@processmaker/screen-builder 2.85.10 → 2.85.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-form-builder.css +1 -1
- package/dist/vue-form-builder.es.js +8 -4
- package/dist/vue-form-builder.es.js.map +1 -1
- package/dist/vue-form-builder.umd.js +2 -2
- package/dist/vue-form-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/DataProvider.js +11 -3
- package/src/components/renderer/file-upload.vue +1 -6
|
@@ -205,7 +205,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
205
205
|
}
|
|
206
206
|
`],sourceRoot:""}])},function(r,a,i){var n=i(7).each,s={_eventData:null,on:function(o,u){this._eventData||(this._eventData={}),this._eventData[o]||(this._eventData[o]=[]);var l=!1;n(this._eventData[o],function(c){if(c===u)return l=!0,!1}),l||this._eventData[o].push(u)},off:function(o,u){this._eventData||(this._eventData={}),this._eventData[o]&&this._eventData[o].length&&(u?n(this._eventData[o],function(l,c){if(l===u)return this._eventData[o].splice(c,1),!1},this):this._eventData[o]=[])},trigger:function(o){if(this._eventData||(this._eventData={}),!this._eventData[o])return!0;var u=this._eventData[o].slice.call(arguments,1),l=!1;return n(this._eventData[o],function(c){l=c.apply(this,u)===!1||l},this),!l}};r.exports=s},function(r,a,i){function n(l,c,d){o.defineNonEnumerable(this,"uploader",l),this.isRoot=this.isFolder=l===this,o.defineNonEnumerable(this,"parent",d||null),o.defineNonEnumerable(this,"files",[]),o.defineNonEnumerable(this,"fileList",[]),o.defineNonEnumerable(this,"chunks",[]),o.defineNonEnumerable(this,"_errorFiles",[]),o.defineNonEnumerable(this,"file",null),this.id=o.uid(),this.isRoot||!c?this.file=null:o.isString(c)?(this.isFolder=!0,this.file=null,this.path=c,this.parent.path&&(c=c.substr(this.parent.path.length)),this.name=c.charAt(c.length-1)==="/"?c.substr(0,c.length-1):c):(this.file=c,this.fileType=this.file.type,this.name=c.fileName||c.name,this.size=c.size,this.relativePath=c.relativePath||c.webkitRelativePath||this.name,this._parseFile()),this.paused=l.opts.initialPaused,this.error=!1,this.allError=!1,this.aborted=!1,this.completed=!1,this.averageSpeed=0,this.currentSpeed=0,this._lastProgressCallback=Date.now(),this._prevUploadedSize=0,this._prevProgress=0,this.bootstrap()}function s(l){var c=[],d=l.split("/"),p=d.length,v=1;if(d.splice(p-1,1),p--,d.length)for(;v<=p;)c.push(d.slice(0,v++).join("/")+"/");return c}var o=i(7),u=i(22);o.extend(n.prototype,{_parseFile:function(){var l=s(this.relativePath);if(l.length){var c=this.uploader.filePaths;o.each(l,function(d,p){var v=c[d];v||(v=new n(this.uploader,d,this.parent),c[d]=v,this._updateParentFileList(v)),this.parent=v,v.files.push(this),l[p+1]||v.fileList.push(this)},this)}else this._updateParentFileList()},_updateParentFileList:function(l){l||(l=this);var c=this.parent;c&&c.fileList.push(l)},_eachAccess:function(l,c){if(this.isFolder)return void o.each(this.files,function(d,p){return l.call(this,d,p)},this);c.call(this,this)},bootstrap:function(){if(!this.isFolder){var l=this.uploader.opts;o.isFunction(l.initFileFn)&&l.initFileFn.call(this,this),this.abort(!0),this._resetError(),this._prevProgress=0;for(var c=l.forceChunkSize?Math.ceil:Math.floor,d=Math.max(c(this.size/l.chunkSize),1),p=0;p<d;p++)this.chunks.push(new u(this.uploader,this,p))}},_measureSpeed:function(){var l=this.uploader.opts.speedSmoothingFactor,c=Date.now()-this._lastProgressCallback;if(c){var d=this.sizeUploaded();this.currentSpeed=Math.max((d-this._prevUploadedSize)/c*1e3,0),this.averageSpeed=l*this.currentSpeed+(1-l)*this.averageSpeed,this._prevUploadedSize=d,this.parent&&this.parent._checkProgress()&&this.parent._measureSpeed()}},_checkProgress:function(l){return Date.now()-this._lastProgressCallback>=this.uploader.opts.progressCallbacksInterval},_chunkEvent:function(l,c,d){var p=this.uploader,v=u.STATUS,_=this,h=this.getRoot(),y=function(){_._measureSpeed(),p._trigger("fileProgress",h,_,l),_._lastProgressCallback=Date.now()};switch(c){case v.PROGRESS:this._checkProgress()&&y();break;case v.ERROR:this._error(),this.abort(!0),p._trigger("fileError",h,this,d,l);break;case v.SUCCESS:if(this._updateUploadedChunks(d,l),this.error)return;clearTimeout(this._progeressId),this._progeressId=0;var x=Date.now()-this._lastProgressCallback;x<p.opts.progressCallbacksInterval&&(this._progeressId=setTimeout(y,p.opts.progressCallbacksInterval-x)),this.isComplete()?(clearTimeout(this._progeressId),y(),this.currentSpeed=0,this.averageSpeed=0,p._trigger("fileSuccess",h,this,d,l),h.isComplete()&&p._trigger("fileComplete",h,this)):this._progeressId||y();break;case v.RETRY:p._trigger("fileRetry",h,this,l)}},_updateUploadedChunks:function(l,c){var d=this.uploader.opts.checkChunkUploadedByResponse;if(d){var p=c.xhr;o.each(this.chunks,function(v){if(!v.tested){var _=d.call(this,v,l);v!==c||_||(v.xhr=null),_&&(v.xhr=p),v.tested=!0}},this),this._firstResponse?this.uploader.uploadNextChunk():(this._firstResponse=!0,this.uploader.upload(!0))}else this.uploader.uploadNextChunk()},_error:function(){this.error=this.allError=!0;for(var l=this.parent;l&&l!==this.uploader;)l._errorFiles.push(this),l.error=!0,l._errorFiles.length===l.files.length&&(l.allError=!0),l=l.parent},_resetError:function(){this.error=this.allError=!1;for(var l=this.parent,c=-1;l&&l!==this.uploader;)c=l._errorFiles.indexOf(this),l._errorFiles.splice(c,1),l.allError=!1,l._errorFiles.length||(l.error=!1),l=l.parent},isComplete:function(){if(!this.completed){var l=!1;this._eachAccess(function(c){if(!c.isComplete())return l=!0,!1},function(){if(this.error)l=!0;else{var c=u.STATUS;o.each(this.chunks,function(d){var p=d.status();if(p===c.ERROR||p===c.PENDING||p===c.UPLOADING||p===c.READING||d.preprocessState===1||d.readState===1)return l=!0,!1})}}),this.completed=!l}return this.completed},isUploading:function(){var l=!1;return this._eachAccess(function(c){if(c.isUploading())return l=!0,!1},function(){var c=u.STATUS.UPLOADING;o.each(this.chunks,function(d){if(d.status()===c)return l=!0,!1})}),l},resume:function(){this._eachAccess(function(l){l.resume()},function(){this.paused=!1,this.aborted=!1,this.uploader.upload()}),this.paused=!1,this.aborted=!1},pause:function(){this._eachAccess(function(l){l.pause()},function(){this.paused=!0,this.abort()}),this.paused=!0},cancel:function(){this.uploader.removeFile(this)},retry:function(l){var c=function(d){d.error&&d.bootstrap()};l?l.bootstrap():this._eachAccess(c,function(){this.bootstrap()}),this.uploader.upload()},abort:function(l){if(!this.aborted){this.currentSpeed=0,this.averageSpeed=0,this.aborted=!l;var c=this.chunks;l&&(this.chunks=[]);var d=u.STATUS.UPLOADING;o.each(c,function(p){p.status()===d&&(p.abort(),this.uploader.uploadNextChunk())},this)}},progress:function(){var l=0,c=0,d=0;return this._eachAccess(function(p,v){l+=p.progress()*p.size,c+=p.size,v===this.files.length-1&&(d=c>0?l/c:this.isComplete()?1:0)},function(){if(this.error)return void(d=1);if(this.chunks.length===1)return this._prevProgress=Math.max(this._prevProgress,this.chunks[0].progress()),void(d=this._prevProgress);var p=0;o.each(this.chunks,function(_){p+=_.progress()*(_.endByte-_.startByte)});var v=p/this.size;this._prevProgress=Math.max(this._prevProgress,v>.9999?1:v),d=this._prevProgress}),d},getSize:function(){var l=0;return this._eachAccess(function(c){l+=c.size},function(){l+=this.size}),l},getFormatSize:function(){var l=this.getSize();return o.formatSize(l)},getRoot:function(){if(this.isRoot)return this;for(var l=this.parent;l;){if(l.parent===this.uploader)return l;l=l.parent}return this},sizeUploaded:function(){var l=0;return this._eachAccess(function(c){l+=c.sizeUploaded()},function(){o.each(this.chunks,function(c){l+=c.sizeUploaded()})}),l},timeRemaining:function(){function l(v,_){return v&&!_?Number.POSITIVE_INFINITY:v||_?Math.floor(v/_):0}var c=0,d=0,p=0;return this._eachAccess(function(v,_){v.paused||v.error||(d+=v.size-v.sizeUploaded(),p+=v.averageSpeed),_===this.files.length-1&&(c=l(d,p))},function(){if(this.paused||this.error)return void(c=0);var v=this.size-this.sizeUploaded();c=l(v,this.averageSpeed)}),c},removeFile:function(l){if(l.isFolder)for(;l.files.length;){var c=l.files[l.files.length-1];this._removeFile(c)}this._removeFile(l)},_delFilePath:function(l){l.path&&this.filePaths&&delete this.filePaths[l.path],o.each(l.fileList,function(c){this._delFilePath(c)},this)},_removeFile:function(l){if(!l.isFolder){o.each(this.files,function(p,v){if(p===l)return this.files.splice(v,1),!1},this),l.abort();for(var c,d=l.parent;d&&d!==this;)c=d.parent,d._removeFile(l),d=c}l.parent===this&&o.each(this.fileList,function(p,v){if(p===l)return this.fileList.splice(v,1),!1},this),this.isRoot||!this.isFolder||this.files.length||(this.parent._removeFile(this),this.uploader._delFilePath(this)),l.parent=null},getType:function(){return this.isFolder?"folder":this.file.type&&this.file.type.split("/")[1]},getExtension:function(){return this.isFolder?"":this.name.substr(2+(~-this.name.lastIndexOf(".")>>>0)).toLowerCase()}}),r.exports=n},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement;return(i._self._c||n)("div",{directives:[{name:"show",rawName:"v-show",value:!i.support,expression:"!support"}],staticClass:"uploader-unsupport"},[i._t("default",[i._m(0)])],2)},staticRenderFns:[function(){var i=this,n=i.$createElement,s=i._self._c||n;return s("p",[i._v(`
|
|
207
207
|
Your browser, unfortunately, is not supported by Uploader.js. The library requires support for `),s("a",{attrs:{href:"http://www.w3.org/TR/FileAPI/"}},[i._v("the HTML5 File API")]),i._v(" along with "),s("a",{attrs:{href:"http://www.w3.org/TR/FileAPI/#normalization-of-params"}},[i._v("file slicing")]),i._v(`.
|
|
208
|
-
`)])}]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement,s=i._self._c||n;return s("div",{staticClass:"uploader-list"},[i._t("default",[s("ul",i._l(i.fileList,function(o){return s("li",{key:o.id},[s("uploader-file",{attrs:{file:o,list:!0}})],1)}))],{fileList:i.fileList})],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement,s=i._self._c||n;return s("div",{staticClass:"uploader-file",attrs:{status:i.status}},[i._t("default",[s("div",{staticClass:"uploader-file-progress",class:i.progressingClass,style:i.progressStyle}),i._v(" "),s("div",{staticClass:"uploader-file-info"},[s("div",{staticClass:"uploader-file-name"},[s("i",{staticClass:"uploader-file-icon",attrs:{icon:i.fileCategory}}),i._v(i._s(i.file.name))]),i._v(" "),s("div",{staticClass:"uploader-file-size"},[i._v(i._s(i.formatedSize))]),i._v(" "),s("div",{staticClass:"uploader-file-meta"}),i._v(" "),s("div",{staticClass:"uploader-file-status"},[s("span",{directives:[{name:"show",rawName:"v-show",value:i.status!=="uploading",expression:"status !== 'uploading'"}]},[i._v(i._s(i.statusText))]),i._v(" "),s("span",{directives:[{name:"show",rawName:"v-show",value:i.status==="uploading",expression:"status === 'uploading'"}]},[s("span",[i._v(i._s(i.progressStyle.progress))]),i._v(" "),s("em",[i._v(i._s(i.formatedAverageSpeed))]),i._v(" "),s("i",[i._v(i._s(i.formatedTimeRemaining))])])]),i._v(" "),s("div",{staticClass:"uploader-file-actions"},[s("span",{staticClass:"uploader-file-pause",on:{click:i.pause}}),i._v(" "),s("span",{staticClass:"uploader-file-resume",on:{click:i.resume}},[i._v("️")]),i._v(" "),s("span",{staticClass:"uploader-file-retry",on:{click:i.retry}}),i._v(" "),s("span",{staticClass:"uploader-file-remove",on:{click:i.remove}})])])],{file:i.file,list:i.list,status:i.status,paused:i.paused,error:i.error,response:i.response,averageSpeed:i.averageSpeed,formatedAverageSpeed:i.formatedAverageSpeed,currentSpeed:i.currentSpeed,isComplete:i.isComplete,isUploading:i.isUploading,size:i.size,formatedSize:i.formatedSize,uploadedSize:i.uploadedSize,progress:i.progress,progressStyle:i.progressStyle,progressingClass:i.progressingClass,timeRemaining:i.timeRemaining,formatedTimeRemaining:i.formatedTimeRemaining,type:i.type,extension:i.extension,fileCategory:i.fileCategory})],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement,s=i._self._c||n;return s("div",{staticClass:"uploader"},[i._t("default",[s("uploader-unsupport"),i._v(" "),s("uploader-drop",[s("p",[i._v("Drop files here to upload or")]),i._v(" "),s("uploader-btn",[i._v("select files")]),i._v(" "),s("uploader-btn",{attrs:{directory:!0}},[i._v("select folder")])],1),i._v(" "),s("uploader-list")],{files:i.files,fileList:i.fileList,started:i.started})],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement;return(i._self._c||n)("div",{directives:[{name:"show",rawName:"v-show",value:i.support,expression:"support"}],ref:"drop",staticClass:"uploader-drop",class:i.dropClass},[i._t("default")],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement,s=i._self._c||n;return s("div",{staticClass:"uploader-files"},[i._t("default",[s("ul",i._l(i.files,function(o){return s("li",{key:o.id},[s("uploader-file",{attrs:{file:o}})],1)}))],{files:i.files})],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement;return(i._self._c||n)("label",{directives:[{name:"show",rawName:"v-show",value:i.support,expression:"support"}],ref:"btn",staticClass:"uploader-btn"},[i._t("default")],2)},staticRenderFns:[]}},function(r,a,i){var n=i(63);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("2e4f4074",n,!0,{})},function(r,a,i){var n=i(64);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("30297bf6",n,!0,{})},function(r,a,i){var n=i(65);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("9c4391de",n,!0,{})},function(r,a,i){var n=i(66);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("6f0f0164",n,!0,{})},function(r,a,i){var n=i(67);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("f60d437e",n,!0,{})},function(r,a,i){var n=i(68);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("36e02209",n,!0,{})},function(r,a,i){var n=i(69);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("fb1ffb7e",n,!0,{})},function(r,a){r.exports=function(i,n){for(var s=[],o={},u=0;u<n.length;u++){var l=n[u],c=l[0],d=l[1],p=l[2],v=l[3],_={id:i+":"+u,css:d,media:p,sourceMap:v};o[c]?o[c].parts.push(_):s.push(o[c]={id:c,parts:[_]})}return s}}])})})(Wf);var k_=Wf.exports;const __=ar(k_),bX="",w_=vn(),C_=["Cannot read property 'assignBrowse' of null","Cannot read property 'assignDrop' of null","Cannot read properties of null (reading 'assignBrowse')","Cannot read properties of null (reading 'assignDrop')"],T_={components:{...__,RequiredAsterisk:ee.RequiredAsterisk},mixins:[w_],props:["label","error","helper","name","value","controlClass","endpoint","accept","validation","parent","config","multipleUpload"],updated(){this.removeDefaultClasses()},mounted(){this.$root.$on("set-upload-data-name",(t,e,r)=>this.listenRecordList(t,e,r)),this.$root.$on("removed-record",(t,e)=>this.listenRemovedRecord(t,e)),this.$root.$on("removed-loop",(t,e)=>this.listenRemovedLoop(t,e)),window.ProcessMaker.EventBus.$on("modal-shown",()=>{this.clearFiles()}),this.removeDefaultClasses(),this.setPrefix(),this.$refs.uploader&&(this.$refs.uploader.$forceUpdate(),this.files.length>0&&(this.$refs.uploader.uploader.addFiles(this.files),this.uploading=!1)),this.disabled=H.get(window,"ProcessMaker.isSelfService",!1)},errorCaptured(t){if(C_.includes(t.message))return!1},computed:{filesFromGlobalRequestFiles(){return this.value?H.get(window,`PM4ConfigOverrides.requestFiles["${this.fileDataName}"]`,[]).filter(t=>this.multipleUpload?this.value.some(e=>e.file===t.id):t.id===this.value):[]},filesFromCollection(){return this.value?this.filesFromCollectionValue(this.value):[]},collection(){const t=document.head.querySelector('meta[name="collection-id"]');return t?t.content:!1},filesData(){return this.collection?this.filesFromCollection:this.filesFromGlobalRequestFiles},fileIds(){return this.files.map(t=>t.id)},nativeButtonAttrs(){const t={"data-cy":"file-upload-button"};return this.disabled&&(t.disabled=!0),t.accept=this.attrs.accept,t},required(){return this.config&&this.config.validation?this.config.validation==="required":!1},inPreviewMode(){return this.mode==="preview"&&!window.exampleScreens||this.mode==="editor"},mode(){return this.$root.$children[0].mode},classList(){return{"is-invalid":this.validator&&this.validator.errorCount||this.error,[this.controlClass]:!!this.controlClass}},inProgress(){return this.$refs.uploader.fileList.some(t=>t._prevProgress<1)},filesAccept(){if(!this.accept)return null;let t=[];return this.accept.split(",").forEach(e=>{t.push(e.trim())}),t},fileDataName(){return this.prefix+this.name+(this.row_id?"."+this.row_id:"")}},watch:{filesData:{handler(){this.setFiles()},immediate:!0,deep:!0},files:{handler(){this.collection||this.setRequestFiles(),this.$emit("input",this.valueToSend())},deep:!0},name:{handler(){this.options.query.data_name=this.fileDataName},immediate:!0},parent:{handler(){this.options.query.parent=this.parent},immediate:!0},prefix:{handler(){this.options.query.data_name=this.fileDataName},immediate:!0},row_id:{handler(){this.options.query.row_id=this.row_id,this.options.query.data_name=this.prefix+this.name+(this.row_id?"."+this.row_id:"")},immediate:!0},multipleUpload:{handler(){this.options.query.multiple=this.multipleUpload},immediate:!0}},data(){return{uploaderId:1,content:"",validator:{errorCount:0,errors:[]},prefix:"",row_id:null,options:{target:this.getTargetUrl,simultaneousUploads:1,query:{chunk:!0,data_name:this.name,parent:null,row_id:null},testChunks:!1,headers:{"X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":window.ProcessMaker.apiClient.defaults.headers.common["X-CSRF-TOKEN"]},singleFile:!this.multipleUpload},attrs:{accept:this.accept},disabled:!1,files:[],nativeFiles:{},uploading:!1,invalidFile:!1,showComponent:!0}},methods:{clearFiles(){this.showComponent=!1,this.$nextTick(()=>{this.showComponent=!0})},uploaderLoaded(){return this.$refs.uploader},setFiles(){H.isEqual(this.filesData,this.files)||(this.files=this.filesData)},filesFromCollectionValue(t){return t?this.multipleUpload?this.filesFromCollectionMulti(t):this.filesFromCollectionSingle(t):[]},filesFromCollectionSingle(t){return[{id:t.id,file_name:t.name}]},filesFromCollectionMulti(t){return t.map(e=>({id:e.file.id,file_name:e.file.name}))},setRequestFiles(){H.set(window,`PM4ConfigOverrides.requestFiles["${this.fileDataName}"]`,this.files),this.$emit("input",this.valueToSend())},valueToSend(){return this.multipleUpload?this.valueForMulti():this.valueForSingle()},valueForMulti(){return this.files.map(t=>({file:this.formatForType(t)}))},valueForSingle(){return this.files.length>0?this.formatForType(this.files[0]):null},formatForType(t){return this.collection?{id:t.id,name:t.file_name}:t.id},hasFileId(t){return this.fileIds.includes(t)},listenRemovedLoop(t,e){this.deleteAssociatedFiles(e)},listenRemovedRecord(t,e){this.parentRecordList(this)===t&&this.deleteAssociatedFiles(e)},async deleteAssociatedFiles(t){for(const e in t)if(e===this.name&&t[e]){const r=this.idsFromValue(t[e]);for(const a of r)this.hasFileId(a)&&(await this.$dataProvider.deleteFile(a).catch(i=>{}),this.removeFromFiles(a))}},idsFromValue(t){return this.collection?this.filesFromCollectionValue(t).map(e=>e.id):this.multipleUpload?t.map(e=>e.file):[t]},async removeFile(t){const e=t.id,r=t.token?t.token:null;isNaN(e)||await this.$dataProvider.deleteFile(e,r),this.removeFromFiles(e)},removeFromFiles(t){const e=this.files.findIndex(r=>r.id===t);this.$delete(this.files,e),this.nativeFiles[t]&&(this.$refs.uploader&&this.$refs.uploader.uploader.removeFile(this.nativeFiles[t]),this.$delete(this.nativeFiles,t))},addToFiles(t){this.multipleUpload?this.files.push(t):this.files=[t]},listenRecordList(t,e,r){const a=this.parentRecordList(this);a===t&&(this.row_id=a!==null?r:null)},setPrefix(){let t=this.$parent,e=0;for(;!t.loopContext;){if(t=t.$parent,t===this.$root){t=null;break}if(e++,e>100)throw"Loop Error"}t&&t.loopContext&&(this.prefix=t.loopContext+".")},addFile(t){if(this.disabled)return t.ignored=!0,!1;if(t.fileType===void 0){const e=this.files.find(r=>{if(r.name===t.name)return r.fileType});t.fileType=e.fileType}return this.filesAccept&&(t.ignored=!0,this.filesAccept.indexOf(t.fileType)!==-1&&(t.ignored=!1),t.ignored)?(this.invalidFile=!0,this.uploading=!1,window.ProcessMaker.alert(this.$t("This file type is not accepted."),"danger"),!1):(t.ignored=!1,this.name||(this.options.query.data_name=t.name),!0)},removeDefaultClasses(){this.$el.querySelectorAll(".uploader-btn, .uploader-drop").forEach(t=>{t.classList.remove("uploader-btn","uploader-drop")})},browse(t){["Enter","Space"].includes(t.code)&&t.target.click()},fileUploaded(t,e,r){this.uploading=!1;let a=e.name;if(r){const i=JSON.parse(r);let n=i.fileUploadId;this.collection&&(n=i.id);const s={id:n,file_name:a,mime_type:t.fileType,name:a,fileType:t.fileType};this.$set(this.nativeFiles,n,t),this.addToFiles(s)}else this.$emit("input",a)},removed(){this.inProgress||this.complete()},complete(){this.validator.errorCount=0,window.onbeforeunload=function(){}},parentRecordList(t){return t.$parent&&t.$parent.$options?t.$parent.$options._componentTag==="form-record-list"?t.$parent:this.parentRecordList(t.$parent):null},start(){this.invalidFile||(this.uploading=!0,this.parentRecordList(this)===null&&(this.row_id=null),this.validator.errorCount=1,window.onbeforeunload=function(){return!0})},getTargetUrl(){if(H.has(window,"PM4ConfigOverrides.postFileEndpoint"))return window.PM4ConfigOverrides.postFileEndpoint;if(this.endpoint)return this.endpoint;if(this.collection)return"/api/1.0/files?model=ProcessMaker\\Plugins\\Collections\\Models\\Collection&model_id="+this.collection+"&collection=collection";{const t=document.head.querySelector('meta[name="request-id"]');return t?`/api/1.0/requests/${t.content}/files`:null}}}};var A_=function(){var e=this,r=e._self._c;return r("div",[r("required-asterisk"),r("label",{directives:[{name:"uni-for",rawName:"v-uni-for",value:e.name,expression:"name"}]},[e._v(e._s(e.label))]),e.inPreviewMode?r("b-card",{staticClass:"mb-2"},[e._v(" "+e._s(e.$t("File uploads are unavailable in preview mode."))+" ")]):e._e(),!e.inPreviewMode&&e.showComponent?r("uploader",{ref:"uploader",class:{"was-validated":e.required},attrs:{options:e.options,attrs:e.attrs},on:{complete:e.complete,"upload-start":e.start,"file-removed":e.removed,"file-success":e.fileUploaded,"file-added":e.addFile}},[r("uploader-unsupport"),e.uploaderLoaded?r("uploader-drop",{staticClass:"form-control-file"},[r("p",[e._v(e._s(e.$t("Drop a file here to upload or")))]),r("uploader-btn",{staticClass:"btn btn-secondary text-white",class:{disabled:e.disabled},attrs:{attrs:e.nativeButtonAttrs,tabindex:"0","aria-label":e.$attrs["aria-label"]},nativeOn:{keyup:function(a){return e.browse.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("select file"))+" ")]),e.validation==="required"&&!e.value?r("span",{staticClass:"required"},[e._v(e._s(e.$t("Required")))]):e._e()],1):e._e(),r("uploader-list",{scopedSlots:e._u([{key:"default",fn:function({fileList:a}){return[e.uploading?r("ul",e._l(a,function(i){return r("li",{key:i.id},[r("uploader-file",{attrs:{file:i,list:!0}})],1)}),0):r("ul",e._l(e.files,function(i,n){return r("li",{key:n,attrs:{"data-cy":i.id}},[r("div",{},[r("div",{staticStyle:{display:"flex",background:"rgb(226 238 255)"}},[e.nativeFiles[i.id]?r("div",{staticClass:"overflow-hidden",staticStyle:{flex:"1"},attrs:{"data-cy":i.file_name.replace(/[^0-9a-zA-Z\-]/g,"-")}},[r("uploader-file",{attrs:{file:e.nativeFiles[i.id],list:!0}})],1):r("div",{staticClass:"text-truncate",staticStyle:{flex:"1"},attrs:{title:i.file_name}},[r("i",{staticClass:"fas fa-paperclip"}),e._v(" "+e._s(i.file_name)+" ")]),r("div",{staticClass:"pt-1"},[r("b-btn",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{variant:"outline",title:e.$t("Delete")},on:{click:function(s){return e.removeFile(i)}}},[r("i",{staticClass:"fas fa-trash-alt"})])],1)])])])}),0)]}}],null,!1,3267103099)}),r("div",{staticClass:"invalid-feedback",class:{"d-block":e.error&&!e.value}},[e._v(" "+e._s(e.$t("Field is required"))+" ")])],1):e._e(),e.error?r("div",{staticClass:"invalid-feedback"},[e._v(e._s(e.error))]):e._e(),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]):e._e()],1)},O_=[],E_=oe(T_,A_,O_,!1,null,"91ddb437",null,null);const bn=E_.exports,yX="",M_={props:{width:{default:64},height:{default:64}},data(){return{user:window.Processmaker.user}},mounted(){this.getInitials()},methods:{getInitials(){return this.user.firstname&&this.user.lastname?this.user.firstname.match(/./u)[0]+this.user.lastname.match(/./u)[0]:""},variant(){return this.user.avatar?"secondary":"info"},styleAvatar(){return"width: "+this.width+"px; height: "+this.height+"px; font-size:"+this.height/2.5+"px; padding:0;"}}};var $_=function(){var e=this,r=e._self._c;return r("span",[r("b-button",{staticClass:"avatar-button rounded-circle overflow-hidden p-0 m-0 d-inline-flex border-0",style:e.styleAvatar(),attrs:{variant:e.variant(),disabled:""}},[e.user.avatar?r("img",{class:e.image,attrs:{src:e.user.avatar,width:e.width,height:e.height,alt:e.user.fullname}}):r("span",{staticClass:"border-0 d-inline-flex align-items-center justify-content-center text-white text-uppercase text-nowrap font-weight-normal",style:e.styleAvatar()},[e.getInitials()?r("span",[e._v(e._s(e.getInitials()))]):r("span",[e._v("PM")])])])],1)},P_=[],D_=oe(M_,$_,P_,!1,null,"5418080e",null,null);const yn=D_.exports;var Vf={exports:{}};(function(t,e){(function(r,a){t.exports=a()})(wt,function(){/*!
|
|
208
|
+
`)])}]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement,s=i._self._c||n;return s("div",{staticClass:"uploader-list"},[i._t("default",[s("ul",i._l(i.fileList,function(o){return s("li",{key:o.id},[s("uploader-file",{attrs:{file:o,list:!0}})],1)}))],{fileList:i.fileList})],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement,s=i._self._c||n;return s("div",{staticClass:"uploader-file",attrs:{status:i.status}},[i._t("default",[s("div",{staticClass:"uploader-file-progress",class:i.progressingClass,style:i.progressStyle}),i._v(" "),s("div",{staticClass:"uploader-file-info"},[s("div",{staticClass:"uploader-file-name"},[s("i",{staticClass:"uploader-file-icon",attrs:{icon:i.fileCategory}}),i._v(i._s(i.file.name))]),i._v(" "),s("div",{staticClass:"uploader-file-size"},[i._v(i._s(i.formatedSize))]),i._v(" "),s("div",{staticClass:"uploader-file-meta"}),i._v(" "),s("div",{staticClass:"uploader-file-status"},[s("span",{directives:[{name:"show",rawName:"v-show",value:i.status!=="uploading",expression:"status !== 'uploading'"}]},[i._v(i._s(i.statusText))]),i._v(" "),s("span",{directives:[{name:"show",rawName:"v-show",value:i.status==="uploading",expression:"status === 'uploading'"}]},[s("span",[i._v(i._s(i.progressStyle.progress))]),i._v(" "),s("em",[i._v(i._s(i.formatedAverageSpeed))]),i._v(" "),s("i",[i._v(i._s(i.formatedTimeRemaining))])])]),i._v(" "),s("div",{staticClass:"uploader-file-actions"},[s("span",{staticClass:"uploader-file-pause",on:{click:i.pause}}),i._v(" "),s("span",{staticClass:"uploader-file-resume",on:{click:i.resume}},[i._v("️")]),i._v(" "),s("span",{staticClass:"uploader-file-retry",on:{click:i.retry}}),i._v(" "),s("span",{staticClass:"uploader-file-remove",on:{click:i.remove}})])])],{file:i.file,list:i.list,status:i.status,paused:i.paused,error:i.error,response:i.response,averageSpeed:i.averageSpeed,formatedAverageSpeed:i.formatedAverageSpeed,currentSpeed:i.currentSpeed,isComplete:i.isComplete,isUploading:i.isUploading,size:i.size,formatedSize:i.formatedSize,uploadedSize:i.uploadedSize,progress:i.progress,progressStyle:i.progressStyle,progressingClass:i.progressingClass,timeRemaining:i.timeRemaining,formatedTimeRemaining:i.formatedTimeRemaining,type:i.type,extension:i.extension,fileCategory:i.fileCategory})],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement,s=i._self._c||n;return s("div",{staticClass:"uploader"},[i._t("default",[s("uploader-unsupport"),i._v(" "),s("uploader-drop",[s("p",[i._v("Drop files here to upload or")]),i._v(" "),s("uploader-btn",[i._v("select files")]),i._v(" "),s("uploader-btn",{attrs:{directory:!0}},[i._v("select folder")])],1),i._v(" "),s("uploader-list")],{files:i.files,fileList:i.fileList,started:i.started})],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement;return(i._self._c||n)("div",{directives:[{name:"show",rawName:"v-show",value:i.support,expression:"support"}],ref:"drop",staticClass:"uploader-drop",class:i.dropClass},[i._t("default")],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement,s=i._self._c||n;return s("div",{staticClass:"uploader-files"},[i._t("default",[s("ul",i._l(i.files,function(o){return s("li",{key:o.id},[s("uploader-file",{attrs:{file:o}})],1)}))],{files:i.files})],2)},staticRenderFns:[]}},function(r,a){r.exports={render:function(){var i=this,n=i.$createElement;return(i._self._c||n)("label",{directives:[{name:"show",rawName:"v-show",value:i.support,expression:"support"}],ref:"btn",staticClass:"uploader-btn"},[i._t("default")],2)},staticRenderFns:[]}},function(r,a,i){var n=i(63);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("2e4f4074",n,!0,{})},function(r,a,i){var n=i(64);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("30297bf6",n,!0,{})},function(r,a,i){var n=i(65);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("9c4391de",n,!0,{})},function(r,a,i){var n=i(66);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("6f0f0164",n,!0,{})},function(r,a,i){var n=i(67);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("f60d437e",n,!0,{})},function(r,a,i){var n=i(68);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("36e02209",n,!0,{})},function(r,a,i){var n=i(69);typeof n=="string"&&(n=[[r.i,n,""]]),n.locals&&(r.exports=n.locals),i(2)("fb1ffb7e",n,!0,{})},function(r,a){r.exports=function(i,n){for(var s=[],o={},u=0;u<n.length;u++){var l=n[u],c=l[0],d=l[1],p=l[2],v=l[3],_={id:i+":"+u,css:d,media:p,sourceMap:v};o[c]?o[c].parts.push(_):s.push(o[c]={id:c,parts:[_]})}return s}}])})})(Wf);var k_=Wf.exports;const __=ar(k_),bX="",w_=vn(),C_=["Cannot read property 'assignBrowse' of null","Cannot read property 'assignDrop' of null","Cannot read properties of null (reading 'assignBrowse')","Cannot read properties of null (reading 'assignDrop')"],T_={components:{...__,RequiredAsterisk:ee.RequiredAsterisk},mixins:[w_],props:["label","error","helper","name","value","controlClass","endpoint","accept","validation","parent","config","multipleUpload"],updated(){this.removeDefaultClasses()},mounted(){this.$root.$on("set-upload-data-name",(t,e,r)=>this.listenRecordList(t,e,r)),this.$root.$on("removed-record",(t,e)=>this.listenRemovedRecord(t,e)),this.$root.$on("removed-loop",(t,e)=>this.listenRemovedLoop(t,e)),window.ProcessMaker.EventBus.$on("modal-shown",()=>{this.clearFiles()}),this.removeDefaultClasses(),this.setPrefix(),this.$refs.uploader&&this.$refs.uploader.$forceUpdate(),this.disabled=H.get(window,"ProcessMaker.isSelfService",!1)},errorCaptured(t){if(C_.includes(t.message))return!1},computed:{filesFromGlobalRequestFiles(){return this.value?H.get(window,`PM4ConfigOverrides.requestFiles["${this.fileDataName}"]`,[]).filter(t=>this.multipleUpload?this.value.some(e=>e.file===t.id):t.id===this.value):[]},filesFromCollection(){return this.value?this.filesFromCollectionValue(this.value):[]},collection(){const t=document.head.querySelector('meta[name="collection-id"]');return t?t.content:!1},filesData(){return this.collection?this.filesFromCollection:this.filesFromGlobalRequestFiles},fileIds(){return this.files.map(t=>t.id)},nativeButtonAttrs(){const t={"data-cy":"file-upload-button"};return this.disabled&&(t.disabled=!0),t.accept=this.attrs.accept,t},required(){return this.config&&this.config.validation?this.config.validation==="required":!1},inPreviewMode(){return this.mode==="preview"&&!window.exampleScreens||this.mode==="editor"},mode(){return this.$root.$children[0].mode},classList(){return{"is-invalid":this.validator&&this.validator.errorCount||this.error,[this.controlClass]:!!this.controlClass}},inProgress(){return this.$refs.uploader.fileList.some(t=>t._prevProgress<1)},filesAccept(){if(!this.accept)return null;let t=[];return this.accept.split(",").forEach(e=>{t.push(e.trim())}),t},fileDataName(){return this.prefix+this.name+(this.row_id?"."+this.row_id:"")}},watch:{filesData:{handler(){this.setFiles()},immediate:!0,deep:!0},files:{handler(){this.collection||this.setRequestFiles(),this.$emit("input",this.valueToSend())},deep:!0},name:{handler(){this.options.query.data_name=this.fileDataName},immediate:!0},parent:{handler(){this.options.query.parent=this.parent},immediate:!0},prefix:{handler(){this.options.query.data_name=this.fileDataName},immediate:!0},row_id:{handler(){this.options.query.row_id=this.row_id,this.options.query.data_name=this.prefix+this.name+(this.row_id?"."+this.row_id:"")},immediate:!0},multipleUpload:{handler(){this.options.query.multiple=this.multipleUpload},immediate:!0}},data(){return{uploaderId:1,content:"",validator:{errorCount:0,errors:[]},prefix:"",row_id:null,options:{target:this.getTargetUrl,simultaneousUploads:1,query:{chunk:!0,data_name:this.name,parent:null,row_id:null,task_id:H.get(window,"_current_task_id",0)},testChunks:!1,headers:{"X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":window.ProcessMaker.apiClient.defaults.headers.common["X-CSRF-TOKEN"]},singleFile:!this.multipleUpload},attrs:{accept:this.accept},disabled:!1,files:[],nativeFiles:{},uploading:!1,invalidFile:!1,showComponent:!0}},methods:{clearFiles(){this.showComponent=!1,this.$nextTick(()=>{this.showComponent=!0})},uploaderLoaded(){return this.$refs.uploader},setFiles(){H.isEqual(this.filesData,this.files)||(this.files=this.filesData)},filesFromCollectionValue(t){return t?this.multipleUpload?this.filesFromCollectionMulti(t):this.filesFromCollectionSingle(t):[]},filesFromCollectionSingle(t){return[{id:t.id,file_name:t.name}]},filesFromCollectionMulti(t){return t.map(e=>({id:e.file.id,file_name:e.file.name}))},setRequestFiles(){H.set(window,`PM4ConfigOverrides.requestFiles["${this.fileDataName}"]`,this.files),this.$emit("input",this.valueToSend())},valueToSend(){return this.multipleUpload?this.valueForMulti():this.valueForSingle()},valueForMulti(){return this.files.map(t=>({file:this.formatForType(t)}))},valueForSingle(){return this.files.length>0?this.formatForType(this.files[0]):null},formatForType(t){return this.collection?{id:t.id,name:t.file_name}:t.id},hasFileId(t){return this.fileIds.includes(t)},listenRemovedLoop(t,e){this.deleteAssociatedFiles(e)},listenRemovedRecord(t,e){this.parentRecordList(this)===t&&this.deleteAssociatedFiles(e)},async deleteAssociatedFiles(t){for(const e in t)if(e===this.name&&t[e]){const r=this.idsFromValue(t[e]);for(const a of r)this.hasFileId(a)&&(await this.$dataProvider.deleteFile(a).catch(i=>{}),this.removeFromFiles(a))}},idsFromValue(t){return this.collection?this.filesFromCollectionValue(t).map(e=>e.id):this.multipleUpload?t.map(e=>e.file):[t]},async removeFile(t){const e=t.id,r=t.token?t.token:null;isNaN(e)||await this.$dataProvider.deleteFile(e,r),this.removeFromFiles(e)},removeFromFiles(t){const e=this.files.findIndex(r=>r.id===t);this.$delete(this.files,e),this.nativeFiles[t]&&(this.$refs.uploader&&this.$refs.uploader.uploader.removeFile(this.nativeFiles[t]),this.$delete(this.nativeFiles,t))},addToFiles(t){this.multipleUpload?this.files.push(t):this.files=[t]},listenRecordList(t,e,r){const a=this.parentRecordList(this);a===t&&(this.row_id=a!==null?r:null)},setPrefix(){let t=this.$parent,e=0;for(;!t.loopContext;){if(t=t.$parent,t===this.$root){t=null;break}if(e++,e>100)throw"Loop Error"}t&&t.loopContext&&(this.prefix=t.loopContext+".")},addFile(t){if(this.disabled)return t.ignored=!0,!1;if(t.fileType===void 0){const e=this.files.find(r=>{if(r.name===t.name)return r.fileType});t.fileType=e.fileType}return this.filesAccept&&(t.ignored=!0,this.filesAccept.indexOf(t.fileType)!==-1&&(t.ignored=!1),t.ignored)?(this.invalidFile=!0,this.uploading=!1,window.ProcessMaker.alert(this.$t("This file type is not accepted."),"danger"),!1):(t.ignored=!1,this.name||(this.options.query.data_name=t.name),!0)},removeDefaultClasses(){this.$el.querySelectorAll(".uploader-btn, .uploader-drop").forEach(t=>{t.classList.remove("uploader-btn","uploader-drop")})},browse(t){["Enter","Space"].includes(t.code)&&t.target.click()},fileUploaded(t,e,r){this.uploading=!1;let a=e.name;if(r){const i=JSON.parse(r);let n=i.fileUploadId;this.collection&&(n=i.id);const s={id:n,file_name:a,mime_type:t.fileType,name:a,fileType:t.fileType};this.$set(this.nativeFiles,n,t),this.addToFiles(s)}else this.$emit("input",a)},removed(){this.inProgress||this.complete()},complete(){this.validator.errorCount=0,window.onbeforeunload=function(){}},parentRecordList(t){return t.$parent&&t.$parent.$options?t.$parent.$options._componentTag==="form-record-list"?t.$parent:this.parentRecordList(t.$parent):null},start(){this.invalidFile||(this.uploading=!0,this.parentRecordList(this)===null&&(this.row_id=null),this.validator.errorCount=1,window.onbeforeunload=function(){return!0})},getTargetUrl(){if(H.has(window,"PM4ConfigOverrides.postFileEndpoint"))return window.PM4ConfigOverrides.postFileEndpoint;if(this.endpoint)return this.endpoint;if(this.collection)return"/api/1.0/files?model=ProcessMaker\\Plugins\\Collections\\Models\\Collection&model_id="+this.collection+"&collection=collection";{const t=document.head.querySelector('meta[name="request-id"]');return t?`/api/1.0/requests/${t.content}/files`:null}}}};var A_=function(){var e=this,r=e._self._c;return r("div",[r("required-asterisk"),r("label",{directives:[{name:"uni-for",rawName:"v-uni-for",value:e.name,expression:"name"}]},[e._v(e._s(e.label))]),e.inPreviewMode?r("b-card",{staticClass:"mb-2"},[e._v(" "+e._s(e.$t("File uploads are unavailable in preview mode."))+" ")]):e._e(),!e.inPreviewMode&&e.showComponent?r("uploader",{ref:"uploader",class:{"was-validated":e.required},attrs:{options:e.options,attrs:e.attrs},on:{complete:e.complete,"upload-start":e.start,"file-removed":e.removed,"file-success":e.fileUploaded,"file-added":e.addFile}},[r("uploader-unsupport"),e.uploaderLoaded?r("uploader-drop",{staticClass:"form-control-file"},[r("p",[e._v(e._s(e.$t("Drop a file here to upload or")))]),r("uploader-btn",{staticClass:"btn btn-secondary text-white",class:{disabled:e.disabled},attrs:{attrs:e.nativeButtonAttrs,tabindex:"0","aria-label":e.$attrs["aria-label"]},nativeOn:{keyup:function(a){return e.browse.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("select file"))+" ")]),e.validation==="required"&&!e.value?r("span",{staticClass:"required"},[e._v(e._s(e.$t("Required")))]):e._e()],1):e._e(),r("uploader-list",{scopedSlots:e._u([{key:"default",fn:function({fileList:a}){return[e.uploading?r("ul",e._l(a,function(i){return r("li",{key:i.id},[r("uploader-file",{attrs:{file:i,list:!0}})],1)}),0):r("ul",e._l(e.files,function(i,n){return r("li",{key:n,attrs:{"data-cy":i.id}},[r("div",{},[r("div",{staticStyle:{display:"flex",background:"rgb(226 238 255)"}},[e.nativeFiles[i.id]?r("div",{staticClass:"overflow-hidden",staticStyle:{flex:"1"},attrs:{"data-cy":i.file_name.replace(/[^0-9a-zA-Z\-]/g,"-")}},[r("uploader-file",{attrs:{file:e.nativeFiles[i.id],list:!0}})],1):r("div",{staticClass:"text-truncate",staticStyle:{flex:"1"},attrs:{title:i.file_name}},[r("i",{staticClass:"fas fa-paperclip"}),e._v(" "+e._s(i.file_name)+" ")]),r("div",{staticClass:"pt-1"},[r("b-btn",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{variant:"outline",title:e.$t("Delete")},on:{click:function(s){return e.removeFile(i)}}},[r("i",{staticClass:"fas fa-trash-alt"})])],1)])])])}),0)]}}],null,!1,3267103099)}),r("div",{staticClass:"invalid-feedback",class:{"d-block":e.error&&!e.value}},[e._v(" "+e._s(e.$t("Field is required"))+" ")])],1):e._e(),e.error?r("div",{staticClass:"invalid-feedback"},[e._v(e._s(e.error))]):e._e(),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]):e._e()],1)},O_=[],E_=oe(T_,A_,O_,!1,null,"c1f1eef6",null,null);const bn=E_.exports,yX="",M_={props:{width:{default:64},height:{default:64}},data(){return{user:window.Processmaker.user}},mounted(){this.getInitials()},methods:{getInitials(){return this.user.firstname&&this.user.lastname?this.user.firstname.match(/./u)[0]+this.user.lastname.match(/./u)[0]:""},variant(){return this.user.avatar?"secondary":"info"},styleAvatar(){return"width: "+this.width+"px; height: "+this.height+"px; font-size:"+this.height/2.5+"px; padding:0;"}}};var $_=function(){var e=this,r=e._self._c;return r("span",[r("b-button",{staticClass:"avatar-button rounded-circle overflow-hidden p-0 m-0 d-inline-flex border-0",style:e.styleAvatar(),attrs:{variant:e.variant(),disabled:""}},[e.user.avatar?r("img",{class:e.image,attrs:{src:e.user.avatar,width:e.width,height:e.height,alt:e.user.fullname}}):r("span",{staticClass:"border-0 d-inline-flex align-items-center justify-content-center text-white text-uppercase text-nowrap font-weight-normal",style:e.styleAvatar()},[e.getInitials()?r("span",[e._v(e._s(e.getInitials()))]):r("span",[e._v("PM")])])])],1)},P_=[],D_=oe(M_,$_,P_,!1,null,"5418080e",null,null);const yn=D_.exports;var Vf={exports:{}};(function(t,e){(function(r,a){t.exports=a()})(wt,function(){/*!
|
|
209
209
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
210
210
|
* http://github.com/janl/mustache.js
|
|
211
211
|
*/var r=Object.prototype.toString,a=Array.isArray||function(E){return r.call(E)==="[object Array]"};function i(T){return typeof T=="function"}function n(T){return a(T)?"array":typeof T}function s(T){return T.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(T,E){return T!=null&&typeof T=="object"&&E in T}function u(T,E){return T!=null&&typeof T!="object"&&T.hasOwnProperty&&T.hasOwnProperty(E)}var l=RegExp.prototype.test;function c(T,E){return l.call(T,E)}var d=/\S/;function p(T){return!c(d,T)}var v={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function _(T){return String(T).replace(/[&<>"'`=\/]/g,function(z){return v[z]})}var h=/\s*/,y=/\s+/,x=/\s*=/,S=/\s*\}/,b=/#|\^|\/|>|\{|&|=|!/;function f(T,E){if(!T)return[];var z=!1,F=[],N=[],U=[],q=!1,P=!1,D="",I=0;function L(){if(q&&!P)for(;U.length;)delete N[U.pop()];else U=[];q=!1,P=!1}var W,Y,Q;function J(le){if(typeof le=="string"&&(le=le.split(y,2)),!a(le)||le.length!==2)throw new Error("Invalid tags: "+le);W=new RegExp(s(le[0])+"\\s*"),Y=new RegExp("\\s*"+s(le[1])),Q=new RegExp("\\s*"+s("}"+le[1]))}J(E||C.tags);for(var R=new m(T),A,$,j,B,G,Z;!R.eos();){if(A=R.pos,j=R.scanUntil(W),j)for(var te=0,re=j.length;te<re;++te)B=j.charAt(te),p(B)?(U.push(N.length),D+=B):(P=!0,z=!0,D+=" "),N.push(["text",B,A,A+1]),A+=1,B===`
|
|
@@ -265,7 +265,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
265
265
|
`):" "+Dv(n[0]):"as no adapter specified";throw new Oe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return a},adapters:hd};function md(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Wn(null,t)}function zv(t){return md(t),t.headers=Wr.from(t.headers),t.data=fd.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Iv.getAdapter(t.adapter||dd.adapter)(t).then(function(a){return md(t),a.data=fd.call(t,t.transformResponse,a),a.headers=Wr.from(a.headers),a},function(a){return Mv(a)||(md(t),a&&a.response&&(a.response.data=fd.call(t,t.transformResponse,a.response),a.response.headers=Wr.from(a.response.headers))),Promise.reject(a)})}const Lv=t=>t instanceof Wr?t.toJSON():t;function ki(t,e){e=e||{};const r={};function a(l,c,d){return X.isPlainObject(l)&&X.isPlainObject(c)?X.merge.call({caseless:d},l,c):X.isPlainObject(c)?X.merge({},c):X.isArray(c)?c.slice():c}function i(l,c,d){if(X.isUndefined(c)){if(!X.isUndefined(l))return a(void 0,l,d)}else return a(l,c,d)}function n(l,c){if(!X.isUndefined(c))return a(void 0,c)}function s(l,c){if(X.isUndefined(c)){if(!X.isUndefined(l))return a(void 0,l)}else return a(void 0,c)}function o(l,c,d){if(d in e)return a(l,c);if(d in t)return a(void 0,l)}const u={url:n,method:n,data:n,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:o,headers:(l,c)=>i(Lv(l),Lv(c),!0)};return X.forEach(Object.keys(Object.assign({},t,e)),function(c){const d=u[c]||i,p=d(t[c],e[c],c);X.isUndefined(p)&&d!==o||(r[c]=p)}),r}const jv="1.6.7",gd={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{gd[t]=function(a){return typeof a===t||"a"+(e<1?"n ":" ")+t}});const Nv={};gd.transitional=function(e,r,a){function i(n,s){return"[Axios v"+jv+"] Transitional option '"+n+"'"+s+(a?". "+a:"")}return(n,s,o)=>{if(e===!1)throw new Oe(i(s," has been removed"+(r?" in "+r:"")),Oe.ERR_DEPRECATED);return r&&!Nv[s]&&(Nv[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(n,s,o):!0}};function rB(t,e,r){if(typeof t!="object")throw new Oe("options must be an object",Oe.ERR_BAD_OPTION_VALUE);const a=Object.keys(t);let i=a.length;for(;i-- >0;){const n=a[i],s=e[n];if(s){const o=t[n],u=o===void 0||s(o,n,t);if(u!==!0)throw new Oe("option "+n+" must be "+u,Oe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Oe("Unknown option "+n,Oe.ERR_BAD_OPTION)}}const vd={assertOptions:rB,validators:gd},ca=vd.validators;class fl{constructor(e){this.defaults=e,this.interceptors={request:new Cv,response:new Cv}}async request(e,r){try{return await this._request(e,r)}catch(a){if(a instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const n=i.stack?i.stack.replace(/^.+\n/,""):"";a.stack?n&&!String(a.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
266
266
|
`+n):a.stack=n}throw a}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ki(this.defaults,r);const{transitional:a,paramsSerializer:i,headers:n}=r;a!==void 0&&vd.assertOptions(a,{silentJSONParsing:ca.transitional(ca.boolean),forcedJSONParsing:ca.transitional(ca.boolean),clarifyTimeoutError:ca.transitional(ca.boolean)},!1),i!=null&&(X.isFunction(i)?r.paramsSerializer={serialize:i}:vd.assertOptions(i,{encode:ca.function,serialize:ca.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=n&&X.merge(n.common,n[r.method]);n&&X.forEach(["delete","get","head","post","put","patch","common"],_=>{delete n[_]}),r.headers=Wr.concat(s,n);const o=[];let u=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(u=u&&h.synchronous,o.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let c,d=0,p;if(!u){const _=[zv.bind(this),void 0];for(_.unshift.apply(_,o),_.push.apply(_,l),p=_.length,c=Promise.resolve(r);d<p;)c=c.then(_[d++],_[d++]);return c}p=o.length;let v=r;for(d=0;d<p;){const _=o[d++],h=o[d++];try{v=_(v)}catch(y){h.call(this,y);break}}try{c=zv.call(this,v)}catch(_){return Promise.reject(_)}for(d=0,p=l.length;d<p;)c=c.then(l[d++],l[d++]);return c}getUri(e){e=ki(this.defaults,e);const r=$v(e.baseURL,e.url);return ud(r,e.params,e.paramsSerializer)}}X.forEach(["delete","get","head","options"],function(e){fl.prototype[e]=function(r,a){return this.request(ki(a||{},{method:e,url:r,data:(a||{}).data}))}}),X.forEach(["post","put","patch"],function(e){function r(a){return function(n,s,o){return this.request(ki(o||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:n,data:s}))}}fl.prototype[e]=r(),fl.prototype[e+"Form"]=r(!0)});const hl=fl;class bd{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(n){r=n});const a=this;this.promise.then(i=>{if(!a._listeners)return;let n=a._listeners.length;for(;n-- >0;)a._listeners[n](i);a._listeners=null}),this.promise.then=i=>{let n;const s=new Promise(o=>{a.subscribe(o),n=o}).then(i);return s.cancel=function(){a.unsubscribe(n)},s},e(function(n,s,o){a.reason||(a.reason=new Wn(n,s,o),r(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new bd(function(i){e=i}),cancel:e}}}const aB=bd;function iB(t){return function(r){return t.apply(null,r)}}function nB(t){return X.isObject(t)&&t.isAxiosError===!0}const yd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(yd).forEach(([t,e])=>{yd[e]=t});const sB=yd;function Rv(t){const e=new hl(t),r=uv(hl.prototype.request,e);return X.extend(r,hl.prototype,e,{allOwnKeys:!0}),X.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return Rv(ki(t,i))},r}const tt=Rv(dd);tt.Axios=hl,tt.CanceledError=Wn,tt.CancelToken=aB,tt.isCancel=Mv,tt.VERSION=jv,tt.toFormData=cl,tt.AxiosError=Oe,tt.Cancel=tt.CanceledError,tt.all=function(e){return Promise.all(e)},tt.spread=iB,tt.isAxiosError=nB,tt.mergeConfig=ki,tt.AxiosHeaders=Wr,tt.formToJSON=t=>Ov(X.isHTMLForm(t)?new FormData(t):t),tt.getAdapter=Iv.getAdapter,tt.HttpStatusCode=sB,tt.default=tt;const Vn=tt,Un=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ml=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new Fv}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},oB=typeof AbortSignal=="function",lB=typeof ml.AbortSignal=="function",Fv=oB?AbortSignal:lB?ml.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(r=>r(e),this))}onabort(){}addEventListener(e,r){e==="abort"&&this._listeners.push(r)}removeEventListener(e,r){e==="abort"&&(this._listeners=this._listeners.filter(a=>a!==r))}},xd=new Set,Sd=(t,e)=>{const r=`LRU_CACHE_OPTION_${t}`;gl(r)&&_d(r,`${t} option`,`options.${e}`,bl)},kd=(t,e)=>{const r=`LRU_CACHE_METHOD_${t}`;if(gl(r)){const{prototype:a}=bl,{get:i}=Object.getOwnPropertyDescriptor(a,t);_d(r,`${t} method`,`cache.${e}()`,i)}},uB=(t,e)=>{const r=`LRU_CACHE_PROPERTY_${t}`;if(gl(r)){const{prototype:a}=bl,{get:i}=Object.getOwnPropertyDescriptor(a,t);_d(r,`${t} property`,`cache.${e}`,i)}},qv=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},gl=t=>!xd.has(t),_d=(t,e,r,a)=>{xd.add(t);const i=`The ${e} is deprecated. Please use ${r} instead.`;qv(i,"DeprecationWarning",t,a)},da=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Bv=t=>da(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?vl:null:null;let vl=class extends Array{constructor(e){super(e),this.fill(0)}},cB=class{constructor(e){if(e===0)return[];const r=Bv(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},bl=class pf{constructor(e={}){const{max:r=0,ttl:a,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:p,maxSize:v=0,maxEntrySize:_=0,sizeCalculation:h,fetchMethod:y,fetchContext:x,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:k,ignoreFetchAbort:g}=e,{length:m,maxAge:w,stale:O}=e instanceof pf?{}:e;if(r!==0&&!da(r))throw new TypeError("max option must be a nonnegative integer");const C=r?Bv(r):Array;if(!C)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=v,this.maxEntrySize=_||this.maxSize,this.sizeCalculation=h||m,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=y||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=x,!this.fetchMethod&&x!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(r).fill(null),this.valList=new Array(r).fill(null),this.next=new C(r),this.prev=new C(r),this.head=0,this.tail=0,this.free=new cB(r),this.initialFill=1,this.size=0,typeof l=="function"&&(this.dispose=l),typeof c=="function"?(this.disposeAfter=c,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!f,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!g,this.maxEntrySize!==0){if(this.maxSize!==0&&!da(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!da(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!O,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=da(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=a||w||0,this.ttl){if(!da(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const M="LRU_CACHE_UNBOUNDED";gl(M)&&(xd.add(M),qv("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,pf))}O&&Sd("stale","allowStale"),w&&Sd("maxAge","ttl"),m&&Sd("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new vl(this.max),this.starts=new vl(this.max),this.setItemTTL=(a,i,n=Un.now())=>{if(this.starts[a]=i!==0?n:0,this.ttls[a]=i,i!==0&&this.ttlAutopurge){const s=setTimeout(()=>{this.isStale(a)&&this.delete(this.keyList[a])},i+1);s.unref&&s.unref()}},this.updateItemAge=a=>{this.starts[a]=this.ttls[a]!==0?Un.now():0},this.statusTTL=(a,i)=>{a&&(a.ttl=this.ttls[i],a.start=this.starts[i],a.now=e||r(),a.remainingTTL=a.now+a.ttl-a.start)};let e=0;const r=()=>{const a=Un.now();if(this.ttlResolution>0){e=a;const i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return a};this.getRemainingTTL=a=>{const i=this.keyMap.get(a);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||r())},this.isStale=a=>this.ttls[a]!==0&&this.starts[a]!==0&&(e||r())-this.starts[a]>this.ttls[a]}updateItemAge(e){}statusTTL(e,r){}setItemTTL(e,r,a){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new vl(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,a,i)=>{if(this.isBackgroundFetch(r))return 0;if(!da(a))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(a=i(r,e),!da(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a},this.addItemSize=(e,r,a)=>{if(this.sizes[e]=r,this.maxSize){const i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],a&&(a.entrySize=r,a.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,r){}requireSize(e,r,a,i){if(a||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.tail;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.head));)r=this.prev[r]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.head;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.tail));)r=this.next[r]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(const e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(const e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(const e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(const e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(const e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,r){for(const a of this.indexes()){const i=this.valList[a],n=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(n!==void 0&&e(n,this.keyList[a],this))return this.get(this.keyList[a],r)}}forEach(e,r=this){for(const a of this.indexes()){const i=this.valList[a],n=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(r,n,this.keyList[a],this)}}rforEach(e,r=this){for(const a of this.rindexes()){const i=this.valList[a],n=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(r,n,this.keyList[a],this)}}get prune(){return kd("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const r of this.rindexes({allowStale:!0}))this.isStale(r)&&(this.delete(this.keyList[r]),e=!0);return e}dump(){const e=[];for(const r of this.indexes({allowStale:!0})){const a=this.keyList[r],i=this.valList[r],n=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(n===void 0)continue;const s={value:n};if(this.ttls){s.ttl=this.ttls[r];const o=Un.now()-this.starts[r];s.start=Math.floor(Date.now()-o)}this.sizes&&(s.size=this.sizes[r]),e.unshift([a,s])}return e}load(e){this.clear();for(const[r,a]of e){if(a.start){const i=Date.now()-a.start;a.start=Un.now()-i}this.set(r,a.value,a)}}dispose(e,r,a){}set(e,r,{ttl:a=this.ttl,start:i,noDisposeOnSet:n=this.noDisposeOnSet,size:s=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:l}={}){if(s=this.requireSize(e,r,s,o),this.maxEntrySize&&s>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let c=this.size===0?void 0:this.keyMap.get(e);if(c===void 0)c=this.newIndex(),this.keyList[c]=e,this.valList[c]=r,this.keyMap.set(e,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,s,l),l&&(l.set="add"),u=!1;else{this.moveToTail(c);const d=this.valList[c];if(r!==d){if(this.isBackgroundFetch(d)?d.__abortController.abort(new Error("replaced")):n||(this.dispose(d,e,"set"),this.disposeAfter&&this.disposed.push([d,e,"set"])),this.removeItemSize(c),this.valList[c]=r,this.addItemSize(c,s,l),l){l.set="replace";const p=d&&this.isBackgroundFetch(d)?d.__staleWhileFetching:d;p!==void 0&&(l.oldValue=p)}}else l&&(l.set="update")}if(a!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(c,a,i),this.statusTTL(l,c),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const r=this.head,a=this.keyList[r],i=this.valList[r];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,a,"evict"),this.disposeAfter&&this.disposed.push([i,a,"evict"])),this.removeItemSize(r),e&&(this.keyList[r]=null,this.valList[r]=null,this.free.push(r)),this.head=this.next[r],this.keyMap.delete(a),this.size--,r}has(e,{updateAgeOnHas:r=this.updateAgeOnHas,status:a}={}){const i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))a&&(a.has="stale",this.statusTTL(a,i));else return r&&this.updateItemAge(i),a&&(a.has="hit"),this.statusTTL(a,i),!0;else a&&(a.has="miss");return!1}peek(e,{allowStale:r=this.allowStale}={}){const a=this.keyMap.get(e);if(a!==void 0&&(r||!this.isStale(a))){const i=this.valList[a];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,r,a,i){const n=r===void 0?void 0:this.valList[r];if(this.isBackgroundFetch(n))return n;const s=new ml;a.signal&&a.signal.addEventListener("abort",()=>s.abort(a.signal.reason));const o={signal:s.signal,options:a,context:i},u=(v,_=!1)=>{const{aborted:h}=s.signal,y=a.ignoreFetchAbort&&v!==void 0;return a.status&&(h&&!_?(a.status.fetchAborted=!0,a.status.fetchError=s.signal.reason,y&&(a.status.fetchAbortIgnored=!0)):a.status.fetchResolved=!0),h&&!y&&!_?c(s.signal.reason):(this.valList[r]===p&&(v===void 0?p.__staleWhileFetching?this.valList[r]=p.__staleWhileFetching:this.delete(e):(a.status&&(a.status.fetchUpdated=!0),this.set(e,v,o.options))),v)},l=v=>(a.status&&(a.status.fetchRejected=!0,a.status.fetchError=v),c(v)),c=v=>{const{aborted:_}=s.signal,h=_&&a.allowStaleOnFetchAbort,y=h||a.allowStaleOnFetchRejection,x=y||a.noDeleteOnFetchRejection;if(this.valList[r]===p&&(!x||p.__staleWhileFetching===void 0?this.delete(e):h||(this.valList[r]=p.__staleWhileFetching)),y)return a.status&&p.__staleWhileFetching!==void 0&&(a.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw v},d=(v,_)=>{this.fetchMethod(e,n,o).then(h=>v(h),_),s.signal.addEventListener("abort",()=>{(!a.ignoreFetchAbort||a.allowStaleOnFetchAbort)&&(v(),a.allowStaleOnFetchAbort&&(v=h=>u(h,!0)))})};a.status&&(a.status.fetchDispatched=!0);const p=new Promise(d).then(u,l);return p.__abortController=s,p.__staleWhileFetching=n,p.__returned=null,r===void 0?(this.set(e,p,{...o.options,status:void 0}),r=this.keyMap.get(e)):this.valList[r]=p,p}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:r=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,fetchContext:_=this.fetchContext,forceRefresh:h=!1,status:y,signal:x}={}){if(!this.fetchMethod)return y&&(y.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:a,noDeleteOnStaleGet:i,status:y});const S={allowStale:r,updateAgeOnGet:a,noDeleteOnStaleGet:i,ttl:n,noDisposeOnSet:s,size:o,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:v,ignoreFetchAbort:p,status:y,signal:x};let b=this.keyMap.get(e);if(b===void 0){y&&(y.fetch="miss");const f=this.backgroundFetch(e,b,S,_);return f.__returned=f}else{const f=this.valList[b];if(this.isBackgroundFetch(f)){const O=r&&f.__staleWhileFetching!==void 0;return y&&(y.fetch="inflight",O&&(y.returnedStale=!0)),O?f.__staleWhileFetching:f.__returned=f}const k=this.isStale(b);if(!h&&!k)return y&&(y.fetch="hit"),this.moveToTail(b),a&&this.updateItemAge(b),this.statusTTL(y,b),f;const g=this.backgroundFetch(e,b,S,_),m=g.__staleWhileFetching!==void 0,w=m&&r;return y&&(y.fetch=m&&k?"stale":"refresh",w&&k&&(y.returnedStale=!0)),w?g.__staleWhileFetching:g.__returned=g}}get(e,{allowStale:r=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:n}={}){const s=this.keyMap.get(e);if(s!==void 0){const o=this.valList[s],u=this.isBackgroundFetch(o);return this.statusTTL(n,s),this.isStale(s)?(n&&(n.get="stale"),u?(n&&(n.returnedStale=r&&o.__staleWhileFetching!==void 0),r?o.__staleWhileFetching:void 0):(i||this.delete(e),n&&(n.returnedStale=r),r?o:void 0)):(n&&(n.get="hit"),u?o.__staleWhileFetching:(this.moveToTail(s),a&&this.updateItemAge(s),o))}else n&&(n.get="miss")}connect(e,r){this.prev[r]=e,this.next[e]=r}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return kd("del","delete"),this.delete}delete(e){let r=!1;if(this.size!==0){const a=this.keyMap.get(e);if(a!==void 0)if(r=!0,this.size===1)this.clear();else{this.removeItemSize(a);const i=this.valList[a];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[a]=null,this.valList[a]=null,a===this.tail?this.tail=this.prev[a]:a===this.head?this.head=this.next[a]:(this.next[this.prev[a]]=this.next[a],this.prev[this.next[a]]=this.prev[a]),this.size--,this.free.push(a)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return r}clear(){for(const e of this.rindexes({allowStale:!0})){const r=this.valList[e];if(this.isBackgroundFetch(r))r.__abortController.abort(new Error("deleted"));else{const a=this.keyList[e];this.dispose(r,a,"delete"),this.disposeAfter&&this.disposed.push([r,a,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return kd("reset","clear"),this.clear}get length(){return uB("length","size"),this.size}static get AbortController(){return ml}static get AbortSignal(){return Fv}};const dB=bl;function pB(t,e,r,a){function i(n){return n instanceof r?n:new r(function(s){s(n)})}return new(r||(r=Promise))(function(n,s){function o(c){try{l(a.next(c))}catch(d){s(d)}}function u(c){try{l(a.throw(c))}catch(d){s(d)}}function l(c){c.done?n(c.value):i(c.value).then(o,u)}l((a=a.apply(t,e||[])).next())})}function fB(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},a,i,n,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(l){return function(c){return u([l,c])}}function u(l){if(a)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(a=1,i&&(n=l[0]&2?i.return:l[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,l[1])).done)return n;switch(i=0,n&&(l=[l[0]&2,n.value]),l[0]){case 0:case 1:n=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){r.label=l[1];break}if(l[0]===6&&r.label<n[1]){r.label=n[1],n=l;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(l);break}n[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(c){l=[6,c],i=0}finally{a=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;function hB(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=ud.apply(void 0,t),a=r.split("?"),i=a[0],n=a[1];if(n){var s=n.split("&");return"".concat(i,"?").concat(s.sort().join("&"))}return r}function mB(t){return typeof t.get=="function"&&typeof t.set=="function"&&(typeof t.delete=="function"||typeof t.del=="function")}var gB=1e3*60*5,vB=100;function Wv(t,e){var r=this;e===void 0&&(e={});var a=e.enabledByDefault,i=a===void 0?!0:a,n=e.cacheFlag,s=n===void 0?"cache":n,o=e.defaultCache,u=o===void 0?new dB({ttl:gB,max:vB}):o;return function(l){var c=l.url,d=l.method,p=l.params,v=l.paramsSerializer,_=l.forceUpdate,h=l[s]!==void 0&&l[s]!==null?l[s]:i;if(d==="get"&&h){var y=mB(h)?h:u,x=hB(c,p,v),S=y.get(x);return!S||_?(S=function(){return pB(r,void 0,void 0,function(){var b;return fB(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,t(l)];case 1:return[2,f.sent()];case 2:throw b=f.sent(),"delete"in y?y.delete(x):y.del(x),b;case 3:return[2]}})})}(),y.set(x,S),S):({}.LOGGER_LEVEL==="info"&&console.info("[axios-extensions] request cached by cache adapter --> url: ".concat(x)),S)}return t(l)}}const _i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Vv=new Set,wd=typeof process=="object"&&process?process:{},Uv=(t,e,r,a)=>{typeof wd.emitWarning=="function"?wd.emitWarning(t,e,r,a):console.error(`[${r}] ${e}: ${t}`)};let yl=globalThis.AbortController,Gv=globalThis.AbortSignal;if(typeof yl>"u"){Gv=class{constructor(){se(this,"onabort");se(this,"_onabort",[]);se(this,"reason");se(this,"aborted",!1)}addEventListener(a,i){this._onabort.push(i)}},yl=class{constructor(){se(this,"signal",new Gv);e()}abort(a){var i,n;if(!this.signal.aborted){this.signal.reason=a,this.signal.aborted=!0;for(const s of this.signal._onabort)s(a);(n=(i=this.signal).onabort)==null||n.call(i,a)}}};let t=((uk=wd.env)==null?void 0:uk.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,Uv("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const bB=t=>!Vv.has(t),pa=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Hv=t=>pa(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?xl:null:null;class xl extends Array{constructor(e){super(e),this.fill(0)}}const Ka=class Ka{constructor(e,r){se(this,"heap");se(this,"length");if(!V(Ka,Qi))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}static create(e){const r=Hv(e);if(!r)return[];ge(Ka,Qi,!0);const a=new Ka(e,r);return ge(Ka,Qi,!1),a}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Qi=new WeakMap,we(Ka,Qi,!1);let Cd=Ka;const of=class of{constructor(e){we(this,Os);we(this,xu);we(this,Pr);we(this,Dr);we(this,$s);we(this,Zi);we(this,Xi);we(this,ze);we(this,Ps);we(this,Xa);we(this,pr,void 0);we(this,Ft,void 0);we(this,fr,void 0);we(this,hr,void 0);we(this,Ki,void 0);se(this,"ttl");se(this,"ttlResolution");se(this,"ttlAutopurge");se(this,"updateAgeOnGet");se(this,"updateAgeOnHas");se(this,"allowStale");se(this,"noDisposeOnSet");se(this,"noUpdateTTL");se(this,"maxEntrySize");se(this,"sizeCalculation");se(this,"noDeleteOnFetchRejection");se(this,"noDeleteOnStaleGet");se(this,"allowStaleOnFetchAbort");se(this,"allowStaleOnFetchRejection");se(this,"ignoreFetchAbort");we(this,nt,void 0);we(this,mr,void 0);we(this,at,void 0);we(this,Be,void 0);we(this,ke,void 0);we(this,St,void 0);we(this,qt,void 0);we(this,gt,void 0);we(this,st,void 0);we(this,gr,void 0);we(this,ot,void 0);we(this,vr,void 0);we(this,br,void 0);we(this,Bt,void 0);we(this,yr,void 0);we(this,xa,void 0);we(this,kt,void 0);we(this,Ja,()=>{});we(this,ra,()=>{});we(this,Es,()=>{});we(this,Wt,()=>!1);we(this,Za,e=>{});we(this,Ji,(e,r,a)=>{});we(this,Ms,(e,r,a,i)=>{if(a||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:r=0,ttl:a,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:p,maxSize:v=0,maxEntrySize:_=0,sizeCalculation:h,fetchMethod:y,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:f,ignoreFetchAbort:k}=e;if(r!==0&&!pa(r))throw new TypeError("max option must be a nonnegative integer");const g=r?Hv(r):Array;if(!g)throw new Error("invalid max value: "+r);if(ge(this,pr,r),ge(this,Ft,v),this.maxEntrySize=_||V(this,Ft),this.sizeCalculation=h,this.sizeCalculation){if(!V(this,Ft)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(ge(this,Ki,y),ge(this,xa,!!y),ge(this,at,new Map),ge(this,Be,new Array(r).fill(void 0)),ge(this,ke,new Array(r).fill(void 0)),ge(this,St,new g(r)),ge(this,qt,new g(r)),ge(this,gt,0),ge(this,st,0),ge(this,gr,Cd.create(r)),ge(this,nt,0),ge(this,mr,0),typeof l=="function"&&ge(this,fr,l),typeof c=="function"?(ge(this,hr,c),ge(this,ot,[])):(ge(this,hr,void 0),ge(this,ot,void 0)),ge(this,yr,!!V(this,fr)),ge(this,kt,!!V(this,hr)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!f,this.ignoreFetchAbort=!!k,this.maxEntrySize!==0){if(V(this,Ft)!==0&&!pa(V(this,Ft)))throw new TypeError("maxSize must be a positive integer if specified");if(!pa(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");fe(this,xu,pk).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=pa(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=a||0,this.ttl){if(!pa(this.ttl))throw new TypeError("ttl must be a positive integer if specified");fe(this,Os,ff).call(this)}if(V(this,pr)===0&&this.ttl===0&&V(this,Ft)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!V(this,pr)&&!V(this,Ft)){const m="LRU_CACHE_UNBOUNDED";bB(m)&&(Vv.add(m),Uv("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",m,of))}}static unsafeExposeInternals(e){return{starts:V(e,br),ttls:V(e,Bt),sizes:V(e,vr),keyMap:V(e,at),keyList:V(e,Be),valList:V(e,ke),next:V(e,St),prev:V(e,qt),get head(){return V(e,gt)},get tail(){return V(e,st)},free:V(e,gr),isBackgroundFetch:r=>{var a;return fe(a=e,ze,We).call(a,r)},backgroundFetch:(r,a,i,n)=>{var s;return fe(s=e,Xi,Cu).call(s,r,a,i,n)},moveToTail:r=>{var a;return fe(a=e,Xa,Is).call(a,r)},indexes:r=>{var a;return fe(a=e,Pr,Sa).call(a,r)},rindexes:r=>{var a;return fe(a=e,Dr,ka).call(a,r)},isStale:r=>{var a;return V(a=e,Wt).call(a,r)}}}get max(){return V(this,pr)}get maxSize(){return V(this,Ft)}get calculatedSize(){return V(this,mr)}get size(){return V(this,nt)}get fetchMethod(){return V(this,Ki)}get dispose(){return V(this,fr)}get disposeAfter(){return V(this,hr)}getRemainingTTL(e){return V(this,at).has(e)?1/0:0}*entries(){for(const e of fe(this,Pr,Sa).call(this))V(this,ke)[e]!==void 0&&V(this,Be)[e]!==void 0&&!fe(this,ze,We).call(this,V(this,ke)[e])&&(yield[V(this,Be)[e],V(this,ke)[e]])}*rentries(){for(const e of fe(this,Dr,ka).call(this))V(this,ke)[e]!==void 0&&V(this,Be)[e]!==void 0&&!fe(this,ze,We).call(this,V(this,ke)[e])&&(yield[V(this,Be)[e],V(this,ke)[e]])}*keys(){for(const e of fe(this,Pr,Sa).call(this)){const r=V(this,Be)[e];r!==void 0&&!fe(this,ze,We).call(this,V(this,ke)[e])&&(yield r)}}*rkeys(){for(const e of fe(this,Dr,ka).call(this)){const r=V(this,Be)[e];r!==void 0&&!fe(this,ze,We).call(this,V(this,ke)[e])&&(yield r)}}*values(){for(const e of fe(this,Pr,Sa).call(this))V(this,ke)[e]!==void 0&&!fe(this,ze,We).call(this,V(this,ke)[e])&&(yield V(this,ke)[e])}*rvalues(){for(const e of fe(this,Dr,ka).call(this))V(this,ke)[e]!==void 0&&!fe(this,ze,We).call(this,V(this,ke)[e])&&(yield V(this,ke)[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(const a of fe(this,Pr,Sa).call(this)){const i=V(this,ke)[a],n=fe(this,ze,We).call(this,i)?i.__staleWhileFetching:i;if(n!==void 0&&e(n,V(this,Be)[a],this))return this.get(V(this,Be)[a],r)}}forEach(e,r=this){for(const a of fe(this,Pr,Sa).call(this)){const i=V(this,ke)[a],n=fe(this,ze,We).call(this,i)?i.__staleWhileFetching:i;n!==void 0&&e.call(r,n,V(this,Be)[a],this)}}rforEach(e,r=this){for(const a of fe(this,Dr,ka).call(this)){const i=V(this,ke)[a],n=fe(this,ze,We).call(this,i)?i.__staleWhileFetching:i;n!==void 0&&e.call(r,n,V(this,Be)[a],this)}}purgeStale(){let e=!1;for(const r of fe(this,Dr,ka).call(this,{allowStale:!0}))V(this,Wt).call(this,r)&&(this.delete(V(this,Be)[r]),e=!0);return e}info(e){const r=V(this,at).get(e);if(r===void 0)return;const a=V(this,ke)[r],i=fe(this,ze,We).call(this,a)?a.__staleWhileFetching:a;if(i===void 0)return;const n={value:i};if(V(this,Bt)&&V(this,br)){const s=V(this,Bt)[r],o=V(this,br)[r];if(s&&o){const u=s-(_i.now()-o);n.ttl=u,n.start=Date.now()}}return V(this,vr)&&(n.size=V(this,vr)[r]),n}dump(){const e=[];for(const r of fe(this,Pr,Sa).call(this,{allowStale:!0})){const a=V(this,Be)[r],i=V(this,ke)[r],n=fe(this,ze,We).call(this,i)?i.__staleWhileFetching:i;if(n===void 0||a===void 0)continue;const s={value:n};if(V(this,Bt)&&V(this,br)){s.ttl=V(this,Bt)[r];const o=_i.now()-V(this,br)[r];s.start=Math.floor(Date.now()-o)}V(this,vr)&&(s.size=V(this,vr)[r]),e.unshift([a,s])}return e}load(e){this.clear();for(const[r,a]of e){if(a.start){const i=Date.now()-a.start;a.start=_i.now()-i}this.set(r,a.value,a)}}set(e,r,a={}){var p,v,_,h,y;if(r===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:n,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:u}=a;let{noUpdateTTL:l=this.noUpdateTTL}=a;const c=V(this,Ms).call(this,e,r,a.size||0,o);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(e),this;let d=V(this,nt)===0?void 0:V(this,at).get(e);if(d===void 0)d=V(this,nt)===0?V(this,st):V(this,gr).length!==0?V(this,gr).pop():V(this,nt)===V(this,pr)?fe(this,Zi,wu).call(this,!1):V(this,nt),V(this,Be)[d]=e,V(this,ke)[d]=r,V(this,at).set(e,d),V(this,St)[V(this,st)]=d,V(this,qt)[d]=V(this,st),ge(this,st,d),_u(this,nt)._++,V(this,Ji).call(this,d,c,u),u&&(u.set="add"),l=!1;else{fe(this,Xa,Is).call(this,d);const x=V(this,ke)[d];if(r!==x){if(V(this,xa)&&fe(this,ze,We).call(this,x)){x.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:S}=x;S!==void 0&&!s&&(V(this,yr)&&((p=V(this,fr))==null||p.call(this,S,e,"set")),V(this,kt)&&((v=V(this,ot))==null||v.push([S,e,"set"])))}else s||(V(this,yr)&&((_=V(this,fr))==null||_.call(this,x,e,"set")),V(this,kt)&&((h=V(this,ot))==null||h.push([x,e,"set"])));if(V(this,Za).call(this,d),V(this,Ji).call(this,d,c,u),V(this,ke)[d]=r,u){u.set="replace";const S=x&&fe(this,ze,We).call(this,x)?x.__staleWhileFetching:x;S!==void 0&&(u.oldValue=S)}}else u&&(u.set="update")}if(i!==0&&!V(this,Bt)&&fe(this,Os,ff).call(this),V(this,Bt)&&(l||V(this,Es).call(this,d,i,n),u&&V(this,ra).call(this,u,d)),!s&&V(this,kt)&&V(this,ot)){const x=V(this,ot);let S;for(;S=x==null?void 0:x.shift();)(y=V(this,hr))==null||y.call(this,...S)}return this}pop(){var e;try{for(;V(this,nt);){const r=V(this,ke)[V(this,gt)];if(fe(this,Zi,wu).call(this,!0),fe(this,ze,We).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(V(this,kt)&&V(this,ot)){const r=V(this,ot);let a;for(;a=r==null?void 0:r.shift();)(e=V(this,hr))==null||e.call(this,...a)}}}has(e,r={}){const{updateAgeOnHas:a=this.updateAgeOnHas,status:i}=r,n=V(this,at).get(e);if(n!==void 0){const s=V(this,ke)[n];if(fe(this,ze,We).call(this,s)&&s.__staleWhileFetching===void 0)return!1;if(V(this,Wt).call(this,n))i&&(i.has="stale",V(this,ra).call(this,i,n));else return a&&V(this,Ja).call(this,n),i&&(i.has="hit",V(this,ra).call(this,i,n)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){const{allowStale:a=this.allowStale}=r,i=V(this,at).get(e);if(i===void 0||!a&&V(this,Wt).call(this,i))return;const n=V(this,ke)[i];return fe(this,ze,We).call(this,n)?n.__staleWhileFetching:n}async fetch(e,r={}){const{allowStale:a=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:h,forceRefresh:y=!1,status:x,signal:S}=r;if(!V(this,xa))return x&&(x.fetch="get"),this.get(e,{allowStale:a,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:x});const b={allowStale:a,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:s,noDisposeOnSet:o,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:v,status:x,signal:S};let f=V(this,at).get(e);if(f===void 0){x&&(x.fetch="miss");const k=fe(this,Xi,Cu).call(this,e,f,b,h);return k.__returned=k}else{const k=V(this,ke)[f];if(fe(this,ze,We).call(this,k)){const C=a&&k.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",C&&(x.returnedStale=!0)),C?k.__staleWhileFetching:k.__returned=k}const g=V(this,Wt).call(this,f);if(!y&&!g)return x&&(x.fetch="hit"),fe(this,Xa,Is).call(this,f),i&&V(this,Ja).call(this,f),x&&V(this,ra).call(this,x,f),k;const m=fe(this,Xi,Cu).call(this,e,f,b,h),O=m.__staleWhileFetching!==void 0&&a;return x&&(x.fetch=g?"stale":"refresh",O&&g&&(x.returnedStale=!0)),O?m.__staleWhileFetching:m.__returned=m}}get(e,r={}){const{allowStale:a=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:s}=r,o=V(this,at).get(e);if(o!==void 0){const u=V(this,ke)[o],l=fe(this,ze,We).call(this,u);return s&&V(this,ra).call(this,s,o),V(this,Wt).call(this,o)?(s&&(s.get="stale"),l?(s&&a&&u.__staleWhileFetching!==void 0&&(s.returnedStale=!0),a?u.__staleWhileFetching:void 0):(n||this.delete(e),s&&a&&(s.returnedStale=!0),a?u:void 0)):(s&&(s.get="hit"),l?u.__staleWhileFetching:(fe(this,Xa,Is).call(this,o),i&&V(this,Ja).call(this,o),u))}else s&&(s.get="miss")}delete(e){var a,i,n,s;let r=!1;if(V(this,nt)!==0){const o=V(this,at).get(e);if(o!==void 0)if(r=!0,V(this,nt)===1)this.clear();else{V(this,Za).call(this,o);const u=V(this,ke)[o];if(fe(this,ze,We).call(this,u)?u.__abortController.abort(new Error("deleted")):(V(this,yr)||V(this,kt))&&(V(this,yr)&&((a=V(this,fr))==null||a.call(this,u,e,"delete")),V(this,kt)&&((i=V(this,ot))==null||i.push([u,e,"delete"]))),V(this,at).delete(e),V(this,Be)[o]=void 0,V(this,ke)[o]=void 0,o===V(this,st))ge(this,st,V(this,qt)[o]);else if(o===V(this,gt))ge(this,gt,V(this,St)[o]);else{const l=V(this,qt)[o];V(this,St)[l]=V(this,St)[o];const c=V(this,St)[o];V(this,qt)[c]=V(this,qt)[o]}_u(this,nt)._--,V(this,gr).push(o)}}if(V(this,kt)&&((n=V(this,ot))!=null&&n.length)){const o=V(this,ot);let u;for(;u=o==null?void 0:o.shift();)(s=V(this,hr))==null||s.call(this,...u)}return r}clear(){var e,r,a;for(const i of fe(this,Dr,ka).call(this,{allowStale:!0})){const n=V(this,ke)[i];if(fe(this,ze,We).call(this,n))n.__abortController.abort(new Error("deleted"));else{const s=V(this,Be)[i];V(this,yr)&&((e=V(this,fr))==null||e.call(this,n,s,"delete")),V(this,kt)&&((r=V(this,ot))==null||r.push([n,s,"delete"]))}}if(V(this,at).clear(),V(this,ke).fill(void 0),V(this,Be).fill(void 0),V(this,Bt)&&V(this,br)&&(V(this,Bt).fill(0),V(this,br).fill(0)),V(this,vr)&&V(this,vr).fill(0),ge(this,gt,0),ge(this,st,0),V(this,gr).length=0,ge(this,mr,0),ge(this,nt,0),V(this,kt)&&V(this,ot)){const i=V(this,ot);let n;for(;n=i==null?void 0:i.shift();)(a=V(this,hr))==null||a.call(this,...n)}}};pr=new WeakMap,Ft=new WeakMap,fr=new WeakMap,hr=new WeakMap,Ki=new WeakMap,nt=new WeakMap,mr=new WeakMap,at=new WeakMap,Be=new WeakMap,ke=new WeakMap,St=new WeakMap,qt=new WeakMap,gt=new WeakMap,st=new WeakMap,gr=new WeakMap,ot=new WeakMap,vr=new WeakMap,br=new WeakMap,Bt=new WeakMap,yr=new WeakMap,xa=new WeakMap,kt=new WeakMap,Os=new WeakSet,ff=function(){const e=new xl(V(this,pr)),r=new xl(V(this,pr));ge(this,Bt,e),ge(this,br,r),ge(this,Es,(n,s,o=_i.now())=>{if(r[n]=s!==0?o:0,e[n]=s,s!==0&&this.ttlAutopurge){const u=setTimeout(()=>{V(this,Wt).call(this,n)&&this.delete(V(this,Be)[n])},s+1);u.unref&&u.unref()}}),ge(this,Ja,n=>{r[n]=e[n]!==0?_i.now():0}),ge(this,ra,(n,s)=>{if(e[s]){const o=e[s],u=r[s];if(!o||!u)return;n.ttl=o,n.start=u,n.now=a||i();const l=n.now-u;n.remainingTTL=o-l}});let a=0;const i=()=>{const n=_i.now();if(this.ttlResolution>0){a=n;const s=setTimeout(()=>a=0,this.ttlResolution);s.unref&&s.unref()}return n};this.getRemainingTTL=n=>{const s=V(this,at).get(n);if(s===void 0)return 0;const o=e[s],u=r[s];if(!o||!u)return 1/0;const l=(a||i())-u;return o-l},ge(this,Wt,n=>{const s=r[n],o=e[n];return!!o&&!!s&&(a||i())-s>o})},Ja=new WeakMap,ra=new WeakMap,Es=new WeakMap,Wt=new WeakMap,xu=new WeakSet,pk=function(){const e=new xl(V(this,pr));ge(this,mr,0),ge(this,vr,e),ge(this,Za,r=>{ge(this,mr,V(this,mr)-e[r]),e[r]=0}),ge(this,Ms,(r,a,i,n)=>{if(fe(this,ze,We).call(this,a))return 0;if(!pa(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(a,r),!pa(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),ge(this,Ji,(r,a,i)=>{if(e[r]=a,V(this,Ft)){const n=V(this,Ft)-e[r];for(;V(this,mr)>n;)fe(this,Zi,wu).call(this,!0)}ge(this,mr,V(this,mr)+e[r]),i&&(i.entrySize=a,i.totalCalculatedSize=V(this,mr))})},Za=new WeakMap,Ji=new WeakMap,Ms=new WeakMap,Pr=new WeakSet,Sa=function*({allowStale:e=this.allowStale}={}){if(V(this,nt))for(let r=V(this,st);!(!fe(this,$s,hf).call(this,r)||((e||!V(this,Wt).call(this,r))&&(yield r),r===V(this,gt)));)r=V(this,qt)[r]},Dr=new WeakSet,ka=function*({allowStale:e=this.allowStale}={}){if(V(this,nt))for(let r=V(this,gt);!(!fe(this,$s,hf).call(this,r)||((e||!V(this,Wt).call(this,r))&&(yield r),r===V(this,st)));)r=V(this,St)[r]},$s=new WeakSet,hf=function(e){return e!==void 0&&V(this,at).get(V(this,Be)[e])===e},Zi=new WeakSet,wu=function(e){var n,s;const r=V(this,gt),a=V(this,Be)[r],i=V(this,ke)[r];return V(this,xa)&&fe(this,ze,We).call(this,i)?i.__abortController.abort(new Error("evicted")):(V(this,yr)||V(this,kt))&&(V(this,yr)&&((n=V(this,fr))==null||n.call(this,i,a,"evict")),V(this,kt)&&((s=V(this,ot))==null||s.push([i,a,"evict"]))),V(this,Za).call(this,r),e&&(V(this,Be)[r]=void 0,V(this,ke)[r]=void 0,V(this,gr).push(r)),V(this,nt)===1?(ge(this,gt,ge(this,st,0)),V(this,gr).length=0):ge(this,gt,V(this,St)[r]),V(this,at).delete(a),_u(this,nt)._--,r},Xi=new WeakSet,Cu=function(e,r,a,i){const n=r===void 0?void 0:V(this,ke)[r];if(fe(this,ze,We).call(this,n))return n;const s=new yl,{signal:o}=a;o==null||o.addEventListener("abort",()=>s.abort(o.reason),{signal:s.signal});const u={signal:s.signal,options:a,context:i},l=(h,y=!1)=>{const{aborted:x}=s.signal,S=a.ignoreFetchAbort&&h!==void 0;if(a.status&&(x&&!y?(a.status.fetchAborted=!0,a.status.fetchError=s.signal.reason,S&&(a.status.fetchAbortIgnored=!0)):a.status.fetchResolved=!0),x&&!S&&!y)return d(s.signal.reason);const b=v;return V(this,ke)[r]===v&&(h===void 0?b.__staleWhileFetching?V(this,ke)[r]=b.__staleWhileFetching:this.delete(e):(a.status&&(a.status.fetchUpdated=!0),this.set(e,h,u.options))),h},c=h=>(a.status&&(a.status.fetchRejected=!0,a.status.fetchError=h),d(h)),d=h=>{const{aborted:y}=s.signal,x=y&&a.allowStaleOnFetchAbort,S=x||a.allowStaleOnFetchRejection,b=S||a.noDeleteOnFetchRejection,f=v;if(V(this,ke)[r]===v&&(!b||f.__staleWhileFetching===void 0?this.delete(e):x||(V(this,ke)[r]=f.__staleWhileFetching)),S)return a.status&&f.__staleWhileFetching!==void 0&&(a.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw h},p=(h,y)=>{var S;const x=(S=V(this,Ki))==null?void 0:S.call(this,e,n,u);x&&x instanceof Promise&&x.then(b=>h(b===void 0?void 0:b),y),s.signal.addEventListener("abort",()=>{(!a.ignoreFetchAbort||a.allowStaleOnFetchAbort)&&(h(void 0),a.allowStaleOnFetchAbort&&(h=b=>l(b,!0)))})};a.status&&(a.status.fetchDispatched=!0);const v=new Promise(p).then(l,c),_=Object.assign(v,{__abortController:s,__staleWhileFetching:n,__returned:void 0});return r===void 0?(this.set(e,_,{...u.options,status:void 0}),r=V(this,at).get(e)):V(this,ke)[r]=_,_},ze=new WeakSet,We=function(e){if(!V(this,xa))return!1;const r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof yl},Ps=new WeakSet,mf=function(e,r){V(this,qt)[r]=e,V(this,St)[e]=r},Xa=new WeakSet,Is=function(e){e!==V(this,st)&&(e===V(this,gt)?ge(this,gt,V(this,St)[e]):fe(this,Ps,mf).call(this,V(this,qt)[e],V(this,St)[e]),fe(this,Ps,mf).call(this,V(this,st),e),ge(this,st,e))};let Sl=of;function ur(t){"@babel/helpers - typeof";return ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ur(t)}function yB(t,e){if(ur(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(ur(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yv(t){var e=yB(t,"string");return ur(e)=="symbol"?e:String(e)}function xB(t,e,r){return e=Yv(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?Object(arguments[e]):{},a=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&a.push.apply(a,Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),a.forEach(function(i){xB(t,i,r[i])})}return t}function Vr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qv(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Yv(a.key),a)}}function Ur(t,e,r){return e&&Qv(t.prototype,e),r&&Qv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Nt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gn(t,e){if(e&&(ur(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nt(t)}function wi(t){return wi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wi(t)}function Td(t,e){return Td=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},Td(t,e)}function kl(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Td(t,e)}function Ad(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function SB(t){if(Array.isArray(t))return Ad(t)}function kB(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Kv(t,e){if(t){if(typeof t=="string")return Ad(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ad(t,e)}}function _B(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
267
267
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wB(t){return SB(t)||kB(t)||Kv(t)||_B()}var CB={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,r){var a;console&&console[e]&&(a=console)[e].apply(a,wB(r))}},TB=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Vr(this,t),this.init(e,r)}return Ur(t,[{key:"init",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=a.prefix||"i18next:",this.logger=r||CB,this.options=a,this.debug=a.debug}},{key:"setDebug",value:function(r){this.debug=r}},{key:"log",value:function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return this.forward(a,"log","",!0)}},{key:"warn",value:function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return this.forward(a,"warn","",!0)}},{key:"error",value:function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return this.forward(a,"error","")}},{key:"deprecate",value:function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return this.forward(a,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(r,a,i,n){return n&&!this.debug?null:(typeof r[0]=="string"&&(r[0]="".concat(i).concat(this.prefix," ").concat(r[0])),this.logger[a](r))}},{key:"create",value:function(r){return new t(this.logger,jt({},{prefix:"".concat(this.prefix,":").concat(r,":")},this.options))}}]),t}();const Gr=new TB;var fa=function(){function t(){Vr(this,t),this.observers={}}return Ur(t,[{key:"on",value:function(r,a){var i=this;return r.split(" ").forEach(function(n){i.observers[n]=i.observers[n]||[],i.observers[n].push(a)}),this}},{key:"off",value:function(r,a){var i=this;this.observers[r]&&this.observers[r].forEach(function(){if(!a)delete i.observers[r];else{var n=i.observers[r].indexOf(a);n>-1&&i.observers[r].splice(n,1)}})}},{key:"emit",value:function(r){for(var a=arguments.length,i=new Array(a>1?a-1:0),n=1;n<a;n++)i[n-1]=arguments[n];if(this.observers[r]){var s=[].concat(this.observers[r]);s.forEach(function(u){u.apply(void 0,i)})}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach(function(u){u.apply(u,[r].concat(i))})}}}]),t}();function Hn(){var t,e,r=new Promise(function(a,i){t=a,e=i});return r.resolve=t,r.reject=e,r}function Jv(t){return t==null?"":""+t}function AB(t,e,r){t.forEach(function(a){e[a]&&(r[a]=e[a])})}function Od(t,e,r){function a(o){return o&&o.indexOf("###")>-1?o.replace(/###/g,"."):o}function i(){return!t||typeof t=="string"}for(var n=typeof e!="string"?[].concat(e):e.split(".");n.length>1;){if(i())return{};var s=a(n.shift());!t[s]&&r&&(t[s]=new r),t=t[s]}return i()?{}:{obj:t,k:a(n.shift())}}function Zv(t,e,r){var a=Od(t,e,Object),i=a.obj,n=a.k;i[n]=r}function OB(t,e,r,a){var i=Od(t,e,Object),n=i.obj,s=i.k;n[s]=n[s]||[],a&&(n[s]=n[s].concat(r)),a||n[s].push(r)}function _l(t,e){var r=Od(t,e),a=r.obj,i=r.k;if(a)return a[i]}function Xv(t,e,r){for(var a in e)a in t?typeof t[a]=="string"||t[a]instanceof String||typeof e[a]=="string"||e[a]instanceof String?r&&(t[a]=e[a]):Xv(t[a],e[a],r):t[a]=e[a];return t}function Ci(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var EB={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function MB(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,function(e){return EB[e]}):t}var $B=function(t){kl(e,t);function e(r){var a,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Vr(this,e),a=Gn(this,wi(e).call(this)),fa.call(Nt(Nt(a))),a.data=r||{},a.options=i,a.options.keySeparator===void 0&&(a.options.keySeparator="."),a}return Ur(e,[{key:"addNamespaces",value:function(a){this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}},{key:"removeNamespaces",value:function(a){var i=this.options.ns.indexOf(a);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(a,i,n){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=[a,i];return n&&typeof n!="string"&&(u=u.concat(n)),n&&typeof n=="string"&&(u=u.concat(o?n.split(o):n)),a.indexOf(".")>-1&&(u=a.split(".")),_l(this.data,u)}},{key:"addResource",value:function(a,i,n,s){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var l=[a,i];n&&(l=l.concat(u?n.split(u):n)),a.indexOf(".")>-1&&(l=a.split("."),s=i,i=l[1]),this.addNamespaces(i),Zv(this.data,l,s),o.silent||this.emit("added",a,i,n,s)}},{key:"addResources",value:function(a,i,n){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var o in n)(typeof n[o]=="string"||Object.prototype.toString.apply(n[o])==="[object Array]")&&this.addResource(a,i,o,n[o],{silent:!0});s.silent||this.emit("added",a,i,n)}},{key:"addResourceBundle",value:function(a,i,n,s,o){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},l=[a,i];a.indexOf(".")>-1&&(l=a.split("."),s=n,n=i,i=l[1]),this.addNamespaces(i);var c=_l(this.data,l)||{};s?Xv(c,n,o):c=jt({},c,n),Zv(this.data,l,c),u.silent||this.emit("added",a,i,n)}},{key:"removeResourceBundle",value:function(a,i){this.hasResourceBundle(a,i)&&delete this.data[a][i],this.removeNamespaces(i),this.emit("removed",a,i)}},{key:"hasResourceBundle",value:function(a,i){return this.getResource(a,i)!==void 0}},{key:"getResourceBundle",value:function(a,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?jt({},{},this.getResource(a,i)):this.getResource(a,i)}},{key:"getDataByLanguage",value:function(a){return this.data[a]}},{key:"toJSON",value:function(){return this.data}}]),e}(fa);const eb={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,r,a,i,n){var s=this;return e.forEach(function(o){s.processors[o]&&(r=s.processors[o].process(r,a,i,n))}),r}};var tb=function(t){kl(e,t);function e(r){var a,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Vr(this,e),a=Gn(this,wi(e).call(this)),fa.call(Nt(Nt(a))),AB(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat"],r,Nt(Nt(a))),a.options=i,a.options.keySeparator===void 0&&(a.options.keySeparator="."),a.logger=Gr.create("translator"),a}return Ur(e,[{key:"changeLanguage",value:function(a){a&&(this.language=a)}},{key:"exists",value:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},n=this.resolve(a,i);return n&&n.res!==void 0}},{key:"extractFromKey",value:function(a,i){var n=i.nsSeparator||this.options.nsSeparator;n===void 0&&(n=":");var s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ns||this.options.defaultNS;if(n&&a.indexOf(n)>-1){var u=a.split(n);(n!==s||n===s&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),a=u.join(s)}return typeof o=="string"&&(o=[o]),{key:a,namespaces:o}}},{key:"translate",value:function(a,i){var n=this;if(ur(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),a==null)return"";Array.isArray(a)||(a=[String(a)]);var s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=this.extractFromKey(a[a.length-1],i),u=o.key,l=o.namespaces,c=l[l.length-1],d=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&d.toLowerCase()==="cimode"){if(p){var v=i.nsSeparator||this.options.nsSeparator;return c+v+u}return u}var _=this.resolve(a,i),h=_&&_.res,y=_&&_.usedKey||u,x=_&&_.exactUsedKey||u,S=Object.prototype.toString.apply(h),b=["[object Number]","[object Function]","[object RegExp]"],f=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,g=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(k&&h&&g&&b.indexOf(S)<0&&!(typeof f=="string"&&S==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,h,i):"key '".concat(u," (").concat(this.language,")' returned an object instead of string.");if(s){var m=S==="[object Array]",w=m?[]:{},O=m?x:y;for(var C in h)if(Object.prototype.hasOwnProperty.call(h,C)){var M="".concat(O).concat(s).concat(C);w[C]=this.translate(M,jt({},i,{joinArrays:!1,ns:l})),w[C]===M&&(w[C]=h[C])}h=w}}else if(k&&typeof f=="string"&&S==="[object Array]")h=h.join(f),h&&(h=this.extendTranslation(h,a,i));else{var T=!1,E=!1;if(!this.isValidLookup(h)&&i.defaultValue!==void 0){if(T=!0,i.count!==void 0){var z=this.pluralResolver.getSuffix(d,i.count);h=i["defaultValue".concat(z)]}h||(h=i.defaultValue)}this.isValidLookup(h)||(E=!0,h=u);var F=i.defaultValue&&i.defaultValue!==h&&this.options.updateMissing;if(E||T||F){this.logger.log(F?"updateKey":"missingKey",d,c,u,F?i.defaultValue:h);var N=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(var q=0;q<U.length;q++)N.push(U[q]);else this.options.saveMissingTo==="all"?N=this.languageUtils.toResolveHierarchy(i.lng||this.language):N.push(i.lng||this.language);var P=function(L,W){n.options.missingKeyHandler?n.options.missingKeyHandler(L,c,W,F?i.defaultValue:h,F,i):n.backendConnector&&n.backendConnector.saveMissing&&n.backendConnector.saveMissing(L,c,W,F?i.defaultValue:h,F,i),n.emit("missingKey",L,c,W,h)};if(this.options.saveMissing){var D=i.count!==void 0&&typeof i.count!="string";this.options.saveMissingPlurals&&D?N.forEach(function(I){var L=n.pluralResolver.getPluralFormsOfKey(I,u);L.forEach(function(W){return P([I],W)})}):P(N,u)}}h=this.extendTranslation(h,a,i,_),E&&h===u&&this.options.appendNamespaceToMissingKey&&(h="".concat(c,":").concat(u)),E&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(a,i,n,s){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)a=this.i18nFormat.parse(a,n,s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(jt({},n,{interpolation:jt({},this.options.interpolation,n.interpolation)}));var u=n.replace&&typeof n.replace!="string"?n.replace:n;this.options.interpolation.defaultVariables&&(u=jt({},this.options.interpolation.defaultVariables,u)),a=this.interpolator.interpolate(a,u,n.lng||this.language,n),n.nest!==!1&&(a=this.interpolator.nest(a,function(){return o.translate.apply(o,arguments)},n)),n.interpolation&&this.interpolator.reset()}var l=n.postProcess||this.options.postProcess,c=typeof l=="string"?[l]:l;return a!=null&&c&&c.length&&n.applyPostProcessor!==!1&&(a=eb.handle(c,a,i,n,this)),a}},{key:"resolve",value:function(a){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,o,u,l,c;return typeof a=="string"&&(a=[a]),a.forEach(function(d){if(!i.isValidLookup(s)){var p=i.extractFromKey(d,n),v=p.key;o=v;var _=p.namespaces;i.options.fallbackNS&&(_=_.concat(i.options.fallbackNS));var h=n.count!==void 0&&typeof n.count!="string",y=n.context!==void 0&&typeof n.context=="string"&&n.context!=="",x=n.lngs?n.lngs:i.languageUtils.toResolveHierarchy(n.lng||i.language,n.fallbackLng);_.forEach(function(S){i.isValidLookup(s)||(c=S,x.forEach(function(b){if(!i.isValidLookup(s)){l=b;var f=v,k=[f];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(k,v,b,S,n);else{var g;h&&(g=i.pluralResolver.getSuffix(b,n.count)),h&&y&&k.push(f+g),y&&k.push(f+="".concat(i.options.contextSeparator).concat(n.context)),h&&k.push(f+=g)}for(var m;m=k.pop();)i.isValidLookup(s)||(u=m,s=i.getResource(b,S,m,n))}}))})}}),{res:s,usedKey:o,exactUsedKey:u,usedLng:l,usedNS:c}}},{key:"isValidLookup",value:function(a){return a!==void 0&&!(!this.options.returnNull&&a===null)&&!(!this.options.returnEmptyString&&a==="")}},{key:"getResource",value:function(a,i,n){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(a,i,n,s):this.resourceStore.getResource(a,i,n,s)}}]),e}(fa);function Ed(t){return t.charAt(0).toUpperCase()+t.slice(1)}var PB=function(){function t(e){Vr(this,t),this.options=e,this.whitelist=this.options.whitelist||!1,this.logger=Gr.create("languageUtils")}return Ur(t,[{key:"getScriptPartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return null;var a=r.split("-");return a.length===2?null:(a.pop(),this.formatLanguageCode(a.join("-")))}},{key:"getLanguagePartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return r;var a=r.split("-");return this.formatLanguageCode(a[0])}},{key:"formatLanguageCode",value:function(r){if(typeof r=="string"&&r.indexOf("-")>-1){var a=["hans","hant","latn","cyrl","cans","mong","arab"],i=r.split("-");return this.options.lowerCaseLng?i=i.map(function(n){return n.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),a.indexOf(i[1].toLowerCase())>-1&&(i[1]=Ed(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),a.indexOf(i[1].toLowerCase())>-1&&(i[1]=Ed(i[1].toLowerCase())),a.indexOf(i[2].toLowerCase())>-1&&(i[2]=Ed(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}},{key:"isWhitelisted",value:function(r){return(this.options.load==="languageOnly"||this.options.nonExplicitWhitelist)&&(r=this.getLanguagePartFromCode(r)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(r)>-1}},{key:"getFallbackCodes",value:function(r,a){if(!r)return[];if(typeof r=="string"&&(r=[r]),Object.prototype.toString.apply(r)==="[object Array]")return r;if(!a)return r.default||[];var i=r[a];return i||(i=r[this.getScriptPartFromCode(a)]),i||(i=r[this.formatLanguageCode(a)]),i||(i=r.default),i||[]}},{key:"toResolveHierarchy",value:function(r,a){var i=this,n=this.getFallbackCodes(a||this.options.fallbackLng||[],r),s=[],o=function(l){l&&(i.isWhitelisted(l)?s.push(l):i.logger.warn("rejecting non-whitelisted language code: ".concat(l)))};return typeof r=="string"&&r.indexOf("-")>-1?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(r))):typeof r=="string"&&o(this.formatLanguageCode(r)),n.forEach(function(u){s.indexOf(u)<0&&o(i.formatLanguageCode(u))}),s}}]),t}(),DB=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he"],nr:[1,2,20,21],fc:22}],IB={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e===0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e===0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e===0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e===1?0:e===2?1:(e<0||e>10)&&e%10==0?2:3}};function zB(){var t={};return DB.forEach(function(e){e.lngs.forEach(function(r){t[r]={numbers:e.nr,plurals:IB[e.fc]}})}),t}var LB=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Vr(this,t),this.languageUtils=e,this.options=r,this.logger=Gr.create("pluralResolver"),this.rules=zB()}return Ur(t,[{key:"addRule",value:function(r,a){this.rules[r]=a}},{key:"getRule",value:function(r){return this.rules[r]||this.rules[this.languageUtils.getLanguagePartFromCode(r)]}},{key:"needsPlural",value:function(r){var a=this.getRule(r);return a&&a.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(r,a){var i=this,n=[],s=this.getRule(r);return s&&s.numbers.forEach(function(o){var u=i.getSuffix(r,o);n.push("".concat(a).concat(u))}),n}},{key:"getSuffix",value:function(r,a){var i=this,n=this.getRule(r);if(n){var s=n.noAbs?n.plurals(a):n.plurals(Math.abs(a)),o=n.numbers[s];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var u=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):u():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?u():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}return this.logger.warn("no plural rule found for: ".concat(r)),""}}]),t}(),jB=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vr(this,t),this.logger=Gr.create("interpolator"),this.init(e,!0)}return Ur(t,[{key:"init",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;a&&(this.options=r,this.format=r.interpolation&&r.interpolation.format||function(n){return n}),r.interpolation||(r.interpolation={escapeValue:!0});var i=r.interpolation;this.escape=i.escape!==void 0?i.escape:MB,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?Ci(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?Ci(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?Ci(i.nestingPrefix):i.nestingPrefixEscaped||Ci("$t("),this.nestingSuffix=i.nestingSuffix?Ci(i.nestingSuffix):i.nestingSuffixEscaped||Ci(")"),this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var r="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(r,"g");var a="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(a,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(r,a,i,n){var s=this,o,u,l;function c(_){return _.replace(/\$/g,"$$$$")}var d=function(h){if(h.indexOf(s.formatSeparator)<0)return _l(a,h);var y=h.split(s.formatSeparator),x=y.shift().trim(),S=y.join(s.formatSeparator).trim();return s.format(_l(a,x),S,i)};this.resetRegExp();var p=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler;for(l=0;(o=this.regexpUnescape.exec(r))&&(u=d(o[1].trim()),r=r.replace(o[0],u),this.regexpUnescape.lastIndex=0,l++,!(l>=this.maxReplaces)););for(l=0;o=this.regexp.exec(r);){if(u=d(o[1].trim()),u===void 0)if(typeof p=="function"){var v=p(r,o,n);u=typeof v=="string"?v:""}else this.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(r)),u="";else typeof u!="string"&&!this.useRawValueToEscape&&(u=Jv(u));if(u=this.escapeValue?c(this.escape(u)):c(u),r=r.replace(o[0],u),this.regexp.lastIndex=0,l++,l>=this.maxReplaces)break}return r}},{key:"nest",value:function(r,a){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n,s,o=jt({},i);o.applyPostProcessor=!1;function u(l,c){if(l.indexOf(",")<0)return l;var d=l.split(",");l=d.shift();var p=d.join(",");p=this.interpolate(p,o),p=p.replace(/'/g,'"');try{o=JSON.parse(p),c&&(o=jt({},c,o))}catch(v){this.logger.error("failed parsing options string in nesting for key ".concat(l),v)}return l}for(;n=this.nestingRegexp.exec(r);){if(s=a(u.call(this,n[1].trim(),o),o),s&&n[0]===r&&typeof s!="string")return s;typeof s!="string"&&(s=Jv(s)),s||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(r)),s=""),r=r.replace(n[0],s),this.regexp.lastIndex=0}return r}}]),t}();function NB(t){if(Array.isArray(t))return t}function RB(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a,i,n,s,o=[],u=!0,l=!1;try{if(n=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(a=n.call(r)).done)&&(o.push(a.value),o.length!==e);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}function FB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
268
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rb(t,e){return NB(t)||RB(t,e)||Kv(t,e)||FB()}function qB(t,e){for(var r=t.indexOf(e);r!==-1;)t.splice(r,1),r=t.indexOf(e)}var BB=function(t){kl(e,t);function e(r,a,i){var n,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Vr(this,e),n=Gn(this,wi(e).call(this)),fa.call(Nt(Nt(n))),n.backend=r,n.store=a,n.languageUtils=i.languageUtils,n.options=s,n.logger=Gr.create("backendConnector"),n.state={},n.queue=[],n.backend&&n.backend.init&&n.backend.init(i,s.backend,s),n}return Ur(e,[{key:"queueLoad",value:function(a,i,n,s){var o=this,u=[],l=[],c=[],d=[];return a.forEach(function(p){var v=!0;i.forEach(function(_){var h="".concat(p,"|").concat(_);!n.reload&&o.store.hasResourceBundle(p,_)?o.state[h]=2:o.state[h]<0||(o.state[h]===1?l.indexOf(h)<0&&l.push(h):(o.state[h]=1,v=!1,l.indexOf(h)<0&&l.push(h),u.indexOf(h)<0&&u.push(h),d.indexOf(_)<0&&d.push(_)))}),v||c.push(p)}),(u.length||l.length)&&this.queue.push({pending:l,loaded:{},errors:[],callback:s}),{toLoad:u,pending:l,toLoadLanguages:c,toLoadNamespaces:d}}},{key:"loaded",value:function(a,i,n){var s=a.split("|"),o=rb(s,2),u=o[0],l=o[1];i&&this.emit("failedLoading",u,l,i),n&&this.store.addResourceBundle(u,l,n),this.state[a]=i?-1:2;var c={};this.queue.forEach(function(d){OB(d.loaded,[u],l),qB(d.pending,a),i&&d.errors.push(i),d.pending.length===0&&!d.done&&(Object.keys(d.loaded).forEach(function(p){c[p]||(c[p]=[]),d.loaded[p].length&&d.loaded[p].forEach(function(v){c[p].indexOf(v)<0&&c[p].push(v)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(a,i,n){var s=this,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:250,l=arguments.length>5?arguments[5]:void 0;return a.length?this.backend[n](a,i,function(c,d){if(c&&d&&o<5){setTimeout(function(){s.read.call(s,a,i,n,o+1,u*2,l)},u);return}l(c,d)}):l(null,{})}},{key:"prepareLoading",value:function(a,i){var n=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof a=="string"&&(a=this.languageUtils.toResolveHierarchy(a)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(a,i,s,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(function(l){n.loadOne(l)})}},{key:"load",value:function(a,i,n){this.prepareLoading(a,i,{},n)}},{key:"reload",value:function(a,i,n){this.prepareLoading(a,i,{reload:!0},n)}},{key:"loadOne",value:function(a){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=a.split("|"),o=rb(s,2),u=o[0],l=o[1];this.read(u,l,"read",null,null,function(c,d){c&&i.logger.warn("".concat(n,"loading namespace ").concat(l," for language ").concat(u," failed"),c),!c&&d&&i.logger.log("".concat(n,"loaded namespace ").concat(l," for language ").concat(u),d),i.loaded(a,c,d)})}},{key:"saveMissing",value:function(a,i,n,s,o){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.backend&&this.backend.create&&this.backend.create(a,i,n,s,null,jt({},u,{isUpdate:o})),!(!a||!a[0])&&this.store.addResource(a[0],i,n,s)}}]),e}(fa);function WB(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var r={};if(ur(e[1])==="object"&&(r=e[1]),typeof e[1]=="string"&&(r.defaultValue=e[1]),typeof e[2]=="string"&&(r.tDescription=e[2]),ur(e[2])==="object"||ur(e[3])==="object"){var a=e[3]||e[2];Object.keys(a).forEach(function(i){r[i]=a[i]})}return r},interpolation:{escapeValue:!0,format:function(e,r,a){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}}}function ab(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&t.whitelist.indexOf("cimode")<0&&(t.whitelist=t.whitelist.concat(["cimode"])),t}function wl(){}var VB=function(t){kl(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Vr(this,e),r=Gn(this,wi(e).call(this)),fa.call(Nt(Nt(r))),r.options=ab(a),r.services={},r.logger=Gr,r.modules={external:[]},i&&!r.isInitialized&&!a.isClone){if(!r.options.initImmediate)return r.init(a,i),Gn(r,Nt(Nt(r)));setTimeout(function(){r.init(a,i)},0)}return r}return Ur(e,[{key:"init",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(n=i,i={}),this.options=jt({},WB(),this.options,ab(i)),this.format=this.options.interpolation.format,n||(n=wl);function s(p){return p?typeof p=="function"?new p:p:null}if(!this.options.isClone){this.modules.logger?Gr.init(s(this.modules.logger),this.options):Gr.init(null,this.options);var o=new PB(this.options);this.store=new $B(this.options.resources,this.options);var u=this.services;u.logger=Gr,u.resourceStore=this.store,u.languageUtils=o,u.pluralResolver=new LB(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u.interpolator=new jB(this.options),u.backendConnector=new BB(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(p){for(var v=arguments.length,_=new Array(v>1?v-1:0),h=1;h<v;h++)_[h-1]=arguments[h];a.emit.apply(a,[p].concat(_))}),this.modules.languageDetector&&(u.languageDetector=s(this.modules.languageDetector),u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=s(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new tb(this.services,this.options),this.translator.on("*",function(p){for(var v=arguments.length,_=new Array(v>1?v-1:0),h=1;h<v;h++)_[h-1]=arguments[h];a.emit.apply(a,[p].concat(_))}),this.modules.external.forEach(function(p){p.init&&p.init(a)})}var l=["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach(function(p){a[p]=function(){var v;return(v=a.store)[p].apply(v,arguments)}});var c=Hn(),d=function(){a.changeLanguage(a.options.lng,function(v,_){a.isInitialized=!0,a.logger.log("initialized",a.options),a.emit("initialized",a.options),c.resolve(_),n(v,_)})};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),c}},{key:"loadResources",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wl;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&this.language.toLowerCase()==="cimode")return i();var n=[],s=function(l){if(l){var c=a.services.languageUtils.toResolveHierarchy(l);c.forEach(function(d){n.indexOf(d)<0&&n.push(d)})}};if(this.language)s(this.language);else{var o=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);o.forEach(function(u){return s(u)})}this.options.preload&&this.options.preload.forEach(function(u){return s(u)}),this.services.backendConnector.load(n,this.options.ns,i)}else i(null)}},{key:"reloadResources",value:function(a,i,n){var s=Hn();return a||(a=this.languages),i||(i=this.options.ns),n||(n=wl),this.services.backendConnector.reload(a,i,function(o){s.resolve(),n(o)}),s}},{key:"use",value:function(a){return a.type==="backend"&&(this.modules.backend=a),(a.type==="logger"||a.log&&a.warn&&a.error)&&(this.modules.logger=a),a.type==="languageDetector"&&(this.modules.languageDetector=a),a.type==="i18nFormat"&&(this.modules.i18nFormat=a),a.type==="postProcessor"&&eb.addPostProcessor(a),a.type==="3rdParty"&&this.modules.external.push(a),this}},{key:"changeLanguage",value:function(a,i){var n=this,s=Hn();this.emit("languageChanging",a);var o=function(c,d){n.translator.changeLanguage(d),d&&(n.emit("languageChanged",d),n.logger.log("languageChanged",d)),s.resolve(function(){return n.t.apply(n,arguments)}),i&&i(c,function(){return n.t.apply(n,arguments)})},u=function(c){c&&(n.language=c,n.languages=n.services.languageUtils.toResolveHierarchy(c),n.translator.language||n.translator.changeLanguage(c),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(c)),n.loadResources(function(d){o(d,c)})};return!a&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!a&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(a),s}},{key:"getFixedT",value:function(a,i){var n=this,s=function o(u,l){var c=jt({},l);if(ur(l)!=="object"){for(var d=arguments.length,p=new Array(d>2?d-2:0),v=2;v<d;v++)p[v-2]=arguments[v];c=n.options.overloadTranslationOptionHandler([u,l].concat(p))}return c.lng=c.lng||o.lng,c.lngs=c.lngs||o.lngs,c.ns=c.ns||o.ns,n.t(u,c)};return typeof a=="string"?s.lng=a:s.lngs=a,s.ns=i,s}},{key:"t",value:function(){var a;return this.translator&&(a=this.translator).translate.apply(a,arguments)}},{key:"exists",value:function(){var a;return this.translator&&(a=this.translator).exists.apply(a,arguments)}},{key:"setDefaultNamespace",value:function(a){this.options.defaultNS=a}},{key:"loadNamespaces",value:function(a,i){var n=this,s=Hn();return this.options.ns?(typeof a=="string"&&(a=[a]),a.forEach(function(o){n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),this.loadResources(function(o){s.resolve(),i&&i(o)}),s):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(a,i){var n=Hn();typeof a=="string"&&(a=[a]);var s=this.options.preload||[],o=a.filter(function(u){return s.indexOf(u)<0});return o.length?(this.options.preload=s.concat(o),this.loadResources(function(u){n.resolve(),i&&i(u)}),n):(i&&i(),Promise.resolve())}},{key:"dir",value:function(a){if(a||(a=this.languages&&this.languages.length>0?this.languages[0]:this.language),!a)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"];return i.indexOf(this.services.languageUtils.getLanguagePartFromCode(a))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new e(a,i)}},{key:"cloneInstance",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wl,s=jt({},this.options,i,{isClone:!0}),o=new e(s),u=["store","services","language"];return u.forEach(function(l){o[l]=a[l]}),o.translator=new tb(o.services,o.options),o.translator.on("*",function(l){for(var c=arguments.length,d=new Array(c>1?c-1:0),p=1;p<c;p++)d[p-1]=arguments[p];o.emit.apply(o,[l].concat(d))}),o.init(s,n),o.translator.options=o.options,o}}]),e}(fa);const Me=new VB;Me.changeLanguage.bind(Me),Me.cloneInstance.bind(Me),Me.createInstance.bind(Me),Me.dir.bind(Me),Me.exists.bind(Me),Me.getFixedT.bind(Me),Me.init.bind(Me),Me.loadLanguages.bind(Me),Me.loadNamespaces.bind(Me),Me.loadResources.bind(Me),Me.off.bind(Me),Me.on.bind(Me),Me.setDefaultNamespace.bind(Me),Me.t.bind(Me),Me.use.bind(Me);const Cl={screensCache:[],cachedScreenPromises:[],install(t){t.prototype.$dataProvider=this},apiInstance(){return H.has(window,"ProcessMaker.apiClient")&&!window.ProcessMaker.isStub?window.ProcessMaker.apiClient:this.token()?(Vn.defaults.baseURL=this.baseURL(),Vn.defaults.headers.common={Authorization:`Bearer ${this.token()}`},Vn.defaults.adapter=Wv(Vn.defaults.adapter,{enabledByDefault:window.ProcessMaker.screen.cacheEnabled,cacheFlag:"useCache",defaultCache:new Sl({ttl:window.ProcessMaker.screen.cacheTimeout,max:100})}),Vn):H.has(window,"ProcessMaker.apiClient")&&window.ProcessMaker.isStub?window.ProcessMaker.apiClient:{get(){return Promise.resolve({data:{data:[]}})}}},get(...t){return this.apiInstance().get(...t)},post(...t){return this.apiInstance().post(...t)},delete(...t){return this.apiInstance().delete(...t)},token(){return localStorage.getItem("token")},baseURL(){return localStorage.getItem("baseURL")},getTasks(t){const e=H.get(window,"PM4ConfigOverrides.getTasksEndpoint","/tasks");return this.get(e+t).then(r=>(r.data.screen&&r.data.screen.nested&&this.addNestedScreenCache(r.data.screen.nested),r))},addNestedScreenCache(t){t.forEach(e=>{e.screen_id&&(e.id=e.screen_id);const r=this.screensCache.findIndex(a=>a.id===e.id);r>-1?this.screensCache.splice(r,1,e):this.screensCache.push(e)})},getScreen(t,e=""){if(!t)return null;const r=this.cachedScreenPromises.find(s=>s.id===t&&s.query===e);if(r)return r.screenPromise;const a=H.get(window,"PM4ConfigOverrides.getScreenEndpoint","/screens"),i=this.screensCache.find(s=>s.id===t);if(i)return Promise.resolve({data:i});const n=new Promise((s,o)=>{this.get(`${a}/${t}${e}`).then(u=>{u.data.nested&&this.addNestedScreenCache(u.data.nested),s(u)}).catch(u=>o(u))});return this.cachedScreenPromises.push({id:t,query:e,screenPromise:n}),n},flushScreenCache(){this.cachedScreenPromises.splice(0,this.cachedScreenPromises.length)},postScript(t,e,r={}){const a=H.get(window,"PM4ConfigOverrides.postScriptEndpoint","/scripts/execute/{id}");return this.post(a.replace("{id}",t)+this.authQueryString(),e,r)},postDataSource(t,e,r){let a;return e?a=`/requests/${e}/data_sources/${t}`:a=`/requests/data_sources/${t}`,a+=this.authQueryString(),this.post(a,r,{timeout:0})},getDataSource(t,e){if(!window.ProcessMaker.screen.cacheEnabled&&!window.ProcessMaker.screen.cacheTimeout)return this.postDataSource(t,null,e);let r=`/requests/data_sources/${t}/resources/${e.config.endpoint}/data`;return r+=this.authQueryString(),this.get(r,{useCache:window.ProcessMaker.screen.cacheEnabled,params:{pmds_config:JSON.stringify(e.config),pmds_data:JSON.stringify(e.data)}}).then(a=>a)},authQueryString(){const t=H.get(window,"PM4ConfigOverrides.authParams",null);let e="";return t&&(e=`?${new URLSearchParams(t).toString()}`),e},deleteFile(t,e=null){let r=`files/${t}`;return e&&(r+=`?token=${e}`),this.delete(r)},download(t){return this.apiInstance().get(t,{responseType:"blob"})},getCollections(){return this.get("/collections?per_page=1000").catch(t=>{throw t.response&&t.response.status===404?new Error(Me.t("Collections package not installed")):t})},getCollectionFields(t){return this.get(`/collections/${t}/columns?per_page=1000`).catch(e=>{throw e.response&&e.response.status===404?new Error(Me.t("Collection id not found")):e})},getCollectionRecords(t,e,r=null){return e.useCache=window.ProcessMaker.screen.cacheEnabled,this.get(`/collections/${t}/records${this.authQueryString()}`,e).then(a=>{const i=a?a.data:null;if(!i)throw new Error(Me.t("No data returned"));return[i,r]}).catch(a=>{if(a.response&&a.response.status===404)return[{data:[]},r];throw a})}};let Yn=typeof window>"u"?global:window;class Ti{constructor(e,r){se(this,"screen",null);se(this,"firstPage",0);this.element=e,Object.assign(this,r)}async countItems(e){throw e}}class UB extends Ti{async countItems(e){for(const r of this.element)await Ai(r,{screen:this.screen}).countItems(e)}}class GB extends Ti{async countItems(e){for(let r=0,a=this.element.config.length;r<a;r++)await Ai(this.element.config[r].items,{screen:this.element}).countItems(e)}}class HB extends Ti{async countItems(e){e.push(this.element);const r=await this.loadScreen(this.element.config.screen);r&&r[0]&&r[0].items&&await Ai(r[0].items,{screen:this.screen}).countItems(e)}async loadScreen(e){try{if(Yn.nestedScreens||(Yn.nestedScreens={}),Yn.nestedScreens["id_"+e])return Yn.nestedScreens["id_"+e];const r=await Cl.getScreen(e);return Yn.nestedScreens["id_"+e]=r.data.config,r.data.config}catch{return!1}}}class YB extends Ti{async countItems(e){e.push(this.element),await Ai(this.element.items,{screen:this.screen}).countItems(e)}}class QB extends Ti{async countItems(e){await Ai(this.element.items,{screen:this.screen}).countItems(e)}}class KB extends Ti{async countItems(e){e.push(this.element)}}function Ai(t,e){return t instanceof Array?new UB(t,e):t.config instanceof Array?new GB(t,e):t.component==="FormNestedScreen"?new HB(t,e):t.component==="FormMultiColumn"?new QB(t,e):t.component==="FormLoop"?new YB(t,e):new KB(t,e)}let Or=typeof window>"u"?global:window,Qn=[];class Fa{constructor(e,r){se(this,"screen",null);se(this,"firstPage",0);se(this,"data",{});se(this,"insideLoop",!1);this.element=e,Object.assign(this,r)}async addValidations(e){throw e}isVisible(){if(!(this.element.visibleInDevice===null||this.element.visibleInDevice===void 0?!0:this.element.visibleInDevice))return!1;let r=!0;if(this.element.config.conditionalHide)try{r=!!At.evaluate(this.element.config.conditionalHide,this.data)}catch{r=!1}return r}}class JB extends Fa{async addValidations(e){for(const r of this.element)await ha(r,{screen:this.screen,data:this.data,parentVisibilityRule:this.parentVisibilityRule,insideLoop:this.insideLoop}).addValidations(e)}}class ZB extends Fa{async addValidations(e){this.element.config[this.firstPage]&&(Qn=[this.firstPage],await ha(this.element.config[this.firstPage].items,{screen:this.element,data:this.data}).addValidations(e),Qn=[])}}class XB extends Fa{async addValidations(e){if(!this.isVisible())return;const r=await this.loadNestedScreen(this.element.config.screen);if(r&&r.config){const a=r.config;let i=this.parentVisibilityRule?this.parentVisibilityRule:this.element.config.conditionalHide;a&&a[0]&&a[0].items&&await ha(a[0].items,{screen:r,data:this.data,parentVisibilityRule:i}).addValidations(e)}}async loadNestedScreen(e){if(!e)return null;if(Or.nestedScreens||(Or.nestedScreens={}),Or.nestedScreens["id_"+e])return{config:Or.nestedScreens["id_"+e]};const r=await Cl.getScreen(e);return Or.nestedScreens["id_"+e]=r.data.config,{config:r.data}}async loadScreen(e){if(!e)return null;if(Or.nestedScreens||(Or.nestedScreens={}),Or.nestedScreens["id_"+e])return Or.nestedScreens["id_"+e];const r=await Cl.getScreen(e);return Or.nestedScreens["id_"+e]=r.data.config,r.data.config}}class eW extends Fa{async addValidations(e){if(!this.isVisible())return;H.set(e,this.element.config.name,{});const r=H.get(e,this.element.config.name);r.$each={},this.checkForSiblings(e);const a=(H.get(this.data,this.element.config.name)||[{}])[0];await ha(this.element.items,{screen:this.screen,data:{_parent:this.data,...a},parentVisibilityRule:this.element.config.conditionalHide,insideLoop:!0}).addValidations(r.$each)}checkForSiblings(e){const r=[],a=[];if(this.screen.config.forEach(i=>{!i||!i.items||(i.items.filter(n=>{n.component==="FormLoop"&&n.config.name===this.element.config.name&&r.push(n)}),r&&r.forEach(n=>{n.items.filter(s=>{s.config.validation&&s.config.validation.forEach(o=>{const u=this.camelCase(o.value.split(":")[0]),l=nl[u],c={};let d={};d[u]=l,c[s.config.name]=d,H.merge(a,c)})})}))}),Object.keys(a).length!=0){const i=H.get(e,this.element.config.name);i.hasOwnProperty("$each")&&H.merge(i.$each,a),H.set(e[this.element.config.name].$each,i)}}camelCase(e){return e.replace(/_\w/g,r=>r.substr(1,1).toUpperCase())}}class tW extends Fa{async addValidations(e){this.isVisible()&&await ha(this.element.items,{screen:this.screen,data:this.data,parentVisibilityRule:this.element.config.conditionalHide}).addValidations(e)}}class rW extends Fa{async addValidations(e){if(!this.isVisible())return;const r=this.element.config.eventData;let a="Empty Screen";this.screen.config[r]&&this.screen.config[r].name&&(a=this.screen.config[r].name);const i=`${a}-${r}`;Qn.length>0&&!Qn.includes(i)&&this.screen.config[r]&&this.screen.config[r].items&&(Qn.push(i),await ha(this.screen.config[this.element.config.eventData].items,{screen:this.screen,data:this.data}).addValidations(e))}}class aW extends Fa{async addValidations(e){if(this.element.config&&this.element.config.readonly||this.element.config&&this.element.config.disabled||!(this.element.config&&this.element.config.name&&typeof this.element.config.name=="string"&&this.element.config.name.match(/^[a-zA-Z_][0-9a-zA-Z_.]*$/)))return;const r=this.element.config.name,a=this.element.config.validation,i=this.element.config.conditionalHide,n=this.parentVisibilityRule,s=this.insideLoop||!1,o=this.element.config.deviceVisibility?this.element.config.deviceVisibility:{showForDesktop:!0,showForMobile:!0};H.set(e,r,H.get(e,r,{}));const u=H.get(e,r);if(a instanceof Array)a.forEach(l=>{const c=this.camelCase(l.value.split(":")[0]);if(!c)return;let d=nl[c];if(d){if(l.configs instanceof Array){const p=[];l.configs.forEach(v=>{p.push(v.value)}),p.push(r),d=d(...p)}u[c]=function(...p){const v=p[1],_=r.split(".").length-1,h=this.getDataAccordingToFieldLevel(this.getRootScreen().addReferenceToParents(v),_);if(n){const S=s?1:0,b=this.getDataAccordingToFieldLevel(this.getRootScreen().addReferenceToParents(v),_+S);let f=!0;try{f=!!At.evaluate(n,b)}catch{f=!1}if(!f)return!0}let y=!0;try{const S=this.$root.$children[0].$refs.renderer.definition.isMobile;y=S&&o.showForMobile||!S&&o.showForDesktop}catch{y=!0}if(!y)return!0;let x=!0;if(i)try{x=!!At.evaluate(i,h)}catch{x=!1}return x?d.apply(this,p):!0}}});else if(typeof a=="string"&&a){let l=nl[a];if(!l)return;u[a]=function(...c){const d=c[1],p=r.split(".").length-1,v=this.getDataAccordingToFieldLevel(this.getRootScreen().addReferenceToParents(d),p);if(n){const h=s?1:0,y=this.getDataAccordingToFieldLevel(this.getRootScreen().addReferenceToParents(d),p+h);let x=!0;try{x=!!At.evaluate(n,y)}catch{x=!1}if(!x)return!0}let _=!0;if(i)try{_=!!At.evaluate(i,v)}catch{_=!1}return _?l.apply(this,c):!0}}this.element.items&&ha(this.element.items,{screen:this.screen,data:this.data}).addValidations(e)}camelCase(e){return e.replace(/_\w/g,r=>r.substr(1,1).toUpperCase())}}function ha(t,e){return t instanceof Array?new JB(t,e):t.config instanceof Array?new ZB(t,e):t.component==="FormNestedScreen"?new XB(t,e):t.component==="FormMultiColumn"?new tW(t,e):t.component==="FormLoop"?new eW(t,e):(t.component,t.component==="FormButton"&&t.config.event==="pageNavigate"?new rW(t,e):new aW(t,e))}let Kn;const ib={mixins:ov,props:{value:Object,_parent:null,definition:Object,components:{type:Object,default(){return{}}},showErrors:{type:Boolean,default:!1},testScreenDefinition:{type:Boolean,default:!1}},data(){return{references__:[],debugCmp:null,component:null,alias:{},extensions:[],nodeNameProperty:"component",variables:[],variablesTree:[],initialize:[],ownerDocument:window.document,updatedConfigs:[],building:{show:!1,error:"",component:"",errors:[]}}},methods:{dot2bracket(t){return t.replace(/\.\d/g,e=>`[${e.substr(1)}]`)},submit(t,e=!1,r=null){r&&this.loopContext&&(r.loopContext=this.loopContext),this.$emit("submit",this.value,e,r)},buildComponent(t){window.ProcessMaker&&window.ProcessMaker.EventBus&&window.ProcessMaker.EventBus.$emit("screen-renderer-build-component",this);const e=this.componentDefinition(t);if(!this.testScreenDefinition)return e;const r=this.$root.constructor,a=r.config.warnHandler,i=r.config.errorHandler,n=[];this.building.error="",this.building.component="",this.building.errors=[],this.building.show=!1;let s;try{r.config.warnHandler=u=>{n.push(u)},r.config.errorHandler=u=>{n.push(u)},s=r.component("ScreenRendered",e);const o=new s({propsData:{vdata:{}}});if(o.$parent=this,o.$mount(),n.length>0)throw this.$t("Building error");return this.codigo=e,e}catch(o){return console.error(o),this.building.error=o,this.building.component=e,this.building.errors=n,this.building.show=!0,e||{template:"<div></div>"}}finally{r.config.warnHandler=a,r.config.errorHandler=i}},parse(t,e){const r=this.ownerDocument.createElement("div");return this.loadPages(e,r,t),"<div>"+r.innerHTML+"</div>"},loadPages(t,e,r){const a=t.config;this.variables.splice(0),this.extensions.forEach(i=>i.beforeload instanceof Function&&i.beforeload.bind(this)({pages:a,owner:e,definition:t})),a.forEach((i,n)=>{if(i){const s=this.createComponent("div",{name:i.name,class:"page","v-if":`currentPage__==${n}`,key:`page-${n}`});this.loadItems(i.items,s,r,t,n),e.appendChild(s)}})},escapeVuePropertyName(t){return t.substr(0,1)==="@"?t.replace("@","v-on:"):this.snakeCase(t)},snakeCase(t){return t.replace(/[A-Z]/g,e=>`-${e}`).toLowerCase().replace(/^-/,"")},camelCase(t){return t.replace(/_\w/g,e=>e.substr(1,1).toUpperCase())},updateComponentConfig(t,e){this.updatedConfigs.push({name:t,properties:e})},mergeUpdatedConfig(t,e){let r=this.updatedConfigs.find(a=>a.name===t);if(r){let a=r.properties;for(let i in a)e[i]===void 0&&(e[i]=a[i])}return e},createComponent(t,e){e=this.mergeUpdatedConfig(t,this.setDefaultPropertyValues(e)),t=this.snakeCase(t);const r=this.ownerDocument.createElement(t);for(let a in e){const i=e[a];i!==!1&&i!==null&&i!==void 0&&(a.substr(0,1)===":"||typeof i=="string"&&i.indexOf("{{")===-1?r.setAttribute(this.escapeVuePropertyName(a),i):typeof i=="string"&&i.indexOf("{{")!==-1&&!e.ignoreMustache?r.setAttribute(":"+this.escapeVuePropertyName(a),"mustache("+this.byValue(i)+")"):i!==void 0&&r.setAttribute(":"+this.escapeVuePropertyName(a),this.byRef(i)))}return r},byValue(t){return JSON.stringify(t).replace("{{","{{").replace("}}","}}")},byRef(t){const r=`references__[${this.references__.indexOf(t)>-1?this.references__.indexOf(t):this.references__.length}]`;return this.references__.push(t),r},loadItems(t,e,r,a,i){t.forEach(n=>{const s=n[this.nodeNameProperty],o=this.alias[s]||s,u={...n.config};this.extensions.forEach(d=>d.onloadproperties instanceof Function&&d.onloadproperties.bind(this)({properties:u,element:n,component:e,items:t,nodeName:o,componentName:s,screen:r,definition:a,formIndex:i}));const l=this.createComponent(o,u),c=this.ownerDocument.createElement("div");c.appendChild(l),this.extensions.forEach(d=>d.onloaditems instanceof Function&&d.onloaditems.bind(this)({properties:u,element:n,component:e,items:t,nodeName:o,componentName:s,node:l,wrapper:c,screen:r,definition:a,formIndex:i})),e.appendChild(c)})},setDefaultPropertyValues(t){let e={...t};return(typeof e.ariaLabel>"u"||e.ariaLabel===null||e.ariaLabel==="")&&e.label&&(e.ariaLabel=e.label),e.tabindex&&(e.tabindex=parseInt(e.tabindex)),e},validVariableName(t){return t&&typeof t=="string"&&t.match(/^[a-zA-Z_][0-9a-zA-Z_.]*$/)},isComputedVariable(t,e){return e.computed&&e.computed.some(r=>new RegExp(`^${r.property}(\\.|$)`,"i").test(t))},registerVariable(t,e={}){if(t&&t.startsWith("_parent.")||t&&t.includes("._parent.")||!this.validVariableName(t))return;const r=H.get(e,"config",{});this.variables.find(i=>i.name===t)||(this.variables.push({name:t,config:r,element:e}),this.variablesTree.push({name:t,config:r,element:e}))},registerNestedVariable(t,e,r){const a=Kn.getVariablesTree(r);this.variablesTree.push({name:t,prefix:e,config:{},items:a}),Kn.getVariablesTree({config:[]})},getVariablesTree(t){let e;try{e={mixins:[ad],components:{},props:{},computed:{},methods:{},data:{},watch:{},mounted:[]},this.variablesTree=[];const r=this.parse(e,t);return this.extensions.forEach(a=>{a.onparse instanceof Function&&a.onparse.bind(this)({screen:e,template:r,definition:t})}),this.variablesTree}catch(r){return console.error(r),this.variablesTree}},elementCssClass(t){const e=[];return t.config.bgcolor&&e.push(t.config.bgcolor),t.config.color&&e.push(t.config.color),e.join(" ")},componentDefinition(t){let e;this.building.error="",this.building.component="",this.building.errors=[],this.building.show=!1;try{e={mixins:[ad],components:{},props:{},computed:{},methods:{},created:[],data:{},watch:{},mounted:[]};const r=this.parse(e,t);this.extensions.forEach(n=>{n.onparse instanceof Function&&n.onparse.bind(this)({screen:e,template:r,definition:t})}),e.template=r,this.extensions.forEach(n=>{n.onbuild instanceof Function&&n.onbuild.bind(this)({screen:e,definition:t})});const a=["currentPage__"],i=`let value;const data = {};
|
|
268
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rb(t,e){return NB(t)||RB(t,e)||Kv(t,e)||FB()}function qB(t,e){for(var r=t.indexOf(e);r!==-1;)t.splice(r,1),r=t.indexOf(e)}var BB=function(t){kl(e,t);function e(r,a,i){var n,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Vr(this,e),n=Gn(this,wi(e).call(this)),fa.call(Nt(Nt(n))),n.backend=r,n.store=a,n.languageUtils=i.languageUtils,n.options=s,n.logger=Gr.create("backendConnector"),n.state={},n.queue=[],n.backend&&n.backend.init&&n.backend.init(i,s.backend,s),n}return Ur(e,[{key:"queueLoad",value:function(a,i,n,s){var o=this,u=[],l=[],c=[],d=[];return a.forEach(function(p){var v=!0;i.forEach(function(_){var h="".concat(p,"|").concat(_);!n.reload&&o.store.hasResourceBundle(p,_)?o.state[h]=2:o.state[h]<0||(o.state[h]===1?l.indexOf(h)<0&&l.push(h):(o.state[h]=1,v=!1,l.indexOf(h)<0&&l.push(h),u.indexOf(h)<0&&u.push(h),d.indexOf(_)<0&&d.push(_)))}),v||c.push(p)}),(u.length||l.length)&&this.queue.push({pending:l,loaded:{},errors:[],callback:s}),{toLoad:u,pending:l,toLoadLanguages:c,toLoadNamespaces:d}}},{key:"loaded",value:function(a,i,n){var s=a.split("|"),o=rb(s,2),u=o[0],l=o[1];i&&this.emit("failedLoading",u,l,i),n&&this.store.addResourceBundle(u,l,n),this.state[a]=i?-1:2;var c={};this.queue.forEach(function(d){OB(d.loaded,[u],l),qB(d.pending,a),i&&d.errors.push(i),d.pending.length===0&&!d.done&&(Object.keys(d.loaded).forEach(function(p){c[p]||(c[p]=[]),d.loaded[p].length&&d.loaded[p].forEach(function(v){c[p].indexOf(v)<0&&c[p].push(v)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(a,i,n){var s=this,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:250,l=arguments.length>5?arguments[5]:void 0;return a.length?this.backend[n](a,i,function(c,d){if(c&&d&&o<5){setTimeout(function(){s.read.call(s,a,i,n,o+1,u*2,l)},u);return}l(c,d)}):l(null,{})}},{key:"prepareLoading",value:function(a,i){var n=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof a=="string"&&(a=this.languageUtils.toResolveHierarchy(a)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(a,i,s,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(function(l){n.loadOne(l)})}},{key:"load",value:function(a,i,n){this.prepareLoading(a,i,{},n)}},{key:"reload",value:function(a,i,n){this.prepareLoading(a,i,{reload:!0},n)}},{key:"loadOne",value:function(a){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=a.split("|"),o=rb(s,2),u=o[0],l=o[1];this.read(u,l,"read",null,null,function(c,d){c&&i.logger.warn("".concat(n,"loading namespace ").concat(l," for language ").concat(u," failed"),c),!c&&d&&i.logger.log("".concat(n,"loaded namespace ").concat(l," for language ").concat(u),d),i.loaded(a,c,d)})}},{key:"saveMissing",value:function(a,i,n,s,o){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.backend&&this.backend.create&&this.backend.create(a,i,n,s,null,jt({},u,{isUpdate:o})),!(!a||!a[0])&&this.store.addResource(a[0],i,n,s)}}]),e}(fa);function WB(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var r={};if(ur(e[1])==="object"&&(r=e[1]),typeof e[1]=="string"&&(r.defaultValue=e[1]),typeof e[2]=="string"&&(r.tDescription=e[2]),ur(e[2])==="object"||ur(e[3])==="object"){var a=e[3]||e[2];Object.keys(a).forEach(function(i){r[i]=a[i]})}return r},interpolation:{escapeValue:!0,format:function(e,r,a){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}}}function ab(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&t.whitelist.indexOf("cimode")<0&&(t.whitelist=t.whitelist.concat(["cimode"])),t}function wl(){}var VB=function(t){kl(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Vr(this,e),r=Gn(this,wi(e).call(this)),fa.call(Nt(Nt(r))),r.options=ab(a),r.services={},r.logger=Gr,r.modules={external:[]},i&&!r.isInitialized&&!a.isClone){if(!r.options.initImmediate)return r.init(a,i),Gn(r,Nt(Nt(r)));setTimeout(function(){r.init(a,i)},0)}return r}return Ur(e,[{key:"init",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(n=i,i={}),this.options=jt({},WB(),this.options,ab(i)),this.format=this.options.interpolation.format,n||(n=wl);function s(p){return p?typeof p=="function"?new p:p:null}if(!this.options.isClone){this.modules.logger?Gr.init(s(this.modules.logger),this.options):Gr.init(null,this.options);var o=new PB(this.options);this.store=new $B(this.options.resources,this.options);var u=this.services;u.logger=Gr,u.resourceStore=this.store,u.languageUtils=o,u.pluralResolver=new LB(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u.interpolator=new jB(this.options),u.backendConnector=new BB(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(p){for(var v=arguments.length,_=new Array(v>1?v-1:0),h=1;h<v;h++)_[h-1]=arguments[h];a.emit.apply(a,[p].concat(_))}),this.modules.languageDetector&&(u.languageDetector=s(this.modules.languageDetector),u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=s(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new tb(this.services,this.options),this.translator.on("*",function(p){for(var v=arguments.length,_=new Array(v>1?v-1:0),h=1;h<v;h++)_[h-1]=arguments[h];a.emit.apply(a,[p].concat(_))}),this.modules.external.forEach(function(p){p.init&&p.init(a)})}var l=["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach(function(p){a[p]=function(){var v;return(v=a.store)[p].apply(v,arguments)}});var c=Hn(),d=function(){a.changeLanguage(a.options.lng,function(v,_){a.isInitialized=!0,a.logger.log("initialized",a.options),a.emit("initialized",a.options),c.resolve(_),n(v,_)})};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),c}},{key:"loadResources",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wl;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&this.language.toLowerCase()==="cimode")return i();var n=[],s=function(l){if(l){var c=a.services.languageUtils.toResolveHierarchy(l);c.forEach(function(d){n.indexOf(d)<0&&n.push(d)})}};if(this.language)s(this.language);else{var o=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);o.forEach(function(u){return s(u)})}this.options.preload&&this.options.preload.forEach(function(u){return s(u)}),this.services.backendConnector.load(n,this.options.ns,i)}else i(null)}},{key:"reloadResources",value:function(a,i,n){var s=Hn();return a||(a=this.languages),i||(i=this.options.ns),n||(n=wl),this.services.backendConnector.reload(a,i,function(o){s.resolve(),n(o)}),s}},{key:"use",value:function(a){return a.type==="backend"&&(this.modules.backend=a),(a.type==="logger"||a.log&&a.warn&&a.error)&&(this.modules.logger=a),a.type==="languageDetector"&&(this.modules.languageDetector=a),a.type==="i18nFormat"&&(this.modules.i18nFormat=a),a.type==="postProcessor"&&eb.addPostProcessor(a),a.type==="3rdParty"&&this.modules.external.push(a),this}},{key:"changeLanguage",value:function(a,i){var n=this,s=Hn();this.emit("languageChanging",a);var o=function(c,d){n.translator.changeLanguage(d),d&&(n.emit("languageChanged",d),n.logger.log("languageChanged",d)),s.resolve(function(){return n.t.apply(n,arguments)}),i&&i(c,function(){return n.t.apply(n,arguments)})},u=function(c){c&&(n.language=c,n.languages=n.services.languageUtils.toResolveHierarchy(c),n.translator.language||n.translator.changeLanguage(c),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(c)),n.loadResources(function(d){o(d,c)})};return!a&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!a&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(a),s}},{key:"getFixedT",value:function(a,i){var n=this,s=function o(u,l){var c=jt({},l);if(ur(l)!=="object"){for(var d=arguments.length,p=new Array(d>2?d-2:0),v=2;v<d;v++)p[v-2]=arguments[v];c=n.options.overloadTranslationOptionHandler([u,l].concat(p))}return c.lng=c.lng||o.lng,c.lngs=c.lngs||o.lngs,c.ns=c.ns||o.ns,n.t(u,c)};return typeof a=="string"?s.lng=a:s.lngs=a,s.ns=i,s}},{key:"t",value:function(){var a;return this.translator&&(a=this.translator).translate.apply(a,arguments)}},{key:"exists",value:function(){var a;return this.translator&&(a=this.translator).exists.apply(a,arguments)}},{key:"setDefaultNamespace",value:function(a){this.options.defaultNS=a}},{key:"loadNamespaces",value:function(a,i){var n=this,s=Hn();return this.options.ns?(typeof a=="string"&&(a=[a]),a.forEach(function(o){n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),this.loadResources(function(o){s.resolve(),i&&i(o)}),s):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(a,i){var n=Hn();typeof a=="string"&&(a=[a]);var s=this.options.preload||[],o=a.filter(function(u){return s.indexOf(u)<0});return o.length?(this.options.preload=s.concat(o),this.loadResources(function(u){n.resolve(),i&&i(u)}),n):(i&&i(),Promise.resolve())}},{key:"dir",value:function(a){if(a||(a=this.languages&&this.languages.length>0?this.languages[0]:this.language),!a)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"];return i.indexOf(this.services.languageUtils.getLanguagePartFromCode(a))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new e(a,i)}},{key:"cloneInstance",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wl,s=jt({},this.options,i,{isClone:!0}),o=new e(s),u=["store","services","language"];return u.forEach(function(l){o[l]=a[l]}),o.translator=new tb(o.services,o.options),o.translator.on("*",function(l){for(var c=arguments.length,d=new Array(c>1?c-1:0),p=1;p<c;p++)d[p-1]=arguments[p];o.emit.apply(o,[l].concat(d))}),o.init(s,n),o.translator.options=o.options,o}}]),e}(fa);const Me=new VB;Me.changeLanguage.bind(Me),Me.cloneInstance.bind(Me),Me.createInstance.bind(Me),Me.dir.bind(Me),Me.exists.bind(Me),Me.getFixedT.bind(Me),Me.init.bind(Me),Me.loadLanguages.bind(Me),Me.loadNamespaces.bind(Me),Me.loadResources.bind(Me),Me.off.bind(Me),Me.on.bind(Me),Me.setDefaultNamespace.bind(Me),Me.t.bind(Me),Me.use.bind(Me);const Cl={screensCache:[],cachedScreenPromises:[],install(t){t.prototype.$dataProvider=this},apiInstance(){return H.has(window,"ProcessMaker.apiClient")&&!window.ProcessMaker.isStub?window.ProcessMaker.apiClient:this.token()?(Vn.defaults.baseURL=this.baseURL(),Vn.defaults.headers.common={Authorization:`Bearer ${this.token()}`},Vn.defaults.adapter=Wv(Vn.defaults.adapter,{enabledByDefault:window.ProcessMaker.screen.cacheEnabled,cacheFlag:"useCache",defaultCache:new Sl({ttl:window.ProcessMaker.screen.cacheTimeout,max:100})}),Vn):H.has(window,"ProcessMaker.apiClient")&&window.ProcessMaker.isStub?window.ProcessMaker.apiClient:{get(){return Promise.resolve({data:{data:[]}})}}},get(...t){return this.apiInstance().get(...t)},post(...t){return this.apiInstance().post(...t)},delete(...t){return this.apiInstance().delete(...t)},token(){return localStorage.getItem("token")},baseURL(){return localStorage.getItem("baseURL")},getTasks(t){const e=H.get(window,"PM4ConfigOverrides.getTasksEndpoint","/tasks");return this.get(e+t).then(r=>(r.data.screen&&r.data.screen.nested&&this.addNestedScreenCache(r.data.screen.nested),r))},addNestedScreenCache(t){t.forEach(e=>{e.screen_id&&(e.id=e.screen_id);const r=this.screensCache.findIndex(a=>a.id===e.id);r>-1?this.screensCache.splice(r,1,e):this.screensCache.push(e)})},getScreen(t,e=""){if(!t)return null;const r=this.cachedScreenPromises.find(s=>s.id===t&&s.query===e);if(r)return r.screenPromise;const a=H.get(window,"PM4ConfigOverrides.getScreenEndpoint","/screens"),i=this.screensCache.find(s=>s.id===t);if(i)return Promise.resolve({data:i});const n=new Promise((s,o)=>{this.get(`${a}/${t}${e}`).then(u=>{u.data.nested&&this.addNestedScreenCache(u.data.nested),s(u)}).catch(u=>o(u))});return this.cachedScreenPromises.push({id:t,query:e,screenPromise:n}),n},flushScreenCache(){this.cachedScreenPromises.splice(0,this.cachedScreenPromises.length)},postScript(t,e,r={}){const a=H.get(window,"PM4ConfigOverrides.postScriptEndpoint","/scripts/execute/{id}");return this.post(a.replace("{id}",t)+this.authQueryString(),e,r)},postDataSource(t,e,r){let a;return e?a=`/requests/${e}/data_sources/${t}`:a=`/requests/data_sources/${t}`,a+=this.authQueryString(),this.post(a,r,{timeout:0})},getDataSource(t,e){if(!window.ProcessMaker.screen.cacheEnabled&&!window.ProcessMaker.screen.cacheTimeout)return this.postDataSource(t,null,e);let r=`/requests/data_sources/${t}/resources/${e.config.endpoint}/data`;return r+=this.authQueryString(),this.get(r,{useCache:window.ProcessMaker.screen.cacheEnabled,params:{pmds_config:JSON.stringify(e.config),pmds_data:JSON.stringify(e.data)}}).then(a=>a)},authQueryString(){const t=H.get(window,"PM4ConfigOverrides.authParams",null);let e="";return t&&(e=`?${new URLSearchParams(t).toString()}`),e},deleteFile(t,e=null){let r=`files/${t}`;const a={token:e},i=H.get(window,"_current_task_id",0);return i&&(a.task_id=i),this.delete(r,{params:a})},download(t){return this.apiInstance().get(t,{responseType:"blob"})},getCollections(){return this.get("/collections?per_page=1000").catch(t=>{throw t.response&&t.response.status===404?new Error(Me.t("Collections package not installed")):t})},getCollectionFields(t){return this.get(`/collections/${t}/columns?per_page=1000`).catch(e=>{throw e.response&&e.response.status===404?new Error(Me.t("Collection id not found")):e})},getCollectionRecords(t,e,r=null){return e.useCache=window.ProcessMaker.screen.cacheEnabled,this.get(`/collections/${t}/records${this.authQueryString()}`,e).then(a=>{const i=a?a.data:null;if(!i)throw new Error(Me.t("No data returned"));return[i,r]}).catch(a=>{if(a.response&&a.response.status===404)return[{data:[]},r];throw a})}};let Yn=typeof window>"u"?global:window;class Ti{constructor(e,r){se(this,"screen",null);se(this,"firstPage",0);this.element=e,Object.assign(this,r)}async countItems(e){throw e}}class UB extends Ti{async countItems(e){for(const r of this.element)await Ai(r,{screen:this.screen}).countItems(e)}}class GB extends Ti{async countItems(e){for(let r=0,a=this.element.config.length;r<a;r++)await Ai(this.element.config[r].items,{screen:this.element}).countItems(e)}}class HB extends Ti{async countItems(e){e.push(this.element);const r=await this.loadScreen(this.element.config.screen);r&&r[0]&&r[0].items&&await Ai(r[0].items,{screen:this.screen}).countItems(e)}async loadScreen(e){try{if(Yn.nestedScreens||(Yn.nestedScreens={}),Yn.nestedScreens["id_"+e])return Yn.nestedScreens["id_"+e];const r=await Cl.getScreen(e);return Yn.nestedScreens["id_"+e]=r.data.config,r.data.config}catch{return!1}}}class YB extends Ti{async countItems(e){e.push(this.element),await Ai(this.element.items,{screen:this.screen}).countItems(e)}}class QB extends Ti{async countItems(e){await Ai(this.element.items,{screen:this.screen}).countItems(e)}}class KB extends Ti{async countItems(e){e.push(this.element)}}function Ai(t,e){return t instanceof Array?new UB(t,e):t.config instanceof Array?new GB(t,e):t.component==="FormNestedScreen"?new HB(t,e):t.component==="FormMultiColumn"?new QB(t,e):t.component==="FormLoop"?new YB(t,e):new KB(t,e)}let Or=typeof window>"u"?global:window,Qn=[];class Fa{constructor(e,r){se(this,"screen",null);se(this,"firstPage",0);se(this,"data",{});se(this,"insideLoop",!1);this.element=e,Object.assign(this,r)}async addValidations(e){throw e}isVisible(){if(!(this.element.visibleInDevice===null||this.element.visibleInDevice===void 0?!0:this.element.visibleInDevice))return!1;let r=!0;if(this.element.config.conditionalHide)try{r=!!At.evaluate(this.element.config.conditionalHide,this.data)}catch{r=!1}return r}}class JB extends Fa{async addValidations(e){for(const r of this.element)await ha(r,{screen:this.screen,data:this.data,parentVisibilityRule:this.parentVisibilityRule,insideLoop:this.insideLoop}).addValidations(e)}}class ZB extends Fa{async addValidations(e){this.element.config[this.firstPage]&&(Qn=[this.firstPage],await ha(this.element.config[this.firstPage].items,{screen:this.element,data:this.data}).addValidations(e),Qn=[])}}class XB extends Fa{async addValidations(e){if(!this.isVisible())return;const r=await this.loadNestedScreen(this.element.config.screen);if(r&&r.config){const a=r.config;let i=this.parentVisibilityRule?this.parentVisibilityRule:this.element.config.conditionalHide;a&&a[0]&&a[0].items&&await ha(a[0].items,{screen:r,data:this.data,parentVisibilityRule:i}).addValidations(e)}}async loadNestedScreen(e){if(!e)return null;if(Or.nestedScreens||(Or.nestedScreens={}),Or.nestedScreens["id_"+e])return{config:Or.nestedScreens["id_"+e]};const r=await Cl.getScreen(e);return Or.nestedScreens["id_"+e]=r.data.config,{config:r.data}}async loadScreen(e){if(!e)return null;if(Or.nestedScreens||(Or.nestedScreens={}),Or.nestedScreens["id_"+e])return Or.nestedScreens["id_"+e];const r=await Cl.getScreen(e);return Or.nestedScreens["id_"+e]=r.data.config,r.data.config}}class eW extends Fa{async addValidations(e){if(!this.isVisible())return;H.set(e,this.element.config.name,{});const r=H.get(e,this.element.config.name);r.$each={},this.checkForSiblings(e);const a=(H.get(this.data,this.element.config.name)||[{}])[0];await ha(this.element.items,{screen:this.screen,data:{_parent:this.data,...a},parentVisibilityRule:this.element.config.conditionalHide,insideLoop:!0}).addValidations(r.$each)}checkForSiblings(e){const r=[],a=[];if(this.screen.config.forEach(i=>{!i||!i.items||(i.items.filter(n=>{n.component==="FormLoop"&&n.config.name===this.element.config.name&&r.push(n)}),r&&r.forEach(n=>{n.items.filter(s=>{s.config.validation&&s.config.validation.forEach(o=>{const u=this.camelCase(o.value.split(":")[0]),l=nl[u],c={};let d={};d[u]=l,c[s.config.name]=d,H.merge(a,c)})})}))}),Object.keys(a).length!=0){const i=H.get(e,this.element.config.name);i.hasOwnProperty("$each")&&H.merge(i.$each,a),H.set(e[this.element.config.name].$each,i)}}camelCase(e){return e.replace(/_\w/g,r=>r.substr(1,1).toUpperCase())}}class tW extends Fa{async addValidations(e){this.isVisible()&&await ha(this.element.items,{screen:this.screen,data:this.data,parentVisibilityRule:this.element.config.conditionalHide}).addValidations(e)}}class rW extends Fa{async addValidations(e){if(!this.isVisible())return;const r=this.element.config.eventData;let a="Empty Screen";this.screen.config[r]&&this.screen.config[r].name&&(a=this.screen.config[r].name);const i=`${a}-${r}`;Qn.length>0&&!Qn.includes(i)&&this.screen.config[r]&&this.screen.config[r].items&&(Qn.push(i),await ha(this.screen.config[this.element.config.eventData].items,{screen:this.screen,data:this.data}).addValidations(e))}}class aW extends Fa{async addValidations(e){if(this.element.config&&this.element.config.readonly||this.element.config&&this.element.config.disabled||!(this.element.config&&this.element.config.name&&typeof this.element.config.name=="string"&&this.element.config.name.match(/^[a-zA-Z_][0-9a-zA-Z_.]*$/)))return;const r=this.element.config.name,a=this.element.config.validation,i=this.element.config.conditionalHide,n=this.parentVisibilityRule,s=this.insideLoop||!1,o=this.element.config.deviceVisibility?this.element.config.deviceVisibility:{showForDesktop:!0,showForMobile:!0};H.set(e,r,H.get(e,r,{}));const u=H.get(e,r);if(a instanceof Array)a.forEach(l=>{const c=this.camelCase(l.value.split(":")[0]);if(!c)return;let d=nl[c];if(d){if(l.configs instanceof Array){const p=[];l.configs.forEach(v=>{p.push(v.value)}),p.push(r),d=d(...p)}u[c]=function(...p){const v=p[1],_=r.split(".").length-1,h=this.getDataAccordingToFieldLevel(this.getRootScreen().addReferenceToParents(v),_);if(n){const S=s?1:0,b=this.getDataAccordingToFieldLevel(this.getRootScreen().addReferenceToParents(v),_+S);let f=!0;try{f=!!At.evaluate(n,b)}catch{f=!1}if(!f)return!0}let y=!0;try{const S=this.$root.$children[0].$refs.renderer.definition.isMobile;y=S&&o.showForMobile||!S&&o.showForDesktop}catch{y=!0}if(!y)return!0;let x=!0;if(i)try{x=!!At.evaluate(i,h)}catch{x=!1}return x?d.apply(this,p):!0}}});else if(typeof a=="string"&&a){let l=nl[a];if(!l)return;u[a]=function(...c){const d=c[1],p=r.split(".").length-1,v=this.getDataAccordingToFieldLevel(this.getRootScreen().addReferenceToParents(d),p);if(n){const h=s?1:0,y=this.getDataAccordingToFieldLevel(this.getRootScreen().addReferenceToParents(d),p+h);let x=!0;try{x=!!At.evaluate(n,y)}catch{x=!1}if(!x)return!0}let _=!0;if(i)try{_=!!At.evaluate(i,v)}catch{_=!1}return _?l.apply(this,c):!0}}this.element.items&&ha(this.element.items,{screen:this.screen,data:this.data}).addValidations(e)}camelCase(e){return e.replace(/_\w/g,r=>r.substr(1,1).toUpperCase())}}function ha(t,e){return t instanceof Array?new JB(t,e):t.config instanceof Array?new ZB(t,e):t.component==="FormNestedScreen"?new XB(t,e):t.component==="FormMultiColumn"?new tW(t,e):t.component==="FormLoop"?new eW(t,e):(t.component,t.component==="FormButton"&&t.config.event==="pageNavigate"?new rW(t,e):new aW(t,e))}let Kn;const ib={mixins:ov,props:{value:Object,_parent:null,definition:Object,components:{type:Object,default(){return{}}},showErrors:{type:Boolean,default:!1},testScreenDefinition:{type:Boolean,default:!1}},data(){return{references__:[],debugCmp:null,component:null,alias:{},extensions:[],nodeNameProperty:"component",variables:[],variablesTree:[],initialize:[],ownerDocument:window.document,updatedConfigs:[],building:{show:!1,error:"",component:"",errors:[]}}},methods:{dot2bracket(t){return t.replace(/\.\d/g,e=>`[${e.substr(1)}]`)},submit(t,e=!1,r=null){r&&this.loopContext&&(r.loopContext=this.loopContext),this.$emit("submit",this.value,e,r)},buildComponent(t){window.ProcessMaker&&window.ProcessMaker.EventBus&&window.ProcessMaker.EventBus.$emit("screen-renderer-build-component",this);const e=this.componentDefinition(t);if(!this.testScreenDefinition)return e;const r=this.$root.constructor,a=r.config.warnHandler,i=r.config.errorHandler,n=[];this.building.error="",this.building.component="",this.building.errors=[],this.building.show=!1;let s;try{r.config.warnHandler=u=>{n.push(u)},r.config.errorHandler=u=>{n.push(u)},s=r.component("ScreenRendered",e);const o=new s({propsData:{vdata:{}}});if(o.$parent=this,o.$mount(),n.length>0)throw this.$t("Building error");return this.codigo=e,e}catch(o){return console.error(o),this.building.error=o,this.building.component=e,this.building.errors=n,this.building.show=!0,e||{template:"<div></div>"}}finally{r.config.warnHandler=a,r.config.errorHandler=i}},parse(t,e){const r=this.ownerDocument.createElement("div");return this.loadPages(e,r,t),"<div>"+r.innerHTML+"</div>"},loadPages(t,e,r){const a=t.config;this.variables.splice(0),this.extensions.forEach(i=>i.beforeload instanceof Function&&i.beforeload.bind(this)({pages:a,owner:e,definition:t})),a.forEach((i,n)=>{if(i){const s=this.createComponent("div",{name:i.name,class:"page","v-if":`currentPage__==${n}`,key:`page-${n}`});this.loadItems(i.items,s,r,t,n),e.appendChild(s)}})},escapeVuePropertyName(t){return t.substr(0,1)==="@"?t.replace("@","v-on:"):this.snakeCase(t)},snakeCase(t){return t.replace(/[A-Z]/g,e=>`-${e}`).toLowerCase().replace(/^-/,"")},camelCase(t){return t.replace(/_\w/g,e=>e.substr(1,1).toUpperCase())},updateComponentConfig(t,e){this.updatedConfigs.push({name:t,properties:e})},mergeUpdatedConfig(t,e){let r=this.updatedConfigs.find(a=>a.name===t);if(r){let a=r.properties;for(let i in a)e[i]===void 0&&(e[i]=a[i])}return e},createComponent(t,e){e=this.mergeUpdatedConfig(t,this.setDefaultPropertyValues(e)),t=this.snakeCase(t);const r=this.ownerDocument.createElement(t);for(let a in e){const i=e[a];i!==!1&&i!==null&&i!==void 0&&(a.substr(0,1)===":"||typeof i=="string"&&i.indexOf("{{")===-1?r.setAttribute(this.escapeVuePropertyName(a),i):typeof i=="string"&&i.indexOf("{{")!==-1&&!e.ignoreMustache?r.setAttribute(":"+this.escapeVuePropertyName(a),"mustache("+this.byValue(i)+")"):i!==void 0&&r.setAttribute(":"+this.escapeVuePropertyName(a),this.byRef(i)))}return r},byValue(t){return JSON.stringify(t).replace("{{","{{").replace("}}","}}")},byRef(t){const r=`references__[${this.references__.indexOf(t)>-1?this.references__.indexOf(t):this.references__.length}]`;return this.references__.push(t),r},loadItems(t,e,r,a,i){t.forEach(n=>{const s=n[this.nodeNameProperty],o=this.alias[s]||s,u={...n.config};this.extensions.forEach(d=>d.onloadproperties instanceof Function&&d.onloadproperties.bind(this)({properties:u,element:n,component:e,items:t,nodeName:o,componentName:s,screen:r,definition:a,formIndex:i}));const l=this.createComponent(o,u),c=this.ownerDocument.createElement("div");c.appendChild(l),this.extensions.forEach(d=>d.onloaditems instanceof Function&&d.onloaditems.bind(this)({properties:u,element:n,component:e,items:t,nodeName:o,componentName:s,node:l,wrapper:c,screen:r,definition:a,formIndex:i})),e.appendChild(c)})},setDefaultPropertyValues(t){let e={...t};return(typeof e.ariaLabel>"u"||e.ariaLabel===null||e.ariaLabel==="")&&e.label&&(e.ariaLabel=e.label),e.tabindex&&(e.tabindex=parseInt(e.tabindex)),e},validVariableName(t){return t&&typeof t=="string"&&t.match(/^[a-zA-Z_][0-9a-zA-Z_.]*$/)},isComputedVariable(t,e){return e.computed&&e.computed.some(r=>new RegExp(`^${r.property}(\\.|$)`,"i").test(t))},registerVariable(t,e={}){if(t&&t.startsWith("_parent.")||t&&t.includes("._parent.")||!this.validVariableName(t))return;const r=H.get(e,"config",{});this.variables.find(i=>i.name===t)||(this.variables.push({name:t,config:r,element:e}),this.variablesTree.push({name:t,config:r,element:e}))},registerNestedVariable(t,e,r){const a=Kn.getVariablesTree(r);this.variablesTree.push({name:t,prefix:e,config:{},items:a}),Kn.getVariablesTree({config:[]})},getVariablesTree(t){let e;try{e={mixins:[ad],components:{},props:{},computed:{},methods:{},data:{},watch:{},mounted:[]},this.variablesTree=[];const r=this.parse(e,t);return this.extensions.forEach(a=>{a.onparse instanceof Function&&a.onparse.bind(this)({screen:e,template:r,definition:t})}),this.variablesTree}catch(r){return console.error(r),this.variablesTree}},elementCssClass(t){const e=[];return t.config.bgcolor&&e.push(t.config.bgcolor),t.config.color&&e.push(t.config.color),e.join(" ")},componentDefinition(t){let e;this.building.error="",this.building.component="",this.building.errors=[],this.building.show=!1;try{e={mixins:[ad],components:{},props:{},computed:{},methods:{},created:[],data:{},watch:{},mounted:[]};const r=this.parse(e,t);this.extensions.forEach(n=>{n.onparse instanceof Function&&n.onparse.bind(this)({screen:e,template:r,definition:t})}),e.template=r,this.extensions.forEach(n=>{n.onbuild instanceof Function&&n.onbuild.bind(this)({screen:e,definition:t})});const a=["currentPage__"],i=`let value;const data = {};
|
|
269
269
|
${Object.keys(e.data).map(n=>{const{code:s,variable:o}=e.data[n];return`value = ${s};
|
|
270
270
|
data.${this.safeDotName(n)} = value;
|
|
271
271
|
${!o||a.includes(o)||o.endsWith("__")?"":`this.setValue(${JSON.stringify(o)}, value, this.vdata);`}`}).join(`
|