xframelib 0.8.7 → 0.8.9
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/README.md +3 -0
- package/dist/core/Global.d.ts +5 -0
- package/dist/index.cjs +10 -10
- package/dist/index.js +10 -10
- package/dist/utils/FileDownload.d.ts +12 -4
- package/dist/utils/FilenameUtils.d.ts +14 -0
- package/dist/utils/GzipTool.d.ts +27 -0
- package/dist/utils/H5Tool.d.ts +56 -0
- package/dist/utils/IsTool.d.ts +12 -0
- package/dist/utils/ZipTool.d.ts +60 -0
- package/dist/utils/index.d.ts +4 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var l=require("vue"),ti=require("axios"),ni=require("qs"),Ge=require("@hprose/rpc-core"),re=require("@hprose/io"),oi=require("@hprose/rpc-html5"),Dt=require("@iconify/vue");function Gn(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ri=Gn(ti),ii=Gn(ni),si={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((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.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(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((o,r)=>(o.size=r===e?o.max:o.min,r!==e&&(n+=o.min),o)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e])},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:o-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),100*t/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(t),r),o);let s=[e,e+1],c=this.panes[s[0]]||null,h=this.panes[s[1]]||null;const m=c.max<100&&i>=c.max+n.prevPanesSize,C=h.max<100&&i<=100-(h.max+this.sumNextPanesSize(e+1));if(m||C)m?(c.size=c.max,h.size=Math.max(100-c.max-n.prevPanesSize-n.nextPanesSize,0)):(c.size=Math.max(100-h.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),h.size=h.max);else{if(this.pushOtherPanes){const k=this.doPushOtherPanes(n,i);if(!k)return;({sums:n,panesToResize:s}=k),c=this.panes[s[0]]||null,h=this.panes[s[1]]||null}c!==null&&(c.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,c.min),c.max)),h!==null&&(h.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,h.min),h.max))}},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,o=[n,n+1];return e<t.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((r,i)=>{i>o[0]&&i<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),t.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((r,i)=>{i>n&&i<o[1]&&(r.size=r.min,t.nextReachedMinPanes+=r.min)}),t.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(t.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,i)=>{i<this.panesCount-1&&i>=n+1&&(r.size=r.min,t.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:o}},sumPrevPanesSize(t){return this.panes.reduce((e,n,o)=>e+(o<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,o)=>e+(o>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.index<t&&e.size>e.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");if(!e&&!n)return t.parentNode.removeChild(t),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(t,e,n=!1){const o=t-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(r.onmousedown=i=>this.onMouseDown(i,o),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=i=>this.onMouseDown(i,o)),r.onclick=i=>this.onSplitterClick(i,o+1)),this.dblClickSplitter&&(r.ondblclick=i=>this.onSplitterDblClick(i,o+1)),e.parentNode.insertBefore(r,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([o,r])=>n[o]=r)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&e++,r===t.$el));const n=parseFloat(t.minSize),o=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((r,i)=>r.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(o=>o.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(t={}){t.addedPane||t.removedPane?this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(t,r.max),r.min),e-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&o.push(r.id)}),e>.1&&this.readjustSizes(e,n,o)},initialPanesSizing(){let t=100;const e=[],n=[];let o=0;this.panes.forEach(i=>{t-=i.size,i.size!==null&&o++,i.size>=i.max&&e.push(i.id),i.size<=i.min&&n.push(i.id)});let r=100;t>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(t/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t}={}){let e=100/this.panesCount,n=0;const o=[],r=[];t&&t.givenSize!==null&&(e=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(i=>{n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(i=>{t&&t.givenSize!==null&&t.id===i.id||(i.size=Math.max(Math.min(e,i.max),i.min)),n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),n>.1&&this.readjustSizes(n,o,r))},readjustSizes(t,e,n){let o;o=t>0?t/(this.panesCount-e.length):t/(this.panesCount-n.length),this.panes.forEach(r=>{if(t>0&&!e.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;t-=s,r.size=i}else if(!n.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;t-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(t)>.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(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?o=>this.onSplitterDblClick(o,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 l.h("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},At={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(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function Bt(t){return window.TouchEvent&&t instanceof TouchEvent}At.render=function(t,e,n,o,r,i){return l.openBlock(),l.createElementBlock("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=s=>i.onPaneClick(s,t._.uid)),style:l.normalizeStyle(t.style)},[l.renderSlot(t.$slots,"default")],4)},At.__file="src/controls/splitpanes/pane.vue";class ae{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Bt(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Bt(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new kn(this.clientX,this.clientY)}static bindDown(e,n,o,r=!1){const i=c=>{n(new ae(c))},s=c=>{c.touches.length===1&&n(new ae(c)),c.touches.length>1&&o&&o(new ae(c))};return e.addEventListener("mousedown",i,r),e.addEventListener("touchstart",s,r),()=>{e.removeEventListener("mousedown",i,r),e.removeEventListener("touchstart",s,r)}}static bindMove(e,n,o=!1){const r=s=>{n(new ae(s))},i=s=>{s.touches.length===1&&n(new ae(s))};return e.addEventListener("mousemove",r,o),e.addEventListener("touchmove",i,o),()=>{e.removeEventListener("mousemove",r,o),e.removeEventListener("touchmove",i,o)}}static bindUp(e,n,o=!1){const r=s=>{n(new ae(s))},i=s=>{s.touches.length===0&&n(new ae(s))};return e.addEventListener("mouseup",r,o),e.addEventListener("touchend",i,o),()=>{e.removeEventListener("mouseup",r,o),e.removeEventListener("touchend",i,o)}}originalEvent({mouse:e,touch:n}){Bt(this.e)?n&&n(this.e):e&&e(this.e)}}class kn{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new kn(this.x,this.y)}}class ai{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,o={}){this.handle=e,this.container=n,this.options=o,e&&(this.unbindDown=ae.bindDown(e,this.mousedown),e.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=e=>{e.preventDefault(),this.handle&&(this.offsetX=e.clientX,this.offsetY=e.clientY),this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=ae.bindMove(document,this.mousemove),this.unbindUp=ae.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=`calc(${e.clientX-this.offsetX}px + ${this.container.style.left})`,this.container.style.top=`calc(${e.clientY-this.offsetY}px + ${this.container.style.top})`,this.offsetX=e.clientX,this.offsetY=e.clientY),this.options.onMove&&this.options.onMove()};mouseup=e=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class ci{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(o=>o.push(this))}set group(e){this._group=e;const n=Je(this._group),o=Je(e);n.splice(n.indexOf(this),1),o.push(this),Jn()}get group(){return this._group}unregister(){this.a(e=>e.splice(e.indexOf(this),1))}raise(){this.a(e=>{e.splice(e.indexOf(this),1),e.push(this)})}a(e){e(Je(this._group)),Jn()}}const Ye=new Map,li=0;function Je(t){return Ye.has(t)||Ye.set(t,[]),Ye.get(t)}function Yn(t,e){return t>e?-Yn(e,t):t<0&&e>=0?1:t-e}function Jn(){let t=li;for(const e of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(Ye).sort(Yn))for(const n of Je(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function $t(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const o=Ze(t);return t.style.width=e,t.style.height=n,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function Ze(t){const e=t.getBoundingClientRect(),n=e.width,o=e.height,r=e.top,i=e.left;return{width:n,height:o,top:r,left:i,bottom:r+o,right:i+n}}class ui{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=Zn.map(h=>new h(e,this));const{width:o,height:r}=$t(e),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let c=!1;(o<n.minWidth||o>i)&&(e.style.width=`${Qn(o,n.minWidth,i)}px`,c=!0),(r<n.minHeight||r>s)&&(e.style.height=`${Qn(r,n.minHeight,s)}px`,c=!0),c&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const Zn=[];class me{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=ae.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=e=>{e.preventDefault(),e.stopPropagation();const{left:n,top:o,width:r,height:i}=Ze(this.container);this.x0=e.clientX,this.y0=e.clientY,this.left0=n,this.top0=o,this.width0=r,this.height0=i,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=ae.bindMove(document,this.mousemove),this.unbindUp=ae.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:o,bottom:r}=Ze(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,c=i.maxHeight||window.innerHeight;this.minLeft=Math.max(o-s,0),this.maxLeft=o-i.minWidth,this.minRight=e+i.minWidth,this.maxRight=Math.min(e+s,window.innerWidth),this.minTop=Math.max(r-c,0),this.maxTop=r-i.minHeight,this.minBottom=n+i.minHeight,this.maxBottom=Math.min(n+c,window.innerHeight)}mousemove=e=>{e.preventDefault(),e.stopPropagation(),this.setPosition(e),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:e,height:n,left:o,top:r,right:i,bottom:s}=Ze(this.container),c=this.helper.options;c&&(o<this.minLeft?(this.container.style.width=e+o-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):o>this.maxLeft?(this.container.style.width=`${c.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):i<this.minRight?this.container.style.width=`${c.minWidth}px`:i>this.maxRight&&(this.container.style.width=this.maxRight-o+"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=`${c.minHeight}px`,this.container.style.top=`${this.maxTop}px`):s<this.minBottom?this.container.style.height=`${c.minHeight}px`:s>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=e=>{e.preventDefault(),e.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const e=document.createElement("div"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function Qn(t,e,n){return t<e?e:t>n?n:t}Zn.push(class extends me{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.right=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="nwse-resize"}},class extends me{setPosition(t){this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.right=`${this.handleSize}px`,t.left=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="ns-resize"}},class extends me{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends me{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.top=`${this.handleSize}px`,t.cursor="ew-resize"}},class extends me{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.top=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nwse-resize"}},class extends me{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=`${this.handleSize}px`,t.right=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.top=-this.handleSize+"px",t.cursor="ns-resize"}},class extends me{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px",this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=-this.handleSize+"px",t.height=2*this.handleSize+"px",t.width=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends me{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=`${this.handleSize}px`,t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.cursor="ew-resize"}});var Qe=l.defineComponent({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=l.ref(!1),n=l.ref(!1);return{hover:e,active:n,style:function(){let o=t.windowStyle.button;return e.value&&(o={...o,...this.windowStyle.buttonHover}),n.value&&(o={...o,...this.windowStyle.buttonActive}),o},mouseup:function(o){this.active&&this.$emit("click")},mousedown:function(o){o.preventDefault(),n.value=!0;const r=ae.bindUp(document,()=>{n.value=!1,r()})}}}});const hi=["disabled"];Qe.render=function(t,e,n,o,r,i){return l.openBlock(),l.createElementBlock("div",{class:"btn",style:l.normalizeStyle(t.style()),onMouseenter:e[0]||(e[0]=s=>t.hover=!0),onMouseleave:e[1]||(e[1]=s=>t.hover=!1),onMousedown:e[2]||(e[2]=l.withModifiers((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onTouchstart:e[3]||(e[3]=l.withModifiers((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onMouseup:e[4]||(e[4]=(...s)=>t.mouseup&&t.mouseup(...s)),onTouchend:e[5]||(e[5]=(...s)=>t.mouseup&&t.mouseup(...s)),disabled:t.disabled},[l.renderSlot(t.$slots,"default")],44,hi)},Qe.__scopeId="data-v-71662210",Qe.__file="src/controls/vuewindow/window/Button.vue";const di=Object.prototype.toString;function ie(t,e){return di.call(t)===`[object ${e}]`}function et(t){return ie(t,"Function")}const eo=t=>typeof t<"u",Nt=t=>!eo(t);function Wt(t){return t===null}const ve=t=>t!=null&&t!==null&&ie(t,"Object");function Ut(t){return ie(t,"Number")}function tt(t){return ie(t,"String")}function Ot(t){return t&&Array.isArray(t)}const fi=typeof window>"u";var Ie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var to,no={exports:{}},pi=(to||(to=1,no.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(p,u){var y=p[0],v=p[1],g=p[2],w=p[3];v=((v+=((g=((g+=((w=((w+=((y=((y+=(v&g|~v&w)+u[0]-680876936|0)<<7|y>>>25)+v|0)&v|~y&g)+u[1]-389564586|0)<<12|w>>>20)+y|0)&y|~w&v)+u[2]+606105819|0)<<17|g>>>15)+w|0)&w|~g&y)+u[3]-1044525330|0)<<22|v>>>10)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v&g|~v&w)+u[4]-176418897|0)<<7|y>>>25)+v|0)&v|~y&g)+u[5]+1200080426|0)<<12|w>>>20)+y|0)&y|~w&v)+u[6]-1473231341|0)<<17|g>>>15)+w|0)&w|~g&y)+u[7]-45705983|0)<<22|v>>>10)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v&g|~v&w)+u[8]+1770035416|0)<<7|y>>>25)+v|0)&v|~y&g)+u[9]-1958414417|0)<<12|w>>>20)+y|0)&y|~w&v)+u[10]-42063|0)<<17|g>>>15)+w|0)&w|~g&y)+u[11]-1990404162|0)<<22|v>>>10)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v&g|~v&w)+u[12]+1804603682|0)<<7|y>>>25)+v|0)&v|~y&g)+u[13]-40341101|0)<<12|w>>>20)+y|0)&y|~w&v)+u[14]-1502002290|0)<<17|g>>>15)+w|0)&w|~g&y)+u[15]+1236535329|0)<<22|v>>>10)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v&w|g&~w)+u[1]-165796510|0)<<5|y>>>27)+v|0)&g|v&~g)+u[6]-1069501632|0)<<9|w>>>23)+y|0)&v|y&~v)+u[11]+643717713|0)<<14|g>>>18)+w|0)&y|w&~y)+u[0]-373897302|0)<<20|v>>>12)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v&w|g&~w)+u[5]-701558691|0)<<5|y>>>27)+v|0)&g|v&~g)+u[10]+38016083|0)<<9|w>>>23)+y|0)&v|y&~v)+u[15]-660478335|0)<<14|g>>>18)+w|0)&y|w&~y)+u[4]-405537848|0)<<20|v>>>12)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v&w|g&~w)+u[9]+568446438|0)<<5|y>>>27)+v|0)&g|v&~g)+u[14]-1019803690|0)<<9|w>>>23)+y|0)&v|y&~v)+u[3]-187363961|0)<<14|g>>>18)+w|0)&y|w&~y)+u[8]+1163531501|0)<<20|v>>>12)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v&w|g&~w)+u[13]-1444681467|0)<<5|y>>>27)+v|0)&g|v&~g)+u[2]-51403784|0)<<9|w>>>23)+y|0)&v|y&~v)+u[7]+1735328473|0)<<14|g>>>18)+w|0)&y|w&~y)+u[12]-1926607734|0)<<20|v>>>12)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v^g^w)+u[5]-378558|0)<<4|y>>>28)+v|0)^v^g)+u[8]-2022574463|0)<<11|w>>>21)+y|0)^y^v)+u[11]+1839030562|0)<<16|g>>>16)+w|0)^w^y)+u[14]-35309556|0)<<23|v>>>9)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v^g^w)+u[1]-1530992060|0)<<4|y>>>28)+v|0)^v^g)+u[4]+1272893353|0)<<11|w>>>21)+y|0)^y^v)+u[7]-155497632|0)<<16|g>>>16)+w|0)^w^y)+u[10]-1094730640|0)<<23|v>>>9)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v^g^w)+u[13]+681279174|0)<<4|y>>>28)+v|0)^v^g)+u[0]-358537222|0)<<11|w>>>21)+y|0)^y^v)+u[3]-722521979|0)<<16|g>>>16)+w|0)^w^y)+u[6]+76029189|0)<<23|v>>>9)+g|0,v=((v+=((g=((g+=((w=((w+=((y=((y+=(v^g^w)+u[9]-640364487|0)<<4|y>>>28)+v|0)^v^g)+u[12]-421815835|0)<<11|w>>>21)+y|0)^y^v)+u[15]+530742520|0)<<16|g>>>16)+w|0)^w^y)+u[2]-995338651|0)<<23|v>>>9)+g|0,v=((v+=((w=((w+=(v^((y=((y+=(g^(v|~w))+u[0]-198630844|0)<<6|y>>>26)+v|0)|~g))+u[7]+1126891415|0)<<10|w>>>22)+y|0)^((g=((g+=(y^(w|~v))+u[14]-1416354905|0)<<15|g>>>17)+w|0)|~y))+u[5]-57434055|0)<<21|v>>>11)+g|0,v=((v+=((w=((w+=(v^((y=((y+=(g^(v|~w))+u[12]+1700485571|0)<<6|y>>>26)+v|0)|~g))+u[3]-1894986606|0)<<10|w>>>22)+y|0)^((g=((g+=(y^(w|~v))+u[10]-1051523|0)<<15|g>>>17)+w|0)|~y))+u[1]-2054922799|0)<<21|v>>>11)+g|0,v=((v+=((w=((w+=(v^((y=((y+=(g^(v|~w))+u[8]+1873313359|0)<<6|y>>>26)+v|0)|~g))+u[15]-30611744|0)<<10|w>>>22)+y|0)^((g=((g+=(y^(w|~v))+u[6]-1560198380|0)<<15|g>>>17)+w|0)|~y))+u[13]+1309151649|0)<<21|v>>>11)+g|0,v=((v+=((w=((w+=(v^((y=((y+=(g^(v|~w))+u[4]-145523070|0)<<6|y>>>26)+v|0)|~g))+u[11]-1120210379|0)<<10|w>>>22)+y|0)^((g=((g+=(y^(w|~v))+u[2]+718787259|0)<<15|g>>>17)+w|0)|~y))+u[9]-343485551|0)<<21|v>>>11)+g|0,p[0]=y+p[0]|0,p[1]=v+p[1]|0,p[2]=g+p[2]|0,p[3]=w+p[3]|0}function o(p){var u,y=[];for(u=0;u<64;u+=4)y[u>>2]=p.charCodeAt(u)+(p.charCodeAt(u+1)<<8)+(p.charCodeAt(u+2)<<16)+(p.charCodeAt(u+3)<<24);return y}function r(p){var u,y=[];for(u=0;u<64;u+=4)y[u>>2]=p[u]+(p[u+1]<<8)+(p[u+2]<<16)+(p[u+3]<<24);return y}function i(p){var u,y,v,g,w,B,D=p.length,R=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=D;u+=64)n(R,o(p.substring(u-64,u)));for(y=(p=p.substring(u-64)).length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<y;u+=1)v[u>>2]|=p.charCodeAt(u)<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n(R,v),u=0;u<16;u+=1)v[u]=0;return g=(g=8*D).toString(16).match(/(.*?)(.{0,8})$/),w=parseInt(g[2],16),B=parseInt(g[1],16)||0,v[14]=w,v[15]=B,n(R,v),R}function s(p){var u,y,v,g,w,B,D=p.length,R=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=D;u+=64)n(R,r(p.subarray(u-64,u)));for(y=(p=u-64<D?p.subarray(u-64):new Uint8Array(0)).length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<y;u+=1)v[u>>2]|=p[u]<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n(R,v),u=0;u<16;u+=1)v[u]=0;return g=(g=8*D).toString(16).match(/(.*?)(.{0,8})$/),w=parseInt(g[2],16),B=parseInt(g[1],16)||0,v[14]=w,v[15]=B,n(R,v),R}function c(p){var u,y="";for(u=0;u<4;u+=1)y+=e[p>>8*u+4&15]+e[p>>8*u&15];return y}function h(p){var u;for(u=0;u<p.length;u+=1)p[u]=c(p[u]);return p.join("")}function m(p){return/[\u0080-\uFFFF]/.test(p)&&(p=unescape(encodeURIComponent(p))),p}function C(p,u){var y,v=p.length,g=new ArrayBuffer(v),w=new Uint8Array(g);for(y=0;y<v;y+=1)w[y]=p.charCodeAt(y);return u?w:g}function k(p){return String.fromCharCode.apply(null,new Uint8Array(p))}function $(p,u,y){var v=new Uint8Array(p.byteLength+u.byteLength);return v.set(new Uint8Array(p)),v.set(new Uint8Array(u),p.byteLength),y?v:v.buffer}function A(p){var u,y=[],v=p.length;for(u=0;u<v-1;u+=2)y.push(parseInt(p.substr(u,2),16));return String.fromCharCode.apply(String,y)}function z(){this.reset()}return h(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function p(u,y){return(u=0|u||0)<0?Math.max(u+y,0):Math.min(u,y)}ArrayBuffer.prototype.slice=function(u,y){var v,g,w,B,D=this.byteLength,R=p(u,D),L=D;return y!==t&&(L=p(y,D)),R>L?new ArrayBuffer(0):(v=L-R,g=new ArrayBuffer(v),w=new Uint8Array(g),B=new Uint8Array(this,R,v),w.set(B),g)}}(),z.prototype.append=function(p){return this.appendBinary(m(p)),this},z.prototype.appendBinary=function(p){this._buff+=p,this._length+=p.length;var u,y=this._buff.length;for(u=64;u<=y;u+=64)n(this._hash,o(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},z.prototype.end=function(p){var u,y,v=this._buff,g=v.length,w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<g;u+=1)w[u>>2]|=v.charCodeAt(u)<<(u%4<<3);return this._finish(w,g),y=h(this._hash),p&&(y=A(y)),this.reset(),y},z.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},z.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},z.prototype.setState=function(p){return this._buff=p.buff,this._length=p.length,this._hash=p.hash,this},z.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},z.prototype._finish=function(p,u){var y,v,g,w=u;if(p[w>>2]|=128<<(w%4<<3),w>55)for(n(this._hash,p),w=0;w<16;w+=1)p[w]=0;y=(y=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(y[2],16),g=parseInt(y[1],16)||0,p[14]=v,p[15]=g,n(this._hash,p)},z.hash=function(p,u){return z.hashBinary(m(p),u)},z.hashBinary=function(p,u){var y=h(i(p));return u?A(y):y},z.ArrayBuffer=function(){this.reset()},z.ArrayBuffer.prototype.append=function(p){var u,y=$(this._buff.buffer,p,!0),v=y.length;for(this._length+=p.byteLength,u=64;u<=v;u+=64)n(this._hash,r(y.subarray(u-64,u)));return this._buff=u-64<v?new Uint8Array(y.buffer.slice(u-64)):new Uint8Array(0),this},z.ArrayBuffer.prototype.end=function(p){var u,y,v=this._buff,g=v.length,w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<g;u+=1)w[u>>2]|=v[u]<<(u%4<<3);return this._finish(w,g),y=h(this._hash),p&&(y=A(y)),this.reset(),y},z.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},z.ArrayBuffer.prototype.getState=function(){var p=z.prototype.getState.call(this);return p.buff=k(p.buff),p},z.ArrayBuffer.prototype.setState=function(p){return p.buff=C(p.buff,!0),z.prototype.setState.call(this,p)},z.ArrayBuffer.prototype.destroy=z.prototype.destroy,z.ArrayBuffer.prototype._finish=z.prototype._finish,z.ArrayBuffer.hash=function(p,u){var y=h(s(new Uint8Array(p)));return u?A(y):y},z}()),no.exports),jt=nt(pi);const Ht=[];class se{static addHandler(e,n,o){e.addEventListener?e.addEventListener(n,o,!1):e.attachEvent?e.attachEvent("on"+n,o):e["on"+n]=o}static removeHandler(e,n,o){e.removeEventListener?e.removeEventListener(n,o,!1):e.detachEvent?e.detachEvent("on"+n,o):delete e["on"+n]}static windowResizeHandler(e){se.addHandler(window,"resize",e)}static offWindowResizeHandler(e){se.removeHandler(window,"resize",e)}static fullscreenEnabled(){const e=window.document;return document.fullscreenEnabled||window.fullScreen||e.mozFullscreenEnabled||e.webkitIsFullScreen}static fullScreen(e,n){if(n){const o=window.document;let r=window.document.exitFullscreen||o.msExitFullscreen||o.mozCancelFullScreen||o.webkitCancelFullScreen;typeof r<"u"&&r?r.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let o=e;o||(o=window.document.documentElement);let r=o.requestFullScreen||o.webkitRequestFullScreen||o.mozRequestFullScreen||o.msRequestFullScreen;typeof r<"u"&&r?r.call(o):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(e=window.document.documentElement){let n=e;var o=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(o)o.call(n);else if(typeof window.ActiveXObject<"u"){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static exitFullScreen(){const e=window.document;var n=document.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.webkitExitFullscreen;if(n)n.call(document);else if(typeof window.ActiveXObject<"u"){var o=new window.ActiveXObject("WScript.Shell");o!==null&&o.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!se.fullScreenElement()}static onFullScreenChanged(e){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 o=se.isFullScreen();e(o)}):document.addEventListener("MSFullscreenChange",function(){const o=se.isFullScreen();e(o)})}static stringifyCircularHandler(e,n){if(typeof n=="object"&&n!==null){if(Ht.indexOf(n)!==-1)return;Ht.push(n)}return n}static jsonStringify(e){if(!e)return"";const n=JSON.stringify(e,se.stringifyCircularHandler);return Ht.length=0,n}static jsonParse(e){const n=se.jsonStringify(e);if(n.length>1)return JSON.parse(n)}static getObjectURL(e){let n;const o=window;return o.createObjcectURL!=null?n=o.createOjcectURL(e):window.URL!=null?n=window.URL.createObjectURL(e):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(e)),n}static getFileShortMD5(e,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,c=new jt.ArrayBuffer,h=new FileReader;h.onload=function(m){c.append(m.target?.result);const C=c.end();n({isOK:!0,data:C})},h.onerror=function(){const m="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(m),n({isOK:!1,data:m})},function(){const m=0+s>=i.size?i.size:0+s;h.readAsArrayBuffer(r.call(i,0,m))}()}static getFileMD5(e,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,c=Math.ceil(i.size/s);let h=0;const m=new jt.ArrayBuffer,C=new FileReader;function k(){const $=h*s,A=$+s>=i.size?i.size:$+s;C.readAsArrayBuffer(r.call(i,$,A))}C.onload=function($){if(m.append($.target?.result),h++,h<c)k();else{const A=m.end();n({isOK:!0,data:A})}},C.onerror=function(){const $=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn($),n({isOK:!1,data:$})},k()}static MD5(e,n=!1){return jt.hash(e,n)}static copyTextByCommand(e){return new Promise((n,o)=>{const r=document.createElement("input");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}static copyText=e=>navigator.clipboard?navigator.clipboard.writeText(e).then(function(){return!0},function(n){return!1}):se.copyTextByCommand(e);static copyElementTextByCommand(e){const n=document.createRange();n.selectNode(document.getElementById(e));const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges(),o.addRange(n);try{return document.execCommand("copy"),o.removeRange(n),!0}catch(r){return o.removeRange(n),console.error("Command\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1}}static copyElementText(e){if(!navigator.clipboard)return se.copyElementTextByCommand(e);const n=document.createRange();n.selectNode(document.getElementById(e));const o=window.getSelection();return o.rangeCount>0&&o.removeAllRanges(),o.addRange(n),navigator.clipboard.writeText(o).then(function(){return o.removeRange(n),!0},function(r){return o.removeRange(n),console.error("Clipboard\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1})}static setGrayMode(e){se.toggleClass(e,"grayMode",document.documentElement)}static toggleClass(e,n,o){const r=o||document.body;let{className:i}=r;i=i.replace(n,""),r.className=e?`${i} ${n} `:i}static setCssVar(e,n,o=document.documentElement){o.style.setProperty(e,n)}static dispatchWindowResize(){const e=new Event("resize");window.dispatchEvent(e)}static dispatchElementEvent(e,n="click",o){let r;if(r=tt(e)?document.getElementById(e):e,r){const i=new Event(n,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}static getRandomNum(e,n){var o=n-e,r=Math.random();return e+Math.round(r*o)}static merge(e={},n={}){let o,r,i,s;for(e||(e={}),r=0,i=n.length;r<i;r++)for(o in s=n[r],s)e[o]=s[o];return e}static setOptions(e,n){e.hasOwnProperty("options")||(e.options=e.options?Object.create(e.options):{});for(let o in n)e.options[o]=n[o];return e.options}static formatNum(e,n){let o=Math.pow(10,n===void 0?6:n);return Math.round(e*o)/o}static trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}static splitWords(e){return this.trim(e).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(e,n){let o=null;return function(){o&&clearTimeout(o),o=setTimeout(e,n)}}static throttle(e,n){let o=!0;return function(){if(!o)return!1;o=!1,setTimeout(()=>{e(),o=!0},n)}}static dataURLtoBlob(e){let n=e.split(",");if(!n||n.length===0)return;let o=n[0].match(/:(.*?);/)[1],r=atob(n[1]),i=r.length,s=new Uint8Array(i);for(;i--;)s[i]=r.charCodeAt(i);return new Blob([s],{type:o})}static getElement(e){return typeof e=="string"?document.getElementById(e):e}static getStyle(e,n){let o=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!o||o==="auto")&&document.defaultView){let r=document.defaultView.getComputedStyle(e,null);o=r?r[n]:null}return o==="auto"?null:o}static create(e,n,o){let r=document.createElement(e);return r.className=n||"",o&&o.appendChild(r),r}static removeElement(e){let n=e.parentNode;n&&n.removeChild(e)}static emptyElement(e){for(;e.firstChild;)e.removeChild(e.firstChild)}static hasClass(e,n){if(e.classList!==void 0)return e.classList.contains(n);let o=this.getClass(e);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}static addClass(e,n){if(e.classList!==void 0){let o=this.splitWords(n);for(let r=0,i=o.length;r<i;r++)e.classList.add(o[r])}else if(!this.hasClass(e,n)){let o=this.getClass(e);this.setClass(e,(o?o+" ":"")+n)}}static removeClass(e,n){e.classList!==void 0?e.classList.remove(n):this.setClass(e,this.trim((" "+this.getClass(e)+" ").replace(" "+n+" "," ")))}static setClass(e,n){e.className.baseVal===void 0?e.className=n:e.className.baseVal=n}static getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}static createSvgElement(e,n,o,r){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",e),i.setAttribute("height",n),i.setAttribute("viewBox",`0 0 ${e} ${n}`);let s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",o),i.appendChild(s),r&&r.appendChild(i),i}static parseDom(e,n=!0,o=""){n=n??!1;let r=document.createElement("div");return r.className=o||"",r.innerHTML=e,n?r:r.childNodes}static createVideoHTML(e,n,o){let r=this.create("video",n,o),i=this.create("source","",r);i.setAttribute("src",e),i.setAttribute("type","video/map4");let s=this.create("source","",r);return s.setAttribute("src",e),s.setAttribute("type","video/quicktime"),r}static readFileBytes(e){return new Promise((n,o)=>{const r=new FileReader;r.onload=function(i){const s=r.result,c=s.indexOf("64,"),h=s.substring(c+3);n(h)},r.readAsDataURL(e)})}}class Le{static isNullOrEmpty=e=>e===null||e===""||e===void 0||e.length===0;static isNotEmpty=e=>!(e===null||e===""||e===void 0||e.length===0);static toHump(e){return e.replace(/[\-\/\_](\w)/g,(n,o)=>o.toUpperCase()).replace("views","")}static getFileName(e){const n=e.lastIndexOf("/")+1;let o=e.substring(n);return o=decodeURI(o.split("?")[0]),o}}class ot{prefixKey;storage;constructor(e="",n=localStorage){this.prefixKey=e,this.storage=n}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,n,o=604800){const r=JSON.stringify({value:n,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(e),r)}get(e,n=null){const o=this.storage.getItem(this.getKey(e));if(o)try{const r=JSON.parse(o),{value:i,expire:s}=r;if(s===null||s>=Date.now())return i;this.remove(this.getKey(e))}catch{return n}return n}getJsonObject(e){const n=this.storage.getItem(this.getKey(e));if(n)try{const o=JSON.parse(n);if(o.expire===null||o.expire>=Date.now())return o;this.remove(this.getKey(e))}catch{return}}remove(e){this.storage.removeItem(this.getKey(e))}clear(){this.storage.clear()}setCookie(e,n,o=604800){document.cookie=`${this.getKey(e)}=${n}; Max-Age=${o}`}getCookie(e){const n=document.cookie.split("; ");for(let o=0,r=n.length;o<r;o++){const i=n[o].split("=");if(i[0]===this.getKey(e))return i[1]}return""}removeCookie(e){this.setCookie(e,1,-1)}clearCookie(){const e=document.cookie.match(/[^ =;]+(?==)/g);if(e)for(let n=e.length;n--;)document.cookie=e[n]+"=0;expire="+new Date(0).toUTCString()}}const gi=new ot("",localStorage);function oo(){let t=[];const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const r=Math.floor(16*Math.random());t[n]=e.substring(r,r+1)}t[14]="4";const o=3&Number(t[19])|8;return t[19]=e.substring(o,o+1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function Ft(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function rt(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function qt(t){let e=t.toLowerCase();if(rt(t)){if(e.length===4){let o="#";for(let r=1;r<4;r+=1)o+=e.slice(r,r+1).concat(e.slice(r,r+1));e=o}const n=[];for(let o=1;o<7;o+=2)n.push(parseInt("0x"+e.slice(o,o+2)));return"RGB("+n.join(",")+")"}return e}function Vt(t,e){const n=parseInt(t,16)+e,o=n>255?255:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function ro(t,e,n){const o=[t,e,n].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*o[0]+.7152*o[1]+.0722*o[2]}function Xt(t,e){const n=parseInt(t,16)-e,o=n<0?0:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function Kt(t){return{all:t=t||new Map,on(e,n){const o=t.get(e);o?o.push(n):t.set(e,[n])},off(e,n){const o=t.get(e);o&&(n?o.splice(o.indexOf(n)>>>0,1):t.set(e,[]))},emit(e,n){let o=t.get(e);o&&o.slice().map(r=>{r(n)}),o=t.get("*"),o&&o.slice().map(r=>{r(e,n)})}}}exports.EnumColor=void 0,function(t){t[t.RGBA=0]="RGBA",t[t.Hex=1]="Hex",t[t.Hsla=2]="Hsla"}(exports.EnumColor||(exports.EnumColor={}));const ye=Kt(),te={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetToUnloadEvent:"WidgetToUnloadEvent",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},De=(t,e)=>{const n=document.createElement("a");n.download=e,n.style.display="none";const o=new Blob([t],{type:"application/octet-stream"});n.href=URL.createObjectURL(o),document.body.appendChild(n),n.click(),document.body.removeChild(n)},io=(t,e)=>{const n=JSON.stringify(t,null,2);e?De(n,e+".json"):ye.emit(te.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")};function so(t){return new Promise(e=>setTimeout(e,t))}var ao,Gt={exports:{}},co,lo,Yt,Jt=(ao||(ao=1,lo=Gt.exports,Yt=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(A,z){var p=A[z];if(typeof p.bind=="function")return p.bind(A);try{return Function.prototype.bind.call(p,A)}catch{return function(){return Function.prototype.apply.apply(p,[A,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function h(){for(var A=this.getLevel(),z=0;z<o.length;z++){var p=o[z];this[p]=z<A?t:this.methodFactory(p,A,this.name)}if(this.log=this.debug,typeof console===e&&A<this.levels.SILENT)return"No console available for logging"}function m(A){return function(){typeof console!==e&&(h.call(this),this[A].apply(this,arguments))}}function C(A,z,p){return function(u){return u==="debug"&&(u="log"),typeof console!==e&&(u==="trace"&&n?c:console[u]!==void 0?s(console,u):console.log!==void 0?s(console,"log"):t)}(A)||m.apply(this,arguments)}function k(A,z){var p,u,y,v=this,g="loglevel";function w(){var R;if(typeof window!==e&&g){try{R=window.localStorage[g]}catch{}if(typeof R===e)try{var L=window.document.cookie,U=encodeURIComponent(g),j=L.indexOf(U+"=");j!==-1&&(R=/^([^;]+)/.exec(L.slice(j+U.length+1))[1])}catch{}return v.levels[R]===void 0&&(R=void 0),R}}function B(R){var L=R;if(typeof L=="string"&&v.levels[L.toUpperCase()]!==void 0&&(L=v.levels[L.toUpperCase()]),typeof L=="number"&&L>=0&&L<=v.levels.SILENT)return L;throw new TypeError("log.setLevel() called with invalid level: "+R)}typeof A=="string"?g+=":"+A:typeof A=="symbol"&&(g=void 0),v.name=A,v.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},v.methodFactory=z||C,v.getLevel=function(){return y??u??p},v.setLevel=function(R,L){return y=B(R),L!==!1&&function(U){var j=(o[U]||"silent").toUpperCase();if(typeof window!==e&&g){try{return void(window.localStorage[g]=j)}catch{}try{window.document.cookie=encodeURIComponent(g)+"="+j+";"}catch{}}}(y),h.call(v)},v.setDefaultLevel=function(R){u=B(R),w()||v.setLevel(R,!1)},v.resetLevel=function(){y=null,function(){if(typeof window!==e&&g){try{window.localStorage.removeItem(g)}catch{}try{window.document.cookie=encodeURIComponent(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),h.call(v)},v.enableAll=function(R){v.setLevel(v.levels.TRACE,R)},v.disableAll=function(R){v.setLevel(v.levels.SILENT,R)},v.rebuild=function(){if(i!==v&&(p=B(i.getLevel())),h.call(v),i===v)for(var R in r)r[R].rebuild()},p=B(i?i.getLevel():"WARN");var D=w();D!=null&&(y=B(D)),h.call(v)}(i=new k).getLogger=function(A){if(typeof A!="symbol"&&typeof A!="string"||A==="")throw new TypeError("You must supply a name when creating a logger.");var z=r[A];return z||(z=r[A]=new k(A,i.methodFactory)),z};var $=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=$),i},i.getLoggers=function(){return r},i.default=i,i},(co=Gt).exports?co.exports=Yt():lo.log=Yt()),Gt.exports);class uo{message;eventBus;constructor(e,n=void 0){e&&(this.message=e),n&&(this.eventBus=n)}msg(e,n=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:e,duration:n});else switch(o){case"info":this.message.info(e,n);break;case"success":this.message.success(e,n);break;case"warning":this.message.warn?this.message.warn(e,n):this.message.warning&&this.message.warning(e,n);break;case"error":this.message.error(e,n)}else{switch(o){case"info":case"success":console.log(e);break;case"warning":console.warn(e);break;case"error":o="dark",console.error(e)}this.eventBus&&this.eventBus.emit(te.AlertInfoEvent,{type:o,info:e})}}info(e,n=3){this.msg(e,n,"info")}warn(e,n=3){this.msg(e,n,"warning")}err(e,n=3){this.msg(e,n,"error")}success(e,n=3){this.msg(e,n,"success")}}let ho=!1;const W={Config:SysConfig,EventBus:ye,DefaultProxyClient:null,Axios:ri.default,Message:new uo(void 0,ye),LayoutMap:new Map,getLayoutManager:t=>{if(!W.WidgetConfigList||W.WidgetConfigList.length===0)return;const e=W.WidgetConfigList.find(n=>n.id===t);if(e){const n=e.layoutID;if(n&&W.LayoutMap.has(n))return W.LayoutMap.get(n)}},Logger:t=>{ho||(SysConfig.UI.ProductLog?Jt.enableAll():Jt.setDefaultLevel("warn"),ho=!0);const e=t||"default";return Jt.getLogger(e)}},fo="access_token",Te=new ot("user",localStorage);function we(){return Te.get(fo)}function Zt(){Te.remove(fo)}function po(){return we()?.refresh}function Qt(t,e,n,o="json",r){const i={baseURL:W.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,paramsSerializer:{serialize:function(s){return ii.default.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+we()?.token},responseType:o,cancelToken:r};if(n)for(let s in n)i.headers[s]=n[s];return W.SystemID&&(i.headers.sysid=W.SystemID,W.SystemGroup&&(i.headers.sysgroup=W.SystemGroup)),e!==void 0&&(i.baseURL=e),i}function le(t,e,n,o,r="json",i,s){const c=Qt(n,e,o,r,i);return s&&s>=2e4&&(c.timeout=s),W.Axios?.get(t,c).catch(function(h){it(h,c.baseURL,t,"Get")})}function it(t,e,n,o="Get"){const r=`${e}${n}`;if(t&&t.response){let i=!1;const s=t.response.status;switch(s){case 400:t.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:t.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:t.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:t.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:t.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:t.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const h=t.response.data;if(h){const m=h.indexOf(":"),C=h.indexOf(`
|
|
2
|
-
`);if(
|
|
3
|
-
`),i=0;i<r.length;i++){var s=r[i],c=s.indexOf(":"),h=t(s.slice(0,c)).toLowerCase(),m=t(s.slice(c+1));o[h]===void 0?o[h]=m:(n=o[h],Object.prototype.toString.call(n)==="[object Array]"?o[h].push(m):o[h]=[o[h],m])}return o},tn}var wi=function(){if(Co)return st.exports;Co=1;var t=mi(),e=vi(),n=yi(),o=function(){if(So)return nn;So=1,nn=function(){for(var h={},m=0;m<arguments.length;m++){var C=arguments[m];for(var k in C)c.call(C,k)&&(h[k]=C[k])}return h};var c=Object.prototype.hasOwnProperty;return nn}();function r(c,h,m){var C=c;return e(h)?(m=h,typeof c=="string"&&(C={uri:c})):C=o(h,{uri:c}),C.callback=m,C}function i(c,h,m){return s(h=r(c,h,m))}function s(c){if(c.callback===void 0)throw new Error("callback argument missing");var h=!1,m=function(L,U,j){h||(h=!0,c.callback(L,U,j))};function C(){var L=void 0;if(L=p.response?p.response:p.responseText||function(U){try{if(U.responseType==="document")return U.responseXML;var j=U.responseXML&&U.responseXML.documentElement.nodeName==="parsererror";if(U.responseType===""&&!j)return U.responseXML}catch{}return null}(p),D)try{L=JSON.parse(L)}catch{}return L}function k(L){return clearTimeout(u),L instanceof Error||(L=new Error(""+(L||"Unknown XMLHttpRequest Error"))),L.statusCode=0,m(L,R)}function $(){if(!z){var L;clearTimeout(u),L=c.useXDR&&p.status===void 0?200:p.status===1223?204:p.status;var U=R,j=null;return L!==0?(U={body:C(),statusCode:L,method:v,headers:{},url:y,rawRequest:p},p.getAllResponseHeaders&&(U.headers=n(p.getAllResponseHeaders()))):j=new Error("Internal XMLHttpRequest Error"),m(j,U,U.body)}}var A,z,p=c.xhr||null;p||(p=c.cors||c.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var u,y=p.url=c.uri||c.url,v=p.method=c.method||"GET",g=c.body||c.data,w=p.headers=c.headers||{},B=!!c.sync,D=!1,R={body:void 0,headers:{},statusCode:0,method:v,url:y,rawRequest:p};if("json"in c&&c.json!==!1&&(D=!0,w.accept||w.Accept||(w.Accept="application/json"),v!=="GET"&&v!=="HEAD"&&(w["content-type"]||w["Content-Type"]||(w["Content-Type"]="application/json"),g=JSON.stringify(c.json===!0?g:c.json))),p.onreadystatechange=function(){p.readyState===4&&setTimeout($,0)},p.onload=$,p.onerror=k,p.onprogress=function(){},p.onabort=function(){z=!0},p.ontimeout=k,p.open(v,y,!B,c.username,c.password),B||(p.withCredentials=!!c.withCredentials),!B&&c.timeout>0&&(u=setTimeout(function(){if(!z){z=!0,p.abort("timeout");var L=new Error("XMLHttpRequest timeout");L.code="ETIMEDOUT",k(L)}},c.timeout)),p.setRequestHeader)for(A in w)w.hasOwnProperty(A)&&p.setRequestHeader(A,w[A]);else if(c.headers&&!function(L){for(var U in L)if(L.hasOwnProperty(U))return!1;return!0}(c.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in c&&(p.responseType=c.responseType),"beforeSend"in c&&typeof c.beforeSend=="function"&&c.beforeSend(p),p.send(g||null),p}return st.exports=i,st.exports.default=i,i.XMLHttpRequest=t.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:t.XDomainRequest,function(c,h){for(var m=0;m<c.length;m++)h(c[m])}(["get","put","post","patch","head","delete"],function(c){i[c==="delete"?"del":c]=function(h,m,C){return(m=r(h,m,C)).method=c.toUpperCase(),s(m)}}),st.exports}(),bi=nt(wi);const _i=[200,201,202,204,308],Si=[408,502,503,504];class Eo{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.fileName=encodeURI(this.file.name),this.headers=e.headers||{},this.method=e.method||"PUT",this.chunkSize=e.chunkSize||5120,this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.md5=e.md5||"",this.maxFileBytes=1024*(e.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=Kt(),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(e,n){this.eventTarget.on(e,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(e,n){this.eventTarget.emit(e,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(e=>(this.endpointValue=e,this.endpointValue))}getChunk(){return new Promise(e=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,o=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),e(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+n))})}xhrPromise(e){const n=o=>{o.upload.onprogress=r=>{const i=100/this.totalChunks,s=i*this.file.size,c=i*this.chunkCount,h=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(c+h,100))}};return new Promise((o,r)=>{this.currentXhr=bi({...e,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const e=this.chunkCount*this.chunkByteSize,n=e+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${e}-${n}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:o,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(){console.log(this.paused,this.offline,this.success,"sendChunks this.paused || this.offline || this.success"),!(this.paused||this.offline||this.success)&&this.getChunk().then(()=>this.sendChunk()).then(e=>{if(this.attemptCount=this.attemptCount+1,e!=null&&_i.includes(e.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:e}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const n=this.chunkCount/this.totalChunks*this.file.size*100/this.file.size;this.dispatch("progress",n)}else if(e!=null&&Si.includes(e.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(e=>{this.paused||this.offline||this.manageRetries()})}}const Ci=new class{hasClass(t,e){return t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}addClass(t,e){this.hasClass(t,e)||(t.className+=" "+e)}removeClass(t,e){if(this.hasClass(t,e)){const n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}toggleClass(t,e){this.hasClass(t,e)?this.removeClass(t,e):this.addClass(t,e)}setCSSProperty(t,e,n){t?.style.setProperty(e,n)}};class qe{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!Le.isNullOrEmpty(e)){if(qe.httpTransport||(qe.httpTransport=new oi.HttpTransport),this.client=new Ge.Client(e),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=e,this.init()}}init(){this.client&&this.client.useServiceAsync().then(e=>{this.hproseProxy=e}).catch(e=>{String(e).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):ye.emit(te.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(e)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(e){console.warn(e),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(e,n,o){if(this.client)return await this.client.invoke(e,n,o)}encode(e,n,o){if(this.client)return this.client.codec.encode(e,n,o)}decode(e,n){if(this.client)return this.client.codec.decode(e,n)}}class Ae{hproseClient;hpProxyObj;defaultContext=new Ge.ClientContext;constructor(e){this.hproseClient=new qe(e),this.hpProxyObj=null}getClientContext(e,n){const o={};n&&(o.requestHeaders=n);const r=we();o.httpRequestHeaders=e||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),W.SystemID&&(i.sysid=W.SystemID,W.SystemGroup&&(i.sysgroup=W.SystemGroup)),new Ge.ClientContext(o)}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 e=await this.hproseClient.getProxy();this.hpProxyObj=e}return this.hpProxyObj||ye.emit(te.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,n,o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(e,n,o)}async hproseInvokeContext(e,n,...o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=we();return console.log(r,"userToken3"),r&&(n||(n=new Ge.ClientContext({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(e,o,n)}async hproseInvokeEncode(e){const n=new re.ByteStream(e).toBytes(),o=await this.hproseClient.client?.request(n,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(e,...n){const o=this.hproseClient.client?.codec?.encode(e,n,this.defaultContext);return re.ByteStream.toString(o)}}const on=new Map;function ko(t){if(t&&Le.isNotEmpty(t)){if(on.has(t))return on.get(t);{const e=new Ae(t);return on.set(t,e),e}}}const be=l.reactive({isLock:!1,lockTime:0});function at(t){be.isLock=t,t&&(Zt(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}let rn;function Be(){clearInterval(rn),!(window.location.href.indexOf("/login")>0||be.isLock)&&(at(!1),be.lockTime=function(){let t=3600;return W.Config.UI?.LockTime&&W.Config.UI?.LockTime>=10&&(t=W.Config.UI.LockTime),t}(),rn=setInterval(()=>{if(be.lockTime--,be.lockTime<=0)return at(!0),clearInterval(rn)},1e3))}function sn(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var xo,Io={exports:{}};/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var p=require("vue"),Ns=require("axios"),$s=require("qs"),Lt=require("@hprose/rpc-core"),ve=require("@hprose/io"),Ws=require("@hprose/rpc-html5"),Ln=require("@iconify/vue");function uo(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var Us=uo(Ns),js=uo($s),Os={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((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.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(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((r,o)=>(r.size=o===e?r.max:r.min,o!==e&&(n+=r.min),r)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e])},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:r}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:r-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),100*t/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const r=0+(this.pushOtherPanes?0:n.prevPanesSize),o=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(t),o),r);let s=[e,e+1],a=this.panes[s[0]]||null,c=this.panes[s[1]]||null;const u=a.max<100&&i>=a.max+n.prevPanesSize,g=c.max<100&&i<=100-(c.max+this.sumNextPanesSize(e+1));if(u||g)u?(a.size=a.max,c.size=Math.max(100-a.max-n.prevPanesSize-n.nextPanesSize,0)):(a.size=Math.max(100-c.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),c.size=c.max);else{if(this.pushOtherPanes){const _=this.doPushOtherPanes(n,i);if(!_)return;({sums:n,panesToResize:s}=_),a=this.panes[s[0]]||null,c=this.panes[s[1]]||null}a!==null&&(a.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,a.min),a.max)),c!==null&&(c.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,c.min),c.max))}},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,r=[n,n+1];return e<t.prevPanesSize+this.panes[r[0]].min&&(r[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,r[0]<n&&this.panes.forEach((o,i)=>{i>r[0]&&i<=n&&(o.size=o.min,t.prevReachedMinPanes+=o.min)}),t.prevPanesSize=this.sumPrevPanesSize(r[0]),r[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((o,i)=>{i>0&&i<=n&&(o.size=o.min,t.prevReachedMinPanes+=o.min)}),this.panes[r[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[r[1]].min&&(r[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,r[1]>n+1&&this.panes.forEach((o,i)=>{i>n&&i<r[1]&&(o.size=o.min,t.nextReachedMinPanes+=o.min)}),t.nextPanesSize=this.sumNextPanesSize(r[1]-1),r[1]===void 0)?(t.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((o,i)=>{i<this.panesCount-1&&i>=n+1&&(o.size=o.min,t.nextReachedMinPanes+=o.min)}),this.panes[r[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:r}},sumPrevPanesSize(t){return this.panes.reduce((e,n,r)=>e+(r<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,r)=>e+(r>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.index<t&&e.size>e.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");if(!e&&!n)return t.parentNode.removeChild(t),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(t,e,n=!1){const r=t-1,o=document.createElement("div");o.classList.add("splitpanes__splitter"),n||(o.onmousedown=i=>this.onMouseDown(i,r),typeof window<"u"&&"ontouchstart"in window&&(o.ontouchstart=i=>this.onMouseDown(i,r)),o.onclick=i=>this.onSplitterClick(i,r+1)),this.dblClickSplitter&&(o.ondblclick=i=>this.onSplitterDblClick(i,r+1)),e.parentNode.insertBefore(o,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([r,o])=>n[r]=o)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(o=>(o.className.includes("splitpanes__pane")&&e++,o===t.$el));const n=parseFloat(t.minSize),r=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(r)?100:r,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((o,i)=>o.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(r=>r.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((r,o)=>r.index=o),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},resetPaneSizes(t={}){t.addedPane||t.removedPane?this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],r=[];this.panes.forEach(o=>{o.size=Math.max(Math.min(t,o.max),o.min),e-=o.size,o.size>=o.max&&n.push(o.id),o.size<=o.min&&r.push(o.id)}),e>.1&&this.readjustSizes(e,n,r)},initialPanesSizing(){let t=100;const e=[],n=[];let r=0;this.panes.forEach(i=>{t-=i.size,i.size!==null&&r++,i.size>=i.max&&e.push(i.id),i.size<=i.min&&n.push(i.id)});let o=100;t>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(t/(this.panesCount-r),i.max),i.min)),o-=i.size}),o>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t}={}){let e=100/this.panesCount,n=0;const r=[],o=[];t&&t.givenSize!==null&&(e=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(i=>{n-=i.size,i.size>=i.max&&r.push(i.id),i.size<=i.min&&o.push(i.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(i=>{t&&t.givenSize!==null&&t.id===i.id||(i.size=Math.max(Math.min(e,i.max),i.min)),n-=i.size,i.size>=i.max&&r.push(i.id),i.size<=i.min&&o.push(i.id)}),n>.1&&this.readjustSizes(n,r,o))},readjustSizes(t,e,n){let r;r=t>0?t/(this.panesCount-e.length):t/(this.panesCount-n.length),this.panes.forEach(o=>{if(t>0&&!e.includes(o.id)){const i=Math.max(Math.min(o.size+r,o.max),o.min),s=i-o.size;t-=s,o.size=i}else if(!n.includes(o.id)){const i=Math.max(Math.min(o.size+r,o.max),o.min),s=i-o.size;t-=s,o.size=i}o.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[o.id].size}%`})}),Math.abs(t)>.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(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?r=>this.onSplitterDblClick(r,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 p.h("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},Nn={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(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function $n(t){return window.TouchEvent&&t instanceof TouchEvent}Nn.render=function(t,e,n,r,o,i){return p.openBlock(),p.createElementBlock("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=s=>i.onPaneClick(s,t._.uid)),style:p.normalizeStyle(t.style)},[p.renderSlot(t.$slots,"default")],4)},Nn.__file="src/controls/splitpanes/pane.vue";class be{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return $n(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return $n(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new jr(this.clientX,this.clientY)}static bindDown(e,n,r,o=!1){const i=a=>{n(new be(a))},s=a=>{a.touches.length===1&&n(new be(a)),a.touches.length>1&&r&&r(new be(a))};return e.addEventListener("mousedown",i,o),e.addEventListener("touchstart",s,o),()=>{e.removeEventListener("mousedown",i,o),e.removeEventListener("touchstart",s,o)}}static bindMove(e,n,r=!1){const o=s=>{n(new be(s))},i=s=>{s.touches.length===1&&n(new be(s))};return e.addEventListener("mousemove",o,r),e.addEventListener("touchmove",i,r),()=>{e.removeEventListener("mousemove",o,r),e.removeEventListener("touchmove",i,r)}}static bindUp(e,n,r=!1){const o=s=>{n(new be(s))},i=s=>{s.touches.length===0&&n(new be(s))};return e.addEventListener("mouseup",o,r),e.addEventListener("touchend",i,r),()=>{e.removeEventListener("mouseup",o,r),e.removeEventListener("touchend",i,r)}}originalEvent({mouse:e,touch:n}){$n(this.e)?n&&n(this.e):e&&e(this.e)}}class jr{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new jr(this.x,this.y)}}class Fs{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,r={}){this.handle=e,this.container=n,this.options=r,e&&(this.unbindDown=be.bindDown(e,this.mousedown),e.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=e=>{e.preventDefault(),this.handle&&(this.offsetX=e.clientX,this.offsetY=e.clientY),this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=be.bindMove(document,this.mousemove),this.unbindUp=be.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=`calc(${e.clientX-this.offsetX}px + ${this.container.style.left})`,this.container.style.top=`calc(${e.clientY-this.offsetY}px + ${this.container.style.top})`,this.offsetX=e.clientX,this.offsetY=e.clientY),this.options.onMove&&this.options.onMove()};mouseup=e=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Hs{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(r=>r.push(this))}set group(e){this._group=e;const n=$t(this._group),r=$t(e);n.splice(n.indexOf(this),1),r.push(this),fo()}get group(){return this._group}unregister(){this.a(e=>e.splice(e.indexOf(this),1))}raise(){this.a(e=>{e.splice(e.indexOf(this),1),e.push(this)})}a(e){e($t(this._group)),fo()}}const Nt=new Map,qs=0;function $t(t){return Nt.has(t)||Nt.set(t,[]),Nt.get(t)}function ho(t,e){return t>e?-ho(e,t):t<0&&e>=0?1:t-e}function fo(){let t=qs;for(const e of function(n){const r=[];return n.forEach((o,i)=>r.push(i)),r}(Nt).sort(ho))for(const n of $t(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function Wn(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const r=Wt(t);return t.style.width=e,t.style.height=n,r}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function Wt(t){const e=t.getBoundingClientRect(),n=e.width,r=e.height,o=e.top,i=e.left;return{width:n,height:r,top:o,left:i,bottom:o+r,right:i+n}}class Vs{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=po.map(c=>new c(e,this));const{width:r,height:o}=Wn(e),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let a=!1;(r<n.minWidth||r>i)&&(e.style.width=`${go(r,n.minWidth,i)}px`,a=!0),(o<n.minHeight||o>s)&&(e.style.height=`${go(o,n.minHeight,s)}px`,a=!0),a&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const po=[];class We{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=be.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=e=>{e.preventDefault(),e.stopPropagation();const{left:n,top:r,width:o,height:i}=Wt(this.container);this.x0=e.clientX,this.y0=e.clientY,this.left0=n,this.top0=r,this.width0=o,this.height0=i,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=be.bindMove(document,this.mousemove),this.unbindUp=be.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:r,bottom:o}=Wt(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,a=i.maxHeight||window.innerHeight;this.minLeft=Math.max(r-s,0),this.maxLeft=r-i.minWidth,this.minRight=e+i.minWidth,this.maxRight=Math.min(e+s,window.innerWidth),this.minTop=Math.max(o-a,0),this.maxTop=o-i.minHeight,this.minBottom=n+i.minHeight,this.maxBottom=Math.min(n+a,window.innerHeight)}mousemove=e=>{e.preventDefault(),e.stopPropagation(),this.setPosition(e),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:e,height:n,left:r,top:o,right:i,bottom:s}=Wt(this.container),a=this.helper.options;a&&(r<this.minLeft?(this.container.style.width=e+r-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):r>this.maxLeft?(this.container.style.width=`${a.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):i<this.minRight?this.container.style.width=`${a.minWidth}px`:i>this.maxRight&&(this.container.style.width=this.maxRight-r+"px"),o<this.minTop?(this.container.style.height=n+o-this.minTop+"px",this.container.style.top=`${this.minTop}px`):o>this.maxTop?(this.container.style.height=`${a.minHeight}px`,this.container.style.top=`${this.maxTop}px`):s<this.minBottom?this.container.style.height=`${a.minHeight}px`:s>this.maxBottom&&(this.container.style.height=this.maxBottom-o+"px"))}mouseup=e=>{e.preventDefault(),e.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const e=document.createElement("div"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function go(t,e,n){return t<e?e:t>n?n:t}po.push(class extends We{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.right=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="nwse-resize"}},class extends We{setPosition(t){this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.right=`${this.handleSize}px`,t.left=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="ns-resize"}},class extends We{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends We{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.top=`${this.handleSize}px`,t.cursor="ew-resize"}},class extends We{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.top=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nwse-resize"}},class extends We{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=`${this.handleSize}px`,t.right=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.top=-this.handleSize+"px",t.cursor="ns-resize"}},class extends We{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px",this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=-this.handleSize+"px",t.height=2*this.handleSize+"px",t.width=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends We{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=`${this.handleSize}px`,t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.cursor="ew-resize"}});var Ut=p.defineComponent({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=p.ref(!1),n=p.ref(!1);return{hover:e,active:n,style:function(){let r=t.windowStyle.button;return e.value&&(r={...r,...this.windowStyle.buttonHover}),n.value&&(r={...r,...this.windowStyle.buttonActive}),r},mouseup:function(r){this.active&&this.$emit("click")},mousedown:function(r){r.preventDefault(),n.value=!0;const o=be.bindUp(document,()=>{n.value=!1,o()})}}}});const Xs=["disabled"];Ut.render=function(t,e,n,r,o,i){return p.openBlock(),p.createElementBlock("div",{class:"btn",style:p.normalizeStyle(t.style()),onMouseenter:e[0]||(e[0]=s=>t.hover=!0),onMouseleave:e[1]||(e[1]=s=>t.hover=!1),onMousedown:e[2]||(e[2]=p.withModifiers((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onTouchstart:e[3]||(e[3]=p.withModifiers((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onMouseup:e[4]||(e[4]=(...s)=>t.mouseup&&t.mouseup(...s)),onTouchend:e[5]||(e[5]=(...s)=>t.mouseup&&t.mouseup(...s)),disabled:t.disabled},[p.renderSlot(t.$slots,"default")],44,Xs)},Ut.__scopeId="data-v-71662210",Ut.__file="src/controls/vuewindow/window/Button.vue";var nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mo,vo={exports:{}},Gs=(mo||(mo=1,vo.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(d,h){var b=d[0],v=d[1],f=d[2],w=d[3];v=((v+=((f=((f+=((w=((w+=((b=((b+=(v&f|~v&w)+h[0]-680876936|0)<<7|b>>>25)+v|0)&v|~b&f)+h[1]-389564586|0)<<12|w>>>20)+b|0)&b|~w&v)+h[2]+606105819|0)<<17|f>>>15)+w|0)&w|~f&b)+h[3]-1044525330|0)<<22|v>>>10)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v&f|~v&w)+h[4]-176418897|0)<<7|b>>>25)+v|0)&v|~b&f)+h[5]+1200080426|0)<<12|w>>>20)+b|0)&b|~w&v)+h[6]-1473231341|0)<<17|f>>>15)+w|0)&w|~f&b)+h[7]-45705983|0)<<22|v>>>10)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v&f|~v&w)+h[8]+1770035416|0)<<7|b>>>25)+v|0)&v|~b&f)+h[9]-1958414417|0)<<12|w>>>20)+b|0)&b|~w&v)+h[10]-42063|0)<<17|f>>>15)+w|0)&w|~f&b)+h[11]-1990404162|0)<<22|v>>>10)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v&f|~v&w)+h[12]+1804603682|0)<<7|b>>>25)+v|0)&v|~b&f)+h[13]-40341101|0)<<12|w>>>20)+b|0)&b|~w&v)+h[14]-1502002290|0)<<17|f>>>15)+w|0)&w|~f&b)+h[15]+1236535329|0)<<22|v>>>10)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v&w|f&~w)+h[1]-165796510|0)<<5|b>>>27)+v|0)&f|v&~f)+h[6]-1069501632|0)<<9|w>>>23)+b|0)&v|b&~v)+h[11]+643717713|0)<<14|f>>>18)+w|0)&b|w&~b)+h[0]-373897302|0)<<20|v>>>12)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v&w|f&~w)+h[5]-701558691|0)<<5|b>>>27)+v|0)&f|v&~f)+h[10]+38016083|0)<<9|w>>>23)+b|0)&v|b&~v)+h[15]-660478335|0)<<14|f>>>18)+w|0)&b|w&~b)+h[4]-405537848|0)<<20|v>>>12)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v&w|f&~w)+h[9]+568446438|0)<<5|b>>>27)+v|0)&f|v&~f)+h[14]-1019803690|0)<<9|w>>>23)+b|0)&v|b&~v)+h[3]-187363961|0)<<14|f>>>18)+w|0)&b|w&~b)+h[8]+1163531501|0)<<20|v>>>12)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v&w|f&~w)+h[13]-1444681467|0)<<5|b>>>27)+v|0)&f|v&~f)+h[2]-51403784|0)<<9|w>>>23)+b|0)&v|b&~v)+h[7]+1735328473|0)<<14|f>>>18)+w|0)&b|w&~b)+h[12]-1926607734|0)<<20|v>>>12)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v^f^w)+h[5]-378558|0)<<4|b>>>28)+v|0)^v^f)+h[8]-2022574463|0)<<11|w>>>21)+b|0)^b^v)+h[11]+1839030562|0)<<16|f>>>16)+w|0)^w^b)+h[14]-35309556|0)<<23|v>>>9)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v^f^w)+h[1]-1530992060|0)<<4|b>>>28)+v|0)^v^f)+h[4]+1272893353|0)<<11|w>>>21)+b|0)^b^v)+h[7]-155497632|0)<<16|f>>>16)+w|0)^w^b)+h[10]-1094730640|0)<<23|v>>>9)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v^f^w)+h[13]+681279174|0)<<4|b>>>28)+v|0)^v^f)+h[0]-358537222|0)<<11|w>>>21)+b|0)^b^v)+h[3]-722521979|0)<<16|f>>>16)+w|0)^w^b)+h[6]+76029189|0)<<23|v>>>9)+f|0,v=((v+=((f=((f+=((w=((w+=((b=((b+=(v^f^w)+h[9]-640364487|0)<<4|b>>>28)+v|0)^v^f)+h[12]-421815835|0)<<11|w>>>21)+b|0)^b^v)+h[15]+530742520|0)<<16|f>>>16)+w|0)^w^b)+h[2]-995338651|0)<<23|v>>>9)+f|0,v=((v+=((w=((w+=(v^((b=((b+=(f^(v|~w))+h[0]-198630844|0)<<6|b>>>26)+v|0)|~f))+h[7]+1126891415|0)<<10|w>>>22)+b|0)^((f=((f+=(b^(w|~v))+h[14]-1416354905|0)<<15|f>>>17)+w|0)|~b))+h[5]-57434055|0)<<21|v>>>11)+f|0,v=((v+=((w=((w+=(v^((b=((b+=(f^(v|~w))+h[12]+1700485571|0)<<6|b>>>26)+v|0)|~f))+h[3]-1894986606|0)<<10|w>>>22)+b|0)^((f=((f+=(b^(w|~v))+h[10]-1051523|0)<<15|f>>>17)+w|0)|~b))+h[1]-2054922799|0)<<21|v>>>11)+f|0,v=((v+=((w=((w+=(v^((b=((b+=(f^(v|~w))+h[8]+1873313359|0)<<6|b>>>26)+v|0)|~f))+h[15]-30611744|0)<<10|w>>>22)+b|0)^((f=((f+=(b^(w|~v))+h[6]-1560198380|0)<<15|f>>>17)+w|0)|~b))+h[13]+1309151649|0)<<21|v>>>11)+f|0,v=((v+=((w=((w+=(v^((b=((b+=(f^(v|~w))+h[4]-145523070|0)<<6|b>>>26)+v|0)|~f))+h[11]-1120210379|0)<<10|w>>>22)+b|0)^((f=((f+=(b^(w|~v))+h[2]+718787259|0)<<15|f>>>17)+w|0)|~b))+h[9]-343485551|0)<<21|v>>>11)+f|0,d[0]=b+d[0]|0,d[1]=v+d[1]|0,d[2]=f+d[2]|0,d[3]=w+d[3]|0}function r(d){var h,b=[];for(h=0;h<64;h+=4)b[h>>2]=d.charCodeAt(h)+(d.charCodeAt(h+1)<<8)+(d.charCodeAt(h+2)<<16)+(d.charCodeAt(h+3)<<24);return b}function o(d){var h,b=[];for(h=0;h<64;h+=4)b[h>>2]=d[h]+(d[h+1]<<8)+(d[h+2]<<16)+(d[h+3]<<24);return b}function i(d){var h,b,v,f,w,B,D=d.length,R=[1732584193,-271733879,-1732584194,271733878];for(h=64;h<=D;h+=64)n(R,r(d.substring(h-64,h)));for(b=(d=d.substring(h-64)).length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0;h<b;h+=1)v[h>>2]|=d.charCodeAt(h)<<(h%4<<3);if(v[h>>2]|=128<<(h%4<<3),h>55)for(n(R,v),h=0;h<16;h+=1)v[h]=0;return f=(f=8*D).toString(16).match(/(.*?)(.{0,8})$/),w=parseInt(f[2],16),B=parseInt(f[1],16)||0,v[14]=w,v[15]=B,n(R,v),R}function s(d){var h,b,v,f,w,B,D=d.length,R=[1732584193,-271733879,-1732584194,271733878];for(h=64;h<=D;h+=64)n(R,o(d.subarray(h-64,h)));for(b=(d=h-64<D?d.subarray(h-64):new Uint8Array(0)).length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0;h<b;h+=1)v[h>>2]|=d[h]<<(h%4<<3);if(v[h>>2]|=128<<(h%4<<3),h>55)for(n(R,v),h=0;h<16;h+=1)v[h]=0;return f=(f=8*D).toString(16).match(/(.*?)(.{0,8})$/),w=parseInt(f[2],16),B=parseInt(f[1],16)||0,v[14]=w,v[15]=B,n(R,v),R}function a(d){var h,b="";for(h=0;h<4;h+=1)b+=e[d>>8*h+4&15]+e[d>>8*h&15];return b}function c(d){var h;for(h=0;h<d.length;h+=1)d[h]=a(d[h]);return d.join("")}function u(d){return/[\u0080-\uFFFF]/.test(d)&&(d=unescape(encodeURIComponent(d))),d}function g(d,h){var b,v=d.length,f=new ArrayBuffer(v),w=new Uint8Array(f);for(b=0;b<v;b+=1)w[b]=d.charCodeAt(b);return h?w:f}function _(d){return String.fromCharCode.apply(null,new Uint8Array(d))}function x(d,h,b){var v=new Uint8Array(d.byteLength+h.byteLength);return v.set(new Uint8Array(d)),v.set(new Uint8Array(h),d.byteLength),b?v:v.buffer}function T(d){var h,b=[],v=d.length;for(h=0;h<v-1;h+=2)b.push(parseInt(d.substr(h,2),16));return String.fromCharCode.apply(String,b)}function z(){this.reset()}return c(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function d(h,b){return(h=0|h||0)<0?Math.max(h+b,0):Math.min(h,b)}ArrayBuffer.prototype.slice=function(h,b){var v,f,w,B,D=this.byteLength,R=d(h,D),k=D;return b!==t&&(k=d(b,D)),R>k?new ArrayBuffer(0):(v=k-R,f=new ArrayBuffer(v),w=new Uint8Array(f),B=new Uint8Array(this,R,v),w.set(B),f)}}(),z.prototype.append=function(d){return this.appendBinary(u(d)),this},z.prototype.appendBinary=function(d){this._buff+=d,this._length+=d.length;var h,b=this._buff.length;for(h=64;h<=b;h+=64)n(this._hash,r(this._buff.substring(h-64,h)));return this._buff=this._buff.substring(h-64),this},z.prototype.end=function(d){var h,b,v=this._buff,f=v.length,w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(h=0;h<f;h+=1)w[h>>2]|=v.charCodeAt(h)<<(h%4<<3);return this._finish(w,f),b=c(this._hash),d&&(b=T(b)),this.reset(),b},z.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},z.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},z.prototype.setState=function(d){return this._buff=d.buff,this._length=d.length,this._hash=d.hash,this},z.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},z.prototype._finish=function(d,h){var b,v,f,w=h;if(d[w>>2]|=128<<(w%4<<3),w>55)for(n(this._hash,d),w=0;w<16;w+=1)d[w]=0;b=(b=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(b[2],16),f=parseInt(b[1],16)||0,d[14]=v,d[15]=f,n(this._hash,d)},z.hash=function(d,h){return z.hashBinary(u(d),h)},z.hashBinary=function(d,h){var b=c(i(d));return h?T(b):b},z.ArrayBuffer=function(){this.reset()},z.ArrayBuffer.prototype.append=function(d){var h,b=x(this._buff.buffer,d,!0),v=b.length;for(this._length+=d.byteLength,h=64;h<=v;h+=64)n(this._hash,o(b.subarray(h-64,h)));return this._buff=h-64<v?new Uint8Array(b.buffer.slice(h-64)):new Uint8Array(0),this},z.ArrayBuffer.prototype.end=function(d){var h,b,v=this._buff,f=v.length,w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(h=0;h<f;h+=1)w[h>>2]|=v[h]<<(h%4<<3);return this._finish(w,f),b=c(this._hash),d&&(b=T(b)),this.reset(),b},z.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},z.ArrayBuffer.prototype.getState=function(){var d=z.prototype.getState.call(this);return d.buff=_(d.buff),d},z.ArrayBuffer.prototype.setState=function(d){return d.buff=g(d.buff,!0),z.prototype.setState.call(this,d)},z.ArrayBuffer.prototype.destroy=z.prototype.destroy,z.ArrayBuffer.prototype._finish=z.prototype._finish,z.ArrayBuffer.hash=function(d,h){var b=c(s(new Uint8Array(d)));return h?T(b):b},z}()),vo.exports),Un=jt(Gs);const yo=Object.prototype.toString;function ye(t,e){return yo.call(t)===`[object ${e}]`}function Ot(t){return ye(t,"Function")}const wo=t=>typeof t<"u",jn=t=>!wo(t);function On(t){return t===null}const Fe=t=>t!=null&&t!==null&&ye(t,"Object");function Fn(t){return ye(t,"Number")}function rt(t){return ye(t,"String")}function Ft(t){return t&&Array.isArray(t)}const bo=t=>yo.call(t).startsWith("[object HTML")&&!!t.tagName,Ks=typeof window>"u",_o=t=>/^(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(t);function So(t){return/^\s*[{[]/.test(String(t))}function Co(t){return t.includes("<kml ")&&t.includes('xmlns="http://www.opengis.net/kml/')}const Hn=[];let Ht;class se{static addHandler(e,n,r){e.addEventListener?e.addEventListener(n,r,!1):e.attachEvent?e.attachEvent("on"+n,r):e["on"+n]=r}static removeHandler(e,n,r){e.removeEventListener?e.removeEventListener(n,r,!1):e.detachEvent?e.detachEvent("on"+n,r):delete e["on"+n]}static windowResizeHandler(e){se.addHandler(window,"resize",e)}static offWindowResizeHandler(e){se.removeHandler(window,"resize",e)}static fullscreenEnabled(){const e=window.document;return document.fullscreenEnabled||window.fullScreen||e.mozFullscreenEnabled||e.webkitIsFullScreen}static fullScreen(e,n){if(n){const r=window.document;let o=window.document.exitFullscreen||r.msExitFullscreen||r.mozCancelFullScreen||r.webkitCancelFullScreen;typeof o<"u"&&o?o.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let r=e;r||(r=window.document.documentElement);let o=r.requestFullScreen||r.webkitRequestFullScreen||r.mozRequestFullScreen||r.msRequestFullScreen;typeof o<"u"&&o?o.call(r):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(e=window.document.documentElement){let n=e;var r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(r)r.call(n);else if(typeof window.ActiveXObject<"u"){var o=new window.ActiveXObject("WScript.Shell");o!==null&&o.SendKeys("{F11}")}}static exitFullScreen(){const e=window.document;var n=document.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.webkitExitFullscreen;if(n)n.call(document);else if(typeof window.ActiveXObject<"u"){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!se.fullScreenElement()}static onFullScreenChanged(e){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 r=se.isFullScreen();e(r)}):document.addEventListener("MSFullscreenChange",function(){const r=se.isFullScreen();e(r)})}static stringifyCircularHandler(e,n){if(typeof n=="object"&&n!==null){if(Hn.indexOf(n)!==-1)return;Hn.push(n)}return n}static jsonStringify(e){if(!e)return"";const n=JSON.stringify(e,se.stringifyCircularHandler);return Hn.length=0,n}static jsonParse(e){const n=se.jsonStringify(e);if(n.length>1)return JSON.parse(n)}static getObjectURL(e){let n;const r=window;return r.createObjcectURL!=null?n=r.createOjcectURL(e):window.URL!=null?n=window.URL.createObjectURL(e):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(e)),n}static getFileShortMD5(e,n){const r=File.prototype,o=r.slice||r.mozSlice||r.webkitSlice,i=e,s=2097152,a=new Un.ArrayBuffer,c=new FileReader;c.onload=function(u){a.append(u.target?.result);const g=a.end();n({isOK:!0,data:g})},c.onerror=function(){const u="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(u),n({isOK:!1,data:u})},function(){const u=0+s>=i.size?i.size:0+s;c.readAsArrayBuffer(o.call(i,0,u))}()}static getFileMD5(e,n){const r=File.prototype,o=r.slice||r.mozSlice||r.webkitSlice,i=e,s=2097152,a=Math.ceil(i.size/s);let c=0;const u=new Un.ArrayBuffer,g=new FileReader;function _(){const x=c*s,T=x+s>=i.size?i.size:x+s;g.readAsArrayBuffer(o.call(i,x,T))}g.onload=function(x){if(u.append(x.target?.result),c++,c<a)_();else{const T=u.end();n({isOK:!0,data:T})}},g.onerror=function(){const x=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(x),n({isOK:!1,data:x})},_()}static MD5(e,n=!1){return Un.hash(e,n)}static copyTextByCommand(e){return new Promise((n,r)=>{const o=document.createElement("input");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),o.remove(),n(!0)})}static copyText=e=>navigator.clipboard?navigator.clipboard.writeText(e).then(function(){return!0},function(n){return!1}):se.copyTextByCommand(e);static copyElementTextByCommand(e){const n=document.createRange();n.selectNode(document.getElementById(e));const r=window.getSelection();r.rangeCount>0&&r.removeAllRanges(),r.addRange(n);try{return document.execCommand("copy"),r.removeRange(n),!0}catch(o){return r.removeRange(n),console.error("Command\u590D\u5236\u6587\u672C\u9519\u8BEF",o),!1}}static copyElementText(e){if(!navigator.clipboard)return se.copyElementTextByCommand(e);const n=document.createRange();n.selectNode(document.getElementById(e));const r=window.getSelection();return r.rangeCount>0&&r.removeAllRanges(),r.addRange(n),navigator.clipboard.writeText(r).then(function(){return r.removeRange(n),!0},function(o){return r.removeRange(n),console.error("Clipboard\u590D\u5236\u6587\u672C\u9519\u8BEF",o),!1})}static setGrayMode(e){se.toggleClass(e,"grayMode",document.documentElement)}static toggleClass(e,n,r){const o=r||document.body;let{className:i}=o;i=i.replace(n,""),o.className=e?`${i} ${n} `:i}static setCssVar(e,n,r=document.documentElement){r.style.setProperty(e,n)}static dispatchWindowResize(){const e=new Event("resize");window.dispatchEvent(e)}static dispatchElementEvent(e,n="click",r){let o;if(o=rt(e)?document.getElementById(e):e,o){const i=new Event(n,{bubbles:!0,cancelable:!0});r&&o.addEventListener("ev",s=>{r(s)},!1),o.dispatchEvent(i)}}static getRandomNum(e,n){var r=n-e,o=Math.random();return e+Math.round(o*r)}static merge(e={},n={}){let r,o,i,s;for(e||(e={}),o=0,i=n.length;o<i;o++)for(r in s=n[o],s)e[r]=s[r];return e}static setOptions(e,n){e.hasOwnProperty("options")||(e.options=e.options?Object.create(e.options):{});for(let r in n)e.options[r]=n[r];return e.options}static formatNum(e,n){let r=Math.pow(10,n===void 0?6:n);return Math.round(e*r)/r}static trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}static splitWords(e){return this.trim(e).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(e,n){let r=null;return function(){r&&clearTimeout(r),r=setTimeout(e,n)}}static throttle(e,n){let r=!0;return function(){if(!r)return!1;r=!1,setTimeout(()=>{e(),r=!0},n)}}static dataURLtoBlob(e){let n=e.split(",");if(!n||n.length===0)return;let r=n[0].match(/:(.*?);/)[1],o=atob(n[1]),i=o.length,s=new Uint8Array(i);for(;i--;)s[i]=o.charCodeAt(i);return new Blob([s],{type:r})}static getElement(e){return typeof e=="string"?document.getElementById(e):e}static getStyle(e,n){let r=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!r||r==="auto")&&document.defaultView){let o=document.defaultView.getComputedStyle(e,null);r=o?o[n]:null}return r==="auto"?null:r}static create(e,n,r){let o=document.createElement(e);return o.className=n||"",r&&r.appendChild(o),o}static removeElement(e){let n=e.parentNode;n&&n.removeChild(e)}static emptyElement(e){for(;e.firstChild;)e.removeChild(e.firstChild)}static hasClass(e,n){if(e.classList!==void 0)return e.classList.contains(n);let r=this.getClass(e);return r.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(r)}static addClass(e,n){if(e.classList!==void 0){let r=this.splitWords(n);for(let o=0,i=r.length;o<i;o++)e.classList.add(r[o])}else if(!this.hasClass(e,n)){let r=this.getClass(e);this.setClass(e,(r?r+" ":"")+n)}}static removeClass(e,n){e.classList!==void 0?e.classList.remove(n):this.setClass(e,this.trim((" "+this.getClass(e)+" ").replace(" "+n+" "," ")))}static setClass(e,n){e.className.baseVal===void 0?e.className=n:e.className.baseVal=n}static getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}static createSvgElement(e,n,r,o){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",e),i.setAttribute("height",n),i.setAttribute("viewBox",`0 0 ${e} ${n}`);let s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",r),i.appendChild(s),o&&o.appendChild(i),i}static parseDom(e,n=!0,r=""){n=n??!1;let o=document.createElement("div");return o.className=r||"",o.innerHTML=e,n?o:o.childNodes}static createVideoHTML(e,n,r){let o=this.create("video",n,r),i=this.create("source","",o);i.setAttribute("src",e),i.setAttribute("type","video/map4");let s=this.create("source","",o);return s.setAttribute("src",e),s.setAttribute("type","video/quicktime"),o}static readFilePromise(e,n="ArrayBuffer",r="UTF-8"){return new Promise((o,i)=>{const s=new FileReader;switch(n){case"ArrayBuffer":s.readAsArrayBuffer(e);break;case"Text":s.readAsText(e,r);break;case"BinaryString":s.readAsBinaryString(e);break;case"DataURL":case"FileBytes":s.readAsDataURL(e)}s.onload=function(){if(s.result)if(n==="FileBytes"){const a=s.result,c=a.indexOf("64,"),u=a.substring(c+3);o(u)}else o(s.result);else i(s)},s.onerror=function(){i(s)}})}static readFileBytes(e){return this.readFilePromise(e,"FileBytes")}static promisify(e,...n){return function(){return new Promise((r,o)=>{n.push(function(i,s){i?o(i):r(s)}),e.apply(this,n)})}}static wait(e){return new Promise(n=>setTimeout(n,e))}static blockEvent(e){e.preventDefault(),e.stopPropagation()}static bindDropFileHanlder(e,n){if(!e)throw Error("\u4F20\u5165Element\u5BF9\u8C61\u4E0D\u80FD\u4E3A\u7A7A\uFF01");let r;if(rt(e)){let o=document.getElementById(e);if(o)r=o;else{const i=document.getElementsByClassName(e);if(!i||i.length==0)throw Error("\u672A\u627E\u5230\u5BF9\u5E94id\u6216\u7C7B\u540D\u7684HtmlElement\u5BF9\u8C61\uFF01");o=i[0],r=o}}else{if(!bo(e))throw Error("ele\u53C2\u6570\u53EA\u80FD\u4E3Astring \u6216 Element\u5BF9\u8C61\uFF01");r=e}r&&(r.addEventListener("dragenter",this.blockEvent,!1),r.addEventListener("dragover",this.blockEvent,!1),r.addEventListener("drop",function(o){se.blockEvent(o),n(o.dataTransfer.files)},!1))}static getInputElement(){var e=document.activeElement;return!e||e.tagName!="INPUT"&&e.contentEditable!="true"?null:e}static guessPasteTextToFileName(e,n){let r,o=n;return rt(e)?o=(So(e)?"json":Co(e)&&"kml")||"text":(Fe(e)&&e.type||Ft(e))&&(o="json"),o=="text"?r="pasted.txt":o=="kml"?r="pasted.kml":o=="json"&&(r="pasted.json"),r}static pasteEventHanlder(e,n){const r=this;if(r.getInputElement())return;r.blockEvent(e);const o=e.clipboardData,i=Array.from(o.types||[]).join(","),s=Array.from(o.items||[]);let a;if(i.includes("text/plain")){const c=o.getData("text/plain");if(c[1]===":"||_o(c))return n(c);const u=r.guessPasteTextToFileName(c);if(!u||u==="pasted.txt")return n(c);{const g=new Blob([c]);a=[new File([g],u)]}}else a=s.map(function(c){return c.kind=="file"?c.getAsFile():null});a=a.filter(Boolean),a.length?n(a):n(void 0)}static onPasteHandler(e){const n=this;Ht=r=>{n.pasteEventHanlder(r,e)},se.addHandler(document,"paste",Ht)}static offPasteHandler(){Ht&&se.removeHandler(document,"paste",Ht)}}class mt{static isNullOrEmpty=e=>e===null||e===""||e===void 0||e.length===0;static isNotEmpty=e=>!(e===null||e===""||e===void 0||e.length===0);static toHump(e){return e.replace(/[\-\/\_](\w)/g,(n,r)=>r.toUpperCase()).replace("views","")}static getFileName(e){const n=e.lastIndexOf("/")+1;let r=e.substring(n);return r=decodeURI(r.split("?")[0]),r}}class qt{prefixKey;storage;constructor(e="",n=localStorage){this.prefixKey=e,this.storage=n}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,n,r=604800){const o=JSON.stringify({value:n,expire:r!==null?new Date().getTime()+1e3*r:null});this.storage.setItem(this.getKey(e),o)}get(e,n=null){const r=this.storage.getItem(this.getKey(e));if(r)try{const o=JSON.parse(r),{value:i,expire:s}=o;if(s===null||s>=Date.now())return i;this.remove(this.getKey(e))}catch{return n}return n}getJsonObject(e){const n=this.storage.getItem(this.getKey(e));if(n)try{const r=JSON.parse(n);if(r.expire===null||r.expire>=Date.now())return r;this.remove(this.getKey(e))}catch{return}}remove(e){this.storage.removeItem(this.getKey(e))}clear(){this.storage.clear()}setCookie(e,n,r=604800){document.cookie=`${this.getKey(e)}=${n}; Max-Age=${r}`}getCookie(e){const n=document.cookie.split("; ");for(let r=0,o=n.length;r<o;r++){const i=n[r].split("=");if(i[0]===this.getKey(e))return i[1]}return""}removeCookie(e){this.setCookie(e,1,-1)}clearCookie(){const e=document.cookie.match(/[^ =;]+(?==)/g);if(e)for(let n=e.length;n--;)document.cookie=e[n]+"=0;expire="+new Date(0).toUTCString()}}const Js=new qt("",localStorage);function Eo(){let t=[];const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const o=Math.floor(16*Math.random());t[n]=e.substring(o,o+1)}t[14]="4";const r=3&Number(t[19])|8;return t[19]=e.substring(r,r+1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}var ko={},ee=Uint8Array,we=Uint16Array,vt=Int32Array,ot=new ee([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),it=new ee([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),yt=new ee([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xo=function(t,e){for(var n=new we(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var o=new vt(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return{b:n,r:o}},Io=xo(ot,2),qn=Io.b,Vt=Io.r;qn[28]=258,Vt[258]=28;for(var To=xo(it,0),Ro=To.b,Vn=To.r,wt=new we(32768),ne=0;ne<32768;++ne){var He=(43690&ne)>>1|(21845&ne)<<1;He=(61680&(He=(52428&He)>>2|(13107&He)<<2))>>4|(3855&He)<<4,wt[ne]=((65280&He)>>8|(255&He)<<8)>>1}var ke=function(t,e,n){for(var r=t.length,o=0,i=new we(e);o<r;++o)t[o]&&++i[t[o]-1];var s,a=new we(e);for(o=1;o<e;++o)a[o]=a[o-1]+i[o-1]<<1;if(n){s=new we(1<<e);var c=15-e;for(o=0;o<r;++o)if(t[o])for(var u=o<<4|t[o],g=e-t[o],_=a[t[o]-1]++<<g,x=_|(1<<g)-1;_<=x;++_)s[wt[_]>>c]=u}else for(s=new we(r),o=0;o<r;++o)t[o]&&(s[o]=wt[a[t[o]-1]++]>>15-t[o]);return s},Ae=new ee(288);for(ne=0;ne<144;++ne)Ae[ne]=8;for(ne=144;ne<256;++ne)Ae[ne]=9;for(ne=256;ne<280;++ne)Ae[ne]=7;for(ne=280;ne<288;++ne)Ae[ne]=8;var st=new ee(32);for(ne=0;ne<32;++ne)st[ne]=5;var Po=ke(Ae,9,0),zo=ke(Ae,9,1),Mo=ke(st,5,0),Ao=ke(st,5,1),Xt=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},xe=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},Gt=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},bt=function(t){return(t+7)/8|0},Ue=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new ee(t.subarray(e,n))},Bo=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],te=function(t,e,n){var r=new Error(e||Bo[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,te),!n)throw r;return r},Xn=function(t,e,n,r){var o=t.length,i=r?r.length:0;if(!o||e.f&&!e.l)return n||new ee(0);var s=!n,a=s||e.i!=2,c=e.i;s&&(n=new ee(3*o));var u=function(Oe){var Ne=n.length;if(Oe>Ne){var me=new ee(Math.max(2*Ne,Oe));me.set(n),n=me}},g=e.f||0,_=e.p||0,x=e.b||0,T=e.l,z=e.d,d=e.m,h=e.n,b=8*o;do{if(!T){g=xe(t,_,1);var v=xe(t,_+1,3);if(_+=3,!v){var f=t[(q=bt(_)+4)-4]|t[q-3]<<8,w=q+f;if(w>o){c&&te(0);break}a&&u(x+f),n.set(t.subarray(q,w),x),e.b=x+=f,e.p=_=8*w,e.f=g;continue}if(v==1)T=zo,z=Ao,d=9,h=5;else if(v==2){var B=xe(t,_,31)+257,D=xe(t,_+10,15)+4,R=B+xe(t,_+5,31)+1;_+=14;for(var k=new ee(R),A=new ee(19),W=0;W<D;++W)A[yt[W]]=xe(t,_+3*W,7);_+=3*D;var M=Xt(A),j=(1<<M)-1,H=ke(A,M,1);for(W=0;W<R;){var q,X=H[xe(t,_,j)];if(_+=15&X,(q=X>>4)<16)k[W++]=q;else{var K=0,J=0;for(q==16?(J=3+xe(t,_,3),_+=2,K=k[W-1]):q==17?(J=3+xe(t,_,7),_+=3):q==18&&(J=11+xe(t,_,127),_+=7);J--;)k[W++]=K}}var ae=k.subarray(0,B),Z=k.subarray(B);d=Xt(ae),h=Xt(Z),T=ke(ae,d,1),z=ke(Z,h,1)}else te(1);if(_>b){c&&te(0);break}}a&&u(x+131072);for(var Be=(1<<d)-1,_e=(1<<h)-1,Te=_;;Te=_){var ge=(K=T[Gt(t,_)&Be])>>4;if((_+=15&K)>b){c&&te(0);break}if(K||te(2),ge<256)n[x++]=ge;else{if(ge==256){Te=_,T=null;break}var Se=ge-254;if(ge>264){var re=ot[W=ge-257];Se=xe(t,_,(1<<re)-1)+qn[W],_+=re}var Ee=z[Gt(t,_)&_e],De=Ee>>4;if(Ee||te(3),_+=15&Ee,Z=Ro[De],De>3&&(re=it[De],Z+=Gt(t,_)&(1<<re)-1,_+=re),_>b){c&&te(0);break}a&&u(x+131072);var Le=x+Se;if(x<Z){var je=i-Z,et=Math.min(Z,Le);for(je+x<0&&te(3);x<et;++x)n[x]=r[je+x]}for(;x<Le;++x)n[x]=n[x-Z]}}e.l=T,e.p=Te,e.b=x,e.f=g,T&&(g=1,e.m=d,e.d=z,e.n=h)}while(!g);return x!=n.length&&s?Ue(n,0,x):n.subarray(0,x)},ze=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},at=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},Kt=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var o=n.length,i=n.slice();if(!o)return{t:Yn,l:0};if(o==1){var s=new ee(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(B,D){return B.f-D.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,g=1,_=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};g!=o-1;)a=n[n[u].f<n[_].f?u++:_++],c=n[u!=g&&n[u].f<n[_].f?u++:_++],n[g++]={s:-1,f:a.f+c.f,l:a,r:c};var x=i[0].s;for(r=1;r<o;++r)i[r].s>x&&(x=i[r].s);var T=new we(x+1),z=Jt(n[g-1],T,0);if(z>e){r=0;var d=0,h=z-e,b=1<<h;for(i.sort(function(B,D){return T[D.s]-T[B.s]||B.f-D.f});r<o;++r){var v=i[r].s;if(!(T[v]>e))break;d+=b-(1<<z-T[v]),T[v]=e}for(d>>=h;d>0;){var f=i[r].s;T[f]<e?d-=1<<e-T[f]++-1:++r}for(;r>=0&&d;--r){var w=i[r].s;T[w]==e&&(--T[w],++d)}z=e}return{t:new ee(T),l:z}},Jt=function(t,e,n){return t.s==-1?Math.max(Jt(t.l,e,n+1),Jt(t.r,e,n+1)):e[t.s]=n},Gn=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new we(++e),r=0,o=t[0],i=1,s=function(c){n[r++]=c},a=1;a<=e;++a)if(t[a]==o&&a!=e)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=t[a]}return{c:n.subarray(0,r),n:e}},ct=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},Kn=function(t,e,n){var r=n.length,o=bt(e+2);t[o]=255&r,t[o+1]=r>>8,t[o+2]=255^t[o],t[o+3]=255^t[o+1];for(var i=0;i<r;++i)t[o+i+4]=n[i];return 8*(o+4+r)},Jn=function(t,e,n,r,o,i,s,a,c,u,g){ze(e,g++,n),++o[256];for(var _=Kt(o,15),x=_.t,T=_.l,z=Kt(i,15),d=z.t,h=z.l,b=Gn(x),v=b.c,f=b.n,w=Gn(d),B=w.c,D=w.n,R=new we(19),k=0;k<v.length;++k)++R[31&v[k]];for(k=0;k<B.length;++k)++R[31&B[k]];for(var A=Kt(R,7),W=A.t,M=A.l,j=19;j>4&&!W[yt[j-1]];--j);var H,q,X,K,J=u+5<<3,ae=ct(o,Ae)+ct(i,st)+s,Z=ct(o,x)+ct(i,d)+s+14+3*j+ct(R,W)+2*R[16]+3*R[17]+7*R[18];if(c>=0&&J<=ae&&J<=Z)return Kn(e,g,t.subarray(c,c+u));if(ze(e,g,1+(Z<ae)),g+=2,Z<ae){H=ke(x,T,0),q=x,X=ke(d,h,0),K=d;var Be=ke(W,M,0);for(ze(e,g,f-257),ze(e,g+5,D-1),ze(e,g+10,j-4),g+=14,k=0;k<j;++k)ze(e,g+3*k,W[yt[k]]);g+=3*j;for(var _e=[v,B],Te=0;Te<2;++Te){var ge=_e[Te];for(k=0;k<ge.length;++k){var Se=31&ge[k];ze(e,g,Be[Se]),g+=W[Se],Se>15&&(ze(e,g,ge[k]>>5&127),g+=ge[k]>>12)}}}else H=Po,q=Ae,X=Mo,K=st;for(k=0;k<a;++k){var re=r[k];if(re>255){at(e,g,H[(Se=re>>18&31)+257]),g+=q[Se+257],Se>7&&(ze(e,g,re>>23&31),g+=ot[Se]);var Ee=31&re;at(e,g,X[Ee]),g+=K[Ee],Ee>3&&(at(e,g,re>>5&8191),g+=it[Ee])}else at(e,g,H[re]),g+=q[re]}return at(e,g,H[256]),g+q[256]},Do=new vt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yn=new ee(0),Lo=function(t,e,n,r,o,i){var s=i.z||t.length,a=new ee(r+s+5*(1+Math.ceil(s/7e3))+o),c=a.subarray(r,a.length-o),u=i.l,g=7&(i.r||0);if(e){g&&(c[0]=i.r>>3);for(var _=Do[e-1],x=_>>13,T=8191&_,z=(1<<n)-1,d=i.p||new we(32768),h=i.h||new we(z+1),b=Math.ceil(n/3),v=2*b,f=function(me){return(t[me]^t[me+1]<<b^t[me+2]<<v)&z},w=new vt(25e3),B=new we(288),D=new we(32),R=0,k=0,A=i.i||0,W=0,M=i.w||0,j=0;A+2<s;++A){var H=f(A),q=32767&A,X=h[H];if(d[q]=X,h[H]=q,M<=A){var K=s-A;if((R>7e3||W>24576)&&(K>423||!u)){g=Jn(t,c,0,w,B,D,k,W,j,A-j,g),W=R=k=0,j=A;for(var J=0;J<286;++J)B[J]=0;for(J=0;J<30;++J)D[J]=0}var ae=2,Z=0,Be=T,_e=q-X&32767;if(K>2&&H==f(A-_e))for(var Te=Math.min(x,K)-1,ge=Math.min(32767,A),Se=Math.min(258,K);_e<=ge&&--Be&&q!=X;){if(t[A+ae]==t[A+ae-_e]){for(var re=0;re<Se&&t[A+re]==t[A+re-_e];++re);if(re>ae){if(ae=re,Z=_e,re>Te)break;var Ee=Math.min(_e,re-2),De=0;for(J=0;J<Ee;++J){var Le=A-_e+J&32767,je=Le-d[Le]&32767;je>De&&(De=je,X=Le)}}}_e+=(q=X)-(X=d[q])&32767}if(Z){w[W++]=268435456|Vt[ae]<<18|Vn[Z];var et=31&Vt[ae],Oe=31&Vn[Z];k+=ot[et]+it[Oe],++B[257+et],++D[Oe],M=A+ae,++R}else w[W++]=t[A],++B[t[A]]}}for(A=Math.max(A,M);A<s;++A)w[W++]=t[A],++B[t[A]];g=Jn(t,c,u,w,B,D,k,W,j,A-j,g),u||(i.r=7&g|c[g/8|0]<<3,g-=7,i.h=h,i.p=d,i.i=A,i.w=M)}else{for(A=i.w||0;A<s+u;A+=65535){var Ne=A+65535;Ne>=s&&(c[g/8|0]=u,Ne=s),g=Kn(c,g+1,t.subarray(A,Ne))}i.i=s}return Ue(a,0,r+bt(g)+o)},No=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),Yt=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=No[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},Zn=function(t,e,n,r,o){if(!o&&(o={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),s=new ee(i.length+t.length);s.set(i),s.set(t,i.length),t=s,o.w=i.length}return Lo(t,e.level==null?6:e.level,e.mem==null?o.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,r,o)},Zt=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},$o=function(t,e,n){for(var r=t(),o=t.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<r.length;++s){var a=r[s],c=i[s];if(typeof a=="function"){e+=";"+c+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var g=u.indexOf(" ",8)+1;e+=u.slice(g,u.indexOf("(",g))}else for(var _ in e+=u,a.prototype)e+=";"+c+".prototype."+_+"="+a.prototype[_].toString();else e+=u}else n[c]=a}return e},Qt=[],Ys=function(t,e,n,r){if(!Qt[n]){for(var o="",i={},s=t.length-1,a=0;a<s;++a)o=$o(t[a],o,i);Qt[n]={c:$o(t[s],o,i),e:i}}var c=Zt({},Qt[n].e);return function(u,g,_,x,T){var z=new Worker(ko[g]||(ko[g]=URL.createObjectURL(new Blob([u+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return z.onmessage=function(d){var h=d.data,b=h.$e$;if(b){var v=new Error(b[0]);v.code=b[1],v.stack=b[2],T(v,null)}else T(null,h)},z.postMessage(_,x),z}(Qt[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,c,function(u){var g=[];for(var _ in u)u[_].buffer&&g.push((u[_]=new u[_].constructor(u[_])).buffer);return g}(c),r)},Wo=function(){return[ee,we,vt,ot,it,yt,qn,Ro,zo,Ao,wt,Bo,ke,Xt,xe,Gt,bt,Ue,te,Xn,nn,lt,jo]},Uo=function(){return[ee,we,vt,ot,it,yt,Vt,Vn,Po,Ae,Mo,st,wt,Do,Yn,ke,ze,at,Kt,Jt,Gn,ct,Kn,Jn,bt,Ue,Lo,Zn,tn,lt]},Zs=function(){return[Oo,qo,ce,Yt,No]},Qs=function(){return[Fo,Ho]},lt=function(t){return postMessage(t,[t.buffer])},jo=function(t){return t&&{out:t.size&&new ee(t.size),dictionary:t.dictionary}},en=function(t,e,n,r,o,i){var s=Ys(n,r,o,function(a,c){s.terminate(),i(a,c)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},Re=function(t,e){return t[e]|t[e+1]<<8},de=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},Qn=function(t,e){return de(t,e)+4294967296*de(t,e+4)},ce=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Oo=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&ce(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},Fo=function(t){t[0]==31&&t[1]==139&&t[2]==8||te(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=2+(t[10]|t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)},Ho=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},qo=function(t){return 10+(t.filename?t.filename.length+1:0)};function tn(t,e){return Zn(t,e||{},0,0)}function nn(t,e){return Xn(t,{i:2},e&&e.out,e&&e.dictionary)}function ea(t,e,n){return n||(n=e,e={}),typeof n!="function"&&te(7),en(t,e,[Uo,Zs,function(){return[er]}],function(r){return lt(er(r.data[0],r.data[1]))},2,n)}function er(t,e){e||(e={});var n=Yt(),r=t.length;n.p(t);var o=Zn(t,e,qo(e),8),i=o.length;return Oo(o,e),ce(o,i-8,n.d()),ce(o,i-4,r),o}function ta(t,e,n){return n||(n=e,e={}),typeof n!="function"&&te(7),en(t,e,[Wo,Qs,function(){return[tr]}],function(r){return lt(tr(r.data[0],r.data[1]))},3,n)}function tr(t,e){var n=Fo(t);return n+8>t.length&&te(6,"invalid gzip data"),Xn(t.subarray(n,-8),{i:2},e&&e.out||new ee(Ho(t)),e&&e.dictionary)}var nr=function(t,e,n,r){for(var o in t){var i=t[o],s=e+o,a=r;Array.isArray(i)&&(a=Zt(r,i[1]),i=i[0]),i instanceof ee?n[s]=[i,a]:(n[s+="/"]=[new ee(0),a],nr(i,s,n,r))}},Vo=typeof TextEncoder<"u"&&new TextEncoder,rr=typeof TextDecoder<"u"&&new TextDecoder;try{rr.decode(Yn,{stream:!0})}catch{}function qe(t,e){if(e){for(var n=new ee(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Vo)return Vo.encode(t);var o=t.length,i=new ee(t.length+(t.length>>1)),s=0,a=function(g){i[s++]=g};for(r=0;r<o;++r){if(s+5>i.length){var c=new ee(s+8+(o-r<<1));c.set(i),i=c}var u=t.charCodeAt(r);u<128||e?a(u):u<2048?(a(192|u>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++r))>>18),a(128|u>>12&63),a(128|u>>6&63),a(128|63&u)):(a(224|u>>12),a(128|u>>6&63),a(128|63&u))}return Ue(i,0,s)}function or(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(rr)return rr.decode(t);var o=function(s){for(var a="",c=0;;){var u=s[c++],g=(u>127)+(u>223)+(u>239);if(c+g>s.length)return{s:a,r:Ue(s,c-1)};g?g==3?(u=((15&u)<<18|(63&s[c++])<<12|(63&s[c++])<<6|63&s[c++])-65536,a+=String.fromCharCode(55296|u>>10,56320|1023&u)):a+=1&g?String.fromCharCode((31&u)<<6|63&s[c++]):String.fromCharCode((15&u)<<12|(63&s[c++])<<6|63&s[c++]):a+=String.fromCharCode(u)}}(t),i=o.s;return(n=o.r).length&&te(8),i}var Xo=function(t,e){return e+30+Re(t,e+26)+Re(t,e+28)},Go=function(t,e,n){var r=Re(t,e+28),o=or(t.subarray(e+46,e+46+r),!(2048&Re(t,e+8))),i=e+46+r,s=de(t,e+20),a=n&&s==4294967295?na(t,i):[s,de(t,e+24),de(t,e+42)],c=a[0],u=a[1],g=a[2];return[Re(t,e+10),c,u,o,i+Re(t,e+30)+Re(t,e+32),g]},na=function(t,e){for(;Re(t,e)!=1;e+=4+Re(t,e+2));return[Qn(t,e+12),Qn(t,e+4),Qn(t,e+20)]},_t=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&te(9),e+=r+4}return e},rn=function(t,e,n,r,o,i,s,a){var c=r.length,u=n.extra,g=a&&a.length,_=_t(u);ce(t,e,s!=null?33639248:67324752),e+=4,s!=null&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(i<0&&8),t[e++]=o&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var x=new Date(n.mtime==null?Date.now():n.mtime),T=x.getFullYear()-1980;if((T<0||T>119)&&te(10),ce(t,e,T<<25|x.getMonth()+1<<21|x.getDate()<<16|x.getHours()<<11|x.getMinutes()<<5|x.getSeconds()>>1),e+=4,i!=-1&&(ce(t,e,n.crc),ce(t,e+4,i<0?-i-2:i),ce(t,e+8,n.size)),ce(t,e+12,c),ce(t,e+14,_),e+=16,s!=null&&(ce(t,e,g),ce(t,e+6,n.attrs),ce(t,e+10,s),e+=14),t.set(r,e),e+=c,_)for(var z in u){var d=u[z],h=d.length;ce(t,e,+z),ce(t,e+2,h),t.set(d,e+4),e+=4+h}return g&&(t.set(a,e),e+=g),e},Ko=function(t,e,n,r,o){ce(t,e,101010256),ce(t,e+8,n),ce(t,e+10,n),ce(t,e+12,r),ce(t,e+16,o)};function ra(t,e,n){n||(n=e,e={}),typeof n!="function"&&te(7);var r={};nr(t,"",r,e);var o=Object.keys(r),i=o.length,s=0,a=0,c=i,u=new Array(i),g=[],_=function(){for(var h=0;h<g.length;++h)g[h]()},x=function(h,b){on(function(){n(h,b)})};on(function(){x=n});var T=function(){var h=new ee(a+22),b=s,v=a-s;a=0;for(var f=0;f<c;++f){var w=u[f];try{var B=w.c.length;rn(h,a,w,w.f,w.u,B);var D=30+w.f.length+_t(w.extra),R=a+D;h.set(w.c,R),rn(h,s,w,w.f,w.u,B,a,w.m),s+=16+D+(w.m?w.m.length:0),a=R+B}catch(k){return x(k,null)}}Ko(h,s,u.length,v,b),x(null,h)};i||T();for(var z=function(h){var b=o[h],v=r[b],f=v[0],w=v[1],B=Yt(),D=f.length;B.p(f);var R=qe(b),k=R.length,A=w.comment,W=A&&qe(A),M=W&&W.length,j=_t(w.extra),H=w.level==0?0:8,q=function(X,K){if(X)_(),x(X,null);else{var J=K.length;u[h]=Zt(w,{size:D,crc:B.d(),c:K,f:R,m:W,u:k!=b.length||W&&A.length!=M,compression:H}),s+=30+k+j+J,a+=76+2*(k+j)+(M||0)+J,--i||T()}};if(k>65535&&q(te(11,0,1),null),H)if(D<16e4)try{q(null,tn(f,w))}catch(X){q(X,null)}else g.push(function(X,K,J){return J||(J=K,K={}),typeof J!="function"&&te(7),en(X,K,[Uo],function(ae){return lt(tn(ae.data[0],ae.data[1]))},0,J)}(f,w,q));else q(null,f)},d=0;d<c;++d)z(d);return _}var on=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(t){t()};function oa(t,e,n){n||(n=e,e={}),typeof n!="function"&&te(7);var r=[],o=function(){for(var h=0;h<r.length;++h)r[h]()},i={},s=function(h,b){on(function(){n(h,b)})};on(function(){s=n});for(var a=t.length-22;de(t,a)!=101010256;--a)if(!a||t.length-a>65558)return s(te(13,0,1),null),o;var c=Re(t,a+8);if(c){var u=c,g=de(t,a+16),_=g==4294967295||u==65535;if(_){var x=de(t,a-12);(_=de(t,x)==101075792)&&(u=c=de(t,x+32),g=de(t,x+48))}for(var T=e&&e.filter,z=function(h){var b=Go(t,g,_),v=b[0],f=b[1],w=b[2],B=b[3],D=b[4],R=b[5],k=Xo(t,R);g=D;var A=function(M,j){M?(o(),s(M,null)):(j&&(i[B]=j),--c||s(null,i))};if(!T||T({name:B,size:f,originalSize:w,compression:v}))if(v)if(v==8){var W=t.subarray(k,k+f);if(w<524288||f>.8*w)try{A(null,nn(W,{out:new ee(w)}))}catch(M){A(M,null)}else r.push(function(M,j,H){return H||(H=j,j={}),typeof H!="function"&&te(7),en(M,j,[Wo],function(q){return lt(nn(q.data[0],jo(q.data[1])))},1,H)}(W,{size:w},A))}else A(te(14,"unknown compression type "+v,1),null);else A(null,Ue(t,k,k+f));else A(null,null)},d=0;d<u;++d)z()}else s(null,{});return o}function ut(t){var e={filename:"",directory:"",basename:"",extension:""},n=function(a){return a.indexOf("/")==-1&&a.indexOf("\\")!=-1?"\\":"/"}(t),r=t.split(n),o=r.pop(),i=/\.([a-z][a-z0-9]*)$/i,s=i.test(o)?i.exec(o)[0]:"";return s||o.includes("*")?(e.filename=o,e.extension=s?s.slice(1):"",e.basename=o.slice(0,o.length-s.length),e.directory=r.join(n)):e.directory=o?t:r.join(n),e}function Jo(t){return ut(t).basename}function sn(t){return ut(t).extension}function ir(t){var e=ut(t);return e.extension?t.slice(0,t.length-e.extension.length-1):t}function Yo(t,e){var n;return t&&e&&(n=Zo(t,e).replace(/[-_]$/,"")),n||""}function Zo(t,e){for(var n=0,r=t.length;n<r&&t[n]===e[n];n++);return t.substr(0,n)}function sr(t){return{all:t=t||new Map,on(e,n){const r=t.get(e);r?r.push(n):t.set(e,[n])},off(e,n){const r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit(e,n){let r=t.get(e);r&&r.slice().map(o=>{o(n)}),r=t.get("*"),r&&r.slice().map(o=>{o(e,n)})}}}const Ve=sr(),fe={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetToUnloadEvent:"WidgetToUnloadEvent",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},St=(t,e)=>{ar(t,e)};function ar(t,e){const n=window.URL||window.webkitURL||window,r=new Blob([t]),o=n.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=e,document.body.appendChild(i),i.click(),n.revokeObjectURL(o),setTimeout(function(){n.revokeObjectURL(o),document.body.removeChild(i)},400)}const Qo=(t,e)=>{const n=JSON.stringify(t,null,2);e?St(n,e+".json"):Ve.emit(fe.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")};function cr(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function an(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function lr(t){let e=t.toLowerCase();if(an(t)){if(e.length===4){let r="#";for(let o=1;o<4;o+=1)r+=e.slice(o,o+1).concat(e.slice(o,o+1));e=r}const n=[];for(let r=1;r<7;r+=2)n.push(parseInt("0x"+e.slice(r,r+2)));return"RGB("+n.join(",")+")"}return e}function ur(t,e){const n=parseInt(t,16)+e,r=n>255?255:n;return r.toString(16).length>1?r.toString(16):`0${r.toString(16)}`}function ei(t,e,n){const r=[t,e,n].map(o=>(o/=255)<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4));return .2126*r[0]+.7152*r[1]+.0722*r[2]}function hr(t,e){const n=parseInt(t,16)-e,r=n<0?0:n;return r.toString(16).length>1?r.toString(16):`0${r.toString(16)}`}function ti(t){return new Promise(e=>setTimeout(e,t))}exports.EnumColor=void 0,function(t){t[t.RGBA=0]="RGBA",t[t.Hex=1]="Hex",t[t.Hsla=2]="Hsla"}(exports.EnumColor||(exports.EnumColor={}));var ni,dr={exports:{}},ri,oi,fr,pr=(ni||(ni=1,oi=dr.exports,fr=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],o={},i=null;function s(T,z){var d=T[z];if(typeof d.bind=="function")return d.bind(T);try{return Function.prototype.bind.call(d,T)}catch{return function(){return Function.prototype.apply.apply(d,[T,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var T=this.getLevel(),z=0;z<r.length;z++){var d=r[z];this[d]=z<T?t:this.methodFactory(d,T,this.name)}if(this.log=this.debug,typeof console===e&&T<this.levels.SILENT)return"No console available for logging"}function u(T){return function(){typeof console!==e&&(c.call(this),this[T].apply(this,arguments))}}function g(T,z,d){return function(h){return h==="debug"&&(h="log"),typeof console!==e&&(h==="trace"&&n?a:console[h]!==void 0?s(console,h):console.log!==void 0?s(console,"log"):t)}(T)||u.apply(this,arguments)}function _(T,z){var d,h,b,v=this,f="loglevel";function w(){var R;if(typeof window!==e&&f){try{R=window.localStorage[f]}catch{}if(typeof R===e)try{var k=window.document.cookie,A=encodeURIComponent(f),W=k.indexOf(A+"=");W!==-1&&(R=/^([^;]+)/.exec(k.slice(W+A.length+1))[1])}catch{}return v.levels[R]===void 0&&(R=void 0),R}}function B(R){var k=R;if(typeof k=="string"&&v.levels[k.toUpperCase()]!==void 0&&(k=v.levels[k.toUpperCase()]),typeof k=="number"&&k>=0&&k<=v.levels.SILENT)return k;throw new TypeError("log.setLevel() called with invalid level: "+R)}typeof T=="string"?f+=":"+T:typeof T=="symbol"&&(f=void 0),v.name=T,v.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},v.methodFactory=z||g,v.getLevel=function(){return b??h??d},v.setLevel=function(R,k){return b=B(R),k!==!1&&function(A){var W=(r[A]||"silent").toUpperCase();if(typeof window!==e&&f){try{return void(window.localStorage[f]=W)}catch{}try{window.document.cookie=encodeURIComponent(f)+"="+W+";"}catch{}}}(b),c.call(v)},v.setDefaultLevel=function(R){h=B(R),w()||v.setLevel(R,!1)},v.resetLevel=function(){b=null,function(){if(typeof window!==e&&f){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),c.call(v)},v.enableAll=function(R){v.setLevel(v.levels.TRACE,R)},v.disableAll=function(R){v.setLevel(v.levels.SILENT,R)},v.rebuild=function(){if(i!==v&&(d=B(i.getLevel())),c.call(v),i===v)for(var R in o)o[R].rebuild()},d=B(i?i.getLevel():"WARN");var D=w();D!=null&&(b=B(D)),c.call(v)}(i=new _).getLogger=function(T){if(typeof T!="symbol"&&typeof T!="string"||T==="")throw new TypeError("You must supply a name when creating a logger.");var z=o[T];return z||(z=o[T]=new _(T,i.methodFactory)),z};var x=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=x),i},i.getLoggers=function(){return o},i.default=i,i},(ri=dr).exports?ri.exports=fr():oi.log=fr()),dr.exports);class ii{message;eventBus;constructor(e,n=void 0){e&&(this.message=e),n&&(this.eventBus=n)}msg(e,n=3,r="success"){if(this.message)if(typeof this.message=="function")this.message({type:r,message:e,duration:n});else switch(r){case"info":this.message.info(e,n);break;case"success":this.message.success(e,n);break;case"warning":this.message.warn?this.message.warn(e,n):this.message.warning&&this.message.warning(e,n);break;case"error":this.message.error(e,n)}else{switch(r){case"info":case"success":console.log(e);break;case"warning":console.warn(e);break;case"error":r="dark",console.error(e)}this.eventBus&&this.eventBus.emit(fe.AlertInfoEvent,{type:r,info:e})}}info(e,n=3){this.msg(e,n,"info")}warn(e,n=3){this.msg(e,n,"warning")}err(e,n=3){this.msg(e,n,"error")}success(e,n=3){this.msg(e,n,"success")}}let si=!1;Function.prototype.promise=function(...t){const e=this;return function(){const n=t||[];return new Promise((r,o)=>{n.push(function(i,s){i?o(i):r(s)}),e.apply(e,t)})}()};const O={Config:SysConfig,EventBus:Ve,DefaultProxyClient:null,Axios:Us.default,Message:new ii(void 0,Ve),LayoutMap:new Map,getLayoutManager:t=>{if(!O.WidgetConfigList||O.WidgetConfigList.length===0)return;const e=O.WidgetConfigList.find(n=>n.id===t);if(e){const n=e.layoutID;if(n&&O.LayoutMap.has(n))return O.LayoutMap.get(n)}},Logger:t=>{si||(SysConfig.UI.ProductLog?pr.enableAll():pr.setDefaultLevel("warn"),si=!0);const e=t||"default";return pr.getLogger(e)}},ai="access_token",ht=new qt("user",localStorage);function Xe(){return ht.get(ai)}function gr(){ht.remove(ai)}function ci(){return Xe()?.refresh}function mr(t,e,n,r="json",o){const i={baseURL:O.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,paramsSerializer:{serialize:function(s){return js.default.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Xe()?.token},responseType:r,cancelToken:o};if(n)for(let s in n)i.headers[s]=n[s];return O.SystemID&&(i.headers.sysid=O.SystemID,O.SystemGroup&&(i.headers.sysgroup=O.SystemGroup)),e!==void 0&&(i.baseURL=e),i}function Ie(t,e,n,r,o="json",i,s){const a=mr(n,e,r,o,i);return s&&s>=2e4&&(a.timeout=s),O.Axios?.get(t,a).catch(function(c){cn(c,a.baseURL,t,"Get")})}function cn(t,e,n,r="Get"){const o=`${e}${n}`;if(t&&t.response){let i=!1;const s=t.response.status;switch(s){case 400:t.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:t.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:t.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:t.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:t.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:t.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const c=t.response.data;if(c){const u=c.indexOf(":"),g=c.indexOf(`
|
|
2
|
+
`);if(u>0&&g-u>2){const _=c.substring(u+2,g);_.indexOf("System.Exception")>0?t.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,t.message=_)}else i=!0,t.message=c}else t.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:t.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:t.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:t.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:t.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:t.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:t.message=`\u8FDE\u63A5\u9519\u8BEF${t.response.status}`}let a={address:o,code:s,isExceptionInfo:i,message:t.message,result:t.response.data};if(O.EventBus.emit(fe.AxiosRequestErrorEvent,a),i)throw new Error(t.message)}else{if(t?.message)throw new Error(t.message);console.error(t,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function li(t,e,n,r,o,i="json",s){const a=mr(r,e,o,i);s&&s>=2e4&&(a.timeout=s),a.headers["Content-Type"]="multipart/form-data";const c=function(u){let g=new FormData;return u&&Object.keys(u).forEach(_=>{if(!u)return;let x=u[_];x!=null&&(Ft(x)?x.forEach(T=>{g.append(_,hi(T))}):g.append(_,hi(x)))}),g}(n);return O.Axios?.post(t,c,a).catch(function(u){cn(u,e,a.baseURL,"Post")})}function ui(t,e,n,r,o,i="json",s){const a=mr(r,e,o,i);return s&&s>=2e4&&(a.timeout=s),O.Axios?.post(t,n,a).catch(function(c){cn(c,e,t,"Post")})}function hi(t){return t instanceof Blob?t:t.toString()}var di,fi,vr,pi,yr,gi,wr,mi,vi,ln={exports:{}};function ia(){return fi?di:(fi=1,t=typeof window<"u"?window:nt!==void 0?nt:typeof self<"u"?self:{},di=t);var t}function sa(){if(pi)return vr;pi=1,vr=function(e){if(!e)return!1;var n=t.call(e);return n==="[object Function]"||typeof e=="function"&&n!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString;return vr}function aa(){if(gi)return yr;gi=1;var t=function(e){return e.replace(/^\s+|\s+$/g,"")};return yr=function(e){if(!e)return{};for(var n,r={},o=t(e).split(`
|
|
3
|
+
`),i=0;i<o.length;i++){var s=o[i],a=s.indexOf(":"),c=t(s.slice(0,a)).toLowerCase(),u=t(s.slice(a+1));r[c]===void 0?r[c]=u:(n=r[c],Object.prototype.toString.call(n)==="[object Array]"?r[c].push(u):r[c]=[r[c],u])}return r},yr}var ca=function(){if(vi)return ln.exports;vi=1;var t=ia(),e=sa(),n=aa(),r=function(){if(mi)return wr;mi=1,wr=function(){for(var c={},u=0;u<arguments.length;u++){var g=arguments[u];for(var _ in g)a.call(g,_)&&(c[_]=g[_])}return c};var a=Object.prototype.hasOwnProperty;return wr}();function o(a,c,u){var g=a;return e(c)?(u=c,typeof a=="string"&&(g={uri:a})):g=r(c,{uri:a}),g.callback=u,g}function i(a,c,u){return s(c=o(a,c,u))}function s(a){if(a.callback===void 0)throw new Error("callback argument missing");var c=!1,u=function(k,A,W){c||(c=!0,a.callback(k,A,W))};function g(){var k=void 0;if(k=d.response?d.response:d.responseText||function(A){try{if(A.responseType==="document")return A.responseXML;var W=A.responseXML&&A.responseXML.documentElement.nodeName==="parsererror";if(A.responseType===""&&!W)return A.responseXML}catch{}return null}(d),D)try{k=JSON.parse(k)}catch{}return k}function _(k){return clearTimeout(h),k instanceof Error||(k=new Error(""+(k||"Unknown XMLHttpRequest Error"))),k.statusCode=0,u(k,R)}function x(){if(!z){var k;clearTimeout(h),k=a.useXDR&&d.status===void 0?200:d.status===1223?204:d.status;var A=R,W=null;return k!==0?(A={body:g(),statusCode:k,method:v,headers:{},url:b,rawRequest:d},d.getAllResponseHeaders&&(A.headers=n(d.getAllResponseHeaders()))):W=new Error("Internal XMLHttpRequest Error"),u(W,A,A.body)}}var T,z,d=a.xhr||null;d||(d=a.cors||a.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var h,b=d.url=a.uri||a.url,v=d.method=a.method||"GET",f=a.body||a.data,w=d.headers=a.headers||{},B=!!a.sync,D=!1,R={body:void 0,headers:{},statusCode:0,method:v,url:b,rawRequest:d};if("json"in a&&a.json!==!1&&(D=!0,w.accept||w.Accept||(w.Accept="application/json"),v!=="GET"&&v!=="HEAD"&&(w["content-type"]||w["Content-Type"]||(w["Content-Type"]="application/json"),f=JSON.stringify(a.json===!0?f:a.json))),d.onreadystatechange=function(){d.readyState===4&&setTimeout(x,0)},d.onload=x,d.onerror=_,d.onprogress=function(){},d.onabort=function(){z=!0},d.ontimeout=_,d.open(v,b,!B,a.username,a.password),B||(d.withCredentials=!!a.withCredentials),!B&&a.timeout>0&&(h=setTimeout(function(){if(!z){z=!0,d.abort("timeout");var k=new Error("XMLHttpRequest timeout");k.code="ETIMEDOUT",_(k)}},a.timeout)),d.setRequestHeader)for(T in w)w.hasOwnProperty(T)&&d.setRequestHeader(T,w[T]);else if(a.headers&&!function(k){for(var A in k)if(k.hasOwnProperty(A))return!1;return!0}(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(d.responseType=a.responseType),"beforeSend"in a&&typeof a.beforeSend=="function"&&a.beforeSend(d),d.send(f||null),d}return ln.exports=i,ln.exports.default=i,i.XMLHttpRequest=t.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:t.XDomainRequest,function(a,c){for(var u=0;u<a.length;u++)c(a[u])}(["get","put","post","patch","head","delete"],function(a){i[a==="delete"?"del":a]=function(c,u,g){return(u=o(c,u,g)).method=a.toUpperCase(),s(u)}}),ln.exports}(),la=jt(ca);const ua=[200,201,202,204,308],ha=[408,502,503,504];class yi{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.fileName=encodeURI(this.file.name),this.headers=e.headers||{},this.method=e.method||"PUT",this.chunkSize=e.chunkSize||5120,this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.md5=e.md5||"",this.maxFileBytes=1024*(e.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=sr(),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(e,n){this.eventTarget.on(e,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(e,n){this.eventTarget.emit(e,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(e=>(this.endpointValue=e,this.endpointValue))}getChunk(){return new Promise(e=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,r=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),e(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(r,r+n))})}xhrPromise(e){const n=r=>{r.upload.onprogress=o=>{const i=100/this.totalChunks,s=i*this.file.size,a=i*this.chunkCount,c=o.loaded/(o.total??s)*i;this.dispatch("progress",Math.min(a+c,100))}};return new Promise((r,o)=>{this.currentXhr=la({...e,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?o(i):r(s)))})}sendChunk(){if(!this.chunk)return;const e=this.chunkCount*this.chunkByteSize,n=e+this.chunk.size-1,r={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${e}-${n}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:r,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(){console.log(this.paused,this.offline,this.success,"sendChunks this.paused || this.offline || this.success"),!(this.paused||this.offline||this.success)&&this.getChunk().then(()=>this.sendChunk()).then(e=>{if(this.attemptCount=this.attemptCount+1,e!=null&&ua.includes(e.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:e}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const n=this.chunkCount/this.totalChunks*this.file.size*100/this.file.size;this.dispatch("progress",n)}else if(e!=null&&ha.includes(e.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(e=>{this.paused||this.offline||this.manageRetries()})}}const da=new class{hasClass(t,e){return t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}addClass(t,e){this.hasClass(t,e)||(t.className+=" "+e)}removeClass(t,e){if(this.hasClass(t,e)){const n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}toggleClass(t,e){this.hasClass(t,e)?this.removeClass(t,e):this.addClass(t,e)}setCSSProperty(t,e,n){t?.style.setProperty(e,n)}};class At{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!mt.isNullOrEmpty(e)){if(At.httpTransport||(At.httpTransport=new Ws.HttpTransport),this.client=new Lt.Client(e),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=e,this.init()}}init(){this.client&&this.client.useServiceAsync().then(e=>{this.hproseProxy=e}).catch(e=>{String(e).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):Ve.emit(fe.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(e)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(e){console.warn(e),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(e,n,r){if(this.client)return await this.client.invoke(e,n,r)}encode(e,n,r){if(this.client)return this.client.codec.encode(e,n,r)}decode(e,n){if(this.client)return this.client.codec.decode(e,n)}}class Ct{hproseClient;hpProxyObj;defaultContext=new Lt.ClientContext;constructor(e){this.hproseClient=new At(e),this.hpProxyObj=null}getClientContext(e,n){const r={};n&&(r.requestHeaders=n);const o=Xe();r.httpRequestHeaders=e||{};const i=r.httpRequestHeaders;return o&&(i.token=o.token),O.SystemID&&(i.sysid=O.SystemID,O.SystemGroup&&(i.sysgroup=O.SystemGroup)),new Lt.ClientContext(r)}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 e=await this.hproseClient.getProxy();this.hpProxyObj=e}return this.hpProxyObj||Ve.emit(fe.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,n,r){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(e,n,r)}async hproseInvokeContext(e,n,...r){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const o=Xe();return console.log(o,"userToken3"),o&&(n||(n=new Lt.ClientContext({httpRequestHeaders:{token:o.token}}))),await this.hproseClient.invoke(e,r,n)}async hproseInvokeEncode(e){const n=new ve.ByteStream(e).toBytes(),r=await this.hproseClient.client?.request(n,this.defaultContext);return r&&this.hproseClient.client?.codec.decode(r,this.defaultContext)}encodeRequest(e,...n){const r=this.hproseClient.client?.codec?.encode(e,n,this.defaultContext);return ve.ByteStream.toString(r)}}const br=new Map;function wi(t){if(t&&mt.isNotEmpty(t)){if(br.has(t))return br.get(t);{const e=new Ct(t);return br.set(t,e),e}}}const Ge=p.reactive({isLock:!1,lockTime:0});function un(t){Ge.isLock=t,t&&(gr(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}let _r;function Et(){clearInterval(_r),!(window.location.href.indexOf("/login")>0||Ge.isLock)&&(un(!1),Ge.lockTime=function(){let t=3600;return O.Config.UI?.LockTime&&O.Config.UI?.LockTime>=10&&(t=O.Config.UI.LockTime),t}(),_r=setInterval(()=>{if(Ge.lockTime--,Ge.lockTime<=0)return un(!0),clearInterval(_r)},1e3))}function Sr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var bi,_i={exports:{}};/*!
|
|
4
4
|
localForage -- Offline Storage, Improved
|
|
5
5
|
Version 1.10.0
|
|
6
6
|
https://localforage.github.io/localForage
|
|
7
7
|
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
8
|
-
*/var To,Ei=(xo||(xo=1,Io.exports=function t(e,n,o){function r(c,h){if(!n[c]){if(!e[c]){if(!h&&sn)return sn(c);if(i)return i(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var C=n[c]={exports:{}};e[c][0].call(C.exports,function(k){var $=e[c][1][k];return r($||k)},C,C.exports,t,e,n,o)}return n[c].exports}for(var i=sn,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(t,e,n){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var c=0,h=new s($),m=o.document.createTextNode("");h.observe(m,{characterData:!0}),r=function(){m.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var z=o.document.createElement("script");z.onreadystatechange=function(){$(),z.onreadystatechange=null,z.parentNode.removeChild(z),z=null},o.document.documentElement.appendChild(z)}:function(){setTimeout($,0)};else{var C=new o.MessageChannel;C.port1.onmessage=$,r=function(){C.port2.postMessage(0)}}var k=[];function $(){var z,p;i=!0;for(var u=k.length;u;){for(p=k,k=[],z=-1;++z<u;)p[z]();u=k.length}i=!1}function A(z){k.push(z)!==1||i||r()}e.exports=A}).call(this,Ie!==void 0?Ie:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,e,n){var o=t(1);function r(){}var i={},s=["REJECTED"],c=["FULFILLED"],h=["PENDING"];function m(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,g!==r&&A(this,g)}function C(g,w,B){this.promise=g,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof B=="function"&&(this.onRejected=B,this.callRejected=this.otherCallRejected)}function k(g,w,B){o(function(){var D;try{D=w(B)}catch(R){return i.reject(g,R)}D===g?i.reject(g,new TypeError("Cannot resolve promise with itself")):i.resolve(g,D)})}function $(g){var w=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof w=="function")return function(){w.apply(g,arguments)}}function A(g,w){var B=!1;function D(j){B||(B=!0,i.reject(g,j))}function R(j){B||(B=!0,i.resolve(g,j))}function L(){w(R,D)}var U=z(L);U.status==="error"&&D(U.value)}function z(g,w){var B={};try{B.value=g(w),B.status="success"}catch(D){B.status="error",B.value=D}return B}function p(g){return g instanceof this?g:i.resolve(new this(r),g)}function u(g){var w=new this(r);return i.reject(w,g)}function y(g){var w=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var B=g.length,D=!1;if(!B)return this.resolve([]);for(var R=new Array(B),L=0,U=-1,j=new this(r);++U<B;)P(g[U],U);return j;function P(F,V){function oe(Q){R[V]=Q,++L!==B||D||(D=!0,i.resolve(j,R))}w.resolve(F).then(oe,function(Q){D||(D=!0,i.reject(j,Q))})}}function v(g){var w=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var B=g.length,D=!1;if(!B)return this.resolve([]);for(var R=-1,L=new this(r);++R<B;)U(g[R]);return L;function U(j){w.resolve(j).then(function(P){D||(D=!0,i.resolve(L,P))},function(P){D||(D=!0,i.reject(L,P))})}}e.exports=m,m.prototype.catch=function(g){return this.then(null,g)},m.prototype.then=function(g,w){if(typeof g!="function"&&this.state===c||typeof w!="function"&&this.state===s)return this;var B=new this.constructor(r);return this.state!==h?k(B,this.state===c?g:w,this.outcome):this.queue.push(new C(B,g,w)),B},C.prototype.callFulfilled=function(g){i.resolve(this.promise,g)},C.prototype.otherCallFulfilled=function(g){k(this.promise,this.onFulfilled,g)},C.prototype.callRejected=function(g){i.reject(this.promise,g)},C.prototype.otherCallRejected=function(g){k(this.promise,this.onRejected,g)},i.resolve=function(g,w){var B=z($,w);if(B.status==="error")return i.reject(g,B.value);var D=B.value;if(D)A(g,D);else{g.state=c,g.outcome=w;for(var R=-1,L=g.queue.length;++R<L;)g.queue[R].callFulfilled(w)}return g},i.reject=function(g,w){g.state=s,g.outcome=w;for(var B=-1,D=g.queue.length;++B<D;)g.queue[B].callRejected(w);return g},m.resolve=p,m.reject=u,m.all=y,m.race=v},{1:1}],3:[function(t,e,n){(function(o){typeof o.Promise!="function"&&(o.Promise=t(2))}).call(this,Ie!==void 0?Ie:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,e,n){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function r(a,d){if(!(a instanceof d))throw new TypeError("Cannot call a class as a function")}function i(){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 s=i();function c(){try{if(!s||!s.open)return!1;var a=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!a||d)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function h(a,d){a=a||[],d=d||{};try{return new Blob(a,d)}catch(b){if(b.name!=="TypeError")throw b;for(var f=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),_=0;_<a.length;_+=1)f.append(a[_]);return f.getBlob(d.type)}}typeof Promise>"u"&&t(3);var m=Promise;function C(a,d){d&&a.then(function(f){d(null,f)},function(f){d(f)})}function k(a,d,f){typeof d=="function"&&a.then(d),typeof f=="function"&&a.catch(f)}function $(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function A(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var z="local-forage-detect-blob-support",p=void 0,u={},y=Object.prototype.toString,v="readonly",g="readwrite";function w(a){for(var d=a.length,f=new ArrayBuffer(d),_=new Uint8Array(f),b=0;b<d;b++)_[b]=a.charCodeAt(b);return f}function B(a){return new m(function(d){var f=a.transaction(z,g),_=h([""]);f.objectStore(z).put(_,"key"),f.onabort=function(b){b.preventDefault(),b.stopPropagation(),d(!1)},f.oncomplete=function(){var b=navigator.userAgent.match(/Chrome\/(\d+)/),S=navigator.userAgent.match(/Edge\//);d(S||!b||parseInt(b[1],10)>=43)}}).catch(function(){return!1})}function D(a){return typeof p=="boolean"?m.resolve(p):B(a).then(function(d){return p=d})}function R(a){var d=u[a.name],f={};f.promise=new m(function(_,b){f.resolve=_,f.reject=b}),d.deferredOperations.push(f),d.dbReady?d.dbReady=d.dbReady.then(function(){return f.promise}):d.dbReady=f.promise}function L(a){var d=u[a.name].deferredOperations.pop();if(d)return d.resolve(),d.promise}function U(a,d){var f=u[a.name].deferredOperations.pop();if(f)return f.reject(d),f.promise}function j(a,d){return new m(function(f,_){if(u[a.name]=u[a.name]||Rn(),a.db){if(!d)return f(a.db);R(a),a.db.close()}var b=[a.name];d&&b.push(a.version);var S=s.open.apply(s,b);d&&(S.onupgradeneeded=function(E){var I=S.result;try{I.createObjectStore(a.storeName),E.oldVersion<=1&&I.createObjectStore(z)}catch(T){if(T.name!=="ConstraintError")throw T;console.warn('The database "'+a.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+a.storeName+'" already exists.')}}),S.onerror=function(E){E.preventDefault(),_(S.error)},S.onsuccess=function(){var E=S.result;E.onversionchange=function(I){I.target.close()},f(E),L(a)}})}function P(a){return j(a,!1)}function F(a){return j(a,!0)}function V(a,d){if(!a.db)return!0;var f=!a.db.objectStoreNames.contains(a.storeName),_=a.version<a.db.version,b=a.version>a.db.version;if(_&&(a.version!==d&&console.warn('The database "'+a.name+`" can't be downgraded from version `+a.db.version+" to version "+a.version+"."),a.version=a.db.version),b||f){if(f){var S=a.db.version+1;S>a.version&&(a.version=S)}return!0}return!1}function oe(a){return new m(function(d,f){var _=new FileReader;_.onerror=f,_.onloadend=function(b){var S=btoa(b.target.result||"");d({__local_forage_encoded_blob:!0,data:S,type:a.type})},_.readAsBinaryString(a)})}function Q(a){return h([w(atob(a.data))],{type:a.type})}function de(a){return a&&a.__local_forage_encoded_blob}function Ve(a){var d=this,f=d._initReady().then(function(){var _=u[d._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return k(f,a,a),f}function Et(a){R(a);for(var d=u[a.name],f=d.forages,_=0;_<f.length;_++){var b=f[_];b._dbInfo.db&&(b._dbInfo.db.close(),b._dbInfo.db=null)}return a.db=null,P(a).then(function(S){return a.db=S,V(a)?F(a):S}).then(function(S){a.db=d.db=S;for(var E=0;E<f.length;E++)f[E]._dbInfo.db=S}).catch(function(S){throw U(a,S),S})}function ue(a,d,f,_){_===void 0&&(_=1);try{var b=a.db.transaction(a.storeName,d);f(null,b)}catch(S){if(_>0&&(!a.db||S.name==="InvalidStateError"||S.name==="NotFoundError"))return m.resolve().then(function(){if(!a.db||S.name==="NotFoundError"&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),F(a)}).then(function(){return Et(a).then(function(){ue(a,d,f,_-1)})}).catch(f);f(S)}}function Rn(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ir(a){var d=this,f={db:null};if(a)for(var _ in a)f[_]=a[_];var b=u[f.name];b||(b=Rn(),u[f.name]=b),b.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=Ve);var S=[];function E(){return m.resolve()}for(var I=0;I<b.forages.length;I++){var T=b.forages[I];T!==d&&S.push(T._initReady().catch(E))}var M=b.forages.slice(0);return m.all(S).then(function(){return f.db=b.db,P(f)}).then(function(N){return f.db=N,V(f,d._defaultConfig.version)?F(f):N}).then(function(N){f.db=b.db=N,d._dbInfo=f;for(var O=0;O<M.length;O++){var q=M[O];q!==d&&(q._dbInfo.db=f.db,q._dbInfo.version=f.version)}})}function sr(a,d){var f=this;a=$(a);var _=new m(function(b,S){f.ready().then(function(){ue(f._dbInfo,v,function(E,I){if(E)return S(E);try{var T=I.objectStore(f._dbInfo.storeName).get(a);T.onsuccess=function(){var M=T.result;M===void 0&&(M=null),de(M)&&(M=Q(M)),b(M)},T.onerror=function(){S(T.error)}}catch(M){S(M)}})}).catch(S)});return C(_,d),_}function ar(a,d){var f=this,_=new m(function(b,S){f.ready().then(function(){ue(f._dbInfo,v,function(E,I){if(E)return S(E);try{var T=I.objectStore(f._dbInfo.storeName).openCursor(),M=1;T.onsuccess=function(){var N=T.result;if(N){var O=N.value;de(O)&&(O=Q(O));var q=a(O,N.key,M++);q!==void 0?b(q):N.continue()}else b()},T.onerror=function(){S(T.error)}}catch(N){S(N)}})}).catch(S)});return C(_,d),_}function cr(a,d,f){var _=this;a=$(a);var b=new m(function(S,E){var I;_.ready().then(function(){return I=_._dbInfo,y.call(d)==="[object Blob]"?D(I.db).then(function(T){return T?d:oe(d)}):d}).then(function(T){ue(_._dbInfo,g,function(M,N){if(M)return E(M);try{var O=N.objectStore(_._dbInfo.storeName);T===null&&(T=void 0);var q=O.put(T,a);N.oncomplete=function(){T===void 0&&(T=null),S(T)},N.onabort=N.onerror=function(){var X=q.error?q.error:q.transaction.error;E(X)}}catch(X){E(X)}})}).catch(E)});return C(b,f),b}function lr(a,d){var f=this;a=$(a);var _=new m(function(b,S){f.ready().then(function(){ue(f._dbInfo,g,function(E,I){if(E)return S(E);try{var T=I.objectStore(f._dbInfo.storeName).delete(a);I.oncomplete=function(){b()},I.onerror=function(){S(T.error)},I.onabort=function(){var M=T.error?T.error:T.transaction.error;S(M)}}catch(M){S(M)}})}).catch(S)});return C(_,d),_}function ur(a){var d=this,f=new m(function(_,b){d.ready().then(function(){ue(d._dbInfo,g,function(S,E){if(S)return b(S);try{var I=E.objectStore(d._dbInfo.storeName).clear();E.oncomplete=function(){_()},E.onabort=E.onerror=function(){var T=I.error?I.error:I.transaction.error;b(T)}}catch(T){b(T)}})}).catch(b)});return C(f,a),f}function hr(a){var d=this,f=new m(function(_,b){d.ready().then(function(){ue(d._dbInfo,v,function(S,E){if(S)return b(S);try{var I=E.objectStore(d._dbInfo.storeName).count();I.onsuccess=function(){_(I.result)},I.onerror=function(){b(I.error)}}catch(T){b(T)}})}).catch(b)});return C(f,a),f}function dr(a,d){var f=this,_=new m(function(b,S){a<0?b(null):f.ready().then(function(){ue(f._dbInfo,v,function(E,I){if(E)return S(E);try{var T=I.objectStore(f._dbInfo.storeName),M=!1,N=T.openKeyCursor();N.onsuccess=function(){var O=N.result;O?a===0||M?b(O.key):(M=!0,O.advance(a)):b(null)},N.onerror=function(){S(N.error)}}catch(O){S(O)}})}).catch(S)});return C(_,d),_}function fr(a){var d=this,f=new m(function(_,b){d.ready().then(function(){ue(d._dbInfo,v,function(S,E){if(S)return b(S);try{var I=E.objectStore(d._dbInfo.storeName).openKeyCursor(),T=[];I.onsuccess=function(){var M=I.result;M?(T.push(M.key),M.continue()):_(T)},I.onerror=function(){b(I.error)}}catch(M){b(M)}})}).catch(b)});return C(f,a),f}function pr(a,d){d=A.apply(this,arguments);var f=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||f.name,a.storeName=a.storeName||f.storeName);var _,b=this;if(a.name){var S=a.name===f.name&&b._dbInfo.db?m.resolve(b._dbInfo.db):P(a).then(function(E){var I=u[a.name],T=I.forages;I.db=E;for(var M=0;M<T.length;M++)T[M]._dbInfo.db=E;return E});_=a.storeName?S.then(function(E){if(E.objectStoreNames.contains(a.storeName)){var I=E.version+1;R(a);var T=u[a.name],M=T.forages;E.close();for(var N=0;N<M.length;N++){var O=M[N];O._dbInfo.db=null,O._dbInfo.version=I}var q=new m(function(X,K){var ee=s.open(a.name,I);ee.onerror=function(fe){ee.result.close(),K(fe)},ee.onupgradeneeded=function(){ee.result.deleteObjectStore(a.storeName)},ee.onsuccess=function(){var fe=ee.result;fe.close(),X(fe)}});return q.then(function(X){T.db=X;for(var K=0;K<M.length;K++){var ee=M[K];ee._dbInfo.db=X,L(ee._dbInfo)}}).catch(function(X){throw(U(a,X)||m.resolve()).catch(function(){}),X})}}):S.then(function(E){R(a);var I=u[a.name],T=I.forages;E.close();for(var M=0;M<T.length;M++)T[M]._dbInfo.db=null;var N=new m(function(O,q){var X=s.deleteDatabase(a.name);X.onerror=function(){var K=X.result;K&&K.close(),q(X.error)},X.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},X.onsuccess=function(){var K=X.result;K&&K.close(),O(K)}});return N.then(function(O){I.db=O;for(var q=0;q<T.length;q++)L(T[q]._dbInfo)}).catch(function(O){throw(U(a,O)||m.resolve()).catch(function(){}),O})})}else _=m.reject("Invalid arguments");return C(_,d),_}var gr={_driver:"asyncStorage",_initStorage:ir,_support:c(),iterate:ar,getItem:sr,setItem:cr,removeItem:lr,clear:ur,length:hr,key:dr,keys:fr,dropInstance:pr};function mr(){return typeof openDatabase=="function"}var pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vr="~~local_forage_type~",Pn=/^~~local_forage_type~([^~]+)~/,Xe="__lfsc__:",kt=Xe.length,xt="arbf",It="blob",Mn="si08",zn="ui08",Ln="uic8",Dn="si16",An="si32",Bn="ur16",$n="ui32",Nn="fl32",Wn="fl64",Un=kt+xt.length,On=Object.prototype.toString;function jn(a){var d,f,_,b,S,E=.75*a.length,I=a.length,T=0;a[a.length-1]==="="&&(E--,a[a.length-2]==="="&&E--);var M=new ArrayBuffer(E),N=new Uint8Array(M);for(d=0;d<I;d+=4)f=pe.indexOf(a[d]),_=pe.indexOf(a[d+1]),b=pe.indexOf(a[d+2]),S=pe.indexOf(a[d+3]),N[T++]=f<<2|_>>4,N[T++]=(15&_)<<4|b>>2,N[T++]=(3&b)<<6|63&S;return M}function Tt(a){var d,f=new Uint8Array(a),_="";for(d=0;d<f.length;d+=3)_+=pe[f[d]>>2],_+=pe[(3&f[d])<<4|f[d+1]>>4],_+=pe[(15&f[d+1])<<2|f[d+2]>>6],_+=pe[63&f[d+2]];return f.length%3==2?_=_.substring(0,_.length-1)+"=":f.length%3==1&&(_=_.substring(0,_.length-2)+"=="),_}function yr(a,d){var f="";if(a&&(f=On.call(a)),a&&(f==="[object ArrayBuffer]"||a.buffer&&On.call(a.buffer)==="[object ArrayBuffer]")){var _,b=Xe;a instanceof ArrayBuffer?(_=a,b+=xt):(_=a.buffer,f==="[object Int8Array]"?b+=Mn:f==="[object Uint8Array]"?b+=zn:f==="[object Uint8ClampedArray]"?b+=Ln:f==="[object Int16Array]"?b+=Dn:f==="[object Uint16Array]"?b+=Bn:f==="[object Int32Array]"?b+=An:f==="[object Uint32Array]"?b+=$n:f==="[object Float32Array]"?b+=Nn:f==="[object Float64Array]"?b+=Wn:d(new Error("Failed to get type for BinaryArray"))),d(b+Tt(_))}else if(f==="[object Blob]"){var S=new FileReader;S.onload=function(){var E=vr+a.type+"~"+Tt(this.result);d(Xe+It+E)},S.readAsArrayBuffer(a)}else try{d(JSON.stringify(a))}catch(E){console.error("Couldn't convert value into a JSON string: ",a),d(null,E)}}function wr(a){if(a.substring(0,kt)!==Xe)return JSON.parse(a);var d,f=a.substring(Un),_=a.substring(kt,Un);if(_===It&&Pn.test(f)){var b=f.match(Pn);d=b[1],f=f.substring(b[0].length)}var S=jn(f);switch(_){case xt:return S;case It:return h([S],{type:d});case Mn:return new Int8Array(S);case zn:return new Uint8Array(S);case Ln:return new Uint8ClampedArray(S);case Dn:return new Int16Array(S);case Bn:return new Uint16Array(S);case An:return new Int32Array(S);case $n:return new Uint32Array(S);case Nn:return new Float32Array(S);case Wn:return new Float64Array(S);default:throw new Error("Unkown type: "+_)}}var Rt={serialize:yr,deserialize:wr,stringToBuffer:jn,bufferToString:Tt};function Hn(a,d,f,_){a.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],f,_)}function br(a){var d=this,f={db:null};if(a)for(var _ in a)f[_]=typeof a[_]!="string"?a[_].toString():a[_];var b=new m(function(S,E){try{f.db=openDatabase(f.name,String(f.version),f.description,f.size)}catch(I){return E(I)}f.db.transaction(function(I){Hn(I,f,function(){d._dbInfo=f,S()},function(T,M){E(M)})},E)});return f.serializer=Rt,b}function ge(a,d,f,_,b,S){a.executeSql(f,_,b,function(E,I){I.code===I.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(T,M){M.rows.length?S(T,I):Hn(T,d,function(){T.executeSql(f,_,b,S)},S)},S):S(E,I)},S)}function _r(a,d){var f=this;a=$(a);var _=new m(function(b,S){f.ready().then(function(){var E=f._dbInfo;E.db.transaction(function(I){ge(I,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[a],function(T,M){var N=M.rows.length?M.rows.item(0).value:null;N&&(N=E.serializer.deserialize(N)),b(N)},function(T,M){S(M)})})}).catch(S)});return C(_,d),_}function Sr(a,d){var f=this,_=new m(function(b,S){f.ready().then(function(){var E=f._dbInfo;E.db.transaction(function(I){ge(I,E,"SELECT * FROM "+E.storeName,[],function(T,M){for(var N=M.rows,O=N.length,q=0;q<O;q++){var X=N.item(q),K=X.value;if(K&&(K=E.serializer.deserialize(K)),(K=a(K,X.key,q+1))!==void 0)return void b(K)}b()},function(T,M){S(M)})})}).catch(S)});return C(_,d),_}function Fn(a,d,f,_){var b=this;a=$(a);var S=new m(function(E,I){b.ready().then(function(){d===void 0&&(d=null);var T=d,M=b._dbInfo;M.serializer.serialize(d,function(N,O){O?I(O):M.db.transaction(function(q){ge(q,M,"INSERT OR REPLACE INTO "+M.storeName+" (key, value) VALUES (?, ?)",[a,N],function(){E(T)},function(X,K){I(K)})},function(q){if(q.code===q.QUOTA_ERR){if(_>0)return void E(Fn.apply(b,[a,T,f,_-1]));I(q)}})})}).catch(I)});return C(S,f),S}function Cr(a,d,f){return Fn.apply(this,[a,d,f,1])}function Er(a,d){var f=this;a=$(a);var _=new m(function(b,S){f.ready().then(function(){var E=f._dbInfo;E.db.transaction(function(I){ge(I,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[a],function(){b()},function(T,M){S(M)})})}).catch(S)});return C(_,d),_}function kr(a){var d=this,f=new m(function(_,b){d.ready().then(function(){var S=d._dbInfo;S.db.transaction(function(E){ge(E,S,"DELETE FROM "+S.storeName,[],function(){_()},function(I,T){b(T)})})}).catch(b)});return C(f,a),f}function xr(a){var d=this,f=new m(function(_,b){d.ready().then(function(){var S=d._dbInfo;S.db.transaction(function(E){ge(E,S,"SELECT COUNT(key) as c FROM "+S.storeName,[],function(I,T){var M=T.rows.item(0).c;_(M)},function(I,T){b(T)})})}).catch(b)});return C(f,a),f}function Ir(a,d){var f=this,_=new m(function(b,S){f.ready().then(function(){var E=f._dbInfo;E.db.transaction(function(I){ge(I,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[a+1],function(T,M){var N=M.rows.length?M.rows.item(0).key:null;b(N)},function(T,M){S(M)})})}).catch(S)});return C(_,d),_}function Tr(a){var d=this,f=new m(function(_,b){d.ready().then(function(){var S=d._dbInfo;S.db.transaction(function(E){ge(E,S,"SELECT key FROM "+S.storeName,[],function(I,T){for(var M=[],N=0;N<T.rows.length;N++)M.push(T.rows.item(N).key);_(M)},function(I,T){b(T)})})}).catch(b)});return C(f,a),f}function Rr(a){return new m(function(d,f){a.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(b,S){for(var E=[],I=0;I<S.rows.length;I++)E.push(S.rows.item(I).name);d({db:a,storeNames:E})},function(b,S){f(S)})},function(_){f(_)})})}function Pr(a,d){d=A.apply(this,arguments);var f=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||f.name,a.storeName=a.storeName||f.storeName);var _,b=this;return _=a.name?new m(function(S){var E;E=a.name===f.name?b._dbInfo.db:openDatabase(a.name,"","",0),a.storeName?S({db:E,storeNames:[a.storeName]}):S(Rr(E))}).then(function(S){return new m(function(E,I){S.db.transaction(function(T){function M(X){return new m(function(K,ee){T.executeSql("DROP TABLE IF EXISTS "+X,[],function(){K()},function(fe,zt){ee(zt)})})}for(var N=[],O=0,q=S.storeNames.length;O<q;O++)N.push(M(S.storeNames[O]));m.all(N).then(function(){E()}).catch(function(X){I(X)})},function(T){I(T)})})}):m.reject("Invalid arguments"),C(_,d),_}var Mr={_driver:"webSQLStorage",_initStorage:br,_support:mr(),iterate:Sr,getItem:_r,setItem:Cr,removeItem:Er,clear:kr,length:xr,key:Ir,keys:Tr,dropInstance:Pr};function zr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qn(a,d){var f=a.name+"/";return a.storeName!==d.storeName&&(f+=a.storeName+"/"),f}function Lr(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function Dr(){return!Lr()||localStorage.length>0}function Ar(a){var d=this,f={};if(a)for(var _ in a)f[_]=a[_];return f.keyPrefix=qn(a,d._defaultConfig),Dr()?(d._dbInfo=f,f.serializer=Rt,m.resolve()):m.reject()}function Br(a){var d=this,f=d.ready().then(function(){for(var _=d._dbInfo.keyPrefix,b=localStorage.length-1;b>=0;b--){var S=localStorage.key(b);S.indexOf(_)===0&&localStorage.removeItem(S)}});return C(f,a),f}function $r(a,d){var f=this;a=$(a);var _=f.ready().then(function(){var b=f._dbInfo,S=localStorage.getItem(b.keyPrefix+a);return S&&(S=b.serializer.deserialize(S)),S});return C(_,d),_}function Nr(a,d){var f=this,_=f.ready().then(function(){for(var b=f._dbInfo,S=b.keyPrefix,E=S.length,I=localStorage.length,T=1,M=0;M<I;M++){var N=localStorage.key(M);if(N.indexOf(S)===0){var O=localStorage.getItem(N);if(O&&(O=b.serializer.deserialize(O)),(O=a(O,N.substring(E),T++))!==void 0)return O}}});return C(_,d),_}function Wr(a,d){var f=this,_=f.ready().then(function(){var b,S=f._dbInfo;try{b=localStorage.key(a)}catch{b=null}return b&&(b=b.substring(S.keyPrefix.length)),b});return C(_,d),_}function Ur(a){var d=this,f=d.ready().then(function(){for(var _=d._dbInfo,b=localStorage.length,S=[],E=0;E<b;E++){var I=localStorage.key(E);I.indexOf(_.keyPrefix)===0&&S.push(I.substring(_.keyPrefix.length))}return S});return C(f,a),f}function Or(a){var d=this.keys().then(function(f){return f.length});return C(d,a),d}function jr(a,d){var f=this;a=$(a);var _=f.ready().then(function(){var b=f._dbInfo;localStorage.removeItem(b.keyPrefix+a)});return C(_,d),_}function Hr(a,d,f){var _=this;a=$(a);var b=_.ready().then(function(){d===void 0&&(d=null);var S=d;return new m(function(E,I){var T=_._dbInfo;T.serializer.serialize(d,function(M,N){if(N)I(N);else try{localStorage.setItem(T.keyPrefix+a,M),E(S)}catch(O){O.name!=="QuotaExceededError"&&O.name!=="NS_ERROR_DOM_QUOTA_REACHED"||I(O),I(O)}})})});return C(b,f),b}function Fr(a,d){if(d=A.apply(this,arguments),!(a=typeof a!="function"&&a||{}).name){var f=this.config();a.name=a.name||f.name,a.storeName=a.storeName||f.storeName}var _,b=this;return _=a.name?new m(function(S){a.storeName?S(qn(a,b._defaultConfig)):S(a.name+"/")}).then(function(S){for(var E=localStorage.length-1;E>=0;E--){var I=localStorage.key(E);I.indexOf(S)===0&&localStorage.removeItem(I)}}):m.reject("Invalid arguments"),C(_,d),_}var qr={_driver:"localStorageWrapper",_initStorage:Ar,_support:zr(),iterate:Nr,getItem:$r,setItem:Hr,removeItem:jr,clear:Br,length:Or,key:Wr,keys:Ur,dropInstance:Fr},Vr=function(a,d){return a===d||typeof a=="number"&&typeof d=="number"&&isNaN(a)&&isNaN(d)},Xr=function(a,d){for(var f=a.length,_=0;_<f;){if(Vr(a[_],d))return!0;_++}return!1},Vn=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},ze={},Xn={},xe={INDEXEDDB:gr,WEBSQL:Mr,LOCALSTORAGE:qr},Kr=[xe.INDEXEDDB._driver,xe.WEBSQL._driver,xe.LOCALSTORAGE._driver],Ke=["dropInstance"],Pt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ke),Gr={description:"",driver:Kr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Yr(a,d){a[d]=function(){var f=arguments;return a.ready().then(function(){return a[d].apply(a,f)})}}function Mt(){for(var a=1;a<arguments.length;a++){var d=arguments[a];if(d)for(var f in d)d.hasOwnProperty(f)&&(Vn(d[f])?arguments[0][f]=d[f].slice():arguments[0][f]=d[f])}return arguments[0]}var Jr=function(){function a(d){for(var f in r(this,a),xe)if(xe.hasOwnProperty(f)){var _=xe[f],b=_._driver;this[f]=b,ze[b]||this.defineDriver(_)}this._defaultConfig=Mt({},Gr),this._config=Mt({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return a.prototype.config=function(d){if((d===void 0?"undefined":o(d))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var f in d){if(f==="storeName"&&(d[f]=d[f].replace(/\W/g,"_")),f==="version"&&typeof d[f]!="number")return new Error("Database version must be a number.");this._config[f]=d[f]}return!("driver"in d)||!d.driver||this.setDriver(this._config.driver)}return typeof d=="string"?this._config[d]:this._config},a.prototype.defineDriver=function(d,f,_){var b=new m(function(S,E){try{var I=d._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!d._driver)return void E(T);for(var M=Pt.concat("_initStorage"),N=0,O=M.length;N<O;N++){var q=M[N];if((!Xr(Ke,q)||d[q])&&typeof d[q]!="function")return void E(T)}var X=function(){for(var ee=function(Qr){return function(){var ei=new Error("Method "+Qr+" is not implemented by the current driver"),Kn=m.reject(ei);return C(Kn,arguments[arguments.length-1]),Kn}},fe=0,zt=Ke.length;fe<zt;fe++){var Lt=Ke[fe];d[Lt]||(d[Lt]=ee(Lt))}};X();var K=function(ee){ze[I]&&console.info("Redefining LocalForage driver: "+I),ze[I]=d,Xn[I]=ee,S()};"_support"in d?d._support&&typeof d._support=="function"?d._support().then(K,E):K(!!d._support):K(!0)}catch(ee){E(ee)}});return k(b,f,_),b},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(d,f,_){var b=ze[d]?m.resolve(ze[d]):m.reject(new Error("Driver not found."));return k(b,f,_),b},a.prototype.getSerializer=function(d){var f=m.resolve(Rt);return k(f,d),f},a.prototype.ready=function(d){var f=this,_=f._driverSet.then(function(){return f._ready===null&&(f._ready=f._initDriver()),f._ready});return k(_,d,d),_},a.prototype.setDriver=function(d,f,_){var b=this;Vn(d)||(d=[d]);var S=this._getSupportedDrivers(d);function E(){b._config.driver=b.driver()}function I(N){return b._extend(N),E(),b._ready=b._initStorage(b._config),b._ready}function T(N){return function(){var O=0;function q(){for(;O<N.length;){var X=N[O];return O++,b._dbInfo=null,b._ready=null,b.getDriver(X).then(I).catch(q)}E();var K=new Error("No available storage method found.");return b._driverSet=m.reject(K),b._driverSet}return q()}}var M=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=M.then(function(){var N=S[0];return b._dbInfo=null,b._ready=null,b.getDriver(N).then(function(O){b._driver=O._driver,E(),b._wrapLibraryMethodsWithReady(),b._initDriver=T(S)})}).catch(function(){E();var N=new Error("No available storage method found.");return b._driverSet=m.reject(N),b._driverSet}),k(this._driverSet,f,_),this._driverSet},a.prototype.supports=function(d){return!!Xn[d]},a.prototype._extend=function(d){Mt(this,d)},a.prototype._getSupportedDrivers=function(d){for(var f=[],_=0,b=d.length;_<b;_++){var S=d[_];this.supports(S)&&f.push(S)}return f},a.prototype._wrapLibraryMethodsWithReady=function(){for(var d=0,f=Pt.length;d<f;d++)Yr(this,Pt[d])},a.prototype.createInstance=function(d){return new a(d)},a}(),Zr=new Jr;e.exports=Zr},{3:3}]},{},[4])(4)),Io.exports),ct=nt(Ei),Ro={exports:{}},ki=(To||(To=1,function(t){((e,n)=>{t.exports=n()})(0,()=>{const e=typeof window=="object"?window:this;e.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,o=!1;const r=e.WebStreamsPolyfill||{},i=e.isSecureContext;let s=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const c=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",h={createWriteStream:function(C,k,$){let A={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},z=0,p=null,u=null,y=null;if(Number.isFinite(k)?([$,k]=[k,$],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),A.size=$,A.writableStrategy=k):k&&k.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),A.size=$,A.writableStrategy=k):A=k||{},!s){n||(n=i?m(h.mitm):function(B){const D="width=200,height=100",R=document.createDocumentFragment(),L={frame:e.open(B,"popup",D),loaded:!1,isIframe:!1,isPopup:!0,remove(){L.frame.close()},addEventListener(...j){R.addEventListener(...j)},dispatchEvent(...j){R.dispatchEvent(...j)},removeEventListener(...j){R.removeEventListener(...j)},postMessage(...j){L.frame.postMessage(...j)}},U=j=>{j.source===L.frame&&(L.loaded=!0,e.removeEventListener("message",U),L.dispatchEvent(new Event("load")))};return e.addEventListener("message",U),L}(h.mitm)),u=new MessageChannel,C=encodeURIComponent(C.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const g={transferringReadable:o,pathname:A.pathname||Math.random().toString().slice(-6)+"/"+C,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+C}};A.size&&(g.headers["Content-Length"]=A.size);const w=[g,"*",[u.port2]];if(o){const B=c==="iframe"?void 0:{transform(R,L){if(!(R instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");z+=R.length,L.enqueue(R),p&&(location.href=p,p=null)},flush(){p&&(location.href=p)}};y=new h.TransformStream(B,A.writableStrategy,A.readableStrategy);const D=y.readable;u.port1.postMessage({readableStream:D},[D])}u.port1.onmessage=B=>{B.data.download?c==="navigate"?(n.remove(),n=null,z?location.href=B.data.download:p=B.data.download):(n.isPopup&&(n.remove(),n=null,c==="iframe"&&m(h.mitm)),m(B.data.download)):B.data.abort&&(v=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...w):n.addEventListener("load",()=>{n.postMessage(...w)},{once:!0})}let v=[];return!s&&y&&y.writable||new h.WritableStream({write(g){if(!(g instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?v.push(g):(u.port1.postMessage(g),z+=g.length,p&&(location.href=p,p=null))},close(){if(s){const g=new Blob(v,{type:"application/octet-stream; charset=utf-8"}),w=document.createElement("a");w.href=URL.createObjectURL(g),w.download=C,w.click()}else u.port1.postMessage("end")},abort(){v=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},A.writableStrategy)},WritableStream:e.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 m(C){if(!C)throw new Error("meh");const k=document.createElement("iframe");return k.hidden=!0,k.src=C,k.loaded=!1,k.name="iframe",k.isIframe=!0,k.postMessage=(...$)=>k.contentWindow.postMessage(...$),k.addEventListener("load",()=>{k.loaded=!0},{once:!0}),document.body.appendChild(k),k}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(C=>{try{C()}catch{}})(()=>{const{readable:C}=new TransformStream,k=new MessageChannel;k.port1.postMessage(C,[C]),k.port1.close(),k.port2.close(),o=!0,Object.defineProperty(h,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),h})}(Ro)),Ro.exports),xi=nt(ki);function Ii(t,e){const n=`${t}_${e}`;return se.MD5(n)}function Po(t){const e=function(c){if(!c)return;const h=c,m=[];if(h)for(let C of h){const k=Mo(C);k&&m.push(k)}return m}(t.bussinessRoutes),n=function(c){if(!c)return;const h=c;if(h&&h.length>0){const m=[];return h.forEach(C=>{const k=zo(C);k&&m.push(k)}),m}}(t.widgetMenuConfig),o=function(c){if(c&&c.length>0){const h=[];return c.forEach(m=>{const C=function(k){return k?{id:k.id,label:k.label,layoutID:k.layoutID,container:k.container,preload:k.preload,afterid:k.afterid,bindid:k.bindid,group:k.group}:void 0}(m);C&&h.push(C)}),h}}(t.widgetConfig),r=function(c){if(c&&c.length>0)return c}(t.functionList),i=t.pkgObject.version,s=t.pkgObject.name;return{id:Ii(s,i),name:W.Config.UI.SiteTitle,group:W.Config.UI.Group,product:s,version:i,routes:e,widgetMenu:n,widgets:o,functions:r}}function Mo(t){if(t){let e=0;t.meta?.hidden&&(e=1);let n={path:t.path,name:t.name,title:t.meta?.title,type:e,index:t.meta?.index};if(t.children){const o=[];for(let r of t.children){const i=Mo(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function zo(t){if(!t)return;const e={name:t.name,index:t.index,path:t.path,type:t.type};return t.children&&t.children.length>0&&(e.children=[],t.children.forEach(n=>{const o=zo(n);o&&e.children?.push(o)})),e}function an(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d.]/g,""),e=e.replace(/^0{2}$/g,"0"),e=e.replace(/^\./g,""),e=e.replace(".","$#$").replace(/\./g,"").replace("$#$","."),e=e.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),e}let Lo=!0;try{String.fromCharCode.apply(String,[1,2])}catch{Lo=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var cn=2654435769;function Do(t,e){var n=t.length,o=n<<2;if(e){var r=t[n-1];if(r<(o-=4)-3||r>o)return null;o=r}for(var i=new Uint8Array(o),s=0;s<o;++s)i[s]=t[s>>2]>>((3&s)<<3);return i}function lt(t,e){var n,o=t.length,r=o>>2;3&o&&++r,e?(n=new Uint32Array(r+1))[r]=o:n=new Uint32Array(r);for(var i=0;i<o;++i)n[i>>2]|=t[i]<<((3&i)<<3);return n}function _e(t){return 4294967295&t}function ut(t,e,n,o,r,i){return(n>>>5^e<<2)+(e>>>3^n<<4)^(t^e)+(i[3&o^r]^n)}function Ao(t){if(t.length<16){var e=new Uint8Array(16);e.set(t),t=e}return t}function ht(t){for(var e=t.length,n=new Uint8Array(3*e),o=0,r=0;r<e;r++){var i=t.charCodeAt(r);if(i<128)n[o++]=i;else if(i<2048)n[o++]=192|i>>6,n[o++]=128|63&i;else{if(!(i<55296||i>57343)){if(r+1<e){var s=t.charCodeAt(r+1);if(i<56320&&56320<=s&&s<=57343){var c=65536+((1023&i)<<10|1023&s);n[o++]=240|c>>18,n[o++]=128|c>>12&63,n[o++]=128|c>>6&63,n[o++]=128|63&c,r++;continue}}throw new Error("Malformed string")}n[o++]=224|i>>12,n[o++]=128|i>>6&63,n[o++]=128|63&i}}return n.subarray(0,o)}function Bo(t){var e=t.length;return e===0?"":e<32767?function(n,o){for(var r=new Array(o),i=0,s=0,c=n.length;i<o&&s<c;i++){var h=n[s++];switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=h;break;case 12:case 13:if(!(s<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&h)<<6|63&n[s++];break;case 14:if(!(s+1<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&h)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<c))throw new Error("Unfinished UTF-8 octet sequence");var m=((7&h)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=m&&m<=1048575))throw new Error("Character outside valid Unicode range: 0x"+m.toString(16));r[i++]=m>>10&1023|55296,r[i]=1023&m|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+h.toString(16))}}return i<o&&(r.length=i),String.fromCharCode.apply(String,r)}(t,e):function(n,o){for(var r=[],i=new Array(32768),s=0,c=0,h=n.length;s<o&&c<h;s++){var m=n[c++];switch(m>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=m;break;case 12:case 13:if(!(c<h))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&m)<<6|63&n[c++];break;case 14:if(!(c+1<h))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&m)<<12|(63&n[c++])<<6|63&n[c++];break;case 15:if(!(c+2<h))throw new Error("Unfinished UTF-8 octet sequence");var C=((7&m)<<18|(63&n[c++])<<12|(63&n[c++])<<6|63&n[c++])-65536;if(!(0<=C&&C<=1048575))throw new Error("Character outside valid Unicode range: 0x"+C.toString(16));i[s++]=C>>10&1023|55296,i[s]=1023&C|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+m.toString(16))}if(s>=32766){var k=s+1;i.length=k,r.push(String.fromCharCode.apply(String,i)),o-=k,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(t,e)}function Ti(t){var e=t.length;if(e===0)return"";var n=Lo?t:function(c){for(var h=c.length,m=new Array(c.length),C=0;C<h;++C)m[C]=c[C];return m}(t);if(e<65535)return String.fromCharCode.apply(String,n);for(var o=32767&e,r=e>>15,i=new Array(o?r+1:r),s=0;s<r;++s)i[s]=String.fromCharCode.apply(String,n.subarray(s<<15,s+1<<15));return o&&(i[r]=String.fromCharCode.apply(String,n.subarray(r<<15,e))),i.join("")}function $o(t,e){return typeof t=="string"&&(t=ht(t)),typeof e=="string"&&(e=ht(e)),t==null||t.length===0?t:Do(function(n,o){var r,i,s,c,h,m,C=n.length,k=C-1;for(i=n[k],s=0,m=0|Math.floor(6+52/C);m>0;--m){for(c=(s=_e(s+cn))>>>2&3,h=0;h<k;++h)r=n[h+1],i=n[h]=_e(n[h]+ut(s,r,i,h,c,o));r=n[0],i=n[k]=_e(n[k]+ut(s,r,i,k,c,o))}return n}(lt(t,!0),lt(Ao(e),!1)),!1)}function No(t,e){return typeof t=="string"&&(t=function(n){for(var o=window.atob(n),r=o.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=o.charCodeAt(s);return i}(t)),typeof e=="string"&&(e=ht(e)),t==null||t.length===0?t:Do(function(n,o){var r,i,s,c,h,m=n.length,C=m-1;for(r=n[0],s=_e(Math.floor(6+52/m)*cn);s!==0;s=_e(s-cn)){for(c=s>>>2&3,h=C;h>0;--h)i=n[h-1],r=n[h]=_e(n[h]-ut(s,r,i,h,c,o));i=n[C],r=n[0]=_e(n[0]-ut(s,r,i,0,c,o))}return n}(lt(t,!1),lt(Ao(e),!1)),!0)}const $e={toBytes:ht,toString:Bo,encrypt:$o,encryptToString:function(t,e){return window.btoa(Ti($o(t,e)))},decrypt:No,decryptToString:function(t,e){return Bo(No(t,e))}},Wo=t=>{const e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e));const n=document.createElement("canvas");n.width=200,n.height=130;const o=n.getContext("2d");o.rotate(-20*Math.PI/180),o.font="12px Vedana",o.fillStyle="rgba(200, 200, 200, 0.30)",o.textBaseline="middle",o.fillText(t,n.width/10,n.height/2);const r=document.createElement("div");return r.id=e,r.style.pointerEvents="none",r.style.top="0px",r.style.left="0px",r.style.position="fixed",r.style.zIndex="10000000",r.style.width=`${document.documentElement.clientWidth}px`,r.style.height=`${document.documentElement.clientHeight}px`,r.style.background=`url(${n.toDataURL("image/png")}) left top repeat`,document.body.appendChild(r),e},Ri={set:t=>{let e=Wo(t);document.getElementById(e)===null&&(e=Wo(t))},del:()=>{let t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t))}};class Se extends Error{constructor(e,n){const o=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class ln extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class he extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class Pi extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Mi extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class zi extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class Uo extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class Li extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=o}}class Oo{constructor(e,n,o){this.statusCode=e,this.statusText=n,this.content=o}}class dt{get(e,n){return this.send({...n,method:"GET",url:e})}post(e,n){return this.send({...n,method:"POST",url:e})}delete(e,n){return this.send({...n,method:"DELETE",url:e})}getCookieString(e){return""}}var x;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(x||(x={}));class Ne{constructor(){}log(e,n){}}Ne.instance=new Ne;class J{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,o){if(!(e in n))throw new Error(`Unknown ${o} value: ${e}.`)}}class Y{static get isBrowser(){return!Y.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Y.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Y.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function We(t,e){let n="";return Ce(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${function(o){const r=new Uint8Array(o);let i="";return r.forEach(s=>{i+=`0x${s<16?"0":""}${s.toString(16)} `}),i.substr(0,i.length-1)}(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function Ce(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}async function jo(t,e,n,o,r,i){const s={},[c,h]=Re();s[c]=h,t.log(x.Trace,`(${e} transport) sending data. ${We(r,i.logMessageContent)}.`);const m=Ce(r)?"arraybuffer":"text",C=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:m,timeout:i.timeout,withCredentials:i.withCredentials});t.log(x.Trace,`(${e} transport) request complete. Response status: ${C.statusCode}.`)}class Di{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class ft{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const o=`[${new Date().toISOString()}] ${x[e]}: ${n}`;switch(e){case x.Critical:case x.Error:this.out.error(o);break;case x.Warning:this.out.warn(o);break;case x.Information:this.out.info(o);break;default:this.out.log(o)}}}}function Re(){let t="X-SignalR-User-Agent";return Y.isNode&&(t="User-Agent"),[t,Ai("8.0.7",Bi(),Ni(),$i())]}function Ai(t,e,n,o){let r="Microsoft SignalR/";const i=t.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${t}; `,r+=e&&e!==""?`${e}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Bi(){if(!Y.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function $i(){if(Y.isNode)return process.versions.node}function Ni(){return Y.isNode?"NodeJS":"Browser"}function un(t){return t.stack?t.stack:t.message?t.message:`${t}`}class Wi extends dt{constructor(e){if(super(),this._logger=e,typeof fetch>"u"||Y.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}());if(typeof AbortController>"u"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new he;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let o;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),o=new he});let r,i=null;if(e.timeout){const h=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(x.Warning,"Timeout from HTTP request."),o=new ln},h)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Ce(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(h){throw o||(this._logger.log(x.Warning,`Error from HTTP request. ${h}.`),h)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const h=await Ho(r,"text");throw new Se(h||r.statusText,r.status)}const s=Ho(r,e.responseType),c=await s;return new Oo(r.status,r.statusText,c)}getCookieString(e){let n="";return Y.isNode&&this._jar&&this._jar.getCookies(e,(o,r)=>n=r.join("; ")),n}}function Ho(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":default:n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return n}class Ui extends dt{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new he):e.method?e.url?new Promise((n,o)=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),r.withCredentials=e.withCredentials===void 0||e.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(Ce(e.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=e.headers;i&&Object.keys(i).forEach(s=>{r.setRequestHeader(s,i[s])}),e.responseType&&(r.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{r.abort(),o(new he)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new Oo(r.status,r.statusText,r.response||r.responseText)):o(new Se(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(x.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new Se(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(x.Warning,"Timeout from HTTP request."),o(new ln)},r.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Oi extends dt{constructor(e){if(super(),typeof fetch<"u"||Y.isNode)this._httpClient=new Wi(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new Ui(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new he):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class ce{static write(e){return`${e}${ce.RecordSeparator}`}static parse(e){if(e[e.length-1]!==ce.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(ce.RecordSeparator);return n.pop(),n}}ce.RecordSeparatorCode=30,ce.RecordSeparator=String.fromCharCode(ce.RecordSeparatorCode);class ji{writeHandshakeRequest(e){return ce.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,o;if(Ce(e)){const s=new Uint8Array(e),c=s.indexOf(ce.RecordSeparatorCode);if(c===-1)throw new Error("Message is incomplete.");const h=c+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,h))),o=s.byteLength>h?s.slice(h).buffer:null}else{const s=e,c=s.indexOf(ce.RecordSeparator);if(c===-1)throw new Error("Message is incomplete.");const h=c+1;n=s.substring(0,h),o=s.length>h?s.substring(h):null}const r=ce.parse(n),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var H;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(H||(H={}));class Hi{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Di(this,e)}}class Fi{constructor(e,n,o){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=n,this._bufferSize=o}async _send(e){const n=this._protocol.writeMessage(e);let o=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let r=()=>{},i=()=>{};Ce(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(o=new Promise((s,c)=>{r=s,i=c})),this._messages.push(new qi(n,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await o}_ack(e){let n=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=e.sequenceId)n=o,Ce(r._message)?this._bufferedByteCount-=r._message.byteLength:this._bufferedByteCount-=r._message.length,r._resolver();else{if(!(this._bufferedByteCount<this._bufferSize))break;r._resolver()}}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type===H.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(e){e.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:H.Sequence,sequenceId:e}));const n=this._messages;for(const o of n)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.type){case H.Invocation:case H.StreamItem:case H.Completion:case H.StreamInvocation:case H.CancelInvocation:return!0;case H.Close:case H.Sequence:case H.Ping:case H.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:H.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class qi{constructor(e,n,o,r){this._message=e,this._id=n,this._resolver=o,this._rejector=r}}var G;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(G||(G={}));class xn{static create(e,n,o,r,i,s,c){return new xn(e,n,o,r,i,s,c)}constructor(e,n,o,r,i,s,c){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(x.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},J.isRequired(e,"connection"),J.isRequired(n,"logger"),J.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=c??1e5,this._logger=n,this._protocol=o,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new ji,this.connection.onreceive=h=>this._processIncomingData(h),this.connection.onclose=h=>this._connectionClosed(h),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=G.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:H.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==G.Disconnected&&this._connectionState!==G.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==G.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=G.Connecting,this._logger.log(x.Debug,"Starting HubConnection.");try{await this._startInternal(),Y.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=G.Connected,this._connectionStarted=!0,this._logger.log(x.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=G.Disconnected,this._logger.log(x.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise((n,o)=>{this._handshakeResolver=n,this._handshakeRejecter=o});await this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const o={protocol:this._protocol.name,version:n};if(this._logger.log(x.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(x.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new Fi(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(n){throw this._logger.log(x.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch{}}_stopInternal(e){if(this._connectionState===G.Disconnected)return this._logger.log(x.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===G.Disconnecting)return this._logger.log(x.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=G.Disconnecting,this._logger.log(x.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(x.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===G.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new he("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createStreamInvocation(e,n,r);let s;const c=new Hi;return c.cancelCallback=()=>{const h=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(h))},this._callbacks[i.invocationId]=(h,m)=>{m?c.error(m):h&&(h.type===H.Completion?h.error?c.error(new Error(h.error)):c.complete():c.next(h.item))},s=this._sendWithProtocol(i).catch(h=>{c.error(h),delete this._callbacks[i.invocationId]}),this._launchStreams(o,s),c}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(e,n,!0,r));return this._launchStreams(o,i),i}invoke(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createInvocation(e,n,!1,r);return new Promise((c,h)=>{this._callbacks[i.invocationId]=(C,k)=>{k?h(k):C&&(C.type===H.Completion?C.error?h(new Error(C.error)):c(C.result):h(new Error(`Unexpected message type: ${C.type}`)))};const m=this._sendWithProtocol(i).catch(C=>{h(C),delete this._callbacks[i.invocationId]});this._launchStreams(o,m)})}on(e,n){e&&n&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const o=this._methods[e];if(o)if(n){const r=o.indexOf(n);r!==-1&&(o.splice(r,1),o.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const o of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case H.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(x.Error,`Invoke client method threw error: ${un(r)}`)});break;case H.StreamItem:case H.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===H.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(x.Error,`Stream callback threw error: ${un(i)}`)}}break}case H.Ping:break;case H.Close:{this._logger.log(x.Information,"Close message received from server.");const r=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(r):this._stopPromise=this._stopInternal(r);break}case H.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case H.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(o);break;default:this._logger.log(x.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,o;try{[o,n]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(r){const i="Error parsing handshake response: "+r;this._logger.log(x.Error,i);const s=new Error(i);throw this._handshakeRejecter(s),s}if(n.error){const r="Server returned handshake error: "+n.error;this._logger.log(x.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(x.Debug,"Server handshake complete."),this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle!==void 0))){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===G.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const n=e.target.toLowerCase(),o=this._methods[n];if(!o)return this._logger.log(x.Warning,`No client method with the name '${n}' found.`),void(e.invocationId&&(this._logger.log(x.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!e.invocationId;let s,c,h;for(const m of r)try{const C=s;s=await m.apply(this,e.arguments),i&&s&&C&&(this._logger.log(x.Error,`Multiple results provided for '${n}'. Sending error to server.`),h=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),c=void 0}catch(C){c=C,this._logger.log(x.Error,`A callback for the method '${n}' threw error '${C}'.`)}h?await this._sendWithProtocol(h):i?(c?h=this._createCompletionMessage(e.invocationId,`${c}`,null):s!==void 0?h=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(x.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),h=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(h)):s&&this._logger.log(x.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(x.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new he("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===G.Disconnecting?this._completeClose(e):this._connectionState===G.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===G.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=G.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),Y.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(x.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}async _reconnect(e){const n=Date.now();let o=0,r=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(o++,0,r);if(i===null)return this._logger.log(x.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=G.Reconnecting,e?this._logger.log(x.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(x.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[e]))}catch(s){this._logger.log(x.Error,`An onreconnecting callback called with error '${e}' threw error '${s}'.`)}if(this._connectionState!==G.Reconnecting)return void this._logger.log(x.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(x.Information,`Reconnect attempt number ${o} will start in ${i} ms.`),await new Promise(s=>{this._reconnectDelayHandle=setTimeout(s,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==G.Reconnecting)return void this._logger.log(x.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=G.Connected,this._logger.log(x.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(x.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(x.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==G.Reconnecting)return this._logger.log(x.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===G.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-n,r)}}this._logger.log(x.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,n,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:o})}catch(r){return this._logger.log(x.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${r}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(o=>{const r=n[o];try{r(null,e)}catch(i){this._logger.log(x.Error,`Stream 'error' callback called with '${e}' threw error: ${un(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,o,r){if(o)return r.length!==0?{arguments:n,streamIds:r,target:e,type:H.Invocation}:{arguments:n,target:e,type:H.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:e,type:H.Invocation}:{arguments:n,invocationId:i.toString(),target:e,type:H.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const o in e)e[o].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:r=>{let i;i=r instanceof Error?r.message:r&&r.toString?r.toString():"Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,i)))},next:r=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,r)))}})}}_replaceStreamingParams(e){const n=[],o=[];for(let r=0;r<e.length;r++){const i=e[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,o.push(s.toString()),e.splice(r,1)}}return[n,o]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:r.toString(),streamIds:o,target:e,type:H.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:e,type:H.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:H.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:H.StreamItem}}_createCompletionMessage(e,n,o){return n?{error:n,invocationId:e,type:H.Completion}:{invocationId:e,result:o,type:H.Completion}}_createCloseMessage(){return{type:H.Close}}}const Vi=[0,2e3,1e4,3e4,null];class Fo{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Vi}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class Ee{}Ee.Authorization="Authorization",Ee.Cookie="Cookie";class Xi extends dt{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}async send(e){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const o=await this._innerClient.send(e);return n&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):o}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[Ee.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[Ee.Authorization]&&delete e.headers[Ee.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var Z,ne;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(Z||(Z={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(ne||(ne={}));class Ki{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class qo{get pollAborted(){return this._pollAbort.aborted}constructor(e,n,o){this._httpClient=e,this._logger=n,this._pollAbort=new Ki,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,n){if(J.isRequired(e,"url"),J.isRequired(n,"transferFormat"),J.isIn(n,ne,"transferFormat"),this._url=e,this._logger.log(x.Trace,"(LongPolling transport) Connecting."),n===ne.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[o,r]=Re(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===ne.Binary&&(s.responseType="arraybuffer");const c=`${e}&_=${Date.now()}`;this._logger.log(x.Trace,`(LongPolling transport) polling: ${c}.`);const h=await this._httpClient.get(c,s);h.statusCode!==200?(this._logger.log(x.Error,`(LongPolling transport) Unexpected response code: ${h.statusCode}.`),this._closeError=new Se(h.statusText||"",h.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(e,n){try{for(;this._running;)try{const o=`${e}&_=${Date.now()}`;this._logger.log(x.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,n);r.statusCode===204?(this._logger.log(x.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(x.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new Se(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(x.Trace,`(LongPolling transport) data received. ${We(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(x.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof ln?this._logger.log(x.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(x.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(x.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?jo(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(x.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(x.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,o]=Re();e[n]=o;const r={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let i;try{await this._httpClient.delete(this._url,r)}catch(s){i=s}i?i instanceof Se&&(i.statusCode===404?this._logger.log(x.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(x.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(x.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(x.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(x.Trace,e),this.onclose(this._closeError)}}}class Gi{constructor(e,n,o,r){this._httpClient=e,this._accessToken=n,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,n){return J.isRequired(e,"url"),J.isRequired(n,"transferFormat"),J.isIn(n,ne,"transferFormat"),this._logger.log(x.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,r)=>{let i,s=!1;if(n===ne.Text){if(Y.isBrowser||Y.isWebWorker)i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const c=this._httpClient.getCookieString(e),h={};h.Cookie=c;const[m,C]=Re();h[m]=C,i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...h,...this._options.headers}})}try{i.onmessage=c=>{if(this.onreceive)try{this._logger.log(x.Trace,`(SSE transport) data received. ${We(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(h){return void this._close(h)}},i.onerror=c=>{s?this._close():r(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(x.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,o()}}catch(c){return void r(c)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(e){return this._eventSource?jo(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class Yi{constructor(e,n,o,r,i,s){this._logger=o,this._accessTokenFactory=n,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,n){let o;return J.isRequired(e,"url"),J.isRequired(n,"transferFormat"),J.isIn(n,ne,"transferFormat"),this._logger.log(x.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;e=e.replace(/^http/,"ws");const c=this._httpClient.getCookieString(e);let h=!1;if(Y.isNode||Y.isReactNative){const m={},[C,k]=Re();m[C]=k,o&&(m[Ee.Authorization]=`Bearer ${o}`),c&&(m[Ee.Cookie]=c),s=new this._webSocketConstructor(e,void 0,{headers:{...m,...this._headers}})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(e)),n===ne.Binary&&(s.binaryType="arraybuffer"),s.onopen=m=>{this._logger.log(x.Information,`WebSocket connected to ${e}.`),this._webSocket=s,h=!0,r()},s.onerror=m=>{let C=null;C=typeof ErrorEvent<"u"&&m instanceof ErrorEvent?m.error:"There was an error with the transport",this._logger.log(x.Information,`(WebSockets transport) ${C}.`)},s.onmessage=m=>{if(this._logger.log(x.Trace,`(WebSockets transport) data received. ${We(m.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(m.data)}catch(C){return void this._close(C)}},s.onclose=m=>{if(h)this._close(m);else{let C=null;C=typeof ErrorEvent<"u"&&m instanceof ErrorEvent?m.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",i(new Error(C))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(x.Trace,`(WebSockets transport) sending data. ${We(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(x.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||e.wasClean!==!1&&e.code===1e3?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}class Ji{constructor(e,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,J.isRequired(e,"url"),this._logger=(o=n.logger)===void 0?new ft(x.Information):o===null?Ne.instance:o.log!==void 0?o:new ft(o),this.baseUrl=this._resolveUrl(e),(n=n||{}).logMessageContent=n.logMessageContent!==void 0&&n.logMessageContent,typeof n.withCredentials!="boolean"&&n.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.withCredentials=n.withCredentials===void 0||n.withCredentials,n.timeout=n.timeout===void 0?1e5:n.timeout;let r=null,i=null;if(Y.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;r=s("ws"),i=s("eventsource")}Y.isNode||typeof WebSocket>"u"||n.WebSocket?Y.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,Y.isNode||typeof EventSource>"u"||n.EventSource?Y.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new Xi(n.httpClient||new Oi(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(e){if(e=e||ne.Binary,J.isIn(e,ne,"transferFormat"),this._logger.log(x.Debug,`Starting connection with transfer format '${ne[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(x.Error,n),await this._stopPromise,Promise.reject(new he(n))}if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(x.Error,n),Promise.reject(new he(n))}this._connectionStarted=!0}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new In(this.transport)),this._sendQueue.send(e))}async stop(e){return this._connectionState==="Disconnected"?(this._logger.log(x.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(x.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(x.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(x.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==Z.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(Z.WebSockets),await this._startTransport(n,e)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new he("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(n=o.url),o.accessToken){const i=o.accessToken;this._accessTokenFactory=()=>i,this._httpClient._accessToken=i,this._httpClient._accessTokenFactory=void 0}r++}while(o.url&&r<100);if(r===100&&o.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(n,this._options.transport,o,e)}this.transport instanceof qo&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(x.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(x.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}}async _getNegotiationResponse(e){const n={},[o,r]=Re();n[o]=r;const i=this._resolveNegotiateUrl(e);this._logger.log(x.Debug,`Sending negotiation request: ${i}.`);try{const s=await this._httpClient.post(i,{content:"",headers:{...n,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(s.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${s.statusCode}'`));const c=JSON.parse(s.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new Uo("Client didn't negotiate Stateful Reconnect but the server did.")):c}catch(s){let c="Failed to complete negotiation with the server: "+s;return s instanceof Se&&s.statusCode===404&&(c+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(x.Error,c),Promise.reject(new Uo(c))}}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}async _createTransport(e,n,o,r){let i=this._createConnectUrl(e,o.connectionToken);if(this._isITransport(n))return this._logger.log(x.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,await this._startTransport(i,r),void(this.connectionId=o.connectionId);const s=[],c=o.availableTransports||[];let h=o;for(const m of c){const C=this._resolveTransportOrError(m,n,r,h?.useStatefulReconnect===!0);if(C instanceof Error)s.push(`${m.transport} failed:`),s.push(C);else if(this._isITransport(C)){if(this.transport=C,!h){try{h=await this._getNegotiationResponse(e)}catch(k){return Promise.reject(k)}i=this._createConnectUrl(e,h.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=h.connectionId)}catch(k){if(this._logger.log(x.Error,`Failed to start the transport '${m.transport}': ${k}`),h=void 0,s.push(new zi(`${m.transport} failed: ${k}`,Z[m.transport])),this._connectionState!=="Connecting"){const $="Failed to select transport before stop() was called.";return this._logger.log(x.Debug,$),Promise.reject(new he($))}}}}return s.length>0?Promise.reject(new Li(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case Z.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Yi(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case Z.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Gi(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case Z.LongPolling:return new qo(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async o=>{let r=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(e,n),await this.features.resend()}catch{r=!0}r&&this._stopConnection(o)}else this._stopConnection(o)}:this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(e,n)}_resolveTransportOrError(e,n,o,r){const i=Z[e.transport];if(i==null)return this._logger.log(x.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(s,c){return!s||!!(c&s)}(n,i))return this._logger.log(x.Debug,`Skipping transport '${Z[i]}' because it was disabled by the client.`),new Mi(`'${Z[i]}' is disabled by the client.`,i);{if(!(e.transferFormats.map(c=>ne[c]).indexOf(o)>=0))return this._logger.log(x.Debug,`Skipping transport '${Z[i]}' because it does not support the requested transfer format '${ne[o]}'.`),new Error(`'${Z[i]}' does not support ${ne[o]}.`);if(i===Z.WebSockets&&!this._options.WebSocket||i===Z.ServerSentEvents&&!this._options.EventSource)return this._logger.log(x.Debug,`Skipping transport '${Z[i]}' because it is not supported in your environment.'`),new Pi(`'${Z[i]}' is not supported in your environment.`,i);this._logger.log(x.Debug,`Selecting transport '${Z[i]}'.`);try{return this.features.reconnect=i===Z.WebSockets?r:void 0,this._constructTransport(i)}catch(c){return c}}}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(x.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(x.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(x.Error,`Connection disconnected with error '${e}'.`):this._logger.log(x.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(x.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(n){this._logger.log(x.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}else this._logger.log(x.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!Y.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(x.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const o=new URLSearchParams(n.searchParams);return o.has("negotiateVersion")||o.append("negotiateVersion",this._negotiateVersion.toString()),o.has("useStatefulReconnect")?o.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&o.append("useStatefulReconnect","true"),n.search=o.toString(),n.toString()}}class In{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new pt,this._transportResult=new pt,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new pt),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new pt;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):In._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),e.resolve()}catch(o){e.reject(o)}}}static _concatBuffers(e){const n=e.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(n);let r=0;for(const i of e)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class pt{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Zi{constructor(){this.name="json",this.version=2,this.transferFormat=ne.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=Ne.instance);const o=ce.parse(e),r=[];for(const i of o){const s=JSON.parse(i);if(typeof s.type!="number")throw new Error("Invalid payload.");switch(s.type){case H.Invocation:this._isInvocationMessage(s);break;case H.StreamItem:this._isStreamItemMessage(s);break;case H.Completion:this._isCompletionMessage(s);break;case H.Ping:case H.Close:break;case H.Ack:this._isAckMessage(s);break;case H.Sequence:this._isSequenceMessage(s);break;default:n.log(x.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(e){return ce.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,n){if(typeof e!="string"||e==="")throw new Error(n)}}const Qi={trace:x.Trace,debug:x.Debug,info:x.Information,information:x.Information,warn:x.Warning,warning:x.Warning,error:x.Error,critical:x.Critical,none:x.None};class es{configureLogging(e){if(J.isRequired(e,"logging"),e.log!==void 0)this.logger=e;else if(typeof e=="string"){const n=function(o){const r=Qi[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(e);this.logger=new ft(n)}else this.logger=new ft(e);return this}withUrl(e,n){return J.isRequired(e,"url"),J.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(e){return J.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new Fo(e):this.reconnectPolicy=e:this.reconnectPolicy=new Fo,this}withServerTimeout(e){return J.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return J.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new Ji(this.url,e);return xn.create(n,this.logger||Ne.instance,this.protocol||new Zi,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let gt;const hn=new Set;function Vo(t){return t!==null?parseFloat(t):0}function mt(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(Vo).reduce((r,i)=>r+i)),o=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(Vo).reduce((r,i)=>r+i));return{width:n,height:o}}class Xo{width;height;constructor(e,n){this.width=e,this.height=n}}function ts(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),o=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(o))return{left:n,top:o}}return null}function ns(t,e,n,o){const r=t-n,i=e-o;return r*r+i*i}window.addEventListener("resize",t=>{hn.forEach(e=>{e&&et(e.fixPosition)&&e.fixPosition()})});const vt=[];var yt=l.defineComponent({name:"VWindow",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:Qe},setup(t,{emit:e}){const n=l.getCurrentInstance();if(!n)return;const{proxy:o}=n;let r=0,i,s,c;const h=l.ref(t.isOpen),m=()=>{vt.push(o),c=new ci(t.zGroup,C),t.isOpen&&function(D){D&&(l.nextTick(()=>{r++==0&&(v(o),function(){const R=k.value,{width:L,height:U}=$t(R);let j,P;if(t.left!==void 0!=(t.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof t.left=="number")j=t.left,P=t.top;else{const F=t.positionHint||"auto";switch(F){case"auto":{let V=20,oe=50,Q=0;do{if(vt.every(de=>{if(!de.isOpen||o==de)return!0;const Ve=ts(de);if(Ve==null)return!0;const{left:Et,top:ue}=Ve;return ns(Et,ue,V,oe)>16}))break;V=(V+40)%(window.innerWidth-200),oe=(oe+40)%(window.innerHeight-200)}while(++Q<100);j=V,P=oe}break;case"center":j=(window.innerWidth-L)/2,P=(window.innerHeight-U)/2,console.log(j,P,window.innerWidth,window.innerHeight,"111111");break;default:try{const V=F.split("/").map(Number);if(V.length!=2)throw null;const[oe,Q]=V;if(!isFinite(oe)||!isFinite(Q))throw null;j=oe>=0?oe:window.innerWidth-L+oe,P=Q>=0?Q:window.innerHeight-U+Q}catch{throw new Error(`invalid position string: ${F}`)}}}R&&(R.style.left=`${j}px`,R.style.top=`${P}px`)}()),t.resizable&&g(),B(),i=new ai($.value,k.value,{onMove:()=>B(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:R}=$t($.value);s=new ui(k.value,{onResize:()=>g(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+R,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+R:void 0})}()}),t.activateWhenOpen&&z())}(!0),hn.add(o)};function C(D){p.value.zIndex=`${D}`}const k=l.ref(null),$=l.ref(null),A=l.ref(null);function z(){c.raise(),e("activate")}const p=l.ref({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),u=l.computed(()=>t.windowStyle.titlebar),y=l.computed(()=>{const D={...t.windowStyle.content};return t.resizable?D.padding="0":t.padding!=null&&(D.padding=`${t.padding}px`),t.isScrollable&&(D.overflow="auto"),D});function v(D){const{width:R,height:L,top:U,left:j}=D,P=k;if(P&&R!=null&&(P.value.style.width=`${R}px`),L!=null){const F=$.value;if(F){const V=mt(F).height;P.value.style.height=`${L+V}px`}}P&&j!=null&&(P.value.style.left=`${j}px`),P&&U!=null&&(P.value.style.top=`${U}px`)}function g(D=!0){const R=k.value,L=$.value,U=A.value;if(U&&R&&L){const{width:j,height:P}=mt(U),{width:F,height:V}=mt(R),oe=mt(L).height,Q=F-(U.offsetWidth-j),de=V-oe-(U.offsetHeight-P);U.style.width=`${Q}px`,U.style.height=`${de}px`,w(),e("resize",new Xo(Q,de)),D&&(e("update:width",Q),e("update:height",de))}}function w(){const D=k.value;if(D){const R=D.getBoundingClientRect();R.left<0&&(p.value.left="0px"),R.top<0&&(p.value.top="0px"),R.right>window.innerWidth&&(p.value.left=window.innerWidth-R.width+"px"),R.bottom>window.innerHeight&&(p.value.top=window.innerHeight-R.height+"px")}}function B(D=!0){w();const R=k.value;if(R){const{left:L,top:U}=R.getBoundingClientRect();D&&(e("update:left",L),e("update:top",U))}}return l.watch(()=>t.isOpen,D=>{h.value=D}),l.watch(()=>t.zGroup,D=>{c.group=D}),l.watch(()=>t.width,D=>{v({width:D}),g(!1)}),l.watch(()=>t.height,D=>{v({height:D}),g(!1)}),l.onMounted(()=>{m()}),l.onBeforeUnmount(()=>{hn.delete(this),c.unregister(),s&&s.teardown(),i&&i.teardown(),vt.splice(vt.indexOf(o),1)}),{isOpen:h,windowEl:k,titlebar:$,content:A,activate:z,styleWindow:p,styleTitlebar:u,styleContent:y,closeButtonClick:function(){h.value=!1,e("closebuttonclick")},fixPosition:w}}});const os={class:"title"};var Ko;yt.render=function(t,e,n,o,r,i){const s=l.resolveComponent("myButton");return l.openBlock(),l.createBlock(l.Transition,{name:"fade",onAfterLeave:e[2]||(e[2]=c=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=c=>t.$emit("open")),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("div",{class:"window",style:l.normalizeStyle(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...c)=>t.activate&&t.activate(...c)),onTouchstart:e[1]||(e[1]=(...c)=>t.activate&&t.activate(...c))},[l.createElementVNode("div",{class:"titlebar",style:l.normalizeStyle(t.styleTitlebar),ref:"titlebar"},[l.createElementVNode("div",os,[t.$slots.title?l.renderSlot(t.$slots,"title",{key:0}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(t.title),1)],64))]),t.closeButton?(l.openBlock(),l.createBlock(s,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:l.withCtx(()=>e[4]||(e[4]=[l.createTextVNode("\xD7")])),_:1},8,["windowStyle","onClick"])):l.createCommentVNode("v-if",!0)],4),l.createElementVNode("div",{class:"content",style:l.normalizeStyle(t.styleContent),ref:"content"},[l.renderSlot(t.$slots,"default")],4)],36),[[l.vShow,t.isOpen]])]),_:3})},yt.__file="src/controls/vuewindow/window/index.vue",function(t){t[t.StyleBlack=0]="StyleBlack",t[t.StyleWhite=1]="StyleWhite",t[t.StyleMetal=2]="StyleMetal",t[t.StyleGrayblue=3]="StyleGrayblue"}(Ko||(Ko={}));const rs=yt;exports.LayoutContainerEnum=void 0,function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.centerBack=2]="centerBack",t[t.centerMain=3]="centerMain",t[t.centerFront=4]="centerFront",t[t.left=5]="left",t[t.right=6]="right"}(exports.LayoutContainerEnum||(exports.LayoutContainerEnum={}));class Go{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(e,n,o,r){this.layoutState=e,this._LayoutID=o,this._mapItemRefs=r,n.forEach(i=>{if(i.layoutID===o&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const s=new Set;s.add(i),this.preConditionMap.set(i.afterid,s)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e)})}async loadWidget(e){if(!e)return;let n;if(ve(e)?n=e:tt(e)&&(n=this.widgetConfig.find(o=>o.id===e)),n){if(n.afterid){if(this.isWidgetLoaded(n.afterid))return this._loadWidget(n);{let o=function(c){c.layoutID===r._LayoutID&&c.widgetID===i&&(r._loadWidget(s),W.EventBus.off(te.WidgetLoadedEvent,o))};const r=this,i=n.afterid,s=n;return W.EventBus.on(te.WidgetLoadedEvent,o),this.loadWidget(n.afterid)}}return this._loadWidget(n)}}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e){if(!this.widgetsLoadedSet.has(e.id))return e.component?e.component().then(n=>{if(n.default){const o=l.markRaw(n.default);o.id=e.id,e.layout&&(o.style=e.layout),e.cssClass&&(o.cssClass=e.cssClass),e.layoutID&&(o.layoutID=e.layoutID),e.label&&(o.label=e.label),e.jsURL&&(o.jsURL=e.jsURL),e.cssURL&&(o.cssURL=e.cssURL),this.getContainerComponents(e.container).value.set(e.id,o),this.widgetsLoadedSet.add(e.id),l.nextTick().then(()=>{W.EventBus.emit(te.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}}).catch(n=>{W.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",e,n),W.EventBus.emit(te.WidgetLoadedErrorEvent,e)}):void 0;this.changeWidgetVisible(e.id,!0)}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(o=>o.id===e);if(n){if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(e),this.widgetsLoadedSet.delete(e),this._mapItemRefs&&this._mapItemRefs.delete(e),W.EventBus.emit(te.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;e?(n&&(n.style.left="0",n.style.width="100%"),o&&(o.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),o&&(o.style.width="50%"))}getLayoutContainer(e){switch(e){case exports.LayoutContainerEnum.top:return this.layoutState.topContainer;case exports.LayoutContainerEnum.bottom:return this.layoutState.bottomContainer;case exports.LayoutContainerEnum.left:return this.layoutState.leftContainer;case exports.LayoutContainerEnum.right:return this.layoutState.rightContainer;case exports.LayoutContainerEnum.centerBack:return this.layoutState.centerBackContainer;case exports.LayoutContainerEnum.centerMain:return this.layoutState.centerMainContainer;case exports.LayoutContainerEnum.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const o=this.getLayoutContainer(e);o&&(o.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const o=this.getWidgetComponent(e);o&&o.changeVisible&&o.changeVisible(n)}isWidgetVisible(e){const n=this.getWidgetComponent(e);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)&&this._mapItemRefs)return this._mapItemRefs.get(e)}getWigetItem(e){return this.widgetConfig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetConfig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=l.ref(new Map);return this.layoutMap.set(e,n),n}}getWidgetLoadedIDList(){const e=[];return this.widgetsLoadedSet.forEach(n=>{e.push(n)}),e}unloadAllWidgets(e){const n=[];this.widgetsLoadedSet.forEach(o=>{e&&e.length>0?e.findIndex(r=>r===o)<0&&n.push(o):n.push(o)}),n.forEach(o=>this.unloadWidget(o))}unloadWidgets(e){e&&e.length>0&&e.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(e,n){if(n){const o=n.find(r=>r.id===e);if(o&&o.layoutID)return W.LayoutMap.get(o.layoutID)}}}var Ue=l.defineComponent({name:"SuspenseWithError",setup(){const t=l.ref(null);return l.onErrorCaptured(e=>(t.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",e),!0)),{error:t}}});Ue.render=function(t,e,n,o,r,i){return t.error?l.renderSlot(t.$slots,"error",{key:0},()=>[l.createTextVNode(l.toDisplayString(t.error),1)]):(l.openBlock(),l.createBlock(l.Suspense,{key:1},{default:l.withCtx(()=>[l.renderSlot(t.$slots,"default")]),fallback:l.withCtx(()=>[l.renderSlot(t.$slots,"fallback")]),_:3}))},Ue.__file="src/controls/routertransition/SuspenseWithError.vue";var dn=l.defineComponent({name:"RouterTransition",__name:"RouterTransition",setup:t=>(e,n)=>{const o=l.resolveComponent("router-view");return l.openBlock(),l.createBlock(Ue,null,{default:l.withCtx(()=>[l.createVNode(o,null,{default:l.withCtx(({Component:r,route:i})=>[l.createCommentVNode(" <transition> "),(l.openBlock(),l.createBlock(l.KeepAlive,null,[i.meta.keepAlive?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r),{key:i.name})):l.createCommentVNode("v-if",!0)],1024)),i.meta.keepAlive?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r),{key:i.name})),l.createCommentVNode(" </transition> ")]),_:1})]),_:1})}});dn.__file="src/controls/routertransition/RouterTransition.vue";var wt=l.defineComponent({name:"LayoutContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],components:{RouterTransition:dn},setup(t,{attrs:e,slots:n,emit:o}){const r=t.layoutID,i=l.ref(t.enableRouterView);l.watch(()=>t.enableRouterView,()=>{i.value=t.enableRouterView});const s=l.reactive({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),c=new Map,h=new Go(s,t.widgetConfig,r,c),m=p(exports.LayoutContainerEnum.top),C=p(exports.LayoutContainerEnum.centerBack),k=p(exports.LayoutContainerEnum.centerFront),$=p(exports.LayoutContainerEnum.left),A=p(exports.LayoutContainerEnum.right),z=p(exports.LayoutContainerEnum.bottom);function p(y){return h?.getContainerComponents(y)}const u=l.computed(()=>t.layoutStyle);return l.onMounted(()=>{h&&(r?W.LayoutMap.set(r,h):(W.LayoutManager=h,W.LayoutMap.set("",h)),h.preloadWidgets(),o("containerLoaded",{layoutID:r,layoutManager:h}),W.EventBus.emit(te.LayoutContainerLoaded,{layoutID:r,layoutManager:h}))}),{...l.toRefs(s),topContainerComponents:m,centerbackComponents:C,centerfrontComponents:k,leftContainerComponents:$,rightContainerComponents:A,bottomContainerComponents:z,containerStyle:u,isEnableRouterView:i,setItemRef:(y,v)=>{y&&c.set(v,y)}}}});const is={ref:"topContainer",class:"topContainer"},ss={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},as={ref:"centerBackContainer",class:"centerdiv backContainer"},cs={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},ls={ref:"leftContainer",class:"leftContainer"},us={ref:"rightContainer",class:"rightContainer"},hs={ref:"bottomContainer",class:"bottomContainer"};wt.render=function(t,e,n,o,r,i){const s=l.resolveComponent("router-transition");return l.openBlock(),l.createElementBlock("div",{class:"layoutContainer",style:l.normalizeStyle(t.containerStyle)},[l.createElementVNode("div",is,[l.renderSlot(t.$slots,"top"),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.topContainerComponents,([c,h])=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(h),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c,style:l.normalizeStyle(h.style),class:l.normalizeClass(h.cssClass)},null,8,["style","class"]))),128))],512),l.createElementVNode("div",null,[l.createCommentVNode(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),t.isEnableRouterView?(l.openBlock(),l.createElementBlock("div",ss,[l.renderSlot(t.$slots,"main",{},()=>[l.createVNode(s)])],512)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),l.createElementVNode("div",as,[l.renderSlot(t.$slots,"back"),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.centerbackComponents,([c,h])=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(h),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c,style:l.normalizeStyle(h.style),class:l.normalizeClass(h.cssClass)},null,8,["style","class"]))),128))],512),l.createCommentVNode(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),l.createElementVNode("div",cs,[l.renderSlot(t.$slots,"front"),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.centerfrontComponents,([c,h])=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(h),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c,style:l.normalizeStyle(h.style),class:l.normalizeClass(h.cssClass)},null,8,["style","class"]))),128))],512),l.createElementVNode("div",ls,[l.renderSlot(t.$slots,"left"),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.leftContainerComponents,([c,h])=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(h),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c,style:l.normalizeStyle(h.style),class:l.normalizeClass(h.cssClass)},null,8,["style","class"]))),128))],512),l.createElementVNode("div",us,[l.renderSlot(t.$slots,"right"),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.rightContainerComponents,([c,h])=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(h),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c,style:l.normalizeStyle(h.style),class:l.normalizeClass(h.cssClass)},null,8,["style","class"]))),128))],512)]),l.createElementVNode("div",hs,[l.renderSlot(t.$slots,"bottom"),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.bottomContainerComponents,([c,h])=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(h),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c,style:l.normalizeStyle(h.style),class:l.normalizeClass(h.cssClass)},null,8,["style","class"]))),128))],512),l.createCommentVNode(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),l.renderSlot(t.$slots,"default")],4)},wt.__scopeId="data-v-4d081e5c",wt.__file="src/controls/layoutcontainer/layout.vue";var Yo=l.defineComponent({name:"RouterTransition",__name:"RouterTransitionAnimate",props:{enterActive:{type:String,required:!1,default:"animated fadeIn"},leaveActive:{type:String,required:!1,default:"animated fadeOut"}},setup:t=>(e,n)=>{const o=l.resolveComponent("router-view");return l.openBlock(),l.createBlock(Ue,null,{default:l.withCtx(()=>[l.createVNode(o,null,{default:l.withCtx(({Component:r,route:i})=>[l.createVNode(l.TransitionGroup,{appear:"","enter-active-class":e.enterActive,"leave-active-class":e.leaveActive},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.KeepAlive,null,[i.meta.keepAlive?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r),{key:i.name})):l.createCommentVNode("v-if",!0)],1024)),i.meta.keepAlive?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});Yo.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const Pe=new Map,Oe=l.ref(new Map);class je{static addWindowPanel(e){Pe.set(e.id,e)}static removeWindowPanel(e){Pe.has(e)&&(Pe.delete(e),Oe.value.delete(e))}static minimizeWindowPanel(e){Pe.has(e)&&Oe.value.set(e,-1)}static openWindowPanel(e){Pe.has(e)&&Oe.value.set(e,1)}}const ds=["src"],fs={key:1,class:"paneltitle"},ps={class:"dragPanelBar"},gs={class:"dragPanelContent"},ms={class:"drag-pointer-group"};var fn=l.defineComponent({__name:"XWindow",props:{top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},nWidth:{type:[String,Number],default:"300px"},nHeight:{type:[String,Number],default:"400px"},icon:{type:String,default:"img/logo.png"},title:{type:String,default:""},titleHeight:{type:[String,Number],default:"40px"},hasMin:{type:Boolean,default:!0},hasMax:{type:Boolean,default:!1},hasClose:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},pid:{type:String,default:""},tag:{type:[String,Array,Object,Number],default:""}},emits:["close","open","loaded","minimize"],setup(t,{expose:e,emit:n}){const o=oo(),r=t,i=n,s=l.ref(),c=l.ref(),h=l.computed(()=>r.isDark),m=l.ref({x:0,y:0}),C=250,k=100,$=l.ref({width:0,height:0}),A=P=>{s.value&&(s.value.style.left=`${P.x}px`,s.value.style.top=`${P.y}px`)};l.watch(()=>m.value,P=>{A(P)});const z=P=>{s.value&&(s.value.style.width=`${P.width}px`,s.value.style.height=`${P.height}px`)};l.watch(()=>$.value,P=>{z(P)});const p={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(p.refs).forEach(([P,F])=>{F.value&&F.value.addEventListener("mousedown",V=>{p.mouseDown(V,P)})})},mouseDown:(P,F)=>{P.button==0&&(P.preventDefault(),p.startingEdges={left:m.value.x,top:m.value.y,right:m.value.x+$.value.width,bottom:m.value.y+$.value.height},p.newEdges={...p.startingEdges},p.clickStart={x:P.clientX,y:P.clientY},p.eventListenerController=new AbortController,document.addEventListener("mousemove",V=>{p.mouseMove(V,F)},{signal:p.eventListenerController.signal}),document.addEventListener("mouseup",V=>{p.mouseUp(V,F)},{signal:p.eventListenerController.signal}))},mouseMove:(P,F)=>{if(p.startingEdges!=null&&p.newEdges!=null&&p.clickStart!=null&&p.refs[F].value){if(P.preventDefault(),console.log("mouseMove",F),F.toLowerCase().includes("north")){p.newEdges.top=Math.max(p.startingEdges.top+P.clientY-p.clickStart.y,0);const V=p.newEdges.bottom-p.newEdges.top-k;V<0&&(p.newEdges.top+=V)}else F.toLowerCase().includes("south")&&(p.newEdges.bottom=Math.min(p.startingEdges.bottom+P.clientY-p.clickStart.y,document.body.clientHeight));if(F.toLowerCase().includes("west")){p.newEdges.left=Math.max(p.startingEdges.left+P.clientX-p.clickStart.x,0);const V=p.newEdges.right-p.newEdges.left-C;V<0&&(p.newEdges.left+=V)}else F.toLowerCase().includes("east")&&(p.newEdges.right=Math.min(p.startingEdges.right+P.clientX-p.clickStart.x,document.body.clientWidth));p.update()}},update:()=>{p.newEdges==null||p.startingEdges==null||(m.value={x:Math.max(p.newEdges.left,0),y:Math.max(p.newEdges.top,0)},$.value={width:Math.min(Math.max(p.newEdges.right-p.newEdges.left,C),document.body.clientWidth),height:Math.min(Math.max(p.newEdges.bottom-p.newEdges.top,k),document.body.clientHeight)})},mouseUp:(P,F)=>{P.button!=0||p.startingEdges==null||(console.log("mouseUp",F),P.preventDefault(),p.startingEdges=null,p.newEdges=null,p.clickStart=null,p.eventListenerController&&(p.eventListenerController.abort(),p.eventListenerController=null))},refs:{northWest:l.ref(null),north:l.ref(null),northEast:l.ref(null),west:l.ref(null),east:l.ref(null),southWest:l.ref(null),south:l.ref(null),southEast:l.ref(null)}},u={startingMouse:null,startingPosition:null,mouseDown:P=>{P.button==0&&(P.preventDefault(),console.log("mouseDown"),u.startingMouse={x:P.clientX,y:P.clientY},u.startingPosition=m.value,document.addEventListener("mousemove",u.mouseMove),document.addEventListener("mouseup",u.mouseUp))},mouseMove:P=>{!u.startingMouse||!u.startingPosition||(P.preventDefault(),m.value={x:Math.min(Math.max(u.startingPosition.x+P.clientX-u.startingMouse.x,0),document.body.clientWidth-$.value.width),y:Math.min(Math.max(u.startingPosition.y+P.clientY-u.startingMouse.y,0),document.body.clientHeight-$.value.height)})},mouseUp:P=>{P.button!=0||!u.startingMouse||!u.startingPosition||(P.preventDefault(),u.startingMouse=null,u.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",u.mouseMove),document.removeEventListener("mouseup",u.mouseUp))}};function y(P){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:P??r.tag}}const v=l.computed(()=>Oe.value.get(o)!==-1),g=l.ref(!1),w=l.ref(!0);function B(){i("minimize",y()),je.minimizeWindowPanel(o)}function D(){g.value=!g.value}function R(){i("close",y(!1)),je.removeWindowPanel(o),w.value=!1}const L=l.computed(()=>g.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),U={id:o,isShow:v,close:R,open:function(){i("open",y(!0)),w.value=!0},showHidePanel:B};function j(P){if(Ut(P))return P;{const F=Number(P);if(F==F)return F;if(P.endsWith("px")){const V=P.substring(0,P.length-2);return Number(V)}if(P.endsWith("%")){const V=P.substring(0,P.length-1);return Number(V)/100*document.body.clientWidth}return 300}}return e(U),l.onMounted(()=>{(function(){let P=90;if(r.hasMin||(P-=30),r.hasMax||(P-=30),r.hasClose||(P-=30),se.setCssVar("--right-bar-width",P+"px",c.value),!c.value)return;const F=Ut(r.titleHeight)?r.titleHeight+"px":r.titleHeight;c.value.style.height=F,c.value.style.lineHeight=F})(),function(){const P=y(U);je.addWindowPanel(P),i("loaded",P)}(),m.value.x=j(r.left),m.value.y=j(r.top),A(m.value),$.value={width:j(r.nWidth),height:j(r.nHeight)},z($.value),p.mount()}),l.onUnmounted(()=>{je.removeWindowPanel(o)}),(P,F)=>(l.openBlock(),l.createBlock(l.Transition,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:l.withCtx(()=>[w.value?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"dragPanelRef",ref:s,class:l.normalizeClass(["dragWindowPanel",{maxPanel:g.value,dragWindowPanel_dark:h.value}])},[l.createElementVNode("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:c,onMousedown:F[0]||(F[0]=(...V)=>u.mouseDown&&u.mouseDown(...V))},[l.renderSlot(P.$slots,"title",{},()=>[r.icon?(l.openBlock(),l.createElementBlock("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,ds)):l.createCommentVNode("v-if",!0),r.title?(l.openBlock(),l.createElementBlock("span",fs,l.toDisplayString(r.title),1)):l.createCommentVNode("v-if",!0)]),l.createElementVNode("div",ps,[t.hasMin?(l.openBlock(),l.createBlock(l.unref(Dt.Icon),{key:0,icon:"ant-design:minus-outlined",onClick:B})):l.createCommentVNode("v-if",!0),t.hasMax?(l.openBlock(),l.createBlock(l.unref(Dt.Icon),{key:1,icon:L.value,onClick:D},null,8,["icon"])):l.createCommentVNode("v-if",!0),t.hasClose?(l.openBlock(),l.createBlock(l.unref(Dt.Icon),{key:2,icon:"ant-design:close-outlined",onClick:R})):l.createCommentVNode("v-if",!0)])],544),l.createElementVNode("div",gs,[l.renderSlot(P.$slots,"default")]),l.createElementVNode("div",ms,[l.createElementVNode("div",{class:"cursor-nw-resize",ref:p.refs.northWest},null,512),l.createElementVNode("div",{class:"cursor-n-resize",ref:p.refs.north},null,512),l.createElementVNode("div",{class:"cursor-ne-resize",ref:p.refs.northEast},null,512),l.createElementVNode("div",{class:"cursor-w-resize",ref:p.refs.west},null,512),F[1]||(F[1]=l.createElementVNode("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),l.createElementVNode("div",{class:"cursor-e-resize",ref:p.refs.east},null,512),l.createElementVNode("div",{class:"cursor-sw-resize",ref:p.refs.southWest},null,512),l.createElementVNode("div",{class:"cursor-s-resize",ref:p.refs.south},null,512),l.createElementVNode("div",{class:"cursor-se-resize",ref:p.refs.southEast},null,512)])],2)),[[l.vShow,v.value]]):l.createCommentVNode("v-if",!0)]),_:3}))}});fn.__scopeId="data-v-39ea9741",fn.__file="src/controls/xwindow/XWindow.vue";class Tn{debug=!1;simple=!1;utc=!1;longType="number";dictType="object";nullType=void 0;static Instance=new Tn;textEncoder=new TextEncoder;textDecoder=new TextDecoder;constructor(){}encodeResponse(e,n={}){var o=new re.ByteStream,r=new re.Writer(o,this.simple,this.utc),i=n;this.simple;var s=0;for(var c in i)s++;s>0&&(o.writeByte(72),r.serialize(i),r.reset()),e instanceof Error?(o.writeByte(69),r.serialize(this.debug&&e.stack?e.stack:e.message)):(o.writeByte(82),r.serialize(e)),o.writeByte(122);const h=o.takeBytes();return this.textDecoder.decode(h)}decodeRequest(e,n={}){const o=this.textEncoder.encode(e);if(o.length===0)return["~",[]];var r=new re.ByteStream(o),i=new re.Reader(r,!1);i.longType=this.longType,i.dictType=this.dictType;var s=r.readByte();if(console.log("tag",s),s===72){var c=i.deserialize(this.nullType);for(var h in c)n[h]=c[h];i.reset(),s=r.readByte()}switch(s){case 67:return[i.deserialize(String),this.decodeArguments(i)];case 122:return["~",[]];default:throw new Error(`Invalid request:\r
|
|
9
|
-
`+
|
|
10
|
-
`+r.toString())}}}const bt=new Map,pn=new Map;let _t;const vs={getDefaultClient(){if(_t||(_t=new Ae(SysConfig.DefaultHproseAPI)),!_t)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return _t},registerHprose(t,e){const n=pn.get(t);if(!n){const o=new Ae(e);bt.set(t,o)}return n},getHprose:t=>pn?.get(t),getProxyHprose:t=>bt.get(t),unregisterHprose(t){bt.get(t)&&(pn.delete(t),bt.delete(t))}},gn=5e3,Jo=36e5,ke={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},mn="access_token",ys=W.Config.ServiceURL.LoginAuthURL;function vn(){const t=po();t&&le(ke.RefreshToken,ys,{refreshToken:t}).then(e=>{yn(e.data)})}function Zo(){const t=Te.getJsonObject(mn);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=gn?vn():setTimeout(vn,n-gn))}function yn(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;if(n>=Jo?(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let o=we();o?(o.token=t.accessToken.tokenContent,o.expire=t.accessToken.expires,o.refresh=t.refreshToken.tokenContent):o={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},Te.set(mn,o,n/1e3),Zo()}else Te.remove(mn)}const St="Wm314243",Ct=W.Config.ServiceURL.LoginAuthURL,wn="ROLE_SYSTEM_RIGHT",bn=new ot("",sessionStorage);function Qo(){return bn.get(wn)}function _n(t){bn.set(wn,t)}function er(){bn.remove(wn)}function Me(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(Me(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function tr(t,e,n="name"){t&&e&&t.forEach(o=>{const r=e.find(i=>i[n]===o[n]);r&&(o.children?r.children&&tr(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function He(t,e,n,o="name"){const r=t[n],i=e[n];r?i&&tr(r,i,o):i&&(t[n]=i)}function nr(t){if(t&&t.length>0){const e=t.length;let n,o=!1;if(e>0){o=ve(t[0]);const r=o?t[0]:JSON.parse(t[0]);if(e>1)for(let i=1;i<t.length;i++){const s=t[i],c=o?s:JSON.parse(s);He(r,c,"routes","name"),He(r,c,"widgetMenu","name"),He(r,c,"widgets","id"),He(r,c,"functions","id")}n=r}return n&&(Me(n.routes),Me(n.widgetMenu),Me(n.widgets),Me(n.functions)),n}}const Sn=[],Cn=[],En=[];function Fe(){return Qo()}function or(t,e){const n={...t};return n.meta||(n.meta={}),e.index!=null&&(n.meta.index=e.index),e.title!=null&&(n.meta.title=e.title),t.children&&(n.children=[],e.children&&e.children.forEach(o=>{const r=t.children?.find(i=>i.path===o.path);if(r){const i=or(r,o);i&&n.children?.push(i)}})),n}function rr(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(o=>{const r=t.children?.find(i=>i.name===o.name);if(r){const i=rr(r,o);i&&n.children?.push(i)}})),n}exports.BigFileDownload=class{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(t,e,n=3,o=6,r=6e4){this.fileID=t,this.downloadURL=e,this.chunkByteSize=n*this.ChunkUnitM,this.eventTarget=Kt(),this.initIndexDB(),o>=3&&(this.cacheSize=o),r>this.requestTimeout&&(this.requestTimeout=r)}on(t,e){this.eventTarget.on(t,e)}dispatch(t,e){this.eventTarget.emit(t,e)}dispatchError(t){this.eventTarget.emit("error",t)}dispatchInfo(t){this.eventTarget.emit("info",t)}async queryDownloadFileMeta(t,e="",n){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const o=await le(e,t,n);let r=null;return o&&o.status===200&&(r=o.data),r}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=ct.createInstance({name:this.fileID,driver:ct.INDEXEDDB})}async init(t){if(this.finishNum=0,t){const e="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(e,this.fileMetaData)}if(this.fileMetaData!=null){const e=this.fileMetaData.chunkSize;e!=null&&e>0&&(this.chunkByteSize=e)}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(),ct.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(e=>setTimeout(e,t))}async download(t,e){let n=t;if(!n&&this.downloadURL&&(n=this.downloadURL),!n)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const o=W.Axios.CancelToken;this.cancelSource=o.source(),this.isStarting=!0;const r={key:this.fileMetaData?.downloadID};let i=0;const s=this.cacheSize;let c=0;for(let h=0;h<this.totalChunks;h++){if(this.keys&&this.keys?.indexOf(h.toString())>=0){i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());continue}const m=h*this.chunkByteSize;let C=m+this.chunkByteSize-1;this.fileMetaData&&C>this.fileMetaData.length&&(C=this.fileMetaData.length-1);const k={range:`bytes=${m}-${C}`};for(;c>=s;)await this.sleep(200);const $=h.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${h+1}/${this.totalChunks}`),c++,le(n,e,r,k,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async A=>{const z=A.data;c--,await this.currentDB?.setItem($,z),i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());const p=parseInt($)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${p}/${this.totalChunks}`),this.savefile()}).catch(A=>{c--;const z=parseInt($)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${z}\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 e=100*t/this.totalChunks;this.dispatch("saveProgress",e)}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=xi.createWriteStream(this.fileName).getWriter();let e=0;for(let n=0;n<this.totalChunks;n++){const o=n.toString();let r=await this.currentDB?.getItem(o);if(r||(r=await this.currentDB?.getItem(o)),!r)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let i=new Response(r).body;if(i===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const s=i.getReader();for(;;){const{done:c,value:h}=await s.read();if(c)break;await t.write(h)}e++,this.outputProgress(e),this.dispatchInfo(`\u5B8C\u6210\u7B2C${n+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),ct.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}},exports.Download=De,exports.FileUpload=Eo,exports.GetSignalRClient=function(t){if(!t){if(gt)return gt;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new es().configureLogging(x.Information).withUrl(t).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return e.keepAliveIntervalInMilliseconds=15e3,e.serverTimeoutInMilliseconds=18e5,e.start().then(()=>{W.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),e.onclose(async()=>{W.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),e.onreconnecting(()=>{W.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),e.onreconnected(()=>{W.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),gt||(gt=e),e},exports.Global=W,exports.GlobalHprose=vs,exports.GlobalMitt=ye,exports.H5Tool=se,exports.HproseClient=qe,exports.HproseRPCCodec=Tn,exports.HttpDownload=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(o){De(o.data,n)}).catch(o=>{console.warn(o),ye.emit(te.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})},exports.JsonDownload=io,exports.LayoutContainer=wt,exports.LayoutManager=Go,exports.LockState=be,exports.MinWindowMap=Oe,exports.ObjToUrlParams=function(t,e){let n="",o="";for(const r in e)n+=r+"="+encodeURIComponent(e[r])+"&";return n=n.replace(/&$/,""),o=/\?$/.test(t)?t+n:t.replace(/\/?$/,"?")+n,o},exports.Pane=At,exports.ProxyClient=Ae,exports.RouterTransition=dn,exports.RouterTransitionAnimate=Yo,exports.SaveAs=function(t,e){const n=window.URL||window.webkitURL||window,o=new Blob([t]),r=document.createElement("a");r.href=n.createObjectURL(o),r.download=e,r.click(),n.revokeObjectURL(r.href)},exports.Splitpanes=si,exports.Storage=ot,exports.StringUtils=Le,exports.StyleBlack={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)"}},exports.StyleGrayblue={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)"}},exports.StyleMetal={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)"}},exports.StyleWhite={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)"}},exports.SuspenseWithError=Ue,exports.SysEvents=te,exports.TOKEN_REFRESH_TIME=gn,exports.TOKEN_VALID_TIMESPAN=Jo,exports.USER_TOKEN_API=ke,exports.VWindow=yt,exports.WaterMark=Ri,exports.WindowResizeEvent=Xo,exports.WindowType=rs,exports.WindowsMap=Pe,exports.XWindow=fn,exports.XWindowManager=je,exports.XXTEA=$e,exports.calculateBestTextColor=function(t){return function(e,n){return(ro(~~e[0],~~e[1],~~e[2])+.05)/(ro(n[0],n[1],n[2])+.05)}(qt(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"},exports.changeMyPWD=function(t){const e={oldpwd:$e.encryptToString(t.oldpwd,St),newpwd:$e.encryptToString(t.newpwd,St)};return le(ke.ChangeMyPwd,Ct,e)},exports.checkDoRefreshToken=Zo,exports.checkToken=function(t){return le(ke.CheckToken,Ct,{token:t})},exports.clearLocalToken=Zt,exports.clearRight=er,exports.colorIsDark=function(t){if(!rt(t))return;const[e,n,o]=qt(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*n+.114*o<192},exports.createFileUpload=t=>new Eo(t),exports.darken=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${Xt(t.substring(0,2),e)}${Xt(t.substring(2,4),e)}${Xt(t.substring(4,6),e)}`},exports.deepMerge=function t(e={},n={}){let o;for(o in n)ve(n[o])?e[o]=t(e[o],n[o]):e[o]=n[o];return e},exports.delay=so,exports.deserialize=function(t){return t==null||t===""?t:new re.Reader(new re.ByteStream(t)).deserialize()},exports.doRefreshToken=vn,exports.doSetLock=at,exports.exportSystemRights=Po,exports.get=function(t,e,n=!1){return t.startsWith("http")?le("",t,e):n||e?le(t,void 0,e):le(t,"",void 0)},exports.getCurrentSystemRight=Fe,exports.getData=function(t,e){return W.Axios?.get(t,{params:e}).catch(function(n){it(n,t,"","\u5916\u90E8Get")})},exports.getDownload=function(t,e,n){const o=e??Le.getFileName(t);le("",t,n,void 0,"blob").then(r=>{r.data&&De(r.data,o)})},exports.getEncryptPWD=function(t){return $e.encryptToString(t,St)},exports.getFunctions=function(t,e=2){if(e===0)return t;const n=Fe();return n?n.functions:void 0},exports.getHexColor=function(t){const e=t.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(e[3]||"1"),o=Math.floor(n*parseInt(e[0])+255*(1-n)),r=Math.floor(n*parseInt(e[1])+255*(1-n)),i=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)},exports.getLocalToken=we,exports.getLockState=function(){return be.isLock},exports.getLongHexColor=function(t){const e=t;if(e.length===4){let o="#";for(var n=1;n<4;n+=1){const r=e.slice(n,n+1);o+=r.concat(r)}return o}return e},exports.getProxyClient=ko,exports.getRGBColor=function(t){var e=t.toLowerCase();if(rt(t)){if(e.length===4){for(var n="#",o=1;o<4;o+=1){const i=e.slice(o,o+1);n+=i.concat(i)}e=n}var r=[];for(o=1;o<7;o+=2)r.push(parseInt("0x"+e.slice(o,o+2)));return"rgb("+r.join(",")+")"}return e},exports.getRGBColorFromHSLA=function(t){if(t){var e=t.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(e){var n,o,r,i=(parseFloat(e[1])%360+360)%360/360,s=parseFloat(e[2])/(/%$/.test(e[2])?100:1),c=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(s===0)n=o=r=c;else{var h=c<=.5?c*(s+1):c+s-c*s,m=2*c-h;n=Ft(m,h,i+1/3),o=Ft(m,h,i),r=Ft(m,h,i-1/3)}return`rgba(${n=Math.round(255*n)},${o=Math.round(255*o)},${r=Math.round(255*r)},${e[4]?parseFloat(e[4]):1})`}}},exports.getRefreshToken=po,exports.getRight=Qo,exports.getRoutes=function(t,e=2){if(e===0)return t;const n=Fe();return n&&n.routes?(En.length>0||t.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=or(o,r);i&&En.push(i)}}),En):void 0},exports.getSystemRoleRight=async function(t,e=!1){er();const n=ke.GetSystemRights,o=W.Config.ServiceURL.LoginAuthURL,r=await le(n,o,{systemid:t});if(!r||!r.data)return void W.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const i=r.data;if(i&&i.length>0){if(e){const s=JSON.parse(i[0]);return _n(s),s}{const s=nr(i);return _n(s),s}}},exports.getWidgetConfig=function(t,e=2){if(e===0)return t;const n=Fe();return n&&n.widgets?(Sn.length>0||t?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&Sn.push(o)}),Sn):void 0},exports.getWidgetMenus=function(t,e=2){if(e===0)return t;const n=Fe();return n&&n.widgetMenu?(Cn.length>0||t.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=rr(o,r);i&&Cn.push(i)}}),Cn):void 0},exports.handleNodes=Me,exports.hexToRGB=qt,exports.init=function(t,e,n){!W.Config.DefaultHproseAPI&&W.Config.ServiceURL&&(W.Config.DefaultHproseAPI=W.Config.ServiceURL.DefaultHproseAPI),W.Config.DefaultHproseAPI&&Le.isNotEmpty(W.Config.DefaultHproseAPI)&&(W.DefaultProxyClient=new Ae(W.Config.DefaultHproseAPI));const o=W.Config.UI.GrayMode;o&&se.setGrayMode(o);const r=new uo(t,W.EventBus);W.Message=r,W.SystemID=e,W.SystemGroup=n,W.EventBus.on(te.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),W.EventBus.on(te.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),W.EventBus.on(te.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),W.EventBus.on(te.CommonWarnEvent,i=>{r.warn(i)})},exports.initDefaultProxyClient=function(t){const e=ko(t);return e&&(W.DefaultProxyClient=e),e},exports.is=ie,exports.isArray=Ot,exports.isAsyncFunction=function(t){return ie(t,"AsyncFunction")},exports.isBoolean=function(t){return t===!0||t===!1||ie(t,"Boolean")},exports.isClient=()=>typeof window<"u",exports.isDate=function(t){return ie(t,"Date")},exports.isDef=eo,exports.isElement=t=>ve(t)&&!!t.tagName,exports.isEmpty=function(t){return t==null||(tt(t)||Ot(t)?t.length===0:!!ve(t)&&JSON.stringify(t)==="{}")},exports.isEnumColor=function(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substring(0,1);return e==="#"?exports.EnumColor.Hex:e==="r"||e==="("?exports.EnumColor.RGBA:e==="h"?exports.EnumColor.Hsla:exports.EnumColor.RGBA},exports.isError=function(t){return ie(t,"Error")},exports.isFunction=et,exports.isHexColor=rt,exports.isImageDom=function(t){return t&&["IMAGE","IMG"].includes(t.tagName)},exports.isMap=function(t){return ie(t,"Map")},exports.isNull=Wt,exports.isNullAndUnDef=function(t){return Nt(t)&&Wt(t)},exports.isNullOrUnDef=function(t){return Nt(t)||Wt(t)},exports.isNumber=Ut,exports.isObjectX=ve,exports.isPromise=function(t){return ie(t,"Promise")&&ve(t)&&et(t.then)&&et(t.catch)},exports.isServer=fi,exports.isString=tt,exports.isSymbol=function(t){return ie(t,"Symbol")},exports.isUnDef=Nt,exports.isValidURL=t=>/^(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(t),exports.isWeakMap=function(t){return ie(t,"WeakMap")},exports.isWeakSet=function(t){return ie(t,"WeakSet")},exports.isWindow=t=>typeof window<"u"&&ie(t,"Window"),exports.jquery=Ci,exports.lighten=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${Vt(t.substring(0,2),e)}${Vt(t.substring(2,4),e)}${Vt(t.substring(4,6),e)}`},exports.login=async function(t){const e={username:t.username,pwd:$e.encryptToString(t.pwd,St)},n=(await le(ke.Login,Ct,e))?.data;return n&&(yn(n.doubletoken),at(!1)),n},exports.logout=function(){const t=we();t&&(mo(ke.Logout,Ct,{token:t.token,reftoken:t.refresh}),Zt())},exports.mergeFilterRoleSysRight=nr,exports.mergeNodes=function t(e,n,o="name"){e&&n&&e.forEach(r=>{const i=n.find(s=>s[o]===r[o]);i&&(r.children?i.children&&t(r.children,i.children,o):(!i.children||i.children.length===0)&&i.selected&&(r.selected=i.selected))})},exports.mergeNodesAll=He,exports.newGuid=function(){var t=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var o=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(n==="x"?o:3&o|8).toString(16)});return e},exports.onLockListener=function(){Be(),document.addEventListener("mousedown",Be),document.addEventListener("mousemove",Be)},exports.post=function(t,e){return go(t,void 0,e)},exports.requestGet=le,exports.requestPost=go,exports.requestPostBody=mo,exports.rgbToHex=function(t,e,n){const o=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o},exports.serialize=function(t){const e=new re.Writer(new re.ByteStream);return e.serialize(t),e.stream.toString()},exports.setLocalToken=yn,exports.setRight=_n,exports.sleep=function(t){const e=new Date().getTime();let n=new Date().getTime();for(;n-e<t;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${so}\u6BEB\u79D2`)},exports.storage=gi,exports.storageHelper=Te,exports.unLockListener=function(){document.removeEventListener("mousedown",Be),document.removeEventListener("mousemove",Be)},exports.uuid=oo,exports.verifiyNumberInteger=function(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[\.]*/g,""),e=e.replace(/(^0[\d]*)$/g,"0"),e=e.replace(/^0\d$/g,"0"),e=e.replace(/[^\d]/g,""),e},exports.verifyAccount=function(t){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(t)},exports.verifyAndSpace=function(t){return t.replace(/(^\s*)|(\s*$)/g,"")},exports.verifyCarNum=function(t){return!!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(t)},exports.verifyCnAndSpace=function(t){let e=t.replace(/[\u4e00-\u9fa5\s]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e},exports.verifyEmail=function(t){return!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)},exports.verifyEnAndSpace=function(t){let e=t.replace(/[a-zA-Z]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e},exports.verifyFullName=function(t){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(t)},exports.verifyIPAddress=function(t){return!!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(t)},exports.verifyIdCard=function(t){return!!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(t)},exports.verifyNumberCnUppercase=function(t,e="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let o=(t+="00").indexOf(".");o>=0&&(t=t.substring(0,o)+t.substr(o+1,2)),e=e.substr(e.length-t.length);for(let r=0;r<t.length;r++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(t.substr(r,1),1)+e.substr(r,1);return n=n.replace(/零角零分$/,"\u6574").replace(/零[仟佰拾]/g,"\u96F6").replace(/零{2,}/g,"\u96F6").replace(/零([亿|万])/g,"$1").replace(/零+元/,"\u5143").replace(/亿零{0,3}万/,"\u4EBF").replace(/^元/,"\u96F6\u5143")},exports.verifyNumberComma=function(t){let e=an(t);return e=e.toString().split("."),e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e=e.join("."),e},exports.verifyNumberIntegerAndFloat=an,exports.verifyNumberPercentage=function(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d]/g,""),e=e.replace(/^0/g,""),e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e},exports.verifyNumberPercentageFloat=function(t){let e=an(t);return e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e=e.replace(/^100\.$/,"100"),e},exports.verifyPassword=function(t){return!!/^[a-zA-Z]\w{5,15}$/.test(t)},exports.verifyPasswordPowerful=function(t){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)},exports.verifyPasswordStrength=function(t){let e="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(t)&&(e="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u5F3A"),e},exports.verifyPhone=function(t){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(t)},exports.verifyPostalCode=function(t){return!!/^[1-9][0-9]{5}$/.test(t)},exports.verifyTelPhone=function(t){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(t)},exports.verifyTextColor=function(t,e="",n="red"){return e.replace(new RegExp(t,"gi"),`<span style='color: ${n}'>${t}</span>`)},exports.verifyUrl=function(t){return!!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(t)},exports.writeIconifyList=function(t,e="IconifyList.ts"){let n="",o=`const iconlist={
|
|
11
|
-
`,
|
|
12
|
-
`,
|
|
13
|
-
`,
|
|
14
|
-
`,
|
|
8
|
+
*/var Si,fa=(bi||(bi=1,_i.exports=function t(e,n,r){function o(a,c){if(!n[a]){if(!e[a]){if(!c&&Sr)return Sr(a);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var g=n[a]={exports:{}};e[a][0].call(g.exports,function(_){var x=e[a][1][_];return o(x||_)},g,g.exports,t,e,n,r)}return n[a].exports}for(var i=Sr,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,n){(function(r){var o,i,s=r.MutationObserver||r.WebKitMutationObserver;if(s){var a=0,c=new s(x),u=r.document.createTextNode("");c.observe(u,{characterData:!0}),o=function(){u.data=a=++a%2}}else if(r.setImmediate||r.MessageChannel===void 0)o="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(){var z=r.document.createElement("script");z.onreadystatechange=function(){x(),z.onreadystatechange=null,z.parentNode.removeChild(z),z=null},r.document.documentElement.appendChild(z)}:function(){setTimeout(x,0)};else{var g=new r.MessageChannel;g.port1.onmessage=x,o=function(){g.port2.postMessage(0)}}var _=[];function x(){var z,d;i=!0;for(var h=_.length;h;){for(d=_,_=[],z=-1;++z<h;)d[z]();h=_.length}i=!1}function T(z){_.push(z)!==1||i||o()}e.exports=T}).call(this,nt!==void 0?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,e,n){var r=t(1);function o(){}var i={},s=["REJECTED"],a=["FULFILLED"],c=["PENDING"];function u(f){if(typeof f!="function")throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,f!==o&&T(this,f)}function g(f,w,B){this.promise=f,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof B=="function"&&(this.onRejected=B,this.callRejected=this.otherCallRejected)}function _(f,w,B){r(function(){var D;try{D=w(B)}catch(R){return i.reject(f,R)}D===f?i.reject(f,new TypeError("Cannot resolve promise with itself")):i.resolve(f,D)})}function x(f){var w=f&&f.then;if(f&&(typeof f=="object"||typeof f=="function")&&typeof w=="function")return function(){w.apply(f,arguments)}}function T(f,w){var B=!1;function D(W){B||(B=!0,i.reject(f,W))}function R(W){B||(B=!0,i.resolve(f,W))}function k(){w(R,D)}var A=z(k);A.status==="error"&&D(A.value)}function z(f,w){var B={};try{B.value=f(w),B.status="success"}catch(D){B.status="error",B.value=D}return B}function d(f){return f instanceof this?f:i.resolve(new this(o),f)}function h(f){var w=new this(o);return i.reject(w,f)}function b(f){var w=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var B=f.length,D=!1;if(!B)return this.resolve([]);for(var R=new Array(B),k=0,A=-1,W=new this(o);++A<B;)M(f[A],A);return W;function M(j,H){function q(X){R[H]=X,++k!==B||D||(D=!0,i.resolve(W,R))}w.resolve(j).then(q,function(X){D||(D=!0,i.reject(W,X))})}}function v(f){var w=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var B=f.length,D=!1;if(!B)return this.resolve([]);for(var R=-1,k=new this(o);++R<B;)A(f[R]);return k;function A(W){w.resolve(W).then(function(M){D||(D=!0,i.resolve(k,M))},function(M){D||(D=!0,i.reject(k,M))})}}e.exports=u,u.prototype.catch=function(f){return this.then(null,f)},u.prototype.then=function(f,w){if(typeof f!="function"&&this.state===a||typeof w!="function"&&this.state===s)return this;var B=new this.constructor(o);return this.state!==c?_(B,this.state===a?f:w,this.outcome):this.queue.push(new g(B,f,w)),B},g.prototype.callFulfilled=function(f){i.resolve(this.promise,f)},g.prototype.otherCallFulfilled=function(f){_(this.promise,this.onFulfilled,f)},g.prototype.callRejected=function(f){i.reject(this.promise,f)},g.prototype.otherCallRejected=function(f){_(this.promise,this.onRejected,f)},i.resolve=function(f,w){var B=z(x,w);if(B.status==="error")return i.reject(f,B.value);var D=B.value;if(D)T(f,D);else{f.state=a,f.outcome=w;for(var R=-1,k=f.queue.length;++R<k;)f.queue[R].callFulfilled(w)}return f},i.reject=function(f,w){f.state=s,f.outcome=w;for(var B=-1,D=f.queue.length;++B<D;)f.queue[B].callRejected(w);return f},u.resolve=d,u.reject=h,u.all=b,u.race=v},{1:1}],3:[function(t,e,n){(function(r){typeof r.Promise!="function"&&(r.Promise=t(2))}).call(this,nt!==void 0?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,e,n){var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function o(l,m){if(!(l instanceof m))throw new TypeError("Cannot call a class as a function")}function i(){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 s=i();function a(){try{if(!s||!s.open)return!1;var l=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),m=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||m)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function c(l,m){l=l||[],m=m||{};try{return new Blob(l,m)}catch(S){if(S.name!=="TypeError")throw S;for(var y=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),C=0;C<l.length;C+=1)y.append(l[C]);return y.getBlob(m.type)}}typeof Promise>"u"&&t(3);var u=Promise;function g(l,m){m&&l.then(function(y){m(null,y)},function(y){m(y)})}function _(l,m,y){typeof m=="function"&&l.then(m),typeof y=="function"&&l.catch(y)}function x(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function T(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var z="local-forage-detect-blob-support",d=void 0,h={},b=Object.prototype.toString,v="readonly",f="readwrite";function w(l){for(var m=l.length,y=new ArrayBuffer(m),C=new Uint8Array(y),S=0;S<m;S++)C[S]=l.charCodeAt(S);return y}function B(l){return new u(function(m){var y=l.transaction(z,f),C=c([""]);y.objectStore(z).put(C,"key"),y.onabort=function(S){S.preventDefault(),S.stopPropagation(),m(!1)},y.oncomplete=function(){var S=navigator.userAgent.match(/Chrome\/(\d+)/),E=navigator.userAgent.match(/Edge\//);m(E||!S||parseInt(S[1],10)>=43)}}).catch(function(){return!1})}function D(l){return typeof d=="boolean"?u.resolve(d):B(l).then(function(m){return d=m})}function R(l){var m=h[l.name],y={};y.promise=new u(function(C,S){y.resolve=C,y.reject=S}),m.deferredOperations.push(y),m.dbReady?m.dbReady=m.dbReady.then(function(){return y.promise}):m.dbReady=y.promise}function k(l){var m=h[l.name].deferredOperations.pop();if(m)return m.resolve(),m.promise}function A(l,m){var y=h[l.name].deferredOperations.pop();if(y)return y.reject(m),y.promise}function W(l,m){return new u(function(y,C){if(h[l.name]=h[l.name]||Be(),l.db){if(!m)return y(l.db);R(l),l.db.close()}var S=[l.name];m&&S.push(l.version);var E=s.open.apply(s,S);m&&(E.onupgradeneeded=function(I){var L=E.result;try{L.createObjectStore(l.storeName),I.oldVersion<=1&&L.createObjectStore(z)}catch(N){if(N.name!=="ConstraintError")throw N;console.warn('The database "'+l.name+'" has been upgraded from version '+I.oldVersion+" to version "+I.newVersion+', but the storage "'+l.storeName+'" already exists.')}}),E.onerror=function(I){I.preventDefault(),C(E.error)},E.onsuccess=function(){var I=E.result;I.onversionchange=function(L){L.target.close()},y(I),k(l)}})}function M(l){return W(l,!1)}function j(l){return W(l,!0)}function H(l,m){if(!l.db)return!0;var y=!l.db.objectStoreNames.contains(l.storeName),C=l.version<l.db.version,S=l.version>l.db.version;if(C&&(l.version!==m&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),S||y){if(y){var E=l.db.version+1;E>l.version&&(l.version=E)}return!0}return!1}function q(l){return new u(function(m,y){var C=new FileReader;C.onerror=y,C.onloadend=function(S){var E=btoa(S.target.result||"");m({__local_forage_encoded_blob:!0,data:E,type:l.type})},C.readAsBinaryString(l)})}function X(l){return c([w(atob(l.data))],{type:l.type})}function K(l){return l&&l.__local_forage_encoded_blob}function J(l){var m=this,y=m._initReady().then(function(){var C=h[m._dbInfo.name];if(C&&C.dbReady)return C.dbReady});return _(y,l,l),y}function ae(l){R(l);for(var m=h[l.name],y=m.forages,C=0;C<y.length;C++){var S=y[C];S._dbInfo.db&&(S._dbInfo.db.close(),S._dbInfo.db=null)}return l.db=null,M(l).then(function(E){return l.db=E,H(l)?j(l):E}).then(function(E){l.db=m.db=E;for(var I=0;I<y.length;I++)y[I]._dbInfo.db=E}).catch(function(E){throw A(l,E),E})}function Z(l,m,y,C){C===void 0&&(C=1);try{var S=l.db.transaction(l.storeName,m);y(null,S)}catch(E){if(C>0&&(!l.db||E.name==="InvalidStateError"||E.name==="NotFoundError"))return u.resolve().then(function(){if(!l.db||E.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),j(l)}).then(function(){return ae(l).then(function(){Z(l,m,y,C-1)})}).catch(y);y(E)}}function Be(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function _e(l){var m=this,y={db:null};if(l)for(var C in l)y[C]=l[C];var S=h[y.name];S||(S=Be(),h[y.name]=S),S.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=J);var E=[];function I(){return u.resolve()}for(var L=0;L<S.forages.length;L++){var N=S.forages[L];N!==m&&E.push(N._initReady().catch(I))}var $=S.forages.slice(0);return u.all(E).then(function(){return y.db=S.db,M(y)}).then(function(U){return y.db=U,H(y,m._defaultConfig.version)?j(y):U}).then(function(U){y.db=S.db=U,m._dbInfo=y;for(var F=0;F<$.length;F++){var G=$[F];G!==m&&(G._dbInfo.db=y.db,G._dbInfo.version=y.version)}})}function Te(l,m){var y=this;l=x(l);var C=new u(function(S,E){y.ready().then(function(){Z(y._dbInfo,v,function(I,L){if(I)return E(I);try{var N=L.objectStore(y._dbInfo.storeName).get(l);N.onsuccess=function(){var $=N.result;$===void 0&&($=null),K($)&&($=X($)),S($)},N.onerror=function(){E(N.error)}}catch($){E($)}})}).catch(E)});return g(C,m),C}function ge(l,m){var y=this,C=new u(function(S,E){y.ready().then(function(){Z(y._dbInfo,v,function(I,L){if(I)return E(I);try{var N=L.objectStore(y._dbInfo.storeName).openCursor(),$=1;N.onsuccess=function(){var U=N.result;if(U){var F=U.value;K(F)&&(F=X(F));var G=l(F,U.key,$++);G!==void 0?S(G):U.continue()}else S()},N.onerror=function(){E(N.error)}}catch(U){E(U)}})}).catch(E)});return g(C,m),C}function Se(l,m,y){var C=this;l=x(l);var S=new u(function(E,I){var L;C.ready().then(function(){return L=C._dbInfo,b.call(m)==="[object Blob]"?D(L.db).then(function(N){return N?m:q(m)}):m}).then(function(N){Z(C._dbInfo,f,function($,U){if($)return I($);try{var F=U.objectStore(C._dbInfo.storeName);N===null&&(N=void 0);var G=F.put(N,l);U.oncomplete=function(){N===void 0&&(N=null),E(N)},U.onabort=U.onerror=function(){var Y=G.error?G.error:G.transaction.error;I(Y)}}catch(Y){I(Y)}})}).catch(I)});return g(S,y),S}function re(l,m){var y=this;l=x(l);var C=new u(function(S,E){y.ready().then(function(){Z(y._dbInfo,f,function(I,L){if(I)return E(I);try{var N=L.objectStore(y._dbInfo.storeName).delete(l);L.oncomplete=function(){S()},L.onerror=function(){E(N.error)},L.onabort=function(){var $=N.error?N.error:N.transaction.error;E($)}}catch($){E($)}})}).catch(E)});return g(C,m),C}function Ee(l){var m=this,y=new u(function(C,S){m.ready().then(function(){Z(m._dbInfo,f,function(E,I){if(E)return S(E);try{var L=I.objectStore(m._dbInfo.storeName).clear();I.oncomplete=function(){C()},I.onabort=I.onerror=function(){var N=L.error?L.error:L.transaction.error;S(N)}}catch(N){S(N)}})}).catch(S)});return g(y,l),y}function De(l){var m=this,y=new u(function(C,S){m.ready().then(function(){Z(m._dbInfo,v,function(E,I){if(E)return S(E);try{var L=I.objectStore(m._dbInfo.storeName).count();L.onsuccess=function(){C(L.result)},L.onerror=function(){S(L.error)}}catch(N){S(N)}})}).catch(S)});return g(y,l),y}function Le(l,m){var y=this,C=new u(function(S,E){l<0?S(null):y.ready().then(function(){Z(y._dbInfo,v,function(I,L){if(I)return E(I);try{var N=L.objectStore(y._dbInfo.storeName),$=!1,U=N.openKeyCursor();U.onsuccess=function(){var F=U.result;F?l===0||$?S(F.key):($=!0,F.advance(l)):S(null)},U.onerror=function(){E(U.error)}}catch(F){E(F)}})}).catch(E)});return g(C,m),C}function je(l){var m=this,y=new u(function(C,S){m.ready().then(function(){Z(m._dbInfo,v,function(E,I){if(E)return S(E);try{var L=I.objectStore(m._dbInfo.storeName).openKeyCursor(),N=[];L.onsuccess=function(){var $=L.result;$?(N.push($.key),$.continue()):C(N)},L.onerror=function(){S(L.error)}}catch($){S($)}})}).catch(S)});return g(y,l),y}function et(l,m){m=T.apply(this,arguments);var y=this.config();(l=typeof l!="function"&&l||{}).name||(l.name=l.name||y.name,l.storeName=l.storeName||y.storeName);var C,S=this;if(l.name){var E=l.name===y.name&&S._dbInfo.db?u.resolve(S._dbInfo.db):M(l).then(function(I){var L=h[l.name],N=L.forages;L.db=I;for(var $=0;$<N.length;$++)N[$]._dbInfo.db=I;return I});C=l.storeName?E.then(function(I){if(I.objectStoreNames.contains(l.storeName)){var L=I.version+1;R(l);var N=h[l.name],$=N.forages;I.close();for(var U=0;U<$.length;U++){var F=$[U];F._dbInfo.db=null,F._dbInfo.version=L}var G=new u(function(Y,Q){var he=s.open(l.name,L);he.onerror=function(Me){he.result.close(),Q(Me)},he.onupgradeneeded=function(){he.result.deleteObjectStore(l.storeName)},he.onsuccess=function(){var Me=he.result;Me.close(),Y(Me)}});return G.then(function(Y){N.db=Y;for(var Q=0;Q<$.length;Q++){var he=$[Q];he._dbInfo.db=Y,k(he._dbInfo)}}).catch(function(Y){throw(A(l,Y)||u.resolve()).catch(function(){}),Y})}}):E.then(function(I){R(l);var L=h[l.name],N=L.forages;I.close();for(var $=0;$<N.length;$++)N[$]._dbInfo.db=null;var U=new u(function(F,G){var Y=s.deleteDatabase(l.name);Y.onerror=function(){var Q=Y.result;Q&&Q.close(),G(Y.error)},Y.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},Y.onsuccess=function(){var Q=Y.result;Q&&Q.close(),F(Q)}});return U.then(function(F){L.db=F;for(var G=0;G<N.length;G++)k(N[G]._dbInfo)}).catch(function(F){throw(A(l,F)||u.resolve()).catch(function(){}),F})})}else C=u.reject("Invalid arguments");return g(C,m),C}var Oe={_driver:"asyncStorage",_initStorage:_e,_support:a(),iterate:ge,getItem:Te,setItem:Se,removeItem:re,clear:Ee,length:De,key:Le,keys:je,dropInstance:et};function Ne(){return typeof openDatabase=="function"}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qi="~~local_forage_type~",qr=/^~~local_forage_type~([^~]+)~/,Bt="__lfsc__:",In=Bt.length,Tn="arbf",Rn="blob",Vr="si08",Xr="ui08",Gr="uic8",Kr="si16",Jr="si32",Yr="ur16",Zr="ui32",Qr="fl32",eo="fl64",to=In+Tn.length,no=Object.prototype.toString;function ro(l){var m,y,C,S,E,I=.75*l.length,L=l.length,N=0;l[l.length-1]==="="&&(I--,l[l.length-2]==="="&&I--);var $=new ArrayBuffer(I),U=new Uint8Array($);for(m=0;m<L;m+=4)y=me.indexOf(l[m]),C=me.indexOf(l[m+1]),S=me.indexOf(l[m+2]),E=me.indexOf(l[m+3]),U[N++]=y<<2|C>>4,U[N++]=(15&C)<<4|S>>2,U[N++]=(3&S)<<6|63&E;return $}function Pn(l){var m,y=new Uint8Array(l),C="";for(m=0;m<y.length;m+=3)C+=me[y[m]>>2],C+=me[(3&y[m])<<4|y[m+1]>>4],C+=me[(15&y[m+1])<<2|y[m+2]>>6],C+=me[63&y[m+2]];return y.length%3==2?C=C.substring(0,C.length-1)+"=":y.length%3==1&&(C=C.substring(0,C.length-2)+"=="),C}function es(l,m){var y="";if(l&&(y=no.call(l)),l&&(y==="[object ArrayBuffer]"||l.buffer&&no.call(l.buffer)==="[object ArrayBuffer]")){var C,S=Bt;l instanceof ArrayBuffer?(C=l,S+=Tn):(C=l.buffer,y==="[object Int8Array]"?S+=Vr:y==="[object Uint8Array]"?S+=Xr:y==="[object Uint8ClampedArray]"?S+=Gr:y==="[object Int16Array]"?S+=Kr:y==="[object Uint16Array]"?S+=Yr:y==="[object Int32Array]"?S+=Jr:y==="[object Uint32Array]"?S+=Zr:y==="[object Float32Array]"?S+=Qr:y==="[object Float64Array]"?S+=eo:m(new Error("Failed to get type for BinaryArray"))),m(S+Pn(C))}else if(y==="[object Blob]"){var E=new FileReader;E.onload=function(){var I=Qi+l.type+"~"+Pn(this.result);m(Bt+Rn+I)},E.readAsArrayBuffer(l)}else try{m(JSON.stringify(l))}catch(I){console.error("Couldn't convert value into a JSON string: ",l),m(null,I)}}function ts(l){if(l.substring(0,In)!==Bt)return JSON.parse(l);var m,y=l.substring(to),C=l.substring(In,to);if(C===Rn&&qr.test(y)){var S=y.match(qr);m=S[1],y=y.substring(S[0].length)}var E=ro(y);switch(C){case Tn:return E;case Rn:return c([E],{type:m});case Vr:return new Int8Array(E);case Xr:return new Uint8Array(E);case Gr:return new Uint8ClampedArray(E);case Kr:return new Int16Array(E);case Yr:return new Uint16Array(E);case Jr:return new Int32Array(E);case Zr:return new Uint32Array(E);case Qr:return new Float32Array(E);case eo:return new Float64Array(E);default:throw new Error("Unkown type: "+C)}}var zn={serialize:es,deserialize:ts,stringToBuffer:ro,bufferToString:Pn};function oo(l,m,y,C){l.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],y,C)}function ns(l){var m=this,y={db:null};if(l)for(var C in l)y[C]=typeof l[C]!="string"?l[C].toString():l[C];var S=new u(function(E,I){try{y.db=openDatabase(y.name,String(y.version),y.description,y.size)}catch(L){return I(L)}y.db.transaction(function(L){oo(L,y,function(){m._dbInfo=y,E()},function(N,$){I($)})},I)});return y.serializer=zn,S}function $e(l,m,y,C,S,E){l.executeSql(y,C,S,function(I,L){L.code===L.SYNTAX_ERR?I.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(N,$){$.rows.length?E(N,L):oo(N,m,function(){N.executeSql(y,C,S,E)},E)},E):E(I,L)},E)}function rs(l,m){var y=this;l=x(l);var C=new u(function(S,E){y.ready().then(function(){var I=y._dbInfo;I.db.transaction(function(L){$e(L,I,"SELECT * FROM "+I.storeName+" WHERE key = ? LIMIT 1",[l],function(N,$){var U=$.rows.length?$.rows.item(0).value:null;U&&(U=I.serializer.deserialize(U)),S(U)},function(N,$){E($)})})}).catch(E)});return g(C,m),C}function os(l,m){var y=this,C=new u(function(S,E){y.ready().then(function(){var I=y._dbInfo;I.db.transaction(function(L){$e(L,I,"SELECT * FROM "+I.storeName,[],function(N,$){for(var U=$.rows,F=U.length,G=0;G<F;G++){var Y=U.item(G),Q=Y.value;if(Q&&(Q=I.serializer.deserialize(Q)),(Q=l(Q,Y.key,G+1))!==void 0)return void S(Q)}S()},function(N,$){E($)})})}).catch(E)});return g(C,m),C}function io(l,m,y,C){var S=this;l=x(l);var E=new u(function(I,L){S.ready().then(function(){m===void 0&&(m=null);var N=m,$=S._dbInfo;$.serializer.serialize(m,function(U,F){F?L(F):$.db.transaction(function(G){$e(G,$,"INSERT OR REPLACE INTO "+$.storeName+" (key, value) VALUES (?, ?)",[l,U],function(){I(N)},function(Y,Q){L(Q)})},function(G){if(G.code===G.QUOTA_ERR){if(C>0)return void I(io.apply(S,[l,N,y,C-1]));L(G)}})})}).catch(L)});return g(E,y),E}function is(l,m,y){return io.apply(this,[l,m,y,1])}function ss(l,m){var y=this;l=x(l);var C=new u(function(S,E){y.ready().then(function(){var I=y._dbInfo;I.db.transaction(function(L){$e(L,I,"DELETE FROM "+I.storeName+" WHERE key = ?",[l],function(){S()},function(N,$){E($)})})}).catch(E)});return g(C,m),C}function as(l){var m=this,y=new u(function(C,S){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(I){$e(I,E,"DELETE FROM "+E.storeName,[],function(){C()},function(L,N){S(N)})})}).catch(S)});return g(y,l),y}function cs(l){var m=this,y=new u(function(C,S){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(I){$e(I,E,"SELECT COUNT(key) as c FROM "+E.storeName,[],function(L,N){var $=N.rows.item(0).c;C($)},function(L,N){S(N)})})}).catch(S)});return g(y,l),y}function ls(l,m){var y=this,C=new u(function(S,E){y.ready().then(function(){var I=y._dbInfo;I.db.transaction(function(L){$e(L,I,"SELECT key FROM "+I.storeName+" WHERE id = ? LIMIT 1",[l+1],function(N,$){var U=$.rows.length?$.rows.item(0).key:null;S(U)},function(N,$){E($)})})}).catch(E)});return g(C,m),C}function us(l){var m=this,y=new u(function(C,S){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(I){$e(I,E,"SELECT key FROM "+E.storeName,[],function(L,N){for(var $=[],U=0;U<N.rows.length;U++)$.push(N.rows.item(U).key);C($)},function(L,N){S(N)})})}).catch(S)});return g(y,l),y}function hs(l){return new u(function(m,y){l.transaction(function(C){C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(S,E){for(var I=[],L=0;L<E.rows.length;L++)I.push(E.rows.item(L).name);m({db:l,storeNames:I})},function(S,E){y(E)})},function(C){y(C)})})}function ds(l,m){m=T.apply(this,arguments);var y=this.config();(l=typeof l!="function"&&l||{}).name||(l.name=l.name||y.name,l.storeName=l.storeName||y.storeName);var C,S=this;return C=l.name?new u(function(E){var I;I=l.name===y.name?S._dbInfo.db:openDatabase(l.name,"","",0),l.storeName?E({db:I,storeNames:[l.storeName]}):E(hs(I))}).then(function(E){return new u(function(I,L){E.db.transaction(function(N){function $(Y){return new u(function(Q,he){N.executeSql("DROP TABLE IF EXISTS "+Y,[],function(){Q()},function(Me,Bn){he(Bn)})})}for(var U=[],F=0,G=E.storeNames.length;F<G;F++)U.push($(E.storeNames[F]));u.all(U).then(function(){I()}).catch(function(Y){L(Y)})},function(N){L(N)})})}):u.reject("Invalid arguments"),g(C,m),C}var fs={_driver:"webSQLStorage",_initStorage:ns,_support:Ne(),iterate:os,getItem:rs,setItem:is,removeItem:ss,clear:as,length:cs,key:ls,keys:us,dropInstance:ds};function ps(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function so(l,m){var y=l.name+"/";return l.storeName!==m.storeName&&(y+=l.storeName+"/"),y}function gs(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch{return!0}}function ms(){return!gs()||localStorage.length>0}function vs(l){var m=this,y={};if(l)for(var C in l)y[C]=l[C];return y.keyPrefix=so(l,m._defaultConfig),ms()?(m._dbInfo=y,y.serializer=zn,u.resolve()):u.reject()}function ys(l){var m=this,y=m.ready().then(function(){for(var C=m._dbInfo.keyPrefix,S=localStorage.length-1;S>=0;S--){var E=localStorage.key(S);E.indexOf(C)===0&&localStorage.removeItem(E)}});return g(y,l),y}function ws(l,m){var y=this;l=x(l);var C=y.ready().then(function(){var S=y._dbInfo,E=localStorage.getItem(S.keyPrefix+l);return E&&(E=S.serializer.deserialize(E)),E});return g(C,m),C}function bs(l,m){var y=this,C=y.ready().then(function(){for(var S=y._dbInfo,E=S.keyPrefix,I=E.length,L=localStorage.length,N=1,$=0;$<L;$++){var U=localStorage.key($);if(U.indexOf(E)===0){var F=localStorage.getItem(U);if(F&&(F=S.serializer.deserialize(F)),(F=l(F,U.substring(I),N++))!==void 0)return F}}});return g(C,m),C}function _s(l,m){var y=this,C=y.ready().then(function(){var S,E=y._dbInfo;try{S=localStorage.key(l)}catch{S=null}return S&&(S=S.substring(E.keyPrefix.length)),S});return g(C,m),C}function Ss(l){var m=this,y=m.ready().then(function(){for(var C=m._dbInfo,S=localStorage.length,E=[],I=0;I<S;I++){var L=localStorage.key(I);L.indexOf(C.keyPrefix)===0&&E.push(L.substring(C.keyPrefix.length))}return E});return g(y,l),y}function Cs(l){var m=this.keys().then(function(y){return y.length});return g(m,l),m}function Es(l,m){var y=this;l=x(l);var C=y.ready().then(function(){var S=y._dbInfo;localStorage.removeItem(S.keyPrefix+l)});return g(C,m),C}function ks(l,m,y){var C=this;l=x(l);var S=C.ready().then(function(){m===void 0&&(m=null);var E=m;return new u(function(I,L){var N=C._dbInfo;N.serializer.serialize(m,function($,U){if(U)L(U);else try{localStorage.setItem(N.keyPrefix+l,$),I(E)}catch(F){F.name!=="QuotaExceededError"&&F.name!=="NS_ERROR_DOM_QUOTA_REACHED"||L(F),L(F)}})})});return g(S,y),S}function xs(l,m){if(m=T.apply(this,arguments),!(l=typeof l!="function"&&l||{}).name){var y=this.config();l.name=l.name||y.name,l.storeName=l.storeName||y.storeName}var C,S=this;return C=l.name?new u(function(E){l.storeName?E(so(l,S._defaultConfig)):E(l.name+"/")}).then(function(E){for(var I=localStorage.length-1;I>=0;I--){var L=localStorage.key(I);L.indexOf(E)===0&&localStorage.removeItem(L)}}):u.reject("Invalid arguments"),g(C,m),C}var Is={_driver:"localStorageWrapper",_initStorage:vs,_support:ps(),iterate:bs,getItem:ws,setItem:ks,removeItem:Es,clear:ys,length:Cs,key:_s,keys:Ss,dropInstance:xs},Ts=function(l,m){return l===m||typeof l=="number"&&typeof m=="number"&&isNaN(l)&&isNaN(m)},Rs=function(l,m){for(var y=l.length,C=0;C<y;){if(Ts(l[C],m))return!0;C++}return!1},ao=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},gt={},co={},tt={INDEXEDDB:Oe,WEBSQL:fs,LOCALSTORAGE:Is},Ps=[tt.INDEXEDDB._driver,tt.WEBSQL._driver,tt.LOCALSTORAGE._driver],Dt=["dropInstance"],Mn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Dt),zs={description:"",driver:Ps.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ms(l,m){l[m]=function(){var y=arguments;return l.ready().then(function(){return l[m].apply(l,y)})}}function An(){for(var l=1;l<arguments.length;l++){var m=arguments[l];if(m)for(var y in m)m.hasOwnProperty(y)&&(ao(m[y])?arguments[0][y]=m[y].slice():arguments[0][y]=m[y])}return arguments[0]}var As=function(){function l(m){for(var y in o(this,l),tt)if(tt.hasOwnProperty(y)){var C=tt[y],S=C._driver;this[y]=S,gt[S]||this.defineDriver(C)}this._defaultConfig=An({},zs),this._config=An({},this._defaultConfig,m),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(m){if((m===void 0?"undefined":r(m))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var y in m){if(y==="storeName"&&(m[y]=m[y].replace(/\W/g,"_")),y==="version"&&typeof m[y]!="number")return new Error("Database version must be a number.");this._config[y]=m[y]}return!("driver"in m)||!m.driver||this.setDriver(this._config.driver)}return typeof m=="string"?this._config[m]:this._config},l.prototype.defineDriver=function(m,y,C){var S=new u(function(E,I){try{var L=m._driver,N=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!m._driver)return void I(N);for(var $=Mn.concat("_initStorage"),U=0,F=$.length;U<F;U++){var G=$[U];if((!Rs(Dt,G)||m[G])&&typeof m[G]!="function")return void I(N)}var Y=function(){for(var he=function(Ds){return function(){var Ls=new Error("Method "+Ds+" is not implemented by the current driver"),lo=u.reject(Ls);return g(lo,arguments[arguments.length-1]),lo}},Me=0,Bn=Dt.length;Me<Bn;Me++){var Dn=Dt[Me];m[Dn]||(m[Dn]=he(Dn))}};Y();var Q=function(he){gt[L]&&console.info("Redefining LocalForage driver: "+L),gt[L]=m,co[L]=he,E()};"_support"in m?m._support&&typeof m._support=="function"?m._support().then(Q,I):Q(!!m._support):Q(!0)}catch(he){I(he)}});return _(S,y,C),S},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(m,y,C){var S=gt[m]?u.resolve(gt[m]):u.reject(new Error("Driver not found."));return _(S,y,C),S},l.prototype.getSerializer=function(m){var y=u.resolve(zn);return _(y,m),y},l.prototype.ready=function(m){var y=this,C=y._driverSet.then(function(){return y._ready===null&&(y._ready=y._initDriver()),y._ready});return _(C,m,m),C},l.prototype.setDriver=function(m,y,C){var S=this;ao(m)||(m=[m]);var E=this._getSupportedDrivers(m);function I(){S._config.driver=S.driver()}function L(U){return S._extend(U),I(),S._ready=S._initStorage(S._config),S._ready}function N(U){return function(){var F=0;function G(){for(;F<U.length;){var Y=U[F];return F++,S._dbInfo=null,S._ready=null,S.getDriver(Y).then(L).catch(G)}I();var Q=new Error("No available storage method found.");return S._driverSet=u.reject(Q),S._driverSet}return G()}}var $=this._driverSet!==null?this._driverSet.catch(function(){return u.resolve()}):u.resolve();return this._driverSet=$.then(function(){var U=E[0];return S._dbInfo=null,S._ready=null,S.getDriver(U).then(function(F){S._driver=F._driver,I(),S._wrapLibraryMethodsWithReady(),S._initDriver=N(E)})}).catch(function(){I();var U=new Error("No available storage method found.");return S._driverSet=u.reject(U),S._driverSet}),_(this._driverSet,y,C),this._driverSet},l.prototype.supports=function(m){return!!co[m]},l.prototype._extend=function(m){An(this,m)},l.prototype._getSupportedDrivers=function(m){for(var y=[],C=0,S=m.length;C<S;C++){var E=m[C];this.supports(E)&&y.push(E)}return y},l.prototype._wrapLibraryMethodsWithReady=function(){for(var m=0,y=Mn.length;m<y;m++)Ms(this,Mn[m])},l.prototype.createInstance=function(m){return new l(m)},l}(),Bs=new As;e.exports=Bs},{3:3}]},{},[4])(4)),_i.exports),hn=jt(fa),Ci={exports:{}},pa=(Si||(Si=1,function(t){((e,n)=>{t.exports=n()})(0,()=>{const e=typeof window=="object"?window:this;e.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,r=!1;const o=e.WebStreamsPolyfill||{},i=e.isSecureContext;let s=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const a=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",c={createWriteStream:function(g,_,x){let T={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},z=0,d=null,h=null,b=null;if(Number.isFinite(_)?([x,_]=[_,x],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),T.size=x,T.writableStrategy=_):_&&_.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),T.size=x,T.writableStrategy=_):T=_||{},!s){n||(n=i?u(c.mitm):function(B){const D="width=200,height=100",R=document.createDocumentFragment(),k={frame:e.open(B,"popup",D),loaded:!1,isIframe:!1,isPopup:!0,remove(){k.frame.close()},addEventListener(...W){R.addEventListener(...W)},dispatchEvent(...W){R.dispatchEvent(...W)},removeEventListener(...W){R.removeEventListener(...W)},postMessage(...W){k.frame.postMessage(...W)}},A=W=>{W.source===k.frame&&(k.loaded=!0,e.removeEventListener("message",A),k.dispatchEvent(new Event("load")))};return e.addEventListener("message",A),k}(c.mitm)),h=new MessageChannel,g=encodeURIComponent(g.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const f={transferringReadable:r,pathname:T.pathname||Math.random().toString().slice(-6)+"/"+g,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+g}};T.size&&(f.headers["Content-Length"]=T.size);const w=[f,"*",[h.port2]];if(r){const B=a==="iframe"?void 0:{transform(R,k){if(!(R instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");z+=R.length,k.enqueue(R),d&&(location.href=d,d=null)},flush(){d&&(location.href=d)}};b=new c.TransformStream(B,T.writableStrategy,T.readableStrategy);const D=b.readable;h.port1.postMessage({readableStream:D},[D])}h.port1.onmessage=B=>{B.data.download?a==="navigate"?(n.remove(),n=null,z?location.href=B.data.download:d=B.data.download):(n.isPopup&&(n.remove(),n=null,a==="iframe"&&u(c.mitm)),u(B.data.download)):B.data.abort&&(v=[],h.port1.postMessage("abort"),h.port1.onmessage=null,h.port1.close(),h.port2.close(),h=null)},n.loaded?n.postMessage(...w):n.addEventListener("load",()=>{n.postMessage(...w)},{once:!0})}let v=[];return!s&&b&&b.writable||new c.WritableStream({write(f){if(!(f instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?v.push(f):(h.port1.postMessage(f),z+=f.length,d&&(location.href=d,d=null))},close(){if(s){const f=new Blob(v,{type:"application/octet-stream; charset=utf-8"}),w=document.createElement("a");w.href=URL.createObjectURL(f),w.download=g,w.click()}else h.port1.postMessage("end")},abort(){v=[],h.port1.postMessage("abort"),h.port1.onmessage=null,h.port1.close(),h.port2.close(),h=null}},T.writableStrategy)},WritableStream:e.WritableStream||o.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 u(g){if(!g)throw new Error("meh");const _=document.createElement("iframe");return _.hidden=!0,_.src=g,_.loaded=!1,_.name="iframe",_.isIframe=!0,_.postMessage=(...x)=>_.contentWindow.postMessage(...x),_.addEventListener("load",()=>{_.loaded=!0},{once:!0}),document.body.appendChild(_),_}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(g=>{try{g()}catch{}})(()=>{const{readable:g}=new TransformStream,_=new MessageChannel;_.port1.postMessage(g,[g]),_.port1.close(),_.port2.close(),r=!0,Object.defineProperty(c,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),c})}(Ci)),Ci.exports),ga=jt(pa);function ma(t,e){const n=`${t}_${e}`;return se.MD5(n)}function Ei(t){const e=function(a){if(!a)return;const c=a,u=[];if(c)for(let g of c){const _=ki(g);_&&u.push(_)}return u}(t.bussinessRoutes),n=function(a){if(!a)return;const c=a;if(c&&c.length>0){const u=[];return c.forEach(g=>{const _=xi(g);_&&u.push(_)}),u}}(t.widgetMenuConfig),r=function(a){if(a&&a.length>0){const c=[];return a.forEach(u=>{const g=function(_){return _?{id:_.id,label:_.label,layoutID:_.layoutID,container:_.container,preload:_.preload,afterid:_.afterid,bindid:_.bindid,group:_.group}:void 0}(u);g&&c.push(g)}),c}}(t.widgetConfig),o=function(a){if(a&&a.length>0)return a}(t.functionList),i=t.pkgObject.version,s=t.pkgObject.name;return{id:ma(s,i),name:O.Config.UI.SiteTitle,group:O.Config.UI.Group,product:s,version:i,routes:e,widgetMenu:n,widgets:r,functions:o}}function ki(t){if(t){let e=0;t.meta?.hidden&&(e=1);let n={path:t.path,name:t.name,title:t.meta?.title,type:e,index:t.meta?.index};if(t.children){const r=[];for(let o of t.children){const i=ki(o);i&&r.push(i)}r.length>0&&(n.children=r)}return n}}function xi(t){if(!t)return;const e={name:t.name,index:t.index,path:t.path,type:t.type};return t.children&&t.children.length>0&&(e.children=[],t.children.forEach(n=>{const r=xi(n);r&&e.children?.push(r)})),e}function Cr(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d.]/g,""),e=e.replace(/^0{2}$/g,"0"),e=e.replace(/^\./g,""),e=e.replace(".","$#$").replace(/\./g,"").replace("$#$","."),e=e.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),e}let Ii=!0;try{String.fromCharCode.apply(String,[1,2])}catch{Ii=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var Er=2654435769;function Ti(t,e){var n=t.length,r=n<<2;if(e){var o=t[n-1];if(o<(r-=4)-3||o>r)return null;r=o}for(var i=new Uint8Array(r),s=0;s<r;++s)i[s]=t[s>>2]>>((3&s)<<3);return i}function dn(t,e){var n,r=t.length,o=r>>2;3&r&&++o,e?(n=new Uint32Array(o+1))[o]=r:n=new Uint32Array(o);for(var i=0;i<r;++i)n[i>>2]|=t[i]<<((3&i)<<3);return n}function Ke(t){return 4294967295&t}function fn(t,e,n,r,o,i){return(n>>>5^e<<2)+(e>>>3^n<<4)^(t^e)+(i[3&r^o]^n)}function Ri(t){if(t.length<16){var e=new Uint8Array(16);e.set(t),t=e}return t}function pn(t){for(var e=t.length,n=new Uint8Array(3*e),r=0,o=0;o<e;o++){var i=t.charCodeAt(o);if(i<128)n[r++]=i;else if(i<2048)n[r++]=192|i>>6,n[r++]=128|63&i;else{if(!(i<55296||i>57343)){if(o+1<e){var s=t.charCodeAt(o+1);if(i<56320&&56320<=s&&s<=57343){var a=65536+((1023&i)<<10|1023&s);n[r++]=240|a>>18,n[r++]=128|a>>12&63,n[r++]=128|a>>6&63,n[r++]=128|63&a,o++;continue}}throw new Error("Malformed string")}n[r++]=224|i>>12,n[r++]=128|i>>6&63,n[r++]=128|63&i}}return n.subarray(0,r)}function Pi(t){var e=t.length;return e===0?"":e<32767?function(n,r){for(var o=new Array(r),i=0,s=0,a=n.length;i<r&&s<a;i++){var c=n[s++];switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o[i]=c;break;case 12:case 13:if(!(s<a))throw new Error("Unfinished UTF-8 octet sequence");o[i]=(31&c)<<6|63&n[s++];break;case 14:if(!(s+1<a))throw new Error("Unfinished UTF-8 octet sequence");o[i]=(15&c)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<a))throw new Error("Unfinished UTF-8 octet sequence");var u=((7&c)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=u&&u<=1048575))throw new Error("Character outside valid Unicode range: 0x"+u.toString(16));o[i++]=u>>10&1023|55296,o[i]=1023&u|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+c.toString(16))}}return i<r&&(o.length=i),String.fromCharCode.apply(String,o)}(t,e):function(n,r){for(var o=[],i=new Array(32768),s=0,a=0,c=n.length;s<r&&a<c;s++){var u=n[a++];switch(u>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=u;break;case 12:case 13:if(!(a<c))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&u)<<6|63&n[a++];break;case 14:if(!(a+1<c))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&u)<<12|(63&n[a++])<<6|63&n[a++];break;case 15:if(!(a+2<c))throw new Error("Unfinished UTF-8 octet sequence");var g=((7&u)<<18|(63&n[a++])<<12|(63&n[a++])<<6|63&n[a++])-65536;if(!(0<=g&&g<=1048575))throw new Error("Character outside valid Unicode range: 0x"+g.toString(16));i[s++]=g>>10&1023|55296,i[s]=1023&g|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+u.toString(16))}if(s>=32766){var _=s+1;i.length=_,o.push(String.fromCharCode.apply(String,i)),r-=_,s=-1}}return s>0&&(i.length=s,o.push(String.fromCharCode.apply(String,i))),o.join("")}(t,e)}function va(t){var e=t.length;if(e===0)return"";var n=Ii?t:function(a){for(var c=a.length,u=new Array(a.length),g=0;g<c;++g)u[g]=a[g];return u}(t);if(e<65535)return String.fromCharCode.apply(String,n);for(var r=32767&e,o=e>>15,i=new Array(r?o+1:o),s=0;s<o;++s)i[s]=String.fromCharCode.apply(String,n.subarray(s<<15,s+1<<15));return r&&(i[o]=String.fromCharCode.apply(String,n.subarray(o<<15,e))),i.join("")}function zi(t,e){return typeof t=="string"&&(t=pn(t)),typeof e=="string"&&(e=pn(e)),t==null||t.length===0?t:Ti(function(n,r){var o,i,s,a,c,u,g=n.length,_=g-1;for(i=n[_],s=0,u=0|Math.floor(6+52/g);u>0;--u){for(a=(s=Ke(s+Er))>>>2&3,c=0;c<_;++c)o=n[c+1],i=n[c]=Ke(n[c]+fn(s,o,i,c,a,r));o=n[0],i=n[_]=Ke(n[_]+fn(s,o,i,_,a,r))}return n}(dn(t,!0),dn(Ri(e),!1)),!1)}function Mi(t,e){return typeof t=="string"&&(t=function(n){for(var r=window.atob(n),o=r.length,i=new Uint8Array(o),s=0;s<o;s++)i[s]=r.charCodeAt(s);return i}(t)),typeof e=="string"&&(e=pn(e)),t==null||t.length===0?t:Ti(function(n,r){var o,i,s,a,c,u=n.length,g=u-1;for(o=n[0],s=Ke(Math.floor(6+52/u)*Er);s!==0;s=Ke(s-Er)){for(a=s>>>2&3,c=g;c>0;--c)i=n[c-1],o=n[c]=Ke(n[c]-fn(s,o,i,c,a,r));i=n[g],o=n[0]=Ke(n[0]-fn(s,o,i,0,a,r))}return n}(dn(t,!1),dn(Ri(e),!1)),!0)}const kt={toBytes:pn,toString:Pi,encrypt:zi,encryptToString:function(t,e){return window.btoa(va(zi(t,e)))},decrypt:Mi,decryptToString:function(t,e){return Pi(Mi(t,e))}},Ai=t=>{const e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e));const n=document.createElement("canvas");n.width=200,n.height=130;const r=n.getContext("2d");r.rotate(-20*Math.PI/180),r.font="12px Vedana",r.fillStyle="rgba(200, 200, 200, 0.30)",r.textBaseline="middle",r.fillText(t,n.width/10,n.height/2);const o=document.createElement("div");return o.id=e,o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.position="fixed",o.style.zIndex="10000000",o.style.width=`${document.documentElement.clientWidth}px`,o.style.height=`${document.documentElement.clientHeight}px`,o.style.background=`url(${n.toDataURL("image/png")}) left top repeat`,document.body.appendChild(o),e},ya={set:t=>{let e=Ai(t);document.getElementById(e)===null&&(e=Ai(t))},del:()=>{let t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t))}};class Je extends Error{constructor(e,n){const r=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=r}}class kr extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class Pe extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class wa extends Error{constructor(e,n){const r=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=r}}class ba extends Error{constructor(e,n){const r=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=r}}class _a extends Error{constructor(e,n){const r=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=r}}class Bi extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class Sa extends Error{constructor(e,n){const r=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=r}}class Di{constructor(e,n,r){this.statusCode=e,this.statusText=n,this.content=r}}class gn{get(e,n){return this.send({...n,method:"GET",url:e})}post(e,n){return this.send({...n,method:"POST",url:e})}delete(e,n){return this.send({...n,method:"DELETE",url:e})}getCookieString(e){return""}}var P;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(P||(P={}));class xt{constructor(){}log(e,n){}}xt.instance=new xt;class le{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,r){if(!(e in n))throw new Error(`Unknown ${r} value: ${e}.`)}}class ie{static get isBrowser(){return!ie.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!ie.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!ie.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function It(t,e){let n="";return Ye(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${function(r){const o=new Uint8Array(r);let i="";return o.forEach(s=>{i+=`0x${s<16?"0":""}${s.toString(16)} `}),i.substr(0,i.length-1)}(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function Ye(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}async function Li(t,e,n,r,o,i){const s={},[a,c]=dt();s[a]=c,t.log(P.Trace,`(${e} transport) sending data. ${It(o,i.logMessageContent)}.`);const u=Ye(o)?"arraybuffer":"text",g=await n.post(r,{content:o,headers:{...s,...i.headers},responseType:u,timeout:i.timeout,withCredentials:i.withCredentials});t.log(P.Trace,`(${e} transport) request complete. Response status: ${g.statusCode}.`)}class Ca{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class mn{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const r=`[${new Date().toISOString()}] ${P[e]}: ${n}`;switch(e){case P.Critical:case P.Error:this.out.error(r);break;case P.Warning:this.out.warn(r);break;case P.Information:this.out.info(r);break;default:this.out.log(r)}}}}function dt(){let t="X-SignalR-User-Agent";return ie.isNode&&(t="User-Agent"),[t,Ea("8.0.7",ka(),Ia(),xa())]}function Ea(t,e,n,r){let o="Microsoft SignalR/";const i=t.split(".");return o+=`${i[0]}.${i[1]}`,o+=` (${t}; `,o+=e&&e!==""?`${e}; `:"Unknown OS; ",o+=`${n}`,o+=r?`; ${r}`:"; Unknown Runtime Version",o+=")",o}function ka(){if(!ie.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function xa(){if(ie.isNode)return process.versions.node}function Ia(){return ie.isNode?"NodeJS":"Browser"}function xr(t){return t.stack?t.stack:t.message?t.message:`${t}`}class Ta extends gn{constructor(e){if(super(),this._logger=e,typeof fetch>"u"||ie.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}());if(typeof AbortController>"u"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new Pe;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let r;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),r=new Pe});let o,i=null;if(e.timeout){const c=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(P.Warning,"Timeout from HTTP request."),r=new kr},c)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Ye(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{o=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(c){throw r||(this._logger.log(P.Warning,`Error from HTTP request. ${c}.`),c)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const c=await Ni(o,"text");throw new Je(c||o.statusText,o.status)}const s=Ni(o,e.responseType),a=await s;return new Di(o.status,o.statusText,a)}getCookieString(e){let n="";return ie.isNode&&this._jar&&this._jar.getCookies(e,(r,o)=>n=o.join("; ")),n}}function Ni(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":default:n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return n}class Ra extends gn{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Pe):e.method?e.url?new Promise((n,r)=>{const o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=e.withCredentials===void 0||e.withCredentials,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(Ye(e.content)?o.setRequestHeader("Content-Type","application/octet-stream"):o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=e.headers;i&&Object.keys(i).forEach(s=>{o.setRequestHeader(s,i[s])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{o.abort(),r(new Pe)}),e.timeout&&(o.timeout=e.timeout),o.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new Di(o.status,o.statusText,o.response||o.responseText)):r(new Je(o.response||o.responseText||o.statusText,o.status))},o.onerror=()=>{this._logger.log(P.Warning,`Error from HTTP request. ${o.status}: ${o.statusText}.`),r(new Je(o.statusText,o.status))},o.ontimeout=()=>{this._logger.log(P.Warning,"Timeout from HTTP request."),r(new kr)},o.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Pa extends gn{constructor(e){if(super(),typeof fetch<"u"||ie.isNode)this._httpClient=new Ta(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new Ra(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Pe):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class Ce{static write(e){return`${e}${Ce.RecordSeparator}`}static parse(e){if(e[e.length-1]!==Ce.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(Ce.RecordSeparator);return n.pop(),n}}Ce.RecordSeparatorCode=30,Ce.RecordSeparator=String.fromCharCode(Ce.RecordSeparatorCode);class za{writeHandshakeRequest(e){return Ce.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,r;if(Ye(e)){const s=new Uint8Array(e),a=s.indexOf(Ce.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const c=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,c))),r=s.byteLength>c?s.slice(c).buffer:null}else{const s=e,a=s.indexOf(Ce.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const c=a+1;n=s.substring(0,c),r=s.length>c?s.substring(c):null}const o=Ce.parse(n),i=JSON.parse(o[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[r,i]}}var V;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(V||(V={}));class Ma{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Ca(this,e)}}class Aa{constructor(e,n,r){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=n,this._bufferSize=r}async _send(e){const n=this._protocol.writeMessage(e);let r=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let o=()=>{},i=()=>{};Ye(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(r=new Promise((s,a)=>{o=s,i=a})),this._messages.push(new Ba(n,this._totalMessageCount,o,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await r}_ack(e){let n=-1;for(let r=0;r<this._messages.length;r++){const o=this._messages[r];if(o._id<=e.sequenceId)n=r,Ye(o._message)?this._bufferedByteCount-=o._message.byteLength:this._bufferedByteCount-=o._message.length,o._resolver();else{if(!(this._bufferedByteCount<this._bufferSize))break;o._resolver()}}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type===V.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(e){e.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:V.Sequence,sequenceId:e}));const n=this._messages;for(const r of n)await this._connection.send(r._message);this._reconnectInProgress=!1}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.type){case V.Invocation:case V.StreamItem:case V.Completion:case V.StreamInvocation:case V.CancelInvocation:return!0;case V.Close:case V.Sequence:case V.Ping:case V.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:V.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Ba{constructor(e,n,r,o){this._message=e,this._id=n,this._resolver=r,this._rejector=o}}var oe;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(oe||(oe={}));class Or{static create(e,n,r,o,i,s,a){return new Or(e,n,r,o,i,s,a)}constructor(e,n,r,o,i,s,a){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(P.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},le.isRequired(e,"connection"),le.isRequired(n,"logger"),le.isRequired(r,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=a??1e5,this._logger=n,this._protocol=r,this.connection=e,this._reconnectPolicy=o,this._handshakeProtocol=new za,this.connection.onreceive=c=>this._processIncomingData(c),this.connection.onclose=c=>this._connectionClosed(c),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=oe.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:V.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==oe.Disconnected&&this._connectionState!==oe.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==oe.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=oe.Connecting,this._logger.log(P.Debug,"Starting HubConnection.");try{await this._startInternal(),ie.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=oe.Connected,this._connectionStarted=!0,this._logger.log(P.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=oe.Disconnected,this._logger.log(P.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise((n,r)=>{this._handshakeResolver=n,this._handshakeRejecter=r});await this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const r={protocol:this._protocol.name,version:n};if(this._logger.log(P.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(r)),this._logger.log(P.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new Aa(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(n){throw this._logger.log(P.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch{}}_stopInternal(e){if(this._connectionState===oe.Disconnected)return this._logger.log(P.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===oe.Disconnecting)return this._logger.log(P.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=oe.Disconnecting,this._logger.log(P.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(P.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===oe.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Pe("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...n){const[r,o]=this._replaceStreamingParams(n),i=this._createStreamInvocation(e,n,o);let s;const a=new Ma;return a.cancelCallback=()=>{const c=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(c))},this._callbacks[i.invocationId]=(c,u)=>{u?a.error(u):c&&(c.type===V.Completion?c.error?a.error(new Error(c.error)):a.complete():a.next(c.item))},s=this._sendWithProtocol(i).catch(c=>{a.error(c),delete this._callbacks[i.invocationId]}),this._launchStreams(r,s),a}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...n){const[r,o]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(e,n,!0,o));return this._launchStreams(r,i),i}invoke(e,...n){const[r,o]=this._replaceStreamingParams(n),i=this._createInvocation(e,n,!1,o);return new Promise((a,c)=>{this._callbacks[i.invocationId]=(g,_)=>{_?c(_):g&&(g.type===V.Completion?g.error?c(new Error(g.error)):a(g.result):c(new Error(`Unexpected message type: ${g.type}`)))};const u=this._sendWithProtocol(i).catch(g=>{c(g),delete this._callbacks[i.invocationId]});this._launchStreams(r,u)})}on(e,n){e&&n&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const r=this._methods[e];if(r)if(n){const o=r.indexOf(n);o!==-1&&(r.splice(o,1),r.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const r of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(r))switch(r.type){case V.Invocation:this._invokeClientMethod(r).catch(o=>{this._logger.log(P.Error,`Invoke client method threw error: ${xr(o)}`)});break;case V.StreamItem:case V.Completion:{const o=this._callbacks[r.invocationId];if(o){r.type===V.Completion&&delete this._callbacks[r.invocationId];try{o(r)}catch(i){this._logger.log(P.Error,`Stream callback threw error: ${xr(i)}`)}}break}case V.Ping:break;case V.Close:{this._logger.log(P.Information,"Close message received from server.");const o=r.error?new Error("Server returned an error on close: "+r.error):void 0;r.allowReconnect===!0?this.connection.stop(o):this._stopPromise=this._stopInternal(o);break}case V.Ack:this._messageBuffer&&this._messageBuffer._ack(r);break;case V.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(r);break;default:this._logger.log(P.Warning,`Invalid message type: ${r.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,r;try{[r,n]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(o){const i="Error parsing handshake response: "+o;this._logger.log(P.Error,i);const s=new Error(i);throw this._handshakeRejecter(s),s}if(n.error){const o="Server returned handshake error: "+n.error;this._logger.log(P.Error,o);const i=new Error(o);throw this._handshakeRejecter(i),i}return this._logger.log(P.Debug,"Server handshake complete."),this._handshakeResolver(),r}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle!==void 0))){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===oe.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const n=e.target.toLowerCase(),r=this._methods[n];if(!r)return this._logger.log(P.Warning,`No client method with the name '${n}' found.`),void(e.invocationId&&(this._logger.log(P.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const o=r.slice(),i=!!e.invocationId;let s,a,c;for(const u of o)try{const g=s;s=await u.apply(this,e.arguments),i&&s&&g&&(this._logger.log(P.Error,`Multiple results provided for '${n}'. Sending error to server.`),c=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),a=void 0}catch(g){a=g,this._logger.log(P.Error,`A callback for the method '${n}' threw error '${g}'.`)}c?await this._sendWithProtocol(c):i?(a?c=this._createCompletionMessage(e.invocationId,`${a}`,null):s!==void 0?c=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(P.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),c=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(c)):s&&this._logger.log(P.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(P.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Pe("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===oe.Disconnecting?this._completeClose(e):this._connectionState===oe.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===oe.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=oe.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),ie.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(P.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}async _reconnect(e){const n=Date.now();let r=0,o=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(r++,0,o);if(i===null)return this._logger.log(P.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=oe.Reconnecting,e?this._logger.log(P.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(P.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[e]))}catch(s){this._logger.log(P.Error,`An onreconnecting callback called with error '${e}' threw error '${s}'.`)}if(this._connectionState!==oe.Reconnecting)return void this._logger.log(P.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(P.Information,`Reconnect attempt number ${r} will start in ${i} ms.`),await new Promise(s=>{this._reconnectDelayHandle=setTimeout(s,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==oe.Reconnecting)return void this._logger.log(P.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=oe.Connected,this._logger.log(P.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(P.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(P.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==oe.Reconnecting)return this._logger.log(P.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===oe.Disconnecting&&this._completeClose());o=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(r++,Date.now()-n,o)}}this._logger.log(P.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${r} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,n,r){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:r})}catch(o){return this._logger.log(P.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${o}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(r=>{const o=n[r];try{o(null,e)}catch(i){this._logger.log(P.Error,`Stream 'error' callback called with '${e}' threw error: ${xr(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,r,o){if(r)return o.length!==0?{arguments:n,streamIds:o,target:e,type:V.Invocation}:{arguments:n,target:e,type:V.Invocation};{const i=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:i.toString(),streamIds:o,target:e,type:V.Invocation}:{arguments:n,invocationId:i.toString(),target:e,type:V.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const r in e)e[r].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(r)))},error:o=>{let i;i=o instanceof Error?o.message:o&&o.toString?o.toString():"Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(r,i)))},next:o=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(r,o)))}})}}_replaceStreamingParams(e){const n=[],r=[];for(let o=0;o<e.length;o++){const i=e[o];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,r.push(s.toString()),e.splice(o,1)}}return[n,r]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,r){const o=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:o.toString(),streamIds:r,target:e,type:V.StreamInvocation}:{arguments:n,invocationId:o.toString(),target:e,type:V.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:V.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:V.StreamItem}}_createCompletionMessage(e,n,r){return n?{error:n,invocationId:e,type:V.Completion}:{invocationId:e,result:r,type:V.Completion}}_createCloseMessage(){return{type:V.Close}}}const Da=[0,2e3,1e4,3e4,null];class $i{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Da}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class Ze{}Ze.Authorization="Authorization",Ze.Cookie="Cookie";class La extends gn{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}async send(e){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const r=await this._innerClient.send(e);return n&&r.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):r}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[Ze.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[Ze.Authorization]&&delete e.headers[Ze.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var ue,pe;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(ue||(ue={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(pe||(pe={}));class Na{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class Wi{get pollAborted(){return this._pollAbort.aborted}constructor(e,n,r){this._httpClient=e,this._logger=n,this._pollAbort=new Na,this._options=r,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,n){if(le.isRequired(e,"url"),le.isRequired(n,"transferFormat"),le.isIn(n,pe,"transferFormat"),this._url=e,this._logger.log(P.Trace,"(LongPolling transport) Connecting."),n===pe.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[r,o]=dt(),i={[r]:o,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===pe.Binary&&(s.responseType="arraybuffer");const a=`${e}&_=${Date.now()}`;this._logger.log(P.Trace,`(LongPolling transport) polling: ${a}.`);const c=await this._httpClient.get(a,s);c.statusCode!==200?(this._logger.log(P.Error,`(LongPolling transport) Unexpected response code: ${c.statusCode}.`),this._closeError=new Je(c.statusText||"",c.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(e,n){try{for(;this._running;)try{const r=`${e}&_=${Date.now()}`;this._logger.log(P.Trace,`(LongPolling transport) polling: ${r}.`);const o=await this._httpClient.get(r,n);o.statusCode===204?(this._logger.log(P.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):o.statusCode!==200?(this._logger.log(P.Error,`(LongPolling transport) Unexpected response code: ${o.statusCode}.`),this._closeError=new Je(o.statusText||"",o.statusCode),this._running=!1):o.content?(this._logger.log(P.Trace,`(LongPolling transport) data received. ${It(o.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(o.content)):this._logger.log(P.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(r){this._running?r instanceof kr?this._logger.log(P.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=r,this._running=!1):this._logger.log(P.Trace,`(LongPolling transport) Poll errored after shutdown: ${r.message}`)}}finally{this._logger.log(P.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Li(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(P.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(P.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,r]=dt();e[n]=r;const o={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let i;try{await this._httpClient.delete(this._url,o)}catch(s){i=s}i?i instanceof Je&&(i.statusCode===404?this._logger.log(P.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(P.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(P.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(P.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(P.Trace,e),this.onclose(this._closeError)}}}class $a{constructor(e,n,r,o){this._httpClient=e,this._accessToken=n,this._logger=r,this._options=o,this.onreceive=null,this.onclose=null}async connect(e,n){return le.isRequired(e,"url"),le.isRequired(n,"transferFormat"),le.isIn(n,pe,"transferFormat"),this._logger.log(P.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((r,o)=>{let i,s=!1;if(n===pe.Text){if(ie.isBrowser||ie.isWebWorker)i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const a=this._httpClient.getCookieString(e),c={};c.Cookie=a;const[u,g]=dt();c[u]=g,i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...c,...this._options.headers}})}try{i.onmessage=a=>{if(this.onreceive)try{this._logger.log(P.Trace,`(SSE transport) data received. ${It(a.data,this._options.logMessageContent)}.`),this.onreceive(a.data)}catch(c){return void this._close(c)}},i.onerror=a=>{s?this._close():o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(P.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,r()}}catch(a){return void o(a)}}else o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(e){return this._eventSource?Li(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class Wa{constructor(e,n,r,o,i,s){this._logger=r,this._accessTokenFactory=n,this._logMessageContent=o,this._webSocketConstructor=i,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,n){let r;return le.isRequired(e,"url"),le.isRequired(n,"transferFormat"),le.isIn(n,pe,"transferFormat"),this._logger.log(P.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(r=await this._accessTokenFactory()),new Promise((o,i)=>{let s;e=e.replace(/^http/,"ws");const a=this._httpClient.getCookieString(e);let c=!1;if(ie.isNode||ie.isReactNative){const u={},[g,_]=dt();u[g]=_,r&&(u[Ze.Authorization]=`Bearer ${r}`),a&&(u[Ze.Cookie]=a),s=new this._webSocketConstructor(e,void 0,{headers:{...u,...this._headers}})}else r&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(r)}`);s||(s=new this._webSocketConstructor(e)),n===pe.Binary&&(s.binaryType="arraybuffer"),s.onopen=u=>{this._logger.log(P.Information,`WebSocket connected to ${e}.`),this._webSocket=s,c=!0,o()},s.onerror=u=>{let g=null;g=typeof ErrorEvent<"u"&&u instanceof ErrorEvent?u.error:"There was an error with the transport",this._logger.log(P.Information,`(WebSockets transport) ${g}.`)},s.onmessage=u=>{if(this._logger.log(P.Trace,`(WebSockets transport) data received. ${It(u.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(u.data)}catch(g){return void this._close(g)}},s.onclose=u=>{if(c)this._close(u);else{let g=null;g=typeof ErrorEvent<"u"&&u instanceof ErrorEvent?u.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",i(new Error(g))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(P.Trace,`(WebSockets transport) sending data. ${It(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(P.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||e.wasClean!==!1&&e.code===1e3?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}class Ua{constructor(e,n={}){var r;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,le.isRequired(e,"url"),this._logger=(r=n.logger)===void 0?new mn(P.Information):r===null?xt.instance:r.log!==void 0?r:new mn(r),this.baseUrl=this._resolveUrl(e),(n=n||{}).logMessageContent=n.logMessageContent!==void 0&&n.logMessageContent,typeof n.withCredentials!="boolean"&&n.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.withCredentials=n.withCredentials===void 0||n.withCredentials,n.timeout=n.timeout===void 0?1e5:n.timeout;let o=null,i=null;if(ie.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;o=s("ws"),i=s("eventsource")}ie.isNode||typeof WebSocket>"u"||n.WebSocket?ie.isNode&&!n.WebSocket&&o&&(n.WebSocket=o):n.WebSocket=WebSocket,ie.isNode||typeof EventSource>"u"||n.EventSource?ie.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new La(n.httpClient||new Pa(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(e){if(e=e||pe.Binary,le.isIn(e,pe,"transferFormat"),this._logger.log(P.Debug,`Starting connection with transfer format '${pe[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(P.Error,n),await this._stopPromise,Promise.reject(new Pe(n))}if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(P.Error,n),Promise.reject(new Pe(n))}this._connectionStarted=!0}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Fr(this.transport)),this._sendQueue.send(e))}async stop(e){return this._connectionState==="Disconnected"?(this._logger.log(P.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(P.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(P.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(P.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==ue.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(ue.WebSockets),await this._startTransport(n,e)}else{let r=null,o=0;do{if(r=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new Pe("The connection was stopped during negotiation.");if(r.error)throw new Error(r.error);if(r.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(r.url&&(n=r.url),r.accessToken){const i=r.accessToken;this._accessTokenFactory=()=>i,this._httpClient._accessToken=i,this._httpClient._accessTokenFactory=void 0}o++}while(r.url&&o<100);if(o===100&&r.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(n,this._options.transport,r,e)}this.transport instanceof Wi&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(P.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(r){return this._logger.log(P.Error,"Failed to start the connection: "+r),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(r)}}async _getNegotiationResponse(e){const n={},[r,o]=dt();n[r]=o;const i=this._resolveNegotiateUrl(e);this._logger.log(P.Debug,`Sending negotiation request: ${i}.`);try{const s=await this._httpClient.post(i,{content:"",headers:{...n,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(s.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${s.statusCode}'`));const a=JSON.parse(s.content);return(!a.negotiateVersion||a.negotiateVersion<1)&&(a.connectionToken=a.connectionId),a.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new Bi("Client didn't negotiate Stateful Reconnect but the server did.")):a}catch(s){let a="Failed to complete negotiation with the server: "+s;return s instanceof Je&&s.statusCode===404&&(a+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(P.Error,a),Promise.reject(new Bi(a))}}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}async _createTransport(e,n,r,o){let i=this._createConnectUrl(e,r.connectionToken);if(this._isITransport(n))return this._logger.log(P.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,await this._startTransport(i,o),void(this.connectionId=r.connectionId);const s=[],a=r.availableTransports||[];let c=r;for(const u of a){const g=this._resolveTransportOrError(u,n,o,c?.useStatefulReconnect===!0);if(g instanceof Error)s.push(`${u.transport} failed:`),s.push(g);else if(this._isITransport(g)){if(this.transport=g,!c){try{c=await this._getNegotiationResponse(e)}catch(_){return Promise.reject(_)}i=this._createConnectUrl(e,c.connectionToken)}try{return await this._startTransport(i,o),void(this.connectionId=c.connectionId)}catch(_){if(this._logger.log(P.Error,`Failed to start the transport '${u.transport}': ${_}`),c=void 0,s.push(new _a(`${u.transport} failed: ${_}`,ue[u.transport])),this._connectionState!=="Connecting"){const x="Failed to select transport before stop() was called.";return this._logger.log(P.Debug,x),Promise.reject(new Pe(x))}}}}return s.length>0?Promise.reject(new Sa(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case ue.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Wa(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case ue.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new $a(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case ue.LongPolling:return new Wi(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async r=>{let o=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(e,n),await this.features.resend()}catch{o=!0}o&&this._stopConnection(r)}else this._stopConnection(r)}:this.transport.onclose=r=>this._stopConnection(r),this.transport.connect(e,n)}_resolveTransportOrError(e,n,r,o){const i=ue[e.transport];if(i==null)return this._logger.log(P.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(s,a){return!s||!!(a&s)}(n,i))return this._logger.log(P.Debug,`Skipping transport '${ue[i]}' because it was disabled by the client.`),new ba(`'${ue[i]}' is disabled by the client.`,i);{if(!(e.transferFormats.map(a=>pe[a]).indexOf(r)>=0))return this._logger.log(P.Debug,`Skipping transport '${ue[i]}' because it does not support the requested transfer format '${pe[r]}'.`),new Error(`'${ue[i]}' does not support ${pe[r]}.`);if(i===ue.WebSockets&&!this._options.WebSocket||i===ue.ServerSentEvents&&!this._options.EventSource)return this._logger.log(P.Debug,`Skipping transport '${ue[i]}' because it is not supported in your environment.'`),new wa(`'${ue[i]}' is not supported in your environment.`,i);this._logger.log(P.Debug,`Selecting transport '${ue[i]}'.`);try{return this.features.reconnect=i===ue.WebSockets?o:void 0,this._constructTransport(i)}catch(a){return a}}}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(P.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(P.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(P.Error,`Connection disconnected with error '${e}'.`):this._logger.log(P.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(P.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(n){this._logger.log(P.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}else this._logger.log(P.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!ie.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(P.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const r=new URLSearchParams(n.searchParams);return r.has("negotiateVersion")||r.append("negotiateVersion",this._negotiateVersion.toString()),r.has("useStatefulReconnect")?r.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&r.append("useStatefulReconnect","true"),n.search=r.toString(),n.toString()}}class Fr{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new vn,this._transportResult=new vn,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new vn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new vn;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):Fr._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),e.resolve()}catch(r){e.reject(r)}}}static _concatBuffers(e){const n=e.map(i=>i.byteLength).reduce((i,s)=>i+s),r=new Uint8Array(n);let o=0;for(const i of e)r.set(new Uint8Array(i),o),o+=i.byteLength;return r.buffer}}class vn{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class ja{constructor(){this.name="json",this.version=2,this.transferFormat=pe.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=xt.instance);const r=Ce.parse(e),o=[];for(const i of r){const s=JSON.parse(i);if(typeof s.type!="number")throw new Error("Invalid payload.");switch(s.type){case V.Invocation:this._isInvocationMessage(s);break;case V.StreamItem:this._isStreamItemMessage(s);break;case V.Completion:this._isCompletionMessage(s);break;case V.Ping:case V.Close:break;case V.Ack:this._isAckMessage(s);break;case V.Sequence:this._isSequenceMessage(s);break;default:n.log(P.Information,"Unknown message type '"+s.type+"' ignored.");continue}o.push(s)}return o}writeMessage(e){return Ce.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,n){if(typeof e!="string"||e==="")throw new Error(n)}}const Oa={trace:P.Trace,debug:P.Debug,info:P.Information,information:P.Information,warn:P.Warning,warning:P.Warning,error:P.Error,critical:P.Critical,none:P.None};class Fa{configureLogging(e){if(le.isRequired(e,"logging"),e.log!==void 0)this.logger=e;else if(typeof e=="string"){const n=function(r){const o=Oa[r.toLowerCase()];if(o!==void 0)return o;throw new Error(`Unknown log level: ${r}`)}(e);this.logger=new mn(n)}else this.logger=new mn(e);return this}withUrl(e,n){return le.isRequired(e,"url"),le.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(e){return le.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new $i(e):this.reconnectPolicy=e:this.reconnectPolicy=new $i,this}withServerTimeout(e){return le.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return le.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new Ua(this.url,e);return Or.create(n,this.logger||xt.instance,this.protocol||new ja,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let yn;const Ir=new Set;function Ui(t){return t!==null?parseFloat(t):0}function wn(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(Ui).reduce((o,i)=>o+i)),r=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(Ui).reduce((o,i)=>o+i));return{width:n,height:r}}class ji{width;height;constructor(e,n){this.width=e,this.height=n}}function Ha(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),r=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(r))return{left:n,top:r}}return null}function qa(t,e,n,r){const o=t-n,i=e-r;return o*o+i*i}window.addEventListener("resize",t=>{Ir.forEach(e=>{e&&Ot(e.fixPosition)&&e.fixPosition()})});const bn=[];var _n=p.defineComponent({name:"VWindow",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:Ut},setup(t,{emit:e}){const n=p.getCurrentInstance();if(!n)return;const{proxy:r}=n;let o=0,i,s,a;const c=p.ref(t.isOpen),u=()=>{bn.push(r),a=new Hs(t.zGroup,g),t.isOpen&&function(D){D&&(p.nextTick(()=>{o++==0&&(v(r),function(){const R=_.value,{width:k,height:A}=Wn(R);let W,M;if(t.left!==void 0!=(t.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof t.left=="number")W=t.left,M=t.top;else{const j=t.positionHint||"auto";switch(j){case"auto":{let H=20,q=50,X=0;do{if(bn.every(K=>{if(!K.isOpen||r==K)return!0;const J=Ha(K);if(J==null)return!0;const{left:ae,top:Z}=J;return qa(ae,Z,H,q)>16}))break;H=(H+40)%(window.innerWidth-200),q=(q+40)%(window.innerHeight-200)}while(++X<100);W=H,M=q}break;case"center":W=(window.innerWidth-k)/2,M=(window.innerHeight-A)/2,console.log(W,M,window.innerWidth,window.innerHeight,"111111");break;default:try{const H=j.split("/").map(Number);if(H.length!=2)throw null;const[q,X]=H;if(!isFinite(q)||!isFinite(X))throw null;W=q>=0?q:window.innerWidth-k+q,M=X>=0?X:window.innerHeight-A+X}catch{throw new Error(`invalid position string: ${j}`)}}}R&&(R.style.left=`${W}px`,R.style.top=`${M}px`)}()),t.resizable&&f(),B(),i=new Fs(x.value,_.value,{onMove:()=>B(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:R}=Wn(x.value);s=new Vs(_.value,{onResize:()=>f(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+R,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+R:void 0})}()}),t.activateWhenOpen&&z())}(!0),Ir.add(r)};function g(D){d.value.zIndex=`${D}`}const _=p.ref(null),x=p.ref(null),T=p.ref(null);function z(){a.raise(),e("activate")}const d=p.ref({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),h=p.computed(()=>t.windowStyle.titlebar),b=p.computed(()=>{const D={...t.windowStyle.content};return t.resizable?D.padding="0":t.padding!=null&&(D.padding=`${t.padding}px`),t.isScrollable&&(D.overflow="auto"),D});function v(D){const{width:R,height:k,top:A,left:W}=D,M=_;if(M&&R!=null&&(M.value.style.width=`${R}px`),k!=null){const j=x.value;if(j){const H=wn(j).height;M.value.style.height=`${k+H}px`}}M&&W!=null&&(M.value.style.left=`${W}px`),M&&A!=null&&(M.value.style.top=`${A}px`)}function f(D=!0){const R=_.value,k=x.value,A=T.value;if(A&&R&&k){const{width:W,height:M}=wn(A),{width:j,height:H}=wn(R),q=wn(k).height,X=j-(A.offsetWidth-W),K=H-q-(A.offsetHeight-M);A.style.width=`${X}px`,A.style.height=`${K}px`,w(),e("resize",new ji(X,K)),D&&(e("update:width",X),e("update:height",K))}}function w(){const D=_.value;if(D){const R=D.getBoundingClientRect();R.left<0&&(d.value.left="0px"),R.top<0&&(d.value.top="0px"),R.right>window.innerWidth&&(d.value.left=window.innerWidth-R.width+"px"),R.bottom>window.innerHeight&&(d.value.top=window.innerHeight-R.height+"px")}}function B(D=!0){w();const R=_.value;if(R){const{left:k,top:A}=R.getBoundingClientRect();D&&(e("update:left",k),e("update:top",A))}}return p.watch(()=>t.isOpen,D=>{c.value=D}),p.watch(()=>t.zGroup,D=>{a.group=D}),p.watch(()=>t.width,D=>{v({width:D}),f(!1)}),p.watch(()=>t.height,D=>{v({height:D}),f(!1)}),p.onMounted(()=>{u()}),p.onBeforeUnmount(()=>{Ir.delete(this),a.unregister(),s&&s.teardown(),i&&i.teardown(),bn.splice(bn.indexOf(r),1)}),{isOpen:c,windowEl:_,titlebar:x,content:T,activate:z,styleWindow:d,styleTitlebar:h,styleContent:b,closeButtonClick:function(){c.value=!1,e("closebuttonclick")},fixPosition:w}}});const Va={class:"title"};var Oi;_n.render=function(t,e,n,r,o,i){const s=p.resolveComponent("myButton");return p.openBlock(),p.createBlock(p.Transition,{name:"fade",onAfterLeave:e[2]||(e[2]=a=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=a=>t.$emit("open")),persisted:""},{default:p.withCtx(()=>[p.withDirectives(p.createElementVNode("div",{class:"window",style:p.normalizeStyle(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...a)=>t.activate&&t.activate(...a)),onTouchstart:e[1]||(e[1]=(...a)=>t.activate&&t.activate(...a))},[p.createElementVNode("div",{class:"titlebar",style:p.normalizeStyle(t.styleTitlebar),ref:"titlebar"},[p.createElementVNode("div",Va,[t.$slots.title?p.renderSlot(t.$slots,"title",{key:0}):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(t.title),1)],64))]),t.closeButton?(p.openBlock(),p.createBlock(s,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:p.withCtx(()=>e[4]||(e[4]=[p.createTextVNode("\xD7")])),_:1},8,["windowStyle","onClick"])):p.createCommentVNode("v-if",!0)],4),p.createElementVNode("div",{class:"content",style:p.normalizeStyle(t.styleContent),ref:"content"},[p.renderSlot(t.$slots,"default")],4)],36),[[p.vShow,t.isOpen]])]),_:3})},_n.__file="src/controls/vuewindow/window/index.vue",function(t){t[t.StyleBlack=0]="StyleBlack",t[t.StyleWhite=1]="StyleWhite",t[t.StyleMetal=2]="StyleMetal",t[t.StyleGrayblue=3]="StyleGrayblue"}(Oi||(Oi={}));const Xa=_n;exports.LayoutContainerEnum=void 0,function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.centerBack=2]="centerBack",t[t.centerMain=3]="centerMain",t[t.centerFront=4]="centerFront",t[t.left=5]="left",t[t.right=6]="right"}(exports.LayoutContainerEnum||(exports.LayoutContainerEnum={}));class Fi{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(e,n,r,o){this.layoutState=e,this._LayoutID=r,this._mapItemRefs=o,n.forEach(i=>{if(i.layoutID===r&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const s=new Set;s.add(i),this.preConditionMap.set(i.afterid,s)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e)})}async loadWidget(e){if(!e)return;let n;if(Fe(e)?n=e:rt(e)&&(n=this.widgetConfig.find(r=>r.id===e)),n){if(n.afterid){if(this.isWidgetLoaded(n.afterid))return this._loadWidget(n);{let r=function(a){a.layoutID===o._LayoutID&&a.widgetID===i&&(o._loadWidget(s),O.EventBus.off(fe.WidgetLoadedEvent,r))};const o=this,i=n.afterid,s=n;return O.EventBus.on(fe.WidgetLoadedEvent,r),this.loadWidget(n.afterid)}}return this._loadWidget(n)}}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e){if(!this.widgetsLoadedSet.has(e.id))return e.component?e.component().then(n=>{if(n.default){const r=p.markRaw(n.default);r.id=e.id,e.layout&&(r.style=e.layout),e.cssClass&&(r.cssClass=e.cssClass),e.layoutID&&(r.layoutID=e.layoutID),e.label&&(r.label=e.label),e.jsURL&&(r.jsURL=e.jsURL),e.cssURL&&(r.cssURL=e.cssURL),this.getContainerComponents(e.container).value.set(e.id,r),this.widgetsLoadedSet.add(e.id),p.nextTick().then(()=>{O.EventBus.emit(fe.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}}).catch(n=>{O.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",e,n),O.EventBus.emit(fe.WidgetLoadedErrorEvent,e)}):void 0;this.changeWidgetVisible(e.id,!0)}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const r=this.preConditionMap.get(e);if(r){for(const o of r)if(this.isWidgetLoaded(o.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(r=>r.id===e);if(n){if(this.preConditionMap.has(e)){const r=this.preConditionMap.get(e);if(r)for(const o of r)this.unloadWidget(o.id)}this.getContainerComponents(n.container).value.delete(e),this.widgetsLoadedSet.delete(e),this._mapItemRefs&&this._mapItemRefs.delete(e),O.EventBus.emit(fe.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,r=this.layoutState.centerBackContainer;e?(n&&(n.style.left="0",n.style.width="100%"),r&&(r.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),r&&(r.style.width="50%"))}getLayoutContainer(e){switch(e){case exports.LayoutContainerEnum.top:return this.layoutState.topContainer;case exports.LayoutContainerEnum.bottom:return this.layoutState.bottomContainer;case exports.LayoutContainerEnum.left:return this.layoutState.leftContainer;case exports.LayoutContainerEnum.right:return this.layoutState.rightContainer;case exports.LayoutContainerEnum.centerBack:return this.layoutState.centerBackContainer;case exports.LayoutContainerEnum.centerMain:return this.layoutState.centerMainContainer;case exports.LayoutContainerEnum.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const r=this.getLayoutContainer(e);r&&(r.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const r=this.getWidgetComponent(e);r&&r.changeVisible&&r.changeVisible(n)}isWidgetVisible(e){const n=this.getWidgetComponent(e);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)&&this._mapItemRefs)return this._mapItemRefs.get(e)}getWigetItem(e){return this.widgetConfig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetConfig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=p.ref(new Map);return this.layoutMap.set(e,n),n}}getWidgetLoadedIDList(){const e=[];return this.widgetsLoadedSet.forEach(n=>{e.push(n)}),e}unloadAllWidgets(e){const n=[];this.widgetsLoadedSet.forEach(r=>{e&&e.length>0?e.findIndex(o=>o===r)<0&&n.push(r):n.push(r)}),n.forEach(r=>this.unloadWidget(r))}unloadWidgets(e){e&&e.length>0&&e.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(e,n){if(n){const r=n.find(o=>o.id===e);if(r&&r.layoutID)return O.LayoutMap.get(r.layoutID)}}}var Tt=p.defineComponent({name:"SuspenseWithError",setup(){const t=p.ref(null);return p.onErrorCaptured(e=>(t.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",e),!0)),{error:t}}});Tt.render=function(t,e,n,r,o,i){return t.error?p.renderSlot(t.$slots,"error",{key:0},()=>[p.createTextVNode(p.toDisplayString(t.error),1)]):(p.openBlock(),p.createBlock(p.Suspense,{key:1},{default:p.withCtx(()=>[p.renderSlot(t.$slots,"default")]),fallback:p.withCtx(()=>[p.renderSlot(t.$slots,"fallback")]),_:3}))},Tt.__file="src/controls/routertransition/SuspenseWithError.vue";var Tr=p.defineComponent({name:"RouterTransition",__name:"RouterTransition",setup:t=>(e,n)=>{const r=p.resolveComponent("router-view");return p.openBlock(),p.createBlock(Tt,null,{default:p.withCtx(()=>[p.createVNode(r,null,{default:p.withCtx(({Component:o,route:i})=>[p.createCommentVNode(" <transition> "),(p.openBlock(),p.createBlock(p.KeepAlive,null,[i.meta.keepAlive?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(o),{key:i.name})):p.createCommentVNode("v-if",!0)],1024)),i.meta.keepAlive?p.createCommentVNode("v-if",!0):(p.openBlock(),p.createBlock(p.resolveDynamicComponent(o),{key:i.name})),p.createCommentVNode(" </transition> ")]),_:1})]),_:1})}});Tr.__file="src/controls/routertransition/RouterTransition.vue";var Sn=p.defineComponent({name:"LayoutContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],components:{RouterTransition:Tr},setup(t,{attrs:e,slots:n,emit:r}){const o=t.layoutID,i=p.ref(t.enableRouterView);p.watch(()=>t.enableRouterView,()=>{i.value=t.enableRouterView});const s=p.reactive({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),a=new Map,c=new Fi(s,t.widgetConfig,o,a),u=d(exports.LayoutContainerEnum.top),g=d(exports.LayoutContainerEnum.centerBack),_=d(exports.LayoutContainerEnum.centerFront),x=d(exports.LayoutContainerEnum.left),T=d(exports.LayoutContainerEnum.right),z=d(exports.LayoutContainerEnum.bottom);function d(b){return c?.getContainerComponents(b)}const h=p.computed(()=>t.layoutStyle);return p.onMounted(()=>{c&&(o?O.LayoutMap.set(o,c):(O.LayoutManager=c,O.LayoutMap.set("",c)),c.preloadWidgets(),r("containerLoaded",{layoutID:o,layoutManager:c}),O.EventBus.emit(fe.LayoutContainerLoaded,{layoutID:o,layoutManager:c}))}),{...p.toRefs(s),topContainerComponents:u,centerbackComponents:g,centerfrontComponents:_,leftContainerComponents:x,rightContainerComponents:T,bottomContainerComponents:z,containerStyle:h,isEnableRouterView:i,setItemRef:(b,v)=>{b&&a.set(v,b)}}}});const Ga={ref:"topContainer",class:"topContainer"},Ka={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},Ja={ref:"centerBackContainer",class:"centerdiv backContainer"},Ya={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},Za={ref:"leftContainer",class:"leftContainer"},Qa={ref:"rightContainer",class:"rightContainer"},ec={ref:"bottomContainer",class:"bottomContainer"};Sn.render=function(t,e,n,r,o,i){const s=p.resolveComponent("router-transition");return p.openBlock(),p.createElementBlock("div",{class:"layoutContainer",style:p.normalizeStyle(t.containerStyle)},[p.createElementVNode("div",Ga,[p.renderSlot(t.$slots,"top"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.topContainerComponents,([a,c])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:p.normalizeStyle(c.style),class:p.normalizeClass(c.cssClass)},null,8,["style","class"]))),128))],512),p.createElementVNode("div",null,[p.createCommentVNode(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),t.isEnableRouterView?(p.openBlock(),p.createElementBlock("div",Ka,[p.renderSlot(t.$slots,"main",{},()=>[p.createVNode(s)])],512)):p.createCommentVNode("v-if",!0),p.createCommentVNode(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),p.createElementVNode("div",Ja,[p.renderSlot(t.$slots,"back"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.centerbackComponents,([a,c])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:p.normalizeStyle(c.style),class:p.normalizeClass(c.cssClass)},null,8,["style","class"]))),128))],512),p.createCommentVNode(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),p.createElementVNode("div",Ya,[p.renderSlot(t.$slots,"front"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.centerfrontComponents,([a,c])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:p.normalizeStyle(c.style),class:p.normalizeClass(c.cssClass)},null,8,["style","class"]))),128))],512),p.createElementVNode("div",Za,[p.renderSlot(t.$slots,"left"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.leftContainerComponents,([a,c])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:p.normalizeStyle(c.style),class:p.normalizeClass(c.cssClass)},null,8,["style","class"]))),128))],512),p.createElementVNode("div",Qa,[p.renderSlot(t.$slots,"right"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.rightContainerComponents,([a,c])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:p.normalizeStyle(c.style),class:p.normalizeClass(c.cssClass)},null,8,["style","class"]))),128))],512)]),p.createElementVNode("div",ec,[p.renderSlot(t.$slots,"bottom"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.bottomContainerComponents,([a,c])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:p.normalizeStyle(c.style),class:p.normalizeClass(c.cssClass)},null,8,["style","class"]))),128))],512),p.createCommentVNode(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),p.renderSlot(t.$slots,"default")],4)},Sn.__scopeId="data-v-4d081e5c",Sn.__file="src/controls/layoutcontainer/layout.vue";var Hi=p.defineComponent({name:"RouterTransition",__name:"RouterTransitionAnimate",props:{enterActive:{type:String,required:!1,default:"animated fadeIn"},leaveActive:{type:String,required:!1,default:"animated fadeOut"}},setup:t=>(e,n)=>{const r=p.resolveComponent("router-view");return p.openBlock(),p.createBlock(Tt,null,{default:p.withCtx(()=>[p.createVNode(r,null,{default:p.withCtx(({Component:o,route:i})=>[p.createVNode(p.TransitionGroup,{appear:"","enter-active-class":e.enterActive,"leave-active-class":e.leaveActive},{default:p.withCtx(()=>[(p.openBlock(),p.createBlock(p.KeepAlive,null,[i.meta.keepAlive?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(o),{key:i.name})):p.createCommentVNode("v-if",!0)],1024)),i.meta.keepAlive?p.createCommentVNode("v-if",!0):(p.openBlock(),p.createBlock(p.resolveDynamicComponent(o),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});Hi.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const ft=new Map,Rt=p.ref(new Map);class Pt{static addWindowPanel(e){ft.set(e.id,e)}static removeWindowPanel(e){ft.has(e)&&(ft.delete(e),Rt.value.delete(e))}static minimizeWindowPanel(e){ft.has(e)&&Rt.value.set(e,-1)}static openWindowPanel(e){ft.has(e)&&Rt.value.set(e,1)}}const tc=["src"],nc={key:1,class:"paneltitle"},rc={class:"dragPanelBar"},oc={class:"dragPanelContent"},ic={class:"drag-pointer-group"};var Rr=p.defineComponent({__name:"XWindow",props:{top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},nWidth:{type:[String,Number],default:"300px"},nHeight:{type:[String,Number],default:"400px"},icon:{type:String,default:"img/logo.png"},title:{type:String,default:""},titleHeight:{type:[String,Number],default:"40px"},hasMin:{type:Boolean,default:!0},hasMax:{type:Boolean,default:!1},hasClose:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},pid:{type:String,default:""},tag:{type:[String,Array,Object,Number],default:""}},emits:["close","open","loaded","minimize"],setup(t,{expose:e,emit:n}){const r=Eo(),o=t,i=n,s=p.ref(),a=p.ref(),c=p.computed(()=>o.isDark),u=p.ref({x:0,y:0}),g=250,_=100,x=p.ref({width:0,height:0}),T=M=>{s.value&&(s.value.style.left=`${M.x}px`,s.value.style.top=`${M.y}px`)};p.watch(()=>u.value,M=>{T(M)});const z=M=>{s.value&&(s.value.style.width=`${M.width}px`,s.value.style.height=`${M.height}px`)};p.watch(()=>x.value,M=>{z(M)});const d={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(d.refs).forEach(([M,j])=>{j.value&&j.value.addEventListener("mousedown",H=>{d.mouseDown(H,M)})})},mouseDown:(M,j)=>{M.button==0&&(M.preventDefault(),d.startingEdges={left:u.value.x,top:u.value.y,right:u.value.x+x.value.width,bottom:u.value.y+x.value.height},d.newEdges={...d.startingEdges},d.clickStart={x:M.clientX,y:M.clientY},d.eventListenerController=new AbortController,document.addEventListener("mousemove",H=>{d.mouseMove(H,j)},{signal:d.eventListenerController.signal}),document.addEventListener("mouseup",H=>{d.mouseUp(H,j)},{signal:d.eventListenerController.signal}))},mouseMove:(M,j)=>{if(d.startingEdges!=null&&d.newEdges!=null&&d.clickStart!=null&&d.refs[j].value){if(M.preventDefault(),console.log("mouseMove",j),j.toLowerCase().includes("north")){d.newEdges.top=Math.max(d.startingEdges.top+M.clientY-d.clickStart.y,0);const H=d.newEdges.bottom-d.newEdges.top-_;H<0&&(d.newEdges.top+=H)}else j.toLowerCase().includes("south")&&(d.newEdges.bottom=Math.min(d.startingEdges.bottom+M.clientY-d.clickStart.y,document.body.clientHeight));if(j.toLowerCase().includes("west")){d.newEdges.left=Math.max(d.startingEdges.left+M.clientX-d.clickStart.x,0);const H=d.newEdges.right-d.newEdges.left-g;H<0&&(d.newEdges.left+=H)}else j.toLowerCase().includes("east")&&(d.newEdges.right=Math.min(d.startingEdges.right+M.clientX-d.clickStart.x,document.body.clientWidth));d.update()}},update:()=>{d.newEdges==null||d.startingEdges==null||(u.value={x:Math.max(d.newEdges.left,0),y:Math.max(d.newEdges.top,0)},x.value={width:Math.min(Math.max(d.newEdges.right-d.newEdges.left,g),document.body.clientWidth),height:Math.min(Math.max(d.newEdges.bottom-d.newEdges.top,_),document.body.clientHeight)})},mouseUp:(M,j)=>{M.button!=0||d.startingEdges==null||(console.log("mouseUp",j),M.preventDefault(),d.startingEdges=null,d.newEdges=null,d.clickStart=null,d.eventListenerController&&(d.eventListenerController.abort(),d.eventListenerController=null))},refs:{northWest:p.ref(null),north:p.ref(null),northEast:p.ref(null),west:p.ref(null),east:p.ref(null),southWest:p.ref(null),south:p.ref(null),southEast:p.ref(null)}},h={startingMouse:null,startingPosition:null,mouseDown:M=>{M.button==0&&(M.preventDefault(),console.log("mouseDown"),h.startingMouse={x:M.clientX,y:M.clientY},h.startingPosition=u.value,document.addEventListener("mousemove",h.mouseMove),document.addEventListener("mouseup",h.mouseUp))},mouseMove:M=>{!h.startingMouse||!h.startingPosition||(M.preventDefault(),u.value={x:Math.min(Math.max(h.startingPosition.x+M.clientX-h.startingMouse.x,0),document.body.clientWidth-x.value.width),y:Math.min(Math.max(h.startingPosition.y+M.clientY-h.startingMouse.y,0),document.body.clientHeight-x.value.height)})},mouseUp:M=>{M.button!=0||!h.startingMouse||!h.startingPosition||(M.preventDefault(),h.startingMouse=null,h.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",h.mouseMove),document.removeEventListener("mouseup",h.mouseUp))}};function b(M){return{id:r,icon:o.icon,title:o.title,pid:o.pid,data:M??o.tag}}const v=p.computed(()=>Rt.value.get(r)!==-1),f=p.ref(!1),w=p.ref(!0);function B(){i("minimize",b()),Pt.minimizeWindowPanel(r)}function D(){f.value=!f.value}function R(){i("close",b(!1)),Pt.removeWindowPanel(r),w.value=!1}const k=p.computed(()=>f.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),A={id:r,isShow:v,close:R,open:function(){i("open",b(!0)),w.value=!0},showHidePanel:B};function W(M){if(Fn(M))return M;{const j=Number(M);if(j==j)return j;if(M.endsWith("px")){const H=M.substring(0,M.length-2);return Number(H)}if(M.endsWith("%")){const H=M.substring(0,M.length-1);return Number(H)/100*document.body.clientWidth}return 300}}return e(A),p.onMounted(()=>{(function(){let M=90;if(o.hasMin||(M-=30),o.hasMax||(M-=30),o.hasClose||(M-=30),se.setCssVar("--right-bar-width",M+"px",a.value),!a.value)return;const j=Fn(o.titleHeight)?o.titleHeight+"px":o.titleHeight;a.value.style.height=j,a.value.style.lineHeight=j})(),function(){const M=b(A);Pt.addWindowPanel(M),i("loaded",M)}(),u.value.x=W(o.left),u.value.y=W(o.top),T(u.value),x.value={width:W(o.nWidth),height:W(o.nHeight)},z(x.value),d.mount()}),p.onUnmounted(()=>{Pt.removeWindowPanel(r)}),(M,j)=>(p.openBlock(),p.createBlock(p.Transition,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:p.withCtx(()=>[w.value?p.withDirectives((p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"dragPanelRef",ref:s,class:p.normalizeClass(["dragWindowPanel",{maxPanel:f.value,dragWindowPanel_dark:c.value}])},[p.createElementVNode("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:a,onMousedown:j[0]||(j[0]=(...H)=>h.mouseDown&&h.mouseDown(...H))},[p.renderSlot(M.$slots,"title",{},()=>[o.icon?(p.openBlock(),p.createElementBlock("img",{key:0,src:o.icon,width:"24",height:"24"},null,8,tc)):p.createCommentVNode("v-if",!0),o.title?(p.openBlock(),p.createElementBlock("span",nc,p.toDisplayString(o.title),1)):p.createCommentVNode("v-if",!0)]),p.createElementVNode("div",rc,[t.hasMin?(p.openBlock(),p.createBlock(p.unref(Ln.Icon),{key:0,icon:"ant-design:minus-outlined",onClick:B})):p.createCommentVNode("v-if",!0),t.hasMax?(p.openBlock(),p.createBlock(p.unref(Ln.Icon),{key:1,icon:k.value,onClick:D},null,8,["icon"])):p.createCommentVNode("v-if",!0),t.hasClose?(p.openBlock(),p.createBlock(p.unref(Ln.Icon),{key:2,icon:"ant-design:close-outlined",onClick:R})):p.createCommentVNode("v-if",!0)])],544),p.createElementVNode("div",oc,[p.renderSlot(M.$slots,"default")]),p.createElementVNode("div",ic,[p.createElementVNode("div",{class:"cursor-nw-resize",ref:d.refs.northWest},null,512),p.createElementVNode("div",{class:"cursor-n-resize",ref:d.refs.north},null,512),p.createElementVNode("div",{class:"cursor-ne-resize",ref:d.refs.northEast},null,512),p.createElementVNode("div",{class:"cursor-w-resize",ref:d.refs.west},null,512),j[1]||(j[1]=p.createElementVNode("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),p.createElementVNode("div",{class:"cursor-e-resize",ref:d.refs.east},null,512),p.createElementVNode("div",{class:"cursor-sw-resize",ref:d.refs.southWest},null,512),p.createElementVNode("div",{class:"cursor-s-resize",ref:d.refs.south},null,512),p.createElementVNode("div",{class:"cursor-se-resize",ref:d.refs.southEast},null,512)])],2)),[[p.vShow,v.value]]):p.createCommentVNode("v-if",!0)]),_:3}))}});Rr.__scopeId="data-v-39ea9741",Rr.__file="src/controls/xwindow/XWindow.vue";class Hr{debug=!1;simple=!1;utc=!1;longType="number";dictType="object";nullType=void 0;static Instance=new Hr;textEncoder=new TextEncoder;textDecoder=new TextDecoder;constructor(){}encodeResponse(e,n={}){var r=new ve.ByteStream,o=new ve.Writer(r,this.simple,this.utc),i=n;this.simple;var s=0;for(var a in i)s++;s>0&&(r.writeByte(72),o.serialize(i),o.reset()),e instanceof Error?(r.writeByte(69),o.serialize(this.debug&&e.stack?e.stack:e.message)):(r.writeByte(82),o.serialize(e)),r.writeByte(122);const c=r.takeBytes();return this.textDecoder.decode(c)}decodeRequest(e,n={}){const r=this.textEncoder.encode(e);if(r.length===0)return["~",[]];var o=new ve.ByteStream(r),i=new ve.Reader(o,!1);i.longType=this.longType,i.dictType=this.dictType;var s=o.readByte();if(console.log("tag",s),s===72){var a=i.deserialize(this.nullType);for(var c in a)n[c]=a[c];i.reset(),s=o.readByte()}switch(s){case 67:return[i.deserialize(String),this.decodeArguments(i)];case 122:return["~",[]];default:throw new Error(`Invalid request:\r
|
|
9
|
+
`+o.toString())}}decodeArguments(e){var n=e.stream;let r=[];if(n.readByte()===97){e.reset();var o=ve.ValueReader.readCount(n);const s=new Array(o).fill(this.nullType);r=new Array(o),e.addReference(r);for(var i=0;i<o;++i)r[i]=e.deserialize(s[i]);n.readByte()}return r}encodeRequest(e,n,r={}){var o=new ve.ByteStream,i=new ve.Writer(o,this.simple,this.utc),s=r;this.simple&&(s.simple=!0);var a=0;for(var c in s)a++;a>0&&(o.writeByte(72),i.serialize(s),i.reset()),o.writeByte(67),i.serialize(e),n.length>0&&(i.reset(),i.serialize(n)),o.writeByte(122);const u=o.takeBytes();return this.textDecoder.decode(u)}decodeResponse(e,n={}){const r=this.textEncoder.encode(e);var o=new ve.ByteStream(r),i=new ve.Reader(o,!1);i.longType=this.longType,i.dictType=this.dictType;var s=o.readByte();if(s===72){var a=i.deserialize();for(var c in a)n[c]=a[c];i.reset(),s=o.readByte()}switch(s){case 82:return n.simple&&(i.simple=!0),console.log(s,"9999999999"),i.deserialize();case 69:throw new Error(i.deserialize(String));case 122:return;default:throw new Error(`Invalid response:\r
|
|
10
|
+
`+o.toString())}}}const Cn=new Map,Pr=new Map;let En;const sc={getDefaultClient(){if(En||(En=new Ct(SysConfig.DefaultHproseAPI)),!En)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return En},registerHprose(t,e){const n=Pr.get(t);if(!n){const r=new Ct(e);Cn.set(t,r)}return n},getHprose:t=>Pr?.get(t),getProxyHprose:t=>Cn.get(t),unregisterHprose(t){Cn.get(t)&&(Pr.delete(t),Cn.delete(t))}},zr=5e3,qi=36e5,Qe={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},Mr="access_token",ac=O.Config.ServiceURL.LoginAuthURL;function Ar(){const t=ci();t&&Ie(Qe.RefreshToken,ac,{refreshToken:t}).then(e=>{Br(e.data)})}function Vi(){const t=ht.getJsonObject(Mr);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=zr?Ar():setTimeout(Ar,n-zr))}function Br(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;if(n>=qi?(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let r=Xe();r?(r.token=t.accessToken.tokenContent,r.expire=t.accessToken.expires,r.refresh=t.refreshToken.tokenContent):r={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},ht.set(Mr,r,n/1e3),Vi()}else ht.remove(Mr)}const kn="Wm314243",xn=O.Config.ServiceURL.LoginAuthURL,Dr="ROLE_SYSTEM_RIGHT",Lr=new qt("",sessionStorage);function Xi(){return Lr.get(Dr)}function Nr(t){Lr.set(Dr,t)}function Gi(){Lr.remove(Dr)}function pt(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(pt(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function Ki(t,e,n="name"){t&&e&&t.forEach(r=>{const o=e.find(i=>i[n]===r[n]);o&&(r.children?o.children&&Ki(r.children,o.children,n):(!o.children||o.children.length===0)&&o.selected&&(r.selected=o.selected))})}function zt(t,e,n,r="name"){const o=t[n],i=e[n];o?i&&Ki(o,i,r):i&&(t[n]=i)}function Ji(t){if(t&&t.length>0){const e=t.length;let n,r=!1;if(e>0){r=Fe(t[0]);const o=r?t[0]:JSON.parse(t[0]);if(e>1)for(let i=1;i<t.length;i++){const s=t[i],a=r?s:JSON.parse(s);zt(o,a,"routes","name"),zt(o,a,"widgetMenu","name"),zt(o,a,"widgets","id"),zt(o,a,"functions","id")}n=o}return n&&(pt(n.routes),pt(n.widgetMenu),pt(n.widgets),pt(n.functions)),n}}const $r=[],Wr=[],Ur=[];function Mt(){return Xi()}function Yi(t,e){const n={...t};return n.meta||(n.meta={}),e.index!=null&&(n.meta.index=e.index),e.title!=null&&(n.meta.title=e.title),t.children&&(n.children=[],e.children&&e.children.forEach(r=>{const o=t.children?.find(i=>i.path===r.path);if(o){const i=Yi(o,r);i&&n.children?.push(i)}})),n}function Zi(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(r=>{const o=t.children?.find(i=>i.name===r.name);if(o){const i=Zi(o,r);i&&n.children?.push(i)}})),n}exports.BigFileDownload=class{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(t,e,n=3,r=6,o=6e4){this.fileID=t,this.downloadURL=e,this.chunkByteSize=n*this.ChunkUnitM,this.eventTarget=sr(),this.initIndexDB(),r>=3&&(this.cacheSize=r),o>this.requestTimeout&&(this.requestTimeout=o)}on(t,e){this.eventTarget.on(t,e)}dispatch(t,e){this.eventTarget.emit(t,e)}dispatchError(t){this.eventTarget.emit("error",t)}dispatchInfo(t){this.eventTarget.emit("info",t)}async queryDownloadFileMeta(t,e="",n){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await Ie(e,t,n);let o=null;return r&&r.status===200&&(o=r.data),o}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=hn.createInstance({name:this.fileID,driver:hn.INDEXEDDB})}async init(t){if(this.finishNum=0,t){const e="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(e,this.fileMetaData)}if(this.fileMetaData!=null){const e=this.fileMetaData.chunkSize;e!=null&&e>0&&(this.chunkByteSize=e)}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(),hn.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(e=>setTimeout(e,t))}async download(t,e){let n=t;if(!n&&this.downloadURL&&(n=this.downloadURL),!n)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=O.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const o={key:this.fileMetaData?.downloadID};let i=0;const s=this.cacheSize;let a=0;for(let c=0;c<this.totalChunks;c++){if(this.keys&&this.keys?.indexOf(c.toString())>=0){i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());continue}const u=c*this.chunkByteSize;let g=u+this.chunkByteSize-1;this.fileMetaData&&g>this.fileMetaData.length&&(g=this.fileMetaData.length-1);const _={range:`bytes=${u}-${g}`};for(;a>=s;)await this.sleep(200);const x=c.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${c+1}/${this.totalChunks}`),a++,Ie(n,e,o,_,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async T=>{const z=T.data;a--,await this.currentDB?.setItem(x,z),i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());const d=parseInt(x)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${d}/${this.totalChunks}`),this.savefile()}).catch(T=>{a--;const z=parseInt(x)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${z}\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 e=100*t/this.totalChunks;this.dispatch("saveProgress",e)}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=ga.createWriteStream(this.fileName).getWriter();let e=0;for(let n=0;n<this.totalChunks;n++){const r=n.toString();let o=await this.currentDB?.getItem(r);if(o||(o=await this.currentDB?.getItem(r)),!o)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let i=new Response(o).body;if(i===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const s=i.getReader();for(;;){const{done:a,value:c}=await s.read();if(a)break;await t.write(c)}e++,this.outputProgress(e),this.dispatchInfo(`\u5B8C\u6210\u7B2C${n+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),hn.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}},exports.Download=St,exports.FileUpload=yi,exports.GetSignalRClient=function(t){if(!t){if(yn)return yn;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new Fa().configureLogging(P.Information).withUrl(t).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return e.keepAliveIntervalInMilliseconds=15e3,e.serverTimeoutInMilliseconds=18e5,e.start().then(()=>{O.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),e.onclose(async()=>{O.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),e.onreconnecting(()=>{O.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),e.onreconnected(()=>{O.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),yn||(yn=e),e},exports.Global=O,exports.GlobalHprose=sc,exports.GlobalMitt=Ve,exports.GzipTool=class{static runningInBrowser(){return typeof window<"u"&&typeof window.document<"u"}static isGzipped(t){return t.length>2&&t.buffer instanceof ArrayBuffer&&t[0]==31&&t[1]==139}static gzipSync(t,e){if(typeof t=="string"&&(t=qe(t)),this.runningInBrowser())return er(t,e)}static async gzipAsync(t,e){let n;return typeof t=="string"&&(n=qe(t)),this.runningInBrowser()?se.promisify(ea)(n,e):void 0}static async readGzipFromFile(t){const e={content:await se.readFilePromise(t,"ArrayBuffer"),name:t.name};return this.readGzipFile(e)}static readGzipFile(t){var e=t.name.replace(/\.gz$/,"");return[{name:e,content:this.gunzipSync(t.content,e)}]}static async gunzipAsync(t,e){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),e=e||{},!this.runningInBrowser())return;var n=se.promisify(ta);let r=await n(t,e);return e.filename&&(r=or(r)),r}static gunzipSync(t,e){t instanceof ArrayBuffer&&(t=new Uint8Array(t));let n=tr(t);return e&&(n=or(n)),n}},exports.H5Tool=se,exports.HproseClient=At,exports.HproseRPCCodec=Hr,exports.HttpDownload=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(r){St(r.data,n)}).catch(r=>{console.warn(r),Ve.emit(fe.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})},exports.JsonDownload=Qo,exports.LayoutContainer=Sn,exports.LayoutManager=Fi,exports.LockState=Ge,exports.MinWindowMap=Rt,exports.ObjToUrlParams=function(t,e){let n="",r="";for(const o in e)n+=o+"="+encodeURIComponent(e[o])+"&";return n=n.replace(/&$/,""),r=/\?$/.test(t)?t+n:t.replace(/\/?$/,"?")+n,r},exports.Pane=Nn,exports.ProxyClient=Ct,exports.RouterTransition=Tr,exports.RouterTransitionAnimate=Hi,exports.SaveAs=ar,exports.SaveToSelectedFile=async function(t,e,n){var r,o=function(s){var a=sn(s).toLowerCase(),c={};return a=="kml"?c["application/vnd.google-earth.kml+xml"]=[".kml"]:a==="svg"?c["image/svg+xml"]=[".svg"]:a==="zip"?c["application/zip"]=[".zip"]:a==="txt"||a==="csv"||a==="tsv"||a==="tab"?c["text/csv"]=[".csv",".tsv",".tab",".txt"]:a==="json"||a==="geojson"||a==="topojson"?c["application/json"]=[".json",".geojson",".topojson"]:c["application/octet-stream"]=["."+a],{suggestedName:s,types:[{description:"Files",accept:c}]}}(t);try{r=await window.showSaveFilePicker(o);var i=await r.createWritable();await i.write(e),await i.close()}catch(s){return void(s.name=="SecurityError"?(console.warn(s.message),n(s.message)):s.name=="AbortError"?n():(console.error(s.name,s.message,s),n("Save failed for an unknown reason")))}n()},exports.Splitpanes=Os,exports.Storage=qt,exports.StringUtils=mt,exports.StyleBlack={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)"}},exports.StyleGrayblue={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)"}},exports.StyleMetal={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)"}},exports.StyleWhite={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)"}},exports.SuspenseWithError=Tt,exports.SysEvents=fe,exports.TOKEN_REFRESH_TIME=zr,exports.TOKEN_VALID_TIMESPAN=qi,exports.USER_TOKEN_API=Qe,exports.VWindow=_n,exports.WaterMark=ya,exports.WindowResizeEvent=ji,exports.WindowType=Xa,exports.WindowsMap=ft,exports.XWindow=Rr,exports.XWindowManager=Pt,exports.XXTEA=kt,exports.ZipTool=class{static runningInBrowser(){return typeof window<"u"&&typeof window.document<"u"}static saveZipFile(t,e){this.zipAsync(e,function(n,r){if(n)throw n;ar(new Blob([r]),t)})}static unzipSync(t){let e;if(e=t instanceof ArrayBuffer?new Uint8Array(t):t,!this.runningInBrowser())return;const n=function(r,o){for(var i={},s=r.length-22;de(r,s)!=101010256;--s)(!s||r.length-s>65558)&&te(13);var a=Re(r,s+8);if(!a)return{};var c=de(r,s+16),u=c==4294967295||a==65535;if(u){var g=de(r,s-12);(u=de(r,g)==101075792)&&(a=de(r,g+32),c=de(r,g+48))}for(var _=o&&o.filter,x=0;x<a;++x){var T=Go(r,c,u),z=T[0],d=T[1],h=T[2],b=T[3],v=T[4],f=T[5],w=Xo(r,f);c=v,_&&!_({name:b,size:d,originalSize:h,compression:z})||(z?z==8?i[b]=nn(r.subarray(w,w+d),{out:new ee(h)}):te(14,"unknown compression type "+z):i[b]=Ue(r,w,w+d))}return i}(e,{filter:this.fflateFilter});return this.fflatePostprocess(n)}static async readZipFromFile(t){const e={content:await se.readFilePromise(t,"ArrayBuffer"),name:t.name};return this.readZipFile(e)}static async readZipFile(t){const e=await this.unzipAsync.promise(t.content);return Object.keys(e).reduce(function(n,r){return n.push({name:r,content:e[r]}),n},[])}static unzipAsync(t,e){if(!this.runningInBrowser())throw new Error("Async unzipping only supported in the browser");let n;n=t instanceof ArrayBuffer?new Uint8Array(t):t,oa(n,{filter:this.fflateFilter},function(r,o){r&&e(r),e(null,this.fflatePostprocess(o))})}static zipSync(t){if(!this.runningInBrowser())throw new Error("Async zipping only supported in the browser");return function(e,n){n||(n={});var r={},o=[];nr(e,"",r,n);var i=0,s=0;for(var a in r){var c=r[a],u=c[0],g=c[1],_=g.level==0?0:8,x=(k=qe(a)).length,T=g.comment,z=T&&qe(T),d=z&&z.length,h=_t(g.extra);x>65535&&te(11);var b=_?tn(u,g):u,v=b.length,f=Yt();f.p(u),o.push(Zt(g,{size:u.length,crc:f.d(),c:b,f:k,m:z,u:x!=a.length||z&&T.length!=d,o:i,compression:_})),i+=30+x+h+v,s+=76+2*(x+h)+(d||0)+v}for(var w=new ee(s+22),B=i,D=s-i,R=0;R<o.length;++R){var k=o[R];rn(w,k.o,k,k.f,k.u,k.c.length);var A=30+k.f.length+_t(k.extra);w.set(k.c,k.o+A),rn(w,i,k,k.f,k.u,k.c.length,k.o,k.m),i+=16+A+(k.m?k.m.length:0)}return Ko(w,i,o.length,D,B),w}(this.fflatePreprocess(t))}static zipAsync(t,e){ra(this.fflatePreprocess(t),{},e)}static fflateFilter(t){return this.isImportableZipPath(t.name)}static fflatePostprocess(t){return Object.keys(t).reduce(function(e,n){const r=ut(n).filename;let o=t[n];return e[r]=o,e},{})}static isImportableZipPath(t){const e=ut(t),n=sn(t).toLowerCase();return n!="gz"&&n!="zip"&&!/^__MACOSX/.test(t)&&e.filename[0]!="."}static fflatePreprocess(t){const e={};return t.forEach(function(n){typeof n.content=="string"?n.content=qe(n.content):n.content instanceof ArrayBuffer&&(n.content=new Uint8Array(n.content)),e[n.filename]=n.content}),e}},exports.calculateBestTextColor=function(t){return function(e,n){return(ei(~~e[0],~~e[1],~~e[2])+.05)/(ei(n[0],n[1],n[2])+.05)}(lr(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"},exports.changeMyPWD=function(t){const e={oldpwd:kt.encryptToString(t.oldpwd,kn),newpwd:kt.encryptToString(t.newpwd,kn)};return Ie(Qe.ChangeMyPwd,xn,e)},exports.checkDoRefreshToken=Vi,exports.checkToken=function(t){return Ie(Qe.CheckToken,xn,{token:t})},exports.clearLocalToken=gr,exports.clearRight=Gi,exports.colorIsDark=function(t){if(!an(t))return;const[e,n,r]=lr(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(o=>Number(o));return .299*e+.578*n+.114*r<192},exports.createFileUpload=t=>new yi(t),exports.darken=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${hr(t.substring(0,2),e)}${hr(t.substring(2,4),e)}${hr(t.substring(4,6),e)}`},exports.deepMerge=function t(e={},n={}){let r;for(r in n)Fe(n[r])?e[r]=t(e[r],n[r]):e[r]=n[r];return e},exports.delay=ti,exports.deserialize=function(t){return t==null||t===""?t:new ve.Reader(new ve.ByteStream(t)).deserialize()},exports.doRefreshToken=Ar,exports.doSetLock=un,exports.exportSystemRights=Ei,exports.findStringPrefix=Zo,exports.get=function(t,e,n=!1){return t.startsWith("http")?Ie("",t,e):n||e?Ie(t,void 0,e):Ie(t,"",void 0)},exports.getCommonFileBase=function(t){return t.reduce(function(e,n,r){return e=r===0?Jo(n):Yo(e,n)},"")},exports.getCurrentSystemRight=Mt,exports.getData=function(t,e){return O.Axios?.get(t,{params:e}).catch(function(n){cn(n,t,"","\u5916\u90E8Get")})},exports.getDownload=function(t,e,n){const r=e??mt.getFileName(t);Ie("",t,n,void 0,"blob").then(o=>{o.data&&St(o.data,r)})},exports.getEncryptPWD=function(t){return kt.encryptToString(t,kn)},exports.getFileBase=Jo,exports.getFileExtension=sn,exports.getFunctions=function(t,e=2){if(e===0)return t;const n=Mt();return n?n.functions:void 0},exports.getHexColor=function(t){const e=t.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(e[3]||"1"),r=Math.floor(n*parseInt(e[0])+255*(1-n)),o=Math.floor(n*parseInt(e[1])+255*(1-n)),i=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+r.toString(16)).slice(-2)+("0"+o.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)},exports.getLocalToken=Xe,exports.getLockState=function(){return Ge.isLock},exports.getLongHexColor=function(t){const e=t;if(e.length===4){let r="#";for(var n=1;n<4;n+=1){const o=e.slice(n,n+1);r+=o.concat(o)}return r}return e},exports.getPathBase=ir,exports.getProxyClient=wi,exports.getRGBColor=function(t){var e=t.toLowerCase();if(an(t)){if(e.length===4){for(var n="#",r=1;r<4;r+=1){const i=e.slice(r,r+1);n+=i.concat(i)}e=n}var o=[];for(r=1;r<7;r+=2)o.push(parseInt("0x"+e.slice(r,r+2)));return"rgb("+o.join(",")+")"}return e},exports.getRGBColorFromHSLA=function(t){if(t){var e=t.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(e){var n,r,o,i=(parseFloat(e[1])%360+360)%360/360,s=parseFloat(e[2])/(/%$/.test(e[2])?100:1),a=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(s===0)n=r=o=a;else{var c=a<=.5?a*(s+1):a+s-a*s,u=2*a-c;n=cr(u,c,i+1/3),r=cr(u,c,i),o=cr(u,c,i-1/3)}return`rgba(${n=Math.round(255*n)},${r=Math.round(255*r)},${o=Math.round(255*o)},${e[4]?parseFloat(e[4]):1})`}}},exports.getRefreshToken=ci,exports.getRight=Xi,exports.getRoutes=function(t,e=2){if(e===0)return t;const n=Mt();return n&&n.routes?(Ur.length>0||t.forEach(r=>{const o=n.routes?.find(i=>i.name===r.name);if(o){const i=Yi(r,o);i&&Ur.push(i)}}),Ur):void 0},exports.getSystemRoleRight=async function(t,e=!1){Gi();const n=Qe.GetSystemRights,r=O.Config.ServiceURL.LoginAuthURL,o=await Ie(n,r,{systemid:t});if(!o||!o.data)return void O.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const i=o.data;if(i&&i.length>0){if(e){const s=JSON.parse(i[0]);return Nr(s),s}{const s=Ji(i);return Nr(s),s}}},exports.getWidgetConfig=function(t,e=2){if(e===0)return t;const n=Mt();return n&&n.widgets?($r.length>0||t?.forEach(r=>{n.widgets?.find(o=>o.id===r.id)&&$r.push(r)}),$r):void 0},exports.getWidgetMenus=function(t,e=2){if(e===0)return t;const n=Mt();return n&&n.widgetMenu?(Wr.length>0||t.forEach(r=>{const o=n.widgetMenu?.find(i=>i.name===r.name);if(o){const i=Zi(r,o);i&&Wr.push(i)}}),Wr):void 0},exports.handleNodes=pt,exports.hexToRGB=lr,exports.init=function(t,e,n){!O.Config.DefaultHproseAPI&&O.Config.ServiceURL&&(O.Config.DefaultHproseAPI=O.Config.ServiceURL.DefaultHproseAPI),O.Config.DefaultHproseAPI&&mt.isNotEmpty(O.Config.DefaultHproseAPI)&&(O.DefaultProxyClient=new Ct(O.Config.DefaultHproseAPI));const r=O.Config.UI.GrayMode;r&&se.setGrayMode(r);const o=new ii(t,O.EventBus);O.Message=o,O.SystemID=e,O.SystemGroup=n,O.EventBus.on(fe.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),O.EventBus.on(fe.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),O.EventBus.on(fe.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),O.EventBus.on(fe.CommonWarnEvent,i=>{o.warn(i)})},exports.initDefaultProxyClient=function(t){const e=wi(t);return e&&(O.DefaultProxyClient=e),e},exports.is=ye,exports.isArray=Ft,exports.isAsyncFunction=function(t){return ye(t,"AsyncFunction")},exports.isBoolean=function(t){return t===!0||t===!1||ye(t,"Boolean")},exports.isClient=()=>typeof window<"u",exports.isDate=function(t){return ye(t,"Date")},exports.isDef=wo,exports.isElement=bo,exports.isEmpty=function(t){return t==null||(rt(t)||Ft(t)?t.length===0:!!Fe(t)&&JSON.stringify(t)==="{}")},exports.isEnumColor=function(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substring(0,1);return e==="#"?exports.EnumColor.Hex:e==="r"||e==="("?exports.EnumColor.RGBA:e==="h"?exports.EnumColor.Hsla:exports.EnumColor.RGBA},exports.isError=function(t){return ye(t,"Error")},exports.isFunction=Ot,exports.isHexColor=an,exports.isImageDom=function(t){return t&&["IMAGE","IMG"].includes(t.tagName)},exports.isMap=function(t){return ye(t,"Map")},exports.isNull=On,exports.isNullAndUnDef=function(t){return jn(t)&&On(t)},exports.isNullOrUnDef=function(t){return jn(t)||On(t)},exports.isNumber=Fn,exports.isObjectX=Fe,exports.isPromise=function(t){return ye(t,"Promise")&&Fe(t)&&Ot(t.then)&&Ot(t.catch)},exports.isServer=Ks,exports.isString=rt,exports.isStringLikeJson=So,exports.isStringLikeKml=Co,exports.isSymbol=function(t){return ye(t,"Symbol")},exports.isUnDef=jn,exports.isValidURL=_o,exports.isWeakMap=function(t){return ye(t,"WeakMap")},exports.isWeakSet=function(t){return ye(t,"WeakSet")},exports.isWindow=t=>typeof window<"u"&&ye(t,"Window"),exports.jquery=da,exports.lighten=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${ur(t.substring(0,2),e)}${ur(t.substring(2,4),e)}${ur(t.substring(4,6),e)}`},exports.login=async function(t){const e={username:t.username,pwd:kt.encryptToString(t.pwd,kn)},n=(await Ie(Qe.Login,xn,e))?.data;return n&&(Br(n.doubletoken),un(!1)),n},exports.logout=function(){const t=Xe();t&&(ui(Qe.Logout,xn,{token:t.token,reftoken:t.refresh}),gr())},exports.mergeFilterRoleSysRight=Ji,exports.mergeNames=Yo,exports.mergeNodes=function t(e,n,r="name"){e&&n&&e.forEach(o=>{const i=n.find(s=>s[r]===o[r]);i&&(o.children?i.children&&t(o.children,i.children,r):(!i.children||i.children.length===0)&&i.selected&&(o.selected=i.selected))})},exports.mergeNodesAll=zt,exports.newGuid=function(){var t=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(n==="x"?r:3&r|8).toString(16)});return e},exports.onLockListener=function(){Et(),document.addEventListener("mousedown",Et),document.addEventListener("mousemove",Et)},exports.parseLocalPath=ut,exports.post=function(t,e){return li(t,void 0,e)},exports.replaceFileExtension=function(t,e){var n=ir(t);return e?n+"."+e:n},exports.requestGet=Ie,exports.requestPost=li,exports.requestPostBody=ui,exports.rgbToHex=function(t,e,n){const r=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(r.length-7)).join("0")+r},exports.serialize=function(t){const e=new ve.Writer(new ve.ByteStream);return e.serialize(t),e.stream.toString()},exports.setLocalToken=Br,exports.setRight=Nr,exports.sleep=function(t){const e=new Date().getTime();let n=new Date().getTime();for(;n-e<t;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${ti}\u6BEB\u79D2`)},exports.storage=Js,exports.storageHelper=ht,exports.toLowerCaseExtension=function(t){var e=sn(t);return e?ir(t)+"."+e.toLowerCase():t},exports.unLockListener=function(){document.removeEventListener("mousedown",Et),document.removeEventListener("mousemove",Et)},exports.uuid=Eo,exports.verifiyNumberInteger=function(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[\.]*/g,""),e=e.replace(/(^0[\d]*)$/g,"0"),e=e.replace(/^0\d$/g,"0"),e=e.replace(/[^\d]/g,""),e},exports.verifyAccount=function(t){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(t)},exports.verifyAndSpace=function(t){return t.replace(/(^\s*)|(\s*$)/g,"")},exports.verifyCarNum=function(t){return!!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(t)},exports.verifyCnAndSpace=function(t){let e=t.replace(/[\u4e00-\u9fa5\s]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e},exports.verifyEmail=function(t){return!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)},exports.verifyEnAndSpace=function(t){let e=t.replace(/[a-zA-Z]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e},exports.verifyFullName=function(t){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(t)},exports.verifyIPAddress=function(t){return!!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(t)},exports.verifyIdCard=function(t){return!!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(t)},exports.verifyNumberCnUppercase=function(t,e="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let r=(t+="00").indexOf(".");r>=0&&(t=t.substring(0,r)+t.substr(r+1,2)),e=e.substr(e.length-t.length);for(let o=0;o<t.length;o++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(t.substr(o,1),1)+e.substr(o,1);return n=n.replace(/零角零分$/,"\u6574").replace(/零[仟佰拾]/g,"\u96F6").replace(/零{2,}/g,"\u96F6").replace(/零([亿|万])/g,"$1").replace(/零+元/,"\u5143").replace(/亿零{0,3}万/,"\u4EBF").replace(/^元/,"\u96F6\u5143")},exports.verifyNumberComma=function(t){let e=Cr(t);return e=e.toString().split("."),e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e=e.join("."),e},exports.verifyNumberIntegerAndFloat=Cr,exports.verifyNumberPercentage=function(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d]/g,""),e=e.replace(/^0/g,""),e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e},exports.verifyNumberPercentageFloat=function(t){let e=Cr(t);return e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e=e.replace(/^100\.$/,"100"),e},exports.verifyPassword=function(t){return!!/^[a-zA-Z]\w{5,15}$/.test(t)},exports.verifyPasswordPowerful=function(t){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)},exports.verifyPasswordStrength=function(t){let e="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(t)&&(e="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u5F3A"),e},exports.verifyPhone=function(t){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(t)},exports.verifyPostalCode=function(t){return!!/^[1-9][0-9]{5}$/.test(t)},exports.verifyTelPhone=function(t){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(t)},exports.verifyTextColor=function(t,e="",n="red"){return e.replace(new RegExp(t,"gi"),`<span style='color: ${n}'>${t}</span>`)},exports.verifyUrl=function(t){return!!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(t)},exports.writeIconifyList=function(t,e="IconifyList.ts"){let n="",r=`const iconlist={
|
|
11
|
+
`,o=0;t.forEach(i=>{const s=i.split(":");if(s&&s.length===2){const a="icon"+o;n+=`import ${a} from '~icons/${s[0]}/${s[1]}'
|
|
12
|
+
`,r+=` '${i}':${a},
|
|
13
|
+
`,o++}}),o>0&&(r+=`};
|
|
14
|
+
`,St(n+r+"export default iconlist;","IconifyList.ts"))},exports.writeSysRoleRight=function(t,e){const n=Ei(t);Qo(n,e),O.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")};
|