xframelib 0.5.4 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
- import{h as ro,openBlock as H,createElementBlock as tt,normalizeStyle as yt,renderSlot as ft,reactive as bn,computed as pt,defineComponent as Tt,ref as nt,onMounted as Sn,onUpdated as so,nextTick as Cn,normalizeClass as ao,createElementVNode as V,createCommentVNode as zt,createVNode as xn,Transition as kn,withCtx as Wt,withModifiers as En,getCurrentInstance as co,watch as Ft,onBeforeUnmount as uo,resolveComponent as zn,createBlock as ct,withDirectives as lo,Fragment as wt,createTextVNode as Mn,toDisplayString as ho,vShow as fo,markRaw as _n,toRefs as po,renderList as Mt,resolveDynamicComponent as bt}from"vue";import{Client as mo,ClientContext as we}from"@hprose/rpc-core";import{ByteStream as Rn}from"@hprose/io";import{HttpTransport as go}from"@hprose/rpc-html5";import vo from"axios";var yo={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let n=0;this.panes=this.panes.map((i,r)=>(i.size=r===t?i.max:i.min,r!==t&&(n+=i.min),i)),this.panes[t].size-=n,this.$emit("pane-maximize",this.panes[t])},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:n,clientY:i}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:i-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),100*e/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const i=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),c=Math.max(Math.min(this.getCurrentDragPercentage(e),r),i);let v=[t,t+1],y=this.panes[v[0]]||null,w=this.panes[v[1]]||null;const S=y.max<100&&c>=y.max+n.prevPanesSize,E=w.max<100&&c<=100-(w.max+this.sumNextPanesSize(t+1));if(S||E)S?(y.size=y.max,w.size=Math.max(100-y.max-n.prevPanesSize-n.nextPanesSize,0)):(y.size=Math.max(100-w.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),w.size=w.max);else{if(this.pushOtherPanes){const z=this.doPushOtherPanes(n,c);if(!z)return;({sums:n,panesToResize:v}=z),y=this.panes[v[0]]||null,w=this.panes[v[1]]||null}y!==null&&(y.size=Math.min(Math.max(c-n.prevPanesSize-n.prevReachedMinPanes,y.min),y.max)),w!==null&&(w.size=Math.min(Math.max(100-c-n.nextPanesSize-n.nextReachedMinPanes,w.min),w.max))}},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,i=[n,n+1];return t<e.prevPanesSize+this.panes[i[0]].min&&(i[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,i[0]<n&&this.panes.forEach((r,c)=>{c>i[0]&&c<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),e.prevPanesSize=this.sumPrevPanesSize(i[0]),i[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,c)=>{c>0&&c<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),this.panes[i[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[i[1]].min&&(i[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,i[1]>n+1&&this.panes.forEach((r,c)=>{c>n&&c<i[1]&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),e.nextPanesSize=this.sumNextPanesSize(i[1]-1),i[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,c)=>{c<this.panesCount-1&&c>=n+1&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),this.panes[i[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:i}},sumPrevPanesSize(e){return this.panes.reduce((t,n,i)=>t+(i<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,i)=>t+(i>e+1?n.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),n=e.classList.contains("splitpanes__splitter");if(!t&&!n)return e.parentNode.removeChild(e),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(e,t,n=!1){const i=e-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(r.onmousedown=c=>this.onMouseDown(c,i),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=c=>this.onMouseDown(c,i)),r.onclick=c=>this.onSplitterClick(c,i+1)),this.dblClickSplitter&&(r.ondblclick=c=>this.onSplitterDblClick(c,i+1)),t.parentNode.insertBefore(r,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let t=0;e.forEach(n=>{n.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,n,!0):t&&this.addSplitter(t,n),t++)})},requestUpdate({target:e,...t}){const n=this.indexedPanes[e._.uid];Object.entries(t).forEach(([i,r])=>n[i]=r)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&t++,r===e.$el));const n=parseFloat(e.minSize),i=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(i)?100:i,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((r,c)=>r.index=c),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(i=>i.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((i,r)=>i.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.size}))})})},resetPaneSizes(e={}){e.addedPane||e.removedPane?this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const n=[],i=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(e,r.max),r.min),t-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&i.push(r.id)}),t>.1&&this.readjustSizes(t,n,i)},initialPanesSizing(){let e=100;const t=[],n=[];let i=0;this.panes.forEach(c=>{e-=c.size,c.size!==null&&i++,c.size>=c.max&&t.push(c.id),c.size<=c.min&&n.push(c.id)});let r=100;e>.1&&(this.panes.forEach(c=>{c.size===null&&(c.size=Math.max(Math.min(e/(this.panesCount-i),c.max),c.min)),r-=c.size}),r>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e}={}){let t=100/this.panesCount,n=0;const i=[],r=[];e&&e.givenSize!==null&&(t=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(c=>{n-=c.size,c.size>=c.max&&i.push(c.id),c.size<=c.min&&r.push(c.id)}),Math.abs(n)<.1||(this.panes.forEach(c=>{e&&e.givenSize!==null&&e.id===c.id||(c.size=Math.max(Math.min(t,c.max),c.min)),n-=c.size,c.size>=c.max&&i.push(c.id),c.size<=c.min&&r.push(c.id)}),n>.1&&this.readjustSizes(n,i,r))},readjustSizes(e,t,n){let i;i=e>0?e/(this.panesCount-t.length):e/(this.panesCount-n.length),this.panes.forEach(r=>{if(e>0&&!t.includes(r.id)){const c=Math.max(Math.min(r.size+i,r.max),r.min);e-=c-r.size,r.size=c}else if(!n.includes(r.id)){const c=Math.max(Math.min(r.size+i,r.max),r.min);e-=c-r.size,r.size=c}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,n)=>{t.ondblclick=e?i=>this.onSplitterDblClick(i,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.updatePaneComponents(),this.$emit("ready"),this.ready=!0},render(){return ro("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},be={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:10},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};be.render=function(e,t,n,i,r,c){return H(),tt("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=v=>c.onPaneClick(v,e._.uid)),style:yt(e.style)},[ft(e.$slots,"default")],4)},be.__file="src/controls/splitpanes/pane.vue";var _t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Se(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var wo={exports:{}},In=wo.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(b,u){var d=b[0],h=b[1],l=b[2],p=b[3];h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[0]-680876936|0)<<7|d>>>25)+h|0)&h|~d&l)+u[1]-389564586|0)<<12|p>>>20)+d|0)&d|~p&h)+u[2]+606105819|0)<<17|l>>>15)+p|0)&p|~l&d)+u[3]-1044525330|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[4]-176418897|0)<<7|d>>>25)+h|0)&h|~d&l)+u[5]+1200080426|0)<<12|p>>>20)+d|0)&d|~p&h)+u[6]-1473231341|0)<<17|l>>>15)+p|0)&p|~l&d)+u[7]-45705983|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[8]+1770035416|0)<<7|d>>>25)+h|0)&h|~d&l)+u[9]-1958414417|0)<<12|p>>>20)+d|0)&d|~p&h)+u[10]-42063|0)<<17|l>>>15)+p|0)&p|~l&d)+u[11]-1990404162|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[12]+1804603682|0)<<7|d>>>25)+h|0)&h|~d&l)+u[13]-40341101|0)<<12|p>>>20)+d|0)&d|~p&h)+u[14]-1502002290|0)<<17|l>>>15)+p|0)&p|~l&d)+u[15]+1236535329|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[1]-165796510|0)<<5|d>>>27)+h|0)&l|h&~l)+u[6]-1069501632|0)<<9|p>>>23)+d|0)&h|d&~h)+u[11]+643717713|0)<<14|l>>>18)+p|0)&d|p&~d)+u[0]-373897302|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[5]-701558691|0)<<5|d>>>27)+h|0)&l|h&~l)+u[10]+38016083|0)<<9|p>>>23)+d|0)&h|d&~h)+u[15]-660478335|0)<<14|l>>>18)+p|0)&d|p&~d)+u[4]-405537848|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[9]+568446438|0)<<5|d>>>27)+h|0)&l|h&~l)+u[14]-1019803690|0)<<9|p>>>23)+d|0)&h|d&~h)+u[3]-187363961|0)<<14|l>>>18)+p|0)&d|p&~d)+u[8]+1163531501|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[13]-1444681467|0)<<5|d>>>27)+h|0)&l|h&~l)+u[2]-51403784|0)<<9|p>>>23)+d|0)&h|d&~h)+u[7]+1735328473|0)<<14|l>>>18)+p|0)&d|p&~d)+u[12]-1926607734|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[5]-378558|0)<<4|d>>>28)+h|0)^h^l)+u[8]-2022574463|0)<<11|p>>>21)+d|0)^d^h)+u[11]+1839030562|0)<<16|l>>>16)+p|0)^p^d)+u[14]-35309556|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[1]-1530992060|0)<<4|d>>>28)+h|0)^h^l)+u[4]+1272893353|0)<<11|p>>>21)+d|0)^d^h)+u[7]-155497632|0)<<16|l>>>16)+p|0)^p^d)+u[10]-1094730640|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[13]+681279174|0)<<4|d>>>28)+h|0)^h^l)+u[0]-358537222|0)<<11|p>>>21)+d|0)^d^h)+u[3]-722521979|0)<<16|l>>>16)+p|0)^p^d)+u[6]+76029189|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[9]-640364487|0)<<4|d>>>28)+h|0)^h^l)+u[12]-421815835|0)<<11|p>>>21)+d|0)^d^h)+u[15]+530742520|0)<<16|l>>>16)+p|0)^p^d)+u[2]-995338651|0)<<23|h>>>9)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[0]-198630844|0)<<6|d>>>26)+h|0)|~l))+u[7]+1126891415|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[14]-1416354905|0)<<15|l>>>17)+p|0)|~d))+u[5]-57434055|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[12]+1700485571|0)<<6|d>>>26)+h|0)|~l))+u[3]-1894986606|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[10]-1051523|0)<<15|l>>>17)+p|0)|~d))+u[1]-2054922799|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[8]+1873313359|0)<<6|d>>>26)+h|0)|~l))+u[15]-30611744|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[6]-1560198380|0)<<15|l>>>17)+p|0)|~d))+u[13]+1309151649|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[4]-145523070|0)<<6|d>>>26)+h|0)|~l))+u[11]-1120210379|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[2]+718787259|0)<<15|l>>>17)+p|0)|~d))+u[9]-343485551|0)<<21|h>>>11)+l|0,b[0]=d+b[0]|0,b[1]=h+b[1]|0,b[2]=l+b[2]|0,b[3]=p+b[3]|0}function i(b){var u,d=[];for(u=0;u<64;u+=4)d[u>>2]=b.charCodeAt(u)+(b.charCodeAt(u+1)<<8)+(b.charCodeAt(u+2)<<16)+(b.charCodeAt(u+3)<<24);return d}function r(b){var u,d=[];for(u=0;u<64;u+=4)d[u>>2]=b[u]+(b[u+1]<<8)+(b[u+2]<<16)+(b[u+3]<<24);return d}function c(b){var u,d,h,l,p,T,R=b.length,B=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=R;u+=64)n(B,i(b.substring(u-64,u)));for(d=(b=b.substring(u-64)).length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<d;u+=1)h[u>>2]|=b.charCodeAt(u)<<(u%4<<3);if(h[u>>2]|=128<<(u%4<<3),u>55)for(n(B,h),u=0;u<16;u+=1)h[u]=0;return l=(l=8*R).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(l[2],16),T=parseInt(l[1],16)||0,h[14]=p,h[15]=T,n(B,h),B}function v(b){var u,d,h,l,p,T,R=b.length,B=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=R;u+=64)n(B,r(b.subarray(u-64,u)));for(d=(b=u-64<R?b.subarray(u-64):new Uint8Array(0)).length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<d;u+=1)h[u>>2]|=b[u]<<(u%4<<3);if(h[u>>2]|=128<<(u%4<<3),u>55)for(n(B,h),u=0;u<16;u+=1)h[u]=0;return l=(l=8*R).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(l[2],16),T=parseInt(l[1],16)||0,h[14]=p,h[15]=T,n(B,h),B}function y(b){var u,d="";for(u=0;u<4;u+=1)d+=t[b>>8*u+4&15]+t[b>>8*u&15];return d}function w(b){var u;for(u=0;u<b.length;u+=1)b[u]=y(b[u]);return b.join("")}function S(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function E(b,u){var d,h=b.length,l=new ArrayBuffer(h),p=new Uint8Array(l);for(d=0;d<h;d+=1)p[d]=b.charCodeAt(d);return u?p:l}function z(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function I(b,u,d){var h=new Uint8Array(b.byteLength+u.byteLength);return h.set(new Uint8Array(b)),h.set(new Uint8Array(u),b.byteLength),d?h:h.buffer}function D(b){var u,d=[],h=b.length;for(u=0;u<h-1;u+=2)d.push(parseInt(b.substr(u,2),16));return String.fromCharCode.apply(String,d)}function P(){this.reset()}return w(c("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function b(u,d){return(u=0|u||0)<0?Math.max(u+d,0):Math.min(u,d)}ArrayBuffer.prototype.slice=function(u,d){var h,l,p,T,R=this.byteLength,B=b(u,R),U=R;return d!==e&&(U=b(d,R)),B>U?new ArrayBuffer(0):(h=U-B,l=new ArrayBuffer(h),p=new Uint8Array(l),T=new Uint8Array(this,B,h),p.set(T),l)}}(),P.prototype.append=function(b){return this.appendBinary(S(b)),this},P.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var u,d=this._buff.length;for(u=64;u<=d;u+=64)n(this._hash,i(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},P.prototype.end=function(b){var u,d,h=this._buff,l=h.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<l;u+=1)p[u>>2]|=h.charCodeAt(u)<<(u%4<<3);return this._finish(p,l),d=w(this._hash),b&&(d=D(d)),this.reset(),d},P.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},P.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},P.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},P.prototype._finish=function(b,u){var d,h,l,p=u;if(b[p>>2]|=128<<(p%4<<3),p>55)for(n(this._hash,b),p=0;p<16;p+=1)b[p]=0;d=(d=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),h=parseInt(d[2],16),l=parseInt(d[1],16)||0,b[14]=h,b[15]=l,n(this._hash,b)},P.hash=function(b,u){return P.hashBinary(S(b),u)},P.hashBinary=function(b,u){var d=w(c(b));return u?D(d):d},P.ArrayBuffer=function(){this.reset()},P.ArrayBuffer.prototype.append=function(b){var u,d=I(this._buff.buffer,b,!0),h=d.length;for(this._length+=b.byteLength,u=64;u<=h;u+=64)n(this._hash,r(d.subarray(u-64,u)));return this._buff=u-64<h?new Uint8Array(d.buffer.slice(u-64)):new Uint8Array(0),this},P.ArrayBuffer.prototype.end=function(b){var u,d,h=this._buff,l=h.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<l;u+=1)p[u>>2]|=h[u]<<(u%4<<3);return this._finish(p,l),d=w(this._hash),b&&(d=D(d)),this.reset(),d},P.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.ArrayBuffer.prototype.getState=function(){var b=P.prototype.getState.call(this);return b.buff=z(b.buff),b},P.ArrayBuffer.prototype.setState=function(b){return b.buff=E(b.buff,!0),P.prototype.setState.call(this,b)},P.ArrayBuffer.prototype.destroy=P.prototype.destroy,P.ArrayBuffer.prototype._finish=P.prototype._finish,P.ArrayBuffer.hash=function(b,u){var d=w(v(new Uint8Array(b)));return u?D(d):d},P}();const Ce=[];class lt{static addHandler(t,n,i){t.addEventListener?t.addEventListener(n,i,!1):t.attachEvent?t.attachEvent("on"+n,i):t["on"+n]=i}static windowResizeHandler(t){lt.addHandler(window,"resize",t)}static fullscreenEnabled(){const t=window.document;return document.fullscreenEnabled||window.fullScreen||t.mozFullscreenEnabled||t.webkitIsFullScreen}static fullScreen(t,n){if(n){const i=window.document;let r=window.document.exitFullscreen||i.msExitFullscreen||i.mozCancelFullScreen||i.webkitCancelFullScreen;if(r!==void 0&&r)r.call(window.document);else if(window.ActiveXObject!==void 0){let c=new window.ActiveXObject("WScript.Shell");c?.SendKeys("{F11}")}}else{let i=t;i||(i=window.document.documentElement);let r=i.requestFullScreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullScreen;if(r!==void 0&&r)r.call(i);else if(window.ActiveXObject!==void 0){let c=new window.ActiveXObject("WScript.Shell");c?.SendKeys("{F11}")}}}static requestFullScreen(t=window.document.documentElement){let n=t;var i=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(i)i.call(n);else if(window.ActiveXObject!==void 0){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static exitFullScreen(){const t=window.document;var n=document.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.webkitExitFullscreen;if(n)n.call(document);else if(window.ActiveXObject!==void 0){var i=new window.ActiveXObject("WScript.Shell");i!==null&&i.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!lt.fullScreenElement()}static onFullScreenChanged(t){let n;"onfullscreenchange"in window.document?n="fullscreenchange":"onwebkitfullscreenchange"in window.document?n="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(n="mozfullscreenchange"),n?document.addEventListener(n,function(){const i=lt.isFullScreen();t(i)}):document.addEventListener("MSFullscreenChange",function(){const i=lt.isFullScreen();t(i)})}static stringifyCircularHandler(t,n){if(typeof n=="object"&&n!==null){if(Ce.indexOf(n)!==-1)return;Ce.push(n)}return n}static jsonStringify(t){if(!t)return"";const n=JSON.stringify(t,lt.stringifyCircularHandler);return Ce.length=0,n}static jsonParse(t){const n=lt.jsonStringify(t);if(n.length>1)return JSON.parse(n)}static getObjectURL(t){let n;const i=window;return i.createObjcectURL!=null?n=i.createOjcectURL(t):window.URL!=null?n=window.URL.createObjectURL(t):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(t)),n}static getFileShortMD5(t,n){const i=File.prototype,r=i.slice||i.mozSlice||i.webkitSlice,c=t,v=new In.ArrayBuffer,y=new FileReader;y.onload=function(w){v.append(w.target?.result);const S=v.end();n({isOK:!0,data:S})},y.onerror=function(){const w="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(w),n({isOK:!1,data:w})},function(){const w=2097152>=c.size?c.size:2097152;y.readAsArrayBuffer(r.call(c,0,w))}()}static MD5(t,n=!1){return In.hash(t,n)}static copyText=t=>new Promise((n,i)=>{const r=document.createElement("input");r.value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}class $t{static isNullOrEmpty=t=>t===null||t===""||t===void 0||t.length===0;static isNotEmpty=t=>t!==null&&t!==""&&t!==void 0&&t.length!==0;static toHump(t){return t.replace(/[\-\/\_](\w)/g,(n,i)=>i.toUpperCase()).replace("views","")}}class Ht{prefixKey;storage;constructor(t="",n=localStorage){this.prefixKey=t,this.storage=n}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,n,i=604800){const r=JSON.stringify({value:n,expire:i!==null?new Date().getTime()+1e3*i:null});this.storage.setItem(this.getKey(t),r)}get(t,n=null){const i=this.storage.getItem(this.getKey(t));if(i)try{const r=JSON.parse(i),{value:c,expire:v}=r;if(v===null||v>=Date.now())return c;this.remove(this.getKey(t))}catch{return n}return n}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}setCookie(t,n,i=604800){document.cookie=`${this.getKey(t)}=${n}; Max-Age=${i}`}getCookie(t){const n=document.cookie.split("; ");for(let i=0,r=n.length;i<r;i++){const c=n[i].split("=");if(c[0]===this.getKey(t))return c[1]}return""}removeCookie(t){this.setCookie(t,1,-1)}clearCookie(){const t=document.cookie.match(/[^ =;]+(?==)/g);if(t)for(let n=t.length;n--;)document.cookie=t[n]+"=0;expire="+new Date(0).toUTCString()}}const bo=new Ht("",localStorage);function qt(){let e=[];const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++)e[n]=t.substr(Math.floor(16*Math.random()),1);return e[14]="4",e[19]=t.substr(3&Number(e[19])|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}function So(){var e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==="x"?n:3&n|8).toString(16)})}function Co(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),i=Math.floor(n*parseInt(t[0])+255*(1-n)),r=Math.floor(n*parseInt(t[1])+255*(1-n)),c=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+i.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+c.toString(16)).slice(-2)}function xo(e){var t=e.toLowerCase();if(Gt(e)){if(t.length===4){for(var n="#",i=1;i<4;i+=1){const c=t.slice(i,i+1);n+=c.concat(c)}t=n}var r=[];for(i=1;i<7;i+=2)r.push(parseInt("0x"+t.slice(i,i+2)));return"rgb("+r.join(",")+")"}return t}function ko(e){const t=e;if(t.length===4){let i="#";for(var n=1;n<4;n+=1){const r=t.slice(n,n+1);i+=r.concat(r)}return i}return t}var St,Rt;function Eo(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substr(0,1);return t==="#"?St.Hex:t==="r"||t==="("?St.RGBA:t==="h"?St.Hsla:St.RGBA}function zo(e){if(!!e){var t=e.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(!!t){var n,i,r,c=(parseFloat(t[1])%360+360)%360/360,v=parseFloat(t[2])/(/%$/.test(t[2])?100:1),y=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(v===0)n=i=r=y;else{var w=y<=.5?y*(v+1):y+v-y*v,S=2*y-w;n=xe(S,w,c+1/3),i=xe(S,w,c),r=xe(S,w,c-1/3)}return`rgba(${n=Math.round(255*n)},${i=Math.round(255*i)},${r=Math.round(255*r)},${t[4]?parseFloat(t[4]):1})`}}}function xe(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Gt(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(e)}function Mo(e,t,n){const i=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(i.length-7)).join("0")+i}function ke(e){let t=e.toLowerCase();if(Gt(e)){if(t.length===4){let i="#";for(let r=1;r<4;r+=1)i+=t.slice(r,r+1).concat(t.slice(r,r+1));t=i}const n=[];for(let i=1;i<7;i+=2)n.push(parseInt("0x"+t.slice(i,i+2)));return"RGB("+n.join(",")+")"}return t}function _o(e){if(!Gt(e))return;const[t,n,i]=ke(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*t+.578*n+.114*i<192}function Ro(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${ze(e.substring(0,2),t)}${ze(e.substring(2,4),t)}${ze(e.substring(4,6),t)}`}function Io(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${Ee(e.substring(0,2),t)}${Ee(e.substring(2,4),t)}${Ee(e.substring(4,6),t)}`}function Ee(e,t){const n=parseInt(e,16)+t,i=n>255?255:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Ln(e,t,n){const i=[e,t,n].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}function Lo(e){const t=ke(e.substring(1));var n,i;return n=t.split(","),i=[0,0,0],(Ln(~~n[0],~~n[1],~~n[2])+.05)/(Ln(i[0],i[1],i[2])+.05)>=12?"#000000":"#FFFFFF"}function ze(e,t){const n=parseInt(e,16)-t,i=n<0?0:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Me(e){return{all:e=e||new Map,on(t,n){const i=e?.get(t);i&&i.push(n)||e?.set(t,[n])},off(t,n){const i=e?.get(t);i&&i.splice(i.indexOf(n)>>>0,1)},emit(t,n){(e?.get(t)||[]).slice().map(i=>{i(n)}),(e?.get("*")||[]).slice().map(i=>{i(t,n)})}}}(Rt=St||(St={}))[Rt.RGBA=0]="RGBA",Rt[Rt.Hex=1]="Hex",Rt[Rt.Hsla=2]="Hsla";const It=Me(),K={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent"},Xt=(e,t)=>{const n=document.createElement("a");n.download=t,n.style.display="none";const i=new Blob([e],{type:"application/octet-stream"});n.href=URL.createObjectURL(i),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function Po(e,t){const n=window.URL||window.webkitURL||window,i=new Blob([e]),r=document.createElement("a");r.href=n.createObjectURL(i),r.download=t,r.click(),n.revokeObjectURL(r.href)}const Pn=(e,t)=>{const n=JSON.stringify(e,null,2);t?Xt(n,t+".json"):It.emit(K.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},To=(e,t,n)=>{e.get(t).then(function(i){Xt(i.data,n)}).catch(i=>{console.warn(i),It.emit(K.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function Tn(e){const t=e.lastIndexOf("/")+1;let n=e.substring(t);return n=decodeURI(n.split("?")[0]),n}function Bo({url:e,target:t="_blank",fileName:n}){const i=new URL(e).host==location.host;return new Promise((r,c)=>{if(i){const v=document.createElement("a");if(v.href=e,v.target=t,v.download!==void 0&&(v.download=n||Tn(e)),document.createEvent){const y=document.createEvent("MouseEvents");return y.initEvent("click",!0,!0),v.dispatchEvent(y),r(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),r(!0)}{const v=document.createElement("canvas"),y=document.createElement("img");y.setAttribute("crossOrigin","Anonymous"),y.src=e,y.onload=w=>{v.width=y.width,v.height=y.height,v.getContext("2d").drawImage(y,0,0,y.width,y.height),v.toBlob(S=>{if(S){const E=document.createElement("a");E.href=window.URL.createObjectURL(S),E.download=Tn(e),E.click(),URL.revokeObjectURL(E.href),r(!0)}},"image/jpeg")},y.onerror=w=>c(w)}})}function Ao(e){for(var t=new Date().getTime();new Date().getTime()-t<e;);console.log(`\u5F3A\u5236\u7B49\u5F85${e}\u6BEB\u79D2`)}class Ut{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!$t.isNullOrEmpty(t)){if(Ut.httpTransport||(Ut.httpTransport=new go),this.client=new mo(t),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=t,this.init()}}init(){this.client&&this.client.useServiceAsync().then(t=>{this.hproseProxy=t}).catch(t=>{String(t).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):It.emit(K.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(t)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(t){console.warn(t),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(t,n,i){if(this.client)return await this.client.invoke(t,n,i)}encode(t,n,i){return this.client?this.client.codec.encode(t,n,i):void 0}decode(t,n){return this.client?this.client.codec.decode(t,n):void 0}}const mt=new Ht("user",localStorage);function Ct(){return mt.get("access_token")}function _e(){mt.remove("access_token"),L.User&&delete L.User}function Bn(){return Ct()?.refresh}class Bt{hproseClient;hpProxyObj;defaultContext=new we;constructor(t){this.hproseClient=new Ut(t),this.hpProxyObj=null}getClientContext(t,n){const i={};n&&(i.requestHeaders=n);const r=Ct();i.httpRequestHeaders=t||{};const c=i.httpRequestHeaders;return r&&(c.token=r.token),new we(i)}async getHproseProxy(){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");if(!this.hpProxyObj){const t=await this.hproseClient.getProxy();this.hpProxyObj=t}return this.hpProxyObj||It.emit(K.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(t,n,i){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(t,n,i)}async hproseInvokeContext(t,n,...i){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Ct();return console.log(r,"userToken3"),r&&(n||(n=new we({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(t,i,n)}async hproseInvokeEncode(t){const n=new Rn(t).toBytes(),i=await this.hproseClient.client?.request(n,this.defaultContext);return i&&this.hproseClient.client?.codec.decode(i,this.defaultContext)}encodeRequest(t,...n){const i=this.hproseClient.client?.codec?.encode(t,n,this.defaultContext);return Rn.toString(i)}}class Do{message;eventBus;constructor(t,n){t&&(this.message=t),n&&(this.eventBus=n)}msg(t,n=3,i="success"){if(this.message)if(typeof this.message=="function")this.message({type:i,message:t,duration:n});else switch(i){case"info":this.message.info(t,n);break;case"success":this.message.success(t,n);break;case"warning":this.message.warn(t,n);break;case"error":this.message.error(t,n)}else{switch(i){case"info":case"success":console.log(t);break;case"warning":console.warn(t);break;case"error":i="dark",console.error(t)}this.eventBus&&this.eventBus.emit(K.AlertInfoEvent,{type:i,info:t})}}info(t,n=3){this.msg(t,n,"info")}warn(t,n=3){this.msg(t,n,"warning")}err(t,n=3){this.msg(t,n,"error")}}const Re=new Map,L={Config:SysConfig,EventBus:It,DefaultProxyClient:null,Axios:vo};function No(e){An(e.message,e.defaultHproseURL),e.config&&(L.Config=e.config)}const An=function(e,t){t?L.Config.DefaultHproseAPI=t:!L.Config.DefaultHproseAPI&&L.Config.ServiceURL&&(L.Config.DefaultHproseAPI=L.Config.ServiceURL.DefaultHproseAPI),L.Config.DefaultHproseAPI&&$t.isNotEmpty(L.Config.DefaultHproseAPI)&&(L.DefaultProxyClient=new Bt(L.Config.DefaultHproseAPI));const n=new Do(e,L.EventBus);L.Message=n,L.EventBus.on(K.HproseServiceErrorEvent,i=>{const r=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;n.warn(r)}),L.EventBus.on(K.WebAPIErrorEvent,i=>{const r=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;n.warn(r)}),L.EventBus.on(K.CommonWarnEvent,i=>{n.warn(i)})};function Dn(e){if(e&&$t.isNotEmpty(e)){if(Re.has(e))return Re.get(e);{const t=new Bt(e);return Re.set(e,t),t}}}function Uo(e){const t=Dn(e);return t&&(L.DefaultProxyClient=t),t}function Ie(e,t,n,i="json",r){const c={baseURL:L.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:e,headers:{"Content-Type":"application/json",Authorization:"bearer "+Ct()?.token},responseType:i,cancelToken:r};if(n)for(let v in n)c.headers[v]=n[v];return t&&(c.baseURL=t),c}function rt(e,t,n,i,r="json",c,v){const y=Ie(n,t,i,r,c);return v&&v>=2e4&&(y.timeout=v),L.Axios?.get(e,y).catch(function(w){Vt(w,t,e,"Get")})}function Vt(e,t,n,i="Get"){const r=`${t}${n}`;if(e&&e.response){const c=e.response.status;switch(c){case 400:e.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:e.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:e.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:e.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:e.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:e.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:e.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:e.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:e.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:e.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:e.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:e.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:e.message=`\u8FDE\u63A5\u9519\u8BEF${e.response.status}`}let v={address:r,code:c,message:e.message,result:e.response.data};console.warn(`HTTP ${i}\u8BF7\u6C42\u9519\u8BEF\uFF1A`,v),L.EventBus.emit(K.AxiosRequestErrorEvent,v)}}function Le(e,t,n,i,r,c="json",v){const y=Ie(i,t,r,c);v&&v>=2e4&&(y.timeout=v);const w=function(S){let E=new FormData;return S&&Object.keys(S).forEach(z=>{if(!S)return;let I=S[z];var D;I!=null&&E.append(z,(D=I)instanceof Blob?D:D.toString())}),E}(n);return L.Axios?.post(e,w,y).catch(function(S){Vt(S,t,e,"Post")})}function Oo(e,t,n,i,r,c="json",v){const y=Ie(i,t,r,c);return v&&v>=2e4&&(y.timeout=v),L.Axios?.post(e,n,y).catch(function(w){Vt(w,t,e,"Post")})}function jo(e,t){return rt(e,void 0,t)}function Wo(e,t){return Le(e,void 0,t)}function Fo(e,t){return L.Axios?.get(e,{params:t}).catch(function(n){Vt(n,e,"","\u5916\u90E8Get")})}var Pe={exports:{}},$o=typeof window<"u"?window:_t!==void 0?_t:typeof self<"u"?self:{},Ho=function(e){if(!e)return!1;var t=qo.call(e);return t==="[object Function]"||typeof e=="function"&&t!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},qo=Object.prototype.toString,Te=function(e){return e.replace(/^\s+|\s+$/g,"")},Go=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)Xo.call(n,i)&&(e[i]=n[i])}return e},Xo=Object.prototype.hasOwnProperty,Nn=$o,Vo=Ho,Ko=function(e){if(!e)return{};for(var t,n={},i=Te(e).split(`
2
- `),r=0;r<i.length;r++){var c=i[r],v=c.indexOf(":"),y=Te(c.slice(0,v)).toLowerCase(),w=Te(c.slice(v+1));n[y]===void 0?n[y]=w:(t=n[y],Object.prototype.toString.call(t)==="[object Array]"?n[y].push(w):n[y]=[n[y],w])}return n},Yo=Go;function Un(e,t,n){var i=e;return Vo(t)?(n=t,typeof e=="string"&&(i={uri:e})):i=Yo(t,{uri:e}),i.callback=n,i}function ut(e,t,n){return On(t=Un(e,t,n))}function On(e){if(e.callback===void 0)throw new Error("callback argument missing");var t=!1,n=function(d,h,l){t||(t=!0,e.callback(d,h,l))};function i(){var d=void 0;if(d=w.response?w.response:w.responseText||function(h){try{if(h.responseType==="document")return h.responseXML;var l=h.responseXML&&h.responseXML.documentElement.nodeName==="parsererror";if(h.responseType===""&&!l)return h.responseXML}catch{}return null}(w),b)try{d=JSON.parse(d)}catch{}return d}function r(d){return clearTimeout(S),d instanceof Error||(d=new Error(""+(d||"Unknown XMLHttpRequest Error"))),d.statusCode=0,n(d,u)}function c(){if(!y){var d;clearTimeout(S),d=e.useXDR&&w.status===void 0?200:w.status===1223?204:w.status;var h=u,l=null;return d!==0?(h={body:i(),statusCode:d,method:z,headers:{},url:E,rawRequest:w},w.getAllResponseHeaders&&(h.headers=Ko(w.getAllResponseHeaders()))):l=new Error("Internal XMLHttpRequest Error"),n(l,h,h.body)}}var v,y,w=e.xhr||null;w||(w=e.cors||e.useXDR?new ut.XDomainRequest:new ut.XMLHttpRequest);var S,E=w.url=e.uri||e.url,z=w.method=e.method||"GET",I=e.body||e.data,D=w.headers=e.headers||{},P=!!e.sync,b=!1,u={body:void 0,headers:{},statusCode:0,method:z,url:E,rawRequest:w};if("json"in e&&e.json!==!1&&(b=!0,D.accept||D.Accept||(D.Accept="application/json"),z!=="GET"&&z!=="HEAD"&&(D["content-type"]||D["Content-Type"]||(D["Content-Type"]="application/json"),I=JSON.stringify(e.json===!0?I:e.json))),w.onreadystatechange=function(){w.readyState===4&&setTimeout(c,0)},w.onload=c,w.onerror=r,w.onprogress=function(){},w.onabort=function(){y=!0},w.ontimeout=r,w.open(z,E,!P,e.username,e.password),P||(w.withCredentials=!!e.withCredentials),!P&&e.timeout>0&&(S=setTimeout(function(){if(!y){y=!0,w.abort("timeout");var d=new Error("XMLHttpRequest timeout");d.code="ETIMEDOUT",r(d)}},e.timeout)),w.setRequestHeader)for(v in D)D.hasOwnProperty(v)&&w.setRequestHeader(v,D[v]);else if(e.headers&&!function(d){for(var h in d)if(d.hasOwnProperty(h))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(w.responseType=e.responseType),"beforeSend"in e&&typeof e.beforeSend=="function"&&e.beforeSend(w),w.send(I||null),w}Pe.exports=ut,Pe.exports.default=ut,ut.XMLHttpRequest=Nn.XMLHttpRequest||function(){},ut.XDomainRequest="withCredentials"in new ut.XMLHttpRequest?ut.XMLHttpRequest:Nn.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){ut[e==="delete"?"del":e]=function(t,n,i){return(n=Un(t,n,i)).method=e.toUpperCase(),On(n)}});var Jo=Pe.exports;const Zo=[200,201,202,204,308],Qo=[408,502,503,504];class tr{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(t){this.endpoint=t.endpoint,this.file=t.file,this.fileName=encodeURI(this.file.name),this.headers=t.headers||{},this.method=t.method||"PUT",this.chunkSize=t.chunkSize||5120,this.attempts=t.attempts||5,this.delayBeforeAttempt=t.delayBeforeAttempt||1,this.md5=t.md5||"",this.maxFileBytes=1024*(t.maxFileSize||0),this.chunkCount=0,this.chunkByteSize=1024*this.chunkSize,this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.attemptCount=0,this.offline=!1,this.paused=!1,this.success=!1,this.reader=new FileReader,this.eventTarget=Me(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{this.offline&&(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}on(t,n){this.eventTarget.on(t,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(t,n){this.eventTarget.emit(t,n)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint\u5FC5\u987B\u4E3A\uFF1A\u6587\u4EF6\u4E0A\u4F20URL\u5B57\u7B26\u4E32\uFF0C\u6216\u8FD4\u56DE\u5730\u5740\u7684\u51FD\u6570\uFF01");if(!(this.file instanceof File))throw new TypeError("file\u5FC5\u987B\u4E3A\u6587\u4EF6\u5BF9\u8C61");if(this.headers&&typeof this.headers!="object")throw new TypeError("\u6587\u4EF6\u5934\u5FC5\u987B\u4E3A\u5BF9\u8C61\u6216\u7A7A\uFF01");if(this.chunkSize&&(typeof this.chunkSize!="number"||this.chunkSize<=0||this.chunkSize%256!=0))throw new TypeError("chunkSize\u5FC5\u987B\u5927\u4E8E0,\u5E76\u662F256\u7684\u6574\u6570\u500D");if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u5141\u8BB8\u503C\uFF1A(${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("\u91CD\u8BD5\u6B21\u6570\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("\u5EF6\u65F6\u91CD\u8BD5\u65F6\u95F4\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01\u9ED8\u8BA4\u4E3A1")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(t=>(this.endpointValue=t,this.endpointValue))}getChunk(){return new Promise(t=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,i=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),t(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(i,i+n))})}xhrPromise(t){const n=i=>{i.upload.onprogress=r=>{const c=100/this.totalChunks,v=c*this.file.size,y=c*this.chunkCount,w=r.loaded/(r.total??v)*c;this.dispatch("progress",Math.min(y+w,100))}};return new Promise((i,r)=>{this.currentXhr=Jo({...t,beforeSend:n},(c,v)=>(this.currentXhr=void 0,c?r(c):i(v)))})}sendChunk(){if(!this.chunk)return;const t=this.chunkCount*this.chunkByteSize,n=t+this.chunk.size-1,i={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${n}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:i,url:this.endpointValue,method:this.method,body:this.chunk});console.warn("\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01"),this.dispatch("error",{message:"\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01\u53D6\u6D88\u4E0A\u4F20\uFF01",chunk:this.chunkCount,attempts:this.attemptCount})}manageRetries(){if(this.attemptCount<this.attempts)return setTimeout(()=>this.sendChunks(),1e3*this.delayBeforeAttempt),void this.dispatch("attemptFailure",{message:`\u4E0A\u4F20\u5206\u7247\uFF1A${this.chunkCount}\u5931\u8D25\u3002\u8FD8\u4F1A\u518D\u5C1D\u8BD5 ${this.attempts-this.attemptCount}\u6B21\uFF01`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount});this.dispatch("error",{message:`\u4E0A\u4F20\u5206\u7247\u9519\u8BEF\uFF1A ${this.chunkCount}\u3002\u505C\u6B62\u5C1D\u8BD5\uFF0C\u53D6\u6D88\u4E0A\u4F20\uFF01`,chunk:this.chunkCount,attempts:this.attemptCount})}sendChunks(){this.paused||this.offline||this.success||this.getChunk().then(()=>this.sendChunk()).then(t=>{if(this.attemptCount=this.attemptCount+1,t!=null&&Zo.includes(t.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:t}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const n=100*(this.chunkCount/this.totalChunks*this.file.size)/this.file.size;this.dispatch("progress",n)}else if(t!=null&&Qo.includes(t.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(t=>{this.paused||this.offline||this.manageRetries()})}}const er=e=>new tr(e),nr=new class{hasClass(e,t){return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}addClass(e,t){this.hasClass(e,t)||(e.className+=" "+t)}removeClass(e,t){if(this.hasClass(e,t)){const n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}toggleClass(e,t){this.hasClass(e,t)?this.removeClass(e,t):this.addClass(e,t)}setCSSProperty(e,t,n){e?.style.setProperty(t,n)}},jn=mt.get("is_LockScreen",!1),At={isLock:jn,lockTime:jn=="true"?Fn():0};function Wn(e){At.isLock=e,mt.set("is_LockScreen",e,10),e&&(_e(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function ir(){return mt.get("is_LockScreen",!1)}function Fn(){let e=3600;return L.Config.UI?.LockTime&&L.Config.UI?.LockTime>=10&&(e=L.Config.UI.LockTime),e}let Be;function Ae(){clearInterval(Be),window.location.href.indexOf("/login")>0||At.isLock||(Wn(!1),At.lockTime=Fn(),Be=setInterval(()=>{if(At.lockTime--,At.lockTime<=0)return Wn(!0),clearInterval(Be)},1e3))}function or(){Ae(),document.addEventListener("mousedown",Ae)}function rr(){document.removeEventListener("mousedown",Ae)}var sr={exports:{}},Kt=sr.exports=function e(t,n,i){function r(y,w){if(!n[y]){if(!t[y]){if(!w&&Se)return Se(y);if(c)return c(y,!0);var S=new Error("Cannot find module '"+y+"'");throw S.code="MODULE_NOT_FOUND",S}var E=n[y]={exports:{}};t[y][0].call(E.exports,function(z){var I=t[y][1][z];return r(I||z)},E,E.exports,e,t,n,i)}return n[y].exports}for(var c=Se,v=0;v<i.length;v++)r(i[v]);return r}({1:[function(e,t,n){(function(i){var r,c,v=i.MutationObserver||i.WebKitMutationObserver;if(v){var y=0,w=new v(I),S=i.document.createTextNode("");w.observe(S,{characterData:!0}),r=function(){S.data=y=++y%2}}else if(i.setImmediate||i.MessageChannel===void 0)r="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var P=i.document.createElement("script");P.onreadystatechange=function(){I(),P.onreadystatechange=null,P.parentNode.removeChild(P),P=null},i.document.documentElement.appendChild(P)}:function(){setTimeout(I,0)};else{var E=new i.MessageChannel;E.port1.onmessage=I,r=function(){E.port2.postMessage(0)}}var z=[];function I(){var P,b;c=!0;for(var u=z.length;u;){for(b=z,z=[],P=-1;++P<u;)b[P]();u=z.length}c=!1}function D(P){z.push(P)!==1||c||r()}t.exports=D}).call(this,_t!==void 0?_t:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var i=e(1);function r(){}var c={},v=["REJECTED"],y=["FULFILLED"],w=["PENDING"];function S(l){if(typeof l!="function")throw new TypeError("resolver must be a function");this.state=w,this.queue=[],this.outcome=void 0,l!==r&&D(this,l)}function E(l,p,T){this.promise=l,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}function z(l,p,T){i(function(){var R;try{R=p(T)}catch(B){return c.reject(l,B)}R===l?c.reject(l,new TypeError("Cannot resolve promise with itself")):c.resolve(l,R)})}function I(l){var p=l&&l.then;if(l&&(typeof l=="object"||typeof l=="function")&&typeof p=="function")return function(){p.apply(l,arguments)}}function D(l,p){var T=!1;function R(j){T||(T=!0,c.reject(l,j))}function B(j){T||(T=!0,c.resolve(l,j))}function U(){p(B,R)}var O=P(U);O.status==="error"&&R(O.value)}function P(l,p){var T={};try{T.value=l(p),T.status="success"}catch(R){T.status="error",T.value=R}return T}function b(l){return l instanceof this?l:c.resolve(new this(r),l)}function u(l){var p=new this(r);return c.reject(p,l)}function d(l){var p=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=l.length,R=!1;if(!T)return this.resolve([]);for(var B=new Array(T),U=0,O=-1,j=new this(r);++O<T;)$(l[O],O);return j;function $(G,X){function it(Q){B[X]=Q,++U!==T||R||(R=!0,c.resolve(j,B))}p.resolve(G).then(it,function(Q){R||(R=!0,c.reject(j,Q))})}}function h(l){var p=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=l.length,R=!1;if(!T)return this.resolve([]);for(var B=-1,U=new this(r);++B<T;)O(l[B]);return U;function O(j){p.resolve(j).then(function($){R||(R=!0,c.resolve(U,$))},function($){R||(R=!0,c.reject(U,$))})}}t.exports=S,S.prototype.catch=function(l){return this.then(null,l)},S.prototype.then=function(l,p){if(typeof l!="function"&&this.state===y||typeof p!="function"&&this.state===v)return this;var T=new this.constructor(r);return this.state!==w?z(T,this.state===y?l:p,this.outcome):this.queue.push(new E(T,l,p)),T},E.prototype.callFulfilled=function(l){c.resolve(this.promise,l)},E.prototype.otherCallFulfilled=function(l){z(this.promise,this.onFulfilled,l)},E.prototype.callRejected=function(l){c.reject(this.promise,l)},E.prototype.otherCallRejected=function(l){z(this.promise,this.onRejected,l)},c.resolve=function(l,p){var T=P(I,p);if(T.status==="error")return c.reject(l,T.value);var R=T.value;if(R)D(l,R);else{l.state=y,l.outcome=p;for(var B=-1,U=l.queue.length;++B<U;)l.queue[B].callFulfilled(p)}return l},c.reject=function(l,p){l.state=v,l.outcome=p;for(var T=-1,R=l.queue.length;++T<R;)l.queue[T].callRejected(p);return l},S.resolve=b,S.reject=u,S.all=d,S.race=h},{1:1}],3:[function(e,t,n){(function(i){typeof i.Promise!="function"&&(i.Promise=e(2))}).call(this,_t!==void 0?_t:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function r(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")}function c(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var v=c();function y(){try{if(!v||!v.open)return!1;var o=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),s=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!o||s)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function w(o,s){o=o||[],s=s||{};try{return new Blob(o,s)}catch(f){if(f.name!=="TypeError")throw f;for(var a=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),m=0;m<o.length;m+=1)a.append(o[m]);return a.getBlob(s.type)}}typeof Promise>"u"&&e(3);var S=Promise;function E(o,s){s&&o.then(function(a){s(null,a)},function(a){s(a)})}function z(o,s,a){typeof s=="function"&&o.then(s),typeof a=="function"&&o.catch(a)}function I(o){return typeof o!="string"&&(console.warn(o+" used as a key, but it is not a string."),o=String(o)),o}function D(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var P="local-forage-detect-blob-support",b=void 0,u={},d=Object.prototype.toString,h="readonly",l="readwrite";function p(o){for(var s=o.length,a=new ArrayBuffer(s),m=new Uint8Array(a),f=0;f<s;f++)m[f]=o.charCodeAt(f);return a}function T(o){return new S(function(s){var a=o.transaction(P,l),m=w([""]);a.objectStore(P).put(m,"key"),a.onabort=function(f){f.preventDefault(),f.stopPropagation(),s(!1)},a.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),g=navigator.userAgent.match(/Edge\//);s(g||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function R(o){return typeof b=="boolean"?S.resolve(b):T(o).then(function(s){return b=s})}function B(o){var s=u[o.name],a={};a.promise=new S(function(m,f){a.resolve=m,a.reject=f}),s.deferredOperations.push(a),s.dbReady?s.dbReady=s.dbReady.then(function(){return a.promise}):s.dbReady=a.promise}function U(o){var s=u[o.name].deferredOperations.pop();if(s)return s.resolve(),s.promise}function O(o,s){var a=u[o.name].deferredOperations.pop();if(a)return a.reject(s),a.promise}function j(o,s){return new S(function(a,m){if(u[o.name]=u[o.name]||Ze(),o.db){if(!s)return a(o.db);B(o),o.db.close()}var f=[o.name];s&&f.push(o.version);var g=v.open.apply(v,f);s&&(g.onupgradeneeded=function(C){var x=g.result;try{x.createObjectStore(o.storeName),C.oldVersion<=1&&x.createObjectStore(P)}catch(k){if(k.name!=="ConstraintError")throw k;console.warn('The database "'+o.name+'" has been upgraded from version '+C.oldVersion+" to version "+C.newVersion+', but the storage "'+o.storeName+'" already exists.')}}),g.onerror=function(C){C.preventDefault(),m(g.error)},g.onsuccess=function(){var C=g.result;C.onversionchange=function(x){x.target.close()},a(C),U(o)}})}function $(o){return j(o,!1)}function G(o){return j(o,!0)}function X(o,s){if(!o.db)return!0;var a=!o.db.objectStoreNames.contains(o.storeName),m=o.version<o.db.version,f=o.version>o.db.version;if(m&&(o.version!==s&&console.warn('The database "'+o.name+`" can't be downgraded from version `+o.db.version+" to version "+o.version+"."),o.version=o.db.version),f||a){if(a){var g=o.db.version+1;g>o.version&&(o.version=g)}return!0}return!1}function it(o){return new S(function(s,a){var m=new FileReader;m.onerror=a,m.onloadend=function(f){var g=btoa(f.target.result||"");s({__local_forage_encoded_blob:!0,data:g,type:o.type})},m.readAsBinaryString(o)})}function Q(o){return w([p(atob(o.data))],{type:o.type})}function st(o){return o&&o.__local_forage_encoded_blob}function le(o){var s=this,a=s._initReady().then(function(){var m=u[s._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return z(a,o,o),a}function he(o){B(o);for(var s=u[o.name],a=s.forages,m=0;m<a.length;m++){var f=a[m];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return o.db=null,$(o).then(function(g){return o.db=g,X(o)?G(o):g}).then(function(g){o.db=s.db=g;for(var C=0;C<a.length;C++)a[C]._dbInfo.db=g}).catch(function(g){throw O(o,g),g})}function at(o,s,a,m){m===void 0&&(m=1);try{var f=o.db.transaction(o.storeName,s);a(null,f)}catch(g){if(m>0&&(!o.db||g.name==="InvalidStateError"||g.name==="NotFoundError"))return S.resolve().then(function(){if(!o.db||g.name==="NotFoundError"&&!o.db.objectStoreNames.contains(o.storeName)&&o.version<=o.db.version)return o.db&&(o.version=o.db.version+1),G(o)}).then(function(){return he(o).then(function(){at(o,s,a,m-1)})}).catch(a);a(g)}}function Ze(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function li(o){var s=this,a={db:null};if(o)for(var m in o)a[m]=o[m];var f=u[a.name];f||(f=Ze(),u[a.name]=f),f.forages.push(s),s._initReady||(s._initReady=s.ready,s.ready=le);var g=[];function C(){return S.resolve()}for(var x=0;x<f.forages.length;x++){var k=f.forages[x];k!==s&&g.push(k._initReady().catch(C))}var M=f.forages.slice(0);return S.all(g).then(function(){return a.db=f.db,$(a)}).then(function(_){return a.db=_,X(a,s._defaultConfig.version)?G(a):_}).then(function(_){a.db=f.db=_,s._dbInfo=a;for(var A=0;A<M.length;A++){var N=M[A];N!==s&&(N._dbInfo.db=a.db,N._dbInfo.version=a.version)}})}function hi(o,s){var a=this;o=I(o);var m=new S(function(f,g){a.ready().then(function(){at(a._dbInfo,h,function(C,x){if(C)return g(C);try{var k=x.objectStore(a._dbInfo.storeName).get(o);k.onsuccess=function(){var M=k.result;M===void 0&&(M=null),st(M)&&(M=Q(M)),f(M)},k.onerror=function(){g(k.error)}}catch(M){g(M)}})}).catch(g)});return E(m,s),m}function di(o,s){var a=this,m=new S(function(f,g){a.ready().then(function(){at(a._dbInfo,h,function(C,x){if(C)return g(C);try{var k=x.objectStore(a._dbInfo.storeName).openCursor(),M=1;k.onsuccess=function(){var _=k.result;if(_){var A=_.value;st(A)&&(A=Q(A));var N=o(A,_.key,M++);N!==void 0?f(N):_.continue()}else f()},k.onerror=function(){g(k.error)}}catch(_){g(_)}})}).catch(g)});return E(m,s),m}function fi(o,s,a){var m=this;o=I(o);var f=new S(function(g,C){var x;m.ready().then(function(){return x=m._dbInfo,d.call(s)==="[object Blob]"?R(x.db).then(function(k){return k?s:it(s)}):s}).then(function(k){at(m._dbInfo,l,function(M,_){if(M)return C(M);try{var A=_.objectStore(m._dbInfo.storeName);k===null&&(k=void 0);var N=A.put(k,o);_.oncomplete=function(){k===void 0&&(k=null),g(k)},_.onabort=_.onerror=function(){var W=N.error?N.error:N.transaction.error;C(W)}}catch(W){C(W)}})}).catch(C)});return E(f,a),f}function pi(o,s){var a=this;o=I(o);var m=new S(function(f,g){a.ready().then(function(){at(a._dbInfo,l,function(C,x){if(C)return g(C);try{var k=x.objectStore(a._dbInfo.storeName).delete(o);x.oncomplete=function(){f()},x.onerror=function(){g(k.error)},x.onabort=function(){var M=k.error?k.error:k.transaction.error;g(M)}}catch(M){g(M)}})}).catch(g)});return E(m,s),m}function mi(o){var s=this,a=new S(function(m,f){s.ready().then(function(){at(s._dbInfo,l,function(g,C){if(g)return f(g);try{var x=C.objectStore(s._dbInfo.storeName).clear();C.oncomplete=function(){m()},C.onabort=C.onerror=function(){var k=x.error?x.error:x.transaction.error;f(k)}}catch(k){f(k)}})}).catch(f)});return E(a,o),a}function gi(o){var s=this,a=new S(function(m,f){s.ready().then(function(){at(s._dbInfo,h,function(g,C){if(g)return f(g);try{var x=C.objectStore(s._dbInfo.storeName).count();x.onsuccess=function(){m(x.result)},x.onerror=function(){f(x.error)}}catch(k){f(k)}})}).catch(f)});return E(a,o),a}function vi(o,s){var a=this,m=new S(function(f,g){o<0?f(null):a.ready().then(function(){at(a._dbInfo,h,function(C,x){if(C)return g(C);try{var k=x.objectStore(a._dbInfo.storeName),M=!1,_=k.openKeyCursor();_.onsuccess=function(){var A=_.result;A?o===0||M?f(A.key):(M=!0,A.advance(o)):f(null)},_.onerror=function(){g(_.error)}}catch(A){g(A)}})}).catch(g)});return E(m,s),m}function yi(o){var s=this,a=new S(function(m,f){s.ready().then(function(){at(s._dbInfo,h,function(g,C){if(g)return f(g);try{var x=C.objectStore(s._dbInfo.storeName).openKeyCursor(),k=[];x.onsuccess=function(){var M=x.result;M?(k.push(M.key),M.continue()):m(k)},x.onerror=function(){f(x.error)}}catch(M){f(M)}})}).catch(f)});return E(a,o),a}function wi(o,s){s=D.apply(this,arguments);var a=this.config();(o=typeof o!="function"&&o||{}).name||(o.name=o.name||a.name,o.storeName=o.storeName||a.storeName);var m,f=this;if(o.name){var g=o.name===a.name&&f._dbInfo.db?S.resolve(f._dbInfo.db):$(o).then(function(C){var x=u[o.name],k=x.forages;x.db=C;for(var M=0;M<k.length;M++)k[M]._dbInfo.db=C;return C});m=o.storeName?g.then(function(C){if(C.objectStoreNames.contains(o.storeName)){var x=C.version+1;B(o);var k=u[o.name],M=k.forages;C.close();for(var _=0;_<M.length;_++){var A=M[_];A._dbInfo.db=null,A._dbInfo.version=x}return new S(function(N,W){var F=v.open(o.name,x);F.onerror=function(ot){F.result.close(),W(ot)},F.onupgradeneeded=function(){F.result.deleteObjectStore(o.storeName)},F.onsuccess=function(){var ot=F.result;ot.close(),N(ot)}}).then(function(N){k.db=N;for(var W=0;W<M.length;W++){var F=M[W];F._dbInfo.db=N,U(F._dbInfo)}}).catch(function(N){throw(O(o,N)||S.resolve()).catch(function(){}),N})}}):g.then(function(C){B(o);var x=u[o.name],k=x.forages;C.close();for(var M=0;M<k.length;M++)k[M]._dbInfo.db=null;return new S(function(_,A){var N=v.deleteDatabase(o.name);N.onerror=function(){var W=N.result;W&&W.close(),A(N.error)},N.onblocked=function(){console.warn('dropInstance blocked for database "'+o.name+'" until all open connections are closed')},N.onsuccess=function(){var W=N.result;W&&W.close(),_(W)}}).then(function(_){x.db=_;for(var A=0;A<k.length;A++)U(k[A]._dbInfo)}).catch(function(_){throw(O(o,_)||S.resolve()).catch(function(){}),_})})}else m=S.reject("Invalid arguments");return E(m,s),m}var bi={_driver:"asyncStorage",_initStorage:li,_support:y(),iterate:di,getItem:hi,setItem:fi,removeItem:pi,clear:mi,length:gi,key:vi,keys:yi,dropInstance:wi};function Si(){return typeof openDatabase=="function"}var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ci="~~local_forage_type~",Qe=/^~~local_forage_type~([^~]+)~/,Ot="__lfsc__:",de=Ot.length,fe="arbf",pe="blob",tn="si08",en="ui08",nn="uic8",on="si16",rn="si32",sn="ur16",an="ui32",cn="fl32",un="fl64",ln=de+fe.length,hn=Object.prototype.toString;function dn(o){var s,a,m,f,g,C=.75*o.length,x=o.length,k=0;o[o.length-1]==="="&&(C--,o[o.length-2]==="="&&C--);var M=new ArrayBuffer(C),_=new Uint8Array(M);for(s=0;s<x;s+=4)a=ht.indexOf(o[s]),m=ht.indexOf(o[s+1]),f=ht.indexOf(o[s+2]),g=ht.indexOf(o[s+3]),_[k++]=a<<2|m>>4,_[k++]=(15&m)<<4|f>>2,_[k++]=(3&f)<<6|63&g;return M}function me(o){var s,a=new Uint8Array(o),m="";for(s=0;s<a.length;s+=3)m+=ht[a[s]>>2],m+=ht[(3&a[s])<<4|a[s+1]>>4],m+=ht[(15&a[s+1])<<2|a[s+2]>>6],m+=ht[63&a[s+2]];return a.length%3==2?m=m.substring(0,m.length-1)+"=":a.length%3==1&&(m=m.substring(0,m.length-2)+"=="),m}function xi(o,s){var a="";if(o&&(a=hn.call(o)),o&&(a==="[object ArrayBuffer]"||o.buffer&&hn.call(o.buffer)==="[object ArrayBuffer]")){var m,f=Ot;o instanceof ArrayBuffer?(m=o,f+=fe):(m=o.buffer,a==="[object Int8Array]"?f+=tn:a==="[object Uint8Array]"?f+=en:a==="[object Uint8ClampedArray]"?f+=nn:a==="[object Int16Array]"?f+=on:a==="[object Uint16Array]"?f+=sn:a==="[object Int32Array]"?f+=rn:a==="[object Uint32Array]"?f+=an:a==="[object Float32Array]"?f+=cn:a==="[object Float64Array]"?f+=un:s(new Error("Failed to get type for BinaryArray"))),s(f+me(m))}else if(a==="[object Blob]"){var g=new FileReader;g.onload=function(){var C=Ci+o.type+"~"+me(this.result);s(Ot+pe+C)},g.readAsArrayBuffer(o)}else try{s(JSON.stringify(o))}catch(C){console.error("Couldn't convert value into a JSON string: ",o),s(null,C)}}function ki(o){if(o.substring(0,de)!==Ot)return JSON.parse(o);var s,a=o.substring(ln),m=o.substring(de,ln);if(m===pe&&Qe.test(a)){var f=a.match(Qe);s=f[1],a=a.substring(f[0].length)}var g=dn(a);switch(m){case fe:return g;case pe:return w([g],{type:s});case tn:return new Int8Array(g);case en:return new Uint8Array(g);case nn:return new Uint8ClampedArray(g);case on:return new Int16Array(g);case sn:return new Uint16Array(g);case rn:return new Int32Array(g);case an:return new Uint32Array(g);case cn:return new Float32Array(g);case un:return new Float64Array(g);default:throw new Error("Unkown type: "+m)}}var ge={serialize:xi,deserialize:ki,stringToBuffer:dn,bufferToString:me};function fn(o,s,a,m){o.executeSql("CREATE TABLE IF NOT EXISTS "+s.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],a,m)}function Ei(o){var s=this,a={db:null};if(o)for(var m in o)a[m]=typeof o[m]!="string"?o[m].toString():o[m];var f=new S(function(g,C){try{a.db=openDatabase(a.name,String(a.version),a.description,a.size)}catch(x){return C(x)}a.db.transaction(function(x){fn(x,a,function(){s._dbInfo=a,g()},function(k,M){C(M)})},C)});return a.serializer=ge,f}function dt(o,s,a,m,f,g){o.executeSql(a,m,f,function(C,x){x.code===x.SYNTAX_ERR?C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[s.storeName],function(k,M){M.rows.length?g(k,x):fn(k,s,function(){k.executeSql(a,m,f,g)},g)},g):g(C,x)},g)}function zi(o,s){var a=this;o=I(o);var m=new S(function(f,g){a.ready().then(function(){var C=a._dbInfo;C.db.transaction(function(x){dt(x,C,"SELECT * FROM "+C.storeName+" WHERE key = ? LIMIT 1",[o],function(k,M){var _=M.rows.length?M.rows.item(0).value:null;_&&(_=C.serializer.deserialize(_)),f(_)},function(k,M){g(M)})})}).catch(g)});return E(m,s),m}function Mi(o,s){var a=this,m=new S(function(f,g){a.ready().then(function(){var C=a._dbInfo;C.db.transaction(function(x){dt(x,C,"SELECT * FROM "+C.storeName,[],function(k,M){for(var _=M.rows,A=_.length,N=0;N<A;N++){var W=_.item(N),F=W.value;if(F&&(F=C.serializer.deserialize(F)),(F=o(F,W.key,N+1))!==void 0)return void f(F)}f()},function(k,M){g(M)})})}).catch(g)});return E(m,s),m}function pn(o,s,a,m){var f=this;o=I(o);var g=new S(function(C,x){f.ready().then(function(){s===void 0&&(s=null);var k=s,M=f._dbInfo;M.serializer.serialize(s,function(_,A){A?x(A):M.db.transaction(function(N){dt(N,M,"INSERT OR REPLACE INTO "+M.storeName+" (key, value) VALUES (?, ?)",[o,_],function(){C(k)},function(W,F){x(F)})},function(N){if(N.code===N.QUOTA_ERR){if(m>0)return void C(pn.apply(f,[o,k,a,m-1]));x(N)}})})}).catch(x)});return E(g,a),g}function _i(o,s,a){return pn.apply(this,[o,s,a,1])}function Ri(o,s){var a=this;o=I(o);var m=new S(function(f,g){a.ready().then(function(){var C=a._dbInfo;C.db.transaction(function(x){dt(x,C,"DELETE FROM "+C.storeName+" WHERE key = ?",[o],function(){f()},function(k,M){g(M)})})}).catch(g)});return E(m,s),m}function Ii(o){var s=this,a=new S(function(m,f){s.ready().then(function(){var g=s._dbInfo;g.db.transaction(function(C){dt(C,g,"DELETE FROM "+g.storeName,[],function(){m()},function(x,k){f(k)})})}).catch(f)});return E(a,o),a}function Li(o){var s=this,a=new S(function(m,f){s.ready().then(function(){var g=s._dbInfo;g.db.transaction(function(C){dt(C,g,"SELECT COUNT(key) as c FROM "+g.storeName,[],function(x,k){var M=k.rows.item(0).c;m(M)},function(x,k){f(k)})})}).catch(f)});return E(a,o),a}function Pi(o,s){var a=this,m=new S(function(f,g){a.ready().then(function(){var C=a._dbInfo;C.db.transaction(function(x){dt(x,C,"SELECT key FROM "+C.storeName+" WHERE id = ? LIMIT 1",[o+1],function(k,M){var _=M.rows.length?M.rows.item(0).key:null;f(_)},function(k,M){g(M)})})}).catch(g)});return E(m,s),m}function Ti(o){var s=this,a=new S(function(m,f){s.ready().then(function(){var g=s._dbInfo;g.db.transaction(function(C){dt(C,g,"SELECT key FROM "+g.storeName,[],function(x,k){for(var M=[],_=0;_<k.rows.length;_++)M.push(k.rows.item(_).key);m(M)},function(x,k){f(k)})})}).catch(f)});return E(a,o),a}function Bi(o){return new S(function(s,a){o.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,g){for(var C=[],x=0;x<g.rows.length;x++)C.push(g.rows.item(x).name);s({db:o,storeNames:C})},function(f,g){a(g)})},function(m){a(m)})})}function Ai(o,s){s=D.apply(this,arguments);var a=this.config();(o=typeof o!="function"&&o||{}).name||(o.name=o.name||a.name,o.storeName=o.storeName||a.storeName);var m,f=this;return E(m=o.name?new S(function(g){var C;C=o.name===a.name?f._dbInfo.db:openDatabase(o.name,"","",0),o.storeName?g({db:C,storeNames:[o.storeName]}):g(Bi(C))}).then(function(g){return new S(function(C,x){g.db.transaction(function(k){function M(W){return new S(function(F,ot){k.executeSql("DROP TABLE IF EXISTS "+W,[],function(){F()},function(yn,Pt){ot(Pt)})})}for(var _=[],A=0,N=g.storeNames.length;A<N;A++)_.push(M(g.storeNames[A]));S.all(_).then(function(){C()}).catch(function(W){x(W)})},function(k){x(k)})})}):S.reject("Invalid arguments"),s),m}var Di={_driver:"webSQLStorage",_initStorage:Ei,_support:Si(),iterate:Mi,getItem:zi,setItem:_i,removeItem:Ri,clear:Ii,length:Li,key:Pi,keys:Ti,dropInstance:Ai};function Ni(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function mn(o,s){var a=o.name+"/";return o.storeName!==s.storeName&&(a+=o.storeName+"/"),a}function Ui(){var o="_localforage_support_test";try{return localStorage.setItem(o,!0),localStorage.removeItem(o),!1}catch{return!0}}function Oi(){return!Ui()||localStorage.length>0}function ji(o){var s=this,a={};if(o)for(var m in o)a[m]=o[m];return a.keyPrefix=mn(o,s._defaultConfig),Oi()?(s._dbInfo=a,a.serializer=ge,S.resolve()):S.reject()}function Wi(o){var s=this,a=s.ready().then(function(){for(var m=s._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var g=localStorage.key(f);g.indexOf(m)===0&&localStorage.removeItem(g)}});return E(a,o),a}function Fi(o,s){var a=this;o=I(o);var m=a.ready().then(function(){var f=a._dbInfo,g=localStorage.getItem(f.keyPrefix+o);return g&&(g=f.serializer.deserialize(g)),g});return E(m,s),m}function $i(o,s){var a=this,m=a.ready().then(function(){for(var f=a._dbInfo,g=f.keyPrefix,C=g.length,x=localStorage.length,k=1,M=0;M<x;M++){var _=localStorage.key(M);if(_.indexOf(g)===0){var A=localStorage.getItem(_);if(A&&(A=f.serializer.deserialize(A)),(A=o(A,_.substring(C),k++))!==void 0)return A}}});return E(m,s),m}function Hi(o,s){var a=this,m=a.ready().then(function(){var f,g=a._dbInfo;try{f=localStorage.key(o)}catch{f=null}return f&&(f=f.substring(g.keyPrefix.length)),f});return E(m,s),m}function qi(o){var s=this,a=s.ready().then(function(){for(var m=s._dbInfo,f=localStorage.length,g=[],C=0;C<f;C++){var x=localStorage.key(C);x.indexOf(m.keyPrefix)===0&&g.push(x.substring(m.keyPrefix.length))}return g});return E(a,o),a}function Gi(o){var s=this.keys().then(function(a){return a.length});return E(s,o),s}function Xi(o,s){var a=this;o=I(o);var m=a.ready().then(function(){var f=a._dbInfo;localStorage.removeItem(f.keyPrefix+o)});return E(m,s),m}function Vi(o,s,a){var m=this;o=I(o);var f=m.ready().then(function(){s===void 0&&(s=null);var g=s;return new S(function(C,x){var k=m._dbInfo;k.serializer.serialize(s,function(M,_){if(_)x(_);else try{localStorage.setItem(k.keyPrefix+o,M),C(g)}catch(A){A.name!=="QuotaExceededError"&&A.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(A),x(A)}})})});return E(f,a),f}function Ki(o,s){if(s=D.apply(this,arguments),!(o=typeof o!="function"&&o||{}).name){var a=this.config();o.name=o.name||a.name,o.storeName=o.storeName||a.storeName}var m,f=this;return E(m=o.name?new S(function(g){o.storeName?g(mn(o,f._defaultConfig)):g(o.name+"/")}).then(function(g){for(var C=localStorage.length-1;C>=0;C--){var x=localStorage.key(C);x.indexOf(g)===0&&localStorage.removeItem(x)}}):S.reject("Invalid arguments"),s),m}var Yi={_driver:"localStorageWrapper",_initStorage:ji,_support:Ni(),iterate:$i,getItem:Fi,setItem:Vi,removeItem:Xi,clear:Wi,length:Gi,key:Hi,keys:qi,dropInstance:Ki},Ji=function(o,s){return o===s||typeof o=="number"&&typeof s=="number"&&isNaN(o)&&isNaN(s)},Zi=function(o,s){for(var a=o.length,m=0;m<a;){if(Ji(o[m],s))return!0;m++}return!1},gn=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"},Lt={},vn={},Et={INDEXEDDB:bi,WEBSQL:Di,LOCALSTORAGE:Yi},Qi=[Et.INDEXEDDB._driver,Et.WEBSQL._driver,Et.LOCALSTORAGE._driver],jt=["dropInstance"],ve=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(jt),to={description:"",driver:Qi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function eo(o,s){o[s]=function(){var a=arguments;return o.ready().then(function(){return o[s].apply(o,a)})}}function ye(){for(var o=1;o<arguments.length;o++){var s=arguments[o];if(s)for(var a in s)s.hasOwnProperty(a)&&(gn(s[a])?arguments[0][a]=s[a].slice():arguments[0][a]=s[a])}return arguments[0]}var no=new(function(){function o(s){for(var a in r(this,o),Et)if(Et.hasOwnProperty(a)){var m=Et[a],f=m._driver;this[a]=f,Lt[f]||this.defineDriver(m)}this._defaultConfig=ye({},to),this._config=ye({},this._defaultConfig,s),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return o.prototype.config=function(s){if((s===void 0?"undefined":i(s))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var a in s){if(a==="storeName"&&(s[a]=s[a].replace(/\W/g,"_")),a==="version"&&typeof s[a]!="number")return new Error("Database version must be a number.");this._config[a]=s[a]}return!("driver"in s)||!s.driver||this.setDriver(this._config.driver)}return typeof s=="string"?this._config[s]:this._config},o.prototype.defineDriver=function(s,a,m){var f=new S(function(g,C){try{var x=s._driver,k=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!s._driver)return void C(k);for(var M=ve.concat("_initStorage"),_=0,A=M.length;_<A;_++){var N=M[_];if((!Zi(jt,N)||s[N])&&typeof s[N]!="function")return void C(k)}(function(){for(var F=function(io){return function(){var oo=new Error("Method "+io+" is not implemented by the current driver"),wn=S.reject(oo);return E(wn,arguments[arguments.length-1]),wn}},ot=0,yn=jt.length;ot<yn;ot++){var Pt=jt[ot];s[Pt]||(s[Pt]=F(Pt))}})();var W=function(F){Lt[x]&&console.info("Redefining LocalForage driver: "+x),Lt[x]=s,vn[x]=F,g()};"_support"in s?s._support&&typeof s._support=="function"?s._support().then(W,C):W(!!s._support):W(!0)}catch(F){C(F)}});return z(f,a,m),f},o.prototype.driver=function(){return this._driver||null},o.prototype.getDriver=function(s,a,m){var f=Lt[s]?S.resolve(Lt[s]):S.reject(new Error("Driver not found."));return z(f,a,m),f},o.prototype.getSerializer=function(s){var a=S.resolve(ge);return z(a,s),a},o.prototype.ready=function(s){var a=this,m=a._driverSet.then(function(){return a._ready===null&&(a._ready=a._initDriver()),a._ready});return z(m,s,s),m},o.prototype.setDriver=function(s,a,m){var f=this;gn(s)||(s=[s]);var g=this._getSupportedDrivers(s);function C(){f._config.driver=f.driver()}function x(_){return f._extend(_),C(),f._ready=f._initStorage(f._config),f._ready}function k(_){return function(){var A=0;function N(){for(;A<_.length;){var W=_[A];return A++,f._dbInfo=null,f._ready=null,f.getDriver(W).then(x).catch(N)}C();var F=new Error("No available storage method found.");return f._driverSet=S.reject(F),f._driverSet}return N()}}var M=this._driverSet!==null?this._driverSet.catch(function(){return S.resolve()}):S.resolve();return this._driverSet=M.then(function(){var _=g[0];return f._dbInfo=null,f._ready=null,f.getDriver(_).then(function(A){f._driver=A._driver,C(),f._wrapLibraryMethodsWithReady(),f._initDriver=k(g)})}).catch(function(){C();var _=new Error("No available storage method found.");return f._driverSet=S.reject(_),f._driverSet}),z(this._driverSet,a,m),this._driverSet},o.prototype.supports=function(s){return!!vn[s]},o.prototype._extend=function(s){ye(this,s)},o.prototype._getSupportedDrivers=function(s){for(var a=[],m=0,f=s.length;m<f;m++){var g=s[m];this.supports(g)&&a.push(g)}return a},o.prototype._wrapLibraryMethodsWithReady=function(){for(var s=0,a=ve.length;s<a;s++)eo(this,ve[s])},o.prototype.createInstance=function(s){return new o(s)},o}());t.exports=no},{3:3}]},{},[4])(4),$n={exports:{}};/*! streamsaver. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */(function(e){$n.exports=(()=>{const t=typeof window=="object"?window:this;t.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,i=!1;const r=t.WebStreamsPolyfill||{},c=t.isSecureContext;let v=/constructor/i.test(t.HTMLElement)||!!t.safari||!!t.WebKitPoint;const y=c||"MozAppearance"in document.documentElement.style?"iframe":"navigate",w={createWriteStream:function(E,z,I){let D={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},P=0,b=null,u=null,d=null;if(Number.isFinite(z)?([I,z]=[z,I],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),D.size=I,D.writableStrategy=z):z&&z.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),D.size=I,D.writableStrategy=z):D=z||{},!v){n||(n=c?S(w.mitm):function(T){const R="width=200,height=100",B=document.createDocumentFragment(),U={frame:t.open(T,"popup",R),loaded:!1,isIframe:!1,isPopup:!0,remove(){U.frame.close()},addEventListener(...j){B.addEventListener(...j)},dispatchEvent(...j){B.dispatchEvent(...j)},removeEventListener(...j){B.removeEventListener(...j)},postMessage(...j){U.frame.postMessage(...j)}},O=j=>{j.source===U.frame&&(U.loaded=!0,t.removeEventListener("message",O),U.dispatchEvent(new Event("load")))};return t.addEventListener("message",O),U}(w.mitm)),u=new MessageChannel,E=encodeURIComponent(E.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const l={transferringReadable:i,pathname:D.pathname||Math.random().toString().slice(-6)+"/"+E,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+E}};D.size&&(l.headers["Content-Length"]=D.size);const p=[l,"*",[u.port2]];if(i){const T=y==="iframe"?void 0:{transform(B,U){if(!(B instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");P+=B.length,U.enqueue(B),b&&(location.href=b,b=null)},flush(){b&&(location.href=b)}};d=new w.TransformStream(T,D.writableStrategy,D.readableStrategy);const R=d.readable;u.port1.postMessage({readableStream:R},[R])}u.port1.onmessage=T=>{T.data.download?y==="navigate"?(n.remove(),n=null,P?location.href=T.data.download:b=T.data.download):(n.isPopup&&(n.remove(),n=null,y==="iframe"&&S(w.mitm)),S(T.data.download)):T.data.abort&&(h=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...p):n.addEventListener("load",()=>{n.postMessage(...p)},{once:!0})}let h=[];return!v&&d&&d.writable||new w.WritableStream({write(l){if(!(l instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");v?h.push(l):(u.port1.postMessage(l),P+=l.length,b&&(location.href=b,b=null))},close(){if(v){const l=new Blob(h,{type:"application/octet-stream; charset=utf-8"}),p=document.createElement("a");p.href=URL.createObjectURL(l),p.download=E,p.click()}else u.port1.postMessage("end")},abort(){h=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},D.writableStrategy)},WritableStream:t.WritableStream||r.WritableStream,supported:!0,version:{full:"2.0.5",major:2,minor:0,dot:5},mitm:"https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0"};function S(E){if(!E)throw new Error("meh");const z=document.createElement("iframe");return z.hidden=!0,z.src=E,z.loaded=!1,z.name="iframe",z.isIframe=!0,z.postMessage=(...I)=>z.contentWindow.postMessage(...I),z.addEventListener("load",()=>{z.loaded=!0},{once:!0}),document.body.appendChild(z),z}try{new Response(new ReadableStream),c&&!("serviceWorker"in navigator)&&(v=!0)}catch{v=!0}return(E=>{try{E()}catch{}})(()=>{const{readable:E}=new TransformStream,z=new MessageChannel;z.port1.postMessage(E,[E]),z.port1.close(),z.port2.close(),i=!0,Object.defineProperty(w,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),w})()})();var ar=$n.exports;class cr{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(t,n,i=3,r=6,c=6e4){this.fileID=t,this.downloadURL=n,this.chunkByteSize=i*this.ChunkUnitM,this.eventTarget=Me(),this.initIndexDB(),r>=3&&(this.cacheSize=r),c>this.requestTimeout&&(this.requestTimeout=c)}on(t,n){this.eventTarget.on(t,n)}dispatch(t,n){this.eventTarget.emit(t,n)}dispatchError(t){this.eventTarget.emit("error",t)}dispatchInfo(t){this.eventTarget.emit("info",t)}async queryDownloadFileMeta(t,n="",i){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await rt(n,t,i);let c=null;return r&&r.status===200&&(c=r.data),c}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=Kt.createInstance({name:this.fileID,driver:Kt.INDEXEDDB})}async init(t){if(this.finishNum=0,t){const n="fileinfo";this.fileMetaData={id:t.id,name:t.name,length:t.length,downloadID:t.downloadID,chunkSize:this.chunkByteSize},this.fileName=t.name,this.currentDB?.setItem(n,this.fileMetaData)}if(this.fileMetaData!=null){const n=this.fileMetaData.chunkSize;n!=null&&n>0&&(this.chunkByteSize=n)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),Kt.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(t){return new Promise(n=>setTimeout(n,t))}async download(t,n){let i=t;if(!i&&this.downloadURL&&(i=this.downloadURL),!i)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=L.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const c={key:this.fileMetaData?.downloadID};let v=0;const y=this.cacheSize;let w=0;for(let S=0;S<this.totalChunks;S++){if(this.keys&&this.keys?.indexOf(S.toString())>=0){v++,v>this.finishNum&&(this.finishNum=v,this.downloadProgress());continue}const E=S*this.chunkByteSize;let z=E+this.chunkByteSize-1;this.fileMetaData&&z>this.fileMetaData.length&&(z=this.fileMetaData.length-1);const I={range:`bytes=${E}-${z}`};for(;w>=y;)await this.sleep(200);const D=S.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${S+1}/${this.totalChunks}`),w++,rt(i,n,c,I,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async P=>{const b=P.data;w--,await this.currentDB?.setItem(D,b),v++,v>this.finishNum&&(this.finishNum=v,this.downloadProgress());const u=parseInt(D)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(P=>{w--;const b=parseInt(D)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${b}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const t=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",t)}outputProgress(t){const n=100*t/this.totalChunks;this.dispatch("saveProgress",n)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const t=ar.createWriteStream(this.fileName).getWriter();let n=0;for(let i=0;i<this.totalChunks;i++){const r=i.toString();let c=await this.currentDB?.getItem(r);if(c||(c=await this.currentDB?.getItem(r)),!c)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let v=new Response(c).body;if(v===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const y=v.getReader();for(;;){const{done:w,value:S}=await y.read();if(w)break;await t.write(S)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${i+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),Kt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}const ur=Object.prototype.toString;function Y(e,t){return ur.call(e)===`[object ${t}]`}function De(e){return Y(e,"Function")}const Hn=e=>e!==void 0,Ne=e=>!Hn(e);function Ue(e){return e===null}function lr(e){return Ne(e)&&Ue(e)}function hr(e){return Ne(e)||Ue(e)}const xt=e=>e!==null&&Y(e,"Object");function dr(e){return Y(e,"Date")}function fr(e){return Y(e,"Number")}function pr(e){return Y(e,"AsyncFunction")}function mr(e){return Y(e,"Promise")&&xt(e)&&De(e.then)&&De(e.catch)}function Yt(e){return Y(e,"String")}function gr(e){return e===!0||e===!1||Y(e,"Boolean")}function qn(e){return e&&Array.isArray(e)}const vr=()=>typeof window<"u",yr=e=>typeof window<"u"&&Y(e,"Window"),wr=e=>xt(e)&&!!e.tagName,br=typeof window>"u";function Sr(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function Cr(e){return e==null||(Yt(e)||qn(e)?e.length===0:!!xt(e)&&JSON.stringify(e)==="{}")}function xr(e){return Y(e,"Error")}function kr(e){return Y(e,"WeakSet")}function Er(e){return Y(e,"WeakMap")}function zr(e){return Y(e,"Symbol")}function Mr(e){return Y(e,"Map")}const _r=e=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(e);function Rr(e,t){let n="",i="";for(const r in t)n+=r+"="+encodeURIComponent(t[r])+"&";return n=n.replace(/&$/,""),i=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,i}function Gn(e={},t={}){let n;for(n in t)e[n]=xt(e[n])?Gn(e[n],t[n]):e[n]=t[n];return e}function Xn(e){const t=function(w){if(!w)return;const S=w,E=[];if(S)for(let z of S){const I=Vn(z);I&&E.push(I)}return E}(e.bussinessRoutes),n=function(w){if(!w)return;const S=w;if(S&&S.length>0){const E=[];return S.forEach(z=>{const I=Kn(z);I&&E.push(I)}),E}}(e.widgetMenuConfig),i=function(w){if(!!w&&w.length>0){const S=[];return w.forEach(E=>{const z=function(I){if(!!I)return{id:I.id,label:I.label,container:I.container,preload:I.preload,afterid:I.afterid,bindid:I.bindid,group:I.group}}(E);z&&S.push(z)}),S}}(e.widgetConfig),r=(c=e.functionList)&&c.length>0?c:void 0;var c;const v=e.pkgObject.version,y=e.pkgObject.name;return{id:function(w,S){const E=`${w}_${S}`;return lt.MD5(E)}(y,v),name:L.Config.UI.SiteTitle,group:L.Config.UI.Group,product:y,version:v,routes:t,widgetMenu:n,widgets:i,functions:r}}function Vn(e){if(e){let t=0;e.meta?.hidden&&(t=1);let n={path:e.path,name:e.name,title:e.meta?.title,type:t,index:e.meta?.index};if(e.children){const i=[];for(let r of e.children){const c=Vn(r);c&&i.push(c)}i.length>0&&(n.children=i)}return n}}function Kn(e){if(!e)return;const t={name:e.name,index:e.index,path:e.path,type:e.type};return e.children&&e.children.length>0&&(t.children=[],e.children.forEach(n=>{const i=Kn(n);i&&t.children?.push(i)})),t}function Ir(e,t="IconifyList.ts"){let n="",i=`const iconlist={
3
- `,r=0;e.forEach(c=>{const v=c.split(":");if(v&&v.length===2){const y="icon"+r;n+=`import ${y} from '~icons/${v[0]}/${v[1]}'
4
- `,i+=` '${c}':${y},
1
+ import{h as oo,openBlock as H,createElementBlock as tt,normalizeStyle as yt,renderSlot as ft,reactive as bn,computed as pt,defineComponent as Tt,ref as nt,onMounted as Sn,onUpdated as ro,nextTick as Cn,normalizeClass as so,createElementVNode as V,createCommentVNode as zt,createVNode as xn,Transition as kn,withCtx as Wt,withModifiers as En,getCurrentInstance as ao,watch as $t,onBeforeUnmount as co,resolveComponent as zn,createBlock as ut,withDirectives as uo,Fragment as wt,createTextVNode as Mn,toDisplayString as lo,vShow as ho,markRaw as _n,toRefs as fo,renderList as Mt,resolveDynamicComponent as bt}from"vue";import po from"axios";import{Client as mo,ClientContext as we}from"@hprose/rpc-core";import{ByteStream as In}from"@hprose/io";import{HttpTransport as go}from"@hprose/rpc-html5";var vo={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let n=0;this.panes=this.panes.map((i,r)=>(i.size=r===t?i.max:i.min,r!==t&&(n+=i.min),i)),this.panes[t].size-=n,this.$emit("pane-maximize",this.panes[t])},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:n,clientY:i}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:i-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),100*e/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const i=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),s=Math.max(Math.min(this.getCurrentDragPercentage(e),r),i);let g=[t,t+1],y=this.panes[g[0]]||null,w=this.panes[g[1]]||null;const S=y.max<100&&s>=y.max+n.prevPanesSize,k=w.max<100&&s<=100-(w.max+this.sumNextPanesSize(t+1));if(S||k)S?(y.size=y.max,w.size=Math.max(100-y.max-n.prevPanesSize-n.nextPanesSize,0)):(y.size=Math.max(100-w.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),w.size=w.max);else{if(this.pushOtherPanes){const z=this.doPushOtherPanes(n,s);if(!z)return;({sums:n,panesToResize:g}=z),y=this.panes[g[0]]||null,w=this.panes[g[1]]||null}y!==null&&(y.size=Math.min(Math.max(s-n.prevPanesSize-n.prevReachedMinPanes,y.min),y.max)),w!==null&&(w.size=Math.min(Math.max(100-s-n.nextPanesSize-n.nextReachedMinPanes,w.min),w.max))}},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,i=[n,n+1];return t<e.prevPanesSize+this.panes[i[0]].min&&(i[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,i[0]<n&&this.panes.forEach((r,s)=>{s>i[0]&&s<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),e.prevPanesSize=this.sumPrevPanesSize(i[0]),i[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,s)=>{s>0&&s<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),this.panes[i[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[i[1]].min&&(i[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,i[1]>n+1&&this.panes.forEach((r,s)=>{s>n&&s<i[1]&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),e.nextPanesSize=this.sumNextPanesSize(i[1]-1),i[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,s)=>{s<this.panesCount-1&&s>=n+1&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),this.panes[i[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:i}},sumPrevPanesSize(e){return this.panes.reduce((t,n,i)=>t+(i<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,i)=>t+(i>e+1?n.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),n=e.classList.contains("splitpanes__splitter");if(!t&&!n)return e.parentNode.removeChild(e),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(e,t,n=!1){const i=e-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(r.onmousedown=s=>this.onMouseDown(s,i),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=s=>this.onMouseDown(s,i)),r.onclick=s=>this.onSplitterClick(s,i+1)),this.dblClickSplitter&&(r.ondblclick=s=>this.onSplitterDblClick(s,i+1)),t.parentNode.insertBefore(r,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let t=0;e.forEach(n=>{n.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,n,!0):t&&this.addSplitter(t,n),t++)})},requestUpdate({target:e,...t}){const n=this.indexedPanes[e._.uid];Object.entries(t).forEach(([i,r])=>n[i]=r)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&t++,r===e.$el));const n=parseFloat(e.minSize),i=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(i)?100:i,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((r,s)=>r.index=s),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(i=>i.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((i,r)=>i.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.size}))})})},resetPaneSizes(e={}){e.addedPane||e.removedPane?this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const n=[],i=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(e,r.max),r.min),t-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&i.push(r.id)}),t>.1&&this.readjustSizes(t,n,i)},initialPanesSizing(){let e=100;const t=[],n=[];let i=0;this.panes.forEach(s=>{e-=s.size,s.size!==null&&i++,s.size>=s.max&&t.push(s.id),s.size<=s.min&&n.push(s.id)});let r=100;e>.1&&(this.panes.forEach(s=>{s.size===null&&(s.size=Math.max(Math.min(e/(this.panesCount-i),s.max),s.min)),r-=s.size}),r>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e}={}){let t=100/this.panesCount,n=0;const i=[],r=[];e&&e.givenSize!==null&&(t=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(s=>{n-=s.size,s.size>=s.max&&i.push(s.id),s.size<=s.min&&r.push(s.id)}),Math.abs(n)<.1||(this.panes.forEach(s=>{e&&e.givenSize!==null&&e.id===s.id||(s.size=Math.max(Math.min(t,s.max),s.min)),n-=s.size,s.size>=s.max&&i.push(s.id),s.size<=s.min&&r.push(s.id)}),n>.1&&this.readjustSizes(n,i,r))},readjustSizes(e,t,n){let i;i=e>0?e/(this.panesCount-t.length):e/(this.panesCount-n.length),this.panes.forEach(r=>{if(e>0&&!t.includes(r.id)){const s=Math.max(Math.min(r.size+i,r.max),r.min);e-=s-r.size,r.size=s}else if(!n.includes(r.id)){const s=Math.max(Math.min(r.size+i,r.max),r.min);e-=s-r.size,r.size=s}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,n)=>{t.ondblclick=e?i=>this.onSplitterDblClick(i,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.updatePaneComponents(),this.$emit("ready"),this.ready=!0},render(){return oo("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},be={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:10},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};be.render=function(e,t,n,i,r,s){return H(),tt("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=g=>s.onPaneClick(g,e._.uid)),style:yt(e.style)},[ft(e.$slots,"default")],4)},be.__file="src/controls/splitpanes/pane.vue";var _t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Se(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var yo={exports:{}},Rn=yo.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(b,u){var d=b[0],h=b[1],l=b[2],p=b[3];h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[0]-680876936|0)<<7|d>>>25)+h|0)&h|~d&l)+u[1]-389564586|0)<<12|p>>>20)+d|0)&d|~p&h)+u[2]+606105819|0)<<17|l>>>15)+p|0)&p|~l&d)+u[3]-1044525330|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[4]-176418897|0)<<7|d>>>25)+h|0)&h|~d&l)+u[5]+1200080426|0)<<12|p>>>20)+d|0)&d|~p&h)+u[6]-1473231341|0)<<17|l>>>15)+p|0)&p|~l&d)+u[7]-45705983|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[8]+1770035416|0)<<7|d>>>25)+h|0)&h|~d&l)+u[9]-1958414417|0)<<12|p>>>20)+d|0)&d|~p&h)+u[10]-42063|0)<<17|l>>>15)+p|0)&p|~l&d)+u[11]-1990404162|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[12]+1804603682|0)<<7|d>>>25)+h|0)&h|~d&l)+u[13]-40341101|0)<<12|p>>>20)+d|0)&d|~p&h)+u[14]-1502002290|0)<<17|l>>>15)+p|0)&p|~l&d)+u[15]+1236535329|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[1]-165796510|0)<<5|d>>>27)+h|0)&l|h&~l)+u[6]-1069501632|0)<<9|p>>>23)+d|0)&h|d&~h)+u[11]+643717713|0)<<14|l>>>18)+p|0)&d|p&~d)+u[0]-373897302|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[5]-701558691|0)<<5|d>>>27)+h|0)&l|h&~l)+u[10]+38016083|0)<<9|p>>>23)+d|0)&h|d&~h)+u[15]-660478335|0)<<14|l>>>18)+p|0)&d|p&~d)+u[4]-405537848|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[9]+568446438|0)<<5|d>>>27)+h|0)&l|h&~l)+u[14]-1019803690|0)<<9|p>>>23)+d|0)&h|d&~h)+u[3]-187363961|0)<<14|l>>>18)+p|0)&d|p&~d)+u[8]+1163531501|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[13]-1444681467|0)<<5|d>>>27)+h|0)&l|h&~l)+u[2]-51403784|0)<<9|p>>>23)+d|0)&h|d&~h)+u[7]+1735328473|0)<<14|l>>>18)+p|0)&d|p&~d)+u[12]-1926607734|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[5]-378558|0)<<4|d>>>28)+h|0)^h^l)+u[8]-2022574463|0)<<11|p>>>21)+d|0)^d^h)+u[11]+1839030562|0)<<16|l>>>16)+p|0)^p^d)+u[14]-35309556|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[1]-1530992060|0)<<4|d>>>28)+h|0)^h^l)+u[4]+1272893353|0)<<11|p>>>21)+d|0)^d^h)+u[7]-155497632|0)<<16|l>>>16)+p|0)^p^d)+u[10]-1094730640|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[13]+681279174|0)<<4|d>>>28)+h|0)^h^l)+u[0]-358537222|0)<<11|p>>>21)+d|0)^d^h)+u[3]-722521979|0)<<16|l>>>16)+p|0)^p^d)+u[6]+76029189|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[9]-640364487|0)<<4|d>>>28)+h|0)^h^l)+u[12]-421815835|0)<<11|p>>>21)+d|0)^d^h)+u[15]+530742520|0)<<16|l>>>16)+p|0)^p^d)+u[2]-995338651|0)<<23|h>>>9)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[0]-198630844|0)<<6|d>>>26)+h|0)|~l))+u[7]+1126891415|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[14]-1416354905|0)<<15|l>>>17)+p|0)|~d))+u[5]-57434055|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[12]+1700485571|0)<<6|d>>>26)+h|0)|~l))+u[3]-1894986606|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[10]-1051523|0)<<15|l>>>17)+p|0)|~d))+u[1]-2054922799|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[8]+1873313359|0)<<6|d>>>26)+h|0)|~l))+u[15]-30611744|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[6]-1560198380|0)<<15|l>>>17)+p|0)|~d))+u[13]+1309151649|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[4]-145523070|0)<<6|d>>>26)+h|0)|~l))+u[11]-1120210379|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[2]+718787259|0)<<15|l>>>17)+p|0)|~d))+u[9]-343485551|0)<<21|h>>>11)+l|0,b[0]=d+b[0]|0,b[1]=h+b[1]|0,b[2]=l+b[2]|0,b[3]=p+b[3]|0}function i(b){var u,d=[];for(u=0;u<64;u+=4)d[u>>2]=b.charCodeAt(u)+(b.charCodeAt(u+1)<<8)+(b.charCodeAt(u+2)<<16)+(b.charCodeAt(u+3)<<24);return d}function r(b){var u,d=[];for(u=0;u<64;u+=4)d[u>>2]=b[u]+(b[u+1]<<8)+(b[u+2]<<16)+(b[u+3]<<24);return d}function s(b){var u,d,h,l,p,T,I=b.length,B=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=I;u+=64)n(B,i(b.substring(u-64,u)));for(d=(b=b.substring(u-64)).length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<d;u+=1)h[u>>2]|=b.charCodeAt(u)<<(u%4<<3);if(h[u>>2]|=128<<(u%4<<3),u>55)for(n(B,h),u=0;u<16;u+=1)h[u]=0;return l=(l=8*I).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(l[2],16),T=parseInt(l[1],16)||0,h[14]=p,h[15]=T,n(B,h),B}function g(b){var u,d,h,l,p,T,I=b.length,B=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=I;u+=64)n(B,r(b.subarray(u-64,u)));for(d=(b=u-64<I?b.subarray(u-64):new Uint8Array(0)).length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<d;u+=1)h[u>>2]|=b[u]<<(u%4<<3);if(h[u>>2]|=128<<(u%4<<3),u>55)for(n(B,h),u=0;u<16;u+=1)h[u]=0;return l=(l=8*I).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(l[2],16),T=parseInt(l[1],16)||0,h[14]=p,h[15]=T,n(B,h),B}function y(b){var u,d="";for(u=0;u<4;u+=1)d+=t[b>>8*u+4&15]+t[b>>8*u&15];return d}function w(b){var u;for(u=0;u<b.length;u+=1)b[u]=y(b[u]);return b.join("")}function S(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function k(b,u){var d,h=b.length,l=new ArrayBuffer(h),p=new Uint8Array(l);for(d=0;d<h;d+=1)p[d]=b.charCodeAt(d);return u?p:l}function z(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function L(b,u,d){var h=new Uint8Array(b.byteLength+u.byteLength);return h.set(new Uint8Array(b)),h.set(new Uint8Array(u),b.byteLength),d?h:h.buffer}function A(b){var u,d=[],h=b.length;for(u=0;u<h-1;u+=2)d.push(parseInt(b.substr(u,2),16));return String.fromCharCode.apply(String,d)}function P(){this.reset()}return w(s("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function b(u,d){return(u=0|u||0)<0?Math.max(u+d,0):Math.min(u,d)}ArrayBuffer.prototype.slice=function(u,d){var h,l,p,T,I=this.byteLength,B=b(u,I),U=I;return d!==e&&(U=b(d,I)),B>U?new ArrayBuffer(0):(h=U-B,l=new ArrayBuffer(h),p=new Uint8Array(l),T=new Uint8Array(this,B,h),p.set(T),l)}}(),P.prototype.append=function(b){return this.appendBinary(S(b)),this},P.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var u,d=this._buff.length;for(u=64;u<=d;u+=64)n(this._hash,i(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},P.prototype.end=function(b){var u,d,h=this._buff,l=h.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<l;u+=1)p[u>>2]|=h.charCodeAt(u)<<(u%4<<3);return this._finish(p,l),d=w(this._hash),b&&(d=A(d)),this.reset(),d},P.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},P.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},P.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},P.prototype._finish=function(b,u){var d,h,l,p=u;if(b[p>>2]|=128<<(p%4<<3),p>55)for(n(this._hash,b),p=0;p<16;p+=1)b[p]=0;d=(d=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),h=parseInt(d[2],16),l=parseInt(d[1],16)||0,b[14]=h,b[15]=l,n(this._hash,b)},P.hash=function(b,u){return P.hashBinary(S(b),u)},P.hashBinary=function(b,u){var d=w(s(b));return u?A(d):d},P.ArrayBuffer=function(){this.reset()},P.ArrayBuffer.prototype.append=function(b){var u,d=L(this._buff.buffer,b,!0),h=d.length;for(this._length+=b.byteLength,u=64;u<=h;u+=64)n(this._hash,r(d.subarray(u-64,u)));return this._buff=u-64<h?new Uint8Array(d.buffer.slice(u-64)):new Uint8Array(0),this},P.ArrayBuffer.prototype.end=function(b){var u,d,h=this._buff,l=h.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<l;u+=1)p[u>>2]|=h[u]<<(u%4<<3);return this._finish(p,l),d=w(this._hash),b&&(d=A(d)),this.reset(),d},P.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.ArrayBuffer.prototype.getState=function(){var b=P.prototype.getState.call(this);return b.buff=z(b.buff),b},P.ArrayBuffer.prototype.setState=function(b){return b.buff=k(b.buff,!0),P.prototype.setState.call(this,b)},P.ArrayBuffer.prototype.destroy=P.prototype.destroy,P.ArrayBuffer.prototype._finish=P.prototype._finish,P.ArrayBuffer.hash=function(b,u){var d=w(g(new Uint8Array(b)));return u?A(d):d},P}();const Ce=[];class ot{static addHandler(t,n,i){t.addEventListener?t.addEventListener(n,i,!1):t.attachEvent?t.attachEvent("on"+n,i):t["on"+n]=i}static windowResizeHandler(t){ot.addHandler(window,"resize",t)}static fullscreenEnabled(){const t=window.document;return document.fullscreenEnabled||window.fullScreen||t.mozFullscreenEnabled||t.webkitIsFullScreen}static fullScreen(t,n){if(n){const i=window.document;let r=window.document.exitFullscreen||i.msExitFullscreen||i.mozCancelFullScreen||i.webkitCancelFullScreen;if(r!==void 0&&r)r.call(window.document);else if(window.ActiveXObject!==void 0){let s=new window.ActiveXObject("WScript.Shell");s?.SendKeys("{F11}")}}else{let i=t;i||(i=window.document.documentElement);let r=i.requestFullScreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullScreen;if(r!==void 0&&r)r.call(i);else if(window.ActiveXObject!==void 0){let s=new window.ActiveXObject("WScript.Shell");s?.SendKeys("{F11}")}}}static requestFullScreen(t=window.document.documentElement){let n=t;var i=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(i)i.call(n);else if(window.ActiveXObject!==void 0){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static exitFullScreen(){const t=window.document;var n=document.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.webkitExitFullscreen;if(n)n.call(document);else if(window.ActiveXObject!==void 0){var i=new window.ActiveXObject("WScript.Shell");i!==null&&i.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!ot.fullScreenElement()}static onFullScreenChanged(t){let n;"onfullscreenchange"in window.document?n="fullscreenchange":"onwebkitfullscreenchange"in window.document?n="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(n="mozfullscreenchange"),n?document.addEventListener(n,function(){const i=ot.isFullScreen();t(i)}):document.addEventListener("MSFullscreenChange",function(){const i=ot.isFullScreen();t(i)})}static stringifyCircularHandler(t,n){if(typeof n=="object"&&n!==null){if(Ce.indexOf(n)!==-1)return;Ce.push(n)}return n}static jsonStringify(t){if(!t)return"";const n=JSON.stringify(t,ot.stringifyCircularHandler);return Ce.length=0,n}static jsonParse(t){const n=ot.jsonStringify(t);if(n.length>1)return JSON.parse(n)}static getObjectURL(t){let n;const i=window;return i.createObjcectURL!=null?n=i.createOjcectURL(t):window.URL!=null?n=window.URL.createObjectURL(t):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(t)),n}static getFileShortMD5(t,n){const i=File.prototype,r=i.slice||i.mozSlice||i.webkitSlice,s=t,g=new Rn.ArrayBuffer,y=new FileReader;y.onload=function(w){g.append(w.target?.result);const S=g.end();n({isOK:!0,data:S})},y.onerror=function(){const w="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(w),n({isOK:!1,data:w})},function(){const w=2097152>=s.size?s.size:2097152;y.readAsArrayBuffer(r.call(s,0,w))}()}static MD5(t,n=!1){return Rn.hash(t,n)}static copyText=t=>new Promise((n,i)=>{const r=document.createElement("input");r.value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)});static setGrayMode(t){ot.toggleClass(t,"grayMode",document.documentElement)}static toggleClass(t,n,i){const r=i||document.body;let{className:s}=r;s=s.replace(n,""),r.className=t?`${s} ${n} `:s}static setCssVar(t,n,i=document.documentElement){i.style.setProperty(t,n)}}class Ft{static isNullOrEmpty=t=>t===null||t===""||t===void 0||t.length===0;static isNotEmpty=t=>t!==null&&t!==""&&t!==void 0&&t.length!==0;static toHump(t){return t.replace(/[\-\/\_](\w)/g,(n,i)=>i.toUpperCase()).replace("views","")}}class Ht{prefixKey;storage;constructor(t="",n=localStorage){this.prefixKey=t,this.storage=n}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,n,i=604800){const r=JSON.stringify({value:n,expire:i!==null?new Date().getTime()+1e3*i:null});this.storage.setItem(this.getKey(t),r)}get(t,n=null){const i=this.storage.getItem(this.getKey(t));if(i)try{const r=JSON.parse(i),{value:s,expire:g}=r;if(g===null||g>=Date.now())return s;this.remove(this.getKey(t))}catch{return n}return n}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}setCookie(t,n,i=604800){document.cookie=`${this.getKey(t)}=${n}; Max-Age=${i}`}getCookie(t){const n=document.cookie.split("; ");for(let i=0,r=n.length;i<r;i++){const s=n[i].split("=");if(s[0]===this.getKey(t))return s[1]}return""}removeCookie(t){this.setCookie(t,1,-1)}clearCookie(){const t=document.cookie.match(/[^ =;]+(?==)/g);if(t)for(let n=t.length;n--;)document.cookie=t[n]+"=0;expire="+new Date(0).toUTCString()}}const wo=new Ht("",localStorage);function qt(){let e=[];const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const r=Math.floor(16*Math.random());e[n]=t.substring(r,r+1)}e[14]="4";const i=3&Number(e[19])|8;return e[19]=t.substring(i,i+1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}function bo(){var e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==="x"?n:3&n|8).toString(16)})}function So(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),i=Math.floor(n*parseInt(t[0])+255*(1-n)),r=Math.floor(n*parseInt(t[1])+255*(1-n)),s=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+i.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+s.toString(16)).slice(-2)}function Co(e){var t=e.toLowerCase();if(Gt(e)){if(t.length===4){for(var n="#",i=1;i<4;i+=1){const s=t.slice(i,i+1);n+=s.concat(s)}t=n}var r=[];for(i=1;i<7;i+=2)r.push(parseInt("0x"+t.slice(i,i+2)));return"rgb("+r.join(",")+")"}return t}function xo(e){const t=e;if(t.length===4){let i="#";for(var n=1;n<4;n+=1){const r=t.slice(n,n+1);i+=r.concat(r)}return i}return t}var St,It;function ko(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substring(0,1);return t==="#"?St.Hex:t==="r"||t==="("?St.RGBA:t==="h"?St.Hsla:St.RGBA}function Eo(e){if(!!e){var t=e.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(!!t){var n,i,r,s=(parseFloat(t[1])%360+360)%360/360,g=parseFloat(t[2])/(/%$/.test(t[2])?100:1),y=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(g===0)n=i=r=y;else{var w=y<=.5?y*(g+1):y+g-y*g,S=2*y-w;n=xe(S,w,s+1/3),i=xe(S,w,s),r=xe(S,w,s-1/3)}return`rgba(${n=Math.round(255*n)},${i=Math.round(255*i)},${r=Math.round(255*r)},${t[4]?parseFloat(t[4]):1})`}}}function xe(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Gt(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(e)}function zo(e,t,n){const i=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(i.length-7)).join("0")+i}function ke(e){let t=e.toLowerCase();if(Gt(e)){if(t.length===4){let i="#";for(let r=1;r<4;r+=1)i+=t.slice(r,r+1).concat(t.slice(r,r+1));t=i}const n=[];for(let i=1;i<7;i+=2)n.push(parseInt("0x"+t.slice(i,i+2)));return"RGB("+n.join(",")+")"}return t}function Mo(e){if(!Gt(e))return;const[t,n,i]=ke(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*t+.578*n+.114*i<192}function _o(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${ze(e.substring(0,2),t)}${ze(e.substring(2,4),t)}${ze(e.substring(4,6),t)}`}function Io(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${Ee(e.substring(0,2),t)}${Ee(e.substring(2,4),t)}${Ee(e.substring(4,6),t)}`}function Ee(e,t){const n=parseInt(e,16)+t,i=n>255?255:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Ln(e,t,n){const i=[e,t,n].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}function Ro(e){const t=ke(e.substring(1));var n,i;return n=t.split(","),i=[0,0,0],(Ln(~~n[0],~~n[1],~~n[2])+.05)/(Ln(i[0],i[1],i[2])+.05)>=12?"#000000":"#FFFFFF"}function ze(e,t){const n=parseInt(e,16)-t,i=n<0?0:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Me(e){return{all:e=e||new Map,on(t,n){const i=e?.get(t);i&&i.push(n)||e?.set(t,[n])},off(t,n){const i=e?.get(t);i&&i.splice(i.indexOf(n)>>>0,1)},emit(t,n){(e?.get(t)||[]).slice().map(i=>{i(n)}),(e?.get("*")||[]).slice().map(i=>{i(t,n)})}}}(It=St||(St={}))[It.RGBA=0]="RGBA",It[It.Hex=1]="Hex",It[It.Hsla=2]="Hsla";const Rt=Me(),K={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent"},Xt=(e,t)=>{const n=document.createElement("a");n.download=t,n.style.display="none";const i=new Blob([e],{type:"application/octet-stream"});n.href=URL.createObjectURL(i),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function Lo(e,t){const n=window.URL||window.webkitURL||window,i=new Blob([e]),r=document.createElement("a");r.href=n.createObjectURL(i),r.download=t,r.click(),n.revokeObjectURL(r.href)}const Pn=(e,t)=>{const n=JSON.stringify(e,null,2);t?Xt(n,t+".json"):Rt.emit(K.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},Po=(e,t,n)=>{e.get(t).then(function(i){Xt(i.data,n)}).catch(i=>{console.warn(i),Rt.emit(K.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function Tn(e){const t=e.lastIndexOf("/")+1;let n=e.substring(t);return n=decodeURI(n.split("?")[0]),n}function To({url:e,target:t="_blank",fileName:n}){const i=new URL(e).host==location.host;return new Promise((r,s)=>{if(i){const g=document.createElement("a");if(g.href=e,g.target=t,g.download!==void 0&&(g.download=n||Tn(e)),document.createEvent){const y=document.createEvent("MouseEvents");return y.initEvent("click",!0,!0),g.dispatchEvent(y),r(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),r(!0)}{const g=document.createElement("canvas"),y=document.createElement("img");y.setAttribute("crossOrigin","Anonymous"),y.src=e,y.onload=w=>{g.width=y.width,g.height=y.height,g.getContext("2d").drawImage(y,0,0,y.width,y.height),g.toBlob(S=>{if(S){const k=document.createElement("a");k.href=window.URL.createObjectURL(S),k.download=Tn(e),k.click(),URL.revokeObjectURL(k.href),r(!0)}},"image/jpeg")},y.onerror=w=>s(w)}})}function Bo(e){for(var t=new Date().getTime();new Date().getTime()-t<e;);console.log(`\u5F3A\u5236\u7B49\u5F85${e}\u6BEB\u79D2`)}const R={Config:SysConfig,EventBus:Rt,DefaultProxyClient:null,Axios:po},mt=new Ht("user",localStorage);function Ct(){return mt.get("access_token")}function _e(){mt.remove("access_token"),R.User&&delete R.User}function Bn(){return Ct()?.refresh}function Ie(e,t,n,i="json",r){const s={baseURL:R.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:e,headers:{"Content-Type":"application/json",Authorization:"bearer "+Ct()?.token},responseType:i,cancelToken:r};if(n)for(let g in n)s.headers[g]=n[g];return R.SystemID&&(s.headers.sysid=R.SystemID,R.SystemGroup&&(s.headers.sysgroup=R.SystemGroup)),t&&(s.baseURL=t),s}function st(e,t,n,i,r="json",s,g){const y=Ie(n,t,i,r,s);return g&&g>=2e4&&(y.timeout=g),R.Axios?.get(e,y).catch(function(w){Vt(w,t,e,"Get")})}function Vt(e,t,n,i="Get"){const r=`${t}${n}`;if(e&&e.response){let s=!1;const g=e.response.status;switch(g){case 400:e.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:e.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:e.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:e.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:e.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:e.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const w=e.response.data;if(w){const S=w.indexOf(":"),k=w.indexOf(`\r
2
+ `);if(S>0&&k-S>2){const z=w.substring(S+2,k);z.indexOf("'System.Exception'")>0?e.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(s=!0,e.message=z)}}else e.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:e.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:e.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:e.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:e.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:e.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:e.message=`\u8FDE\u63A5\u9519\u8BEF${e.response.status}`}let y={address:r,code:g,isExceptionInfo:s,message:e.message,result:e.response.data};if(console.warn(`HTTP ${i}\u8BF7\u6C42\u9519\u8BEF\uFF1A`,y),R.EventBus.emit(K.AxiosRequestErrorEvent,y),s)throw new Error(e.message)}}function Re(e,t,n,i,r,s="json",g){const y=Ie(i,t,r,s);g&&g>=2e4&&(y.timeout=g);const w=function(S){let k=new FormData;return S&&Object.keys(S).forEach(z=>{if(!S)return;let L=S[z];var A;L!=null&&k.append(z,(A=L)instanceof Blob?A:A.toString())}),k}(n);return R.Axios?.post(e,w,y).catch(function(S){Vt(S,t,e,"Post")})}function Do(e,t,n,i,r,s="json",g){const y=Ie(i,t,r,s);return g&&g>=2e4&&(y.timeout=g),R.Axios?.post(e,n,y).catch(function(w){Vt(w,t,e,"Post")})}function Ao(e,t){return st(e,void 0,t)}function No(e,t){return Re(e,void 0,t)}function Uo(e,t){return R.Axios?.get(e,{params:t}).catch(function(n){Vt(n,e,"","\u5916\u90E8Get")})}var Le={exports:{}},Oo=typeof window<"u"?window:_t!==void 0?_t:typeof self<"u"?self:{},jo=function(e){if(!e)return!1;var t=Wo.call(e);return t==="[object Function]"||typeof e=="function"&&t!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Wo=Object.prototype.toString,Pe=function(e){return e.replace(/^\s+|\s+$/g,"")},$o=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)Fo.call(n,i)&&(e[i]=n[i])}return e},Fo=Object.prototype.hasOwnProperty,Dn=Oo,Ho=jo,qo=function(e){if(!e)return{};for(var t,n={},i=Pe(e).split(`
3
+ `),r=0;r<i.length;r++){var s=i[r],g=s.indexOf(":"),y=Pe(s.slice(0,g)).toLowerCase(),w=Pe(s.slice(g+1));n[y]===void 0?n[y]=w:(t=n[y],Object.prototype.toString.call(t)==="[object Array]"?n[y].push(w):n[y]=[n[y],w])}return n},Go=$o;function An(e,t,n){var i=e;return Ho(t)?(n=t,typeof e=="string"&&(i={uri:e})):i=Go(t,{uri:e}),i.callback=n,i}function lt(e,t,n){return Nn(t=An(e,t,n))}function Nn(e){if(e.callback===void 0)throw new Error("callback argument missing");var t=!1,n=function(d,h,l){t||(t=!0,e.callback(d,h,l))};function i(){var d=void 0;if(d=w.response?w.response:w.responseText||function(h){try{if(h.responseType==="document")return h.responseXML;var l=h.responseXML&&h.responseXML.documentElement.nodeName==="parsererror";if(h.responseType===""&&!l)return h.responseXML}catch{}return null}(w),b)try{d=JSON.parse(d)}catch{}return d}function r(d){return clearTimeout(S),d instanceof Error||(d=new Error(""+(d||"Unknown XMLHttpRequest Error"))),d.statusCode=0,n(d,u)}function s(){if(!y){var d;clearTimeout(S),d=e.useXDR&&w.status===void 0?200:w.status===1223?204:w.status;var h=u,l=null;return d!==0?(h={body:i(),statusCode:d,method:z,headers:{},url:k,rawRequest:w},w.getAllResponseHeaders&&(h.headers=qo(w.getAllResponseHeaders()))):l=new Error("Internal XMLHttpRequest Error"),n(l,h,h.body)}}var g,y,w=e.xhr||null;w||(w=e.cors||e.useXDR?new lt.XDomainRequest:new lt.XMLHttpRequest);var S,k=w.url=e.uri||e.url,z=w.method=e.method||"GET",L=e.body||e.data,A=w.headers=e.headers||{},P=!!e.sync,b=!1,u={body:void 0,headers:{},statusCode:0,method:z,url:k,rawRequest:w};if("json"in e&&e.json!==!1&&(b=!0,A.accept||A.Accept||(A.Accept="application/json"),z!=="GET"&&z!=="HEAD"&&(A["content-type"]||A["Content-Type"]||(A["Content-Type"]="application/json"),L=JSON.stringify(e.json===!0?L:e.json))),w.onreadystatechange=function(){w.readyState===4&&setTimeout(s,0)},w.onload=s,w.onerror=r,w.onprogress=function(){},w.onabort=function(){y=!0},w.ontimeout=r,w.open(z,k,!P,e.username,e.password),P||(w.withCredentials=!!e.withCredentials),!P&&e.timeout>0&&(S=setTimeout(function(){if(!y){y=!0,w.abort("timeout");var d=new Error("XMLHttpRequest timeout");d.code="ETIMEDOUT",r(d)}},e.timeout)),w.setRequestHeader)for(g in A)A.hasOwnProperty(g)&&w.setRequestHeader(g,A[g]);else if(e.headers&&!function(d){for(var h in d)if(d.hasOwnProperty(h))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(w.responseType=e.responseType),"beforeSend"in e&&typeof e.beforeSend=="function"&&e.beforeSend(w),w.send(L||null),w}Le.exports=lt,Le.exports.default=lt,lt.XMLHttpRequest=Dn.XMLHttpRequest||function(){},lt.XDomainRequest="withCredentials"in new lt.XMLHttpRequest?lt.XMLHttpRequest:Dn.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){lt[e==="delete"?"del":e]=function(t,n,i){return(n=An(t,n,i)).method=e.toUpperCase(),Nn(n)}});var Xo=Le.exports;const Vo=[200,201,202,204,308],Ko=[408,502,503,504];class Yo{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(t){this.endpoint=t.endpoint,this.file=t.file,this.fileName=encodeURI(this.file.name),this.headers=t.headers||{},this.method=t.method||"PUT",this.chunkSize=t.chunkSize||5120,this.attempts=t.attempts||5,this.delayBeforeAttempt=t.delayBeforeAttempt||1,this.md5=t.md5||"",this.maxFileBytes=1024*(t.maxFileSize||0),this.chunkCount=0,this.chunkByteSize=1024*this.chunkSize,this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.attemptCount=0,this.offline=!1,this.paused=!1,this.success=!1,this.reader=new FileReader,this.eventTarget=Me(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{this.offline&&(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}on(t,n){this.eventTarget.on(t,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(t,n){this.eventTarget.emit(t,n)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint\u5FC5\u987B\u4E3A\uFF1A\u6587\u4EF6\u4E0A\u4F20URL\u5B57\u7B26\u4E32\uFF0C\u6216\u8FD4\u56DE\u5730\u5740\u7684\u51FD\u6570\uFF01");if(!(this.file instanceof File))throw new TypeError("file\u5FC5\u987B\u4E3A\u6587\u4EF6\u5BF9\u8C61");if(this.headers&&typeof this.headers!="object")throw new TypeError("\u6587\u4EF6\u5934\u5FC5\u987B\u4E3A\u5BF9\u8C61\u6216\u7A7A\uFF01");if(this.chunkSize&&(typeof this.chunkSize!="number"||this.chunkSize<=0||this.chunkSize%256!=0))throw new TypeError("chunkSize\u5FC5\u987B\u5927\u4E8E0,\u5E76\u662F256\u7684\u6574\u6570\u500D");if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u5141\u8BB8\u503C\uFF1A(${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("\u91CD\u8BD5\u6B21\u6570\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("\u5EF6\u65F6\u91CD\u8BD5\u65F6\u95F4\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01\u9ED8\u8BA4\u4E3A1")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(t=>(this.endpointValue=t,this.endpointValue))}getChunk(){return new Promise(t=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,i=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),t(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(i,i+n))})}xhrPromise(t){const n=i=>{i.upload.onprogress=r=>{const s=100/this.totalChunks,g=s*this.file.size,y=s*this.chunkCount,w=r.loaded/(r.total??g)*s;this.dispatch("progress",Math.min(y+w,100))}};return new Promise((i,r)=>{this.currentXhr=Xo({...t,beforeSend:n},(s,g)=>(this.currentXhr=void 0,s?r(s):i(g)))})}sendChunk(){if(!this.chunk)return;const t=this.chunkCount*this.chunkByteSize,n=t+this.chunk.size-1,i={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${n}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:i,url:this.endpointValue,method:this.method,body:this.chunk});console.warn("\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01"),this.dispatch("error",{message:"\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01\u53D6\u6D88\u4E0A\u4F20\uFF01",chunk:this.chunkCount,attempts:this.attemptCount})}manageRetries(){if(this.attemptCount<this.attempts)return setTimeout(()=>this.sendChunks(),1e3*this.delayBeforeAttempt),void this.dispatch("attemptFailure",{message:`\u4E0A\u4F20\u5206\u7247\uFF1A${this.chunkCount}\u5931\u8D25\u3002\u8FD8\u4F1A\u518D\u5C1D\u8BD5 ${this.attempts-this.attemptCount}\u6B21\uFF01`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount});this.dispatch("error",{message:`\u4E0A\u4F20\u5206\u7247\u9519\u8BEF\uFF1A ${this.chunkCount}\u3002\u505C\u6B62\u5C1D\u8BD5\uFF0C\u53D6\u6D88\u4E0A\u4F20\uFF01`,chunk:this.chunkCount,attempts:this.attemptCount})}sendChunks(){this.paused||this.offline||this.success||this.getChunk().then(()=>this.sendChunk()).then(t=>{if(this.attemptCount=this.attemptCount+1,t!=null&&Vo.includes(t.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:t}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const n=100*(this.chunkCount/this.totalChunks*this.file.size)/this.file.size;this.dispatch("progress",n)}else if(t!=null&&Ko.includes(t.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(t=>{this.paused||this.offline||this.manageRetries()})}}const Jo=e=>new Yo(e),Zo=new class{hasClass(e,t){return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}addClass(e,t){this.hasClass(e,t)||(e.className+=" "+t)}removeClass(e,t){if(this.hasClass(e,t)){const n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}toggleClass(e,t){this.hasClass(e,t)?this.removeClass(e,t):this.addClass(e,t)}setCSSProperty(e,t,n){e?.style.setProperty(t,n)}};class Ut{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!Ft.isNullOrEmpty(t)){if(Ut.httpTransport||(Ut.httpTransport=new go),this.client=new mo(t),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=t,this.init()}}init(){this.client&&this.client.useServiceAsync().then(t=>{this.hproseProxy=t}).catch(t=>{String(t).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):Rt.emit(K.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(t)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(t){console.warn(t),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(t,n,i){if(this.client)return await this.client.invoke(t,n,i)}encode(t,n,i){return this.client?this.client.codec.encode(t,n,i):void 0}decode(t,n){return this.client?this.client.codec.decode(t,n):void 0}}class Bt{hproseClient;hpProxyObj;defaultContext=new we;constructor(t){this.hproseClient=new Ut(t),this.hpProxyObj=null}getClientContext(t,n){const i={};n&&(i.requestHeaders=n);const r=Ct();i.httpRequestHeaders=t||{};const s=i.httpRequestHeaders;return r&&(s.token=r.token),R.SystemID&&(s.sysid=R.SystemID,R.SystemGroup&&(s.sysgroup=R.SystemGroup)),new we(i)}async getHproseProxy(){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");if(!this.hpProxyObj){const t=await this.hproseClient.getProxy();this.hpProxyObj=t}return this.hpProxyObj||Rt.emit(K.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(t,n,i){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(t,n,i)}async hproseInvokeContext(t,n,...i){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Ct();return console.log(r,"userToken3"),r&&(n||(n=new we({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(t,i,n)}async hproseInvokeEncode(t){const n=new In(t).toBytes(),i=await this.hproseClient.client?.request(n,this.defaultContext);return i&&this.hproseClient.client?.codec.decode(i,this.defaultContext)}encodeRequest(t,...n){const i=this.hproseClient.client?.codec?.encode(t,n,this.defaultContext);return In.toString(i)}}class Qo{message;eventBus;constructor(t,n){t&&(this.message=t),n&&(this.eventBus=n)}msg(t,n=3,i="success"){if(this.message)if(typeof this.message=="function")this.message({type:i,message:t,duration:n});else switch(i){case"info":this.message.info(t,n);break;case"success":this.message.success(t,n);break;case"warning":this.message.warn(t,n);break;case"error":this.message.error(t,n)}else{switch(i){case"info":case"success":console.log(t);break;case"warning":console.warn(t);break;case"error":i="dark",console.error(t)}this.eventBus&&this.eventBus.emit(K.AlertInfoEvent,{type:i,info:t})}}info(t,n=3){this.msg(t,n,"info")}warn(t,n=3){this.msg(t,n,"warning")}err(t,n=3){this.msg(t,n,"error")}}const Te=new Map,tr=function(e,t,n){!R.Config.DefaultHproseAPI&&R.Config.ServiceURL&&(R.Config.DefaultHproseAPI=R.Config.ServiceURL.DefaultHproseAPI),R.Config.DefaultHproseAPI&&Ft.isNotEmpty(R.Config.DefaultHproseAPI)&&(R.DefaultProxyClient=new Bt(R.Config.DefaultHproseAPI));const i=R.Config.UI.GrayMode;i&&ot.setGrayMode(i);const r=new Qo(e,R.EventBus);R.Message=r,R.SystemID=t,R.SystemGroup=n,R.EventBus.on(K.HproseServiceErrorEvent,s=>{const g=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${s}`;r.warn(g)}),R.EventBus.on(K.WebAPIErrorEvent,s=>{const g=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${s}`;r.warn(g)}),R.EventBus.on(K.CommonWarnEvent,s=>{r.warn(s)})};function Un(e){if(e&&Ft.isNotEmpty(e)){if(Te.has(e))return Te.get(e);{const t=new Bt(e);return Te.set(e,t),t}}}function er(e){const t=Un(e);return t&&(R.DefaultProxyClient=t),t}const On=mt.get("is_LockScreen",!1),Dt={isLock:On,lockTime:On=="true"?Wn():0};function jn(e){Dt.isLock=e,mt.set("is_LockScreen",e,10),e&&(_e(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function nr(){return mt.get("is_LockScreen",!1)}function Wn(){let e=3600;return R.Config.UI?.LockTime&&R.Config.UI?.LockTime>=10&&(e=R.Config.UI.LockTime),e}let Be;function De(){clearInterval(Be),window.location.href.indexOf("/login")>0||Dt.isLock||(jn(!1),Dt.lockTime=Wn(),Be=setInterval(()=>{if(Dt.lockTime--,Dt.lockTime<=0)return jn(!0),clearInterval(Be)},1e3))}function ir(){De(),document.addEventListener("mousedown",De)}function or(){document.removeEventListener("mousedown",De)}var rr={exports:{}},Kt=rr.exports=function e(t,n,i){function r(y,w){if(!n[y]){if(!t[y]){if(!w&&Se)return Se(y);if(s)return s(y,!0);var S=new Error("Cannot find module '"+y+"'");throw S.code="MODULE_NOT_FOUND",S}var k=n[y]={exports:{}};t[y][0].call(k.exports,function(z){var L=t[y][1][z];return r(L||z)},k,k.exports,e,t,n,i)}return n[y].exports}for(var s=Se,g=0;g<i.length;g++)r(i[g]);return r}({1:[function(e,t,n){(function(i){var r,s,g=i.MutationObserver||i.WebKitMutationObserver;if(g){var y=0,w=new g(L),S=i.document.createTextNode("");w.observe(S,{characterData:!0}),r=function(){S.data=y=++y%2}}else if(i.setImmediate||i.MessageChannel===void 0)r="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var P=i.document.createElement("script");P.onreadystatechange=function(){L(),P.onreadystatechange=null,P.parentNode.removeChild(P),P=null},i.document.documentElement.appendChild(P)}:function(){setTimeout(L,0)};else{var k=new i.MessageChannel;k.port1.onmessage=L,r=function(){k.port2.postMessage(0)}}var z=[];function L(){var P,b;s=!0;for(var u=z.length;u;){for(b=z,z=[],P=-1;++P<u;)b[P]();u=z.length}s=!1}function A(P){z.push(P)!==1||s||r()}t.exports=A}).call(this,_t!==void 0?_t:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var i=e(1);function r(){}var s={},g=["REJECTED"],y=["FULFILLED"],w=["PENDING"];function S(l){if(typeof l!="function")throw new TypeError("resolver must be a function");this.state=w,this.queue=[],this.outcome=void 0,l!==r&&A(this,l)}function k(l,p,T){this.promise=l,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}function z(l,p,T){i(function(){var I;try{I=p(T)}catch(B){return s.reject(l,B)}I===l?s.reject(l,new TypeError("Cannot resolve promise with itself")):s.resolve(l,I)})}function L(l){var p=l&&l.then;if(l&&(typeof l=="object"||typeof l=="function")&&typeof p=="function")return function(){p.apply(l,arguments)}}function A(l,p){var T=!1;function I(j){T||(T=!0,s.reject(l,j))}function B(j){T||(T=!0,s.resolve(l,j))}function U(){p(B,I)}var O=P(U);O.status==="error"&&I(O.value)}function P(l,p){var T={};try{T.value=l(p),T.status="success"}catch(I){T.status="error",T.value=I}return T}function b(l){return l instanceof this?l:s.resolve(new this(r),l)}function u(l){var p=new this(r);return s.reject(p,l)}function d(l){var p=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=l.length,I=!1;if(!T)return this.resolve([]);for(var B=new Array(T),U=0,O=-1,j=new this(r);++O<T;)F(l[O],O);return j;function F(G,X){function it(Q){B[X]=Q,++U!==T||I||(I=!0,s.resolve(j,B))}p.resolve(G).then(it,function(Q){I||(I=!0,s.reject(j,Q))})}}function h(l){var p=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=l.length,I=!1;if(!T)return this.resolve([]);for(var B=-1,U=new this(r);++B<T;)O(l[B]);return U;function O(j){p.resolve(j).then(function(F){I||(I=!0,s.resolve(U,F))},function(F){I||(I=!0,s.reject(U,F))})}}t.exports=S,S.prototype.catch=function(l){return this.then(null,l)},S.prototype.then=function(l,p){if(typeof l!="function"&&this.state===y||typeof p!="function"&&this.state===g)return this;var T=new this.constructor(r);return this.state!==w?z(T,this.state===y?l:p,this.outcome):this.queue.push(new k(T,l,p)),T},k.prototype.callFulfilled=function(l){s.resolve(this.promise,l)},k.prototype.otherCallFulfilled=function(l){z(this.promise,this.onFulfilled,l)},k.prototype.callRejected=function(l){s.reject(this.promise,l)},k.prototype.otherCallRejected=function(l){z(this.promise,this.onRejected,l)},s.resolve=function(l,p){var T=P(L,p);if(T.status==="error")return s.reject(l,T.value);var I=T.value;if(I)A(l,I);else{l.state=y,l.outcome=p;for(var B=-1,U=l.queue.length;++B<U;)l.queue[B].callFulfilled(p)}return l},s.reject=function(l,p){l.state=g,l.outcome=p;for(var T=-1,I=l.queue.length;++T<I;)l.queue[T].callRejected(p);return l},S.resolve=b,S.reject=u,S.all=d,S.race=h},{1:1}],3:[function(e,t,n){(function(i){typeof i.Promise!="function"&&(i.Promise=e(2))}).call(this,_t!==void 0?_t:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function r(o,a){if(!(o instanceof a))throw new TypeError("Cannot call a class as a function")}function s(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var g=s();function y(){try{if(!g||!g.open)return!1;var o=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),a=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!o||a)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function w(o,a){o=o||[],a=a||{};try{return new Blob(o,a)}catch(f){if(f.name!=="TypeError")throw f;for(var c=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),m=0;m<o.length;m+=1)c.append(o[m]);return c.getBlob(a.type)}}typeof Promise>"u"&&e(3);var S=Promise;function k(o,a){a&&o.then(function(c){a(null,c)},function(c){a(c)})}function z(o,a,c){typeof a=="function"&&o.then(a),typeof c=="function"&&o.catch(c)}function L(o){return typeof o!="string"&&(console.warn(o+" used as a key, but it is not a string."),o=String(o)),o}function A(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var P="local-forage-detect-blob-support",b=void 0,u={},d=Object.prototype.toString,h="readonly",l="readwrite";function p(o){for(var a=o.length,c=new ArrayBuffer(a),m=new Uint8Array(c),f=0;f<a;f++)m[f]=o.charCodeAt(f);return c}function T(o){return new S(function(a){var c=o.transaction(P,l),m=w([""]);c.objectStore(P).put(m,"key"),c.onabort=function(f){f.preventDefault(),f.stopPropagation(),a(!1)},c.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);a(v||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function I(o){return typeof b=="boolean"?S.resolve(b):T(o).then(function(a){return b=a})}function B(o){var a=u[o.name],c={};c.promise=new S(function(m,f){c.resolve=m,c.reject=f}),a.deferredOperations.push(c),a.dbReady?a.dbReady=a.dbReady.then(function(){return c.promise}):a.dbReady=c.promise}function U(o){var a=u[o.name].deferredOperations.pop();if(a)return a.resolve(),a.promise}function O(o,a){var c=u[o.name].deferredOperations.pop();if(c)return c.reject(a),c.promise}function j(o,a){return new S(function(c,m){if(u[o.name]=u[o.name]||Ze(),o.db){if(!a)return c(o.db);B(o),o.db.close()}var f=[o.name];a&&f.push(o.version);var v=g.open.apply(g,f);a&&(v.onupgradeneeded=function(C){var x=v.result;try{x.createObjectStore(o.storeName),C.oldVersion<=1&&x.createObjectStore(P)}catch(E){if(E.name!=="ConstraintError")throw E;console.warn('The database "'+o.name+'" has been upgraded from version '+C.oldVersion+" to version "+C.newVersion+', but the storage "'+o.storeName+'" already exists.')}}),v.onerror=function(C){C.preventDefault(),m(v.error)},v.onsuccess=function(){var C=v.result;C.onversionchange=function(x){x.target.close()},c(C),U(o)}})}function F(o){return j(o,!1)}function G(o){return j(o,!0)}function X(o,a){if(!o.db)return!0;var c=!o.db.objectStoreNames.contains(o.storeName),m=o.version<o.db.version,f=o.version>o.db.version;if(m&&(o.version!==a&&console.warn('The database "'+o.name+`" can't be downgraded from version `+o.db.version+" to version "+o.version+"."),o.version=o.db.version),f||c){if(c){var v=o.db.version+1;v>o.version&&(o.version=v)}return!0}return!1}function it(o){return new S(function(a,c){var m=new FileReader;m.onerror=c,m.onloadend=function(f){var v=btoa(f.target.result||"");a({__local_forage_encoded_blob:!0,data:v,type:o.type})},m.readAsBinaryString(o)})}function Q(o){return w([p(atob(o.data))],{type:o.type})}function at(o){return o&&o.__local_forage_encoded_blob}function le(o){var a=this,c=a._initReady().then(function(){var m=u[a._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return z(c,o,o),c}function he(o){B(o);for(var a=u[o.name],c=a.forages,m=0;m<c.length;m++){var f=c[m];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return o.db=null,F(o).then(function(v){return o.db=v,X(o)?G(o):v}).then(function(v){o.db=a.db=v;for(var C=0;C<c.length;C++)c[C]._dbInfo.db=v}).catch(function(v){throw O(o,v),v})}function ct(o,a,c,m){m===void 0&&(m=1);try{var f=o.db.transaction(o.storeName,a);c(null,f)}catch(v){if(m>0&&(!o.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return S.resolve().then(function(){if(!o.db||v.name==="NotFoundError"&&!o.db.objectStoreNames.contains(o.storeName)&&o.version<=o.db.version)return o.db&&(o.version=o.db.version+1),G(o)}).then(function(){return he(o).then(function(){ct(o,a,c,m-1)})}).catch(c);c(v)}}function Ze(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ui(o){var a=this,c={db:null};if(o)for(var m in o)c[m]=o[m];var f=u[c.name];f||(f=Ze(),u[c.name]=f),f.forages.push(a),a._initReady||(a._initReady=a.ready,a.ready=le);var v=[];function C(){return S.resolve()}for(var x=0;x<f.forages.length;x++){var E=f.forages[x];E!==a&&v.push(E._initReady().catch(C))}var M=f.forages.slice(0);return S.all(v).then(function(){return c.db=f.db,F(c)}).then(function(_){return c.db=_,X(c,a._defaultConfig.version)?G(c):_}).then(function(_){c.db=f.db=_,a._dbInfo=c;for(var D=0;D<M.length;D++){var N=M[D];N!==a&&(N._dbInfo.db=c.db,N._dbInfo.version=c.version)}})}function li(o,a){var c=this;o=L(o);var m=new S(function(f,v){c.ready().then(function(){ct(c._dbInfo,h,function(C,x){if(C)return v(C);try{var E=x.objectStore(c._dbInfo.storeName).get(o);E.onsuccess=function(){var M=E.result;M===void 0&&(M=null),at(M)&&(M=Q(M)),f(M)},E.onerror=function(){v(E.error)}}catch(M){v(M)}})}).catch(v)});return k(m,a),m}function hi(o,a){var c=this,m=new S(function(f,v){c.ready().then(function(){ct(c._dbInfo,h,function(C,x){if(C)return v(C);try{var E=x.objectStore(c._dbInfo.storeName).openCursor(),M=1;E.onsuccess=function(){var _=E.result;if(_){var D=_.value;at(D)&&(D=Q(D));var N=o(D,_.key,M++);N!==void 0?f(N):_.continue()}else f()},E.onerror=function(){v(E.error)}}catch(_){v(_)}})}).catch(v)});return k(m,a),m}function di(o,a,c){var m=this;o=L(o);var f=new S(function(v,C){var x;m.ready().then(function(){return x=m._dbInfo,d.call(a)==="[object Blob]"?I(x.db).then(function(E){return E?a:it(a)}):a}).then(function(E){ct(m._dbInfo,l,function(M,_){if(M)return C(M);try{var D=_.objectStore(m._dbInfo.storeName);E===null&&(E=void 0);var N=D.put(E,o);_.oncomplete=function(){E===void 0&&(E=null),v(E)},_.onabort=_.onerror=function(){var W=N.error?N.error:N.transaction.error;C(W)}}catch(W){C(W)}})}).catch(C)});return k(f,c),f}function fi(o,a){var c=this;o=L(o);var m=new S(function(f,v){c.ready().then(function(){ct(c._dbInfo,l,function(C,x){if(C)return v(C);try{var E=x.objectStore(c._dbInfo.storeName).delete(o);x.oncomplete=function(){f()},x.onerror=function(){v(E.error)},x.onabort=function(){var M=E.error?E.error:E.transaction.error;v(M)}}catch(M){v(M)}})}).catch(v)});return k(m,a),m}function pi(o){var a=this,c=new S(function(m,f){a.ready().then(function(){ct(a._dbInfo,l,function(v,C){if(v)return f(v);try{var x=C.objectStore(a._dbInfo.storeName).clear();C.oncomplete=function(){m()},C.onabort=C.onerror=function(){var E=x.error?x.error:x.transaction.error;f(E)}}catch(E){f(E)}})}).catch(f)});return k(c,o),c}function mi(o){var a=this,c=new S(function(m,f){a.ready().then(function(){ct(a._dbInfo,h,function(v,C){if(v)return f(v);try{var x=C.objectStore(a._dbInfo.storeName).count();x.onsuccess=function(){m(x.result)},x.onerror=function(){f(x.error)}}catch(E){f(E)}})}).catch(f)});return k(c,o),c}function gi(o,a){var c=this,m=new S(function(f,v){o<0?f(null):c.ready().then(function(){ct(c._dbInfo,h,function(C,x){if(C)return v(C);try{var E=x.objectStore(c._dbInfo.storeName),M=!1,_=E.openKeyCursor();_.onsuccess=function(){var D=_.result;D?o===0||M?f(D.key):(M=!0,D.advance(o)):f(null)},_.onerror=function(){v(_.error)}}catch(D){v(D)}})}).catch(v)});return k(m,a),m}function vi(o){var a=this,c=new S(function(m,f){a.ready().then(function(){ct(a._dbInfo,h,function(v,C){if(v)return f(v);try{var x=C.objectStore(a._dbInfo.storeName).openKeyCursor(),E=[];x.onsuccess=function(){var M=x.result;M?(E.push(M.key),M.continue()):m(E)},x.onerror=function(){f(x.error)}}catch(M){f(M)}})}).catch(f)});return k(c,o),c}function yi(o,a){a=A.apply(this,arguments);var c=this.config();(o=typeof o!="function"&&o||{}).name||(o.name=o.name||c.name,o.storeName=o.storeName||c.storeName);var m,f=this;if(o.name){var v=o.name===c.name&&f._dbInfo.db?S.resolve(f._dbInfo.db):F(o).then(function(C){var x=u[o.name],E=x.forages;x.db=C;for(var M=0;M<E.length;M++)E[M]._dbInfo.db=C;return C});m=o.storeName?v.then(function(C){if(C.objectStoreNames.contains(o.storeName)){var x=C.version+1;B(o);var E=u[o.name],M=E.forages;C.close();for(var _=0;_<M.length;_++){var D=M[_];D._dbInfo.db=null,D._dbInfo.version=x}return new S(function(N,W){var $=g.open(o.name,x);$.onerror=function(rt){$.result.close(),W(rt)},$.onupgradeneeded=function(){$.result.deleteObjectStore(o.storeName)},$.onsuccess=function(){var rt=$.result;rt.close(),N(rt)}}).then(function(N){E.db=N;for(var W=0;W<M.length;W++){var $=M[W];$._dbInfo.db=N,U($._dbInfo)}}).catch(function(N){throw(O(o,N)||S.resolve()).catch(function(){}),N})}}):v.then(function(C){B(o);var x=u[o.name],E=x.forages;C.close();for(var M=0;M<E.length;M++)E[M]._dbInfo.db=null;return new S(function(_,D){var N=g.deleteDatabase(o.name);N.onerror=function(){var W=N.result;W&&W.close(),D(N.error)},N.onblocked=function(){console.warn('dropInstance blocked for database "'+o.name+'" until all open connections are closed')},N.onsuccess=function(){var W=N.result;W&&W.close(),_(W)}}).then(function(_){x.db=_;for(var D=0;D<E.length;D++)U(E[D]._dbInfo)}).catch(function(_){throw(O(o,_)||S.resolve()).catch(function(){}),_})})}else m=S.reject("Invalid arguments");return k(m,a),m}var wi={_driver:"asyncStorage",_initStorage:ui,_support:y(),iterate:hi,getItem:li,setItem:di,removeItem:fi,clear:pi,length:mi,key:gi,keys:vi,dropInstance:yi};function bi(){return typeof openDatabase=="function"}var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Si="~~local_forage_type~",Qe=/^~~local_forage_type~([^~]+)~/,Ot="__lfsc__:",de=Ot.length,fe="arbf",pe="blob",tn="si08",en="ui08",nn="uic8",on="si16",rn="si32",sn="ur16",an="ui32",cn="fl32",un="fl64",ln=de+fe.length,hn=Object.prototype.toString;function dn(o){var a,c,m,f,v,C=.75*o.length,x=o.length,E=0;o[o.length-1]==="="&&(C--,o[o.length-2]==="="&&C--);var M=new ArrayBuffer(C),_=new Uint8Array(M);for(a=0;a<x;a+=4)c=ht.indexOf(o[a]),m=ht.indexOf(o[a+1]),f=ht.indexOf(o[a+2]),v=ht.indexOf(o[a+3]),_[E++]=c<<2|m>>4,_[E++]=(15&m)<<4|f>>2,_[E++]=(3&f)<<6|63&v;return M}function me(o){var a,c=new Uint8Array(o),m="";for(a=0;a<c.length;a+=3)m+=ht[c[a]>>2],m+=ht[(3&c[a])<<4|c[a+1]>>4],m+=ht[(15&c[a+1])<<2|c[a+2]>>6],m+=ht[63&c[a+2]];return c.length%3==2?m=m.substring(0,m.length-1)+"=":c.length%3==1&&(m=m.substring(0,m.length-2)+"=="),m}function Ci(o,a){var c="";if(o&&(c=hn.call(o)),o&&(c==="[object ArrayBuffer]"||o.buffer&&hn.call(o.buffer)==="[object ArrayBuffer]")){var m,f=Ot;o instanceof ArrayBuffer?(m=o,f+=fe):(m=o.buffer,c==="[object Int8Array]"?f+=tn:c==="[object Uint8Array]"?f+=en:c==="[object Uint8ClampedArray]"?f+=nn:c==="[object Int16Array]"?f+=on:c==="[object Uint16Array]"?f+=sn:c==="[object Int32Array]"?f+=rn:c==="[object Uint32Array]"?f+=an:c==="[object Float32Array]"?f+=cn:c==="[object Float64Array]"?f+=un:a(new Error("Failed to get type for BinaryArray"))),a(f+me(m))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var C=Si+o.type+"~"+me(this.result);a(Ot+pe+C)},v.readAsArrayBuffer(o)}else try{a(JSON.stringify(o))}catch(C){console.error("Couldn't convert value into a JSON string: ",o),a(null,C)}}function xi(o){if(o.substring(0,de)!==Ot)return JSON.parse(o);var a,c=o.substring(ln),m=o.substring(de,ln);if(m===pe&&Qe.test(c)){var f=c.match(Qe);a=f[1],c=c.substring(f[0].length)}var v=dn(c);switch(m){case fe:return v;case pe:return w([v],{type:a});case tn:return new Int8Array(v);case en:return new Uint8Array(v);case nn:return new Uint8ClampedArray(v);case on:return new Int16Array(v);case sn:return new Uint16Array(v);case rn:return new Int32Array(v);case an:return new Uint32Array(v);case cn:return new Float32Array(v);case un:return new Float64Array(v);default:throw new Error("Unkown type: "+m)}}var ge={serialize:Ci,deserialize:xi,stringToBuffer:dn,bufferToString:me};function fn(o,a,c,m){o.executeSql("CREATE TABLE IF NOT EXISTS "+a.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,m)}function ki(o){var a=this,c={db:null};if(o)for(var m in o)c[m]=typeof o[m]!="string"?o[m].toString():o[m];var f=new S(function(v,C){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(x){return C(x)}c.db.transaction(function(x){fn(x,c,function(){a._dbInfo=c,v()},function(E,M){C(M)})},C)});return c.serializer=ge,f}function dt(o,a,c,m,f,v){o.executeSql(c,m,f,function(C,x){x.code===x.SYNTAX_ERR?C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[a.storeName],function(E,M){M.rows.length?v(E,x):fn(E,a,function(){E.executeSql(c,m,f,v)},v)},v):v(C,x)},v)}function Ei(o,a){var c=this;o=L(o);var m=new S(function(f,v){c.ready().then(function(){var C=c._dbInfo;C.db.transaction(function(x){dt(x,C,"SELECT * FROM "+C.storeName+" WHERE key = ? LIMIT 1",[o],function(E,M){var _=M.rows.length?M.rows.item(0).value:null;_&&(_=C.serializer.deserialize(_)),f(_)},function(E,M){v(M)})})}).catch(v)});return k(m,a),m}function zi(o,a){var c=this,m=new S(function(f,v){c.ready().then(function(){var C=c._dbInfo;C.db.transaction(function(x){dt(x,C,"SELECT * FROM "+C.storeName,[],function(E,M){for(var _=M.rows,D=_.length,N=0;N<D;N++){var W=_.item(N),$=W.value;if($&&($=C.serializer.deserialize($)),($=o($,W.key,N+1))!==void 0)return void f($)}f()},function(E,M){v(M)})})}).catch(v)});return k(m,a),m}function pn(o,a,c,m){var f=this;o=L(o);var v=new S(function(C,x){f.ready().then(function(){a===void 0&&(a=null);var E=a,M=f._dbInfo;M.serializer.serialize(a,function(_,D){D?x(D):M.db.transaction(function(N){dt(N,M,"INSERT OR REPLACE INTO "+M.storeName+" (key, value) VALUES (?, ?)",[o,_],function(){C(E)},function(W,$){x($)})},function(N){if(N.code===N.QUOTA_ERR){if(m>0)return void C(pn.apply(f,[o,E,c,m-1]));x(N)}})})}).catch(x)});return k(v,c),v}function Mi(o,a,c){return pn.apply(this,[o,a,c,1])}function _i(o,a){var c=this;o=L(o);var m=new S(function(f,v){c.ready().then(function(){var C=c._dbInfo;C.db.transaction(function(x){dt(x,C,"DELETE FROM "+C.storeName+" WHERE key = ?",[o],function(){f()},function(E,M){v(M)})})}).catch(v)});return k(m,a),m}function Ii(o){var a=this,c=new S(function(m,f){a.ready().then(function(){var v=a._dbInfo;v.db.transaction(function(C){dt(C,v,"DELETE FROM "+v.storeName,[],function(){m()},function(x,E){f(E)})})}).catch(f)});return k(c,o),c}function Ri(o){var a=this,c=new S(function(m,f){a.ready().then(function(){var v=a._dbInfo;v.db.transaction(function(C){dt(C,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(x,E){var M=E.rows.item(0).c;m(M)},function(x,E){f(E)})})}).catch(f)});return k(c,o),c}function Li(o,a){var c=this,m=new S(function(f,v){c.ready().then(function(){var C=c._dbInfo;C.db.transaction(function(x){dt(x,C,"SELECT key FROM "+C.storeName+" WHERE id = ? LIMIT 1",[o+1],function(E,M){var _=M.rows.length?M.rows.item(0).key:null;f(_)},function(E,M){v(M)})})}).catch(v)});return k(m,a),m}function Pi(o){var a=this,c=new S(function(m,f){a.ready().then(function(){var v=a._dbInfo;v.db.transaction(function(C){dt(C,v,"SELECT key FROM "+v.storeName,[],function(x,E){for(var M=[],_=0;_<E.rows.length;_++)M.push(E.rows.item(_).key);m(M)},function(x,E){f(E)})})}).catch(f)});return k(c,o),c}function Ti(o){return new S(function(a,c){o.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,v){for(var C=[],x=0;x<v.rows.length;x++)C.push(v.rows.item(x).name);a({db:o,storeNames:C})},function(f,v){c(v)})},function(m){c(m)})})}function Bi(o,a){a=A.apply(this,arguments);var c=this.config();(o=typeof o!="function"&&o||{}).name||(o.name=o.name||c.name,o.storeName=o.storeName||c.storeName);var m,f=this;return k(m=o.name?new S(function(v){var C;C=o.name===c.name?f._dbInfo.db:openDatabase(o.name,"","",0),o.storeName?v({db:C,storeNames:[o.storeName]}):v(Ti(C))}).then(function(v){return new S(function(C,x){v.db.transaction(function(E){function M(W){return new S(function($,rt){E.executeSql("DROP TABLE IF EXISTS "+W,[],function(){$()},function(yn,Pt){rt(Pt)})})}for(var _=[],D=0,N=v.storeNames.length;D<N;D++)_.push(M(v.storeNames[D]));S.all(_).then(function(){C()}).catch(function(W){x(W)})},function(E){x(E)})})}):S.reject("Invalid arguments"),a),m}var Di={_driver:"webSQLStorage",_initStorage:ki,_support:bi(),iterate:zi,getItem:Ei,setItem:Mi,removeItem:_i,clear:Ii,length:Ri,key:Li,keys:Pi,dropInstance:Bi};function Ai(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function mn(o,a){var c=o.name+"/";return o.storeName!==a.storeName&&(c+=o.storeName+"/"),c}function Ni(){var o="_localforage_support_test";try{return localStorage.setItem(o,!0),localStorage.removeItem(o),!1}catch{return!0}}function Ui(){return!Ni()||localStorage.length>0}function Oi(o){var a=this,c={};if(o)for(var m in o)c[m]=o[m];return c.keyPrefix=mn(o,a._defaultConfig),Ui()?(a._dbInfo=c,c.serializer=ge,S.resolve()):S.reject()}function ji(o){var a=this,c=a.ready().then(function(){for(var m=a._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var v=localStorage.key(f);v.indexOf(m)===0&&localStorage.removeItem(v)}});return k(c,o),c}function Wi(o,a){var c=this;o=L(o);var m=c.ready().then(function(){var f=c._dbInfo,v=localStorage.getItem(f.keyPrefix+o);return v&&(v=f.serializer.deserialize(v)),v});return k(m,a),m}function $i(o,a){var c=this,m=c.ready().then(function(){for(var f=c._dbInfo,v=f.keyPrefix,C=v.length,x=localStorage.length,E=1,M=0;M<x;M++){var _=localStorage.key(M);if(_.indexOf(v)===0){var D=localStorage.getItem(_);if(D&&(D=f.serializer.deserialize(D)),(D=o(D,_.substring(C),E++))!==void 0)return D}}});return k(m,a),m}function Fi(o,a){var c=this,m=c.ready().then(function(){var f,v=c._dbInfo;try{f=localStorage.key(o)}catch{f=null}return f&&(f=f.substring(v.keyPrefix.length)),f});return k(m,a),m}function Hi(o){var a=this,c=a.ready().then(function(){for(var m=a._dbInfo,f=localStorage.length,v=[],C=0;C<f;C++){var x=localStorage.key(C);x.indexOf(m.keyPrefix)===0&&v.push(x.substring(m.keyPrefix.length))}return v});return k(c,o),c}function qi(o){var a=this.keys().then(function(c){return c.length});return k(a,o),a}function Gi(o,a){var c=this;o=L(o);var m=c.ready().then(function(){var f=c._dbInfo;localStorage.removeItem(f.keyPrefix+o)});return k(m,a),m}function Xi(o,a,c){var m=this;o=L(o);var f=m.ready().then(function(){a===void 0&&(a=null);var v=a;return new S(function(C,x){var E=m._dbInfo;E.serializer.serialize(a,function(M,_){if(_)x(_);else try{localStorage.setItem(E.keyPrefix+o,M),C(v)}catch(D){D.name!=="QuotaExceededError"&&D.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(D),x(D)}})})});return k(f,c),f}function Vi(o,a){if(a=A.apply(this,arguments),!(o=typeof o!="function"&&o||{}).name){var c=this.config();o.name=o.name||c.name,o.storeName=o.storeName||c.storeName}var m,f=this;return k(m=o.name?new S(function(v){o.storeName?v(mn(o,f._defaultConfig)):v(o.name+"/")}).then(function(v){for(var C=localStorage.length-1;C>=0;C--){var x=localStorage.key(C);x.indexOf(v)===0&&localStorage.removeItem(x)}}):S.reject("Invalid arguments"),a),m}var Ki={_driver:"localStorageWrapper",_initStorage:Oi,_support:Ai(),iterate:$i,getItem:Wi,setItem:Xi,removeItem:Gi,clear:ji,length:qi,key:Fi,keys:Hi,dropInstance:Vi},Yi=function(o,a){return o===a||typeof o=="number"&&typeof a=="number"&&isNaN(o)&&isNaN(a)},Ji=function(o,a){for(var c=o.length,m=0;m<c;){if(Yi(o[m],a))return!0;m++}return!1},gn=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"},Lt={},vn={},Et={INDEXEDDB:wi,WEBSQL:Di,LOCALSTORAGE:Ki},Zi=[Et.INDEXEDDB._driver,Et.WEBSQL._driver,Et.LOCALSTORAGE._driver],jt=["dropInstance"],ve=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(jt),Qi={description:"",driver:Zi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function to(o,a){o[a]=function(){var c=arguments;return o.ready().then(function(){return o[a].apply(o,c)})}}function ye(){for(var o=1;o<arguments.length;o++){var a=arguments[o];if(a)for(var c in a)a.hasOwnProperty(c)&&(gn(a[c])?arguments[0][c]=a[c].slice():arguments[0][c]=a[c])}return arguments[0]}var eo=new(function(){function o(a){for(var c in r(this,o),Et)if(Et.hasOwnProperty(c)){var m=Et[c],f=m._driver;this[c]=f,Lt[f]||this.defineDriver(m)}this._defaultConfig=ye({},Qi),this._config=ye({},this._defaultConfig,a),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return o.prototype.config=function(a){if((a===void 0?"undefined":i(a))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var c in a){if(c==="storeName"&&(a[c]=a[c].replace(/\W/g,"_")),c==="version"&&typeof a[c]!="number")return new Error("Database version must be a number.");this._config[c]=a[c]}return!("driver"in a)||!a.driver||this.setDriver(this._config.driver)}return typeof a=="string"?this._config[a]:this._config},o.prototype.defineDriver=function(a,c,m){var f=new S(function(v,C){try{var x=a._driver,E=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!a._driver)return void C(E);for(var M=ve.concat("_initStorage"),_=0,D=M.length;_<D;_++){var N=M[_];if((!Ji(jt,N)||a[N])&&typeof a[N]!="function")return void C(E)}(function(){for(var $=function(no){return function(){var io=new Error("Method "+no+" is not implemented by the current driver"),wn=S.reject(io);return k(wn,arguments[arguments.length-1]),wn}},rt=0,yn=jt.length;rt<yn;rt++){var Pt=jt[rt];a[Pt]||(a[Pt]=$(Pt))}})();var W=function($){Lt[x]&&console.info("Redefining LocalForage driver: "+x),Lt[x]=a,vn[x]=$,v()};"_support"in a?a._support&&typeof a._support=="function"?a._support().then(W,C):W(!!a._support):W(!0)}catch($){C($)}});return z(f,c,m),f},o.prototype.driver=function(){return this._driver||null},o.prototype.getDriver=function(a,c,m){var f=Lt[a]?S.resolve(Lt[a]):S.reject(new Error("Driver not found."));return z(f,c,m),f},o.prototype.getSerializer=function(a){var c=S.resolve(ge);return z(c,a),c},o.prototype.ready=function(a){var c=this,m=c._driverSet.then(function(){return c._ready===null&&(c._ready=c._initDriver()),c._ready});return z(m,a,a),m},o.prototype.setDriver=function(a,c,m){var f=this;gn(a)||(a=[a]);var v=this._getSupportedDrivers(a);function C(){f._config.driver=f.driver()}function x(_){return f._extend(_),C(),f._ready=f._initStorage(f._config),f._ready}function E(_){return function(){var D=0;function N(){for(;D<_.length;){var W=_[D];return D++,f._dbInfo=null,f._ready=null,f.getDriver(W).then(x).catch(N)}C();var $=new Error("No available storage method found.");return f._driverSet=S.reject($),f._driverSet}return N()}}var M=this._driverSet!==null?this._driverSet.catch(function(){return S.resolve()}):S.resolve();return this._driverSet=M.then(function(){var _=v[0];return f._dbInfo=null,f._ready=null,f.getDriver(_).then(function(D){f._driver=D._driver,C(),f._wrapLibraryMethodsWithReady(),f._initDriver=E(v)})}).catch(function(){C();var _=new Error("No available storage method found.");return f._driverSet=S.reject(_),f._driverSet}),z(this._driverSet,c,m),this._driverSet},o.prototype.supports=function(a){return!!vn[a]},o.prototype._extend=function(a){ye(this,a)},o.prototype._getSupportedDrivers=function(a){for(var c=[],m=0,f=a.length;m<f;m++){var v=a[m];this.supports(v)&&c.push(v)}return c},o.prototype._wrapLibraryMethodsWithReady=function(){for(var a=0,c=ve.length;a<c;a++)to(this,ve[a])},o.prototype.createInstance=function(a){return new o(a)},o}());t.exports=eo},{3:3}]},{},[4])(4),$n={exports:{}};/*! streamsaver. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */(function(e){$n.exports=(()=>{const t=typeof window=="object"?window:this;t.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,i=!1;const r=t.WebStreamsPolyfill||{},s=t.isSecureContext;let g=/constructor/i.test(t.HTMLElement)||!!t.safari||!!t.WebKitPoint;const y=s||"MozAppearance"in document.documentElement.style?"iframe":"navigate",w={createWriteStream:function(k,z,L){let A={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},P=0,b=null,u=null,d=null;if(Number.isFinite(z)?([L,z]=[z,L],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),A.size=L,A.writableStrategy=z):z&&z.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),A.size=L,A.writableStrategy=z):A=z||{},!g){n||(n=s?S(w.mitm):function(T){const I="width=200,height=100",B=document.createDocumentFragment(),U={frame:t.open(T,"popup",I),loaded:!1,isIframe:!1,isPopup:!0,remove(){U.frame.close()},addEventListener(...j){B.addEventListener(...j)},dispatchEvent(...j){B.dispatchEvent(...j)},removeEventListener(...j){B.removeEventListener(...j)},postMessage(...j){U.frame.postMessage(...j)}},O=j=>{j.source===U.frame&&(U.loaded=!0,t.removeEventListener("message",O),U.dispatchEvent(new Event("load")))};return t.addEventListener("message",O),U}(w.mitm)),u=new MessageChannel,k=encodeURIComponent(k.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const l={transferringReadable:i,pathname:A.pathname||Math.random().toString().slice(-6)+"/"+k,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+k}};A.size&&(l.headers["Content-Length"]=A.size);const p=[l,"*",[u.port2]];if(i){const T=y==="iframe"?void 0:{transform(B,U){if(!(B instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");P+=B.length,U.enqueue(B),b&&(location.href=b,b=null)},flush(){b&&(location.href=b)}};d=new w.TransformStream(T,A.writableStrategy,A.readableStrategy);const I=d.readable;u.port1.postMessage({readableStream:I},[I])}u.port1.onmessage=T=>{T.data.download?y==="navigate"?(n.remove(),n=null,P?location.href=T.data.download:b=T.data.download):(n.isPopup&&(n.remove(),n=null,y==="iframe"&&S(w.mitm)),S(T.data.download)):T.data.abort&&(h=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...p):n.addEventListener("load",()=>{n.postMessage(...p)},{once:!0})}let h=[];return!g&&d&&d.writable||new w.WritableStream({write(l){if(!(l instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");g?h.push(l):(u.port1.postMessage(l),P+=l.length,b&&(location.href=b,b=null))},close(){if(g){const l=new Blob(h,{type:"application/octet-stream; charset=utf-8"}),p=document.createElement("a");p.href=URL.createObjectURL(l),p.download=k,p.click()}else u.port1.postMessage("end")},abort(){h=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},A.writableStrategy)},WritableStream:t.WritableStream||r.WritableStream,supported:!0,version:{full:"2.0.5",major:2,minor:0,dot:5},mitm:"https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0"};function S(k){if(!k)throw new Error("meh");const z=document.createElement("iframe");return z.hidden=!0,z.src=k,z.loaded=!1,z.name="iframe",z.isIframe=!0,z.postMessage=(...L)=>z.contentWindow.postMessage(...L),z.addEventListener("load",()=>{z.loaded=!0},{once:!0}),document.body.appendChild(z),z}try{new Response(new ReadableStream),s&&!("serviceWorker"in navigator)&&(g=!0)}catch{g=!0}return(k=>{try{k()}catch{}})(()=>{const{readable:k}=new TransformStream,z=new MessageChannel;z.port1.postMessage(k,[k]),z.port1.close(),z.port2.close(),i=!0,Object.defineProperty(w,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),w})()})();var sr=$n.exports;class ar{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(t,n,i=3,r=6,s=6e4){this.fileID=t,this.downloadURL=n,this.chunkByteSize=i*this.ChunkUnitM,this.eventTarget=Me(),this.initIndexDB(),r>=3&&(this.cacheSize=r),s>this.requestTimeout&&(this.requestTimeout=s)}on(t,n){this.eventTarget.on(t,n)}dispatch(t,n){this.eventTarget.emit(t,n)}dispatchError(t){this.eventTarget.emit("error",t)}dispatchInfo(t){this.eventTarget.emit("info",t)}async queryDownloadFileMeta(t,n="",i){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await st(n,t,i);let s=null;return r&&r.status===200&&(s=r.data),s}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=Kt.createInstance({name:this.fileID,driver:Kt.INDEXEDDB})}async init(t){if(this.finishNum=0,t){const n="fileinfo";this.fileMetaData={id:t.id,name:t.name,length:t.length,downloadID:t.downloadID,chunkSize:this.chunkByteSize},this.fileName=t.name,this.currentDB?.setItem(n,this.fileMetaData)}if(this.fileMetaData!=null){const n=this.fileMetaData.chunkSize;n!=null&&n>0&&(this.chunkByteSize=n)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),Kt.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(t){return new Promise(n=>setTimeout(n,t))}async download(t,n){let i=t;if(!i&&this.downloadURL&&(i=this.downloadURL),!i)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=R.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const s={key:this.fileMetaData?.downloadID};let g=0;const y=this.cacheSize;let w=0;for(let S=0;S<this.totalChunks;S++){if(this.keys&&this.keys?.indexOf(S.toString())>=0){g++,g>this.finishNum&&(this.finishNum=g,this.downloadProgress());continue}const k=S*this.chunkByteSize;let z=k+this.chunkByteSize-1;this.fileMetaData&&z>this.fileMetaData.length&&(z=this.fileMetaData.length-1);const L={range:`bytes=${k}-${z}`};for(;w>=y;)await this.sleep(200);const A=S.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${S+1}/${this.totalChunks}`),w++,st(i,n,s,L,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async P=>{const b=P.data;w--,await this.currentDB?.setItem(A,b),g++,g>this.finishNum&&(this.finishNum=g,this.downloadProgress());const u=parseInt(A)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(P=>{w--;const b=parseInt(A)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${b}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const t=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",t)}outputProgress(t){const n=100*t/this.totalChunks;this.dispatch("saveProgress",n)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const t=sr.createWriteStream(this.fileName).getWriter();let n=0;for(let i=0;i<this.totalChunks;i++){const r=i.toString();let s=await this.currentDB?.getItem(r);if(s||(s=await this.currentDB?.getItem(r)),!s)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let g=new Response(s).body;if(g===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const y=g.getReader();for(;;){const{done:w,value:S}=await y.read();if(w)break;await t.write(S)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${i+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),Kt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}const cr=Object.prototype.toString;function Y(e,t){return cr.call(e)===`[object ${t}]`}function Ae(e){return Y(e,"Function")}const Fn=e=>e!==void 0,Ne=e=>!Fn(e);function Ue(e){return e===null}function ur(e){return Ne(e)&&Ue(e)}function lr(e){return Ne(e)||Ue(e)}const xt=e=>e!==null&&Y(e,"Object");function hr(e){return Y(e,"Date")}function dr(e){return Y(e,"Number")}function fr(e){return Y(e,"AsyncFunction")}function pr(e){return Y(e,"Promise")&&xt(e)&&Ae(e.then)&&Ae(e.catch)}function Yt(e){return Y(e,"String")}function mr(e){return e===!0||e===!1||Y(e,"Boolean")}function Hn(e){return e&&Array.isArray(e)}const gr=()=>typeof window<"u",vr=e=>typeof window<"u"&&Y(e,"Window"),yr=e=>xt(e)&&!!e.tagName,wr=typeof window>"u";function br(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function Sr(e){return e==null||(Yt(e)||Hn(e)?e.length===0:!!xt(e)&&JSON.stringify(e)==="{}")}function Cr(e){return Y(e,"Error")}function xr(e){return Y(e,"WeakSet")}function kr(e){return Y(e,"WeakMap")}function Er(e){return Y(e,"Symbol")}function zr(e){return Y(e,"Map")}const Mr=e=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(e);function _r(e,t){let n="",i="";for(const r in t)n+=r+"="+encodeURIComponent(t[r])+"&";return n=n.replace(/&$/,""),i=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,i}function qn(e={},t={}){let n;for(n in t)e[n]=xt(e[n])?qn(e[n],t[n]):e[n]=t[n];return e}function Gn(e){const t=function(w){if(!w)return;const S=w,k=[];if(S)for(let z of S){const L=Xn(z);L&&k.push(L)}return k}(e.bussinessRoutes),n=function(w){if(!w)return;const S=w;if(S&&S.length>0){const k=[];return S.forEach(z=>{const L=Vn(z);L&&k.push(L)}),k}}(e.widgetMenuConfig),i=function(w){if(!!w&&w.length>0){const S=[];return w.forEach(k=>{const z=function(L){if(!!L)return{id:L.id,label:L.label,container:L.container,preload:L.preload,afterid:L.afterid,bindid:L.bindid,group:L.group}}(k);z&&S.push(z)}),S}}(e.widgetConfig),r=(s=e.functionList)&&s.length>0?s:void 0;var s;const g=e.pkgObject.version,y=e.pkgObject.name;return{id:function(w,S){const k=`${w}_${S}`;return ot.MD5(k)}(y,g),name:R.Config.UI.SiteTitle,group:R.Config.UI.Group,product:y,version:g,routes:t,widgetMenu:n,widgets:i,functions:r}}function Xn(e){if(e){let t=0;e.meta?.hidden&&(t=1);let n={path:e.path,name:e.name,title:e.meta?.title,type:t,index:e.meta?.index};if(e.children){const i=[];for(let r of e.children){const s=Xn(r);s&&i.push(s)}i.length>0&&(n.children=i)}return n}}function Vn(e){if(!e)return;const t={name:e.name,index:e.index,path:e.path,type:e.type};return e.children&&e.children.length>0&&(t.children=[],e.children.forEach(n=>{const i=Vn(n);i&&t.children?.push(i)})),t}function Ir(e,t="IconifyList.ts"){let n="",i=`const iconlist={
4
+ `,r=0;e.forEach(s=>{const g=s.split(":");if(g&&g.length===2){const y="icon"+r;n+=`import ${y} from '~icons/${g[0]}/${g[1]}'
5
+ `,i+=` '${s}':${y},
5
6
  `,r++}}),r>0&&(i+=`};
6
- `,Xt(n+i+"export default iconlist;","IconifyList.ts"))}function Lr(e,t){const n=Xn(e);Pn(n,t),L.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}const J=bn({panelGroups:{}}),Yn=()=>({useGroupAccordion:e=>pt(()=>J.panelGroups[e].accordion),setGroupAccordionStatus:(e,t)=>{J.panelGroups[e]={...J.panelGroups[e],accordion:t}},panelExpanded:(e,t)=>pt(()=>J.panelGroups[e]?.panelExpandStatus?.[t]||!1),setPanelExpandedStatus:(e,t,n)=>{J.panelGroups[e]={...J.panelGroups[e],panelExpandStatus:{...J.panelGroups[e]?.panelExpandStatus||{},[t]:n}}},togglePanelExpandedStatus:(e,t)=>{J.panelGroups[e].accordion&&(J.panelGroups[e].panelExpandStatus[t]||Object.keys(J.panelGroups[e].panelExpandStatus).forEach(n=>{J.panelGroups[e].panelExpandStatus[n]=!1})),J.panelGroups[e].panelExpandStatus[t]=!J.panelGroups[e].panelExpandStatus[t]}}),Oe=e=>e>255?255:e<0?0:e,Jt=(e,t)=>{const n=e.replace("#",""),i=parseInt(n,16),r=Oe((i>>16)+t),c=Oe((i>>8&255)+t);return"#"+(Oe((255&i)+t)|c<<8|r<<16).toString(16)};var Zt=Tt({name:"VueCollapsiblePanelGroup",props:{accordion:{type:Boolean,default:!1},baseColor:{type:String,default:"#333333"}},setup(e){const t=nt(`group-${qt()}`),{setGroupAccordionStatus:n}=Yn(),i={"--base-color":e.baseColor,"--border-color":Jt(e.baseColor,180),"--bg-color-header":Jt(e.baseColor,140),"--bg-color-header-hover":Jt(e.baseColor,190),"--bg-color-header-active":Jt(e.baseColor,200),"--bg-color-body":"#fff"};return n(t.value,e.accordion),{idGroup:t,cssColorVars:i}}});const Pr=["data-id-group"];Zt.render=function(e,t,n,i,r,c){return H(),tt("div",{"data-id-group":e.idGroup,style:yt(e.cssColorVars),class:"vcpg"},[ft(e.$slots,"default")],12,Pr)},Zt.__scopeId="data-v-23ab5317",Zt.__file="src/controls/collapsepanel/VCollapsiblePanelGroup.vue";var Qt=Tt({name:"VueCollapsiblePanel",props:{expanded:{type:Boolean,default:!0}},setup(e,t){const n=`panel-${qt()}`,i=nt(),r=nt(),c=nt(),{panelExpanded:v,togglePanelExpandedStatus:y,setPanelExpandedStatus:w}=Yn(),S=pt(()=>({hasContent:t.slots.content&&t.slots.content()[0].children.length>0,dataKey:qt()})),E=pt(()=>i.value?.parentElement?.getAttribute("data-id-group")||""),z=pt(()=>v(E.value,n).value&&S.value.hasContent);return Sn(()=>{w(E.value,n,e.expanded)}),so(()=>{(async()=>(await Cn(),r.value&&c.value&&(r.value.style.height=`${Math.min(c.value.scrollHeight,r.value.scrollHeight)}px`)))()}),{body:S,panelRef:i,bodyRef:r,bodyContentRef:c,isExpanded:z,collapse:I=>{I.style.height="0"},expand:I=>{I.style.height=`${I.scrollHeight}px`},toggle:()=>{S.value.hasContent&&y(E.value,n)},toggleIcon:`
7
+ `,Xt(n+i+"export default iconlist;","IconifyList.ts"))}function Rr(e,t){const n=Gn(e);Pn(n,t),R.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}const J=bn({panelGroups:{}}),Kn=()=>({useGroupAccordion:e=>pt(()=>J.panelGroups[e].accordion),setGroupAccordionStatus:(e,t)=>{J.panelGroups[e]={...J.panelGroups[e],accordion:t}},panelExpanded:(e,t)=>pt(()=>J.panelGroups[e]?.panelExpandStatus?.[t]||!1),setPanelExpandedStatus:(e,t,n)=>{J.panelGroups[e]={...J.panelGroups[e],panelExpandStatus:{...J.panelGroups[e]?.panelExpandStatus||{},[t]:n}}},togglePanelExpandedStatus:(e,t)=>{J.panelGroups[e].accordion&&(J.panelGroups[e].panelExpandStatus[t]||Object.keys(J.panelGroups[e].panelExpandStatus).forEach(n=>{J.panelGroups[e].panelExpandStatus[n]=!1})),J.panelGroups[e].panelExpandStatus[t]=!J.panelGroups[e].panelExpandStatus[t]}}),Oe=e=>e>255?255:e<0?0:e,Jt=(e,t)=>{const n=e.replace("#",""),i=parseInt(n,16),r=Oe((i>>16)+t),s=Oe((i>>8&255)+t);return"#"+(Oe((255&i)+t)|s<<8|r<<16).toString(16)};var Zt=Tt({name:"VueCollapsiblePanelGroup",props:{accordion:{type:Boolean,default:!1},baseColor:{type:String,default:"#333333"}},setup(e){const t=nt(`group-${qt()}`),{setGroupAccordionStatus:n}=Kn(),i={"--base-color":e.baseColor,"--border-color":Jt(e.baseColor,180),"--bg-color-header":Jt(e.baseColor,140),"--bg-color-header-hover":Jt(e.baseColor,190),"--bg-color-header-active":Jt(e.baseColor,200),"--bg-color-body":"#fff"};return n(t.value,e.accordion),{idGroup:t,cssColorVars:i}}});const Lr=["data-id-group"];Zt.render=function(e,t,n,i,r,s){return H(),tt("div",{"data-id-group":e.idGroup,style:yt(e.cssColorVars),class:"vcpg"},[ft(e.$slots,"default")],12,Lr)},Zt.__scopeId="data-v-23ab5317",Zt.__file="src/controls/collapsepanel/VCollapsiblePanelGroup.vue";var Qt=Tt({name:"VueCollapsiblePanel",props:{expanded:{type:Boolean,default:!0}},setup(e,t){const n=`panel-${qt()}`,i=nt(),r=nt(),s=nt(),{panelExpanded:g,togglePanelExpandedStatus:y,setPanelExpandedStatus:w}=Kn(),S=pt(()=>({hasContent:t.slots.content&&t.slots.content()[0].children.length>0,dataKey:qt()})),k=pt(()=>i.value?.parentElement?.getAttribute("data-id-group")||""),z=pt(()=>g(k.value,n).value&&S.value.hasContent);return Sn(()=>{w(k.value,n,e.expanded)}),ro(()=>{(async()=>(await Cn(),r.value&&s.value&&(r.value.style.height=`${Math.min(s.value.scrollHeight,r.value.scrollHeight)}px`)))()}),{body:S,panelRef:i,bodyRef:r,bodyContentRef:s,isExpanded:z,collapse:L=>{L.style.height="0"},expand:L=>{L.style.height=`${L.scrollHeight}px`},toggle:()=>{S.value.hasContent&&y(k.value,n)},toggleIcon:`
7
8
  <svg
8
9
  width="24px"
9
10
  height="24px"
@@ -13,4 +14,4 @@ import{h as ro,openBlock as H,createElementBlock as tt,normalizeStyle as yt,rend
13
14
  >
14
15
  <path d="M6.34292 7.75734L4.92871 9.17155L11.9998 16.2426L19.0708 9.17158L17.6566 7.75737L11.9998 13.4142L6.34292 7.75734Z"/>
15
16
  </svg>
16
- `}}});const Tr={class:"vcp__header-title"},Br={key:0,class:"vcp__header-icon"},Ar=["innerHTML"],Dr={key:0,ref:"bodyRef",class:"vcp__body"},Nr={ref:"bodyContentRef",class:"vcp__body-content"};function je(e){return window.TouchEvent&&e instanceof TouchEvent}Qt.render=function(e,t,n,i,r,c){return H(),tt("section",{ref:"panelRef",class:ao(["vcp",{"vcp--expanded":e.isExpanded,"vcp--expandable":e.body.hasContent}])},[V("header",{class:"vcp__header",onClick:t[0]||(t[0]=(...v)=>e.toggle&&e.toggle(...v))},[V("div",Tr,[ft(e.$slots,"title")]),e.body.hasContent?(H(),tt("div",Br,[ft(e.$slots,"icon",{},()=>[V("span",{innerHTML:e.toggleIcon},null,8,Ar)])])):zt("v-if",!0)]),xn(kn,{"data-key":e.body.dataKey,name:"slide",onBeforeEnter:e.collapse,onEnter:e.expand,onBeforeLeave:e.expand,onLeave:e.collapse},{default:Wt(()=>[e.isExpanded?(H(),tt("div",Dr,[V("div",Nr,[ft(e.$slots,"content")],512)],512)):zt("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},Qt.__scopeId="data-v-08c94cf8",Qt.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class Z{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return je(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return je(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Je(this.clientX,this.clientY)}static bindDown(t,n,i,r=!1){const c=y=>{n(new Z(y))},v=y=>{y.touches.length===1&&n(new Z(y)),y.touches.length>1&&i&&i(new Z(y))};return t.addEventListener("mousedown",c,r),t.addEventListener("touchstart",v,r),()=>{t.removeEventListener("mousedown",c,r),t.removeEventListener("touchstart",v,r)}}static bindMove(t,n,i=!1){const r=v=>{n(new Z(v))},c=v=>{v.touches.length===1&&n(new Z(v))};return t.addEventListener("mousemove",r,i),t.addEventListener("touchmove",c,i),()=>{t.removeEventListener("mousemove",r,i),t.removeEventListener("touchmove",c,i)}}static bindUp(t,n,i=!1){const r=v=>{n(new Z(v))},c=v=>{v.touches.length===0&&n(new Z(v))};return t.addEventListener("mouseup",r,i),t.addEventListener("touchend",c,i),()=>{t.removeEventListener("mouseup",r,i),t.removeEventListener("touchend",c,i)}}originalEvent({mouse:t,touch:n}){je(this.e)?n&&n(this.e):t&&t(this.e)}}class Je{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Je(this.x,this.y)}}class Ur{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,i={}){this.handle=t,this.container=n,this.options=i,t&&(this.unbindDown=Z.bindDown(t,this.mousedown),t.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=t=>{if(t.preventDefault(),this.handle){const{left:n,top:i}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-i}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=Z.bindMove(document,this.mousemove),this.unbindUp=Z.bindUp(document,this.mouseup)};mousemove=t=>{this.container&&(this.container.style.left=t.clientX-this.offsetX+"px",this.container.style.top=t.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=t=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Or{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(i=>i.push(this))}set group(t){this._group=t;const n=ee(this._group),i=ee(t);n.splice(n.indexOf(this),1),i.push(this),Zn()}get group(){return this._group}unregister(){this.a(t=>t.splice(t.indexOf(this),1))}raise(){this.a(t=>{t.splice(t.indexOf(this),1),t.push(this)})}a(t){t(ee(this._group)),Zn()}}const te=new Map;function ee(e){return te.has(e)||te.set(e,[]),te.get(e)}function Jn(e,t){return e>t?-Jn(t,e):e<0&&t>=0?1:e-t}function Zn(){let e=0;for(const t of function(n){const i=[];return n.forEach((r,c)=>i.push(c)),i}(te).sort(Jn))for(const n of ee(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function We(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const i=ne(e);return e.style.width=t,e.style.height=n,i}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function ne(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height,r=t.top,c=t.left;return{width:n,height:i,top:r,left:c,bottom:r+i,right:c+n}}class jr{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=Qn.map(w=>new w(t,this));const{width:i,height:r}=We(t),c=n.maxWidth||window.innerWidth,v=n.maxHeight||window.innerHeight;let y=!1;(i<n.minWidth||i>c)&&(t.style.width=`${ti(i,n.minWidth,c)}px`,y=!0),(r<n.minHeight||r>v)&&(t.style.height=`${ti(r,n.minHeight,v)}px`,y=!0),y&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const Qn=[];class gt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=Z.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=t=>{t.preventDefault(),t.stopPropagation();const{left:n,top:i,width:r,height:c}=ne(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=i,this.width0=r,this.height0=c,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=Z.bindMove(document,this.mousemove),this.unbindUp=Z.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:i,bottom:r}=ne(this.container),c=this.helper.options,v=c.maxWidth||window.innerWidth,y=c.maxHeight||window.innerHeight;this.minLeft=Math.max(i-v,0),this.maxLeft=i-c.minWidth,this.minRight=t+c.minWidth,this.maxRight=Math.min(t+v,window.innerWidth),this.minTop=Math.max(r-y,0),this.maxTop=r-c.minHeight,this.minBottom=n+c.minHeight,this.maxBottom=Math.min(n+y,window.innerHeight)}mousemove=t=>{t.preventDefault(),t.stopPropagation(),this.setPosition(t),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:t,height:n,left:i,top:r,right:c,bottom:v}=ne(this.container),y=this.helper.options;y&&(i<this.minLeft?(this.container.style.width=t+i-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):i>this.maxLeft?(this.container.style.width=`${y.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):c<this.minRight?this.container.style.width=`${y.minWidth}px`:c>this.maxRight&&(this.container.style.width=this.maxRight-i+"px"),r<this.minTop?(this.container.style.height=n+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>this.maxTop?(this.container.style.height=`${y.minHeight}px`,this.container.style.top=`${this.maxTop}px`):v<this.minBottom?this.container.style.height=`${y.minHeight}px`:v>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=t=>{t.preventDefault(),t.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const t=document.createElement("div"),n=t.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(t),t}}function ti(e,t,n){return e<t?t:e>n?n:e}Qn.push(class extends gt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.right=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="nwse-resize"}},class extends gt{setPosition(e){this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.right=`${this.handleSize}px`,e.left=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="ns-resize"}},class extends gt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends gt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.top=`${this.handleSize}px`,e.cursor="ew-resize"}},class extends gt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.top=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nwse-resize"}},class extends gt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=`${this.handleSize}px`,e.right=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.top=-this.handleSize+"px",e.cursor="ns-resize"}},class extends gt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px",this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=-this.handleSize+"px",e.height=2*this.handleSize+"px",e.width=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends gt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=`${this.handleSize}px`,e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.cursor="ew-resize"}});var ie=Tt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=nt(!1),n=nt(!1);return{hover:t,active:n,style:function(){let i=e.windowStyle.button;return t.value&&(i={...i,...this.windowStyle.buttonHover}),n.value&&(i={...i,...this.windowStyle.buttonActive}),i},mouseup:function(i){this.active&&this.$emit("click")},mousedown:function(i){i.preventDefault(),n.value=!0;const r=Z.bindUp(document,()=>{n.value=!1,r()})}}}});const Wr=["disabled"];ie.render=function(e,t,n,i,r,c){return H(),tt("div",{class:"btn",style:yt(e.style()),onMouseenter:t[0]||(t[0]=v=>e.hover=!0),onMouseleave:t[1]||(t[1]=v=>e.hover=!1),onMousedown:t[2]||(t[2]=En((...v)=>e.mousedown&&e.mousedown(...v),["stop"])),onTouchstart:t[3]||(t[3]=En((...v)=>e.mousedown&&e.mousedown(...v),["stop"])),onMouseup:t[4]||(t[4]=(...v)=>e.mouseup&&e.mouseup(...v)),onTouchend:t[5]||(t[5]=(...v)=>e.mouseup&&e.mouseup(...v)),disabled:e.disabled},[ft(e.$slots,"default")],44,Wr)},ie.__scopeId="data-v-71662210",ie.__file="src/controls/vuewindow/window/Button.vue";const Fe=new Set;function ei(e){return e!==null?parseFloat(e):0}function oe(e){const t=window.getComputedStyle(e);return{width:Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(ei).reduce((n,i)=>n+i)),height:Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(ei).reduce((n,i)=>n+i))}}class ni{width;height;constructor(t,n){this.width=t,this.height=n}}function Fr(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),i=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(i))return{left:n,top:i}}return null}function $r(e,t,n,i){const r=e-n,c=t-i;return r*r+c*c}window.addEventListener("resize",e=>{Fe.forEach(t=>{t?.fixPosition()})});const re=[];var se=Tt({name:"Window",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:ie},setup(e,{emit:t}){const n=co();if(!n)return;const{proxy:i}=n;let r=0,c,v,y;const w=nt(e.isOpen),S=()=>{re.push(i),y=new Or(e.zGroup,E),e.isOpen&&(Cn(()=>{r++==0&&(h(i),function(){const R=z.value,{width:B,height:U}=We(R);let O,j;if(e.left!==void 0!=(e.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof e.left=="number")O=e.left,j=e.top;else{const $=e.positionHint||"auto";switch($){case"auto":{let G=20,X=50,it=0;do{if(re.every(Q=>{if(!Q.isOpen||i==Q)return!0;const st=Fr(Q);if(st==null)return!0;const{left:le,top:he}=st;return $r(le,he,G,X)>16}))break;G=(G+40)%(window.innerWidth-200),X=(X+40)%(window.innerHeight-200)}while(++it<100);O=G,j=X}break;case"center":O=(window.innerWidth-B)/2,j=(window.innerHeight-U)/2,console.log(O,j,window.innerWidth,window.innerHeight,"111111");break;default:try{const G=$.split("/").map(Number);if(G.length!=2)throw null;const[X,it]=G;if(!isFinite(X)||!isFinite(it))throw null;O=X>=0?X:window.innerWidth-B+X,j=it>=0?it:window.innerHeight-U+it}catch{throw new Error(`invalid position string: ${$}`)}}}R&&(R.style.left=`${O}px`,R.style.top=`${j}px`)}()),e.resizable&&l(),T(),c=new Ur(I.value,z.value,{onMove:()=>T(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:R}=We(I.value);v=new jr(z.value,{onResize:()=>l(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+R,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+R:void 0})}()}),e.activateWhenOpen&&P()),Fe.add(i)};function E(R){b.value.zIndex=`${R}`}const z=nt(null),I=nt(null),D=nt(null);function P(){y.raise(),t("activate")}const b=nt({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=pt(()=>e.windowStyle.titlebar),d=pt(()=>{const R={...e.windowStyle.content};return e.resizable?R.padding="0":e.padding!=null&&(R.padding=`${e.padding}px`),e.isScrollable&&(R.overflow="auto"),R});function h(R){const{width:B,height:U,top:O,left:j}=R,$=z;if($&&B!=null&&($.value.style.width=`${B}px`),U!=null){const G=I.value;if(G){const X=oe(G).height;$.value.style.height=`${U+X}px`}}$&&j!=null&&($.value.style.left=`${j}px`),$&&O!=null&&($.value.style.top=`${O}px`)}function l(R=!0){const B=z.value,U=I.value,O=D.value;if(O&&B&&U){const{width:j,height:$}=oe(O),{width:G,height:X}=oe(B),it=oe(U).height,Q=G-(O.offsetWidth-j),st=X-it-(O.offsetHeight-$);O.style.width=`${Q}px`,O.style.height=`${st}px`,p(),t("resize",new ni(Q,st)),R&&(t("update:width",Q),t("update:height",st))}}function p(){const R=z.value;if(R){const B=R.getBoundingClientRect();B.left<0&&(b.value.left="0px"),B.top<0&&(b.value.top="0px"),B.right>window.innerWidth&&(b.value.left=window.innerWidth-B.width+"px"),B.bottom>window.innerHeight&&(b.value.top=window.innerHeight-B.height+"px")}}function T(R=!0){p();const B=z.value;if(B){const{left:U,top:O}=B.getBoundingClientRect();R&&(t("update:left",U),t("update:top",O))}}return Ft(()=>e.isOpen,R=>{w.value=R}),Ft(()=>e.zGroup,R=>{y.group=R}),Ft(()=>e.width,R=>{h({width:R}),l(!1)}),Ft(()=>e.height,R=>{h({height:R}),l(!1)}),Sn(()=>{S()}),uo(()=>{Fe.delete(this),y.unregister(),v&&v.teardown(),c&&c.teardown(),re.splice(re.indexOf(i),1)}),{isOpen:w,windowEl:z,titlebar:I,content:D,activate:P,styleWindow:b,styleTitlebar:u,styleContent:d,closeButtonClick:function(){w.value=!1,t("closebuttonclick")}}}});const Hr={class:"title"},qr=Mn("\xD7");var ii,vt;se.render=function(e,t,n,i,r,c){const v=zn("myButton");return H(),ct(kn,{name:"fade",onAfterLeave:t[2]||(t[2]=y=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=y=>e.$emit("open"))},{default:Wt(()=>[lo(V("div",{class:"window",style:yt(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...y)=>e.activate&&e.activate(...y)),onTouchstart:t[1]||(t[1]=(...y)=>e.activate&&e.activate(...y))},[V("div",{class:"titlebar",style:yt(e.styleTitlebar),ref:"titlebar"},[V("div",Hr,[e.$slots.title?ft(e.$slots,"title",{key:0}):(H(),tt(wt,{key:1},[Mn(ho(e.title),1)],2112))]),e.closeButton?(H(),ct(v,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:Wt(()=>[qr]),_:1},8,["windowStyle","onClick"])):zt("v-if",!0)],4),V("div",{class:"content",style:yt(e.styleContent),ref:"content"},[ft(e.$slots,"default")],4)],36),[[fo,e.isOpen]])]),_:3})},se.__file="src/controls/vuewindow/window/index.vue",(vt=ii||(ii={}))[vt.StyleBlack=0]="StyleBlack",vt[vt.StyleWhite=1]="StyleWhite",vt[vt.StyleMetal=2]="StyleMetal",vt[vt.StyleGrayblue=3]="StyleGrayblue";const Gr={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},Xr={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},Vr={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},Kr={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},Yr=se;var q,et;(et=q||(q={}))[et.top=0]="top",et[et.bottom=1]="bottom",et[et.centerBack=2]="centerBack",et[et.centerMain=3]="centerMain",et[et.centerFront=4]="centerFront",et[et.left=5]="left",et[et.right=6]="right";class Jr{layoutState;widgetCofig;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;constructor(t,n){this.layoutState=t,this.widgetCofig=n,this.widgetCofig.forEach(i=>{if(i.afterid)if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const r=new Set;r.add(i),this.preConditionMap.set(i.afterid,r)}})}getWidgetConfig(){return this.widgetCofig}preloadWidgets(){this.widgetCofig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t,this.loadOtherDependenceWidgets.bind(this))})}loadWidget(t){if(!t)return;let n;xt(t)?n=t:Yt(t)&&(n=this.widgetCofig.find(i=>i.id===t)),n&&this._loadWidget(n,this.loadOtherDependenceWidgets.bind(this))}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t,n){if(!this.widgetsLoadedSet.has(t.id))return t.component().then(i=>{if(i.default){const r=_n(i.default);this.getContainerComponents(t.container).value.set(t.id,r),this.widgetsLoadedSet.add(t.id),L.EventBus.emit(K.WidgetLoadedEvent,t.id),n&&n(t.id)}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetCofig.find(i=>i.id===t);if(n){if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i)for(const r of i)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(t),this.widgetsLoadedSet.delete(t),L.EventBus.emit(K.WidgetUnLoadedEvent,t)}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(t){switch(t){case q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const i=this.getLayoutContainer(t);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const i=this.getWidgetComponent(t);i&&L.EventBus.emit(K.WidgetVisibleChanged,{id:t,name:i.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetCofig.find(i=>i.id===t);if(n)return this.getContainerComponents(n.container).value.get(t)}}getWigetItem(t){return this.widgetCofig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetCofig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=nt(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}var $e=Tt({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutStyle:{type:Object}},components:{},setup(e,{attrs:t,slots:n,emit:i}){const r=bn({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0});if(!L.LayoutManager){const D=new Jr(r,e.widgetConfig);L.LayoutManager=D,D.preloadWidgets()}const c=z(q.top),v=z(q.centerBack),y=z(q.centerFront),w=z(q.left),S=z(q.right),E=z(q.bottom);function z(D){return L.LayoutManager?.getContainerComponents(D)}const I=pt(()=>e.layoutStyle);return{...po(r),topContainerComponents:c,centerbackComponents:v,centerfrontComponents:y,leftContainerComponents:w,rightContainerComponents:S,bottomContainerComponents:E,containerStyle:I}}});const Zr={ref:"topContainer",class:"topContainer"},Qr={ref:"centerBackContainer",class:"centerdiv backContainer"},ts={ref:"centerMainContainer",class:"centerdiv mainContainer"},es={ref:"centerFrontContainer",class:"centerdiv centerContainer"},ns={ref:"leftContainer",class:"leftContainer"},is={ref:"rightContainer",class:"rightContainer"},os={ref:"bottomContainer",class:"bottomContainer"};$e.render=function(e,t,n,i,r,c){const v=zn("router-view");return H(),tt("div",{class:"layoutContainer",style:yt(e.containerStyle)},[V("div",Zr,[(H(!0),tt(wt,null,Mt(e.topContainerComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512),V("div",null,[zt(" \u5E95\u5C42-\u4E3B\u5BB9\u5668 "),V("div",Qr,[(H(!0),tt(wt,null,Mt(e.centerbackComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512),zt(" \u4E3B\u8981\u5BB9\u5668 "),V("div",ts,[xn(v,null,{default:Wt(({Component:y})=>[(H(),ct(bt(y)))]),_:1})],512),zt(" \u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),V("div",es,[(H(!0),tt(wt,null,Mt(e.centerfrontComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512),V("div",ns,[(H(!0),tt(wt,null,Mt(e.leftContainerComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512),V("div",is,[(H(!0),tt(wt,null,Mt(e.rightContainerComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512)]),V("div",os,[(H(!0),tt(wt,null,Mt(e.bottomContainerComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512)],4)},$e.__file="src/controls/layoutcontainer/layout.vue";class rs{layoutState;widgetCofig;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;constructor(t,n){this.layoutState=t,this.widgetCofig=n,this.widgetCofig.forEach(i=>{if(i.afterid)if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const r=new Set;r.add(i),this.preConditionMap.set(i.afterid,r)}})}getWidgetConfig(){return this.widgetCofig}preloadWidgets(){this.widgetCofig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t,this.loadOtherDependenceWidgets.bind(this))})}loadWidget(t){if(!t)return;let n;xt(t)?n=t:Yt(t)&&(n=this.widgetCofig.find(i=>i.id===t)),n&&this._loadWidget(n,this.loadOtherDependenceWidgets.bind(this))}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t,n){if(!this.widgetsLoadedSet.has(t.id))return t.component().then(i=>{if(i.default){const r=_n(i.default);this.getContainerComponents(t.container).value.set(t.id,r),this.widgetsLoadedSet.add(t.id),L.EventBus.emit(K.WidgetLoadedEvent,t.id),n&&n(t.id)}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetCofig.find(i=>i.id===t);if(n){if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i)for(const r of i)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(t),this.widgetsLoadedSet.delete(t),L.EventBus.emit(K.WidgetUnLoadedEvent,t)}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(t){switch(t){case q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const i=this.getLayoutContainer(t);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const i=this.getWidgetComponent(t);i&&L.EventBus.emit(K.WidgetVisibleChanged,{id:t,name:i.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetCofig.find(i=>i.id===t);if(n)return this.getContainerComponents(n.container).value.get(t)}}getWigetItem(t){return this.widgetCofig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetCofig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=nt(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}const ae=new Map,He=new Map;let ce;const ss={getDefaultClient(){if(ce||(ce=new Bt(SysConfig.DefaultHproseAPI)),!ce)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return ce},registerHprose(e,t){const n=He.get(e);if(!n){const i=new Bt(t);ae.set(e,i)}return n},getHprose:e=>He?.get(e),getProxyHprose:e=>ae.get(e),unregisterHprose(e){ae.get(e)&&(He.delete(e),ae.delete(e))}},as=4e3,kt={Login:"/api/Login/Login",CheckLogin:"\u200B/api\u200B/Check\u200B/Login",Logout:"/api/Check/ExitLogin",ChangePWD:"/api/UserManager/UpdateUserPWD",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken"},cs=L.Config.ServiceURL.LoginAuthURL;function qe(){const e=Bn();e&&rt(kt.RefreshToken,cs,{refreshToken:e}).then(t=>{ue(t.data)})}function oi(e){L.User||(L.User={id:e.id,name:e.name,issystem:e.issystem,issecurity:e.issecurity,appkey:e.appkey,role:e.role,doubleToken:{accessToken:{tokenContent:e.token,expires:e.expire},refreshToken:{tokenContent:e.refresh,expires:e.expire}}});const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=4e3?qe():setTimeout(qe,n-4e3))}function ue(e){L.User&&(L.User.doubleToken=e);const t=new Date().getTime(),n=new Date(e.accessToken.expires).getTime()-t;if(n>0&&L.User){let i=Ct();if(!i){const r=L.User.doubleToken;i={id:L.User.id,name:L.User.name,token:r?r.accessToken.tokenContent:"",expire:r?r.accessToken.expires:"",refresh:r?r.accessToken.tokenContent:"",issystem:L.User.issystem,issecurity:L.User.issecurity,appkey:L.User.appkey,role:L.User.role}}i.token=e.accessToken.tokenContent,i.expire=e.accessToken.expires,i.refresh=e.refreshToken.tokenContent,mt.set("access_token",i,n/1e3),oi(i)}else mt.remove("access_token")}function Ge(e){L.User=e}const Dt=L.Config.ServiceURL.LoginAuthURL;async function us(e){const t=(await rt(kt.Login,Dt,e))?.data;return t&&t.isSuccess&&(Ge(t.resultValue),ue(t.resultValue.doubleToken)),t}async function ls(e){const t=(await rt(kt.CheckLogin,Dt,e))?.data;return t&&t.isSuccess&&(Ge(t.resultValue),ue(t.resultValue.doubleToken)),t}function hs(e){return rt(kt.ChangePWD,Dt,e)}function ds(){const e=Ct();e&&(Le(kt.Logout,Dt,{token:e.token,reftoken:e.refresh}),_e())}function fs(e){return rt(kt.CheckToken,Dt,{token:e})}const Xe=new Ht("",sessionStorage);function ri(){return Xe.get("ROLE_SYSTEM_RIGHT")}function si(e){Xe.set("ROLE_SYSTEM_RIGHT",e)}function ai(){Xe.remove("ROLE_SYSTEM_RIGHT")}const Ve=[],Ke=[],Ye=[];function Nt(){return ri()}async function ps(e,t,n,i){if(ai(),!L.User)return;let r;if(i)r=i;else{if(!t)return;let c=n;c||(c=L.Config.ServiceURL.LoginAuthURL);const v=await rt(t,c,{system:e});if(!v||!v.data)return void L.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");r=v.data}return r&&si(r),r}function ci(e,t){const n={...e};return n.meta||(n.meta={}),t.index!=null&&(n.meta.index=t.index),t.title!=null&&(n.meta.title=t.title),e.children&&(n.children=[],t.children&&t.children.forEach(i=>{const r=e.children?.find(c=>c.path===i.path);if(r){const c=ci(r,i);c&&n.children?.push(c)}})),n}function ms(e){if(L.User?.issystem)return e;const t=Nt();return t&&t.routes?(Ye.length>0||e.forEach(n=>{const i=t.routes?.find(r=>r.name===n.name);if(i){const r=ci(n,i);r&&Ye.push(r)}}),Ye):void 0}function ui(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(i=>{const r=e.children?.find(c=>c.name===i.name);if(r){const c=ui(r,i);c&&n.children?.push(c)}})),n}function gs(e){if(L.User?.issystem)return e;const t=Nt();return t&&t.widgetMenu?(Ke.length>0||e.forEach(n=>{const i=t.widgetMenu?.find(r=>r.name===n.name);if(i){const r=ui(n,i);r&&Ke.push(r)}}),Ke):void 0}function vs(e){if(L.User?.issystem)return e;const t=Nt();return t&&t.widgets?(Ve.length>0||e?.forEach(n=>{t.widgets?.find(i=>i.id===n.id)&&Ve.push(n)}),Ve):void 0}function ys(e){if(L.User?.issystem)return e;const t=Nt();return t?t.functions:void 0}export{cr as BigFileDownload,Xt as Download,Bo as DownloadByUrl,St as EnumColor,L as Global,ss as GlobalHprose,It as GlobalMitt,lt as H5Tool,Ut as HproseClient,To as HttpDownload,Pn as JsonDownload,$e as LayoutContainer,q as LayoutContainerEnum,rs as LayoutManager,Rr as ObjToUrlParams,be as Pane,Bt as ProxyClient,Po as SaveAs,yo as Splitpanes,Ht as Storage,$t as StringUtils,Gr as StyleBlack,Kr as StyleGrayblue,Vr as StyleMetal,Xr as StyleWhite,K as SysEvents,as as TOKEN_REFRESH_TIME,kt as USER_TOKEN_API,Qt as VCollapsiblePanel,Zt as VCollapsiblePanelGroup,se as VWindow,ni as WindowResizeEvent,Yr as WindowType,Lo as calculateBestTextColor,hs as changePWD,oi as checkDoRefreshToken,ls as checkLogin,fs as checkToken,_e as clearLocalToken,ai as clearRight,_o as colorIsDark,er as createFileUpload,Ro as darken,Gn as deepMerge,qe as doRefreshToken,Xn as exportSystemRights,jo as get,Nt as getCurrentSystemRight,Fo as getData,ys as getFunctions,Co as getHexColor,Ct as getLocalToken,ir as getLockState,ko as getLongHexColor,Dn as getProxyClient,xo as getRGBColor,zo as getRGBColorFromHSLA,Bn as getRefreshToken,ri as getRight,ms as getRoutes,ps as getSystemRoleRight,vs as getWidgetConfig,gs as getWidgetMenus,ke as hexToRGB,An as init,Uo as initDefaultProxyClient,No as initXFrame,Y as is,qn as isArray,pr as isAsyncFunction,gr as isBoolean,vr as isClient,dr as isDate,Hn as isDef,wr as isElement,Cr as isEmpty,Eo as isEnumColor,xr as isError,De as isFunction,Gt as isHexColor,Sr as isImageDom,Mr as isMap,Ue as isNull,lr as isNullAndUnDef,hr as isNullOrUnDef,fr as isNumber,xt as isObject,mr as isPromise,br as isServer,Yt as isString,zr as isSymbol,Ne as isUnDef,_r as isValidURL,Er as isWeakMap,kr as isWeakSet,yr as isWindow,nr as jquery,Io as lighten,us as login,ds as logout,So as newGuid,or as onLockListener,Wo as post,rt as requestGet,Le as requestPost,Oo as requestPostBody,Mo as rgbToHex,ue as setLocalToken,si as setRight,Ge as setUser,Ao as sleep,bo as storage,mt as storageHelper,rr as unLockListener,qt as uuid,Ir as writeIconifyList,Lr as writeSysRoleRight};
17
+ `}}});const Pr={class:"vcp__header-title"},Tr={key:0,class:"vcp__header-icon"},Br=["innerHTML"],Dr={key:0,ref:"bodyRef",class:"vcp__body"},Ar={ref:"bodyContentRef",class:"vcp__body-content"};function je(e){return window.TouchEvent&&e instanceof TouchEvent}Qt.render=function(e,t,n,i,r,s){return H(),tt("section",{ref:"panelRef",class:so(["vcp",{"vcp--expanded":e.isExpanded,"vcp--expandable":e.body.hasContent}])},[V("header",{class:"vcp__header",onClick:t[0]||(t[0]=(...g)=>e.toggle&&e.toggle(...g))},[V("div",Pr,[ft(e.$slots,"title")]),e.body.hasContent?(H(),tt("div",Tr,[ft(e.$slots,"icon",{},()=>[V("span",{innerHTML:e.toggleIcon},null,8,Br)])])):zt("v-if",!0)]),xn(kn,{"data-key":e.body.dataKey,name:"slide",onBeforeEnter:e.collapse,onEnter:e.expand,onBeforeLeave:e.expand,onLeave:e.collapse},{default:Wt(()=>[e.isExpanded?(H(),tt("div",Dr,[V("div",Ar,[ft(e.$slots,"content")],512)],512)):zt("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},Qt.__scopeId="data-v-08c94cf8",Qt.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class Z{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return je(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return je(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Je(this.clientX,this.clientY)}static bindDown(t,n,i,r=!1){const s=y=>{n(new Z(y))},g=y=>{y.touches.length===1&&n(new Z(y)),y.touches.length>1&&i&&i(new Z(y))};return t.addEventListener("mousedown",s,r),t.addEventListener("touchstart",g,r),()=>{t.removeEventListener("mousedown",s,r),t.removeEventListener("touchstart",g,r)}}static bindMove(t,n,i=!1){const r=g=>{n(new Z(g))},s=g=>{g.touches.length===1&&n(new Z(g))};return t.addEventListener("mousemove",r,i),t.addEventListener("touchmove",s,i),()=>{t.removeEventListener("mousemove",r,i),t.removeEventListener("touchmove",s,i)}}static bindUp(t,n,i=!1){const r=g=>{n(new Z(g))},s=g=>{g.touches.length===0&&n(new Z(g))};return t.addEventListener("mouseup",r,i),t.addEventListener("touchend",s,i),()=>{t.removeEventListener("mouseup",r,i),t.removeEventListener("touchend",s,i)}}originalEvent({mouse:t,touch:n}){je(this.e)?n&&n(this.e):t&&t(this.e)}}class Je{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Je(this.x,this.y)}}class Nr{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,i={}){this.handle=t,this.container=n,this.options=i,t&&(this.unbindDown=Z.bindDown(t,this.mousedown),t.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=t=>{if(t.preventDefault(),this.handle){const{left:n,top:i}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-i}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=Z.bindMove(document,this.mousemove),this.unbindUp=Z.bindUp(document,this.mouseup)};mousemove=t=>{this.container&&(this.container.style.left=t.clientX-this.offsetX+"px",this.container.style.top=t.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=t=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Ur{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(i=>i.push(this))}set group(t){this._group=t;const n=ee(this._group),i=ee(t);n.splice(n.indexOf(this),1),i.push(this),Jn()}get group(){return this._group}unregister(){this.a(t=>t.splice(t.indexOf(this),1))}raise(){this.a(t=>{t.splice(t.indexOf(this),1),t.push(this)})}a(t){t(ee(this._group)),Jn()}}const te=new Map;function ee(e){return te.has(e)||te.set(e,[]),te.get(e)}function Yn(e,t){return e>t?-Yn(t,e):e<0&&t>=0?1:e-t}function Jn(){let e=0;for(const t of function(n){const i=[];return n.forEach((r,s)=>i.push(s)),i}(te).sort(Yn))for(const n of ee(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function We(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const i=ne(e);return e.style.width=t,e.style.height=n,i}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function ne(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height,r=t.top,s=t.left;return{width:n,height:i,top:r,left:s,bottom:r+i,right:s+n}}class Or{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=Zn.map(w=>new w(t,this));const{width:i,height:r}=We(t),s=n.maxWidth||window.innerWidth,g=n.maxHeight||window.innerHeight;let y=!1;(i<n.minWidth||i>s)&&(t.style.width=`${Qn(i,n.minWidth,s)}px`,y=!0),(r<n.minHeight||r>g)&&(t.style.height=`${Qn(r,n.minHeight,g)}px`,y=!0),y&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const Zn=[];class gt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=Z.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=t=>{t.preventDefault(),t.stopPropagation();const{left:n,top:i,width:r,height:s}=ne(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=i,this.width0=r,this.height0=s,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=Z.bindMove(document,this.mousemove),this.unbindUp=Z.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:i,bottom:r}=ne(this.container),s=this.helper.options,g=s.maxWidth||window.innerWidth,y=s.maxHeight||window.innerHeight;this.minLeft=Math.max(i-g,0),this.maxLeft=i-s.minWidth,this.minRight=t+s.minWidth,this.maxRight=Math.min(t+g,window.innerWidth),this.minTop=Math.max(r-y,0),this.maxTop=r-s.minHeight,this.minBottom=n+s.minHeight,this.maxBottom=Math.min(n+y,window.innerHeight)}mousemove=t=>{t.preventDefault(),t.stopPropagation(),this.setPosition(t),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:t,height:n,left:i,top:r,right:s,bottom:g}=ne(this.container),y=this.helper.options;y&&(i<this.minLeft?(this.container.style.width=t+i-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):i>this.maxLeft?(this.container.style.width=`${y.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):s<this.minRight?this.container.style.width=`${y.minWidth}px`:s>this.maxRight&&(this.container.style.width=this.maxRight-i+"px"),r<this.minTop?(this.container.style.height=n+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>this.maxTop?(this.container.style.height=`${y.minHeight}px`,this.container.style.top=`${this.maxTop}px`):g<this.minBottom?this.container.style.height=`${y.minHeight}px`:g>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=t=>{t.preventDefault(),t.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const t=document.createElement("div"),n=t.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(t),t}}function Qn(e,t,n){return e<t?t:e>n?n:e}Zn.push(class extends gt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.right=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="nwse-resize"}},class extends gt{setPosition(e){this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.right=`${this.handleSize}px`,e.left=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="ns-resize"}},class extends gt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends gt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.top=`${this.handleSize}px`,e.cursor="ew-resize"}},class extends gt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.top=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nwse-resize"}},class extends gt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=`${this.handleSize}px`,e.right=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.top=-this.handleSize+"px",e.cursor="ns-resize"}},class extends gt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px",this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=-this.handleSize+"px",e.height=2*this.handleSize+"px",e.width=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends gt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=`${this.handleSize}px`,e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.cursor="ew-resize"}});var ie=Tt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=nt(!1),n=nt(!1);return{hover:t,active:n,style:function(){let i=e.windowStyle.button;return t.value&&(i={...i,...this.windowStyle.buttonHover}),n.value&&(i={...i,...this.windowStyle.buttonActive}),i},mouseup:function(i){this.active&&this.$emit("click")},mousedown:function(i){i.preventDefault(),n.value=!0;const r=Z.bindUp(document,()=>{n.value=!1,r()})}}}});const jr=["disabled"];ie.render=function(e,t,n,i,r,s){return H(),tt("div",{class:"btn",style:yt(e.style()),onMouseenter:t[0]||(t[0]=g=>e.hover=!0),onMouseleave:t[1]||(t[1]=g=>e.hover=!1),onMousedown:t[2]||(t[2]=En((...g)=>e.mousedown&&e.mousedown(...g),["stop"])),onTouchstart:t[3]||(t[3]=En((...g)=>e.mousedown&&e.mousedown(...g),["stop"])),onMouseup:t[4]||(t[4]=(...g)=>e.mouseup&&e.mouseup(...g)),onTouchend:t[5]||(t[5]=(...g)=>e.mouseup&&e.mouseup(...g)),disabled:e.disabled},[ft(e.$slots,"default")],44,jr)},ie.__scopeId="data-v-71662210",ie.__file="src/controls/vuewindow/window/Button.vue";const $e=new Set;function ti(e){return e!==null?parseFloat(e):0}function oe(e){const t=window.getComputedStyle(e);return{width:Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(ti).reduce((n,i)=>n+i)),height:Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(ti).reduce((n,i)=>n+i))}}class ei{width;height;constructor(t,n){this.width=t,this.height=n}}function Wr(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),i=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(i))return{left:n,top:i}}return null}function $r(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}window.addEventListener("resize",e=>{$e.forEach(t=>{t?.fixPosition()})});const re=[];var se=Tt({name:"Window",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:ie},setup(e,{emit:t}){const n=ao();if(!n)return;const{proxy:i}=n;let r=0,s,g,y;const w=nt(e.isOpen),S=()=>{re.push(i),y=new Ur(e.zGroup,k),e.isOpen&&(Cn(()=>{r++==0&&(h(i),function(){const I=z.value,{width:B,height:U}=We(I);let O,j;if(e.left!==void 0!=(e.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof e.left=="number")O=e.left,j=e.top;else{const F=e.positionHint||"auto";switch(F){case"auto":{let G=20,X=50,it=0;do{if(re.every(Q=>{if(!Q.isOpen||i==Q)return!0;const at=Wr(Q);if(at==null)return!0;const{left:le,top:he}=at;return $r(le,he,G,X)>16}))break;G=(G+40)%(window.innerWidth-200),X=(X+40)%(window.innerHeight-200)}while(++it<100);O=G,j=X}break;case"center":O=(window.innerWidth-B)/2,j=(window.innerHeight-U)/2,console.log(O,j,window.innerWidth,window.innerHeight,"111111");break;default:try{const G=F.split("/").map(Number);if(G.length!=2)throw null;const[X,it]=G;if(!isFinite(X)||!isFinite(it))throw null;O=X>=0?X:window.innerWidth-B+X,j=it>=0?it:window.innerHeight-U+it}catch{throw new Error(`invalid position string: ${F}`)}}}I&&(I.style.left=`${O}px`,I.style.top=`${j}px`)}()),e.resizable&&l(),T(),s=new Nr(L.value,z.value,{onMove:()=>T(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:I}=We(L.value);g=new Or(z.value,{onResize:()=>l(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+I,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+I:void 0})}()}),e.activateWhenOpen&&P()),$e.add(i)};function k(I){b.value.zIndex=`${I}`}const z=nt(null),L=nt(null),A=nt(null);function P(){y.raise(),t("activate")}const b=nt({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=pt(()=>e.windowStyle.titlebar),d=pt(()=>{const I={...e.windowStyle.content};return e.resizable?I.padding="0":e.padding!=null&&(I.padding=`${e.padding}px`),e.isScrollable&&(I.overflow="auto"),I});function h(I){const{width:B,height:U,top:O,left:j}=I,F=z;if(F&&B!=null&&(F.value.style.width=`${B}px`),U!=null){const G=L.value;if(G){const X=oe(G).height;F.value.style.height=`${U+X}px`}}F&&j!=null&&(F.value.style.left=`${j}px`),F&&O!=null&&(F.value.style.top=`${O}px`)}function l(I=!0){const B=z.value,U=L.value,O=A.value;if(O&&B&&U){const{width:j,height:F}=oe(O),{width:G,height:X}=oe(B),it=oe(U).height,Q=G-(O.offsetWidth-j),at=X-it-(O.offsetHeight-F);O.style.width=`${Q}px`,O.style.height=`${at}px`,p(),t("resize",new ei(Q,at)),I&&(t("update:width",Q),t("update:height",at))}}function p(){const I=z.value;if(I){const B=I.getBoundingClientRect();B.left<0&&(b.value.left="0px"),B.top<0&&(b.value.top="0px"),B.right>window.innerWidth&&(b.value.left=window.innerWidth-B.width+"px"),B.bottom>window.innerHeight&&(b.value.top=window.innerHeight-B.height+"px")}}function T(I=!0){p();const B=z.value;if(B){const{left:U,top:O}=B.getBoundingClientRect();I&&(t("update:left",U),t("update:top",O))}}return $t(()=>e.isOpen,I=>{w.value=I}),$t(()=>e.zGroup,I=>{y.group=I}),$t(()=>e.width,I=>{h({width:I}),l(!1)}),$t(()=>e.height,I=>{h({height:I}),l(!1)}),Sn(()=>{S()}),co(()=>{$e.delete(this),y.unregister(),g&&g.teardown(),s&&s.teardown(),re.splice(re.indexOf(i),1)}),{isOpen:w,windowEl:z,titlebar:L,content:A,activate:P,styleWindow:b,styleTitlebar:u,styleContent:d,closeButtonClick:function(){w.value=!1,t("closebuttonclick")}}}});const Fr={class:"title"},Hr=Mn("\xD7");var ni,vt;se.render=function(e,t,n,i,r,s){const g=zn("myButton");return H(),ut(kn,{name:"fade",onAfterLeave:t[2]||(t[2]=y=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=y=>e.$emit("open"))},{default:Wt(()=>[uo(V("div",{class:"window",style:yt(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...y)=>e.activate&&e.activate(...y)),onTouchstart:t[1]||(t[1]=(...y)=>e.activate&&e.activate(...y))},[V("div",{class:"titlebar",style:yt(e.styleTitlebar),ref:"titlebar"},[V("div",Fr,[e.$slots.title?ft(e.$slots,"title",{key:0}):(H(),tt(wt,{key:1},[Mn(lo(e.title),1)],2112))]),e.closeButton?(H(),ut(g,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:Wt(()=>[Hr]),_:1},8,["windowStyle","onClick"])):zt("v-if",!0)],4),V("div",{class:"content",style:yt(e.styleContent),ref:"content"},[ft(e.$slots,"default")],4)],36),[[ho,e.isOpen]])]),_:3})},se.__file="src/controls/vuewindow/window/index.vue",(vt=ni||(ni={}))[vt.StyleBlack=0]="StyleBlack",vt[vt.StyleWhite=1]="StyleWhite",vt[vt.StyleMetal=2]="StyleMetal",vt[vt.StyleGrayblue=3]="StyleGrayblue";const qr={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},Gr={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},Xr={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},Vr={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},Kr=se;var q,et;(et=q||(q={}))[et.top=0]="top",et[et.bottom=1]="bottom",et[et.centerBack=2]="centerBack",et[et.centerMain=3]="centerMain",et[et.centerFront=4]="centerFront",et[et.left=5]="left",et[et.right=6]="right";class Yr{layoutState;widgetCofig;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;constructor(t,n){this.layoutState=t,this.widgetCofig=n,this.widgetCofig.forEach(i=>{if(i.afterid)if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const r=new Set;r.add(i),this.preConditionMap.set(i.afterid,r)}})}getWidgetConfig(){return this.widgetCofig}preloadWidgets(){this.widgetCofig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t,this.loadOtherDependenceWidgets.bind(this))})}loadWidget(t){if(!t)return;let n;xt(t)?n=t:Yt(t)&&(n=this.widgetCofig.find(i=>i.id===t)),n&&this._loadWidget(n,this.loadOtherDependenceWidgets.bind(this))}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t,n){if(!this.widgetsLoadedSet.has(t.id))return t.component().then(i=>{if(i.default){const r=_n(i.default);this.getContainerComponents(t.container).value.set(t.id,r),this.widgetsLoadedSet.add(t.id),R.EventBus.emit(K.WidgetLoadedEvent,t.id),n&&n(t.id)}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetCofig.find(i=>i.id===t);if(n){if(this.preConditionMap.has(t)){const s=this.preConditionMap.get(t);if(s)for(const g of s)this.unloadWidget(g.id)}const i=this.getContainerComponents(n.container),r=i.value.get(t);r&&r.unmounted&&r.unmounted(),i.value.delete(t),this.widgetsLoadedSet.delete(t),R.EventBus.emit(K.WidgetUnLoadedEvent,t)}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(t){switch(t){case q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const i=this.getLayoutContainer(t);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const i=this.getWidgetComponent(t);i&&R.EventBus.emit(K.WidgetVisibleChanged,{id:t,name:i.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetCofig.find(i=>i.id===t);if(n)return this.getContainerComponents(n.container).value.get(t)}}getWigetItem(t){return this.widgetCofig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetCofig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=nt(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}var Fe=Tt({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutStyle:{type:Object}},components:{},setup(e,{attrs:t,slots:n,emit:i}){const r=bn({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0});if(!R.LayoutManager){const A=new Yr(r,e.widgetConfig);R.LayoutManager=A,A.preloadWidgets()}const s=z(q.top),g=z(q.centerBack),y=z(q.centerFront),w=z(q.left),S=z(q.right),k=z(q.bottom);function z(A){return R.LayoutManager?.getContainerComponents(A)}const L=pt(()=>e.layoutStyle);return{...fo(r),topContainerComponents:s,centerbackComponents:g,centerfrontComponents:y,leftContainerComponents:w,rightContainerComponents:S,bottomContainerComponents:k,containerStyle:L}}});const Jr={ref:"topContainer",class:"topContainer"},Zr={ref:"centerBackContainer",class:"centerdiv backContainer"},Qr={ref:"centerMainContainer",class:"centerdiv mainContainer"},ts={ref:"centerFrontContainer",class:"centerdiv centerContainer"},es={ref:"leftContainer",class:"leftContainer"},ns={ref:"rightContainer",class:"rightContainer"},is={ref:"bottomContainer",class:"bottomContainer"};Fe.render=function(e,t,n,i,r,s){const g=zn("router-view");return H(),tt("div",{class:"layoutContainer",style:yt(e.containerStyle)},[V("div",Jr,[(H(!0),tt(wt,null,Mt(e.topContainerComponents,([y,w])=>(H(),ut(bt(w),{key:y}))),128))],512),V("div",null,[zt(" \u5E95\u5C42-\u4E3B\u5BB9\u5668 "),V("div",Zr,[(H(!0),tt(wt,null,Mt(e.centerbackComponents,([y,w])=>(H(),ut(bt(w),{key:y}))),128))],512),zt(" \u4E3B\u8981\u5BB9\u5668 "),V("div",Qr,[xn(g,null,{default:Wt(({Component:y})=>[(H(),ut(bt(y)))]),_:1})],512),zt(" \u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),V("div",ts,[(H(!0),tt(wt,null,Mt(e.centerfrontComponents,([y,w])=>(H(),ut(bt(w),{key:y}))),128))],512),V("div",es,[(H(!0),tt(wt,null,Mt(e.leftContainerComponents,([y,w])=>(H(),ut(bt(w),{key:y}))),128))],512),V("div",ns,[(H(!0),tt(wt,null,Mt(e.rightContainerComponents,([y,w])=>(H(),ut(bt(w),{key:y}))),128))],512)]),V("div",is,[(H(!0),tt(wt,null,Mt(e.bottomContainerComponents,([y,w])=>(H(),ut(bt(w),{key:y}))),128))],512)],4)},Fe.__file="src/controls/layoutcontainer/layout.vue";class os{layoutState;widgetCofig;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;constructor(t,n){this.layoutState=t,this.widgetCofig=n,this.widgetCofig.forEach(i=>{if(i.afterid)if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const r=new Set;r.add(i),this.preConditionMap.set(i.afterid,r)}})}getWidgetConfig(){return this.widgetCofig}preloadWidgets(){this.widgetCofig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t,this.loadOtherDependenceWidgets.bind(this))})}loadWidget(t){if(!t)return;let n;xt(t)?n=t:Yt(t)&&(n=this.widgetCofig.find(i=>i.id===t)),n&&this._loadWidget(n,this.loadOtherDependenceWidgets.bind(this))}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t,n){if(!this.widgetsLoadedSet.has(t.id))return t.component().then(i=>{if(i.default){const r=_n(i.default);this.getContainerComponents(t.container).value.set(t.id,r),this.widgetsLoadedSet.add(t.id),R.EventBus.emit(K.WidgetLoadedEvent,t.id),n&&n(t.id)}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetCofig.find(i=>i.id===t);if(n){if(this.preConditionMap.has(t)){const s=this.preConditionMap.get(t);if(s)for(const g of s)this.unloadWidget(g.id)}const i=this.getContainerComponents(n.container),r=i.value.get(t);r&&r.unmounted&&r.unmounted(),i.value.delete(t),this.widgetsLoadedSet.delete(t),R.EventBus.emit(K.WidgetUnLoadedEvent,t)}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(t){switch(t){case q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const i=this.getLayoutContainer(t);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const i=this.getWidgetComponent(t);i&&R.EventBus.emit(K.WidgetVisibleChanged,{id:t,name:i.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetCofig.find(i=>i.id===t);if(n)return this.getContainerComponents(n.container).value.get(t)}}getWigetItem(t){return this.widgetCofig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetCofig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=nt(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}const ae=new Map,He=new Map;let ce;const rs={getDefaultClient(){if(ce||(ce=new Bt(SysConfig.DefaultHproseAPI)),!ce)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return ce},registerHprose(e,t){const n=He.get(e);if(!n){const i=new Bt(t);ae.set(e,i)}return n},getHprose:e=>He?.get(e),getProxyHprose:e=>ae.get(e),unregisterHprose(e){ae.get(e)&&(He.delete(e),ae.delete(e))}},ss=4e3,kt={Login:"/api/Login/Login",CheckLogin:"\u200B/api\u200B/Check\u200B/Login",Logout:"/api/Check/ExitLogin",ChangePWD:"/api/UserManager/UpdateUserPWD",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken"},as=R.Config.ServiceURL.LoginAuthURL;function qe(){const e=Bn();e&&st(kt.RefreshToken,as,{refreshToken:e}).then(t=>{ue(t.data)})}function ii(e){R.User||(R.User={id:e.id,name:e.name,issystem:e.issystem,issecurity:e.issecurity,appkey:e.appkey,role:e.role,doubleToken:{accessToken:{tokenContent:e.token,expires:e.expire},refreshToken:{tokenContent:e.refresh,expires:e.expire}}});const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=4e3?qe():setTimeout(qe,n-4e3))}function ue(e){R.User&&(R.User.doubleToken=e);const t=new Date().getTime(),n=new Date(e.accessToken.expires).getTime()-t;if(n>0&&R.User){let i=Ct();if(!i){const r=R.User.doubleToken;i={id:R.User.id,name:R.User.name,token:r?r.accessToken.tokenContent:"",expire:r?r.accessToken.expires:"",refresh:r?r.accessToken.tokenContent:"",issystem:R.User.issystem,issecurity:R.User.issecurity,appkey:R.User.appkey,role:R.User.role}}i.token=e.accessToken.tokenContent,i.expire=e.accessToken.expires,i.refresh=e.refreshToken.tokenContent,mt.set("access_token",i,n/1e3),ii(i)}else mt.remove("access_token")}function Ge(e){R.User=e}const At=R.Config.ServiceURL.LoginAuthURL;async function cs(e){const t=(await st(kt.Login,At,e))?.data;return t&&t.isSuccess&&(Ge(t.resultValue),ue(t.resultValue.doubleToken)),t}async function us(e){const t=(await st(kt.CheckLogin,At,e))?.data;return t&&t.isSuccess&&(Ge(t.resultValue),ue(t.resultValue.doubleToken)),t}function ls(e){return st(kt.ChangePWD,At,e)}function hs(){const e=Ct();e&&(Re(kt.Logout,At,{token:e.token,reftoken:e.refresh}),_e())}function ds(e){return st(kt.CheckToken,At,{token:e})}const Xe=new Ht("",sessionStorage);function oi(){return Xe.get("ROLE_SYSTEM_RIGHT")}function ri(e){Xe.set("ROLE_SYSTEM_RIGHT",e)}function si(){Xe.remove("ROLE_SYSTEM_RIGHT")}const Ve=[],Ke=[],Ye=[];function Nt(){return oi()}async function fs(e,t,n,i){if(si(),!R.User)return;let r;if(i)r=i;else{if(!t)return;let s=n;s||(s=R.Config.ServiceURL.LoginAuthURL);const g=await st(t,s,{system:e});if(!g||!g.data)return void R.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");r=g.data}return r&&ri(r),r}function ai(e,t){const n={...e};return n.meta||(n.meta={}),t.index!=null&&(n.meta.index=t.index),t.title!=null&&(n.meta.title=t.title),e.children&&(n.children=[],t.children&&t.children.forEach(i=>{const r=e.children?.find(s=>s.path===i.path);if(r){const s=ai(r,i);s&&n.children?.push(s)}})),n}function ps(e){if(R.User?.issystem)return e;const t=Nt();return t&&t.routes?(Ye.length>0||e.forEach(n=>{const i=t.routes?.find(r=>r.name===n.name);if(i){const r=ai(n,i);r&&Ye.push(r)}}),Ye):void 0}function ci(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(i=>{const r=e.children?.find(s=>s.name===i.name);if(r){const s=ci(r,i);s&&n.children?.push(s)}})),n}function ms(e){if(R.User?.issystem)return e;const t=Nt();return t&&t.widgetMenu?(Ke.length>0||e.forEach(n=>{const i=t.widgetMenu?.find(r=>r.name===n.name);if(i){const r=ci(n,i);r&&Ke.push(r)}}),Ke):void 0}function gs(e){if(R.User?.issystem)return e;const t=Nt();return t&&t.widgets?(Ve.length>0||e?.forEach(n=>{t.widgets?.find(i=>i.id===n.id)&&Ve.push(n)}),Ve):void 0}function vs(e){if(R.User?.issystem)return e;const t=Nt();return t?t.functions:void 0}export{ar as BigFileDownload,Xt as Download,To as DownloadByUrl,St as EnumColor,R as Global,rs as GlobalHprose,Rt as GlobalMitt,ot as H5Tool,Ut as HproseClient,Po as HttpDownload,Pn as JsonDownload,Fe as LayoutContainer,q as LayoutContainerEnum,os as LayoutManager,_r as ObjToUrlParams,be as Pane,Bt as ProxyClient,Lo as SaveAs,vo as Splitpanes,Ht as Storage,Ft as StringUtils,qr as StyleBlack,Vr as StyleGrayblue,Xr as StyleMetal,Gr as StyleWhite,K as SysEvents,ss as TOKEN_REFRESH_TIME,kt as USER_TOKEN_API,Qt as VCollapsiblePanel,Zt as VCollapsiblePanelGroup,se as VWindow,ei as WindowResizeEvent,Kr as WindowType,Ro as calculateBestTextColor,ls as changePWD,ii as checkDoRefreshToken,us as checkLogin,ds as checkToken,_e as clearLocalToken,si as clearRight,Mo as colorIsDark,Jo as createFileUpload,_o as darken,qn as deepMerge,qe as doRefreshToken,Gn as exportSystemRights,Ao as get,Nt as getCurrentSystemRight,Uo as getData,vs as getFunctions,So as getHexColor,Ct as getLocalToken,nr as getLockState,xo as getLongHexColor,Un as getProxyClient,Co as getRGBColor,Eo as getRGBColorFromHSLA,Bn as getRefreshToken,oi as getRight,ps as getRoutes,fs as getSystemRoleRight,gs as getWidgetConfig,ms as getWidgetMenus,ke as hexToRGB,tr as init,er as initDefaultProxyClient,Y as is,Hn as isArray,fr as isAsyncFunction,mr as isBoolean,gr as isClient,hr as isDate,Fn as isDef,yr as isElement,Sr as isEmpty,ko as isEnumColor,Cr as isError,Ae as isFunction,Gt as isHexColor,br as isImageDom,zr as isMap,Ue as isNull,ur as isNullAndUnDef,lr as isNullOrUnDef,dr as isNumber,xt as isObject,pr as isPromise,wr as isServer,Yt as isString,Er as isSymbol,Ne as isUnDef,Mr as isValidURL,kr as isWeakMap,xr as isWeakSet,vr as isWindow,Zo as jquery,Io as lighten,cs as login,hs as logout,bo as newGuid,ir as onLockListener,No as post,st as requestGet,Re as requestPost,Do as requestPostBody,zo as rgbToHex,ue as setLocalToken,ri as setRight,Ge as setUser,Bo as sleep,wo as storage,mt as storageHelper,or as unLockListener,qt as uuid,Ir as writeIconifyList,Rr as writeSysRoleRight};