udata 11.0.1.dev37781__py2.py3-none-any.whl → 11.0.2.dev37787__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of udata might be problematic. Click here for more details.

Files changed (23) hide show
  1. udata/__init__.py +1 -1
  2. udata/static/chunks/{10.8ca60413647062717b1e.js → 10.471164b2a9fe15614797.js} +3 -3
  3. udata/static/chunks/{10.8ca60413647062717b1e.js.map → 10.471164b2a9fe15614797.js.map} +1 -1
  4. udata/static/chunks/{11.b6f741fcc366abfad9c4.js → 11.83535504cd650ea08f65.js} +3 -3
  5. udata/static/chunks/{11.b6f741fcc366abfad9c4.js.map → 11.83535504cd650ea08f65.js.map} +1 -1
  6. udata/static/chunks/{13.2d06442dd9a05d9777b5.js → 13.d9c1735d14038b94c17e.js} +2 -2
  7. udata/static/chunks/{13.2d06442dd9a05d9777b5.js.map → 13.d9c1735d14038b94c17e.js.map} +1 -1
  8. udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js → 17.81c57c0dedf812e43013.js} +2 -2
  9. udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js.map → 17.81c57c0dedf812e43013.js.map} +1 -1
  10. udata/static/chunks/{19.f03a102365af4315f9db.js → 19.df16abde17a42033a7f8.js} +3 -3
  11. udata/static/chunks/{19.f03a102365af4315f9db.js.map → 19.df16abde17a42033a7f8.js.map} +1 -1
  12. udata/static/chunks/{8.778091d55cd8ea39af6b.js → 8.462bb3029de008497675.js} +2 -2
  13. udata/static/chunks/{8.778091d55cd8ea39af6b.js.map → 8.462bb3029de008497675.js.map} +1 -1
  14. udata/static/chunks/{9.033d7e190ca9e226a5d0.js → 9.07515e5187f475bce828.js} +3 -3
  15. udata/static/chunks/{9.033d7e190ca9e226a5d0.js.map → 9.07515e5187f475bce828.js.map} +1 -1
  16. udata/static/common.js +1 -1
  17. udata/static/common.js.map +1 -1
  18. {udata-11.0.1.dev37781.dist-info → udata-11.0.2.dev37787.dist-info}/METADATA +5 -1
  19. {udata-11.0.1.dev37781.dist-info → udata-11.0.2.dev37787.dist-info}/RECORD +23 -23
  20. {udata-11.0.1.dev37781.dist-info → udata-11.0.2.dev37787.dist-info}/LICENSE +0 -0
  21. {udata-11.0.1.dev37781.dist-info → udata-11.0.2.dev37787.dist-info}/WHEEL +0 -0
  22. {udata-11.0.1.dev37781.dist-info → udata-11.0.2.dev37787.dist-info}/entry_points.txt +0 -0
  23. {udata-11.0.1.dev37781.dist-info → udata-11.0.2.dev37787.dist-info}/top_level.txt +0 -0
@@ -4,12 +4,12 @@ this._uploadData.setStatus(e,qq.status.UPLOAD_RETRYING),t?t(e):this._handler.ret
4
4
  },isResumable:function(e){return!!o.isResumable&&o.isResumable(e)}}),qq.extend(l,e),i=l.log,r=l.chunking.enabled&&qq.supportedFeatures.chunking,s=r&&l.chunking.concurrent.enabled,n=function(){var e={};return e[l.preventRetryParam]=!0,e}(),p.initHandler()},qq.WindowReceiveMessage=function(e){"use strict";var t={log:function(e,t){}},n={};qq.extend(t,e),qq.extend(this,{receiveMessage:function(e,t){var i=function(e){t(e.data)};window.postMessage?n[e]=qq(window).attach("message",i):log("iframe message passing not supported in this browser!","error")},stopReceivingMessages:function(e){if(window.postMessage){var t=n[e];t&&t()}}})},qq.FormUploadHandler=function(e){"use strict";function expungeFile(e){delete r[e],l&&(clearTimeout(s[e]),delete s[e],p.stopReceivingMessages(e));var t=document.getElementById(n._getIframeName(e));t&&(t.setAttribute("src","javascript:false;"),qq(t).remove())}function getFileIdForIframeName(e){return e.split("_")[0]}function initIframeForUpload(e){var t=qq.toElement("<iframe src='javascript:false;' name='"+e+"' />");return t.setAttribute("id",e),t.style.display="none",document.body.appendChild(t),t}function registerPostMessageCallback(e,t){var i=e.id,o=getFileIdForIframeName(i),l=d(o);a[l]=t,r[o]=qq(e).attach("load",function(){n.getInput(o)&&(c("Received iframe load event for CORS upload request (iframe name "+i+")"),s[i]=setTimeout(function(){var e="No valid message received from loaded iframe for iframe name "+i;c(e,"error"),t({error:e})},1e3))}),p.receiveMessage(i,function(e){c("Received the following window message: '"+e+"'");var t,o=(getFileIdForIframeName(i),n._parseJsonResponse(e)),r=o.uuid;r&&a[r]?(c("Handling response for iframe name "+i),clearTimeout(s[i]),delete s[i],n._detachLoadEvent(i),t=a[r],delete a[r],p.stopReceivingMessages(i),t(o)):r||c("'"+e+"' does not contain a UUID - ignoring.")})}var t=e.options,n=this,i=e.proxy,o=qq.getUniqueId(),a={},r={},s={},l=t.isCors,u=t.inputName,d=i.getUuid,c=i.log,p=new qq.WindowReceiveMessage({log:c});qq.extend(this,new qq.UploadHandler(e)),qq.override(this,function(e){return{add:function(t,n){e.add(t,{input:n}),n.setAttribute("name",u),n.parentNode&&qq(n).remove()},expunge:function(t){expungeFile(t),e.expunge(t)},isValid:function(t){return e.isValid(t)&&void 0!==n._getFileState(t).input}}}),qq.extend(this,{getInput:function(e){return n._getFileState(e).input},_attachLoadEvent:function(e,t){var n;l?registerPostMessageCallback(e,t):r[e.id]=qq(e).attach("load",function(){if(c("Received response for "+e.id),e.parentNode){try{if(e.contentDocument&&e.contentDocument.body&&"false"==e.contentDocument.body.innerHTML)return}catch(i){c("Error when attempting to access iframe during handling of upload response ("+i.message+")","error"),n={success:!1}}t(n)}})},_createIframe:function(e){var t=n._getIframeName(e);return initIframeForUpload(t)},_detachLoadEvent:function(e){void 0!==r[e]&&(r[e](),delete r[e])},_getIframeName:function(e){return e+"_"+o},_initFormForUpload:function(e){var t=e.method,n=e.endpoint,i=e.params,o=e.paramsInBody,a=e.targetName,r=qq.toElement("<form method='"+t+"' enctype='multipart/form-data'></form>"),s=n;return o?qq.obj2Inputs(i,r):s=qq.obj2url(i,n),r.setAttribute("action",s),r.setAttribute("target",a),r.style.display="none",document.body.appendChild(r),r},_parseJsonResponse:function(e){var t={};try{t=qq.parseJson(e)}catch(n){c("Error when attempting to parse iframe upload response ("+n.message+")","error")}return t}})},qq.XhrUploadHandler=function(e){"use strict";function abort(e){qq.each(t._getXhrs(e),function(n,i){var o=t._getAjaxRequester(e,n);i.onreadystatechange=null,i.upload.onprogress=null,i.abort(),o&&o.canceled&&o.canceled(e)})}var t=this,n=e.options.namespace,i=e.proxy,o=e.options.chunking,a=function(e){var n=t._getFileState(e);if(n.chunkSize)return n.chunkSize;var i=o.partSize;return qq.isFunction(i)&&(i=i(e,d(e))),n.chunkSize=i,i},r=e.options.resume,s=o&&e.options.chunking.enabled&&qq.supportedFeatures.chunking,l=r&&e.options.resume.enabled&&s&&qq.supportedFeatures.resume,u=i.getName,d=i.getSize,c=i.getUuid,p=i.getEndpoint,h=i.getDataByUuid,f=i.onUuidChanged,g=i.onProgress,m=i.log,v=i.getCustomResumeData;qq.extend(this,new qq.UploadHandler(e)),qq.override(this,function(e){return{add:function(n,i){if(qq.isFile(i)||qq.isBlob(i))e.add(n,{file:i});else{if(!(i instanceof qq.BlobProxy))throw new Error("Passed obj is not a File, Blob, or proxy");e.add(n,{proxy:i})}t._initTempState(n),l&&t._maybePrepareForResume(n)},expunge:function(n){abort(n),t._maybeDeletePersistedChunkData(n),t._clearXhrs(n),e.expunge(n)}}}),qq.extend(this,{clearCachedChunk:function(e,n){var i=t._getFileState(e);i&&delete i.temp.cachedChunks[n]},clearXhr:function(e,n){var i=t._getFileState(e).temp;i.xhrs&&delete i.xhrs[n],i.ajaxRequesters&&delete i.ajaxRequesters[n]},finalizeChunks:function(e,n){var i=t._getTotalChunks(e)-1,o=t._getXhr(e,i);return n?(new qq.Promise).success(n(o),o):(new qq.Promise).success({},o)},getFile:function(e){return t.isValid(e)&&t._getFileState(e).file},getProxy:function(e){return t.isValid(e)&&t._getFileState(e).proxy},getResumableFilesData:function(){var e=[];return t._iterateResumeRecords(function(n,i){t.moveInProgressToRemaining(null,i.chunking.inProgress,i.chunking.remaining);var o={name:i.name,remaining:i.chunking.remaining,size:i.size,uuid:i.uuid};i.key&&(o.key=i.key),i.customResumeData&&(o.customResumeData=i.customResumeData),e.push(o)}),e},isAttemptingResume:function(e){return t._getFileState(e).attemptingResume},isResumable:function(e){return!!o&&t.isValid(e)&&!t._getFileState(e).notResumable},moveInProgressToRemaining:function(e,n,i){var o=t._getFileState(e)||{},a=o.chunking||{},r=n||a.inProgress,s=i||a.remaining;r&&(m(qq.format("Moving these chunks from in-progress {}, to remaining.",JSON.stringify(r))),r.reverse(),qq.each(r,function(e,t){s.unshift(t)}),r.length=0)},pause:function(e){if(t.isValid(e))return m(qq.format("Aborting XHR upload for {} '{}' due to pause instruction.",e,u(e))),t._getFileState(e).paused=!0,abort(e),!0},reevaluateChunking:function(e){if(o&&t.isValid(e)){var n,i,a=t._getFileState(e);if(delete a.chunking,a.chunking={},n=t._getTotalChunks(e),n>1||o.mandatory){for(a.chunking.enabled=!0,a.chunking.parts=n,a.chunking.remaining=[],i=0;i<n;i++)a.chunking.remaining.push(i);t._initTempState(e)}else a.chunking.enabled=!1}},updateBlob:function(e,n){t.isValid(e)&&(t._getFileState(e).file=n)},_clearXhrs:function(e){var n=t._getFileState(e).temp;qq.each(n.ajaxRequesters,function(e){delete n.ajaxRequesters[e]}),qq.each(n.xhrs,function(e){delete n.xhrs[e]})},_createXhr:function(e,n){return t._registerXhr(e,n,qq.createXhrInstance())},_getAjaxRequester:function(e,n){var i=null==n?-1:n;return t._getFileState(e).temp.ajaxRequesters[i]},_getChunkData:function(e,n){var i=a(e),o=d(e),r=t.getFile(e),s=i*n,l=s+i>=o?o:s+i,u=t._getTotalChunks(e),c=this._getFileState(e).temp.cachedChunks,p=c[n]||qq.sliceBlob(r,s,l);return c[n]=p,{part:n,start:s,end:l,count:u,blob:p,size:l-s}},_getChunkDataForCallback:function(e){return{partIndex:e.part,startByte:e.start+1,endByte:e.end,totalParts:e.count}},_getLocalStorageId:function(e){var t="5.0",i=u(e),o=d(e),s=a(e),l=p(e),c=r.customKeys(e),h=qq.format("qq{}resume{}-{}-{}-{}-{}",n,t,i,o,s,l);return c.forEach(function(e){h+="-"+e}),h},_getMimeType:function(e){return t.getFile(e).type},_getPersistableData:function(e){return t._getFileState(e).chunking},_getTotalChunks:function(e){if(o){var t=d(e),n=a(e);return Math.ceil(t/n)}},_getXhr:function(e,n){var i=null==n?-1:n;return t._getFileState(e).temp.xhrs[i]},_getXhrs:function(e){return t._getFileState(e).temp.xhrs},_iterateResumeRecords:function(e){l&&qq.each(localStorage,function(t,i){if(0===t.indexOf(qq.format("qq{}resume",n))){var o=JSON.parse(i);e(t,o)}})},_initTempState:function(e){t._getFileState(e).temp={ajaxRequesters:{},chunkProgress:{},xhrs:{},cachedChunks:{}}},_markNotResumable:function(e){t._getFileState(e).notResumable=!0},_maybeDeletePersistedChunkData:function(e){var n;return!!(l&&t.isResumable(e)&&(n=t._getLocalStorageId(e),n&&localStorage.getItem(n)))&&(localStorage.removeItem(n),!0)},_maybePrepareForResume:function(e){var n,i,o=t._getFileState(e);l&&void 0===o.key&&(n=t._getLocalStorageId(e),i=localStorage.getItem(n),i&&(i=JSON.parse(i),h(i.uuid)?t._markNotResumable(e):(m(qq.format("Identified file with ID {} and name of {} as resumable.",e,u(e))),f(e,i.uuid),o.key=i.key,o.chunking=i.chunking,o.loaded=i.loaded,o.customResumeData=i.customResumeData,o.attemptingResume=!0,t.moveInProgressToRemaining(e))))},_maybePersistChunkedState:function(e){var n,i,o=t._getFileState(e);if(l&&t.isResumable(e)){var a=v(e);n=t._getLocalStorageId(e),i={name:u(e),size:d(e),uuid:c(e),key:o.key,chunking:o.chunking,loaded:o.loaded,lastUpdated:Date.now()},a&&(i.customResumeData=a);try{localStorage.setItem(n,JSON.stringify(i))}catch(r){m(qq.format("Unable to save resume data for '{}' due to error: '{}'.",e,r.toString()),"warn")}}},_registerProgressHandler:function(e,n,i){var o=t._getXhr(e,n),a=u(e),r={simple:function(t,n){var i=d(e);t===n?g(e,a,i,i):g(e,a,t>=i?i-1:t,i)},chunked:function(o,r){var s=t._getFileState(e).temp.chunkProgress,l=t._getFileState(e).loaded,u=o,c=r,p=d(e),h=u-(c-i),f=l;s[n]=h,qq.each(s,function(e,t){f+=t}),g(e,a,f,p)}};o.upload.onprogress=function(e){if(e.lengthComputable){var t=null==i?"simple":"chunked";r[t](e.loaded,e.total)}}},_registerXhr:function(e,n,i,o){var a=null==n?-1:n,r=t._getFileState(e).temp;return r.xhrs=r.xhrs||{},r.ajaxRequesters=r.ajaxRequesters||{},r.xhrs[a]=i,o&&(r.ajaxRequesters[a]=o),i},_removeExpiredChunkingRecords:function(){var e=r.recordsExpireIn;t._iterateResumeRecords(function(t,n){var i=new Date(n.lastUpdated);i.setDate(i.getDate()+e),i.getTime()<=Date.now()&&(m("Removing expired resume record with key "+t),localStorage.removeItem(t))})},_shouldChunkThisFile:function(e){var n=t._getFileState(e);if(n)return n.chunking||t.reevaluateChunking(e),n.chunking.enabled}})},qq.DeleteFileAjaxRequester=function(e){"use strict";function getMandatedParams(){return"POST"===n.method.toUpperCase()?{_method:"DELETE"}:{}}var t,n={method:"DELETE",uuidParamName:"qquuid",endpointStore:{},maxConnections:3,customHeaders:function(e){return{}},paramsStore:{},cors:{expected:!1,sendCredentials:!1},log:function(e,t){},onDelete:function(e){},onDeleteComplete:function(e,t,n){}};qq.extend(n,e),t=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:["POST","DELETE"],method:n.method,endpointStore:n.endpointStore,paramsStore:n.paramsStore,mandatedParams:getMandatedParams(),maxConnections:n.maxConnections,customHeaders:function(e){return n.customHeaders.get(e)},log:n.log,onSend:n.onDelete,onComplete:n.onDeleteComplete,cors:n.cors})),qq.extend(this,{sendDelete:function(e,i,o){var a=o||{};n.log("Submitting delete file request for "+e),"DELETE"===n.method?t.initTransport(e).withPath(i).withParams(a).send():(a[n.uuidParamName]=i,t.initTransport(e).withParams(a).send())}})},function(){function detectSubsampling(e){var t,n=e.naturalWidth,i=e.naturalHeight,o=document.createElement("canvas");return n*i>1048576&&(o.width=o.height=1,t=o.getContext("2d"),t.drawImage(e,-n+1,0),0===t.getImageData(0,0,1,1).data[3])}function detectVerticalSquash(e,t,n){var i,o,a,r,s=document.createElement("canvas"),l=0,u=n,d=n;for(s.width=1,s.height=n,i=s.getContext("2d"),i.drawImage(e,0,0),o=i.getImageData(0,0,1,n).data;d>l;)a=o[4*(d-1)+3],0===a?u=d:l=d,d=u+l>>1;return r=d/n,0===r?1:r}function renderImageToDataURL(e,t,n,i){var o=document.createElement("canvas"),a=n.mime||"image/jpeg",r=new qq.Promise;return renderImageToCanvas(e,t,o,n,i).then(function(){r.success(o.toDataURL(a,n.quality||.8))}),r}function maybeCalculateDownsampledDimensions(e){var t=5241e3;if(!qq.ios())throw new qq.Error("Downsampled dimensions can only be reliably calculated for iOS!");if(e.origHeight*e.origWidth>t)return{newHeight:Math.round(Math.sqrt(t*(e.origHeight/e.origWidth))),newWidth:Math.round(Math.sqrt(t*(e.origWidth/e.origHeight)))}}function renderImageToCanvas(e,t,n,i,o){var a,r=e.naturalWidth,s=e.naturalHeight,l=i.width,u=i.height,d=n.getContext("2d"),c=new qq.Promise;return d.save(),i.resize?renderImageToCanvasWithCustomResizer({blob:t,canvas:n,image:e,imageHeight:s,imageWidth:r,orientation:i.orientation,resize:i.resize,targetHeight:u,targetWidth:l}):(qq.supportedFeatures.unlimitedScaledImageSize||(a=maybeCalculateDownsampledDimensions({origWidth:l,origHeight:u}),a&&(qq.log(qq.format("Had to reduce dimensions due to device limitations from {}w / {}h to {}w / {}h",l,u,a.newWidth,a.newHeight),"warn"),l=a.newWidth,u=a.newHeight)),transformCoordinate(n,l,u,i.orientation),qq.ios()?!function(){detectSubsampling(e)&&(r/=2,s/=2);var t,n,i,a=1024,c=document.createElement("canvas"),p=o?detectVerticalSquash(e,r,s):1,h=Math.ceil(a*l/r),f=Math.ceil(a*u/s/p),g=0,m=0;for(c.width=c.height=a,t=c.getContext("2d");g<s;){for(n=0,i=0;n<r;)t.clearRect(0,0,a,a),t.drawImage(e,-n,-g),d.drawImage(c,0,0,a,a,i,m,h,f),n+=a,i+=h;g+=a,m+=f}d.restore(),c=t=null}():d.drawImage(e,0,0,l,u),n.qqImageRendered&&n.qqImageRendered(),c.success(),c)}function renderImageToCanvasWithCustomResizer(e){var t=e.blob,n=e.image,i=e.imageHeight,o=e.imageWidth,a=e.orientation,r=new qq.Promise,s=e.resize,l=document.createElement("canvas"),u=l.getContext("2d"),d=e.canvas,c=e.targetHeight,p=e.targetWidth;return transformCoordinate(l,o,i,a),d.height=c,d.width=p,u.drawImage(n,0,0),s({blob:t,height:c,image:n,sourceCanvas:l,targetCanvas:d,width:p}).then(function(){d.qqImageRendered&&d.qqImageRendered(),r.success()},r.failure),r}function transformCoordinate(e,t,n,i){switch(i){case 5:case 6:case 7:case 8:e.width=n,e.height=t;break;default:e.width=t,e.height=n}var o=e.getContext("2d");switch(i){case 2:o.translate(t,0),o.scale(-1,1);break;case 3:o.translate(t,n),o.rotate(Math.PI);break;case 4:o.translate(0,n),o.scale(1,-1);break;case 5:o.rotate(.5*Math.PI),o.scale(1,-1);break;case 6:o.rotate(.5*Math.PI),o.translate(0,-n);break;case 7:o.rotate(.5*Math.PI),o.translate(t,-n),o.scale(-1,1);break;case 8:o.rotate(-.5*Math.PI),o.translate(-t,0)}}function MegaPixImage(e,t){var n=this;window.Blob&&e instanceof Blob&&!function(){var t=new Image,i=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;if(!i)throw Error("No createObjectURL function found to create blob url");t.src=i.createObjectURL(e),n.blob=e,e=t}(),e.naturalWidth||e.naturalHeight||(e.onload=function(){var e=n.imageLoadListeners;e&&(n.imageLoadListeners=null,setTimeout(function(){for(var t=0,n=e.length;t<n;t++)e[t]()},0))},e.onerror=t,this.imageLoadListeners=[]),this.srcImage=e}MegaPixImage.prototype.render=function(e,t){t=t||{};var n,i=this,o=this.srcImage.naturalWidth,a=this.srcImage.naturalHeight,r=t.width,s=t.height,l=t.maxWidth,u=t.maxHeight,d=!this.blob||"image/jpeg"===this.blob.type,c=e.tagName.toLowerCase();return this.imageLoadListeners?void this.imageLoadListeners.push(function(){i.render(e,t)}):(r&&!s?s=a*r/o<<0:s&&!r?r=o*s/a<<0:(r=o,s=a),l&&r>l&&(r=l,s=a*r/o<<0),u&&s>u&&(s=u,r=o*s/a<<0),n={width:r,height:s},qq.each(t,function(e,t){n[e]=t}),"img"===c?!function(){var t=e.src;renderImageToDataURL(i.srcImage,i.blob,n,d).then(function(n){e.src=n,t===e.src&&e.onload()})}():"canvas"===c&&renderImageToCanvas(this.srcImage,this.blob,e,n,d),void("function"==typeof this.onrender&&this.onrender(e)))},qq.MegaPixImage=MegaPixImage}(),qq.ImageGenerator=function(e){"use strict";function isImg(e){return"img"===e.tagName.toLowerCase()}function isCanvas(e){return"canvas"===e.tagName.toLowerCase()}function isImgCorsSupported(){return void 0!==(new Image).crossOrigin}function isCanvasSupported(){var e=document.createElement("canvas");return e.getContext&&e.getContext("2d")}function determineMimeOfFileName(e){var t=e.split("/"),n=t[t.length-1].split("?")[0],i=qq.getExtension(n);switch(i=i&&i.toLowerCase()){case"jpeg":case"jpg":return"image/jpeg";case"png":return"image/png";case"bmp":return"image/bmp";case"gif":return"image/gif";case"tiff":case"tif":return"image/tiff"}}function isCrossOrigin(e){var t,n,i,o=document.createElement("a");return o.href=e,t=o.protocol,i=o.port,n=o.hostname,t.toLowerCase()!==window.location.protocol.toLowerCase()||(n.toLowerCase()!==window.location.hostname.toLowerCase()||i!==window.location.port&&!qq.ie())}function registerImgLoadListeners(t,n){t.onload=function(){t.onload=null,t.onerror=null,n.success(t)},t.onerror=function(){t.onload=null,t.onerror=null,e("Problem drawing thumbnail!","error"),n.failure(t,"Problem drawing thumbnail!")}}function registerCanvasDrawImageListener(e,t){e.qqImageRendered=function(){t.success(e)}}function registerThumbnailRenderedListener(t,n){var i=isImg(t)||isCanvas(t);return isImg(t)?registerImgLoadListeners(t,n):isCanvas(t)?registerCanvasDrawImageListener(t,n):(n.failure(t),e(qq.format("Element container of type {} is not supported!",t.tagName),"error")),i}function draw(t,n,i){var o=new qq.Promise,a=new qq.Identify(t,e),r=i.maxSize,s=null==i.orient||i.orient,l=function(){n.onerror=null,n.onload=null,e("Could not render preview, file may be too large!","error"),o.failure(n,"Browser cannot render image!")};return a.isPreviewable().then(function(a){var u={parse:function(){return(new qq.Promise).success()}},d=s?new qq.Exif(t,e):u,c=new qq.MegaPixImage(t,l);registerThumbnailRenderedListener(n,o)&&d.parse().then(function(e){var t=e&&e.Orientation;c.render(n,{maxWidth:r,maxHeight:r,orientation:t,mime:a,resize:i.customResizeFunction})},function(t){e(qq.format("EXIF data could not be parsed ({}). Assuming orientation = 1.",t)),c.render(n,{maxWidth:r,maxHeight:r,mime:a,resize:i.customResizeFunction})})},function(){e("Not previewable"),o.failure(n,"Not previewable")}),o}function drawOnCanvasOrImgFromUrl(e,t,n,i,o){var a=new Image,r=new qq.Promise;registerThumbnailRenderedListener(a,r),isCrossOrigin(e)&&(a.crossOrigin="anonymous"),a.src=e,r.then(function(){registerThumbnailRenderedListener(t,n);var r=new qq.MegaPixImage(a);r.render(t,{maxWidth:i,maxHeight:i,mime:determineMimeOfFileName(e),resize:o})},n.failure)}function drawOnImgFromUrlWithCssScaling(e,t,n,i){registerThumbnailRenderedListener(t,n),qq(t).css({maxWidth:i+"px",maxHeight:i+"px"}),t.src=e}function drawFromUrl(e,t,n){var i=new qq.Promise,o=n.scale,a=o?n.maxSize:null;return o&&isImg(t)?isCanvasSupported()?isCrossOrigin(e)&&!isImgCorsSupported()?drawOnImgFromUrlWithCssScaling(e,t,i,a):drawOnCanvasOrImgFromUrl(e,t,i,a):drawOnImgFromUrlWithCssScaling(e,t,i,a):isCanvas(t)?drawOnCanvasOrImgFromUrl(e,t,i,a):registerThumbnailRenderedListener(t,i)&&(t.src=e),i}qq.extend(this,{generate:function(t,n,i){return qq.isString(t)?(e("Attempting to update thumbnail based on server response."),drawFromUrl(t,n,i||{})):(e("Attempting to draw client-side image preview."),draw(t,n,i||{}))}}),this._testing={},this._testing.isImg=isImg,this._testing.isCanvas=isCanvas,this._testing.isCrossOrigin=isCrossOrigin,this._testing.determineMimeOfFileName=determineMimeOfFileName},qq.Exif=function(e,t){"use strict";function parseLittleEndian(e){for(var t=0,n=0;e.length>0;)t+=parseInt(e.substring(0,2),16)*Math.pow(2,n),e=e.substring(2,e.length),n+=8;return t}function seekToApp1(t,n){var i=t,o=n;return void 0===i&&(i=2,o=new qq.Promise),qq.readBlobToHex(e,i,4).then(function(e){var t,n=/^ffe([0-9])/.exec(e);n?"1"!==n[1]?(t=parseInt(e.slice(4,8),16),seekToApp1(i+t+2,o)):o.success(i):o.failure("No EXIF header to be found!")}),o}function getApp1Offset(){var t=new qq.Promise;return qq.readBlobToHex(e,0,6).then(function(e){0!==e.indexOf("ffd8")?t.failure("Not a valid JPEG!"):seekToApp1().then(function(e){t.success(e)},function(e){t.failure(e)})}),t}function isLittleEndian(t){var n=new qq.Promise;return qq.readBlobToHex(e,t+10,2).then(function(e){n.success("4949"===e)}),n}function getDirEntryCount(t,n){var i=new qq.Promise;return qq.readBlobToHex(e,t+18,2).then(function(e){return n?i.success(parseLittleEndian(e)):void i.success(parseInt(e,16))}),i}function getIfd(t,n){var i=t+20,o=12*n;return qq.readBlobToHex(e,i,o)}function getDirEntries(e){for(var t=[],n=0;n+24<=e.length;)t.push(e.slice(n,n+24)),n+=24;return t}function getTagValues(e,t){var o=16,a=qq.extend([],n),r={};return qq.each(t,function(t,n){var s,l,u,d=n.slice(0,4),c=e?parseLittleEndian(d):parseInt(d,16),p=a.indexOf(c);if(p>=0&&(l=i[c].name,u=i[c].bytes,s=n.slice(o,o+2*u),r[l]=e?parseLittleEndian(s):parseInt(s,16),a.splice(p,1)),0===a.length)return!1}),r}var n=[274],i={274:{name:"Orientation",bytes:2}};qq.extend(this,{parse:function(){var n=new qq.Promise,i=function(e){t(qq.format("EXIF header parse failed: '{}' ",e)),n.failure(e)};return getApp1Offset().then(function(o){t(qq.format("Moving forward with EXIF header parsing for '{}'",void 0===e.name?"blob":e.name)),isLittleEndian(o).then(function(e){t(qq.format("EXIF Byte order is {} endian",e?"little":"big")),getDirEntryCount(o,e).then(function(a){t(qq.format("Found {} APP1 directory entries",a)),getIfd(o,a).then(function(i){var o=getDirEntries(i),a=getTagValues(e,o);t("Successfully parsed some EXIF tags"),n.success(a)},i)},i)},i)},i),n}}),this._testing={},this._testing.parseLittleEndian=parseLittleEndian},qq.Identify=function(e,t){"use strict";function isIdentifiable(e,t){var n=!1,i=[].concat(e);return qq.each(i,function(e,i){if(0===t.indexOf(i))return n=!0,!1}),n}qq.extend(this,{isPreviewable:function(){var n=this,i=new qq.Promise,o=!1,a=void 0===e.name?"blob":e.name;return t(qq.format("Attempting to determine if {} can be rendered in this browser",a)),t("First pass: check type attribute of blob object."),this.isPreviewableSync()?(t("Second pass: check for magic bytes in file header."),qq.readBlobToHex(e,0,4).then(function(e){qq.each(n.PREVIEWABLE_MIME_TYPES,function(t,n){if(isIdentifiable(n,e))return("image/tiff"!==t||qq.supportedFeatures.tiffPreviews)&&(o=!0,i.success(t)),!1}),t(qq.format("'{}' is {} able to be rendered in this browser",a,o?"":"NOT")),o||i.failure()},function(){t("Error reading file w/ name '"+a+"'. Not able to be rendered in this browser."),i.failure()})):i.failure(),i},isPreviewableSync:function(){var n=e.type,i=qq.indexOf(Object.keys(this.PREVIEWABLE_MIME_TYPES),n)>=0,o=!1,a=void 0===e.name?"blob":e.name;return i&&(o="image/tiff"!==n||qq.supportedFeatures.tiffPreviews),!o&&t(a+" is not previewable in this browser per the blob's type attr"),o}})},qq.Identify.prototype.PREVIEWABLE_MIME_TYPES={"image/jpeg":"ffd8ff","image/gif":"474946","image/png":"89504e","image/bmp":"424d","image/tiff":["49492a00","4d4d002a"]},qq.ImageValidation=function(e,t){"use strict";function hasNonZeroLimits(e){var t=!1;return qq.each(e,function(e,n){if(n>0)return t=!0,!1}),t}function getWidthHeight(){var n=new qq.Promise;return new qq.Identify(e,t).isPreviewable().then(function(){var i=new Image,o=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;o?(i.onerror=function(){t("Cannot determine dimensions for image. May be too large.","error"),n.failure()},i.onload=function(){n.success({width:this.width,height:this.height})},i.src=o.createObjectURL(e)):(t("No createObjectURL function available to generate image URL!","error"),n.failure())},n.failure),n}function getFailingLimit(e,t){var n;return qq.each(e,function(e,i){if(i>0){var o=/(max|min)(Width|Height)/.exec(e),a=o[2].charAt(0).toLowerCase()+o[2].slice(1),r=t[a];switch(o[1]){case"min":if(r<i)return n=e,!1;break;case"max":if(r>i)return n=e,!1}}}),n}this.validate=function(e){var n=new qq.Promise;return t("Attempting to validate image."),hasNonZeroLimits(e)?getWidthHeight().then(function(t){var i=getFailingLimit(e,t);i?n.failure(i):n.success()},n.success):n.success(),n}},qq.Session=function(e){"use strict";function isJsonResponseValid(e){return!!qq.isArray(e)||void t.log("Session response is not an array.","error")}function handleFileItems(e,n,i,o){var a=!1;n=n&&isJsonResponseValid(e),n&&qq.each(e,function(e,n){if(null==n.uuid)a=!0,t.log(qq.format("Session response item {} did not include a valid UUID - ignoring.",e),"error");else if(null==n.name)a=!0,t.log(qq.format("Session response item {} did not include a valid name - ignoring.",e),"error");else try{return t.addFileRecord(n),!0}catch(i){a=!0,t.log(i.message,"error")}return!1}),o[n&&!a?"success":"failure"](e,i)}var t={endpoint:null,params:{},customHeaders:{},cors:{},addFileRecord:function(e){},log:function(e,t){}};qq.extend(t,e,!0),this.refresh=function(){var e=new qq.Promise,n=function(t,n,i){handleFileItems(t,n,i,e)},i=qq.extend({},t),o=new qq.SessionAjaxRequester(qq.extend(i,{onComplete:n}));return o.queryServer(),e}},qq.SessionAjaxRequester=function(e){"use strict";function onComplete(e,t,i){var o=null;if(null!=t.responseText)try{o=qq.parseJson(t.responseText)}catch(a){n.log("Problem parsing session response: "+a.message,"error"),i=!0}n.onComplete(o,!i,t)}var t,n={endpoint:null,customHeaders:{},params:{},cors:{expected:!1,sendCredentials:!1},onComplete:function(e,t,n){},log:function(e,t){}};qq.extend(n,e),t=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:["GET"],method:"GET",endpointStore:{get:function(){return n.endpoint}},customHeaders:n.customHeaders,log:n.log,onComplete:onComplete,cors:n.cors})),qq.extend(this,{queryServer:function(){var e=qq.extend({},n.params);n.log("Session query request."),t.initTransport("sessionRefresh").withParams(e).withCacheBuster().send()}})},qq.Scaler=function(e,t){"use strict";var n=e.customResizer,i=e.sendOriginal,o=e.orient,a=e.defaultType,r=e.defaultQuality/100,s=e.failureText,l=e.includeExif,u=this._getSortedSizes(e.sizes);qq.extend(this,{enabled:qq.supportedFeatures.scaling&&u.length>0,getFileRecords:function(e,d,c){var p=this,h=[],f=c.blob?c.blob:c,g=new qq.Identify(f,t);return g.isPreviewableSync()?(qq.each(u,function(e,i){var u=p._determineOutputType({defaultType:a,requestedType:i.type,refType:f.type});h.push({uuid:qq.getUniqueId(),name:p._getName(d,{name:i.name,type:u,refType:f.type}),blob:new qq.BlobProxy(f,qq.bind(p._generateScaledImage,p,{customResizeFunction:n,maxSize:i.maxSize,orient:o,type:u,quality:r,failedText:s,includeExif:l,log:t}))})}),h.push({uuid:e,name:d,size:f.size,blob:i?f:null})):h.push({uuid:e,name:d,size:f.size,blob:f}),h},handleNewFile:function(e,t,n,i,o,a,r,s){var l=this,u=(e.qqButtonId||e.blob&&e.blob.qqButtonId,[]),d=null,c=s.addFileToHandler,p=s.uploadData,h=s.paramsStore,f=qq.getUniqueId();qq.each(l.getFileRecords(n,t,e),function(e,t){var n,i=t.size;t.blob instanceof qq.BlobProxy&&(i=-1),n=p.addFile({uuid:t.uuid,name:t.name,size:i,batchId:a,proxyGroupId:f}),t.blob instanceof qq.BlobProxy?u.push(n):d=n,t.blob?(c(n,t.blob),o.push({id:n,file:t.blob})):p.setStatus(n,qq.status.REJECTED)}),null!==d&&(qq.each(u,function(e,t){var n={qqparentuuid:p.retrieve({id:d}).uuid,qqparentsize:p.retrieve({id:d}).size};n[r]=p.retrieve({id:t}).uuid,p.setParentId(t,d),h.addReadOnly(t,n)}),u.length&&!function(){var e={};e[r]=p.retrieve({id:d}).uuid,h.addReadOnly(d,e)}())}})},qq.extend(qq.Scaler.prototype,{scaleImage:function(e,t,n){"use strict";if(!qq.supportedFeatures.scaling)throw new qq.Error("Scaling is not supported in this browser!");var i=new qq.Promise,o=n.log,a=n.getFile(e),r=n.uploadData.retrieve({id:e}),s=r&&r.name,l=r&&r.uuid,u={customResizer:t.customResizer,sendOriginal:!1,orient:t.orient,defaultType:t.type||null,defaultQuality:t.quality,failedToScaleText:"Unable to scale",sizes:[{name:"",maxSize:t.maxSize}]},d=new qq.Scaler(u,o);return qq.Scaler&&qq.supportedFeatures.imagePreviews&&a?qq.bind(function(){var t=d.getFileRecords(l,s,a)[0];t&&t.blob instanceof qq.BlobProxy?t.blob.create().then(i.success,i.failure):(o(e+" is not a scalable image!","error"),i.failure())},this)():(i.failure(),o("Could not generate requested scaled image for "+e+". Scaling is either not possible in this browser, or the file could not be located.","error")),i},_determineOutputType:function(e){"use strict";var t=e.requestedType,n=e.defaultType,i=e.refType;return n||t?t&&qq.indexOf(Object.keys(qq.Identify.prototype.PREVIEWABLE_MIME_TYPES),t)>=0?"image/tiff"===t?qq.supportedFeatures.tiffPreviews?t:n:t:n:"image/jpeg"!==i?"image/png":i},_getName:function(e,t){"use strict";var n=e.lastIndexOf("."),i=t.type||"image/png",o=t.refType,a="",r=qq.getExtension(e),s="";return t.name&&t.name.trim().length&&(s=" ("+t.name+")"),n>=0?(a=e.substr(0,n),o!==i&&(r=i.split("/")[1]),a+=s+"."+r):a=e+s,a},_getSortedSizes:function(e){"use strict";return e=qq.extend([],e),e.sort(function(e,t){return e.maxSize>t.maxSize?1:e.maxSize<t.maxSize?-1:0})},_generateScaledImage:function(e,t){"use strict";var n=this,i=e.customResizeFunction,o=e.log,a=e.maxSize,r=e.orient,s=e.type,l=e.quality,u=e.failedText,d=e.includeExif&&"image/jpeg"===t.type&&"image/jpeg"===s,c=new qq.Promise,p=new qq.ImageGenerator(o),h=document.createElement("canvas");return o("Attempting to generate scaled version for "+t.name),p.generate(t,h,{maxSize:a,orient:r,customResizeFunction:i}).then(function(){var e=h.toDataURL(s,l),i=function(){o("Success generating scaled version for "+t.name);var n=qq.dataUriToBlob(e);c.success(n)};d?n._insertExifHeader(t,e,o).then(function(t){e=t,i()},function(){o("Problem inserting EXIF header into scaled image. Using scaled image w/out EXIF data.","error"),i()}):i()},function(){o("Failed attempt to generate scaled version for "+t.name,"error"),c.failure(u)}),c},_insertExifHeader:function(e,t,n){"use strict";var i=new FileReader,o=new qq.Promise,a="";return i.onload=function(){a=i.result,o.success(qq.ExifRestorer.restore(a,t))},i.onerror=function(){n("Problem reading "+e.name+" during attempt to transfer EXIF data to scaled version.","error"),o.failure()},i.readAsDataURL(e),o},_dataUriToBlob:function(e){"use strict";var t,n,i,o;return t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):decodeURI(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),o=new Uint8Array(i),qq.each(t,function(e,t){o[e]=t.charCodeAt(0)}),this._createBlob(i,n)},_createBlob:function(e,t){"use strict";var n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,i=n&&new n;return i?(i.append(e),i.getBlob(t)):new Blob([e],{type:t})}}),qq.ExifRestorer=function(){var e={};return e.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e.encode64=function(e){var t,n,i,o,a,r="",s="",l="",u=0;do t=e[u++],n=e[u++],s=e[u++],i=t>>2,o=(3&t)<<4|n>>4,a=(15&n)<<2|s>>6,l=63&s,isNaN(n)?a=l=64:isNaN(s)&&(l=64),r=r+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l),t=n=s="",i=o=a=l="";while(u<e.length);return r},e.restore=function(e,t){var n="data:image/jpeg;base64,";if(!e.match(n))return t;var i=this.decode64(e.replace(n,"")),o=this.slice2Segments(i),a=this.exifManipulation(t,o);return n+this.encode64(a)},e.exifManipulation=function(e,t){var n=this.getExifArray(t),i=this.insertExif(e,n),o=new Uint8Array(i);return o},e.getExifArray=function(e){for(var t,n=0;n<e.length;n++)if(t=e[n],255==t[0]&225==t[1])return t;return[]},e.insertExif=function(e,t){var n=e.replace("data:image/jpeg;base64,",""),i=this.decode64(n),o=i.indexOf(255,3),a=i.slice(0,o),r=i.slice(o),s=a;return s=s.concat(t),s=s.concat(r)},e.slice2Segments=function(e){for(var t=0,n=[];;){if(255==e[t]&218==e[t+1])break;if(255==e[t]&216==e[t+1])t+=2;else{var i=256*e[t+2]+e[t+3],o=t+i+2,a=e.slice(t,o);n.push(a),t=o}if(t>e.length)break}return n},e.decode64=function(e){var t,n,i,o,a,r="",s="",l=0,u=[],d=/[^A-Za-z0-9\+\/\=]/g;if(d.exec(e))throw new Error("There were invalid base64 characters in the input text. Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='");e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do i=this.KEY_STR.indexOf(e.charAt(l++)),o=this.KEY_STR.indexOf(e.charAt(l++)),a=this.KEY_STR.indexOf(e.charAt(l++)),s=this.KEY_STR.indexOf(e.charAt(l++)),t=i<<2|o>>4,n=(15&o)<<4|a>>2,r=(3&a)<<6|s,u.push(t),64!=a&&u.push(n),64!=s&&u.push(r),t=n=r="",
5
5
  i=o=a=s="";while(l<e.length);return u},e}(),qq.TotalProgress=function(e,t){"use strict";var n={},i=0,o=0,a=-1,r=-1,s=function(t,n){t===a&&n===r||e(t,n),a=t,r=n},l=function(e,t){var n=!0;return qq.each(e,function(e,i){if(qq.indexOf(t,i)>=0)return n=!1,!1}),n},u=function(e){p(e,-1,-1),delete n[e]},d=function(e,t,n){(0===t.length||l(t,n))&&(s(o,o),this.reset())},c=function(e){var i=t(e);i>0&&(p(e,0,i),n[e]={loaded:0,total:i})},p=function(e,t,a){var r=n[e]?n[e].loaded:0,l=n[e]?n[e].total:0;t===-1&&a===-1?(i-=r,o-=l):(t&&(i+=t-r),a&&(o+=a-l)),s(i,o)};qq.extend(this,{onAllComplete:d,onStatusChange:function(e,t,n){n===qq.status.CANCELED||n===qq.status.REJECTED?u(e):n===qq.status.SUBMITTING&&c(e)},onIndividualProgress:function(e,t,i){p(e,t,i),n[e]={loaded:t,total:i}},onNewSize:function(e){c(e)},reset:function(){n={},i=0,o=0}})},qq.PasteSupport=function(e){"use strict";function isImage(e){return e.type&&0===e.type.indexOf("image/")}function registerPasteHandler(){n=qq(t.targetElement).attach("paste",function(e){var n=e.clipboardData;n&&qq.each(n.items,function(e,n){if(isImage(n)){var i=n.getAsFile();t.callbacks.pasteReceived(i)}})})}function unregisterPasteHandler(){n&&n()}var t,n;t={targetElement:null,callbacks:{log:function(e,t){},pasteReceived:function(e){}}},qq.extend(t,e),registerPasteHandler(),qq.extend(this,{reset:function(){unregisterPasteHandler()}})},qq.FormSupport=function(e,t,n){"use strict";function determineNewEndpoint(e){e.getAttribute("action")&&(i.newEndpoint=e.getAttribute("action"))}function validateForm(e,t){return!(e.checkValidity&&!e.checkValidity())||(n("Form did not pass validation checks - will not upload.","error"),void t())}function maybeUploadOnSubmit(e){var n=e.submit;qq(e).attach("submit",function(i){i=i||window.event,i.preventDefault?i.preventDefault():i.returnValue=!1,validateForm(e,n)&&t()}),e.submit=function(){validateForm(e,n)&&t()}}function determineFormEl(e){return e&&(qq.isString(e)&&(e=document.getElementById(e)),e&&(n("Attaching to form element."),determineNewEndpoint(e),o&&maybeUploadOnSubmit(e))),e}var i=this,o=e.interceptSubmit,a=e.element,r=e.autoUpload;qq.extend(this,{newEndpoint:null,newAutoUpload:r,attachedToForm:!1,getFormInputsAsObject:function(){return null==a?null:i._form2Obj(a)}}),a=determineFormEl(a),this.attachedToForm=!!a},qq.extend(qq.FormSupport.prototype,{_form2Obj:function(e){"use strict";var t={},n=function(e){var t=["button","image","reset","submit"];return qq.indexOf(t,e.toLowerCase())<0},i=function(e){return qq.indexOf(["checkbox","radio"],e.toLowerCase())>=0},o=function(e){return!(!i(e.type)||e.checked)||e.disabled&&"hidden"!==e.type.toLowerCase()},a=function(e){var t=null;return qq.each(qq(e).children(),function(e,n){if("option"===n.tagName.toLowerCase()&&n.selected)return t=n.value,!1}),t};return qq.each(e.elements,function(e,i){if(!qq.isInput(i,!0)&&"textarea"!==i.tagName.toLowerCase()||!n(i.type)||o(i)){if("select"===i.tagName.toLowerCase()&&!o(i)){var r=a(i);null!==r&&(t[i.name]=r)}}else t[i.name]=i.value}),t}}),qq.traditional=qq.traditional||{},qq.traditional.FormUploadHandler=function(e,t){"use strict";function getIframeContentJson(e,t){var i,o,r;try{o=t.contentDocument||t.contentWindow.document,r=o.body.innerHTML,a("converting iframe's innerHTML to JSON"),a("innerHTML = "+r),r&&r.match(/^<pre/i)&&(r=o.body.firstChild.firstChild.nodeValue),i=n._parseJsonResponse(r)}catch(s){a("Error when attempting to parse form upload response ("+s.message+")","error"),i={success:!1}}return i}function createForm(t,a){var r=e.paramsStore.get(t),s="get"===e.method.toLowerCase()?"GET":"POST",l=e.endpointStore.get(t),u=i(t);return r[e.uuidName]=o(t),r[e.filenameParam]=u,n._initFormForUpload({method:s,endpoint:l,params:r,paramsInBody:e.paramsInBody,targetName:a.name})}var n=this,i=t.getName,o=t.getUuid,a=t.log;this.uploadFile=function(t){var i,o=n.getInput(t),r=n._createIframe(t),s=new qq.Promise;return i=createForm(t,r),i.appendChild(o),n._attachLoadEvent(r,function(i){a("iframe loaded");var o=i?i:getIframeContentJson(t,r);n._detachLoadEvent(t),e.cors.expected||qq(r).remove(),o.success?s.success(o):s.failure(o)}),a("Sending upload request for "+t),i.submit(),qq(i).remove(),s},qq.extend(this,new qq.FormUploadHandler({options:{isCors:e.cors.expected,inputName:e.inputName},proxy:{onCancel:e.onCancel,getName:i,getUuid:o,log:a}}))},qq.traditional=qq.traditional||{},qq.traditional.XhrUploadHandler=function(e,t){"use strict";var n=this,i=t.getName,o=t.getSize,a=t.getUuid,r=t.log,s=e.forceMultipart||e.paramsInBody,l=function(t,n,a){var r=o(t),l=i(t);e.omitDefaultParams||(n[e.chunking.paramNames.partIndex]=a.part,n[e.chunking.paramNames.partByteOffset]=a.start,n[e.chunking.paramNames.chunkSize]=a.size,n[e.chunking.paramNames.totalParts]=a.count,n[e.totalFileSizeName]=r),s&&!e.omitDefaultParams&&(n[e.filenameParam]=l)},u=new qq.traditional.AllChunksDoneAjaxRequester({cors:e.cors,endpoint:e.chunking.success.endpoint,headers:e.chunking.success.headers,jsonPayload:e.chunking.success.jsonPayload,log:r,method:e.chunking.success.method,params:e.chunking.success.params}),d=function(e,t){var n=new qq.Promise;return t.onreadystatechange=function(){if(4===t.readyState){var i=h(e,t);i.success?n.success(i.response,t):n.failure(i.response,t)}},n},c=function(t){var r=e.paramsStore.get(t),s=i(t),l=o(t);return r[e.uuidName]=a(t),r[e.filenameParam]=s,r[e.totalFileSizeName]=l,r[e.chunking.paramNames.totalParts]=n._getTotalChunks(t),r},p=function(t,n){return qq.indexOf([200,201,202,203,204],t.status)<0||e.requireSuccessJson&&!n.success||n.reset},h=function(e,t){var n;return r("xhr - server response received for "+e),r("responseText = "+t.responseText),n=f(!0,t),{success:!p(t,n),response:n}},f=function(t,n){var i={};try{r(qq.format("Received response status {} with body: {}",n.status,n.responseText)),i=qq.parseJson(n.responseText)}catch(o){t&&e.requireSuccessJson&&r("Error when attempting to parse xhr response text ("+o.message+")","error")}return i},g=function(t){var i=new qq.Promise;return u.complete(t,n._createXhr(t),c(t),e.customHeaders.get(t)).then(function(e){i.success(f(!1,e),e)},function(e){i.failure(f(!1,e),e)}),i},m=function(t){var n,r=t.fileOrBlob,l=t.id,u=t.xhr,d=t.xhrOverrides||{},c=t.customParams||{},p=t.params||{},h=d.params||{},f=s?new FormData:null,g=d.method||e.method,m=d.endpoint||e.endpointStore.get(l),v=i(l),b=o(l);return e.omitDefaultParams?(n=qq.extend({},c),qq.extend(n,h)):(n=qq.extend({},c),qq.extend(n,h),qq.extend(n,p),n[e.uuidName]=a(l),n[e.filenameParam]=v,s?n[e.totalFileSizeName]=b:e.paramsInBody||(n[e.inputName]=v)),e.paramsInBody||(m=qq.obj2url(n,m)),u.open(g,m,!0),e.cors.expected&&e.cors.sendCredentials&&(u.withCredentials=!0),s?(e.paramsInBody&&qq.obj2FormData(n,f),f.append(e.inputName,r),f):r},v=function(t){var i=t.headerOverrides,o=t.id,a=t.xhr;if(i)qq.each(i,function(e,t){a.setRequestHeader(e,t)});else{var r=e.customHeaders.get(o),l=n.getFile(o);a.setRequestHeader("Accept","application/json"),a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.setRequestHeader("Cache-Control","no-cache"),s||(a.setRequestHeader("Content-Type","application/octet-stream"),a.setRequestHeader("X-Mime-Type",l.type)),qq.each(r,function(e,t){a.setRequestHeader(e,t)})}};qq.extend(this,{uploadChunk:function(t){var i,o,a,r=t.id,s=t.chunkIdx,u=t.overrides||{},c=t.resuming,p=n._getChunkData(r,s),h=n._createXhr(r,s),f={};return i=d(r,h),n._registerProgressHandler(r,s,p.size),a=e.paramsStore.get(r),l(r,f,p),c&&(f[e.resume.paramNames.resuming]=!0),o=m({fileOrBlob:p.blob,id:r,customParams:a,params:f,xhr:h,xhrOverrides:u}),v({headerOverrides:u.headers,id:r,xhr:h}),h.send(o),i},uploadFile:function(t){var i,o,a,r,s=n.getFile(t);return o=n._createXhr(t),n._registerProgressHandler(t),i=d(t,o),a=e.paramsStore.get(t),r=m({fileOrBlob:s,id:t,customParams:a,xhr:o}),v({id:t,xhr:o}),o.send(r),i}}),qq.extend(this,new qq.XhrUploadHandler({options:qq.extend({namespace:"traditional"},e),proxy:qq.extend({getEndpoint:e.endpointStore.get},t)})),qq.override(this,function(n){return{finalizeChunks:function(i){return t.onFinalizing(i),e.chunking.success.endpoint?g(i):n.finalizeChunks(i,qq.bind(f,this,!0))}}})},qq.traditional.AllChunksDoneAjaxRequester=function(e){"use strict";var t,n={cors:{allowXdr:!1,expected:!1,sendCredentials:!1},endpoint:null,log:function(e,t){},method:"POST"},i={},o={get:function(e){return qq.isFunction(n.endpoint)?n.endpoint(e):n.endpoint}};qq.extend(n,e),t=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",contentType:n.jsonPayload?"application/json":"application/x-www-form-urlencoded",validMethods:[n.method],method:n.method,endpointStore:o,allowXRequestedWithAndCacheControl:!1,cors:n.cors,log:n.log,onComplete:function(e,t,n){var o=i[e];delete i[e],n?o.failure(t):o.success(t)}})),qq.extend(this,{complete:function(e,o,a,r){var s=new qq.Promise;return n.log("Submitting All Chunks Done request for "+e),i[e]=s,t.initTransport(e).withParams(n.params(e)||a).withHeaders(n.headers(e)||r).send(o),s}})},qq.DragAndDrop=function(e){"use strict";function uploadDroppedFiles(e,n){var i=Array.prototype.slice.call(e);t.callbacks.dropLog("Grabbed "+e.length+" dropped files."),n.dropDisabled(!1),t.callbacks.processingDroppedFilesComplete(i,n.getElement())}function traverseFileTree(e){var n=new qq.Promise;return e.isFile?e.file(function(t){t.qqPath=extractDirectoryPath(e),a.push(t),n.success()},function(i){t.callbacks.dropLog("Problem parsing '"+e.fullPath+"'. FileError code "+i.code+".","error"),n.failure()}):e.isDirectory&&getFilesInDirectory(e).then(function(e){var t=e.length;qq.each(e,function(e,i){traverseFileTree(i).done(function(){t-=1,0===t&&n.success()})}),e.length||n.success()},function(i){t.callbacks.dropLog("Problem parsing '"+e.fullPath+"'. FileError code "+i.code+".","error"),n.failure()}),n}function extractDirectoryPath(e){var t=e.name,n=e.fullPath,i=n.lastIndexOf(t);return n=n.substr(0,i),"/"===n.charAt(0)&&(n=n.substr(1)),n}function getFilesInDirectory(e,t,n,i){var o=i||new qq.Promise,a=t||e.createReader();return a.readEntries(function(t){var i=n?n.concat(t):t;t.length?setTimeout(function(){getFilesInDirectory(e,a,i,o)},0):o.success(i)},o.failure),o}function handleDataTransfer(e,n){var i=[],o=new qq.Promise;return t.callbacks.processingDroppedFiles(),n.dropDisabled(!0),e.files.length>1&&!t.allowMultipleItems?(t.callbacks.processingDroppedFilesComplete([]),t.callbacks.dropError("tooManyFilesError",""),n.dropDisabled(!1),o.failure()):(a=[],qq.isFolderDropSupported(e)?qq.each(e.items,function(e,t){var n=t.webkitGetAsEntry();n&&(n.isFile?a.push(t.getAsFile()):i.push(traverseFileTree(n).done(function(){i.pop(),0===i.length&&o.success()})))}):a=e.files,0===i.length&&o.success()),o}function setupDropzone(e){var s=new qq.UploadDropZone({HIDE_ZONES_EVENT_NAME:n,element:e,onEnter:function(n){qq(e).addClass(t.classes.dropActive),n.stopPropagation()},onLeaveNotDescendants:function(n){qq(e).removeClass(t.classes.dropActive)},onDrop:function(e){handleDataTransfer(e.dataTransfer,s).then(function(){uploadDroppedFiles(a,s)},function(){t.callbacks.dropLog("Drop event DataTransfer parsing failed. No files will be uploaded.","error")})}});return r.addDisposer(function(){s.dispose()}),qq(e).hasAttribute(i)&&qq(e).hide(),o.push(s),s}function isFileDrag(e){var t;return qq.each(e.dataTransfer.types,function(e,n){if("Files"===n)return t=!0,!1}),t}function leavingDocumentOut(e){return qq.safari()?e.x<0||e.y<0:0===e.x&&0===e.y}function setupDragDrop(){var e=t.dropZoneElements,o=function(){setTimeout(function(){qq.each(e,function(e,n){qq(n).hasAttribute(i)&&qq(n).hide(),qq(n).removeClass(t.classes.dropActive)})},10)};qq.each(e,function(t,n){var o=setupDropzone(n);e.length&&qq.supportedFeatures.fileDrop&&r.attach(document,"dragenter",function(t){!o.dropDisabled()&&isFileDrag(t)&&qq.each(e,function(e,t){t instanceof HTMLElement&&qq(t).hasAttribute(i)&&qq(t).css({display:"block"})})})}),r.attach(document,"dragleave",function(e){leavingDocumentOut(e)&&o()}),r.attach(qq(document).children()[0],"mouseenter",function(e){o()}),r.attach(document,"drop",function(e){isFileDrag(e)&&(e.preventDefault(),o())}),r.attach(document,n,o)}var t,n="qq-hidezones",i="qq-hide-dropzone",o=[],a=[],r=new qq.DisposeSupport;t={dropZoneElements:[],allowMultipleItems:!0,classes:{dropActive:null},callbacks:new qq.DragAndDrop.callbacks},qq.extend(t,e,!0),setupDragDrop(),qq.extend(this,{setupExtraDropzone:function(e){t.dropZoneElements.push(e),setupDropzone(e)},removeDropzone:function(e){var n,i=t.dropZoneElements;for(n in i)if(i[n]===e)return i.splice(n,1)},dispose:function(){r.dispose(),qq.each(o,function(e,t){t.dispose()})}}),this._testing={},this._testing.extractDirectoryPath=extractDirectoryPath},qq.DragAndDrop.callbacks=function(){"use strict";return{processingDroppedFiles:function(){},processingDroppedFilesComplete:function(e,t){},dropError:function(e,t){qq.log("Drag & drop error code '"+e+" with these specifics: '"+t+"'","error")},dropLog:function(e,t){qq.log(e,t)}}},qq.UploadDropZone=function(e){"use strict";function dragoverShouldBeCanceled(){return qq.safari()||qq.firefox()&&qq.windows()}function disableDropOutside(e){o||(dragoverShouldBeCanceled?a.attach(document,"dragover",function(e){e.preventDefault()}):a.attach(document,"dragover",function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="none",e.preventDefault())}),o=!0)}function isValidFileDrag(e){if(!qq.supportedFeatures.fileDrop)return!1;var t,n=e.dataTransfer,i=qq.safari();return t=!(!qq.ie()||!qq.supportedFeatures.fileDrop)||"none"!==n.effectAllowed,n&&t&&(n.files&&n.files.length||!i&&n.types.contains&&n.types.contains("Files")||n.types.includes&&n.types.includes("Files"))}function isOrSetDropDisabled(e){return void 0!==e&&(i=e),i}function triggerHidezonesEvent(){function triggerUsingOldApi(){e=document.createEvent("Event"),e.initEvent(t.HIDE_ZONES_EVENT_NAME,!0,!0)}var e;if(window.CustomEvent)try{e=new CustomEvent(t.HIDE_ZONES_EVENT_NAME)}catch(n){triggerUsingOldApi()}else triggerUsingOldApi();document.dispatchEvent(e)}function attachEvents(){a.attach(n,"dragover",function(e){if(isValidFileDrag(e)){var t=qq.ie()&&qq.supportedFeatures.fileDrop?null:e.dataTransfer.effectAllowed;"move"===t||"linkMove"===t?e.dataTransfer.dropEffect="move":e.dataTransfer.dropEffect="copy",e.stopPropagation(),e.preventDefault()}}),a.attach(n,"dragenter",function(e){if(!isOrSetDropDisabled()){if(!isValidFileDrag(e))return;t.onEnter(e)}}),a.attach(n,"dragleave",function(e){if(isValidFileDrag(e)){t.onLeave(e);var n=document.elementFromPoint(e.clientX,e.clientY);qq(this).contains(n)||t.onLeaveNotDescendants(e)}}),a.attach(n,"drop",function(e){if(!isOrSetDropDisabled()){if(!isValidFileDrag(e))return;e.preventDefault(),e.stopPropagation(),t.onDrop(e),triggerHidezonesEvent()}})}var t,n,i,o,a=new qq.DisposeSupport;t={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}},qq.extend(t,e),n=t.element,disableDropOutside(),attachEvents(),qq.extend(this,{dropDisabled:function(e){return isOrSetDropDisabled(e)},dispose:function(){a.dispose()},getElement:function(){return n}}),this._testing={},this._testing.isValidFileDrag=isValidFileDrag},function(){"use strict";qq.uiPublicApi={addInitialFiles:function(e){this._parent.prototype.addInitialFiles.apply(this,arguments),this._templating.addCacheToDom()},clearStoredFiles:function(){this._parent.prototype.clearStoredFiles.apply(this,arguments),this._templating.clearFiles()},addExtraDropzone:function(e){this._dnd&&this._dnd.setupExtraDropzone(e)},removeExtraDropzone:function(e){if(this._dnd)return this._dnd.removeDropzone(e)},getItemByFileId:function(e){if(!this._templating.isHiddenForever(e))return this._templating.getFileContainer(e)},reset:function(){this._parent.prototype.reset.apply(this,arguments),this._templating.reset(),!this._options.button&&this._templating.getButton()&&(this._defaultButtonId=this._createUploadButton({element:this._templating.getButton(),title:this._options.text.fileInputTitle}).getButtonId()),this._dnd&&(this._dnd.dispose(),this._dnd=this._setupDragAndDrop()),this._totalFilesInBatch=0,this._filesInBatchAddedToUi=0,this._setupClickAndEditEventHandlers()},setName:function(e,t){var n=this._options.formatFileName(t);this._parent.prototype.setName.apply(this,arguments),this._templating.updateFilename(e,n)},pauseUpload:function(e){var t=this._parent.prototype.pauseUpload.apply(this,arguments);return t&&this._templating.uploadPaused(e),t},continueUpload:function(e){var t=this._parent.prototype.continueUpload.apply(this,arguments);return t&&this._templating.uploadContinued(e),t},getId:function(e){return this._templating.getFileId(e)},getDropTarget:function(e){var t=this.getFile(e);return t.qqDropTarget}},qq.uiPrivateApi={_getButton:function(e){var t=this._parent.prototype._getButton.apply(this,arguments);return t||e===this._defaultButtonId&&(t=this._templating.getButton()),t},_removeFileItem:function(e){this._templating.removeFile(e)},_setupClickAndEditEventHandlers:function(){this._fileButtonsClickHandler=qq.FileButtonsClickHandler&&this._bindFileButtonsClickEvent(),this._focusinEventSupported=!qq.firefox(),this._isEditFilenameEnabled()&&(this._filenameClickHandler=this._bindFilenameClickEvent(),this._filenameInputFocusInHandler=this._bindFilenameInputFocusInEvent(),this._filenameInputFocusHandler=this._bindFilenameInputFocusEvent())},_setupDragAndDrop:function(){var e=this,t=this._options.dragAndDrop.extraDropzones,n=this._templating,i=n.getDropZone();return i&&t.push(i),new qq.DragAndDrop({dropZoneElements:t,allowMultipleItems:this._options.multiple,classes:{dropActive:this._options.classes.dropActive},callbacks:{processingDroppedFiles:function(){n.showDropProcessing()},processingDroppedFilesComplete:function(t,i){n.hideDropProcessing(),qq.each(t,function(e,t){t.qqDropTarget=i}),t.length&&e.addFiles(t,null,null)},dropError:function(t,n){e._itemError(t,n)},dropLog:function(t,n){e.log(t,n)}}})},_bindFileButtonsClickEvent:function(){var e=this;return new qq.FileButtonsClickHandler({templating:this._templating,log:function(t,n){e.log(t,n)},onDeleteFile:function(t){e.deleteFile(t)},onCancel:function(t){e.cancel(t)},onRetry:function(t){e.retry(t)},onPause:function(t){e.pauseUpload(t)},onContinue:function(t){e.continueUpload(t)},onGetName:function(t){return e.getName(t)}})},_isEditFilenameEnabled:function(){return this._templating.isEditFilenamePossible()&&!this._options.autoUpload&&qq.FilenameClickHandler&&qq.FilenameInputFocusHandler&&qq.FilenameInputFocusHandler},_filenameEditHandler:function(){var e=this,t=this._templating;return{templating:t,log:function(t,n){e.log(t,n)},onGetUploadStatus:function(t){return e.getUploads({id:t}).status},onGetName:function(t){return e.getName(t)},onSetName:function(t,n){e.setName(t,n)},onEditingStatusChange:function(e,n){var i=qq(t.getEditInput(e)),o=qq(t.getFileContainer(e));n?(i.addClass("qq-editing"),t.hideFilename(e),t.hideEditIcon(e)):(i.removeClass("qq-editing"),t.showFilename(e),t.showEditIcon(e)),o.addClass("qq-temp").removeClass("qq-temp")}}},_onUploadStatusChange:function(e,t,n){this._parent.prototype._onUploadStatusChange.apply(this,arguments),this._isEditFilenameEnabled()&&this._templating.getFileContainer(e)&&n!==qq.status.SUBMITTED&&(this._templating.markFilenameEditable(e),this._templating.hideEditIcon(e)),t===qq.status.UPLOAD_RETRYING&&n===qq.status.UPLOADING?(this._templating.hideRetry(e),this._templating.setStatusText(e),qq(this._templating.getFileContainer(e)).removeClass(this._classes.retrying)):n===qq.status.UPLOAD_FAILED&&this._templating.hidePause(e)},_bindFilenameInputFocusInEvent:function(){var e=qq.extend({},this._filenameEditHandler());return new qq.FilenameInputFocusInHandler(e)},_bindFilenameInputFocusEvent:function(){var e=qq.extend({},this._filenameEditHandler());return new qq.FilenameInputFocusHandler(e)},_bindFilenameClickEvent:function(){var e=qq.extend({},this._filenameEditHandler());return new qq.FilenameClickHandler(e)},_storeForLater:function(e){this._parent.prototype._storeForLater.apply(this,arguments),this._templating.hideSpinner(e)},_onAllComplete:function(e,t){this._parent.prototype._onAllComplete.apply(this,arguments),this._templating.resetTotalProgress()},_onSubmit:function(e,t){var n=this.getFile(e);n&&n.qqPath&&this._options.dragAndDrop.reportDirectoryPaths&&this._paramsStore.addReadOnly(e,{qqpath:n.qqPath}),this._parent.prototype._onSubmit.apply(this,arguments),this._addToList(e,t)},_onSubmitted:function(e){this._isEditFilenameEnabled()&&(this._templating.markFilenameEditable(e),this._templating.showEditIcon(e),this._focusinEventSupported||this._filenameInputFocusHandler.addHandler(this._templating.getEditInput(e)))},_onProgress:function(e,t,n,i){this._parent.prototype._onProgress.apply(this,arguments),this._templating.updateProgress(e,n,i),0===i||100===Math.round(n/i*100)?(this._templating.hideCancel(e),this._templating.hidePause(e),this._templating.hideProgress(e),this._templating.setStatusText(e,this._options.text.waitingForResponse),this._displayFileSize(e)):this._displayFileSize(e,n,i)},_onTotalProgress:function(e,t){this._parent.prototype._onTotalProgress.apply(this,arguments),this._templating.updateTotalProgress(e,t)},_onComplete:function(e,t,n,i){function completeUpload(t){r&&(a.setStatusText(e),qq(r).removeClass(s._classes.retrying),a.hideProgress(e),s.getUploads({id:e}).status!==qq.status.UPLOAD_FAILED&&a.hideCancel(e),a.hideSpinner(e),t.success?s._markFileAsSuccessful(e):(qq(r).addClass(s._classes.fail),a.showCancel(e),a.isRetryPossible()&&!s._preventRetries[e]&&(qq(r).addClass(s._classes.retryable),a.showRetry(e)),s._controlFailureTextDisplay(e,t)))}var o=this._parent.prototype._onComplete.apply(this,arguments),a=this._templating,r=a.getFileContainer(e),s=this;return o instanceof qq.Promise?o.done(function(e){completeUpload(e)}):completeUpload(n),o},_markFileAsSuccessful:function(e){var t=this._templating;this._isDeletePossible()&&t.showDeleteButton(e),qq(t.getFileContainer(e)).addClass(this._classes.success),this._maybeUpdateThumbnail(e)},_onUploadPrep:function(e){this._parent.prototype._onUploadPrep.apply(this,arguments),this._templating.showSpinner(e)},_onUpload:function(e,t){var n=this._parent.prototype._onUpload.apply(this,arguments);return this._templating.showSpinner(e),n},_onUploadChunk:function(e,t){this._parent.prototype._onUploadChunk.apply(this,arguments),t.partIndex>0&&this._handler.isResumable(e)&&this._templating.allowPause(e)},_onCancel:function(e,t){this._parent.prototype._onCancel.apply(this,arguments),this._removeFileItem(e),0===this._getNotFinished()&&this._templating.resetTotalProgress()},_onBeforeAutoRetry:function(e){var t,n,i;this._parent.prototype._onBeforeAutoRetry.apply(this,arguments),this._showCancelLink(e),this._options.retry.showAutoRetryNote&&(t=this._autoRetries[e],n=this._options.retry.maxAutoAttempts,i=this._options.retry.autoRetryNote.replace(/\{retryNum\}/g,t),i=i.replace(/\{maxAuto\}/g,n),this._templating.setStatusText(e,i),qq(this._templating.getFileContainer(e)).addClass(this._classes.retrying))},_onBeforeManualRetry:function(e){return this._parent.prototype._onBeforeManualRetry.apply(this,arguments)?(this._templating.resetProgress(e),qq(this._templating.getFileContainer(e)).removeClass(this._classes.fail),this._templating.setStatusText(e),this._templating.showSpinner(e),this._showCancelLink(e),!0):(qq(this._templating.getFileContainer(e)).addClass(this._classes.retryable),this._templating.showRetry(e),!1)},_onSubmitDelete:function(e){var t=qq.bind(this._onSubmitDeleteSuccess,this);this._parent.prototype._onSubmitDelete.call(this,e,t)},_onSubmitDeleteSuccess:function(e,t,n){this._options.deleteFile.forceConfirm?this._showDeleteConfirm.apply(this,arguments):this._sendDeleteRequest.apply(this,arguments)},_onDeleteComplete:function(e,t,n){this._parent.prototype._onDeleteComplete.apply(this,arguments),this._templating.hideSpinner(e),n?(this._templating.setStatusText(e,this._options.deleteFile.deletingFailedText),this._templating.showDeleteButton(e)):this._removeFileItem(e)},_sendDeleteRequest:function(e,t,n){this._templating.hideDeleteButton(e),this._templating.showSpinner(e),this._templating.setStatusText(e,this._options.deleteFile.deletingStatusText),this._deleteHandler.sendDelete.apply(this,arguments)},_showDeleteConfirm:function(e,t,n){var i,o=this.getName(e),a=this._options.deleteFile.confirmMessage.replace(/\{filename\}/g,o),r=(this.getUuid(e),arguments),s=this;i=this._options.showConfirm(a),qq.isGenericPromise(i)?i.then(function(){s._sendDeleteRequest.apply(s,r)}):i!==!1&&s._sendDeleteRequest.apply(s,r)},_addToList:function(e,t,n){var i,o,a=0,r=this._handler.isProxied(e)&&this._options.scaling.hideScaled;this._options.display.prependFiles&&(this._totalFilesInBatch>1&&this._filesInBatchAddedToUi>0&&(a=this._filesInBatchAddedToUi-1),i={index:a}),n||(this._options.disableCancelForFormUploads&&!qq.supportedFeatures.ajaxUploading&&this._templating.disableCancel(),this._options.multiple||(o=this.getUploads({id:e}),this._handledProxyGroup=this._handledProxyGroup||o.proxyGroupId,o.proxyGroupId===this._handledProxyGroup&&o.proxyGroupId||(this._handler.cancelAll(),this._clearList(),this._handledProxyGroup=null))),n?(this._templating.addFileToCache(e,this._options.formatFileName(t),i,r),this._templating.updateThumbnail(e,this._thumbnailUrls[e],!0,this._options.thumbnails.customResizer)):(this._templating.addFile(e,this._options.formatFileName(t),i,r),this._templating.generatePreview(e,this.getFile(e),this._options.thumbnails.customResizer)),this._filesInBatchAddedToUi+=1,(n||this._options.display.fileSizeOnSubmit&&qq.supportedFeatures.ajaxUploading)&&this._displayFileSize(e)},_clearList:function(){this._templating.clearFiles(),this.clearStoredFiles()},_displayFileSize:function(e,t,n){var i=this.getSize(e),o=this._formatSize(i);i>=0&&(void 0!==t&&void 0!==n&&(o=this._formatProgress(t,n)),this._templating.updateSize(e,o))},_formatProgress:function(e,t){function r(e,t){n=n.replace(e,t)}var n=this._options.text.formatProgress;return r("{percent}",Math.round(e/t*100)),r("{total_size}",this._formatSize(t)),n},_controlFailureTextDisplay:function(e,t){var n,i,o;n=this._options.failedUploadTextDisplay.mode,i=this._options.failedUploadTextDisplay.responseProperty,"custom"===n?(o=t[i],o||(o=this._options.text.failUpload),this._templating.setStatusText(e,o),this._options.failedUploadTextDisplay.enableTooltip&&this._showTooltip(e,o)):"default"===n?this._templating.setStatusText(e,this._options.text.failUpload):"none"!==n&&this.log("failedUploadTextDisplay.mode value of '"+n+"' is not valid","warn")},_showTooltip:function(e,t){this._templating.getFileContainer(e).title=t},_showCancelLink:function(e){this._options.disableCancelForFormUploads&&!qq.supportedFeatures.ajaxUploading||this._templating.showCancel(e)},_itemError:function(e,t,n){var i=this._parent.prototype._itemError.apply(this,arguments);this._options.showMessage(i)},_batchError:function(e){this._parent.prototype._batchError.apply(this,arguments),this._options.showMessage(e)},_setupPastePrompt:function(){var e=this;this._options.callbacks.onPasteReceived=function(){var t=e._options.paste.namePromptMessage,n=e._options.paste.defaultName;return e._options.showPrompt(t,n)}},_fileOrBlobRejected:function(e,t){this._totalFilesInBatch-=1,this._parent.prototype._fileOrBlobRejected.apply(this,arguments)},_prepareItemsForUpload:function(e,t,n){this._totalFilesInBatch=e.length,this._filesInBatchAddedToUi=0,this._parent.prototype._prepareItemsForUpload.apply(this,arguments)},_maybeUpdateThumbnail:function(e){var t=this._thumbnailUrls[e],n=this.getUploads({id:e}).status;n===qq.status.DELETED||!t&&!this._options.thumbnails.placeholders.waitUntilResponse&&qq.supportedFeatures.imagePreviews||this._templating.updateThumbnail(e,t,this._options.thumbnails.customResizer)},_addCannedFile:function(e){var t=this._parent.prototype._addCannedFile.apply(this,arguments);return this._addToList(t,this.getName(t),!0),this._templating.hideSpinner(t),this._templating.hideCancel(t),this._markFileAsSuccessful(t),t},_setSize:function(e,t){this._parent.prototype._setSize.apply(this,arguments),this._templating.updateSize(e,this._formatSize(t))},_sessionRequestComplete:function(){this._templating.addCacheToDom(),this._parent.prototype._sessionRequestComplete.apply(this,arguments)}}}(),qq.FineUploader=function(e,t){"use strict";var n=this;this._parent=t?qq[t].FineUploaderBasic:qq.FineUploaderBasic,this._parent.apply(this,arguments),qq.extend(this._options,{element:null,button:null,listElement:null,dragAndDrop:{extraDropzones:[],reportDirectoryPaths:!1},text:{formatProgress:"{percent}% of {total_size}",failUpload:"Upload failed",waitingForResponse:"Processing...",paused:"Paused"},template:"qq-template",classes:{retrying:"qq-upload-retrying",retryable:"qq-upload-retryable",success:"qq-upload-success",fail:"qq-upload-fail",editable:"qq-editable",hide:"qq-hide",dropActive:"qq-upload-drop-area-active"},failedUploadTextDisplay:{mode:"default",responseProperty:"error",enableTooltip:!0},messages:{tooManyFilesError:"You may only drop one file",unsupportedBrowser:"Unrecoverable error - this browser does not permit file uploading of any kind."},retry:{showAutoRetryNote:!0,autoRetryNote:"Retrying {retryNum}/{maxAuto}..."},deleteFile:{forceConfirm:!1,confirmMessage:"Are you sure you want to delete {filename}?",deletingStatusText:"Deleting...",deletingFailedText:"Delete failed"},display:{fileSizeOnSubmit:!1,prependFiles:!1},paste:{promptForName:!1,namePromptMessage:"Please name this image"},thumbnails:{customResizer:null,maxCount:0,placeholders:{waitUntilResponse:!1,notAvailablePath:null,waitingPath:null},timeBetweenThumbs:750},scaling:{hideScaled:!1},showMessage:function(e){return n._templating.hasDialog("alert")?n._templating.showDialog("alert",e):void setTimeout(function(){window.alert(e)},0)},showConfirm:function(e){return n._templating.hasDialog("confirm")?n._templating.showDialog("confirm",e):window.confirm(e)},showPrompt:function(e,t){return n._templating.hasDialog("prompt")?n._templating.showDialog("prompt",e,t):window.prompt(e,t)}},!0),qq.extend(this._options,e,!0),this._templating=new qq.Templating({log:qq.bind(this.log,this),templateIdOrEl:this._options.template,containerEl:this._options.element,fileContainerEl:this._options.listElement,button:this._options.button,imageGenerator:this._imageGenerator,classes:{hide:this._options.classes.hide,editable:this._options.classes.editable},limits:{maxThumbs:this._options.thumbnails.maxCount,timeBetweenThumbs:this._options.thumbnails.timeBetweenThumbs},placeholders:{waitUntilUpdate:this._options.thumbnails.placeholders.waitUntilResponse,thumbnailNotAvailable:this._options.thumbnails.placeholders.notAvailablePath,waitingForThumbnail:this._options.thumbnails.placeholders.waitingPath},text:this._options.text}),this._options.workarounds.ios8SafariUploads&&qq.ios800()&&qq.iosSafari()?this._templating.renderFailure(this._options.messages.unsupportedBrowserIos8Safari):!qq.supportedFeatures.uploading||this._options.cors.expected&&!qq.supportedFeatures.uploadCors?this._templating.renderFailure(this._options.messages.unsupportedBrowser):(this._wrapCallbacks(),this._templating.render(),this._classes=this._options.classes,!this._options.button&&this._templating.getButton()&&(this._defaultButtonId=this._createUploadButton({element:this._templating.getButton(),title:this._options.text.fileInputTitle}).getButtonId()),this._setupClickAndEditEventHandlers(),qq.DragAndDrop&&qq.supportedFeatures.fileDrop&&(this._dnd=this._setupDragAndDrop()),this._options.paste.targetElement&&this._options.paste.promptForName&&(qq.PasteSupport?this._setupPastePrompt():this.log("Paste support module not found.","error")),this._totalFilesInBatch=0,this._filesInBatchAddedToUi=0)},qq.extend(qq.FineUploader.prototype,qq.basePublicApi),qq.extend(qq.FineUploader.prototype,qq.basePrivateApi),qq.extend(qq.FineUploader.prototype,qq.uiPublicApi),
6
6
  qq.extend(qq.FineUploader.prototype,qq.uiPrivateApi),qq.Templating=function(e){"use strict";var t,n,i,o,a,r,s,l,u="qq-file-id",d="qq-file-id-",c="qq-max-size",p="qq-server-scale",h="qq-hide-dropzone",f="qq-drop-area-text",g="qq-in-progress",m="qq-hidden-forever",v={content:document.createDocumentFragment(),map:{}},b=!1,x=0,_=!1,q=[],y=-1,w={log:null,limits:{maxThumbs:0,timeBetweenThumbs:750},templateIdOrEl:"qq-template",containerEl:null,fileContainerEl:null,button:null,imageGenerator:null,classes:{hide:"qq-hide",editable:"qq-editable"},placeholders:{waitUntilUpdate:!1,thumbnailNotAvailable:null,waitingForThumbnail:null},text:{paused:"Paused"}},C={button:"qq-upload-button-selector",alertDialog:"qq-alert-dialog-selector",dialogCancelButton:"qq-cancel-button-selector",confirmDialog:"qq-confirm-dialog-selector",dialogMessage:"qq-dialog-message-selector",dialogOkButton:"qq-ok-button-selector",promptDialog:"qq-prompt-dialog-selector",uploader:"qq-uploader-selector",drop:"qq-upload-drop-area-selector",list:"qq-upload-list-selector",progressBarContainer:"qq-progress-bar-container-selector",progressBar:"qq-progress-bar-selector",totalProgressBarContainer:"qq-total-progress-bar-container-selector",totalProgressBar:"qq-total-progress-bar-selector",file:"qq-upload-file-selector",spinner:"qq-upload-spinner-selector",size:"qq-upload-size-selector",cancel:"qq-upload-cancel-selector",pause:"qq-upload-pause-selector",continueButton:"qq-upload-continue-selector",deleteButton:"qq-upload-delete-selector",retry:"qq-upload-retry-selector",statusText:"qq-upload-status-text-selector",editFilenameInput:"qq-edit-filename-selector",editNameIcon:"qq-edit-filename-icon-selector",dropText:"qq-upload-drop-area-text-selector",dropProcessing:"qq-drop-processing-selector",dropProcessingSpinner:"qq-drop-processing-spinner-selector",thumbnail:"qq-thumbnail-selector"},S={},A=new qq.Promise,k=new qq.Promise,D=function(){var e=w.placeholders.thumbnailNotAvailable,n=w.placeholders.waitingForThumbnail,i={maxSize:y,scale:l};s&&(e?w.imageGenerator.generate(e,new Image,i).then(function(e){A.success(e)},function(){A.failure(),t("Problem loading 'not available' placeholder image at "+e,"error")}):A.failure(),n?w.imageGenerator.generate(n,new Image,i).then(function(e){k.success(e)},function(){k.failure(),t("Problem loading 'waiting for thumbnail' placeholder image at "+n,"error")}):k.failure())},F=function(e){var t=new qq.Promise;return k.then(function(n){$(n,e),e.src?t.success():(e.src=n.src,e.onload=function(){e.onload=null,te(e),t.success()})},function(){X(e),t.success()}),t},P=function(e,n,i){var o=G(e);return t("Generating new thumbnail for "+e),n.qqThumbnailId=e,w.imageGenerator.generate(n,o,i).then(function(){x++,te(o),S[e].success()},function(){S[e].failure(),w.placeholders.waitUntilUpdate||Y(e,o)})},I=function(){if(q.length){_=!0;var e=q.shift();e.update?Q(e):Z(e)}else _=!1},M=function(e){return W(L(e),C.cancel)},T=function(e){return W(L(e),C.continueButton)},R=function(e){return W(a,C[e+"Dialog"])},E=function(e){return W(L(e),C.deleteButton)},B=function(){return W(a,C.dropProcessing)},O=function(e){return W(L(e),C.editNameIcon)},L=function(e){return v.map[e]||qq(r).getFirstByClass(d+e)},z=function(e){return W(L(e),C.file)},N=function(e){return W(L(e),C.pause)},U=function(e){return null==e?W(a,C.totalProgressBarContainer)||W(a,C.totalProgressBar):W(L(e),C.progressBarContainer)||W(L(e),C.progressBar)},H=function(e){return W(L(e),C.retry)},j=function(e){return W(L(e),C.size)},V=function(e){return W(L(e),C.spinner)},W=function(e,t){return e&&qq(e).getFirstByClass(t)},G=function(e){return s&&W(L(e),C.thumbnail)},X=function(e){e&&qq(e).addClass(w.classes.hide)},$=function(e,t){var n=e.style.maxWidth,i=e.style.maxHeight;i&&n&&!t.style.maxWidth&&!t.style.maxHeight&&qq(t).css({maxWidth:n,maxHeight:i})},Y=function(e,t){var n=S[e]||(new qq.Promise).failure(),i=new qq.Promise;return A.then(function(e){n.then(function(){i.success()},function(){$(e,t),t.onload=function(){t.onload=null,i.success()},t.src=e.src,te(t)})}),i},J=function(){var e,o,a,r,u,d,g,m,v,b,x;if(t("Parsing template"),null==w.templateIdOrEl)throw new Error("You MUST specify either a template element or ID!");if(qq.isString(w.templateIdOrEl)){if(e=document.getElementById(w.templateIdOrEl),null===e)throw new Error(qq.format("Cannot find template script at ID '{}'!",w.templateIdOrEl));o=e.innerHTML}else{if(void 0===w.templateIdOrEl.innerHTML)throw new Error("You have specified an invalid value for the template option! It must be an ID or an Element.");o=w.templateIdOrEl.innerHTML}if(o=qq.trimStr(o),r=document.createElement("div"),r.appendChild(qq.toElement(o)),x=qq(r).getFirstByClass(C.uploader),w.button&&(d=qq(r).getFirstByClass(C.button),d&&qq(d).remove()),qq.DragAndDrop&&qq.supportedFeatures.fileDrop||(v=qq(r).getFirstByClass(C.dropProcessing),v&&qq(v).remove()),g=qq(r).getFirstByClass(C.drop),g&&!qq.DragAndDrop&&(t("DnD module unavailable.","info"),qq(g).remove()),qq.supportedFeatures.fileDrop?qq(x).hasAttribute(f)&&g&&(b=qq(g).getFirstByClass(C.dropText),b&&qq(b).remove()):(x.removeAttribute(f),g&&qq(g).hasAttribute(h)&&qq(g).css({display:"none"})),m=qq(r).getFirstByClass(C.thumbnail),s?m&&(y=parseInt(m.getAttribute(c)),y=y>0?y:null,l=qq(m).hasAttribute(p)):m&&qq(m).remove(),s=s&&m,n=qq(r).getByClass(C.editFilenameInput).length>0,i=qq(r).getByClass(C.retry).length>0,a=qq(r).getFirstByClass(C.list),null==a)throw new Error("Could not find the file list container in the template!");return u=a.children[0].cloneNode(!0),a.innerHTML="",r.getElementsByTagName("DIALOG").length&&document.createElement("dialog"),t("Template parsing complete"),{template:r,fileTemplate:u}},K=function(e,t,n){var i=n,o=i.firstChild;t>0&&(o=qq(i).children()[t].nextSibling),i.insertBefore(e,o)},Z=function(e){var t=e.id,n=e.optFileOrBlob,i=n&&n.qqThumbnailId,o=G(t),a={customResizeFunction:e.customResizeFunction,maxSize:y,orient:!0,scale:!0};qq.supportedFeatures.imagePreviews?o?w.limits.maxThumbs&&w.limits.maxThumbs<=x?(Y(t,o),I()):F(o).done(function(){S[t]=new qq.Promise,S[t].done(function(){setTimeout(I,w.limits.timeBetweenThumbs)}),null!=i?ne(t,i):P(t,n,a)}):I():o&&(F(o),I())},Q=function(e){var t=e.id,n=e.thumbnailUrl,i=e.showWaitingImg,o=G(t),a={customResizeFunction:e.customResizeFunction,scale:l,maxSize:y};if(o)if(n){if(!(w.limits.maxThumbs&&w.limits.maxThumbs<=x))return i&&F(o),w.imageGenerator.generate(n,o,a).then(function(){te(o),x++,setTimeout(I,w.limits.timeBetweenThumbs)},function(){Y(t,o),setTimeout(I,w.limits.timeBetweenThumbs)});Y(t,o),I()}else Y(t,o),I()},ee=function(e,t){var n=U(e),i=null==e?C.totalProgressBar:C.progressBar;n&&!qq(n).hasClass(i)&&(n=qq(n).getFirstByClass(i)),n&&(qq(n).css({width:t+"%"}),n.setAttribute("aria-valuenow",t))},te=function(e){e&&qq(e).removeClass(w.classes.hide)},ne=function(e,n){var i=G(e),o=G(n);t(qq.format("ID {} is the same file as ID {}. Will use generated thumbnail from ID {} instead.",e,n,n)),S[n].then(function(){x++,S[e].success(),t(qq.format("Now using previously generated thumbnail created for ID {} on ID {}.",n,e)),i.src=o.src,te(i)},function(){S[e].failure(),w.placeholders.waitUntilUpdate||Y(e,i)})};qq.extend(w,e),t=w.log,qq.supportedFeatures.imagePreviews||(w.limits.timeBetweenThumbs=0,w.limits.maxThumbs=0),a=w.containerEl,s=void 0!==w.imageGenerator,o=J(),D(),qq.extend(this,{render:function(){t("Rendering template in DOM."),x=0,a.appendChild(o.template.cloneNode(!0)),X(B()),this.hideTotalProgress(),r=w.fileContainerEl||W(a,C.list),t("Template rendering complete")},renderFailure:function(e){var t=qq.toElement(e);a.innerHTML="",a.appendChild(t)},reset:function(){a.innerHTML="",this.render()},clearFiles:function(){r.innerHTML=""},disableCancel:function(){b=!0},addFile:function(e,t,n,i,s){var l,c=o.fileTemplate.cloneNode(!0),p=W(c,C.file),h=W(a,C.uploader),g=s?v.content:r;s&&(v.map[e]=c),qq(c).addClass(d+e),h.removeAttribute(f),p&&(qq(p).setText(t),p.setAttribute("title",t)),c.setAttribute(u,e),n?K(c,n.index,g):g.appendChild(c),i?(c.style.display="none",qq(c).addClass(m)):(X(U(e)),X(j(e)),X(E(e)),X(H(e)),X(N(e)),X(T(e)),b&&this.hideCancel(e),l=G(e),l&&!l.src&&k.then(function(e){l.src=e.src,e.style.maxHeight&&e.style.maxWidth&&qq(l).css({maxHeight:e.style.maxHeight,maxWidth:e.style.maxWidth}),te(l)}))},addFileToCache:function(e,t,n,i){this.addFile(e,t,n,i,!0)},addCacheToDom:function(){r.appendChild(v.content),v.content=document.createDocumentFragment(),v.map={}},removeFile:function(e){qq(L(e)).remove()},getFileId:function(e){var t=e;if(t){for(;null==t.getAttribute(u);)t=t.parentNode;return parseInt(t.getAttribute(u))}},getFileList:function(){return r},markFilenameEditable:function(e){var t=z(e);t&&qq(t).addClass(w.classes.editable)},updateFilename:function(e,t){var n=z(e);n&&(qq(n).setText(t),n.setAttribute("title",t))},hideFilename:function(e){X(z(e))},showFilename:function(e){te(z(e))},isFileName:function(e){return qq(e).hasClass(C.file)},getButton:function(){return w.button||W(a,C.button)},hideDropProcessing:function(){X(B())},showDropProcessing:function(){te(B())},getDropZone:function(){return W(a,C.drop)},isEditFilenamePossible:function(){return n},hideRetry:function(e){X(H(e))},isRetryPossible:function(){return i},showRetry:function(e){te(H(e))},getFileContainer:function(e){return L(e)},showEditIcon:function(e){var t=O(e);t&&qq(t).addClass(w.classes.editable)},isHiddenForever:function(e){return qq(L(e)).hasClass(m)},hideEditIcon:function(e){var t=O(e);t&&qq(t).removeClass(w.classes.editable)},isEditIcon:function(e){return qq(e).hasClass(C.editNameIcon,!0)},getEditInput:function(e){return W(L(e),C.editFilenameInput)},isEditInput:function(e){return qq(e).hasClass(C.editFilenameInput,!0)},updateProgress:function(e,t,n){var i,o=U(e);o&&n>0&&(i=Math.round(t/n*100),100===i?X(o):te(o),ee(e,i))},updateTotalProgress:function(e,t){this.updateProgress(null,e,t)},hideProgress:function(e){var t=U(e);t&&X(t)},hideTotalProgress:function(){this.hideProgress()},resetProgress:function(e){ee(e,0),this.hideTotalProgress(e)},resetTotalProgress:function(){this.resetProgress()},showCancel:function(e){if(!b){var t=M(e);t&&qq(t).removeClass(w.classes.hide)}},hideCancel:function(e){X(M(e))},isCancel:function(e){return qq(e).hasClass(C.cancel,!0)},allowPause:function(e){te(N(e)),X(T(e))},uploadPaused:function(e){this.setStatusText(e,w.text.paused),this.allowContinueButton(e),X(V(e))},hidePause:function(e){X(N(e))},isPause:function(e){return qq(e).hasClass(C.pause,!0)},isContinueButton:function(e){return qq(e).hasClass(C.continueButton,!0)},allowContinueButton:function(e){te(T(e)),X(N(e))},uploadContinued:function(e){this.setStatusText(e,""),this.allowPause(e),te(V(e))},showDeleteButton:function(e){te(E(e))},hideDeleteButton:function(e){X(E(e))},isDeleteButton:function(e){return qq(e).hasClass(C.deleteButton,!0)},isRetry:function(e){return qq(e).hasClass(C.retry,!0)},updateSize:function(e,t){var n=j(e);n&&(te(n),qq(n).setText(t))},setStatusText:function(e,t){var n=W(L(e),C.statusText);n&&(null==t?qq(n).clearText():qq(n).setText(t))},hideSpinner:function(e){qq(L(e)).removeClass(g),X(V(e))},showSpinner:function(e){qq(L(e)).addClass(g),te(V(e))},generatePreview:function(e,t,n){this.isHiddenForever(e)||(q.push({id:e,customResizeFunction:n,optFileOrBlob:t}),!_&&I())},updateThumbnail:function(e,t,n,i){this.isHiddenForever(e)||(q.push({customResizeFunction:i,update:!0,id:e,thumbnailUrl:t,showWaitingImg:n}),!_&&I())},hasDialog:function(e){return qq.supportedFeatures.dialogElement&&!!R(e)},showDialog:function(e,t,n){var i=R(e),o=W(i,C.dialogMessage),a=i.getElementsByTagName("INPUT")[0],r=W(i,C.dialogCancelButton),s=W(i,C.dialogOkButton),l=new qq.Promise,u=function(){r.removeEventListener("click",d),s&&s.removeEventListener("click",c),l.failure()},d=function(){r.removeEventListener("click",d),i.close()},c=function(){i.removeEventListener("close",u),s.removeEventListener("click",c),i.close(),l.success(a&&a.value)};return i.addEventListener("close",u),r.addEventListener("click",d),s&&s.addEventListener("click",c),a&&(a.value=n),o.textContent=t,i.showModal(),l}})},qq.UiEventHandler=function(e,t){"use strict";function addHandler(e){n.attach(e,i.eventType,function(e){e=e||window.event;var t=e.target||e.srcElement;i.onHandled(t,e)})}var n=new qq.DisposeSupport,i={eventType:"click",attachTo:null,onHandled:function(e,t){}};qq.extend(this,{addHandler:function(e){addHandler(e)},dispose:function(){n.dispose()}}),qq.extend(t,{getFileIdFromItem:function(e){return e.qqFileId},getDisposeSupport:function(){return n}}),qq.extend(i,e),i.attachTo&&addHandler(i.attachTo)},qq.FileButtonsClickHandler=function(e){"use strict";function examineEvent(e,t){qq.each(i,function(i,o){var a,r=i.charAt(0).toUpperCase()+i.slice(1);if(n.templating["is"+r](e))return a=n.templating.getFileId(e),qq.preventDefault(t),n.log(qq.format("Detected valid file button click event on file '{}', ID: {}.",n.onGetName(a),a)),o(a),!1})}var t={},n={templating:null,log:function(e,t){},onDeleteFile:function(e){},onCancel:function(e){},onRetry:function(e){},onPause:function(e){},onContinue:function(e){},onGetName:function(e){}},i={cancel:function(e){n.onCancel(e)},retry:function(e){n.onRetry(e)},deleteButton:function(e){n.onDeleteFile(e)},pause:function(e){n.onPause(e)},continueButton:function(e){n.onContinue(e)}};qq.extend(n,e),n.eventType="click",n.onHandled=examineEvent,n.attachTo=n.templating.getFileList(),qq.extend(this,new qq.UiEventHandler(n,t))},qq.FilenameClickHandler=function(e){"use strict";function examineEvent(e,i){if(n.templating.isFileName(e)||n.templating.isEditIcon(e)){var o=n.templating.getFileId(e),a=n.onGetUploadStatus(o);a===qq.status.SUBMITTED&&(n.log(qq.format("Detected valid filename click event on file '{}', ID: {}.",n.onGetName(o),o)),qq.preventDefault(i),t.handleFilenameEdit(o,e,!0))}}var t={},n={templating:null,log:function(e,t){},classes:{file:"qq-upload-file",editNameIcon:"qq-edit-filename-icon"},onGetUploadStatus:function(e){},onGetName:function(e){}};qq.extend(n,e),n.eventType="click",n.onHandled=examineEvent,qq.extend(this,new qq.FilenameEditHandler(n,t))},qq.FilenameInputFocusInHandler=function(e,t){"use strict";function handleInputFocus(e,i){if(n.templating.isEditInput(e)){var o=n.templating.getFileId(e),a=n.onGetUploadStatus(o);a===qq.status.SUBMITTED&&(n.log(qq.format("Detected valid filename input focus event on file '{}', ID: {}.",n.onGetName(o),o)),t.handleFilenameEdit(o,e))}}var n={templating:null,onGetUploadStatus:function(e){},log:function(e,t){}};t||(t={}),n.eventType="focusin",n.onHandled=handleInputFocus,qq.extend(n,e),qq.extend(this,new qq.FilenameEditHandler(n,t))},qq.FilenameInputFocusHandler=function(e){"use strict";e.eventType="focus",e.attachTo=null,qq.extend(this,new qq.FilenameInputFocusInHandler(e,{}))},qq.FilenameEditHandler=function(e,t){"use strict";function getFilenameSansExtension(e){var t=n.onGetName(e),i=t.lastIndexOf(".");return i>0&&(t=t.substr(0,i)),t}function getOriginalExtension(e){var t=n.onGetName(e);return qq.getExtension(t)}function handleNameUpdate(e,t){var i,o=e.value;void 0!==o&&qq.trimStr(o).length>0&&(i=getOriginalExtension(t),void 0!==i&&(o=o+"."+i),n.onSetName(t,o)),n.onEditingStatusChange(t,!1)}function registerInputBlurHandler(e,n){t.getDisposeSupport().attach(e,"blur",function(){handleNameUpdate(e,n)})}function registerInputEnterKeyHandler(e,n){t.getDisposeSupport().attach(e,"keyup",function(t){var i=t.keyCode||t.which;13===i&&handleNameUpdate(e,n)})}var n={templating:null,log:function(e,t){},onGetUploadStatus:function(e){},onGetName:function(e){},onSetName:function(e,t){},onEditingStatusChange:function(e,t){}};qq.extend(n,e),n.attachTo=n.templating.getFileList(),qq.extend(this,new qq.UiEventHandler(n,t)),qq.extend(t,{handleFilenameEdit:function(e,t,i){var o=n.templating.getEditInput(e);n.onEditingStatusChange(e,!0),o.value=getFilenameSansExtension(e),i&&o.focus(),registerInputBlurHandler(o,e),registerInputEnterKeyHandler(o,e)}})}}(window)},1142:function(e,t,n){"use strict";e.exports=n(1141)},1143:function(e,t){e.exports=' <img :src="value | avatar_url field.width" :width=field.width :height=field.width /> '},1144:function(e,t){e.exports=' <time :datetime="value | dt YYYY-MM-DD">{{value | dt L}}</time> '},1145:function(e,t){e.exports=" <time :datetime=value>{{value | dt L LT}}</time> "},1146:function(e,t){e.exports=" <del v-if=item.deleted :title=\"_('This item has been deleted')\" :datetime=item.deleted>{{value}}</del> <span v-else>{{value}}</span> "},1147:function(e,t){e.exports=' <span v-for="label in labels" class="label label-{{label | color}}"> {{label | format}} </span> '},1148:function(e,t){e.exports=" <span class=badge :class=\"{\n 'bg-green': value > 0,\n 'bg-red': value == 0\n }\">{{value}}</span> "},1149:function(e,t){e.exports=" <i class=\"fa fa-fw fa-{{value ? 'play' : 'stop'}} text-{{value ? 'green' : 'red'}}\"></i> "},1150:function(e,t){e.exports=' <div class="progress progress-sm"> <span class="progress-bar progress-bar-{{ progress_class }}" :style="{width: value * 100 + \'%\'}" :title="_(\'Score:\') + \' \' + value * 100"> </span> </div> '},1151:function(e,t){e.exports=" <time :datetime=value>{{value | since}}</time> "},1152:function(e,t){e.exports="<span>{{value}}</span>"},1153:function(e,t){e.exports=" <img :src=src :width=field.width :height=field.width /> "},1154:function(e,t){e.exports=" <time :datetime=value class=timeago>{{value | timeago}}</time> "},1155:function(e,t){e.exports=' <span class="label label-{{ status.type }}">{{ status.label }}</span> '},1156:function(e,t){e.exports=" <tr class=pointer :class=\"{ 'active': selected }\" @click=item_click(item)> <td v-for=\"field in fields\" track-by=key :class=\"{\n 'text-center': field.align === 'center',\n 'text-left': field.align === 'left',\n 'text-right': field.align === 'right',\n 'ellipsis': field.ellipsis\n }\"> <component :is=\"field.type || 'text'\" :item=item :field=field> </component> </td> </tr> "},1157:function(e,t){e.exports=' <table class="table table-hover datatable"> <thead> <tr> <th v-for="field in fields" :class=classes_for(field) @click=header_click(field) :width="field.width | thwidth"> {{field.label}} <span class="fa fa-fw" v-if=field.sort :class=sort_classes_for(field)></span> </th> </tr> </thead> <tbody> <tr v-for="item in p.data" :track-by=trackBy is=row :item=item :fields=fields :selected="item === selected"> </tr> </tbody> </table> '},1158:function(e,t){e.exports=' <div> <box :title=title :icon=icon :boxclass=boxclasses bodyclass="table-responsive no-padding" footerclass="text-center clearfix" :loading="loading !== undefined ? loading : p.loading" :footer=show_footer> <aside slot=tools> <div class=btn-group v-show=downloads.length> <button type=button class="btn btn-box-tool dropdown-toggle" data-toggle=dropdown aria-expanded=false> <span class="fa fa-download"></span> </button> <ul class=dropdown-menu role=menu> <li v-for="download in downloads"> <a :href=download.url>{{download.label}}</a> </li> </ul> </div> <div class=box-search v-if=p.has_search> <div class=input-group> <input type=text class="form-control input-sm pull-right" style="width: 150px" :placeholder="_(\'Search\')" v-model=search_query debounce=500 @keyup.enter=search> <div class=input-group-btn> <button class="btn btn-sm btn-flat" @click=search> <i class="fa fa-search"></i> </button> </div> </div> </div> </aside> <header class=datatable-header> <slot name=header></slot> </header> <datatable v-if=p.has_data :p=p :fields=fields :track=track> </datatable> <div class="text-center lead" v-if=!p.has_data> {{ empty || _(\'No data\')}} </div> <footer slot=footer> <div :class="{ \'pull-right\': p.pages > 1 }" v-el:footer_container> <slot name=footer></slot> </div> <pagination-widget :p=p></pagination-widget> </footer> </box> </div> '},1159:function(e,t){e.exports=' <ul class="pagination pagination-sm no-margin" v-show="p && p.pages > 1"> <li :class="{ \'disabled\': !p || p.page == 1 }"> <a :title="_(\'First page\')" class=pointer @click=p.go_to_page(1)> &laquo; </a> </li> <li :class="{ \'disabled\': !p || p.page == 1 }"> <a :title="_(\'Previous page\')" class=pointer @click=p.previousPage()> &lsaquo; </a> </li> <li v-for="current in range" :class="{ \'active\': current == p.page }"> <a @click=p.go_to_page(current) class=pointer>{{ current }}</a> </li> <li :class="{ \'disabled\': !p || p.page == p.pages }"> <a :title="_(\'Next page\')" class=pointer @click=p.nextPage()> &rsaquo; </a> </li> <li :class="{ \'disabled\': !p || p.page == p.pages }"> <a :title="_(\'Last page\')" class=pointer @click=p.go_to_page(p.pages)> &raquo; </a> </li> </ul> '},1160:function(e,t,n){var i,o;n(1177),i=n(1101),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1161:function(e,t,n){var i,o;n(1178),i=n(1102),o=n(1143),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1162:function(e,t,n){var i,o;i=n(1103),o=n(1144),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1163:function(e,t,n){var i,o;i=n(1104),o=n(1145),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1164:function(e,t,n){var i,o;i=n(1105),o=n(1146),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1165:function(e,t,n){var i,o;n(1182),i=n(1106),o=n(1147),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1166:function(e,t,n){var i,o;i=n(1107),o=n(1148),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1167:function(e,t,n){var i,o;i=n(1108),o=n(1149),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1168:function(e,t,n){var i,o;i=n(1109),o=n(1150),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1169:function(e,t,n){var i,o;i=n(1110),o=n(1151),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1170:function(e,t,n){var i,o;i=n(1111),o=n(1152),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1171:function(e,t,n){var i,o;n(1179),i=n(1112),o=n(1153),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1172:function(e,t,n){var i,o;i=n(1113),o=n(1154),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1173:function(e,t,n){var i,o;i=n(1114),o=n(1155),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1174:function(e,t,n){var i,o;i=n(1115),o=n(1156),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1175:function(e,t,n){var i,o;n(1180),i=n(1116),o=n(1157),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1176:function(e,t,n){var i,o;i=n(1118),o=n(1159),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1177:function(e,t,n){var i=n(1135);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1178:function(e,t,n){var i=n(1136);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1179:function(e,t,n){var i=n(1137);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1180:function(e,t,n){var i=n(1138);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1181:function(e,t,n){var i=n(1139);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1182:function(e,t,n){var i=n(1140);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1198:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.HarvestJob=t.STATUS_I18N=t.STATUS_CLASSES=void 0;var i=n(21),o=_interopRequireDefault(i),a=n(19),r=_interopRequireDefault(a),s=n(46),l=_interopRequireDefault(s),u=n(27),d=_interopRequireDefault(u),c=n(26),p=_interopRequireDefault(c),h=n(39),f=n(20),g=_interopRequireDefault(f),m=n(133),v=(t.STATUS_CLASSES={pending:"default",initializing:"primary",initialized:"info",processing:"info",done:"success","done-errors":"warning",failed:"danger",deleted:"danger"},t.STATUS_I18N={pending:(0,m._)("Pending"),initializing:(0,m._)("Initializing"),initialized:(0,m._)("Initialized"),processing:(0,m._)("Processing"),done:(0,m._)("Done"),"done-errors":(0,m._)("Done with errors"),failed:(0,m._)("Failed"),deleted:(0,m._)("Deleted")},t.HarvestJob=function(e){function HarvestJob(){return(0,r.default)(this,HarvestJob),(0,d.default)(this,(HarvestJob.__proto__||(0,o.default)(HarvestJob)).apply(this,arguments))}return(0,p.default)(HarvestJob,e),(0,l.default)(HarvestJob,[{key:"fetch",value:function(){return this.id?(this.loading=!0,this.$api("harvest.get_harvest_job",{ident:this.id},this.on_fetched)):g.default.error("Unable to fetch Job"),this}}]),HarvestJob}(h.Model));t.default=v},1201:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(20),o=_interopRequireDefault(i),a=n(1097),r=_interopRequireDefault(a),s=n(1214),l=_interopRequireDefault(s),u=["png","jpg","jpeg","webp"];t.default={name:"image-picker",autoUpload:!1,chunk:!1,allowedExtensions:u,mixins:[r.default],components:{Thumbnailer:l.default},data:function(){return{src:null,resizing:!1}},props:{endpoint:null,sizes:{type:Array,default:function(){return[100]}}},computed:{file:function(){if(this.files.length>0)return this.files[0]},upload_endpoint:function(){return this.endpoint}},events:{"uploader:file-submit":function(e,t){return this.HAS_FILE_API?(this.src=URL.createObjectURL(t),this.resizing=!0):(o.default.warning("File APIs not supported"),this.upload()),this.$dispatch("wizard:enable-next"),!0},"uploader:progress":function(e,t,n){return this.progress=Math.round(100*t/n),!0},"uploader:complete":function(e,t){return this.HAS_FILE_API?this.$dispatch("image:saved"):(this.src=t.url,this.resizing=!0),!0}},methods:{save:function(){if(this.HAS_FILE_API){var e={};try{var t=this.$refs.thumbnailer.bbox;t&&(e.bbox=t),this.upload(e)}catch(n){}}else this.$dispatch("image:saved")}}}},1202:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1034),o=_interopRequireDefault(i),a=n(135),r=_interopRequireDefault(a),s=n(1206),l=(_interopRequireDefault(s),n(12)),u=_interopRequireDefault(l);t.default={name:"thumbnailer",props:{src:null,sizes:{type:Array,default:function(){return[50,100]}}},data:function(){return{centered:!1}},computed:{bbox:function(){if(!this.$els.checkbox.checked){var e=this.Jcrop.tellSelect();return[e.x,e.y,e.x2,e.y2]}}},methods:{preview:function(e){var t=this.Jcrop.getBounds(),n=(0,r.default)(t,2),i=n[0],a=n[1],s=[].concat((0,o.default)(this.$el.querySelectorAll(".preview-container")));s.forEach(function(t){var n=(0,u.default)(t),o=n.width(),r=n.height(),s=o/e.w,l=r/e.h;n.find(".preview").removeAttr("style").css({width:Math.round(s*i)+"px",height:Math.round(l*a)+"px",marginLeft:"-"+Math.round(s*e.x)+"px",marginTop:"-"+Math.round(l*e.y)+"px"})})},setImage:function(e){if(e){var t=this,n=(0,u.default)(this.$els.crop_pane),i=n.width(),a=parseInt(n.css("max-height").replace("px",""));(0,u.default)(this.$els.cropper).attr("src",e).Jcrop({onChange:this.preview.bind(this),onSelect:this.preview.bind(this),aspectRatio:1,boxWidth:i,boxHeight:a},function(){var e=Math.min.apply(Math,(0,o.default)(this.getBounds()));t.Jcrop=this,this.setSelect([0,0,e,e])})}}},watch:{centered:function(e){if(e){var t=this.Jcrop.getBounds(),n=t[0]>t[1]?"width":"height";this.Jcrop.disable(),(0,u.default)(this.$els.preview_containers).find(".preview").removeAttr("style").css(n,"100%")}else this.Jcrop.enable()},src:function(e){return this.setImage(e)}},ready:function(){this.setImage(this.src)}}},1204:function(e,t,n){t=e.exports=n(37)(),t.push([e.id,".image-picker .uploader .drop-pane{padding:15px;margin:15px 0;border:5px dashed #999}.image-picker .uploader .drop-pane.drop-active{border-color:blue}","",{version:3,sources:["/./js/components/widgets/image-picker.vue"],names:[],mappings:"AAAA,mCAAmC,aAAa,cAAc,sBAAsB,CAAC,+CAA+C,iBAAiB,CAAC",file:"image-picker.vue",sourcesContent:[".image-picker .uploader .drop-pane{padding:15px;margin:15px 0;border:5px dashed #999}.image-picker .uploader .drop-pane.drop-active{border-color:blue}"],sourceRoot:"webpack://"}])},1205:function(e,t,n){t=e.exports=n(37)(),t.push([e.id,'.thumbnailer img{max-width:none!important}.thumbnailer .crop-pane{min-height:200px;max-height:600px}.thumbnailer .crop-pane .jcrop-holder{margin:auto;border:1px solid #000;box-shadow:1px 1px 5px 2px rgba(0,0,0,.2)}.centered.thumbnailer .crop-pane .jcrop-holder :not(.cropper){display:none}.centered.thumbnailer .crop-pane .jcrop-holder .cropper{opacity:1!important}.thumbnailer .preview-pane .preview-container{overflow:hidden;border:1px solid #000;margin-bottom:15px;box-shadow:1px 1px 5px 2px rgba(0,0,0,.2)}.centered.thumbnailer .preview-pane .preview-container{text-align:center}.centered.thumbnailer .preview-pane .preview-container>img{vertical-align:middle;display:inline-block;max-width:100%;max-height:100%}.centered.thumbnailer .preview-pane .preview-container>img:before{content:" ";display:inline-block;vertical-align:middle;height:100%}',"",{version:3,sources:["/./js/components/widgets/thumbnailer.vue"],names:[],mappings:"AAAA,iBAAiB,wBAAyB,CAAC,wBAAwB,iBAAiB,gBAAgB,CAAC,sCAAsC,YAAY,sBAAuB,yCAA0C,CAAC,8DAA8D,YAAY,CAAC,wDAAwD,mBAAoB,CAAC,8CAA8C,gBAAgB,sBAAuB,mBAAmB,yCAA0C,CAAC,uDAAuD,iBAAiB,CAAC,2DAA2D,sBAAsB,qBAAqB,eAAe,eAAe,CAAC,kEAAkE,YAAY,qBAAqB,sBAAsB,WAAW,CAAC",file:"thumbnailer.vue",sourcesContent:[".thumbnailer img{max-width:none !important}.thumbnailer .crop-pane{min-height:200px;max-height:600px}.thumbnailer .crop-pane .jcrop-holder{margin:auto;border:1px solid black;box-shadow:1px 1px 5px 2px rgba(0,0,0,0.2)}.centered.thumbnailer .crop-pane .jcrop-holder :not(.cropper){display:none}.centered.thumbnailer .crop-pane .jcrop-holder .cropper{opacity:1 !important}.thumbnailer .preview-pane .preview-container{overflow:hidden;border:1px solid black;margin-bottom:15px;box-shadow:1px 1px 5px 2px rgba(0,0,0,0.2)}.centered.thumbnailer .preview-pane .preview-container{text-align:center}.centered.thumbnailer .preview-pane .preview-container>img{vertical-align:middle;display:inline-block;max-width:100%;max-height:100%}.centered.thumbnailer .preview-pane .preview-container>img:before{content:' ';display:inline-block;vertical-align:middle;height:100%}"],
7
- sourceRoot:"webpack://"}])},1206:function(e,t,n){(function(e){!function(e){e.Jcrop=function(t,n){function px(e){return Math.round(e)+"px"}function cssClass(e){return o.baseClass+"-"+e}function supportsColorFade(){return e.fx.step.hasOwnProperty("backgroundColor")}function getPos(t){var n=e(t).offset();return[n.left,n.top]}function mouseAbs(e){return[e.pageX-i[0],e.pageY-i[1]]}function setOptions(t){"object"!=typeof t&&(t={}),o=e.extend(o,t),e.each(["onChange","onSelect","onRelease","onDblClick"],function(e,t){"function"!=typeof o[t]&&(o[t]=function(){})})}function startDragMode(e,t,n){if(i=getPos(p),O.setCursor("move"===e?e:e+"-resize"),"move"===e)return O.activateHandlers(createMover(t),doneSelect,n);var o=R.getFixed(),a=oppLockCorner(e),r=R.getCorner(oppLockCorner(a));R.setPressed(R.getCorner(a)),R.setCurrent(r),O.activateHandlers(dragmodeHandler(e,o),doneSelect,n)}function dragmodeHandler(e,t){return function(n){if(o.aspectRatio)switch(e){case"e":n[1]=t.y+1;break;case"w":n[1]=t.y+1;break;case"n":n[0]=t.x+1;break;case"s":n[0]=t.x+1}else switch(e){case"e":n[1]=t.y2;break;case"w":n[1]=t.y2;break;case"n":n[0]=t.x2;break;case"s":n[0]=t.x2}R.setCurrent(n),B.update()}}function createMover(e){var t=e;return L.watchKeys(),function(e){R.moveOffset([e[0]-t[0],e[1]-t[1]]),t=e,B.update()}}function oppLockCorner(e){switch(e){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function createDragger(e){return function(t){return!o.disabled&&(!("move"===e&&!o.allowMove)&&(i=getPos(p),A=!0,startDragMode(e,mouseAbs(t)),t.stopPropagation(),t.preventDefault(),!1))}}function presize(e,t,n){var i=e.width(),o=e.height();i>t&&t>0&&(i=t,o=t/e.width()*e.height()),o>n&&n>0&&(o=n,i=n/e.height()*e.width()),C=e.width()/i,S=e.height()/o,e.width(i).height(o)}function unscale(e){return{x:e.x*C,y:e.y*S,x2:e.x2*C,y2:e.y2*S,w:e.w*C,h:e.h*S}}function doneSelect(e){var t=R.getFixed();t.w>o.minSelect[0]&&t.h>o.minSelect[1]?(B.enableHandles(),B.done()):B.release(),O.setCursor(o.allowSelect?"crosshair":"default")}function newSelection(e){if(!o.disabled&&o.allowSelect){A=!0,i=getPos(p),B.disableHandles(),O.setCursor("crosshair");var t=mouseAbs(e);return R.setPressed(t),B.update(),O.activateHandlers(selectDrag,doneSelect,"touch"===e.type.substring(0,5)),L.watchKeys(),e.stopPropagation(),e.preventDefault(),!1}}function selectDrag(e){R.setCurrent(e),B.update()}function newTracker(){var t=e("<div></div>").addClass(cssClass("tracker"));return r&&t.css({opacity:0,backgroundColor:"white"}),t}function setClass(e){g.removeClass().addClass(cssClass("holder")).addClass(e)}function animateTo(e,t){function queueAnimator(){window.setTimeout(b,c)}var n=e[0]/C,i=e[1]/S,a=e[2]/C,r=e[3]/S;if(!k){var s=R.flipCoords(n,i,a,r),l=R.getFixed(),u=[l.x,l.y,l.x2,l.y2],d=u,c=o.animationDelay,p=s[0]-u[0],h=s[1]-u[1],f=s[2]-u[2],g=s[3]-u[3],m=0,v=o.swingSpeed;n=d[0],i=d[1],a=d[2],r=d[3],B.animMode(!0);var b=function(){return function(){m+=(100-m)/v,d[0]=Math.round(n+m/100*p),d[1]=Math.round(i+m/100*h),d[2]=Math.round(a+m/100*f),d[3]=Math.round(r+m/100*g),m>=99.8&&(m=100),m<100?(setSelectRaw(d),queueAnimator()):(B.done(),B.animMode(!1),"function"==typeof t&&t.call(z))}}();queueAnimator()}}function setSelect(e){setSelectRaw([e[0]/C,e[1]/S,e[2]/C,e[3]/S]),o.onSelect.call(z,unscale(R.getFixed())),B.enableHandles()}function setSelectRaw(e){R.setPressed([e[0],e[1]]),R.setCurrent([e[2],e[3]]),B.update()}function tellSelect(){return unscale(R.getFixed())}function tellScaled(){return R.getFixed()}function setOptionsNew(e){setOptions(e),interfaceUpdate()}function disableCrop(){o.disabled=!0,B.disableHandles(),B.setCursor("default"),O.setCursor("default")}function enableCrop(){o.disabled=!1,interfaceUpdate()}function cancelCrop(){B.done(),O.activateHandlers(null,null)}function destroy(){g.remove(),u.show(),u.css("visibility","visible"),e(t).removeData("Jcrop")}function setImage(e,t){B.release(),disableCrop();var n=new Image;n.onload=function(){var i=n.width,a=n.height,r=o.boxWidth,s=o.boxHeight;p.width(i).height(a),p.attr("src",e),m.attr("src",e),presize(p,r,s),h=p.width(),f=p.height(),m.width(h).height(f),P.width(h+2*F).height(f+2*F),g.width(h).height(f),E.resize(h,f),enableCrop(),"function"==typeof t&&t.call(z)},n.src=e}function colorChangeMacro(e,t,n){var i=t||o.bgColor;o.bgFade&&supportsColorFade()&&o.fadeTime&&!n?e.animate({backgroundColor:i},{queue:!1,duration:o.fadeTime}):e.css("backgroundColor",i)}function interfaceUpdate(e){o.allowResize?e?B.enableOnly():B.enableHandles():B.disableHandles(),O.setCursor(o.allowSelect?"crosshair":"default"),B.setCursor(o.allowMove?"move":"default"),o.hasOwnProperty("trueSize")&&(C=o.trueSize[0]/h,S=o.trueSize[1]/f),o.hasOwnProperty("setSelect")&&(setSelect(o.setSelect),B.done(),delete o.setSelect),E.refresh(),o.bgColor!=I&&(colorChangeMacro(o.shade?E.getShades():g,o.shade?o.shadeColor||o.bgColor:o.bgColor),I=o.bgColor),M!=o.bgOpacity&&(M=o.bgOpacity,o.shade?E.refresh():B.setBgOpacity(M)),_=o.maxSize[0]||0,q=o.maxSize[1]||0,y=o.minSize[0]||0,w=o.minSize[1]||0,o.hasOwnProperty("outerImage")&&(p.attr("src",o.outerImage),delete o.outerImage),B.refresh()}var i,o=e.extend({},e.Jcrop.defaults),a=navigator.userAgent.toLowerCase(),r=/msie/.test(a),s=/msie [1-6]\./.test(a);"object"!=typeof t&&(t=e(t)[0]),"object"!=typeof n&&(n={}),setOptions(n);var l={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},u=e(t),d=!0;if("IMG"==t.tagName){if(0!=u[0].width&&0!=u[0].height)u.width(u[0].width),u.height(u[0].height);else{var c=new Image;c.src=u[0].src,u.width(c.width),u.height(c.height)}var p=u.clone().removeAttr("id").css(l).show();p.width(u.width()),p.height(u.height()),u.after(p).hide()}else p=u.css(l).show(),d=!1,null===o.shade&&(o.shade=!0);presize(p,o.boxWidth,o.boxHeight);var h=p.width(),f=p.height(),g=e("<div />").width(h).height(f).addClass(cssClass("holder")).css({position:"relative",backgroundColor:o.bgColor}).insertAfter(u).append(p);o.addClass&&g.addClass(o.addClass);var m=e("<div />"),v=e("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),b=e("<div />").width("100%").height("100%").css("zIndex",320),x=e("<div />").css({position:"absolute",zIndex:600}).dblclick(function(){var e=R.getFixed();o.onDblClick.call(z,e)}).insertBefore(p).append(v,b);d&&(m=e("<img />").attr("src",p.attr("src")).css(l).width(h).height(f),v.append(m)),s&&x.css({overflowY:"hidden"});var _,q,y,w,C,S,A,k,D,F=o.boundary,P=newTracker().width(h+2*F).height(f+2*F).css({position:"absolute",top:px(-F),left:px(-F),zIndex:290}).mousedown(newSelection),I=o.bgColor,M=o.bgOpacity;i=getPos(p);var T=function(){function hasTouchSupport(){var e,t={},n=["touchstart","touchmove","touchend"],i=document.createElement("div");try{for(e=0;e<n.length;e++){var o=n[e];o="on"+o;var a=o in i;a||(i.setAttribute(o,"return;"),a="function"==typeof i[o]),t[n[e]]=a}return t.touchstart&&t.touchend&&t.touchmove}catch(r){return!1}}function detectSupport(){return o.touchSupport===!0||o.touchSupport===!1?o.touchSupport:hasTouchSupport()}return{createDragger:function(e){return function(t){return!o.disabled&&(!("move"===e&&!o.allowMove)&&(i=getPos(p),A=!0,startDragMode(e,mouseAbs(T.cfilter(t)),!0),t.stopPropagation(),t.preventDefault(),!1))}},newSelection:function(e){return newSelection(T.cfilter(e))},cfilter:function(e){return e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e},isSupported:hasTouchSupport,support:detectSupport()}}(),R=function(){function setPressed(e){e=rebound(e),a=n=e[0],r=i=e[1]}function setCurrent(n){n=rebound(n),e=n[0]-a,t=n[1]-r,a=n[0],r=n[1]}function getOffset(){return[e,t]}function moveOffset(e){var t=e[0],o=e[1];0>n+t&&(t-=t+n),0>i+o&&(o-=o+i),f<r+o&&(o+=f-(r+o)),h<a+t&&(t+=h-(a+t)),n+=t,a+=t,i+=o,r+=o}function getCorner(e){var t=getFixed();switch(e){case"ne":return[t.x2,t.y];case"nw":return[t.x,t.y];case"se":return[t.x2,t.y2];case"sw":return[t.x,t.y2]}}function getFixed(){if(!o.aspectRatio)return getRect();var e,t,s,l,u=o.aspectRatio,d=o.minSize[0]/C,c=o.maxSize[0]/C,p=o.maxSize[1]/S,g=a-n,m=r-i,v=Math.abs(g),b=Math.abs(m),x=v/b;return 0===c&&(c=10*h),0===p&&(p=10*f),x<u?(t=r,s=b*u,e=g<0?n-s:s+n,e<0?(e=0,l=Math.abs((e-n)/u),t=m<0?i-l:l+i):e>h&&(e=h,l=Math.abs((e-n)/u),t=m<0?i-l:l+i)):(e=a,l=v/u,t=m<0?i-l:i+l,t<0?(t=0,s=Math.abs((t-i)*u),e=g<0?n-s:s+n):t>f&&(t=f,s=Math.abs(t-i)*u,e=g<0?n-s:s+n)),e>n?(e-n<d?e=n+d:e-n>c&&(e=n+c),t=t>i?i+(e-n)/u:i-(e-n)/u):e<n&&(n-e<d?e=n-d:n-e>c&&(e=n-c),t=t>i?i+(n-e)/u:i-(n-e)/u),e<0?(n-=e,e=0):e>h&&(n-=e-h,e=h),t<0?(i-=t,t=0):t>f&&(i-=t-f,t=f),makeObj(flipCoords(n,i,e,t))}function rebound(e){return e[0]<0&&(e[0]=0),e[1]<0&&(e[1]=0),e[0]>h&&(e[0]=h),e[1]>f&&(e[1]=f),[Math.round(e[0]),Math.round(e[1])]}function flipCoords(e,t,n,i){var o=e,a=n,r=t,s=i;return n<e&&(o=n,a=e),i<t&&(r=i,s=t),[o,r,a,s]}function getRect(){var e,t=a-n,o=r-i;return _&&Math.abs(t)>_&&(a=t>0?n+_:n-_),q&&Math.abs(o)>q&&(r=o>0?i+q:i-q),w/S&&Math.abs(o)<w/S&&(r=o>0?i+w/S:i-w/S),y/C&&Math.abs(t)<y/C&&(a=t>0?n+y/C:n-y/C),n<0&&(a-=n,n-=n),i<0&&(r-=i,i-=i),a<0&&(n-=a,a-=a),r<0&&(i-=r,r-=r),a>h&&(e=a-h,n-=e,a-=e),r>f&&(e=r-f,i-=e,r-=e),n>h&&(e=n-f,r-=e,i-=e),i>f&&(e=i-f,r-=e,i-=e),makeObj(flipCoords(n,i,a,r))}function makeObj(e){return{x:e[0],y:e[1],x2:e[2],y2:e[3],w:e[2]-e[0],h:e[3]-e[1]}}var e,t,n=0,i=0,a=0,r=0;return{flipCoords:flipCoords,setPressed:setPressed,setCurrent:setCurrent,getOffset:getOffset,moveOffset:moveOffset,getCorner:getCorner,getFixed:getFixed}}(),E=function(){function resizeShades(e,t){i.left.css({height:px(t)}),i.right.css({height:px(t)})}function updateAuto(){return updateShade(R.getFixed())}function updateShade(e){i.top.css({left:px(e.x),width:px(e.w),height:px(e.y)}),i.bottom.css({top:px(e.y2),left:px(e.x),width:px(e.w),height:px(f-e.y2)}),i.right.css({left:px(e.x2),width:px(h-e.x2)}),i.left.css({width:px(e.x)})}function createShade(){return e("<div />").css({position:"absolute",backgroundColor:o.shadeColor||o.bgColor}).appendTo(n)}function enableShade(){t||(t=!0,n.insertBefore(p),updateAuto(),B.setBgOpacity(1,0,1),m.hide(),setBgColor(o.shadeColor||o.bgColor,1),B.isAwake()?setOpacity(o.bgOpacity,1):setOpacity(1,1))}function setBgColor(e,t){colorChangeMacro(getShades(),e,t)}function disableShade(){t&&(n.remove(),m.show(),t=!1,B.isAwake()?B.setBgOpacity(o.bgOpacity,1,1):(B.setBgOpacity(1,1,1),B.disableHandles()),colorChangeMacro(g,0,1))}function setOpacity(e,i){t&&(o.bgFade&&!i?n.animate({opacity:1-e},{queue:!1,duration:o.fadeTime}):n.css({opacity:1-e}))}function refreshAll(){o.shade?enableShade():disableShade(),B.isAwake()&&setOpacity(o.bgOpacity)}function getShades(){return n.children()}var t=!1,n=e("<div />").css({position:"absolute",zIndex:240,opacity:0}),i={top:createShade(),left:createShade().height(f),right:createShade().height(f),bottom:createShade()};return{update:updateAuto,updateRaw:updateShade,getShades:getShades,setBgColor:setBgColor,enable:enableShade,disable:disableShade,resize:resizeShades,refresh:refreshAll,opacity:setOpacity}}(),B=function(){function insertBorder(t){var n=e("<div />").css({position:"absolute",opacity:o.borderOpacity}).addClass(cssClass(t));return v.append(n),n}function dragDiv(t,n){var i=e("<div />").mousedown(createDragger(t)).css({cursor:t+"-resize",position:"absolute",zIndex:n}).addClass("ord-"+t);return T.support&&i.bind("touchstart.jcrop",T.createDragger(t)),b.append(i),i}function insertHandle(e){var t=o.handleSize,i=dragDiv(e,n++).css({opacity:o.handleOpacity}).addClass(cssClass("handle"));return t&&i.width(t).height(t),i}function insertDragbar(e){return dragDiv(e,n++).addClass("jcrop-dragbar")}function createDragbars(e){var t;for(t=0;t<e.length;t++)r[e[t]]=insertDragbar(e[t])}function createBorders(e){var t,n;for(n=0;n<e.length;n++){switch(e[n]){case"n":t="hline";break;case"s":t="hline bottom";break;case"e":t="vline right";break;case"w":t="vline"}i[e[n]]=insertBorder(t)}}function createHandles(e){var t;for(t=0;t<e.length;t++)a[e[t]]=insertHandle(e[t])}function moveto(e,t){o.shade||m.css({top:px(-t),left:px(-e)}),x.css({top:px(t),left:px(e)})}function resize(e,t){x.width(Math.round(e)).height(Math.round(t))}function refresh(){var e=R.getFixed();R.setPressed([e.x,e.y]),R.setCurrent([e.x2,e.y2]),updateVisible()}function updateVisible(e){if(t)return update(e)}function update(e){var n=R.getFixed();resize(n.w,n.h),moveto(n.x,n.y),o.shade&&E.updateRaw(n),t||show(),e?o.onSelect.call(z,unscale(n)):o.onChange.call(z,unscale(n))}function setBgOpacity(e,n,i){(t||n)&&(o.bgFade&&!i?p.animate({opacity:e},{queue:!1,duration:o.fadeTime}):p.css("opacity",e))}function show(){x.show(),o.shade?E.opacity(M):setBgOpacity(M,!0),t=!0}function release(){disableHandles(),x.hide(),o.shade?E.opacity(1):setBgOpacity(1),t=!1,o.onRelease.call(z)}function showHandles(){s&&b.show()}function enableHandles(){if(s=!0,o.allowResize)return b.show(),!0}function disableHandles(){s=!1,b.hide()}function animMode(e){e?(k=!0,disableHandles()):(k=!1,enableHandles())}function done(){animMode(!1),refresh()}var t,n=370,i={},a={},r={},s=!1;o.dragEdges&&e.isArray(o.createDragbars)&&createDragbars(o.createDragbars),e.isArray(o.createHandles)&&createHandles(o.createHandles),o.drawBorders&&e.isArray(o.createBorders)&&createBorders(o.createBorders),e(document).bind("touchstart.jcrop-ios",function(t){e(t.currentTarget).hasClass("jcrop-tracker")&&t.stopPropagation()});var l=newTracker().mousedown(createDragger("move")).css({cursor:"move",position:"absolute",zIndex:360});return T.support&&l.bind("touchstart.jcrop",T.createDragger("move")),v.append(l),disableHandles(),{updateVisible:updateVisible,update:update,release:release,refresh:refresh,isAwake:function(){return t},setCursor:function(e){l.css("cursor",e)},enableHandles:enableHandles,enableOnly:function(){s=!0},showHandles:showHandles,disableHandles:disableHandles,animMode:animMode,setBgOpacity:setBgOpacity,done:done}}(),O=function(){function toFront(t){P.css({zIndex:450}),t?e(document).bind("touchmove.jcrop",trackTouchMove).bind("touchend.jcrop",trackTouchEnd):i&&e(document).bind("mousemove.jcrop",trackMove).bind("mouseup.jcrop",trackUp)}function toBack(){P.css({zIndex:290}),e(document).unbind(".jcrop")}function trackMove(e){return t(mouseAbs(e)),!1}function trackUp(e){return e.preventDefault(),e.stopPropagation(),A&&(A=!1,n(mouseAbs(e)),B.isAwake()&&o.onSelect.call(z,unscale(R.getFixed())),toBack(),t=function(){},n=function(){}),!1}function activateHandlers(e,i,o){return A=!0,t=e,n=i,toFront(o),!1}function trackTouchMove(e){return t(mouseAbs(T.cfilter(e))),!1}function trackTouchEnd(e){return trackUp(T.cfilter(e))}function setCursor(e){P.css("cursor",e)}var t=function(){},n=function(){},i=o.trackDocument;return i||P.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp),p.before(P),{activateHandlers:activateHandlers,setCursor:setCursor}}(),L=function(){function watchKeys(){o.keySupport&&(t.show(),t.focus())}function onBlur(e){t.hide()}function doNudge(e,t,n){o.allowMove&&(R.moveOffset([t,n]),B.updateVisible(!0)),e.preventDefault(),e.stopPropagation()}function parseKey(e){if(e.ctrlKey||e.metaKey)return!0;D=!!e.shiftKey;var t=D?10:1;switch(e.keyCode){case 37:doNudge(e,-t,0);break;case 39:doNudge(e,t,0);break;case 38:doNudge(e,0,-t);break;case 40:doNudge(e,0,t);break;case 27:o.allowSelect&&B.release();break;case 9:return!0}return!1}var t=e('<input type="radio" />').css({position:"fixed",left:"-120px",width:"12px"}).addClass("jcrop-keymgr"),n=e("<div />").css({position:"absolute",overflow:"hidden"}).append(t);return o.keySupport&&(t.keydown(parseKey).blur(onBlur),s||!o.fixedSupport?(t.css({position:"absolute",left:"-20px"}),n.append(t).insertBefore(p)):t.insertBefore(p)),{watchKeys:watchKeys}}();T.support&&P.bind("touchstart.jcrop",T.newSelection),b.hide(),interfaceUpdate(!0);var z={setImage:setImage,animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,setClass:setClass,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,release:B.release,destroy:destroy,focus:L.watchKeys,getBounds:function(){return[h*C,f*S]},getWidgetSize:function(){return[h,f]},getScaleFactor:function(){return[C,S]},getOptions:function(){return o},ui:{holder:g,selection:x}};return r&&g.bind("selectstart",function(){return!1}),u.data("Jcrop",z),z},e.fn.Jcrop=function(t,n){var i;return this.each(function(){if(e(this).data("Jcrop")){if("api"===t)return e(this).data("Jcrop");e(this).data("Jcrop").setOptions(t)}else"IMG"==this.tagName?e.Jcrop.Loader(this,function(){e(this).css({display:"block",visibility:"hidden"}),i=e.Jcrop(this,t),e.isFunction(n)&&n.call(i)}):(e(this).css({display:"block",visibility:"hidden"}),i=e.Jcrop(this,t),e.isFunction(n)&&n.call(i))}),this},e.Jcrop.Loader=function(t,n,i){function completeCheck(){a.complete?(o.unbind(".jcloader"),e.isFunction(n)&&n.call(a)):window.setTimeout(completeCheck,50)}var o=e(t),a=o[0];o.bind("load.jcloader",completeCheck).bind("error.jcloader",function(t){o.unbind(".jcloader"),e.isFunction(i)&&i.call(a)}),a.complete&&e.isFunction(n)&&(o.unbind(".jcloader"),n.call(a))},e.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:!1,borderOpacity:.4,handleOpacity:.5,handleSize:null,aspectRatio:0,keySupport:!0,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges:!0,fixedSupport:!0,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}}(e)}).call(t,n(12))},1209:function(e,t){e.exports=' <div class=image-picker> <div class=uploader v-if="!resizing && !files.length"> <div class="row drop-pane"> <div class="text-center col-xs-12"> <span class="fa fa-download fa-4x dropicon"></span> </div> <div class="text-center col-xs-12 lead"> <p>{{ _(\'Drag a picture here\') }}</p> </div> <div class="text-center col-xs-12"> <p>{{ _(\'or\') }}</p> </div> <div class="text-center col-xs-12"> <span class="btn btn-outline btn-flat" v-el:upload-btn> {{ _(\'Select a file from your computer\') }} </span> </div> </div> </div> <div v-if="!resizing && files.length" class="info-box bg-aqua"> <span class=info-box-icon> <span class="fa fa-cloud-upload"></span> </span> <div class=info-box-content> <span class=info-box-text>{{file.name}}</span> <span class=info-box-number>{{file.size | filesize}}</span> <div class=progress> <div class=progress-bar :style="{width: progress+\'%\'}"></div> </div> <span class=progress-description> {{progress}}% </span> </div> </div> <div class="row progress-pane hide" v-if=files.length> <div class=col-xs-12> <div class=progress> <div class=progress> <div class="progress-bar progress-bar-success" role=progressbar aria-valuenow=0 aria-valuemin=0 aria-valuemax=100> </div> </div> </div> </div> </div> <thumbnailer v-ref:thumbnailer v-if=resizing :src=src :sizes=sizes> </thumbnailer> </div> '},1210:function(e,t){e.exports=" <div class=thumbnailer v-show=preview :class=\"{ 'centered': centered }\"> <div class=row> <div class=\"col-xs-12 col-sm-8 crop-pane\" v-el:crop_pane> <img class=cropper v-el:cropper/> </div> <div class=\"col-xs-12 col-sm-4 preview-pane\" v-el:preview_pane> <div class=checkbox> <label> <input type=checkbox v-el:checkbox v-model=centered> {{ _('Center the full picture') }} </label> </div> <h5>{{ _('Preview') }}</h5> <div class=preview-container v-for=\"size in sizes\" v-el:preview_containers :style=\"{width: size+'px', height: size+'px'}\"> <img class=preview :alt=\"_('Preview')\" v-el:previews :src=src /> </div> </div> </div> </div> "},1213:function(e,t,n){var i,o;n(1216),i=n(1201),o=n(1209),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1214:function(e,t,n){var i,o;n(1217),i=n(1202),o=n(1210),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1216:function(e,t,n){var i=n(1204);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1217:function(e,t,n){var i=n(1205);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1219:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=_interopRequireDefault(i),a=n(19),r=_interopRequireDefault(a),s=n(27),l=_interopRequireDefault(s),u=n(26),d=_interopRequireDefault(u),c=n(39),p=function(e){function CommunityResourcePage(e){(0,r.default)(this,CommunityResourcePage);var t=(0,l.default)(this,(CommunityResourcePage.__proto__||(0,o.default)(CommunityResourcePage)).call(this,e));return t.$options.ns="datasets",t.$options.fetch="list_community_resources",t}return(0,d.default)(CommunityResourcePage,e),CommunityResourcePage}(c.ModelPage);t.default=p},1222:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1039),o=_interopRequireDefault(i);t.default={name:"reuses-list",components:{Datatable:o.default},MASK:["id","title","created_at","last_modified","metrics","private","image_thumbnail"],data:function(){return{fields:[{key:"image_thumbnail",type:"thumbnail",width:30},{label:this._("Title"),key:"title",sort:"title",type:"deletable-text"},{label:this._("Creation"),key:"created_at",sort:"created",align:"left",type:"timeago",width:120},{label:this._("Modification"),key:"last_modified",sort:"last_modified",align:"left",type:"timeago",width:120},{label:this._("Datasets"),key:"metrics.datasets",sort:"datasets",align:"center",type:"metric",width:135},{label:this._("Followers"),key:"metrics.followers",sort:"followers",align:"center",type:"metric",width:95},{label:this._("Views"),key:"metrics.views",sort:"views",align:"center",type:"metric",width:95},{label:this._("Status"),align:"center",type:"visibility",width:95}]}},events:{"datatable:item:click":function(e){this.$go("/reuse/"+e.id+"/")}},props:{reuses:null,downloads:{type:Array,default:function(){return[]}},title:{type:String,default:function(){return this._("Reuses")}}}}},1228:function(e,t){e.exports=" <div> <datatable :title=title icon=recycle boxclass=reuses-widget :fields=fields :p=reuses :downloads=downloads :empty=\"_('No reuse')\"> </datatable> </div> "},1231:[1672,1222,1228],1235:function(e,t,n){!function(t,i){e.exports=i(function(){try{return n(17)}catch(e){}}())}(this,function(e){"use strict";function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}function getCjsExportFromNamespace(e){return e&&e.default||e}function buildGraph(){for(var e={},t=Object.keys(n),i=t.length,o=0;o<i;o++)e[t[o]]={distance:-1,parent:null};return e}function deriveBFS(e){var t=buildGraph(),i=[e];for(t[e].distance=0;i.length;)for(var o=i.pop(),a=Object.keys(n[o]),r=a.length,s=0;s<r;s++){var l=a[s],u=t[l];u.distance===-1&&(u.distance=t[o].distance+1,u.parent=o,i.unshift(l))}return t}function link(e,t){return function(n){return t(e(n))}}function wrapConversion(e,t){for(var i=[t[e].parent,e],o=n[t[e].parent][e],a=t[e].parent;t[a].parent;)i.unshift(t[a].parent),o=link(n[t[a].parent][a],o),a=t[a].parent;return o.conversion=i,o}function wrapRaw(e){var t=function(t){return void 0===t||null===t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function wrapRounded(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var i=n.length,o=0;o<i;o++)n[o]=Math.round(n[o]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}function getRgba(e){if(e){var t=/^#([a-fA-F0-9]{3,4})$/i,n=/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,i=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,a=/(\w+)/,r=[0,0,0],l=1,u=e.match(t),d="";if(u){u=u[1],d=u[3];for(var c=0;c<r.length;c++)r[c]=parseInt(u[c]+u[c],16);d&&(l=Math.round(parseInt(d+d,16)/255*100)/100)}else if(u=e.match(n)){d=u[2],u=u[1];for(var c=0;c<r.length;c++)r[c]=parseInt(u.slice(2*c,2*c+2),16);d&&(l=Math.round(parseInt(d,16)/255*100)/100)}else if(u=e.match(i)){for(var c=0;c<r.length;c++)r[c]=parseInt(u[c+1]);l=parseFloat(u[4])}else if(u=e.match(o)){for(var c=0;c<r.length;c++)r[c]=Math.round(2.55*parseFloat(u[c+1]));l=parseFloat(u[4])}else if(u=e.match(a)){if("transparent"==u[1])return[0,0,0,0];if(r=s[u[1]],!r)return}for(var c=0;c<r.length;c++)r[c]=scale(r[c],0,255);return l=l||0==l?scale(l,0,1):1,r[3]=l,r}}function getHsla(e){if(e){var t=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=e.match(t);if(n){var i=parseFloat(n[4]),o=scale(parseInt(n[1]),0,360),a=scale(parseFloat(n[2]),0,100),r=scale(parseFloat(n[3]),0,100),s=scale(isNaN(i)?1:i,0,1);return[o,a,r,s]}}}function getHwb(e){if(e){var t=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=e.match(t);if(n){var i=parseFloat(n[4]),o=scale(parseInt(n[1]),0,360),a=scale(parseFloat(n[2]),0,100),r=scale(parseFloat(n[3]),0,100),s=scale(isNaN(i)?1:i,0,1);return[o,a,r,s]}}}function getRgb(e){var t=getRgba(e);return t&&t.slice(0,3)}function getHsl(e){var t=getHsla(e);return t&&t.slice(0,3)}function getAlpha(e){var t=getRgba(e);return t?t[3]:(t=getHsla(e))?t[3]:(t=getHwb(e))?t[3]:void 0}function hexString(e,t){var t=void 0!==t&&3===e.length?t:e[3];return"#"+hexDouble(e[0])+hexDouble(e[1])+hexDouble(e[2])+(t>=0&&t<1?hexDouble(Math.round(255*t)):"")}function rgbString(e,t){return t<1||e[3]&&e[3]<1?rgbaString(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"}function rgbaString(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function percentString(e,t){if(t<1||e[3]&&e[3]<1)return percentaString(e,t);var n=Math.round(e[0]/255*100),i=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return"rgb("+n+"%, "+i+"%, "+o+"%)"}function percentaString(e,t){var n=Math.round(e[0]/255*100),i=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return"rgba("+n+"%, "+i+"%, "+o+"%, "+(t||e[3]||1)+")"}function hslString(e,t){return t<1||e[3]&&e[3]<1?hslaString(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"}function hslaString(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function hwbString(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"}function keyword(e){return u[e.slice(0,3)]}function scale(e,t,n){return Math.min(Math.max(t,e),n)}function hexDouble(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}function isValidKey(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function toFontString(e){return!e||f.isNullOrUndef(e.size)||f.isNullOrUndef(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function interpolate(e,t,n,i){var o,a,r,s,l,u,d,c,h,f=Object.keys(n);for(o=0,a=f.length;o<a;++o)if(r=f[o],u=n[r],t.hasOwnProperty(r)||(t[r]=u),s=t[r],s!==u&&"_"!==r[0]){if(e.hasOwnProperty(r)||(e[r]=s),l=e[r],d=typeof u,d===typeof l)if("string"===d){if(c=p(l),c.valid&&(h=p(u),h.valid)){t[r]=h.mix(c,i).rgbString();continue}}else if(O.isFinite(l)&&O.isFinite(u)){t[r]=l+(u-l)*i;continue}t[r]=u}}function listenArrayEvents(e,t){return e._chartjs?void e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),void Y.forEach(function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),i=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),o=i.apply(this,t);return O.each(e._chartjs.listeners,function(e){"function"==typeof e[n]&&e[n].apply(e,t)}),o}})}))}function unlistenArrayEvents(e,t){var n=e._chartjs;if(n){var i=n.listeners,o=i.indexOf(t);o!==-1&&i.splice(o,1),i.length>0||(Y.forEach(function(t){delete e[t]}),delete e._chartjs)}}function clipArc(e,t){var n=t.startAngle,i=t.endAngle,o=t.pixelMargin,a=o/t.outerRadius,r=t.x,s=t.y;e.beginPath(),e.arc(r,s,t.outerRadius,n-a,i+a),t.innerRadius>o?(a=o/t.innerRadius,e.arc(r,s,t.innerRadius-o,i+a,n-a,!0)):e.arc(r,s,o,i+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}function drawFullCircleBorders(e,t,n,i){var o,a=n.endAngle;for(i&&(n.endAngle=n.startAngle+Z,clipArc(e,n),n.endAngle=a,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=Z,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+Z,n.startAngle,!0),o=0;o<n.fullCircles;++o)e.stroke();for(e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.startAngle+Z),o=0;o<n.fullCircles;++o)e.stroke()}function drawBorder(e,t,n){var i="inner"===t.borderAlign;i?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),n.fullCircles&&drawFullCircleBorders(e,t,n,i),i&&clipArc(e,n),e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.endAngle),e.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),e.closePath(),e.stroke()}function xRange(e){var t=this._view;return!!t&&Math.abs(e-t.x)<t.radius+t.hitRadius}function yRange(e){var t=this._view;return!!t&&Math.abs(e-t.y)<t.radius+t.hitRadius}function isVertical(e){return e&&void 0!==e.width}function getBarBounds(e){var t,n,i,o,a;return isVertical(e)?(a=e.width/2,t=e.x-a,n=e.x+a,i=Math.min(e.y,e.base),o=Math.max(e.y,e.base)):(a=e.height/2,t=Math.min(e.x,e.base),n=Math.max(e.x,e.base),i=e.y-a,o=e.y+a),{left:t,top:i,right:n,bottom:o}}function swap(e,t,n){return e===t?n:e===n?t:e}function parseBorderSkipped(e){var t=e.borderSkipped,n={};return t?(e.horizontal?e.base>e.x&&(t=swap(t,"left","right")):e.base<e.y&&(t=swap(t,"bottom","top")),n[t]=!0,n):n}function parseBorderWidth(e,t,n){var i,o,a,r,s=e.borderWidth,l=parseBorderSkipped(e);return O.isObject(s)?(i=+s.top||0,o=+s.right||0,a=+s.bottom||0,r=+s.left||0):i=o=a=r=+s||0,{t:l.top||i<0?0:i>n?n:i,r:l.right||o<0?0:o>t?t:o,b:l.bottom||a<0?0:a>n?n:a,l:l.left||r<0?0:r>t?t:r}}function boundingRects(e){var t=getBarBounds(e),n=t.right-t.left,i=t.bottom-t.top,o=parseBorderWidth(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:i-o.t-o.b}}}function inRange(e,t,n){var i=null===t,o=null===n,a=!(!e||i&&o)&&getBarBounds(e);return a&&(i||t>=a.left&&t<=a.right)&&(o||n>=a.top&&n<=a.bottom)}function computeMinSampleSize(e,t){var n,i,o,a,r=e._length;for(o=1,a=t.length;o<a;++o)r=Math.min(r,Math.abs(t[o]-t[o-1]));for(o=0,a=e.getTicks().length;o<a;++o)i=e.getPixelForTick(o),r=o>0?Math.min(r,Math.abs(i-n)):r,n=i;return r}function computeFitCategoryTraits(e,t,n){var i,o,a=n.barThickness,r=t.stackCount,s=t.pixels[e],l=O.isNullOrUndef(a)?computeMinSampleSize(t.scale,t.pixels):-1;return O.isNullOrUndef(a)?(i=l*n.categoryPercentage,o=n.barPercentage):(i=a*r,o=1),{chunk:i/r,ratio:o,start:s-i/2}}function computeFlexCategoryTraits(e,t,n){var i,o,a=t.pixels,r=a[e],s=e>0?a[e-1]:null,l=e<a.length-1?a[e+1]:null,u=n.categoryPercentage;return null===s&&(s=r-(null===l?t.end-t.start:l-r)),null===l&&(l=r+r-s),i=r-(r-Math.min(s,l))/2*u,o=Math.abs(l-s)/2*u,{chunk:o/t.stackCount,ratio:n.barPercentage,start:i}}function scaleClip(e,t){var n=e&&e.options.ticks||{},i=n.reverse,o=void 0===n.min?t:0,a=void 0===n.max?t:0;return{start:i?a:o,end:i?o:a}}function defaultClip(e,t,n){var i=n/2,o=scaleClip(e,i),a=scaleClip(t,i);return{top:a.end,right:o.end,bottom:a.start,left:o.start}}function toClip(e){
7
+ sourceRoot:"webpack://"}])},1206:function(e,t,n){(function(e){!function(e){e.Jcrop=function(t,n){function px(e){return Math.round(e)+"px"}function cssClass(e){return o.baseClass+"-"+e}function supportsColorFade(){return e.fx.step.hasOwnProperty("backgroundColor")}function getPos(t){var n=e(t).offset();return[n.left,n.top]}function mouseAbs(e){return[e.pageX-i[0],e.pageY-i[1]]}function setOptions(t){"object"!=typeof t&&(t={}),o=e.extend(o,t),e.each(["onChange","onSelect","onRelease","onDblClick"],function(e,t){"function"!=typeof o[t]&&(o[t]=function(){})})}function startDragMode(e,t,n){if(i=getPos(p),O.setCursor("move"===e?e:e+"-resize"),"move"===e)return O.activateHandlers(createMover(t),doneSelect,n);var o=R.getFixed(),a=oppLockCorner(e),r=R.getCorner(oppLockCorner(a));R.setPressed(R.getCorner(a)),R.setCurrent(r),O.activateHandlers(dragmodeHandler(e,o),doneSelect,n)}function dragmodeHandler(e,t){return function(n){if(o.aspectRatio)switch(e){case"e":n[1]=t.y+1;break;case"w":n[1]=t.y+1;break;case"n":n[0]=t.x+1;break;case"s":n[0]=t.x+1}else switch(e){case"e":n[1]=t.y2;break;case"w":n[1]=t.y2;break;case"n":n[0]=t.x2;break;case"s":n[0]=t.x2}R.setCurrent(n),B.update()}}function createMover(e){var t=e;return L.watchKeys(),function(e){R.moveOffset([e[0]-t[0],e[1]-t[1]]),t=e,B.update()}}function oppLockCorner(e){switch(e){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function createDragger(e){return function(t){return!o.disabled&&(!("move"===e&&!o.allowMove)&&(i=getPos(p),A=!0,startDragMode(e,mouseAbs(t)),t.stopPropagation(),t.preventDefault(),!1))}}function presize(e,t,n){var i=e.width(),o=e.height();i>t&&t>0&&(i=t,o=t/e.width()*e.height()),o>n&&n>0&&(o=n,i=n/e.height()*e.width()),C=e.width()/i,S=e.height()/o,e.width(i).height(o)}function unscale(e){return{x:e.x*C,y:e.y*S,x2:e.x2*C,y2:e.y2*S,w:e.w*C,h:e.h*S}}function doneSelect(e){var t=R.getFixed();t.w>o.minSelect[0]&&t.h>o.minSelect[1]?(B.enableHandles(),B.done()):B.release(),O.setCursor(o.allowSelect?"crosshair":"default")}function newSelection(e){if(!o.disabled&&o.allowSelect){A=!0,i=getPos(p),B.disableHandles(),O.setCursor("crosshair");var t=mouseAbs(e);return R.setPressed(t),B.update(),O.activateHandlers(selectDrag,doneSelect,"touch"===e.type.substring(0,5)),L.watchKeys(),e.stopPropagation(),e.preventDefault(),!1}}function selectDrag(e){R.setCurrent(e),B.update()}function newTracker(){var t=e("<div></div>").addClass(cssClass("tracker"));return r&&t.css({opacity:0,backgroundColor:"white"}),t}function setClass(e){g.removeClass().addClass(cssClass("holder")).addClass(e)}function animateTo(e,t){function queueAnimator(){window.setTimeout(b,c)}var n=e[0]/C,i=e[1]/S,a=e[2]/C,r=e[3]/S;if(!k){var s=R.flipCoords(n,i,a,r),l=R.getFixed(),u=[l.x,l.y,l.x2,l.y2],d=u,c=o.animationDelay,p=s[0]-u[0],h=s[1]-u[1],f=s[2]-u[2],g=s[3]-u[3],m=0,v=o.swingSpeed;n=d[0],i=d[1],a=d[2],r=d[3],B.animMode(!0);var b=function(){return function(){m+=(100-m)/v,d[0]=Math.round(n+m/100*p),d[1]=Math.round(i+m/100*h),d[2]=Math.round(a+m/100*f),d[3]=Math.round(r+m/100*g),m>=99.8&&(m=100),m<100?(setSelectRaw(d),queueAnimator()):(B.done(),B.animMode(!1),"function"==typeof t&&t.call(z))}}();queueAnimator()}}function setSelect(e){setSelectRaw([e[0]/C,e[1]/S,e[2]/C,e[3]/S]),o.onSelect.call(z,unscale(R.getFixed())),B.enableHandles()}function setSelectRaw(e){R.setPressed([e[0],e[1]]),R.setCurrent([e[2],e[3]]),B.update()}function tellSelect(){return unscale(R.getFixed())}function tellScaled(){return R.getFixed()}function setOptionsNew(e){setOptions(e),interfaceUpdate()}function disableCrop(){o.disabled=!0,B.disableHandles(),B.setCursor("default"),O.setCursor("default")}function enableCrop(){o.disabled=!1,interfaceUpdate()}function cancelCrop(){B.done(),O.activateHandlers(null,null)}function destroy(){g.remove(),u.show(),u.css("visibility","visible"),e(t).removeData("Jcrop")}function setImage(e,t){B.release(),disableCrop();var n=new Image;n.onload=function(){var i=n.width,a=n.height,r=o.boxWidth,s=o.boxHeight;p.width(i).height(a),p.attr("src",e),m.attr("src",e),presize(p,r,s),h=p.width(),f=p.height(),m.width(h).height(f),P.width(h+2*F).height(f+2*F),g.width(h).height(f),E.resize(h,f),enableCrop(),"function"==typeof t&&t.call(z)},n.src=e}function colorChangeMacro(e,t,n){var i=t||o.bgColor;o.bgFade&&supportsColorFade()&&o.fadeTime&&!n?e.animate({backgroundColor:i},{queue:!1,duration:o.fadeTime}):e.css("backgroundColor",i)}function interfaceUpdate(e){o.allowResize?e?B.enableOnly():B.enableHandles():B.disableHandles(),O.setCursor(o.allowSelect?"crosshair":"default"),B.setCursor(o.allowMove?"move":"default"),o.hasOwnProperty("trueSize")&&(C=o.trueSize[0]/h,S=o.trueSize[1]/f),o.hasOwnProperty("setSelect")&&(setSelect(o.setSelect),B.done(),delete o.setSelect),E.refresh(),o.bgColor!=I&&(colorChangeMacro(o.shade?E.getShades():g,o.shade?o.shadeColor||o.bgColor:o.bgColor),I=o.bgColor),M!=o.bgOpacity&&(M=o.bgOpacity,o.shade?E.refresh():B.setBgOpacity(M)),_=o.maxSize[0]||0,q=o.maxSize[1]||0,y=o.minSize[0]||0,w=o.minSize[1]||0,o.hasOwnProperty("outerImage")&&(p.attr("src",o.outerImage),delete o.outerImage),B.refresh()}var i,o=e.extend({},e.Jcrop.defaults),a=navigator.userAgent.toLowerCase(),r=/msie/.test(a),s=/msie [1-6]\./.test(a);"object"!=typeof t&&(t=e(t)[0]),"object"!=typeof n&&(n={}),setOptions(n);var l={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},u=e(t),d=!0;if("IMG"==t.tagName){if(0!=u[0].width&&0!=u[0].height)u.width(u[0].width),u.height(u[0].height);else{var c=new Image;c.src=u[0].src,u.width(c.width),u.height(c.height)}var p=u.clone().removeAttr("id").css(l).show();p.width(u.width()),p.height(u.height()),u.after(p).hide()}else p=u.css(l).show(),d=!1,null===o.shade&&(o.shade=!0);presize(p,o.boxWidth,o.boxHeight);var h=p.width(),f=p.height(),g=e("<div />").width(h).height(f).addClass(cssClass("holder")).css({position:"relative",backgroundColor:o.bgColor}).insertAfter(u).append(p);o.addClass&&g.addClass(o.addClass);var m=e("<div />"),v=e("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),b=e("<div />").width("100%").height("100%").css("zIndex",320),x=e("<div />").css({position:"absolute",zIndex:600}).dblclick(function(){var e=R.getFixed();o.onDblClick.call(z,e)}).insertBefore(p).append(v,b);d&&(m=e("<img />").attr("src",p.attr("src")).css(l).width(h).height(f),v.append(m)),s&&x.css({overflowY:"hidden"});var _,q,y,w,C,S,A,k,D,F=o.boundary,P=newTracker().width(h+2*F).height(f+2*F).css({position:"absolute",top:px(-F),left:px(-F),zIndex:290}).mousedown(newSelection),I=o.bgColor,M=o.bgOpacity;i=getPos(p);var T=function(){function hasTouchSupport(){var e,t={},n=["touchstart","touchmove","touchend"],i=document.createElement("div");try{for(e=0;e<n.length;e++){var o=n[e];o="on"+o;var a=o in i;a||(i.setAttribute(o,"return;"),a="function"==typeof i[o]),t[n[e]]=a}return t.touchstart&&t.touchend&&t.touchmove}catch(r){return!1}}function detectSupport(){return o.touchSupport===!0||o.touchSupport===!1?o.touchSupport:hasTouchSupport()}return{createDragger:function(e){return function(t){return!o.disabled&&(!("move"===e&&!o.allowMove)&&(i=getPos(p),A=!0,startDragMode(e,mouseAbs(T.cfilter(t)),!0),t.stopPropagation(),t.preventDefault(),!1))}},newSelection:function(e){return newSelection(T.cfilter(e))},cfilter:function(e){return e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e},isSupported:hasTouchSupport,support:detectSupport()}}(),R=function(){function setPressed(e){e=rebound(e),a=n=e[0],r=i=e[1]}function setCurrent(n){n=rebound(n),e=n[0]-a,t=n[1]-r,a=n[0],r=n[1]}function getOffset(){return[e,t]}function moveOffset(e){var t=e[0],o=e[1];0>n+t&&(t-=t+n),0>i+o&&(o-=o+i),f<r+o&&(o+=f-(r+o)),h<a+t&&(t+=h-(a+t)),n+=t,a+=t,i+=o,r+=o}function getCorner(e){var t=getFixed();switch(e){case"ne":return[t.x2,t.y];case"nw":return[t.x,t.y];case"se":return[t.x2,t.y2];case"sw":return[t.x,t.y2]}}function getFixed(){if(!o.aspectRatio)return getRect();var e,t,s,l,u=o.aspectRatio,d=o.minSize[0]/C,c=o.maxSize[0]/C,p=o.maxSize[1]/S,g=a-n,m=r-i,v=Math.abs(g),b=Math.abs(m),x=v/b;return 0===c&&(c=10*h),0===p&&(p=10*f),x<u?(t=r,s=b*u,e=g<0?n-s:s+n,e<0?(e=0,l=Math.abs((e-n)/u),t=m<0?i-l:l+i):e>h&&(e=h,l=Math.abs((e-n)/u),t=m<0?i-l:l+i)):(e=a,l=v/u,t=m<0?i-l:i+l,t<0?(t=0,s=Math.abs((t-i)*u),e=g<0?n-s:s+n):t>f&&(t=f,s=Math.abs(t-i)*u,e=g<0?n-s:s+n)),e>n?(e-n<d?e=n+d:e-n>c&&(e=n+c),t=t>i?i+(e-n)/u:i-(e-n)/u):e<n&&(n-e<d?e=n-d:n-e>c&&(e=n-c),t=t>i?i+(n-e)/u:i-(n-e)/u),e<0?(n-=e,e=0):e>h&&(n-=e-h,e=h),t<0?(i-=t,t=0):t>f&&(i-=t-f,t=f),makeObj(flipCoords(n,i,e,t))}function rebound(e){return e[0]<0&&(e[0]=0),e[1]<0&&(e[1]=0),e[0]>h&&(e[0]=h),e[1]>f&&(e[1]=f),[Math.round(e[0]),Math.round(e[1])]}function flipCoords(e,t,n,i){var o=e,a=n,r=t,s=i;return n<e&&(o=n,a=e),i<t&&(r=i,s=t),[o,r,a,s]}function getRect(){var e,t=a-n,o=r-i;return _&&Math.abs(t)>_&&(a=t>0?n+_:n-_),q&&Math.abs(o)>q&&(r=o>0?i+q:i-q),w/S&&Math.abs(o)<w/S&&(r=o>0?i+w/S:i-w/S),y/C&&Math.abs(t)<y/C&&(a=t>0?n+y/C:n-y/C),n<0&&(a-=n,n-=n),i<0&&(r-=i,i-=i),a<0&&(n-=a,a-=a),r<0&&(i-=r,r-=r),a>h&&(e=a-h,n-=e,a-=e),r>f&&(e=r-f,i-=e,r-=e),n>h&&(e=n-f,r-=e,i-=e),i>f&&(e=i-f,r-=e,i-=e),makeObj(flipCoords(n,i,a,r))}function makeObj(e){return{x:e[0],y:e[1],x2:e[2],y2:e[3],w:e[2]-e[0],h:e[3]-e[1]}}var e,t,n=0,i=0,a=0,r=0;return{flipCoords:flipCoords,setPressed:setPressed,setCurrent:setCurrent,getOffset:getOffset,moveOffset:moveOffset,getCorner:getCorner,getFixed:getFixed}}(),E=function(){function resizeShades(e,t){i.left.css({height:px(t)}),i.right.css({height:px(t)})}function updateAuto(){return updateShade(R.getFixed())}function updateShade(e){i.top.css({left:px(e.x),width:px(e.w),height:px(e.y)}),i.bottom.css({top:px(e.y2),left:px(e.x),width:px(e.w),height:px(f-e.y2)}),i.right.css({left:px(e.x2),width:px(h-e.x2)}),i.left.css({width:px(e.x)})}function createShade(){return e("<div />").css({position:"absolute",backgroundColor:o.shadeColor||o.bgColor}).appendTo(n)}function enableShade(){t||(t=!0,n.insertBefore(p),updateAuto(),B.setBgOpacity(1,0,1),m.hide(),setBgColor(o.shadeColor||o.bgColor,1),B.isAwake()?setOpacity(o.bgOpacity,1):setOpacity(1,1))}function setBgColor(e,t){colorChangeMacro(getShades(),e,t)}function disableShade(){t&&(n.remove(),m.show(),t=!1,B.isAwake()?B.setBgOpacity(o.bgOpacity,1,1):(B.setBgOpacity(1,1,1),B.disableHandles()),colorChangeMacro(g,0,1))}function setOpacity(e,i){t&&(o.bgFade&&!i?n.animate({opacity:1-e},{queue:!1,duration:o.fadeTime}):n.css({opacity:1-e}))}function refreshAll(){o.shade?enableShade():disableShade(),B.isAwake()&&setOpacity(o.bgOpacity)}function getShades(){return n.children()}var t=!1,n=e("<div />").css({position:"absolute",zIndex:240,opacity:0}),i={top:createShade(),left:createShade().height(f),right:createShade().height(f),bottom:createShade()};return{update:updateAuto,updateRaw:updateShade,getShades:getShades,setBgColor:setBgColor,enable:enableShade,disable:disableShade,resize:resizeShades,refresh:refreshAll,opacity:setOpacity}}(),B=function(){function insertBorder(t){var n=e("<div />").css({position:"absolute",opacity:o.borderOpacity}).addClass(cssClass(t));return v.append(n),n}function dragDiv(t,n){var i=e("<div />").mousedown(createDragger(t)).css({cursor:t+"-resize",position:"absolute",zIndex:n}).addClass("ord-"+t);return T.support&&i.bind("touchstart.jcrop",T.createDragger(t)),b.append(i),i}function insertHandle(e){var t=o.handleSize,i=dragDiv(e,n++).css({opacity:o.handleOpacity}).addClass(cssClass("handle"));return t&&i.width(t).height(t),i}function insertDragbar(e){return dragDiv(e,n++).addClass("jcrop-dragbar")}function createDragbars(e){var t;for(t=0;t<e.length;t++)r[e[t]]=insertDragbar(e[t])}function createBorders(e){var t,n;for(n=0;n<e.length;n++){switch(e[n]){case"n":t="hline";break;case"s":t="hline bottom";break;case"e":t="vline right";break;case"w":t="vline"}i[e[n]]=insertBorder(t)}}function createHandles(e){var t;for(t=0;t<e.length;t++)a[e[t]]=insertHandle(e[t])}function moveto(e,t){o.shade||m.css({top:px(-t),left:px(-e)}),x.css({top:px(t),left:px(e)})}function resize(e,t){x.width(Math.round(e)).height(Math.round(t))}function refresh(){var e=R.getFixed();R.setPressed([e.x,e.y]),R.setCurrent([e.x2,e.y2]),updateVisible()}function updateVisible(e){if(t)return update(e)}function update(e){var n=R.getFixed();resize(n.w,n.h),moveto(n.x,n.y),o.shade&&E.updateRaw(n),t||show(),e?o.onSelect.call(z,unscale(n)):o.onChange.call(z,unscale(n))}function setBgOpacity(e,n,i){(t||n)&&(o.bgFade&&!i?p.animate({opacity:e},{queue:!1,duration:o.fadeTime}):p.css("opacity",e))}function show(){x.show(),o.shade?E.opacity(M):setBgOpacity(M,!0),t=!0}function release(){disableHandles(),x.hide(),o.shade?E.opacity(1):setBgOpacity(1),t=!1,o.onRelease.call(z)}function showHandles(){s&&b.show()}function enableHandles(){if(s=!0,o.allowResize)return b.show(),!0}function disableHandles(){s=!1,b.hide()}function animMode(e){e?(k=!0,disableHandles()):(k=!1,enableHandles())}function done(){animMode(!1),refresh()}var t,n=370,i={},a={},r={},s=!1;o.dragEdges&&e.isArray(o.createDragbars)&&createDragbars(o.createDragbars),e.isArray(o.createHandles)&&createHandles(o.createHandles),o.drawBorders&&e.isArray(o.createBorders)&&createBorders(o.createBorders),e(document).bind("touchstart.jcrop-ios",function(t){e(t.currentTarget).hasClass("jcrop-tracker")&&t.stopPropagation()});var l=newTracker().mousedown(createDragger("move")).css({cursor:"move",position:"absolute",zIndex:360});return T.support&&l.bind("touchstart.jcrop",T.createDragger("move")),v.append(l),disableHandles(),{updateVisible:updateVisible,update:update,release:release,refresh:refresh,isAwake:function(){return t},setCursor:function(e){l.css("cursor",e)},enableHandles:enableHandles,enableOnly:function(){s=!0},showHandles:showHandles,disableHandles:disableHandles,animMode:animMode,setBgOpacity:setBgOpacity,done:done}}(),O=function(){function toFront(t){P.css({zIndex:450}),t?e(document).bind("touchmove.jcrop",trackTouchMove).bind("touchend.jcrop",trackTouchEnd):i&&e(document).bind("mousemove.jcrop",trackMove).bind("mouseup.jcrop",trackUp)}function toBack(){P.css({zIndex:290}),e(document).unbind(".jcrop")}function trackMove(e){return t(mouseAbs(e)),!1}function trackUp(e){return e.preventDefault(),e.stopPropagation(),A&&(A=!1,n(mouseAbs(e)),B.isAwake()&&o.onSelect.call(z,unscale(R.getFixed())),toBack(),t=function(){},n=function(){}),!1}function activateHandlers(e,i,o){return A=!0,t=e,n=i,toFront(o),!1}function trackTouchMove(e){return t(mouseAbs(T.cfilter(e))),!1}function trackTouchEnd(e){return trackUp(T.cfilter(e))}function setCursor(e){P.css("cursor",e)}var t=function(){},n=function(){},i=o.trackDocument;return i||P.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp),p.before(P),{activateHandlers:activateHandlers,setCursor:setCursor}}(),L=function(){function watchKeys(){o.keySupport&&(t.show(),t.focus())}function onBlur(e){t.hide()}function doNudge(e,t,n){o.allowMove&&(R.moveOffset([t,n]),B.updateVisible(!0)),e.preventDefault(),e.stopPropagation()}function parseKey(e){if(e.ctrlKey||e.metaKey)return!0;D=!!e.shiftKey;var t=D?10:1;switch(e.keyCode){case 37:doNudge(e,-t,0);break;case 39:doNudge(e,t,0);break;case 38:doNudge(e,0,-t);break;case 40:doNudge(e,0,t);break;case 27:o.allowSelect&&B.release();break;case 9:return!0}return!1}var t=e('<input type="radio" />').css({position:"fixed",left:"-120px",width:"12px"}).addClass("jcrop-keymgr"),n=e("<div />").css({position:"absolute",overflow:"hidden"}).append(t);return o.keySupport&&(t.keydown(parseKey).blur(onBlur),s||!o.fixedSupport?(t.css({position:"absolute",left:"-20px"}),n.append(t).insertBefore(p)):t.insertBefore(p)),{watchKeys:watchKeys}}();T.support&&P.bind("touchstart.jcrop",T.newSelection),b.hide(),interfaceUpdate(!0);var z={setImage:setImage,animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,setClass:setClass,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,release:B.release,destroy:destroy,focus:L.watchKeys,getBounds:function(){return[h*C,f*S]},getWidgetSize:function(){return[h,f]},getScaleFactor:function(){return[C,S]},getOptions:function(){return o},ui:{holder:g,selection:x}};return r&&g.bind("selectstart",function(){return!1}),u.data("Jcrop",z),z},e.fn.Jcrop=function(t,n){var i;return this.each(function(){if(e(this).data("Jcrop")){if("api"===t)return e(this).data("Jcrop");e(this).data("Jcrop").setOptions(t)}else"IMG"==this.tagName?e.Jcrop.Loader(this,function(){e(this).css({display:"block",visibility:"hidden"}),i=e.Jcrop(this,t),e.isFunction(n)&&n.call(i)}):(e(this).css({display:"block",visibility:"hidden"}),i=e.Jcrop(this,t),e.isFunction(n)&&n.call(i))}),this},e.Jcrop.Loader=function(t,n,i){function completeCheck(){a.complete?(o.unbind(".jcloader"),e.isFunction(n)&&n.call(a)):window.setTimeout(completeCheck,50)}var o=e(t),a=o[0];o.bind("load.jcloader",completeCheck).bind("error.jcloader",function(t){o.unbind(".jcloader"),e.isFunction(i)&&i.call(a)}),a.complete&&e.isFunction(n)&&(o.unbind(".jcloader"),n.call(a))},e.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:!1,borderOpacity:.4,handleOpacity:.5,handleSize:null,aspectRatio:0,keySupport:!0,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges:!0,fixedSupport:!0,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}}(e)}).call(t,n(12))},1209:function(e,t){e.exports=' <div class=image-picker> <div class=uploader v-if="!resizing && !files.length"> <div class="row drop-pane"> <div class="text-center col-xs-12"> <span class="fa fa-download fa-4x dropicon"></span> </div> <div class="text-center col-xs-12 lead"> <p>{{ _(\'Drag a picture here\') }}</p> </div> <div class="text-center col-xs-12"> <p>{{ _(\'or\') }}</p> </div> <div class="text-center col-xs-12"> <span class="btn btn-outline btn-flat" v-el:upload-btn> {{ _(\'Select a file from your computer\') }} </span> </div> </div> </div> <div v-if="!resizing && files.length" class="info-box bg-aqua"> <span class=info-box-icon> <span class="fa fa-cloud-upload"></span> </span> <div class=info-box-content> <span class=info-box-text>{{file.name}}</span> <span class=info-box-number>{{file.size | filesize}}</span> <div class=progress> <div class=progress-bar :style="{width: progress+\'%\'}"></div> </div> <span class=progress-description> {{progress}}% </span> </div> </div> <div class="row progress-pane hide" v-if=files.length> <div class=col-xs-12> <div class=progress> <div class=progress> <div class="progress-bar progress-bar-success" role=progressbar aria-valuenow=0 aria-valuemin=0 aria-valuemax=100> </div> </div> </div> </div> </div> <thumbnailer v-ref:thumbnailer v-if=resizing :src=src :sizes=sizes> </thumbnailer> </div> '},1210:function(e,t){e.exports=" <div class=thumbnailer v-show=preview :class=\"{ 'centered': centered }\"> <div class=row> <div class=\"col-xs-12 col-sm-8 crop-pane\" v-el:crop_pane> <img class=cropper v-el:cropper/> </div> <div class=\"col-xs-12 col-sm-4 preview-pane\" v-el:preview_pane> <div class=checkbox> <label> <input type=checkbox v-el:checkbox v-model=centered> {{ _('Center the full picture') }} </label> </div> <h5>{{ _('Preview') }}</h5> <div class=preview-container v-for=\"size in sizes\" v-el:preview_containers :style=\"{width: size+'px', height: size+'px'}\"> <img class=preview :alt=\"_('Preview')\" v-el:previews :src=src /> </div> </div> </div> </div> "},1213:function(e,t,n){var i,o;n(1216),i=n(1201),o=n(1209),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1214:function(e,t,n){var i,o;n(1217),i=n(1202),o=n(1210),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1216:function(e,t,n){var i=n(1204);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1217:function(e,t,n){var i=n(1205);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1219:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=_interopRequireDefault(i),a=n(19),r=_interopRequireDefault(a),s=n(27),l=_interopRequireDefault(s),u=n(26),d=_interopRequireDefault(u),c=n(39),p=function(e){function CommunityResourcePage(e){(0,r.default)(this,CommunityResourcePage);var t=(0,l.default)(this,(CommunityResourcePage.__proto__||(0,o.default)(CommunityResourcePage)).call(this,e));return t.$options.ns="datasets",t.$options.fetch="list_community_resources",t}return(0,d.default)(CommunityResourcePage,e),CommunityResourcePage}(c.ModelPage);t.default=p},1222:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1039),o=_interopRequireDefault(i);t.default={name:"reuses-list",components:{Datatable:o.default},MASK:["id","title","created_at","last_modified","metrics","private","image_thumbnail"],data:function(){return{fields:[{key:"image_thumbnail",type:"thumbnail",width:30},{label:this._("Title"),key:"title",sort:"title",type:"deletable-text"},{label:this._("Creation"),key:"created_at",sort:"created",align:"left",type:"timeago",width:120},{label:this._("Modification"),key:"last_modified",sort:"last_modified",align:"left",type:"timeago",width:120},{label:this._("Datasets"),key:"metrics.datasets",sort:"datasets",align:"center",type:"metric",width:135},{label:this._("Followers"),key:"metrics.followers",sort:"followers",align:"center",type:"metric",width:95},{label:this._("Views"),key:"metrics.views",sort:"views",align:"center",type:"metric",width:95},{label:this._("Status"),align:"center",type:"visibility",width:95}]}},events:{"datatable:item:click":function(e){this.$go("/reuse/"+e.id+"/")}},props:{reuses:null,downloads:{type:Array,default:function(){return[]}},title:{type:String,default:function(){return this._("Reuses")}}}}},1228:function(e,t){e.exports=" <div> <datatable :title=title icon=recycle boxclass=reuses-widget :fields=fields :p=reuses :downloads=downloads :empty=\"_('No reuse')\"> </datatable> </div> "},1231:[1673,1222,1228],1235:function(e,t,n){!function(t,i){e.exports=i(function(){try{return n(17)}catch(e){}}())}(this,function(e){"use strict";function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}function getCjsExportFromNamespace(e){return e&&e.default||e}function buildGraph(){for(var e={},t=Object.keys(n),i=t.length,o=0;o<i;o++)e[t[o]]={distance:-1,parent:null};return e}function deriveBFS(e){var t=buildGraph(),i=[e];for(t[e].distance=0;i.length;)for(var o=i.pop(),a=Object.keys(n[o]),r=a.length,s=0;s<r;s++){var l=a[s],u=t[l];u.distance===-1&&(u.distance=t[o].distance+1,u.parent=o,i.unshift(l))}return t}function link(e,t){return function(n){return t(e(n))}}function wrapConversion(e,t){for(var i=[t[e].parent,e],o=n[t[e].parent][e],a=t[e].parent;t[a].parent;)i.unshift(t[a].parent),o=link(n[t[a].parent][a],o),a=t[a].parent;return o.conversion=i,o}function wrapRaw(e){var t=function(t){return void 0===t||null===t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function wrapRounded(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var i=n.length,o=0;o<i;o++)n[o]=Math.round(n[o]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}function getRgba(e){if(e){var t=/^#([a-fA-F0-9]{3,4})$/i,n=/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,i=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,a=/(\w+)/,r=[0,0,0],l=1,u=e.match(t),d="";if(u){u=u[1],d=u[3];for(var c=0;c<r.length;c++)r[c]=parseInt(u[c]+u[c],16);d&&(l=Math.round(parseInt(d+d,16)/255*100)/100)}else if(u=e.match(n)){d=u[2],u=u[1];for(var c=0;c<r.length;c++)r[c]=parseInt(u.slice(2*c,2*c+2),16);d&&(l=Math.round(parseInt(d,16)/255*100)/100)}else if(u=e.match(i)){for(var c=0;c<r.length;c++)r[c]=parseInt(u[c+1]);l=parseFloat(u[4])}else if(u=e.match(o)){for(var c=0;c<r.length;c++)r[c]=Math.round(2.55*parseFloat(u[c+1]));l=parseFloat(u[4])}else if(u=e.match(a)){if("transparent"==u[1])return[0,0,0,0];if(r=s[u[1]],!r)return}for(var c=0;c<r.length;c++)r[c]=scale(r[c],0,255);return l=l||0==l?scale(l,0,1):1,r[3]=l,r}}function getHsla(e){if(e){var t=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=e.match(t);if(n){var i=parseFloat(n[4]),o=scale(parseInt(n[1]),0,360),a=scale(parseFloat(n[2]),0,100),r=scale(parseFloat(n[3]),0,100),s=scale(isNaN(i)?1:i,0,1);return[o,a,r,s]}}}function getHwb(e){if(e){var t=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=e.match(t);if(n){var i=parseFloat(n[4]),o=scale(parseInt(n[1]),0,360),a=scale(parseFloat(n[2]),0,100),r=scale(parseFloat(n[3]),0,100),s=scale(isNaN(i)?1:i,0,1);return[o,a,r,s]}}}function getRgb(e){var t=getRgba(e);return t&&t.slice(0,3)}function getHsl(e){var t=getHsla(e);return t&&t.slice(0,3)}function getAlpha(e){var t=getRgba(e);return t?t[3]:(t=getHsla(e))?t[3]:(t=getHwb(e))?t[3]:void 0}function hexString(e,t){var t=void 0!==t&&3===e.length?t:e[3];return"#"+hexDouble(e[0])+hexDouble(e[1])+hexDouble(e[2])+(t>=0&&t<1?hexDouble(Math.round(255*t)):"")}function rgbString(e,t){return t<1||e[3]&&e[3]<1?rgbaString(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"}function rgbaString(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function percentString(e,t){if(t<1||e[3]&&e[3]<1)return percentaString(e,t);var n=Math.round(e[0]/255*100),i=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return"rgb("+n+"%, "+i+"%, "+o+"%)"}function percentaString(e,t){var n=Math.round(e[0]/255*100),i=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return"rgba("+n+"%, "+i+"%, "+o+"%, "+(t||e[3]||1)+")"}function hslString(e,t){return t<1||e[3]&&e[3]<1?hslaString(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"}function hslaString(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function hwbString(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"}function keyword(e){return u[e.slice(0,3)]}function scale(e,t,n){return Math.min(Math.max(t,e),n)}function hexDouble(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}function isValidKey(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function toFontString(e){return!e||f.isNullOrUndef(e.size)||f.isNullOrUndef(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function interpolate(e,t,n,i){var o,a,r,s,l,u,d,c,h,f=Object.keys(n);for(o=0,a=f.length;o<a;++o)if(r=f[o],u=n[r],t.hasOwnProperty(r)||(t[r]=u),s=t[r],s!==u&&"_"!==r[0]){if(e.hasOwnProperty(r)||(e[r]=s),l=e[r],d=typeof u,d===typeof l)if("string"===d){if(c=p(l),c.valid&&(h=p(u),h.valid)){t[r]=h.mix(c,i).rgbString();continue}}else if(O.isFinite(l)&&O.isFinite(u)){t[r]=l+(u-l)*i;continue}t[r]=u}}function listenArrayEvents(e,t){return e._chartjs?void e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),void Y.forEach(function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),i=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),o=i.apply(this,t);return O.each(e._chartjs.listeners,function(e){"function"==typeof e[n]&&e[n].apply(e,t)}),o}})}))}function unlistenArrayEvents(e,t){var n=e._chartjs;if(n){var i=n.listeners,o=i.indexOf(t);o!==-1&&i.splice(o,1),i.length>0||(Y.forEach(function(t){delete e[t]}),delete e._chartjs)}}function clipArc(e,t){var n=t.startAngle,i=t.endAngle,o=t.pixelMargin,a=o/t.outerRadius,r=t.x,s=t.y;e.beginPath(),e.arc(r,s,t.outerRadius,n-a,i+a),t.innerRadius>o?(a=o/t.innerRadius,e.arc(r,s,t.innerRadius-o,i+a,n-a,!0)):e.arc(r,s,o,i+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}function drawFullCircleBorders(e,t,n,i){var o,a=n.endAngle;for(i&&(n.endAngle=n.startAngle+Z,clipArc(e,n),n.endAngle=a,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=Z,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+Z,n.startAngle,!0),o=0;o<n.fullCircles;++o)e.stroke();for(e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.startAngle+Z),o=0;o<n.fullCircles;++o)e.stroke()}function drawBorder(e,t,n){var i="inner"===t.borderAlign;i?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),n.fullCircles&&drawFullCircleBorders(e,t,n,i),i&&clipArc(e,n),e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.endAngle),e.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),e.closePath(),e.stroke()}function xRange(e){var t=this._view;return!!t&&Math.abs(e-t.x)<t.radius+t.hitRadius}function yRange(e){var t=this._view;return!!t&&Math.abs(e-t.y)<t.radius+t.hitRadius}function isVertical(e){return e&&void 0!==e.width}function getBarBounds(e){var t,n,i,o,a;return isVertical(e)?(a=e.width/2,t=e.x-a,n=e.x+a,i=Math.min(e.y,e.base),o=Math.max(e.y,e.base)):(a=e.height/2,t=Math.min(e.x,e.base),n=Math.max(e.x,e.base),i=e.y-a,o=e.y+a),{left:t,top:i,right:n,bottom:o}}function swap(e,t,n){return e===t?n:e===n?t:e}function parseBorderSkipped(e){var t=e.borderSkipped,n={};return t?(e.horizontal?e.base>e.x&&(t=swap(t,"left","right")):e.base<e.y&&(t=swap(t,"bottom","top")),n[t]=!0,n):n}function parseBorderWidth(e,t,n){var i,o,a,r,s=e.borderWidth,l=parseBorderSkipped(e);return O.isObject(s)?(i=+s.top||0,o=+s.right||0,a=+s.bottom||0,r=+s.left||0):i=o=a=r=+s||0,{t:l.top||i<0?0:i>n?n:i,r:l.right||o<0?0:o>t?t:o,b:l.bottom||a<0?0:a>n?n:a,l:l.left||r<0?0:r>t?t:r}}function boundingRects(e){var t=getBarBounds(e),n=t.right-t.left,i=t.bottom-t.top,o=parseBorderWidth(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:i-o.t-o.b}}}function inRange(e,t,n){var i=null===t,o=null===n,a=!(!e||i&&o)&&getBarBounds(e);return a&&(i||t>=a.left&&t<=a.right)&&(o||n>=a.top&&n<=a.bottom)}function computeMinSampleSize(e,t){var n,i,o,a,r=e._length;for(o=1,a=t.length;o<a;++o)r=Math.min(r,Math.abs(t[o]-t[o-1]));for(o=0,a=e.getTicks().length;o<a;++o)i=e.getPixelForTick(o),r=o>0?Math.min(r,Math.abs(i-n)):r,n=i;return r}function computeFitCategoryTraits(e,t,n){var i,o,a=n.barThickness,r=t.stackCount,s=t.pixels[e],l=O.isNullOrUndef(a)?computeMinSampleSize(t.scale,t.pixels):-1;return O.isNullOrUndef(a)?(i=l*n.categoryPercentage,o=n.barPercentage):(i=a*r,o=1),{chunk:i/r,ratio:o,start:s-i/2}}function computeFlexCategoryTraits(e,t,n){var i,o,a=t.pixels,r=a[e],s=e>0?a[e-1]:null,l=e<a.length-1?a[e+1]:null,u=n.categoryPercentage;return null===s&&(s=r-(null===l?t.end-t.start:l-r)),null===l&&(l=r+r-s),i=r-(r-Math.min(s,l))/2*u,o=Math.abs(l-s)/2*u,{chunk:o/t.stackCount,ratio:n.barPercentage,start:i}}function scaleClip(e,t){var n=e&&e.options.ticks||{},i=n.reverse,o=void 0===n.min?t:0,a=void 0===n.max?t:0;return{start:i?a:o,end:i?o:a}}function defaultClip(e,t,n){var i=n/2,o=scaleClip(e,i),a=scaleClip(t,i);return{top:a.end,right:o.end,bottom:a.start,left:o.start}}function toClip(e){
8
8
  var t,n,i,o;return O.isObject(e)?(t=e.top,n=e.right,i=e.bottom,o=e.left):t=n=i=o=e,{top:t,right:n,bottom:i,left:o}}function getRelativePosition(e,t){return e.native?{x:e.x,y:e.y}:O.getRelativePosition(e,t)}function parseVisibleItems(e,t){var n,i,o,a,r,s,l=e._getSortedVisibleDatasetMetas();for(i=0,a=l.length;i<a;++i)for(n=l[i].data,o=0,r=n.length;o<r;++o)s=n[o],s._view.skip||t(s)}function getIntersectItems(e,t){var n=[];return parseVisibleItems(e,function(e){e.inRange(t.x,t.y)&&n.push(e)}),n}function getNearestItems(e,t,n,i){var o=Number.POSITIVE_INFINITY,a=[];return parseVisibleItems(e,function(e){if(!n||e.inRange(t.x,t.y)){var r=e.getCenterPoint(),s=i(t,r);s<o?(a=[e],o=s):s===o&&a.push(e)}}),a}function getDistanceMetricForAxis(e){var t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(e,i){var o=t?Math.abs(e.x-i.x):0,a=n?Math.abs(e.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function indexMode(e,t,n){var i=getRelativePosition(t,e);n.axis=n.axis||"x";var o=getDistanceMetricForAxis(n.axis),a=n.intersect?getIntersectItems(e,i):getNearestItems(e,i,!1,o),r=[];return a.length?(e._getSortedVisibleDatasetMetas().forEach(function(e){var t=e.data[a[0]._index];t&&!t._view.skip&&r.push(t)}),r):[]}function filterByPosition(e,t){return O.where(e,function(e){return e.pos===t})}function sortByWeight(e,t){return e.sort(function(e,n){var i=t?n:e,o=t?e:n;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function wrapBoxes(e){var t,n,i,o=[];for(t=0,n=(e||[]).length;t<n;++t)i=e[t],o.push({index:t,box:i,pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return o}function setLayoutDims(e,t){var n,i,o;for(n=0,i=e.length;n<i;++n)o=e[n],o.width=o.horizontal?o.box.fullWidth&&t.availableWidth:t.vBoxMaxWidth,o.height=o.horizontal&&t.hBoxMaxHeight}function buildLayoutBoxes(e){var t=wrapBoxes(e),n=sortByWeight(filterByPosition(t,"left"),!0),i=sortByWeight(filterByPosition(t,"right")),o=sortByWeight(filterByPosition(t,"top"),!0),a=sortByWeight(filterByPosition(t,"bottom"));return{leftAndTop:n.concat(o),rightAndBottom:i.concat(a),chartArea:filterByPosition(t,"chartArea"),vertical:n.concat(i),horizontal:o.concat(a)}}function getCombinedMax(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function updateDims(e,t,n){var i,o,a=n.box,r=e.maxPadding;if(n.size&&(e[n.pos]-=n.size),n.size=n.horizontal?a.height:a.width,e[n.pos]+=n.size,a.getPadding){var s=a.getPadding();r.top=Math.max(r.top,s.top),r.left=Math.max(r.left,s.left),r.bottom=Math.max(r.bottom,s.bottom),r.right=Math.max(r.right,s.right)}if(i=t.outerWidth-getCombinedMax(r,e,"left","right"),o=t.outerHeight-getCombinedMax(r,e,"top","bottom"),i!==e.w||o!==e.h){e.w=i,e.h=o;var l=n.horizontal?[i,e.w]:[o,e.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function handleMaxPadding(e){function updatePos(n){var i=Math.max(t[n]-e[n],0);return e[n]+=i,i}var t=e.maxPadding;e.y+=updatePos("top"),e.x+=updatePos("left"),updatePos("right"),updatePos("bottom")}function getMargins(e,t){function marginForPositions(e){var i={left:0,top:0,right:0,bottom:0};return e.forEach(function(e){i[e]=Math.max(t[e],n[e])}),i}var n=t.maxPadding;return marginForPositions(e?["left","right"]:["top","bottom"])}function fitBoxes(e,t,n){var i,o,a,r,s,l,u=[];for(i=0,o=e.length;i<o;++i)a=e[i],r=a.box,r.update(a.width||t.w,a.height||t.h,getMargins(a.horizontal,t)),updateDims(t,n,a)&&(l=!0,u.length&&(s=!0)),r.fullWidth||u.push(a);return s?fitBoxes(u,t,n)||l:l}function placeBoxes(e,t,n){var i,o,a,r,s=n.padding,l=t.x,u=t.y;for(i=0,o=e.length;i<o;++i)a=e[i],r=a.box,a.horizontal?(r.left=r.fullWidth?s.left:t.left,r.right=r.fullWidth?n.outerWidth-s.right:t.left+t.w,r.top=u,r.bottom=u+r.height,r.width=r.right-r.left,u=r.bottom):(r.left=l,r.right=l+r.width,r.top=t.top,r.bottom=t.top+t.h,r.height=r.bottom-r.top,l=r.right);t.x=l,t.y=u}function readUsedSize(e,t){var n=O.getStyle(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}function initCanvas(e,t){var n=e.style,i=e.getAttribute("height"),o=e.getAttribute("width");if(e[je]={initial:{height:i,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===o||""===o){var a=readUsedSize(e,"width");void 0!==a&&(e.width=a)}if(null===i||""===i)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var r=readUsedSize(e,"height");void 0!==a&&(e.height=r)}return e}function addListener(e,t,n){e.addEventListener(t,n,Ke)}function removeListener(e,t,n){e.removeEventListener(t,n,Ke)}function createEvent(e,t,n,i,o){return{type:e,chart:t,native:o||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function fromNativeEvent(e,t){var n=Ye[e.type]||e.type,i=O.getRelativePosition(e,t);return createEvent(n,t,i.x,i.y,e)}function throttled(e,t){var n=!1,i=[];return function(){i=Array.prototype.slice.call(arguments),t=t||this,n||(n=!0,O.requestAnimFrame.call(window,function(){n=!1,e.apply(t,i)}))}}function createDiv(e){var t=document.createElement("div");return t.className=e||"",t}function createResizer(e){var t=1e6,n=createDiv(We),i=createDiv(We+"-expand"),o=createDiv(We+"-shrink");i.appendChild(createDiv()),o.appendChild(createDiv()),n.appendChild(i),n.appendChild(o),n._reset=function(){i.scrollLeft=t,i.scrollTop=t,o.scrollLeft=t,o.scrollTop=t};var a=function(){n._reset(),e()};return addListener(i,"scroll",a.bind(i,"expand")),addListener(o,"scroll",a.bind(o,"shrink")),n}function watchForRender(e,t){var n=e[je]||(e[je]={}),i=n.renderProxy=function(e){e.animationName===Xe&&t()};O.each($e,function(t){addListener(e,t,i)}),n.reflow=!!e.offsetParent,e.classList.add(Ge)}function unwatchForRender(e){var t=e[je]||{},n=t.renderProxy;n&&(O.each($e,function(t){removeListener(e,t,n)}),delete t.renderProxy),e.classList.remove(Ge)}function addResizeListener(e,t,n){var i=e[je]||(e[je]={}),o=i.resizer=createResizer(throttled(function(){if(i.resizer){var o=n.options.maintainAspectRatio&&e.parentNode,a=o?o.clientWidth:0;t(createEvent("resize",n)),o&&o.clientWidth<a&&n.canvas&&t(createEvent("resize",n))}}));watchForRender(e,function(){if(i.resizer){var t=e.parentNode;t&&t!==o.parentNode&&t.insertBefore(o,t.firstChild),o._reset()}})}function removeResizeListener(e){var t=e[je]||{},n=t.resizer;delete t.resizer,unwatchForRender(e),n&&n.parentNode&&n.parentNode.removeChild(n)}function injectCSS(e,t){var n=e[je]||(e[je]={});if(!n.containsStyles){n.containsStyles=!0,t="/* Chart.js */\n"+t;var i=document.createElement("style");i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(t)),e.appendChild(i)}}function pushOrConcat(e,t){return t&&(O.isArray(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function splitNewlines(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function createTooltipItem(e){var t=e._xScale,n=e._yScale||e._scale,i=e._index,o=e._datasetIndex,a=e._chart.getDatasetMeta(o).controller,r=a._getIndexScale(),s=a._getValueScale();return{xLabel:t?t.getLabelForIndex(i,o):"",yLabel:n?n.getLabelForIndex(i,o):"",label:r?""+r.getLabelForIndex(i,o):"",value:s?""+s.getLabelForIndex(i,o):"",index:i,datasetIndex:o,x:e._model.x,y:e._model.y}}function getBaseModel(e){var t=A.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:it(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:it(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:it(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:it(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:it(e.titleFontStyle,t.defaultFontStyle),titleFontSize:it(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:it(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:it(e.footerFontStyle,t.defaultFontStyle),footerFontSize:it(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function getTooltipSize(e,t){var n=e._chart.ctx,i=2*t.yPadding,o=0,a=t.body,r=a.reduce(function(e,t){return e+t.before.length+t.lines.length+t.after.length},0);r+=t.beforeBody.length+t.afterBody.length;var s=t.title.length,l=t.footer.length,u=t.titleFontSize,d=t.bodyFontSize,c=t.footerFontSize;i+=s*u,i+=s?(s-1)*t.titleSpacing:0,i+=s?t.titleMarginBottom:0,i+=r*d,i+=r?(r-1)*t.bodySpacing:0,i+=l?t.footerMarginTop:0,i+=l*c,i+=l?(l-1)*t.footerSpacing:0;var p=0,h=function(e){o=Math.max(o,n.measureText(e).width+p)};return n.font=O.fontString(u,t._titleFontStyle,t._titleFontFamily),O.each(t.title,h),n.font=O.fontString(d,t._bodyFontStyle,t._bodyFontFamily),O.each(t.beforeBody.concat(t.afterBody),h),p=t.displayColors?d+2:0,O.each(a,function(e){O.each(e.before,h),O.each(e.lines,h),O.each(e.after,h)}),p=0,n.font=O.fontString(c,t._footerFontStyle,t._footerFontFamily),O.each(t.footer,h),o+=2*t.xPadding,{width:o,height:i}}function determineAlignment(e,t){var n=e._model,i=e._chart,o=e._chart.chartArea,a="center",r="center";n.y<t.height?r="top":n.y>i.height-t.height&&(r="bottom");var s,l,u,d,c,p=(o.left+o.right)/2,h=(o.top+o.bottom)/2;"center"===r?(s=function(e){return e<=p},l=function(e){return e>p}):(s=function(e){return e<=t.width/2},l=function(e){return e>=i.width-t.width/2}),u=function(e){return e+t.width+n.caretSize+n.caretPadding>i.width},d=function(e){return e-t.width-n.caretSize-n.caretPadding<0},c=function(e){return e<=h?"top":"bottom"},s(n.x)?(a="left",u(n.x)&&(a="center",r=c(n.y))):l(n.x)&&(a="right",d(n.x)&&(a="center",r=c(n.y)));var f=e._options;return{xAlign:f.xAlign?f.xAlign:a,yAlign:f.yAlign?f.yAlign:r}}function getBackgroundPoint(e,t,n,i){var o=e.x,a=e.y,r=e.caretSize,s=e.caretPadding,l=e.cornerRadius,u=n.xAlign,d=n.yAlign,c=r+s,p=l+s;return"right"===u?o-=t.width:"center"===u&&(o-=t.width/2,o+t.width>i.width&&(o=i.width-t.width),o<0&&(o=0)),"top"===d?a+=c:a-="bottom"===d?t.height+c:t.height/2,"center"===d?"left"===u?o+=c:"right"===u&&(o-=c):"left"===u?o-=p:"right"===u&&(o+=p),{x:o,y:a}}function getAlignedX(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function getBeforeAfterBodyLines(e){return pushOrConcat([],splitNewlines(e))}function mergeScaleConfig(){return O.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,i){if("xAxes"===e||"yAxes"===e){var o,a,r,s=n[e].length;for(t[e]||(t[e]=[]),o=0;o<s;++o)r=n[e][o],a=ut(r.type,"xAxes"===e?"category":"linear"),o>=t[e].length&&t[e].push({}),!t[e][o].type||r.type&&r.type!==t[e][o].type?O.merge(t[e][o],[nt.getScaleDefaults(a),r]):O.merge(t[e][o],r)}else O._merger(e,t,n,i)}})}function mergeConfig(){return O.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,i){var o=t[e]||Object.create(null),a=n[e];"scales"===e?t[e]=mergeScaleConfig(o,a):"scale"===e?t[e]=O.merge(o,[nt.getScaleDefaults(a.type),a]):O._merger(e,t,n,i)}})}function initConfig(e){e=e||Object.create(null);var t=e.data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=mergeConfig(A.global,A[e.type],e.options||{}),e}function updateConfig(e){var t=e.options;O.each(e.scales,function(t){Le.removeBox(e,t)}),t=mergeConfig(A.global,A[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function nextAvailableScaleId(e,t,n){var i,o=function(e){return e.id===i};do i=t+n++;while(O.findIndex(e,o)>=0);return i}function positionIsHorizontal(e){return"top"===e||"bottom"===e}function compare2Level(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function abstract(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function DateAdapter(e){this.options=e||{}}function sample(e,t){for(var n=[],i=e.length/t,o=0,a=e.length;o<a;o+=i)n.push(e[Math.floor(o)]);return n}function getPixelForGridLine(e,t,n){var i,o=e.getTicks().length,a=Math.min(t,o-1),r=e.getPixelForTick(a),s=e._startPixel,l=e._endPixel,u=1e-6;if(!(n&&(i=1===o?Math.max(r-s,l-r):0===t?(e.getPixelForTick(1)-r)/2:(r-e.getPixelForTick(a-1))/2,r+=a<t?i:-i,r<s-u||r>l+u)))return r}function garbageCollect(e,t){O.each(e,function(e){var n,i=e.gc,o=i.length/2;if(o>t){for(n=0;n<o;++n)delete e.data[i[n]];i.splice(0,o)}})}function computeLabelSizes(e,t,n,i){function valueAt(e){return{width:b[e]||0,height:x[e]||0,offset:_[e]||0}}var o,a,r,s,l,u,d,c,p,h,f,g,m,v=n.length,b=[],x=[],_=[],q=0,y=0;for(o=0;o<v;++o){if(s=n[o].label,l=n[o].major?t.major:t.minor,e.font=u=l.string,d=i[u]=i[u]||{data:{},gc:[]},c=l.lineHeight,p=h=0,vt(s)||mt(s)){if(mt(s))for(a=0,r=s.length;a<r;++a)f=s[a],vt(f)||mt(f)||(p=O.measureText(e,d.data,d.gc,p,f),h+=c)}else p=O.measureText(e,d.data,d.gc,p,s),h=c;b.push(p),x.push(h),_.push(c/2),q=Math.max(p,q),y=Math.max(h,y)}return garbageCollect(i,v),g=b.indexOf(q),m=x.indexOf(y),{first:valueAt(0),last:valueAt(v-1),widest:valueAt(g),highest:valueAt(m)}}function getTickMarkLength(e){return e.drawTicks?e.tickMarkLength:0}function getScaleLabelHeight(e){var t,n;return e.display?(t=O.options._parseFont(e),n=O.options.toPadding(e.padding),t.lineHeight+n.height):0}function parseFontOptions(e,t){return O.extend(O.options._parseFont({fontFamily:bt(t.fontFamily,e.fontFamily),fontSize:bt(t.fontSize,e.fontSize),fontStyle:bt(t.fontStyle,e.fontStyle),lineHeight:bt(t.lineHeight,e.lineHeight)}),{color:O.options.resolve([t.fontColor,e.fontColor,A.global.defaultFontColor])})}function parseTickFontOptions(e){var t=parseFontOptions(e,e.minor),n=e.major.enabled?parseFontOptions(e,e.major):t;return{minor:t,major:n}}function nonSkipped(e){var t,n,i,o=[];for(n=0,i=e.length;n<i;++n)t=e[n],"undefined"!=typeof t._index&&o.push(t);return o}function getEvenSpacing(e){var t,n,i=e.length;if(i<2)return!1;for(n=e[0],t=1;t<i;++t)if(e[t]-e[t-1]!==n)return!1;return n}function calculateSpacing(e,t,n,i){var o,a,r,s,l=getEvenSpacing(e),u=(t.length-1)/i;if(!l)return Math.max(u,1);for(o=O.math._factorize(l),r=0,s=o.length-1;r<s;r++)if(a=o[r],a>u)return a;return Math.max(u,1)}function getMajorIndices(e){var t,n,i=[];for(t=0,n=e.length;t<n;t++)e[t].major&&i.push(t);return i}function skipMajors(e,t,n){var i,o,a=0,r=t[0];for(n=Math.ceil(n),i=0;i<e.length;i++)o=e[i],i===r?(o._index=i,a++,r=t[a*n]):delete o.label}function skip(e,t,n,i){var o,a,r,s,l=bt(n,0),u=Math.min(bt(i,e.length),e.length),d=0;for(t=Math.ceil(t),i&&(o=i-n,t=o/Math.floor(o/t)),s=l;s<0;)d++,s=Math.round(l+d*t);for(a=Math.max(l,0);a<u;a++)r=e[a],a===s?(r._index=a,d++,s=Math.round(l+d*t)):delete r.label}function generateTicks(e,t){var n,i,o,a,r=[],s=1e-14,l=e.stepSize,u=l||1,d=e.maxTicks-1,c=e.min,p=e.max,h=e.precision,f=t.min,g=t.max,m=O.niceNum((g-f)/d/u)*u;if(m<s&&kt(c)&&kt(p))return[f,g];a=Math.ceil(g/m)-Math.floor(f/m),a>d&&(m=O.niceNum(a*m/d/u)*u),l||kt(h)?n=Math.pow(10,O._decimalPlaces(m)):(n=Math.pow(10,h),m=Math.ceil(m*n)/n),i=Math.floor(f/m)*m,o=Math.ceil(g/m)*m,l&&(!kt(c)&&O.almostWhole(c/m,m/1e3)&&(i=c),!kt(p)&&O.almostWhole(p/m,m/1e3)&&(o=p)),a=(o-i)/m,a=O.almostEquals(a,Math.round(a),m/1e3)?Math.round(a):Math.ceil(a),i=Math.round(i*n)/n,o=Math.round(o*n)/n,r.push(kt(c)?i:c);for(var v=1;v<a;++v)r.push(Math.round((i+v*m)*n)/n);return r.push(kt(p)?o:p),r}function getOrCreateStack(e,t,n){var i=[n.type,void 0===t&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===e[i]&&(e[i]={pos:[],neg:[]}),e[i]}function stackData(e,t,n,i){var o,a,r=e.options,s=r.stacked,l=getOrCreateStack(t,s,n),u=l.pos,d=l.neg,c=i.length;for(o=0;o<c;++o)a=e._parseValue(i[o]),isNaN(a.min)||isNaN(a.max)||n.data[o].hidden||(u[o]=u[o]||0,d[o]=d[o]||0,r.relativePoints?u[o]=100:a.min<0||a.max<0?d[o]+=a.min:u[o]+=a.max)}function updateMinMax(e,t,n){var i,o,a=n.length;for(i=0;i<a;++i)o=e._parseValue(n[i]),isNaN(o.min)||isNaN(o.max)||t.data[i].hidden||(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}function generateTicks$1(e,t){var n,i,o=[],a=Rt(e.min,Math.pow(10,Math.floor(Et(t.min)))),r=Math.floor(Et(t.max)),s=Math.ceil(t.max/Math.pow(10,r));0===a?(n=Math.floor(Et(t.minNotZero)),i=Math.floor(t.minNotZero/Math.pow(10,n)),o.push(a),a=i*Math.pow(10,n)):(n=Math.floor(Et(a)),i=Math.floor(a/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do o.push(a),++i,10===i&&(i=1,++n,l=n>=0?1:l),a=Math.round(i*Math.pow(10,n)*l)/l;while(n<r||n===r&&i<s);var u=Rt(e.max,a);return o.push(u),o}function nonNegativeOrDefault(e,t){return O.isFinite(e)&&e>=0?e:t}function getTickBackdropHeight(e){var t=e.ticks;return t.display&&e.display?zt(t.fontSize,A.global.defaultFontSize)+2*t.backdropPaddingY:0}function measureLabelSize(e,t,n){return O.isArray(n)?{w:O.longestText(e,e.font,n),h:n.length*t}:{w:e.measureText(n).width,h:t}}function determineLimits(e,t,n,i,o){return e===i||e===o?{start:t-n/2,end:t+n/2}:e<i||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function fitWithPointLabels(e){var t,n,i,o=O.options._parseFont(e.options.pointLabels),a={l:0,r:e.width,t:0,b:e.height-e.paddingTop},r={};e.ctx.font=o.string,e._pointLabelSizes=[];var s=e.chart.data.labels.length;for(t=0;t<s;t++){i=e.getPointPosition(t,e.drawingArea+5),n=measureLabelSize(e.ctx,o.lineHeight,e.pointLabels[t]),e._pointLabelSizes[t]=n;var l=e.getIndexAngle(t),u=O.toDegrees(l)%360,d=determineLimits(u,i.x,n.w,0,180),c=determineLimits(u,i.y,n.h,90,270);d.start<a.l&&(a.l=d.start,r.l=l),d.end>a.r&&(a.r=d.end,r.r=l),c.start<a.t&&(a.t=c.start,r.t=l),c.end>a.b&&(a.b=c.end,r.b=l)}e.setReductions(e.drawingArea,a,r)}function getTextAlignForAngle(e){return 0===e||180===e?"center":e<180?"left":"right"}function fillText(e,t,n,i){var o,a,r=n.y+i/2;if(O.isArray(t))for(o=0,a=t.length;o<a;++o)e.fillText(t[o],n.x,r),r+=i;else e.fillText(t,n.x,r)}function adjustPointPositionForLabelHeight(e,t,n){90===e||270===e?n.y-=t.h/2:(e>270||e<90)&&(n.y-=t.h)}function drawPointLabels(e){var t=e.ctx,n=e.options,i=n.pointLabels,o=getTickBackdropHeight(n),a=e.getDistanceFromCenterForValue(n.ticks.reverse?e.min:e.max),r=O.options._parseFont(i);t.save(),t.font=r.string,t.textBaseline="middle";for(var s=e.chart.data.labels.length-1;s>=0;s--){var l=0===s?o/2:0,u=e.getPointPosition(s,a+l+5),d=Nt(i.fontColor,s,A.global.defaultFontColor);t.fillStyle=d;var c=e.getIndexAngle(s),p=O.toDegrees(c);t.textAlign=getTextAlignForAngle(p),adjustPointPositionForLabelHeight(p,e._pointLabelSizes[s],u),fillText(t,e.pointLabels[s],u,r.lineHeight)}t.restore()}function drawRadiusLine(e,t,n,i){var o,a=e.ctx,r=t.circular,s=e.chart.data.labels.length,l=Nt(t.color,i-1),u=Nt(t.lineWidth,i-1);if((r||s)&&l&&u){if(a.save(),a.strokeStyle=l,a.lineWidth=u,a.setLineDash&&(a.setLineDash(t.borderDash||[]),a.lineDashOffset=t.borderDashOffset||0),a.beginPath(),r)a.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{o=e.getPointPosition(0,n),a.moveTo(o.x,o.y);for(var d=1;d<s;d++)o=e.getPointPosition(d,n),a.lineTo(o.x,o.y)}a.closePath(),a.stroke(),a.restore()}}function numberOrZero(e){return O.isNumber(e)?e:0}function sorter(e,t){return e-t}function arrayUnique(e){var t,n,i,o={},a=[];for(t=0,n=e.length;t<n;++t)i=e[t],o[i]||(o[i]=!0,a.push(i));return a}function getMin(e){return O.valueOrDefault(e.time.min,e.ticks.min)}function getMax(e){return O.valueOrDefault(e.time.max,e.ticks.max)}function buildLookupTable(e,t,n,i){if("linear"===i||!e.length)return[{time:t,pos:0},{time:n,pos:1}];var o,a,r,s,l,u=[],d=[t];for(o=0,a=e.length;o<a;++o)s=e[o],s>t&&s<n&&d.push(s);for(d.push(n),o=0,a=d.length;o<a;++o)l=d[o+1],r=d[o-1],s=d[o],void 0!==r&&void 0!==l&&Math.round((l+r)/2)===s||u.push({time:s,pos:o/(a-1)});return u}function lookup(e,t,n){for(var i,o,a,r=0,s=e.length-1;r>=0&&r<=s;){if(i=r+s>>1,o=e[i-1]||null,a=e[i],!o)return{lo:null,hi:a};if(a[t]<n)r=i+1;else{if(!(o[t]>n))return{lo:o,hi:a};s=i-1}}return{lo:a,hi:null}}function interpolate$1(e,t,n,i){var o=lookup(e,t,n),a=o.lo?o.hi?o.lo:e[e.length-2]:e[0],r=o.lo?o.hi?o.hi:e[e.length-1]:e[1],s=r[t]-a[t],l=s?(n-a[t])/s:0,u=(r[i]-a[i])*l;return a[i]+u}function toTimestamp(e,t){var n=e._adapter,i=e.options.time,o=i.parser,a=o||i.format,r=t;return"function"==typeof o&&(r=o(r)),O.isFinite(r)||(r="string"==typeof a?n.parse(r,a):n.parse(r)),null!==r?+r:(o||"function"!=typeof a||(r=a(t),O.isFinite(r)||(r=n.parse(r))),r)}function parse(e,t){if(O.isNullOrUndef(t))return null;var n=e.options.time,i=toTimestamp(e,e.getRightValue(t));return null===i?i:(n.round&&(i=+e._adapter.startOf(i,n.round)),i)}function determineUnitForAutoTicks(e,t,n,i){var o,a,r,s=Kt.length;for(o=Kt.indexOf(e);o<s-1;++o)if(a=Jt[Kt[o]],r=a.steps?a.steps:Yt,a.common&&Math.ceil((n-t)/(r*a.size))<=i)return Kt[o];return Kt[s-1]}function determineUnitForFormatting(e,t,n,i,o){var a,r;for(a=Kt.length-1;a>=Kt.indexOf(n);a--)if(r=Kt[a],Jt[r].common&&e._adapter.diff(o,i,r)>=t-1)return r;return Kt[n?Kt.indexOf(n):0]}function determineMajorUnit(e){for(var t=Kt.indexOf(e)+1,n=Kt.length;t<n;++t)if(Jt[Kt[t]].common)return Kt[t]}function generate(e,t,n,i){var o,a=e._adapter,r=e.options,s=r.time,l=s.unit||determineUnitForAutoTicks(s.minUnit,t,n,i),u=Gt([s.stepSize,s.unitStepSize,1]),d="week"===l&&s.isoWeekday,c=t,p=[];if(d&&(c=+a.startOf(c,"isoWeek",d)),c=+a.startOf(c,d?"day":l),a.diff(n,t,l)>1e5*u)throw t+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(o=c;o<n;o=+a.add(o,u,l))p.push(o);return o!==n&&"ticks"!==r.bounds||p.push(o),p}function computeOffsets(e,t,n,i,o){var a,r,s=0,l=0;return o.offset&&t.length&&(a=interpolate$1(e,"time",t[0],"pos"),s=1===t.length?1-a:(interpolate$1(e,"time",t[1],"pos")-a)/2,r=interpolate$1(e,"time",t[t.length-1],"pos"),l=1===t.length?r:(r-interpolate$1(e,"time",t[t.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}function setMajorTicks(e,t,n,i){var o,a,r=e._adapter,s=+r.startOf(t[0].value,i),l=t[t.length-1].value;for(o=s;o<=l;o=+r.add(o,1,i))a=n[o],a>=0&&(t[a].major=!0);return t}function ticksFromTimestamps(e,t,n){var i,o,a=[],r={},s=t.length;for(i=0;i<s;++i)o=t[i],r[o]=i,a.push({value:o,major:!1});return 0!==s&&n?setMajorTicks(e,a,r,n):a}function decodeFill(e,t,n){var i,o=e._model||{},a=o.fill;if(void 0===a&&(a=!!o.backgroundColor),a===!1||null===a)return!1;if(a===!0)return"origin";if(i=parseFloat(a,10),isFinite(i)&&Math.floor(i)===i)return"-"!==a[0]&&"+"!==a[0]||(i=t+i),!(i===t||i<0||i>=n)&&i;switch(a){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return a;default:return!1}}function computeLinearBoundary(e){var t,n=e.el._model||{},i=e.el._scale||{},o=e.fill,a=null;if(isFinite(o))return null;if("start"===o?a=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===o?a=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?a=n.scaleZero:i.getBasePixel&&(a=i.getBasePixel()),void 0!==a&&null!==a){if(void 0!==a.x&&void 0!==a.y)return a;if(O.isFinite(a))return t=i.isHorizontal(),{x:t?a:null,y:t?null:a}}return null}function computeCircularBoundary(e){var t,n,i,o,a,r=e.el._scale,s=r.options,l=r.chart.data.labels.length,u=e.fill,d=[];if(!l)return null;for(t=s.ticks.reverse?r.max:r.min,n=s.ticks.reverse?r.min:r.max,i=r.getPointPositionForValue(0,t),o=0;o<l;++o)a="start"===u||"end"===u?r.getPointPositionForValue(o,"start"===u?t:n):r.getBasePosition(o),s.gridLines.circular&&(a.cx=i.x,a.cy=i.y,a.angle=r.getIndexAngle(o)-Math.PI/2),d.push(a);return d}function computeBoundary(e){var t=e.el._scale||{};return t.getPointPositionForValue?computeCircularBoundary(e):computeLinearBoundary(e)}function resolveTarget(e,t,n){var i,o=e[t],a=o.fill,r=[t];if(!n)return a;for(;a!==!1&&r.indexOf(a)===-1;){if(!isFinite(a))return a;if(i=e[a],!i)return!1;if(i.visible)return a;r.push(a),a=i.fill}return!1}function createMapper(e){var t=e.fill,n="dataset";return t===!1?null:(isFinite(t)||(n="boundary"),on[n](e))}function isDrawable(e){return e&&!e.skip}function drawArea(e,t,n,i,o){var a,r,s,l;if(i&&o){for(e.moveTo(t[0].x,t[0].y),a=1;a<i;++a)O.canvas.lineTo(e,t[a-1],t[a]);if(void 0===n[0].angle)for(e.lineTo(n[o-1].x,n[o-1].y),a=o-1;a>0;--a)O.canvas.lineTo(e,n[a],n[a-1],!0);else for(r=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-r,2)+Math.pow(n[0].y-s,2)),a=o-1;a>0;--a)e.arc(r,s,l,n[a].angle,n[a-1].angle,!0)}}function doFill(e,t,n,i,o,a){var r,s,l,u,d,c,p,h,f=t.length,g=i.spanGaps,m=[],v=[],b=0,x=0;for(e.beginPath(),r=0,s=f;r<s;++r)l=r%f,u=t[l]._view,d=n(u,l,i),c=isDrawable(u),p=isDrawable(d),a&&void 0===h&&c&&(h=r+1,s=f+h),c&&p?(b=m.push(u),x=v.push(d)):b&&x&&(g?(c&&m.push(u),p&&v.push(d)):(drawArea(e,m,v,b,x),b=x=0,m=[],v=[]));drawArea(e,m,v,b,x),e.closePath(),e.fillStyle=o,e.fill()}function getBoxWidth(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}function createNewLegendAndAttach(e,t){var n=new un({ctx:e.ctx,options:t,chart:e});Le.configure(e,n,t),Le.addBox(e,n),e.legend=n}function createNewTitleBlockAndAttach(e,t){var n=new pn({ctx:e.ctx,options:t,chart:e});Le.configure(e,n,t),Le.addBox(e,n),e.titleBlock=n}e=e&&e.hasOwnProperty("default")?e.default:e;var t={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=createCommonjsModule(function(e){function comparativeDistance(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}var n={};for(var i in t)t.hasOwnProperty(i)&&(n[t[i]]=i);var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in o)if(o.hasOwnProperty(a)){if(!("channels"in o[a]))throw new Error("missing channels property: "+a);if(!("labels"in o[a]))throw new Error("missing channel labels property: "+a);if(o[a].labels.length!==o[a].channels)throw new Error("channel and label counts mismatch: "+a);var r=o[a].channels,s=o[a].labels;delete o[a].channels,delete o[a].labels,Object.defineProperty(o[a],"channels",{value:r}),Object.defineProperty(o[a],"labels",{value:s})}o.rgb.hsl=function(e){var t,n,i,o=e[0]/255,a=e[1]/255,r=e[2]/255,s=Math.min(o,a,r),l=Math.max(o,a,r),u=l-s;return l===s?t=0:o===l?t=(a-r)/u:a===l?t=2+(r-o)/u:r===l&&(t=4+(o-a)/u),t=Math.min(60*t,360),t<0&&(t+=360),i=(s+l)/2,n=l===s?0:i<=.5?u/(l+s):u/(2-l-s),[t,100*n,100*i]},o.rgb.hsv=function(e){var t,n,i,o,a,r=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(r,s,l),d=u-Math.min(r,s,l),c=function(e){return(u-e)/6/d+.5};return 0===d?o=a=0:(a=d/u,t=c(r),n=c(s),i=c(l),r===u?o=i-n:s===u?o=1/3+t-i:l===u&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*u]},o.rgb.hwb=function(e){var t=e[0],n=e[1],i=e[2],a=o.rgb.hsl(e)[0],r=1/255*Math.min(t,Math.min(n,i));return i=1-1/255*Math.max(t,Math.max(n,i)),[a,100*r,100*i]},o.rgb.cmyk=function(e){var t,n,i,o,a=e[0]/255,r=e[1]/255,s=e[2]/255;return o=Math.min(1-a,1-r,1-s),t=(1-a-o)/(1-o)||0,n=(1-r-o)/(1-o)||0,i=(1-s-o)/(1-o)||0,[100*t,100*n,100*i,100*o]},o.rgb.keyword=function(e){var i=n[e];if(i)return i;var o,a=1/0;for(var r in t)if(t.hasOwnProperty(r)){var s=t[r],l=comparativeDistance(e,s);l<a&&(a=l,o=r)}return o},o.keyword.rgb=function(e){return t[e]},o.rgb.xyz=function(e){var t=e[0]/255,n=e[1]/255,i=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var o=.4124*t+.3576*n+.1805*i,a=.2126*t+.7152*n+.0722*i,r=.0193*t+.1192*n+.9505*i;return[100*o,100*a,100*r]},o.rgb.lab=function(e){var t,n,i,a=o.rgb.xyz(e),r=a[0],s=a[1],l=a[2];return r/=95.047,s/=100,l/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,l=l>.008856?Math.pow(l,1/3):7.787*l+16/116,t=116*s-16,n=500*(r-s),i=200*(s-l),[t,n,i]},o.hsl.rgb=function(e){var t,n,i,o,a,r=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return a=255*l,[a,a,a];n=l<.5?l*(1+s):l+s-l*s,t=2*l-n,o=[0,0,0];for(var u=0;u<3;u++)i=r+1/3*-(u-1),i<0&&i++,i>1&&i--,a=6*i<1?t+6*(n-t)*i:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t,o[u]=255*a;return o},o.hsl.hsv=function(e){var t,n,i=e[0],o=e[1]/100,a=e[2]/100,r=o,s=Math.max(a,.01);return a*=2,o*=a<=1?a:2-a,r*=s<=1?s:2-s,n=(a+o)/2,t=0===a?2*r/(s+r):2*o/(a+o),[i,100*t,100*n]},o.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,i=e[2]/100,o=Math.floor(t)%6,a=t-Math.floor(t),r=255*i*(1-n),s=255*i*(1-n*a),l=255*i*(1-n*(1-a));
9
9
  switch(i*=255,o){case 0:return[i,l,r];case 1:return[s,i,r];case 2:return[r,i,l];case 3:return[r,s,i];case 4:return[l,r,i];case 5:return[i,r,s]}},o.hsv.hsl=function(e){var t,n,i,o=e[0],a=e[1]/100,r=e[2]/100,s=Math.max(r,.01);return i=(2-a)*r,t=(2-a)*s,n=a*s,n/=t<=1?t:2-t,n=n||0,i/=2,[o,100*n,100*i]},o.hwb.rgb=function(e){var t,n,i,o,a=e[0]/360,r=e[1]/100,s=e[2]/100,l=r+s;l>1&&(r/=l,s/=l),t=Math.floor(6*a),n=1-s,i=6*a-t,0!==(1&t)&&(i=1-i),o=r+i*(n-r);var u,d,c;switch(t){default:case 6:case 0:u=n,d=o,c=r;break;case 1:u=o,d=n,c=r;break;case 2:u=r,d=n,c=o;break;case 3:u=r,d=o,c=n;break;case 4:u=o,d=r,c=n;break;case 5:u=n,d=r,c=o}return[255*u,255*d,255*c]},o.cmyk.rgb=function(e){var t,n,i,o=e[0]/100,a=e[1]/100,r=e[2]/100,s=e[3]/100;return t=1-Math.min(1,o*(1-s)+s),n=1-Math.min(1,a*(1-s)+s),i=1-Math.min(1,r*(1-s)+s),[255*t,255*n,255*i]},o.xyz.rgb=function(e){var t,n,i,o=e[0]/100,a=e[1]/100,r=e[2]/100;return t=3.2406*o+a*-1.5372+r*-.4986,n=o*-.9689+1.8758*a+.0415*r,i=.0557*o+a*-.204+1.057*r,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,t=Math.min(Math.max(0,t),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*t,255*n,255*i]},o.xyz.lab=function(e){var t,n,i,o=e[0],a=e[1],r=e[2];return o/=95.047,a/=100,r/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,t=116*a-16,n=500*(o-a),i=200*(a-r),[t,n,i]},o.lab.xyz=function(e){var t,n,i,o=e[0],a=e[1],r=e[2];n=(o+16)/116,t=a/500+n,i=n-r/200;var s=Math.pow(n,3),l=Math.pow(t,3),u=Math.pow(i,3);return n=s>.008856?s:(n-16/116)/7.787,t=l>.008856?l:(t-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,t*=95.047,n*=100,i*=108.883,[t,n,i]},o.lab.lch=function(e){var t,n,i,o=e[0],a=e[1],r=e[2];return t=Math.atan2(r,a),n=360*t/2/Math.PI,n<0&&(n+=360),i=Math.sqrt(a*a+r*r),[o,i,n]},o.lch.lab=function(e){var t,n,i,o=e[0],a=e[1],r=e[2];return i=r/360*2*Math.PI,t=a*Math.cos(i),n=a*Math.sin(i),[o,t,n]},o.rgb.ansi16=function(e){var t=e[0],n=e[1],i=e[2],a=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];if(a=Math.round(a/50),0===a)return 30;var r=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===a&&(r+=60),r},o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){var t=e[0],n=e[1],i=e[2];if(t===n&&n===i)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var o=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5);return o},o.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var n=.5*(~~(e>50)+1),i=(1&t)*n*255,o=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[i,o,a]},o.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}e-=16;var n,i=Math.floor(e/36)/5*255,o=Math.floor((n=e%36)/6)/5*255,a=n%6/5*255;return[i,o,a]},o.rgb.hex=function(e){var t=((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2])),n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n},o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map(function(e){return e+e}).join(""));var i=parseInt(n,16),o=i>>16&255,a=i>>8&255,r=255&i;return[o,a,r]},o.rgb.hcg=function(e){var t,n,i=e[0]/255,o=e[1]/255,a=e[2]/255,r=Math.max(Math.max(i,o),a),s=Math.min(Math.min(i,o),a),l=r-s;return t=l<1?s/(1-l):0,n=l<=0?0:r===i?(o-a)/l%6:r===o?2+(a-i)/l:4+(i-o)/l+4,n/=6,n%=1,[360*n,100*l,100*t]},o.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,i=1,o=0;return i=n<.5?2*t*n:2*t*(1-n),i<1&&(o=(n-.5*i)/(1-i)),[e[0],100*i,100*o]},o.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,i=t*n,o=0;return i<1&&(o=(n-i)/(1-i)),[e[0],100*i,100*o]},o.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,i=e[2]/100;if(0===n)return[255*i,255*i,255*i];var o=[0,0,0],a=t%1*6,r=a%1,s=1-r,l=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=r,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=r;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=r,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return l=(1-n)*i,[255*(n*o[0]+l),255*(n*o[1]+l),255*(n*o[2]+l)]},o.hcg.hsv=function(e){var t=e[1]/100,n=e[2]/100,i=t+n*(1-t),o=0;return i>0&&(o=t/i),[e[0],100*o,100*i]},o.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100,i=n*(1-t)+.5*t,o=0;return i>0&&i<.5?o=t/(2*i):i>=.5&&i<1&&(o=t/(2*(1-i))),[e[0],100*o,100*i]},o.hcg.hwb=function(e){var t=e[1]/100,n=e[2]/100,i=t+n*(1-t);return[e[0],100*(i-t),100*(1-i)]},o.hwb.hcg=function(e){var t=e[1]/100,n=e[2]/100,i=1-n,o=i-t,a=0;return o<1&&(a=(i-o)/(1-o)),[e[0],100*o,100*a]},o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]},o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=(t<<16)+(t<<8)+t,i=n.toString(16).toUpperCase();return"000000".substring(i.length)+i},o.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}}),i=(n.rgb,n.hsl,n.hsv,n.hwb,n.cmyk,n.xyz,n.lab,n.lch,n.hex,n.keyword,n.ansi16,n.ansi256,n.hcg,n.apple,n.gray,function(e){for(var t=deriveBFS(e),n={},i=Object.keys(t),o=i.length,a=0;a<o;a++){var r=i[a],s=t[r];null!==s.parent&&(n[r]=wrapConversion(r,t))}return n}),o={},a=Object.keys(n);a.forEach(function(e){o[e]={},Object.defineProperty(o[e],"channels",{value:n[e].channels}),Object.defineProperty(o[e],"labels",{value:n[e].labels});var t=i(e),a=Object.keys(t);a.forEach(function(n){var i=t[n];o[e][n]=wrapRounded(i),o[e][n].raw=wrapRaw(i)})});var r=o,s={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},l={getRgba:getRgba,getHsla:getHsla,getRgb:getRgb,getHsl:getHsl,getHwb:getHwb,getAlpha:getAlpha,hexString:hexString,rgbString:rgbString,rgbaString:rgbaString,percentString:percentString,percentaString:percentaString,hslString:hslString,hslaString:hslaString,hwbString:hwbString,keyword:keyword},u={};for(var d in s)u[s[d]]=d;var c=function(e){if(e instanceof c)return e;if(!(this instanceof c))return new c(e);this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var t;"string"==typeof e?(t=l.getRgba(e),t?this.setValues("rgb",t):(t=l.getHsla(e))?this.setValues("hsl",t):(t=l.getHwb(e))&&this.setValues("hwb",t)):"object"==typeof e&&(t=e,void 0!==t.r||void 0!==t.red?this.setValues("rgb",t):void 0!==t.l||void 0!==t.lightness?this.setValues("hsl",t):void 0!==t.v||void 0!==t.value?this.setValues("hsv",t):void 0!==t.w||void 0!==t.whiteness?this.setValues("hwb",t):void 0===t.c&&void 0===t.cyan||this.setValues("cmyk",t))};c.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var e=this.values;return 1!==e.alpha?e.hwb.concat([e.alpha]):e.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values;return e.rgb.concat([e.alpha])},hslaArray:function(){var e=this.values;return e.hsl.concat([e.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return e&&(e%=360,e=e<0?360+e:e),this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return l.hexString(this.values.rgb)},rgbString:function(){return l.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return l.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return l.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return l.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return l.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return l.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return l.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],n=0;n<e.length;n++){var i=e[n]/255;t[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb,t=(299*e[0]+587*e[1]+114*e[2])/1e3;return t<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=this,i=e,o=void 0===t?.5:t,a=2*o-1,r=n.alpha()-i.alpha(),s=((a*r===-1?a:(a+r)/(1+a*r))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*o+i.alpha()*(1-o))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new c,i=this.values,o=n.values;for(var a in i)i.hasOwnProperty(a)&&(e=i[a],t={}.toString.call(e),"[object Array]"===t?o[a]=e.slice(0):"[object Number]"===t?o[a]=e:console.error("unexpected color value:",e));return n}},c.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},c.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},c.prototype.getValues=function(e){for(var t=this.values,n={},i=0;i<e.length;i++)n[e.charAt(i)]=t[e][i];return 1!==t.alpha&&(n.a=t.alpha),n},c.prototype.setValues=function(e,t){var n,i=this.values,o=this.spaces,a=this.maxes,s=1;if(this.valid=!0,"alpha"===e)s=t;else if(t.length)i[e]=t.slice(0,e.length),s=t[e.length];else if(void 0!==t[e.charAt(0)]){for(n=0;n<e.length;n++)i[e][n]=t[e.charAt(n)];s=t.a}else if(void 0!==t[o[e][0]]){var l=o[e];for(n=0;n<e.length;n++)i[e][n]=t[l[n]];s=t.alpha}if(i.alpha=Math.max(0,Math.min(1,void 0===s?i.alpha:s)),"alpha"===e)return!1;var u;for(n=0;n<e.length;n++)u=Math.max(0,Math.min(a[e][n],i[e][n])),i[e][n]=Math.round(u);for(var d in o)d!==e&&(i[d]=r[e][d](i[e]));return!0},c.prototype.setSpace=function(e,t){var n=t[0];return void 0===n?this.getValues(e):("number"==typeof n&&(n=Array.prototype.slice.call(t)),this.setValues(e,n),this)},c.prototype.setChannel=function(e,t,n){var i=this.values[e];return void 0===n?i[t]:n===i[t]?this:(i[t]=n,this.setValues(e,i),this)},"undefined"!=typeof window&&(window.Color=c);var p=c,h={noop:function(){},uid:function(){var e=0;return function(){return e++}}(),isNullOrUndef:function(e){return null===e||"undefined"==typeof e},isArray:function(e){if(Array.isArray&&Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)},isObject:function(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)},isFinite:function(e){return("number"==typeof e||e instanceof Number)&&isFinite(e)},valueOrDefault:function(e,t){return"undefined"==typeof e?t:e},valueAtIndexOrDefault:function(e,t,n){return h.valueOrDefault(h.isArray(e)?e[t]:e,n)},callback:function(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)},each:function(e,t,n,i){var o,a,r;if(h.isArray(e))if(a=e.length,i)for(o=a-1;o>=0;o--)t.call(n,e[o],o);else for(o=0;o<a;o++)t.call(n,e[o],o);else if(h.isObject(e))for(r=Object.keys(e),a=r.length,o=0;o<a;o++)t.call(n,e[r[o]],r[o])},arrayEquals:function(e,t){var n,i,o,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(o=e[n],a=t[n],o instanceof Array&&a instanceof Array){if(!h.arrayEquals(o,a))return!1}else if(o!==a)return!1;return!0},clone:function(e){if(h.isArray(e))return e.map(h.clone);if(h.isObject(e)){for(var t=Object.create(e),n=Object.keys(e),i=n.length,o=0;o<i;++o)t[n[o]]=h.clone(e[n[o]]);return t}return e},_merger:function(e,t,n,i){if(isValidKey(e)){var o=t[e],a=n[e];h.isObject(o)&&h.isObject(a)?h.merge(o,a,i):t[e]=h.clone(a)}},_mergerIf:function(e,t,n){if(isValidKey(e)){var i=t[e],o=n[e];h.isObject(i)&&h.isObject(o)?h.mergeIf(i,o):t.hasOwnProperty(e)||(t[e]=h.clone(o))}},merge:function(e,t,n){var i,o,a,r,s,l=h.isArray(t)?t:[t],u=l.length;if(!h.isObject(e))return e;for(n=n||{},i=n.merger||h._merger,o=0;o<u;++o)if(t=l[o],h.isObject(t))for(a=Object.keys(t),s=0,r=a.length;s<r;++s)i(a[s],e,t,n);return e},mergeIf:function(e,t){return h.merge(e,t,{merger:h._mergerIf})},extend:Object.assign||function(e){return h.merge(e,[].slice.call(arguments,1),{merger:function(e,t,n){t[e]=n[e]}})},inherits:function(e){var t=this,n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return t.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=t.prototype,n.prototype=new i,n.extend=h.inherits,e&&h.extend(n.prototype,e),n.__super__=t.prototype,n},_deprecated:function(e,t,n,i){void 0!==t&&console.warn(e+': "'+n+'" is deprecated. Please use "'+i+'" instead')}},f=h;h.callCallback=h.callback,h.indexOf=function(e,t,n){return Array.prototype.indexOf.call(e,t,n)},h.getValueOrDefault=h.valueOrDefault,h.getValueAtIndexOrDefault=h.valueAtIndexOrDefault;var g={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-e*(e-2)},easeInOutQuad:function(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return(e-=1)*e*e+1},easeInOutCubic:function(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return-((e-=1)*e*e*e-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return(e-=1)*e*e*e*e+1},easeInOutQuint:function(e){return(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},easeInSine:function(e){return-Math.cos(e*(Math.PI/2))+1},easeOutSine:function(e){return Math.sin(e*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInExpo:function(e){return 0===e?0:Math.pow(2,10*(e-1))},easeOutExpo:function(e){return 1===e?1:-Math.pow(2,-10*e)+1},easeInOutExpo:function(e){return 0===e?0:1===e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(-Math.pow(2,-10*--e)+2)},easeInCirc:function(e){return e>=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0,i=1;return 0===e?0:1===e?1:(n||(n=.3),i<1?(i=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/i),-(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)))},easeOutElastic:function(e){var t=1.70158,n=0,i=1;return 0===e?0:1===e?1:(n||(n=.3),i<1?(i=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0,i=1;return 0===e?0:2===(e/=.5)?1:(n||(n=.45),i<1?(i=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/i),e<1?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)):i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:function(e){return 1-g.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*g.easeInBounce(2*e):.5*g.easeOutBounce(2*e-1)+.5}},m={effects:g};f.easingEffects=g;var v=Math.PI,b=v/180,x=2*v,_=v/2,q=v/4,y=2*v/3,w={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,i,o,a){if(a){var r=Math.min(a,o/2,i/2),s=t+r,l=n+r,u=t+i-r,d=n+o-r;e.moveTo(t,l),s<u&&l<d?(e.arc(s,l,r,-v,-_),e.arc(u,l,r,-_,0),e.arc(u,d,r,0,_),e.arc(s,d,r,_,v)):s<u?(e.moveTo(s,n),e.arc(u,l,r,-_,_),e.arc(s,l,r,_,v+_)):l<d?(e.arc(s,l,r,-v,0),e.arc(s,d,r,0,v)):e.arc(s,l,r,-v,v),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,i,o)},drawPoint:function(e,t,n,i,o,a){var r,s,l,u,d,c=(a||0)*b;if(t&&"object"==typeof t&&(r=t.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return e.save(),e.translate(i,o),e.rotate(c),e.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),void e.restore();if(!(isNaN(n)||n<=0)){switch(e.beginPath(),t){default:e.arc(i,o,n,0,x),e.closePath();break;case"triangle":e.moveTo(i+Math.sin(c)*n,o-Math.cos(c)*n),c+=y,e.lineTo(i+Math.sin(c)*n,o-Math.cos(c)*n),c+=y,e.lineTo(i+Math.sin(c)*n,o-Math.cos(c)*n),e.closePath();break;case"rectRounded":d=.516*n,u=n-d,s=Math.cos(c+q)*u,l=Math.sin(c+q)*u,e.arc(i-s,o-l,d,c-v,c-_),e.arc(i+l,o-s,d,c-_,c),e.arc(i+s,o+l,d,c,c+_),e.arc(i-l,o+s,d,c+_,c+v),e.closePath();break;case"rect":if(!a){u=Math.SQRT1_2*n,e.rect(i-u,o-u,2*u,2*u);break}c+=q;case"rectRot":s=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(i-s,o-l),e.lineTo(i+l,o-s),e.lineTo(i+s,o+l),e.lineTo(i-l,o+s),e.closePath();break;case"crossRot":c+=q;case"cross":s=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(i-s,o-l),e.lineTo(i+s,o+l),e.moveTo(i+l,o-s),e.lineTo(i-l,o+s);break;case"star":s=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(i-s,o-l),e.lineTo(i+s,o+l),e.moveTo(i+l,o-s),e.lineTo(i-l,o+s),c+=q,s=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(i-s,o-l),e.lineTo(i+s,o+l),e.moveTo(i+l,o-s),e.lineTo(i-l,o+s);break;case"line":s=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(i-s,o-l),e.lineTo(i+s,o+l);break;case"dash":e.moveTo(i,o),e.lineTo(i+Math.cos(c)*n,o+Math.sin(c)*n)}e.fill(),e.stroke()}},_isPointInArea:function(e,t){var n=1e-6;return e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n},clipArea:function(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()},unclipArea:function(e){e.restore()},lineTo:function(e,t,n,i){var o=n.steppedLine;if(o){if("middle"===o){var a=(t.x+n.x)/2;e.lineTo(a,i?n.y:t.y),e.lineTo(a,i?t.y:n.y)}else"after"===o&&!i||"after"!==o&&i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);return void e.lineTo(n.x,n.y)}return n.tension?void e.bezierCurveTo(i?t.controlPointPreviousX:t.controlPointNextX,i?t.controlPointPreviousY:t.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):void e.lineTo(n.x,n.y)}},C=w;f.clear=w.clear,f.drawRoundedRectangle=function(e){e.beginPath(),w.roundedRect.apply(w,arguments)};var S={_set:function(e,t){return f.merge(this[e]||(this[e]={}),t)}};S._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var A=S,k=f.valueOrDefault,D={toLineHeight:function(e,t){var n=(""+e).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e},toPadding:function(e){var t,n,i,o;return f.isObject(e)?(t=+e.top||0,n=+e.right||0,i=+e.bottom||0,o=+e.left||0):t=n=i=o=+e||0,{top:t,right:n,bottom:i,left:o,height:t+i,width:o+n}},_parseFont:function(e){var t=A.global,n=k(e.fontSize,t.defaultFontSize),i={family:k(e.fontFamily,t.defaultFontFamily),lineHeight:f.options.toLineHeight(k(e.lineHeight,t.defaultLineHeight),n),size:n,style:k(e.fontStyle,t.defaultFontStyle),weight:null,string:""};return i.string=toFontString(i),i},resolve:function(e,t,n,i){var o,a,r,s=!0;for(o=0,a=e.length;o<a;++o)if(r=e[o],void 0!==r&&(void 0!==t&&"function"==typeof r&&(r=r(t),s=!1),void 0!==n&&f.isArray(r)&&(r=r[n],s=!1),void 0!==r))return i&&!s&&(i.cacheable=!1),r}},F={_factorize:function(e){var t,n=[],i=Math.sqrt(e);for(t=1;t<i;t++)e%t===0&&(n.push(t),n.push(e/t));return i===(0|i)&&n.push(i),n.sort(function(e,t){return e-t}).pop(),n},log10:Math.log10||function(e){var t=Math.log(e)*Math.LOG10E,n=Math.round(t),i=e===Math.pow(10,n);return i?n:t}},P=F;f.log10=F.log10;var I=function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}},M=function(){return{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}},T=function(e,t,n){return e?I(t,n):M()},R=function(e,t){var n,i;"ltr"!==t&&"rtl"!==t||(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)},E=function(e){var t=e.prevTextDirection;void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))},B={getRtlAdapter:T,overrideTextDirection:R,restoreTextDirection:E},O=f,L=m,z=C,N=D,U=P,H=B;O.easing=L,O.canvas=z,O.options=N,O.math=U,O.rtl=H;var j=function(e){O.extend(this,e),this.initialize.apply(this,arguments)};O.extend(j.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var e=this;return e._view||(e._view=O.extend({},e._model)),e._start={},e},transition:function(e){var t=this,n=t._model,i=t._start,o=t._view;return n&&1!==e?(o||(o=t._view={}),i||(i=t._start={}),interpolate(i,o,n,e),t):(t._view=O.extend({},n),t._start=null,t)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return O.isNumber(this._model.x)&&O.isNumber(this._model.y)}}),j.extend=O.inherits;var V=j,W=V.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),G=W;Object.defineProperty(W.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(W.prototype,"chartInstance",{get:function(){return this.chart},set:function(e){this.chart=e}}),A._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:O.noop,onComplete:O.noop}});var X={animations:[],request:null,addAnimation:function(e,t,n,i){var o,a,r=this.animations;for(t.chart=e,t.startTime=Date.now(),t.duration=n,i||(e.animating=!0),o=0,a=r.length;o<a;++o)if(r[o].chart===e)return void(r[o]=t);r.push(t),1===r.length&&this.requestAnimationFrame()},cancelAnimation:function(e){var t=O.findIndex(this.animations,function(t){return t.chart===e});t!==-1&&(this.animations.splice(t,1),e.animating=!1)},requestAnimationFrame:function(){var e=this;null===e.request&&(e.request=O.requestAnimFrame.call(window,function(){e.request=null,e.startDigest()}))},startDigest:function(){var e=this;e.advance(),e.animations.length>0&&e.requestAnimationFrame()},advance:function(){for(var e,t,n,i,o=this.animations,a=0;a<o.length;)e=o[a],t=e.chart,n=e.numSteps,i=Math.floor((Date.now()-e.startTime)/e.duration*n)+1,e.currentStep=Math.min(i,n),O.callback(e.render,[t,e],t),O.callback(e.onAnimationProgress,[e],t),e.currentStep>=n?(O.callback(e.onAnimationComplete,[e],t),t.animating=!1,o.splice(a,1)):++a}},$=O.options.resolve,Y=["push","pop","shift","splice","unshift"],J=function(e,t){this.initialize(e,t)};O.extend(J.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),n=e.chart,i=n.scales,o=e.getDataset(),a=n.options.scales;null!==t.xAxisID&&t.xAxisID in i&&!o.xAxisID||(t.xAxisID=o.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in i&&!o.yAxisID||(t.yAxisID=o.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&unlistenArrayEvents(this._data,this)},createMetaDataset:function(){var e=this,t=e.datasetElementType;return t&&new t({_chart:e.chart,_datasetIndex:e.index})},createMetaData:function(e){var t=this,n=t.dataElementType;return n&&new n({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,n=this,i=n.getMeta(),o=n.getDataset().data||[],a=i.data;for(e=0,t=o.length;e<t;++e)a[e]=a[e]||n.createMetaData(e);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(e){var t=this.createMetaData(e);this.getMeta().data.splice(e,0,t),this.updateElement(t,e,!0)},buildOrUpdateElements:function(){var e=this,t=e.getDataset(),n=t.data||(t.data=[]);e._data!==n&&(e._data&&unlistenArrayEvents(e._data,e),n&&Object.isExtensible(n)&&listenArrayEvents(n,e),e._data=n),e.resyncElements()},_configure:function(){var e=this;e._config=O.merge(Object.create(null),[e.chart.options.datasets[e._type],e.getDataset()],{merger:function(e,t,n){"_meta"!==e&&"data"!==e&&O._merger(e,t,n)}})},_update:function(e){var t=this;t._configure(),t._cachedDataOpts=null,t.update(e)},update:O.noop,transition:function(e){for(var t=this.getMeta(),n=t.data||[],i=n.length,o=0;o<i;++o)n[o].transition(e);t.dataset&&t.dataset.transition(e)},draw:function(){var e=this.getMeta(),t=e.data||[],n=t.length,i=0;for(e.dataset&&e.dataset.draw();i<n;++i)t[i].draw()},getStyle:function(e){var t,n=this,i=n.getMeta(),o=i.dataset;return n._configure(),o&&void 0===e?t=n._resolveDatasetElementOptions(o||{}):(e=e||0,t=n._resolveDataElementOptions(i.data[e]||{},e)),t.fill!==!1&&null!==t.fill||(t.backgroundColor=t.borderColor),t},_resolveDatasetElementOptions:function(e,t){var n,i,o,a,r=this,s=r.chart,l=r._config,u=e.custom||{},d=s.options.elements[r.datasetElementType.prototype._type]||{},c=r._datasetElementOptions,p={},h={chart:s,dataset:r.getDataset(),datasetIndex:r.index,hover:t};for(n=0,i=c.length;n<i;++n)o=c[n],a=t?"hover"+o.charAt(0).toUpperCase()+o.slice(1):o,p[o]=$([u[a],l[a],d[a]],h);return p},_resolveDataElementOptions:function(e,t){var n=this,i=e&&e.custom,o=n._cachedDataOpts;if(o&&!i)return o;var a,r,s,l,u=n.chart,d=n._config,c=u.options.elements[n.dataElementType.prototype._type]||{},p=n._dataElementOptions,h={},f={chart:u,dataIndex:t,dataset:n.getDataset(),datasetIndex:n.index},g={cacheable:!i};if(i=i||{},O.isArray(p))for(r=0,s=p.length;r<s;++r)l=p[r],
10
10
  h[l]=$([i[l],d[l],c[l]],f,t,g);else for(a=Object.keys(p),r=0,s=a.length;r<s;++r)l=a[r],h[l]=$([i[l],d[p[l]],d[l],c[l]],f,t,g);return g.cacheable&&(n._cachedDataOpts=Object.freeze(h)),h},removeHoverStyle:function(e){O.merge(e._model,e.$previousStyle||{}),delete e.$previousStyle},setHoverStyle:function(e){var t=this.chart.data.datasets[e._datasetIndex],n=e._index,i=e.custom||{},o=e._model,a=O.getHoverColor;e.$previousStyle={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderWidth:o.borderWidth},o.backgroundColor=$([i.hoverBackgroundColor,t.hoverBackgroundColor,a(o.backgroundColor)],void 0,n),o.borderColor=$([i.hoverBorderColor,t.hoverBorderColor,a(o.borderColor)],void 0,n),o.borderWidth=$([i.hoverBorderWidth,t.hoverBorderWidth,o.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var e=this.getMeta().dataset;e&&this.removeHoverStyle(e)},_setDatasetHoverStyle:function(){var e,t,n,i,o,a,r=this.getMeta().dataset,s={};if(r){for(a=r._model,o=this._resolveDatasetElementOptions(r,!0),i=Object.keys(o),e=0,t=i.length;e<t;++e)n=i[e],s[n]=a[n],a[n]=o[n];r.$previousStyle=s}},resyncElements:function(){var e=this,t=e.getMeta(),n=e.getDataset().data,i=t.data.length,o=n.length;o<i?t.data.splice(o,i-o):o>i&&e.insertElements(i,o-i)},insertElements:function(e,t){for(var n=0;n<t;++n)this.addElementAndReset(e+n)},onDataPush:function(){var e=arguments.length;this.insertElements(this.getDataset().data.length-e,e)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(e,t){this.getMeta().data.splice(e,t),this.insertElements(e,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),J.extend=O.inherits;var K=J,Z=2*Math.PI;A._set("global",{elements:{arc:{backgroundColor:A.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var Q=V.extend({_type:"arc",inLabelRange:function(e){var t=this._view;return!!t&&Math.pow(e-t.x,2)<Math.pow(t.radius+t.hoverRadius,2)},inRange:function(e,t){var n=this._view;if(n){for(var i=O.getAngleFromPoint(n,{x:e,y:t}),o=i.angle,a=i.distance,r=n.startAngle,s=n.endAngle;s<r;)s+=Z;for(;o>s;)o-=Z;for(;o<r;)o+=Z;var l=o>=r&&o<=s,u=a>=n.innerRadius&&a<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,o={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/Z)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,o.fullCircles){for(o.endAngle=o.startAngle+Z,t.beginPath(),t.arc(o.x,o.y,o.outerRadius,o.startAngle,o.endAngle),t.arc(o.x,o.y,o.innerRadius,o.endAngle,o.startAngle,!0),t.closePath(),e=0;e<o.fullCircles;++e)t.fill();o.endAngle=o.startAngle+n.circumference%Z}t.beginPath(),t.arc(o.x,o.y,o.outerRadius,o.startAngle,o.endAngle),t.arc(o.x,o.y,o.innerRadius,o.endAngle,o.startAngle,!0),t.closePath(),t.fill(),n.borderWidth&&drawBorder(t,n,o),t.restore()}}),ee=O.valueOrDefault,te=A.global.defaultColor;A._set("global",{elements:{line:{tension:.4,backgroundColor:te,borderWidth:3,borderColor:te,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var ne=V.extend({_type:"line",draw:function(){var e,t,n,i=this,o=i._view,a=i._chart.ctx,r=o.spanGaps,s=i._children.slice(),l=A.global,u=l.elements.line,d=-1,c=i._loop;if(s.length){if(i._loop){for(e=0;e<s.length;++e)if(t=O.previousItem(s,e),!s[e]._view.skip&&t._view.skip){s=s.slice(e).concat(s.slice(0,e)),c=r;break}c&&s.push(s[0])}for(a.save(),a.lineCap=o.borderCapStyle||u.borderCapStyle,a.setLineDash&&a.setLineDash(o.borderDash||u.borderDash),a.lineDashOffset=ee(o.borderDashOffset,u.borderDashOffset),a.lineJoin=o.borderJoinStyle||u.borderJoinStyle,a.lineWidth=ee(o.borderWidth,u.borderWidth),a.strokeStyle=o.borderColor||l.defaultColor,a.beginPath(),n=s[0]._view,n.skip||(a.moveTo(n.x,n.y),d=0),e=1;e<s.length;++e)n=s[e]._view,t=d===-1?O.previousItem(s,e):s[d],n.skip||(d!==e-1&&!r||d===-1?a.moveTo(n.x,n.y):O.canvas.lineTo(a,t._view,n),d=e);c&&a.closePath(),a.stroke(),a.restore()}}}),ie=O.valueOrDefault,oe=A.global.defaultColor;A._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:oe,borderColor:oe,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var ae=V.extend({_type:"point",inRange:function(e,t){var n=this._view;return!!n&&Math.pow(e-n.x,2)+Math.pow(t-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:xRange,inXRange:xRange,inYRange:yRange,getCenterPoint:function(){var e=this._view;return{x:e.x,y:e.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y,padding:e.radius+e.borderWidth}},draw:function(e){var t=this._view,n=this._chart.ctx,i=t.pointStyle,o=t.rotation,a=t.radius,r=t.x,s=t.y,l=A.global,u=l.defaultColor;t.skip||(void 0===e||O.canvas._isPointInArea(t,e))&&(n.strokeStyle=t.borderColor||u,n.lineWidth=ie(t.borderWidth,l.elements.point.borderWidth),n.fillStyle=t.backgroundColor||u,O.canvas.drawPoint(n,i,a,r,s,o))}}),re=A.global.defaultColor;A._set("global",{elements:{rectangle:{backgroundColor:re,borderColor:re,borderSkipped:"bottom",borderWidth:0}}});var se=V.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=boundingRects(t),i=n.outer,o=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(i.x,i.y,i.w,i.h),i.w===o.w&&i.h===o.h||(e.save(),e.beginPath(),e.rect(i.x,i.y,i.w,i.h),e.clip(),e.fillStyle=t.borderColor,e.rect(o.x,o.y,o.w,o.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return inRange(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return isVertical(n)?inRange(n,e,null):inRange(n,null,t)},inXRange:function(e){return inRange(this._view,e,null)},inYRange:function(e){return inRange(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return isVertical(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return isVertical(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),le={},ue=Q,de=ne,ce=ae,pe=se;le.Arc=ue,le.Line=de,le.Point=ce,le.Rectangle=pe;var he=O._deprecated,fe=O.valueOrDefault;A._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),A._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var ge=K.extend({dataElementType:le.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,n=this;K.prototype.initialize.apply(n,arguments),e=n.getMeta(),e.stack=n.getDataset().stack,e.bar=!0,t=n._getIndexScale().options,he("bar chart",t.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),he("bar chart",t.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),he("bar chart",t.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),he("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),he("bar chart",t.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(e){var t,n,i=this,o=i.getMeta().data;for(i._ruler=i.getRuler(),t=0,n=o.length;t<n;++t)i.updateElement(o[t],t,e)},updateElement:function(e,t,n){var i=this,o=i.getMeta(),a=i.getDataset(),r=i._resolveDataElementOptions(e,t);e._xScale=i.getScaleForId(o.xAxisID),e._yScale=i.getScaleForId(o.yAxisID),e._datasetIndex=i.index,e._index=t,e._model={backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderSkipped:r.borderSkipped,borderWidth:r.borderWidth,datasetLabel:a.label,label:i.chart.data.labels[t]},O.isArray(a.data[t])&&(e._model.borderSkipped=null),i._updateElementGeometry(e,t,n,r),e.pivot()},_updateElementGeometry:function(e,t,n,i){var o=this,a=e._model,r=o._getValueScale(),s=r.getBasePixel(),l=r.isHorizontal(),u=o._ruler||o.getRuler(),d=o.calculateBarValuePixels(o.index,t,i),c=o.calculateBarIndexPixels(o.index,t,u,i);a.horizontal=l,a.base=n?s:d.base,a.x=l?n?s:d.head:c.center,a.y=l?c.center:n?s:d.head,a.height=l?c.size:void 0,a.width=l?void 0:c.size},_getStacks:function(e){var t,n,i=this,o=i._getIndexScale(),a=o._getMatchingVisibleMetas(i._type),r=o.options.stacked,s=a.length,l=[];for(t=0;t<s&&(n=a[t],(r===!1||l.indexOf(n.stack)===-1||void 0===r&&void 0===n.stack)&&l.push(n.stack),n.index!==e);++t);return l},getStackCount:function(){return this._getStacks().length},getStackIndex:function(e,t){var n=this._getStacks(e),i=void 0!==t?n.indexOf(t):-1;return i===-1?n.length-1:i},getRuler:function(){var e,t,n=this,i=n._getIndexScale(),o=[];for(e=0,t=n.getMeta().data.length;e<t;++e)o.push(i.getPixelForValue(null,e,n.index));return{pixels:o,start:i._startPixel,end:i._endPixel,stackCount:n.getStackCount(),scale:i}},calculateBarValuePixels:function(e,t,n){var i,o,a,r,s,l,u,d=this,c=d.chart,p=d._getValueScale(),h=p.isHorizontal(),f=c.data.datasets,g=p._getMatchingVisibleMetas(d._type),m=p._parseValue(f[e].data[t]),v=n.minBarLength,b=p.options.stacked,x=d.getMeta().stack,_=void 0===m.start?0:m.max>=0&&m.min>=0?m.min:m.max,q=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,y=g.length;if(b||void 0===b&&void 0!==x)for(i=0;i<y&&(o=g[i],o.index!==e);++i)o.stack===x&&(u=p._parseValue(f[o.index].data[t]),a=void 0===u.start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(m.min<0&&a<0||m.max>=0&&a>0)&&(_+=a));return r=p.getPixelForValue(_),s=p.getPixelForValue(_+q),l=s-r,void 0!==v&&Math.abs(l)<v&&(l=v,s=q>=0&&!h||q<0&&h?r-v:r+v),{size:l,base:r,head:s,center:s+l/2}},calculateBarIndexPixels:function(e,t,n,i){var o=this,a="flex"===i.barThickness?computeFlexCategoryTraits(t,n,i):computeFitCategoryTraits(t,n,i),r=o.getStackIndex(e,o.getMeta().stack),s=a.start+a.chunk*r+a.chunk/2,l=Math.min(fe(i.maxBarThickness,1/0),a.chunk*a.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}},draw:function(){var e=this,t=e.chart,n=e._getValueScale(),i=e.getMeta().data,o=e.getDataset(),a=i.length,r=0;for(O.canvas.clipArea(t.ctx,t.chartArea);r<a;++r){var s=n._parseValue(o.data[r]);isNaN(s.min)||isNaN(s.max)||i[r].draw()}O.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var e=this,t=O.extend({},K.prototype._resolveDataElementOptions.apply(e,arguments)),n=e._getIndexScale().options,i=e._getValueScale().options;return t.barPercentage=fe(n.barPercentage,t.barPercentage),t.barThickness=fe(n.barThickness,t.barThickness),t.categoryPercentage=fe(n.categoryPercentage,t.categoryPercentage),t.maxBarThickness=fe(n.maxBarThickness,t.maxBarThickness),t.minBarLength=fe(i.minBarLength,t.minBarLength),t}}),me=O.valueOrDefault,ve=O.options.resolve;A._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(e,t){var n=t.datasets[e.datasetIndex].label||"",i=t.datasets[e.datasetIndex].data[e.index];return n+": ("+e.xLabel+", "+e.yLabel+", "+i.r+")"}}}});var be=K.extend({dataElementType:le.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(e){var t=this,n=t.getMeta(),i=n.data;O.each(i,function(n,i){t.updateElement(n,i,e)})},updateElement:function(e,t,n){var i=this,o=i.getMeta(),a=e.custom||{},r=i.getScaleForId(o.xAxisID),s=i.getScaleForId(o.yAxisID),l=i._resolveDataElementOptions(e,t),u=i.getDataset().data[t],d=i.index,c=n?r.getPixelForDecimal(.5):r.getPixelForValue("object"==typeof u?u:NaN,t,d),p=n?s.getBasePixel():s.getPixelForValue(u,t,d);e._xScale=r,e._yScale=s,e._options=l,e._datasetIndex=d,e._index=t,e._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:n?0:l.radius,skip:a.skip||isNaN(c)||isNaN(p),x:c,y:p},e.pivot()},setHoverStyle:function(e){var t=e._model,n=e._options,i=O.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=me(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=me(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=me(n.hoverBorderWidth,n.borderWidth),t.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(e,t){var n=this,i=n.chart,o=n.getDataset(),a=e.custom||{},r=o.data[t]||{},s=K.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:i,dataIndex:t,dataset:o,datasetIndex:n.index};return n._cachedDataOpts===s&&(s=O.extend({},s)),s.radius=ve([a.radius,r.r,n._config.radius,i.options.elements.point.radius],l,t),s}}),xe=O.valueOrDefault,_e=Math.PI,qe=2*_e,ye=_e/2;A._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(e){var t,n,i,o,a=document.createElement("ul"),r=e.data,s=r.datasets,l=r.labels;if(a.setAttribute("class",e.id+"-legend"),s.length)for(t=0,n=s[0].data.length;t<n;++t)i=a.appendChild(document.createElement("li")),o=i.appendChild(document.createElement("span")),o.style.backgroundColor=s[0].backgroundColor[t],l[t]&&i.appendChild(document.createTextNode(l[t]));return a.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map(function(n,i){var o=e.getDatasetMeta(0),a=o.controller.getStyle(i);return{text:n,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,hidden:isNaN(t.datasets[0].data[i])||o.data[i].hidden,index:i}}):[]}},onClick:function(e,t){var n,i,o,a=t.index,r=this.chart;for(n=0,i=(r.data.datasets||[]).length;n<i;++n)o=r.getDatasetMeta(n),o.data[a]&&(o.data[a].hidden=!o.data[a].hidden);r.update()}},cutoutPercentage:50,rotation:-ye,circumference:qe,tooltips:{callbacks:{title:function(){return""},label:function(e,t){var n=t.labels[e.index],i=": "+t.datasets[e.datasetIndex].data[e.index];return O.isArray(n)?(n=n.slice(),n[0]+=i):n+=i,n}}}});var we=K.extend({dataElementType:le.Arc,linkScales:O.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&++t;return t},update:function(e){var t,n,i,o,a=this,r=a.chart,s=r.chartArea,l=r.options,u=1,d=1,c=0,p=0,h=a.getMeta(),f=h.data,g=l.cutoutPercentage/100||0,m=l.circumference,v=a._getRingWeight(a.index);if(m<qe){var b=l.rotation%qe;b+=b>=_e?-qe:b<-_e?qe:0;var x=b+m,_=Math.cos(b),q=Math.sin(b),y=Math.cos(x),w=Math.sin(x),C=b<=0&&x>=0||x>=qe,S=b<=ye&&x>=ye||x>=qe+ye,A=b===-_e||x>=_e,k=b<=-ye&&x>=-ye||x>=_e+ye,D=A?-1:Math.min(_,_*g,y,y*g),F=k?-1:Math.min(q,q*g,w,w*g),P=C?1:Math.max(_,_*g,y,y*g),I=S?1:Math.max(q,q*g,w,w*g);u=(P-D)/2,d=(I-F)/2,c=-(P+D)/2,p=-(I+F)/2}for(i=0,o=f.length;i<o;++i)f[i]._options=a._resolveDataElementOptions(f[i],i);for(r.borderWidth=a.getMaxBorderWidth(),t=(s.right-s.left-r.borderWidth)/u,n=(s.bottom-s.top-r.borderWidth)/d,r.outerRadius=Math.max(Math.min(t,n)/2,0),r.innerRadius=Math.max(r.outerRadius*g,0),r.radiusLength=(r.outerRadius-r.innerRadius)/(a._getVisibleDatasetWeightTotal()||1),r.offsetX=c*r.outerRadius,r.offsetY=p*r.outerRadius,h.total=a.calculateTotal(),a.outerRadius=r.outerRadius-r.radiusLength*a._getRingWeightOffset(a.index),a.innerRadius=Math.max(a.outerRadius-r.radiusLength*v,0),i=0,o=f.length;i<o;++i)a.updateElement(f[i],i,e)},updateElement:function(e,t,n){var i=this,o=i.chart,a=o.chartArea,r=o.options,s=r.animation,l=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=r.rotation,c=r.rotation,p=i.getDataset(),h=n&&s.animateRotate?0:e.hidden?0:i.calculateCircumference(p.data[t])*(r.circumference/qe),f=n&&s.animateScale?0:i.innerRadius,g=n&&s.animateScale?0:i.outerRadius,m=e._options||{};O.extend(e,{_datasetIndex:i.index,_index:t,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:l+o.offsetX,y:u+o.offsetY,startAngle:d,endAngle:c,circumference:h,outerRadius:g,innerRadius:f,label:O.valueAtIndexOrDefault(p.label,t,o.data.labels[t])}});var v=e._model;n&&s.animateRotate||(0===t?v.startAngle=r.rotation:v.startAngle=i.getMeta().data[t-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),e.pivot()},calculateTotal:function(){var e,t=this.getDataset(),n=this.getMeta(),i=0;return O.each(n.data,function(n,o){e=t.data[o],isNaN(e)||n.hidden||(i+=Math.abs(e))}),i},calculateCircumference:function(e){var t=this.getMeta().total;return t>0&&!isNaN(e)?qe*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,i,o,a,r,s,l,u=this,d=0,c=u.chart;if(!e)for(t=0,n=c.data.datasets.length;t<n;++t)if(c.isDatasetVisible(t)){i=c.getDatasetMeta(t),e=i.data,t!==u.index&&(a=i.controller);break}if(!e)return 0;for(t=0,n=e.length;t<n;++t)o=e[t],a?(a._configure(),r=a._resolveDataElementOptions(o,t)):r=o._options,"inner"!==r.borderAlign&&(s=r.borderWidth,l=r.hoverBorderWidth,d=s>d?s:d,d=l>d?l:d);return d},setHoverStyle:function(e){var t=e._model,n=e._options,i=O.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=xe(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=xe(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=xe(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t},_getRingWeight:function(e){return Math.max(xe(this.chart.data.datasets[e].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});A._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),A._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Ce=ge.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Se=O.valueOrDefault,Ae=O.options.resolve,ke=O.canvas._isPointInArea;A._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var De=K.extend({datasetElementType:le.Line,dataElementType:le.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(e){var t,n,i=this,o=i.getMeta(),a=o.dataset,r=o.data||[],s=i.chart.options,l=i._config,u=i._showLine=Se(l.showLine,s.showLines);for(i._xScale=i.getScaleForId(o.xAxisID),i._yScale=i.getScaleForId(o.yAxisID),u&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),a._scale=i._yScale,a._datasetIndex=i.index,a._children=r,a._model=i._resolveDatasetElementOptions(a),a.pivot()),t=0,n=r.length;t<n;++t)i.updateElement(r[t],t,e);for(u&&0!==a._model.tension&&i.updateBezierControlPoints(),t=0,n=r.length;t<n;++t)r[t].pivot()},updateElement:function(e,t,n){var i,o,a=this,r=a.getMeta(),s=e.custom||{},l=a.getDataset(),u=a.index,d=l.data[t],c=a._xScale,p=a._yScale,h=r.dataset._model,f=a._resolveDataElementOptions(e,t);i=c.getPixelForValue("object"==typeof d?d:NaN,t,u),o=n?p.getBasePixel():a.calculatePointY(d,t,u),e._xScale=c,e._yScale=p,e._options=f,e._datasetIndex=u,e._index=t,e._model={x:i,y:o,skip:s.skip||isNaN(i)||isNaN(o),radius:f.radius,pointStyle:f.pointStyle,rotation:f.rotation,backgroundColor:f.backgroundColor,borderColor:f.borderColor,borderWidth:f.borderWidth,tension:Se(s.tension,h?h.tension:0),steppedLine:!!h&&h.steppedLine,hitRadius:f.hitRadius}},_resolveDatasetElementOptions:function(e){var t=this,n=t._config,i=e.custom||{},o=t.chart.options,a=o.elements.line,r=K.prototype._resolveDatasetElementOptions.apply(t,arguments);return r.spanGaps=Se(n.spanGaps,o.spanGaps),r.tension=Se(n.lineTension,a.tension),r.steppedLine=Ae([i.steppedLine,n.steppedLine,a.stepped]),r.clip=toClip(Se(n.clip,defaultClip(t._xScale,t._yScale,r.borderWidth))),r},calculatePointY:function(e,t,n){var i,o,a,r,s,l,u,d=this,c=d.chart,p=d._yScale,h=0,f=0;if(p.options.stacked){for(s=+p.getRightValue(e),l=c._getSortedVisibleDatasetMetas(),u=l.length,i=0;i<u&&(a=l[i],a.index!==n);++i)o=c.data.datasets[a.index],"line"===a.type&&a.yAxisID===p.id&&(r=+p.getRightValue(o.data[t]),r<0?f+=r||0:h+=r||0);return s<0?p.getPixelForValue(f+s):p.getPixelForValue(h+s)}return p.getPixelForValue(e)},updateBezierControlPoints:function(){function capControlPoint(e,t,n){return Math.max(Math.min(e,n),t)}var e,t,n,i,o=this,a=o.chart,r=o.getMeta(),s=r.dataset._model,l=a.chartArea,u=r.data||[];if(s.spanGaps&&(u=u.filter(function(e){return!e._model.skip})),"monotone"===s.cubicInterpolationMode)O.splineCurveMonotone(u);else for(e=0,t=u.length;e<t;++e)n=u[e]._model,i=O.splineCurve(O.previousItem(u,e)._model,n,O.nextItem(u,e)._model,s.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(a.options.elements.line.capBezierPoints)for(e=0,t=u.length;e<t;++e)n=u[e]._model,ke(n,l)&&(e>0&&ke(u[e-1]._model,l)&&(n.controlPointPreviousX=capControlPoint(n.controlPointPreviousX,l.left,l.right),n.controlPointPreviousY=capControlPoint(n.controlPointPreviousY,l.top,l.bottom)),e<u.length-1&&ke(u[e+1]._model,l)&&(n.controlPointNextX=capControlPoint(n.controlPointNextX,l.left,l.right),n.controlPointNextY=capControlPoint(n.controlPointNextY,l.top,l.bottom)))},draw:function(){var e,t=this,n=t.chart,i=t.getMeta(),o=i.data||[],a=n.chartArea,r=n.canvas,s=0,l=o.length;for(t._showLine&&(e=i.dataset._model.clip,O.canvas.clipArea(n.ctx,{left:e.left===!1?0:a.left-e.left,right:e.right===!1?r.width:a.right+e.right,top:e.top===!1?0:a.top-e.top,bottom:e.bottom===!1?r.height:a.bottom+e.bottom}),i.dataset.draw(),O.canvas.unclipArea(n.ctx));s<l;++s)o[s].draw(a)},setHoverStyle:function(e){var t=e._model,n=e._options,i=O.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Se(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=Se(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=Se(n.hoverBorderWidth,n.borderWidth),t.radius=Se(n.hoverRadius,n.radius)}}),Fe=O.options.resolve;A._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(e){var t,n,i,o,a=document.createElement("ul"),r=e.data,s=r.datasets,l=r.labels;if(a.setAttribute("class",e.id+"-legend"),s.length)for(t=0,n=s[0].data.length;t<n;++t)i=a.appendChild(document.createElement("li")),o=i.appendChild(document.createElement("span")),o.style.backgroundColor=s[0].backgroundColor[t],l[t]&&i.appendChild(document.createTextNode(l[t]));return a.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map(function(n,i){var o=e.getDatasetMeta(0),a=o.controller.getStyle(i);return{text:n,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,hidden:isNaN(t.datasets[0].data[i])||o.data[i].hidden,index:i}}):[]}},onClick:function(e,t){var n,i,o,a=t.index,r=this.chart;for(n=0,i=(r.data.datasets||[]).length;n<i;++n)o=r.getDatasetMeta(n),o.data[a].hidden=!o.data[a].hidden;r.update()}},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return t.labels[e.index]+": "+e.yLabel}}}});var Pe=K.extend({dataElementType:le.Arc,linkScales:O.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,i,o=this,a=o.getDataset(),r=o.getMeta(),s=o.chart.options.startAngle||0,l=o._starts=[],u=o._angles=[],d=r.data;for(o._updateRadius(),r.count=o.countVisibleElements(),t=0,n=a.data.length;t<n;t++)l[t]=s,i=o._computeAngle(t),u[t]=i,s+=i;for(t=0,n=d.length;t<n;++t)d[t]._options=o._resolveDataElementOptions(d[t],t),o.updateElement(d[t],t,e)},_updateRadius:function(){var e=this,t=e.chart,n=t.chartArea,i=t.options,o=Math.min(n.right-n.left,n.bottom-n.top);t.outerRadius=Math.max(o/2,0),t.innerRadius=Math.max(i.cutoutPercentage?t.outerRadius/100*i.cutoutPercentage:1,0),t.radiusLength=(t.outerRadius-t.innerRadius)/t.getVisibleDatasetCount(),e.outerRadius=t.outerRadius-t.radiusLength*e.index,e.innerRadius=e.outerRadius-t.radiusLength},updateElement:function(e,t,n){var i=this,o=i.chart,a=i.getDataset(),r=o.options,s=r.animation,l=o.scale,u=o.data.labels,d=l.xCenter,c=l.yCenter,p=r.startAngle,h=e.hidden?0:l.getDistanceFromCenterForValue(a.data[t]),f=i._starts[t],g=f+(e.hidden?0:i._angles[t]),m=s.animateScale?0:l.getDistanceFromCenterForValue(a.data[t]),v=e._options||{};O.extend(e,{_datasetIndex:i.index,_index:t,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:d,y:c,innerRadius:0,outerRadius:n?m:h,startAngle:n&&s.animateRotate?p:f,endAngle:n&&s.animateRotate?p:g,label:O.valueAtIndexOrDefault(u,t,u[t])}}),e.pivot()},countVisibleElements:function(){var e=this.getDataset(),t=this.getMeta(),n=0;return O.each(t.data,function(t,i){isNaN(e.data[i])||t.hidden||n++}),n},setHoverStyle:function(e){var t=e._model,n=e._options,i=O.getHoverColor,o=O.valueOrDefault;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=o(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=o(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=o(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(e){var t=this,n=this.getMeta().count,i=t.getDataset(),o=t.getMeta();if(isNaN(i.data[e])||o.data[e].hidden)return 0;var a={chart:t.chart,dataIndex:e,dataset:i,datasetIndex:t.index};return Fe([t.chart.options.elements.arc.angle,2*Math.PI/n],a,e)}});A._set("pie",O.clone(A.doughnut)),A._set("pie",{cutoutPercentage:0});var Ie=we,Me=O.valueOrDefault;A._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Te=K.extend({datasetElementType:le.Line,dataElementType:le.Point,linkScales:O.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,i=this,o=i.getMeta(),a=o.dataset,r=o.data||[],s=i.chart.scale,l=i._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),a._scale=s,a._datasetIndex=i.index,a._children=r,a._loop=!0,a._model=i._resolveDatasetElementOptions(a),a.pivot(),t=0,n=r.length;t<n;++t)i.updateElement(r[t],t,e);for(i.updateBezierControlPoints(),t=0,n=r.length;t<n;++t)r[t].pivot()},updateElement:function(e,t,n){var i=this,o=e.custom||{},a=i.getDataset(),r=i.chart.scale,s=r.getPointPositionForValue(t,a.data[t]),l=i._resolveDataElementOptions(e,t),u=i.getMeta().dataset._model,d=n?r.xCenter:s.x,c=n?r.yCenter:s.y;e._scale=r,e._options=l,e._datasetIndex=i.index,e._index=t,e._model={x:d,y:c,skip:o.skip||isNaN(d)||isNaN(c),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Me(o.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var e=this,t=e._config,n=e.chart.options,i=K.prototype._resolveDatasetElementOptions.apply(e,arguments);return i.spanGaps=Me(t.spanGaps,n.spanGaps),i.tension=Me(t.lineTension,n.elements.line.tension),i},updateBezierControlPoints:function(){function capControlPoint(e,t,n){return Math.max(Math.min(e,n),t)}var e,t,n,i,o=this,a=o.getMeta(),r=o.chart.chartArea,s=a.data||[];for(a.dataset._model.spanGaps&&(s=s.filter(function(e){return!e._model.skip})),e=0,t=s.length;e<t;++e)n=s[e]._model,i=O.splineCurve(O.previousItem(s,e,!0)._model,n,O.nextItem(s,e,!0)._model,n.tension),n.controlPointPreviousX=capControlPoint(i.previous.x,r.left,r.right),n.controlPointPreviousY=capControlPoint(i.previous.y,r.top,r.bottom),n.controlPointNextX=capControlPoint(i.next.x,r.left,r.right),n.controlPointNextY=capControlPoint(i.next.y,r.top,r.bottom)},setHoverStyle:function(e){var t=e._model,n=e._options,i=O.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Me(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=Me(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=Me(n.hoverBorderWidth,n.borderWidth),t.radius=Me(n.hoverRadius,n.radius)}});A._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(e){return"("+e.xLabel+", "+e.yLabel+")"}}}}),A._set("global",{datasets:{scatter:{showLine:!1}}});var Re=De,Ee={bar:ge,bubble:be,doughnut:we,horizontalBar:Ce,line:De,polarArea:Pe,pie:Ie,radar:Te,scatter:Re},Be={modes:{single:function(e,t){var n=getRelativePosition(t,e),i=[];return parseVisibleItems(e,function(e){if(e.inRange(n.x,n.y))return i.push(e),i}),i.slice(0,1)},label:indexMode,index:indexMode,dataset:function(e,t,n){var i=getRelativePosition(t,e);n.axis=n.axis||"xy";var o=getDistanceMetricForAxis(n.axis),a=n.intersect?getIntersectItems(e,i):getNearestItems(e,i,!1,o);return a.length>0&&(a=e.getDatasetMeta(a[0]._datasetIndex).data),a},"x-axis":function(e,t){return indexMode(e,t,{intersect:!1})},point:function(e,t){var n=getRelativePosition(t,e);return getIntersectItems(e,n)},nearest:function(e,t,n){var i=getRelativePosition(t,e);n.axis=n.axis||"xy";var o=getDistanceMetricForAxis(n.axis);return getNearestItems(e,i,n.intersect,o)},x:function(e,t,n){var i=getRelativePosition(t,e),o=[],a=!1;return parseVisibleItems(e,function(e){e.inXRange(i.x)&&o.push(e),e.inRange(i.x,i.y)&&(a=!0)}),n.intersect&&!a&&(o=[]),o},y:function(e,t,n){var i=getRelativePosition(t,e),o=[],a=!1;
11
11
  return parseVisibleItems(e,function(e){e.inYRange(i.y)&&o.push(e),e.inRange(i.x,i.y)&&(a=!0)}),n.intersect&&!a&&(o=[]),o}}},Oe=O.extend;A._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var Le={defaults:{},addBox:function(e,t){e.boxes||(e.boxes=[]),t.fullWidth=t.fullWidth||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw:function(){t.draw.apply(t,arguments)}}]},e.boxes.push(t)},removeBox:function(e,t){var n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure:function(e,t,n){for(var i,o=["fullWidth","position","weight"],a=o.length,r=0;r<a;++r)i=o[r],n.hasOwnProperty(i)&&(t[i]=n[i])},update:function(e,t,n){if(e){var i=e.options.layout||{},o=O.options.toPadding(i.padding),a=t-o.width,r=n-o.height,s=buildLayoutBoxes(e.boxes),l=s.vertical,u=s.horizontal,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:a,vBoxMaxWidth:a/2/l.length,hBoxMaxHeight:r/2}),c=Oe({maxPadding:Oe({},o),w:a,h:r,x:o.left,y:o.top},o);setLayoutDims(l.concat(u),d),fitBoxes(l,c,d),fitBoxes(u,c,d)&&fitBoxes(l,c,d),handleMaxPadding(c),placeBoxes(s.leftAndTop,c,d),c.x+=c.w,c.y+=c.h,placeBoxes(s.rightAndBottom,c,d),e.chartArea={left:c.left,top:c.top,right:c.left+c.w,bottom:c.top+c.h},O.each(s.chartArea,function(t){var n=t.box;Oe(n,e.chartArea),n.update(c.w,c.h)})}}},ze={acquireContext:function(e){return e&&e.canvas&&(e=e.canvas),e&&e.getContext("2d")||null}},Ne="/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n",Ue=Object.freeze({__proto__:null,default:Ne}),He=getCjsExportFromNamespace(Ue),je="$chartjs",Ve="chartjs-",We=Ve+"size-monitor",Ge=Ve+"render-monitor",Xe=Ve+"render-animation",$e=["animationstart","webkitAnimationStart"],Ye={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Je=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch(n){}return e}(),Ke=!!Je&&{passive:!0},Ze={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(e){if(!this.disableCSSInjection){var t=e.getRootNode?e.getRootNode():document,n=t.host?t:document.head;injectCSS(n,He)}},acquireContext:function(e,t){"string"==typeof e?e=document.getElementById(e):e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas);var n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(this._ensureLoaded(e),initCanvas(e,t),n):null},releaseContext:function(e){var t=e.canvas;if(t[je]){var n=t[je].initial;["height","width"].forEach(function(e){var i=n[e];O.isNullOrUndef(i)?t.removeAttribute(e):t.setAttribute(e,i)}),O.each(n.style||{},function(e,n){t.style[n]=e}),t.width=t.width,delete t[je]}},addEventListener:function(e,t,n){var i=e.canvas;if("resize"===t)return void addResizeListener(i,n,e);var o=n[je]||(n[je]={}),a=o.proxies||(o.proxies={}),r=a[e.id+"_"+t]=function(t){n(fromNativeEvent(t,e))};addListener(i,t,r)},removeEventListener:function(e,t,n){var i=e.canvas;if("resize"===t)return void removeResizeListener(i);var o=n[je]||{},a=o.proxies||{},r=a[e.id+"_"+t];r&&removeListener(i,t,r)}};O.addEvent=addListener,O.removeEvent=removeListener;var Qe=Ze._enabled?Ze:ze,et=O.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},Qe);A._set("global",{plugins:{}});var tt={_plugins:[],_cacheId:0,register:function(e){var t=this._plugins;[].concat(e).forEach(function(e){t.indexOf(e)===-1&&t.push(e)}),this._cacheId++},unregister:function(e){var t=this._plugins;[].concat(e).forEach(function(e){var n=t.indexOf(e);n!==-1&&t.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(e,t,n){var i,o,a,r,s,l=this.descriptors(e),u=l.length;for(i=0;i<u;++i)if(o=l[i],a=o.plugin,s=a[t],"function"==typeof s&&(r=[e].concat(n||[]),r.push(o.options),s.apply(a,r)===!1))return!1;return!0},descriptors:function(e){var t=e.$plugins||(e.$plugins={});if(t.id===this._cacheId)return t.descriptors;var n=[],i=[],o=e&&e.config||{},a=o.options&&o.options.plugins||{};return this._plugins.concat(o.plugins||[]).forEach(function(e){var t=n.indexOf(e);if(t===-1){var o=e.id,r=a[o];r!==!1&&(r===!0&&(r=O.clone(A.global.plugins[o])),n.push(e),i.push({plugin:e,options:r||{}}))}}),t.descriptors=i,t.id=this._cacheId,i},_invalidate:function(e){delete e.$plugins}},nt={constructors:{},defaults:{},registerScaleType:function(e,t,n){this.constructors[e]=t,this.defaults[e]=O.clone(n)},getScaleConstructor:function(e){return this.constructors.hasOwnProperty(e)?this.constructors[e]:void 0},getScaleDefaults:function(e){return this.defaults.hasOwnProperty(e)?O.merge(Object.create(null),[A.scale,this.defaults[e]]):{}},updateScaleDefaults:function(e,t){var n=this;n.defaults.hasOwnProperty(e)&&(n.defaults[e]=O.extend(n.defaults[e],t))},addScalesToLayout:function(e){O.each(e.scales,function(t){t.fullWidth=t.options.fullWidth,t.position=t.options.position,t.weight=t.options.weight,Le.addBox(e,t)})}},it=O.valueOrDefault,ot=O.rtl.getRtlAdapter;A._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:O.noop,title:function(e,t){var n="",i=t.labels,o=i?i.length:0;if(e.length>0){var a=e[0];a.label?n=a.label:a.xLabel?n=a.xLabel:o>0&&a.index<o&&(n=i[a.index])}return n},afterTitle:O.noop,beforeBody:O.noop,beforeLabel:O.noop,label:function(e,t){var n=t.datasets[e.datasetIndex].label||"";return n&&(n+=": "),n+=O.isNullOrUndef(e.value)?e.yLabel:e.value},labelColor:function(e,t){var n=t.getDatasetMeta(e.datasetIndex),i=n.data[e.index],o=i._view;return{borderColor:o.borderColor,backgroundColor:o.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:O.noop,afterBody:O.noop,beforeFooter:O.noop,footer:O.noop,afterFooter:O.noop}}});var at={average:function(e){if(!e.length)return!1;var t,n,i=0,o=0,a=0;for(t=0,n=e.length;t<n;++t){var r=e[t];if(r&&r.hasValue()){var s=r.tooltipPosition();i+=s.x,o+=s.y,++a}}return{x:i/a,y:o/a}},nearest:function(e,t){var n,i,o,a=t.x,r=t.y,s=Number.POSITIVE_INFINITY;for(n=0,i=e.length;n<i;++n){var l=e[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),d=O.distanceBetweenPoints(t,u);d<s&&(s=d,o=l)}}if(o){var c=o.tooltipPosition();a=c.x,r=c.y}return{x:a,y:r}}},rt=V.extend({initialize:function(){this._model=getBaseModel(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options,n=t.callbacks,i=n.beforeTitle.apply(e,arguments),o=n.title.apply(e,arguments),a=n.afterTitle.apply(e,arguments),r=[];return r=pushOrConcat(r,splitNewlines(i)),r=pushOrConcat(r,splitNewlines(o)),r=pushOrConcat(r,splitNewlines(a))},getBeforeBody:function(){return getBeforeAfterBodyLines(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,i=n._options.callbacks,o=[];return O.each(e,function(e){var a={before:[],lines:[],after:[]};pushOrConcat(a.before,splitNewlines(i.beforeLabel.call(n,e,t))),pushOrConcat(a.lines,i.label.call(n,e,t)),pushOrConcat(a.after,splitNewlines(i.afterLabel.call(n,e,t))),o.push(a)}),o},getAfterBody:function(){return getBeforeAfterBodyLines(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),i=t.footer.apply(e,arguments),o=t.afterFooter.apply(e,arguments),a=[];return a=pushOrConcat(a,splitNewlines(n)),a=pushOrConcat(a,splitNewlines(i)),a=pushOrConcat(a,splitNewlines(o))},update:function(e){var t,n,i=this,o=i._options,a=i._model,r=i._model=getBaseModel(o),s=i._active,l=i._data,u={xAlign:a.xAlign,yAlign:a.yAlign},d={x:a.x,y:a.y},c={width:a.width,height:a.height},p={x:a.caretX,y:a.caretY};if(s.length){r.opacity=1;var h=[],f=[];p=at[o.position].call(i,s,i._eventPosition);var g=[];for(t=0,n=s.length;t<n;++t)g.push(createTooltipItem(s[t]));o.filter&&(g=g.filter(function(e){return o.filter(e,l)})),o.itemSort&&(g=g.sort(function(e,t){return o.itemSort(e,t,l)})),O.each(g,function(e){h.push(o.callbacks.labelColor.call(i,e,i._chart)),f.push(o.callbacks.labelTextColor.call(i,e,i._chart))}),r.title=i.getTitle(g,l),r.beforeBody=i.getBeforeBody(g,l),r.body=i.getBody(g,l),r.afterBody=i.getAfterBody(g,l),r.footer=i.getFooter(g,l),r.x=p.x,r.y=p.y,r.caretPadding=o.caretPadding,r.labelColors=h,r.labelTextColors=f,r.dataPoints=g,c=getTooltipSize(this,r),u=determineAlignment(this,c),d=getBackgroundPoint(r,c,u,i._chart)}else r.opacity=0;return r.xAlign=u.xAlign,r.yAlign=u.yAlign,r.x=d.x,r.y=d.y,r.width=c.width,r.height=c.height,r.caretX=p.x,r.caretY=p.y,i._model=r,e&&o.custom&&o.custom.call(i,r),i},drawCaret:function(e,t){var n=this._chart.ctx,i=this._view,o=this.getCaretPosition(e,t,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)},getCaretPosition:function(e,t,n){var i,o,a,r,s,l,u=n.caretSize,d=n.cornerRadius,c=n.xAlign,p=n.yAlign,h=e.x,f=e.y,g=t.width,m=t.height;if("center"===p)s=f+m/2,"left"===c?(i=h,o=i-u,a=i,r=s+u,l=s-u):(i=h+g,o=i+u,a=i,r=s-u,l=s+u);else if("left"===c?(o=h+d+u,i=o-u,a=o+u):"right"===c?(o=h+g-d-u,i=o-u,a=o+u):(o=n.caretX,i=o-u,a=o+u),"top"===p)r=f,s=r-u,l=r;else{r=f+m,s=r+u,l=r;var v=a;a=i,i=v}return{x1:i,x2:o,x3:a,y1:r,y2:s,y3:l}},drawTitle:function(e,t,n){var i,o,a,r=t.title,s=r.length;if(s){var l=ot(t.rtl,t.x,t.width);for(e.x=getAlignedX(t,t._titleAlign),n.textAlign=l.textAlign(t._titleAlign),n.textBaseline="middle",i=t.titleFontSize,o=t.titleSpacing,n.fillStyle=t.titleFontColor,n.font=O.fontString(i,t._titleFontStyle,t._titleFontFamily),a=0;a<s;++a)n.fillText(r[a],l.x(e.x),e.y+i/2),e.y+=i+o,a+1===s&&(e.y+=t.titleMarginBottom-o)}},drawBody:function(e,t,n){var i,o,a,r,s,l,u,d,c=t.bodyFontSize,p=t.bodySpacing,h=t._bodyAlign,f=t.body,g=t.displayColors,m=0,v=g?getAlignedX(t,"left"):0,b=ot(t.rtl,t.x,t.width),x=function(t){n.fillText(t,b.x(e.x+m),e.y+c/2),e.y+=c+p},_=b.textAlign(h);for(n.textAlign=h,n.textBaseline="middle",n.font=O.fontString(c,t._bodyFontStyle,t._bodyFontFamily),e.x=getAlignedX(t,_),n.fillStyle=t.bodyFontColor,O.each(t.beforeBody,x),m=g&&"right"!==_?"center"===h?c/2+1:c+2:0,s=0,u=f.length;s<u;++s){for(i=f[s],o=t.labelTextColors[s],a=t.labelColors[s],n.fillStyle=o,O.each(i.before,x),r=i.lines,l=0,d=r.length;l<d;++l){if(g){var q=b.x(v);n.fillStyle=t.legendColorBackground,n.fillRect(b.leftForLtr(q,c),e.y,c,c),n.lineWidth=1,n.strokeStyle=a.borderColor,n.strokeRect(b.leftForLtr(q,c),e.y,c,c),n.fillStyle=a.backgroundColor,n.fillRect(b.leftForLtr(b.xPlus(q,1),c-2),e.y+1,c-2,c-2),n.fillStyle=o}x(r[l])}O.each(i.after,x)}m=0,O.each(t.afterBody,x),e.y-=p},drawFooter:function(e,t,n){var i,o,a=t.footer,r=a.length;if(r){var s=ot(t.rtl,t.x,t.width);for(e.x=getAlignedX(t,t._footerAlign),e.y+=t.footerMarginTop,n.textAlign=s.textAlign(t._footerAlign),n.textBaseline="middle",i=t.footerFontSize,n.fillStyle=t.footerFontColor,n.font=O.fontString(i,t._footerFontStyle,t._footerFontFamily),o=0;o<r;++o)n.fillText(a[o],s.x(e.x),e.y+i/2),e.y+=i+t.footerSpacing}},drawBackground:function(e,t,n,i){n.fillStyle=t.backgroundColor,n.strokeStyle=t.borderColor,n.lineWidth=t.borderWidth;var o=t.xAlign,a=t.yAlign,r=e.x,s=e.y,l=i.width,u=i.height,d=t.cornerRadius;n.beginPath(),n.moveTo(r+d,s),"top"===a&&this.drawCaret(e,i),n.lineTo(r+l-d,s),n.quadraticCurveTo(r+l,s,r+l,s+d),"center"===a&&"right"===o&&this.drawCaret(e,i),n.lineTo(r+l,s+u-d),n.quadraticCurveTo(r+l,s+u,r+l-d,s+u),"bottom"===a&&this.drawCaret(e,i),n.lineTo(r+d,s+u),n.quadraticCurveTo(r,s+u,r,s+u-d),"center"===a&&"left"===o&&this.drawCaret(e,i),n.lineTo(r,s+d),n.quadraticCurveTo(r,s,r+d,s),n.closePath(),n.fill(),t.borderWidth>0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var n={width:t.width,height:t.height},i={x:t.x,y:t.y},o=Math.abs(t.opacity<.001)?0:t.opacity,a=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length;this._options.enabled&&a&&(e.save(),e.globalAlpha=o,this.drawBackground(i,t,e,n),i.y+=t.yPadding,O.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(i,t,e),this.drawBody(i,t,e),this.drawFooter(i,t,e),O.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t=this,n=t._options,i=!1;return t._lastActive=t._lastActive||[],"mouseout"===e.type?t._active=[]:(t._active=t._chart.getElementsAtEventForMode(e,n.mode,n),n.reverse&&t._active.reverse()),i=!O.arrayEquals(t._active,t._lastActive),i&&(t._lastActive=t._active,(n.enabled||n.custom)&&(t._eventPosition={x:e.x,y:e.y},t.update(!0),t.pivot())),i}}),st=at,lt=rt;lt.positioners=st;var ut=O.valueOrDefault;A._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var dt=function(e,t){return this.construct(e,t),this};O.extend(dt.prototype,{construct:function(e,t){var n=this;t=initConfig(t);var i=et.acquireContext(e,t),o=i&&i.canvas,a=o&&o.height,r=o&&o.width;return n.id=O.uid(),n.ctx=i,n.canvas=o,n.config=t,n.width=r,n.height=a,n.aspectRatio=a?r/a:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,dt.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),i&&o?(n.initialize(),void n.update()):void console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return tt.notify(e,"beforeInit"),O.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),tt.notify(e,"afterInit"),e},clear:function(){return O.canvas.clear(this),this},stop:function(){return X.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,i=t.canvas,o=n.maintainAspectRatio&&t.aspectRatio||null,a=Math.max(0,Math.floor(O.getMaximumWidth(i))),r=Math.max(0,Math.floor(o?a/o:O.getMaximumHeight(i)));if((t.width!==a||t.height!==r)&&(i.width=t.width=a,i.height=t.height=r,i.style.width=a+"px",i.style.height=r+"px",O.retinaScale(t,n.devicePixelRatio),!e)){var s={width:a,height:r};tt.notify(t,"resize",[s]),n.onResize&&n.onResize(t,s),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;O.each(t.xAxes,function(e,n){e.id||(e.id=nextAvailableScaleId(t.xAxes,"x-axis-",n))}),O.each(t.yAxes,function(e,n){e.id||(e.id=nextAvailableScaleId(t.yAxes,"y-axis-",n))}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},i=[],o=Object.keys(n).reduce(function(e,t){return e[t]=!1,e},{});t.scales&&(i=i.concat((t.scales.xAxes||[]).map(function(e){return{options:e,dtype:"category",dposition:"bottom"}}),(t.scales.yAxes||[]).map(function(e){return{options:e,dtype:"linear",dposition:"left"}}))),t.scale&&i.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),O.each(i,function(t){var i=t.options,a=i.id,r=ut(i.type,t.dtype);positionIsHorizontal(i.position)!==positionIsHorizontal(t.dposition)&&(i.position=t.dposition),o[a]=!0;var s=null;if(a in n&&n[a].type===r)s=n[a],s.options=i,s.ctx=e.ctx,s.chart=e;else{var l=nt.getScaleConstructor(r);if(!l)return;s=new l({id:a,type:r,options:i,ctx:e.ctx,chart:e}),n[s.id]=s}s.mergeTicksOptions(),t.isDefault&&(e.scale=s)}),O.each(o,function(e,t){e||delete n[t]}),e.scales=n,nt.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,i=[],o=n.data.datasets;for(e=0,t=o.length;e<t;e++){var a=o[e],r=n.getDatasetMeta(e),s=a.type||n.config.type;if(r.type&&r.type!==s&&(n.destroyDatasetMeta(e),r=n.getDatasetMeta(e)),r.type=s,r.order=a.order||0,r.index=e,r.controller)r.controller.updateIndex(e),r.controller.linkScales();else{var l=Ee[r.type];if(void 0===l)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new l(n,e),i.push(r.controller)}}return i},resetElements:function(){var e=this;O.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.reset()},e)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(e){var t,n,i=this;if(e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]}),updateConfig(i),tt._invalidate(i),tt.notify(i,"beforeUpdate")!==!1){i.tooltip._data=i.data;var o=i.buildOrUpdateControllers();for(t=0,n=i.data.datasets.length;t<n;t++)i.getDatasetMeta(t).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&O.each(o,function(e){e.reset()}),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],tt.notify(i,"afterUpdate"),i._layers.sort(compare2Level("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:e.duration,easing:e.easing,lazy:e.lazy}:i.render(e)}},updateLayout:function(){var e=this;tt.notify(e,"beforeLayout")!==!1&&(Le.update(this,this.width,this.height),e._layers=[],O.each(e.boxes,function(t){t._configure&&t._configure(),e._layers.push.apply(e._layers,t._layers())},e),e._layers.forEach(function(e,t){e._idx=t}),tt.notify(e,"afterScaleUpdate"),tt.notify(e,"afterLayout"))},updateDatasets:function(){var e=this;if(tt.notify(e,"beforeDatasetsUpdate")!==!1){for(var t=0,n=e.data.datasets.length;t<n;++t)e.updateDataset(t);tt.notify(e,"afterDatasetsUpdate")}},updateDataset:function(e){var t=this,n=t.getDatasetMeta(e),i={meta:n,index:e};tt.notify(t,"beforeDatasetUpdate",[i])!==!1&&(n.controller._update(),tt.notify(t,"afterDatasetUpdate",[i]))},render:function(e){var t=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var n=t.options.animation,i=ut(e.duration,n&&n.duration),o=e.lazy;if(tt.notify(t,"beforeRender")!==!1){var a=function(e){tt.notify(t,"afterRender"),O.callback(n&&n.onComplete,[e],t)};if(n&&i){var r=new G({numSteps:i/16.66,easing:e.easing||n.easing,render:function(e,t){var n=O.easing.effects[t.easing],i=t.currentStep,o=i/t.numSteps;e.draw(n(o),o,i)},onAnimationProgress:n.onProgress,onAnimationComplete:a});X.addAnimation(t,r,i,o)}else t.draw(),a(new G({numSteps:0,chart:t}));return t}},draw:function(e){var t,n,i=this;if(i.clear(),O.isNullOrUndef(e)&&(e=1),i.transition(e),!(i.width<=0||i.height<=0)&&tt.notify(i,"beforeDraw",[e])!==!1){for(n=i._layers,t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(i.chartArea);for(i.drawDatasets(e);t<n.length;++t)n[t].draw(i.chartArea);i._drawTooltip(e),tt.notify(i,"afterDraw",[e])}},transition:function(e){for(var t=this,n=0,i=(t.data.datasets||[]).length;n<i;++n)t.isDatasetVisible(n)&&t.getDatasetMeta(n).controller.transition(e);t.tooltip.transition(e)},_getSortedDatasetMetas:function(e){var t,n,i=this,o=i.data.datasets||[],a=[];for(t=0,n=o.length;t<n;++t)e&&!i.isDatasetVisible(t)||a.push(i.getDatasetMeta(t));return a.sort(compare2Level("order","index")),a},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(e){var t,n,i=this;if(tt.notify(i,"beforeDatasetsDraw",[e])!==!1){for(t=i._getSortedVisibleDatasetMetas(),n=t.length-1;n>=0;--n)i.drawDataset(t[n],e);tt.notify(i,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n=this,i={meta:e,index:e.index,easingValue:t};tt.notify(n,"beforeDatasetDraw",[i])!==!1&&(e.controller.draw(t),tt.notify(n,"afterDatasetDraw",[i]))},_drawTooltip:function(e){var t=this,n=t.tooltip,i={tooltip:n,easingValue:e};tt.notify(t,"beforeTooltipDraw",[i])!==!1&&(n.draw(),tt.notify(t,"afterTooltipDraw",[i]))},getElementAtEvent:function(e){return Be.modes.single(this,e)},getElementsAtEvent:function(e){return Be.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Be.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var i=Be.modes[t];return"function"==typeof i?i(this,e,n):[]},getDatasetAtEvent:function(e){return Be.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,n=t.data.datasets[e];n._meta||(n._meta={});var i=n._meta[t.id];return i||(i=n._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:e}),i},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t<n;++t)this.isDatasetVisible(t)&&e++;return e},isDatasetVisible:function(e){var t=this.getDatasetMeta(e);return"boolean"==typeof t.hidden?!t.hidden:!this.data.datasets[e].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(e){var t=this.id,n=this.data.datasets[e],i=n._meta&&n._meta[t];i&&(i.controller.destroy(),delete n._meta[t])},destroy:function(){var e,t,n=this,i=n.canvas;for(n.stop(),e=0,t=n.data.datasets.length;e<t;++e)n.destroyDatasetMeta(e);i&&(n.unbindEvents(),O.canvas.clear(n),et.releaseContext(n.ctx),n.canvas=null,n.ctx=null),tt.notify(n,"destroy"),delete dt.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new lt({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var e=this,t=e._listeners={},n=function(){e.eventHandler.apply(e,arguments)};O.each(e.options.events,function(i){et.addEventListener(e,i,n),t[i]=n}),e.options.responsive&&(n=function(){e.resize()},et.addEventListener(e,"resize",n),t.resize=n)},unbindEvents:function(){var e=this,t=e._listeners;t&&(delete e._listeners,O.each(t,function(t,n){et.removeEventListener(e,n,t)}))},updateHoverStyle:function(e,t,n){var i,o,a,r=n?"set":"remove";for(o=0,a=e.length;o<a;++o)i=e[o],i&&this.getDatasetMeta(i._datasetIndex).controller[r+"HoverStyle"](i);"dataset"===t&&this.getDatasetMeta(e[0]._datasetIndex).controller["_"+r+"DatasetHoverStyle"]()},eventHandler:function(e){var t=this,n=t.tooltip;if(tt.notify(t,"beforeEvent",[e])!==!1){t._bufferedRender=!0,t._bufferedRequest=null;var i=t.handleEvent(e);n&&(i=n._start?n.handleEvent(e):i|n.handleEvent(e)),tt.notify(t,"afterEvent",[e]);var o=t._bufferedRequest;return o?t.render(o):i&&!t.animating&&(t.stop(),t.render({duration:t.options.hover.animationDuration,lazy:!0})),t._bufferedRender=!1,t._bufferedRequest=null,t}},handleEvent:function(e){var t=this,n=t.options||{},i=n.hover,o=!1;return t.lastActive=t.lastActive||[],"mouseout"===e.type?t.active=[]:t.active=t.getElementsAtEventForMode(e,i.mode,i),O.callback(n.onHover||n.hover.onHover,[e.native,t.active],t),"mouseup"!==e.type&&"click"!==e.type||n.onClick&&n.onClick.call(t,e.native,t.active),t.lastActive.length&&t.updateHoverStyle(t.lastActive,i.mode,!1),t.active.length&&i.mode&&t.updateHoverStyle(t.active,i.mode,!0),o=!O.arrayEquals(t.active,t.lastActive),t.lastActive=t.active,o}}),dt.instances={};var ct=dt;dt.Controller=dt,dt.types={},O.configMerge=mergeConfig,O.scaleMerge=mergeScaleConfig;var pt=function(){function parseMaxStyle(e,t,n){var i;return"string"==typeof e?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}function isConstrainedValue(e){return void 0!==e&&null!==e&&"none"!==e}function getConstraintDimension(e,t,n){var i=document.defaultView,o=O._getParentNode(e),a=i.getComputedStyle(e)[t],r=i.getComputedStyle(o)[t],s=isConstrainedValue(a),l=isConstrainedValue(r),u=Number.POSITIVE_INFINITY;return s||l?Math.min(s?parseMaxStyle(a,e,n):u,l?parseMaxStyle(r,o,n):u):"none"}O.where=function(e,t){if(O.isArray(e)&&Array.prototype.filter)return e.filter(t);var n=[];return O.each(e,function(e){t(e)&&n.push(e)}),n},O.findIndex=Array.prototype.findIndex?function(e,t,n){return e.findIndex(t,n)}:function(e,t,n){n=void 0===n?e:n;for(var i=0,o=e.length;i<o;++i)if(t.call(n,e[i],i,e))return i;return-1},O.findNextWhere=function(e,t,n){O.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<e.length;i++){var o=e[i];if(t(o))return o}},O.findPreviousWhere=function(e,t,n){O.isNullOrUndef(n)&&(n=e.length);for(var i=n-1;i>=0;i--){var o=e[i];if(t(o))return o}},O.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},O.almostEquals=function(e,t,n){return Math.abs(e-t)<n},O.almostWhole=function(e,t){var n=Math.round(e);return n-t<=e&&n+t>=e},O.max=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.max(e,t)},Number.NEGATIVE_INFINITY)},O.min=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.min(e,t)},Number.POSITIVE_INFINITY)},O.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return e=+e,0===e||isNaN(e)?e:e>0?1:-1},O.toRadians=function(e){return e*(Math.PI/180)},O.toDegrees=function(e){return e*(180/Math.PI)},O._decimalPlaces=function(e){if(O.isFinite(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}},O.getAngleFromPoint=function(e,t){var n=t.x-e.x,i=t.y-e.y,o=Math.sqrt(n*n+i*i),a=Math.atan2(i,n);return a<-.5*Math.PI&&(a+=2*Math.PI),{angle:a,distance:o}},O.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},O.aliasPixel=function(e){return e%2===0?0:.5},O._alignPixel=function(e,t,n){var i=e.currentDevicePixelRatio,o=n/2;return Math.round((t-o)*i)/i+o},O.splineCurve=function(e,t,n,i){var o=e.skip?t:e,a=t,r=n.skip?t:n,s=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),l=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),u=s/(s+l),d=l/(s+l);u=isNaN(u)?0:u,d=isNaN(d)?0:d;var c=i*u,p=i*d;return{previous:{x:a.x-c*(r.x-o.x),y:a.y-c*(r.y-o.y)},next:{x:a.x+p*(r.x-o.x),y:a.y+p*(r.y-o.y)}}},O.EPSILON=Number.EPSILON||1e-14,O.splineCurveMonotone=function(e){var t,n,i,o,a=(e||[]).map(function(e){return{model:e._model,deltaK:0,mK:0}}),r=a.length;for(t=0;t<r;++t)if(i=a[t],!i.model.skip){if(n=t>0?a[t-1]:null,o=t<r-1?a[t+1]:null,o&&!o.model.skip){var s=o.model.x-i.model.x;i.deltaK=0!==s?(o.model.y-i.model.y)/s:0}!n||n.model.skip?i.mK=i.deltaK:!o||o.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}var l,u,d,c;for(t=0;t<r-1;++t)i=a[t],o=a[t+1],i.model.skip||o.model.skip||(O.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=o.mK=0:(l=i.mK/i.deltaK,u=o.mK/i.deltaK,c=Math.pow(l,2)+Math.pow(u,2),c<=9||(d=3/Math.sqrt(c),i.mK=l*d*i.deltaK,o.mK=u*d*i.deltaK)));var p;for(t=0;t<r;++t)i=a[t],i.model.skip||(n=t>0?a[t-1]:null,o=t<r-1?a[t+1]:null,n&&!n.model.skip&&(p=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-p,i.model.controlPointPreviousY=i.model.y-p*i.mK),o&&!o.model.skip&&(p=(o.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+p,i.model.controlPointNextY=i.model.y+p*i.mK))},O.nextItem=function(e,t,n){return n?t>=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},O.previousItem=function(e,t,n){return n?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},O.niceNum=function(e,t){var n,i=Math.floor(O.log10(e)),o=e/Math.pow(10,i);return n=t?o<1.5?1:o<3?2:o<7?5:10:o<=1?1:o<=2?2:o<=5?5:10,n*Math.pow(10,i)},O.requestAnimFrame=function(){return"undefined"==typeof window?function(e){e()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)}}(),O.getRelativePosition=function(e,t){var n,i,o=e.originalEvent||e,a=e.target||e.srcElement,r=a.getBoundingClientRect(),s=o.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=o.clientX,i=o.clientY);var l=parseFloat(O.getStyle(a,"padding-left")),u=parseFloat(O.getStyle(a,"padding-top")),d=parseFloat(O.getStyle(a,"padding-right")),c=parseFloat(O.getStyle(a,"padding-bottom")),p=r.right-r.left-l-d,h=r.bottom-r.top-u-c;return n=Math.round((n-r.left-l)/p*a.width/t.currentDevicePixelRatio),i=Math.round((i-r.top-u)/h*a.height/t.currentDevicePixelRatio),{x:n,y:i}},O.getConstraintWidth=function(e){return getConstraintDimension(e,"max-width","clientWidth")},O.getConstraintHeight=function(e){return getConstraintDimension(e,"max-height","clientHeight")},O._calculatePadding=function(e,t,n){return t=O.getStyle(e,t),t.indexOf("%")>-1?n*parseInt(t,10)/100:parseInt(t,10)},O._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},O.getMaximumWidth=function(e){var t=O._getParentNode(e);if(!t)return e.clientWidth;var n=t.clientWidth,i=O._calculatePadding(t,"padding-left",n),o=O._calculatePadding(t,"padding-right",n),a=n-i-o,r=O.getConstraintWidth(e);return isNaN(r)?a:Math.min(a,r)},O.getMaximumHeight=function(e){var t=O._getParentNode(e);if(!t)return e.clientHeight;var n=t.clientHeight,i=O._calculatePadding(t,"padding-top",n),o=O._calculatePadding(t,"padding-bottom",n),a=n-i-o,r=O.getConstraintHeight(e);return isNaN(r)?a:Math.min(a,r)},O.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},O.retinaScale=function(e,t){var n=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=e.canvas,o=e.height,a=e.width;i.height=o*n,i.width=a*n,e.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=o+"px",i.style.width=a+"px")}},O.fontString=function(e,t,n){return t+" "+e+"px "+n},O.longestText=function(e,t,n,i){i=i||{};var o=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(o=i.data={},a=i.garbageCollect=[],i.font=t),e.font=t;var r,s,l,u,d,c=0,p=n.length;for(r=0;r<p;r++)if(u=n[r],void 0!==u&&null!==u&&O.isArray(u)!==!0)c=O.measureText(e,o,a,c,u);else if(O.isArray(u))for(s=0,l=u.length;s<l;s++)d=u[s],void 0===d||null===d||O.isArray(d)||(c=O.measureText(e,o,a,c,d));var h=a.length/2;if(h>n.length){for(r=0;r<h;r++)delete o[a[r]];a.splice(0,h)}return c},O.measureText=function(e,t,n,i,o){var a=t[o];return a||(a=t[o]=e.measureText(o).width,n.push(o)),a>i&&(i=a),i},O.numberOfLabelLines=function(e){var t=1;return O.each(e,function(e){O.isArray(e)&&e.length>t&&(t=e.length)}),t},O.color=p?function(e){return e instanceof CanvasGradient&&(e=A.global.defaultColor),p(e)}:function(e){return console.error("Color.js not found!"),e},O.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:O.color(e).saturate(.5).darken(.1).rgbString()}};O.extend(DateAdapter.prototype,{formats:abstract,parse:abstract,format:abstract,add:abstract,diff:abstract,startOf:abstract,endOf:abstract,_create:function(e){return e}}),DateAdapter.override=function(e){O.extend(DateAdapter.prototype,e)};var ht=DateAdapter,ft={_date:ht},gt={formatters:{values:function(e){return O.isArray(e)?e:""+e},linear:function(e,t,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&e!==Math.floor(e)&&(i=e-Math.floor(e));var o=O.log10(Math.abs(i)),a="";if(0!==e){var r=Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]));if(r<1e-4){var s=O.log10(Math.abs(e)),l=Math.floor(s)-Math.floor(o);
12
12
  l=Math.max(Math.min(l,20),0),a=e.toExponential(l)}else{var u=-1*Math.floor(o);u=Math.max(Math.min(u,20),0),a=e.toFixed(u)}}else a="0";return a},logarithmic:function(e,t,n){var i=e/Math.pow(10,Math.floor(O.log10(e)));return 0===e?"0":1===i||2===i||5===i||0===t||t===n.length-1?e.toExponential():""}}},mt=O.isArray,vt=O.isNullOrUndef,bt=O.valueOrDefault,xt=O.valueAtIndexOrDefault;A._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:gt.formatters.values,minor:{},major:{}}});var _t=V.extend({zeroLineIndex:0,getPadding:function(){var e=this;return{left:e.paddingLeft||0,top:e.paddingTop||0,right:e.paddingRight||0,bottom:e.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){O.callback(this.options.beforeUpdate,[this])},update:function(e,t,n){var i,o,a,r,s,l=this,u=l.options.ticks,d=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=e,l.maxHeight=t,l.margins=O.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),r=l.buildTicks()||[],r=l.afterBuildTicks(r)||r,(!r||!r.length)&&l.ticks)for(r=[],i=0,o=l.ticks.length;i<o;++i)r.push({value:l.ticks[i],major:!1});return l._ticks=r,s=d<r.length,a=l._convertTicksToLabels(s?sample(r,d):r),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(r):r,s&&(a=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=a,l.afterUpdate(),l.minSize},_configure:function(){var e,t,n=this,i=n.options.ticks.reverse;n.isHorizontal()?(e=n.left,t=n.right):(e=n.top,t=n.bottom,i=!i),n._startPixel=e,n._endPixel=t,n._reversePixels=i,n._length=t-e},afterUpdate:function(){O.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){O.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0},afterSetDimensions:function(){O.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){O.callback(this.options.beforeDataLimits,[this])},determineDataLimits:O.noop,afterDataLimits:function(){O.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){O.callback(this.options.beforeBuildTicks,[this])},buildTicks:O.noop,afterBuildTicks:function(e){var t=this;return mt(e)&&e.length?O.callback(t.options.afterBuildTicks,[t,e]):(t.ticks=O.callback(t.options.afterBuildTicks,[t,t.ticks])||t.ticks,e)},beforeTickToLabelConversion:function(){O.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var e=this,t=e.options.ticks;e.ticks=e.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){O.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){O.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var e,t,n,i,o,a,r,s=this,l=s.options,u=l.ticks,d=s.getTicks().length,c=u.minRotation||0,p=u.maxRotation,h=c;return!s._isVisible()||!u.display||c>=p||d<=1||!s.isHorizontal()?void(s.labelRotation=c):(e=s._getLabelSizes(),t=e.widest.width,n=e.highest.height-e.highest.offset,i=Math.min(s.maxWidth,s.chart.width-t),o=l.offset?s.maxWidth/d:i/(d-1),t+6>o&&(o=i/(d-(l.offset?.5:1)),a=s.maxHeight-getTickMarkLength(l.gridLines)-u.padding-getScaleLabelHeight(l.scaleLabel),r=Math.sqrt(t*t+n*n),h=O.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/o,1)),Math.asin(Math.min(a/r,1))-Math.asin(n/r))),h=Math.max(c,Math.min(p,h))),void(s.labelRotation=h))},afterCalculateTickRotation:function(){O.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){O.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,i=e.options,o=i.ticks,a=i.scaleLabel,r=i.gridLines,s=e._isVisible(),l="bottom"===i.position,u=e.isHorizontal();if(u?t.width=e.maxWidth:s&&(t.width=getTickMarkLength(r)+getScaleLabelHeight(a)),u?s&&(t.height=getTickMarkLength(r)+getScaleLabelHeight(a)):t.height=e.maxHeight,o.display&&s){var d=parseTickFontOptions(o),c=e._getLabelSizes(),p=c.first,h=c.last,f=c.widest,g=c.highest,m=.4*d.minor.lineHeight,v=o.padding;if(u){var b=0!==e.labelRotation,x=O.toRadians(e.labelRotation),_=Math.cos(x),q=Math.sin(x),y=q*f.width+_*(g.height-(b?g.offset:0))+(b?0:m);t.height=Math.min(e.maxHeight,t.height+y+v);var w,C,S=e.getPixelForTick(0)-e.left,A=e.right-e.getPixelForTick(e.getTicks().length-1);b?(w=l?_*p.width+q*p.offset:q*(p.height-p.offset),C=l?q*(h.height-h.offset):_*h.width+q*h.offset):(w=p.width/2,C=h.width/2),e.paddingLeft=Math.max((w-S)*e.width/(e.width-S),0)+3,e.paddingRight=Math.max((C-A)*e.width/(e.width-A),0)+3}else{var k=o.mirror?0:f.width+v+m;t.width=Math.min(e.maxWidth,t.width+k),e.paddingTop=p.height/2,e.paddingBottom=h.height/2}}e.handleMargins(),u?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){O.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(vt(e))return NaN;if(("number"==typeof e||e instanceof Number)&&!isFinite(e))return NaN;if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y);return e},_convertTicksToLabels:function(e){var t,n,i,o=this;for(o.ticks=e.map(function(e){return e.value}),o.beforeTickToLabelConversion(),t=o.convertTicksToLabels(e)||o.ticks,o.afterTickToLabelConversion(),n=0,i=e.length;n<i;++n)e[n].label=t[n];return t},_getLabelSizes:function(){var e=this,t=e._labelSizes;return t||(e._labelSizes=t=computeLabelSizes(e.ctx,parseTickFontOptions(e.options.ticks),e.getTicks(),e.longestTextCache),e.longestLabelWidth=t.widest.width),t},_parseValue:function(e){var t,n,i,o;return mt(e)?(t=+this.getRightValue(e[0]),n=+this.getRightValue(e[1]),i=Math.min(t,n),o=Math.max(t,n)):(e=+this.getRightValue(e),t=void 0,n=e,i=e,o=e),{min:i,max:o,start:t,end:n}},_getScaleLabel:function(e){var t=this._parseValue(e);return void 0!==t.start?"["+t.start+", "+t.end+"]":+this.getRightValue(e)},getLabelForIndex:O.noop,getPixelForValue:O.noop,getValueForPixel:O.noop,getPixelForTick:function(e){var t=this,n=t.options.offset,i=t._ticks.length,o=1/Math.max(i-(n?0:1),1);return e<0||e>i-1?null:t.getPixelForDecimal(e*o+(n?o/2:0))},getPixelForDecimal:function(e){var t=this;return t._reversePixels&&(e=1-e),t._startPixel+e*t._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this,t=e.min,n=e.max;return e.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0},_autoSkip:function(e){var t,n,i,o,a=this,r=a.options.ticks,s=a._length,l=r.maxTicksLimit||s/a._tickSize()+1,u=r.major.enabled?getMajorIndices(e):[],d=u.length,c=u[0],p=u[d-1];if(d>l)return skipMajors(e,u,d/l),nonSkipped(e);if(i=calculateSpacing(u,e,s,l),d>0){for(t=0,n=d-1;t<n;t++)skip(e,i,u[t],u[t+1]);return o=d>1?(p-c)/(d-1):null,skip(e,i,O.isNullOrUndef(o)?0:c-o,c),skip(e,i,p,O.isNullOrUndef(o)?e.length:p+o),nonSkipped(e)}return skip(e,i),nonSkipped(e)},_tickSize:function(){var e=this,t=e.options.ticks,n=O.toRadians(e.labelRotation),i=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),a=e._getLabelSizes(),r=t.autoSkipPadding||0,s=a?a.widest.width+r:0,l=a?a.highest.height+r:0;return e.isHorizontal()?l*i>s*o?s/i:l/o:l*o<s*i?l/i:s/o},_isVisible:function(){var e,t,n,i=this,o=i.chart,a=i.options.display;if("auto"!==a)return!!a;for(e=0,t=o.data.datasets.length;e<t;++e)if(o.isDatasetVisible(e)&&(n=o.getDatasetMeta(e),n.xAxisID===i.id||n.yAxisID===i.id))return!0;return!1},_computeGridLineItems:function(e){var t,n,i,o,a,r,s,l,u,d,c,p,h,f,g,m,v,b=this,x=b.chart,_=b.options,q=_.gridLines,y=_.position,w=q.offsetGridLines,C=b.isHorizontal(),S=b._ticksToDraw,A=S.length+(w?1:0),k=getTickMarkLength(q),D=[],F=q.drawBorder?xt(q.lineWidth,0,0):0,P=F/2,I=O._alignPixel,M=function(e){return I(x,e,F)};for("top"===y?(t=M(b.bottom),s=b.bottom-k,u=t-P,c=M(e.top)+P,h=e.bottom):"bottom"===y?(t=M(b.top),c=e.top,h=M(e.bottom)-P,s=t+P,u=b.top+k):"left"===y?(t=M(b.right),r=b.right-k,l=t-P,d=M(e.left)+P,p=e.right):(t=M(b.left),d=e.left,p=M(e.right)-P,r=t+P,l=b.left+k),n=0;n<A;++n)i=S[n]||{},vt(i.label)&&n<S.length||(n===b.zeroLineIndex&&_.offset===w?(f=q.zeroLineWidth,g=q.zeroLineColor,m=q.zeroLineBorderDash||[],v=q.zeroLineBorderDashOffset||0):(f=xt(q.lineWidth,n,1),g=xt(q.color,n,"rgba(0,0,0,0.1)"),m=q.borderDash||[],v=q.borderDashOffset||0),o=getPixelForGridLine(b,i._index||n,w),void 0!==o&&(a=I(x,o,f),C?r=l=d=p=a:s=u=c=h=a,D.push({tx1:r,ty1:s,tx2:l,ty2:u,x1:d,y1:c,x2:p,y2:h,width:f,color:g,borderDash:m,borderDashOffset:v})));return D.ticksLength=A,D.borderValue=t,D},_computeLabelItems:function(){var e,t,n,i,o,a,r,s,l,u,d,c,p=this,h=p.options,f=h.ticks,g=h.position,m=f.mirror,v=p.isHorizontal(),b=p._ticksToDraw,x=parseTickFontOptions(f),_=f.padding,q=getTickMarkLength(h.gridLines),y=-O.toRadians(p.labelRotation),w=[];for("top"===g?(a=p.bottom-q-_,r=y?"left":"center"):"bottom"===g?(a=p.top+q+_,r=y?"right":"center"):"left"===g?(o=p.right-(m?0:q)-_,r=m?"left":"right"):(o=p.left+(m?0:q)+_,r=m?"right":"left"),e=0,t=b.length;e<t;++e)n=b[e],i=n.label,vt(i)||(s=p.getPixelForTick(n._index||e)+f.labelOffset,l=n.major?x.major:x.minor,u=l.lineHeight,d=mt(i)?i.length:1,v?(o=s,c="top"===g?((y?1:.5)-d)*u:(y?0:.5)*u):(a=s,c=(1-d)*u/2),w.push({x:o,y:a,rotation:y,label:i,font:l,textOffset:c,textAlign:r}));return w},_drawGrid:function(e){var t=this,n=t.options.gridLines;if(n.display){var i,o,a,r,s,l=t.ctx,u=t.chart,d=O._alignPixel,c=n.drawBorder?xt(n.lineWidth,0,0):0,p=t._gridLineItems||(t._gridLineItems=t._computeGridLineItems(e));for(a=0,r=p.length;a<r;++a)s=p[a],i=s.width,o=s.color,i&&o&&(l.save(),l.lineWidth=i,l.strokeStyle=o,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),n.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(c){var h,f,g,m,v=c,b=xt(n.lineWidth,p.ticksLength-1,1),x=p.borderValue;t.isHorizontal()?(h=d(u,t.left,v)-v/2,f=d(u,t.right,b)+b/2,g=m=x):(g=d(u,t.top,v)-v/2,m=d(u,t.bottom,b)+b/2,h=f=x),l.lineWidth=c,l.strokeStyle=xt(n.color,0),l.beginPath(),l.moveTo(h,g),l.lineTo(f,m),l.stroke()}}},_drawLabels:function(){var e=this,t=e.options.ticks;if(t.display){var n,i,o,a,r,s,l,u,d=e.ctx,c=e._labelItems||(e._labelItems=e._computeLabelItems());for(n=0,o=c.length;n<o;++n){if(r=c[n],s=r.font,d.save(),d.translate(r.x,r.y),d.rotate(r.rotation),d.font=s.string,d.fillStyle=s.color,d.textBaseline="middle",d.textAlign=r.textAlign,l=r.label,u=r.textOffset,mt(l))for(i=0,a=l.length;i<a;++i)d.fillText(""+l[i],0,u),u+=s.lineHeight;else d.fillText(l,0,u);d.restore()}}},_drawTitle:function(){var e=this,t=e.ctx,n=e.options,i=n.scaleLabel;if(i.display){var o,a,r=bt(i.fontColor,A.global.defaultFontColor),s=O.options._parseFont(i),l=O.options.toPadding(i.padding),u=s.lineHeight/2,d=n.position,c=0;if(e.isHorizontal())o=e.left+e.width/2,a="bottom"===d?e.bottom-u-l.bottom:e.top+u+l.top;else{var p="left"===d;o=p?e.left+u+l.top:e.right-u-l.top,a=e.top+e.height/2,c=p?-.5*Math.PI:.5*Math.PI}t.save(),t.translate(o,a),t.rotate(c),t.textAlign="center",t.textBaseline="middle",t.fillStyle=r,t.font=s.string,t.fillText(i.labelString,0,0),t.restore()}},draw:function(e){var t=this;t._isVisible()&&(t._drawGrid(e),t._drawTitle(),t._drawLabels())},_layers:function(){var e=this,t=e.options,n=t.ticks&&t.ticks.z||0,i=t.gridLines&&t.gridLines.z||0;return e._isVisible()&&n!==i&&e.draw===e._draw?[{z:i,draw:function(){e._drawGrid.apply(e,arguments),e._drawTitle.apply(e,arguments)}},{z:n,draw:function(){e._drawLabels.apply(e,arguments)}}]:[{z:n,draw:function(){e.draw.apply(e,arguments)}}]},_getMatchingVisibleMetas:function(e){var t=this,n=t.isHorizontal();return t.chart._getSortedVisibleDatasetMetas().filter(function(i){return(!e||i.type===e)&&(n?i.xAxisID===t.id:i.yAxisID===t.id)})}});_t.prototype._draw=_t.prototype.draw;var qt=_t,yt=O.isNullOrUndef,wt={position:"bottom"},Ct=qt.extend({determineDataLimits:function(){var e,t=this,n=t._getLabels(),i=t.options.ticks,o=i.min,a=i.max,r=0,s=n.length-1;void 0!==o&&(e=n.indexOf(o),e>=0&&(r=e)),void 0!==a&&(e=n.indexOf(a),e>=0&&(s=e)),t.minIndex=r,t.maxIndex=s,t.min=n[r],t.max=n[s]},buildTicks:function(){var e=this,t=e._getLabels(),n=e.minIndex,i=e.maxIndex;e.ticks=0===n&&i===t.length-1?t:t.slice(n,i+1)},getLabelForIndex:function(e,t){var n=this,i=n.chart;return i.getDatasetMeta(t).controller._getValueScaleId()===n.id?n.getRightValue(i.data.datasets[t].data[e]):n._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;qt.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var i,o,a,r=this;return yt(t)||yt(n)||(e=r.chart.data.datasets[n].data[t]),yt(e)||(i=r.isHorizontal()?e.x:e.y),(void 0!==i||void 0!==e&&isNaN(t))&&(o=r._getLabels(),e=O.valueOrDefault(i,e),a=o.indexOf(e),t=a!==-1?a:t,isNaN(t)&&(t=e)),r.getPixelForDecimal((t-r._startValue)/r._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=this,n=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(n,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}}),St=wt;Ct._defaults=St;var At=O.noop,kt=O.isNullOrUndef,Dt=qt.extend({getRightValue:function(e){return"string"==typeof e?+e:qt.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options,n=t.ticks;if(n.beginAtZero){var i=O.sign(e.min),o=O.sign(e.max);i<0&&o<0?e.max=0:i>0&&o>0&&(e.min=0)}var a=void 0!==n.min||void 0!==n.suggestedMin,r=void 0!==n.max||void 0!==n.suggestedMax;void 0!==n.min?e.min=n.min:void 0!==n.suggestedMin&&(null===e.min?e.min=n.suggestedMin:e.min=Math.min(e.min,n.suggestedMin)),void 0!==n.max?e.max=n.max:void 0!==n.suggestedMax&&(null===e.max?e.max=n.suggestedMax:e.max=Math.max(e.max,n.suggestedMax)),a!==r&&e.min>=e.max&&(a?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,n.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this,n=t.options.ticks,i=n.stepSize,o=n.maxTicksLimit;return i?e=Math.ceil(t.max/i)-Math.floor(t.min/i)+1:(e=t._computeTickLimit(),o=o||11),o&&(e=Math.min(o,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:At,buildTicks:function(){var e=this,t=e.options,n=t.ticks,i=e.getTickLimit();i=Math.max(2,i);var o={maxTicks:i,min:n.min,max:n.max,precision:n.precision,stepSize:O.valueOrDefault(n.fixedStepSize,n.stepSize)},a=e.ticks=generateTicks(o,e);e.handleDirectionalChanges(),e.max=O.max(a),e.min=O.min(a),n.reverse?(a.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),qt.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),i=t.min,o=t.max;qt.prototype._configure.call(t),t.options.offset&&n.length&&(e=(o-i)/Math.max(n.length-1,1)/2,i-=e,o+=e),t._startValue=i,t._endValue=o,t._valueRange=o-i}}),Ft={position:"left",ticks:{callback:gt.formatters.linear}},Pt=0,It=1,Mt=Dt.extend({determineDataLimits:function(){var e,t,n,i,o=this,a=o.options,r=o.chart,s=r.data.datasets,l=o._getMatchingVisibleMetas(),u=a.stacked,d={},c=l.length;if(o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,void 0===u)for(e=0;!u&&e<c;++e)t=l[e],u=void 0!==t.stack;for(e=0;e<c;++e)t=l[e],n=s[t.index].data,u?stackData(o,d,t,n):updateMinMax(o,t,n);O.each(d,function(e){i=e.pos.concat(e.neg),o.min=Math.min(o.min,O.min(i)),o.max=Math.max(o.max,O.max(i))}),o.min=O.isFinite(o.min)&&!isNaN(o.min)?o.min:Pt,o.max=O.isFinite(o.max)&&!isNaN(o.max)?o.max:It,o.handleTickRangeOptions()},_computeTickLimit:function(){var e,t=this;return t.isHorizontal()?Math.ceil(t.width/40):(e=O.options._parseFont(t.options.ticks),Math.ceil(t.height/e.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForValue:function(e){var t=this;return t.getPixelForDecimal((+t.getRightValue(e)-t._startValue)/t._valueRange)},getValueForPixel:function(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange},getPixelForTick:function(e){var t=this.ticksAsNumbers;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])}}),Tt=Ft;Mt._defaults=Tt;var Rt=O.valueOrDefault,Et=O.math.log10,Bt={position:"left",ticks:{callback:gt.formatters.logarithmic}},Ot=qt.extend({determineDataLimits:function(){function IDMatches(e){return d?e.xAxisID===r.id:e.yAxisID===r.id}var e,t,n,i,o,a,r=this,s=r.options,l=r.chart,u=l.data.datasets,d=r.isHorizontal();r.min=Number.POSITIVE_INFINITY,r.max=Number.NEGATIVE_INFINITY,r.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(e=0;e<u.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&IDMatches(t)&&void 0!==t.stack){c=!0;break}if(s.stacked||c){var p={};for(e=0;e<u.length;e++){t=l.getDatasetMeta(e);var h=[t.type,void 0===s.stacked&&void 0===t.stack?e:"",t.stack].join(".");if(l.isDatasetVisible(e)&&IDMatches(t))for(void 0===p[h]&&(p[h]=[]),i=u[e].data,o=0,a=i.length;o<a;o++){var f=p[h];n=r._parseValue(i[o]),isNaN(n.min)||isNaN(n.max)||t.data[o].hidden||n.min<0||n.max<0||(f[o]=f[o]||0,f[o]+=n.max)}}O.each(p,function(e){if(e.length>0){var t=O.min(e),n=O.max(e);r.min=Math.min(r.min,t),r.max=Math.max(r.max,n)}})}else for(e=0;e<u.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&IDMatches(t))for(i=u[e].data,o=0,a=i.length;o<a;o++)n=r._parseValue(i[o]),isNaN(n.min)||isNaN(n.max)||t.data[o].hidden||n.min<0||n.max<0||(r.min=Math.min(n.min,r.min),r.max=Math.max(n.max,r.max),0!==n.min&&(r.minNotZero=Math.min(n.min,r.minNotZero)));r.min=O.isFinite(r.min)?r.min:null,r.max=O.isFinite(r.max)?r.max:null,r.minNotZero=O.isFinite(r.minNotZero)?r.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var e=this,t=e.options.ticks,n=1,i=10;e.min=nonNegativeOrDefault(t.min,e.min),e.max=nonNegativeOrDefault(t.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(Et(e.min))-1),e.max=Math.pow(10,Math.floor(Et(e.max))+1)):(e.min=n,e.max=i)),null===e.min&&(e.min=Math.pow(10,Math.floor(Et(e.max))-1)),null===e.max&&(e.max=0!==e.min?Math.pow(10,Math.floor(Et(e.min))+1):i),null===e.minNotZero&&(e.min>0?e.minNotZero=e.min:e.max<1?e.minNotZero=Math.pow(10,Math.floor(Et(e.max))):e.minNotZero=n)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),i={min:nonNegativeOrDefault(t.min),max:nonNegativeOrDefault(t.max)},o=e.ticks=generateTicks$1(i,e);e.max=O.max(o),e.min=O.min(o),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&o.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),qt.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForTick:function(e){var t=this.tickValues;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(Et(e)),n=Math.floor(e/Math.pow(10,t));return n*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;qt.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=Rt(e.options.ticks.fontSize,A.global.defaultFontSize)/e._length),e._startValue=Et(t),e._valueOffset=n,e._valueRange=(Et(e.max)-Et(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return e=+t.getRightValue(e),e>t.min&&e>0&&(n=(Et(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return 0===n&&0===t.min?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}}),Lt=Bt;Ot._defaults=Lt;var zt=O.valueOrDefault,Nt=O.valueAtIndexOrDefault,Ut=O.options.resolve,Ht={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:gt.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}},jt=Dt.extend({setDimensions:function(){var e=this;e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=getTickBackdropHeight(e.options)/2,e.xCenter=Math.floor(e.width/2),e.yCenter=Math.floor((e.height-e.paddingTop)/2),e.drawingArea=Math.min(e.height-e.paddingTop,e.width)/2},determineDataLimits:function(){var e=this,t=e.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;O.each(t.data.datasets,function(o,a){if(t.isDatasetVisible(a)){var r=t.getDatasetMeta(a);O.each(o.data,function(t,o){var a=+e.getRightValue(t);isNaN(a)||r.data[o].hidden||(n=Math.min(a,n),i=Math.max(a,i))})}}),e.min=n===Number.POSITIVE_INFINITY?0:n,e.max=i===Number.NEGATIVE_INFINITY?0:i,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))},convertTicksToLabels:function(){var e=this;Dt.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(function(){var t=O.callback(e.options.pointLabels.callback,arguments,e);return t||0===t?t:""})},getLabelForIndex:function(e,t){return+this.getRightValue(this.chart.data.datasets[t].data[e])},fit:function(){var e=this,t=e.options;t.display&&t.pointLabels.display?fitWithPointLabels(e):e.setCenterPoint(0,0,0,0)},setReductions:function(e,t,n){var i=this,o=t.l/Math.sin(n.l),a=Math.max(t.r-i.width,0)/Math.sin(n.r),r=-t.t/Math.cos(n.t),s=-Math.max(t.b-(i.height-i.paddingTop),0)/Math.cos(n.b);o=numberOrZero(o),a=numberOrZero(a),r=numberOrZero(r),s=numberOrZero(s),i.drawingArea=Math.min(Math.floor(e-(o+a)/2),Math.floor(e-(r+s)/2)),i.setCenterPoint(o,a,r,s)},setCenterPoint:function(e,t,n,i){var o=this,a=o.width-t-o.drawingArea,r=e+o.drawingArea,s=n+o.drawingArea,l=o.height-o.paddingTop-i-o.drawingArea;o.xCenter=Math.floor((r+a)/2+o.left),o.yCenter=Math.floor((s+l)/2+o.top+o.paddingTop)},getIndexAngle:function(e){var t=this.chart,n=360/t.data.labels.length,i=t.options||{},o=i.startAngle||0,a=(e*n+o)%360;return(a<0?a+360:a)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this;if(O.isNullOrUndef(e))return NaN;var n=t.drawingArea/(t.max-t.min);return t.options.ticks.reverse?(t.max-e)*n:(e-t.min)*n},getPointPosition:function(e,t){var n=this,i=n.getIndexAngle(e)-Math.PI/2;return{x:Math.cos(i)*t+n.xCenter,y:Math.sin(i)*t+n.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this,n=t.min,i=t.max;return t.getPointPositionForValue(e||0,t.beginAtZero?0:n<0&&i<0?i:n>0&&i>0?n:0)},_drawGrid:function(){var e,t,n,i=this,o=i.ctx,a=i.options,r=a.gridLines,s=a.angleLines,l=zt(s.lineWidth,r.lineWidth),u=zt(s.color,r.color);if(a.pointLabels.display&&drawPointLabels(i),r.display&&O.each(i.ticks,function(e,n){0!==n&&(t=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),drawRadiusLine(i,r,t,n))}),s.display&&l&&u){for(o.save(),o.lineWidth=l,o.strokeStyle=u,o.setLineDash&&(o.setLineDash(Ut([s.borderDash,r.borderDash,[]])),o.lineDashOffset=Ut([s.borderDashOffset,r.borderDashOffset,0])),e=i.chart.data.labels.length-1;e>=0;e--)t=i.getDistanceFromCenterForValue(a.ticks.reverse?i.min:i.max),n=i.getPointPosition(e,t),o.beginPath(),o.moveTo(i.xCenter,i.yCenter),o.lineTo(n.x,n.y),o.stroke();o.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options,i=n.ticks;if(i.display){var o,a,r=e.getIndexAngle(0),s=O.options._parseFont(i),l=zt(i.fontColor,A.global.defaultFontColor);t.save(),t.font=s.string,t.translate(e.xCenter,e.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",O.each(e.ticks,function(n,r){(0!==r||i.reverse)&&(o=e.getDistanceFromCenterForValue(e.ticksAsNumbers[r]),i.showLabelBackdrop&&(a=t.measureText(n).width,t.fillStyle=i.backdropColor,t.fillRect(-a/2-i.backdropPaddingX,-o-s.size/2-i.backdropPaddingY,a+2*i.backdropPaddingX,s.size+2*i.backdropPaddingY)),t.fillStyle=l,t.fillText(n,0,-o))}),t.restore()}},_drawTitle:O.noop}),Vt=Ht;jt._defaults=Vt;var Wt=O._deprecated,Gt=O.options.resolve,Xt=O.valueOrDefault,$t=Number.MIN_SAFE_INTEGER||-9007199254740991,Yt=Number.MAX_SAFE_INTEGER||9007199254740991,Jt={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Kt=Object.keys(Jt),Zt={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}},Qt=qt.extend({initialize:function(){this.mergeTicksOptions(),qt.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,n=t.time||(t.time={}),i=e._adapter=new ft._date(t.adapters.date);return Wt("time scale",n.format,"time.format","time.parser"),Wt("time scale",n.min,"time.min","ticks.min"),Wt("time scale",n.max,"time.max","ticks.max"),O.mergeIf(n.displayFormats,i.formats()),qt.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),qt.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,n,i,o,a,r,s=this,l=s.chart,u=s._adapter,d=s.options,c=d.time.unit||"day",p=Yt,h=$t,f=[],g=[],m=[],v=s._getLabels();for(e=0,n=v.length;e<n;++e)m.push(parse(s,v[e]));for(e=0,n=(l.data.datasets||[]).length;e<n;++e)if(l.isDatasetVisible(e))if(o=l.data.datasets[e].data,O.isObject(o[0]))for(g[e]=[],t=0,i=o.length;t<i;++t)a=parse(s,o[t]),f.push(a),g[e][t]=a;else g[e]=m.slice(0),r||(f=f.concat(m),r=!0);else g[e]=[];m.length&&(p=Math.min(p,m[0]),h=Math.max(h,m[m.length-1])),f.length&&(f=n>1?arrayUnique(f).sort(sorter):f.sort(sorter),p=Math.min(p,f[0]),h=Math.max(h,f[f.length-1])),p=parse(s,getMin(d))||p,h=parse(s,getMax(d))||h,p=p===Yt?+u.startOf(Date.now(),c):p,h=h===$t?+u.endOf(Date.now(),c)+1:h,s.min=Math.min(p,h),s.max=Math.max(p+1,h),s._table=[],s._timestamps={data:f,datasets:g,labels:m}},buildTicks:function(){var e,t,n,i=this,o=i.min,a=i.max,r=i.options,s=r.ticks,l=r.time,u=i._timestamps,d=[],c=i.getLabelCapacity(o),p=s.source,h=r.distribution;for(u="data"===p||"auto"===p&&"series"===h?u.data:"labels"===p?u.labels:generate(i,o,a,c),"ticks"===r.bounds&&u.length&&(o=u[0],a=u[u.length-1]),o=parse(i,getMin(r))||o,a=parse(i,getMax(r))||a,e=0,t=u.length;e<t;++e)n=u[e],n>=o&&n<=a&&d.push(n);return i.min=o,i.max=a,i._unit=l.unit||(s.autoSkip?determineUnitForAutoTicks(l.minUnit,i.min,i.max,c):determineUnitForFormatting(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?determineMajorUnit(i._unit):void 0,i._table=buildLookupTable(i._timestamps.data,o,a,h),i._offsets=computeOffsets(i._table,d,o,a,r),s.reverse&&d.reverse(),ticksFromTimestamps(i,d,i._majorUnit)},getLabelForIndex:function(e,t){var n=this,i=n._adapter,o=n.chart.data,a=n.options.time,r=o.labels&&e<o.labels.length?o.labels[e]:"",s=o.datasets[t].data[e];return O.isObject(s)&&(r=n.getRightValue(s)),a.tooltipFormat?i.format(toTimestamp(n,r),a.tooltipFormat):"string"==typeof r?r:i.format(toTimestamp(n,r),a.displayFormats.datetime)},tickFormatFunction:function(e,t,n,i){var o=this,a=o._adapter,r=o.options,s=r.time.displayFormats,l=s[o._unit],u=o._majorUnit,d=s[u],c=n[t],p=r.ticks,h=u&&d&&c&&c.major,f=a.format(e,i?i:h?d:l),g=h?p.major:p.minor,m=Gt([g.callback,g.userCallback,p.callback,p.userCallback]);return m?m(f,t,n):f},convertTicksToLabels:function(e){var t,n,i=[];for(t=0,n=e.length;t<n;++t)i.push(this.tickFormatFunction(e[t].value,t,e));return i},getPixelForOffset:function(e){var t=this,n=t._offsets,i=interpolate$1(t._table,"time",e,"pos");return t.getPixelForDecimal((n.start+i)*n.factor)},getPixelForValue:function(e,t,n){var i=this,o=null;if(void 0!==t&&void 0!==n&&(o=i._timestamps.datasets[n][t]),null===o&&(o=parse(i,e)),null!==o)return i.getPixelForOffset(o)},getPixelForTick:function(e){var t=this.getTicks();return e>=0&&e<t.length?this.getPixelForOffset(t[e].value):null},getValueForPixel:function(e){var t=this,n=t._offsets,i=t.getDecimalForPixel(e)/n.factor-n.end,o=interpolate$1(t._table,"pos",i,"time");return t._adapter._create(o)},_getLabelSize:function(e){var t=this,n=t.options.ticks,i=t.ctx.measureText(e).width,o=O.toRadians(t.isHorizontal()?n.maxRotation:n.minRotation),a=Math.cos(o),r=Math.sin(o),s=Xt(n.fontSize,A.global.defaultFontSize);return{w:i*a+s*r,h:i*r+s*a}},getLabelWidth:function(e){return this._getLabelSize(e).w},getLabelCapacity:function(e){var t=this,n=t.options.time,i=n.displayFormats,o=i[n.unit]||i.millisecond,a=t.tickFormatFunction(e,0,ticksFromTimestamps(t,[e],t._majorUnit),o),r=t._getLabelSize(a),s=Math.floor(t.isHorizontal()?t.width/r.w:t.height/r.h);return t.options.offset&&s--,s>0?s:1}}),en=Zt;Qt._defaults=en;var tn={category:Ct,linear:Mt,logarithmic:Ot,radialLinear:jt,time:Qt},nn={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};ft._date.override("function"==typeof e?{_id:"moment",formats:function(){return nn},parse:function(t,n){return"string"==typeof t&&"string"==typeof n?t=e(t,n):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,n){return e(t).format(n)},add:function(t,n,i){return e(t).add(n,i).valueOf()},diff:function(t,n,i){return e(t).diff(e(n),i)},startOf:function(t,n,i){return t=e(t),"isoWeek"===n?t.isoWeekday(i).valueOf():t.startOf(n).valueOf()},endOf:function(t,n){return e(t).endOf(n).valueOf()},_create:function(t){return e(t)}}:{}),A._set("global",{plugins:{filler:{propagate:!0}}});var on={dataset:function(e){var t=e.fill,n=e.chart,i=n.getDatasetMeta(t),o=i&&n.isDatasetVisible(t),a=o&&i.dataset._children||[],r=a.length||0;return r?function(e,t){return t<r&&a[t]._view||null}:null},boundary:function(e){var t=e.boundary,n=t?t.x:null,i=t?t.y:null;return O.isArray(t)?function(e,n){
13
- return t[n]}:function(e){return{x:null===n?e.x:n,y:null===i?e.y:i}}}},an={id:"filler",afterDatasetsUpdate:function(e,t){var n,i,o,a,r=(e.data.datasets||[]).length,s=t.propagate,l=[];for(i=0;i<r;++i)n=e.getDatasetMeta(i),o=n.dataset,a=null,o&&o._model&&o instanceof le.Line&&(a={visible:e.isDatasetVisible(i),fill:decodeFill(o,i,r),chart:e,el:o}),n.$filler=a,l.push(a);for(i=0;i<r;++i)a=l[i],a&&(a.fill=resolveTarget(l,i,s),a.boundary=computeBoundary(a),a.mapper=createMapper(a))},beforeDatasetsDraw:function(e){var t,n,i,o,a,r,s,l=e._getSortedVisibleDatasetMetas(),u=e.ctx;for(n=l.length-1;n>=0;--n)t=l[n].$filler,t&&t.visible&&(i=t.el,o=i._view,a=i._children||[],r=t.mapper,s=o.backgroundColor||A.global.defaultColor,r&&s&&a.length&&(O.canvas.clipArea(u,e.chartArea),doFill(u,a,r,o,s,i._loop),O.canvas.unclipArea(u)))}},rn=O.rtl.getRtlAdapter,sn=O.noop,ln=O.valueOrDefault;A._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,i=this.chart,o=i.getDatasetMeta(n);o.hidden=null===o.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},i=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map(function(n){var o=n.controller.getStyle(i?0:void 0);return{text:t[n.index].label,fillStyle:o.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:o.borderCapStyle,lineDash:o.borderDash,lineDashOffset:o.borderDashOffset,lineJoin:o.borderJoinStyle,lineWidth:o.borderWidth,strokeStyle:o.borderColor,pointStyle:o.pointStyle,rotation:o.rotation,datasetIndex:n.index}},this)}}},legendCallback:function(e){var t,n,i,o,a=document.createElement("ul"),r=e.data.datasets;for(a.setAttribute("class",e.id+"-legend"),t=0,n=r.length;t<n;t++)i=a.appendChild(document.createElement("li")),o=i.appendChild(document.createElement("span")),o.style.backgroundColor=r[t].backgroundColor,r[t].label&&i.appendChild(document.createTextNode(r[t].label));return a.outerHTML}});var un=V.extend({initialize:function(e){var t=this;O.extend(t,e),t.legendHitBoxes=[],t._hoveredItem=null,t.doughnutMode=!1},beforeUpdate:sn,update:function(e,t,n){var i=this;return i.beforeUpdate(),i.maxWidth=e,i.maxHeight=t,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:sn,beforeSetDimensions:sn,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:sn,beforeBuildLabels:sn,buildLabels:function(){var e=this,t=e.options.labels||{},n=O.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(n=n.filter(function(n){return t.filter(n,e.chart.data)})),e.options.reverse&&n.reverse(),e.legendItems=n},afterBuildLabels:sn,beforeFit:sn,fit:function(){var e=this,t=e.options,n=t.labels,i=t.display,o=e.ctx,a=O.options._parseFont(n),r=a.size,s=e.legendHitBoxes=[],l=e.minSize,u=e.isHorizontal();if(u?(l.width=e.maxWidth,l.height=i?10:0):(l.width=i?10:0,l.height=e.maxHeight),!i)return void(e.width=l.width=e.height=l.height=0);if(o.font=a.string,u){var d=e.lineWidths=[0],c=0;o.textAlign="left",o.textBaseline="middle",O.each(e.legendItems,function(e,t){var i=getBoxWidth(n,r),a=i+r/2+o.measureText(e.text).width;(0===t||d[d.length-1]+a+2*n.padding>l.width)&&(c+=r+n.padding,d[d.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:a,height:r},d[d.length-1]+=a+n.padding}),l.height+=c}else{var p=n.padding,h=e.columnWidths=[],f=e.columnHeights=[],g=n.padding,m=0,v=0;O.each(e.legendItems,function(e,t){var i=getBoxWidth(n,r),a=i+r/2+o.measureText(e.text).width;t>0&&v+r+2*p>l.height&&(g+=m+n.padding,h.push(m),f.push(v),m=0,v=0),m=Math.max(m,a),v+=r+p,s[t]={left:0,top:0,width:a,height:r}}),g+=m,h.push(m),f.push(v),l.width+=g}e.width=l.width,e.height=l.height},afterFit:sn,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,i=A.global,o=i.defaultColor,a=i.elements.line,r=e.height,s=e.columnHeights,l=e.width,u=e.lineWidths;if(t.display){var d,c=rn(t.rtl,e.left,e.minSize.width),p=e.ctx,h=ln(n.fontColor,i.defaultFontColor),f=O.options._parseFont(n),g=f.size;p.textAlign=c.textAlign("left"),p.textBaseline="middle",p.lineWidth=.5,p.strokeStyle=h,p.fillStyle=h,p.font=f.string;var m=getBoxWidth(n,g),v=e.legendHitBoxes,b=function(e,t,i){if(!(isNaN(m)||m<=0)){p.save();var r=ln(i.lineWidth,a.borderWidth);if(p.fillStyle=ln(i.fillStyle,o),p.lineCap=ln(i.lineCap,a.borderCapStyle),p.lineDashOffset=ln(i.lineDashOffset,a.borderDashOffset),p.lineJoin=ln(i.lineJoin,a.borderJoinStyle),p.lineWidth=r,p.strokeStyle=ln(i.strokeStyle,o),p.setLineDash&&p.setLineDash(ln(i.lineDash,a.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=c.xPlus(e,m/2),u=t+g/2;O.canvas.drawPoint(p,i.pointStyle,s,l,u,i.rotation)}else p.fillRect(c.leftForLtr(e,m),t,m,g),0!==r&&p.strokeRect(c.leftForLtr(e,m),t,m,g);p.restore()}},x=function(e,t,n,i){var o=g/2,a=c.xPlus(e,m+o),r=t+o;p.fillText(n.text,a,r),n.hidden&&(p.beginPath(),p.lineWidth=2,p.moveTo(a,r),p.lineTo(c.xPlus(a,i),r),p.stroke())},_=function(e,i){switch(t.align){case"start":return n.padding;case"end":return e-i;default:return(e-i+n.padding)/2}},q=e.isHorizontal();d=q?{x:e.left+_(l,u[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+_(r,s[0]),line:0},O.rtl.overrideTextDirection(e.ctx,t.textDirection);var y=g+n.padding;O.each(e.legendItems,function(t,i){var o=p.measureText(t.text).width,a=m+g/2+o,h=d.x,f=d.y;c.setWidth(e.minSize.width),q?i>0&&h+a+n.padding>e.left+e.minSize.width&&(f=d.y+=y,d.line++,h=d.x=e.left+_(l,u[d.line])):i>0&&f+y>e.top+e.minSize.height&&(h=d.x=h+e.columnWidths[d.line]+n.padding,d.line++,f=d.y=e.top+_(r,s[d.line]));var w=c.x(h);b(w,f,t),v[i].left=c.leftForLtr(w,v[i].width),v[i].top=f,x(w,f,t,o),q?d.x+=a+n.padding:d.y+=y}),O.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,i,o,a=this;if(e>=a.left&&e<=a.right&&t>=a.top&&t<=a.bottom)for(o=a.legendHitBoxes,n=0;n<o.length;++n)if(i=o[n],e>=i.left&&e<=i.left+i.width&&t>=i.top&&t<=i.top+i.height)return a.legendItems[n];return null},handleEvent:function(e){var t,n=this,i=n.options,o="mouseup"===e.type?"click":e.type;if("mousemove"===o){if(!i.onHover&&!i.onLeave)return}else{if("click"!==o)return;if(!i.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===o?t&&i.onClick&&i.onClick.call(n,e.native,t):(i.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),i.onHover&&t&&i.onHover.call(n,e.native,t))}}),dn={id:"legend",_element:un,beforeInit:function(e){var t=e.options.legend;t&&createNewLegendAndAttach(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(O.mergeIf(t,A.global.legend),n?(Le.configure(e,n,t),n.options=t):createNewLegendAndAttach(e,t)):n&&(Le.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},cn=O.noop;A._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var pn=V.extend({initialize:function(e){var t=this;O.extend(t,e),t.legendHitBoxes=[]},beforeUpdate:cn,update:function(e,t,n){var i=this;return i.beforeUpdate(),i.maxWidth=e,i.maxHeight=t,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:cn,beforeSetDimensions:cn,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:cn,beforeBuildLabels:cn,buildLabels:cn,afterBuildLabels:cn,beforeFit:cn,fit:function(){var e,t,n=this,i=n.options,o=n.minSize={},a=n.isHorizontal();return i.display?(e=O.isArray(i.text)?i.text.length:1,t=e*O.options._parseFont(i).lineHeight+2*i.padding,n.width=o.width=a?n.maxWidth:t,void(n.height=o.height=a?t:n.maxHeight)):void(n.width=o.width=n.height=o.height=0)},afterFit:cn,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var i,o,a,r=O.options._parseFont(n),s=r.lineHeight,l=s/2+n.padding,u=0,d=e.top,c=e.left,p=e.bottom,h=e.right;t.fillStyle=O.valueOrDefault(n.fontColor,A.global.defaultFontColor),t.font=r.string,e.isHorizontal()?(o=c+(h-c)/2,a=d+l,i=h-c):(o="left"===n.position?c+l:h-l,a=d+(p-d)/2,i=p-d,u=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(o,a),t.rotate(u),t.textAlign="center",t.textBaseline="middle";var f=n.text;if(O.isArray(f))for(var g=0,m=0;m<f.length;++m)t.fillText(f[m],0,g,i),g+=s;else t.fillText(f,0,0,i);t.restore()}}}),hn={id:"title",_element:pn,beforeInit:function(e){var t=e.options.title;t&&createNewTitleBlockAndAttach(e,t)},beforeUpdate:function(e){var t=e.options.title,n=e.titleBlock;t?(O.mergeIf(t,A.global.title),n?(Le.configure(e,n,t),n.options=t):createNewTitleBlockAndAttach(e,t)):n&&(Le.removeBox(e,n),delete e.titleBlock)}},fn={},gn=an,mn=dn,vn=hn;fn.filler=gn,fn.legend=mn,fn.title=vn,ct.helpers=O,pt(),ct._adapters=ft,ct.Animation=G,ct.animationService=X,ct.controllers=Ee,ct.DatasetController=K,ct.defaults=A,ct.Element=V,ct.elements=le,ct.Interaction=Be,ct.layouts=Le,ct.platform=et,ct.plugins=tt,ct.Scale=qt,ct.scaleService=nt,ct.Ticks=gt,ct.Tooltip=lt,ct.helpers.each(tn,function(e,t){ct.scaleService.registerScaleType(t,e,e._defaults)});for(var bn in fn)fn.hasOwnProperty(bn)&&ct.plugins.register(fn[bn]);ct.platform.initialize();var xn=ct;return"undefined"!=typeof window&&(window.Chart=ct),ct.Chart=ct,ct.Legend=fn.legend._element,ct.Title=fn.title._element,ct.pluginService=ct.plugins,ct.PluginBase=ct.Element.extend({}),ct.canvasHelpers=ct.helpers.canvas,ct.layoutService=ct.layouts,ct.LinearScaleBase=Dt,ct.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(e){ct[e]=function(t,n){return new ct(t,ct.helpers.merge(n||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}}),xn})},1239:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(136),o=_interopRequireDefault(i),a=n(17),r=_interopRequireDefault(a),s=n(1235),l=_interopRequireDefault(s),u=n(985),d=_interopRequireDefault(u);l.default.defaults.global.showScale=!0,l.default.defaults.global.scaleLineColor="rgba(0,0,0,.05)",l.default.defaults.global.scaleLineWidth=1,l.default.defaults.global.responsive=!0,l.default.defaults.global.maintainAspectRatio=!1,l.default.defaults.global.multiTooltipTemplate="<%=datasetLabel%>: <%= value %>";var c={scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,lineTension:.3,yAxes:[{ticks:{min:0,stepSize:1}}]},p=(0,o.default)({},c,{datasetFill:!1}),h={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,datasetFill:!1},f=(0,o.default)({},h,{scaleShowVerticalLines:!1,scales:{xAxes:[{stacked:!0}],yAxes:[{stacked:!0}]}}),g=["#a0d0e0","#3c8dbc","#4da74d","#ffb311","#8612ee","#aaa"];t.default={name:"chart-widget",data:function(){return{chart:null,canvasHeight:null}},props:{title:String,icon:{type:String,default:"line-chart"},default:null,height:{type:String,default:"300px"},x:String,y:Array,metrics:{type:Object,required:!0},chartType:{type:String,default:"Area"}},computed:{series:function series(){var e=this,series=this.y.map(function(e){return e.id}),t=this.metrics.timeserie(series);return{labels:t.map(function(e){return(0,r.default)(e.date).format("L")}),datasets:this.y.map(function(n,i){var o={label:n.label},a=n.color||g[i];return o.backgroundColor=e.toRGBA(a,.5),o.borderColor=a,o.pointBackgroundColor=a,o.pointHoverBackgroundColor="#fff",o.pointHoverBorderColor=a,o.data=t.map(function(e){return e[n.id]}),o})}}},components:{Box:d.default},ready:function(){this.canvasHeight=this.$els.container.clientHeight,this.buildChart(),this.metrics.$on("updated",this.buildChart.bind(this))},beforeDestroy:function(){this.cleanChart()},watch:{y:function(e,t){e!=t&&this.buildChart()}},methods:{buildChart:function(){if(this.y&&this.metrics&&this.chartType){var e=this["build"+this.chartType],t=this.$els.canvas.getContext("2d");this.cleanChart(),t.canvas.height=this.canvasHeight,this.chart=e(t)}},buildArea:function(e){return new l.default(e,{type:"line",data:this.series,options:c})},buildBar:function(e){return new l.default(e,{type:"bar",data:this.series,options:h})},buildStackedBar:function(e){return new l.default(e,{type:"bar",data:this.series,options:f})},buildLine:function(e){return new l.default(e,{type:"line",data:this.series,options:p})},cleanChart:function(){this.chart&&(this.chart.destroy(),this.chart=null)},toRGBA:function(e,t){var n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(n,function(e,t,n,i){return t+t+n+n+i+i});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return i?"rgba("+parseInt(i[1],16)+","+parseInt(i[2],16)+","+parseInt(i[3],16)+","+t+")":e}}}},1244:function(e,t){e.exports=' <div class=chart-widget> <box :title=title :icon=icon boxclass=box-solid bodyclass=chart-responsive :loading=metrics.loading> <div class=chart :style="{height: height}" v-el:container> <canvas v-el:canvas height=100%></canvas> </div> </box> </div> '},1247:function(e,t,n){var i,o;i=n(1239),o=n(1244),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1254:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1219),o=_interopRequireDefault(i),a=n(1039),r=_interopRequireDefault(a);t.default={name:"community-widget",MASK:["id","title","created_at","dataset{id,title}"],props:{communities:{type:Object,default:function(){return new o.default}},withoutDataset:Boolean,title:{type:String,default:function(){return this._("Community resources")}}},components:{Datatable:r.default},data:function(){var e=[{label:this._("Title"),key:"title",type:"text"},{label:this._("Created on"),key:"created_at",type:"datetime",width:200}];return this.withoutDataset||e.push({label:this._("Dataset"),key:"dataset.title",type:"text",ellipsis:!0}),{fields:e}},events:{"datatable:item:click":function(e){var t=e.dataset?e.dataset.id:"deleted";this.$go({name:"dataset-community-resource",params:{oid:t,rid:e.id}})}}}},1255:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1039),o=_interopRequireDefault(i);t.default={name:"dataset-list",components:{Datatable:o.default},MASK:["id","title","acronym","created_at","last_update","last_modified","metrics","private","quality","archived"],data:function(){return{fields:[{label:this._("Title"),key:function(e){return e.acronym?e.title+" ("+e.acronym+")":e.title},sort:"title",align:"left",type:"deletable-text"},{label:this._("Creation"),key:"created_at",sort:"created",align:"left",type:"timeago",width:120},{label:this._("Metadata update"),key:"last_modified",sort:"last_modified",align:"left",type:"timeago",width:120},{label:this._("Data update"),key:"last_update",sort:"last_update",align:"left",type:"timeago",width:120},{label:this._("Reuses"),key:"metrics.reuses",sort:"reuses",align:"center",type:"metric",width:125},{label:this._("Followers"),key:"metrics.followers",sort:"followers",align:"center",type:"metric",width:95},{label:this._("Views"),key:"metrics.views",sort:"views",align:"center",type:"metric",width:95},{label:this._("Status"),align:"center",type:"visibility",width:95},{label:this._("Quality"),key:"quality.score",align:"center",type:"progress-bars",width:125}]}},events:{"datatable:item:click":function(e){this.$go("/dataset/"+e.id+"/")}},props:{datasets:null,downloads:{type:Array,default:function(){return[]}},title:{type:String,default:function(){return this._("Datasets")}}}}},1256:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(73);_interopRequireDefault(i);t.default={props:{src:null,size:{type:Number,default:100},sizes:{type:Array,default:function(){return[100]}},editable:Boolean,endpoint:null},methods:{click:function(){var e=this;this.editable&&this.$root.$modal(n(1270),{endpoint:this.endpoint,sizes:this.sizes}).$once("image:saved",function(){e.$dispatch("image:saved")})}}}},1257:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(318),o=_interopRequireDefault(i),a=n(1213),r=_interopRequireDefault(a);t.default={name:"image-picker-modal",components:{Modal:o.default,Picker:r.default},props:{endpoint:String,sizes:{type:Array,default:function(){return[100]}}},computed:{title:function(){return this.$refs.picker&&this.$refs.picker.resizing?this._("Resize your thumbnail"):this._("Upload an image")}},events:{"image:saved":function(){return this.$refs.modal.close(),!0}},methods:{click:function(){this.$refs.picker.save()}}}},1259:function(e,t,n){t=e.exports=n(37)(),t.push([e.id,".image-button{position:relative}.image-button img{height:100%;width:100%}.image-button .change-overlay{position:absolute;display:none;top:0;left:0;color:#fff;padding:0 5px;background-color:#666}.image-button.editable:hover{border:1px solid #666;background-color:#b3b3b3}.image-button.editable:hover img{opacity:.5}.image-button.editable:hover .change-overlay{display:block}","",{version:3,sources:["/./js/components/widgets/image-button.vue"],names:[],mappings:"AAAA,cAAc,iBAAiB,CAAC,kBAAkB,YAAY,UAAU,CAAC,8BAA8B,kBAAkB,aAAa,MAAM,OAAO,WAAY,cAAc,qBAAqB,CAAC,6BAA6B,sBAAsB,wBAAwB,CAAC,iCAAiC,UAAU,CAAC,6CAA6C,aAAa,CAAC",file:"image-button.vue",sourcesContent:[".image-button{position:relative}.image-button img{height:100%;width:100%}.image-button .change-overlay{position:absolute;display:none;top:0;left:0;color:white;padding:0 5px;background-color:#666}.image-button.editable:hover{border:1px solid #666;background-color:#b3b3b3}.image-button.editable:hover img{opacity:.5}.image-button.editable:hover .change-overlay{display:block}"],sourceRoot:"webpack://"}])},1260:function(e,t,n){t=e.exports=n(37)(),t.push([e.id,".image-picker-modal .image-picker .uploader .drop-pane{border:5px dashed #fff}","",{version:3,sources:["/./js/components/widgets/image-picker-modal.vue"],names:[],mappings:"AAAA,uDAAuD,sBAAuB,CAAC",file:"image-picker-modal.vue",sourcesContent:[".image-picker-modal .image-picker .uploader .drop-pane{border:5px dashed white}"],sourceRoot:"webpack://"}])},1262:function(e,t){e.exports=" <div> <datatable :title=title icon=code-fork boxclass=community-widget :fields=fields :p=communities :empty=\"_('No community resources')\"> </datatable> </div> "},1263:function(e,t){e.exports=" <div> <datatable :title=title icon=cubes boxclass=datasets-widget :fields=fields :p=datasets :downloads=downloads :empty=\"_('No dataset')\"> </datatable> </div> "},1264:function(e,t){e.exports=" <div class=image-button :class=\"{editable: editable, pointer: editable}\" :style=\"{width:size+'px', height:size+'px'}\" @click=click> <img :src=src /> <small v-if=editable class=change-overlay>{{ _('change') }}</small> </div> "},1265:function(e,t){e.exports=' <div> <modal :title=title class="image-picker-modal modal-info" v-ref:modal> <div class=modal-body> <picker v-ref:picker :endpoint=endpoint :sizes=sizes></picker> </div> <footer class=modal-footer> <button type=button class="btn btn-primary btn-flat pull-left" v-show="$refs.picker && $refs.picker.resizing" @click=click> {{ _(\'Validate\') }} </button> <button type=button class="btn btn-warning btn-flat" @click=$refs.modal.close> {{ _(\'Cancel\') }} </button> </footer> </modal> </div> '},1267:function(e,t,n){var i,o;i=n(1254),o=n(1262),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1268:[1672,1255,1263],1269:function(e,t,n){var i,o;n(1272),i=n(1256),o=n(1264),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1270:function(e,t,n){var i,o;n(1273),i=n(1257),o=n(1265),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1272:function(e,t,n){var i=n(1259);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1273:function(e,t,n){var i=n(1260);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1278:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=_interopRequireDefault(i),a=n(19),r=_interopRequireDefault(a),s=n(27),l=_interopRequireDefault(s),u=n(26),d=_interopRequireDefault(u),c=n(39),p=function(e){function HarvestSourcePage(e){(0,r.default)(this,HarvestSourcePage);var t=(0,l.default)(this,(HarvestSourcePage.__proto__||(0,o.default)(HarvestSourcePage)).call(this,e));return t.$options.ns="harvest",t.$options.fetch="list_harvest_sources",t}return(0,d.default)(HarvestSourcePage,e),HarvestSourcePage}(c.ModelPage);t.default=p},1284:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(39),o=n(1278),a=_interopRequireDefault(o),r=n(1198),s=n(1039),l=_interopRequireDefault(s),u=n(101),d=_interopRequireDefault(u),c=["id","name","owner","last_job{status,ended}","organization{name,logo_thumbnail}","backend","validation{state}","deleted"];t.default={MASK:c,components:{Datatable:l.default},props:{owner:{type:i.Model,default:function(){}}},data:function(){return{title:this._("Harvesters"),sources:new a.default({mask:c,query:{deleted:!0}})}},computed:{fields:function fields(){var e=this,fields=[];return this.owner instanceof i.Model||fields.push({key:function(e){return e.organization?d.default.org_logo(e.organization,30):d.default.user_avatar(e.owner,30)},type:"thumbnail",width:30}),fields.push({label:this._("Name"),key:"name",align:"left",type:"deletable-text"}),this.owner instanceof i.Model||fields.push({label:this._("Owner"),key:function(e){return e.organization?e.organization.name:e.owner.first_name+" "+e.owner.last_name},align:"left",type:"text",width:250}),fields.push({label:this._("Backend"),key:"backend",align:"left",type:"text",width:100},{label:this._("Status"),key:function(e){return e.deleted?"deleted":"pending"==e.validation.state?"validation":"refused"==e.validation.state?"refused":e.last_job.status},type:"label",width:100,label_type:function(e){return e?"validation"==e?"default":"refused"==e?"danger":r.STATUS_CLASSES[e]:"default"},label_func:function(t){return t?"validation"==t?e._("Validation"):"refused"==t?e._("Refused"):r.STATUS_I18N[t]:e._("No job yet")}},{label:this._("Last run"),key:"last_job.ended",align:"left",type:"timeago",width:120}),fields}},events:{"datatable:item:click":function(e){this.$go({name:"harvester",params:{oid:e.id}})}},ready:function(){this.owner instanceof i.Model?this.owner.id&&this.sources.fetch({owner:this.owner.id}):this.sources.fetch()},watch:{"owner.id":function(e){e&&this.sources.fetch({owner:e})}}}},1291:function(e,t){e.exports=" <div> <datatable :title=title icon=tasks boxclass=harvesters-widget :fields=fields :p=sources :loading=sources.loading :empty=\"_('No harvester')\"> </datatable> </div> "},1295:function(e,t,n){var i,o;i=n(1284),o=n(1291),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1302:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=_interopRequireDefault(i),a=n(19),r=_interopRequireDefault(a),s=n(27),l=_interopRequireDefault(s),u=n(26),d=_interopRequireDefault(u),c=n(39),p=n(20),h=(_interopRequireDefault(p),function(e){function ReusePage(e){(0,r.default)(this,ReusePage);var t=(0,l.default)(this,(ReusePage.__proto__||(0,o.default)(ReusePage)).call(this,e));return t.$options.ns="reuses",t.$options.fetch="list_reuses",t}return(0,d.default)(ReusePage,e),ReusePage}(c.ModelPage));t.default=h},1323:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=_interopRequireDefault(i),a=n(19),r=_interopRequireDefault(a),s=n(27),l=_interopRequireDefault(s),u=n(26),d=_interopRequireDefault(u),c=n(39),p=function(e){function DatasetPage(e){(0,r.default)(this,DatasetPage);var t=(0,l.default)(this,(DatasetPage.__proto__||(0,o.default)(DatasetPage)).call(this,e));return t.$options.ns="datasets",t.$options.fetch="list_datasets",t}return(0,d.default)(DatasetPage,e),DatasetPage}(c.ModelPage);t.default=p},1346:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(99),o=_interopRequireDefault(i),a=n(985),r=_interopRequireDefault(a),s=n(1269),l=_interopRequireDefault(s);t.default={name:"user-profile",props:["user"],data:function(){return{title:this._("Profile")}},computed:{endpoint:function(){if(this.user.id===this.$root.me.id){var e=o.default.me.operations.my_avatar;return e.urlify({})}var e=o.default.users.operations.user_avatar;return e.urlify({user:this.user.id})},can_edit:function(){return this.$root.me.is_admin||this.user.id==this.$root.me.id}},components:{Box:r.default,ImageButton:l.default},events:{"image:saved":function(){this.user.fetch()}}}},1354:function(e,t,n){t=e.exports=n(37)(),t.push([e.id,".user-profile-widget .avatar-button{border:1px solid #ccc;float:left;margin:0 10px 5px 0}.user-profile-widget .box-body h3{margin-top:0}.user-profile-widget .profile-body{min-height:100px}","",{version:3,sources:["/./js/components/user/profile.vue"],names:[],mappings:"AAAA,oCAAoC,sBAAsB,WAAW,mBAAmB,CAAC,kCAAkC,YAAY,CAAC,mCAAmC,gBAAgB,CAAC",file:"profile.vue",sourcesContent:[".user-profile-widget .avatar-button{border:1px solid #ccc;float:left;margin:0 10px 5px 0}.user-profile-widget .box-body h3{margin-top:0}.user-profile-widget .profile-body{min-height:100px}"],sourceRoot:"webpack://"}])},1372:function(e,t){e.exports=' <div> <box :title=user.fullname icon=user boxclass=user-profile-widget> <div class=profile-body> <image-button :src="user | avatar_url 100" :size=100 class=avatar-button :endpoint=endpoint :editable=can_edit> </image-button> <div v-markdown=user.about></div> <h4 v-if=user.email>{{user.email}}</h4> </div> </box> </div> '},1390:function(e,t,n){var i,o;n(1398),i=n(1346),o=n(1372),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1398:function(e,t,n){var i=n(1354);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1464:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(99),o=_interopRequireDefault(i),a=n(318),r=_interopRequireDefault(a);t.default={components:{Modal:r.default},props:{user:Object},methods:{confirm:function(){var e=this;o.default.users.delete_user({user:this.user.id},function(t){e.$refs.modal.close(),e.$dispatch("notify",{icon:"exclamation-triangle",title:e._("The user {fullname} has been successfully deleted",{fullname:e.user.fullname})}),e.$go({name:"site"})},function(t){e.$refs.modal.close(),e.$dispatch("notify",{type:"error",icon:"exclamation-triangle",title:e._("An error {status} occured",{status:t.status}),details:JSON.parse(t.data).message})})}}}},1494:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(205),o=_interopRequireDefault(i),a=n(1302),r=_interopRequireDefault(a),s=n(1323),l=_interopRequireDefault(s),u=n(1219),d=_interopRequireDefault(u),c=n(1247),p=_interopRequireDefault(c),h=n(1267),f=_interopRequireDefault(h),g=n(1268),m=_interopRequireDefault(g),v=n(1295),b=_interopRequireDefault(v),x=n(1081),_=_interopRequireDefault(x),q=n(1390),y=_interopRequireDefault(q),w=n(1231),C=_interopRequireDefault(w);t.default={name:"user-view",data:function(){return{user:new o.default,reuses:new r.default({query:{sort:"-created",page_size:10},mask:C.default.MASK}),datasets:new l.default({query:{sort:"-created",page_size:10},mask:m.default.MASK}),communities:new d.default({query:{sort:"-created_at",page_size:10}}),y:[{id:"datasets",label:this._("Datasets")},{id:"reuses",label:this._("Reuses")}]}},components:{Chart:p.default,CommunityList:f.default,DatasetList:m.default,Harvesters:b.default,Layout:_.default,Profile:y.default,ReuseList:C.default},computed:{actions:function actions(){var actions=[];return this.can_edit&&actions.push({label:this._("Edit this user"),icon:"edit",method:this.edit},{label:this._("Delete"),icon:"trash",method:this.confirm_delete}),actions},can_edit:function(){return this.$root.me.is_admin||this.user.id==this.$root.me}},watch:{"user.id":function(e){e?(this.reuses.clear().fetch({owner:e}),this.datasets.clear().fetch({owner:e}),this.communities.clear().fetch({owner:e})):(this.datasets.clear(),this.reuses.clear(),this.communities.clear())}},route:{data:function(){this.$route.params.oid!==this.user.id&&(this.user.fetch(this.$route.params.oid),this.$scrollTo(this.$el))}},methods:{edit:function(){this.$go("/user/edit/"+this.user.id+"/")},confirm_delete:function(){this.$root.$modal(n(1643),{user:this.user})}}}},1561:function(e,t){e.exports=' <modal :title="_(\'Confirm deletion\')" class=modal-danger v-ref:modal> <div class=modal-body> <p class="lead text-center"> {{ _(\'You are about to delete the profile of the user {fullname}.\', {fullname: user.fullname}) }} </p> <p class="lead text-center"> {{ _(\'It will not be possible to recover this profile once deleted.\') }} </p> <p class="lead text-center"> {{ _(\'Are you sure ?\') }} </p> </div> <footer class="modal-footer text-center"> <button type=button class="btn btn-danger btn-flat pull-left" @click=$refs.modal.close> {{ _(\'Cancel\') }} </button> <button type=button class="btn btn-warning btn-flat" @click=confirm> {{ _(\'Confirm\') }} </button> </footer> </modal> '},1591:function(e,t){e.exports=' <div> <layout :title="user.fullname || \'\'" :subtitle="_(\'User\')" :page="user.page || \'\'" :actions=actions> <div class=row> <profile :user=user class="col-xs-12 col-md-6"></profile> </div> <div class=row> <dataset-list class=col-xs-12 :datasets=datasets></dataset-list> </div> <div class=row> <reuse-list class=col-xs-12 :reuses=reuses></reuse-list> </div> <div class=row> <community-list class=col-xs-12 :communities=communities></community-list> </div> <div class=row> <harvesters id=harvesters-widget class=col-xs-12 :owner=user></harvesters> </div> </layout> </div> '},1643:function(e,t,n){var i,o;i=n(1464),o=n(1561),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1672:function(e,t,n,i,o){
13
+ return t[n]}:function(e){return{x:null===n?e.x:n,y:null===i?e.y:i}}}},an={id:"filler",afterDatasetsUpdate:function(e,t){var n,i,o,a,r=(e.data.datasets||[]).length,s=t.propagate,l=[];for(i=0;i<r;++i)n=e.getDatasetMeta(i),o=n.dataset,a=null,o&&o._model&&o instanceof le.Line&&(a={visible:e.isDatasetVisible(i),fill:decodeFill(o,i,r),chart:e,el:o}),n.$filler=a,l.push(a);for(i=0;i<r;++i)a=l[i],a&&(a.fill=resolveTarget(l,i,s),a.boundary=computeBoundary(a),a.mapper=createMapper(a))},beforeDatasetsDraw:function(e){var t,n,i,o,a,r,s,l=e._getSortedVisibleDatasetMetas(),u=e.ctx;for(n=l.length-1;n>=0;--n)t=l[n].$filler,t&&t.visible&&(i=t.el,o=i._view,a=i._children||[],r=t.mapper,s=o.backgroundColor||A.global.defaultColor,r&&s&&a.length&&(O.canvas.clipArea(u,e.chartArea),doFill(u,a,r,o,s,i._loop),O.canvas.unclipArea(u)))}},rn=O.rtl.getRtlAdapter,sn=O.noop,ln=O.valueOrDefault;A._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,i=this.chart,o=i.getDatasetMeta(n);o.hidden=null===o.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},i=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map(function(n){var o=n.controller.getStyle(i?0:void 0);return{text:t[n.index].label,fillStyle:o.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:o.borderCapStyle,lineDash:o.borderDash,lineDashOffset:o.borderDashOffset,lineJoin:o.borderJoinStyle,lineWidth:o.borderWidth,strokeStyle:o.borderColor,pointStyle:o.pointStyle,rotation:o.rotation,datasetIndex:n.index}},this)}}},legendCallback:function(e){var t,n,i,o,a=document.createElement("ul"),r=e.data.datasets;for(a.setAttribute("class",e.id+"-legend"),t=0,n=r.length;t<n;t++)i=a.appendChild(document.createElement("li")),o=i.appendChild(document.createElement("span")),o.style.backgroundColor=r[t].backgroundColor,r[t].label&&i.appendChild(document.createTextNode(r[t].label));return a.outerHTML}});var un=V.extend({initialize:function(e){var t=this;O.extend(t,e),t.legendHitBoxes=[],t._hoveredItem=null,t.doughnutMode=!1},beforeUpdate:sn,update:function(e,t,n){var i=this;return i.beforeUpdate(),i.maxWidth=e,i.maxHeight=t,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:sn,beforeSetDimensions:sn,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:sn,beforeBuildLabels:sn,buildLabels:function(){var e=this,t=e.options.labels||{},n=O.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(n=n.filter(function(n){return t.filter(n,e.chart.data)})),e.options.reverse&&n.reverse(),e.legendItems=n},afterBuildLabels:sn,beforeFit:sn,fit:function(){var e=this,t=e.options,n=t.labels,i=t.display,o=e.ctx,a=O.options._parseFont(n),r=a.size,s=e.legendHitBoxes=[],l=e.minSize,u=e.isHorizontal();if(u?(l.width=e.maxWidth,l.height=i?10:0):(l.width=i?10:0,l.height=e.maxHeight),!i)return void(e.width=l.width=e.height=l.height=0);if(o.font=a.string,u){var d=e.lineWidths=[0],c=0;o.textAlign="left",o.textBaseline="middle",O.each(e.legendItems,function(e,t){var i=getBoxWidth(n,r),a=i+r/2+o.measureText(e.text).width;(0===t||d[d.length-1]+a+2*n.padding>l.width)&&(c+=r+n.padding,d[d.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:a,height:r},d[d.length-1]+=a+n.padding}),l.height+=c}else{var p=n.padding,h=e.columnWidths=[],f=e.columnHeights=[],g=n.padding,m=0,v=0;O.each(e.legendItems,function(e,t){var i=getBoxWidth(n,r),a=i+r/2+o.measureText(e.text).width;t>0&&v+r+2*p>l.height&&(g+=m+n.padding,h.push(m),f.push(v),m=0,v=0),m=Math.max(m,a),v+=r+p,s[t]={left:0,top:0,width:a,height:r}}),g+=m,h.push(m),f.push(v),l.width+=g}e.width=l.width,e.height=l.height},afterFit:sn,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,i=A.global,o=i.defaultColor,a=i.elements.line,r=e.height,s=e.columnHeights,l=e.width,u=e.lineWidths;if(t.display){var d,c=rn(t.rtl,e.left,e.minSize.width),p=e.ctx,h=ln(n.fontColor,i.defaultFontColor),f=O.options._parseFont(n),g=f.size;p.textAlign=c.textAlign("left"),p.textBaseline="middle",p.lineWidth=.5,p.strokeStyle=h,p.fillStyle=h,p.font=f.string;var m=getBoxWidth(n,g),v=e.legendHitBoxes,b=function(e,t,i){if(!(isNaN(m)||m<=0)){p.save();var r=ln(i.lineWidth,a.borderWidth);if(p.fillStyle=ln(i.fillStyle,o),p.lineCap=ln(i.lineCap,a.borderCapStyle),p.lineDashOffset=ln(i.lineDashOffset,a.borderDashOffset),p.lineJoin=ln(i.lineJoin,a.borderJoinStyle),p.lineWidth=r,p.strokeStyle=ln(i.strokeStyle,o),p.setLineDash&&p.setLineDash(ln(i.lineDash,a.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=c.xPlus(e,m/2),u=t+g/2;O.canvas.drawPoint(p,i.pointStyle,s,l,u,i.rotation)}else p.fillRect(c.leftForLtr(e,m),t,m,g),0!==r&&p.strokeRect(c.leftForLtr(e,m),t,m,g);p.restore()}},x=function(e,t,n,i){var o=g/2,a=c.xPlus(e,m+o),r=t+o;p.fillText(n.text,a,r),n.hidden&&(p.beginPath(),p.lineWidth=2,p.moveTo(a,r),p.lineTo(c.xPlus(a,i),r),p.stroke())},_=function(e,i){switch(t.align){case"start":return n.padding;case"end":return e-i;default:return(e-i+n.padding)/2}},q=e.isHorizontal();d=q?{x:e.left+_(l,u[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+_(r,s[0]),line:0},O.rtl.overrideTextDirection(e.ctx,t.textDirection);var y=g+n.padding;O.each(e.legendItems,function(t,i){var o=p.measureText(t.text).width,a=m+g/2+o,h=d.x,f=d.y;c.setWidth(e.minSize.width),q?i>0&&h+a+n.padding>e.left+e.minSize.width&&(f=d.y+=y,d.line++,h=d.x=e.left+_(l,u[d.line])):i>0&&f+y>e.top+e.minSize.height&&(h=d.x=h+e.columnWidths[d.line]+n.padding,d.line++,f=d.y=e.top+_(r,s[d.line]));var w=c.x(h);b(w,f,t),v[i].left=c.leftForLtr(w,v[i].width),v[i].top=f,x(w,f,t,o),q?d.x+=a+n.padding:d.y+=y}),O.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,i,o,a=this;if(e>=a.left&&e<=a.right&&t>=a.top&&t<=a.bottom)for(o=a.legendHitBoxes,n=0;n<o.length;++n)if(i=o[n],e>=i.left&&e<=i.left+i.width&&t>=i.top&&t<=i.top+i.height)return a.legendItems[n];return null},handleEvent:function(e){var t,n=this,i=n.options,o="mouseup"===e.type?"click":e.type;if("mousemove"===o){if(!i.onHover&&!i.onLeave)return}else{if("click"!==o)return;if(!i.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===o?t&&i.onClick&&i.onClick.call(n,e.native,t):(i.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),i.onHover&&t&&i.onHover.call(n,e.native,t))}}),dn={id:"legend",_element:un,beforeInit:function(e){var t=e.options.legend;t&&createNewLegendAndAttach(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(O.mergeIf(t,A.global.legend),n?(Le.configure(e,n,t),n.options=t):createNewLegendAndAttach(e,t)):n&&(Le.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},cn=O.noop;A._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var pn=V.extend({initialize:function(e){var t=this;O.extend(t,e),t.legendHitBoxes=[]},beforeUpdate:cn,update:function(e,t,n){var i=this;return i.beforeUpdate(),i.maxWidth=e,i.maxHeight=t,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:cn,beforeSetDimensions:cn,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:cn,beforeBuildLabels:cn,buildLabels:cn,afterBuildLabels:cn,beforeFit:cn,fit:function(){var e,t,n=this,i=n.options,o=n.minSize={},a=n.isHorizontal();return i.display?(e=O.isArray(i.text)?i.text.length:1,t=e*O.options._parseFont(i).lineHeight+2*i.padding,n.width=o.width=a?n.maxWidth:t,void(n.height=o.height=a?t:n.maxHeight)):void(n.width=o.width=n.height=o.height=0)},afterFit:cn,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var i,o,a,r=O.options._parseFont(n),s=r.lineHeight,l=s/2+n.padding,u=0,d=e.top,c=e.left,p=e.bottom,h=e.right;t.fillStyle=O.valueOrDefault(n.fontColor,A.global.defaultFontColor),t.font=r.string,e.isHorizontal()?(o=c+(h-c)/2,a=d+l,i=h-c):(o="left"===n.position?c+l:h-l,a=d+(p-d)/2,i=p-d,u=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(o,a),t.rotate(u),t.textAlign="center",t.textBaseline="middle";var f=n.text;if(O.isArray(f))for(var g=0,m=0;m<f.length;++m)t.fillText(f[m],0,g,i),g+=s;else t.fillText(f,0,0,i);t.restore()}}}),hn={id:"title",_element:pn,beforeInit:function(e){var t=e.options.title;t&&createNewTitleBlockAndAttach(e,t)},beforeUpdate:function(e){var t=e.options.title,n=e.titleBlock;t?(O.mergeIf(t,A.global.title),n?(Le.configure(e,n,t),n.options=t):createNewTitleBlockAndAttach(e,t)):n&&(Le.removeBox(e,n),delete e.titleBlock)}},fn={},gn=an,mn=dn,vn=hn;fn.filler=gn,fn.legend=mn,fn.title=vn,ct.helpers=O,pt(),ct._adapters=ft,ct.Animation=G,ct.animationService=X,ct.controllers=Ee,ct.DatasetController=K,ct.defaults=A,ct.Element=V,ct.elements=le,ct.Interaction=Be,ct.layouts=Le,ct.platform=et,ct.plugins=tt,ct.Scale=qt,ct.scaleService=nt,ct.Ticks=gt,ct.Tooltip=lt,ct.helpers.each(tn,function(e,t){ct.scaleService.registerScaleType(t,e,e._defaults)});for(var bn in fn)fn.hasOwnProperty(bn)&&ct.plugins.register(fn[bn]);ct.platform.initialize();var xn=ct;return"undefined"!=typeof window&&(window.Chart=ct),ct.Chart=ct,ct.Legend=fn.legend._element,ct.Title=fn.title._element,ct.pluginService=ct.plugins,ct.PluginBase=ct.Element.extend({}),ct.canvasHelpers=ct.helpers.canvas,ct.layoutService=ct.layouts,ct.LinearScaleBase=Dt,ct.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(e){ct[e]=function(t,n){return new ct(t,ct.helpers.merge(n||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}}),xn})},1239:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(136),o=_interopRequireDefault(i),a=n(17),r=_interopRequireDefault(a),s=n(1235),l=_interopRequireDefault(s),u=n(985),d=_interopRequireDefault(u);l.default.defaults.global.showScale=!0,l.default.defaults.global.scaleLineColor="rgba(0,0,0,.05)",l.default.defaults.global.scaleLineWidth=1,l.default.defaults.global.responsive=!0,l.default.defaults.global.maintainAspectRatio=!1,l.default.defaults.global.multiTooltipTemplate="<%=datasetLabel%>: <%= value %>";var c={scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,lineTension:.3,yAxes:[{ticks:{min:0,stepSize:1}}]},p=(0,o.default)({},c,{datasetFill:!1}),h={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,datasetFill:!1},f=(0,o.default)({},h,{scaleShowVerticalLines:!1,scales:{xAxes:[{stacked:!0}],yAxes:[{stacked:!0}]}}),g=["#a0d0e0","#3c8dbc","#4da74d","#ffb311","#8612ee","#aaa"];t.default={name:"chart-widget",data:function(){return{chart:null,canvasHeight:null}},props:{title:String,icon:{type:String,default:"line-chart"},default:null,height:{type:String,default:"300px"},x:String,y:Array,metrics:{type:Object,required:!0},chartType:{type:String,default:"Area"}},computed:{series:function series(){var e=this,series=this.y.map(function(e){return e.id}),t=this.metrics.timeserie(series);return{labels:t.map(function(e){return(0,r.default)(e.date).format("L")}),datasets:this.y.map(function(n,i){var o={label:n.label},a=n.color||g[i];return o.backgroundColor=e.toRGBA(a,.5),o.borderColor=a,o.pointBackgroundColor=a,o.pointHoverBackgroundColor="#fff",o.pointHoverBorderColor=a,o.data=t.map(function(e){return e[n.id]}),o})}}},components:{Box:d.default},ready:function(){this.canvasHeight=this.$els.container.clientHeight,this.buildChart(),this.metrics.$on("updated",this.buildChart.bind(this))},beforeDestroy:function(){this.cleanChart()},watch:{y:function(e,t){e!=t&&this.buildChart()}},methods:{buildChart:function(){if(this.y&&this.metrics&&this.chartType){var e=this["build"+this.chartType],t=this.$els.canvas.getContext("2d");this.cleanChart(),t.canvas.height=this.canvasHeight,this.chart=e(t)}},buildArea:function(e){return new l.default(e,{type:"line",data:this.series,options:c})},buildBar:function(e){return new l.default(e,{type:"bar",data:this.series,options:h})},buildStackedBar:function(e){return new l.default(e,{type:"bar",data:this.series,options:f})},buildLine:function(e){return new l.default(e,{type:"line",data:this.series,options:p})},cleanChart:function(){this.chart&&(this.chart.destroy(),this.chart=null)},toRGBA:function(e,t){var n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(n,function(e,t,n,i){return t+t+n+n+i+i});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return i?"rgba("+parseInt(i[1],16)+","+parseInt(i[2],16)+","+parseInt(i[3],16)+","+t+")":e}}}},1244:function(e,t){e.exports=' <div class=chart-widget> <box :title=title :icon=icon boxclass=box-solid bodyclass=chart-responsive :loading=metrics.loading> <div class=chart :style="{height: height}" v-el:container> <canvas v-el:canvas height=100%></canvas> </div> </box> </div> '},1247:function(e,t,n){var i,o;i=n(1239),o=n(1244),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1254:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1219),o=_interopRequireDefault(i),a=n(1039),r=_interopRequireDefault(a);t.default={name:"community-widget",MASK:["id","title","created_at","dataset{id,title}"],props:{communities:{type:Object,default:function(){return new o.default}},withoutDataset:Boolean,title:{type:String,default:function(){return this._("Community resources")}}},components:{Datatable:r.default},data:function(){var e=[{label:this._("Title"),key:"title",type:"text"},{label:this._("Created on"),key:"created_at",type:"datetime",width:200}];return this.withoutDataset||e.push({label:this._("Dataset"),key:"dataset.title",type:"text",ellipsis:!0}),{fields:e}},events:{"datatable:item:click":function(e){var t=e.dataset?e.dataset.id:"deleted";this.$go({name:"dataset-community-resource",params:{oid:t,rid:e.id}})}}}},1255:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1039),o=_interopRequireDefault(i);t.default={name:"dataset-list",components:{Datatable:o.default},MASK:["id","title","acronym","created_at","last_update","last_modified","metrics","private","quality","archived"],data:function(){return{fields:[{label:this._("Title"),key:function(e){return e.acronym?e.title+" ("+e.acronym+")":e.title},sort:"title",align:"left",type:"deletable-text"},{label:this._("Creation"),key:"created_at",sort:"created",align:"left",type:"timeago",width:120},{label:this._("Metadata update"),key:"last_modified",sort:"last_modified",align:"left",type:"timeago",width:120},{label:this._("Data update"),key:"last_update",sort:"last_update",align:"left",type:"timeago",width:120},{label:this._("Reuses"),key:"metrics.reuses",sort:"reuses",align:"center",type:"metric",width:125},{label:this._("Followers"),key:"metrics.followers",sort:"followers",align:"center",type:"metric",width:95},{label:this._("Views"),key:"metrics.views",sort:"views",align:"center",type:"metric",width:95},{label:this._("Status"),align:"center",type:"visibility",width:95},{label:this._("Quality"),key:"quality.score",align:"center",type:"progress-bars",width:125}]}},events:{"datatable:item:click":function(e){this.$go("/dataset/"+e.id+"/")}},props:{datasets:null,downloads:{type:Array,default:function(){return[]}},title:{type:String,default:function(){return this._("Datasets")}}}}},1256:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(73);_interopRequireDefault(i);t.default={props:{src:null,size:{type:Number,default:100},sizes:{type:Array,default:function(){return[100]}},editable:Boolean,endpoint:null},methods:{click:function(){var e=this;this.editable&&this.$root.$modal(n(1270),{endpoint:this.endpoint,sizes:this.sizes}).$once("image:saved",function(){e.$dispatch("image:saved")})}}}},1257:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(318),o=_interopRequireDefault(i),a=n(1213),r=_interopRequireDefault(a);t.default={name:"image-picker-modal",components:{Modal:o.default,Picker:r.default},props:{endpoint:String,sizes:{type:Array,default:function(){return[100]}}},computed:{title:function(){return this.$refs.picker&&this.$refs.picker.resizing?this._("Resize your thumbnail"):this._("Upload an image")}},events:{"image:saved":function(){return this.$refs.modal.close(),!0}},methods:{click:function(){this.$refs.picker.save()}}}},1259:function(e,t,n){t=e.exports=n(37)(),t.push([e.id,".image-button{position:relative}.image-button img{height:100%;width:100%}.image-button .change-overlay{position:absolute;display:none;top:0;left:0;color:#fff;padding:0 5px;background-color:#666}.image-button.editable:hover{border:1px solid #666;background-color:#b3b3b3}.image-button.editable:hover img{opacity:.5}.image-button.editable:hover .change-overlay{display:block}","",{version:3,sources:["/./js/components/widgets/image-button.vue"],names:[],mappings:"AAAA,cAAc,iBAAiB,CAAC,kBAAkB,YAAY,UAAU,CAAC,8BAA8B,kBAAkB,aAAa,MAAM,OAAO,WAAY,cAAc,qBAAqB,CAAC,6BAA6B,sBAAsB,wBAAwB,CAAC,iCAAiC,UAAU,CAAC,6CAA6C,aAAa,CAAC",file:"image-button.vue",sourcesContent:[".image-button{position:relative}.image-button img{height:100%;width:100%}.image-button .change-overlay{position:absolute;display:none;top:0;left:0;color:white;padding:0 5px;background-color:#666}.image-button.editable:hover{border:1px solid #666;background-color:#b3b3b3}.image-button.editable:hover img{opacity:.5}.image-button.editable:hover .change-overlay{display:block}"],sourceRoot:"webpack://"}])},1260:function(e,t,n){t=e.exports=n(37)(),t.push([e.id,".image-picker-modal .image-picker .uploader .drop-pane{border:5px dashed #fff}","",{version:3,sources:["/./js/components/widgets/image-picker-modal.vue"],names:[],mappings:"AAAA,uDAAuD,sBAAuB,CAAC",file:"image-picker-modal.vue",sourcesContent:[".image-picker-modal .image-picker .uploader .drop-pane{border:5px dashed white}"],sourceRoot:"webpack://"}])},1262:function(e,t){e.exports=" <div> <datatable :title=title icon=code-fork boxclass=community-widget :fields=fields :p=communities :empty=\"_('No community resources')\"> </datatable> </div> "},1263:function(e,t){e.exports=" <div> <datatable :title=title icon=cubes boxclass=datasets-widget :fields=fields :p=datasets :downloads=downloads :empty=\"_('No dataset')\"> </datatable> </div> "},1264:function(e,t){e.exports=" <div class=image-button :class=\"{editable: editable, pointer: editable}\" :style=\"{width:size+'px', height:size+'px'}\" @click=click> <img :src=src /> <small v-if=editable class=change-overlay>{{ _('change') }}</small> </div> "},1265:function(e,t){e.exports=' <div> <modal :title=title class="image-picker-modal modal-info" v-ref:modal> <div class=modal-body> <picker v-ref:picker :endpoint=endpoint :sizes=sizes></picker> </div> <footer class=modal-footer> <button type=button class="btn btn-primary btn-flat pull-left" v-show="$refs.picker && $refs.picker.resizing" @click=click> {{ _(\'Validate\') }} </button> <button type=button class="btn btn-warning btn-flat" @click=$refs.modal.close> {{ _(\'Cancel\') }} </button> </footer> </modal> </div> '},1267:function(e,t,n){var i,o;i=n(1254),o=n(1262),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1268:[1673,1255,1263],1269:function(e,t,n){var i,o;n(1272),i=n(1256),o=n(1264),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1270:function(e,t,n){var i,o;n(1273),i=n(1257),o=n(1265),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1272:function(e,t,n){var i=n(1259);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1273:function(e,t,n){var i=n(1260);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1278:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=_interopRequireDefault(i),a=n(19),r=_interopRequireDefault(a),s=n(27),l=_interopRequireDefault(s),u=n(26),d=_interopRequireDefault(u),c=n(39),p=function(e){function HarvestSourcePage(e){(0,r.default)(this,HarvestSourcePage);var t=(0,l.default)(this,(HarvestSourcePage.__proto__||(0,o.default)(HarvestSourcePage)).call(this,e));return t.$options.ns="harvest",t.$options.fetch="list_harvest_sources",t}return(0,d.default)(HarvestSourcePage,e),HarvestSourcePage}(c.ModelPage);t.default=p},1284:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(39),o=n(1278),a=_interopRequireDefault(o),r=n(1198),s=n(1039),l=_interopRequireDefault(s),u=n(101),d=_interopRequireDefault(u),c=["id","name","owner","last_job{status,ended}","organization{name,logo_thumbnail}","backend","validation{state}","deleted"];t.default={MASK:c,components:{Datatable:l.default},props:{owner:{type:i.Model,default:function(){}}},data:function(){return{title:this._("Harvesters"),sources:new a.default({mask:c,query:{deleted:!0}})}},computed:{fields:function fields(){var e=this,fields=[];return this.owner instanceof i.Model||fields.push({key:function(e){return e.organization?d.default.org_logo(e.organization,30):d.default.user_avatar(e.owner,30)},type:"thumbnail",width:30}),fields.push({label:this._("Name"),key:"name",align:"left",type:"deletable-text"}),this.owner instanceof i.Model||fields.push({label:this._("Owner"),key:function(e){return e.organization?e.organization.name:e.owner.first_name+" "+e.owner.last_name},align:"left",type:"text",width:250}),fields.push({label:this._("Backend"),key:"backend",align:"left",type:"text",width:100},{label:this._("Status"),key:function(e){return e.deleted?"deleted":"pending"==e.validation.state?"validation":"refused"==e.validation.state?"refused":e.last_job.status},type:"label",width:100,label_type:function(e){return e?"validation"==e?"default":"refused"==e?"danger":r.STATUS_CLASSES[e]:"default"},label_func:function(t){return t?"validation"==t?e._("Validation"):"refused"==t?e._("Refused"):r.STATUS_I18N[t]:e._("No job yet")}},{label:this._("Last run"),key:"last_job.ended",align:"left",type:"timeago",width:120}),fields}},events:{"datatable:item:click":function(e){this.$go({name:"harvester",params:{oid:e.id}})}},ready:function(){this.owner instanceof i.Model?this.owner.id&&this.sources.fetch({owner:this.owner.id}):this.sources.fetch()},watch:{"owner.id":function(e){e&&this.sources.fetch({owner:e})}}}},1291:function(e,t){e.exports=" <div> <datatable :title=title icon=tasks boxclass=harvesters-widget :fields=fields :p=sources :loading=sources.loading :empty=\"_('No harvester')\"> </datatable> </div> "},1295:function(e,t,n){var i,o;i=n(1284),o=n(1291),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1302:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=_interopRequireDefault(i),a=n(19),r=_interopRequireDefault(a),s=n(27),l=_interopRequireDefault(s),u=n(26),d=_interopRequireDefault(u),c=n(39),p=n(20),h=(_interopRequireDefault(p),function(e){function ReusePage(e){(0,r.default)(this,ReusePage);var t=(0,l.default)(this,(ReusePage.__proto__||(0,o.default)(ReusePage)).call(this,e));return t.$options.ns="reuses",t.$options.fetch="list_reuses",t}return(0,d.default)(ReusePage,e),ReusePage}(c.ModelPage));t.default=h},1323:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=_interopRequireDefault(i),a=n(19),r=_interopRequireDefault(a),s=n(27),l=_interopRequireDefault(s),u=n(26),d=_interopRequireDefault(u),c=n(39),p=function(e){function DatasetPage(e){(0,r.default)(this,DatasetPage);var t=(0,l.default)(this,(DatasetPage.__proto__||(0,o.default)(DatasetPage)).call(this,e));return t.$options.ns="datasets",t.$options.fetch="list_datasets",t}return(0,d.default)(DatasetPage,e),DatasetPage}(c.ModelPage);t.default=p},1346:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(99),o=_interopRequireDefault(i),a=n(985),r=_interopRequireDefault(a),s=n(1269),l=_interopRequireDefault(s);t.default={name:"user-profile",props:["user"],data:function(){return{title:this._("Profile")}},computed:{endpoint:function(){if(this.user.id===this.$root.me.id){var e=o.default.me.operations.my_avatar;return e.urlify({})}var e=o.default.users.operations.user_avatar;return e.urlify({user:this.user.id})},can_edit:function(){return this.$root.me.is_admin||this.user.id==this.$root.me.id}},components:{Box:r.default,ImageButton:l.default},events:{"image:saved":function(){this.user.fetch()}}}},1354:function(e,t,n){t=e.exports=n(37)(),t.push([e.id,".user-profile-widget .avatar-button{border:1px solid #ccc;float:left;margin:0 10px 5px 0}.user-profile-widget .box-body h3{margin-top:0}.user-profile-widget .profile-body{min-height:100px}","",{version:3,sources:["/./js/components/user/profile.vue"],names:[],mappings:"AAAA,oCAAoC,sBAAsB,WAAW,mBAAmB,CAAC,kCAAkC,YAAY,CAAC,mCAAmC,gBAAgB,CAAC",file:"profile.vue",sourcesContent:[".user-profile-widget .avatar-button{border:1px solid #ccc;float:left;margin:0 10px 5px 0}.user-profile-widget .box-body h3{margin-top:0}.user-profile-widget .profile-body{min-height:100px}"],sourceRoot:"webpack://"}])},1372:function(e,t){e.exports=' <div> <box :title=user.fullname icon=user boxclass=user-profile-widget> <div class=profile-body> <image-button :src="user | avatar_url 100" :size=100 class=avatar-button :endpoint=endpoint :editable=can_edit> </image-button> <div v-markdown=user.about></div> <h4 v-if=user.email>{{user.email}}</h4> </div> </box> </div> '},1390:function(e,t,n){var i,o;n(1398),i=n(1346),o=n(1372),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1398:function(e,t,n){var i=n(1354);"string"==typeof i&&(i=[[e.id,i,""]]);n(38)(i,{sourceMap:!0});i.locals&&(e.exports=i.locals)},1464:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(99),o=_interopRequireDefault(i),a=n(318),r=_interopRequireDefault(a);t.default={components:{Modal:r.default},props:{user:Object},methods:{confirm:function(){var e=this;o.default.users.delete_user({user:this.user.id},function(t){e.$refs.modal.close(),e.$dispatch("notify",{icon:"exclamation-triangle",title:e._("The user {fullname} has been successfully deleted",{fullname:e.user.fullname})}),e.$go({name:"site"})},function(t){e.$refs.modal.close(),e.$dispatch("notify",{type:"error",icon:"exclamation-triangle",title:e._("An error {status} occured",{status:t.status}),details:JSON.parse(t.data).message})})}}}},1494:function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(205),o=_interopRequireDefault(i),a=n(1302),r=_interopRequireDefault(a),s=n(1323),l=_interopRequireDefault(s),u=n(1219),d=_interopRequireDefault(u),c=n(1247),p=_interopRequireDefault(c),h=n(1267),f=_interopRequireDefault(h),g=n(1268),m=_interopRequireDefault(g),v=n(1295),b=_interopRequireDefault(v),x=n(1081),_=_interopRequireDefault(x),q=n(1390),y=_interopRequireDefault(q),w=n(1231),C=_interopRequireDefault(w);t.default={name:"user-view",data:function(){return{user:new o.default,reuses:new r.default({query:{sort:"-created",page_size:10},mask:C.default.MASK}),datasets:new l.default({query:{sort:"-created",page_size:10},mask:m.default.MASK}),communities:new d.default({query:{sort:"-created_at",page_size:10}}),y:[{id:"datasets",label:this._("Datasets")},{id:"reuses",label:this._("Reuses")}]}},components:{Chart:p.default,CommunityList:f.default,DatasetList:m.default,Harvesters:b.default,Layout:_.default,Profile:y.default,ReuseList:C.default},computed:{actions:function actions(){var actions=[];return this.can_edit&&actions.push({label:this._("Edit this user"),icon:"edit",method:this.edit},{label:this._("Delete"),icon:"trash",method:this.confirm_delete}),actions},can_edit:function(){return this.$root.me.is_admin||this.user.id==this.$root.me}},watch:{"user.id":function(e){e?(this.reuses.clear().fetch({owner:e}),this.datasets.clear().fetch({owner:e}),this.communities.clear().fetch({owner:e})):(this.datasets.clear(),this.reuses.clear(),this.communities.clear())}},route:{data:function(){this.$route.params.oid!==this.user.id&&(this.user.fetch(this.$route.params.oid),this.$scrollTo(this.$el))}},methods:{edit:function(){this.$go("/user/edit/"+this.user.id+"/")},confirm_delete:function(){this.$root.$modal(n(1643),{user:this.user})}}}},1561:function(e,t){e.exports=' <modal :title="_(\'Confirm deletion\')" class=modal-danger v-ref:modal> <div class=modal-body> <p class="lead text-center"> {{ _(\'You are about to delete the profile of the user {fullname}.\', {fullname: user.fullname}) }} </p> <p class="lead text-center"> {{ _(\'It will not be possible to recover this profile once deleted.\') }} </p> <p class="lead text-center"> {{ _(\'Are you sure ?\') }} </p> </div> <footer class="modal-footer text-center"> <button type=button class="btn btn-danger btn-flat pull-left" @click=$refs.modal.close> {{ _(\'Cancel\') }} </button> <button type=button class="btn btn-warning btn-flat" @click=confirm> {{ _(\'Confirm\') }} </button> </footer> </modal> '},1591:function(e,t){e.exports=' <div> <layout :title="user.fullname || \'\'" :subtitle="_(\'User\')" :page="user.page || \'\'" :actions=actions> <div class=row> <profile :user=user class="col-xs-12 col-md-6"></profile> </div> <div class=row> <dataset-list class=col-xs-12 :datasets=datasets></dataset-list> </div> <div class=row> <reuse-list class=col-xs-12 :reuses=reuses></reuse-list> </div> <div class=row> <community-list class=col-xs-12 :communities=communities></community-list> </div> <div class=row> <harvesters id=harvesters-widget class=col-xs-12 :owner=user></harvesters> </div> </layout> </div> '},1643:function(e,t,n){var i,o;i=n(1464),o=n(1561),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports.default),o&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=o)},1673:function(e,t,n,i,o){
14
14
  var a,r;a=n(i),r=n(o),e.exports=a||{},e.exports.__esModule&&(e.exports=e.exports.default),r&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=r)}});
15
- //# sourceMappingURL=9.033d7e190ca9e226a5d0.js.map
15
+ //# sourceMappingURL=9.07515e5187f475bce828.js.map