qti3-item-player-vue3 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,215 @@
1
+ (function(l,ht){typeof exports=="object"&&typeof module<"u"?module.exports=ht(require("vue")):typeof define=="function"&&define.amd?define(["vue"],ht):(l=typeof globalThis<"u"?globalThis:l||self,l.Qti3Player=ht(l.Vue))})(this,function(l){"use strict";var xk=Object.defineProperty;var Ik=(l,ht,wi)=>ht in l?xk(l,ht,{enumerable:!0,configurable:!0,writable:!0,value:wi}):l[ht]=wi;var Je=(l,ht,wi)=>(Ik(l,typeof ht!="symbol"?ht+"":ht,wi),wi);class ht{constructor(t,i,n){this.fieldIdentifier=t,this.value=n,this.baseType=i,this.cardinality="single"}getValue(){return this.value}setValue(t){this.value=t}getBaseType(){return this.baseType}setBaseType(t){this.baseType=t}getCardinality(){return this.cardinality}getFieldIdentifier(){return this.fieldIdentifier}setFieldIdentifier(t){this.fieldIdentifier=t}}class wi{constructor(){Je(this,"constants",{COLOR_DEFAULT:"qti3-player-color-default",COLOR_DEFAULT_REVERSE:"qti3-player-color-defaultreverse",COLOR_BLACK_WHITE:"qti3-player-color-blackwhite",COLOR_WHITE_BLACK:"qti3-player-color-whiteblack",COLOR_BLACK_ROSE:"qti3-player-color-blackrose",COLOR_ROSE_BLACK:"qti3-player-color-roseblack",COLOR_YELLOW_BLUE:"qti3-player-color-yellowblue",COLOR_BLUE_YELLOW:"qti3-player-color-blueyellow",COLOR_MGRAY_DGRAY:"qti3-player-color-mgraydgray",COLOR_DGRAY_MGRAY:"qti3-player-color-dgraymgray",COLOR_BLACK_CYAN:"qti3-player-color-blackcyan",COLOR_CYAN_BLACK:"qti3-player-color-cyanblack",COLOR_BLACK_CREAM:"qti3-player-color-blackcream",COLOR_CREAM_BLACK:"qti3-player-color-creamblack",GLOSSARY_ON:"glossary-on",GLOSSARY_OFF:"glossary-off",KEYWORD_TRANS_OFF:"ktlang-off",KEYWORD_TRANS_AR:"ktlang-ar",KEYWORD_TRANS_CMN:"ktlang-cmn",KEYWORD_TRANS_DE:"ktlang-de",KEYWORD_TRANS_EN:"ktlang-en",KEYWORD_TRANS_ES:"ktlang-es",KEYWORD_TRANS_FR:"ktlang-fr",KEYWORD_TRANS_HMN:"ktlang-hmn",KEYWORD_TRANS_IT:"ktlang-it",KEYWORD_TRANS_JA:"ktlang-ja",KEYWORD_TRANS_KO:"ktlang-ko",KEYWORD_TRANS_MY:"ktlang-my",KEYWORD_TRANS_NL:"ktlang-nl",KEYWORD_TRANS_PA:"ktlang-pa",KEYWORD_TRANS_RU:"ktlang-ru",KEYWORD_TRANS_SO:"ktlang-so",KEYWORD_TRANS_TL:"ktlang-tl",KEYWORD_TRANS_UK:"ktlang-uk",KEYWORD_TRANS_VI:"ktlang-vi",KEYWORD_TRANS_YUE:"ktlang-yue",KEYWORD_TRANS_ZH:"ktlang-zh",EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:"sbacGlossaryIllustration-on",EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:"sbacGlossaryIllustration-off"});return this.pnp=this.defaultPnp(),this}defaultPnp(){return{textAppearance:{colorStyle:this.constants.COLOR_DEFAULT},glossaryOnScreen:!0,keywordTranslationLanguage:"",extSbacGlossaryIllustration:!1,layoutSingleColumn:!1}}setPnp(t){typeof t>"u"||(t===null&&(this.pnp=this.defaultPnp()),"textAppearance"in t&&t.textAppearance!==null&&"colorStyle"in t.textAppearance&&this.setColorStyle(t.textAppearance.colorStyle),"glossaryOnScreen"in t&&t.glossaryOnScreen!==null&&this.setGlossaryOnScreen(t.glossaryOnScreen),"keywordTranslationLanguage"in t&&this.setKeywordTranslationLanguage(t.keywordTranslationLanguage),"extSbacGlossaryIllustration"in t&&t.extSbacGlossaryIllustration!==null&&this.setExtSbacGlossaryIllustration(t.extSbacGlossaryIllustration),"layoutSingleColumn"in t&&t.layoutSingleColumn!==null&&this.setLayoutSingleColumn(t.layoutSingleColumn))}getPnp(){return this.pnp}getColorStyle(){return this.pnp.textAppearance.colorStyle}setColorStyle(t){this.pnp.textAppearance.colorStyle=t}getGlossaryOnScreen(){return this.pnp.glossaryOnScreen}setGlossaryOnScreen(t){this.pnp.glossaryOnScreen=t}getKeywordTranslationLanguage(){return this.pnp.keywordTranslationLanguage}setKeywordTranslationLanguage(t){this.pnp.keywordTranslationLanguage=t}getExtSbacGlossaryIllustration(){return this.pnp.extSbacGlossaryIllustration}setExtSbacGlossaryIllustration(t){this.pnp.extSbacGlossaryIllustration=t}getLayoutSingleColumn(){return this.pnp.layoutSingleColumn}setLayoutSingleColumn(t){this.pnp.layoutSingleColumn=t}evaluatePnpEvent(t){let i=!1;switch(t){case this.constants.GLOSSARY_ON:this.getGlossaryOnScreen()===!1&&(this.setGlossaryOnScreen(!0),i=!0);break;case this.constants.GLOSSARY_OFF:this.getGlossaryOnScreen()===!0&&(this.setGlossaryOnScreen(!1),i=!0);break;case this.constants.KEYWORD_TRANS_OFF:this.getKeywordTranslationLanguage()!==""&&(this.setKeywordTranslationLanguage(""),i=!0);break;case this.constants.KEYWORD_TRANS_AR:this.getKeywordTranslationLanguage()!=="ar"&&(this.setKeywordTranslationLanguage("ar"),i=!0);break;case this.constants.KEYWORD_TRANS_CMN:this.getKeywordTranslationLanguage()!=="cmn"&&(this.setKeywordTranslationLanguage("cmn"),i=!0);break;case this.constants.KEYWORD_TRANS_DE:this.getKeywordTranslationLanguage()!=="de"&&(this.setKeywordTranslationLanguage("de"),i=!0);break;case this.constants.KEYWORD_TRANS_EN:this.getKeywordTranslationLanguage()!=="en"&&(this.setKeywordTranslationLanguage("en"),i=!0);break;case this.constants.KEYWORD_TRANS_ES:this.getKeywordTranslationLanguage()!=="es"&&(this.setKeywordTranslationLanguage("es"),i=!0);break;case this.constants.KEYWORD_TRANS_FR:this.getKeywordTranslationLanguage()!=="fr"&&(this.setKeywordTranslationLanguage("fr"),i=!0);break;case this.constants.KEYWORD_TRANS_HMN:this.getKeywordTranslationLanguage()!=="hmn"&&(this.setKeywordTranslationLanguage("hmn"),i=!0);break;case this.constants.KEYWORD_TRANS_IT:this.getKeywordTranslationLanguage()!=="it"&&(this.setKeywordTranslationLanguage("it"),i=!0);break;case this.constants.KEYWORD_TRANS_JA:this.getKeywordTranslationLanguage()!=="ja"&&(this.setKeywordTranslationLanguage("ja"),i=!0);break;case this.constants.KEYWORD_TRANS_KO:this.getKeywordTranslationLanguage()!=="ko"&&(this.setKeywordTranslationLanguage("ko"),i=!0);break;case this.constants.KEYWORD_TRANS_MY:this.getKeywordTranslationLanguage()!=="my"&&(this.setKeywordTranslationLanguage("my"),i=!0);break;case this.constants.KEYWORD_TRANS_NL:this.getKeywordTranslationLanguage()!=="nl"&&(this.setKeywordTranslationLanguage("nl"),i=!0);break;case this.constants.KEYWORD_TRANS_PA:this.getKeywordTranslationLanguage()!=="pa"&&(this.setKeywordTranslationLanguage("pa"),i=!0);break;case this.constants.KEYWORD_TRANS_RU:this.getKeywordTranslationLanguage()!=="ru"&&(this.setKeywordTranslationLanguage("ru"),i=!0);break;case this.constants.KEYWORD_TRANS_SO:this.getKeywordTranslationLanguage()!=="so"&&(this.setKeywordTranslationLanguage("so"),i=!0);break;case this.constants.KEYWORD_TRANS_TL:this.getKeywordTranslationLanguage()!=="tl"&&(this.setKeywordTranslationLanguage("tl"),i=!0);break;case this.constants.KEYWORD_TRANS_UK:this.getKeywordTranslationLanguage()!=="uk"&&(this.setKeywordTranslationLanguage("uk"),i=!0);break;case this.constants.KEYWORD_TRANS_VI:this.getKeywordTranslationLanguage()!=="vi"&&(this.setKeywordTranslationLanguage("vi"),i=!0);break;case this.constants.KEYWORD_TRANS_YUE:this.getKeywordTranslationLanguage()!=="yue"&&(this.setKeywordTranslationLanguage("yue"),i=!0);break;case this.constants.KEYWORD_TRANS_ZH:this.getKeywordTranslationLanguage()!=="zh"&&(this.setKeywordTranslationLanguage("zh"),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:this.getExtSbacGlossaryIllustration()===!1&&(this.setExtSbacGlossaryIllustration(!0),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:this.getExtSbacGlossaryIllustration()===!0&&(this.setExtSbacGlossaryIllustration(!1),i=!0);break}return i}}class Dh{constructor(){Je(this,"constants",{TIME_LIMITS_DEFAULT:{min_time:null,max_time:null,allow_late_submission:!1},ATTEMPTS_UNLIMITED:0});return this.sc=this.defaultSessionControl(),this}defaultSessionControl(){return{allow_comment:!1,allow_review:!0,allow_skipping:!0,max_attempts:this.constants.ATTEMPTS_UNLIMITED,show_feedback:!1,show_solution:!1,time_limits:this.constants.TIME_LIMITS_DEFAULT,validate_responses:!1}}setSessionControl(t){typeof t>"u"||(t===null&&(this.sc=this.defaultSessionControl()),"allow_comment"in t&&t.allow_comment!==null&&this.setAllowComment(t.allow_comment),"allow_review"in t&&t.allow_review!==null&&this.setAllowReview(t.allow_review),"allow_skipping"in t&&t.allow_skipping!==null&&this.setAllowSkipping(t.allow_skipping),"max_attempts"in t&&t.max_attempts!==null&&this.setMaxAttempts(t.max_attempts),"show_feedback"in t&&t.show_feedback!==null&&this.setShowFeedback(t.show_feedback),"show_solution"in t&&t.show_solution!==null&&this.setShowSolution(t.show_solution),"time_limits"in t&&t.time_limits!==null&&("min_time"in t.time_limits&&this.setTimeLimitsMinTime(t.time_limits.min_time),"max_time"in t.time_limits&&this.setTimeLimitsMaxTime(t.time_limits.max_time),"allow_late_submission"in t.time_limits&&this.setTimeLimitsAllowLateSubmission(t.time_limits.allow_late_submission)),"validate_responses"in t&&t.validate_responses!==null&&this.setValidateResponses(t.validate_responses))}getSessionControl(){return{allow_comment:this.getAllowComment(),allow_review:this.getAllowReview(),allow_skipping:this.getAllowSkipping(),max_attempts:this.getMaxAttempts(),show_feedback:this.getShowFeedback(),show_solution:this.getShowSolution(),time_limits:this.getTimeLimits(),validate_responses:this.getValidateResponses()}}getAllowComment(){return this.sc.allow_comment}setAllowComment(t){this.sc.allow_comment=t}getAllowReview(){return this.sc.allow_review}setAllowReview(t){this.sc.allow_review=t}getAllowSkipping(){return this.sc.allow_skipping}setAllowSkipping(t){this.allow_skipping=t}getMaxAttempts(){return this.sc.max_attempts}setMaxAttempts(t){this.sc.max_attempts=t}getShowFeedback(){return this.sc.show_feedback}setShowFeedback(t){this.sc.show_feedback=t}getShowSolution(){return this.sc.show_solution}setShowSolution(t){this.sc.show_solution=t}getTimeLimits(){return this.sc.time_limits}setTimeLimits(t=null,i=null,n=!1){this.setTimeLimitsMinTime(t),this.setTimeLimitsMaxTime(i),this.setTimeLimitsAllowLateSubmission(n)}getTimeLimitsMinTime(){return this.sc.time_limits.min_time}setTimeLimitsMinTime(t){this.sc.time_limits.min_time=t}getTimeLimitsMaxTime(){return this.sc.time_limits.max_time}setTimeLimitsMaxTime(t){this.sc.time_limits.max_time=t}getTimeLimitsAllowLateSubmission(){return this.sc.time_limits.allow_late_submission}setTimeLimitsAllowLateSubmission(t){this.sc.time_limits.allow_late_submission=t}getValidateResponses(){return this.sc.validate_responses}setValidateResponses(t){this.sc.validate_responses=t}}class Fr{constructor(t,i){return typeof t>"u"?this:(this.identifier=t,this.guid=i.getItemContextGuid(),this.contextVariables=i.getContextDeclarations(),this.responseVariables=i.getResponseDeclarations(),this.templateVariables=i.getTemplateDeclarations(),this.outcomeVariables=i.getOutcomeDeclarations(),this.validationMessages=i.getItemContextValidationMessages(),this)}createStateFromState(t){return this.identifier=t.identifier,this.guid=t.guid,this.contextVariables=t.contextVariables,this.responseVariables=t.responseVariables,this.templateVariables=t.templateVariables,this.outcomeVariables=t.outcomeVariables,this.validationMessages=t.validationMessages,this.getSerializedState()}getSerializedState(){return{identifier:this.identifier,guid:this.guid,contextVariables:this.serializeVariables(this.contextVariables),responseVariables:this.serializeResponseVariables(this.responseVariables),outcomeVariables:this.serializeOutcomeVariables(this.outcomeVariables),templateVariables:this.serializeVariables(this.templateVariables),validationMessages:this.serializeValidationMessages(this.validationMessages)}}serializeResponseVariables(t){let i=[];return t.forEach(n=>{let s={identifier:n.identifier,cardinality:n.cardinality,baseType:this.resolveBaseType(n.baseType),value:this.serializeVariableValue(n.cardinality,n.value),state:this.serializeVariableState(n.state)};"correctResponse"in n&&(s.correctResponse=this.serializeVariableValue(n.cardinality,n.correctResponse)),i.push(s)}),i}serializeOutcomeVariables(t){let i=[];return t.forEach(n=>{i.push({identifier:n.identifier,cardinality:n.cardinality,baseType:this.resolveBaseType(n.baseType),value:this.serializeVariableValue(n.cardinality,n.value),view:n.view,interpretation:n.interpretation,longInterpretation:n.longInterpretation,normalMaximum:n.normalMaximum,normalMinimum:n.normalMinimum,masteryValue:n.masteryValue,externalScored:n.externalScored,variableIdentifierRef:n.variableIdentifierRef})}),i}serializeVariables(t){let i=[];return t.forEach(n=>{i.push({identifier:n.identifier,cardinality:n.cardinality,baseType:this.resolveBaseType(n.baseType),value:this.serializeVariableValue(n.cardinality,n.value)})}),i}serializeValidationMessages(t){let i=[];return t.forEach(n=>{i.push({identifier:n.identifier,message:n.message})}),i}serializeVariableValue(t,i){return t!=="record"?JSON.parse(JSON.stringify(i)):this.serializeRecordVariableValue(i)}serializeVariableState(t){return JSON.parse(JSON.stringify(t))}resolveBaseType(t){return typeof t>"u"?null:t}serializeRecordVariableValue(t){const i=this.strMapToJson(t);return this.jsonToStrMap(i)}strMapToJson(t){return JSON.stringify(this.strMapToObj(t))}jsonToStrMap(t){return this.objToStrMap(JSON.parse(t))}strMapToObj(t){let i=Object.create(null);for(let[n,s]of t)i[n]=typeof s=="object"&&s!==null?s.getValue():s;return i}objToStrMap(t){let i=new Map;for(let n of Object.keys(t))i.set(n,t[n]);return i}}class Qh{constructor(){Je(this,"itemTimer");Je(this,"itemDuration");this.setTime(0)}getTime(){return this.itemDuration}setTime(t){this.itemDuration=t}startTimer(){this.clearTimer(),this.setTime(0),this.itemTimer=setInterval(this.updateTime.bind(this),1e3)}updateTime(){++this.itemDuration}resetTimer(){this.clearTimer(),this.setTime(0)}clearTimer(){clearInterval(this.itemTimer)}}var Hh=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ur=Math.ceil,At=Math.floor,gt="[BigNumber Error] ",$o=gt+"Number primitive has more than 15 significant digits: ",qt=1e14,ke=14,Gr=9007199254740991,jr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],oi=1e7,rt=1e9;function No(e){var t,i,n,s=m.prototype={constructor:m,toString:null,valueOf:null},r=new m(1),a=20,c=4,y=-7,w=21,f=-1e7,g=1e7,p=!1,d=1,S=0,b={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},_="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function m(v,V){var C,x,I,k,N,M,D,Q,H=this;if(!(H instanceof m))return new m(v,V);if(V==null){if(v&&v._isBigNumber===!0){H.s=v.s,!v.c||v.e>g?H.c=H.e=null:v.e<f?H.c=[H.e=0]:(H.e=v.e,H.c=v.c.slice());return}if((M=typeof v=="number")&&v*0==0){if(H.s=1/v<0?(v=-v,-1):1,v===~~v){for(k=0,N=v;N>=10;N/=10,k++);k>g?H.c=H.e=null:(H.e=k,H.c=[v]);return}Q=String(v)}else{if(!Hh.test(Q=String(v)))return n(H,Q,M);H.s=Q.charCodeAt(0)==45?(Q=Q.slice(1),-1):1}(k=Q.indexOf("."))>-1&&(Q=Q.replace(".","")),(N=Q.search(/e/i))>0?(k<0&&(k=N),k+=+Q.slice(N+1),Q=Q.substring(0,N)):k<0&&(k=Q.length)}else{if(je(V,2,_.length,"Base"),V==10&&E)return H=new m(v),P(H,a+H.e+1,c);if(Q=String(v),M=typeof v=="number"){if(v*0!=0)return n(H,Q,M,V);if(H.s=1/v<0?(Q=Q.slice(1),-1):1,m.DEBUG&&Q.replace(/^0\.0*|\./,"").length>15)throw Error($o+v)}else H.s=Q.charCodeAt(0)===45?(Q=Q.slice(1),-1):1;for(C=_.slice(0,V),k=N=0,D=Q.length;N<D;N++)if(C.indexOf(x=Q.charAt(N))<0){if(x=="."){if(N>k){k=D;continue}}else if(!I&&(Q==Q.toUpperCase()&&(Q=Q.toLowerCase())||Q==Q.toLowerCase()&&(Q=Q.toUpperCase()))){I=!0,N=-1,k=0;continue}return n(H,String(v),M,V)}M=!1,Q=i(Q,V,10,H.s),(k=Q.indexOf("."))>-1?Q=Q.replace(".",""):k=Q.length}for(N=0;Q.charCodeAt(N)===48;N++);for(D=Q.length;Q.charCodeAt(--D)===48;);if(Q=Q.slice(N,++D)){if(D-=N,M&&m.DEBUG&&D>15&&(v>Gr||v!==At(v)))throw Error($o+H.s*v);if((k=k-N-1)>g)H.c=H.e=null;else if(k<f)H.c=[H.e=0];else{if(H.e=k,H.c=[],N=(k+1)%ke,k<0&&(N+=ke),N<D){for(N&&H.c.push(+Q.slice(0,N)),D-=ke;N<D;)H.c.push(+Q.slice(N,N+=ke));N=ke-(Q=Q.slice(N)).length}else N-=D;for(;N--;Q+="0");H.c.push(+Q)}}else H.c=[H.e=0]}m.clone=No,m.ROUND_UP=0,m.ROUND_DOWN=1,m.ROUND_CEIL=2,m.ROUND_FLOOR=3,m.ROUND_HALF_UP=4,m.ROUND_HALF_DOWN=5,m.ROUND_HALF_EVEN=6,m.ROUND_HALF_CEIL=7,m.ROUND_HALF_FLOOR=8,m.EUCLID=9,m.config=m.set=function(v){var V,C;if(v!=null)if(typeof v=="object"){if(v.hasOwnProperty(V="DECIMAL_PLACES")&&(C=v[V],je(C,0,rt,V),a=C),v.hasOwnProperty(V="ROUNDING_MODE")&&(C=v[V],je(C,0,8,V),c=C),v.hasOwnProperty(V="EXPONENTIAL_AT")&&(C=v[V],C&&C.pop?(je(C[0],-rt,0,V),je(C[1],0,rt,V),y=C[0],w=C[1]):(je(C,-rt,rt,V),y=-(w=C<0?-C:C))),v.hasOwnProperty(V="RANGE"))if(C=v[V],C&&C.pop)je(C[0],-rt,-1,V),je(C[1],1,rt,V),f=C[0],g=C[1];else if(je(C,-rt,rt,V),C)f=-(g=C<0?-C:C);else throw Error(gt+V+" cannot be zero: "+C);if(v.hasOwnProperty(V="CRYPTO"))if(C=v[V],C===!!C)if(C)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=C;else throw p=!C,Error(gt+"crypto unavailable");else p=C;else throw Error(gt+V+" not true or false: "+C);if(v.hasOwnProperty(V="MODULO_MODE")&&(C=v[V],je(C,0,9,V),d=C),v.hasOwnProperty(V="POW_PRECISION")&&(C=v[V],je(C,0,rt,V),S=C),v.hasOwnProperty(V="FORMAT"))if(C=v[V],typeof C=="object")b=C;else throw Error(gt+V+" not an object: "+C);if(v.hasOwnProperty(V="ALPHABET"))if(C=v[V],typeof C=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(C))E=C.slice(0,10)=="0123456789",_=C;else throw Error(gt+V+" invalid: "+C)}else throw Error(gt+"Object expected: "+v);return{DECIMAL_PLACES:a,ROUNDING_MODE:c,EXPONENTIAL_AT:[y,w],RANGE:[f,g],CRYPTO:p,MODULO_MODE:d,POW_PRECISION:S,FORMAT:b,ALPHABET:_}},m.isBigNumber=function(v){if(!v||v._isBigNumber!==!0)return!1;if(!m.DEBUG)return!0;var V,C,x=v.c,I=v.e,k=v.s;e:if({}.toString.call(x)=="[object Array]"){if((k===1||k===-1)&&I>=-rt&&I<=rt&&I===At(I)){if(x[0]===0){if(I===0&&x.length===1)return!0;break e}if(V=(I+1)%ke,V<1&&(V+=ke),String(x[0]).length==V){for(V=0;V<x.length;V++)if(C=x[V],C<0||C>=qt||C!==At(C))break e;if(C!==0)return!0}}}else if(x===null&&I===null&&(k===null||k===1||k===-1))return!0;throw Error(gt+"Invalid BigNumber: "+v)},m.maximum=m.max=function(){return u(arguments,-1)},m.minimum=m.min=function(){return u(arguments,1)},m.random=function(){var v=9007199254740992,V=Math.random()*v&2097151?function(){return At(Math.random()*v)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(C){var x,I,k,N,M,D=0,Q=[],H=new m(r);if(C==null?C=a:je(C,0,rt),N=Ur(C/ke),p)if(crypto.getRandomValues){for(x=crypto.getRandomValues(new Uint32Array(N*=2));D<N;)M=x[D]*131072+(x[D+1]>>>11),M>=9e15?(I=crypto.getRandomValues(new Uint32Array(2)),x[D]=I[0],x[D+1]=I[1]):(Q.push(M%1e14),D+=2);D=N/2}else if(crypto.randomBytes){for(x=crypto.randomBytes(N*=7);D<N;)M=(x[D]&31)*281474976710656+x[D+1]*1099511627776+x[D+2]*4294967296+x[D+3]*16777216+(x[D+4]<<16)+(x[D+5]<<8)+x[D+6],M>=9e15?crypto.randomBytes(7).copy(x,D):(Q.push(M%1e14),D+=7);D=N/7}else throw p=!1,Error(gt+"crypto unavailable");if(!p)for(;D<N;)M=V(),M<9e15&&(Q[D++]=M%1e14);for(N=Q[--D],C%=ke,N&&C&&(M=jr[ke-C],Q[D]=At(N/M)*M);Q[D]===0;Q.pop(),D--);if(D<0)Q=[k=0];else{for(k=-1;Q[0]===0;Q.splice(0,1),k-=ke);for(D=1,M=Q[0];M>=10;M/=10,D++);D<ke&&(k-=ke-D)}return H.e=k,H.c=Q,H}}(),m.sum=function(){for(var v=1,V=arguments,C=new m(V[0]);v<V.length;)C=C.plus(V[v++]);return C},i=function(){var v="0123456789";function V(C,x,I,k){for(var N,M=[0],D,Q=0,H=C.length;Q<H;){for(D=M.length;D--;M[D]*=x);for(M[0]+=k.indexOf(C.charAt(Q++)),N=0;N<M.length;N++)M[N]>I-1&&(M[N+1]==null&&(M[N+1]=0),M[N+1]+=M[N]/I|0,M[N]%=I)}return M.reverse()}return function(C,x,I,k,N){var M,D,Q,H,j,G,B,U,L=C.indexOf("."),X=a,K=c;for(L>=0&&(H=S,S=0,C=C.replace(".",""),U=new m(x),G=U.pow(C.length-L),S=H,U.c=V(Jt(Ot(G.c),G.e,"0"),10,I,v),U.e=U.c.length),B=V(C,x,I,N?(M=_,v):(M=v,_)),Q=H=B.length;B[--H]==0;B.pop());if(!B[0])return M.charAt(0);if(L<0?--Q:(G.c=B,G.e=Q,G.s=k,G=t(G,U,X,K,I),B=G.c,j=G.r,Q=G.e),D=Q+X+1,L=B[D],H=I/2,j=j||D<0||B[D+1]!=null,j=K<4?(L!=null||j)&&(K==0||K==(G.s<0?3:2)):L>H||L==H&&(K==4||j||K==6&&B[D-1]&1||K==(G.s<0?8:7)),D<1||!B[0])C=j?Jt(M.charAt(1),-X,M.charAt(0)):M.charAt(0);else{if(B.length=D,j)for(--I;++B[--D]>I;)B[D]=0,D||(++Q,B=[1].concat(B));for(H=B.length;!B[--H];);for(L=0,C="";L<=H;C+=M.charAt(B[L++]));C=Jt(C,Q,M.charAt(0))}return C}}(),t=function(){function v(x,I,k){var N,M,D,Q,H=0,j=x.length,G=I%oi,B=I/oi|0;for(x=x.slice();j--;)D=x[j]%oi,Q=x[j]/oi|0,N=B*D+Q*G,M=G*D+N%oi*oi+H,H=(M/k|0)+(N/oi|0)+B*Q,x[j]=M%k;return H&&(x=[H].concat(x)),x}function V(x,I,k,N){var M,D;if(k!=N)D=k>N?1:-1;else for(M=D=0;M<k;M++)if(x[M]!=I[M]){D=x[M]>I[M]?1:-1;break}return D}function C(x,I,k,N){for(var M=0;k--;)x[k]-=M,M=x[k]<I[k]?1:0,x[k]=M*N+x[k]-I[k];for(;!x[0]&&x.length>1;x.splice(0,1));}return function(x,I,k,N,M){var D,Q,H,j,G,B,U,L,X,K,F,Y,Z,J,le,de,Se,ve=x.s==I.s?1:-1,Ee=x.c,be=I.c;if(!Ee||!Ee[0]||!be||!be[0])return new m(!x.s||!I.s||(Ee?be&&Ee[0]==be[0]:!be)?NaN:Ee&&Ee[0]==0||!be?ve*0:ve/0);for(L=new m(ve),X=L.c=[],Q=x.e-I.e,ve=k+Q+1,M||(M=qt,Q=kt(x.e/ke)-kt(I.e/ke),ve=ve/ke|0),H=0;be[H]==(Ee[H]||0);H++);if(be[H]>(Ee[H]||0)&&Q--,ve<0)X.push(1),j=!0;else{for(J=Ee.length,de=be.length,H=0,ve+=2,G=At(M/(be[0]+1)),G>1&&(be=v(be,G,M),Ee=v(Ee,G,M),de=be.length,J=Ee.length),Z=de,K=Ee.slice(0,de),F=K.length;F<de;K[F++]=0);Se=be.slice(),Se=[0].concat(Se),le=be[0],be[1]>=M/2&&le++;do{if(G=0,D=V(be,K,de,F),D<0){if(Y=K[0],de!=F&&(Y=Y*M+(K[1]||0)),G=At(Y/le),G>1)for(G>=M&&(G=M-1),B=v(be,G,M),U=B.length,F=K.length;V(B,K,U,F)==1;)G--,C(B,de<U?Se:be,U,M),U=B.length,D=1;else G==0&&(D=G=1),B=be.slice(),U=B.length;if(U<F&&(B=[0].concat(B)),C(K,B,F,M),F=K.length,D==-1)for(;V(be,K,de,F)<1;)G++,C(K,de<F?Se:be,F,M),F=K.length}else D===0&&(G++,K=[0]);X[H++]=G,K[0]?K[F++]=Ee[Z]||0:(K=[Ee[Z]],F=1)}while((Z++<J||K[0]!=null)&&ve--);j=K[0]!=null,X[0]||X.splice(0,1)}if(M==qt){for(H=1,ve=X[0];ve>=10;ve/=10,H++);P(L,k+(L.e=H+Q*ke-1)+1,N,j)}else L.e=Q,L.r=+j;return L}}();function A(v,V,C,x){var I,k,N,M,D;if(C==null?C=c:je(C,0,8),!v.c)return v.toString();if(I=v.c[0],N=v.e,V==null)D=Ot(v.c),D=x==1||x==2&&(N<=y||N>=w)?Os(D,N):Jt(D,N,"0");else if(v=P(new m(v),V,C),k=v.e,D=Ot(v.c),M=D.length,x==1||x==2&&(V<=k||k<=y)){for(;M<V;D+="0",M++);D=Os(D,k)}else if(V-=N,D=Jt(D,k,"0"),k+1>M){if(--V>0)for(D+=".";V--;D+="0");}else if(V+=k-M,V>0)for(k+1==M&&(D+=".");V--;D+="0");return v.s<0&&I?"-"+D:D}function u(v,V){for(var C,x,I=1,k=new m(v[0]);I<v.length;I++)x=new m(v[I]),(!x.s||(C=bi(k,x))===V||C===0&&k.s===V)&&(k=x);return k}function O(v,V,C){for(var x=1,I=V.length;!V[--I];V.pop());for(I=V[0];I>=10;I/=10,x++);return(C=x+C*ke-1)>g?v.c=v.e=null:C<f?v.c=[v.e=0]:(v.e=C,v.c=V),v}n=function(){var v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,V=/^([^.]+)\.$/,C=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(k,N,M,D){var Q,H=M?N:N.replace(I,"");if(x.test(H))k.s=isNaN(H)?null:H<0?-1:1;else{if(!M&&(H=H.replace(v,function(j,G,B){return Q=(B=B.toLowerCase())=="x"?16:B=="b"?2:8,!D||D==Q?G:j}),D&&(Q=D,H=H.replace(V,"$1").replace(C,"0.$1")),N!=H))return new m(H,Q);if(m.DEBUG)throw Error(gt+"Not a"+(D?" base "+D:"")+" number: "+N);k.s=null}k.c=k.e=null}}();function P(v,V,C,x){var I,k,N,M,D,Q,H,j=v.c,G=jr;if(j){e:{for(I=1,M=j[0];M>=10;M/=10,I++);if(k=V-I,k<0)k+=ke,N=V,D=j[Q=0],H=At(D/G[I-N-1]%10);else if(Q=Ur((k+1)/ke),Q>=j.length)if(x){for(;j.length<=Q;j.push(0));D=H=0,I=1,k%=ke,N=k-ke+1}else break e;else{for(D=M=j[Q],I=1;M>=10;M/=10,I++);k%=ke,N=k-ke+I,H=N<0?0:At(D/G[I-N-1]%10)}if(x=x||V<0||j[Q+1]!=null||(N<0?D:D%G[I-N-1]),x=C<4?(H||x)&&(C==0||C==(v.s<0?3:2)):H>5||H==5&&(C==4||x||C==6&&(k>0?N>0?D/G[I-N]:0:j[Q-1])%10&1||C==(v.s<0?8:7)),V<1||!j[0])return j.length=0,x?(V-=v.e+1,j[0]=G[(ke-V%ke)%ke],v.e=-V||0):j[0]=v.e=0,v;if(k==0?(j.length=Q,M=1,Q--):(j.length=Q+1,M=G[ke-k],j[Q]=N>0?At(D/G[I-N]%G[N])*M:0),x)for(;;)if(Q==0){for(k=1,N=j[0];N>=10;N/=10,k++);for(N=j[0]+=M,M=1;N>=10;N/=10,M++);k!=M&&(v.e++,j[0]==qt&&(j[0]=1));break}else{if(j[Q]+=M,j[Q]!=qt)break;j[Q--]=0,M=1}for(k=j.length;j[--k]===0;j.pop());}v.e>g?v.c=v.e=null:v.e<f&&(v.c=[v.e=0])}return v}function q(v){var V,C=v.e;return C===null?v.toString():(V=Ot(v.c),V=C<=y||C>=w?Os(V,C):Jt(V,C,"0"),v.s<0?"-"+V:V)}return s.absoluteValue=s.abs=function(){var v=new m(this);return v.s<0&&(v.s=1),v},s.comparedTo=function(v,V){return bi(this,new m(v,V))},s.decimalPlaces=s.dp=function(v,V){var C,x,I,k=this;if(v!=null)return je(v,0,rt),V==null?V=c:je(V,0,8),P(new m(k),v+k.e+1,V);if(!(C=k.c))return null;if(x=((I=C.length-1)-kt(this.e/ke))*ke,I=C[I])for(;I%10==0;I/=10,x--);return x<0&&(x=0),x},s.dividedBy=s.div=function(v,V){return t(this,new m(v,V),a,c)},s.dividedToIntegerBy=s.idiv=function(v,V){return t(this,new m(v,V),0,1)},s.exponentiatedBy=s.pow=function(v,V){var C,x,I,k,N,M,D,Q,H,j=this;if(v=new m(v),v.c&&!v.isInteger())throw Error(gt+"Exponent not an integer: "+q(v));if(V!=null&&(V=new m(V)),M=v.e>14,!j.c||!j.c[0]||j.c[0]==1&&!j.e&&j.c.length==1||!v.c||!v.c[0])return H=new m(Math.pow(+q(j),M?v.s*(2-ks(v)):+q(v))),V?H.mod(V):H;if(D=v.s<0,V){if(V.c?!V.c[0]:!V.s)return new m(NaN);x=!D&&j.isInteger()&&V.isInteger(),x&&(j=j.mod(V))}else{if(v.e>9&&(j.e>0||j.e<-1||(j.e==0?j.c[0]>1||M&&j.c[1]>=24e7:j.c[0]<8e13||M&&j.c[0]<=9999975e7)))return k=j.s<0&&ks(v)?-0:0,j.e>-1&&(k=1/k),new m(D?1/k:k);S&&(k=Ur(S/ke+2))}for(M?(C=new m(.5),D&&(v.s=1),Q=ks(v)):(I=Math.abs(+q(v)),Q=I%2),H=new m(r);;){if(Q){if(H=H.times(j),!H.c)break;k?H.c.length>k&&(H.c.length=k):x&&(H=H.mod(V))}if(I){if(I=At(I/2),I===0)break;Q=I%2}else if(v=v.times(C),P(v,v.e+1,1),v.e>14)Q=ks(v);else{if(I=+q(v),I===0)break;Q=I%2}j=j.times(j),k?j.c&&j.c.length>k&&(j.c.length=k):x&&(j=j.mod(V))}return x?H:(D&&(H=r.div(H)),V?H.mod(V):k?P(H,S,c,N):H)},s.integerValue=function(v){var V=new m(this);return v==null?v=c:je(v,0,8),P(V,V.e+1,v)},s.isEqualTo=s.eq=function(v,V){return bi(this,new m(v,V))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(v,V){return bi(this,new m(v,V))>0},s.isGreaterThanOrEqualTo=s.gte=function(v,V){return(V=bi(this,new m(v,V)))===1||V===0},s.isInteger=function(){return!!this.c&&kt(this.e/ke)>this.c.length-2},s.isLessThan=s.lt=function(v,V){return bi(this,new m(v,V))<0},s.isLessThanOrEqualTo=s.lte=function(v,V){return(V=bi(this,new m(v,V)))===-1||V===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(v,V){var C,x,I,k,N=this,M=N.s;if(v=new m(v,V),V=v.s,!M||!V)return new m(NaN);if(M!=V)return v.s=-V,N.plus(v);var D=N.e/ke,Q=v.e/ke,H=N.c,j=v.c;if(!D||!Q){if(!H||!j)return H?(v.s=-V,v):new m(j?N:NaN);if(!H[0]||!j[0])return j[0]?(v.s=-V,v):new m(H[0]?N:c==3?-0:0)}if(D=kt(D),Q=kt(Q),H=H.slice(),M=D-Q){for((k=M<0)?(M=-M,I=H):(Q=D,I=j),I.reverse(),V=M;V--;I.push(0));I.reverse()}else for(x=(k=(M=H.length)<(V=j.length))?M:V,M=V=0;V<x;V++)if(H[V]!=j[V]){k=H[V]<j[V];break}if(k&&(I=H,H=j,j=I,v.s=-v.s),V=(x=j.length)-(C=H.length),V>0)for(;V--;H[C++]=0);for(V=qt-1;x>M;){if(H[--x]<j[x]){for(C=x;C&&!H[--C];H[C]=V);--H[C],H[x]+=qt}H[x]-=j[x]}for(;H[0]==0;H.splice(0,1),--Q);return H[0]?O(v,H,Q):(v.s=c==3?-1:1,v.c=[v.e=0],v)},s.modulo=s.mod=function(v,V){var C,x,I=this;return v=new m(v,V),!I.c||!v.s||v.c&&!v.c[0]?new m(NaN):!v.c||I.c&&!I.c[0]?new m(I):(d==9?(x=v.s,v.s=1,C=t(I,v,0,3),v.s=x,C.s*=x):C=t(I,v,0,d),v=I.minus(C.times(v)),!v.c[0]&&d==1&&(v.s=I.s),v)},s.multipliedBy=s.times=function(v,V){var C,x,I,k,N,M,D,Q,H,j,G,B,U,L,X,K=this,F=K.c,Y=(v=new m(v,V)).c;if(!F||!Y||!F[0]||!Y[0])return!K.s||!v.s||F&&!F[0]&&!Y||Y&&!Y[0]&&!F?v.c=v.e=v.s=null:(v.s*=K.s,!F||!Y?v.c=v.e=null:(v.c=[0],v.e=0)),v;for(x=kt(K.e/ke)+kt(v.e/ke),v.s*=K.s,D=F.length,j=Y.length,D<j&&(U=F,F=Y,Y=U,I=D,D=j,j=I),I=D+j,U=[];I--;U.push(0));for(L=qt,X=oi,I=j;--I>=0;){for(C=0,G=Y[I]%X,B=Y[I]/X|0,N=D,k=I+N;k>I;)Q=F[--N]%X,H=F[N]/X|0,M=B*Q+H*G,Q=G*Q+M%X*X+U[k]+C,C=(Q/L|0)+(M/X|0)+B*H,U[k--]=Q%L;U[k]=C}return C?++x:U.splice(0,1),O(v,U,x)},s.negated=function(){var v=new m(this);return v.s=-v.s||null,v},s.plus=function(v,V){var C,x=this,I=x.s;if(v=new m(v,V),V=v.s,!I||!V)return new m(NaN);if(I!=V)return v.s=-V,x.minus(v);var k=x.e/ke,N=v.e/ke,M=x.c,D=v.c;if(!k||!N){if(!M||!D)return new m(I/0);if(!M[0]||!D[0])return D[0]?v:new m(M[0]?x:I*0)}if(k=kt(k),N=kt(N),M=M.slice(),I=k-N){for(I>0?(N=k,C=D):(I=-I,C=M),C.reverse();I--;C.push(0));C.reverse()}for(I=M.length,V=D.length,I-V<0&&(C=D,D=M,M=C,V=I),I=0;V;)I=(M[--V]=M[V]+D[V]+I)/qt|0,M[V]=qt===M[V]?0:M[V]%qt;return I&&(M=[I].concat(M),++N),O(v,M,N)},s.precision=s.sd=function(v,V){var C,x,I,k=this;if(v!=null&&v!==!!v)return je(v,1,rt),V==null?V=c:je(V,0,8),P(new m(k),v,V);if(!(C=k.c))return null;if(I=C.length-1,x=I*ke+1,I=C[I]){for(;I%10==0;I/=10,x--);for(I=C[0];I>=10;I/=10,x++);}return v&&k.e+1>x&&(x=k.e+1),x},s.shiftedBy=function(v){return je(v,-Gr,Gr),this.times("1e"+v)},s.squareRoot=s.sqrt=function(){var v,V,C,x,I,k=this,N=k.c,M=k.s,D=k.e,Q=a+4,H=new m("0.5");if(M!==1||!N||!N[0])return new m(!M||M<0&&(!N||N[0])?NaN:N?k:1/0);if(M=Math.sqrt(+q(k)),M==0||M==1/0?(V=Ot(N),(V.length+D)%2==0&&(V+="0"),M=Math.sqrt(+V),D=kt((D+1)/2)-(D<0||D%2),M==1/0?V="5e"+D:(V=M.toExponential(),V=V.slice(0,V.indexOf("e")+1)+D),C=new m(V)):C=new m(M+""),C.c[0]){for(D=C.e,M=D+Q,M<3&&(M=0);;)if(I=C,C=H.times(I.plus(t(k,I,Q,1))),Ot(I.c).slice(0,M)===(V=Ot(C.c)).slice(0,M))if(C.e<D&&--M,V=V.slice(M-3,M+1),V=="9999"||!x&&V=="4999"){if(!x&&(P(I,I.e+a+2,0),I.times(I).eq(k))){C=I;break}Q+=4,M+=4,x=1}else{(!+V||!+V.slice(1)&&V.charAt(0)=="5")&&(P(C,C.e+a+2,1),v=!C.times(C).eq(k));break}}return P(C,C.e+a+1,c,v)},s.toExponential=function(v,V){return v!=null&&(je(v,0,rt),v++),A(this,v,V,1)},s.toFixed=function(v,V){return v!=null&&(je(v,0,rt),v=v+this.e+1),A(this,v,V)},s.toFormat=function(v,V,C){var x,I=this;if(C==null)v!=null&&V&&typeof V=="object"?(C=V,V=null):v&&typeof v=="object"?(C=v,v=V=null):C=b;else if(typeof C!="object")throw Error(gt+"Argument not an object: "+C);if(x=I.toFixed(v,V),I.c){var k,N=x.split("."),M=+C.groupSize,D=+C.secondaryGroupSize,Q=C.groupSeparator||"",H=N[0],j=N[1],G=I.s<0,B=G?H.slice(1):H,U=B.length;if(D&&(k=M,M=D,D=k,U-=k),M>0&&U>0){for(k=U%M||M,H=B.substr(0,k);k<U;k+=M)H+=Q+B.substr(k,M);D>0&&(H+=Q+B.slice(k)),G&&(H="-"+H)}x=j?H+(C.decimalSeparator||"")+((D=+C.fractionGroupSize)?j.replace(new RegExp("\\d{"+D+"}\\B","g"),"$&"+(C.fractionGroupSeparator||"")):j):H}return(C.prefix||"")+x+(C.suffix||"")},s.toFraction=function(v){var V,C,x,I,k,N,M,D,Q,H,j,G,B=this,U=B.c;if(v!=null&&(M=new m(v),!M.isInteger()&&(M.c||M.s!==1)||M.lt(r)))throw Error(gt+"Argument "+(M.isInteger()?"out of range: ":"not an integer: ")+q(M));if(!U)return new m(B);for(V=new m(r),Q=C=new m(r),x=D=new m(r),G=Ot(U),k=V.e=G.length-B.e-1,V.c[0]=jr[(N=k%ke)<0?ke+N:N],v=!v||M.comparedTo(V)>0?k>0?V:Q:M,N=g,g=1/0,M=new m(G),D.c[0]=0;H=t(M,V,0,1),I=C.plus(H.times(x)),I.comparedTo(v)!=1;)C=x,x=I,Q=D.plus(H.times(I=Q)),D=I,V=M.minus(H.times(I=V)),M=I;return I=t(v.minus(C),x,0,1),D=D.plus(I.times(Q)),C=C.plus(I.times(x)),D.s=Q.s=B.s,k=k*2,j=t(Q,x,k,c).minus(B).abs().comparedTo(t(D,C,k,c).minus(B).abs())<1?[Q,x]:[D,C],g=N,j},s.toNumber=function(){return+q(this)},s.toPrecision=function(v,V){return v!=null&&je(v,1,rt),A(this,v,V,2)},s.toString=function(v){var V,C=this,x=C.s,I=C.e;return I===null?x?(V="Infinity",x<0&&(V="-"+V)):V="NaN":(v==null?V=I<=y||I>=w?Os(Ot(C.c),I):Jt(Ot(C.c),I,"0"):v===10&&E?(C=P(new m(C),a+I+1,c),V=Jt(Ot(C.c),C.e,"0")):(je(v,2,_.length,"Base"),V=i(Jt(Ot(C.c),I,"0"),10,v,x,!0)),x<0&&C.c[0]&&(V="-"+V)),V},s.valueOf=s.toJSON=function(){return q(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&m.set(e),m}function kt(e){var t=e|0;return e>0||e===t?t:t-1}function Ot(e){for(var t,i,n=1,s=e.length,r=e[0]+"";n<s;){for(t=e[n++]+"",i=ke-t.length;i--;t="0"+t);r+=t}for(s=r.length;r.charCodeAt(--s)===48;);return r.slice(0,s+1||1)}function bi(e,t){var i,n,s=e.c,r=t.c,a=e.s,c=t.s,y=e.e,w=t.e;if(!a||!c)return null;if(i=s&&!s[0],n=r&&!r[0],i||n)return i?n?0:-c:a;if(a!=c)return a;if(i=a<0,n=y==w,!s||!r)return n?0:!s^i?1:-1;if(!n)return y>w^i?1:-1;for(c=(y=s.length)<(w=r.length)?y:w,a=0;a<c;a++)if(s[a]!=r[a])return s[a]>r[a]^i?1:-1;return y==w?0:y>w^i?1:-1}function je(e,t,i,n){if(e<t||e>i||e!==At(e))throw Error(gt+(n||"Argument")+(typeof e=="number"?e<t||e>i?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ks(e){var t=e.c.length-1;return kt(e.e/ke)==t&&e.c[t]%2!=0}function Os(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Jt(e,t,i){var n,s;if(t<0){for(s=i+".";++t;s+=i);e=s+e}else if(n=e.length,++t>n){for(s=i,t-=n;--t;s+=i);e+=s}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var ce=No();class ee extends Error{constructor(t){super(t),this.name="QtiEvaluationException"}}class me{QTI_RESPONSE_RULES(){return["qti-response-processing-fragment","qti-response-condition","qti-set-outcome-value","qti-lookup-outcome-value","qti-get-outcome-value","qti-exit-response"]}QTI_TEMPLATE_RULES(){return["qti-set-template-value","qti-exit-template","qti-template-condition","qti-set-default-value","qti-set-correct-response","qti-template-constraint"]}QTI_EXPRESSIONS(){return["qti-base-value","qti-variable","qti-correct","qti-default","qti-is-null","qti-null","qti-and","qti-or","qti-not","qti-match","qti-map-response","qti-member","qti-subtract","qti-sum","qti-random","qti-random-float","qti-random-integer","qti-index","qti-integer-divide","qti-integer-modulus","qti-integer-to-float","qti-equal","qti-equal-rounded","qti-field-value","qti-multiple","qti-ordered","qti-map-response-point","qti-product","qti-delete","qti-string-match","qti-pattern-match","qti-substring","qti-round","qti-round-to","qti-truncate","qti-divide","qti-gt","qti-gte","qti-lt","qti-lte","qti-max","qti-min","qti-custom-operator","qti-math-operator","qti-math-constant","qti-repeat","qti-gcd","qti-lcm","qti-stats-operator","qti-power","qti-any-n"]}constructor(){}isExpressionNode(t){return this.QTI_EXPRESSIONS().includes(t)}isResponseRuleNode(t){return this.QTI_RESPONSE_RULES().includes(t)}isTemplateRuleNode(t){return this.QTI_TEMPLATE_RULES().includes(t)}nullValue(){return null}isNullValue(t){return typeof t>"u"||t===null}isBaseTypeNumeric(t){return t==="float"||t==="integer"}isSingleValuesMatch(t,i,n){if(this.isBaseTypeNumeric(t)){let s=new ce(i),r=new ce(n);return s.comparedTo(r)==0}return i===n}isMultipleValuesMatch(t,i,n){if(!Array.isArray(i)||!Array.isArray(n)||i.length!==n.length)return!1;const s=i.concat().sort(),r=n.concat().sort();if(this.isBaseTypeNumeric(t)){for(let a=0;a<s.length;a++)if(!this.isSingleValuesMatch(t,s[a],r[a]))return!1}else for(let a=0;a<s.length;a++)if(s[a]!==r[a])return!1;return!0}isOrderedValuesMatch(t,i,n){if(!Array.isArray(i)||!Array.isArray(n)||i.length!==n.length)return!1;if(this.isBaseTypeNumeric(t)){for(let s=0;s<i.length;s++)if(!this.isSingleValuesMatch(t,i[s],n[s]))return!1}else for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}mapResponse(t){if(this.isNullValue(t.value))return t.mapping.getDefaultValue();const i=t.mapping.getValue(),n=i.length;if(t.cardinality==="single"){let s=this.isBaseTypeNumeric(t.baseType)?new ce(t.value).toString():t.value;for(let r=0;r<n;r++){const a=i[r];if(this.isSingleValuesMatch("string",a.caseSensitive?a.mapKey:a.mapKey.toLowerCase(),a.caseSensitive?s:s.toLowerCase()))return t.mapping.applyConstraints(new ce(a.mappedValue))}}else if(t.cardinality==="multiple"||t.cardinality==="ordered"){let s=new ce(0),r=t.value;if(this.isBaseTypeNumeric(t.baseType))for(let a=0;a<r.length;a++)r[a]!==null&&(r[a]=new ce(r[a]).toString());r=this.mappingEliminateNullsAndDuplicates(r);for(let a=0;a<n;a++){const c=i[a];for(let y=0;y<r.length;y++)this.isSingleValuesMatch("string",c.caseSensitive?c.mapKey:c.mapKey.toLowerCase(),c.caseSensitive?r[y]:r[y].toLowerCase())&&(s=s.plus(c.mappedValue))}return t.mapping.applyConstraints(s)}return t.mapping.getDefaultValue()}mappingEliminateNullsAndDuplicates(t){let i=t.length,n=[],s={};for(let r=0;r<i;r++)t[r]!==null&&(s[t[r]]=0);for(let r in s)n.push(r);return n}mapValueFromLookupTable(t,i){if(this.isNullValue(t.lookupTable))return this.nullValue();if(this.isNullValue(i))return t.lookupTable.getDefaultValue();const n=t.lookupTable.getValue(),s=t.lookupTable.getTableType();if(i=new ce(i),s==="interpolation"){n.sort(function(r,a){return r.sourceValue-a.sourceValue});for(let r=0;r<n.length;r++){let a=n[r];const c=new ce(a.sourceValue);if(i.comparedTo(c)<0||a.includeBoundary&&i.comparedTo(c)===0)return a.targetValue}}else if(s==="match"){i=new ce(i);for(let r=0;r<n.length;r++){let a=n[r];const c=new ce(a.sourceValue);if(i.comparedTo(c)===0)return a.targetValue}}return t.lookupTable.getDefaultValue()}shuffleArray(t){for(let i=t.length-1;i>0;i--){let n=Math.floor(Math.random()*(i+1)),s=t[i];t[i]=t[n],t[n]=s}}shuffleArrayFixed(t){for(let i=t.length-1;i>0;i--){let n=Math.floor(Math.random()*(i+1));if(t[i].fixed||t[n].fixed)continue;let s=t[i];t[i]=t[n],t[n]=s}}generalizedLcm(t,i){let n=i[0];for(let s=1;s<t;s++){if(n===0||i[s]===0)return 0;n=this.lcm(n,i[s])}return n}lcm(t,i){return new ce(t).multipliedBy(i).dividedBy(this.gcd(t,i)).toNumber()}generalizedGcd(t,i){let n=i[0];for(let s=1;s<t;s++)n=this.gcd(n,i[s]);return n}gcd(t,i){return i=new ce(i),i.isZero()?t:this.gcd(i.toNumber(),new ce(t).modulo(i).toNumber())}getParametersFromDefinition(t){let i=new Map;if(typeof t>"u"||(t=t.trim(),t.length===0))return i;let n=t.split("|||");for(let s=0;s<n.length;s++){const r=n[s].split("=");i.set(r[0],r.length<2?"":r[1].replaceAll("&equals;","="))}return i}computeWordCount(t){const i=t.match(/\S+/g);return i===null?0:i.length}valueToPciJson(t,i,n){return t===null?{base:null}:n==="single"?{base:this.baseValueToPciJson(t,i)}:n==="multiple"||n==="ordered"?{list:this.baseValueToPciJson(t,i)}:n==="record"?{record:this.recordValueToPciJson(t)}:{base:null}}baseValueToPciJson(t,i){let n={};switch(i){case"string":case"identifier":case"integer":case"float":case"duration":case"boolean":case"point":case"directedPair":case"pair":case"uri":return n[i]=t,n;case"intOrIdentifier":case"file":return n[i]=null,n;default:return n[i]=null,n}}recordValueToPciJson(t){let i=[];for(let n of t.values())i.push({name:n.fieldIdentifier,base:n.value===null?null:this.valueToPciJson(n.value,n.baseType,n.cardinality)});return i}processInteractionResponse(t,i){return t.interactionType==="PortableCustom"?this.getValueFromPciJson(t.node.getResponse(),i):t.node.getResponse()}getValueFromPciJson(t,i){if(console.log("[GetValueFromPciJson][Value]",t,i),t===null||typeof i>"u")return this.nullValue();try{if(typeof t!="object")throw new ee("Improper value encoding. Must be an Object.");if(Array.isArray(t))throw new ee("Improper value encoding. Found Array. Must be an Object.");if(t.base!==void 0){if(i.cardinality==="single")return this.baseValueFromPciJson(t.base,i.baseType);throw new ee("Inconsistent value cardinality [base] for this variable. Variable must be single cardinality.")}if(t.list!==void 0){if(i.cardinality==="multiple"||i.cardinality==="ordered")return this.baseValueFromPciJson(t.list,i.baseType);throw new ee("Inconsistent value cardinality [list] for this variable. Variable must be multiple or ordered cardinality.")}if(t.record!==void 0){if(i.cardinality==="record")return this.recordValueFromPciJson(t.record,i);throw new ee("Inconsistent value cardinality [record] for this variable. Variable must be record cardinality.")}throw new ee('Improper value encoding. Must be one of "base", "list", "record".')}catch({name:n,message:s}){return console.log("[PciDecodingException][ValueFromJson] ",s),this.nullValue()}}baseValueFromPciJson(t,i){if(t===null)return this.nullValue();try{if(typeof t!="object")throw new ee("Invalid value. Must be an Object.");if(Array.isArray(t))throw new ee("Invalid value. Found Array. Must be an Object.");if(t[i]!==void 0)return t[i];throw new ee(`Value does not have the required base-type. Expecting ${i}.`)}catch({name:n,message:s}){return console.log("[PciDecodingException][BaseValueFromJson] ",s,t),this.nullValue()}}recordValueFromPciJson(t,i){try{let n=this.getRecordVariableFieldDefinition(i);if(n===null)throw new ee(`Unable to retrieve ${i.identifier} record field definition.`);if(typeof t!="object")throw new ee("Improper record value encoding. Must be an Array.");if(!Array.isArray(t))throw new ee("Improper record value encoding. Must be an Array.");const s=new Map;for(let[r,a]of n)for(let c=0;c<t.length;c++)if(t[c].name!==void 0&&t[c].base!==void 0&&t[c].name===r){const y=this.baseValueFromPciJson(t[c].base,a.getBaseType()),w=new ht(r,a.getBaseType(),y);s.set(r,w);break}return s}catch({name:n,message:s}){return console.log("[VariableDecodingException][RecordValueFromJson] ",s),new Map}}getRecordVariableFieldDefinition(t){return t==null?null:t.defaultValue!==null?t.defaultValue:t.correctResponse}}const Fh=new me,W={player:null,state:{item:null,itemBody:null,identifier:"",title:"",responseDeclarations:[],outcomeDeclarations:[],templateDeclarations:[],contextDeclarations:[],stimulusRefs:[],interactions:[],processing:[],feedbacks:[],templates:[],printedVariables:[],catalogs:[],scoringRubricBlocks:[],asyncStateMap:new Map},itemContext:{guid:null,pnp:null,sc:null,state:null,validationMessages:[],lifecycleStatus:null},itemTimer:new Qh,pciContext:{renderer2p0:"assets/pci/pci.html"},pciMessageHandler:null,windowResizeHandler:null,getResponseDeclarations(){return this.state.responseDeclarations},getResponseDeclaration(e){return this.state.responseDeclarations.find(t=>t.identifier===e)},getOutcomeDeclarations(){return this.state.outcomeDeclarations},getOutcomeDeclaration(e){return this.state.outcomeDeclarations.find(t=>t.identifier===e)},getTemplateDeclarations(){return this.state.templateDeclarations},getTemplateMathParameterVariables(){return this.state.templateDeclarations.filter(e=>e.mathVariable===!0)},getTemplateDeclaration(e){return this.state.templateDeclarations.find(t=>t.identifier===e)},getContextDeclarations(){return this.state.contextDeclarations},getContextDeclaration(e){return this.state.contextDeclarations.find(t=>t.identifier===e)},getStimulusRefs(){return this.state.stimulusRefs},getStimulusRef(e){return this.state.stimulusRefs.find(t=>t.identifier===e)},getVariableDeclaration(e){let t=this.state.outcomeDeclarations.find(i=>i.identifier===e);return typeof t<"u"||(t=this.state.responseDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.templateDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.contextDeclarations.find(i=>i.identifier===e),typeof t<"u")?t:null},getInteraction(e){return this.state.interactions.find(t=>t.identifier===e)},getInteractions(){return this.state.interactions},getProcessing(e){return this.state.processing.find(t=>t.processingType===e)},getFeedbacks(){return this.state.feedbacks},getTemplates(){return this.state.templates},getPrintedVariables(){return this.state.printedVariables},getCatalog(e){return this.state.catalogs.find(t=>t.id===e)},getCatalogs(){return this.state.catalogs},getScoringRubricBlocks(){return this.state.scoringRubricBlocks},getItem(){return this.state.item},setItem(e){this.state.item=e.item},getItemBody(){return this.state.itemBody},setItemBody(e){this.state.itemBody=e},defineResponseDeclaration(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.responseDeclarations[t]=e:this.state.responseDeclarations.push(e)},defineOutcomeDeclaration(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.outcomeDeclarations[t]=e:this.state.outcomeDeclarations.push(e)},defineTemplateDeclaration(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.templateDeclarations[t]=e:this.state.templateDeclarations.push(e)},defineContextDeclaration(e){let t=this.state.contextDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.contextDeclarations[t]=e:this.state.contextDeclarations.push(e)},defineStimulusRef(e){let t=this.state.stimulusRefs.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.stimulusRefs[t]=e:this.state.stimulusRefs.push(e)},defineInteraction(e){let t=this.state.interactions.findIndex(n=>n.identifier==e.identifier);if(t<0){console.log("[DefineInteraction]["+e.identifier+"]"),this.state.interactions.push(e);return}let i=this.state.interactions[t];i.interactionType=e.interactionType,i.isValidResponse=e.isValidResponse,i.invalidResponseMessage=e.invalidResponseMessage,i.maxSelectionsMessage=e.maxSelectionsMessage,i.node=e.node,i.resetValue=e.resetValue},defineProcessing(e){let t=e.processingType,i=this.state.processing.findIndex(n=>n.processingType==t);i>-1?this.state.processing[i]=e:this.state.processing.push(e),t=="response"?console.log("[QtiResponseProcessing][Defined]",e):t=="template"?console.log("[QtiTemplateProcessing][Defined]",e):t=="outcome"&&console.log("[QtiOutcomeProcessing][Defined]",e)},defineResponseProcessing(e){this.defineProcessing({processingType:"response",node:e.node})},defineTemplateProcessing(e){this.defineProcessing({processingType:"template",node:e.node})},defineItemBody(e){this.setItemBody(e.node)},defineFeedback(e){this.state.feedbacks.push(e),console.log("[DefineFeedback]["+e.outcomeIdentifier+"]["+e.identifier+"]")},defineTemplate(e){this.state.templates.push(e)},definePrintedVariable(e){this.state.printedVariables.push(e)},defineCatalog(e){let t=this.state.catalogs.findIndex(i=>i.id==e.id);if(t<0){this.state.catalogs.push(e);return}this.state.catalogs[t]=e},defineScoringRubricBlock(e){this.state.scoringRubricBlocks.push(e)},resetAll(){this.state.item=null,this.state.itemBody=null,this.state.identifier="",this.state.title="",this.state.responseDeclarations.splice(0,this.state.responseDeclarations.length),this.state.outcomeDeclarations.splice(0,this.state.outcomeDeclarations.length),this.state.templateDeclarations.splice(0,this.state.templateDeclarations.length),this.state.contextDeclarations.splice(0,this.state.contextDeclarations.length),this.state.stimulusRefs.splice(0,this.state.stimulusRefs.length),this.state.interactions.splice(0,this.state.interactions.length),this.state.processing.splice(0,this.state.processing.length),this.state.feedbacks.splice(0,this.state.feedbacks.length),this.state.templates.splice(0,this.state.templates.length),this.state.printedVariables.splice(0,this.state.printedVariables.length),this.state.catalogs.splice(0,this.state.catalogs.length),this.state.scoringRubricBlocks.splice(0,this.state.scoringRubricBlocks.length),this.state.asyncStateMap.clear(),this.resetItemTimer(),this.itemContext.guid=null,this.itemContext.state=null,this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length),this.itemContext.lifecycleState=null},initializeBuiltInDeclarations(){function e(){return 0}const t=new Map;t.set("candidateIdentifier",new ht("candidateIdentifier","string",null)),t.set("testIdentifier",new ht("testIdentifier","string",null)),t.set("environmentIdentifier",new ht("environmentIdentifier","string",null)),this.defineContextDeclaration({identifier:"QTI_CONTEXT",baseType:null,cardinality:"record",value:t,defaultValue:t}),console.log("[QtiAssessmentItem][QTI_CONTEXT] initialized"),this.defineOutcomeDeclaration({identifier:"SCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][SCORE] initialized"),this.defineOutcomeDeclaration({identifier:"MAXSCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][MAXSCORE] initialized"),this.defineOutcomeDeclaration({identifier:"completionStatus",baseType:"identifier",cardinality:"single",value:"not_attempted",defaultValue:"not_attempted",lookupTable:null,lookupTableType:null,normalMaximum:null,normalMinimum:null,externalScored:null,interpretation:null}),console.log("[QtiAssessmentItem][completionStatus] initialized"),this.defineResponseDeclaration({identifier:"numAttempts",baseType:"integer",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][numAttempts] initialized"),this.defineResponseDeclaration({identifier:"duration",baseType:"duration",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][duration] initialized")},restoreContextVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"contextVariables"in e&&e.contextVariables!==null&&e.contextVariables.forEach(t=>{let i=this.state.contextDeclarations.findIndex(n=>n.identifier==t.identifier);i<0||(this.state.contextDeclarations[i].value=t.value)},this)},restoreOutcomeVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"outcomeVariables"in e&&e.outcomeVariables!==null&&e.outcomeVariables.forEach(t=>{this.setOutcomeVariableValue({identifier:t.identifier,value:t.value})},this)},setOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.outcomeDeclarations[t].value=e.value)},resetOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(n=>n.identifier==e.identifier);if(t<0)return;let i=this.state.outcomeDeclarations[t];if(i.defaultValue!==null){i.value=this.defaultValue;return}if(i.cardinality==="record"||i.cardinality==="multiple"||i.cardinality==="ordered"){i.value=null;return}if(i.baseType==="integer"||i.baseType==="float"){i.value=0;return}i.value=null},getResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e);return t<0?null:this.state.responseDeclarations[t].correctResponse},setResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(n=>n.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.correctResponse=e.value},setInteractionIsValidResponse(e){let t=this.state.interactions.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.interactions[t].isValidResponse=e.isValidResponse)},resetInteractionStateIsValidResponse(){this.state.interactions.forEach(e=>{e.interactionType!=="EndAttemptInteraction"&&(e.isValidResponse=!1)})},restoreResponseVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"responseVariables"in e&&e.responseVariables!==null&&e.responseVariables.forEach(t=>{this.setResponseVariableValue({identifier:t.identifier,value:t.value,state:t.state}),"correctResponse"in t&&this.setResponseVariableCorrectResponse({identifier:t.identifier,value:t.correctResponse})},this)},setResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(n=>n.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=e.value,i.state=e.state},resetResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(n=>n.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=i.defaultValue!==null?i.defaultValue:null},incrementNumAttempts(){let e=this.state.responseDeclarations.findIndex(t=>t.identifier=="numAttempts");this.state.responseDeclarations[e].value+=1},updateItemDuration(){const e=this.getResponseDeclaration("duration");e.value+=this.itemTimer.getTime(),this.restartItemTimer()},restartItemTimer(){this.itemTimer.startTimer()},resetItemTimer(){this.itemTimer.resetTimer()},setTemplateVariableValue(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.templateDeclarations[t].value=e.value)},resetTemplateVariables(){this.state.templateDeclarations.forEach(e=>{e.node.reset()})},setVariableDefaultValue(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);if(t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}if(t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier),t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}},getPciContext(){return this.pciContext},setPciContext(e){this.pciContext=e},getPciContextRenderer(){return this.pciContext.renderer2p0},setPciContextRenderer(e){this.pciContext.renderer2p0=e},initializePciMessageListener(){this.pciMessageHandler=this.PciMessageListener.bind(this),this.windowResizeHandler=this.WindowResize.bind(this),window.addEventListener("message",this.pciMessageHandler),window.addEventListener("resize",this.windowResizeHandler)},removePciMessageListener(){this.pciMessageHandler!==null&&window.removeEventListener("message",this.pciMessageHandler),this.windowResizeHandler!==null&&window.removeEventListener("resize",this.windowResizeHandler)},PciMessageListener(e){switch(e.data.message){case"PciChildLoaded":console.log("[PCI Parent] PCI Frame Loaded: "+e.data.identifier),this.pciInitialize(e.data.identifier);break;case"PciReady":console.log("[PCI Parent] PCI Ready: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciReady(e.data.identifier),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!0);break;case"PciResize":console.log("[PCI Parent] PCI Resize: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!1);break;case"PciGetState_Reply":console.log("[PCI Parent] PCI GetState Reply: "+e.data.identifier+", state:",e.data.state),this.pciSaveState(e.data.identifier,e.data.state);break}},WindowResize(){this.getInteractions().forEach(e=>{e.interactionType==="PortableCustom"&&e.node.pciResizeIframeWidthToContainer()})},pciInitialize(e){let t=W.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciInitialize()},pciReady(e){let t=W.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciSetReady()},pciResizeIframe(e,t,i,n){let s=W.getInteraction(e);typeof s>"u"||s.interactionType!=="PortableCustom"||(n?s.node.pciResizeIframe(t,s.node.initialWidth):s.node.pciResizeIframe(t,i))},pciSaveState(e,t){let i=W.getInteraction(e);typeof i>"u"||i.interactionType!=="PortableCustom"||i.node.pciSaveState(t)},getAsyncStateMap(){return this.state.asyncStateMap},getItemContextGuid(){return this.itemContext.guid},setItemContextGuid(e){this.itemContext.guid=e},initializeItemContextPnp(){this.itemContext.pnp=new wi},getItemContextPnp(){return this.itemContext.pnp},setItemContextPnp(e){this.itemContext.pnp===null&&this.initializeItemContextPnp(),this.itemContext.pnp.setPnp(e)},initializeItemContextSessionControl(){this.itemContext.sc=new Dh},getItemContextSessionControl(){return this.itemContext.sc},setItemContextSessionControl(e){this.itemContext.sc===null&&this.initializeItemContextSessionControl(),this.itemContext.sc.setSessionControl(e)},getItemContextState(){return this.itemContext.state},setItemContextState(e){const t=new Fr,i=e===null?e:t.createStateFromState(e);this.itemContext.state=i},getItemContextStateVariable(e){if(!this.hasItemContextState())return null;const t=this.getItemContextState();let i=t.outcomeVariables.find(n=>n.identifier===e);return typeof i<"u"||(i=t.responseVariables.find(n=>n.identifier===e),typeof i<"u")||(i=t.templateVariables.find(n=>n.identifier===e),typeof i<"u")||(i=t.contextDeclarations.find(n=>n.identifier===e),typeof i<"u")?i:null},hasItemContextState(){return this.getItemContextState()!==null},getItemContextValidationMessages(){return this.itemContext.validationMessages},addItemContextValidationMessage(e){this.itemContext.validationMessages.push(e)},resetItemContextValidationMessages(){this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length)},getItemLifecycleStatus(){return this.lifecycleStatus},setItemLifecycleStatus(e){this.lifecycleStatus=e},NotifyPlayerReady(e){this.player=e.player},NotifyEndAttempt(e){this.state.item.endAttempt(e,(function(){this.state.item.notifyEndAttemptInteractionResults("itemEndAttemptReady")}).bind(this))},NotifyNewTemplate(e){this.state.item.newTemplate(e)},NotifyItemReady(e){this.setItem(e),this.getItem().isAdaptive||this.restartItemTimer(),this.getItem().isAdaptiveItemCompleted()||this.restartItemTimer()},NotifyInteractionSelectionsLimit(e){const t={icon:"warning",message:e};this.player.displayAlertMessage(t)},NotifyInteractionStateReady(e){console.log("[InteractionStateReady][Interaction]",e.identifier);const t=this.getInteraction(e.identifier);typeof t>"u"||typeof this.getAsyncStateMap().get(t.identifier)>"u"||(this.setResponseVariableValue({identifier:t.identifier,value:Fh.processInteractionResponse(t,this.getResponseDeclaration(t.identifier)),state:t.node.getState()}),this.getAsyncStateMap().delete(t.identifier),this.getAsyncStateMap().size===0&&this.getItem().triggerGetResponsesComplete())}};class Uh{constructor(){Je(this,"xmlDeclaration",null);Je(this,"rxTrackSource",null);this.xmlDeclaration=new RegExp(/<\?xml.*?\?>/s),this.rxTrackSource=new RegExp(/<(track|source)[^>]+?\/>/g)}filterXmlDeclaration(t){return t.replace(this.xmlDeclaration,"")}filterCdata(t){return t.replaceAll("<![CDATA[","").replaceAll("]]>","")}filterStyle(t){return t.replaceAll("<style>","<amp-style>").replaceAll("</style>","</amp-style>")}filterMedia(t){return t=t.replaceAll("<video>","<amp-video>").replaceAll("<video ","<amp-video ").replaceAll("</video>","</amp-video>").replaceAll("<audio>","<amp-audio>").replaceAll("<audio ","<amp-audio ").replaceAll("</audio>","</amp-audio>"),this.filterTrackSource(t)}filterTrackSource(t){return t.replace(this.rxTrackSource,i=>i.replace(/\/>/g,">"))}}var ei=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Po(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qo={exports:{}};/*!
2
+ * sweetalert2 v11.11.1
3
+ * Released under the MIT License.
4
+ */(function(e,t){(function(i,n){e.exports=n()})(ei,function(){function i($,o){(o==null||o>$.length)&&(o=$.length);for(var T=0,R=Array(o);T<o;T++)R[T]=$[T];return R}function n($){if(Array.isArray($))return $}function s($){if(Array.isArray($))return i($)}function r($,o,T){if(typeof $=="function"?$===o:$.has(o))return arguments.length<3?o:T;throw new TypeError("Private element is not present on this object")}function a($){if($===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $}function c($,o,T){return o=E(o),v($,A()?Reflect.construct(o,T||[],E($).constructor):o.apply($,T))}function y($,o){if(o.has($))throw new TypeError("Cannot initialize the same private elements twice on an object")}function w($,o){if(!($ instanceof o))throw new TypeError("Cannot call a class as a function")}function f($,o){return $.get(r($,o))}function g($,o,T){y($,o),o.set($,T)}function p($,o,T){return $.set(r($,o),T),T}function d($,o,T){if(A())return Reflect.construct.apply(null,arguments);var R=[null];R.push.apply(R,o);var z=new($.bind.apply($,R));return z}function S($,o){for(var T=0;T<o.length;T++){var R=o[T];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty($,N(R.key),R)}}function b($,o,T){return o&&S($.prototype,o),Object.defineProperty($,"prototype",{writable:!1}),$}function _(){return _=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function($,o,T){var R=x($,o);if(R){var z=Object.getOwnPropertyDescriptor(R,o);return z.get?z.get.call(arguments.length<3?$:T):z.value}},_.apply(null,arguments)}function E($){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},E($)}function m($,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");$.prototype=Object.create(o&&o.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),Object.defineProperty($,"prototype",{writable:!1}),o&&V($,o)}function A(){try{var $=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A=function(){return!!$})()}function u($){if(typeof Symbol<"u"&&$[Symbol.iterator]!=null||$["@@iterator"]!=null)return Array.from($)}function O($,o){var T=$==null?null:typeof Symbol<"u"&&$[Symbol.iterator]||$["@@iterator"];if(T!=null){var R,z,ae,ye,$e=[],Pe=!0,Ke=!1;try{if(ae=(T=T.call($)).next,o!==0)for(;!(Pe=(R=ae.call(T)).done)&&($e.push(R.value),$e.length!==o);Pe=!0);}catch(As){Ke=!0,z=As}finally{try{if(!Pe&&T.return!=null&&(ye=T.return(),Object(ye)!==ye))return}finally{if(Ke)throw z}}return $e}}function P(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
5
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
6
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v($,o){if(o&&(typeof o=="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a($)}function V($,o){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,R){return T.__proto__=R,T},V($,o)}function C($,o){return n($)||O($,o)||D($,o)||P()}function x($,o){for(;!{}.hasOwnProperty.call($,o)&&($=E($))!==null;);return $}function I($){return s($)||u($)||D($)||q()}function k($,o){if(typeof $!="object"||!$)return $;var T=$[Symbol.toPrimitive];if(T!==void 0){var R=T.call($,o);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return String($)}function N($){var o=k($,"string");return typeof o=="symbol"?o:o+""}function M($){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},M($)}function D($,o){if($){if(typeof $=="string")return i($,o);var T={}.toString.call($).slice(8,-1);return T==="Object"&&$.constructor&&(T=$.constructor.name),T==="Map"||T==="Set"?Array.from($):T==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T)?i($,o):void 0}}var Q=100,H={},j=function(){H.previousActiveElement instanceof HTMLElement?(H.previousActiveElement.focus(),H.previousActiveElement=null):document.body&&document.body.focus()},G=function(o){return new Promise(function(T){if(!o)return T();var R=window.scrollX,z=window.scrollY;H.restoreFocusTimeout=setTimeout(function(){j(),T()},Q),window.scrollTo(R,z)})},B="swal2-",U=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"],L=U.reduce(function($,o){return $[o]=B+o,$},{}),X=["success","warning","info","question","error"],K=X.reduce(function($,o){return $[o]=B+o,$},{}),F="SweetAlert2:",Y=function(o){return o.charAt(0).toUpperCase()+o.slice(1)},Z=function(o){console.warn("".concat(F," ").concat(M(o)==="object"?o.join(" "):o))},J=function(o){console.error("".concat(F," ").concat(o))},le=[],de=function(o){le.includes(o)||(le.push(o),Z(o))},Se=function(o,T){de('"'.concat(o,'" is deprecated and will be removed in the next major release. Please use "').concat(T,'" instead.'))},ve=function(o){return typeof o=="function"?o():o},Ee=function(o){return o&&typeof o.toPromise=="function"},be=function(o){return Ee(o)?o.toPromise():Promise.resolve(o)},Ge=function(o){return o&&Promise.resolve(o)===o},Le=function(){return document.body.querySelector(".".concat(L.container))},ne=function(o){var T=Le();return T?T.querySelector(o):null},ie=function(o){return ne(".".concat(o))},ue=function(){return ie(L.popup)},fe=function(){return ie(L.icon)},he=function(){return ie(L["icon-content"])},Ce=function(){return ie(L.title)},Ie=function(){return ie(L["html-container"])},Ve=function(){return ie(L.image)},Ye=function(){return ie(L["progress-steps"])},nt=function(){return ie(L["validation-message"])},Re=function(){return ne(".".concat(L.actions," .").concat(L.confirm))},Yt=function(){return ne(".".concat(L.actions," .").concat(L.cancel))},He=function(){return ne(".".concat(L.actions," .").concat(L.deny))},Pt=function(){return ie(L["input-label"])},mi=function(){return ne(".".concat(L.loader))},$i=function(){return ie(L.actions)},oe=function(){return ie(L.footer)},we=function(){return ie(L["timer-progress-bar"])},Te=function(){return ie(L.close)},De=`
7
+ a[href],
8
+ area[href],
9
+ input:not([disabled]),
10
+ select:not([disabled]),
11
+ textarea:not([disabled]),
12
+ button:not([disabled]),
13
+ iframe,
14
+ object,
15
+ embed,
16
+ [tabindex="0"],
17
+ [contenteditable],
18
+ audio[controls],
19
+ video[controls],
20
+ summary
21
+ `,Ne=function(){var o=ue();if(!o)return[];var T=o.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),R=Array.from(T).sort(function(ye,$e){var Pe=parseInt(ye.getAttribute("tabindex")||"0"),Ke=parseInt($e.getAttribute("tabindex")||"0");return Pe>Ke?1:Pe<Ke?-1:0}),z=o.querySelectorAll(De),ae=Array.from(z).filter(function(ye){return ye.getAttribute("tabindex")!=="-1"});return I(new Set(R.concat(ae))).filter(function(ye){return Vt(ye)})},st=function(){return ut(document.body,L.shown)&&!ut(document.body,L["toast-shown"])&&!ut(document.body,L["no-backdrop"])},lt=function(){var o=ue();return o?ut(o,L.toast):!1},gi=function(){var o=ue();return o?o.hasAttribute("data-loading"):!1},ft=function(o,T){if(o.textContent="",T){var R=new DOMParser,z=R.parseFromString(T,"text/html"),ae=z.querySelector("head");ae&&Array.from(ae.childNodes).forEach(function($e){o.appendChild($e)});var ye=z.querySelector("body");ye&&Array.from(ye.childNodes).forEach(function($e){$e instanceof HTMLVideoElement||$e instanceof HTMLAudioElement?o.appendChild($e.cloneNode(!0)):o.appendChild($e)})}},ut=function(o,T){if(!T)return!1;for(var R=T.split(/\s+/),z=0;z<R.length;z++)if(!o.classList.contains(R[z]))return!1;return!0},_s=function(o,T){Array.from(o.classList).forEach(function(R){!Object.values(L).includes(R)&&!Object.values(K).includes(R)&&!Object.values(T.showClass||{}).includes(R)&&o.classList.remove(R)})},ct=function(o,T,R){if(_s(o,T),T.customClass&&T.customClass[R]){if(typeof T.customClass[R]!="string"&&!T.customClass[R].forEach){Z("Invalid type of customClass.".concat(R,'! Expected string or iterable object, got "').concat(M(T.customClass[R]),'"'));return}Me(o,T.customClass[R])}},Ft=function(o,T){if(!T)return null;switch(T){case"select":case"textarea":case"file":return o.querySelector(".".concat(L.popup," > .").concat(L[T]));case"checkbox":return o.querySelector(".".concat(L.popup," > .").concat(L.checkbox," input"));case"radio":return o.querySelector(".".concat(L.popup," > .").concat(L.radio," input:checked"))||o.querySelector(".".concat(L.popup," > .").concat(L.radio," input:first-child"));case"range":return o.querySelector(".".concat(L.popup," > .").concat(L.range," input"));default:return o.querySelector(".".concat(L.popup," > .").concat(L.input))}},Nr=function(o){if(o.focus(),o.type!=="file"){var T=o.value;o.value="",o.value=T}},wn=function(o,T,R){!o||!T||(typeof T=="string"&&(T=T.split(/\s+/).filter(Boolean)),T.forEach(function(z){Array.isArray(o)?o.forEach(function(ae){R?ae.classList.add(z):ae.classList.remove(z)}):R?o.classList.add(z):o.classList.remove(z)}))},Me=function(o,T){wn(o,T,!0)},Xt=function(o,T){wn(o,T,!1)},yi=function(o,T){for(var R=Array.from(o.children),z=0;z<R.length;z++){var ae=R[z];if(ae instanceof HTMLElement&&ut(ae,T))return ae}},Ni=function(o,T,R){R==="".concat(parseInt(R))&&(R=parseInt(R)),R||parseInt(R)===0?o.style.setProperty(T,typeof R=="number"?"".concat(R,"px"):R):o.style.removeProperty(T)},at=function(o){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"flex";o&&(o.style.display=T)},pt=function(o){o&&(o.style.display="none")},_o=function(o){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"block";o&&new MutationObserver(function(){xs(o,o.innerHTML,T)}).observe(o,{childList:!0,subtree:!0})},zc=function(o,T,R,z){var ae=o.querySelector(T);ae&&ae.style.setProperty(R,z)},xs=function(o,T){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"flex";T?at(o,R):pt(o)},Vt=function(o){return!!(o&&(o.offsetWidth||o.offsetHeight||o.getClientRects().length))},nV=function(){return!Vt(Re())&&!Vt(He())&&!Vt(Yt())},Kc=function(o){return o.scrollHeight>o.clientHeight},Yc=function(o){var T=window.getComputedStyle(o),R=parseFloat(T.getPropertyValue("animation-duration")||"0"),z=parseFloat(T.getPropertyValue("transition-duration")||"0");return R>0||z>0},xo=function(o){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=we();R&&Vt(R)&&(T&&(R.style.transition="none",R.style.width="100%"),setTimeout(function(){R.style.transition="width ".concat(o/1e3,"s linear"),R.style.width="0%"},10))},sV=function(){var o=we();if(o){var T=parseInt(window.getComputedStyle(o).width);o.style.removeProperty("transition"),o.style.width="100%";var R=parseInt(window.getComputedStyle(o).width),z=T/R*100;o.style.width="".concat(z,"%")}},Xc=function(){return typeof window>"u"||typeof document>"u"},rV=`
22
+ <div aria-labelledby="`.concat(L.title,'" aria-describedby="').concat(L["html-container"],'" class="').concat(L.popup,`" tabindex="-1">
23
+ <button type="button" class="`).concat(L.close,`"></button>
24
+ <ul class="`).concat(L["progress-steps"],`"></ul>
25
+ <div class="`).concat(L.icon,`"></div>
26
+ <img class="`).concat(L.image,`" />
27
+ <h2 class="`).concat(L.title,'" id="').concat(L.title,`"></h2>
28
+ <div class="`).concat(L["html-container"],'" id="').concat(L["html-container"],`"></div>
29
+ <input class="`).concat(L.input,'" id="').concat(L.input,`" />
30
+ <input type="file" class="`).concat(L.file,`" />
31
+ <div class="`).concat(L.range,`">
32
+ <input type="range" />
33
+ <output></output>
34
+ </div>
35
+ <select class="`).concat(L.select,'" id="').concat(L.select,`"></select>
36
+ <div class="`).concat(L.radio,`"></div>
37
+ <label class="`).concat(L.checkbox,`">
38
+ <input type="checkbox" id="`).concat(L.checkbox,`" />
39
+ <span class="`).concat(L.label,`"></span>
40
+ </label>
41
+ <textarea class="`).concat(L.textarea,'" id="').concat(L.textarea,`"></textarea>
42
+ <div class="`).concat(L["validation-message"],'" id="').concat(L["validation-message"],`"></div>
43
+ <div class="`).concat(L.actions,`">
44
+ <div class="`).concat(L.loader,`"></div>
45
+ <button type="button" class="`).concat(L.confirm,`"></button>
46
+ <button type="button" class="`).concat(L.deny,`"></button>
47
+ <button type="button" class="`).concat(L.cancel,`"></button>
48
+ </div>
49
+ <div class="`).concat(L.footer,`"></div>
50
+ <div class="`).concat(L["timer-progress-bar-container"],`">
51
+ <div class="`).concat(L["timer-progress-bar"],`"></div>
52
+ </div>
53
+ </div>
54
+ `).replace(/(^|\n)\s*/g,""),aV=function(){var o=Le();return o?(o.remove(),Xt([document.documentElement,document.body],[L["no-backdrop"],L["toast-shown"],L["has-column"]]),!0):!1},Pi=function(){H.currentInstance.resetValidationMessage()},oV=function(){var o=ue(),T=yi(o,L.input),R=yi(o,L.file),z=o.querySelector(".".concat(L.range," input")),ae=o.querySelector(".".concat(L.range," output")),ye=yi(o,L.select),$e=o.querySelector(".".concat(L.checkbox," input")),Pe=yi(o,L.textarea);T.oninput=Pi,R.onchange=Pi,ye.onchange=Pi,$e.onchange=Pi,Pe.oninput=Pi,z.oninput=function(){Pi(),ae.value=z.value},z.onchange=function(){Pi(),ae.value=z.value}},lV=function(o){return typeof o=="string"?document.querySelector(o):o},uV=function(o){var T=ue();T.setAttribute("role",o.toast?"alert":"dialog"),T.setAttribute("aria-live",o.toast?"polite":"assertive"),o.toast||T.setAttribute("aria-modal","true")},cV=function(o){window.getComputedStyle(o).direction==="rtl"&&Me(Le(),L.rtl)},hV=function(o){var T=aV();if(Xc()){J("SweetAlert2 requires document to initialize");return}var R=document.createElement("div");R.className=L.container,T&&Me(R,L["no-transition"]),ft(R,rV);var z=lV(o.target);z.appendChild(R),uV(o),cV(z),oV()},Io=function(o,T){o instanceof HTMLElement?T.appendChild(o):M(o)==="object"?dV(o,T):o&&ft(T,o)},dV=function(o,T){o.jquery?fV(T,o):ft(T,o.toString())},fV=function(o,T){if(o.textContent="",0 in T)for(var R=0;R in T;R++)o.appendChild(T[R].cloneNode(!0));else o.appendChild(T.cloneNode(!0))},qi=function(){if(Xc())return!1;var $=document.createElement("div");return typeof $.style.webkitAnimation<"u"?"webkitAnimationEnd":typeof $.style.animation<"u"?"animationend":!1}(),pV=function(o,T){var R=$i(),z=mi();!R||!z||(!T.showConfirmButton&&!T.showDenyButton&&!T.showCancelButton?pt(R):at(R),ct(R,T,"actions"),mV(R,z,T),ft(z,T.loaderHtml||""),ct(z,T,"loader"))};function mV($,o,T){var R=Re(),z=He(),ae=Yt();!R||!z||!ae||(Vo(R,"confirm",T),Vo(z,"deny",T),Vo(ae,"cancel",T),gV(R,z,ae,T),T.reverseButtons&&(T.toast?($.insertBefore(ae,R),$.insertBefore(z,R)):($.insertBefore(ae,o),$.insertBefore(z,o),$.insertBefore(R,o))))}function gV($,o,T,R){if(!R.buttonsStyling){Xt([$,o,T],L.styled);return}Me([$,o,T],L.styled),R.confirmButtonColor&&($.style.backgroundColor=R.confirmButtonColor,Me($,L["default-outline"])),R.denyButtonColor&&(o.style.backgroundColor=R.denyButtonColor,Me(o,L["default-outline"])),R.cancelButtonColor&&(T.style.backgroundColor=R.cancelButtonColor,Me(T,L["default-outline"]))}function Vo($,o,T){var R=Y(o);xs($,T["show".concat(R,"Button")],"inline-block"),ft($,T["".concat(o,"ButtonText")]||""),$.setAttribute("aria-label",T["".concat(o,"ButtonAriaLabel")]||""),$.className=L[o],ct($,T,"".concat(o,"Button"))}var yV=function(o,T){var R=Te();R&&(ft(R,T.closeButtonHtml||""),ct(R,T,"closeButton"),xs(R,T.showCloseButton),R.setAttribute("aria-label",T.closeButtonAriaLabel||""))},vV=function(o,T){var R=Le();R&&(wV(R,T.backdrop),bV(R,T.position),EV(R,T.grow),ct(R,T,"container"))};function wV($,o){typeof o=="string"?$.style.background=o:o||Me([document.documentElement,document.body],L["no-backdrop"])}function bV($,o){o&&(o in L?Me($,L[o]):(Z('The "position" parameter is not valid, defaulting to "center"'),Me($,L.center)))}function EV($,o){o&&Me($,L["grow-".concat(o)])}var Fe={innerParams:new WeakMap,domCache:new WeakMap},SV=["input","file","range","select","radio","checkbox","textarea"],TV=function(o,T){var R=ue();if(R){var z=Fe.innerParams.get(o),ae=!z||T.input!==z.input;SV.forEach(function(ye){var $e=yi(R,L[ye]);$e&&(xV(ye,T.inputAttributes),$e.className=L[ye],ae&&pt($e))}),T.input&&(ae&&CV(T),IV(T))}},CV=function(o){if(o.input){if(!Xe[o.input]){J("Unexpected type of input! Expected ".concat(Object.keys(Xe).join(" | "),', got "').concat(o.input,'"'));return}var T=Zc(o.input),R=Xe[o.input](T,o);at(T),o.inputAutoFocus&&setTimeout(function(){Nr(R)})}},_V=function(o){for(var T=0;T<o.attributes.length;T++){var R=o.attributes[T].name;["id","type","value","style"].includes(R)||o.removeAttribute(R)}},xV=function(o,T){var R=Ft(ue(),o);if(R){_V(R);for(var z in T)R.setAttribute(z,T[z])}},IV=function(o){var T=Zc(o.input);M(o.customClass)==="object"&&Me(T,o.customClass.input)},Ao=function(o,T){(!o.placeholder||T.inputPlaceholder)&&(o.placeholder=T.inputPlaceholder)},Is=function(o,T,R){if(R.inputLabel){var z=document.createElement("label"),ae=L["input-label"];z.setAttribute("for",o.id),z.className=ae,M(R.customClass)==="object"&&Me(z,R.customClass.inputLabel),z.innerText=R.inputLabel,T.insertAdjacentElement("beforebegin",z)}},Zc=function(o){return yi(ue(),L[o]||L.input)},Pr=function(o,T){["string","number"].includes(M(T))?o.value="".concat(T):Ge(T)||Z('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(M(T),'"'))},Xe={};Xe.text=Xe.email=Xe.password=Xe.number=Xe.tel=Xe.url=Xe.search=Xe.date=Xe["datetime-local"]=Xe.time=Xe.week=Xe.month=function($,o){return Pr($,o.inputValue),Is($,$,o),Ao($,o),$.type=o.input,$},Xe.file=function($,o){return Is($,$,o),Ao($,o),$},Xe.range=function($,o){var T=$.querySelector("input"),R=$.querySelector("output");return Pr(T,o.inputValue),T.type=o.input,Pr(R,o.inputValue),Is(T,$,o),$},Xe.select=function($,o){if($.textContent="",o.inputPlaceholder){var T=document.createElement("option");ft(T,o.inputPlaceholder),T.value="",T.disabled=!0,T.selected=!0,$.appendChild(T)}return Is($,$,o),$},Xe.radio=function($){return $.textContent="",$},Xe.checkbox=function($,o){var T=Ft(ue(),"checkbox");T.value="1",T.checked=!!o.inputValue;var R=$.querySelector("span");return ft(R,o.inputPlaceholder),T},Xe.textarea=function($,o){Pr($,o.inputValue),Ao($,o),Is($,$,o);var T=function(z){return parseInt(window.getComputedStyle(z).marginLeft)+parseInt(window.getComputedStyle(z).marginRight)};return setTimeout(function(){if("MutationObserver"in window){var R=parseInt(window.getComputedStyle(ue()).width),z=function(){if(document.body.contains($)){var ye=$.offsetWidth+T($);ye>R?ue().style.width="".concat(ye,"px"):Ni(ue(),"width",o.width)}};new MutationObserver(z).observe($,{attributes:!0,attributeFilter:["style"]})}}),$};var VV=function(o,T){var R=Ie();R&&(_o(R),ct(R,T,"htmlContainer"),T.html?(Io(T.html,R),at(R,"block")):T.text?(R.textContent=T.text,at(R,"block")):pt(R),TV(o,T))},AV=function(o,T){var R=oe();R&&(_o(R),xs(R,T.footer,"block"),T.footer&&Io(T.footer,R),ct(R,T,"footer"))},kV=function(o,T){var R=Fe.innerParams.get(o),z=fe();if(z){if(R&&T.icon===R.icon){eh(z,T),Jc(z,T);return}if(!T.icon&&!T.iconHtml){pt(z);return}if(T.icon&&Object.keys(K).indexOf(T.icon)===-1){J('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(T.icon,'"')),pt(z);return}at(z),eh(z,T),Jc(z,T),Me(z,T.showClass&&T.showClass.icon)}},Jc=function(o,T){for(var R=0,z=Object.entries(K);R<z.length;R++){var ae=C(z[R],2),ye=ae[0],$e=ae[1];T.icon!==ye&&Xt(o,$e)}Me(o,T.icon&&K[T.icon]),MV(o,T),OV(),ct(o,T,"icon")},OV=function(){var o=ue();if(o)for(var T=window.getComputedStyle(o).getPropertyValue("background-color"),R=o.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),z=0;z<R.length;z++)R[z].style.backgroundColor=T},LV=`
55
+ <div class="swal2-success-circular-line-left"></div>
56
+ <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
57
+ <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
58
+ <div class="swal2-success-circular-line-right"></div>
59
+ `,RV=`
60
+ <span class="swal2-x-mark">
61
+ <span class="swal2-x-mark-line-left"></span>
62
+ <span class="swal2-x-mark-line-right"></span>
63
+ </span>
64
+ `,eh=function(o,T){if(!(!T.icon&&!T.iconHtml)){var R=o.innerHTML,z="";if(T.iconHtml)z=th(T.iconHtml);else if(T.icon==="success")z=LV,R=R.replace(/ style=".*?"/g,"");else if(T.icon==="error")z=RV;else if(T.icon){var ae={question:"?",warning:"!",info:"i"};z=th(ae[T.icon])}R.trim()!==z.trim()&&ft(o,z)}},MV=function(o,T){if(T.iconColor){o.style.color=T.iconColor,o.style.borderColor=T.iconColor;for(var R=0,z=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];R<z.length;R++){var ae=z[R];zc(o,ae,"background-color",T.iconColor)}zc(o,".swal2-success-ring","border-color",T.iconColor)}},th=function(o){return'<div class="'.concat(L["icon-content"],'">').concat(o,"</div>")},$V=function(o,T){var R=Ve();if(R){if(!T.imageUrl){pt(R);return}at(R,""),R.setAttribute("src",T.imageUrl),R.setAttribute("alt",T.imageAlt||""),Ni(R,"width",T.imageWidth),Ni(R,"height",T.imageHeight),R.className=L.image,ct(R,T,"image")}},NV=function(o,T){var R=Le(),z=ue();if(!(!R||!z)){if(T.toast){Ni(R,"width",T.width),z.style.width="100%";var ae=mi();ae&&z.insertBefore(ae,fe())}else Ni(z,"width",T.width);Ni(z,"padding",T.padding),T.color&&(z.style.color=T.color),T.background&&(z.style.background=T.background),pt(nt()),PV(z,T)}},PV=function(o,T){var R=T.showClass||{};o.className="".concat(L.popup," ").concat(Vt(o)?R.popup:""),T.toast?(Me([document.documentElement,document.body],L["toast-shown"]),Me(o,L.toast)):Me(o,L.modal),ct(o,T,"popup"),typeof T.customClass=="string"&&Me(o,T.customClass),T.icon&&Me(o,L["icon-".concat(T.icon)])},qV=function(o,T){var R=Ye();if(R){var z=T.progressSteps,ae=T.currentProgressStep;if(!z||z.length===0||ae===void 0){pt(R);return}at(R),R.textContent="",ae>=z.length&&Z("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),z.forEach(function(ye,$e){var Pe=BV(ye);if(R.appendChild(Pe),$e===ae&&Me(Pe,L["active-progress-step"]),$e!==z.length-1){var Ke=DV(T);R.appendChild(Ke)}})}},BV=function(o){var T=document.createElement("li");return Me(T,L["progress-step"]),ft(T,o),T},DV=function(o){var T=document.createElement("li");return Me(T,L["progress-step-line"]),o.progressStepsDistance&&Ni(T,"width",o.progressStepsDistance),T},QV=function(o,T){var R=Ce();R&&(_o(R),xs(R,T.title||T.titleText,"block"),T.title&&Io(T.title,R),T.titleText&&(R.innerText=T.titleText),ct(R,T,"title"))},ih=function(o,T){NV(o,T),vV(o,T),qV(o,T),kV(o,T),$V(o,T),QV(o,T),yV(o,T),VV(o,T),pV(o,T),AV(o,T);var R=ue();typeof T.didRender=="function"&&R&&T.didRender(R)},HV=function(){return Vt(ue())},nh=function(){var o;return(o=Re())===null||o===void 0?void 0:o.click()},FV=function(){var o;return(o=He())===null||o===void 0?void 0:o.click()},UV=function(){var o;return(o=Yt())===null||o===void 0?void 0:o.click()},bn=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),sh=function(o){o.keydownTarget&&o.keydownHandlerAdded&&(o.keydownTarget.removeEventListener("keydown",o.keydownHandler,{capture:o.keydownListenerCapture}),o.keydownHandlerAdded=!1)},GV=function(o,T,R){sh(o),T.toast||(o.keydownHandler=function(z){return WV(T,z,R)},o.keydownTarget=T.keydownListenerCapture?window:ue(),o.keydownListenerCapture=T.keydownListenerCapture,o.keydownTarget.addEventListener("keydown",o.keydownHandler,{capture:o.keydownListenerCapture}),o.keydownHandlerAdded=!0)},ko=function(o,T){var R,z=Ne();if(z.length){o=o+T,o===z.length?o=0:o===-1&&(o=z.length-1),z[o].focus();return}(R=ue())===null||R===void 0||R.focus()},rh=["ArrowRight","ArrowDown"],jV=["ArrowLeft","ArrowUp"],WV=function(o,T,R){o&&(T.isComposing||T.keyCode===229||(o.stopKeydownPropagation&&T.stopPropagation(),T.key==="Enter"?zV(T,o):T.key==="Tab"?KV(T):[].concat(rh,jV).includes(T.key)?YV(T.key):T.key==="Escape"&&XV(T,o,R)))},zV=function(o,T){if(ve(T.allowEnterKey)){var R=Ft(ue(),T.input);if(o.target&&R&&o.target instanceof HTMLElement&&o.target.outerHTML===R.outerHTML){if(["textarea","file"].includes(T.input))return;nh(),o.preventDefault()}}},KV=function(o){for(var T=o.target,R=Ne(),z=-1,ae=0;ae<R.length;ae++)if(T===R[ae]){z=ae;break}o.shiftKey?ko(z,-1):ko(z,1),o.stopPropagation(),o.preventDefault()},YV=function(o){var T=$i(),R=Re(),z=He(),ae=Yt();if(!(!T||!R||!z||!ae)){var ye=[R,z,ae];if(!(document.activeElement instanceof HTMLElement&&!ye.includes(document.activeElement))){var $e=rh.includes(o)?"nextElementSibling":"previousElementSibling",Pe=document.activeElement;if(Pe){for(var Ke=0;Ke<T.children.length;Ke++){if(Pe=Pe[$e],!Pe)return;if(Pe instanceof HTMLButtonElement&&Vt(Pe))break}Pe instanceof HTMLButtonElement&&Pe.focus()}}}},XV=function(o,T,R){ve(T.allowEscapeKey)&&(o.preventDefault(),R(bn.esc))},En={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap},ZV=function(){var o=Le(),T=Array.from(document.body.children);T.forEach(function(R){R.contains(o)||(R.hasAttribute("aria-hidden")&&R.setAttribute("data-previous-aria-hidden",R.getAttribute("aria-hidden")||""),R.setAttribute("aria-hidden","true"))})},ah=function(){var o=Array.from(document.body.children);o.forEach(function(T){T.hasAttribute("data-previous-aria-hidden")?(T.setAttribute("aria-hidden",T.getAttribute("data-previous-aria-hidden")||""),T.removeAttribute("data-previous-aria-hidden")):T.removeAttribute("aria-hidden")})},oh=typeof window<"u"&&!!window.GestureEvent,JV=function(){if(oh&&!ut(document.body,L.iosfix)){var o=document.body.scrollTop;document.body.style.top="".concat(o*-1,"px"),Me(document.body,L.iosfix),eA()}},eA=function(){var o=Le();if(o){var T;o.ontouchstart=function(R){T=tA(R)},o.ontouchmove=function(R){T&&(R.preventDefault(),R.stopPropagation())}}},tA=function(o){var T=o.target,R=Le(),z=Ie();return!R||!z||iA(o)||nA(o)?!1:T===R||!Kc(R)&&T instanceof HTMLElement&&T.tagName!=="INPUT"&&T.tagName!=="TEXTAREA"&&!(Kc(z)&&z.contains(T))},iA=function(o){return o.touches&&o.touches.length&&o.touches[0].touchType==="stylus"},nA=function(o){return o.touches&&o.touches.length>1},sA=function(){if(ut(document.body,L.iosfix)){var o=parseInt(document.body.style.top,10);Xt(document.body,L.iosfix),document.body.style.top="",document.body.scrollTop=o*-1}},rA=function(){var o=document.createElement("div");o.className=L["scrollbar-measure"],document.body.appendChild(o);var T=o.getBoundingClientRect().width-o.clientWidth;return document.body.removeChild(o),T},Sn=null,aA=function(o){Sn===null&&(document.body.scrollHeight>window.innerHeight||o==="scroll")&&(Sn=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Sn+rA(),"px"))},oA=function(){Sn!==null&&(document.body.style.paddingRight="".concat(Sn,"px"),Sn=null)};function lh($,o,T,R){lt()?ch($,R):(G(T).then(function(){return ch($,R)}),sh(H)),oh?(o.setAttribute("style","display:none !important"),o.removeAttribute("class"),o.innerHTML=""):o.remove(),st()&&(oA(),sA(),ah()),lA()}function lA(){Xt([document.documentElement,document.body],[L.shown,L["height-auto"],L["no-backdrop"],L["toast-shown"]])}function vi($){$=cA($);var o=En.swalPromiseResolve.get(this),T=uA(this);this.isAwaitingPromise?$.isDismissed||(Vs(this),o($)):T&&o($)}var uA=function(o){var T=ue();if(!T)return!1;var R=Fe.innerParams.get(o);if(!R||ut(T,R.hideClass.popup))return!1;Xt(T,R.showClass.popup),Me(T,R.hideClass.popup);var z=Le();return Xt(z,R.showClass.backdrop),Me(z,R.hideClass.backdrop),hA(o,T,R),!0};function uh($){var o=En.swalPromiseReject.get(this);Vs(this),o&&o($)}var Vs=function(o){o.isAwaitingPromise&&(delete o.isAwaitingPromise,Fe.innerParams.get(o)||o._destroy())},cA=function(o){return typeof o>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},o)},hA=function(o,T,R){var z=Le(),ae=qi&&Yc(T);typeof R.willClose=="function"&&R.willClose(T),ae?dA(o,T,z,R.returnFocus,R.didClose):lh(o,z,R.returnFocus,R.didClose)},dA=function(o,T,R,z,ae){qi&&(H.swalCloseEventFinishedCallback=lh.bind(null,o,R,z,ae),T.addEventListener(qi,function(ye){ye.target===T&&(H.swalCloseEventFinishedCallback(),delete H.swalCloseEventFinishedCallback)}))},ch=function(o,T){setTimeout(function(){typeof T=="function"&&T.bind(o.params)(),o._destroy&&o._destroy()})},Tn=function(o){var T=ue();if(T||new Hr,T=ue(),!!T){var R=mi();lt()?pt(fe()):fA(T,o),at(R),T.setAttribute("data-loading","true"),T.setAttribute("aria-busy","true"),T.focus()}},fA=function(o,T){var R=$i(),z=mi();!R||!z||(!T&&Vt(Re())&&(T=Re()),at(R),T&&(pt(T),z.setAttribute("data-button-to-replace",T.className),R.insertBefore(z,T)),Me([o,R],L.loading))},pA=function(o,T){T.input==="select"||T.input==="radio"?wA(o,T):["text","email","number","tel","textarea"].some(function(R){return R===T.input})&&(Ee(T.inputValue)||Ge(T.inputValue))&&(Tn(Re()),bA(o,T))},mA=function(o,T){var R=o.getInput();if(!R)return null;switch(T.input){case"checkbox":return gA(R);case"radio":return yA(R);case"file":return vA(R);default:return T.inputAutoTrim?R.value.trim():R.value}},gA=function(o){return o.checked?1:0},yA=function(o){return o.checked?o.value:null},vA=function(o){return o.files&&o.files.length?o.getAttribute("multiple")!==null?o.files:o.files[0]:null},wA=function(o,T){var R=ue();if(R){var z=function(ye){T.input==="select"?EA(R,hh(ye),T):T.input==="radio"&&SA(R,hh(ye),T)};Ee(T.inputOptions)||Ge(T.inputOptions)?(Tn(Re()),be(T.inputOptions).then(function(ae){o.hideLoading(),z(ae)})):M(T.inputOptions)==="object"?z(T.inputOptions):J("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(M(T.inputOptions)))}},bA=function(o,T){var R=o.getInput();R&&(pt(R),be(T.inputValue).then(function(z){R.value=T.input==="number"?"".concat(parseFloat(z)||0):"".concat(z),at(R),R.focus(),o.hideLoading()}).catch(function(z){J("Error in inputValue promise: ".concat(z)),R.value="",at(R),R.focus(),o.hideLoading()}))};function EA($,o,T){var R=yi($,L.select);if(R){var z=function(ye,$e,Pe){var Ke=document.createElement("option");Ke.value=Pe,ft(Ke,$e),Ke.selected=dh(Pe,T.inputValue),ye.appendChild(Ke)};o.forEach(function(ae){var ye=ae[0],$e=ae[1];if(Array.isArray($e)){var Pe=document.createElement("optgroup");Pe.label=ye,Pe.disabled=!1,R.appendChild(Pe),$e.forEach(function(Ke){return z(Pe,Ke[1],Ke[0])})}else z(R,$e,ye)}),R.focus()}}function SA($,o,T){var R=yi($,L.radio);if(R){o.forEach(function(ae){var ye=ae[0],$e=ae[1],Pe=document.createElement("input"),Ke=document.createElement("label");Pe.type="radio",Pe.name=L.radio,Pe.value=ye,dh(ye,T.inputValue)&&(Pe.checked=!0);var As=document.createElement("span");ft(As,$e),As.className=L.label,Ke.appendChild(Pe),Ke.appendChild(As),R.appendChild(Ke)});var z=R.querySelectorAll("input");z.length&&z[0].focus()}}var hh=function $(o){var T=[];return o instanceof Map?o.forEach(function(R,z){var ae=R;M(ae)==="object"&&(ae=$(ae)),T.push([z,ae])}):Object.keys(o).forEach(function(R){var z=o[R];M(z)==="object"&&(z=$(z)),T.push([R,z])}),T},dh=function(o,T){return!!T&&T.toString()===o.toString()},qr=void 0,TA=function(o){var T=Fe.innerParams.get(o);o.disableButtons(),T.input?fh(o,"confirm"):Lo(o,!0)},CA=function(o){var T=Fe.innerParams.get(o);o.disableButtons(),T.returnInputValueOnDeny?fh(o,"deny"):Oo(o,!1)},_A=function(o,T){o.disableButtons(),T(bn.cancel)},fh=function(o,T){var R=Fe.innerParams.get(o);if(!R.input){J('The "input" parameter is needed to be set when using returnInputValueOn'.concat(Y(T)));return}var z=o.getInput(),ae=mA(o,R);R.inputValidator?xA(o,ae,T):z&&!z.checkValidity()?(o.enableButtons(),o.showValidationMessage(R.validationMessage||z.validationMessage)):T==="deny"?Oo(o,ae):Lo(o,ae)},xA=function(o,T,R){var z=Fe.innerParams.get(o);o.disableInput();var ae=Promise.resolve().then(function(){return be(z.inputValidator(T,z.validationMessage))});ae.then(function(ye){o.enableButtons(),o.enableInput(),ye?o.showValidationMessage(ye):R==="deny"?Oo(o,T):Lo(o,T)})},Oo=function(o,T){var R=Fe.innerParams.get(o||qr);if(R.showLoaderOnDeny&&Tn(He()),R.preDeny){o.isAwaitingPromise=!0;var z=Promise.resolve().then(function(){return be(R.preDeny(T,R.validationMessage))});z.then(function(ae){ae===!1?(o.hideLoading(),Vs(o)):o.close({isDenied:!0,value:typeof ae>"u"?T:ae})}).catch(function(ae){return mh(o||qr,ae)})}else o.close({isDenied:!0,value:T})},ph=function(o,T){o.close({isConfirmed:!0,value:T})},mh=function(o,T){o.rejectPromise(T)},Lo=function(o,T){var R=Fe.innerParams.get(o||qr);if(R.showLoaderOnConfirm&&Tn(),R.preConfirm){o.resetValidationMessage(),o.isAwaitingPromise=!0;var z=Promise.resolve().then(function(){return be(R.preConfirm(T,R.validationMessage))});z.then(function(ae){Vt(nt())||ae===!1?(o.hideLoading(),Vs(o)):ph(o,typeof ae>"u"?T:ae)}).catch(function(ae){return mh(o||qr,ae)})}else ph(o,T)};function Br(){var $=Fe.innerParams.get(this);if($){var o=Fe.domCache.get(this);pt(o.loader),lt()?$.icon&&at(fe()):IA(o),Xt([o.popup,o.actions],L.loading),o.popup.removeAttribute("aria-busy"),o.popup.removeAttribute("data-loading"),o.confirmButton.disabled=!1,o.denyButton.disabled=!1,o.cancelButton.disabled=!1}}var IA=function(o){var T=o.popup.getElementsByClassName(o.loader.getAttribute("data-button-to-replace"));T.length?at(T[0],"inline-block"):nV()&&pt(o.actions)};function gh(){var $=Fe.innerParams.get(this),o=Fe.domCache.get(this);return o?Ft(o.popup,$.input):null}function yh($,o,T){var R=Fe.domCache.get($);o.forEach(function(z){R[z].disabled=T})}function vh($,o){var T=ue();if(!(!T||!$))if($.type==="radio")for(var R=T.querySelectorAll('[name="'.concat(L.radio,'"]')),z=0;z<R.length;z++)R[z].disabled=o;else $.disabled=o}function wh(){yh(this,["confirmButton","denyButton","cancelButton"],!1)}function bh(){yh(this,["confirmButton","denyButton","cancelButton"],!0)}function Eh(){vh(this.getInput(),!1)}function Sh(){vh(this.getInput(),!0)}function Th($){var o=Fe.domCache.get(this),T=Fe.innerParams.get(this);ft(o.validationMessage,$),o.validationMessage.className=L["validation-message"],T.customClass&&T.customClass.validationMessage&&Me(o.validationMessage,T.customClass.validationMessage),at(o.validationMessage);var R=this.getInput();R&&(R.setAttribute("aria-invalid","true"),R.setAttribute("aria-describedby",L["validation-message"]),Nr(R),Me(R,L.inputerror))}function Ch(){var $=Fe.domCache.get(this);$.validationMessage&&pt($.validationMessage);var o=this.getInput();o&&(o.removeAttribute("aria-invalid"),o.removeAttribute("aria-describedby"),Xt(o,L.inputerror))}var Cn={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},VA=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],AA={},kA=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],_h=function(o){return Object.prototype.hasOwnProperty.call(Cn,o)},xh=function(o){return VA.indexOf(o)!==-1},Ih=function(o){return AA[o]},OA=function(o){_h(o)||Z('Unknown parameter "'.concat(o,'"'))},LA=function(o){kA.includes(o)&&Z('The parameter "'.concat(o,'" is incompatible with toasts'))},RA=function(o){var T=Ih(o);T&&Se(o,T)},MA=function(o){o.backdrop===!1&&o.allowOutsideClick&&Z('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(var T in o)OA(T),o.toast&&LA(T),RA(T)};function Vh($){var o=ue(),T=Fe.innerParams.get(this);if(!o||ut(o,T.hideClass.popup)){Z("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");return}var R=$A($),z=Object.assign({},T,R);ih(this,z),Fe.innerParams.set(this,z),Object.defineProperties(this,{params:{value:Object.assign({},this.params,$),writable:!1,enumerable:!0}})}var $A=function(o){var T={};return Object.keys(o).forEach(function(R){xh(R)?T[R]=o[R]:Z("Invalid parameter to update: ".concat(R))}),T};function Ah(){var $=Fe.domCache.get(this),o=Fe.innerParams.get(this);if(!o){kh(this);return}$.popup&&H.swalCloseEventFinishedCallback&&(H.swalCloseEventFinishedCallback(),delete H.swalCloseEventFinishedCallback),typeof o.didDestroy=="function"&&o.didDestroy(),NA(this)}var NA=function(o){kh(o),delete o.params,delete H.keydownHandler,delete H.keydownTarget,delete H.currentInstance},kh=function(o){o.isAwaitingPromise?(Ro(Fe,o),o.isAwaitingPromise=!0):(Ro(En,o),Ro(Fe,o),delete o.isAwaitingPromise,delete o.disableButtons,delete o.enableButtons,delete o.getInput,delete o.disableInput,delete o.enableInput,delete o.hideLoading,delete o.disableLoading,delete o.showValidationMessage,delete o.resetValidationMessage,delete o.close,delete o.closePopup,delete o.closeModal,delete o.closeToast,delete o.rejectPromise,delete o.update,delete o._destroy)},Ro=function(o,T){for(var R in o)o[R].delete(T)},PA=Object.freeze({__proto__:null,_destroy:Ah,close:vi,closeModal:vi,closePopup:vi,closeToast:vi,disableButtons:bh,disableInput:Sh,disableLoading:Br,enableButtons:wh,enableInput:Eh,getInput:gh,handleAwaitingPromise:Vs,hideLoading:Br,rejectPromise:uh,resetValidationMessage:Ch,showValidationMessage:Th,update:Vh}),qA=function(o,T,R){o.toast?BA(o,T,R):(QA(T),HA(T),FA(o,T,R))},BA=function(o,T,R){T.popup.onclick=function(){o&&(DA(o)||o.timer||o.input)||R(bn.close)}},DA=function(o){return!!(o.showConfirmButton||o.showDenyButton||o.showCancelButton||o.showCloseButton)},Dr=!1,QA=function(o){o.popup.onmousedown=function(){o.container.onmouseup=function(T){o.container.onmouseup=function(){},T.target===o.container&&(Dr=!0)}}},HA=function(o){o.container.onmousedown=function(T){T.target===o.container&&T.preventDefault(),o.popup.onmouseup=function(R){o.popup.onmouseup=function(){},(R.target===o.popup||R.target instanceof HTMLElement&&o.popup.contains(R.target))&&(Dr=!0)}}},FA=function(o,T,R){T.container.onclick=function(z){if(Dr){Dr=!1;return}z.target===T.container&&ve(o.allowOutsideClick)&&R(bn.backdrop)}},UA=function(o){return M(o)==="object"&&o.jquery},Oh=function(o){return o instanceof Element||UA(o)},GA=function(o){var T={};return M(o[0])==="object"&&!Oh(o[0])?Object.assign(T,o[0]):["title","html","icon"].forEach(function(R,z){var ae=o[z];typeof ae=="string"||Oh(ae)?T[R]=ae:ae!==void 0&&J("Unexpected type of ".concat(R,'! Expected "string" or "Element", got ').concat(M(ae)))}),T};function jA(){for(var $=this,o=arguments.length,T=new Array(o),R=0;R<o;R++)T[R]=arguments[R];return d($,T)}function WA($){var o=function(T){function R(){return w(this,R),c(this,R,arguments)}return m(R,T),b(R,[{key:"_main",value:function(ae,ye){return _(E(R.prototype),"_main",this).call(this,ae,Object.assign({},$,ye))}}])}(this);return o}var zA=function(){return H.timeout&&H.timeout.getTimerLeft()},Lh=function(){if(H.timeout)return sV(),H.timeout.stop()},Rh=function(){if(H.timeout){var o=H.timeout.start();return xo(o),o}},KA=function(){var o=H.timeout;return o&&(o.running?Lh():Rh())},YA=function(o){if(H.timeout){var T=H.timeout.increase(o);return xo(T,!0),T}},XA=function(){return!!(H.timeout&&H.timeout.isRunning())},Mh=!1,Mo={};function ZA(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";Mo[$]=this,Mh||(document.body.addEventListener("click",JA),Mh=!0)}var JA=function(o){for(var T=o.target;T&&T!==document;T=T.parentNode)for(var R in Mo){var z=T.getAttribute(R);if(z){Mo[R].fire({template:z});return}}},ek=Object.freeze({__proto__:null,argsToParams:GA,bindClickHandler:ZA,clickCancel:UV,clickConfirm:nh,clickDeny:FV,enableLoading:Tn,fire:jA,getActions:$i,getCancelButton:Yt,getCloseButton:Te,getConfirmButton:Re,getContainer:Le,getDenyButton:He,getFocusableElements:Ne,getFooter:oe,getHtmlContainer:Ie,getIcon:fe,getIconContent:he,getImage:Ve,getInputLabel:Pt,getLoader:mi,getPopup:ue,getProgressSteps:Ye,getTimerLeft:zA,getTimerProgressBar:we,getTitle:Ce,getValidationMessage:nt,increaseTimer:YA,isDeprecatedParameter:Ih,isLoading:gi,isTimerRunning:XA,isUpdatableParameter:xh,isValidParameter:_h,isVisible:HV,mixin:WA,resumeTimer:Rh,showLoading:Tn,stopTimer:Lh,toggleTimer:KA}),tk=function(){function $(o,T){w(this,$),this.callback=o,this.remaining=T,this.running=!1,this.start()}return b($,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}},{key:"increase",value:function(T){var R=this.running;return R&&this.stop(),this.remaining+=T,R&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}])}(),$h=["swal-title","swal-html","swal-footer"],ik=function(o){var T=typeof o.template=="string"?document.querySelector(o.template):o.template;if(!T)return{};var R=T.content;ck(R);var z=Object.assign(nk(R),sk(R),rk(R),ak(R),ok(R),lk(R),uk(R,$h));return z},nk=function(o){var T={},R=Array.from(o.querySelectorAll("swal-param"));return R.forEach(function(z){Bi(z,["name","value"]);var ae=z.getAttribute("name"),ye=z.getAttribute("value");typeof Cn[ae]=="boolean"?T[ae]=ye!=="false":M(Cn[ae])==="object"?T[ae]=JSON.parse(ye):T[ae]=ye}),T},sk=function(o){var T={},R=Array.from(o.querySelectorAll("swal-function-param"));return R.forEach(function(z){var ae=z.getAttribute("name"),ye=z.getAttribute("value");T[ae]=new Function("return ".concat(ye))()}),T},rk=function(o){var T={},R=Array.from(o.querySelectorAll("swal-button"));return R.forEach(function(z){Bi(z,["type","color","aria-label"]);var ae=z.getAttribute("type");T["".concat(ae,"ButtonText")]=z.innerHTML,T["show".concat(Y(ae),"Button")]=!0,z.hasAttribute("color")&&(T["".concat(ae,"ButtonColor")]=z.getAttribute("color")),z.hasAttribute("aria-label")&&(T["".concat(ae,"ButtonAriaLabel")]=z.getAttribute("aria-label"))}),T},ak=function(o){var T={},R=o.querySelector("swal-image");return R&&(Bi(R,["src","width","height","alt"]),R.hasAttribute("src")&&(T.imageUrl=R.getAttribute("src")||void 0),R.hasAttribute("width")&&(T.imageWidth=R.getAttribute("width")||void 0),R.hasAttribute("height")&&(T.imageHeight=R.getAttribute("height")||void 0),R.hasAttribute("alt")&&(T.imageAlt=R.getAttribute("alt")||void 0)),T},ok=function(o){var T={},R=o.querySelector("swal-icon");return R&&(Bi(R,["type","color"]),R.hasAttribute("type")&&(T.icon=R.getAttribute("type")),R.hasAttribute("color")&&(T.iconColor=R.getAttribute("color")),T.iconHtml=R.innerHTML),T},lk=function(o){var T={},R=o.querySelector("swal-input");R&&(Bi(R,["type","label","placeholder","value"]),T.input=R.getAttribute("type")||"text",R.hasAttribute("label")&&(T.inputLabel=R.getAttribute("label")),R.hasAttribute("placeholder")&&(T.inputPlaceholder=R.getAttribute("placeholder")),R.hasAttribute("value")&&(T.inputValue=R.getAttribute("value")));var z=Array.from(o.querySelectorAll("swal-input-option"));return z.length&&(T.inputOptions={},z.forEach(function(ae){Bi(ae,["value"]);var ye=ae.getAttribute("value"),$e=ae.innerHTML;T.inputOptions[ye]=$e})),T},uk=function(o,T){var R={};for(var z in T){var ae=T[z],ye=o.querySelector(ae);ye&&(Bi(ye,[]),R[ae.replace(/^swal-/,"")]=ye.innerHTML.trim())}return R},ck=function(o){var T=$h.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(o.children).forEach(function(R){var z=R.tagName.toLowerCase();T.includes(z)||Z("Unrecognized element <".concat(z,">"))})},Bi=function(o,T){Array.from(o.attributes).forEach(function(R){T.indexOf(R.name)===-1&&Z(['Unrecognized attribute "'.concat(R.name,'" on <').concat(o.tagName.toLowerCase(),">."),"".concat(T.length?"Allowed attributes are: ".concat(T.join(", ")):"To set the value, use HTML within the element.")])})},Nh=10,hk=function(o){var T=Le(),R=ue();typeof o.willOpen=="function"&&o.willOpen(R);var z=window.getComputedStyle(document.body),ae=z.overflowY;mk(T,R,o),setTimeout(function(){fk(T,R)},Nh),st()&&(pk(T,o.scrollbarPadding,ae),ZV()),!lt()&&!H.previousActiveElement&&(H.previousActiveElement=document.activeElement),typeof o.didOpen=="function"&&setTimeout(function(){return o.didOpen(R)}),Xt(T,L["no-transition"])},dk=function $(o){var T=ue();if(!(o.target!==T||!qi)){var R=Le();T.removeEventListener(qi,$),R.style.overflowY="auto"}},fk=function(o,T){qi&&Yc(T)?(o.style.overflowY="hidden",T.addEventListener(qi,dk)):o.style.overflowY="auto"},pk=function(o,T,R){JV(),T&&R!=="hidden"&&aA(R),setTimeout(function(){o.scrollTop=0})},mk=function(o,T,R){Me(o,R.showClass.backdrop),R.animation?(T.style.setProperty("opacity","0","important"),at(T,"grid"),setTimeout(function(){Me(T,R.showClass.popup),T.style.removeProperty("opacity")},Nh)):at(T,"grid"),Me([document.documentElement,document.body],L.shown),R.heightAuto&&R.backdrop&&!R.toast&&Me([document.documentElement,document.body],L["height-auto"])},Ph={email:function(o,T){return/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(o)?Promise.resolve():Promise.resolve(T||"Invalid email address")},url:function(o,T){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(o)?Promise.resolve():Promise.resolve(T||"Invalid URL")}};function gk($){$.inputValidator||($.input==="email"&&($.inputValidator=Ph.email),$.input==="url"&&($.inputValidator=Ph.url))}function yk($){(!$.target||typeof $.target=="string"&&!document.querySelector($.target)||typeof $.target!="string"&&!$.target.appendChild)&&(Z('Target parameter is not valid, defaulting to "body"'),$.target="body")}function vk($){gk($),$.showLoaderOnConfirm&&!$.preConfirm&&Z(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
65
+ showLoaderOnConfirm should be used together with preConfirm, see usage example:
66
+ https://sweetalert2.github.io/#ajax-request`),yk($),typeof $.title=="string"&&($.title=$.title.split(`
67
+ `).join("<br />")),hV($)}var Zt,Qr=new WeakMap,Ze=function(){function $(){if(w(this,$),g(this,Qr,void 0),!(typeof window>"u")){Zt=this;for(var o=arguments.length,T=new Array(o),R=0;R<o;R++)T[R]=arguments[R];var z=Object.freeze(this.constructor.argsToParams(T));this.params=z,this.isAwaitingPromise=!1,p(Qr,this,this._main(Zt.params))}}return b($,[{key:"_main",value:function(T){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(MA(Object.assign({},R,T)),H.currentInstance){var z=En.swalPromiseResolve.get(H.currentInstance),ae=H.currentInstance.isAwaitingPromise;H.currentInstance._destroy(),ae||z({isDismissed:!0}),st()&&ah()}H.currentInstance=Zt;var ye=bk(T,R);vk(ye),Object.freeze(ye),H.timeout&&(H.timeout.stop(),delete H.timeout),clearTimeout(H.restoreFocusTimeout);var $e=Ek(Zt);return ih(Zt,ye),Fe.innerParams.set(Zt,ye),wk(Zt,$e,ye)}},{key:"then",value:function(T){return f(Qr,this).then(T)}},{key:"finally",value:function(T){return f(Qr,this).finally(T)}}])}(),wk=function(o,T,R){return new Promise(function(z,ae){var ye=function(Pe){o.close({isDismissed:!0,dismiss:Pe})};En.swalPromiseResolve.set(o,z),En.swalPromiseReject.set(o,ae),T.confirmButton.onclick=function(){TA(o)},T.denyButton.onclick=function(){CA(o)},T.cancelButton.onclick=function(){_A(o,ye)},T.closeButton.onclick=function(){ye(bn.close)},qA(R,T,ye),GV(H,R,ye),pA(o,R),hk(R),Sk(H,R,ye),Tk(T,R),setTimeout(function(){T.container.scrollTop=0})})},bk=function(o,T){var R=ik(o),z=Object.assign({},Cn,T,R,o);return z.showClass=Object.assign({},Cn.showClass,z.showClass),z.hideClass=Object.assign({},Cn.hideClass,z.hideClass),z.animation===!1&&(z.showClass={backdrop:"swal2-noanimation"},z.hideClass={}),z},Ek=function(o){var T={popup:ue(),container:Le(),actions:$i(),confirmButton:Re(),denyButton:He(),cancelButton:Yt(),loader:mi(),closeButton:Te(),validationMessage:nt(),progressSteps:Ye()};return Fe.domCache.set(o,T),T},Sk=function(o,T,R){var z=we();pt(z),T.timer&&(o.timeout=new tk(function(){R("timer"),delete o.timeout},T.timer),T.timerProgressBar&&(at(z),ct(z,T,"timerProgressBar"),setTimeout(function(){o.timeout&&o.timeout.running&&xo(T.timer)})))},Tk=function(o,T){if(!T.toast){if(!ve(T.allowEnterKey)){_k();return}Ck(o,T)||ko(-1,1)}},Ck=function(o,T){return T.focusDeny&&Vt(o.denyButton)?(o.denyButton.focus(),!0):T.focusCancel&&Vt(o.cancelButton)?(o.cancelButton.focus(),!0):T.focusConfirm&&Vt(o.confirmButton)?(o.confirmButton.focus(),!0):!1},_k=function(){document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};if(typeof window<"u"&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var qh=new Date,Bh=localStorage.getItem("swal-initiation");Bh?(qh.getTime()-Date.parse(Bh))/(1e3*60*60*24)>3&&setTimeout(function(){document.body.style.pointerEvents="none";var $=document.createElement("audio");$.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",$.loop=!0,document.body.appendChild($),setTimeout(function(){$.play().catch(function(){})},2500)},500):localStorage.setItem("swal-initiation","".concat(qh))}Ze.prototype.disableButtons=bh,Ze.prototype.enableButtons=wh,Ze.prototype.getInput=gh,Ze.prototype.disableInput=Sh,Ze.prototype.enableInput=Eh,Ze.prototype.hideLoading=Br,Ze.prototype.disableLoading=Br,Ze.prototype.showValidationMessage=Th,Ze.prototype.resetValidationMessage=Ch,Ze.prototype.close=vi,Ze.prototype.closePopup=vi,Ze.prototype.closeModal=vi,Ze.prototype.closeToast=vi,Ze.prototype.rejectPromise=uh,Ze.prototype.update=Vh,Ze.prototype._destroy=Ah,Object.assign(Ze,ek),Object.keys(PA).forEach(function($){Ze[$]=function(){if(Zt&&Zt[$]){var o;return(o=Zt)[$].apply(o,arguments)}return null}}),Ze.DismissReason=bn,Ze.version="11.11.1";var Hr=Ze;return Hr.default=Hr,Hr}),typeof ei<"u"&&ei.Sweetalert2&&(ei.swal=ei.sweetAlert=ei.Swal=ei.SweetAlert=ei.Sweetalert2),typeof document<"u"&&function(i,n){var s=i.createElement("style");if(i.getElementsByTagName("head")[0].appendChild(s),s.styleSheet)s.styleSheet.disabled||(s.styleSheet.cssText=n);else try{s.innerHTML=n}catch{s.innerText=n}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}')})(qo);var Gh=qo.exports;const Bo=Po(Gh);class h extends Error{constructor(t){super(t),this.name="QtiValidationException"}}class ge extends Error{constructor(t){super(t),this.name="QtiParseException"}}class re{QTI_BASE_TYPES(){return["boolean","directedPair","duration","file","float","identifier","integer","pair","point","string","uri"]}QTI_CARDINALITIES(){return["single","multiple","ordered","record"]}QTI_MATH_OPERATORS(){return["abs","acos","acot","acsc","asec","asin","atan","atan2","ceil","cos","cosh","cot","coth","csc","csch","exp","floor","ln","log","sec","sech","signum","sin","sinh","tan","tanh","toDegrees","toRadians"]}QTI_MATH_CONSTANTS(){return["pi","e"]}QTI_STATS_OPERATORS(){return["mean","sampleVariance","sampleSD","popVariance","popSD"]}QTI_RUBRICBLOCK_VIEWS(){return["author","candidate","proctor","scorer","testConstructor","tutor"]}constructor(){}validateBaseType(t){if(!this.QTI_BASE_TYPES().includes(t))throw new h('Invalid base-type: "'+t+'".')}validateCardinality(t){if(!this.QTI_CARDINALITIES().includes(t))throw new h('Invalid cardinality: "'+t+'".')}validateBaseTypeAndCardinality(t,i){if(i&&typeof t<"u")throw new h('base-type not permitted for "record" cardinality.');if(!i&&typeof t>"u")throw new h("base-type is a required attribute.");!i&&typeof t<"u"&&this.validateBaseType(t)}validateFieldIdentifierAndCardinality(t,i){if(i&&typeof t>"u")throw new h("field-identifier is required for record cardinality.");if(!i&&typeof t<"u")throw new h("field-identifier only permitted for record cardinality.")}validatePositiveIntegerAttribute(t,i,n){let s=/^\d+$/,r;if(typeof i>"u"){if(n)throw new h("attribute: "+t+" is a required attribute");return}if(s.test(i))r=this.IntegerValue(i);else throw new ge("Invalid "+t+' attribute "'+i+'"');if(r<0)throw new h("Invalid "+t+" attribute. Must be greater than or equal to 0");return r}validateIntegerAttribute(t,i,n,s){let r=/^-?\d+$/,a;if(typeof i>"u"){if(n)throw new h("attribute: "+t+" is a required attribute");return s}if(r.test(i))a=this.IntegerValue(i);else throw new ge("Invalid "+t+' attribute "'+i+'"');return a}validateIdentifierAttribute(t){if(t!=null&&t.length!=t.trim().length)throw new h('Invalid identifier "'+t+'". Whitespace not permitted.');if(t==null||t.length==0)throw new h('Invalid identifier "'+t+'". Length is not valid.');if(!this.isCharacterALetter(t.charAt(0))&&!this.isCharacterADigit(t.charAt(0))&&t.charAt(0)!=="_")throw new h('Invalid identifier "'+t+'". First character "'+t.charAt(0)+'" is not valid.');for(let i=1;i<t.length;i++)if(!this.isCharacterALetterOrDigit(t.charAt(i))&&t.charAt(i)!=="_"&&t.charAt(i)!=="-"&&t.charAt(i)!==".")throw new h('Invalid identifier "'+t+'". Character "'+t.charAt(i)+'" at position '+(i+1)+" is not valid.")}validateFloatAttribute(t,i,n,s){let r=/^[-+]?([0-9]*\.[0-9]+|[0-9]+)$/,a;if(typeof i>"u"){if(n)throw new h("attribute: "+t+" is a required attribute");return s}if(r.test(i))a=this.FloatValue(i);else throw new ge("Invalid "+t+' attribute "'+i+'"');return a}validateResponseIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let n=t.getResponseDeclaration(i);if(typeof n>"u")throw new h('No response declaration found for response-identifier: "'+i+'"');return n}validateOutcomeIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let n=t.getOutcomeDeclaration(i);if(typeof n>"u")throw new h('No outcome declaration found for identifier: "'+i+'"');return n}validateTemplateIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let n=t.getTemplateDeclaration(i);if(typeof n>"u")throw new h('No template declaration found for identifier: "'+i+'"');return n}validateTemplateOrOutcomeIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let n=t.getTemplateDeclaration(i);if(typeof n<"u"||(n=t.getOutcomeDeclaration(i),typeof n<"u"))return n;throw new h('No outcome or template declaration found for identifier: "'+i+'"')}validateVariableIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let n=t.getOutcomeDeclaration(i);if(typeof n<"u"||(n=t.getResponseDeclaration(i),typeof n<"u")||(n=t.getContextDeclaration(i),typeof n<"u")||(n=t.getTemplateDeclaration(i),typeof n<"u"))return n;throw new h('No declaration found for identifier: "'+i+'"')}validatePrintedVariableIdentifierAttribute(t,i){if(typeof i>"u")throw new h('Attribute "identifier" is undefined');this.validateIdentifierAttribute(i);let n=t.getOutcomeDeclaration(i);if(typeof n<"u"||(n=t.getTemplateDeclaration(i),typeof n<"u")||(n=t.getContextDeclaration(i),typeof n<"u"))return n;throw new h('No declaration found for identifier: "'+i+'"')}validateMaxMinChoices(t,i){let n=this.validatePositiveIntegerAttribute("max-choices",t),s=this.validatePositiveIntegerAttribute("min-choices",i);if(n>0&&s>n)throw new h('Invalid min-choices attribute "'+i+'". Must be less than or equal to max-choices attribute when max-choices attribute is greater than 0')}validateMaxMinStrings(t,i){let n=this.validatePositiveIntegerAttribute("max-strings",t),s=this.validatePositiveIntegerAttribute("min-strings",i);if(n>0&&s>n)throw new h('Invalid min-strings attribute "'+i+'". Must be less than or equal to max-strings attribute when max-strings attribute is greater than 0')}validateMaxMinPlays(t,i){let n=this.validatePositiveIntegerAttribute("max-plays",t),s=this.validatePositiveIntegerAttribute("min-plays",i);if(n>0&&s>n)throw new h('Invalid min-plays attribute "'+i+'". Must be less than or equal to max-plays attribute when max-plays attribute is greater than 0')}validatePattern(t,i){if(typeof i>"u")return null;if(i==null||i.length==0)throw new ge("Invalid "+t+' "'+i+'". Length is not valid.');let n=i.trim();if(n.length==0)throw new ge("Invalid "+t+' "'+i+'".');n=n.startsWith("^")?n.substring(1):n,n=n.endsWith("$")?n.substring(0,n.length-1):n,n=n.replaceAll("/","\\/");try{return new RegExp("^"+n+"$")}catch{throw new ge("Unable to parse "+t+': "'+i+'""')}}validatePlaceholderText(t,i){return typeof t<"u"?t:i}validatePatternmaskMessage(t,i){return typeof t<"u"?t:i}validateCaseSensitive(t,i){if(typeof t>"u"){if(i)throw new h('Attribute "case-sensitive" is a required attribute');return!1}if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1;throw new h("Invalid case-sensitive attribute. Must be a Boolean value.")}validateIncludeBoundary(t,i){if(typeof t>"u"||t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1;throw new h("Invalid "+i+" attribute. Must be a Boolean value.")}validateValueFromBaseType(t,i){let n=null;try{switch(t){case"string":if(i===null||i.length===0)throw new ge('Null string "'+i+'".');n=i;break;case"identifier":this.validateIdentifierAttribute(i),n=i;break;case"integer":n=this.IntegerValue(i);break;case"float":n=this.FloatValue(i);break;case"duration":n=this.DurationValue(i);break;default:throw new ge('[Unhandled Attribute Value BaseType]: "'+t+'"')}}catch(s){if(s.name==="QtiValidationException")throw new h(s.message);if(s.name==="QtiParseException")throw new ge(s.message)}return n}validateShowHideAttribute(t){if(typeof t>"u"||t==="show")return!0;if(t==="hide")return!1;throw new h('Invalid show-hide attribute: "'+t+'" Value must be "show" or "hide".')}validateShapeAttribute(t){if(typeof t>"u")return"";if(t==="circle")return"circle";if(t==="rect")return"rect";if(t==="poly")return"poly";if(t==="default")return"default";if(t==="ellipse")return"ellipse";throw new h('Invalid shape attribute: "'+t+'" Value must be "circle", "rect", "poly", "default", or "ellipse".')}validateToleranceModeAttribute(t){if(typeof t>"u")return!0;if(t==="exact")return"exact";if(t==="absolute")return"absoluate";if(t==="relative")return"relative";throw new h('Invalid tolerance-mode attribute: "'+t+'" Value must be "exact", "absolute", or "relative".')}validateRoundingModeAttribute(t){if(typeof t>"u")return!0;if(t==="decimalPlaces")return"decimalPlaces";if(t==="significantFigures")return"significantFigures";throw new h('Invalid rounding-mode attribute: "'+t+'" Value must be "decimalPlaces" or "significantFigures".')}validateMathOperatorNameAttribute(t){if(this.QTI_MATH_OPERATORS().includes(t))return!0;throw new h('Unsupported qti-math-operator "name" attribute: "'+t+'".')}validateMathConstantNameAttribute(t){if(this.QTI_MATH_CONSTANTS().includes(t))return!0;throw new h('Unsupported qti-math-constant "name" attribute: "'+t+'".')}validateStatsOperatorNameAttribute(t){if(this.QTI_STATS_OPERATORS().includes(t))return!0;throw new h('Unsupported qti-stats-operator "name" attribute: "'+t+'".')}validateToleranceAttribute(t){if(t===null||t.length===0)return[];const i=t.split(" ");if(i.length===0)throw new h('Unable to parse tolerance attribute: "'+t+'"');if(i.length<3)try{if(i.length===1){const n=new ce(this.FloatValue(i[0]));if(n.comparedTo(new ce(0))<0)throw new h('Tolerance attribute: "'+n.valueOf()+'" cannot be negative.');return[n,n]}else if(i.length===2){const n=new ce(this.FloatValue(i[0]));if(n.comparedTo(new ce(0))<0)throw new h('Tolerance attribute: "'+n.valueOf()+'" cannot be negative.');const s=new ce(this.FloatValue(i[1]));if(s.comparedTo(new ce(0))<0)throw new h('Tolerance attribute: "'+s.valueOf()+'" cannot be negative.');return[n,s]}}catch(n){if(n.name==="QtiValidationException")throw new h(n.message);if(n.name==="QtiParseException")throw new ge(n.message)}else if(i.length>=3)throw new h('Invalid tolerance attribute: "'+t+'". Value must contain 1 or 2 tolerances.')}validateRubricBlockViewAttribute(t){if(!this.QTI_RUBRICBLOCK_VIEWS().includes(t))throw new h('Invalid view attribute: "'+t+'".')}parseXmlLangAttribute(t){return typeof t>"u"?null:t}isCharacterALetter(t){return/[a-zA-Z]/.test(t)}isCharacterADigit(t){return/\d/.test(t)}isCharacterALetterOrDigit(t){return this.isCharacterALetter(t)||this.isCharacterADigit(t)}IntegerValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new ge('Invalid integer "'+t+'". Length is not valid.');try{let i=parseInt(t,10);if(Number.isNaN(i))throw new ge('Invalid integer "'+t+'". ');return i}catch(i){throw new ge(i.message)}}FloatValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new ge('Invalid float "'+t+'". Length is not valid.');try{let i=parseFloat(t);if(Number.isNaN(i))throw new ge('Invalid float "'+t+'". ');return i}catch(i){throw new ge(i.message)}}DurationValue(t){try{let i=new ce(t);if(i.isZero()&&i.isNegative()&&(i=new ce(0)),i.comparedTo(0)<0)throw new ge('Invalid duration "'+i+'". Duration cannot be negative.');return i.toNumber()}catch(i){throw new ge(i.message)}}randomString(t,i){i=i&&i.toLowerCase();let n="";const s=i=="a"?10:0,r=i=="n"?10:62;for(let a=0;a<t;a++){let c=Math.random()*(r-s)+s<<0;n+=String.fromCharCode(c+=c>9?c<36?55:61:48)}return n}kebabCase(t){return t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}isValidSlot(t){if(typeof t.type.name<"u")return!0;if(typeof t.type=="symbol"&&t.children.trim().length>0){if(t.type.toString()==="Symbol(v-cmt)")return!1;throw new h('Invalid Child Node: "'+t.children.trim()+'"')}return!1}}class jh{constructor(t){Je(this,"constants",{keys:{ENTER:13,SPACE:32}});return this.audioElement=t,this.isPaused=!0,this.onPlayPauseClick=this.playPauseClickHandler.bind(this),this.onKeyDown=this.keydownHandler.bind(this),this.onEnded=this.endedHandler.bind(this),this}create(){return this.createAudioTemplate(),this}createAudioTemplate(){this.outerWrapper=document.createElement("div"),this.outerWrapper.classList.add("cat-audio__wrapper"),this.wrapper=document.createElement("div"),this.wrapper.classList.add("cat-audio__holder"),this.audioElement.parentNode.appendChild(this.outerWrapper),this.audioElement.setAttribute("tabindex","-1"),this.outerWrapper.appendChild(this.wrapper),this.wrapper.appendChild(this.audioElement),this.playerContainer=this.createPlayerContainer(),this.outerWrapper.appendChild(this.playerContainer),this.addListeners()}createPlayerContainer(){const t=document.createElement("div");return t.classList.add("cat-audio__container"),t.appendChild(this.createPlayPauseButton()),t}createPlayPauseButton(){const t=document.createElement("button");return t.classList.add("cat-audio-playpause__container"),t.classList.add("play"),t.setAttribute("tabindex","0"),t}addListeners(){this.playButton=this.playerContainer.querySelector(".cat-audio-playpause__container"),this.playButton.addEventListener("click",this.onPlayPauseClick),this.playButton.addEventListener("keydown",this.onKeyDown),this.audioElement.addEventListener("ended",this.onEnded)}removeListeners(){this.playButton.removeEventListener("click",this.onPlayPauseClick),this.playButton.removeEventListener("keydown",this.onKeyDown),this.audioElement.removeEventListener("ended",this.onEnded)}playPauseClickHandler(){this.toggleAudio()}keydownHandler(t){let i=!1;switch(t.keyCode){case this.constants.keys.SPACE:case this.constants.keys.ENTER:this.toggleAudio(),i=!0;break}i&&(t.stopPropagation(),t.preventDefault())}endedHandler(){this.playButton.classList.remove("pause"),this.playButton.classList.add("play"),this.isPaused=!0}toggleAudio(){this.isPaused?this.play():this.pause()}play(){this.playButton.classList.remove("play"),this.playButton.classList.add("pause"),this.isPaused=!1,this.audioElement.play()}pause(){this.playButton.classList.remove("pause"),this.playButton.classList.add("play"),this.isPaused=!0,this.audioElement.pause()}}class Wh{constructor(t){Je(this,"constants",{labels:{GLOSSARY:"Glossary",KEYWORD_TRANSLATION:"Translation",GLOSSARY_ILLUSTRATION:"Illustration"},cards:{GLOSSARY:"glossary",KEYWORD_TRANSLATION:"keywordTranslation",GLOSSARY_ILLUSTRATION:"glossaryIllustration"},keys:{ENTER:13,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},direction:{37:-1,38:-1,39:1,40:1}});return this.element=t,this.idList=this.createIds(),this.tabElements=[],this.tabPanelElements=[],this.audioPlayers=[],this.onTabClick=this.tabClickHandler.bind(this),this.onKeyDown=this.keydownHandler.bind(this),this.onKeyUp=this.keyupHandler.bind(this),this}create(t){this.unbindTabListEvents();const i=this.constants.cards.GLOSSARY in t,n=this.constants.cards.KEYWORD_TRANSLATION in t,s=this.constants.cards.GLOSSARY_ILLUSTRATION in t,r=this.tabList(i,n,s);if(r.length==0){this.element.innerHTML="";return}let a="",c="",y="",w="",f="",g="";for(let d=0;d<r.length;d++)d==0&&(a=this.createTabButton(this.idList.tabIds[d],this.idList.tabPanelIds[d],r[d],!0),c=this.tabPanel(r[d],d,t,0)),d==1&&(y=this.createTabButton(this.idList.tabIds[d],this.idList.tabPanelIds[d],r[d],!1),w=this.tabPanel(r[d],d,t,-1)),d==2&&(f=this.createTabButton(this.idList.tabIds[d],this.idList.tabPanelIds[d],r[d],!1),g=this.tabPanel(r[d],d,t,-1));const p=`<div id="${this.idList.tabWrapperId}" class="qti3-player-cat-tabs">
68
+ <div role="tablist" aria-orientation="horizontal" aria-label="Glossary Tab List">
69
+ ${a}
70
+ ${y}
71
+ ${f}
72
+ </div>
73
+ ${c}
74
+ ${w}
75
+ ${g}
76
+ </div>`;this.element.innerHTML=p,this.bindTabListEvents()}tabPanel(t,i,n,s=-1){switch(t){case this.constants.labels.GLOSSARY:return this.createTabPanel(this.idList.tabIds[i],this.idList.tabPanelIds[i],n[this.constants.cards.GLOSSARY].content,s);case this.constants.labels.KEYWORD_TRANSLATION:return this.createTabPanel(this.idList.tabIds[i],this.idList.tabPanelIds[i],n[this.constants.cards.KEYWORD_TRANSLATION].content,s);case this.constants.labels.GLOSSARY_ILLUSTRATION:return this.createTabPanel(this.idList.tabIds[i],this.idList.tabPanelIds[i],n[this.constants.cards.GLOSSARY_ILLUSTRATION].content,s);default:return""}}createTabButton(t,i,n,s=!1){return`<button type="button"
77
+ role="tab"
78
+ aria-selected="${s}"
79
+ aria-controls="${i}"
80
+ id="${t}">${n}</button>`}createTabPanel(t,i,n,s=-1){return`<div tabindex="${s}"
81
+ role="tabpanel"
82
+ class="${s===-1?"hidden":""}"
83
+ id="${i}"
84
+ aria-labelledby="${t}">${n}</div>`}createIds(){const t={tabWrapperId:"",tabIds:[],tabPanelIds:[]};t.tabWrapperId="catalog-tabwrapper-"+this.randomString(5,"a");for(let i=0;i<3;i++){const n=this.randomString(5,"a");t.tabIds.push("catalog-"+i+"-tab-"+n),t.tabPanelIds.push("catalog-"+i+"-tabpanel-"+n)}return t}tabList(t,i,n){let s=[];return t&&s.push(this.constants.labels.GLOSSARY),i&&s.push(this.constants.labels.KEYWORD_TRANSLATION),n&&s.push(this.constants.labels.GLOSSARY_ILLUSTRATION),s}bindTabListEvents(){const t=document.getElementById(this.idList.tabWrapperId);if(t!==null&&(this.tabElements=t.querySelectorAll('[role="tab"]'),this.tabPanelElements=t.querySelectorAll('[role="tabpanel"]'),this.tabElements.length==this.tabPanelElements.length)){for(let i=0;i<this.tabElements.length;++i)this.addListeners(this.tabElements[i],this.tabPanelElements[i],i);this.bindTabAudioPlayers()}}unbindTabListEvents(){this.removeListeners(),this.unbindTabAudioPlayers()}bindTabAudioPlayers(){this.element.querySelectorAll("audio").forEach(i=>{const n=new jh(i).create();this.audioPlayers.push(n)},this)}unbindTabAudioPlayers(){this.audioPlayers.forEach(t=>{t.removeListeners()},this),this.audioPlayers.splice(0,this.audioPlayers.length)}addListeners(t,i,n){t.addEventListener("click",this.onTabClick),t.addEventListener("keydown",this.onKeyDown),t.addEventListener("keyup",this.onKeyUp),t.index=n}removeListeners(){this.tabElements.forEach(t=>{t.removeEventListener("click",this.onTabClick),t.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("keyup",this.onKeyUp)},this)}tabClickHandler(t){var i=t.target;this.activateTab(i,!1)}keydownHandler(t){switch(t.keyCode){case this.constants.keys.END:t.preventDefault(),this.focusLastTab();break;case this.constants.keys.HOME:t.preventDefault(),this.focusFirstTab();break;case this.constants.keys.UP:case this.constants.keys.DOWN:this.switchTabOnArrowPress(t);break}}switchTabOnArrowPress(t){const i=t.keyCode;if(this.constants.direction[i]){let n=t.target;if(n.index!==void 0){if(this.tabElements[n.index+this.constants.direction[i]]){this.tabElements[n.index+this.constants.direction[i]].focus();return}if(i===this.constants.keys.LEFT||i===this.constants.keys.UP){this.focusLastTab();return}(i===this.constants.keys.RIGHT||i==this.constants.keys.DOWN)&&this.focusFirstTab()}}}keyupHandler(t){switch(t.keyCode){case this.constants.keys.LEFT:case this.constants.keys.RIGHT:this.switchTabOnArrowPress(t);break;case this.constants.keys.ENTER:case this.constants.keys.SPACE:this.activateTab(t.target);break}}activateTab(t,i){i=i||!0,this.deactivateTabs(),t.setAttribute("aria-selected","true");let n=t.getAttribute("aria-controls");document.getElementById(n).classList.remove("hidden"),i&&t.focus()}deactivateTabs(){this.audioPlayers.forEach(t=>{t.pause()},this),this.tabElements.forEach(t=>{t.setAttribute("aria-selected","false")},this),this.tabPanelElements.forEach(t=>{t.classList.add("hidden")},this)}focusFirstTab(){this.tabElements[0].focus()}focusLastTab(){this.tabElements[this.tabElements.length-1].focus()}randomString(t,i){i=i&&i.toLowerCase();let n="";const s=i=="a"?10:0,r=i=="n"?10:62;for(let a=0;a<t;a++){let c=Math.random()*(r-s)+s<<0;n+=String.fromCharCode(c+=c>9?c<36?55:61:48)}return n}}const te=(e,t)=>{const i=e.__vccOpts||e;for(const[n,s]of t)i[n]=s;return i},zh={name:"CatalogDialog",data(){return{state:{isShown:!1,dragging:!1,hidden:!0,xDiff:0,yDiff:0,x:0,y:0},content:{term:""},tabs:null}},methods:{setContent(e){this.resetDialogContent(),this.setDialogTerm(e.term),this.setDialogContent(e),this.createTabs(this.content)},setDialogContent(e){"data"in e&&e.data.forEach(t=>{switch(t.support){case"glossary-on-screen":this.setDialogGlossary(t.card);break;case"keyword-translation":this.setDialogKeywordTranslation(t.card);break;case"ext:sbac-glossary-illustration":this.setDialogGlossaryIllustration(t.card);break}},this)},resetDialogContent(){"glossary"in this.content&&delete this.content.glossary,"keywordTranslation"in this.content&&delete this.content.keywordTranslation,"glossaryIllustration"in this.content&&delete this.content.glossaryIllustration},setDialogTerm(e){this.content.term=e},setDialogGlossary(e){this.content.glossary=e},setDialogKeywordTranslation(e){this.content.keywordTranslation=e},setDialogGlossaryIllustration(e){this.content.glossaryIllustration=e},createTabs(e){this.tabs.create(e)},show(){this.state.hidden=!1,this.render(),this.state.isShown||(this.state.isShown=!0,this.center())},hide(){this.state.hidden=!0,this.render()},center(){this.$refs.dialog.style.top=window.innerHeight/2-this.$refs.dialog.offsetHeight/2+"px",this.$refs.dialog.style.left=window.innerWidth/2-this.$refs.dialog.offsetWidth/2+"px"},reset(){this.state.x=0,this.state.y=0,this.state.isShown=!1,this.state.hidden=!0,this.render()},render(){this.state.hidden?this.$refs.dialog.style.display="none":this.$refs.dialog.style.display="",this.$refs.dialog.style.transform="translate("+this.state.x+"px, "+this.state.y+"px)"},addListeners(){this.$refs.header.addEventListener("mousedown",this.onMouseDown.bind(this)),this.$refs.header.addEventListener("mousemove",this.onMouseMove.bind(this)),this.$refs.header.addEventListener("mouseup",this.onMouseUp.bind(this)),this.$refs.header.addEventListener("mouseleave",this.onMouseUp.bind(this)),this.$refs.header.addEventListener("touchstart",this.onTouchStart.bind(this)),this.$refs.header.addEventListener("touchmove",this.onTouchMove.bind(this)),this.$refs.header.addEventListener("touchend",this.onTouchEnd.bind(this)),this.$refs.close.addEventListener("click",this.hide.bind(this)),this.$refs.close.addEventListener("touchend",this.hide.bind(this))},removeListeners(){this.$refs.header.removeEventListener("mousedown",this.onMouseDown),this.$refs.header.removeEventListener("mousemove",this.onMouseMove),this.$refs.header.removeEventListener("mouseup",this.onMouseUp),this.$refs.header.removeEventListener("mouseleave",this.onMouseUp),this.$refs.header.removeEventListener("touchstart",this.onTouchStart),this.$refs.header.removeEventListener("touchmove",this.onTouchMove),this.$refs.header.removeEventListener("touchend",this.onTouchEnd),this.$refs.close.removeEventListener("click",this.hide),this.$refs.close.removeEventListener("touchend",this.hide)},onMouseDown(e){this.state.dragging=!0,this.state.xDiff=e.pageX-this.state.x,this.state.yDiff=e.pageY-this.state.y},onTouchStart(e){e.preventDefault(),this.state.dragging=!0,this.state.xDiff=e.targetTouches[0].pageX-this.state.x,this.state.yDiff=e.targetTouches[0].pageY-this.state.y},onMouseMove(e){this.state.dragging&&(this.state.x=e.pageX-this.state.xDiff,this.state.y=e.pageY-this.state.yDiff),this.render()},onTouchMove(e){e.preventDefault(),e.stopPropagation(),this.state.dragging&&(this.state.x=e.targetTouches[0].pageX-this.state.xDiff,this.state.y=e.targetTouches[0].pageY-this.state.yDiff),this.render()},onMouseUp(){this.state.dragging=!1},onTouchEnd(e){e.preventDefault(),this.state.dragging=!1}},mounted(){this.tabs=new Wh(this.$refs.body),this.addListeners()},beforeUnmount(){this.tabs.removeListeners(),this.removeListeners()}},Kh={ref:"dialog",class:"qti3-player-cat-dialog",role:"dialog",style:{display:"none"}},Yh={ref:"header",class:"qti3-player-cat-dialog-header"},Xh={class:"qti3-player-cat-dialog-term"},Zh={ref:"close",type:"button",class:"qti3-player-cat-dialog-close","aria-label":"Close"},Jh={ref:"body",class:"qti3-player-cat-dialog-body"};function ed(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Kh,[l.createElementVNode("div",Yh,[l.createElementVNode("span",Xh,l.toDisplayString(s.content.term),1),l.createElementVNode("button",Zh,"×",512)],512),l.createElementVNode("div",Jh,null,512)],512)}const td=te(zh,[["render",ed]]),id={name:"AmpStyle",render(){return l.h("style",{},this.$slots.default())}},nd=new re,sd={name:"AmpAudio",emits:["mediaEnded","mediaMounted"],props:{},data(){return{audio:null,audioSubType:null,currentTime:0,duration:0,displayCurrentTime:"00:00",displayDuration:"00:00",audioLoaded:!1,isPlaying:!1,isMuted:!1,isTimeUpdateListening:!0,showPlayTimer:!1,showVolumeMute:!1,showProgress:!1,showCaptions:!1,textTracksMap:null,mediaInteractionChild:!1,isDisabled:!1,isQtiValid:!0}},methods:{disable(){this.isDisabled=!0,this.pauseAudio(),this.disableController()},enable(){this.isDisabled=!1,this.enableController()},disableController(){this.$refs.playpause.setAttribute("tabindex","-1"),this.$refs.playpause.classList.add("disabled"),this.$refs.progress.setAttribute("tabindex","-1"),this.$refs.progress.classList.add("disabled"),this.$refs.volume.setAttribute("tabindex","-1"),this.$refs.volume.classList.add("disabled"),this.$refs.playtimer.classList.add("disabled")},enableController(){this.$refs.playpause.setAttribute("tabindex","0"),this.$refs.playpause.classList.remove("disabled"),(this.isMediaInteractionChild()||this.audioSubType==="audioprogress")&&(this.$refs.progress.setAttribute("tabindex","0"),this.$refs.progress.classList.remove("disabled"),this.$refs.volume.setAttribute("tabindex","0"),this.$refs.volume.classList.remove("disabled"),this.$refs.playtimer.classList.remove("disabled"))},handleLoaded(){this.audio&&(this.addControllerEventListeners(),this.duration=Math.round(this.audio.duration),this.displayDuration=this.convertTime(this.duration))},handleEnded(){this.isPlaying=!1,this.isMediaInteractionChild()&&this.$parent.$emit("mediaEnded",{})},handleCanPlay(){this.audioLoaded=!0},handleTimeUpdate(){if(!this.isTimeUpdateListening)return;let e=Math.round(this.audio.currentTime);this.currentTime=e,this.displayCurrentTime=this.convertTime(e)},handlePlayPauseClick(){this.isDisabled||this.toggleAudio()},handlePlayPauseKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleAudio(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleProgressMouseDown(){this.isDisabled||(this.isTimeUpdateListening=!1,this.audio.paused?this.wasPlaying=!1:(this.wasPlaying=!0,this.audio.pause(),this.isPlaying=!1))},handleProgressInput(e){this.isDisabled||(this.displayCurrentTime=this.convertTime(e.target.valueAsNumber))},handleProgressChange(e){this.isDisabled||(this.setPosition(e.target.valueAsNumber),this.isTimeUpdateListening=!0,this.wasPlaying&&this.audio.paused&&(this.wasPlaying=!1,this.toggleAudio()))},handleVolumeMuteClick(){this.isDisabled||this.toggleVolume()},handleVolumeMuteKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleVolume(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleCueChange(e){const t=e.target.activeCues;if(t.length>0&&this.showCaptions){const i=t[0].text.replace(/\n/g,"<br/>");console.log("[AmpAudio][currentCue]",i),this.$refs.captions.innerHTML=i}},setPosition(e){this.audio.currentTime=e,this.displayCurrentTime=this.convertTime(e)},toggleAudio(){this.audio&&(this.isPlaying?(this.isPlaying=!1,this.audio.pause()):(this.isPlaying=!0,this.audio.play()))},pauseAudio(){this.audio&&(this.audio.pause(),this.isPlaying=!1)},toggleVolume(){this.audio&&(this.audio.muted?(this.audio.muted=!1,this.isMuted=!1):(this.audio.muted=!0,this.isMuted=!0))},initSlider(){this.audio&&(this.duration=Math.round(this.audio.duration))},convertTime(e){let t=new Date(e*1e3).toISOString().substr(11,8);return t.indexOf("00:")===0&&(t=t.substr(3)),t},setAudioSubType(e){this.audioSubType=e,this.audioSubType==="audioprogress"&&(this.showProgress=!0,this.showPlayTimer=!0,this.showVolumeMute=!0)},getAudioSubType(e){if(e===null)return null;const t=e.class;if(typeof t>"u"||t===null||t.length==0)return null;const i=t.split(" ");for(let n=0;n<i.length;n++)switch(i[n]){case"sbaudio":case"audioprogress":return this.showProgress=!0,this.showPlayTimer=!0,this.showVolumeMute=!0,"audioprogress"}return null},detectAudioSubType(e){return this.getAudioSubType(e)},isMediaInteractionChild(){return this.mediaInteractionChild},detectMediaInteractionChild(){this.mediaInteractionChild=this.$parent.$el.classList.contains("qti3-player-media-group")},processChildren(){this.audio=this.$refs.player,this.audio.removeAttribute("controls"),this.textTracksMap=this.filterTextTracks(this.audio.querySelectorAll("track"))},filterTextTracks(e){let t=new Map;return e.forEach(i=>{switch(i.getAttribute("kind")){case"subtitles":case"captions":i.hasAttribute("id")||i.setAttribute("id","track-"+nd.randomString(5,"a")),t.set(i.getAttribute("id"),i);break}},this),t},isDefaultTextTrack(e){return e.hasAttribute("default")},addTextTrackCueEventListener(){this.audio&&this.audio.textTracks.length!==0&&this.audio.textTracks.forEach(e=>{const t=this.textTracksMap.get(e.id);if(typeof t<"u"&&this.isDefaultTextTrack(t)){e.addEventListener("cuechange",this.handleCueChange);return}},this)},removeTextTrackCueEventListener(){this.audio&&this.audio.textTracks.length!==0&&this.audio.textTracks.forEach(e=>{const t=this.textTracksMap.get(e.id);if(typeof t<"u"&&this.isDefaultTextTrack(t)){e.removeEventListener("cuechange",this.handleCueChange);return}},this)},addControllerEventListeners(){this.$refs.playpause.addEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.addEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.addEventListener("input",this.handleProgressInput),this.$refs.progress.addEventListener("change",this.handleProgressChange),this.$refs.progress.addEventListener("mousedown",this.handleProgressMouseDown),this.$refs.volume.addEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.addEventListener("keydown",this.handleVolumeMuteKeydown)},removeControllerEventListeners(){this.$refs.playpause.removeEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.removeEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.removeEventListener("input",this.handleProgressInput),this.$refs.progress.removeEventListener("change",this.handleProgressChange),this.$refs.progress.removeEventListener("mousedown",this.handleProgressMouseDown),this.$refs.volume.removeEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.removeEventListener("keydown",this.handleVolumeMuteKeydown)}},created(){this.setAudioSubType(this.detectAudioSubType(this.$.vnode.props))},mounted(){if(this.isQtiValid)try{if(this.detectMediaInteractionChild(),this.processChildren(),this.$nextTick(function(){this.audio&&(this.audio.addEventListener("loadedmetadata",this.handleLoaded),this.audio.addEventListener("canplay",this.handleCanPlay),this.audio.addEventListener("timeupdate",this.handleTimeUpdate),this.audio.addEventListener("ended",this.handleEnded),this.addTextTrackCueEventListener())}),this.isMediaInteractionChild()){this.$parent.$emit("mediaMounted",{node:this,mediaType:"audio"});return}this.enable()}catch(e){throw this.isQtiValid=!1,new h(e.message)}},beforeUnmount(){this.audio&&(this.audio.removeEventListener("loadedmetadata",this.handleLoaded),this.audio.removeEventListener("canplay",this.handleCanPlay),this.audio.removeEventListener("timeupdate",this.handleTimeUpdate),this.audio.removeEventListener("ended",this.handleEnded),this.removeTextTrackCueEventListener()),this.removeControllerEventListeners()}},_n=e=>(l.pushScopeId("data-v-c60c0fc9"),e=e(),l.popScopeId(),e),rd={class:"amp-audio"},ad={class:"amp-audio__holder"},od={ref:"controller",class:"amp-audio__container"},ld={ref:"playpause",class:"amp-audio-playpause__container"},ud={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},cd=[_n(()=>l.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"},null,-1))],hd={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},dd=[_n(()=>l.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1))],fd={ref:"playtimer",class:"amp-playtimer__container"},pd=_n(()=>l.createElementVNode("span",null," / ",-1)),md={class:"amp-progress__container"},gd=["max"],yd={ref:"volume",class:"amp-video-volumemute__container","aria-label":"Volume mute or unmute"},vd={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},wd=[_n(()=>l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},null,-1))],bd={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Ed=[_n(()=>l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},null,-1))],Sd={class:"amp-audio-captions__container hidden"},Td={class:"amp-audio-captions",ref:"captions"};function Cd(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",rd,[l.createElementVNode("div",ad,[l.createElementVNode("audio",l.mergeProps({ref:"player",tabIndex:"-1"},e.$attrs),[l.renderSlot(e.$slots,"default",{},void 0,!0)],16)]),l.createElementVNode("div",od,[l.createElementVNode("button",ld,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",ud,cd,512)),[[l.vShow,!s.isPlaying]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",hd,dd,512)),[[l.vShow,s.isPlaying]])],512),l.withDirectives(l.createElementVNode("div",fd,[l.createElementVNode("span",null,l.toDisplayString(s.displayCurrentTime),1),pd,l.createElementVNode("span",null,l.toDisplayString(s.displayDuration),1)],512),[[l.vShow,s.showPlayTimer]]),l.withDirectives(l.createElementVNode("div",md,[l.withDirectives(l.createElementVNode("input",{ref:"progress","onUpdate:modelValue":t[0]||(t[0]=a=>s.currentTime=a),type:"range",min:"0",max:s.duration,class:"slider"},null,8,gd),[[l.vModelText,s.currentTime]])],512),[[l.vShow,s.showProgress]]),l.withDirectives(l.createElementVNode("div",yd,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",vd,wd,512)),[[l.vShow,!s.isMuted]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",bd,Ed,512)),[[l.vShow,s.isMuted]])],512),[[l.vShow,s.showVolumeMute]])],512),l.createElementVNode("div",Sd,[l.createElementVNode("div",Td,null,512)])])}const _d=te(sd,[["render",Cd],["__scopeId","data-v-c60c0fc9"]]),xd=new re,Id={name:"AmpVideo",emits:["mediaEnded","mediaMounted"],props:{},data(){return{video:null,playerSubType:null,currentTime:0,duration:0,displayCurrentTime:"00:00",displayDuration:"00:00",videoLoaded:!1,isPlaying:!1,isMuted:!1,isTimeUpdateListening:!0,showPlayTimer:!1,showVolumeMute:!1,showProgress:!1,showCaptions:!1,textTracksMap:null,mediaInteractionChild:!1,subtitlesMenu:null,subtitleMenuButtons:[],isDisabled:!1,isQtiValid:!0}},methods:{disable(){this.isDisabled=!0,this.pauseVideo(),this.disableController()},enable(){this.isDisabled=!1,this.enableController()},disableController(){this.$refs.playpause.setAttribute("tabindex","-1"),this.$refs.playpause.classList.add("disabled"),this.$refs.progress.setAttribute("tabindex","-1"),this.$refs.progress.classList.add("disabled"),this.$refs.cc.setAttribute("tabindex","-1"),this.$refs.cc.classList.add("disabled"),this.$refs.volume.setAttribute("tabindex","-1"),this.$refs.volume.classList.add("disabled"),this.$refs.playtimer.classList.add("disabled")},enableController(){this.$refs.playpause.setAttribute("tabindex","0"),this.$refs.playpause.classList.remove("disabled"),this.$refs.progress.setAttribute("tabindex","0"),this.$refs.progress.classList.remove("disabled"),this.$refs.cc.setAttribute("tabindex","0"),this.$refs.cc.classList.remove("disabled"),this.$refs.volume.setAttribute("tabindex","0"),this.$refs.volume.classList.remove("disabled"),this.$refs.playtimer.classList.remove("disabled")},handleLoaded(){this.video&&(this.addControllerEventListeners(),this.duration=Math.round(this.video.duration),this.displayDuration=this.convertTime(this.duration))},handleEnded(){this.isPlaying=!1,this.isMediaInteractionChild()&&this.$parent.$emit("mediaEnded",{})},handleCanPlay(){this.videoLoaded=!0},handleTimeUpdate(){if(!this.isTimeUpdateListening||!this.video)return;let e=Math.round(this.video.currentTime);this.currentTime=e,this.displayCurrentTime=this.convertTime(e)},handlePlayPauseClick(){this.isDisabled||this.toggleVideo()},handlePlayPauseKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleVideo(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleProgressMouseDown(){this.isDisabled||(this.isTimeUpdateListening=!1,this.video.paused?this.wasPlaying=!1:(this.wasPlaying=!0,this.video.pause(),this.isPlaying=!1))},handleProgressInput(e){this.isDisabled||(this.displayCurrentTime=this.convertTime(e.target.valueAsNumber))},handleProgressChange(e){this.isDisabled||(this.setPosition(e.target.valueAsNumber),this.isTimeUpdateListening=!0,this.wasPlaying&&this.video.paused&&(this.wasPlaying=!1,this.toggleVideo()))},handleCaptionsClick(){this.isDisabled||this.toggleCaptionsMenu()},handleCaptionsKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleCaptionsMenu(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},toggleCaptionsMenu(){this.subtitlesMenu.style.display=this.subtitlesMenu.style.display==="block"?"none":"block"},handleVolumeMuteClick(){this.isDisabled||this.toggleVolume()},handleVolumeMuteKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleVolume(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleCueChange(){},setPosition(e){this.video.currentTime=e,this.displayCurrentTime=this.convertTime(e)},toggleVideo(){this.video&&(this.isPlaying?(this.isPlaying=!1,this.video.pause()):(this.isPlaying=!0,this.video.play()))},pauseVideo(){this.video&&(this.video.pause(),this.isPlaying=!1)},toggleVolume(){this.video&&(this.video.muted?(this.video.muted=!1,this.isMuted=!1):(this.video.muted=!0,this.isMuted=!0))},initSlider(){this.video&&(this.duration=Math.round(this.video.duration))},convertTime(e){let t=new Date(e*1e3).toISOString().substr(11,8);return t.indexOf("00:")===0&&(t=t.substr(3)),t},getPlayerSubType(){return this.showProgress=!0,this.showPlayTimer=!0,this.showVolumeMute=!0,"ampvideo-default"},detectPlayerSubType(e){return this.getPlayerSubType(e)},isMediaInteractionChild(){return this.mediaInteractionChild},detectMediaInteractionChild(){this.mediaInteractionChild=this.$parent.$el.classList.contains("qti3-player-media-group")},processChildren(){if(this.video=this.$refs.player,this.video.removeAttribute("controls"),this.video.hasAttribute("width")){const e=`${this.video.getAttribute("width")}`,t=e.endsWith("%")?`width:${e}`:`width:${e}px`;this.$refs.videocontainer.setAttribute("style",t),this.$refs.controller.setAttribute("style",t)}else this.video.setAttribute("width","100%");this.textTracksMap=this.filterTextTracks(this.video.querySelectorAll("track"))},filterTextTracks(e){let t=new Map;return e.forEach(i=>{switch(i.getAttribute("kind")){case"subtitles":case"captions":i.hasAttribute("id")||i.setAttribute("id","track-"+xd.randomString(5,"a")),t.set(i.getAttribute("id"),i);break}},this),t},isDefaultTextTrack(e){return e.hasAttribute("default")},addTextTrackCueEventListener(){if(this.video&&this.video.textTracks.length!==0){this.showCaptions=!0,this.initializeSubtitlesMenu();for(let e=0;e<this.video.textTracks.length;e++){const t=this.video.textTracks[e];t.mode="hidden",this.addSubtitlesMenuItem(t),typeof this.textTracksMap.get(t.id)<"u"&&t.addEventListener("cuechange",this.handleCueChange)}this.$refs.videocontainer.appendChild(this.subtitlesMenu)}},removeTextTrackCueEventListener(){if(this.video&&this.video.textTracks.length!==0){this.subtitleMenuButtons.forEach(e=>{e.removeEventListener("click",this.handleSubtitleButtonClick)});for(let e=0;e<this.video.textTracks.length;e++){const t=this.video.textTracks[e];typeof this.textTracksMap.get(t.id)<"u"&&t.removeEventListener("cuechange",this.handleCueChange)}}},initializeSubtitlesMenu(){const e=document.createDocumentFragment();this.subtitlesMenu=e.appendChild(document.createElement("ul")),this.subtitlesMenu.className="ampvideo-subtitles-menu",this.subtitlesMenu.appendChild(this.createMenuItem("subtitles-off","","Off"))},addSubtitlesMenuItem(e){this.subtitlesMenu.appendChild(this.createMenuItem(`subtitles-${e.language}`,e.language,e.label))},createMenuItem(e,t,i){const n=document.createElement("li"),s=n.appendChild(document.createElement("button"));return s.setAttribute("id",e),s.className="ampvideo-subtitles-button",t.length>0&&s.setAttribute("lang",t),s.value=i,t===""?s.setAttribute("data-state","active"):s.setAttribute("data-state","inactive"),s.appendChild(document.createTextNode(i)),s.addEventListener("click",this.handleSubtitleButtonClick),this.subtitleMenuButtons.push(s),n},handleSubtitleButtonClick(e){const t=e.currentTarget;this.subtitleMenuButtons.forEach(n=>{n.setAttribute("data-state","inactive")});const i=t.getAttribute("lang");for(let n=0;n<this.video.textTracks.length;n++)this.video.textTracks[n].language===i?(this.video.textTracks[n].mode="showing",t.setAttribute("data-state","active")):this.video.textTracks[n].mode="hidden";i===null&&t.setAttribute("data-state","active"),this.subtitlesMenu.style.display="none"},addControllerEventListeners(){this.$refs.playpause.addEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.addEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.addEventListener("input",this.handleProgressInput),this.$refs.progress.addEventListener("change",this.handleProgressChange),this.$refs.progress.addEventListener("mousedown",this.handleProgressMouseDown),this.$refs.cc.addEventListener("click",this.handleCaptionsClick),this.$refs.cc.addEventListener("keydown",this.handleCaptionsKeydown),this.$refs.volume.addEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.addEventListener("keydown",this.handleVolumeMuteKeydown)},removeControllerEventListeners(){this.$refs.playpause.removeEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.removeEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.removeEventListener("input",this.handleProgressInput),this.$refs.progress.removeEventListener("change",this.handleProgressChange),this.$refs.progress.removeEventListener("mousedown",this.handleProgressMouseDown),this.$refs.cc.removeEventListener("click",this.handleCaptionsClick),this.$refs.cc.removeEventListener("keydown",this.handleCaptionsKeydown),this.$refs.volume.removeEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.removeEventListener("keydown",this.handleVolumeMuteKeydown)}},created(){this.playerSubType=this.detectPlayerSubType(this.$.vnode.props)},mounted(){if(this.isQtiValid)try{if(this.detectMediaInteractionChild(),this.processChildren(),this.$nextTick(function(){this.video&&(this.video.addEventListener("loadedmetadata",this.handleLoaded),this.video.addEventListener("canplay",this.handleCanPlay),this.video.addEventListener("timeupdate",this.handleTimeUpdate),this.video.addEventListener("ended",this.handleEnded),this.addTextTrackCueEventListener())}),this.isMediaInteractionChild()){this.$parent.$emit("mediaMounted",{node:this,mediaType:"video"});return}this.enable()}catch(e){throw this.isQtiValid=!1,new h(e.message)}},beforeUnmount(){this.video&&(this.video.removeEventListener("loadedmetadata",this.handleLoaded),this.video.removeEventListener("canplay",this.handleCanPlay),this.video.removeEventListener("timeupdate",this.handleTimeUpdate),this.video.removeEventListener("ended",this.handleEnded),this.removeTextTrackCueEventListener()),this.removeControllerEventListeners()}},Vd={ref:"videocontainer",class:"amp-video"},Ad={class:"amp-video__holder"},kd={ref:"controller",class:"amp-video__container"},Od={ref:"playpause",class:"amp-video-playpause__container"},Ld={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Rd=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"},null,-1)],Md={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},$d=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1)],Nd={ref:"playtimer",class:"amp-playtimer__container"},Pd=l.createElementVNode("span",null," / ",-1),qd={class:"amp-progress__container"},Bd=["max"],Dd={ref:"cc",class:"amp-video-cc__container","aria-label":"Captions menu"},Qd={ref:"volume",class:"amp-video-volumemute__container","aria-label":"Volume mute or unmute"},Hd={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},Fd=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},null,-1)],Ud={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Gd=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},null,-1)];function jd(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Vd,[l.createElementVNode("div",Ad,[l.createElementVNode("video",l.mergeProps({ref:"player",tabIndex:"-1",class:"amp-video__video"},e.$attrs),[l.renderSlot(e.$slots,"default")],16)]),l.createElementVNode("div",kd,[l.createElementVNode("button",Od,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",Ld,Rd,512)),[[l.vShow,!s.isPlaying]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",Md,$d,512)),[[l.vShow,s.isPlaying]])],512),l.withDirectives(l.createElementVNode("div",Nd,[l.createElementVNode("span",null,l.toDisplayString(s.displayCurrentTime),1),Pd,l.createElementVNode("span",null,l.toDisplayString(s.displayDuration),1)],512),[[l.vShow,s.showPlayTimer]]),l.withDirectives(l.createElementVNode("div",qd,[l.withDirectives(l.createElementVNode("input",{ref:"progress","onUpdate:modelValue":t[0]||(t[0]=a=>s.currentTime=a),type:"range",min:"0",max:s.duration,class:"slider"},null,8,Bd),[[l.vModelText,s.currentTime]])],512),[[l.vShow,s.showProgress]]),l.withDirectives(l.createElementVNode("div",Dd," CC ",512),[[l.vShow,s.showCaptions]]),l.withDirectives(l.createElementVNode("div",Qd,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",Hd,Fd,512)),[[l.vShow,!s.isMuted]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",Ud,Gd,512)),[[l.vShow,s.isMuted]])],512),[[l.vShow,s.showVolumeMute]])],512)],512)}const Wd=te(Id,[["render",jd]]);class zd{constructor(t,i){Je(this,"constants",{supports:{GLOSSARY:"glossary-on-screen",KEYWORD_TRANSLATION:"keyword-translation",EXT_SBAC_GLOSSARY_ILLUSTRATION:"ext:sbac-glossary-illustration"},GLOSSARY_CLICKABLE_CLASS:"qti3-player-catalog-clickable-term",LANGUAGE_OFF:""});return this.item=t,this.itemElement=t.$refs.item,this.store=i,this.nodeList=null,this.showGlossary=this.showGlossaryHandler.bind(this),this}bindAll(){this.store.getCatalogs().length!==0&&(this.resetAll(),this.nodeList=this.itemElement.querySelectorAll("[data-catalog-idref]"),this.nodeList.length!==0&&this.bindGlossary(this.nodeList))}resetAll(){this.nodeList!==null&&(this.nodeList.forEach(t=>{this.unbindGlossaryDOM(t)},this),this.nodeList=null)}getPnpGlossarySupports(t){let i=[];return t.getGlossaryOnScreen()&&i.push(this.constants.supports.GLOSSARY),t.getKeywordTranslationLanguage()!==this.constants.LANGUAGE_OFF&&i.push(`${this.constants.supports.KEYWORD_TRANSLATION}:${t.getKeywordTranslationLanguage()}`),t.getExtSbacGlossaryIllustration()&&i.push(this.constants.supports.EXT_SBAC_GLOSSARY_ILLUSTRATION),i}bindGlossary(t){const i=this.getPnpGlossarySupports(this.store.getItemContextPnp());i.length!==0&&t.forEach(n=>{this.bindGlossaryNode(n,i)},this)}bindGlossaryNode(t,i){const n=t.getAttribute("data-catalog-idref"),s=this.store.getCatalog(n);typeof s>"u"||this.hasCatalogGlossarySupport(s,i)&&this.bindGlossaryDOM(t)}bindGlossaryDOM(t){t.classList.contains(this.constants.GLOSSARY_CLICKABLE_CLASS)||(t.classList.add(this.constants.GLOSSARY_CLICKABLE_CLASS),this.setGlossaryTerm(t),t.addEventListener("click",this.showGlossary),t.addEventListener("touchend",this.showGlossary))}unbindGlossaryDOM(t){t.classList.contains(this.constants.GLOSSARY_CLICKABLE_CLASS)&&(t.classList.remove(this.constants.GLOSSARY_CLICKABLE_CLASS),t.removeEventListener("click",this.showGlossary),t.removeEventListener("touchend",this.showGlossary))}setGlossaryTerm(t){if(!t.hasAttribute("data-glossary-term")){if(t.hasAttribute("data-sbac-term")){t.setAttribute("data-glossary-term",t.getAttribute("data-sbac-term"));return}t.setAttribute("data-glossary-term",t.innerText)}}showGlossaryHandler(t){t.preventDefault(),t.stopPropagation();const i=t.target.getAttribute("data-catalog-idref"),n=this.createGlossaryData(i);this.item.$parent.$emit("itemCatalogEvent",{type:"glossary",catalogIdRef:i,term:t.target.getAttribute("data-glossary-term"),data:n})}createGlossaryData(t){const i=this.store.getCatalog(t),n=this.getPnpGlossarySupports(this.store.getItemContextPnp());return this.createGlossaryDataFromCatalog(i,n)}createGlossaryDataFromCatalog(t,i){let n=[];return i.forEach(s=>{const r=this.findCatalogCardBySupport(t,s);if(r!==null){if(s===this.constants.supports.GLOSSARY||s===this.constants.supports.EXT_SBAC_GLOSSARY_ILLUSTRATION){const a=this.createGlossaryContent(r);if(a===null)return;n.push({support:s,card:a});return}if(s.startsWith(`${this.constants.supports.KEYWORD_TRANSLATION}:`)){const a=this.getLanguageCodeFromSupport(s),c=this.createTranslationContent(r,a);if(c===null)return;n.push({support:this.constants.supports.KEYWORD_TRANSLATION,card:c});return}}},this),n}hasCatalogGlossarySupport(t,i){let n=null;return i.forEach(s=>{let r=this.findCatalogCardBySupport(t,s);if(r!==null){n=r;return}},this),n!=null}getLanguageCodeFromSupport(t){const i=t.indexOf(":");return t.length>i+1?t.substring(i+1):""}findCatalogCardBySupport(t,i){return typeof t>"u"?null:this.findCardBySupport(t.node.getCards(),i)}findCardBySupport(t,i){let n=null,s="";return i.startsWith(`${this.constants.supports.KEYWORD_TRANSLATION}:`)&&(s=this.getLanguageCodeFromSupport(i),i=this.constants.supports.KEYWORD_TRANSLATION),t.forEach(r=>{if(r.support===i){if(i===this.constants.supports.KEYWORD_TRANSLATION&&this.createTranslationContent(r,s)===null)return;n=r;return}},this),n}createGlossaryContent(t){return this.getGlossaryCardContent(t)}createTranslationContent(t,i){let n=this.getTranslationCardContent(t,i);return n!==null?n:this.getTranslationCardContent(t,i,!0)}getGlossaryCardContent(t){let i=null;return t.getChildren().forEach(n=>{switch(n.$options.name){case"QtiHtmlContent":i=this.createContent("qti-html-content",n);return;case"QtiFileRef":i=this.createContent("qti-file-ref",n);return;case"QtiCardEntry":i=this.getGlossaryCardContent(n);return;default:return}},this),i}getTranslationCardContent(t,i,n=!1,s=0){if(s>1||s==0&&t.getLanguage().length>0&&t.getLanguage()!==i)return null;let r=null;return t.getChildren().forEach(a=>{switch(a.$options.name){case"QtiHtmlContent":r=this.createContent("qti-html-content",a);return;case"QtiFileRef":r=this.createContent("qti-file-ref",a);return;case"QtiCardEntry":if(n&&a.isDefault()){r=this.getTranslationCardContent(a,i,n,s+1);return}if(a.getLanguage()===i){r=this.getTranslationCardContent(a,i,n,s+1);return}return;default:return}},this),r}createContent(t,i){return{properties:{name:t},content:i.getContent()}}}const Kd={name:"EventListener",emits:["templateProcessingReady","itemBodyReady"],setup(e,t){return()=>{var i,n;return((n=(i=t.slots).default)==null?void 0:n.call(i))??null}}},Yd=new re,Xd={name:"QtiAssessmentItem",components:{EventListener:Kd},emits:["itemReady","itemCompleted","itemSuspendAttemptReady","itemEndAttemptReady","itemScoreAttemptReady","itemCatalogEvent","itemNewTemplate","itemNewTemplateCompleted"],props:{identifier:{type:String,required:!0},title:{type:String,required:!1},adaptive:{type:String,required:!1},timeDependent:{type:String,required:!1},"xml:lang":{type:String,required:!1}},data(){return{isAdaptive:!1,isTimeDependent:!1,lang:null,locale:null,catalogFactory:null,getResponsesCallback:null}},methods:{getEndAttempt(e){this.endAttempt(void 0,(function(){this.notifyAttemptResults("itemEndAttemptReady",e)}).bind(this))},getSuspendAttempt(e){W.updateItemDuration(),this.getResponses((function(){this.evaluateAttemptValidity(W.getItemContextSessionControl().getValidateResponses()),this.notifyAttemptResults("itemSuspendAttemptReady",e)}).bind(this))},getScoreAttempt(e){this.processResponses(!0),this.notifyAttemptResults("itemScoreAttemptReady",e)},notifyAttemptResults(e,t){const i=new Fr(this.identifier,W);this.$parent.$emit(e,{state:i.getSerializedState(),target:typeof t<"u"?t:null})},notifyEndAttemptInteractionResults(){const t=new Fr(this.identifier,W).getSerializedState();W.getItemContextSessionControl().getValidateResponses()&&t.validationMessages.length>0&&W.getInteractions().forEach(i=>{i.interactionType==="EndAttemptInteraction"&&i.interactionSubType==="endattempt-controller-bar"&&i.enable()}),this.$parent.$emit("itemEndAttemptReady",{state:t,target:null})},handleTemplateProcessingReady(e){console.log("[QtiAssessmentItem][TemplateProcessingReady]"),W.defineTemplateProcessing({node:e.templateProcessing}),W.hasItemContextState()||this.executeTemplateProcessing()},handleItemBodyReady(e){console.log("[QtiAssessmentItem][ItemBodyReady][Adaptive="+this.isAdaptive+"]",e),W.defineItemBody({node:e.itemBody}),this.initializeResponseDeclarations(W.hasItemContextState()),this.initializeOutcomeDeclarations(W.hasItemContextState()),this.isAdaptive&&this.evaluateFeedbacks(),(W.getItemLifecycleStatus()==="closed"||W.getItemLifecycleStatus()==="review"||W.getItemLifecycleStatus()==="solution")&&(W.resetItemTimer(),this.disableInteractions())},getItemBody(){return W.getItemBody()},getTemplateProcessing(){let e=W.getProcessing("template");return typeof e>"u"?null:e.node},getResponseProcessing(){let e=W.getProcessing("response");return typeof e>"u"?null:e.node},newTemplate(){console.log("[QtiAssessmentItem][NewTemplate][Started]"),this.$parent.$emit("itemNewTemplate"),this.resetResponseDeclarations(),this.resetInteractions(),this.resetTemplateDeclarations(),this.executeTemplateProcessing(),this.evaluatePrintedVariables(),this.evaluateTemplateMathVariables(),this.evaluateTemplates(),this.resetOutcomeDeclarations(),this.evaluateFeedbacks(),W.restartItemTimer(),console.log("[QtiAssessmentItem][NewTemplate][Completed]"),this.$parent.$emit("itemNewTemplateCompleted")},evaluateTemplateMathVariables(){if(W.getTemplateMathParameterVariables().length===0)return;const t=this.getItemBody();t!==null&&t.updateTemplateMathVariables(),W.getFeedbacks().forEach(i=>{i.feedbackType==="Modal"&&i.node.updateTemplateMathVariables()})},executeTemplateProcessing(){let e=this.getTemplateProcessing();e!==null&&e.evaluate()},initializeOutcomeDeclarations(e){e?W.restoreOutcomeVariables():this.resetOutcomeDeclarations()},resetOutcomeDeclarations(){W.getOutcomeDeclarations().forEach(e=>{this.resetOutcomeDeclaration(e)},this)},resetOutcomeDeclaration(e){if(e.node!==void 0){e.node.reset();return}W.setOutcomeVariableValue({identifier:e.identifier,value:e.defaultValue})},initializeResponseDeclarations(e){e?W.restoreResponseVariables():this.resetResponseDeclarations()},resetResponseDeclarations(){W.getResponseDeclarations().forEach(e=>{e.resetValue&&e.resetValue()})},resetTemplateDeclarations(){W.getTemplateDeclarations().forEach(e=>{e.node.reset()})},resetInteractions(){W.getInteractions().forEach(e=>{console.log("[ResetInteractions]["+e.identifier+"]",e),e.resetValue&&e.resetValue(),e.node.enable&&e.node.enable()}),W.resetInteractionStateIsValidResponse()},disableInteractions(){W.getInteractions().forEach(e=>{e.node.disable&&e.node.disable()})},showSolutionInteractions(){W.getItemContextSessionControl().getShowSolution()&&W.getItemLifecycleState()==="solution"&&W.getInteractions().forEach(e=>{e.node.showSolution&&e.node.showSolution(W.getResponseVariableCorrectResponse(e.identifier))})},evaluateFeedbacks(){console.log("[EvaluateFeedback][Started]"),W.getFeedbacks().forEach(e=>{e.node.evaluate()}),console.log("[EvaluateFeedback][Completed]")},evaluatePrintedVariables(){console.log("[EvaluatePrintedVariables][Started]"),W.getPrintedVariables().forEach(e=>{e.node.evaluate()}),console.log("[EvaluatePrintedVariables][Completed]")},evaluateTemplates(){console.log("[EvaluateTemplates][Started]"),W.getTemplates().forEach(e=>{e.node.evaluate()}),console.log("[EvaluateTemplates][Completed]")},endAttempt(e,t){console.log("[EndAttempt][Start][Identifier]",this.identifier),W.updateItemDuration(),this.getResponses((function(){if(!this.evaluateAttemptValidity(W.getItemContextSessionControl().getValidateResponses())){console.log("[EndAttempt][InvalidResponses][Identifier]",this.identifier),t&&t();return}this.processResponses(),this.isAdaptive&&this.evaluateItemCompleted(),this.updateItemBodyUI(e),console.log("[EndAttempt][Complete][Identifier]",this.identifier),t&&t()}).bind(this))},updateItemBodyUI(e){typeof e>"u"||e.interactionSubType!=="endattempt-controller-bar"&&W.getInteractions().forEach(t=>{if(t.interactionType==="EndAttemptInteraction"){if(t.interactionSubType==="endattempt-controller-bar"){t.disable();return}if(this.isAdaptive){if(this.isAdaptiveItemCompleted()){t.disable();return}t.enable()}}})},getResponses(e){console.log("[GetResponses][Start]"),W.getAsyncStateMap().clear(),this.getResponsesCallback=e;let t=W.getResponseDeclarations();for(let i=0;i<t.length;i++){const n=t[i],s=W.getInteraction(n.identifier);if(typeof s>"u"){n.identifier!=="numAttempts"&&n.identifier!=="duration"&&W.resetResponseVariableValue({identifier:n.identifier,value:n.defaultValue,state:null});continue}if(s.interactionType!=="PortableCustom"){console.log("[GetResponses]["+n.identifier+"]:",s.node.getResponse()),W.setResponseVariableValue({identifier:n.identifier,value:s.node.getResponse(),state:s.node.getState()});continue}s.node.pciIsReady()?W.getAsyncStateMap().set(s.identifier,{identifier:s.identifier,node:s.node}):W.setResponseVariableValue({identifier:n.identifier,value:s.node.getResponse(),state:s.node.getState()})}this.initiateAsyncGetResponsesRequests()},initiateAsyncGetResponsesRequests(){if(W.getAsyncStateMap().size===0)return this.triggerGetResponsesComplete();for(const[e,t]of W.getAsyncStateMap().entries())console.log("[GetResponses]["+e+"][PCI Initiate]"),t.node.getStateRequest()},triggerGetResponsesComplete(){console.log("[GetResponses][Complete]"),typeof this.getResponsesCallback=="function"&&this.getResponsesCallback()},evaluateItemCompleted(){this.isAdaptiveItemCompleted()&&(W.resetItemTimer(),this.$parent.$emit("itemCompleted"))},isAdaptiveItemCompleted(){return W.getOutcomeDeclaration("completionStatus").value==="completed"},processResponses(e=!1){console.log("[ProcessResponses][Started]"),e||W.incrementNumAttempts(),console.log("[ProcessResponses][IsAdaptive]",this.isAdaptive),this.isAdaptive||this.resetOutcomeDeclarations();let t=this.getResponseProcessing();t!==null&&t.evaluate(),e||(this.printOutcomeDeclarations(),this.evaluatePrintedVariables(),W.getItemContextSessionControl().getShowFeedback()&&this.evaluateFeedbacks()),console.log("[ProcessResponses][Completed]")},evaluateAttemptValidity(e){return e?(W.resetItemContextValidationMessages(),this.evaluateInteractionResponseValidity(W.getInteractions())):!0},evaluateInteractionResponseValidity(e){let t=!0;return e.forEach(i=>{i.isValidResponse||(W.addItemContextValidationMessage({identifier:i.identifier,message:i.invalidResponseMessage}),t=!1)}),t},bindCatalog(){this.catalogFactory!==null&&this.catalogFactory.bindAll()},setLang(e,t){t!==null&&e.setAttribute("lang",t)},coerceItemAttributes(){this.isTimeDependent=typeof this.timeDependent>"u"?!1:this.timeDependent==="true",this.isAdaptive=typeof this.adaptive>"u"?!1:this.adaptive==="true",this.lang=Yd.parseXmlLangAttribute(this.$props["xml:lang"]),this.locale=this.lang===null?"en":this.lang},printOutcomeDeclarations(){W.getOutcomeDeclarations().forEach(e=>{(this.isAdaptive||e.identifier!=="completionStatus")&&console.log("[ProcessResponses][Outcomes]["+e.identifier+"][Value]",e.value)})}},errorCaptured(e,t){return console.log("["+e.name+"]["+t.$options.name+"] "+e.message),!1},created(){this.coerceItemAttributes()},mounted(){this.setLang(this.$refs.item,this.lang),this.catalogFactory=new zd(this,W),this.bindCatalog(),this.$parent.$emit("itemReady",{item:this})},beforeUnmount(){this.catalogFactory.resetAll()}},Zd={ref:"item",class:"qti-assessment-item"};function Jd(e,t,i,n,s,r){const a=l.resolveComponent("event-listener");return l.openBlock(),l.createElementBlock("div",Zd,[l.createVNode(a,{onTemplateProcessingReady:r.handleTemplateProcessingReady,onItemBodyReady:r.handleItemBodyReady},{default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(e.$slots,"default")])]),_:3},8,["onTemplateProcessingReady","onItemBodyReady"])],512)}const ef=te(Xd,[["render",Jd]]),Ls=new re,tf=new me,nf={name:"QtiContextDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0}},data(){return{value:null,defaultValue:null,isQtiValid:!0}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getDefaultValue(){return this.defaultValue},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}this.setValue(tf.nullValue())},reset(){this.initializeValue()},validateChildren(){let e=!1;this.$slots.default&&this.$slots.default().forEach(t=>{if(Ls.isValidSlot(t)){if(t.type.name==="QtiDefaultValue"){if(!e)return e=!0;throw new h("Maximum of 1 qti-default-value element permitted")}throw new h('Element must be one of qti-default-value: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.component!==null){if(t.type.name==="QtiDefaultValue")return this.defaultValue=t.component.proxy.getValue();throw new h("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')}})},getPriorState(e){const t=W.getItemContextStateVariable(e);if(console.log("[ContextDeclaration]["+e+"][priorState]",t),t===null)return null;if(!("value"in t))throw new ee('Variable Restore State Invalid. "value" property not found.');return this.setValue(t.value),t}},created:function(){try{Ls.validateCardinality(this.cardinality),Ls.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),Ls.validateIdentifierAttribute(this.identifier),this.validateChildren(),W.defineContextDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:null,resetValue:this.reset,defaultValue:null})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted:function(){if(this.isQtiValid)try{this.processChildren(),this.getPriorState(this.identifier)===null&&this.initializeValue(),W.defineContextDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:this.getValue(),resetValue:this.reset,defaultValue:this.defaultValue}),console.log("["+this.$options.name+"]["+this.identifier+"][DefaultValue]",this.defaultValue)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},sf=["identifier"];function rf(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-context-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,sf)}const af=te(nf,[["render",rf]]),Rs=new re,of=new me,lf={name:"QtiResponseDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0}},data(){return{value:null,state:null,defaultValue:null,correctResponse:null,mapping:null,areaMapping:null,isQtiValid:!0}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},getState(){return this.state},setState(e){this.state=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getDefaultValue(){return this.defaultValue},getCorrectResponse(){return this.correctResponse},getMapping(){return this.mapping},getAreaMapping(){return this.areaMapping},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}this.setValue(of.nullValue())},validateChildren(){let e=!1,t=!1,i=!1,n=!1;this.$slots.default&&this.$slots.default().forEach(s=>{if(Rs.isValidSlot(s)){if(s.type.name==="QtiCorrectResponse"){if(!e)return e=!0;throw new h("Maximum of 1 qti-correct-response element permitted")}if(s.type.name==="QtiDefaultValue"){if(!t)return t=!0;throw new h("Maximum of 1 qti-default-value element permitted")}if(s.type.name==="QtiMapping"){if(!i)return i=!0;throw new h("Maximum of 1 qti-mapping element permitted")}if(s.type.name==="QtiAreaMapping"){if(!n)return n=!0;throw new h("Maximum of 1 qti-area-mapping element permitted")}throw new h('Element must be one of qti-correct-response, qti-default-value, qti-mapping, qti-area-mapping: "'+s.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.type.name==="QtiCorrectResponse"&&t.component!==null)return this.correctResponse=t.component.proxy.getValue();if(t.type.name==="QtiDefaultValue"&&t.component!==null)return this.defaultValue=t.component.proxy.getValue();if(t.type.name==="QtiMapping"&&t.component!==null)return this.mapping=t.component.proxy;throw new h("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')})},getPriorState(e){const t=W.getItemContextStateVariable(e);if(console.log("[ResponseDeclaration]["+e+"][priorState]",t),t===null)return null;if(!("value"in t))throw new ee('Variable Restore State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Variable Restore State Invalid. "state" property not found.');return this.setValue(t.value),this.setState(t.state),t}},created(){try{Rs.validateCardinality(this.cardinality),Rs.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),Rs.validateIdentifierAttribute(this.identifier),this.validateChildren(),W.defineResponseDeclaration({identifier:this.getIdentifier(),baseType:this.getBaseType(),cardinality:this.getCardinality(),value:null,state:null,defaultValue:null,correctResponse:null,mapping:null,areaMapping:null})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.getPriorState(this.identifier)===null&&this.initializeValue(),W.defineResponseDeclaration({identifier:this.getIdentifier(),baseType:this.getBaseType(),cardinality:this.getCardinality(),value:this.getValue(),state:this.getState(),defaultValue:this.getDefaultValue(),correctResponse:this.getCorrectResponse(),mapping:this.getMapping(),areaMapping:this.getAreaMapping()}),console.log("["+this.$options.name+"]["+this.identifier+"][CorrectResponse]",this.correctResponse,"[Mapping]",this.mapping)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},uf=["identifier"];function cf(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",{ref:"root",class:"qti-response-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,uf)}const hf=te(lf,[["render",cf]]),Ei=new re,Do=new me,df={name:"QtiOutcomeDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0},view:{type:String,required:!1,default:null},interpretation:{type:String,required:!1,default:null},longInterpretation:{type:String,required:!1,default:null},normalMaximum:{type:String,required:!1},normalMinimum:{type:String,required:!1},masteryValue:{type:String,required:!1},externalScored:{type:String,required:!1,default:null},variableIdentifierRef:{type:String,required:!1,default:null}},data(){return{value:null,defaultValue:null,lookupTable:null,isQtiValid:!0,normalMaximumValue:null,normalMinimumValue:null,masteryValueValue:null}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getNormalMaximumValue(){return this.normalMaximumValue},getNormalMinimumValue(){return this.normalMinimumValue},getMasteryValueValue(){return this.masteryValueValue},getDefaultValue(){return this.defaultValue},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}if(this.getCardinality()==="single"&&Do.isBaseTypeNumeric(this.getBaseType())){this.setValue(new ce(0).toNumber());return}this.setValue(Do.nullValue())},reset(){this.initializeValue(),W.setOutcomeVariableValue({identifier:this.identifier,value:this.getValue()})},validateChildren(){let e=!1,t=!1,i=!1;this.$slots.default&&this.$slots.default().forEach(n=>{if(Ei.isValidSlot(n)){if(n.type.name==="QtiDefaultValue"){if(!e)return e=!0;throw new h("Maximum of 1 qti-default-value element permitted")}if(n.type.name==="QtiMatchTable"){if(i)throw new h("Maximum of 1 lookupTable permitted");if(!t)return t=!0;throw new h("Maximum of 1 qti-match-table element permitted")}if(n.type.name==="QtiInterpolationTable"){if(t)throw new h("Maximum of 1 lookupTable permitted");if(!i)return i=!0;throw new h("Maximum of 1 qti-interpolation-table element permitted")}throw new h('Element must be one of qti-default-value, qti-match-table, qti-interpolation-table: "'+n.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.type.name==="QtiDefaultValue"&&t.component!==null)return this.defaultValue=t.component.proxy.getValue();if((t.type.name==="QtiMatchTable"||t.type.name==="QtiLookupTable")&&t.component!==null)return this.lookupTable=t.component.proxy;throw new h("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')})},getPriorState(e){const t=W.getItemContextStateVariable(e);if(console.log("[OutcomeDeclaration]["+e+"][priorState]",t),t===null)return null;if(!("value"in t))throw new ee('Variable Restore State Invalid. "value" property not found.');return this.setValue(t.value),t}},created(){try{if(Ei.validateCardinality(this.cardinality),Ei.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),Ei.validateIdentifierAttribute(this.identifier),this.validateChildren(),this.normalMaximumValue=Ei.validateFloatAttribute("normal-maximum",this.normalMaximum,!1,null),this.normalMaximumValue!==null&&this.normalMaximumValue<=0)throw new h('Outcome declaration "'+this.identifier+'" has invalid normal-maximum attribute value. Must be a positive value.');if(this.normalMinimumValue=Ei.validateFloatAttribute("normal-minimum",this.normalMinimum,!1,null),this.masteryValueValue=Ei.validateFloatAttribute("mastery-value",this.masteryValue,!1,null),this.identifier==="SCORE"||this.identifier==="MAXSCORE"){if(typeof this.baseType>"u"||this.baseType!=="float")throw new h('Outcome declaration "'+this.identifier+'" has invalid base-type. Must be base-type="float".');if(typeof this.cardinality>"u"||this.cardinality!=="single")throw new h('Outcome declaration "'+this.identifier+'" has invalid cardinality. Must be cardinality="single".')}W.defineOutcomeDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),view:this.view,interpretation:this.interpretation,longInterpretation:this.longInterpretation,normalMaximum:this.getNormalMaximumValue(),normalMinimum:this.getNormalMinimumValue(),masteryValue:this.getMasteryValueValue(),externalScored:this.externalScored,variableIdentifierRef:this.variableIdentifierRef,value:null,defaultValue:null,node:this})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.getPriorState(this.identifier)===null&&this.initializeValue(),W.defineOutcomeDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),view:this.view,interpretation:this.interpretation,longInterpretation:this.longInterpretation,normalMaximum:this.getNormalMaximumValue(),normalMinimum:this.getNormalMinimumValue(),masteryValue:this.getMasteryValueValue(),externalScored:this.externalScored,variableIdentifierRef:this.variableIdentifierRef,value:this.getValue(),defaultValue:this.defaultValue,lookupTable:this.lookupTable,lookupTableType:this.lookupTableType,node:this}),console.log("["+this.$options.name+"]["+this.identifier+"][DefaultValue]",this.defaultValue,"[lookupTable]",this.lookupTable)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},ff=["identifier"];function pf(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-outcome-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,ff)}const mf=te(df,[["render",pf]]),Ms=new re,gf=new me,yf={name:"QtiTemplateDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0},paramVariable:{type:String,required:!1,default:"false"},mathVariable:{type:String,required:!1,default:"false"}},data(){return{value:null,defaultValue:null,isQtiValid:!0}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getDefaultValue(){return this.defaultValue},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}this.setValue(gf.nullValue())},reset(){this.initializeValue(),W.setTemplateVariableValue({identifier:this.identifier,value:this.getValue()})},validateChildren(){let e=!1;this.$slots.default&&this.$slots.default().forEach(t=>{if(Ms.isValidSlot(t)){if(t.type.name==="QtiDefaultValue"){if(!e)return e=!0;throw new h("Maximum of 1 qti-default-value element permitted")}throw new h('Element must be qti-default-value: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.type.name==="QtiDefaultValue"&&t.component!==null)return this.defaultValue=t.component.proxy.getValue();throw new h("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')})},readChildren:function(){this.$children.forEach(e=>{switch(e.$el.className){case"qti-default-value":this.defaultValue=e.getValue();break;default:throw new h("["+this.$options.name+'][Unhandled Child Node]: "'+e.$el.className+'"')}})},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Variable Restore State Invalid. "value" property not found.');return this.setValue(t.value),t}},created:function(){try{Ms.validateCardinality(this.cardinality),Ms.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),Ms.validateIdentifierAttribute(this.identifier),this.validateChildren(),W.defineTemplateDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:null,defaultValue:null,paramVariable:this.paramVariable==="true",mathVariable:this.mathVariable==="true",node:this})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted:function(){if(this.isQtiValid)try{this.processChildren(),this.getPriorState(this.identifier)===null&&this.initializeValue(),W.defineTemplateDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:this.getValue(),defaultValue:this.getDefaultValue(),paramVariable:this.paramVariable==="true",mathVariable:this.mathVariable==="true",node:this}),console.log("["+this.$options.name+"]["+this.identifier+"][Value]",this.getValue())}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},vf=["identifier"];function wf(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-template-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,vf)}const bf=te(yf,[["render",wf]]);function Qo(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ef}=Object.prototype,{getPrototypeOf:Wr}=Object,$s=(e=>t=>{const i=Ef.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Bt=e=>(e=e.toLowerCase(),t=>$s(t)===e),Ns=e=>t=>typeof t===e,{isArray:Di}=Array,xn=Ns("undefined");function Sf(e){return e!==null&&!xn(e)&&e.constructor!==null&&!xn(e.constructor)&&Lt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ho=Bt("ArrayBuffer");function Tf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ho(e.buffer),t}const Cf=Ns("string"),Lt=Ns("function"),Fo=Ns("number"),Ps=e=>e!==null&&typeof e=="object",_f=e=>e===!0||e===!1,qs=e=>{if($s(e)!=="object")return!1;const t=Wr(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},xf=Bt("Date"),If=Bt("File"),Vf=Bt("Blob"),Af=Bt("FileList"),kf=e=>Ps(e)&&Lt(e.pipe),Of=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Lt(e.append)&&((t=$s(e))==="formdata"||t==="object"&&Lt(e.toString)&&e.toString()==="[object FormData]"))},Lf=Bt("URLSearchParams"),[Rf,Mf,$f,Nf]=["ReadableStream","Request","Response","Headers"].map(Bt),Pf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function In(e,t,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),Di(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{const r=i?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;let c;for(n=0;n<a;n++)c=r[n],t.call(null,e[c],c,e)}}function Uo(e,t){t=t.toLowerCase();const i=Object.keys(e);let n=i.length,s;for(;n-- >0;)if(s=i[n],t===s.toLowerCase())return s;return null}const Go=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,jo=e=>!xn(e)&&e!==Go;function zr(){const{caseless:e}=jo(this)&&this||{},t={},i=(n,s)=>{const r=e&&Uo(t,s)||s;qs(t[r])&&qs(n)?t[r]=zr(t[r],n):qs(n)?t[r]=zr({},n):Di(n)?t[r]=n.slice():t[r]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&In(arguments[n],i);return t}const qf=(e,t,i,{allOwnKeys:n}={})=>(In(t,(s,r)=>{i&&Lt(s)?e[r]=Qo(s,i):e[r]=s},{allOwnKeys:n}),e),Bf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Df=(e,t,i,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},Qf=(e,t,i,n)=>{let s,r,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)a=s[r],(!n||n(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=i!==!1&&Wr(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},Hf=(e,t,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=t.length;const n=e.indexOf(t,i);return n!==-1&&n===i},Ff=e=>{if(!e)return null;if(Di(e))return e;let t=e.length;if(!Fo(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},Uf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Wr(Uint8Array)),Gf=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=n.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},jf=(e,t)=>{let i;const n=[];for(;(i=e.exec(t))!==null;)n.push(i);return n},Wf=Bt("HTMLFormElement"),zf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,n,s){return n.toUpperCase()+s}),Wo=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),Kf=Bt("RegExp"),zo=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),n={};In(i,(s,r)=>{let a;(a=t(s,r,e))!==!1&&(n[r]=a||s)}),Object.defineProperties(e,n)},Yf=e=>{zo(e,(t,i)=>{if(Lt(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const n=e[i];if(Lt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Xf=(e,t)=>{const i={},n=s=>{s.forEach(r=>{i[r]=!0})};return Di(e)?n(e):n(String(e).split(t)),i},Zf=()=>{},Jf=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Kr="abcdefghijklmnopqrstuvwxyz",Ko="0123456789",Yo={DIGIT:Ko,ALPHA:Kr,ALPHA_DIGIT:Kr+Kr.toUpperCase()+Ko},ep=(e=16,t=Yo.ALPHA_DIGIT)=>{let i="";const{length:n}=t;for(;e--;)i+=t[Math.random()*n|0];return i};function tp(e){return!!(e&&Lt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ip=e=>{const t=new Array(10),i=(n,s)=>{if(Ps(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[s]=n;const r=Di(n)?[]:{};return In(n,(a,c)=>{const y=i(a,s+1);!xn(y)&&(r[c]=y)}),t[s]=void 0,r}}return n};return i(e,0)},np=Bt("AsyncFunction"),se={isArray:Di,isArrayBuffer:Ho,isBuffer:Sf,isFormData:Of,isArrayBufferView:Tf,isString:Cf,isNumber:Fo,isBoolean:_f,isObject:Ps,isPlainObject:qs,isReadableStream:Rf,isRequest:Mf,isResponse:$f,isHeaders:Nf,isUndefined:xn,isDate:xf,isFile:If,isBlob:Vf,isRegExp:Kf,isFunction:Lt,isStream:kf,isURLSearchParams:Lf,isTypedArray:Uf,isFileList:Af,forEach:In,merge:zr,extend:qf,trim:Pf,stripBOM:Bf,inherits:Df,toFlatObject:Qf,kindOf:$s,kindOfTest:Bt,endsWith:Hf,toArray:Ff,forEachEntry:Gf,matchAll:jf,isHTMLForm:Wf,hasOwnProperty:Wo,hasOwnProp:Wo,reduceDescriptors:zo,freezeMethods:Yf,toObjectSet:Xf,toCamelCase:zf,noop:Zf,toFiniteNumber:Jf,findKey:Uo,global:Go,isContextDefined:jo,ALPHABET:Yo,generateString:ep,isSpecCompliantForm:tp,toJSONObject:ip,isAsyncFn:np,isThenable:e=>e&&(Ps(e)||Lt(e))&&Lt(e.then)&&Lt(e.catch)};function Oe(e,t,i,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),s&&(this.response=s)}se.inherits(Oe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:se.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Xo=Oe.prototype,Zo={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Zo[e]={value:e}}),Object.defineProperties(Oe,Zo),Object.defineProperty(Xo,"isAxiosError",{value:!0}),Oe.from=(e,t,i,n,s,r)=>{const a=Object.create(Xo);return se.toFlatObject(e,a,function(y){return y!==Error.prototype},c=>c!=="isAxiosError"),Oe.call(a,e.message,t,i,n,s),a.cause=e,a.name=e.name,r&&Object.assign(a,r),a};const sp=null;function Yr(e){return se.isPlainObject(e)||se.isArray(e)}function Jo(e){return se.endsWith(e,"[]")?e.slice(0,-2):e}function el(e,t,i){return e?e.concat(t).map(function(s,r){return s=Jo(s),!i&&r?"["+s+"]":s}).join(i?".":""):t}function rp(e){return se.isArray(e)&&!e.some(Yr)}const ap=se.toFlatObject(se,{},null,function(t){return/^is[A-Z]/.test(t)});function Bs(e,t,i){if(!se.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,i=se.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,_){return!se.isUndefined(_[b])});const n=i.metaTokens,s=i.visitor||f,r=i.dots,a=i.indexes,y=(i.Blob||typeof Blob<"u"&&Blob)&&se.isSpecCompliantForm(t);if(!se.isFunction(s))throw new TypeError("visitor must be a function");function w(S){if(S===null)return"";if(se.isDate(S))return S.toISOString();if(!y&&se.isBlob(S))throw new Oe("Blob is not supported. Use a Buffer instead.");return se.isArrayBuffer(S)||se.isTypedArray(S)?y&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function f(S,b,_){let E=S;if(S&&!_&&typeof S=="object"){if(se.endsWith(b,"{}"))b=n?b:b.slice(0,-2),S=JSON.stringify(S);else if(se.isArray(S)&&rp(S)||(se.isFileList(S)||se.endsWith(b,"[]"))&&(E=se.toArray(S)))return b=Jo(b),E.forEach(function(A,u){!(se.isUndefined(A)||A===null)&&t.append(a===!0?el([b],u,r):a===null?b:b+"[]",w(A))}),!1}return Yr(S)?!0:(t.append(el(_,b,r),w(S)),!1)}const g=[],p=Object.assign(ap,{defaultVisitor:f,convertValue:w,isVisitable:Yr});function d(S,b){if(!se.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+b.join("."));g.push(S),se.forEach(S,function(E,m){(!(se.isUndefined(E)||E===null)&&s.call(t,E,se.isString(m)?m.trim():m,b,p))===!0&&d(E,b?b.concat(m):[m])}),g.pop()}}if(!se.isObject(e))throw new TypeError("data must be an object");return d(e),t}function tl(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Xr(e,t){this._pairs=[],e&&Bs(e,this,t)}const il=Xr.prototype;il.append=function(t,i){this._pairs.push([t,i])},il.toString=function(t){const i=t?function(n){return t.call(this,n,tl)}:tl;return this._pairs.map(function(s){return i(s[0])+"="+i(s[1])},"").join("&")};function op(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nl(e,t,i){if(!t)return e;const n=i&&i.encode||op,s=i&&i.serialize;let r;if(s?r=s(t,i):r=se.isURLSearchParams(t)?t.toString():new Xr(t,i).toString(n),r){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class sl{constructor(){this.handlers=[]}use(t,i,n){return this.handlers.push({fulfilled:t,rejected:i,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){se.forEach(this.handlers,function(n){n!==null&&t(n)})}}const rl={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},lp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Xr,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Zr=typeof window<"u"&&typeof document<"u",up=(e=>Zr&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),cp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hp=Zr&&window.location.href||"http://localhost",Dt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Zr,hasStandardBrowserEnv:up,hasStandardBrowserWebWorkerEnv:cp,origin:hp},Symbol.toStringTag,{value:"Module"})),...lp};function dp(e,t){return Bs(e,new Dt.classes.URLSearchParams,Object.assign({visitor:function(i,n,s,r){return Dt.isNode&&se.isBuffer(i)?(this.append(n,i.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function fp(e){return se.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function pp(e){const t={},i=Object.keys(e);let n;const s=i.length;let r;for(n=0;n<s;n++)r=i[n],t[r]=e[r];return t}function al(e){function t(i,n,s,r){let a=i[r++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),y=r>=i.length;return a=!a&&se.isArray(s)?s.length:a,y?(se.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!c):((!s[a]||!se.isObject(s[a]))&&(s[a]=[]),t(i,n,s[a],r)&&se.isArray(s[a])&&(s[a]=pp(s[a])),!c)}if(se.isFormData(e)&&se.isFunction(e.entries)){const i={};return se.forEachEntry(e,(n,s)=>{t(fp(n),s,i,0)}),i}return null}function mp(e,t,i){if(se.isString(e))try{return(t||JSON.parse)(e),se.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(i||JSON.stringify)(e)}const Vn={transitional:rl,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){const n=i.getContentType()||"",s=n.indexOf("application/json")>-1,r=se.isObject(t);if(r&&se.isHTMLForm(t)&&(t=new FormData(t)),se.isFormData(t))return s?JSON.stringify(al(t)):t;if(se.isArrayBuffer(t)||se.isBuffer(t)||se.isStream(t)||se.isFile(t)||se.isBlob(t)||se.isReadableStream(t))return t;if(se.isArrayBufferView(t))return t.buffer;if(se.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return dp(t,this.formSerializer).toString();if((c=se.isFileList(t))||n.indexOf("multipart/form-data")>-1){const y=this.env&&this.env.FormData;return Bs(c?{"files[]":t}:t,y&&new y,this.formSerializer)}}return r||s?(i.setContentType("application/json",!1),mp(t)):t}],transformResponse:[function(t){const i=this.transitional||Vn.transitional,n=i&&i.forcedJSONParsing,s=this.responseType==="json";if(se.isResponse(t)||se.isReadableStream(t))return t;if(t&&se.isString(t)&&(n&&!this.responseType||s)){const a=!(i&&i.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?Oe.from(c,Oe.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dt.classes.FormData,Blob:Dt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};se.forEach(["delete","get","head","post","put","patch"],e=>{Vn.headers[e]={}});const gp=se.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),yp=e=>{const t={};let i,n,s;return e&&e.split(`
85
+ `).forEach(function(a){s=a.indexOf(":"),i=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!i||t[i]&&gp[i])&&(i==="set-cookie"?t[i]?t[i].push(n):t[i]=[n]:t[i]=t[i]?t[i]+", "+n:n)}),t},ol=Symbol("internals");function An(e){return e&&String(e).trim().toLowerCase()}function Ds(e){return e===!1||e==null?e:se.isArray(e)?e.map(Ds):String(e)}function vp(e){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(e);)t[n[1]]=n[2];return t}const wp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Jr(e,t,i,n,s){if(se.isFunction(n))return n.call(this,t,i);if(s&&(t=i),!!se.isString(t)){if(se.isString(n))return t.indexOf(n)!==-1;if(se.isRegExp(n))return n.test(t)}}function bp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,n)=>i.toUpperCase()+n)}function Ep(e,t){const i=se.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+i,{value:function(s,r,a){return this[n].call(this,t,s,r,a)},configurable:!0})})}class yt{constructor(t){t&&this.set(t)}set(t,i,n){const s=this;function r(c,y,w){const f=An(y);if(!f)throw new Error("header name must be a non-empty string");const g=se.findKey(s,f);(!g||s[g]===void 0||w===!0||w===void 0&&s[g]!==!1)&&(s[g||y]=Ds(c))}const a=(c,y)=>se.forEach(c,(w,f)=>r(w,f,y));if(se.isPlainObject(t)||t instanceof this.constructor)a(t,i);else if(se.isString(t)&&(t=t.trim())&&!wp(t))a(yp(t),i);else if(se.isHeaders(t))for(const[c,y]of t.entries())r(y,c,n);else t!=null&&r(i,t,n);return this}get(t,i){if(t=An(t),t){const n=se.findKey(this,t);if(n){const s=this[n];if(!i)return s;if(i===!0)return vp(s);if(se.isFunction(i))return i.call(this,s,n);if(se.isRegExp(i))return i.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=An(t),t){const n=se.findKey(this,t);return!!(n&&this[n]!==void 0&&(!i||Jr(this,this[n],n,i)))}return!1}delete(t,i){const n=this;let s=!1;function r(a){if(a=An(a),a){const c=se.findKey(n,a);c&&(!i||Jr(n,n[c],c,i))&&(delete n[c],s=!0)}}return se.isArray(t)?t.forEach(r):r(t),s}clear(t){const i=Object.keys(this);let n=i.length,s=!1;for(;n--;){const r=i[n];(!t||Jr(this,this[r],r,t,!0))&&(delete this[r],s=!0)}return s}normalize(t){const i=this,n={};return se.forEach(this,(s,r)=>{const a=se.findKey(n,r);if(a){i[a]=Ds(s),delete i[r];return}const c=t?bp(r):String(r).trim();c!==r&&delete i[r],i[c]=Ds(s),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return se.forEach(this,(n,s)=>{n!=null&&n!==!1&&(i[s]=t&&se.isArray(n)?n.join(", "):n)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(`
86
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const n=new this(t);return i.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[ol]=this[ol]={accessors:{}}).accessors,s=this.prototype;function r(a){const c=An(a);n[c]||(Ep(s,a),n[c]=!0)}return se.isArray(t)?t.forEach(r):r(t),this}}yt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),se.reduceDescriptors(yt.prototype,({value:e},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[i]=n}}}),se.freezeMethods(yt);function ea(e,t){const i=this||Vn,n=t||i,s=yt.from(n.headers);let r=n.data;return se.forEach(e,function(c){r=c.call(i,r,s.normalize(),t?t.status:void 0)}),s.normalize(),r}function ll(e){return!!(e&&e.__CANCEL__)}function Qi(e,t,i){Oe.call(this,e??"canceled",Oe.ERR_CANCELED,t,i),this.name="CanceledError"}se.inherits(Qi,Oe,{__CANCEL__:!0});function ul(e,t,i){const n=i.config.validateStatus;!i.status||!n||n(i.status)?e(i):t(new Oe("Request failed with status code "+i.status,[Oe.ERR_BAD_REQUEST,Oe.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function Sp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Tp(e,t){e=e||10;const i=new Array(e),n=new Array(e);let s=0,r=0,a;return t=t!==void 0?t:1e3,function(y){const w=Date.now(),f=n[r];a||(a=w),i[s]=y,n[s]=w;let g=r,p=0;for(;g!==s;)p+=i[g++],g=g%e;if(s=(s+1)%e,s===r&&(r=(r+1)%e),w-a<t)return;const d=f&&w-f;return d?Math.round(p*1e3/d):void 0}}function Cp(e,t){let i=0;const n=1e3/t;let s=null;return function(){const a=this===!0,c=Date.now();if(a||c-i>n)return s&&(clearTimeout(s),s=null),i=c,e.apply(null,arguments);s||(s=setTimeout(()=>(s=null,i=Date.now(),e.apply(null,arguments)),n-(c-i)))}}const Qs=(e,t,i=3)=>{let n=0;const s=Tp(50,250);return Cp(r=>{const a=r.loaded,c=r.lengthComputable?r.total:void 0,y=a-n,w=s(y),f=a<=c;n=a;const g={loaded:a,total:c,progress:c?a/c:void 0,bytes:y,rate:w||void 0,estimated:w&&c&&f?(c-a)/w:void 0,event:r,lengthComputable:c!=null};g[t?"download":"upload"]=!0,e(g)},i)},_p=Dt.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");let n;function s(r){let a=r;return t&&(i.setAttribute("href",a),a=i.href),i.setAttribute("href",a),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return n=s(window.location.href),function(a){const c=se.isString(a)?s(a):a;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}(),xp=Dt.hasStandardBrowserEnv?{write(e,t,i,n,s,r){const a=[e+"="+encodeURIComponent(t)];se.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),se.isString(n)&&a.push("path="+n),se.isString(s)&&a.push("domain="+s),r===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ip(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Vp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function cl(e,t){return e&&!Ip(t)?Vp(e,t):t}const hl=e=>e instanceof yt?{...e}:e;function Si(e,t){t=t||{};const i={};function n(w,f,g){return se.isPlainObject(w)&&se.isPlainObject(f)?se.merge.call({caseless:g},w,f):se.isPlainObject(f)?se.merge({},f):se.isArray(f)?f.slice():f}function s(w,f,g){if(se.isUndefined(f)){if(!se.isUndefined(w))return n(void 0,w,g)}else return n(w,f,g)}function r(w,f){if(!se.isUndefined(f))return n(void 0,f)}function a(w,f){if(se.isUndefined(f)){if(!se.isUndefined(w))return n(void 0,w)}else return n(void 0,f)}function c(w,f,g){if(g in t)return n(w,f);if(g in e)return n(void 0,w)}const y={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(w,f)=>s(hl(w),hl(f),!0)};return se.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=y[f]||s,p=g(e[f],t[f],f);se.isUndefined(p)&&g!==c||(i[f]=p)}),i}const dl=e=>{const t=Si({},e);let{data:i,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:r,headers:a,auth:c}=t;t.headers=a=yt.from(a),t.url=nl(cl(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let y;if(se.isFormData(i)){if(Dt.hasStandardBrowserEnv||Dt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((y=a.getContentType())!==!1){const[w,...f]=y?y.split(";").map(g=>g.trim()).filter(Boolean):[];a.setContentType([w||"multipart/form-data",...f].join("; "))}}if(Dt.hasStandardBrowserEnv&&(n&&se.isFunction(n)&&(n=n(t)),n||n!==!1&&_p(t.url))){const w=s&&r&&xp.read(r);w&&a.set(s,w)}return t},Ap=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(i,n){const s=dl(e);let r=s.data;const a=yt.from(s.headers).normalize();let{responseType:c}=s,y;function w(){s.cancelToken&&s.cancelToken.unsubscribe(y),s.signal&&s.signal.removeEventListener("abort",y)}let f=new XMLHttpRequest;f.open(s.method.toUpperCase(),s.url,!0),f.timeout=s.timeout;function g(){if(!f)return;const d=yt.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),b={data:!c||c==="text"||c==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:d,config:e,request:f};ul(function(E){i(E),w()},function(E){n(E),w()},b),f=null}"onloadend"in f?f.onloadend=g:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(g)},f.onabort=function(){f&&(n(new Oe("Request aborted",Oe.ECONNABORTED,s,f)),f=null)},f.onerror=function(){n(new Oe("Network Error",Oe.ERR_NETWORK,s,f)),f=null},f.ontimeout=function(){let S=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const b=s.transitional||rl;s.timeoutErrorMessage&&(S=s.timeoutErrorMessage),n(new Oe(S,b.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,s,f)),f=null},r===void 0&&a.setContentType(null),"setRequestHeader"in f&&se.forEach(a.toJSON(),function(S,b){f.setRequestHeader(b,S)}),se.isUndefined(s.withCredentials)||(f.withCredentials=!!s.withCredentials),c&&c!=="json"&&(f.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&f.addEventListener("progress",Qs(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",Qs(s.onUploadProgress)),(s.cancelToken||s.signal)&&(y=d=>{f&&(n(!d||d.type?new Qi(null,e,f):d),f.abort(),f=null)},s.cancelToken&&s.cancelToken.subscribe(y),s.signal&&(s.signal.aborted?y():s.signal.addEventListener("abort",y)));const p=Sp(s.url);if(p&&Dt.protocols.indexOf(p)===-1){n(new Oe("Unsupported protocol "+p+":",Oe.ERR_BAD_REQUEST,e));return}f.send(r||null)})},kp=(e,t)=>{let i=new AbortController,n;const s=function(y){if(!n){n=!0,a();const w=y instanceof Error?y:this.reason;i.abort(w instanceof Oe?w:new Qi(w instanceof Error?w.message:w))}};let r=t&&setTimeout(()=>{s(new Oe(`timeout ${t} of ms exceeded`,Oe.ETIMEDOUT))},t);const a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(y=>{y&&(y.removeEventListener?y.removeEventListener("abort",s):y.unsubscribe(s))}),e=null)};e.forEach(y=>y&&y.addEventListener&&y.addEventListener("abort",s));const{signal:c}=i;return c.unsubscribe=a,[c,()=>{r&&clearTimeout(r),r=null}]},Op=function*(e,t){let i=e.byteLength;if(!t||i<t){yield e;return}let n=0,s;for(;n<i;)s=n+t,yield e.slice(n,s),n=s},Lp=async function*(e,t,i){for await(const n of e)yield*Op(ArrayBuffer.isView(n)?n:await i(String(n)),t)},fl=(e,t,i,n,s)=>{const r=Lp(e,t,s);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:y,value:w}=await r.next();if(y){c.close(),n();return}let f=w.byteLength;i&&i(a+=f),c.enqueue(new Uint8Array(w))},cancel(c){return n(c),r.return()}},{highWaterMark:2})},pl=(e,t)=>{const i=e!=null;return n=>setTimeout(()=>t({lengthComputable:i,total:e,loaded:n}))},Hs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ml=Hs&&typeof ReadableStream=="function",ta=Hs&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Rp=ml&&(()=>{let e=!1;const t=new Request(Dt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),gl=64*1024,ia=ml&&!!(()=>{try{return se.isReadableStream(new Response("").body)}catch{}})(),Fs={stream:ia&&(e=>e.body)};Hs&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Fs[t]&&(Fs[t]=se.isFunction(e[t])?i=>i[t]():(i,n)=>{throw new Oe(`Response type '${t}' is not supported`,Oe.ERR_NOT_SUPPORT,n)})})})(new Response);const Mp=async e=>{if(e==null)return 0;if(se.isBlob(e))return e.size;if(se.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(se.isArrayBufferView(e))return e.byteLength;if(se.isURLSearchParams(e)&&(e=e+""),se.isString(e))return(await ta(e)).byteLength},$p=async(e,t)=>{const i=se.toFiniteNumber(e.getContentLength());return i??Mp(t)},na={http:sp,xhr:Ap,fetch:Hs&&(async e=>{let{url:t,method:i,data:n,signal:s,cancelToken:r,timeout:a,onDownloadProgress:c,onUploadProgress:y,responseType:w,headers:f,withCredentials:g="same-origin",fetchOptions:p}=dl(e);w=w?(w+"").toLowerCase():"text";let[d,S]=s||r||a?kp([s,r],a):[],b,_;const E=()=>{!b&&setTimeout(()=>{d&&d.unsubscribe()}),b=!0};let m;try{if(y&&Rp&&i!=="get"&&i!=="head"&&(m=await $p(f,n))!==0){let P=new Request(t,{method:"POST",body:n,duplex:"half"}),q;se.isFormData(n)&&(q=P.headers.get("content-type"))&&f.setContentType(q),P.body&&(n=fl(P.body,gl,pl(m,Qs(y)),null,ta))}se.isString(g)||(g=g?"cors":"omit"),_=new Request(t,{...p,signal:d,method:i.toUpperCase(),headers:f.normalize().toJSON(),body:n,duplex:"half",withCredentials:g});let A=await fetch(_);const u=ia&&(w==="stream"||w==="response");if(ia&&(c||u)){const P={};["status","statusText","headers"].forEach(v=>{P[v]=A[v]});const q=se.toFiniteNumber(A.headers.get("content-length"));A=new Response(fl(A.body,gl,c&&pl(q,Qs(c,!0)),u&&E,ta),P)}w=w||"text";let O=await Fs[se.findKey(Fs,w)||"text"](A,e);return!u&&E(),S&&S(),await new Promise((P,q)=>{ul(P,q,{data:O,headers:yt.from(A.headers),status:A.status,statusText:A.statusText,config:e,request:_})})}catch(A){throw E(),A&&A.name==="TypeError"&&/fetch/i.test(A.message)?Object.assign(new Oe("Network Error",Oe.ERR_NETWORK,e,_),{cause:A.cause||A}):Oe.from(A,A&&A.code,e,_)}})};se.forEach(na,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const yl=e=>`- ${e}`,Np=e=>se.isFunction(e)||e===null||e===!1,vl={getAdapter:e=>{e=se.isArray(e)?e:[e];const{length:t}=e;let i,n;const s={};for(let r=0;r<t;r++){i=e[r];let a;if(n=i,!Np(i)&&(n=na[(a=String(i)).toLowerCase()],n===void 0))throw new Oe(`Unknown adapter '${a}'`);if(n)break;s[a||"#"+r]=n}if(!n){const r=Object.entries(s).map(([c,y])=>`adapter ${c} `+(y===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
87
+ `+r.map(yl).join(`
88
+ `):" "+yl(r[0]):"as no adapter specified";throw new Oe("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:na};function sa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qi(null,e)}function wl(e){return sa(e),e.headers=yt.from(e.headers),e.data=ea.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vl.getAdapter(e.adapter||Vn.adapter)(e).then(function(n){return sa(e),n.data=ea.call(e,e.transformResponse,n),n.headers=yt.from(n.headers),n},function(n){return ll(n)||(sa(e),n&&n.response&&(n.response.data=ea.call(e,e.transformResponse,n.response),n.response.headers=yt.from(n.response.headers))),Promise.reject(n)})}const bl="1.7.2",ra={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ra[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const El={};ra.transitional=function(t,i,n){function s(r,a){return"[Axios v"+bl+"] Transitional option '"+r+"'"+a+(n?". "+n:"")}return(r,a,c)=>{if(t===!1)throw new Oe(s(a," has been removed"+(i?" in "+i:"")),Oe.ERR_DEPRECATED);return i&&!El[a]&&(El[a]=!0,console.warn(s(a," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(r,a,c):!0}};function Pp(e,t,i){if(typeof e!="object")throw new Oe("options must be an object",Oe.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const r=n[s],a=t[r];if(a){const c=e[r],y=c===void 0||a(c,r,e);if(y!==!0)throw new Oe("option "+r+" must be "+y,Oe.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Oe("Unknown option "+r,Oe.ERR_BAD_OPTION)}}const aa={assertOptions:Pp,validators:ra},li=aa.validators;class Ti{constructor(t){this.defaults=t,this.interceptors={request:new sl,response:new sl}}async request(t,i){try{return await this._request(t,i)}catch(n){if(n instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const r=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?r&&!String(n.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(n.stack+=`
89
+ `+r):n.stack=r}catch{}}throw n}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=Si(this.defaults,i);const{transitional:n,paramsSerializer:s,headers:r}=i;n!==void 0&&aa.assertOptions(n,{silentJSONParsing:li.transitional(li.boolean),forcedJSONParsing:li.transitional(li.boolean),clarifyTimeoutError:li.transitional(li.boolean)},!1),s!=null&&(se.isFunction(s)?i.paramsSerializer={serialize:s}:aa.assertOptions(s,{encode:li.function,serialize:li.function},!0)),i.method=(i.method||this.defaults.method||"get").toLowerCase();let a=r&&se.merge(r.common,r[i.method]);r&&se.forEach(["delete","get","head","post","put","patch","common"],S=>{delete r[S]}),i.headers=yt.concat(a,r);const c=[];let y=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(i)===!1||(y=y&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const w=[];this.interceptors.response.forEach(function(b){w.push(b.fulfilled,b.rejected)});let f,g=0,p;if(!y){const S=[wl.bind(this),void 0];for(S.unshift.apply(S,c),S.push.apply(S,w),p=S.length,f=Promise.resolve(i);g<p;)f=f.then(S[g++],S[g++]);return f}p=c.length;let d=i;for(g=0;g<p;){const S=c[g++],b=c[g++];try{d=S(d)}catch(_){b.call(this,_);break}}try{f=wl.call(this,d)}catch(S){return Promise.reject(S)}for(g=0,p=w.length;g<p;)f=f.then(w[g++],w[g++]);return f}getUri(t){t=Si(this.defaults,t);const i=cl(t.baseURL,t.url);return nl(i,t.params,t.paramsSerializer)}}se.forEach(["delete","get","head","options"],function(t){Ti.prototype[t]=function(i,n){return this.request(Si(n||{},{method:t,url:i,data:(n||{}).data}))}}),se.forEach(["post","put","patch"],function(t){function i(n){return function(r,a,c){return this.request(Si(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Ti.prototype[t]=i(),Ti.prototype[t+"Form"]=i(!0)});class oa{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(r){i=r});const n=this;this.promise.then(s=>{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](s);n._listeners=null}),this.promise.then=s=>{let r;const a=new Promise(c=>{n.subscribe(c),r=c}).then(s);return a.cancel=function(){n.unsubscribe(r)},a},t(function(r,a,c){n.reason||(n.reason=new Qi(r,a,c),i(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}static source(){let t;return{token:new oa(function(s){t=s}),cancel:t}}}function qp(e){return function(i){return e.apply(null,i)}}function Bp(e){return se.isObject(e)&&e.isAxiosError===!0}const la={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(la).forEach(([e,t])=>{la[t]=e});function Sl(e){const t=new Ti(e),i=Qo(Ti.prototype.request,t);return se.extend(i,Ti.prototype,t,{allOwnKeys:!0}),se.extend(i,t,null,{allOwnKeys:!0}),i.create=function(s){return Sl(Si(e,s))},i}const et=Sl(Vn);et.Axios=Ti,et.CanceledError=Qi,et.CancelToken=oa,et.isCancel=ll,et.VERSION=bl,et.toFormData=Bs,et.AxiosError=Oe,et.Cancel=et.CanceledError,et.all=function(t){return Promise.all(t)},et.spread=qp,et.isAxiosError=Bp,et.mergeConfig=Si,et.AxiosHeaders=yt,et.formToJSON=e=>al(se.isHTMLForm(e)?new FormData(e):e),et.getAdapter=vl.getAdapter,et.HttpStatusCode=la,et.default=et;const Dp={name:"QtiStylesheet",props:{href:{type:String,required:!0},type:{type:String,required:!0}},data(){return{css:"",isQtiValid:!0}},methods:{getCss(){et.get(this.href).then(e=>{this.css=`<style>${e.data}</style>`}).catch(e=>{console.log("["+this.$options.name+"][CSS Fetch Error: "+e+"]")})},validateChildren(){}},created(){this.getCss()},mounted(){if(this.isQtiValid)try{this.validateChildren(),console.log("["+this.$options.name+"][Href: "+this.href+"]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Qp=["innerHTML"];function Hp(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",{ref:"root",class:"qti-stylesheet",innerHTML:s.css},null,8,Qp)}const Fp=te(Dp,[["render",Hp]]),Up={name:"QtiCompanionMaterialsInfo",data(){return{isQtiValid:!0}},methods:{validateChildren(){}},mounted(){if(this.isQtiValid)try{this.validateChildren(),console.log("["+this.$options.name+"]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Gp={class:"qti-companion-materials-info"};function jp(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Gp)}const Wp=te(Up,[["render",jp]]),kn=new re,zp={name:"QtiMapping",props:{lowerBound:{type:String,required:!1},upperBound:{type:String,required:!1},defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueLowerBound:null,valueUpperBound:null,valueDefaultValue:new ce(0).toNumber(),isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},getLowerBound(){return this.valueLowerBound},setLowerBound(e){this.valueLowerBound=e},getUpperBound(){return this.valueUpperBound},setUpperBound(e){this.valueUpperBound=e},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},computeFloatValue(e){let t=null;try{t=new ce(e)}catch(i){throw new ge(i.message)}return t.toNumber()},applyConstraints(e){return e===null||!ce.isBigNumber(e)?null:(this.getLowerBound()!==null&&e.comparedTo(this.getLowerBound())<0&&(e=new ce(this.getLowerBound())),this.getUpperBound()!==null&&e.comparedTo(this.getUpperBound())>0&&(e=new ce(this.getUpperBound())),e.toNumber())},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one qti-map-entry node");if(this.$slots.default().forEach(t=>{if(kn.isValidSlot(t))if(kn.kebabCase(t.type.name)==="qti-map-entry")e+=1;else throw new h('Node is not a qti-map-entry: "'+t.tpe.name+'"')}),e===0)throw new h("Must have at least one qti-map-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const n=i.component.proxy;e===null&&(e=[]),e.push(n.getValue())}),e}},created(){try{typeof this.lowerBound<"u"&&this.setLowerBound(this.computeFloatValue(kn.FloatValue(this.lowerBound))),typeof this.upperBound<"u"&&this.setUpperBound(this.computeFloatValue(kn.FloatValue(this.upperBound))),typeof this.defaultValue<"u"&&this.setDefaultValue(this.computeFloatValue(kn.FloatValue(this.defaultValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiMapping][lowerBound][upperBound][defaultValue][Value]",this.getLowerBound(),this.getUpperBound(),this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Kp={class:"qti-mapping"};function Yp(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Kp,[l.renderSlot(e.$slots,"default")])}const Xp=te(zp,[["render",Yp]]),ua=new re,Zp={name:"QtiMapEntry",props:{mapKey:{type:String,required:!0},mappedValue:{type:String,required:!0},caseSensitive:{type:String,required:!1}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueMappedValue:null,valueCaseSensitive:!1,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},setMappedValue(e){this.valueMappedValue=e},getMappedValue(){return this.valueMappedValue},setCaseSensitive(e){this.valueCaseSensitive=e},getCaseSensitive(){return this.valueCaseSensitive},computeMappedValue(e){let t=null;try{t=new ce(e)}catch(i){throw new ge(i.message)}return t.toNumber()},validateChildren:function(){this.$slots.default&&this.$slots.default().forEach(e=>{if(ua.isValidSlot(e))throw new h('Invalid Child Node: "'+e.tpe.name+'"')})}},created(){try{this.setCaseSensitive(ua.validateCaseSensitive(this.caseSensitive,!1)),this.setMappedValue(this.computeMappedValue(ua.FloatValue(this.mappedValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){let e=this.$el.querySelector(".amp-mapentry__container");this.isQtiValid&&(this.setValue({mapKey:this.mapKey,mappedValue:this.getMappedValue(),caseSensitive:this.getCaseSensitive()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},Jp={class:"qti-map-entry"},em={class:"amp-mapentry__container"};function tm(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Jp,[l.createElementVNode("div",em,[l.renderSlot(e.$slots,"default")])])}const im=te(Zp,[["render",tm]]),nm={name:"QtiAreaMapping",methods:{},created:function(){},mounted:function(){console.log("[AreaMapping][Mounted]")}},sm={class:"qti-area-mapping"};function rm(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",sm)}const am=te(nm,[["render",rm]]),ca=new re,om={name:"QtiInterpolationTable",props:{defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:"single",valueDefaultValue:null,tableType:"interpolation",isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},getTableType(){return this.tableType},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one qti-interpolation-table-entry node");if(this.$slots.default().forEach(t=>{if(ca.isValidSlot(t))if(ca.kebabCase(t.type.name)==="qti-interpolation-table-entry")e+=1;else throw new h('Node is not a qti-interpolation-table-entry: "'+t.tpe.name+'"')}),e===0)throw new h("Must have at least one qti-interpolation-table-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{e===null&&(e=[]),e.push(i.getValue())}),e}},created(){try{let e=this.$parent.getBaseType();this.setBaseType(e),typeof this.defaultValue>"u"?this.setDefaultValue(null):this.setDefaultValue(ca.validateValueFromBaseType(e,this.defaultValue)),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiInterpolationTable][DefaultValue][Value]",this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},lm={class:"qti-interpolation-table"};function um(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",lm,[l.renderSlot(e.$slots,"default")])}const cm=te(om,[["render",um]]),Us=new re,hm={name:"QtiInterpolationTableEntry",props:{sourceValue:{type:String,required:!0},includeBoundary:{type:String,required:!1},targetValue:{type:String,required:!0}},data(){return{value:null,valueSourceValue:null,valueTargetValue:null,valueIncludeBoundary:!0,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},setSourceValue(e){this.valueSourceValue=e},getSourceValue(){return this.valueSourceValue},setTargetValue(e){this.valueTargetValue=e},getTargetValue(){return this.valueTargetValue},setIncludeBoundary(e){this.valueIncludeBoundary=e},getIncludeBoundary(){return this.valueIncludeBoundary},computeSourceValue(e){let t=null;try{t=new ce(e)}catch(i){throw new ge(i.message)}return t.toNumber()},isValidSlot(e){if(typeof e.componentOptions<"u")return!0;if(typeof e.text<"u"&&e.text.trim().length>0)throw new h('Invalid Child Node: "'+e.text.trim()+'"');return!1},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(Us.isValidSlot(e))throw new h('Invalid Child Node: "'+e.tpe.name+'"')})}},created(){try{let e=this.$parent.$parent.getBaseType();this.setIncludeBoundary(Us.validateIncludeBoundary(this.includeBoundary,"include-boundary")),this.setSourceValue(this.computeSourceValue(Us.FloatValue(this.sourceValue))),this.setTargetValue(Us.validateValueFromBaseType(e,this.targetValue))}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new h(e.message);if(e.name==="QtiParseException")throw new ge(e.message)}},mounted(){let e=this.$el.querySelector(".amp-interpolationentry__container");this.isQtiValid&&(this.setValue({sourceValue:this.getSourceValue(),targetValue:this.getTargetValue(),includeBoundary:this.getIncludeBoundary()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},dm={class:"qti-interpolation-table-entry"},fm={class:"amp-interpolationentry__container"};function pm(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",dm,[l.createElementVNode("div",fm,[l.renderSlot(e.$slots,"default")])])}const mm=te(hm,[["render",pm]]),ha=new re,gm={name:"QtiMatchTable",props:{defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:"single",valueDefaultValue:null,tableType:"match",isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},getTableType(){return this.tableType},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one qti-match-table-entry node");if(this.$slots.default().forEach(t=>{if(ha.isValidSlot(t))if(ha.kebabCase(t.type.name)==="qti-match-table-entry")e+=1;else throw new h('Node is not a qti-match-table-entry: "'+t.tpe.name+'"')}),e===0)throw new h("Must have at least one qti-match-table-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{e===null&&(e=[]),e.push(i.getValue())}),e}},created(){try{let e=this.$parent.getBaseType();this.setBaseType(e),typeof this.defaultValue>"u"?this.setDefaultValue(null):this.setDefaultValue(ha.validateValueFromBaseType(e,this.defaultValue)),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiMatchTable][DefaultValue][Value]",this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},ym={class:"qti-match-table"};function vm(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",ym,[l.renderSlot(e.$slots,"default")])}const wm=te(gm,[["render",vm]]),da=new re,bm={name:"QtiMatchTableEntry",props:{sourceValue:{type:String,required:!0},targetValue:{type:String,required:!0}},data(){return{value:null,valueSourceValue:null,valueTargetValue:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},setSourceValue(e){this.valueSourceValue=e},getSourceValue(){return this.valueSourceValue},setTargetValue(e){this.valueTargetValue=e},getTargetValue(){return this.valueTargetValue},computeSourceValue(e){let t=null;try{if(t=new ce(e),!t.isInteger())throw new ge('Invalid qti-match-table-entry source-value integer "'+t+'"')}catch(i){throw new ge(i.message)}return t.toNumber()},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(da.isValidSlot(e))throw new h('Invalid Child Node: "'+e.tpe.name+'"')})}},created(){try{let e=this.$parent.$parent.getBaseType();this.setSourceValue(this.computeSourceValue(da.IntegerValue(this.sourceValue))),this.setTargetValue(da.validateValueFromBaseType(e,this.targetValue)),this.validateChildren()}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new h(e.message);if(e.name==="QtiParseException")throw new ge(e.message)}},mounted(){let e=this.$el.querySelector(".amp-matchtableentry__container");this.isQtiValid&&(this.setValue({sourceValue:this.getSourceValue(),targetValue:this.getTargetValue()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},Em={class:"qti-match-table-entry"},Sm={class:"amp-matchtableentry__container"};function Tm(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Em,[l.createElementVNode("div",Sm,[l.renderSlot(e.$slots,"default")])])}const Cm=te(bm,[["render",Tm]]),_m={name:"QtiDefaultValue",props:{interpretation:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const n=i.component.proxy;switch(this.variableCardinality){case"record":e===null&&(e=new Map),n.isRecordFieldValue()&&e.set(n.getFieldIdentifier(),n);break;case"multiple":case"ordered":e===null&&(e=[]),e.push(n.getValue());break;case"single":e=e===null?n.getValue():e;break;default:console.log("[DefaultValue][Cardinality]: processChildren cardinality unhandled = "+this.variableCardinality)}}),e},getVariableBaseType(){return this.$parent.$props.baseType},getVariableCardinality(){return this.$parent.$props.cardinality},evaluate(){return this.getValue()}},created(){try{this.valueBaseType=this.variableBaseType=this.getVariableBaseType(),this.valueCardinality=this.variableCardinality=this.getVariableCardinality()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[DefaultValue][Value:",this.getValue(),"][BaseType:"+this.getBaseType()+"][Cardinality:"+this.getCardinality()+"]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},xm={ref:"root",class:"qti-default-value"};function Im(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",xm,[l.renderSlot(e.$slots,"default")],512)}const Vm=te(_m,[["render",Im]]),Am={name:"QtiCorrectResponse",props:{interpretation:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const n=i.component.proxy;switch(this.variableCardinality){case"record":e===null&&(e=new Map),n.isRecordFieldValue()&&e.set(n.getFieldIdentifier(),n);break;case"multiple":case"ordered":e===null&&(e=[]),e.push(n.getValue());break;case"single":e=e===null?n.getValue():e;break;default:console.log("[CorrectResponse][Cardinality]: processChildren cardinality unhandled = "+this.variableCardinality)}}),e},getVariableBaseType(){return this.$parent.$props.baseType},getVariableCardinality(){return this.$parent.$props.cardinality},evaluate(){return this.getValue()}},created(){try{this.valueBaseType=this.variableBaseType=this.getVariableBaseType(),this.valueCardinality=this.variableCardinality=this.getVariableCardinality()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[CorrectResponse][Value:",this.getValue(),"][BaseType:"+this.getBaseType()+"][Cardinality:"+this.getCardinality()+"]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},km={class:"qti-correct-response"};function Om(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",km,[l.renderSlot(e.$slots,"default")])}const Lm=te(Am,[["render",Om]]);class Tl{constructor(){}IntegerValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new ge('Invalid integer "'+t+'". Length is not valid.');try{let i=parseInt(t,10);if(Number.isNaN(i))throw new ge('Invalid integer "'+t+'". ');return i}catch(i){throw new ge('Invalid integer "'+t+'". '+i.message)}}FloatValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new ge('Invalid float "'+t+'". Length is not valid.');try{let i=parseFloat(t);if(Number.isNaN(i))throw new ge('Invalid float "'+t+'". ');return i}catch(i){throw new ge('Invalid float "'+t+'". '+i.message)}}BooleanValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new ge('Invalid boolean "'+t+'". Length is not valid.');if(t.toLowerCase()==="true"||t==="1")return!0;if(t.toLowerCase()==="false"||t==="0")return!1;throw new ge('Invalid boolean "'+t+'".')}StringValue(t){if(t==null||t.length==0)throw new ge('Invalid string "'+t+'". Length is not valid.');return t}IdentifierValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new ge('Invalid identifier "'+t+'". Length is not valid.');if(!this.isCharacterALetter(t.charAt(0))&&!this.isCharacterADigit(t.charAt(0))&&t.charAt(0)!=="_")throw new ge('Invalid identifier "'+t+'". First character "'+t.charAt(0)+'" is not valid.');for(let i=1;i<t.length;i++)if(!this.isCharacterALetterOrDigit(t.charAt(i))&&t.charAt(i)!=="_"&&t.charAt(i)!=="-"&&t.charAt(i)!==".")throw new ge('Invalid identifier "'+t+'". Character "'+t.charAt(i)+'" at position '+(i+1)+" is not valid.");return t}isCharacterALetter(t){return/[a-zA-Z]/.test(t)}isCharacterADigit(t){return/\d/.test(t)}isCharacterALetterOrDigit(t){return this.isCharacterALetter(t)||this.isCharacterADigit(t)}}const fa=new re,Hi=new Tl,Rm={name:"QtiValue",props:{baseType:{type:String,required:!1},fieldIdentifier:{type:String,required:!1}},data(){return{singleValue:null,valueBaseType:null,valueCardinality:"single",valueFieldIdentifier:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{getValue(){if(this.isNull())return null;switch(this.valueBaseType){case"integer":case"float":return this.singleValue.toNumber();case"boolean":return this.singleValue;case"string":case"identifier":case"directedPair":case"pair":return this.singleValue;default:return console.log("[QtiValue][GetValue Exception]","Unhandled BaseType:"+this.valueBaseType),null}},isNull(){return this.singleValue===null},getBaseType(){return this.valueBaseType},getCardinality(){return"single"},getFieldIdentifier(){return this.valueFieldIdentifier},isRecordFieldValue(){return this.valueFieldIdentifier!==null&&this.valueBaseType!==null},readChildren(e){this.valueBaseType!=null&&(this.singleValue=this.parseSingleValue(this.valueBaseType,e.textContent))},parseSingleValue(e,t){let i=null;try{switch(e){case"integer":i=new ce(Hi.IntegerValue(t));break;case"float":i=new ce(Hi.FloatValue(t));break;case"boolean":i=Hi.BooleanValue(t);break;case"string":i=Hi.StringValue(t);break;case"identifier":i=Hi.IdentifierValue(t);break;case"directedPair":case"pair":i=Hi.StringValue(t);break;default:throw new ge('[QtiValue][Unhandled BaseType]: "'+e+'"')}}catch(n){throw new ge(n.message)}return i},_getVariableBaseType(e){return typeof e<"u"?e.baseType:null},_getVariableCardinality(e){return typeof e<"u"?e.cardinality:null},_validateAttributes(e,t){if(t==="record"){if(typeof this.baseType>"u")throw new h('base-type is a required attribute for "record" cardinality');if(fa.validateBaseType(this.baseType),this.valueBaseType=this.baseType,typeof this.fieldIdentifier>"u")throw new h('field-identifier is a required attribute for "record" cardinality');fa.validateIdentifierAttribute(this.fieldIdentifier),this.valueFieldIdentifier=this.fieldIdentifier}else{if(typeof this.baseType<"u")throw new h("base-type only permitted for record cardinality.");if(typeof this.fieldIdentifier<"u")throw new h("field-identifier only permitted for record cardinality.");this.valueBaseType=e}}},created:function(){try{let e=fa.validateVariableIdentifierAttribute(W,this.$parent.$parent.$props.identifier);if(typeof e>"u")throw new h('Variable declaration not found: "'+this.$parent.$parent.$props.identifier+'"');this.variableCardinality=this._getVariableCardinality(e),this.variableBaseType=this._getVariableBaseType(e),this._validateAttributes(this.variableBaseType,this.variableCardinality)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted:function(){let e=this.$el.querySelector(".amp-value__container");if(this.isQtiValid){try{this.readChildren(e)}catch(t){throw this.isQtiValid=!1,t.name==="QtiValidationException"?new h(t.message):t.name==="QtiParseException"?new ge(t.message):new Error(t.message)}console.log("["+this.$options.name+"][Value:"+this.getValue()+"][BaseType:"+this.getBaseType()+"][FieldIdentifier:"+this.getFieldIdentifier()+"]")}e.remove()}},Mm=["variable-basetype","variable-cardinality"],$m={class:"amp-value__container"};function Nm(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-value","variable-basetype":s.variableBaseType,"variable-cardinality":s.variableCardinality},[l.createElementVNode("div",$m,[l.renderSlot(e.$slots,"default")])],8,Mm)}const Pm=te(Rm,[["render",Nm]]),qm=new re,Bm={name:"QtiItemBody",emits:["itemBodyReady"],data(){return{mathElementMap:new Map}},methods:{initializeTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathElements().forEach(function(i){this.archiveMathElement(i),i.innerHTML=this.applyTemplateValuesToMathml(i.innerHTML,e)},this)},updateTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathScriptElements().forEach(function(i){for(let[n,s]of this.mathElementMap){const r=new RegExp('id="('+n+')"',"g");if(i.innerHTML.match(r)){i.innerHTML=this.applyTemplateValuesToMathml(s,e);break}}},this),this.reprocessMML()},getTemplateMathVariables(){return W.getTemplateMathParameterVariables()},getMathElements(){return this.$el.querySelectorAll("math")},getMathScriptElements(){return this.$el.querySelectorAll('script[type="math/mml"]')},archiveMathElement(e){e.hasAttribute("id")||(e.id=qm.randomString(5,"a")),this.mathElementMap.set(e.id,e.outerHTML)},applyTemplateValuesToMathml(e,t){let i=e;return t.forEach(function(n){const s=new RegExp("<[mc]i[^>]*>("+n.identifier+")<\\/[mc]i>","g"),r=e.match(s);r&&(i=i.replace(s,r[0].replace(n.identifier,n.value)))}),i},reprocessMML(){this.$nextTick(()=>{window.MathJax&&window.MathJax.Hub.Queue(["Reprocess",window.MathJax.Hub,this.$refs.root])})}},mounted(){this.initializeTemplateMathVariables(),this.$parent.$emit("itemBodyReady",{itemBody:this})}},Dm={ref:"root",class:"qti-item-body"};function Qm(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Dm,[l.renderSlot(e.$slots,"default")],512)}const Hm=te(Bm,[["render",Qm]]),Fm={name:"ModalDialog",data(){return{visible:!0}},methods:{hide(){this.$refs.mymodal.classList.remove("fade","show"),document.querySelector("body").classList.remove("modal-open")},show(){this.$refs.mymodal.classList.add("fade","show"),document.querySelector("body").classList.add("modal-open")}}},Cl=e=>(l.pushScopeId("data-v-2611a8eb"),e=e(),l.popScopeId(),e),Um={key:0,ref:"mymodal",class:"qti3-player-modal"},Gm={class:"qti3-player-modal-dialog qti3-player-modal-md qti3-player-modal-dialog-centered"},jm=Cl(()=>l.createElementVNode("span",{tabindex:"0"},null,-1)),Wm={class:"qti3-player-modal-content"},zm={class:"qti3-player-modal-header"},Km={class:"qti3-player-modal-body"},Ym={class:"qti3-player-modal-footer"},Xm=Cl(()=>l.createElementVNode("span",{tabindex:"0"},null,-1));function Zm(e,t,i,n,s,r){return l.openBlock(),l.createBlock(l.Transition,{name:"fade"},{default:l.withCtx(()=>[s.visible?(l.openBlock(),l.createElementBlock("div",Um,[l.createElementVNode("div",Gm,[jm,l.createElementVNode("div",Wm,[l.createElementVNode("header",zm,[l.renderSlot(e.$slots,"header",{},void 0,!0),l.createElementVNode("button",{type:"button",class:"qti3-player-close","aria-label":"Close",onClick:t[0]||(t[0]=a=>r.hide())},"×")]),l.createElementVNode("div",Km,[l.renderSlot(e.$slots,"body",{},void 0,!0)]),l.createElementVNode("footer",Ym,[l.renderSlot(e.$slots,"footer",{},void 0,!0)])]),Xm]),l.createElementVNode("div",{class:"qti3-player-modal-backdrop",onClick:t[1]||(t[1]=a=>r.hide())})],512)):l.createCommentVNode("",!0)]),_:3})}const Jm=te(Fm,[["render",Zm],["__scopeId","data-v-2611a8eb"]]),On=new re,eg={name:"QtiModalFeedback",components:{ModalDialog:Jm},props:{identifier:{type:String,required:!0},outcomeIdentifier:{type:String,required:!0},showHide:{type:String,required:!0},title:{type:String,required:!1}},computed:{modalTitle(){return typeof this.title>"u"?void 0:this.title}},data(){return{outcomeDeclaration:null,mathElementMap:new Map,isQtiValid:!0}},inheritAttrs:!0,methods:{initializeTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathElements().forEach(function(i){this.archiveMathElement(i),i.innerHTML=this.applyTemplateValuesToMathml(i.innerHTML,e)},this)},updateTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathScriptElements().forEach(function(i){for(let[n,s]of this.mathElementMap){const r=new RegExp('id="('+n+')"',"g");if(i.innerHTML.match(r)){i.innerHTML=this.applyTemplateValuesToMathml(s,e);break}}},this),this.reprocessMML()},getTemplateMathVariables(){return W.getTemplateMathParameterVariables()},getMathElements(){return this.$el.querySelectorAll("math")},getMathScriptElements(){return this.$el.querySelectorAll('script[type="math/mml"]')},archiveMathElement(e){e.hasAttribute("id")||(e.id=On.randomString(5,"a")),this.mathElementMap.set(e.id,e.outerHTML)},applyTemplateValuesToMathml(e,t){let i=e;return t.forEach(function(n){const s=new RegExp("<[mc]i[^>]*>("+n.identifier+")<\\/[mc]i>","g"),r=e.match(s);r&&(i=i.replace(s,r[0].replace(n.identifier,n.value)))}),i},reprocessMML(){this.$nextTick(()=>{window.MathJax&&window.MathJax.Hub.Queue(["Reprocess",window.MathJax.Hub,this.$refs.root])})},display(e){e?this.$refs.modal.show():this.$refs.modal.hide()},evaluate(){if(this.outcomeDeclaration=On.validateOutcomeIdentifierAttribute(W,this.outcomeIdentifier),this.outcomeDeclaration.cardinality==="single"){if(this.outcomeDeclaration.value===this.identifier){this.display(this.show);return}this.show||this.display(!0);return}if(this.outcomeDeclaration.cardinality==="multiple"){for(let e=0;e<this.outcomeDeclaration.value.length;e++)if(this.outcomeDeclaration.value[e]===this.identifier){this.display(this.show);return}this.show||this.display(!0)}}},created(){try{let e=On.validateOutcomeIdentifierAttribute(W,this.outcomeIdentifier);if(e.baseType!=="identifier")throw new h('Invalid outcome variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new h('Invalid outcome variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');On.validateIdentifierAttribute(this.identifier),this.show=On.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.initializeTemplateMathVariables(),W.defineFeedback({outcomeIdentifier:this.outcomeIdentifier,identifier:this.identifier,feedbackType:"Modal",node:this}),console.log("[ModalFeedback]",this)}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},tg={ref:"root",class:"qti-modal-feedback"};function ig(e,t,i,n,s,r){const a=l.resolveComponent("ModalDialog");return l.openBlock(),l.createElementBlock("div",tg,[l.createVNode(a,{ref:"modal"},{header:l.withCtx(()=>[l.createElementVNode("h5",null,l.toDisplayString(r.modalTitle),1)]),body:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),footer:l.withCtx(()=>[l.createElementVNode("button",{class:"qti-modal-feedback-ok",onClick:t[0]||(t[0]=c=>e.$refs.modal.hide())},"OK")]),_:3},512)],512)}const ng=te(eg,[["render",ig]]),sg={name:"QtiContentBody",data(){return{isQtiValid:!0}},mounted(){}},rg={ref:"root",class:"qti-content-body"};function ag(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",rg,[l.renderSlot(e.$slots,"default")],512)}const og=te(sg,[["render",ag]]),Gs=new re,lg={name:"QtiTemplateInline",props:{identifier:{type:String,required:!0},templateIdentifier:{type:String,required:!0},showHide:{type:String,required:!1,default:"show"}},data(){return{value:null,templateDeclaration:null,show:!0,isQtiValid:!0}},methods:{evaluate(){try{if(this.hideTemplate(),this.templateDeclaration=Gs.validateTemplateIdentifierAttribute(W,this.templateIdentifier),console.log("[QtiTemplateInline]["+this.templateIdentifier+"][Show]",this.show),this.templateDeclaration.cardinality==="single"){if(this.templateDeclaration.value===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.showTemplate();return}if(this.templateDeclaration.cardinality==="multiple"){for(let e=0;e<this.templateDeclaration.value.length;e++)if(this.templateDeclaration.value[e]===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.hideTemplate();return}}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}},hideTemplate(){this.$refs.root.classList.add("hidden")},showTemplate(){this.$refs.root.classList.remove("hidden")}},created(){try{let e=Gs.validateTemplateIdentifierAttribute(W,this.templateIdentifier);if(e.baseType!=="identifier")throw new h('Invalid template variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new h('Invalid template variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Gs.validateIdentifierAttribute(this.identifier),this.show=Gs.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{W.defineTemplate({node:this}),this.evaluate()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},ug={ref:"root",class:"qti-template-inline hidden"};function cg(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",ug,[l.renderSlot(e.$slots,"default")],512)}const hg=te(lg,[["render",cg]]),js=new re,dg={name:"QtiTemplateBlock",props:{identifier:{type:String,required:!0},templateIdentifier:{type:String,required:!0},showHide:{type:String,required:!1,default:"show"}},data(){return{value:null,templateDeclaration:null,show:!0,isQtiValid:!0}},methods:{evaluate(){try{if(this.hideTemplate(),this.templateDeclaration=js.validateTemplateIdentifierAttribute(W,this.templateIdentifier),console.log("[QtiTemplateBlock]["+this.templateIdentifier+"][Show]",this.show),this.templateDeclaration.cardinality==="single"){if(this.templateDeclaration.value===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.showTemplate();return}if(this.templateDeclaration.cardinality==="multiple"){for(let e=0;e<this.templateDeclaration.value.length;e++)if(this.templateDeclaration.value[e]===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.showTemplate();return}}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}},hideTemplate(){this.$refs.root.classList.add("hidden")},showTemplate(){this.$refs.root.classList.remove("hidden")}},created(){try{let e=js.validateTemplateIdentifierAttribute(W,this.templateIdentifier);if(e.baseType!=="identifier")throw new h('Invalid template variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new h('Invalid template variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');js.validateIdentifierAttribute(this.identifier),this.show=js.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{W.defineTemplate({node:this}),this.evaluate()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},fg={ref:"root",class:"qti-template-block hidden"};function pg(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",fg,[l.renderSlot(e.$slots,"default")],512)}const mg=te(dg,[["render",pg]]),Ws=new re,gg={name:"QtiFeedbackInline",props:{identifier:{type:String,required:!0},outcomeIdentifier:{type:String,required:!0},showHide:{type:String,required:!0}},data(){return{show:null,outcomeDeclaration:null,isQtiValid:!0}},methods:{defaultShowHide(){this.show?this.$refs.root.classList.add("hidden"):this.$refs.root.classList.remove("hidden")},display(e){e?this.$refs.root.classList.remove("hidden"):this.$refs.root.classList.add("hidden")},isOutcomeValueNull(e){return e===null},evaluate(){if(this.defaultShowHide(),this.outcomeDeclaration=Ws.validateOutcomeIdentifierAttribute(W,this.outcomeIdentifier),this.outcomeDeclaration.cardinality==="single"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;if(this.outcomeDeclaration.value===this.identifier){this.display(this.show);return}this.show||this.display(!0);return}if(this.outcomeDeclaration.cardinality==="multiple"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;for(let e=0;e<this.outcomeDeclaration.value.length;e++)if(this.outcomeDeclaration.value[e]===this.identifier){this.display(this.show);return}this.show||this.display(!0)}}},created(){try{let e=Ws.validateOutcomeIdentifierAttribute(W,this.outcomeIdentifier);if(e.baseType!=="identifier")throw new h('Invalid outcome variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new h('Invalid outcome variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Ws.validateIdentifierAttribute(this.identifier),this.show=Ws.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.defaultShowHide(),W.defineFeedback({outcomeIdentifier:this.outcomeIdentifier,identifier:this.identifier,feedbackType:"Inline",show:this.show,node:this}),console.log("[FeedbackInline]",this)}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},yg={ref:"root",class:"qti-feedback-inline hidden"};function vg(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",yg,[l.renderSlot(e.$slots,"default")],512)}const wg=te(gg,[["render",vg]]),zs=new re,bg={name:"QtiFeedbackBlock",props:{identifier:{type:String,required:!0},outcomeIdentifier:{type:String,required:!0},showHide:{type:String,required:!0}},data(){return{show:null,outcomeDeclaration:null,isQtiValid:!0}},methods:{defaultShowHide(){this.show?this.$refs.root.classList.add("hidden"):this.$refs.root.classList.remove("hidden")},display(e){e?this.$refs.root.classList.remove("hidden"):this.$refs.root.classList.add("hidden")},isOutcomeValueNull(e){return e===null},evaluate(){if(this.defaultShowHide(),this.outcomeDeclaration=zs.validateOutcomeIdentifierAttribute(W,this.outcomeIdentifier),console.log("[FeedbackBlock]["+this.identifier+"][evaluate]",this.outcomeIdentifier,this.outcomeDeclaration.value),this.outcomeDeclaration.cardinality==="single"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;if(this.outcomeDeclaration.value===this.identifier){this.display(this.show);return}this.show||this.display(!0);return}if(this.outcomeDeclaration.cardinality==="multiple"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;for(let e=0;e<this.outcomeDeclaration.value.length;e++)if(this.outcomeDeclaration.value[e]===this.identifier){this.display(this.show);return}this.show||this.display(!0)}}},created(){try{let e=zs.validateOutcomeIdentifierAttribute(W,this.outcomeIdentifier);if(e.baseType!=="identifier")throw new h('Invalid outcome variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new h('Invalid outcome variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');zs.validateIdentifierAttribute(this.identifier),this.show=zs.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.defaultShowHide(),W.defineFeedback({outcomeIdentifier:this.outcomeIdentifier,identifier:this.identifier,feedbackType:"Block",show:this.show,node:this}),console.log("[FeedbackBlock]",this)}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Eg={ref:"root",class:"qti-feedback-block hidden"};function Sg(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Eg,[l.renderSlot(e.$slots,"default")],512)}const Tg=te(bg,[["render",Sg]]),Cg=new re,_g={name:"QtiRubricBlock",props:{view:{type:String,required:!0},use:{type:String,required:!1}},data(){return{isQtiValid:!0}},computed:{isScoringRubricBlock(){const e=this.view.split(" ");for(let t=0;t<e.length;t++)if(e[t]==="scorer")return!0;return!1}},methods:{validateChildren(){},evaluate(){if(!this.isScoringRubricBlock){this.$refs.root.classList.remove("hidden");return}this.$refs.root.innerHTML=""}},created(){try{Cg.validateRubricBlockViewAttribute(this.view),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.isScoringRubricBlock&&W.defineScoringRubricBlock({view:this.view,html:this.$refs.root.innerHTML,node:this}),this.evaluate(),console.log("["+this.$options.name+"][View: "+this.view+"]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},xg={ref:"root",class:"qti-rubric-block hidden"};function Ig(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",xg,[l.renderSlot(e.$slots,"default")],512)}const Vg=te(_g,[["render",Ig]]);var _l={},Ks={},xl={},Ys={};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.boolean=void 0;const Ag=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};Ys.boolean=Ag;var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.isBooleanable=void 0;const kg=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};Xs.isBooleanable=kg,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=Ys;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const i=Xs;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return i.isBooleanable}})}(xl);var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.tokenize=void 0;const Og=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,Lg=e=>{let t;const i=[];let n=0,s=0,r=null;for(;(t=Og.exec(e))!==null;){t.index>s&&(r={literal:e.slice(s,t.index),type:"literal"},i.push(r));const a=t[0];s=t.index+a.length,a==="\\%"||a==="%%"?r&&r.type==="literal"?r.literal+="%":(r={literal:"%",type:"literal"},i.push(r)):t.groups&&(r={conversion:t.groups.conversion,flag:t.groups.flag||null,placeholder:a,position:t.groups.position?Number.parseInt(t.groups.position,10)-1:n++,precision:t.groups.precision?Number.parseInt(t.groups.precision.slice(1),10):null,type:"placeholder",width:t.groups.width?Number.parseInt(t.groups.width,10):null},i.push(r))}return s<=e.length-1&&(r&&r.type==="literal"?r.literal+=e.slice(s):i.push({literal:e.slice(s),type:"literal"})),i};Zs.tokenize=Lg,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.createPrintf=void 0;const Il=xl,Rg=Zs,Mg=(e,t)=>t.placeholder,$g=e=>{var t;const i=(r,a,c)=>c==="-"?r.padEnd(a," "):c==="-+"?((Number(r)>=0?"+":"")+r).padEnd(a," "):c==="+"?((Number(r)>=0?"+":"")+r).padStart(a," "):c==="0"?r.padStart(a,"0"):r.padStart(a," "),n=(t=e==null?void 0:e.formatUnboundExpression)!==null&&t!==void 0?t:Mg,s={};return(r,...a)=>{let c=s[r];c||(c=s[r]=Rg.tokenize(r));let y="";for(const w of c)if(w.type==="literal")y+=w.literal;else{let f=a[w.position];if(f===void 0)y+=n(r,w,a);else if(w.conversion==="b")y+=Il.boolean(f)?"true":"false";else if(w.conversion==="B")y+=Il.boolean(f)?"TRUE":"FALSE";else if(w.conversion==="c")y+=f;else if(w.conversion==="C")y+=String(f).toUpperCase();else if(w.conversion==="i"||w.conversion==="d")f=String(Math.trunc(f)),w.width!==null&&(f=i(f,w.width,w.flag)),y+=f;else if(w.conversion==="e")y+=Number(f).toExponential();else if(w.conversion==="E")y+=Number(f).toExponential().toUpperCase();else if(w.conversion==="f")w.precision!==null&&(f=Number(f).toFixed(w.precision)),w.width!==null&&(f=i(String(f),w.width,w.flag)),y+=f;else if(w.conversion==="o")y+=(Number.parseInt(String(f),10)>>>0).toString(8);else if(w.conversion==="s")w.width!==null&&(f=i(String(f),w.width,w.flag)),y+=f;else if(w.conversion==="S")w.width!==null&&(f=i(String(f),w.width,w.flag)),y+=String(f).toUpperCase();else if(w.conversion==="u")y+=Number.parseInt(String(f),10)>>>0;else if(w.conversion==="x")f=(Number.parseInt(String(f),10)>>>0).toString(16),w.width!==null&&(f=i(String(f),w.width,w.flag)),y+=f;else throw new Error("Unknown format specifier.")}return y}};Ks.createPrintf=$g,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=Ks;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()}(_l);const Vl=new re,Ng={name:"QtiPrintedVariable",props:{id:{type:String,required:!1},language:{type:String,required:!1},label:{type:String,required:!1},baseuri:{type:String,required:!1},identifier:{type:String,required:!0},format:{type:String,required:!1},base:{type:String,required:!1},index:{type:String,required:!1},powerForm:{type:String,required:!1},field:{type:String,required:!1},delimiter:{type:String,required:!1},mappingIndicator:{type:String,required:!1}},data(){return{value:this.identifier,declaration:null,isQtiValid:!0}},methods:{printedValue(e){return typeof this.format>"u"?e:_l.printf(this.format,e)},evaluate(){try{this.declaration=Vl.validatePrintedVariableIdentifierAttribute(W,this.identifier),this.value=this.printedValue(this.declaration.value),console.log("[QtiPrintedVariable]["+this.identifier+"][Value]",this.value)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{Vl.validatePrintedVariableIdentifierAttribute(W,this.identifier)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{W.definePrintedVariable({node:this}),this.evaluate()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}};function Pg(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",{ref:"root",class:"qti-printed-variable"},l.toDisplayString(s.value),513)}const qg=te(Ng,[["render",Pg]]);class Bg{constructor(){this.constants={LABELS_UPPER_ALPHA:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],LABELS_LOWER_ALPHA:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],LABELS_DECIMAL:["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26"],LABELS_CJK_IDEOGRAPHIC:["一","二","三","四","五","六","七","八","九","十"],LABELS_SUFFIX_PERIOD:".",LABELS_SUFFIX_PARENTHESIS:")",LABELS_SUFFIX_NONE:"",LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA:"、",QTI_LABELS_NONE:"qti-labels-none",QTI_LABELS_DECIMAL:"qti-labels-decimal",QTI_LABELS_LOWER_ALPHA:"qti-labels-lower-alpha",QTI_LABELS_UPPER_ALPHA:"qti-labels-upper-alpha",QTI_LABELS_CJK_IDEOGRAPHIC:"qti-labels-cjk-ideographic",QTI_LABELS_SUFFIX_NONE:"qti-labels-suffix-none",QTI_LABELS_SUFFIX_PERIOD:"qti-labels-suffix-period",QTI_LABELS_SUFFIX_PARENTHESIS:"qti-labels-suffix-parenthesis",QTI_LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA:"qti-labels-cjk-ideographic-comma",QTI_ORIENTATION_VERTICAL:"qti-orientation-vertical",QTI_ORIENTATION_HORIZONTAL:"qti-orientation-horizontal",QTI_INPUT_CONTROL_HIDDEN:"qti-input-control-hidden",SBAC_PRESENTATION:"sbac",LRN_PRESENTATION:"lrn",QTI_CHOICES_STACKING_1:"qti-choices-stacking-1",QTI_CHOICES_STACKING_2:"qti-choices-stacking-2",QTI_CHOICES_STACKING_3:"qti-choices-stacking-3",QTI_CHOICES_STACKING_4:"qti-choices-stacking-4",QTI_CHOICES_STACKING_5:"qti-choices-stacking-5",DATA_MAX_SELECTIONS_MESSAGE:"data-max-selections-message",DATA_MIN_SELECTIONS_MESSAGE:"data-min-selections-message"},this.parentClassList=null,this.choiceGroupNode=null,this.choices=null,this.presentation_HideLabels=!1,this.presentation_Labels=this.constants.LABELS_UPPER_ALPHA,this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PERIOD,this.presentation_Sbac=!1,this.presentation_Lrn=!1,this.presentation_IsInputControlHidden=!1,this.presentation_IsOrientationVertical=!1,this.presentation_IsOrientationHorizontal=!1,this.presentation_MaxSelectionsMessage="",this.presentation_MinSelectionsMessage="",this.presentation_Label_Style="",this.presentation_Stacking_Class=""}initialize(t){this.choiceGroupNode=t,this.parentClassList=t.choiceInteractionClassAttribute,this.choices=t.choices,this.processRootClassAttribute(this.parentClassList),this.processStackingClass(),this.processLabelsAndInputControls()}processRootClassAttribute(t){const i=t.values();for(let n of i)switch(n){case this.constants.QTI_ORIENTATION_VERTICAL:this.presentation_IsOrientationVertical=!0,this.presentation_IsOrientationHorizontal=!1;break;case this.constants.QTI_ORIENTATION_HORIZONTAL:this.presentation_IsOrientationVertical=!1,this.presentation_IsOrientationHorizontal=!0;break;case this.constants.QTI_CHOICES_STACKING_1:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_1;break;case this.constants.QTI_CHOICES_STACKING_2:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_2;break;case this.constants.QTI_CHOICES_STACKING_3:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_3;break;case this.constants.QTI_CHOICES_STACKING_4:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_4;break;case this.constants.QTI_CHOICES_STACKING_5:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_5;break;case this.constants.QTI_LABELS_NONE:this.presentation_HideLabels=!0;break;case this.constants.QTI_LABELS_UPPER_ALPHA:this.presentation_Labels=this.constants.LABELS_UPPER_ALPHA;break;case this.constants.QTI_LABELS_LOWER_ALPHA:this.presentation_Labels=this.constants.LABELS_LOWER_ALPHA;break;case this.constants.QTI_LABELS_DECIMAL:this.presentation_Labels=this.constants.LABELS_DECIMAL;break;case this.constants.QTI_LABELS_CJK_IDEOGRAPHIC:this.presentation_Labels=this.constants.LABELS_CJK_IDEOGRAPHIC;break;case this.constants.QTI_LABELS_SUFFIX_NONE:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_NONE;break;case this.constants.QTI_LABELS_SUFFIX_PERIOD:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PERIOD;break;case this.constants.QTI_LABELS_SUFFIX_PARENTHESIS:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PARENTHESIS;break;case this.constants.QTI_LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA:this.presentation_LabelsSuffix=this.constants.QTI_LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA;break;case this.constants.QTI_INPUT_CONTROL_HIDDEN:this.presentation_IsInputControlHidden=!0;break;case this.constants.SBAC_PRESENTATION:this.presentation_Sbac=!0;break;case this.constants.LRN_PRESENTATION:this.presentation_Lrn=!0;break}}processStackingClass(){if(this.presentation_Stacking_Class!==""&&!this.presentation_IsOrientationVertical&&!this.presentation_IsOrientationHorizontal)this.choices.length>1?this.presentation_IsOrientationHorizontal=!0:this.presentation_IsOrientationVertical=!0;else if(this.presentation_Stacking_Class===""&&this.presentation_IsOrientationHorizontal){const t=this.choices.length;t>=5?this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_5:t==4?this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_4:t==3?this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_3:t==2&&(this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_2),t==1&&(this.presentation_IsOrientationVertical=!0,this.presentation_IsOrientationHorizontal=!1)}!this.presentation_IsOrientationVertical&&!this.presentation_IsOrientationHorizontal&&(this.presentation_IsOrientationVertical=!0),this.choiceGroupNode.$refs.choicegroup.classList.add(this.presentation_IsOrientationVertical?this.constants.QTI_ORIENTATION_VERTICAL:this.constants.QTI_ORIENTATION_HORIZONTAL),this.presentation_Stacking_Class!==""&&this.choiceGroupNode.$refs.choicegroup.classList.add(this.presentation_Stacking_Class)}processLabelsAndInputControls(){for(let t=0;t<this.choices.length;t++)this.presentation_HideLabels?this.choices[t].hideLabel():this.presentation_Sbac?this.choices[t].setLabelSbac(this.presentation_Labels[t]):this.choices[t].setLabel(this.presentation_Labels[t]+this.presentation_LabelsSuffix),this.presentation_Lrn&&this.choices[t].setChoiceLrn(),this.presentation_IsInputControlHidden&&this.choices[t].hideControl()}}const Dg=new re,Qg=new me,Hg={props:{responseIdentifier:{required:!0,type:String},cardinality:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},maxChoices:{required:!1,type:String,default:"1"}},data(){return{choices:[],firstChoice:null,lastChoice:null,role:null,isRadio:null,isShuffle:null,hasPrompt:!1,choiceInteractionClassAttribute:null,presentationFactory:null,isQtiValid:!0,priorState:null}},methods:{getPriorState(){return this.priorState},setPriorState(e){this.priorState=e},validateChildren(){let e=!1;this.$slots.default()[0].children.forEach(t=>{if(Dg.isValidSlot(t)){if(t.type.name==="QtiPrompt"){if(e)throw new h("Invalid element order. qti-prompt must come before qti-simple-choices");if(!this.hasPrompt)return this.hasPrompt=!0;throw new h("Maximum of 1 qti-prompt element permitted")}if(t.type.name==="QtiSimpleChoice")return e=!0;if(t.type.name!=="QtiSimpleChoice")throw new h('Node is not a qti-simple-choice: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children[0].children.forEach(t=>{t.type.name==="QtiSimpleChoice"&&t.component!==null&&this.choices.push(t.component.proxy)},this)},processGroupUI(){this.isShuffle&&this.processShuffle(),this.presentationFactory.initialize(this),this.setActiveDescendant(""),this.isRadio&&this.processFirstAndLastChoices()},resetGroupUI(){this.setPriorState(null),this.processGroupUI(),this.$emit("choiceGroupReady",{choices:this.choices,firstChoice:this.firstChoice,lastChoice:this.lastChoice})},processShuffle(){let e=this.createShuffleContainer(this.choices,this.getPriorState()),t=null;this.hasPrompt&&(t=this.$refs.choicegroup.querySelector(".qti-prompt").cloneNode(!0)),this.choices.splice(0,this.choices.length),this.$refs.choicegroup.innerHTML="",t!==null&&this.$refs.choicegroup.appendChild(t),e.forEach(i=>{this.$refs.choicegroup.appendChild(i.node.$el),this.choices.push(i.node)},this)},createShuffleContainer(e,t){let i=[];return t===null?(e.forEach(n=>{i.push({fixed:n.fixed==="true",node:n})}),Qg.shuffleArrayFixed(i),i):(t.state.order.forEach(n=>{i.push({node:this.findChoiceByIdentifier(n,e)})},this),i)},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new ee('Choice Interaction State Invalid. Choice identifier "'+e+'" not found.')},processFirstAndLastChoices(){this.choices.length!==0&&(this.firstChoice=this.choices[0],this.lastChoice=this.choices[this.choices.length-1])},setActiveDescendant(e){this.$refs.choicegroup.setAttribute("aria-activedescendant",e)},initializeChoiceGroup(){switch(this.cardinality){case"single":this.role="radiogroup",this.isRadio=!0;break;case"multiple":this.role="group",this.isRadio=!1;break;default:this.role="radiogroup",this.isRadio=!0;break}this.isShuffle=this.shuffle==="true",this.presentationFactory=new Bg}},created(){try{if(typeof this.cardinality>"u")throw new h("Undefined qti-choice-interaction cardinality");this.initializeChoiceGroup(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,console.log("[QtiChoiceInteraction][ValidationError]",e.name,e.message),new h(e.message)}},mounted(){if(this.isQtiValid)try{this.choiceInteractionClassAttribute=this.$parent.$refs.root.classList,this.processChildren(),this.setPriorState(this.$parent.priorState),this.processGroupUI(),this.$emit("choiceGroupReady",{choices:this.choices,firstChoice:this.firstChoice,lastChoice:this.lastChoice})}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw console.log("[QtiChoiceInteraction][ValidationException]",e.message),new h(e.message);if(e.name==="QtiEvaluationException")throw console.log("[QtiChoiceInteraction][EvaluationException]",e.message),new ee(e.message)}}},Fg=["role"];function Ug(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("ul",{ref:"choicegroup",role:s.role,class:"qti-choice-list"},[l.renderSlot(e.$slots,"default")],8,Fg)}const Al=te(Hg,[["render",Ug]]),kl=new re,Gg={name:"QtiChoiceInteraction",components:[Al],props:{responseIdentifier:{required:!0,type:String},minChoices:{required:!1,type:String,default:"0"},maxChoices:{required:!1,type:String,default:"1"},shuffle:{required:!1,type:String,default:"false"},orientation:{required:!1,type:String},dataMaxSelectionsMessage:{required:!1,type:String},dataMinSelectionsMessage:{required:!1,type:String}},data(){return{response:null,state:null,isValidResponse:!1,cardinality:"single",minSelectionsMessage:"",maxSelectionsMessage:"",responseDeclaration:null,choices:[],firstChoice:null,lastChoice:null,currentChoice:null,isRadio:!0,isShuffle:!1,hasPrompts:!1,isDisabled:!1,isQtiValid:!0,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},disable(){this.toggleDisableChoices(!0)},enable(){this.toggleDisableChoices(!1)},toggleDisableChoices(e){this.isDisabled=e,this.choices.forEach(t=>{t.setIsDisabled(e)})},getInvalidResponseMessage(){return this.minSelectionsMessage},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.choices.forEach(e=>{e.setChecked(!1),this.isRadio&&e.setTabIndex("-1")}),this.currentChoice=null,this.priorState=null,this.$refs.choicegroup.resetGroupUI()},restoreValue(e){e!==null&&(this.isRadio?this.handleSetChecked({identifier:e,checked:"true"},!0):e.forEach(t=>{this.handleSetChecked({identifier:t,checked:"true"},!0)},this),this.updateValidity(this.computeIsValid()))},getCardinality(){let e=W.getResponseDeclaration(this.responseIdentifier);return this.cardinality=typeof e<"u"?e.cardinality!=="multiple"?"single":"multiple":"single",this.cardinality},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},handleSetChecked(e,t=!1){this.choices.forEach(i=>{this.isRadio&&(i.setChecked(!1),i.setTabIndex("-1")),i.identifier===e.identifier&&(this.currentChoice=i)}),e.checked==="true"?this.checkMaxChoicesLimit()?this.currentChoice.setChecked(!1):this.currentChoice.setChecked(!0):this.currentChoice.setChecked(!1),t||(this.setResponse(this.computeResponse()),this.currentChoice.setFocus(),this.evaluateValidity()),this.currentChoice.setTabIndex("0")},handleSetFocusPreviousChoice(e){this.isRadio&&this.removeChoiceFromTabOrder(e),this.setFocusChoice(this.findPreviousIdentifier(e))},handleSetFocusNextChoice(e){this.isRadio&&this.removeChoiceFromTabOrder(e),this.setFocusChoice(this.findNextIdentifier(e))},handleSetActiveDescendant(e){this.$refs.choicegroup.setActiveDescendant(e)},setFocusChoice(e){for(let t=0;t<this.choices.length;t++)this.choices[t].identifier===e&&(this.currentChoice=this.choices[t]);this.currentChoice.setTabIndex("0"),this.currentChoice.setFocus()},removeChoiceFromTabOrder(e){for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e){this.choices[t].setTabIndex(-1);break}},findPreviousIdentifier(e){if(e===this.firstChoice.identifier)return this.lastChoice.identifier;for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e)return this.choices[t-1].identifier;return null},findNextIdentifier(e){if(e===this.lastChoice.identifier)return this.firstChoice.identifier;for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e)return this.choices[t+1].identifier;return null},handleChoiceGroupReady(e){this.choices=e.choices,this.firstChoice=e.firstChoice,this.lastChoice=e.lastChoice,this.isRadio&&this.firstChoice.setTabIndex("0"),this.priorState!==null&&this.restoreValue(this.priorState.value),this.setResponse(this.computeResponse()),this.setState(this.computeState()),this.setIsValid(this.computeIsValid())},computeResponse(){let e=this.isRadio?null:[];return this.choices.forEach(t=>{t.isChecked()&&(this.isRadio?e=t.identifier:e.push(t.identifier))}),this.isRadio?e:e.length===0?null:e},computeState(){const e={};let t=[];return this.choices.forEach(i=>{t.push(i.identifier)}),e.order=t,e},computeIsValid(){return this.minChoices*1===0?!0:this.response===null?!1:this.cardinality==="single"||this.cardinality==="multiple"&&this.response.length>=this.minChoices*1},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},checkMaxChoicesLimit(){if(this.isRadio||this.maxChoices==0)return!1;const e=this.getResponse();return e!==null&&e.length==this.maxChoices?(W.NotifyInteractionSelectionsLimit(this.maxSelectionsMessage),!0):!1},computeMaxSelectionsMessage(){if(typeof this.dataMaxSelectionsMessage<"u"){this.maxSelectionsMessage=this.dataMaxSelectionsMessage;return}this.maxSelectionsMessage=this.maxChoices==0?"":"You are permitted a maximum of "+this.maxChoices+" choice"+(this.maxChoices>1?"s":"")+" for this question.<br/><br/>Please unselect one of your choices before making another choice."},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}this.minSelectionsMessage=this.minChoices==0?"":"You must make at least "+this.minChoices+" choice"+(this.minChoices>1?"s":"")+" for this question."},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Choice Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Choice Interaction State Invalid. "state" property not found.');if(!("order"in t.state))throw new ee('Choice Interaction State Invalid. "order" property not found.');return t},showSolution(e){if(e!==null){if(this.isRadio){this.choices.forEach(t=>{this.setChoiceSolution(t,e)},this);return}this.choices.forEach(t=>{const i=this.findIdentifierInCorrectResponse(t.identifier,e);this.setChoiceSolution(t,i)},this)}},setChoiceSolution(e,t){e.isChecked()?e.identifier===t?e.setCorrectSolution():e.setIncorrectSolution():e.identifier===t?e.setExpectedSolution():e.setIgnoreSolution()},findIdentifierInCorrectResponse(e,t){for(let i=0;i<t.length;i++)if(e===t[i])return e;return null}},created(){try{this.responseDeclaration=kl.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.priorState=this.getPriorState(this.responseIdentifier),kl.validateMaxMinChoices(this.maxChoices,this.minChoices),this.cardinality=this.getCardinality(),this.isRadio=this.cardinality!=="multiple",this.isShuffle=this.shuffle==="true",this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMinSelectionsMessage(),this.computeMaxSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"Choice",node:this,resetValue:this.resetValue,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxSelectionsMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},jg={ref:"root",class:"qti-choice-interaction"},Wg={ref:"prompt",class:"qti-prompt-wrapper"};function zg(e,t,i,n,s,r){const a=l.resolveComponent("ChoiceGroup");return l.openBlock(),l.createElementBlock("div",jg,[l.createElementVNode("div",Wg,null,512),l.createVNode(a,l.mergeProps({ref:"choicegroup",cardinality:s.cardinality,shuffle:i.shuffle,responseIdentifier:i.responseIdentifier,maxChoices:i.maxChoices,minChoices:i.minChoices,onChoiceGroupReady:r.handleChoiceGroupReady,onSetChecked:r.handleSetChecked,onSetFocusNextChoice:r.handleSetFocusNextChoice,onSetFocusPreviousChoice:r.handleSetFocusPreviousChoice,onSetActiveDescendant:r.handleSetActiveDescendant},e.$attrs),{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},16,["cardinality","shuffle","responseIdentifier","maxChoices","minChoices","onChoiceGroupReady","onSetChecked","onSetFocusNextChoice","onSetFocusPreviousChoice","onSetActiveDescendant"])],512)}const Kg=te(Gg,[["render",zg]]);class Yg{constructor(t){return this.constants={QTI_ORIENTATION_HORIZONTAL:"qti-orientation-horizontal",QTI_ORIENTATION_VERTICAL:"qti-orientation-vertical",QTI_WRITING_ORIENTATION_VERTICAL_RL:"qti-writing-orientation-vertical-rl"},this.classList=t,this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_HORIZONTAL,this.processClassAttribute(),this}processClassAttribute(){if(typeof this.classList>"u"||this.classList===null||this.classList.length==0)return;const t=this.classList.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case this.constants.QTI_ORIENTATION_VERTICAL:case this.constants.QTI_WRITING_ORIENTATION_VERTICAL_RL:this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_VERTICAL;break;case this.constants.QTI_ORIENTATION_HORIZONTAL:this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_HORIZONTAL;break}}getOrientationClass(){return this.presentation_OrientationClass}isOrientationVertical(){return this.presentation_OrientationClass==this.constants.QTI_ORIENTATION_VERTICAL}setVerticalOrientation(t){this.isOrientationVertical()&&t.classList.add(this.constants.QTI_ORIENTATION_VERTICAL)}}const pa=new re,Xg=new me,Zg={name:"QtiInlineChoiceInteraction",props:{responseIdentifier:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},required:{required:!1,type:String,default:"false"},dataPrompt:{required:!1,type:String,default:"Choose..."},minChoices:{required:!1,type:String,default:"0"},maxChoices:{required:!1,type:String,default:"1"},dataMinSelectionsMessage:{required:!1,type:String}},computed:{labelId(){return"inlinechoice_label_"+this.responseIdentifier},buttonId(){return"inlinechoice_button_"+this.responseIdentifier},buttonAriaLabelledbyId(){return"inlinechoice_label_"+this.responseIdentifier+" inlinechoice_button_"+this.responseIdentifier},listboxId(){return"inlinechoice_listbox_"+this.responseIdentifier},listboxAriaLabelledbyId(){return"inlinechoice_label_"+this.responseIdentifier}},data(){return{response:null,state:null,isValidResponse:!1,cardinality:"single",minSelectionsMessage:"",choices:[],allOptionElements:null,activeDescendant:null,keysSoFar:"",searchIndex:null,isShuffle:null,isRequired:!1,isDisabled:!1,isQtiValid:!0,presentationFactory:null,isOrientationVertical:!1,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.minSelectionsMessage},disable(){this.toggleDisable(!0)},enable(){this.toggleDisable(!1)},toggleDisable(e){this.isDisabled=e,e?(this.getResponse()===null&&(this.$refs.label.innerHTML=""),this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.button.classList.add("qti-hidden"),this.$refs.listbox.classList.add("inline-choice-select-listbox-hidden")):(this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.button.classList.remove("qti-hidden"))},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.$refs.listbox.querySelectorAll('[role="option"]').forEach(t=>{this.defocusOption(t)},this),this.processGroupUI()},restoreValue(e){if(e===null)return;const t=this.findChoiceByIdentifier(e,this.choices);this.focusOption(t.$el,!0),this.setResponse(this.computeResponse(e)),this.updateValidity(this.computeIsValid())},getCardinality(){let e=W.getResponseDeclaration(this.responseIdentifier);if(typeof e>"u"&&(this.cardinality="single"),e.cardinality!=="single")throw new h('Invalid qti-inline-choice-interaction Response Variable cardinality: "'+this.cardinality+'"');return this.cardinality="single",this.cardinality},computeResponse(e){return e===null||e.length===0?null:e},computeState(){const e={};let t=[];return this.choices.forEach(i=>{t.push(i.identifier)}),e.order=t,e},computeIsValid(){return!this.isRequired&&this.minChoices*1===0?!0:this.response!==null},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}!this.isRequired&&this.minChoices*1===0||(this.minSelectionsMessage="You must make at least 1 choice for this question.")},handleButtonClick(){this.isDisabled||this.showListbox()},handleButtonKeyup(e){switch(e.code){case"ArrowUp":case"ArrowDown":if(e.preventDefault(),this.isDisabled)return;this.showListbox();break}},handleChoiceMousedown(e){e.preventDefault();let t=e.target;t.getAttribute("role")==="option"&&(this.focusOption(t),this.hideListbox(),this.$refs.button.focus())},handleBlur(){this.hideListbox()},handleFocusChange(e){this.$refs.prompt.innerHTML=e.innerHTML,this.$refs.label.innerHTML=e.innerHTML},showListbox(){this.$refs.listbox.classList.remove("inline-choice-select-listbox-hidden"),this.$refs.button.setAttribute("aria-expanded","true"),this.$refs.listbox.focus()},hideListbox(){this.$refs.listbox.classList.add("inline-choice-select-listbox-hidden"),this.$refs.button.removeAttribute("aria-expanded")},setupFocus(){this.activeDescendant||this.focusFirstOption()},focusFirstOption(){let e=this.$refs.listbox.querySelector('[role="option"]');e&&this.focusOption(e)},focusLastOption(){let e=this.$refs.listbox.querySelectorAll('[role="option"]');e.length&&this.focusOption(e[e.length-1])},focusOption(e,t=!1){if(t||this.defocusOption(document.getElementById(this.activeDescendant)),e.setAttribute("aria-selected","true"),e.classList.add("focused"),this.setActiveDescendant(e.id),!t&&(this.setResponse(this.computeResponse(e.getAttribute("data-identifier"))),this.evaluateValidity(),this.$refs.listbox.scrollHeight>this.$refs.listbox.clientHeight)){const i=this.$refs.listbox.clientHeight+this.$refs.listbox.scrollTop,n=e.offsetTop+e.offsetHeight;n>i?this.$refs.listbox.scrollTop=n-this.$refs.listbox.clientHeight:e.offsetTop<this.$refs.listbox.scrollTop&&(this.$refs.listbox.scrollTop=e.offsetTop)}this.handleFocusChange(e)},defocusOption(e){e&&(e.removeAttribute("aria-selected"),e.classList.remove("focused"))},checkKeyPress(e){if(e.code=="Enter"||e.code=="Escape"){e.preventDefault(),this.hideListbox(),this.$refs.button.focus();return}let t=document.getElementById(this.activeDescendant);if(t)switch(e.code){case"ArrowUp":case"ArrowDown":e.preventDefault(),e.code=="ArrowUp"?t=t.previousElementSibling:t=t.nextElementSibling,t&&this.focusOption(t);break;case"Home":e.preventDefault(),this.focusFirstOption();break;case"End":e.preventDefault(),this.focusLastOption();break}},findOptionToFocus(e){let t=this.$refs.listbox.querySelectorAll('[role="option"]');if(!this.keysSoFar)for(let n=0;n<t.length;n++)t[n].getAttribute("id")==this.activeDescendant&&(this.searchIndex=n);this.keysSoFar+=e,this.clearKeysSoFarAfterDelay();let i=this.findMatchInRange(t,this.searchIndex+1,t.length);return i||(i=this.findMatchInRange(t,0,this.searchIndex)),i},clearKeysSoFarAfterDelay(){this.keyClear&&(clearTimeout(this.keyClear),this.keyClear=null);let e=this;this.keyClear=setTimeout((function(){e.keysSoFar="",e.keyClear=null}).bind(this),500)},findMatchInRange(e,t,i){for(let n=t;n<i;n++){let s=e[n].innerText;if(s&&s.toUpperCase().indexOf(this.keysSoFar)===0)return e[n]}return null},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(pa.isValidSlot(e)){if(e.type.name==="QtiInlineChoice")return;throw new h('Node is not a qti-inline-choice: "'+e.type.name+'"')}})},processChildren(){const e=this.$.subTree.children[0].children[2].children[0];this.choices.push(e.component.proxy),this.$.subTree.children[0].children[2].children[1].children.forEach(i=>{i.component!==null&&this.choices.push(i.component.proxy)})},processGroupUI(){this.isOrientationVertical&&this.presentationFactory.setVerticalOrientation(this.$refs.root),this.isShuffle&&this.processShuffle(),this.setResponse(null),this.setState(this.computeState()),this.setIsValid(this.computeIsValid()),this.setActiveDescendant("")},processShuffle(){let e=this.createShuffleContainer(this.choices,this.priorState);this.choices.splice(0,this.choices.length),this.$refs.listbox.innerHTML="",e.forEach(t=>{this.$refs.listbox.appendChild(t.node.$el),this.choices.push(t.node)},this)},createShuffleContainer(e,t){let i=[];return t===null?(e.forEach(n=>{i.push({fixed:n.fixed==="true",node:n})}),Xg.shuffleArrayFixed(i),i):(t.state.order.forEach(n=>{i.push({node:this.findChoiceByIdentifier(n,e)})},this),i)},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new ee('Inline Choice Interaction State Invalid. Inline Choice identifier "'+e+'" not found.')},setActiveDescendant(e){this.activeDescendant=e,this.$refs.listbox.setAttribute("aria-activedescendant",e)},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Choice Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Choice Interaction State Invalid. "state" property not found.');if(!("order"in t.state))throw new ee('Choice Interaction State Invalid. "order" property not found.');return t},addChoiceMousedownListeners(){this.allOptionElements=this.$refs.listbox.querySelectorAll('[role="option"]'),this.allOptionElements.forEach(e=>{e.addEventListener("mousedown",this.handleChoiceMousedown)})},removeChoiceMousedownListeners(){this.allOptionsElements!==null&&this.allOptionElements.forEach(e=>{e.removeEventListener("mousedown",this.handleChoiceMousedown)})}},created(){try{if(this.responseDeclaration=pa.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.presentationFactory=new Yg(this.$.vnode.props.class),this.isOrientationVertical=this.presentationFactory.isOrientationVertical(),this.validateChildren(),this.priorState=this.getPriorState(this.responseIdentifier),pa.validateMaxMinChoices(this.maxChoices,this.minChoices),this.minChoices>1)throw new h('Invalid qti-inline-choice-interaction min-choices attribute: "'+this.minChoices+'"');this.cardinality=this.getCardinality(),this.isShuffle=this.shuffle==="true",this.isRequired=this.required==="true",this.computeMinSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.processGroupUI(),this.priorState!==null&&this.restoreValue(this.priorState.value),this.addChoiceMousedownListeners(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"InlineChoice",node:this,resetValue:this.resetValue,isValidResponse:this.isValidResponse,invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:null}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}},beforeUnmount(){this.removeChoiceMousedownListeners()}},Jg={ref:"root",class:"qti-inline-choice-interaction"},ey={class:"inline-choice-wrapper"},ty=["aria-labelledby","id"],iy=["aria-labelledby"];function ny(e,t,i,n,s,r){const a=l.resolveComponent("qti-inline-choice");return l.openBlock(),l.createElementBlock("div",Jg,[l.createElementVNode("div",ey,[l.createElementVNode("div",{ref:"label",class:"inline-choice-select-label qti-hidden"},l.toDisplayString(i.dataPrompt),513),l.createElementVNode("button",{ref:"button","aria-haspopup":"listbox","aria-labelledby":r.buttonAriaLabelledbyId,id:r.buttonId,class:"inline-choice-select",onClick:t[0]||(t[0]=(...c)=>r.handleButtonClick&&r.handleButtonClick(...c)),onKeyup:t[1]||(t[1]=(...c)=>r.handleButtonKeyup&&r.handleButtonKeyup(...c))},[l.createElementVNode("div",{ref:"prompt",class:"inline-choice-select-prompt"},l.toDisplayString(i.dataPrompt),513)],40,ty),l.createElementVNode("ul",{ref:"listbox",tabindex:"-1",role:"listbox","aria-labelledby":r.labelId,class:"inline-choice-select-listbox inline-choice-select-listbox-hidden",onBlur:t[2]||(t[2]=(...c)=>r.handleBlur&&r.handleBlur(...c)),onFocus:t[3]||(t[3]=(...c)=>r.setupFocus&&r.setupFocus(...c)),onKeydown:t[4]||(t[4]=(...c)=>r.checkKeyPress&&r.checkKeyPress(...c))},[l.createVNode(a,{identifier:"",fixed:"true"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(i.dataPrompt),1)]),_:1}),l.renderSlot(e.$slots,"default")],40,iy)])],512)}const sy=te(Zg,[["render",ny]]),ry={name:"EndAttemptGeneric",props:{title:{required:!0,type:String}},data(){return{step:1,isBtnDisabled:!1}},methods:{getIsBtnDisabled(){return this.isBtnDisabled},setIsBtnDisabled(e){this.isBtnDisabled=e},handleEndAttempt(){this.$parent.$emit("endAttempt",{response:!0})},enable(){this.toggleButtonDisabled(!1)},disable(){this.toggleButtonDisabled(!0)},toggleButtonDisabled(e){e?this.$refs.root.setAttribute("disabled",""):this.$refs.root.removeAttribute("disabled"),this.setIsBtnDisabled(e)}},created(){},mounted(){this.$parent.$emit("endAttemptReady",{node:this})}};function ay(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("button",{ref:"root",class:"qti-end-attempt-interaction",onClick:t[0]||(t[0]=l.withModifiers((...a)=>r.handleEndAttempt&&r.handleEndAttempt(...a),["prevent"])),type:"button"},l.toDisplayString(i.title),513)}const oy=te(ry,[["render",ay]]),ly={name:"EndAttemptControllerBar",props:{responseIdentifier:{required:!0,type:String},title:{required:!0,type:String},dataSteps:{required:!1,type:String},dataHastemplates:{required:!1,type:String},dataControllerType:{required:!1,type:String},dataHideprogress:{required:!1,type:String}},data(){return{step:1,isBtnDisabled:!1,response:!1}},computed:{progressMaximumSteps(){return typeof this.dataSteps>"u"?1:this.dataSteps*1},progressActiveWidth(){let e=this.progressMaximumSteps;return e=this.step>e?this.step:e,Math.floor(100*(this.step/e))},progressMessage(){return this.step===this.progressMaximumSteps?"All Parts Showing":"Step "+this.step+" of "+this.progressMaximumSteps},hasTemplates(){return typeof this.dataHastemplates<"u"?this.dataHastemplates==="true":!1},controllerType(){return typeof this.dataControllerType<"u"?this.dataControllerType:"generic"},progressClass(){return{"endattempt-progress-panel":!0,"progress-hidden":typeof this.dataHideprogress<"u"?this.dataHideprogress==="true":!1}}},methods:{getStep(){return this.step},setStep(e){this.step=e<this.progressMaximumSteps?e:this.progressMaximumSteps},incrementStep(){this.setStep(this.getStep()+1)},getIsBtnDisabled(){return this.isBtnDisabled},setIsBtnDisabled(e){this.isBtnDisabled=e},handleControllerNewTemplate(){this.resetControllerState(),W.NotifyNewTemplate({identifier:this.responseIdentifier,step:this.getStep(),maximumSteps:this.progressMaximumSteps})},handleControllerEndAttempt(){this.updateControllerState(),this.$parent.$emit("endAttempt",{response:this.response})},enable(){this.toggleButtonDisabled(!1)},disable(){this.toggleButtonDisabled(!0)},toggleButtonDisabled(e){e?this.$refs.endattempt.setAttribute("disabled",""):this.$refs.endattempt.removeAttribute("disabled"),this.setIsBtnDisabled(e)},resetControllerState(){this.setStep(1),this.enable(),this.$parent.$emit("notifyUpdateState",{})},updateControllerState(){switch(this.dataControllerType){case"showexample":case"solve":this.incrementStep(),this.getStep()<this.progressMaximumSteps?(this.response=!1,this.enable()):(this.response=!0,this.disable());break;case"generic":default:this.getStep()<this.progressMaximumSteps?(this.response=!1,this.incrementStep(),this.enable()):(this.response=!0,this.disable())}}},created(){},mounted(){this.$parent.$emit("endAttemptReady",{node:this})}},uy={class:"endattempt-controller"},cy={class:"endattempt-controller-progress"},hy={id:"msgNotes"},dy={class:"progress"},fy=["aria-valuenow"],py=l.createElementVNode("div",{class:"endattempt-controller-filler"},null,-1),my={class:"endattempt-controller-buttons"};function gy(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",uy,[l.createElementVNode("div",cy,[l.createElementVNode("div",{class:l.normalizeClass(r.progressClass)},[l.createElementVNode("div",hy,l.toDisplayString(r.progressMessage),1),l.createElementVNode("div",dy,[l.createElementVNode("div",{class:"progress-bar",style:l.normalizeStyle({width:r.progressActiveWidth+"%"}),role:"progressbar","aria-valuenow":r.progressActiveWidth,"aria-valuemin":"0","aria-valuemax":"progressMaximumSteps"},null,12,fy)])],2)]),py,l.createElementVNode("div",my,[r.hasTemplates?(l.openBlock(),l.createElementBlock("button",{key:0,id:"btnNewTemplate",onClick:t[0]||(t[0]=l.withModifiers((...a)=>r.handleControllerNewTemplate&&r.handleControllerNewTemplate(...a),["prevent"])),type:"button",class:"endattempt-btn endattempt-btn-secondary"},"New Question")):l.createCommentVNode("",!0),l.createElementVNode("button",{ref:"endattempt",id:"btnEndAttempt",onClick:t[1]||(t[1]=l.withModifiers((...a)=>r.handleControllerEndAttempt&&r.handleControllerEndAttempt(...a),["prevent"])),type:"button",class:"endattempt-btn endattempt-btn-primary"},l.toDisplayString(i.title),513)])])}const yy=te(ly,[["render",gy]]),Js={DEFAULT:"",ENDATTEMPT_CONTROLLER_BAR:"endattempt-controller-bar"};function vy(e,t){switch(e){case Js.ENDATTEMPT_CONTROLLER_BAR:return{template:'<end-attempt-controller-bar response-identifier="'+t.responseIdentifier+'" title="'+t.title+'" data-steps="'+t.dataSteps+'" data-hastemplates="'+t.dataHastemplates+'" data-controller-type="'+t.dataControllerType+'" data-hideprogress="'+t.dataHideprogress+'" />',components:{EndAttemptControllerBar:yy}};default:return{template:'<end-attempt-default response-identifier="'+t.responseIdentifier+'" title="'+t.title+'"/>',components:{EndAttemptDefault:oy}}}}function wy(e){if(typeof e>"u"||e===null||e.length==0)return Js.DEFAULT;const t=e.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case Js.ENDATTEMPT_CONTROLLER_BAR:return t[i]}return Js.DEFAULT}const by=new re,Ey={name:"QtiEndAttemptInteraction",props:{responseIdentifier:{required:!0,type:String},title:{required:!0,type:String},dataSteps:{required:!1,type:String},dataHastemplates:{required:!1,type:String},dataControllerType:{required:!1,type:String},dataHideprogress:{required:!1,type:String}},data(){return{response:!1,state:null,cardinality:"single",responseDeclaration:null,interactionSubType:"",isBtnDisabled:!1,isValidResponse:!0,invalidResponseMessage:"",isQtiValid:!0,node:null,priorState:null}},computed:{interactionTemplate(){return vy(this.interactionSubType,this.createComponentProperties())}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},updateState(){this.setState(this.computeState())},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.invalidResponseMessage},getCardinality(){return this.cardinality},getStep(){return this.interactionSubType==="endattempt-controller-bar"?this.node.getStep():1},setStep(e){this.interactionSubType==="endattempt-controller-bar"&&this.node.setStep(e)},initializeValue(){this.enableButton(),this.setStep(1),this.updateState(),this.setResponse(!1),this.setIsValid(!0)},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.initializeValue()},restoreValue(e){e.state.isBtnDisabled?this.disableButton():this.enableButton(),this.setStep(e.state.step),this.setState(this.computeState()),this.setResponse(this.computeResponse(e.value)),this.setIsValid(!0)},computeResponse(e){return e===null?!1:e},computeState(){return{step:this.getStep(),isBtnDisabled:this.getIsBtnDisabled(),interactionSubType:this.getInteractionSubType()}},disable(){this.disableButton(),this.updateState()},enable(){this.enableButton(),this.setResponse(!1),this.updateState()},getIsBtnDisabled(){return this.node.getIsBtnDisabled()},setIsBtnDisabled(e){this.node.setIsBtnDisabled(e)},setInteractionSubType(e){this.interactionSubType=e},getInteractionSubType(){return this.interactionSubType},handleEndAttempt(e){this.setResponse(e.response),this.updateState(),this.notifyEndAttempt()},handleUpdateState(){this.updateState()},enableButton(){this.node.enable()},disableButton(){this.node.disable()},detectInteractionSubType(e){return wy(e)},createComponentProperties(){const e={responseIdentifier:this.responseIdentifier,title:this.title};return e.dataSteps=typeof this.dataSteps<"u"?this.dataSteps:"1",e.dataHastemplates=typeof this.dataHastemplates<"u"?this.dataHastemplates==="true":!1,e.dataHideprogress=typeof this.dataHideprogress<"u"?this.dataHideprogress==="true":!1,e.dataControllerType=typeof this.dataControllerType<"u"?this.dataControllerType:"generic",e},handleEndAttemptReady(e){this.node=e.node},notifyEndAttempt(){W.NotifyEndAttempt({identifier:this.responseIdentifier,step:this.getStep(),maximumSteps:typeof this.dataSteps<"u"?this.dataSteps*1:1,interactionSubType:this.getInteractionSubType()})},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('End Attempt Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('End Attempt Interaction State Invalid. "state" property not found.');if(!("step"in t.state))throw new ee('End Attempt Interaction State Invalid. "step" property not found.');if(!("isBtnDisabled"in t.state))throw new ee('End Attempt Interaction State Invalid. "isBtnDisabled" property not found.');return t}},created(){try{this.responseDeclaration=by.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.setInteractionSubType(this.detectInteractionSubType(this.$attrs.class)),this.priorState=this.getPriorState(this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.priorState===null?this.initializeValue():this.restoreValue(this.priorState),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"EndAttemptInteraction",interactionSubType:this.interactionSubType,node:this,resetValue:this.resetValue,disable:this.disable,enable:this.enable,isValidResponse:this.isValidResponse,invalidResponseMessage:this.getInvalidResponseMessage()}),console.log("["+this.$options.name+":"+this.interactionSubType+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},Sy={ref:"root"};function Ty(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Sy,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.interactionTemplate),l.mergeProps({ref:"endattempt",onEndAttempt:r.handleEndAttempt,onUpdateState:r.handleUpdateState,onEndAttemptReady:r.handleEndAttemptReady},e.$attrs),null,16,["onEndAttempt","onUpdateState","onEndAttemptReady"]))],512)}const Cy=te(Ey,[["render",Ty]]);class _y{constructor(t,i){return this.constants={QTI_COUNTER_NONE:"none",QTI_COUNTER_UP:"qti-counter-up",QTI_COUNTER_DOWN:"qti-counter-down",QTI_HEIGHT_LINES_3:"qti-height-lines-3",QTI_HEIGHT_LINES_6:"qti-height-lines-6",QTI_HEIGHT_LINES_15:"qti-height-lines-15",SBAC_HEIGHT_LINES_95:"sbac-height-lines-95",SBAC_PRESENTATION:"sbac"},this.classList=t,this.expectedLength=i,this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_3,this.presentation_CounterStyle=this.constants.QTI_COUNTER_NONE,this.presentation_Sbac=!1,this.processClassAttribute(),this}processClassAttribute(){if(typeof this.classList>"u"||this.classList===null||this.classList.length==0)return;const t=this.classList.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case this.constants.SBAC_PRESENTATION:this.presentation_Sbac=!0;break;case this.constants.SBAC_HEIGHT_LINES_95:this.presentation_HeightClass=this.constants.SBAC_HEIGHT_LINES_95;break;case this.constants.QTI_COUNTER_UP:this.presentation_CounterStyle="up",this.expectedLength=this.processExpectedLength();break;case this.constants.QTI_COUNTER_DOWN:this.presentation_CounterStyle="down",this.expectedLength=this.processExpectedLength();break;case this.constants.QTI_HEIGHT_LINES_3:this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_3;break;case this.constants.QTI_HEIGHT_LINES_6:this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_6;break;case this.constants.QTI_HEIGHT_LINES_15:this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_15;break}}processExpectedLength(){return typeof this.expectedLength>"u"||this.expectedLength===null||this.expectedLength.length==0||this.expectedLength==="0"?400:this.expectedLength*1}getCounterStyle(){return this.presentation_CounterStyle}getHeightClass(){return this.presentation_HeightClass}getExpectedLength(){return this.expectedLength}getIsSbac(){return this.presentation_Sbac}}var vt="top",Rt="bottom",Mt="right",wt="left",ma="auto",Ln=[vt,Rt,Mt,wt],Fi="start",Rn="end",xy="clippingParents",Ol="viewport",Mn="popper",Iy="reference",Ll=Ln.reduce(function(e,t){return e.concat([t+"-"+Fi,t+"-"+Rn])},[]),Rl=[].concat(Ln,[ma]).reduce(function(e,t){return e.concat([t,t+"-"+Fi,t+"-"+Rn])},[]),Vy="beforeRead",Ay="read",ky="afterRead",Oy="beforeMain",Ly="main",Ry="afterMain",My="beforeWrite",$y="write",Ny="afterWrite",Py=[Vy,Ay,ky,Oy,Ly,Ry,My,$y,Ny];function Ut(e){return e?(e.nodeName||"").toLowerCase():null}function St(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ci(e){var t=St(e).Element;return e instanceof t||e instanceof Element}function $t(e){var t=St(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ga(e){if(typeof ShadowRoot>"u")return!1;var t=St(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function qy(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var n=t.styles[i]||{},s=t.attributes[i]||{},r=t.elements[i];!$t(r)||!Ut(r)||(Object.assign(r.style,n),Object.keys(s).forEach(function(a){var c=s[a];c===!1?r.removeAttribute(a):r.setAttribute(a,c===!0?"":c)}))})}function By(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(n){var s=t.elements[n],r=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:i[n]),c=a.reduce(function(y,w){return y[w]="",y},{});!$t(s)||!Ut(s)||(Object.assign(s.style,c),Object.keys(r).forEach(function(y){s.removeAttribute(y)}))})}}const Ml={name:"applyStyles",enabled:!0,phase:"write",fn:qy,effect:By,requires:["computeStyles"]};function Gt(e){return e.split("-")[0]}var _i=Math.max,er=Math.min,Ui=Math.round;function ya(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function $l(){return!/^((?!chrome|android).)*safari/i.test(ya())}function Gi(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var n=e.getBoundingClientRect(),s=1,r=1;t&&$t(e)&&(s=e.offsetWidth>0&&Ui(n.width)/e.offsetWidth||1,r=e.offsetHeight>0&&Ui(n.height)/e.offsetHeight||1);var a=Ci(e)?St(e):window,c=a.visualViewport,y=!$l()&&i,w=(n.left+(y&&c?c.offsetLeft:0))/s,f=(n.top+(y&&c?c.offsetTop:0))/r,g=n.width/s,p=n.height/r;return{width:g,height:p,top:f,right:w+g,bottom:f+p,left:w,x:w,y:f}}function va(e){var t=Gi(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function Nl(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&ga(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ti(e){return St(e).getComputedStyle(e)}function Dy(e){return["table","td","th"].indexOf(Ut(e))>=0}function ui(e){return((Ci(e)?e.ownerDocument:e.document)||window.document).documentElement}function tr(e){return Ut(e)==="html"?e:e.assignedSlot||e.parentNode||(ga(e)?e.host:null)||ui(e)}function Pl(e){return!$t(e)||ti(e).position==="fixed"?null:e.offsetParent}function Qy(e){var t=/firefox/i.test(ya()),i=/Trident/i.test(ya());if(i&&$t(e)){var n=ti(e);if(n.position==="fixed")return null}var s=tr(e);for(ga(s)&&(s=s.host);$t(s)&&["html","body"].indexOf(Ut(s))<0;){var r=ti(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function $n(e){for(var t=St(e),i=Pl(e);i&&Dy(i)&&ti(i).position==="static";)i=Pl(i);return i&&(Ut(i)==="html"||Ut(i)==="body"&&ti(i).position==="static")?t:i||Qy(e)||t}function wa(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Nn(e,t,i){return _i(e,er(t,i))}function Hy(e,t,i){var n=Nn(e,t,i);return n>i?i:n}function ql(){return{top:0,right:0,bottom:0,left:0}}function Bl(e){return Object.assign({},ql(),e)}function Dl(e,t){return t.reduce(function(i,n){return i[n]=e,i},{})}var Fy=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,Bl(typeof t!="number"?t:Dl(t,Ln))};function Uy(e){var t,i=e.state,n=e.name,s=e.options,r=i.elements.arrow,a=i.modifiersData.popperOffsets,c=Gt(i.placement),y=wa(c),w=[wt,Mt].indexOf(c)>=0,f=w?"height":"width";if(!(!r||!a)){var g=Fy(s.padding,i),p=va(r),d=y==="y"?vt:wt,S=y==="y"?Rt:Mt,b=i.rects.reference[f]+i.rects.reference[y]-a[y]-i.rects.popper[f],_=a[y]-i.rects.reference[y],E=$n(r),m=E?y==="y"?E.clientHeight||0:E.clientWidth||0:0,A=b/2-_/2,u=g[d],O=m-p[f]-g[S],P=m/2-p[f]/2+A,q=Nn(u,P,O),v=y;i.modifiersData[n]=(t={},t[v]=q,t.centerOffset=q-P,t)}}function Gy(e){var t=e.state,i=e.options,n=i.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Nl(t.elements.popper,s)&&(t.elements.arrow=s))}const jy={name:"arrow",enabled:!0,phase:"main",fn:Uy,effect:Gy,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ji(e){return e.split("-")[1]}var Wy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function zy(e,t){var i=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:Ui(i*s)/s||0,y:Ui(n*s)/s||0}}function Ql(e){var t,i=e.popper,n=e.popperRect,s=e.placement,r=e.variation,a=e.offsets,c=e.position,y=e.gpuAcceleration,w=e.adaptive,f=e.roundOffsets,g=e.isFixed,p=a.x,d=p===void 0?0:p,S=a.y,b=S===void 0?0:S,_=typeof f=="function"?f({x:d,y:b}):{x:d,y:b};d=_.x,b=_.y;var E=a.hasOwnProperty("x"),m=a.hasOwnProperty("y"),A=wt,u=vt,O=window;if(w){var P=$n(i),q="clientHeight",v="clientWidth";if(P===St(i)&&(P=ui(i),ti(P).position!=="static"&&c==="absolute"&&(q="scrollHeight",v="scrollWidth")),P=P,s===vt||(s===wt||s===Mt)&&r===Rn){u=Rt;var V=g&&P===O&&O.visualViewport?O.visualViewport.height:P[q];b-=V-n.height,b*=y?1:-1}if(s===wt||(s===vt||s===Rt)&&r===Rn){A=Mt;var C=g&&P===O&&O.visualViewport?O.visualViewport.width:P[v];d-=C-n.width,d*=y?1:-1}}var x=Object.assign({position:c},w&&Wy),I=f===!0?zy({x:d,y:b},St(i)):{x:d,y:b};if(d=I.x,b=I.y,y){var k;return Object.assign({},x,(k={},k[u]=m?"0":"",k[A]=E?"0":"",k.transform=(O.devicePixelRatio||1)<=1?"translate("+d+"px, "+b+"px)":"translate3d("+d+"px, "+b+"px, 0)",k))}return Object.assign({},x,(t={},t[u]=m?b+"px":"",t[A]=E?d+"px":"",t.transform="",t))}function Ky(e){var t=e.state,i=e.options,n=i.gpuAcceleration,s=n===void 0?!0:n,r=i.adaptive,a=r===void 0?!0:r,c=i.roundOffsets,y=c===void 0?!0:c,w={placement:Gt(t.placement),variation:ji(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ql(Object.assign({},w,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:y})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ql(Object.assign({},w,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:y})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Yy={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ky,data:{}};var ir={passive:!0};function Xy(e){var t=e.state,i=e.instance,n=e.options,s=n.scroll,r=s===void 0?!0:s,a=n.resize,c=a===void 0?!0:a,y=St(t.elements.popper),w=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&w.forEach(function(f){f.addEventListener("scroll",i.update,ir)}),c&&y.addEventListener("resize",i.update,ir),function(){r&&w.forEach(function(f){f.removeEventListener("scroll",i.update,ir)}),c&&y.removeEventListener("resize",i.update,ir)}}const Zy={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Xy,data:{}};var Jy={left:"right",right:"left",bottom:"top",top:"bottom"};function nr(e){return e.replace(/left|right|bottom|top/g,function(t){return Jy[t]})}var ev={start:"end",end:"start"};function Hl(e){return e.replace(/start|end/g,function(t){return ev[t]})}function ba(e){var t=St(e),i=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:i,scrollTop:n}}function Ea(e){return Gi(ui(e)).left+ba(e).scrollLeft}function tv(e,t){var i=St(e),n=ui(e),s=i.visualViewport,r=n.clientWidth,a=n.clientHeight,c=0,y=0;if(s){r=s.width,a=s.height;var w=$l();(w||!w&&t==="fixed")&&(c=s.offsetLeft,y=s.offsetTop)}return{width:r,height:a,x:c+Ea(e),y}}function iv(e){var t,i=ui(e),n=ba(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=_i(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=_i(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),c=-n.scrollLeft+Ea(e),y=-n.scrollTop;return ti(s||i).direction==="rtl"&&(c+=_i(i.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:c,y}}function Sa(e){var t=ti(e),i=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Fl(e){return["html","body","#document"].indexOf(Ut(e))>=0?e.ownerDocument.body:$t(e)&&Sa(e)?e:Fl(tr(e))}function Pn(e,t){var i;t===void 0&&(t=[]);var n=Fl(e),s=n===((i=e.ownerDocument)==null?void 0:i.body),r=St(n),a=s?[r].concat(r.visualViewport||[],Sa(n)?n:[]):n,c=t.concat(a);return s?c:c.concat(Pn(tr(a)))}function Ta(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function nv(e,t){var i=Gi(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function Ul(e,t,i){return t===Ol?Ta(tv(e,i)):Ci(t)?nv(t,i):Ta(iv(ui(e)))}function sv(e){var t=Pn(tr(e)),i=["absolute","fixed"].indexOf(ti(e).position)>=0,n=i&&$t(e)?$n(e):e;return Ci(n)?t.filter(function(s){return Ci(s)&&Nl(s,n)&&Ut(s)!=="body"}):[]}function rv(e,t,i,n){var s=t==="clippingParents"?sv(e):[].concat(t),r=[].concat(s,[i]),a=r[0],c=r.reduce(function(y,w){var f=Ul(e,w,n);return y.top=_i(f.top,y.top),y.right=er(f.right,y.right),y.bottom=er(f.bottom,y.bottom),y.left=_i(f.left,y.left),y},Ul(e,a,n));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function Gl(e){var t=e.reference,i=e.element,n=e.placement,s=n?Gt(n):null,r=n?ji(n):null,a=t.x+t.width/2-i.width/2,c=t.y+t.height/2-i.height/2,y;switch(s){case vt:y={x:a,y:t.y-i.height};break;case Rt:y={x:a,y:t.y+t.height};break;case Mt:y={x:t.x+t.width,y:c};break;case wt:y={x:t.x-i.width,y:c};break;default:y={x:t.x,y:t.y}}var w=s?wa(s):null;if(w!=null){var f=w==="y"?"height":"width";switch(r){case Fi:y[w]=y[w]-(t[f]/2-i[f]/2);break;case Rn:y[w]=y[w]+(t[f]/2-i[f]/2);break}}return y}function qn(e,t){t===void 0&&(t={});var i=t,n=i.placement,s=n===void 0?e.placement:n,r=i.strategy,a=r===void 0?e.strategy:r,c=i.boundary,y=c===void 0?xy:c,w=i.rootBoundary,f=w===void 0?Ol:w,g=i.elementContext,p=g===void 0?Mn:g,d=i.altBoundary,S=d===void 0?!1:d,b=i.padding,_=b===void 0?0:b,E=Bl(typeof _!="number"?_:Dl(_,Ln)),m=p===Mn?Iy:Mn,A=e.rects.popper,u=e.elements[S?m:p],O=rv(Ci(u)?u:u.contextElement||ui(e.elements.popper),y,f,a),P=Gi(e.elements.reference),q=Gl({reference:P,element:A,strategy:"absolute",placement:s}),v=Ta(Object.assign({},A,q)),V=p===Mn?v:P,C={top:O.top-V.top+E.top,bottom:V.bottom-O.bottom+E.bottom,left:O.left-V.left+E.left,right:V.right-O.right+E.right},x=e.modifiersData.offset;if(p===Mn&&x){var I=x[s];Object.keys(C).forEach(function(k){var N=[Mt,Rt].indexOf(k)>=0?1:-1,M=[vt,Rt].indexOf(k)>=0?"y":"x";C[k]+=I[M]*N})}return C}function av(e,t){t===void 0&&(t={});var i=t,n=i.placement,s=i.boundary,r=i.rootBoundary,a=i.padding,c=i.flipVariations,y=i.allowedAutoPlacements,w=y===void 0?Rl:y,f=ji(n),g=f?c?Ll:Ll.filter(function(S){return ji(S)===f}):Ln,p=g.filter(function(S){return w.indexOf(S)>=0});p.length===0&&(p=g);var d=p.reduce(function(S,b){return S[b]=qn(e,{placement:b,boundary:s,rootBoundary:r,padding:a})[Gt(b)],S},{});return Object.keys(d).sort(function(S,b){return d[S]-d[b]})}function ov(e){if(Gt(e)===ma)return[];var t=nr(e);return[Hl(e),t,Hl(t)]}function lv(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=i.mainAxis,r=s===void 0?!0:s,a=i.altAxis,c=a===void 0?!0:a,y=i.fallbackPlacements,w=i.padding,f=i.boundary,g=i.rootBoundary,p=i.altBoundary,d=i.flipVariations,S=d===void 0?!0:d,b=i.allowedAutoPlacements,_=t.options.placement,E=Gt(_),m=E===_,A=y||(m||!S?[nr(_)]:ov(_)),u=[_].concat(A).reduce(function(X,K){return X.concat(Gt(K)===ma?av(t,{placement:K,boundary:f,rootBoundary:g,padding:w,flipVariations:S,allowedAutoPlacements:b}):K)},[]),O=t.rects.reference,P=t.rects.popper,q=new Map,v=!0,V=u[0],C=0;C<u.length;C++){var x=u[C],I=Gt(x),k=ji(x)===Fi,N=[vt,Rt].indexOf(I)>=0,M=N?"width":"height",D=qn(t,{placement:x,boundary:f,rootBoundary:g,altBoundary:p,padding:w}),Q=N?k?Mt:wt:k?Rt:vt;O[M]>P[M]&&(Q=nr(Q));var H=nr(Q),j=[];if(r&&j.push(D[I]<=0),c&&j.push(D[Q]<=0,D[H]<=0),j.every(function(X){return X})){V=x,v=!1;break}q.set(x,j)}if(v)for(var G=S?3:1,B=function(K){var F=u.find(function(Y){var Z=q.get(Y);if(Z)return Z.slice(0,K).every(function(J){return J})});if(F)return V=F,"break"},U=G;U>0;U--){var L=B(U);if(L==="break")break}t.placement!==V&&(t.modifiersData[n]._skip=!0,t.placement=V,t.reset=!0)}}const uv={name:"flip",enabled:!0,phase:"main",fn:lv,requiresIfExists:["offset"],data:{_skip:!1}};function jl(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Wl(e){return[vt,Mt,Rt,wt].some(function(t){return e[t]>=0})}function cv(e){var t=e.state,i=e.name,n=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,a=qn(t,{elementContext:"reference"}),c=qn(t,{altBoundary:!0}),y=jl(a,n),w=jl(c,s,r),f=Wl(y),g=Wl(w);t.modifiersData[i]={referenceClippingOffsets:y,popperEscapeOffsets:w,isReferenceHidden:f,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":g})}const hv={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:cv};function dv(e,t,i){var n=Gt(e),s=[wt,vt].indexOf(n)>=0?-1:1,r=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,a=r[0],c=r[1];return a=a||0,c=(c||0)*s,[wt,Mt].indexOf(n)>=0?{x:c,y:a}:{x:a,y:c}}function fv(e){var t=e.state,i=e.options,n=e.name,s=i.offset,r=s===void 0?[0,0]:s,a=Rl.reduce(function(f,g){return f[g]=dv(g,t.rects,r),f},{}),c=a[t.placement],y=c.x,w=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=y,t.modifiersData.popperOffsets.y+=w),t.modifiersData[n]=a}const pv={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:fv};function mv(e){var t=e.state,i=e.name;t.modifiersData[i]=Gl({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const gv={name:"popperOffsets",enabled:!0,phase:"read",fn:mv,data:{}};function yv(e){return e==="x"?"y":"x"}function vv(e){var t=e.state,i=e.options,n=e.name,s=i.mainAxis,r=s===void 0?!0:s,a=i.altAxis,c=a===void 0?!1:a,y=i.boundary,w=i.rootBoundary,f=i.altBoundary,g=i.padding,p=i.tether,d=p===void 0?!0:p,S=i.tetherOffset,b=S===void 0?0:S,_=qn(t,{boundary:y,rootBoundary:w,padding:g,altBoundary:f}),E=Gt(t.placement),m=ji(t.placement),A=!m,u=wa(E),O=yv(u),P=t.modifiersData.popperOffsets,q=t.rects.reference,v=t.rects.popper,V=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,C=typeof V=="number"?{mainAxis:V,altAxis:V}:Object.assign({mainAxis:0,altAxis:0},V),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(P){if(r){var k,N=u==="y"?vt:wt,M=u==="y"?Rt:Mt,D=u==="y"?"height":"width",Q=P[u],H=Q+_[N],j=Q-_[M],G=d?-v[D]/2:0,B=m===Fi?q[D]:v[D],U=m===Fi?-v[D]:-q[D],L=t.elements.arrow,X=d&&L?va(L):{width:0,height:0},K=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ql(),F=K[N],Y=K[M],Z=Nn(0,q[D],X[D]),J=A?q[D]/2-G-Z-F-C.mainAxis:B-Z-F-C.mainAxis,le=A?-q[D]/2+G+Z+Y+C.mainAxis:U+Z+Y+C.mainAxis,de=t.elements.arrow&&$n(t.elements.arrow),Se=de?u==="y"?de.clientTop||0:de.clientLeft||0:0,ve=(k=x==null?void 0:x[u])!=null?k:0,Ee=Q+J-ve-Se,be=Q+le-ve,Ge=Nn(d?er(H,Ee):H,Q,d?_i(j,be):j);P[u]=Ge,I[u]=Ge-Q}if(c){var Le,ne=u==="x"?vt:wt,ie=u==="x"?Rt:Mt,ue=P[O],fe=O==="y"?"height":"width",he=ue+_[ne],Ce=ue-_[ie],Ie=[vt,wt].indexOf(E)!==-1,Ve=(Le=x==null?void 0:x[O])!=null?Le:0,Ye=Ie?he:ue-q[fe]-v[fe]-Ve+C.altAxis,nt=Ie?ue+q[fe]+v[fe]-Ve-C.altAxis:Ce,Re=d&&Ie?Hy(Ye,ue,nt):Nn(d?Ye:he,ue,d?nt:Ce);P[O]=Re,I[O]=Re-ue}t.modifiersData[n]=I}}const wv={name:"preventOverflow",enabled:!0,phase:"main",fn:vv,requiresIfExists:["offset"]};function bv(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ev(e){return e===St(e)||!$t(e)?ba(e):bv(e)}function Sv(e){var t=e.getBoundingClientRect(),i=Ui(t.width)/e.offsetWidth||1,n=Ui(t.height)/e.offsetHeight||1;return i!==1||n!==1}function Tv(e,t,i){i===void 0&&(i=!1);var n=$t(t),s=$t(t)&&Sv(t),r=ui(t),a=Gi(e,s,i),c={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(n||!n&&!i)&&((Ut(t)!=="body"||Sa(r))&&(c=Ev(t)),$t(t)?(y=Gi(t,!0),y.x+=t.clientLeft,y.y+=t.clientTop):r&&(y.x=Ea(r))),{x:a.left+c.scrollLeft-y.x,y:a.top+c.scrollTop-y.y,width:a.width,height:a.height}}function Cv(e){var t=new Map,i=new Set,n=[];e.forEach(function(r){t.set(r.name,r)});function s(r){i.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(c){if(!i.has(c)){var y=t.get(c);y&&s(y)}}),n.push(r)}return e.forEach(function(r){i.has(r.name)||s(r)}),n}function _v(e){var t=Cv(e);return Py.reduce(function(i,n){return i.concat(t.filter(function(s){return s.phase===n}))},[])}function xv(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function Iv(e){var t=e.reduce(function(i,n){var s=i[n.name];return i[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,i},{});return Object.keys(t).map(function(i){return t[i]})}var zl={placement:"bottom",modifiers:[],strategy:"absolute"};function Kl(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function Vv(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,n=i===void 0?[]:i,s=t.defaultOptions,r=s===void 0?zl:s;return function(c,y,w){w===void 0&&(w=r);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},zl,r),modifiersData:{},elements:{reference:c,popper:y},attributes:{},styles:{}},g=[],p=!1,d={state:f,setOptions:function(E){var m=typeof E=="function"?E(f.options):E;b(),f.options=Object.assign({},r,f.options,m),f.scrollParents={reference:Ci(c)?Pn(c):c.contextElement?Pn(c.contextElement):[],popper:Pn(y)};var A=_v(Iv([].concat(n,f.options.modifiers)));return f.orderedModifiers=A.filter(function(u){return u.enabled}),S(),d.update()},forceUpdate:function(){if(!p){var E=f.elements,m=E.reference,A=E.popper;if(Kl(m,A)){f.rects={reference:Tv(m,$n(A),f.options.strategy==="fixed"),popper:va(A)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(C){return f.modifiersData[C.name]=Object.assign({},C.data)});for(var u=0;u<f.orderedModifiers.length;u++){if(f.reset===!0){f.reset=!1,u=-1;continue}var O=f.orderedModifiers[u],P=O.fn,q=O.options,v=q===void 0?{}:q,V=O.name;typeof P=="function"&&(f=P({state:f,options:v,name:V,instance:d})||f)}}}},update:xv(function(){return new Promise(function(_){d.forceUpdate(),_(f)})}),destroy:function(){b(),p=!0}};if(!Kl(c,y))return d;d.setOptions(w).then(function(_){!p&&w.onFirstUpdate&&w.onFirstUpdate(_)});function S(){f.orderedModifiers.forEach(function(_){var E=_.name,m=_.options,A=m===void 0?{}:m,u=_.effect;if(typeof u=="function"){var O=u({state:f,name:E,instance:d,options:A}),P=function(){};g.push(O||P)}})}function b(){g.forEach(function(_){return _()}),g=[]}return d}}var Av=[Zy,gv,Yy,Ml,pv,uv,wv,jy,hv],kv=Vv({defaultModifiers:Av}),Ov="tippy-box",Yl="tippy-content",Lv="tippy-backdrop",Xl="tippy-arrow",Zl="tippy-svg-arrow",xi={passive:!0,capture:!0},Jl=function(){return document.body};function Rv(e,t){return{}.hasOwnProperty.call(e,t)}function Ca(e,t,i){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(i)?i[t]:i)}return e}function _a(e,t){var i={}.toString.call(e);return i.indexOf("[object")===0&&i.indexOf(t+"]")>-1}function eu(e,t){return typeof e=="function"?e.apply(void 0,t):e}function tu(e,t){if(t===0)return e;var i;return function(n){clearTimeout(i),i=setTimeout(function(){e(n)},t)}}function Mv(e,t){var i=Object.assign({},e);return t.forEach(function(n){delete i[n]}),i}function $v(e){return e.split(/\s+/).filter(Boolean)}function Wi(e){return[].concat(e)}function iu(e,t){e.indexOf(t)===-1&&e.push(t)}function Nv(e){return e.filter(function(t,i){return e.indexOf(t)===i})}function Pv(e){return e.split("-")[0]}function sr(e){return[].slice.call(e)}function nu(e){return Object.keys(e).reduce(function(t,i){return e[i]!==void 0&&(t[i]=e[i]),t},{})}function Bn(){return document.createElement("div")}function Dn(e){return["Element","Fragment"].some(function(t){return _a(e,t)})}function qv(e){return _a(e,"NodeList")}function Bv(e){return _a(e,"MouseEvent")}function Dv(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Qv(e){return Dn(e)?[e]:qv(e)?sr(e):Array.isArray(e)?e:sr(document.querySelectorAll(e))}function xa(e,t){e.forEach(function(i){i&&(i.style.transitionDuration=t+"ms")})}function su(e,t){e.forEach(function(i){i&&i.setAttribute("data-state",t)})}function Hv(e){var t,i=Wi(e),n=i[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function Fv(e,t){var i=t.clientX,n=t.clientY;return e.every(function(s){var r=s.popperRect,a=s.popperState,c=s.props,y=c.interactiveBorder,w=Pv(a.placement),f=a.modifiersData.offset;if(!f)return!0;var g=w==="bottom"?f.top.y:0,p=w==="top"?f.bottom.y:0,d=w==="right"?f.left.x:0,S=w==="left"?f.right.x:0,b=r.top-n+g>y,_=n-r.bottom-p>y,E=r.left-i+d>y,m=i-r.right-S>y;return b||_||E||m})}function Ia(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(s){e[n](s,i)})}function ru(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=i.getRootNode==null||(n=i.getRootNode())==null?void 0:n.host}return!1}var jt={isTouch:!1},au=0;function Uv(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",ou))}function ou(){var e=performance.now();e-au<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",ou)),au=e}function Gv(){var e=document.activeElement;if(Dv(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function jv(){document.addEventListener("touchstart",Uv,xi),window.addEventListener("blur",Gv)}var Wv=typeof window<"u"&&typeof document<"u",zv=Wv?!!window.msCrypto:!1;function zi(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function lu(e){var t=/[ \t]{2,}/g,i=/^[ \t]*/gm;return e.replace(t," ").replace(i,"").trim()}function Kv(e){return lu(`
90
+ %ctippy.js
91
+
92
+ %c`+lu(e)+`
93
+
94
+ %c👷‍ This is a development-only message. It will be removed in production.
95
+ `)}function uu(e){return[Kv(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Qn;process.env.NODE_ENV!=="production"&&Yv();function Yv(){Qn=new Set}function ii(e,t){if(e&&!Qn.has(t)){var i;Qn.add(t),(i=console).warn.apply(i,uu(t))}}function Va(e,t){if(e&&!Qn.has(t)){var i;Qn.add(t),(i=console).error.apply(i,uu(t))}}function Xv(e){var t=!e,i=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;Va(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Va(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var cu={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Zv={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Tt=Object.assign({appendTo:Jl,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},cu,Zv),Jv=Object.keys(Tt),ew=function(t){process.env.NODE_ENV!=="production"&&fu(t,[]);var i=Object.keys(t);i.forEach(function(n){Tt[n]=t[n]})};function hu(e){var t=e.plugins||[],i=t.reduce(function(n,s){var r=s.name,a=s.defaultValue;if(r){var c;n[r]=e[r]!==void 0?e[r]:(c=Tt[r])!=null?c:a}return n},{});return Object.assign({},e,i)}function tw(e,t){var i=t?Object.keys(hu(Object.assign({},Tt,{plugins:t}))):Jv,n=i.reduce(function(s,r){var a=(e.getAttribute("data-tippy-"+r)||"").trim();if(!a)return s;if(r==="content")s[r]=a;else try{s[r]=JSON.parse(a)}catch{s[r]=a}return s},{});return n}function du(e,t){var i=Object.assign({},t,{content:eu(t.content,[e])},t.ignoreAttributes?{}:tw(e,t.plugins));return i.aria=Object.assign({},Tt.aria,i.aria),i.aria={expanded:i.aria.expanded==="auto"?t.interactive:i.aria.expanded,content:i.aria.content==="auto"?t.interactive?null:"describedby":i.aria.content},i}function fu(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var i=Object.keys(e);i.forEach(function(n){var s=Mv(Tt,Object.keys(cu)),r=!Rv(s,n);r&&(r=t.filter(function(a){return a.name===n}).length===0),ii(r,["`"+n+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
96
+
97
+ `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
98
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var iw=function(){return"innerHTML"};function Aa(e,t){e[iw()]=t}function pu(e){var t=Bn();return e===!0?t.className=Xl:(t.className=Zl,Dn(e)?t.appendChild(e):Aa(t,e)),t}function mu(e,t){Dn(t.content)?(Aa(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Aa(e,t.content):e.textContent=t.content)}function ka(e){var t=e.firstElementChild,i=sr(t.children);return{box:t,content:i.find(function(n){return n.classList.contains(Yl)}),arrow:i.find(function(n){return n.classList.contains(Xl)||n.classList.contains(Zl)}),backdrop:i.find(function(n){return n.classList.contains(Lv)})}}function gu(e){var t=Bn(),i=Bn();i.className=Ov,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=Bn();n.className=Yl,n.setAttribute("data-state","hidden"),mu(n,e.props),t.appendChild(i),i.appendChild(n),s(e.props,e.props);function s(r,a){var c=ka(t),y=c.box,w=c.content,f=c.arrow;a.theme?y.setAttribute("data-theme",a.theme):y.removeAttribute("data-theme"),typeof a.animation=="string"?y.setAttribute("data-animation",a.animation):y.removeAttribute("data-animation"),a.inertia?y.setAttribute("data-inertia",""):y.removeAttribute("data-inertia"),y.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?y.setAttribute("role",a.role):y.removeAttribute("role"),(r.content!==a.content||r.allowHTML!==a.allowHTML)&&mu(w,e.props),a.arrow?f?r.arrow!==a.arrow&&(y.removeChild(f),y.appendChild(pu(a.arrow))):y.appendChild(pu(a.arrow)):f&&y.removeChild(f)}return{popper:t,onUpdate:s}}gu.$$tippy=!0;var nw=1,rr=[],Oa=[];function sw(e,t){var i=du(e,Object.assign({},Tt,hu(nu(t)))),n,s,r,a=!1,c=!1,y=!1,w=!1,f,g,p,d=[],S=tu(Ee,i.interactiveDebounce),b,_=nw++,E=null,m=Nv(i.plugins),A={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},u={id:_,reference:e,popper:Bn(),popperInstance:E,props:i,state:A,plugins:m,clearDelayTimeouts:Ye,setProps:nt,setContent:Re,show:Yt,hide:He,hideWithInteractivity:Pt,enable:Ie,disable:Ve,unmount:mi,destroy:$i};if(!i.render)return process.env.NODE_ENV!=="production"&&Va(!0,"render() function has not been supplied."),u;var O=i.render(u),P=O.popper,q=O.onUpdate;P.setAttribute("data-tippy-root",""),P.id="tippy-"+u.id,u.popper=P,e._tippy=u,P._tippy=u;var v=m.map(function(oe){return oe.fn(u)}),V=e.hasAttribute("aria-expanded");return de(),G(),Q(),H("onCreate",[u]),i.showOnCreate&&he(),P.addEventListener("mouseenter",function(){u.props.interactive&&u.state.isVisible&&u.clearDelayTimeouts()}),P.addEventListener("mouseleave",function(){u.props.interactive&&u.props.trigger.indexOf("mouseenter")>=0&&N().addEventListener("mousemove",S)}),u;function C(){var oe=u.props.touch;return Array.isArray(oe)?oe:[oe,0]}function x(){return C()[0]==="hold"}function I(){var oe;return!!((oe=u.props.render)!=null&&oe.$$tippy)}function k(){return b||e}function N(){var oe=k().parentNode;return oe?Hv(oe):document}function M(){return ka(P)}function D(oe){return u.state.isMounted&&!u.state.isVisible||jt.isTouch||f&&f.type==="focus"?0:Ca(u.props.delay,oe?0:1,Tt.delay)}function Q(oe){oe===void 0&&(oe=!1),P.style.pointerEvents=u.props.interactive&&!oe?"":"none",P.style.zIndex=""+u.props.zIndex}function H(oe,we,Te){if(Te===void 0&&(Te=!0),v.forEach(function(Ne){Ne[oe]&&Ne[oe].apply(Ne,we)}),Te){var De;(De=u.props)[oe].apply(De,we)}}function j(){var oe=u.props.aria;if(oe.content){var we="aria-"+oe.content,Te=P.id,De=Wi(u.props.triggerTarget||e);De.forEach(function(Ne){var st=Ne.getAttribute(we);if(u.state.isVisible)Ne.setAttribute(we,st?st+" "+Te:Te);else{var lt=st&&st.replace(Te,"").trim();lt?Ne.setAttribute(we,lt):Ne.removeAttribute(we)}})}}function G(){if(!(V||!u.props.aria.expanded)){var oe=Wi(u.props.triggerTarget||e);oe.forEach(function(we){u.props.interactive?we.setAttribute("aria-expanded",u.state.isVisible&&we===k()?"true":"false"):we.removeAttribute("aria-expanded")})}}function B(){N().removeEventListener("mousemove",S),rr=rr.filter(function(oe){return oe!==S})}function U(oe){if(!(jt.isTouch&&(y||oe.type==="mousedown"))){var we=oe.composedPath&&oe.composedPath()[0]||oe.target;if(!(u.props.interactive&&ru(P,we))){if(Wi(u.props.triggerTarget||e).some(function(Te){return ru(Te,we)})){if(jt.isTouch||u.state.isVisible&&u.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[u,oe]);u.props.hideOnClick===!0&&(u.clearDelayTimeouts(),u.hide(),c=!0,setTimeout(function(){c=!1}),u.state.isMounted||F())}}}function L(){y=!0}function X(){y=!1}function K(){var oe=N();oe.addEventListener("mousedown",U,!0),oe.addEventListener("touchend",U,xi),oe.addEventListener("touchstart",X,xi),oe.addEventListener("touchmove",L,xi)}function F(){var oe=N();oe.removeEventListener("mousedown",U,!0),oe.removeEventListener("touchend",U,xi),oe.removeEventListener("touchstart",X,xi),oe.removeEventListener("touchmove",L,xi)}function Y(oe,we){J(oe,function(){!u.state.isVisible&&P.parentNode&&P.parentNode.contains(P)&&we()})}function Z(oe,we){J(oe,we)}function J(oe,we){var Te=M().box;function De(Ne){Ne.target===Te&&(Ia(Te,"remove",De),we())}if(oe===0)return we();Ia(Te,"remove",g),Ia(Te,"add",De),g=De}function le(oe,we,Te){Te===void 0&&(Te=!1);var De=Wi(u.props.triggerTarget||e);De.forEach(function(Ne){Ne.addEventListener(oe,we,Te),d.push({node:Ne,eventType:oe,handler:we,options:Te})})}function de(){x()&&(le("touchstart",ve,{passive:!0}),le("touchend",be,{passive:!0})),$v(u.props.trigger).forEach(function(oe){if(oe!=="manual")switch(le(oe,ve),oe){case"mouseenter":le("mouseleave",be);break;case"focus":le(zv?"focusout":"blur",Ge);break;case"focusin":le("focusout",Ge);break}})}function Se(){d.forEach(function(oe){var we=oe.node,Te=oe.eventType,De=oe.handler,Ne=oe.options;we.removeEventListener(Te,De,Ne)}),d=[]}function ve(oe){var we,Te=!1;if(!(!u.state.isEnabled||Le(oe)||c)){var De=((we=f)==null?void 0:we.type)==="focus";f=oe,b=oe.currentTarget,G(),!u.state.isVisible&&Bv(oe)&&rr.forEach(function(Ne){return Ne(oe)}),oe.type==="click"&&(u.props.trigger.indexOf("mouseenter")<0||a)&&u.props.hideOnClick!==!1&&u.state.isVisible?Te=!0:he(oe),oe.type==="click"&&(a=!Te),Te&&!De&&Ce(oe)}}function Ee(oe){var we=oe.target,Te=k().contains(we)||P.contains(we);if(!(oe.type==="mousemove"&&Te)){var De=fe().concat(P).map(function(Ne){var st,lt=Ne._tippy,gi=(st=lt.popperInstance)==null?void 0:st.state;return gi?{popperRect:Ne.getBoundingClientRect(),popperState:gi,props:i}:null}).filter(Boolean);Fv(De,oe)&&(B(),Ce(oe))}}function be(oe){var we=Le(oe)||u.props.trigger.indexOf("click")>=0&&a;if(!we){if(u.props.interactive){u.hideWithInteractivity(oe);return}Ce(oe)}}function Ge(oe){u.props.trigger.indexOf("focusin")<0&&oe.target!==k()||u.props.interactive&&oe.relatedTarget&&P.contains(oe.relatedTarget)||Ce(oe)}function Le(oe){return jt.isTouch?x()!==oe.type.indexOf("touch")>=0:!1}function ne(){ie();var oe=u.props,we=oe.popperOptions,Te=oe.placement,De=oe.offset,Ne=oe.getReferenceClientRect,st=oe.moveTransition,lt=I()?ka(P).arrow:null,gi=Ne?{getBoundingClientRect:Ne,contextElement:Ne.contextElement||k()}:e,ft={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ct){var Ft=ct.state;if(I()){var Nr=M(),wn=Nr.box;["placement","reference-hidden","escaped"].forEach(function(Me){Me==="placement"?wn.setAttribute("data-placement",Ft.placement):Ft.attributes.popper["data-popper-"+Me]?wn.setAttribute("data-"+Me,""):wn.removeAttribute("data-"+Me)}),Ft.attributes.popper={}}}},ut=[{name:"offset",options:{offset:De}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!st}},ft];I()&&lt&&ut.push({name:"arrow",options:{element:lt,padding:3}}),ut.push.apply(ut,(we==null?void 0:we.modifiers)||[]),u.popperInstance=kv(gi,P,Object.assign({},we,{placement:Te,onFirstUpdate:p,modifiers:ut}))}function ie(){u.popperInstance&&(u.popperInstance.destroy(),u.popperInstance=null)}function ue(){var oe=u.props.appendTo,we,Te=k();u.props.interactive&&oe===Jl||oe==="parent"?we=Te.parentNode:we=eu(oe,[Te]),we.contains(P)||we.appendChild(P),u.state.isMounted=!0,ne(),process.env.NODE_ENV!=="production"&&ii(u.props.interactive&&oe===Tt.appendTo&&Te.nextElementSibling!==P,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
99
+
100
+ `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
101
+
102
+ `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
103
+
104
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function fe(){return sr(P.querySelectorAll("[data-tippy-root]"))}function he(oe){u.clearDelayTimeouts(),oe&&H("onTrigger",[u,oe]),K();var we=D(!0),Te=C(),De=Te[0],Ne=Te[1];jt.isTouch&&De==="hold"&&Ne&&(we=Ne),we?n=setTimeout(function(){u.show()},we):u.show()}function Ce(oe){if(u.clearDelayTimeouts(),H("onUntrigger",[u,oe]),!u.state.isVisible){F();return}if(!(u.props.trigger.indexOf("mouseenter")>=0&&u.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(oe.type)>=0&&a)){var we=D(!1);we?s=setTimeout(function(){u.state.isVisible&&u.hide()},we):r=requestAnimationFrame(function(){u.hide()})}}function Ie(){u.state.isEnabled=!0}function Ve(){u.hide(),u.state.isEnabled=!1}function Ye(){clearTimeout(n),clearTimeout(s),cancelAnimationFrame(r)}function nt(oe){if(process.env.NODE_ENV!=="production"&&ii(u.state.isDestroyed,zi("setProps")),!u.state.isDestroyed){H("onBeforeUpdate",[u,oe]),Se();var we=u.props,Te=du(e,Object.assign({},we,nu(oe),{ignoreAttributes:!0}));u.props=Te,de(),we.interactiveDebounce!==Te.interactiveDebounce&&(B(),S=tu(Ee,Te.interactiveDebounce)),we.triggerTarget&&!Te.triggerTarget?Wi(we.triggerTarget).forEach(function(De){De.removeAttribute("aria-expanded")}):Te.triggerTarget&&e.removeAttribute("aria-expanded"),G(),Q(),q&&q(we,Te),u.popperInstance&&(ne(),fe().forEach(function(De){requestAnimationFrame(De._tippy.popperInstance.forceUpdate)})),H("onAfterUpdate",[u,oe])}}function Re(oe){u.setProps({content:oe})}function Yt(){process.env.NODE_ENV!=="production"&&ii(u.state.isDestroyed,zi("show"));var oe=u.state.isVisible,we=u.state.isDestroyed,Te=!u.state.isEnabled,De=jt.isTouch&&!u.props.touch,Ne=Ca(u.props.duration,0,Tt.duration);if(!(oe||we||Te||De)&&!k().hasAttribute("disabled")&&(H("onShow",[u],!1),u.props.onShow(u)!==!1)){if(u.state.isVisible=!0,I()&&(P.style.visibility="visible"),Q(),K(),u.state.isMounted||(P.style.transition="none"),I()){var st=M(),lt=st.box,gi=st.content;xa([lt,gi],0)}p=function(){var ut;if(!(!u.state.isVisible||w)){if(w=!0,P.offsetHeight,P.style.transition=u.props.moveTransition,I()&&u.props.animation){var _s=M(),ct=_s.box,Ft=_s.content;xa([ct,Ft],Ne),su([ct,Ft],"visible")}j(),G(),iu(Oa,u),(ut=u.popperInstance)==null||ut.forceUpdate(),H("onMount",[u]),u.props.animation&&I()&&Z(Ne,function(){u.state.isShown=!0,H("onShown",[u])})}},ue()}}function He(){process.env.NODE_ENV!=="production"&&ii(u.state.isDestroyed,zi("hide"));var oe=!u.state.isVisible,we=u.state.isDestroyed,Te=!u.state.isEnabled,De=Ca(u.props.duration,1,Tt.duration);if(!(oe||we||Te)&&(H("onHide",[u],!1),u.props.onHide(u)!==!1)){if(u.state.isVisible=!1,u.state.isShown=!1,w=!1,a=!1,I()&&(P.style.visibility="hidden"),B(),F(),Q(!0),I()){var Ne=M(),st=Ne.box,lt=Ne.content;u.props.animation&&(xa([st,lt],De),su([st,lt],"hidden"))}j(),G(),u.props.animation?I()&&Y(De,u.unmount):u.unmount()}}function Pt(oe){process.env.NODE_ENV!=="production"&&ii(u.state.isDestroyed,zi("hideWithInteractivity")),N().addEventListener("mousemove",S),iu(rr,S),S(oe)}function mi(){process.env.NODE_ENV!=="production"&&ii(u.state.isDestroyed,zi("unmount")),u.state.isVisible&&u.hide(),u.state.isMounted&&(ie(),fe().forEach(function(oe){oe._tippy.unmount()}),P.parentNode&&P.parentNode.removeChild(P),Oa=Oa.filter(function(oe){return oe!==u}),u.state.isMounted=!1,H("onHidden",[u]))}function $i(){process.env.NODE_ENV!=="production"&&ii(u.state.isDestroyed,zi("destroy")),!u.state.isDestroyed&&(u.clearDelayTimeouts(),u.unmount(),Se(),delete e._tippy,u.state.isDestroyed=!0,H("onDestroy",[u]))}}function Hn(e,t){t===void 0&&(t={});var i=Tt.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(Xv(e),fu(t,i)),jv();var n=Object.assign({},t,{plugins:i}),s=Qv(e);if(process.env.NODE_ENV!=="production"){var r=Dn(n.content),a=s.length>1;ii(r&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
105
+
106
+ `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
107
+
108
+ `,`1) content: element.innerHTML
109
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var c=s.reduce(function(y,w){var f=w&&sw(w,n);return f&&y.push(f),y},[]);return Dn(e)?c[0]:c}Hn.defaultProps=Tt,Hn.setDefaultProps=ew,Hn.currentInput=jt,Object.assign({},Ml,{effect:function(t){var i=t.state,n={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(i.elements.popper.style,n.popper),i.styles=n,i.elements.arrow&&Object.assign(i.elements.arrow.style,n.arrow)}}),Hn.setDefaultProps({render:gu});const rw={name:"Tooltip",props:{target:{required:!0,type:Function},message:{required:!1,type:String,default:""},colorStyle:{required:!1,type:String,default:""},placement:{required:!1,type:String,default:"top"}},computed:{tooltipStyle(){return this.colorStyle+" __tooltipMessage"}},data(){return{targetElement:null,tippy:null,zIndex:101}},methods:{hide(){this.tippy.hide()},show(){this.tippy.show()}},mounted(){this.targetElement=this.target(),this.tippy=Hn(this.targetElement,{content:this.$refs.template.innerHTML,allowHTML:!0,trigger:"manual",theme:this.colorStyle,placement:this.placement,zIndex:101})},beforeDestroy(){this.tippy!==null&&this.tippy.destroy()}},aw={ref:"template",style:{display:"none"}};function ow(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",aw,[l.createElementVNode("span",{class:l.normalizeClass(r.tooltipStyle)},l.toDisplayString(i.message),3)],512)}const Fn=te(rw,[["render",ow]]),lw=new re,uw={name:"ExtendedTextPlainDefault",emits:["extendedTextReady","extendedTextUpdate"],components:{Tooltip:Fn},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},counterStyle:{required:!1,type:String,default:"none"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return W.getItemContextPnp().getColorStyle()},maxLength(){return 1e4},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"},disabled(){return this.isDisabled}},data(){return{response:"",priorResponse:"",appliedRegex:null,displayMessage:!1,counter:0,isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e){if(e===null){this.response="",this.updateCounter(0);return}this.response=e,this.updateCounter(this.response.length)},getState(){return this.state},setState(e){this.state=e},setIsDisabled(e){this.isDisabled=e,e?(this.$refs.label.innerHTML=this.replaceNewLines(this.getResponse()),this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.textarea.classList.add("qti-hidden")):(this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.textarea.classList.remove("qti-hidden"))},replaceNewLines(e){return e===null?"":e.replace(/\r\n|\r|\n/g,"<br />")},handleInput(e){e.preventDefault();let t=!0;this.showCounter&&!this.applyLimitCheck(this.$refs.textarea.value)||(this.appliedRegex!==null?t=this.applyPatternMask(this.$refs.textarea.value):this.setResponse(this.$refs.textarea.value),t&&(this.priorResponse=this.$refs.textarea.value,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()})))},applyLimitCheck(e){return e.length>this.computedExpectedLength?(this.setResponse(this.priorResponse),!1):!0},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}},getLength(){return this.response.length},applyPatternMask(e){return this.appliedRegex.test(e)?(this.setResponse(e),this.priorResponse=e,!0):(this.showPatternMaskMessage(),this.setResponse(this.priorResponse),!1)},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)}},created(){this.appliedRegex=lw.validatePattern("pattern-mask",this.patternMask)},mounted(){this.$parent.$emit("extendedTextReady",{node:this})}},cw={ref:"root"},hw={ref:"label",class:"ext-text-plain-default-label qti-hidden"},dw=["placeholder","disabled"],fw={key:0,"aria-hidden":"true",class:"ext-text-plain-counter"},pw={key:0};function mw(e,t,i,n,s,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",cw,[l.createElementVNode("div",hw,null,512),l.withDirectives(l.createElementVNode("textarea",l.mergeProps({ref:"textarea",class:"ext-text-plain-default"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=c=>s.response=c),placeholder:i.placeholder,disabled:r.disabled,autocapitalize:"none",spellcheck:"false",maxlength:"maxLength",onInput:t[1]||(t[1]=(...c)=>r.handleInput&&r.handleInput(...c))}),null,16,dw),[[l.vModelText,s.response]]),r.showCounter?(l.openBlock(),l.createElementBlock("div",fw,[l.createTextVNode(l.toDisplayString(s.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",pw," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:1,ref:"tooltip",target:()=>e.$refs.textarea,message:i.patternMaskMessage,"color-style":r.colorStyle},null,8,["target","message","color-style"])):l.createCommentVNode("",!0)],512)}const gw=te(uw,[["render",mw]]),yw=new re,yu=new me,vw={name:"ExtendedTextPlainDefault",emits:["extendedTextReady","extendedTextUpdate"],components:{Tooltip:Fn},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},counterStyle:{required:!1,type:String,default:"none"},dataSpellcheck:{required:!1,type:String},dataToolbarButtons:{required:!1,type:String}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return W.getItemContextPnp().getColorStyle()},maxLength(){return 1e4},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"},computeSpellcheck(){return typeof this.dataSpellcheck<"u"?this.dataSpellcheck:!1},showCopy(){return this.isDisabled?!1:typeof this.dataToolbarButtons<"u"?this.dataToolbarButtons.includes("copy"):!1},showCut(){return this.isDisabled?!1:typeof this.dataToolbarButtons<"u"?this.dataToolbarButtons.includes("cut"):!1},showPaste(){return this.isDisabled?!1:typeof this.dataToolbarButtons<"u"?this.dataToolbarButtons.includes("paste"):!1},disabled(){return this.isDisabled}},data(){return{response:"",priorResponse:"",appliedRegex:null,displayMessage:!1,counter:0,selectedText:"",isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e){if(e===null){this.response="",this.updateCounter(0);return}this.response=e,this.updateCounter(yu.computeWordCount(this.response))},getState(){return this.state},setState(e){this.state=e},setIsDisabled(e){this.isDisabled=e},handleInput(e){e.preventDefault();const t=this.$refs.textarea.value;this.isPassedConstraints(t)&&(this.setResponse(t),this.priorResponse=t,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()}))},isPassedConstraints(e){return!(this.showCounter&&!this.applyLimitCheck(e))},applyLimitCheck(e){return yu.computeWordCount(e)>this.computedExpectedLength?(this.setResponse(this.priorResponse),!1):!0},applyPatternMask(e){return this.appliedRegex.test(e)?!0:(this.showPatternMaskMessage(),this.setResponse(this.priorResponse),!1)},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}},getLength(){return this.response.length},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)},handleCopy(){this.selectedText=this.getSelectedText()},handleCut(){this.selectedText=this.getSelectedText(),this.insertText("")},handlePaste(){this.insertText(this.selectedText)},getSelectedText(){const e=this.$refs.textarea;if(typeof e.selectionStart=="number"){const t=e.value.slice(e.selectionStart,e.selectionEnd);return e.focus(),e.setSelectionRange(e.selectionStart,e.selectionEnd),t}return""},insertText(e){this.insertTextAtCursor(e),this.setResponse(this.$refs.textarea.value),this.priorResponse=this.$refs.textarea.value,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()})},insertTextAtCursor(e){const t=this.$refs.textarea;if(t.selectionStart||t.selectionStart===0){const n=t.selectionStart,s=t.selectionEnd,r=t.scrollTop,a=t.value.substring(0,n)+e+t.value.substring(s,t.value.length);if(!this.isPassedConstraints(a))return;t.value=a,t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=r;return}const i=t.value+e;this.isPassedConstraints(i)&&(t.value=i,t.focus())}},created(){this.appliedRegex=yw.validatePattern("pattern-mask",this.patternMask)},mounted(){this.$parent.$emit("extendedTextReady",{node:this})}},ww={ref:"root"},bw={ref:"toolbar",class:"ext-text-toolbar"},Ew={key:0,"aria-hidden":"true",class:"toolbar-right"},Sw={class:"ext-text-toolbar-counter"},Tw={key:0},Cw={class:"toolbar-left"},_w=["placeholder","disabled","spellcheck"];function xw(e,t,i,n,s,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",ww,[l.createElementVNode("div",bw,[r.showCounter?(l.openBlock(),l.createElementBlock("div",Ew,[l.createElementVNode("span",Sw,[l.createTextVNode(l.toDisplayString(s.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",Tw," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0),l.createTextVNode(" Word(s) ")])])):l.createCommentVNode("",!0),l.createElementVNode("span",Cw,[r.showCopy?(l.openBlock(),l.createElementBlock("button",{key:0,onClick:t[0]||(t[0]=l.withModifiers((...c)=>r.handleCopy&&r.handleCopy(...c),["prevent"])),type:"button",class:"btn-copy",unselectable:"on"},"Copy")):l.createCommentVNode("",!0),r.showCut?(l.openBlock(),l.createElementBlock("button",{key:1,onClick:t[1]||(t[1]=l.withModifiers((...c)=>r.handleCut&&r.handleCut(...c),["prevent"])),type:"button",class:"btn-cut",unselectable:"on"},"Cut")):l.createCommentVNode("",!0),r.showPaste?(l.openBlock(),l.createElementBlock("button",{key:2,onClick:t[2]||(t[2]=l.withModifiers((...c)=>r.handlePaste&&r.handlePaste(...c),["prevent"])),type:"button",class:"btn-paste",unselectable:"on"},"Paste")):l.createCommentVNode("",!0)])],512),l.withDirectives(l.createElementVNode("textarea",l.mergeProps({ref:"textarea",class:"ext-text-plain-lrn"},e.$attrs,{"onUpdate:modelValue":t[3]||(t[3]=c=>s.response=c),placeholder:i.placeholder,disabled:r.disabled,autocapitalize:"none",spellcheck:r.computeSpellcheck,maxlength:"maxLength",onInput:t[4]||(t[4]=(...c)=>r.handleInput&&r.handleInput(...c))}),null,16,_w),[[l.vModelText,s.response]]),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:0,ref:"tooltip",target:()=>e.$refs.textarea,message:i.patternMaskMessage,"color-style":r.colorStyle},null,8,["target","message","color-style"])):l.createCommentVNode("",!0)],512)}const Iw=te(vw,[["render",xw]]),Vw=new re,Aw={name:"ExtendedTextPlainVerticalRl",emits:["extendedTextReady","extendedTextUpdate"],components:{Tooltip:Fn},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:"foo"},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},counterStyle:{required:!1,type:String,default:"none"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return W.getItemContextPnp().getColorStyle()},maxLength(){return 1e4},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"},tooltipPlacement(){return"right"},disabled(){return this.isDisabled}},data(){return{response:"",state:null,priorResponse:"",appliedRegex:null,displayMessage:!1,counter:0,caretIndex:0,maxlengthMessage:"",isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e,t=!1){e===null&&(e=""),this.response=e,t&&this.updateContent(this.response),this.updateCounter(this.response.length)},updateResponse(e){this.response=e,this.updateCounter(this.response.length)},getState(){return this.state},setState(e){this.state=e},computeState(e){return{html:e}},setIsDisabled(e){this.isDisabled=e,e?(this.$refs.label.innerHTML=this.replaceNewLines(this.getResponse()),this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.textarea.classList.add("qti-hidden")):(this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.textarea.classList.remove("qti-hidden"))},replaceNewLines(e){return e===null?"":e.replace(/\r\n|\r|\n/g,"<br>")},getContent(){return this.getTextContent(this.$refs.textarea.childNodes)},updateContent(e){this.$refs.textarea.innerHTML=e},getTextContent(e){let t,i="",n=0,s=e.nodeType;if(!s)for(;t=e[n++];)i+=this.getTextContent(t);return s===1||s===11?e.textContent:s===9?e.documentElement.textContent:s===3||s===4?e.nodeValue:i},getCaretIndex(){return this.caretIndex},setCaretIndex(e){this.caretIndex=e},handleInput(e){e.preventDefault();let t=!0;this.setCaretIndex(this.getCaretPos(this.$refs.textarea)-1);let i=this.getContent();this.showCounter&&!this.applyLimitCheck(i)||this.appliedRegex!==null&&(t=this.applyPatternMask(i),!t)||((i.length==0||i.length==1&&i.charCodeAt(0)==10)&&(this.empty(),this.updateCounter(0),i=""),this.setResponse(i),this.setState(this.computeState(this.replaceNewLines(this.$refs.textarea.innerHTML))),this.priorResponse=i,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse(),state:this.getState()}))},handlePaste(e){e.preventDefault();let t=!0,i=e.clipboardData.getData("text/plain");const n=document.getSelection().getRangeAt(0);n.deleteContents();const s=document.createTextNode(i);n.insertNode(s),n.selectNodeContents(s),n.collapse(!1);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);let a=this.getContent();this.showCounter&&!this.applyLimitCheck(a)||this.appliedRegex!==null&&(t=this.applyPatternMask(a),!t)||((a.length==0||a.length==1&&a.charCodeAt(0)==10)&&(this.empty(),this.updateCounter(0),a=""),this.setResponse(a),this.setState(this.computeState(this.replaceNewLines(this.$refs.textarea.innerHTML))),this.priorResponse=a,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse(),state:this.getState()}))},handleDrop(e){e.preventDefault()},handleKeydown(e){switch(this.setCaretIndex(this.getCaretPos(this.$refs.textarea)),e.code){case"KeyI":case"KeyB":case"KeyU":e.ctrlKey&&e.preventDefault();return}},getRange(){const e=document.getSelection();return e.rangeCount===0?null:e.getRangeAt(0)},getCaretPos(e){let t=0;if(typeof window.getSelection<"u"&&window.getSelection().rangeCount!==0){const s=window.getSelection().getRangeAt(0),r=s.cloneRange();r.selectNodeContents(e),r.setEnd(s.endContainer,s.endOffset),t=r.toString().length}return t},setCaretPos(e,t){e.focus(),e.childNodes.length===1&&document.getSelection().collapse(e.childNodes[0],t)},getLength(){return this.response.length},empty(){this.$refs.textarea.textContent=""},applyLimitCheck(e){return e.length>this.computedExpectedLength?(this.setResponse(this.priorResponse,!0),this.setCaretPos(this.$refs.textarea,this.getCaretIndex()),!1):!0},applyPatternMask(e){return this.appliedRegex.test(e)?(this.setResponse(e),this.priorResponse=e,!0):(this.showPatternMaskMessage(),this.setResponse(this.priorResponse,!0),this.setCaretPos(this.$refs.textarea,this.getCaretIndex()),!1)},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}}},created(){this.appliedRegex=Vw.validatePattern("pattern-mask",this.patternMask),this.setState(this.computeState(""))},mounted(){this.$parent.$emit("extendedTextReady",{node:this})}},kw={ref:"root"},Ow={ref:"label",class:"ext-text-default-vert-rl-label qti-hidden"},Lw=["maxlength","data-placeholder"],Rw={key:0,"aria-hidden":"true",class:"ext-text-default-vert-rl-counter"},Mw={key:0};function $w(e,t,i,n,s,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",kw,[l.createElementVNode("div",Ow,null,512),l.createElementVNode("div",l.mergeProps({ref:"textarea",class:"ext-text-default-vert-rl"},e.$attrs,{tabindex:"0",contenteditable:"true",autocapitalize:"false",spellcheck:"false",maxlength:r.maxLength,"data-placeholder":i.placeholder,onInput:t[0]||(t[0]=(...c)=>r.handleInput&&r.handleInput(...c)),onKeydown:t[1]||(t[1]=(...c)=>r.handleKeydown&&r.handleKeydown(...c)),onPaste:t[2]||(t[2]=(...c)=>r.handlePaste&&r.handlePaste(...c)),onDrop:t[3]||(t[3]=(...c)=>r.handleDrop&&r.handleDrop(...c))}),null,16,Lw),r.showCounter?(l.openBlock(),l.createElementBlock("div",Rw,[l.createTextVNode(l.toDisplayString(s.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",Mw," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:1,ref:"tooltip",target:()=>e.$refs.textarea,message:i.patternMaskMessage,"color-style":r.colorStyle,placement:r.tooltipPlacement},null,8,["target","message","color-style","placement"])):l.createCommentVNode("",!0)],512)}const Nw=te(Aw,[["render",$w]]);var vu={exports:{}};/*!
110
+ * Quill Editor v1.3.7
111
+ * https://quilljs.com/
112
+ * Copyright (c) 2014, Jason Chen
113
+ * Copyright (c) 2013, salesforce.com
114
+ */(function(e,t){(function(n,s){e.exports=s()})(typeof self<"u"?self:ei,function(){return function(i){var n={};function s(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return i[r].call(a.exports,a,a.exports,s),a.l=!0,a.exports}return s.m=i,s.c=n,s.d=function(r,a,c){s.o(r,a)||Object.defineProperty(r,a,{configurable:!1,enumerable:!0,get:c})},s.n=function(r){var a=r&&r.__esModule?function(){return r.default}:function(){return r};return s.d(a,"a",a),a},s.o=function(r,a){return Object.prototype.hasOwnProperty.call(r,a)},s.p="",s(s.s=109)}([function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(17),a=s(18),c=s(19),y=s(45),w=s(46),f=s(47),g=s(48),p=s(49),d=s(12),S=s(32),b=s(33),_=s(31),E=s(1),m={Scope:E.Scope,create:E.create,find:E.find,query:E.query,register:E.register,Container:r.default,Format:a.default,Leaf:c.default,Embed:g.default,Scroll:y.default,Block:f.default,Inline:w.default,Text:p.default,Attributor:{Attribute:d.default,Class:S.default,Style:b.default,Store:_.default}};n.default=m},function(i,n,s){var r=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,m){E.__proto__=m}||function(E,m){for(var A in m)m.hasOwnProperty(A)&&(E[A]=m[A])};return function(E,m){_(E,m);function A(){this.constructor=E}E.prototype=m===null?Object.create(m):(A.prototype=m.prototype,new A)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=function(_){r(E,_);function E(m){var A=this;return m="[Parchment] "+m,A=_.call(this,m)||this,A.message=m,A.name=A.constructor.name,A}return E}(Error);n.ParchmentError=a;var c={},y={},w={},f={};n.DATA_KEY="__blot";var g;(function(_){_[_.TYPE=3]="TYPE",_[_.LEVEL=12]="LEVEL",_[_.ATTRIBUTE=13]="ATTRIBUTE",_[_.BLOT=14]="BLOT",_[_.INLINE=7]="INLINE",_[_.BLOCK=11]="BLOCK",_[_.BLOCK_BLOT=10]="BLOCK_BLOT",_[_.INLINE_BLOT=6]="INLINE_BLOT",_[_.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",_[_.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",_[_.ANY=15]="ANY"})(g=n.Scope||(n.Scope={}));function p(_,E){var m=S(_);if(m==null)throw new a("Unable to create "+_+" blot");var A=m,u=_ instanceof Node||_.nodeType===Node.TEXT_NODE?_:A.create(E);return new A(u,E)}n.create=p;function d(_,E){return E===void 0&&(E=!1),_==null?null:_[n.DATA_KEY]!=null?_[n.DATA_KEY].blot:E?d(_.parentNode,E):null}n.find=d;function S(_,E){E===void 0&&(E=g.ANY);var m;if(typeof _=="string")m=f[_]||c[_];else if(_ instanceof Text||_.nodeType===Node.TEXT_NODE)m=f.text;else if(typeof _=="number")_&g.LEVEL&g.BLOCK?m=f.block:_&g.LEVEL&g.INLINE&&(m=f.inline);else if(_ instanceof HTMLElement){var A=(_.getAttribute("class")||"").split(/\s+/);for(var u in A)if(m=y[A[u]],m)break;m=m||w[_.tagName]}return m==null?null:E&g.LEVEL&m.scope&&E&g.TYPE&m.scope?m:null}n.query=S;function b(){for(var _=[],E=0;E<arguments.length;E++)_[E]=arguments[E];if(_.length>1)return _.map(function(u){return b(u)});var m=_[0];if(typeof m.blotName!="string"&&typeof m.attrName!="string")throw new a("Invalid definition");if(m.blotName==="abstract")throw new a("Cannot register abstract class");if(f[m.blotName||m.attrName]=m,typeof m.keyName=="string")c[m.keyName]=m;else if(m.className!=null&&(y[m.className]=m),m.tagName!=null){Array.isArray(m.tagName)?m.tagName=m.tagName.map(function(u){return u.toUpperCase()}):m.tagName=m.tagName.toUpperCase();var A=Array.isArray(m.tagName)?m.tagName:[m.tagName];A.forEach(function(u){(w[u]==null||m.className==null)&&(w[u]=m)})}return m}n.register=b},function(i,n,s){var r=s(51),a=s(11),c=s(3),y=s(20),w="\0",f=function(g){Array.isArray(g)?this.ops=g:g!=null&&Array.isArray(g.ops)?this.ops=g.ops:this.ops=[]};f.prototype.insert=function(g,p){var d={};return g.length===0?this:(d.insert=g,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(d.attributes=p),this.push(d))},f.prototype.delete=function(g){return g<=0?this:this.push({delete:g})},f.prototype.retain=function(g,p){if(g<=0)return this;var d={retain:g};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(d.attributes=p),this.push(d)},f.prototype.push=function(g){var p=this.ops.length,d=this.ops[p-1];if(g=c(!0,{},g),typeof d=="object"){if(typeof g.delete=="number"&&typeof d.delete=="number")return this.ops[p-1]={delete:d.delete+g.delete},this;if(typeof d.delete=="number"&&g.insert!=null&&(p-=1,d=this.ops[p-1],typeof d!="object"))return this.ops.unshift(g),this;if(a(g.attributes,d.attributes)){if(typeof g.insert=="string"&&typeof d.insert=="string")return this.ops[p-1]={insert:d.insert+g.insert},typeof g.attributes=="object"&&(this.ops[p-1].attributes=g.attributes),this;if(typeof g.retain=="number"&&typeof d.retain=="number")return this.ops[p-1]={retain:d.retain+g.retain},typeof g.attributes=="object"&&(this.ops[p-1].attributes=g.attributes),this}}return p===this.ops.length?this.ops.push(g):this.ops.splice(p,0,g),this},f.prototype.chop=function(){var g=this.ops[this.ops.length-1];return g&&g.retain&&!g.attributes&&this.ops.pop(),this},f.prototype.filter=function(g){return this.ops.filter(g)},f.prototype.forEach=function(g){this.ops.forEach(g)},f.prototype.map=function(g){return this.ops.map(g)},f.prototype.partition=function(g){var p=[],d=[];return this.forEach(function(S){var b=g(S)?p:d;b.push(S)}),[p,d]},f.prototype.reduce=function(g,p){return this.ops.reduce(g,p)},f.prototype.changeLength=function(){return this.reduce(function(g,p){return p.insert?g+y.length(p):p.delete?g-p.delete:g},0)},f.prototype.length=function(){return this.reduce(function(g,p){return g+y.length(p)},0)},f.prototype.slice=function(g,p){g=g||0,typeof p!="number"&&(p=1/0);for(var d=[],S=y.iterator(this.ops),b=0;b<p&&S.hasNext();){var _;b<g?_=S.next(g-b):(_=S.next(p-b),d.push(_)),b+=y.length(_)}return new f(d)},f.prototype.compose=function(g){var p=y.iterator(this.ops),d=y.iterator(g.ops),S=[],b=d.peek();if(b!=null&&typeof b.retain=="number"&&b.attributes==null){for(var _=b.retain;p.peekType()==="insert"&&p.peekLength()<=_;)_-=p.peekLength(),S.push(p.next());b.retain-_>0&&d.next(b.retain-_)}for(var E=new f(S);p.hasNext()||d.hasNext();)if(d.peekType()==="insert")E.push(d.next());else if(p.peekType()==="delete")E.push(p.next());else{var m=Math.min(p.peekLength(),d.peekLength()),A=p.next(m),u=d.next(m);if(typeof u.retain=="number"){var O={};typeof A.retain=="number"?O.retain=m:O.insert=A.insert;var P=y.attributes.compose(A.attributes,u.attributes,typeof A.retain=="number");if(P&&(O.attributes=P),E.push(O),!d.hasNext()&&a(E.ops[E.ops.length-1],O)){var q=new f(p.rest());return E.concat(q).chop()}}else typeof u.delete=="number"&&typeof A.retain=="number"&&E.push(u)}return E.chop()},f.prototype.concat=function(g){var p=new f(this.ops.slice());return g.ops.length>0&&(p.push(g.ops[0]),p.ops=p.ops.concat(g.ops.slice(1))),p},f.prototype.diff=function(g,p){if(this.ops===g.ops)return new f;var d=[this,g].map(function(m){return m.map(function(A){if(A.insert!=null)return typeof A.insert=="string"?A.insert:w;var u=m===g?"on":"with";throw new Error("diff() called "+u+" non-document")}).join("")}),S=new f,b=r(d[0],d[1],p),_=y.iterator(this.ops),E=y.iterator(g.ops);return b.forEach(function(m){for(var A=m[1].length;A>0;){var u=0;switch(m[0]){case r.INSERT:u=Math.min(E.peekLength(),A),S.push(E.next(u));break;case r.DELETE:u=Math.min(A,_.peekLength()),_.next(u),S.delete(u);break;case r.EQUAL:u=Math.min(_.peekLength(),E.peekLength(),A);var O=_.next(u),P=E.next(u);a(O.insert,P.insert)?S.retain(u,y.attributes.diff(O.attributes,P.attributes)):S.push(P).delete(u);break}A-=u}}),S.chop()},f.prototype.eachLine=function(g,p){p=p||`
115
+ `;for(var d=y.iterator(this.ops),S=new f,b=0;d.hasNext();){if(d.peekType()!=="insert")return;var _=d.peek(),E=y.length(_)-d.peekLength(),m=typeof _.insert=="string"?_.insert.indexOf(p,E)-E:-1;if(m<0)S.push(d.next());else if(m>0)S.push(d.next(m));else{if(g(S,d.next(1).attributes||{},b)===!1)return;b+=1,S=new f}}S.length()>0&&g(S,{},b)},f.prototype.transform=function(g,p){if(p=!!p,typeof g=="number")return this.transformPosition(g,p);for(var d=y.iterator(this.ops),S=y.iterator(g.ops),b=new f;d.hasNext()||S.hasNext();)if(d.peekType()==="insert"&&(p||S.peekType()!=="insert"))b.retain(y.length(d.next()));else if(S.peekType()==="insert")b.push(S.next());else{var _=Math.min(d.peekLength(),S.peekLength()),E=d.next(_),m=S.next(_);if(E.delete)continue;m.delete?b.push(m):b.retain(_,y.attributes.transform(E.attributes,m.attributes,p))}return b.chop()},f.prototype.transformPosition=function(g,p){p=!!p;for(var d=y.iterator(this.ops),S=0;d.hasNext()&&S<=g;){var b=d.peekLength(),_=d.peekType();if(d.next(),_==="delete"){g-=Math.min(b,g-S);continue}else _==="insert"&&(S<g||!p)&&(g+=b);S+=b}return g},i.exports=f},function(i,n){var s=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,c=Object.getOwnPropertyDescriptor,y=function(d){return typeof Array.isArray=="function"?Array.isArray(d):r.call(d)==="[object Array]"},w=function(d){if(!d||r.call(d)!=="[object Object]")return!1;var S=s.call(d,"constructor"),b=d.constructor&&d.constructor.prototype&&s.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!S&&!b)return!1;var _;for(_ in d);return typeof _>"u"||s.call(d,_)},f=function(d,S){a&&S.name==="__proto__"?a(d,S.name,{enumerable:!0,configurable:!0,value:S.newValue,writable:!0}):d[S.name]=S.newValue},g=function(d,S){if(S==="__proto__")if(s.call(d,S)){if(c)return c(d,S).value}else return;return d[S]};i.exports=function p(){var d,S,b,_,E,m,A=arguments[0],u=1,O=arguments.length,P=!1;for(typeof A=="boolean"&&(P=A,A=arguments[1]||{},u=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});u<O;++u)if(d=arguments[u],d!=null)for(S in d)b=g(A,S),_=g(d,S),A!==_&&(P&&_&&(w(_)||(E=y(_)))?(E?(E=!1,m=b&&y(b)?b:[]):m=b&&w(b)?b:{},f(A,{name:S,newValue:p(P,m,_)})):typeof _<"u"&&f(A,{name:S,newValue:_}));return A}},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var r=function(){function x(I,k){for(var N=0;N<k.length;N++){var M=k[N];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(I,M.key,M)}}return function(I,k,N){return k&&x(I.prototype,k),N&&x(I,N),I}}(),a=function x(I,k,N){I===null&&(I=Function.prototype);var M=Object.getOwnPropertyDescriptor(I,k);if(M===void 0){var D=Object.getPrototypeOf(I);return D===null?void 0:x(D,k,N)}else{if("value"in M)return M.value;var Q=M.get;return Q===void 0?void 0:Q.call(N)}},c=s(3),y=A(c),w=s(2),f=A(w),g=s(0),p=A(g),d=s(16),S=A(d),b=s(6),_=A(b),E=s(7),m=A(E);function A(x){return x&&x.__esModule?x:{default:x}}function u(x,I){if(!(x instanceof I))throw new TypeError("Cannot call a class as a function")}function O(x,I){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:x}function P(x,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);x.prototype=Object.create(I&&I.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(x,I):x.__proto__=I)}var q=1,v=function(x){P(I,x);function I(){return u(this,I),O(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return r(I,[{key:"attach",value:function(){a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"attach",this).call(this),this.attributes=new p.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new f.default().insert(this.value(),(0,y.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(N,M){var D=p.default.query(N,p.default.Scope.BLOCK_ATTRIBUTE);D!=null&&this.attributes.attribute(D,M)}},{key:"formatAt",value:function(N,M,D,Q){this.format(D,Q)}},{key:"insertAt",value:function(N,M,D){if(typeof M=="string"&&M.endsWith(`
116
+ `)){var Q=p.default.create(V.blotName);this.parent.insertBefore(Q,N===0?this:this.next),Q.insertAt(0,M.slice(0,-1))}else a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"insertAt",this).call(this,N,M,D)}}]),I}(p.default.Embed);v.scope=p.default.Scope.BLOCK_BLOT;var V=function(x){P(I,x);function I(k){u(this,I);var N=O(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,k));return N.cache={},N}return r(I,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(p.default.Leaf).reduce(function(N,M){return M.length()===0?N:N.insert(M.value(),C(M))},new f.default).insert(`
117
+ `,C(this))),this.cache.delta}},{key:"deleteAt",value:function(N,M){a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"deleteAt",this).call(this,N,M),this.cache={}}},{key:"formatAt",value:function(N,M,D,Q){M<=0||(p.default.query(D,p.default.Scope.BLOCK)?N+M===this.length()&&this.format(D,Q):a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"formatAt",this).call(this,N,Math.min(M,this.length()-N-1),D,Q),this.cache={})}},{key:"insertAt",value:function(N,M,D){if(D!=null)return a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"insertAt",this).call(this,N,M,D);if(M.length!==0){var Q=M.split(`
118
+ `),H=Q.shift();H.length>0&&(N<this.length()-1||this.children.tail==null?a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"insertAt",this).call(this,Math.min(N,this.length()-1),H):this.children.tail.insertAt(this.children.tail.length(),H),this.cache={});var j=this;Q.reduce(function(G,B){return j=j.split(G,!0),j.insertAt(0,B),B.length},N+H.length)}}},{key:"insertBefore",value:function(N,M){var D=this.children.head;a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"insertBefore",this).call(this,N,M),D instanceof S.default&&D.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"length",this).call(this)+q),this.cache.length}},{key:"moveChildren",value:function(N,M){a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"moveChildren",this).call(this,N,M),this.cache={}}},{key:"optimize",value:function(N){a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"optimize",this).call(this,N),this.cache={}}},{key:"path",value:function(N){return a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"path",this).call(this,N,!0)}},{key:"removeChild",value:function(N){a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"removeChild",this).call(this,N),this.cache={}}},{key:"split",value:function(N){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(M&&(N===0||N>=this.length()-q)){var D=this.clone();return N===0?(this.parent.insertBefore(D,this),this):(this.parent.insertBefore(D,this.next),D)}else{var Q=a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"split",this).call(this,N,M);return this.cache={},Q}}}]),I}(p.default.Block);V.blotName="block",V.tagName="P",V.defaultChild="break",V.allowedChildren=[_.default,p.default.Embed,m.default];function C(x){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return x==null||(typeof x.formats=="function"&&(I=(0,y.default)(I,x.formats())),x.parent==null||x.parent.blotName=="scroll"||x.parent.statics.scope!==x.statics.scope)?I:C(x.parent,I)}n.bubbleFormats=C,n.BlockEmbed=v,n.default=V},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},a=function(){function j(G,B){var U=[],L=!0,X=!1,K=void 0;try{for(var F=G[Symbol.iterator](),Y;!(L=(Y=F.next()).done)&&(U.push(Y.value),!(B&&U.length===B));L=!0);}catch(Z){X=!0,K=Z}finally{try{!L&&F.return&&F.return()}finally{if(X)throw K}}return U}return function(G,B){if(Array.isArray(G))return G;if(Symbol.iterator in Object(G))return j(G,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function j(G,B){for(var U=0;U<B.length;U++){var L=B[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(G,L.key,L)}}return function(G,B,U){return B&&j(G.prototype,B),U&&j(G,U),G}}();s(50);var y=s(2),w=C(y),f=s(14),g=C(f),p=s(8),d=C(p),S=s(9),b=C(S),_=s(0),E=C(_),m=s(15),A=C(m),u=s(3),O=C(u),P=s(10),q=C(P),v=s(34),V=C(v);function C(j){return j&&j.__esModule?j:{default:j}}function x(j,G,B){return G in j?Object.defineProperty(j,G,{value:B,enumerable:!0,configurable:!0,writable:!0}):j[G]=B,j}function I(j,G){if(!(j instanceof G))throw new TypeError("Cannot call a class as a function")}var k=(0,q.default)("quill"),N=function(){c(j,null,[{key:"debug",value:function(B){B===!0&&(B="log"),q.default.level(B)}},{key:"find",value:function(B){return B.__quill||E.default.find(B)}},{key:"import",value:function(B){return this.imports[B]==null&&k.error("Cannot import "+B+". Are you sure it was registered?"),this.imports[B]}},{key:"register",value:function(B,U){var L=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof B!="string"){var K=B.attrName||B.blotName;typeof K=="string"?this.register("formats/"+K,B,U):Object.keys(B).forEach(function(F){L.register(F,B[F],U)})}else this.imports[B]!=null&&!X&&k.warn("Overwriting "+B+" with",U),this.imports[B]=U,(B.startsWith("blots/")||B.startsWith("formats/"))&&U.blotName!=="abstract"?E.default.register(U):B.startsWith("modules")&&typeof U.register=="function"&&U.register()}}]);function j(G){var B=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(I(this,j),this.options=M(G,U),this.container=this.options.container,this.container==null)return k.error("Invalid Quill container",G);this.options.debug&&j.debug(this.options.debug);var L=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new d.default,this.scroll=E.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new g.default(this.scroll),this.selection=new A.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(d.default.events.EDITOR_CHANGE,function(K){K===d.default.events.TEXT_CHANGE&&B.root.classList.toggle("ql-blank",B.editor.isBlank())}),this.emitter.on(d.default.events.SCROLL_UPDATE,function(K,F){var Y=B.selection.lastRange,Z=Y&&Y.length===0?Y.index:void 0;D.call(B,function(){return B.editor.update(null,F,Z)},K)});var X=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+L+"<p><br></p></div>");this.setContents(X),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return c(j,[{key:"addContainer",value:function(B){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof B=="string"){var L=B;B=document.createElement("div"),B.classList.add(L)}return this.container.insertBefore(B,U),B}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(B,U,L){var X=this,K=Q(B,U,L),F=a(K,4);return B=F[0],U=F[1],L=F[3],D.call(this,function(){return X.editor.deleteText(B,U)},L,B,-1*U)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(B),this.container.classList.toggle("ql-disabled",!B)}},{key:"focus",value:function(){var B=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=B,this.scrollIntoView()}},{key:"format",value:function(B,U){var L=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.default.sources.API;return D.call(this,function(){var K=L.getSelection(!0),F=new w.default;if(K==null)return F;if(E.default.query(B,E.default.Scope.BLOCK))F=L.editor.formatLine(K.index,K.length,x({},B,U));else{if(K.length===0)return L.selection.format(B,U),F;F=L.editor.formatText(K.index,K.length,x({},B,U))}return L.setSelection(K,d.default.sources.SILENT),F},X)}},{key:"formatLine",value:function(B,U,L,X,K){var F=this,Y=void 0,Z=Q(B,U,L,X,K),J=a(Z,4);return B=J[0],U=J[1],Y=J[2],K=J[3],D.call(this,function(){return F.editor.formatLine(B,U,Y)},K,B,0)}},{key:"formatText",value:function(B,U,L,X,K){var F=this,Y=void 0,Z=Q(B,U,L,X,K),J=a(Z,4);return B=J[0],U=J[1],Y=J[2],K=J[3],D.call(this,function(){return F.editor.formatText(B,U,Y)},K,B,0)}},{key:"getBounds",value:function(B){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=void 0;typeof B=="number"?L=this.selection.getBounds(B,U):L=this.selection.getBounds(B.index,B.length);var X=this.container.getBoundingClientRect();return{bottom:L.bottom-X.top,height:L.height,left:L.left-X.left,right:L.right-X.left,top:L.top-X.top,width:L.width}}},{key:"getContents",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,L=Q(B,U),X=a(L,2);return B=X[0],U=X[1],this.editor.getContents(B,U)}},{key:"getFormat",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof B=="number"?this.editor.getFormat(B,U):this.editor.getFormat(B.index,B.length)}},{key:"getIndex",value:function(B){return B.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(B){return this.scroll.leaf(B)}},{key:"getLine",value:function(B){return this.scroll.line(B)}},{key:"getLines",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof B!="number"?this.scroll.lines(B.index,B.length):this.scroll.lines(B,U)}},{key:"getModule",value:function(B){return this.theme.modules[B]}},{key:"getSelection",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return B&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,L=Q(B,U),X=a(L,2);return B=X[0],U=X[1],this.editor.getText(B,U)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(B,U,L){var X=this,K=arguments.length>3&&arguments[3]!==void 0?arguments[3]:j.sources.API;return D.call(this,function(){return X.editor.insertEmbed(B,U,L)},K,B)}},{key:"insertText",value:function(B,U,L,X,K){var F=this,Y=void 0,Z=Q(B,0,L,X,K),J=a(Z,4);return B=J[0],Y=J[2],K=J[3],D.call(this,function(){return F.editor.insertText(B,U,Y)},K,B,U.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(B,U,L){this.clipboard.dangerouslyPasteHTML(B,U,L)}},{key:"removeFormat",value:function(B,U,L){var X=this,K=Q(B,U,L),F=a(K,4);return B=F[0],U=F[1],L=F[3],D.call(this,function(){return X.editor.removeFormat(B,U)},L,B)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(B){var U=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return D.call(this,function(){B=new w.default(B);var X=U.getLength(),K=U.editor.deleteText(0,X),F=U.editor.applyDelta(B),Y=F.ops[F.ops.length-1];Y!=null&&typeof Y.insert=="string"&&Y.insert[Y.insert.length-1]===`
119
+ `&&(U.editor.deleteText(U.getLength()-1,1),F.delete(1));var Z=K.compose(F);return Z},L)}},{key:"setSelection",value:function(B,U,L){if(B==null)this.selection.setRange(null,U||j.sources.API);else{var X=Q(B,U,L),K=a(X,4);B=K[0],U=K[1],L=K[3],this.selection.setRange(new m.Range(B,U),L),L!==d.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(B){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API,L=new w.default().insert(B);return this.setContents(L,U)}},{key:"update",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d.default.sources.USER,U=this.scroll.update(B);return this.selection.update(B),U}},{key:"updateContents",value:function(B){var U=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return D.call(this,function(){return B=new w.default(B),U.editor.applyDelta(B,L)},L,!0)}}]),j}();N.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},N.events=d.default.events,N.sources=d.default.sources,N.version="1.3.7",N.imports={delta:w.default,parchment:E.default,"core/module":b.default,"core/theme":V.default};function M(j,G){if(G=(0,O.default)(!0,{container:j,modules:{clipboard:!0,keyboard:!0,history:!0}},G),!G.theme||G.theme===N.DEFAULTS.theme)G.theme=V.default;else if(G.theme=N.import("themes/"+G.theme),G.theme==null)throw new Error("Invalid theme "+G.theme+". Did you register it?");var B=(0,O.default)(!0,{},G.theme.DEFAULTS);[B,G].forEach(function(X){X.modules=X.modules||{},Object.keys(X.modules).forEach(function(K){X.modules[K]===!0&&(X.modules[K]={})})});var U=Object.keys(B.modules).concat(Object.keys(G.modules)),L=U.reduce(function(X,K){var F=N.import("modules/"+K);return F==null?k.error("Cannot load "+K+" module. Are you sure you registered it?"):X[K]=F.DEFAULTS||{},X},{});return G.modules!=null&&G.modules.toolbar&&G.modules.toolbar.constructor!==Object&&(G.modules.toolbar={container:G.modules.toolbar}),G=(0,O.default)(!0,{},N.DEFAULTS,{modules:L},B,G),["bounds","container","scrollingContainer"].forEach(function(X){typeof G[X]=="string"&&(G[X]=document.querySelector(G[X]))}),G.modules=Object.keys(G.modules).reduce(function(X,K){return G.modules[K]&&(X[K]=G.modules[K]),X},{}),G}function D(j,G,B,U){if(this.options.strict&&!this.isEnabled()&&G===d.default.sources.USER)return new w.default;var L=B==null?null:this.getSelection(),X=this.editor.delta,K=j();if(L!=null&&(B===!0&&(B=L.index),U==null?L=H(L,K,G):U!==0&&(L=H(L,B,U,G)),this.setSelection(L,d.default.sources.SILENT)),K.length()>0){var F,Y=[d.default.events.TEXT_CHANGE,K,X,G];if((F=this.emitter).emit.apply(F,[d.default.events.EDITOR_CHANGE].concat(Y)),G!==d.default.sources.SILENT){var Z;(Z=this.emitter).emit.apply(Z,Y)}}return K}function Q(j,G,B,U,L){var X={};return typeof j.index=="number"&&typeof j.length=="number"?typeof G!="number"?(L=U,U=B,B=G,G=j.length,j=j.index):(G=j.length,j=j.index):typeof G!="number"&&(L=U,U=B,B=G,G=0),(typeof B>"u"?"undefined":r(B))==="object"?(X=B,L=U):typeof B=="string"&&(U!=null?X[B]=U:L=B),L=L||d.default.sources.API,[j,G,X,L]}function H(j,G,B,U){if(j==null)return null;var L=void 0,X=void 0;if(G instanceof w.default){var K=[j.index,j.index+j.length].map(function(J){return G.transformPosition(J,U!==d.default.sources.USER)}),F=a(K,2);L=F[0],X=F[1]}else{var Y=[j.index,j.index+j.length].map(function(J){return J<G||J===G&&U===d.default.sources.USER?J:B>=0?J+B:Math.max(G,J+B)}),Z=a(Y,2);L=Z[0],X=Z[1]}return new m.Range(L,X-L)}n.expandConfig=M,n.overload=Q,n.default=N},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function _(E,m){for(var A=0;A<m.length;A++){var u=m[A];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(E,u.key,u)}}return function(E,m,A){return m&&_(E.prototype,m),A&&_(E,A),E}}(),a=function _(E,m,A){E===null&&(E=Function.prototype);var u=Object.getOwnPropertyDescriptor(E,m);if(u===void 0){var O=Object.getPrototypeOf(E);return O===null?void 0:_(O,m,A)}else{if("value"in u)return u.value;var P=u.get;return P===void 0?void 0:P.call(A)}},c=s(7),y=g(c),w=s(0),f=g(w);function g(_){return _&&_.__esModule?_:{default:_}}function p(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function d(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function S(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var b=function(_){S(E,_);function E(){return p(this,E),d(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return r(E,[{key:"formatAt",value:function(A,u,O,P){if(E.compare(this.statics.blotName,O)<0&&f.default.query(O,f.default.Scope.BLOT)){var q=this.isolate(A,u);P&&q.wrap(O,P)}else a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"formatAt",this).call(this,A,u,O,P)}},{key:"optimize",value:function(A){if(a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,A),this.parent instanceof E&&E.compare(this.statics.blotName,this.parent.statics.blotName)>0){var u=this.parent.isolate(this.offset(),this.length());this.moveChildren(u),u.wrap(this)}}}],[{key:"compare",value:function(A,u){var O=E.order.indexOf(A),P=E.order.indexOf(u);return O>=0||P>=0?O-P:A===u?0:A<u?-1:1}}]),E}(f.default.Inline);b.allowedChildren=[b,f.default.Embed,y.default],b.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=b},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(0),a=c(r);function c(p){return p&&p.__esModule?p:{default:p}}function y(p,d){if(!(p instanceof d))throw new TypeError("Cannot call a class as a function")}function w(p,d){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:p}function f(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(p,d):p.__proto__=d)}var g=function(p){f(d,p);function d(){return y(this,d),w(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default.Text);n.default=g},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function m(A,u){for(var O=0;O<u.length;O++){var P=u[O];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(A,P.key,P)}}return function(A,u,O){return u&&m(A.prototype,u),O&&m(A,O),A}}(),a=function m(A,u,O){A===null&&(A=Function.prototype);var P=Object.getOwnPropertyDescriptor(A,u);if(P===void 0){var q=Object.getPrototypeOf(A);return q===null?void 0:m(q,u,O)}else{if("value"in P)return P.value;var v=P.get;return v===void 0?void 0:v.call(O)}},c=s(54),y=g(c),w=s(10),f=g(w);function g(m){return m&&m.__esModule?m:{default:m}}function p(m,A){if(!(m instanceof A))throw new TypeError("Cannot call a class as a function")}function d(m,A){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:m}function S(m,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);m.prototype=Object.create(A&&A.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(m,A):m.__proto__=A)}var b=(0,f.default)("quill:events"),_=["selectionchange","mousedown","mouseup","click"];_.forEach(function(m){document.addEventListener(m,function(){for(var A=arguments.length,u=Array(A),O=0;O<A;O++)u[O]=arguments[O];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(P){if(P.__quill&&P.__quill.emitter){var q;(q=P.__quill.emitter).handleDOM.apply(q,u)}})})});var E=function(m){S(A,m);function A(){p(this,A);var u=d(this,(A.__proto__||Object.getPrototypeOf(A)).call(this));return u.listeners={},u.on("error",b.error),u}return r(A,[{key:"emit",value:function(){b.log.apply(b,arguments),a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(O){for(var P=arguments.length,q=Array(P>1?P-1:0),v=1;v<P;v++)q[v-1]=arguments[v];(this.listeners[O.type]||[]).forEach(function(V){var C=V.node,x=V.handler;(O.target===C||C.contains(O.target))&&x.apply(void 0,[O].concat(q))})}},{key:"listenDOM",value:function(O,P,q){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push({node:P,handler:q})}}]),A}(y.default);E.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},E.sources={API:"api",SILENT:"silent",USER:"user"},n.default=E},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});function r(c,y){if(!(c instanceof y))throw new TypeError("Cannot call a class as a function")}var a=function c(y){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r(this,c),this.quill=y,this.options=w};a.DEFAULTS={},n.default=a},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=["error","warn","log","info"],a="warn";function c(w){if(r.indexOf(w)<=r.indexOf(a)){for(var f,g=arguments.length,p=Array(g>1?g-1:0),d=1;d<g;d++)p[d-1]=arguments[d];(f=console)[w].apply(f,p)}}function y(w){return r.reduce(function(f,g){return f[g]=c.bind(console,g,w),f},{})}c.level=y.level=function(w){a=w},n.default=y},function(i,n,s){var r=Array.prototype.slice,a=s(52),c=s(53),y=i.exports=function(p,d,S){return S||(S={}),p===d?!0:p instanceof Date&&d instanceof Date?p.getTime()===d.getTime():!p||!d||typeof p!="object"&&typeof d!="object"?S.strict?p===d:p==d:g(p,d,S)};function w(p){return p==null}function f(p){return!(!p||typeof p!="object"||typeof p.length!="number"||typeof p.copy!="function"||typeof p.slice!="function"||p.length>0&&typeof p[0]!="number")}function g(p,d,S){var b,_;if(w(p)||w(d)||p.prototype!==d.prototype)return!1;if(c(p))return c(d)?(p=r.call(p),d=r.call(d),y(p,d,S)):!1;if(f(p)){if(!f(d)||p.length!==d.length)return!1;for(b=0;b<p.length;b++)if(p[b]!==d[b])return!1;return!0}try{var E=a(p),m=a(d)}catch{return!1}if(E.length!=m.length)return!1;for(E.sort(),m.sort(),b=E.length-1;b>=0;b--)if(E[b]!=m[b])return!1;for(b=E.length-1;b>=0;b--)if(_=E[b],!y(p[_],d[_],S))return!1;return typeof p==typeof d}},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(1),a=function(){function c(y,w,f){f===void 0&&(f={}),this.attrName=y,this.keyName=w;var g=r.Scope.TYPE&r.Scope.ATTRIBUTE;f.scope!=null?this.scope=f.scope&r.Scope.LEVEL|g:this.scope=r.Scope.ATTRIBUTE,f.whitelist!=null&&(this.whitelist=f.whitelist)}return c.keys=function(y){return[].map.call(y.attributes,function(w){return w.name})},c.prototype.add=function(y,w){return this.canAdd(y,w)?(y.setAttribute(this.keyName,w),!0):!1},c.prototype.canAdd=function(y,w){var f=r.query(y,r.Scope.BLOT&(this.scope|r.Scope.TYPE));return f==null?!1:this.whitelist==null?!0:typeof w=="string"?this.whitelist.indexOf(w.replace(/["']/g,""))>-1:this.whitelist.indexOf(w)>-1},c.prototype.remove=function(y){y.removeAttribute(this.keyName)},c.prototype.value=function(y){var w=y.getAttribute(this.keyName);return this.canAdd(y,w)&&w?w:""},c}();n.default=a},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var r=function(){function v(V,C){var x=[],I=!0,k=!1,N=void 0;try{for(var M=V[Symbol.iterator](),D;!(I=(D=M.next()).done)&&(x.push(D.value),!(C&&x.length===C));I=!0);}catch(Q){k=!0,N=Q}finally{try{!I&&M.return&&M.return()}finally{if(k)throw N}}return x}return function(V,C){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return v(V,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function v(V,C){for(var x=0;x<C.length;x++){var I=C[x];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(V,I.key,I)}}return function(V,C,x){return C&&v(V.prototype,C),x&&v(V,x),V}}(),c=function v(V,C,x){V===null&&(V=Function.prototype);var I=Object.getOwnPropertyDescriptor(V,C);if(I===void 0){var k=Object.getPrototypeOf(V);return k===null?void 0:v(k,C,x)}else{if("value"in I)return I.value;var N=I.get;return N===void 0?void 0:N.call(x)}},y=s(2),w=m(y),f=s(0),g=m(f),p=s(4),d=m(p),S=s(6),b=m(S),_=s(7),E=m(_);function m(v){return v&&v.__esModule?v:{default:v}}function A(v,V){if(!(v instanceof V))throw new TypeError("Cannot call a class as a function")}function u(v,V){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V&&(typeof V=="object"||typeof V=="function")?V:v}function O(v,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof V);v.prototype=Object.create(V&&V.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),V&&(Object.setPrototypeOf?Object.setPrototypeOf(v,V):v.__proto__=V)}var P=function(v){O(V,v);function V(){return A(this,V),u(this,(V.__proto__||Object.getPrototypeOf(V)).apply(this,arguments))}return V}(b.default);P.blotName="code",P.tagName="CODE";var q=function(v){O(V,v);function V(){return A(this,V),u(this,(V.__proto__||Object.getPrototypeOf(V)).apply(this,arguments))}return a(V,[{key:"delta",value:function(){var x=this,I=this.domNode.textContent;return I.endsWith(`
120
+ `)&&(I=I.slice(0,-1)),I.split(`
121
+ `).reduce(function(k,N){return k.insert(N).insert(`
122
+ `,x.formats())},new w.default)}},{key:"format",value:function(x,I){if(!(x===this.statics.blotName&&I)){var k=this.descendant(E.default,this.length()-1),N=r(k,1),M=N[0];M!=null&&M.deleteAt(M.length()-1,1),c(V.prototype.__proto__||Object.getPrototypeOf(V.prototype),"format",this).call(this,x,I)}}},{key:"formatAt",value:function(x,I,k,N){if(I!==0&&!(g.default.query(k,g.default.Scope.BLOCK)==null||k===this.statics.blotName&&N===this.statics.formats(this.domNode))){var M=this.newlineIndex(x);if(!(M<0||M>=x+I)){var D=this.newlineIndex(x,!0)+1,Q=M-D+1,H=this.isolate(D,Q),j=H.next;H.format(k,N),j instanceof V&&j.formatAt(0,x-D+I-Q,k,N)}}}},{key:"insertAt",value:function(x,I,k){if(k==null){var N=this.descendant(E.default,x),M=r(N,2),D=M[0],Q=M[1];D.insertAt(Q,I)}}},{key:"length",value:function(){var x=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
123
+ `)?x:x+1}},{key:"newlineIndex",value:function(x){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(I)return this.domNode.textContent.slice(0,x).lastIndexOf(`
124
+ `);var k=this.domNode.textContent.slice(x).indexOf(`
125
+ `);return k>-1?x+k:-1}},{key:"optimize",value:function(x){this.domNode.textContent.endsWith(`
126
+ `)||this.appendChild(g.default.create("text",`
127
+ `)),c(V.prototype.__proto__||Object.getPrototypeOf(V.prototype),"optimize",this).call(this,x);var I=this.next;I!=null&&I.prev===this&&I.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===I.statics.formats(I.domNode)&&(I.optimize(x),I.moveChildren(this),I.remove())}},{key:"replace",value:function(x){c(V.prototype.__proto__||Object.getPrototypeOf(V.prototype),"replace",this).call(this,x),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(I){var k=g.default.find(I);k==null?I.parentNode.removeChild(I):k instanceof g.default.Embed?k.remove():k.unwrap()})}}],[{key:"create",value:function(x){var I=c(V.__proto__||Object.getPrototypeOf(V),"create",this).call(this,x);return I.setAttribute("spellcheck",!1),I}},{key:"formats",value:function(){return!0}}]),V}(d.default);q.blotName="code-block",q.tagName="PRE",q.TAB=" ",n.Code=P,n.default=q},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},a=function(){function j(G,B){var U=[],L=!0,X=!1,K=void 0;try{for(var F=G[Symbol.iterator](),Y;!(L=(Y=F.next()).done)&&(U.push(Y.value),!(B&&U.length===B));L=!0);}catch(Z){X=!0,K=Z}finally{try{!L&&F.return&&F.return()}finally{if(X)throw K}}return U}return function(G,B){if(Array.isArray(G))return G;if(Symbol.iterator in Object(G))return j(G,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function j(G,B){for(var U=0;U<B.length;U++){var L=B[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(G,L.key,L)}}return function(G,B,U){return B&&j(G.prototype,B),U&&j(G,U),G}}(),y=s(2),w=I(y),f=s(20),g=I(f),p=s(0),d=I(p),S=s(13),b=I(S),_=s(24),E=I(_),m=s(4),A=I(m),u=s(16),O=I(u),P=s(21),q=I(P),v=s(11),V=I(v),C=s(3),x=I(C);function I(j){return j&&j.__esModule?j:{default:j}}function k(j,G,B){return G in j?Object.defineProperty(j,G,{value:B,enumerable:!0,configurable:!0,writable:!0}):j[G]=B,j}function N(j,G){if(!(j instanceof G))throw new TypeError("Cannot call a class as a function")}var M=/^[ -~]*$/,D=function(){function j(G){N(this,j),this.scroll=G,this.delta=this.getDelta()}return c(j,[{key:"applyDelta",value:function(B){var U=this,L=!1;this.scroll.update();var X=this.scroll.length();return this.scroll.batchStart(),B=H(B),B.reduce(function(K,F){var Y=F.retain||F.delete||F.insert.length||1,Z=F.attributes||{};if(F.insert!=null){if(typeof F.insert=="string"){var J=F.insert;J.endsWith(`
128
+ `)&&L&&(L=!1,J=J.slice(0,-1)),K>=X&&!J.endsWith(`
129
+ `)&&(L=!0),U.scroll.insertAt(K,J);var le=U.scroll.line(K),de=a(le,2),Se=de[0],ve=de[1],Ee=(0,x.default)({},(0,m.bubbleFormats)(Se));if(Se instanceof A.default){var be=Se.descendant(d.default.Leaf,ve),Ge=a(be,1),Le=Ge[0];Ee=(0,x.default)(Ee,(0,m.bubbleFormats)(Le))}Z=g.default.attributes.diff(Ee,Z)||{}}else if(r(F.insert)==="object"){var ne=Object.keys(F.insert)[0];if(ne==null)return K;U.scroll.insertAt(K,ne,F.insert[ne])}X+=Y}return Object.keys(Z).forEach(function(ie){U.scroll.formatAt(K,Y,ie,Z[ie])}),K+Y},0),B.reduce(function(K,F){return typeof F.delete=="number"?(U.scroll.deleteAt(K,F.delete),K):K+(F.retain||F.insert.length||1)},0),this.scroll.batchEnd(),this.update(B)}},{key:"deleteText",value:function(B,U){return this.scroll.deleteAt(B,U),this.update(new w.default().retain(B).delete(U))}},{key:"formatLine",value:function(B,U){var L=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(X).forEach(function(K){if(!(L.scroll.whitelist!=null&&!L.scroll.whitelist[K])){var F=L.scroll.lines(B,Math.max(U,1)),Y=U;F.forEach(function(Z){var J=Z.length();if(!(Z instanceof b.default))Z.format(K,X[K]);else{var le=B-Z.offset(L.scroll),de=Z.newlineIndex(le+Y)-le+1;Z.formatAt(le,de,K,X[K])}Y-=J})}}),this.scroll.optimize(),this.update(new w.default().retain(B).retain(U,(0,q.default)(X)))}},{key:"formatText",value:function(B,U){var L=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(X).forEach(function(K){L.scroll.formatAt(B,U,K,X[K])}),this.update(new w.default().retain(B).retain(U,(0,q.default)(X)))}},{key:"getContents",value:function(B,U){return this.delta.slice(B,B+U)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(B,U){return B.concat(U.delta())},new w.default)}},{key:"getFormat",value:function(B){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=[],X=[];U===0?this.scroll.path(B).forEach(function(F){var Y=a(F,1),Z=Y[0];Z instanceof A.default?L.push(Z):Z instanceof d.default.Leaf&&X.push(Z)}):(L=this.scroll.lines(B,U),X=this.scroll.descendants(d.default.Leaf,B,U));var K=[L,X].map(function(F){if(F.length===0)return{};for(var Y=(0,m.bubbleFormats)(F.shift());Object.keys(Y).length>0;){var Z=F.shift();if(Z==null)return Y;Y=Q((0,m.bubbleFormats)(Z),Y)}return Y});return x.default.apply(x.default,K)}},{key:"getText",value:function(B,U){return this.getContents(B,U).filter(function(L){return typeof L.insert=="string"}).map(function(L){return L.insert}).join("")}},{key:"insertEmbed",value:function(B,U,L){return this.scroll.insertAt(B,U,L),this.update(new w.default().retain(B).insert(k({},U,L)))}},{key:"insertText",value:function(B,U){var L=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return U=U.replace(/\r\n/g,`
130
+ `).replace(/\r/g,`
131
+ `),this.scroll.insertAt(B,U),Object.keys(X).forEach(function(K){L.scroll.formatAt(B,U.length,K,X[K])}),this.update(new w.default().retain(B).insert(U,(0,q.default)(X)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var B=this.scroll.children.head;return B.statics.blotName!==A.default.blotName||B.children.length>1?!1:B.children.head instanceof O.default}},{key:"removeFormat",value:function(B,U){var L=this.getText(B,U),X=this.scroll.line(B+U),K=a(X,2),F=K[0],Y=K[1],Z=0,J=new w.default;F!=null&&(F instanceof b.default?Z=F.newlineIndex(Y)-Y+1:Z=F.length()-Y,J=F.delta().slice(Y,Y+Z-1).insert(`
132
+ `));var le=this.getContents(B,U+Z),de=le.diff(new w.default().insert(L).concat(J)),Se=new w.default().retain(B).concat(de);return this.applyDelta(Se)}},{key:"update",value:function(B){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,X=this.delta;if(U.length===1&&U[0].type==="characterData"&&U[0].target.data.match(M)&&d.default.find(U[0].target)){var K=d.default.find(U[0].target),F=(0,m.bubbleFormats)(K),Y=K.offset(this.scroll),Z=U[0].oldValue.replace(E.default.CONTENTS,""),J=new w.default().insert(Z),le=new w.default().insert(K.value()),de=new w.default().retain(Y).concat(J.diff(le,L));B=de.reduce(function(Se,ve){return ve.insert?Se.insert(ve.insert,F):Se.push(ve)},new w.default),this.delta=X.compose(B)}else this.delta=this.getDelta(),(!B||!(0,V.default)(X.compose(B),this.delta))&&(B=X.diff(this.delta,L));return B}}]),j}();function Q(j,G){return Object.keys(G).reduce(function(B,U){return j[U]==null||(G[U]===j[U]?B[U]=G[U]:Array.isArray(G[U])?G[U].indexOf(j[U])<0&&(B[U]=G[U].concat([j[U]])):B[U]=[G[U],j[U]]),B},{})}function H(j){return j.reduce(function(G,B){if(B.insert===1){var U=(0,q.default)(B.attributes);return delete U.image,G.insert({image:B.attributes.image},U)}if(B.attributes!=null&&(B.attributes.list===!0||B.attributes.bullet===!0)&&(B=(0,q.default)(B),B.attributes.list?B.attributes.list="ordered":(B.attributes.list="bullet",delete B.attributes.bullet)),typeof B.insert=="string"){var L=B.insert.replace(/\r\n/g,`
133
+ `).replace(/\r/g,`
134
+ `);return G.insert(L,B.attributes)}return G.push(B)},new w.default)}n.default=D},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var r=function(){function v(V,C){var x=[],I=!0,k=!1,N=void 0;try{for(var M=V[Symbol.iterator](),D;!(I=(D=M.next()).done)&&(x.push(D.value),!(C&&x.length===C));I=!0);}catch(Q){k=!0,N=Q}finally{try{!I&&M.return&&M.return()}finally{if(k)throw N}}return x}return function(V,C){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return v(V,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function v(V,C){for(var x=0;x<C.length;x++){var I=C[x];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(V,I.key,I)}}return function(V,C,x){return C&&v(V.prototype,C),x&&v(V,x),V}}(),c=s(0),y=E(c),w=s(21),f=E(w),g=s(11),p=E(g),d=s(8),S=E(d),b=s(10),_=E(b);function E(v){return v&&v.__esModule?v:{default:v}}function m(v){if(Array.isArray(v)){for(var V=0,C=Array(v.length);V<v.length;V++)C[V]=v[V];return C}else return Array.from(v)}function A(v,V){if(!(v instanceof V))throw new TypeError("Cannot call a class as a function")}var u=(0,_.default)("quill:selection"),O=function v(V){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;A(this,v),this.index=V,this.length=C},P=function(){function v(V,C){var x=this;A(this,v),this.emitter=C,this.scroll=V,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=y.default.create("cursor",this),this.lastRange=this.savedRange=new O(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){x.mouseDown||setTimeout(x.update.bind(x,S.default.sources.USER),1)}),this.emitter.on(S.default.events.EDITOR_CHANGE,function(I,k){I===S.default.events.TEXT_CHANGE&&k.length()>0&&x.update(S.default.sources.SILENT)}),this.emitter.on(S.default.events.SCROLL_BEFORE_UPDATE,function(){if(x.hasFocus()){var I=x.getNativeRange();I!=null&&I.start.node!==x.cursor.textNode&&x.emitter.once(S.default.events.SCROLL_UPDATE,function(){try{x.setNativeRange(I.start.node,I.start.offset,I.end.node,I.end.offset)}catch{}})}}),this.emitter.on(S.default.events.SCROLL_OPTIMIZE,function(I,k){if(k.range){var N=k.range,M=N.startNode,D=N.startOffset,Q=N.endNode,H=N.endOffset;x.setNativeRange(M,D,Q,H)}}),this.update(S.default.sources.SILENT)}return a(v,[{key:"handleComposition",value:function(){var C=this;this.root.addEventListener("compositionstart",function(){C.composing=!0}),this.root.addEventListener("compositionend",function(){if(C.composing=!1,C.cursor.parent){var x=C.cursor.restore();if(!x)return;setTimeout(function(){C.setNativeRange(x.startNode,x.startOffset,x.endNode,x.endOffset)},1)}})}},{key:"handleDragging",value:function(){var C=this;this.emitter.listenDOM("mousedown",document.body,function(){C.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){C.mouseDown=!1,C.update(S.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(C,x){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[C])){this.scroll.update();var I=this.getNativeRange();if(!(I==null||!I.native.collapsed||y.default.query(C,y.default.Scope.BLOCK))){if(I.start.node!==this.cursor.textNode){var k=y.default.find(I.start.node,!1);if(k==null)return;if(k instanceof y.default.Leaf){var N=k.split(I.start.offset);k.parent.insertBefore(this.cursor,N)}else k.insertBefore(this.cursor,I.start.node);this.cursor.attach()}this.cursor.format(C,x),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(C){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,I=this.scroll.length();C=Math.min(C,I-1),x=Math.min(C+x,I-1)-C;var k=void 0,N=this.scroll.leaf(C),M=r(N,2),D=M[0],Q=M[1];if(D==null)return null;var H=D.position(Q,!0),j=r(H,2);k=j[0],Q=j[1];var G=document.createRange();if(x>0){G.setStart(k,Q);var B=this.scroll.leaf(C+x),U=r(B,2);if(D=U[0],Q=U[1],D==null)return null;var L=D.position(Q,!0),X=r(L,2);return k=X[0],Q=X[1],G.setEnd(k,Q),G.getBoundingClientRect()}else{var K="left",F=void 0;return k instanceof Text?(Q<k.data.length?(G.setStart(k,Q),G.setEnd(k,Q+1)):(G.setStart(k,Q-1),G.setEnd(k,Q),K="right"),F=G.getBoundingClientRect()):(F=D.domNode.getBoundingClientRect(),Q>0&&(K="right")),{bottom:F.top+F.height,height:F.height,left:F[K],right:F[K],top:F.top,width:0}}}},{key:"getNativeRange",value:function(){var C=document.getSelection();if(C==null||C.rangeCount<=0)return null;var x=C.getRangeAt(0);if(x==null)return null;var I=this.normalizeNative(x);return u.info("getNativeRange",I),I}},{key:"getRange",value:function(){var C=this.getNativeRange();if(C==null)return[null,null];var x=this.normalizedToRange(C);return[x,C]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(C){var x=this,I=[[C.start.node,C.start.offset]];C.native.collapsed||I.push([C.end.node,C.end.offset]);var k=I.map(function(D){var Q=r(D,2),H=Q[0],j=Q[1],G=y.default.find(H,!0),B=G.offset(x.scroll);return j===0?B:G instanceof y.default.Container?B+G.length():B+G.index(H,j)}),N=Math.min(Math.max.apply(Math,m(k)),this.scroll.length()-1),M=Math.min.apply(Math,[N].concat(m(k)));return new O(M,N-M)}},{key:"normalizeNative",value:function(C){if(!q(this.root,C.startContainer)||!C.collapsed&&!q(this.root,C.endContainer))return null;var x={start:{node:C.startContainer,offset:C.startOffset},end:{node:C.endContainer,offset:C.endOffset},native:C};return[x.start,x.end].forEach(function(I){for(var k=I.node,N=I.offset;!(k instanceof Text)&&k.childNodes.length>0;)if(k.childNodes.length>N)k=k.childNodes[N],N=0;else if(k.childNodes.length===N)k=k.lastChild,N=k instanceof Text?k.data.length:k.childNodes.length+1;else break;I.node=k,I.offset=N}),x}},{key:"rangeToNative",value:function(C){var x=this,I=C.collapsed?[C.index]:[C.index,C.index+C.length],k=[],N=this.scroll.length();return I.forEach(function(M,D){M=Math.min(N-1,M);var Q=void 0,H=x.scroll.leaf(M),j=r(H,2),G=j[0],B=j[1],U=G.position(B,D!==0),L=r(U,2);Q=L[0],B=L[1],k.push(Q,B)}),k.length<2&&(k=k.concat(k)),k}},{key:"scrollIntoView",value:function(C){var x=this.lastRange;if(x!=null){var I=this.getBounds(x.index,x.length);if(I!=null){var k=this.scroll.length()-1,N=this.scroll.line(Math.min(x.index,k)),M=r(N,1),D=M[0],Q=D;if(x.length>0){var H=this.scroll.line(Math.min(x.index+x.length,k)),j=r(H,1);Q=j[0]}if(!(D==null||Q==null)){var G=C.getBoundingClientRect();I.top<G.top?C.scrollTop-=G.top-I.top:I.bottom>G.bottom&&(C.scrollTop+=I.bottom-G.bottom)}}}}},{key:"setNativeRange",value:function(C,x){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:C,k=arguments.length>3&&arguments[3]!==void 0?arguments[3]:x,N=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(u.info("setNativeRange",C,x,I,k),!(C!=null&&(this.root.parentNode==null||C.parentNode==null||I.parentNode==null))){var M=document.getSelection();if(M!=null)if(C!=null){this.hasFocus()||this.root.focus();var D=(this.getNativeRange()||{}).native;if(D==null||N||C!==D.startContainer||x!==D.startOffset||I!==D.endContainer||k!==D.endOffset){C.tagName=="BR"&&(x=[].indexOf.call(C.parentNode.childNodes,C),C=C.parentNode),I.tagName=="BR"&&(k=[].indexOf.call(I.parentNode.childNodes,I),I=I.parentNode);var Q=document.createRange();Q.setStart(C,x),Q.setEnd(I,k),M.removeAllRanges(),M.addRange(Q)}}else M.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(C){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.default.sources.API;if(typeof x=="string"&&(I=x,x=!1),u.info("setRange",C),C!=null){var k=this.rangeToNative(C);this.setNativeRange.apply(this,m(k).concat([x]))}else this.setNativeRange(null);this.update(I)}},{key:"update",value:function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S.default.sources.USER,x=this.lastRange,I=this.getRange(),k=r(I,2),N=k[0],M=k[1];if(this.lastRange=N,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,p.default)(x,this.lastRange)){var D;!this.composing&&M!=null&&M.native.collapsed&&M.start.node!==this.cursor.textNode&&this.cursor.restore();var Q=[S.default.events.SELECTION_CHANGE,(0,f.default)(this.lastRange),(0,f.default)(x),C];if((D=this.emitter).emit.apply(D,[S.default.events.EDITOR_CHANGE].concat(Q)),C!==S.default.sources.SILENT){var H;(H=this.emitter).emit.apply(H,Q)}}}}]),v}();function q(v,V){try{V.parentNode}catch{return!1}return V instanceof Text&&(V=V.parentNode),v.contains(V)}n.Range=O,n.default=P},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function S(b,_){for(var E=0;E<_.length;E++){var m=_[E];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,_,E){return _&&S(b.prototype,_),E&&S(b,E),b}}(),a=function S(b,_,E){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,_);if(m===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:S(A,_,E)}else{if("value"in m)return m.value;var u=m.get;return u===void 0?void 0:u.call(E)}},c=s(0),y=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function f(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function g(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function p(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var d=function(S){p(b,S);function b(){return f(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return r(b,[{key:"insertInto",value:function(E,m){E.children.length===0?a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"insertInto",this).call(this,E,m):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),b}(y.default.Embed);d.blotName="break",d.tagName="BR",n.default=d},function(i,n,s){var r=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,d){p.__proto__=d}||function(p,d){for(var S in d)d.hasOwnProperty(S)&&(p[S]=d[S])};return function(p,d){g(p,d);function S(){this.constructor=p}p.prototype=d===null?Object.create(d):(S.prototype=d.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(44),c=s(30),y=s(1),w=function(g){r(p,g);function p(d){var S=g.call(this,d)||this;return S.build(),S}return p.prototype.appendChild=function(d){this.insertBefore(d)},p.prototype.attach=function(){g.prototype.attach.call(this),this.children.forEach(function(d){d.attach()})},p.prototype.build=function(){var d=this;this.children=new a.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(S){try{var b=f(S);d.insertBefore(b,d.children.head||void 0)}catch(_){if(_ instanceof y.ParchmentError)return;throw _}})},p.prototype.deleteAt=function(d,S){if(d===0&&S===this.length())return this.remove();this.children.forEachAt(d,S,function(b,_,E){b.deleteAt(_,E)})},p.prototype.descendant=function(d,S){var b=this.children.find(S),_=b[0],E=b[1];return d.blotName==null&&d(_)||d.blotName!=null&&_ instanceof d?[_,E]:_ instanceof p?_.descendant(d,E):[null,-1]},p.prototype.descendants=function(d,S,b){S===void 0&&(S=0),b===void 0&&(b=Number.MAX_VALUE);var _=[],E=b;return this.children.forEachAt(S,b,function(m,A,u){(d.blotName==null&&d(m)||d.blotName!=null&&m instanceof d)&&_.push(m),m instanceof p&&(_=_.concat(m.descendants(d,A,E))),E-=u}),_},p.prototype.detach=function(){this.children.forEach(function(d){d.detach()}),g.prototype.detach.call(this)},p.prototype.formatAt=function(d,S,b,_){this.children.forEachAt(d,S,function(E,m,A){E.formatAt(m,A,b,_)})},p.prototype.insertAt=function(d,S,b){var _=this.children.find(d),E=_[0],m=_[1];if(E)E.insertAt(m,S,b);else{var A=b==null?y.create("text",S):y.create(S,b);this.appendChild(A)}},p.prototype.insertBefore=function(d,S){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(b){return d instanceof b}))throw new y.ParchmentError("Cannot insert "+d.statics.blotName+" into "+this.statics.blotName);d.insertInto(this,S)},p.prototype.length=function(){return this.children.reduce(function(d,S){return d+S.length()},0)},p.prototype.moveChildren=function(d,S){this.children.forEach(function(b){d.insertBefore(b,S)})},p.prototype.optimize=function(d){if(g.prototype.optimize.call(this,d),this.children.length===0)if(this.statics.defaultChild!=null){var S=y.create(this.statics.defaultChild);this.appendChild(S),S.optimize(d)}else this.remove()},p.prototype.path=function(d,S){S===void 0&&(S=!1);var b=this.children.find(d,S),_=b[0],E=b[1],m=[[this,d]];return _ instanceof p?m.concat(_.path(E,S)):(_!=null&&m.push([_,E]),m)},p.prototype.removeChild=function(d){this.children.remove(d)},p.prototype.replace=function(d){d instanceof p&&d.moveChildren(this),g.prototype.replace.call(this,d)},p.prototype.split=function(d,S){if(S===void 0&&(S=!1),!S){if(d===0)return this;if(d===this.length())return this.next}var b=this.clone();return this.parent.insertBefore(b,this.next),this.children.forEachAt(d,this.length(),function(_,E,m){_=_.split(E,S),b.appendChild(_)}),b},p.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},p.prototype.update=function(d,S){var b=this,_=[],E=[];d.forEach(function(m){m.target===b.domNode&&m.type==="childList"&&(_.push.apply(_,m.addedNodes),E.push.apply(E,m.removedNodes))}),E.forEach(function(m){if(!(m.parentNode!=null&&m.tagName!=="IFRAME"&&document.body.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var A=y.find(m);A!=null&&(A.domNode.parentNode==null||A.domNode.parentNode===b.domNode)&&A.detach()}}),_.filter(function(m){return m.parentNode==b.domNode}).sort(function(m,A){return m===A?0:m.compareDocumentPosition(A)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(m){var A=null;m.nextSibling!=null&&(A=y.find(m.nextSibling));var u=f(m);(u.next!=A||u.next==null)&&(u.parent!=null&&u.parent.removeChild(b),b.insertBefore(u,A||void 0))})},p}(c.default);function f(g){var p=y.find(g);if(p==null)try{p=y.create(g)}catch{p=y.create(y.Scope.INLINE),[].slice.call(g.childNodes).forEach(function(S){p.domNode.appendChild(S)}),g.parentNode&&g.parentNode.replaceChild(p.domNode,g),p.attach()}return p}n.default=w},function(i,n,s){var r=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,d){p.__proto__=d}||function(p,d){for(var S in d)d.hasOwnProperty(S)&&(p[S]=d[S])};return function(p,d){g(p,d);function S(){this.constructor=p}p.prototype=d===null?Object.create(d):(S.prototype=d.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(12),c=s(31),y=s(17),w=s(1),f=function(g){r(p,g);function p(d){var S=g.call(this,d)||this;return S.attributes=new c.default(S.domNode),S}return p.formats=function(d){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return d.tagName.toLowerCase()},p.prototype.format=function(d,S){var b=w.query(d);b instanceof a.default?this.attributes.attribute(b,S):S&&b!=null&&(d!==this.statics.blotName||this.formats()[d]!==S)&&this.replaceWith(d,S)},p.prototype.formats=function(){var d=this.attributes.values(),S=this.statics.formats(this.domNode);return S!=null&&(d[this.statics.blotName]=S),d},p.prototype.replaceWith=function(d,S){var b=g.prototype.replaceWith.call(this,d,S);return this.attributes.copy(b),b},p.prototype.update=function(d,S){var b=this;g.prototype.update.call(this,d,S),d.some(function(_){return _.target===b.domNode&&_.type==="attributes"})&&this.attributes.build()},p.prototype.wrap=function(d,S){var b=g.prototype.wrap.call(this,d,S);return b instanceof p&&b.statics.scope===this.statics.scope&&this.attributes.move(b),b},p}(y.default);n.default=f},function(i,n,s){var r=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var p in g)g.hasOwnProperty(p)&&(f[p]=g[p])};return function(f,g){w(f,g);function p(){this.constructor=f}f.prototype=g===null?Object.create(g):(p.prototype=g.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(30),c=s(1),y=function(w){r(f,w);function f(){return w!==null&&w.apply(this,arguments)||this}return f.value=function(g){return!0},f.prototype.index=function(g,p){return this.domNode===g||this.domNode.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(p,1):-1},f.prototype.position=function(g,p){var d=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return g>0&&(d+=1),[this.parent.domNode,d]},f.prototype.value=function(){var g;return g={},g[this.statics.blotName]=this.statics.value(this.domNode)||!0,g},f.scope=c.Scope.INLINE_BLOT,f}(a.default);n.default=y},function(i,n,s){var r=s(11),a=s(3),c={attributes:{compose:function(w,f,g){typeof w!="object"&&(w={}),typeof f!="object"&&(f={});var p=a(!0,{},f);g||(p=Object.keys(p).reduce(function(S,b){return p[b]!=null&&(S[b]=p[b]),S},{}));for(var d in w)w[d]!==void 0&&f[d]===void 0&&(p[d]=w[d]);return Object.keys(p).length>0?p:void 0},diff:function(w,f){typeof w!="object"&&(w={}),typeof f!="object"&&(f={});var g=Object.keys(w).concat(Object.keys(f)).reduce(function(p,d){return r(w[d],f[d])||(p[d]=f[d]===void 0?null:f[d]),p},{});return Object.keys(g).length>0?g:void 0},transform:function(w,f,g){if(typeof w!="object")return f;if(typeof f=="object"){if(!g)return f;var p=Object.keys(f).reduce(function(d,S){return w[S]===void 0&&(d[S]=f[S]),d},{});return Object.keys(p).length>0?p:void 0}}},iterator:function(w){return new y(w)},length:function(w){return typeof w.delete=="number"?w.delete:typeof w.retain=="number"?w.retain:typeof w.insert=="string"?w.insert.length:1}};function y(w){this.ops=w,this.index=0,this.offset=0}y.prototype.hasNext=function(){return this.peekLength()<1/0},y.prototype.next=function(w){w||(w=1/0);var f=this.ops[this.index];if(f){var g=this.offset,p=c.length(f);if(w>=p-g?(w=p-g,this.index+=1,this.offset=0):this.offset+=w,typeof f.delete=="number")return{delete:w};var d={};return f.attributes&&(d.attributes=f.attributes),typeof f.retain=="number"?d.retain=w:typeof f.insert=="string"?d.insert=f.insert.substr(g,w):d.insert=f.insert,d}else return{retain:1/0}},y.prototype.peek=function(){return this.ops[this.index]},y.prototype.peekLength=function(){return this.ops[this.index]?c.length(this.ops[this.index])-this.offset:1/0},y.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},y.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var w=this.offset,f=this.index,g=this.next(),p=this.ops.slice(this.index);return this.offset=w,this.index=f,[g].concat(p)}else return[]},i.exports=c},function(i,n){var s=function(){function r(b,_){return _!=null&&b instanceof _}var a;try{a=Map}catch{a=function(){}}var c;try{c=Set}catch{c=function(){}}var y;try{y=Promise}catch{y=function(){}}function w(b,_,E,m,A){typeof _=="object"&&(E=_.depth,m=_.prototype,A=_.includeNonEnumerable,_=_.circular);var u=[],O=[],P=typeof Buffer<"u";typeof _>"u"&&(_=!0),typeof E>"u"&&(E=1/0);function q(v,V){if(v===null)return null;if(V===0)return v;var C,x;if(typeof v!="object")return v;if(r(v,a))C=new a;else if(r(v,c))C=new c;else if(r(v,y))C=new y(function(G,B){v.then(function(U){G(q(U,V-1))},function(U){B(q(U,V-1))})});else if(w.__isArray(v))C=[];else if(w.__isRegExp(v))C=new RegExp(v.source,S(v)),v.lastIndex&&(C.lastIndex=v.lastIndex);else if(w.__isDate(v))C=new Date(v.getTime());else{if(P&&Buffer.isBuffer(v))return Buffer.allocUnsafe?C=Buffer.allocUnsafe(v.length):C=new Buffer(v.length),v.copy(C),C;r(v,Error)?C=Object.create(v):typeof m>"u"?(x=Object.getPrototypeOf(v),C=Object.create(x)):(C=Object.create(m),x=m)}if(_){var I=u.indexOf(v);if(I!=-1)return O[I];u.push(v),O.push(C)}r(v,a)&&v.forEach(function(G,B){var U=q(B,V-1),L=q(G,V-1);C.set(U,L)}),r(v,c)&&v.forEach(function(G){var B=q(G,V-1);C.add(B)});for(var k in v){var N;x&&(N=Object.getOwnPropertyDescriptor(x,k)),!(N&&N.set==null)&&(C[k]=q(v[k],V-1))}if(Object.getOwnPropertySymbols)for(var M=Object.getOwnPropertySymbols(v),k=0;k<M.length;k++){var D=M[k],Q=Object.getOwnPropertyDescriptor(v,D);Q&&!Q.enumerable&&!A||(C[D]=q(v[D],V-1),Q.enumerable||Object.defineProperty(C,D,{enumerable:!1}))}if(A)for(var H=Object.getOwnPropertyNames(v),k=0;k<H.length;k++){var j=H[k],Q=Object.getOwnPropertyDescriptor(v,j);Q&&Q.enumerable||(C[j]=q(v[j],V-1),Object.defineProperty(C,j,{enumerable:!1}))}return C}return q(b,E)}w.clonePrototype=function(_){if(_===null)return null;var E=function(){};return E.prototype=_,new E};function f(b){return Object.prototype.toString.call(b)}w.__objToStr=f;function g(b){return typeof b=="object"&&f(b)==="[object Date]"}w.__isDate=g;function p(b){return typeof b=="object"&&f(b)==="[object Array]"}w.__isArray=p;function d(b){return typeof b=="object"&&f(b)==="[object RegExp]"}w.__isRegExp=d;function S(b){var _="";return b.global&&(_+="g"),b.ignoreCase&&(_+="i"),b.multiline&&(_+="m"),_}return w.__getRegExpFlags=S,w}();typeof i=="object"&&i.exports&&(i.exports=s)},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function C(x,I){var k=[],N=!0,M=!1,D=void 0;try{for(var Q=x[Symbol.iterator](),H;!(N=(H=Q.next()).done)&&(k.push(H.value),!(I&&k.length===I));N=!0);}catch(j){M=!0,D=j}finally{try{!N&&Q.return&&Q.return()}finally{if(M)throw D}}return k}return function(x,I){if(Array.isArray(x))return x;if(Symbol.iterator in Object(x))return C(x,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function C(x,I){for(var k=0;k<I.length;k++){var N=I[k];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,N.key,N)}}return function(x,I,k){return I&&C(x.prototype,I),k&&C(x,k),x}}(),c=function C(x,I,k){x===null&&(x=Function.prototype);var N=Object.getOwnPropertyDescriptor(x,I);if(N===void 0){var M=Object.getPrototypeOf(x);return M===null?void 0:C(M,I,k)}else{if("value"in N)return N.value;var D=N.get;return D===void 0?void 0:D.call(k)}},y=s(0),w=u(y),f=s(8),g=u(f),p=s(4),d=u(p),S=s(16),b=u(S),_=s(13),E=u(_),m=s(25),A=u(m);function u(C){return C&&C.__esModule?C:{default:C}}function O(C,x){if(!(C instanceof x))throw new TypeError("Cannot call a class as a function")}function P(C,x){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:C}function q(C,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);C.prototype=Object.create(x&&x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(C,x):C.__proto__=x)}function v(C){return C instanceof d.default||C instanceof p.BlockEmbed}var V=function(C){q(x,C);function x(I,k){O(this,x);var N=P(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,I));return N.emitter=k.emitter,Array.isArray(k.whitelist)&&(N.whitelist=k.whitelist.reduce(function(M,D){return M[D]=!0,M},{})),N.domNode.addEventListener("DOMNodeInserted",function(){}),N.optimize(),N.enable(),N}return a(x,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(k,N){var M=this.line(k),D=r(M,2),Q=D[0],H=D[1],j=this.line(k+N),G=r(j,1),B=G[0];if(c(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"deleteAt",this).call(this,k,N),B!=null&&Q!==B&&H>0){if(Q instanceof p.BlockEmbed||B instanceof p.BlockEmbed){this.optimize();return}if(Q instanceof E.default){var U=Q.newlineIndex(Q.length(),!0);if(U>-1&&(Q=Q.split(U+1),Q===B)){this.optimize();return}}else if(B instanceof E.default){var L=B.newlineIndex(0);L>-1&&B.split(L+1)}var X=B.children.head instanceof b.default?null:B.children.head;Q.moveChildren(B,X),Q.remove()}this.optimize()}},{key:"enable",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",k)}},{key:"formatAt",value:function(k,N,M,D){this.whitelist!=null&&!this.whitelist[M]||(c(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"formatAt",this).call(this,k,N,M,D),this.optimize())}},{key:"insertAt",value:function(k,N,M){if(!(M!=null&&this.whitelist!=null&&!this.whitelist[N])){if(k>=this.length())if(M==null||w.default.query(N,w.default.Scope.BLOCK)==null){var D=w.default.create(this.statics.defaultChild);this.appendChild(D),M==null&&N.endsWith(`
135
+ `)&&(N=N.slice(0,-1)),D.insertAt(0,N,M)}else{var Q=w.default.create(N,M);this.appendChild(Q)}else c(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertAt",this).call(this,k,N,M);this.optimize()}}},{key:"insertBefore",value:function(k,N){if(k.statics.scope===w.default.Scope.INLINE_BLOT){var M=w.default.create(this.statics.defaultChild);M.appendChild(k),k=M}c(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertBefore",this).call(this,k,N)}},{key:"leaf",value:function(k){return this.path(k).pop()||[null,-1]}},{key:"line",value:function(k){return k===this.length()?this.line(k-1):this.descendant(v,k)}},{key:"lines",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,M=function D(Q,H,j){var G=[],B=j;return Q.children.forEachAt(H,j,function(U,L,X){v(U)?G.push(U):U instanceof w.default.Container&&(G=G.concat(D(U,L,B))),B-=X}),G};return M(this,k,N)}},{key:"optimize",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(c(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,k,N),k.length>0&&this.emitter.emit(g.default.events.SCROLL_OPTIMIZE,k,N))}},{key:"path",value:function(k){return c(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"path",this).call(this,k).slice(1)}},{key:"update",value:function(k){if(this.batch!==!0){var N=g.default.sources.USER;typeof k=="string"&&(N=k),Array.isArray(k)||(k=this.observer.takeRecords()),k.length>0&&this.emitter.emit(g.default.events.SCROLL_BEFORE_UPDATE,N,k),c(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"update",this).call(this,k.concat([])),k.length>0&&this.emitter.emit(g.default.events.SCROLL_UPDATE,N,k)}}}]),x}(w.default.Scroll);V.blotName="scroll",V.className="ql-editor",V.tagName="DIV",V.defaultChild="block",V.allowedChildren=[d.default,p.BlockEmbed,A.default],n.default=V},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},a=function(){function F(Y,Z){var J=[],le=!0,de=!1,Se=void 0;try{for(var ve=Y[Symbol.iterator](),Ee;!(le=(Ee=ve.next()).done)&&(J.push(Ee.value),!(Z&&J.length===Z));le=!0);}catch(be){de=!0,Se=be}finally{try{!le&&ve.return&&ve.return()}finally{if(de)throw Se}}return J}return function(Y,Z){if(Array.isArray(Y))return Y;if(Symbol.iterator in Object(Y))return F(Y,Z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function F(Y,Z){for(var J=0;J<Z.length;J++){var le=Z[J];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(Y,le.key,le)}}return function(Y,Z,J){return Z&&F(Y.prototype,Z),J&&F(Y,J),Y}}(),y=s(21),w=C(y),f=s(11),g=C(f),p=s(3),d=C(p),S=s(2),b=C(S),_=s(20),E=C(_),m=s(0),A=C(m),u=s(5),O=C(u),P=s(10),q=C(P),v=s(9),V=C(v);function C(F){return F&&F.__esModule?F:{default:F}}function x(F,Y,Z){return Y in F?Object.defineProperty(F,Y,{value:Z,enumerable:!0,configurable:!0,writable:!0}):F[Y]=Z,F}function I(F,Y){if(!(F instanceof Y))throw new TypeError("Cannot call a class as a function")}function k(F,Y){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Y&&(typeof Y=="object"||typeof Y=="function")?Y:F}function N(F,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Y);F.prototype=Object.create(Y&&Y.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),Y&&(Object.setPrototypeOf?Object.setPrototypeOf(F,Y):F.__proto__=Y)}var M=(0,q.default)("quill:keyboard"),D=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",Q=function(F){N(Y,F),c(Y,null,[{key:"match",value:function(J,le){return le=K(le),["altKey","ctrlKey","metaKey","shiftKey"].some(function(de){return!!le[de]!==J[de]&&le[de]!==null})?!1:le.key===(J.which||J.keyCode)}}]);function Y(Z,J){I(this,Y);var le=k(this,(Y.__proto__||Object.getPrototypeOf(Y)).call(this,Z,J));return le.bindings={},Object.keys(le.options.bindings).forEach(function(de){de==="list autofill"&&Z.scroll.whitelist!=null&&!Z.scroll.whitelist.list||le.options.bindings[de]&&le.addBinding(le.options.bindings[de])}),le.addBinding({key:Y.keys.ENTER,shiftKey:null},U),le.addBinding({key:Y.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(le.addBinding({key:Y.keys.BACKSPACE},{collapsed:!0},j),le.addBinding({key:Y.keys.DELETE},{collapsed:!0},G)):(le.addBinding({key:Y.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},j),le.addBinding({key:Y.keys.DELETE},{collapsed:!0,suffix:/^.?$/},G)),le.addBinding({key:Y.keys.BACKSPACE},{collapsed:!1},B),le.addBinding({key:Y.keys.DELETE},{collapsed:!1},B),le.addBinding({key:Y.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},j),le.listen(),le}return c(Y,[{key:"addBinding",value:function(J){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Se=K(J);if(Se==null||Se.key==null)return M.warn("Attempted to add invalid keyboard binding",Se);typeof le=="function"&&(le={handler:le}),typeof de=="function"&&(de={handler:de}),Se=(0,d.default)(Se,le,de),this.bindings[Se.key]=this.bindings[Se.key]||[],this.bindings[Se.key].push(Se)}},{key:"listen",value:function(){var J=this;this.quill.root.addEventListener("keydown",function(le){if(!le.defaultPrevented){var de=le.which||le.keyCode,Se=(J.bindings[de]||[]).filter(function(He){return Y.match(le,He)});if(Se.length!==0){var ve=J.quill.getSelection();if(!(ve==null||!J.quill.hasFocus())){var Ee=J.quill.getLine(ve.index),be=a(Ee,2),Ge=be[0],Le=be[1],ne=J.quill.getLeaf(ve.index),ie=a(ne,2),ue=ie[0],fe=ie[1],he=ve.length===0?[ue,fe]:J.quill.getLeaf(ve.index+ve.length),Ce=a(he,2),Ie=Ce[0],Ve=Ce[1],Ye=ue instanceof A.default.Text?ue.value().slice(0,fe):"",nt=Ie instanceof A.default.Text?Ie.value().slice(Ve):"",Re={collapsed:ve.length===0,empty:ve.length===0&&Ge.length()<=1,format:J.quill.getFormat(ve),offset:Le,prefix:Ye,suffix:nt},Yt=Se.some(function(He){if(He.collapsed!=null&&He.collapsed!==Re.collapsed||He.empty!=null&&He.empty!==Re.empty||He.offset!=null&&He.offset!==Re.offset)return!1;if(Array.isArray(He.format)){if(He.format.every(function(Pt){return Re.format[Pt]==null}))return!1}else if(r(He.format)==="object"&&!Object.keys(He.format).every(function(Pt){return He.format[Pt]===!0?Re.format[Pt]!=null:He.format[Pt]===!1?Re.format[Pt]==null:(0,g.default)(He.format[Pt],Re.format[Pt])}))return!1;return He.prefix!=null&&!He.prefix.test(Re.prefix)||He.suffix!=null&&!He.suffix.test(Re.suffix)?!1:He.handler.call(J,ve,Re)!==!0});Yt&&le.preventDefault()}}}})}}]),Y}(V.default);Q.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},Q.DEFAULTS={bindings:{bold:X("bold"),italic:X("italic"),underline:X("underline"),indent:{key:Q.keys.TAB,format:["blockquote","indent","list"],handler:function(Y,Z){if(Z.collapsed&&Z.offset!==0)return!0;this.quill.format("indent","+1",O.default.sources.USER)}},outdent:{key:Q.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(Y,Z){if(Z.collapsed&&Z.offset!==0)return!0;this.quill.format("indent","-1",O.default.sources.USER)}},"outdent backspace":{key:Q.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(Y,Z){Z.format.indent!=null?this.quill.format("indent","-1",O.default.sources.USER):Z.format.list!=null&&this.quill.format("list",!1,O.default.sources.USER)}},"indent code-block":L(!0),"outdent code-block":L(!1),"remove tab":{key:Q.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(Y){this.quill.deleteText(Y.index-1,1,O.default.sources.USER)}},tab:{key:Q.keys.TAB,handler:function(Y){this.quill.history.cutoff();var Z=new b.default().retain(Y.index).delete(Y.length).insert(" ");this.quill.updateContents(Z,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Y.index+1,O.default.sources.SILENT)}},"list empty enter":{key:Q.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(Y,Z){this.quill.format("list",!1,O.default.sources.USER),Z.format.indent&&this.quill.format("indent",!1,O.default.sources.USER)}},"checklist enter":{key:Q.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(Y){var Z=this.quill.getLine(Y.index),J=a(Z,2),le=J[0],de=J[1],Se=(0,d.default)({},le.formats(),{list:"checked"}),ve=new b.default().retain(Y.index).insert(`
136
+ `,Se).retain(le.length()-de-1).retain(1,{list:"unchecked"});this.quill.updateContents(ve,O.default.sources.USER),this.quill.setSelection(Y.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:Q.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(Y,Z){var J=this.quill.getLine(Y.index),le=a(J,2),de=le[0],Se=le[1],ve=new b.default().retain(Y.index).insert(`
137
+ `,Z.format).retain(de.length()-Se-1).retain(1,{header:null});this.quill.updateContents(ve,O.default.sources.USER),this.quill.setSelection(Y.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(Y,Z){var J=Z.prefix.length,le=this.quill.getLine(Y.index),de=a(le,2),Se=de[0],ve=de[1];if(ve>J)return!0;var Ee=void 0;switch(Z.prefix.trim()){case"[]":case"[ ]":Ee="unchecked";break;case"[x]":Ee="checked";break;case"-":case"*":Ee="bullet";break;default:Ee="ordered"}this.quill.insertText(Y.index," ",O.default.sources.USER),this.quill.history.cutoff();var be=new b.default().retain(Y.index-ve).delete(J+1).retain(Se.length()-2-ve).retain(1,{list:Ee});this.quill.updateContents(be,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Y.index-J,O.default.sources.SILENT)}},"code exit":{key:Q.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(Y){var Z=this.quill.getLine(Y.index),J=a(Z,2),le=J[0],de=J[1],Se=new b.default().retain(Y.index+le.length()-de-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Se,O.default.sources.USER)}},"embed left":H(Q.keys.LEFT,!1),"embed left shift":H(Q.keys.LEFT,!0),"embed right":H(Q.keys.RIGHT,!1),"embed right shift":H(Q.keys.RIGHT,!0)}};function H(F,Y){var Z,J=F===Q.keys.LEFT?"prefix":"suffix";return Z={key:F,shiftKey:Y,altKey:null},x(Z,J,/^$/),x(Z,"handler",function(de){var Se=de.index;F===Q.keys.RIGHT&&(Se+=de.length+1);var ve=this.quill.getLeaf(Se),Ee=a(ve,1),be=Ee[0];return be instanceof A.default.Embed?(F===Q.keys.LEFT?Y?this.quill.setSelection(de.index-1,de.length+1,O.default.sources.USER):this.quill.setSelection(de.index-1,O.default.sources.USER):Y?this.quill.setSelection(de.index,de.length+1,O.default.sources.USER):this.quill.setSelection(de.index+de.length+1,O.default.sources.USER),!1):!0}),Z}function j(F,Y){if(!(F.index===0||this.quill.getLength()<=1)){var Z=this.quill.getLine(F.index),J=a(Z,1),le=J[0],de={};if(Y.offset===0){var Se=this.quill.getLine(F.index-1),ve=a(Se,1),Ee=ve[0];if(Ee!=null&&Ee.length()>1){var be=le.formats(),Ge=this.quill.getFormat(F.index-1,1);de=E.default.attributes.diff(be,Ge)||{}}}var Le=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(Y.prefix)?2:1;this.quill.deleteText(F.index-Le,Le,O.default.sources.USER),Object.keys(de).length>0&&this.quill.formatLine(F.index-Le,Le,de,O.default.sources.USER),this.quill.focus()}}function G(F,Y){var Z=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(Y.suffix)?2:1;if(!(F.index>=this.quill.getLength()-Z)){var J={},le=0,de=this.quill.getLine(F.index),Se=a(de,1),ve=Se[0];if(Y.offset>=ve.length()-1){var Ee=this.quill.getLine(F.index+1),be=a(Ee,1),Ge=be[0];if(Ge){var Le=ve.formats(),ne=this.quill.getFormat(F.index,1);J=E.default.attributes.diff(Le,ne)||{},le=Ge.length()}}this.quill.deleteText(F.index,Z,O.default.sources.USER),Object.keys(J).length>0&&this.quill.formatLine(F.index+le-1,Z,J,O.default.sources.USER)}}function B(F){var Y=this.quill.getLines(F),Z={};if(Y.length>1){var J=Y[0].formats(),le=Y[Y.length-1].formats();Z=E.default.attributes.diff(le,J)||{}}this.quill.deleteText(F,O.default.sources.USER),Object.keys(Z).length>0&&this.quill.formatLine(F.index,1,Z,O.default.sources.USER),this.quill.setSelection(F.index,O.default.sources.SILENT),this.quill.focus()}function U(F,Y){var Z=this;F.length>0&&this.quill.scroll.deleteAt(F.index,F.length);var J=Object.keys(Y.format).reduce(function(le,de){return A.default.query(de,A.default.Scope.BLOCK)&&!Array.isArray(Y.format[de])&&(le[de]=Y.format[de]),le},{});this.quill.insertText(F.index,`
138
+ `,J,O.default.sources.USER),this.quill.setSelection(F.index+1,O.default.sources.SILENT),this.quill.focus(),Object.keys(Y.format).forEach(function(le){J[le]==null&&(Array.isArray(Y.format[le])||le!=="link"&&Z.quill.format(le,Y.format[le],O.default.sources.USER))})}function L(F){return{key:Q.keys.TAB,shiftKey:!F,format:{"code-block":!0},handler:function(Z){var J=A.default.query("code-block"),le=Z.index,de=Z.length,Se=this.quill.scroll.descendant(J,le),ve=a(Se,2),Ee=ve[0],be=ve[1];if(Ee!=null){var Ge=this.quill.getIndex(Ee),Le=Ee.newlineIndex(be,!0)+1,ne=Ee.newlineIndex(Ge+be+de),ie=Ee.domNode.textContent.slice(Le,ne).split(`
139
+ `);be=0,ie.forEach(function(ue,fe){F?(Ee.insertAt(Le+be,J.TAB),be+=J.TAB.length,fe===0?le+=J.TAB.length:de+=J.TAB.length):ue.startsWith(J.TAB)&&(Ee.deleteAt(Le+be,J.TAB.length),be-=J.TAB.length,fe===0?le-=J.TAB.length:de-=J.TAB.length),be+=ue.length+1}),this.quill.update(O.default.sources.USER),this.quill.setSelection(le,de,O.default.sources.SILENT)}}}}function X(F){return{key:F[0].toUpperCase(),shortKey:!0,handler:function(Z,J){this.quill.format(F,!J.format[F],O.default.sources.USER)}}}function K(F){if(typeof F=="string"||typeof F=="number")return K({key:F});if((typeof F>"u"?"undefined":r(F))==="object"&&(F=(0,w.default)(F,!1)),typeof F.key=="string")if(Q.keys[F.key.toUpperCase()]!=null)F.key=Q.keys[F.key.toUpperCase()];else if(F.key.length===1)F.key=F.key.toUpperCase().charCodeAt(0);else return null;return F.shortKey&&(F[D]=F.shortKey,delete F.shortKey),F}n.default=Q,n.SHORTKEY=D},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function E(m,A){var u=[],O=!0,P=!1,q=void 0;try{for(var v=m[Symbol.iterator](),V;!(O=(V=v.next()).done)&&(u.push(V.value),!(A&&u.length===A));O=!0);}catch(C){P=!0,q=C}finally{try{!O&&v.return&&v.return()}finally{if(P)throw q}}return u}return function(m,A){if(Array.isArray(m))return m;if(Symbol.iterator in Object(m))return E(m,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function E(m,A,u){m===null&&(m=Function.prototype);var O=Object.getOwnPropertyDescriptor(m,A);if(O===void 0){var P=Object.getPrototypeOf(m);return P===null?void 0:E(P,A,u)}else{if("value"in O)return O.value;var q=O.get;return q===void 0?void 0:q.call(u)}},c=function(){function E(m,A){for(var u=0;u<A.length;u++){var O=A[u];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(m,O.key,O)}}return function(m,A,u){return A&&E(m.prototype,A),u&&E(m,u),m}}(),y=s(0),w=p(y),f=s(7),g=p(f);function p(E){return E&&E.__esModule?E:{default:E}}function d(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function b(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var _=function(E){b(m,E),c(m,null,[{key:"value",value:function(){}}]);function m(A,u){d(this,m);var O=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,A));return O.selection=u,O.textNode=document.createTextNode(m.CONTENTS),O.domNode.appendChild(O.textNode),O._length=0,O}return c(m,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(u,O){if(this._length!==0)return a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,u,O);for(var P=this,q=0;P!=null&&P.statics.scope!==w.default.Scope.BLOCK_BLOT;)q+=P.offset(P.parent),P=P.parent;P!=null&&(this._length=m.CONTENTS.length,P.optimize(),P.formatAt(q,m.CONTENTS.length,u,O),this._length=0)}},{key:"index",value:function(u,O){return u===this.textNode?0:a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"index",this).call(this,u,O)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var u=this.textNode,O=this.selection.getNativeRange(),P=void 0,q=void 0,v=void 0;if(O!=null&&O.start.node===u&&O.end.node===u){var V=[u,O.start.offset,O.end.offset];P=V[0],q=V[1],v=V[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==m.CONTENTS){var C=this.textNode.data.split(m.CONTENTS).join("");this.next instanceof g.default?(P=this.next.domNode,this.next.insertAt(0,C),this.textNode.data=m.CONTENTS):(this.textNode.data=C,this.parent.insertBefore(w.default.create(this.textNode),this),this.textNode=document.createTextNode(m.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),q!=null){var x=[q,v].map(function(k){return Math.max(0,Math.min(P.data.length,k-1))}),I=r(x,2);return q=I[0],v=I[1],{startNode:P,startOffset:q,endNode:P,endOffset:v}}}}},{key:"update",value:function(u,O){var P=this;if(u.some(function(v){return v.type==="characterData"&&v.target===P.textNode})){var q=this.restore();q&&(O.range=q)}}},{key:"value",value:function(){return""}}]),m}(w.default.Embed);_.blotName="cursor",_.className="ql-cursor",_.tagName="span",_.CONTENTS="\uFEFF",n.default=_},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(0),a=w(r),c=s(4),y=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function f(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function g(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function p(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var d=function(S){p(b,S);function b(){return f(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(a.default.Container);d.allowedChildren=[y.default,c.BlockEmbed,d],n.default=d},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var r=function(){function _(E,m){for(var A=0;A<m.length;A++){var u=m[A];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(E,u.key,u)}}return function(E,m,A){return m&&_(E.prototype,m),A&&_(E,A),E}}(),a=function _(E,m,A){E===null&&(E=Function.prototype);var u=Object.getOwnPropertyDescriptor(E,m);if(u===void 0){var O=Object.getPrototypeOf(E);return O===null?void 0:_(O,m,A)}else{if("value"in u)return u.value;var P=u.get;return P===void 0?void 0:P.call(A)}},c=s(0),y=w(c);function w(_){return _&&_.__esModule?_:{default:_}}function f(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function g(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function p(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var d=function(_){p(E,_);function E(){return f(this,E),g(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return r(E,[{key:"value",value:function(A){var u=a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"value",this).call(this,A);return u.startsWith("rgb(")?(u=u.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+u.split(",").map(function(O){return("00"+parseInt(O).toString(16)).slice(-2)}).join("")):u}}]),E}(y.default.Attributor.Style),S=new y.default.Attributor.Class("color","ql-color",{scope:y.default.Scope.INLINE}),b=new d("color","color",{scope:y.default.Scope.INLINE});n.ColorAttributor=d,n.ColorClass=S,n.ColorStyle=b},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var r=function(){function b(_,E){for(var m=0;m<E.length;m++){var A=E[m];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(_,A.key,A)}}return function(_,E,m){return E&&b(_.prototype,E),m&&b(_,m),_}}(),a=function b(_,E,m){_===null&&(_=Function.prototype);var A=Object.getOwnPropertyDescriptor(_,E);if(A===void 0){var u=Object.getPrototypeOf(_);return u===null?void 0:b(u,E,m)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(m)}},c=s(6),y=w(c);function w(b){return b&&b.__esModule?b:{default:b}}function f(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function g(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var d=function(b){p(_,b);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return r(_,[{key:"format",value:function(m,A){if(m!==this.statics.blotName||!A)return a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,m,A);A=this.constructor.sanitize(A),this.domNode.setAttribute("href",A)}}],[{key:"create",value:function(m){var A=a(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,m);return m=this.sanitize(m),A.setAttribute("href",m),A.setAttribute("rel","noopener noreferrer"),A.setAttribute("target","_blank"),A}},{key:"formats",value:function(m){return m.getAttribute("href")}},{key:"sanitize",value:function(m){return S(m,this.PROTOCOL_WHITELIST)?m:this.SANITIZED_URL}}]),_}(y.default);d.blotName="link",d.tagName="A",d.SANITIZED_URL="about:blank",d.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function S(b,_){var E=document.createElement("a");E.href=b;var m=E.href.slice(0,E.href.indexOf(":"));return _.indexOf(m)>-1}n.default=d,n.sanitize=S},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},a=function(){function _(E,m){for(var A=0;A<m.length;A++){var u=m[A];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(E,u.key,u)}}return function(E,m,A){return m&&_(E.prototype,m),A&&_(E,A),E}}(),c=s(23),y=g(c),w=s(107),f=g(w);function g(_){return _&&_.__esModule?_:{default:_}}function p(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}var d=0;function S(_,E){_.setAttribute(E,_.getAttribute(E)!=="true")}var b=function(){function _(E){var m=this;p(this,_),this.select=E,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){m.togglePicker()}),this.label.addEventListener("keydown",function(A){switch(A.keyCode){case y.default.keys.ENTER:m.togglePicker();break;case y.default.keys.ESCAPE:m.escape(),A.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return a(_,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),S(this.label,"aria-expanded"),S(this.options,"aria-hidden")}},{key:"buildItem",value:function(m){var A=this,u=document.createElement("span");return u.tabIndex="0",u.setAttribute("role","button"),u.classList.add("ql-picker-item"),m.hasAttribute("value")&&u.setAttribute("data-value",m.getAttribute("value")),m.textContent&&u.setAttribute("data-label",m.textContent),u.addEventListener("click",function(){A.selectItem(u,!0)}),u.addEventListener("keydown",function(O){switch(O.keyCode){case y.default.keys.ENTER:A.selectItem(u,!0),O.preventDefault();break;case y.default.keys.ESCAPE:A.escape(),O.preventDefault();break}}),u}},{key:"buildLabel",value:function(){var m=document.createElement("span");return m.classList.add("ql-picker-label"),m.innerHTML=f.default,m.tabIndex="0",m.setAttribute("role","button"),m.setAttribute("aria-expanded","false"),this.container.appendChild(m),m}},{key:"buildOptions",value:function(){var m=this,A=document.createElement("span");A.classList.add("ql-picker-options"),A.setAttribute("aria-hidden","true"),A.tabIndex="-1",A.id="ql-picker-options-"+d,d+=1,this.label.setAttribute("aria-controls",A.id),this.options=A,[].slice.call(this.select.options).forEach(function(u){var O=m.buildItem(u);A.appendChild(O),u.selected===!0&&m.selectItem(O)}),this.container.appendChild(A)}},{key:"buildPicker",value:function(){var m=this;[].slice.call(this.select.attributes).forEach(function(A){m.container.setAttribute(A.name,A.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var m=this;this.close(),setTimeout(function(){return m.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(m){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=this.container.querySelector(".ql-selected");if(m!==u&&(u!=null&&u.classList.remove("ql-selected"),m!=null&&(m.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(m.parentNode.children,m),m.hasAttribute("data-value")?this.label.setAttribute("data-value",m.getAttribute("data-value")):this.label.removeAttribute("data-value"),m.hasAttribute("data-label")?this.label.setAttribute("data-label",m.getAttribute("data-label")):this.label.removeAttribute("data-label"),A))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":r(Event))==="object"){var O=document.createEvent("Event");O.initEvent("change",!0,!0),this.select.dispatchEvent(O)}this.close()}}},{key:"update",value:function(){var m=void 0;if(this.select.selectedIndex>-1){var A=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];m=this.select.options[this.select.selectedIndex],this.selectItem(A)}else this.selectItem(null);var u=m!=null&&m!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",u)}}]),_}();n.default=b},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(0),a=M(r),c=s(5),y=M(c),w=s(4),f=M(w),g=s(16),p=M(g),d=s(25),S=M(d),b=s(24),_=M(b),E=s(35),m=M(E),A=s(6),u=M(A),O=s(22),P=M(O),q=s(7),v=M(q),V=s(55),C=M(V),x=s(42),I=M(x),k=s(23),N=M(k);function M(D){return D&&D.__esModule?D:{default:D}}y.default.register({"blots/block":f.default,"blots/block/embed":w.BlockEmbed,"blots/break":p.default,"blots/container":S.default,"blots/cursor":_.default,"blots/embed":m.default,"blots/inline":u.default,"blots/scroll":P.default,"blots/text":v.default,"modules/clipboard":C.default,"modules/history":I.default,"modules/keyboard":N.default}),a.default.register(f.default,p.default,_.default,u.default,P.default,v.default),n.default=y.default},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(1),a=function(){function c(y){this.domNode=y,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(c.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),c.create=function(y){if(this.tagName==null)throw new r.ParchmentError("Blot definition missing tagName");var w;return Array.isArray(this.tagName)?(typeof y=="string"&&(y=y.toUpperCase(),parseInt(y).toString()===y&&(y=parseInt(y))),typeof y=="number"?w=document.createElement(this.tagName[y-1]):this.tagName.indexOf(y)>-1?w=document.createElement(y):w=document.createElement(this.tagName[0])):w=document.createElement(this.tagName),this.className&&w.classList.add(this.className),w},c.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},c.prototype.clone=function(){var y=this.domNode.cloneNode(!1);return r.create(y)},c.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},c.prototype.deleteAt=function(y,w){var f=this.isolate(y,w);f.remove()},c.prototype.formatAt=function(y,w,f,g){var p=this.isolate(y,w);if(r.query(f,r.Scope.BLOT)!=null&&g)p.wrap(f,g);else if(r.query(f,r.Scope.ATTRIBUTE)!=null){var d=r.create(this.statics.scope);p.wrap(d),d.format(f,g)}},c.prototype.insertAt=function(y,w,f){var g=f==null?r.create("text",w):r.create(w,f),p=this.split(y);this.parent.insertBefore(g,p)},c.prototype.insertInto=function(y,w){w===void 0&&(w=null),this.parent!=null&&this.parent.children.remove(this);var f=null;y.children.insertBefore(this,w),w!=null&&(f=w.domNode),(this.domNode.parentNode!=y.domNode||this.domNode.nextSibling!=f)&&y.domNode.insertBefore(this.domNode,f),this.parent=y,this.attach()},c.prototype.isolate=function(y,w){var f=this.split(y);return f.split(w),f},c.prototype.length=function(){return 1},c.prototype.offset=function(y){return y===void 0&&(y=this.parent),this.parent==null||this==y?0:this.parent.children.offset(this)+this.parent.offset(y)},c.prototype.optimize=function(y){this.domNode[r.DATA_KEY]!=null&&delete this.domNode[r.DATA_KEY].mutations},c.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},c.prototype.replace=function(y){y.parent!=null&&(y.parent.insertBefore(this,y.next),y.remove())},c.prototype.replaceWith=function(y,w){var f=typeof y=="string"?r.create(y,w):y;return f.replace(this),f},c.prototype.split=function(y,w){return y===0?this:this.next},c.prototype.update=function(y,w){},c.prototype.wrap=function(y,w){var f=typeof y=="string"?r.create(y,w):y;return this.parent!=null&&this.parent.insertBefore(f,this.next),f.appendChild(this),f},c.blotName="abstract",c}();n.default=a},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(12),a=s(32),c=s(33),y=s(1),w=function(){function f(g){this.attributes={},this.domNode=g,this.build()}return f.prototype.attribute=function(g,p){p?g.add(this.domNode,p)&&(g.value(this.domNode)!=null?this.attributes[g.attrName]=g:delete this.attributes[g.attrName]):(g.remove(this.domNode),delete this.attributes[g.attrName])},f.prototype.build=function(){var g=this;this.attributes={};var p=r.default.keys(this.domNode),d=a.default.keys(this.domNode),S=c.default.keys(this.domNode);p.concat(d).concat(S).forEach(function(b){var _=y.query(b,y.Scope.ATTRIBUTE);_ instanceof r.default&&(g.attributes[_.attrName]=_)})},f.prototype.copy=function(g){var p=this;Object.keys(this.attributes).forEach(function(d){var S=p.attributes[d].value(p.domNode);g.format(d,S)})},f.prototype.move=function(g){var p=this;this.copy(g),Object.keys(this.attributes).forEach(function(d){p.attributes[d].remove(p.domNode)}),this.attributes={}},f.prototype.values=function(){var g=this;return Object.keys(this.attributes).reduce(function(p,d){return p[d]=g.attributes[d].value(g.domNode),p},{})},f}();n.default=w},function(i,n,s){var r=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var p in g)g.hasOwnProperty(p)&&(f[p]=g[p])};return function(f,g){w(f,g);function p(){this.constructor=f}f.prototype=g===null?Object.create(g):(p.prototype=g.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(12);function c(w,f){var g=w.getAttribute("class")||"";return g.split(/\s+/).filter(function(p){return p.indexOf(f+"-")===0})}var y=function(w){r(f,w);function f(){return w!==null&&w.apply(this,arguments)||this}return f.keys=function(g){return(g.getAttribute("class")||"").split(/\s+/).map(function(p){return p.split("-").slice(0,-1).join("-")})},f.prototype.add=function(g,p){return this.canAdd(g,p)?(this.remove(g),g.classList.add(this.keyName+"-"+p),!0):!1},f.prototype.remove=function(g){var p=c(g,this.keyName);p.forEach(function(d){g.classList.remove(d)}),g.classList.length===0&&g.removeAttribute("class")},f.prototype.value=function(g){var p=c(g,this.keyName)[0]||"",d=p.slice(this.keyName.length+1);return this.canAdd(g,d)?d:""},f}(a.default);n.default=y},function(i,n,s){var r=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var p in g)g.hasOwnProperty(p)&&(f[p]=g[p])};return function(f,g){w(f,g);function p(){this.constructor=f}f.prototype=g===null?Object.create(g):(p.prototype=g.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(12);function c(w){var f=w.split("-"),g=f.slice(1).map(function(p){return p[0].toUpperCase()+p.slice(1)}).join("");return f[0]+g}var y=function(w){r(f,w);function f(){return w!==null&&w.apply(this,arguments)||this}return f.keys=function(g){return(g.getAttribute("style")||"").split(";").map(function(p){var d=p.split(":");return d[0].trim()})},f.prototype.add=function(g,p){return this.canAdd(g,p)?(g.style[c(this.keyName)]=p,!0):!1},f.prototype.remove=function(g){g.style[c(this.keyName)]="",g.getAttribute("style")||g.removeAttribute("style")},f.prototype.value=function(g){var p=g.style[c(this.keyName)];return this.canAdd(g,p)?p:""},f}(a.default);n.default=y},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function y(w,f){for(var g=0;g<f.length;g++){var p=f[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(w,p.key,p)}}return function(w,f,g){return f&&y(w.prototype,f),g&&y(w,g),w}}();function a(y,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}var c=function(){function y(w,f){a(this,y),this.quill=w,this.options=f,this.modules={}}return r(y,[{key:"init",value:function(){var f=this;Object.keys(this.options.modules).forEach(function(g){f.modules[g]==null&&f.addModule(g)})}},{key:"addModule",value:function(f){var g=this.quill.constructor.import("modules/"+f);return this.modules[f]=new g(this.quill,this.options.modules[f]||{}),this.modules[f]}}]),y}();c.DEFAULTS={modules:{}},c.themes={default:c},n.default=c},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function E(m,A){for(var u=0;u<A.length;u++){var O=A[u];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(m,O.key,O)}}return function(m,A,u){return A&&E(m.prototype,A),u&&E(m,u),m}}(),a=function E(m,A,u){m===null&&(m=Function.prototype);var O=Object.getOwnPropertyDescriptor(m,A);if(O===void 0){var P=Object.getPrototypeOf(m);return P===null?void 0:E(P,A,u)}else{if("value"in O)return O.value;var q=O.get;return q===void 0?void 0:q.call(u)}},c=s(0),y=g(c),w=s(7),f=g(w);function g(E){return E&&E.__esModule?E:{default:E}}function p(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function d(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function S(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var b="\uFEFF",_=function(E){S(m,E);function m(A){p(this,m);var u=d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,A));return u.contentNode=document.createElement("span"),u.contentNode.setAttribute("contenteditable",!1),[].slice.call(u.domNode.childNodes).forEach(function(O){u.contentNode.appendChild(O)}),u.leftGuard=document.createTextNode(b),u.rightGuard=document.createTextNode(b),u.domNode.appendChild(u.leftGuard),u.domNode.appendChild(u.contentNode),u.domNode.appendChild(u.rightGuard),u}return r(m,[{key:"index",value:function(u,O){return u===this.leftGuard?0:u===this.rightGuard?1:a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"index",this).call(this,u,O)}},{key:"restore",value:function(u){var O=void 0,P=void 0,q=u.data.split(b).join("");if(u===this.leftGuard)if(this.prev instanceof f.default){var v=this.prev.length();this.prev.insertAt(v,q),O={startNode:this.prev.domNode,startOffset:v+q.length}}else P=document.createTextNode(q),this.parent.insertBefore(y.default.create(P),this),O={startNode:P,startOffset:q.length};else u===this.rightGuard&&(this.next instanceof f.default?(this.next.insertAt(0,q),O={startNode:this.next.domNode,startOffset:q.length}):(P=document.createTextNode(q),this.parent.insertBefore(y.default.create(P),this.next),O={startNode:P,startOffset:q.length}));return u.data=b,O}},{key:"update",value:function(u,O){var P=this;u.forEach(function(q){if(q.type==="characterData"&&(q.target===P.leftGuard||q.target===P.rightGuard)){var v=P.restore(q.target);v&&(O.range=v)}})}}]),m}(y.default.Embed);n.default=_},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var r=s(0),a=c(r);function c(p){return p&&p.__esModule?p:{default:p}}var y={scope:a.default.Scope.BLOCK,whitelist:["right","center","justify"]},w=new a.default.Attributor.Attribute("align","align",y),f=new a.default.Attributor.Class("align","ql-align",y),g=new a.default.Attributor.Style("align","text-align",y);n.AlignAttribute=w,n.AlignClass=f,n.AlignStyle=g},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var r=s(0),a=y(r),c=s(26);function y(g){return g&&g.__esModule?g:{default:g}}var w=new a.default.Attributor.Class("background","ql-bg",{scope:a.default.Scope.INLINE}),f=new c.ColorAttributor("background","background-color",{scope:a.default.Scope.INLINE});n.BackgroundClass=w,n.BackgroundStyle=f},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var r=s(0),a=c(r);function c(p){return p&&p.__esModule?p:{default:p}}var y={scope:a.default.Scope.BLOCK,whitelist:["rtl"]},w=new a.default.Attributor.Attribute("direction","dir",y),f=new a.default.Attributor.Class("direction","ql-direction",y),g=new a.default.Attributor.Style("direction","direction",y);n.DirectionAttribute=w,n.DirectionClass=f,n.DirectionStyle=g},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var r=function(){function E(m,A){for(var u=0;u<A.length;u++){var O=A[u];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(m,O.key,O)}}return function(m,A,u){return A&&E(m.prototype,A),u&&E(m,u),m}}(),a=function E(m,A,u){m===null&&(m=Function.prototype);var O=Object.getOwnPropertyDescriptor(m,A);if(O===void 0){var P=Object.getPrototypeOf(m);return P===null?void 0:E(P,A,u)}else{if("value"in O)return O.value;var q=O.get;return q===void 0?void 0:q.call(u)}},c=s(0),y=w(c);function w(E){return E&&E.__esModule?E:{default:E}}function f(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function g(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function p(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var d={scope:y.default.Scope.INLINE,whitelist:["serif","monospace"]},S=new y.default.Attributor.Class("font","ql-font",d),b=function(E){p(m,E);function m(){return f(this,m),g(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return r(m,[{key:"value",value:function(u){return a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"value",this).call(this,u).replace(/["']/g,"")}}]),m}(y.default.Attributor.Style),_=new b("font","font-family",d);n.FontStyle=_,n.FontClass=S},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var r=s(0),a=c(r);function c(f){return f&&f.__esModule?f:{default:f}}var y=new a.default.Attributor.Class("size","ql-size",{scope:a.default.Scope.INLINE,whitelist:["small","large","huge"]}),w=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=y,n.SizeStyle=w},function(i,n,s){i.exports={align:{"":s(76),center:s(77),right:s(78),justify:s(79)},background:s(80),blockquote:s(81),bold:s(82),clean:s(83),code:s(58),"code-block":s(58),color:s(84),direction:{"":s(85),rtl:s(86)},float:{center:s(87),full:s(88),left:s(89),right:s(90)},formula:s(91),header:{1:s(92),2:s(93)},italic:s(94),image:s(95),indent:{"+1":s(96),"-1":s(97)},link:s(98),list:{ordered:s(99),bullet:s(100),check:s(101)},script:{sub:s(102),super:s(103)},strike:s(104),underline:s(105),video:s(106)}},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var r=function(){function A(u,O){for(var P=0;P<O.length;P++){var q=O[P];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(u,q.key,q)}}return function(u,O,P){return O&&A(u.prototype,O),P&&A(u,P),u}}(),a=s(0),c=p(a),y=s(5),w=p(y),f=s(9),g=p(f);function p(A){return A&&A.__esModule?A:{default:A}}function d(A,u){if(!(A instanceof u))throw new TypeError("Cannot call a class as a function")}function S(A,u){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:A}function b(A,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);A.prototype=Object.create(u&&u.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(A,u):A.__proto__=u)}var _=function(A){b(u,A);function u(O,P){d(this,u);var q=S(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,O,P));return q.lastRecorded=0,q.ignoreChange=!1,q.clear(),q.quill.on(w.default.events.EDITOR_CHANGE,function(v,V,C,x){v!==w.default.events.TEXT_CHANGE||q.ignoreChange||(!q.options.userOnly||x===w.default.sources.USER?q.record(V,C):q.transform(V))}),q.quill.keyboard.addBinding({key:"Z",shortKey:!0},q.undo.bind(q)),q.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},q.redo.bind(q)),/Win/i.test(navigator.platform)&&q.quill.keyboard.addBinding({key:"Y",shortKey:!0},q.redo.bind(q)),q}return r(u,[{key:"change",value:function(P,q){if(this.stack[P].length!==0){var v=this.stack[P].pop();this.stack[q].push(v),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(v[P],w.default.sources.USER),this.ignoreChange=!1;var V=m(v[P]);this.quill.setSelection(V)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(P,q){if(P.ops.length!==0){this.stack.redo=[];var v=this.quill.getContents().diff(q),V=Date.now();if(this.lastRecorded+this.options.delay>V&&this.stack.undo.length>0){var C=this.stack.undo.pop();v=v.compose(C.undo),P=C.redo.compose(P)}else this.lastRecorded=V;this.stack.undo.push({redo:P,undo:v}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(P){this.stack.undo.forEach(function(q){q.undo=P.transform(q.undo,!0),q.redo=P.transform(q.redo,!0)}),this.stack.redo.forEach(function(q){q.undo=P.transform(q.undo,!0),q.redo=P.transform(q.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),u}(g.default);_.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function E(A){var u=A.ops[A.ops.length-1];return u==null?!1:u.insert!=null?typeof u.insert=="string"&&u.insert.endsWith(`
140
+ `):u.attributes!=null?Object.keys(u.attributes).some(function(O){return c.default.query(O,c.default.Scope.BLOCK)!=null}):!1}function m(A){var u=A.reduce(function(P,q){return P+=q.delete||0,P},0),O=A.length()-u;return E(A)&&(O-=1),O}n.default=_,n.getLastChangeIndex=m},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var r=function(){function U(L,X){for(var K=0;K<X.length;K++){var F=X[K];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(L,F.key,F)}}return function(L,X,K){return X&&U(L.prototype,X),K&&U(L,K),L}}(),a=function U(L,X,K){L===null&&(L=Function.prototype);var F=Object.getOwnPropertyDescriptor(L,X);if(F===void 0){var Y=Object.getPrototypeOf(L);return Y===null?void 0:U(Y,X,K)}else{if("value"in F)return F.value;var Z=F.get;return Z===void 0?void 0:Z.call(K)}},c=s(3),y=V(c),w=s(2),f=V(w),g=s(8),p=V(g),d=s(23),S=V(d),b=s(34),_=V(b),E=s(59),m=V(E),A=s(60),u=V(A),O=s(28),P=V(O),q=s(61),v=V(q);function V(U){return U&&U.__esModule?U:{default:U}}function C(U,L){if(!(U instanceof L))throw new TypeError("Cannot call a class as a function")}function x(U,L){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:U}function I(U,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);U.prototype=Object.create(L&&L.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(U,L):U.__proto__=L)}var k=[!1,"center","right","justify"],N=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],M=[!1,"serif","monospace"],D=["1","2","3",!1],Q=["small",!1,"large","huge"],H=function(U){I(L,U);function L(X,K){C(this,L);var F=x(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,X,K)),Y=function Z(J){if(!document.body.contains(X.root))return document.body.removeEventListener("click",Z);F.tooltip!=null&&!F.tooltip.root.contains(J.target)&&document.activeElement!==F.tooltip.textbox&&!F.quill.hasFocus()&&F.tooltip.hide(),F.pickers!=null&&F.pickers.forEach(function(le){le.container.contains(J.target)||le.close()})};return X.emitter.listenDOM("click",document.body,Y),F}return r(L,[{key:"addModule",value:function(K){var F=a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"addModule",this).call(this,K);return K==="toolbar"&&this.extendToolbar(F),F}},{key:"buildButtons",value:function(K,F){K.forEach(function(Y){var Z=Y.getAttribute("class")||"";Z.split(/\s+/).forEach(function(J){if(J.startsWith("ql-")&&(J=J.slice(3),F[J]!=null))if(J==="direction")Y.innerHTML=F[J][""]+F[J].rtl;else if(typeof F[J]=="string")Y.innerHTML=F[J];else{var le=Y.value||"";le!=null&&F[J][le]&&(Y.innerHTML=F[J][le])}})})}},{key:"buildPickers",value:function(K,F){var Y=this;this.pickers=K.map(function(J){if(J.classList.contains("ql-align"))return J.querySelector("option")==null&&B(J,k),new u.default(J,F.align);if(J.classList.contains("ql-background")||J.classList.contains("ql-color")){var le=J.classList.contains("ql-background")?"background":"color";return J.querySelector("option")==null&&B(J,N,le==="background"?"#ffffff":"#000000"),new m.default(J,F[le])}else return J.querySelector("option")==null&&(J.classList.contains("ql-font")?B(J,M):J.classList.contains("ql-header")?B(J,D):J.classList.contains("ql-size")&&B(J,Q)),new P.default(J)});var Z=function(){Y.pickers.forEach(function(le){le.update()})};this.quill.on(p.default.events.EDITOR_CHANGE,Z)}}]),L}(_.default);H.DEFAULTS=(0,y.default)(!0,{},_.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var L=this,X=this.container.querySelector("input.ql-image[type=file]");X==null&&(X=document.createElement("input"),X.setAttribute("type","file"),X.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),X.classList.add("ql-image"),X.addEventListener("change",function(){if(X.files!=null&&X.files[0]!=null){var K=new FileReader;K.onload=function(F){var Y=L.quill.getSelection(!0);L.quill.updateContents(new f.default().retain(Y.index).delete(Y.length).insert({image:F.target.result}),p.default.sources.USER),L.quill.setSelection(Y.index+1,p.default.sources.SILENT),X.value=""},K.readAsDataURL(X.files[0])}}),this.container.appendChild(X)),X.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var j=function(U){I(L,U);function L(X,K){C(this,L);var F=x(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,X,K));return F.textbox=F.root.querySelector('input[type="text"]'),F.listen(),F}return r(L,[{key:"listen",value:function(){var K=this;this.textbox.addEventListener("keydown",function(F){S.default.match(F,"enter")?(K.save(),F.preventDefault()):S.default.match(F,"escape")&&(K.cancel(),F.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),F!=null?this.textbox.value=F:K!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+K)||""),this.root.setAttribute("data-mode",K)}},{key:"restoreFocus",value:function(){var K=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=K}},{key:"save",value:function(){var K=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var F=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",K,p.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",K,p.default.sources.USER)),this.quill.root.scrollTop=F;break}case"video":K=G(K);case"formula":{if(!K)break;var Y=this.quill.getSelection(!0);if(Y!=null){var Z=Y.index+Y.length;this.quill.insertEmbed(Z,this.root.getAttribute("data-mode"),K,p.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(Z+1," ",p.default.sources.USER),this.quill.setSelection(Z+2,p.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),L}(v.default);function G(U){var L=U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return L?(L[1]||"https")+"://www.youtube.com/embed/"+L[2]+"?showinfo=0":(L=U.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(L[1]||"https")+"://player.vimeo.com/video/"+L[2]+"/":U}function B(U,L){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;L.forEach(function(K){var F=document.createElement("option");K===X?F.setAttribute("selected","selected"):F.setAttribute("value",K),U.appendChild(F)})}n.BaseTooltip=j,n.default=H},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function a(){this.head=this.tail=null,this.length=0}return a.prototype.append=function(){for(var c=[],y=0;y<arguments.length;y++)c[y]=arguments[y];this.insertBefore(c[0],null),c.length>1&&this.append.apply(this,c.slice(1))},a.prototype.contains=function(c){for(var y,w=this.iterator();y=w();)if(y===c)return!0;return!1},a.prototype.insertBefore=function(c,y){c&&(c.next=y,y!=null?(c.prev=y.prev,y.prev!=null&&(y.prev.next=c),y.prev=c,y===this.head&&(this.head=c)):this.tail!=null?(this.tail.next=c,c.prev=this.tail,this.tail=c):(c.prev=null,this.head=this.tail=c),this.length+=1)},a.prototype.offset=function(c){for(var y=0,w=this.head;w!=null;){if(w===c)return y;y+=w.length(),w=w.next}return-1},a.prototype.remove=function(c){this.contains(c)&&(c.prev!=null&&(c.prev.next=c.next),c.next!=null&&(c.next.prev=c.prev),c===this.head&&(this.head=c.next),c===this.tail&&(this.tail=c.prev),this.length-=1)},a.prototype.iterator=function(c){return c===void 0&&(c=this.head),function(){var y=c;return c!=null&&(c=c.next),y}},a.prototype.find=function(c,y){y===void 0&&(y=!1);for(var w,f=this.iterator();w=f();){var g=w.length();if(c<g||y&&c===g&&(w.next==null||w.next.length()!==0))return[w,c];c-=g}return[null,0]},a.prototype.forEach=function(c){for(var y,w=this.iterator();y=w();)c(y)},a.prototype.forEachAt=function(c,y,w){if(!(y<=0))for(var f=this.find(c),g=f[0],p=f[1],d,S=c-p,b=this.iterator(g);(d=b())&&S<c+y;){var _=d.length();c>S?w(d,c-S,Math.min(y,S+_-c)):w(d,0,Math.min(_,c+y-S)),S+=_}},a.prototype.map=function(c){return this.reduce(function(y,w){return y.push(c(w)),y},[])},a.prototype.reduce=function(c,y){for(var w,f=this.iterator();w=f();)y=c(y,w);return y},a}();n.default=r},function(i,n,s){var r=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,d){p.__proto__=d}||function(p,d){for(var S in d)d.hasOwnProperty(S)&&(p[S]=d[S])};return function(p,d){g(p,d);function S(){this.constructor=p}p.prototype=d===null?Object.create(d):(S.prototype=d.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(17),c=s(1),y={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},w=100,f=function(g){r(p,g);function p(d){var S=g.call(this,d)||this;return S.scroll=S,S.observer=new MutationObserver(function(b){S.update(b)}),S.observer.observe(S.domNode,y),S.attach(),S}return p.prototype.detach=function(){g.prototype.detach.call(this),this.observer.disconnect()},p.prototype.deleteAt=function(d,S){this.update(),d===0&&S===this.length()?this.children.forEach(function(b){b.remove()}):g.prototype.deleteAt.call(this,d,S)},p.prototype.formatAt=function(d,S,b,_){this.update(),g.prototype.formatAt.call(this,d,S,b,_)},p.prototype.insertAt=function(d,S,b){this.update(),g.prototype.insertAt.call(this,d,S,b)},p.prototype.optimize=function(d,S){var b=this;d===void 0&&(d=[]),S===void 0&&(S={}),g.prototype.optimize.call(this,S);for(var _=[].slice.call(this.observer.takeRecords());_.length>0;)d.push(_.pop());for(var E=function(O,P){P===void 0&&(P=!0),!(O==null||O===b)&&O.domNode.parentNode!=null&&(O.domNode[c.DATA_KEY].mutations==null&&(O.domNode[c.DATA_KEY].mutations=[]),P&&E(O.parent))},m=function(O){O.domNode[c.DATA_KEY]==null||O.domNode[c.DATA_KEY].mutations==null||(O instanceof a.default&&O.children.forEach(m),O.optimize(S))},A=d,u=0;A.length>0;u+=1){if(u>=w)throw new Error("[Parchment] Maximum optimize iterations reached");for(A.forEach(function(O){var P=c.find(O.target,!0);P!=null&&(P.domNode===O.target&&(O.type==="childList"?(E(c.find(O.previousSibling,!1)),[].forEach.call(O.addedNodes,function(q){var v=c.find(q,!1);E(v,!1),v instanceof a.default&&v.children.forEach(function(V){E(V,!1)})})):O.type==="attributes"&&E(P.prev)),E(P))}),this.children.forEach(m),A=[].slice.call(this.observer.takeRecords()),_=A.slice();_.length>0;)d.push(_.pop())}},p.prototype.update=function(d,S){var b=this;S===void 0&&(S={}),d=d||this.observer.takeRecords(),d.map(function(_){var E=c.find(_.target,!0);return E==null?null:E.domNode[c.DATA_KEY].mutations==null?(E.domNode[c.DATA_KEY].mutations=[_],E):(E.domNode[c.DATA_KEY].mutations.push(_),null)}).forEach(function(_){_==null||_===b||_.domNode[c.DATA_KEY]==null||_.update(_.domNode[c.DATA_KEY].mutations||[],S)}),this.domNode[c.DATA_KEY].mutations!=null&&g.prototype.update.call(this,this.domNode[c.DATA_KEY].mutations,S),this.optimize(d,S)},p.blotName="scroll",p.defaultChild="block",p.scope=c.Scope.BLOCK_BLOT,p.tagName="DIV",p}(a.default);n.default=f},function(i,n,s){var r=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,p){g.__proto__=p}||function(g,p){for(var d in p)p.hasOwnProperty(d)&&(g[d]=p[d])};return function(g,p){f(g,p);function d(){this.constructor=g}g.prototype=p===null?Object.create(p):(d.prototype=p.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(18),c=s(1);function y(f,g){if(Object.keys(f).length!==Object.keys(g).length)return!1;for(var p in f)if(f[p]!==g[p])return!1;return!0}var w=function(f){r(g,f);function g(){return f!==null&&f.apply(this,arguments)||this}return g.formats=function(p){if(p.tagName!==g.tagName)return f.formats.call(this,p)},g.prototype.format=function(p,d){var S=this;p===this.statics.blotName&&!d?(this.children.forEach(function(b){b instanceof a.default||(b=b.wrap(g.blotName,!0)),S.attributes.copy(b)}),this.unwrap()):f.prototype.format.call(this,p,d)},g.prototype.formatAt=function(p,d,S,b){if(this.formats()[S]!=null||c.query(S,c.Scope.ATTRIBUTE)){var _=this.isolate(p,d);_.format(S,b)}else f.prototype.formatAt.call(this,p,d,S,b)},g.prototype.optimize=function(p){f.prototype.optimize.call(this,p);var d=this.formats();if(Object.keys(d).length===0)return this.unwrap();var S=this.next;S instanceof g&&S.prev===this&&y(d,S.formats())&&(S.moveChildren(this),S.remove())},g.blotName="inline",g.scope=c.Scope.INLINE_BLOT,g.tagName="SPAN",g}(a.default);n.default=w},function(i,n,s){var r=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var p in g)g.hasOwnProperty(p)&&(f[p]=g[p])};return function(f,g){w(f,g);function p(){this.constructor=f}f.prototype=g===null?Object.create(g):(p.prototype=g.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(18),c=s(1),y=function(w){r(f,w);function f(){return w!==null&&w.apply(this,arguments)||this}return f.formats=function(g){var p=c.query(f.blotName).tagName;if(g.tagName!==p)return w.formats.call(this,g)},f.prototype.format=function(g,p){c.query(g,c.Scope.BLOCK)!=null&&(g===this.statics.blotName&&!p?this.replaceWith(f.blotName):w.prototype.format.call(this,g,p))},f.prototype.formatAt=function(g,p,d,S){c.query(d,c.Scope.BLOCK)!=null?this.format(d,S):w.prototype.formatAt.call(this,g,p,d,S)},f.prototype.insertAt=function(g,p,d){if(d==null||c.query(p,c.Scope.INLINE)!=null)w.prototype.insertAt.call(this,g,p,d);else{var S=this.split(g),b=c.create(p,d);S.parent.insertBefore(b,S)}},f.prototype.update=function(g,p){navigator.userAgent.match(/Trident/)?this.build():w.prototype.update.call(this,g,p)},f.blotName="block",f.scope=c.Scope.BLOCK_BLOT,f.tagName="P",f}(a.default);n.default=y},function(i,n,s){var r=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,f){w.__proto__=f}||function(w,f){for(var g in f)f.hasOwnProperty(g)&&(w[g]=f[g])};return function(w,f){y(w,f);function g(){this.constructor=w}w.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(19),c=function(y){r(w,y);function w(){return y!==null&&y.apply(this,arguments)||this}return w.formats=function(f){},w.prototype.format=function(f,g){y.prototype.formatAt.call(this,0,this.length(),f,g)},w.prototype.formatAt=function(f,g,p,d){f===0&&g===this.length()?this.format(p,d):y.prototype.formatAt.call(this,f,g,p,d)},w.prototype.formats=function(){return this.statics.formats(this.domNode)},w}(a.default);n.default=c},function(i,n,s){var r=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var p in g)g.hasOwnProperty(p)&&(f[p]=g[p])};return function(f,g){w(f,g);function p(){this.constructor=f}f.prototype=g===null?Object.create(g):(p.prototype=g.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=s(19),c=s(1),y=function(w){r(f,w);function f(g){var p=w.call(this,g)||this;return p.text=p.statics.value(p.domNode),p}return f.create=function(g){return document.createTextNode(g)},f.value=function(g){var p=g.data;return p.normalize&&(p=p.normalize()),p},f.prototype.deleteAt=function(g,p){this.domNode.data=this.text=this.text.slice(0,g)+this.text.slice(g+p)},f.prototype.index=function(g,p){return this.domNode===g?p:-1},f.prototype.insertAt=function(g,p,d){d==null?(this.text=this.text.slice(0,g)+p+this.text.slice(g),this.domNode.data=this.text):w.prototype.insertAt.call(this,g,p,d)},f.prototype.length=function(){return this.text.length},f.prototype.optimize=function(g){w.prototype.optimize.call(this,g),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof f&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},f.prototype.position=function(g,p){return[this.domNode,g]},f.prototype.split=function(g,p){if(p===void 0&&(p=!1),!p){if(g===0)return this;if(g===this.length())return this.next}var d=c.create(this.domNode.splitText(g));return this.parent.insertBefore(d,this.next),this.text=this.statics.value(this.domNode),d},f.prototype.update=function(g,p){var d=this;g.some(function(S){return S.type==="characterData"&&S.target===d.domNode})&&(this.text=this.statics.value(this.domNode))},f.prototype.value=function(){return this.text},f.blotName="text",f.scope=c.Scope.INLINE_BLOT,f}(a.default);n.default=y},function(i,n,s){var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var a=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(c,y){return arguments.length>1&&!this.contains(c)==!y?y:a.call(this,c)}}String.prototype.startsWith||(String.prototype.startsWith=function(c,y){return y=y||0,this.substr(y,c.length)===c}),String.prototype.endsWith||(String.prototype.endsWith=function(c,y){var w=this.toString();(typeof y!="number"||!isFinite(y)||Math.floor(y)!==y||y>w.length)&&(y=w.length),y-=c.length;var f=w.indexOf(c,y);return f!==-1&&f===y}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(y){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof y!="function")throw new TypeError("predicate must be a function");for(var w=Object(this),f=w.length>>>0,g=arguments[1],p,d=0;d<f;d++)if(p=w[d],y.call(g,p,d,w))return p}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(i,n){var s=-1,r=1,a=0;function c(u,O,P){if(u==O)return u?[[a,u]]:[];(P<0||u.length<P)&&(P=null);var q=g(u,O),v=u.substring(0,q);u=u.substring(q),O=O.substring(q),q=p(u,O);var V=u.substring(u.length-q);u=u.substring(0,u.length-q),O=O.substring(0,O.length-q);var C=y(u,O);return v&&C.unshift([a,v]),V&&C.push([a,V]),S(C),P!=null&&(C=E(C,P)),C=m(C),C}function y(u,O){var P;if(!u)return[[r,O]];if(!O)return[[s,u]];var q=u.length>O.length?u:O,v=u.length>O.length?O:u,V=q.indexOf(v);if(V!=-1)return P=[[r,q.substring(0,V)],[a,v],[r,q.substring(V+v.length)]],u.length>O.length&&(P[0][0]=P[2][0]=s),P;if(v.length==1)return[[s,u],[r,O]];var C=d(u,O);if(C){var x=C[0],I=C[1],k=C[2],N=C[3],M=C[4],D=c(x,k),Q=c(I,N);return D.concat([[a,M]],Q)}return w(u,O)}function w(u,O){for(var P=u.length,q=O.length,v=Math.ceil((P+q)/2),V=v,C=2*v,x=new Array(C),I=new Array(C),k=0;k<C;k++)x[k]=-1,I[k]=-1;x[V+1]=0,I[V+1]=0;for(var N=P-q,M=N%2!=0,D=0,Q=0,H=0,j=0,G=0;G<v;G++){for(var B=-G+D;B<=G-Q;B+=2){var U=V+B,L;B==-G||B!=G&&x[U-1]<x[U+1]?L=x[U+1]:L=x[U-1]+1;for(var X=L-B;L<P&&X<q&&u.charAt(L)==O.charAt(X);)L++,X++;if(x[U]=L,L>P)Q+=2;else if(X>q)D+=2;else if(M){var K=V+N-B;if(K>=0&&K<C&&I[K]!=-1){var F=P-I[K];if(L>=F)return f(u,O,L,X)}}}for(var Y=-G+H;Y<=G-j;Y+=2){var K=V+Y,F;Y==-G||Y!=G&&I[K-1]<I[K+1]?F=I[K+1]:F=I[K-1]+1;for(var Z=F-Y;F<P&&Z<q&&u.charAt(P-F-1)==O.charAt(q-Z-1);)F++,Z++;if(I[K]=F,F>P)j+=2;else if(Z>q)H+=2;else if(!M){var U=V+N-Y;if(U>=0&&U<C&&x[U]!=-1){var L=x[U],X=V+L-U;if(F=P-F,L>=F)return f(u,O,L,X)}}}}return[[s,u],[r,O]]}function f(u,O,P,q){var v=u.substring(0,P),V=O.substring(0,q),C=u.substring(P),x=O.substring(q),I=c(v,V),k=c(C,x);return I.concat(k)}function g(u,O){if(!u||!O||u.charAt(0)!=O.charAt(0))return 0;for(var P=0,q=Math.min(u.length,O.length),v=q,V=0;P<v;)u.substring(V,v)==O.substring(V,v)?(P=v,V=P):q=v,v=Math.floor((q-P)/2+P);return v}function p(u,O){if(!u||!O||u.charAt(u.length-1)!=O.charAt(O.length-1))return 0;for(var P=0,q=Math.min(u.length,O.length),v=q,V=0;P<v;)u.substring(u.length-v,u.length-V)==O.substring(O.length-v,O.length-V)?(P=v,V=P):q=v,v=Math.floor((q-P)/2+P);return v}function d(u,O){var P=u.length>O.length?u:O,q=u.length>O.length?O:u;if(P.length<4||q.length*2<P.length)return null;function v(Q,H,j){for(var G=Q.substring(j,j+Math.floor(Q.length/4)),B=-1,U="",L,X,K,F;(B=H.indexOf(G,B+1))!=-1;){var Y=g(Q.substring(j),H.substring(B)),Z=p(Q.substring(0,j),H.substring(0,B));U.length<Z+Y&&(U=H.substring(B-Z,B)+H.substring(B,B+Y),L=Q.substring(0,j-Z),X=Q.substring(j+Y),K=H.substring(0,B-Z),F=H.substring(B+Y))}return U.length*2>=Q.length?[L,X,K,F,U]:null}var V=v(P,q,Math.ceil(P.length/4)),C=v(P,q,Math.ceil(P.length/2)),x;if(!V&&!C)return null;C?V?x=V[4].length>C[4].length?V:C:x=C:x=V;var I,k,N,M;u.length>O.length?(I=x[0],k=x[1],N=x[2],M=x[3]):(N=x[0],M=x[1],I=x[2],k=x[3]);var D=x[4];return[I,k,N,M,D]}function S(u){u.push([a,""]);for(var O=0,P=0,q=0,v="",V="",C;O<u.length;)switch(u[O][0]){case r:q++,V+=u[O][1],O++;break;case s:P++,v+=u[O][1],O++;break;case a:P+q>1?(P!==0&&q!==0&&(C=g(V,v),C!==0&&(O-P-q>0&&u[O-P-q-1][0]==a?u[O-P-q-1][1]+=V.substring(0,C):(u.splice(0,0,[a,V.substring(0,C)]),O++),V=V.substring(C),v=v.substring(C)),C=p(V,v),C!==0&&(u[O][1]=V.substring(V.length-C)+u[O][1],V=V.substring(0,V.length-C),v=v.substring(0,v.length-C))),P===0?u.splice(O-q,P+q,[r,V]):q===0?u.splice(O-P,P+q,[s,v]):u.splice(O-P-q,P+q,[s,v],[r,V]),O=O-P-q+(P?1:0)+(q?1:0)+1):O!==0&&u[O-1][0]==a?(u[O-1][1]+=u[O][1],u.splice(O,1)):O++,q=0,P=0,v="",V="";break}u[u.length-1][1]===""&&u.pop();var x=!1;for(O=1;O<u.length-1;)u[O-1][0]==a&&u[O+1][0]==a&&(u[O][1].substring(u[O][1].length-u[O-1][1].length)==u[O-1][1]?(u[O][1]=u[O-1][1]+u[O][1].substring(0,u[O][1].length-u[O-1][1].length),u[O+1][1]=u[O-1][1]+u[O+1][1],u.splice(O-1,1),x=!0):u[O][1].substring(0,u[O+1][1].length)==u[O+1][1]&&(u[O-1][1]+=u[O+1][1],u[O][1]=u[O][1].substring(u[O+1][1].length)+u[O+1][1],u.splice(O+1,1),x=!0)),O++;x&&S(u)}var b=c;b.INSERT=r,b.DELETE=s,b.EQUAL=a,i.exports=b;function _(u,O){if(O===0)return[a,u];for(var P=0,q=0;q<u.length;q++){var v=u[q];if(v[0]===s||v[0]===a){var V=P+v[1].length;if(O===V)return[q+1,u];if(O<V){u=u.slice();var C=O-P,x=[v[0],v[1].slice(0,C)],I=[v[0],v[1].slice(C)];return u.splice(q,1,x,I),[q+1,u]}else P=V}}throw new Error("cursor_pos is out of bounds!")}function E(u,O){var P=_(u,O),q=P[1],v=P[0],V=q[v],C=q[v+1];if(V==null)return u;if(V[0]!==a)return u;if(C!=null&&V[1]+C[1]===C[1]+V[1])return q.splice(v,2,C,V),A(q,v,2);if(C!=null&&C[1].indexOf(V[1])===0){q.splice(v,2,[C[0],V[1]],[0,V[1]]);var x=C[1].slice(V[1].length);return x.length>0&&q.splice(v+2,0,[C[0],x]),A(q,v,3)}else return u}function m(u){for(var O=!1,P=function(C){return C.charCodeAt(0)>=56320&&C.charCodeAt(0)<=57343},q=function(C){return C.charCodeAt(C.length-1)>=55296&&C.charCodeAt(C.length-1)<=56319},v=2;v<u.length;v+=1)u[v-2][0]===a&&q(u[v-2][1])&&u[v-1][0]===s&&P(u[v-1][1])&&u[v][0]===r&&P(u[v][1])&&(O=!0,u[v-1][1]=u[v-2][1].slice(-1)+u[v-1][1],u[v][1]=u[v-2][1].slice(-1)+u[v][1],u[v-2][1]=u[v-2][1].slice(0,-1));if(!O)return u;for(var V=[],v=0;v<u.length;v+=1)u[v][1].length>0&&V.push(u[v]);return V}function A(u,O,P){for(var q=O+P-1;q>=0&&q>=O-1;q--)if(q+1<u.length){var v=u[q],V=u[q+1];v[0]===V[1]&&u.splice(q,2,[v[0],v[1]+V[1]])}return u}},function(i,n){n=i.exports=typeof Object.keys=="function"?Object.keys:s,n.shim=s;function s(r){var a=[];for(var c in r)a.push(c);return a}},function(i,n){var s=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=i.exports=s?r:a,n.supported=r;function r(c){return Object.prototype.toString.call(c)=="[object Arguments]"}n.unsupported=a;function a(c){return c&&typeof c=="object"&&typeof c.length=="number"&&Object.prototype.hasOwnProperty.call(c,"callee")&&!Object.prototype.propertyIsEnumerable.call(c,"callee")||!1}},function(i,n){var s=Object.prototype.hasOwnProperty,r="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(r=!1));function c(w,f,g){this.fn=w,this.context=f,this.once=g||!1}function y(){this._events=new a,this._eventsCount=0}y.prototype.eventNames=function(){var f=[],g,p;if(this._eventsCount===0)return f;for(p in g=this._events)s.call(g,p)&&f.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(g)):f},y.prototype.listeners=function(f,g){var p=r?r+f:f,d=this._events[p];if(g)return!!d;if(!d)return[];if(d.fn)return[d.fn];for(var S=0,b=d.length,_=new Array(b);S<b;S++)_[S]=d[S].fn;return _},y.prototype.emit=function(f,g,p,d,S,b){var _=r?r+f:f;if(!this._events[_])return!1;var E=this._events[_],m=arguments.length,A,u;if(E.fn){switch(E.once&&this.removeListener(f,E.fn,void 0,!0),m){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,g),!0;case 3:return E.fn.call(E.context,g,p),!0;case 4:return E.fn.call(E.context,g,p,d),!0;case 5:return E.fn.call(E.context,g,p,d,S),!0;case 6:return E.fn.call(E.context,g,p,d,S,b),!0}for(u=1,A=new Array(m-1);u<m;u++)A[u-1]=arguments[u];E.fn.apply(E.context,A)}else{var O=E.length,P;for(u=0;u<O;u++)switch(E[u].once&&this.removeListener(f,E[u].fn,void 0,!0),m){case 1:E[u].fn.call(E[u].context);break;case 2:E[u].fn.call(E[u].context,g);break;case 3:E[u].fn.call(E[u].context,g,p);break;case 4:E[u].fn.call(E[u].context,g,p,d);break;default:if(!A)for(P=1,A=new Array(m-1);P<m;P++)A[P-1]=arguments[P];E[u].fn.apply(E[u].context,A)}}return!0},y.prototype.on=function(f,g,p){var d=new c(g,p||this),S=r?r+f:f;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],d]:this._events[S].push(d):(this._events[S]=d,this._eventsCount++),this},y.prototype.once=function(f,g,p){var d=new c(g,p||this,!0),S=r?r+f:f;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],d]:this._events[S].push(d):(this._events[S]=d,this._eventsCount++),this},y.prototype.removeListener=function(f,g,p,d){var S=r?r+f:f;if(!this._events[S])return this;if(!g)return--this._eventsCount===0?this._events=new a:delete this._events[S],this;var b=this._events[S];if(b.fn)b.fn===g&&(!d||b.once)&&(!p||b.context===p)&&(--this._eventsCount===0?this._events=new a:delete this._events[S]);else{for(var _=0,E=[],m=b.length;_<m;_++)(b[_].fn!==g||d&&!b[_].once||p&&b[_].context!==p)&&E.push(b[_]);E.length?this._events[S]=E.length===1?E[0]:E:--this._eventsCount===0?this._events=new a:delete this._events[S]}return this},y.prototype.removeAllListeners=function(f){var g;return f?(g=r?r+f:f,this._events[g]&&(--this._eventsCount===0?this._events=new a:delete this._events[g])):(this._events=new a,this._eventsCount=0),this},y.prototype.off=y.prototype.removeListener,y.prototype.addListener=y.prototype.on,y.prototype.setMaxListeners=function(){return this},y.prefixed=r,y.EventEmitter=y,typeof i<"u"&&(i.exports=y)},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ne){return typeof ne}:function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},a=function(){function ne(ie,ue){var fe=[],he=!0,Ce=!1,Ie=void 0;try{for(var Ve=ie[Symbol.iterator](),Ye;!(he=(Ye=Ve.next()).done)&&(fe.push(Ye.value),!(ue&&fe.length===ue));he=!0);}catch(nt){Ce=!0,Ie=nt}finally{try{!he&&Ve.return&&Ve.return()}finally{if(Ce)throw Ie}}return fe}return function(ie,ue){if(Array.isArray(ie))return ie;if(Symbol.iterator in Object(ie))return ne(ie,ue);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function ne(ie,ue){for(var fe=0;fe<ue.length;fe++){var he=ue[fe];he.enumerable=he.enumerable||!1,he.configurable=!0,"value"in he&&(he.writable=!0),Object.defineProperty(ie,he.key,he)}}return function(ie,ue,fe){return ue&&ne(ie.prototype,ue),fe&&ne(ie,fe),ie}}(),y=s(3),w=I(y),f=s(2),g=I(f),p=s(0),d=I(p),S=s(5),b=I(S),_=s(10),E=I(_),m=s(9),A=I(m),u=s(36),O=s(37),P=s(13),q=I(P),v=s(26),V=s(38),C=s(39),x=s(40);function I(ne){return ne&&ne.__esModule?ne:{default:ne}}function k(ne,ie,ue){return ie in ne?Object.defineProperty(ne,ie,{value:ue,enumerable:!0,configurable:!0,writable:!0}):ne[ie]=ue,ne}function N(ne,ie){if(!(ne instanceof ie))throw new TypeError("Cannot call a class as a function")}function M(ne,ie){if(!ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie&&(typeof ie=="object"||typeof ie=="function")?ie:ne}function D(ne,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ie);ne.prototype=Object.create(ie&&ie.prototype,{constructor:{value:ne,enumerable:!1,writable:!0,configurable:!0}}),ie&&(Object.setPrototypeOf?Object.setPrototypeOf(ne,ie):ne.__proto__=ie)}var Q=(0,E.default)("quill:clipboard"),H="__ql-matcher",j=[[Node.TEXT_NODE,Le],[Node.TEXT_NODE,Ee],["br",de],[Node.ELEMENT_NODE,Ee],[Node.ELEMENT_NODE,le],[Node.ELEMENT_NODE,be],[Node.ELEMENT_NODE,J],[Node.ELEMENT_NODE,Ge],["li",ve],["b",Z.bind(Z,"bold")],["i",Z.bind(Z,"italic")],["style",Se]],G=[u.AlignAttribute,V.DirectionAttribute].reduce(function(ne,ie){return ne[ie.keyName]=ie,ne},{}),B=[u.AlignStyle,O.BackgroundStyle,v.ColorStyle,V.DirectionStyle,C.FontStyle,x.SizeStyle].reduce(function(ne,ie){return ne[ie.keyName]=ie,ne},{}),U=function(ne){D(ie,ne);function ie(ue,fe){N(this,ie);var he=M(this,(ie.__proto__||Object.getPrototypeOf(ie)).call(this,ue,fe));return he.quill.root.addEventListener("paste",he.onPaste.bind(he)),he.container=he.quill.addContainer("ql-clipboard"),he.container.setAttribute("contenteditable",!0),he.container.setAttribute("tabindex",-1),he.matchers=[],j.concat(he.options.matchers).forEach(function(Ce){var Ie=a(Ce,2),Ve=Ie[0],Ye=Ie[1];!fe.matchVisual&&Ye===be||he.addMatcher(Ve,Ye)}),he}return c(ie,[{key:"addMatcher",value:function(fe,he){this.matchers.push([fe,he])}},{key:"convert",value:function(fe){if(typeof fe=="string")return this.container.innerHTML=fe.replace(/\>\r?\n +\</g,"><"),this.convert();var he=this.quill.getFormat(this.quill.selection.savedRange.index);if(he[q.default.blotName]){var Ce=this.container.innerText;return this.container.innerHTML="",new g.default().insert(Ce,k({},q.default.blotName,he[q.default.blotName]))}var Ie=this.prepareMatching(),Ve=a(Ie,2),Ye=Ve[0],nt=Ve[1],Re=Y(this.container,Ye,nt);return K(Re,`
141
+ `)&&Re.ops[Re.ops.length-1].attributes==null&&(Re=Re.compose(new g.default().retain(Re.length()-1).delete(1))),Q.log("convert",this.container.innerHTML,Re),this.container.innerHTML="",Re}},{key:"dangerouslyPasteHTML",value:function(fe,he){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b.default.sources.API;if(typeof fe=="string")this.quill.setContents(this.convert(fe),he),this.quill.setSelection(0,b.default.sources.SILENT);else{var Ie=this.convert(he);this.quill.updateContents(new g.default().retain(fe).concat(Ie),Ce),this.quill.setSelection(fe+Ie.length(),b.default.sources.SILENT)}}},{key:"onPaste",value:function(fe){var he=this;if(!(fe.defaultPrevented||!this.quill.isEnabled())){var Ce=this.quill.getSelection(),Ie=new g.default().retain(Ce.index),Ve=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(b.default.sources.SILENT),setTimeout(function(){Ie=Ie.concat(he.convert()).delete(Ce.length),he.quill.updateContents(Ie,b.default.sources.USER),he.quill.setSelection(Ie.length()-Ce.length,b.default.sources.SILENT),he.quill.scrollingContainer.scrollTop=Ve,he.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var fe=this,he=[],Ce=[];return this.matchers.forEach(function(Ie){var Ve=a(Ie,2),Ye=Ve[0],nt=Ve[1];switch(Ye){case Node.TEXT_NODE:Ce.push(nt);break;case Node.ELEMENT_NODE:he.push(nt);break;default:[].forEach.call(fe.container.querySelectorAll(Ye),function(Re){Re[H]=Re[H]||[],Re[H].push(nt)});break}}),[he,Ce]}}]),ie}(A.default);U.DEFAULTS={matchers:[],matchVisual:!0};function L(ne,ie,ue){return(typeof ie>"u"?"undefined":r(ie))==="object"?Object.keys(ie).reduce(function(fe,he){return L(fe,he,ie[he])},ne):ne.reduce(function(fe,he){return he.attributes&&he.attributes[ie]?fe.push(he):fe.insert(he.insert,(0,w.default)({},k({},ie,ue),he.attributes))},new g.default)}function X(ne){if(ne.nodeType!==Node.ELEMENT_NODE)return{};var ie="__ql-computed-style";return ne[ie]||(ne[ie]=window.getComputedStyle(ne))}function K(ne,ie){for(var ue="",fe=ne.ops.length-1;fe>=0&&ue.length<ie.length;--fe){var he=ne.ops[fe];if(typeof he.insert!="string")break;ue=he.insert+ue}return ue.slice(-1*ie.length)===ie}function F(ne){if(ne.childNodes.length===0)return!1;var ie=X(ne);return["block","list-item"].indexOf(ie.display)>-1}function Y(ne,ie,ue){return ne.nodeType===ne.TEXT_NODE?ue.reduce(function(fe,he){return he(ne,fe)},new g.default):ne.nodeType===ne.ELEMENT_NODE?[].reduce.call(ne.childNodes||[],function(fe,he){var Ce=Y(he,ie,ue);return he.nodeType===ne.ELEMENT_NODE&&(Ce=ie.reduce(function(Ie,Ve){return Ve(he,Ie)},Ce),Ce=(he[H]||[]).reduce(function(Ie,Ve){return Ve(he,Ie)},Ce)),fe.concat(Ce)},new g.default):new g.default}function Z(ne,ie,ue){return L(ue,ne,!0)}function J(ne,ie){var ue=d.default.Attributor.Attribute.keys(ne),fe=d.default.Attributor.Class.keys(ne),he=d.default.Attributor.Style.keys(ne),Ce={};return ue.concat(fe).concat(he).forEach(function(Ie){var Ve=d.default.query(Ie,d.default.Scope.ATTRIBUTE);Ve!=null&&(Ce[Ve.attrName]=Ve.value(ne),Ce[Ve.attrName])||(Ve=G[Ie],Ve!=null&&(Ve.attrName===Ie||Ve.keyName===Ie)&&(Ce[Ve.attrName]=Ve.value(ne)||void 0),Ve=B[Ie],Ve!=null&&(Ve.attrName===Ie||Ve.keyName===Ie)&&(Ve=B[Ie],Ce[Ve.attrName]=Ve.value(ne)||void 0))}),Object.keys(Ce).length>0&&(ie=L(ie,Ce)),ie}function le(ne,ie){var ue=d.default.query(ne);if(ue==null)return ie;if(ue.prototype instanceof d.default.Embed){var fe={},he=ue.value(ne);he!=null&&(fe[ue.blotName]=he,ie=new g.default().insert(fe,ue.formats(ne)))}else typeof ue.formats=="function"&&(ie=L(ie,ue.blotName,ue.formats(ne)));return ie}function de(ne,ie){return K(ie,`
142
+ `)||ie.insert(`
143
+ `),ie}function Se(){return new g.default}function ve(ne,ie){var ue=d.default.query(ne);if(ue==null||ue.blotName!=="list-item"||!K(ie,`
144
+ `))return ie;for(var fe=-1,he=ne.parentNode;!he.classList.contains("ql-clipboard");)(d.default.query(he)||{}).blotName==="list"&&(fe+=1),he=he.parentNode;return fe<=0?ie:ie.compose(new g.default().retain(ie.length()-1).retain(1,{indent:fe}))}function Ee(ne,ie){return K(ie,`
145
+ `)||(F(ne)||ie.length()>0&&ne.nextSibling&&F(ne.nextSibling))&&ie.insert(`
146
+ `),ie}function be(ne,ie){if(F(ne)&&ne.nextElementSibling!=null&&!K(ie,`
147
+
148
+ `)){var ue=ne.offsetHeight+parseFloat(X(ne).marginTop)+parseFloat(X(ne).marginBottom);ne.nextElementSibling.offsetTop>ne.offsetTop+ue*1.5&&ie.insert(`
149
+ `)}return ie}function Ge(ne,ie){var ue={},fe=ne.style||{};return fe.fontStyle&&X(ne).fontStyle==="italic"&&(ue.italic=!0),fe.fontWeight&&(X(ne).fontWeight.startsWith("bold")||parseInt(X(ne).fontWeight)>=700)&&(ue.bold=!0),Object.keys(ue).length>0&&(ie=L(ie,ue)),parseFloat(fe.textIndent||0)>0&&(ie=new g.default().insert(" ").concat(ie)),ie}function Le(ne,ie){var ue=ne.data;if(ne.parentNode.tagName==="O:P")return ie.insert(ue.trim());if(ue.trim().length===0&&ne.parentNode.classList.contains("ql-clipboard"))return ie;if(!X(ne.parentNode).whiteSpace.startsWith("pre")){var fe=function(Ce,Ie){return Ie=Ie.replace(/[^\u00a0]/g,""),Ie.length<1&&Ce?" ":Ie};ue=ue.replace(/\r\n/g," ").replace(/\n/g," "),ue=ue.replace(/\s\s+/g,fe.bind(fe,!0)),(ne.previousSibling==null&&F(ne.parentNode)||ne.previousSibling!=null&&F(ne.previousSibling))&&(ue=ue.replace(/^\s+/,fe.bind(fe,!1))),(ne.nextSibling==null&&F(ne.parentNode)||ne.nextSibling!=null&&F(ne.nextSibling))&&(ue=ue.replace(/\s+$/,fe.bind(fe,!1)))}return ie.insert(ue)}n.default=U,n.matchAttributor=J,n.matchBlot=le,n.matchNewline=Ee,n.matchSpacing=be,n.matchText=Le},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function S(b,_){for(var E=0;E<_.length;E++){var m=_[E];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,_,E){return _&&S(b.prototype,_),E&&S(b,E),b}}(),a=function S(b,_,E){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,_);if(m===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:S(A,_,E)}else{if("value"in m)return m.value;var u=m.get;return u===void 0?void 0:u.call(E)}},c=s(6),y=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function f(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function g(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function p(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var d=function(S){p(b,S);function b(){return f(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return r(b,[{key:"optimize",value:function(E){a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,E),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return a(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),b}(y.default);d.blotName="bold",d.tagName=["STRONG","B"],n.default=d},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var r=function(){function x(I,k){var N=[],M=!0,D=!1,Q=void 0;try{for(var H=I[Symbol.iterator](),j;!(M=(j=H.next()).done)&&(N.push(j.value),!(k&&N.length===k));M=!0);}catch(G){D=!0,Q=G}finally{try{!M&&H.return&&H.return()}finally{if(D)throw Q}}return N}return function(I,k){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return x(I,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function x(I,k){for(var N=0;N<k.length;N++){var M=k[N];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(I,M.key,M)}}return function(I,k,N){return k&&x(I.prototype,k),N&&x(I,N),I}}(),c=s(2),y=E(c),w=s(0),f=E(w),g=s(5),p=E(g),d=s(10),S=E(d),b=s(9),_=E(b);function E(x){return x&&x.__esModule?x:{default:x}}function m(x,I,k){return I in x?Object.defineProperty(x,I,{value:k,enumerable:!0,configurable:!0,writable:!0}):x[I]=k,x}function A(x,I){if(!(x instanceof I))throw new TypeError("Cannot call a class as a function")}function u(x,I){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:x}function O(x,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);x.prototype=Object.create(I&&I.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(x,I):x.__proto__=I)}var P=(0,S.default)("quill:toolbar"),q=function(x){O(I,x);function I(k,N){A(this,I);var M=u(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,k,N));if(Array.isArray(M.options.container)){var D=document.createElement("div");V(D,M.options.container),k.container.parentNode.insertBefore(D,k.container),M.container=D}else typeof M.options.container=="string"?M.container=document.querySelector(M.options.container):M.container=M.options.container;if(!(M.container instanceof HTMLElement)){var Q;return Q=P.error("Container required for toolbar",M.options),u(M,Q)}return M.container.classList.add("ql-toolbar"),M.controls=[],M.handlers={},Object.keys(M.options.handlers).forEach(function(H){M.addHandler(H,M.options.handlers[H])}),[].forEach.call(M.container.querySelectorAll("button, select"),function(H){M.attach(H)}),M.quill.on(p.default.events.EDITOR_CHANGE,function(H,j){H===p.default.events.SELECTION_CHANGE&&M.update(j)}),M.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){var H=M.quill.selection.getRange(),j=r(H,1),G=j[0];M.update(G)}),M}return a(I,[{key:"addHandler",value:function(N,M){this.handlers[N]=M}},{key:"attach",value:function(N){var M=this,D=[].find.call(N.classList,function(H){return H.indexOf("ql-")===0});if(D){if(D=D.slice(3),N.tagName==="BUTTON"&&N.setAttribute("type","button"),this.handlers[D]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[D]==null){P.warn("ignoring attaching to disabled format",D,N);return}if(f.default.query(D)==null){P.warn("ignoring attaching to nonexistent format",D,N);return}}var Q=N.tagName==="SELECT"?"change":"click";N.addEventListener(Q,function(H){var j=void 0;if(N.tagName==="SELECT"){if(N.selectedIndex<0)return;var G=N.options[N.selectedIndex];G.hasAttribute("selected")?j=!1:j=G.value||!1}else N.classList.contains("ql-active")?j=!1:j=N.value||!N.hasAttribute("value"),H.preventDefault();M.quill.focus();var B=M.quill.selection.getRange(),U=r(B,1),L=U[0];if(M.handlers[D]!=null)M.handlers[D].call(M,j);else if(f.default.query(D).prototype instanceof f.default.Embed){if(j=prompt("Enter "+D),!j)return;M.quill.updateContents(new y.default().retain(L.index).delete(L.length).insert(m({},D,j)),p.default.sources.USER)}else M.quill.format(D,j,p.default.sources.USER);M.update(L)}),this.controls.push([D,N])}}},{key:"update",value:function(N){var M=N==null?{}:this.quill.getFormat(N);this.controls.forEach(function(D){var Q=r(D,2),H=Q[0],j=Q[1];if(j.tagName==="SELECT"){var G=void 0;if(N==null)G=null;else if(M[H]==null)G=j.querySelector("option[selected]");else if(!Array.isArray(M[H])){var B=M[H];typeof B=="string"&&(B=B.replace(/\"/g,'\\"')),G=j.querySelector('option[value="'+B+'"]')}G==null?(j.value="",j.selectedIndex=-1):G.selected=!0}else if(N==null)j.classList.remove("ql-active");else if(j.hasAttribute("value")){var U=M[H]===j.getAttribute("value")||M[H]!=null&&M[H].toString()===j.getAttribute("value")||M[H]==null&&!j.getAttribute("value");j.classList.toggle("ql-active",U)}else j.classList.toggle("ql-active",M[H]!=null)})}}]),I}(_.default);q.DEFAULTS={};function v(x,I,k){var N=document.createElement("button");N.setAttribute("type","button"),N.classList.add("ql-"+I),k!=null&&(N.value=k),x.appendChild(N)}function V(x,I){Array.isArray(I[0])||(I=[I]),I.forEach(function(k){var N=document.createElement("span");N.classList.add("ql-formats"),k.forEach(function(M){if(typeof M=="string")v(N,M);else{var D=Object.keys(M)[0],Q=M[D];Array.isArray(Q)?C(N,D,Q):v(N,D,Q)}}),x.appendChild(N)})}function C(x,I,k){var N=document.createElement("select");N.classList.add("ql-"+I),k.forEach(function(M){var D=document.createElement("option");M!==!1?D.setAttribute("value",M):D.setAttribute("selected","selected"),N.appendChild(D)}),x.appendChild(N)}q.DEFAULTS={container:null,handlers:{clean:function(){var I=this,k=this.quill.getSelection();if(k!=null)if(k.length==0){var N=this.quill.getFormat();Object.keys(N).forEach(function(M){f.default.query(M,f.default.Scope.INLINE)!=null&&I.quill.format(M,!1)})}else this.quill.removeFormat(k,p.default.sources.USER)},direction:function(I){var k=this.quill.getFormat().align;I==="rtl"&&k==null?this.quill.format("align","right",p.default.sources.USER):!I&&k==="right"&&this.quill.format("align",!1,p.default.sources.USER),this.quill.format("direction",I,p.default.sources.USER)},indent:function(I){var k=this.quill.getSelection(),N=this.quill.getFormat(k),M=parseInt(N.indent||0);if(I==="+1"||I==="-1"){var D=I==="+1"?1:-1;N.direction==="rtl"&&(D*=-1),this.quill.format("indent",M+D,p.default.sources.USER)}},link:function(I){I===!0&&(I=prompt("Enter link URL:")),this.quill.format("link",I,p.default.sources.USER)},list:function(I){var k=this.quill.getSelection(),N=this.quill.getFormat(k);I==="check"?N.list==="checked"||N.list==="unchecked"?this.quill.format("list",!1,p.default.sources.USER):this.quill.format("list","unchecked",p.default.sources.USER):this.quill.format("list",I,p.default.sources.USER)}}},n.default=q,n.addControls=V},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function S(b,_){for(var E=0;E<_.length;E++){var m=_[E];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,_,E){return _&&S(b.prototype,_),E&&S(b,E),b}}(),a=function S(b,_,E){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,_);if(m===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:S(A,_,E)}else{if("value"in m)return m.value;var u=m.get;return u===void 0?void 0:u.call(E)}},c=s(28),y=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function f(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function g(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function p(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var d=function(S){p(b,S);function b(_,E){f(this,b);var m=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,_));return m.label.innerHTML=E,m.container.classList.add("ql-color-picker"),[].slice.call(m.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(A){A.classList.add("ql-primary")}),m}return r(b,[{key:"buildItem",value:function(E){var m=a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"buildItem",this).call(this,E);return m.style.backgroundColor=E.getAttribute("value")||"",m}},{key:"selectItem",value:function(E,m){a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,E,m);var A=this.label.querySelector(".ql-color-label"),u=E&&E.getAttribute("data-value")||"";A&&(A.tagName==="line"?A.style.stroke=u:A.style.fill=u)}}]),b}(y.default);n.default=d},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function S(b,_){for(var E=0;E<_.length;E++){var m=_[E];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,_,E){return _&&S(b.prototype,_),E&&S(b,E),b}}(),a=function S(b,_,E){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,_);if(m===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:S(A,_,E)}else{if("value"in m)return m.value;var u=m.get;return u===void 0?void 0:u.call(E)}},c=s(28),y=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function f(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function g(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function p(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var d=function(S){p(b,S);function b(_,E){f(this,b);var m=g(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,_));return m.container.classList.add("ql-icon-picker"),[].forEach.call(m.container.querySelectorAll(".ql-picker-item"),function(A){A.innerHTML=E[A.getAttribute("data-value")||""]}),m.defaultItem=m.container.querySelector(".ql-selected"),m.selectItem(m.defaultItem),m}return r(b,[{key:"selectItem",value:function(E,m){a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,E,m),E=E||this.defaultItem,this.label.innerHTML=E.innerHTML}}]),b}(y.default);n.default=d},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function y(w,f){for(var g=0;g<f.length;g++){var p=f[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(w,p.key,p)}}return function(w,f,g){return f&&y(w.prototype,f),g&&y(w,g),w}}();function a(y,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}var c=function(){function y(w,f){var g=this;a(this,y),this.quill=w,this.boundsContainer=f||document.body,this.root=w.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){g.root.style.marginTop=-1*g.quill.root.scrollTop+"px"}),this.hide()}return r(y,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(f){var g=f.left+f.width/2-this.root.offsetWidth/2,p=f.bottom+this.quill.root.scrollTop;this.root.style.left=g+"px",this.root.style.top=p+"px",this.root.classList.remove("ql-flip");var d=this.boundsContainer.getBoundingClientRect(),S=this.root.getBoundingClientRect(),b=0;if(S.right>d.right&&(b=d.right-S.right,this.root.style.left=g+b+"px"),S.left<d.left&&(b=d.left-S.left,this.root.style.left=g+b+"px"),S.bottom>d.bottom){var _=S.bottom-S.top,E=f.bottom-f.top+_;this.root.style.top=p-E+"px",this.root.classList.add("ql-flip")}return b}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),y}();n.default=c},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function C(x,I){var k=[],N=!0,M=!1,D=void 0;try{for(var Q=x[Symbol.iterator](),H;!(N=(H=Q.next()).done)&&(k.push(H.value),!(I&&k.length===I));N=!0);}catch(j){M=!0,D=j}finally{try{!N&&Q.return&&Q.return()}finally{if(M)throw D}}return k}return function(x,I){if(Array.isArray(x))return x;if(Symbol.iterator in Object(x))return C(x,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function C(x,I,k){x===null&&(x=Function.prototype);var N=Object.getOwnPropertyDescriptor(x,I);if(N===void 0){var M=Object.getPrototypeOf(x);return M===null?void 0:C(M,I,k)}else{if("value"in N)return N.value;var D=N.get;return D===void 0?void 0:D.call(k)}},c=function(){function C(x,I){for(var k=0;k<I.length;k++){var N=I[k];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,N.key,N)}}return function(x,I,k){return I&&C(x.prototype,I),k&&C(x,k),x}}(),y=s(3),w=A(y),f=s(8),g=A(f),p=s(43),d=A(p),S=s(27),b=A(S),_=s(15),E=s(41),m=A(E);function A(C){return C&&C.__esModule?C:{default:C}}function u(C,x){if(!(C instanceof x))throw new TypeError("Cannot call a class as a function")}function O(C,x){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:C}function P(C,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);C.prototype=Object.create(x&&x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(C,x):C.__proto__=x)}var q=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],v=function(C){P(x,C);function x(I,k){u(this,x),k.modules.toolbar!=null&&k.modules.toolbar.container==null&&(k.modules.toolbar.container=q);var N=O(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,I,k));return N.quill.container.classList.add("ql-snow"),N}return c(x,[{key:"extendToolbar",value:function(k){k.container.classList.add("ql-snow"),this.buildButtons([].slice.call(k.container.querySelectorAll("button")),m.default),this.buildPickers([].slice.call(k.container.querySelectorAll("select")),m.default),this.tooltip=new V(this.quill,this.options.bounds),k.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(N,M){k.handlers.link.call(k,!M.format.link)})}}]),x}(d.default);v.DEFAULTS=(0,w.default)(!0,{},d.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(x){if(x){var I=this.quill.getSelection();if(I==null||I.length==0)return;var k=this.quill.getText(I);/^\S+@\S+\.\S+$/.test(k)&&k.indexOf("mailto:")!==0&&(k="mailto:"+k);var N=this.quill.theme.tooltip;N.edit("link",k)}else this.quill.format("link",!1)}}}}});var V=function(C){P(x,C);function x(I,k){u(this,x);var N=O(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,I,k));return N.preview=N.root.querySelector("a.ql-preview"),N}return c(x,[{key:"listen",value:function(){var k=this;a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(N){k.root.classList.contains("ql-editing")?k.save():k.edit("link",k.preview.textContent),N.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(N){if(k.linkRange!=null){var M=k.linkRange;k.restoreFocus(),k.quill.formatText(M,"link",!1,g.default.sources.USER),delete k.linkRange}N.preventDefault(),k.hide()}),this.quill.on(g.default.events.SELECTION_CHANGE,function(N,M,D){if(N!=null){if(N.length===0&&D===g.default.sources.USER){var Q=k.quill.scroll.descendant(b.default,N.index),H=r(Q,2),j=H[0],G=H[1];if(j!=null){k.linkRange=new _.Range(N.index-G,j.length());var B=b.default.formats(j.domNode);k.preview.textContent=B,k.preview.setAttribute("href",B),k.show(),k.position(k.quill.getBounds(k.linkRange));return}}else delete k.linkRange;k.hide()}})}},{key:"show",value:function(){a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),x}(p.BaseTooltip);V.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=v},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(29),a=he(r),c=s(36),y=s(38),w=s(64),f=s(65),g=he(f),p=s(66),d=he(p),S=s(67),b=he(S),_=s(37),E=s(26),m=s(39),A=s(40),u=s(56),O=he(u),P=s(68),q=he(P),v=s(27),V=he(v),C=s(69),x=he(C),I=s(70),k=he(I),N=s(71),M=he(N),D=s(72),Q=he(D),H=s(73),j=he(H),G=s(13),B=he(G),U=s(74),L=he(U),X=s(75),K=he(X),F=s(57),Y=he(F),Z=s(41),J=he(Z),le=s(28),de=he(le),Se=s(59),ve=he(Se),Ee=s(60),be=he(Ee),Ge=s(61),Le=he(Ge),ne=s(108),ie=he(ne),ue=s(62),fe=he(ue);function he(Ce){return Ce&&Ce.__esModule?Ce:{default:Ce}}a.default.register({"attributors/attribute/direction":y.DirectionAttribute,"attributors/class/align":c.AlignClass,"attributors/class/background":_.BackgroundClass,"attributors/class/color":E.ColorClass,"attributors/class/direction":y.DirectionClass,"attributors/class/font":m.FontClass,"attributors/class/size":A.SizeClass,"attributors/style/align":c.AlignStyle,"attributors/style/background":_.BackgroundStyle,"attributors/style/color":E.ColorStyle,"attributors/style/direction":y.DirectionStyle,"attributors/style/font":m.FontStyle,"attributors/style/size":A.SizeStyle},!0),a.default.register({"formats/align":c.AlignClass,"formats/direction":y.DirectionClass,"formats/indent":w.IndentClass,"formats/background":_.BackgroundStyle,"formats/color":E.ColorStyle,"formats/font":m.FontClass,"formats/size":A.SizeClass,"formats/blockquote":g.default,"formats/code-block":B.default,"formats/header":d.default,"formats/list":b.default,"formats/bold":O.default,"formats/code":G.Code,"formats/italic":q.default,"formats/link":V.default,"formats/script":x.default,"formats/strike":k.default,"formats/underline":M.default,"formats/image":Q.default,"formats/video":j.default,"formats/list/item":S.ListItem,"modules/formula":L.default,"modules/syntax":K.default,"modules/toolbar":Y.default,"themes/bubble":ie.default,"themes/snow":fe.default,"ui/icons":J.default,"ui/picker":de.default,"ui/icon-picker":be.default,"ui/color-picker":ve.default,"ui/tooltip":Le.default},!0),n.default=a.default},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var r=function(){function b(_,E){for(var m=0;m<E.length;m++){var A=E[m];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(_,A.key,A)}}return function(_,E,m){return E&&b(_.prototype,E),m&&b(_,m),_}}(),a=function b(_,E,m){_===null&&(_=Function.prototype);var A=Object.getOwnPropertyDescriptor(_,E);if(A===void 0){var u=Object.getPrototypeOf(_);return u===null?void 0:b(u,E,m)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(m)}},c=s(0),y=w(c);function w(b){return b&&b.__esModule?b:{default:b}}function f(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function g(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var d=function(b){p(_,b);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return r(_,[{key:"add",value:function(m,A){if(A==="+1"||A==="-1"){var u=this.value(m)||0;A=A==="+1"?u+1:u-1}return A===0?(this.remove(m),!0):a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"add",this).call(this,m,A)}},{key:"canAdd",value:function(m,A){return a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"canAdd",this).call(this,m,A)||a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"canAdd",this).call(this,m,parseInt(A))}},{key:"value",value:function(m){return parseInt(a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"value",this).call(this,m))||void 0}}]),_}(y.default.Attributor.Class),S=new d("indent","ql-indent",{scope:y.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=S},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(4),a=c(r);function c(p){return p&&p.__esModule?p:{default:p}}function y(p,d){if(!(p instanceof d))throw new TypeError("Cannot call a class as a function")}function w(p,d){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:p}function f(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(p,d):p.__proto__=d)}var g=function(p){f(d,p);function d(){return y(this,d),w(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);g.blotName="blockquote",g.tagName="blockquote",n.default=g},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function d(S,b){for(var _=0;_<b.length;_++){var E=b[_];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}return function(S,b,_){return b&&d(S.prototype,b),_&&d(S,_),S}}(),a=s(4),c=y(a);function y(d){return d&&d.__esModule?d:{default:d}}function w(d,S){if(!(d instanceof S))throw new TypeError("Cannot call a class as a function")}function f(d,S){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:d}function g(d,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);d.prototype=Object.create(S&&S.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(d,S):d.__proto__=S)}var p=function(d){g(S,d);function S(){return w(this,S),f(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return r(S,null,[{key:"formats",value:function(_){return this.tagName.indexOf(_.tagName)+1}}]),S}(c.default);p.blotName="header",p.tagName=["H1","H2","H3","H4","H5","H6"],n.default=p},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var r=function(){function u(O,P){for(var q=0;q<P.length;q++){var v=P[q];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(O,v.key,v)}}return function(O,P,q){return P&&u(O.prototype,P),q&&u(O,q),O}}(),a=function u(O,P,q){O===null&&(O=Function.prototype);var v=Object.getOwnPropertyDescriptor(O,P);if(v===void 0){var V=Object.getPrototypeOf(O);return V===null?void 0:u(V,P,q)}else{if("value"in v)return v.value;var C=v.get;return C===void 0?void 0:C.call(q)}},c=s(0),y=d(c),w=s(4),f=d(w),g=s(25),p=d(g);function d(u){return u&&u.__esModule?u:{default:u}}function S(u,O,P){return O in u?Object.defineProperty(u,O,{value:P,enumerable:!0,configurable:!0,writable:!0}):u[O]=P,u}function b(u,O){if(!(u instanceof O))throw new TypeError("Cannot call a class as a function")}function _(u,O){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:u}function E(u,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);u.prototype=Object.create(O&&O.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(u,O):u.__proto__=O)}var m=function(u){E(O,u);function O(){return b(this,O),_(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return r(O,[{key:"format",value:function(q,v){q===A.blotName&&!v?this.replaceWith(y.default.create(this.statics.scope)):a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,q,v)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(q,v){return this.parent.isolate(this.offset(this.parent),this.length()),q===this.parent.statics.blotName?(this.parent.replaceWith(q,v),this):(this.parent.unwrap(),a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,q,v))}}],[{key:"formats",value:function(q){return q.tagName===this.tagName?void 0:a(O.__proto__||Object.getPrototypeOf(O),"formats",this).call(this,q)}}]),O}(f.default);m.blotName="list-item",m.tagName="LI";var A=function(u){E(O,u),r(O,null,[{key:"create",value:function(q){var v=q==="ordered"?"OL":"UL",V=a(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,v);return(q==="checked"||q==="unchecked")&&V.setAttribute("data-checked",q==="checked"),V}},{key:"formats",value:function(q){if(q.tagName==="OL")return"ordered";if(q.tagName==="UL")return q.hasAttribute("data-checked")?q.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function O(P){b(this,O);var q=_(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,P)),v=function(C){if(C.target.parentNode===P){var x=q.statics.formats(P),I=y.default.find(C.target);x==="checked"?I.format("list","unchecked"):x==="unchecked"&&I.format("list","checked")}};return P.addEventListener("touchstart",v),P.addEventListener("mousedown",v),q}return r(O,[{key:"format",value:function(q,v){this.children.length>0&&this.children.tail.format(q,v)}},{key:"formats",value:function(){return S({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(q,v){if(q instanceof m)a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,q,v);else{var V=v==null?this.length():v.offset(this),C=this.split(V);C.parent.insertBefore(q,C)}}},{key:"optimize",value:function(q){a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,q);var v=this.next;v!=null&&v.prev===this&&v.statics.blotName===this.statics.blotName&&v.domNode.tagName===this.domNode.tagName&&v.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(v.moveChildren(this),v.remove())}},{key:"replace",value:function(q){if(q.statics.blotName!==this.statics.blotName){var v=y.default.create(this.statics.defaultChild);q.moveChildren(v),this.appendChild(v)}a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,q)}}]),O}(p.default);A.blotName="list",A.scope=y.default.Scope.BLOCK_BLOT,A.tagName=["OL","UL"],A.defaultChild="list-item",A.allowedChildren=[m],n.ListItem=m,n.default=A},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(56),a=c(r);function c(p){return p&&p.__esModule?p:{default:p}}function y(p,d){if(!(p instanceof d))throw new TypeError("Cannot call a class as a function")}function w(p,d){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:p}function f(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(p,d):p.__proto__=d)}var g=function(p){f(d,p);function d(){return y(this,d),w(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);g.blotName="italic",g.tagName=["EM","I"],n.default=g},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function S(b,_){for(var E=0;E<_.length;E++){var m=_[E];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,_,E){return _&&S(b.prototype,_),E&&S(b,E),b}}(),a=function S(b,_,E){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,_);if(m===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:S(A,_,E)}else{if("value"in m)return m.value;var u=m.get;return u===void 0?void 0:u.call(E)}},c=s(6),y=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function f(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function g(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function p(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var d=function(S){p(b,S);function b(){return f(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return r(b,null,[{key:"create",value:function(E){return E==="super"?document.createElement("sup"):E==="sub"?document.createElement("sub"):a(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,E)}},{key:"formats",value:function(E){if(E.tagName==="SUB")return"sub";if(E.tagName==="SUP")return"super"}}]),b}(y.default);d.blotName="script",d.tagName=["SUB","SUP"],n.default=d},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(6),a=c(r);function c(p){return p&&p.__esModule?p:{default:p}}function y(p,d){if(!(p instanceof d))throw new TypeError("Cannot call a class as a function")}function w(p,d){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:p}function f(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(p,d):p.__proto__=d)}var g=function(p){f(d,p);function d(){return y(this,d),w(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);g.blotName="strike",g.tagName="S",n.default=g},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=s(6),a=c(r);function c(p){return p&&p.__esModule?p:{default:p}}function y(p,d){if(!(p instanceof d))throw new TypeError("Cannot call a class as a function")}function w(p,d){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:p}function f(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(p,d):p.__proto__=d)}var g=function(p){f(d,p);function d(){return y(this,d),w(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);g.blotName="underline",g.tagName="U",n.default=g},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function _(E,m){for(var A=0;A<m.length;A++){var u=m[A];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(E,u.key,u)}}return function(E,m,A){return m&&_(E.prototype,m),A&&_(E,A),E}}(),a=function _(E,m,A){E===null&&(E=Function.prototype);var u=Object.getOwnPropertyDescriptor(E,m);if(u===void 0){var O=Object.getPrototypeOf(E);return O===null?void 0:_(O,m,A)}else{if("value"in u)return u.value;var P=u.get;return P===void 0?void 0:P.call(A)}},c=s(0),y=f(c),w=s(27);function f(_){return _&&_.__esModule?_:{default:_}}function g(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function p(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function d(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var S=["alt","height","width"],b=function(_){d(E,_);function E(){return g(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return r(E,[{key:"format",value:function(A,u){S.indexOf(A)>-1?u?this.domNode.setAttribute(A,u):this.domNode.removeAttribute(A):a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"format",this).call(this,A,u)}}],[{key:"create",value:function(A){var u=a(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,A);return typeof A=="string"&&u.setAttribute("src",this.sanitize(A)),u}},{key:"formats",value:function(A){return S.reduce(function(u,O){return A.hasAttribute(O)&&(u[O]=A.getAttribute(O)),u},{})}},{key:"match",value:function(A){return/\.(jpe?g|gif|png)$/.test(A)||/^data:image\/.+;base64/.test(A)}},{key:"sanitize",value:function(A){return(0,w.sanitize)(A,["http","https","data"])?A:"//:0"}},{key:"value",value:function(A){return A.getAttribute("src")}}]),E}(y.default.Embed);b.blotName="image",b.tagName="IMG",n.default=b},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function _(E,m){for(var A=0;A<m.length;A++){var u=m[A];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(E,u.key,u)}}return function(E,m,A){return m&&_(E.prototype,m),A&&_(E,A),E}}(),a=function _(E,m,A){E===null&&(E=Function.prototype);var u=Object.getOwnPropertyDescriptor(E,m);if(u===void 0){var O=Object.getPrototypeOf(E);return O===null?void 0:_(O,m,A)}else{if("value"in u)return u.value;var P=u.get;return P===void 0?void 0:P.call(A)}},c=s(4),y=s(27),w=f(y);function f(_){return _&&_.__esModule?_:{default:_}}function g(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function p(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function d(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var S=["height","width"],b=function(_){d(E,_);function E(){return g(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return r(E,[{key:"format",value:function(A,u){S.indexOf(A)>-1?u?this.domNode.setAttribute(A,u):this.domNode.removeAttribute(A):a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"format",this).call(this,A,u)}}],[{key:"create",value:function(A){var u=a(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,A);return u.setAttribute("frameborder","0"),u.setAttribute("allowfullscreen",!0),u.setAttribute("src",this.sanitize(A)),u}},{key:"formats",value:function(A){return S.reduce(function(u,O){return A.hasAttribute(O)&&(u[O]=A.getAttribute(O)),u},{})}},{key:"sanitize",value:function(A){return w.default.sanitize(A)}},{key:"value",value:function(A){return A.getAttribute("src")}}]),E}(c.BlockEmbed);b.blotName="video",b.className="ql-video",b.tagName="IFRAME",n.default=b},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var r=function(){function A(u,O){for(var P=0;P<O.length;P++){var q=O[P];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(u,q.key,q)}}return function(u,O,P){return O&&A(u.prototype,O),P&&A(u,P),u}}(),a=function A(u,O,P){u===null&&(u=Function.prototype);var q=Object.getOwnPropertyDescriptor(u,O);if(q===void 0){var v=Object.getPrototypeOf(u);return v===null?void 0:A(v,O,P)}else{if("value"in q)return q.value;var V=q.get;return V===void 0?void 0:V.call(P)}},c=s(35),y=d(c),w=s(5),f=d(w),g=s(9),p=d(g);function d(A){return A&&A.__esModule?A:{default:A}}function S(A,u){if(!(A instanceof u))throw new TypeError("Cannot call a class as a function")}function b(A,u){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:A}function _(A,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);A.prototype=Object.create(u&&u.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(A,u):A.__proto__=u)}var E=function(A){_(u,A);function u(){return S(this,u),b(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return r(u,null,[{key:"create",value:function(P){var q=a(u.__proto__||Object.getPrototypeOf(u),"create",this).call(this,P);return typeof P=="string"&&(window.katex.render(P,q,{throwOnError:!1,errorColor:"#f00"}),q.setAttribute("data-value",P)),q}},{key:"value",value:function(P){return P.getAttribute("data-value")}}]),u}(y.default);E.blotName="formula",E.className="ql-formula",E.tagName="SPAN";var m=function(A){_(u,A),r(u,null,[{key:"register",value:function(){f.default.register(E,!0)}}]);function u(){S(this,u);var O=b(this,(u.__proto__||Object.getPrototypeOf(u)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return O}return u}(p.default);n.FormulaBlot=E,n.default=m},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var r=function(){function P(q,v){for(var V=0;V<v.length;V++){var C=v[V];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(q,C.key,C)}}return function(q,v,V){return v&&P(q.prototype,v),V&&P(q,V),q}}(),a=function P(q,v,V){q===null&&(q=Function.prototype);var C=Object.getOwnPropertyDescriptor(q,v);if(C===void 0){var x=Object.getPrototypeOf(q);return x===null?void 0:P(x,v,V)}else{if("value"in C)return C.value;var I=C.get;return I===void 0?void 0:I.call(V)}},c=s(0),y=b(c),w=s(5),f=b(w),g=s(9),p=b(g),d=s(13),S=b(d);function b(P){return P&&P.__esModule?P:{default:P}}function _(P,q){if(!(P instanceof q))throw new TypeError("Cannot call a class as a function")}function E(P,q){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return q&&(typeof q=="object"||typeof q=="function")?q:P}function m(P,q){if(typeof q!="function"&&q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof q);P.prototype=Object.create(q&&q.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),q&&(Object.setPrototypeOf?Object.setPrototypeOf(P,q):P.__proto__=q)}var A=function(P){m(q,P);function q(){return _(this,q),E(this,(q.__proto__||Object.getPrototypeOf(q)).apply(this,arguments))}return r(q,[{key:"replaceWith",value:function(V){this.domNode.textContent=this.domNode.textContent,this.attach(),a(q.prototype.__proto__||Object.getPrototypeOf(q.prototype),"replaceWith",this).call(this,V)}},{key:"highlight",value:function(V){var C=this.domNode.textContent;this.cachedText!==C&&((C.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=V(C),this.domNode.normalize(),this.attach()),this.cachedText=C)}}]),q}(S.default);A.className="ql-syntax";var u=new y.default.Attributor.Class("token","hljs",{scope:y.default.Scope.INLINE}),O=function(P){m(q,P),r(q,null,[{key:"register",value:function(){f.default.register(u,!0),f.default.register(A,!0)}}]);function q(v,V){_(this,q);var C=E(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,v,V));if(typeof C.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var x=null;return C.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(x),x=setTimeout(function(){C.highlight(),x=null},C.options.interval)}),C.highlight(),C}return r(q,[{key:"highlight",value:function(){var V=this;if(!this.quill.selection.composing){this.quill.update(f.default.sources.USER);var C=this.quill.getSelection();this.quill.scroll.descendants(A).forEach(function(x){x.highlight(V.options.highlight)}),this.quill.update(f.default.sources.SILENT),C!=null&&this.quill.setSelection(C,f.default.sources.SILENT)}}}]),q}(p.default);O.DEFAULTS={highlight:function(){return window.hljs==null?null:function(P){var q=window.hljs.highlightAuto(P);return q.value}}(),interval:1e3},n.CodeBlock=A,n.CodeToken=u,n.default=O},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(i,n){i.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(i,n){i.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(i,n){i.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(i,n){i.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(i,n){i.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(i,n,s){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var r=function q(v,V,C){v===null&&(v=Function.prototype);var x=Object.getOwnPropertyDescriptor(v,V);if(x===void 0){var I=Object.getPrototypeOf(v);return I===null?void 0:q(I,V,C)}else{if("value"in x)return x.value;var k=x.get;return k===void 0?void 0:k.call(C)}},a=function(){function q(v,V){for(var C=0;C<V.length;C++){var x=V[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,x.key,x)}}return function(v,V,C){return V&&q(v.prototype,V),C&&q(v,C),v}}(),c=s(3),y=_(c),w=s(8),f=_(w),g=s(43),p=_(g),d=s(15),S=s(41),b=_(S);function _(q){return q&&q.__esModule?q:{default:q}}function E(q,v){if(!(q instanceof v))throw new TypeError("Cannot call a class as a function")}function m(q,v){if(!q)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:q}function A(q,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);q.prototype=Object.create(v&&v.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(q,v):q.__proto__=v)}var u=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],O=function(q){A(v,q);function v(V,C){E(this,v),C.modules.toolbar!=null&&C.modules.toolbar.container==null&&(C.modules.toolbar.container=u);var x=m(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,V,C));return x.quill.container.classList.add("ql-bubble"),x}return a(v,[{key:"extendToolbar",value:function(C){this.tooltip=new P(this.quill,this.options.bounds),this.tooltip.root.appendChild(C.container),this.buildButtons([].slice.call(C.container.querySelectorAll("button")),b.default),this.buildPickers([].slice.call(C.container.querySelectorAll("select")),b.default)}}]),v}(p.default);O.DEFAULTS=(0,y.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(v){v?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var P=function(q){A(v,q);function v(V,C){E(this,v);var x=m(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,V,C));return x.quill.on(f.default.events.EDITOR_CHANGE,function(I,k,N,M){if(I===f.default.events.SELECTION_CHANGE)if(k!=null&&k.length>0&&M===f.default.sources.USER){x.show(),x.root.style.left="0px",x.root.style.width="",x.root.style.width=x.root.offsetWidth+"px";var D=x.quill.getLines(k.index,k.length);if(D.length===1)x.position(x.quill.getBounds(k));else{var Q=D[D.length-1],H=x.quill.getIndex(Q),j=Math.min(Q.length()-1,k.index+k.length-H),G=x.quill.getBounds(new d.Range(H,j));x.position(G)}}else document.activeElement!==x.textbox&&x.quill.hasFocus()&&x.hide()}),x}return a(v,[{key:"listen",value:function(){var C=this;r(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){C.root.classList.remove("ql-editing")}),this.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!C.root.classList.contains("ql-hidden")){var x=C.quill.getSelection();x!=null&&C.position(C.quill.getBounds(x))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(C){var x=r(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"position",this).call(this,C),I=this.root.querySelector(".ql-tooltip-arrow");if(I.style.marginLeft="",x===0)return x;I.style.marginLeft=-1*x-I.offsetWidth/2+"px"}}]),v}(g.BaseTooltip);P.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=P,n.default=O},function(i,n,s){i.exports=s(63)}]).default})})(vu);var Pw=vu.exports;const ar=Po(Pw),qw={emits:["input","editorReady"],props:{content:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},editorHeight:{required:!1,type:String,default:"5.8rem"},counterStyle:{required:!1,type:String,default:"none"},labelHeight:{required:!1,type:String,default:"6.7rem"},disabled:Boolean},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},colorStyle(){return W.getItemContextPnp().getColorStyle()},style(){return{"font-family":"inherit","font-size":"inherit","line-height":"inherit",height:this.editorHeight,minHeight:void 0}},styleLabel(){return{"font-family":"inherit","font-size":"inherit","line-height":"inherit",height:this.labelHeight,minHeight:void 0}},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"}},watch:{content(){this.setEditorContent()},disabled(){this.toggleEditorDisabled()}},data(){return{quill:void 0,counter:0}},methods:{setEditorContent(){this.$el&&(this.quill.off("text-change",this.textChangeHandler),this.$refs.editor.children[0].innerHTML=this.content,this.updateCounter(this.getLength()),this.quill.on("text-change",this.textChangeHandler))},toggleEditorDisabled(){if(this.disabled){this.$refs.label.innerHTML=this.content,this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.editor.classList.add("qti-hidden");const e=this.$refs.root.querySelector(".ql-toolbar");e!==null&&e.classList.add("qti-hidden")}else{this.$refs.label.innerHTML="",this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.editor.classList.remove("qti-hidden");const e=this.$refs.root.querySelector(".ql-toolbar");e!==null&&e.classList.remove("qti-hidden")}},initialize(){if(this.$el){let e=ar.import("ui/icons");e.undo=`<svg viewbox="0 0 18 18">
150
+ <polygon class="ql-fill ql-stroke" points="6 10 4 12 2 10 6 10"></polygon>
151
+ <path class="ql-stroke" d="M8.09,13.91A4.6,4.6,0,0,0,9,14,5,5,0,1,0,4,9"></path>
152
+ </svg>`,e.redo=`<svg viewbox="0 0 18 18">
153
+ <polygon class="ql-fill ql-stroke" points="12 10 14 12 16 10 12 10"></polygon>
154
+ <path class="ql-stroke" d="M9.91,13.91A4.6,4.6,0,0,1,9,14a5,5,0,1,1,5-5"></path>
155
+ </svg>`;let t=this;const i={theme:"snow",boundary:"div.qti-extended-text-interaction",modules:{toolbar:{container:[["undo","redo"],["bold","italic","underline"],["blockquote"],[{list:"ordered"},{list:"bullet"}]],handlers:{redo(){t.quill.history.redo()},undo(){t.quill.history.undo()}}},history:{delay:2e3,maxStack:100,userOnly:!1},keyboard:{bindings:{tab:{key:9,handler:function(){return!0}}}}},placeholder:this.placeholder,readOnly:!1};this.quill=new ar(this.$refs.editor,i),this.quill.on("text-change",this.textChangeHandler),this.updateCounter(this.getLength()),this.quill.enable(!0)}},textChangeHandler(){let e=this.getText(),t=this.$refs.editor.children[0].innerHTML,i=this.getLength();if(this.expectedLength&&i>this.expectedLength){this.quill.deleteText(this.expectedLength,i);return}t==="<p><br></p>"&&(t=""),this.updateCounter(this.getLength()),this.$emit("input",{html:t,text:e})},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}},getLength(){return this.quill.getLength()-1},getText(){return this.quill.getText()}},mounted(){this.initialize(),this.$emit("editorReady",{node:this})},beforeUnmount(){this.$el.remove(),this.quill=void 0}},Bw={ref:"root",class:"quill-editor"},Dw={key:0,"aria-hidden":"true",class:"ext-text-editor-counter"},Qw={key:0};function Hw(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Bw,[l.createElementVNode("div",{ref:"label",style:l.normalizeStyle(r.styleLabel),class:"ext-text-xhtml-default-label qti-hidden"},null,4),l.createElementVNode("div",{ref:"editor",style:l.normalizeStyle(r.style)},null,4),r.showCounter?(l.openBlock(),l.createElementBlock("div",Dw,[l.createTextVNode(l.toDisplayString(s.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",Qw," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],512)}const Fw={name:"ExtendedTextXhtmlDefault",emits:["extendedTextReady","extendedTextUpdate"],components:{EditorQuill:te(qw,[["render",Hw]])},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},heightClass:{required:!1,type:String,default:""},counterStyle:{required:!1,type:String,default:"none"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength:"400"},colorStyle(){return W.getItemContextPnp().getColorStyle()},editorHeight(){return this.heightClass==="qti-height-lines-15"?"22.9rem":this.heightClass==="qti-height-lines-6"?"10.1rem":this.heightClass==="sbac-height-lines-95"?"136.6rem":"5.8rem"},labelHeight(){return this.heightClass==="qti-height-lines-15"?"29.4rem":this.heightClass==="qti-height-lines-6"?"12.1rem":this.heightClass==="sbac-height-lines-95"?"29.4rem":"6.4rem"},maxLength(){return 1e4},disabled(){return this.isDisabled}},data(){return{response:"",content:"",state:null,editor:null,isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e){if(e===null){this.response="",this.setContent("");return}this.setContent(e),this.response=e},updateResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getContent(){return this.content},setContent(e){this.content=e},computeState(e){return{text:e}},setIsDisabled(e){this.isDisabled=e},handleInput(e){e.html&&(this.updateResponse(e.html),this.setState(this.computeState(e.text)),this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()}))},handleEditorReady(e){this.node=e.node,this.$parent.$emit("extendedTextReady",{node:this})}},mounted(){}},Uw={ref:"root"};function Gw(e,t,i,n,s,r){const a=l.resolveComponent("EditorQuill");return l.openBlock(),l.createElementBlock("div",Uw,[l.createVNode(a,{ref:"editor",content:s.content,placeholder:i.placeholder,editorHeight:r.editorHeight,labelHeight:r.labelHeight,counterStyle:i.counterStyle,expectedLength:r.computedExpectedLength,disabled:r.disabled,onInput:r.handleInput,onEditorReady:r.handleEditorReady},null,8,["content","placeholder","editorHeight","labelHeight","counterStyle","expectedLength","disabled","onInput","onEditorReady"])],512)}const jw=te(Fw,[["render",Gw]]),Ww={emits:["input","editorReady"],props:{content:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},editorHeight:{required:!1,type:String,default:"6.2rem"},counterStyle:{required:!1,type:String,default:"none"},labelHeight:{required:!1,type:String,default:"6.7rem"},disabled:Boolean},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},colorStyle(){return W.getItemContextPnp().getColorStyle()},style(){return{"font-family":"inherit","font-size":"inherit","line-height":"inherit",width:this.editorHeight,minWidth:void 0}},styleLabel(){return{"font-family":"inherit","font-size":"inherit","line-height":"inherit",width:this.labelHeight,minWidth:void 0}},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"}},watch:{content(){this.setEditorContent()},disabled(){this.toggleEditorDisabled()}},data(){return{quill:void 0,counter:0}},methods:{setEditorContent(){this.$el&&(this.quill.off("text-change",this.textChangeHandler),this.$refs.editor.children[0].innerHTML=this.content,this.updateCounter(this.getLength()),this.quill.on("text-change",this.textChangeHandler))},toggleEditorDisabled(){if(this.disabled){this.$refs.label.innerHTML=this.content,this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.editor.classList.add("qti-hidden");const e=this.$refs.root.querySelector(".ql-toolbar");e!==null&&e.classList.add("qti-hidden")}else{this.$refs.label.innerHTML="",this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.editor.classList.remove("qti-hidden");const e=this.$refs.root.querySelector(".ql-toolbar");e!==null&&e.classList.remove("qti-hidden")}},initialize(){if(this.$el){let e=ar.import("ui/icons");e.undo=`<svg viewbox="0 0 18 18">
156
+ <polygon class="ql-fill ql-stroke" points="6 10 4 12 2 10 6 10"></polygon>
157
+ <path class="ql-stroke" d="M8.09,13.91A4.6,4.6,0,0,0,9,14,5,5,0,1,0,4,9"></path>
158
+ </svg>`,e.redo=`<svg viewbox="0 0 18 18">
159
+ <polygon class="ql-fill ql-stroke" points="12 10 14 12 16 10 12 10"></polygon>
160
+ <path class="ql-stroke" d="M9.91,13.91A4.6,4.6,0,0,1,9,14a5,5,0,1,1,5-5"></path>
161
+ </svg>`;let t=this;const i={theme:"snow",boundary:"div.qti-extended-text-interaction",modules:{toolbar:{container:[["undo","redo"],["bold","italic","underline"],["blockquote"],[{list:"ordered"},{list:"bullet"}]],handlers:{redo(){t.quill.history.redo()},undo(){t.quill.history.undo()}}},history:{delay:2e3,maxStack:100,userOnly:!1},keyboard:{bindings:{tab:{key:9,handler:function(){return!0}}}}},placeholder:this.placeholder,readOnly:!1};this.quill=new ar(this.$refs.editor,i),this.quill.root.setAttribute("spellcheck",!1),this.quill.on("text-change",this.textChangeHandler),this.updateCounter(this.getLength()),this.quill.enable(!0)}},setQuillEditorStyleProperties(){this.$refs.editor!=null&&this.$refs.editor.children!=null&&this.$refs.editor.children.length>0&&(this.$refs.editor.children[0].style=`width:${this.editorHeight};overflow-x:auto;`)},textChangeHandler(){let e=this.getText(),t=this.$refs.editor.children[0].innerHTML,i=this.getLength();if(this.expectedLength&&i>this.expectedLength){this.quill.deleteText(this.expectedLength,i);return}t==="<p><br></p>"&&(t=""),this.updateCounter(this.getLength()),this.$emit("input",{html:t,text:e})},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}},getLength(){return this.quill.getLength()-1},getText(){return this.quill.getText()}},mounted(){this.initialize(),this.setQuillEditorStyleProperties(),this.$emit("editorReady",{node:this})},beforeUnmount(){this.$el.remove(),this.quill=void 0}},zw={ref:"root",class:"quill-editor vertical-rl"},Kw={key:0,"aria-hidden":"true",class:"ext-text-xhtml-vert-rl-counter"},Yw={key:0};function Xw(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",zw,[l.createElementVNode("div",{ref:"label",style:l.normalizeStyle(r.styleLabel),class:"ext-text-xhtml-vert-label qti-hidden"},null,4),l.createElementVNode("div",{ref:"editor",style:l.normalizeStyle(r.style)},null,4),r.showCounter?(l.openBlock(),l.createElementBlock("div",Kw,[l.createTextVNode(l.toDisplayString(s.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",Yw," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],512)}const Zw={name:"ExtendedTextXhtmlVerticalRl",components:{EditorQuillVerticalRl:te(Ww,[["render",Xw]])},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},heightClass:{required:!1,type:String,default:""},counterStyle:{required:!1,type:String,default:"none"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength:"400"},colorStyle(){return W.getItemContextPnp().getColorStyle()},editorHeight(){return this.heightClass==="qti-height-lines-15"?"25.9rem":this.heightClass==="qti-height-lines-6"?"11.5rem":"6.7rem"},labelHeight(){return this.heightClass==="qti-height-lines-15"?"29.7rem":this.heightClass==="qti-height-lines-6"?"12.3rem":"6.6rem"},maxLength(){return 1e4},disabled(){return this.isDisabled}},data(){return{response:"",content:"",state:null,editor:null,isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e){if(e===null){this.response="",this.setContent("");return}this.setContent(e),this.response=e},updateResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getContent(){return this.content},setContent(e){this.content=e},computeState(e){return{text:e}},setIsDisabled(e){this.isDisabled=e},handleInput(e){e.html&&(this.updateResponse(e.html),this.setState(this.computeState(e.text)),this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()}))},handleEditorReady(e){this.node=e.node,this.$parent.$emit("extendedTextReady",{node:this})}},mounted(){}},Jw={ref:"root"};function eb(e,t,i,n,s,r){const a=l.resolveComponent("EditorQuillVerticalRl");return l.openBlock(),l.createElementBlock("div",Jw,[l.createVNode(a,{content:s.content,placeholder:i.placeholder,editorHeight:r.editorHeight,labelHeight:r.labelHeight,counterStyle:i.counterStyle,expectedLength:r.computedExpectedLength,disabled:r.disabled,onInput:r.handleInput,onEditorReady:r.handleEditorReady},null,8,["content","placeholder","editorHeight","labelHeight","counterStyle","expectedLength","disabled","onInput","onEditorReady"])],512)}const tb=te(Zw,[["render",eb]]),Ct={DEFAULT:"default-plain",DEFAULT_SBAC:"sbac-plain",DEFAULT_LRN:"lrn-plain",DEFAULT_VERTICAL_RL:"vertical-rl-plain",XHTML_DEFAULT:"default-xhtml",XHTML_SBAC:"sbac-xhtml",XHTML_VERTICAL_RL:"vertical-rl-xhtml"};function ib(e,t,i){switch(e){case Ct.XHTML_DEFAULT:case Ct.XHTML_SBAC:return{template:'<extended-text-xhtml-default response-identifier="'+t.responseIdentifier+'" '+Wn(t)+Un(t)+Gn(t)+jn(t)+zn(t)+Kn(t)+Yn(i)+" />",components:{ExtendedTextXhtmlDefault:jw}};case Ct.DEFAULT_LRN:return{template:'<extended-text-plain-lrn response-identifier="'+t.responseIdentifier+'" '+Wn(t)+Un(t)+Gn(t)+jn(t)+zn(t)+Kn(t)+Yn(i)+" />",components:{ExtendedTextPlainLrn:Iw}};case Ct.DEFAULT_VERTICAL_RL:return{template:'<extended-text-plain-vertical-rl response-identifier="'+t.responseIdentifier+'" '+Wn(t)+Un(t)+Gn(t)+jn(t)+zn(t)+Kn(t)+Yn(i)+" />",components:{ExtendedTextPlainVerticalRl:Nw}};case Ct.XHTML_VERTICAL_RL:return{template:'<extended-text-xhtml-vertical-rl response-identifier="'+t.responseIdentifier+'" '+Wn(t)+Un(t)+Gn(t)+jn(t)+zn(t)+Kn(t)+Yn(i)+" />",components:{ExtendedTextXhtmlVerticalRl:tb}};default:return{template:'<extended-text-plain-default response-identifier="'+t.responseIdentifier+'" '+Wn(t)+Un(t)+Gn(t)+jn(t)+zn(t)+Kn(t)+Yn(i)+" />",components:{ExtendedTextPlainDefault:gw}}}}function nb(e,t){const i=sb(e);if(i&&t==="plain")return Ct.DEFAULT_SBAC;if(i&&t==="xhtml")return Ct.XHTML_DEFAULT;if(rb(e)&&t==="plain")return Ct.DEFAULT_LRN;const s=ab(e);return s&&t==="plain"?Ct.DEFAULT_VERTICAL_RL:s&&t==="xhtml"?Ct.XHTML_VERTICAL_RL:t==="plain"?Ct.DEFAULT:t==="xhtml"?Ct.XHTML_DEFAULT:Ct.DEFAULT}function Un(e){return typeof e.patternMask>"u"?"":'pattern-mask="'+e.patternMask+'" '}function Gn(e){return'pattern-mask-message="'+e.patternMaskMessage+'" '}function jn(e){return'placeholder="'+e.placeholder+'" '}function Wn(e){return typeof e.expectedLength>"u"?"":'expected-length="'+e.expectedLength+'" '}function zn(e){return typeof e.heightClass>"u"?"":'height-class="'+e.heightClass+'" '}function Kn(e){return typeof e.counterStyle>"u"?"none":'counter-style="'+e.counterStyle+'" '}function Yn(e){let t="";for(const[i,n]of Object.entries(e))t+=`${i}="${n}" `;return t}function sb(e){return typeof e>"u"||e===null||e.length==0?!1:La("sbac",e)}function rb(e){return typeof e>"u"||e===null||e.length==0?!1:La("lrn",e)}function ab(e){return typeof e>"u"||e===null||e.length==0?!1:La("qti-writing-orientation-vertical-rl",e)}function La(e,t){const i=t.split(" ");for(let n=0;n<i.length;n++)if(i[n]===e)return!0;return!1}const Xn=new re,ob=new me,lb={name:"QtiExtendedTextInteraction",props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},patternMask:{required:!1,type:String},placeholderText:{required:!1,type:String},format:{required:!1,type:String,default:"plain"},dataPatternmaskMessage:{required:!1,type:String},minStrings:{required:!1,type:String,default:"0"},maxStrings:{required:!1,type:String,default:"0"}},computed:{interactionTemplate(){return ib(this.interactionSubType,this.createComponentProperties(),this.$attrs)},placeholder(){return Xn.validatePlaceholderText(this.placeholderText,"")},hasPatternMask(){return typeof this.patternMask<"u"},patternMaskMessage(){return Xn.validatePatternmaskMessage(this.dataPatternmaskMessage,"Invalid Input")}},data(){return{response:"",state:null,baseType:"string",cardinality:"single",interactionSubType:null,isValidResponse:!1,invalidResponseMessage:"Input Required",classAttribute:"",isDisabled:!1,isQtiValid:!0,hasPrompts:!1,presentationFactory:null,node:null,priorState:null}},methods:{getResponse(){return this.response.length===0?null:this.response},setResponse(e){e===null?this.response="":this.response=e,this.node.setResponse(this.response,!0)},updateResponse(e){e===null?this.response="":this.response=e},getState(){return this.state},setState(e){this.state=e,this.node.setState(this.state,!0)},updateState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},setInteractionSubType(e){this.interactionSubType=e},getInteractionSubType(){return this.interactionSubType},disable(){this.toggleDisable(!0)},enable(){this.toggleDisable(!1)},toggleDisable(e){this.isDisabled=e,this.node.setIsDisabled(e)},getInvalidResponseMessage(){return this.invalidResponseMessage},initializeValue(){this.setResponse(null),this.setState(this.computeState()),this.setIsValid(this.computeIsValid())},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.setResponse(null),this.setState(this.computeState()),this.setIsValid(this.computeIsValid())},restoreValue(e){this.setResponse(e.value),this.setState(e.state),this.updateValidity(this.computeIsValid())},getCardinality(){return this.cardinality},computeState(){return{}},computeIsValid(){const e=this.minStrings*1;if(e===0)return!0;if(this.response===null)return!1;const t=this.response.trim();return!(t.length<1||ob.computeWordCount(t)<e)},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},detectInteractionSubType(e,t){return nb(e,t)},createComponentProperties(){return{responseIdentifier:this.responseIdentifier,expectedLength:this.presentationFactory.getExpectedLength(),placeholder:this.placeholder,patternMask:this.patternMask,patternMaskMessage:this.patternMaskMessage,heightClass:this.presentationFactory.getHeightClass(),counterStyle:this.presentationFactory.getCounterStyle()}},handleExtendedTextUpdate(e){this.updateResponse(e.response),"state"in e&&this.updateState(e.state),this.evaluateValidity()},handleExtendedTextReady(e){this.node=e.node,this.priorState===null?this.initializeValue():this.restoreValue(this.priorState)},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Extended Text Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Extended Text Interaction State Invalid. "state" property not found.');return t}},created(){try{this.responseDeclaration=Xn.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.setInteractionSubType(this.detectInteractionSubType(this.$.vnode.props.class,this.format)),this.presentationFactory=new _y(this.$.vnode.props.class,this.expectedLength),Xn.validateMaxMinStrings(this.maxStrings,this.minStrings),this.priorState=this.getPriorState(this.responseIdentifier),this.cardinality=this.getCardinality(),this.hasPrompts=this.getPrompts(this.$slots).length>0,this.appliedRegex=Xn.validatePattern("pattern-mask",this.patternMask)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{W.defineInteraction({identifier:this.responseIdentifier,interactionType:"ExtendedText",interactionSubType:this.interactionSubType,node:this,resetValue:this.resetValue,isValidResponse:this.isValidResponse,invalidResponseMessage:this.getInvalidResponseMessage()}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},ub={ref:"root",class:"qti-extended-text-interaction"},cb={ref:"prompt",class:"qti-prompt-wrapper"};function hb(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",ub,[l.createElementVNode("div",cb,[l.renderSlot(e.$slots,"default")],512),(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.interactionTemplate),{ref:"textarea",onExtendedTextUpdate:r.handleExtendedTextUpdate,onExtendedTextReady:r.handleExtendedTextReady},null,40,["onExtendedTextUpdate","onExtendedTextReady"]))],512)}const db=te(lb,[["render",hb]]);class fb{constructor(t){return this.constants={QTI_ORIENTATION_HORIZONTAL:"qti-orientation-horizontal",QTI_ORIENTATION_VERTICAL:"qti-orientation-vertical",QTI_INPUT_WIDTH_DEFAULT:"",QTI_INPUT_WIDTH_1:"qti-input-width-1",QTI_INPUT_WIDTH_2:"qti-input-width-2",QTI_INPUT_WIDTH_3:"qti-input-width-3",QTI_INPUT_WIDTH_4:"qti-input-width-4",QTI_INPUT_WIDTH_5:"qti-input-width-5",QTI_INPUT_WIDTH_6:"qti-input-width-6",QTI_INPUT_WIDTH_10:"qti-input-width-10",QTI_INPUT_WIDTH_15:"qti-input-width-15",QTI_INPUT_WIDTH_20:"qti-input-width-20",QTI_INPUT_WIDTH_25:"qti-input-width-25",QTI_INPUT_WIDTH_30:"qti-input-width-30",QTI_INPUT_WIDTH_35:"qti-input-width-35",QTI_INPUT_WIDTH_40:"qti-input-width-40",QTI_INPUT_WIDTH_45:"qti-input-width-45",QTI_INPUT_WIDTH_50:"qti-input-width-50",QTI_INPUT_WIDTH_72:"qti-input-width-72"},this.classList=t,this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_HORIZONTAL,this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_DEFAULT,this.presentation_MaxLength=8,this.processClassAttribute(),this}processClassAttribute(){if(typeof this.classList>"u"||this.classList===null||this.classList.length==0)return;const t=this.classList.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case this.constants.QTI_ORIENTATION_VERTICAL:this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_VERTICAL;break;case this.constants.QTI_ORIENTATION_HORIZONTAL:this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_HORIZONTAL;break;case this.constants.QTI_INPUT_WIDTH_1:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_1,this.presentation_MaxLength=1;break;case this.constants.QTI_INPUT_WIDTH_2:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_2,this.presentation_MaxLength=2;break;case this.constants.QTI_INPUT_WIDTH_3:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_3,this.presentation_MaxLength=3;break;case this.constants.QTI_INPUT_WIDTH_4:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_4,this.presentation_MaxLength=4;break;case this.constants.QTI_INPUT_WIDTH_5:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_5,this.presentation_MaxLength=5;break;case this.constants.QTI_INPUT_WIDTH_6:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_6,this.presentation_MaxLength=6;break;case this.constants.QTI_INPUT_WIDTH_10:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_10,this.presentation_MaxLength=10;break;case this.constants.QTI_INPUT_WIDTH_15:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_15,this.presentation_MaxLength=15;break;case this.constants.QTI_INPUT_WIDTH_20:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_20,this.presentation_MaxLength=20;break;case this.constants.QTI_INPUT_WIDTH_25:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_25,this.presentation_MaxLength=25;break;case this.constants.QTI_INPUT_WIDTH_30:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_30,this.presentation_MaxLength=30;break;case this.constants.QTI_INPUT_WIDTH_35:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_35,this.presentation_MaxLength=35;break;case this.constants.QTI_INPUT_WIDTH_40:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_40,this.presentation_MaxLength=40;break;case this.constants.QTI_INPUT_WIDTH_45:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_45,this.presentation_MaxLength=45;break;case this.constants.QTI_INPUT_WIDTH_50:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_50,this.presentation_MaxLength=50;break;case this.constants.QTI_INPUT_WIDTH_72:this.presentation_WidthClass=this.constants.QTI_INPUT_WIDTH_72,this.presentation_MaxLength=500;break}}getOrientationClass(){return this.presentation_OrientationClass}isOrientationVertical(){return this.presentation_OrientationClass==this.constants.QTI_ORIENTATION_VERTICAL}getWidthClass(){return this.presentation_WidthClass}getVerticalMaxLength(){return this.presentation_MaxLength}}const pb=new re,mb={name:"TextEntryPlainDefault",emits:["textEntryReady","textEntryUpdate"],components:{Tooltip:Fn},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},spellcheck:{required:!1,type:String,default:"false"},maxlength:{required:!1,type:String,default:"500"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return W.getItemContextPnp().getColorStyle()},disabled(){return this.isDisabled}},data(){return{response:"",priorResponse:"",appliedRegex:null,displayMessage:!1,isDisabled:!1}},methods:{getResponse(){return this.response},setResponse(e){if(e===null){this.response="";return}this.response=e},getState(){return this.state},setState(e){this.state=e},setIsDisabled(e){if(this.isDisabled=e,e){const t=this.getResponse();this.$refs.label.innerHTML=t===null?"":t,this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.input.classList.add("qti-hidden"),(t===null||t.length===0)&&(this.$refs.label.style.paddingRight="1.1rem")}else this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.input.classList.remove("qti-hidden")},handleInput(e){e.preventDefault();let t=!0;this.appliedRegex!==null?t=this.applyPatternMask(this.$refs.input.value):this.setResponse(this.$refs.input.value),t&&(this.priorResponse=this.$refs.input.value,this.$parent.$emit("textEntryUpdate",{response:this.getResponse()}))},getLength(){return this.response.length},applyPatternMask(e){return this.appliedRegex.test(e)?(this.setResponse(e),this.priorResponse=e,!0):(this.showPatternMaskMessage(),this.setResponse(this.priorResponse),!1)},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)}},created(){this.appliedRegex=pb.validatePattern("pattern-mask",this.patternMask)},mounted(){this.$parent.$emit("textEntryReady",{node:this})}},gb={ref:"root"},yb={ref:"label",class:"text-entry-default-label qti-hidden"},vb=["placeholder","disabled","spellcheck","maxlength"];function wb(e,t,i,n,s,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("span",gb,[l.createElementVNode("span",yb,null,512),l.withDirectives(l.createElementVNode("input",l.mergeProps({ref:"input",class:"text-entry-default"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=c=>s.response=c),type:"text",placeholder:i.placeholder,disabled:r.disabled,autocapitalize:"none",spellcheck:i.spellcheck,maxlength:i.maxlength,onInput:t[1]||(t[1]=(...c)=>r.handleInput&&r.handleInput(...c))}),null,16,vb),[[l.vModelText,s.response]]),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:0,ref:"tooltip",target:()=>e.$refs.input,message:i.patternMaskMessage,"color-style":r.colorStyle},null,8,["target","message","color-style"])):l.createCommentVNode("",!0)],512)}const wu=te(mb,[["render",wb]]),bb=new re,Eb={name:"TextEntryPlainDefaultVertical",emits:["textEntryReady","textEntryUpdate"],components:{Tooltip:Fn},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},spellcheck:{required:!1,type:String,default:"false"},widthClass:{required:!1,type:String,default:""},maxlength:{required:!1,type:String,default:"8"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return W.getItemContextPnp().getColorStyle()},disabled(){return this.isDisabled}},data(){return{response:"",priorResponse:"",appliedRegex:null,displayMessage:!1,caretIndex:0,maxlengthMessage:"",isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e,t=!1){e===null?this.response="":this.response=e,t&&this.updateContent(this.response)},getState(){return this.state},setState(e){this.state=e},setIsDisabled(e){if(this.isDisabled=e,e){const t=this.getResponse();this.$refs.label.innerHTML=t===null?"":t,this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.input.classList.add("qti-hidden"),this.hidePlaceholder()}else this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.input.classList.remove("qti-hidden"),this.getContent().length===0?this.showPlaceholder():this.hidePlaceholder()},getContent(){return this.$refs.input.innerText},updateContent(e){this.$refs.input.innerText=e,e.length>0?this.hidePlaceholder():this.showPlaceholder()},getCaretIndex(){return this.caretIndex},setCaretIndex(e){this.caretIndex=e},handleInput(e){e.preventDefault();let t=!0;this.setCaretIndex(this.getCaretPos(this.$refs.input)-1);const i=this.getContent();i.length>0&&this.hidePlaceholder(),this.applyLimitCheck(i)&&(this.appliedRegex!==null?t=this.applyPatternMask(i):this.setResponse(i),t&&(i.length==0&&this.showPlaceholder(),this.priorResponse=i,this.$parent.$emit("textEntryUpdate",{response:this.getResponse()})))},handlePaste(e){e.preventDefault();const t=this.getRange();if(t===null)return;const i=this.getContent(),n=t.startOffset,s=t.endOffset;let r=e.clipboardData.getData("text/plain"),a=i.substring(0,n)+r+i.substring(s),c=!0;if(a.length>0&&this.hidePlaceholder(),a.length>this.maxlength){this.showMaxlengthMessage(),this.setResponse(this.priorResponse,!0),this.setCaretPos(this.$refs.input,n);return}this.appliedRegex!==null?c=this.applyPatternMask(a):this.setResponse(a,!0),c&&(this.setCaretIndex(n+r.length),this.setCaretPos(this.$refs.input,this.getCaretIndex()),this.priorResponse=a,this.$parent.$emit("textEntryUpdate",{response:this.getResponse()}))},handleDrop(e){e.preventDefault()},handleKeydown(e){switch(this.setCaretIndex(this.getCaretPos(this.$refs.input)),e.code){case"Enter":e.preventDefault();return;case"KeyI":case"KeyB":case"KeyU":e.ctrlKey&&e.preventDefault();return}},newDownRange(e){const t=e.firstChild,i=this.getRange();if(i===null)return;const n=i.startOffset,s=i.endOffset;if(s===this.getResponse().length)return;const r=window.getSelection();r.removeAllRanges();const a=document.createRange();a.setStart(t,n),a.setEnd(t,s+1),r.addRange(a)},newUpRange(e){const t=e.firstChild,i=this.getRange();if(i===null)return;const n=i.startOffset,s=i.endOffset;if(n===0)return;const r=window.getSelection();r.removeAllRanges();const a=document.createRange();a.setStart(t,n-1),a.setEnd(t,s),r.addRange(a)},getRange(){const e=document.getSelection();return e.rangeCount===0?null:e.getRangeAt(0)},getCaretPos(e){let t=0;if(typeof window.getSelection<"u"&&window.getSelection().rangeCount!==0){const s=window.getSelection().getRangeAt(0),r=s.cloneRange();r.selectNodeContents(e),r.setEnd(s.endContainer,s.endOffset),t=r.toString().length}return t},setCaretPos(e,t){e.focus(),e.childNodes.length===1&&document.getSelection().collapse(e.childNodes[0],t)},showPlaceholder(){this.$refs.placeholder.classList.remove("text-entry-ph-hidden")},hidePlaceholder(){this.$refs.placeholder.classList.add("text-entry-ph-hidden")},handleBlur(){this.$refs.root.classList.remove("focused")},handleFocus(){this.$refs.root.classList.add("focused")},getLength(){return this.response.length},applyLimitCheck(e){return e.length>this.maxlength?(this.showMaxlengthMessage(),this.setResponse(this.priorResponse,!0),this.setCaretPos(this.$refs.input,this.getCaretIndex()),!1):!0},applyPatternMask(e){return this.appliedRegex.test(e)?(this.setResponse(e),this.priorResponse=e,!0):(this.showPatternMaskMessage(),this.setResponse(this.priorResponse,!0),this.setCaretPos(this.$refs.input,this.getCaretIndex()),!1)},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)},showMaxlengthMessage(){this.$refs.tooltipMaxlength.show(),this.hideMaxlengthMessage()},hideMaxlengthMessage(e=1e3){setTimeout(()=>{this.$refs.tooltipMaxlength.hide()},e)},computeMaxlengthMessage(){this.maxlengthMessage=`Maximum of ${this.maxlength} character`+(this.maxlength==="1"?"":"s")}},created(){this.appliedRegex=bb.validatePattern("pattern-mask",this.patternMask),this.computeMaxlengthMessage()},mounted(){this.$parent.$emit("textEntryReady",{node:this})}},Sb=["spellcheck","maxlength","disabled"];function Tb(e,t,i,n,s,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",l.mergeProps({ref:"root",class:"text-entry-default-vert-wrapper"},e.$attrs),[l.createElementVNode("div",{ref:"label",class:"text-entry-default-vert-label qti-hidden",onFocus:t[0]||(t[0]=(...c)=>r.handleFocus&&r.handleFocus(...c)),onBlur:t[1]||(t[1]=(...c)=>r.handleBlur&&r.handleBlur(...c))},null,544),l.createElementVNode("div",{ref:"input",class:"text-entry-default-vert",tabindex:"0",contenteditable:"true",autocapitalize:"false",spellcheck:i.spellcheck,maxlength:i.maxlength,disabled:r.disabled,onInput:t[2]||(t[2]=(...c)=>r.handleInput&&r.handleInput(...c)),onBlur:t[3]||(t[3]=(...c)=>r.handleBlur&&r.handleBlur(...c)),onFocus:t[4]||(t[4]=(...c)=>r.handleFocus&&r.handleFocus(...c)),onKeydown:t[5]||(t[5]=(...c)=>r.handleKeydown&&r.handleKeydown(...c)),onPaste:t[6]||(t[6]=(...c)=>r.handlePaste&&r.handlePaste(...c)),onDrop:t[7]||(t[7]=(...c)=>r.handleDrop&&r.handleDrop(...c))},null,40,Sb),l.createElementVNode("label",{ref:"placeholder",class:"text-entry-default-vert-ph","aria-hidden":"true"},l.toDisplayString(i.placeholder),513),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:0,ref:"tooltip",target:()=>e.$refs.input,message:i.patternMaskMessage,"color-style":r.colorStyle},null,8,["target","message","color-style"])):l.createCommentVNode("",!0),l.createVNode(a,{ref:"tooltipMaxlength",target:()=>e.$refs.input,message:s.maxlengthMessage,"color-style":r.colorStyle},null,8,["target","message","color-style"])],16)}const Cb=te(Eb,[["render",Tb]]),or={DEFAULT:"default-plain-horizontal",DEFAULT_VERTICAL:"default-plain-vertical"};function _b(e,t,i){switch(e){case or.DEFAULT:return{template:'<text-entry-plain-default response-identifier="'+t.responseIdentifier+'" '+Na(t)+Ra(t)+Ma(t)+$a(t)+Pa(t)+qa(t)+bu(t)+Ba(i)+" />",components:{TextEntryPlainDefault:wu}};case or.DEFAULT_VERTICAL:return{template:'<text-entry-plain-default-vertical response-identifier="'+t.responseIdentifier+'" '+Na(t)+Ra(t)+Ma(t)+$a(t)+Pa(t)+qa(t)+Ib(t)+Vb(t)+Ba(i)+" />",components:{TextEntryPlainDefaultVertical:Cb}};default:return{template:'<text-entry-plain-default response-identifier="'+t.responseIdentifier+'" '+Na(t)+Ra(t)+Ma(t)+$a(t)+Pa(t)+qa(t)+bu(t)+Ba(i)+" />",components:{TextEntryPlainDefault:wu}}}}function xb(e){return Ab(e)?or.DEFAULT_VERTICAL:or.DEFAULT}function Ra(e){return typeof e.patternMask>"u"?"":'pattern-mask="'+e.patternMask+'" '}function Ma(e){return'pattern-mask-message="'+e.patternMaskMessage+'" '}function $a(e){return'placeholder="'+e.placeholder+'" '}function Na(e){return typeof e.expectedLength>"u"?"":'expected-length="'+e.expectedLength+'" '}function Pa(e){return typeof e.format>"u"||e.format.length==0?"":'format="'+e.format+'" '}function qa(e){return typeof e.spellcheck>"u"?"":'spellcheck="'+e.spellcheck+'" '}function bu(e){return typeof e.maxlength>"u"?"":'maxlength="'+e.maxlength+'" '}function Ib(e){return typeof e.widthClass>"u"?"":'width-class="'+e.widthClass+'" '}function Vb(e){return typeof e.verticalMaxlength>"u"?"":'maxlength="'+e.verticalMaxlength+'" '}function Ba(e){let t="";for(const[i,n]of Object.entries(e))t+=`${i}="${n}" `;return t}function Ab(e){return typeof e>"u"||e===null||e.length==0?!1:Eu("qti-writing-orientation-vertical-rl",e)?!0:Eu("qti-orientation-vertical",e)}function Eu(e,t){const i=t.split(" ");for(let n=0;n<i.length;n++)if(i[n]===e)return!0;return!1}const lr=new re,kb={name:"QtiTextEntryInteraction",props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},patternMask:{required:!1,type:String},placeholderText:{required:!1,type:String},format:{required:!1,type:String,default:""},dataPatternmaskMessage:{required:!1,type:String},dataMaxlength:{required:!1,type:String},dataSpellcheck:{required:!1,type:String}},computed:{interactionTemplate(){return _b(this.interactionSubType,this.createComponentProperties(),this.$attrs)},placeholder(){return lr.validatePlaceholderText(this.placeholderText,"")},hasPatternMask(){return typeof this.patternMask<"u"},patternMaskMessage(){return lr.validatePatternmaskMessage(this.dataPatternmaskMessage,"Invalid Input")},colorStyle(){return W.getItemContextPnp().getColorStyle()},computeMaxlength(){return typeof this.dataMaxlength<"u"?this.dataMaxlength:500},computeSpellcheck(){return typeof this.dataSpellcheck<"u"?this.dataSpellcheck:!1}},data(){return{response:"",state:null,baseType:"string",cardinality:"single",interactionSubType:null,isValidResponse:!1,invalidResponseMessage:"Input Required",classAttribute:"",isDisabled:!1,isQtiValid:!0,presentationFactory:null,node:null,priorState:null}},methods:{getResponse(){return this.response.length===0?null:this.response},setResponse(e){e===null?this.response="":this.response=e,this.node.setResponse(this.response,!0)},updateResponse(e){e===null?this.response="":this.response=e},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},setInteractionSubType(e){this.interactionSubType=e},getInteractionSubType(){return this.interactionSubType},disable(){this.toggleDisable(!0)},enable(){this.toggleDisable(!1)},toggleDisable(e){this.isDisabled=e,this.node.setIsDisabled(e)},getInvalidResponseMessage(){return this.invalidResponseMessage},initializeValue(){this.setResponse(null),this.setState(this.computeState()),this.setIsValid(!1)},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.setResponse(null),this.setState(this.computeState()),this.setIsValid(!1)},restoreValue(e){this.setResponse(e.value),this.setState(e.state),this.updateValidity(this.computeIsValid())},getCardinality(){return this.cardinality},computeState(){return{}},computeIsValid(){return!(this.response===null||this.response.length<1)},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},detectInteractionSubType(e){return xb(e)},createComponentProperties(){return{responseIdentifier:this.responseIdentifier,placeholder:this.placeholder,patternMask:this.patternMask,patternMaskMessage:this.patternMaskMessage,spellcheck:this.computeSpellcheck,maxlength:this.computeMaxlength,widthClass:this.presentationFactory.getWidthClass(),verticalMaxlength:this.presentationFactory.getVerticalMaxLength(),format:this.format}},handleTextEntryUpdate(e){this.updateResponse(e.response),this.evaluateValidity()},handleTextEntryReady(e){this.node=e.node,this.priorState===null?this.initializeValue():this.restoreValue(this.priorState)},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Text Entry Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Text Entry Interaction State Invalid. "state" property not found.');return t}},created(){try{this.responseDeclaration=lr.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.setInteractionSubType(this.detectInteractionSubType(this.$.vnode.props.class)),this.presentationFactory=new fb(this.$.vnode.props.class),this.priorState=this.getPriorState(this.responseIdentifier),this.cardinality=this.getCardinality(),this.appliedRegex=lr.validatePattern("pattern-mask",this.patternMask)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.priorState===null?this.initializeValue():this.restoreValue(this.priorState),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"TextEntry",node:this,resetValue:this.resetValue,isValidResponse:this.isValidResponse,invalidResponseMessage:this.getInvalidResponseMessage()}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}};function Ob(e,t,i,n,s,r){return l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.interactionTemplate),{ref:"input",class:"qti-text-entry-interaction",onTextEntryUpdate:r.handleTextEntryUpdate,onTextEntryReady:r.handleTextEntryReady},null,40,["onTextEntryUpdate","onTextEntryReady"])}const Lb=te(kb,[["render",Ob]]),Rb=new re,Mb={name:"QtiMatchInteraction",props:{responseIdentifier:{required:!0,type:String},minAssociations:{required:!1,type:String,default:"0"},maxAssociations:{required:!1,type:String,default:"1"},shuffle:{required:!1,type:String,default:"false"},dataMaxSelectionsMessage:{required:!1,type:String},dataMinSelectionsMessage:{required:!1,type:String},dataFirstColumnHeader:{required:!1,type:String,default:null}},data(){return{response:null,state:null,isValidResponse:!1,matchsets:[],orders:[],cardinality:"single",minSelectionsMessage:"",maxSelectionsMessage:"",responseDeclaration:null,hasPrompts:!1,matchInteractionStaticClass:"",interactionSubType:"default",headerHidden:"false",rowCentric:"false",isQtiValid:!0,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},setInteractionSubType(e){this.interactionSubType=e},getInteractionSubType(){return this.interactionSubType},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.minSelectionsMessage},disable(){this.$refs.matchgroup.disable()},enable(){this.$refs.matchgroup.enable()},initializeValue(e){this.setResponse(e),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.setResponse(null),this.setState(null),this.priorState=null,this.$refs.matchgroup.resetGroupUI()},restoreValue(e){this.setResponse(e),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},getCardinality(){let e=W.getResponseDeclaration(this.responseIdentifier);return this.cardinality=typeof e<"u"?e.cardinality:"single",this.cardinality},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},handleMatchGroupReady(e){this.matchsets=e.matchsets,this.orders=e.orders,this.initializeValue(e.response)},handleMatchGroupUpdate(e){this.setResponse(e.response),this.updateValidity(this.computeIsValid())},handleAssociationsLimit(){W.NotifyInteractionSelectionsLimit(this.maxSelectionsMessage)},computeState(){return this.priorState!==null?this.priorState.state:{orders:this.orders}},computeIsValid(){const e=this.getResponse(),t=this.minAssociations*1;return t===0?!0:e===null?!1:this.cardinality==="single"||e.length>=t},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},computeMaxSelectionsMessage(){if(typeof this.dataMaxSelectionsMessage<"u"){this.maxSelectionsMessage=this.dataMaxSelectionsMessage;return}this.maxSelectionsMessage=this.maxAssociations*1==0?"":"You may make a maximum of "+this.maxAssociations+" match"+(this.maxAssociations*1>1?"es":"")+" for this question."},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}this.minAssociations*1!=0&&(this.minSelectionsMessage="You must make at least "+this.minAssociations+" match"+(this.minAssociations*1>1?"es":"")+" for this question.")},detectInteractionSubType(e){return this.getMatchInteractionSubType(e)},getMatchInteractionSubType(e){let t="default";if(typeof e>"u"||e===null||e.length==0)return t;this.matchInteractionStaticClass=e;const i=e.split(" ");for(let n=0;n<i.length;n++)switch(i[n]){case"qti-match-tabular":t="matchtabular";break;case"qti-header-hidden":this.headerHidden="true";break;case"row-centric":this.rowCentric="true";break}return t},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Match Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Match Interaction State Invalid. "state" property not found.');if(!("orders"in t.state))throw new ee('Match Interaction State Invalid. "orders" property not found.');return t}},created(){try{if(this.responseDeclaration=Rb.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.setInteractionSubType(this.detectInteractionSubType(this.$.vnode.props.class)),this.priorState=this.getPriorState(this.responseIdentifier),this.cardinality=this.getCardinality(),this.cardinality!=="single"&&this.cardinality!=="multiple")throw new h('qti-match-interaction cardinality must be "single" or "multiple"');if(this.maxAssociations*1!=1&&this.cardinality!=="multiple")throw new h('qti-match-interaction response variable must have "multiple" cardinality because max-associations is '+this.maxAssociations);if(this.minAssociations*1>1&&this.cardinality==="single")throw new h('qti-match-interaction response variable must have "multiple" cardinality because min-associations is '+this.minAssociations);this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMinSelectionsMessage(),this.computeMaxSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"Match",interactionSubType:this.interactionSubType,node:this,resetValue:this.resetValue,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxSelectionsMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},$b={ref:"root",class:"qti-match-interaction"},Nb={ref:"prompt",class:"qti-prompt-wrapper"};function Pb(e,t,i,n,s,r){const a=l.resolveComponent("MatchGroup");return l.openBlock(),l.createElementBlock("div",$b,[l.createElementVNode("div",Nb,null,512),l.createVNode(a,l.mergeProps({ref:"matchgroup",cardinality:s.cardinality,shuffle:i.shuffle,responseIdentifier:i.responseIdentifier,maxAssociations:i.maxAssociations,minAssociations:i.minAssociations,interactionSubType:s.interactionSubType,matchInteractionStaticClass:s.matchInteractionStaticClass,headerHidden:s.headerHidden,rowCentric:s.rowCentric,dataFirstColumnHeader:i.dataFirstColumnHeader,priorState:s.priorState,onMatchGroupReady:r.handleMatchGroupReady,onMatchGroupUpdate:r.handleMatchGroupUpdate,onMatchGroupAssociationsLimit:r.handleAssociationsLimit},e.$attrs),{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},16,["cardinality","shuffle","responseIdentifier","maxAssociations","minAssociations","interactionSubType","matchInteractionStaticClass","headerHidden","rowCentric","dataFirstColumnHeader","priorState","onMatchGroupReady","onMatchGroupUpdate","onMatchGroupAssociationsLimit"])],512)}const qb=te(Mb,[["render",Pb]]),Bb=new re,Db={name:"QtiGapMatchInteraction",props:{responseIdentifier:{required:!0,type:String},minAssociations:{required:!1,type:String,default:"0"},maxAssociations:{required:!1,type:String,default:"1"},shuffle:{required:!1,type:String,default:"false"},dataMaxSelectionsMessage:{required:!1,type:String},dataMinSelectionsMessage:{required:!1,type:String},dataChoicesContainerWidth:{required:!1,type:String,default:null}},data(){return{response:null,state:null,isValidResponse:!1,choices:[],order:[],cardinality:"single",minSelectionsMessage:"",maxSelectionsMessage:"",responseDeclaration:null,hasPrompts:!1,gapMatchInteractionStaticClass:"",interactionSubType:"default",isQtiValid:!0,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},setInteractionSubType(e){this.interactionSubType=e},getInteractionSubType(){return this.interactionSubType},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.minSelectionsMessage},disable(){this.$refs.gapmatchgroup.disable()},enable(){this.$refs.gapmatchgroup.enable()},initializeValue(e){this.setResponse(e),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.setResponse(null),this.setState(null),this.priorState=null,this.$refs.matchgroup.resetGroupUI()},restoreValue(e){this.setResponse(e),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},getCardinality(){let e=W.getResponseDeclaration(this.responseIdentifier);return this.cardinality=typeof e<"u"?e.cardinality:"single",this.cardinality},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},handleGapMatchGroupReady(e){this.choices=e.choices,this.order=e.order,this.initializeValue(e.response)},handleGapMatchGroupUpdate(e){this.setResponse(e.response),this.updateValidity(this.computeIsValid())},handleAssociationsLimit(){W.NotifyInteractionSelectionsLimit(this.maxSelectionsMessage)},computeState(){return this.priorState!==null?this.priorState.state:{order:this.order}},computeIsValid(){const e=this.getResponse(),t=this.minAssociations*1;return t===0?!0:e===null?!1:this.cardinality==="single"||e.length>=t},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},computeMaxSelectionsMessage(){if(typeof this.dataMaxSelectionsMessage<"u"){this.maxSelectionsMessage=this.dataMaxSelectionsMessage;return}this.maxSelectionsMessage=this.maxAssociations*1==0?"":"You may make a maximum of "+this.maxAssociations+" match"+(this.maxAssociations*1>1?"es":"")+" for this question."},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}this.minAssociations*1!=0&&(this.minSelectionsMessage="You must make at least "+this.minAssociations+" match"+(this.minAssociations*1>1?"es":"")+" for this question.")},detectInteractionSubType(e){return this.computeInteractionSubType(e)},computeInteractionSubType(e){let t="default";return typeof e>"u"||e===null||e.length==0||(this.gapMatchInteractionStaticClass=e),t},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Gap Match Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Gap Match Interaction State Invalid. "state" property not found.');if(!("order"in t.state))throw new ee('Gap Match Interaction State Invalid. "order" property not found.');return t}},created(){try{if(this.responseDeclaration=Bb.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.setInteractionSubType(this.detectInteractionSubType(this.$.vnode.props.class)),this.priorState=this.getPriorState(this.responseIdentifier),this.cardinality=this.getCardinality(),this.cardinality!=="single"&&this.cardinality!=="multiple")throw new h('qti-gap-match-interaction cardinality must be "single" or "multiple"');if(this.maxAssociations*1!=1&&this.cardinality!=="multiple")throw new h('qti-gap-match-interaction response variable must have "multiple" cardinality because max-associations is '+this.maxAssociations);if(this.minAssociations*1>1&&this.cardinality==="single")throw new h('qti-gap-match-interaction response variable must have "multiple" cardinality because min-associations is '+this.minAssociations);this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMinSelectionsMessage(),this.computeMaxSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"GapMatch",interactionSubType:this.interactionSubType,node:this,resetValue:this.resetValue,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxSelectionsMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},Qb={ref:"root",class:"qti-gap-match-interaction"},Hb={ref:"prompt",class:"qti-prompt-wrapper"};function Fb(e,t,i,n,s,r){const a=l.resolveComponent("GapMatchGroup");return l.openBlock(),l.createElementBlock("div",Qb,[l.createElementVNode("div",Hb,null,512),l.createVNode(a,l.mergeProps({ref:"gapmatchgroup",cardinality:s.cardinality,shuffle:i.shuffle,responseIdentifier:i.responseIdentifier,maxAssociations:i.maxAssociations,minAssociations:i.minAssociations,interactionSubType:s.interactionSubType,gapMatchInteractionStaticClass:s.gapMatchInteractionStaticClass,dataChoicesContainerWidth:i.dataChoicesContainerWidth,priorState:s.priorState,onGapMatchGroupReady:r.handleGapMatchGroupReady,onGapMatchGroupUpdate:r.handleGapMatchGroupUpdate,onGapMatchGroupAssociationsLimit:r.handleAssociationsLimit},e.$attrs),{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},16,["cardinality","shuffle","responseIdentifier","maxAssociations","minAssociations","interactionSubType","gapMatchInteractionStaticClass","dataChoicesContainerWidth","priorState","onGapMatchGroupReady","onGapMatchGroupUpdate","onGapMatchGroupAssociationsLimit"])],512)}const Ub=te(Db,[["render",Fb]]),Gb=new re,jb={name:"QtiGraphicGapMatchInteraction",props:{responseIdentifier:{required:!0,type:String},minAssociations:{required:!1,type:String,default:"0"},maxAssociations:{required:!1,type:String,default:"1"},shuffle:{required:!1,type:String,default:"false"},dataMaxSelectionsMessage:{required:!1,type:String},dataMinSelectionsMessage:{required:!1,type:String},dataChoicesContainerWidth:{required:!1,type:String,default:null}},data(){return{response:null,state:null,isValidResponse:!1,choices:[],order:[],cardinality:"multiple",minSelectionsMessage:"",maxSelectionsMessage:"",responseDeclaration:null,hasPrompts:!1,interactionStaticClass:"",interactionSubType:"default",isQtiValid:!0,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},setInteractionSubType(e){this.interactionSubType=e},getInteractionSubType(){return this.interactionSubType},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.minSelectionsMessage},disable(){this.$refs.ggmgroup.disable()},enable(){this.$refs.ggmgroup.enable()},initializeValue(e){this.setResponse(e),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.setResponse(null),this.setState(null),this.priorState=null,this.$refs.matchgroup.resetGroupUI()},restoreValue(e){this.setResponse(e),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},getCardinality(){let e=W.getResponseDeclaration(this.responseIdentifier);return this.cardinality=typeof e<"u"?e.cardinality:"single",this.cardinality},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},handleGraphicGapMatchGroupReady(e){this.choices=e.choices,this.order=e.order,this.initializeValue(e.response)},handleGraphicGapMatchGroupUpdate(e){this.setResponse(e.response),this.updateValidity(this.computeIsValid())},handleAssociationsLimit(){W.NotifyInteractionSelectionsLimit(this.maxSelectionsMessage)},computeState(){return this.priorState!==null?this.priorState.state:{order:this.order}},computeIsValid(){const e=this.getResponse(),t=this.minAssociations*1;return t===0?!0:e===null?!1:this.cardinality==="single"||e.length>=t},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},computeMaxSelectionsMessage(){if(typeof this.dataMaxSelectionsMessage<"u"){this.maxSelectionsMessage=this.dataMaxSelectionsMessage;return}this.maxSelectionsMessage=this.maxAssociations*1==0?"":"You may make a maximum of "+this.maxAssociations+" match"+(this.maxAssociations*1>1?"es":"")+" for this question."},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}this.minAssociations*1!=0&&(this.minSelectionsMessage="You must make at least "+this.minAssociations+" match"+(this.minAssociations*1>1?"es":"")+" for this question.")},detectInteractionSubType(e){return this.computeInteractionSubType(e)},computeInteractionSubType(e){let t="default";return typeof e>"u"||e===null||e.length==0||(this.interactionStaticClass=e),t},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Gap Match Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Gap Match Interaction State Invalid. "state" property not found.');if(!("order"in t.state))throw new ee('Gap Match Interaction State Invalid. "order" property not found.');return t}},created(){try{if(this.responseDeclaration=Gb.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.setInteractionSubType(this.detectInteractionSubType(this.$.vnode.props.class)),this.priorState=this.getPriorState(this.responseIdentifier),this.cardinality=this.getCardinality(),this.cardinality!=="multiple")throw new h('qti-graphic-gap-match-interaction cardinality must be "multiple"');this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMinSelectionsMessage(),this.computeMaxSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"GraphicGapMatch",interactionSubType:this.interactionSubType,node:this,resetValue:this.resetValue,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxSelectionsMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},Wb={ref:"root",class:"qti-graphic-gap-match-interaction"},zb={ref:"prompt",class:"qti-prompt-wrapper"};function Kb(e,t,i,n,s,r){const a=l.resolveComponent("GraphicGapMatchGroup");return l.openBlock(),l.createElementBlock("div",Wb,[l.createElementVNode("div",zb,null,512),l.createVNode(a,l.mergeProps({ref:"ggmgroup",cardinality:s.cardinality,shuffle:i.shuffle,responseIdentifier:i.responseIdentifier,maxAssociations:i.maxAssociations,minAssociations:i.minAssociations,interactionSubType:s.interactionSubType,interactionStaticClass:s.interactionStaticClass,dataChoicesContainerWidth:i.dataChoicesContainerWidth,priorState:s.priorState,onGgmGroupReady:r.handleGraphicGapMatchGroupReady,onGgmGroupUpdate:r.handleGraphicGapMatchGroupUpdate,onGgmGroupAssociationsLimit:r.handleAssociationsLimit},e.$attrs),{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},16,["cardinality","shuffle","responseIdentifier","maxAssociations","minAssociations","interactionSubType","interactionStaticClass","dataChoicesContainerWidth","priorState","onGgmGroupReady","onGgmGroupUpdate","onGgmGroupAssociationsLimit"])],512)}const Yb=te(jb,[["render",Kb]]),Xb={},Zb={ref:"root",class:"qti3-player-media-group"};function Jb(e,t){return l.openBlock(),l.createElementBlock("div",Zb,[l.renderSlot(e.$slots,"default")],512)}const Su=te(Xb,[["render",Jb]]),Tu=new re,eE={name:"QtiMediaInteraction",components:[Su],props:{responseIdentifier:{required:!0,type:String},autostart:{required:!1,type:String,default:"false"},minPlays:{required:!1,type:String,default:"0"},maxPlays:{required:!1,type:String,default:"0"},loop:{required:!1,type:String,default:"false"},coords:{required:!1,type:String},dataMaxPlaysMessage:{required:!1,type:String},dataMinPlaysMessage:{required:!1,type:String}},data(){return{response:null,state:null,isValidResponse:!1,cardinality:"single",minPlaysMessage:"",maxPlaysMessage:"",responseDeclaration:null,mediaType:"media",isDisabled:!1,isQtiValid:!0,hasPrompts:!1,node:null,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},incrementPlays(){let e=this.getResponse();this.setResponse(e===null?1:e+1)},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},disable(){this.node!==null&&this.node.disable()},enable(){this.node!==null&&this.node.enable()},getInvalidResponseMessage(){return this.computeMinPlaysMessage(),this.minPlaysMessage},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.priorState=null,this.setResponse(null),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},restoreValue(e){e!==null&&(this.setResponse(e),this.setState(this.computeState()),this.updateValidity(this.computeIsValid()),this.evaluateMaxPlays())},getCardinality(){return this.cardinality},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},handleMediaMounted(e){this.node=e.node,this.mediaType=e.mediaType,e.mediaType==="audio"&&this.node.setAudioSubType("audioprogress"),this.evaluateMaxPlays()},handleMediaEnded(){this.incrementPlays(),this.evaluateValidity(),this.evaluateMaxPlays()},computeState(){return{}},computeIsValid(){const e=this.minPlays*1;if(e===0)return!0;const t=this.getResponse();return t===null?!1:t>=e},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},evaluateMaxPlays(){this.checkMaxPlaysLimit()?this.disable():this.enable()},checkMaxPlaysLimit(){if(this.maxPlays*1===0)return!1;const e=this.getResponse();return e!==null&&e==this.maxPlays*1},computeMaxPlaysMessage(){if(typeof this.dataMaxPlaysMessage<"u"){this.maxPlaysMessage=this.dataMaxPlaysMessage;return}const e=this.maxPlays*1;this.maxPlaysMessage=e===0?"":`You are permitted a maximum of ${this.maxPlays} play${e>1?"s":""} for this ${this.mediaType}.`},computeMinPlaysMessage(){if(typeof this.dataMinPlaysMessage<"u"){this.minPlaysMessage=this.dataMinPlaysMessage;return}const e=this.minPlays*1;this.minPlaysMessage=e===0?"":`You must play this ${this.mediaType} to the end at least ${this.minPlays} time${e>1?"s":""}.`},validateChildren(){},processChildren(){this.processMedia(),this.setIsValid(this.computeIsValid()),this.priorState!==null&&this.restoreValue(this.priorState.value)},processMedia(){let e=this.$refs.mediagroup.$el.getElementsByTagName("object");if(e.length!==0)throw new h("Unsupported Media Interaction element. The <object> elemnt is deprecated. Use <video> or <audio> instead.");if(e=this.$refs.mediagroup.$el.getElementsByTagName("video"),e.length===0&&(e=this.$refs.mediagroup.$el.getElementsByTagName("audio")),e.length!==1)throw new h("Media Interaction must have exactly one <video> or <audio> node.")},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Media Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Media Interaction State Invalid. "state" property not found.');return t}},created(){try{this.responseDeclaration=Tu.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.validateChildren(),this.priorState=this.getPriorState(this.responseIdentifier),Tu.validateMaxMinPlays(this.maxPlays,this.minPlays),this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMaxPlaysMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),this.processChildren(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"Media",node:this,resetValue:this.resetValue,disable:this.disable,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxPlaysMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},tE={ref:"root",class:"qti-media-interaction"},iE={ref:"prompt",class:"qti-prompt-wrapper"};function nE(e,t,i,n,s,r){const a=l.resolveComponent("MediaGroup");return l.openBlock(),l.createElementBlock("div",tE,[l.createElementVNode("div",iE,null,512),l.createVNode(a,{ref:"mediagroup",onMediaMounted:r.handleMediaMounted,onMediaEnded:r.handleMediaEnded},{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},8,["onMediaMounted","onMediaEnded"])],512)}const sE=te(eE,[["render",nE]]),rE=new re,aE={name:"QtiOrderInteraction",props:{responseIdentifier:{required:!0,type:String},minChoices:{required:!1,type:String,default:"0"},maxChoices:{required:!1,type:String,default:"0"},shuffle:{required:!1,type:String,default:"false"},orientation:{required:!1,type:String,default:"horizontal"},dataMaxSelectionsMessage:{required:!1,type:String},dataMinSelectionsMessage:{required:!1,type:String},dataChoicesContainerWidth:{required:!1,type:String,default:null}},data(){return{response:null,state:null,isValidResponse:!1,cardinality:"ordered",minSelectionsMessage:"",maxSelectionsMessage:"",responseDeclaration:null,interactionSubType:"default",choices:[],isShuffle:!1,hasPrompts:!1,isQtiValid:!0,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},setInteractionSubType(e){this.interactionSubType=e},getInteractionSubType(){return this.interactionSubType},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.minSelectionsMessage},disable(){this.$refs.ordergroup.disable()},enable(){this.$refs.ordergroup.enable()},initializeValue(e){this.setResponse(e),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.setResponse(null),this.setState(null),this.priorState=null,this.$refs.ordergroup.resetGroupUI()},restoreValue(e){this.setResponse(e),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},getCardinality(){let e=W.getResponseDeclaration(this.responseIdentifier);return this.cardinality=typeof e<"u"?e.cardinality:"ordered",this.cardinality},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){this.hasPrompts&&this.$refs.prompt.appendChild(this.$refs.ordergroup.getPromptElement())},handleOrderGroupReady(e){this.choices=e.choices,this.initializeValue(e.response)},handleOrderGroupUpdate(e){this.setResponse(e.response),this.updateValidity(this.computeIsValid())},handleSelectionsLimit(){W.NotifyInteractionSelectionsLimit(this.maxSelectionsMessage)},computeResponse(){let e=[];return this.choices.forEach(t=>{e.push(t.identifier)}),e},computeState(){return this.priorState!==null?this.priorState.state:{order:this.computeResponse()}},computeIsValid(){const e=this.getState(),t=this.getResponse(),i=this.minChoices*1;if(t===null||t.length!=e.order.length)return!1;let n=0;switch(this.interactionSubType){case"default":for(let s=0;s<t.length;s++)t[s]!==e.order[s]&&(n+=1);return i===0?n>0:n>=i;case"ordermatch":for(let s=0;s<t.length;s++)t[s]!==null&&(n+=1);return i===0?n===t.length:n>=i}return!1},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},computeMaxSelectionsMessage(){if(typeof this.dataMaxSelectionsMessage<"u"){this.maxSelectionsMessage=this.dataMaxSelectionsMessage;return}this.maxSelectionsMessage=this.maxChoices==0?"":"You may set an order for a maximum of "+this.maxChoices+" choice"+(this.maxChoices>1?"s":"")+" for this question."},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}this.interactionSubType==="default"?this.minChoices*1==0?this.minSelectionsMessage="You must set the order for at least 1 choice for this question.":this.minSelectionsMessage="You must set the order for at least "+this.minChoices+" choice"+(this.minChoices>1?"s":"")+" for this question.":this.interactionSubType==="ordermatch"&&(this.minChoices*1==0?this.minSelectionsMessage="You must set the order for all choices for this question.":this.minSelectionsMessage="You must set the order for at least "+this.minChoices+" choice"+(this.minChoices>1?"s":"")+" for this question.")},detectInteractionSubType(e){return this.getOrderInteractionSubType(e)},getOrderInteractionSubType(e){if(typeof e>"u"||e===null||e.length==0)return"default";const t=e.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case"qti-choices-top":case"qti-choices-bottom":case"qti-choices-left":case"qti-choices-right":return"ordermatch"}return"default"},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Order Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Order Interaction State Invalid. "state" property not found.');if(!("order"in t.state))throw new ee('Order Interaction State Invalid. "order" property not found.');return t}},created(){try{if(this.responseDeclaration=rE.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.setInteractionSubType(this.detectInteractionSubType(this.$.vnode.props.class)),this.priorState=this.getPriorState(this.responseIdentifier),this.cardinality=this.getCardinality(),this.cardinality!=="ordered")throw new h('qti-order-interaction cardinality must be "ordered"');this.isShuffle=this.shuffle==="true",this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMinSelectionsMessage(),this.computeMaxSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"Order",node:this,resetValue:this.resetValue,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxSelectionsMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},oE={ref:"root",class:"qti-order-interaction"},lE={ref:"prompt",class:"qti-prompt-wrapper"};function uE(e,t,i,n,s,r){const a=l.resolveComponent("OrderGroup");return l.openBlock(),l.createElementBlock("div",oE,[l.createElementVNode("div",lE,null,512),l.createVNode(a,l.mergeProps({ref:"ordergroup",cardinality:s.cardinality,shuffle:i.shuffle,responseIdentifier:i.responseIdentifier,orientation:i.orientation,maxChoices:i.maxChoices,minChoices:i.minChoices,interactionSubType:s.interactionSubType,dataChoicesContainerWidth:i.dataChoicesContainerWidth,priorState:s.priorState,onOrderGroupReady:r.handleOrderGroupReady,onOrderGroupUpdate:r.handleOrderGroupUpdate,onOrderGroupSelectionsLimit:r.handleSelectionsLimit},e.$attrs),{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},16,["cardinality","shuffle","responseIdentifier","orientation","maxChoices","minChoices","interactionSubType","dataChoicesContainerWidth","priorState","onOrderGroupReady","onOrderGroupUpdate","onOrderGroupSelectionsLimit"])],512)}const cE=te(aE,[["render",uE]]);class hE{constructor(t){return this.constants={QTI_UNSELECTED_HIDDEN:"qti-unselected-hidden"},this.classList=t,this.presentation_UnselectedHidden=!1,this.processClassAttribute(),this}processClassAttribute(){if(typeof this.classList>"u"||this.classList===null||this.classList.length==0)return;const t=this.classList.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case this.constants.QTI_UNSELECTED_HIDDEN:this.presentation_UnselectedHidden=!0;break}}getUnselectedHidden(){return this.presentation_UnselectedHidden}}const Cu=new re,dE={name:"QtiHottextInteraction",props:{responseIdentifier:{required:!0,type:String},minChoices:{required:!1,type:String,default:"0"},maxChoices:{required:!1,type:String,default:"1"},dataMaxSelectionsMessage:{required:!1,type:String},dataMinSelectionsMessage:{required:!1,type:String}},inheritAttrs:!0,data(){return{response:null,state:null,isValidResponse:!1,cardinality:"single",minSelectionsMessage:"",maxSelectionsMessage:"",responseDeclaration:null,choices:[],currentChoice:null,isRadio:!0,isDisabled:!1,isQtiValid:!0,hasPrompts:!1,presentationFactory:null,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},disable(){this.toggleDisableChoices(!0)},enable(){this.toggleDisableChoices(!1)},toggleDisableChoices(e){this.isDisabled=e,this.choices.forEach(t=>{t.setIsDisabled(e)})},getInvalidResponseMessage(){return this.minSelectionsMessage},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.choices.forEach(e=>{e.setChecked(!1)}),this.currentChoice=null,this.priorState=null},restoreValue(e){e!==null&&(this.isRadio?this.handleSetChecked(new CustomEvent("setChecked",{bubbles:!1,detail:{identifier:e,checked:"true"}}),!0):e.forEach(t=>{this.handleSetChecked(new CustomEvent("setChecked",{bubbles:!1,detail:{identifier:t,checked:"true"}}),!0)},this),this.setResponse(this.computeResponse()),this.setState(this.computeState()),this.updateValidity(this.computeIsValid()))},getCardinality(){let e=W.getResponseDeclaration(this.responseIdentifier);return this.cardinality=typeof e<"u"?e.cardinality!=="multiple"?"single":"multiple":"single",this.cardinality},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},handleSetChecked(e,t=!1){const i=e.detail;this.choices.forEach(n=>{this.isRadio&&n.setChecked(!1),n.identifier===i.identifier&&(this.currentChoice=n)}),i.checked==="true"?this.checkMaxChoicesLimit()?this.currentChoice.setChecked(!1):this.currentChoice.setChecked(!0):this.currentChoice.setChecked(!1),t||(this.setResponse(this.computeResponse()),this.currentChoice.setFocus(),this.evaluateValidity())},computeResponse(){let e=this.isRadio?null:[];return this.choices.forEach(t=>{t.isChecked()&&(this.isRadio?e=t.identifier:e.push(t.identifier))}),this.isRadio?e:e.length===0?null:e},computeState(){return{}},computeIsValid(){return this.minChoices*1===0?!0:this.response===null?!1:this.cardinality==="single"||this.cardinality==="multiple"&&this.response.length>=this.minChoices*1},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},checkMaxChoicesLimit(){if(this.isRadio||this.maxChoices==0)return!1;const e=this.getResponse();return e!==null&&e.length==this.maxChoices?(W.NotifyInteractionSelectionsLimit(this.maxSelectionsMessage),!0):!1},computeMaxSelectionsMessage(){if(typeof this.dataMaxSelectionsMessage<"u"){this.maxSelectionsMessage=this.dataMaxSelectionsMessage;return}this.maxSelectionsMessage=this.maxChoices==0?"":"You are permitted a maximum of "+this.maxChoices+" selection"+(this.maxChoices>1?"s":"")+" for this question.<br/><br/>Please unselect one of your selections before making another selection."},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}this.minSelectionsMessage=this.minChoices==0?"":"You must make at least "+this.minChoices+" selection"+(this.minChoices>1?"s":"")+" for this question."},validateChildren(){},processChildren(){this.$.subTree.children[1].children.forEach(t=>{t.dynamicChildren!==null&&t.dynamicChildren.forEach(i=>{i.component!==null&&i.type.name==="QtiHottext"&&this.choices.push(i.component.proxy)})}),this.processGroupUI(),this.priorState!==null&&this.restoreValue(this.priorState.value)},processGroupUI(){this.setUnselectedHidden(),this.setResponse(null),this.setState(this.computeState()),this.setIsValid(this.computeIsValid())},setUnselectedHidden(){this.presentationFactory.getUnselectedHidden()&&this.$refs.hottextgroup.setAttribute("class","qti3-player-hottext-group qti-unselected-hidden")},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Hottext Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Hottext Interaction State Invalid. "state" property not found.');return t}},created(){try{this.responseDeclaration=Cu.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.presentationFactory=new hE(this.$.vnode.props.class),this.validateChildren(),this.priorState=this.getPriorState(this.responseIdentifier),Cu.validateMaxMinChoices(this.maxChoices,this.minChoices),this.isRadio=this.getCardinality()!=="multiple",this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMinSelectionsMessage(),this.computeMaxSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),this.processChildren(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"Hottext",node:this,resetValue:this.resetValue,disable:this.disable,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxSelectionsMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},fE={ref:"root",class:"qti-hottext-interaction"},pE={ref:"prompt",class:"qti-prompt-wrapper"};function mE(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",fE,[l.createElementVNode("div",pE,null,512),l.createElementVNode("div",{ref:"hottextgroup","on:setChecked":t[0]||(t[0]=(...a)=>r.handleSetChecked&&r.handleSetChecked(...a)),class:"qti3-player-hottext-group"},[l.renderSlot(e.$slots,"default")],544)],512)}const gE=te(dE,[["render",mE]]);class yE{constructor(t){return this.constants={QTI_SELECTIONS_LIGHT:"qti-selections-light",QTI_SELECTIONS_DARK:"qti-selections-dark",QTI_UNSELECTED_HIDDEN:"qti-unselected-hidden",THEME_LIGHT:{selectedOpacity:"1.0",unselectedOpacity:"0.5",fillColor:"orange",fillOpacity:"0",strokeColor:"orange",strokeWidth:2,selectedStrokeWidth:4},THEME_DARK:{selectedOpacity:"1.0",unselectedOpacity:"0.5",fillColor:"#0088CC",fillOpacity:"0",strokeColor:"blue",strokeWidth:2,selectedStrokeWidth:4},THEME_HIDDEN_LIGHT:{selectedOpacity:"1.0",unselectedOpacity:"0",fillColor:"orange",fillOpacity:"0",strokeColor:"orange",strokeWidth:2,selectedStrokeWidth:4},THEME_HIDDEN_DARK:{selectedOpacity:"1.0",unselectedOpacity:"0",fillColor:"blue",fillOpacity:"0",strokeColor:"blue",strokeWidth:2,selectedStrokeWidth:4}},this.classList=t,this.presentation_Theme=this.constants.QTI_SELECTIONS_DARK,this.theme=this.constants.THEME_DARK,this.presentation_UnselectedHidden=!1,this.processClassAttribute(),this}processClassAttribute(){if(typeof this.classList>"u"||this.classList===null||this.classList.length==0)return;const t=this.classList.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case this.constants.QTI_SELECTIONS_DARK:this.presentation_Theme=this.constants.QTI_SELECTIONS_DARK;break;case this.constants.QTI_SELECTIONS_LIGHT:this.presentation_Theme=this.constants.QTI_SELECTIONS_LIGHT;break;case this.constants.QTI_UNSELECTED_HIDDEN:this.presentation_UnselectedHidden=!0;break}switch(this.presentation_Theme){case this.constants.QTI_SELECTIONS_DARK:this.presentation_UnselectedHidden&&(this.theme=this.constants.THEME_HIDDEN_DARK);break;case this.constants.QTI_SELECTIONS_LIGHT:this.presentation_UnselectedHidden?this.theme=this.constants.THEME_HIDDEN_LIGHT:this.theme=this.constants.THEME_LIGHT;break}}getThemeColors(){return this.theme}}const _u=new re,vE={name:"QtiHotspotInteraction",props:{responseIdentifier:{required:!0,type:String},minChoices:{required:!1,type:String,default:"0"},maxChoices:{required:!1,type:String,default:"1"},dataMaxSelectionsMessage:{required:!1,type:String},dataMinSelectionsMessage:{required:!1,type:String}},data(){return{response:null,state:null,isValidResponse:!1,cardinality:"single",minSelectionsMessage:"",maxSelectionsMessage:"",responseDeclaration:null,choices:[],currentChoice:null,shapeElements:[],currentElement:null,backgroundImage:null,backgroundImageWidth:"0",backgroundImageHeight:"0",isRadio:!0,isDisabled:!1,isQtiValid:!0,hasPrompts:!1,presentationFactory:null,shapeColorProperties:null,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},disable(){this.toggleDisableChoices(!0)},enable(){this.toggleDisableChoices(!1)},toggleDisableChoices(e){this.isDisabled=e},getInvalidResponseMessage(){return this.minSelectionsMessage},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier);for(let e=0;e<this.choices.length;e++)this.setChoiceUnChecked(this.choices[e],this.shapeElements[e]);this.currentChoice=null,this.currentElement=null,this.priorState=null,this.setResponse(null),this.setState(this.computeState()),this.updateValidity(this.computeIsValid())},restoreValue(e){e!==null&&(this.isRadio?this.handleSetChecked(new CustomEvent("setChecked",{bubbles:!1,detail:{identifier:e,checked:"true"}}),!0):e.forEach(t=>{this.handleSetChecked(new CustomEvent("setChecked",{bubbles:!1,detail:{identifier:t,checked:"true"}}),!0)},this),this.setResponse(this.computeResponse()),this.setState(this.computeState()),this.updateValidity(this.computeIsValid()))},getCardinality(){let e=W.getResponseDeclaration(this.responseIdentifier);return this.cardinality=typeof e<"u"?e.cardinality!=="multiple"?"single":"multiple":"single",this.cardinality},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},handleSetChecked(e,t=!1){const i=e.detail;for(let n=0;n<this.choices.length;n++)this.isRadio&&this.setChoiceUnChecked(this.choices[n],this.shapeElements[n]),this.choices[n].identifier===i.identifier&&(this.currentChoice=this.choices[n],this.currentElement=this.shapeElements[n]);i.checked==="true"?this.checkMaxChoicesLimit()?this.setChoiceUnChecked(this.currentChoice,this.currentElement):this.setChoiceChecked(this.currentChoice,this.currentElement):this.setChoiceUnChecked(this.currentChoice,this.currentElement),t||(this.setResponse(this.computeResponse()),this.currentElement.focus(),this.evaluateValidity())},computeResponse(){let e=this.isRadio?null:[];return this.choices.forEach(t=>{t.isChecked()&&(this.isRadio?e=t.identifier:e.push(t.identifier))}),this.isRadio?e:e.length===0?null:e},computeState(){return{}},computeIsValid(){return this.minChoices*1===0?!0:this.response===null?!1:this.cardinality==="single"||this.cardinality==="multiple"&&this.response.length>=this.minChoices*1},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},checkMaxChoicesLimit(){if(this.isRadio||this.maxChoices==0)return!1;const e=this.getResponse();return e!==null&&e.length==this.maxChoices?(W.NotifyInteractionSelectionsLimit(this.maxSelectionsMessage),!0):!1},computeMaxSelectionsMessage(){if(typeof this.dataMaxSelectionsMessage<"u"){this.maxSelectionsMessage=this.dataMaxSelectionsMessage;return}this.maxSelectionsMessage=this.maxChoices==0?"":"You are permitted a maximum of "+this.maxChoices+" selection"+(this.maxChoices>1?"s":"")+" for this question.<br/><br/>Please unselect one of your selections before making another selection."},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}this.minSelectionsMessage=this.minChoices==0?"":"You must make at least "+this.minChoices+" selection"+(this.minChoices>1?"s":"")+" for this question."},validateChildren(){},processChildren(){this.processBackgroundImage(),this.$.subTree.children[1].children[0].dynamicChildren.forEach(t=>{if(t.component!==null&&t.type.name==="QtiHotspotChoice"){const i=t.component.proxy;this.choices.push(i);const n=i.getShapeElement();n!==null&&(this.addHotspotListeners(n),this.shapeElements.push(n),this.$refs.overlay.appendChild(n))}}),this.processGroupUI(),this.priorState!==null&&this.restoreValue(this.priorState.value)},addHotspotListeners(e){e.addEventListener("click",this.handleHotspotClick),e.addEventListener("keydown",this.handleHotspotKeydown)},removeHotspotListeners(e){e.removeEventListener("click",this.handleHotspotClick),e.removeEventListener("keydown",this.handleHotspotKeydown)},handleHotspotClick(e){if(e.preventDefault(),this.isDisabled)return;const t=e.target.getAttribute("data-identifier"),i=this.findChoiceByIdentifier(t);this.isRadio?this.triggerChecked(e.target.getAttribute("data-identifier"),"true"):(this.toggleChecked(i,e.target),this.triggerChecked(t,i.getChecked()))},handleHotspotKeydown(e){const t=e.target.getAttribute("data-identifier"),i=this.findChoiceByIdentifier(t);switch(e.code){case"Space":case"Enter":if(e.stopPropagation(),e.preventDefault(),this.isDisabled||i==null)return;this.toggleChecked(i,e.target),this.triggerChecked(t,i.getChecked());break}},findChoiceByIdentifier(e){for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e)return this.choices[t];return null},toggleChecked(e,t){if(e.toggleChecked(),t===null)return;const i=t.getAttribute("aria-checked");t.setAttribute("aria-checked",i==="true"?"false":"true")},triggerChecked(e,t){const i=new CustomEvent("setChecked",{bubbles:!0,cancelable:!0,detail:{identifier:e,checked:t}});this.$refs.hotspotgroup.dispatchEvent(i)},setChoiceUnChecked(e,t){e.setChecked(!1),t.setAttribute("aria-checked","false");const i=e.getShapeColorProperties();t.setAttribute("fill",`${i.fillColor}`),t.setAttribute("fill-opacity",`${i.fillOpacity}`),t.setAttribute("opacity",`${i.unselectedOpacity}`),t.setAttribute("stroke",`${i.strokeColor}`),t.setAttribute("stroke-width",`${i.strokeWidth}`)},setChoiceChecked(e,t){e.setChecked(!0),t.setAttribute("aria-checked","true");const i=e.getShapeColorProperties();t.setAttribute("fill",`${i.fillColor}`),t.setAttribute("fill-opacity",`${i.fillOpacity}`),t.setAttribute("opacity",`${i.selectedOpacity}`),t.setAttribute("stroke",`${i.strokeColor}`),t.setAttribute("stroke-width",`${i.selectedStrokeWidth}`)},processGroupUI(){this.setResponse(null),this.setState(this.computeState()),this.setIsValid(this.computeIsValid())},processBackgroundImage(){let e=this.$refs.hotspotgroup.getElementsByTagName("object");if(e.length===0&&(e=this.$refs.hotspotgroup.getElementsByTagName("img")),e.length===0&&(e=this.$refs.hotspotgroup.getElementsByTagName("picture")),e.length!==1)throw new h("Hotspot interaction must have exactly one <img>, <object>, or <picture> node");this.backgroundImage=e[0],this.backgroundImage.setAttribute("draggable","false"),this.backgroundImageWidth=`${e[0].clientWidth}`,this.backgroundImageHeight=`${e[0].clientHeight}`,this.$refs.overlay.setAttribute("viewBox",`0 0 ${this.backgroundImageWidth} ${this.backgroundImageHeight}`),this.$refs.overlay.setAttribute("tabindex","-1"),this.$refs.overlay.setAttribute("role","application"),this.$refs.overlay.setAttribute("focusable","false"),this.$refs.hotspotgroup.setAttribute("style",`width:${e[0].clientWidth};height:${e[0].clientHeight}`)},getShapeColorProperties(){return this.shapeColorProperties},setShapeColorProperties(e){this.shapeColorProperties=e},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('Hotspot Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new ee('Hotspot Interaction State Invalid. "state" property not found.');return t}},created(){try{this.responseDeclaration=_u.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.presentationFactory=new yE(this.$.vnode.props.class),this.setShapeColorProperties(this.presentationFactory.getThemeColors()),this.validateChildren(),this.priorState=this.getPriorState(this.responseIdentifier),_u.validateMaxMinChoices(this.maxChoices,this.minChoices),this.isRadio=this.getCardinality()!=="multiple",this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMinSelectionsMessage(),this.computeMaxSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),this.processChildren(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"Hotspot",node:this,resetValue:this.resetValue,disable:this.disable,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxSelectionsMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}},beforeUnmount(){this.shapeElements.forEach(e=>{this.removeHotspotListeners(e)})}},wE={ref:"root",class:"qti-hotspot-interaction"},bE={ref:"prompt",class:"qti-prompt-wrapper"},EE={ref:"overlay",class:"qti3-player-hotspot-overlay"};function SE(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",wE,[l.createElementVNode("div",bE,null,512),l.createElementVNode("div",{ref:"hotspotgroup","on:setChecked":t[0]||(t[0]=(...a)=>r.handleSetChecked&&r.handleSetChecked(...a)),class:"qti3-player-hotspot-group"},[l.renderSlot(e.$slots,"default"),(l.openBlock(),l.createElementBlock("svg",EE,null,512))],544)],512)}const TE=te(vE,[["render",SE]]);class CE{constructor(t,i,n){Je(this,"moduleAttribute","");Je(this,"modulesNode",null);Je(this,"itemPathUri","");Je(this,"modules",null);Je(this,"constants",{BASE_CONFIG:{waitSeconds:60,paths:{}}});return this.moduleAttribute=t,this.modulesNode=i,this.itemPathUri=n,this}async getConfiguration(t){this.setModules(this.getInteractionModules());let i=null;this.moduleAttribute.length>0&&this.modulesNode===null?i=await this.getConfigurationFromUrl(this.getModules()):i=await this.resolveModules(this.getModules()),t&&t(i)}async resolveModules(t){let i=null;if(t===null)return i;let n=this.constants.BASE_CONFIG;return n=await this.initBaseConfiguration(n,t),i=await this.resolvePrimaryConfigurationModules(n,t),i!==null||(i=await this.resolveSecondaryConfigurationModules(n,t)),i}async initBaseConfiguration(t,i){const n=`${this.getItemPathUri()}modules/module_resolution.js`;if(typeof i.primaryconfiguration>"u"&&typeof i.secondaryConfiguration>"u"){const s=await this.fetchDefaultModuleResolution(n,!1);if(s!==null)return s}return t}async resolvePrimaryConfigurationModules(t,i){let n=[];if(typeof i.primaryconfiguration>"u"){for(let c=0;c<i.module.length;c++){if(typeof i.module[c].primarypath>"u")return null;n.push(this.addPathJs(i.module[c].primarypath)),t.paths[i.module[c].id]=this.stripPathJs(i.module[c].primarypath)}return await this.resolveConfigurationModules(n)?t:null}const s=await this.fetchConfiguration(i.primaryconfiguration,!0,!0);if(s===null)return null;for(const a in s.paths)s.paths[a]=this.stripPathJs(s.paths[a]);for(let a=0;a<i.module.length;a++)typeof i.module[a].primarypath<"u"&&(s.paths[i.module[a].id]=this.stripPathJs(this.addPathJs(i.module[a].primarypath)));return await this.resolveConfigurationPathUrls(s.paths)?s:null}async resolveSecondaryConfigurationModules(t,i){let n=[];if(typeof i.secondaryconfiguration>"u"){for(let c=0;c<i.module.length;c++){if(typeof i.module[c].fallbackpath>"u")return null;n.push(this.addPathJs(i.module[c].fallbackpath)),t.paths[i.module[c].id]=this.stripPathJs(i.module[c].fallbackpath)}return await this.resolveConfigurationModules(n)?t:null}const s=await this.fetchConfiguration(i.secondaryconfiguration,!1,!0);if(s===null)return null;for(const a in s.paths)s.paths[a]=this.stripPathJs(s.paths[a]);for(let a=0;a<i.module.length;a++)typeof i.module[a].fallbackpath<"u"&&(s.paths[i.module[a].id]=this.stripPathJs(this.addPathJs(i.module[a].fallbackpath)));return await this.resolveConfigurationPathUrls(s.paths)?s:null}async resolveConfigurationPathUrls(t){let i=[];for(let s=0;s<t.length;s++)i.push(t[s]);return await this.resolveConfigurationModules(i)}async resolveConfigurationModules(t){return await Promise.all(t.map(n=>fetch(n).then(s=>{if(s.ok)return console.log("[PCI Parent] Module Loader Success:",n),s;throw new Error(n)}))).catch(n=>(console.log("[PCI Parent] Module Loader Failure:",n.message),null))!==null}async getConfigurationFromUrl(t){let i=null;return t===null||(typeof t.primaryconfiguration<"u"&&(i=await this.fetchConfiguration(t.primaryconfiguration,!0,!1)),i!==null)||typeof t.secondaryconfiguration<"u"&&(i=await this.fetchConfiguration(t.secondaryconfiguration,!1,!1)),i}async fetchConfiguration(t,i,n){try{const s=await fetch(t);if(!s.ok)throw new Error(`HTTP error: ${s.status}`);const r=await s.json();let a=r.paths;for(let c in a)a[c]!==null&&!a[c].startsWith("http")&&(n?a[c]=`${this.getConfigurationRelativePath(t)}${a[c]}`:a[c]=`${this.getItemPathUri()}${a[c]}`);return r}catch(s){return console.log((i?"Primary":"Fallback")+"configuration Fetch error:",s),null}}async fetchDefaultModuleResolution(t,i){try{const n=await fetch(t);if(!n.ok)throw new Error(`HTTP error: ${n.status}`);const s=await n.json();let r=s.paths;for(let a in r)r[a]!==null&&!r[a].startsWith("http")&&(i?r[a]=`${this.getConfigurationRelativePath(t)}${r[a]}`:r[a]=`${this.getItemPathUri()}${r[a]}`);return s}catch(n){return console.log("module_resolution.js Fetch error:",n),null}}getItemPathUri(){return this.itemPathUri}getModules(){return this.modules}setModules(t){this.modules=t}getInteractionModules(){let t={};if(this.modulesNode===null)return t={primaryconfiguration:"modules/module_resolution.js",secondaryconfiguration:"modules/fallback_module_resolution.js"},this.addPackagePath(t);const i=this.modulesNode.getPrimaryConfiguration();i.length>0&&(t.primaryconfiguration=i);const n=this.modulesNode.getSecondaryConfiguration();n.length>0&&(t.secondaryconfiguration=n),t.module=[];let s=this.modulesNode.getModules();for(let r=0;r<s.length;r++){let a={id:s[r].getId()};s[r].getPrimaryPath().length>0&&(a.primarypath=s[r].getPrimaryPath()),s[r].getFallbackPath().length>0&&(a.fallbackpath=s[r].getFallbackPath()),t.module.push(a)}return this.addPackagePath(t)}addPackagePath(t){for(let n in{primaryconfiguration:"",secondaryconfiguration:""})n in t&&t[n]!==null&&!t[n].startsWith("http")&&(t[n]=this.getAbsolutePath(this.getItemPathUri(),t[n]));let i=t.module;if(i!=null)for(let n=0;n<i.length;n++){let s=i[n];for(let r in{primarypath:"",fallbackpath:""})r in s&&s[r]!==null&&!s[r].startsWith("http")&&(s[r]=this.getAbsolutePath(this.getItemPathUri(),s[r]))}return t}getAbsolutePath(t,i){let n=t.split("/"),s=i.split("/");n.pop();for(var r=0;r<s.length;r++)s[r]!="."&&(s[r]==".."?n.pop():n.push(s[r]));return n.join("/")}getConfigurationRelativePath(t){if(t===null||t.length===0)return"";const i=t.lastIndexOf("/");return i<0?"":t.substring(0,i+1)}stripPathJs(t){return t===null?null:t.endsWith(".js")?t.slice(0,t.lastIndexOf(".")):t}addPathJs(t){return t===null?null:t.length>0&&!t.endsWith(".js")?`${t}.js`:t}}const Da=new re,xu=new me,_E={name:"QtiPortableCustomInteraction",props:{responseIdentifier:{required:!0,type:String},customInteractionTypeIdentifier:{required:!0,type:String},module:{required:!1,type:String,default:""},dataItemPathUri:{required:!1,type:String,default:""}},inheritAttrs:!0,data(){return{response:null,state:null,baseType:null,cardinality:null,isValidResponse:!0,isQtiValid:!0,hasPrompts:!1,pciModuleResolver:null,loadIframeHandler:null,renderer:"",classAttribute:"",properties:{},modulesNode:null,modules:null,configuration:null,templateVariables:[],contextVariables:[],uniqueId:null,pciIframe:null,isReady:!1,initialWidth:0,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getStateRequest(){this.pciIframe.contentWindow.postMessage({message:"PciGetState_Request"},"*")},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return""},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.priorState=null},restoreValue(e,t){this.setResponse(e),this.setState(t)},getCardinality(){let e=W.getResponseDeclaration(this.responseIdentifier);return this.cardinality=e.cardinality,this.cardinality},getBaseType(){let e=W.getResponseDeclaration(this.responseIdentifier);return this.baseType=e.baseType,this.baseType},getPrompts(e){let t=[];return e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},computeState(){return{}},computeIsValid(){return!0},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),W.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},validateChildren(){if(!this.$slots.default)return;let e=!1,t=!1,i=!1,n=!1,s=!1;this.$slots.default().forEach(r=>{if(Da.isValidSlot(r)){if(r.type.name==="QtiPrompt"){if(t||i||n||s)throw new h("Invalid element order. qti-prompt must be the first element");if(!e)return e=!0;throw new h("Maximum of 1 qti-prompt element permitted")}if(r.type.name==="QtiInteractionModules"){if(t||n||s)throw new h("Invalid element order: qti-interaction-modules");if(!i)return i=!0;throw new h("Maximum of 1 qti-interaction-modules element permitted")}if(r.type.name==="QtiInteractionMarkup"){if(n||s)throw new h("Invalid element order: qti-interaction-markup");if(!t)return t=!0;throw new h("Maximum of 1 qti-interaction-markup element permitted")}if(r.type.name==="QtiTemplateVariable"){if(n)throw new h("Invalid element order: qti-template-variable");if(!s)return s=!0;throw new h("Maximum of 1 qti-interaction-markup element permitted")}if(r.type.name==="QtiContextVariable")return n=!0;if(r.type.name==="QtiStylesheet")return!0;throw new h('Node is not permitted inside QtiPortableCustomInteraction: "'+r.type.name+'"')}})},processChildren(){const e=this.$.subTree.children[1].children[0].children;e!==null&&(e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;switch(t.type.name){case"QtiInteractionMarkup":this.markup=i.getMarkup();break;case"QtiInteractionModules":this.modulesNode=i;break;case"QtiTemplateVariable":this.templateVariables.push(i);break;case"QtiContextVariable":this.contextVariables.push(i);break}}),this.priorState!==null&&this.restoreValue(this.priorState.value,this.priorState.state),this.initialWidth=this.$refs.root.clientWidth)},disable(){},enable(){},getPriorState(e){const t=W.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new ee('PCI State Invalid. "value" property not found.');if(!("state"in t))throw new ee('PCI State Invalid. "state" property not found.');return t},createId(){return"pci_"+Da.randomString(5,"a")},initialize(){this.setProperties(this.getPciProperties()),this.pciModuleResolver=new CE(this.module,this.modulesNode,this.dataItemPathUri),this.pciModuleResolver.getConfiguration((function(e){this.setConfiguration(e),console.log("[PCI Parent] PCI Configuration:",e),e!==null&&this.loadPciIframe(this.initialWidth)}).bind(this))},loadPciIframe(e){const t=document.createElement("iframe");t.name=this.uniqueId,t.id=this.uniqueId,t.setAttribute("scrolling","no"),t.style.border="none",t.style.width=`${e}px`,t.addEventListener("load",this.loadIframeHandler),t.src=`${this.renderer}?identifier=${this.responseIdentifier}&uniqueId=${this.uniqueId}`,this.$refs.ic.appendChild(t)},handleLoadIframe(e){this.pciIframe=e.target},getItemPathUri(){return this.dataItemPathUri},getPciProperties(){let e=this.$refs.root;const t={};for(let i in e.dataset)i!=="uniqueId"&&(t[i]=e.dataset[i]);return t},getProperties(){return this.properties},setProperties(e){this.properties=e},getContextVariables(){let e={};for(let t=0;t<this.contextVariables.length;t++)e[this.contextVariables[t].getIdentifier()]=this.contextVariables[t].evaluate();return e},getTemplateVariables(){let e={};for(let t=0;t<this.templateVariables.length;t++)e[this.templateVariables[t].getIdentifier()]=this.templateVariables[t].evaluate();return e},getModules(){return this.modules},setModules(e){this.modules=e},getConfiguration(){return this.configuration},setConfiguration(e){this.configuration=e},getClassAttribute(){return this.classAttribute},setClassAttribute(e){this.classAttribute=e},copyAttributes(e,t,i){return e.forEach(function(n){let s=n.replace("-","");t[s]=i.getAttribute(n)}),t},getResponseVariable(){let e=xu.valueToPciJson(this.getResponse(),this.baseType,this.cardinality),t={};return t[this.responseIdentifier]=e,t},pciInitialize(){let e={typeIdentifier:this.customInteractionTypeIdentifier,classAttribute:this.getClassAttribute(),markup:this.markup,properties:this.getProperties(),boundTo:this.getResponseVariable(),templateVariables:this.getTemplateVariables(),contextVariables:this.getContextVariables(),module:this.module,modules:this.getModules(),moduleResolution:this.getConfiguration(),status:W.getItemLifecycleStatus()},t={message:"PciLoadInteraction",pci:JSON.stringify(e)};this.priorState!==null&&(t.state=JSON.stringify({response:xu.valueToPciJson(this.getResponse(),this.baseType,this.cardinality),state:this.getState()})),this.pciIframe.contentWindow.postMessage(t,"*")},pciResizeIframe(e,t){this.pciIframe!==null&&(this.pciIframe.style.height=`${e}px`,this.pciIframe.style.width=`${t}px`)},pciResizeIframeWidthToContainer(){this.pciIframe!==null&&(this.pciIframe.style.width=`${this.$refs.ic.clientWidth}px`)},pciSaveState(e){const t=JSON.parse(e);typeof t.response<"u"?this.setResponse(t.response):this.setResponse(null),typeof t.state<"u"?this.setState(t.state):this.setState(null),this.notifyInteractionStateReady()},pciSetReady(){this.isReady=!0},pciIsReady(){return this.pciIframe!==null&&this.isReady},notifyInteractionStateReady(){W.NotifyInteractionStateReady({identifier:this.responseIdentifier})}},created(){try{this.responseDeclaration=Da.validateResponseIdentifierAttribute(W,this.responseIdentifier),this.validateChildren(),this.renderer=W.getPciContextRenderer(),this.loadIframeHandler=this.handleLoadIframe.bind(this);const e=typeof this.$.vnode.props.class<"u"?this.$.vnode.props.class:"";this.setClassAttribute(e),this.priorState=this.getPriorState(this.responseIdentifier),this.hasPrompts=this.getPrompts(this.$slots).length>0,this.cardinality=this.getCardinality(),this.baseType=this.getBaseType(),this.uniqueId=this.createId()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),this.processChildren(),W.defineInteraction({identifier:this.responseIdentifier,interactionType:"PortableCustom",node:this,resetValue:this.resetValue,disable:this.disable,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:""}),this.initialize(),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}},beforeUnmount(){this.pciIframe!==null&&this.pciIframe.removeEventListener("load",this.loadIframeHandler)}},xE={ref:"root",class:"qti-portable-custom-interaction"},IE={ref:"prompt",class:"qti-prompt-wrapper"},VE={ref:"pcigroup",class:"qti3-player-pci-group"},AE={ref:"ic",class:"qti3-player-pci-iframe-container"};function kE(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",xE,[l.createElementVNode("div",IE,null,512),l.createElementVNode("div",VE,[l.renderSlot(e.$slots,"default")],512),l.createElementVNode("div",AE,null,512)],512)}const OE=te(_E,[["render",kE]]),LE={name:"QtiPrompt"},RE={class:"qti-prompt"};function ME(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",RE,[l.renderSlot(e.$slots,"default")])}const $E=te(LE,[["render",ME]]),NE=new re,PE={name:"QtiInlineChoice",props:{identifier:{required:!0,type:String},fixed:{required:!1,type:String,default:"false"},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"}},data(){return{id:null}},inheritAttrs:!0,methods:{createId(){if(this.$refs.choice.hasAttribute("id")){this.id=this.$refs.choice.getAttribute("id");return}this.id="inlinechoice_"+NE.randomString(5,"a")+"_"+this.identifier,this.$refs.choice.setAttribute("id",this.id)}},created(){},mounted(){this.createId()}},qE=["data-identifier"];function BE(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("li",{ref:"choice",role:"option","data-identifier":i.identifier,class:"qti-inline-choice"},[l.renderSlot(e.$slots,"default")],8,qE)}const DE=te(PE,[["render",BE]]),QE=new re,HE={name:"QtiSimpleChoice",emits:["setChecked","setFocusPreviousChoice","setFocusNextChoice","setActiveDescendant"],props:{identifier:{required:!0,type:String},fixed:{required:!1,type:String,default:"false"},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"}},data(){return{id:null,checked:"false",isRadio:!0,role:"radio",tabIndex:"-1",hasMath:!1,isDisabled:!1,parentCardinality:"single"}},inheritAttrs:!0,methods:{handleClick(){if(!this.isDisabled)if(this.isRadio)this.$parent.$emit("setChecked",{identifier:this.identifier,checked:"true"});else{if(this.toggleChecked(),this.parentCardinality==="ordered")return;this.$parent.$emit("setChecked",{identifier:this.identifier,checked:this.checked})}},handleKeydown(e){let t=!1;switch(e.code){case"Space":if(!this.isDisabled){if(this.toggleChecked(),this.parentCardinality==="ordered")return;this.$parent.$emit("setChecked",{identifier:this.identifier,checked:this.checked})}t=!0;break;case"Enter":if(!this.isDisabled){if(this.toggleChecked(),this.parentCardinality==="ordered")return;this.$parent.$emit("setChecked",{identifier:this.identifier,checked:this.checked})}t=!0;break;case"ArrowUp":case"ArrowLeft":this.isRadio&&(this.$parent.$emit("setFocusPreviousChoice",this.identifier),t=!0);break;case"ArrowDown":case"ArrowRight":this.isRadio&&(this.$parent.$emit("setFocusNextChoice",this.identifier),t=!0);break}t&&(e.stopPropagation(),e.preventDefault())},handleFocus(){this.parentCardinality!=="ordered"&&this.$parent.$emit("setActiveDescendant",this.id)},handleBlur(){},setChecked(e){this.checked=e?"true":"false"},isChecked(){return this.checked==="true"},setTabIndex(e){this.tabIndex=e},setFocus(){this.$refs.choice.focus()},setBlur(){this.$refs.choice.blur()},toggleChecked(){this.checked=this.checked==="true"?"false":"true"},setLabel(e){this.$refs.label.innerText=e},hideLabel(){this.$refs.label.classList.add("qti-hidden")},showLabel(){this.$refs.label.classList.remove("qti-hidden")},setLabelSbac(e){this.$refs.choice.classList.add("sbac"),this.$refs.choice.setAttribute("data-label",e),this.$refs.label.innerText=e,this.$refs.label.classList.add("qti-visually-hidden")},setChoiceLrn(){this.$refs.choice.classList.add("lrn")},hideControl(){this.$refs.choice.classList.add("control-hidden")},setIsDisabled(e){this.isDisabled=e},initializeChoice(){switch(this.parentCardinality=this.$parent.cardinality,this.parentCardinality){case"ordered":this.role="button",this.isRadio=!1,this.tabIndex=0;break;case"multiple":this.role="checkbox",this.isRadio=!1,this.tabIndex=0;break;default:this.role="radio",this.isRadio=!0,this.tabIndex=-1;break}},initializeOrderChoice(){this.role==="button"&&(this.hideLabel(),this.hideControl())},createId(){if(this.$refs.choice.hasAttribute("id")){this.id=this.$refs.choice.getAttribute("id");return}this.id="choice_"+QE.randomString(5,"a")+"_"+this.identifier,this.$refs.choice.setAttribute("id",this.id)},setExpectedSolution(){this.$refs.choice.classList.add("player-show-solution","player-choice-expected")},setCorrectSolution(){this.$refs.choice.classList.add("player-show-solution","player-choice-correct")},setIncorrectSolution(){this.$refs.choice.classList.add("player-show-solution","player-choice-incorrect")},setIgnoreSolution(){this.$refs.choice.classList.remove("player-show-solution","player-choice-incorrect","player-choice-correct","player-choice-expected")}},created(){this.initializeChoice()},mounted(){this.initializeOrderChoice(),this.createId()}},FE=["role","aria-checked","tabindex","data-identifier"],UE={ref:"label",class:"qti-choice-label"},GE={ref:"description",class:"qti-choice-description"};function jE(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("li",{ref:"choice",role:s.role,"aria-checked":s.checked,tabindex:s.tabIndex,"data-identifier":i.identifier,onFocus:t[0]||(t[0]=(...a)=>r.handleFocus&&r.handleFocus(...a)),onBlur:t[1]||(t[1]=(...a)=>r.handleBlur&&r.handleBlur(...a)),onClick:t[2]||(t[2]=(...a)=>r.handleClick&&r.handleClick(...a)),onKeydown:t[3]||(t[3]=(...a)=>r.handleKeydown&&r.handleKeydown(...a)),class:l.normalizeClass(["qti-simple-choice",{source:s.role=="button"}])},[l.createElementVNode("div",{class:l.normalizeClass(["qti-simple-choice-wrapper",{draggable:s.role=="button"}]),style:{width:"100%"}},[l.createElementVNode("div",UE,null,512),l.createElementVNode("div",GE,[l.renderSlot(e.$slots,"default")],512)],2)],42,FE)}const WE=te(HE,[["render",jE]]),zE=new re,KE={name:"QtiSimpleAssociableChoice",props:{identifier:{required:!0,type:String},fixed:{required:!1,type:String,default:"false"},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},matchMax:{required:!0,type:String},matchMin:{required:!1,type:String,default:"0"}},data(){return{id:null}},methods:{createId(){if(this.$refs.choice.hasAttribute("id")){this.id=this.$refs.choice.getAttribute("id");return}this.id="choice_"+zE.randomString(5,"a")+"_"+this.identifier,this.$refs.choice.setAttribute("id",this.id)}},mounted(){this.createId()}},YE=["data-identifier","data-match-max","data-match-min","data-match-group"],XE={ref:"description",class:"choice-description"};function ZE(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("li",{ref:"choice","data-identifier":i.identifier,"data-match-max":i.matchMax,"data-match-min":i.matchMin,"data-match-group":i.matchGroup,class:"qti-simple-associable-choice"},[l.createElementVNode("div",XE,[l.renderSlot(e.$slots,"default")],512)],8,YE)}const JE=te(KE,[["render",ZE]]),e0=new re,t0={name:"QtiAssociableHotspot",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},shape:{required:!0,type:String},coords:{required:!0,type:String},hotspotLabel:{required:!1,type:String,default:""},ariaLabel:{required:!1,type:String,default:""},matchMax:{required:!0,type:String},matchMin:{required:!1,type:String,default:"0"}},data(){return{shapeData:null,shapeColorProperties:null,isQtiValid:!0}},inheritAttrs:!0,methods:{getIdentifier(){return this.identifier},getShape(){return this.shape},getShapeData(){return this.shapeData},setShapeData(){const e=this.coords.split(",");switch(this.getShape()){case"circle":if(e.length!=3)return;this.shapeData=e;return;case"rect":if(e.length!==4)return;e[2]=parseInt(e[2])-parseInt(e[0]),e[3]=parseInt(e[3])-parseInt(e[1]),this.shapeData=e;return;case"poly":this.shapeData=this.transformPolyCoords(e);return;case"ellipse":if(e.length!=4)return;this.shapeData=e;return;case"default":this.shapeData="";return}},transformPolyCoords(e){let t=[];if(e.length%2!=0)return t;for(let i=0;i<e.length;i+=2)t.push(`${e[i]} ${e[i+1]}`);return t},initialize(){e0.validateShapeAttribute(this.shape),this.setShapeData()}},created(){try{this.initialize()}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new h(e.message)}},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},i0=["data-identifier","data-match-max","data-match-min","data-match-group"];function n0(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",{ref:"gap","data-identifier":i.identifier,"data-match-max":i.matchMax,"data-match-min":i.matchMin,"data-match-group":i.matchGroup,class:"ggm-gap"},null,8,i0)}const s0=te(t0,[["render",n0]]),r0=new re,a0=new me,o0={name:"QtiSimpleMatchSet",data(){return{choices:[],isShuffle:!1,isQtiValid:!0}},methods:{getChoices(){return this.choices},setIsShuffle(e){this.isShuffle=e},createContainer(e,t){let i=[];return e===null?(this.choices.forEach(s=>{i.push({fixed:s.fixed==="true",node:s})}),this.isShuffle&&a0.shuffleArrayFixed(i),i):(e.state.orders[t].forEach(s=>{const r=this.findChoiceByIdentifier(s,this.choices);r!==null&&i.push({fixed:r.fixed==="true",node:r})},this),i)},processContainerChoices(e){this.choices.splice(0,this.choices.length),this.$refs.matchset.innerHTML="",e.forEach(t=>{this.$refs.matchset.appendChild(t.node.$el),this.choices.push(t.node)},this)},validateChildren(){let e=0;if(!this.$slots.default)throw new h("Must have at least 1 qti-simple-associable-choice");if(this.$slots.default().forEach(t=>{if(r0.isValidSlot(t)){if(t.type.name==="QtiSimpleAssociableChoice")return e+=1;throw new h('Node is not a qti-simple-associable-choice: "'+t.type.name+'"')}}),e===0)throw new h("Must have at least 1 qti-simple-associable-choice")},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&this.choices.push(t.component.proxy)})},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new ee('Match Interaction State Invalid. Choice identifier "'+e+'" not found.')}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),console.log("["+this.$options.name+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},l0={ref:"matchset",class:"qti-simple-match-set"};function u0(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("ul",l0,[l.renderSlot(e.$slots,"default")],512)}const c0=te(o0,[["render",u0]]);class h0{constructor(t){this.constants={QTI_CHOICES_TOP:"qti-choices-top",QTI_CHOICES_BOTTOM:"qti-choices-bottom",QTI_CHOICES_LEFT:"qti-choices-left",QTI_CHOICES_RIGHT:"qti-choices-right",DATA_MAX_SELECTIONS_MESSAGE:"data-max-selections-message",DATA_MIN_SELECTIONS_MESSAGE:"data-min-selections-message",DATA_CHOICES_CONTAINER_WIDTH:null},this.parentClass=t,this.clazzTokens=[],this.gapMatchGroupElement=null,this.gapChoiceWrapperElement=null,this.gapTargetWrapperElement=null,this.choicesContainerWidth=null,this.gapChoices=[],this.gaps=[],this.presentation_Choices_Orientation=null,this.presentation_MaxSelectionsMessage="",this.presentation_MinSelectionsMessage=""}initialize(t,i,n,s,r,a){this.gapMatchGroupElement=t,this.gapChoiceWrapperElement=i,this.gapTargetWrapperElement=n,this.choicesContainerWidth=s,this.gapChoices=r,this.gaps=a,this.processRootClassAttribute(this.parentClass),this.processPresentation()}processRootClassAttribute(t){const i=t.split(" ");for(let n=0;n<i.length;n++)switch(i[n]){case this.constants.QTI_CHOICES_TOP:case this.constants.QTI_CHOICES_BOTTOM:case this.constants.QTI_CHOICES_LEFT:case this.constants.QTI_CHOICES_RIGHT:this.presentation_Choices_Orientation=i[n];break}this.clazzTokens=i}processPresentation(){this.presentation_Choices_Orientation===null&&(this.presentation_Choices_Orientation=this.constants.QTI_CHOICES_TOP),this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_LEFT?(this.gapChoiceWrapperElement.classList.add(this.constants.QTI_CHOICES_LEFT),this.gapTargetWrapperElement.classList.add(this.constants.QTI_CHOICES_LEFT),this.gapMatchGroupElement.classList.add(this.constants.QTI_CHOICES_LEFT)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_TOP?(this.gapChoiceWrapperElement.classList.add(this.constants.QTI_CHOICES_TOP),this.gapTargetWrapperElement.classList.add(this.constants.QTI_CHOICES_TOP)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_RIGHT?(this.gapChoiceWrapperElement.classList.add(this.constants.QTI_CHOICES_RIGHT),this.gapTargetWrapperElement.classList.add(this.constants.QTI_CHOICES_RIGHT),this.gapMatchGroupElement.classList.add(this.constants.QTI_CHOICES_RIGHT),this.gapMatchGroupElement.insertBefore(this.gapTargetWrapperElement,this.gapChoiceWrapperElement)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_BOTTOM&&(this.gapChoiceWrapperElement.classList.add(this.constants.QTI_CHOICES_BOTTOM),this.gapTargetWrapperElement.classList.add(this.constants.QTI_CHOICES_BOTTOM),this.gapMatchGroupElement.insertBefore(this.gapTargetWrapperElement,this.gapChoiceWrapperElement)),this.processChoicesContainerWidth(),this.processGaps()}processChoicesContainerWidth(){this.choicesContainerWidth!==null&&(this.gapChoiceWrapperElement.style.width=`${this.choicesContainerWidth}px`)}processGaps(){for(let t=0;t<this.gaps.length;t++)this.gaps[t].classList.add("target")}}class d0{constructor(t,i){Je(this,"options",{interactionSubType:"default",cardinality:"single",maxAssociations:0,response:null,onReady:null,onUpdate:null,onSelectionsLimit:null});return this.qtiAttributeValidation=new re,this.wrapper=t,this.sourcewrapper=this.wrapper.querySelector(".qti-gap-match-source-wrapper"),this.targetwrapper=this.wrapper.querySelector(".qti-gap-match-target-wrapper"),this.processOptions(i),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragMove=this.handleDragMove.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.itemTarget=null,this.itemStart=null,this.isItemStartSource=!0,this.initialX=0,this.initialY=0,this.offsetX=0,this.offsetY=0,this.startingX=0,this.startingY=0,this.currentAssociationsCount=0,this.isDisabled=!1,this.currentDragger=null,this.initializeSources(this.sourcewrapper),this.initializeTargets(this.targetwrapper),this.restoreResponse(this.options.response),this.notifyReady(),this}processOptions(t){"interactionSubType"in t&&(this.options.interactionSubType=t.interactionSubType),"cardinality"in t&&(this.options.cardinality=t.cardinality),"response"in t&&(this.options.response=t.response),"maxAssociations"in t&&(this.options.maxAssociations=t.maxAssociations),"onReady"in t&&(this.options.onReady=t.onReady),"onUpdate"in t&&(this.options.onUpdate=t.onUpdate),"onAssociationsLimit"in t&&(this.options.onAssociationsLimit=t.onAssociationsLimit)}notifyReady(){this.options.onReady!==null&&this.options.onReady({response:this.getResponse()})}notifyUpdate(){this.options.onUpdate!==null&&this.options.onUpdate({response:this.computeResponse()})}notifyAssociationsLimit(){this.options.onAssociationsLimit!==null&&this.options.onAssociationsLimit()}toggleDisable(t){this.isDisabled=t,this.draggers.forEach(i=>{t?i.classList.add("disabled"):i.classList.remove("disabled")})}handleDragStart(t){if(t.preventDefault(),!this.isDisabled&&t.button==0)return this.interactionStart(t.target,t.clientX,t.clientY,!1),!1}handleTouchStart(t){if(t.preventDefault(),!this.isDisabled)return t.targetTouches.length!=1||this.interactionStart(t.target,t.touches[0].pageX,t.touches[0].pageY,!0),!1}interactionStart(t,i,n,s){const r=this.getClosestElement(t,"draggable");this.itemStart=r.parentNode,this.isItemStartSource=this.itemStart.classList.contains("source"),this.identifyTargets(this.itemStart,!0),this.itemTarget=null;const a=r.getBoundingClientRect();this.initialX=i,this.initialY=n,this.startingX=a.left,this.startingY=a.top,this.offsetX=i-this.startingX,this.offsetY=n-this.startingY,this.addPlaceholder(r),r.style.userSelect="none",r.style.width=a.width+"px",r.style.height=a.height+"px",r.style.transform=`translateX(${a.left}px) translateY(${a.top}px) translateZ(0)`,r.classList.add("dragging"),this.setCurrentDragger(r),this.addListeners(r,s)}handleDragMove(t){t.preventDefault(),!this.isDisabled&&this.interactionMove(t.clientX,t.clientY)}handleTouchMove(t){t.preventDefault(),!this.isDisabled&&t.targetTouches.length==1&&this.interactionMove(t.touches[0].clientX,t.touches[0].clientY)}interactionMove(t,i){const n=this.currentDragger;this.offsetX=t-this.initialX,this.offsetY=i-this.initialY,this.constrainDraggerToWrapper(n,this.wrapper),n.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0) scale(1)`;const s=n.getBoundingClientRect();this.findDraggerItemTarget(n,s,this.targets),this.isItemStartSource||this.findSourceDraggerTarget(n,s)}constrainDraggerToWrapper(t,i){const n=t.getBoundingClientRect(),s=i.getBoundingClientRect(),r=this.startingX+this.offsetX-s.x,a=this.startingY+this.offsetY-s.y,c=this.startingX+n.width+this.offsetX-(s.x+s.width),y=this.startingY+n.height+this.offsetY-(s.y+s.height);r<0&&(this.offsetX=this.offsetX-r),c>0&&(this.offsetX=this.offsetX-c),a<0&&(this.offsetY=this.offsetY-a),y>0&&(this.offsetY=this.offsetY-y)}handleDragEnd(t){this.isDisabled||this.interactionEnd(t.clientX,t.clientY,!1)}handleTouchEnd(t){this.isDisabled||this.interactionEnd(t.changedTouches[0].clientX,t.changedTouches[0].clientY,!0)}interactionEnd(t,i,n){const s=this.currentDragger;if(this.itemTarget===null?s.style.transform=`translateX(${this.startingX}px) translateY(${this.startingY}px) translateZ(0)`:s.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0)`,s.removeAttribute("style"),s.classList.remove("dragging"),this.clearTargetHighlights(),this.itemTarget===null){this.resetDraggerToItemStart(this.itemStart,s),this.setCurrentDragger(null),this.removeListeners(s,n);return}if(this.itemTarget.classList.contains("active")){if(this.itemTarget.classList.remove("active"),this.isExceedingMaxAssociations(this.itemStart,this.itemTarget,s)){this.resetDraggerToItemStart(this.itemStart,s),this.notifyAssociationsLimit(),this.setCurrentDragger(null),this.removeListeners(s,n);return}if(this.itemStart.getAttribute("data-identifier")===this.itemTarget.getAttribute("data-identifier")){this.resetDraggerToItemStart(this.itemStart,s),this.setCurrentDragger(null),this.removeListeners(s,n);return}this.removePlaceholder(s),this.setDraggerToItemTarget(this.itemTarget,s),this.itemTarget.classList.contains("source")&&(this.itemTarget.classList.add("full"),this.itemTarget.dataset.matchMax*1>0&&this.incrementRemaining(this.itemTarget),this.decrementAssociationsCount(),this.sortContainerElements(this.sourcewrapper)),this.itemStart.classList.contains("source")&&(this.itemStart.dataset.matchMax*1>0&&this.decrementRemaining(this.itemStart)===0&&this.itemStart.classList.remove("full"),this.incrementAssociationsCount()),this.itemStart.classList.contains("target")&&(this.isTargetFull(this.itemStart)?this.itemStart.classList.add("full"):this.itemStart.classList.remove("full")),this.notifyUpdate()}this.setCurrentDragger(null),this.removeListeners(s,n)}setCurrentDragger(t){this.currentDragger=t}resetDraggerToItemStart(t,i){this.replacePlaceholder(i),t.classList.contains("source")||i.setAttribute("style","width:100%")}setDraggerToItemTarget(t,i){if(t.classList.contains("source")){if(t.classList.contains("full")){const n=t.querySelector(".draggable");n!=null&&t.replaceChild(i,n);return}t.append(i);return}t.append(i),i.setAttribute("style","width:100%"),this.isTargetFull(t)?t.classList.add("full"):t.classList.remove("full")}findDraggerItemTarget(t,i,n){this.itemTarget=null,n.forEach(s=>{const r=s.getBoundingClientRect();if(i.top+t.offsetHeight/2<r.bottom&&i.right-t.offsetWidth/2>r.left&&i.bottom-t.offsetHeight/2>r.top&&i.left+t.offsetWidth/2<r.right){if(this.isItemStartSource&&s.classList.contains("source")||s.classList.contains("full")||!this.hasMatchingMatchGroup(t.parentNode,s))return;s.classList.add("active"),this.itemTarget=s}else s.classList.remove("active")},this)}findSourceDraggerTarget(t,i){const n=this.sourcewrapper.getBoundingClientRect();if(i.top+t.offsetHeight/2<n.bottom&&i.right-t.offsetWidth/2>n.left&&i.bottom-t.offsetHeight/2>n.top&&i.left+t.offsetWidth/2<n.right){for(let s=0;s<this.sources.length;s++)if(this.sources[s].dataset.identifier===t.dataset.identifier){this.sources[s].classList.add("active"),this.itemTarget=this.sources[s];break}}else for(let s=0;s<this.sources.length;s++)this.sources[s].classList.contains("active")&&this.sources[s].classList.remove("active")}addPlaceholder(t){if(!t.parentNode.classList.contains("source")){this.addPlaceholderElement(t,!1);return}const i=t.parentNode.dataset.matchMax*1;if(i===1){this.addPlaceholderElement(t,!1);return}if(i===0){this.addPlaceholderElement(t,!0);return}if(this.getRemaining(t.parentNode)===1){this.addPlaceholderElement(t,!1);return}this.addPlaceholderElement(t,!0)}addPlaceholderElement(t,i){const n=t.cloneNode(!0);this.deepCloneId(n),i?(n.classList.add("clone"),n.addEventListener("mousedown",this.handleDragStart),n.addEventListener("touchstart",this.handleTouchStart)):n.classList.add("gm-dragger-placeholder"),n.classList.add("placeholder-fade"),t.parentNode.insertBefore(n,t)}removePlaceholder(t){if(t.parentNode.classList.contains("target")){const s=t.parentNode.querySelector(".gm-dragger-placeholder");if(s===null)return;t.parentNode.removeChild(s);return}const i=t.parentNode.dataset.matchMax*1,n=t.parentNode.querySelector(".gm-dragger-placeholder");if(n===null){const s=t.parentNode.querySelector(".clone");if(s===null)return;s.classList.remove("placeholder-fade");return}i!==0&&t.parentNode.removeChild(n)}replacePlaceholder(t){const i=t.parentNode;let n=i.querySelector(".gm-dragger-placeholder");if(i.classList.contains("source")){if(n==null&&(n=i.querySelector(".draggable")),n===null)return;i.replaceChild(t,n);return}n!==null&&i.replaceChild(t,n)}addClonePlaceholder(t){const i=t.cloneNode(!0);this.deepCloneId(i),i.classList.add("clone"),t.parentNode.insertBefore(i,t),i.addEventListener("mousedown",this.handleDragStart),i.addEventListener("touchstart",this.handleTouchStart)}initializeSources(t){this.sources=t.querySelectorAll(".source"),this.sources.forEach(i=>{i.classList.add("full");const n=i.dataset.matchMax*1;this.setRemaining(i,n===0?1e3:n)},this),this.draggers=t.querySelectorAll(".draggable"),this.draggers.forEach((i,n)=>{const s=i.parentNode.getAttribute("data-identifier");i.setAttribute("data-identifier",s),i.setAttribute("data-order",n),i.setAttribute("tabindex",0),i.addEventListener("mousedown",this.handleDragStart),i.addEventListener("touchstart",this.handleTouchStart)},this)}initializeTargets(t){this.targets=t.querySelectorAll(".target"),this.targets.forEach(i=>{i.setAttribute("tabindex",0)})}identifyTargets(t,i){this.targets.forEach(n=>{i&&!n.classList.contains("full")&&this.hasMatchingMatchGroup(t,n)&&n.classList.add("target-active")},this),i&&!this.isItemStartSource&&this.sourcewrapper.classList.add("target-active")}addListeners(t,i){i?(this.removeListeners(t,i),t.addEventListener("touchmove",this.handleTouchMove),t.addEventListener("touchend",this.handleTouchEnd)):(this.removeListeners(t,i),document.addEventListener("mousemove",this.handleDragMove),document.addEventListener("mouseup",this.handleDragEnd))}removeListeners(t,i){i?(t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd)):(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd))}clearTargetHighlights(){this.targets.forEach(t=>{t.classList.remove("target-active")},this),this.sourcewrapper.classList.remove("target-active")}getClosestElement(t,i){return t?t&&t.classList.contains(i)?t:this.getClosestElement(t.parentElement,i):!1}sortContainerElements(t){let i=[],n=t.children;for(let s=0;s<n.length;s++){const r=n[s].querySelector("div.draggable");r&&i.push([1*r.dataset.order,n[s]])}i.sort(function(s,r){return s[0]-r[0]});for(let s=0;s<i.length;s++)t.appendChild(i[s][1])}getResponse(){return this.computeResponse()}computeResponse(){let t=[];return this.targets.forEach(i=>{i.querySelectorAll(".draggable").forEach(n=>{t.push(`${n.dataset.identifier} ${i.dataset.identifier}`)})}),t.length===0?null:this.options.cardinality==="single"?t[0]:t}restoreResponse(t){t!==null&&(this.options.cardinality==="single"?this.restoreResponsePair(t):t.forEach(i=>{this.restoreResponsePair(i)},this))}restoreResponsePair(t){const i=this.getPair(t);if(i===null)return;const n=this.findSourceByIdentifier(i.source),s=this.findTargetGapByIdentifier(i.target);if(n===null||s===null)return;const r=n.querySelector(".draggable");r!==null&&(this.cloneOrEmptySourceDragger(n,r),this.restoreSourceDraggerToTarget(s,r))}cloneOrEmptySourceDragger(t,i){const n=t.dataset.matchMax*1;if(n===1){t.classList.remove("full"),this.decrementRemaining(t);return}if(n===0){this.addClonePlaceholder(i);return}if(this.getRemaining(t)===1){t.classList.remove("full"),this.decrementRemaining(t);return}this.decrementRemaining(t),this.addClonePlaceholder(i)}findSourceByIdentifier(t){for(let i=0;i<this.sources.length;i++)if(t===this.sources[i].dataset.identifier)return this.sources[i];return null}findTargetGapByIdentifier(t){for(let i=0;i<this.targets.length;i++)if(t===this.targets[i].dataset.identifier)return this.targets[i];return null}getPair(t){if(t===null)return null;const i=t.split(" ");return i.length!=2?null:{source:i[0],target:i[1]}}restoreSourceDraggerToTarget(t,i){t===null||i===null||(t.append(i),i.setAttribute("style","width:100%"),this.incrementAssociationsCount(),this.isTargetFull(t)&&t.classList.add("full"))}hasMatchingMatchGroup(t,i){return t===null||i===null?!1:t.dataset.matchGroup===i.dataset.matchGroup}isTargetFull(t){if(t==null)return!1;const i=t.querySelectorAll(".draggable"),n=t.dataset.matchMax*1;return n===0?!1:i.length>=n}isExceedingMaxAssociations(t,i){return!(this.options.maxAssociations===0||i.classList.contains("source")||t.classList.contains("target")||this.currentAssociationsCount<this.options.maxAssociations)}initializeAssociationsCount(){this.currentAssociationsCount=0}incrementAssociationsCount(){this.currentAssociationsCount+=1}decrementAssociationsCount(){this.currentAssociationsCount!==0&&(this.currentAssociationsCount-=1)}getRemaining(t){return t.dataset.remaining*1}setRemaining(t,i){t.setAttribute("data-remaining",i)}incrementRemaining(t){const i=t.dataset.remaining*1+1;return t.setAttribute("data-remaining",i),i}decrementRemaining(t){let i=t.dataset.remaining*1-1;return i=i>=0?i:0,t.setAttribute("data-remaining",i),i}deepCloneId(t){t.id&&(t.id=`clone_${this.qtiAttributeValidation.randomString(5,"a")}`);for(let i=0;i<t.children.length;i++)this.deepCloneId(t.children[i])}reset(){this.resetDraggersToSources(),this.initializeAssociationsCount(),this.destroy()}resetDraggersToSources(){this.targets.forEach(t=>{t.querySelectorAll(".draggable").forEach(n=>{const s=this.findSourceByIdentifier(n.getAttribute("data-identifier"));s.classList.contains("full")||(t.classList.remove("full"),s.classList.contains("full")?t.removeChild(n):(s.append(n),s.classList.add("full")))},this)},this)}destroy(){this.currentDragger!==null&&(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd)),this.wrapper.querySelectorAll(".draggable").forEach(i=>{i.removeEventListener("touchstart",this.handleTouchStart),i.removeEventListener("touchmove",this.handleTouchMove),i.removeEventListener("touchend",this.handleTouchEnd),i.removeEventListener("mousedown",this.handleDragStart)},this)}}const f0=new re,p0=new me,m0={emits:["gapMatchGroupReady","gapMatchGroupUpdate","gapMatchGroupAssociationsLimit"],props:{responseIdentifier:{required:!0,type:String},cardinality:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},maxAssociations:{required:!1,type:String,default:"1"},minAssociations:{required:!1,type:String,default:"0"},dataChoicesContainerWidth:{required:!1,type:String,default:null},interactionSubType:{required:!1,type:String,default:"default"},gapMatchInteractionStaticClass:{required:!0,type:String},priorState:{required:!1,type:Object,default:null}},data(){return{choices:[],order:[],gaps:[],response:null,isShuffle:null,hasPrompt:!1,gapMatchInteractionClassAttribute:null,presentationFactory:null,matchable:null,isQtiValid:!0}},computed:{computedMaxAssociations(){return this.maxAssociations*1}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},disable(){this.matchable!==null&&this.matchable.toggleDisable(!0)},enable(){this.matchable!==null&&this.matchable.toggleDisable(!1)},getChoices(){return this.choices},setIsShuffle(e){this.isShuffle=e},validateChildren(){let e=0;this.$slots.default()[0].children.forEach(t=>{if(f0.isValidSlot(t)){if(t.type.name==="QtiPrompt"){if(e>0)throw new h("Invalid element order. qti-prompt must come before qti-gap-text's, qti-gap-img's, or qti-gap's");if(!this.hasPrompt)return this.hasPrompt=!0;throw new h("Maximum of 1 qti-prompt element permitted")}if(t.type.name==="QtiGapText"||t.type.name==="QtiGapImg")return e+=1;throw new h('Node is not one of qti-gap-text or qti-gap-img: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children[0].children.forEach(i=>{i.component!==null&&(i.type.name==="QtiGapText"||i.type.name==="QtiGapImg")&&this.choices.push(i.component.proxy)}),this.$refs.root.querySelectorAll(".gap-match-gap").forEach(i=>{this.gaps.push(i)})},insertAfter(e,t){t.parentNode.insertBefore(e,t.nextSibling)},processGroupUI(e){let t=this.createGapChoiceWrapper();if(t==null)return;let i=this.createContainer(this.priorState);this.processContainerChoices(i,t),this.saveContainerOrder(i);let n=this.createGapTargetWrapper(t);this.presentationFactory.initialize(this.$refs.root,t,n,this.dataChoicesContainerWidth,this.choices,this.gaps),this.matchable=new d0(this.$refs.root,{interactionSubType:this.interactionSubType,cardinality:this.cardinality,maxAssociations:this.computedMaxAssociations,response:e,onReady:this.handleWidgetReady,onUpdate:this.handleWidgetUpdate,onAssociationsLimit:this.handleAssociationsLimit})},createGapChoiceWrapper(){let e=this.$refs.root.querySelector(".qti-gap-choice");if(e===null)return null;let t=document.createElement("ul");return t.classList.add("qti-gap-match-source-wrapper"),this.$refs.root.insertBefore(t,e),t},createGapTargetWrapper(e){const t=document.createElement("div");t.classList.add("qti-gap-match-target-wrapper"),this.insertAfter(t,e);const i=t.nextElementSibling;return i!=null&&t.append(i),t},createContainer(e){let t=[];return e===null?(this.choices.forEach(n=>{t.push({fixed:n.fixed==="true",node:n})}),this.isShuffle&&p0.shuffleArrayFixed(t),t):(e.state.order.forEach(n=>{const s=this.findChoiceByIdentifier(n,this.choices);s!==null&&t.push({fixed:s.fixed==="true",node:s})},this),t)},processContainerChoices(e,t){this.choices.splice(0,this.choices.length),t.innerHTML="",e.forEach(i=>{t.appendChild(i.node.$el),this.choices.push(i.node)},this)},saveContainerOrder(e){const t=[];e.forEach(i=>{t.push(i.node.identifier)}),this.order=t},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new ee('Gap Match Interaction State Invalid. Choice identifier "'+e+'" not found.')},resetGroupUI(){this.processGroupUI(null)},handleWidgetReady(e){this.setResponse(e.response),this.$emit("gapMatchGroupReady",{response:this.getResponse(),order:this.order})},handleWidgetUpdate(e){this.setResponse(e.response),this.$emit("gapMatchGroupUpdate",{response:this.getResponse()})},handleAssociationsLimit(){this.$emit("gapMatchGroupAssociationsLimit")},initializeGapMatchGroup(){this.presentationFactory=new h0(this.gapMatchInteractionStaticClass)}},created(){try{if(typeof this.cardinality>"u")throw new h("Undefined qti-gap-match-interaction cardinality");if(this.cardinality!=="single"&&this.cardinality!=="multiple")throw new h('qti-gap-match-interaction cardinality must be "single" or "multiple"');this.setIsShuffle(this.shuffle==="true"),this.initializeGapMatchGroup(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,console.log("[QtiGapMatchInteraction][ValidationError]",e.name,e.message),new h(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.processGroupUI(this.priorState===null?null:this.priorState.value)}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw console.log("[QtiGapMatchInteraction][ValidationException]",e.message),new h(e.message);if(e.name==="QtiEvaluationException")throw console.log("[QtiGapMatchInteraction][EvaluationException]",e.message),new ee(e.message)}},beforeUnmount(){this.matchable!==null&&(this.matchable.destroy(),this.matchable=null)}},g0={ref:"root",class:"qti-gap-match-group-wrapper"};function y0(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",g0,[l.renderSlot(e.$slots,"default")],512)}const v0=te(m0,[["render",y0]]);class w0{constructor(t){this.constants={QTI_SELECTIONS_LIGHT:"qti-selections-light",QTI_SELECTIONS_DARK:"qti-selections-dark",QTI_UNSELECTED_HIDDEN:"qti-unselected-hidden",QTI_CHOICES_TOP:"qti-choices-top",QTI_CHOICES_BOTTOM:"qti-choices-bottom",QTI_CHOICES_LEFT:"qti-choices-left",QTI_CHOICES_RIGHT:"qti-choices-right",DATA_MAX_SELECTIONS_MESSAGE:"data-max-selections-message",DATA_MIN_SELECTIONS_MESSAGE:"data-min-selections-message",DATA_CHOICES_CONTAINER_WIDTH:null},this.parentClass=t,this.clazzTokens=[],this.ggmGroupElement=null,this.ggmChoiceWrapperElement=null,this.ggmTargetWrapperElement=null,this.image=null,this.choicesContainerWidth=null,this.gapChoices=[],this.gaps=[],this.presentation_Choices_Orientation=null,this.presentation_Theme=this.constants.QTI_SELECTIONS_DARK,this.presentation_UnselectedHidden=!1,this.presentation_MaxSelectionsMessage="",this.presentation_MinSelectionsMessage=""}initialize(t,i,n,s,r,a,c){this.ggmGroupElement=t,this.ggmChoiceWrapperElement=i,this.ggmTargetWrapperElement=n,this.image=s,this.choicesContainerWidth=r,this.gapChoices=a,this.gaps=c,this.processRootClassAttribute(this.parentClass),this.processPresentation()}processRootClassAttribute(t){const i=t.split(" ");for(let n=0;n<i.length;n++)switch(i[n]){case this.constants.QTI_CHOICES_TOP:case this.constants.QTI_CHOICES_BOTTOM:case this.constants.QTI_CHOICES_LEFT:case this.constants.QTI_CHOICES_RIGHT:this.presentation_Choices_Orientation=i[n];break;case this.constants.QTI_SELECTIONS_DARK:case this.constants.QTI_SELECTIONS_LIGHT:this.presentation_Theme=i[n];break;case this.constants.QTI_UNSELECTED_HIDDEN:this.presentation_UnselectedHidden=!0;break}this.clazzTokens=i}processPresentation(){this.presentation_Choices_Orientation===null&&(this.presentation_Choices_Orientation=this.constants.QTI_CHOICES_TOP),this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_LEFT?(this.ggmChoiceWrapperElement.classList.add(this.constants.QTI_CHOICES_LEFT),this.ggmTargetWrapperElement.classList.add(this.constants.QTI_CHOICES_LEFT),this.ggmGroupElement.classList.add(this.constants.QTI_CHOICES_LEFT)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_TOP?(this.ggmChoiceWrapperElement.classList.add(this.constants.QTI_CHOICES_TOP),this.ggmTargetWrapperElement.classList.add(this.constants.QTI_CHOICES_TOP)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_RIGHT?(this.ggmChoiceWrapperElement.classList.add(this.constants.QTI_CHOICES_RIGHT),this.ggmTargetWrapperElement.classList.add(this.constants.QTI_CHOICES_RIGHT),this.ggmGroupElement.classList.add(this.constants.QTI_CHOICES_RIGHT),this.ggmGroupElement.insertBefore(this.ggmTargetWrapperElement,this.ggmChoiceWrapperElement)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_BOTTOM&&(this.ggmChoiceWrapperElement.classList.add(this.constants.QTI_CHOICES_BOTTOM),this.ggmTargetWrapperElement.classList.add(this.constants.QTI_CHOICES_BOTTOM),this.ggmGroupElement.insertBefore(this.ggmTargetWrapperElement,this.ggmChoiceWrapperElement)),this.processBackgroundImage(),this.processChoicesContainerWidth(),this.processGaps()}processBackgroundImage(){if(this.image===null)return;this.image.setAttribute("draggable","false");const t=this.image.getBoundingClientRect();this.ggmTargetWrapperElement.style.width=`${t.width}px`,this.ggmTargetWrapperElement.style.height=`${t.height}px`}processChoicesContainerWidth(){this.choicesContainerWidth!==null&&(this.ggmChoiceWrapperElement.style.width=`${this.choicesContainerWidth}px`,this.ggmChoiceWrapperElement.style.textAlign="center")}processGaps(){for(let t=0;t<this.gaps.length;t++){const i=this.gaps[t];this.setGapStyle(i,i.getShape(),i.getShapeData()),this.gaps[t].$refs.gap.classList.add("target",this.presentation_Theme),this.presentation_UnselectedHidden&&this.gaps[t].$refs.gap.classList.add(this.constants.QTI_UNSELECTED_HIDDEN)}}setGapStyle(t,i,n){switch(i){case"rect":t.$refs.gap.style.left=`${n[0]}px`,t.$refs.gap.style.top=`${n[1]}px`,t.$refs.gap.style.width=`${n[2]}px`,t.$refs.gap.style.height=`${n[3]}px`;break}}}class b0{constructor(t,i){Je(this,"options",{interactionSubType:"default",cardinality:"multiple",maxAssociations:0,response:null,onReady:null,onUpdate:null,onSelectionsLimit:null,zindex:1e3});return this.qtiAttributeValidation=new re,this.wrapper=t,this.sourcewrapper=this.wrapper.querySelector(".qti-ggm-source-wrapper"),this.targetwrapper=this.wrapper.querySelector(".qti-ggm-target-wrapper"),this.processOptions(i),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragMove=this.handleDragMove.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.itemTarget=null,this.itemStart=null,this.isItemStartSource=!0,this.savedGapZindex="",this.initialX=0,this.initialY=0,this.offsetX=0,this.offsetY=0,this.startingX=0,this.startingY=0,this.currentAssociationsCount=0,this.isDisabled=!1,this.currentDragger=null,this.initializeSources(this.sourcewrapper),this.initializeTargets(this.targetwrapper),this.restoreResponse(this.options.response),this.notifyReady(),this}processOptions(t){"interactionSubType"in t&&(this.options.interactionSubType=t.interactionSubType),"cardinality"in t&&(this.options.cardinality=t.cardinality),"response"in t&&(this.options.response=t.response),"maxAssociations"in t&&(this.options.maxAssociations=t.maxAssociations),"onReady"in t&&(this.options.onReady=t.onReady),"onUpdate"in t&&(this.options.onUpdate=t.onUpdate),"onAssociationsLimit"in t&&(this.options.onAssociationsLimit=t.onAssociationsLimit)}notifyReady(){this.options.onReady!==null&&this.options.onReady({response:this.getResponse()})}notifyUpdate(){this.options.onUpdate!==null&&this.options.onUpdate({response:this.computeResponse()})}notifyAssociationsLimit(){this.options.onAssociationsLimit!==null&&this.options.onAssociationsLimit()}toggleDisable(t){this.isDisabled=t,this.draggers.forEach(i=>{t?i.classList.add("disabled"):i.classList.remove("disabled")})}handleDragStart(t){if(t.preventDefault(),!this.isDisabled&&t.button==0)return this.interactionStart(t.target,t.clientX,t.clientY,!1),!1}handleTouchStart(t){if(t.preventDefault(),!this.isDisabled)return t.targetTouches.length!=1||this.interactionStart(t.target,t.touches[0].pageX,t.touches[0].pageY,!0),!1}interactionStart(t,i,n,s){const r=this.getClosestElement(t,"draggable");this.itemStart=r.parentNode,this.isItemStartSource=this.itemStart.classList.contains("source"),this.isItemStartSource||this.saveGapZindex(this.itemStart),this.identifyTargets(this.itemStart,!0),this.itemTarget=null;const a=r.getBoundingClientRect();this.initialX=i,this.initialY=n,this.startingX=a.left,this.startingY=a.top,this.offsetX=i-this.startingX,this.offsetY=n-this.startingY,this.addPlaceholder(r),r.classList.add("dragging"),r.style.userSelect="none",r.style.width=a.width+"px",r.style.height=a.height+"px",r.style.transform=`translateX(${a.left}px) translateY(${a.top}px) translateZ(0)`,this.setCurrentDragger(r),this.addListeners(r,s)}handleDragMove(t){t.preventDefault(),!this.isDisabled&&this.interactionMove(t.clientX,t.clientY)}handleTouchMove(t){t.preventDefault(),!this.isDisabled&&t.targetTouches.length==1&&this.interactionMove(t.touches[0].clientX,t.touches[0].clientY)}interactionMove(t,i){const n=this.currentDragger;this.offsetX=t-this.initialX,this.offsetY=i-this.initialY,this.constrainDraggerToWrapper(n,this.wrapper),n.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0) scale(1)`;const s=n.getBoundingClientRect();this.findDraggerItemTarget(n,s,this.targets),this.isItemStartSource||this.findSourceDraggerTarget(n,s)}constrainDraggerToWrapper(t,i){const n=t.getBoundingClientRect(),s=i.getBoundingClientRect(),r=this.startingX+this.offsetX-s.x,a=this.startingY+this.offsetY-s.y,c=this.startingX+n.width+this.offsetX-(s.x+s.width),y=this.startingY+n.height+this.offsetY-(s.y+s.height);r<0&&(this.offsetX=this.offsetX-r),c>0&&(this.offsetX=this.offsetX-c),a<0&&(this.offsetY=this.offsetY-a),y>0&&(this.offsetY=this.offsetY-y)}handleDragEnd(t){this.isDisabled||this.interactionEnd(t.clientX,t.clientY,!1)}handleTouchEnd(t){this.isDisabled||this.interactionEnd(t.changedTouches[0].clientX,t.changedTouches[0].clientY,!0)}interactionEnd(t,i,n){const s=this.currentDragger;if(this.itemTarget===null?s.style.transform=`translateX(${this.startingX}px) translateY(${this.startingY}px) translateZ(0)`:s.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0)`,s.removeAttribute("style"),s.classList.remove("dragging"),this.clearTargetHighlights(),this.itemTarget===null){this.resetDraggerToItemStart(this.itemStart,s),this.setCurrentDragger(null),this.removeListeners(s,n);return}if(this.itemTarget.classList.contains("active")){if(this.itemTarget.classList.remove("active"),this.isExceedingMaxAssociations(this.itemStart,this.itemTarget,s)){this.resetDraggerToItemStart(this.itemStart,s),this.notifyAssociationsLimit(),this.setCurrentDragger(null),this.removeListeners(s,n);return}if(this.itemStart.getAttribute("data-identifier")===this.itemTarget.getAttribute("data-identifier")){this.resetDraggerToItemStart(this.itemStart,s),this.setCurrentDragger(null),this.removeListeners(s,n);return}this.removePlaceholder(s),this.setDraggerToItemTarget(this.itemTarget,s),this.itemTarget.classList.contains("source")&&(this.itemTarget.classList.add("full"),this.itemTarget.dataset.matchMax*1>0&&this.incrementRemaining(this.itemTarget),this.decrementAssociationsCount(),this.sortContainerElements(this.sourcewrapper)),this.itemStart.classList.contains("source")&&(this.itemStart.dataset.matchMax*1>0&&this.decrementRemaining(this.itemStart)===0&&this.itemStart.classList.remove("full"),this.incrementAssociationsCount()),this.itemStart.classList.contains("target")&&(this.restoreGapZindex(this.itemStart),this.isTargetFull(this.itemStart)?this.itemStart.classList.add("full","contains-choice"):(this.itemStart.classList.remove("full"),this.containsChoices(this.itemStart)?this.itemStart.classList.add("contains-choice"):this.itemStart.classList.remove("contains-choice"))),this.notifyUpdate()}this.setCurrentDragger(null),this.removeListeners(s,n)}setCurrentDragger(t){this.currentDragger=t}resetDraggerToItemStart(t,i){t.classList.contains("target")&&this.restoreGapZindex(t),this.replacePlaceholder(i)}setDraggerToItemTarget(t,i){if(t.classList.contains("source")){this.appendDraggerToSourceTarget(t,i);return}this.appendDraggerToGapTarget(t,i),this.isTargetFull(t)?t.classList.add("full"):t.classList.remove("full")}appendDraggerToSourceTarget(t,i){if(t.classList.contains("full")){const n=t.querySelector(".draggable");n!=null&&t.replaceChild(i,n);return}t.append(i)}appendDraggerToGapTarget(t,i){t.classList.add("contains-choice"),t.append(i)}findDraggerItemTarget(t,i,n){this.itemTarget=null,n.forEach(s=>{const r=s.getBoundingClientRect();if(i.top+t.offsetHeight/2<r.bottom&&i.right-t.offsetWidth/2>r.left&&i.bottom-t.offsetHeight/2>r.top&&i.left+t.offsetWidth/2<r.right){if(this.isItemStartSource&&s.classList.contains("source")||s.classList.contains("full")||!this.hasMatchingMatchGroup(t.parentNode,s))return;s.classList.add("active"),this.itemTarget=s}else s.classList.remove("active")},this)}findSourceDraggerTarget(t,i){const n=this.sourcewrapper.getBoundingClientRect();if(i.top+t.offsetHeight/2<n.bottom&&i.right-t.offsetWidth/2>n.left&&i.bottom-t.offsetHeight/2>n.top&&i.left+t.offsetWidth/2<n.right){for(let s=0;s<this.sources.length;s++)if(this.sources[s].dataset.identifier===t.dataset.identifier){this.sources[s].classList.add("active"),this.itemTarget=this.sources[s];break}}else for(let s=0;s<this.sources.length;s++)this.sources[s].classList.contains("active")&&this.sources[s].classList.remove("active")}addPlaceholder(t){if(!t.parentNode.classList.contains("source")){this.addPlaceholderElement(t,!1);return}const i=t.parentNode.dataset.matchMax*1;if(i===1){this.addPlaceholderElement(t,!1);return}if(i===0){this.addPlaceholderElement(t,!0);return}if(this.getRemaining(t.parentNode)===1){this.addPlaceholderElement(t,!1);return}this.addPlaceholderElement(t,!0)}addPlaceholderElement(t,i){const n=t.cloneNode(!0);this.deepCloneId(n),i?(n.classList.add("clone"),n.addEventListener("mousedown",this.handleDragStart),n.addEventListener("touchstart",this.handleTouchStart)):n.classList.add("ggm-dragger-placeholder"),n.classList.add("placeholder-fade"),t.parentNode.insertBefore(n,t)}removePlaceholder(t){if(t.parentNode.classList.contains("target")){const s=t.parentNode.querySelector(".ggm-dragger-placeholder");if(s===null)return;t.parentNode.removeChild(s);return}const i=t.parentNode.dataset.matchMax*1,n=t.parentNode.querySelector(".ggm-dragger-placeholder");if(n===null){const s=t.parentNode.querySelector(".clone");if(s===null)return;s.classList.remove("placeholder-fade");return}i!==0&&t.parentNode.removeChild(n)}replacePlaceholder(t){const i=t.parentNode;let n=i.querySelector(".ggm-dragger-placeholder");if(i.classList.contains("source")){if(n==null&&(n=i.querySelector(".draggable")),n===null)return;i.replaceChild(t,n);return}n!==null&&i.replaceChild(t,n)}addClonePlaceholder(t){const i=t.cloneNode(!0);this.deepCloneId(i),i.classList.add("clone"),t.parentNode.insertBefore(i,t),i.addEventListener("mousedown",this.handleDragStart),i.addEventListener("touchstart",this.handleTouchStart)}initializeSources(t){this.sources=t.querySelectorAll(".source"),this.sources.forEach(i=>{i.classList.add("full");const n=i.dataset.matchMax*1;this.setRemaining(i,n===0?1e3:n)},this),this.draggers=t.querySelectorAll(".draggable"),this.draggers.forEach((i,n)=>{const s=i.parentNode.getAttribute("data-identifier");i.setAttribute("data-identifier",s),i.setAttribute("data-order",n),i.setAttribute("tabindex",0),i.addEventListener("mousedown",this.handleDragStart),i.addEventListener("touchstart",this.handleTouchStart)},this)}initializeTargets(t){this.targets=t.querySelectorAll(".target"),this.targets.forEach(i=>{i.setAttribute("tabindex",0)})}identifyTargets(t,i){this.targets.forEach(n=>{i&&!n.classList.contains("full")&&this.hasMatchingMatchGroup(t,n)&&n.classList.add("target-active")},this),i&&!this.isItemStartSource&&this.sourcewrapper.classList.add("target-active")}addListeners(t,i){i?(this.removeListeners(t,i),t.addEventListener("touchmove",this.handleTouchMove),t.addEventListener("touchend",this.handleTouchEnd)):(this.removeListeners(t,i),document.addEventListener("mousemove",this.handleDragMove),document.addEventListener("mouseup",this.handleDragEnd))}removeListeners(t,i){i?(t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd)):(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd))}clearTargetHighlights(){this.targets.forEach(t=>{t.classList.remove("target-active")},this),this.sourcewrapper.classList.remove("target-active")}getClosestElement(t,i){return t?t&&t.classList.contains(i)?t:this.getClosestElement(t.parentElement,i):!1}sortContainerElements(t){let i=[],n=t.children;for(let s=0;s<n.length;s++){const r=n[s].querySelector("div.draggable");r&&i.push([1*r.dataset.order,n[s]])}i.sort(function(s,r){return s[0]-r[0]});for(let s=0;s<i.length;s++)t.appendChild(i[s][1])}saveGapZindex(t){this.savedGapZindex=t.style.zIndex,t.style.zIndex=this.options.zindex}restoreGapZindex(t){t.style.zIndex=this.savedGapZindex}getResponse(){return this.computeResponse()}computeResponse(){let t=[];return this.targets.forEach(i=>{i.querySelectorAll(".draggable").forEach(n=>{t.push(`${n.dataset.identifier} ${i.dataset.identifier}`)})}),t.length===0?null:this.options.cardinality==="single"?t[0]:t}restoreResponse(t){t!==null&&(this.options.cardinality==="single"?this.restoreResponsePair(t):t.forEach(i=>{this.restoreResponsePair(i)},this))}restoreResponsePair(t){const i=this.getPair(t);if(i===null)return;const n=this.findSourceByIdentifier(i.source),s=this.findTargetGapByIdentifier(i.target);if(n===null||s===null)return;const r=n.querySelector(".draggable");r!==null&&(this.cloneOrEmptySourceDragger(n,r),this.restoreSourceDraggerToTarget(s,r))}cloneOrEmptySourceDragger(t,i){const n=t.dataset.matchMax*1;if(n===1){t.classList.remove("full"),this.decrementRemaining(t);return}if(n===0){this.addClonePlaceholder(i);return}if(this.getRemaining(t)===1){t.classList.remove("full"),this.decrementRemaining(t);return}this.decrementRemaining(t),this.addClonePlaceholder(i)}findSourceByIdentifier(t){for(let i=0;i<this.sources.length;i++)if(t===this.sources[i].dataset.identifier)return this.sources[i];return null}findTargetGapByIdentifier(t){for(let i=0;i<this.targets.length;i++)if(t===this.targets[i].dataset.identifier)return this.targets[i];return null}getPair(t){if(t===null)return null;const i=t.split(" ");return i.length!=2?null:{source:i[0],target:i[1]}}restoreSourceDraggerToTarget(t,i){t===null||i===null||(this.appendDraggerToGapTarget(t,i),this.incrementAssociationsCount(),this.isTargetFull(t)&&t.classList.add("full"))}hasMatchingMatchGroup(t,i){return t===null||i===null?!1:t.dataset.matchGroup===i.dataset.matchGroup}isTargetFull(t){if(t==null)return!1;const i=t.querySelectorAll(".draggable"),n=t.dataset.matchMax*1;return n===0?!1:i.length>=n}containsChoices(t){return t==null?!1:t.querySelectorAll(".draggable").length!==0}isExceedingMaxAssociations(t,i){return!(this.options.maxAssociations===0||i.classList.contains("source")||t.classList.contains("target")||this.currentAssociationsCount<this.options.maxAssociations)}initializeAssociationsCount(){this.currentAssociationsCount=0}incrementAssociationsCount(){this.currentAssociationsCount+=1}decrementAssociationsCount(){this.currentAssociationsCount!==0&&(this.currentAssociationsCount-=1)}getRemaining(t){return t.dataset.remaining*1}setRemaining(t,i){t.setAttribute("data-remaining",i)}incrementRemaining(t){const i=t.dataset.remaining*1+1;return t.setAttribute("data-remaining",i),i}decrementRemaining(t){let i=t.dataset.remaining*1-1;return i=i>=0?i:0,t.setAttribute("data-remaining",i),i}deepCloneId(t){t.id&&(t.id=`clone_${this.qtiAttributeValidation.randomString(5,"a")}`);for(let i=0;i<t.children.length;i++)this.deepCloneId(t.children[i])}reset(){this.resetDraggersToSources(),this.initializeAssociationsCount(),this.destroy()}resetDraggersToSources(){this.targets.forEach(t=>{t.querySelectorAll(".draggable").forEach(n=>{const s=this.findSourceByIdentifier(n.getAttribute("data-identifier"));s.classList.contains("full")||(s.classList.contains("full")?t.removeChild(n):(s.append(n),s.classList.add("full")))},this),t.classList.remove("full","contains-choice")},this)}destroy(){this.currentDragger!==null&&(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd)),this.wrapper.querySelectorAll(".draggable").forEach(i=>{i.removeEventListener("touchstart",this.handleTouchStart),i.removeEventListener("touchmove",this.handleTouchMove),i.removeEventListener("touchend",this.handleTouchEnd),i.removeEventListener("mousedown",this.handleDragStart)},this)}}const E0=new re,S0=new me,T0={emits:["ggmGroupReady","ggmGroupUpdate","ggmGroupAssociationsLimit"],props:{responseIdentifier:{required:!0,type:String},cardinality:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},maxAssociations:{required:!1,type:String,default:"1"},minAssociations:{required:!1,type:String,default:"0"},dataChoicesContainerWidth:{required:!1,type:String,default:null},interactionSubType:{required:!1,type:String,default:"default"},interactionStaticClass:{required:!0,type:String},priorState:{required:!1,type:Object,default:null}},data(){return{image:null,choices:[],order:[],gaps:[],response:null,isShuffle:null,hasPrompt:!1,interactionClassAttribute:null,presentationFactory:null,matchable:null,isQtiValid:!0}},computed:{computedMaxAssociations(){return this.maxAssociations*1}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},disable(){this.matchable!==null&&this.matchable.toggleDisable(!0)},enable(){this.matchable!==null&&this.matchable.toggleDisable(!1)},getChoices(){return this.choices},setIsShuffle(e){this.isShuffle=e},validateChildren(){let e=0,t=0,i=!1;this.$slots.default()[0].children.forEach(n=>{if(E0.isValidSlot(n)){if(n.type.name==="QtiPrompt"){if(e>0||t>0||i)throw new h("Invalid element order. qti-prompt must come before the background image, qti-gap-text's, qti-gap-img's, or qti-associable-hotspot's");if(!this.hasPrompt)return this.hasPrompt=!0;throw new h("Maximum of 1 qti-prompt element permitted")}if(n.type.name==="QtiGapText"||n.type.name==="QtiGapImg"){if(t>0)throw new h("Invalid element order. qti-gap-text's and qti-gap-img's must come before qti-associable-hotspot's");return e+=1}if(n.type.name==="QtiAssociableHotspot")return t+=1;throw new h('Node is not one of qti-gap-text, qti-gap-img, or qti-associable-hotspot: "'+n.type.name+'"')}else if(n.type==="img"||n.type==="object"||n.type==="picture"){if(e>0||t>0)throw new h("Invalid element order. Background image must preceed qti-gap-text's, qti-gap-img's and qti-associable-hotspot's");i=!0}})},processChildren(){this.$.subTree.children[0].children[0].children.forEach(t=>{if(t.type==="img"||t.type==="object"||t.type==="picture"){this.image=t.el;return}t.component!==null&&(t.type.name==="QtiGapText"||t.type.name==="QtiGapImg"?this.choices.push(t.component.proxy):t.type.name==="QtiAssociableHotspot"&&this.gaps.push(t.component.proxy))})},insertAfter(e,t){t.parentNode.insertBefore(e,t.nextSibling)},processGroupUI(e){let t=this.createGapChoiceWrapper();if(t==null)return;let i=this.createGapTargetWrapper(),n=this.createContainer(this.priorState);this.processContainerChoices(n,t),this.saveContainerOrder(n),this.presentationFactory.initialize(this.$refs.root,t,i,this.image,this.dataChoicesContainerWidth,this.choices,this.gaps),this.matchable=new b0(this.$refs.root,{interactionSubType:this.interactionSubType,cardinality:this.cardinality,maxAssociations:this.computedMaxAssociations,response:e,onReady:this.handleWidgetReady,onUpdate:this.handleWidgetUpdate,onAssociationsLimit:this.handleAssociationsLimit})},createGapChoiceWrapper(){let e=this.$refs.root.querySelector(".qti-gap-choice");if(e===null)return null;let t=document.createElement("ul");return t.classList.add("qti-ggm-source-wrapper"),this.$refs.root.insertBefore(t,e),t},createGapTargetWrapper(){let e=document.createElement("div");e.classList.add("qti-ggm-target-wrapper"),e.append(this.image);for(let t=0;t<this.gaps.length;t++)e.append(this.gaps[t].$el);return this.$refs.root.append(e),e},createContainer(e){let t=[];return e===null?(this.choices.forEach(n=>{t.push({fixed:n.fixed==="true",node:n})}),this.isShuffle&&S0.shuffleArrayFixed(t),t):(e.state.order.forEach(n=>{const s=this.findChoiceByIdentifier(n,this.choices);s!==null&&t.push({fixed:s.fixed==="true",node:s})},this),t)},processContainerChoices(e,t){this.choices.splice(0,this.choices.length),t.innerHTML="",e.forEach(i=>{t.appendChild(i.node.$el),this.choices.push(i.node)},this)},saveContainerOrder(e){const t=[];e.forEach(i=>{t.push(i.node.identifier)}),this.order=t},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new ee('Gap Match Interaction State Invalid. Choice identifier "'+e+'" not found.')},resetGroupUI(){this.processGroupUI(null)},handleWidgetReady(e){this.setResponse(e.response),this.$emit("ggmGroupReady",{response:this.getResponse(),order:this.order})},handleWidgetUpdate(e){this.setResponse(e.response),this.$emit("ggmGroupUpdate",{response:this.getResponse()})},handleAssociationsLimit(){this.$emit("ggmGroupAssociationsLimit")},initializeGraphicGapMatchGroup(){this.presentationFactory=new w0(this.interactionStaticClass)}},created(){try{if(typeof this.cardinality>"u")throw new h("Undefined qti-graphic-gap-match-interaction cardinality");if(this.cardinality!=="multiple")throw new h('qti-graphic-gap-match-interaction cardinality must be "multiple"');this.setIsShuffle(this.shuffle==="true"),this.initializeGraphicGapMatchGroup(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,console.log("[QtiGapMatchInteraction][ValidationError]",e.name,e.message),new h(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.processGroupUI(this.priorState===null?null:this.priorState.value)}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw console.log("[QtiGapMatchInteraction][ValidationException]",e.message),new h(e.message);if(e.name==="QtiEvaluationException")throw console.log("[QtiGapMatchInteraction][EvaluationException]",e.message),new ee(e.message)}},beforeUnmount(){this.matchable!==null&&(this.matchable.destroy(),this.matchable=null)}},C0={ref:"root",class:"qti-ggm-group-wrapper"};function _0(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",C0,[l.renderSlot(e.$slots,"default")],512)}const x0=te(T0,[["render",_0]]);class I0{constructor(){this.constants={QTI_CHOICES_TOP:"qti-choices-top",QTI_CHOICES_BOTTOM:"qti-choices-bottom",QTI_CHOICES_LEFT:"qti-choices-left",QTI_CHOICES_RIGHT:"qti-choices-right",QTI_MATCH_TABULAR:"qti-match-tabular",QTI_HEADER_HIDDEN:"qti-header-hidden",ROW_CENTRIC:"row-centric",DATA_MAX_SELECTIONS_MESSAGE:"data-max-selections-message",DATA_MIN_SELECTIONS_MESSAGE:"data-min-selections-message",DATA_FIRST_COLUMN_HEADER:""},this.interactionSubType="default",this.parentClass="",this.clazzTokens=[],this.matchWrapperElement=null,this.matchGroupNode=null,this.matchSetNode1=null,this.matchSetNode2=null,this.choices1=[],this.choices2=[],this.presentation_Choices_Orientation=null,this.presentation_Header_Hidden=!1,this.presentation_Row_Centric=!1,this.presentation_MaxSelectionsMessage="",this.presentation_MinSelectionsMessage=""}initialize(t,i,n,s,r){this.interactionSubType=t,this.matchWrapperElement=i,this.matchGroupNode=n,this.parentClass=n.matchInteractionStaticClass,this.matchSetNode1=s,this.matchSetNode2=r,this.choices1=this.matchSetNode1.getChoices(),this.choices2=this.matchSetNode2.getChoices(),this.processRootClassAttribute(this.parentClass),this.processPresentation()}processRootClassAttribute(t){const i=t.split(" ");for(let n=0;n<i.length;n++)switch(i[n]){case this.constants.QTI_CHOICES_TOP:case this.constants.QTI_CHOICES_BOTTOM:case this.constants.QTI_CHOICES_LEFT:case this.constants.QTI_CHOICES_RIGHT:this.presentation_Choices_Orientation=i[n];break;case this.constants.QTI_MATCH_TABULAR:break;case this.constants.QTI_HEADER_HIDDEN:this.presentation_Header_Hidden=!0;break;case this.constants.ROW_CENTRIC:this.presentation_Row_Centric=!0;break}this.clazzTokens=i}processPresentation(){this.matchSetNode1.$refs.matchset.classList.add("qti-match-source-wrapper"),this.matchSetNode2.$refs.matchset.classList.add("qti-match-target-wrapper"),this.interactionSubType==="default"?(this.presentation_Choices_Orientation===null&&(this.presentation_Choices_Orientation=this.constants.QTI_CHOICES_TOP),this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_LEFT?(this.matchSetNode1.$refs.matchset.classList.add(this.constants.QTI_CHOICES_LEFT),this.matchSetNode2.$refs.matchset.classList.add(this.constants.QTI_CHOICES_LEFT)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_TOP?(this.matchSetNode1.$refs.matchset.classList.add(this.constants.QTI_CHOICES_TOP),this.matchSetNode2.$refs.matchset.classList.add(this.constants.QTI_CHOICES_TOP)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_RIGHT?(this.matchSetNode1.$refs.matchset.classList.add(this.constants.QTI_CHOICES_RIGHT),this.matchSetNode2.$refs.matchset.classList.add(this.constants.QTI_CHOICES_RIGHT),this.matchWrapperElement.insertBefore(this.matchSetNode2.$refs.matchset,this.matchSetNode1.$refs.matchset)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_BOTTOM&&(this.matchSetNode1.$refs.matchset.classList.add(this.constants.QTI_CHOICES_BOTTOM),this.matchSetNode2.$refs.matchset.classList.add(this.constants.QTI_CHOICES_BOTTOM),this.matchWrapperElement.insertBefore(this.matchSetNode2.$refs.matchset,this.matchSetNode1.$refs.matchset)),this.updateMatchSetChoices(this.matchSetNode1,!0),this.updateMatchSetChoices(this.matchSetNode2,!1)):this.interactionSubType==="matchtabular"&&(this.createMatchTable(),this.matchSetNode1.$refs.matchset.classList.add("matchset-hidden"),this.matchSetNode2.$refs.matchset.classList.add("matchset-hidden"))}updateMatchSetChoices(t,i){const n=t.getChoices();for(let s=0;s<n.length;s++)i?(n[s].$refs.choice.classList.add("source"),n[s].$refs.description.classList.add("draggable")):(n[s].$refs.choice.classList.add("target"),n[s].$refs.description.classList.add("match-target-label"))}createMatchTable(){const t=document.createElement("table");this.clazzTokens.forEach(i=>{t.classList.add(i)}),t.classList.add("matchtabular","table","table-bordered"),this.matchWrapperElement.insertBefore(t,this.matchSetNode1.$refs.matchset)}}class V0{constructor(t,i){Je(this,"options",{interactionSubType:"default",cardinality:"single",maxAssociations:0,response:null,onReady:null,onUpdate:null,onSelectionsLimit:null});return this.qtiAttributeValidation=new re,this.wrapper=t,this.sourcewrapper=this.wrapper.querySelector(".qti-match-source-wrapper"),this.targetwrapper=this.wrapper.querySelector(".qti-match-target-wrapper"),this.processOptions(i),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragMove=this.handleDragMove.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.itemTarget=null,this.itemStart=null,this.isItemStartSource=!0,this.initialX=0,this.initialY=0,this.offsetX=0,this.offsetY=0,this.startingX=0,this.startingY=0,this.currentAssociationsCount=0,this.isDisabled=!1,this.currentDragger=null,this.initializeSources(this.sourcewrapper),this.initializeTargets(this.targetwrapper),this.restoreResponse(this.options.response),this.notifyReady(),this}processOptions(t){"interactionSubType"in t&&(this.options.interactionSubType=t.interactionSubType),"cardinality"in t&&(this.options.cardinality=t.cardinality),"response"in t&&(this.options.response=t.response),"maxAssociations"in t&&(this.options.maxAssociations=t.maxAssociations),"onReady"in t&&(this.options.onReady=t.onReady),"onUpdate"in t&&(this.options.onUpdate=t.onUpdate),"onAssociationsLimit"in t&&(this.options.onAssociationsLimit=t.onAssociationsLimit)}notifyReady(){this.options.onReady!==null&&this.options.onReady({response:this.getResponse()})}notifyUpdate(){this.options.onUpdate!==null&&this.options.onUpdate({response:this.computeResponse()})}notifyAssociationsLimit(){this.options.onAssociationsLimit!==null&&this.options.onAssociationsLimit()}toggleDisable(t){this.isDisabled=t,this.draggers.forEach(i=>{t?i.classList.add("disabled"):i.classList.remove("disabled")})}handleDragStart(t){if(t.preventDefault(),!this.isDisabled&&t.button==0)return this.interactionStart(t.target,t.clientX,t.clientY,!1),!1}handleTouchStart(t){if(t.preventDefault(),!this.isDisabled)return t.targetTouches.length!=1||this.interactionStart(t.target,t.touches[0].pageX,t.touches[0].pageY,!0),!1}interactionStart(t,i,n,s){const r=this.getClosestElement(t,"draggable");this.itemStart=r.parentNode,this.isItemStartSource=this.itemStart.classList.contains("source"),this.identifyTargets(this.itemStart,!0),this.itemTarget=null;const a=r.getBoundingClientRect();this.initialX=i,this.initialY=n,this.startingX=a.left,this.startingY=a.top,this.offsetX=i-this.startingX,this.offsetY=n-this.startingY,this.addPlaceholder(r),r.style.userSelect="none",r.style.width=a.width+"px",r.style.height=a.height+"px",r.style.transform=`translateX(${a.left}px) translateY(${a.top}px) translateZ(0)`,r.classList.add("dragging"),this.setCurrentDragger(r),this.addListeners(r,s)}handleDragMove(t){t.preventDefault(),!this.isDisabled&&this.interactionMove(t.clientX,t.clientY)}handleTouchMove(t){t.preventDefault(),!this.isDisabled&&t.targetTouches.length==1&&this.interactionMove(t.touches[0].clientX,t.touches[0].clientY)}interactionMove(t,i){const n=this.currentDragger;this.offsetX=t-this.initialX,this.offsetY=i-this.initialY,this.constrainDraggerToWrapper(n,this.wrapper),n.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0) scale(1)`;const s=n.getBoundingClientRect();this.findDraggerItemTarget(n,s,this.targets),this.isItemStartSource||this.findSourceDraggerTarget(n,s)}constrainDraggerToWrapper(t,i){const n=t.getBoundingClientRect(),s=i.getBoundingClientRect(),r=this.startingX+this.offsetX-s.x,a=this.startingY+this.offsetY-s.y,c=this.startingX+n.width+this.offsetX-(s.x+s.width),y=this.startingY+n.height+this.offsetY-(s.y+s.height);r<0&&(this.offsetX=this.offsetX-r),c>0&&(this.offsetX=this.offsetX-c),a<0&&(this.offsetY=this.offsetY-a),y>0&&(this.offsetY=this.offsetY-y)}handleDragEnd(t){this.isDisabled||this.interactionEnd(t.clientX,t.clientY,!1)}handleTouchEnd(t){this.isDisabled||this.interactionEnd(t.changedTouches[0].clientX,t.changedTouches[0].clientY,!0)}interactionEnd(t,i,n){const s=this.currentDragger;if(this.itemTarget===null?s.style.transform=`translateX(${this.startingX}px) translateY(${this.startingY}px) translateZ(0)`:s.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0)`,s.removeAttribute("style"),s.classList.remove("dragging"),this.clearTargetHighlights(),this.itemTarget===null){this.resetDraggerToItemStart(this.itemStart,s),this.setCurrentDragger(null),this.removeListeners(s,n);return}if(this.itemTarget.classList.contains("active")){if(this.itemTarget.classList.remove("active"),this.isExceedingMaxAssociations(this.itemStart,this.itemTarget,s)){this.resetDraggerToItemStart(this.itemStart,s),this.notifyAssociationsLimit(),this.setCurrentDragger(null),this.removeListeners(s,n);return}if(this.itemStart.getAttribute("data-identifier")===this.itemTarget.getAttribute("data-identifier")){this.resetDraggerToItemStart(this.itemStart,s),this.setCurrentDragger(null),this.removeListeners(s,n);return}this.removePlaceholder(s),this.setDraggerToItemTarget(this.itemTarget,s),this.itemTarget.classList.contains("source")&&(this.itemTarget.classList.add("full"),this.itemTarget.dataset.matchMax*1>0&&this.incrementRemaining(this.itemTarget),this.decrementAssociationsCount(),this.sortContainerElements(this.sourcewrapper)),this.itemStart.classList.contains("source")&&(this.itemStart.dataset.matchMax*1>0&&this.decrementRemaining(this.itemStart)===0&&this.itemStart.classList.remove("full"),this.incrementAssociationsCount()),this.itemStart.classList.contains("target")&&(this.isTargetFull(this.itemStart)?this.itemStart.classList.add("full"):this.itemStart.classList.remove("full")),this.notifyUpdate()}this.setCurrentDragger(null),this.removeListeners(s,n)}setCurrentDragger(t){this.currentDragger=t}resetDraggerToItemStart(t,i){this.replacePlaceholder(i),t.classList.contains("source")||i.setAttribute("style","width:100%")}setDraggerToItemTarget(t,i){if(t.classList.contains("source")){if(t.classList.contains("full")){const n=t.querySelector(".draggable");n!=null&&t.replaceChild(i,n);return}t.append(i);return}t.append(i),i.setAttribute("style","width:100%"),this.isTargetFull(t)?t.classList.add("full"):t.classList.remove("full")}findDraggerItemTarget(t,i,n){this.itemTarget=null,n.forEach(s=>{const r=s.getBoundingClientRect();if(i.top+t.offsetHeight/2<r.bottom&&i.right-t.offsetWidth/2>r.left&&i.bottom-t.offsetHeight/2>r.top&&i.left+t.offsetWidth/2<r.right){if(this.isItemStartSource&&s.classList.contains("source")||s.classList.contains("full")||!this.hasMatchingMatchGroup(t.parentNode,s))return;s.classList.add("active"),this.itemTarget=s}else s.classList.remove("active")},this)}findSourceDraggerTarget(t,i){const n=this.sourcewrapper.getBoundingClientRect();if(i.top+t.offsetHeight/2<n.bottom&&i.right-t.offsetWidth/2>n.left&&i.bottom-t.offsetHeight/2>n.top&&i.left+t.offsetWidth/2<n.right){for(let s=0;s<this.sources.length;s++)if(this.sources[s].dataset.identifier===t.dataset.identifier){this.sources[s].classList.add("active"),this.itemTarget=this.sources[s];break}}else for(let s=0;s<this.sources.length;s++)this.sources[s].classList.contains("active")&&this.sources[s].classList.remove("active")}addPlaceholder(t){if(!t.parentNode.classList.contains("source")){this.addPlaceholderElement(t,!1);return}const i=t.parentNode.dataset.matchMax*1;if(i===1){this.addPlaceholderElement(t,!1);return}if(i===0){this.addPlaceholderElement(t,!0);return}if(this.getRemaining(t.parentNode)===1){this.addPlaceholderElement(t,!1);return}this.addPlaceholderElement(t,!0)}addPlaceholderElement(t,i){const n=t.cloneNode(!0);this.deepCloneId(n),i?(n.classList.add("clone"),n.addEventListener("mousedown",this.handleDragStart),n.addEventListener("touchstart",this.handleTouchStart)):n.classList.add("match-dragger-placeholder"),n.classList.add("placeholder-fade"),t.parentNode.insertBefore(n,t)}removePlaceholder(t){if(t.parentNode.classList.contains("target")){const s=t.parentNode.querySelector(".match-dragger-placeholder");if(s===null)return;t.parentNode.removeChild(s);return}const i=t.parentNode.dataset.matchMax*1,n=t.parentNode.querySelector(".match-dragger-placeholder");if(n===null){const s=t.parentNode.querySelector(".clone");if(s===null)return;s.classList.remove("placeholder-fade");return}i!==0&&t.parentNode.removeChild(n)}replacePlaceholder(t){const i=t.parentNode;let n=i.querySelector(".match-dragger-placeholder");if(i.classList.contains("source")){if(n==null&&(n=i.querySelector(".draggable")),n===null)return;i.replaceChild(t,n);return}n!==null&&i.replaceChild(t,n)}addClonePlaceholder(t){const i=t.cloneNode(!0);this.deepCloneId(i),i.classList.add("clone"),t.parentNode.insertBefore(i,t),i.addEventListener("mousedown",this.handleDragStart),i.addEventListener("touchstart",this.handleTouchStart)}initializeSources(t){this.sources=t.querySelectorAll(".source"),this.sources.forEach(i=>{i.classList.add("full");const n=i.dataset.matchMax*1;this.setRemaining(i,n===0?1e3:n)},this),this.draggers=t.querySelectorAll(".draggable"),this.draggers.forEach((i,n)=>{const s=i.parentNode.getAttribute("data-identifier");i.setAttribute("data-identifier",s),i.setAttribute("data-order",n),i.setAttribute("tabindex",0),i.addEventListener("mousedown",this.handleDragStart),i.addEventListener("touchstart",this.handleTouchStart)},this)}initializeTargets(t){this.targets=t.querySelectorAll(".target"),this.targets.forEach(i=>{i.setAttribute("tabindex",0)})}identifyTargets(t,i){this.targets.forEach(n=>{i&&!n.classList.contains("full")&&this.hasMatchingMatchGroup(t,n)&&n.classList.add("target-active")},this),i&&!this.isItemStartSource&&this.sourcewrapper.classList.add("target-active")}addListeners(t,i){i?(this.removeListeners(t,i),t.addEventListener("touchmove",this.handleTouchMove),t.addEventListener("touchend",this.handleTouchEnd)):(this.removeListeners(t,i),document.addEventListener("mousemove",this.handleDragMove),document.addEventListener("mouseup",this.handleDragEnd))}removeListeners(t,i){i?(t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd)):(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd))}clearTargetHighlights(){this.targets.forEach(t=>{t.classList.remove("target-active")},this),this.sourcewrapper.classList.remove("target-active")}getClosestElement(t,i){return t?t&&t.classList.contains(i)?t:this.getClosestElement(t.parentElement,i):!1}sortContainerElements(t){let i=[],n=t.children;for(let s=0;s<n.length;s++){const r=n[s].querySelector("div.draggable");r&&i.push([1*r.dataset.order,n[s]])}i.sort(function(s,r){return s[0]-r[0]});for(let s=0;s<i.length;s++)t.appendChild(i[s][1])}getResponse(){return this.computeResponse()}computeResponse(){let t=[];return this.targets.forEach(i=>{i.querySelectorAll(".draggable").forEach(n=>{t.push(`${n.dataset.identifier} ${i.dataset.identifier}`)})}),t.length===0?null:this.options.cardinality==="single"?t[0]:t}restoreResponse(t){t!==null&&(this.options.cardinality==="single"?this.restoreResponsePair(t):t.forEach(i=>{this.restoreResponsePair(i)},this))}restoreResponsePair(t){const i=this.getPair(t);if(i===null)return;const n=this.findSourceByIdentifier(i.source),s=this.findTargetGapByIdentifier(i.target);if(n===null||s===null)return;const r=n.querySelector(".draggable");r!==null&&(this.cloneOrEmptySourceDragger(n,r),this.restoreSourceDraggerToTarget(s,r))}cloneOrEmptySourceDragger(t,i){const n=t.dataset.matchMax*1;if(n===1){t.classList.remove("full"),this.decrementRemaining(t);return}if(n===0){this.addClonePlaceholder(i);return}if(this.getRemaining(t)===1){t.classList.remove("full"),this.decrementRemaining(t);return}this.decrementRemaining(t),this.addClonePlaceholder(i)}findSourceByIdentifier(t){for(let i=0;i<this.sources.length;i++)if(t===this.sources[i].dataset.identifier)return this.sources[i];return null}findTargetGapByIdentifier(t){for(let i=0;i<this.targets.length;i++)if(t===this.targets[i].dataset.identifier)return this.targets[i];return null}getPair(t){if(t===null)return null;const i=t.split(" ");return i.length!=2?null:{source:i[0],target:i[1]}}restoreSourceDraggerToTarget(t,i){t===null||i===null||(t.append(i),i.setAttribute("style","width:100%"),this.incrementAssociationsCount(),this.isTargetFull(t)&&t.classList.add("full"))}hasMatchingMatchGroup(t,i){return t===null||i===null?!1:t.dataset.matchGroup===i.dataset.matchGroup}isTargetFull(t){if(t==null)return!1;const i=t.querySelectorAll(".draggable"),n=t.dataset.matchMax*1;return n===0?!1:i.length>=n}isExceedingMaxAssociations(t,i){return!(this.options.maxAssociations===0||i.classList.contains("source")||t.classList.contains("target")||this.currentAssociationsCount<this.options.maxAssociations)}initializeAssociationsCount(){this.currentAssociationsCount=0}incrementAssociationsCount(){this.currentAssociationsCount+=1}decrementAssociationsCount(){this.currentAssociationsCount!==0&&(this.currentAssociationsCount-=1)}getRemaining(t){return t.dataset.remaining*1}setRemaining(t,i){t.setAttribute("data-remaining",i)}incrementRemaining(t){const i=t.dataset.remaining*1+1;return t.setAttribute("data-remaining",i),i}decrementRemaining(t){let i=t.dataset.remaining*1-1;return i=i>=0?i:0,t.setAttribute("data-remaining",i),i}deepCloneId(t){t.id&&(t.id=`clone_${this.qtiAttributeValidation.randomString(5,"a")}`);for(let i=0;i<t.children.length;i++)this.deepCloneId(t.children[i])}reset(){this.resetDraggersToSources(),this.initializeAssociationsCount(),this.destroy()}resetDraggersToSources(){this.targets.forEach(t=>{t.querySelectorAll(".draggable").forEach(n=>{const s=this.findSourceByIdentifier(n.getAttribute("data-identifier"));s.classList.contains("full")||(t.classList.remove("full"),s.classList.contains("full")?t.removeChild(n):(s.append(n),s.classList.add("full")))},this)},this)}destroy(){this.currentDragger!==null&&(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd)),this.wrapper.querySelectorAll(".draggable").forEach(i=>{i.removeEventListener("touchstart",this.handleTouchStart),i.removeEventListener("touchmove",this.handleTouchMove),i.removeEventListener("touchend",this.handleTouchEnd),i.removeEventListener("mousedown",this.handleDragStart)},this)}}class A0{constructor(t,i){Je(this,"options",{interactionSubType:"matchtabular",isHeaderHidden:!1,isRowCentric:!1,firstColumnHeader:null,cardinality:"single",maxAssociations:0,response:null,onReady:null,onUpdate:null,onSelectionsLimit:null});Je(this,"keyCodes",{Enter:13,Space:32,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40});return this.wrapper=t,this.table=this.wrapper.querySelector("table.matchtabular"),this.sourcewrapper=this.wrapper.querySelector(".qti-match-source-wrapper"),this.targetwrapper=this.wrapper.querySelector(".qti-match-target-wrapper"),this.currentAssociationsCount=0,this.isDisabled=!1,this.processOptions(i),this.handleClick=this.handleClick.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.state=new Map,this.initializeTable(this.sourcewrapper,this.targetwrapper),this.restoreResponse(),this.notifyReady(),this}processOptions(t){"interactionSubType"in t&&(this.options.interactionSubType=t.interactionSubType),"isHeaderHidden"in t&&(this.options.isHeaderHidden=t.isHeaderHidden),"isRowCentric"in t&&(this.options.isRowCentric=t.isRowCentric),"firstColumnHeader"in t&&(this.options.firstColumnHeader=t.firstColumnHeader),"cardinality"in t&&(this.options.cardinality=t.cardinality),"response"in t&&(this.options.response=t.response),"maxAssociations"in t&&(this.options.maxAssociations=t.maxAssociations),"onReady"in t&&(this.options.onReady=t.onReady),"onUpdate"in t&&(this.options.onUpdate=t.onUpdate),"onAssociationsLimit"in t&&(this.options.onAssociationsLimit=t.onAssociationsLimit)}notifyReady(){this.options.onReady!==null&&this.options.onReady({response:this.getResponse()})}notifyUpdate(){this.options.onUpdate!==null&&this.options.onUpdate({response:this.computeResponse()})}notifyAssociationsLimit(){this.options.onAssociationsLimit!==null&&this.options.onAssociationsLimit()}toggleDisable(t){this.isDisabled=t,this.controls.forEach(i=>{t?i.classList.add("disabled"):i.classList.remove("disabled")})}handleClick(t){if(!this.isDisabled){if(this.isRadio(t.target)){this.setControlChecked(t.target);return}this.toggleControl(t.target)}}handleKeydown(t){let i=!1;switch(t.code){case"Space":case"Enter":this.isDisabled||this.toggleControl(t.target),i=!0;break;case"ArrowUp":case"ArrowLeft":i=!0;break;case"ArrowDown":case"ArrowRight":i=!0;break}i&&(t.stopPropagation(),t.preventDefault())}handleFocus(){}handleBlur(){}toggleControl(t){if(!this.isChecked(t)){if(this.isExceedingMaxAssociations()){this.notifyAssociationsLimit();return}if(this.isExceedingMatchMax(t.dataset.pair,t.dataset.sourceMax*1,!0)||this.isExceedingMatchMax(t.dataset.pair,t.dataset.targetMax*1,!1))return;this.updateState(t.dataset.pair,this.toggleChecked(t)),this.notifyUpdate();return}this.updateState(t.dataset.pair,this.toggleChecked(t)),this.notifyUpdate()}setControlChecked(t){if(!this.isChecked(t)){if(this.isExceedingMaxAssociations()){this.notifyAssociationsLimit();return}if(this.isExceedingMatchMax(t.dataset.pair,t.dataset.sourceMax*1,!0)||this.isExceedingMatchMax(t.dataset.pair,t.dataset.targetMax*1,!1))return;this.updateState(t.dataset.pair,this.setChecked(t,!0)),this.notifyUpdate();return}this.updateState(t.dataset.pair,this.setChecked(t,!0)),this.notifyUpdate()}setChecked(t,i){const n=i?"true":"false";return t.setAttribute("aria-checked",n),n}toggleChecked(t){const n=t.getAttribute("aria-checked")==="true"?"false":"true";return t.setAttribute("aria-checked",n),n}isRadio(t){return t===null?!1:t.getAttribute("role")==="radio"}isChecked(t){return t===null?!1:t.getAttribute("aria-checked")==="true"}setTabIndex(t){this.tabIndex=t}setFocus(){}setBlur(){}updateState(t,i){this.state.set(t,i),this.currentAssociationsCount=0;for(let n of this.state.values())n==="true"&&(this.currentAssociationsCount+=1)}initializeTable(t,i){this.sources=this.getChoices(t),this.targets=this.getChoices(i);const n=`width:${this.getColumnWidthPercentage(this.targets.length)}%`;this.table.innerHTML=`${this.getHeader(n)}${this.getBody(n)}`,this.controls=this.table.querySelectorAll(".control-cell"),this.controls.forEach(s=>{const r=s.getAttribute("data-pair");this.updateState(r,"false"),s.addEventListener("click",this.handleClick),s.addEventListener("keydown",this.handleKeydown),s.addEventListener("focus",this.handleFocus),s.addEventListener("blur",this.handleBlur)},this)}getHeader(t){if(this.options.isHeaderHidden)return"";let i=`<th scope="col" class="header-cell">${this.options.firstColumnHeader==null?"":this.options.firstColumnHeader}</th>`;return this.options.isRowCentric?(i+=this.getSourceHeader(t),`<thead>${i}</thead>`):(i+=this.getTargetHeader(t),`<thead>${i}</thead>`)}getTargetHeader(t){let i="";return this.targets.forEach(n=>{i+=`<th scope="col" class="header-cell" style="${t}">${n.innerHTML}</th>`}),i}getSourceHeader(t){let i="";return this.sources.forEach(n=>{i+=`<th scope="col" class="header-cell" style="${t}">${n.innerHTML}</th>`}),i}getBody(t){let i="";return this.options.isRowCentric?(this.targets.forEach(n=>{i+=`<tr><th scope="row" class="row-header-cell">${n.innerHTML}</th>`;const s=n.getAttribute("data-match-max");this.sources.forEach(r=>{const a=r.getAttribute("data-match-max"),c=r.getAttribute("data-identifier"),y=n.getAttribute("data-identifier"),w=`${c} ${y}`;i+=`<td class="table-cell" style="${t}">
162
+ <div class="control-cell" aria-checked="false" tabindex="0" role="checkbox"
163
+ data-source-max="${a}" data-target-max="${s}" data-pair="${w}"></div>
164
+ </td>`}),i+="</tr>"}),`<tbody>${i}</tbody>`):(this.sources.forEach(n=>{i+=`<tr><th scope="row" class="row-header-cell">${n.innerHTML}</th>`;const s=n.getAttribute("data-match-max");this.targets.forEach(r=>{const a=r.getAttribute("data-match-max"),c=n.getAttribute("data-identifier"),y=r.getAttribute("data-identifier"),w=`${c} ${y}`;i+=`<td class="table-cell" style="${t}">
165
+ <div class="control-cell" aria-checked="false" tabindex="0" role="checkbox"
166
+ data-source-max="${s}" data-target-max="${a}" data-pair="${w}"></div>
167
+ </td>`}),i+="</tr>"}),`<tbody>${i}</tbody>`)}getColumnWidthPercentage(t){return Math.trunc(1/(t+1)*100)}getRoleFromMatchMax(t){return t===null||t*1===1?"radio":"checkbox"}getChoices(t){return t.querySelectorAll(".qti-simple-associable-choice")}getResponse(){return this.computeResponse()}computeResponse(){let t=[];for(let[i,n]of this.state)n==="true"&&t.push(i);return t.length===0?null:this.options.cardinality==="single"?t[0]:t}restoreResponse(){if(this.options.response!==null){if(this.options.cardinality==="single"){const t=this.options.response;if(t===null)return;const i=this.findControlByIdentifier(t);if(i==null)return;this.updateState(t,"true"),this.setChecked(i,!0);return}this.options.response.forEach(t=>{if(t===null)return;const i=this.findControlByIdentifier(t);i!=null&&(this.updateState(t,"true"),this.setChecked(i,!0))},this)}}findControlByIdentifier(t){for(let i=0;i<this.controls.length;i++)if(t===this.controls[i].getAttribute("data-pair"))return this.controls[i];return null}isExceedingMaxAssociations(){return!(this.options.maxAssociations===0||this.currentAssociationsCount<this.options.maxAssociations)}isExceedingMatchMax(t,i,n){if(i===0)return!1;const s=this.getPair(t);return!((n?this.countIdentifiersInState(s.source,!0):this.countIdentifiersInState(s.target,!1))<i)}countIdentifiersInState(t,i){let n=0;for(let[s,r]of this.state)if(r==="true"){const a=this.getPair(s);if(a==null)continue;(i&&a.source===t||!i&&a.target===t)&&(n+=1)}return n}getPair(t){if(t===null)return null;const i=t.split(" ");return i.length!=2?null:{source:i[0],target:i[1]}}reset(){this.initializeAssociationsCount(),this.destroy()}destroy(){this.controls!=null&&this.controls.forEach(t=>{t.removeEventListener("click",this.handleClick),t.removeEventListener("keydown",this.handleKeydown),t.removeEventListener("focus",this.handleFocus),t.removeEventListener("blur",this.handleBlur)},this)}}const k0=new re,O0={emits:["matchGroupReady","matchGroupUpdate","matchGroupAssociationsLimit"],props:{responseIdentifier:{required:!0,type:String},cardinality:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},maxAssociations:{required:!1,type:String,default:"1"},minAssociations:{required:!1,type:String,default:"0"},interactionSubType:{required:!1,type:String,default:"default"},matchInteractionStaticClass:{required:!1,type:String,default:""},headerHidden:{required:!1,type:String,default:"false"},rowCentric:{required:!1,type:String,default:"false"},dataFirstColumnHeader:{required:!1,type:String,default:null},priorState:{required:!1,type:Object,default:null}},data(){return{matchsets:[],orders:[],response:null,isShuffle:null,isHeaderHidden:null,isRowCentric:null,hasPrompt:!1,matchInteractionClassAttribute:null,presentationFactory:null,matchable:null,isQtiValid:!0}},computed:{computedMaxAssociations(){return this.maxAssociations*1}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},disable(){this.matchable!==null&&this.matchable.toggleDisable(!0)},enable(){this.matchable!==null&&this.matchable.toggleDisable(!1)},validateChildren(){let e=0;if(this.$slots.default()[0].children.forEach(t=>{if(k0.isValidSlot(t)){if(t.type.name==="QtiPrompt"){if(e>0)throw new h("Invalid element order. qti-prompt must come before qti-simple-match-set's");if(!this.hasPrompt)return this.hasPrompt=!0;throw new h("Maximum of 1 qti-prompt element permitted")}if(t.type.name==="QtiSimpleMatchSet")return e+=1;throw new h('Node is not a qti-simple-match-set: "'+t.type.name+'"')}}),e!=2)throw new h("qti-match-interaction must contain exactly 2 qti-simple-match-sets. Found: "+e)},processChildren(){this.$.subTree.children[0].children[0].children.forEach(t=>{if(t.type.name==="QtiSimpleMatchSet"&&t.component!==null){const i=t.component.proxy;i.setIsShuffle(this.isShuffle),this.matchsets.push(i)}})},processGroupUI(e){let t=this.matchsets[0].createContainer(this.priorState,0);this.matchsets[0].processContainerChoices(t);let i=this.matchsets[1].createContainer(this.priorState,1);this.matchsets[1].processContainerChoices(i),this.saveContainerOrders(t,i),this.presentationFactory.initialize(this.interactionSubType,this.$refs.root,this,this.matchsets[0],this.matchsets[1]),this.interactionSubType==="default"?this.matchable=new V0(this.$refs.root,{interactionSubType:this.interactionSubType,cardinality:this.cardinality,maxAssociations:this.computedMaxAssociations,response:e,onReady:this.handleWidgetReady,onUpdate:this.handleWidgetUpdate,onAssociationsLimit:this.handleAssociationsLimit}):this.interactionSubType==="matchtabular"&&(this.matchable=new A0(this.$refs.root,{interactionSubType:this.interactionSubType,cardinality:this.cardinality,maxAssociations:this.computedMaxAssociations,isHeaderHidden:this.isHeaderHidden,isRowCentric:this.isRowCentric,firstColumnHeader:this.dataFirstColumnHeader,response:e,onReady:this.handleWidgetReady,onUpdate:this.handleWidgetUpdate,onAssociationsLimit:this.handleAssociationsLimit}))},saveContainerOrders(e,t){const i=[];e.forEach(s=>{i.push(s.node.identifier)});const n=[];t.forEach(s=>{n.push(s.node.identifier)}),this.orders=[i,n]},resetGroupUI(){this.processGroupUI(null)},handleWidgetReady(e){this.setResponse(e.response),this.$emit("matchGroupReady",{response:this.getResponse(),matchsets:this.matchsets,orders:this.orders})},handleWidgetUpdate(e){this.setResponse(e.response),this.$emit("matchGroupUpdate",{response:this.getResponse()})},handleAssociationsLimit(){this.$emit("matchGroupAssociationsLimit")},initializeMatchGroup(){this.presentationFactory=new I0}},created(){try{if(typeof this.cardinality>"u")throw new h("Undefined qti-match-interaction cardinality");if(this.cardinality!=="single"&&this.cardinality!=="multiple")throw new h('qti-match-interaction cardinality must be "single" or "multiple"');this.isShuffle=this.shuffle==="true",this.isHeaderHidden=this.headerHidden==="true",this.isRowCentric=this.rowCentric==="true",this.initializeMatchGroup(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,console.log("[QtiMatchInteraction][ValidationError]",e.name,e.message),new h(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.processGroupUI(this.priorState===null?null:this.priorState.value)}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw console.log("[QtiMatchInteraction][ValidationException]",e.message),new h(e.message);if(e.name==="QtiEvaluationException")throw console.log("[QtiMatchInteraction][EvaluationException]",e.message),new ee(e.message)}},beforeUnmount(){this.matchable!==null&&(this.matchable.destroy(),this.matchable=null)}},L0={ref:"root",class:"qti-match-group-wrapper"};function R0(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",L0,[l.renderSlot(e.$slots,"default")],512)}const M0=te(O0,[["render",R0]]);class $0{constructor(){this.constants={LABELS_UPPER_ALPHA:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],LABELS_LOWER_ALPHA:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],LABELS_DECIMAL:["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26"],LABELS_SUFFIX_PERIOD:".",LABELS_SUFFIX_PARENTHESIS:")",LABELS_SUFFIX_NONE:"",QTI_LABELS_NONE:"qti-labels-none",QTI_LABELS_DECIMAL:"qti-labels-decimal",QTI_LABELS_LOWER_ALPHA:"qti-labels-lower-alpha",QTI_LABELS_UPPER_ALPHA:"qti-labels-upper-alpha",QTI_LABELS_SUFFIX_NONE:"qti-labels-suffix-none",QTI_LABELS_SUFFIX_PERIOD:"qti-labels-suffix-period",QTI_LABELS_SUFFIX_PARENTHESIS:"qti-labels-suffix-parenthesis",QTI_CHOICES_TOP:"qti-choices-top",QTI_CHOICES_BOTTOM:"qti-choices-bottom",QTI_CHOICES_LEFT:"qti-choices-left",QTI_CHOICES_RIGHT:"qti-choices-right",QTI_CHOICES_INLINE:"qti-choices-inline",QTI_ORIENTATION_VERTICAL:"qti-orientation-vertical",QTI_ORIENTATION_HORIZONTAL:"qti-orientation-horizontal",DATA_MAX_SELECTIONS_MESSAGE:"data-max-selections-message",DATA_MIN_SELECTIONS_MESSAGE:"data-min-selections-message"},this.parentClassList=null,this.orderWrapperElement=null,this.orderGroupNode=null,this.choices=null,this.presentation_HideLabels=!1,this.presentation_Labels=this.constants.LABELS_DECIMAL,this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_NONE,this.presentation_Choices_Orientation=null,this.presentation_IsOrientationVertical=!1,this.presentation_HasOrientationVerticalClass=!1,this.presentation_HasOrientationHorizontalClass=!1,this.presentation_MaxSelectionsMessage="",this.presentation_MinSelectionsMessage="",this.presentation_Label_Style=""}initialize(t,i){this.orderWrapperElement=t,this.orderGroupNode=i,this.parentClassList=i.orderInteractionClassAttribute,this.presentation_IsOrientationVertical=i.isOrientationVertical,this.choices=i.choices,this.processRootClassAttribute(this.parentClassList),this.processPresentation()}processRootClassAttribute(t){const i=t.values();for(let n of i)switch(n){case this.constants.QTI_LABELS_NONE:this.presentation_HideLabels=!0;break;case this.constants.QTI_LABELS_UPPER_ALPHA:this.presentation_Labels=this.constants.LABELS_UPPER_ALPHA;break;case this.constants.QTI_LABELS_LOWER_ALPHA:this.presentation_Labels=this.constants.LABELS_LOWER_ALPHA;break;case this.constants.QTI_LABELS_DECIMAL:this.presentation_Labels=this.constants.LABELS_DECIMAL;break;case this.constants.QTI_LABELS_SUFFIX_NONE:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_NONE;break;case this.constants.QTI_LABELS_SUFFIX_PERIOD:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PERIOD;break;case this.constants.QTI_LABELS_SUFFIX_PARENTHESIS:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PARENTHESIS;break;case this.constants.QTI_CHOICES_TOP:case this.constants.QTI_CHOICES_BOTTOM:case this.constants.QTI_CHOICES_LEFT:case this.constants.QTI_CHOICES_RIGHT:this.presentation_Choices_Orientation=n;break;case this.constants.QTI_ORIENTATION_VERTICAL:this.presentation_HasOrientationVerticalClass=!0,this.presentation_HasOrientationHorizontalClass=!1;break;case this.constants.QTI_ORIENTATION_HORIZONTAL:this.presentation_HasOrientationVerticalClass=!1,this.presentation_HasOrientationHorizontalClass=!0;break}}processPresentation(){if(this.processOrientation(),this.presentation_Choices_Orientation===null){this.orderGroupNode.$refs.ordergroup.classList.add(this.constants.QTI_CHOICES_INLINE);return}const t=this.createTargetWrapper();this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_LEFT?(this.orderGroupNode.$refs.ordergroup.classList.add(this.constants.QTI_CHOICES_LEFT),this.orderWrapperElement.appendChild(t)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_TOP?this.orderWrapperElement.appendChild(t):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_RIGHT?(this.orderGroupNode.$refs.ordergroup.classList.add(this.constants.QTI_CHOICES_RIGHT),this.orderWrapperElement.insertBefore(t,this.orderGroupNode.$refs.ordergroup)):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_BOTTOM&&this.orderWrapperElement.insertBefore(t,this.orderGroupNode.$refs.ordergroup)}processOrientation(){let t=this.computeOrientation();this.orderGroupNode.$refs.ordergroup.classList.add(t)}computeOrientation(){return this.presentation_HasOrientationVerticalClass?this.constants.QTI_ORIENTATION_VERTICAL:this.presentation_HasOrientationHorizontalClass?this.constants.QTI_ORIENTATION_HORIZONTAL:this.getOrientationClass(this.presentation_IsOrientationVertical)}getOrientationClass(t){return t?this.constants.QTI_ORIENTATION_VERTICAL:this.constants.QTI_ORIENTATION_HORIZONTAL}createTargetWrapper(){let t=document.createElement("ul");t.classList.add("qti-order-target-wrapper"),this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_LEFT?t.classList.add(this.constants.QTI_CHOICES_LEFT):this.presentation_Choices_Orientation===this.constants.QTI_CHOICES_RIGHT&&t.classList.add(this.constants.QTI_CHOICES_RIGHT),t.classList.add(this.computeOrientation());for(let i=0;i<this.choices.length;i++)t.appendChild(this.createTargetFromChoice(i));return t}createTargetFromChoice(t){let i=document.createElement("li");return this.presentation_HideLabels&&i.classList.add("qti-labels-none"),i.classList.add("target"),i.setAttribute("data-identifier",t),i.setAttribute("aria-label",t),this.createTargetLabel(i,t),i}createTargetLabel(t,i){if(this.presentation_HideLabels)return;let n=document.createElement("div");n.classList.add("target-label"),n.innerText=`${this.presentation_Labels[i]}${this.presentation_LabelsSuffix}`,t.appendChild(n)}}/**!
168
+ * Sortable 1.15.2
169
+ * @author RubaXa <trash@rubaxa.org>
170
+ * @author owenm <owen23355@gmail.com>
171
+ * @license MIT
172
+ */function Iu(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),i.push.apply(i,n)}return i}function Wt(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Iu(Object(i),!0).forEach(function(n){N0(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Iu(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}function ur(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ur=function(t){return typeof t}:ur=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ur(e)}function N0(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ni(){return ni=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},ni.apply(this,arguments)}function P0(e,t){if(e==null)return{};var i={},n=Object.keys(e),s,r;for(r=0;r<n.length;r++)s=n[r],!(t.indexOf(s)>=0)&&(i[s]=e[s]);return i}function q0(e,t){if(e==null)return{};var i=P0(e,t),n,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s<r.length;s++)n=r[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var B0="1.15.2";function si(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ri=si(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Zn=si(/Edge/i),Vu=si(/firefox/i),Jn=si(/safari/i)&&!si(/chrome/i)&&!si(/android/i),Au=si(/iP(ad|od|hone)/i),ku=si(/chrome/i)&&si(/android/i),Ou={capture:!1,passive:!1};function Be(e,t,i){e.addEventListener(t,i,!ri&&Ou)}function qe(e,t,i){e.removeEventListener(t,i,!ri&&Ou)}function cr(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function D0(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Qt(e,t,i,n){if(e){i=i||document;do{if(t!=null&&(t[0]===">"?e.parentNode===i&&cr(e,t):cr(e,t))||n&&e===i)return e;if(e===i)break}while(e=D0(e))}return null}var Lu=/\s+/g;function _t(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(Lu," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(Lu," ")}}function _e(e,t,i){var n=e&&e.style;if(n){if(i===void 0)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),t===void 0?i:i[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=i+(typeof i=="string"?"":"px")}}function Ki(e,t){var i="";if(typeof e=="string")i=e;else do{var n=_e(e,"transform");n&&n!=="none"&&(i=n+" "+i)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(i)}function Ru(e,t,i){if(e){var n=e.getElementsByTagName(t),s=0,r=n.length;if(i)for(;s<r;s++)i(n[s],s);return n}return[]}function zt(){var e=document.scrollingElement;return e||document.documentElement}function tt(e,t,i,n,s){if(!(!e.getBoundingClientRect&&e!==window)){var r,a,c,y,w,f,g;if(e!==window&&e.parentNode&&e!==zt()?(r=e.getBoundingClientRect(),a=r.top,c=r.left,y=r.bottom,w=r.right,f=r.height,g=r.width):(a=0,c=0,y=window.innerHeight,w=window.innerWidth,f=window.innerHeight,g=window.innerWidth),(t||i)&&e!==window&&(s=s||e.parentNode,!ri))do if(s&&s.getBoundingClientRect&&(_e(s,"transform")!=="none"||i&&_e(s,"position")!=="static")){var p=s.getBoundingClientRect();a-=p.top+parseInt(_e(s,"border-top-width")),c-=p.left+parseInt(_e(s,"border-left-width")),y=a+r.height,w=c+r.width;break}while(s=s.parentNode);if(n&&e!==window){var d=Ki(s||e),S=d&&d.a,b=d&&d.d;d&&(a/=b,c/=S,g/=S,f/=b,y=a+f,w=c+g)}return{top:a,left:c,bottom:y,right:w,width:g,height:f}}}function Mu(e,t,i){for(var n=ci(e,!0),s=tt(e)[t];n;){var r=tt(n)[i],a=void 0;if(a=s>=r,!a)return n;if(n===zt())break;n=ci(n,!1)}return!1}function Yi(e,t,i,n){for(var s=0,r=0,a=e.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==xe.ghost&&(n||a[r]!==xe.dragged)&&Qt(a[r],i.draggable,e,!1)){if(s===t)return a[r];s++}r++}return null}function Qa(e,t){for(var i=e.lastElementChild;i&&(i===xe.ghost||_e(i,"display")==="none"||t&&!cr(i,t));)i=i.previousElementSibling;return i||null}function Nt(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==xe.clone&&(!t||cr(e,t))&&i++;return i}function $u(e){var t=0,i=0,n=zt();if(e)do{var s=Ki(e),r=s.a,a=s.d;t+=e.scrollLeft*r,i+=e.scrollTop*a}while(e!==n&&(e=e.parentNode));return[t,i]}function Q0(e,t){for(var i in e)if(e.hasOwnProperty(i)){for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[i][n])return Number(i)}return-1}function ci(e,t){if(!e||!e.getBoundingClientRect)return zt();var i=e,n=!1;do if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var s=_e(i);if(i.clientWidth<i.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||i.clientHeight<i.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!i.getBoundingClientRect||i===document.body)return zt();if(n||t)return i;n=!0}}while(i=i.parentNode);return zt()}function H0(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function Ha(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var es;function Nu(e,t){return function(){if(!es){var i=arguments,n=this;i.length===1?e.call(n,i[0]):e.apply(n,i),es=setTimeout(function(){es=void 0},t)}}}function F0(){clearTimeout(es),es=void 0}function Pu(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function qu(e){var t=window.Polymer,i=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):i?i(e).clone(!0)[0]:e.cloneNode(!0)}function Bu(e,t,i){var n={};return Array.from(e.children).forEach(function(s){var r,a,c,y;if(!(!Qt(s,t.draggable,e,!1)||s.animated||s===i)){var w=tt(s);n.left=Math.min((r=n.left)!==null&&r!==void 0?r:1/0,w.left),n.top=Math.min((a=n.top)!==null&&a!==void 0?a:1/0,w.top),n.right=Math.max((c=n.right)!==null&&c!==void 0?c:-1/0,w.right),n.bottom=Math.max((y=n.bottom)!==null&&y!==void 0?y:-1/0,w.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var xt="Sortable"+new Date().getTime();function U0(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(s){if(!(_e(s,"display")==="none"||s===xe.ghost)){e.push({target:s,rect:tt(s)});var r=Wt({},e[e.length-1].rect);if(s.thisAnimationDuration){var a=Ki(s,!0);a&&(r.top-=a.f,r.left-=a.e)}s.fromRect=r}})}},addAnimationState:function(n){e.push(n)},removeAnimationState:function(n){e.splice(Q0(e,{target:n}),1)},animateAll:function(n){var s=this;if(!this.options.animation){clearTimeout(t),typeof n=="function"&&n();return}var r=!1,a=0;e.forEach(function(c){var y=0,w=c.target,f=w.fromRect,g=tt(w),p=w.prevFromRect,d=w.prevToRect,S=c.rect,b=Ki(w,!0);b&&(g.top-=b.f,g.left-=b.e),w.toRect=g,w.thisAnimationDuration&&Ha(p,g)&&!Ha(f,g)&&(S.top-g.top)/(S.left-g.left)===(f.top-g.top)/(f.left-g.left)&&(y=j0(S,p,d,s.options)),Ha(g,f)||(w.prevFromRect=f,w.prevToRect=g,y||(y=s.options.animation),s.animate(w,S,g,y)),y&&(r=!0,a=Math.max(a,y),clearTimeout(w.animationResetTimer),w.animationResetTimer=setTimeout(function(){w.animationTime=0,w.prevFromRect=null,w.fromRect=null,w.prevToRect=null,w.thisAnimationDuration=null},y),w.thisAnimationDuration=y)}),clearTimeout(t),r?t=setTimeout(function(){typeof n=="function"&&n()},a):typeof n=="function"&&n(),e=[]},animate:function(n,s,r,a){if(a){_e(n,"transition",""),_e(n,"transform","");var c=Ki(this.el),y=c&&c.a,w=c&&c.d,f=(s.left-r.left)/(y||1),g=(s.top-r.top)/(w||1);n.animatingX=!!f,n.animatingY=!!g,_e(n,"transform","translate3d("+f+"px,"+g+"px,0)"),this.forRepaintDummy=G0(n),_e(n,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),_e(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){_e(n,"transition",""),_e(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},a)}}}}function G0(e){return e.offsetWidth}function j0(e,t,i,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*n.animation}var Xi=[],Fa={initializeByDefault:!0},ts={mount:function(t){for(var i in Fa)Fa.hasOwnProperty(i)&&!(i in t)&&(t[i]=Fa[i]);Xi.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Xi.push(t)},pluginEvent:function(t,i,n){var s=this;this.eventCanceled=!1,n.cancel=function(){s.eventCanceled=!0};var r=t+"Global";Xi.forEach(function(a){i[a.pluginName]&&(i[a.pluginName][r]&&i[a.pluginName][r](Wt({sortable:i},n)),i.options[a.pluginName]&&i[a.pluginName][t]&&i[a.pluginName][t](Wt({sortable:i},n)))})},initializePlugins:function(t,i,n,s){Xi.forEach(function(c){var y=c.pluginName;if(!(!t.options[y]&&!c.initializeByDefault)){var w=new c(t,i,t.options);w.sortable=t,w.options=t.options,t[y]=w,ni(n,w.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var a=this.modifyOption(t,r,t.options[r]);typeof a<"u"&&(t.options[r]=a)}},getEventProperties:function(t,i){var n={};return Xi.forEach(function(s){typeof s.eventProperties=="function"&&ni(n,s.eventProperties.call(i[s.pluginName],t))}),n},modifyOption:function(t,i,n){var s;return Xi.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[i]=="function"&&(s=r.optionListeners[i].call(t[r.pluginName],n))}),s}};function W0(e){var t=e.sortable,i=e.rootEl,n=e.name,s=e.targetEl,r=e.cloneEl,a=e.toEl,c=e.fromEl,y=e.oldIndex,w=e.newIndex,f=e.oldDraggableIndex,g=e.newDraggableIndex,p=e.originalEvent,d=e.putSortable,S=e.extraEventProperties;if(t=t||i&&i[xt],!!t){var b,_=t.options,E="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!ri&&!Zn?b=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(b=document.createEvent("Event"),b.initEvent(n,!0,!0)),b.to=a||i,b.from=c||i,b.item=s||i,b.clone=r,b.oldIndex=y,b.newIndex=w,b.oldDraggableIndex=f,b.newDraggableIndex=g,b.originalEvent=p,b.pullMode=d?d.lastPutMode:void 0;var m=Wt(Wt({},S),ts.getEventProperties(n,t));for(var A in m)b[A]=m[A];i&&i.dispatchEvent(b),_[E]&&_[E].call(t,b)}}var z0=["evt"],bt=function(t,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=n.evt,r=q0(n,z0);ts.pluginEvent.bind(xe)(t,i,Wt({dragEl:pe,parentEl:ze,ghostEl:Ae,rootEl:Ue,nextEl:Ii,lastDownEl:hr,cloneEl:We,cloneHidden:hi,dragStarted:ns,putSortable:ot,activeSortable:xe.active,originalEvent:s,oldIndex:Zi,oldDraggableIndex:is,newIndex:It,newDraggableIndex:di,hideGhostForTarget:ju,unhideGhostForTarget:Wu,cloneNowHidden:function(){hi=!0},cloneNowShown:function(){hi=!1},dispatchSortableEvent:function(c){mt({sortable:i,name:c,originalEvent:s})}},r))};function mt(e){W0(Wt({putSortable:ot,cloneEl:We,targetEl:pe,rootEl:Ue,oldIndex:Zi,oldDraggableIndex:is,newIndex:It,newDraggableIndex:di},e))}var pe,ze,Ae,Ue,Ii,hr,We,hi,Zi,It,is,di,dr,ot,Ji=!1,fr=!1,pr=[],Vi,Ht,Ua,Ga,Du,Qu,ns,en,ss,rs=!1,mr=!1,gr,dt,ja=[],Wa=!1,yr=[],vr=typeof document<"u",wr=Au,Hu=Zn||ri?"cssFloat":"float",K0=vr&&!ku&&!Au&&"draggable"in document.createElement("div"),Fu=function(){if(vr){if(ri)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Uu=function(t,i){var n=_e(t),s=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=Yi(t,0,i),a=Yi(t,1,i),c=r&&_e(r),y=a&&_e(a),w=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+tt(r).width,f=y&&parseInt(y.marginLeft)+parseInt(y.marginRight)+tt(a).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&c.float&&c.float!=="none"){var g=c.float==="left"?"left":"right";return a&&(y.clear==="both"||y.clear===g)?"vertical":"horizontal"}return r&&(c.display==="block"||c.display==="flex"||c.display==="table"||c.display==="grid"||w>=s&&n[Hu]==="none"||a&&n[Hu]==="none"&&w+f>s)?"vertical":"horizontal"},Y0=function(t,i,n){var s=n?t.left:t.top,r=n?t.right:t.bottom,a=n?t.width:t.height,c=n?i.left:i.top,y=n?i.right:i.bottom,w=n?i.width:i.height;return s===c||r===y||s+a/2===c+w/2},X0=function(t,i){var n;return pr.some(function(s){var r=s[xt].options.emptyInsertThreshold;if(!(!r||Qa(s))){var a=tt(s),c=t>=a.left-r&&t<=a.right+r,y=i>=a.top-r&&i<=a.bottom+r;if(c&&y)return n=s}}),n},Gu=function(t){function i(r,a){return function(c,y,w,f){var g=c.options.group.name&&y.options.group.name&&c.options.group.name===y.options.group.name;if(r==null&&(a||g))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return i(r(c,y,w,f),a)(c,y,w,f);var p=(a?c:y).options.group.name;return r===!0||typeof r=="string"&&r===p||r.join&&r.indexOf(p)>-1}}var n={},s=t.group;(!s||ur(s)!="object")&&(s={name:s}),n.name=s.name,n.checkPull=i(s.pull,!0),n.checkPut=i(s.put),n.revertClone=s.revertClone,t.group=n},ju=function(){!Fu&&Ae&&_e(Ae,"display","none")},Wu=function(){!Fu&&Ae&&_e(Ae,"display","")};vr&&!ku&&document.addEventListener("click",function(e){if(fr)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),fr=!1,!1},!0);var Ai=function(t){if(pe){t=t.touches?t.touches[0]:t;var i=X0(t.clientX,t.clientY);if(i){var n={};for(var s in t)t.hasOwnProperty(s)&&(n[s]=t[s]);n.target=n.rootEl=i,n.preventDefault=void 0,n.stopPropagation=void 0,i[xt]._onDragOver(n)}}},Z0=function(t){pe&&pe.parentNode[xt]._isOutsideThisEl(t.target)};function xe(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=ni({},t),e[xt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Uu(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,c){a.setData("Text",c.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:xe.supportPointer!==!1&&"PointerEvent"in window&&!Jn,emptyInsertThreshold:5};ts.initializePlugins(this,e,i);for(var n in i)!(n in t)&&(t[n]=i[n]);Gu(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:K0,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Be(e,"pointerdown",this._onTapStart):(Be(e,"mousedown",this._onTapStart),Be(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Be(e,"dragover",this),Be(e,"dragenter",this)),pr.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),ni(this,U0())}xe.prototype={constructor:xe,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(en=null)},_getDirection:function(t,i){return typeof this.options.direction=="function"?this.options.direction.call(this,t,i,pe):this.options.direction},_onTapStart:function(t){if(t.cancelable){var i=this,n=this.el,s=this.options,r=s.preventOnFilter,a=t.type,c=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,y=(c||t).target,w=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||y,f=s.filter;if(aS(n),!pe&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||s.disabled)&&!w.isContentEditable&&!(!this.nativeDraggable&&Jn&&y&&y.tagName.toUpperCase()==="SELECT")&&(y=Qt(y,s.draggable,n,!1),!(y&&y.animated)&&hr!==y)){if(Zi=Nt(y),is=Nt(y,s.draggable),typeof f=="function"){if(f.call(this,t,y,this)){mt({sortable:i,rootEl:w,name:"filter",targetEl:y,toEl:n,fromEl:n}),bt("filter",i,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(f&&(f=f.split(",").some(function(g){if(g=Qt(w,g.trim(),n,!1),g)return mt({sortable:i,rootEl:g,name:"filter",targetEl:y,fromEl:n,toEl:n}),bt("filter",i,{evt:t}),!0}),f)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!Qt(w,s.handle,n,!1)||this._prepareDragStart(t,c,y)}}},_prepareDragStart:function(t,i,n){var s=this,r=s.el,a=s.options,c=r.ownerDocument,y;if(n&&!pe&&n.parentNode===r){var w=tt(n);if(Ue=r,pe=n,ze=pe.parentNode,Ii=pe.nextSibling,hr=n,dr=a.group,xe.dragged=pe,Vi={target:pe,clientX:(i||t).clientX,clientY:(i||t).clientY},Du=Vi.clientX-w.left,Qu=Vi.clientY-w.top,this._lastX=(i||t).clientX,this._lastY=(i||t).clientY,pe.style["will-change"]="all",y=function(){if(bt("delayEnded",s,{evt:t}),xe.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!Vu&&s.nativeDraggable&&(pe.draggable=!0),s._triggerDragStart(t,i),mt({sortable:s,name:"choose",originalEvent:t}),_t(pe,a.chosenClass,!0)},a.ignore.split(",").forEach(function(f){Ru(pe,f.trim(),za)}),Be(c,"dragover",Ai),Be(c,"mousemove",Ai),Be(c,"touchmove",Ai),Be(c,"mouseup",s._onDrop),Be(c,"touchend",s._onDrop),Be(c,"touchcancel",s._onDrop),Vu&&this.nativeDraggable&&(this.options.touchStartThreshold=4,pe.draggable=!0),bt("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(Zn||ri))){if(xe.eventCanceled){this._onDrop();return}Be(c,"mouseup",s._disableDelayedDrag),Be(c,"touchend",s._disableDelayedDrag),Be(c,"touchcancel",s._disableDelayedDrag),Be(c,"mousemove",s._delayedDragTouchMoveHandler),Be(c,"touchmove",s._delayedDragTouchMoveHandler),a.supportPointer&&Be(c,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(y,a.delay)}else y()}},_delayedDragTouchMoveHandler:function(t){var i=t.touches?t.touches[0]:t;Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){pe&&za(pe),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;qe(t,"mouseup",this._disableDelayedDrag),qe(t,"touchend",this._disableDelayedDrag),qe(t,"touchcancel",this._disableDelayedDrag),qe(t,"mousemove",this._delayedDragTouchMoveHandler),qe(t,"touchmove",this._delayedDragTouchMoveHandler),qe(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,i){i=i||t.pointerType=="touch"&&t,!this.nativeDraggable||i?this.options.supportPointer?Be(document,"pointermove",this._onTouchMove):i?Be(document,"touchmove",this._onTouchMove):Be(document,"mousemove",this._onTouchMove):(Be(pe,"dragend",this),Be(Ue,"dragstart",this._onDragStart));try{document.selection?Er(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,i){if(Ji=!1,Ue&&pe){bt("dragStarted",this,{evt:i}),this.nativeDraggable&&Be(document,"dragover",Z0);var n=this.options;!t&&_t(pe,n.dragClass,!1),_t(pe,n.ghostClass,!0),xe.active=this,t&&this._appendGhost(),mt({sortable:this,name:"start",originalEvent:i})}else this._nulling()},_emulateDragOver:function(){if(Ht){this._lastX=Ht.clientX,this._lastY=Ht.clientY,ju();for(var t=document.elementFromPoint(Ht.clientX,Ht.clientY),i=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ht.clientX,Ht.clientY),t!==i);)i=t;if(pe.parentNode[xt]._isOutsideThisEl(t),i)do{if(i[xt]){var n=void 0;if(n=i[xt]._onDragOver({clientX:Ht.clientX,clientY:Ht.clientY,target:t,rootEl:i}),n&&!this.options.dragoverBubble)break}t=i}while(i=i.parentNode);Wu()}},_onTouchMove:function(t){if(Vi){var i=this.options,n=i.fallbackTolerance,s=i.fallbackOffset,r=t.touches?t.touches[0]:t,a=Ae&&Ki(Ae,!0),c=Ae&&a&&a.a,y=Ae&&a&&a.d,w=wr&&dt&&$u(dt),f=(r.clientX-Vi.clientX+s.x)/(c||1)+(w?w[0]-ja[0]:0)/(c||1),g=(r.clientY-Vi.clientY+s.y)/(y||1)+(w?w[1]-ja[1]:0)/(y||1);if(!xe.active&&!Ji){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(Ae){a?(a.e+=f-(Ua||0),a.f+=g-(Ga||0)):a={a:1,b:0,c:0,d:1,e:f,f:g};var p="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");_e(Ae,"webkitTransform",p),_e(Ae,"mozTransform",p),_e(Ae,"msTransform",p),_e(Ae,"transform",p),Ua=f,Ga=g,Ht=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Ae){var t=this.options.fallbackOnBody?document.body:Ue,i=tt(pe,!0,wr,!0,t),n=this.options;if(wr){for(dt=t;_e(dt,"position")==="static"&&_e(dt,"transform")==="none"&&dt!==document;)dt=dt.parentNode;dt!==document.body&&dt!==document.documentElement?(dt===document&&(dt=zt()),i.top+=dt.scrollTop,i.left+=dt.scrollLeft):dt=zt(),ja=$u(dt)}Ae=pe.cloneNode(!0),_t(Ae,n.ghostClass,!1),_t(Ae,n.fallbackClass,!0),_t(Ae,n.dragClass,!0),_e(Ae,"transition",""),_e(Ae,"transform",""),_e(Ae,"box-sizing","border-box"),_e(Ae,"margin",0),_e(Ae,"top",i.top),_e(Ae,"left",i.left),_e(Ae,"width",i.width),_e(Ae,"height",i.height),_e(Ae,"opacity","0.8"),_e(Ae,"position",wr?"absolute":"fixed"),_e(Ae,"zIndex","100000"),_e(Ae,"pointerEvents","none"),xe.ghost=Ae,t.appendChild(Ae),_e(Ae,"transform-origin",Du/parseInt(Ae.style.width)*100+"% "+Qu/parseInt(Ae.style.height)*100+"%")}},_onDragStart:function(t,i){var n=this,s=t.dataTransfer,r=n.options;if(bt("dragStart",this,{evt:t}),xe.eventCanceled){this._onDrop();return}bt("setupClone",this),xe.eventCanceled||(We=qu(pe),We.removeAttribute("id"),We.draggable=!1,We.style["will-change"]="",this._hideClone(),_t(We,this.options.chosenClass,!1),xe.clone=We),n.cloneId=Er(function(){bt("clone",n),!xe.eventCanceled&&(n.options.removeCloneOnHide||Ue.insertBefore(We,pe),n._hideClone(),mt({sortable:n,name:"clone"}))}),!i&&_t(pe,r.dragClass,!0),i?(fr=!0,n._loopId=setInterval(n._emulateDragOver,50)):(qe(document,"mouseup",n._onDrop),qe(document,"touchend",n._onDrop),qe(document,"touchcancel",n._onDrop),s&&(s.effectAllowed="move",r.setData&&r.setData.call(n,s,pe)),Be(document,"drop",n),_e(pe,"transform","translateZ(0)")),Ji=!0,n._dragStartId=Er(n._dragStarted.bind(n,i,t)),Be(document,"selectstart",n),ns=!0,Jn&&_e(document.body,"user-select","none")},_onDragOver:function(t){var i=this.el,n=t.target,s,r,a,c=this.options,y=c.group,w=xe.active,f=dr===y,g=c.sort,p=ot||w,d,S=this,b=!1;if(Wa)return;function _(H,j){bt(H,S,Wt({evt:t,isOwner:f,axis:d?"vertical":"horizontal",revert:a,dragRect:s,targetRect:r,canSort:g,fromSortable:p,target:n,completed:m,onMove:function(B,U){return br(Ue,i,pe,s,B,tt(B),t,U)},changed:A},j))}function E(){_("dragOverAnimationCapture"),S.captureAnimationState(),S!==p&&p.captureAnimationState()}function m(H){return _("dragOverCompleted",{insertion:H}),H&&(f?w._hideClone():w._showClone(S),S!==p&&(_t(pe,ot?ot.options.ghostClass:w.options.ghostClass,!1),_t(pe,c.ghostClass,!0)),ot!==S&&S!==xe.active?ot=S:S===xe.active&&ot&&(ot=null),p===S&&(S._ignoreWhileAnimating=n),S.animateAll(function(){_("dragOverAnimationComplete"),S._ignoreWhileAnimating=null}),S!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(n===pe&&!pe.animated||n===i&&!n.animated)&&(en=null),!c.dragoverBubble&&!t.rootEl&&n!==document&&(pe.parentNode[xt]._isOutsideThisEl(t.target),!H&&Ai(t)),!c.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),b=!0}function A(){It=Nt(pe),di=Nt(pe,c.draggable),mt({sortable:S,name:"change",toEl:i,newIndex:It,newDraggableIndex:di,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=Qt(n,c.draggable,i,!0),_("dragOver"),xe.eventCanceled)return b;if(pe.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||S._ignoreWhileAnimating===n)return m(!1);if(fr=!1,w&&!c.disabled&&(f?g||(a=ze!==Ue):ot===this||(this.lastPutMode=dr.checkPull(this,w,pe,t))&&y.checkPut(this,w,pe,t))){if(d=this._getDirection(t,n)==="vertical",s=tt(pe),_("dragOverValid"),xe.eventCanceled)return b;if(a)return ze=Ue,E(),this._hideClone(),_("revert"),xe.eventCanceled||(Ii?Ue.insertBefore(pe,Ii):Ue.appendChild(pe)),m(!0);var u=Qa(i,c.draggable);if(!u||iS(t,d,this)&&!u.animated){if(u===pe)return m(!1);if(u&&i===t.target&&(n=u),n&&(r=tt(n)),br(Ue,i,pe,s,n,r,t,!!n)!==!1)return E(),u&&u.nextSibling?i.insertBefore(pe,u.nextSibling):i.appendChild(pe),ze=i,A(),m(!0)}else if(u&&tS(t,d,this)){var O=Yi(i,0,c,!0);if(O===pe)return m(!1);if(n=O,r=tt(n),br(Ue,i,pe,s,n,r,t,!1)!==!1)return E(),i.insertBefore(pe,O),ze=i,A(),m(!0)}else if(n.parentNode===i){r=tt(n);var P=0,q,v=pe.parentNode!==i,V=!Y0(pe.animated&&pe.toRect||s,n.animated&&n.toRect||r,d),C=d?"top":"left",x=Mu(n,"top","top")||Mu(pe,"top","top"),I=x?x.scrollTop:void 0;en!==n&&(q=r[C],rs=!1,mr=!V&&c.invertSwap||v),P=nS(t,n,r,d,V?1:c.swapThreshold,c.invertedSwapThreshold==null?c.swapThreshold:c.invertedSwapThreshold,mr,en===n);var k;if(P!==0){var N=Nt(pe);do N-=P,k=ze.children[N];while(k&&(_e(k,"display")==="none"||k===Ae))}if(P===0||k===n)return m(!1);en=n,ss=P;var M=n.nextElementSibling,D=!1;D=P===1;var Q=br(Ue,i,pe,s,n,r,t,D);if(Q!==!1)return(Q===1||Q===-1)&&(D=Q===1),Wa=!0,setTimeout(eS,30),E(),D&&!M?i.appendChild(pe):n.parentNode.insertBefore(pe,D?M:n),x&&Pu(x,0,I-x.scrollTop),ze=pe.parentNode,q!==void 0&&!mr&&(gr=Math.abs(q-tt(n)[C])),A(),m(!0)}if(i.contains(pe))return m(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){qe(document,"mousemove",this._onTouchMove),qe(document,"touchmove",this._onTouchMove),qe(document,"pointermove",this._onTouchMove),qe(document,"dragover",Ai),qe(document,"mousemove",Ai),qe(document,"touchmove",Ai)},_offUpEvents:function(){var t=this.el.ownerDocument;qe(t,"mouseup",this._onDrop),qe(t,"touchend",this._onDrop),qe(t,"pointerup",this._onDrop),qe(t,"touchcancel",this._onDrop),qe(document,"selectstart",this)},_onDrop:function(t){var i=this.el,n=this.options;if(It=Nt(pe),di=Nt(pe,n.draggable),bt("drop",this,{evt:t}),ze=pe&&pe.parentNode,It=Nt(pe),di=Nt(pe,n.draggable),xe.eventCanceled){this._nulling();return}Ji=!1,mr=!1,rs=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ka(this.cloneId),Ka(this._dragStartId),this.nativeDraggable&&(qe(document,"drop",this),qe(i,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Jn&&_e(document.body,"user-select",""),_e(pe,"transform",""),t&&(ns&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Ae&&Ae.parentNode&&Ae.parentNode.removeChild(Ae),(Ue===ze||ot&&ot.lastPutMode!=="clone")&&We&&We.parentNode&&We.parentNode.removeChild(We),pe&&(this.nativeDraggable&&qe(pe,"dragend",this),za(pe),pe.style["will-change"]="",ns&&!Ji&&_t(pe,ot?ot.options.ghostClass:this.options.ghostClass,!1),_t(pe,this.options.chosenClass,!1),mt({sortable:this,name:"unchoose",toEl:ze,newIndex:null,newDraggableIndex:null,originalEvent:t}),Ue!==ze?(It>=0&&(mt({rootEl:ze,name:"add",toEl:ze,fromEl:Ue,originalEvent:t}),mt({sortable:this,name:"remove",toEl:ze,originalEvent:t}),mt({rootEl:ze,name:"sort",toEl:ze,fromEl:Ue,originalEvent:t}),mt({sortable:this,name:"sort",toEl:ze,originalEvent:t})),ot&&ot.save()):It!==Zi&&It>=0&&(mt({sortable:this,name:"update",toEl:ze,originalEvent:t}),mt({sortable:this,name:"sort",toEl:ze,originalEvent:t})),xe.active&&((It==null||It===-1)&&(It=Zi,di=is),mt({sortable:this,name:"end",toEl:ze,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){bt("nulling",this),Ue=pe=ze=Ae=Ii=We=hr=hi=Vi=Ht=ns=It=di=Zi=is=en=ss=ot=dr=xe.dragged=xe.ghost=xe.clone=xe.active=null,yr.forEach(function(t){t.checked=!0}),yr.length=Ua=Ga=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":pe&&(this._onDragOver(t),J0(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],i,n=this.el.children,s=0,r=n.length,a=this.options;s<r;s++)i=n[s],Qt(i,a.draggable,this.el,!1)&&t.push(i.getAttribute(a.dataIdAttr)||rS(i));return t},sort:function(t,i){var n={},s=this.el;this.toArray().forEach(function(r,a){var c=s.children[a];Qt(c,this.options.draggable,s,!1)&&(n[r]=c)},this),i&&this.captureAnimationState(),t.forEach(function(r){n[r]&&(s.removeChild(n[r]),s.appendChild(n[r]))}),i&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,i){return Qt(t,i||this.options.draggable,this.el,!1)},option:function(t,i){var n=this.options;if(i===void 0)return n[t];var s=ts.modifyOption(this,t,i);typeof s<"u"?n[t]=s:n[t]=i,t==="group"&&Gu(n)},destroy:function(){bt("destroy",this);var t=this.el;t[xt]=null,qe(t,"mousedown",this._onTapStart),qe(t,"touchstart",this._onTapStart),qe(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(qe(t,"dragover",this),qe(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(i){i.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),pr.splice(pr.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!hi){if(bt("hideClone",this),xe.eventCanceled)return;_e(We,"display","none"),this.options.removeCloneOnHide&&We.parentNode&&We.parentNode.removeChild(We),hi=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(hi){if(bt("showClone",this),xe.eventCanceled)return;pe.parentNode==Ue&&!this.options.group.revertClone?Ue.insertBefore(We,pe):Ii?Ue.insertBefore(We,Ii):Ue.appendChild(We),this.options.group.revertClone&&this.animate(pe,We),_e(We,"display",""),hi=!1}}};function J0(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function br(e,t,i,n,s,r,a,c){var y,w=e[xt],f=w.options.onMove,g;return window.CustomEvent&&!ri&&!Zn?y=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent("move",!0,!0)),y.to=t,y.from=e,y.dragged=i,y.draggedRect=n,y.related=s||t,y.relatedRect=r||tt(t),y.willInsertAfter=c,y.originalEvent=a,e.dispatchEvent(y),f&&(g=f.call(w,y,a)),g}function za(e){e.draggable=!1}function eS(){Wa=!1}function tS(e,t,i){var n=tt(Yi(i.el,0,i.options,!0)),s=Bu(i.el,i.options,Ae),r=10;return t?e.clientX<s.left-r||e.clientY<n.top&&e.clientX<n.right:e.clientY<s.top-r||e.clientY<n.bottom&&e.clientX<n.left}function iS(e,t,i){var n=tt(Qa(i.el,i.options.draggable)),s=Bu(i.el,i.options,Ae),r=10;return t?e.clientX>s.right+r||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>s.bottom+r||e.clientX>n.right&&e.clientY>n.top}function nS(e,t,i,n,s,r,a,c){var y=n?e.clientY:e.clientX,w=n?i.height:i.width,f=n?i.top:i.left,g=n?i.bottom:i.right,p=!1;if(!a){if(c&&gr<w*s){if(!rs&&(ss===1?y>f+w*r/2:y<g-w*r/2)&&(rs=!0),rs)p=!0;else if(ss===1?y<f+gr:y>g-gr)return-ss}else if(y>f+w*(1-s)/2&&y<g-w*(1-s)/2)return sS(t)}return p=p||a,p&&(y<f+w*r/2||y>g-w*r/2)?y>f+w/2?1:-1:0}function sS(e){return Nt(pe)<Nt(e)?1:-1}function rS(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,n=0;i--;)n+=t.charCodeAt(i);return n.toString(36)}function aS(e){yr.length=0;for(var t=e.getElementsByTagName("input"),i=t.length;i--;){var n=t[i];n.checked&&yr.push(n)}}function Er(e){return setTimeout(e,0)}function Ka(e){return clearTimeout(e)}vr&&Be(document,"touchmove",function(e){(xe.active||Ji)&&e.cancelable&&e.preventDefault()}),xe.utils={on:Be,off:qe,css:_e,find:Ru,is:function(t,i){return!!Qt(t,i,t,!1)},extend:H0,throttle:Nu,closest:Qt,toggleClass:_t,clone:qu,index:Nt,nextTick:Er,cancelNextTick:Ka,detectDirection:Uu,getChild:Yi},xe.get=function(e){return e[xt]},xe.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(xe.utils=Wt(Wt({},xe.utils),n.utils)),ts.mount(n)})},xe.create=function(e,t){return new xe(e,t)},xe.version=B0;var it=[],as,Ya,Xa=!1,Za,Ja,Sr,os;function oS(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(i){var n=i.originalEvent;this.sortable.nativeDraggable?Be(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Be(document,"pointermove",this._handleFallbackAutoScroll):n.touches?Be(document,"touchmove",this._handleFallbackAutoScroll):Be(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(i){var n=i.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?qe(document,"dragover",this._handleAutoScroll):(qe(document,"pointermove",this._handleFallbackAutoScroll),qe(document,"touchmove",this._handleFallbackAutoScroll),qe(document,"mousemove",this._handleFallbackAutoScroll)),zu(),Tr(),F0()},nulling:function(){Sr=Ya=as=Xa=os=Za=Ja=null,it.length=0},_handleFallbackAutoScroll:function(i){this._handleAutoScroll(i,!0)},_handleAutoScroll:function(i,n){var s=this,r=(i.touches?i.touches[0]:i).clientX,a=(i.touches?i.touches[0]:i).clientY,c=document.elementFromPoint(r,a);if(Sr=i,n||this.options.forceAutoScrollFallback||Zn||ri||Jn){eo(i,this.options,c,n);var y=ci(c,!0);Xa&&(!os||r!==Za||a!==Ja)&&(os&&zu(),os=setInterval(function(){var w=ci(document.elementFromPoint(r,a),!0);w!==y&&(y=w,Tr()),eo(i,s.options,w,n)},10),Za=r,Ja=a)}else{if(!this.options.bubbleScroll||ci(c,!0)===zt()){Tr();return}eo(i,this.options,ci(c,!1),!1)}}},ni(e,{pluginName:"scroll",initializeByDefault:!0})}function Tr(){it.forEach(function(e){clearInterval(e.pid)}),it=[]}function zu(){clearInterval(os)}var eo=Nu(function(e,t,i,n){if(t.scroll){var s=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,c=t.scrollSpeed,y=zt(),w=!1,f;Ya!==i&&(Ya=i,Tr(),as=t.scroll,f=t.scrollFn,as===!0&&(as=ci(i,!0)));var g=0,p=as;do{var d=p,S=tt(d),b=S.top,_=S.bottom,E=S.left,m=S.right,A=S.width,u=S.height,O=void 0,P=void 0,q=d.scrollWidth,v=d.scrollHeight,V=_e(d),C=d.scrollLeft,x=d.scrollTop;d===y?(O=A<q&&(V.overflowX==="auto"||V.overflowX==="scroll"||V.overflowX==="visible"),P=u<v&&(V.overflowY==="auto"||V.overflowY==="scroll"||V.overflowY==="visible")):(O=A<q&&(V.overflowX==="auto"||V.overflowX==="scroll"),P=u<v&&(V.overflowY==="auto"||V.overflowY==="scroll"));var I=O&&(Math.abs(m-s)<=a&&C+A<q)-(Math.abs(E-s)<=a&&!!C),k=P&&(Math.abs(_-r)<=a&&x+u<v)-(Math.abs(b-r)<=a&&!!x);if(!it[g])for(var N=0;N<=g;N++)it[N]||(it[N]={});(it[g].vx!=I||it[g].vy!=k||it[g].el!==d)&&(it[g].el=d,it[g].vx=I,it[g].vy=k,clearInterval(it[g].pid),(I!=0||k!=0)&&(w=!0,it[g].pid=setInterval((function(){n&&this.layer===0&&xe.active._onTouchMove(Sr);var M=it[this.layer].vy?it[this.layer].vy*c:0,D=it[this.layer].vx?it[this.layer].vx*c:0;typeof f=="function"&&f.call(xe.dragged.parentNode[xt],D,M,e,Sr,it[this.layer].el)!=="continue"||Pu(it[this.layer].el,D,M)}).bind({layer:g}),24))),g++}while(t.bubbleScroll&&p!==y&&(p=ci(p,!1)));Xa=w}},30),Ku=function(t){var i=t.originalEvent,n=t.putSortable,s=t.dragEl,r=t.activeSortable,a=t.dispatchSortableEvent,c=t.hideGhostForTarget,y=t.unhideGhostForTarget;if(i){var w=n||r;c();var f=i.changedTouches&&i.changedTouches.length?i.changedTouches[0]:i,g=document.elementFromPoint(f.clientX,f.clientY);y(),w&&!w.el.contains(g)&&(a("spill"),this.onSpill({dragEl:s,putSortable:n}))}};function to(){}to.prototype={startIndex:null,dragStart:function(t){var i=t.oldDraggableIndex;this.startIndex=i},onSpill:function(t){var i=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var s=Yi(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(i,s):this.sortable.el.appendChild(i),this.sortable.animateAll(),n&&n.animateAll()},drop:Ku},ni(to,{pluginName:"revertOnSpill"});function io(){}io.prototype={onSpill:function(t){var i=t.dragEl,n=t.putSortable,s=n||this.sortable;s.captureAnimationState(),i.parentNode&&i.parentNode.removeChild(i),s.animateAll()},drop:Ku},ni(io,{pluginName:"removeOnSpill"}),xe.mount(new oS),xe.mount(io,to);class lS{constructor(t,i){Je(this,"options",{interactionSubType:"default",maxChoices:0,response:null,onReady:null,onUpdate:null,onSelectionsLimit:null});return this.wrapper=t,this.sourcewrapper=this.wrapper.querySelector(".qti-order-source-wrapper"),this.sortable=null,this.isDisabled=!1,this.processOptions(i),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragMove=this.handleDragMove.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.notifyUpdate=this.notifyUpdate.bind(this),this.options.interactionSubType==="default"?this.sortable=new xe(this.sourcewrapper,{animation:400,onEnd:this.notifyUpdate}):this.options.interactionSubType==="ordermatch"&&(this.itemTarget=null,this.itemStart=null,this.isItemStartSource=!0,this.initialX=0,this.initialY=0,this.offsetX=0,this.offsetY=0,this.startingX=0,this.startingY=0,this.currentTargetCount=0,this.currentDragger=null,this.initializeSources(this.sourcewrapper),this.targetwrapper=this.wrapper.querySelector(".qti-order-target-wrapper"),this.initializeTargets(this.targetwrapper),this.restoreResponse()),this.notifyReady(),this}processOptions(t){"interactionSubType"in t&&(this.options.interactionSubType=t.interactionSubType),"response"in t&&(this.options.response=t.response),"maxChoices"in t&&(this.options.maxChoices=t.maxChoices),"onReady"in t&&(this.options.onReady=t.onReady),"onUpdate"in t&&(this.options.onUpdate=t.onUpdate),"onSelectionsLimit"in t&&(this.options.onSelectionsLimit=t.onSelectionsLimit)}notifyReady(){this.options.onReady!==null&&this.options.onReady({response:this.getResponse()})}notifyUpdate(t){this.options.onUpdate!==null&&this.options.onUpdate({response:this.computeResponse(t)})}notifySelectionsLimit(){this.options.onSelectionsLimit!==null&&this.options.onSelectionsLimit()}toggleDisable(t){if(this.isDisabled=t,this.options.interactionSubType==="default"&&this.sortable!==null){this.sortable.option("disabled",t);const i=this.sourcewrapper.querySelectorAll(".draggable");this.enableDisableDraggers(i,t);return}this.enableDisableDraggers(this.draggers,t)}handleDragStart(t){if(t.preventDefault(),!this.isDisabled&&t.button==0)return this.interactionStart(t.target,t.clientX,t.clientY,!1),!1}handleTouchStart(t){if(t.preventDefault(),!this.isDisabled)return t.targetTouches.length!=1||this.interactionStart(t.target,t.touches[0].pageX,t.touches[0].pageY,!0),!1}interactionStart(t,i,n,s){const r=this.getClosestElement(t,"draggable");this.itemStart=r.parentNode,this.isItemStartSource=this.itemStart.classList.contains("source"),this.identifyTargets(!0),this.itemTarget=null;const a=r.getBoundingClientRect();this.initialX=i,this.initialY=n,this.startingX=a.left,this.startingY=a.top,this.offsetX=i-this.startingX,this.offsetY=n-this.startingY,r.style.userSelect="none",r.style.width=a.width+"px",r.style.height=a.height+"px",r.style.transform=`translateX(${a.left}px) translateY(${a.top}px) translateZ(0)`,this.removePlaceholder(r),this.addPlaceholder(r),r.classList.contains("dragging")||r.classList.add("dragging"),this.setCurrentDragger(r),this.addListeners(r,s)}handleDragMove(t){t.preventDefault(),!this.isDisabled&&this.interactionMove(t.clientX,t.clientY)}handleTouchMove(t){t.preventDefault(),!this.isDisabled&&t.targetTouches.length==1&&this.interactionMove(t.touches[0].clientX,t.touches[0].clientY)}interactionMove(t,i){const n=this.currentDragger;this.offsetX=t-this.initialX,this.offsetY=i-this.initialY,this.constrainDraggerToWrapper(n),n.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0) scale(1)`;const s=n.getBoundingClientRect();this.findDraggerTarget(n,s,this.targets),this.isItemStartSource||this.findSourceDraggerTarget(n,s,this.sources)}constrainDraggerToWrapper(t){const i=t.getBoundingClientRect(),n=this.wrapper.getBoundingClientRect(),s=this.startingX+this.offsetX-n.x,r=this.startingY+this.offsetY-n.y,a=this.startingX+i.width+this.offsetX-(n.x+n.width),c=this.startingY+i.height+this.offsetY-(n.y+n.height);s<0&&(this.offsetX=this.offsetX-s),a>0&&(this.offsetX=this.offsetX-a),r<0&&(this.offsetY=this.offsetY-r),c>0&&(this.offsetY=this.offsetY-c)}handleDragEnd(t){this.isDisabled||this.interactionEnd(t.clientX,t.clientY,!1)}handleTouchEnd(t){this.isDisabled||this.interactionEnd(t.changedTouches[0].clientX,t.changedTouches[0].clientY,!0)}interactionEnd(t,i,n){const s=this.currentDragger;if(this.itemTarget===null?s.style.transform=`translateX(${this.startingX}px) translateY(${this.startingY}px) translateZ(0)`:s.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0)`,s.removeAttribute("style"),this.removePlaceholder(s),s.classList.contains("dragging")&&s.classList.remove("dragging"),this.clearTargetHighlights(),this.itemTarget===null){this.resetDraggerToItemStart(this.itemStart,s),this.setCurrentDragger(null),this.removeListeners(s,n);return}if(this.itemTarget.classList.contains("active")){if(this.itemTarget.classList.remove("active"),this.isExceedingMaxChoices(this.itemStart,this.itemTarget,s)){this.resetDraggerToItemStart(this.itemStart,s),this.notifySelectionsLimit(),this.setCurrentDragger(null),this.removeListeners(s,n);return}this.itemStart.classList.remove("full"),this.setDraggerToItemTarget(this.itemTarget,s),this.itemTarget.classList.contains("source")&&(this.decrementTargetCount(),this.sortContainerElements(this.sourcewrapper)),this.itemStart.classList.contains("target")||this.incrementTargetCount(),this.notifyUpdate()}this.setCurrentDragger(null),this.removeListeners(s,n)}setCurrentDragger(t){this.currentDragger=t}resetDraggerToItemStart(t,i){t.append(i),t.classList.add("full"),i.setAttribute("style","width:100%")}setDraggerToItemTarget(t,i){t.append(i),t.classList.add("full"),i.setAttribute("style","width:100%")}findDraggerTarget(t,i,n){n.forEach(s=>{const r=s.getBoundingClientRect();if(i.top+t.offsetHeight/2<r.bottom&&i.right-t.offsetWidth/2>r.left&&i.bottom-t.offsetHeight/2>r.top&&i.left+t.offsetWidth/2<r.right){if(this.isItemStartSource&&s.classList.contains("source")||s.classList.contains("full"))return;s.classList.add("active"),this.itemTarget=s}else s.classList.remove("active")},this)}findSourceDraggerTarget(t,i){const n=this.sourcewrapper.getBoundingClientRect();if(i.top+t.offsetHeight/2<n.bottom&&i.right-t.offsetWidth/2>n.left&&i.bottom-t.offsetHeight/2>n.top&&i.left+t.offsetWidth/2<n.right){for(let s=0;s<this.sources.length;s++)if(!this.sources[s].classList.contains("full")){this.sources[s].classList.add("active"),this.itemTarget=this.sources[s];break}}else for(let s=0;s<this.sources.length;s++)this.sources[s].classList.contains("active")&&this.sources[s].classList.remove("active")}addPlaceholder(t){const i=t.getBoundingClientRect(),n=document.createElement("div");n.classList.add("dragger-placeholder"),n.style.width=`${i.width}px`,n.style.height=`${i.height}px`,t.parentNode.insertBefore(n,t)}removePlaceholder(t){const i=t.parentNode.querySelector(".dragger-placeholder");i!==null&&t.parentNode.removeChild(i)}enableDisableDraggers(t,i){t.forEach(n=>{i?n.classList.add("disabled"):n.classList.remove("disabled")})}initializeSources(t){this.sources=t.querySelectorAll(".source"),this.sources.forEach(i=>{i.classList.add("full")},this),this.draggers=t.querySelectorAll(".draggable"),this.draggers.forEach((i,n)=>{const s=i.parentNode.getAttribute("data-identifier");i.setAttribute("data-identifier",s),i.setAttribute("data-order",n),i.setAttribute("tabindex",0),i.addEventListener("mousedown",this.handleDragStart),i.addEventListener("touchstart",this.handleTouchStart)},this)}initializeTargets(t){this.targets=t.querySelectorAll(".target"),this.targets.forEach(i=>{i.setAttribute("tabindex",0)})}identifyTargets(t){for(let i=0;i<this.targets.length;i++)t&&!this.targets[i].classList.contains("full")&&this.targets[i].classList.add("target-active");t&&!this.isItemStartSource&&this.sourcewrapper.classList.add("target-active")}addListeners(t,i){i?(this.removeListeners(t,i),t.addEventListener("touchmove",this.handleTouchMove),t.addEventListener("touchend",this.handleTouchEnd)):(this.removeListeners(t,i),document.addEventListener("mousemove",this.handleDragMove),document.addEventListener("mouseup",this.handleDragEnd))}removeListeners(t,i){i?(t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd)):(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd))}clearTargetHighlights(){this.targets.forEach(t=>{t.classList.remove("target-active")},this),this.sourcewrapper.classList.remove("target-active")}getClosestElement(t,i){return t?t&&t.classList.contains(i)?t:this.getClosestElement(t.parentElement,i):!1}sortContainerElements(t){let i=[],n=t.children;for(let s=0;s<n.length;s++){const r=n[s].querySelector("div.draggable");if(r){const a=r.getAttribute("data-order");i.push([1*a,n[s]])}}i.sort(function(s,r){return s[0]-r[0]});for(let s=0;s<i.length;s++)t.appendChild(i[s][1])}getResponse(){return this.options.interactionSubType==="default"?this.computeResponse({target:this.sourcewrapper}):this.computeResponse()}computeResponse(t){let i=[];switch(this.options.interactionSubType){case"default":t.target.querySelectorAll(".qti-simple-choice").forEach(n=>{i.push(n.getAttribute("data-identifier"))});break;case"ordermatch":this.targets.forEach(n=>{if(n.classList.contains("full")){const s=n.querySelector(".draggable");if(s!==null){i.push(s.getAttribute("data-identifier"));return}}i.push(null)});break}return i}restoreResponse(){this.options.response!==null&&this.options.response.forEach((t,i)=>{if(t!==null){const n=this.findSourceDraggerByIdentifier(t);this.emptyDraggerParent(n),this.addSourceDraggerToTargetAtIndex(i,n)}},this)}findSourceDraggerByIdentifier(t){for(let i=0;i<this.draggers.length;i++)if(t===this.draggers[i].getAttribute("data-identifier"))return this.draggers[i];return null}addSourceDraggerToTargetAtIndex(t,i){const n=this.targets[t];n.append(i),n.classList.add("full")}addTargetDraggerToSourceAtIndex(t,i){const n=this.sources[t];n.append(i),n.classList.add("full")}emptyDraggerParent(t){t.parentNode.classList.remove("full")}findSourceByIdentifier(t){for(let i=0;i<this.sources.length;i++)if(t===this.sources[i].getAttribute("data-identifier"))return this.sources[i];return null}isExceedingMaxChoices(t,i){return!(this.options.maxChoices===0||i.classList.contains("source")||t.classList.contains("target")||this.currentTargetCount<this.options.maxChoices)}initializeCurrentTargetCount(){this.currentTargetCount=0}incrementTargetCount(){this.currentTargetCount+=1}decrementTargetCount(){this.currentTargetCount!==0&&(this.currentTargetCount-=1)}reset(){this.options.interactionSubType==="ordermatch"&&(this.resetDraggersToSources(),this.initializeCurrentTargetCount()),this.destroy()}resetDraggersToSources(){this.targets.forEach(t=>{if(t.classList.contains("full")){const i=t.querySelector(".draggable"),n=this.findSourceByIdentifier(i.getAttribute("data-identifier"));if(n.classList.contains("full"))return;this.emptyDraggerParent(i),n.append(i),n.classList.add("full")}},this)}destroy(){this.options.interactionSubType==="ordermatch"&&(this.currentDragger!==null&&(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd)),this.draggers.forEach(t=>{t.removeEventListener("touchstart",this.handleTouchStart),t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd),t.removeEventListener("mousedown",this.handleDragStart)},this),this.targetwrapper.remove())}}const uS=new re,cS=new me,hS={emits:["orderGroupReady","orderGroupUpdate","orderGroupSelectionsLimit"],props:{responseIdentifier:{required:!0,type:String},cardinality:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},orientation:{required:!1,type:String,default:"horizontal"},maxChoices:{required:!1,type:String,default:"0"},interactionSubType:{required:!0,type:String},priorState:{required:!1,type:Object,default:null}},data(){return{choices:[],response:null,role:null,isRadio:null,isShuffle:null,hasPrompt:!1,promptElement:null,isOrientationVertical:!1,presentationFactory:null,sortable:null,isQtiValid:!0}},computed:{computedMaxChoices(){return this.maxChoices*1}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},disable(){this.sortable!==null&&this.sortable.toggleDisable(!0)},enable(){this.sortable!==null&&this.sortable.toggleDisable(!1)},getPromptElement(){return this.promptElement},setPromptElement(e){this.promptElement=e},validateChildren(){let e=0;this.$slots.default&&this.$slots.default()[0].children.forEach(t=>{if(uS.isValidSlot(t)){if(t.type.name==="QtiPrompt"){if(e>0)throw new h("Invalid element order. qti-prompt must come before qti-simple-choice's");if(!this.hasPrompt)return this.hasPrompt=!0;throw new h("Maximum of 1 qti-prompt element permitted")}if(t.type.name==="QtiSimpleChoice")return e+=1;throw new h('Node is not a qti-simple-choice: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children[0].children[0].children.forEach(t=>{t.type.name==="QtiSimpleChoice"&&t.component!==null&&this.choices.push(t.component.proxy)})},processGroupUI(e){if(this.hasPrompt){const i=this.$refs.ordergroup.querySelector(".qti-prompt");this.setPromptElement(i.cloneNode(!0))}const t=this.createContainer(this.choices,this.priorState);this.processContainerChoices(t),this.presentationFactory.initialize(this.$refs.root,this),this.sortable=new lS(this.$refs.root,{interactionSubType:this.interactionSubType,maxChoices:this.computedMaxChoices,response:e,onReady:this.handleWidgetReady,onUpdate:this.handleWidgetUpdate,onSelectionsLimit:this.handleSelectionsLimit})},resetGroupUI(){this.sortable!==null&&(this.sortable.reset(),this.sortable=null,this.processGroupUI(null))},handleWidgetReady(e){this.setResponse(e.response),this.$emit("orderGroupReady",{choices:this.choices,response:this.getResponse()})},handleWidgetUpdate(e){this.setResponse(e.response),this.$emit("orderGroupUpdate",{response:this.getResponse()})},handleSelectionsLimit(){this.$emit("orderGroupSelectionsLimit")},processContainerChoices(e){this.choices.splice(0,this.choices.length),this.$refs.ordergroup.innerHTML="",e.forEach(t=>{this.$refs.ordergroup.appendChild(t.node.$el),this.choices.push(t.node)},this)},createContainer(e,t){let i=[];return t===null?(e.forEach(n=>{i.push({fixed:n.fixed==="true",node:n})}),this.isShuffle&&cS.shuffleArrayFixed(i),i):(this.getPriorValue(this.interactionSubType).forEach(n=>{i.push({node:this.findChoiceByIdentifier(n,e)})},this),i)},getPriorValue(e){return this.priorState===null?[]:e==="default"?this.priorState.value:this.priorState.state.order},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new ee('Order Interaction State Invalid. Choice identifier "'+e+'" not found.')},initializeOrderGroup(){this.isShuffle=this.shuffle==="true",this.isOrientationVertical=this.orientation==="vertical",this.presentationFactory=new $0}},created(){try{if(typeof this.cardinality>"u")throw new h("Undefined qti-order-interaction cardinality");if(this.cardinality!=="ordered")throw new h('qti-order-interaction cardinality must be "ordered"');this.initializeOrderGroup(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,console.log("[QtiOrderInteraction][ValidationError]",e.name,e.message),new h(e.message)}},mounted(){if(this.isQtiValid)try{this.orderInteractionClassAttribute=this.$parent.$refs.root.classList,this.processChildren(),this.processGroupUI(this.priorState===null?null:this.priorState.value)}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw console.log("[QtiOrderInteraction][ValidationException]",e.message),new h(e.message);if(e.name==="QtiEvaluationException")throw console.log("[QtiOrderInteraction][EvaluationException]",e.message),new ee(e.message)}},beforeUnmount(){this.sortable.destroy(),this.sortable=null}},dS={ref:"root",class:"qti-order-interaction-wrapper"},fS={ref:"ordergroup",class:"qti-order-source-wrapper"};function pS(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",dS,[l.createElementVNode("ul",fS,[l.renderSlot(e.$slots,"default")],512)],512)}const mS=te(hS,[["render",pS]]),gS={name:"QtiGapText",props:{identifier:{required:!0,type:String},fixed:{required:!1,type:String,default:"false"},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},matchMax:{required:!0,type:String},matchMin:{required:!1,type:String,default:"0"}},data(){return{id:null,isQtiValid:!0}},methods:{},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},yS=["data-identifier","data-match-max","data-match-min","data-match-group"],vS={ref:"text",class:"gap-choice-text draggable"};function wS(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("li",{ref:"choicetext","data-identifier":i.identifier,"data-match-max":i.matchMax,"data-match-min":i.matchMin,"data-match-group":i.matchGroup,class:"qti-gap-choice qti-gap-text source"},[l.createElementVNode("div",vS,[l.renderSlot(e.$slots,"default")],512)],8,yS)}const bS=te(gS,[["render",wS]]),ES={name:"QtiGapImg",props:{identifier:{required:!0,type:String},fixed:{required:!1,type:String,default:"false"},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},matchMax:{required:!0,type:String},matchMin:{required:!1,type:String,default:"0"},objectLabel:{required:!1,type:String,default:null},top:{required:!1,type:String,default:null},left:{required:!1,type:String,default:null}},data(){return{isQtiValid:!0}},methods:{},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},SS=["data-identifier","data-match-max","data-match-min","data-match-group"],TS={ref:"image",class:"gap-choice-img draggable"};function CS(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("li",{ref:"choiceimage","data-identifier":i.identifier,"data-match-max":i.matchMax,"data-match-min":i.matchMin,"data-match-group":i.matchGroup,class:"qti-gap-choice qti-gap-img source"},[l.createElementVNode("div",TS,[l.renderSlot(e.$slots,"default")],512)],8,SS)}const _S=te(ES,[["render",CS]]),xS={name:"QtiGap",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},required:{required:!1,type:String,default:"false"}},data(){return{id:null,isRequired:!1,inputWidthClass:"",isQtiValid:!0}},methods:{},created(){this.isRequired=this.required!=="false"},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},IS=["data-identifier","data-required","data-match-group"];function VS(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("span",{ref:"gap","data-identifier":i.identifier,"data-required":s.isRequired,"data-match-max":"1","data-match-group":i.matchGroup,class:"gap-match-gap"},null,8,IS)}const AS=te(xS,[["render",VS]]),kS=new re,OS={name:"QtiHottext",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"}},data(){return{id:null,checked:"false",isRadio:!0,isDisabled:!1,isQtiValid:!0}},inheritAttrs:!0,methods:{handleClick(e){e.preventDefault(),!this.isDisabled&&(this.isRadio?this.triggerChecked(this.identifier,"true"):(this.toggleChecked(),this.triggerChecked(this.identifier,this.checked)))},handleKeydown(e){switch(e.code){case"Space":case"Enter":if(e.stopPropagation(),e.preventDefault(),this.isDisabled)return;this.toggleChecked(),this.triggerChecked(this.identifier,this.checked);break}},triggerChecked(e,t){const i=new CustomEvent("setChecked",{bubbles:!0,cancelable:!0,detail:{identifier:e,checked:t}});this.$refs.hottext.dispatchEvent(i)},setChecked(e){this.checked=e?"true":"false"},isChecked(){return this.checked==="true"},toggleChecked(){this.checked=this.checked==="true"?"false":"true"},setFocus(){this.$refs.hottext.focus()},setIsDisabled(e){this.isDisabled=e},initialize(){switch(this.$parent.cardinality){case"multiple":this.isRadio=!1,this.tabIndex=0;break;default:this.isRadio=!0,this.tabIndex=0;break}},createId(){if(this.$refs.hottext.hasAttribute("id")){this.id=this.$refs.hottext.getAttribute("id");return}this.id="hottext_"+kS.randomString(5,"a")+"_"+this.identifier,this.$refs.hottext.setAttribute("id",this.id)}},created(){this.initialize()},mounted(){if(this.isQtiValid)try{this.createId(),console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},LS=["data-identifier","aria-checked","tabindex"];function RS(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("span",{ref:"hottext","data-identifier":i.identifier,"aria-checked":s.checked,tabindex:e.tabIndex,onClick:t[0]||(t[0]=(...a)=>r.handleClick&&r.handleClick(...a)),onKeydown:t[1]||(t[1]=(...a)=>r.handleKeydown&&r.handleKeydown(...a)),class:"qti-hottext"},[l.renderSlot(e.$slots,"default")],40,LS)}const MS=te(OS,[["render",RS]]),$S=new re,NS={name:"QtiHotspotChoice",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},shape:{required:!0,type:String},coords:{required:!0,type:String},hotspotLabel:{required:!1,type:String,default:""},ariaLabel:{required:!1,type:String,default:""}},data(){return{shapeData:null,shapeColorProperties:null,checked:"false",isRadio:!0,isQtiValid:!0}},inheritAttrs:!0,methods:{getIdentifier(){return this.identifier},getShape(){return this.shape},getChecked(){return this.checked},setChecked(e){this.checked=e?"true":"false"},isChecked(){return this.checked==="true"},toggleChecked(){this.checked=this.checked==="true"?"false":"true"},getRole(){return this.isRadio?"radio":"checkbox"},getAriaLabel(){return this.ariaLabel.length>0?this.ariaLabel:this.hotspotLabel},getShapeColorProperties(){return this.shapeColorProperties},setShapeColorProperties(e){this.shapeColorProperties=e},getShapeData(){return this.shapeData},setShapeData(){const e=this.coords.split(",");switch(this.shape){case"circle":if(e.length!=3)return;this.shapeData=e;return;case"rect":if(e.length!==4)return;e[2]=parseInt(e[2])-parseInt(e[0]),e[3]=parseInt(e[3])-parseInt(e[1]),this.shapeData=e;return;case"poly":this.shapeData=this.computePolyShapeData(this.transformPolyCoords(e));return;case"ellipse":if(e.length!=4)return;this.shapeData=e;return;case"default":this.shapeData="";return}},transformPolyCoords(e){let t="";if(e.length%2!=0)return t;for(let i=0;i<e.length;i+=2)t+=`${e[i]},${e[i+1]}`,i+2<e.length&&(t+=" ");return t},computePolyShapeData(e){const t=e.indexOf(" ");return"M "+[e.slice(0,t),"L",e.slice(t)].join(" ")+" z"},getShapeElement(){let e=null;const t=this.getShapeData();if(t==null)return null;switch(this.getShape()){case"circle":e=document.createElementNS("http://www.w3.org/2000/svg","circle"),e.setAttribute("cx",t[0]),e.setAttribute("cy",t[1]),e.setAttribute("r",t[2]);break;case"rect":e=document.createElementNS("http://www.w3.org/2000/svg","rect"),e.setAttribute("x",t[0]),e.setAttribute("y",t[1]),e.setAttribute("width",t[2]),e.setAttribute("height",t[3]);break;case"poly":e=document.createElementNS("http://www.w3.org/2000/svg","path"),e.setAttribute("d",t);break;case"ellipse":e=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),e.setAttribute("cx",t[0]),e.setAttribute("cy",t[1]),e.setAttribute("rx",t[2]),e.setAttribute("ry",t[3]);break}return e!==null&&(e.setAttribute("class","qti3-player-hotspot-choice"),e.setAttribute("tabindex","0"),e.setAttribute("data-identifier",this.getIdentifier()),e.setAttribute("role",this.getRole()),e.setAttribute("aria-checked","false"),e.setAttribute("aria-label",this.getAriaLabel()),e.setAttribute("fill",`${this.shapeColorProperties.fillColor}`),e.setAttribute("fill-opacity",`${this.shapeColorProperties.fillOpacity}`),e.setAttribute("opacity",`${this.shapeColorProperties.unselectedOpacity}`),e.setAttribute("stroke",`${this.shapeColorProperties.strokeColor}`),e.setAttribute("stroke-width",`${this.shapeColorProperties.strokeWidth}`)),e},initialize(){switch($S.validateShapeAttribute(this.shape),this.$parent.cardinality){case"multiple":this.isRadio=!1;break;default:this.isRadio=!0;break}this.setShapeData(),this.setShapeColorProperties(this.$parent.getShapeColorProperties())}},created(){try{this.initialize()}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new h(e.message)}},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},PS={ref:"hotspotchoice",class:"qti-hotspot-choice"};function qS(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",PS,[l.renderSlot(e.$slots,"default")],512)}const BS=te(NS,[["render",qS]]),DS=new re,QS={name:"QtiInteractionModules",props:{primaryConfiguration:{required:!1,type:String,default:""},secondaryConfiguration:{required:!1,type:String,default:""}},data(){return{modules:[],isQtiValid:!0}},inheritAttrs:!0,methods:{getPrimaryConfiguration(){return this.primaryConfiguration},getSecondaryConfiguration(){return this.secondaryConfiguration},getModules(){return this.modules},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(DS.isValidSlot(e)){if(e.type.name==="QtiInteractionModule")return;throw new h('Node is not a qti-interaction-module: "'+e.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.type.name==="QtiInteractionModule"&&t.component!==null&&this.modules.push(t.component.proxy)})}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),console.log("[PCI]["+this.$options.name+"][PrimaryCfg="+this.primaryConfiguration+"][SecondaryCfg="+this.secondaryConfiguration+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},HS={ref:"root",class:"qti-interaction-modules"};function FS(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",HS,[l.renderSlot(e.$slots,"default")],512)}const US=te(QS,[["render",FS]]),GS={name:"QtiInteractionModule",props:{id:{required:!0,type:String},primaryPath:{required:!1,type:String,default:""},fallbackPath:{required:!1,type:String,default:""}},data(){return{isQtiValid:!0}},inheritAttrs:!0,methods:{getId(){return this.id},getPrimaryPath(){return this.primaryPath},getFallbackPath(){return this.fallbackPath}},mounted(){if(this.isQtiValid)try{console.log("[PCI]["+this.$options.name+"][Id="+this.id+"]","[Primary="+this.primaryPath+"]","[Fallback="+this.fallbackPath+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},jS={ref:"root",class:"qti-interaction-module"};function WS(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",jS,null,512)}const zS=te(GS,[["render",WS]]),KS={name:"QtiInteractionMarkup",props:{},data(){return{markup:"",isQtiValid:!0}},inheritAttrs:!0,methods:{getMarkup(){return this.markup},setMarkup(e){this.markup=e}},mounted(){if(this.isQtiValid)try{this.setMarkup(this.$refs.root.innerHTML),console.log("[PCI]["+this.$options.name+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new h(e.message)}}},YS={ref:"root",class:"qti-interaction-markup"};function XS(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",YS,[l.renderSlot(e.$slots,"default")],512)}const ZS=te(KS,[["render",XS]]),Yu=new re,tn=new me,JS={name:"QtiTemplateVariable",props:{templateIdentifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:null,isQtiValid:!0}},methods:{getIdentifier(){return this.templateIdentifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return tn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=Yu.validateVariableIdentifierAttribute(W,this.getIdentifier());if(typeof e>"u")return this.setValue(tn.valueToPciJson(tn.nullValue(),void 0,void 0)),this.getValue();if(e.value===null)return console.log("[QtiTemplateVariable]["+this.getIdentifier()+"] value:",{base:null}),this.setValue(tn.valueToPciJson(tn.nullValue(),this.getBaseType(),this.getCardinality())),this.getValue();const t=tn.valueToPciJson(e.value,this.getBaseType(),this.getCardinality());return console.log("[QtiTemplateVariable]["+this.getIdentifier()+"] value:",t),this.setValue(t),this.getValue()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{let e=Yu.validateVariableIdentifierAttribute(W,this.getIdentifier());this.valueBaseType=e.baseType,this.valueCardinality=e.cardinality}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},eT={class:"qti-template-variable"};function tT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",eT)}const iT=te(JS,[["render",tT]]),Xu=new re,nn=new me,nT={name:"QtiContextVariable",props:{identifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:null,isQtiValid:!0}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return nn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=Xu.validateVariableIdentifierAttribute(W,this.identifier);if(typeof e>"u")return this.setValue(nn.valueToPciJson(nn.nullValue(),void 0,void 0)),this.getValue();if(e.value===null)return console.log("[QtiContextVariable]["+this.identifier+"] value:",{base:null}),this.setValue(nn.valueToPciJson(nn.nullValue(),this.getBaseType(),this.getCardinality())),this.getValue();const t=nn.valueToPciJson(e.value,this.getBaseType(),this.getCardinality());return console.log("[QtiContextVariable]["+this.identifier+"] value:",t),this.setValue(t),this.getValue()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{let e=Xu.validateVariableIdentifierAttribute(W,this.identifier);this.valueBaseType=e.baseType,this.valueCardinality=e.cardinality}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},sT={class:"qti-context-variable"};function rT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",sT)}const aT=te(nT,[["render",rT]]),Zu=new re,oT=new me,lT={name:"QtiResponseProcessing",props:{template:{type:String,required:!1}},data(){return{responseRules:[],isQtiValid:!0,matchCorrectXml:`<qti-response-condition>
173
+ <qti-response-if>
174
+ <qti-match>
175
+ <qti-variable identifier="RESPONSE"/>
176
+ <qti-correct identifier="RESPONSE"/>
177
+ </qti-match>
178
+ <qti-set-outcome-value identifier="SCORE">
179
+ <qti-base-value base-type="float">1</qti-base-value>
180
+ </qti-set-outcome-value>
181
+ </qti-response-if>
182
+ <qti-response-else>
183
+ <qti-set-outcome-value identifier="SCORE">
184
+ <qti-base-value base-type="float">0</qti-base-value>
185
+ </qti-set-outcome-value>
186
+ </qti-response-else>
187
+ </qti-response-condition>`,mapResponseXml:`<qti-response-condition>
188
+ <qti-response-if>
189
+ <qti-is-null>
190
+ <qti-variable identifier="RESPONSE"/>
191
+ </qti-is-null>
192
+ <qti-set-outcome-value identifier="SCORE">
193
+ <qti-base-value base-type="float">0</qti-base-value>
194
+ </qti-set-outcome-value>
195
+ </qti-response-if>
196
+ <qti-response-else>
197
+ <qti-set-outcome-value identifier="SCORE">
198
+ <qti-map-response identifier="RESPONSE"/>
199
+ </qti-set-outcome-value>
200
+ </qti-response-else>
201
+ </qti-response-condition>`,mapResponsePointXml:`<qti-response-condition>
202
+ <qti-response-if>
203
+ <qti-is-null>
204
+ <qti-variable identifier="RESPONSE"/>
205
+ </qti-is-null>
206
+ <qti-set-outcome-value identifier="SCORE">
207
+ <qti-base-value base-type="float">0</qti-base-value>
208
+ </qti-set-outcome-value>
209
+ </qti-response-if>
210
+ <qti-response-else>
211
+ <qti-set-outcome-value identifier="SCORE">
212
+ <qti-map-response-point identifier="RESPONSE"/>
213
+ </qti-set-outcome-value>
214
+ </qti-response-else>
215
+ </qti-response-condition>`}},computed:{containsSlotData(){return this.$slots.default},useStandardTemplate(){if(!this.containsSlotData){const e=/.*(match_correct.xml|match_correct)$/,t=/.*(map_response.xml|map_response)$/,i=/.*(map_response_point.xml|map_response_point)$/;return e.test(this.template)||t.test(this.template)||i.test(this.template)}return!1},templateXml(){const e=/.*(match_correct.xml|match_correct)$/,t=/.*(map_response.xml|map_response)$/,i=/.*(map_response_point.xml|map_response_point)$/;let n="";return e.test(this.template)?(console.log("[ResponseProcessing][template]","MATCH_CORRECT"),n=this.matchCorrectXml):t.test(this.template)?(console.log("[ResponseProcessing][template]","MAP_RESPONSE"),n=this.mapResponseXml):i.test(this.template)&&(console.log("[ResponseProcessing][template]","MAP_RESPONSE_POINT"),n=this.mapResponsePoint),{template:`<div id="amp-rptemplate-container">${n}</div>`}}},methods:{validateChildren(){this.containsSlotData&&this.$slots.default().forEach(e=>{if(Zu.isValidSlot(e)&&!oT.isResponseRuleNode(Zu.kebabCase(e.type.name)))throw new h('Invalid Response Rule: "'+e.type.name+'"')})},processChildren(){this.getChildren().forEach(t=>{t.component!==null&&this.responseRules.push(t.component.proxy)})},getChildren(){return this.useStandardTemplate?this.$.subTree.children[0].children[0].component.subTree.children:this.$.subTree.children[1].children[0].children},evaluate(){try{this.responseRules.forEach(e=>{e.evaluate()})}catch(e){if(e.name==="QtiValidationException")throw new h(e.message);if(e.name==="QtiEvaluationException")throw new ee(e.message);if(e.name==="QtiExitProcessingException")console.log("["+e.name+"] "+e.message);else throw new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),W.defineResponseProcessing({node:this})}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},uT={class:"qti-response-processing"},cT={key:0},hT={key:1};function dT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",uT,[r.useStandardTemplate?(l.openBlock(),l.createElementBlock("div",cT,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.templateXml),{ref:"rptemplate"},null,512))])):l.createCommentVNode("",!0),r.containsSlotData?(l.openBlock(),l.createElementBlock("div",hT,[l.renderSlot(e.$slots,"default")])):l.createCommentVNode("",!0)])}const fT=te(lT,[["render",dT]]),Ju=new re,pT=new me,mT={name:"QtiTemplateProcessing",emits:["templateProcessingReady"],data(){return{templateRules:[],isQtiValid:!0}},methods:{resetTemplateProcessing(){W.resetTemplateVariables(),this.evaluate()},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(Ju.isValidSlot(e)&&!pT.isTemplateRuleNode(Ju.kebabCase(e.type.name)))throw new h('Invalid Template Rule: "'+e.type.name+'"')})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&this.templateRules.push(t.component.proxy)})},evaluate(){try{this.templateRules.forEach(e=>{e.evaluate()})}catch(e){if(e.name==="QtiValidationException")throw new h(e.message);if(e.name==="QtiEvaluationException")throw new ee(e.message);if(e.name==="QtiExitProcessingException")console.log("["+e.name+"] "+e.message);else if(e.name==="QtiTemplateConstraintException")this.resetTemplateProcessing();else throw new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.$parent.$emit("templateProcessingReady",{templateProcessing:this})}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},gT={class:"qti-template-processing"};function yT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",gT,[l.renderSlot(e.$slots,"default")])}const vT=te(mT,[["render",yT]]),ec=new re,wT={name:"QtiCatalogInfo",data(){return{isQtiValid:!0}},methods:{isCatalog(e){return e==="qti-catalog"},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Invalid CatalogInfo. Must contain at least 1 qti-catalog child node");if(this.$slots.default().forEach(t=>{if(ec.isValidSlot(t)){if(!this.isCatalog(ec.kebabCase(t.type.name)))throw new h('Invalid CatalogInfo child node: "'+t.type.name+'"');e+=1}}),e===0)throw new h("Invalid CatalogInfo. Must contain at least 1 qti-catalog child node")}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){this.isQtiValid&&console.log("[QtiCatalogInfo]")}},bT={class:"qti-catalog-info"};function ET(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",bT,[l.renderSlot(e.$slots,"default")])}const ST=te(wT,[["render",ET]]),tc=new re,TT={name:"QtiCatalog",props:{id:{type:String,required:!0}},data(){return{cards:[],isQtiValid:!0}},methods:{getCards(){return this.cards},isCard(e){return e==="qti-card"},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Invalid Catalog. Must contain at least 1 qti-card child node");if(this.$slots.default().forEach(t=>{if(tc.isValidSlot(t)){if(!this.isCard(tc.kebabCase(t.type.name)))throw new h('Invalid Catalog child node: "'+t.type.name+'"');e+=1}}),e===0)throw new h("Invalid Catalog. Must contain at least 1 qti-card child node")},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&this.cards.push(t.component.proxy)})}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),W.defineCatalog({id:this.id,node:this}),console.log("[QtiCatalog][Id: "+this.id+" ]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},CT={class:"qti-catalog"};function _T(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",CT,[l.renderSlot(e.$slots,"default")])}const xT=te(TT,[["render",_T]]),no=new re,IT={name:"QtiCard",props:{support:{type:String,required:!0},"xml:lang":{type:String,required:!1,default:""}},data(){return{children:[],isQtiValid:!0}},methods:{getLanguage(){return this.$props["xml:lang"]},getChildren(){return this.children},isValidCardChild(e){return e==="qti-card-entry"||e==="qti-html-content"||e==="qti-file-href"},validateChildren:function(){let e=0,t=null;this.$slots.default&&this.$slots.default().forEach(i=>{if(no.isValidSlot(i)){if(!this.isValidCardChild(no.kebabCase(i.type.name)))throw new h('Invalid Card Child node: "'+i.type.name+'"');if(e>0&&i.type.name!==t)throw new h('All Card Child elements must be the same element type: "'+t+'"');if(e>0&&no.kebabCase(i.type.name)!=="qti-card-entry")throw new h('Multiple Card Child elements of type "'+i.type.name+'" not permitted');e===0&&(t=i.type.name),e+=1}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&this.children.push(t.component.proxy)})}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),console.log("[QtiCard][Support: "+this.support+" ]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},VT={class:"qti-card"};function AT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",VT,[l.renderSlot(e.$slots,"default")])}const kT=te(IT,[["render",AT]]),ic=new re,OT={name:"QtiCardEntry",props:{"xml:lang":{type:String,required:!1,default:""},default:{type:String,required:!1,default:"false"},dataListCode:{type:String,required:!1},dataListType:{type:String,required:!1},dataMathRepresentation:{type:String,required:!1},dataContracted:{type:String,required:!1},dataType:{type:String,required:!1},dataFormat:{type:String,required:!1}},data(){return{children:[],isQtiValid:!0}},methods:{getLanguage(){return this.$props["xml:lang"]},isDefault(){return this.$props.default==="true"},getDataAttributes(){let e={};return typeof this.dataListCode<"u"&&(e["data-list-code"]=this.dataListCode),typeof this.dataListType<"u"&&(e["data-list-type"]=this.dataListType),typeof this.dataMathRepresentation<"u"&&(e["data-math-representation"]=this.dataMathRepresentation),typeof this.dataContracted<"u"&&(e["data-contracted"]=this.dataContracted),typeof this.dataType<"u"&&(e["data-type"]=this.dataType),typeof this.dataFormat<"u"&&(e["data-format"]=this.dataFormat),e},getChildren(){return this.children},isValidCardChild(e){return e==="qti-html-content"||e==="qti-file-href"},validateChildren:function(){let e=0;this.$slots.default&&this.$slots.default().forEach(t=>{if(ic.isValidSlot(t)){if(!this.isValidCardChild(ic.kebabCase(t.type.name)))throw new h('Invalid CardEntry Child node: "'+t.type.name+'"');if(e>1)throw new h("Maximum of one CardEntry Child node permitted");e+=1}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&this.children.push(t.component.proxy)})}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),console.log("[QtiCardEntry][Lang: "+this.$props["xml:lang"]+" ]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},LT={class:"qti-card-entry"};function RT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",LT,[l.renderSlot(e.$slots,"default")])}const MT=te(OT,[["render",RT]]),$T={name:"QtiHtmlContent",data(){return{content:null,isQtiValid:!0}},methods:{getContent(){return this.content},setContent(e){this.content=e},validateChildren(){},processChildren(){this.setContent(this.$refs.root.innerHTML)}},created(){this.validateChildren()},mounted(){if(this.isQtiValid)try{this.processChildren(),console.log("["+this.$options.name+"]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},NT={ref:"root",class:"qti-html-content"};function PT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",NT,[l.renderSlot(e.$slots,"default")],512)}const qT=te($T,[["render",PT]]),BT={name:"QtiFileHref",props:{mimeType:{type:String,required:!0}},data(){return{content:null,isQtiValid:!0}},methods:{getContent(){return this.content},setContent(e){this.content=e},validateChildren(){},processChildren(){this.setContent(this.$refs.root.innerText)}},created(){this.validateChildren()},mounted(){if(this.isQtiValid)try{this.processChildren(),console.log("["+this.$options.name+"]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},DT={ref:"root",class:"qti-file-href"};function QT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",DT,[l.renderSlot(e.$slots,"default")],512)}const HT=te(BT,[["render",QT]]);class Et extends Error{constructor(t){super(t),this.name="QtiExitProcessingException"}}const FT=new re,UT={name:"QtiResponseCondition",data(){return{responseRules:[],isQtiValid:!0}},methods:{validateChildren(){let e=0,t=0;if(!this.$slots.default)throw new h("Must have 1 qti-response-if node");if(this.$slots.default().forEach(i=>{if(FT.isValidSlot(i))switch(i.type.name){case"QtiResponseIf":if(e===0)e=1;else throw new h("Only 1 qti-response-if node permitted");break;case"QtiResponseElse":if(e===0)throw new h("qti-response-else node not permitted before qti-response-if");if(t===0)t=1;else throw new h("More than one qti-response-else node");break;case"QtiResponseElseIf":if(e===0)throw new h("qti-response-else-if node not permitted before qti-response-if");if(t===1)throw new h("qti-response-else-if node not permitted after qti-response-else");break;default:throw new h('Invalid Child Node: "'+i.type.name+'"')}}),e===0)throw new h("Must have 1 qti-response-if node")},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&this.responseRules.push(t.component.proxy)})},evaluate(){try{this.responseRules.every(e=>!e.evaluate())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},GT={class:"qti-response-condition"};function jT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",GT,[l.renderSlot(e.$slots,"default")])}const WT=te(UT,[["render",jT]]),zT={name:"QtiResponseProcessingFragment",mounted(){console.log("[QtiResponseProcessingFragment]")}},KT={class:"qti-response-processing-fragment"};function YT(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",KT,[l.renderSlot(e.$slots,"default")])}const XT=te(zT,[["render",YT]]),ls=new re,ZT=new me,JT={name:"QtiSetOutcomeValue",props:{identifier:{type:String,required:!0}},data(){return{isQtiValid:!0,expression:null}},methods:{validateRequiredBaseTypeAndCardinality(e,t){if(e.baseType!==t.getBaseType())throw new h('Outcome variable has base-type "'+e.baseType+'" but Expression node has base-type "'+t.getBaseType()+'"');if(e.cardinality!==t.getCardinality())throw new h('Outcome variable has cardinality "'+e.cardinality+'" but Expression node has cardinality "'+t.getCardinality()+'"')},validateChildren(){let e=0;if(!this.$slots.default)throw new h("Must have one Expression node");if(this.$slots.default().forEach(t=>{if(ls.isValidSlot(t))if(ZT.isExpressionNode(ls.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{t.component!==null&&this.validateRequiredBaseTypeAndCardinality(ls.validateOutcomeIdentifierAttribute(W,this.identifier),t.component.proxy)})},evaluate(){try{let e=this.expression.evaluate();if(typeof ls.validateOutcomeIdentifierAttribute(W,this.identifier)>"u")throw new ee('Outcome variable not found for identifier: "'+this.identifier+'"');W.setOutcomeVariableValue({identifier:this.identifier,value:e}),console.log("[SetOutcomeValue]["+this.identifier+"] value:",e)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{ls.validateOutcomeIdentifierAttribute(W,this.identifier),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},eC={class:"qti-set-outcome-value"};function tC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",eC,[l.renderSlot(e.$slots,"default")])}const iC=te(JT,[["render",tC]]),nC={name:"QtiExitResponse",data(){return{isQtiValid:!0}},methods:{validateChildren(){},evaluate(){throw new Et("qti-exit-response")}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){}},sC={class:"qti-exit-response"};function rC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",sC)}const aC=te(nC,[["render",rC]]),sn=new re,so=new me,oC={name:"QtiLookupOutcomeValue",props:{identifier:{type:String,required:!0}},data(){return{isQtiValid:!0,expression:null}},methods:{validateRequiredBaseTypeAndCardinality(e,t){if(t.getCardinality()!=="single")throw new h('Expression node must have cardinality "single"');if(e.lookupTable===null)throw new ee('Missing lookupTable for Outcome variable identifier: "'+this.identifier+'"');const i=t.getBaseType(),n=e.lookupTable.getTableType();if(n==="match"){if(i!=="integer")throw new h('Expression node must have base-type "integer" when lookupTable=matchTable')}else if(n==="interpolation"&&i!=="integer"&&i!=="float"&&i!=="duration")throw new h('Expression node must have base-type "integer", "float", or "duration" when lookupTable=interpolationTable')},validateChildren(){let e=0;if(this.$slots.default.forEach(t=>{if(sn.isValidSlot(t))if(so.isExpressionNode(t.componentOptions.tag))e+=1;else throw new h('Node is not an Expression: "'+t.componentOptions.tag+'"')}),e!==1)throw new h("Must have exactly one Expression node");this.validateRequiredBaseTypeAndCardinality(sn.validateOutcomeIdentifierAttribute(W,this.identifier),this.$children[0]),this.processChildren()},processChildren(){this.expression=this.$children[0]},evaluate(){try{let e=this.expression.evaluate(),t=sn.validateOutcomeIdentifierAttribute(W,this.identifier);if(typeof t>"u")throw new ee('Outcome variable not found for identifier: "'+this.identifier+'"');if(t.lookupTable===null)throw new ee('Outcome variable lookupTable not found for identifier: "'+this.identifier+'"');let i=null;so.isNullValue(e)||(this.expression.getBaseType()==="duration"&&(e=sn.FloatValue(sn.DurationValue(e))),i=e);let n=so.mapValueFromLookupTable(t,i);console.log("[LookupOutcomeValue]["+this.identifier+"][Expression]",i,"[TargetValue]",n),W.setOutcomeVariableValue({identifier:this.identifier,value:n})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{sn.validateOutcomeIdentifierAttribute(W,this.identifier)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},lC={class:"qti-lookup-outcome-value"};function uC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",lC,[l.renderSlot(e.$slots,"default")])}const cC=te(oC,[["render",uC]]),ro=new re,nc=new me,hC={name:"QtiResponseIf",data(){return{expression:null,responseRules:[],isQtiValid:!0}},methods:{validateChildren(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(ro.isValidSlot(t))if(nc.isExpressionNode(ro.kebabCase(t.type.name)))if(e===0)e=1;else throw new h('Multiple Expression nodes: "'+t.type.name+'"');else if(nc.isResponseRuleNode(ro.kebabCase(t.type.name))){if(e===0)throw new h('Response Rules must follow an Expression node: "'+t.type.name+'"')}else throw new h('Node is not an Expression or a Response Rule: "'+t.type.name+'"')}),e===0)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;let t=!0;e.forEach(i=>{if(i.component===null)return;const n=i.component.proxy;t?(t=!1,this.expression=n):this.responseRules.push(n)})},evaluate(){try{return this.expression.evaluate()?(this.responseRules.forEach(e=>{e.evaluate()}),!0):!1}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},dC={class:"qti-response-if"};function fC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",dC,[l.renderSlot(e.$slots,"default")])}const pC=te(hC,[["render",fC]]),ao=new re,sc=new me,mC={name:"QtiResponseElse",data(){return{responseRules:[],isQtiValid:!0}},methods:{validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(ao.isValidSlot(e)){if(sc.isExpressionNode(ao.kebabCase(e.type.name)))throw new h('Expression nodes not permitted: "'+e.type.name+'"');if(!sc.isResponseRuleNode(ao.kebabCase(e.type.name)))throw new h('Invalid Response Rule node: "'+e.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&this.responseRules.push(t.component.proxy)})},evaluate(){try{return this.responseRules.forEach(e=>{e.evaluate()}),!0}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},gC={class:"qti-response-else"};function yC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",gC,[l.renderSlot(e.$slots,"default")])}const vC=te(mC,[["render",yC]]),oo=new re,rc=new me,wC={name:"QtiResponseElseIf",data(){return{expression:null,responseRules:[],isQtiValid:!0}},methods:{validateChildren(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(oo.isValidSlot(t))if(rc.isExpressionNode(oo.kebabCase(t.type.name)))if(e===0)e=1;else throw new h('Multiple Expression nodes: "'+t.type.name+'"');else if(rc.isResponseRuleNode(oo.kebabCase(t.type.name))){if(e===0)throw new h('Response Rules must follow an Expression node: "'+t.type.name+'"')}else throw new h('Node is not an Expression or a Response Rule: "'+t.type.name+'"')}),e===0)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;let t=!0;e.forEach(i=>{if(i.component===null)return;const n=i.component.proxy;t?(t=!1,this.expression=n):this.responseRules.push(n)})},evaluate(){try{return this.expression.evaluate()?(this.responseRules.forEach(e=>{e.evaluate()}),!0):!1}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},bC={class:"qti-response-else-if"};function EC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",bC,[l.renderSlot(e.$slots,"default")])}const SC=te(wC,[["render",EC]]),us=new re,TC=new me,CC={name:"QtiSetTemplateValue",props:{identifier:{type:String,required:!0}},data(){return{isQtiValid:!0,expression:null}},methods:{validateRequiredBaseTypeAndCardinality(e,t){if(e.baseType!==t.getBaseType())throw new h('Template variable "'+e.identifier+'" has base-type "'+e.baseType+'" but Expression node has base-type "'+t.getBaseType()+'"');if(e.cardinality!==t.getCardinality())throw new h('Template variable "'+e.identifier+'" has cardinality "'+e.cardinality+'" but Expression node has cardinality "'+t.getCardinality()+'"')},validateChildren(){let e=0;if(!this.$slots.default)throw new h("Must have one Expression node");if(this.$slots.default().forEach(t=>{if(us.isValidSlot(t))if(TC.isExpressionNode(us.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{t.component!==null&&this.validateRequiredBaseTypeAndCardinality(us.validateTemplateIdentifierAttribute(W,this.identifier),t.component.proxy)})},evaluate(){try{let e=this.expression.evaluate();if(typeof us.validateTemplateIdentifierAttribute(W,this.identifier)>"u")throw new ee('Template variable not found for identifier: "'+this.identifier+'"');W.setTemplateVariableValue({identifier:this.identifier,value:e}),console.log("[SetTemplateValue]["+this.identifier+"] value:",e)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{us.validateTemplateIdentifierAttribute(W,this.identifier),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},_C={class:"qti-set-template-value"};function xC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",_C,[l.renderSlot(e.$slots,"default")])}const IC=te(CC,[["render",xC]]),VC=new re,AC={name:"QtiTemplateCondition",data(){return{templateRules:[],isQtiValid:!0}},methods:{validateChildren(){let e=0,t=0;if(!this.$slots.default)throw new h("Must have 1 qti-template-if node");if(this.$slots.default().forEach(i=>{if(VC.isValidSlot(i))switch(i.type.name){case"QtiTemplateIf":if(e===0)e=1;else throw new h("Only 1 qti-template-if node permitted");break;case"QtiTemplateElse":if(e===0)throw new h("qti-template-else node not permitted before qti-template-if");if(t===0)t=1;else throw new h("More than one qti-template-else node");break;case"QtiTemplateElseIf":if(e===0)throw new h("qti-template-else-if node not permitted before qti-template-if");if(t===1)throw new h("qti-template-else-if node not permitted after qti-template-else");break;default:throw new h('Invalid Child Node: "'+i.type.name+'"')}}),e===0)throw new h("Must have 1 qti-template-if node")},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&this.templateRules.push(t.component.proxy)})},evaluate(){try{this.templateRules.every(e=>!e.evaluate())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},kC={class:"qti-template-condition"};function OC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",kC,[l.renderSlot(e.$slots,"default")])}const LC=te(AC,[["render",OC]]),lo=new re,ac=new me,RC={name:"QtiTemplateIf",data(){return{expression:null,templateRules:[],isQtiValid:!0}},methods:{validateChildren(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(lo.isValidSlot(t))if(ac.isExpressionNode(lo.kebabCase(t.type.name)))if(e===0)e=1;else throw new h('Multiple Expression nodes: "'+t.type.name+'"');else if(ac.isTemplateRuleNode(lo.kebabCase(t.type.name))){if(e===0)throw new h('Template Rules must follow an Expression node: "'+t.type.name+'"')}else throw new h('Node is not an Expression or a Template Rule: "'+t.type.name+'"')}),e===0)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;let t=!0;e.forEach(i=>{if(i.component===null)return;const n=i.component.proxy;t?(t=!1,this.expression=n):this.templateRules.push(n)})},evaluate(){try{return this.expression.evaluate()?(this.templateRules.forEach(e=>{e.evaluate()}),!0):!1}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},MC={class:"qti-template-if"};function $C(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",MC,[l.renderSlot(e.$slots,"default")])}const NC=te(RC,[["render",$C]]),uo=new re,oc=new me,PC={name:"QtiTemplateElse",data(){return{templateRules:[],isQtiValid:!0}},methods:{validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(uo.isValidSlot(e)){if(oc.isExpressionNode(uo.kebabCase(e.type.name)))throw new h('Expression nodes not permitted: "'+e.type.name+'"');if(!oc.isTemplateRuleNode(uo.kebabCase(e.type.name)))throw new h('Invalid Template Rule node: "'+e.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&this.templateRules.push(t.component.proxy)})},evaluate(){try{return this.templateRules.forEach(e=>{e.evaluate()}),!0}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},qC={class:"qti-template-else"};function BC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",qC,[l.renderSlot(e.$slots,"default")])}const DC=te(PC,[["render",BC]]),co=new re,lc=new me,QC={name:"QtiTemplateElseIf",data(){return{expression:null,templateRules:[],isQtiValid:!0}},methods:{validateChildren(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(co.isValidSlot(t))if(lc.isExpressionNode(co.kebabCase(t.type.name)))if(e===0)e=1;else throw new h('Multiple Expression nodes: "'+t.type.name+'"');else if(lc.isTemplateRuleNode(co.kebabCase(t.type.name))){if(e===0)throw new h('Template Rules must follow an Expression node: "'+t.type.name+'"')}else throw new h('Node is not an Expression or a Template Rule: "'+t.type.name+'"')}),e===0)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;let t=!0;e.forEach(i=>{if(i.component===null)return;const n=i.component.proxy;t?(t=!1,this.expression=n):this.templateRules.push(n)})},evaluate(){try{return this.expression.evaluate()?(this.templateRules.forEach(e=>{e.evaluate()}),!0):!1}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},HC={class:"qti-template-else-if"};function FC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",HC,[l.renderSlot(e.$slots,"default")])}const UC=te(QC,[["render",FC]]);class uc extends Error{constructor(t){super(t),this.name="QtiTemplateConstraintException"}}const cc=new re,hc=new me,GC={name:"QtiTemplateConstraint",data(){return{expression:null,iterationCount:0,isQtiValid:!0}},methods:{getIterationCount(){return this.iterationCount},setIterationCount(e){this.iterationCount=e},incrementIterationCount(){this.setIterationCount(this.getIterationCount()+1)},resetIterationCount(){this.setIterationCount(0)},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(cc.isValidSlot(t))if(hc.isExpressionNode(cc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),this.expression=e[0].component.proxy},validateExpressions(e){e.forEach(t=>{const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expression must be cardinality="single"');if(i.getBaseType()!=="boolean")throw new h('Expression must be base-type="boolean"')})},evaluate(){try{if(this.iterationCount>100){this.resetIterationCount(),console.log("[TemplateConstraint][MaxIterations]");return}let e=this.expression.evaluate();if(hc.isNullValue(e)||!e)throw this.incrementIterationCount(),console.log("[TemplateConstraint][False]["+this.getIterationCount()+"]"),new uc("TemplateConstraint:false");this.resetIterationCount(),console.log("[TemplateConstraint][True]")}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiTemplateConstraintException"?new uc(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},jC={class:"qti-template-constraint"};function WC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",jC,[l.renderSlot(e.$slots,"default")])}const zC=te(GC,[["render",WC]]),KC={name:"QtiExitTemplate",data(){return{isQtiValid:!0}},methods:{validateChildren(){},evaluate(){throw new Et("qti-exit-template")}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){}},YC={class:"qti-exit-template"};function XC(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",YC)}const ZC=te(KC,[["render",XC]]),cs=new re,JC=new me,e1={name:"QtiSetCorrectResponse",props:{identifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{validateRequiredBaseTypeAndCardinality(e,t){if(e.cardinality!==t.getCardinality())throw new h('Response variable has cardinality "'+e.cardinality+'" but Expression node has cardinality "'+t.getCardinality()+'"');if(e.baseType==="float"&&t.getBaseType()==="integer")throw new h("Integer values cannot be assigned to Floating point variables");if(e.baseType==="integer"&&t.getBaseType()==="float")throw new h("Floating point values cannot be assigned to Integer variables");if(e.baseType!==t.getBaseType())throw new h('Response variable has base-type "'+e.baseType+'" but Expression node has base-type "'+t.getBaseType()+'"')},validateChildren(){let e=0;if(!this.$slots.default)throw new h("Must have one Expression node");if(this.$slots.default().forEach(t=>{if(cs.isValidSlot(t))if(JC.isExpressionNode(cs.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{t.component!==null&&this.validateRequiredBaseTypeAndCardinality(cs.validateResponseIdentifierAttribute(W,this.identifier),t.component.proxy)})},evaluate(){try{let e=this.expression.evaluate();if(typeof cs.validateResponseIdentifierAttribute(W,this.identifier)>"u")throw new ee('Response variable not found for identifier: "'+this.identifier+'"');W.setResponseVariableCorrectResponse({identifier:this.identifier,value:e}),console.log("[SetCorrectResponse]["+this.identifier+"] value:",e)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{cs.validateResponseIdentifierAttribute(W,this.identifier),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},t1={class:"qti-set-correct-response"};function i1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",t1,[l.renderSlot(e.$slots,"default")])}const n1=te(e1,[["render",i1]]),Cr=new re,s1=new me,r1={name:"QtiSetDefaultValue",props:{identifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{validateRequiredBaseTypeAndCardinality(e,t){if(e.cardinality!==t.getCardinality())throw new h('Variable has cardinality "'+e.cardinality+'" but Expression node has cardinality "'+t.getCardinality()+'"');if(e.baseType==="float"&&t.getBaseType()==="integer")throw new h("Integer values cannot be assigned to Floating point variables");if(e.baseType==="integer"&&t.getBaseType()==="float")throw new h("Floating point values cannot be assigned to Integer variables");if(e.baseType!==t.getBaseType())throw new h('Variable has base-type "'+e.baseType+'" but Expression node has base-type "'+t.getBaseType()+'"')},validateChildren(){let e=0;if(!this.$slots.default)throw new h("Must have one Expression node");if(this.$slots.default().forEach(t=>{if(Cr.isValidSlot(t))if(s1.isExpressionNode(Cr.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{t.component!==null&&this.validateRequiredBaseTypeAndCardinality(Cr.validateVariableIdentifierAttribute(W,this.identifier),t.component.proxy)})},evaluate(){try{let e=this.expression.evaluate();W.setVariableDefaultValue({identifier:this.identifier,value:e}),console.log("[SetDefaultValue]["+this.identifier+"] value:",e)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{Cr.validateVariableIdentifierAttribute(W,this.identifier),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},a1={class:"qti-set-default-value"};function o1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",a1,[l.renderSlot(e.$slots,"default")])}const l1=te(r1,[["render",o1]]),u1=new re,hs=new Tl,c1=new me,h1={name:"QtiBaseValue",props:{baseType:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:"single",isQtiValid:!0}},methods:{getValue(){if(this.isNull())return c1.nullValue();switch(this.valueBaseType){case"integer":case"float":return this.value.toNumber();case"boolean":return this.value;case"string":case"identifier":return this.value;default:return console.log("["+this.$options.name+"][GetValue Exception]","Unhandled BaseType:"+this.baseType),null}},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},readChildren(e){this.valueBaseType!=null&&(this.value=this.parseSingleValue(this.baseType,e.textContent))},parseSingleValue(e,t){let i=null;try{switch(e){case"integer":i=new ce(hs.IntegerValue(t));break;case"float":i=new ce(hs.FloatValue(t));break;case"boolean":i=hs.BooleanValue(t);break;case"string":i=hs.StringValue(t);break;case"identifier":i=hs.IdentifierValue(t);break;default:throw new ge('[QtiBaseValue][Unhandled BaseType]: "'+e+'"')}}catch(n){throw new ge(n.message)}return i},evaluate(){try{return this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created:function(){try{u1.validateBaseType(this.baseType),this.valueBaseType=this.baseType}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted:function(){let e=this.$el.querySelector(".amp-basevalue__container");if(this.isQtiValid){try{this.readChildren(e)}catch(t){throw this.isQtiValid=!1,t.name==="QtiValidationException"?new h(t.message):t.name==="QtiParseException"?new ge(t.message):new Error(t.message)}console.log("["+this.$options.name+"][Value:",this.getValue(),"][BaseType:"+this.getBaseType()+"]")}e.remove()}},d1={class:"qti-base-value"},f1={class:"amp-basevalue__container"};function p1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",d1,[l.createElementVNode("div",f1,[l.renderSlot(e.$slots,"default")])])}const m1=te(h1,[["render",p1]]),dc=new re,ho=new me,g1={name:"QtiCorrect",props:{identifier:{type:String,required:!0},weightIdentifier:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return ho.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=dc.validateResponseIdentifierAttribute(W,this.identifier);return typeof e>"u"?(this.setValue(ho.nullValue()),this.getValue()):e.correctResponse===null?(console.log("[Correct]["+this.identifier+"] value:",null),this.setValue(ho.nullValue()),this.getValue()):(console.log("[Correct]["+this.identifier+"] value:",e.correctResponse),this.setValue(e.correctResponse),this.getValue())}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{let e=dc.validateResponseIdentifierAttribute(W,this.identifier);this.setBaseType(e.baseType),this.setCardinality(e.cardinality)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(`[Correct] ${e.message}`):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(`[Correct] ${e.message}`)}}},y1={class:"qti-correct"};function v1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",y1)}const w1=te(g1,[["render",v1]]),fc=new re,fo=new me,b1={name:"QtiDefault",props:{identifier:{type:String,required:!0},weightIdentifier:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return fo.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=fc.validateVariableIdentifierAttribute(W,this.identifier);return typeof e>"u"?(this.setValue(fo.nullValue()),this.getValue()):e.defaultValue===null?(console.log("[Default]["+this.identifier+"] value:",null),this.setValue(fo.nullValue()),this.getValue()):(console.log("[Default]["+this.identifier+"] value:",e.defaultValue),this.setValue(e.defaultValue),this.getValue())}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{let e=fc.validateVariableIdentifierAttribute(W,this.identifier);this.setBaseType(e.baseType),this.setCardinality(e.cardinality)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(`[Default] ${e.message}`):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(`[Default] ${e.message}`)}}},E1={class:"qti-default"};function S1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",E1)}const T1=te(b1,[["render",S1]]),pc=new re,po=new me,C1={name:"QtiVariable",props:{identifier:{type:String,required:!0},weightIdentifier:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return po.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=pc.validateVariableIdentifierAttribute(W,this.identifier);return typeof e>"u"?(this.setValue(po.nullValue()),this.getValue()):e.value===null?(console.log("[Variable]["+this.identifier+"] value:",null),this.setValue(po.nullValue()),this.getValue()):(console.log("[Variable]["+this.identifier+"] value:",e.value),this.setValue(e.value),this.getValue())}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{let e=pc.validateVariableIdentifierAttribute(W,this.identifier);this.valueBaseType=e.baseType,this.valueCardinality=e.cardinality}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},_1={class:"qti-variable"};function x1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",_1)}const I1=te(C1,[["render",x1]]),mc=new re,fi=new me,V1={name:"QtiMatch",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return fi.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(mc.isValidSlot(t))if(fi.isExpressionNode(mc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},validateExpressions(e){let t=!0,i=null;e.forEach(n=>{if(n.component===null)return;const s=n.component.proxy;if(t)t=!1,i=s;else{if(i.getBaseType()!==s.getBaseType())throw new h("Expressions must be of same base-type");if(i.getCardinality()!==s.getCardinality())throw new h("Expressions must be of same cardinality");if(s.getBaseType()==="duration")throw new h("Expressions of base-type duration not permitted")}})},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();if(fi.isNullValue(e)||fi.isNullValue(t))return this.setValue(fi.nullValue()),this.getValue();let i=this.expressions[0];if(i.getCardinality()=="single")return fi.isSingleValuesMatch(i.getBaseType(),e,t);if(i.getCardinality()=="multiple")return fi.isMultipleValuesMatch(i.getBaseType(),e,t);if(i.getCardinality()=="ordered")return fi.isOrderedValuesMatch(i.getBaseType(),e,t);i.getCardinality()=="record"&&(JSON.stringify(e),JSON.stringify(t))}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},A1={class:"qti-match"};function k1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",A1,[l.renderSlot(e.$slots,"default")])}const O1=te(V1,[["render",k1]]),gc=new re,yc=new me,L1={name:"QtiMapResponse",props:{identifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return yc.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=gc.validateResponseIdentifierAttribute(W,this.identifier);if(typeof e>"u")throw new ee('Cannot find response declaration for identifier: "'+this.identifier+'"');if(e.mapping===null)throw new ee('Cannot find mapping for response declaration: "'+this.identifier+'"');return this.setValue(yc.mapResponse(e)),this.getValue()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{if(gc.validateResponseIdentifierAttribute(W,this.identifier).cardinality==="record")throw new h('Cannot be applied to variables of "record" cardinality')}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},R1={class:"qti-map-response"};function M1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",R1,[l.renderSlot(e.$slots,"default")])}const $1=te(L1,[["render",M1]]),vc=new re,wc=new me,N1={name:"QtiIsNull",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expression:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return wc.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(vc.isValidSlot(t))if(wc.isExpressionNode(vc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},evaluate(){try{return this.expression.evaluate(),this.setValue(this.expression.isNull()),console.log("[IsNull][Value]",this.getValue()),this.getValue()}catch(e){throw this.value=null,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},P1={class:"qti-is-null"};function q1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",P1,[l.renderSlot(e.$slots,"default")])}const B1=te(N1,[["render",q1]]),bc=new re,_r=new me,D1={name:"QtiAnd",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return _r.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(bc.isValidSlot(t))if(_r.isExpressionNode(bc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("Must have at least one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(i.getBaseType()!=="boolean")throw new h('Expressions must be base-type="boolean"')})},evaluate(){try{let e=!1;for(let t=0;t<this.expressions.length;t++){let i=this.expressions[t].evaluate();if(_r.isNullValue(i))e=!0;else if(i===!1)return console.log("[And] value:",!1),this.setValue(!1),this.getValue()}return e?(console.log("[And] value:",null),this.setValue(_r.nullValue()),this.getValue()):(console.log("[And] value:",!0),this.setValue(!0),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Q1={class:"qti-and"};function H1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Q1,[l.renderSlot(e.$slots,"default")])}const F1=te(D1,[["render",H1]]),Ec=new re,xr=new me,U1={name:"QtiOr",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return xr.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(Ec.isValidSlot(t))if(xr.isExpressionNode(Ec.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("Must have at least one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(i.getBaseType()!=="boolean")throw new h('Expressions must be base-type="boolean"')})},evaluate(){try{let e=!1;for(let t=0;t<this.expressions.length;t++){let i=this.expressions[t].evaluate();if(xr.isNullValue(i))e=!0;else if(i===!0)return console.log("[Or] value:",!0),this.setValue(!0),this.getValue()}return e?(console.log("[Or] value:",null),this.setValue(xr.nullValue()),this.getValue()):(console.log("[Or] value:",!1),this.setValue(!1),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},G1={class:"qti-or"};function j1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",G1,[l.renderSlot(e.$slots,"default")])}const W1=te(U1,[["render",j1]]),Sc=new re,Ir=new me,z1={name:"QtiNot",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expression:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Ir.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(Sc.isValidSlot(t))if(Ir.isExpressionNode(Sc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expression must be cardinality="single"');if(i.getBaseType()!=="boolean")throw new h('Expression must be base-type="boolean"')})},evaluate(){try{let e=this.expression.evaluate();return Ir.isNullValue(e)?(console.log("[Not] value:",null),this.setValue(Ir.nullValue()),this.getValue()):(console.log("[Not] value:",!e),this.setValue(!e),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.nae==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},K1={class:"qti-not"};function Y1(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",K1,[l.renderSlot(e.$slots,"default")])}const X1=te(z1,[["render",Y1]]),Tc=new re,rn=new me,Z1={name:"QtiSubtract",data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return rn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Tc.isValidSlot(t))if(rn.isExpressionNode(Tc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(!rn.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type");if(i.getBaseType()==="float"&&this.setBaseType("float"),i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"')})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return rn.isNullValue(e)||rn.isNullValue(t)?(this.setValue(rn.nullValue()),console.log("[Subtract][Value]",this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),this.setValue(e.minus(t).toNumber()),console.log("[Subtract][Value]",this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},J1={class:"qti-subtract"};function e_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",J1,[l.renderSlot(e.$slots,"default")])}const t_=te(Z1,[["render",e_]]),Cc=new re,ki=new me,i_={name:"QtiSum",data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return ki.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(Cc.isValidSlot(t))if(ki.isExpressionNode(Cc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("Must have at least one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(!ki.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type");if(i.getBaseType()==="float"&&this.setBaseType("float"),i.getCardinality()!=="single"&&i.getCardinality()!=="multiple"&&i.getCardinality()!=="ordered")throw new h('Expressions must be of cardinality "single", "multiple", or "ordered"')})},evaluate(){try{let e="integer",t=new ce(0);for(let i=0;i<this.expressions.length;i++){let n=this.expressions[i].evaluate();if(ki.isNullValue(n))return console.log("[Sum]["+this.getBaseType()+"] value:",null),this.setValue(ki.nullValue()),this.getValue();this.expressions[i].getBaseType()!=="integer"&&(e="float");let s=this.expressions[i].getCardinality();if(s==="single")t=t.plus(n);else if(s==="multiple"||s==="ordered")for(let r=0;r<n.length;r++){if(ki.isNullValue(n[r]))return console.log("[Sum]["+this.getBaseType()+"] value:",null),this.setValue(ki.nullValue()),this.getValue();t=t.plus(n[r])}}if(e==="integer"){if(console.log("[Sum][Integer] value:",t.toNumber()),!t.isInteger())throw new ee("Expressions did not produce an integer value");return this.setBaseType("integer"),this.setValue(t.toNumber()),this.getValue()}return console.log("[Sum][Float] value:",t.toNumber()),this.setBaseType("float"),this.setValue(t.toNumber()),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},n_={class:"qti-sum"};function s_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",n_,[l.renderSlot(e.$slots,"default")])}const r_=te(i_,[["render",s_]]),_c=new re,ds=new me,a_={name:"QtiRandom",data(){return{value:null,valueBaseType:null,valueCardinality:"single",expression:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return ds.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(_c.isValidSlot(t))if(ds.isExpressionNode(_c.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="multiple"&&i.getCardinality()!=="ordered")throw new h('Expression must be of cardinality="multiple" or cardinality="ordered"');this.setBaseType(i.getBaseType())})},evaluate(){try{let e=this.expression.evaluate();return ds.isNullValue(e)?(console.log("[Random] value:",null),this.setValue(ds.nullValue()),this.getValue()):(ds.shuffleArray(e),console.log("[Random] value:",e),this.setValue(e[0]),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.nae==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},o_={class:"qti-random"};function l_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",o_,[l.renderSlot(e.$slots,"default")])}const u_=te(a_,[["render",l_]]),xc=new re,mo=new me,c_={name:"QtiMultiple",data(){return{value:null,valueBaseType:null,valueCardinality:"multiple",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return mo.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){this.$slots.default&&this.$slots.default().forEach(e=>{if(xc.isValidSlot(e)&&!mo.isExpressionNode(xc.kebabCase(e.type.name)))throw new h('Node is not an Expression: "'+e.type.name+'"')})},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){let t=null;e.forEach(i=>{if(i.component===null)return;const n=i.component.proxy,s=n.getCardinality();if(s!=="single"&&s!=="multiple")throw new h('Expressions must be of cardinality="single" or cardinality="multiple"');if(t===null)t=n.getBaseType();else if(t!==n.getBaseType())throw new h('Expressions not all the same base-type: "'+t+'"')}),this.setBaseType(t)},evaluate(){try{let e=[];for(let t=0;t<this.expressions.length;t++){let i=this.expressions[t].evaluate(),n=this.expressions[t].getCardinality();if(n==="single")i!==null&&e.push(i);else if((n==="multiple"||n==="ordered")&&i!==null)for(let s=0;s<i.length;s++)i[s]!==null&&e.push(i[s])}return e.length===0?this.setValue(mo.nullValue()):this.setValue(e),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},h_={class:"qti-multiple"};function d_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",h_,[l.renderSlot(e.$slots,"default")])}const f_=te(c_,[["render",d_]]),Ic=new re,go=new me,p_={name:"QtiOrdered",data(){return{value:null,valueBaseType:null,valueCardinality:"ordered",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return go.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){this.$slots.default&&this.$slots.default().forEach(e=>{if(Ic.isValidSlot(e)&&!go.isExpressionNode(Ic.kebabCase(e.type.name)))throw new h('Node is not an Expression: "'+e.type.name+'"')})},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){let t=null;e.forEach(i=>{if(i.component===null)return;const n=i.component.proxy,s=n.getCardinality();if(s!=="single"&&s!=="ordered")throw new h('Expressions must be of cardinality="single" or cardinality="ordered"');if(t===null)t=n.getBaseType();else if(t!==n.getBaseType())throw new h('Expressions not all the same base-type: "'+t+'"')}),this.setBaseType(t)},evaluate(){try{let e=[];for(let t=0;t<this.expressions.length;t++){let i=this.expressions[t].evaluate(),n=this.expressions[t].getCardinality();if(n==="single")i!==null&&e.push(i);else if(n==="ordered"&&i!==null)for(let s=0;s<i.length;s++)i[s]!==null&&e.push(i[s])}return e.length===0?this.setValue(go.nullValue()):this.setValue(e),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},m_={class:"qti-ordered"};function g_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",m_,[l.renderSlot(e.$slots,"default")])}const y_=te(p_,[["render",g_]]),an=new re,on=new me,v_={name:"QtiEqual",props:{toleranceMode:{type:String,required:!1,default:"exact"},tolerance:{type:String,required:!1},includeLowerBound:{type:String,required:!1,default:"true"},includeUpperBound:{type:String,required:!1,default:"true"}},data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",tolerances:[],expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return on.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},isEqualExact(e,t){return e.comparedTo(t)===0},isEqualAbsolute(e,t,i,n,s,r){const a=e.minus(i);if(s&&t.comparedTo(a)<0||!s&&t.comparedTo(a)<=0)return!1;const c=e.plus(n);return!(r&&t.comparedTo(c)>0||!r&&t.comparedTo(c)>=0)},isEqualRelative(e,t,i,n,s,r){const a=e.multipliedBy(ce(1).minus(i.dividedBy(ce(100))));if(s&&t.comparedTo(a)<0||!s&&t.comparedTo(a)<=0)return!1;const c=e.multipliedBy(ce(1).plus(n.dividedBy(ce(100))));return!(r&&t.comparedTo(c)>0||!r&&t.comparedTo(c)>=0)},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(an.isValidSlot(t))if(on.isExpressionNode(an.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(!on.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type")})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return on.isNullValue(e)||on.isNullValue(t)?(this.setValue(on.nullValue()),console.log("[Equal][Exp1][Exp2][Value]",e===null?null:e.valueOf(),t===null?null:t.valueOf(),this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),this.toleranceMode==="exact"?this.setValue(this.isEqualExact(e,t)):this.toleranceMode==="absolute"?this.setValue(this.isEqualAbsolute(e,t,this.tolerances[0],this.tolerances[1],this.includeLowerBound==="true",this.includeUpperBound==="true")):this.toleranceMode==="relative"&&this.setValue(this.isEqualRelative(e,t,this.tolerances[0],this.tolerances[1],this.includeLowerBound==="true",this.includeUpperBound==="true")),console.log("[Equal][Exp1][Exp2][Value]",e.valueOf(),t.valueOf(),this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{if(an.validateToleranceModeAttribute(this.toleranceMode),this.toleranceMode==="absolute"||this.toleranceMode==="relative"){if(typeof this.tolerance>"u")throw new h('Undefined tolerance attribute. "tolerance" must be defined when tolerance-mode is "absolute" or "relative".');if(this.tolerances=an.validateToleranceAttribute(this.tolerance),this.tolerances.length===0)throw new h('Invalid tolerance attribute: "'+this.tolerance+'" Must contain at least one value when tolerance-mode is "absolute" or "relative".')}an.validateIncludeBoundary(this.includeLowerBound,"include-lower-bound"),an.validateIncludeBoundary(this.includeUpperBound,"include-upper-bound"),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},w_={class:"qti-equal"};function b_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",w_,[l.renderSlot(e.$slots,"default")])}const E_=te(v_,[["render",b_]]),Vr=new re,ai=new me,S_={name:"QtiEqualRounded",props:{roundingMode:{type:String,required:!0},figures:{type:String,required:!0}},data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],valueFigures:null,isFiguresIdentifier:!1,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return ai.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},isEqualExact(e,t){return e.comparedTo(t)===0},roundValue(e){switch(this.roundingMode){case"decimalPlaces":return e.decimalPlaces(this.valueFigures,ce.ROUND_HALF_UP).toNumber();case"significantFigures":return e.precision(this.valueFigures,ce.ROUND_HALF_UP).toNumber()}return null},validateAttributes(){if(Vr.validateRoundingModeAttribute(this.roundingMode),this.valueFigures=Vr.validateIntegerAttribute("figures",this.figures,!0,1),this.valueFigures!==null&&this.valueFigures<1)throw new h('Attribute "figures" must be positive');this.isFiguresIdentifier=typeof this.valueFigures=="string"},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Vr.isValidSlot(t))if(ai.isExpressionNode(Vr.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(!ai.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type");if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"')})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return ai.isNullValue(e)||ai.isNullValue(t)?(this.setValue(ai.nullValue()),console.log("[EqualRounded][Exp1][Exp2][Value]",e===null?null:e.valueOf(),t===null?null:t.valueOf(),this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),e=this.roundValue(e),t=this.roundValue(t),ai.isNullValue(e)||ai.isNullValue(t)?(this.setValue(ai.nullValue()),console.log("[EqualRounded][Exp1][Exp2][Value]",e===null?null:e.valueOf(),t===null?null:t.valueOf(),this.getValue()),this.getValue()):(this.setValue(this.isEqualExact(new ce(e),new ce(t))),console.log("[EqualRounded][Exp1][Exp2][Value]",e.valueOf(),t.valueOf(),this.getValue()),this.getValue()))}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateAttributes(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},T_={class:"qti-equal"};function C_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",T_,[l.renderSlot(e.$slots,"default")])}const __=te(S_,[["render",C_]]),Ar=new re,fs=new me,x_={name:"QtiFieldValue",props:{fieldIdentifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:"single",expression:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return fs.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(Ar.isValidSlot(t))if(fs.isExpressionNode(Ar.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="record")throw new h('Expression must be of cardinality="record"');this.setBaseType(this.processFieldBaseType(i,t.type.name))})},processFieldBaseType(e,t){switch(t){case"QtiVariable":case"QtiCorrect":case"QtiDefault":return this.getFieldBaseTypeFromRecordVariable(e.$props.identifier);default:return null}},getFieldBaseTypeFromRecordVariable(e){let t;try{t=Ar.validateVariableIdentifierAttribute(W,e)}catch{return null}if(t.cardinality!=="record")return null;if(t.defaultValue!==null){const i=t.defaultValue.get(this.fieldIdentifier);return typeof i<"u"?i.getBaseType():null}try{t=Ar.validateResponseIdentifierAttribute(W,e)}catch{return null}if(t.correctResponse!==null){const i=t.correctResponse.get(this.fieldIdentifier);return typeof i<"u"?i.getBaseType():null}return null},evaluate(){try{const e=this.expression.evaluate();if(this.expression.getCardinality()!=="record")throw new ee('qti-field-value expression is not cardinality="record"');if(fs.isNullValue(e))return console.log("[FieldValue]["+this.fieldIdentifier+"]",null),this.setValue(fs.nullValue()),this.getValue();let t=e.get(this.fieldIdentifier);return typeof t>"u"?(console.log("[FieldValue]["+this.fieldIdentifier+"]",null),this.setValue(fs.nullValue()),this.getValue()):(this.setValue(t.getValue()),console.log("[FieldValue]["+this.fieldIdentifier+"]",this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.nae==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},I_={class:"qti-field-value"};function V_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",I_,[l.renderSlot(e.$slots,"default")])}const A_=te(x_,[["render",V_]]),Vc=new re,yo=new me,k_={name:"QtiRandomFloat",props:{min:{type:String,required:!1,default:"0"},max:{type:String,required:!0}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueMin:null,valueMax:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return yo.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateAttributes(){if(this.valueMin=Vc.validateFloatAttribute("min",this.min,!1,0),this.valueMax=Vc.validateFloatAttribute("max",this.max,!0,null),this.valueMin!==null&&this.valueMax!==null&&this.valueMax<this.valueMin)throw new h('Attribute "max" cannot be less than Attribute "min"')},validateChildren(){},evaluate(){try{let e=[],t=this.valueMin;for(;t<=this.valueMax;)e.push(t);return e.length===0?this.setValue(yo.nullValue()):(yo.shuffleArray(e),this.setValue(e[0])),console.log("[RandomFloat][Value]",this.getValue()),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateAttributes()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},O_={class:"qti-random-float"};function L_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",O_)}const R_=te(k_,[["render",L_]]),vo=new re,wo=new me,M_={name:"QtiRandomInteger",props:{min:{type:String,required:!1,default:"0"},max:{type:String,required:!0},step:{type:String,required:!1,default:"1"}},data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",valueMin:null,valueMax:null,valueStep:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return wo.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateAttributes(){if(this.valueMin=vo.validateIntegerAttribute("min",this.min,!1,0),this.valueMax=vo.validateIntegerAttribute("max",this.max,!0,null),this.valueStep=vo.validateIntegerAttribute("step",this.step,!1,1),this.valueMin!==null&&this.valueMax!==null&&this.valueMax<this.valueMin)throw new h('Attribute "max" cannot be less than Attribute "min"');if(this.valueStep!==null&&this.valueStep<1)throw new h('Attribute "step" must be positive')},validateChildren(){},evaluate(){try{let e=[],t=this.valueMin;for(;t<=this.valueMax;)e.push(t),t+=this.valueStep;return e.length===0?this.setValue(wo.nullValue()):(wo.shuffleArray(e),this.setValue(e[0])),console.log("[RandomInteger][Value]",this.getValue()),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateAttributes()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},$_={class:"qti-random-integer"};function N_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",$_)}const P_=te(M_,[["render",N_]]),Ac=new re,ln=new me,q_={name:"QtiIntegerDivide",data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return ln.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Ac.isValidSlot(t))if(ln.isExpressionNode(Ac.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(i.getBaseType()!=="integer")throw new h('Expressions must be base-type="integer"')})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return ln.isNullValue(e)||ln.isNullValue(t)?(this.setValue(ln.nullValue()),console.log("[IntegerDivide][Value]",this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),t.isZero()?(this.setValue(ln.nullValue()),console.log("[IntegerDivide][Value]",this.getValue()),this.getValue()):(this.setValue(e.dividedToIntegerBy(t).toNumber()),console.log("[IntegerDivide][Value]",this.getValue()),this.getValue()))}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},B_={class:"qti-integer-divide"};function D_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",B_,[l.renderSlot(e.$slots,"default")])}const Q_=te(q_,[["render",D_]]),kc=new re,un=new me,H_={name:"QtiIntegerModulus",data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return un.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(kc.isValidSlot(t))if(un.isExpressionNode(kc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(i.getBaseType()!=="integer")throw new h('Expressions must be base-type="integer"')})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return un.isNullValue(e)||un.isNullValue(t)?(this.setValue(un.nullValue()),console.log("[IntegerModulus][Value]",this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),t.isZero()?(this.setValue(un.nullValue()),console.log("[IntegerModulus][Value]",this.getValue()),this.getValue()):(this.setValue(e.modulo(t).toNumber()),console.log("[IntegerModulus][Value]",this.getValue()),this.getValue()))}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},F_={class:"qti-integer-modulus"};function U_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",F_,[l.renderSlot(e.$slots,"default")])}const G_=te(H_,[["render",U_]]),Oc=new re,ps=new me,j_={name:"QtiIntegerToFloat",data(){return{value:null,valueBaseType:"float",valueCardinality:"single",expression:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return ps.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(Oc.isValidSlot(t))if(ps.isExpressionNode(Oc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expression must be of cardinality="single"');if(i.getBaseType()!=="integer")throw new h('Expression must be base-type="integer"')})},evaluate(){try{let e=this.expression.evaluate();return ps.isNullValue(e)?(console.log("[IntegerToFloat][Value]",null),this.setValue(ps.nullValue()),this.getValue()):(e=new ce(e),e.isNaN()?(this.setValue(ps.nullValue()),console.log("[IntegerToFloat][Value]",this.getValue()),this.getValue()):(this.setValue(e.toNumber()),console.log("[IntegerToFloat][Value]",this.getValue()),this.getValue()))}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},W_={class:"qti-integer-to-float"};function z_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",W_,[l.renderSlot(e.$slots,"default")])}const K_=te(j_,[["render",z_]]),Lc=new re,Oi=new me,Y_={name:"QtiProduct",data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Oi.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(Lc.isValidSlot(t))if(Oi.isExpressionNode(Lc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("Must have at least one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(!Oi.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type");if(i.getBaseType()==="float"&&this.setBaseType("float"),i.getCardinality()!=="single"&&i.getCardinality()!=="multiple"&&i.getCardinality()!=="ordered")throw new h('Expressions must be of cardinality "single", "multiple", or "ordered"')})},evaluate(){try{let e="integer",t=new ce(1);for(let i=0;i<this.expressions.length;i++){let n=this.expressions[i].evaluate();if(Oi.isNullValue(n))return console.log("[Product]["+this.getBaseType()+"] value:",null),this.setValue(Oi.nullValue()),this.getValue();this.expressions[i].getBaseType()!=="integer"&&(e="float");let s=this.expressions[i].getCardinality();if(s==="single")t=t.times(n);else if(s==="multiple"||s==="ordered")for(let r=0;r<n.length;r++){if(Oi.isNullValue(n[r]))return console.log("[Product]["+this.getBaseType()+"] value:",null),this.setValue(Oi.nullValue()),this.getValue();t=t.times(n[r])}}if(e==="integer"){if(console.log("[Product][Integer] value:",t.toNumber()),!t.isInteger())throw new ee("Expressions did not produce an integer value");return this.setBaseType("integer"),this.setValue(t.toNumber()),this.getValue()}return console.log("[Product][Float] value:",t.toNumber()),this.setBaseType("float"),this.setValue(t.toNumber()),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},X_={class:"qti-product"};function Z_(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",X_,[l.renderSlot(e.$slots,"default")])}const J_=te(Y_,[["render",Z_]]),ms=new re,cn=new me,ex={name:"QtiIndex",props:{n:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:"single",expression:null,valueN:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return cn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateAttributes(){try{this.valueN=ms.validateIntegerAttribute("n",this.n,!0,0);return}catch(e){if(e.name!=="QtiParseException")throw new Error(e.message)}try{ms.validateIdentifierAttribute(this.n);const e=ms.validateTemplateOrOutcomeIdentifierAttribute(W,this.n);if(e.baseType!=="integer"||e.cardinality!=="single")throw new h('[Index] Attribute "n" template or outcome variable must be base-type="integer" and cardinality="single"')}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(ms.isValidSlot(t))if(cn.isExpressionNode(ms.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="ordered")throw new h('Expression must be of cardinality="ordered"');this.setBaseType(i.getBaseType())})},evaluate(){try{let e=this.expression.evaluate();this.setBaseType(this.expression.getBaseType());const t=this.getNValue();if(t===null||t<1)return console.log("[Index]["+t+"]",null),this.setValue(cn.nullValue()),this.getValue();if(cn.isNullValue(e))return console.log("[Index]["+t+"]",null),this.setValue(cn.nullValue()),this.getValue();if(e.length&&e.length<t)return console.log("[Index]["+t+"]",null),this.setValue(cn.nullValue()),this.getValue();const i=e[t-1];return console.log("[Index]["+t+"]",i),this.setValue(i),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.nae==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}},getNValue(){if(this.valueN!==null)return this.valueN;let e=W.getVariableDeclaration(this.n);return e!==null?e.value:0}},created(){try{this.validateAttributes(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},tx={class:"qti-index"};function ix(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",tx,[l.renderSlot(e.$slots,"default")])}const nx=te(ex,[["render",ix]]),Rc=new re,pi=new me,sx={name:"QtiMember",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return pi.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Rc.isValidSlot(t))if(pi.isExpressionNode(Rc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){let t=!0,i=null;e.forEach(n=>{if(n.component===null)return;const s=n.component.proxy;if(t){if(t=!1,i=s,s.getCardinality()!=="single")throw new h('First expression must be cardinality="single"');if(s.getBaseType()==="duration")throw new h('First expression of base-type="duration" not permitted')}else{if(i.getBaseType()!==s.getBaseType())throw new h("Expressions must be of same base-type");if(s.getCardinality()!=="multiple"&&s.getCardinality()!=="ordered")throw new h('Second expression must be cardinality="multiple" or cardinality="ordered"');if(s.getBaseType()==="duration")throw new h('Second expression of base-type="duration" not permitted')}})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();if(pi.isNullValue(e)||pi.isNullValue(t))return console.log("[Member]",pi.nullValue()),this.setValue(pi.nullValue()),this.getValue();let i=this.expressions[0].getBaseType();console.log("[Member][Exp1][Exp2]",e,t);for(let n=0;n<t.length;n++)if(!pi.isNullValue(t[n])&&pi.isSingleValuesMatch(i,e,t[n]))return console.log("[Member]",!0),this.setValue(!0),this.getValue();return console.log("[Member]",!1),this.setValue(!1),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},rx={class:"qti-member"};function ax(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",rx,[l.renderSlot(e.$slots,"default")])}const ox=te(sx,[["render",ax]]),Mc=new re,Kt=new me,lx={name:"QtiDelete",data(){return{value:null,valueBaseType:null,valueCardinality:null,expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Kt.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("[Delete] Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Mc.isValidSlot(t))if(Kt.isExpressionNode(Mc.kebabCase(t.type.name)))e+=1;else throw new h('[Delete] Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("[Delete] Must have two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){let t=!0,i=null;e.forEach(n=>{if(n.component===null)return;const s=n.component.proxy;if(t){if(t=!1,i=s,s.getCardinality()!=="single")throw new h('[Delete] First expression must be cardinality="single"');if(s.getBaseType()==="duration")throw new h('[Delete] First expression of base-type="duration" not permitted');this.setBaseType(s.getBaseType())}else{if(i.getBaseType()!==s.getBaseType())throw new h("[Delete] Expressions must be of same base-type");if(s.getCardinality()!=="multiple"&&s.getCardinality()!=="ordered")throw new h('[Delete] Second expression must be cardinality="multiple" or cardinality="ordered"');if(s.getBaseType()==="duration")throw new h('[Delete] Second expression of base-type="duration" not permitted');this.setCardinality(s.getCardinality())}})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();if(Kt.isNullValue(e)||Kt.isNullValue(t))return console.log("[Delete][Value]",Kt.nullValue()),this.setValue(Kt.nullValue()),this.getValue();let i=this.expressions[0].getBaseType(),n=[];for(let s=0;s<t.length;s++)Kt.isNullValue(t[s])||Kt.isSingleValuesMatch(i,e,t[s])||n.push(t[s]);return n.length===0?(console.log("[Delete][Value]",Kt.nullValue()),this.setValue(Kt.nullValue()),this.getValue()):(console.log("[Delete][Value]",n),this.setValue(n),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},ux={class:"qti-delete"};function cx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",ux,[l.renderSlot(e.$slots,"default")])}const hx=te(lx,[["render",cx]]),bo=new re,gs=new me,dx={name:"QtiSubstring",props:{caseSensitive:{type:String,required:!0}},data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],valueCaseSensitive:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return gs.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateAttributes(){this.valueCaseSensitive=bo.validateCaseSensitive(this.caseSensitive,!0)},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(bo.isValidSlot(t))if(gs.isExpressionNode(bo.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(i.getBaseType()!=="string")throw new h("Expressions must be a string base-type")})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return gs.isNullValue(e)||gs.isNullValue(t)?(this.setValue(gs.nullValue()),console.log("[Substring][Exp1][Exp2][Value]",e.valueOf(),t.valueOf(),this.getValue()),this.getValue()):(this.valueCaseSensitive||(e=e.toLowerCase(),t=t.toLowerCase()),this.setValue(t.indexOf(e)!=-1),console.log("[Substring][Exp1][Exp2][Value]",e,t,this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateAttributes(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},fx={class:"qti-substring"};function px(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",fx,[l.renderSlot(e.$slots,"default")])}const mx=te(dx,[["render",px]]),Eo=new re,hn=new me,gx={name:"QtiStringMatch",props:{caseSensitive:{type:String,required:!0}},data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],valueCaseSensitive:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return hn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateAttributes(){this.valueCaseSensitive=Eo.validateCaseSensitive(this.caseSensitive,!0)},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Eo.isValidSlot(t))if(hn.isExpressionNode(Eo.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(i.getBaseType()!=="string")throw new h("Expressions must be a string base-type")})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return hn.isNullValue(e)||hn.isNullValue(t)?(this.setValue(hn.nullValue()),console.log("[StringMatch][Exp1][Exp2][Value]",e.valueOf(),t.valueOf(),this.getValue()),this.getValue()):(this.valueCaseSensitive||(e=e.toLowerCase(),t=t.toLowerCase()),this.setValue(hn.isSingleValuesMatch("string",e,t)),console.log("[StringMatch][Exp1][Exp2][Value]",e,t,this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateAttributes(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},yx={class:"qti-string-match"};function vx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",yx,[l.renderSlot(e.$slots,"default")])}const wx=te(gx,[["render",vx]]),ys=new re,kr=new me,bx={name:"QtiPatternMatch",props:{pattern:{required:!1,type:String}},data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expression:null,appliedRegex:null,isPatternIdentifier:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return kr.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateAttributes(){let e;try{e=ys.validateVariableIdentifierAttribute(W,this.pattern),this.isPatternIdentifier=!0}catch(t){if(t.name==="QtiValidationException")this.isPatternIdentifier=!1;else throw new Error(t.message)}if(this.isPatternIdentifier){if(e.baseType==="string"&&e.cardinality==="single")return;throw new h('Invalid "pattern" attribute. The referenced variable must be of base-type "string" and cardinality "single"')}this.appliedRegex=ys.validatePattern("pattern",this.pattern)},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(ys.isValidSlot(t))if(kr.isExpressionNode(ys.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expression must be of cardinality="single"');if(i.getBaseType()!=="string")throw new h("Expression must be a string base-type")})},evaluate(){try{let e=this.expression.evaluate();const t=this.getRegex();return kr.isNullValue(e)||t===null?(this.setValue(kr.nullValue()),console.log("[PatternMatch][Pattern][Exp][Value]",t,e,this.getValue()),this.getValue()):(this.setValue(t.test(e)),console.log("[PatternMatch][Pattern][Exp][Value]",t,e,this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}},getRegex(){if(this.isPatternIdentifier){let e=W.getVariableDeclaration(this.pattern);return ys.validatePattern("pattern",e.value)}return this.appliedRegex}},created(){try{this.validateAttributes(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Ex={class:"qti-pattern-match"};function Sx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Ex,[l.renderSlot(e.$slots,"default")])}const Tx=te(bx,[["render",Sx]]),$c=new re,dn=new me,Cx={name:"QtiRound",data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",expression:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return dn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if($c.isValidSlot(t))if(dn.isExpressionNode($c.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expression must be of cardinality="single"');if(!dn.isBaseTypeNumeric(i.getBaseType()))throw new h("Expression must be a numeric base-type")})},evaluate(){try{let e=this.expression.evaluate();return dn.isNullValue(e)?(console.log("[Round][Value]",null),this.setValue(dn.nullValue()),this.getValue()):(e=new ce(e),e.isNaN()?(this.setValue(dn.nullValue()),console.log("[Round][Value]",this.getValue()),this.getValue()):e.toNumber()==1/0?(this.setValue(1/0),console.log("[Round][Value]",this.getValue()),this.getValue()):e.toNumber()==-1/0?(this.setValue(1/0),console.log("[Round][Value]",this.getValue()),this.getValue()):(this.setValue(e.integerValue(ce.ROUND_HALF_CEIL).toNumber()),console.log("[Round][Value]",this.getValue()),this.getValue()))}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},_x={class:"qti-round"};function xx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",_x,[l.renderSlot(e.$slots,"default")])}const Ix=te(Cx,[["render",xx]]),Or=new re,vs=new me,Vx={name:"QtiRoundTo",props:{roundingMode:{type:String,required:!0},figures:{type:String,required:!0}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",expression:null,valueFigures:null,isFiguresIdentifier:!1,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return vs.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateAttributes(){if(Or.validateRoundingModeAttribute(this.roundingMode),this.valueFigures=Or.validateIntegerAttribute("figures",this.figures,!0,1),this.valueFigures!==null&&this.valueFigures<1)throw new h('Attribute "figures" must be positive');this.isFiguresIdentifier=typeof this.valueFigures=="string"},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(Or.isValidSlot(t))if(vs.isExpressionNode(Or.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expression must be of cardinality="single"');if(!vs.isBaseTypeNumeric(i.getBaseType()))throw new h("Expression must be a numeric base-type")})},evaluate(){try{let e=this.expression.evaluate();if(vs.isNullValue(e))return console.log("[RoundTo][Value]",null),this.setValue(vs.nullValue()),this.getValue();let t=new ce(e);switch(this.roundingMode){case"decimalPlaces":this.setValue(t.decimalPlaces(this.valueFigures,ce.ROUND_HALF_UP).toNumber());break;case"significantFigures":this.setValue(t.precision(this.valueFigures,ce.ROUND_HALF_UP).toNumber());break;default:throw new ee('Unexpected rounding mode: "'+this.roundingMode+'"')}return console.log("[RoundTo][Value]",this.getValue()),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateAttributes(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Ax={class:"qti-round-to"};function kx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Ax,[l.renderSlot(e.$slots,"default")])}const Ox=te(Vx,[["render",kx]]),Nc=new re,fn=new me,Lx={name:"QtiTruncate",data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",expression:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return fn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(Nc.isValidSlot(t))if(fn.isExpressionNode(Nc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expression must be of cardinality="single"');if(!fn.isBaseTypeNumeric(i.getBaseType()))throw new h("Expression must be a numeric base-type")})},evaluate(){try{let e=this.expression.evaluate();return fn.isNullValue(e)?(console.log("[Truncate][Value]",null),this.setValue(fn.nullValue()),this.getValue()):(e=new ce(e),e.isNaN()?(this.setValue(fn.nullValue()),console.log("[Truncate][Value]",this.getValue()),this.getValue()):e.toNumber()==1/0?(this.setValue(1/0),console.log("[Truncate][Value]",this.getValue()),this.getValue()):e.toNumber()==-1/0?(this.setValue(1/0),console.log("[Truncate][Value]",this.getValue()),this.getValue()):(this.setValue(e.integerValue(ce.ROUND_DOWN).toNumber()),console.log("[Truncate][Value]",this.getValue()),this.getValue()))}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Rx={class:"qti-truncate"};function Mx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Rx,[l.renderSlot(e.$slots,"default")])}const $x=te(Lx,[["render",Mx]]),Pc=new re,Li=new me,Nx={name:"QtiDivide",data(){return{value:null,valueBaseType:"float",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Li.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Pc.isValidSlot(t))if(Li.isExpressionNode(Pc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(!Li.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type");if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"')})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return Li.isNullValue(e)||Li.isNullValue(t)?(this.setValue(Li.nullValue()),console.log("[Divide][Value]",this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),t.isZero()?(this.setValue(Li.nullValue()),console.log("[Divide][Value]",this.getValue()),this.getValue()):(this.setValue(e.dividedBy(t).toNumber()),console.log("[Divide][Value]",this.getValue()),this.getValue()))}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Px={class:"qti-divide"};function qx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Px,[l.renderSlot(e.$slots,"default")])}const Bx=te(Nx,[["render",qx]]),qc=new re,pn=new me,Dx={name:"QtiGt",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return pn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},isGreaterThan(e,t){return e.isGreaterThan(t)},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(qc.isValidSlot(t))if(pn.isExpressionNode(qc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(!pn.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type")})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return pn.isNullValue(e)||pn.isNullValue(t)?(this.setValue(pn.nullValue()),console.log("[GT][Exp1][Exp2][Value]",e===null?null:e.valueOf(),t===null?null:t.valueOf(),this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),this.setValue(this.isGreaterThan(e,t)),console.log("[GT][Exp1][Exp2][Value]",e.valueOf(),t.valueOf(),this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Qx={class:"qti-gt"};function Hx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Qx,[l.renderSlot(e.$slots,"default")])}const Fx=te(Dx,[["render",Hx]]),Bc=new re,mn=new me,Ux={name:"QtiGte",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return mn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},isGreaterThanOrEqualTo(e,t){return e.isGreaterThanOrEqualTo(t)},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Bc.isValidSlot(t))if(mn.isExpressionNode(Bc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(!mn.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type")})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return mn.isNullValue(e)||mn.isNullValue(t)?(this.setValue(mn.nullValue()),console.log("[GTE][Exp1][Exp2][Value]",e===null?null:e.valueOf(),t===null?null:t.valueOf(),this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),this.setValue(this.isGreaterThanOrEqualTo(e,t)),console.log("[GTE][Exp1][Exp2][Value]",e.valueOf(),t.valueOf(),this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Gx={class:"qti-gte"};function jx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Gx,[l.renderSlot(e.$slots,"default")])}const Wx=te(Ux,[["render",jx]]),Dc=new re,gn=new me,zx={name:"QtiLt",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return gn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},isLessThan(e,t){return e.isLessThan(t)},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Dc.isValidSlot(t))if(gn.isExpressionNode(Dc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(!gn.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type")})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return gn.isNullValue(e)||gn.isNullValue(t)?(this.setValue(gn.nullValue()),console.log("[LT][Exp1][Exp2][Value]",e===null?null:e.valueOf(),t===null?null:t.valueOf(),this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),this.setValue(this.isLessThan(e,t)),console.log("[LT][Exp1][Exp2][Value]",e.valueOf(),t.valueOf(),this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Kx={class:"qti-lt"};function Yx(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Kx,[l.renderSlot(e.$slots,"default")])}const Xx=te(zx,[["render",Yx]]),Qc=new re,yn=new me,Zx={name:"QtiLte",data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return yn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},isLessThanOrEqualTo(e,t){return e.isLessThanOrEqualTo(t)},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Qc.isValidSlot(t))if(yn.isExpressionNode(Qc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(!yn.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type")})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return yn.isNullValue(e)||yn.isNullValue(t)?(this.setValue(yn.nullValue()),console.log("[LTE][Exp1][Exp2][Value]",e===null?null:e.valueOf(),t===null?null:t.valueOf(),this.getValue()),this.getValue()):(e=new ce(e),t=new ce(t),this.setValue(this.isLessThanOrEqualTo(e,t)),console.log("[LTE][Exp1][Exp2][Value]",e.valueOf(),t.valueOf(),this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},Jx={class:"qti-lte"};function eI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",Jx,[l.renderSlot(e.$slots,"default")])}const tI=te(Zx,[["render",eI]]),Hc=new re,Ri=new me,iI={name:"QtiMax",data(){return{value:null,valueBaseType:null,valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Ri.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(Hc.isValidSlot(t))if(Ri.isExpressionNode(Hc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("Must have one or more Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){this.setBaseType("integer"),e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(!Ri.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type");if(i.getBaseType()==="float"&&this.setBaseType("float"),i.getCardinality()!=="single"&&i.getCardinality()!=="multiple"&&i.getCardinality()!=="ordered")throw new h('Expressions must be of cardinality "single", "multiple", or "ordered"')})},evaluate(){try{this.setBaseType("integer");let e=new ce(-1/0);for(let t=0;t<this.expressions.length;t++){let i=this.expressions[t].evaluate();if(Ri.isNullValue(i))return console.log("[Max]["+this.getBaseType()+"]",null),this.setValue(Ri.nullValue()),this.getValue();this.expressions[t].getBaseType()!=="integer"&&this.setBaseType("float");let n=this.expressions[t].getCardinality();if(n==="single")e=e.comparedTo(i)<0?new ce(i):e;else if(n==="multiple"||n==="ordered")for(let s=0;s<i.length;s++){if(Ri.isNullValue(i[s]))return console.log("[Max]["+this.getBaseType()+"]",null),this.setValue(Ri.nullValue()),this.getValue();e=e.comparedTo(i[s])<0?new ce(i[s]):e}}if(this.getBaseType()==="integer"){if(console.log("[Max][Integer]",e.toNumber()),!e.isInteger())throw new ee("Expressions did not produce an integer value");return this.setValue(e.toNumber()),this.getValue()}return console.log("[Max][Float]",e.toNumber()),this.setValue(e.toNumber()),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},nI={class:"qti-max"};function sI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",nI,[l.renderSlot(e.$slots,"default")])}const rI=te(iI,[["render",sI]]),Fc=new re,Mi=new me,aI={name:"QtiMin",data(){return{value:null,valueBaseType:null,valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Mi.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(Fc.isValidSlot(t))if(Mi.isExpressionNode(Fc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("Must have one or more Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){this.setBaseType("integer"),e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(!Mi.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type");if(i.getBaseType()==="float"&&this.setBaseType("float"),i.getCardinality()!=="single"&&i.getCardinality()!=="multiple"&&i.getCardinality()!=="ordered")throw new h('Expressions must be of cardinality "single", "multiple", or "ordered"')})},evaluate(){try{this.setBaseType("integer");let e=new ce(1/0);for(let t=0;t<this.expressions.length;t++){let i=this.expressions[t].evaluate();if(Mi.isNullValue(i))return console.log("[Min]["+this.getBaseType()+"]",null),this.setValue(Mi.nullValue()),this.getValue();this.expressions[t].getBaseType()!=="integer"&&this.setBaseType("float");let n=this.expressions[t].getCardinality();if(n==="single")e=e.comparedTo(i)>0?new ce(i):e;else if(n==="multiple"||n==="ordered")for(let s=0;s<i.length;s++){if(Mi.isNullValue(i[s]))return console.log("[Min]["+this.getBaseType()+"]",null),this.setValue(Mi.nullValue()),this.getValue();e=e.comparedTo(i[s])>0?new ce(i[s]):e}}if(this.getBaseType()==="integer"){if(console.log("[Min][Integer]",e.toNumber()),!e.isInteger())throw new ee("Expressions did not produce an integer value");return this.setValue(e.toNumber()),this.getValue()}return console.log("[Min][Float]",e.toNumber()),this.setValue(e.toNumber()),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},oI={class:"qti-min"};function lI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",oI,[l.renderSlot(e.$slots,"default")])}const uI=te(aI,[["render",lI]]),Uc=new re,ws=new me,cI={name:"MathStringToFloat",emits:["customOperatorReady"],data(){return{value:null,valueBaseType:"float",valueCardinality:"single",expression:null}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return ws.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.cardinality=e},validateChildren:function(){let e=0;if(this.$slots.default()[0].children.length===0)throw new h("Must have exactly one Expression node");if(this.$slots.default()[0].children[0].children.forEach(i=>{if(Uc.isValidSlot(i))if(ws.isExpressionNode(Uc.kebabCase(i.type.name)))e+=1;else throw new h('Node is not an Expression: "'+i.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children[0].children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expression must be of cardinality="single"');if(i.getBaseType()!=="string")throw new h('Expression must be base-type="string"')})},evaluate(){try{let e=this.expression.evaluate();return ws.isNullValue(e)?(console.log("[math.StringToFloat][Value]",null),this.setValue(ws.nullValue()),this.getValue()):(e=new ce(e),e.isNaN()?(console.log("[math.StringToFloat][Value]",null),this.setValue(ws.nullValue()),this.getValue()):(this.setValue(e.toNumber()),console.log("[math.StringToFloat][Value]",this.getValue()),this.getValue()))}catch(e){throw e.nae==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){try{this.processChildren(),this.$parent.$emit("customOperatorReady",{baseType:this.getBaseType(),cardinality:this.getCardinality(),evaluate:this.evaluate})}catch(e){throw new h(e.message)}}};function hI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",null,[l.renderSlot(e.$slots,"default")])}const dI=te(cI,[["render",hI]]),bs={MATH_STRINGTOFLOAT:"math.stringToFloat",AMP_MATH_STRINGTOFLOAT:"amp:math.stringToFloat",AMP_EE_ISEQUIVALENT:"amp:ee.isEquivalent"};function fI(e,t){switch(e){case bs.MATH_STRINGTOFLOAT:case bs.AMP_MATH_STRINGTOFLOAT:return{template:"<MathStringToFloat><slot/></MathStringToFloat>",components:{MathStringToFloat:dI}};case bs.AMP_EE_ISEQUIVALENT:return{template:'<MathEeIsEquivalent definition="'+t.definition+'"><slot></slot></MathEeIsEquivalent>',components:{}};default:return}}function pI(e){if(e===null||e.length==0)return null;const t=e.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case bs.MATH_STRINGTOFLOAT:case bs.AMP_MATH_STRINGTOFLOAT:return t[i]}return null}const So=new me,mI={name:"QtiCustomOperator",props:{definition:{type:String,required:!1,default:""}},data(){return{value:null,valueBaseType:null,valueCardinality:null,expression:null,operatorSubType:null,isQtiValid:!0}},computed:{customOperatorTemplate(){return fI(this.operatorSubType,this.$props)}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return So.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},detectOperatorSubType(e){return pI(e)},handleCustomOperatorReady(e){this.setBaseType(e.baseType),this.setCardinality(e.cardinality),this.expression=e},evaluate(){try{if(this.operatorSubType===null)return this.setValue(So.nullValue()),console.log("[CustomOperator][UNSUPORTED_CUSTOM_OPERATOR][Value]",this.getValue()),this.getValue();const e=this.expression!==null?this.expression.evaluate():So.nullValue();return this.setValue(e),console.log("[CustomOperator]["+this.operatorSubType+"][Value]",this.getValue()),this.getValue()}catch(e){throw e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{if(this.operatorSubType=this.detectOperatorSubType(this.$attrs.class),this.operatorSubType===null)throw new h("Unsupported Custom Operator ["+this.$attrs.class+"]")}catch(e){throw this.isQtiValid=!1,new h(e.message)}},mounted(){this.isQtiValid}},gI={class:"qti-custom-operator"};function yI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",gI,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.customOperatorTemplate),{onCustomOperatorReady:r.handleCustomOperatorReady},{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},40,["onCustomOperatorReady"]))])}const vI=te(mI,[["render",yI]]),To=new re,Qe=new me,wI={name:"QtiMathOperator",props:{name:{type:String,required:!0}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",expressions:[],hasTwoExpressions:!1,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Qe.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw this.hasTwoExpressions?new h("Must have two Expression nodes"):new h("Must have one Expression node");if(this.$slots.default().forEach(t=>{if(To.isValidSlot(t))if(Qe.isExpressionNode(To.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2&&this.hasTwoExpressions)throw new h("["+this.name+"] Must have exactly two Expression nodes");if(e!==1)throw new h("["+this.name+"] Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(!Qe.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type")})},evaluate(){try{let e=this.expressions[0].evaluate(),t;if(this.hasTwoExpressions&&(t=this.expressions[1].evaluate()),Qe.isNullValue(e)||this.hasTwoExpressions&&Qe.isNullValue(t))return this.setValue(Qe.nullValue()),console.log("[MathOperator]["+this.name+"][Value]",this.getValue()),this.getValue();switch(e=new ce(e),this.name){case"abs":if(e.isNaN()){this.setValue(Qe.nullValue());break}if(e.toNumber()==-1/0||e.toNumber()==1/0){this.setValue(1/0);break}this.setValue(e.absoluteValue().toNumber());break;case"acos":if(e.absoluteValue().isGreaterThan(1)){this.setValue(Qe.nullValue());break}this.setValue(Math.acos(e.toNumber()));break;case"acot":this.setValue(new ce(Math.PI/2).minus(Math.atan(1/e.toNumber())).toNumber());break;case"acsc":if(e.absoluteValue().isLessThan(1)){this.setValue(Qe.nullValue());break}this.setValue(new ce(Math.PI/2).minus(Math.asin(1/e.toNumber())).toNumber());break;case"asec":if(e.absoluteValue().isLessThan(1)){this.setValue(Qe.nullValue());break}this.setValue(new ce(Math.PI/2).minus(Math.acos(1/e.toNumber())).toNumber());break;case"asin":if(e.absoluteValue().isGreaterThan(1)){this.setValue(Qe.nullValue());break}if(e.isEqualTo(0)){this.setValue(e.toNumber());break}this.setValue(Math.asin(e.toNumber()));break;case"atan":if(e.isEqualTo(0)){this.setValue(e.toNumber());break}this.setValue(Math.atan(e.toNumber()));break;case"atan2":this.setValue(Math.atan2(e.toNumber(),new ce(t).toNumber()));break;case"ceil":if(e.isNaN()){this.setValue(Qe.nullValue());break}if(e.toNumber()==-1/0){this.setValue(-1/0);break}if(e.toNumber()==1/0){this.setValue(1/0);break}this.setValue(Math.ceil(e.toNumber()));break;case"cos":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(Math.cos(e.toNumber()));break;case"cosh":if(e.isEqualTo(0)){this.setValue(new ce(1).toNumber());break}if(e.toNumber()==-1/0){this.setValue(1/0);break}if(e.toNumber()==1/0){this.setValue(1/0);break}this.setValue(Math.cosh(e.toNumber()));break;case"cot":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(new ce(1).dividedBy(Math.tan(e.toNumber())).toNumber());break;case"coth":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(new ce(1).dividedBy(Math.tanh(e.toNumber())).toNumber());break;case"csc":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(new ce(1).dividedBy(Math.sin(e.toNumber())).toNumber());break;case"csch":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(new ce(1).dividedBy(Math.sinh(e.toNumber())).toNumber());break;case"exp":if(e.isNaN()){this.setValue(Qe.nullValue());break}if(e.toNumber()==-1/0){this.setValue(new ce(0).toNumber());break}if(e.toNumber()==1/0){this.setValue(1/0);break}this.setValue(Math.exp(e.toNumber()));break;case"floor":if(e.isNaN()){this.setValue(Qe.nullValue());break}if(e.toNumber()==-1/0){this.setValue(-1/0);break}if(e.toNumber()==1/0){this.setValue(1/0);break}this.setValue(Math.floor(e.toNumber()));break;case"ln":if(e.comparedTo(0)<0){this.setValue(Qe.nullValue());break}if(e.comparedTo(0)==0){this.setValue(-1/0);break}if(e.toNumber()==1/0){this.setValue(1/0);break}this.setValue(Math.log(e.toNumber()));break;case"log":if(e.comparedTo(0)<0){this.setValue(Qe.nullValue());break}if(e.comparedTo(0)==0){this.setValue(-1/0);break}if(e.toNumber()==1/0){this.setValue(1/0);break}this.setValue(Math.log10(e.toNumber()));break;case"sec":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(new ce(1).dividedBy(Math.cos(e.toNumber())).toNumber());break;case"sech":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(new ce(1).dividedBy(Math.cosh(e.toNumber())).toNumber());break;case"signum":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(Math.sign(e.toNumber()));break;case"sin":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(Math.sin(e.toNumber()));break;case"sinh":if(e.isNaN()){this.setValue(Qe.nullValue());break}if(e.toNumber()==1/0){this.setValue(1/0);break}if(e.toNumber()==-1/0){this.setValue(-1/0);break}if(e.isEqualTo(0)){this.setValue(e.toNumber());break}this.setValue(Math.sinh(e.toNumber()));break;case"tan":if(e.isNaN()){this.setValue(Qe.nullValue());break}this.setValue(Math.tan(e.toNumber()));break;case"tanh":if(e.isNaN()){this.setValue(Qe.nullValue());break}if(e.toNumber()==1/0){this.setValue(new ce(1).toNumber());break}if(e.toNumber()==-1/0){this.setValue(new ce(-1).toNumber());break}if(e.isEqualTo(-0)){this.setValue(e.toNumber());break}if(e.isEqualTo(0)){this.setValue(e.toNumber());break}this.setValue(Math.tanh(e.toNumber()));break;case"toDegrees":if(e.isNaN()){this.setValue(Qe.nullValue());break}if(e.toNumber()==1/0){this.setValue(1/0);break}if(e.toNumber()==-1/0){this.setValue(-1/0);break}this.setValue(e.multipliedBy(180/Math.PI));break;case"toRadians":if(e.isNaN()){this.setValue(Qe.nullValue());break}if(e.toNumber()==1/0){this.setValue(1/0);break}if(e.toNumber()==-1/0){this.setValue(-1/0);break}this.setValue(e.multipliedBy(Math.PI/180));break;default:throw new ee('Unsupported qti-math-operator "name" attribute: "'+name+'"')}return console.log("[MathOperator]["+this.name+"][Value]",this.getValue()),this.getValue()}catch(e){throw e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{switch(To.validateMathOperatorNameAttribute(this.name),this.name){case"signum":case"floor":case"ceil":this.setBaseType("integer"),this.hasTwoExpressions=!1;break;case"atan2":this.setBaseType("float"),this.hasTwoExpressions=!0;break;default:this.setBaseType("float"),this.hasTwoExpressions=!1}this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},bI={class:"qti-math-operator"};function EI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",bI,[l.renderSlot(e.$slots,"default")])}const SI=te(wI,[["render",EI]]),TI=new re,CI=new me,_I={name:"QtiMathConstant",props:{name:{type:String,required:!0}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return CI.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{switch(this.name){case"pi":this.setValue(new ce(Math.PI).toNumber());break;case"e":this.setValue(new ce(Math.E).toNumber());break;default:throw new ee('Unsupported qti-math-constant "name" attribute: "'+name+'"')}return console.log("[MathConstant]["+this.name+"][Value]",this.getValue()),this.getValue()}catch(e){throw e.nae==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{TI.validateMathConstantNameAttribute(this.name)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},xI={class:"qti-math-constant"};function II(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",xI)}const VI=te(_I,[["render",II]]),Es=new re,Lr=new me,AI={name:"QtiRepeat",props:{numberRepeats:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:"ordered",expressions:[],valueNumberRepeats:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Lr.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateAttributes(){try{this.valueNumberRepeats=Es.validateIntegerAttribute("number-repeats",this.numberRepeats,!0,0);return}catch(e){if(e.name!=="QtiParseException")throw new Error(e.message)}try{Es.validateIdentifierAttribute(this.numberRepeats);const e=Es.validateTemplateOrOutcomeIdentifierAttribute(W,this.numberRepeats);if(e.baseType!=="integer"||e.cardinality!=="single")throw new h('[Repeat] Attribute "number-repeats" template or outcome variable must be base-type="integer" and cardinality="single"')}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("[Repeat] Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(Es.isValidSlot(t))if(Lr.isExpressionNode(Es.kebabCase(t.type.name)))e+=1;else throw new h('[Repeat] Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("[Repeat] Must have at least one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){let t=null;e.forEach(i=>{if(i.component===null)return;const n=i.component.proxy,s=n.getCardinality();if(s!=="single"&&s!=="ordered")throw new h('[Repeat] Expressions must be of cardinality="single" or cardinality="ordered"');if(t===null)t=n.getBaseType();else if(t!==n.getBaseType())throw new h('[Repeat] Expressions not all the same base-type: "'+t+'"')}),this.setBaseType(t)},evaluate(){try{let e=[];const t=this.getNumberRepeatsValue();if(t<1)return console.log("[Repeat]["+t+"]",null),this.setValue(Lr.nullValue()),this.getValue();for(let i=0;i<t;i++)for(let n=0;n<this.expressions.length;n++){let s=this.expressions[n].evaluate(),r=this.expressions[n].getCardinality();if(r==="single")s!==null&&e.push(s);else if(r==="ordered"&&s!==null)for(let a=0;a<s.length;a++)s[a]!==null&&e.push(s[a])}return e.length===0?(console.log("[Repeat]["+t+"]",null),this.setValue(Lr.nullValue()),this.getValue()):(console.log("[Repeat]["+t+"]",e),this.setValue(e),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}},getNumberRepeatsValue(){if(this.valueNumberRepeats!==null)return this.valueNumberRepeats;let e=W.getVariableDeclaration(this.numberRepeats);return e!==null?e.value:0}},created(){try{this.validateAttributes(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},kI={class:"qti-repeat"};function OI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",kI,[l.renderSlot(e.$slots,"default")])}const LI=te(AI,[["render",OI]]),Co=new re,Ss=new me,RI={name:"QtiStatsOperator",props:{name:{type:String,required:!0}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",expression:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Ss.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have exactly one Expression node");if(this.$slots.default().forEach(t=>{if(Co.isValidSlot(t))if(Ss.isExpressionNode(Co.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==1)throw new h("Must have exactly one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&(this.expression=t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="multiple"&&i.getCardinality()!=="ordered")throw new h('Expression must be of cardinality="multiple" or cardinality="ordered"');if(!Ss.isBaseTypeNumeric(i.getBaseType()))throw new h("Expression must be a numeric base-type")})},computeMean(e){const t=e===null?0:e.length;if(t===0)return new ce(0).toNumber();let i=new ce(0);for(let n=0;n<t;n++)i=i.plus(e[n]);return i.dividedBy(t).toNumber()},computeSampleMean(e){const t=e===null?0:e.length;if(t===0)return new ce(0).toNumber();let i=new ce(0);for(let n=0;n<t;n++)i=i.plus(e[n]);return i.dividedBy(t>1?t-1:1).toNumber()},computePopulationStandardDeviation(e){const t=this.computeMean(e),i=this.computeSquareDifferences(e,t),n=this.computeMean(i);return new ce(n).squareRoot().toNumber()},computeSampleStandardDeviation(e){const t=this.computeMean(e),i=this.computeSquareDifferences(e,t),n=this.computeSampleMean(i);return new ce(n).squareRoot().toNumber()},computePopulationVariance(e){const t=this.computeMean(e),i=this.computeSquareDifferences(e,t),n=this.computeMean(i);return new ce(n).toNumber()},computeSampleVariance(e){const t=this.computeMean(e),i=this.computeSquareDifferences(e,t),n=this.computeSampleMean(i);return new ce(n).toNumber()},computeSquareDifferences(e,t){const i=e===null?0:e.length;let n=[];for(let s=0;s<i;s++){let r=new ce(e[s]).minus(t);n.push(r.multipliedBy(r).toNumber())}return n},evaluate(){try{let e=this.expression.evaluate();if(Ss.isNullValue(e))return this.setValue(Ss.nullValue()),console.log("[StatsOperator]["+this.name+"][Value]",this.getValue()),this.getValue();switch(this.name){case"mean":this.setValue(this.computeMean(e));break;case"sampleVariance":this.setValue(this.computeSampleVariance(e));break;case"popVariance":this.setValue(this.computePopulationVariance(e));break;case"sampleSD":this.setValue(this.computeSampleStandardDeviation(e));break;case"popSD":this.setValue(this.computePopulationStandardDeviation(e));break;default:throw new ee('Unsupported qti-stats-operator "name" attribute: "'+name+'"')}return console.log("[StatsOperator]["+this.name+"][Value]",this.getValue()),this.getValue()}catch(e){throw e.nae==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{Co.validateStatsOperatorNameAttribute(this.name),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},MI={class:"qti-stats-operator"};function $I(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",MI,[l.renderSlot(e.$slots,"default")])}const NI=te(RI,[["render",$I]]),Gc=new re,Ts=new me,PI={name:"QtiGcd",data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Ts.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(Gc.isValidSlot(t))if(Ts.isExpressionNode(Gc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("Must have at least one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getBaseType()!=="integer")throw new h('Expressions must be base-type="integer"');if(i.getCardinality()!=="single"&&i.getCardinality()!=="multiple"&&i.getCardinality()!=="ordered")throw new h('Expressions must be of cardinality "single", "multiple", or "ordered"')})},evaluate(){try{let e=[];for(let i=0;i<this.expressions.length;i++){const n=this.expressions[i].evaluate();if(Ts.isNullValue(n))return console.log("[Gcd]",null),this.setValue(Ts.nullValue()),this.getValue();const s=this.expressions[i].getCardinality();if(s==="single")e.push(n);else if(s==="multiple"||s==="ordered")for(let r=0;r<n.length;r++)e.push(n[r])}const t=Ts.generalizedGcd(e.length,e);return console.log("[Gcd][container]",t,e),this.setValue(t),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):e.name==="QtiExitProcessingException"?new Et(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},qI={class:"qti-gcd"};function BI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",qI,[l.renderSlot(e.$slots,"default")])}const DI=te(PI,[["render",BI]]),jc=new re,Cs=new me,QI={name:"QtiLcm",data(){return{value:null,valueBaseType:"integer",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Cs.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(jc.isValidSlot(t))if(Cs.isExpressionNode(jc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("Must have at least one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getBaseType()!=="integer")throw new h('Expressions must be base-type="integer"');if(i.getCardinality()!=="single"&&i.getCardinality()!=="multiple"&&i.getCardinality()!=="ordered")throw new h('Expressions must be of cardinality "single", "multiple", or "ordered"')})},evaluate(){try{let e=[];for(let i=0;i<this.expressions.length;i++){const n=this.expressions[i].evaluate();if(Cs.isNullValue(n))return console.log("[Lcm]",null),this.setValue(Cs.nullValue()),this.getValue();const s=this.expressions[i].getCardinality();if(s==="single")e.push(n);else if(s==="multiple"||s==="ordered")for(let r=0;r<n.length;r++)e.push(n[r])}const t=Cs.generalizedLcm(e.length,e);return console.log("[Lcm][container]",t,e),this.setValue(t),this.getValue()}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},HI={class:"qti-lcm"};function FI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",HI,[l.renderSlot(e.$slots,"default")])}const UI=te(QI,[["render",FI]]),Wc=new re,vn=new me,GI={name:"QtiPower",data(){return{value:null,valueBaseType:"float",valueCardinality:"single",expressions:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return vn.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have two Expression nodes");if(this.$slots.default().forEach(t=>{if(Wc.isValidSlot(t))if(vn.isExpressionNode(Wc.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e!==2)throw new h("Must have exactly two Expression nodes")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(!vn.isBaseTypeNumeric(i.getBaseType()))throw new h("Expressions must be a numeric base-type")})},evaluate(){try{let e=this.expressions[0].evaluate(),t=this.expressions[1].evaluate();return vn.isNullValue(e)||vn.isNullValue(t)?(this.setValue(vn.nullValue()),console.log("[Power][Value]",this.getValue()),this.getValue()):(this.setValue(Math.pow(e,t)),console.log("[Power][Value]",this.getValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},jI={class:"qti-power"};function WI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",jI,[l.renderSlot(e.$slots,"default")])}const zI=te(GI,[["render",WI]]),Rr=new re,Mr=new me,KI={name:"QtiAnyN",props:{min:{type:String,required:!0},max:{type:String,required:!0}},data(){return{value:null,valueBaseType:"boolean",valueCardinality:"single",expressions:[],valueMin:null,isMinIdentifier:!1,valueMax:null,isMaxIdentifier:!1,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return Mr.isNullValue(this.value)},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},validateMinMaxAttribute(e,t){let i,n=!1;try{i=Rr.validateVariableIdentifierAttribute(W,t),n=!0}catch(r){if(r.name!=="QtiValidationException")throw new Error(r.message)}if(n){if(i.baseType!=="integer"||i.cardinality!=="single")throw new h('Invalid "'+e+'" attribute. The referenced variable must be of base-type "integer" and cardinality "single"');if(e==="min"){this.isMinIdentifier=!0;return}if(e==="max"){this.isMaxIdentifier=!0;return}}let s=Rr.validatePositiveIntegerAttribute(e,t,!0);if(e==="min"){this.valueMin=s;return}if(e==="max"){this.valueMax=s;return}},validateAttributes(){if(this.validateMinMaxAttribute("min",this.min),this.validateMinMaxAttribute("max",this.max),!this.isMinIdentifier&&!this.isMaxIdentifier&&this.valueMax<this.valueMin)throw new h('Invalid "max" and "min" attributes. "max" ('+this.max+') must be greater than or equal to "min" ('+this.min+")")},validateChildren:function(){let e=0;if(!this.$slots.default)throw new h("Must have at least one Expression node");if(this.$slots.default().forEach(t=>{if(Rr.isValidSlot(t))if(Mr.isExpressionNode(Rr.kebabCase(t.type.name)))e+=1;else throw new h('Node is not an Expression: "'+t.type.name+'"')}),e===0)throw new h("Must have at least one Expression node")},processChildren(){const e=this.$.subTree.children[0].children;this.validateExpressions(e),e.forEach(t=>{t.component!==null&&this.expressions.push(t.component.proxy)})},validateExpressions(e){e.forEach(t=>{if(t.component===null)return;const i=t.component.proxy;if(i.getCardinality()!=="single")throw new h('Expressions must be cardinality="single"');if(i.getBaseType()!=="boolean")throw new h('Expressions must be base-type="boolean"')})},evaluate(){try{let e=0,t=0;for(let s=0;s<this.expressions.length;s++){let r=this.expressions[s].evaluate();Mr.isNullValue(r)?e+=1:r&&(t+=1)}const i=this.getMinValue();let n=this.getMaxValue();return n=n>0?n:0,i>n?(console.log("[AnyN] value:",!1),this.setValue(!1),this.getValue()):t>=i&&t+e<=n?(console.log("[AnyN] value:",!0),this.setValue(!0),this.getValue()):t+e<i||t>n?(console.log("[AnyN] value:",!1),this.setValue(!1),this.getValue()):(console.log("[AnyN] value:",null),this.setValue(Mr.nullValue()),this.getValue())}catch(e){throw e.name==="QtiValidationException"?new h(e.message):e.name==="QtiEvaluationException"?new ee(e.message):new Error(e.message)}},getMinValue(){if(this.valueMin!==null)return this.valueMin;let e=W.getVariableDeclaration(this.min);return e!==null?e.value:0},getMaxValue(){if(this.valueMax!==null)return this.valueMax;let e=W.getVariableDeclaration(this.max);return e!==null?e.value:0}},created(){try{this.validateAttributes(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new h(e.message):e.name==="QtiParseException"?new ge(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren()}catch(e){throw this.isQtiValid=!1,new h(e.message)}}},YI={class:"qti-anyn"};function XI(e,t,i,n,s,r){return l.openBlock(),l.createElementBlock("div",YI,[l.renderSlot(e.$slots,"default")])}const ZI=te(KI,[["render",XI]]),JI=new re,$r=new Uh,eV={name:"Qti3Player",components:{CatalogDialog:td},emits:["notifyQti3ItemReady","notifyQti3ItemCompleted","notifyQti3EndAttemptCompleted","notifyQti3SuspendAttemptCompleted","notifyQti3ScoreAttemptCompleted","notifyQti3ItemCatalogEvent","notifyQti3ItemAlertEvent","notifyQti3PlayerReady","itemNewTemplateCompleted"],props:{containerClass:{type:String,required:!1,default:"qti3-player-container-fluid"},containerPaddingClass:{type:String,required:!1,default:"qti3-player-container-padding-0"},colorClass:{type:String,required:!1,default:"qti3-player-color-default"},suppressAlertMessages:{type:Boolean,required:!1,default:!1},suppressInvalidResponseMessages:{type:Boolean,required:!1,default:!1},suppressCatalogMessages:{type:Boolean,required:!1,default:!1}},setup(e,t){const i=l.getCurrentInstance().appContext.app;i.component("qti-assessment-item",ef).component("qti-context-declaration",af).component("qti-response-declaration",hf).component("qti-outcome-declaration",mf).component("qti-template-declaration",bf).component("qti-template-processing",vT).component("qti-companion-materials-info",Wp).component("qti-stylesheet",Fp).component("qti-item-body",Hm).component("qti-catalog-info",ST).component("qti-response-processing",fT).component("qti-modal-feedback",ng),i.component("qti-default-value",Vm).component("qti-value",Pm).component("qti-correct-response",Lm).component("qti-mapping",Xp).component("qti-map-entry",im).component("qti-interpolation-table",cm).component("qti-interpolation-table-entry",mm).component("qti-match-table",wm).component("qti-match-table-entry",Cm).component("qti-area-mapping",am),i.component("qti-content-body",og).component("qti-template-inline",hg).component("qti-template-block",mg).component("qti-feedback-inline",wg).component("qti-feedback-block",Tg).component("qti-rubric-block",Vg).component("qti-printed-variable",qg).component("amp-style",id).component("amp-audio",_d).component("amp-video",Wd).component("qti-choice-interaction",Kg).component("qti-end-attempt-interaction",Cy).component("qti-extended-text-interaction",db).component("qti-text-entry-interaction",Lb).component("qti-inline-choice-interaction",sy).component("qti-match-interaction",qb).component("qti-gap-match-interaction",Ub).component("qti-graphic-gap-match-interaction",Yb).component("qti-order-interaction",cE).component("qti-hottext-interaction",gE).component("qti-hotspot-interaction",TE).component("qti-media-interaction",sE).component("qti-portable-custom-interaction",OE).component("qti-prompt",$E).component("qti-simple-choice",WE).component("ChoiceGroup",Al).component("qti-inline-choice",DE).component("MatchGroup",M0).component("qti-simple-match-set",c0).component("qti-simple-associable-choice",JE).component("qti-associable-hotspot",s0).component("GapMatchGroup",v0).component("GraphicGapMatchGroup",x0).component("MediaGroup",Su).component("OrderGroup",mS).component("qti-gap-text",bS).component("qti-gap-img",_S).component("qti-gap",AS).component("qti-hottext",MS).component("qti-hotspot-choice",BS).component("qti-interaction-modules",US).component("qti-interaction-module",zS).component("qti-interaction-markup",ZS).component("qti-template-variable",iT).component("qti-context-variable",aT),i.component("qti-catalog",xT).component("qti-card",kT).component("qti-card-entry",MT).component("qti-html-content",qT).component("qti-file-href",HT),i.component("qti-response-condition",WT),i.component("qti-response-processing-fragment",XT),i.component("qti-set-outcome-value",iC),i.component("qti-exit-response",aC),i.component("qti-lookup-outcome-value",cC),i.component("qti-response-if",pC),i.component("qti-response-else",vC),i.component("qti-response-else-if",SC),i.component("qti-set-template-value",IC),i.component("qti-template-condition",LC),i.component("qti-template-if",NC),i.component("qti-template-else",DC),i.component("qti-template-else-if",UC),i.component("qti-template-constraint",zC),i.component("qti-exit-template",ZC),i.component("qti-set-correct-response",n1),i.component("qti-set-default-value",l1),i.component("qti-base-value",m1),i.component("qti-correct",w1),i.component("qti-default",T1),i.component("qti-variable",I1),i.component("qti-match",O1),i.component("qti-map-response",$1),i.component("qti-is-null",B1),i.component("qti-and",F1),i.component("qti-or",W1),i.component("qti-not",X1),i.component("qti-subtract",t_),i.component("qti-sum",r_),i.component("qti-random",u_),i.component("qti-multiple",f_),i.component("qti-ordered",y_),i.component("qti-equal",E_),i.component("qti-equal-rounded",__),i.component("qti-field-value",A_),i.component("qti-random-float",R_),i.component("qti-random-integer",P_),i.component("qti-integer-divide",Q_),i.component("qti-integer-modulus",G_),i.component("qti-integer-to-float",K_),i.component("qti-product",J_),i.component("qti-index",nx),i.component("qti-member",ox),i.component("qti-delete",hx),i.component("qti-substring",mx),i.component("qti-string-match",wx),i.component("qti-pattern-match",Tx),i.component("qti-round",Ix),i.component("qti-round-to",Ox),i.component("qti-truncate",$x),i.component("qti-divide",Bx),i.component("qti-gt",Fx),i.component("qti-gte",Wx),i.component("qti-lt",Xx),i.component("qti-lte",tI),i.component("qti-max",rI),i.component("qti-min",uI),i.component("qti-custom-operator",vI),i.component("qti-math-operator",SI),i.component("qti-math-constant",VI),i.component("qti-repeat",LI),i.component("qti-stats-operator",NI),i.component("qti-gcd",DI),i.component("qti-lcm",UI),i.component("qti-power",zI),i.component("qti-any-n",ZI);const n=B();let s=l.ref(""),r=l.ref(null),a=l.ref(""),c=l.ref(""),y=l.ref("");a.value=e.containerClass,c.value=e.containerPaddingClass,y.value=e.colorClass;const w=l.ref(null),f=l.ref(null),g=l.computed(()=>{let L=s.value;return L=$r.filterXmlDeclaration(L),L=$r.filterCdata(L),L=$r.filterStyle(L),L=$r.filterMedia(L),{template:`<div id="${n}">${L}</div>`}});function p(L,X){console.log("[Qti3Player][LoadItemFromXml][configuration]",X),W.resetAll(),C(),W.initializeBuiltInDeclarations(),I(X),s.value=L}function d(L){console.log("[Qti3Player][EndAttempt]["+L+"]"),r.value.getEndAttempt(L)}function S(L){console.log("[Qti3Player][SuspendAttempt]["+L+"]"),r.value.getSuspendAttempt(L)}function b(L){console.log("[Qti3Player][ScoreAttempt]["+L+"]"),r.value.getScoreAttempt(L)}function _(){console.log("[Qti3Player][NewTemplate][Started]"),r.value.newTemplate()}function E(L){console.log("[Qti3Player][ItemReady]"),r.value=L.item,W.NotifyItemReady({item:L.item}),t.emit("notifyQti3ItemReady",L.item)}function m(){console.log("[Qti3Player][ItemCompleted]"),t.emit("notifyQti3ItemCompleted")}function A(L){j(L.state.validationMessages),t.emit("notifyQti3SuspendAttemptCompleted",L)}function u(L){j(L.state.validationMessages),t.emit("notifyQti3EndAttemptCompleted",L)}function O(L){t.emit("notifyQti3ScoreAttemptCompleted",L)}function P(L){G(L),t.emit("notifyQti3ItemCatalogEvent",L)}function q(){C()}function v(){console.log("[Qti3Player][NewTemplate][Completed]"),t.emit("itemNewTemplateCompleted")}function V(){console.log("[Qti3Player][BindCatalog]"),C(),r.value.bindCatalog()}function C(){w.value.reset()}function x(){return r}function I(L){typeof L>"u"||("guid"in L&&M(L.guid),"pnp"in L&&k(L.pnp),"sessionControl"in L&&N(L.sessionControl),"status"in L&&Q(L.status),"state"in L&&(D(L.state),W.restoreContextVariables()),"pciContext"in L&&W.setPciContext(L.pciContext))}function k(L){W.setItemContextPnp(L);const X=W.getItemContextPnp().getColorStyle();y.value!==X&&(y.value=X)}function N(L){W.setItemContextSessionControl(L)}function M(L){W.setItemContextGuid(L)}function D(L){W.setItemContextState(L)}function Q(L){W.setItemLifecycleStatus(L)}function H(L){e.suppressAlertMessages||Bo.fire({toast:!0,position:"top-end",icon:L.icon,html:L.message,showConfirmButton:!1,showCloseButton:!0,timer:3e3,timerProgressBar:!0}),t.emit("notifyQti3ItemAlertEvent",L)}function j(L){W.getItemContextSessionControl().getValidateResponses()&&!e.suppressInvalidResponseMessages&&L.forEach(X=>{Bo.fire({toast:!0,position:"top-end",icon:"error",html:X.message,showConfirmButton:!1,showCloseButton:!0,timer:3e3,timerProgressBar:!0})})}function G(L){e.suppressCatalogMessages||L.type==="glossary"&&(w.value.setContent(L),w.value.show())}function B(){return`item-container-${JI.randomString(5,"a")}`}function U(){l.nextTick(()=>{window.MathJax&&(window.MathJax.Hub.Config({messageStyle:"none",showProcessingMessages:!1,menuSettings:{inTabOrder:!1},tex2jax:{inlineMath:[["$$","$$"],["\\(","\\)"]],displayMath:[["\\[","\\]"]],preview:"none"}}),window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,"qti-item-container"]))})}return l.watch(s,()=>{U()}),W.initializeItemContextPnp(),W.initializeItemContextSessionControl(),W.initializePciMessageListener(),l.onBeforeUnmount(()=>{W.removePciMessageListener()}),{cssContainerClass:a,cssContainerPaddingClass:c,cssColorClass:y,processedXml:g,itemcomponent:f,catalogdialog:w,loadItemFromXml:p,endAttempt:d,suspendAttempt:S,scoreAttempt:b,newTemplate:_,getItem:x,handleItemReady:E,handleItemCompleted:m,handleSuspendAttemptReady:A,handleEndAttemptReady:u,handleScoreAttemptReady:O,handleCatalogEvent:P,handleNewTemplate:q,handleNewTemplateCompleted:v,displayAlertMessage:H,displayInvalidResponseMessages:j,displayCatalogEvent:G,bindCatalog:V}},mounted(){console.log("[Qti3Player][Ready]"),W.NotifyPlayerReady({player:this}),this.$emit("notifyQti3PlayerReady",this)}};function tV(e,t,i,n,s,r){const a=l.resolveComponent("catalog-dialog");return l.openBlock(),l.createElementBlock("div",{ref:"player",class:l.normalizeClass([n.cssContainerClass,n.cssContainerPaddingClass,n.cssColorClass])},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.processedXml),{ref:"itemcomponent",onItemReady:n.handleItemReady,onItemCompleted:n.handleItemCompleted,onItemSuspendAttemptReady:n.handleSuspendAttemptReady,onItemEndAttemptReady:n.handleEndAttemptReady,onItemScoreAttemptReady:n.handleScoreAttemptReady,onItemCatalogEvent:n.handleCatalogEvent,onItemNewTemplate:n.handleNewTemplate,onItemNewTemplateCompleted:n.handleNewTemplateCompleted},null,40,["onItemReady","onItemCompleted","onItemSuspendAttemptReady","onItemEndAttemptReady","onItemScoreAttemptReady","onItemCatalogEvent","onItemNewTemplate","onItemNewTemplateCompleted"])),l.createVNode(a,{ref:"catalogdialog"},null,512)],2)}const iV=te(eV,[["render",tV]]);return{install:e=>{e.component("Qti3Player",iV)}}});