xframelib 0.8.1 → 0.8.3
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 +4 -2
- package/dist/hprose/HproseIO.d.ts +53 -0
- package/dist/hprose/index.d.ts +3 -2
- package/dist/index.cjs +9 -7
- package/dist/index.css +43 -43
- package/dist/index.js +9 -7
- package/dist/utils/AxiosHelper.d.ts +2 -1
- package/dist/utils/FileDownload.d.ts +3 -2
- package/package.json +12 -7
- package/dist/public/WSynchro.js +0 -67
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var p=require("vue"),ts=require("axios"),ns=require("qs"),st=require("@hprose/rpc-core"),Pe=require("@hprose/io"),os=require("@hprose/rpc-html5");function Lo(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var rs=Lo(ts),is=Lo(ns),ss={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],a=this.panes[s[0]]||null,l=this.panes[s[1]]||null;const h=a.max<100&&i>=a.max+n.prevPanesSize,b=l.max<100&&i<=100-(l.max+this.sumNextPanesSize(e+1));if(h||b)h?(a.size=a.max,l.size=Math.max(100-a.max-n.prevPanesSize-n.nextPanesSize,0)):(a.size=Math.max(100-l.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),l.size=l.max);else{if(this.pushOtherPanes){const S=this.doPushOtherPanes(n,i);if(!S)return;({sums:n,panesToResize:s}=S),a=this.panes[s[0]]||null,l=this.panes[s[1]]||null}a!==null&&(a.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,a.min),a.max)),l!==null&&(l.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,l.min),l.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 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 on(t){return window.TouchEvent&&t instanceof TouchEvent}nn.render=function(t,e,n,o,r,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 ce{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return on(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return on(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new uo(this.clientX,this.clientY)}static bindDown(e,n,o,r=!1){const i=a=>{n(new ce(a))},s=a=>{a.touches.length===1&&n(new ce(a)),a.touches.length>1&&o&&o(new ce(a))};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 ce(s))},i=s=>{s.touches.length===1&&n(new ce(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 ce(s))},i=s=>{s.touches.length===0&&n(new ce(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}){on(this.e)?n&&n(this.e):e&&e(this.e)}}class uo{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new uo(this.x,this.y)}}class as{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,o={}){this.handle=e,this.container=n,this.options=o,e&&(this.unbindDown=ce.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=>{if(e.preventDefault(),this.handle){const{left:n,top:o}=this.handle.getBoundingClientRect();this.offsetX=e.clientX-n,this.offsetY=e.clientY-o}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=ce.bindMove(document,this.mousemove),this.unbindUp=ce.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=e.clientX-this.offsetX+"px",this.container.style.top=e.clientY-this.offsetY+"px"),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 cs{_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=ct(this._group),o=ct(e);n.splice(n.indexOf(this),1),o.push(this),Do()}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(ct(this._group)),Do()}}const at=new Map;function ct(t){return at.has(t)||at.set(t,[]),at.get(t)}function Ao(t,e){return t>e?-Ao(e,t):t<0&&e>=0?1:t-e}function Do(){let t=0;for(const e of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(at).sort(Ao))for(const n of ct(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function rn(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const o=lt(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 lt(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 ls{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=No.map(l=>new l(e,this));const{width:o,height:r}=rn(e),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let a=!1;(o<n.minWidth||o>i)&&(e.style.width=`${$o(o,n.minWidth,i)}px`,a=!0),(r<n.minHeight||r>s)&&(e.style.height=`${$o(r,n.minHeight,s)}px`,a=!0),a&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const No=[];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=ce.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}=lt(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=ce.bindMove(document,this.mousemove),this.unbindUp=ce.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}=lt(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,a=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-a,0),this.maxTop=r-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:o,top:r,right:i,bottom:s}=lt(this.container),a=this.helper.options;a&&(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=`${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-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=`${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-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 $o(t,e,n){return t<e?e:t>n?n:t}No.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 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=ce.bindUp(document,()=>{n.value=!1,r()})}}}});const us=["disabled"];ut.render=function(t,e,n,o,r,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,us)},ut.__scopeId="data-v-71662210",ut.__file="src/controls/vuewindow/window/Button.vue";const hs=Object.prototype.toString;function se(t,e){return hs.call(t)===`[object ${e}]`}function ht(t){return se(t,"Function")}const Bo=t=>typeof t<"u",sn=t=>!Bo(t);function an(t){return t===null}const be=t=>t!=null&&t!==null&&se(t,"Object");function cn(t){return se(t,"Number")}function dt(t){return se(t,"String")}function ln(t){return t&&Array.isArray(t)}const ds=typeof window>"u";var ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jo,Oo={exports:{}},fs=jo?Oo.exports:(jo=1,Oo.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(g,u){var y=g[0],w=g[1],d=g[2],f=g[3];w=((w+=((d=((d+=((f=((f+=((y=((y+=(w&d|~w&f)+u[0]-680876936|0)<<7|y>>>25)+w|0)&w|~y&d)+u[1]-389564586|0)<<12|f>>>20)+y|0)&y|~f&w)+u[2]+606105819|0)<<17|d>>>15)+f|0)&f|~d&y)+u[3]-1044525330|0)<<22|w>>>10)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w&d|~w&f)+u[4]-176418897|0)<<7|y>>>25)+w|0)&w|~y&d)+u[5]+1200080426|0)<<12|f>>>20)+y|0)&y|~f&w)+u[6]-1473231341|0)<<17|d>>>15)+f|0)&f|~d&y)+u[7]-45705983|0)<<22|w>>>10)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w&d|~w&f)+u[8]+1770035416|0)<<7|y>>>25)+w|0)&w|~y&d)+u[9]-1958414417|0)<<12|f>>>20)+y|0)&y|~f&w)+u[10]-42063|0)<<17|d>>>15)+f|0)&f|~d&y)+u[11]-1990404162|0)<<22|w>>>10)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w&d|~w&f)+u[12]+1804603682|0)<<7|y>>>25)+w|0)&w|~y&d)+u[13]-40341101|0)<<12|f>>>20)+y|0)&y|~f&w)+u[14]-1502002290|0)<<17|d>>>15)+f|0)&f|~d&y)+u[15]+1236535329|0)<<22|w>>>10)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w&f|d&~f)+u[1]-165796510|0)<<5|y>>>27)+w|0)&d|w&~d)+u[6]-1069501632|0)<<9|f>>>23)+y|0)&w|y&~w)+u[11]+643717713|0)<<14|d>>>18)+f|0)&y|f&~y)+u[0]-373897302|0)<<20|w>>>12)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w&f|d&~f)+u[5]-701558691|0)<<5|y>>>27)+w|0)&d|w&~d)+u[10]+38016083|0)<<9|f>>>23)+y|0)&w|y&~w)+u[15]-660478335|0)<<14|d>>>18)+f|0)&y|f&~y)+u[4]-405537848|0)<<20|w>>>12)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w&f|d&~f)+u[9]+568446438|0)<<5|y>>>27)+w|0)&d|w&~d)+u[14]-1019803690|0)<<9|f>>>23)+y|0)&w|y&~w)+u[3]-187363961|0)<<14|d>>>18)+f|0)&y|f&~y)+u[8]+1163531501|0)<<20|w>>>12)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w&f|d&~f)+u[13]-1444681467|0)<<5|y>>>27)+w|0)&d|w&~d)+u[2]-51403784|0)<<9|f>>>23)+y|0)&w|y&~w)+u[7]+1735328473|0)<<14|d>>>18)+f|0)&y|f&~y)+u[12]-1926607734|0)<<20|w>>>12)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w^d^f)+u[5]-378558|0)<<4|y>>>28)+w|0)^w^d)+u[8]-2022574463|0)<<11|f>>>21)+y|0)^y^w)+u[11]+1839030562|0)<<16|d>>>16)+f|0)^f^y)+u[14]-35309556|0)<<23|w>>>9)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w^d^f)+u[1]-1530992060|0)<<4|y>>>28)+w|0)^w^d)+u[4]+1272893353|0)<<11|f>>>21)+y|0)^y^w)+u[7]-155497632|0)<<16|d>>>16)+f|0)^f^y)+u[10]-1094730640|0)<<23|w>>>9)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w^d^f)+u[13]+681279174|0)<<4|y>>>28)+w|0)^w^d)+u[0]-358537222|0)<<11|f>>>21)+y|0)^y^w)+u[3]-722521979|0)<<16|d>>>16)+f|0)^f^y)+u[6]+76029189|0)<<23|w>>>9)+d|0,w=((w+=((d=((d+=((f=((f+=((y=((y+=(w^d^f)+u[9]-640364487|0)<<4|y>>>28)+w|0)^w^d)+u[12]-421815835|0)<<11|f>>>21)+y|0)^y^w)+u[15]+530742520|0)<<16|d>>>16)+f|0)^f^y)+u[2]-995338651|0)<<23|w>>>9)+d|0,w=((w+=((f=((f+=(w^((y=((y+=(d^(w|~f))+u[0]-198630844|0)<<6|y>>>26)+w|0)|~d))+u[7]+1126891415|0)<<10|f>>>22)+y|0)^((d=((d+=(y^(f|~w))+u[14]-1416354905|0)<<15|d>>>17)+f|0)|~y))+u[5]-57434055|0)<<21|w>>>11)+d|0,w=((w+=((f=((f+=(w^((y=((y+=(d^(w|~f))+u[12]+1700485571|0)<<6|y>>>26)+w|0)|~d))+u[3]-1894986606|0)<<10|f>>>22)+y|0)^((d=((d+=(y^(f|~w))+u[10]-1051523|0)<<15|d>>>17)+f|0)|~y))+u[1]-2054922799|0)<<21|w>>>11)+d|0,w=((w+=((f=((f+=(w^((y=((y+=(d^(w|~f))+u[8]+1873313359|0)<<6|y>>>26)+w|0)|~d))+u[15]-30611744|0)<<10|f>>>22)+y|0)^((d=((d+=(y^(f|~w))+u[6]-1560198380|0)<<15|d>>>17)+f|0)|~y))+u[13]+1309151649|0)<<21|w>>>11)+d|0,w=((w+=((f=((f+=(w^((y=((y+=(d^(w|~f))+u[4]-145523070|0)<<6|y>>>26)+w|0)|~d))+u[11]-1120210379|0)<<10|f>>>22)+y|0)^((d=((d+=(y^(f|~w))+u[2]+718787259|0)<<15|d>>>17)+f|0)|~y))+u[9]-343485551|0)<<21|w>>>11)+d|0,g[0]=y+g[0]|0,g[1]=w+g[1]|0,g[2]=d+g[2]|0,g[3]=f+g[3]|0}function o(g){var u,y=[];for(u=0;u<64;u+=4)y[u>>2]=g.charCodeAt(u)+(g.charCodeAt(u+1)<<8)+(g.charCodeAt(u+2)<<16)+(g.charCodeAt(u+3)<<24);return y}function r(g){var u,y=[];for(u=0;u<64;u+=4)y[u>>2]=g[u]+(g[u+1]<<8)+(g[u+2]<<16)+(g[u+3]<<24);return y}function i(g){var u,y,w,d,f,L,D=g.length,N=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=D;u+=64)n(N,o(g.substring(u-64,u)));for(y=(g=g.substring(u-64)).length,w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<y;u+=1)w[u>>2]|=g.charCodeAt(u)<<(u%4<<3);if(w[u>>2]|=128<<(u%4<<3),u>55)for(n(N,w),u=0;u<16;u+=1)w[u]=0;return d=(d=8*D).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(d[2],16),L=parseInt(d[1],16)||0,w[14]=f,w[15]=L,n(N,w),N}function s(g){var u,y,w,d,f,L,D=g.length,N=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=D;u+=64)n(N,r(g.subarray(u-64,u)));for(y=(g=u-64<D?g.subarray(u-64):new Uint8Array(0)).length,w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<y;u+=1)w[u>>2]|=g[u]<<(u%4<<3);if(w[u>>2]|=128<<(u%4<<3),u>55)for(n(N,w),u=0;u<16;u+=1)w[u]=0;return d=(d=8*D).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(d[2],16),L=parseInt(d[1],16)||0,w[14]=f,w[15]=L,n(N,w),N}function a(g){var u,y="";for(u=0;u<4;u+=1)y+=e[g>>8*u+4&15]+e[g>>8*u&15];return y}function l(g){var u;for(u=0;u<g.length;u+=1)g[u]=a(g[u]);return g.join("")}function h(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function b(g,u){var y,w=g.length,d=new ArrayBuffer(w),f=new Uint8Array(d);for(y=0;y<w;y+=1)f[y]=g.charCodeAt(y);return u?f:d}function S(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function x(g,u,y){var w=new Uint8Array(g.byteLength+u.byteLength);return w.set(new Uint8Array(g)),w.set(new Uint8Array(u),g.byteLength),y?w:w.buffer}function $(g){var u,y=[],w=g.length;for(u=0;u<w-1;u+=2)y.push(parseInt(g.substr(u,2),16));return String.fromCharCode.apply(String,y)}function T(){this.reset()}return l(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function g(u,y){return(u=0|u||0)<0?Math.max(u+y,0):Math.min(u,y)}ArrayBuffer.prototype.slice=function(u,y){var w,d,f,L,D=this.byteLength,N=g(u,D),P=D;return y!==t&&(P=g(y,D)),N>P?new ArrayBuffer(0):(w=P-N,d=new ArrayBuffer(w),f=new Uint8Array(d),L=new Uint8Array(this,N,w),f.set(L),d)}}(),T.prototype.append=function(g){return this.appendBinary(h(g)),this},T.prototype.appendBinary=function(g){this._buff+=g,this._length+=g.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},T.prototype.end=function(g){var u,y,w=this._buff,d=w.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<d;u+=1)f[u>>2]|=w.charCodeAt(u)<<(u%4<<3);return this._finish(f,d),y=l(this._hash),g&&(y=$(y)),this.reset(),y},T.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},T.prototype.setState=function(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},T.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},T.prototype._finish=function(g,u){var y,w,d,f=u;if(g[f>>2]|=128<<(f%4<<3),f>55)for(n(this._hash,g),f=0;f<16;f+=1)g[f]=0;y=(y=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),w=parseInt(y[2],16),d=parseInt(y[1],16)||0,g[14]=w,g[15]=d,n(this._hash,g)},T.hash=function(g,u){return T.hashBinary(h(g),u)},T.hashBinary=function(g,u){var y=l(i(g));return u?$(y):y},T.ArrayBuffer=function(){this.reset()},T.ArrayBuffer.prototype.append=function(g){var u,y=x(this._buff.buffer,g,!0),w=y.length;for(this._length+=g.byteLength,u=64;u<=w;u+=64)n(this._hash,r(y.subarray(u-64,u)));return this._buff=u-64<w?new Uint8Array(y.buffer.slice(u-64)):new Uint8Array(0),this},T.ArrayBuffer.prototype.end=function(g){var u,y,w=this._buff,d=w.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<d;u+=1)f[u>>2]|=w[u]<<(u%4<<3);return this._finish(f,d),y=l(this._hash),g&&(y=$(y)),this.reset(),y},T.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.ArrayBuffer.prototype.getState=function(){var g=T.prototype.getState.call(this);return g.buff=S(g.buff),g},T.ArrayBuffer.prototype.setState=function(g){return g.buff=b(g.buff,!0),T.prototype.setState.call(this,g)},T.ArrayBuffer.prototype.destroy=T.prototype.destroy,T.ArrayBuffer.prototype._finish=T.prototype._finish,T.ArrayBuffer.hash=function(g,u){var y=l(s(new Uint8Array(g)));return u?$(y):y},T}()),un=ft(fs);const hn=[];class ae{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){ae.addHandler(window,"resize",e)}static offWindowResizeHandler(e){ae.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!!ae.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=ae.isFullScreen();e(o)}):document.addEventListener("MSFullscreenChange",function(){const o=ae.isFullScreen();e(o)})}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,ae.stringifyCircularHandler);return hn.length=0,n}static jsonParse(e){const n=ae.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,a=new un.ArrayBuffer,l=new FileReader;l.onload=function(h){a.append(h.target?.result);const b=a.end();n({isOK:!0,data:b})},l.onerror=function(){const h="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(h),n({isOK:!1,data:h})},function(){const h=0+s>=i.size?i.size:0+s;l.readAsArrayBuffer(r.call(i,0,h))}()}static getFileMD5(e,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,a=Math.ceil(i.size/s);let l=0;const h=new un.ArrayBuffer,b=new FileReader;function S(){const x=l*s,$=x+s>=i.size?i.size:x+s;b.readAsArrayBuffer(r.call(i,x,$))}b.onload=function(x){if(h.append(x.target?.result),l++,l<a)S();else{const $=h.end();n({isOK:!0,data:$})}},b.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})},S()}static MD5(e,n=!1){return un.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}):ae.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 ae.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){ae.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=dt(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}}class pt{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","")}}class gt{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 ps=new gt("",localStorage);function Wo(){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 dn(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 mt(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function fn(t){let e=t.toLowerCase();if(mt(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 pn(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 Uo(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 gn(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 mn(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&&o.splice(o.indexOf(n)>>>0,1)},emit(e,n){(t?.get(e)||[]).slice().map(o=>{o(n)}),(t?.get("*")||[]).slice().map(o=>{o(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 _e=mn(),re={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},vt=(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)},Fo=(t,e)=>{const n=JSON.stringify(t,null,2);e?vt(n,e+".json"):_e.emit(re.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")};function Ho(t){const e=t.lastIndexOf("/")+1;let n=t.substring(e);return n=decodeURI(n.split("?")[0]),n}function qo(t){return new Promise(e=>setTimeout(e,t))}var Vo,vn={exports:{}},Xo,Go,yn,wn=(Vo||(Vo=1,Go=vn.exports,yn=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(T,g){var u=T[g];if(typeof u.bind=="function")return u.bind(T);try{return Function.prototype.bind.call(u,T)}catch{return function(){return Function.prototype.apply.apply(u,[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 l(T){return T==="debug"&&(T="log"),typeof console!==e&&(T==="trace"&&n?a:console[T]!==void 0?s(console,T):console.log!==void 0?s(console,"log"):t)}function h(){for(var T=this.getLevel(),g=0;g<o.length;g++){var u=o[g];this[u]=g<T?t:this.methodFactory(u,T,this.name)}if(this.log=this.debug,typeof console===e&&T<this.levels.SILENT)return"No console available for logging"}function b(T){return function(){typeof console!==e&&(h.call(this),this[T].apply(this,arguments))}}function S(T,g,u){return l(T)||b.apply(this,arguments)}function x(T,g){var u,y,w,d=this,f="loglevel";function L(){var P;if(typeof window!==e&&f){try{P=window.localStorage[f]}catch{}if(typeof P===e)try{var B=window.document.cookie,W=encodeURIComponent(f),R=B.indexOf(W+"=");R!==-1&&(P=/^([^;]+)/.exec(B.slice(R+W.length+1))[1])}catch{}return d.levels[P]===void 0&&(P=void 0),P}}function D(P){var B=P;if(typeof B=="string"&&d.levels[B.toUpperCase()]!==void 0&&(B=d.levels[B.toUpperCase()]),typeof B=="number"&&B>=0&&B<=d.levels.SILENT)return B;throw new TypeError("log.setLevel() called with invalid level: "+P)}typeof T=="string"?f+=":"+T:typeof T=="symbol"&&(f=void 0),d.name=T,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=g||S,d.getLevel=function(){return w??y??u},d.setLevel=function(P,B){return w=D(P),B!==!1&&function(W){var R=(o[W]||"silent").toUpperCase();if(typeof window!==e&&f){try{return void(window.localStorage[f]=R)}catch{}try{window.document.cookie=encodeURIComponent(f)+"="+R+";"}catch{}}}(w),h.call(d)},d.setDefaultLevel=function(P){y=D(P),L()||d.setLevel(P,!1)},d.resetLevel=function(){w=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{}}}(),h.call(d)},d.enableAll=function(P){d.setLevel(d.levels.TRACE,P)},d.disableAll=function(P){d.setLevel(d.levels.SILENT,P)},d.rebuild=function(){if(i!==d&&(u=D(i.getLevel())),h.call(d),i===d)for(var P in r)r[P].rebuild()},u=D(i?i.getLevel():"WARN");var N=L();N!=null&&(w=D(N)),h.call(d)}(i=new x).getLogger=function(T){if(typeof T!="symbol"&&typeof T!="string"||T==="")throw new TypeError("You must supply a name when creating a logger.");var g=r[T];return g||(g=r[T]=new x(T,i.methodFactory)),g};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},(Xo=vn).exports?Xo.exports=yn():Go.log=yn()),vn.exports);class Ko{message;eventBus;constructor(e,n){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(re.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 Jo=!1;const O={Config:SysConfig,EventBus:_e,DefaultProxyClient:null,Axios:rs.default,Message:new Ko(void 0,_e),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=>{Jo||(SysConfig.UI.ProductLog?wn.enableAll():wn.setDefaultLevel("warn"),Jo=!0);const e=t||"default";return wn.getLogger(e)}},Yo="access_token",me=new gt("user",localStorage);function Se(){return me.get(Yo)}function bn(){me.remove(Yo)}function Zo(){return Se()?.refresh}function _n(t,e,n,o="json",r){const i={baseURL:O.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,paramsSerializer:{serialize:function(s){return is.default.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Se()?.token},responseType:o,cancelToken:r};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&&(i.baseURL=e),i}function ve(t,e,n,o,r="json",i,s){const a=_n(n,e,o,r,i);return s&&s>=2e4&&(a.timeout=s),O.Axios?.get(t,a).catch(function(l){yt(l,e,t,"Get")})}function yt(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 l=t.response.data;if(l){const h=l.indexOf(":"),b=l.indexOf(`
|
|
2
|
-
`);if(
|
|
3
|
-
`),i=0;i<r.length;i++){var s=r[i],a=s.indexOf(":"),l=t(s.slice(0,a)).toLowerCase(),h=t(s.slice(a+1));o[l]===void 0?o[l]=h:(n=o[l],Object.prototype.toString.call(n)==="[object Array]"?o[l].push(h):o[l]=[o[l],h])}return o},Cn}var ys=function(){if(ar)return wt.exports;ar=1;var t=gs(),e=ms(),n=vs(),o=function(){if(sr)return En;sr=1,En=function(){for(var l={},h=0;h<arguments.length;h++){var b=arguments[h];for(var S in b)a.call(b,S)&&(l[S]=b[S])}return l};var a=Object.prototype.hasOwnProperty;return En}();function r(a,l,h){var b=a;return e(l)?(h=l,typeof a=="string"&&(b={uri:a})):b=o(l,{uri:a}),b.callback=h,b}function i(a,l,h){return s(l=r(a,l,h))}function s(a){if(a.callback===void 0)throw new Error("callback argument missing");var l=!1,h=function(P,B,W){l||(l=!0,a.callback(P,B,W))};function b(){var P=void 0;if(P=g.response?g.response:g.responseText||function(B){try{if(B.responseType==="document")return B.responseXML;var W=B.responseXML&&B.responseXML.documentElement.nodeName==="parsererror";if(B.responseType===""&&!W)return B.responseXML}catch{}return null}(g),D)try{P=JSON.parse(P)}catch{}return P}function S(P){return clearTimeout(u),P instanceof Error||(P=new Error(""+(P||"Unknown XMLHttpRequest Error"))),P.statusCode=0,h(P,N)}function x(){if(!T){var P;clearTimeout(u),P=a.useXDR&&g.status===void 0?200:g.status===1223?204:g.status;var B=N,W=null;return P!==0?(B={body:b(),statusCode:P,method:w,headers:{},url:y,rawRequest:g},g.getAllResponseHeaders&&(B.headers=n(g.getAllResponseHeaders()))):W=new Error("Internal XMLHttpRequest Error"),h(W,B,B.body)}}var $,T,g=a.xhr||null;g||(g=a.cors||a.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var u,y=g.url=a.uri||a.url,w=g.method=a.method||"GET",d=a.body||a.data,f=g.headers=a.headers||{},L=!!a.sync,D=!1,N={body:void 0,headers:{},statusCode:0,method:w,url:y,rawRequest:g};if("json"in a&&a.json!==!1&&(D=!0,f.accept||f.Accept||(f.Accept="application/json"),w!=="GET"&&w!=="HEAD"&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),d=JSON.stringify(a.json===!0?d:a.json))),g.onreadystatechange=function(){g.readyState===4&&setTimeout(x,0)},g.onload=x,g.onerror=S,g.onprogress=function(){},g.onabort=function(){T=!0},g.ontimeout=S,g.open(w,y,!L,a.username,a.password),L||(g.withCredentials=!!a.withCredentials),!L&&a.timeout>0&&(u=setTimeout(function(){if(!T){T=!0,g.abort("timeout");var P=new Error("XMLHttpRequest timeout");P.code="ETIMEDOUT",S(P)}},a.timeout)),g.setRequestHeader)for($ in f)f.hasOwnProperty($)&&g.setRequestHeader($,f[$]);else if(a.headers&&!function(P){for(var B in P)if(P.hasOwnProperty(B))return!1;return!0}(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(g.responseType=a.responseType),"beforeSend"in a&&typeof a.beforeSend=="function"&&a.beforeSend(g),g.send(d||null),g}return wt.exports=i,wt.exports.default=i,i.XMLHttpRequest=t.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:t.XDomainRequest,function(a,l){for(var h=0;h<a.length;h++)l(a[h])}(["get","put","post","patch","head","delete"],function(a){i[a==="delete"?"del":a]=function(l,h,b){return(h=r(l,h,b)).method=a.toUpperCase(),s(h)}}),wt.exports}(),ws=ft(ys);const bs=[200,201,202,204,308],_s=[408,502,503,504];class cr{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=mn(),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,a=i*this.chunkCount,l=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(a+l,100))}};return new Promise((o,r)=>{this.currentXhr=ws({...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&&bs.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&&_s.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 Ss=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&&!pt.isNullOrEmpty(e)){if(Qe.httpTransport||(Qe.httpTransport=new os.HttpTransport),this.client=new st.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")):_e.emit(re.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 We{hproseClient;hpProxyObj;defaultContext=new st.ClientContext;constructor(e){this.hproseClient=new Qe(e),this.hpProxyObj=null}getClientContext(e,n){const o={};n&&(o.requestHeaders=n);const r=Se();o.httpRequestHeaders=e||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),O.SystemID&&(i.sysid=O.SystemID,O.SystemGroup&&(i.sysgroup=O.SystemGroup)),new st.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||_e.emit(re.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=Se();return console.log(r,"userToken3"),r&&(n||(n=new st.ClientContext({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(e,o,n)}async hproseInvokeEncode(e){const n=new Pe.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 Pe.ByteStream.toString(o)}}const kn=new Map;function lr(t){if(t&&pt.isNotEmpty(t)){if(kn.has(t))return kn.get(t);{const e=new We(t);return kn.set(t,e),e}}}const xn="is_LockScreen",ur=me.get(xn,!1),Ue={isLock:ur,lockTime:ur=="true"?dr():0};function hr(t){Ue.isLock=t,me.set(xn,t,10),t&&(bn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function dr(){let t=3600;return O.Config.UI?.LockTime&&O.Config.UI?.LockTime>=10&&(t=O.Config.UI.LockTime),t}let In;function Tn(){clearInterval(In),!(window.location.href.indexOf("/login")>0||Ue.isLock)&&(hr(!1),Ue.lockTime=dr(),In=setInterval(()=>{if(Ue.lockTime--,Ue.lockTime<=0)return hr(!0),clearInterval(In)},1e3))}function Rn(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 fr,pr={exports:{}};/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var l=require("vue"),oi=require("axios"),ri=require("qs"),Ve=require("@hprose/rpc-core"),re=require("@hprose/io"),ii=require("@hprose/rpc-html5"),zt=require("@iconify/vue");function Gn(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var si=Gn(oi),ai=Gn(ri),ci={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 Lt(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 Lt(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Lt(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new En(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}){Lt(this.e)?n&&n(this.e):e&&e(this.e)}}class En{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new En(this.x,this.y)}}class li{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 ui{_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=Ge(this._group),o=Ge(e);n.splice(n.indexOf(this),1),o.push(this),Yn()}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(Ge(this._group)),Yn()}}const Xe=new Map;function Ge(t){return Xe.has(t)||Xe.set(t,[]),Xe.get(t)}function Kn(t,e){return t>e?-Kn(e,t):t<0&&e>=0?1:t-e}function Yn(){let t=0;for(const e of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(Xe).sort(Kn))for(const n of Ge(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function Dt(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const o=Ke(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 Ke(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 hi{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=Jn.map(h=>new h(e,this));const{width:o,height:r}=Dt(e),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let c=!1;(o<n.minWidth||o>i)&&(e.style.width=`${Zn(o,n.minWidth,i)}px`,c=!0),(r<n.minHeight||r>s)&&(e.style.height=`${Zn(r,n.minHeight,s)}px`,c=!0),c&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const Jn=[];class ve{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}=Ke(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}=Ke(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}=Ke(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 Zn(t,e,n){return t<e?e:t>n?n:t}Jn.push(class extends ve{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 ve{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 ve{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 ve{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 ve{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 ve{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 ve{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 ve{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 Ye=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 di=["disabled"];Ye.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,di)},Ye.__scopeId="data-v-71662210",Ye.__file="src/controls/vuewindow/window/Button.vue";const fi=Object.prototype.toString;function ie(t,e){return fi.call(t)===`[object ${e}]`}function Je(t){return ie(t,"Function")}const Qn=t=>typeof t<"u",Bt=t=>!Qn(t);function $t(t){return t===null}const ye=t=>t!=null&&t!==null&&ie(t,"Object");function Nt(t){return ie(t,"Number")}function Ze(t){return ie(t,"String")}function Wt(t){return t&&Array.isArray(t)}const pi=typeof window>"u";var Ie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var eo,to={exports:{}},gi=eo?to.exports:(eo=1,to.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(g,u){var w=g[0],v=g[1],f=g[2],y=g[3];v=((v+=((f=((f+=((y=((y+=((w=((w+=(v&f|~v&y)+u[0]-680876936|0)<<7|w>>>25)+v|0)&v|~w&f)+u[1]-389564586|0)<<12|y>>>20)+w|0)&w|~y&v)+u[2]+606105819|0)<<17|f>>>15)+y|0)&y|~f&w)+u[3]-1044525330|0)<<22|v>>>10)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v&f|~v&y)+u[4]-176418897|0)<<7|w>>>25)+v|0)&v|~w&f)+u[5]+1200080426|0)<<12|y>>>20)+w|0)&w|~y&v)+u[6]-1473231341|0)<<17|f>>>15)+y|0)&y|~f&w)+u[7]-45705983|0)<<22|v>>>10)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v&f|~v&y)+u[8]+1770035416|0)<<7|w>>>25)+v|0)&v|~w&f)+u[9]-1958414417|0)<<12|y>>>20)+w|0)&w|~y&v)+u[10]-42063|0)<<17|f>>>15)+y|0)&y|~f&w)+u[11]-1990404162|0)<<22|v>>>10)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v&f|~v&y)+u[12]+1804603682|0)<<7|w>>>25)+v|0)&v|~w&f)+u[13]-40341101|0)<<12|y>>>20)+w|0)&w|~y&v)+u[14]-1502002290|0)<<17|f>>>15)+y|0)&y|~f&w)+u[15]+1236535329|0)<<22|v>>>10)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v&y|f&~y)+u[1]-165796510|0)<<5|w>>>27)+v|0)&f|v&~f)+u[6]-1069501632|0)<<9|y>>>23)+w|0)&v|w&~v)+u[11]+643717713|0)<<14|f>>>18)+y|0)&w|y&~w)+u[0]-373897302|0)<<20|v>>>12)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v&y|f&~y)+u[5]-701558691|0)<<5|w>>>27)+v|0)&f|v&~f)+u[10]+38016083|0)<<9|y>>>23)+w|0)&v|w&~v)+u[15]-660478335|0)<<14|f>>>18)+y|0)&w|y&~w)+u[4]-405537848|0)<<20|v>>>12)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v&y|f&~y)+u[9]+568446438|0)<<5|w>>>27)+v|0)&f|v&~f)+u[14]-1019803690|0)<<9|y>>>23)+w|0)&v|w&~v)+u[3]-187363961|0)<<14|f>>>18)+y|0)&w|y&~w)+u[8]+1163531501|0)<<20|v>>>12)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v&y|f&~y)+u[13]-1444681467|0)<<5|w>>>27)+v|0)&f|v&~f)+u[2]-51403784|0)<<9|y>>>23)+w|0)&v|w&~v)+u[7]+1735328473|0)<<14|f>>>18)+y|0)&w|y&~w)+u[12]-1926607734|0)<<20|v>>>12)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v^f^y)+u[5]-378558|0)<<4|w>>>28)+v|0)^v^f)+u[8]-2022574463|0)<<11|y>>>21)+w|0)^w^v)+u[11]+1839030562|0)<<16|f>>>16)+y|0)^y^w)+u[14]-35309556|0)<<23|v>>>9)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v^f^y)+u[1]-1530992060|0)<<4|w>>>28)+v|0)^v^f)+u[4]+1272893353|0)<<11|y>>>21)+w|0)^w^v)+u[7]-155497632|0)<<16|f>>>16)+y|0)^y^w)+u[10]-1094730640|0)<<23|v>>>9)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v^f^y)+u[13]+681279174|0)<<4|w>>>28)+v|0)^v^f)+u[0]-358537222|0)<<11|y>>>21)+w|0)^w^v)+u[3]-722521979|0)<<16|f>>>16)+y|0)^y^w)+u[6]+76029189|0)<<23|v>>>9)+f|0,v=((v+=((f=((f+=((y=((y+=((w=((w+=(v^f^y)+u[9]-640364487|0)<<4|w>>>28)+v|0)^v^f)+u[12]-421815835|0)<<11|y>>>21)+w|0)^w^v)+u[15]+530742520|0)<<16|f>>>16)+y|0)^y^w)+u[2]-995338651|0)<<23|v>>>9)+f|0,v=((v+=((y=((y+=(v^((w=((w+=(f^(v|~y))+u[0]-198630844|0)<<6|w>>>26)+v|0)|~f))+u[7]+1126891415|0)<<10|y>>>22)+w|0)^((f=((f+=(w^(y|~v))+u[14]-1416354905|0)<<15|f>>>17)+y|0)|~w))+u[5]-57434055|0)<<21|v>>>11)+f|0,v=((v+=((y=((y+=(v^((w=((w+=(f^(v|~y))+u[12]+1700485571|0)<<6|w>>>26)+v|0)|~f))+u[3]-1894986606|0)<<10|y>>>22)+w|0)^((f=((f+=(w^(y|~v))+u[10]-1051523|0)<<15|f>>>17)+y|0)|~w))+u[1]-2054922799|0)<<21|v>>>11)+f|0,v=((v+=((y=((y+=(v^((w=((w+=(f^(v|~y))+u[8]+1873313359|0)<<6|w>>>26)+v|0)|~f))+u[15]-30611744|0)<<10|y>>>22)+w|0)^((f=((f+=(w^(y|~v))+u[6]-1560198380|0)<<15|f>>>17)+y|0)|~w))+u[13]+1309151649|0)<<21|v>>>11)+f|0,v=((v+=((y=((y+=(v^((w=((w+=(f^(v|~y))+u[4]-145523070|0)<<6|w>>>26)+v|0)|~f))+u[11]-1120210379|0)<<10|y>>>22)+w|0)^((f=((f+=(w^(y|~v))+u[2]+718787259|0)<<15|f>>>17)+y|0)|~w))+u[9]-343485551|0)<<21|v>>>11)+f|0,g[0]=w+g[0]|0,g[1]=v+g[1]|0,g[2]=f+g[2]|0,g[3]=y+g[3]|0}function o(g){var u,w=[];for(u=0;u<64;u+=4)w[u>>2]=g.charCodeAt(u)+(g.charCodeAt(u+1)<<8)+(g.charCodeAt(u+2)<<16)+(g.charCodeAt(u+3)<<24);return w}function r(g){var u,w=[];for(u=0;u<64;u+=4)w[u>>2]=g[u]+(g[u+1]<<8)+(g[u+2]<<16)+(g[u+3]<<24);return w}function i(g){var u,w,v,f,y,$,A=g.length,L=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=A;u+=64)n(L,o(g.substring(u-64,u)));for(w=(g=g.substring(u-64)).length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<w;u+=1)v[u>>2]|=g.charCodeAt(u)<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n(L,v),u=0;u<16;u+=1)v[u]=0;return f=(f=8*A).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(f[2],16),$=parseInt(f[1],16)||0,v[14]=y,v[15]=$,n(L,v),L}function s(g){var u,w,v,f,y,$,A=g.length,L=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=A;u+=64)n(L,r(g.subarray(u-64,u)));for(w=(g=u-64<A?g.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<w;u+=1)v[u>>2]|=g[u]<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n(L,v),u=0;u<16;u+=1)v[u]=0;return f=(f=8*A).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(f[2],16),$=parseInt(f[1],16)||0,v[14]=y,v[15]=$,n(L,v),L}function c(g){var u,w="";for(u=0;u<4;u+=1)w+=e[g>>8*u+4&15]+e[g>>8*u&15];return w}function h(g){var u;for(u=0;u<g.length;u+=1)g[u]=c(g[u]);return g.join("")}function m(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function C(g,u){var w,v=g.length,f=new ArrayBuffer(v),y=new Uint8Array(f);for(w=0;w<v;w+=1)y[w]=g.charCodeAt(w);return u?y:f}function k(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function D(g,u,w){var v=new Uint8Array(g.byteLength+u.byteLength);return v.set(new Uint8Array(g)),v.set(new Uint8Array(u),g.byteLength),w?v:v.buffer}function j(g){var u,w=[],v=g.length;for(u=0;u<v-1;u+=2)w.push(parseInt(g.substr(u,2),16));return String.fromCharCode.apply(String,w)}function T(){this.reset()}return h(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function g(u,w){return(u=0|u||0)<0?Math.max(u+w,0):Math.min(u,w)}ArrayBuffer.prototype.slice=function(u,w){var v,f,y,$,A=this.byteLength,L=g(u,A),z=A;return w!==t&&(z=g(w,A)),L>z?new ArrayBuffer(0):(v=z-L,f=new ArrayBuffer(v),y=new Uint8Array(f),$=new Uint8Array(this,L,v),y.set($),f)}}(),T.prototype.append=function(g){return this.appendBinary(m(g)),this},T.prototype.appendBinary=function(g){this._buff+=g,this._length+=g.length;var u,w=this._buff.length;for(u=64;u<=w;u+=64)n(this._hash,o(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},T.prototype.end=function(g){var u,w,v=this._buff,f=v.length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<f;u+=1)y[u>>2]|=v.charCodeAt(u)<<(u%4<<3);return this._finish(y,f),w=h(this._hash),g&&(w=j(w)),this.reset(),w},T.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},T.prototype.setState=function(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},T.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},T.prototype._finish=function(g,u){var w,v,f,y=u;if(g[y>>2]|=128<<(y%4<<3),y>55)for(n(this._hash,g),y=0;y<16;y+=1)g[y]=0;w=(w=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(w[2],16),f=parseInt(w[1],16)||0,g[14]=v,g[15]=f,n(this._hash,g)},T.hash=function(g,u){return T.hashBinary(m(g),u)},T.hashBinary=function(g,u){var w=h(i(g));return u?j(w):w},T.ArrayBuffer=function(){this.reset()},T.ArrayBuffer.prototype.append=function(g){var u,w=D(this._buff.buffer,g,!0),v=w.length;for(this._length+=g.byteLength,u=64;u<=v;u+=64)n(this._hash,r(w.subarray(u-64,u)));return this._buff=u-64<v?new Uint8Array(w.buffer.slice(u-64)):new Uint8Array(0),this},T.ArrayBuffer.prototype.end=function(g){var u,w,v=this._buff,f=v.length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<f;u+=1)y[u>>2]|=v[u]<<(u%4<<3);return this._finish(y,f),w=h(this._hash),g&&(w=j(w)),this.reset(),w},T.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.ArrayBuffer.prototype.getState=function(){var g=T.prototype.getState.call(this);return g.buff=k(g.buff),g},T.ArrayBuffer.prototype.setState=function(g){return g.buff=C(g.buff,!0),T.prototype.setState.call(this,g)},T.ArrayBuffer.prototype.destroy=T.prototype.destroy,T.ArrayBuffer.prototype._finish=T.prototype._finish,T.ArrayBuffer.hash=function(g,u){var w=h(s(new Uint8Array(g)));return u?j(w):w},T}()),Ut=Qe(gi);const Ot=[];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(Ot.indexOf(n)!==-1)return;Ot.push(n)}return n}static jsonStringify(e){if(!e)return"";const n=JSON.stringify(e,se.stringifyCircularHandler);return Ot.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 Ut.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 Ut.ArrayBuffer,C=new FileReader;function k(){const D=h*s,j=D+s>=i.size?i.size:D+s;C.readAsArrayBuffer(r.call(i,D,j))}C.onload=function(D){if(m.append(D.target?.result),h++,h<c)k();else{const j=m.end();n({isOK:!0,data:j})}},C.onerror=function(){const D=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(D),n({isOK:!1,data:D})},k()}static MD5(e,n=!1){return Ut.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=Ze(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}}class et{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","")}}class tt{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 mi=new tt("",localStorage);function no(){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 jt(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 nt(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function Ht(t){let e=t.toLowerCase();if(nt(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 qt(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 oo(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 Ft(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 Vt(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&&o.splice(o.indexOf(n)>>>0,1)},emit(e,n){(t?.get(e)||[]).slice().map(o=>{o(n)}),(t?.get("*")||[]).slice().map(o=>{o(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 we=Vt(),te={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},ot=(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)},ro=(t,e)=>{const n=JSON.stringify(t,null,2);e?ot(n,e+".json"):we.emit(te.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")};function io(t){const e=t.lastIndexOf("/")+1;let n=t.substring(e);return n=decodeURI(n.split("?")[0]),n}function so(t){return new Promise(e=>setTimeout(e,t))}var ao,Xt={exports:{}},co,lo,Gt,Kt=(ao||(ao=1,lo=Xt.exports,Gt=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(T,g){var u=T[g];if(typeof u.bind=="function")return u.bind(T);try{return Function.prototype.bind.call(u,T)}catch{return function(){return Function.prototype.apply.apply(u,[T,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(T){return T==="debug"&&(T="log"),typeof console!==e&&(T==="trace"&&n?c:console[T]!==void 0?s(console,T):console.log!==void 0?s(console,"log"):t)}function m(){for(var T=this.getLevel(),g=0;g<o.length;g++){var u=o[g];this[u]=g<T?t:this.methodFactory(u,T,this.name)}if(this.log=this.debug,typeof console===e&&T<this.levels.SILENT)return"No console available for logging"}function C(T){return function(){typeof console!==e&&(m.call(this),this[T].apply(this,arguments))}}function k(T,g,u){return h(T)||C.apply(this,arguments)}function D(T,g){var u,w,v,f=this,y="loglevel";function $(){var z;if(typeof window!==e&&y){try{z=window.localStorage[y]}catch{}if(typeof z===e)try{var N=window.document.cookie,O=encodeURIComponent(y),P=N.indexOf(O+"=");P!==-1&&(z=/^([^;]+)/.exec(N.slice(P+O.length+1))[1])}catch{}return f.levels[z]===void 0&&(z=void 0),z}}function A(z){var N=z;if(typeof N=="string"&&f.levels[N.toUpperCase()]!==void 0&&(N=f.levels[N.toUpperCase()]),typeof N=="number"&&N>=0&&N<=f.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+z)}typeof T=="string"?y+=":"+T:typeof T=="symbol"&&(y=void 0),f.name=T,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=g||k,f.getLevel=function(){return v??w??u},f.setLevel=function(z,N){return v=A(z),N!==!1&&function(O){var P=(o[O]||"silent").toUpperCase();if(typeof window!==e&&y){try{return void(window.localStorage[y]=P)}catch{}try{window.document.cookie=encodeURIComponent(y)+"="+P+";"}catch{}}}(v),m.call(f)},f.setDefaultLevel=function(z){w=A(z),$()||f.setLevel(z,!1)},f.resetLevel=function(){v=null,function(){if(typeof window!==e&&y){try{window.localStorage.removeItem(y)}catch{}try{window.document.cookie=encodeURIComponent(y)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),m.call(f)},f.enableAll=function(z){f.setLevel(f.levels.TRACE,z)},f.disableAll=function(z){f.setLevel(f.levels.SILENT,z)},f.rebuild=function(){if(i!==f&&(u=A(i.getLevel())),m.call(f),i===f)for(var z in r)r[z].rebuild()},u=A(i?i.getLevel():"WARN");var L=$();L!=null&&(v=A(L)),m.call(f)}(i=new D).getLogger=function(T){if(typeof T!="symbol"&&typeof T!="string"||T==="")throw new TypeError("You must supply a name when creating a logger.");var g=r[T];return g||(g=r[T]=new D(T,i.methodFactory)),g};var j=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=j),i},i.getLoggers=function(){return r},i.default=i,i},(co=Xt).exports?co.exports=Gt():lo.log=Gt()),Xt.exports);class uo{message;eventBus;constructor(e,n){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:we,DefaultProxyClient:null,Axios:si.default,Message:new uo(void 0,we),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?Kt.enableAll():Kt.setDefaultLevel("warn"),ho=!0);const e=t||"default";return Kt.getLogger(e)}},fo="access_token",fe=new tt("user",localStorage);function be(){return fe.get(fo)}function Yt(){fe.remove(fo)}function po(){return be()?.refresh}function Jt(t,e,n,o="json",r){const i={baseURL:W.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,paramsSerializer:{serialize:function(s){return ai.default.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+be()?.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&&(i.baseURL=e),i}function pe(t,e,n,o,r="json",i,s){const c=Jt(n,e,o,r,i);return s&&s>=2e4&&(c.timeout=s),W.Axios?.get(t,c).catch(function(h){rt(h,e,t,"Get")})}function rt(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(m>0&&C-m>2){const k=h.substring(m+2,C);k.indexOf("System.Exception")>0?t.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,t.message=k)}else i=!0,t.message=h}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 c={address:r,code:s,isExceptionInfo:i,message:t.message,result:t.response.data};if(W.EventBus.emit(te.AxiosRequestErrorEvent,c),i)throw new Error(t.message)}else{if(t?.message)throw new Error(t.message);console.error(t,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function go(t,e,n,o,r,i="json",s){const c=Jt(o,e,r,i);s&&s>=2e4&&(c.timeout=s),c.headers["Content-Type"]="multipart/form-data";const h=function(m){let C=new FormData;return m&&Object.keys(m).forEach(k=>{if(!m)return;let D=m[k];D!=null&&(Wt(D)?D.forEach(j=>{C.append(k,vo(j))}):C.append(k,vo(D)))}),C}(n);return W.Axios?.post(t,h,c).catch(function(m){rt(m,e,t,"Post")})}function mo(t,e,n,o,r,i="json",s){const c=Jt(o,e,r,i);return s&&s>=2e4&&(c.timeout=s),W.Axios?.post(t,n,c).catch(function(h){rt(h,e,t,"Post")})}function vo(t){return t instanceof Blob?t:t.toString()}var yo,wo,Zt,bo,Qt,_o,en,So,Co,it={exports:{}};function vi(){return wo?yo:(wo=1,t=typeof window<"u"?window:Ie!==void 0?Ie:typeof self<"u"?self:{},yo=t);var t}function yi(){if(bo)return Zt;bo=1,Zt=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 Zt}function wi(){if(_o)return Qt;_o=1;var t=function(e){return e.replace(/^\s+|\s+$/g,"")};return Qt=function(e){if(!e)return{};for(var n,o={},r=t(e).split(`
|
|
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},Qt}var bi=function(){if(Co)return it.exports;Co=1;var t=vi(),e=yi(),n=wi(),o=function(){if(So)return en;So=1,en=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 en}();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(z,N,O){h||(h=!0,c.callback(z,N,O))};function C(){var z=void 0;if(z=g.response?g.response:g.responseText||function(N){try{if(N.responseType==="document")return N.responseXML;var O=N.responseXML&&N.responseXML.documentElement.nodeName==="parsererror";if(N.responseType===""&&!O)return N.responseXML}catch{}return null}(g),A)try{z=JSON.parse(z)}catch{}return z}function k(z){return clearTimeout(u),z instanceof Error||(z=new Error(""+(z||"Unknown XMLHttpRequest Error"))),z.statusCode=0,m(z,L)}function D(){if(!T){var z;clearTimeout(u),z=c.useXDR&&g.status===void 0?200:g.status===1223?204:g.status;var N=L,O=null;return z!==0?(N={body:C(),statusCode:z,method:v,headers:{},url:w,rawRequest:g},g.getAllResponseHeaders&&(N.headers=n(g.getAllResponseHeaders()))):O=new Error("Internal XMLHttpRequest Error"),m(O,N,N.body)}}var j,T,g=c.xhr||null;g||(g=c.cors||c.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var u,w=g.url=c.uri||c.url,v=g.method=c.method||"GET",f=c.body||c.data,y=g.headers=c.headers||{},$=!!c.sync,A=!1,L={body:void 0,headers:{},statusCode:0,method:v,url:w,rawRequest:g};if("json"in c&&c.json!==!1&&(A=!0,y.accept||y.Accept||(y.Accept="application/json"),v!=="GET"&&v!=="HEAD"&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),f=JSON.stringify(c.json===!0?f:c.json))),g.onreadystatechange=function(){g.readyState===4&&setTimeout(D,0)},g.onload=D,g.onerror=k,g.onprogress=function(){},g.onabort=function(){T=!0},g.ontimeout=k,g.open(v,w,!$,c.username,c.password),$||(g.withCredentials=!!c.withCredentials),!$&&c.timeout>0&&(u=setTimeout(function(){if(!T){T=!0,g.abort("timeout");var z=new Error("XMLHttpRequest timeout");z.code="ETIMEDOUT",k(z)}},c.timeout)),g.setRequestHeader)for(j in y)y.hasOwnProperty(j)&&g.setRequestHeader(j,y[j]);else if(c.headers&&!function(z){for(var N in z)if(z.hasOwnProperty(N))return!1;return!0}(c.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in c&&(g.responseType=c.responseType),"beforeSend"in c&&typeof c.beforeSend=="function"&&c.beforeSend(g),g.send(f||null),g}return it.exports=i,it.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)}}),it.exports}(),_i=Qe(bi);const Si=[200,201,202,204,308],Ci=[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=Vt(),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=_i({...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&&Si.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&&Ci.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 Ei=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 je{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!et.isNullOrEmpty(e)){if(je.httpTransport||(je.httpTransport=new ii.HttpTransport),this.client=new Ve.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")):we.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 ze{hproseClient;hpProxyObj;defaultContext=new Ve.ClientContext;constructor(e){this.hproseClient=new je(e),this.hpProxyObj=null}getClientContext(e,n){const o={};n&&(o.requestHeaders=n);const r=be();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 Ve.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||we.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=be();return console.log(r,"userToken3"),r&&(n||(n=new Ve.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 tn=new Map;function ko(t){if(t&&et.isNotEmpty(t)){if(tn.has(t))return tn.get(t);{const e=new ze(t);return tn.set(t,e),e}}}const nn="is_LockScreen",xo=fe.get(nn,!1),Ae={isLock:xo,lockTime:xo=="true"?To():0};function Io(t){Ae.isLock=t,fe.set(nn,t,10),t&&(Yt(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function To(){let t=3600;return W.Config.UI?.LockTime&&W.Config.UI?.LockTime>=10&&(t=W.Config.UI.LockTime),t}let on;function rn(){clearInterval(on),!(window.location.href.indexOf("/login")>0||Ae.isLock)&&(Io(!1),Ae.lockTime=To(),on=setInterval(()=>{if(Ae.lockTime--,Ae.lockTime<=0)return Io(!0),clearInterval(on)},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 Ro,Po={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 gr,Cs=fr?pr.exports:(fr=1,pr.exports=function t(e,n,o){function r(a,l){if(!n[a]){if(!e[a]){if(!l&&Rn)return Rn(a);if(i)return i(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var b=n[a]={exports:{}};e[a][0].call(b.exports,function(S){var x=e[a][1][S];return r(x||S)},b,b.exports,t,e,n,o)}return n[a].exports}for(var i=Rn,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 a=0,l=new s(x),h=o.document.createTextNode("");l.observe(h,{characterData:!0}),r=function(){h.data=a=++a%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var T=o.document.createElement("script");T.onreadystatechange=function(){x(),T.onreadystatechange=null,T.parentNode.removeChild(T),T=null},o.document.documentElement.appendChild(T)}:function(){setTimeout(x,0)};else{var b=new o.MessageChannel;b.port1.onmessage=x,r=function(){b.port2.postMessage(0)}}var S=[];function x(){var T,g;i=!0;for(var u=S.length;u;){for(g=S,S=[],T=-1;++T<u;)g[T]();u=S.length}i=!1}function $(T){S.push(T)!==1||i||r()}e.exports=$}).call(this,ze!==void 0?ze:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,e,n){var o=t(1);function r(){}var i={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function h(d){if(typeof d!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,d!==r&&$(this,d)}function b(d,f,L){this.promise=d,typeof f=="function"&&(this.onFulfilled=f,this.callFulfilled=this.otherCallFulfilled),typeof L=="function"&&(this.onRejected=L,this.callRejected=this.otherCallRejected)}function S(d,f,L){o(function(){var D;try{D=f(L)}catch(N){return i.reject(d,N)}D===d?i.reject(d,new TypeError("Cannot resolve promise with itself")):i.resolve(d,D)})}function x(d){var f=d&&d.then;if(d&&(typeof d=="object"||typeof d=="function")&&typeof f=="function")return function(){f.apply(d,arguments)}}function $(d,f){var L=!1;function D(W){L||(L=!0,i.reject(d,W))}function N(W){L||(L=!0,i.resolve(d,W))}function P(){f(N,D)}var B=T(P);B.status==="error"&&D(B.value)}function T(d,f){var L={};try{L.value=d(f),L.status="success"}catch(D){L.status="error",L.value=D}return L}function g(d){return d instanceof this?d:i.resolve(new this(r),d)}function u(d){var f=new this(r);return i.reject(f,d)}function y(d){var f=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=d.length,D=!1;if(!L)return this.resolve([]);for(var N=new Array(L),P=0,B=-1,W=new this(r);++B<L;)R(d[B],B);return W;function R(U,V){function ne(J){N[V]=J,++P!==L||D||(D=!0,i.resolve(W,N))}f.resolve(U).then(ne,function(J){D||(D=!0,i.reject(W,J))})}}function w(d){var f=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=d.length,D=!1;if(!L)return this.resolve([]);for(var N=-1,P=new this(r);++N<L;)B(d[N]);return P;function B(W){f.resolve(W).then(function(R){D||(D=!0,i.resolve(P,R))},function(R){D||(D=!0,i.reject(P,R))})}}e.exports=h,h.prototype.catch=function(d){return this.then(null,d)},h.prototype.then=function(d,f){if(typeof d!="function"&&this.state===a||typeof f!="function"&&this.state===s)return this;var L=new this.constructor(r);return this.state!==l?S(L,this.state===a?d:f,this.outcome):this.queue.push(new b(L,d,f)),L},b.prototype.callFulfilled=function(d){i.resolve(this.promise,d)},b.prototype.otherCallFulfilled=function(d){S(this.promise,this.onFulfilled,d)},b.prototype.callRejected=function(d){i.reject(this.promise,d)},b.prototype.otherCallRejected=function(d){S(this.promise,this.onRejected,d)},i.resolve=function(d,f){var L=T(x,f);if(L.status==="error")return i.reject(d,L.value);var D=L.value;if(D)$(d,D);else{d.state=a,d.outcome=f;for(var N=-1,P=d.queue.length;++N<P;)d.queue[N].callFulfilled(f)}return d},i.reject=function(d,f){d.state=s,d.outcome=f;for(var L=-1,D=d.queue.length;++L<D;)d.queue[L].callRejected(f);return d},h.resolve=g,h.reject=u,h.all=y,h.race=w},{1:1}],3:[function(t,e,n){(function(o){typeof o.Promise!="function"&&(o.Promise=t(2))}).call(this,ze!==void 0?ze: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(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function r(c,m){if(!(c 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 c=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(!c||m)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function l(c,m){c=c||[],m=m||{};try{return new Blob(c,m)}catch(_){if(_.name!=="TypeError")throw _;for(var v=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),C=0;C<c.length;C+=1)v.append(c[C]);return v.getBlob(m.type)}}typeof Promise>"u"&&t(3);var h=Promise;function b(c,m){m&&c.then(function(v){m(null,v)},function(v){m(v)})}function S(c,m,v){typeof m=="function"&&c.then(m),typeof v=="function"&&c.catch(v)}function x(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function $(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var T="local-forage-detect-blob-support",g=void 0,u={},y=Object.prototype.toString,w="readonly",d="readwrite";function f(c){for(var m=c.length,v=new ArrayBuffer(m),C=new Uint8Array(v),_=0;_<m;_++)C[_]=c.charCodeAt(_);return v}function L(c){return new h(function(m){var v=c.transaction(T,d),C=l([""]);v.objectStore(T).put(C,"key"),v.onabort=function(_){_.preventDefault(),_.stopPropagation(),m(!1)},v.oncomplete=function(){var _=navigator.userAgent.match(/Chrome\/(\d+)/),E=navigator.userAgent.match(/Edge\//);m(E||!_||parseInt(_[1],10)>=43)}}).catch(function(){return!1})}function D(c){return typeof g=="boolean"?h.resolve(g):L(c).then(function(m){return g=m})}function N(c){var m=u[c.name],v={};v.promise=new h(function(C,_){v.resolve=C,v.reject=_}),m.deferredOperations.push(v),m.dbReady?m.dbReady=m.dbReady.then(function(){return v.promise}):m.dbReady=v.promise}function P(c){var m=u[c.name].deferredOperations.pop();if(m)return m.resolve(),m.promise}function B(c,m){var v=u[c.name].deferredOperations.pop();if(v)return v.reject(m),v.promise}function W(c,m){return new h(function(v,C){if(u[c.name]=u[c.name]||pe(),c.db){if(!m)return v(c.db);N(c),c.db.close()}var _=[c.name];m&&_.push(c.version);var E=s.open.apply(s,_);m&&(E.onupgradeneeded=function(k){var M=E.result;try{M.createObjectStore(c.storeName),k.oldVersion<=1&&M.createObjectStore(T)}catch(z){if(z.name!=="ConstraintError")throw z;console.warn('The database "'+c.name+'" has been upgraded from version '+k.oldVersion+" to version "+k.newVersion+', but the storage "'+c.storeName+'" already exists.')}}),E.onerror=function(k){k.preventDefault(),C(E.error)},E.onsuccess=function(){var k=E.result;k.onversionchange=function(M){M.target.close()},v(k),P(c)}})}function R(c){return W(c,!1)}function U(c){return W(c,!0)}function V(c,m){if(!c.db)return!0;var v=!c.db.objectStoreNames.contains(c.storeName),C=c.version<c.db.version,_=c.version>c.db.version;if(C&&(c.version!==m&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),_||v){if(v){var E=c.db.version+1;E>c.version&&(c.version=E)}return!0}return!1}function ne(c){return new h(function(m,v){var C=new FileReader;C.onerror=v,C.onloadend=function(_){var E=btoa(_.target.result||"");m({__local_forage_encoded_blob:!0,data:E,type:c.type})},C.readAsBinaryString(c)})}function J(c){return l([f(atob(c.data))],{type:c.type})}function Y(c){return c&&c.__local_forage_encoded_blob}function fe(c){var m=this,v=m._initReady().then(function(){var C=u[m._dbInfo.name];if(C&&C.dbReady)return C.dbReady});return S(v,c,c),v}function Re(c){N(c);for(var m=u[c.name],v=m.forages,C=0;C<v.length;C++){var _=v[C];_._dbInfo.db&&(_._dbInfo.db.close(),_._dbInfo.db=null)}return c.db=null,R(c).then(function(E){return c.db=E,V(c)?U(c):E}).then(function(E){c.db=m.db=E;for(var k=0;k<v.length;k++)v[k]._dbInfo.db=E}).catch(function(E){throw B(c,E),E})}function Q(c,m,v,C){C===void 0&&(C=1);try{var _=c.db.transaction(c.storeName,m);v(null,_)}catch(E){if(C>0&&(!c.db||E.name==="InvalidStateError"||E.name==="NotFoundError"))return h.resolve().then(function(){if(!c.db||E.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),U(c)}).then(function(){return Re(c).then(function(){Q(c,m,v,C-1)})}).catch(v);v(E)}}function pe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ht(c){var m=this,v={db:null};if(c)for(var C in c)v[C]=c[C];var _=u[v.name];_||(_=pe(),u[v.name]=_),_.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=fe);var E=[];function k(){return h.resolve()}for(var M=0;M<_.forages.length;M++){var z=_.forages[M];z!==m&&E.push(z._initReady().catch(k))}var A=_.forages.slice(0);return h.all(E).then(function(){return v.db=_.db,R(v)}).then(function(j){return v.db=j,V(v,m._defaultConfig.version)?U(v):j}).then(function(j){v.db=_.db=j,m._dbInfo=v;for(var F=0;F<A.length;F++){var q=A[F];q!==m&&(q._dbInfo.db=v.db,q._dbInfo.version=v.version)}})}function qt(c,m){var v=this;c=x(c);var C=new h(function(_,E){v.ready().then(function(){Q(v._dbInfo,w,function(k,M){if(k)return E(k);try{var z=M.objectStore(v._dbInfo.storeName).get(c);z.onsuccess=function(){var A=z.result;A===void 0&&(A=null),Y(A)&&(A=J(A)),_(A)},z.onerror=function(){E(z.error)}}catch(A){E(A)}})}).catch(E)});return b(C,m),C}function Vt(c,m){var v=this,C=new h(function(_,E){v.ready().then(function(){Q(v._dbInfo,w,function(k,M){if(k)return E(k);try{var z=M.objectStore(v._dbInfo.storeName).openCursor(),A=1;z.onsuccess=function(){var j=z.result;if(j){var F=j.value;Y(F)&&(F=J(F));var q=c(F,j.key,A++);q!==void 0?_(q):j.continue()}else _()},z.onerror=function(){E(z.error)}}catch(j){E(j)}})}).catch(E)});return b(C,m),C}function et(c,m,v){var C=this;c=x(c);var _=new h(function(E,k){var M;C.ready().then(function(){return M=C._dbInfo,y.call(m)==="[object Blob]"?D(M.db).then(function(z){return z?m:ne(m)}):m}).then(function(z){Q(C._dbInfo,d,function(A,j){if(A)return k(A);try{var F=j.objectStore(C._dbInfo.storeName);z===null&&(z=void 0);var q=F.put(z,c);j.oncomplete=function(){z===void 0&&(z=null),E(z)},j.onabort=j.onerror=function(){var X=q.error?q.error:q.transaction.error;k(X)}}catch(X){k(X)}})}).catch(k)});return b(_,v),_}function Ne(c,m){var v=this;c=x(c);var C=new h(function(_,E){v.ready().then(function(){Q(v._dbInfo,d,function(k,M){if(k)return E(k);try{var z=M.objectStore(v._dbInfo.storeName).delete(c);M.oncomplete=function(){_()},M.onerror=function(){E(z.error)},M.onabort=function(){var A=z.error?z.error:z.transaction.error;E(A)}}catch(A){E(A)}})}).catch(E)});return b(C,m),C}function $e(c){var m=this,v=new h(function(C,_){m.ready().then(function(){Q(m._dbInfo,d,function(E,k){if(E)return _(E);try{var M=k.objectStore(m._dbInfo.storeName).clear();k.oncomplete=function(){C()},k.onabort=k.onerror=function(){var z=M.error?M.error:M.transaction.error;_(z)}}catch(z){_(z)}})}).catch(_)});return b(v,c),v}function ue(c){var m=this,v=new h(function(C,_){m.ready().then(function(){Q(m._dbInfo,w,function(E,k){if(E)return _(E);try{var M=k.objectStore(m._dbInfo.storeName).count();M.onsuccess=function(){C(M.result)},M.onerror=function(){_(M.error)}}catch(z){_(z)}})}).catch(_)});return b(v,c),v}function tt(c,m){var v=this,C=new h(function(_,E){c<0?_(null):v.ready().then(function(){Q(v._dbInfo,w,function(k,M){if(k)return E(k);try{var z=M.objectStore(v._dbInfo.storeName),A=!1,j=z.openKeyCursor();j.onsuccess=function(){var F=j.result;F?c===0||A?_(F.key):(A=!0,F.advance(c)):_(null)},j.onerror=function(){E(j.error)}}catch(F){E(F)}})}).catch(E)});return b(C,m),C}function nt(c){var m=this,v=new h(function(C,_){m.ready().then(function(){Q(m._dbInfo,w,function(E,k){if(E)return _(E);try{var M=k.objectStore(m._dbInfo.storeName).openKeyCursor(),z=[];M.onsuccess=function(){var A=M.result;A?(z.push(A.key),A.continue()):C(z)},M.onerror=function(){_(M.error)}}catch(A){_(A)}})}).catch(_)});return b(v,c),v}function Be(c,m){m=$.apply(this,arguments);var v=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||v.name,c.storeName=c.storeName||v.storeName);var C,_=this;if(c.name){var E=c.name===v.name&&_._dbInfo.db?h.resolve(_._dbInfo.db):R(c).then(function(k){var M=u[c.name],z=M.forages;M.db=k;for(var A=0;A<z.length;A++)z[A]._dbInfo.db=k;return k});C=c.storeName?E.then(function(k){if(k.objectStoreNames.contains(c.storeName)){var M=k.version+1;N(c);var z=u[c.name],A=z.forages;k.close();for(var j=0;j<A.length;j++){var F=A[j];F._dbInfo.db=null,F._dbInfo.version=M}var q=new h(function(X,G){var oe=s.open(c.name,M);oe.onerror=function(ge){oe.result.close(),G(ge)},oe.onupgradeneeded=function(){oe.result.deleteObjectStore(c.storeName)},oe.onsuccess=function(){var ge=oe.result;ge.close(),X(ge)}});return q.then(function(X){z.db=X;for(var G=0;G<A.length;G++){var oe=A[G];oe._dbInfo.db=X,P(oe._dbInfo)}}).catch(function(X){throw(B(c,X)||h.resolve()).catch(function(){}),X})}}):E.then(function(k){N(c);var M=u[c.name],z=M.forages;k.close();for(var A=0;A<z.length;A++)z[A]._dbInfo.db=null;var j=new h(function(F,q){var X=s.deleteDatabase(c.name);X.onerror=function(){var G=X.result;G&&G.close(),q(X.error)},X.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},X.onsuccess=function(){var G=X.result;G&&G.close(),F(G)}});return j.then(function(F){M.db=F;for(var q=0;q<z.length;q++)P(z[q]._dbInfo)}).catch(function(F){throw(B(c,F)||h.resolve()).catch(function(){}),F})})}else C=h.reject("Invalid arguments");return b(C,m),C}var ot={_driver:"asyncStorage",_initStorage:Ht,_support:a(),iterate:Vt,getItem:qt,setItem:et,removeItem:Ne,clear:$e,length:ue,key:tt,keys:nt,dropInstance:Be};function je(){return typeof openDatabase=="function"}var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vi="~~local_forage_type~",po=/^~~local_forage_type~([^~]+)~/,rt="__lfsc__:",Xt=rt.length,Gt="arbf",Kt="blob",go="si08",mo="ui08",vo="uic8",yo="si16",wo="si32",bo="ur16",_o="ui32",So="fl32",Co="fl64",Eo=Xt+Gt.length,ko=Object.prototype.toString;function xo(c){var m,v,C,_,E,k=.75*c.length,M=c.length,z=0;c[c.length-1]==="="&&(k--,c[c.length-2]==="="&&k--);var A=new ArrayBuffer(k),j=new Uint8Array(A);for(m=0;m<M;m+=4)v=he.indexOf(c[m]),C=he.indexOf(c[m+1]),_=he.indexOf(c[m+2]),E=he.indexOf(c[m+3]),j[z++]=v<<2|C>>4,j[z++]=(15&C)<<4|_>>2,j[z++]=(3&_)<<6|63&E;return A}function Jt(c){var m,v=new Uint8Array(c),C="";for(m=0;m<v.length;m+=3)C+=he[v[m]>>2],C+=he[(3&v[m])<<4|v[m+1]>>4],C+=he[(15&v[m+1])<<2|v[m+2]>>6],C+=he[63&v[m+2]];return v.length%3==2?C=C.substring(0,C.length-1)+"=":v.length%3==1&&(C=C.substring(0,C.length-2)+"=="),C}function yi(c,m){var v="";if(c&&(v=ko.call(c)),c&&(v==="[object ArrayBuffer]"||c.buffer&&ko.call(c.buffer)==="[object ArrayBuffer]")){var C,_=rt;c instanceof ArrayBuffer?(C=c,_+=Gt):(C=c.buffer,v==="[object Int8Array]"?_+=go:v==="[object Uint8Array]"?_+=mo:v==="[object Uint8ClampedArray]"?_+=vo:v==="[object Int16Array]"?_+=yo:v==="[object Uint16Array]"?_+=bo:v==="[object Int32Array]"?_+=wo:v==="[object Uint32Array]"?_+=_o:v==="[object Float32Array]"?_+=So:v==="[object Float64Array]"?_+=Co:m(new Error("Failed to get type for BinaryArray"))),m(_+Jt(C))}else if(v==="[object Blob]"){var E=new FileReader;E.onload=function(){var k=vi+c.type+"~"+Jt(this.result);m(rt+Kt+k)},E.readAsArrayBuffer(c)}else try{m(JSON.stringify(c))}catch(k){console.error("Couldn't convert value into a JSON string: ",c),m(null,k)}}function wi(c){if(c.substring(0,Xt)!==rt)return JSON.parse(c);var m,v=c.substring(Eo),C=c.substring(Xt,Eo);if(C===Kt&&po.test(v)){var _=v.match(po);m=_[1],v=v.substring(_[0].length)}var E=xo(v);switch(C){case Gt:return E;case Kt:return l([E],{type:m});case go:return new Int8Array(E);case mo:return new Uint8Array(E);case vo:return new Uint8ClampedArray(E);case yo:return new Int16Array(E);case bo:return new Uint16Array(E);case wo:return new Int32Array(E);case _o:return new Uint32Array(E);case So:return new Float32Array(E);case Co:return new Float64Array(E);default:throw new Error("Unkown type: "+C)}}var Yt={serialize:yi,deserialize:wi,stringToBuffer:xo,bufferToString:Jt};function Io(c,m,v,C){c.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],v,C)}function bi(c){var m=this,v={db:null};if(c)for(var C in c)v[C]=typeof c[C]!="string"?c[C].toString():c[C];var _=new h(function(E,k){try{v.db=openDatabase(v.name,String(v.version),v.description,v.size)}catch(M){return k(M)}v.db.transaction(function(M){Io(M,v,function(){m._dbInfo=v,E()},function(z,A){k(A)})},k)});return v.serializer=Yt,_}function ye(c,m,v,C,_,E){c.executeSql(v,C,_,function(k,M){M.code===M.SYNTAX_ERR?k.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(z,A){A.rows.length?E(z,M):Io(z,m,function(){z.executeSql(v,C,_,E)},E)},E):E(k,M)},E)}function _i(c,m){var v=this;c=x(c);var C=new h(function(_,E){v.ready().then(function(){var k=v._dbInfo;k.db.transaction(function(M){ye(M,k,"SELECT * FROM "+k.storeName+" WHERE key = ? LIMIT 1",[c],function(z,A){var j=A.rows.length?A.rows.item(0).value:null;j&&(j=k.serializer.deserialize(j)),_(j)},function(z,A){E(A)})})}).catch(E)});return b(C,m),C}function Si(c,m){var v=this,C=new h(function(_,E){v.ready().then(function(){var k=v._dbInfo;k.db.transaction(function(M){ye(M,k,"SELECT * FROM "+k.storeName,[],function(z,A){for(var j=A.rows,F=j.length,q=0;q<F;q++){var X=j.item(q),G=X.value;if(G&&(G=k.serializer.deserialize(G)),(G=c(G,X.key,q+1))!==void 0)return void _(G)}_()},function(z,A){E(A)})})}).catch(E)});return b(C,m),C}function To(c,m,v,C){var _=this;c=x(c);var E=new h(function(k,M){_.ready().then(function(){m===void 0&&(m=null);var z=m,A=_._dbInfo;A.serializer.serialize(m,function(j,F){F?M(F):A.db.transaction(function(q){ye(q,A,"INSERT OR REPLACE INTO "+A.storeName+" (key, value) VALUES (?, ?)",[c,j],function(){k(z)},function(X,G){M(G)})},function(q){if(q.code===q.QUOTA_ERR){if(C>0)return void k(To.apply(_,[c,z,v,C-1]));M(q)}})})}).catch(M)});return b(E,v),E}function Ci(c,m,v){return To.apply(this,[c,m,v,1])}function Ei(c,m){var v=this;c=x(c);var C=new h(function(_,E){v.ready().then(function(){var k=v._dbInfo;k.db.transaction(function(M){ye(M,k,"DELETE FROM "+k.storeName+" WHERE key = ?",[c],function(){_()},function(z,A){E(A)})})}).catch(E)});return b(C,m),C}function ki(c){var m=this,v=new h(function(C,_){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(k){ye(k,E,"DELETE FROM "+E.storeName,[],function(){C()},function(M,z){_(z)})})}).catch(_)});return b(v,c),v}function xi(c){var m=this,v=new h(function(C,_){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(k){ye(k,E,"SELECT COUNT(key) as c FROM "+E.storeName,[],function(M,z){var A=z.rows.item(0).c;C(A)},function(M,z){_(z)})})}).catch(_)});return b(v,c),v}function Ii(c,m){var v=this,C=new h(function(_,E){v.ready().then(function(){var k=v._dbInfo;k.db.transaction(function(M){ye(M,k,"SELECT key FROM "+k.storeName+" WHERE id = ? LIMIT 1",[c+1],function(z,A){var j=A.rows.length?A.rows.item(0).key:null;_(j)},function(z,A){E(A)})})}).catch(E)});return b(C,m),C}function Ti(c){var m=this,v=new h(function(C,_){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(k){ye(k,E,"SELECT key FROM "+E.storeName,[],function(M,z){for(var A=[],j=0;j<z.rows.length;j++)A.push(z.rows.item(j).key);C(A)},function(M,z){_(z)})})}).catch(_)});return b(v,c),v}function Ri(c){return new h(function(m,v){c.transaction(function(C){C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(_,E){for(var k=[],M=0;M<E.rows.length;M++)k.push(E.rows.item(M).name);m({db:c,storeNames:k})},function(_,E){v(E)})},function(C){v(C)})})}function Mi(c,m){m=$.apply(this,arguments);var v=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||v.name,c.storeName=c.storeName||v.storeName);var C,_=this;return C=c.name?new h(function(E){var k;k=c.name===v.name?_._dbInfo.db:openDatabase(c.name,"","",0),c.storeName?E({db:k,storeNames:[c.storeName]}):E(Ri(k))}).then(function(E){return new h(function(k,M){E.db.transaction(function(z){function A(X){return new h(function(G,oe){z.executeSql("DROP TABLE IF EXISTS "+X,[],function(){G()},function(ge,en){oe(en)})})}for(var j=[],F=0,q=E.storeNames.length;F<q;F++)j.push(A(E.storeNames[F]));h.all(j).then(function(){k()}).catch(function(X){M(X)})},function(z){M(z)})})}):h.reject("Invalid arguments"),b(C,m),C}var Pi={_driver:"webSQLStorage",_initStorage:bi,_support:je(),iterate:Si,getItem:_i,setItem:Ci,removeItem:Ei,clear:ki,length:xi,key:Ii,keys:Ti,dropInstance:Mi};function zi(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Ro(c,m){var v=c.name+"/";return c.storeName!==m.storeName&&(v+=c.storeName+"/"),v}function Li(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch{return!0}}function Ai(){return!Li()||localStorage.length>0}function Di(c){var m=this,v={};if(c)for(var C in c)v[C]=c[C];return v.keyPrefix=Ro(c,m._defaultConfig),Ai()?(m._dbInfo=v,v.serializer=Yt,h.resolve()):h.reject()}function Ni(c){var m=this,v=m.ready().then(function(){for(var C=m._dbInfo.keyPrefix,_=localStorage.length-1;_>=0;_--){var E=localStorage.key(_);E.indexOf(C)===0&&localStorage.removeItem(E)}});return b(v,c),v}function $i(c,m){var v=this;c=x(c);var C=v.ready().then(function(){var _=v._dbInfo,E=localStorage.getItem(_.keyPrefix+c);return E&&(E=_.serializer.deserialize(E)),E});return b(C,m),C}function Bi(c,m){var v=this,C=v.ready().then(function(){for(var _=v._dbInfo,E=_.keyPrefix,k=E.length,M=localStorage.length,z=1,A=0;A<M;A++){var j=localStorage.key(A);if(j.indexOf(E)===0){var F=localStorage.getItem(j);if(F&&(F=_.serializer.deserialize(F)),(F=c(F,j.substring(k),z++))!==void 0)return F}}});return b(C,m),C}function ji(c,m){var v=this,C=v.ready().then(function(){var _,E=v._dbInfo;try{_=localStorage.key(c)}catch{_=null}return _&&(_=_.substring(E.keyPrefix.length)),_});return b(C,m),C}function Oi(c){var m=this,v=m.ready().then(function(){for(var C=m._dbInfo,_=localStorage.length,E=[],k=0;k<_;k++){var M=localStorage.key(k);M.indexOf(C.keyPrefix)===0&&E.push(M.substring(C.keyPrefix.length))}return E});return b(v,c),v}function Wi(c){var m=this.keys().then(function(v){return v.length});return b(m,c),m}function Ui(c,m){var v=this;c=x(c);var C=v.ready().then(function(){var _=v._dbInfo;localStorage.removeItem(_.keyPrefix+c)});return b(C,m),C}function Fi(c,m,v){var C=this;c=x(c);var _=C.ready().then(function(){m===void 0&&(m=null);var E=m;return new h(function(k,M){var z=C._dbInfo;z.serializer.serialize(m,function(A,j){if(j)M(j);else try{localStorage.setItem(z.keyPrefix+c,A),k(E)}catch(F){F.name!=="QuotaExceededError"&&F.name!=="NS_ERROR_DOM_QUOTA_REACHED"||M(F),M(F)}})})});return b(_,v),_}function Hi(c,m){if(m=$.apply(this,arguments),!(c=typeof c!="function"&&c||{}).name){var v=this.config();c.name=c.name||v.name,c.storeName=c.storeName||v.storeName}var C,_=this;return C=c.name?new h(function(E){c.storeName?E(Ro(c,_._defaultConfig)):E(c.name+"/")}).then(function(E){for(var k=localStorage.length-1;k>=0;k--){var M=localStorage.key(k);M.indexOf(E)===0&&localStorage.removeItem(M)}}):h.reject("Invalid arguments"),b(C,m),C}var qi={_driver:"localStorageWrapper",_initStorage:Di,_support:zi(),iterate:Bi,getItem:$i,setItem:Fi,removeItem:Ui,clear:Ni,length:Wi,key:ji,keys:Oi,dropInstance:Hi},Vi=function(c,m){return c===m||typeof c=="number"&&typeof m=="number"&&isNaN(c)&&isNaN(m)},Xi=function(c,m){for(var v=c.length,C=0;C<v;){if(Vi(c[C],m))return!0;C++}return!1},Mo=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},Oe={},Po={},Me={INDEXEDDB:ot,WEBSQL:Pi,LOCALSTORAGE:qi},Gi=[Me.INDEXEDDB._driver,Me.WEBSQL._driver,Me.LOCALSTORAGE._driver],it=["dropInstance"],Zt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(it),Ki={description:"",driver:Gi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ji(c,m){c[m]=function(){var v=arguments;return c.ready().then(function(){return c[m].apply(c,v)})}}function Qt(){for(var c=1;c<arguments.length;c++){var m=arguments[c];if(m)for(var v in m)m.hasOwnProperty(v)&&(Mo(m[v])?arguments[0][v]=m[v].slice():arguments[0][v]=m[v])}return arguments[0]}var Yi=function(){function c(m){for(var v in r(this,c),Me)if(Me.hasOwnProperty(v)){var C=Me[v],_=C._driver;this[v]=_,Oe[_]||this.defineDriver(C)}this._defaultConfig=Qt({},Ki),this._config=Qt({},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 c.prototype.config=function(m){if((m===void 0?"undefined":o(m))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var v in m){if(v==="storeName"&&(m[v]=m[v].replace(/\W/g,"_")),v==="version"&&typeof m[v]!="number")return new Error("Database version must be a number.");this._config[v]=m[v]}return!("driver"in m)||!m.driver||this.setDriver(this._config.driver)}return typeof m=="string"?this._config[m]:this._config},c.prototype.defineDriver=function(m,v,C){var _=new h(function(E,k){try{var M=m._driver,z=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!m._driver)return void k(z);for(var A=Zt.concat("_initStorage"),j=0,F=A.length;j<F;j++){var q=A[j];if((!Xi(it,q)||m[q])&&typeof m[q]!="function")return void k(z)}var X=function(){for(var oe=function(Qi){return function(){var es=new Error("Method "+Qi+" is not implemented by the current driver"),zo=h.reject(es);return b(zo,arguments[arguments.length-1]),zo}},ge=0,en=it.length;ge<en;ge++){var tn=it[ge];m[tn]||(m[tn]=oe(tn))}};X();var G=function(oe){Oe[M]&&console.info("Redefining LocalForage driver: "+M),Oe[M]=m,Po[M]=oe,E()};"_support"in m?m._support&&typeof m._support=="function"?m._support().then(G,k):G(!!m._support):G(!0)}catch(oe){k(oe)}});return S(_,v,C),_},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(m,v,C){var _=Oe[m]?h.resolve(Oe[m]):h.reject(new Error("Driver not found."));return S(_,v,C),_},c.prototype.getSerializer=function(m){var v=h.resolve(Yt);return S(v,m),v},c.prototype.ready=function(m){var v=this,C=v._driverSet.then(function(){return v._ready===null&&(v._ready=v._initDriver()),v._ready});return S(C,m,m),C},c.prototype.setDriver=function(m,v,C){var _=this;Mo(m)||(m=[m]);var E=this._getSupportedDrivers(m);function k(){_._config.driver=_.driver()}function M(j){return _._extend(j),k(),_._ready=_._initStorage(_._config),_._ready}function z(j){return function(){var F=0;function q(){for(;F<j.length;){var X=j[F];return F++,_._dbInfo=null,_._ready=null,_.getDriver(X).then(M).catch(q)}k();var G=new Error("No available storage method found.");return _._driverSet=h.reject(G),_._driverSet}return q()}}var A=this._driverSet!==null?this._driverSet.catch(function(){return h.resolve()}):h.resolve();return this._driverSet=A.then(function(){var j=E[0];return _._dbInfo=null,_._ready=null,_.getDriver(j).then(function(F){_._driver=F._driver,k(),_._wrapLibraryMethodsWithReady(),_._initDriver=z(E)})}).catch(function(){k();var j=new Error("No available storage method found.");return _._driverSet=h.reject(j),_._driverSet}),S(this._driverSet,v,C),this._driverSet},c.prototype.supports=function(m){return!!Po[m]},c.prototype._extend=function(m){Qt(this,m)},c.prototype._getSupportedDrivers=function(m){for(var v=[],C=0,_=m.length;C<_;C++){var E=m[C];this.supports(E)&&v.push(E)}return v},c.prototype._wrapLibraryMethodsWithReady=function(){for(var m=0,v=Zt.length;m<v;m++)Ji(this,Zt[m])},c.prototype.createInstance=function(m){return new c(m)},c}(),Zi=new Yi;e.exports=Zi},{3:3}]},{},[4])(4)),bt=ft(Cs),mr={exports:{}},Es=(gr||(gr=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 a=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",l={createWriteStream:function(b,S,x){let $={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},T=0,g=null,u=null,y=null;if(Number.isFinite(S)?([x,S]=[S,x],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),$.size=x,$.writableStrategy=S):S&&S.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),$.size=x,$.writableStrategy=S):$=S||{},!s){n||(n=i?h(l.mitm):function(L){const D="width=200,height=100",N=document.createDocumentFragment(),P={frame:e.open(L,"popup",D),loaded:!1,isIframe:!1,isPopup:!0,remove(){P.frame.close()},addEventListener(...W){N.addEventListener(...W)},dispatchEvent(...W){N.dispatchEvent(...W)},removeEventListener(...W){N.removeEventListener(...W)},postMessage(...W){P.frame.postMessage(...W)}},B=W=>{W.source===P.frame&&(P.loaded=!0,e.removeEventListener("message",B),P.dispatchEvent(new Event("load")))};return e.addEventListener("message",B),P}(l.mitm)),u=new MessageChannel,b=encodeURIComponent(b.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const d={transferringReadable:o,pathname:$.pathname||Math.random().toString().slice(-6)+"/"+b,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+b}};$.size&&(d.headers["Content-Length"]=$.size);const f=[d,"*",[u.port2]];if(o){const L=a==="iframe"?void 0:{transform(N,P){if(!(N instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");T+=N.length,P.enqueue(N),g&&(location.href=g,g=null)},flush(){g&&(location.href=g)}};y=new l.TransformStream(L,$.writableStrategy,$.readableStrategy);const D=y.readable;u.port1.postMessage({readableStream:D},[D])}u.port1.onmessage=L=>{L.data.download?a==="navigate"?(n.remove(),n=null,T?location.href=L.data.download:g=L.data.download):(n.isPopup&&(n.remove(),n=null,a==="iframe"&&h(l.mitm)),h(L.data.download)):L.data.abort&&(w=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...f):n.addEventListener("load",()=>{n.postMessage(...f)},{once:!0})}let w=[];return!s&&y&&y.writable||new l.WritableStream({write(d){if(!(d instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?w.push(d):(u.port1.postMessage(d),T+=d.length,g&&(location.href=g,g=null))},close(){if(s){const d=new Blob(w,{type:"application/octet-stream; charset=utf-8"}),f=document.createElement("a");f.href=URL.createObjectURL(d),f.download=b,f.click()}else u.port1.postMessage("end")},abort(){w=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},$.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 h(b){if(!b)throw new Error("meh");const S=document.createElement("iframe");return S.hidden=!0,S.src=b,S.loaded=!1,S.name="iframe",S.isIframe=!0,S.postMessage=(...x)=>S.contentWindow.postMessage(...x),S.addEventListener("load",()=>{S.loaded=!0},{once:!0}),document.body.appendChild(S),S}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(b=>{try{b()}catch{}})(()=>{const{readable:b}=new TransformStream,S=new MessageChannel;S.port1.postMessage(b,[b]),S.port1.close(),S.port2.close(),o=!0,Object.defineProperty(l,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),l})}(mr)),mr.exports),ks=ft(Es);function xs(t,e){const n=`${t}_${e}`;return ae.MD5(n)}function vr(t){const e=function(a){if(!a)return;const l=a,h=[];if(l)for(let b of l){const S=yr(b);S&&h.push(S)}return h}(t.bussinessRoutes),n=function(a){if(!a)return;const l=a;if(l&&l.length>0){const h=[];return l.forEach(b=>{const S=wr(b);S&&h.push(S)}),h}}(t.widgetMenuConfig),o=function(a){if(a&&a.length>0){const l=[];return a.forEach(h=>{const b=function(S){return S?{id:S.id,label:S.label,container:S.container,preload:S.preload,afterid:S.afterid,bindid:S.bindid,group:S.group}:void 0}(h);b&&l.push(b)}),l}}(t.widgetConfig),r=function(a){if(a&&a.length>0)return a}(t.functionList),i=t.pkgObject.version,s=t.pkgObject.name;return{id:xs(s,i),name:O.Config.UI.SiteTitle,group:O.Config.UI.Group,product:s,version:i,routes:e,widgetMenu:n,widgets:o,functions:r}}function yr(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=yr(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function wr(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=wr(n);o&&e.children?.push(o)})),e}function Mn(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 br=!0;try{String.fromCharCode.apply(String,[1,2])}catch{br=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var Pn=2654435769;function _r(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 _t(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 Ce(t){return 4294967295&t}function St(t,e,n,o,r,i){return(n>>>5^e<<2)+(e>>>3^n<<4)^(t^e)+(i[3&o^r]^n)}function Sr(t){if(t.length<16){var e=new Uint8Array(16);e.set(t),t=e}return t}function Ct(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 a=65536+((1023&i)<<10|1023&s);n[o++]=240|a>>18,n[o++]=128|a>>12&63,n[o++]=128|a>>6&63,n[o++]=128|63&a,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 Cr(t){var e=t.length;return e===0?"":e<32767?function(n,o){for(var r=new Array(o),i=0,s=0,a=n.length;i<o&&s<a;i++){var l=n[s++];switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=l;break;case 12:case 13:if(!(s<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&l)<<6|63&n[s++];break;case 14:if(!(s+1<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&l)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<a))throw new Error("Unfinished UTF-8 octet sequence");var h=((7&l)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=h&&h<=1048575))throw new Error("Character outside valid Unicode range: 0x"+h.toString(16));r[i++]=h>>10&1023|55296,r[i]=1023&h|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+l.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,a=0,l=n.length;s<o&&a<l;s++){var h=n[a++];switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=h;break;case 12:case 13:if(!(a<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&h)<<6|63&n[a++];break;case 14:if(!(a+1<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&h)<<12|(63&n[a++])<<6|63&n[a++];break;case 15:if(!(a+2<l))throw new Error("Unfinished UTF-8 octet sequence");var b=((7&h)<<18|(63&n[a++])<<12|(63&n[a++])<<6|63&n[a++])-65536;if(!(0<=b&&b<=1048575))throw new Error("Character outside valid Unicode range: 0x"+b.toString(16));i[s++]=b>>10&1023|55296,i[s]=1023&b|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+h.toString(16))}if(s>=32766){var S=s+1;i.length=S,r.push(String.fromCharCode.apply(String,i)),o-=S,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(t,e)}function Is(t){var e=t.length;if(e===0)return"";var n=br?t:function(a){for(var l=a.length,h=new Array(a.length),b=0;b<l;++b)h[b]=a[b];return h}(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 Er(t,e){return typeof t=="string"&&(t=Ct(t)),typeof e=="string"&&(e=Ct(e)),t==null||t.length===0?t:_r(function(n,o){var r,i,s,a,l,h,b=n.length,S=b-1;for(i=n[S],s=0,h=0|Math.floor(6+52/b);h>0;--h){for(a=(s=Ce(s+Pn))>>>2&3,l=0;l<S;++l)r=n[l+1],i=n[l]=Ce(n[l]+St(s,r,i,l,a,o));r=n[0],i=n[S]=Ce(n[S]+St(s,r,i,S,a,o))}return n}(_t(t,!0),_t(Sr(e),!1)),!1)}function kr(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=Ct(e)),t==null||t.length===0?t:_r(function(n,o){var r,i,s,a,l,h=n.length,b=h-1;for(r=n[0],s=Ce(Math.floor(6+52/h)*Pn);s!==0;s=Ce(s-Pn)){for(a=s>>>2&3,l=b;l>0;--l)i=n[l-1],r=n[l]=Ce(n[l]-St(s,r,i,l,a,o));i=n[b],r=n[0]=Ce(n[0]-St(s,r,i,0,a,o))}return n}(_t(t,!1),_t(Sr(e),!1)),!0)}const Fe={toBytes:Ct,toString:Cr,encrypt:Er,encryptToString:function(t,e){return window.btoa(Is(Er(t,e)))},decrypt:kr,decryptToString:function(t,e){return Cr(kr(t,e))}},xr=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},Ts={set:t=>{let e=xr(t);document.getElementById(e)===null&&(e=xr(t))},del:()=>{let t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t))}};class Ee extends Error{constructor(e,n){const o=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class zn extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class de extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class Rs extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Ms extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class Ps extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class Ir extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class zs extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=o}}class Tr{constructor(e,n,o){this.statusCode=e,this.statusText=n,this.content=o}}class Et{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 I;(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"})(I||(I={}));class He{constructor(){}log(e,n){}}He.instance=new He;class ee{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 Z{static get isBrowser(){return!Z.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Z.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Z.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function qe(t,e){let n="";return ke(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 ke(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}async function Rr(t,e,n,o,r,i){const s={},[a,l]=Le();s[a]=l,t.log(I.Trace,`(${e} transport) sending data. ${qe(r,i.logMessageContent)}.`);const h=ke(r)?"arraybuffer":"text",b=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:h,timeout:i.timeout,withCredentials:i.withCredentials});t.log(I.Trace,`(${e} transport) request complete. Response status: ${b.statusCode}.`)}class Ls{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 kt{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const o=`[${new Date().toISOString()}] ${I[e]}: ${n}`;switch(e){case I.Critical:case I.Error:this.out.error(o);break;case I.Warning:this.out.warn(o);break;case I.Information:this.out.info(o);break;default:this.out.log(o)}}}}function Le(){let t="X-SignalR-User-Agent";return Z.isNode&&(t="User-Agent"),[t,As("8.0.7",Ds(),$s(),Ns())]}function As(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 Ds(){if(!Z.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Ns(){if(Z.isNode)return process.versions.node}function $s(){return Z.isNode?"NodeJS":"Browser"}function Ln(t){return t.stack?t.stack:t.message?t.message:`${t}`}class Bs extends Et{constructor(e){if(super(),this._logger=e,typeof fetch>"u"||Z.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 de;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 de});let r,i=null;if(e.timeout){const l=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(I.Warning,"Timeout from HTTP request."),o=new zn},l)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},ke(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(l){throw o||(this._logger.log(I.Warning,`Error from HTTP request. ${l}.`),l)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const l=await Mr(r,"text");throw new Ee(l||r.statusText,r.status)}const s=Mr(r,e.responseType),a=await s;return new Tr(r.status,r.statusText,a)}getCookieString(e){let n="";return Z.isNode&&this._jar&&this._jar.getCookies(e,(o,r)=>n=r.join("; ")),n}}function Mr(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 js extends Et{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new de):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&&(ke(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 de)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new Tr(r.status,r.statusText,r.response||r.responseText)):o(new Ee(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(I.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new Ee(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(I.Warning,"Timeout from HTTP request."),o(new zn)},r.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Os extends Et{constructor(e){if(super(),typeof fetch<"u"||Z.isNode)this._httpClient=new Bs(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new js(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new de):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 le{static write(e){return`${e}${le.RecordSeparator}`}static parse(e){if(e[e.length-1]!==le.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(le.RecordSeparator);return n.pop(),n}}le.RecordSeparatorCode=30,le.RecordSeparator=String.fromCharCode(le.RecordSeparatorCode);class Ws{writeHandshakeRequest(e){return le.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,o;if(ke(e)){const s=new Uint8Array(e),a=s.indexOf(le.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const l=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,l))),o=s.byteLength>l?s.slice(l).buffer:null}else{const s=e,a=s.indexOf(le.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const l=a+1;n=s.substring(0,l),o=s.length>l?s.substring(l):null}const r=le.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 Us{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 Ls(this,e)}}class Fs{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=()=>{};ke(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(o=new Promise((s,a)=>{r=s,i=a})),this._messages.push(new Hs(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,ke(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 Hs{constructor(e,n,o,r){this._message=e,this._id=n,this._resolver=o,this._rejector=r}}var K;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(K||(K={}));class ho{static create(e,n,o,r,i,s,a){return new ho(e,n,o,r,i,s,a)}constructor(e,n,o,r,i,s,a){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(I.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")},ee.isRequired(e,"connection"),ee.isRequired(n,"logger"),ee.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=a??1e5,this._logger=n,this._protocol=o,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new Ws,this.connection.onreceive=l=>this._processIncomingData(l),this.connection.onclose=l=>this._connectionClosed(l),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=K.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!==K.Disconnected&&this._connectionState!==K.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!==K.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=K.Connecting,this._logger.log(I.Debug,"Starting HubConnection.");try{await this._startInternal(),Z.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=K.Connected,this._connectionStarted=!0,this._logger.log(I.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=K.Disconnected,this._logger.log(I.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(I.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(I.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 Fs(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(I.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===K.Disconnected)return this._logger.log(I.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===K.Disconnecting)return this._logger.log(I.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=K.Disconnecting,this._logger.log(I.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(I.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===K.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new de("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 a=new Us;return a.cancelCallback=()=>{const l=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(l))},this._callbacks[i.invocationId]=(l,h)=>{h?a.error(h):l&&(l.type===H.Completion?l.error?a.error(new Error(l.error)):a.complete():a.next(l.item))},s=this._sendWithProtocol(i).catch(l=>{a.error(l),delete this._callbacks[i.invocationId]}),this._launchStreams(o,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[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((a,l)=>{this._callbacks[i.invocationId]=(b,S)=>{S?l(S):b&&(b.type===H.Completion?b.error?l(new Error(b.error)):a(b.result):l(new Error(`Unexpected message type: ${b.type}`)))};const h=this._sendWithProtocol(i).catch(b=>{l(b),delete this._callbacks[i.invocationId]});this._launchStreams(o,h)})}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(I.Error,`Invoke client method threw error: ${Ln(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(I.Error,`Stream callback threw error: ${Ln(i)}`)}}break}case H.Ping:break;case H.Close:{this._logger.log(I.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(I.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(I.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(I.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(I.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===K.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(I.Warning,`No client method with the name '${n}' found.`),void(e.invocationId&&(this._logger.log(I.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,a,l;for(const h of r)try{const b=s;s=await h.apply(this,e.arguments),i&&s&&b&&(this._logger.log(I.Error,`Multiple results provided for '${n}'. Sending error to server.`),l=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),a=void 0}catch(b){a=b,this._logger.log(I.Error,`A callback for the method '${n}' threw error '${b}'.`)}l?await this._sendWithProtocol(l):i?(a?l=this._createCompletionMessage(e.invocationId,`${a}`,null):s!==void 0?l=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(I.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),l=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(l)):s&&this._logger.log(I.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(I.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new de("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===K.Disconnecting?this._completeClose(e):this._connectionState===K.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===K.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=K.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),Z.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(I.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(I.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=K.Reconnecting,e?this._logger.log(I.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(I.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[e]))}catch(s){this._logger.log(I.Error,`An onreconnecting callback called with error '${e}' threw error '${s}'.`)}if(this._connectionState!==K.Reconnecting)return void this._logger.log(I.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(I.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!==K.Reconnecting)return void this._logger.log(I.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=K.Connected,this._logger.log(I.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(I.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(I.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==K.Reconnecting)return this._logger.log(I.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===K.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-n,r)}}this._logger.log(I.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(I.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(I.Error,`Stream 'error' callback called with '${e}' threw error: ${Ln(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 qs=[0,2e3,1e4,3e4,null];class Pr{constructor(e){this._retryDelays=e!==void 0?[...e,null]:qs}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class xe{}xe.Authorization="Authorization",xe.Cookie="Cookie";class Vs extends Et{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[xe.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[xe.Authorization]&&delete e.headers[xe.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var te,ie;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(te||(te={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(ie||(ie={}));class Xs{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 zr{get pollAborted(){return this._pollAbort.aborted}constructor(e,n,o){this._httpClient=e,this._logger=n,this._pollAbort=new Xs,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,n){if(ee.isRequired(e,"url"),ee.isRequired(n,"transferFormat"),ee.isIn(n,ie,"transferFormat"),this._url=e,this._logger.log(I.Trace,"(LongPolling transport) Connecting."),n===ie.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]=Le(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===ie.Binary&&(s.responseType="arraybuffer");const a=`${e}&_=${Date.now()}`;this._logger.log(I.Trace,`(LongPolling transport) polling: ${a}.`);const l=await this._httpClient.get(a,s);l.statusCode!==200?(this._logger.log(I.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new Ee(l.statusText||"",l.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(I.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,n);r.statusCode===204?(this._logger.log(I.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(I.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new Ee(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(I.Trace,`(LongPolling transport) data received. ${qe(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(I.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof zn?this._logger.log(I.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(I.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(I.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Rr(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(I.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(I.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,o]=Le();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 Ee&&(i.statusCode===404?this._logger.log(I.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(I.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(I.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(I.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(I.Trace,e),this.onclose(this._closeError)}}}class Gs{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 ee.isRequired(e,"url"),ee.isRequired(n,"transferFormat"),ee.isIn(n,ie,"transferFormat"),this._logger.log(I.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===ie.Text){if(Z.isBrowser||Z.isWebWorker)i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const a=this._httpClient.getCookieString(e),l={};l.Cookie=a;const[h,b]=Le();l[h]=b,i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...l,...this._options.headers}})}try{i.onmessage=a=>{if(this.onreceive)try{this._logger.log(I.Trace,`(SSE transport) data received. ${qe(a.data,this._options.logMessageContent)}.`),this.onreceive(a.data)}catch(l){return void this._close(l)}},i.onerror=a=>{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(I.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,o()}}catch(a){return void r(a)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(e){return this._eventSource?Rr(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 Ks{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 ee.isRequired(e,"url"),ee.isRequired(n,"transferFormat"),ee.isIn(n,ie,"transferFormat"),this._logger.log(I.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;e=e.replace(/^http/,"ws");const a=this._httpClient.getCookieString(e);let l=!1;if(Z.isNode||Z.isReactNative){const h={},[b,S]=Le();h[b]=S,o&&(h[xe.Authorization]=`Bearer ${o}`),a&&(h[xe.Cookie]=a),s=new this._webSocketConstructor(e,void 0,{headers:{...h,...this._headers}})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(e)),n===ie.Binary&&(s.binaryType="arraybuffer"),s.onopen=h=>{this._logger.log(I.Information,`WebSocket connected to ${e}.`),this._webSocket=s,l=!0,r()},s.onerror=h=>{let b=null;b=typeof ErrorEvent<"u"&&h instanceof ErrorEvent?h.error:"There was an error with the transport",this._logger.log(I.Information,`(WebSockets transport) ${b}.`)},s.onmessage=h=>{if(this._logger.log(I.Trace,`(WebSockets transport) data received. ${qe(h.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(h.data)}catch(b){return void this._close(b)}},s.onclose=h=>{if(l)this._close(h);else{let b=null;b=typeof ErrorEvent<"u"&&h instanceof ErrorEvent?h.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(b))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(I.Trace,`(WebSockets transport) sending data. ${qe(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(I.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 Js{constructor(e,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,ee.isRequired(e,"url"),this._logger=(o=n.logger)===void 0?new kt(I.Information):o===null?He.instance:o.log!==void 0?o:new kt(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(Z.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;r=s("ws"),i=s("eventsource")}Z.isNode||typeof WebSocket>"u"||n.WebSocket?Z.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,Z.isNode||typeof EventSource>"u"||n.EventSource?Z.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new Vs(n.httpClient||new Os(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||ie.Binary,ee.isIn(e,ie,"transferFormat"),this._logger.log(I.Debug,`Starting connection with transfer format '${ie[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(I.Error,n),await this._stopPromise,Promise.reject(new de(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(I.Error,n),Promise.reject(new de(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 fo(this.transport)),this._sendQueue.send(e))}async stop(e){return this._connectionState==="Disconnected"?(this._logger.log(I.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(I.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(I.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(I.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!==te.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(te.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 de("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 zr&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(I.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(I.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]=Le();n[o]=r;const i=this._resolveNegotiateUrl(e);this._logger.log(I.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 Ir("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 Ee&&s.statusCode===404&&(a+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(I.Error,a),Promise.reject(new Ir(a))}}_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(I.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=[],a=o.availableTransports||[];let l=o;for(const h of a){const b=this._resolveTransportOrError(h,n,r,l?.useStatefulReconnect===!0);if(b instanceof Error)s.push(`${h.transport} failed:`),s.push(b);else if(this._isITransport(b)){if(this.transport=b,!l){try{l=await this._getNegotiationResponse(e)}catch(S){return Promise.reject(S)}i=this._createConnectUrl(e,l.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=l.connectionId)}catch(S){if(this._logger.log(I.Error,`Failed to start the transport '${h.transport}': ${S}`),l=void 0,s.push(new Ps(`${h.transport} failed: ${S}`,te[h.transport])),this._connectionState!=="Connecting"){const x="Failed to select transport before stop() was called.";return this._logger.log(I.Debug,x),Promise.reject(new de(x))}}}}return s.length>0?Promise.reject(new zs(`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 te.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Ks(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case te.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Gs(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case te.LongPolling:return new zr(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=te[e.transport];if(i==null)return this._logger.log(I.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)!=0}(n,i))return this._logger.log(I.Debug,`Skipping transport '${te[i]}' because it was disabled by the client.`),new Ms(`'${te[i]}' is disabled by the client.`,i);{if(!(e.transferFormats.map(a=>ie[a]).indexOf(o)>=0))return this._logger.log(I.Debug,`Skipping transport '${te[i]}' because it does not support the requested transfer format '${ie[o]}'.`),new Error(`'${te[i]}' does not support ${ie[o]}.`);if(i===te.WebSockets&&!this._options.WebSocket||i===te.ServerSentEvents&&!this._options.EventSource)return this._logger.log(I.Debug,`Skipping transport '${te[i]}' because it is not supported in your environment.'`),new Rs(`'${te[i]}' is not supported in your environment.`,i);this._logger.log(I.Debug,`Selecting transport '${te[i]}'.`);try{return this.features.reconnect=i===te.WebSockets?r: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(I.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(I.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(I.Error,`Connection disconnected with error '${e}'.`):this._logger.log(I.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(I.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(I.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}else this._logger.log(I.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(!Z.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(I.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 fo{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new xt,this._transportResult=new xt,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new xt),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 xt;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):fo._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 xt{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Ys{constructor(){this.name="json",this.version=2,this.transferFormat=ie.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=He.instance);const o=le.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(I.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(e){return le.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 Zs={trace:I.Trace,debug:I.Debug,info:I.Information,information:I.Information,warn:I.Warning,warning:I.Warning,error:I.Error,critical:I.Critical,none:I.None};class Qs{configureLogging(e){if(ee.isRequired(e,"logging"),e.log!==void 0)this.logger=e;else if(typeof e=="string"){const n=function(o){const r=Zs[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(e);this.logger=new kt(n)}else this.logger=new kt(e);return this}withUrl(e,n){return ee.isRequired(e,"url"),ee.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(e){return ee.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 Pr(e):this.reconnectPolicy=e:this.reconnectPolicy=new Pr,this}withServerTimeout(e){return ee.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return ee.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 Js(this.url,e);return ho.create(n,this.logger||He.instance,this.protocol||new Ys,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let It;const An=new Set;function Lr(t){return t!==null?parseFloat(t):0}function Tt(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(Lr).reduce((r,i)=>r+i)),o=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(Lr).reduce((r,i)=>r+i));return{width:n,height:o}}class Ar{width;height;constructor(e,n){this.width=e,this.height=n}}function ea(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 ta(t,e,n,o){const r=t-n,i=e-o;return r*r+i*i}window.addEventListener("resize",t=>{An.forEach(e=>{e&&ht(e.fixPosition)&&e.fixPosition()})});const Rt=[];var Mt=p.defineComponent({name:"Window",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:ut},setup(t,{emit:e}){const n=p.getCurrentInstance();if(!n)return;const{proxy:o}=n;let r=0,i,s,a;const l=p.ref(t.isOpen),h=()=>{Rt.push(o),a=new cs(t.zGroup,b),t.isOpen&&function(D){D&&(p.nextTick(()=>{r++==0&&(w(o),function(){const N=S.value,{width:P,height:B}=rn(N);let W,R;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,R=t.top;else{const U=t.positionHint||"auto";switch(U){case"auto":{let V=20,ne=50,J=0;do{if(Rt.every(Y=>{if(!Y.isOpen||o==Y)return!0;const fe=ea(Y);if(fe==null)return!0;const{left:Re,top:Q}=fe;return ta(Re,Q,V,ne)>16}))break;V=(V+40)%(window.innerWidth-200),ne=(ne+40)%(window.innerHeight-200)}while(++J<100);W=V,R=ne}break;case"center":W=(window.innerWidth-P)/2,R=(window.innerHeight-B)/2,console.log(W,R,window.innerWidth,window.innerHeight,"111111");break;default:try{const V=U.split("/").map(Number);if(V.length!=2)throw null;const[ne,J]=V;if(!isFinite(ne)||!isFinite(J))throw null;W=ne>=0?ne:window.innerWidth-P+ne,R=J>=0?J:window.innerHeight-B+J}catch{throw new Error(`invalid position string: ${U}`)}}}N&&(N.style.left=`${W}px`,N.style.top=`${R}px`)}()),t.resizable&&d(),L(),i=new as(x.value,S.value,{onMove:()=>L(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:N}=rn(x.value);s=new ls(S.value,{onResize:()=>d(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+N,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+N:void 0})}()}),t.activateWhenOpen&&T())}(!0),An.add(o)};function b(D){g.value.zIndex=`${D}`}const S=p.ref(null),x=p.ref(null),$=p.ref(null);function T(){a.raise(),e("activate")}const g=p.ref({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),u=p.computed(()=>t.windowStyle.titlebar),y=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 w(D){const{width:N,height:P,top:B,left:W}=D,R=S;if(R&&N!=null&&(R.value.style.width=`${N}px`),P!=null){const U=x.value;if(U){const V=Tt(U).height;R.value.style.height=`${P+V}px`}}R&&W!=null&&(R.value.style.left=`${W}px`),R&&B!=null&&(R.value.style.top=`${B}px`)}function d(D=!0){const N=S.value,P=x.value,B=$.value;if(B&&N&&P){const{width:W,height:R}=Tt(B),{width:U,height:V}=Tt(N),ne=Tt(P).height,J=U-(B.offsetWidth-W),Y=V-ne-(B.offsetHeight-R);B.style.width=`${J}px`,B.style.height=`${Y}px`,f(),e("resize",new Ar(J,Y)),D&&(e("update:width",J),e("update:height",Y))}}function f(){const D=S.value;if(D){const N=D.getBoundingClientRect();N.left<0&&(g.value.left="0px"),N.top<0&&(g.value.top="0px"),N.right>window.innerWidth&&(g.value.left=window.innerWidth-N.width+"px"),N.bottom>window.innerHeight&&(g.value.top=window.innerHeight-N.height+"px")}}function L(D=!0){f();const N=S.value;if(N){const{left:P,top:B}=N.getBoundingClientRect();D&&(e("update:left",P),e("update:top",B))}}return p.watch(()=>t.isOpen,D=>{l.value=D}),p.watch(()=>t.zGroup,D=>{a.group=D}),p.watch(()=>t.width,D=>{w({width:D}),d(!1)}),p.watch(()=>t.height,D=>{w({height:D}),d(!1)}),p.onMounted(()=>{h()}),p.onBeforeUnmount(()=>{An.delete(this),a.unregister(),s&&s.teardown(),i&&i.teardown(),Rt.splice(Rt.indexOf(o),1)}),{isOpen:l,windowEl:S,titlebar:x,content:$,activate:T,styleWindow:g,styleTitlebar:u,styleContent:y,closeButtonClick:function(){l.value=!1,e("closebuttonclick")},fixPosition:f}}});const na={class:"title"};var Dr;Mt.render=function(t,e,n,o,r,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",na,[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})},Mt.__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"}(Dr||(Dr={}));const oa=Mt;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 Nr{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(be(e)?n=e:dt(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(a){a.layoutID===r._LayoutID&&a.widgetID===i&&(r._loadWidget(s),O.EventBus.off(re.WidgetLoadedEvent,o))};const r=this,i=n.afterid,s=n;return O.EventBus.on(re.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=p.markRaw(n.default);e.layout&&(o.style=e.layout),e.cssClass&&(o.cssClass=e.cssClass),this.getContainerComponents(e.container).value.set(e.id,o),this.widgetsLoadedSet.add(e.id),p.nextTick().then(()=>{O.EventBus.emit(re.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}}).catch(n=>{O.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",e),O.EventBus.emit(re.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),O.EventBus.emit(re.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=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(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 O.LayoutMap.get(o.layoutID)}}}var Ve=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}}});Ve.render=function(t,e,n,o,r,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}))},Ve.__file="src/controls/routertransition/SuspenseWithError.vue";var Dn=p.defineComponent({name:"RouterTransition",__name:"RouterTransition",setup:t=>(e,n)=>{const o=p.resolveComponent("router-view");return p.openBlock(),p.createBlock(Ve,null,{default:p.withCtx(()=>[p.createVNode(o,null,{default:p.withCtx(({Component:r,route:i})=>[p.createCommentVNode(" <transition> "),(p.openBlock(),p.createBlock(p.KeepAlive,null,[i.meta.keepAlive?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(r),{key:i.name})):p.createCommentVNode("v-if",!0)],1024)),i.meta.keepAlive?p.createCommentVNode("v-if",!0):(p.openBlock(),p.createBlock(p.resolveDynamicComponent(r),{key:i.name})),p.createCommentVNode(" </transition> ")]),_:1})]),_:1})}});Dn.__file="src/controls/routertransition/RouterTransition.vue";var Pt=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:Dn},setup(t,{attrs:e,slots:n,emit:o}){const r=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,l=new Nr(s,t.widgetConfig,r,a),h=g(exports.LayoutContainerEnum.top),b=g(exports.LayoutContainerEnum.centerBack),S=g(exports.LayoutContainerEnum.centerFront),x=g(exports.LayoutContainerEnum.left),$=g(exports.LayoutContainerEnum.right),T=g(exports.LayoutContainerEnum.bottom);function g(y){return l?.getContainerComponents(y)}const u=p.computed(()=>t.layoutStyle);return p.onMounted(()=>{l&&(r?O.LayoutMap.set(r,l):(O.LayoutManager=l,O.LayoutMap.set("",l)),l.preloadWidgets(),o("containerLoaded",{layoutID:r,layoutManager:l}),O.EventBus.emit(re.LayoutContainerLoaded,{layoutID:r,layoutManager:l}))}),{...p.toRefs(s),topContainerComponents:h,centerbackComponents:b,centerfrontComponents:S,leftContainerComponents:x,rightContainerComponents:$,bottomContainerComponents:T,containerStyle:u,isEnableRouterView:i,setItemRef:(y,w)=>{y&&a.set(w,y)}}}});const ra={ref:"topContainer",class:"topContainer"},ia={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},sa={ref:"centerBackContainer",class:"centerdiv backContainer"},aa={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},ca={ref:"leftContainer",class:"leftContainer"},la={ref:"rightContainer",class:"rightContainer"},ua={ref:"bottomContainer",class:"bottomContainer"};Pt.render=function(t,e,n,o,r,i){const s=p.resolveComponent("router-transition");return p.openBlock(),p.createElementBlock("div",{class:"layoutContainer",style:p.normalizeStyle(t.containerStyle)},[p.createElementVNode("div",ra,[p.renderSlot(t.$slots,"top"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.topContainerComponents,([a,l])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(l),{ref_for:!0,ref:h=>t.setItemRef(h,a),key:a,style:p.normalizeStyle(l.style),class:p.normalizeClass(l.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",ia,[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",sa,[p.renderSlot(t.$slots,"back"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.centerbackComponents,([a,l])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(l),{ref_for:!0,ref:h=>t.setItemRef(h,a),key:a,style:p.normalizeStyle(l.style),class:p.normalizeClass(l.cssClass)},null,8,["style","class"]))),128))],512),p.createCommentVNode(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),p.createElementVNode("div",aa,[p.renderSlot(t.$slots,"front"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.centerfrontComponents,([a,l])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(l),{ref_for:!0,ref:h=>t.setItemRef(h,a),key:a,style:p.normalizeStyle(l.style),class:p.normalizeClass(l.cssClass)},null,8,["style","class"]))),128))],512),p.createElementVNode("div",ca,[p.renderSlot(t.$slots,"left"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.leftContainerComponents,([a,l])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(l),{ref_for:!0,ref:h=>t.setItemRef(h,a),key:a,style:p.normalizeStyle(l.style),class:p.normalizeClass(l.cssClass)},null,8,["style","class"]))),128))],512),p.createElementVNode("div",la,[p.renderSlot(t.$slots,"right"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.rightContainerComponents,([a,l])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(l),{ref_for:!0,ref:h=>t.setItemRef(h,a),key:a,style:p.normalizeStyle(l.style),class:p.normalizeClass(l.cssClass)},null,8,["style","class"]))),128))],512)]),p.createElementVNode("div",ua,[p.renderSlot(t.$slots,"bottom"),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.bottomContainerComponents,([a,l])=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(l),{ref_for:!0,ref:h=>t.setItemRef(h,a),key:a,style:p.normalizeStyle(l.style),class:p.normalizeClass(l.cssClass)},null,8,["style","class"]))),128))],512),p.createCommentVNode(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),p.renderSlot(t.$slots,"default")],4)},Pt.__scopeId="data-v-4d081e5c",Pt.__file="src/controls/layoutcontainer/layout.vue";var $r=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 o=p.resolveComponent("router-view");return p.openBlock(),p.createBlock(Ve,null,{default:p.withCtx(()=>[p.createVNode(o,null,{default:p.withCtx(({Component:r,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(r),{key:i.name})):p.createCommentVNode("v-if",!0)],1024)),i.meta.keepAlive?p.createCommentVNode("v-if",!0):(p.openBlock(),p.createBlock(p.resolveDynamicComponent(r),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});$r.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const Xe=/^[a-z0-9]+(-[a-z0-9]+)*$/,zt=(t,e,n,o="")=>{const r=t.split(":");if(t.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),l=r.pop(),h={provider:r.length>0?r[0]:o,prefix:l,name:a};return e&&!Lt(h)?null:h}const i=r[0],s=i.split("-");if(s.length>1){const a={provider:o,prefix:s.shift(),name:s.join("-")};return e&&!Lt(a)?null:a}if(n&&o===""){const a={provider:o,prefix:"",name:i};return e&&!Lt(a,n)?null:a}return null},Lt=(t,e)=>!!t&&!(t.provider!==""&&!t.provider.match(Xe)||!(e&&t.prefix===""||t.prefix.match(Xe))||!t.name.match(Xe)),Br=Object.freeze({left:0,top:0,width:16,height:16}),At=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Dt=Object.freeze({...Br,...At}),Nn=Object.freeze({...Dt,body:"",hidden:!1});function jr(t,e){const n=function(o,r){const i={};!o.hFlip!=!r.hFlip&&(i.hFlip=!0),!o.vFlip!=!r.vFlip&&(i.vFlip=!0);const s=((o.rotate||0)+(r.rotate||0))%4;return s&&(i.rotate=s),i}(t,e);for(const o in Nn)o in At?o in t&&!(o in n)&&(n[o]=At[o]):o in e?n[o]=e[o]:o in t&&(n[o]=t[o]);return n}function ha(t,e,n){const o=t.icons,r=t.aliases||Object.create(null);let i={};function s(a){i=jr(o[a]||r[a],i)}return s(e),n.forEach(s),jr(t,i)}function Or(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(r=>{e(r,null),n.push(r)});const o=function(r,i){const s=r.icons,a=r.aliases||Object.create(null),l=Object.create(null);return(i||Object.keys(s).concat(Object.keys(a))).forEach(function h(b){if(s[b])return l[b]=[];if(!(b in l)){l[b]=null;const S=a[b]&&a[b].parent,x=S&&h(S);x&&(l[b]=[S].concat(x))}return l[b]}),l}(t);for(const r in o){const i=o[r];i&&(e(r,ha(t,r,i)),n.push(r))}return n}const da={provider:"",aliases:{},not_found:{},...Br};function $n(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Wr(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!$n(t,da))return null;const n=e.icons;for(const r in n){const i=n[r];if(!r.match(Xe)||typeof i.body!="string"||!$n(i,Nn))return null}const o=e.aliases||Object.create(null);for(const r in o){const i=o[r],s=i.parent;if(!r.match(Xe)||typeof s!="string"||!n[s]&&!o[s]||!$n(i,Nn))return null}return e}const Ur=Object.create(null);function Ie(t,e){const n=Ur[t]||(Ur[t]=Object.create(null));return n[e]||(n[e]=function(o,r){return{provider:o,prefix:r,icons:Object.create(null),missing:new Set}}(t,e))}function Bn(t,e){return Wr(e)?Or(e,(n,o)=>{o?t.icons[n]=o:t.missing.add(n)}):[]}let Ge=!1;function Fr(t){return typeof t=="boolean"&&(Ge=t),Ge}function fa(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),Ge&&!e&&!t.prefix){let o=!1;return Wr(t)&&(t.prefix="",Or(t,(r,i)=>{i&&function(s,a){const l=zt(s,!0,Ge);return!!l&&function(h,b,S){try{if(typeof S.body=="string")return h.icons[b]={...S},!0}catch{}return!1}(Ie(l.provider,l.prefix),l.name,a)}(r,i)&&(o=!0)})),o}const n=t.prefix;return Lt({provider:e,prefix:n,name:"a"})?!!Bn(Ie(e,n),t):!1}const Hr=Object.freeze({width:null,height:null}),qr=Object.freeze({...Hr,...At}),pa=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ga=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Vr(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const o=t.split(pa);if(o===null||!o.length)return t;const r=[];let i=o.shift(),s=ga.test(i);for(;;){if(s){const a=parseFloat(i);isNaN(a)?r.push(i):r.push(Math.ceil(a*e*n)/n)}else r.push(i);if(i=o.shift(),i===void 0)return r.join("");s=!s}}const ma=/\sid="(\S+)"/g,va="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let ya=0;const jn=Object.create(null);function On(t){return jn[t]||jn[""]}function Wn(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const Un=Object.create(null),Nt=["https://api.simplesvg.com","https://api.unisvg.com"],Fn=[];for(;Nt.length>0;)Nt.length===1||Math.random()>.5?Fn.push(Nt.shift()):Fn.push(Nt.pop());function wa(t,e){const n=Wn(e);return n!==null&&(Un[t]=n,!0)}function Hn(t){return Un[t]}Un[""]=Wn({resources:["https://api.iconify.design"].concat(Fn)});let Xr=(()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}})();const ba={prepare:(t,e,n)=>{const o=[],r=function(l,h){const b=Hn(l);if(!b)return 0;let S;if(b.maxURL){let x=0;b.resources.forEach(T=>{x=Math.max(x,T.length)});const $=h+".json?icons=";S=b.maxURL-x-b.path.length-$.length}else S=0;return S}(t,e),i="icons";let s={type:i,provider:t,prefix:e,icons:[]},a=0;return n.forEach((l,h)=>{a+=l.length+1,a>=r&&h>0&&(o.push(s),s={type:i,provider:t,prefix:e,icons:[]},a=l.length),s.icons.push(l)}),o.push(s),o},send:(t,e,n)=>{if(!Xr)return void n("abort",424);let o=function(i){if(typeof i=="string"){const s=Hn(i);if(s)return s.path}return"/"}(e.provider);switch(e.type){case"icons":{const i=e.prefix,s=e.icons.join(",");o+=i+".json?"+new URLSearchParams({icons:s}).toString();break}case"custom":{const i=e.uri;o+=i.slice(0,1)==="/"?i.slice(1):i;break}default:return void n("abort",400)}let r=503;Xr(t+o).then(i=>{const s=i.status;if(s===200)return r=501,i.json();setTimeout(()=>{n(function(a){return a===404}(s)?"abort":"next",s)})}).then(i=>{setTimeout(typeof i=="object"&&i!==null?()=>{n("success",i)}:()=>{i===404?n("abort",i):n("next",r)})}).catch(()=>{n("next",r)})}};function Gr(t,e){t.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(r=>r.id!==e))})}let _a=0;var Sa={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ca(t,e,n,o){const r=t.resources.length,i=t.random?Math.floor(Math.random()*r):t.index;let s;if(t.random){let f=t.resources.slice(0);for(s=[];f.length>1;){const L=Math.floor(Math.random()*f.length);s.push(f[L]),f=f.slice(0,L).concat(f.slice(L+1))}s=s.concat(f)}else s=t.resources.slice(i).concat(t.resources.slice(0,i));const a=Date.now();let l,h="pending",b=0,S=null,x=[],$=[];function T(){S&&(clearTimeout(S),S=null)}function g(){h==="pending"&&(h="aborted"),T(),x.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),x=[]}function u(f,L){L&&($=[]),typeof f=="function"&&$.push(f)}function y(){h="failed",$.forEach(f=>{f(void 0,l)})}function w(){x.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),x=[]}function d(){if(h!=="pending")return;T();const f=s.shift();if(f===void 0)return x.length?void(S=setTimeout(()=>{T(),h==="pending"&&(w(),y())},t.timeout)):void y();const L={status:"pending",resource:f,callback:(D,N)=>{(function(P,B,W){const R=B!=="success";switch(x=x.filter(U=>U!==P),h){case"pending":break;case"failed":if(R||!t.dataAfterTimeout)return;break;default:return}if(B==="abort")return l=W,void y();if(R)return l=W,void(x.length||(s.length?d():y()));if(T(),w(),!t.random){const U=t.resources.indexOf(P.resource);U!==-1&&U!==t.index&&(t.index=U)}h="completed",$.forEach(U=>{U(W)})})(L,D,N)}};x.push(L),b++,S=setTimeout(d,t.rotate),n(f,e,L.callback)}return typeof o=="function"&&$.push(o),setTimeout(d),function(){return{startTime:a,payload:e,status:h,queriesSent:b,queriesPending:x.length,subscribe:u,abort:g}}}function Kr(t){const e={...Sa,...t};let n=[];function o(){n=n.filter(r=>r().status==="pending")}return{query:function(r,i,s){const a=Ca(e,r,i,(l,h)=>{o(),s&&s(l,h)});return n.push(a),a},find:function(r){return n.find(i=>r(i))||null},setIndex:r=>{e.index=r},getIndex:()=>e.index,cleanup:o}}function Jr(){}const qn=Object.create(null);function Ea(t,e,n){let o,r;if(typeof t=="string"){const i=On(t);if(!i)return n(void 0,424),Jr;r=i.send;const s=function(a){if(!qn[a]){const l=Hn(a);if(!l)return;const h={config:l,redundancy:Kr(l)};qn[a]=h}return qn[a]}(t);s&&(o=s.redundancy)}else{const i=Wn(t);if(i){o=Kr(i);const s=On(t.resources?t.resources[0]:"");s&&(r=s.send)}}return o&&r?o.query(e,r,n)().abort:(n(void 0,424),Jr)}function Vn(t,e){try{return t.getItem(e)}catch{}}function Xn(t,e,n){try{return t.setItem(e,n),!0}catch{}}function Yr(t,e){try{t.removeItem(e)}catch{}}function Gn(t,e){return Xn(t,"iconify-count",e.toString())}function Kn(t){return parseInt(Vn(t,"iconify-count"))||0}const $t={local:!0,session:!0},Zr={local:new Set,session:new Set};let Jn=!1,Bt=typeof window>"u"?{}:window;function Qr(t){const e=t+"Storage";try{if(Bt&&Bt[e]&&typeof Bt[e].length=="number")return Bt[e]}catch{}$t[t]=!1}function ei(t,e){const n=Qr(t);if(!n)return;const o=Vn(n,"iconify-version");if(o!=="iconify2"){if(o){const a=Kn(n);for(let l=0;l<a;l++)Yr(n,"iconify"+l.toString())}return Xn(n,"iconify-version","iconify2"),void Gn(n,0)}const r=Math.floor(Date.now()/36e5)-168,i=a=>{const l="iconify"+a.toString(),h=Vn(n,l);if(typeof h=="string"){try{const b=JSON.parse(h);if(typeof b=="object"&&typeof b.cached=="number"&&b.cached>r&&typeof b.provider=="string"&&typeof b.data=="object"&&typeof b.data.prefix=="string"&&e(b,a))return!0}catch{}Yr(n,l)}};let s=Kn(n);for(let a=s-1;a>=0;a--)i(a)||(a===s-1?(s--,Gn(n,s)):Zr[t].add(a))}function ti(){if(!Jn){Jn=!0;for(const t in $t)ei(t,e=>{const n=e.data,o=Ie(e.provider,n.prefix);if(!Bn(o,n).length)return!1;const r=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function ka(t,e){function n(o){let r;if(!$t[o]||!(r=Qr(o)))return;const i=Zr[o];let s;if(i.size)i.delete(s=Array.from(i).shift());else if(s=Kn(r),s>=50||!Gn(r,s+1))return;const a={cached:Math.floor(Date.now()/36e5),provider:t.provider,data:e};return Xn(r,"iconify"+s.toString(),JSON.stringify(a))}Jn||ti(),e.lastModified&&!function(o,r){const i=o.lastModifiedCached;if(i&&i>=r)return i===r;if(o.lastModifiedCached=r,i)for(const s in $t)ei(s,a=>{const l=a.data;return a.provider!==o.provider||l.prefix!==o.prefix||l.lastModified===r});return!0}(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&delete(e=Object.assign({},e)).not_found,n("local")||n("session"))}function ni(){}function xa(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let o=!1;const r=e.provider,i=e.prefix;n.forEach(s=>{const a=s.icons,l=a.pending.length;a.pending=a.pending.filter(h=>{if(h.prefix!==i)return!0;const b=h.name;if(e.icons[b])a.loaded.push({provider:r,prefix:i,name:b});else{if(!e.missing.has(b))return o=!0,!0;a.missing.push({provider:r,prefix:i,name:b})}return!1}),a.pending.length!==l&&(o||Gr([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}(t)}))}const Ia=(t,e)=>{const n=function(l,h=!0,b=!1){const S=[];return l.forEach(x=>{const $=typeof x=="string"?zt(x,h,b):x;$&&S.push($)}),S}(t,!0,Fr()),o=function(l){const h={loaded:[],missing:[],pending:[]},b=Object.create(null);l.sort((x,$)=>x.provider!==$.provider?x.provider.localeCompare($.provider):x.prefix!==$.prefix?x.prefix.localeCompare($.prefix):x.name.localeCompare($.name));let S={provider:"",prefix:"",name:""};return l.forEach(x=>{if(S.name===x.name&&S.prefix===x.prefix&&S.provider===x.provider)return;S=x;const $=x.provider,T=x.prefix,g=x.name,u=b[$]||(b[$]=Object.create(null)),y=u[T]||(u[T]=Ie($,T));let w;w=g in y.icons?h.loaded:T===""||y.missing.has(g)?h.missing:h.pending;const d={provider:$,prefix:T,name:g};w.push(d)}),h}(n);if(!o.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(o.loaded,o.missing,o.pending,ni)}),()=>{l=!1}}const r=Object.create(null),i=[];let s,a;return o.pending.forEach(l=>{const{provider:h,prefix:b}=l;if(b===a&&h===s)return;s=h,a=b,i.push(Ie(h,b));const S=r[h]||(r[h]=Object.create(null));S[b]||(S[b]=[])}),o.pending.forEach(l=>{const{provider:h,prefix:b,name:S}=l,x=Ie(h,b),$=x.pendingIcons||(x.pendingIcons=new Set);$.has(S)||($.add(S),r[h][b].push(S))}),i.forEach(l=>{const{provider:h,prefix:b}=l;r[h][b].length&&function(S,x){S.iconsToLoad?S.iconsToLoad=S.iconsToLoad.concat(x).sort():S.iconsToLoad=x,S.iconsQueueFlag||(S.iconsQueueFlag=!0,setTimeout(()=>{S.iconsQueueFlag=!1;const{provider:$,prefix:T}=S,g=S.iconsToLoad;let u;delete S.iconsToLoad,g&&(u=On($))&&u.prepare($,T,g).forEach(y=>{Ea($,y,w=>{if(typeof w!="object")y.icons.forEach(d=>{S.missing.add(d)});else try{const d=Bn(S,w);if(!d.length)return;const f=S.pendingIcons;f&&d.forEach(L=>{f.delete(L)}),ka(S,w)}catch(d){console.error(d)}xa(S)})})}))}(l,r[h][b])}),e?function(l,h,b){const S=_a++,x=Gr.bind(null,b,S);if(!h.pending.length)return x;const $={id:S,icons:h,callback:l,abort:x};return b.forEach(T=>{(T.loaderCallbacks||(T.loaderCallbacks=[])).push($)}),x}(e,o,i):ni},Ta=/[\s,]+/;function Ra(t,e){e.split(Ta).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0}})}function Ma(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function o(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(t);return isNaN(r)?0:o(r)}if(n!==t){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(t.slice(0,t.length-n.length));return isNaN(i)?0:(i/=r,i%1==0?o(i):0)}}return e}const oi={...qr,inline:!1},Pa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},za={display:"inline-block"},Yn={backgroundColor:"currentColor"},ri={backgroundColor:"transparent"},ii={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},si={webkitMask:Yn,mask:Yn,background:ri};for(const t in si){const e=si[t];for(const n in ii)e[t+n]=ii[n]}const jt={};function ai(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";jt[t+"-flip"]=e,jt[t.slice(0,1)+"-flip"]=e,jt[t+"Flip"]=e});const ci=(t,e)=>{const n=function(u,y){const w={...u};for(const d in y){const f=y[d],L=typeof f;d in Hr?(f===null||f&&(L==="string"||L==="number"))&&(w[d]=f):L===typeof w[d]&&(w[d]=d==="rotate"?f%4:f)}return w}(oi,e),o={...Pa},r=e.mode||"svg",i={},s=e.style,a=typeof s!="object"||s instanceof Array?{}:s;for(let u in e){const y=e[u];if(y!==void 0)switch(u){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[u]=y===!0||y==="true"||y===1;break;case"flip":typeof y=="string"&&Ra(n,y);break;case"color":i.color=y;break;case"rotate":typeof y=="string"?n[u]=Ma(y):typeof y=="number"&&(n[u]=y);break;case"ariaHidden":case"aria-hidden":y!==!0&&y!=="true"&&delete o["aria-hidden"];break;default:{const w=jt[u];w?y!==!0&&y!=="true"&&y!==1||(n[w]=!0):oi[u]===void 0&&(o[u]=y)}}}const l=function(u,y){const w={...Dt,...u},d={...qr,...y},f={left:w.left,top:w.top,width:w.width,height:w.height};let L=w.body;[w,d].forEach(J=>{const Y=[],fe=J.hFlip,Re=J.vFlip;let Q,pe=J.rotate;switch(fe?Re?pe+=2:(Y.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),Y.push("scale(-1 1)"),f.top=f.left=0):Re&&(Y.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),Y.push("scale(1 -1)"),f.top=f.left=0),pe<0&&(pe-=4*Math.floor(pe/4)),pe%=4,pe){case 1:Q=f.height/2+f.top,Y.unshift("rotate(90 "+Q.toString()+" "+Q.toString()+")");break;case 2:Y.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:Q=f.width/2+f.left,Y.unshift("rotate(-90 "+Q.toString()+" "+Q.toString()+")")}pe%2==1&&(f.left!==f.top&&(Q=f.left,f.left=f.top,f.top=Q),f.width!==f.height&&(Q=f.width,f.width=f.height,f.height=Q)),Y.length&&(L=function(Ht,qt,Vt){const et=function(ue,tt="defs"){let nt="";const Be=ue.indexOf("<"+tt);for(;Be>=0;){const ot=ue.indexOf(">",Be),je=ue.indexOf("</"+tt);if(ot===-1||je===-1)break;const he=ue.indexOf(">",je);if(he===-1)break;nt+=ue.slice(ot+1,je).trim(),ue=ue.slice(0,Be).trim()+ue.slice(he+1)}return{defs:nt,content:ue}}(Ht);return Ne=et.defs,$e=qt+et.content+Vt,Ne?"<defs>"+Ne+"</defs>"+$e:$e;var Ne,$e}(L,'<g transform="'+Y.join(" ")+'">',"</g>"))});const D=d.width,N=d.height,P=f.width,B=f.height;let W,R;D===null?(R=N===null?"1em":N==="auto"?B:N,W=Vr(R,P/B)):(W=D==="auto"?P:D,R=N===null?Vr(W,B/P):N==="auto"?B:N);const U={},V=(J,Y)=>{(fe=>fe==="unset"||fe==="undefined"||fe==="none")(Y)||(U[J]=Y.toString())};V("width",W),V("height",R);const ne=[f.left,f.top,P,B];return U.viewBox=ne.join(" "),{attributes:U,viewBox:ne,body:L}}(t,n),h=l.attributes;if(n.inline&&(i.verticalAlign="-0.125em"),r==="svg"){o.style={...i,...a},Object.assign(o,h);let u=0,y=e.id;return typeof y=="string"&&(y=y.replace(/-/g,"_")),o.innerHTML=function(w,d=va){const f=[];let L;for(;L=ma.exec(w);)f.push(L[1]);if(!f.length)return w;const D="suffix"+(16777216*Math.random()|Date.now()).toString(16);return f.forEach(N=>{const P=typeof d=="function"?d(N):d+(ya++).toString(),B=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");w=w.replace(new RegExp('([#;"])('+B+')([")]|\\.[a-z])',"g"),"$1"+P+D+"$3")}),w=w.replace(new RegExp(D,"g"),"")}(l.body,y?()=>y+"ID"+u++:"iconifyVue"),p.h("svg",o)}const{body:b,width:S,height:x}=t,$=r==="mask"||r!=="bg"&&b.indexOf("currentColor")!==-1,T=function(u,y){let w=u.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const d in y)w+=" "+d+'="'+y[d]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+w+">"+u+"</svg>"}(b,{...h,width:S+"",height:x+""});var g;return o.style={...i,"--svg":(g=T,'url("'+function(u){return"data:image/svg+xml,"+function(y){return y.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(u)}(g)+'")'),width:ai(h.width),height:ai(h.height),...za,...$?Yn:ri,...a},p.h("span",o)};var li;if(Fr(!0),li=ba,jn[""]=li,typeof document<"u"&&typeof window<"u"){ti();const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!fa(o))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const o="IconifyProviders["+n+"] is invalid.";try{const r=e[n];if(typeof r!="object"||!r||r.resources===void 0)continue;wa(n,r)||console.error(o)}catch{console.error(o)}}}}const La={...Dt,body:""},Zn=p.defineComponent({inheritAttrs:!1,data:()=>({_name:"",_loadingIcon:null,iconMounted:!1,counter:0}),mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(t,e){if(typeof t=="object"&&t!==null&&typeof t.body=="string")return this._name="",this.abortLoading(),{data:t};let n;if(typeof t!="string"||(n=zt(t,!1,!0))===null)return this.abortLoading(),null;const o=function(i){const s=typeof i=="string"?zt(i,!0,Ge):i;if(s){const a=Ie(s.provider,s.prefix),l=s.name;return a.icons[l]||(a.missing.has(l)?null:void 0)}}(n);if(!o)return this._loadingIcon&&this._loadingIcon.name===t||(this.abortLoading(),this._name="",o!==null&&(this._loadingIcon={name:t,abort:Ia([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==t&&(this._name=t,e&&e(t));const r=["iconify"];return n.prefix!==""&&r.push("iconify--"+n.prefix),n.provider!==""&&r.push("iconify--"+n.provider),{data:o,classes:r}}},render(){this.counter;const t=this.$attrs,e=this.iconMounted||t.ssr?this.getIcon(t.icon,t.onLoad):null;if(!e)return ci(La,t);let n=t;return e.classes&&(n={...t,class:(typeof t.class=="string"?t.class+" ":"")+e.classes.join(" ")}),ci({...Dt,...e.data},n)}}),Ae=new Map,Ke=p.ref(new Map);class Je{static addWindowPanel(e){Ae.set(e.id,e)}static removeWindowPanel(e){Ae.has(e)&&(Ae.delete(e),Ke.value.delete(e))}static minimizeWindowPanel(e){Ae.has(e)&&Ke.value.set(e,-1)}static openWindowPanel(e){Ae.has(e)&&Ke.value.set(e,1)}}const Aa=["src"],Da={key:1,class:"paneltitle"},Na={class:"dragPanelBar"},$a={class:"dragPanelContent"},Ba={class:"drag-pointer-group"};var Qn=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 o=Wo(),r=t,i=n,s=p.ref(),a=p.ref(),l=p.computed(()=>r.isDark),h=p.ref({x:0,y:0}),b=250,S=100,x=p.ref({width:0,height:0}),$=R=>{s.value&&(s.value.style.left=`${R.x}px`,s.value.style.top=`${R.y}px`)};p.watch(()=>h.value,R=>{$(R)});const T=R=>{s.value&&(s.value.style.width=`${R.width}px`,s.value.style.height=`${R.height}px`)};p.watch(()=>x.value,R=>{T(R)});const g={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(g.refs).forEach(([R,U])=>{U.value&&U.value.addEventListener("mousedown",V=>{g.mouseDown(V,R)})})},mouseDown:(R,U)=>{R.button==0&&(R.preventDefault(),g.startingEdges={left:h.value.x,top:h.value.y,right:h.value.x+x.value.width,bottom:h.value.y+x.value.height},g.newEdges={...g.startingEdges},g.clickStart={x:R.clientX,y:R.clientY},g.eventListenerController=new AbortController,document.addEventListener("mousemove",V=>{g.mouseMove(V,U)},{signal:g.eventListenerController.signal}),document.addEventListener("mouseup",V=>{g.mouseUp(V,U)},{signal:g.eventListenerController.signal}))},mouseMove:(R,U)=>{if(g.startingEdges!=null&&g.newEdges!=null&&g.clickStart!=null&&g.refs[U].value){if(R.preventDefault(),console.log("mouseMove",U),U.toLowerCase().includes("north")){g.newEdges.top=Math.max(g.startingEdges.top+R.clientY-g.clickStart.y,0);const V=g.newEdges.bottom-g.newEdges.top-S;V<0&&(g.newEdges.top+=V)}else U.toLowerCase().includes("south")&&(g.newEdges.bottom=Math.min(g.startingEdges.bottom+R.clientY-g.clickStart.y,document.body.clientHeight));if(U.toLowerCase().includes("west")){g.newEdges.left=Math.max(g.startingEdges.left+R.clientX-g.clickStart.x,0);const V=g.newEdges.right-g.newEdges.left-b;V<0&&(g.newEdges.left+=V)}else U.toLowerCase().includes("east")&&(g.newEdges.right=Math.min(g.startingEdges.right+R.clientX-g.clickStart.x,document.body.clientWidth));g.update()}},update:()=>{g.newEdges==null||g.startingEdges==null||(h.value={x:Math.max(g.newEdges.left,0),y:Math.max(g.newEdges.top,0)},x.value={width:Math.min(Math.max(g.newEdges.right-g.newEdges.left,b),document.body.clientWidth),height:Math.min(Math.max(g.newEdges.bottom-g.newEdges.top,S),document.body.clientHeight)})},mouseUp:(R,U)=>{R.button!=0||g.startingEdges==null||(console.log("mouseUp",U),R.preventDefault(),g.startingEdges=null,g.newEdges=null,g.clickStart=null,g.eventListenerController&&(g.eventListenerController.abort(),g.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)}},u={startingMouse:null,startingPosition:null,mouseDown:R=>{R.button==0&&(R.preventDefault(),console.log("mouseDown"),u.startingMouse={x:R.clientX,y:R.clientY},u.startingPosition=h.value,document.addEventListener("mousemove",u.mouseMove),document.addEventListener("mouseup",u.mouseUp))},mouseMove:R=>{!u.startingMouse||!u.startingPosition||(R.preventDefault(),h.value={x:Math.min(Math.max(u.startingPosition.x+R.clientX-u.startingMouse.x,0),document.body.clientWidth-x.value.width),y:Math.min(Math.max(u.startingPosition.y+R.clientY-u.startingMouse.y,0),document.body.clientHeight-x.value.height)})},mouseUp:R=>{R.button!=0||!u.startingMouse||!u.startingPosition||(R.preventDefault(),u.startingMouse=null,u.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",u.mouseMove),document.removeEventListener("mouseup",u.mouseUp))}};function y(R){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:R??r.tag}}const w=p.computed(()=>Ke.value.get(o)!==-1),d=p.ref(!1),f=p.ref(!0);function L(){i("minimize",y()),Je.minimizeWindowPanel(o)}function D(){d.value=!d.value}function N(){i("close",y(!1)),Je.removeWindowPanel(o),f.value=!1}const P=p.computed(()=>d.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),B={id:o,isShow:w,close:N,open:function(){i("open",y(!0)),f.value=!0},showHidePanel:L};function W(R){if(cn(R))return R;{const U=Number(R);if(U==U)return U;if(R.endsWith("px")){const V=R.substring(0,R.length-2);return Number(V)}if(R.endsWith("%")){const V=R.substring(0,R.length-1);return Number(V)/100*document.body.clientWidth}return 300}}return e(B),p.onMounted(()=>{(function(){let R=90;if(r.hasMin||(R-=30),r.hasMax||(R-=30),r.hasClose||(R-=30),ae.setCssVar("--right-bar-width",R+"px",a.value),!a.value)return;const U=cn(r.titleHeight)?r.titleHeight+"px":r.titleHeight;a.value.style.height=U,a.value.style.lineHeight=U})(),function(){const R=y(B);Je.addWindowPanel(R),i("loaded",R)}(),h.value.x=W(r.left),h.value.y=W(r.top),$(h.value),x.value={width:W(r.nWidth),height:W(r.nHeight)},T(x.value),g.mount()}),p.onUnmounted(()=>{Je.removeWindowPanel(o)}),(R,U)=>(p.openBlock(),p.createBlock(p.Transition,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:p.withCtx(()=>[f.value?p.withDirectives((p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"dragPanelRef",ref:s,class:p.normalizeClass(["dragWindowPanel",{maxPanel:d.value,dragWindowPanel_dark:l.value}])},[p.createElementVNode("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:a,onMousedown:U[0]||(U[0]=(...V)=>u.mouseDown&&u.mouseDown(...V))},[p.renderSlot(R.$slots,"title",{},()=>[r.icon?(p.openBlock(),p.createElementBlock("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,Aa)):p.createCommentVNode("v-if",!0),r.title?(p.openBlock(),p.createElementBlock("span",Da,p.toDisplayString(r.title),1)):p.createCommentVNode("v-if",!0)]),p.createElementVNode("div",Na,[t.hasMin?(p.openBlock(),p.createBlock(p.unref(Zn),{key:0,icon:"ant-design:minus-outlined",onClick:L})):p.createCommentVNode("v-if",!0),t.hasMax?(p.openBlock(),p.createBlock(p.unref(Zn),{key:1,icon:P.value,onClick:D},null,8,["icon"])):p.createCommentVNode("v-if",!0),t.hasClose?(p.openBlock(),p.createBlock(p.unref(Zn),{key:2,icon:"ant-design:close-outlined",onClick:N})):p.createCommentVNode("v-if",!0)])],544),p.createElementVNode("div",$a,[p.renderSlot(R.$slots,"default")]),p.createElementVNode("div",Ba,[p.createElementVNode("div",{class:"cursor-nw-resize",ref:g.refs.northWest},null,512),p.createElementVNode("div",{class:"cursor-n-resize",ref:g.refs.north},null,512),p.createElementVNode("div",{class:"cursor-ne-resize",ref:g.refs.northEast},null,512),p.createElementVNode("div",{class:"cursor-w-resize",ref:g.refs.west},null,512),U[1]||(U[1]=p.createElementVNode("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),p.createElementVNode("div",{class:"cursor-e-resize",ref:g.refs.east},null,512),p.createElementVNode("div",{class:"cursor-sw-resize",ref:g.refs.southWest},null,512),p.createElementVNode("div",{class:"cursor-s-resize",ref:g.refs.south},null,512),p.createElementVNode("div",{class:"cursor-se-resize",ref:g.refs.southEast},null,512)])],2)),[[p.vShow,w.value]]):p.createCommentVNode("v-if",!0)]),_:3}))}});Qn.__scopeId="data-v-39ea9741",Qn.__file="src/controls/xwindow/XWindow.vue";const Ot=new Map,eo=new Map;let Wt;const ja={getDefaultClient(){if(Wt||(Wt=new We(SysConfig.DefaultHproseAPI)),!Wt)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Wt},registerHprose(t,e){const n=eo.get(t);if(!n){const o=new We(e);Ot.set(t,o)}return n},getHprose:t=>eo?.get(t),getProxyHprose:t=>Ot.get(t),unregisterHprose(t){Ot.get(t)&&(eo.delete(t),Ot.delete(t))}},Te={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},to="access_token",Oa=O.Config.ServiceURL.LoginAuthURL;function no(){const t=Zo();t&&ve(Te.RefreshToken,Oa,{refreshToken:t}).then(e=>{oo(e.data)})}function ui(){const t=me.getJsonObject(to);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=5e3?no():setTimeout(no,n-5e3))}function oo(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;if(n>=36e5?(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=Se();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},me.set(to,o,n/1e3),ui()}else me.remove(to)}const Ut="Wm314243",Ft=O.Config.ServiceURL.LoginAuthURL,ro="ROLE_SYSTEM_RIGHT",io=new gt("",sessionStorage);function hi(){return io.get(ro)}function so(t){io.set(ro,t)}function di(){io.remove(ro)}function De(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(De(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function fi(t,e,n="name"){t&&e&&t.forEach(o=>{const r=e.find(i=>i[n]===o[n]);r&&(o.children?r.children&&fi(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Ye(t,e,n,o="name"){const r=t[n],i=e[n];r?i&&fi(r,i,o):i&&(t[n]=i)}function pi(t){if(t&&t.length>0){const e=t.length;let n,o=!1;if(e>0){o=be(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],a=o?s:JSON.parse(s);Ye(r,a,"routes","name"),Ye(r,a,"widgetMenu","name"),Ye(r,a,"widgets","id"),Ye(r,a,"functions","id")}n=r}return n&&(De(n.routes),De(n.widgetMenu),De(n.widgets),De(n.functions)),n}}const ao=[],co=[],lo=[];function Ze(){return hi()}function gi(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=gi(r,o);i&&n.children?.push(i)}})),n}function mi(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=mi(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=mn(),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 ve(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=bt.createInstance({name:this.fileID,driver:bt.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(),bt.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=O.Axios.CancelToken;this.cancelSource=o.source(),this.isStarting=!0;const r={key:this.fileMetaData?.downloadID};let i=0;const s=this.cacheSize;let a=0;for(let l=0;l<this.totalChunks;l++){if(this.keys&&this.keys?.indexOf(l.toString())>=0){i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());continue}const h=l*this.chunkByteSize;let b=h+this.chunkByteSize-1;this.fileMetaData&&b>this.fileMetaData.length&&(b=this.fileMetaData.length-1);const S={range:`bytes=${h}-${b}`};for(;a>=s;)await this.sleep(200);const x=l.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${l+1}/${this.totalChunks}`),a++,ve(n,e,r,S,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async $=>{const T=$.data;a--,await this.currentDB?.setItem(x,T),i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());const g=parseInt(x)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${g}/${this.totalChunks}`),this.savefile()}).catch($=>{a--;const T=parseInt(x)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${T}\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=ks.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:a,value:l}=await s.read();if(a)break;await t.write(l)}e++,this.outputProgress(e),this.dispatchInfo(`\u5B8C\u6210\u7B2C${n+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),bt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}},exports.Download=vt,exports.DownloadByUrl=function({url:t,target:e="_blank",fileName:n}){const o=new URL(t).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=t,s.target=e,s.download!==void 0&&(s.download=n||Ho(t)),document.createEvent){const a=document.createEvent("MouseEvents");return a.initEvent("click",!0,!0),s.dispatchEvent(a),r(!0)}return t.indexOf("?")===-1&&(t+="?download"),window.open(t,e),r(!0)}{const s=document.createElement("canvas"),a=document.createElement("img");a.setAttribute("crossOrigin","Anonymous"),a.src=t,a.onload=l=>{s.width=a.width,s.height=a.height,s.getContext("2d").drawImage(a,0,0,a.width,a.height),s.toBlob(h=>{if(h){const b=document.createElement("a");b.href=window.URL.createObjectURL(h),b.download=Ho(t),b.click(),URL.revokeObjectURL(b.href),r(!0)}},"image/jpeg")},a.onerror=l=>i(l)}})},exports.FileUpload=cr,exports.GetSignalRClient=function(t){if(!t){if(It)return It;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new Qs().configureLogging(I.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!")}),It||(It=e),e},exports.Global=O,exports.GlobalHprose=ja,exports.GlobalMitt=_e,exports.H5Tool=ae,exports.HproseClient=Qe,exports.HttpDownload=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(o){vt(o.data,n)}).catch(o=>{console.warn(o),_e.emit(re.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})},exports.JsonDownload=Fo,exports.LayoutContainer=Pt,exports.LayoutManager=Nr,exports.MinWindowMap=Ke,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=nn,exports.ProxyClient=We,exports.RouterTransition=Dn,exports.RouterTransitionAnimate=$r,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=ss,exports.Storage=gt,exports.StringUtils=pt,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=Ve,exports.SysEvents=re,exports.TOKEN_REFRESH_TIME=5e3,exports.TOKEN_VALID_TIMESPAN=36e5,exports.USER_TOKEN_API=Te,exports.VWindow=Mt,exports.WaterMark=Ts,exports.WindowResizeEvent=Ar,exports.WindowType=oa,exports.WindowsMap=Ae,exports.XWindow=Qn,exports.XWindowManager=Je,exports.XXTEA=Fe,exports.calculateBestTextColor=function(t){return function(e,n){return(Uo(~~e[0],~~e[1],~~e[2])+.05)/(Uo(n[0],n[1],n[2])+.05)}(fn(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"},exports.changeMyPWD=function(t){const e={oldpwd:Fe.encryptToString(t.oldpwd,Ut),newpwd:Fe.encryptToString(t.newpwd,Ut)};return ve(Te.ChangeMyPwd,Ft,e)},exports.checkDoRefreshToken=ui,exports.checkToken=function(t){return ve(Te.CheckToken,Ft,{token:t})},exports.clearLocalToken=bn,exports.clearRight=di,exports.colorIsDark=function(t){if(!mt(t))return;const[e,n,o]=fn(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*n+.114*o<192},exports.createFileUpload=t=>new cr(t),exports.darken=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${gn(t.substring(0,2),e)}${gn(t.substring(2,4),e)}${gn(t.substring(4,6),e)}`},exports.deepMerge=function t(e={},n={}){let o;for(o in n)be(n[o])?e[o]=t(e[o],n[o]):e[o]=n[o];return e},exports.delay=qo,exports.deserialize=function(t){return t==null||t===""?t:new Pe.Reader(new Pe.ByteStream(t)).deserialize()},exports.doRefreshToken=no,exports.exportSystemRights=vr,exports.get=function(t,e){return ve(t,void 0,e)},exports.getCurrentSystemRight=Ze,exports.getData=function(t,e){return O.Axios?.get(t,{params:e}).catch(function(n){yt(n,t,"","\u5916\u90E8Get")})},exports.getEncryptPWD=function(t){return Fe.encryptToString(t,Ut)},exports.getFunctions=function(t,e=2){if(e===0)return t;const n=Ze();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=Se,exports.getLockState=function(){return me.get(xn,!1)},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=lr,exports.getRGBColor=function(t){var e=t.toLowerCase();if(mt(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),a=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(s===0)n=o=r=a;else{var l=a<=.5?a*(s+1):a+s-a*s,h=2*a-l;n=dn(h,l,i+1/3),o=dn(h,l,i),r=dn(h,l,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=Zo,exports.getRight=hi,exports.getRoutes=function(t,e=2){if(e===0)return t;const n=Ze();return n&&n.routes?(lo.length>0||t.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=gi(o,r);i&&lo.push(i)}}),lo):void 0},exports.getSystemRoleRight=async function(t,e=!1){di();const n=Te.GetSystemRights,o=O.Config.ServiceURL.LoginAuthURL,r=await ve(n,o,{systemid:t});if(!r||!r.data)return void O.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 so(s),s}{const s=pi(i);return so(s),s}}},exports.getWidgetConfig=function(t,e=2){if(e===0)return t;const n=Ze();return n&&n.widgets?(ao.length>0||t?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&ao.push(o)}),ao):void 0},exports.getWidgetMenus=function(t,e=2){if(e===0)return t;const n=Ze();return n&&n.widgetMenu?(co.length>0||t.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=mi(o,r);i&&co.push(i)}}),co):void 0},exports.handleNodes=De,exports.hexToRGB=fn,exports.init=function(t,e,n){!O.Config.DefaultHproseAPI&&O.Config.ServiceURL&&(O.Config.DefaultHproseAPI=O.Config.ServiceURL.DefaultHproseAPI),O.Config.DefaultHproseAPI&&pt.isNotEmpty(O.Config.DefaultHproseAPI)&&(O.DefaultProxyClient=new We(O.Config.DefaultHproseAPI));const o=O.Config.UI.GrayMode;o&&ae.setGrayMode(o);const r=new Ko(t,O.EventBus);O.Message=r,O.SystemID=e,O.SystemGroup=n,O.EventBus.on(re.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(re.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),O.EventBus.on(re.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),O.EventBus.on(re.CommonWarnEvent,i=>{r.warn(i)})},exports.initDefaultProxyClient=function(t){const e=lr(t);return e&&(O.DefaultProxyClient=e),e},exports.is=se,exports.isArray=ln,exports.isAsyncFunction=function(t){return se(t,"AsyncFunction")},exports.isBoolean=function(t){return t===!0||t===!1||se(t,"Boolean")},exports.isClient=()=>typeof window<"u",exports.isDate=function(t){return se(t,"Date")},exports.isDef=Bo,exports.isElement=t=>be(t)&&!!t.tagName,exports.isEmpty=function(t){return t==null||(dt(t)||ln(t)?t.length===0:!!be(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 se(t,"Error")},exports.isFunction=ht,exports.isHexColor=mt,exports.isImageDom=function(t){return t&&["IMAGE","IMG"].includes(t.tagName)},exports.isMap=function(t){return se(t,"Map")},exports.isNull=an,exports.isNullAndUnDef=function(t){return sn(t)&&an(t)},exports.isNullOrUnDef=function(t){return sn(t)||an(t)},exports.isNumber=cn,exports.isObjectX=be,exports.isPromise=function(t){return se(t,"Promise")&&be(t)&&ht(t.then)&&ht(t.catch)},exports.isServer=ds,exports.isString=dt,exports.isSymbol=function(t){return se(t,"Symbol")},exports.isUnDef=sn,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 se(t,"WeakMap")},exports.isWeakSet=function(t){return se(t,"WeakSet")},exports.isWindow=t=>typeof window<"u"&&se(t,"Window"),exports.jquery=Ss,exports.lighten=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${pn(t.substring(0,2),e)}${pn(t.substring(2,4),e)}${pn(t.substring(4,6),e)}`},exports.login=async function(t){const e={username:t.username,pwd:Fe.encryptToString(t.pwd,Ut)},n=(await ve(Te.Login,Ft,e))?.data;return n&&oo(n.doubletoken),n},exports.logout=function(){const t=Se();t&&(er(Te.Logout,Ft,{token:t.token,reftoken:t.refresh}),bn())},exports.mergeFilterRoleSysRight=pi,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=Ye,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(){Tn(),document.addEventListener("mousedown",Tn)},exports.post=function(t,e){return Qo(t,void 0,e)},exports.requestGet=ve,exports.requestPost=Qo,exports.requestPostBody=er,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 Pe.Writer(new Pe.ByteStream);return e.serialize(t),e.stream.toString()},exports.setLocalToken=oo,exports.setRight=so,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${qo}\u6BEB\u79D2`)},exports.storage=ps,exports.storageHelper=me,exports.unLockListener=function(){document.removeEventListener("mousedown",Tn)},exports.uuid=Wo,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=Mn(t);return e=e.toString().split("."),e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e=e.join("."),e},exports.verifyNumberIntegerAndFloat=Mn,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=Mn(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={
|
|
9
|
-
|
|
10
|
-
`,o+=` '${i}':${a},
|
|
8
|
+
*/var Mo,ki=Ro?Po.exports:(Ro=1,Po.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 D=e[c][1][k];return r(D||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(D),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 T=o.document.createElement("script");T.onreadystatechange=function(){D(),T.onreadystatechange=null,T.parentNode.removeChild(T),T=null},o.document.documentElement.appendChild(T)}:function(){setTimeout(D,0)};else{var C=new o.MessageChannel;C.port1.onmessage=D,r=function(){C.port2.postMessage(0)}}var k=[];function D(){var T,g;i=!0;for(var u=k.length;u;){for(g=k,k=[],T=-1;++T<u;)g[T]();u=k.length}i=!1}function j(T){k.push(T)!==1||i||r()}e.exports=j}).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(f){if(typeof f!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,f!==r&&j(this,f)}function C(f,y,$){this.promise=f,typeof y=="function"&&(this.onFulfilled=y,this.callFulfilled=this.otherCallFulfilled),typeof $=="function"&&(this.onRejected=$,this.callRejected=this.otherCallRejected)}function k(f,y,$){o(function(){var A;try{A=y($)}catch(L){return i.reject(f,L)}A===f?i.reject(f,new TypeError("Cannot resolve promise with itself")):i.resolve(f,A)})}function D(f){var y=f&&f.then;if(f&&(typeof f=="object"||typeof f=="function")&&typeof y=="function")return function(){y.apply(f,arguments)}}function j(f,y){var $=!1;function A(O){$||($=!0,i.reject(f,O))}function L(O){$||($=!0,i.resolve(f,O))}function z(){y(L,A)}var N=T(z);N.status==="error"&&A(N.value)}function T(f,y){var $={};try{$.value=f(y),$.status="success"}catch(A){$.status="error",$.value=A}return $}function g(f){return f instanceof this?f:i.resolve(new this(r),f)}function u(f){var y=new this(r);return i.reject(y,f)}function w(f){var y=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=f.length,A=!1;if(!$)return this.resolve([]);for(var L=new Array($),z=0,N=-1,O=new this(r);++N<$;)P(f[N],N);return O;function P(H,V){function oe(Q){L[V]=Q,++z!==$||A||(A=!0,i.resolve(O,L))}y.resolve(H).then(oe,function(Q){A||(A=!0,i.reject(O,Q))})}}function v(f){var y=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=f.length,A=!1;if(!$)return this.resolve([]);for(var L=-1,z=new this(r);++L<$;)N(f[L]);return z;function N(O){y.resolve(O).then(function(P){A||(A=!0,i.resolve(z,P))},function(P){A||(A=!0,i.reject(z,P))})}}e.exports=m,m.prototype.catch=function(f){return this.then(null,f)},m.prototype.then=function(f,y){if(typeof f!="function"&&this.state===c||typeof y!="function"&&this.state===s)return this;var $=new this.constructor(r);return this.state!==h?k($,this.state===c?f:y,this.outcome):this.queue.push(new C($,f,y)),$},C.prototype.callFulfilled=function(f){i.resolve(this.promise,f)},C.prototype.otherCallFulfilled=function(f){k(this.promise,this.onFulfilled,f)},C.prototype.callRejected=function(f){i.reject(this.promise,f)},C.prototype.otherCallRejected=function(f){k(this.promise,this.onRejected,f)},i.resolve=function(f,y){var $=T(D,y);if($.status==="error")return i.reject(f,$.value);var A=$.value;if(A)j(f,A);else{f.state=c,f.outcome=y;for(var L=-1,z=f.queue.length;++L<z;)f.queue[L].callFulfilled(y)}return f},i.reject=function(f,y){f.state=s,f.outcome=y;for(var $=-1,A=f.queue.length;++$<A;)f.queue[$].callRejected(y);return f},m.resolve=g,m.reject=u,m.all=w,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 p=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),_=0;_<a.length;_+=1)p.append(a[_]);return p.getBlob(d.type)}}typeof Promise>"u"&&t(3);var m=Promise;function C(a,d){d&&a.then(function(p){d(null,p)},function(p){d(p)})}function k(a,d,p){typeof d=="function"&&a.then(d),typeof p=="function"&&a.catch(p)}function D(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function j(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var T="local-forage-detect-blob-support",g=void 0,u={},w=Object.prototype.toString,v="readonly",f="readwrite";function y(a){for(var d=a.length,p=new ArrayBuffer(d),_=new Uint8Array(p),b=0;b<d;b++)_[b]=a.charCodeAt(b);return p}function $(a){return new m(function(d){var p=a.transaction(T,f),_=h([""]);p.objectStore(T).put(_,"key"),p.onabort=function(b){b.preventDefault(),b.stopPropagation(),d(!1)},p.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 A(a){return typeof g=="boolean"?m.resolve(g):$(a).then(function(d){return g=d})}function L(a){var d=u[a.name],p={};p.promise=new m(function(_,b){p.resolve=_,p.reject=b}),d.deferredOperations.push(p),d.dbReady?d.dbReady=d.dbReady.then(function(){return p.promise}):d.dbReady=p.promise}function z(a){var d=u[a.name].deferredOperations.pop();if(d)return d.resolve(),d.promise}function N(a,d){var p=u[a.name].deferredOperations.pop();if(p)return p.reject(d),p.promise}function O(a,d){return new m(function(p,_){if(u[a.name]=u[a.name]||Tn(),a.db){if(!d)return p(a.db);L(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(T)}catch(R){if(R.name!=="ConstraintError")throw R;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()},p(E),z(a)}})}function P(a){return O(a,!1)}function H(a){return O(a,!0)}function V(a,d){if(!a.db)return!0;var p=!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||p){if(p){var S=a.db.version+1;S>a.version&&(a.version=S)}return!0}return!1}function oe(a){return new m(function(d,p){var _=new FileReader;_.onerror=p,_.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([y(atob(a.data))],{type:a.type})}function he(a){return a&&a.__local_forage_encoded_blob}function He(a){var d=this,p=d._initReady().then(function(){var _=u[d._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return k(p,a,a),p}function St(a){L(a);for(var d=u[a.name],p=d.forages,_=0;_<p.length;_++){var b=p[_];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)?H(a):S}).then(function(S){a.db=d.db=S;for(var E=0;E<p.length;E++)p[E]._dbInfo.db=S}).catch(function(S){throw N(a,S),S})}function le(a,d,p,_){_===void 0&&(_=1);try{var b=a.db.transaction(a.storeName,d);p(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),H(a)}).then(function(){return St(a).then(function(){le(a,d,p,_-1)})}).catch(p);p(S)}}function Tn(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ar(a){var d=this,p={db:null};if(a)for(var _ in a)p[_]=a[_];var b=u[p.name];b||(b=Tn(),u[p.name]=b),b.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=He);var S=[];function E(){return m.resolve()}for(var I=0;I<b.forages.length;I++){var R=b.forages[I];R!==d&&S.push(R._initReady().catch(E))}var M=b.forages.slice(0);return m.all(S).then(function(){return p.db=b.db,P(p)}).then(function(B){return p.db=B,V(p,d._defaultConfig.version)?H(p):B}).then(function(B){p.db=b.db=B,d._dbInfo=p;for(var U=0;U<M.length;U++){var F=M[U];F!==d&&(F._dbInfo.db=p.db,F._dbInfo.version=p.version)}})}function cr(a,d){var p=this;a=D(a);var _=new m(function(b,S){p.ready().then(function(){le(p._dbInfo,v,function(E,I){if(E)return S(E);try{var R=I.objectStore(p._dbInfo.storeName).get(a);R.onsuccess=function(){var M=R.result;M===void 0&&(M=null),he(M)&&(M=Q(M)),b(M)},R.onerror=function(){S(R.error)}}catch(M){S(M)}})}).catch(S)});return C(_,d),_}function lr(a,d){var p=this,_=new m(function(b,S){p.ready().then(function(){le(p._dbInfo,v,function(E,I){if(E)return S(E);try{var R=I.objectStore(p._dbInfo.storeName).openCursor(),M=1;R.onsuccess=function(){var B=R.result;if(B){var U=B.value;he(U)&&(U=Q(U));var F=a(U,B.key,M++);F!==void 0?b(F):B.continue()}else b()},R.onerror=function(){S(R.error)}}catch(B){S(B)}})}).catch(S)});return C(_,d),_}function ur(a,d,p){var _=this;a=D(a);var b=new m(function(S,E){var I;_.ready().then(function(){return I=_._dbInfo,w.call(d)==="[object Blob]"?A(I.db).then(function(R){return R?d:oe(d)}):d}).then(function(R){le(_._dbInfo,f,function(M,B){if(M)return E(M);try{var U=B.objectStore(_._dbInfo.storeName);R===null&&(R=void 0);var F=U.put(R,a);B.oncomplete=function(){R===void 0&&(R=null),S(R)},B.onabort=B.onerror=function(){var X=F.error?F.error:F.transaction.error;E(X)}}catch(X){E(X)}})}).catch(E)});return C(b,p),b}function hr(a,d){var p=this;a=D(a);var _=new m(function(b,S){p.ready().then(function(){le(p._dbInfo,f,function(E,I){if(E)return S(E);try{var R=I.objectStore(p._dbInfo.storeName).delete(a);I.oncomplete=function(){b()},I.onerror=function(){S(R.error)},I.onabort=function(){var M=R.error?R.error:R.transaction.error;S(M)}}catch(M){S(M)}})}).catch(S)});return C(_,d),_}function dr(a){var d=this,p=new m(function(_,b){d.ready().then(function(){le(d._dbInfo,f,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 R=I.error?I.error:I.transaction.error;b(R)}}catch(R){b(R)}})}).catch(b)});return C(p,a),p}function fr(a){var d=this,p=new m(function(_,b){d.ready().then(function(){le(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(R){b(R)}})}).catch(b)});return C(p,a),p}function pr(a,d){var p=this,_=new m(function(b,S){a<0?b(null):p.ready().then(function(){le(p._dbInfo,v,function(E,I){if(E)return S(E);try{var R=I.objectStore(p._dbInfo.storeName),M=!1,B=R.openKeyCursor();B.onsuccess=function(){var U=B.result;U?a===0||M?b(U.key):(M=!0,U.advance(a)):b(null)},B.onerror=function(){S(B.error)}}catch(U){S(U)}})}).catch(S)});return C(_,d),_}function gr(a){var d=this,p=new m(function(_,b){d.ready().then(function(){le(d._dbInfo,v,function(S,E){if(S)return b(S);try{var I=E.objectStore(d._dbInfo.storeName).openKeyCursor(),R=[];I.onsuccess=function(){var M=I.result;M?(R.push(M.key),M.continue()):_(R)},I.onerror=function(){b(I.error)}}catch(M){b(M)}})}).catch(b)});return C(p,a),p}function mr(a,d){d=j.apply(this,arguments);var p=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||p.name,a.storeName=a.storeName||p.storeName);var _,b=this;if(a.name){var S=a.name===p.name&&b._dbInfo.db?m.resolve(b._dbInfo.db):P(a).then(function(E){var I=u[a.name],R=I.forages;I.db=E;for(var M=0;M<R.length;M++)R[M]._dbInfo.db=E;return E});_=a.storeName?S.then(function(E){if(E.objectStoreNames.contains(a.storeName)){var I=E.version+1;L(a);var R=u[a.name],M=R.forages;E.close();for(var B=0;B<M.length;B++){var U=M[B];U._dbInfo.db=null,U._dbInfo.version=I}var F=new m(function(X,G){var ee=s.open(a.name,I);ee.onerror=function(de){ee.result.close(),G(de)},ee.onupgradeneeded=function(){ee.result.deleteObjectStore(a.storeName)},ee.onsuccess=function(){var de=ee.result;de.close(),X(de)}});return F.then(function(X){R.db=X;for(var G=0;G<M.length;G++){var ee=M[G];ee._dbInfo.db=X,z(ee._dbInfo)}}).catch(function(X){throw(N(a,X)||m.resolve()).catch(function(){}),X})}}):S.then(function(E){L(a);var I=u[a.name],R=I.forages;E.close();for(var M=0;M<R.length;M++)R[M]._dbInfo.db=null;var B=new m(function(U,F){var X=s.deleteDatabase(a.name);X.onerror=function(){var G=X.result;G&&G.close(),F(X.error)},X.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},X.onsuccess=function(){var G=X.result;G&&G.close(),U(G)}});return B.then(function(U){I.db=U;for(var F=0;F<R.length;F++)z(R[F]._dbInfo)}).catch(function(U){throw(N(a,U)||m.resolve()).catch(function(){}),U})})}else _=m.reject("Invalid arguments");return C(_,d),_}var vr={_driver:"asyncStorage",_initStorage:ar,_support:c(),iterate:lr,getItem:cr,setItem:ur,removeItem:hr,clear:dr,length:fr,key:pr,keys:gr,dropInstance:mr};function yr(){return typeof openDatabase=="function"}var ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wr="~~local_forage_type~",Rn=/^~~local_forage_type~([^~]+)~/,qe="__lfsc__:",Ct=qe.length,Et="arbf",kt="blob",Pn="si08",Mn="ui08",zn="uic8",An="si16",Ln="si32",Dn="ur16",Bn="ui32",$n="fl32",Nn="fl64",Wn=Ct+Et.length,Un=Object.prototype.toString;function On(a){var d,p,_,b,S,E=.75*a.length,I=a.length,R=0;a[a.length-1]==="="&&(E--,a[a.length-2]==="="&&E--);var M=new ArrayBuffer(E),B=new Uint8Array(M);for(d=0;d<I;d+=4)p=ge.indexOf(a[d]),_=ge.indexOf(a[d+1]),b=ge.indexOf(a[d+2]),S=ge.indexOf(a[d+3]),B[R++]=p<<2|_>>4,B[R++]=(15&_)<<4|b>>2,B[R++]=(3&b)<<6|63&S;return M}function xt(a){var d,p=new Uint8Array(a),_="";for(d=0;d<p.length;d+=3)_+=ge[p[d]>>2],_+=ge[(3&p[d])<<4|p[d+1]>>4],_+=ge[(15&p[d+1])<<2|p[d+2]>>6],_+=ge[63&p[d+2]];return p.length%3==2?_=_.substring(0,_.length-1)+"=":p.length%3==1&&(_=_.substring(0,_.length-2)+"=="),_}function br(a,d){var p="";if(a&&(p=Un.call(a)),a&&(p==="[object ArrayBuffer]"||a.buffer&&Un.call(a.buffer)==="[object ArrayBuffer]")){var _,b=qe;a instanceof ArrayBuffer?(_=a,b+=Et):(_=a.buffer,p==="[object Int8Array]"?b+=Pn:p==="[object Uint8Array]"?b+=Mn:p==="[object Uint8ClampedArray]"?b+=zn:p==="[object Int16Array]"?b+=An:p==="[object Uint16Array]"?b+=Dn:p==="[object Int32Array]"?b+=Ln:p==="[object Uint32Array]"?b+=Bn:p==="[object Float32Array]"?b+=$n:p==="[object Float64Array]"?b+=Nn:d(new Error("Failed to get type for BinaryArray"))),d(b+xt(_))}else if(p==="[object Blob]"){var S=new FileReader;S.onload=function(){var E=wr+a.type+"~"+xt(this.result);d(qe+kt+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 _r(a){if(a.substring(0,Ct)!==qe)return JSON.parse(a);var d,p=a.substring(Wn),_=a.substring(Ct,Wn);if(_===kt&&Rn.test(p)){var b=p.match(Rn);d=b[1],p=p.substring(b[0].length)}var S=On(p);switch(_){case Et:return S;case kt:return h([S],{type:d});case Pn:return new Int8Array(S);case Mn:return new Uint8Array(S);case zn:return new Uint8ClampedArray(S);case An:return new Int16Array(S);case Dn:return new Uint16Array(S);case Ln:return new Int32Array(S);case Bn:return new Uint32Array(S);case $n:return new Float32Array(S);case Nn:return new Float64Array(S);default:throw new Error("Unkown type: "+_)}}var It={serialize:br,deserialize:_r,stringToBuffer:On,bufferToString:xt};function jn(a,d,p,_){a.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],p,_)}function Sr(a){var d=this,p={db:null};if(a)for(var _ in a)p[_]=typeof a[_]!="string"?a[_].toString():a[_];var b=new m(function(S,E){try{p.db=openDatabase(p.name,String(p.version),p.description,p.size)}catch(I){return E(I)}p.db.transaction(function(I){jn(I,p,function(){d._dbInfo=p,S()},function(R,M){E(M)})},E)});return p.serializer=It,b}function me(a,d,p,_,b,S){a.executeSql(p,_,b,function(E,I){I.code===I.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(R,M){M.rows.length?S(R,I):jn(R,d,function(){R.executeSql(p,_,b,S)},S)},S):S(E,I)},S)}function Cr(a,d){var p=this;a=D(a);var _=new m(function(b,S){p.ready().then(function(){var E=p._dbInfo;E.db.transaction(function(I){me(I,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[a],function(R,M){var B=M.rows.length?M.rows.item(0).value:null;B&&(B=E.serializer.deserialize(B)),b(B)},function(R,M){S(M)})})}).catch(S)});return C(_,d),_}function Er(a,d){var p=this,_=new m(function(b,S){p.ready().then(function(){var E=p._dbInfo;E.db.transaction(function(I){me(I,E,"SELECT * FROM "+E.storeName,[],function(R,M){for(var B=M.rows,U=B.length,F=0;F<U;F++){var X=B.item(F),G=X.value;if(G&&(G=E.serializer.deserialize(G)),(G=a(G,X.key,F+1))!==void 0)return void b(G)}b()},function(R,M){S(M)})})}).catch(S)});return C(_,d),_}function Hn(a,d,p,_){var b=this;a=D(a);var S=new m(function(E,I){b.ready().then(function(){d===void 0&&(d=null);var R=d,M=b._dbInfo;M.serializer.serialize(d,function(B,U){U?I(U):M.db.transaction(function(F){me(F,M,"INSERT OR REPLACE INTO "+M.storeName+" (key, value) VALUES (?, ?)",[a,B],function(){E(R)},function(X,G){I(G)})},function(F){if(F.code===F.QUOTA_ERR){if(_>0)return void E(Hn.apply(b,[a,R,p,_-1]));I(F)}})})}).catch(I)});return C(S,p),S}function kr(a,d,p){return Hn.apply(this,[a,d,p,1])}function xr(a,d){var p=this;a=D(a);var _=new m(function(b,S){p.ready().then(function(){var E=p._dbInfo;E.db.transaction(function(I){me(I,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[a],function(){b()},function(R,M){S(M)})})}).catch(S)});return C(_,d),_}function Ir(a){var d=this,p=new m(function(_,b){d.ready().then(function(){var S=d._dbInfo;S.db.transaction(function(E){me(E,S,"DELETE FROM "+S.storeName,[],function(){_()},function(I,R){b(R)})})}).catch(b)});return C(p,a),p}function Tr(a){var d=this,p=new m(function(_,b){d.ready().then(function(){var S=d._dbInfo;S.db.transaction(function(E){me(E,S,"SELECT COUNT(key) as c FROM "+S.storeName,[],function(I,R){var M=R.rows.item(0).c;_(M)},function(I,R){b(R)})})}).catch(b)});return C(p,a),p}function Rr(a,d){var p=this,_=new m(function(b,S){p.ready().then(function(){var E=p._dbInfo;E.db.transaction(function(I){me(I,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[a+1],function(R,M){var B=M.rows.length?M.rows.item(0).key:null;b(B)},function(R,M){S(M)})})}).catch(S)});return C(_,d),_}function Pr(a){var d=this,p=new m(function(_,b){d.ready().then(function(){var S=d._dbInfo;S.db.transaction(function(E){me(E,S,"SELECT key FROM "+S.storeName,[],function(I,R){for(var M=[],B=0;B<R.rows.length;B++)M.push(R.rows.item(B).key);_(M)},function(I,R){b(R)})})}).catch(b)});return C(p,a),p}function Mr(a){return new m(function(d,p){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){p(S)})},function(_){p(_)})})}function zr(a,d){d=j.apply(this,arguments);var p=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||p.name,a.storeName=a.storeName||p.storeName);var _,b=this;return _=a.name?new m(function(S){var E;E=a.name===p.name?b._dbInfo.db:openDatabase(a.name,"","",0),a.storeName?S({db:E,storeNames:[a.storeName]}):S(Mr(E))}).then(function(S){return new m(function(E,I){S.db.transaction(function(R){function M(X){return new m(function(G,ee){R.executeSql("DROP TABLE IF EXISTS "+X,[],function(){G()},function(de,Pt){ee(Pt)})})}for(var B=[],U=0,F=S.storeNames.length;U<F;U++)B.push(M(S.storeNames[U]));m.all(B).then(function(){E()}).catch(function(X){I(X)})},function(R){I(R)})})}):m.reject("Invalid arguments"),C(_,d),_}var Ar={_driver:"webSQLStorage",_initStorage:Sr,_support:yr(),iterate:Er,getItem:Cr,setItem:kr,removeItem:xr,clear:Ir,length:Tr,key:Rr,keys:Pr,dropInstance:zr};function Lr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qn(a,d){var p=a.name+"/";return a.storeName!==d.storeName&&(p+=a.storeName+"/"),p}function Dr(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function Br(){return!Dr()||localStorage.length>0}function $r(a){var d=this,p={};if(a)for(var _ in a)p[_]=a[_];return p.keyPrefix=qn(a,d._defaultConfig),Br()?(d._dbInfo=p,p.serializer=It,m.resolve()):m.reject()}function Nr(a){var d=this,p=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(p,a),p}function Wr(a,d){var p=this;a=D(a);var _=p.ready().then(function(){var b=p._dbInfo,S=localStorage.getItem(b.keyPrefix+a);return S&&(S=b.serializer.deserialize(S)),S});return C(_,d),_}function Ur(a,d){var p=this,_=p.ready().then(function(){for(var b=p._dbInfo,S=b.keyPrefix,E=S.length,I=localStorage.length,R=1,M=0;M<I;M++){var B=localStorage.key(M);if(B.indexOf(S)===0){var U=localStorage.getItem(B);if(U&&(U=b.serializer.deserialize(U)),(U=a(U,B.substring(E),R++))!==void 0)return U}}});return C(_,d),_}function Or(a,d){var p=this,_=p.ready().then(function(){var b,S=p._dbInfo;try{b=localStorage.key(a)}catch{b=null}return b&&(b=b.substring(S.keyPrefix.length)),b});return C(_,d),_}function jr(a){var d=this,p=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(p,a),p}function Hr(a){var d=this.keys().then(function(p){return p.length});return C(d,a),d}function qr(a,d){var p=this;a=D(a);var _=p.ready().then(function(){var b=p._dbInfo;localStorage.removeItem(b.keyPrefix+a)});return C(_,d),_}function Fr(a,d,p){var _=this;a=D(a);var b=_.ready().then(function(){d===void 0&&(d=null);var S=d;return new m(function(E,I){var R=_._dbInfo;R.serializer.serialize(d,function(M,B){if(B)I(B);else try{localStorage.setItem(R.keyPrefix+a,M),E(S)}catch(U){U.name!=="QuotaExceededError"&&U.name!=="NS_ERROR_DOM_QUOTA_REACHED"||I(U),I(U)}})})});return C(b,p),b}function Vr(a,d){if(d=j.apply(this,arguments),!(a=typeof a!="function"&&a||{}).name){var p=this.config();a.name=a.name||p.name,a.storeName=a.storeName||p.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 Xr={_driver:"localStorageWrapper",_initStorage:$r,_support:Lr(),iterate:Ur,getItem:Wr,setItem:Fr,removeItem:qr,clear:Nr,length:Hr,key:Or,keys:jr,dropInstance:Vr},Gr=function(a,d){return a===d||typeof a=="number"&&typeof d=="number"&&isNaN(a)&&isNaN(d)},Kr=function(a,d){for(var p=a.length,_=0;_<p;){if(Gr(a[_],d))return!0;_++}return!1},Fn=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},Me={},Vn={},xe={INDEXEDDB:vr,WEBSQL:Ar,LOCALSTORAGE:Xr},Yr=[xe.INDEXEDDB._driver,xe.WEBSQL._driver,xe.LOCALSTORAGE._driver],Fe=["dropInstance"],Tt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Fe),Jr={description:"",driver:Yr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Zr(a,d){a[d]=function(){var p=arguments;return a.ready().then(function(){return a[d].apply(a,p)})}}function Rt(){for(var a=1;a<arguments.length;a++){var d=arguments[a];if(d)for(var p in d)d.hasOwnProperty(p)&&(Fn(d[p])?arguments[0][p]=d[p].slice():arguments[0][p]=d[p])}return arguments[0]}var Qr=function(){function a(d){for(var p in r(this,a),xe)if(xe.hasOwnProperty(p)){var _=xe[p],b=_._driver;this[p]=b,Me[b]||this.defineDriver(_)}this._defaultConfig=Rt({},Jr),this._config=Rt({},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 p in d){if(p==="storeName"&&(d[p]=d[p].replace(/\W/g,"_")),p==="version"&&typeof d[p]!="number")return new Error("Database version must be a number.");this._config[p]=d[p]}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,p,_){var b=new m(function(S,E){try{var I=d._driver,R=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!d._driver)return void E(R);for(var M=Tt.concat("_initStorage"),B=0,U=M.length;B<U;B++){var F=M[B];if((!Kr(Fe,F)||d[F])&&typeof d[F]!="function")return void E(R)}var X=function(){for(var ee=function(ti){return function(){var ni=new Error("Method "+ti+" is not implemented by the current driver"),Xn=m.reject(ni);return C(Xn,arguments[arguments.length-1]),Xn}},de=0,Pt=Fe.length;de<Pt;de++){var Mt=Fe[de];d[Mt]||(d[Mt]=ee(Mt))}};X();var G=function(ee){Me[I]&&console.info("Redefining LocalForage driver: "+I),Me[I]=d,Vn[I]=ee,S()};"_support"in d?d._support&&typeof d._support=="function"?d._support().then(G,E):G(!!d._support):G(!0)}catch(ee){E(ee)}});return k(b,p,_),b},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(d,p,_){var b=Me[d]?m.resolve(Me[d]):m.reject(new Error("Driver not found."));return k(b,p,_),b},a.prototype.getSerializer=function(d){var p=m.resolve(It);return k(p,d),p},a.prototype.ready=function(d){var p=this,_=p._driverSet.then(function(){return p._ready===null&&(p._ready=p._initDriver()),p._ready});return k(_,d,d),_},a.prototype.setDriver=function(d,p,_){var b=this;Fn(d)||(d=[d]);var S=this._getSupportedDrivers(d);function E(){b._config.driver=b.driver()}function I(B){return b._extend(B),E(),b._ready=b._initStorage(b._config),b._ready}function R(B){return function(){var U=0;function F(){for(;U<B.length;){var X=B[U];return U++,b._dbInfo=null,b._ready=null,b.getDriver(X).then(I).catch(F)}E();var G=new Error("No available storage method found.");return b._driverSet=m.reject(G),b._driverSet}return F()}}var M=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=M.then(function(){var B=S[0];return b._dbInfo=null,b._ready=null,b.getDriver(B).then(function(U){b._driver=U._driver,E(),b._wrapLibraryMethodsWithReady(),b._initDriver=R(S)})}).catch(function(){E();var B=new Error("No available storage method found.");return b._driverSet=m.reject(B),b._driverSet}),k(this._driverSet,p,_),this._driverSet},a.prototype.supports=function(d){return!!Vn[d]},a.prototype._extend=function(d){Rt(this,d)},a.prototype._getSupportedDrivers=function(d){for(var p=[],_=0,b=d.length;_<b;_++){var S=d[_];this.supports(S)&&p.push(S)}return p},a.prototype._wrapLibraryMethodsWithReady=function(){for(var d=0,p=Tt.length;d<p;d++)Zr(this,Tt[d])},a.prototype.createInstance=function(d){return new a(d)},a}(),ei=new Qr;e.exports=ei},{3:3}]},{},[4])(4)),st=Qe(ki),zo={exports:{}},xi=(Mo||(Mo=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,D){let j={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},T=0,g=null,u=null,w=null;if(Number.isFinite(k)?([D,k]=[k,D],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),j.size=D,j.writableStrategy=k):k&&k.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),j.size=D,j.writableStrategy=k):j=k||{},!s){n||(n=i?m(h.mitm):function($){const A="width=200,height=100",L=document.createDocumentFragment(),z={frame:e.open($,"popup",A),loaded:!1,isIframe:!1,isPopup:!0,remove(){z.frame.close()},addEventListener(...O){L.addEventListener(...O)},dispatchEvent(...O){L.dispatchEvent(...O)},removeEventListener(...O){L.removeEventListener(...O)},postMessage(...O){z.frame.postMessage(...O)}},N=O=>{O.source===z.frame&&(z.loaded=!0,e.removeEventListener("message",N),z.dispatchEvent(new Event("load")))};return e.addEventListener("message",N),z}(h.mitm)),u=new MessageChannel,C=encodeURIComponent(C.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const f={transferringReadable:o,pathname:j.pathname||Math.random().toString().slice(-6)+"/"+C,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+C}};j.size&&(f.headers["Content-Length"]=j.size);const y=[f,"*",[u.port2]];if(o){const $=c==="iframe"?void 0:{transform(L,z){if(!(L instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");T+=L.length,z.enqueue(L),g&&(location.href=g,g=null)},flush(){g&&(location.href=g)}};w=new h.TransformStream($,j.writableStrategy,j.readableStrategy);const A=w.readable;u.port1.postMessage({readableStream:A},[A])}u.port1.onmessage=$=>{$.data.download?c==="navigate"?(n.remove(),n=null,T?location.href=$.data.download:g=$.data.download):(n.isPopup&&(n.remove(),n=null,c==="iframe"&&m(h.mitm)),m($.data.download)):$.data.abort&&(v=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...y):n.addEventListener("load",()=>{n.postMessage(...y)},{once:!0})}let v=[];return!s&&w&&w.writable||new h.WritableStream({write(f){if(!(f instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?v.push(f):(u.port1.postMessage(f),T+=f.length,g&&(location.href=g,g=null))},close(){if(s){const f=new Blob(v,{type:"application/octet-stream; charset=utf-8"}),y=document.createElement("a");y.href=URL.createObjectURL(f),y.download=C,y.click()}else u.port1.postMessage("end")},abort(){v=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},j.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=(...D)=>k.contentWindow.postMessage(...D),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})}(zo)),zo.exports),Ii=Qe(xi);function Ti(t,e){const n=`${t}_${e}`;return se.MD5(n)}function Ao(t){const e=function(c){if(!c)return;const h=c,m=[];if(h)for(let C of h){const k=Lo(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=Do(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,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:Ti(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 Lo(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=Lo(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function Do(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=Do(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 Bo=!0;try{String.fromCharCode.apply(String,[1,2])}catch{Bo=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var cn=2654435769;function $o(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 at(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 ct(t,e,n,o,r,i){return(n>>>5^e<<2)+(e>>>3^n<<4)^(t^e)+(i[3&o^r]^n)}function No(t){if(t.length<16){var e=new Uint8Array(16);e.set(t),t=e}return t}function lt(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 Wo(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 Ri(t){var e=t.length;if(e===0)return"";var n=Bo?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 Uo(t,e){return typeof t=="string"&&(t=lt(t)),typeof e=="string"&&(e=lt(e)),t==null||t.length===0?t:$o(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]+ct(s,r,i,h,c,o));r=n[0],i=n[k]=_e(n[k]+ct(s,r,i,k,c,o))}return n}(at(t,!0),at(No(e),!1)),!1)}function Oo(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=lt(e)),t==null||t.length===0?t:$o(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]-ct(s,r,i,h,c,o));i=n[C],r=n[0]=_e(n[0]-ct(s,r,i,0,c,o))}return n}(at(t,!1),at(No(e),!1)),!0)}const Le={toBytes:lt,toString:Wo,encrypt:Uo,encryptToString:function(t,e){return window.btoa(Ri(Uo(t,e)))},decrypt:Oo,decryptToString:function(t,e){return Wo(Oo(t,e))}},jo=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},Pi={set:t=>{let e=jo(t);document.getElementById(e)===null&&(e=jo(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 ue extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class Mi extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class zi extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class Ai extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class Ho 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 qo{constructor(e,n,o){this.statusCode=e,this.statusText=n,this.content=o}}class ut{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 De{constructor(){}log(e,n){}}De.instance=new De;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 Be(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 Fo(t,e,n,o,r,i){const s={},[c,h]=Te();s[c]=h,t.log(x.Trace,`(${e} transport) sending data. ${Be(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 ht{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 Te(){let t="X-SignalR-User-Agent";return Y.isNode&&(t="User-Agent"),[t,Bi("8.0.7",$i(),Wi(),Ni())]}function Bi(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 $i(){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 Ni(){if(Y.isNode)return process.versions.node}function Wi(){return Y.isNode?"NodeJS":"Browser"}function un(t){return t.stack?t.stack:t.message?t.message:`${t}`}class Ui extends ut{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 ue;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 ue});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 Vo(r,"text");throw new Se(h||r.statusText,r.status)}const s=Vo(r,e.responseType),c=await s;return new qo(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 Vo(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 Oi extends ut{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ue):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 ue)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new qo(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 ji extends ut{constructor(e){if(super(),typeof fetch<"u"||Y.isNode)this._httpClient=new Ui(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new Oi(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ue):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 Hi{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 q;(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"})(q||(q={}));class qi{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 Vi(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===q.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:q.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 q.Invocation:case q.StreamItem:case q.Completion:case q.StreamInvocation:case q.CancelInvocation:return!0;case q.Close:case q.Sequence:case q.Ping:case q.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:q.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Vi{constructor(e,n,o,r){this._message=e,this._id=n,this._resolver=o,this._rejector=r}}var K;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(K||(K={}));class kn{static create(e,n,o,r,i,s,c){return new kn(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 Hi,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=K.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:q.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!==K.Disconnected&&this._connectionState!==K.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!==K.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=K.Connecting,this._logger.log(x.Debug,"Starting HubConnection.");try{await this._startInternal(),Y.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=K.Connected,this._connectionStarted=!0,this._logger.log(x.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=K.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===K.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===K.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=K.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===K.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new ue("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 qi;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===q.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===q.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 q.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(x.Error,`Invoke client method threw error: ${un(r)}`)});break;case q.StreamItem:case q.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===q.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(x.Error,`Stream callback threw error: ${un(i)}`)}}break}case q.Ping:break;case q.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 q.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case q.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===K.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 ue("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===K.Disconnecting?this._completeClose(e):this._connectionState===K.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===K.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=K.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=K.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!==K.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!==K.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=K.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!==K.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===K.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:q.Invocation}:{arguments:n,target:e,type:q.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:e,type:q.Invocation}:{arguments:n,invocationId:i.toString(),target:e,type:q.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:q.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:e,type:q.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:q.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:q.StreamItem}}_createCompletionMessage(e,n,o){return n?{error:n,invocationId:e,type:q.Completion}:{invocationId:e,result:o,type:q.Completion}}_createCloseMessage(){return{type:q.Close}}}const Xi=[0,2e3,1e4,3e4,null];class Xo{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Xi}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class Ee{}Ee.Authorization="Authorization",Ee.Cookie="Cookie";class Gi extends ut{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 Go{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]=Te(),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. ${Be(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?Fo(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]=Te();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 Yi{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]=Te();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. ${Be(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?Fo(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 Ji{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]=Te();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. ${Be(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. ${Be(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 Zi{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 ht(x.Information):o===null?De.instance:o.log!==void 0?o:new ht(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 Gi(n.httpClient||new ji(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 ue(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 ue(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 xn(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 ue("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 Go&&(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]=Te();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 Ho("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 Ho(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 Ai(`${m.transport} failed: ${k}`,Z[m.transport])),this._connectionState!=="Connecting"){const D="Failed to select transport before stop() was called.";return this._logger.log(x.Debug,D),Promise.reject(new ue(D))}}}}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 Ji(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 Yi(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case Z.LongPolling:return new Go(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)!=0}(n,i))return this._logger.log(x.Debug,`Skipping transport '${Z[i]}' because it was disabled by the client.`),new zi(`'${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 Mi(`'${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 xn{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new dt,this._transportResult=new dt,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new dt),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 dt;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):xn._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 dt{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Qi{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=De.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 q.Invocation:this._isInvocationMessage(s);break;case q.StreamItem:this._isStreamItemMessage(s);break;case q.Completion:this._isCompletionMessage(s);break;case q.Ping:case q.Close:break;case q.Ack:this._isAckMessage(s);break;case q.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 es={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 ts{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=es[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(e);this.logger=new ht(n)}else this.logger=new ht(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 Xo(e):this.reconnectPolicy=e:this.reconnectPolicy=new Xo,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 Zi(this.url,e);return kn.create(n,this.logger||De.instance,this.protocol||new Qi,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let ft;const hn=new Set;function Ko(t){return t!==null?parseFloat(t):0}function pt(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(Ko).reduce((r,i)=>r+i)),o=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(Ko).reduce((r,i)=>r+i));return{width:n,height:o}}class Yo{width;height;constructor(e,n){this.width=e,this.height=n}}function ns(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 os(t,e,n,o){const r=t-n,i=e-o;return r*r+i*i}window.addEventListener("resize",t=>{hn.forEach(e=>{e&&Je(e.fixPosition)&&e.fixPosition()})});const gt=[];var mt=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:Ye},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=()=>{gt.push(o),c=new ui(t.zGroup,C),t.isOpen&&function(A){A&&(l.nextTick(()=>{r++==0&&(v(o),function(){const L=k.value,{width:z,height:N}=Dt(L);let O,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")O=t.left,P=t.top;else{const H=t.positionHint||"auto";switch(H){case"auto":{let V=20,oe=50,Q=0;do{if(gt.every(he=>{if(!he.isOpen||o==he)return!0;const He=ns(he);if(He==null)return!0;const{left:St,top:le}=He;return os(St,le,V,oe)>16}))break;V=(V+40)%(window.innerWidth-200),oe=(oe+40)%(window.innerHeight-200)}while(++Q<100);O=V,P=oe}break;case"center":O=(window.innerWidth-z)/2,P=(window.innerHeight-N)/2,console.log(O,P,window.innerWidth,window.innerHeight,"111111");break;default:try{const V=H.split("/").map(Number);if(V.length!=2)throw null;const[oe,Q]=V;if(!isFinite(oe)||!isFinite(Q))throw null;O=oe>=0?oe:window.innerWidth-z+oe,P=Q>=0?Q:window.innerHeight-N+Q}catch{throw new Error(`invalid position string: ${H}`)}}}L&&(L.style.left=`${O}px`,L.style.top=`${P}px`)}()),t.resizable&&f(),$(),i=new li(D.value,k.value,{onMove:()=>$(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:L}=Dt(D.value);s=new hi(k.value,{onResize:()=>f(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+L,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+L:void 0})}()}),t.activateWhenOpen&&T())}(!0),hn.add(o)};function C(A){g.value.zIndex=`${A}`}const k=l.ref(null),D=l.ref(null),j=l.ref(null);function T(){c.raise(),e("activate")}const g=l.ref({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),u=l.computed(()=>t.windowStyle.titlebar),w=l.computed(()=>{const A={...t.windowStyle.content};return t.resizable?A.padding="0":t.padding!=null&&(A.padding=`${t.padding}px`),t.isScrollable&&(A.overflow="auto"),A});function v(A){const{width:L,height:z,top:N,left:O}=A,P=k;if(P&&L!=null&&(P.value.style.width=`${L}px`),z!=null){const H=D.value;if(H){const V=pt(H).height;P.value.style.height=`${z+V}px`}}P&&O!=null&&(P.value.style.left=`${O}px`),P&&N!=null&&(P.value.style.top=`${N}px`)}function f(A=!0){const L=k.value,z=D.value,N=j.value;if(N&&L&&z){const{width:O,height:P}=pt(N),{width:H,height:V}=pt(L),oe=pt(z).height,Q=H-(N.offsetWidth-O),he=V-oe-(N.offsetHeight-P);N.style.width=`${Q}px`,N.style.height=`${he}px`,y(),e("resize",new Yo(Q,he)),A&&(e("update:width",Q),e("update:height",he))}}function y(){const A=k.value;if(A){const L=A.getBoundingClientRect();L.left<0&&(g.value.left="0px"),L.top<0&&(g.value.top="0px"),L.right>window.innerWidth&&(g.value.left=window.innerWidth-L.width+"px"),L.bottom>window.innerHeight&&(g.value.top=window.innerHeight-L.height+"px")}}function $(A=!0){y();const L=k.value;if(L){const{left:z,top:N}=L.getBoundingClientRect();A&&(e("update:left",z),e("update:top",N))}}return l.watch(()=>t.isOpen,A=>{h.value=A}),l.watch(()=>t.zGroup,A=>{c.group=A}),l.watch(()=>t.width,A=>{v({width:A}),f(!1)}),l.watch(()=>t.height,A=>{v({height:A}),f(!1)}),l.onMounted(()=>{m()}),l.onBeforeUnmount(()=>{hn.delete(this),c.unregister(),s&&s.teardown(),i&&i.teardown(),gt.splice(gt.indexOf(o),1)}),{isOpen:h,windowEl:k,titlebar:D,content:j,activate:T,styleWindow:g,styleTitlebar:u,styleContent:w,closeButtonClick:function(){h.value=!1,e("closebuttonclick")},fixPosition:y}}});const rs={class:"title"};var Jo;mt.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",rs,[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})},mt.__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"}(Jo||(Jo={}));const is=mt;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 Zo{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(ye(e)?n=e:Ze(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);e.layout&&(o.style=e.layout),e.cssClass&&(o.cssClass=e.cssClass),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),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 $e=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}}});$e.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}))},$e.__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($e,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 vt=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 Zo(s,t.widgetConfig,r,c),m=g(exports.LayoutContainerEnum.top),C=g(exports.LayoutContainerEnum.centerBack),k=g(exports.LayoutContainerEnum.centerFront),D=g(exports.LayoutContainerEnum.left),j=g(exports.LayoutContainerEnum.right),T=g(exports.LayoutContainerEnum.bottom);function g(w){return h?.getContainerComponents(w)}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:D,rightContainerComponents:j,bottomContainerComponents:T,containerStyle:u,isEnableRouterView:i,setItemRef:(w,v)=>{w&&c.set(v,w)}}}});const ss={ref:"topContainer",class:"topContainer"},as={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},cs={ref:"centerBackContainer",class:"centerdiv backContainer"},ls={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},us={ref:"leftContainer",class:"leftContainer"},hs={ref:"rightContainer",class:"rightContainer"},ds={ref:"bottomContainer",class:"bottomContainer"};vt.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",ss,[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",as,[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",cs,[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",ls,[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",us,[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",hs,[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",ds,[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)},vt.__scopeId="data-v-4d081e5c",vt.__file="src/controls/layoutcontainer/layout.vue";var Qo=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($e,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})}});Qo.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const Re=new Map,Ne=l.ref(new Map);class We{static addWindowPanel(e){Re.set(e.id,e)}static removeWindowPanel(e){Re.has(e)&&(Re.delete(e),Ne.value.delete(e))}static minimizeWindowPanel(e){Re.has(e)&&Ne.value.set(e,-1)}static openWindowPanel(e){Re.has(e)&&Ne.value.set(e,1)}}const fs=["src"],ps={key:1,class:"paneltitle"},gs={class:"dragPanelBar"},ms={class:"dragPanelContent"},vs={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=no(),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,D=l.ref({width:0,height:0}),j=P=>{s.value&&(s.value.style.left=`${P.x}px`,s.value.style.top=`${P.y}px`)};l.watch(()=>m.value,P=>{j(P)});const T=P=>{s.value&&(s.value.style.width=`${P.width}px`,s.value.style.height=`${P.height}px`)};l.watch(()=>D.value,P=>{T(P)});const g={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(g.refs).forEach(([P,H])=>{H.value&&H.value.addEventListener("mousedown",V=>{g.mouseDown(V,P)})})},mouseDown:(P,H)=>{P.button==0&&(P.preventDefault(),g.startingEdges={left:m.value.x,top:m.value.y,right:m.value.x+D.value.width,bottom:m.value.y+D.value.height},g.newEdges={...g.startingEdges},g.clickStart={x:P.clientX,y:P.clientY},g.eventListenerController=new AbortController,document.addEventListener("mousemove",V=>{g.mouseMove(V,H)},{signal:g.eventListenerController.signal}),document.addEventListener("mouseup",V=>{g.mouseUp(V,H)},{signal:g.eventListenerController.signal}))},mouseMove:(P,H)=>{if(g.startingEdges!=null&&g.newEdges!=null&&g.clickStart!=null&&g.refs[H].value){if(P.preventDefault(),console.log("mouseMove",H),H.toLowerCase().includes("north")){g.newEdges.top=Math.max(g.startingEdges.top+P.clientY-g.clickStart.y,0);const V=g.newEdges.bottom-g.newEdges.top-k;V<0&&(g.newEdges.top+=V)}else H.toLowerCase().includes("south")&&(g.newEdges.bottom=Math.min(g.startingEdges.bottom+P.clientY-g.clickStart.y,document.body.clientHeight));if(H.toLowerCase().includes("west")){g.newEdges.left=Math.max(g.startingEdges.left+P.clientX-g.clickStart.x,0);const V=g.newEdges.right-g.newEdges.left-C;V<0&&(g.newEdges.left+=V)}else H.toLowerCase().includes("east")&&(g.newEdges.right=Math.min(g.startingEdges.right+P.clientX-g.clickStart.x,document.body.clientWidth));g.update()}},update:()=>{g.newEdges==null||g.startingEdges==null||(m.value={x:Math.max(g.newEdges.left,0),y:Math.max(g.newEdges.top,0)},D.value={width:Math.min(Math.max(g.newEdges.right-g.newEdges.left,C),document.body.clientWidth),height:Math.min(Math.max(g.newEdges.bottom-g.newEdges.top,k),document.body.clientHeight)})},mouseUp:(P,H)=>{P.button!=0||g.startingEdges==null||(console.log("mouseUp",H),P.preventDefault(),g.startingEdges=null,g.newEdges=null,g.clickStart=null,g.eventListenerController&&(g.eventListenerController.abort(),g.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-D.value.width),y:Math.min(Math.max(u.startingPosition.y+P.clientY-u.startingMouse.y,0),document.body.clientHeight-D.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 w(P){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:P??r.tag}}const v=l.computed(()=>Ne.value.get(o)!==-1),f=l.ref(!1),y=l.ref(!0);function $(){i("minimize",w()),We.minimizeWindowPanel(o)}function A(){f.value=!f.value}function L(){i("close",w(!1)),We.removeWindowPanel(o),y.value=!1}const z=l.computed(()=>f.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),N={id:o,isShow:v,close:L,open:function(){i("open",w(!0)),y.value=!0},showHidePanel:$};function O(P){if(Nt(P))return P;{const H=Number(P);if(H==H)return H;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(N),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 H=Nt(r.titleHeight)?r.titleHeight+"px":r.titleHeight;c.value.style.height=H,c.value.style.lineHeight=H})(),function(){const P=w(N);We.addWindowPanel(P),i("loaded",P)}(),m.value.x=O(r.left),m.value.y=O(r.top),j(m.value),D.value={width:O(r.nWidth),height:O(r.nHeight)},T(D.value),g.mount()}),l.onUnmounted(()=>{We.removeWindowPanel(o)}),(P,H)=>(l.openBlock(),l.createBlock(l.Transition,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:l.withCtx(()=>[y.value?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"dragPanelRef",ref:s,class:l.normalizeClass(["dragWindowPanel",{maxPanel:f.value,dragWindowPanel_dark:h.value}])},[l.createElementVNode("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:c,onMousedown:H[0]||(H[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,fs)):l.createCommentVNode("v-if",!0),r.title?(l.openBlock(),l.createElementBlock("span",ps,l.toDisplayString(r.title),1)):l.createCommentVNode("v-if",!0)]),l.createElementVNode("div",gs,[t.hasMin?(l.openBlock(),l.createBlock(l.unref(zt.Icon),{key:0,icon:"ant-design:minus-outlined",onClick:$})):l.createCommentVNode("v-if",!0),t.hasMax?(l.openBlock(),l.createBlock(l.unref(zt.Icon),{key:1,icon:z.value,onClick:A},null,8,["icon"])):l.createCommentVNode("v-if",!0),t.hasClose?(l.openBlock(),l.createBlock(l.unref(zt.Icon),{key:2,icon:"ant-design:close-outlined",onClick:L})):l.createCommentVNode("v-if",!0)])],544),l.createElementVNode("div",ms,[l.renderSlot(P.$slots,"default")]),l.createElementVNode("div",vs,[l.createElementVNode("div",{class:"cursor-nw-resize",ref:g.refs.northWest},null,512),l.createElementVNode("div",{class:"cursor-n-resize",ref:g.refs.north},null,512),l.createElementVNode("div",{class:"cursor-ne-resize",ref:g.refs.northEast},null,512),l.createElementVNode("div",{class:"cursor-w-resize",ref:g.refs.west},null,512),H[1]||(H[1]=l.createElementVNode("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),l.createElementVNode("div",{class:"cursor-e-resize",ref:g.refs.east},null,512),l.createElementVNode("div",{class:"cursor-sw-resize",ref:g.refs.southWest},null,512),l.createElementVNode("div",{class:"cursor-s-resize",ref:g.refs.south},null,512),l.createElementVNode("div",{class:"cursor-se-resize",ref:g.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 In{debug=!1;simple=!1;utc=!1;longType="number";dictType="object";nullType=void 0;static Instance=new In;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
|
+
`+r.toString())}}decodeArguments(e){var n=e.stream;let o=[];if(n.readByte()===97){e.reset();var r=re.ValueReader.readCount(n);const s=new Array(r).fill(this.nullType);o=new Array(r),e.addReference(o);for(var i=0;i<r;++i)o[i]=e.deserialize(s[i]);n.readByte()}return o}encodeRequest(e,n,o={}){var r=new re.ByteStream,i=new re.Writer(r,this.simple,this.utc),s=o;this.simple&&(s.simple=!0);var c=0;for(var h in s)c++;c>0&&(r.writeByte(72),i.serialize(s),i.reset()),r.writeByte(67),i.serialize(e),n.length>0&&(i.reset(),i.serialize(n)),r.writeByte(122);const m=r.takeBytes();return this.textDecoder.decode(m)}decodeResponse(e,n={}){const o=this.textEncoder.encode(e);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(s===72){var c=i.deserialize();for(var h in c)n[h]=c[h];i.reset(),s=r.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
|
+
`+r.toString())}}}const yt=new Map,pn=new Map;let wt;const ys={getDefaultClient(){if(wt||(wt=new ze(SysConfig.DefaultHproseAPI)),!wt)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return wt},registerHprose(t,e){const n=pn.get(t);if(!n){const o=new ze(e);yt.set(t,o)}return n},getHprose:t=>pn?.get(t),getProxyHprose:t=>yt.get(t),unregisterHprose(t){yt.get(t)&&(pn.delete(t),yt.delete(t))}},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"},gn="access_token",ws=W.Config.ServiceURL.LoginAuthURL;function mn(){const t=po();t&&pe(ke.RefreshToken,ws,{refreshToken:t}).then(e=>{vn(e.data)})}function er(){const t=fe.getJsonObject(gn);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=5e3?mn():setTimeout(mn,n-5e3))}function vn(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;if(n>=36e5?(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=be();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},fe.set(gn,o,n/1e3),er()}else fe.remove(gn)}const bt="Wm314243",_t=W.Config.ServiceURL.LoginAuthURL,yn="ROLE_SYSTEM_RIGHT",wn=new tt("",sessionStorage);function tr(){return wn.get(yn)}function bn(t){wn.set(yn,t)}function nr(){wn.remove(yn)}function Pe(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(Pe(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function or(t,e,n="name"){t&&e&&t.forEach(o=>{const r=e.find(i=>i[n]===o[n]);r&&(o.children?r.children&&or(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Ue(t,e,n,o="name"){const r=t[n],i=e[n];r?i&&or(r,i,o):i&&(t[n]=i)}function rr(t){if(t&&t.length>0){const e=t.length;let n,o=!1;if(e>0){o=ye(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);Ue(r,c,"routes","name"),Ue(r,c,"widgetMenu","name"),Ue(r,c,"widgets","id"),Ue(r,c,"functions","id")}n=r}return n&&(Pe(n.routes),Pe(n.widgetMenu),Pe(n.widgets),Pe(n.functions)),n}}const _n=[],Sn=[],Cn=[];function Oe(){return tr()}function ir(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=ir(r,o);i&&n.children?.push(i)}})),n}function sr(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=sr(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=Vt(),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 pe(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=st.createInstance({name:this.fileID,driver:st.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(),st.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 D=h.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${h+1}/${this.totalChunks}`),c++,pe(n,e,r,k,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async j=>{const T=j.data;c--,await this.currentDB?.setItem(D,T),i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());const g=parseInt(D)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${g}/${this.totalChunks}`),this.savefile()}).catch(j=>{c--;const T=parseInt(D)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${T}\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=Ii.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(),st.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}},exports.Download=ot,exports.DownloadByUrl=function({url:t,target:e="_blank",fileName:n}){const o=new URL(t).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=t,s.target=e,s.download!==void 0&&(s.download=n||io(t)),document.createEvent){const c=document.createEvent("MouseEvents");return c.initEvent("click",!0,!0),s.dispatchEvent(c),r(!0)}return t.indexOf("?")===-1&&(t+="?download"),window.open(t,e),r(!0)}{const s=document.createElement("canvas"),c=document.createElement("img");c.setAttribute("crossOrigin","Anonymous"),c.src=t,c.onload=h=>{s.width=c.width,s.height=c.height,s.getContext("2d").drawImage(c,0,0,c.width,c.height),s.toBlob(m=>{if(m){const C=document.createElement("a");C.href=window.URL.createObjectURL(m),C.download=n??io(t),C.click(),URL.revokeObjectURL(C.href),r(!0)}})},c.onerror=h=>i(h)}})},exports.FileUpload=Eo,exports.GetSignalRClient=function(t){if(!t){if(ft)return ft;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new ts().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!")}),ft||(ft=e),e},exports.Global=W,exports.GlobalHprose=ys,exports.GlobalMitt=we,exports.H5Tool=se,exports.HproseClient=je,exports.HproseRPCCodec=In,exports.HttpDownload=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(o){ot(o.data,n)}).catch(o=>{console.warn(o),we.emit(te.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})},exports.JsonDownload=ro,exports.LayoutContainer=vt,exports.LayoutManager=Zo,exports.MinWindowMap=Ne,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=ze,exports.RouterTransition=dn,exports.RouterTransitionAnimate=Qo,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=ci,exports.Storage=tt,exports.StringUtils=et,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=$e,exports.SysEvents=te,exports.TOKEN_REFRESH_TIME=5e3,exports.TOKEN_VALID_TIMESPAN=36e5,exports.USER_TOKEN_API=ke,exports.VWindow=mt,exports.WaterMark=Pi,exports.WindowResizeEvent=Yo,exports.WindowType=is,exports.WindowsMap=Re,exports.XWindow=fn,exports.XWindowManager=We,exports.XXTEA=Le,exports.calculateBestTextColor=function(t){return function(e,n){return(oo(~~e[0],~~e[1],~~e[2])+.05)/(oo(n[0],n[1],n[2])+.05)}(Ht(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"},exports.changeMyPWD=function(t){const e={oldpwd:Le.encryptToString(t.oldpwd,bt),newpwd:Le.encryptToString(t.newpwd,bt)};return pe(ke.ChangeMyPwd,_t,e)},exports.checkDoRefreshToken=er,exports.checkToken=function(t){return pe(ke.CheckToken,_t,{token:t})},exports.clearLocalToken=Yt,exports.clearRight=nr,exports.colorIsDark=function(t){if(!nt(t))return;const[e,n,o]=Ht(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),`#${Ft(t.substring(0,2),e)}${Ft(t.substring(2,4),e)}${Ft(t.substring(4,6),e)}`},exports.deepMerge=function t(e={},n={}){let o;for(o in n)ye(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=mn,exports.exportSystemRights=Ao,exports.get=function(t,e){return pe(t,void 0,e)},exports.getCurrentSystemRight=Oe,exports.getData=function(t,e){return W.Axios?.get(t,{params:e}).catch(function(n){rt(n,t,"","\u5916\u90E8Get")})},exports.getEncryptPWD=function(t){return Le.encryptToString(t,bt)},exports.getFunctions=function(t,e=2){if(e===0)return t;const n=Oe();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=be,exports.getLockState=function(){return fe.get(nn,!1)},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(nt(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=jt(m,h,i+1/3),o=jt(m,h,i),r=jt(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=tr,exports.getRoutes=function(t,e=2){if(e===0)return t;const n=Oe();return n&&n.routes?(Cn.length>0||t.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=ir(o,r);i&&Cn.push(i)}}),Cn):void 0},exports.getSystemRoleRight=async function(t,e=!1){nr();const n=ke.GetSystemRights,o=W.Config.ServiceURL.LoginAuthURL,r=await pe(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 bn(s),s}{const s=rr(i);return bn(s),s}}},exports.getWidgetConfig=function(t,e=2){if(e===0)return t;const n=Oe();return n&&n.widgets?(_n.length>0||t?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&_n.push(o)}),_n):void 0},exports.getWidgetMenus=function(t,e=2){if(e===0)return t;const n=Oe();return n&&n.widgetMenu?(Sn.length>0||t.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=sr(o,r);i&&Sn.push(i)}}),Sn):void 0},exports.handleNodes=Pe,exports.hexToRGB=Ht,exports.init=function(t,e,n){!W.Config.DefaultHproseAPI&&W.Config.ServiceURL&&(W.Config.DefaultHproseAPI=W.Config.ServiceURL.DefaultHproseAPI),W.Config.DefaultHproseAPI&&et.isNotEmpty(W.Config.DefaultHproseAPI)&&(W.DefaultProxyClient=new ze(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=Wt,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=Qn,exports.isElement=t=>ye(t)&&!!t.tagName,exports.isEmpty=function(t){return t==null||(Ze(t)||Wt(t)?t.length===0:!!ye(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=Je,exports.isHexColor=nt,exports.isImageDom=function(t){return t&&["IMAGE","IMG"].includes(t.tagName)},exports.isMap=function(t){return ie(t,"Map")},exports.isNull=$t,exports.isNullAndUnDef=function(t){return Bt(t)&&$t(t)},exports.isNullOrUnDef=function(t){return Bt(t)||$t(t)},exports.isNumber=Nt,exports.isObjectX=ye,exports.isPromise=function(t){return ie(t,"Promise")&&ye(t)&&Je(t.then)&&Je(t.catch)},exports.isServer=pi,exports.isString=Ze,exports.isSymbol=function(t){return ie(t,"Symbol")},exports.isUnDef=Bt,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=Ei,exports.lighten=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${qt(t.substring(0,2),e)}${qt(t.substring(2,4),e)}${qt(t.substring(4,6),e)}`},exports.login=async function(t){const e={username:t.username,pwd:Le.encryptToString(t.pwd,bt)},n=(await pe(ke.Login,_t,e))?.data;return n&&vn(n.doubletoken),n},exports.logout=function(){const t=be();t&&(mo(ke.Logout,_t,{token:t.token,reftoken:t.refresh}),Yt())},exports.mergeFilterRoleSysRight=rr,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=Ue,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(){rn(),document.addEventListener("mousedown",rn)},exports.post=function(t,e){return go(t,void 0,e)},exports.requestGet=pe,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=vn,exports.setRight=bn,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=mi,exports.storageHelper=fe,exports.unLockListener=function(){document.removeEventListener("mousedown",rn)},exports.uuid=no,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
|
+
`,r=0;t.forEach(i=>{const s=i.split(":");if(s&&s.length===2){const c="icon"+r;n+=`import ${c} from '~icons/${s[0]}/${s[1]}'
|
|
12
|
+
`,o+=` '${i}':${c},
|
|
11
13
|
`,r++}}),r>0&&(o+=`};
|
|
12
|
-
`,
|
|
14
|
+
`,ot(n+o+"export default iconlist;","IconifyList.ts"))},exports.writeSysRoleRight=function(t,e){const n=Ao(t);ro(n,e),W.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")};
|