1
0
Fork 0
mirror of synced 2024-09-28 07:21:35 +12:00

Revert sdk-generator to master

This commit is contained in:
Jake Barnby 2022-08-10 18:02:23 +12:00
parent 8d83b6ada3
commit 25e893f712
11 changed files with 201 additions and 183 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -77,7 +77,7 @@
],
"require-dev": {
"ext-fileinfo": "*",
"appwrite/sdk-generator": "dev-feat-permissions-classes as 0.19.5",
"appwrite/sdk-generator": "dev-master as 0.19.5",
"phpunit/phpunit": "9.5.20",
"squizlabs/php_codesniffer": "^3.6",
"swoole/ide-helper": "4.8.9",

35
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "cce1000b1dd3980df52e8b62db1478a3",
"content-hash": "1c445856ae9bb3cc261811ed64bc6b38",
"packages": [
{
"name": "adhocore/jwt",
@ -1733,22 +1733,22 @@
},
{
"name": "utopia-php/abuse",
"version": "0.7.0",
"version": "dev-refactor-permissions",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/abuse.git",
"reference": "52fb20e39e2e9619948bc0a73b52e10caa71350d"
"reference": "57b5454b37bba9ebf36fc7cbba49786e92a3a577"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/abuse/zipball/52fb20e39e2e9619948bc0a73b52e10caa71350d",
"reference": "52fb20e39e2e9619948bc0a73b52e10caa71350d",
"url": "https://api.github.com/repos/utopia-php/abuse/zipball/57b5454b37bba9ebf36fc7cbba49786e92a3a577",
"reference": "57b5454b37bba9ebf36fc7cbba49786e92a3a577",
"shasum": ""
},
"require": {
"ext-pdo": "*",
"php": ">=8.0",
"utopia-php/database": ">=0.11 <1.0"
"utopia-php/database": "dev-refactor-permissions"
},
"require-dev": {
"phpunit/phpunit": "^9.4",
@ -1780,9 +1780,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/abuse/issues",
"source": "https://github.com/utopia-php/abuse/tree/0.7.0"
"source": "https://github.com/utopia-php/abuse/tree/refactor-permissions"
},
"time": "2021-12-27T13:06:45+00:00"
"time": "2022-08-10T04:50:31+00:00"
},
{
"name": "utopia-php/analytics",
@ -2832,12 +2832,12 @@
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "1edf9354ec993831581872c695cf1ddc335e2e66"
"reference": "ec94bd61d49ddacfd1ac41cf645477e8cc1cc5a4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/1edf9354ec993831581872c695cf1ddc335e2e66",
"reference": "1edf9354ec993831581872c695cf1ddc335e2e66",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/ec94bd61d49ddacfd1ac41cf645477e8cc1cc5a4",
"reference": "ec94bd61d49ddacfd1ac41cf645477e8cc1cc5a4",
"shasum": ""
},
"require": {
@ -2875,7 +2875,7 @@
"issues": "https://github.com/appwrite/sdk-generator/issues",
"source": "https://github.com/appwrite/sdk-generator/tree/master"
},
"time": "2022-08-06T02:46:59+00:00"
"time": "2022-08-09T08:42:43+00:00"
},
{
"name": "doctrine/instantiator",
@ -5354,6 +5354,12 @@
"alias": "0.19.5",
"alias_normalized": "0.19.5.0"
},
{
"package": "utopia-php/abuse",
"version": "dev-refactor-permissions",
"alias": "0.7.0",
"alias_normalized": "0.7.0.0"
},
{
"package": "utopia-php/database",
"version": "dev-refactor-permissions",
@ -5363,6 +5369,7 @@
],
"minimum-stability": "stable",
"stability-flags": {
"utopia-php/abuse": 20,
"utopia-php/database": 20,
"appwrite/sdk-generator": 20
},
@ -5383,7 +5390,9 @@
"ext-zlib": "*",
"ext-sockets": "*"
},
"platform-dev": [],
"platform-dev": {
"ext-fileinfo": "*"
},
"platform-overrides": {
"php": "8.0"
},

File diff suppressed because one or more lines are too long

View file

@ -696,8 +696,8 @@ if(typeof name==='undefined'){throw new AppwriteException('Missing required para
if(typeof fileSecurity==='undefined'){throw new AppwriteException('Missing required parameter: "fileSecurity"');}
let path='/storage/buckets';let payload={};if(typeof bucketId!=='undefined'){payload['bucketId']=bucketId;}
if(typeof name!=='undefined'){payload['name']=name;}
if(typeof fileSecurity!=='undefined'){payload['fileSecurity']=fileSecurity;}
if(typeof permissions!=='undefined'){payload['permissions']=permissions;}
if(typeof fileSecurity!=='undefined'){payload['fileSecurity']=fileSecurity;}
if(typeof enabled!=='undefined'){payload['enabled']=enabled;}
if(typeof maximumFileSize!=='undefined'){payload['maximumFileSize']=maximumFileSize;}
if(typeof allowedFileExtensions!=='undefined'){payload['allowedFileExtensions']=allowedFileExtensions;}
@ -710,8 +710,8 @@ updateBucket(bucketId,name,fileSecurity,permissions,enabled,maximumFileSize,allo
if(typeof name==='undefined'){throw new AppwriteException('Missing required parameter: "name"');}
if(typeof fileSecurity==='undefined'){throw new AppwriteException('Missing required parameter: "fileSecurity"');}
let path='/storage/buckets/{bucketId}'.replace('{bucketId}',bucketId);let payload={};if(typeof name!=='undefined'){payload['name']=name;}
if(typeof fileSecurity!=='undefined'){payload['fileSecurity']=fileSecurity;}
if(typeof permissions!=='undefined'){payload['permissions']=permissions;}
if(typeof fileSecurity!=='undefined'){payload['fileSecurity']=fileSecurity;}
if(typeof enabled!=='undefined'){payload['enabled']=enabled;}
if(typeof maximumFileSize!=='undefined'){payload['maximumFileSize']=maximumFileSize;}
if(typeof allowedFileExtensions!=='undefined'){payload['allowedFileExtensions']=allowedFileExtensions;}
@ -1139,10 +1139,12 @@ gc.splice(0,gcLen);}
return longest;}
function _alignPixel(chart,pixel,width){const devicePixelRatio=chart.currentDevicePixelRatio;const halfWidth=width!==0?Math.max(width/2,0.5):0;return Math.round((pixel-halfWidth)*devicePixelRatio)/devicePixelRatio+halfWidth;}
function clearCanvas(canvas,ctx){ctx=ctx||canvas.getContext('2d');ctx.save();ctx.resetTransform();ctx.clearRect(0,0,canvas.width,canvas.height);ctx.restore();}
function drawPoint(ctx,options,x,y){let type,xOffset,yOffset,size,cornerRadius;const style=options.pointStyle;const rotation=options.rotation;const radius=options.radius;let rad=(rotation||0)*RAD_PER_DEG;if(style&&typeof style==='object'){type=style.toString();if(type==='[object HTMLImageElement]'||type==='[object HTMLCanvasElement]'){ctx.save();ctx.translate(x,y);ctx.rotate(rad);ctx.drawImage(style,-style.width/2,-style.height/2,style.width,style.height);ctx.restore();return;}}
function drawPoint(ctx,options,x,y){drawPointLegend(ctx,options,x,y,null);}
function drawPointLegend(ctx,options,x,y,w){let type,xOffset,yOffset,size,cornerRadius,width;const style=options.pointStyle;const rotation=options.rotation;const radius=options.radius;let rad=(rotation||0)*RAD_PER_DEG;if(style&&typeof style==='object'){type=style.toString();if(type==='[object HTMLImageElement]'||type==='[object HTMLCanvasElement]'){ctx.save();ctx.translate(x,y);ctx.rotate(rad);ctx.drawImage(style,-style.width/2,-style.height/2,style.width,style.height);ctx.restore();return;}}
if(isNaN(radius)||radius<=0){return;}
ctx.beginPath();switch(style){default:ctx.arc(x,y,radius,0,TAU);ctx.closePath();break;case'triangle':ctx.moveTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius);rad+=TWO_THIRDS_PI;ctx.lineTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius);rad+=TWO_THIRDS_PI;ctx.lineTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius);ctx.closePath();break;case'rectRounded':cornerRadius=radius*0.516;size=radius-cornerRadius;xOffset=Math.cos(rad+QUARTER_PI)*size;yOffset=Math.sin(rad+QUARTER_PI)*size;ctx.arc(x-xOffset,y-yOffset,cornerRadius,rad-PI,rad-HALF_PI);ctx.arc(x+yOffset,y-xOffset,cornerRadius,rad-HALF_PI,rad);ctx.arc(x+xOffset,y+yOffset,cornerRadius,rad,rad+HALF_PI);ctx.arc(x-yOffset,y+xOffset,cornerRadius,rad+HALF_PI,rad+PI);ctx.closePath();break;case'rect':if(!rotation){size=Math.SQRT1_2*radius;ctx.rect(x-size,y-size,2*size,2*size);break;}
rad+=QUARTER_PI;case'rectRot':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+yOffset,y-xOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.lineTo(x-yOffset,y+xOffset);ctx.closePath();break;case'crossRot':rad+=QUARTER_PI;case'cross':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x+yOffset,y-xOffset);ctx.lineTo(x-yOffset,y+xOffset);break;case'star':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x+yOffset,y-xOffset);ctx.lineTo(x-yOffset,y+xOffset);rad+=QUARTER_PI;xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x+yOffset,y-xOffset);ctx.lineTo(x-yOffset,y+xOffset);break;case'line':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);break;case'dash':ctx.moveTo(x,y);ctx.lineTo(x+Math.cos(rad)*radius,y+Math.sin(rad)*radius);break;}
ctx.beginPath();switch(style){default:if(w){ctx.ellipse(x,y,w/2,radius,0,0,TAU);}else{ctx.arc(x,y,radius,0,TAU);}
ctx.closePath();break;case'triangle':ctx.moveTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius);rad+=TWO_THIRDS_PI;ctx.lineTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius);rad+=TWO_THIRDS_PI;ctx.lineTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius);ctx.closePath();break;case'rectRounded':cornerRadius=radius*0.516;size=radius-cornerRadius;xOffset=Math.cos(rad+QUARTER_PI)*size;yOffset=Math.sin(rad+QUARTER_PI)*size;ctx.arc(x-xOffset,y-yOffset,cornerRadius,rad-PI,rad-HALF_PI);ctx.arc(x+yOffset,y-xOffset,cornerRadius,rad-HALF_PI,rad);ctx.arc(x+xOffset,y+yOffset,cornerRadius,rad,rad+HALF_PI);ctx.arc(x-yOffset,y+xOffset,cornerRadius,rad+HALF_PI,rad+PI);ctx.closePath();break;case'rect':if(!rotation){size=Math.SQRT1_2*radius;width=w?w/2:size;ctx.rect(x-width,y-size,2*width,2*size);break;}
rad+=QUARTER_PI;case'rectRot':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+yOffset,y-xOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.lineTo(x-yOffset,y+xOffset);ctx.closePath();break;case'crossRot':rad+=QUARTER_PI;case'cross':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x+yOffset,y-xOffset);ctx.lineTo(x-yOffset,y+xOffset);break;case'star':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x+yOffset,y-xOffset);ctx.lineTo(x-yOffset,y+xOffset);rad+=QUARTER_PI;xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x+yOffset,y-xOffset);ctx.lineTo(x-yOffset,y+xOffset);break;case'line':xOffset=w?w/2:Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);break;case'dash':ctx.moveTo(x,y);ctx.lineTo(x+Math.cos(rad)*radius,y+Math.sin(rad)*radius);break;}
ctx.fill();if(options.borderWidth>0){ctx.stroke();}}
function _isPointInArea(point,area,margin){margin=margin||0.5;return!area||(point&&point.x>area.left-margin&&point.x<area.right+margin&&point.y>area.top-margin&&point.y<area.bottom+margin);}
function clipArea(ctx,area){ctx.save();ctx.beginPath();ctx.rect(area.left,area.top,area.right-area.left,area.bottom-area.top);ctx.clip();}
@ -1292,7 +1294,7 @@ if(start<i-1){addStyle(start,i-1,segment.loop,prevStyle);}}
return result;}
function readStyle(options){return{backgroundColor:options.backgroundColor,borderCapStyle:options.borderCapStyle,borderDash:options.borderDash,borderDashOffset:options.borderDashOffset,borderJoinStyle:options.borderJoinStyle,borderWidth:options.borderWidth,borderColor:options.borderColor};}
function styleChanged(style,prevStyle){return prevStyle&&JSON.stringify(style)!==JSON.stringify(prevStyle);}
var helpers=Object.freeze({__proto__:null,easingEffects:effects,isPatternOrGradient:isPatternOrGradient,color:color,getHoverColor:getHoverColor,noop:noop,uid:uid,isNullOrUndef:isNullOrUndef,isArray:isArray,isObject:isObject,isFinite:isNumberFinite,finiteOrDefault:finiteOrDefault,valueOrDefault:valueOrDefault,toPercentage:toPercentage,toDimension:toDimension,callback:callback,each:each,_elementsEqual:_elementsEqual,clone:clone,_merger:_merger,merge:merge,mergeIf:mergeIf,_mergerIf:_mergerIf,_deprecated:_deprecated,resolveObjectKey:resolveObjectKey,_capitalize:_capitalize,defined:defined,isFunction:isFunction,setsEqual:setsEqual,_isClickEvent:_isClickEvent,toFontString:toFontString,_measureText:_measureText,_longestText:_longestText,_alignPixel:_alignPixel,clearCanvas:clearCanvas,drawPoint:drawPoint,_isPointInArea:_isPointInArea,clipArea:clipArea,unclipArea:unclipArea,_steppedLineTo:_steppedLineTo,_bezierCurveTo:_bezierCurveTo,renderText:renderText,addRoundedRectPath:addRoundedRectPath,_lookup:_lookup,_lookupByKey:_lookupByKey,_rlookupByKey:_rlookupByKey,_filterBetween:_filterBetween,listenArrayEvents:listenArrayEvents,unlistenArrayEvents:unlistenArrayEvents,_arrayUnique:_arrayUnique,_createResolver:_createResolver,_attachContext:_attachContext,_descriptors:_descriptors,_parseObjectDataRadialScale:_parseObjectDataRadialScale,splineCurve:splineCurve,splineCurveMonotone:splineCurveMonotone,_updateBezierControlPoints:_updateBezierControlPoints,_isDomSupported:_isDomSupported,_getParentNode:_getParentNode,getStyle:getStyle,getRelativePosition:getRelativePosition,getMaximumSize:getMaximumSize,retinaScale:retinaScale,supportsEventListenerOptions:supportsEventListenerOptions,readUsedSize:readUsedSize,fontString:fontString,requestAnimFrame:requestAnimFrame,throttled:throttled,debounce:debounce,_toLeftRightCenter:_toLeftRightCenter,_alignStartEnd:_alignStartEnd,_textX:_textX,_pointInLine:_pointInLine,_steppedInterpolation:_steppedInterpolation,_bezierInterpolation:_bezierInterpolation,formatNumber:formatNumber,toLineHeight:toLineHeight,_readValueToProps:_readValueToProps,toTRBL:toTRBL,toTRBLCorners:toTRBLCorners,toPadding:toPadding,toFont:toFont,resolve:resolve,_addGrace:_addGrace,createContext:createContext,PI:PI,TAU:TAU,PITAU:PITAU,INFINITY:INFINITY,RAD_PER_DEG:RAD_PER_DEG,HALF_PI:HALF_PI,QUARTER_PI:QUARTER_PI,TWO_THIRDS_PI:TWO_THIRDS_PI,log10:log10,sign:sign,niceNum:niceNum,_factorize:_factorize,isNumber:isNumber,almostEquals:almostEquals,almostWhole:almostWhole,_setMinAndMaxByKey:_setMinAndMaxByKey,toRadians:toRadians,toDegrees:toDegrees,_decimalPlaces:_decimalPlaces,getAngleFromPoint:getAngleFromPoint,distanceBetweenPoints:distanceBetweenPoints,_angleDiff:_angleDiff,_normalizeAngle:_normalizeAngle,_angleBetween:_angleBetween,_limitValue:_limitValue,_int16Range:_int16Range,_isBetween:_isBetween,getRtlAdapter:getRtlAdapter,overrideTextDirection:overrideTextDirection,restoreTextDirection:restoreTextDirection,_boundSegment:_boundSegment,_boundSegments:_boundSegments,_computeSegments:_computeSegments});function binarySearch(metaset,axis,value,intersect){const{controller,data,_sorted}=metaset;const iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&axis!=='r'&&_sorted&&data.length){const lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect){return lookupMethod(data,axis,value);}else if(controller._sharedOptions){const el=data[0];const range=typeof el.getRange==='function'&&el.getRange(axis);if(range){const start=lookupMethod(data,axis,value-range);const end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi};}}}
var helpers=Object.freeze({__proto__:null,easingEffects:effects,isPatternOrGradient:isPatternOrGradient,color:color,getHoverColor:getHoverColor,noop:noop,uid:uid,isNullOrUndef:isNullOrUndef,isArray:isArray,isObject:isObject,isFinite:isNumberFinite,finiteOrDefault:finiteOrDefault,valueOrDefault:valueOrDefault,toPercentage:toPercentage,toDimension:toDimension,callback:callback,each:each,_elementsEqual:_elementsEqual,clone:clone,_merger:_merger,merge:merge,mergeIf:mergeIf,_mergerIf:_mergerIf,_deprecated:_deprecated,resolveObjectKey:resolveObjectKey,_capitalize:_capitalize,defined:defined,isFunction:isFunction,setsEqual:setsEqual,_isClickEvent:_isClickEvent,toFontString:toFontString,_measureText:_measureText,_longestText:_longestText,_alignPixel:_alignPixel,clearCanvas:clearCanvas,drawPoint:drawPoint,drawPointLegend:drawPointLegend,_isPointInArea:_isPointInArea,clipArea:clipArea,unclipArea:unclipArea,_steppedLineTo:_steppedLineTo,_bezierCurveTo:_bezierCurveTo,renderText:renderText,addRoundedRectPath:addRoundedRectPath,_lookup:_lookup,_lookupByKey:_lookupByKey,_rlookupByKey:_rlookupByKey,_filterBetween:_filterBetween,listenArrayEvents:listenArrayEvents,unlistenArrayEvents:unlistenArrayEvents,_arrayUnique:_arrayUnique,_createResolver:_createResolver,_attachContext:_attachContext,_descriptors:_descriptors,_parseObjectDataRadialScale:_parseObjectDataRadialScale,splineCurve:splineCurve,splineCurveMonotone:splineCurveMonotone,_updateBezierControlPoints:_updateBezierControlPoints,_isDomSupported:_isDomSupported,_getParentNode:_getParentNode,getStyle:getStyle,getRelativePosition:getRelativePosition,getMaximumSize:getMaximumSize,retinaScale:retinaScale,supportsEventListenerOptions:supportsEventListenerOptions,readUsedSize:readUsedSize,fontString:fontString,requestAnimFrame:requestAnimFrame,throttled:throttled,debounce:debounce,_toLeftRightCenter:_toLeftRightCenter,_alignStartEnd:_alignStartEnd,_textX:_textX,_pointInLine:_pointInLine,_steppedInterpolation:_steppedInterpolation,_bezierInterpolation:_bezierInterpolation,formatNumber:formatNumber,toLineHeight:toLineHeight,_readValueToProps:_readValueToProps,toTRBL:toTRBL,toTRBLCorners:toTRBLCorners,toPadding:toPadding,toFont:toFont,resolve:resolve,_addGrace:_addGrace,createContext:createContext,PI:PI,TAU:TAU,PITAU:PITAU,INFINITY:INFINITY,RAD_PER_DEG:RAD_PER_DEG,HALF_PI:HALF_PI,QUARTER_PI:QUARTER_PI,TWO_THIRDS_PI:TWO_THIRDS_PI,log10:log10,sign:sign,niceNum:niceNum,_factorize:_factorize,isNumber:isNumber,almostEquals:almostEquals,almostWhole:almostWhole,_setMinAndMaxByKey:_setMinAndMaxByKey,toRadians:toRadians,toDegrees:toDegrees,_decimalPlaces:_decimalPlaces,getAngleFromPoint:getAngleFromPoint,distanceBetweenPoints:distanceBetweenPoints,_angleDiff:_angleDiff,_normalizeAngle:_normalizeAngle,_angleBetween:_angleBetween,_limitValue:_limitValue,_int16Range:_int16Range,_isBetween:_isBetween,getRtlAdapter:getRtlAdapter,overrideTextDirection:overrideTextDirection,restoreTextDirection:restoreTextDirection,_boundSegment:_boundSegment,_boundSegments:_boundSegments,_computeSegments:_computeSegments});function binarySearch(metaset,axis,value,intersect){const{controller,data,_sorted}=metaset;const iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&axis!=='r'&&_sorted&&data.length){const lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect){return lookupMethod(data,axis,value);}else if(controller._sharedOptions){const el=data[0];const range=typeof el.getRange==='function'&&el.getRange(axis);if(range){const start=lookupMethod(data,axis,value-range);const end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi};}}}
return{lo:0,hi:data.length-1};}
function evaluateInteractionItems(chart,axis,position,handler,intersect){const metasets=chart.getSortedVisibleDatasetMetas();const value=position[axis];for(let i=0,ilen=metasets.length;i<ilen;++i){const{index,data}=metasets[i];const{lo,hi}=binarySearch(metasets[i],axis,value,intersect);for(let j=lo;j<=hi;++j){const element=data[j];if(!element.skip){handler(element,index,j);}}}}
function getDistanceMetricForAxis(axis){const useX=axis.indexOf('x')!==-1;const useY=axis.indexOf('y')!==-1;return function(pt1,pt2){const deltaX=useX?Math.abs(pt1.x-pt2.x):0;const deltaY=useY?Math.abs(pt1.y-pt2.y):0;return Math.sqrt(Math.pow(deltaX,2)+Math.pow(deltaY,2));};}
@ -1512,6 +1514,7 @@ return animations;}
getSharedOptions(options){if(!options.$shared){return;}
return this._sharedOptions||(this._sharedOptions=Object.assign({},options));}
includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled;}
_getSharedOptions(start,mode){const firstOpts=this.resolveDataElementOptions(start,mode);const previouslySharedOptions=this._sharedOptions;const sharedOptions=this.getSharedOptions(firstOpts);const includeOptions=this.includeOptions(mode,sharedOptions)||(sharedOptions!==previouslySharedOptions);this.updateSharedOptions(sharedOptions,mode,firstOpts);return{sharedOptions,includeOptions};}
updateElement(element,index,properties,mode){if(isDirectUpdateMode(mode)){Object.assign(element,properties);}else{this._resolveAnimations(index,mode).update(element,properties);}}
updateSharedOptions(sharedOptions,mode,newOptions){if(sharedOptions&&!isDirectUpdateMode(mode)){this._resolveAnimations(undefined,mode).update(sharedOptions,newOptions);}}
_setStyle(element,index,mode,active){element.active=active;const options=this.getStyle(index,active);this._resolveAnimations(index,mode,active).update(element,{options:(!active&&this.getSharedOptions(options))||options});}
@ -1757,16 +1760,17 @@ _descriptors(chart){if(this._cache){return this._cache;}
const descriptors=this._cache=this._createDescriptors(chart);this._notifyStateChanges(chart);return descriptors;}
_createDescriptors(chart,all){const config=chart&&chart.config;const options=valueOrDefault(config.options&&config.options.plugins,{});const plugins=allPlugins(config);return options===false&&!all?[]:createDescriptors(chart,plugins,options,all);}
_notifyStateChanges(chart){const previousDescriptors=this._oldCache||[];const descriptors=this._cache;const diff=(a,b)=>a.filter(x=>!b.some(y=>x.plugin.id===y.plugin.id));this._notify(diff(previousDescriptors,descriptors),chart,'stop');this._notify(diff(descriptors,previousDescriptors),chart,'start');}}
function allPlugins(config){const plugins=[];const keys=Object.keys(registry.plugins.items);for(let i=0;i<keys.length;i++){plugins.push(registry.getPlugin(keys[i]));}
const local=config.plugins||[];for(let i=0;i<local.length;i++){const plugin=local[i];if(plugins.indexOf(plugin)===-1){plugins.push(plugin);}}
return plugins;}
function allPlugins(config){const localIds={};const plugins=[];const keys=Object.keys(registry.plugins.items);for(let i=0;i<keys.length;i++){plugins.push(registry.getPlugin(keys[i]));}
const local=config.plugins||[];for(let i=0;i<local.length;i++){const plugin=local[i];if(plugins.indexOf(plugin)===-1){plugins.push(plugin);localIds[plugin.id]=true;}}
return{plugins,localIds};}
function getOpts(options,all){if(!all&&options===false){return null;}
if(options===true){return{};}
return options;}
function createDescriptors(chart,plugins,options,all){const result=[];const context=chart.getContext();for(let i=0;i<plugins.length;i++){const plugin=plugins[i];const id=plugin.id;const opts=getOpts(options[id],all);if(opts===null){continue;}
result.push({plugin,options:pluginOpts(chart.config,plugin,opts,context)});}
function createDescriptors(chart,{plugins,localIds},options,all){const result=[];const context=chart.getContext();for(const plugin of plugins){const id=plugin.id;const opts=getOpts(options[id],all);if(opts===null){continue;}
result.push({plugin,options:pluginOpts(chart.config,{plugin,local:localIds[id]},opts,context)});}
return result;}
function pluginOpts(config,plugin,opts,context){const keys=config.pluginScopeKeys(plugin);const scopes=config.getOptionScopes(opts,keys);return config.createResolver(scopes,context,[''],{scriptable:false,indexable:false,allKeys:true});}
function pluginOpts(config,{plugin,local},opts,context){const keys=config.pluginScopeKeys(plugin);const scopes=config.getOptionScopes(opts,keys);if(local&&plugin.defaults){scopes.push(plugin.defaults);}
return config.createResolver(scopes,context,[''],{scriptable:false,indexable:false,allKeys:true});}
function getIndexAxis(type,options){const datasetDefaults=defaults.datasets[type]||{};const datasetOptions=(options.datasets||{})[type]||{};return datasetOptions.indexAxis||options.indexAxis||datasetDefaults.indexAxis||'x';}
function getAxisFromDefaultScaleID(id,indexAxis){let axis=id;if(id==='_index_'){axis=indexAxis;}else if(id==='_value_'){axis=indexAxis==='x'?'y':'x';}
return axis;}
@ -1815,7 +1819,7 @@ const cacheKey=prefixes.join();let cached=cache.get(cacheKey);if(!cached){const
return cached;}
const hasFunction=value=>isObject(value)&&Object.getOwnPropertyNames(value).reduce((acc,key)=>acc||isFunction(value[key]),false);function needContext(proxy,names){const{isScriptable,isIndexable}=_descriptors(proxy);for(const prop of names){const scriptable=isScriptable(prop);const indexable=isIndexable(prop);const value=(indexable||scriptable)&&proxy[prop];if((scriptable&&(isFunction(value)||hasFunction(value)))||(indexable&&isArray(value))){return true;}}
return false;}
var version="3.8.0";const KNOWN_POSITIONS=['top','bottom','left','right','chartArea'];function positionIsHorizontal(position,axis){return position==='top'||position==='bottom'||(KNOWN_POSITIONS.indexOf(position)===-1&&axis==='x');}
var version="3.8.2";const KNOWN_POSITIONS=['top','bottom','left','right','chartArea'];function positionIsHorizontal(position,axis){return position==='top'||position==='bottom'||(KNOWN_POSITIONS.indexOf(position)===-1&&axis==='x');}
function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1];};}
function onAnimationsComplete(context){const chart=context.chart;const animationOptions=chart.options.animation;chart.notifyPlugins('afterRender');callback(animationOptions&&animationOptions.onComplete,[context],chart);}
function onAnimationProgress(context){const chart=context.chart;const animationOptions=chart.options.animation;callback(animationOptions&&animationOptions.onProgress,[context],chart);}
@ -1826,7 +1830,7 @@ const instances={};const getChart=(key)=>{const canvas=getCanvas(key);return Obj
function determineLastEvent(e,lastEvent,inChartArea,isClick){if(!inChartArea||e.type==='mouseout'){return null;}
if(isClick){return lastEvent;}
return e;}
class Chart{constructor(item,userConfig){const config=this.config=new Config(userConfig);const initialCanvas=getCanvas(item);const existingChart=getChart(initialCanvas);if(existingChart){throw new Error('Canvas is already in use. Chart with ID \''+existingChart.id+'\''+' must be destroyed before the canvas can be reused.');}
class Chart{constructor(item,userConfig){const config=this.config=new Config(userConfig);const initialCanvas=getCanvas(item);const existingChart=getChart(initialCanvas);if(existingChart){throw new Error('Canvas is already in use. Chart with ID \''+existingChart.id+'\''+' must be destroyed before the canvas with ID \''+existingChart.canvas.id+'\' can be reused.');}
const options=config.createResolver(config.chartOptionScopes(),this.getContext());this.platform=new(config.platform||_detectPlatform(initialCanvas))();this.platform.updateConfig(config);const context=this.platform.acquireContext(initialCanvas,options.aspectRatio);const canvas=context&&context.canvas;const height=canvas&&canvas.height;const width=canvas&&canvas.width;this.id=uid();this.ctx=context;this.canvas=canvas;this.width=width;this.height=height;this._options=options;this._aspectRatio=this.aspectRatio;this._layers=[];this._metasets=[];this._stacks=undefined;this.boxes=[];this.currentDevicePixelRatio=undefined;this.chartArea=undefined;this._active=[];this._lastEvent=undefined;this._listeners={};this._responsiveListeners=undefined;this._sortedMetasets=[];this.scales={};this._plugins=new PluginService();this.$proxies={};this._hiddenIndices={};this.attached=false;this._animationsDisabled=undefined;this.$context=undefined;this._doResize=debounce(mode=>this.update(mode),options.resizeDelay||0);this._dataChanges=[];instances[this.id]=this;if(!context||!canvas){console.error("Failed to create chart: can't acquire context from the given item");return;}
animator.listen(this,'complete',onAnimationsComplete);animator.listen(this,'progress',onAnimationProgress);this._initialize();if(this.attached){this.update();}}
get aspectRatio(){const{options:{aspectRatio,maintainAspectRatio},width,height,_aspectRatio}=this;if(!isNullOrUndef(aspectRatio)){return aspectRatio;}
@ -1991,12 +1995,11 @@ getMaxOverflow(){return 0;}
getLabelAndValue(index){const meta=this._cachedMeta;const{iScale,vScale}=meta;const parsed=this.getParsed(index);const custom=parsed._custom;const value=isFloatBar(custom)?'['+custom.start+', '+custom.end+']':''+vScale.getLabelForValue(parsed[vScale.axis]);return{label:''+iScale.getLabelForValue(parsed[iScale.axis]),value};}
initialize(){this.enableOptionSharing=true;super.initialize();const meta=this._cachedMeta;meta.stack=this.getDataset().stack;}
update(mode){const meta=this._cachedMeta;this.updateElements(meta.data,0,meta.data.length,mode);}
updateElements(bars,start,count,mode){const reset=mode==='reset';const{index,_cachedMeta:{vScale}}=this;const base=vScale.getBasePixel();const horizontal=vScale.isHorizontal();const ruler=this._getRuler();const firstOpts=this.resolveDataElementOptions(start,mode);const sharedOptions=this.getSharedOptions(firstOpts);const includeOptions=this.includeOptions(mode,sharedOptions);this.updateSharedOptions(sharedOptions,mode,firstOpts);for(let i=start;i<start+count;i++){const parsed=this.getParsed(i);const vpixels=reset||isNullOrUndef(parsed[vScale.axis])?{base,head:base}:this._calculateBarValuePixels(i);const ipixels=this._calculateBarIndexPixels(i,ruler);const stack=(parsed._stacks||{})[vScale.axis];const properties={horizontal,base:vpixels.base,enableBorderRadius:!stack||isFloatBar(parsed._custom)||(index===stack._top||index===stack._bottom),x:horizontal?vpixels.head:ipixels.center,y:horizontal?ipixels.center:vpixels.head,height:horizontal?ipixels.size:Math.abs(vpixels.size),width:horizontal?Math.abs(vpixels.size):ipixels.size};if(includeOptions){properties.options=sharedOptions||this.resolveDataElementOptions(i,bars[i].active?'active':mode);}
updateElements(bars,start,count,mode){const reset=mode==='reset';const{index,_cachedMeta:{vScale}}=this;const base=vScale.getBasePixel();const horizontal=vScale.isHorizontal();const ruler=this._getRuler();const{sharedOptions,includeOptions}=this._getSharedOptions(start,mode);for(let i=start;i<start+count;i++){const parsed=this.getParsed(i);const vpixels=reset||isNullOrUndef(parsed[vScale.axis])?{base,head:base}:this._calculateBarValuePixels(i);const ipixels=this._calculateBarIndexPixels(i,ruler);const stack=(parsed._stacks||{})[vScale.axis];const properties={horizontal,base:vpixels.base,enableBorderRadius:!stack||isFloatBar(parsed._custom)||(index===stack._top||index===stack._bottom),x:horizontal?vpixels.head:ipixels.center,y:horizontal?ipixels.center:vpixels.head,height:horizontal?ipixels.size:Math.abs(vpixels.size),width:horizontal?Math.abs(vpixels.size):ipixels.size};if(includeOptions){properties.options=sharedOptions||this.resolveDataElementOptions(i,bars[i].active?'active':mode);}
const options=properties.options||bars[i].options;setBorderSkipped(properties,options,stack,index);setInflateAmount(properties,options,ruler.ratio);this.updateElement(bars[i],i,properties,mode);}}
_getStacks(last,dataIndex){const meta=this._cachedMeta;const iScale=meta.iScale;const metasets=iScale.getMatchingVisibleMetas(this._type);const stacked=iScale.options.stacked;const ilen=metasets.length;const stacks=[];let i,item;for(i=0;i<ilen;++i){item=metasets[i];if(!item.controller.options.grouped){continue;}
if(typeof dataIndex!=='undefined'){const val=item.controller.getParsed(dataIndex)[item.controller._cachedMeta.vScale.axis];if(isNullOrUndef(val)||isNaN(val)){continue;}}
if(stacked===false||stacks.indexOf(item.stack)===-1||(stacked===undefined&&item.stack===undefined)){stacks.push(item.stack);}
if(item.index===last){break;}}
_getStacks(last,dataIndex){const{iScale}=this._cachedMeta;const metasets=iScale.getMatchingVisibleMetas(this._type).filter(meta=>meta.controller.options.grouped);const stacked=iScale.options.stacked;const stacks=[];const skipNull=(meta)=>{const parsed=meta.controller.getParsed(dataIndex);const val=parsed&&parsed[meta.vScale.axis];if(isNullOrUndef(val)||isNaN(val)){return true;}};for(const meta of metasets){if(dataIndex!==undefined&&skipNull(meta)){continue;}
if(stacked===false||stacks.indexOf(meta.stack)===-1||(stacked===undefined&&meta.stack===undefined)){stacks.push(meta.stack);}
if(meta.index===last){break;}}
if(!stacks.length){stacks.push(undefined);}
return stacks;}
_getStackCount(index){return this._getStacks(undefined,index).length;}
@ -2025,9 +2028,8 @@ getMaxOverflow(){const data=this._cachedMeta.data;let max=0;for(let i=data.lengt
return max>0&&max;}
getLabelAndValue(index){const meta=this._cachedMeta;const{xScale,yScale}=meta;const parsed=this.getParsed(index);const x=xScale.getLabelForValue(parsed.x);const y=yScale.getLabelForValue(parsed.y);const r=parsed._custom;return{label:meta.label,value:'('+x+', '+y+(r?', '+r:'')+')'};}
update(mode){const points=this._cachedMeta.data;this.updateElements(points,0,points.length,mode);}
updateElements(points,start,count,mode){const reset=mode==='reset';const{iScale,vScale}=this._cachedMeta;const firstOpts=this.resolveDataElementOptions(start,mode);const sharedOptions=this.getSharedOptions(firstOpts);const includeOptions=this.includeOptions(mode,sharedOptions);const iAxis=iScale.axis;const vAxis=vScale.axis;for(let i=start;i<start+count;i++){const point=points[i];const parsed=!reset&&this.getParsed(i);const properties={};const iPixel=properties[iAxis]=reset?iScale.getPixelForDecimal(0.5):iScale.getPixelForValue(parsed[iAxis]);const vPixel=properties[vAxis]=reset?vScale.getBasePixel():vScale.getPixelForValue(parsed[vAxis]);properties.skip=isNaN(iPixel)||isNaN(vPixel);if(includeOptions){properties.options=this.resolveDataElementOptions(i,point.active?'active':mode);if(reset){properties.options.radius=0;}}
this.updateElement(point,i,properties,mode);}
this.updateSharedOptions(sharedOptions,mode,firstOpts);}
updateElements(points,start,count,mode){const reset=mode==='reset';const{iScale,vScale}=this._cachedMeta;const{sharedOptions,includeOptions}=this._getSharedOptions(start,mode);const iAxis=iScale.axis;const vAxis=vScale.axis;for(let i=start;i<start+count;i++){const point=points[i];const parsed=!reset&&this.getParsed(i);const properties={};const iPixel=properties[iAxis]=reset?iScale.getPixelForDecimal(0.5):iScale.getPixelForValue(parsed[iAxis]);const vPixel=properties[vAxis]=reset?vScale.getBasePixel():vScale.getPixelForValue(parsed[vAxis]);properties.skip=isNaN(iPixel)||isNaN(vPixel);if(includeOptions){properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?'active':mode);if(reset){properties.options.radius=0;}}
this.updateElement(point,i,properties,mode);}}
resolveDataElementOptions(index,mode){const parsed=this.getParsed(index);let values=super.resolveDataElementOptions(index,mode);if(values.$shared){values=Object.assign({},values,{$shared:false});}
const radius=values.radius;if(mode!=='active'){values.radius=0;}
values.radius+=valueOrDefault(parsed&&parsed._custom,radius);return values;}}
@ -2044,10 +2046,9 @@ return{rotation:min,circumference:max-min,};}
update(mode){const chart=this.chart;const{chartArea}=chart;const meta=this._cachedMeta;const arcs=meta.data;const spacing=this.getMaxBorderWidth()+this.getMaxOffset(arcs)+this.options.spacing;const maxSize=Math.max((Math.min(chartArea.width,chartArea.height)-spacing)/2,0);const cutout=Math.min(toPercentage(this.options.cutout,maxSize),1);const chartWeight=this._getRingWeight(this.index);const{circumference,rotation}=this._getRotationExtents();const{ratioX,ratioY,offsetX,offsetY}=getRatioAndOffset(rotation,circumference,cutout);const maxWidth=(chartArea.width-spacing)/ratioX;const maxHeight=(chartArea.height-spacing)/ratioY;const maxRadius=Math.max(Math.min(maxWidth,maxHeight)/2,0);const outerRadius=toDimension(this.options.radius,maxRadius);const innerRadius=Math.max(outerRadius*cutout,0);const radiusLength=(outerRadius-innerRadius)/this._getVisibleDatasetWeightTotal();this.offsetX=offsetX*outerRadius;this.offsetY=offsetY*outerRadius;meta.total=this.calculateTotal();this.outerRadius=outerRadius-radiusLength*this._getRingWeightOffset(this.index);this.innerRadius=Math.max(this.outerRadius-radiusLength*chartWeight,0);this.updateElements(arcs,0,arcs.length,mode);}
_circumference(i,reset){const opts=this.options;const meta=this._cachedMeta;const circumference=this._getCircumference();if((reset&&opts.animation.animateRotate)||!this.chart.getDataVisibility(i)||meta._parsed[i]===null||meta.data[i].hidden){return 0;}
return this.calculateCircumference(meta._parsed[i]*circumference/TAU);}
updateElements(arcs,start,count,mode){const reset=mode==='reset';const chart=this.chart;const chartArea=chart.chartArea;const opts=chart.options;const animationOpts=opts.animation;const centerX=(chartArea.left+chartArea.right)/2;const centerY=(chartArea.top+chartArea.bottom)/2;const animateScale=reset&&animationOpts.animateScale;const innerRadius=animateScale?0:this.innerRadius;const outerRadius=animateScale?0:this.outerRadius;const firstOpts=this.resolveDataElementOptions(start,mode);const sharedOptions=this.getSharedOptions(firstOpts);const includeOptions=this.includeOptions(mode,sharedOptions);let startAngle=this._getRotation();let i;for(i=0;i<start;++i){startAngle+=this._circumference(i,reset);}
updateElements(arcs,start,count,mode){const reset=mode==='reset';const chart=this.chart;const chartArea=chart.chartArea;const opts=chart.options;const animationOpts=opts.animation;const centerX=(chartArea.left+chartArea.right)/2;const centerY=(chartArea.top+chartArea.bottom)/2;const animateScale=reset&&animationOpts.animateScale;const innerRadius=animateScale?0:this.innerRadius;const outerRadius=animateScale?0:this.outerRadius;const{sharedOptions,includeOptions}=this._getSharedOptions(start,mode);let startAngle=this._getRotation();let i;for(i=0;i<start;++i){startAngle+=this._circumference(i,reset);}
for(i=start;i<start+count;++i){const circumference=this._circumference(i,reset);const arc=arcs[i];const properties={x:centerX+this.offsetX,y:centerY+this.offsetY,startAngle,endAngle:startAngle+circumference,circumference,outerRadius,innerRadius};if(includeOptions){properties.options=sharedOptions||this.resolveDataElementOptions(i,arc.active?'active':mode);}
startAngle+=circumference;this.updateElement(arc,i,properties,mode);}
this.updateSharedOptions(sharedOptions,mode,firstOpts);}
startAngle+=circumference;this.updateElement(arc,i,properties,mode);}}
calculateTotal(){const meta=this._cachedMeta;const metaData=meta.data;let total=0;let i;for(i=0;i<metaData.length;i++){const value=meta._parsed[i];if(value!==null&&!isNaN(value)&&this.chart.getDataVisibility(i)&&!metaData[i].hidden){total+=Math.abs(value);}}
return total;}
calculateCircumference(value){const total=this._cachedMeta.total;if(total>0&&!isNaN(value)){return TAU*(Math.abs(value)/total);}
@ -2069,11 +2070,10 @@ return dataLabel;}}}}};class LineController extends DatasetController{initialize
update(mode){const meta=this._cachedMeta;const{dataset:line,data:points=[],_dataset}=meta;const animationsDisabled=this.chart._animationsDisabled;let{start,count}=getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);this._drawStart=start;this._drawCount=count;if(scaleRangesChanged(meta)){start=0;count=points.length;}
line._chart=this.chart;line._datasetIndex=this.index;line._decimated=!!_dataset._decimated;line.points=points;const options=this.resolveDatasetElementOptions(mode);if(!this.options.showLine){options.borderWidth=0;}
options.segment=this.options.segment;this.updateElement(line,undefined,{animated:!animationsDisabled,options},mode);this.updateElements(points,start,count,mode);}
updateElements(points,start,count,mode){const reset=mode==='reset';const{iScale,vScale,_stacked,_dataset}=this._cachedMeta;const firstOpts=this.resolveDataElementOptions(start,mode);const sharedOptions=this.getSharedOptions(firstOpts);const includeOptions=this.includeOptions(mode,sharedOptions);const iAxis=iScale.axis;const vAxis=vScale.axis;const{spanGaps,segment}=this.options;const maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY;const directUpdate=this.chart._animationsDisabled||reset||mode==='none';let prevParsed=start>0&&this.getParsed(start-1);for(let i=start;i<start+count;++i){const point=points[i];const parsed=this.getParsed(i);const properties=directUpdate?point:{};const nullData=isNullOrUndef(parsed[vAxis]);const iPixel=properties[iAxis]=iScale.getPixelForValue(parsed[iAxis],i);const vPixel=properties[vAxis]=reset||nullData?vScale.getBasePixel():vScale.getPixelForValue(_stacked?this.applyStack(vScale,parsed,_stacked):parsed[vAxis],i);properties.skip=isNaN(iPixel)||isNaN(vPixel)||nullData;properties.stop=i>0&&(Math.abs(parsed[iAxis]-prevParsed[iAxis]))>maxGapLength;if(segment){properties.parsed=parsed;properties.raw=_dataset.data[i];}
updateElements(points,start,count,mode){const reset=mode==='reset';const{iScale,vScale,_stacked,_dataset}=this._cachedMeta;const{sharedOptions,includeOptions}=this._getSharedOptions(start,mode);const iAxis=iScale.axis;const vAxis=vScale.axis;const{spanGaps,segment}=this.options;const maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY;const directUpdate=this.chart._animationsDisabled||reset||mode==='none';let prevParsed=start>0&&this.getParsed(start-1);for(let i=start;i<start+count;++i){const point=points[i];const parsed=this.getParsed(i);const properties=directUpdate?point:{};const nullData=isNullOrUndef(parsed[vAxis]);const iPixel=properties[iAxis]=iScale.getPixelForValue(parsed[iAxis],i);const vPixel=properties[vAxis]=reset||nullData?vScale.getBasePixel():vScale.getPixelForValue(_stacked?this.applyStack(vScale,parsed,_stacked):parsed[vAxis],i);properties.skip=isNaN(iPixel)||isNaN(vPixel)||nullData;properties.stop=i>0&&(Math.abs(parsed[iAxis]-prevParsed[iAxis]))>maxGapLength;if(segment){properties.parsed=parsed;properties.raw=_dataset.data[i];}
if(includeOptions){properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?'active':mode);}
if(!directUpdate){this.updateElement(point,i,properties,mode);}
prevParsed=parsed;}
this.updateSharedOptions(sharedOptions,mode,firstOpts);}
prevParsed=parsed;}}
getMaxOverflow(){const meta=this._cachedMeta;const dataset=meta.dataset;const border=dataset.options&&dataset.options.borderWidth||0;const data=meta.data||[];if(!data.length){return border;}
const firstPoint=data[0].size(this.resolveDataElementOptions(0));const lastPoint=data[data.length-1].size(this.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2;}
draw(){const meta=this._cachedMeta;meta.dataset.updateControlPoints(this.chart.chartArea,meta.iScale.axis);super.draw();}}
@ -2240,6 +2240,7 @@ function _getEdge(a,b,prop,fn){if(a&&b){return fn(a[prop],b[prop]);}
return a?a[prop]:b?b[prop]:0;}
function _createBoundaryLine(boundary,line){let points=[];let _loop=false;if(isArray(boundary)){_loop=true;points=boundary;}else{points=_pointsFromSegments(boundary,line);}
return points.length?new LineElement({points,options:{tension:0},_loop,_fullLoop:_loop}):null;}
function _shouldApplyFill(source){return source&&source.fill!==false;}
function _resolveTarget(sources,index,propagate){const source=sources[index];let fill=source.fill;const visited=[index];let target;if(!propagate){return fill;}
while(fill!==false&&visited.indexOf(fill)===-1){if(!isNumberFinite(fill)){return fill;}
target=sources[fill];if(!target){return false;}
@ -2302,9 +2303,9 @@ var index={id:'filler',afterDatasetsUpdate(chart,_args,options){const count=(cha
meta.$filler=source;sources.push(source);}
for(i=0;i<count;++i){source=sources[i];if(!source||source.fill===false){continue;}
source.fill=_resolveTarget(sources,i,options.propagate);}},beforeDraw(chart,_args,options){const draw=options.drawTime==='beforeDraw';const metasets=chart.getSortedVisibleDatasetMetas();const area=chart.chartArea;for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;if(!source){continue;}
source.line.updateControlPoints(area,source.axis);if(draw){_drawfill(chart.ctx,source,area);}}},beforeDatasetsDraw(chart,_args,options){if(options.drawTime!=='beforeDatasetsDraw'){return;}
const metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;if(source){_drawfill(chart.ctx,source,chart.chartArea);}}},beforeDatasetDraw(chart,args,options){const source=args.meta.$filler;if(!source||source.fill===false||options.drawTime!=='beforeDatasetDraw'){return;}
_drawfill(chart.ctx,source,chart.chartArea);},defaults:{propagate:true,drawTime:'beforeDatasetDraw'}};const getBoxSize=(labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;if(labelOpts.usePointStyle){boxHeight=Math.min(boxHeight,fontSize);boxWidth=Math.min(boxWidth,fontSize);}
source.line.updateControlPoints(area,source.axis);if(draw&&source.fill){_drawfill(chart.ctx,source,area);}}},beforeDatasetsDraw(chart,_args,options){if(options.drawTime!=='beforeDatasetsDraw'){return;}
const metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;if(_shouldApplyFill(source)){_drawfill(chart.ctx,source,chart.chartArea);}}},beforeDatasetDraw(chart,args,options){const source=args.meta.$filler;if(!_shouldApplyFill(source)||options.drawTime!=='beforeDatasetDraw'){return;}
_drawfill(chart.ctx,source,chart.chartArea);},defaults:{propagate:true,drawTime:'beforeDatasetDraw'}};const getBoxSize=(labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;if(labelOpts.usePointStyle){boxHeight=Math.min(boxHeight,fontSize);boxWidth=labelOpts.pointStyleWidth||Math.min(boxWidth,fontSize);}
return{boxWidth,boxHeight,itemHeight:Math.max(fontSize,boxHeight)};};const itemsEqual=(a,b)=>a!==null&&b!==null&&a.datasetIndex===b.datasetIndex&&a.index===b.index;class Legend extends Element{constructor(config){super();this._added=false;this.legendHitBoxes=[];this._hoveredItem=null;this.doughnutMode=false;this.chart=config.chart;this.options=config.options;this.ctx=config.ctx;this.legendItems=undefined;this.columnSizes=undefined;this.lineWidths=undefined;this.maxHeight=undefined;this.maxWidth=undefined;this.top=undefined;this.bottom=undefined;this.left=undefined;this.right=undefined;this.height=undefined;this.width=undefined;this._margins=undefined;this.position=undefined;this.weight=undefined;this.fullSize=undefined;}
update(maxWidth,maxHeight,margins){this.maxWidth=maxWidth;this.maxHeight=maxHeight;this._margins=margins;this.setDimensions();this.buildLabels();this.fit();}
setDimensions(){if(this.isHorizontal()){this.width=this.maxWidth;this.left=this._margins.left;this.right=this.width;}else{this.height=this.maxHeight;this.top=this._margins.top;this.bottom=this.height;}}
@ -2326,7 +2327,7 @@ hitbox.top=top;hitbox.left+=this.left+padding;hitbox.left=rtlHelper.leftForLtr(r
isHorizontal(){return this.options.position==='top'||this.options.position==='bottom';}
draw(){if(this.options.display){const ctx=this.ctx;clipArea(ctx,this);this._draw();unclipArea(ctx);}}
_draw(){const{options:opts,columnSizes,lineWidths,ctx}=this;const{align,labels:labelOpts}=opts;const defaultColor=defaults.color;const rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width);const labelFont=toFont(labelOpts.font);const{color:fontColor,padding}=labelOpts;const fontSize=labelFont.size;const halfFontSize=fontSize/2;let cursor;this.drawTitle();ctx.textAlign=rtlHelper.textAlign('left');ctx.textBaseline='middle';ctx.lineWidth=0.5;ctx.font=labelFont.string;const{boxWidth,boxHeight,itemHeight}=getBoxSize(labelOpts,fontSize);const drawLegendBox=function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0){return;}
ctx.save();const lineWidth=valueOrDefault(legendItem.lineWidth,1);ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor);ctx.lineCap=valueOrDefault(legendItem.lineCap,'butt');ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0);ctx.lineJoin=valueOrDefault(legendItem.lineJoin,'miter');ctx.lineWidth=lineWidth;ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor);ctx.setLineDash(valueOrDefault(legendItem.lineDash,[]));if(labelOpts.usePointStyle){const drawOptions={radius:boxWidth*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth};const centerX=rtlHelper.xPlus(x,boxWidth/2);const centerY=y+halfFontSize;drawPoint(ctx,drawOptions,centerX,centerY);}else{const yBoxTop=y+Math.max((fontSize-boxHeight)/2,0);const xBoxLeft=rtlHelper.leftForLtr(x,boxWidth);const borderRadius=toTRBLCorners(legendItem.borderRadius);ctx.beginPath();if(Object.values(borderRadius).some(v=>v!==0)){addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius,});}else{ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight);}
ctx.save();const lineWidth=valueOrDefault(legendItem.lineWidth,1);ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor);ctx.lineCap=valueOrDefault(legendItem.lineCap,'butt');ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0);ctx.lineJoin=valueOrDefault(legendItem.lineJoin,'miter');ctx.lineWidth=lineWidth;ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor);ctx.setLineDash(valueOrDefault(legendItem.lineDash,[]));if(labelOpts.usePointStyle){const drawOptions={radius:boxHeight*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth};const centerX=rtlHelper.xPlus(x,boxWidth/2);const centerY=y+halfFontSize;drawPointLegend(ctx,drawOptions,centerX,centerY,boxWidth);}else{const yBoxTop=y+Math.max((fontSize-boxHeight)/2,0);const xBoxLeft=rtlHelper.leftForLtr(x,boxWidth);const borderRadius=toTRBLCorners(legendItem.borderRadius);ctx.beginPath();if(Object.values(borderRadius).some(v=>v!==0)){addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius,});}else{ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight);}
ctx.fill();if(lineWidth!==0){ctx.stroke();}}
ctx.restore();};const fillText=function(x,y,legendItem){renderText(ctx,legendItem.text,x,y+(itemHeight/2),labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)});};const isHorizontal=this.isHorizontal();const titleHeight=this._computeTitleHeight();if(isHorizontal){cursor={x:_alignStartEnd(align,this.left+padding,this.right-lineWidths[0]),y:this.top+padding+titleHeight,line:0};}else{cursor={x:this.left+padding,y:_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[0].height),line:0};}
overrideTextDirection(this.ctx,opts.textDirection);const lineHeight=itemHeight+padding;this.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor||fontColor;ctx.fillStyle=legendItem.fontColor||fontColor;const textWidth=ctx.measureText(legendItem.text).width;const textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign));const width=boxWidth+halfFontSize+textWidth;let x=cursor.x;let y=cursor.y;rtlHelper.setWidth(this.width);if(isHorizontal){if(i>0&&x+width+padding>this.right){y=cursor.y+=lineHeight;cursor.line++;x=cursor.x=_alignStartEnd(align,this.left+padding,this.right-lineWidths[cursor.line]);}}else if(i>0&&y+lineHeight>this.bottom){x=cursor.x=x+columnSizes[cursor.line].width+padding;cursor.line++;y=cursor.y=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[cursor.line].height);}
@ -2416,7 +2417,7 @@ if(yAlign==='top'){y1=ptY;y2=y1-caretSize;x1=x2-caretSize;x3=x2+caretSize;}else{
y3=y1;}
return{x1,x2,x3,y1,y2,y3};}
drawTitle(pt,ctx,options){const title=this.title;const length=title.length;let titleFont,titleSpacing,i;if(length){const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);pt.x=getAlignedX(this,options.titleAlign,options);ctx.textAlign=rtlHelper.textAlign(options.titleAlign);ctx.textBaseline='middle';titleFont=toFont(options.titleFont);titleSpacing=options.titleSpacing;ctx.fillStyle=options.titleColor;ctx.font=titleFont.string;for(i=0;i<length;++i){ctx.fillText(title[i],rtlHelper.x(pt.x),pt.y+titleFont.lineHeight/2);pt.y+=titleFont.lineHeight+titleSpacing;if(i+1===length){pt.y+=options.titleMarginBottom-titleSpacing;}}}}
_drawColorBox(ctx,pt,i,rtlHelper,options){const labelColors=this.labelColors[i];const labelPointStyle=this.labelPointStyles[i];const{boxHeight,boxWidth,boxPadding}=options;const bodyFont=toFont(options.bodyFont);const colorX=getAlignedX(this,'left',options);const rtlColorX=rtlHelper.x(colorX);const yOffSet=boxHeight<bodyFont.lineHeight?(bodyFont.lineHeight-boxHeight)/2:0;const colorY=pt.y+yOffSet;if(options.usePointStyle){const drawOptions={radius:Math.min(boxWidth,boxHeight)/2,pointStyle:labelPointStyle.pointStyle,rotation:labelPointStyle.rotation,borderWidth:1};const centerX=rtlHelper.leftForLtr(rtlColorX,boxWidth)+boxWidth/2;const centerY=colorY+boxHeight/2;ctx.strokeStyle=options.multiKeyBackground;ctx.fillStyle=options.multiKeyBackground;drawPoint(ctx,drawOptions,centerX,centerY);ctx.strokeStyle=labelColors.borderColor;ctx.fillStyle=labelColors.backgroundColor;drawPoint(ctx,drawOptions,centerX,centerY);}else{ctx.lineWidth=labelColors.borderWidth||1;ctx.strokeStyle=labelColors.borderColor;ctx.setLineDash(labelColors.borderDash||[]);ctx.lineDashOffset=labelColors.borderDashOffset||0;const outerX=rtlHelper.leftForLtr(rtlColorX,boxWidth-boxPadding);const innerX=rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX,1),boxWidth-boxPadding-2);const borderRadius=toTRBLCorners(labelColors.borderRadius);if(Object.values(borderRadius).some(v=>v!==0)){ctx.beginPath();ctx.fillStyle=options.multiKeyBackground;addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius,});ctx.fill();ctx.stroke();ctx.fillStyle=labelColors.backgroundColor;ctx.beginPath();addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius,});ctx.fill();}else{ctx.fillStyle=options.multiKeyBackground;ctx.fillRect(outerX,colorY,boxWidth,boxHeight);ctx.strokeRect(outerX,colorY,boxWidth,boxHeight);ctx.fillStyle=labelColors.backgroundColor;ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2);}}
_drawColorBox(ctx,pt,i,rtlHelper,options){const labelColors=this.labelColors[i];const labelPointStyle=this.labelPointStyles[i];const{boxHeight,boxWidth,boxPadding}=options;const bodyFont=toFont(options.bodyFont);const colorX=getAlignedX(this,'left',options);const rtlColorX=rtlHelper.x(colorX);const yOffSet=boxHeight<bodyFont.lineHeight?(bodyFont.lineHeight-boxHeight)/2:0;const colorY=pt.y+yOffSet;if(options.usePointStyle){const drawOptions={radius:Math.min(boxWidth,boxHeight)/2,pointStyle:labelPointStyle.pointStyle,rotation:labelPointStyle.rotation,borderWidth:1};const centerX=rtlHelper.leftForLtr(rtlColorX,boxWidth)+boxWidth/2;const centerY=colorY+boxHeight/2;ctx.strokeStyle=options.multiKeyBackground;ctx.fillStyle=options.multiKeyBackground;drawPoint(ctx,drawOptions,centerX,centerY);ctx.strokeStyle=labelColors.borderColor;ctx.fillStyle=labelColors.backgroundColor;drawPoint(ctx,drawOptions,centerX,centerY);}else{ctx.lineWidth=isObject(labelColors.borderWidth)?Math.max(...Object.values(labelColors.borderWidth)):(labelColors.borderWidth||1);ctx.strokeStyle=labelColors.borderColor;ctx.setLineDash(labelColors.borderDash||[]);ctx.lineDashOffset=labelColors.borderDashOffset||0;const outerX=rtlHelper.leftForLtr(rtlColorX,boxWidth-boxPadding);const innerX=rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX,1),boxWidth-boxPadding-2);const borderRadius=toTRBLCorners(labelColors.borderRadius);if(Object.values(borderRadius).some(v=>v!==0)){ctx.beginPath();ctx.fillStyle=options.multiKeyBackground;addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius,});ctx.fill();ctx.stroke();ctx.fillStyle=labelColors.backgroundColor;ctx.beginPath();addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius,});ctx.fill();}else{ctx.fillStyle=options.multiKeyBackground;ctx.fillRect(outerX,colorY,boxWidth,boxHeight);ctx.strokeRect(outerX,colorY,boxWidth,boxHeight);ctx.fillStyle=labelColors.backgroundColor;ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2);}}
ctx.fillStyle=this.labelTextColors[i];}
drawBody(pt,ctx,options){const{body}=this;const{bodySpacing,bodyAlign,displayColors,boxHeight,boxWidth,boxPadding}=options;const bodyFont=toFont(options.bodyFont);let bodyLineHeight=bodyFont.lineHeight;let xLinePadding=0;const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);const fillLineOfText=function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2);pt.y+=bodyLineHeight+bodySpacing;};const bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);let bodyItem,textColor,lines,i,j,ilen,jlen;ctx.textAlign=bodyAlign;ctx.textBaseline='middle';ctx.font=bodyFont.string;pt.x=getAlignedX(this,bodyAlignForCalculation,options);ctx.fillStyle=options.bodyColor;each(this.beforeBody,fillLineOfText);xLinePadding=displayColors&&bodyAlignForCalculation!=='right'?bodyAlign==='center'?(boxWidth/2+boxPadding):(boxWidth+2+boxPadding):0;for(i=0,ilen=body.length;i<ilen;++i){bodyItem=body[i];textColor=this.labelTextColors[i];ctx.fillStyle=textColor;each(bodyItem.before,fillLineOfText);lines=bodyItem.lines;if(displayColors&&lines.length){this._drawColorBox(ctx,pt,i,rtlHelper,options);bodyLineHeight=Math.max(bodyFont.lineHeight,boxHeight);}
for(j=0,jlen=lines.length;j<jlen;++j){fillLineOfText(lines[j]);bodyLineHeight=bodyFont.lineHeight;}
@ -2803,21 +2804,22 @@ this.__rules__.forEach((function(rule){rule.enabled=false;}));this.enable(list,i
var result=[];list.forEach((function(name){var idx=this.__find__(name);if(idx<0){if(ignoreInvalid){return;}
throw new Error("Rules manager: invalid rule name "+name);}
this.__rules__[idx].enabled=false;result.push(name);}),this);this.__cache__=null;return result;};Ruler.prototype.getRules=function(chainName){if(this.__cache__===null){this.__compile__();}
return this.__cache__[chainName]||[];};var ruler=Ruler;var NEWLINES_RE=/\r\n?|\n/g;var NULL_RE=/\0/g;var normalize=function normalize(state){var str;str=state.src.replace(NEWLINES_RE,"\n");str=str.replace(NULL_RE,"\ufffd");state.src=str;};var block=function block(state){var token;if(state.inlineMode){token=new state.Token("inline","",0);token.content=state.src;token.map=[0,1];token.children=[];state.tokens.push(token);}else{state.md.block.parse(state.src,state.md,state.env,state.tokens);}};var inline=function inline(state){var tokens=state.tokens,tok,i,l;for(i=0,l=tokens.length;i<l;i++){tok=tokens[i];if(tok.type==="inline"){state.md.inline.parse(tok.content,state.md,state.env,tok.children);}}};var arrayReplaceAt=utils.arrayReplaceAt;function isLinkOpen(str){return/^<a[>\s]/i.test(str);}
function isLinkClose(str){return/^<\/a\s*>/i.test(str);}
var linkify=function linkify(state){var i,j,l,tokens,token,currentToken,nodes,ln,text,pos,lastPos,level,htmlLinkLevel,url,fullUrl,urlText,blockTokens=state.tokens,links;if(!state.md.options.linkify){return;}
return this.__cache__[chainName]||[];};var ruler=Ruler;var NEWLINES_RE=/\r\n?|\n/g;var NULL_RE=/\0/g;var normalize=function normalize(state){var str;str=state.src.replace(NEWLINES_RE,"\n");str=str.replace(NULL_RE,"\ufffd");state.src=str;};var block=function block(state){var token;if(state.inlineMode){token=new state.Token("inline","",0);token.content=state.src;token.map=[0,1];token.children=[];state.tokens.push(token);}else{state.md.block.parse(state.src,state.md,state.env,state.tokens);}};var inline=function inline(state){var tokens=state.tokens,tok,i,l;for(i=0,l=tokens.length;i<l;i++){tok=tokens[i];if(tok.type==="inline"){state.md.inline.parse(tok.content,state.md,state.env,tok.children);}}};var arrayReplaceAt=utils.arrayReplaceAt;function isLinkOpen$1(str){return/^<a[>\s]/i.test(str);}
function isLinkClose$1(str){return/^<\/a\s*>/i.test(str);}
var linkify$1=function linkify(state){var i,j,l,tokens,token,currentToken,nodes,ln,text,pos,lastPos,level,htmlLinkLevel,url,fullUrl,urlText,blockTokens=state.tokens,links;if(!state.md.options.linkify){return;}
for(j=0,l=blockTokens.length;j<l;j++){if(blockTokens[j].type!=="inline"||!state.md.linkify.pretest(blockTokens[j].content)){continue;}
tokens=blockTokens[j].children;htmlLinkLevel=0;for(i=tokens.length-1;i>=0;i--){currentToken=tokens[i];if(currentToken.type==="link_close"){i--;while(tokens[i].level!==currentToken.level&&tokens[i].type!=="link_open"){i--;}
continue;}
if(currentToken.type==="html_inline"){if(isLinkOpen(currentToken.content)&&htmlLinkLevel>0){htmlLinkLevel--;}
if(isLinkClose(currentToken.content)){htmlLinkLevel++;}}
if(currentToken.type==="html_inline"){if(isLinkOpen$1(currentToken.content)&&htmlLinkLevel>0){htmlLinkLevel--;}
if(isLinkClose$1(currentToken.content)){htmlLinkLevel++;}}
if(htmlLinkLevel>0){continue;}
if(currentToken.type==="text"&&state.md.linkify.test(currentToken.content)){text=currentToken.content;links=state.md.linkify.match(text);nodes=[];level=currentToken.level;lastPos=0;for(ln=0;ln<links.length;ln++){url=links[ln].url;fullUrl=state.md.normalizeLink(url);if(!state.md.validateLink(fullUrl)){continue;}
if(currentToken.type==="text"&&state.md.linkify.test(currentToken.content)){text=currentToken.content;links=state.md.linkify.match(text);nodes=[];level=currentToken.level;lastPos=0;if(links.length>0&&links[0].index===0&&i>0&&tokens[i-1].type==="text_special"){links=links.slice(1);}
for(ln=0;ln<links.length;ln++){url=links[ln].url;fullUrl=state.md.normalizeLink(url);if(!state.md.validateLink(fullUrl)){continue;}
urlText=links[ln].text;if(!links[ln].schema){urlText=state.md.normalizeLinkText("http://"+urlText).replace(/^http:\/\//,"");}else if(links[ln].schema==="mailto:"&&!/^mailto:/i.test(urlText)){urlText=state.md.normalizeLinkText("mailto:"+urlText).replace(/^mailto:/,"");}else{urlText=state.md.normalizeLinkText(urlText);}
pos=links[ln].index;if(pos>lastPos){token=new state.Token("text","",0);token.content=text.slice(lastPos,pos);token.level=level;nodes.push(token);}
token=new state.Token("link_open","a",1);token.attrs=[["href",fullUrl]];token.level=level++;token.markup="linkify";token.info="auto";nodes.push(token);token=new state.Token("text","",0);token.content=urlText;token.level=level;nodes.push(token);token=new state.Token("link_close","a",-1);token.level=--level;token.markup="linkify";token.info="auto";nodes.push(token);lastPos=links[ln].lastIndex;}
if(lastPos<text.length){token=new state.Token("text","",0);token.content=text.slice(lastPos);token.level=level;nodes.push(token);}
blockTokens[j].children=tokens=arrayReplaceAt(tokens,i,nodes);}}}};var RARE_RE=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/;var SCOPED_ABBR_TEST_RE=/\((c|tm|r|p)\)/i;var SCOPED_ABBR_RE=/\((c|tm|r|p)\)/gi;var SCOPED_ABBR={c:"\xa9",r:"\xae",p:"\xa7",tm:"\u2122"};function replaceFn(match,name){return SCOPED_ABBR[name.toLowerCase()];}
blockTokens[j].children=tokens=arrayReplaceAt(tokens,i,nodes);}}}};var RARE_RE=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/;var SCOPED_ABBR_TEST_RE=/\((c|tm|r)\)/i;var SCOPED_ABBR_RE=/\((c|tm|r)\)/gi;var SCOPED_ABBR={c:"\xa9",r:"\xae",tm:"\u2122"};function replaceFn(match,name){return SCOPED_ABBR[name.toLowerCase()];}
function replace_scoped(inlineTokens){var i,token,inside_autolink=0;for(i=inlineTokens.length-1;i>=0;i--){token=inlineTokens[i];if(token.type==="text"&&!inside_autolink){token.content=token.content.replace(SCOPED_ABBR_RE,replaceFn);}
if(token.type==="link_open"&&token.info==="auto"){inside_autolink--;}
if(token.type==="link_close"&&token.info==="auto"){inside_autolink++;}}}
@ -2827,7 +2829,7 @@ if(token.type==="link_close"&&token.info==="auto"){inside_autolink++;}}}
var replacements=function replace(state){var blkIdx;if(!state.md.options.typographer){return;}
for(blkIdx=state.tokens.length-1;blkIdx>=0;blkIdx--){if(state.tokens[blkIdx].type!=="inline"){continue;}
if(SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)){replace_scoped(state.tokens[blkIdx].children);}
if(RARE_RE.test(state.tokens[blkIdx].content)){replace_rare(state.tokens[blkIdx].children);}}};var isWhiteSpace$1=utils.isWhiteSpace;var isPunctChar$1=utils.isPunctChar;var isMdAsciiPunct$1=utils.isMdAsciiPunct;var QUOTE_TEST_RE=/['"]/;var QUOTE_RE=/['"]/g;var APOSTROPHE="\u2019";function replaceAt(str,index,ch){return str.substr(0,index)+ch+str.substr(index+1);}
if(RARE_RE.test(state.tokens[blkIdx].content)){replace_rare(state.tokens[blkIdx].children);}}};var isWhiteSpace$1=utils.isWhiteSpace;var isPunctChar$1=utils.isPunctChar;var isMdAsciiPunct$1=utils.isMdAsciiPunct;var QUOTE_TEST_RE=/['"]/;var QUOTE_RE=/['"]/g;var APOSTROPHE="\u2019";function replaceAt(str,index,ch){return str.slice(0,index)+ch+str.slice(index+1);}
function process_inlines(tokens,state){var i,token,text,t,pos,max,thisLevel,item,lastChar,nextChar,isLastPunctChar,isNextPunctChar,isLastWhiteSpace,isNextWhiteSpace,canOpen,canClose,j,isSingle,stack,openQuote,closeQuote;stack=[];for(i=0;i<tokens.length;i++){token=tokens[i];thisLevel=tokens[i].level;for(j=stack.length-1;j>=0;j--){if(stack[j].level<=thisLevel){break;}}
stack.length=j+1;if(token.type!=="text"){continue;}
text=token.content;pos=0;max=text.length;OUTER:while(pos<max){QUOTE_RE.lastIndex=pos;t=QUOTE_RE.exec(text);if(!t){break;}
@ -2846,13 +2848,16 @@ text=token.content;max=text.length;stack.length=j;continue OUTER;}}}
if(canOpen){stack.push({token:i,pos:t.index,single:isSingle,level:thisLevel});}else if(canClose&&isSingle){token.content=replaceAt(token.content,t.index,APOSTROPHE);}}}}
var smartquotes=function smartquotes(state){var blkIdx;if(!state.md.options.typographer){return;}
for(blkIdx=state.tokens.length-1;blkIdx>=0;blkIdx--){if(state.tokens[blkIdx].type!=="inline"||!QUOTE_TEST_RE.test(state.tokens[blkIdx].content)){continue;}
process_inlines(state.tokens[blkIdx].children,state);}};function Token(type,tag,nesting){this.type=type;this.tag=tag;this.attrs=null;this.map=null;this.nesting=nesting;this.level=0;this.children=null;this.content="";this.markup="";this.info="";this.meta=null;this.block=false;this.hidden=false;}
process_inlines(state.tokens[blkIdx].children,state);}};var text_join=function text_join(state){var j,l,tokens,curr,max,last,blockTokens=state.tokens;for(j=0,l=blockTokens.length;j<l;j++){if(blockTokens[j].type!=="inline")continue;tokens=blockTokens[j].children;max=tokens.length;for(curr=0;curr<max;curr++){if(tokens[curr].type==="text_special"){tokens[curr].type="text";}}
for(curr=last=0;curr<max;curr++){if(tokens[curr].type==="text"&&curr+1<max&&tokens[curr+1].type==="text"){tokens[curr+1].content=tokens[curr].content+tokens[curr+1].content;}else{if(curr!==last){tokens[last]=tokens[curr];}
last++;}}
if(curr!==last){tokens.length=last;}}};function Token(type,tag,nesting){this.type=type;this.tag=tag;this.attrs=null;this.map=null;this.nesting=nesting;this.level=0;this.children=null;this.content="";this.markup="";this.info="";this.meta=null;this.block=false;this.hidden=false;}
Token.prototype.attrIndex=function attrIndex(name){var attrs,i,len;if(!this.attrs){return-1;}
attrs=this.attrs;for(i=0,len=attrs.length;i<len;i++){if(attrs[i][0]===name){return i;}}
return-1;};Token.prototype.attrPush=function attrPush(attrData){if(this.attrs){this.attrs.push(attrData);}else{this.attrs=[attrData];}};Token.prototype.attrSet=function attrSet(name,value){var idx=this.attrIndex(name),attrData=[name,value];if(idx<0){this.attrPush(attrData);}else{this.attrs[idx]=attrData;}};Token.prototype.attrGet=function attrGet(name){var idx=this.attrIndex(name),value=null;if(idx>=0){value=this.attrs[idx][1];}
return value;};Token.prototype.attrJoin=function attrJoin(name,value){var idx=this.attrIndex(name);if(idx<0){this.attrPush([name,value]);}else{this.attrs[idx][1]=this.attrs[idx][1]+" "+value;}};var token=Token;function StateCore(src,md,env){this.src=src;this.env=env;this.tokens=[];this.inlineMode=false;this.md=md;}
StateCore.prototype.Token=token;var state_core=StateCore;var _rules$2=[["normalize",normalize],["block",block],["inline",inline],["linkify",linkify],["replacements",replacements],["smartquotes",smartquotes]];function Core(){this.ruler=new ruler;for(var i=0;i<_rules$2.length;i++){this.ruler.push(_rules$2[i][0],_rules$2[i][1]);}}
Core.prototype.process=function(state){var i,l,rules;rules=this.ruler.getRules("");for(i=0,l=rules.length;i<l;i++){rules[i](state);}};Core.prototype.State=state_core;var parser_core=Core;var isSpace$a=utils.isSpace;function getLine(state,line){var pos=state.bMarks[line]+state.tShift[line],max=state.eMarks[line];return state.src.substr(pos,max-pos);}
StateCore.prototype.Token=token;var state_core=StateCore;var _rules$2=[["normalize",normalize],["block",block],["inline",inline],["linkify",linkify$1],["replacements",replacements],["smartquotes",smartquotes],["text_join",text_join]];function Core(){this.ruler=new ruler;for(var i=0;i<_rules$2.length;i++){this.ruler.push(_rules$2[i][0],_rules$2[i][1]);}}
Core.prototype.process=function(state){var i,l,rules;rules=this.ruler.getRules("");for(i=0,l=rules.length;i<l;i++){rules[i](state);}};Core.prototype.State=state_core;var parser_core=Core;var isSpace$a=utils.isSpace;function getLine(state,line){var pos=state.bMarks[line]+state.tShift[line],max=state.eMarks[line];return state.src.slice(pos,max);}
function escapedSplit(str){var result=[],pos=0,max=str.length,ch,isEscaped=false,lastPos=0,current="";ch=str.charCodeAt(pos);while(pos<max){if(ch===124){if(!isEscaped){result.push(current+str.substring(lastPos,pos));current="";lastPos=pos+1;}else{current+=str.substring(lastPos,pos-1);lastPos=pos;}}
isEscaped=ch===92;pos++;ch=str.charCodeAt(pos);}
result.push(current+str.substring(lastPos));return result;}
@ -3041,18 +3046,17 @@ state=new this.State(src,md,env,outTokens);this.tokenize(state,state.line,state.
var text=function text(state,silent){var pos=state.pos;while(pos<state.posMax&&!isTerminatorChar(state.src.charCodeAt(pos))){pos++;}
if(pos===state.pos){return false;}
if(!silent){state.pending+=state.src.slice(state.pos,pos);}
state.pos=pos;return true;};var isSpace$3=utils.isSpace;var newline=function newline(state,silent){var pmax,max,ws,pos=state.pos;if(state.src.charCodeAt(pos)!==10){return false;}
state.pos=pos;return true;};var SCHEME_RE=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;var linkify=function linkify(state,silent){var pos,max,match,proto,link,url,fullUrl,token;if(!state.md.options.linkify)return false;if(state.linkLevel>0)return false;pos=state.pos;max=state.posMax;if(pos+3>max)return false;if(state.src.charCodeAt(pos)!==58)return false;if(state.src.charCodeAt(pos+1)!==47)return false;if(state.src.charCodeAt(pos+2)!==47)return false;match=state.pending.match(SCHEME_RE);if(!match)return false;proto=match[1];link=state.md.linkify.matchAtStart(state.src.slice(pos-proto.length));if(!link)return false;url=link.url;url=url.replace(/\*+$/,"");fullUrl=state.md.normalizeLink(url);if(!state.md.validateLink(fullUrl))return false;if(!silent){state.pending=state.pending.slice(0,-proto.length);token=state.push("link_open","a",1);token.attrs=[["href",fullUrl]];token.markup="linkify";token.info="auto";token=state.push("text","",0);token.content=state.md.normalizeLinkText(url);token=state.push("link_close","a",-1);token.markup="linkify";token.info="auto";}
state.pos+=url.length-proto.length;return true;};var isSpace$3=utils.isSpace;var newline=function newline(state,silent){var pmax,max,ws,pos=state.pos;if(state.src.charCodeAt(pos)!==10){return false;}
pmax=state.pending.length-1;max=state.posMax;if(!silent){if(pmax>=0&&state.pending.charCodeAt(pmax)===32){if(pmax>=1&&state.pending.charCodeAt(pmax-1)===32){ws=pmax-1;while(ws>=1&&state.pending.charCodeAt(ws-1)===32)ws--;state.pending=state.pending.slice(0,ws);state.push("hardbreak","br",0);}else{state.pending=state.pending.slice(0,-1);state.push("softbreak","br",0);}}else{state.push("softbreak","br",0);}}
pos++;while(pos<max&&isSpace$3(state.src.charCodeAt(pos))){pos++;}
state.pos=pos;return true;};var isSpace$2=utils.isSpace;var ESCAPED=[];for(var i=0;i<256;i++){ESCAPED.push(0);}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(ch){ESCAPED[ch.charCodeAt(0)]=1;}));var _escape=function escape(state,silent){var ch,pos=state.pos,max=state.posMax;if(state.src.charCodeAt(pos)!==92){return false;}
pos++;if(pos<max){ch=state.src.charCodeAt(pos);if(ch<256&&ESCAPED[ch]!==0){if(!silent){state.pending+=state.src[pos];}
state.pos+=2;return true;}
if(ch===10){if(!silent){state.push("hardbreak","br",0);}
pos++;while(pos<max){ch=state.src.charCodeAt(pos);if(!isSpace$2(ch)){break;}
pos++;}
state.pos=pos;return true;}}
if(!silent){state.pending+="\\";}
state.pos++;return true;};var backticks=function backtick(state,silent){var start,max,marker,token,matchStart,matchEnd,openerLength,closerLength,pos=state.pos,ch=state.src.charCodeAt(pos);if(ch!==96){return false;}
state.pos=pos;return true;};var isSpace$2=utils.isSpace;var ESCAPED=[];for(var i=0;i<256;i++){ESCAPED.push(0);}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(ch){ESCAPED[ch.charCodeAt(0)]=1;}));var _escape=function escape(state,silent){var ch1,ch2,origStr,escapedStr,token,pos=state.pos,max=state.posMax;if(state.src.charCodeAt(pos)!==92)return false;pos++;if(pos>=max)return false;ch1=state.src.charCodeAt(pos);if(ch1===10){if(!silent){state.push("hardbreak","br",0);}
pos++;while(pos<max){ch1=state.src.charCodeAt(pos);if(!isSpace$2(ch1))break;pos++;}
state.pos=pos;return true;}
escapedStr=state.src[pos];if(ch1>=55296&&ch1<=56319&&pos+1<max){ch2=state.src.charCodeAt(pos+1);if(ch2>=56320&&ch2<=57343){escapedStr+=state.src[pos+1];pos++;}}
origStr="\\"+escapedStr;if(!silent){token=state.push("text_special","",0);if(ch1<256&&ESCAPED[ch1]!==0){token.content=escapedStr;}else{token.content=origStr;}
token.markup=origStr;token.info="escape";}
state.pos=pos+1;return true;};var backticks=function backtick(state,silent){var start,max,marker,token,matchStart,matchEnd,openerLength,closerLength,pos=state.pos,ch=state.src.charCodeAt(pos);if(ch!==96){return false;}
start=pos;pos++;max=state.posMax;while(pos<max&&state.src.charCodeAt(pos)===96){pos++;}
marker=state.src.slice(start,pos);openerLength=marker.length;if(state.backticksScanned&&(state.backticks[openerLength]||0)<=start){if(!silent)state.pending+=marker;state.pos+=openerLength;return true;}
matchStart=matchEnd=pos;while((matchStart=state.src.indexOf("`",matchEnd))!==-1){matchEnd=matchStart+1;while(matchEnd<max&&state.src.charCodeAt(matchEnd)===96){matchEnd++;}
@ -3090,7 +3094,7 @@ if(!label){label=state.src.slice(labelStart,labelEnd);}
ref=state.env.references[normalizeReference$1(label)];if(!ref){state.pos=oldPos;return false;}
href=ref.href;title=ref.title;}
if(!silent){state.pos=labelStart;state.posMax=labelEnd;token=state.push("link_open","a",1);token.attrs=attrs=[["href",href]];if(title){attrs.push(["title",title]);}
state.md.inline.tokenize(state);token=state.push("link_close","a",-1);}
state.linkLevel++;state.md.inline.tokenize(state);state.linkLevel--;token=state.push("link_close","a",-1);}
state.pos=pos;state.posMax=max;return true;};var normalizeReference=utils.normalizeReference;var isSpace=utils.isSpace;var image=function image(state,silent){var attrs,code,content,label,labelEnd,labelStart,pos,ref,res,title,token,tokens,start,href="",oldPos=state.pos,max=state.posMax;if(state.src.charCodeAt(state.pos)!==33){return false;}
if(state.src.charCodeAt(state.pos+1)!==91){return false;}
labelStart=state.pos+2;labelEnd=state.md.helpers.parseLinkLabel(state,state.pos+1,false);if(labelEnd<0){return false;}
@ -3114,25 +3118,25 @@ state.pos+=url.length+2;return true;}
if(EMAIL_RE.test(url)){fullUrl=state.md.normalizeLink("mailto:"+url);if(!state.md.validateLink(fullUrl)){return false;}
if(!silent){token=state.push("link_open","a",1);token.attrs=[["href",fullUrl]];token.markup="autolink";token.info="auto";token=state.push("text","",0);token.content=state.md.normalizeLinkText(url);token=state.push("link_close","a",-1);token.markup="autolink";token.info="auto";}
state.pos+=url.length+2;return true;}
return false;};var HTML_TAG_RE=html_re.HTML_TAG_RE;function isLetter(ch){var lc=ch|32;return lc>=97&&lc<=122;}
return false;};var HTML_TAG_RE=html_re.HTML_TAG_RE;function isLinkOpen(str){return/^<a[>\s]/i.test(str);}
function isLinkClose(str){return/^<\/a\s*>/i.test(str);}
function isLetter(ch){var lc=ch|32;return lc>=97&&lc<=122;}
var html_inline=function html_inline(state,silent){var ch,match,max,token,pos=state.pos;if(!state.md.options.html){return false;}
max=state.posMax;if(state.src.charCodeAt(pos)!==60||pos+2>=max){return false;}
ch=state.src.charCodeAt(pos+1);if(ch!==33&&ch!==63&&ch!==47&&!isLetter(ch)){return false;}
match=state.src.slice(pos).match(HTML_TAG_RE);if(!match){return false;}
if(!silent){token=state.push("html_inline","",0);token.content=state.src.slice(pos,pos+match[0].length);}
state.pos+=match[0].length;return true;};var has=utils.has;var isValidEntityCode=utils.isValidEntityCode;var fromCodePoint=utils.fromCodePoint;var DIGITAL_RE=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;var NAMED_RE=/^&([a-z][a-z0-9]{1,31});/i;var entity=function entity(state,silent){var ch,code,match,pos=state.pos,max=state.posMax;if(state.src.charCodeAt(pos)!==38){return false;}
if(pos+1<max){ch=state.src.charCodeAt(pos+1);if(ch===35){match=state.src.slice(pos).match(DIGITAL_RE);if(match){if(!silent){code=match[1][0].toLowerCase()==="x"?parseInt(match[1].slice(1),16):parseInt(match[1],10);state.pending+=isValidEntityCode(code)?fromCodePoint(code):fromCodePoint(65533);}
state.pos+=match[0].length;return true;}}else{match=state.src.slice(pos).match(NAMED_RE);if(match){if(has(entities,match[1])){if(!silent){state.pending+=entities[match[1]];}
state.pos+=match[0].length;return true;}}}}
if(!silent){state.pending+="&";}
state.pos++;return true;};function processDelimiters(state,delimiters){var closerIdx,openerIdx,closer,opener,minOpenerIdx,newMinOpenerIdx,isOddMatch,lastJump,openersBottom={},max=delimiters.length;if(!max)return;var headerIdx=0;var lastTokenIdx=-2;var jumps=[];for(closerIdx=0;closerIdx<max;closerIdx++){closer=delimiters[closerIdx];jumps.push(0);if(delimiters[headerIdx].marker!==closer.marker||lastTokenIdx!==closer.token-1){headerIdx=closerIdx;}
if(!silent){token=state.push("html_inline","",0);token.content=state.src.slice(pos,pos+match[0].length);if(isLinkOpen(token.content))state.linkLevel++;if(isLinkClose(token.content))state.linkLevel--;}
state.pos+=match[0].length;return true;};var has=utils.has;var isValidEntityCode=utils.isValidEntityCode;var fromCodePoint=utils.fromCodePoint;var DIGITAL_RE=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;var NAMED_RE=/^&([a-z][a-z0-9]{1,31});/i;var entity=function entity(state,silent){var ch,code,match,token,pos=state.pos,max=state.posMax;if(state.src.charCodeAt(pos)!==38)return false;if(pos+1>=max)return false;ch=state.src.charCodeAt(pos+1);if(ch===35){match=state.src.slice(pos).match(DIGITAL_RE);if(match){if(!silent){code=match[1][0].toLowerCase()==="x"?parseInt(match[1].slice(1),16):parseInt(match[1],10);token=state.push("text_special","",0);token.content=isValidEntityCode(code)?fromCodePoint(code):fromCodePoint(65533);token.markup=match[0];token.info="entity";}
state.pos+=match[0].length;return true;}}else{match=state.src.slice(pos).match(NAMED_RE);if(match){if(has(entities,match[1])){if(!silent){token=state.push("text_special","",0);token.content=entities[match[1]];token.markup=match[0];token.info="entity";}
state.pos+=match[0].length;return true;}}}
return false;};function processDelimiters(state,delimiters){var closerIdx,openerIdx,closer,opener,minOpenerIdx,newMinOpenerIdx,isOddMatch,lastJump,openersBottom={},max=delimiters.length;if(!max)return;var headerIdx=0;var lastTokenIdx=-2;var jumps=[];for(closerIdx=0;closerIdx<max;closerIdx++){closer=delimiters[closerIdx];jumps.push(0);if(delimiters[headerIdx].marker!==closer.marker||lastTokenIdx!==closer.token-1){headerIdx=closerIdx;}
lastTokenIdx=closer.token;closer.length=closer.length||0;if(!closer.close)continue;if(!openersBottom.hasOwnProperty(closer.marker)){openersBottom[closer.marker]=[-1,-1,-1,-1,-1,-1];}
minOpenerIdx=openersBottom[closer.marker][(closer.open?3:0)+closer.length%3];openerIdx=headerIdx-jumps[headerIdx]-1;newMinOpenerIdx=openerIdx;for(;openerIdx>minOpenerIdx;openerIdx-=jumps[openerIdx]+1){opener=delimiters[openerIdx];if(opener.marker!==closer.marker)continue;if(opener.open&&opener.end<0){isOddMatch=false;if(opener.close||closer.open){if((opener.length+closer.length)%3===0){if(opener.length%3!==0||closer.length%3!==0){isOddMatch=true;}}}
if(!isOddMatch){lastJump=openerIdx>0&&!delimiters[openerIdx-1].open?jumps[openerIdx-1]+1:0;jumps[closerIdx]=closerIdx-openerIdx+lastJump;jumps[openerIdx]=lastJump;closer.open=false;opener.end=closerIdx;opener.close=false;newMinOpenerIdx=-1;lastTokenIdx=-2;break;}}}
if(newMinOpenerIdx!==-1){openersBottom[closer.marker][(closer.open?3:0)+(closer.length||0)%3]=newMinOpenerIdx;}}}
var balance_pairs=function link_pairs(state){var curr,tokens_meta=state.tokens_meta,max=state.tokens_meta.length;processDelimiters(state,state.delimiters);for(curr=0;curr<max;curr++){if(tokens_meta[curr]&&tokens_meta[curr].delimiters){processDelimiters(state,tokens_meta[curr].delimiters);}}};var text_collapse=function text_collapse(state){var curr,last,level=0,tokens=state.tokens,max=state.tokens.length;for(curr=last=0;curr<max;curr++){if(tokens[curr].nesting<0)level--;tokens[curr].level=level;if(tokens[curr].nesting>0)level++;if(tokens[curr].type==="text"&&curr+1<max&&tokens[curr+1].type==="text"){tokens[curr+1].content=tokens[curr].content+tokens[curr+1].content;}else{if(curr!==last){tokens[last]=tokens[curr];}
var balance_pairs=function link_pairs(state){var curr,tokens_meta=state.tokens_meta,max=state.tokens_meta.length;processDelimiters(state,state.delimiters);for(curr=0;curr<max;curr++){if(tokens_meta[curr]&&tokens_meta[curr].delimiters){processDelimiters(state,tokens_meta[curr].delimiters);}}};var fragments_join=function fragments_join(state){var curr,last,level=0,tokens=state.tokens,max=state.tokens.length;for(curr=last=0;curr<max;curr++){if(tokens[curr].nesting<0)level--;tokens[curr].level=level;if(tokens[curr].nesting>0)level++;if(tokens[curr].type==="text"&&curr+1<max&&tokens[curr+1].type==="text"){tokens[curr+1].content=tokens[curr].content+tokens[curr+1].content;}else{if(curr!==last){tokens[last]=tokens[curr];}
last++;}}
if(curr!==last){tokens.length=last;}};var isWhiteSpace=utils.isWhiteSpace;var isPunctChar=utils.isPunctChar;var isMdAsciiPunct=utils.isMdAsciiPunct;function StateInline(src,md,env,outTokens){this.src=src;this.env=env;this.md=md;this.tokens=outTokens;this.tokens_meta=Array(outTokens.length);this.pos=0;this.posMax=this.src.length;this.level=0;this.pending="";this.pendingLevel=0;this.cache={};this.delimiters=[];this._prev_delimiters=[];this.backticks={};this.backticksScanned=false;}
if(curr!==last){tokens.length=last;}};var isWhiteSpace=utils.isWhiteSpace;var isPunctChar=utils.isPunctChar;var isMdAsciiPunct=utils.isMdAsciiPunct;function StateInline(src,md,env,outTokens){this.src=src;this.env=env;this.md=md;this.tokens=outTokens;this.tokens_meta=Array(outTokens.length);this.pos=0;this.posMax=this.src.length;this.level=0;this.pending="";this.pendingLevel=0;this.cache={};this.delimiters=[];this._prev_delimiters=[];this.backticks={};this.backticksScanned=false;this.linkLevel=0;}
StateInline.prototype.pushPending=function(){var token$1=new token("text","",0);token$1.content=this.pending;token$1.level=this.pendingLevel;this.tokens.push(token$1);this.pending="";return token$1;};StateInline.prototype.push=function(type,tag,nesting){if(this.pending){this.pushPending();}
var token$1=new token(type,tag,nesting);var token_meta=null;if(nesting<0){this.level--;this.delimiters=this._prev_delimiters.pop();}
token$1.level=this.level;if(nesting>0){this.level++;this._prev_delimiters.push(this.delimiters);this.delimiters=[];token_meta={delimiters:this.delimiters};}
@ -3140,7 +3144,7 @@ this.pendingLevel=this.level;this.tokens.push(token$1);this.tokens_meta.push(tok
count=pos-start;nextChar=pos<max?this.src.charCodeAt(pos):32;isLastPunctChar=isMdAsciiPunct(lastChar)||isPunctChar(String.fromCharCode(lastChar));isNextPunctChar=isMdAsciiPunct(nextChar)||isPunctChar(String.fromCharCode(nextChar));isLastWhiteSpace=isWhiteSpace(lastChar);isNextWhiteSpace=isWhiteSpace(nextChar);if(isNextWhiteSpace){left_flanking=false;}else if(isNextPunctChar){if(!(isLastWhiteSpace||isLastPunctChar)){left_flanking=false;}}
if(isLastWhiteSpace){right_flanking=false;}else if(isLastPunctChar){if(!(isNextWhiteSpace||isNextPunctChar)){right_flanking=false;}}
if(!canSplitWord){can_open=left_flanking&&(!right_flanking||isLastPunctChar);can_close=right_flanking&&(!left_flanking||isNextPunctChar);}else{can_open=left_flanking;can_close=right_flanking;}
return{can_open:can_open,can_close:can_close,length:count};};StateInline.prototype.Token=token;var state_inline=StateInline;var _rules=[["text",text],["newline",newline],["escape",_escape],["backticks",backticks],["strikethrough",strikethrough.tokenize],["emphasis",emphasis.tokenize],["link",link],["image",image],["autolink",autolink],["html_inline",html_inline],["entity",entity]];var _rules2=[["balance_pairs",balance_pairs],["strikethrough",strikethrough.postProcess],["emphasis",emphasis.postProcess],["text_collapse",text_collapse]];function ParserInline(){var i;this.ruler=new ruler;for(i=0;i<_rules.length;i++){this.ruler.push(_rules[i][0],_rules[i][1]);}
return{can_open:can_open,can_close:can_close,length:count};};StateInline.prototype.Token=token;var state_inline=StateInline;var _rules=[["text",text],["linkify",linkify],["newline",newline],["escape",_escape],["backticks",backticks],["strikethrough",strikethrough.tokenize],["emphasis",emphasis.tokenize],["link",link],["image",image],["autolink",autolink],["html_inline",html_inline],["entity",entity]];var _rules2=[["balance_pairs",balance_pairs],["strikethrough",strikethrough.postProcess],["emphasis",emphasis.postProcess],["fragments_join",fragments_join]];function ParserInline(){var i;this.ruler=new ruler;for(i=0;i<_rules.length;i++){this.ruler.push(_rules[i][0],_rules[i][1]);}
this.ruler2=new ruler;for(i=0;i<_rules2.length;i++){this.ruler2.push(_rules2[i][0],_rules2[i][1]);}}
ParserInline.prototype.skipToken=function(state){var ok,i,pos=state.pos,rules=this.ruler.getRules(""),len=rules.length,maxNesting=state.md.options.maxNesting,cache=state.cache;if(typeof cache[pos]!=="undefined"){state.pos=cache[pos];return;}
if(state.level<maxNesting){for(i=0;i<len;i++){state.level++;ok=rules[i](state,true);state.level--;if(ok){break;}}}else{state.pos=state.posMax;}
@ -3149,7 +3153,7 @@ cache[pos]=state.pos;};ParserInline.prototype.tokenize=function(state){var ok,i,
if(ok){if(state.pos>=end){break;}
continue;}
state.pending+=state.src[state.pos++];}
if(state.pending){state.pushPending();}};ParserInline.prototype.parse=function(str,md,env,outTokens){var i,rules,len;var state=new this.State(str,md,env,outTokens);this.tokenize(state);rules=this.ruler2.getRules("");len=rules.length;for(i=0;i<len;i++){rules[i](state);}};ParserInline.prototype.State=state_inline;var parser_inline=ParserInline;var re=function(opts){var re={};re.src_Any=regex$3.source;re.src_Cc=regex$2.source;re.src_Z=regex.source;re.src_P=regex$4.source;re.src_ZPCc=[re.src_Z,re.src_P,re.src_Cc].join("|");re.src_ZCc=[re.src_Z,re.src_Cc].join("|");var text_separators="[><\uff5c]";re.src_pseudo_letter="(?:(?!"+text_separators+"|"+re.src_ZPCc+")"+re.src_Any+")";re.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";re.src_auth="(?:(?:(?!"+re.src_ZCc+"|[@/\\[\\]()]).)+@)?";re.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";re.src_host_terminator="(?=$|"+text_separators+"|"+re.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+re.src_ZPCc+"))";re.src_path="(?:"+"[/?#]"+"(?:"+"(?!"+re.src_ZCc+"|"+text_separators+"|[()[\\]{}.,\"'?!\\-;]).|"+"\\[(?:(?!"+re.src_ZCc+"|\\]).)*\\]|"+"\\((?:(?!"+re.src_ZCc+"|[)]).)*\\)|"+"\\{(?:(?!"+re.src_ZCc+"|[}]).)*\\}|"+'\\"(?:(?!'+re.src_ZCc+'|["]).)+\\"|'+"\\'(?:(?!"+re.src_ZCc+"|[']).)+\\'|"+"\\'(?="+re.src_pseudo_letter+"|[-]).|"+"\\.{2,}[a-zA-Z0-9%/&]|"+"\\.(?!"+re.src_ZCc+"|[.]).|"+(opts&&opts["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+re.src_ZCc+").|"+";(?!"+re.src_ZCc+").|"+"\\!+(?!"+re.src_ZCc+"|[!]).|"+"\\?(?!"+re.src_ZCc+"|[?])."+")+"+"|\\/"+")?";re.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';re.src_xn="xn--[a-z0-9\\-]{1,59}";re.src_domain_root="(?:"+re.src_xn+"|"+re.src_pseudo_letter+"{1,63}"+")";re.src_domain="(?:"+re.src_xn+"|"+"(?:"+re.src_pseudo_letter+")"+"|"+"(?:"+re.src_pseudo_letter+"(?:-|"+re.src_pseudo_letter+"){0,61}"+re.src_pseudo_letter+")"+")";re.src_host="(?:"+"(?:(?:(?:"+re.src_domain+")\\.)*"+re.src_domain+")"+")";re.tpl_host_fuzzy="(?:"+re.src_ip4+"|"+"(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%))"+")";re.tpl_host_no_ip_fuzzy="(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%))";re.src_host_strict=re.src_host+re.src_host_terminator;re.tpl_host_fuzzy_strict=re.tpl_host_fuzzy+re.src_host_terminator;re.src_host_port_strict=re.src_host+re.src_port+re.src_host_terminator;re.tpl_host_port_fuzzy_strict=re.tpl_host_fuzzy+re.src_port+re.src_host_terminator;re.tpl_host_port_no_ip_fuzzy_strict=re.tpl_host_no_ip_fuzzy+re.src_port+re.src_host_terminator;re.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+re.src_ZPCc+"|>|$))";re.tpl_email_fuzzy="(^|"+text_separators+'|"|\\(|'+re.src_ZCc+")"+"("+re.src_email_name+"@"+re.tpl_host_fuzzy_strict+")";re.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+re.src_ZPCc+"))"+"((?![$+<=>^`|\uff5c])"+re.tpl_host_port_fuzzy_strict+re.src_path+")";re.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+re.src_ZPCc+"))"+"((?![$+<=>^`|\uff5c])"+re.tpl_host_port_no_ip_fuzzy_strict+re.src_path+")";return re;};function assign(obj){var sources=Array.prototype.slice.call(arguments,1);sources.forEach((function(source){if(!source){return;}
if(state.pending){state.pushPending();}};ParserInline.prototype.parse=function(str,md,env,outTokens){var i,rules,len;var state=new this.State(str,md,env,outTokens);this.tokenize(state);rules=this.ruler2.getRules("");len=rules.length;for(i=0;i<len;i++){rules[i](state);}};ParserInline.prototype.State=state_inline;var parser_inline=ParserInline;var re=function(opts){var re={};opts=opts||{};re.src_Any=regex$3.source;re.src_Cc=regex$2.source;re.src_Z=regex.source;re.src_P=regex$4.source;re.src_ZPCc=[re.src_Z,re.src_P,re.src_Cc].join("|");re.src_ZCc=[re.src_Z,re.src_Cc].join("|");var text_separators="[><\uff5c]";re.src_pseudo_letter="(?:(?!"+text_separators+"|"+re.src_ZPCc+")"+re.src_Any+")";re.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";re.src_auth="(?:(?:(?!"+re.src_ZCc+"|[@/\\[\\]()]).)+@)?";re.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";re.src_host_terminator="(?=$|"+text_separators+"|"+re.src_ZPCc+")"+"(?!"+(opts["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+re.src_ZPCc+"))";re.src_path="(?:"+"[/?#]"+"(?:"+"(?!"+re.src_ZCc+"|"+text_separators+"|[()[\\]{}.,\"'?!\\-;]).|"+"\\[(?:(?!"+re.src_ZCc+"|\\]).)*\\]|"+"\\((?:(?!"+re.src_ZCc+"|[)]).)*\\)|"+"\\{(?:(?!"+re.src_ZCc+"|[}]).)*\\}|"+'\\"(?:(?!'+re.src_ZCc+'|["]).)+\\"|'+"\\'(?:(?!"+re.src_ZCc+"|[']).)+\\'|"+"\\'(?="+re.src_pseudo_letter+"|[-])|"+"\\.{2,}[a-zA-Z0-9%/&]|"+"\\.(?!"+re.src_ZCc+"|[.]|$)|"+(opts["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+re.src_ZCc+"|$)|"+";(?!"+re.src_ZCc+"|$)|"+"\\!+(?!"+re.src_ZCc+"|[!]|$)|"+"\\?(?!"+re.src_ZCc+"|[?]|$)"+")+"+"|\\/"+")?";re.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';re.src_xn="xn--[a-z0-9\\-]{1,59}";re.src_domain_root="(?:"+re.src_xn+"|"+re.src_pseudo_letter+"{1,63}"+")";re.src_domain="(?:"+re.src_xn+"|"+"(?:"+re.src_pseudo_letter+")"+"|"+"(?:"+re.src_pseudo_letter+"(?:-|"+re.src_pseudo_letter+"){0,61}"+re.src_pseudo_letter+")"+")";re.src_host="(?:"+"(?:(?:(?:"+re.src_domain+")\\.)*"+re.src_domain+")"+")";re.tpl_host_fuzzy="(?:"+re.src_ip4+"|"+"(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%))"+")";re.tpl_host_no_ip_fuzzy="(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%))";re.src_host_strict=re.src_host+re.src_host_terminator;re.tpl_host_fuzzy_strict=re.tpl_host_fuzzy+re.src_host_terminator;re.src_host_port_strict=re.src_host+re.src_port+re.src_host_terminator;re.tpl_host_port_fuzzy_strict=re.tpl_host_fuzzy+re.src_port+re.src_host_terminator;re.tpl_host_port_no_ip_fuzzy_strict=re.tpl_host_no_ip_fuzzy+re.src_port+re.src_host_terminator;re.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+re.src_ZPCc+"|>|$))";re.tpl_email_fuzzy="(^|"+text_separators+'|"|\\(|'+re.src_ZCc+")"+"("+re.src_email_name+"@"+re.tpl_host_fuzzy_strict+")";re.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+re.src_ZPCc+"))"+"((?![$+<=>^`|\uff5c])"+re.tpl_host_port_fuzzy_strict+re.src_path+")";re.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+re.src_ZPCc+"))"+"((?![$+<=>^`|\uff5c])"+re.tpl_host_port_no_ip_fuzzy_strict+re.src_path+")";return re;};function assign(obj){var sources=Array.prototype.slice.call(arguments,1);sources.forEach((function(source){if(!source){return;}
Object.keys(source).forEach((function(key){obj[key]=source[key];}));}));return obj;}
function _class(obj){return Object.prototype.toString.call(obj);}
function isString(obj){return _class(obj)==="[object String]";}
@ -3179,7 +3183,7 @@ if(isFunction(val.normalize)){compiled.normalize=val.normalize;}else if(!val.nor
return;}
if(isString(val)){aliases.push(name);return;}
schemaError(name,val);}));aliases.forEach((function(alias){if(!self.__compiled__[self.__schemas__[alias]]){return;}
self.__compiled__[alias].validate=self.__compiled__[self.__schemas__[alias]].validate;self.__compiled__[alias].normalize=self.__compiled__[self.__schemas__[alias]].normalize;}));self.__compiled__[""]={validate:null,normalize:createNormalizer()};var slist=Object.keys(self.__compiled__).filter((function(name){return name.length>0&&self.__compiled__[name];})).map(escapeRE).join("|");self.re.schema_test=RegExp("(^|(?!_)(?:[><\uff5c]|"+re$1.src_ZPCc+"))("+slist+")","i");self.re.schema_search=RegExp("(^|(?!_)(?:[><\uff5c]|"+re$1.src_ZPCc+"))("+slist+")","ig");self.re.pretest=RegExp("("+self.re.schema_test.source+")|("+self.re.host_fuzzy_test.source+")|@","i");resetScanCache(self);}
self.__compiled__[alias].validate=self.__compiled__[self.__schemas__[alias]].validate;self.__compiled__[alias].normalize=self.__compiled__[self.__schemas__[alias]].normalize;}));self.__compiled__[""]={validate:null,normalize:createNormalizer()};var slist=Object.keys(self.__compiled__).filter((function(name){return name.length>0&&self.__compiled__[name];})).map(escapeRE).join("|");self.re.schema_test=RegExp("(^|(?!_)(?:[><\uff5c]|"+re$1.src_ZPCc+"))("+slist+")","i");self.re.schema_search=RegExp("(^|(?!_)(?:[><\uff5c]|"+re$1.src_ZPCc+"))("+slist+")","ig");self.re.schema_at_start=RegExp("^"+self.re.schema_search.source,"i");self.re.pretest=RegExp("("+self.re.schema_test.source+")|("+self.re.host_fuzzy_test.source+")|@","i");resetScanCache(self);}
function Match(self,shift){var start=self.__index__,end=self.__last_index__,text=self.__text_cache__.slice(start,end);this.schema=self.__schema__.toLowerCase();this.index=start+shift;this.lastIndex=end+shift;this.raw=text;this.text=text;this.url=text;}
function createMatch(self,shift){var match=new Match(self,shift);self.__compiled__[match.schema].normalize(match,self);return match;}
function LinkifyIt(schemas,options){if(!(this instanceof LinkifyIt)){return new LinkifyIt(schemas,options);}
@ -3193,7 +3197,7 @@ return this.__index__>=0;};LinkifyIt.prototype.pretest=function pretest(text){re
return this.__compiled__[schema.toLowerCase()].validate(text,pos,this);};LinkifyIt.prototype.match=function match(text){var shift=0,result=[];if(this.__index__>=0&&this.__text_cache__===text){result.push(createMatch(this,shift));shift=this.__last_index__;}
var tail=shift?text.slice(shift):text;while(this.test(tail)){result.push(createMatch(this,shift));tail=tail.slice(this.__last_index__);shift+=this.__last_index__;}
if(result.length){return result;}
return null;};LinkifyIt.prototype.tlds=function tlds(list,keepOld){list=Array.isArray(list)?list:[list];if(!keepOld){this.__tlds__=list.slice();this.__tlds_replaced__=true;compile(this);return this;}
return null;};LinkifyIt.prototype.matchAtStart=function matchAtStart(text){this.__text_cache__=text;this.__index__=-1;if(!text.length)return null;var m=this.re.schema_at_start.exec(text);if(!m)return null;var len=this.testSchemaAt(text,m[2],m[0].length);if(!len)return null;this.__schema__=m[2];this.__index__=m.index+m[1].length;this.__last_index__=m.index+m[0].length+len;return createMatch(this,0);};LinkifyIt.prototype.tlds=function tlds(list,keepOld){list=Array.isArray(list)?list:[list];if(!keepOld){this.__tlds__=list.slice();this.__tlds_replaced__=true;compile(this);return this;}
this.__tlds__=this.__tlds__.concat(list).sort().filter((function(el,idx,arr){return el!==arr[idx-1];})).reverse();compile(this);return this;};LinkifyIt.prototype.normalize=function normalize(match){if(!match.schema){match.url="http://"+match.url;}
if(match.schema==="mailto:"&&!/^mailto:/i.test(match.url)){match.url="mailto:"+match.url;}};LinkifyIt.prototype.onCompile=function onCompile(){};var linkifyIt=LinkifyIt;var maxInt=2147483647;var base=36;var tMin=1;var tMax=26;var skew=38;var damp=700;var initialBias=72;var initialN=128;var delimiter="-";var regexPunycode=/^xn--/;var regexNonASCII=/[^\x20-\x7E]/;var regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g;var errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var baseMinusTMin=base-tMin;var floor=Math.floor;var stringFromCharCode=String.fromCharCode;function error(type){throw new RangeError(errors[type]);}
function map(array,fn){var length=array.length;var result=[];while(length--){result[length]=fn(array[length]);}
@ -3234,7 +3238,7 @@ output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCou
return output.join("");}
function toUnicode(input){return mapDomain(input,(function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string;}));}
function toASCII(input){return mapDomain(input,(function(string){return regexNonASCII.test(string)?"xn--"+encode(string):string;}));}
var version="1.4.1";var ucs2={decode:ucs2decode,encode:ucs2encode};var punycode$1={version:version,ucs2:ucs2,toASCII:toASCII,toUnicode:toUnicode,encode:encode,decode:decode};var punycode$2=Object.freeze({__proto__:null,decode:decode,encode:encode,toUnicode:toUnicode,toASCII:toASCII,version:version,ucs2:ucs2,default:punycode$1});var _default={options:{html:false,xhtmlOut:false,breaks:false,langPrefix:"language-",linkify:false,typographer:false,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}};var zero={options:{html:false,xhtmlOut:false,breaks:false,langPrefix:"language-",linkify:false,typographer:false,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}};var commonmark={options:{html:true,xhtmlOut:true,breaks:false,langPrefix:"language-",linkify:false,typographer:false,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}};var punycode=getAugmentedNamespace(punycode$2);var config={default:_default,zero:zero,commonmark:commonmark};var BAD_PROTO_RE=/^(vbscript|javascript|file|data):/;var GOOD_DATA_RE=/^data:image\/(gif|png|jpeg|webp);/;function validateLink(url){var str=url.trim().toLowerCase();return BAD_PROTO_RE.test(str)?GOOD_DATA_RE.test(str)?true:false:true;}
var version="1.4.1";var ucs2={decode:ucs2decode,encode:ucs2encode};var punycode$1={version:version,ucs2:ucs2,toASCII:toASCII,toUnicode:toUnicode,encode:encode,decode:decode};var punycode$2=Object.freeze({__proto__:null,decode:decode,encode:encode,toUnicode:toUnicode,toASCII:toASCII,version:version,ucs2:ucs2,default:punycode$1});var _default={options:{html:false,xhtmlOut:false,breaks:false,langPrefix:"language-",linkify:false,typographer:false,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}};var zero={options:{html:false,xhtmlOut:false,breaks:false,langPrefix:"language-",linkify:false,typographer:false,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}};var commonmark={options:{html:true,xhtmlOut:true,breaks:false,langPrefix:"language-",linkify:false,typographer:false,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}};var punycode=getAugmentedNamespace(punycode$2);var config={default:_default,zero:zero,commonmark:commonmark};var BAD_PROTO_RE=/^(vbscript|javascript|file|data):/;var GOOD_DATA_RE=/^data:image\/(gif|png|jpeg|webp);/;function validateLink(url){var str=url.trim().toLowerCase();return BAD_PROTO_RE.test(str)?GOOD_DATA_RE.test(str)?true:false:true;}
var RECODE_HOSTNAME_FOR=["http:","https:","mailto:"];function normalizeLink(url){var parsed=mdurl.parse(url,true);if(parsed.hostname){if(!parsed.protocol||RECODE_HOSTNAME_FOR.indexOf(parsed.protocol)>=0){try{parsed.hostname=punycode.toASCII(parsed.hostname);}catch(er){}}}
return mdurl.encode(mdurl.format(parsed));}
function normalizeLinkText(url){var parsed=mdurl.parse(url,true);if(parsed.hostname){if(!parsed.protocol||RECODE_HOSTNAME_FOR.indexOf(parsed.protocol)>=0){try{parsed.hostname=punycode.toUnicode(parsed.hostname);}catch(er){}}}

View file

@ -693,11 +693,10 @@ if(forcePlaces!==false){rounded=Number(rounded).toFixed(forcePlaces);}
return rounded+abbr;}
window.ls.container.get("view").add({selector:"data-acl",controller:function(element,document,router,alerts){document.body.classList.remove("console");document.body.classList.remove("home");document.body.classList.add(router.getCurrent().view.scope);if(!router.getCurrent().view.project){document.body.classList.add("hide-nav");document.body.classList.remove("show-nav");}else{document.body.classList.add("show-nav");document.body.classList.remove("hide-nav");}
if("/console"===router.getCurrent().path){document.body.classList.add("index");}else{document.body.classList.remove("index");}}}).add({selector:"data-prism",controller:function(window,document,element,alerts){Prism.highlightElement(element);let copy=document.createElement("i");copy.className="icon-docs copy";copy.title="Copy to Clipboard";copy.textContent="Click Here to Copy";copy.addEventListener("click",function(){window.getSelection().removeAllRanges();let range=document.createRange();range.selectNode(element);window.getSelection().addRange(range);try{document.execCommand("copy");alerts.add({text:"Copied to clipboard",class:""},3000);}catch(err){alerts.add({text:"Failed to copy text ",class:"error"},3000);}
window.getSelection().removeAllRanges();});element.parentNode.parentNode.appendChild(copy);}});(function(window){document.addEventListener('alpine:init',()=>{Alpine.store('uploader',{_files:[],files(){return(this._files??[]).filter((file)=>!file.cancelled);},isOpen:true,init(){window.addEventListener('beforeunload',(event)=>{if(this.hasOngoingUploads()){let confirmationMessage="There are incomplete uploads, are you sure you want to leave?";event.returnValue=confirmationMessage;return confirmationMessage;}});},cancelAll(){if(this.hasOngoingUploads()?confirm("Are you sure? This will cancel and remove any ongoing uploads?"):true){this._files.forEach(file=>{if(file.completed||file.failed){this.removeFile(file.id);}else{this.updateFile(file.id,{cancelled:true});}});}},hasOngoingUploads(){let ongoing=false;this._files.some((file)=>{if(!file.completed&&!file.failed){ongoing=true;}});return ongoing;},toggle(){this.isOpen=!this.isOpen;},addFile(file){this._files.push(file);},updateFile(id,file){this._files=this._files.map((oldFile)=>id===oldFile.id?{...oldFile,...file}:oldFile);},removeFile(id){const file=this.getFile(id)??{};if(file.completed||file.failed){this._files=this._files.filter((file)=>file.id!==id);}else{if(confirm("Are you sure you want to cancel the upload?")){this.updateFile(id,{cancelled:true});}}},getFile(id){return this._files.find((file)=>file.id===id);},async uploadFile(target){const formData=new FormData(target);const sdk=window.ls.container.get('sdk');const bucketId=formData.get('bucketId');const file=formData.get('file');const fileId=formData.get('fileId');let id=fileId==='unique()'?performance.now():fileId;let read=formData.get('read');if(!file||!fileId){return;}
if(read){read=JSON.parse(read);}
let write=formData.get('write');if(write){write=JSON.parse(write);}
window.getSelection().removeAllRanges();});element.parentNode.parentNode.appendChild(copy);}});(function(window){document.addEventListener('alpine:init',()=>{Alpine.store('uploader',{_files:[],files(){return(this._files??[]).filter((file)=>!file.cancelled);},isOpen:true,init(){window.addEventListener('beforeunload',(event)=>{if(this.hasOngoingUploads()){let confirmationMessage="There are incomplete uploads, are you sure you want to leave?";event.returnValue=confirmationMessage;return confirmationMessage;}});},cancelAll(){if(this.hasOngoingUploads()?confirm("Are you sure? This will cancel and remove any ongoing uploads?"):true){this._files.forEach(file=>{if(file.completed||file.failed){this.removeFile(file.id);}else{this.updateFile(file.id,{cancelled:true});}});}},hasOngoingUploads(){let ongoing=false;this._files.some((file)=>{if(!file.completed&&!file.failed){ongoing=true;return;}});return ongoing;},toggle(){this.isOpen=!this.isOpen;},addFile(file){this._files.push(file);},updateFile(id,file){this._files=this._files.map((oldFile)=>id==oldFile.id?{...oldFile,...file}:oldFile);},removeFile(id){const file=this.getFile(id)??{};if(file.completed||file.failed){this._files=this._files.filter((file)=>file.id!==id);}else{if(confirm("Are you sure you want to cancel the upload?")){this.updateFile(id,{cancelled:true});}}},getFile(id){return this._files.find((file)=>file.id===id);},async uploadFile(target){const formData=new FormData(target);const sdk=window.ls.container.get('sdk');const bucketId=formData.get('bucketId');const file=formData.get('file');const fileId=formData.get('fileId');let id=fileId==='unique()'?performance.now():fileId;if(!file||!fileId){return;}
let permissions=formData.get('permissions');if(permissions){permissions=JSON.parse(permissions);}
if(this.getFile(id)){this.updateFile(id,{name:file.name,completed:false,failed:false,cancelled:false,error:"",});}else{this.addFile({id:id,name:file.name,progress:0,completed:false,failed:false,cancelled:false,error:"",});}
target.reset();try{const response=await sdk.storage.createFile(bucketId,fileId,file,read,write,(progress)=>{this.updateFile(id,{id:progress.$id,progress:Math.round(progress.progress),error:"",});id=progress.$id;const file=this.getFile(id)??{};if(file.cancelled===true){throw'USER_CANCELLED';}});const existingFile=this.getFile(id)??{};if(existingFile.cancelled){this.updateFile(id,{id:response.$id,name:response.name,failed:false,});id=response.$id;throw'USER_CANCELLED'}else{this.updateFile(id,{id:response.$id,name:response.name,progress:100,completed:true,failed:false,});id=response.$id;}
target.reset();try{const response=await sdk.storage.createFile(bucketId,fileId,file,permissions,(progress)=>{this.updateFile(id,{id:progress.$id,progress:Math.round(progress.progress),error:"",});id=progress.$id;const file=this.getFile(id)??{};if(file.cancelled===true){throw'USER_CANCELLED';}});const existingFile=this.getFile(id)??{};if(existingFile.cancelled){this.updateFile(id,{id:response.$id,name:response.name,failed:false,});id=response.$id;throw'USER_CANCELLED'}else{this.updateFile(id,{id:response.$id,name:response.name,progress:100,completed:true,failed:false,});id=response.$id;}
document.dispatchEvent(new CustomEvent('storage.createFile'));}catch(error){if(error==='USER_CANCELLED'){await sdk.storage.deleteFile(bucketId,id);this.updateFile(id,{cancelled:false,failed:true,});this.removeFile(id);}else{this.updateFile(id,{id:id,failed:true,error:error.message??error});}
document.dispatchEvent(new CustomEvent('storage.createFile'));}}});});})(window);(function(window){document.addEventListener('alpine:init',()=>{Alpine.data('events',()=>({events:new Set(),selected:null,action:null,type:null,subType:null,subSubType:null,resource:null,resourceName:'',subResource:null,subResourceName:'',subSubResource:null,subSubResourceName:'',hasResource:false,hasSubResource:false,hasSubSubResource:false,attribute:null,hasAttribute:false,attributes:[],load(events){this.events=new Set(events);},reset(){this.hasResource=this.hasSubResource=this.hasSubSubResource=this.hasAttribute=false;this.type=this.subType=this.subResource=this.resource=this.attribute=this.selected=this.action=null;},setEvent(){this.hasResource=this.hasSubResource=this.hasSubSubResource=this.hasAttribute=this.action=false;if(!this.selected){this.reset();return;}
let[type,action]=this.selected.split('.');switch(type){case'users':if(action==='update'){this.hasAttribute=true;this.attributes=['email','name','password','status','prefs']}
@ -714,7 +713,7 @@ return url;}}else{if(typeof value!=="undefined"&&value!==null){var separator=url
return url;}else{return url;}}};keys=keys.split(",").map(element=>element.trim());return function(serviceForm,router,window){let url=window.location.href;keys.map(node=>{node=node.split("=");let key=node[0]||"";let name=node[1]||key;let value=getValue(key,"param",serviceForm);url=updateQueryString(name,value?value:null,url);});if(url!==window.location.href){window.history.pushState({},"",url);router.reset();}};},trigger:function(events){return function(document){events=events.trim().split(",");for(let i=0;i<events.length;i++){if(""===events[i]){continue;}
document.dispatchEvent(new CustomEvent(events[i]));}};},setId:function name(params){},default:function(){let collection=container.get('project-collection');let document=container.get('project-document');if(collection&&document&&collection.$id===document.$id){for(const[key,value]of Object.entries(document)){delete document[key];}
if(collection.rules){for(let index=0;index<collection.rules.length;index++){const element=collection.rules[index];switch(element.type){case'text':case'email':case'url':case'ip':document[element.key]=element.default||'';break;case'numeric':document[element.key]=element.default||'0';break;case'boolean':document[element.key]=element.default||false;break;case'document':document[element.key]=element.default||{'$id':'','$collection':'','$permissions':{}};break;default:document[element.key]=null;break;}
if(element.array){document[element.key]=[];}}}}}};let getParams=function getParams(func){const REGEX_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;const REGEX_FUNCTION_PARAMS=/(?:\s*(?:function\s*[^(]*)?\s*)((?:[^'"]|(?:(?:(['"])(?:(?:.*?[^\\]\2)|\2))))*?)\s*(?=(?:=>)|{)/m;const REGEX_PARAMETERS_VALUES=/\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm;let functionAsString=func.toString();let params=[];let match;let indexOfArguments=functionAsString.indexOf('(');if(indexOfArguments!==-1){functionAsString=functionAsString.slice(indexOfArguments,-1);}
if(element.array){document[element.key]=[];}}}}}};let getParams=function getParams(func){const REGEX_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;const REGEX_FUNCTION_PARAMS=/(?:\s*(?:function\s*[^(]*)?\s*)((?:[^'"]|(?:(?:(['"])(?:(?:.*?[^\\]\2)|\2))))*?)\s*(?=(?:=>)|{)/m;const REGEX_PARAMETERS_VALUES=/\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm;let functionAsString=func.toString();let params=[];let match;console.log(functionAsString);let indexOfArguments=functionAsString.indexOf('(');if(indexOfArguments!==-1){functionAsString=functionAsString.slice(indexOfArguments,-1);}
functionAsString=functionAsString.replaceAll('={}',"");functionAsString=functionAsString.replaceAll('=[]',"");functionAsString=functionAsString.replace(REGEX_COMMENTS,"");functionAsString=functionAsString.match(REGEX_FUNCTION_PARAMS)[1];if(functionAsString.charAt(0)==="("){functionAsString=functionAsString.slice(1,-1);}
while((match=REGEX_PARAMETERS_VALUES.exec(functionAsString))){params.push(match[1]);}
return params;};let getValue=function(key,prefix,data){let result=null;if(!key){return null;}
@ -729,7 +728,7 @@ running=true;element.style.backgroud='red';if(confirm){if(window.confirm(confirm
if(loading){loaderId=alerts.add({text:loading,class:""},0);}
let method=container.path(scope+"."+parsedAction);if(!method){throw new Error('Method "'+scope+"."+parsedAction+'" not found');}
let formData="FORM"===element.tagName?form.toJson(element):{};let result=resolve(method,"param",formData);if(!result){return;}
if(Promise.resolve(result)!=result){result=new Promise((resolve,reject)=>{resolve(result);});}
if(Promise.resolve(result)!==result){result=new Promise((resolve,reject)=>{resolve(result);});}
result.then(function(data){if(loaderId!==null){alerts.remove(loaderId);}
if(!element){return;}
running=false;element.style.backgroud='transparent';element.classList.add("load-service-end");if(service){container.set(service.replace(".","-"),data,true,true);}
@ -828,7 +827,8 @@ var file=document.createElement("li");var image=document.createElement("img");im
result.bucketId+"/files/"+
result.fileId+"/preview?width="+
previewWidth+"&height="+
previewHeight+"&project="+project+"&mode=admin";image.alt=previewAlt;file.className="file avatar";file.tabIndex=0;file.appendChild(image);preview.appendChild(file);var remove=(function(result){return function(event){render(result.$id);element.value='';};})(result);file.addEventListener("click",remove);file.addEventListener("keypress",remove);element.value=JSON.stringify(result);};input.addEventListener("change",function(){var message=alerts.add({text:labelLoading,class:""},0);var files=input.files;var read=JSON.parse(expression.parse(element.dataset["read"]||"[]"));var write=JSON.parse(expression.parse(element.dataset["write"]||"[]"));sdk.storage.createFile('default','unique()',files[0],read,write).then(function(response){onComplete(message);render({bucketId:response.bucketId,fileId:response.$id});},function(error){alerts.add({text:"An error occurred!",class:""},3000);onComplete(message);});input.disabled=true;});element.addEventListener("change",function(){if(!element.value){return;}
previewHeight+"&project="+project+"&mode=admin";image.alt=previewAlt;file.className="file avatar";file.tabIndex=0;file.appendChild(image);preview.appendChild(file);var remove=(function(result){return function(event){render(result.$id);element.value='';};})(result);file.addEventListener("click",remove);file.addEventListener("keypress",remove);element.value=JSON.stringify(result);};input.addEventListener("change",function(){var message=alerts.add({text:labelLoading,class:""},0);var files=input.files;var permissions=JSON.parse(expression.parse(element.dataset["permissions"]||"[]"))
sdk.storage.createFile('default','unique()',files[0],permissions).then(function(response){onComplete(message);render({bucketId:response.bucketId,fileId:response.$id});},function(error){alerts.add({text:"An error occurred!",class:""},3000);onComplete(message);});input.disabled=true;});element.addEventListener("change",function(){if(!element.value){return;}
render(element.value);wrapper.scrollIntoView();});upload.addEventListener("keypress",function(){input.click();});element.parentNode.insertBefore(wrapper,element);wrapper.appendChild(preview);wrapper.appendChild(progress);wrapper.appendChild(upload);upload.appendChild(input);render(output);if(searchButton){let searchOpen=document.createElement("button");searchOpen.type='button';searchOpen.innerHTML='<i class="icon icon-search"></i> Search';searchOpen.classList.add('reverse');let path=container.scope(searchButton);searchOpen.addEventListener('click',function(){search.selected=element.value;search.path=path;document.dispatchEvent(new CustomEvent("open-file-search",{bubbles:false,cancelable:true}));});wrapper.appendChild(searchOpen);}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-cookies",controller:function(element,alerts,cookie,env){if(!cookie.get("cookie-alert")){let text=element.dataset["cookies"]||"";alerts.add({text:text,class:"cookie-alert",link:env.HOME+"/policy/cookies",label:'Learn More',callback:function(){cookie.set("cookie-alert","true",365*10);}},0);}}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-copy',repeat:false,controller:function(document,element,alerts){let button=document.createElement("i");button.type="button";button.title="Copy to Clipboard";button.className=element.getAttribute("data-class")||"icon-docs note copy";button.style.cursor="pointer";element.parentNode.insertBefore(button,element.nextSibling);let copy=function(event){window.getSelection().removeAllRanges();let range=document.createRange();range.selectNode(element);window.getSelection().addRange(range);try{document.execCommand("copy");alerts.add({text:"Copied to clipboard",class:""},3000);}catch(err){alerts.add({text:"Failed to copy text ",class:"error"},3000);}
window.getSelection().removeAllRanges();};button.addEventListener("click",copy);}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-page-title",repeat:true,controller:function(element,document,expression){document.title=expression.parse(element.getAttribute("data-page-title"))||document.title;}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-scroll-to',repeat:false,controller:function(element,window){let button=window.document.createElement('button');button.className='scroll-to icon-up-dir';button.alt='Back To Top';button.title='Back To Top';button.addEventListener('click',function(){element.scrollIntoView(true,{behavior:'smooth'});button.blur();},false);element.appendChild(button);}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-scroll-direction',repeat:false,controller:function(element,window){let position=0;let check=function(){let direction=window.document.documentElement.scrollTop;if(direction>position){element.classList.remove('scroll-to-top')
element.classList.add('scroll-to-bottom')}

View file

@ -5077,12 +5077,12 @@
if (typeof name !== 'undefined') {
payload['name'] = name;
}
if (typeof fileSecurity !== 'undefined') {
payload['fileSecurity'] = fileSecurity;
}
if (typeof permissions !== 'undefined') {
payload['permissions'] = permissions;
}
if (typeof fileSecurity !== 'undefined') {
payload['fileSecurity'] = fileSecurity;
}
if (typeof enabled !== 'undefined') {
payload['enabled'] = enabled;
}
@ -5160,12 +5160,12 @@
if (typeof name !== 'undefined') {
payload['name'] = name;
}
if (typeof fileSecurity !== 'undefined') {
payload['fileSecurity'] = fileSecurity;
}
if (typeof permissions !== 'undefined') {
payload['permissions'] = permissions;
}
if (typeof fileSecurity !== 'undefined') {
payload['fileSecurity'] = fileSecurity;
}
if (typeof enabled !== 'undefined') {
payload['enabled'] = enabled;
}

View file

@ -53,7 +53,7 @@ class DatabasesPermissionsGuestTest extends Scope
}
/**
* [string[] $read, string[] $write]
* [string[] $permissions]
*/
public function readDocumentsProvider()
{