ss-component-new 1.2.50 → 1.2.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MTLLoader-NSZvi7nI.js → MTLLoader-BYwyWMXA.js} +1 -1
- package/dist/{MTLLoader-D8ibvSFh.cjs → MTLLoader-CsgziIDh.cjs} +1 -1
- package/dist/{OrbitControls-DvH2FOLU.js → OrbitControls-B6u_q54k.js} +1 -1
- package/dist/{OrbitControls-BGSGtkMX.cjs → OrbitControls-DIdDv9T6.cjs} +1 -1
- package/dist/{animationData-SFjieloL.cjs → animationData-BIplXQmL.cjs} +1 -1
- package/dist/{animationData-gK37rTvx.js → animationData-DJTuGNt4.js} +3 -3
- package/dist/{array-Bh2Ohvdn.cjs → array-B_zno3kJ.cjs} +1 -1
- package/dist/{array-DnsJhOVQ.js → array-ShFlmvJl.js} +2 -2
- package/dist/{dataUtil-C-vYfgZA.js → dataUtil-DsoW13ow.js} +1 -1
- package/dist/{dataUtil-BlcWKJem.cjs → dataUtil-k3nImvzW.cjs} +1 -1
- package/dist/{fileUtil-BmUTXw98.js → fileUtil-C0rsEa9w.js} +1 -1
- package/dist/{fileUtil-_H4ZxWjL.cjs → fileUtil-DToE53-r.cjs} +1 -1
- package/dist/{iconfont-DrNWNoTl.cjs → iconfont-DmN4e8Ce.cjs} +1 -1
- package/dist/{iconfont-Dn_p4Yaj.js → iconfont-JsDfBfXr.js} +2 -2
- package/dist/{index-Bwo7MKHa.js → index--ZcfDr9F.js} +5 -5
- package/dist/{index-uVTa9bea.cjs → index-0B0fThJx.cjs} +1 -1
- package/dist/{index-ke4lJPzD.cjs → index-1-FvChHt.cjs} +1 -1
- package/dist/{index-DKzMUkdf.js → index-18QTfsEp.js} +2 -2
- package/dist/{index-6ICa5WHj.js → index-7V3ID8IY.js} +8 -8
- package/dist/{index-Dy9cQWjY.js → index-99iBBlvh.js} +2 -2
- package/dist/{index-D8XR0eSq.js → index-BCrSpeL7.js} +7 -7
- package/dist/{index-BFcxduYK.js → index-BG5qCqPp.js} +1 -1
- package/dist/{index-BVSEKOtz.cjs → index-BHELpKaX.cjs} +1 -1
- package/dist/{index-DzWCBZCp.js → index-BOdwwuQO.js} +1 -1
- package/dist/{index-CC7R4NnH.js → index-BgpaOcbG.js} +2 -2
- package/dist/{index-DDctdcOX.cjs → index-Bh0aBTEr.cjs} +1 -1
- package/dist/{index-C5kHHVhV.js → index-BpDzs5Qp.js} +2 -2
- package/dist/{index-DSAyZE1F.js → index-Bqgt0a8Q.js} +56 -56
- package/dist/{index-DHLztZCX.js → index-BqrSajLE.js} +4 -4
- package/dist/{index-BLC92eE1.cjs → index-BwkXeUvc.cjs} +1 -1
- package/dist/index-Bzh9nO8C.cjs +1 -0
- package/dist/{index-CrDQNZIq.cjs → index-C0vHOv8e.cjs} +1 -1
- package/dist/{index-pIMg1p00.cjs → index-C22jIGA2.cjs} +1 -1
- package/dist/{index-DVvQHXSN.js → index-C7aJ_4Dh.js} +1356 -1335
- package/dist/{index-C9vRA6zS.js → index-CBNxRIxH.js} +5 -5
- package/dist/{index-DoVQFozi.js → index-CDxJySzB.js} +2 -2
- package/dist/{index-DG9cQ9bN.cjs → index-CMsfA9oC.cjs} +1 -1
- package/dist/{index-DzZNl0xL.cjs → index-CN95C7bI.cjs} +1 -1
- package/dist/{index-DOSrpa_J.js → index-CZgNNBKP.js} +2 -2
- package/dist/{index-BeiqdLoK.cjs → index-Ciz1ldTE.cjs} +1 -1
- package/dist/{index-BV8iacuo.js → index-CkOkdSSe.js} +3 -3
- package/dist/{index-DkQAKeVd.js → index-CmasnRur.js} +1 -1
- package/dist/{index-Dr2LRDpo.cjs → index-Co2XOJgv.cjs} +1 -1
- package/dist/{index-BtHcbxFu.js → index-CxtDrd92.js} +1 -1
- package/dist/{index-ZmF9zmqE.cjs → index-D0_mEg_r.cjs} +1 -1
- package/dist/{index-Bupls4_H.js → index-D0rIJW9J.js} +2 -2
- package/dist/{index-D0-3NKe4.cjs → index-D18n8Gh7.cjs} +1 -1
- package/dist/{index-BIHDw5_2.js → index-D1rM2RQL.js} +1 -1
- package/dist/{index-DHhIamRP.js → index-D5CqXgTi.js} +3 -3
- package/dist/{index-CbChx1NW.js → index-D92iKnQs.js} +11 -11
- package/dist/{index-DsLwjz1W.js → index-DBvVR_B5.js} +2 -2
- package/dist/{index-Dxu-jGah.cjs → index-DOt0piJO.cjs} +6 -6
- package/dist/{index-CtfP1enB.cjs → index-DQP3RvLe.cjs} +1 -1
- package/dist/{index-DHPOuQf7.js → index-DdZB840a.js} +1 -1
- package/dist/{index-CTzgi0J1.cjs → index-DfFDFX4i.cjs} +1 -1
- package/dist/{index-DYX6ncpm.js → index-DiALPqS7.js} +2 -2
- package/dist/{index-B25jP2Zm.cjs → index-DoswdgxH.cjs} +1 -1
- package/dist/{index-CNqCLcFZ.cjs → index-Du00NIb9.cjs} +1 -1
- package/dist/{index-CUW343Sl.js → index-MRL0XMqt.js} +5 -5
- package/dist/{index-BDFAZqjQ.js → index-MXp2bNLx.js} +1 -1
- package/dist/{index-Dp9MedC2.cjs → index-WIJK_qws.cjs} +1 -1
- package/dist/{index-BOPc1V6S.cjs → index-WXe9um0g.cjs} +1 -1
- package/dist/{index-Bqcveamx.cjs → index-a8EB89j-.cjs} +1 -1
- package/dist/{index-DjFsn89g.cjs → index-bq9OM2yT.cjs} +1 -1
- package/dist/{index-BTBM69xL.cjs → index-e_eQNKIk.cjs} +1 -1
- package/dist/{index-B61E-7tP.cjs → index-izkyxFId.cjs} +1 -1
- package/dist/{index-K4TBpbv0.cjs → index-jTijCUMR.cjs} +1 -1
- package/dist/{index-DRny_uYu.cjs → index-m0E6zJTS.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-B6XvNJiY.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-B3CmBekG.js} +8 -8
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CoJvGJ_8.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BLc-20yY.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DpCHGWUd.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DTVUIo28.js} +1715 -1720
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BtKRQe3d.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-utAQVjQ5.cjs} +55 -55
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DnuFpoz3.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-CD9lO4Eu.js} +5 -5
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-Do98G4Li.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-DhFVHzR5.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-yffO0nj8.cjs → index.vue_vue_type_style_index_1_lang-5HPoeKSA.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-B1TyseVF.js → index.vue_vue_type_style_index_1_lang-7v-kiH9J.js} +4 -4
- package/dist/{main-C2dyX8S8.cjs → main-0WP5FnvS.cjs} +1 -1
- package/dist/{main-vnqtYF1v.js → main-DgEIGAgk.js} +4 -4
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +10 -10
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +11 -11
- package/dist/{threeModel-cod5YSAI.cjs → threeModel-C6spcC1l.cjs} +1 -1
- package/dist/{threeModel-KzAsamub.js → threeModel-D0mUPwl8.js} +4 -4
- package/dist/{threePreview-IMGkH039.cjs → threePreview-BUTi-ogv.cjs} +1 -1
- package/dist/{threePreview-BKBoF-Pq.js → threePreview-CXzzuNo0.js} +3 -3
- package/dist/{threeSceneView-9L6pD08T.js → threeSceneView-Dr9A1GfB.js} +10 -10
- package/dist/{threeSceneView-C9hicAWV.cjs → threeSceneView-xw-_1WNq.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP--6W3Ib3t.cjs → threeSceneViewForCPMPIP-CzF6I-wd.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-DcmXR46U.js → threeSceneViewForCPMPIP-Wpe3kcVZ.js} +7 -7
- package/dist/{threeTrackPathView-CUphngkb.js → threeTrackPathView-Bb8DL5cH.js} +4 -4
- package/dist/{threeTrackPathView-BCaivDl5.cjs → threeTrackPathView-BckryhRE.cjs} +1 -1
- package/dist/{threeViewerHost-w1UyRR-l.js → threeViewerHost-DlqqVhOM.js} +3 -3
- package/dist/{threeViewerHost-BZ41WsSu.cjs → threeViewerHost-J8qfgEsE.cjs} +1 -1
- package/dist/{urdfTree-BuKlTWHs.cjs → urdfTree-BR3f2tCx.cjs} +1 -1
- package/dist/{urdfTree-D_M--ddQ.js → urdfTree-BgCufT3-.js} +1 -1
- package/dist/{workpieceTreePanel-CCVD39J_.js → workpieceTreePanel-CAJIJEhw.js} +5 -5
- package/dist/{workpieceTreePanel-BnK9-WF1.cjs → workpieceTreePanel-Dg3J_nUK.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-D8exatl4.cjs +0 -1
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";const o=require("vue"),f=require("./index-CTvzL0b3.cjs");function Wn(e){return e}function ls(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var cs=800,fs=16,hs=Date.now;function ds(e){var t=0,n=0;return function(){var r=hs(),s=fs-(r-n);if(n=r,s>0){if(++t>=cs)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ps(e){return function(){return e}}var vs=f.defineProperty?function(e,t){return f.defineProperty(e,"toString",{configurable:!0,enumerable:!1,value:ps(t),writable:!0})}:Wn,Gn=ds(vs),vn=Math.max;function Yn(e,t,n){return t=vn(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=vn(r.length-t,0),u=Array(i);++s<i;)u[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(u),ls(e,this,a)}}var gn=f.Symbol?f.Symbol.isConcatSpreadable:void 0;function gs(e){return f.isArray(e)||f.isArguments(e)||!!(gn&&e&&e[gn])}function Ht(e,t,n,r,s){var i=-1,u=e.length;for(n||(n=gs),s||(s=[]);++i<u;){var a=e[i];t>0&&n(a)?t>1?Ht(a,t-1,n,r,s):f.arrayPush(s,a):r||(s[s.length]=a)}return s}function Zn(e){var t=e==null?0:e.length;return t?Ht(e,1):[]}function Xn(e){return Gn(Yn(e,void 0,Zn),e+"")}function ys(e,t){return e!=null&&t in Object(e)}function ms(e,t,n){t=f.castPath(t,e);for(var r=-1,s=t.length,i=!1;++r<s;){var u=f.toKey(t[r]);if(!(i=e!=null&&n(e,u)))break;e=e[u]}return i||++r!=s?i:(s=e==null?0:e.length,!!s&&f.isLength(s)&&f.isIndex(u,s)&&(f.isArray(e)||f.isArguments(e)))}function Jn(e,t){return e!=null&&ms(e,t,ys)}function bs(e,t,n){for(var r=-1,s=t.length,i={};++r<s;){var u=t[r],a=f.baseGet(e,u);n(a,u)&&f.baseSet(i,f.castPath(u,e),a)}return i}function Ss(e,t){return bs(e,t,function(n,r){return Jn(e,r)})}var Qn=Xn(function(e,t){return e==null?{}:Ss(e,t)});const Me="update:modelValue",
|
|
1
|
+
"use strict";const o=require("vue"),f=require("./index-CTvzL0b3.cjs");function Wn(e){return e}function ls(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var cs=800,fs=16,hs=Date.now;function ds(e){var t=0,n=0;return function(){var r=hs(),s=fs-(r-n);if(n=r,s>0){if(++t>=cs)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ps(e){return function(){return e}}var vs=f.defineProperty?function(e,t){return f.defineProperty(e,"toString",{configurable:!0,enumerable:!1,value:ps(t),writable:!0})}:Wn,Gn=ds(vs),vn=Math.max;function Yn(e,t,n){return t=vn(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=vn(r.length-t,0),u=Array(i);++s<i;)u[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(u),ls(e,this,a)}}var gn=f.Symbol?f.Symbol.isConcatSpreadable:void 0;function gs(e){return f.isArray(e)||f.isArguments(e)||!!(gn&&e&&e[gn])}function Ht(e,t,n,r,s){var i=-1,u=e.length;for(n||(n=gs),s||(s=[]);++i<u;){var a=e[i];t>0&&n(a)?t>1?Ht(a,t-1,n,r,s):f.arrayPush(s,a):r||(s[s.length]=a)}return s}function Zn(e){var t=e==null?0:e.length;return t?Ht(e,1):[]}function Xn(e){return Gn(Yn(e,void 0,Zn),e+"")}function ys(e,t){return e!=null&&t in Object(e)}function ms(e,t,n){t=f.castPath(t,e);for(var r=-1,s=t.length,i=!1;++r<s;){var u=f.toKey(t[r]);if(!(i=e!=null&&n(e,u)))break;e=e[u]}return i||++r!=s?i:(s=e==null?0:e.length,!!s&&f.isLength(s)&&f.isIndex(u,s)&&(f.isArray(e)||f.isArguments(e)))}function Jn(e,t){return e!=null&&ms(e,t,ys)}function bs(e,t,n){for(var r=-1,s=t.length,i={};++r<s;){var u=t[r],a=f.baseGet(e,u);n(a,u)&&f.baseSet(i,f.castPath(u,e),a)}return i}function Ss(e,t){return bs(e,t,function(n,r){return Jn(e,r)})}var Qn=Xn(function(e,t){return e==null?{}:Ss(e,t)});const Me="update:modelValue",Dt="change",Je="input";function Es(e,t,n,r){const s=n-t;return e/=r/2,e<1?s/2*e*e*e+t:s/2*((e-=2)*e*e+2)+t}const er=e=>f.isClient?window.requestAnimationFrame(e):setTimeout(e,16),tr=e=>f.isClient?window.cancelAnimationFrame(e):clearTimeout(e),ws=(e,t)=>{if(!f.isClient)return!1;const n={undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(t)],r=f.getStyle(e,n);return["scroll","auto","overlay"].some(s=>r.includes(s))},Ts=(e,t)=>{if(!f.isClient)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(ws(n,t))return n;n=n.parentNode}return n};let _e;const nr=e=>{var t;if(!f.isClient)return 0;if(_e!==void 0)return _e;const n=document.createElement("div");n.className=`${e}-scrollbar__wrap`,n.style.visibility="hidden",n.style.width="100px",n.style.position="absolute",n.style.top="-9999px",document.body.appendChild(n);const r=n.offsetWidth;n.style.overflow="scroll";const s=document.createElement("div");s.style.width="100%",n.appendChild(s);const i=s.offsetWidth;return(t=n.parentNode)==null||t.removeChild(n),_e=r-i,_e};function Cs(e,t){if(!f.isClient)return;if(!t){e.scrollTop=0;return}const n=[];let r=t.offsetParent;for(;r!==null&&e!==r&&e.contains(r);)n.push(r),r=r.offsetParent;const s=t.offsetTop+n.reduce((l,c)=>l+c.offsetTop,0),i=s+t.offsetHeight,u=e.scrollTop,a=u+e.clientHeight;s<u?e.scrollTop=s:i>a&&(e.scrollTop=i-e.clientHeight)}function As(e,t,n,r,s){const i=Date.now();let u;const a=()=>{const c=Date.now()-i,d=Es(c>r?r:c,t,n,r);f.isWindow(e)?e.scrollTo(window.pageXOffset,d):e.scrollTop=d,c<r?u=er(a):f.isFunction$1(s)&&s()};return a(),()=>{u&&tr(u)}}const Bs=(e,t)=>f.isWindow(t)?e.ownerDocument.documentElement:t,xs=e=>f.isWindow(e)?window.scrollY:e.scrollTop;let U;const Ds={height:"0",visibility:"hidden",overflow:f.isFirefox()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},ks=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],yn=e=>{const t=Number.parseFloat(e);return Number.isNaN(t)?e:t};function Is(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),r=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),s=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:ks.map(u=>[u,t.getPropertyValue(u)]),paddingSize:r,borderSize:s,boxSizing:n}}function mn(e,t=1,n){var r,s;U||(U=document.createElement("textarea"),((r=e.parentNode)!=null?r:document.body).appendChild(U));const{paddingSize:i,borderSize:u,boxSizing:a,contextStyle:l}=Is(e);l.forEach(([y,m])=>U==null?void 0:U.style.setProperty(y,m)),Object.entries(Ds).forEach(([y,m])=>U==null?void 0:U.style.setProperty(y,m,"important")),U.value=e.value||e.placeholder||"";let c=U.scrollHeight;const d={};a==="border-box"?c=c+u:a==="content-box"&&(c=c-i),U.value="";const v=U.scrollHeight-i;if(f.isNumber(t)){let y=v*t;a==="border-box"&&(y=y+i+u),c=Math.max(y,c),d.minHeight=`${y}px`}if(f.isNumber(n)){let y=v*n;a==="border-box"&&(y=y+i+u),c=Math.min(y,c)}return d.height=`${c}px`,(s=U.parentNode)==null||s.removeChild(U),U=void 0,d}const Rs=f.buildProps({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),rr=e=>Qn(Rs,e),sr=f.buildProps({id:{type:String,default:void 0},size:f.useSizeProp,disabled:Boolean,modelValue:{type:f.definePropType([String,Number,Object]),default:""},modelModifiers:{type:f.definePropType(Object),default:()=>({})},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:f.definePropType([Boolean,Object]),default:!1},autocomplete:{type:f.definePropType(String),default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:f.iconPropType,default:f.circle_close_default},showPassword:Boolean,showWordLimit:Boolean,wordLimitPosition:{type:String,values:["inside","outside"],default:"inside"},suffixIcon:{type:f.iconPropType},prefixIcon:{type:f.iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:f.definePropType([Object,Array,String]),default:()=>f.mutable({})},autofocus:Boolean,rows:{type:Number,default:2},...rr(["ariaLabel"]),inputmode:{type:f.definePropType(String),default:void 0},name:String}),Ms={[Me]:e=>f.isString(e),input:e=>f.isString(e),change:e=>f.isString(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},Ns=["class","style"],Os=/^on[A-Z]/,ir=(e={})=>{const{excludeListeners:t=!1,excludeKeys:n}=e,r=o.computed(()=>((n==null?void 0:n.value)||[]).concat(Ns)),s=o.getCurrentInstance();return s?o.computed(()=>{var i;return f.fromPairs(Object.entries((i=s.proxy)==null?void 0:i.$attrs).filter(([u])=>!r.value.includes(u)&&!(t&&Os.test(u))))}):(f.debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),o.computed(()=>({})))},kt={prefix:Math.floor(Math.random()*1e4),current:0},Vs=Symbol("elIdInjection"),or=()=>o.getCurrentInstance()?o.inject(Vs,kt):kt,tt=e=>{const t=or();!f.isClient&&t===kt&&f.debugWarn("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
|
2
2
|
usage: app.provide(ID_INJECTION_KEY, {
|
|
3
3
|
prefix: number,
|
|
4
4
|
current: number,
|
|
5
|
-
})`);const n=f.useGetDerivedNamespace();return f.computedEager(()=>o.unref(e)||`${n.value}-id-${t.prefix}-${t.current++}`)},ot=Symbol("formContextKey"),_t=Symbol("formItemContextKey"),zt=()=>{const e=o.inject(ot,void 0),t=o.inject(_t,void 0);return{form:e,formItem:t}},ar=(e,{formItemContext:t,disableIdGeneration:n,disableIdManagement:r})=>{n||(n=o.ref(!1)),r||(r=o.ref(!1));const s=o.getCurrentInstance(),i=()=>{let c=s==null?void 0:s.parent;for(;c;){if(c.type.name==="ElFormItem")return!1;if(c.type.name==="ElLabelWrap")return!0;c=c.parent}return!1},u=o.ref();let a;const l=o.computed(()=>{var c;return!!(!(e.label||e.ariaLabel)&&t&&t.inputIds&&((c=t.inputIds)==null?void 0:c.length)<=1)});return o.onMounted(()=>{a=o.watch([o.toRef(e,"id"),n],([c,d])=>{const v=c??(d?void 0:tt().value);v!==u.value&&(t!=null&&t.removeInputId&&!i()&&(u.value&&t.removeInputId(u.value),!(r!=null&&r.value)&&!d&&v&&t.addInputId(v)),u.value=v)},{immediate:!0})}),o.onUnmounted(()=>{a&&a(),t!=null&&t.removeInputId&&u.value&&t.removeInputId(u.value)}),{isLabeledByFormItem:l,inputId:u}},ur=e=>{const t=o.getCurrentInstance();return o.computed(()=>{var n,r;return(r=(n=t==null?void 0:t.proxy)==null?void 0:n.$props)==null?void 0:r[e]})},Kt=(e,t={})=>{const n=o.ref(void 0),r=t.prop?n:ur("size"),s=t.global?n:f.useGlobalSize(),i=t.form?{size:void 0}:o.inject(ot,void 0),u=t.formItem?{size:void 0}:o.inject(_t,void 0);return o.computed(()=>r.value||o.unref(e)||(u==null?void 0:u.size)||(i==null?void 0:i.size)||s.value||"")},at=e=>{const t=ur("disabled"),n=o.inject(ot,void 0);return o.computed(()=>t.value||o.unref(e)||(n==null?void 0:n.disabled)||!1)},Ps='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',bn=e=>typeof Element>"u"?!1:e instanceof Element,Fs=e=>getComputedStyle(e).position==="fixed"?!1:e.offsetParent!==null,Sn=e=>Array.from(e.querySelectorAll(Ps)).filter(t=>ut(t)&&Fs(t)),ut=e=>{if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.tabIndex<0||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true")return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return!(e.type==="hidden"||e.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Ls=function(e,t,...n){let r;t.includes("mouse")||t.includes("click")?r="MouseEvents":t.includes("key")?r="KeyboardEvent":r="HTMLEvents";const s=document.createEvent(r);return s.initEvent(t,...n),e.dispatchEvent(s),e},lr=e=>!e.getAttribute("aria-owns"),Hs=(e,t,n)=>{const{parentNode:r}=e;if(!r)return null;const s=r.querySelectorAll(n),i=Array.prototype.indexOf.call(s,e);return s[i+t]||null},$t=(e,t)=>{if(!e||!e.focus)return;let n=!1;bn(e)&&!ut(e)&&!e.getAttribute("tabindex")&&(e.setAttribute("tabindex","-1"),n=!0),e.focus(t),bn(e)&&n&&e.removeAttribute("tabindex")},_s=e=>{e&&($t(e),!lr(e)&&e.click())};function cr(e,{disabled:t,beforeFocus:n,afterFocus:r,beforeBlur:s,afterBlur:i}={}){const u=o.getCurrentInstance(),{emit:a}=u,l=o.shallowRef(),c=o.ref(!1),d=m=>{const h=f.isFunction$1(n)?n(m):!1;o.unref(t)||c.value||h||(c.value=!0,a("focus",m),r==null||r())},v=m=>{var h;const S=f.isFunction$1(s)?s(m):!1;o.unref(t)||m.relatedTarget&&((h=l.value)!=null&&h.contains(m.relatedTarget))||S||(c.value=!1,a("blur",m),i==null||i())},y=m=>{var h,S;o.unref(t)||ut(m.target)||(h=l.value)!=null&&h.contains(document.activeElement)&&l.value!==document.activeElement||(S=e.value)==null||S.focus()};return o.watch([l,()=>o.unref(t)],([m,h])=>{m&&(h?m.removeAttribute("tabindex"):m.setAttribute("tabindex","-1"))}),f.useEventListener(l,"focus",d,!0),f.useEventListener(l,"blur",v,!0),f.useEventListener(l,"click",y,!0),{isFocused:c,wrapperRef:l,handleFocus:d,handleBlur:v}}const zs=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e);function fr({afterComposition:e,emit:t}){const n=o.ref(!1),r=a=>{t==null||t("compositionstart",a),n.value=!0},s=a=>{var l;t==null||t("compositionupdate",a);const c=(l=a.target)==null?void 0:l.value,d=c[c.length-1]||"";n.value=!zs(d)},i=a=>{t==null||t("compositionend",a),n.value&&(n.value=!1,o.nextTick(()=>e(a)))};return{isComposing:n,handleComposition:a=>{a.type==="compositionend"?i(a):s(a)},handleCompositionStart:r,handleCompositionUpdate:s,handleCompositionEnd:i}}function Ks(e){let t;function n(){if(e.value==null)return;const{selectionStart:s,selectionEnd:i,value:u}=e.value;if(s==null||i==null)return;const a=u.slice(0,Math.max(0,s)),l=u.slice(Math.max(0,i));t={selectionStart:s,selectionEnd:i,value:u,beforeTxt:a,afterTxt:l}}function r(){if(e.value==null||t==null)return;const{value:s}=e.value,{beforeTxt:i,afterTxt:u,selectionStart:a}=t;if(i==null||u==null||a==null)return;let l=s.length;if(s.endsWith(u))l=s.length-u.length;else if(s.startsWith(i))l=i.length;else{const c=i[a-1],d=s.indexOf(c,a-1);d!==-1&&(l=d+1)}e.value.setSelectionRange(l,l)}return[n,r]}const hr="ElInput",$s=o.defineComponent({name:hr,inheritAttrs:!1}),Us=o.defineComponent({...$s,props:sr,emits:Ms,setup(e,{expose:t,emit:n}){const r=e,s=o.useAttrs(),i=ir(),u=o.useSlots(),a=o.computed(()=>[r.type==="textarea"?S.b():h.b(),h.m(y.value),h.is("disabled",m.value),h.is("exceed",Xr.value),{[h.b("group")]:u.prepend||u.append,[h.m("prefix")]:u.prefix||r.prefixIcon,[h.m("suffix")]:u.suffix||r.suffixIcon||r.clearable||r.showPassword,[h.bm("suffix","password-clear")]:H.value&&_.value,[h.b("hidden")]:r.type==="hidden"},s.class]),l=o.computed(()=>[h.e("wrapper"),h.is("focus",I.value)]),{form:c,formItem:d}=zt(),{inputId:v}=ar(r,{formItemContext:d}),y=Kt(),m=at(),h=f.useNamespace("input"),S=f.useNamespace("textarea"),T=o.shallowRef(),b=o.shallowRef(),E=o.ref(!1),D=o.ref(!1),N=o.ref(),$=o.shallowRef(r.inputStyle),w=o.computed(()=>T.value||b.value),{wrapperRef:L,isFocused:I,handleFocus:O,handleBlur:q}=cr(w,{disabled:m,afterBlur(){var g;r.validateEvent&&((g=d==null?void 0:d.validate)==null||g.call(d,"blur").catch(x=>f.debugWarn(x)))}}),V=o.computed(()=>{var g;return(g=c==null?void 0:c.statusIcon)!=null?g:!1}),R=o.computed(()=>(d==null?void 0:d.validateState)||""),Z=o.computed(()=>R.value&&f.ValidateComponentsMap[R.value]),vt=o.computed(()=>D.value?f.view_default:f.hide_default),Le=o.computed(()=>[s.style]),He=o.computed(()=>[r.inputStyle,$.value,{resize:r.resize}]),B=o.computed(()=>f.isNil(r.modelValue)?"":String(r.modelValue)),H=o.computed(()=>r.clearable&&!m.value&&!r.readonly&&!!B.value&&(I.value||E.value)),_=o.computed(()=>r.showPassword&&!m.value&&!!B.value),X=o.computed(()=>r.showWordLimit&&!!r.maxlength&&(r.type==="text"||r.type==="textarea")&&!m.value&&!r.readonly&&!r.showPassword),gt=o.computed(()=>B.value.length),Xr=o.computed(()=>!!X.value&>.value>Number(r.maxlength)),Jr=o.computed(()=>!!u.suffix||!!r.suffixIcon||H.value||r.showPassword||X.value||!!R.value&&V.value),Qr=o.computed(()=>!!Object.keys(r.modelModifiers).length),[es,ts]=Ks(T);f.useResizeObserver(b,g=>{if(ns(),!X.value||r.resize!=="both")return;const x=g[0],{width:P}=x.contentRect;N.value={right:`calc(100% - ${P+15+6}px)`}});const Be=()=>{const{type:g,autosize:x}=r;if(!(!f.isClient||g!=="textarea"||!b.value))if(x){const P=f.isObject$1(x)?x.minRows:void 0,he=f.isObject$1(x)?x.maxRows:void 0,xe=mn(b.value,P,he);$.value={overflowY:"hidden",...xe},o.nextTick(()=>{b.value.offsetHeight,$.value=xe})}else $.value={minHeight:mn(b.value).minHeight}},ns=(g=>{let x=!1;return()=>{var P;if(x||!r.autosize)return;((P=b.value)==null?void 0:P.offsetParent)===null||(setTimeout(g),x=!0)}})(Be),fe=()=>{const g=w.value,x=r.formatter?r.formatter(B.value):B.value;!g||g.value===x||(g.value=x)},an=g=>{const{trim:x,number:P}=r.modelModifiers;return x&&(g=g.trim()),P&&(g=`${yn(g)}`),r.formatter&&r.parser&&(g=r.parser(g)),g},yt=async g=>{if(ln.value)return;const{lazy:x}=r.modelModifiers;let{value:P}=g.target;if(x){n(Je,P);return}if(P=an(P),String(P)===B.value){r.formatter&&fe();return}es(),n(Me,P),n(Je,P),await o.nextTick(),(r.formatter&&r.parser||!Qr.value)&&fe(),ts()},un=async g=>{let{value:x}=g.target;x=an(x),r.modelModifiers.lazy&&n(Me,x),n(xt,x),await o.nextTick(),fe()},{isComposing:ln,handleCompositionStart:cn,handleCompositionUpdate:fn,handleCompositionEnd:hn}=fr({emit:n,afterComposition:yt}),rs=()=>{D.value=!D.value},ss=()=>{var g;return(g=w.value)==null?void 0:g.focus()},is=()=>{var g;return(g=w.value)==null?void 0:g.blur()},os=g=>{E.value=!1,n("mouseleave",g)},as=g=>{E.value=!0,n("mouseenter",g)},dn=g=>{n("keydown",g)},us=()=>{var g;(g=w.value)==null||g.select()},pn=()=>{n(Me,""),n(xt,""),n("clear"),n(Je,"")};return o.watch(()=>r.modelValue,()=>{var g;o.nextTick(()=>Be()),r.validateEvent&&((g=d==null?void 0:d.validate)==null||g.call(d,"change").catch(x=>f.debugWarn(x)))}),o.watch(B,g=>{if(!w.value)return;const{trim:x,number:P}=r.modelModifiers,he=w.value.value,xe=(P||r.type==="number")&&!/^0\d/.test(he)?`${yn(he)}`:he;xe!==g&&(document.activeElement===w.value&&w.value.type!=="range"&&x&&xe.trim()===g||fe())}),o.watch(()=>r.type,async()=>{await o.nextTick(),fe(),Be()}),o.onMounted(()=>{!r.formatter&&r.parser&&f.debugWarn(hr,"If you set the parser, you also need to set the formatter."),fe(),o.nextTick(Be)}),t({input:T,textarea:b,ref:w,textareaStyle:He,autosize:o.toRef(r,"autosize"),isComposing:ln,focus:ss,blur:is,select:us,clear:pn,resizeTextarea:Be}),(g,x)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([o.unref(a),{[o.unref(h).bm("group","append")]:g.$slots.append,[o.unref(h).bm("group","prepend")]:g.$slots.prepend}]),style:o.normalizeStyle(o.unref(Le)),onMouseenter:as,onMouseleave:os},[o.createCommentVNode(" input "),g.type!=="textarea"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createCommentVNode(" prepend slot "),g.$slots.prepend?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(h).be("group","prepend"))},[o.renderSlot(g.$slots,"prepend")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref_key:"wrapperRef",ref:L,class:o.normalizeClass(o.unref(l))},[o.createCommentVNode(" prefix slot "),g.$slots.prefix||g.prefixIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(h).e("prefix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(h).e("prefix-inner"))},[o.renderSlot(g.$slots,"prefix"),g.prefixIcon?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:0,class:o.normalizeClass(o.unref(h).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.prefixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("input",o.mergeProps({id:o.unref(v),ref_key:"input",ref:T,class:o.unref(h).e("inner")},o.unref(i),{name:g.name,minlength:g.minlength,maxlength:g.maxlength,type:g.showPassword?D.value?"text":"password":g.type,disabled:o.unref(m),readonly:g.readonly,autocomplete:g.autocomplete,tabindex:g.tabindex,"aria-label":g.ariaLabel,placeholder:g.placeholder,style:g.inputStyle,form:g.form,autofocus:g.autofocus,role:g.containerRole,inputmode:g.inputmode,onCompositionstart:o.unref(cn),onCompositionupdate:o.unref(fn),onCompositionend:o.unref(hn),onInput:yt,onChange:un,onKeydown:dn}),null,16,["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode","onCompositionstart","onCompositionupdate","onCompositionend"]),o.createCommentVNode(" suffix slot "),o.unref(Jr)?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(o.unref(h).e("suffix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(h).e("suffix-inner"))},[!o.unref(H)||!o.unref(_)||!o.unref(X)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.renderSlot(g.$slots,"suffix"),g.suffixIcon?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:0,class:o.normalizeClass(o.unref(h).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.suffixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],64)):o.createCommentVNode("v-if",!0),o.unref(H)?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:1,class:o.normalizeClass([o.unref(h).e("icon"),o.unref(h).e("clear")]),onMousedown:o.withModifiers(o.unref(f.NOOP),["prevent"]),onClick:pn},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.clearIcon)))]),_:1},8,["class","onMousedown"])):o.createCommentVNode("v-if",!0),o.unref(_)?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:2,class:o.normalizeClass([o.unref(h).e("icon"),o.unref(h).e("password")]),onClick:rs,onMousedown:o.withModifiers(o.unref(f.NOOP),["prevent"]),onMouseup:o.withModifiers(o.unref(f.NOOP),["prevent"])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(vt))))]),_:1},8,["class","onMousedown","onMouseup"])):o.createCommentVNode("v-if",!0),o.unref(X)?(o.openBlock(),o.createElementBlock("span",{key:3,class:o.normalizeClass([o.unref(h).e("count"),o.unref(h).is("outside",g.wordLimitPosition==="outside")])},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(h).e("count-inner"))},o.toDisplayString(o.unref(gt))+" / "+o.toDisplayString(g.maxlength),3)],2)):o.createCommentVNode("v-if",!0),o.unref(R)&&o.unref(Z)&&o.unref(V)?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:4,class:o.normalizeClass([o.unref(h).e("icon"),o.unref(h).e("validateIcon"),o.unref(h).is("loading",o.unref(R)==="validating")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(Z))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0)],2),o.createCommentVNode(" append slot "),g.$slots.append?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(h).be("group","append"))},[o.renderSlot(g.$slots,"append")],2)):o.createCommentVNode("v-if",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createCommentVNode(" textarea "),o.createElementVNode("textarea",o.mergeProps({id:o.unref(v),ref_key:"textarea",ref:b,class:[o.unref(S).e("inner"),o.unref(h).is("focus",o.unref(I))]},o.unref(i),{minlength:g.minlength,maxlength:g.maxlength,tabindex:g.tabindex,disabled:o.unref(m),readonly:g.readonly,autocomplete:g.autocomplete,style:o.unref(He),"aria-label":g.ariaLabel,placeholder:g.placeholder,form:g.form,autofocus:g.autofocus,rows:g.rows,role:g.containerRole,onCompositionstart:o.unref(cn),onCompositionupdate:o.unref(fn),onCompositionend:o.unref(hn),onInput:yt,onFocus:o.unref(O),onBlur:o.unref(q),onChange:un,onKeydown:dn}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),o.unref(X)?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(N.value),class:o.normalizeClass([o.unref(h).e("count"),o.unref(h).is("outside",g.wordLimitPosition==="outside")])},o.toDisplayString(o.unref(gt))+" / "+o.toDisplayString(g.maxlength),7)):o.createCommentVNode("v-if",!0)],64))],38))}});var qs=f._export_sfc(Us,[["__file","input.vue"]]);const dr=f.withInstall(qs),mt="focus-trap.focus-after-trapped",bt="focus-trap.focus-after-released",js="focus-trap.focusout-prevented",En={cancelable:!0,bubbles:!1},Ws={cancelable:!0,bubbles:!1},wn="focusAfterTrapped",Tn="focusAfterReleased",pr=Symbol("elFocusTrap"),Ut=o.ref(),lt=o.ref(0),qt=o.ref(0);let ze=0;const vr=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0||r===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},Cn=(e,t)=>{for(const n of e)if(!Gs(n,t))return n},Gs=(e,t)=>{if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},Ys=e=>{const t=vr(e),n=Cn(t,e),r=Cn(t.reverse(),e);return[n,r]},Zs=e=>e instanceof HTMLInputElement&&"select"in e,te=(e,t)=>{if(e){const n=document.activeElement;$t(e,{preventScroll:!0}),qt.value=window.performance.now(),e!==n&&Zs(e)&&t&&e.select()}};function Dn(e,t){const n=[...e],r=e.indexOf(t);return r!==-1&&n.splice(r,1),n}const Xs=()=>{let e=[];return{push:r=>{const s=e[0];s&&r!==s&&s.pause(),e=Dn(e,r),e.unshift(r)},remove:r=>{var s,i;e=Dn(e,r),(i=(s=e[0])==null?void 0:s.resume)==null||i.call(s)}}},Js=(e,t=!1)=>{const n=document.activeElement;for(const r of e)if(te(r,t),document.activeElement!==n)return},An=Xs(),Qs=()=>lt.value>qt.value,Ke=()=>{Ut.value="pointer",lt.value=window.performance.now()},Bn=()=>{Ut.value="keyboard",lt.value=window.performance.now()},ei=()=>(o.onMounted(()=>{ze===0&&(document.addEventListener("mousedown",Ke),document.addEventListener("touchstart",Ke),document.addEventListener("keydown",Bn)),ze++}),o.onBeforeUnmount(()=>{ze--,ze<=0&&(document.removeEventListener("mousedown",Ke),document.removeEventListener("touchstart",Ke),document.removeEventListener("keydown",Bn))}),{focusReason:Ut,lastUserFocusTimestamp:lt,lastAutomatedFocusTimestamp:qt}),$e=e=>new CustomEvent(js,{...Ws,detail:e});let ve=[];const xn=e=>{f.getEventCode(e)===f.EVENT_CODE.esc&&ve.forEach(n=>n(e))},ti=e=>{o.onMounted(()=>{ve.length===0&&document.addEventListener("keydown",xn),f.isClient&&ve.push(e)}),o.onBeforeUnmount(()=>{ve=ve.filter(t=>t!==e),ve.length===0&&f.isClient&&document.removeEventListener("keydown",xn)})},ni=o.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[wn,Tn,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const n=o.ref();let r,s;const{focusReason:i}=ei();ti(h=>{e.trapped&&!u.paused&&t("release-requested",h)});const u={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=h=>{if(!e.loop&&!e.trapped||u.paused)return;const{altKey:S,ctrlKey:T,metaKey:b,currentTarget:E,shiftKey:D}=h,{loop:N}=e,w=f.getEventCode(h)===f.EVENT_CODE.tab&&!S&&!T&&!b,L=document.activeElement;if(w&&L){const I=E,[O,q]=Ys(I);if(O&&q){if(!D&&L===q){const R=$e({focusReason:i.value});t("focusout-prevented",R),R.defaultPrevented||(h.preventDefault(),N&&te(O,!0))}else if(D&&[O,I].includes(L)){const R=$e({focusReason:i.value});t("focusout-prevented",R),R.defaultPrevented||(h.preventDefault(),N&&te(q,!0))}}else if(L===I){const R=$e({focusReason:i.value});t("focusout-prevented",R),R.defaultPrevented||h.preventDefault()}}};o.provide(pr,{focusTrapRef:n,onKeydown:a}),o.watch(()=>e.focusTrapEl,h=>{h&&(n.value=h)},{immediate:!0}),o.watch([n],([h],[S])=>{h&&(h.addEventListener("keydown",a),h.addEventListener("focusin",d),h.addEventListener("focusout",v)),S&&(S.removeEventListener("keydown",a),S.removeEventListener("focusin",d),S.removeEventListener("focusout",v))});const l=h=>{t(wn,h)},c=h=>t(Tn,h),d=h=>{const S=o.unref(n);if(!S)return;const T=h.target,b=h.relatedTarget,E=T&&S.contains(T);e.trapped||b&&S.contains(b)||(r=b),E&&t("focusin",h),!u.paused&&e.trapped&&(E?s=T:te(s,!0))},v=h=>{const S=o.unref(n);if(!(u.paused||!S))if(e.trapped){const T=h.relatedTarget;!f.isNil(T)&&!S.contains(T)&&setTimeout(()=>{if(!u.paused&&e.trapped){const b=$e({focusReason:i.value});t("focusout-prevented",b),b.defaultPrevented||te(s,!0)}},0)}else{const T=h.target;T&&S.contains(T)||t("focusout",h)}};async function y(){await o.nextTick();const h=o.unref(n);if(h){An.push(u);const S=h.contains(document.activeElement)?r:document.activeElement;if(r=S,!h.contains(S)){const b=new Event(mt,En);h.addEventListener(mt,l),h.dispatchEvent(b),b.defaultPrevented||o.nextTick(()=>{let E=e.focusStartEl;f.isString(E)||(te(E),document.activeElement!==E&&(E="first")),E==="first"&&Js(vr(h),!0),(document.activeElement===S||E==="container")&&te(h)})}}}function m(){const h=o.unref(n);if(h){h.removeEventListener(mt,l);const S=new CustomEvent(bt,{...En,detail:{focusReason:i.value}});h.addEventListener(bt,c),h.dispatchEvent(S),!S.defaultPrevented&&(i.value=="keyboard"||!Qs()||h.contains(document.activeElement))&&te(r??document.body),h.removeEventListener(bt,c),An.remove(u),r=null,s=null}}return o.onMounted(()=>{e.trapped&&y(),o.watch(()=>e.trapped,h=>{h?y():m()})}),o.onBeforeUnmount(()=>{e.trapped&&m(),n.value&&(n.value.removeEventListener("keydown",a),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",v),n.value=void 0)}),{onKeydown:a}}});function ri(e,t,n,r,s,i){return o.renderSlot(e.$slots,"default",{handleKeydown:e.onKeydown})}var gr=f._export_sfc(ni,[["render",ri],["__file","focus-trap.vue"]]);const yr=Symbol("buttonGroupContextKey"),mr=({from:e,replacement:t,scope:n,version:r,ref:s,type:i="API"},u)=>{o.watch(()=>o.unref(u),a=>{a&&f.debugWarn(n,`[${i}] ${e} is about to be deprecated in version ${r}, please use ${t} instead.
|
|
5
|
+
})`);const n=f.useGetDerivedNamespace();return f.computedEager(()=>o.unref(e)||`${n.value}-id-${t.prefix}-${t.current++}`)},ot=Symbol("formContextKey"),_t=Symbol("formItemContextKey"),zt=()=>{const e=o.inject(ot,void 0),t=o.inject(_t,void 0);return{form:e,formItem:t}},ar=(e,{formItemContext:t,disableIdGeneration:n,disableIdManagement:r})=>{n||(n=o.ref(!1)),r||(r=o.ref(!1));const s=o.getCurrentInstance(),i=()=>{let c=s==null?void 0:s.parent;for(;c;){if(c.type.name==="ElFormItem")return!1;if(c.type.name==="ElLabelWrap")return!0;c=c.parent}return!1},u=o.ref();let a;const l=o.computed(()=>{var c;return!!(!(e.label||e.ariaLabel)&&t&&t.inputIds&&((c=t.inputIds)==null?void 0:c.length)<=1)});return o.onMounted(()=>{a=o.watch([o.toRef(e,"id"),n],([c,d])=>{const v=c??(d?void 0:tt().value);v!==u.value&&(t!=null&&t.removeInputId&&!i()&&(u.value&&t.removeInputId(u.value),!(r!=null&&r.value)&&!d&&v&&t.addInputId(v)),u.value=v)},{immediate:!0})}),o.onUnmounted(()=>{a&&a(),t!=null&&t.removeInputId&&u.value&&t.removeInputId(u.value)}),{isLabeledByFormItem:l,inputId:u}},ur=e=>{const t=o.getCurrentInstance();return o.computed(()=>{var n,r;return(r=(n=t==null?void 0:t.proxy)==null?void 0:n.$props)==null?void 0:r[e]})},Kt=(e,t={})=>{const n=o.ref(void 0),r=t.prop?n:ur("size"),s=t.global?n:f.useGlobalSize(),i=t.form?{size:void 0}:o.inject(ot,void 0),u=t.formItem?{size:void 0}:o.inject(_t,void 0);return o.computed(()=>r.value||o.unref(e)||(u==null?void 0:u.size)||(i==null?void 0:i.size)||s.value||"")},at=e=>{const t=ur("disabled"),n=o.inject(ot,void 0);return o.computed(()=>t.value||o.unref(e)||(n==null?void 0:n.disabled)||!1)},Ps='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',bn=e=>typeof Element>"u"?!1:e instanceof Element,Fs=e=>getComputedStyle(e).position==="fixed"?!1:e.offsetParent!==null,Sn=e=>Array.from(e.querySelectorAll(Ps)).filter(t=>ut(t)&&Fs(t)),ut=e=>{if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.tabIndex<0||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true")return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return!(e.type==="hidden"||e.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Ls=function(e,t,...n){let r;t.includes("mouse")||t.includes("click")?r="MouseEvents":t.includes("key")?r="KeyboardEvent":r="HTMLEvents";const s=document.createEvent(r);return s.initEvent(t,...n),e.dispatchEvent(s),e},lr=e=>!e.getAttribute("aria-owns"),Hs=(e,t,n)=>{const{parentNode:r}=e;if(!r)return null;const s=r.querySelectorAll(n),i=Array.prototype.indexOf.call(s,e);return s[i+t]||null},$t=(e,t)=>{if(!e||!e.focus)return;let n=!1;bn(e)&&!ut(e)&&!e.getAttribute("tabindex")&&(e.setAttribute("tabindex","-1"),n=!0),e.focus(t),bn(e)&&n&&e.removeAttribute("tabindex")},_s=e=>{e&&($t(e),!lr(e)&&e.click())};function cr(e,{disabled:t,beforeFocus:n,afterFocus:r,beforeBlur:s,afterBlur:i}={}){const u=o.getCurrentInstance(),{emit:a}=u,l=o.shallowRef(),c=o.ref(!1),d=m=>{const h=f.isFunction$1(n)?n(m):!1;o.unref(t)||c.value||h||(c.value=!0,a("focus",m),r==null||r())},v=m=>{var h;const S=f.isFunction$1(s)?s(m):!1;o.unref(t)||m.relatedTarget&&((h=l.value)!=null&&h.contains(m.relatedTarget))||S||(c.value=!1,a("blur",m),i==null||i())},y=m=>{var h,S;o.unref(t)||ut(m.target)||(h=l.value)!=null&&h.contains(document.activeElement)&&l.value!==document.activeElement||(S=e.value)==null||S.focus()};return o.watch([l,()=>o.unref(t)],([m,h])=>{m&&(h?m.removeAttribute("tabindex"):m.setAttribute("tabindex","-1"))}),f.useEventListener(l,"focus",d,!0),f.useEventListener(l,"blur",v,!0),f.useEventListener(l,"click",y,!0),{isFocused:c,wrapperRef:l,handleFocus:d,handleBlur:v}}const zs=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e);function fr({afterComposition:e,emit:t}){const n=o.ref(!1),r=a=>{t==null||t("compositionstart",a),n.value=!0},s=a=>{var l;t==null||t("compositionupdate",a);const c=(l=a.target)==null?void 0:l.value,d=c[c.length-1]||"";n.value=!zs(d)},i=a=>{t==null||t("compositionend",a),n.value&&(n.value=!1,o.nextTick(()=>e(a)))};return{isComposing:n,handleComposition:a=>{a.type==="compositionend"?i(a):s(a)},handleCompositionStart:r,handleCompositionUpdate:s,handleCompositionEnd:i}}function Ks(e){let t;function n(){if(e.value==null)return;const{selectionStart:s,selectionEnd:i,value:u}=e.value;if(s==null||i==null)return;const a=u.slice(0,Math.max(0,s)),l=u.slice(Math.max(0,i));t={selectionStart:s,selectionEnd:i,value:u,beforeTxt:a,afterTxt:l}}function r(){if(e.value==null||t==null)return;const{value:s}=e.value,{beforeTxt:i,afterTxt:u,selectionStart:a}=t;if(i==null||u==null||a==null)return;let l=s.length;if(s.endsWith(u))l=s.length-u.length;else if(s.startsWith(i))l=i.length;else{const c=i[a-1],d=s.indexOf(c,a-1);d!==-1&&(l=d+1)}e.value.setSelectionRange(l,l)}return[n,r]}const hr="ElInput",$s=o.defineComponent({name:hr,inheritAttrs:!1}),Us=o.defineComponent({...$s,props:sr,emits:Ms,setup(e,{expose:t,emit:n}){const r=e,s=o.useAttrs(),i=ir(),u=o.useSlots(),a=o.computed(()=>[r.type==="textarea"?S.b():h.b(),h.m(y.value),h.is("disabled",m.value),h.is("exceed",Xr.value),{[h.b("group")]:u.prepend||u.append,[h.m("prefix")]:u.prefix||r.prefixIcon,[h.m("suffix")]:u.suffix||r.suffixIcon||r.clearable||r.showPassword,[h.bm("suffix","password-clear")]:H.value&&_.value,[h.b("hidden")]:r.type==="hidden"},s.class]),l=o.computed(()=>[h.e("wrapper"),h.is("focus",I.value)]),{form:c,formItem:d}=zt(),{inputId:v}=ar(r,{formItemContext:d}),y=Kt(),m=at(),h=f.useNamespace("input"),S=f.useNamespace("textarea"),T=o.shallowRef(),b=o.shallowRef(),E=o.ref(!1),A=o.ref(!1),N=o.ref(),$=o.shallowRef(r.inputStyle),w=o.computed(()=>T.value||b.value),{wrapperRef:L,isFocused:I,handleFocus:O,handleBlur:q}=cr(w,{disabled:m,afterBlur(){var g;r.validateEvent&&((g=d==null?void 0:d.validate)==null||g.call(d,"blur").catch(D=>f.debugWarn(D)))}}),V=o.computed(()=>{var g;return(g=c==null?void 0:c.statusIcon)!=null?g:!1}),R=o.computed(()=>(d==null?void 0:d.validateState)||""),Z=o.computed(()=>R.value&&f.ValidateComponentsMap[R.value]),vt=o.computed(()=>A.value?f.view_default:f.hide_default),Le=o.computed(()=>[s.style]),He=o.computed(()=>[r.inputStyle,$.value,{resize:r.resize}]),x=o.computed(()=>f.isNil(r.modelValue)?"":String(r.modelValue)),H=o.computed(()=>r.clearable&&!m.value&&!r.readonly&&!!x.value&&(I.value||E.value)),_=o.computed(()=>r.showPassword&&!m.value&&!!x.value),X=o.computed(()=>r.showWordLimit&&!!r.maxlength&&(r.type==="text"||r.type==="textarea")&&!m.value&&!r.readonly&&!r.showPassword),gt=o.computed(()=>x.value.length),Xr=o.computed(()=>!!X.value&>.value>Number(r.maxlength)),Jr=o.computed(()=>!!u.suffix||!!r.suffixIcon||H.value||r.showPassword||X.value||!!R.value&&V.value),Qr=o.computed(()=>!!Object.keys(r.modelModifiers).length),[es,ts]=Ks(T);f.useResizeObserver(b,g=>{if(ns(),!X.value||r.resize!=="both")return;const D=g[0],{width:P}=D.contentRect;N.value={right:`calc(100% - ${P+15+6}px)`}});const xe=()=>{const{type:g,autosize:D}=r;if(!(!f.isClient||g!=="textarea"||!b.value))if(D){const P=f.isObject$1(D)?D.minRows:void 0,he=f.isObject$1(D)?D.maxRows:void 0,De=mn(b.value,P,he);$.value={overflowY:"hidden",...De},o.nextTick(()=>{b.value.offsetHeight,$.value=De})}else $.value={minHeight:mn(b.value).minHeight}},ns=(g=>{let D=!1;return()=>{var P;if(D||!r.autosize)return;((P=b.value)==null?void 0:P.offsetParent)===null||(setTimeout(g),D=!0)}})(xe),fe=()=>{const g=w.value,D=r.formatter?r.formatter(x.value):x.value;!g||g.value===D||(g.value=D)},an=g=>{const{trim:D,number:P}=r.modelModifiers;return D&&(g=g.trim()),P&&(g=`${yn(g)}`),r.formatter&&r.parser&&(g=r.parser(g)),g},yt=async g=>{if(ln.value)return;const{lazy:D}=r.modelModifiers;let{value:P}=g.target;if(D){n(Je,P);return}if(P=an(P),String(P)===x.value){r.formatter&&fe();return}es(),n(Me,P),n(Je,P),await o.nextTick(),(r.formatter&&r.parser||!Qr.value)&&fe(),ts()},un=async g=>{let{value:D}=g.target;D=an(D),r.modelModifiers.lazy&&n(Me,D),n(Dt,D),await o.nextTick(),fe()},{isComposing:ln,handleCompositionStart:cn,handleCompositionUpdate:fn,handleCompositionEnd:hn}=fr({emit:n,afterComposition:yt}),rs=()=>{A.value=!A.value},ss=()=>{var g;return(g=w.value)==null?void 0:g.focus()},is=()=>{var g;return(g=w.value)==null?void 0:g.blur()},os=g=>{E.value=!1,n("mouseleave",g)},as=g=>{E.value=!0,n("mouseenter",g)},dn=g=>{n("keydown",g)},us=()=>{var g;(g=w.value)==null||g.select()},pn=()=>{n(Me,""),n(Dt,""),n("clear"),n(Je,"")};return o.watch(()=>r.modelValue,()=>{var g;o.nextTick(()=>xe()),r.validateEvent&&((g=d==null?void 0:d.validate)==null||g.call(d,"change").catch(D=>f.debugWarn(D)))}),o.watch(x,g=>{if(!w.value)return;const{trim:D,number:P}=r.modelModifiers,he=w.value.value,De=(P||r.type==="number")&&!/^0\d/.test(he)?`${yn(he)}`:he;De!==g&&(document.activeElement===w.value&&w.value.type!=="range"&&D&&De.trim()===g||fe())}),o.watch(()=>r.type,async()=>{await o.nextTick(),fe(),xe()}),o.onMounted(()=>{!r.formatter&&r.parser&&f.debugWarn(hr,"If you set the parser, you also need to set the formatter."),fe(),o.nextTick(xe)}),t({input:T,textarea:b,ref:w,textareaStyle:He,autosize:o.toRef(r,"autosize"),isComposing:ln,focus:ss,blur:is,select:us,clear:pn,resizeTextarea:xe}),(g,D)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([o.unref(a),{[o.unref(h).bm("group","append")]:g.$slots.append,[o.unref(h).bm("group","prepend")]:g.$slots.prepend}]),style:o.normalizeStyle(o.unref(Le)),onMouseenter:as,onMouseleave:os},[o.createCommentVNode(" input "),g.type!=="textarea"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createCommentVNode(" prepend slot "),g.$slots.prepend?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(h).be("group","prepend"))},[o.renderSlot(g.$slots,"prepend")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref_key:"wrapperRef",ref:L,class:o.normalizeClass(o.unref(l))},[o.createCommentVNode(" prefix slot "),g.$slots.prefix||g.prefixIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(h).e("prefix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(h).e("prefix-inner"))},[o.renderSlot(g.$slots,"prefix"),g.prefixIcon?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:0,class:o.normalizeClass(o.unref(h).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.prefixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("input",o.mergeProps({id:o.unref(v),ref_key:"input",ref:T,class:o.unref(h).e("inner")},o.unref(i),{name:g.name,minlength:g.minlength,maxlength:g.maxlength,type:g.showPassword?A.value?"text":"password":g.type,disabled:o.unref(m),readonly:g.readonly,autocomplete:g.autocomplete,tabindex:g.tabindex,"aria-label":g.ariaLabel,placeholder:g.placeholder,style:g.inputStyle,form:g.form,autofocus:g.autofocus,role:g.containerRole,inputmode:g.inputmode,onCompositionstart:o.unref(cn),onCompositionupdate:o.unref(fn),onCompositionend:o.unref(hn),onInput:yt,onChange:un,onKeydown:dn}),null,16,["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode","onCompositionstart","onCompositionupdate","onCompositionend"]),o.createCommentVNode(" suffix slot "),o.unref(Jr)?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(o.unref(h).e("suffix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(h).e("suffix-inner"))},[!o.unref(H)||!o.unref(_)||!o.unref(X)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.renderSlot(g.$slots,"suffix"),g.suffixIcon?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:0,class:o.normalizeClass(o.unref(h).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.suffixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],64)):o.createCommentVNode("v-if",!0),o.unref(H)?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:1,class:o.normalizeClass([o.unref(h).e("icon"),o.unref(h).e("clear")]),onMousedown:o.withModifiers(o.unref(f.NOOP),["prevent"]),onClick:pn},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.clearIcon)))]),_:1},8,["class","onMousedown"])):o.createCommentVNode("v-if",!0),o.unref(_)?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:2,class:o.normalizeClass([o.unref(h).e("icon"),o.unref(h).e("password")]),onClick:rs,onMousedown:o.withModifiers(o.unref(f.NOOP),["prevent"]),onMouseup:o.withModifiers(o.unref(f.NOOP),["prevent"])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(vt))))]),_:1},8,["class","onMousedown","onMouseup"])):o.createCommentVNode("v-if",!0),o.unref(X)?(o.openBlock(),o.createElementBlock("span",{key:3,class:o.normalizeClass([o.unref(h).e("count"),o.unref(h).is("outside",g.wordLimitPosition==="outside")])},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(h).e("count-inner"))},o.toDisplayString(o.unref(gt))+" / "+o.toDisplayString(g.maxlength),3)],2)):o.createCommentVNode("v-if",!0),o.unref(R)&&o.unref(Z)&&o.unref(V)?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:4,class:o.normalizeClass([o.unref(h).e("icon"),o.unref(h).e("validateIcon"),o.unref(h).is("loading",o.unref(R)==="validating")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(Z))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0)],2),o.createCommentVNode(" append slot "),g.$slots.append?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(h).be("group","append"))},[o.renderSlot(g.$slots,"append")],2)):o.createCommentVNode("v-if",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createCommentVNode(" textarea "),o.createElementVNode("textarea",o.mergeProps({id:o.unref(v),ref_key:"textarea",ref:b,class:[o.unref(S).e("inner"),o.unref(h).is("focus",o.unref(I))]},o.unref(i),{minlength:g.minlength,maxlength:g.maxlength,tabindex:g.tabindex,disabled:o.unref(m),readonly:g.readonly,autocomplete:g.autocomplete,style:o.unref(He),"aria-label":g.ariaLabel,placeholder:g.placeholder,form:g.form,autofocus:g.autofocus,rows:g.rows,role:g.containerRole,onCompositionstart:o.unref(cn),onCompositionupdate:o.unref(fn),onCompositionend:o.unref(hn),onInput:yt,onFocus:o.unref(O),onBlur:o.unref(q),onChange:un,onKeydown:dn}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),o.unref(X)?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(N.value),class:o.normalizeClass([o.unref(h).e("count"),o.unref(h).is("outside",g.wordLimitPosition==="outside")])},o.toDisplayString(o.unref(gt))+" / "+o.toDisplayString(g.maxlength),7)):o.createCommentVNode("v-if",!0)],64))],38))}});var qs=f._export_sfc(Us,[["__file","input.vue"]]);const dr=f.withInstall(qs),mt="focus-trap.focus-after-trapped",bt="focus-trap.focus-after-released",js="focus-trap.focusout-prevented",En={cancelable:!0,bubbles:!1},Ws={cancelable:!0,bubbles:!1},wn="focusAfterTrapped",Tn="focusAfterReleased",pr=Symbol("elFocusTrap"),Ut=o.ref(),lt=o.ref(0),qt=o.ref(0);let ze=0;const vr=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0||r===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},Cn=(e,t)=>{for(const n of e)if(!Gs(n,t))return n},Gs=(e,t)=>{if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},Ys=e=>{const t=vr(e),n=Cn(t,e),r=Cn(t.reverse(),e);return[n,r]},Zs=e=>e instanceof HTMLInputElement&&"select"in e,te=(e,t)=>{if(e){const n=document.activeElement;$t(e,{preventScroll:!0}),qt.value=window.performance.now(),e!==n&&Zs(e)&&t&&e.select()}};function An(e,t){const n=[...e],r=e.indexOf(t);return r!==-1&&n.splice(r,1),n}const Xs=()=>{let e=[];return{push:r=>{const s=e[0];s&&r!==s&&s.pause(),e=An(e,r),e.unshift(r)},remove:r=>{var s,i;e=An(e,r),(i=(s=e[0])==null?void 0:s.resume)==null||i.call(s)}}},Js=(e,t=!1)=>{const n=document.activeElement;for(const r of e)if(te(r,t),document.activeElement!==n)return},Bn=Xs(),Qs=()=>lt.value>qt.value,Ke=()=>{Ut.value="pointer",lt.value=window.performance.now()},xn=()=>{Ut.value="keyboard",lt.value=window.performance.now()},ei=()=>(o.onMounted(()=>{ze===0&&(document.addEventListener("mousedown",Ke),document.addEventListener("touchstart",Ke),document.addEventListener("keydown",xn)),ze++}),o.onBeforeUnmount(()=>{ze--,ze<=0&&(document.removeEventListener("mousedown",Ke),document.removeEventListener("touchstart",Ke),document.removeEventListener("keydown",xn))}),{focusReason:Ut,lastUserFocusTimestamp:lt,lastAutomatedFocusTimestamp:qt}),$e=e=>new CustomEvent(js,{...Ws,detail:e});let ve=[];const Dn=e=>{f.getEventCode(e)===f.EVENT_CODE.esc&&ve.forEach(n=>n(e))},ti=e=>{o.onMounted(()=>{ve.length===0&&document.addEventListener("keydown",Dn),f.isClient&&ve.push(e)}),o.onBeforeUnmount(()=>{ve=ve.filter(t=>t!==e),ve.length===0&&f.isClient&&document.removeEventListener("keydown",Dn)})},ni=o.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[wn,Tn,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const n=o.ref();let r,s;const{focusReason:i}=ei();ti(h=>{e.trapped&&!u.paused&&t("release-requested",h)});const u={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=h=>{if(!e.loop&&!e.trapped||u.paused)return;const{altKey:S,ctrlKey:T,metaKey:b,currentTarget:E,shiftKey:A}=h,{loop:N}=e,w=f.getEventCode(h)===f.EVENT_CODE.tab&&!S&&!T&&!b,L=document.activeElement;if(w&&L){const I=E,[O,q]=Ys(I);if(O&&q){if(!A&&L===q){const R=$e({focusReason:i.value});t("focusout-prevented",R),R.defaultPrevented||(h.preventDefault(),N&&te(O,!0))}else if(A&&[O,I].includes(L)){const R=$e({focusReason:i.value});t("focusout-prevented",R),R.defaultPrevented||(h.preventDefault(),N&&te(q,!0))}}else if(L===I){const R=$e({focusReason:i.value});t("focusout-prevented",R),R.defaultPrevented||h.preventDefault()}}};o.provide(pr,{focusTrapRef:n,onKeydown:a}),o.watch(()=>e.focusTrapEl,h=>{h&&(n.value=h)},{immediate:!0}),o.watch([n],([h],[S])=>{h&&(h.addEventListener("keydown",a),h.addEventListener("focusin",d),h.addEventListener("focusout",v)),S&&(S.removeEventListener("keydown",a),S.removeEventListener("focusin",d),S.removeEventListener("focusout",v))});const l=h=>{t(wn,h)},c=h=>t(Tn,h),d=h=>{const S=o.unref(n);if(!S)return;const T=h.target,b=h.relatedTarget,E=T&&S.contains(T);e.trapped||b&&S.contains(b)||(r=b),E&&t("focusin",h),!u.paused&&e.trapped&&(E?s=T:te(s,!0))},v=h=>{const S=o.unref(n);if(!(u.paused||!S))if(e.trapped){const T=h.relatedTarget;!f.isNil(T)&&!S.contains(T)&&setTimeout(()=>{if(!u.paused&&e.trapped){const b=$e({focusReason:i.value});t("focusout-prevented",b),b.defaultPrevented||te(s,!0)}},0)}else{const T=h.target;T&&S.contains(T)||t("focusout",h)}};async function y(){await o.nextTick();const h=o.unref(n);if(h){Bn.push(u);const S=h.contains(document.activeElement)?r:document.activeElement;if(r=S,!h.contains(S)){const b=new Event(mt,En);h.addEventListener(mt,l),h.dispatchEvent(b),b.defaultPrevented||o.nextTick(()=>{let E=e.focusStartEl;f.isString(E)||(te(E),document.activeElement!==E&&(E="first")),E==="first"&&Js(vr(h),!0),(document.activeElement===S||E==="container")&&te(h)})}}}function m(){const h=o.unref(n);if(h){h.removeEventListener(mt,l);const S=new CustomEvent(bt,{...En,detail:{focusReason:i.value}});h.addEventListener(bt,c),h.dispatchEvent(S),!S.defaultPrevented&&(i.value=="keyboard"||!Qs()||h.contains(document.activeElement))&&te(r??document.body),h.removeEventListener(bt,c),Bn.remove(u),r=null,s=null}}return o.onMounted(()=>{e.trapped&&y(),o.watch(()=>e.trapped,h=>{h?y():m()})}),o.onBeforeUnmount(()=>{e.trapped&&m(),n.value&&(n.value.removeEventListener("keydown",a),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",v),n.value=void 0)}),{onKeydown:a}}});function ri(e,t,n,r,s,i){return o.renderSlot(e.$slots,"default",{handleKeydown:e.onKeydown})}var gr=f._export_sfc(ni,[["render",ri],["__file","focus-trap.vue"]]);const yr=Symbol("buttonGroupContextKey"),mr=({from:e,replacement:t,scope:n,version:r,ref:s,type:i="API"},u)=>{o.watch(()=>o.unref(u),a=>{a&&f.debugWarn(n,`[${i}] ${e} is about to be deprecated in version ${r}, please use ${t} instead.
|
|
6
6
|
For more detail, please visit: ${s}
|
|
7
|
-
`)},{immediate:!0})},si=(e,t)=>{mr({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},o.computed(()=>e.type==="text"));const n=o.inject(yr,void 0),r=f.useGlobalConfig("button"),{form:s}=zt(),i=Kt(o.computed(()=>n==null?void 0:n.size)),u=at(),a=o.ref(),l=o.useSlots(),c=o.computed(()=>{var b;return e.type||(n==null?void 0:n.type)||((b=r.value)==null?void 0:b.type)||""}),d=o.computed(()=>{var b,E,D;return(D=(E=e.autoInsertSpace)!=null?E:(b=r.value)==null?void 0:b.autoInsertSpace)!=null?D:!1}),v=o.computed(()=>{var b,E,D;return(D=(E=e.plain)!=null?E:(b=r.value)==null?void 0:b.plain)!=null?D:!1}),y=o.computed(()=>{var b,E,D;return(D=(E=e.round)!=null?E:(b=r.value)==null?void 0:b.round)!=null?D:!1}),m=o.computed(()=>{var b,E,D;return(D=(E=e.text)!=null?E:(b=r.value)==null?void 0:b.text)!=null?D:!1}),h=o.computed(()=>e.tag==="button"?{ariaDisabled:u.value||e.loading,disabled:u.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),S=o.computed(()=>{var b;const E=(b=l.default)==null?void 0:b.call(l);if(d.value&&(E==null?void 0:E.length)===1){const D=E[0];if((D==null?void 0:D.type)===o.Text){const N=D.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(N.trim())}}return!1});return{_disabled:u,_size:i,_type:c,_ref:a,_props:h,_plain:v,_round:y,_text:m,shouldAddSpace:S,handleClick:b=>{if(u.value||e.loading){b.stopPropagation();return}e.nativeType==="reset"&&(s==null||s.resetFields()),t("click",b)}}},br=["default","primary","success","warning","info","danger","text",""],ii=["button","submit","reset"],It=f.buildProps({size:f.useSizeProp,disabled:Boolean,type:{type:String,values:br,default:""},icon:{type:f.iconPropType},nativeType:{type:String,values:ii,default:"button"},loading:Boolean,loadingIcon:{type:f.iconPropType,default:()=>f.loading_default},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:f.definePropType([String,Object]),default:"button"}}),oi={click:e=>e instanceof MouseEvent};function F(e,t){ai(e)&&(e="100%");var n=ui(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Ue(e){return Math.min(1,Math.max(0,e))}function ai(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function ui(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Sr(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function qe(e){return e<=1?"".concat(Number(e)*100,"%"):e}function ue(e){return e.length===1?"0"+e:String(e)}function li(e,t,n){return{r:F(e,255)*255,g:F(t,255)*255,b:F(n,255)*255}}function kn(e,t,n){e=F(e,255),t=F(t,255),n=F(n,255);var r=Math.max(e,t,n),s=Math.min(e,t,n),i=0,u=0,a=(r+s)/2;if(r===s)u=0,i=0;else{var l=r-s;switch(u=a>.5?l/(2-r-s):l/(r+s),r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:u,l:a}}function St(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ci(e,t,n){var r,s,i;if(e=F(e,360),t=F(t,100),n=F(n,100),t===0)s=n,i=n,r=n;else{var u=n<.5?n*(1+t):n+t-n*t,a=2*n-u;r=St(a,u,e+1/3),s=St(a,u,e),i=St(a,u,e-1/3)}return{r:r*255,g:s*255,b:i*255}}function In(e,t,n){e=F(e,255),t=F(t,255),n=F(n,255);var r=Math.max(e,t,n),s=Math.min(e,t,n),i=0,u=r,a=r-s,l=r===0?0:a/r;if(r===s)i=0;else{switch(r){case e:i=(t-n)/a+(t<n?6:0);break;case t:i=(n-e)/a+2;break;case n:i=(e-t)/a+4;break}i/=6}return{h:i,s:l,v:u}}function fi(e,t,n){e=F(e,360)*6,t=F(t,100),n=F(n,100);var r=Math.floor(e),s=e-r,i=n*(1-t),u=n*(1-s*t),a=n*(1-(1-s)*t),l=r%6,c=[n,u,i,i,a,n][l],d=[a,n,n,u,i,i][l],v=[i,i,a,n,n,u][l];return{r:c*255,g:d*255,b:v*255}}function Rn(e,t,n,r){var s=[ue(Math.round(e).toString(16)),ue(Math.round(t).toString(16)),ue(Math.round(n).toString(16))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function hi(e,t,n,r,s){var i=[ue(Math.round(e).toString(16)),ue(Math.round(t).toString(16)),ue(Math.round(n).toString(16)),ue(di(r))];return s&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function di(e){return Math.round(parseFloat(e)*255).toString(16)}function Mn(e){return j(e)/255}function j(e){return parseInt(e,16)}function pi(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var Rt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function vi(e){var t={r:0,g:0,b:0},n=1,r=null,s=null,i=null,u=!1,a=!1;return typeof e=="string"&&(e=mi(e)),typeof e=="object"&&(J(e.r)&&J(e.g)&&J(e.b)?(t=li(e.r,e.g,e.b),u=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):J(e.h)&&J(e.s)&&J(e.v)?(r=qe(e.s),s=qe(e.v),t=fi(e.h,r,s),u=!0,a="hsv"):J(e.h)&&J(e.s)&&J(e.l)&&(r=qe(e.s),i=qe(e.l),t=ci(e.h,r,i),u=!0,a="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Sr(n),{ok:u,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var gi="[-\\+]?\\d+%?",yi="[-\\+]?\\d*\\.\\d+%?",se="(?:".concat(yi,")|(?:").concat(gi,")"),Et="[\\s|\\(]+(".concat(se,")[,|\\s]+(").concat(se,")[,|\\s]+(").concat(se,")\\s*\\)?"),wt="[\\s|\\(]+(".concat(se,")[,|\\s]+(").concat(se,")[,|\\s]+(").concat(se,")[,|\\s]+(").concat(se,")\\s*\\)?"),G={CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+Et),rgba:new RegExp("rgba"+wt),hsl:new RegExp("hsl"+Et),hsla:new RegExp("hsla"+wt),hsv:new RegExp("hsv"+Et),hsva:new RegExp("hsva"+wt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function mi(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Rt[e])e=Rt[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=G.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=G.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=G.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=G.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=G.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=G.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=G.hex8.exec(e),n?{r:j(n[1]),g:j(n[2]),b:j(n[3]),a:Mn(n[4]),format:t?"name":"hex8"}:(n=G.hex6.exec(e),n?{r:j(n[1]),g:j(n[2]),b:j(n[3]),format:t?"name":"hex"}:(n=G.hex4.exec(e),n?{r:j(n[1]+n[1]),g:j(n[2]+n[2]),b:j(n[3]+n[3]),a:Mn(n[4]+n[4]),format:t?"name":"hex8"}:(n=G.hex3.exec(e),n?{r:j(n[1]+n[1]),g:j(n[2]+n[2]),b:j(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function J(e){return!!G.CSS_UNIT.exec(String(e))}var Er=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=pi(t)),this.originalInput=t;var s=vi(t);this.originalInput=t,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:s.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,s,i=t.r/255,u=t.g/255,a=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),u<=.03928?r=u/12.92:r=Math.pow((u+.055)/1.055,2.4),a<=.03928?s=a/12.92:s=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*r+.0722*s},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=Sr(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=In(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=In(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),s=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(s,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(s,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=kn(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=kn(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),s=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(s,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(s,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Rn(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),hi(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(F(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(F(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Rn(this.r,this.g,this.b,!1),n=0,r=Object.entries(Rt);n<r.length;n++){var s=r[n],i=s[0],u=s[1];if(t===u)return i}return!1},e.prototype.toString=function(t){var n=!!t;t=t??this.format;var r=!1,s=this.a<1&&this.a>=0,i=!n&&s&&(t.startsWith("hex")||t==="name");return i?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=Ue(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=Ue(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=Ue(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=Ue(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),s=new e(t).toRgb(),i=n/100,u={r:(s.r-r.r)*i+r.r,g:(s.g-r.g)*i+r.g,b:(s.b-r.b)*i+r.b,a:(s.a-r.a)*i+r.a};return new e(u)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),s=360/n,i=[this];for(r.h=(r.h-(s*t>>1)+720)%360;--t;)r.h=(r.h+s)%360,i.push(new e(r));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,s=n.s,i=n.v,u=[],a=1/t;t--;)u.push(new e({h:r,s,v:i})),i=(i+a)%1;return u},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),s=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/s,g:(n.g*n.a+r.g*r.a*(1-n.a))/s,b:(n.b*n.a+r.b*r.a*(1-n.a))/s,a:s})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,s=[this],i=360/t,u=1;u<t;u++)s.push(new e({h:(r+u*i)%360,s:n.s,l:n.l}));return s},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function ee(e,t=20){return e.mix("#141414",t).toString()}function bi(e){const t=at(),n=f.useNamespace("button");return o.computed(()=>{let r={},s=e.color;if(s){const i=s.match(/var\((.*?)\)/);i&&(s=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const u=new Er(s),a=e.dark?u.tint(20).toString():ee(u,20);if(e.plain)r=n.cssVarBlock({"bg-color":e.dark?ee(u,90):u.tint(90).toString(),"text-color":s,"border-color":e.dark?ee(u,50):u.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":s,"hover-border-color":s,"active-bg-color":a,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":a}),t.value&&(r[n.cssVarBlockName("disabled-bg-color")]=e.dark?ee(u,90):u.tint(90).toString(),r[n.cssVarBlockName("disabled-text-color")]=e.dark?ee(u,50):u.tint(50).toString(),r[n.cssVarBlockName("disabled-border-color")]=e.dark?ee(u,80):u.tint(80).toString());else{const l=e.dark?ee(u,30):u.tint(30).toString(),c=u.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(r=n.cssVarBlock({"bg-color":s,"text-color":c,"border-color":s,"hover-bg-color":l,"hover-text-color":c,"hover-border-color":l,"active-bg-color":a,"active-border-color":a}),t.value){const d=e.dark?ee(u,50):u.tint(50).toString();r[n.cssVarBlockName("disabled-bg-color")]=d,r[n.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,r[n.cssVarBlockName("disabled-border-color")]=d}}}return r})}const Si=o.defineComponent({name:"ElButton"}),Ei=o.defineComponent({...Si,props:It,emits:oi,setup(e,{expose:t,emit:n}){const r=e,s=bi(r),i=f.useNamespace("button"),{_ref:u,_size:a,_type:l,_disabled:c,_props:d,_plain:v,_round:y,_text:m,shouldAddSpace:h,handleClick:S}=si(r,n),T=o.computed(()=>[i.b(),i.m(l.value),i.m(a.value),i.is("disabled",c.value),i.is("loading",r.loading),i.is("plain",v.value),i.is("round",y.value),i.is("circle",r.circle),i.is("text",m.value),i.is("link",r.link),i.is("has-bg",r.bg)]);return t({ref:u,size:a,type:l,disabled:c,shouldAddSpace:h}),(b,E)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(b.tag),o.mergeProps({ref_key:"_ref",ref:u},o.unref(d),{class:o.unref(T),style:o.unref(s),onClick:o.unref(S)}),{default:o.withCtx(()=>[b.loading?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[b.$slots.loading?o.renderSlot(b.$slots,"loading",{key:0}):(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:1,class:o.normalizeClass(o.unref(i).is("loading"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(b.loadingIcon)))]),_:1},8,["class"]))],64)):b.icon||b.$slots.icon?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:1},{default:o.withCtx(()=>[b.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(b.icon),{key:0})):o.renderSlot(b.$slots,"icon",{key:1})]),_:3})):o.createCommentVNode("v-if",!0),b.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass({[o.unref(i).em("text","expand")]:o.unref(h)})},[o.renderSlot(b.$slots,"default")],2)):o.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var wi=f._export_sfc(Ei,[["__file","button.vue"]]);const Ti={size:It.size,type:It.type},Ci=o.defineComponent({name:"ElButtonGroup"}),Di=o.defineComponent({...Ci,props:Ti,setup(e){const t=e;o.provide(yr,o.reactive({size:o.toRef(t,"size"),type:o.toRef(t,"type")}));const n=f.useNamespace("button");return(r,s)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(n).b("group"))},[o.renderSlot(r.$slots,"default")],2))}});var wr=f._export_sfc(Di,[["__file","button-group.vue"]]);const Tr=f.withInstall(wi,{ButtonGroup:wr}),Ai=f.withNoopInstall(wr),Bi="utils/vue/vnode";var Ne=(e=>(e[e.TEXT=1]="TEXT",e[e.CLASS=2]="CLASS",e[e.STYLE=4]="STYLE",e[e.PROPS=8]="PROPS",e[e.FULL_PROPS=16]="FULL_PROPS",e[e.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",e[e.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",e[e.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",e[e.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",e[e.NEED_PATCH=512]="NEED_PATCH",e[e.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",e[e.HOISTED=-1]="HOISTED",e[e.BAIL=-2]="BAIL",e))(Ne||{});function Cr(e){return o.isVNode(e)&&e.type===o.Fragment}function xi(e){return o.isVNode(e)&&e.type===o.Comment}function ki(e){return o.isVNode(e)&&!Cr(e)&&!xi(e)}const Ii=e=>{if(!o.isVNode(e))return f.debugWarn(Bi,"[getNormalizedProps] must be a VNode"),{};const t=e.props||{},n=(o.isVNode(e.type)?e.type.props:void 0)||{},r={};return Object.keys(n).forEach(s=>{f.hasOwn(n[s],"default")&&(r[s]=n[s].default)}),Object.keys(t).forEach(s=>{r[f.camelize(s)]=t[s]}),r},ke=e=>{const t=f.isArray$1(e)?e:[e],n=[];return t.forEach(r=>{var s;f.isArray$1(r)?n.push(...ke(r)):o.isVNode(r)&&((s=r.component)!=null&&s.subTree)?n.push(r,...ke(r.component.subTree)):o.isVNode(r)&&f.isArray$1(r.children)?n.push(...ke(r.children)):o.isVNode(r)&&r.shapeFlag===2?n.push(...ke(r.type())):n.push(r)}),n},jt=e=>{if(!e)return{onClick:f.NOOP,onMousedown:f.NOOP,onMouseup:f.NOOP};let t=!1,n=!1;return{onClick:u=>{t&&n&&e(u),t=n=!1},onMousedown:u=>{t=u.target===u.currentTarget},onMouseup:u=>{n=u.target===u.currentTarget}}},Ri=f.buildProps({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:f.definePropType([String,Array,Object])},zIndex:{type:f.definePropType([String,Number])}}),Mi={click:e=>e instanceof MouseEvent},Ni="overlay";var Oi=o.defineComponent({name:"ElOverlay",props:Ri,emits:Mi,setup(e,{slots:t,emit:n}){const r=f.useNamespace(Ni),s=l=>{n("click",l)},{onClick:i,onMousedown:u,onMouseup:a}=jt(e.customMaskEvent?void 0:s);return()=>e.mask?o.createVNode("div",{class:[r.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:i,onMousedown:u,onMouseup:a},[o.renderSlot(t,"default")],Ne.STYLE|Ne.CLASS|Ne.PROPS,["onClick","onMouseup","onMousedown"]):o.h("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[o.renderSlot(t,"default")])}});const Dr=Oi,Ar=(e,t,n,r)=>{const s={offsetX:0,offsetY:0},i=o.ref(!1),u=(y,m)=>{if(e.value){const{offsetX:h,offsetY:S}=s,T=e.value.getBoundingClientRect(),b=T.left,E=T.top,D=T.width,N=T.height,$=document.documentElement.clientWidth,w=document.documentElement.clientHeight,L=-b+h,I=-E+S,O=$-b-D+h,q=w-E-(N<w?N:0)+S;r!=null&&r.value||(y=Math.min(Math.max(y,L),O),m=Math.min(Math.max(m,I),q)),s.offsetX=y,s.offsetY=m,e.value.style.transform=`translate(${f.addUnit(y)}, ${f.addUnit(m)})`}},a=y=>{const m=y.clientX,h=y.clientY,{offsetX:S,offsetY:T}=s,b=D=>{i.value||(i.value=!0);const N=S+D.clientX-m,$=T+D.clientY-h;u(N,$)},E=()=>{i.value=!1,document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",E)},l=()=>{t.value&&e.value&&(t.value.addEventListener("mousedown",a),window.addEventListener("resize",v))},c=()=>{t.value&&e.value&&(t.value.removeEventListener("mousedown",a),window.removeEventListener("resize",v))},d=()=>{s.offsetX=0,s.offsetY=0,e.value&&(e.value.style.transform="")},v=()=>{const{offsetX:y,offsetY:m}=s;u(y,m)};return o.onMounted(()=>{o.watchEffect(()=>{n.value?l():c()})}),o.onBeforeUnmount(()=>{c()}),{isDragging:i,resetPosition:d,updatePosition:v}},Br=(e,t={})=>{o.isRef(e)||f.throwError("[useLockscreen]","You need to pass a ref param to this function");const n=t.ns||f.useNamespace("popup"),r=o.computed(()=>n.bm("parent","hidden"));let s=0,i=!1,u="0";const a=()=>{setTimeout(()=>{typeof document>"u"||i&&document&&(document.body.style.width=u,f.removeClass(document.body,r.value))},200)};o.watch(e,l=>{if(!l){a();return}i=!f.hasClass(document.body,r.value),i&&(u=document.body.style.width,f.addClass(document.body,r.value)),s=nr(n.namespace.value);const c=document.documentElement.clientHeight<document.body.scrollHeight,d=f.getStyle(document.body,"overflowY");s>0&&(c||d==="scroll")&&i&&(document.body.style.width=`calc(100% - ${s}px)`)}),o.onScopeDispose(()=>a())},xr=e=>["",...f.componentSizes].includes(e),Mt="_trap-focus-children",le=[],Nn=e=>{if(le.length===0)return;const t=f.getEventCode(e),n=le[le.length-1][Mt];if(n.length>0&&t===f.EVENT_CODE.tab){if(n.length===1){e.preventDefault(),document.activeElement!==n[0]&&n[0].focus();return}const r=e.shiftKey,s=e.target===n[0],i=e.target===n[n.length-1];s&&r&&(e.preventDefault(),n[n.length-1].focus()),i&&!r&&(e.preventDefault(),n[0].focus())}},Vi={beforeMount(e){e[Mt]=Sn(e),le.push(e),le.length<=1&&document.addEventListener("keydown",Nn)},updated(e){o.nextTick(()=>{e[Mt]=Sn(e)})},unmounted(){le.shift(),le.length===0&&document.removeEventListener("keydown",Nn)}},Pi=o.defineComponent({name:"ElMessageBox",directives:{TrapFocus:Vi},components:{ElButton:Tr,ElFocusTrap:gr,ElInput:dr,ElOverlay:Dr,ElIcon:f.ElIcon,...f.TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:xr},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:Boolean,container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:r,ns:s,size:i}=f.useGlobalComponentSettings("message-box",o.computed(()=>e.buttonSize)),{t:u}=n,{nextZIndex:a}=r,l=o.ref(!1),c=o.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:o.markRaw(f.loading_default),cancelButtonLoadingIcon:o.markRaw(f.loading_default),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=o.computed(()=>{const B=c.type;return{[s.bm("icon",B)]:B&&f.TypeComponentsMap[B]}}),v=tt(),y=tt(),m=o.computed(()=>{const B=c.type;return c.icon||B&&f.TypeComponentsMap[B]||""}),h=o.computed(()=>!!c.message),S=o.ref(),T=o.ref(),b=o.ref(),E=o.ref(),D=o.ref(),N=o.computed(()=>c.confirmButtonClass);o.watch(()=>c.inputValue,async B=>{await o.nextTick(),e.boxType==="prompt"&&B&&Z()},{immediate:!0}),o.watch(()=>l.value,B=>{var H,_;B&&(e.boxType!=="prompt"&&(c.autofocus?b.value=(_=(H=D.value)==null?void 0:H.$el)!=null?_:S.value:b.value=S.value),c.zIndex=a()),e.boxType==="prompt"&&(B?o.nextTick().then(()=>{var X;E.value&&E.value.$el&&(c.autofocus?b.value=(X=vt())!=null?X:S.value:b.value=S.value)}):(c.editorErrorMessage="",c.validateError=!1))});const $=o.computed(()=>e.draggable),w=o.computed(()=>e.overflow),{isDragging:L}=Ar(S,T,$,w);o.onMounted(async()=>{await o.nextTick(),e.closeOnHashChange&&window.addEventListener("hashchange",I)}),o.onBeforeUnmount(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",I)});function I(){l.value&&(l.value=!1,o.nextTick(()=>{c.action&&t("action",c.action)}))}const O=()=>{e.closeOnClickModal&&R(c.distinguishCancelAndClose?"close":"cancel")},q=jt(O),V=B=>{if(c.inputType!=="textarea")return B.preventDefault(),R("confirm")},R=B=>{var H;e.boxType==="prompt"&&B==="confirm"&&!Z()||(c.action=B,c.beforeClose?(H=c.beforeClose)==null||H.call(c,B,c,I):I())},Z=()=>{if(e.boxType==="prompt"){const B=c.inputPattern;if(B&&!B.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||u("el.messagebox.error"),c.validateError=!0,!1;const H=c.inputValidator;if(f.isFunction$1(H)){const _=H(c.inputValue);if(_===!1)return c.editorErrorMessage=c.inputErrorMessage||u("el.messagebox.error"),c.validateError=!0,!1;if(f.isString(_))return c.editorErrorMessage=_,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},vt=()=>{var B,H;const _=(B=E.value)==null?void 0:B.$refs;return(H=_==null?void 0:_.input)!=null?H:_==null?void 0:_.textarea},Le=()=>{R("close")},He=()=>{e.closeOnPressEscape&&Le()};return e.lockScroll&&Br(l,{ns:s}),{...o.toRefs(c),ns:s,overlayEvent:q,visible:l,hasMessage:h,typeClass:d,contentId:v,inputId:y,btnSize:i,iconComponent:m,confirmButtonClasses:N,rootRef:S,focusStartRef:b,headerRef:T,inputRef:E,isDragging:L,confirmRef:D,doClose:I,handleClose:Le,onCloseRequested:He,handleWrapperClick:O,handleInputEnter:V,handleAction:R,t:u}}});function Fi(e,t,n,r,s,i){const u=o.resolveComponent("el-icon"),a=o.resolveComponent("el-input"),l=o.resolveComponent("el-button"),c=o.resolveComponent("el-focus-trap"),d=o.resolveComponent("el-overlay");return o.openBlock(),o.createBlock(o.Transition,{name:"fade-in-linear",onAfterLeave:v=>e.$emit("vanish"),persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(d,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:o.withCtx(()=>[o.createElementVNode("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:o.normalizeClass(`${e.ns.namespace.value}-overlay-message-box`),onClick:e.overlayEvent.onClick,onMousedown:e.overlayEvent.onMousedown,onMouseup:e.overlayEvent.onMouseup},[o.createVNode(c,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:o.withCtx(()=>[o.createElementVNode("div",{ref:"rootRef",class:o.normalizeClass([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),e.ns.is("dragging",e.isDragging),{[e.ns.m("center")]:e.center}]),style:o.normalizeStyle(e.customStyle),tabindex:"-1",onClick:o.withModifiers(()=>{},["stop"])},[e.title!==null&&e.title!==void 0?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"headerRef",class:o.normalizeClass([e.ns.e("header"),{"show-close":e.showClose}])},[o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("title"))},[e.iconComponent&&e.center?(o.openBlock(),o.createBlock(u,{key:0,class:o.normalizeClass([e.ns.e("status"),e.typeClass])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.createElementVNode("span",null,o.toDisplayString(e.title),1)],2),e.showClose?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:o.normalizeClass(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:v=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:o.withKeys(o.withModifiers(v=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[o.createVNode(u,{class:o.normalizeClass(e.ns.e("close"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.closeIcon||"close")))]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):o.createCommentVNode("v-if",!0)],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{id:e.contentId,class:o.normalizeClass(e.ns.e("content"))},[o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(o.openBlock(),o.createBlock(u,{key:0,class:o.normalizeClass([e.ns.e("status"),e.typeClass])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),e.hasMessage?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(e.ns.e("message"))},[o.renderSlot(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0,textContent:o.toDisplayString(e.message)},null,8,["for","textContent"]))])],2)):o.createCommentVNode("v-if",!0)],2),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("input"))},[o.createVNode(a,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":v=>e.inputValue=v,type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:o.normalizeClass({invalid:e.validateError}),onKeydown:o.withKeys(e.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("errormsg")),style:o.normalizeStyle({visibility:e.editorErrorMessage?"visible":"hidden"})},o.toDisplayString(e.editorErrorMessage),7)],2),[[o.vShow,e.showInput]])],10,["id"]),o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("btns"))},[e.showCancelButton?(o.openBlock(),o.createBlock(l,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:o.normalizeClass([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:v=>e.handleAction("cancel"),onKeydown:o.withKeys(o.withModifiers(v=>e.handleAction("cancel"),["prevent"]),["enter"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):o.createCommentVNode("v-if",!0),o.withDirectives(o.createVNode(l,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:o.normalizeClass([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:v=>e.handleAction("confirm"),onKeydown:o.withKeys(o.withModifiers(v=>e.handleAction("confirm"),["prevent"]),["enter"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[o.vShow,e.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[o.vShow,e.visible]])]),_:3},8,["onAfterLeave"])}var Li=f._export_sfc(Pi,[["render",Fi],["__file","index.vue"]]);const Ve=new Map,Hi=e=>{let t=document.body;return e.appendTo&&(f.isString(e.appendTo)&&(t=document.querySelector(e.appendTo)),f.isElement(e.appendTo)&&(t=e.appendTo),f.isElement(t)||(f.debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),t=document.body)),t},_i=(e,t,n=null)=>{const r=o.createVNode(Li,e,f.isFunction$1(e.message)||o.isVNode(e.message)?{default:f.isFunction$1(e.message)?e.message:()=>e.message}:null);return r.appContext=n,o.render(r,t),Hi(e).appendChild(t.firstElementChild),r.component},zi=()=>document.createElement("div"),Ki=(e,t)=>{const n=zi();e.onVanish=()=>{o.render(null,n),Ve.delete(s)},e.onAction=i=>{const u=Ve.get(s);let a;e.showInput?a={value:s.inputValue,action:i}:a=i,e.callback?e.callback(a,r.proxy):i==="cancel"||i==="close"?e.distinguishCancelAndClose&&i!=="cancel"?u.reject("close"):u.reject("cancel"):u.resolve(a)};const r=_i(e,n,t),s=r.proxy;for(const i in e)f.hasOwn(e,i)&&!f.hasOwn(s.$props,i)&&(i==="closeIcon"&&f.isObject$1(e[i])?s[i]=o.markRaw(e[i]):s[i]=e[i]);return s.visible=!0,s};function De(e,t=null){if(!f.isClient)return Promise.reject();let n;return f.isString(e)||o.isVNode(e)?e={message:e}:n=e.callback,new Promise((r,s)=>{const i=Ki(e,t??De._context);Ve.set(i,{options:e,callback:n,resolve:r,reject:s})})}const $i=["alert","confirm","prompt"],Ui={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};$i.forEach(e=>{De[e]=qi(e)});function qi(e){return(t,n,r,s)=>{let i="";return f.isObject$1(n)?(r=n,i=""):f.isUndefined(n)?i="":i=n,De(Object.assign({title:i,message:t,type:"",...Ui[e]},r,{boxType:e}),s)}}De.close=()=>{Ve.forEach((e,t)=>{t.doClose()}),Ve.clear()};De._context=null;const ne=De;ne.install=e=>{ne._context=e._context,e.config.globalProperties.$msgbox=ne,e.config.globalProperties.$messageBox=ne,e.config.globalProperties.$alert=ne.alert,e.config.globalProperties.$confirm=ne.confirm,e.config.globalProperties.$prompt=ne.prompt};const kr=ne,ji=[{title:"系统配置",path:"系统配置",level:0,icon:"系统配置",carryData:!1,show:!0,childMenus:[{title:"站内信",path:"/系统配置/站内信",show:!0,level:1,icon:"站内信",carryData:!0,isRouter:!0},{title:"自动生成",path:"/系统配置/自动生成",show:!0,level:1,icon:"自动生成",carryData:!0,isRouter:!0}]},{title:"系统维护",path:"系统维护",level:0,icon:"平台管理",carryData:!1,show:!0,childMenus:[{title:"登录日志",path:"/系统维护/登录日志",show:!0,level:1,icon:"菜单管理",carryData:!0,isRouter:!0},{title:"操作日志",path:"/系统维护/操作日志",show:!0,level:1,icon:"主菜单管理",carryData:!0,isRouter:!0}]}],Wt=f.defineStore("menuState",{state:()=>({isRefreshMenus:!1,activeMenuStructureIds:[],cacheInputMenu:{},configMenu:{form:{},options:[],structure:[]},cacheStructures:[],rawMenus:[],menus:[],activeTopMenuPath:"",activeMenuPath:"",activeOldMenuPath:"",activeMainMenu:{},activeAsideMenu:{},activeMenuOpenPaths:[],systemKey:"",buttonTriggerType:"contentConfig",menuTriggerType:"open",permissionSideMenus:[],importLoading:!1,contentLoading:!1,asideMenuLoading:!1,asideMenus:[],platform:"browser",platName:"",childMenu:"",linkMenuInfo:null}),actions:{setLinkMenuInfo(e){this.linkMenuInfo=e},setAsideMenuLoading(e){this.asideMenuLoading=e},setCacheStructures(e){var n,r;const t=(n=this.cacheStructures)==null?void 0:n.map(s=>s.key);e?t!=null&&t.includes(e==null?void 0:e.key)?this.cacheStructures=(r=this.cacheStructures)==null?void 0:r.map(s=>s.key===(e==null?void 0:e.key)?{...s,data:e==null?void 0:e.data}:s):this.cacheStructures.push(e):this.cacheStructures=[]},setChildMenu(e){this.childMenu=e},async setConfigMenu(e){this.configMenu=e},setActiveMainMenu(e){this.activeMainMenu=e},setContentLoading(e){this.contentLoading=e},setActiveAsideMenu(e){this.activeAsideMenu=e},setActiveTopMenuPath(e){this.activeTopMenuPath=e},setCacheInputMenu(e){this.cacheInputMenu=e},setIsRefreshMenus(e){this.isRefreshMenus=e},setButtonTriggerType(e){this.buttonTriggerType=e},setAsideMenus(e){this.asideMenus=e},setMenus(e){this.menus=e},setPlatName(e){this.platName=e},setImportLoading(e){this.importLoading=e},setPlatform(e){this.platform=e},getPlatform(){return this.platform},setMenuTriggerType(e){this.menuTriggerType=e},setSystemKey(e){this.systemKey=e},setActiveMenuPath(e){!e&&e!==null||(this.activeOldMenuPath=f.cloneDeep(this.activeMenuPath),this.activeMenuPath=e)},setActiveMenuOpenPaths(e){this.activeMenuOpenPaths=e},setRawMenus(e){this.rawMenus=e,this.permissionSideMenus=ji}}}),Gt=f.defineStore("modelComp",{state:()=>({lockingPage:"",itemData:[],itemGridData:[],itemExtendData:{},originalData:[],extraContents:[],nodeDev:"",isEdit:"view",isRefreshCurStructure:!1,isSubmitCurStructure:!1,curStructureCompIds:[],systemPath:"",freshContent:!1,routeToChildPath:"",cacheUpdatingData:null,tableViewContents:[],activeItemIndex:-1,tableLoading:!1,pageMapState:{},payloadTypes:"data,structure,structureMethod,gridLayout,extend"}),actions:{setLockingPage(e){this.lockingPage=e},setPageMapState(e){this.pageMapState=e},setItemGridData(e){this.itemGridData=e},setItemExtendData(e){this.itemExtendData=e},setItemData(e){this.itemData=e},setTableLoading(e){this.tableLoading=e},setTableViewContents(e){this.tableViewContents=e},setCacheUpdatingData(e){this.cacheUpdatingData=e},setFreshContent(e){this.freshContent=e},setRouteToChildPath(e){this.routeToChildPath=e},setSubmitCurStructure(e){this.isSubmitCurStructure=e},setCurStructureCompIds(e){this.curStructureCompIds=e},setRefreshCurStructure(e){this.isRefreshCurStructure=e},setOriginalData(e){this.originalData=e},setExtraContents(e){this.extraContents=e},setNodeDev(e){this.nodeDev=e},setIsEdit(e){this.isEdit=e},setSystemPath(e){this.systemPath=e},setActiveItemIndex(e){this.activeItemIndex=e}}}),Yt=f.defineStore("authorityState",{state:()=>({routerPageStructures:[]}),actions:{setRouterPageStructure(e){this.routerPageStructures=e}}}),Wi=Wt(f.pinia),{activeMenuPath:Qe}=f.storeToRefs(Wi),Ir=f.useLoginState(f.pinia),{structureData:Gi,loginUserInfo:Tt}=f.storeToRefs(Ir),Yi=Yt(f.pinia),{routerPageStructures:Zi}=f.storeToRefs(Yi),nt=Gt(f.pinia),Xi=o.ref([{label:"角色名称",value:"",name:"roleName"}]),Ji=o.ref([{label:"查询"},{label:"重置"}]),On=o.reactive({isFilter:!1,filterForm:{}}),Qi=o.ref(!1),eo=e=>{On.isFilter=!0,On.filterForm=e},Rr=o.ref([]),Nt=o.ref([]),Mr=o.ref(""),to=o.computed(()=>{var t,n,r,s,i;const e=(t=Zi.value)==null?void 0:t.find(u=>{var a;return((a=u==null?void 0:u.comp)==null?void 0:a.toUpperCase())==="TABLE"});if(e){Mr.value=e.name,Nt.value=(s=(r=(n=e==null?void 0:e.compData)==null?void 0:n.find(a=>(a==null?void 0:a.key)==="header"))==null?void 0:r.contents)==null?void 0:s.filter(a=>(a==null?void 0:a.label)!=="操作");const u=(i=e==null?void 0:e.compData)==null?void 0:i.map(a=>{var l;if((a==null?void 0:a.key)==="rowButton"){let c=[];return be.value?c=[...a==null?void 0:a.contents,{label:"授权"}]:c=a==null?void 0:a.contents,{...a,contents:c}}return(a==null?void 0:a.key)==="header"?{...a,contents:(l=a==null?void 0:a.contents)==null?void 0:l.map(c=>{var d,v;return{...c,isTableColHidden:(d=c==null?void 0:c.prop)==null?void 0:d.includes("授权"),isFormColHidden:(v=c==null?void 0:c.prop)==null?void 0:v.includes("授权")}})}:a});return Pr(u),u}return[]}),no=e=>{nt.setRefreshCurStructure(!1),nn(e.singleContent,e.buttonName,ft.value,e==null?void 0:e.selectItems)},ye=o.ref({}),Zt=o.ref(),Pe=async(e,t,n)=>{var r,s;try{const i=await e(t);return((r=i==null?void 0:i.data)==null?void 0:r.code)===200?(n!=="查询"&&await Ir.setLogRecordAsync({type:n,data:t},Qe.value),f.ElMessage.success("保存成功"),nt.setRefreshCurStructure(!0),i.data.result||((s=i==null?void 0:i.data)==null?void 0:s.code)===200):null}catch(i){f.ElMessage.error(i)}finally{nt.setCacheUpdatingData(null)}},Nr=(e,t)=>{const n=[];for(const r of e)t!=null&&t.has(r.path)&&n.push(r),r.children&&n.push(...Nr(r.children,t));return n},ro=(e,t)=>{var n,r;try{const s=new Map(e==null?void 0:e.map(a=>[a.path,a.checkedButtons])),i=Nr(t,s),u=(n=i==null?void 0:i.filter(a=>{var l,c;return((l=a==null?void 0:a.checkedButtons)==null?void 0:l.length)===((c=a==null?void 0:a.renderButtons)==null?void 0:c.length)}))==null?void 0:n.map(a=>a==null?void 0:a.path);(r=Zt.value)==null||r.setCheckedKeys(u)}catch{throw new Error("数据显示处理失败")}},so=(e,t)=>{const n=new Map(t==null?void 0:t.map(s=>[s.path,s.checkedButtons]));function r(s){var u,a;const i=(u=s==null?void 0:s.path)!=null&&u.startsWith("/")?(a=s==null?void 0:s.path)==null?void 0:a.substring(1):s==null?void 0:s.path;n.has(i)&&(s.checkedButtons=n.get(i)),s.children&&s.children.length>0&&s.children.forEach(r)}e.forEach(r)},Or=e=>e==null?void 0:e.map(t=>{var r;const n={...t,checkedButtons:[]};return n.children&&((r=n.children)==null?void 0:r.length)>0&&(n.children=Or(n.children)),n}),Xt=e=>{for(const t in e)if(Array.isArray(e[t]))return t;return""},Vr=e=>{const t=[];let n=0;for(;n<e.length;)if(typeof e[n]=="string"){const r={title:e[n]};n+1<e.length&&Array.isArray(e[n+1])?(r.children=Vr(e[n+1]),n+=2):n+=1,t.push(r)}return t},Jt=e=>{const t=[];let n=0;for(;n<(e==null?void 0:e.length);){const r={title:e==null?void 0:e[n]};n+1<(e==null?void 0:e.length)&&Array.isArray(e==null?void 0:e[n+1])?(r.children=Vr(e==null?void 0:e[n+1]),n+=2):n+=1,t.push(r)}return t},ct=(e,t="",n=new Map)=>e==null?void 0:e.map(r=>{const s=t?`${t}/${r.title}`:r.title;if(n.has(s))return n.get(s);const i={...r,path:s};return r.children&&r.children.length>0&&(i.children=ct(r.children,s,n)),n.set(s,i),i}),Qt=(e,t)=>e.reduce((n,r)=>{const s=r[t];return n[s]||(n[s]=[]),n[s].push(r),n},{}),en=e=>{const t=[];function n(r,s){!r.children||r.children.length===0?t.push({...r,parentPath:s||""}):r.children.forEach(i=>n(i,r.path||s))}return e.forEach(r=>n(r,"")),t},tn=e=>Object.entries(e).map(([n,r])=>({path:n,checkedButtons:r==null?void 0:r.map(s=>s==null?void 0:s.path)})),io=e=>Object.prototype.toString.call(e)==="[object Object]"&&e!==null,oo=(e,t)=>{const n={},r=Array.isArray(e)?e==null?void 0:e.filter(s=>{var i;return!(io(s)&&((i=Object.keys(s))!=null&&i.includes("id")))}):null;return r&&(r==null||r.forEach((s,i)=>{var u;n[(u=t[i])==null?void 0:u.prop]=s})),n},me=o.ref(""),Pr=e=>{var i;const t=e==null?void 0:e.find(u=>(u==null?void 0:u.key)==="tableContents"),n=e==null?void 0:e.find(u=>(u==null?void 0:u.key)==="header");if(!t||!n)return"";const r=(i=t==null?void 0:t.contents)==null?void 0:i[0],s=oo(r,n==null?void 0:n.contents);me.value=Xt(s)},ao=e=>{if(!Array.isArray(e))return!1;for(let t of e){if(typeof t!="object"||t===null||typeof t.path!="string"||!Array.isArray(t.checkedButtons))return!1;for(let n of t.checkedButtons)if(typeof n!="string")return!1}return!0},uo=e=>{const t=[];for(const n in e)e[n].forEach(s=>{var l,c;const i=(l=s.path)!=null&&l.startsWith("/")?(c=s.path)==null?void 0:c.substring(1):s.path,u=i==null?void 0:i.split("/");let a=t;u.forEach(d=>{let v=a.find(y=>y.title===d);v||(v={title:d,path:s.path,children:[]},a.push(v)),a=v.children})});return t},lo=e=>{const t={};return e.forEach(n=>{const{path:r,checkedButtons:s}=n,i=r,u=s.map(a=>({title:a.split("/").pop()||"",path:a,parentPath:i}));t[i]=u}),t},Fr=e=>{let t=[];for(const n of e){let r=[n.title];if(n.children&&Array.isArray(n.children)){let s=Fr(n.children);s.length>0&&r.push(s)}t.push(r)}return t},co=e=>{const t=[];for(const n of e){if(!Array.isArray(n)||n.length!==2)continue;const[r,s]=n,i=Lr(s),u=t.indexOf(r);u===-1?t.push(r,i):t[u+1]=Hr(t[u+1],i)}return t},Lr=e=>{const t=[];for(const n of e)if(Array.isArray(n)){if(n.length===1&&typeof n[0]=="string")t.push(n[0]);else if(n.length===2&&typeof n[0]=="string"){const[r,s]=n;t.push(r,Lr(s))}}return t},Hr=(e,t)=>{const n=[...e];let r=0;for(;r<t.length;){const s=t[r];if(typeof s=="string"){const i=n.indexOf(s);i===-1?n.push(s,t[r+1]):n[i+1]=Hr(n[i+1],t[r+1]),r+=2}else n.push(s),r+=1}return n},fo=async(e,t)=>{var n;if(ye.value=f.cloneDeep(t),nt.setRefreshCurStructure(!1),(n=Se.value)==null||n.splice(0),e==="授权"){if(!me.value){f.ElMessage.error("请正确定义角色权限");return}const r=ao(ye.value[me.value]);let s;if(r)s=ye.value[me.value];else{const i=Jt(ye.value[me.value]),u=ct(i),a=en(u),l=Qt(a,"parentPath");s=tn(l)}if(!s||!Array.isArray(s)){f.ElMessage.error("权限数据处理出错了,请联系管理员");return}ce.title=`【${t.角色名称}】授权`,ce.show=!0,await o.nextTick(),so(we.value,s),ro(s,we.value)}},ho=()=>{ce.show=!1},Ot=o.ref(),po=async e=>{const t=await Pe(f.getInsofDataApi,{key:{systemKey:sessionStorage.getItem("systemKey"),type:"data",pageKey:e}},"查询"),n=t==null?void 0:t.map(r=>{var s;return{id:r.id,tableData:(s=r==null?void 0:r.value)==null?void 0:s.tableData}});return n==null?void 0:n.map(r=>{var s;if(Array.isArray(r==null?void 0:r.tableData)){let i={id:r.id};return(s=r==null?void 0:r.tableData)==null||s.forEach((u,a)=>{i[`a${a}`]=u}),i}else return{...r.tableData,id:r.id}})},Fe=(e,t)=>{let n={};if(t==null||t.forEach(r=>{r.label&&e&&(n[r.label]=(e==null?void 0:e[r==null?void 0:r.prop])??null)}),n!=null&&n.id){const{id:r,...s}=n;return s}return n},vo=async(e,t)=>{var i,u;let n=[];Array.isArray(e)?n=f.cloneDeep(e):n=[f.cloneDeep(e)];const r=(i=n==null?void 0:n.filter(a=>typeof(a==null?void 0:a.id)=="string"))==null?void 0:i.map(a=>{var l,c,d,v,y;return{key:{type:"data",systemKey:sessionStorage.getItem("systemKey"),pageKey:(l=Qe.value)!=null&&l.startsWith("/")?(c=Qe.value)==null?void 0:c.substring(1):Qe.value,tableId:t,createUserId:(d=Tt.value)==null?void 0:d.id,createUserOrg:((v=Tt.value)==null?void 0:v.dept)||((y=Tt.value)==null?void 0:y.部门名称)},value:{tableData:Fe(a,Nt.value)}}}),s=(u=n==null?void 0:n.filter(a=>typeof(a==null?void 0:a.id)=="number"))==null?void 0:u.map(a=>({id:a==null?void 0:a.id,value:{tableData:Fe(a,Nt.value)}}));r.length>0&&await Pe(f.batchAddInsofDataApi,{dataList:r},"新增"),s.length>0&&(await Pe(f.batchUpdateInsofDataApi,{dataList:s},"编辑"),ce.show=!1)},nn=async(e,t,n,r)=>{if(!(t!=null&&t.includes("删除")))await vo(e,n);else{let s=[];t!=null&&t.includes("批量")?s=r&&(r==null?void 0:r.length)>0?r==null?void 0:r.map(i=>i==null?void 0:i.id):[]:s=[e==null?void 0:e.id],await Pe(f.batchDeleteInsofDataApi,{ids:s},"编辑")}},_r=e=>{let t=[];return e==null||e.forEach(n=>{var r;if(n.checkedButtons&&((r=n.checkedButtons)==null?void 0:r.length)>0){const s={path:n.path,checkedButtons:n.checkedButtons};t=t.concat(s)}n.children&&(t=t.concat(_r(n.children)))}),t},go=()=>{const e=_r(we.value),t=lo(e),n=uo(t),r=Fr(n),s=co(r);Ot.value={...ye.value,[me.value]:s},o.nextTick(()=>{nn(Ot.value,"编辑",ft.value)})},ce=o.reactive({show:!1,title:"角色授权",width:"30%",draggable:!0}),yo=({isPenultimate:e},t)=>{var n,r;return console.log("isPenultimate",e,t),((r=(n=t==null?void 0:t.data)==null?void 0:n.renderButtons)==null?void 0:r.length)>0?"is-penultimate":""},ft=o.ref(0),zr=async e=>{var r,s,i,u,a;let t;const n=await f.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure",pageKey:e!=null&&e.startsWith("/")?e==null?void 0:e.substring(1):e}});return((r=n==null?void 0:n.data)==null?void 0:r.code)===200&&(s=n==null?void 0:n.data)!=null&&s.result&&((i=n==null?void 0:n.data)==null?void 0:i.result.length)>0&&(t=(a=(u=n==null?void 0:n.data.result)==null?void 0:u[0])==null?void 0:a.id,ft.value=t),t},we=o.ref([]),mo=o.ref([{path:"资源管理",buttons:["查询","新增","编辑","删除"]},{path:"资源管理/人员",buttons:["查询","新增","编辑","删除"]}]),bo=(e,t)=>{var n;e.checkedButtons=t?(n=e.renderButtons)==null?void 0:n.map(r=>r.path):[]},Se=o.ref([]),So=(e,t)=>{var n,r,s;t.checkedButtons=e,((n=t.checkedButtons)==null?void 0:n.length)===((r=t.renderButtons)==null?void 0:r.length)?Se.value.push(t.path):(e==null?void 0:e.length)===0&&(Se.value=(s=Se.value)==null?void 0:s.filter(i=>i!==t.path))};o.watch(()=>Se.value.length,()=>{var e;(e=Zt.value)==null||e.setCheckedKeys([...Se.value])});o.watch(()=>ce.show,e=>{e||(we.value=Or(we.value))});const Kr=o.computed(()=>{var n;const e=(n=f.cloneDeep(Gi.value))==null?void 0:n.filter(r=>{var s,i;return((i=(s=r==null?void 0:r.key)==null?void 0:s.pageKey)==null?void 0:i.toUpperCase())!=="MENU"});return[...e==null?void 0:e.map(r=>{var u,a,l,c,d,v,y,m;const s=/button/i;let i=(l=(a=(u=r==null?void 0:r.value)==null?void 0:u.pageData)==null?void 0:a.compData)==null?void 0:l.filter(h=>s.test(h==null?void 0:h.key));return i=Array.from(new Set(i==null?void 0:i.flatMap(h=>h.contents.map(S=>S.label)))),{path:(d=(c=r==null?void 0:r.key)==null?void 0:c.pageKey)!=null&&d.startsWith("/")?(y=(v=r==null?void 0:r.key)==null?void 0:v.pageKey)==null?void 0:y.substring(1):(m=r==null?void 0:r.key)==null?void 0:m.pageKey,buttons:i}}),...$r.value]}),$r=o.ref([]),Eo=(e,t,n)=>{const s=[e==null?void 0:e.find(i=>(i==null?void 0:i.title)===t)].flatMap(i=>i==null?void 0:i.children);return s==null?void 0:s.map(i=>{var u,a;return{path:(u=i==null?void 0:i.path)!=null&&u.startsWith("/")?(a=i==null?void 0:i.path)==null?void 0:a.substring(1):i==null?void 0:i.path,buttons:n}})},Vn=(e,t)=>{var n;if(e.carryData){if(e.path==="系统管理/个人中心"){const s=["基本信息","上传头像","签名","修改密码"];return s==null?void 0:s.map(i=>{var u,a;return{title:i,path:(u=e==null?void 0:e.path)!=null&&u.startsWith("/")?((a=e==null?void 0:e.path)==null?void 0:a.substring(1))+"/"+i:e.path+"/"+i}})}if(!(t!=null&&t.buttons)||!Array.isArray(t==null?void 0:t.buttons))return[];const r=(n=t==null?void 0:t.buttons)!=null&&n.includes("查看")?t==null?void 0:t.buttons:["查看",...t==null?void 0:t.buttons];return r==null?void 0:r.map(s=>{var i,u;return{title:s,path:(i=e==null?void 0:e.path)!=null&&i.startsWith("/")?((u=e==null?void 0:e.path)==null?void 0:u.substring(1))+"/"+s:e.path+"/"+s}})}return[]},Ur=(e,t)=>{if(Array.isArray(e))return e==null?void 0:e.map(n=>{var i,u;const r=(i=n==null?void 0:n.path)!=null&&i.startsWith("/")?(u=n==null?void 0:n.path)==null?void 0:u.substring(1):n==null?void 0:n.path,s=t==null?void 0:t.find(a=>(a==null?void 0:a.path)===r);return n.children&&n.children.length>0?{...n,renderButtons:Vn(n,s),checkedButtons:[],children:Ur(n.children,Kr.value)}:{...n,renderButtons:Vn(n,s),checkedButtons:[]}})},wo={comp:"Group",name:"/系统管理/角色管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:Rr.value,name:""}]}]},To=Object.freeze(Object.defineProperty({__proto__:null,addButtonsToTree:Ur,addPathToTree:ct,authorizeDialog:ce,buttonValue:Ji,changedRow:Ot,clickRow:ye,clickRowButton:fo,clickSubmitAuthority:go,closeAuthorizeDialog:ho,compName:Mr,convertArrayToTree:Jt,convertIndexToLabel:Fe,customNodeClass:yo,getActivePageStructureId:zr,getAuthorityKey:Pr,getFirstArrayProperty:Xt,getLeafNodesRecursive:en,getPageDataAsync:po,groupByField:Qt,handleAddSysMenusButtons:Eo,handleItemDataChange:no,handleNodeBtnChange:So,handleNodeCheckChange:bo,handleQueryChange:eo,handleRowAuthorityRender:tn,handleSubmitAsync:Pe,isPageDataExist:Qi,menuData:we,menusButtons:mo,pageData:Rr,pageDataFiltered:to,queryFormData:Xi,structureButtons:Kr,structureId:ft,submitTableAsyncByVerify:nn,tempRolePageData:wo,tempSysMenus:$r,treeRef:Zt},Symbol.toStringTag,{value:"Module"}));var Co="0123456789abcdefghijklmnopqrstuvwxyz";function Q(e){return Co.charAt(e)}function Do(e,t){return e&t}function je(e,t){return e|t}function Pn(e,t){return e^t}function Fn(e,t){return e&~t}function Ao(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}function Bo(e){for(var t=0;e!=0;)e&=e-1,++t;return t}var ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qr="=";function rt(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=ge.charAt(n>>6)+ge.charAt(n&63);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=ge.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=ge.charAt(n>>2)+ge.charAt((n&3)<<4));(r.length&3)>0;)r+=qr;return r}function Ln(e){var t="",n,r=0,s=0;for(n=0;n<e.length&&e.charAt(n)!=qr;++n){var i=ge.indexOf(e.charAt(n));i<0||(r==0?(t+=Q(i>>2),s=i&3,r=1):r==1?(t+=Q(s<<2|i>>4),s=i&15,r=2):r==2?(t+=Q(s),t+=Q(i>>2),s=i&3,r=3):(t+=Q(s<<2|i>>4),t+=Q(i&15),r=0))}return r==1&&(t+=Q(s<<2)),t}var de,xo={decode:function(e){var t;if(de===void 0){var n="0123456789ABCDEF",r=` \f
|
|
7
|
+
`)},{immediate:!0})},si=(e,t)=>{mr({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},o.computed(()=>e.type==="text"));const n=o.inject(yr,void 0),r=f.useGlobalConfig("button"),{form:s}=zt(),i=Kt(o.computed(()=>n==null?void 0:n.size)),u=at(),a=o.ref(),l=o.useSlots(),c=o.computed(()=>{var b;return e.type||(n==null?void 0:n.type)||((b=r.value)==null?void 0:b.type)||""}),d=o.computed(()=>{var b,E,A;return(A=(E=e.autoInsertSpace)!=null?E:(b=r.value)==null?void 0:b.autoInsertSpace)!=null?A:!1}),v=o.computed(()=>{var b,E,A;return(A=(E=e.plain)!=null?E:(b=r.value)==null?void 0:b.plain)!=null?A:!1}),y=o.computed(()=>{var b,E,A;return(A=(E=e.round)!=null?E:(b=r.value)==null?void 0:b.round)!=null?A:!1}),m=o.computed(()=>{var b,E,A;return(A=(E=e.text)!=null?E:(b=r.value)==null?void 0:b.text)!=null?A:!1}),h=o.computed(()=>e.tag==="button"?{ariaDisabled:u.value||e.loading,disabled:u.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),S=o.computed(()=>{var b;const E=(b=l.default)==null?void 0:b.call(l);if(d.value&&(E==null?void 0:E.length)===1){const A=E[0];if((A==null?void 0:A.type)===o.Text){const N=A.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(N.trim())}}return!1});return{_disabled:u,_size:i,_type:c,_ref:a,_props:h,_plain:v,_round:y,_text:m,shouldAddSpace:S,handleClick:b=>{if(u.value||e.loading){b.stopPropagation();return}e.nativeType==="reset"&&(s==null||s.resetFields()),t("click",b)}}},br=["default","primary","success","warning","info","danger","text",""],ii=["button","submit","reset"],It=f.buildProps({size:f.useSizeProp,disabled:Boolean,type:{type:String,values:br,default:""},icon:{type:f.iconPropType},nativeType:{type:String,values:ii,default:"button"},loading:Boolean,loadingIcon:{type:f.iconPropType,default:()=>f.loading_default},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:f.definePropType([String,Object]),default:"button"}}),oi={click:e=>e instanceof MouseEvent};function F(e,t){ai(e)&&(e="100%");var n=ui(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Ue(e){return Math.min(1,Math.max(0,e))}function ai(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function ui(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Sr(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function qe(e){return e<=1?"".concat(Number(e)*100,"%"):e}function ue(e){return e.length===1?"0"+e:String(e)}function li(e,t,n){return{r:F(e,255)*255,g:F(t,255)*255,b:F(n,255)*255}}function kn(e,t,n){e=F(e,255),t=F(t,255),n=F(n,255);var r=Math.max(e,t,n),s=Math.min(e,t,n),i=0,u=0,a=(r+s)/2;if(r===s)u=0,i=0;else{var l=r-s;switch(u=a>.5?l/(2-r-s):l/(r+s),r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:u,l:a}}function St(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ci(e,t,n){var r,s,i;if(e=F(e,360),t=F(t,100),n=F(n,100),t===0)s=n,i=n,r=n;else{var u=n<.5?n*(1+t):n+t-n*t,a=2*n-u;r=St(a,u,e+1/3),s=St(a,u,e),i=St(a,u,e-1/3)}return{r:r*255,g:s*255,b:i*255}}function In(e,t,n){e=F(e,255),t=F(t,255),n=F(n,255);var r=Math.max(e,t,n),s=Math.min(e,t,n),i=0,u=r,a=r-s,l=r===0?0:a/r;if(r===s)i=0;else{switch(r){case e:i=(t-n)/a+(t<n?6:0);break;case t:i=(n-e)/a+2;break;case n:i=(e-t)/a+4;break}i/=6}return{h:i,s:l,v:u}}function fi(e,t,n){e=F(e,360)*6,t=F(t,100),n=F(n,100);var r=Math.floor(e),s=e-r,i=n*(1-t),u=n*(1-s*t),a=n*(1-(1-s)*t),l=r%6,c=[n,u,i,i,a,n][l],d=[a,n,n,u,i,i][l],v=[i,i,a,n,n,u][l];return{r:c*255,g:d*255,b:v*255}}function Rn(e,t,n,r){var s=[ue(Math.round(e).toString(16)),ue(Math.round(t).toString(16)),ue(Math.round(n).toString(16))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function hi(e,t,n,r,s){var i=[ue(Math.round(e).toString(16)),ue(Math.round(t).toString(16)),ue(Math.round(n).toString(16)),ue(di(r))];return s&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function di(e){return Math.round(parseFloat(e)*255).toString(16)}function Mn(e){return j(e)/255}function j(e){return parseInt(e,16)}function pi(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var Rt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function vi(e){var t={r:0,g:0,b:0},n=1,r=null,s=null,i=null,u=!1,a=!1;return typeof e=="string"&&(e=mi(e)),typeof e=="object"&&(J(e.r)&&J(e.g)&&J(e.b)?(t=li(e.r,e.g,e.b),u=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):J(e.h)&&J(e.s)&&J(e.v)?(r=qe(e.s),s=qe(e.v),t=fi(e.h,r,s),u=!0,a="hsv"):J(e.h)&&J(e.s)&&J(e.l)&&(r=qe(e.s),i=qe(e.l),t=ci(e.h,r,i),u=!0,a="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Sr(n),{ok:u,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var gi="[-\\+]?\\d+%?",yi="[-\\+]?\\d*\\.\\d+%?",se="(?:".concat(yi,")|(?:").concat(gi,")"),Et="[\\s|\\(]+(".concat(se,")[,|\\s]+(").concat(se,")[,|\\s]+(").concat(se,")\\s*\\)?"),wt="[\\s|\\(]+(".concat(se,")[,|\\s]+(").concat(se,")[,|\\s]+(").concat(se,")[,|\\s]+(").concat(se,")\\s*\\)?"),G={CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+Et),rgba:new RegExp("rgba"+wt),hsl:new RegExp("hsl"+Et),hsla:new RegExp("hsla"+wt),hsv:new RegExp("hsv"+Et),hsva:new RegExp("hsva"+wt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function mi(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Rt[e])e=Rt[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=G.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=G.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=G.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=G.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=G.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=G.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=G.hex8.exec(e),n?{r:j(n[1]),g:j(n[2]),b:j(n[3]),a:Mn(n[4]),format:t?"name":"hex8"}:(n=G.hex6.exec(e),n?{r:j(n[1]),g:j(n[2]),b:j(n[3]),format:t?"name":"hex"}:(n=G.hex4.exec(e),n?{r:j(n[1]+n[1]),g:j(n[2]+n[2]),b:j(n[3]+n[3]),a:Mn(n[4]+n[4]),format:t?"name":"hex8"}:(n=G.hex3.exec(e),n?{r:j(n[1]+n[1]),g:j(n[2]+n[2]),b:j(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function J(e){return!!G.CSS_UNIT.exec(String(e))}var Er=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=pi(t)),this.originalInput=t;var s=vi(t);this.originalInput=t,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:s.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,s,i=t.r/255,u=t.g/255,a=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),u<=.03928?r=u/12.92:r=Math.pow((u+.055)/1.055,2.4),a<=.03928?s=a/12.92:s=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*r+.0722*s},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=Sr(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=In(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=In(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),s=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(s,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(s,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=kn(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=kn(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),s=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(s,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(s,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Rn(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),hi(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(F(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(F(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Rn(this.r,this.g,this.b,!1),n=0,r=Object.entries(Rt);n<r.length;n++){var s=r[n],i=s[0],u=s[1];if(t===u)return i}return!1},e.prototype.toString=function(t){var n=!!t;t=t??this.format;var r=!1,s=this.a<1&&this.a>=0,i=!n&&s&&(t.startsWith("hex")||t==="name");return i?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=Ue(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=Ue(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=Ue(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=Ue(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),s=new e(t).toRgb(),i=n/100,u={r:(s.r-r.r)*i+r.r,g:(s.g-r.g)*i+r.g,b:(s.b-r.b)*i+r.b,a:(s.a-r.a)*i+r.a};return new e(u)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),s=360/n,i=[this];for(r.h=(r.h-(s*t>>1)+720)%360;--t;)r.h=(r.h+s)%360,i.push(new e(r));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,s=n.s,i=n.v,u=[],a=1/t;t--;)u.push(new e({h:r,s,v:i})),i=(i+a)%1;return u},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),s=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/s,g:(n.g*n.a+r.g*r.a*(1-n.a))/s,b:(n.b*n.a+r.b*r.a*(1-n.a))/s,a:s})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,s=[this],i=360/t,u=1;u<t;u++)s.push(new e({h:(r+u*i)%360,s:n.s,l:n.l}));return s},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function ee(e,t=20){return e.mix("#141414",t).toString()}function bi(e){const t=at(),n=f.useNamespace("button");return o.computed(()=>{let r={},s=e.color;if(s){const i=s.match(/var\((.*?)\)/);i&&(s=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const u=new Er(s),a=e.dark?u.tint(20).toString():ee(u,20);if(e.plain)r=n.cssVarBlock({"bg-color":e.dark?ee(u,90):u.tint(90).toString(),"text-color":s,"border-color":e.dark?ee(u,50):u.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":s,"hover-border-color":s,"active-bg-color":a,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":a}),t.value&&(r[n.cssVarBlockName("disabled-bg-color")]=e.dark?ee(u,90):u.tint(90).toString(),r[n.cssVarBlockName("disabled-text-color")]=e.dark?ee(u,50):u.tint(50).toString(),r[n.cssVarBlockName("disabled-border-color")]=e.dark?ee(u,80):u.tint(80).toString());else{const l=e.dark?ee(u,30):u.tint(30).toString(),c=u.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(r=n.cssVarBlock({"bg-color":s,"text-color":c,"border-color":s,"hover-bg-color":l,"hover-text-color":c,"hover-border-color":l,"active-bg-color":a,"active-border-color":a}),t.value){const d=e.dark?ee(u,50):u.tint(50).toString();r[n.cssVarBlockName("disabled-bg-color")]=d,r[n.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,r[n.cssVarBlockName("disabled-border-color")]=d}}}return r})}const Si=o.defineComponent({name:"ElButton"}),Ei=o.defineComponent({...Si,props:It,emits:oi,setup(e,{expose:t,emit:n}){const r=e,s=bi(r),i=f.useNamespace("button"),{_ref:u,_size:a,_type:l,_disabled:c,_props:d,_plain:v,_round:y,_text:m,shouldAddSpace:h,handleClick:S}=si(r,n),T=o.computed(()=>[i.b(),i.m(l.value),i.m(a.value),i.is("disabled",c.value),i.is("loading",r.loading),i.is("plain",v.value),i.is("round",y.value),i.is("circle",r.circle),i.is("text",m.value),i.is("link",r.link),i.is("has-bg",r.bg)]);return t({ref:u,size:a,type:l,disabled:c,shouldAddSpace:h}),(b,E)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(b.tag),o.mergeProps({ref_key:"_ref",ref:u},o.unref(d),{class:o.unref(T),style:o.unref(s),onClick:o.unref(S)}),{default:o.withCtx(()=>[b.loading?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[b.$slots.loading?o.renderSlot(b.$slots,"loading",{key:0}):(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:1,class:o.normalizeClass(o.unref(i).is("loading"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(b.loadingIcon)))]),_:1},8,["class"]))],64)):b.icon||b.$slots.icon?(o.openBlock(),o.createBlock(o.unref(f.ElIcon),{key:1},{default:o.withCtx(()=>[b.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(b.icon),{key:0})):o.renderSlot(b.$slots,"icon",{key:1})]),_:3})):o.createCommentVNode("v-if",!0),b.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass({[o.unref(i).em("text","expand")]:o.unref(h)})},[o.renderSlot(b.$slots,"default")],2)):o.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var wi=f._export_sfc(Ei,[["__file","button.vue"]]);const Ti={size:It.size,type:It.type},Ci=o.defineComponent({name:"ElButtonGroup"}),Ai=o.defineComponent({...Ci,props:Ti,setup(e){const t=e;o.provide(yr,o.reactive({size:o.toRef(t,"size"),type:o.toRef(t,"type")}));const n=f.useNamespace("button");return(r,s)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(n).b("group"))},[o.renderSlot(r.$slots,"default")],2))}});var wr=f._export_sfc(Ai,[["__file","button-group.vue"]]);const Tr=f.withInstall(wi,{ButtonGroup:wr}),Bi=f.withNoopInstall(wr),xi="utils/vue/vnode";var Ne=(e=>(e[e.TEXT=1]="TEXT",e[e.CLASS=2]="CLASS",e[e.STYLE=4]="STYLE",e[e.PROPS=8]="PROPS",e[e.FULL_PROPS=16]="FULL_PROPS",e[e.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",e[e.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",e[e.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",e[e.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",e[e.NEED_PATCH=512]="NEED_PATCH",e[e.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",e[e.HOISTED=-1]="HOISTED",e[e.BAIL=-2]="BAIL",e))(Ne||{});function Cr(e){return o.isVNode(e)&&e.type===o.Fragment}function Di(e){return o.isVNode(e)&&e.type===o.Comment}function ki(e){return o.isVNode(e)&&!Cr(e)&&!Di(e)}const Ii=e=>{if(!o.isVNode(e))return f.debugWarn(xi,"[getNormalizedProps] must be a VNode"),{};const t=e.props||{},n=(o.isVNode(e.type)?e.type.props:void 0)||{},r={};return Object.keys(n).forEach(s=>{f.hasOwn(n[s],"default")&&(r[s]=n[s].default)}),Object.keys(t).forEach(s=>{r[f.camelize(s)]=t[s]}),r},ke=e=>{const t=f.isArray$1(e)?e:[e],n=[];return t.forEach(r=>{var s;f.isArray$1(r)?n.push(...ke(r)):o.isVNode(r)&&((s=r.component)!=null&&s.subTree)?n.push(r,...ke(r.component.subTree)):o.isVNode(r)&&f.isArray$1(r.children)?n.push(...ke(r.children)):o.isVNode(r)&&r.shapeFlag===2?n.push(...ke(r.type())):n.push(r)}),n},jt=e=>{if(!e)return{onClick:f.NOOP,onMousedown:f.NOOP,onMouseup:f.NOOP};let t=!1,n=!1;return{onClick:u=>{t&&n&&e(u),t=n=!1},onMousedown:u=>{t=u.target===u.currentTarget},onMouseup:u=>{n=u.target===u.currentTarget}}},Ri=f.buildProps({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:f.definePropType([String,Array,Object])},zIndex:{type:f.definePropType([String,Number])}}),Mi={click:e=>e instanceof MouseEvent},Ni="overlay";var Oi=o.defineComponent({name:"ElOverlay",props:Ri,emits:Mi,setup(e,{slots:t,emit:n}){const r=f.useNamespace(Ni),s=l=>{n("click",l)},{onClick:i,onMousedown:u,onMouseup:a}=jt(e.customMaskEvent?void 0:s);return()=>e.mask?o.createVNode("div",{class:[r.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:i,onMousedown:u,onMouseup:a},[o.renderSlot(t,"default")],Ne.STYLE|Ne.CLASS|Ne.PROPS,["onClick","onMouseup","onMousedown"]):o.h("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[o.renderSlot(t,"default")])}});const Ar=Oi,Br=(e,t,n,r)=>{const s={offsetX:0,offsetY:0},i=o.ref(!1),u=(y,m)=>{if(e.value){const{offsetX:h,offsetY:S}=s,T=e.value.getBoundingClientRect(),b=T.left,E=T.top,A=T.width,N=T.height,$=document.documentElement.clientWidth,w=document.documentElement.clientHeight,L=-b+h,I=-E+S,O=$-b-A+h,q=w-E-(N<w?N:0)+S;r!=null&&r.value||(y=Math.min(Math.max(y,L),O),m=Math.min(Math.max(m,I),q)),s.offsetX=y,s.offsetY=m,e.value.style.transform=`translate(${f.addUnit(y)}, ${f.addUnit(m)})`}},a=y=>{const m=y.clientX,h=y.clientY,{offsetX:S,offsetY:T}=s,b=A=>{i.value||(i.value=!0);const N=S+A.clientX-m,$=T+A.clientY-h;u(N,$)},E=()=>{i.value=!1,document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",E)},l=()=>{t.value&&e.value&&(t.value.addEventListener("mousedown",a),window.addEventListener("resize",v))},c=()=>{t.value&&e.value&&(t.value.removeEventListener("mousedown",a),window.removeEventListener("resize",v))},d=()=>{s.offsetX=0,s.offsetY=0,e.value&&(e.value.style.transform="")},v=()=>{const{offsetX:y,offsetY:m}=s;u(y,m)};return o.onMounted(()=>{o.watchEffect(()=>{n.value?l():c()})}),o.onBeforeUnmount(()=>{c()}),{isDragging:i,resetPosition:d,updatePosition:v}},xr=(e,t={})=>{o.isRef(e)||f.throwError("[useLockscreen]","You need to pass a ref param to this function");const n=t.ns||f.useNamespace("popup"),r=o.computed(()=>n.bm("parent","hidden"));let s=0,i=!1,u="0";const a=()=>{setTimeout(()=>{typeof document>"u"||i&&document&&(document.body.style.width=u,f.removeClass(document.body,r.value))},200)};o.watch(e,l=>{if(!l){a();return}i=!f.hasClass(document.body,r.value),i&&(u=document.body.style.width,f.addClass(document.body,r.value)),s=nr(n.namespace.value);const c=document.documentElement.clientHeight<document.body.scrollHeight,d=f.getStyle(document.body,"overflowY");s>0&&(c||d==="scroll")&&i&&(document.body.style.width=`calc(100% - ${s}px)`)}),o.onScopeDispose(()=>a())},Dr=e=>["",...f.componentSizes].includes(e),Mt="_trap-focus-children",le=[],Nn=e=>{if(le.length===0)return;const t=f.getEventCode(e),n=le[le.length-1][Mt];if(n.length>0&&t===f.EVENT_CODE.tab){if(n.length===1){e.preventDefault(),document.activeElement!==n[0]&&n[0].focus();return}const r=e.shiftKey,s=e.target===n[0],i=e.target===n[n.length-1];s&&r&&(e.preventDefault(),n[n.length-1].focus()),i&&!r&&(e.preventDefault(),n[0].focus())}},Vi={beforeMount(e){e[Mt]=Sn(e),le.push(e),le.length<=1&&document.addEventListener("keydown",Nn)},updated(e){o.nextTick(()=>{e[Mt]=Sn(e)})},unmounted(){le.shift(),le.length===0&&document.removeEventListener("keydown",Nn)}},Pi=o.defineComponent({name:"ElMessageBox",directives:{TrapFocus:Vi},components:{ElButton:Tr,ElFocusTrap:gr,ElInput:dr,ElOverlay:Ar,ElIcon:f.ElIcon,...f.TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:Dr},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:Boolean,container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:r,ns:s,size:i}=f.useGlobalComponentSettings("message-box",o.computed(()=>e.buttonSize)),{t:u}=n,{nextZIndex:a}=r,l=o.ref(!1),c=o.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:o.markRaw(f.loading_default),cancelButtonLoadingIcon:o.markRaw(f.loading_default),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=o.computed(()=>{const x=c.type;return{[s.bm("icon",x)]:x&&f.TypeComponentsMap[x]}}),v=tt(),y=tt(),m=o.computed(()=>{const x=c.type;return c.icon||x&&f.TypeComponentsMap[x]||""}),h=o.computed(()=>!!c.message),S=o.ref(),T=o.ref(),b=o.ref(),E=o.ref(),A=o.ref(),N=o.computed(()=>c.confirmButtonClass);o.watch(()=>c.inputValue,async x=>{await o.nextTick(),e.boxType==="prompt"&&x&&Z()},{immediate:!0}),o.watch(()=>l.value,x=>{var H,_;x&&(e.boxType!=="prompt"&&(c.autofocus?b.value=(_=(H=A.value)==null?void 0:H.$el)!=null?_:S.value:b.value=S.value),c.zIndex=a()),e.boxType==="prompt"&&(x?o.nextTick().then(()=>{var X;E.value&&E.value.$el&&(c.autofocus?b.value=(X=vt())!=null?X:S.value:b.value=S.value)}):(c.editorErrorMessage="",c.validateError=!1))});const $=o.computed(()=>e.draggable),w=o.computed(()=>e.overflow),{isDragging:L}=Br(S,T,$,w);o.onMounted(async()=>{await o.nextTick(),e.closeOnHashChange&&window.addEventListener("hashchange",I)}),o.onBeforeUnmount(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",I)});function I(){l.value&&(l.value=!1,o.nextTick(()=>{c.action&&t("action",c.action)}))}const O=()=>{e.closeOnClickModal&&R(c.distinguishCancelAndClose?"close":"cancel")},q=jt(O),V=x=>{if(c.inputType!=="textarea")return x.preventDefault(),R("confirm")},R=x=>{var H;e.boxType==="prompt"&&x==="confirm"&&!Z()||(c.action=x,c.beforeClose?(H=c.beforeClose)==null||H.call(c,x,c,I):I())},Z=()=>{if(e.boxType==="prompt"){const x=c.inputPattern;if(x&&!x.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||u("el.messagebox.error"),c.validateError=!0,!1;const H=c.inputValidator;if(f.isFunction$1(H)){const _=H(c.inputValue);if(_===!1)return c.editorErrorMessage=c.inputErrorMessage||u("el.messagebox.error"),c.validateError=!0,!1;if(f.isString(_))return c.editorErrorMessage=_,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},vt=()=>{var x,H;const _=(x=E.value)==null?void 0:x.$refs;return(H=_==null?void 0:_.input)!=null?H:_==null?void 0:_.textarea},Le=()=>{R("close")},He=()=>{e.closeOnPressEscape&&Le()};return e.lockScroll&&xr(l,{ns:s}),{...o.toRefs(c),ns:s,overlayEvent:q,visible:l,hasMessage:h,typeClass:d,contentId:v,inputId:y,btnSize:i,iconComponent:m,confirmButtonClasses:N,rootRef:S,focusStartRef:b,headerRef:T,inputRef:E,isDragging:L,confirmRef:A,doClose:I,handleClose:Le,onCloseRequested:He,handleWrapperClick:O,handleInputEnter:V,handleAction:R,t:u}}});function Fi(e,t,n,r,s,i){const u=o.resolveComponent("el-icon"),a=o.resolveComponent("el-input"),l=o.resolveComponent("el-button"),c=o.resolveComponent("el-focus-trap"),d=o.resolveComponent("el-overlay");return o.openBlock(),o.createBlock(o.Transition,{name:"fade-in-linear",onAfterLeave:v=>e.$emit("vanish"),persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(d,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:o.withCtx(()=>[o.createElementVNode("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:o.normalizeClass(`${e.ns.namespace.value}-overlay-message-box`),onClick:e.overlayEvent.onClick,onMousedown:e.overlayEvent.onMousedown,onMouseup:e.overlayEvent.onMouseup},[o.createVNode(c,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:o.withCtx(()=>[o.createElementVNode("div",{ref:"rootRef",class:o.normalizeClass([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),e.ns.is("dragging",e.isDragging),{[e.ns.m("center")]:e.center}]),style:o.normalizeStyle(e.customStyle),tabindex:"-1",onClick:o.withModifiers(()=>{},["stop"])},[e.title!==null&&e.title!==void 0?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"headerRef",class:o.normalizeClass([e.ns.e("header"),{"show-close":e.showClose}])},[o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("title"))},[e.iconComponent&&e.center?(o.openBlock(),o.createBlock(u,{key:0,class:o.normalizeClass([e.ns.e("status"),e.typeClass])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.createElementVNode("span",null,o.toDisplayString(e.title),1)],2),e.showClose?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:o.normalizeClass(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:v=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:o.withKeys(o.withModifiers(v=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[o.createVNode(u,{class:o.normalizeClass(e.ns.e("close"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.closeIcon||"close")))]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):o.createCommentVNode("v-if",!0)],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{id:e.contentId,class:o.normalizeClass(e.ns.e("content"))},[o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(o.openBlock(),o.createBlock(u,{key:0,class:o.normalizeClass([e.ns.e("status"),e.typeClass])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),e.hasMessage?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(e.ns.e("message"))},[o.renderSlot(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0,textContent:o.toDisplayString(e.message)},null,8,["for","textContent"]))])],2)):o.createCommentVNode("v-if",!0)],2),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("input"))},[o.createVNode(a,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":v=>e.inputValue=v,type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:o.normalizeClass({invalid:e.validateError}),onKeydown:o.withKeys(e.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("errormsg")),style:o.normalizeStyle({visibility:e.editorErrorMessage?"visible":"hidden"})},o.toDisplayString(e.editorErrorMessage),7)],2),[[o.vShow,e.showInput]])],10,["id"]),o.createElementVNode("div",{class:o.normalizeClass(e.ns.e("btns"))},[e.showCancelButton?(o.openBlock(),o.createBlock(l,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:o.normalizeClass([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:v=>e.handleAction("cancel"),onKeydown:o.withKeys(o.withModifiers(v=>e.handleAction("cancel"),["prevent"]),["enter"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):o.createCommentVNode("v-if",!0),o.withDirectives(o.createVNode(l,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:o.normalizeClass([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:v=>e.handleAction("confirm"),onKeydown:o.withKeys(o.withModifiers(v=>e.handleAction("confirm"),["prevent"]),["enter"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[o.vShow,e.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[o.vShow,e.visible]])]),_:3},8,["onAfterLeave"])}var Li=f._export_sfc(Pi,[["render",Fi],["__file","index.vue"]]);const Ve=new Map,Hi=e=>{let t=document.body;return e.appendTo&&(f.isString(e.appendTo)&&(t=document.querySelector(e.appendTo)),f.isElement(e.appendTo)&&(t=e.appendTo),f.isElement(t)||(f.debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),t=document.body)),t},_i=(e,t,n=null)=>{const r=o.createVNode(Li,e,f.isFunction$1(e.message)||o.isVNode(e.message)?{default:f.isFunction$1(e.message)?e.message:()=>e.message}:null);return r.appContext=n,o.render(r,t),Hi(e).appendChild(t.firstElementChild),r.component},zi=()=>document.createElement("div"),Ki=(e,t)=>{const n=zi();e.onVanish=()=>{o.render(null,n),Ve.delete(s)},e.onAction=i=>{const u=Ve.get(s);let a;e.showInput?a={value:s.inputValue,action:i}:a=i,e.callback?e.callback(a,r.proxy):i==="cancel"||i==="close"?e.distinguishCancelAndClose&&i!=="cancel"?u.reject("close"):u.reject("cancel"):u.resolve(a)};const r=_i(e,n,t),s=r.proxy;for(const i in e)f.hasOwn(e,i)&&!f.hasOwn(s.$props,i)&&(i==="closeIcon"&&f.isObject$1(e[i])?s[i]=o.markRaw(e[i]):s[i]=e[i]);return s.visible=!0,s};function Ae(e,t=null){if(!f.isClient)return Promise.reject();let n;return f.isString(e)||o.isVNode(e)?e={message:e}:n=e.callback,new Promise((r,s)=>{const i=Ki(e,t??Ae._context);Ve.set(i,{options:e,callback:n,resolve:r,reject:s})})}const $i=["alert","confirm","prompt"],Ui={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};$i.forEach(e=>{Ae[e]=qi(e)});function qi(e){return(t,n,r,s)=>{let i="";return f.isObject$1(n)?(r=n,i=""):f.isUndefined(n)?i="":i=n,Ae(Object.assign({title:i,message:t,type:"",...Ui[e]},r,{boxType:e}),s)}}Ae.close=()=>{Ve.forEach((e,t)=>{t.doClose()}),Ve.clear()};Ae._context=null;const ne=Ae;ne.install=e=>{ne._context=e._context,e.config.globalProperties.$msgbox=ne,e.config.globalProperties.$messageBox=ne,e.config.globalProperties.$alert=ne.alert,e.config.globalProperties.$confirm=ne.confirm,e.config.globalProperties.$prompt=ne.prompt};const kr=ne,ji=[],Wt=f.defineStore("menuState",{state:()=>({isRefreshMenus:!1,activeMenuStructureIds:[],cacheInputMenu:{},configMenu:{form:{},options:[],structure:[]},cacheStructures:[],rawMenus:[],menus:[],activeTopMenuPath:"",activeMenuPath:"",activeOldMenuPath:"",activeMainMenu:{},activeAsideMenu:{},activeMenuOpenPaths:[],systemKey:"",buttonTriggerType:"contentConfig",menuTriggerType:"open",permissionSideMenus:[],importLoading:!1,contentLoading:!1,asideMenuLoading:!1,asideMenus:[],platform:"browser",platName:"",childMenu:"",linkMenuInfo:null}),actions:{setLinkMenuInfo(e){this.linkMenuInfo=e},setAsideMenuLoading(e){this.asideMenuLoading=e},setCacheStructures(e){var n,r;const t=(n=this.cacheStructures)==null?void 0:n.map(s=>s.key);e?t!=null&&t.includes(e==null?void 0:e.key)?this.cacheStructures=(r=this.cacheStructures)==null?void 0:r.map(s=>s.key===(e==null?void 0:e.key)?{...s,data:e==null?void 0:e.data}:s):this.cacheStructures.push(e):this.cacheStructures=[]},setChildMenu(e){this.childMenu=e},async setConfigMenu(e){this.configMenu=e},setActiveMainMenu(e){this.activeMainMenu=e},setContentLoading(e){this.contentLoading=e},setActiveAsideMenu(e){this.activeAsideMenu=e},setActiveTopMenuPath(e){this.activeTopMenuPath=e},setCacheInputMenu(e){this.cacheInputMenu=e},setIsRefreshMenus(e){this.isRefreshMenus=e},setButtonTriggerType(e){this.buttonTriggerType=e},setAsideMenus(e){this.asideMenus=e},setMenus(e){this.menus=e},setPlatName(e){this.platName=e},setImportLoading(e){this.importLoading=e},setPlatform(e){this.platform=e},getPlatform(){return this.platform},setMenuTriggerType(e){this.menuTriggerType=e},setSystemKey(e){this.systemKey=e},setActiveMenuPath(e){!e&&e!==null||(this.activeOldMenuPath=f.cloneDeep(this.activeMenuPath),this.activeMenuPath=e)},setActiveMenuOpenPaths(e){this.activeMenuOpenPaths=e},setRawMenus(e){this.rawMenus=e,this.permissionSideMenus=ji}}}),Gt=f.defineStore("modelComp",{state:()=>({lockingPage:"",itemData:[],itemGridData:[],itemExtendData:{},originalData:[],extraContents:[],nodeDev:"",isEdit:"view",isRefreshCurStructure:!1,isSubmitCurStructure:!1,curStructureCompIds:[],systemPath:"",freshContent:!1,routeToChildPath:"",cacheUpdatingData:null,tableViewContents:[],activeItemIndex:-1,tableLoading:!1,pageMapState:{},payloadTypes:"data,structure,structureMethod,gridLayout,extend"}),actions:{setLockingPage(e){this.lockingPage=e},setPageMapState(e){this.pageMapState=e},setItemGridData(e){this.itemGridData=e},setItemExtendData(e){this.itemExtendData=e},setItemData(e){this.itemData=e},setTableLoading(e){this.tableLoading=e},setTableViewContents(e){this.tableViewContents=e},setCacheUpdatingData(e){this.cacheUpdatingData=e},setFreshContent(e){this.freshContent=e},setRouteToChildPath(e){this.routeToChildPath=e},setSubmitCurStructure(e){this.isSubmitCurStructure=e},setCurStructureCompIds(e){this.curStructureCompIds=e},setRefreshCurStructure(e){this.isRefreshCurStructure=e},setOriginalData(e){this.originalData=e},setExtraContents(e){this.extraContents=e},setNodeDev(e){this.nodeDev=e},setIsEdit(e){this.isEdit=e},setSystemPath(e){this.systemPath=e},setActiveItemIndex(e){this.activeItemIndex=e}}}),Yt=f.defineStore("authorityState",{state:()=>({routerPageStructures:[]}),actions:{setRouterPageStructure(e){this.routerPageStructures=e}}}),Wi=Wt(f.pinia),{activeMenuPath:Qe}=f.storeToRefs(Wi),Ir=f.useLoginState(f.pinia),{structureData:Gi,loginUserInfo:Tt}=f.storeToRefs(Ir),Yi=Yt(f.pinia),{routerPageStructures:Zi}=f.storeToRefs(Yi),nt=Gt(f.pinia),Xi=o.ref([{label:"角色名称",value:"",name:"roleName"}]),Ji=o.ref([{label:"查询"},{label:"重置"}]),On=o.reactive({isFilter:!1,filterForm:{}}),Qi=o.ref(!1),eo=e=>{On.isFilter=!0,On.filterForm=e},Rr=o.ref([]),Nt=o.ref([]),Mr=o.ref(""),to=o.computed(()=>{var t,n,r,s,i;const e=(t=Zi.value)==null?void 0:t.find(u=>{var a;return((a=u==null?void 0:u.comp)==null?void 0:a.toUpperCase())==="TABLE"});if(e){Mr.value=e.name,Nt.value=(s=(r=(n=e==null?void 0:e.compData)==null?void 0:n.find(a=>(a==null?void 0:a.key)==="header"))==null?void 0:r.contents)==null?void 0:s.filter(a=>(a==null?void 0:a.label)!=="操作");const u=(i=e==null?void 0:e.compData)==null?void 0:i.map(a=>{var l;if((a==null?void 0:a.key)==="rowButton"){let c=[];return be.value?c=[...a==null?void 0:a.contents,{label:"授权"}]:c=a==null?void 0:a.contents,{...a,contents:c}}return(a==null?void 0:a.key)==="header"?{...a,contents:(l=a==null?void 0:a.contents)==null?void 0:l.map(c=>{var d,v;return{...c,isTableColHidden:(d=c==null?void 0:c.prop)==null?void 0:d.includes("授权"),isFormColHidden:(v=c==null?void 0:c.prop)==null?void 0:v.includes("授权")}})}:a});return Pr(u),u}return[]}),no=e=>{nt.setRefreshCurStructure(!1),nn(e.singleContent,e.buttonName,ft.value,e==null?void 0:e.selectItems)},ye=o.ref({}),Zt=o.ref(),Pe=async(e,t,n)=>{var r,s;try{const i=await e(t);return((r=i==null?void 0:i.data)==null?void 0:r.code)===200?(n!=="查询"&&await Ir.setLogRecordAsync({type:n,data:t},Qe.value),f.ElMessage.success("保存成功"),nt.setRefreshCurStructure(!0),i.data.result||((s=i==null?void 0:i.data)==null?void 0:s.code)===200):null}catch(i){f.ElMessage.error(i)}finally{nt.setCacheUpdatingData(null)}},Nr=(e,t)=>{const n=[];for(const r of e)t!=null&&t.has(r.path)&&n.push(r),r.children&&n.push(...Nr(r.children,t));return n},ro=(e,t)=>{var n,r;try{const s=new Map(e==null?void 0:e.map(a=>[a.path,a.checkedButtons])),i=Nr(t,s),u=(n=i==null?void 0:i.filter(a=>{var l,c;return((l=a==null?void 0:a.checkedButtons)==null?void 0:l.length)===((c=a==null?void 0:a.renderButtons)==null?void 0:c.length)}))==null?void 0:n.map(a=>a==null?void 0:a.path);(r=Zt.value)==null||r.setCheckedKeys(u)}catch{throw new Error("数据显示处理失败")}},so=(e,t)=>{const n=new Map(t==null?void 0:t.map(s=>[s.path,s.checkedButtons]));function r(s){var u,a;const i=(u=s==null?void 0:s.path)!=null&&u.startsWith("/")?(a=s==null?void 0:s.path)==null?void 0:a.substring(1):s==null?void 0:s.path;n.has(i)&&(s.checkedButtons=n.get(i)),s.children&&s.children.length>0&&s.children.forEach(r)}e.forEach(r)},Or=e=>e==null?void 0:e.map(t=>{var r;const n={...t,checkedButtons:[]};return n.children&&((r=n.children)==null?void 0:r.length)>0&&(n.children=Or(n.children)),n}),Xt=e=>{for(const t in e)if(Array.isArray(e[t]))return t;return""},Vr=e=>{const t=[];let n=0;for(;n<e.length;)if(typeof e[n]=="string"){const r={title:e[n]};n+1<e.length&&Array.isArray(e[n+1])?(r.children=Vr(e[n+1]),n+=2):n+=1,t.push(r)}return t},Jt=e=>{const t=[];let n=0;for(;n<(e==null?void 0:e.length);){const r={title:e==null?void 0:e[n]};n+1<(e==null?void 0:e.length)&&Array.isArray(e==null?void 0:e[n+1])?(r.children=Vr(e==null?void 0:e[n+1]),n+=2):n+=1,t.push(r)}return t},ct=(e,t="",n=new Map)=>e==null?void 0:e.map(r=>{const s=t?`${t}/${r.title}`:r.title;if(n.has(s))return n.get(s);const i={...r,path:s};return r.children&&r.children.length>0&&(i.children=ct(r.children,s,n)),n.set(s,i),i}),Qt=(e,t)=>e.reduce((n,r)=>{const s=r[t];return n[s]||(n[s]=[]),n[s].push(r),n},{}),en=e=>{const t=[];function n(r,s){!r.children||r.children.length===0?t.push({...r,parentPath:s||""}):r.children.forEach(i=>n(i,r.path||s))}return e.forEach(r=>n(r,"")),t},tn=e=>Object.entries(e).map(([n,r])=>({path:n,checkedButtons:r==null?void 0:r.map(s=>s==null?void 0:s.path)})),io=e=>Object.prototype.toString.call(e)==="[object Object]"&&e!==null,oo=(e,t)=>{const n={},r=Array.isArray(e)?e==null?void 0:e.filter(s=>{var i;return!(io(s)&&((i=Object.keys(s))!=null&&i.includes("id")))}):null;return r&&(r==null||r.forEach((s,i)=>{var u;n[(u=t[i])==null?void 0:u.prop]=s})),n},me=o.ref(""),Pr=e=>{var i;const t=e==null?void 0:e.find(u=>(u==null?void 0:u.key)==="tableContents"),n=e==null?void 0:e.find(u=>(u==null?void 0:u.key)==="header");if(!t||!n)return"";const r=(i=t==null?void 0:t.contents)==null?void 0:i[0],s=oo(r,n==null?void 0:n.contents);me.value=Xt(s)},ao=e=>{if(!Array.isArray(e))return!1;for(let t of e){if(typeof t!="object"||t===null||typeof t.path!="string"||!Array.isArray(t.checkedButtons))return!1;for(let n of t.checkedButtons)if(typeof n!="string")return!1}return!0},uo=e=>{const t=[];for(const n in e)e[n].forEach(s=>{var l,c;const i=(l=s.path)!=null&&l.startsWith("/")?(c=s.path)==null?void 0:c.substring(1):s.path,u=i==null?void 0:i.split("/");let a=t;u.forEach(d=>{let v=a.find(y=>y.title===d);v||(v={title:d,path:s.path,children:[]},a.push(v)),a=v.children})});return t},lo=e=>{const t={};return e.forEach(n=>{const{path:r,checkedButtons:s}=n,i=r,u=s.map(a=>({title:a.split("/").pop()||"",path:a,parentPath:i}));t[i]=u}),t},Fr=e=>{let t=[];for(const n of e){let r=[n.title];if(n.children&&Array.isArray(n.children)){let s=Fr(n.children);s.length>0&&r.push(s)}t.push(r)}return t},co=e=>{const t=[];for(const n of e){if(!Array.isArray(n)||n.length!==2)continue;const[r,s]=n,i=Lr(s),u=t.indexOf(r);u===-1?t.push(r,i):t[u+1]=Hr(t[u+1],i)}return t},Lr=e=>{const t=[];for(const n of e)if(Array.isArray(n)){if(n.length===1&&typeof n[0]=="string")t.push(n[0]);else if(n.length===2&&typeof n[0]=="string"){const[r,s]=n;t.push(r,Lr(s))}}return t},Hr=(e,t)=>{const n=[...e];let r=0;for(;r<t.length;){const s=t[r];if(typeof s=="string"){const i=n.indexOf(s);i===-1?n.push(s,t[r+1]):n[i+1]=Hr(n[i+1],t[r+1]),r+=2}else n.push(s),r+=1}return n},fo=async(e,t)=>{var n;if(ye.value=f.cloneDeep(t),nt.setRefreshCurStructure(!1),(n=Se.value)==null||n.splice(0),e==="授权"){if(!me.value){f.ElMessage.error("请正确定义角色权限");return}const r=ao(ye.value[me.value]);let s;if(r)s=ye.value[me.value];else{const i=Jt(ye.value[me.value]),u=ct(i),a=en(u),l=Qt(a,"parentPath");s=tn(l)}if(!s||!Array.isArray(s)){f.ElMessage.error("权限数据处理出错了,请联系管理员");return}ce.title=`【${t.角色名称}】授权`,ce.show=!0,await o.nextTick(),so(we.value,s),ro(s,we.value)}},ho=()=>{ce.show=!1},Ot=o.ref(),po=async e=>{const t=await Pe(f.getInsofDataApi,{key:{systemKey:sessionStorage.getItem("systemKey"),type:"data",pageKey:e}},"查询"),n=t==null?void 0:t.map(r=>{var s;return{id:r.id,tableData:(s=r==null?void 0:r.value)==null?void 0:s.tableData}});return n==null?void 0:n.map(r=>{var s;if(Array.isArray(r==null?void 0:r.tableData)){let i={id:r.id};return(s=r==null?void 0:r.tableData)==null||s.forEach((u,a)=>{i[`a${a}`]=u}),i}else return{...r.tableData,id:r.id}})},Fe=(e,t)=>{let n={};if(t==null||t.forEach(r=>{r.label&&e&&(n[r.label]=(e==null?void 0:e[r==null?void 0:r.prop])??null)}),n!=null&&n.id){const{id:r,...s}=n;return s}return n},vo=async(e,t)=>{var i,u;let n=[];Array.isArray(e)?n=f.cloneDeep(e):n=[f.cloneDeep(e)];const r=(i=n==null?void 0:n.filter(a=>typeof(a==null?void 0:a.id)=="string"))==null?void 0:i.map(a=>{var l,c,d,v,y;return{key:{type:"data",systemKey:sessionStorage.getItem("systemKey"),pageKey:(l=Qe.value)!=null&&l.startsWith("/")?(c=Qe.value)==null?void 0:c.substring(1):Qe.value,tableId:t,createUserId:(d=Tt.value)==null?void 0:d.id,createUserOrg:((v=Tt.value)==null?void 0:v.dept)||((y=Tt.value)==null?void 0:y.部门名称)},value:{tableData:Fe(a,Nt.value)}}}),s=(u=n==null?void 0:n.filter(a=>typeof(a==null?void 0:a.id)=="number"))==null?void 0:u.map(a=>({id:a==null?void 0:a.id,value:{tableData:Fe(a,Nt.value)}}));r.length>0&&await Pe(f.batchAddInsofDataApi,{dataList:r},"新增"),s.length>0&&(await Pe(f.batchUpdateInsofDataApi,{dataList:s},"编辑"),ce.show=!1)},nn=async(e,t,n,r)=>{if(!(t!=null&&t.includes("删除")))await vo(e,n);else{let s=[];t!=null&&t.includes("批量")?s=r&&(r==null?void 0:r.length)>0?r==null?void 0:r.map(i=>i==null?void 0:i.id):[]:s=[e==null?void 0:e.id],await Pe(f.batchDeleteInsofDataApi,{ids:s},"编辑")}},_r=e=>{let t=[];return e==null||e.forEach(n=>{var r;if(n.checkedButtons&&((r=n.checkedButtons)==null?void 0:r.length)>0){const s={path:n.path,checkedButtons:n.checkedButtons};t=t.concat(s)}n.children&&(t=t.concat(_r(n.children)))}),t},go=()=>{const e=_r(we.value),t=lo(e),n=uo(t),r=Fr(n),s=co(r);Ot.value={...ye.value,[me.value]:s},o.nextTick(()=>{nn(Ot.value,"编辑",ft.value)})},ce=o.reactive({show:!1,title:"角色授权",width:"30%",draggable:!0}),yo=({isPenultimate:e},t)=>{var n,r;return console.log("isPenultimate",e,t),((r=(n=t==null?void 0:t.data)==null?void 0:n.renderButtons)==null?void 0:r.length)>0?"is-penultimate":""},ft=o.ref(0),zr=async e=>{var r,s,i,u,a;let t;const n=await f.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure",pageKey:e!=null&&e.startsWith("/")?e==null?void 0:e.substring(1):e}});return((r=n==null?void 0:n.data)==null?void 0:r.code)===200&&(s=n==null?void 0:n.data)!=null&&s.result&&((i=n==null?void 0:n.data)==null?void 0:i.result.length)>0&&(t=(a=(u=n==null?void 0:n.data.result)==null?void 0:u[0])==null?void 0:a.id,ft.value=t),t},we=o.ref([]),mo=o.ref([{path:"资源管理",buttons:["查询","新增","编辑","删除"]},{path:"资源管理/人员",buttons:["查询","新增","编辑","删除"]}]),bo=(e,t)=>{var n;e.checkedButtons=t?(n=e.renderButtons)==null?void 0:n.map(r=>r.path):[]},Se=o.ref([]),So=(e,t)=>{var n,r,s;t.checkedButtons=e,((n=t.checkedButtons)==null?void 0:n.length)===((r=t.renderButtons)==null?void 0:r.length)?Se.value.push(t.path):(e==null?void 0:e.length)===0&&(Se.value=(s=Se.value)==null?void 0:s.filter(i=>i!==t.path))};o.watch(()=>Se.value.length,()=>{var e;(e=Zt.value)==null||e.setCheckedKeys([...Se.value])});o.watch(()=>ce.show,e=>{e||(we.value=Or(we.value))});const Kr=o.computed(()=>{var n;const e=(n=f.cloneDeep(Gi.value))==null?void 0:n.filter(r=>{var s,i;return((i=(s=r==null?void 0:r.key)==null?void 0:s.pageKey)==null?void 0:i.toUpperCase())!=="MENU"});return[...e==null?void 0:e.map(r=>{var u,a,l,c,d,v,y,m;const s=/button/i;let i=(l=(a=(u=r==null?void 0:r.value)==null?void 0:u.pageData)==null?void 0:a.compData)==null?void 0:l.filter(h=>s.test(h==null?void 0:h.key));return i=Array.from(new Set(i==null?void 0:i.flatMap(h=>h.contents.map(S=>S.label)))),{path:(d=(c=r==null?void 0:r.key)==null?void 0:c.pageKey)!=null&&d.startsWith("/")?(y=(v=r==null?void 0:r.key)==null?void 0:v.pageKey)==null?void 0:y.substring(1):(m=r==null?void 0:r.key)==null?void 0:m.pageKey,buttons:i}}),...$r.value]}),$r=o.ref([]),Eo=(e,t,n)=>{const s=[e==null?void 0:e.find(i=>(i==null?void 0:i.title)===t)].flatMap(i=>i==null?void 0:i.children);return s==null?void 0:s.map(i=>{var u,a;return{path:(u=i==null?void 0:i.path)!=null&&u.startsWith("/")?(a=i==null?void 0:i.path)==null?void 0:a.substring(1):i==null?void 0:i.path,buttons:n}})},Vn=(e,t)=>{var n;if(e.carryData){if(e.path==="系统管理/个人中心"){const s=["基本信息","上传头像","签名","修改密码"];return s==null?void 0:s.map(i=>{var u,a;return{title:i,path:(u=e==null?void 0:e.path)!=null&&u.startsWith("/")?((a=e==null?void 0:e.path)==null?void 0:a.substring(1))+"/"+i:e.path+"/"+i}})}if(!(t!=null&&t.buttons)||!Array.isArray(t==null?void 0:t.buttons))return[];const r=(n=t==null?void 0:t.buttons)!=null&&n.includes("查看")?t==null?void 0:t.buttons:["查看",...t==null?void 0:t.buttons];return r==null?void 0:r.map(s=>{var i,u;return{title:s,path:(i=e==null?void 0:e.path)!=null&&i.startsWith("/")?((u=e==null?void 0:e.path)==null?void 0:u.substring(1))+"/"+s:e.path+"/"+s}})}return[]},Ur=(e,t)=>{if(Array.isArray(e))return e==null?void 0:e.map(n=>{var i,u;const r=(i=n==null?void 0:n.path)!=null&&i.startsWith("/")?(u=n==null?void 0:n.path)==null?void 0:u.substring(1):n==null?void 0:n.path,s=t==null?void 0:t.find(a=>(a==null?void 0:a.path)===r);return n.children&&n.children.length>0?{...n,renderButtons:Vn(n,s),checkedButtons:[],children:Ur(n.children,Kr.value)}:{...n,renderButtons:Vn(n,s),checkedButtons:[]}})},wo={comp:"Group",name:"/系统管理/角色管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:Rr.value,name:""}]}]},To=Object.freeze(Object.defineProperty({__proto__:null,addButtonsToTree:Ur,addPathToTree:ct,authorizeDialog:ce,buttonValue:Ji,changedRow:Ot,clickRow:ye,clickRowButton:fo,clickSubmitAuthority:go,closeAuthorizeDialog:ho,compName:Mr,convertArrayToTree:Jt,convertIndexToLabel:Fe,customNodeClass:yo,getActivePageStructureId:zr,getAuthorityKey:Pr,getFirstArrayProperty:Xt,getLeafNodesRecursive:en,getPageDataAsync:po,groupByField:Qt,handleAddSysMenusButtons:Eo,handleItemDataChange:no,handleNodeBtnChange:So,handleNodeCheckChange:bo,handleQueryChange:eo,handleRowAuthorityRender:tn,handleSubmitAsync:Pe,isPageDataExist:Qi,menuData:we,menusButtons:mo,pageData:Rr,pageDataFiltered:to,queryFormData:Xi,structureButtons:Kr,structureId:ft,submitTableAsyncByVerify:nn,tempRolePageData:wo,tempSysMenus:$r,treeRef:Zt},Symbol.toStringTag,{value:"Module"}));var Co="0123456789abcdefghijklmnopqrstuvwxyz";function Q(e){return Co.charAt(e)}function Ao(e,t){return e&t}function je(e,t){return e|t}function Pn(e,t){return e^t}function Fn(e,t){return e&~t}function Bo(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}function xo(e){for(var t=0;e!=0;)e&=e-1,++t;return t}var ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qr="=";function rt(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=ge.charAt(n>>6)+ge.charAt(n&63);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=ge.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=ge.charAt(n>>2)+ge.charAt((n&3)<<4));(r.length&3)>0;)r+=qr;return r}function Ln(e){var t="",n,r=0,s=0;for(n=0;n<e.length&&e.charAt(n)!=qr;++n){var i=ge.indexOf(e.charAt(n));i<0||(r==0?(t+=Q(i>>2),s=i&3,r=1):r==1?(t+=Q(s<<2|i>>4),s=i&15,r=2):r==2?(t+=Q(s),t+=Q(i>>2),s=i&3,r=3):(t+=Q(s<<2|i>>4),t+=Q(i&15),r=0))}return r==1&&(t+=Q(s<<2)),t}var de,Do={decode:function(e){var t;if(de===void 0){var n="0123456789ABCDEF",r=` \f
|
|
8
8
|
\r \u2028\u2029`;for(de={},t=0;t<16;++t)de[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)de[n.charAt(t)]=t;for(t=0;t<r.length;++t)de[r.charAt(t)]=-1}var s=[],i=0,u=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if(a=="=")break;if(a=de[a],a!=-1){if(a===void 0)throw new Error("Illegal character at offset "+t);i|=a,++u>=2?(s[s.length]=i,i=0,u=0):i<<=4}}if(u)throw new Error("Hex encoding incomplete: 4 bits missing");return s}},ae,Vt={decode:function(e){var t;if(ae===void 0){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=`= \f
|
|
9
9
|
\r \u2028\u2029`;for(ae=Object.create(null),t=0;t<64;++t)ae[n.charAt(t)]=t;for(ae["-"]=62,ae._=63,t=0;t<r.length;++t)ae[r.charAt(t)]=-1}var s=[],i=0,u=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if(a=="=")break;if(a=ae[a],a!=-1){if(a===void 0)throw new Error("Illegal character at offset "+t);i|=a,++u>=4?(s[s.length]=i>>16,s[s.length]=i>>8&255,s[s.length]=i&255,i=0,u=0):i<<=6}}switch(u){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:s[s.length]=i>>10;break;case 3:s[s.length]=i>>16,s[s.length]=i>>8&255;break}return s},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=Vt.re.exec(e);if(t)if(t[1])e=t[1];else if(t[2])e=t[2];else throw new Error("RegExp out of sync");return Vt.decode(e)}},pe=1e13,Ie=function(){function e(t){this.buf=[+t||0]}return e.prototype.mulAdd=function(t,n){var r=this.buf,s=r.length,i,u;for(i=0;i<s;++i)u=r[i]*t+n,u<pe?n=0:(n=0|u/pe,u-=n*pe),r[i]=u;n>0&&(r[i]=n)},e.prototype.sub=function(t){var n=this.buf,r=n.length,s,i;for(s=0;s<r;++s)i=n[s]-t,i<0?(i+=pe,t=1):t=0,n[s]=i;for(;n[n.length-1]===0;)n.pop()},e.prototype.toString=function(t){if((t||10)!=10)throw new Error("only base 10 is supported");for(var n=this.buf,r=n[n.length-1].toString(),s=n.length-2;s>=0;--s)r+=(pe+n[s]).toString().substring(1);return r},e.prototype.valueOf=function(){for(var t=this.buf,n=0,r=t.length-1;r>=0;--r)n=n*pe+t[r];return n},e.prototype.simplify=function(){var t=this.buf;return t.length==1?t[0]:this},e}(),jr="…",ko=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,Io=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function Ee(e,t){return e.length>t&&(e=e.substring(0,t)+jr),e}var Ct=function(){function e(t,n){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=n)}return e.prototype.get=function(t){if(t===void 0&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset ".concat(t," on a stream of length ").concat(this.enc.length));return typeof this.enc=="string"?this.enc.charCodeAt(t):this.enc[t]},e.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(t&15)},e.prototype.hexDump=function(t,n,r){for(var s="",i=t;i<n;++i)if(s+=this.hexByte(this.get(i)),r!==!0)switch(i&15){case 7:s+=" ";break;case 15:s+=`
|
|
10
10
|
`;break;default:s+=" "}return s},e.prototype.isASCII=function(t,n){for(var r=t;r<n;++r){var s=this.get(r);if(s<32||s>176)return!1}return!0},e.prototype.parseStringISO=function(t,n){for(var r="",s=t;s<n;++s)r+=String.fromCharCode(this.get(s));return r},e.prototype.parseStringUTF=function(t,n){for(var r="",s=t;s<n;){var i=this.get(s++);i<128?r+=String.fromCharCode(i):i>191&&i<224?r+=String.fromCharCode((i&31)<<6|this.get(s++)&63):r+=String.fromCharCode((i&15)<<12|(this.get(s++)&63)<<6|this.get(s++)&63)}return r},e.prototype.parseStringBMP=function(t,n){for(var r="",s,i,u=t;u<n;)s=this.get(u++),i=this.get(u++),r+=String.fromCharCode(s<<8|i);return r},e.prototype.parseTime=function(t,n,r){var s=this.parseStringISO(t,n),i=(r?ko:Io).exec(s);return i?(r&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),s=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(s+=":"+i[5],i[6]&&(s+=":"+i[6],i[7]&&(s+="."+i[7]))),i[8]&&(s+=" UTC",i[8]!="Z"&&(s+=i[8],i[9]&&(s+=":"+i[9]))),s):"Unrecognized time: "+s},e.prototype.parseInteger=function(t,n){for(var r=this.get(t),s=r>127,i=s?255:0,u,a="";r==i&&++t<n;)r=this.get(t);if(u=n-t,u===0)return s?-1:0;if(u>4){for(a=r,u<<=3;((+a^i)&128)==0;)a=+a<<1,--u;a="("+u+` bit)
|
|
11
11
|
`}s&&(r=r-256);for(var l=new Ie(r),c=t+1;c<n;++c)l.mulAdd(256,this.get(c));return a+l.toString()},e.prototype.parseBitString=function(t,n,r){for(var s=this.get(t),i=(n-t-1<<3)-s,u="("+i+` bit)
|
|
12
12
|
`,a="",l=t+1;l<n;++l){for(var c=this.get(l),d=l==n-1?s:0,v=7;v>=d;--v)a+=c>>v&1?"1":"0";if(a.length>r)return u+Ee(a,r)}return u+a},e.prototype.parseOctetString=function(t,n,r){if(this.isASCII(t,n))return Ee(this.parseStringISO(t,n),r);var s=n-t,i="("+s+` byte)
|
|
13
13
|
`;r/=2,s>r&&(n=t+r);for(var u=t;u<n;++u)i+=this.hexByte(this.get(u));return s>r&&(i+=jr),i},e.prototype.parseOID=function(t,n,r){for(var s="",i=new Ie,u=0,a=t;a<n;++a){var l=this.get(a);if(i.mulAdd(128,l&127),u+=7,!(l&128)){if(s==="")if(i=i.simplify(),i instanceof Ie)i.sub(80),s="2."+i.toString();else{var c=i<80?i<40?0:1:2;s=c+"."+(i-c*40)}else s+="."+i.toString();if(s.length>r)return Ee(s,r);i=new Ie,u=0}}return u>0&&(s+=".incomplete"),s},e}(),Ro=function(){function e(t,n,r,s,i){if(!(s instanceof Hn))throw new Error("Invalid tag value.");this.stream=t,this.header=n,this.length=r,this.tag=s,this.sub=i}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(t){if(this.tag===void 0)return null;t===void 0&&(t=1/0);var n=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return this.sub!==null?"("+this.sub.length+" elem)":this.stream.parseOctetString(n,n+r,t);switch(this.tag.tagNumber){case 1:return this.stream.get(n)===0?"false":"true";case 2:return this.stream.parseInteger(n,n+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(n,n+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(n,n+r,t);case 6:return this.stream.parseOID(n,n+r,t);case 16:case 17:return this.sub!==null?"("+this.sub.length+" elem)":"(no elem)";case 12:return Ee(this.stream.parseStringUTF(n,n+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return Ee(this.stream.parseStringISO(n,n+r),t);case 30:return Ee(this.stream.parseStringBMP(n,n+r),t);case 23:case 24:return this.stream.parseTime(n,n+r,this.tag.tagNumber==23)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(this.sub===null?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(t){t===void 0&&(t="");var n=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(n+="+"),n+=this.length,this.tag.tagConstructed?n+=" (constructed)":this.tag.isUniversal()&&(this.tag.tagNumber==3||this.tag.tagNumber==4)&&this.sub!==null&&(n+=" (encapsulates)"),n+=`
|
|
14
|
-
`,this.sub!==null){t+=" ";for(var r=0,s=this.sub.length;r<s;++r)n+=this.sub[r].toPrettyString(t)}return n},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(t){var n=t.get(),r=n&127;if(r==n)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(r===0)return null;n=0;for(var s=0;s<r;++s)n=n*256+t.get();return n},e.prototype.getHexStringValue=function(){var t=this.toHexString(),n=this.header*2,r=this.length*2;return t.substr(n,r)},e.decode=function(t){var n;t instanceof Ct?n=t:n=new Ct(t,0);var r=new Ct(n),s=new Hn(n),i=e.decodeLength(n),u=n.pos,a=u-r.pos,l=null,c=function(){var v=[];if(i!==null){for(var y=u+i;n.pos<y;)v[v.length]=e.decode(n);if(n.pos!=y)throw new Error("Content size is not correct for container starting at offset "+u)}else try{for(;;){var m=e.decode(n);if(m.tag.isEOC())break;v[v.length]=m}i=u-n.pos}catch(h){throw new Error("Exception while decoding undefined length content: "+h)}return v};if(s.tagConstructed)l=c();else if(s.isUniversal()&&(s.tagNumber==3||s.tagNumber==4))try{if(s.tagNumber==3&&n.get()!=0)throw new Error("BIT STRINGs with unused bits cannot encapsulate.");l=c();for(var d=0;d<l.length;++d)if(l[d].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch{l=null}if(l===null){if(i===null)throw new Error("We can't skip over an invalid tag with undefined length at offset "+u);n.pos=u+Math.abs(i)}return new e(r,a,i,s,l)},e}(),Hn=function(){function e(t){var n=t.get();if(this.tagClass=n>>6,this.tagConstructed=(n&32)!==0,this.tagNumber=n&31,this.tagNumber==31){var r=new Ie;do n=t.get(),r.mulAdd(128,n&127);while(n&128);this.tagNumber=r.simplify()}}return e.prototype.isUniversal=function(){return this.tagClass===0},e.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},e}(),oe,Mo=0xdeadbeefcafe,_n=(Mo&16777215)==15715070,z=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],No=(1<<26)/z[z.length-1],C=function(){function e(t,n,r){t!=null&&(typeof t=="number"?this.fromNumber(t,n,r):n==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,n))}return e.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var n;if(t==16)n=4;else if(t==8)n=3;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else return this.toRadix(t);var r=(1<<n)-1,s,i=!1,u="",a=this.t,l=this.DB-a*this.DB%n;if(a-- >0)for(l<this.DB&&(s=this[a]>>l)>0&&(i=!0,u=Q(s));a>=0;)l<n?(s=(this[a]&(1<<l)-1)<<n-l,s|=this[--a]>>(l+=this.DB-n)):(s=this[a]>>(l-=n)&r,l<=0&&(l+=this.DB,--a)),s>0&&(i=!0),i&&(u+=Q(s));return i?u:"0"},e.prototype.negate=function(){var t=A();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(t){var n=this.s-t.s;if(n!=0)return n;var r=this.t;if(n=r-t.t,n!=0)return this.s<0?-n:n;for(;--r>=0;)if((n=this[r]-t[r])!=0)return n;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+We(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=A();return this.abs().divRemTo(t,null,n),this.s<0&&n.compareTo(e.ZERO)>0&&t.subTo(n,n),n},e.prototype.modPowInt=function(t,n){var r;return t<256||n.isEven()?r=new zn(n):r=new Kn(n),this.exp(t,r)},e.prototype.clone=function(){var t=A();return this.copyTo(t),t},e.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var t=this.t,n=[];n[0]=this.s;var r=this.DB-t*this.DB%8,s,i=0;if(t-- >0)for(r<this.DB&&(s=this[t]>>r)!=(this.s&this.DM)>>r&&(n[i++]=s|this.s<<this.DB-r);t>=0;)r<8?(s=(this[t]&(1<<r)-1)<<8-r,s|=this[--t]>>(r+=this.DB-8)):(s=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(s&128)!=0&&(s|=-256),i==0&&(this.s&128)!=(s&128)&&++i,(i>0||s!=this.s)&&(n[i++]=s);return n},e.prototype.equals=function(t){return this.compareTo(t)==0},e.prototype.min=function(t){return this.compareTo(t)<0?this:t},e.prototype.max=function(t){return this.compareTo(t)>0?this:t},e.prototype.and=function(t){var n=A();return this.bitwiseTo(t,Do,n),n},e.prototype.or=function(t){var n=A();return this.bitwiseTo(t,je,n),n},e.prototype.xor=function(t){var n=A();return this.bitwiseTo(t,Pn,n),n},e.prototype.andNot=function(t){var n=A();return this.bitwiseTo(t,Fn,n),n},e.prototype.not=function(){for(var t=A(),n=0;n<this.t;++n)t[n]=this.DM&~this[n];return t.t=this.t,t.s=~this.s,t},e.prototype.shiftLeft=function(t){var n=A();return t<0?this.rShiftTo(-t,n):this.lShiftTo(t,n),n},e.prototype.shiftRight=function(t){var n=A();return t<0?this.lShiftTo(-t,n):this.rShiftTo(t,n),n},e.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+Ao(this[t]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var t=0,n=this.s&this.DM,r=0;r<this.t;++r)t+=Bo(this[r]^n);return t},e.prototype.testBit=function(t){var n=Math.floor(t/this.DB);return n>=this.t?this.s!=0:(this[n]&1<<t%this.DB)!=0},e.prototype.setBit=function(t){return this.changeBit(t,je)},e.prototype.clearBit=function(t){return this.changeBit(t,Fn)},e.prototype.flipBit=function(t){return this.changeBit(t,Pn)},e.prototype.add=function(t){var n=A();return this.addTo(t,n),n},e.prototype.subtract=function(t){var n=A();return this.subTo(t,n),n},e.prototype.multiply=function(t){var n=A();return this.multiplyTo(t,n),n},e.prototype.divide=function(t){var n=A();return this.divRemTo(t,n,null),n},e.prototype.remainder=function(t){var n=A();return this.divRemTo(t,null,n),n},e.prototype.divideAndRemainder=function(t){var n=A(),r=A();return this.divRemTo(t,n,r),[n,r]},e.prototype.modPow=function(t,n){var r=t.bitLength(),s,i=re(1),u;if(r<=0)return i;r<18?s=1:r<48?s=3:r<144?s=4:r<768?s=5:s=6,r<8?u=new zn(n):n.isEven()?u=new Vo(n):u=new Kn(n);var a=[],l=3,c=s-1,d=(1<<s)-1;if(a[1]=u.convert(this),s>1){var v=A();for(u.sqrTo(a[1],v);l<=d;)a[l]=A(),u.mulTo(v,a[l-2],a[l]),l+=2}var y=t.t-1,m,h=!0,S=A(),T;for(r=We(t[y])-1;y>=0;){for(r>=c?m=t[y]>>r-c&d:(m=(t[y]&(1<<r+1)-1)<<c-r,y>0&&(m|=t[y-1]>>this.DB+r-c)),l=s;(m&1)==0;)m>>=1,--l;if((r-=l)<0&&(r+=this.DB,--y),h)a[m].copyTo(i),h=!1;else{for(;l>1;)u.sqrTo(i,S),u.sqrTo(S,i),l-=2;l>0?u.sqrTo(i,S):(T=i,i=S,S=T),u.mulTo(S,a[m],i)}for(;y>=0&&(t[y]&1<<r)==0;)u.sqrTo(i,S),T=i,i=S,S=T,--r<0&&(r=this.DB-1,--y)}return u.revert(i)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||t.signum()==0)return e.ZERO;for(var r=t.clone(),s=this.clone(),i=re(1),u=re(0),a=re(0),l=re(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),n?((!i.isEven()||!u.isEven())&&(i.addTo(this,i),u.subTo(t,u)),i.rShiftTo(1,i)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);for(;s.isEven();)s.rShiftTo(1,s),n?((!a.isEven()||!l.isEven())&&(a.addTo(this,a),l.subTo(t,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(s)>=0?(r.subTo(s,r),n&&i.subTo(a,i),u.subTo(l,u)):(s.subTo(r,s),n&&a.subTo(i,a),l.subTo(u,l))}if(s.compareTo(e.ONE)!=0)return e.ZERO;if(l.compareTo(t)>=0)return l.subtract(t);if(l.signum()<0)l.addTo(t,l);else return l;return l.signum()<0?l.add(t):l},e.prototype.pow=function(t){return this.exp(t,new Oo)},e.prototype.gcd=function(t){var n=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(n.compareTo(r)<0){var s=n;n=r,r=s}var i=n.getLowestSetBit(),u=r.getLowestSetBit();if(u<0)return n;for(i<u&&(u=i),u>0&&(n.rShiftTo(u,n),r.rShiftTo(u,r));n.signum()>0;)(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r));return u>0&&r.lShiftTo(u,r),r},e.prototype.isProbablePrime=function(t){var n,r=this.abs();if(r.t==1&&r[0]<=z[z.length-1]){for(n=0;n<z.length;++n)if(r[0]==z[n])return!0;return!1}if(r.isEven())return!1;for(n=1;n<z.length;){for(var s=z[n],i=n+1;i<z.length&&s<No;)s*=z[i++];for(s=r.modInt(s);n<i;)if(s%z[n++]==0)return!1}return r.millerRabin(t)},e.prototype.copyTo=function(t){for(var n=this.t-1;n>=0;--n)t[n]=this[n];t.t=this.t,t.s=this.s},e.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(n==16)r=4;else if(n==8)r=3;else if(n==256)r=8;else if(n==2)r=1;else if(n==32)r=5;else if(n==4)r=2;else{this.fromRadix(t,n);return}this.t=0,this.s=0;for(var s=t.length,i=!1,u=0;--s>=0;){var a=r==8?+t[s]&255:Un(t,s);if(a<0){t.charAt(s)=="-"&&(i=!0);continue}i=!1,u==0?this[this.t++]=a:u+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-u)-1)<<u,this[this.t++]=a>>this.DB-u):this[this.t-1]|=a<<u,u+=r,u>=this.DB&&(u-=this.DB)}r==8&&(+t[0]&128)!=0&&(this.s=-1,u>0&&(this[this.t-1]|=(1<<this.DB-u)-1<<u)),this.clamp(),i&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},e.prototype.dlShiftTo=function(t,n){var r;for(r=this.t-1;r>=0;--r)n[r+t]=this[r];for(r=t-1;r>=0;--r)n[r]=0;n.t=this.t+t,n.s=this.s},e.prototype.drShiftTo=function(t,n){for(var r=t;r<this.t;++r)n[r-t]=this[r];n.t=Math.max(this.t-t,0),n.s=this.s},e.prototype.lShiftTo=function(t,n){for(var r=t%this.DB,s=this.DB-r,i=(1<<s)-1,u=Math.floor(t/this.DB),a=this.s<<r&this.DM,l=this.t-1;l>=0;--l)n[l+u+1]=this[l]>>s|a,a=(this[l]&i)<<r;for(var l=u-1;l>=0;--l)n[l]=0;n[u]=a,n.t=this.t+u+1,n.s=this.s,n.clamp()},e.prototype.rShiftTo=function(t,n){n.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){n.t=0;return}var s=t%this.DB,i=this.DB-s,u=(1<<s)-1;n[0]=this[r]>>s;for(var a=r+1;a<this.t;++a)n[a-r-1]|=(this[a]&u)<<i,n[a-r]=this[a]>>s;s>0&&(n[this.t-r-1]|=(this.s&u)<<i),n.t=this.t-r,n.clamp()},e.prototype.subTo=function(t,n){for(var r=0,s=0,i=Math.min(t.t,this.t);r<i;)s+=this[r]-t[r],n[r++]=s&this.DM,s>>=this.DB;if(t.t<this.t){for(s-=t.s;r<this.t;)s+=this[r],n[r++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;r<t.t;)s-=t[r],n[r++]=s&this.DM,s>>=this.DB;s-=t.s}n.s=s<0?-1:0,s<-1?n[r++]=this.DV+s:s>0&&(n[r++]=s),n.t=r,n.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),s=t.abs(),i=r.t;for(n.t=i+s.t;--i>=0;)n[i]=0;for(i=0;i<s.t;++i)n[i+r.t]=r.am(0,s[i],n,i,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(t){for(var n=this.abs(),r=t.t=2*n.t;--r>=0;)t[r]=0;for(r=0;r<n.t-1;++r){var s=n.am(r,n[r],t,2*r,0,1);(t[r+n.t]+=n.am(r+1,2*n[r],t,2*r+1,s,n.t-r-1))>=n.DV&&(t[r+n.t]-=n.DV,t[r+n.t+1]=1)}t.t>0&&(t[t.t-1]+=n.am(r,n[r],t,2*r,0,1)),t.s=0,t.clamp()},e.prototype.divRemTo=function(t,n,r){var s=t.abs();if(!(s.t<=0)){var i=this.abs();if(i.t<s.t){n!=null&&n.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=A());var u=A(),a=this.s,l=t.s,c=this.DB-We(s[s.t-1]);c>0?(s.lShiftTo(c,u),i.lShiftTo(c,r)):(s.copyTo(u),i.copyTo(r));var d=u.t,v=u[d-1];if(v!=0){var y=v*(1<<this.F1)+(d>1?u[d-2]>>this.F2:0),m=this.FV/y,h=(1<<this.F1)/y,S=1<<this.F2,T=r.t,b=T-d,E=n??A();for(u.dlShiftTo(b,E),r.compareTo(E)>=0&&(r[r.t++]=1,r.subTo(E,r)),e.ONE.dlShiftTo(d,E),E.subTo(u,u);u.t<d;)u[u.t++]=0;for(;--b>=0;){var D=r[--T]==v?this.DM:Math.floor(r[T]*m+(r[T-1]+S)*h);if((r[T]+=u.am(0,D,r,b,0,d))<D)for(u.dlShiftTo(b,E),r.subTo(E,r);r[T]<--D;)r.subTo(E,r)}n!=null&&(r.drShiftTo(d,n),a!=l&&e.ZERO.subTo(n,n)),r.t=d,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var n=t&3;return n=n*(2-(t&15)*n)&15,n=n*(2-(t&255)*n)&255,n=n*(2-((t&65535)*n&65535))&65535,n=n*(2-t*n%this.DV)%this.DV,n>0?this.DV-n:-n},e.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=A(),s=A(),i=n.convert(this),u=We(t)-1;for(i.copyTo(r);--u>=0;)if(n.sqrTo(r,s),(t&1<<u)>0)n.mulTo(s,i,r);else{var a=r;r=s,s=a}return n.revert(r)},e.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},e.prototype.toRadix=function(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var n=this.chunkSize(t),r=Math.pow(t,n),s=re(r),i=A(),u=A(),a="";for(this.divRemTo(s,i,u);i.signum()>0;)a=(r+u.intValue()).toString(t).substr(1)+a,i.divRemTo(s,i,u);return u.intValue().toString(t)+a},e.prototype.fromRadix=function(t,n){this.fromInt(0),n==null&&(n=10);for(var r=this.chunkSize(n),s=Math.pow(n,r),i=!1,u=0,a=0,l=0;l<t.length;++l){var c=Un(t,l);if(c<0){t.charAt(l)=="-"&&this.signum()==0&&(i=!0);continue}a=n*a+c,++u>=r&&(this.dMultiply(s),this.dAddOffset(a,0),u=0,a=0)}u>0&&(this.dMultiply(Math.pow(n,u)),this.dAddOffset(a,0)),i&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,r){if(typeof n=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),je,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var s=[],i=t&7;s.length=(t>>3)+1,n.nextBytes(s),i>0?s[0]&=(1<<i)-1:s[0]=0,this.fromString(s,256)}},e.prototype.bitwiseTo=function(t,n,r){var s,i,u=Math.min(t.t,this.t);for(s=0;s<u;++s)r[s]=n(this[s],t[s]);if(t.t<this.t){for(i=t.s&this.DM,s=u;s<this.t;++s)r[s]=n(this[s],i);r.t=this.t}else{for(i=this.s&this.DM,s=u;s<t.t;++s)r[s]=n(i,t[s]);r.t=t.t}r.s=n(this.s,t.s),r.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(t,n){for(var r=0,s=0,i=Math.min(t.t,this.t);r<i;)s+=this[r]+t[r],n[r++]=s&this.DM,s>>=this.DB;if(t.t<this.t){for(s+=t.s;r<this.t;)s+=this[r],n[r++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;r<t.t;)s+=t[r],n[r++]=s&this.DM,s>>=this.DB;s+=t.s}n.s=s<0?-1:0,s>0?n[r++]=s:s<-1&&(n[r++]=this.DV+s),n.t=r,n.clamp()},e.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(t,n){if(t!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=t;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},e.prototype.multiplyLowerTo=function(t,n,r){var s=Math.min(this.t+t.t,n);for(r.s=0,r.t=s;s>0;)r[--s]=0;for(var i=r.t-this.t;s<i;++s)r[s+this.t]=this.am(0,t[s],r,s,0,this.t);for(var i=Math.min(t.t,n);s<i;++s)this.am(0,t[s],r,s,0,n-s);r.clamp()},e.prototype.multiplyUpperTo=function(t,n,r){--n;var s=r.t=this.t+t.t-n;for(r.s=0;--s>=0;)r[s]=0;for(s=Math.max(n-this.t,0);s<t.t;++s)r[this.t+s-n]=this.am(n-s,t[s],r,0,0,this.t+s-n);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(t){if(t<=0)return 0;var n=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(n==0)r=this[0]%t;else for(var s=this.t-1;s>=0;--s)r=(n*r+this[s])%t;return r},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var s=n.shiftRight(r);t=t+1>>1,t>z.length&&(t=z.length);for(var i=A(),u=0;u<t;++u){i.fromInt(z[Math.floor(Math.random()*z.length)]);var a=i.modPow(s,this);if(a.compareTo(e.ONE)!=0&&a.compareTo(n)!=0){for(var l=1;l++<r&&a.compareTo(n)!=0;)if(a=a.modPowInt(2,this),a.compareTo(e.ONE)==0)return!1;if(a.compareTo(n)!=0)return!1}}return!0},e.prototype.square=function(){var t=A();return this.squareTo(t),t},e.prototype.gcda=function(t,n){var r=this.s<0?this.negate():this.clone(),s=t.s<0?t.negate():t.clone();if(r.compareTo(s)<0){var i=r;r=s,s=i}var u=r.getLowestSetBit(),a=s.getLowestSetBit();if(a<0){n(r);return}u<a&&(a=u),a>0&&(r.rShiftTo(a,r),s.rShiftTo(a,s));var l=function(){(u=r.getLowestSetBit())>0&&r.rShiftTo(u,r),(u=s.getLowestSetBit())>0&&s.rShiftTo(u,s),r.compareTo(s)>=0?(r.subTo(s,r),r.rShiftTo(1,r)):(s.subTo(r,s),s.rShiftTo(1,s)),r.signum()>0?setTimeout(l,0):(a>0&&s.lShiftTo(a,s),setTimeout(function(){n(s)},0))};setTimeout(l,10)},e.prototype.fromNumberAsync=function(t,n,r,s){if(typeof n=="number")if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),je,this),this.isEven()&&this.dAddOffset(1,0);var i=this,u=function(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(e.ONE.shiftLeft(t-1),i),i.isProbablePrime(n)?setTimeout(function(){s()},0):setTimeout(u,0)};setTimeout(u,0)}else{var a=[],l=t&7;a.length=(t>>3)+1,n.nextBytes(a),l>0?a[0]&=(1<<l)-1:a[0]=0,this.fromString(a,256)}},e}(),Oo=function(){function e(){}return e.prototype.convert=function(t){return t},e.prototype.revert=function(t){return t},e.prototype.mulTo=function(t,n,r){t.multiplyTo(n,r)},e.prototype.sqrTo=function(t,n){t.squareTo(n)},e}(),zn=function(){function e(t){this.m=t}return e.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},e.prototype.revert=function(t){return t},e.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},e.prototype.mulTo=function(t,n,r){t.multiplyTo(n,r),this.reduce(r)},e.prototype.sqrTo=function(t,n){t.squareTo(n),this.reduce(n)},e}(),Kn=function(){function e(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return e.prototype.convert=function(t){var n=A();return t.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),t.s<0&&n.compareTo(C.ZERO)>0&&this.m.subTo(n,n),n},e.prototype.revert=function(t){var n=A();return t.copyTo(n),this.reduce(n),n},e.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var n=0;n<this.m.t;++n){var r=t[n]&32767,s=r*this.mpl+((r*this.mph+(t[n]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=n+this.m.t,t[r]+=this.m.am(0,s,t,n,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},e.prototype.mulTo=function(t,n,r){t.multiplyTo(n,r),this.reduce(r)},e.prototype.sqrTo=function(t,n){t.squareTo(n),this.reduce(n)},e}(),Vo=function(){function e(t){this.m=t,this.r2=A(),this.q3=A(),C.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return e.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var n=A();return t.copyTo(n),this.reduce(n),n},e.prototype.revert=function(t){return t},e.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},e.prototype.mulTo=function(t,n,r){t.multiplyTo(n,r),this.reduce(r)},e.prototype.sqrTo=function(t,n){t.squareTo(n),this.reduce(n)},e}();function A(){return new C(null)}function k(e,t){return new C(e,t)}var $n=typeof navigator<"u";$n&&_n&&navigator.appName=="Microsoft Internet Explorer"?(C.prototype.am=function(t,n,r,s,i,u){for(var a=n&32767,l=n>>15;--u>=0;){var c=this[t]&32767,d=this[t++]>>15,v=l*c+d*a;c=a*c+((v&32767)<<15)+r[s]+(i&1073741823),i=(c>>>30)+(v>>>15)+l*d+(i>>>30),r[s++]=c&1073741823}return i},oe=30):$n&&_n&&navigator.appName!="Netscape"?(C.prototype.am=function(t,n,r,s,i,u){for(;--u>=0;){var a=n*this[t++]+r[s]+i;i=Math.floor(a/67108864),r[s++]=a&67108863}return i},oe=26):(C.prototype.am=function(t,n,r,s,i,u){for(var a=n&16383,l=n>>14;--u>=0;){var c=this[t]&16383,d=this[t++]>>14,v=l*c+d*a;c=a*c+((v&16383)<<14)+r[s]+i,i=(c>>28)+(v>>14)+l*d,r[s++]=c&268435455}return i},oe=28);C.prototype.DB=oe;C.prototype.DM=(1<<oe)-1;C.prototype.DV=1<<oe;var rn=52;C.prototype.FV=Math.pow(2,rn);C.prototype.F1=rn-oe;C.prototype.F2=2*oe-rn;var ht=[],Ae,W;Ae=48;for(W=0;W<=9;++W)ht[Ae++]=W;Ae=97;for(W=10;W<36;++W)ht[Ae++]=W;Ae=65;for(W=10;W<36;++W)ht[Ae++]=W;function Un(e,t){var n=ht[e.charCodeAt(t)];return n??-1}function re(e){var t=A();return t.fromInt(e),t}function We(e){var t=1,n;return(n=e>>>16)!=0&&(e=n,t+=16),(n=e>>8)!=0&&(e=n,t+=8),(n=e>>4)!=0&&(e=n,t+=4),(n=e>>2)!=0&&(e=n,t+=2),(n=e>>1)!=0&&(e=n,t+=1),t}C.ZERO=re(0);C.ONE=re(1);var Po=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(t){var n,r,s;for(n=0;n<256;++n)this.S[n]=n;for(r=0,n=0;n<256;++n)r=r+this.S[n]+t[n%t.length]&255,s=this.S[n],this.S[n]=this.S[r],this.S[r]=s;this.i=0,this.j=0},e.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},e}();function Fo(){return new Po}var Wr=256,Ge,ie=null,Y;if(ie==null){ie=[],Y=0;var Ye=void 0;if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){var Dt=new Uint32Array(256);for(window.crypto.getRandomValues(Dt),Ye=0;Ye<Dt.length;++Ye)ie[Y++]=Dt[Ye]&255}var Ze=0,Xe=function(e){if(Ze=Ze||0,Ze>=256||Y>=Wr){window.removeEventListener?window.removeEventListener("mousemove",Xe,!1):window.detachEvent&&window.detachEvent("onmousemove",Xe);return}try{var t=e.x+e.y;ie[Y++]=t&255,Ze+=1}catch{}};typeof window<"u"&&(window.addEventListener?window.addEventListener("mousemove",Xe,!1):window.attachEvent&&window.attachEvent("onmousemove",Xe))}function Lo(){if(Ge==null){for(Ge=Fo();Y<Wr;){var e=Math.floor(65536*Math.random());ie[Y++]=e&255}for(Ge.init(ie),Y=0;Y<ie.length;++Y)ie[Y]=0;Y=0}return Ge.next()}var Pt=function(){function e(){}return e.prototype.nextBytes=function(t){for(var n=0;n<t.length;++n)t[n]=Lo()},e}();function Ho(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",s=0;s<n;s+=2)r+="ff";var i="0001"+r+"00"+e;return k(i,16)}function _o(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var s=e.charCodeAt(r--);s<128?n[--t]=s:s>127&&s<2048?(n[--t]=s&63|128,n[--t]=s>>6|192):(n[--t]=s&63|128,n[--t]=s>>6&63|128,n[--t]=s>>12|224)}n[--t]=0;for(var i=new Pt,u=[];t>2;){for(u[0]=0;u[0]==0;)i.nextBytes(u);n[--t]=u[0]}return n[--t]=2,n[--t]=0,new C(n)}var zo=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(t){if(this.p==null||this.q==null)return t.modPow(this.d,this.n);for(var n=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);n.compareTo(r)<0;)n=n.add(this.p);return n.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},e.prototype.setPublic=function(t,n){t!=null&&n!=null&&t.length>0&&n.length>0?(this.n=k(t,16),this.e=parseInt(n,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(t){var n=this.n.bitLength()+7>>3,r=_o(t,n);if(r==null)return null;var s=this.doPublic(r);if(s==null)return null;for(var i=s.toString(16),u=i.length,a=0;a<n*2-u;a++)i="0"+i;return i},e.prototype.setPrivate=function(t,n,r){t!=null&&n!=null&&t.length>0&&n.length>0?(this.n=k(t,16),this.e=parseInt(n,16),this.d=k(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(t,n,r,s,i,u,a,l){t!=null&&n!=null&&t.length>0&&n.length>0?(this.n=k(t,16),this.e=parseInt(n,16),this.d=k(r,16),this.p=k(s,16),this.q=k(i,16),this.dmp1=k(u,16),this.dmq1=k(a,16),this.coeff=k(l,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(t,n){var r=new Pt,s=t>>1;this.e=parseInt(n,16);for(var i=new C(n,16);;){for(;this.p=new C(t-s,1,r),!(this.p.subtract(C.ONE).gcd(i).compareTo(C.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new C(s,1,r),!(this.q.subtract(C.ONE).gcd(i).compareTo(C.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var u=this.p;this.p=this.q,this.q=u}var a=this.p.subtract(C.ONE),l=this.q.subtract(C.ONE),c=a.multiply(l);if(c.gcd(i).compareTo(C.ONE)==0){this.n=this.p.multiply(this.q),this.d=i.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(t){var n=k(t,16),r=this.doPrivate(n);return r==null?null:Ko(r,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(t,n,r){var s=new Pt,i=t>>1;this.e=parseInt(n,16);var u=new C(n,16),a=this,l=function(){var c=function(){if(a.p.compareTo(a.q)<=0){var y=a.p;a.p=a.q,a.q=y}var m=a.p.subtract(C.ONE),h=a.q.subtract(C.ONE),S=m.multiply(h);S.gcd(u).compareTo(C.ONE)==0?(a.n=a.p.multiply(a.q),a.d=u.modInverse(S),a.dmp1=a.d.mod(m),a.dmq1=a.d.mod(h),a.coeff=a.q.modInverse(a.p),setTimeout(function(){r()},0)):setTimeout(l,0)},d=function(){a.q=A(),a.q.fromNumberAsync(i,1,s,function(){a.q.subtract(C.ONE).gcda(u,function(y){y.compareTo(C.ONE)==0&&a.q.isProbablePrime(10)?setTimeout(c,0):setTimeout(d,0)})})},v=function(){a.p=A(),a.p.fromNumberAsync(t-i,1,s,function(){a.p.subtract(C.ONE).gcda(u,function(y){y.compareTo(C.ONE)==0&&a.p.isProbablePrime(10)?setTimeout(d,0):setTimeout(v,0)})})};setTimeout(v,0)};setTimeout(l,0)},e.prototype.sign=function(t,n,r){var s=$o(r),i=s+n(t).toString(),u=Ho(i,this.n.bitLength()/4);if(u==null)return null;var a=this.doPrivate(u);if(a==null)return null;var l=a.toString(16);return(l.length&1)==0?l:"0"+l},e.prototype.verify=function(t,n,r){var s=k(n,16),i=this.doPublic(s);if(i==null)return null;var u=i.toString(16).replace(/^1f+00/,""),a=Uo(u);return a==r(t).toString()},e}();function Ko(e,t){for(var n=e.toByteArray(),r=0;r<n.length&&n[r]==0;)++r;if(n.length-r!=t-1||n[r]!=2)return null;for(++r;n[r]!=0;)if(++r>=n.length)return null;for(var s="";++r<n.length;){var i=n[r]&255;i<128?s+=String.fromCharCode(i):i>191&&i<224?(s+=String.fromCharCode((i&31)<<6|n[r+1]&63),++r):(s+=String.fromCharCode((i&15)<<12|(n[r+1]&63)<<6|n[r+2]&63),r+=2)}return s}var et={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function $o(e){return et[e]||""}function Uo(e){for(var t in et)if(et.hasOwnProperty(t)){var n=et[t],r=n.length;if(e.substr(0,r)==n)return e.substr(r)}return e}/*!
|
|
14
|
+
`,this.sub!==null){t+=" ";for(var r=0,s=this.sub.length;r<s;++r)n+=this.sub[r].toPrettyString(t)}return n},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(t){var n=t.get(),r=n&127;if(r==n)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(r===0)return null;n=0;for(var s=0;s<r;++s)n=n*256+t.get();return n},e.prototype.getHexStringValue=function(){var t=this.toHexString(),n=this.header*2,r=this.length*2;return t.substr(n,r)},e.decode=function(t){var n;t instanceof Ct?n=t:n=new Ct(t,0);var r=new Ct(n),s=new Hn(n),i=e.decodeLength(n),u=n.pos,a=u-r.pos,l=null,c=function(){var v=[];if(i!==null){for(var y=u+i;n.pos<y;)v[v.length]=e.decode(n);if(n.pos!=y)throw new Error("Content size is not correct for container starting at offset "+u)}else try{for(;;){var m=e.decode(n);if(m.tag.isEOC())break;v[v.length]=m}i=u-n.pos}catch(h){throw new Error("Exception while decoding undefined length content: "+h)}return v};if(s.tagConstructed)l=c();else if(s.isUniversal()&&(s.tagNumber==3||s.tagNumber==4))try{if(s.tagNumber==3&&n.get()!=0)throw new Error("BIT STRINGs with unused bits cannot encapsulate.");l=c();for(var d=0;d<l.length;++d)if(l[d].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch{l=null}if(l===null){if(i===null)throw new Error("We can't skip over an invalid tag with undefined length at offset "+u);n.pos=u+Math.abs(i)}return new e(r,a,i,s,l)},e}(),Hn=function(){function e(t){var n=t.get();if(this.tagClass=n>>6,this.tagConstructed=(n&32)!==0,this.tagNumber=n&31,this.tagNumber==31){var r=new Ie;do n=t.get(),r.mulAdd(128,n&127);while(n&128);this.tagNumber=r.simplify()}}return e.prototype.isUniversal=function(){return this.tagClass===0},e.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},e}(),oe,Mo=0xdeadbeefcafe,_n=(Mo&16777215)==15715070,z=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],No=(1<<26)/z[z.length-1],C=function(){function e(t,n,r){t!=null&&(typeof t=="number"?this.fromNumber(t,n,r):n==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,n))}return e.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var n;if(t==16)n=4;else if(t==8)n=3;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else return this.toRadix(t);var r=(1<<n)-1,s,i=!1,u="",a=this.t,l=this.DB-a*this.DB%n;if(a-- >0)for(l<this.DB&&(s=this[a]>>l)>0&&(i=!0,u=Q(s));a>=0;)l<n?(s=(this[a]&(1<<l)-1)<<n-l,s|=this[--a]>>(l+=this.DB-n)):(s=this[a]>>(l-=n)&r,l<=0&&(l+=this.DB,--a)),s>0&&(i=!0),i&&(u+=Q(s));return i?u:"0"},e.prototype.negate=function(){var t=B();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(t){var n=this.s-t.s;if(n!=0)return n;var r=this.t;if(n=r-t.t,n!=0)return this.s<0?-n:n;for(;--r>=0;)if((n=this[r]-t[r])!=0)return n;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+We(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=B();return this.abs().divRemTo(t,null,n),this.s<0&&n.compareTo(e.ZERO)>0&&t.subTo(n,n),n},e.prototype.modPowInt=function(t,n){var r;return t<256||n.isEven()?r=new zn(n):r=new Kn(n),this.exp(t,r)},e.prototype.clone=function(){var t=B();return this.copyTo(t),t},e.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var t=this.t,n=[];n[0]=this.s;var r=this.DB-t*this.DB%8,s,i=0;if(t-- >0)for(r<this.DB&&(s=this[t]>>r)!=(this.s&this.DM)>>r&&(n[i++]=s|this.s<<this.DB-r);t>=0;)r<8?(s=(this[t]&(1<<r)-1)<<8-r,s|=this[--t]>>(r+=this.DB-8)):(s=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(s&128)!=0&&(s|=-256),i==0&&(this.s&128)!=(s&128)&&++i,(i>0||s!=this.s)&&(n[i++]=s);return n},e.prototype.equals=function(t){return this.compareTo(t)==0},e.prototype.min=function(t){return this.compareTo(t)<0?this:t},e.prototype.max=function(t){return this.compareTo(t)>0?this:t},e.prototype.and=function(t){var n=B();return this.bitwiseTo(t,Ao,n),n},e.prototype.or=function(t){var n=B();return this.bitwiseTo(t,je,n),n},e.prototype.xor=function(t){var n=B();return this.bitwiseTo(t,Pn,n),n},e.prototype.andNot=function(t){var n=B();return this.bitwiseTo(t,Fn,n),n},e.prototype.not=function(){for(var t=B(),n=0;n<this.t;++n)t[n]=this.DM&~this[n];return t.t=this.t,t.s=~this.s,t},e.prototype.shiftLeft=function(t){var n=B();return t<0?this.rShiftTo(-t,n):this.lShiftTo(t,n),n},e.prototype.shiftRight=function(t){var n=B();return t<0?this.lShiftTo(-t,n):this.rShiftTo(t,n),n},e.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+Bo(this[t]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var t=0,n=this.s&this.DM,r=0;r<this.t;++r)t+=xo(this[r]^n);return t},e.prototype.testBit=function(t){var n=Math.floor(t/this.DB);return n>=this.t?this.s!=0:(this[n]&1<<t%this.DB)!=0},e.prototype.setBit=function(t){return this.changeBit(t,je)},e.prototype.clearBit=function(t){return this.changeBit(t,Fn)},e.prototype.flipBit=function(t){return this.changeBit(t,Pn)},e.prototype.add=function(t){var n=B();return this.addTo(t,n),n},e.prototype.subtract=function(t){var n=B();return this.subTo(t,n),n},e.prototype.multiply=function(t){var n=B();return this.multiplyTo(t,n),n},e.prototype.divide=function(t){var n=B();return this.divRemTo(t,n,null),n},e.prototype.remainder=function(t){var n=B();return this.divRemTo(t,null,n),n},e.prototype.divideAndRemainder=function(t){var n=B(),r=B();return this.divRemTo(t,n,r),[n,r]},e.prototype.modPow=function(t,n){var r=t.bitLength(),s,i=re(1),u;if(r<=0)return i;r<18?s=1:r<48?s=3:r<144?s=4:r<768?s=5:s=6,r<8?u=new zn(n):n.isEven()?u=new Vo(n):u=new Kn(n);var a=[],l=3,c=s-1,d=(1<<s)-1;if(a[1]=u.convert(this),s>1){var v=B();for(u.sqrTo(a[1],v);l<=d;)a[l]=B(),u.mulTo(v,a[l-2],a[l]),l+=2}var y=t.t-1,m,h=!0,S=B(),T;for(r=We(t[y])-1;y>=0;){for(r>=c?m=t[y]>>r-c&d:(m=(t[y]&(1<<r+1)-1)<<c-r,y>0&&(m|=t[y-1]>>this.DB+r-c)),l=s;(m&1)==0;)m>>=1,--l;if((r-=l)<0&&(r+=this.DB,--y),h)a[m].copyTo(i),h=!1;else{for(;l>1;)u.sqrTo(i,S),u.sqrTo(S,i),l-=2;l>0?u.sqrTo(i,S):(T=i,i=S,S=T),u.mulTo(S,a[m],i)}for(;y>=0&&(t[y]&1<<r)==0;)u.sqrTo(i,S),T=i,i=S,S=T,--r<0&&(r=this.DB-1,--y)}return u.revert(i)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||t.signum()==0)return e.ZERO;for(var r=t.clone(),s=this.clone(),i=re(1),u=re(0),a=re(0),l=re(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),n?((!i.isEven()||!u.isEven())&&(i.addTo(this,i),u.subTo(t,u)),i.rShiftTo(1,i)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);for(;s.isEven();)s.rShiftTo(1,s),n?((!a.isEven()||!l.isEven())&&(a.addTo(this,a),l.subTo(t,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(s)>=0?(r.subTo(s,r),n&&i.subTo(a,i),u.subTo(l,u)):(s.subTo(r,s),n&&a.subTo(i,a),l.subTo(u,l))}if(s.compareTo(e.ONE)!=0)return e.ZERO;if(l.compareTo(t)>=0)return l.subtract(t);if(l.signum()<0)l.addTo(t,l);else return l;return l.signum()<0?l.add(t):l},e.prototype.pow=function(t){return this.exp(t,new Oo)},e.prototype.gcd=function(t){var n=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(n.compareTo(r)<0){var s=n;n=r,r=s}var i=n.getLowestSetBit(),u=r.getLowestSetBit();if(u<0)return n;for(i<u&&(u=i),u>0&&(n.rShiftTo(u,n),r.rShiftTo(u,r));n.signum()>0;)(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r));return u>0&&r.lShiftTo(u,r),r},e.prototype.isProbablePrime=function(t){var n,r=this.abs();if(r.t==1&&r[0]<=z[z.length-1]){for(n=0;n<z.length;++n)if(r[0]==z[n])return!0;return!1}if(r.isEven())return!1;for(n=1;n<z.length;){for(var s=z[n],i=n+1;i<z.length&&s<No;)s*=z[i++];for(s=r.modInt(s);n<i;)if(s%z[n++]==0)return!1}return r.millerRabin(t)},e.prototype.copyTo=function(t){for(var n=this.t-1;n>=0;--n)t[n]=this[n];t.t=this.t,t.s=this.s},e.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(n==16)r=4;else if(n==8)r=3;else if(n==256)r=8;else if(n==2)r=1;else if(n==32)r=5;else if(n==4)r=2;else{this.fromRadix(t,n);return}this.t=0,this.s=0;for(var s=t.length,i=!1,u=0;--s>=0;){var a=r==8?+t[s]&255:Un(t,s);if(a<0){t.charAt(s)=="-"&&(i=!0);continue}i=!1,u==0?this[this.t++]=a:u+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-u)-1)<<u,this[this.t++]=a>>this.DB-u):this[this.t-1]|=a<<u,u+=r,u>=this.DB&&(u-=this.DB)}r==8&&(+t[0]&128)!=0&&(this.s=-1,u>0&&(this[this.t-1]|=(1<<this.DB-u)-1<<u)),this.clamp(),i&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},e.prototype.dlShiftTo=function(t,n){var r;for(r=this.t-1;r>=0;--r)n[r+t]=this[r];for(r=t-1;r>=0;--r)n[r]=0;n.t=this.t+t,n.s=this.s},e.prototype.drShiftTo=function(t,n){for(var r=t;r<this.t;++r)n[r-t]=this[r];n.t=Math.max(this.t-t,0),n.s=this.s},e.prototype.lShiftTo=function(t,n){for(var r=t%this.DB,s=this.DB-r,i=(1<<s)-1,u=Math.floor(t/this.DB),a=this.s<<r&this.DM,l=this.t-1;l>=0;--l)n[l+u+1]=this[l]>>s|a,a=(this[l]&i)<<r;for(var l=u-1;l>=0;--l)n[l]=0;n[u]=a,n.t=this.t+u+1,n.s=this.s,n.clamp()},e.prototype.rShiftTo=function(t,n){n.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){n.t=0;return}var s=t%this.DB,i=this.DB-s,u=(1<<s)-1;n[0]=this[r]>>s;for(var a=r+1;a<this.t;++a)n[a-r-1]|=(this[a]&u)<<i,n[a-r]=this[a]>>s;s>0&&(n[this.t-r-1]|=(this.s&u)<<i),n.t=this.t-r,n.clamp()},e.prototype.subTo=function(t,n){for(var r=0,s=0,i=Math.min(t.t,this.t);r<i;)s+=this[r]-t[r],n[r++]=s&this.DM,s>>=this.DB;if(t.t<this.t){for(s-=t.s;r<this.t;)s+=this[r],n[r++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;r<t.t;)s-=t[r],n[r++]=s&this.DM,s>>=this.DB;s-=t.s}n.s=s<0?-1:0,s<-1?n[r++]=this.DV+s:s>0&&(n[r++]=s),n.t=r,n.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),s=t.abs(),i=r.t;for(n.t=i+s.t;--i>=0;)n[i]=0;for(i=0;i<s.t;++i)n[i+r.t]=r.am(0,s[i],n,i,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(t){for(var n=this.abs(),r=t.t=2*n.t;--r>=0;)t[r]=0;for(r=0;r<n.t-1;++r){var s=n.am(r,n[r],t,2*r,0,1);(t[r+n.t]+=n.am(r+1,2*n[r],t,2*r+1,s,n.t-r-1))>=n.DV&&(t[r+n.t]-=n.DV,t[r+n.t+1]=1)}t.t>0&&(t[t.t-1]+=n.am(r,n[r],t,2*r,0,1)),t.s=0,t.clamp()},e.prototype.divRemTo=function(t,n,r){var s=t.abs();if(!(s.t<=0)){var i=this.abs();if(i.t<s.t){n!=null&&n.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=B());var u=B(),a=this.s,l=t.s,c=this.DB-We(s[s.t-1]);c>0?(s.lShiftTo(c,u),i.lShiftTo(c,r)):(s.copyTo(u),i.copyTo(r));var d=u.t,v=u[d-1];if(v!=0){var y=v*(1<<this.F1)+(d>1?u[d-2]>>this.F2:0),m=this.FV/y,h=(1<<this.F1)/y,S=1<<this.F2,T=r.t,b=T-d,E=n??B();for(u.dlShiftTo(b,E),r.compareTo(E)>=0&&(r[r.t++]=1,r.subTo(E,r)),e.ONE.dlShiftTo(d,E),E.subTo(u,u);u.t<d;)u[u.t++]=0;for(;--b>=0;){var A=r[--T]==v?this.DM:Math.floor(r[T]*m+(r[T-1]+S)*h);if((r[T]+=u.am(0,A,r,b,0,d))<A)for(u.dlShiftTo(b,E),r.subTo(E,r);r[T]<--A;)r.subTo(E,r)}n!=null&&(r.drShiftTo(d,n),a!=l&&e.ZERO.subTo(n,n)),r.t=d,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var n=t&3;return n=n*(2-(t&15)*n)&15,n=n*(2-(t&255)*n)&255,n=n*(2-((t&65535)*n&65535))&65535,n=n*(2-t*n%this.DV)%this.DV,n>0?this.DV-n:-n},e.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=B(),s=B(),i=n.convert(this),u=We(t)-1;for(i.copyTo(r);--u>=0;)if(n.sqrTo(r,s),(t&1<<u)>0)n.mulTo(s,i,r);else{var a=r;r=s,s=a}return n.revert(r)},e.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},e.prototype.toRadix=function(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var n=this.chunkSize(t),r=Math.pow(t,n),s=re(r),i=B(),u=B(),a="";for(this.divRemTo(s,i,u);i.signum()>0;)a=(r+u.intValue()).toString(t).substr(1)+a,i.divRemTo(s,i,u);return u.intValue().toString(t)+a},e.prototype.fromRadix=function(t,n){this.fromInt(0),n==null&&(n=10);for(var r=this.chunkSize(n),s=Math.pow(n,r),i=!1,u=0,a=0,l=0;l<t.length;++l){var c=Un(t,l);if(c<0){t.charAt(l)=="-"&&this.signum()==0&&(i=!0);continue}a=n*a+c,++u>=r&&(this.dMultiply(s),this.dAddOffset(a,0),u=0,a=0)}u>0&&(this.dMultiply(Math.pow(n,u)),this.dAddOffset(a,0)),i&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,r){if(typeof n=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),je,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var s=[],i=t&7;s.length=(t>>3)+1,n.nextBytes(s),i>0?s[0]&=(1<<i)-1:s[0]=0,this.fromString(s,256)}},e.prototype.bitwiseTo=function(t,n,r){var s,i,u=Math.min(t.t,this.t);for(s=0;s<u;++s)r[s]=n(this[s],t[s]);if(t.t<this.t){for(i=t.s&this.DM,s=u;s<this.t;++s)r[s]=n(this[s],i);r.t=this.t}else{for(i=this.s&this.DM,s=u;s<t.t;++s)r[s]=n(i,t[s]);r.t=t.t}r.s=n(this.s,t.s),r.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(t,n){for(var r=0,s=0,i=Math.min(t.t,this.t);r<i;)s+=this[r]+t[r],n[r++]=s&this.DM,s>>=this.DB;if(t.t<this.t){for(s+=t.s;r<this.t;)s+=this[r],n[r++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;r<t.t;)s+=t[r],n[r++]=s&this.DM,s>>=this.DB;s+=t.s}n.s=s<0?-1:0,s>0?n[r++]=s:s<-1&&(n[r++]=this.DV+s),n.t=r,n.clamp()},e.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(t,n){if(t!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=t;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},e.prototype.multiplyLowerTo=function(t,n,r){var s=Math.min(this.t+t.t,n);for(r.s=0,r.t=s;s>0;)r[--s]=0;for(var i=r.t-this.t;s<i;++s)r[s+this.t]=this.am(0,t[s],r,s,0,this.t);for(var i=Math.min(t.t,n);s<i;++s)this.am(0,t[s],r,s,0,n-s);r.clamp()},e.prototype.multiplyUpperTo=function(t,n,r){--n;var s=r.t=this.t+t.t-n;for(r.s=0;--s>=0;)r[s]=0;for(s=Math.max(n-this.t,0);s<t.t;++s)r[this.t+s-n]=this.am(n-s,t[s],r,0,0,this.t+s-n);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(t){if(t<=0)return 0;var n=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(n==0)r=this[0]%t;else for(var s=this.t-1;s>=0;--s)r=(n*r+this[s])%t;return r},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var s=n.shiftRight(r);t=t+1>>1,t>z.length&&(t=z.length);for(var i=B(),u=0;u<t;++u){i.fromInt(z[Math.floor(Math.random()*z.length)]);var a=i.modPow(s,this);if(a.compareTo(e.ONE)!=0&&a.compareTo(n)!=0){for(var l=1;l++<r&&a.compareTo(n)!=0;)if(a=a.modPowInt(2,this),a.compareTo(e.ONE)==0)return!1;if(a.compareTo(n)!=0)return!1}}return!0},e.prototype.square=function(){var t=B();return this.squareTo(t),t},e.prototype.gcda=function(t,n){var r=this.s<0?this.negate():this.clone(),s=t.s<0?t.negate():t.clone();if(r.compareTo(s)<0){var i=r;r=s,s=i}var u=r.getLowestSetBit(),a=s.getLowestSetBit();if(a<0){n(r);return}u<a&&(a=u),a>0&&(r.rShiftTo(a,r),s.rShiftTo(a,s));var l=function(){(u=r.getLowestSetBit())>0&&r.rShiftTo(u,r),(u=s.getLowestSetBit())>0&&s.rShiftTo(u,s),r.compareTo(s)>=0?(r.subTo(s,r),r.rShiftTo(1,r)):(s.subTo(r,s),s.rShiftTo(1,s)),r.signum()>0?setTimeout(l,0):(a>0&&s.lShiftTo(a,s),setTimeout(function(){n(s)},0))};setTimeout(l,10)},e.prototype.fromNumberAsync=function(t,n,r,s){if(typeof n=="number")if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),je,this),this.isEven()&&this.dAddOffset(1,0);var i=this,u=function(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(e.ONE.shiftLeft(t-1),i),i.isProbablePrime(n)?setTimeout(function(){s()},0):setTimeout(u,0)};setTimeout(u,0)}else{var a=[],l=t&7;a.length=(t>>3)+1,n.nextBytes(a),l>0?a[0]&=(1<<l)-1:a[0]=0,this.fromString(a,256)}},e}(),Oo=function(){function e(){}return e.prototype.convert=function(t){return t},e.prototype.revert=function(t){return t},e.prototype.mulTo=function(t,n,r){t.multiplyTo(n,r)},e.prototype.sqrTo=function(t,n){t.squareTo(n)},e}(),zn=function(){function e(t){this.m=t}return e.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},e.prototype.revert=function(t){return t},e.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},e.prototype.mulTo=function(t,n,r){t.multiplyTo(n,r),this.reduce(r)},e.prototype.sqrTo=function(t,n){t.squareTo(n),this.reduce(n)},e}(),Kn=function(){function e(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return e.prototype.convert=function(t){var n=B();return t.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),t.s<0&&n.compareTo(C.ZERO)>0&&this.m.subTo(n,n),n},e.prototype.revert=function(t){var n=B();return t.copyTo(n),this.reduce(n),n},e.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var n=0;n<this.m.t;++n){var r=t[n]&32767,s=r*this.mpl+((r*this.mph+(t[n]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=n+this.m.t,t[r]+=this.m.am(0,s,t,n,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},e.prototype.mulTo=function(t,n,r){t.multiplyTo(n,r),this.reduce(r)},e.prototype.sqrTo=function(t,n){t.squareTo(n),this.reduce(n)},e}(),Vo=function(){function e(t){this.m=t,this.r2=B(),this.q3=B(),C.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return e.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var n=B();return t.copyTo(n),this.reduce(n),n},e.prototype.revert=function(t){return t},e.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},e.prototype.mulTo=function(t,n,r){t.multiplyTo(n,r),this.reduce(r)},e.prototype.sqrTo=function(t,n){t.squareTo(n),this.reduce(n)},e}();function B(){return new C(null)}function k(e,t){return new C(e,t)}var $n=typeof navigator<"u";$n&&_n&&navigator.appName=="Microsoft Internet Explorer"?(C.prototype.am=function(t,n,r,s,i,u){for(var a=n&32767,l=n>>15;--u>=0;){var c=this[t]&32767,d=this[t++]>>15,v=l*c+d*a;c=a*c+((v&32767)<<15)+r[s]+(i&1073741823),i=(c>>>30)+(v>>>15)+l*d+(i>>>30),r[s++]=c&1073741823}return i},oe=30):$n&&_n&&navigator.appName!="Netscape"?(C.prototype.am=function(t,n,r,s,i,u){for(;--u>=0;){var a=n*this[t++]+r[s]+i;i=Math.floor(a/67108864),r[s++]=a&67108863}return i},oe=26):(C.prototype.am=function(t,n,r,s,i,u){for(var a=n&16383,l=n>>14;--u>=0;){var c=this[t]&16383,d=this[t++]>>14,v=l*c+d*a;c=a*c+((v&16383)<<14)+r[s]+i,i=(c>>28)+(v>>14)+l*d,r[s++]=c&268435455}return i},oe=28);C.prototype.DB=oe;C.prototype.DM=(1<<oe)-1;C.prototype.DV=1<<oe;var rn=52;C.prototype.FV=Math.pow(2,rn);C.prototype.F1=rn-oe;C.prototype.F2=2*oe-rn;var ht=[],Be,W;Be=48;for(W=0;W<=9;++W)ht[Be++]=W;Be=97;for(W=10;W<36;++W)ht[Be++]=W;Be=65;for(W=10;W<36;++W)ht[Be++]=W;function Un(e,t){var n=ht[e.charCodeAt(t)];return n??-1}function re(e){var t=B();return t.fromInt(e),t}function We(e){var t=1,n;return(n=e>>>16)!=0&&(e=n,t+=16),(n=e>>8)!=0&&(e=n,t+=8),(n=e>>4)!=0&&(e=n,t+=4),(n=e>>2)!=0&&(e=n,t+=2),(n=e>>1)!=0&&(e=n,t+=1),t}C.ZERO=re(0);C.ONE=re(1);var Po=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(t){var n,r,s;for(n=0;n<256;++n)this.S[n]=n;for(r=0,n=0;n<256;++n)r=r+this.S[n]+t[n%t.length]&255,s=this.S[n],this.S[n]=this.S[r],this.S[r]=s;this.i=0,this.j=0},e.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},e}();function Fo(){return new Po}var Wr=256,Ge,ie=null,Y;if(ie==null){ie=[],Y=0;var Ye=void 0;if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){var At=new Uint32Array(256);for(window.crypto.getRandomValues(At),Ye=0;Ye<At.length;++Ye)ie[Y++]=At[Ye]&255}var Ze=0,Xe=function(e){if(Ze=Ze||0,Ze>=256||Y>=Wr){window.removeEventListener?window.removeEventListener("mousemove",Xe,!1):window.detachEvent&&window.detachEvent("onmousemove",Xe);return}try{var t=e.x+e.y;ie[Y++]=t&255,Ze+=1}catch{}};typeof window<"u"&&(window.addEventListener?window.addEventListener("mousemove",Xe,!1):window.attachEvent&&window.attachEvent("onmousemove",Xe))}function Lo(){if(Ge==null){for(Ge=Fo();Y<Wr;){var e=Math.floor(65536*Math.random());ie[Y++]=e&255}for(Ge.init(ie),Y=0;Y<ie.length;++Y)ie[Y]=0;Y=0}return Ge.next()}var Pt=function(){function e(){}return e.prototype.nextBytes=function(t){for(var n=0;n<t.length;++n)t[n]=Lo()},e}();function Ho(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",s=0;s<n;s+=2)r+="ff";var i="0001"+r+"00"+e;return k(i,16)}function _o(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var s=e.charCodeAt(r--);s<128?n[--t]=s:s>127&&s<2048?(n[--t]=s&63|128,n[--t]=s>>6|192):(n[--t]=s&63|128,n[--t]=s>>6&63|128,n[--t]=s>>12|224)}n[--t]=0;for(var i=new Pt,u=[];t>2;){for(u[0]=0;u[0]==0;)i.nextBytes(u);n[--t]=u[0]}return n[--t]=2,n[--t]=0,new C(n)}var zo=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(t){if(this.p==null||this.q==null)return t.modPow(this.d,this.n);for(var n=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);n.compareTo(r)<0;)n=n.add(this.p);return n.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},e.prototype.setPublic=function(t,n){t!=null&&n!=null&&t.length>0&&n.length>0?(this.n=k(t,16),this.e=parseInt(n,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(t){var n=this.n.bitLength()+7>>3,r=_o(t,n);if(r==null)return null;var s=this.doPublic(r);if(s==null)return null;for(var i=s.toString(16),u=i.length,a=0;a<n*2-u;a++)i="0"+i;return i},e.prototype.setPrivate=function(t,n,r){t!=null&&n!=null&&t.length>0&&n.length>0?(this.n=k(t,16),this.e=parseInt(n,16),this.d=k(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(t,n,r,s,i,u,a,l){t!=null&&n!=null&&t.length>0&&n.length>0?(this.n=k(t,16),this.e=parseInt(n,16),this.d=k(r,16),this.p=k(s,16),this.q=k(i,16),this.dmp1=k(u,16),this.dmq1=k(a,16),this.coeff=k(l,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(t,n){var r=new Pt,s=t>>1;this.e=parseInt(n,16);for(var i=new C(n,16);;){for(;this.p=new C(t-s,1,r),!(this.p.subtract(C.ONE).gcd(i).compareTo(C.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new C(s,1,r),!(this.q.subtract(C.ONE).gcd(i).compareTo(C.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var u=this.p;this.p=this.q,this.q=u}var a=this.p.subtract(C.ONE),l=this.q.subtract(C.ONE),c=a.multiply(l);if(c.gcd(i).compareTo(C.ONE)==0){this.n=this.p.multiply(this.q),this.d=i.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(t){var n=k(t,16),r=this.doPrivate(n);return r==null?null:Ko(r,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(t,n,r){var s=new Pt,i=t>>1;this.e=parseInt(n,16);var u=new C(n,16),a=this,l=function(){var c=function(){if(a.p.compareTo(a.q)<=0){var y=a.p;a.p=a.q,a.q=y}var m=a.p.subtract(C.ONE),h=a.q.subtract(C.ONE),S=m.multiply(h);S.gcd(u).compareTo(C.ONE)==0?(a.n=a.p.multiply(a.q),a.d=u.modInverse(S),a.dmp1=a.d.mod(m),a.dmq1=a.d.mod(h),a.coeff=a.q.modInverse(a.p),setTimeout(function(){r()},0)):setTimeout(l,0)},d=function(){a.q=B(),a.q.fromNumberAsync(i,1,s,function(){a.q.subtract(C.ONE).gcda(u,function(y){y.compareTo(C.ONE)==0&&a.q.isProbablePrime(10)?setTimeout(c,0):setTimeout(d,0)})})},v=function(){a.p=B(),a.p.fromNumberAsync(t-i,1,s,function(){a.p.subtract(C.ONE).gcda(u,function(y){y.compareTo(C.ONE)==0&&a.p.isProbablePrime(10)?setTimeout(d,0):setTimeout(v,0)})})};setTimeout(v,0)};setTimeout(l,0)},e.prototype.sign=function(t,n,r){var s=$o(r),i=s+n(t).toString(),u=Ho(i,this.n.bitLength()/4);if(u==null)return null;var a=this.doPrivate(u);if(a==null)return null;var l=a.toString(16);return(l.length&1)==0?l:"0"+l},e.prototype.verify=function(t,n,r){var s=k(n,16),i=this.doPublic(s);if(i==null)return null;var u=i.toString(16).replace(/^1f+00/,""),a=Uo(u);return a==r(t).toString()},e}();function Ko(e,t){for(var n=e.toByteArray(),r=0;r<n.length&&n[r]==0;)++r;if(n.length-r!=t-1||n[r]!=2)return null;for(++r;n[r]!=0;)if(++r>=n.length)return null;for(var s="";++r<n.length;){var i=n[r]&255;i<128?s+=String.fromCharCode(i):i>191&&i<224?(s+=String.fromCharCode((i&31)<<6|n[r+1]&63),++r):(s+=String.fromCharCode((i&15)<<12|(n[r+1]&63)<<6|n[r+2]&63),r+=2)}return s}var et={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function $o(e){return et[e]||""}function Uo(e){for(var t in et)if(et.hasOwnProperty(t)){var n=et[t],r=n.length;if(e.substr(0,r)==n)return e.substr(r)}return e}/*!
|
|
15
15
|
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
|
|
16
16
|
Code licensed under the BSD License:
|
|
17
17
|
http://developer.yahoo.com/yui/license.html
|
|
@@ -23,10 +23,10 @@ version: 2.9.0
|
|
|
23
23
|
* @version asn1 1.0.13 (2017-Jun-02)
|
|
24
24
|
* @since jsrsasign 2.1
|
|
25
25
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
26
|
-
*/var p={};(typeof p.asn1>"u"||!p.asn1)&&(p.asn1={});p.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if(t.substr(0,1)!="-")t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1),r=n.length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var s="",i=0;i<r;i++)s+="f";var u=new C(s,16),a=u.xor(e).add(C.ONE);t=a.toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=p,n=t.asn1,r=n.DERBoolean,s=n.DERInteger,i=n.DERBitString,u=n.DEROctetString,a=n.DERNull,l=n.DERObjectIdentifier,c=n.DEREnumerated,d=n.DERUTF8String,v=n.DERNumericString,y=n.DERPrintableString,m=n.DERTeletexString,h=n.DERIA5String,S=n.DERUTCTime,T=n.DERGeneralizedTime,b=n.DERSequence,E=n.DERSet,D=n.DERTaggedObject,N=n.ASN1Util.newObject,$=Object.keys(e);if($.length!=1)throw"key of param shall be only one.";var w=$[0];if(":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":")==-1)throw"undefined key: "+w;if(w=="bool")return new r(e[w]);if(w=="int")return new s(e[w]);if(w=="bitstr")return new i(e[w]);if(w=="octstr")return new u(e[w]);if(w=="null")return new a(e[w]);if(w=="oid")return new l(e[w]);if(w=="enum")return new c(e[w]);if(w=="utf8str")return new d(e[w]);if(w=="numstr")return new v(e[w]);if(w=="prnstr")return new y(e[w]);if(w=="telstr")return new m(e[w]);if(w=="ia5str")return new h(e[w]);if(w=="utctime")return new S(e[w]);if(w=="gentime")return new T(e[w]);if(w=="seq"){for(var L=e[w],I=[],O=0;O<L.length;O++){var q=N(L[O]);I.push(q)}return new b({array:I})}if(w=="set"){for(var L=e[w],I=[],O=0;O<L.length;O++){var q=N(L[O]);I.push(q)}return new E({array:I})}if(w=="tag"){var V=e[w];if(Object.prototype.toString.call(V)==="[object Array]"&&V.length==3){var R=N(V[2]);return new D({tag:V[0],explicit:V[1],obj:R})}else{var Z={};if(V.explicit!==void 0&&(Z.explicit=V.explicit),V.tag!==void 0&&(Z.tag=V.tag),V.obj===void 0)throw"obj shall be specified for 'tag'.";return Z.obj=N(V.obj),new D(Z)}}},this.jsonToASN1HEX=function(e){var t=this.newObject(e);return t.getEncodedHex()}};p.asn1.ASN1Util.oidHexToInt=function(e){for(var s="",t=parseInt(e.substr(0,2),16),n=Math.floor(t/40),r=t%40,s=n+"."+r,i="",u=2;u<e.length;u+=2){var a=parseInt(e.substr(u,2),16),l=("00000000"+a.toString(2)).slice(-8);if(i=i+l.substr(1,7),l.substr(0,1)=="0"){var c=new C(i,2);s=s+"."+c.toString(10),i=""}}return s};p.asn1.ASN1Util.oidIntToHex=function(e){var t=function(a){var l=a.toString(16);return l.length==1&&(l="0"+l),l},n=function(a){var l="",c=new C(a,10),d=c.toString(2),v=7-d.length%7;v==7&&(v=0);for(var y="",m=0;m<v;m++)y+="0";d=y+d;for(var m=0;m<d.length-1;m+=7){var h=d.substr(m,7);m!=d.length-7&&(h="1"+h),l+=t(parseInt(h,2))}return l};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",s=e.split("."),i=parseInt(s[0])*40+parseInt(s[1]);r+=t(i),s.splice(0,2);for(var u=0;u<s.length;u++)r+=n(s[u]);return r};p.asn1.ASN1Object=function(){var e="";this.getLengthHexFromValue=function(){if(typeof this.hV>"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+e.length+",v="+this.hV;var t=this.hV.length/2,n=t.toString(16);if(n.length%2==1&&(n="0"+n),t<128)return n;var r=n.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var s=128+r;return s.toString(16)+n},this.getEncodedHex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}};p.asn1.DERAbstractString=function(e){p.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e=="string"?this.setString(e):typeof e.str<"u"?this.setString(e.str):typeof e.hex<"u"&&this.setStringHex(e.hex))};M.lang.extend(p.asn1.DERAbstractString,p.asn1.ASN1Object);p.asn1.DERAbstractTime=function(e){p.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+t.getTimezoneOffset()*6e4;var n=new Date(utc);return n},this.formatDate=function(t,n,r){var s=this.zeroPadding,i=this.localDateToUTC(t),u=String(i.getFullYear());n=="utc"&&(u=u.substr(2,2));var a=s(String(i.getMonth()+1),2),l=s(String(i.getDate()),2),c=s(String(i.getHours()),2),d=s(String(i.getMinutes()),2),v=s(String(i.getSeconds()),2),y=u+a+l+c+d+v;if(r===!0){var m=i.getMilliseconds();if(m!=0){var h=s(String(m),3);h=h.replace(/[0]+$/,""),y=y+"."+h}}return y+"Z"},this.zeroPadding=function(t,n){return t.length>=n?t:new Array(n-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,n,r,s,i,u){var a=new Date(Date.UTC(t,n-1,r,s,i,u,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}};M.lang.extend(p.asn1.DERAbstractTime,p.asn1.ASN1Object);p.asn1.DERAbstractStructured=function(e){p.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,typeof e<"u"&&typeof e.array<"u"&&(this.asn1Array=e.array)};M.lang.extend(p.asn1.DERAbstractStructured,p.asn1.ASN1Object);p.asn1.DERBoolean=function(){p.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"};M.lang.extend(p.asn1.DERBoolean,p.asn1.ASN1Object);p.asn1.DERInteger=function(e){p.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var n=new C(String(t),10);this.setByBigInteger(n)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e.bigint<"u"?this.setByBigInteger(e.bigint):typeof e.int<"u"?this.setByInteger(e.int):typeof e=="number"?this.setByInteger(e):typeof e.hex<"u"&&this.setValueHex(e.hex))};M.lang.extend(p.asn1.DERInteger,p.asn1.ASN1Object);p.asn1.DERBitString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=p.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}p.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(n){this.hTLV=null,this.isModified=!0,this.hV=n},this.setUnusedBitsAndHexValue=function(n,r){if(n<0||7<n)throw"unused bits shall be from 0 to 7: u = "+n;var s="0"+n;this.hTLV=null,this.isModified=!0,this.hV=s+r},this.setByBinaryString=function(n){n=n.replace(/0+$/,"");var r=8-n.length%8;r==8&&(r=0);for(var s=0;s<=r;s++)n+="0";for(var i="",s=0;s<n.length-1;s+=8){var u=n.substr(s,8),a=parseInt(u,2).toString(16);a.length==1&&(a="0"+a),i+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+r+i},this.setByBooleanArray=function(n){for(var r="",s=0;s<n.length;s++)n[s]==!0?r+="1":r+="0";this.setByBinaryString(r)},this.newFalseArray=function(n){for(var r=new Array(n),s=0;s<n;s++)r[s]=!1;return r},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e=="string"&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):typeof e.hex<"u"?this.setHexValueIncludingUnusedBits(e.hex):typeof e.bin<"u"?this.setByBinaryString(e.bin):typeof e.array<"u"&&this.setByBooleanArray(e.array))};M.lang.extend(p.asn1.DERBitString,p.asn1.ASN1Object);p.asn1.DEROctetString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=p.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}p.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"};M.lang.extend(p.asn1.DEROctetString,p.asn1.DERAbstractString);p.asn1.DERNull=function(){p.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"};M.lang.extend(p.asn1.DERNull,p.asn1.ASN1Object);p.asn1.DERObjectIdentifier=function(e){var t=function(r){var s=r.toString(16);return s.length==1&&(s="0"+s),s},n=function(r){var s="",i=new C(r,10),u=i.toString(2),a=7-u.length%7;a==7&&(a=0);for(var l="",c=0;c<a;c++)l+="0";u=l+u;for(var c=0;c<u.length-1;c+=7){var d=u.substr(c,7);c!=u.length-7&&(d="1"+d),s+=t(parseInt(d,2))}return s};p.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(r){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueOidString=function(r){if(!r.match(/^[0-9.]+$/))throw"malformed oid string: "+r;var s="",i=r.split("."),u=parseInt(i[0])*40+parseInt(i[1]);s+=t(u),i.splice(0,2);for(var a=0;a<i.length;a++)s+=n(i[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=s},this.setValueName=function(r){var s=p.asn1.x509.OID.name2oid(r);if(s!=="")this.setValueOidString(s);else throw"DERObjectIdentifier oidName undefined: "+r},this.getFreshValueHex=function(){return this.hV},e!==void 0&&(typeof e=="string"?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):e.oid!==void 0?this.setValueOidString(e.oid):e.hex!==void 0?this.setValueHex(e.hex):e.name!==void 0&&this.setValueName(e.name))};M.lang.extend(p.asn1.DERObjectIdentifier,p.asn1.ASN1Object);p.asn1.DEREnumerated=function(e){p.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var n=new C(String(t),10);this.setByBigInteger(n)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e.int<"u"?this.setByInteger(e.int):typeof e=="number"?this.setByInteger(e):typeof e.hex<"u"&&this.setValueHex(e.hex))};M.lang.extend(p.asn1.DEREnumerated,p.asn1.ASN1Object);p.asn1.DERUTF8String=function(e){p.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"};M.lang.extend(p.asn1.DERUTF8String,p.asn1.DERAbstractString);p.asn1.DERNumericString=function(e){p.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"};M.lang.extend(p.asn1.DERNumericString,p.asn1.DERAbstractString);p.asn1.DERPrintableString=function(e){p.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"};M.lang.extend(p.asn1.DERPrintableString,p.asn1.DERAbstractString);p.asn1.DERTeletexString=function(e){p.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"};M.lang.extend(p.asn1.DERTeletexString,p.asn1.DERAbstractString);p.asn1.DERIA5String=function(e){p.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"};M.lang.extend(p.asn1.DERIA5String,p.asn1.DERAbstractString);p.asn1.DERUTCTime=function(e){p.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return typeof this.date>"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},e!==void 0&&(e.str!==void 0?this.setString(e.str):typeof e=="string"&&e.match(/^[0-9]{12}Z$/)?this.setString(e):e.hex!==void 0?this.setStringHex(e.hex):e.date!==void 0&&this.setByDate(e.date))};M.lang.extend(p.asn1.DERUTCTime,p.asn1.DERAbstractTime);p.asn1.DERGeneralizedTime=function(e){p.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},e!==void 0&&(e.str!==void 0?this.setString(e.str):typeof e=="string"&&e.match(/^[0-9]{14}Z$/)?this.setString(e):e.hex!==void 0?this.setStringHex(e.hex):e.date!==void 0&&this.setByDate(e.date),e.millis===!0&&(this.withMillis=!0))};M.lang.extend(p.asn1.DERGeneralizedTime,p.asn1.DERAbstractTime);p.asn1.DERSequence=function(e){p.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var t="",n=0;n<this.asn1Array.length;n++){var r=this.asn1Array[n];t+=r.getEncodedHex()}return this.hV=t,this.hV}};M.lang.extend(p.asn1.DERSequence,p.asn1.DERAbstractStructured);p.asn1.DERSet=function(e){p.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,n=0;n<this.asn1Array.length;n++){var r=this.asn1Array[n];t.push(r.getEncodedHex())}return this.sortFlag==!0&&t.sort(),this.hV=t.join(""),this.hV},typeof e<"u"&&typeof e.sortflag<"u"&&e.sortflag==!1&&(this.sortFlag=!1)};M.lang.extend(p.asn1.DERSet,p.asn1.DERAbstractStructured);p.asn1.DERTaggedObject=function(e){p.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,n,r){this.hT=n,this.isExplicit=t,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,n),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e.tag<"u"&&(this.hT=e.tag),typeof e.explicit<"u"&&(this.isExplicit=e.explicit),typeof e.obj<"u"&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))};M.lang.extend(p.asn1.DERTaggedObject,p.asn1.ASN1Object);var qo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qn=function(e){qo(t,e);function t(n){var r=e.call(this)||this;return n&&(typeof n=="string"?r.parseKey(n):(t.hasPrivateKeyProperty(n)||t.hasPublicKeyProperty(n))&&r.parsePropertiesFrom(n)),r}return t.prototype.parseKey=function(n){try{var r=0,s=0,i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,u=i.test(n)?xo.decode(n):Vt.unarmor(n),a=Ro.decode(u);if(a.sub.length===3&&(a=a.sub[2].sub[0]),a.sub.length===9){r=a.sub[1].getHexStringValue(),this.n=k(r,16),s=a.sub[2].getHexStringValue(),this.e=parseInt(s,16);var l=a.sub[3].getHexStringValue();this.d=k(l,16);var c=a.sub[4].getHexStringValue();this.p=k(c,16);var d=a.sub[5].getHexStringValue();this.q=k(d,16);var v=a.sub[6].getHexStringValue();this.dmp1=k(v,16);var y=a.sub[7].getHexStringValue();this.dmq1=k(y,16);var m=a.sub[8].getHexStringValue();this.coeff=k(m,16)}else if(a.sub.length===2)if(a.sub[0].sub){var h=a.sub[1],S=h.sub[0];r=S.sub[0].getHexStringValue(),this.n=k(r,16),s=S.sub[1].getHexStringValue(),this.e=parseInt(s,16)}else r=a.sub[0].getHexStringValue(),this.n=k(r,16),s=a.sub[1].getHexStringValue(),this.e=parseInt(s,16);else return!1;return!0}catch{return!1}},t.prototype.getPrivateBaseKey=function(){var n={array:[new p.asn1.DERInteger({int:0}),new p.asn1.DERInteger({bigint:this.n}),new p.asn1.DERInteger({int:this.e}),new p.asn1.DERInteger({bigint:this.d}),new p.asn1.DERInteger({bigint:this.p}),new p.asn1.DERInteger({bigint:this.q}),new p.asn1.DERInteger({bigint:this.dmp1}),new p.asn1.DERInteger({bigint:this.dmq1}),new p.asn1.DERInteger({bigint:this.coeff})]},r=new p.asn1.DERSequence(n);return r.getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return rt(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var n=new p.asn1.DERSequence({array:[new p.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new p.asn1.DERNull]}),r=new p.asn1.DERSequence({array:[new p.asn1.DERInteger({bigint:this.n}),new p.asn1.DERInteger({int:this.e})]}),s=new p.asn1.DERBitString({hex:"00"+r.getEncodedHex()}),i=new p.asn1.DERSequence({array:[n,s]});return i.getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return rt(this.getPublicBaseKey())},t.wordwrap=function(n,r){if(r=r||64,!n)return n;var s="(.{1,"+r+`})( +|$
|
|
26
|
+
*/var p={};(typeof p.asn1>"u"||!p.asn1)&&(p.asn1={});p.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if(t.substr(0,1)!="-")t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1),r=n.length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var s="",i=0;i<r;i++)s+="f";var u=new C(s,16),a=u.xor(e).add(C.ONE);t=a.toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=p,n=t.asn1,r=n.DERBoolean,s=n.DERInteger,i=n.DERBitString,u=n.DEROctetString,a=n.DERNull,l=n.DERObjectIdentifier,c=n.DEREnumerated,d=n.DERUTF8String,v=n.DERNumericString,y=n.DERPrintableString,m=n.DERTeletexString,h=n.DERIA5String,S=n.DERUTCTime,T=n.DERGeneralizedTime,b=n.DERSequence,E=n.DERSet,A=n.DERTaggedObject,N=n.ASN1Util.newObject,$=Object.keys(e);if($.length!=1)throw"key of param shall be only one.";var w=$[0];if(":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":")==-1)throw"undefined key: "+w;if(w=="bool")return new r(e[w]);if(w=="int")return new s(e[w]);if(w=="bitstr")return new i(e[w]);if(w=="octstr")return new u(e[w]);if(w=="null")return new a(e[w]);if(w=="oid")return new l(e[w]);if(w=="enum")return new c(e[w]);if(w=="utf8str")return new d(e[w]);if(w=="numstr")return new v(e[w]);if(w=="prnstr")return new y(e[w]);if(w=="telstr")return new m(e[w]);if(w=="ia5str")return new h(e[w]);if(w=="utctime")return new S(e[w]);if(w=="gentime")return new T(e[w]);if(w=="seq"){for(var L=e[w],I=[],O=0;O<L.length;O++){var q=N(L[O]);I.push(q)}return new b({array:I})}if(w=="set"){for(var L=e[w],I=[],O=0;O<L.length;O++){var q=N(L[O]);I.push(q)}return new E({array:I})}if(w=="tag"){var V=e[w];if(Object.prototype.toString.call(V)==="[object Array]"&&V.length==3){var R=N(V[2]);return new A({tag:V[0],explicit:V[1],obj:R})}else{var Z={};if(V.explicit!==void 0&&(Z.explicit=V.explicit),V.tag!==void 0&&(Z.tag=V.tag),V.obj===void 0)throw"obj shall be specified for 'tag'.";return Z.obj=N(V.obj),new A(Z)}}},this.jsonToASN1HEX=function(e){var t=this.newObject(e);return t.getEncodedHex()}};p.asn1.ASN1Util.oidHexToInt=function(e){for(var s="",t=parseInt(e.substr(0,2),16),n=Math.floor(t/40),r=t%40,s=n+"."+r,i="",u=2;u<e.length;u+=2){var a=parseInt(e.substr(u,2),16),l=("00000000"+a.toString(2)).slice(-8);if(i=i+l.substr(1,7),l.substr(0,1)=="0"){var c=new C(i,2);s=s+"."+c.toString(10),i=""}}return s};p.asn1.ASN1Util.oidIntToHex=function(e){var t=function(a){var l=a.toString(16);return l.length==1&&(l="0"+l),l},n=function(a){var l="",c=new C(a,10),d=c.toString(2),v=7-d.length%7;v==7&&(v=0);for(var y="",m=0;m<v;m++)y+="0";d=y+d;for(var m=0;m<d.length-1;m+=7){var h=d.substr(m,7);m!=d.length-7&&(h="1"+h),l+=t(parseInt(h,2))}return l};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",s=e.split("."),i=parseInt(s[0])*40+parseInt(s[1]);r+=t(i),s.splice(0,2);for(var u=0;u<s.length;u++)r+=n(s[u]);return r};p.asn1.ASN1Object=function(){var e="";this.getLengthHexFromValue=function(){if(typeof this.hV>"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+e.length+",v="+this.hV;var t=this.hV.length/2,n=t.toString(16);if(n.length%2==1&&(n="0"+n),t<128)return n;var r=n.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var s=128+r;return s.toString(16)+n},this.getEncodedHex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}};p.asn1.DERAbstractString=function(e){p.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e=="string"?this.setString(e):typeof e.str<"u"?this.setString(e.str):typeof e.hex<"u"&&this.setStringHex(e.hex))};M.lang.extend(p.asn1.DERAbstractString,p.asn1.ASN1Object);p.asn1.DERAbstractTime=function(e){p.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+t.getTimezoneOffset()*6e4;var n=new Date(utc);return n},this.formatDate=function(t,n,r){var s=this.zeroPadding,i=this.localDateToUTC(t),u=String(i.getFullYear());n=="utc"&&(u=u.substr(2,2));var a=s(String(i.getMonth()+1),2),l=s(String(i.getDate()),2),c=s(String(i.getHours()),2),d=s(String(i.getMinutes()),2),v=s(String(i.getSeconds()),2),y=u+a+l+c+d+v;if(r===!0){var m=i.getMilliseconds();if(m!=0){var h=s(String(m),3);h=h.replace(/[0]+$/,""),y=y+"."+h}}return y+"Z"},this.zeroPadding=function(t,n){return t.length>=n?t:new Array(n-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,n,r,s,i,u){var a=new Date(Date.UTC(t,n-1,r,s,i,u,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}};M.lang.extend(p.asn1.DERAbstractTime,p.asn1.ASN1Object);p.asn1.DERAbstractStructured=function(e){p.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,typeof e<"u"&&typeof e.array<"u"&&(this.asn1Array=e.array)};M.lang.extend(p.asn1.DERAbstractStructured,p.asn1.ASN1Object);p.asn1.DERBoolean=function(){p.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"};M.lang.extend(p.asn1.DERBoolean,p.asn1.ASN1Object);p.asn1.DERInteger=function(e){p.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var n=new C(String(t),10);this.setByBigInteger(n)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e.bigint<"u"?this.setByBigInteger(e.bigint):typeof e.int<"u"?this.setByInteger(e.int):typeof e=="number"?this.setByInteger(e):typeof e.hex<"u"&&this.setValueHex(e.hex))};M.lang.extend(p.asn1.DERInteger,p.asn1.ASN1Object);p.asn1.DERBitString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=p.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}p.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(n){this.hTLV=null,this.isModified=!0,this.hV=n},this.setUnusedBitsAndHexValue=function(n,r){if(n<0||7<n)throw"unused bits shall be from 0 to 7: u = "+n;var s="0"+n;this.hTLV=null,this.isModified=!0,this.hV=s+r},this.setByBinaryString=function(n){n=n.replace(/0+$/,"");var r=8-n.length%8;r==8&&(r=0);for(var s=0;s<=r;s++)n+="0";for(var i="",s=0;s<n.length-1;s+=8){var u=n.substr(s,8),a=parseInt(u,2).toString(16);a.length==1&&(a="0"+a),i+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+r+i},this.setByBooleanArray=function(n){for(var r="",s=0;s<n.length;s++)n[s]==!0?r+="1":r+="0";this.setByBinaryString(r)},this.newFalseArray=function(n){for(var r=new Array(n),s=0;s<n;s++)r[s]=!1;return r},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e=="string"&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):typeof e.hex<"u"?this.setHexValueIncludingUnusedBits(e.hex):typeof e.bin<"u"?this.setByBinaryString(e.bin):typeof e.array<"u"&&this.setByBooleanArray(e.array))};M.lang.extend(p.asn1.DERBitString,p.asn1.ASN1Object);p.asn1.DEROctetString=function(e){if(e!==void 0&&typeof e.obj<"u"){var t=p.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}p.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"};M.lang.extend(p.asn1.DEROctetString,p.asn1.DERAbstractString);p.asn1.DERNull=function(){p.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"};M.lang.extend(p.asn1.DERNull,p.asn1.ASN1Object);p.asn1.DERObjectIdentifier=function(e){var t=function(r){var s=r.toString(16);return s.length==1&&(s="0"+s),s},n=function(r){var s="",i=new C(r,10),u=i.toString(2),a=7-u.length%7;a==7&&(a=0);for(var l="",c=0;c<a;c++)l+="0";u=l+u;for(var c=0;c<u.length-1;c+=7){var d=u.substr(c,7);c!=u.length-7&&(d="1"+d),s+=t(parseInt(d,2))}return s};p.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(r){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueOidString=function(r){if(!r.match(/^[0-9.]+$/))throw"malformed oid string: "+r;var s="",i=r.split("."),u=parseInt(i[0])*40+parseInt(i[1]);s+=t(u),i.splice(0,2);for(var a=0;a<i.length;a++)s+=n(i[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=s},this.setValueName=function(r){var s=p.asn1.x509.OID.name2oid(r);if(s!=="")this.setValueOidString(s);else throw"DERObjectIdentifier oidName undefined: "+r},this.getFreshValueHex=function(){return this.hV},e!==void 0&&(typeof e=="string"?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):e.oid!==void 0?this.setValueOidString(e.oid):e.hex!==void 0?this.setValueHex(e.hex):e.name!==void 0&&this.setValueName(e.name))};M.lang.extend(p.asn1.DERObjectIdentifier,p.asn1.ASN1Object);p.asn1.DEREnumerated=function(e){p.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var n=new C(String(t),10);this.setByBigInteger(n)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e.int<"u"?this.setByInteger(e.int):typeof e=="number"?this.setByInteger(e):typeof e.hex<"u"&&this.setValueHex(e.hex))};M.lang.extend(p.asn1.DEREnumerated,p.asn1.ASN1Object);p.asn1.DERUTF8String=function(e){p.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"};M.lang.extend(p.asn1.DERUTF8String,p.asn1.DERAbstractString);p.asn1.DERNumericString=function(e){p.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"};M.lang.extend(p.asn1.DERNumericString,p.asn1.DERAbstractString);p.asn1.DERPrintableString=function(e){p.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"};M.lang.extend(p.asn1.DERPrintableString,p.asn1.DERAbstractString);p.asn1.DERTeletexString=function(e){p.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"};M.lang.extend(p.asn1.DERTeletexString,p.asn1.DERAbstractString);p.asn1.DERIA5String=function(e){p.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"};M.lang.extend(p.asn1.DERIA5String,p.asn1.DERAbstractString);p.asn1.DERUTCTime=function(e){p.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return typeof this.date>"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},e!==void 0&&(e.str!==void 0?this.setString(e.str):typeof e=="string"&&e.match(/^[0-9]{12}Z$/)?this.setString(e):e.hex!==void 0?this.setStringHex(e.hex):e.date!==void 0&&this.setByDate(e.date))};M.lang.extend(p.asn1.DERUTCTime,p.asn1.DERAbstractTime);p.asn1.DERGeneralizedTime=function(e){p.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},e!==void 0&&(e.str!==void 0?this.setString(e.str):typeof e=="string"&&e.match(/^[0-9]{14}Z$/)?this.setString(e):e.hex!==void 0?this.setStringHex(e.hex):e.date!==void 0&&this.setByDate(e.date),e.millis===!0&&(this.withMillis=!0))};M.lang.extend(p.asn1.DERGeneralizedTime,p.asn1.DERAbstractTime);p.asn1.DERSequence=function(e){p.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var t="",n=0;n<this.asn1Array.length;n++){var r=this.asn1Array[n];t+=r.getEncodedHex()}return this.hV=t,this.hV}};M.lang.extend(p.asn1.DERSequence,p.asn1.DERAbstractStructured);p.asn1.DERSet=function(e){p.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,n=0;n<this.asn1Array.length;n++){var r=this.asn1Array[n];t.push(r.getEncodedHex())}return this.sortFlag==!0&&t.sort(),this.hV=t.join(""),this.hV},typeof e<"u"&&typeof e.sortflag<"u"&&e.sortflag==!1&&(this.sortFlag=!1)};M.lang.extend(p.asn1.DERSet,p.asn1.DERAbstractStructured);p.asn1.DERTaggedObject=function(e){p.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,n,r){this.hT=n,this.isExplicit=t,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,n),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},typeof e<"u"&&(typeof e.tag<"u"&&(this.hT=e.tag),typeof e.explicit<"u"&&(this.isExplicit=e.explicit),typeof e.obj<"u"&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))};M.lang.extend(p.asn1.DERTaggedObject,p.asn1.ASN1Object);var qo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qn=function(e){qo(t,e);function t(n){var r=e.call(this)||this;return n&&(typeof n=="string"?r.parseKey(n):(t.hasPrivateKeyProperty(n)||t.hasPublicKeyProperty(n))&&r.parsePropertiesFrom(n)),r}return t.prototype.parseKey=function(n){try{var r=0,s=0,i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,u=i.test(n)?Do.decode(n):Vt.unarmor(n),a=Ro.decode(u);if(a.sub.length===3&&(a=a.sub[2].sub[0]),a.sub.length===9){r=a.sub[1].getHexStringValue(),this.n=k(r,16),s=a.sub[2].getHexStringValue(),this.e=parseInt(s,16);var l=a.sub[3].getHexStringValue();this.d=k(l,16);var c=a.sub[4].getHexStringValue();this.p=k(c,16);var d=a.sub[5].getHexStringValue();this.q=k(d,16);var v=a.sub[6].getHexStringValue();this.dmp1=k(v,16);var y=a.sub[7].getHexStringValue();this.dmq1=k(y,16);var m=a.sub[8].getHexStringValue();this.coeff=k(m,16)}else if(a.sub.length===2)if(a.sub[0].sub){var h=a.sub[1],S=h.sub[0];r=S.sub[0].getHexStringValue(),this.n=k(r,16),s=S.sub[1].getHexStringValue(),this.e=parseInt(s,16)}else r=a.sub[0].getHexStringValue(),this.n=k(r,16),s=a.sub[1].getHexStringValue(),this.e=parseInt(s,16);else return!1;return!0}catch{return!1}},t.prototype.getPrivateBaseKey=function(){var n={array:[new p.asn1.DERInteger({int:0}),new p.asn1.DERInteger({bigint:this.n}),new p.asn1.DERInteger({int:this.e}),new p.asn1.DERInteger({bigint:this.d}),new p.asn1.DERInteger({bigint:this.p}),new p.asn1.DERInteger({bigint:this.q}),new p.asn1.DERInteger({bigint:this.dmp1}),new p.asn1.DERInteger({bigint:this.dmq1}),new p.asn1.DERInteger({bigint:this.coeff})]},r=new p.asn1.DERSequence(n);return r.getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return rt(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var n=new p.asn1.DERSequence({array:[new p.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new p.asn1.DERNull]}),r=new p.asn1.DERSequence({array:[new p.asn1.DERInteger({bigint:this.n}),new p.asn1.DERInteger({int:this.e})]}),s=new p.asn1.DERBitString({hex:"00"+r.getEncodedHex()}),i=new p.asn1.DERSequence({array:[n,s]});return i.getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return rt(this.getPublicBaseKey())},t.wordwrap=function(n,r){if(r=r||64,!n)return n;var s="(.{1,"+r+`})( +|$
|
|
27
27
|
?)|(.{1,`+r+"})";return n.match(RegExp(s,"g")).join(`
|
|
28
28
|
`)},t.prototype.getPrivateKey=function(){var n=`-----BEGIN RSA PRIVATE KEY-----
|
|
29
29
|
`;return n+=t.wordwrap(this.getPrivateBaseKeyB64())+`
|
|
30
30
|
`,n+="-----END RSA PRIVATE KEY-----",n},t.prototype.getPublicKey=function(){var n=`-----BEGIN PUBLIC KEY-----
|
|
31
31
|
`;return n+=t.wordwrap(this.getPublicBaseKeyB64())+`
|
|
32
|
-
`,n+="-----END PUBLIC KEY-----",n},t.hasPublicKeyProperty=function(n){return n=n||{},n.hasOwnProperty("n")&&n.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(n){return n=n||{},n.hasOwnProperty("n")&&n.hasOwnProperty("e")&&n.hasOwnProperty("d")&&n.hasOwnProperty("p")&&n.hasOwnProperty("q")&&n.hasOwnProperty("dmp1")&&n.hasOwnProperty("dmq1")&&n.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(n){this.n=n.n,this.e=n.e,n.hasOwnProperty("d")&&(this.d=n.d,this.p=n.p,this.q=n.q,this.dmp1=n.dmp1,this.dmq1=n.dmq1,this.coeff=n.coeff)},t}(zo),
|
|
32
|
+
`,n+="-----END PUBLIC KEY-----",n},t.hasPublicKeyProperty=function(n){return n=n||{},n.hasOwnProperty("n")&&n.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(n){return n=n||{},n.hasOwnProperty("n")&&n.hasOwnProperty("e")&&n.hasOwnProperty("d")&&n.hasOwnProperty("p")&&n.hasOwnProperty("q")&&n.hasOwnProperty("dmp1")&&n.hasOwnProperty("dmq1")&&n.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(n){this.n=n.n,this.e=n.e,n.hasOwnProperty("d")&&(this.d=n.d,this.p=n.p,this.q=n.q,this.dmp1=n.dmp1,this.dmq1=n.dmq1,this.coeff=n.coeff)},t}(zo),Bt,jo=typeof process<"u"?(Bt=process.env)===null||Bt===void 0?void 0:Bt.npm_package_version:void 0,dt=function(){function e(t){t===void 0&&(t={}),t=t||{},this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return e.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new qn(t)},e.prototype.setPrivateKey=function(t){this.setKey(t)},e.prototype.setPublicKey=function(t){this.setKey(t)},e.prototype.decrypt=function(t){try{return this.getKey().decrypt(Ln(t))}catch{return!1}},e.prototype.encrypt=function(t){try{return rt(this.getKey().encrypt(t))}catch{return!1}},e.prototype.sign=function(t,n,r){try{return rt(this.getKey().sign(t,n,r))}catch{return!1}},e.prototype.verify=function(t,n,r){try{return this.getKey().verify(t,Ln(n),r)}catch{return!1}},e.prototype.getKey=function(t){if(!this.key){if(this.key=new qn,t&&{}.toString.call(t)==="[object Function]"){this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version=jo,e}();function Wo(){const e=new dt({default_key_size:"2048"});return{publicKey:e.getPublicKey(),privateKey:e.getPrivateKey()}}function Re(e,t){const n=new dt;return n.setPublicKey(t),n.encrypt(e)||""}function Gr(e,t){const n=new dt;return n.setPrivateKey(t),n.decrypt(e)||""}function jn(){return typeof new dt().encrypt=="function"}const Yr=f.useLoginState(f.pinia),{superAdminInfo:Go,cryptoInfo:K,loginUserInfo:xt}=f.storeToRefs(Yr),Yo=Wt(f.pinia),{activeMenuPath:Oe}=f.storeToRefs(Yo),Ft=Gt(f.pinia),Te="123456",Zo=Yt(f.pinia),{routerPageStructures:Xo}=f.storeToRefs(Zo),sn=o.ref(0),Jo=o.ref([{label:"用户名称",value:"",name:"userName"}]),be=o.computed(()=>{const e=sessionStorage.getItem("isSuperAdmin");return e?JSON.parse(e):!1}),Qo=e=>{console.log("handleQueryChange",e)},st=o.ref([]),Zr=o.ref(""),it=o.computed(()=>{var t,n,r,s,i;const e=(t=Xo.value)==null?void 0:t.find(u=>{var a;return((a=u==null?void 0:u.comp)==null?void 0:a.toUpperCase())==="TABLE"});return e?(Zr.value=e.name,st.value=(s=(r=(n=e==null?void 0:e.compData)==null?void 0:n.find(a=>(a==null?void 0:a.key)==="header"))==null?void 0:r.contents)==null?void 0:s.filter(a=>(a==null?void 0:a.label)!=="操作"),(i=e==null?void 0:e.compData)==null?void 0:i.map(a=>{var l;if((a==null?void 0:a.key)==="rowButton"){const c=[...a==null?void 0:a.contents,{label:"重置密码"}];return{...a,contents:c}}return(a==null?void 0:a.key)==="header"?{...a,contents:(l=a==null?void 0:a.contents)==null?void 0:l.map(c=>{var d,v,y,m;return{...c,isTableColHidden:((d=c==null?void 0:c.prop)==null?void 0:d.includes("头像"))||((v=c==null?void 0:c.prop)==null?void 0:v.includes("签名")),isFormColHidden:((y=c==null?void 0:c.prop)==null?void 0:y.includes("头像"))||((m=c==null?void 0:c.prop)==null?void 0:m.includes("签名"))}})}:a})):[]}),ea=e=>{Ft.setRefreshCurStructure(!1),pt(e.singleContent,e.buttonName,sn.value,e==null?void 0:e.selectItems)},Lt=o.ref(),ta=e=>{console.log("onDoubleClick",e)},na=(e,t)=>{e==="重置密码"&&kr.confirm(`该操作将会重置【${(t==null?void 0:t.account)||(t==null?void 0:t.账号)}】的密码为【${Te}】,确认重置?`,"警告",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{Lt.value={...t,password:Te},pt(Lt.value,e,sn.value)}).catch(()=>{f.ElMessage.info("取消重置")})},ra=()=>{on(Oe.value).then(e=>{var n;const t=Array.isArray(e)&&(e==null?void 0:e.filter(r=>(r==null?void 0:r.account)!==Go.value.account));it.value=(n=it.value)==null?void 0:n.map(r=>r.key==="tableContents"?{...r,contents:t==null?void 0:t.map(s=>{var i;return{...s,password:Gr(s==null?void 0:s.password,(i=K==null?void 0:K.value)==null?void 0:i.privateKey)}})}:r)})},Ce=async(e,t,n)=>{var r,s;try{const i=await e(t);return((r=i==null?void 0:i.data)==null?void 0:r.code)===200?(n!=="查询"&&await Yr.setLogRecordAsync({type:n,data:t},Oe.value),f.ElMessage.success("保存成功"),Ft.setRefreshCurStructure(!0),i.data.result||((s=i==null?void 0:i.data)==null?void 0:s.code)===200):null}catch(i){f.ElMessage.error(i)}finally{Ft.setCacheUpdatingData(null)}},sa=async(e,t)=>{var i,u;let n=[];Array.isArray(e)?n=f.cloneDeep(e):n=[f.cloneDeep(e)];const r=(i=n==null?void 0:n.filter(a=>typeof(a==null?void 0:a.id)=="string"))==null?void 0:i.map(a=>{var c,d,v,y,m,h,S;const l=Fe(a,st.value);return jn()&&l&&(!l.password&&be.value?l.password=Re(Te,(c=K==null?void 0:K.value)==null?void 0:c.publicKey):l.password&&be.value&&(l.password=Re(l==null?void 0:l.password,(d=K==null?void 0:K.value)==null?void 0:d.publicKey))),{key:{type:"data",layer:a==null?void 0:a.layer,systemKey:sessionStorage.getItem("systemKey"),pageKey:(v=Oe.value)!=null&&v.startsWith("/")?(y=Oe.value)==null?void 0:y.substring(1):Oe.value,tableId:t,createUserId:(m=xt.value)==null?void 0:m.id,createUserOrg:((h=xt.value)==null?void 0:h.dept)||((S=xt.value)==null?void 0:S.部门名称)},value:{tableData:l}}}),s=(u=n==null?void 0:n.filter(a=>typeof(a==null?void 0:a.id)=="number"))==null?void 0:u.map(a=>{var c,d;const l=Fe(a,st.value);return jn()&&l&&(!l.password&&be.value?l.password=Re(Te,(c=K==null?void 0:K.value)==null?void 0:c.publicKey):l.password&&be.value&&(l.password=Re(l==null?void 0:l.password,(d=K==null?void 0:K.value)==null?void 0:d.publicKey))),{id:a==null?void 0:a.id,value:{tableData:l}}});r.length>0&&await Ce(f.batchAddInsofDataApi,{dataList:r},"新增"),s.length>0&&(await Ce(f.batchUpdateInsofDataApi,{dataList:s},"编辑"),ce.show=!1)},pt=async(e,t,n,r)=>{if(!(t!=null&&t.includes("删除")))await sa(e,n);else{let s=[];t!=null&&t.includes("批量")?s=r&&(r==null?void 0:r.length)>0?r==null?void 0:r.map(i=>i==null?void 0:i.id):[]:s=[e==null?void 0:e.id],await Ce(f.batchDeleteInsofDataApi,{ids:s},"编辑")}},on=async e=>{const t=await Ce(f.getInsofDataApi,{key:{systemKey:sessionStorage.getItem("systemKey"),type:"data",pageKey:e}},"查询"),n=t==null?void 0:t.map(r=>{var s,i;return{id:r.id,layer:(s=r.key)==null?void 0:s.layer,tableData:(i=r==null?void 0:r.value)==null?void 0:i.tableData}});return n==null?void 0:n.map(r=>{var s;if(!Array.isArray(r==null?void 0:r.tableData))return{...r.tableData,layer:(s=r.key)==null?void 0:s.layer,id:r.id}})},ia={comp:"Group",name:"/系统管理/用户管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:it.value,name:""}]}]},oa=Object.freeze(Object.defineProperty({__proto__:null,changedRow:Lt,clickRowButton:na,columns:st,compName:Zr,getPageDataAsync:on,handleItemDataChange:ea,handleQueryChange:Qo,handleSubmitAsync:Ce,loginUserIsSuper:be,onDoubleClick:ta,pageData:it,queryFormData:Jo,refreshUserTableData:ra,resetPassword:Te,structureId:sn,submitTableAsyncByVerify:pt,tempUserPageData:ia},Symbol.toStringTag,{value:"Module"}));exports.CHANGE_EVENT=Dt;exports.ElButton=Tr;exports.ElButtonGroup=Bi;exports.ElFocusTrap=gr;exports.ElInput=dr;exports.ElMessageBox=kr;exports.ElOverlay=Ar;exports.FOCUS_TRAP_INJECTION_KEY=pr;exports.INPUT_EVENT=Je;exports.PatchFlags=Ne;exports.State=oa;exports.State$1=To;exports.TinyColor=Er;exports.UPDATE_MODEL_EVENT=Me;exports.addPathToTree=ct;exports.animateScrollTo=As;exports.baseFlatten=Ht;exports.buttonTypes=br;exports.cAF=tr;exports.convertArrayToTree=Jt;exports.decryptData=Gr;exports.encryptData=Re;exports.flatRest=Xn;exports.flattedChildren=ke;exports.flatten=Zn;exports.focusElement=$t;exports.focusNode=_s;exports.formContextKey=ot;exports.formItemContextKey=_t;exports.generateKeyPair=Wo;exports.getActivePageStructureId=zr;exports.getFirstArrayProperty=Xt;exports.getLeafNodesRecursive=en;exports.getNormalizedProps=Ii;exports.getPageDataAsync=on;exports.getScrollBarWidth=nr;exports.getScrollContainer=Ts;exports.getScrollElement=Bs;exports.getScrollTop=xs;exports.getSibling=Hs;exports.groupByField=Qt;exports.handleRowAuthorityRender=tn;exports.handleSubmitAsync=Ce;exports.hasIn=Jn;exports.identity=Wn;exports.inputProps=sr;exports.isFocusable=ut;exports.isFragment=Cr;exports.isLeaf=lr;exports.isValidComponentSize=Dr;exports.isValidElementNode=ki;exports.overRest=Yn;exports.pick=Qn;exports.rAF=er;exports.resetPassword=Te;exports.scrollIntoView=Cs;exports.setToString=Gn;exports.submitTableAsyncByVerify=pt;exports.triggerEvent=Ls;exports.useAriaProps=rr;exports.useAttrs=ir;exports.useAuthorityState=Yt;exports.useComposition=fr;exports.useDeprecated=mr;exports.useDraggable=Br;exports.useFocusController=cr;exports.useFormDisabled=at;exports.useFormItem=zt;exports.useFormItemInputId=ar;exports.useFormSize=Kt;exports.useId=tt;exports.useIdInjection=or;exports.useLockscreen=xr;exports.useMenuState=Wt;exports.useModelComp=Gt;exports.useSameTarget=jt;
|