@jari-ace/element-plus-component 0.5.1 → 0.5.2
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/hooks/useRouteableVisible.d.ts +12 -0
- package/dist/hooks/useRouteableVisible.d.ts.map +1 -0
- package/dist/hooks/useRouteableVisible.js +34 -0
- package/dist/hooks/useRouteableVisible.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/lib/index.js +221 -194
- package/lib/index.umd.cjs +8 -4
- package/package.json +1 -1
- package/packages/hooks/useRouteableVisible.ts +35 -0
- package/packages/index.ts +1 -0
package/lib/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(el,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("vue"),require("@jari-ace/app-bolts"),require("@element-plus/icons-vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","@jari-ace/app-bolts","@element-plus/icons-vue","element-plus"],U):(el=typeof globalThis<"u"?globalThis:el||self,U(el.Lib={},el.vue,el.jariAceAppBolts,el.elementPlusIconVue,el.elementPlus))})(this,(function(el,U,$,ml,v){"use strict";var lg=Object.defineProperty;var iX=el=>{throw TypeError(el)};var tg=(el,U,$)=>U in el?lg(el,U,{enumerable:!0,configurable:!0,writable:!0,value:$}):el[U]=$;var f=(el,U,$)=>tg(el,typeof U!="symbol"?U+"":U,$),Fb=(el,U,$)=>U.has(el)||iX("Cannot "+$);var H=(el,U,$)=>(Fb(el,U,"read from private field"),$?$.call(el):U.get(el)),al=(el,U,$)=>U.has(el)?iX("Cannot add the same private member more than once"):U instanceof WeakSet?U.add(el):U.set(el,$),hl=(el,U,$,ml)=>(Fb(el,U,"write to private field"),ml?ml.call(el,$):U.set(el,$),$),Zl=(el,U,$)=>(Fb(el,U,"access private method"),$);var Bn,Od,Yn,WU,vd,QU,ds,At,ob,j0,sX,cX,UX,qW,mU,X0,B0,hb,fd,Y0,k0,NU,lQ,ZX,od,hd,z0,ns,RU,rU,as,Wl,os,Vb,FX,oX,hX,Wb,Qb,mb,Nb,tQ,Rb,is,VX,WX,Ya,L0,O0,QX,rb,v0,I0,ka,mX,NX,RX,D0,za,dQ,bU,Vd,uU,Ne,Re,ss,Wd,w0,pU,rX,MU,nQ,E0,aQ,iQ,cs,bX,sQ,SU,La,Kd,Us,kn,C0,cQ,uX,TU,Zs,x0,JU,UQ,ZQ,FQ,Fs,oQ,hQ,GU,Ia,bb,ub;var hs=typeof document<"u"?document.currentScript:null;const Nl=(e,l)=>(e.install=t=>{for(const d of[e,...Object.values({})])t.component(d.name,d)},e);let Pd=U.ref(),XU;async function H0(e){if(Pd.value)return Pd.value;if(XU)return await XU;e||(e="ace-global-app");const l=$.createAxiosWithoutCache();return XU=$.useAppServiceApi(l).getClassificationLevels(e).then(d=>(d&&(d.system&&d.system.sort((n,a)=>a.value-n.value),d.user&&d.user.sort((n,a)=>a.value-n.value)),Pd.value=d,d)).finally(()=>XU=void 0),await XU}async function Sb(e){return await H0(e),Pd.value.system}async function kX(e){return await H0(e),Pd.value.user}async function zX(e){await H0(e);const l=new Map;for(let t=0;t<Pd.value.user.length;t++){const d=Pd.value.user[t];l.set(d.value,d.label)}return l}async function Tb(e){await H0(e);const l=new Map;for(let t=0;t<Pd.value.system.length;t++){const d=Pd.value.system[t];l.set(d.value,d.label)}return l}function mQ(e,l){return Object.hasOwn(e,l)}function LX(e,l,t){return new Promise(d=>{e.toBlob(d,l,t)})}const IX=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function DX(e,l,t){const d=IX.exec(e),n=l.mimeType??(d==null?void 0:d[1])??"plain/text";let a;if((d==null?void 0:d[2])!=null){const i=atob(decodeURIComponent(d[3])),s=new Uint8Array(i.length);for(let c=0;c<i.length;c++)s[c]=i.charCodeAt(c);a=[s]}else(d==null?void 0:d[3])!=null&&(a=[decodeURIComponent(d[3])]);return new Blob(a,{type:n})}function Jb(e,l,t,d){return e===l?e:d===0?l:e+(l-e)*2**(-d/t)}const Gb=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];class wX extends Error{constructor(t,d=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.");f(this,"cause");f(this,"isNetworkError");f(this,"request");this.cause=t,this.isNetworkError=!0,this.request=d}}function EX(e){const l=t=>"error"in t&&!!t.error;return e.filter(t=>!l(t))}function CX(e){return e.filter(l=>{var t;return!((t=l.progress)!=null&&t.uploadStarted)||!l.isRestored})}function yb(e){return typeof e!="object"||e===null||!("nodeType"in e)?!1:e.nodeType===Node.ELEMENT_NODE}function Xb(e){if(typeof e=="string"){const l=document.querySelectorAll(e);return l.length===0?null:Array.from(l)}return typeof e=="object"&&yb(e)?[e]:null}function xX(e,l=document){return typeof e=="string"?l.querySelector(e):yb(e)?e:null}function Bb(e){const l=e.lastIndexOf(".");return l===-1||l===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,l),extension:e.slice(l+1)}}const NQ={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Yb(e){var t;if(e.type)return e.type;const l=e.name?(t=Bb(e.name).extension)==null?void 0:t.toLowerCase():null;return l&&l in NQ?NQ[l]:"application/octet-stream"}function gX(e){return e.charCodeAt(0).toString(32)}function kb(e){let l="";return e.replace(/[^A-Z0-9]/gi,t=>(l+=`-${gX(t)}`,"/"))+l}function jX(e,l){var d;let t=l||"uppy";return typeof e.name=="string"&&(t+=`-${kb(e.name.toLowerCase())}`),e.type!==void 0&&(t+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(t+=`-${kb(e.meta.relativePath.toLowerCase())}`),((d=e.data)==null?void 0:d.size)!==void 0&&(t+=`-${e.data.size}`),e.data.lastModified!==void 0&&(t+=`-${e.data.lastModified}`),t}function OX(e){return!e.isRemote||!e.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}function vX(e,l){if(OX(e))return e.id;const t=Yb(e);return jX({...e,type:t},l)}function fX(e,l){return e===!0?Object.keys(l):Array.isArray(e)?e:[]}const BU=Array.from;function KX(e){const l=BU(e.files);return Promise.resolve(l)}function zb(e,l,t,{onSuccess:d}){e.readEntries(n=>{const a=[...l,...n];n.length?queueMicrotask(()=>{zb(e,a,t,{onSuccess:d})}):d(a)},n=>{t(n),d(l)})}function Lb(e,l){return e==null?e:{kind:e.isFile?"file":e.isDirectory?"directory":void 0,name:e.name,getFile(){return new Promise((t,d)=>e.file(t,d))},async*values(){const t=e.createReader();yield*await new Promise(n=>{zb(t,[],l,{onSuccess:a=>n(a.map(i=>Lb(i,l)))})})},isSameEntry:void 0}}async function*Ib(e,l,t=void 0){const d=()=>`${l}/${e.name}`;if(e.kind==="file"){const n=await e.getFile();n!=null?(n.relativePath=l?d():null,yield n):t!=null&&(yield t)}else if(e.kind==="directory")for await(const n of e.values())yield*Ib(n,l?d():e.name);else t!=null&&(yield t)}async function*HX(e,l){const t=await Promise.all(Array.from(e.items,async d=>{let n;return n??(n=Lb(typeof d.getAsEntry=="function"?d.getAsEntry():d.webkitGetAsEntry(),l)),{fileSystemHandle:n,lastResortFile:d.getAsFile()}}));for(const{lastResortFile:d,fileSystemHandle:n}of t)if(n!=null)try{yield*Ib(n,"",d)}catch(a){d!=null?yield d:l(a)}else d!=null&&(yield d)}async function PX(e,l){const t=(l==null?void 0:l.logDropError)??Function.prototype;try{const d=[];for await(const n of HX(e,t))d.push(n);return d}catch{return KX(e)}}const AX={__proto__:null,"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/webp":"webp","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};function wa(e){return[e]=e.split(";",1),AX[e]||null}function _X(e){for(;e&&!e.dir;)e=e.parentNode;return e==null?void 0:e.dir}function RQ(e){return e<10?`0${e}`:e.toString()}function P0(){const e=new Date,l=RQ(e.getHours()),t=RQ(e.getMinutes()),d=RQ(e.getSeconds());return`${l}:${t}:${d}`}function qX(){if(typeof window>"u")return!1;const e=document.body;return!(e==null||window==null||!("draggable"in e)||!("ondragstart"in e)||!("ondrop"in e)||!("FormData"in window)||!("FileReader"in window))}function $X(e){return e?e.readyState!==0&&e.readyState!==4||e.status===0:!1}function Db(e){return e.startsWith("blob:")}function wb(e){return e?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e):!1}function lB(e){const l=Math.floor(e/3600)%24,t=Math.floor(e/60)%60,d=Math.floor(e%60);return{hours:l,minutes:t,seconds:d}}function tB(e){const l=lB(e),t=l.hours===0?"":`${l.hours}h`,d=l.minutes===0?"":`${l.hours===0?l.minutes:` ${l.minutes.toString(10).padStart(2,"0")}`}m`,n=l.hours!==0?"":`${l.minutes===0?l.seconds:` ${l.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${d}${n}`}function eB(e){return new Error("Cancelled",{cause:e})}function Eb(e){var l;if(e!=null){const t=()=>this.abort(e.reason);e.addEventListener("abort",t,{once:!0});const d=()=>{e.removeEventListener("abort",t)};(l=this.then)==null||l.call(this,d,d)}return this}class dB{constructor(l){al(this,At);al(this,Bn,0);al(this,Od,[]);al(this,Yn,!1);al(this,WU);al(this,vd,1);al(this,QU);al(this,ds);f(this,"limit");al(this,qW,()=>this.resume());al(this,mU,()=>{if(H(this,Yn)){hl(this,ds,setTimeout(H(this,mU),0));return}hl(this,vd,this.limit),this.limit=Math.ceil((H(this,QU)+H(this,vd))/2);for(let l=H(this,vd);l<=this.limit;l++)Zl(this,At,j0).call(this);H(this,QU)-H(this,vd)>3?hl(this,ds,setTimeout(H(this,mU),2e3)):hl(this,vd,Math.floor(H(this,vd)/2))});typeof l!="number"||l===0?this.limit=1/0:this.limit=l}run(l,t){return!H(this,Yn)&&H(this,Bn)<this.limit?Zl(this,At,ob).call(this,l):Zl(this,At,cX).call(this,l,t)}wrapSyncFunction(l,t){return(...d)=>{const n=this.run(()=>(l(...d),queueMicrotask(()=>n.done()),()=>{}),t);return{abortOn:Eb,abort(){n.abort()}}}}wrapPromiseFunction(l,t){return(...d)=>{let n;const a=new Promise((i,s)=>{n=this.run(()=>{let c,F;try{F=Promise.resolve(l(...d))}catch(o){F=Promise.reject(o)}return F.then(o=>{c?s(c):(n.done(),i(o))},o=>{c?s(c):(n.done(),s(o))}),o=>{c=eB(o)}},t)});return a.abort=i=>{n.abort(i)},a.abortOn=Eb,a}}resume(){hl(this,Yn,!1),clearTimeout(H(this,WU));for(let l=0;l<this.limit;l++)Zl(this,At,j0).call(this)}pause(l=null){hl(this,Yn,!0),clearTimeout(H(this,WU)),l!=null&&hl(this,WU,setTimeout(H(this,qW),l))}rateLimit(l){clearTimeout(H(this,ds)),this.pause(l),this.limit>1&&Number.isFinite(this.limit)&&(hl(this,QU,this.limit-1),this.limit=H(this,vd),hl(this,ds,setTimeout(H(this,mU),l)))}get isPaused(){return H(this,Yn)}}Bn=new WeakMap,Od=new WeakMap,Yn=new WeakMap,WU=new WeakMap,vd=new WeakMap,QU=new WeakMap,ds=new WeakMap,At=new WeakSet,ob=function(l){hl(this,Bn,H(this,Bn)+1);let t=!1,d;try{d=l()}catch(n){throw hl(this,Bn,H(this,Bn)-1),n}return{abort:n=>{t||(t=!0,hl(this,Bn,H(this,Bn)-1),d==null||d(n),Zl(this,At,j0).call(this))},done:()=>{t||(t=!0,hl(this,Bn,H(this,Bn)-1),Zl(this,At,j0).call(this))}}},j0=function(){queueMicrotask(()=>Zl(this,At,sX).call(this))},sX=function(){if(H(this,Yn)||H(this,Bn)>=this.limit||H(this,Od).length===0)return;const l=H(this,Od).shift();if(l==null)throw new Error("Invariant violation: next is null");const t=Zl(this,At,ob).call(this,l.fn);l.abort=t.abort,l.done=t.done},cX=function(l,t){const d={fn:l,priority:(t==null?void 0:t.priority)||0,abort:()=>{Zl(this,At,UX).call(this,d)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=H(this,Od).findIndex(a=>d.priority>a.priority);return n===-1?H(this,Od).push(d):H(this,Od).splice(n,0,d),d},UX=function(l){const t=H(this,Od).indexOf(l);t!==-1&&H(this,Od).splice(t,1)},qW=new WeakMap,mU=new WeakMap;function nB(e,l,t){const d=[];return e.forEach(n=>typeof n!="string"?d.push(n):l[Symbol.split](n).forEach((a,i,s)=>{a!==""&&d.push(a),i<s.length-1&&d.push(t)})),d}/**
|
|
1
|
+
(function(el,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("vue"),require("@jari-ace/app-bolts"),require("@element-plus/icons-vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","@jari-ace/app-bolts","@element-plus/icons-vue","element-plus"],U):(el=typeof globalThis<"u"?globalThis:el||self,U(el.Lib={},el.vue,el.jariAceAppBolts,el.elementPlusIconVue,el.elementPlus))})(this,(function(el,U,$,ml,v){"use strict";var dg=Object.defineProperty;var iX=el=>{throw TypeError(el)};var ng=(el,U,$)=>U in el?dg(el,U,{enumerable:!0,configurable:!0,writable:!0,value:$}):el[U]=$;var f=(el,U,$)=>ng(el,typeof U!="symbol"?U+"":U,$),Fb=(el,U,$)=>U.has(el)||iX("Cannot "+$);var H=(el,U,$)=>(Fb(el,U,"read from private field"),$?$.call(el):U.get(el)),al=(el,U,$)=>U.has(el)?iX("Cannot add the same private member more than once"):U instanceof WeakSet?U.add(el):U.set(el,$),hl=(el,U,$,ml)=>(Fb(el,U,"write to private field"),ml?ml.call(el,$):U.set(el,$),$),Zl=(el,U,$)=>(Fb(el,U,"access private method"),$);var Bn,Od,Yn,WU,vd,QU,ds,At,ob,j0,sX,cX,UX,qW,mU,X0,B0,hb,fd,Y0,k0,NU,lQ,ZX,od,hd,z0,ns,RU,rU,as,Wl,os,Vb,FX,oX,hX,Wb,Qb,mb,Nb,tQ,Rb,is,VX,WX,Ya,L0,O0,QX,rb,v0,I0,ka,mX,NX,RX,D0,za,dQ,bU,Vd,uU,Ne,Re,ss,Wd,w0,pU,rX,MU,nQ,E0,aQ,iQ,cs,bX,sQ,SU,La,Kd,Us,kn,C0,cQ,uX,TU,Zs,x0,JU,UQ,ZQ,FQ,Fs,oQ,hQ,GU,Ia,bb,ub;var hs=typeof document<"u"?document.currentScript:null;const Nl=(e,l)=>(e.install=t=>{for(const d of[e,...Object.values({})])t.component(d.name,d)},e);let Pd=U.ref(),XU;async function H0(e){if(Pd.value)return Pd.value;if(XU)return await XU;e||(e="ace-global-app");const l=$.createAxiosWithoutCache();return XU=$.useAppServiceApi(l).getClassificationLevels(e).then(d=>(d&&(d.system&&d.system.sort((n,a)=>a.value-n.value),d.user&&d.user.sort((n,a)=>a.value-n.value)),Pd.value=d,d)).finally(()=>XU=void 0),await XU}async function Sb(e){return await H0(e),Pd.value.system}async function kX(e){return await H0(e),Pd.value.user}async function zX(e){await H0(e);const l=new Map;for(let t=0;t<Pd.value.user.length;t++){const d=Pd.value.user[t];l.set(d.value,d.label)}return l}async function Tb(e){await H0(e);const l=new Map;for(let t=0;t<Pd.value.system.length;t++){const d=Pd.value.system[t];l.set(d.value,d.label)}return l}function mQ(e,l){return Object.hasOwn(e,l)}function LX(e,l,t){return new Promise(d=>{e.toBlob(d,l,t)})}const IX=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function DX(e,l,t){const d=IX.exec(e),n=l.mimeType??(d==null?void 0:d[1])??"plain/text";let a;if((d==null?void 0:d[2])!=null){const i=atob(decodeURIComponent(d[3])),s=new Uint8Array(i.length);for(let c=0;c<i.length;c++)s[c]=i.charCodeAt(c);a=[s]}else(d==null?void 0:d[3])!=null&&(a=[decodeURIComponent(d[3])]);return new Blob(a,{type:n})}function Jb(e,l,t,d){return e===l?e:d===0?l:e+(l-e)*2**(-d/t)}const Gb=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];class wX extends Error{constructor(t,d=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.");f(this,"cause");f(this,"isNetworkError");f(this,"request");this.cause=t,this.isNetworkError=!0,this.request=d}}function EX(e){const l=t=>"error"in t&&!!t.error;return e.filter(t=>!l(t))}function CX(e){return e.filter(l=>{var t;return!((t=l.progress)!=null&&t.uploadStarted)||!l.isRestored})}function yb(e){return typeof e!="object"||e===null||!("nodeType"in e)?!1:e.nodeType===Node.ELEMENT_NODE}function Xb(e){if(typeof e=="string"){const l=document.querySelectorAll(e);return l.length===0?null:Array.from(l)}return typeof e=="object"&&yb(e)?[e]:null}function xX(e,l=document){return typeof e=="string"?l.querySelector(e):yb(e)?e:null}function Bb(e){const l=e.lastIndexOf(".");return l===-1||l===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,l),extension:e.slice(l+1)}}const NQ={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Yb(e){var t;if(e.type)return e.type;const l=e.name?(t=Bb(e.name).extension)==null?void 0:t.toLowerCase():null;return l&&l in NQ?NQ[l]:"application/octet-stream"}function gX(e){return e.charCodeAt(0).toString(32)}function kb(e){let l="";return e.replace(/[^A-Z0-9]/gi,t=>(l+=`-${gX(t)}`,"/"))+l}function jX(e,l){var d;let t=l||"uppy";return typeof e.name=="string"&&(t+=`-${kb(e.name.toLowerCase())}`),e.type!==void 0&&(t+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(t+=`-${kb(e.meta.relativePath.toLowerCase())}`),((d=e.data)==null?void 0:d.size)!==void 0&&(t+=`-${e.data.size}`),e.data.lastModified!==void 0&&(t+=`-${e.data.lastModified}`),t}function OX(e){return!e.isRemote||!e.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}function vX(e,l){if(OX(e))return e.id;const t=Yb(e);return jX({...e,type:t},l)}function fX(e,l){return e===!0?Object.keys(l):Array.isArray(e)?e:[]}const BU=Array.from;function KX(e){const l=BU(e.files);return Promise.resolve(l)}function zb(e,l,t,{onSuccess:d}){e.readEntries(n=>{const a=[...l,...n];n.length?queueMicrotask(()=>{zb(e,a,t,{onSuccess:d})}):d(a)},n=>{t(n),d(l)})}function Lb(e,l){return e==null?e:{kind:e.isFile?"file":e.isDirectory?"directory":void 0,name:e.name,getFile(){return new Promise((t,d)=>e.file(t,d))},async*values(){const t=e.createReader();yield*await new Promise(n=>{zb(t,[],l,{onSuccess:a=>n(a.map(i=>Lb(i,l)))})})},isSameEntry:void 0}}async function*Ib(e,l,t=void 0){const d=()=>`${l}/${e.name}`;if(e.kind==="file"){const n=await e.getFile();n!=null?(n.relativePath=l?d():null,yield n):t!=null&&(yield t)}else if(e.kind==="directory")for await(const n of e.values())yield*Ib(n,l?d():e.name);else t!=null&&(yield t)}async function*HX(e,l){const t=await Promise.all(Array.from(e.items,async d=>{let n;return n??(n=Lb(typeof d.getAsEntry=="function"?d.getAsEntry():d.webkitGetAsEntry(),l)),{fileSystemHandle:n,lastResortFile:d.getAsFile()}}));for(const{lastResortFile:d,fileSystemHandle:n}of t)if(n!=null)try{yield*Ib(n,"",d)}catch(a){d!=null?yield d:l(a)}else d!=null&&(yield d)}async function PX(e,l){const t=(l==null?void 0:l.logDropError)??Function.prototype;try{const d=[];for await(const n of HX(e,t))d.push(n);return d}catch{return KX(e)}}const AX={__proto__:null,"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/webp":"webp","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};function wa(e){return[e]=e.split(";",1),AX[e]||null}function _X(e){for(;e&&!e.dir;)e=e.parentNode;return e==null?void 0:e.dir}function RQ(e){return e<10?`0${e}`:e.toString()}function P0(){const e=new Date,l=RQ(e.getHours()),t=RQ(e.getMinutes()),d=RQ(e.getSeconds());return`${l}:${t}:${d}`}function qX(){if(typeof window>"u")return!1;const e=document.body;return!(e==null||window==null||!("draggable"in e)||!("ondragstart"in e)||!("ondrop"in e)||!("FormData"in window)||!("FileReader"in window))}function $X(e){return e?e.readyState!==0&&e.readyState!==4||e.status===0:!1}function Db(e){return e.startsWith("blob:")}function wb(e){return e?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e):!1}function lB(e){const l=Math.floor(e/3600)%24,t=Math.floor(e/60)%60,d=Math.floor(e%60);return{hours:l,minutes:t,seconds:d}}function tB(e){const l=lB(e),t=l.hours===0?"":`${l.hours}h`,d=l.minutes===0?"":`${l.hours===0?l.minutes:` ${l.minutes.toString(10).padStart(2,"0")}`}m`,n=l.hours!==0?"":`${l.minutes===0?l.seconds:` ${l.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${d}${n}`}function eB(e){return new Error("Cancelled",{cause:e})}function Eb(e){var l;if(e!=null){const t=()=>this.abort(e.reason);e.addEventListener("abort",t,{once:!0});const d=()=>{e.removeEventListener("abort",t)};(l=this.then)==null||l.call(this,d,d)}return this}class dB{constructor(l){al(this,At);al(this,Bn,0);al(this,Od,[]);al(this,Yn,!1);al(this,WU);al(this,vd,1);al(this,QU);al(this,ds);f(this,"limit");al(this,qW,()=>this.resume());al(this,mU,()=>{if(H(this,Yn)){hl(this,ds,setTimeout(H(this,mU),0));return}hl(this,vd,this.limit),this.limit=Math.ceil((H(this,QU)+H(this,vd))/2);for(let l=H(this,vd);l<=this.limit;l++)Zl(this,At,j0).call(this);H(this,QU)-H(this,vd)>3?hl(this,ds,setTimeout(H(this,mU),2e3)):hl(this,vd,Math.floor(H(this,vd)/2))});typeof l!="number"||l===0?this.limit=1/0:this.limit=l}run(l,t){return!H(this,Yn)&&H(this,Bn)<this.limit?Zl(this,At,ob).call(this,l):Zl(this,At,cX).call(this,l,t)}wrapSyncFunction(l,t){return(...d)=>{const n=this.run(()=>(l(...d),queueMicrotask(()=>n.done()),()=>{}),t);return{abortOn:Eb,abort(){n.abort()}}}}wrapPromiseFunction(l,t){return(...d)=>{let n;const a=new Promise((i,s)=>{n=this.run(()=>{let c,F;try{F=Promise.resolve(l(...d))}catch(o){F=Promise.reject(o)}return F.then(o=>{c?s(c):(n.done(),i(o))},o=>{c?s(c):(n.done(),s(o))}),o=>{c=eB(o)}},t)});return a.abort=i=>{n.abort(i)},a.abortOn=Eb,a}}resume(){hl(this,Yn,!1),clearTimeout(H(this,WU));for(let l=0;l<this.limit;l++)Zl(this,At,j0).call(this)}pause(l=null){hl(this,Yn,!0),clearTimeout(H(this,WU)),l!=null&&hl(this,WU,setTimeout(H(this,qW),l))}rateLimit(l){clearTimeout(H(this,ds)),this.pause(l),this.limit>1&&Number.isFinite(this.limit)&&(hl(this,QU,this.limit-1),this.limit=H(this,vd),hl(this,ds,setTimeout(H(this,mU),l)))}get isPaused(){return H(this,Yn)}}Bn=new WeakMap,Od=new WeakMap,Yn=new WeakMap,WU=new WeakMap,vd=new WeakMap,QU=new WeakMap,ds=new WeakMap,At=new WeakSet,ob=function(l){hl(this,Bn,H(this,Bn)+1);let t=!1,d;try{d=l()}catch(n){throw hl(this,Bn,H(this,Bn)-1),n}return{abort:n=>{t||(t=!0,hl(this,Bn,H(this,Bn)-1),d==null||d(n),Zl(this,At,j0).call(this))},done:()=>{t||(t=!0,hl(this,Bn,H(this,Bn)-1),Zl(this,At,j0).call(this))}}},j0=function(){queueMicrotask(()=>Zl(this,At,sX).call(this))},sX=function(){if(H(this,Yn)||H(this,Bn)>=this.limit||H(this,Od).length===0)return;const l=H(this,Od).shift();if(l==null)throw new Error("Invariant violation: next is null");const t=Zl(this,At,ob).call(this,l.fn);l.abort=t.abort,l.done=t.done},cX=function(l,t){const d={fn:l,priority:(t==null?void 0:t.priority)||0,abort:()=>{Zl(this,At,UX).call(this,d)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=H(this,Od).findIndex(a=>d.priority>a.priority);return n===-1?H(this,Od).push(d):H(this,Od).splice(n,0,d),d},UX=function(l){const t=H(this,Od).indexOf(l);t!==-1&&H(this,Od).splice(t,1)},qW=new WeakMap,mU=new WeakMap;function nB(e,l,t){const d=[];return e.forEach(n=>typeof n!="string"?d.push(n):l[Symbol.split](n).forEach((a,i,s)=>{a!==""&&d.push(a),i<s.length-1&&d.push(t)})),d}/**
|
|
2
2
|
* Takes a string with placeholder variables like `%{smart_count} file selected`
|
|
3
3
|
* and replaces it with values from options `{smart_count: 5}`
|
|
4
4
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* ${c.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:i.length}),details:s},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(i,s);{const c=new Error(s);throw c.errors=i,c}}this.setState({files:t}),d.forEach(s=>{this.emit("file-added",s)}),this.emit("files-added",d),d.length>5?this.log(`Added batch of ${d.length} files`):Object.values(d).forEach(s=>{this.log(`Added file: ${s.name}
|
|
13
13
|
id: ${s.id}
|
|
14
14
|
type: ${s.type}`)}),d.length>0&&Zl(this,Wl,Wb).call(this)}removeFiles(l){const{files:t,currentUploads:d}=this.getState(),n={...t},a={...d},i=Object.create(null);l.forEach(o=>{t[o]&&(i[o]=t[o],delete n[o])});function s(o){return i[o]===void 0}Object.keys(a).forEach(o=>{const h=d[o].fileIDs.filter(s);if(h.length===0){delete a[o];return}const{capabilities:V}=this.getState();if(h.length!==d[o].fileIDs.length&&!V.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");a[o]={...d[o],fileIDs:h}});const c={currentUploads:a,files:n};Object.keys(n).length===0&&(c.allowNewUpload=!0,c.error=null,c.recoveredState=null),this.setState(c),H(this,is).call(this);const F=Object.keys(i);F.forEach(o=>{this.emit("file-removed",i[o])}),F.length>5?this.log(`Removed ${F.length} files`):this.log(`Removed files: ${F.join(", ")}`)}removeFile(l){this.removeFiles([l])}pauseResume(l){if(!this.getState().capabilities.resumableUploads||this.getFile(l).progress.uploadComplete)return;const t=this.getFile(l),n=!(t.isPaused||!1);return this.setFileState(l,{isPaused:n}),this.emit("upload-pause",t,n),n}pauseAll(){const l={...this.getState().files};Object.keys(l).filter(d=>!l[d].progress.uploadComplete&&l[d].progress.uploadStarted).forEach(d=>{const n={...l[d],isPaused:!0};l[d]=n}),this.setState({files:l}),this.emit("pause-all")}resumeAll(){const l={...this.getState().files};Object.keys(l).filter(d=>!l[d].progress.uploadComplete&&l[d].progress.uploadStarted).forEach(d=>{const n={...l[d],isPaused:!1,error:null};l[d]=n}),this.setState({files:l}),this.emit("resume-all")}async retryAll(){const l=await Zl(this,Wl,Nb).call(this);return this.emit("complete",l),l}cancelAll(){this.emit("cancel-all");const{files:l}=this.getState(),t=Object.keys(l);t.length&&this.removeFiles(t),this.setState(lo)}retryUpload(l){this.setFileState(l,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(l));const t=Zl(this,Wl,O0).call(this,[l],{forceAllowNewUpload:!0});return Zl(this,Wl,v0).call(this,t)}logout(){this.iteratePlugins(l=>{var t,d;(d=(t=l.provider)==null?void 0:t.logout)==null||d.call(t)})}[Symbol.for("uppy test: updateTotalProgress")](){return Zl(this,Wl,Rb).call(this)}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(l,...t){if(typeof l!="function"){const i=`Expected a plugin class, but got ${l===null?"null":typeof l}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(i)}const d=new l(this,...t),n=d.id;if(!n)throw new Error("Your plugin must have an id");if(!d.type)throw new Error("Your plugin must have a type");const a=this.getPlugin(n);if(a){const i=`Already found a plugin named '${a.id}'. Tried to use: '${n}'.
|
|
15
|
-
Uppy plugins must have unique \`id\` options.`;throw new Error(i)}return l.VERSION&&this.log(`Using ${n} v${l.VERSION}`),d.type in H(this,od)?H(this,od)[d.type].push(d):H(this,od)[d.type]=[d],d.install(),this.emit("plugin-added",d),this}getPlugin(l){for(const t of Object.values(H(this,od))){const d=t.find(n=>n.id===l);if(d!=null)return d}}[Symbol.for("uppy test: getPlugins")](l){return H(this,od)[l]}iteratePlugins(l){Object.values(H(this,od)).flat(1).forEach(l)}removePlugin(l){this.log(`Removing plugin ${l.id}`),this.emit("plugin-remove",l),l.uninstall&&l.uninstall();const t=H(this,od)[l.type],d=t.findIndex(i=>i.id===l.id);d!==-1&&t.splice(d,1);const a={plugins:{...this.getState().plugins,[l.id]:void 0}};this.setState(a)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),H(this,z0).call(this),this.iteratePlugins(l=>{this.removePlugin(l)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",H(this,Ya)),window.removeEventListener("offline",H(this,Ya)))}hideInfo(){const{info:l}=this.getState();this.setState({info:l.slice(1)}),this.emit("info-hidden")}info(l,t="info",d=3e3){const n=typeof l=="object";this.setState({info:[...this.getState().info,{type:t,message:n?l.message:l,details:n?l.details:null}]}),setTimeout(()=>this.hideInfo(),d),this.emit("info-visible")}log(l,t){const{logger:d}=this.opts;switch(t){case"error":d.error(l);break;case"warning":d.warn(l);break;default:d.debug(l);break}}registerRequestClient(l,t){H(this,L0).set(l,t)}getRequestClientForFile(l){if(!("remote"in l&&l.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${l.id}`);const t=H(this,L0).get(l.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${l.remote.requestClientId}" not registered for file "${l.id}"`);return t}async restore(l){this.log(`Core: Running restored upload "${l}"`);const t=await Zl(this,Wl,v0).call(this,l);return this.emit("complete",t),t}[Symbol.for("uppy test: createUpload")](...l){return Zl(this,Wl,O0).call(this,...l)}addResultData(l,t){if(!Zl(this,Wl,QX).call(this,l)){this.log(`Not setting result for an upload that has been removed: ${l}`);return}const{currentUploads:d}=this.getState(),n={...d[l],result:{...d[l].result,...t}};this.setState({currentUploads:{...d,[l]:n}})}async upload(){var n;(n=H(this,od).uploader)!=null&&n.length||this.log("No uploader type plugins are used","warning");let{files:l}=this.getState();if(Zl(this,Wl,mb).call(this).length>0){const a=await Zl(this,Wl,Nb).call(this);if(!(this.getFiles().filter(s=>s.progress.uploadStarted==null).length>0))return this.emit("complete",a),a;({files:l}=this.getState())}const d=this.opts.onBeforeUpload(l);if(d===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");d&&typeof d=="object"&&(l=d,this.setState({files:l}));try{if(H(this,hd).validateMinNumberOfFiles(l),!Zl(this,Wl,FX).call(this,l))throw new Ae(this.i18n("missingRequiredMetaField"));const{currentUploads:a}=this.getState(),i=Object.values(a).flatMap(o=>o.fileIDs),s=Object.keys(l).filter(o=>{const h=this.getFile(o);return h&&!h.progress.uploadStarted&&!i.includes(o)}),c=Zl(this,Wl,O0).call(this,s),F=await Zl(this,Wl,v0).call(this,c);return this.emit("complete",F),F}catch(a){throw Zl(this,Wl,os).call(this,[a]),a}}};od=new WeakMap,hd=new WeakMap,z0=new WeakMap,ns=new WeakMap,RU=new WeakMap,rU=new WeakMap,as=new WeakMap,Wl=new WeakSet,os=function(l){for(const i of l)i.isRestriction?this.emit("restriction-failed",i.file,i):this.emit("error",i,i.file),this.log(i,"warning");const t=l.filter(i=>i.isUserFacing),d=4,n=t.slice(0,d),a=t.slice(d);n.forEach(({message:i,details:s=""})=>{this.info({message:i,details:s},"error",this.opts.infoTimeout)}),a.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:a.length})})},Vb=function(l){const{missingFields:t,error:d}=H(this,hd).getMissingRequiredMetaFields(l);return t.length>0?(this.setFileState(l.id,{missingRequiredMetaFields:t,error:d.message}),this.log(d.message),this.emit("restriction-failed",l,d),!1):(t.length===0&&l.missingRequiredMetaFields&&this.setFileState(l.id,{missingRequiredMetaFields:[]}),!0)},FX=function(l){let t=!0;for(const d of Object.values(l))Zl(this,Wl,Vb).call(this,d)||(t=!1);return t},oX=function(l){const{allowNewUpload:t}=this.getState();if(t===!1){const d=new Ae(this.i18n("noMoreFilesAllowed"),{file:l});throw Zl(this,Wl,os).call(this,[d]),d}},hX=function(l){const t=l instanceof File?{name:l.name,type:l.type,size:l.size,data:l,meta:{},isRemote:!1,source:void 0,preview:void 0}:l,d=Yb(t),n=AB(d,t),a=Bb(n).extension,i=vX(t,this.getID()),s={...t.meta,name:n,type:d},c=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:i,name:n,extension:a||"",meta:{...this.getState().meta,...s},type:d,progress:{percentage:0,bytesUploaded:!1,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isGhost:!1,...t.isRemote?{isRemote:!0,remote:t.remote,data:t.data}:{isRemote:!1,data:t.data},preview:t.preview}},Wb=function(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(l=>{l.isRestriction||this.log(l.stack||l.message||l)})},4))},Qb=function(l){let{files:t}=this.getState(),d={...t};const n=[],a=[];for(const i of l)try{let s=Zl(this,Wl,hX).call(this,i);Zl(this,Wl,oX).call(this,s);const c=t[s.id],F=c==null?void 0:c.isGhost;if(F&&!s.isRemote){if(s.data==null)throw new Error("File data is missing");s={...c,isGhost:!1,data:s.data},this.log(`Replaced the blob in the restored ghost file: ${s.name}, ${s.id}`)}const o=this.opts.onBeforeFileAdded(s,d);if(t=this.getState().files,d={...t,...d},!o&&this.checkIfFileAlreadyExists(s.id))throw new Ae(this.i18n("noDuplicates",{fileName:s.name??this.i18n("unnamed")}),{file:s});if(o===!1&&!F)throw new Ae("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:s});typeof o=="object"&&o!==null&&(s=o),H(this,hd).validateSingleFile(s),d[s.id]=s,n.push(s)}catch(s){a.push(s)}try{H(this,hd).validateAggregateRestrictions(Object.values(t),n)}catch(i){return a.push(i),{nextFilesState:t,validFilesToAdd:[],errors:a}}return{nextFilesState:d,validFilesToAdd:n,errors:a}},mb=function(){const{files:l}=this.getState();return Object.keys(l).filter(t=>{const d=l[t];return d.error&&(!d.missingRequiredMetaFields||d.missingRequiredMetaFields.length===0)})},Nb=async function(){const l=Zl(this,Wl,mb).call(this),t={...this.getState().files};if(l.forEach(n=>{t[n]={...t[n],isPaused:!1,error:null}}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(l)),l.length===0)return{successful:[],failed:[]};const d=Zl(this,Wl,O0).call(this,l,{forceAllowNewUpload:!0});return Zl(this,Wl,v0).call(this,d)},tQ=new WeakMap,Rb=function(){const l=Zl(this,Wl,VX).call(this);let t=null;l!=null&&(t=Math.round(l*100),t>100?t=100:t<0&&(t=0)),this.emit("progress",t??0),this.setState({totalProgress:t??0})},is=new WeakMap,VX=function(){const t=this.getFiles().filter(c=>c.progress.uploadStarted||c.progress.preprocess||c.progress.postprocess);if(t.length===0)return 0;if(t.every(c=>c.progress.uploadComplete))return 1;const d=c=>c.progress.bytesTotal!=null&&c.progress.bytesTotal!==0,n=t.filter(d),a=t.filter(c=>!d(c));if(n.every(c=>c.progress.uploadComplete)&&a.length>0&&!a.every(c=>c.progress.uploadComplete))return null;const i=n.reduce((c,F)=>c+(F.progress.bytesTotal??0),0),s=n.reduce((c,F)=>c+(F.progress.bytesUploaded||0),0);return i===0?0:s/i},WX=function(){const l=(n,a,i)=>{let s=n.message||"Unknown error";n.details&&(s+=` ${n.details}`),this.setState({error:s}),a!=null&&a.id in this.getState().files&&this.setFileState(a.id,{error:s,response:i})};this.on("error",l),this.on("upload-error",(n,a,i)=>{if(l(a,n,i),typeof a=="object"&&a.message){this.log(a.message,"error");const s=new Error(this.i18n("failedToUpload",{file:(n==null?void 0:n.name)??""}));s.isUserFacing=!0,s.details=a.message,a.details&&(s.details+=` ${a.details}`),Zl(this,Wl,os).call(this,[s])}else Zl(this,Wl,os).call(this,[a])});let t=null;this.on("upload-stalled",(n,a)=>{const{message:i}=n,s=a.map(c=>c.meta.name).join(", ");t||(this.info({message:i,details:s},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${i} ${s}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const d=n=>{const a=n.filter(s=>{const c=s!=null&&this.getFile(s.id);return c||this.log(`Not setting progress for a file that has been removed: ${s==null?void 0:s.id}`),c}),i=Object.fromEntries(a.map(s=>[s.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:s.size}}]));this.patchFilesState(i)};this.on("upload-start",d),this.on("upload-progress",H(this,tQ)),this.on("upload-success",(n,a)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}const i=this.getFile(n.id).progress,s=H(this,as).size>0;this.setFileState(n.id,{progress:{...i,postprocess:s?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!s&&{complete:!0},percentage:100,bytesUploaded:i.bytesTotal},response:a,uploadURL:a.uploadURL,isPaused:!1}),n.size==null&&this.setFileState(n.id,{size:a.bytesUploaded||i.bytesTotal}),H(this,is).call(this)}),this.on("preprocess-progress",(n,a)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}this.setFileState(n.id,{progress:{...this.getFile(n.id).progress,preprocess:a}})}),this.on("preprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}const a={...this.getState().files};a[n.id]={...a[n.id],progress:{...a[n.id].progress}},delete a[n.id].progress.preprocess,this.setState({files:a})}),this.on("postprocess-progress",(n,a)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}this.setFileState(n.id,{progress:{...this.getState().files[n.id].progress,postprocess:a}})}),this.on("postprocess-complete",n=>{const a=n&&this.getFile(n.id);if(a==null){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}const{postprocess:i,...s}=a.progress;this.patchFilesState({[a.id]:{progress:{...s,complete:!0}}})}),this.on("restored",()=>{H(this,is).call(this)}),this.on("dashboard:file-edit-complete",n=>{n&&Zl(this,Wl,Vb).call(this,n)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",H(this,Ya)),window.addEventListener("offline",H(this,Ya)),setTimeout(H(this,Ya),3e3))},Ya=new WeakMap,L0=new WeakMap,O0=function(l,t={}){const{forceAllowNewUpload:d=!1}=t,{allowNewUpload:n,currentUploads:a}=this.getState();if(!n&&!d)throw new Error("Cannot create a new upload: already uploading.");const i=$Q();return this.emit("upload",i,this.getFilesByIds(l)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...a,[i]:{fileIDs:l,step:0,result:{}}}}),i},QX=function(l){const{currentUploads:t}=this.getState();return t[l]},rb=function(l){const{[l]:t,...d}=this.getState().currentUploads;this.setState({currentUploads:d})},v0=async function(l){const t=()=>{const{currentUploads:i}=this.getState();return i[l]};let d=t();if(!d)throw new Error("Nonexistent upload");const n=[...H(this,RU),...H(this,rU),...H(this,as)];try{for(let i=d.step||0;i<n.length&&d;i++){const s=n[i];this.setState({currentUploads:{...this.getState().currentUploads,[l]:{...d,step:i}}});const c=d.fileIDs.filter(F=>!this.getFile(F).progress.uploadComplete);await s(c,l),d=t()}}catch(i){throw Zl(this,Wl,rb).call(this,l),i}if(d){d.fileIDs.forEach(F=>{const o=this.getFile(F);o!=null&&o.progress.postprocess&&this.emit("postprocess-complete",o)});const i=d.fileIDs.map(F=>this.getFile(F)),s=i.filter(F=>!F.error),c=i.filter(F=>F.error);this.addResultData(l,{successful:s,failed:c,uploadID:l}),d=t()}let a;return d&&(a=d.result,Zl(this,Wl,rb).call(this,l)),a==null&&(this.log(`Not setting result for an upload that has been removed: ${l}`),a={successful:[],failed:[],uploadID:l}),a},f(eQ,"VERSION",PB.version);let lm=eQ;function tm(e){"@babel/helpers - typeof";return tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},tm(e)}function $B(e,l,t){return Object.defineProperty(e,"prototype",{writable:!1}),e}function lY(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function tY(e,l,t){return l=EU(l),eY(e,dm()?Reflect.construct(l,t||[],EU(e).constructor):l.apply(e,t))}function eY(e,l){if(l&&(tm(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dY(e)}function dY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nY(e,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(l&&l.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),l&&wU(e,l)}function em(e){var l=typeof Map=="function"?new Map:void 0;return em=function(d){if(d===null||!iY(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l<"u"){if(l.has(d))return l.get(d);l.set(d,n)}function n(){return aY(d,arguments,EU(this).constructor)}return n.prototype=Object.create(d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),wU(n,d)},em(e)}function aY(e,l,t){if(dm())return Reflect.construct.apply(null,arguments);var d=[null];d.push.apply(d,l);var n=new(e.bind.apply(e,d));return t&&wU(n,t.prototype),n}function dm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dm=function(){return!!e})()}function iY(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function wU(e,l){return wU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,n){return d.__proto__=n,d},wU(e,l)}function EU(e){return EU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},EU(e)}var to=(function(e){function l(t){var d,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(lY(this,l),d=tY(this,l,[t]),d.originalRequest=a,d.originalResponse=i,d.causingError=n,n!=null&&(t+=", caused by ".concat(n.toString())),a!=null){var s=a.getHeader("X-Request-ID")||"n/a",c=a.getMethod(),F=a.getURL(),o=i?i.getStatus():"n/a",h=i?i.getBody()||"":"n/a";t+=", originated from request (method: ".concat(c,", url: ").concat(F,", response code: ").concat(o,", response text: ").concat(h,", request id: ").concat(s,")")}return d.message=t,d}return nY(l,e),$B(l)})(em(Error));function ng(e){}function CU(e){"@babel/helpers - typeof";return CU=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},CU(e)}function sY(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function cY(e,l){for(var t=0;t<l.length;t++){var d=l[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,ZY(d.key),d)}}function UY(e,l,t){return l&&cY(e.prototype,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZY(e){var l=FY(e,"string");return CU(l)=="symbol"?l:l+""}function FY(e,l){if(CU(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var d=t.call(e,l);if(CU(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var oY=(function(){function e(){sY(this,e)}return UY(e,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(t){return Promise.resolve([])}},{key:"removeUpload",value:function(t){return Promise.resolve()}},{key:"addUpload",value:function(t,d){return Promise.resolve(null)}}])})();const xu="3.7.8",hY=xu,Ns=typeof Buffer=="function",gu=typeof TextDecoder=="function"?new TextDecoder:void 0,ju=typeof TextEncoder=="function"?new TextEncoder:void 0,xU=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),eo=(e=>{let l={};return e.forEach((t,d)=>l[t]=d),l})(xU),VY=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Gt=String.fromCharCode.bind(String),Ou=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),vu=e=>e.replace(/=/g,"").replace(/[+\/]/g,l=>l=="+"?"-":"_"),fu=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Ku=e=>{let l,t,d,n,a="";const i=e.length%3;for(let s=0;s<e.length;){if((t=e.charCodeAt(s++))>255||(d=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");l=t<<16|d<<8|n,a+=xU[l>>18&63]+xU[l>>12&63]+xU[l>>6&63]+xU[l&63]}return i?a.slice(0,i-3)+"===".substring(i):a},nm=typeof btoa=="function"?e=>btoa(e):Ns?e=>Buffer.from(e,"binary").toString("base64"):Ku,am=Ns?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let d=0,n=e.length;d<n;d+=4096)t.push(Gt.apply(null,e.subarray(d,d+4096)));return nm(t.join(""))},no=(e,l=!1)=>l?vu(am(e)):am(e),WY=e=>{if(e.length<2){var l=e.charCodeAt(0);return l<128?e:l<2048?Gt(192|l>>>6)+Gt(128|l&63):Gt(224|l>>>12&15)+Gt(128|l>>>6&63)+Gt(128|l&63)}else{var l=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Gt(240|l>>>18&7)+Gt(128|l>>>12&63)+Gt(128|l>>>6&63)+Gt(128|l&63)}},QY=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Hu=e=>e.replace(QY,WY),Pu=Ns?e=>Buffer.from(e,"utf8").toString("base64"):ju?e=>am(ju.encode(e)):e=>nm(Hu(e)),Rs=(e,l=!1)=>l?vu(Pu(e)):Pu(e),Au=e=>Rs(e,!0),mY=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,NY=e=>{switch(e.length){case 4:var l=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),t=l-65536;return Gt((t>>>10)+55296)+Gt((t&1023)+56320);case 3:return Gt((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Gt((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},_u=e=>e.replace(mY,NY),qu=e=>{if(e=e.replace(/\s+/g,""),!VY.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let l,t,d,n=[];for(let a=0;a<e.length;)l=eo[e.charAt(a++)]<<18|eo[e.charAt(a++)]<<12|(t=eo[e.charAt(a++)])<<6|(d=eo[e.charAt(a++)]),t===64?n.push(Gt(l>>16&255)):d===64?n.push(Gt(l>>16&255,l>>8&255)):n.push(Gt(l>>16&255,l>>8&255,l&255));return n.join("")},im=typeof atob=="function"?e=>atob(fu(e)):Ns?e=>Buffer.from(e,"base64").toString("binary"):qu,$u=Ns?e=>Ou(Buffer.from(e,"base64")):e=>Ou(im(e).split("").map(l=>l.charCodeAt(0))),lp=e=>$u(tp(e)),RY=Ns?e=>Buffer.from(e,"base64").toString("utf8"):gu?e=>gu.decode($u(e)):e=>_u(im(e)),tp=e=>fu(e.replace(/[-_]/g,l=>l=="-"?"+":"/")),sm=e=>RY(tp(e)),rY=e=>{if(typeof e!="string")return!1;const l=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(l)||!/[^\s0-9a-zA-Z\-_]/.test(l)},ep=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),dp=function(){const e=(l,t)=>Object.defineProperty(String.prototype,l,ep(t));e("fromBase64",function(){return sm(this)}),e("toBase64",function(l){return Rs(this,l)}),e("toBase64URI",function(){return Rs(this,!0)}),e("toBase64URL",function(){return Rs(this,!0)}),e("toUint8Array",function(){return lp(this)})},np=function(){const e=(l,t)=>Object.defineProperty(Uint8Array.prototype,l,ep(t));e("toBase64",function(l){return no(this,l)}),e("toBase64URI",function(){return no(this,!0)}),e("toBase64URL",function(){return no(this,!0)})},bY={version:xu,VERSION:hY,atob:im,atobPolyfill:qu,btoa:nm,btoaPolyfill:Ku,fromBase64:sm,toBase64:Rs,encode:Rs,encodeURI:Au,encodeURL:Au,utob:Hu,btou:_u,decode:sm,isValid:rY,fromUint8Array:no,toUint8Array:lp,extendString:dp,extendUint8Array:np,extendBuiltins:()=>{dp(),np()}};var cm,ap;function uY(){return ap||(ap=1,cm=function(l,t){if(t=t.split(":")[0],l=+l,!l)return!1;switch(t){case"http":case"ws":return l!==80;case"https":case"wss":return l!==443;case"ftp":return l!==21;case"gopher":return l!==70;case"file":return!1}return l!==0}),cm}var ao={},ip;function pY(){if(ip)return ao;ip=1;var e=Object.prototype.hasOwnProperty,l;function t(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}function d(i){try{return encodeURIComponent(i)}catch{return null}}function n(i){for(var s=/([^=?#&]+)=?([^&]*)/g,c={},F;F=s.exec(i);){var o=t(F[1]),h=t(F[2]);o===null||h===null||o in c||(c[o]=h)}return c}function a(i,s){s=s||"";var c=[],F,o;typeof s!="string"&&(s="?");for(o in i)if(e.call(i,o)){if(F=i[o],!F&&(F===null||F===l||isNaN(F))&&(F=""),o=d(o),F=d(F),o===null||F===null)continue;c.push(o+"="+F)}return c.length?s+c.join("&"):""}return ao.stringify=a,ao.parse=n,ao}var Um,sp;function MY(){if(sp)return Um;sp=1;var e=uY(),l=pY(),t=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,d=/[\n\r\t]/g,n=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,a=/:\d+$/,i=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,s=/^[a-zA-Z]:/;function c(r){return(r||"").toString().replace(t,"")}var F=[["#","hash"],["?","query"],function(u,S){return V(S.protocol)?u.replace(/\\/g,"/"):u},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],o={hash:1,query:1};function h(r){var u;typeof window<"u"?u=window:typeof ms<"u"?u=ms:typeof self<"u"?u=self:u={};var S=u.location||{};r=r||S;var G={},J=typeof r,Y;if(r.protocol==="blob:")G=new m(unescape(r.pathname),{});else if(J==="string"){G=new m(r,{});for(Y in o)delete G[Y]}else if(J==="object"){for(Y in r)Y in o||(G[Y]=r[Y]);G.slashes===void 0&&(G.slashes=n.test(r.href))}return G}function V(r){return r==="file:"||r==="ftp:"||r==="http:"||r==="https:"||r==="ws:"||r==="wss:"}function W(r,u){r=c(r),r=r.replace(d,""),u=u||{};var S=i.exec(r),G=S[1]?S[1].toLowerCase():"",J=!!S[2],Y=!!S[3],L=0,y;return J?Y?(y=S[2]+S[3]+S[4],L=S[2].length+S[3].length):(y=S[2]+S[4],L=S[2].length):Y?(y=S[3]+S[4],L=S[3].length):y=S[4],G==="file:"?L>=2&&(y=y.slice(2)):V(G)?y=S[4]:G?J&&(y=y.slice(2)):L>=2&&V(u.protocol)&&(y=S[4]),{protocol:G,slashes:J||V(G),slashesCount:L,rest:y}}function Q(r,u){if(r==="")return u;for(var S=(u||"/").split("/").slice(0,-1).concat(r.split("/")),G=S.length,J=S[G-1],Y=!1,L=0;G--;)S[G]==="."?S.splice(G,1):S[G]===".."?(S.splice(G,1),L++):L&&(G===0&&(Y=!0),S.splice(G,1),L--);return Y&&S.unshift(""),(J==="."||J==="..")&&S.push(""),S.join("/")}function m(r,u,S){if(r=c(r),r=r.replace(d,""),!(this instanceof m))return new m(r,u,S);var G,J,Y,L,y,z,I=F.slice(),O=typeof u,E=this,j=0;for(O!=="object"&&O!=="string"&&(S=u,u=null),S&&typeof S!="function"&&(S=l.parse),u=h(u),J=W(r||"",u),G=!J.protocol&&!J.slashes,E.slashes=J.slashes||G&&u.slashes,E.protocol=J.protocol||u.protocol||"",r=J.rest,(J.protocol==="file:"&&(J.slashesCount!==2||s.test(r))||!J.slashes&&(J.protocol||J.slashesCount<2||!V(E.protocol)))&&(I[3]=[/(.*)/,"pathname"]);j<I.length;j++){if(L=I[j],typeof L=="function"){r=L(r,E);continue}Y=L[0],z=L[1],Y!==Y?E[z]=r:typeof Y=="string"?(y=Y==="@"?r.lastIndexOf(Y):r.indexOf(Y),~y&&(typeof L[2]=="number"?(E[z]=r.slice(0,y),r=r.slice(y+L[2])):(E[z]=r.slice(y),r=r.slice(0,y)))):(y=Y.exec(r))&&(E[z]=y[1],r=r.slice(0,y.index)),E[z]=E[z]||G&&L[3]&&u[z]||"",L[4]&&(E[z]=E[z].toLowerCase())}S&&(E.query=S(E.query)),G&&u.slashes&&E.pathname.charAt(0)!=="/"&&(E.pathname!==""||u.pathname!=="")&&(E.pathname=Q(E.pathname,u.pathname)),E.pathname.charAt(0)!=="/"&&V(E.protocol)&&(E.pathname="/"+E.pathname),e(E.port,E.protocol)||(E.host=E.hostname,E.port=""),E.username=E.password="",E.auth&&(y=E.auth.indexOf(":"),~y?(E.username=E.auth.slice(0,y),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=E.auth.slice(y+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(E.auth)),E.auth=E.password?E.username+":"+E.password:E.username),E.origin=E.protocol!=="file:"&&V(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString()}function N(r,u,S){var G=this;switch(r){case"query":typeof u=="string"&&u.length&&(u=(S||l.parse)(u)),G[r]=u;break;case"port":G[r]=u,e(u,G.protocol)?u&&(G.host=G.hostname+":"+u):(G.host=G.hostname,G[r]="");break;case"hostname":G[r]=u,G.port&&(u+=":"+G.port),G.host=u;break;case"host":G[r]=u,a.test(u)?(u=u.split(":"),G.port=u.pop(),G.hostname=u.join(":")):(G.hostname=u,G.port="");break;case"protocol":G.protocol=u.toLowerCase(),G.slashes=!S;break;case"pathname":case"hash":if(u){var J=r==="pathname"?"/":"#";G[r]=u.charAt(0)!==J?J+u:u}else G[r]=u;break;case"username":case"password":G[r]=encodeURIComponent(u);break;case"auth":var Y=u.indexOf(":");~Y?(G.username=u.slice(0,Y),G.username=encodeURIComponent(decodeURIComponent(G.username)),G.password=u.slice(Y+1),G.password=encodeURIComponent(decodeURIComponent(G.password))):G.username=encodeURIComponent(decodeURIComponent(u))}for(var L=0;L<F.length;L++){var y=F[L];y[4]&&(G[y[1]]=G[y[1]].toLowerCase())}return G.auth=G.password?G.username+":"+G.password:G.username,G.origin=G.protocol!=="file:"&&V(G.protocol)&&G.host?G.protocol+"//"+G.host:"null",G.href=G.toString(),G}function b(r){(!r||typeof r!="function")&&(r=l.stringify);var u,S=this,G=S.host,J=S.protocol;J&&J.charAt(J.length-1)!==":"&&(J+=":");var Y=J+(S.protocol&&S.slashes||V(S.protocol)?"//":"");return S.username?(Y+=S.username,S.password&&(Y+=":"+S.password),Y+="@"):S.password?(Y+=":"+S.password,Y+="@"):S.protocol!=="file:"&&V(S.protocol)&&!G&&S.pathname!=="/"&&(Y+="@"),(G[G.length-1]===":"||a.test(S.hostname)&&!S.port)&&(G+=":"),Y+=G+S.pathname,u=typeof S.query=="object"?r(S.query):S.query,u&&(Y+=u.charAt(0)!=="?"?"?"+u:u),S.hash&&(Y+=S.hash),Y}return m.prototype={set:N,toString:b},m.extractProtocol=W,m.location=h,m.trimLeft=c,m.qs=l,Um=m,Um}var SY=MY();const TY=Ad(SY);function JY(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var l=Math.random()*16|0,t=e==="x"?l:l&3|8;return t.toString(16)})}function Zm(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Zm=function(){return l};var e,l={},t=Object.prototype,d=t.hasOwnProperty,n=Object.defineProperty||function(B,X,k){B[X]=k.value},a=typeof Symbol=="function"?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function F(B,X,k){return Object.defineProperty(B,X,{value:k,enumerable:!0,configurable:!0,writable:!0}),B[X]}try{F({},"")}catch{F=function(k,w,D){return k[w]=D}}function o(B,X,k,w){var D=X&&X.prototype instanceof b?X:b,x=Object.create(D.prototype),K=new j(w||[]);return n(x,"_invoke",{value:z(B,k,K)}),x}function h(B,X,k){try{return{type:"normal",arg:B.call(X,k)}}catch(w){return{type:"throw",arg:w}}}l.wrap=o;var V="suspendedStart",W="suspendedYield",Q="executing",m="completed",N={};function b(){}function r(){}function u(){}var S={};F(S,i,function(){return this});var G=Object.getPrototypeOf,J=G&&G(G(C([])));J&&J!==t&&d.call(J,i)&&(S=J);var Y=u.prototype=b.prototype=Object.create(S);function L(B){["next","throw","return"].forEach(function(X){F(B,X,function(k){return this._invoke(X,k)})})}function y(B,X){function k(D,x,K,A){var P=h(B[D],B,x);if(P.type!=="throw"){var q=P.arg,_=q.value;return _&&ga(_)=="object"&&d.call(_,"__await")?X.resolve(_.__await).then(function(g){k("next",g,K,A)},function(g){k("throw",g,K,A)}):X.resolve(_).then(function(g){q.value=g,K(q)},function(g){return k("throw",g,K,A)})}A(P.arg)}var w;n(this,"_invoke",{value:function(x,K){function A(){return new X(function(P,q){k(x,K,P,q)})}return w=w?w.then(A,A):A()}})}function z(B,X,k){var w=V;return function(D,x){if(w===Q)throw Error("Generator is already running");if(w===m){if(D==="throw")throw x;return{value:e,done:!0}}for(k.method=D,k.arg=x;;){var K=k.delegate;if(K){var A=I(K,k);if(A){if(A===N)continue;return A}}if(k.method==="next")k.sent=k._sent=k.arg;else if(k.method==="throw"){if(w===V)throw w=m,k.arg;k.dispatchException(k.arg)}else k.method==="return"&&k.abrupt("return",k.arg);w=Q;var P=h(B,X,k);if(P.type==="normal"){if(w=k.done?m:W,P.arg===N)continue;return{value:P.arg,done:k.done}}P.type==="throw"&&(w=m,k.method="throw",k.arg=P.arg)}}}function I(B,X){var k=X.method,w=B.iterator[k];if(w===e)return X.delegate=null,k==="throw"&&B.iterator.return&&(X.method="return",X.arg=e,I(B,X),X.method==="throw")||k!=="return"&&(X.method="throw",X.arg=new TypeError("The iterator does not provide a '"+k+"' method")),N;var D=h(w,B.iterator,X.arg);if(D.type==="throw")return X.method="throw",X.arg=D.arg,X.delegate=null,N;var x=D.arg;return x?x.done?(X[B.resultName]=x.value,X.next=B.nextLoc,X.method!=="return"&&(X.method="next",X.arg=e),X.delegate=null,N):x:(X.method="throw",X.arg=new TypeError("iterator result is not an object"),X.delegate=null,N)}function O(B){var X={tryLoc:B[0]};1 in B&&(X.catchLoc=B[1]),2 in B&&(X.finallyLoc=B[2],X.afterLoc=B[3]),this.tryEntries.push(X)}function E(B){var X=B.completion||{};X.type="normal",delete X.arg,B.completion=X}function j(B){this.tryEntries=[{tryLoc:"root"}],B.forEach(O,this),this.reset(!0)}function C(B){if(B||B===""){var X=B[i];if(X)return X.call(B);if(typeof B.next=="function")return B;if(!isNaN(B.length)){var k=-1,w=function D(){for(;++k<B.length;)if(d.call(B,k))return D.value=B[k],D.done=!1,D;return D.value=e,D.done=!0,D};return w.next=w}}throw new TypeError(ga(B)+" is not iterable")}return r.prototype=u,n(Y,"constructor",{value:u,configurable:!0}),n(u,"constructor",{value:r,configurable:!0}),r.displayName=F(u,c,"GeneratorFunction"),l.isGeneratorFunction=function(B){var X=typeof B=="function"&&B.constructor;return!!X&&(X===r||(X.displayName||X.name)==="GeneratorFunction")},l.mark=function(B){return Object.setPrototypeOf?Object.setPrototypeOf(B,u):(B.__proto__=u,F(B,c,"GeneratorFunction")),B.prototype=Object.create(Y),B},l.awrap=function(B){return{__await:B}},L(y.prototype),F(y.prototype,s,function(){return this}),l.AsyncIterator=y,l.async=function(B,X,k,w,D){D===void 0&&(D=Promise);var x=new y(o(B,X,k,w),D);return l.isGeneratorFunction(X)?x:x.next().then(function(K){return K.done?K.value:x.next()})},L(Y),F(Y,c,"Generator"),F(Y,i,function(){return this}),F(Y,"toString",function(){return"[object Generator]"}),l.keys=function(B){var X=Object(B),k=[];for(var w in X)k.push(w);return k.reverse(),function D(){for(;k.length;){var x=k.pop();if(x in X)return D.value=x,D.done=!1,D}return D.done=!0,D}},l.values=C,j.prototype={constructor:j,reset:function(X){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!X)for(var k in this)k.charAt(0)==="t"&&d.call(this,k)&&!isNaN(+k.slice(1))&&(this[k]=e)},stop:function(){this.done=!0;var X=this.tryEntries[0].completion;if(X.type==="throw")throw X.arg;return this.rval},dispatchException:function(X){if(this.done)throw X;var k=this;function w(q,_){return K.type="throw",K.arg=X,k.next=q,_&&(k.method="next",k.arg=e),!!_}for(var D=this.tryEntries.length-1;D>=0;--D){var x=this.tryEntries[D],K=x.completion;if(x.tryLoc==="root")return w("end");if(x.tryLoc<=this.prev){var A=d.call(x,"catchLoc"),P=d.call(x,"finallyLoc");if(A&&P){if(this.prev<x.catchLoc)return w(x.catchLoc,!0);if(this.prev<x.finallyLoc)return w(x.finallyLoc)}else if(A){if(this.prev<x.catchLoc)return w(x.catchLoc,!0)}else{if(!P)throw Error("try statement without catch or finally");if(this.prev<x.finallyLoc)return w(x.finallyLoc)}}}},abrupt:function(X,k){for(var w=this.tryEntries.length-1;w>=0;--w){var D=this.tryEntries[w];if(D.tryLoc<=this.prev&&d.call(D,"finallyLoc")&&this.prev<D.finallyLoc){var x=D;break}}x&&(X==="break"||X==="continue")&&x.tryLoc<=k&&k<=x.finallyLoc&&(x=null);var K=x?x.completion:{};return K.type=X,K.arg=k,x?(this.method="next",this.next=x.finallyLoc,N):this.complete(K)},complete:function(X,k){if(X.type==="throw")throw X.arg;return X.type==="break"||X.type==="continue"?this.next=X.arg:X.type==="return"?(this.rval=this.arg=X.arg,this.method="return",this.next="end"):X.type==="normal"&&k&&(this.next=k),N},finish:function(X){for(var k=this.tryEntries.length-1;k>=0;--k){var w=this.tryEntries[k];if(w.finallyLoc===X)return this.complete(w.completion,w.afterLoc),E(w),N}},catch:function(X){for(var k=this.tryEntries.length-1;k>=0;--k){var w=this.tryEntries[k];if(w.tryLoc===X){var D=w.completion;if(D.type==="throw"){var x=D.arg;E(w)}return x}}throw Error("illegal catch attempt")},delegateYield:function(X,k,w){return this.delegate={iterator:C(X),resultName:k,nextLoc:w},this.method==="next"&&(this.arg=e),N}},l}function cp(e,l,t,d,n,a,i){try{var s=e[a](i),c=s.value}catch(F){t(F);return}s.done?l(c):Promise.resolve(c).then(d,n)}function GY(e){return function(){var l=this,t=arguments;return new Promise(function(d,n){var a=e.apply(l,t);function i(c){cp(a,d,n,i,s,"next",c)}function s(c){cp(a,d,n,i,s,"throw",c)}i(void 0)})}}function Up(e,l){return BY(e)||XY(e,l)||Zp(e,l)||yY()}function yY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
15
|
+
Uppy plugins must have unique \`id\` options.`;throw new Error(i)}return l.VERSION&&this.log(`Using ${n} v${l.VERSION}`),d.type in H(this,od)?H(this,od)[d.type].push(d):H(this,od)[d.type]=[d],d.install(),this.emit("plugin-added",d),this}getPlugin(l){for(const t of Object.values(H(this,od))){const d=t.find(n=>n.id===l);if(d!=null)return d}}[Symbol.for("uppy test: getPlugins")](l){return H(this,od)[l]}iteratePlugins(l){Object.values(H(this,od)).flat(1).forEach(l)}removePlugin(l){this.log(`Removing plugin ${l.id}`),this.emit("plugin-remove",l),l.uninstall&&l.uninstall();const t=H(this,od)[l.type],d=t.findIndex(i=>i.id===l.id);d!==-1&&t.splice(d,1);const a={plugins:{...this.getState().plugins,[l.id]:void 0}};this.setState(a)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),H(this,z0).call(this),this.iteratePlugins(l=>{this.removePlugin(l)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",H(this,Ya)),window.removeEventListener("offline",H(this,Ya)))}hideInfo(){const{info:l}=this.getState();this.setState({info:l.slice(1)}),this.emit("info-hidden")}info(l,t="info",d=3e3){const n=typeof l=="object";this.setState({info:[...this.getState().info,{type:t,message:n?l.message:l,details:n?l.details:null}]}),setTimeout(()=>this.hideInfo(),d),this.emit("info-visible")}log(l,t){const{logger:d}=this.opts;switch(t){case"error":d.error(l);break;case"warning":d.warn(l);break;default:d.debug(l);break}}registerRequestClient(l,t){H(this,L0).set(l,t)}getRequestClientForFile(l){if(!("remote"in l&&l.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${l.id}`);const t=H(this,L0).get(l.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${l.remote.requestClientId}" not registered for file "${l.id}"`);return t}async restore(l){this.log(`Core: Running restored upload "${l}"`);const t=await Zl(this,Wl,v0).call(this,l);return this.emit("complete",t),t}[Symbol.for("uppy test: createUpload")](...l){return Zl(this,Wl,O0).call(this,...l)}addResultData(l,t){if(!Zl(this,Wl,QX).call(this,l)){this.log(`Not setting result for an upload that has been removed: ${l}`);return}const{currentUploads:d}=this.getState(),n={...d[l],result:{...d[l].result,...t}};this.setState({currentUploads:{...d,[l]:n}})}async upload(){var n;(n=H(this,od).uploader)!=null&&n.length||this.log("No uploader type plugins are used","warning");let{files:l}=this.getState();if(Zl(this,Wl,mb).call(this).length>0){const a=await Zl(this,Wl,Nb).call(this);if(!(this.getFiles().filter(s=>s.progress.uploadStarted==null).length>0))return this.emit("complete",a),a;({files:l}=this.getState())}const d=this.opts.onBeforeUpload(l);if(d===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");d&&typeof d=="object"&&(l=d,this.setState({files:l}));try{if(H(this,hd).validateMinNumberOfFiles(l),!Zl(this,Wl,FX).call(this,l))throw new Ae(this.i18n("missingRequiredMetaField"));const{currentUploads:a}=this.getState(),i=Object.values(a).flatMap(o=>o.fileIDs),s=Object.keys(l).filter(o=>{const h=this.getFile(o);return h&&!h.progress.uploadStarted&&!i.includes(o)}),c=Zl(this,Wl,O0).call(this,s),F=await Zl(this,Wl,v0).call(this,c);return this.emit("complete",F),F}catch(a){throw Zl(this,Wl,os).call(this,[a]),a}}};od=new WeakMap,hd=new WeakMap,z0=new WeakMap,ns=new WeakMap,RU=new WeakMap,rU=new WeakMap,as=new WeakMap,Wl=new WeakSet,os=function(l){for(const i of l)i.isRestriction?this.emit("restriction-failed",i.file,i):this.emit("error",i,i.file),this.log(i,"warning");const t=l.filter(i=>i.isUserFacing),d=4,n=t.slice(0,d),a=t.slice(d);n.forEach(({message:i,details:s=""})=>{this.info({message:i,details:s},"error",this.opts.infoTimeout)}),a.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:a.length})})},Vb=function(l){const{missingFields:t,error:d}=H(this,hd).getMissingRequiredMetaFields(l);return t.length>0?(this.setFileState(l.id,{missingRequiredMetaFields:t,error:d.message}),this.log(d.message),this.emit("restriction-failed",l,d),!1):(t.length===0&&l.missingRequiredMetaFields&&this.setFileState(l.id,{missingRequiredMetaFields:[]}),!0)},FX=function(l){let t=!0;for(const d of Object.values(l))Zl(this,Wl,Vb).call(this,d)||(t=!1);return t},oX=function(l){const{allowNewUpload:t}=this.getState();if(t===!1){const d=new Ae(this.i18n("noMoreFilesAllowed"),{file:l});throw Zl(this,Wl,os).call(this,[d]),d}},hX=function(l){const t=l instanceof File?{name:l.name,type:l.type,size:l.size,data:l,meta:{},isRemote:!1,source:void 0,preview:void 0}:l,d=Yb(t),n=AB(d,t),a=Bb(n).extension,i=vX(t,this.getID()),s={...t.meta,name:n,type:d},c=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:i,name:n,extension:a||"",meta:{...this.getState().meta,...s},type:d,progress:{percentage:0,bytesUploaded:!1,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isGhost:!1,...t.isRemote?{isRemote:!0,remote:t.remote,data:t.data}:{isRemote:!1,data:t.data},preview:t.preview}},Wb=function(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(l=>{l.isRestriction||this.log(l.stack||l.message||l)})},4))},Qb=function(l){let{files:t}=this.getState(),d={...t};const n=[],a=[];for(const i of l)try{let s=Zl(this,Wl,hX).call(this,i);Zl(this,Wl,oX).call(this,s);const c=t[s.id],F=c==null?void 0:c.isGhost;if(F&&!s.isRemote){if(s.data==null)throw new Error("File data is missing");s={...c,isGhost:!1,data:s.data},this.log(`Replaced the blob in the restored ghost file: ${s.name}, ${s.id}`)}const o=this.opts.onBeforeFileAdded(s,d);if(t=this.getState().files,d={...t,...d},!o&&this.checkIfFileAlreadyExists(s.id))throw new Ae(this.i18n("noDuplicates",{fileName:s.name??this.i18n("unnamed")}),{file:s});if(o===!1&&!F)throw new Ae("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:s});typeof o=="object"&&o!==null&&(s=o),H(this,hd).validateSingleFile(s),d[s.id]=s,n.push(s)}catch(s){a.push(s)}try{H(this,hd).validateAggregateRestrictions(Object.values(t),n)}catch(i){return a.push(i),{nextFilesState:t,validFilesToAdd:[],errors:a}}return{nextFilesState:d,validFilesToAdd:n,errors:a}},mb=function(){const{files:l}=this.getState();return Object.keys(l).filter(t=>{const d=l[t];return d.error&&(!d.missingRequiredMetaFields||d.missingRequiredMetaFields.length===0)})},Nb=async function(){const l=Zl(this,Wl,mb).call(this),t={...this.getState().files};if(l.forEach(n=>{t[n]={...t[n],isPaused:!1,error:null}}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(l)),l.length===0)return{successful:[],failed:[]};const d=Zl(this,Wl,O0).call(this,l,{forceAllowNewUpload:!0});return Zl(this,Wl,v0).call(this,d)},tQ=new WeakMap,Rb=function(){const l=Zl(this,Wl,VX).call(this);let t=null;l!=null&&(t=Math.round(l*100),t>100?t=100:t<0&&(t=0)),this.emit("progress",t??0),this.setState({totalProgress:t??0})},is=new WeakMap,VX=function(){const t=this.getFiles().filter(c=>c.progress.uploadStarted||c.progress.preprocess||c.progress.postprocess);if(t.length===0)return 0;if(t.every(c=>c.progress.uploadComplete))return 1;const d=c=>c.progress.bytesTotal!=null&&c.progress.bytesTotal!==0,n=t.filter(d),a=t.filter(c=>!d(c));if(n.every(c=>c.progress.uploadComplete)&&a.length>0&&!a.every(c=>c.progress.uploadComplete))return null;const i=n.reduce((c,F)=>c+(F.progress.bytesTotal??0),0),s=n.reduce((c,F)=>c+(F.progress.bytesUploaded||0),0);return i===0?0:s/i},WX=function(){const l=(n,a,i)=>{let s=n.message||"Unknown error";n.details&&(s+=` ${n.details}`),this.setState({error:s}),a!=null&&a.id in this.getState().files&&this.setFileState(a.id,{error:s,response:i})};this.on("error",l),this.on("upload-error",(n,a,i)=>{if(l(a,n,i),typeof a=="object"&&a.message){this.log(a.message,"error");const s=new Error(this.i18n("failedToUpload",{file:(n==null?void 0:n.name)??""}));s.isUserFacing=!0,s.details=a.message,a.details&&(s.details+=` ${a.details}`),Zl(this,Wl,os).call(this,[s])}else Zl(this,Wl,os).call(this,[a])});let t=null;this.on("upload-stalled",(n,a)=>{const{message:i}=n,s=a.map(c=>c.meta.name).join(", ");t||(this.info({message:i,details:s},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${i} ${s}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const d=n=>{const a=n.filter(s=>{const c=s!=null&&this.getFile(s.id);return c||this.log(`Not setting progress for a file that has been removed: ${s==null?void 0:s.id}`),c}),i=Object.fromEntries(a.map(s=>[s.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:s.size}}]));this.patchFilesState(i)};this.on("upload-start",d),this.on("upload-progress",H(this,tQ)),this.on("upload-success",(n,a)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}const i=this.getFile(n.id).progress,s=H(this,as).size>0;this.setFileState(n.id,{progress:{...i,postprocess:s?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!s&&{complete:!0},percentage:100,bytesUploaded:i.bytesTotal},response:a,uploadURL:a.uploadURL,isPaused:!1}),n.size==null&&this.setFileState(n.id,{size:a.bytesUploaded||i.bytesTotal}),H(this,is).call(this)}),this.on("preprocess-progress",(n,a)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}this.setFileState(n.id,{progress:{...this.getFile(n.id).progress,preprocess:a}})}),this.on("preprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}const a={...this.getState().files};a[n.id]={...a[n.id],progress:{...a[n.id].progress}},delete a[n.id].progress.preprocess,this.setState({files:a})}),this.on("postprocess-progress",(n,a)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}this.setFileState(n.id,{progress:{...this.getState().files[n.id].progress,postprocess:a}})}),this.on("postprocess-complete",n=>{const a=n&&this.getFile(n.id);if(a==null){this.log(`Not setting progress for a file that has been removed: ${n==null?void 0:n.id}`);return}const{postprocess:i,...s}=a.progress;this.patchFilesState({[a.id]:{progress:{...s,complete:!0}}})}),this.on("restored",()=>{H(this,is).call(this)}),this.on("dashboard:file-edit-complete",n=>{n&&Zl(this,Wl,Vb).call(this,n)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",H(this,Ya)),window.addEventListener("offline",H(this,Ya)),setTimeout(H(this,Ya),3e3))},Ya=new WeakMap,L0=new WeakMap,O0=function(l,t={}){const{forceAllowNewUpload:d=!1}=t,{allowNewUpload:n,currentUploads:a}=this.getState();if(!n&&!d)throw new Error("Cannot create a new upload: already uploading.");const i=$Q();return this.emit("upload",i,this.getFilesByIds(l)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...a,[i]:{fileIDs:l,step:0,result:{}}}}),i},QX=function(l){const{currentUploads:t}=this.getState();return t[l]},rb=function(l){const{[l]:t,...d}=this.getState().currentUploads;this.setState({currentUploads:d})},v0=async function(l){const t=()=>{const{currentUploads:i}=this.getState();return i[l]};let d=t();if(!d)throw new Error("Nonexistent upload");const n=[...H(this,RU),...H(this,rU),...H(this,as)];try{for(let i=d.step||0;i<n.length&&d;i++){const s=n[i];this.setState({currentUploads:{...this.getState().currentUploads,[l]:{...d,step:i}}});const c=d.fileIDs.filter(F=>!this.getFile(F).progress.uploadComplete);await s(c,l),d=t()}}catch(i){throw Zl(this,Wl,rb).call(this,l),i}if(d){d.fileIDs.forEach(F=>{const o=this.getFile(F);o!=null&&o.progress.postprocess&&this.emit("postprocess-complete",o)});const i=d.fileIDs.map(F=>this.getFile(F)),s=i.filter(F=>!F.error),c=i.filter(F=>F.error);this.addResultData(l,{successful:s,failed:c,uploadID:l}),d=t()}let a;return d&&(a=d.result,Zl(this,Wl,rb).call(this,l)),a==null&&(this.log(`Not setting result for an upload that has been removed: ${l}`),a={successful:[],failed:[],uploadID:l}),a},f(eQ,"VERSION",PB.version);let lm=eQ;function tm(e){"@babel/helpers - typeof";return tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},tm(e)}function $B(e,l,t){return Object.defineProperty(e,"prototype",{writable:!1}),e}function lY(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function tY(e,l,t){return l=EU(l),eY(e,dm()?Reflect.construct(l,t||[],EU(e).constructor):l.apply(e,t))}function eY(e,l){if(l&&(tm(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dY(e)}function dY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nY(e,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(l&&l.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),l&&wU(e,l)}function em(e){var l=typeof Map=="function"?new Map:void 0;return em=function(d){if(d===null||!iY(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l<"u"){if(l.has(d))return l.get(d);l.set(d,n)}function n(){return aY(d,arguments,EU(this).constructor)}return n.prototype=Object.create(d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),wU(n,d)},em(e)}function aY(e,l,t){if(dm())return Reflect.construct.apply(null,arguments);var d=[null];d.push.apply(d,l);var n=new(e.bind.apply(e,d));return t&&wU(n,t.prototype),n}function dm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dm=function(){return!!e})()}function iY(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function wU(e,l){return wU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,n){return d.__proto__=n,d},wU(e,l)}function EU(e){return EU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},EU(e)}var to=(function(e){function l(t){var d,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(lY(this,l),d=tY(this,l,[t]),d.originalRequest=a,d.originalResponse=i,d.causingError=n,n!=null&&(t+=", caused by ".concat(n.toString())),a!=null){var s=a.getHeader("X-Request-ID")||"n/a",c=a.getMethod(),F=a.getURL(),o=i?i.getStatus():"n/a",h=i?i.getBody()||"":"n/a";t+=", originated from request (method: ".concat(c,", url: ").concat(F,", response code: ").concat(o,", response text: ").concat(h,", request id: ").concat(s,")")}return d.message=t,d}return nY(l,e),$B(l)})(em(Error));function sg(e){}function CU(e){"@babel/helpers - typeof";return CU=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},CU(e)}function sY(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function cY(e,l){for(var t=0;t<l.length;t++){var d=l[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,ZY(d.key),d)}}function UY(e,l,t){return l&&cY(e.prototype,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZY(e){var l=FY(e,"string");return CU(l)=="symbol"?l:l+""}function FY(e,l){if(CU(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var d=t.call(e,l);if(CU(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var oY=(function(){function e(){sY(this,e)}return UY(e,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(t){return Promise.resolve([])}},{key:"removeUpload",value:function(t){return Promise.resolve()}},{key:"addUpload",value:function(t,d){return Promise.resolve(null)}}])})();const xu="3.7.8",hY=xu,Ns=typeof Buffer=="function",gu=typeof TextDecoder=="function"?new TextDecoder:void 0,ju=typeof TextEncoder=="function"?new TextEncoder:void 0,xU=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),eo=(e=>{let l={};return e.forEach((t,d)=>l[t]=d),l})(xU),VY=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Gt=String.fromCharCode.bind(String),Ou=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),vu=e=>e.replace(/=/g,"").replace(/[+\/]/g,l=>l=="+"?"-":"_"),fu=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Ku=e=>{let l,t,d,n,a="";const i=e.length%3;for(let s=0;s<e.length;){if((t=e.charCodeAt(s++))>255||(d=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");l=t<<16|d<<8|n,a+=xU[l>>18&63]+xU[l>>12&63]+xU[l>>6&63]+xU[l&63]}return i?a.slice(0,i-3)+"===".substring(i):a},nm=typeof btoa=="function"?e=>btoa(e):Ns?e=>Buffer.from(e,"binary").toString("base64"):Ku,am=Ns?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let d=0,n=e.length;d<n;d+=4096)t.push(Gt.apply(null,e.subarray(d,d+4096)));return nm(t.join(""))},no=(e,l=!1)=>l?vu(am(e)):am(e),WY=e=>{if(e.length<2){var l=e.charCodeAt(0);return l<128?e:l<2048?Gt(192|l>>>6)+Gt(128|l&63):Gt(224|l>>>12&15)+Gt(128|l>>>6&63)+Gt(128|l&63)}else{var l=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Gt(240|l>>>18&7)+Gt(128|l>>>12&63)+Gt(128|l>>>6&63)+Gt(128|l&63)}},QY=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Hu=e=>e.replace(QY,WY),Pu=Ns?e=>Buffer.from(e,"utf8").toString("base64"):ju?e=>am(ju.encode(e)):e=>nm(Hu(e)),Rs=(e,l=!1)=>l?vu(Pu(e)):Pu(e),Au=e=>Rs(e,!0),mY=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,NY=e=>{switch(e.length){case 4:var l=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),t=l-65536;return Gt((t>>>10)+55296)+Gt((t&1023)+56320);case 3:return Gt((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Gt((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},_u=e=>e.replace(mY,NY),qu=e=>{if(e=e.replace(/\s+/g,""),!VY.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let l,t,d,n=[];for(let a=0;a<e.length;)l=eo[e.charAt(a++)]<<18|eo[e.charAt(a++)]<<12|(t=eo[e.charAt(a++)])<<6|(d=eo[e.charAt(a++)]),t===64?n.push(Gt(l>>16&255)):d===64?n.push(Gt(l>>16&255,l>>8&255)):n.push(Gt(l>>16&255,l>>8&255,l&255));return n.join("")},im=typeof atob=="function"?e=>atob(fu(e)):Ns?e=>Buffer.from(e,"base64").toString("binary"):qu,$u=Ns?e=>Ou(Buffer.from(e,"base64")):e=>Ou(im(e).split("").map(l=>l.charCodeAt(0))),lp=e=>$u(tp(e)),RY=Ns?e=>Buffer.from(e,"base64").toString("utf8"):gu?e=>gu.decode($u(e)):e=>_u(im(e)),tp=e=>fu(e.replace(/[-_]/g,l=>l=="-"?"+":"/")),sm=e=>RY(tp(e)),rY=e=>{if(typeof e!="string")return!1;const l=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(l)||!/[^\s0-9a-zA-Z\-_]/.test(l)},ep=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),dp=function(){const e=(l,t)=>Object.defineProperty(String.prototype,l,ep(t));e("fromBase64",function(){return sm(this)}),e("toBase64",function(l){return Rs(this,l)}),e("toBase64URI",function(){return Rs(this,!0)}),e("toBase64URL",function(){return Rs(this,!0)}),e("toUint8Array",function(){return lp(this)})},np=function(){const e=(l,t)=>Object.defineProperty(Uint8Array.prototype,l,ep(t));e("toBase64",function(l){return no(this,l)}),e("toBase64URI",function(){return no(this,!0)}),e("toBase64URL",function(){return no(this,!0)})},bY={version:xu,VERSION:hY,atob:im,atobPolyfill:qu,btoa:nm,btoaPolyfill:Ku,fromBase64:sm,toBase64:Rs,encode:Rs,encodeURI:Au,encodeURL:Au,utob:Hu,btou:_u,decode:sm,isValid:rY,fromUint8Array:no,toUint8Array:lp,extendString:dp,extendUint8Array:np,extendBuiltins:()=>{dp(),np()}};var cm,ap;function uY(){return ap||(ap=1,cm=function(l,t){if(t=t.split(":")[0],l=+l,!l)return!1;switch(t){case"http":case"ws":return l!==80;case"https":case"wss":return l!==443;case"ftp":return l!==21;case"gopher":return l!==70;case"file":return!1}return l!==0}),cm}var ao={},ip;function pY(){if(ip)return ao;ip=1;var e=Object.prototype.hasOwnProperty,l;function t(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}function d(i){try{return encodeURIComponent(i)}catch{return null}}function n(i){for(var s=/([^=?#&]+)=?([^&]*)/g,c={},F;F=s.exec(i);){var o=t(F[1]),h=t(F[2]);o===null||h===null||o in c||(c[o]=h)}return c}function a(i,s){s=s||"";var c=[],F,o;typeof s!="string"&&(s="?");for(o in i)if(e.call(i,o)){if(F=i[o],!F&&(F===null||F===l||isNaN(F))&&(F=""),o=d(o),F=d(F),o===null||F===null)continue;c.push(o+"="+F)}return c.length?s+c.join("&"):""}return ao.stringify=a,ao.parse=n,ao}var Um,sp;function MY(){if(sp)return Um;sp=1;var e=uY(),l=pY(),t=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,d=/[\n\r\t]/g,n=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,a=/:\d+$/,i=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,s=/^[a-zA-Z]:/;function c(r){return(r||"").toString().replace(t,"")}var F=[["#","hash"],["?","query"],function(u,S){return V(S.protocol)?u.replace(/\\/g,"/"):u},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],o={hash:1,query:1};function h(r){var u;typeof window<"u"?u=window:typeof ms<"u"?u=ms:typeof self<"u"?u=self:u={};var S=u.location||{};r=r||S;var G={},J=typeof r,Y;if(r.protocol==="blob:")G=new m(unescape(r.pathname),{});else if(J==="string"){G=new m(r,{});for(Y in o)delete G[Y]}else if(J==="object"){for(Y in r)Y in o||(G[Y]=r[Y]);G.slashes===void 0&&(G.slashes=n.test(r.href))}return G}function V(r){return r==="file:"||r==="ftp:"||r==="http:"||r==="https:"||r==="ws:"||r==="wss:"}function W(r,u){r=c(r),r=r.replace(d,""),u=u||{};var S=i.exec(r),G=S[1]?S[1].toLowerCase():"",J=!!S[2],Y=!!S[3],L=0,y;return J?Y?(y=S[2]+S[3]+S[4],L=S[2].length+S[3].length):(y=S[2]+S[4],L=S[2].length):Y?(y=S[3]+S[4],L=S[3].length):y=S[4],G==="file:"?L>=2&&(y=y.slice(2)):V(G)?y=S[4]:G?J&&(y=y.slice(2)):L>=2&&V(u.protocol)&&(y=S[4]),{protocol:G,slashes:J||V(G),slashesCount:L,rest:y}}function Q(r,u){if(r==="")return u;for(var S=(u||"/").split("/").slice(0,-1).concat(r.split("/")),G=S.length,J=S[G-1],Y=!1,L=0;G--;)S[G]==="."?S.splice(G,1):S[G]===".."?(S.splice(G,1),L++):L&&(G===0&&(Y=!0),S.splice(G,1),L--);return Y&&S.unshift(""),(J==="."||J==="..")&&S.push(""),S.join("/")}function m(r,u,S){if(r=c(r),r=r.replace(d,""),!(this instanceof m))return new m(r,u,S);var G,J,Y,L,y,z,I=F.slice(),O=typeof u,E=this,j=0;for(O!=="object"&&O!=="string"&&(S=u,u=null),S&&typeof S!="function"&&(S=l.parse),u=h(u),J=W(r||"",u),G=!J.protocol&&!J.slashes,E.slashes=J.slashes||G&&u.slashes,E.protocol=J.protocol||u.protocol||"",r=J.rest,(J.protocol==="file:"&&(J.slashesCount!==2||s.test(r))||!J.slashes&&(J.protocol||J.slashesCount<2||!V(E.protocol)))&&(I[3]=[/(.*)/,"pathname"]);j<I.length;j++){if(L=I[j],typeof L=="function"){r=L(r,E);continue}Y=L[0],z=L[1],Y!==Y?E[z]=r:typeof Y=="string"?(y=Y==="@"?r.lastIndexOf(Y):r.indexOf(Y),~y&&(typeof L[2]=="number"?(E[z]=r.slice(0,y),r=r.slice(y+L[2])):(E[z]=r.slice(y),r=r.slice(0,y)))):(y=Y.exec(r))&&(E[z]=y[1],r=r.slice(0,y.index)),E[z]=E[z]||G&&L[3]&&u[z]||"",L[4]&&(E[z]=E[z].toLowerCase())}S&&(E.query=S(E.query)),G&&u.slashes&&E.pathname.charAt(0)!=="/"&&(E.pathname!==""||u.pathname!=="")&&(E.pathname=Q(E.pathname,u.pathname)),E.pathname.charAt(0)!=="/"&&V(E.protocol)&&(E.pathname="/"+E.pathname),e(E.port,E.protocol)||(E.host=E.hostname,E.port=""),E.username=E.password="",E.auth&&(y=E.auth.indexOf(":"),~y?(E.username=E.auth.slice(0,y),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=E.auth.slice(y+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(E.auth)),E.auth=E.password?E.username+":"+E.password:E.username),E.origin=E.protocol!=="file:"&&V(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString()}function N(r,u,S){var G=this;switch(r){case"query":typeof u=="string"&&u.length&&(u=(S||l.parse)(u)),G[r]=u;break;case"port":G[r]=u,e(u,G.protocol)?u&&(G.host=G.hostname+":"+u):(G.host=G.hostname,G[r]="");break;case"hostname":G[r]=u,G.port&&(u+=":"+G.port),G.host=u;break;case"host":G[r]=u,a.test(u)?(u=u.split(":"),G.port=u.pop(),G.hostname=u.join(":")):(G.hostname=u,G.port="");break;case"protocol":G.protocol=u.toLowerCase(),G.slashes=!S;break;case"pathname":case"hash":if(u){var J=r==="pathname"?"/":"#";G[r]=u.charAt(0)!==J?J+u:u}else G[r]=u;break;case"username":case"password":G[r]=encodeURIComponent(u);break;case"auth":var Y=u.indexOf(":");~Y?(G.username=u.slice(0,Y),G.username=encodeURIComponent(decodeURIComponent(G.username)),G.password=u.slice(Y+1),G.password=encodeURIComponent(decodeURIComponent(G.password))):G.username=encodeURIComponent(decodeURIComponent(u))}for(var L=0;L<F.length;L++){var y=F[L];y[4]&&(G[y[1]]=G[y[1]].toLowerCase())}return G.auth=G.password?G.username+":"+G.password:G.username,G.origin=G.protocol!=="file:"&&V(G.protocol)&&G.host?G.protocol+"//"+G.host:"null",G.href=G.toString(),G}function b(r){(!r||typeof r!="function")&&(r=l.stringify);var u,S=this,G=S.host,J=S.protocol;J&&J.charAt(J.length-1)!==":"&&(J+=":");var Y=J+(S.protocol&&S.slashes||V(S.protocol)?"//":"");return S.username?(Y+=S.username,S.password&&(Y+=":"+S.password),Y+="@"):S.password?(Y+=":"+S.password,Y+="@"):S.protocol!=="file:"&&V(S.protocol)&&!G&&S.pathname!=="/"&&(Y+="@"),(G[G.length-1]===":"||a.test(S.hostname)&&!S.port)&&(G+=":"),Y+=G+S.pathname,u=typeof S.query=="object"?r(S.query):S.query,u&&(Y+=u.charAt(0)!=="?"?"?"+u:u),S.hash&&(Y+=S.hash),Y}return m.prototype={set:N,toString:b},m.extractProtocol=W,m.location=h,m.trimLeft=c,m.qs=l,Um=m,Um}var SY=MY();const TY=Ad(SY);function JY(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var l=Math.random()*16|0,t=e==="x"?l:l&3|8;return t.toString(16)})}function Zm(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Zm=function(){return l};var e,l={},t=Object.prototype,d=t.hasOwnProperty,n=Object.defineProperty||function(B,X,k){B[X]=k.value},a=typeof Symbol=="function"?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function F(B,X,k){return Object.defineProperty(B,X,{value:k,enumerable:!0,configurable:!0,writable:!0}),B[X]}try{F({},"")}catch{F=function(k,w,D){return k[w]=D}}function o(B,X,k,w){var D=X&&X.prototype instanceof b?X:b,x=Object.create(D.prototype),K=new j(w||[]);return n(x,"_invoke",{value:z(B,k,K)}),x}function h(B,X,k){try{return{type:"normal",arg:B.call(X,k)}}catch(w){return{type:"throw",arg:w}}}l.wrap=o;var V="suspendedStart",W="suspendedYield",Q="executing",m="completed",N={};function b(){}function r(){}function u(){}var S={};F(S,i,function(){return this});var G=Object.getPrototypeOf,J=G&&G(G(C([])));J&&J!==t&&d.call(J,i)&&(S=J);var Y=u.prototype=b.prototype=Object.create(S);function L(B){["next","throw","return"].forEach(function(X){F(B,X,function(k){return this._invoke(X,k)})})}function y(B,X){function k(D,x,K,A){var P=h(B[D],B,x);if(P.type!=="throw"){var q=P.arg,_=q.value;return _&&ga(_)=="object"&&d.call(_,"__await")?X.resolve(_.__await).then(function(g){k("next",g,K,A)},function(g){k("throw",g,K,A)}):X.resolve(_).then(function(g){q.value=g,K(q)},function(g){return k("throw",g,K,A)})}A(P.arg)}var w;n(this,"_invoke",{value:function(x,K){function A(){return new X(function(P,q){k(x,K,P,q)})}return w=w?w.then(A,A):A()}})}function z(B,X,k){var w=V;return function(D,x){if(w===Q)throw Error("Generator is already running");if(w===m){if(D==="throw")throw x;return{value:e,done:!0}}for(k.method=D,k.arg=x;;){var K=k.delegate;if(K){var A=I(K,k);if(A){if(A===N)continue;return A}}if(k.method==="next")k.sent=k._sent=k.arg;else if(k.method==="throw"){if(w===V)throw w=m,k.arg;k.dispatchException(k.arg)}else k.method==="return"&&k.abrupt("return",k.arg);w=Q;var P=h(B,X,k);if(P.type==="normal"){if(w=k.done?m:W,P.arg===N)continue;return{value:P.arg,done:k.done}}P.type==="throw"&&(w=m,k.method="throw",k.arg=P.arg)}}}function I(B,X){var k=X.method,w=B.iterator[k];if(w===e)return X.delegate=null,k==="throw"&&B.iterator.return&&(X.method="return",X.arg=e,I(B,X),X.method==="throw")||k!=="return"&&(X.method="throw",X.arg=new TypeError("The iterator does not provide a '"+k+"' method")),N;var D=h(w,B.iterator,X.arg);if(D.type==="throw")return X.method="throw",X.arg=D.arg,X.delegate=null,N;var x=D.arg;return x?x.done?(X[B.resultName]=x.value,X.next=B.nextLoc,X.method!=="return"&&(X.method="next",X.arg=e),X.delegate=null,N):x:(X.method="throw",X.arg=new TypeError("iterator result is not an object"),X.delegate=null,N)}function O(B){var X={tryLoc:B[0]};1 in B&&(X.catchLoc=B[1]),2 in B&&(X.finallyLoc=B[2],X.afterLoc=B[3]),this.tryEntries.push(X)}function E(B){var X=B.completion||{};X.type="normal",delete X.arg,B.completion=X}function j(B){this.tryEntries=[{tryLoc:"root"}],B.forEach(O,this),this.reset(!0)}function C(B){if(B||B===""){var X=B[i];if(X)return X.call(B);if(typeof B.next=="function")return B;if(!isNaN(B.length)){var k=-1,w=function D(){for(;++k<B.length;)if(d.call(B,k))return D.value=B[k],D.done=!1,D;return D.value=e,D.done=!0,D};return w.next=w}}throw new TypeError(ga(B)+" is not iterable")}return r.prototype=u,n(Y,"constructor",{value:u,configurable:!0}),n(u,"constructor",{value:r,configurable:!0}),r.displayName=F(u,c,"GeneratorFunction"),l.isGeneratorFunction=function(B){var X=typeof B=="function"&&B.constructor;return!!X&&(X===r||(X.displayName||X.name)==="GeneratorFunction")},l.mark=function(B){return Object.setPrototypeOf?Object.setPrototypeOf(B,u):(B.__proto__=u,F(B,c,"GeneratorFunction")),B.prototype=Object.create(Y),B},l.awrap=function(B){return{__await:B}},L(y.prototype),F(y.prototype,s,function(){return this}),l.AsyncIterator=y,l.async=function(B,X,k,w,D){D===void 0&&(D=Promise);var x=new y(o(B,X,k,w),D);return l.isGeneratorFunction(X)?x:x.next().then(function(K){return K.done?K.value:x.next()})},L(Y),F(Y,c,"Generator"),F(Y,i,function(){return this}),F(Y,"toString",function(){return"[object Generator]"}),l.keys=function(B){var X=Object(B),k=[];for(var w in X)k.push(w);return k.reverse(),function D(){for(;k.length;){var x=k.pop();if(x in X)return D.value=x,D.done=!1,D}return D.done=!0,D}},l.values=C,j.prototype={constructor:j,reset:function(X){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!X)for(var k in this)k.charAt(0)==="t"&&d.call(this,k)&&!isNaN(+k.slice(1))&&(this[k]=e)},stop:function(){this.done=!0;var X=this.tryEntries[0].completion;if(X.type==="throw")throw X.arg;return this.rval},dispatchException:function(X){if(this.done)throw X;var k=this;function w(q,_){return K.type="throw",K.arg=X,k.next=q,_&&(k.method="next",k.arg=e),!!_}for(var D=this.tryEntries.length-1;D>=0;--D){var x=this.tryEntries[D],K=x.completion;if(x.tryLoc==="root")return w("end");if(x.tryLoc<=this.prev){var A=d.call(x,"catchLoc"),P=d.call(x,"finallyLoc");if(A&&P){if(this.prev<x.catchLoc)return w(x.catchLoc,!0);if(this.prev<x.finallyLoc)return w(x.finallyLoc)}else if(A){if(this.prev<x.catchLoc)return w(x.catchLoc,!0)}else{if(!P)throw Error("try statement without catch or finally");if(this.prev<x.finallyLoc)return w(x.finallyLoc)}}}},abrupt:function(X,k){for(var w=this.tryEntries.length-1;w>=0;--w){var D=this.tryEntries[w];if(D.tryLoc<=this.prev&&d.call(D,"finallyLoc")&&this.prev<D.finallyLoc){var x=D;break}}x&&(X==="break"||X==="continue")&&x.tryLoc<=k&&k<=x.finallyLoc&&(x=null);var K=x?x.completion:{};return K.type=X,K.arg=k,x?(this.method="next",this.next=x.finallyLoc,N):this.complete(K)},complete:function(X,k){if(X.type==="throw")throw X.arg;return X.type==="break"||X.type==="continue"?this.next=X.arg:X.type==="return"?(this.rval=this.arg=X.arg,this.method="return",this.next="end"):X.type==="normal"&&k&&(this.next=k),N},finish:function(X){for(var k=this.tryEntries.length-1;k>=0;--k){var w=this.tryEntries[k];if(w.finallyLoc===X)return this.complete(w.completion,w.afterLoc),E(w),N}},catch:function(X){for(var k=this.tryEntries.length-1;k>=0;--k){var w=this.tryEntries[k];if(w.tryLoc===X){var D=w.completion;if(D.type==="throw"){var x=D.arg;E(w)}return x}}throw Error("illegal catch attempt")},delegateYield:function(X,k,w){return this.delegate={iterator:C(X),resultName:k,nextLoc:w},this.method==="next"&&(this.arg=e),N}},l}function cp(e,l,t,d,n,a,i){try{var s=e[a](i),c=s.value}catch(F){t(F);return}s.done?l(c):Promise.resolve(c).then(d,n)}function GY(e){return function(){var l=this,t=arguments;return new Promise(function(d,n){var a=e.apply(l,t);function i(c){cp(a,d,n,i,s,"next",c)}function s(c){cp(a,d,n,i,s,"throw",c)}i(void 0)})}}function Up(e,l){return BY(e)||XY(e,l)||Zp(e,l)||yY()}function yY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
16
16
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XY(e,l){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var d,n,a,i,s=[],c=!0,F=!1;try{if(a=(t=t.call(e)).next,l!==0)for(;!(c=(d=a.call(t)).done)&&(s.push(d.value),s.length!==l);c=!0);}catch(o){F=!0,n=o}finally{try{if(!c&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(F)throw n}}return s}}function BY(e){if(Array.isArray(e))return e}function ga(e){"@babel/helpers - typeof";return ga=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},ga(e)}function YY(e,l){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Zp(e))||l){t&&(e=t);var d=0,n=function(){};return{s:n,n:function(){return d>=e.length?{done:!0}:{done:!1,value:e[d++]}},e:function(F){throw F},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
17
17
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,i=!1,s;return{s:function(){t=t.call(e)},n:function(){var F=t.next();return a=F.done,F},e:function(F){i=!0,s=F},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(i)throw s}}}}function Zp(e,l){if(e){if(typeof e=="string")return Fp(e,l);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Fp(e,l)}}function Fp(e,l){(l==null||l>e.length)&&(l=e.length);for(var t=0,d=new Array(l);t<l;t++)d[t]=e[t];return d}function op(e,l){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);l&&(d=d.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,d)}return t}function rs(e){for(var l=1;l<arguments.length;l++){var t=arguments[l]!=null?arguments[l]:{};l%2?op(Object(t),!0).forEach(function(d){kY(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):op(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function kY(e,l,t){return l=Vp(l),l in e?Object.defineProperty(e,l,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[l]=t,e}function zY(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function hp(e,l){for(var t=0;t<l.length;t++){var d=l[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,Vp(d.key),d)}}function LY(e,l,t){return l&&hp(e.prototype,l),t&&hp(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vp(e){var l=IY(e,"string");return ga(l)=="symbol"?l:l+""}function IY(e,l){if(ga(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var d=t.call(e,l);if(ga(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var io="tus-v1",so="ietf-draft-03",gU="ietf-draft-05",DY={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:Rp,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:io},co=(function(){function e(l,t){zY(this,e),"resume"in t&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=t,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=l,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return LY(e,[{key:"findPreviousUploads",value:function(){var t=this;return this.options.fingerprint(this.file,this.options).then(function(d){return t._urlStorage.findUploadsByFingerprint(d)})}},{key:"resumeFromPreviousUpload",value:function(t){this.url=t.uploadUrl||null,this._parallelUploadUrls=t.parallelUploadUrls||null,this._urlStorageKey=t.urlStorageKey}},{key:"start",value:function(){var t=this,d=this.file;if(!d){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![io,so,gU].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var n=this.options.retryDelays;if(n!=null&&Object.prototype.toString.call(n)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var a=0,i=["uploadUrl","uploadSize","uploadLengthDeferred"];a<i.length;a++){var s=i[a];if(this.options[s]){this._emitError(new Error("tus: cannot use the ".concat(s," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(d,this.options).then(function(c){return t._fingerprint=c,t._source?t._source:t.options.fileReader.openFile(d,t.options.chunkSize)}).then(function(c){if(t._source=c,t.options.uploadLengthDeferred)t._size=null;else if(t.options.uploadSize!=null){if(t._size=Number(t.options.uploadSize),Number.isNaN(t._size)){t._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(t._size=t._source.size,t._size==null){t._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}t.options.parallelUploads>1||t._parallelUploadUrls!=null?t._startParallelUpload():t._startSingleUpload()}).catch(function(c){t._emitError(c)})}},{key:"_startParallelUpload",value:function(){var t,d=this,n=this._size,a=0;this._parallelUploads=[];var i=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,s=(t=this.options.parallelUploadBoundaries)!==null&&t!==void 0?t:EY(this._source.size,i);this._parallelUploadUrls&&s.forEach(function(o,h){o.uploadUrl=d._parallelUploadUrls[h]||null}),this._parallelUploadUrls=new Array(s.length);var c=s.map(function(o,h){var V=0;return d._source.slice(o.start,o.end).then(function(W){var Q=W.value;return new Promise(function(m,N){var b=rs(rs({},d.options),{},{uploadUrl:o.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:d.options.metadataForPartialUploads,headers:rs(rs({},d.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:m,onError:N,onProgress:function(S){a=a-V+S,V=S,d._emitProgress(a,n)},onUploadUrlAvailable:function(){d._parallelUploadUrls[h]=r.url,d._parallelUploadUrls.filter(function(S){return!!S}).length===s.length&&d._saveUploadInUrlStorage()}}),r=new e(Q,b);r.start(),d._parallelUploads.push(r)})})}),F;Promise.all(c).then(function(){F=d._openRequest("POST",d.options.endpoint),F.setHeader("Upload-Concat","final;".concat(d._parallelUploadUrls.join(" ")));var o=Wp(d.options.metadata);return o!==""&&F.setHeader("Upload-Metadata",o),d._sendRequest(F,null)}).then(function(o){if(!bs(o.getStatus(),200)){d._emitHttpError(F,o,"tus: unexpected response while creating upload");return}var h=o.getHeader("Location");if(h==null){d._emitHttpError(F,o,"tus: invalid or missing Location header");return}d.url=rp(d.options.endpoint,h),"Created upload at ".concat(d.url),d._emitSuccess(o)}).catch(function(o){d._emitError(o)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){"Resuming upload from previous URL: ".concat(this.url),this._resumeUpload();return}if(this.options.uploadUrl!=null){"Resuming upload from provided URL: ".concat(this.options.uploadUrl),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload()}},{key:"abort",value:function(t){var d=this;if(this._parallelUploads!=null){var n=YY(this._parallelUploads),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;i.abort(t)}}catch(s){n.e(s)}finally{n.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!t||this.url==null?Promise.resolve():e.terminate(this.url,this.options).then(function(){return d._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(t,d,n,a){this._emitError(new to(n,a,t,d))}},{key:"_emitError",value:function(t){var d=this;if(!this._aborted){if(this.options.retryDelays!=null){var n=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(n&&(this._retryAttempt=0),Np(t,this._retryAttempt,this.options)){var a=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){d.start()},a);return}}if(typeof this.options.onError=="function")this.options.onError(t);else throw t}}},{key:"_emitSuccess",value:function(t){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:t})}},{key:"_emitProgress",value:function(t,d){typeof this.options.onProgress=="function"&&this.options.onProgress(t,d)}},{key:"_emitChunkComplete",value:function(t,d,n){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(t,d,n)}},{key:"_createUpload",value:function(){var t=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var d=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?d.setHeader("Upload-Defer-Length","1"):d.setHeader("Upload-Length","".concat(this._size));var n=Wp(this.options.metadata);n!==""&&d.setHeader("Upload-Metadata",n);var a;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,a=this._addChunkToRequest(d)):((this.options.protocol===so||this.options.protocol===gU)&&d.setHeader("Upload-Complete","?0"),a=this._sendRequest(d,null)),a.then(function(i){if(!bs(i.getStatus(),200)){t._emitHttpError(d,i,"tus: unexpected response while creating upload");return}var s=i.getHeader("Location");if(s==null){t._emitHttpError(d,i,"tus: invalid or missing Location header");return}if(t.url=rp(t.options.endpoint,s),"Created upload at ".concat(t.url),typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._size===0){t._emitSuccess(i),t._source.close();return}t._saveUploadInUrlStorage().then(function(){t.options.uploadDataDuringCreation?t._handleUploadResponse(d,i):(t._offset=0,t._performUpload())})}).catch(function(i){t._emitHttpError(d,null,"tus: failed to create upload",i)})}},{key:"_resumeUpload",value:function(){var t=this,d=this._openRequest("HEAD",this.url),n=this._sendRequest(d,null);n.then(function(a){var i=a.getStatus();if(!bs(i,200)){if(i===423){t._emitHttpError(d,a,"tus: upload is currently locked; retry later");return}if(bs(i,400)&&t._removeFromUrlStorage(),!t.options.endpoint){t._emitHttpError(d,a,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}t.url=null,t._createUpload();return}var s=Number.parseInt(a.getHeader("Upload-Offset"),10);if(Number.isNaN(s)){t._emitHttpError(d,a,"tus: invalid or missing offset value");return}var c=Number.parseInt(a.getHeader("Upload-Length"),10);if(Number.isNaN(c)&&!t.options.uploadLengthDeferred&&t.options.protocol===io){t._emitHttpError(d,a,"tus: invalid or missing length value");return}typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._saveUploadInUrlStorage().then(function(){if(s===c){t._emitProgress(c,c),t._emitSuccess(a);return}t._offset=s,t._performUpload()})}).catch(function(a){t._emitHttpError(d,null,"tus: failed to resume upload",a)})}},{key:"_performUpload",value:function(){var t=this;if(!this._aborted){var d;this.options.overridePatchMethod?(d=this._openRequest("POST",this.url),d.setHeader("X-HTTP-Method-Override","PATCH")):d=this._openRequest("PATCH",this.url),d.setHeader("Upload-Offset","".concat(this._offset));var n=this._addChunkToRequest(d);n.then(function(a){if(!bs(a.getStatus(),200)){t._emitHttpError(d,a,"tus: unexpected response while uploading chunk");return}t._handleUploadResponse(d,a)}).catch(function(a){t._aborted||t._emitHttpError(d,null,"tus: failed to upload chunk at offset ".concat(t._offset),a)})}}},{key:"_addChunkToRequest",value:function(t){var d=this,n=this._offset,a=this._offset+this.options.chunkSize;return t.setProgressHandler(function(i){d._emitProgress(n+i,d._size)}),this.options.protocol===io?t.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===gU&&t.setHeader("Content-Type","application/partial-upload"),(a===Number.POSITIVE_INFINITY||a>this._size)&&!this.options.uploadLengthDeferred&&(a=this._size),this._source.slice(n,a).then(function(i){var s=i.value,c=i.done,F=s!=null&&s.size?s.size:0;d.options.uploadLengthDeferred&&c&&(d._size=d._offset+F,t.setHeader("Upload-Length","".concat(d._size)));var o=d._offset+F;return!d.options.uploadLengthDeferred&&c&&o!==d._size?Promise.reject(new Error("upload was configured with a size of ".concat(d._size," bytes, but the source is done after ").concat(o," bytes"))):s===null?d._sendRequest(t):((d.options.protocol===so||d.options.protocol===gU)&&t.setHeader("Upload-Complete",c?"?1":"?0"),d._emitProgress(d._offset,d._size),d._sendRequest(t,s))})}},{key:"_handleUploadResponse",value:function(t,d){var n=Number.parseInt(d.getHeader("Upload-Offset"),10);if(Number.isNaN(n)){this._emitHttpError(t,d,"tus: invalid or missing offset value");return}if(this._emitProgress(n,this._size),this._emitChunkComplete(n-this._offset,n,this._size),this._offset=n,n===this._size){this._emitSuccess(d),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(t,d){var n=Qp(t,d,this.options);return this._req=n,n}},{key:"_removeFromUrlStorage",value:function(){var t=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(d){t._emitError(d)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var t=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var d={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?d.parallelUploadUrls=this._parallelUploadUrls:d.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,d).then(function(n){t._urlStorageKey=n})}},{key:"_sendRequest",value:function(t){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return mp(t,d,this.options)}}],[{key:"terminate",value:function(t){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Qp("DELETE",t,d);return mp(n,null,d).then(function(a){if(a.getStatus()!==204)throw new to("tus: unexpected response while terminating upload",null,n,a)}).catch(function(a){if(a instanceof to||(a=new to("tus: failed to terminate upload",a,n,null)),!Np(a,0,d))throw a;var i=d.retryDelays[0],s=d.retryDelays.slice(1),c=rs(rs({},d),{},{retryDelays:s});return new Promise(function(F){return setTimeout(F,i)}).then(function(){return e.terminate(t,c)})})}}])})();function Wp(e){return Object.entries(e).map(function(l){var t=Up(l,2),d=t[0],n=t[1];return"".concat(d," ").concat(bY.encode(String(n)))}).join(",")}function bs(e,l){return e>=l&&e<l+100}function Qp(e,l,t){var d=t.httpStack.createRequest(e,l);t.protocol===so?d.setHeader("Upload-Draft-Interop-Version","5"):t.protocol===gU?d.setHeader("Upload-Draft-Interop-Version","6"):d.setHeader("Tus-Resumable","1.0.0");for(var n=t.headers||{},a=0,i=Object.entries(n);a<i.length;a++){var s=Up(i[a],2),c=s[0],F=s[1];d.setHeader(c,F)}if(t.addRequestId){var o=JY();d.setHeader("X-Request-ID",o)}return d}function mp(e,l,t){return Fm.apply(this,arguments)}function Fm(){return Fm=GY(Zm().mark(function e(l,t,d){var n;return Zm().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(typeof d.onBeforeRequest!="function"){i.next=3;break}return i.next=3,d.onBeforeRequest(l);case 3:return i.next=5,l.send(t);case 5:if(n=i.sent,typeof d.onAfterResponse!="function"){i.next=9;break}return i.next=9,d.onAfterResponse(l,n);case 9:return i.abrupt("return",n);case 10:case"end":return i.stop()}},e)})),Fm.apply(this,arguments)}function wY(){var e=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(e=!1),e}function Np(e,l,t){return t.retryDelays==null||l>=t.retryDelays.length||e.originalRequest==null?!1:t&&typeof t.onShouldRetry=="function"?t.onShouldRetry(e,l,t):Rp(e)}function Rp(e){var l=e.originalResponse?e.originalResponse.getStatus():0;return(!bs(l,400)||l===409||l===423)&&wY()}function rp(e,l){return new TY(l,e).toString()}function EY(e,l){for(var t=Math.floor(e/l),d=[],n=0;n<l;n++)d.push({start:t*n,end:t*(n+1)});return d[l-1].end=e,d}co.defaultOptions=DY;var bp=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"};function CY(e){return new Promise(function(l,t){var d=new XMLHttpRequest;d.responseType="blob",d.onload=function(){var n=d.response;l(n)},d.onerror=function(n){t(n)},d.open("GET",e),d.send()})}var xY=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")};function gY(e){return new Promise(function(l,t){var d=new FileReader;d.onload=function(){var n=new Uint8Array(d.result);l({value:n})},d.onerror=function(n){t(n)},d.readAsArrayBuffer(e)})}function jU(e){"@babel/helpers - typeof";return jU=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},jU(e)}function jY(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function OY(e,l){for(var t=0;t<l.length;t++){var d=l[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,fY(d.key),d)}}function vY(e,l,t){return l&&OY(e.prototype,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function fY(e){var l=KY(e,"string");return jU(l)=="symbol"?l:l+""}function KY(e,l){if(jU(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var d=t.call(e,l);if(jU(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var up=(function(){function e(l){jY(this,e),this._file=l,this.size=l.size}return vY(e,[{key:"slice",value:function(t,d){if(xY())return gY(this._file.slice(t,d));var n=this._file.slice(t,d),a=d>=this.size;return Promise.resolve({value:n,done:a})}},{key:"close",value:function(){}}])})();function OU(e){"@babel/helpers - typeof";return OU=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},OU(e)}function HY(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function PY(e,l){for(var t=0;t<l.length;t++){var d=l[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,_Y(d.key),d)}}function AY(e,l,t){return l&&PY(e.prototype,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function _Y(e){var l=qY(e,"string");return OU(l)=="symbol"?l:l+""}function qY(e,l){if(OU(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var d=t.call(e,l);if(OU(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function pp(e){return e===void 0?0:e.size!==void 0?e.size:e.length}function $Y(e,l){if(e.concat)return e.concat(l);if(e instanceof Blob)return new Blob([e,l],{type:e.type});if(e.set){var t=new e.constructor(e.length+l.length);return t.set(e),t.set(l,e.length),t}throw new Error("Unknown data type")}var l1=(function(){function e(l){HY(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=l,this._done=!1}return AY(e,[{key:"slice",value:function(t,d){return t<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(t,d)}},{key:"_readUntilEnoughDataOrDone",value:function(t,d){var n=this,a=d<=this._bufferOffset+pp(this._buffer);if(this._done||a){var i=this._getDataFromBuffer(t,d),s=i==null?this._done:!1;return Promise.resolve({value:i,done:s})}return this._reader.read().then(function(c){var F=c.value,o=c.done;return o?n._done=!0:n._buffer===void 0?n._buffer=F:n._buffer=$Y(n._buffer,F),n._readUntilEnoughDataOrDone(t,d)})}},{key:"_getDataFromBuffer",value:function(t,d){t>this._bufferOffset&&(this._buffer=this._buffer.slice(t-this._bufferOffset),this._bufferOffset=t);var n=pp(this._buffer)===0;return this._done&&n?null:this._buffer.slice(0,d-t)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}])})();function ja(e){"@babel/helpers - typeof";return ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},ja(e)}function om(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */om=function(){return l};var e,l={},t=Object.prototype,d=t.hasOwnProperty,n=Object.defineProperty||function(B,X,k){B[X]=k.value},a=typeof Symbol=="function"?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function F(B,X,k){return Object.defineProperty(B,X,{value:k,enumerable:!0,configurable:!0,writable:!0}),B[X]}try{F({},"")}catch{F=function(k,w,D){return k[w]=D}}function o(B,X,k,w){var D=X&&X.prototype instanceof b?X:b,x=Object.create(D.prototype),K=new j(w||[]);return n(x,"_invoke",{value:z(B,k,K)}),x}function h(B,X,k){try{return{type:"normal",arg:B.call(X,k)}}catch(w){return{type:"throw",arg:w}}}l.wrap=o;var V="suspendedStart",W="suspendedYield",Q="executing",m="completed",N={};function b(){}function r(){}function u(){}var S={};F(S,i,function(){return this});var G=Object.getPrototypeOf,J=G&&G(G(C([])));J&&J!==t&&d.call(J,i)&&(S=J);var Y=u.prototype=b.prototype=Object.create(S);function L(B){["next","throw","return"].forEach(function(X){F(B,X,function(k){return this._invoke(X,k)})})}function y(B,X){function k(D,x,K,A){var P=h(B[D],B,x);if(P.type!=="throw"){var q=P.arg,_=q.value;return _&&ja(_)=="object"&&d.call(_,"__await")?X.resolve(_.__await).then(function(g){k("next",g,K,A)},function(g){k("throw",g,K,A)}):X.resolve(_).then(function(g){q.value=g,K(q)},function(g){return k("throw",g,K,A)})}A(P.arg)}var w;n(this,"_invoke",{value:function(x,K){function A(){return new X(function(P,q){k(x,K,P,q)})}return w=w?w.then(A,A):A()}})}function z(B,X,k){var w=V;return function(D,x){if(w===Q)throw Error("Generator is already running");if(w===m){if(D==="throw")throw x;return{value:e,done:!0}}for(k.method=D,k.arg=x;;){var K=k.delegate;if(K){var A=I(K,k);if(A){if(A===N)continue;return A}}if(k.method==="next")k.sent=k._sent=k.arg;else if(k.method==="throw"){if(w===V)throw w=m,k.arg;k.dispatchException(k.arg)}else k.method==="return"&&k.abrupt("return",k.arg);w=Q;var P=h(B,X,k);if(P.type==="normal"){if(w=k.done?m:W,P.arg===N)continue;return{value:P.arg,done:k.done}}P.type==="throw"&&(w=m,k.method="throw",k.arg=P.arg)}}}function I(B,X){var k=X.method,w=B.iterator[k];if(w===e)return X.delegate=null,k==="throw"&&B.iterator.return&&(X.method="return",X.arg=e,I(B,X),X.method==="throw")||k!=="return"&&(X.method="throw",X.arg=new TypeError("The iterator does not provide a '"+k+"' method")),N;var D=h(w,B.iterator,X.arg);if(D.type==="throw")return X.method="throw",X.arg=D.arg,X.delegate=null,N;var x=D.arg;return x?x.done?(X[B.resultName]=x.value,X.next=B.nextLoc,X.method!=="return"&&(X.method="next",X.arg=e),X.delegate=null,N):x:(X.method="throw",X.arg=new TypeError("iterator result is not an object"),X.delegate=null,N)}function O(B){var X={tryLoc:B[0]};1 in B&&(X.catchLoc=B[1]),2 in B&&(X.finallyLoc=B[2],X.afterLoc=B[3]),this.tryEntries.push(X)}function E(B){var X=B.completion||{};X.type="normal",delete X.arg,B.completion=X}function j(B){this.tryEntries=[{tryLoc:"root"}],B.forEach(O,this),this.reset(!0)}function C(B){if(B||B===""){var X=B[i];if(X)return X.call(B);if(typeof B.next=="function")return B;if(!isNaN(B.length)){var k=-1,w=function D(){for(;++k<B.length;)if(d.call(B,k))return D.value=B[k],D.done=!1,D;return D.value=e,D.done=!0,D};return w.next=w}}throw new TypeError(ja(B)+" is not iterable")}return r.prototype=u,n(Y,"constructor",{value:u,configurable:!0}),n(u,"constructor",{value:r,configurable:!0}),r.displayName=F(u,c,"GeneratorFunction"),l.isGeneratorFunction=function(B){var X=typeof B=="function"&&B.constructor;return!!X&&(X===r||(X.displayName||X.name)==="GeneratorFunction")},l.mark=function(B){return Object.setPrototypeOf?Object.setPrototypeOf(B,u):(B.__proto__=u,F(B,c,"GeneratorFunction")),B.prototype=Object.create(Y),B},l.awrap=function(B){return{__await:B}},L(y.prototype),F(y.prototype,s,function(){return this}),l.AsyncIterator=y,l.async=function(B,X,k,w,D){D===void 0&&(D=Promise);var x=new y(o(B,X,k,w),D);return l.isGeneratorFunction(X)?x:x.next().then(function(K){return K.done?K.value:x.next()})},L(Y),F(Y,c,"Generator"),F(Y,i,function(){return this}),F(Y,"toString",function(){return"[object Generator]"}),l.keys=function(B){var X=Object(B),k=[];for(var w in X)k.push(w);return k.reverse(),function D(){for(;k.length;){var x=k.pop();if(x in X)return D.value=x,D.done=!1,D}return D.done=!0,D}},l.values=C,j.prototype={constructor:j,reset:function(X){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!X)for(var k in this)k.charAt(0)==="t"&&d.call(this,k)&&!isNaN(+k.slice(1))&&(this[k]=e)},stop:function(){this.done=!0;var X=this.tryEntries[0].completion;if(X.type==="throw")throw X.arg;return this.rval},dispatchException:function(X){if(this.done)throw X;var k=this;function w(q,_){return K.type="throw",K.arg=X,k.next=q,_&&(k.method="next",k.arg=e),!!_}for(var D=this.tryEntries.length-1;D>=0;--D){var x=this.tryEntries[D],K=x.completion;if(x.tryLoc==="root")return w("end");if(x.tryLoc<=this.prev){var A=d.call(x,"catchLoc"),P=d.call(x,"finallyLoc");if(A&&P){if(this.prev<x.catchLoc)return w(x.catchLoc,!0);if(this.prev<x.finallyLoc)return w(x.finallyLoc)}else if(A){if(this.prev<x.catchLoc)return w(x.catchLoc,!0)}else{if(!P)throw Error("try statement without catch or finally");if(this.prev<x.finallyLoc)return w(x.finallyLoc)}}}},abrupt:function(X,k){for(var w=this.tryEntries.length-1;w>=0;--w){var D=this.tryEntries[w];if(D.tryLoc<=this.prev&&d.call(D,"finallyLoc")&&this.prev<D.finallyLoc){var x=D;break}}x&&(X==="break"||X==="continue")&&x.tryLoc<=k&&k<=x.finallyLoc&&(x=null);var K=x?x.completion:{};return K.type=X,K.arg=k,x?(this.method="next",this.next=x.finallyLoc,N):this.complete(K)},complete:function(X,k){if(X.type==="throw")throw X.arg;return X.type==="break"||X.type==="continue"?this.next=X.arg:X.type==="return"?(this.rval=this.arg=X.arg,this.method="return",this.next="end"):X.type==="normal"&&k&&(this.next=k),N},finish:function(X){for(var k=this.tryEntries.length-1;k>=0;--k){var w=this.tryEntries[k];if(w.finallyLoc===X)return this.complete(w.completion,w.afterLoc),E(w),N}},catch:function(X){for(var k=this.tryEntries.length-1;k>=0;--k){var w=this.tryEntries[k];if(w.tryLoc===X){var D=w.completion;if(D.type==="throw"){var x=D.arg;E(w)}return x}}throw Error("illegal catch attempt")},delegateYield:function(X,k,w){return this.delegate={iterator:C(X),resultName:k,nextLoc:w},this.method==="next"&&(this.arg=e),N}},l}function Mp(e,l,t,d,n,a,i){try{var s=e[a](i),c=s.value}catch(F){t(F);return}s.done?l(c):Promise.resolve(c).then(d,n)}function t1(e){return function(){var l=this,t=arguments;return new Promise(function(d,n){var a=e.apply(l,t);function i(c){Mp(a,d,n,i,s,"next",c)}function s(c){Mp(a,d,n,i,s,"throw",c)}i(void 0)})}}function e1(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function d1(e,l){for(var t=0;t<l.length;t++){var d=l[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,a1(d.key),d)}}function n1(e,l,t){return l&&d1(e.prototype,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function a1(e){var l=i1(e,"string");return ja(l)=="symbol"?l:l+""}function i1(e,l){if(ja(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var d=t.call(e,l);if(ja(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var s1=(function(){function e(){e1(this,e)}return n1(e,[{key:"openFile",value:(function(){var l=t1(om().mark(function d(n,a){var i;return om().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!(bp()&&n&&typeof n.uri<"u")){c.next=11;break}return c.prev=1,c.next=4,CY(n.uri);case 4:return i=c.sent,c.abrupt("return",new up(i));case 8:throw c.prev=8,c.t0=c.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(c.t0));case 11:if(!(typeof n.slice=="function"&&typeof n.size<"u")){c.next=13;break}return c.abrupt("return",Promise.resolve(new up(n)));case 13:if(typeof n.read!="function"){c.next=18;break}if(a=Number(a),Number.isFinite(a)){c.next=17;break}return c.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return c.abrupt("return",Promise.resolve(new l1(n,a)));case 18:return c.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return c.stop()}},d,null,[[1,8]])}));function t(d,n){return l.apply(this,arguments)}return t})()}])})();function c1(e,l){return bp()?Promise.resolve(U1(e,l)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,l.endpoint].join("-"))}function U1(e,l){var t=e.exif?Z1(JSON.stringify(e.exif)):"noexif";return["tus-rn",e.name||"noname",e.size||"nosize",t,l.endpoint].join("/")}function Z1(e){var l=0;if(e.length===0)return l;for(var t=0;t<e.length;t++){var d=e.charCodeAt(t);l=(l<<5)-l+d,l&=l}return l}function vU(e){"@babel/helpers - typeof";return vU=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},vU(e)}function hm(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function F1(e,l){for(var t=0;t<l.length;t++){var d=l[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,o1(d.key),d)}}function Vm(e,l,t){return l&&F1(e.prototype,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function o1(e){var l=h1(e,"string");return vU(l)=="symbol"?l:l+""}function h1(e,l){if(vU(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var d=t.call(e,l);if(vU(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var V1=(function(){function e(){hm(this,e)}return Vm(e,[{key:"createRequest",value:function(t,d){return new W1(t,d)}},{key:"getName",value:function(){return"XHRHttpStack"}}])})(),W1=(function(){function e(l,t){hm(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(l,t,!0),this._method=l,this._url=t,this._headers={}}return Vm(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(t,d){this._xhr.setRequestHeader(t,d),this._headers[t]=d}},{key:"getHeader",value:function(t){return this._headers[t]}},{key:"setProgressHandler",value:function(t){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(d){d.lengthComputable&&t(d.loaded)})}},{key:"send",value:function(){var t=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(n,a){t._xhr.onload=function(){n(new Q1(t._xhr))},t._xhr.onerror=function(i){a(i)},t._xhr.send(d)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})(),Q1=(function(){function e(l){hm(this,e),this._xhr=l}return Vm(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(t){return this._xhr.getResponseHeader(t)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})();function fU(e){"@babel/helpers - typeof";return fU=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},fU(e)}function m1(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function N1(e,l){for(var t=0;t<l.length;t++){var d=l[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,r1(d.key),d)}}function R1(e,l,t){return l&&N1(e.prototype,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function r1(e){var l=b1(e,"string");return fU(l)=="symbol"?l:l+""}function b1(e,l){if(fU(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var d=t.call(e,l);if(fU(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Wm=!1;try{Wm="localStorage"in window;var Qm="tusSupport",Sp=localStorage.getItem(Qm);localStorage.setItem(Qm,Sp),Sp===null&&localStorage.removeItem(Qm)}catch(e){if(e.code===e.SECURITY_ERR||e.code===e.QUOTA_EXCEEDED_ERR)Wm=!1;else throw e}var u1=Wm,p1=(function(){function e(){m1(this,e)}return R1(e,[{key:"findAllUploads",value:function(){var t=this._findEntries("tus::");return Promise.resolve(t)}},{key:"findUploadsByFingerprint",value:function(t){var d=this._findEntries("tus::".concat(t,"::"));return Promise.resolve(d)}},{key:"removeUpload",value:function(t){return localStorage.removeItem(t),Promise.resolve()}},{key:"addUpload",value:function(t,d){var n=Math.round(Math.random()*1e12),a="tus::".concat(t,"::").concat(n);return localStorage.setItem(a,JSON.stringify(d)),Promise.resolve(a)}},{key:"_findEntries",value:function(t){for(var d=[],n=0;n<localStorage.length;n++){var a=localStorage.key(n);if(a.indexOf(t)===0)try{var i=JSON.parse(localStorage.getItem(a));i.urlStorageKey=a,d.push(i)}catch{}}return d}}])})();function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},us(e)}function M1(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}function S1(e,l){for(var t=0;t<l.length;t++){var d=l[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,Gp(d.key),d)}}function T1(e,l,t){return t&&S1(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function J1(e,l,t){return l=Uo(l),G1(e,Tp()?Reflect.construct(l,t||[],Uo(e).constructor):l.apply(e,t))}function G1(e,l){if(l&&(us(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y1(e)}function y1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tp=function(){return!!e})()}function Uo(e){return Uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Uo(e)}function X1(e,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(l&&l.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),l&&mm(e,l)}function mm(e,l){return mm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,n){return d.__proto__=n,d},mm(e,l)}function Jp(e,l){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);l&&(d=d.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,d)}return t}function ps(e){for(var l=1;l<arguments.length;l++){var t=arguments[l]!=null?arguments[l]:{};l%2?Jp(Object(t),!0).forEach(function(d){B1(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Jp(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function B1(e,l,t){return l=Gp(l),l in e?Object.defineProperty(e,l,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[l]=t,e}function Gp(e){var l=Y1(e,"string");return us(l)=="symbol"?l:l+""}function Y1(e,l){if(us(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var d=t.call(e,l);if(us(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(e)}var Nm=ps(ps({},co.defaultOptions),{},{httpStack:new V1,fileReader:new s1,urlStorage:u1?new p1:new oY,fingerprint:c1}),k1=(function(e){function l(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return M1(this,l),d=ps(ps({},Nm),d),J1(this,l,[t,d])}return X1(l,e),T1(l,null,[{key:"terminate",value:function(d){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=ps(ps({},Nm),n),co.terminate(d,n)}}])})(co);const z1={version:"5.0.2"};function L1(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")}function I1(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"}function D1(e){return(l,t)=>{if(L1()||I1())return Nm.fingerprint(l,t);const d=["tus",e.id,t.endpoint].join("-");return Promise.resolve(d)}}const yp={endpoint:"",uploadUrl:null,metadata:{},uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,overridePatchMethod:!1,headers:{},addRequestId:!1,chunkSize:1/0,retryDelays:[100,1e3,3e3,5e3],parallelUploads:1,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1},w1={limit:20,retryDelays:yp.retryDelays,withCredentials:!1,allowedMetaFields:!0};class Xp extends mu{constructor(t,d){var n;super(t,{...w1,...d});al(this,ka);al(this,I0);f(this,"requests");f(this,"uploaders");f(this,"uploaderEvents");al(this,D0,async t=>{if(t.length===0){this.uppy.log("[Tus] No files to upload");return}this.opts.limit===0&&this.uppy.log("[Tus] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/tus/#limit-0","warning"),this.uppy.log("[Tus] Uploading...");const d=this.uppy.getFilesByIds(t);await Zl(this,ka,RX).call(this,d)});if(this.type="uploader",this.id=this.opts.id||"Tus",(d==null?void 0:d.allowedMetaFields)===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");if("autoRetry"in d)throw new Error("The `autoRetry` option was deprecated and has been removed.");this.requests=this.opts.rateLimitedQueue??new dB(this.opts.limit),hl(this,I0,(n=this.opts.retryDelays)==null?void 0:n.values()),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}resetUploaderReferences(t,d){const n=this.uploaders[t];n&&(n.abort(),d!=null&&d.abort&&n.abort(!0),this.uploaders[t]=null),this.uploaderEvents[t]&&(this.uploaderEvents[t].remove(),this.uploaderEvents[t]=null)}onReceiveUploadUrl(t,d){const n=this.uppy.getFile(t.id);n&&(!n.tus||n.tus.uploadUrl!==d)&&(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(n.id,{tus:{...n.tus,uploadUrl:d}}))}install(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!0}}),this.uppy.addUploader(H(this,D0))}uninstall(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!1}}),this.uppy.removeUploader(H(this,D0))}}I0=new WeakMap,ka=new WeakSet,mX=async function(t){return this.resetUploaderReferences(t.id),new Promise((d,n)=>{let a,i,s;const c={...this.opts,...t.tus||{}};typeof c.headers=="function"&&(c.headers=c.headers(t));const{onShouldRetry:F,onBeforeRequest:o,...h}=c,V={...yp,...h};V.fingerprint=D1(t),V.onBeforeRequest=async r=>{const u=r.getUnderlyingObject();u.withCredentials=!!c.withCredentials;let S;if(typeof o=="function"&&(S=o(r,t)),mQ(a,"shouldBeRequeued")){if(!a.shouldBeRequeued)return Promise.reject();let G;const J=new Promise(Y=>{G=Y});a=this.requests.run(()=>(t.isPaused&&a.abort(),G(),()=>{})),await Promise.all([J,S]);return}return S},V.onError=r=>{this.uppy.log(r);const u=r.originalRequest!=null?r.originalRequest.getUnderlyingObject():null;$X(u)&&(r=new wX(r,u)),this.resetUploaderReferences(t.id),a==null||a.abort(),typeof c.onError=="function"&&c.onError(r),n(r)},V.onProgress=(r,u)=>{this.onReceiveUploadUrl(t,s.url),typeof c.onProgress=="function"&&c.onProgress(r,u);const S=this.uppy.getFile(t.id);this.uppy.emit("upload-progress",S,{uploadStarted:S.progress.uploadStarted??0,bytesUploaded:r,bytesTotal:u})},V.onSuccess=r=>{const u={uploadURL:s.url??void 0,status:200,body:{xhr:r.lastResponse.getUnderlyingObject()}};if(this.uppy.emit("upload-success",this.uppy.getFile(t.id),u),this.resetUploaderReferences(t.id),a.done(),s.url){const{name:S}=s.file;this.uppy.log(`Download ${S} from ${s.url}`)}typeof c.onSuccess=="function"&&c.onSuccess(r),d(s)};const W=r=>{var S,G;const u=(S=r==null?void 0:r.originalResponse)==null?void 0:S.getStatus();if(u===429){if(!this.requests.isPaused){const J=(G=H(this,I0))==null?void 0:G.next();if(J==null||J.done)return!1;this.requests.rateLimit(J.value)}}else{if(u!=null&&u>=400&&u<500&&u!==409&&u!==423)return!1;typeof navigator<"u"&&navigator.onLine===!1&&(this.requests.isPaused||(this.requests.pause(),window.addEventListener("online",()=>{this.requests.resume()},{once:!0})))}return a.abort(),a={shouldBeRequeued:!0,abort(){this.shouldBeRequeued=!1},done(){throw new Error("Cannot mark a queued request as done: this indicates a bug")},fn(){throw new Error("Cannot run a queued request: this indicates a bug")}},!0};F!=null?V.onShouldRetry=(r,u)=>F(r,u,c,W):V.onShouldRetry=W;const Q=(r,u,S)=>{mQ(r,u)&&!mQ(r,S)&&(r[S]=r[u])},m={};if(fX(c.allowedMetaFields,t.meta).forEach(r=>{m[r]=String(t.meta[r])}),Q(m,"type","filetype"),Q(m,"name","filename"),V.metadata=m,t.data==null)throw new Error("File data is empty");s=new k1(t.data,V),this.uploaders[t.id]=s;const b=new RB(this.uppy);this.uploaderEvents[t.id]=b,i=()=>(t.isPaused||s.start(),()=>{}),s.findPreviousUploads().then(r=>{const u=r[0];u&&(this.uppy.log(`[Tus] Resuming upload of ${t.id} started at ${u.creationTime}`),s.resumeFromPreviousUpload(u)),a=this.requests.run(i)}),b.onFileRemove(t.id,r=>{a.abort(),this.resetUploaderReferences(t.id,{abort:!!s.url}),d(`upload ${r} was removed`)}),b.onPause(t.id,r=>{a.abort(),r?s.abort():a=this.requests.run(i)}),b.onPauseAll(t.id,()=>{a.abort(),s.abort()}),b.onCancelAll(t.id,()=>{a.abort(),this.resetUploaderReferences(t.id,{abort:!!s.url}),d(`upload ${t.id} was canceled`)}),b.onResumeAll(t.id,()=>{a.abort(),t.error&&s.abort(),a=this.requests.run(i)})}).catch(d=>{throw this.uppy.emit("upload-error",t,d),d})},NX=function(t){const d={...this.opts};return t.tus&&Object.assign(d,t.tus),typeof d.headers=="function"&&(d.headers=d.headers(t)),{..."remote"in t&&t.remote.body,endpoint:d.endpoint,uploadUrl:d.uploadUrl,protocol:"tus",size:t.data.size,headers:d.headers,metadata:t.meta}},RX=async function(t){const d=EX(t),n=CX(d);this.uppy.emit("upload-start",n),await Promise.allSettled(d.map(a=>{if(a.isRemote){const i=()=>this.requests,s=new AbortController,c=o=>{o.id===a.id&&s.abort()};this.uppy.on("file-removed",c);const F=this.uppy.getRequestClientForFile(a).uploadRemoteFile(a,Zl(this,ka,NX).call(this,a),{signal:s.signal,getQueue:i});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",c)},{priority:-1})(),F}return Zl(this,ka,mX).call(this,a)}))},D0=new WeakMap,f(Xp,"VERSION",z1.version);var KU={exports:{}},Bp;function E1(){if(Bp)return KU.exports;Bp=1,KU.exports=d,KU.exports.isMobile=d,KU.exports.default=d;const e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,l=/CrOS/,t=/android|ipad|playbook|silk/i;function d(n){n||(n={});let a=n.ua;if(!a&&typeof navigator<"u"&&(a=navigator.userAgent),a&&a.headers&&typeof a.headers["user-agent"]=="string"&&(a=a.headers["user-agent"]),typeof a!="string")return!1;let i=e.test(a)&&!l.test(a)||!!n.tablet&&t.test(a);return!i&&n.tablet&&n.featureDetect&&navigator&&navigator.maxTouchPoints>1&&a.indexOf("Macintosh")!==-1&&a.indexOf("Safari")!==-1&&(i=!0),i}return KU.exports}var C1=E1();const x1={version:"5.0.2"};function Yp(){return T("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55",children:T("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"})})}function g1({onDiscard:e,i18n:l}){return T("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:l("discardRecordedFile"),"aria-label":l("discardRecordedFile"),onClick:e,"data-uppy-super-focusable":!0,children:T("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:T("g",{fill:"#FFF",fillRule:"evenodd",children:[T("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),T("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"})]})})})}function j1({recording:e,onStartRecording:l,onStopRecording:t,i18n:d}){return e?T("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:d("stopRecording"),"aria-label":d("stopRecording"),onClick:t,"data-uppy-super-focusable":!0,children:T("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:T("rect",{x:"15",y:"15",width:"70",height:"70"})})}):T("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:d("startRecording"),"aria-label":d("startRecording"),onClick:l,"data-uppy-super-focusable":!0,children:T("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:T("circle",{cx:"50",cy:"50",r:"40"})})})}function O1(e){return`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`}function v1({recordingLengthSeconds:e}){const l=O1(e);return T("span",{children:l})}function f1({onSnapshot:e,i18n:l}){return T("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:l("takePicture"),"aria-label":l("takePicture"),onClick:e,"data-uppy-super-focusable":!0,children:Yp()})}function K1({onSubmit:e,i18n:l}){return T("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:l("submitRecordedFile"),"aria-label":l("submitRecordedFile"),onClick:e,"data-uppy-super-focusable":!0,children:T("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:T("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})})})}function H1({currentDeviceId:e,videoSources:l,onChangeVideoSource:t}){return T("div",{className:"uppy-Webcam-videoSource",children:T("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:d=>{t(d.target.value)},children:l.map(d=>T("option",{value:d.deviceId,selected:d.deviceId===e,children:d.label},d.deviceId))})})}function Zo(e,l){return e.includes(l)}class P1 extends se{constructor(){super(...arguments);f(this,"videoElement");f(this,"refs")}componentDidMount(){const{onFocus:t}=this.props;t()}componentWillUnmount(){const{onStop:t}=this.props;t()}render(){const{src:t,recordedVideo:d,capturedSnapshot:n,recording:a,modes:i,supportsRecording:s,videoSources:c,showVideoSourceDropdown:F,showRecordingLength:o,onSubmit:h,i18n:V,mirror:W,onSnapshot:Q,onStartRecording:m,onStopRecording:N,onDiscardRecordedMedia:b,recordingLengthSeconds:r}=this.props,u=!!d,S=!!n,G=u||S,J=!G&&s&&(Zo(i,"video-only")||Zo(i,"audio-only")||Zo(i,"video-audio")),Y=!G&&Zo(i,"picture"),L=s&&o&&!u,y=F&&c&&c.length>1,z={playsInline:!0};return d?(z.muted=!1,z.controls=!0,z.src=d,this.videoElement&&(this.videoElement.srcObject=null)):(z.muted=!0,z.autoPlay=!0,z.srcObject=t),T("div",{className:"uppy uppy-Webcam-container",children:[T("div",{className:"uppy-Webcam-videoContainer",children:n&&!a&&!d?T("div",{className:"uppy-Webcam-imageContainer",children:T("img",{src:n,className:"uppy-Webcam-video",alt:"capturedSnapshot"})}):T("video",{ref:I=>{this.videoElement=I},className:`uppy-Webcam-video ${W?"uppy-Webcam-video--mirrored":""}`,...z})}),T("div",{className:"uppy-Webcam-footer",children:[T("div",{className:"uppy-Webcam-videoSourceContainer",children:y?H1(this.props):null}),T("div",{className:"uppy-Webcam-buttonContainer",children:[Y&&T(f1,{onSnapshot:Q,i18n:V}),J&&T(j1,{recording:a,onStartRecording:m,onStopRecording:N,i18n:V}),(u||S)&&T(K1,{onSubmit:h,i18n:V}),(u||S)&&T(g1,{onDiscard:b,i18n:V})]}),T("div",{className:"uppy-Webcam-recordingLength",children:L&&T(v1,{recordingLengthSeconds:r})})]})]})}}const A1={strings:{pluginNameCamera:"Camera",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site."}};function _1({icon:e,i18n:l,hasCamera:t}){return T("div",{className:"uppy-Webcam-permissons",children:[T("div",{className:"uppy-Webcam-permissonsIcon",children:e()}),T("div",{className:"uppy-Webcam-title",children:l(t?"allowAccessTitle":"noCameraTitle")}),T("p",{children:l(t?"allowAccessDescription":"noCameraDescription")})]})}function q1(){return typeof MediaRecorder=="function"&&!!MediaRecorder.prototype&&typeof MediaRecorder.prototype.start=="function"}function kp(e){return e[0]==="."?NQ[e.slice(1)]:e}function $1(e){return/^video\/[^*]+$/.test(e)}function lk(e){return/^image\/[^*]+$/.test(e)}function tk(){return navigator.mediaDevices}function Rm(e,l){return e.includes(l)}const ek={onBeforeSnapshot:()=>Promise.resolve(),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:C1.isMobile({tablet:!0})};class zp extends Ln{constructor(t,d){super(t,{...ek,...d});al(this,za);f(this,"mediaDevices");f(this,"supportsUserMedia");f(this,"protocol");f(this,"capturedMediaFile");f(this,"icon");f(this,"webcamActive");f(this,"stream",null);f(this,"recorder",null);f(this,"recordingChunks",null);f(this,"recordingLengthTimer");f(this,"captureInProgress",!1);this.mediaDevices=tk(),this.supportsUserMedia=!!this.mediaDevices,this.protocol=location.protocol.match(/https/i)?"https":"http",this.id=this.opts.id||"Webcam",this.type="acquirer",this.capturedMediaFile=null,this.icon=()=>T("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:T("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383",fillRule:"nonzero"})}),this.defaultLocale=A1,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),hl(this,za,this.opts.mirror),this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.takeSnapshot=this.takeSnapshot.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.discardRecordedMedia=this.discardRecordedMedia.bind(this),this.submit=this.submit.bind(this),this.oneTwoThreeSmile=this.oneTwoThreeSmile.bind(this),this.focus=this.focus.bind(this),this.changeVideoSource=this.changeVideoSource.bind(this),this.webcamActive=!1,this.opts.countdown&&(this.opts.onBeforeSnapshot=this.oneTwoThreeSmile),this.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null,capturedSnapshot:null})}getStatus(){const{recordedVideo:t,capturedSnapshot:d,isRecording:n,cameraReady:a,cameraError:i}=this.getPluginState();return n?"recording":t!=null||d!=null?"captured":a?"ready":i?"error":"init"}setOptions(t){super.setOptions({...t,videoConstraints:{...this.opts.videoConstraints,...t==null?void 0:t.videoConstraints}})}hasCameraCheck(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then(t=>t.some(d=>d.kind==="videoinput")):Promise.resolve(!1)}isAudioOnly(){return this.opts.modes.length===1&&this.opts.modes[0]==="audio-only"}getConstraints(t=null){const d=this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("audio-only")!==-1,n=!this.isAudioOnly()&&(this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("video-only")!==-1||this.opts.modes.indexOf("picture")!==-1),a={...this.opts.videoConstraints||{},...t!=null&&{deviceId:t}};return{audio:d,video:n?a:!1}}start(t=null){if(!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror&&hl(this,za,!0);const d=this.getConstraints(t==null?void 0:t.deviceId);this.hasCameraCheck().then(n=>(this.setPluginState({hasCamera:n}),this.mediaDevices.getUserMedia(d).then(a=>{this.stream=a;let i=null;const s=this.isAudioOnly()?a.getAudioTracks():a.getVideoTracks();!t||!t.deviceId?i=s[0].getSettings().deviceId:s.forEach(c=>{c.getSettings().deviceId===t.deviceId&&(i=c.getSettings().deviceId)}),this.updateVideoSources(),this.setPluginState({currentDeviceId:i,cameraReady:!0})}).catch(a=>{this.setPluginState({cameraReady:!1,cameraError:a}),this.uppy.info(a.message,"error")})))}getMediaRecorderOptions(){const t={};if(MediaRecorder.isTypeSupported){const{restrictions:d}=this.uppy.opts;let n=[];this.opts.preferredVideoMimeType?n=[this.opts.preferredVideoMimeType]:d.allowedFileTypes&&(n=d.allowedFileTypes.map(kp).filter($1));const a=s=>MediaRecorder.isTypeSupported(s)&&wa(s),i=n.filter(a);i.length>0&&(t.mimeType=i[0])}return t}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let t=!1;this.recorder.addEventListener("dataavailable",d=>{this.recordingChunks.push(d.data);const{restrictions:n}=this.uppy.opts;if(this.recordingChunks.length>1&&n.maxFileSize!=null&&!t){const a=this.recordingChunks.reduce((F,o)=>F+o.size,0),s=(a-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3,c=Math.max(0,n.maxFileSize-s);a>c&&(t=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(()=>{const d=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:d+1})},1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise(d=>{this.recorder.addEventListener("stop",()=>{d()}),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))}).then(()=>(this.setPluginState({isRecording:!1}),this.getVideo())).then(d=>{try{this.capturedMediaFile=d,this.setPluginState({recordedVideo:URL.createObjectURL(d.data)}),hl(this,za,!1)}catch(n){n.isRestriction||this.uppy.log(n)}}).then(()=>{this.recordingChunks=null,this.recorder=null},d=>{throw this.recordingChunks=null,this.recorder=null,d})}discardRecordedMedia(){const{recordedVideo:t,capturedSnapshot:d}=this.getPluginState();t&&URL.revokeObjectURL(t),d&&URL.revokeObjectURL(d),this.setPluginState({recordedVideo:null,capturedSnapshot:null}),this.opts.mirror&&hl(this,za,!0),this.capturedMediaFile=null}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(t){t.isRestriction||this.uppy.log(t,"error")}}async stop(){if(this.stream){const t=this.stream.getAudioTracks(),d=this.stream.getVideoTracks();t.concat(d).forEach(n=>n.stop())}this.recorder&&await new Promise(t=>{this.recorder.addEventListener("stop",t,{once:!0}),this.recorder.stop(),this.opts.showRecordingLength&&clearInterval(this.recordingLengthTimer)}),this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,capturedSnapshot:null,isRecording:!1,recordingLengthSeconds:0})}getVideoElement(){return this.el.querySelector(".uppy-Webcam-video")}oneTwoThreeSmile(){return new Promise((t,d)=>{let n=this.opts.countdown;const a=setInterval(()=>{if(!this.webcamActive)return clearInterval(a),this.captureInProgress=!1,d(new Error("Webcam is not active"));n?(this.uppy.info(`${n}...`,"warning",800),n--):(clearInterval(a),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout(()=>t(),1500))},1e3)})}async takeSnapshot(){if(!this.captureInProgress){this.captureInProgress=!0;try{await this.opts.onBeforeSnapshot()}catch(t){const d=typeof t=="object"?t.message:t;throw this.uppy.info(d,"error",5e3),new Error(`onBeforeSnapshot: ${d}`)}try{const t=await this.getImage();if(this.capturedMediaFile=t,t.data==null)throw new Error("File data is empty");const d=URL.createObjectURL(t.data);this.setPluginState({capturedSnapshot:d}),this.captureInProgress=!1}catch(t){this.captureInProgress=!1,t.isRestriction||this.uppy.log(t)}}}async getImage(){const t=this.getVideoElement();if(!t)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));const d=t.videoWidth,n=t.videoHeight,a=document.createElement("canvas");a.width=d,a.height=n,a.getContext("2d").drawImage(t,0,0);const{restrictions:s}=this.uppy.opts;let c=[];this.opts.preferredImageMimeType?c=[this.opts.preferredImageMimeType]:s.allowedFileTypes&&(c=s.allowedFileTypes.map(kp).filter(lk));const F=c[0]||"image/jpeg",o=wa(F)||"jpg",h=`cam-${Date.now()}.${o}`;return LX(a,F).then(V=>({source:this.id,name:h,data:new Blob([V],{type:F}),type:F}))}getVideo(){const t=this.recordingChunks.find(s=>{var c;return((c=s.type)==null?void 0:c.length)>0}).type,d=wa(t);if(!d)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${t}"`));const n=`webcam-${Date.now()}.${d}`,a=new Blob(this.recordingChunks,{type:t}),i={source:this.id,name:n,data:new Blob([a],{type:t}),type:t};return Promise.resolve(i)}focus(){this.opts.countdown&&setTimeout(()=>{this.uppy.info(this.i18n("smile"),"success",1500)},1e3)}changeVideoSource(t){this.stop(),this.start({deviceId:t})}updateVideoSources(){this.mediaDevices.enumerateDevices().then(t=>{this.setPluginState({videoSources:t.filter(d=>d.kind==="videoinput")})})}render(){this.webcamActive||this.start();const t=this.getPluginState();return!t.cameraReady||!t.hasCamera?T(_1,{icon:Yp,i18n:this.i18n,hasCamera:t.hasCamera}):T(P1,{...t,onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedMedia:this.discardRecordedMedia,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:q1(),recording:t.isRecording,mirror:H(this,za),src:this.stream})}install(){var i;const{mobileNativeCamera:t,modes:d,videoConstraints:n}=this.opts,{target:a}=this.opts;if(t&&a){(i=this.getTargetPlugin(a))==null||i.setOptions({showNativeVideoCameraButton:Rm(d,"video-only")||Rm(d,"video-audio"),showNativePhotoCameraButton:Rm(d,"picture"),nativeCameraFacingMode:n==null?void 0:n.facingMode});return}this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),a&&this.mount(a,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let s=!0;const{videoSources:c,currentDeviceId:F}=this.getPluginState();c.forEach(o=>{F===o.deviceId&&(s=!1)}),s&&(this.stop(),this.start())}})}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}}za=new WeakMap,f(zp,"VERSION",x1.version);const dk={version:"5.0.1"},nk={strings:{pluginNameScreenCapture:"Screencast",startCapturing:"Begin screen capturing",stopCapturing:"Stop screen capturing",submitRecordedFile:"Submit recorded file",streamActive:"Stream active",streamPassive:"Stream passive",micDisabled:"Microphone access denied by user",recording:"Recording",takeScreenshot:"Take Screenshot",discardMediaFile:"Discard Media"}};function ak({onDiscard:e,i18n:l}){return T("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--discard",type:"button",title:l("discardMediaFile"),"aria-label":l("discardMediaFile"),onClick:e,"data-uppy-super-focusable":!0,children:T("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[T("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}function ik({recording:e,onStartRecording:l,onStopRecording:t,i18n:d}){return e?T("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video uppy-ScreenCapture-button--stop-rec",type:"button",title:d("stopCapturing"),"aria-label":d("stopCapturing"),onClick:t,"data-uppy-super-focusable":!0,children:T("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:T("rect",{x:"15",y:"15",width:"70",height:"70"})})}):T("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video",type:"button",title:d("startCapturing"),"aria-label":d("startCapturing"),onClick:l,"data-uppy-super-focusable":!0,children:T("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:T("path",{d:"M4.5 4.5a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h8.25a3 3 0 0 0 3-3v-9a3 3 0 0 0-3-3H4.5ZM19.94 18.75l-2.69-2.69V7.94l2.69-2.69c.944-.945 2.56-.276 2.56 1.06v11.38c0 1.336-1.616 2.005-2.56 1.06Z"})})})}function sk({onScreenshot:e,i18n:l}){return T("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--screenshot",type:"button",title:l("takeScreenshot"),"aria-label":l("takeScreenshot"),onClick:e,"data-uppy-super-focusable":!0,children:T("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:[T("path",{d:"M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z"}),T("path",{"fill-rule":"evenodd",d:"M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"})]})})}function ck(e){return(e-(e%=60))/60+(e>9?":":":0")+e}class Uk extends se{constructor(t){super(t);f(this,"wrapperStyle",{width:"100%",height:"100%",display:"flex"});f(this,"overlayStyle",{position:"absolute",width:"100%",height:"100%",background:"black",opacity:.7});f(this,"infoContainerStyle",{marginLeft:"auto",marginRight:"auto",marginTop:"auto",marginBottom:"auto",zIndex:1,color:"white"});f(this,"infotextStyle",{marginLeft:"auto",marginRight:"auto",marginBottom:"1rem",fontSize:"1.5rem"});f(this,"timeStyle",{display:"block",fontWeight:"bold",marginLeft:"auto",marginRight:"auto",fontSize:"3rem",fontFamily:"Courier New"});f(this,"timerRunning",!1);f(this,"timer");this.state={elapsedTime:0}}startTimer(){this.timerTick(),this.timerRunning=!0}resetTimer(){clearTimeout(this.timer),this.setState({elapsedTime:0}),this.timerRunning=!1}timerTick(){this.timer=setTimeout(()=>{this.setState(t=>({elapsedTime:t.elapsedTime+1})),this.timerTick()},1e3)}render(){const{recording:t,i18n:d}={...this.props},{elapsedTime:n}=this.state,a=ck(n);return t&&!this.timerRunning&&this.startTimer(),!t&&this.timerRunning&&this.resetTimer(),t?T("div",{style:this.wrapperStyle,children:[T("div",{style:this.overlayStyle}),T("div",{style:this.infoContainerStyle,children:[T("div",{style:this.infotextStyle,children:d("recording")}),T("div",{style:this.timeStyle,children:a})]})]}):null}}function Zk({streamActive:e,i18n:l}){return e?T("div",{title:l("streamActive"),className:"uppy-ScreenCapture-icon--stream uppy-ScreenCapture-icon--streamActive",children:T("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24",children:[T("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),T("path",{d:"M0 0h24v24H0z",fill:"none"}),T("path",{d:"M1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm18-7H5v1.63c3.96 1.28 7.09 4.41 8.37 8.37H19V7zM1 10v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11zm20-7H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})]})}):T("div",{title:l("streamPassive"),className:"uppy-ScreenCapture-icon--stream",children:T("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24",children:[T("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),T("path",{d:"M0 0h24v24H0z",fill:"none"}),T("path",{d:"M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z"})]})})}function Fk({recording:e,recordedVideo:l,onSubmit:t,capturedScreenshotUrl:d,i18n:n}){return(l||d)&&!e?T("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--submit",type:"button",title:n("submitRecordedFile"),"aria-label":n("submitRecordedFile"),onClick:t,"data-uppy-super-focusable":!0,children:T("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:T("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})})}):null}class ok extends se{constructor(){super(...arguments);f(this,"videoElement",null)}componentWillUnmount(){const{onStop:t}=this.props;t()}render(){const{recording:t,stream:d,recordedVideo:n,enableScreenshots:a,capturedScreenshotUrl:i}=this.props,s={playsinline:!0};return(t||!n&&!t)&&(s.muted=!0,s.autoplay=!0,s.srcObject=d),n&&!t&&(s.muted=!1,s.controls=!0,s.src=n,this.videoElement&&(this.videoElement.srcObject=null)),T("div",{className:"uppy uppy-ScreenCapture-container",children:[T("div",{className:"uppy-ScreenCapture-mediaContainer",children:[T(Zk,{...this.props}),i&&!t&&!n?T("div",{className:"uppy-ScreenCapture-imageContainer",children:T("img",{src:i,className:"uppy-ScreenCapture-media",alt:"screenshotPreview"})}):T("video",{ref:c=>{this.videoElement=c},className:"uppy-ScreenCapture-media",...s}),T("div",{children:T(Uk,{...this.props})})]}),T("div",{className:"uppy-ScreenCapture-buttonContainer",children:n||i?T(Pe,{children:[T(Fk,{...this.props}),T(ak,{...this.props})]}):T(Pe,{children:[a&&!t&&T(sk,{...this.props}),T(ik,{...this.props})]})})]})}}function hk(){return T("svg",{className:"uppy-DashboardTab-iconScreenRec","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:T("g",{fill:"currentcolor",fillRule:"evenodd",children:[T("path",{d:"M24.182 9H7.818C6.81 9 6 9.742 6 10.667v10c0 .916.81 1.666 1.818 1.666h4.546V24h7.272v-1.667h4.546c1 0 1.809-.75 1.809-1.666l.009-10C26 9.742 25.182 9 24.182 9zM24 21H8V11h16v10z"}),T("circle",{cx:"16",cy:"16",r:"2"})]})})}function Vk(){var e;return window.MediaRecorder&&((e=navigator.mediaDevices)==null?void 0:e.getDisplayMedia)}function Wk(){return window.MediaRecorder&&navigator.mediaDevices}const Qk=["image/png","image/jpeg","image/webp"],mk={displayMediaConstraints:{video:{width:1280,height:720,frameRate:{ideal:3,max:5},cursor:"motion",displaySurface:"monitor"}},userMediaConstraints:{audio:!0},preferredVideoMimeType:"video/webm",preferredImageMimeType:"image/png",enableScreenshots:!0};class Lp extends Ln{constructor(t,d){super(t,{...mk,...d});f(this,"mediaDevices");f(this,"protocol");f(this,"icon");f(this,"streamInterrupted");f(this,"captureActive");f(this,"capturedMediaFile");f(this,"videoStream",null);f(this,"audioStream",null);f(this,"userDenied",!1);f(this,"recorder",null);f(this,"outputStream",null);f(this,"recordingChunks",null);this.mediaDevices=Wk(),this.protocol=location.protocol==="https:"?"https":"http",this.id=this.opts.id||"ScreenCapture",this.type="acquirer",this.icon=hk,this.defaultLocale=nk,this.i18nInit(),this.title=this.i18n("pluginNameScreenCapture"),this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.submit=this.submit.bind(this),this.streamInterrupted=this.streamInactivated.bind(this),this.captureScreenshot=this.captureScreenshot.bind(this),this.discardRecordedMedia=this.discardRecordedMedia.bind(this),this.captureActive=!1,this.capturedMediaFile=null,this.setPluginState({streamActive:!1,audioStreamActive:!1,recording:!1,recordedVideo:null,screenRecError:null,capturedScreenshotUrl:null,status:"init"})}install(){if(!Vk())return this.uppy.log("Screen recorder access is not supported","warning"),null;this.setPluginState({streamActive:!1,audioStreamActive:!1,status:"init"});const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.videoStream&&this.stop(),this.unmount()}start(){return this.mediaDevices?(this.captureActive=!0,this.selectAudioStreamSource(),this.selectVideoStreamSource().then(t=>{var d;t===!1&&(d=this.parent)!=null&&d.hideAllPanels&&(this.parent.hideAllPanels(),this.captureActive=!1)})):Promise.reject(new Error("Screen recorder access not supported"))}selectVideoStreamSource(){return this.videoStream?new Promise(t=>t(this.videoStream)):this.mediaDevices.getDisplayMedia(this.opts.displayMediaConstraints).then(t=>(this.videoStream=t,this.videoStream.addEventListener("inactive",()=>{this.streamInactivated()}),this.setPluginState({streamActive:!0,status:"ready",screenRecError:null}),t)).catch(t=>(this.setPluginState({screenRecError:t,status:"error"}),this.userDenied=!0,setTimeout(()=>{this.userDenied=!1},1e3),!1))}selectAudioStreamSource(){return this.audioStream?new Promise(t=>t(this.audioStream)):this.mediaDevices.getUserMedia(this.opts.userMediaConstraints).then(t=>(this.audioStream=t,this.setPluginState({audioStreamActive:!0}),t)).catch(t=>(t.name==="NotAllowedError"&&(this.uppy.info(this.i18n("micDisabled"),"error",5e3),this.uppy.log(this.i18n("micDisabled"),"warning")),!1))}startRecording(){const t={};this.capturedMediaFile=null,this.recordingChunks=[];const{preferredVideoMimeType:d}=this.opts;this.selectVideoStreamSource().then(n=>{if(n===!1)throw new Error("No video stream available");d&&MediaRecorder.isTypeSupported(d)&&wa(d)&&(t.mimeType=d);const a=[n.getVideoTracks()[0]];this.audioStream&&a.push(this.audioStream.getAudioTracks()[0]),this.outputStream=new MediaStream(a),this.recorder=new MediaRecorder(this.outputStream,t),this.recorder.addEventListener("dataavailable",i=>{this.recordingChunks.push(i.data)}),this.recorder.start(),this.setPluginState({recording:!0,status:"recording"})}).catch(n=>{this.uppy.log(n,"error"),this.setPluginState({screenRecError:n,status:"error"})})}streamInactivated(){var n;const{recordedVideo:t,recording:d}={...this.getPluginState()};!t&&!d?((n=this.parent)!=null&&n.hideAllPanels&&this.parent.hideAllPanels(),this.setPluginState({status:"init"})):d&&(this.uppy.log("Capture stream inactive — stop recording"),this.stopRecording()),this.videoStream=null,this.audioStream=null,this.setPluginState({streamActive:!1,audioStreamActive:!1})}stopRecording(){return new Promise(d=>{this.recorder.addEventListener("stop",()=>{d()}),this.recorder.stop()}).then(()=>(this.setPluginState({recording:!1}),this.getVideo())).then(d=>{this.capturedMediaFile=d,this.setPluginState({recordedVideo:URL.createObjectURL(d.data),status:"captured"})}).then(()=>{this.recordingChunks=null,this.recorder=null},d=>{throw this.recordingChunks=null,this.recorder=null,d})}discardRecordedMedia(){const{capturedScreenshotUrl:t,recordedVideo:d}=this.getPluginState();t&&URL.revokeObjectURL(t),d&&URL.revokeObjectURL(d),this.capturedMediaFile=null,this.setPluginState({recordedVideo:null,capturedScreenshotUrl:null,status:this.getPluginState().streamActive?"ready":"init"})}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(t){t.isRestriction||this.uppy.log(t,"warning")}}stop(){this.videoStream&&(this.videoStream.getVideoTracks().forEach(n=>{n.stop()}),this.videoStream.getAudioTracks().forEach(n=>{n.stop()}),this.videoStream=null),this.audioStream&&(this.audioStream.getAudioTracks().forEach(n=>{n.stop()}),this.audioStream.getVideoTracks().forEach(n=>{n.stop()}),this.audioStream=null),this.outputStream&&(this.outputStream.getAudioTracks().forEach(n=>{n.stop()}),this.outputStream.getVideoTracks().forEach(n=>{n.stop()}),this.outputStream=null);const{capturedScreenshotUrl:t,recordedVideo:d}=this.getPluginState();t&&URL.revokeObjectURL(t),d&&URL.revokeObjectURL(d),this.setPluginState({recording:!1,streamActive:!1,audioStreamActive:!1,recordedVideo:null,capturedScreenshotUrl:null,status:"init"}),this.captureActive=!1}getVideo(){const t=this.recordingChunks[0].type,d=wa(t);if(!d)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${t}"`));const n=`screencap-${Date.now()}.${d}`,a=new Blob(this.recordingChunks,{type:t}),i={source:this.id,name:n,data:new Blob([a],{type:t}),type:t};return Promise.resolve(i)}async captureScreenshot(){var t;if(!((t=this.mediaDevices)!=null&&t.getDisplayMedia))throw new Error("Screen capture is not supported");try{let d=this.videoStream;if(!d){const F=await this.selectVideoStreamSource();if(!F)throw new Error("Failed to get screen capture stream");d=F}const n=document.createElement("video");n.srcObject=d,await new Promise(F=>{n.onloadedmetadata=()=>{n.play(),F(null)}});const a=document.createElement("canvas");a.width=n.videoWidth,a.height=n.videoHeight;const i=a.getContext("2d");if(!i)throw new Error("Failed to get canvas context");i.drawImage(n,0,0,a.width,a.height);let s=this.opts.preferredImageMimeType;(!s||!Qk.includes(s))&&(this.uppy.log(`Unsupported image type "${s}", falling back to image/png`,"warning"),s="image/png");const c=1;return new Promise((F,o)=>{a.toBlob(h=>{if(!h){o(new Error("Failed to create screenshot blob"));return}const V=wa(s)||"png",W={source:this.id,name:`Screenshot ${new Date().toISOString()}.${V}`,type:s,data:h};try{this.capturedMediaFile=W;const Q=URL.createObjectURL(h);this.setPluginState({capturedScreenshotUrl:Q,status:"captured"}),F()}catch(Q){this.getPluginState().capturedScreenshotUrl&&this.setPluginState({capturedScreenshotUrl:null}),Q.isRestriction||this.uppy.log(Q,"error"),o(Q)}finally{n.srcObject=null,a.remove(),n.remove()}},s,c)})}catch(d){throw this.uppy.log(d,"error"),d}}render(){const t=this.getPluginState();return!t.streamActive&&!this.captureActive&&!this.userDenied&&this.start(),T(ok,{...t,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,enableScreenshots:this.opts.enableScreenshots,onScreenshot:this.captureScreenshot,onStop:this.stop,onSubmit:this.submit,i18n:this.i18n,stream:this.videoStream,onDiscard:this.discardRecordedMedia})}}f(Lp,"VERSION",dk.version);const Nk={version:"3.0.1"},Rk={strings:{pluginNameAudio:"Audio",startAudioRecording:"Begin audio recording",stopAudioRecording:"Stop audio recording",allowAudioAccessTitle:"Please allow access to your microphone",allowAudioAccessDescription:"In order to record audio, please allow microphone access for this site.",noAudioTitle:"Microphone Not Available",noAudioDescription:"In order to record audio, please connect a microphone or another audio input device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",recordingLength:"Recording length %{recording_length}",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file"}},rk=e=>{const{icon:l,hasAudio:t,i18n:d}=e;return T("div",{className:"uppy-Audio-permissons",children:[T("div",{className:"uppy-Audio-permissonsIcon",children:l()}),T("div",{className:"uppy-Audio-title",children:d(t?"allowAudioAccessTitle":"noAudioTitle")}),T("p",{children:d(t?"allowAudioAccessDescription":"noAudioDescription")})]})},bk=({currentDeviceId:e,audioSources:l,onChangeSource:t})=>T("div",{className:"uppy-Audio-videoSource",children:T("select",{className:"uppy-u-reset uppy-Audio-audioSource-select",onChange:d=>{t(d.target.value)},children:l.map(d=>T("option",{value:d.deviceId,selected:d.deviceId===e,children:d.label},d.deviceId))})});function Ip(e){return typeof e=="function"}function HU(e){return Ip(e)?e():e}class uk{constructor(l,t={}){f(this,"canvas");f(this,"canvasContext");f(this,"width");f(this,"height");f(this,"analyser");f(this,"bufferLength");f(this,"dataArray");f(this,"onDrawFrame");f(this,"streamSource");f(this,"audioContext");f(this,"source");al(this,dQ,()=>this.draw());const d=t.canvas||{},n=t.canvasContext||{};this.analyser=null,this.bufferLength=0,this.canvas=l,this.width=HU(d.width)||this.canvas.width,this.height=HU(d.height)||this.canvas.height,this.canvas.width=this.width,this.canvas.height=this.height,this.canvasContext=this.canvas.getContext("2d"),this.canvasContext.fillStyle=HU(n.fillStyle)||"rgb(255, 255, 255)",this.canvasContext.strokeStyle=HU(n.strokeStyle)||"rgb(0, 0, 0)",this.canvasContext.lineWidth=HU(n.lineWidth)||1,this.onDrawFrame=Ip(t.onDrawFrame)?t.onDrawFrame:()=>{}}addSource(l){this.streamSource=l,this.audioContext=this.streamSource.context,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2048,this.bufferLength=this.analyser.frequencyBinCount,this.source=this.audioContext.createBufferSource(),this.dataArray=new Uint8Array(this.bufferLength),this.analyser.getByteTimeDomainData(this.dataArray),this.streamSource.connect(this.analyser)}draw(){const{analyser:l,dataArray:t,bufferLength:d}=this,n=this.canvasContext,a=this.width,i=this.height;l&&l.getByteTimeDomainData(t),n.fillRect(0,0,a,i),n.beginPath();const s=a*1/d;let c=0;d||n.moveTo(0,this.height/2);for(let F=0;F<d;F++){const h=t[F]/128*(i/2);F===0?n.moveTo(c,h):n.lineTo(c,h),c+=s}n.lineTo(a,i/2),n.stroke(),this.onDrawFrame(this),requestAnimationFrame(H(this,dQ))}}dQ=new WeakMap;function pk({onDiscard:e,i18n:l}){return T("button",{className:"uppy-u-reset uppy-c-btn uppy-Audio-button",type:"button",title:l("discardRecordedFile"),"aria-label":l("discardRecordedFile"),onClick:e,"data-uppy-super-focusable":!0,children:T("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"uppy-c-icon",children:T("g",{fill:"#FFF",fillRule:"evenodd",children:[T("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),T("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"})]})})})}function Mk({recording:e,onStartRecording:l,onStopRecording:t,i18n:d}){return e?T("button",{className:"uppy-u-reset uppy-c-btn uppy-Audio-button",type:"button",title:d("stopAudioRecording"),"aria-label":d("stopAudioRecording"),onClick:t,"data-uppy-super-focusable":!0,children:T("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:T("rect",{x:"15",y:"15",width:"70",height:"70"})})}):T("button",{className:"uppy-u-reset uppy-c-btn uppy-Audio-button",type:"button",title:d("startAudioRecording"),"aria-label":d("startAudioRecording"),onClick:l,"data-uppy-super-focusable":!0,children:T("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14px",height:"20px",viewBox:"0 0 14 20",children:T("path",{d:"M7 14c2.21 0 4-1.71 4-3.818V3.818C11 1.71 9.21 0 7 0S3 1.71 3 3.818v6.364C3 12.29 4.79 14 7 14zm6.364-7h-.637a.643.643 0 0 0-.636.65V9.6c0 3.039-2.565 5.477-5.6 5.175-2.645-.264-4.582-2.692-4.582-5.407V7.65c0-.36-.285-.65-.636-.65H.636A.643.643 0 0 0 0 7.65v1.631c0 3.642 2.544 6.888 6.045 7.382v1.387H3.818a.643.643 0 0 0-.636.65v.65c0 .36.285.65.636.65h6.364c.351 0 .636-.29.636-.65v-.65c0-.36-.285-.65-.636-.65H7.955v-1.372C11.363 16.2 14 13.212 14 9.6V7.65c0-.36-.285-.65-.636-.65z",fill:"#FFF","fill-rule":"nonzero"})})})}function Sk(e){return`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`}function Tk({recordingLengthSeconds:e}){const l=Sk(e);return T("span",{children:l})}function Jk({onSubmit:e,i18n:l}){return T("button",{className:"uppy-u-reset uppy-c-btn uppy-Audio-button uppy-Audio-button--submit",type:"button",title:l("submitRecordedFile"),"aria-label":l("submitRecordedFile"),onClick:e,"data-uppy-super-focusable":!0,children:T("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:T("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})})})}function Gk(e){const{stream:l,recordedAudio:t,onStop:d,recording:n,supportsRecording:a,audioSources:i,showAudioSourceDropdown:s,onSubmit:c,i18n:F,onStartRecording:o,onStopRecording:h,onDiscardRecordedAudio:V,recordingLengthSeconds:W}=e,Q=Ca(null),m=Ca();Qs(()=>()=>{m.current=null,d()},[d]),Qs(()=>{if(!t&&(m.current=new uk(Q.current,{canvas:{width:600,height:600},canvasContext:{lineWidth:2,fillStyle:"rgb(0,0,0)",strokeStyle:"green"}}),m.current.draw(),l)){const S=new AudioContext().createMediaStreamSource(l);m.current.addSource(S)}},[t,l]);const N=t!=null,b=!N&&a,r=s&&!N&&i&&i.length>1;return T("div",{className:"uppy-Audio-container",children:[T("div",{className:"uppy-Audio-audioContainer",children:N?T("audio",{className:"uppy-Audio-player",controls:!0,src:t}):T("canvas",{ref:Q,className:"uppy-Audio-canvas"})}),T("div",{className:"uppy-Audio-footer",children:[T("div",{className:"uppy-Audio-audioSourceContainer",children:r?bk(e):null}),T("div",{className:"uppy-Audio-buttonContainer",children:[b&&T(Mk,{recording:n,onStartRecording:o,onStopRecording:h,i18n:F}),N&&T(Jk,{onSubmit:c,i18n:F}),N&&T(pk,{onDiscard:V,i18n:F})]}),T("div",{className:"uppy-Audio-recordingLength",children:!N&&T(Tk,{recordingLengthSeconds:W})})]})]})}function yk(){var e;return typeof MediaRecorder=="function"&&typeof((e=MediaRecorder.prototype)==null?void 0:e.start)=="function"}class Dp extends Ln{constructor(t,d){super(t,d);al(this,pU);al(this,bU);f(this,"icon");al(this,Vd,null);al(this,uU,!1);al(this,Ne,null);al(this,Re,null);al(this,ss,null);al(this,Wd);al(this,w0);al(this,MU,t=>{if(!H(this,w0))return Promise.reject(new Error("Microphone access not supported"));hl(this,uU,!0),Zl(this,pU,rX).call(this).then(d=>(this.setPluginState({hasAudio:d}),H(this,Wd).getUserMedia({audio:!0}).then(n=>{hl(this,Vd,n);let a=null;const i=n.getAudioTracks();t!=null&&t.deviceId?a=i.findLast(s=>s.getSettings().deviceId===t.deviceId):a=i[0].getSettings().deviceId,H(this,SU).call(this),this.setPluginState({currentDeviceId:a,audioReady:!0})}).catch(n=>{this.setPluginState({audioReady:!1,cameraError:n}),this.uppy.info(n.message,"error")})))});al(this,nQ,()=>{hl(this,Re,new MediaRecorder(H(this,Vd))),hl(this,Ne,[]);let t=!1;H(this,Re).addEventListener("dataavailable",d=>{H(this,Ne).push(d.data);const{restrictions:n}=this.uppy.opts;if(H(this,Ne).length>1&&n.maxFileSize!=null&&!t){const a=H(this,Ne).reduce((F,o)=>F+o.size,0),s=(a-H(this,Ne)[0].size)/(H(this,Ne).length-1)*3,c=Math.max(0,n.maxFileSize-s);a>c&&(t=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),H(this,E0).call(this))}}),H(this,Re).start(500),hl(this,bU,setInterval(()=>{const d=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:d+1})},1e3)),this.setPluginState({isRecording:!0})});al(this,E0,()=>new Promise(d=>{H(this,Re).addEventListener("stop",()=>{d()}),H(this,Re).stop(),clearInterval(H(this,bU)),this.setPluginState({recordingLengthSeconds:0})}).then(()=>(this.setPluginState({isRecording:!1}),Zl(this,pU,bX).call(this))).then(d=>{try{hl(this,ss,d),this.setPluginState({recordedAudio:URL.createObjectURL(d.data)})}catch(n){n.isRestriction||this.uppy.log(n)}}).then(()=>{hl(this,Ne,null),hl(this,Re,null)},d=>{throw hl(this,Ne,null),hl(this,Re,null),d}));al(this,aQ,()=>{this.setPluginState({recordedAudio:null}),hl(this,ss,null)});al(this,iQ,()=>{try{H(this,ss)&&this.uppy.addFile(H(this,ss))}catch(t){t.isRestriction||this.uppy.log(t,"warning")}});al(this,cs,async()=>{H(this,Vd)&&H(this,Vd).getAudioTracks().forEach(d=>d.stop()),H(this,Re)&&await new Promise(t=>{H(this,Re).addEventListener("stop",t,{once:!0}),H(this,Re).stop(),clearInterval(H(this,bU))}),hl(this,Ne,null),hl(this,Re,null),hl(this,uU,!1),hl(this,Vd,null),this.setPluginState({recordedAudio:null,isRecording:!1,recordingLengthSeconds:0})});al(this,sQ,t=>{H(this,cs).call(this),H(this,MU).call(this,{deviceId:t})});al(this,SU,()=>{H(this,Wd).enumerateDevices().then(t=>{this.setPluginState({audioSources:t.filter(d=>d.kind==="audioinput")})})});hl(this,Wd,navigator.mediaDevices),hl(this,w0,H(this,Wd)!=null),this.id=this.opts.id||"Audio",this.type="acquirer",this.icon=()=>T("svg",{className:"uppy-DashboardTab-iconAudio","aria-hidden":"true",focusable:"false",width:"32px",height:"32px",viewBox:"0 0 32 32",children:T("path",{d:"M21.143 12.297c.473 0 .857.383.857.857v2.572c0 3.016-2.24 5.513-5.143 5.931v2.64h2.572a.857.857 0 110 1.714H12.57a.857.857 0 110-1.714h2.572v-2.64C12.24 21.24 10 18.742 10 15.726v-2.572a.857.857 0 111.714 0v2.572A4.29 4.29 0 0016 20.01a4.29 4.29 0 004.286-4.285v-2.572c0-.474.384-.857.857-.857zM16 6.5a3 3 0 013 3v6a3 3 0 01-6 0v-6a3 3 0 013-3z",fill:"currentcolor","fill-rule":"nonzero"})}),this.defaultLocale=Rk,this.opts={...d},this.i18nInit(),this.title=this.i18n("pluginNameAudio"),this.setPluginState({hasAudio:!1,audioReady:!1,cameraError:null,recordingLengthSeconds:0,audioSources:[],currentDeviceId:null})}render(){H(this,uU)||H(this,MU).call(this);const t=this.getPluginState();return!t.audioReady||!t.hasAudio?T(rk,{icon:this.icon,i18n:this.i18n,hasAudio:t.hasAudio}):T(Gk,{...t,onChangeSource:H(this,sQ),onStartRecording:H(this,nQ),onStopRecording:H(this,E0),onDiscardRecordedAudio:H(this,aQ),onSubmit:H(this,iQ),onStop:H(this,cs),i18n:this.i18n,showAudioSourceDropdown:this.opts.showAudioSourceDropdown,supportsRecording:yk(),recording:t.isRecording,stream:H(this,Vd)})}install(){this.setPluginState({audioReady:!1,recordingLengthSeconds:0});const{target:t}=this.opts;t&&this.mount(t,this),H(this,Wd)&&(H(this,SU).call(this),H(this,Wd).ondevicechange=()=>{if(H(this,SU).call(this),H(this,Vd)){let d=!0;const{audioSources:n,currentDeviceId:a}=this.getPluginState();n.forEach(i=>{a===i.deviceId&&(d=!1)}),d&&(H(this,cs).call(this),H(this,MU).call(this))}})}uninstall(){H(this,Vd)&&H(this,cs).call(this),this.unmount()}}bU=new WeakMap,Vd=new WeakMap,uU=new WeakMap,Ne=new WeakMap,Re=new WeakMap,ss=new WeakMap,Wd=new WeakMap,w0=new WeakMap,pU=new WeakSet,rX=function(){return H(this,Wd)?H(this,Wd).enumerateDevices().then(t=>t.some(d=>d.kind==="audioinput")):Promise.resolve(!1)},MU=new WeakMap,nQ=new WeakMap,E0=new WeakMap,aQ=new WeakMap,iQ=new WeakMap,cs=new WeakMap,bX=function(){const t=H(this,Ne).find(s=>{var c;return((c=s.type)==null?void 0:c.length)>0}).type,d=wa(t);if(!d)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${t}"`));const n=`audio-${Date.now()}.${d}`,a=new Blob(H(this,Ne),{type:t}),i={source:this.id,name:n,data:new Blob([a],{type:t}),type:t};return Promise.resolve(i)},sQ=new WeakMap,SU=new WeakMap,f(Dp,"VERSION",Nk.version);const Xk={pluralize(){return 0},strings:{addBulkFilesFailed:{0:"因内部错误,添加 %{smart_count} 个文件失败",1:"因内部错误,添加 %{smart_count} 个文件失败"},addedNumFiles:"已添加 %{numFiles} 个文件",addingMoreFiles:"正在添加更多文件",additionalRestrictionsFailed:"%{count} 个附加限制未满足",addMore:"添加更多",addMoreFiles:"添加更多文件",aggregateExceedsSize:"您选择的文件总大小为 %{size},但允许的最大总大小为 %{sizeAllowed}",allFilesFromFolderNamed:"来自文件夹 %{name} 的所有文件",allowAccessDescription:"请允许本站访问您的摄像头,以便拍照或录制视频。",allowAccessTitle:"请允许访问您的摄像头",allowAudioAccessDescription:"请允许本站访问您的麦克风,以便录制音频。",allowAudioAccessTitle:"请允许访问您的麦克风",aspectRatioLandscape:"裁剪为横向 (16:9)",aspectRatioPortrait:"裁剪为纵向 (9:16)",aspectRatioSquare:"裁剪为方形",authAborted:"身份验证已中止",authenticate:"连接",authenticateWith:"连接到 %{pluginName}",authenticateWithTitle:"请通过 %{pluginName} 验证以选择文件",back:"返回",browse:"浏览",browseFiles:"浏览文件",browseFolders:"浏览文件夹",cancel:"取消",cancelUpload:"取消上传",closeModal:"关闭窗口",companionError:"与 Companion 连接失败",companionUnauthorizeHint:"要取消对 %{provider} 帐户的授权,请访问 %{url}",complete:"完成",compressedX:"通过压缩图像节省了 %{size}",compressingImages:"正在压缩图像...",connectedToInternet:"已连接到互联网",copyLink:"复制链接",copyLinkToClipboardFallback:"请复制下方的 URL",copyLinkToClipboardSuccess:"链接已复制到剪贴板。",creatingAssembly:"正在准备上传...",creatingAssemblyFailed:"Transloadit: 无法创建程序集",dashboardTitle:"Uppy 仪表盘",dashboardWindowTitle:"Uppy 仪表盘窗口 (按 ESC 键关闭)",dataUploadedOfTotal:"%{complete} / %{total}",dataUploadedOfUnknown:"已上传 %{complete}",discardMediaFile:"丢弃媒体文件",discardRecordedFile:"丢弃录制的文件",done:"完成",dropHereOr:"拖放到此处,或%{browse}",dropHint:"将文件拖放到此处",dropPasteBoth:"拖放粘贴文件或文件夹到此处,或者%{browseFiles} / %{browseFolders}",dropPasteFiles:"拖放粘贴文件到此处,或者%{browseFiles}",dropPasteFolders:"拖放粘贴文件到此处,或者%{browseFolders}",dropPasteImportBoth:"拖放粘贴文件到此处,%{browseFiles},%{browseFolders}或从以下位置导入:",dropPasteImportFiles:"拖放粘贴文件到此处,%{browseFiles}或从以下位置导入:",dropPasteImportFolders:"拖放粘贴文件到此处,%{browseFolders}或从以下位置导入:",editFile:"编辑文件",editFileWithFilename:"编辑文件 %{file}",editImage:"编辑图像",editing:"正在编辑 %{file}",emptyFolderAdded:"未从空文件夹添加任何文件",encoding:"正在编码...",enterCorrectUrl:"URL 不正确:请输入文件的直接链接",enterTextToSearch:"输入文本以搜索图像",enterUrlToImport:"输入 URL 以导入文件",error:"错误",exceedsSize:"%{file} 超出了 %{size} 的最大允许大小",failedToFetch:"Companion 无法抓取此 URL,请确保它是正确的",failedToUpload:"上传 %{file} 失败",filesUploadedOfTotal:{0:"%{smart_count} 个文件已上传 %{complete} 个",1:"%{smart_count} 个文件已上传 %{complete} 个"},filter:"筛选",finishEditingFile:"完成文件编辑",flipHorizontal:"水平翻转",folderAdded:{0:"从 %{folder} 添加了 %{smart_count} 个文件",1:"从 %{folder} 添加了 %{smart_count} 个文件"},folderAlreadyAdded:'文件夹 "%{folder}" 已添加',generatingThumbnails:"正在生成缩略图...",import:"导入",importFiles:"从以下位置导入文件:",importFrom:"从 %{name} 导入",inferiorSize:"此文件小于 %{size} 的最小允许大小",loadedXFiles:"已加载 %{numFiles} 个文件",loading:"加载中...",logIn:"登录",logOut:"登出",micDisabled:"用户已拒绝麦克风访问",missingRequiredMetaField:"缺少必需的元数据字段",missingRequiredMetaFieldOnFile:"%{fileName} 缺少必需的元数据字段",missingRequiredMetaFields:{0:"缺少必需的元数据字段: %{fields}。",1:"缺少必需的元数据字段: %{fields}。"},myDevice:"我的设备",noAudioDescription:"请连接麦克风或其他音频输入设备,以便录制音频",noAudioTitle:"麦克风不可用",noCameraDescription:"请连接摄像头设备,以便拍照或录制视频",noCameraTitle:"摄像头不可用",noDuplicates:"无法添加重复文件“%{fileName}”,该文件已存在",noFilesFound:"此处没有文件或文件夹",noInternetConnection:"无网络连接",noMoreFilesAllowed:"无法添加更多文件",noSearchResults:"抱歉,没有找到相关结果",openFolderNamed:"打开文件夹 %{name}",pause:"暂停",paused:"已暂停",pauseUpload:"暂停上传",pickFiles:"选择文件",pickPhotos:"选择照片",pleaseWait:"请稍候",pluginNameAudio:"音频",pluginNameBox:"Box",pluginNameCamera:"摄像头",pluginNameDropbox:"Dropbox",pluginNameFacebook:"Facebook",pluginNameGoogleDrive:"Google Drive",pluginNameGoogleDrivePicker:"Google Drive",pluginNameGooglePhotosPicker:"Google Photos",pluginNameInstagram:"Instagram",pluginNameOneDrive:"OneDrive",pluginNameScreenCapture:"屏幕录制",pluginNameUnsplash:"Unsplash",pluginNameUrl:"链接",pluginNameWebdav:"WebDAV",pluginNameZoom:"Zoom",pluginWebdavInputLabel:"文件的 WebDAV URL (例如来自 ownCloud 或 Nextcloud)",poweredBy:"由 %{uppy} 驱动",processingXFiles:{0:"正在处理 %{smart_count} 个文件",1:"正在处理 %{smart_count} 个文件"},recording:"录制中",recordingLength:"录制时长 %{recording_length}",recordingStoppedMaxSize:"录制已停止,因为文件大小即将超出限制",recordVideoBtn:"录制视频",recoveredAllFiles:"已恢复所有文件。您现在可以继续上传。",recoveredXFiles:{0:"无法完全恢复 1 个文件。请重新选择并继续上传。",1:"无法完全恢复 %{smart_count} 个文件。请重新选择并继续上传。"},removeFile:"移除文件",reSelect:"重新选择",resetFilter:"重置筛选",resetSearch:"重置搜索",resume:"继续",resumeUpload:"继续上传",retry:"重试",retryUpload:"重试上传",revert:"重置",rotate:"旋转 90°",save:"保存",saveChanges:"保存更改",search:"搜索",searchImages:"搜索图像",selectX:{0:"选择 %{smart_count} 项",1:"选择 %{smart_count} 项"},sessionRestored:"会话已恢复",showErrorDetails:"显示错误详情",signInWithGoogle:"使用 Google 登录",smile:"笑一笑!",startAudioRecording:"开始音频录制",startCapturing:"开始屏幕录制",startRecording:"开始视频录制",stopAudioRecording:"停止音频录制",stopCapturing:"停止屏幕录制",stopRecording:"停止视频录制",streamActive:"直播流活跃",streamPassive:"直播流空闲",submitRecordedFile:"提交录制的文件",takePicture:"拍照",takePictureBtn:"拍照",takeScreenshot:"截屏",unnamed:"未命名",upload:"上传",uploadComplete:"上传完成",uploadFailed:"上传失败",uploading:"上传中",uploadingXFiles:{0:"正在上传 %{smart_count} 个文件",1:"正在上传 %{smart_count} 个文件"},uploadPaused:"上传已暂停",uploadStalled:"上传在 %{seconds} 秒内无任何进展。您可能需要重试。",uploadXFiles:{0:"上传 %{smart_count} 个文件",1:"上传 %{smart_count} 个文件"},uploadXNewFiles:{0:"上传 +%{smart_count} 个文件",1:"上传 +%{smart_count} 个文件"},xFilesSelected:{0:"已选择 %{smart_count} 个文件",1:"已选择 %{smart_count} 个文件"},xMoreFilesAdded:{0:"又添加了 %{smart_count} 个文件",1:"又添加了 %{smart_count} 个文件"},xTimeLeft:"剩余 %{time}",youCanOnlyUploadFileTypes:"您只能上传以下类型:%{types}",youCanOnlyUploadX:{0:"您只能上传 %{smart_count} 个文件",1:"您只能上传 %{smart_count} 个文件"},youHaveToAtLeastSelectX:{0:"您至少要选择 %{smart_count} 个文件",1:"您至少要选择 %{smart_count} 个文件"},zoomIn:"放大",zoomOut:"缩小"}};var rm={exports:{}};/*!
|
|
18
18
|
Copyright (c) 2018 Jed Watson.
|
|
@@ -61,7 +61,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
61
61
|
`,e.contentWindow.document.head.appendChild(d),e.contentWindow.document.body.style.width="100%"}function PD(e){return new Promise(l=>{const t=document.createElement("iframe");t.width="0",t.height="0",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.border="none",t.style.overflow="hidden",t.onload=()=>l(t),e.appendChild(t)})}function AD(e,l){const t=URL.createObjectURL(new Blob([e],{type:"application/pdf"})),d=document.createElement("a");d.href=t,d.download=l,d.style.display="none",document.body.append(d),d.click(),setTimeout(()=>{URL.revokeObjectURL(t),document.body.removeChild(d)},1e3)}function jT(e){for(;e!=null&&e.firstChild;)e.removeChild(e.firstChild)}function OT(e){return e?Object.prototype.hasOwnProperty.call(e,"_pdfInfo"):!1}function jR(e){e==null||e.querySelectorAll("canvas").forEach(l=>{var t;l.width=1,l.height=1,(t=l.getContext("2d"))==null||t.clearRect(0,0,1,1)})}function vT({onError:e,onPasswordRequest:l,onProgress:t,source:d}){const n=U.shallowRef(null),a=U.shallowRef(null);return U.watchEffect(async()=>{const i=U.toValue(d);if(i){if(OT(i)){n.value=i;return}}else return;try{a.value=fD(i),l&&(a.value.onPassword=(s,c)=>{l({callback:s,isWrongPassword:c===OD.INCORRECT_PASSWORD})}),t&&(a.value.onProgress=t),n.value=await a.value.promise}catch(s){if(n.value=null,e)e(s);else throw s}}),U.watch(n,(i,s)=>{s==null||s.destroy()}),U.onBeforeUnmount(()=>{var i,s,c,F;(i=a.value)!=null&&i.onPassword&&(a.value.onPassword=null),(s=a.value)!=null&&s.onProgress&&(a.value.onProgress=null),(c=a.value)==null||c.destroy(),OT(U.toValue(d))||(F=n.value)==null||F.destroy()}),{doc:n}}var OF={};OF.d=(e,l)=>{for(var t in l)OF.o(l,t)&&!OF.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:l[t]})},OF.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l);var _l=globalThis.pdfjsViewer={};OF.d(_l,{AnnotationLayerBuilder:()=>mJ,DownloadManager:()=>vw,EventBus:()=>bJ,FindState:()=>ua,GenericL10n:()=>eW,LinkTarget:()=>wi,PDFFindController:()=>Bw,PDFHistory:()=>jE,PDFLinkService:()=>VJ,PDFPageView:()=>cG,PDFScriptingManager:()=>dC,PDFSinglePageViewer:()=>sC,PDFViewer:()=>uG,ProgressBar:()=>cw,RenderingStates:()=>tt,ScrollMode:()=>yl,SimpleLinkService:()=>nr,SpreadMode:()=>Pt,StructTreeLayerBuilder:()=>$J,TextLayerBuilder:()=>nG,XfaLayerBuilder:()=>aG,parseQueryString:()=>xV});const _D="auto",fT=1,KT=1.1,qD=.1,$D=10,OR=0,lw=1.25,HT=40,PT=5,tt={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},jc={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},xd={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2},yl={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},Pt={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};function AT(e,l,t=!1){let d=e.offsetParent;if(!d){console.error("offsetParent is not set -- cannot scroll");return}let n=e.offsetTop+e.clientTop,a=e.offsetLeft+e.clientLeft;for(;d.clientHeight===d.scrollHeight&&d.clientWidth===d.scrollWidth||t&&(d.classList.contains("markedContent")||getComputedStyle(d).overflow==="hidden");)if(n+=d.offsetTop,a+=d.offsetLeft,d=d.offsetParent,!d)return;l&&(l.top!==void 0&&(n+=l.top),l.left!==void 0&&(a+=l.left,d.scrollLeft=a)),d.scrollTop=n}function tw(e,l,t=void 0){const d=function(i){a||(a=window.requestAnimationFrame(function(){a=null;const s=e.scrollLeft,c=n.lastX;s!==c&&(n.right=s>c),n.lastX=s;const F=e.scrollTop,o=n.lastY;F!==o&&(n.down=F>o),n.lastY=F,l(n)}))},n={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:d};let a=null;return e.addEventListener("scroll",d,{useCapture:!0,signal:t}),t==null||t.addEventListener("abort",()=>window.cancelAnimationFrame(a),{once:!0}),n}function xV(e){const l=new Map;for(const[t,d]of new URLSearchParams(e))l.set(t.toLowerCase(),d);return l}const _T=/[\x00-\x1F]/g;function vF(e,l=!1){return _T.test(e)?l?e.replaceAll(_T,t=>t==="\0"?"":" "):e.replaceAll("\0",""):e}function fF(e,l,t=0){let d=t,n=e.length-1;if(n<0||!l(e[n]))return e.length;if(l(e[d]))return d;for(;d<n;){const a=d+n>>1,i=e[a];l(i)?n=a:d=a+1}return d}function qT(e){if(Math.floor(e)===e)return[e,1];const l=1/e,t=8;if(l>t)return[1,t];if(Math.floor(l)===l)return[1,l];const d=e>1?l:e;let n=0,a=1,i=1,s=1;for(;;){const F=n+i,o=a+s;if(o>t)break;d<=F/o?(i=F,s=o):(n=F,a=o)}let c;return d-n/a<i/s-d?c=d===e?[n,a]:[a,n]:c=d===e?[i,s]:[s,i],c}function gV(e,l){return e-e%l}function ew(e,l,t){if(e<2)return e;let d=l[e].div,n=d.offsetTop+d.clientTop;n>=t&&(d=l[e-1].div,n=d.offsetTop+d.clientTop);for(let a=e-2;a>=0&&(d=l[a].div,!(d.offsetTop+d.clientTop+d.clientHeight<=n));--a)e=a;return e}function dw({scrollEl:e,views:l,sortByVisibility:t=!1,horizontal:d=!1,rtl:n=!1}){const a=e.scrollTop,i=a+e.clientHeight,s=e.scrollLeft,c=s+e.clientWidth;function F(r){const u=r.div;return u.offsetTop+u.clientTop+u.clientHeight>a}function o(r){const u=r.div,S=u.offsetLeft+u.clientLeft,G=S+u.clientWidth;return n?S<c:G>s}const h=[],V=new Set,W=l.length;let Q=fF(l,d?o:F);Q>0&&Q<W&&!d&&(Q=ew(Q,l,a));let m=d?c:-1;for(let r=Q;r<W;r++){const u=l[r],S=u.div,G=S.offsetLeft+S.clientLeft,J=S.offsetTop+S.clientTop,Y=S.clientWidth,L=S.clientHeight,y=G+Y,z=J+L;if(m===-1)z>=i&&(m=z);else if((d?G:J)>m)break;if(z<=a||J>=i||y<=s||G>=c)continue;const I=Math.max(0,a-J)+Math.max(0,z-i),O=Math.max(0,s-G)+Math.max(0,y-c),E=(L-I)/L,j=(Y-O)/Y,C=E*j*100|0;h.push({id:u.id,x:G,y:J,view:u,percent:C,widthPercent:j*100|0}),V.add(u.id)}const N=h[0],b=h.at(-1);return t&&h.sort(function(r,u){const S=r.percent-u.percent;return Math.abs(S)>.001?-S:r.id-u.id}),{first:N,last:b,views:h,ids:V}}function $T(e){return Number.isInteger(e)&&e%90===0}function nw(e){return Number.isInteger(e)&&Object.values(yl).includes(e)&&e!==yl.UNKNOWN}function aw(e){return Number.isInteger(e)&&Object.values(Pt).includes(e)&&e!==Pt.UNKNOWN}function lJ(e){return e.width<=e.height}new Promise(function(e){window.requestAnimationFrame(e)});const iw=document.documentElement.style;function sw(e,l,t){return Math.min(Math.max(e,l),t)}var Ii,Oc,Di,KF,vc;class cw{constructor(l){M(this,Ii,null),M(this,Oc,null),M(this,Di,0),M(this,KF,null),M(this,vc,!0),R(this,Ii,l.classList),R(this,KF,l.style)}get percent(){return Z(this,Di)}set percent(l){if(R(this,Di,sw(l,0,100)),isNaN(l)){Z(this,Ii).add("indeterminate");return}Z(this,Ii).remove("indeterminate"),Z(this,KF).setProperty("--progressBar-percent",`${Z(this,Di)}%`)}setWidth(l){if(!l)return;const t=l.parentNode.offsetWidth-l.offsetWidth;t>0&&Z(this,KF).setProperty("--progressBar-end-offset",`${t}px`)}setDisableAutoFetch(l=5e3){Z(this,Di)===100||isNaN(Z(this,Di))||(Z(this,Oc)&&clearTimeout(Z(this,Oc)),this.show(),R(this,Oc,setTimeout(()=>{R(this,Oc,null),this.hide()},l)))}hide(){Z(this,vc)&&(R(this,vc,!1),Z(this,Ii).add("hidden"))}show(){Z(this,vc)||(R(this,vc,!0),Z(this,Ii).remove("hidden"))}}Ii=new WeakMap,Oc=new WeakMap,Di=new WeakMap,KF=new WeakMap,vc=new WeakMap;function Uw(e){let l=yl.VERTICAL,t=Pt.NONE;switch(e){case"SinglePage":l=yl.PAGE;break;case"OneColumn":break;case"TwoPageLeft":l=yl.PAGE;case"TwoColumnLeft":t=Pt.ODD;break;case"TwoPageRight":l=yl.PAGE;case"TwoColumnRight":t=Pt.EVEN;break}return{scrollMode:l,spreadMode:t}}const jV=(function(){const e=document.createElement("div");return e.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)",e.style.width==="calc(1320px)"?Math.fround:l=>l})(),Ud={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};function Zw(e){return e<11904}function Fw(e){return(e&65408)===0}function ow(e){return e>=97&&e<=122||e>=65&&e<=90}function hw(e){return e>=48&&e<=57}function Vw(e){return e===32||e===9||e===13||e===10}function Ww(e){return e>=13312&&e<=40959||e>=63744&&e<=64255}function Qw(e){return e>=12448&&e<=12543}function mw(e){return e>=12352&&e<=12447}function Nw(e){return e>=65376&&e<=65439}function Rw(e){return(e&65408)===3584}function OV(e){return Zw(e)?Fw(e)?Vw(e)?Ud.SPACE:ow(e)||hw(e)||e===95?Ud.ALPHA_LETTER:Ud.PUNCT:Rw(e)?Ud.THAI_LETTER:e===160?Ud.SPACE:Ud.ALPHA_LETTER:Ww(e)?Ud.HAN_LETTER:Qw(e)?Ud.KATAKANA_LETTER:mw(e)?Ud.HIRAGANA_LETTER:Nw(e)?Ud.HALFWIDTH_KATAKANA_LETTER:Ud.ALPHA_LETTER}let vR;function rw(){return vR||(vR=" ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩"),vR}const ua={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},bw=250,uw=-50,pw=-400,tJ={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},eJ=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let fR;const Mw=new RegExp("\\p{M}+","gu"),Sw=new RegExp("([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})","gu"),Tw=new RegExp("([^\\p{M}])\\p{M}*$","u"),Jw=new RegExp("^\\p{M}*([^\\p{M}])","u"),Gw=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,dJ=new Map,yw="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",nJ=new Map;let KR=null,HR=null;function PR(e){const l=[];let t;for(;(t=Gw.exec(e))!==null;){let{index:m}=t;for(const N of t[0]){let b=dJ.get(N);b||(b=N.normalize("NFD").length,dJ.set(N,b)),l.push([b,m++])}}let d;if(l.length===0&&KR)d=KR;else if(l.length>0&&HR)d=HR;else{const m=Object.keys(tJ).join(""),N=rw(),b=`([${m}])|([${N}])|((?:゙|゚)\\n)|(\\p{M}+(?:-\\n)?)|(\\p{Ll}-\\n\\p{Lu})|(\\S-\\n)|((?:\\p{Ideographic}|[-ヿ])\\n)|(\\n)`;l.length===0?d=KR=new RegExp(b+"|(\\u0000)","gum"):d=HR=new RegExp(b+`|(${yw})`,"gum")}const n=[];for(;(t=Mw.exec(e))!==null;)n.push([t[0].length,t.index]);let a=e.normalize("NFD");const i=[0,0];let s=0,c=0,F=0,o=0,h=0,V=!1;a=a.replace(d,(m,N,b,r,u,S,G,J,Y,L,y)=>{var z,I,O;if(y-=o,N){const E=tJ[N],j=E.length;for(let C=1;C<j;C++)i.push(y-F+C,F-C);return F-=j-1,E}if(b){let E=nJ.get(b);E||(E=b.normalize("NFKC"),nJ.set(b,E));const j=E.length;for(let C=1;C<j;C++)i.push(y-F+C,F-C);return F-=j-1,E}if(r)return V=!0,y+h===((z=n[s])==null?void 0:z[1])?++s:(i.push(y-1-F+1,F-1),F-=1,o+=1),i.push(y-F+1,F),o+=1,h+=1,r.charAt(0);if(u){const E=u.endsWith(`
|
|
62
62
|
`),j=E?u.length-2:u.length;V=!0;let C=j;y+h===((I=n[s])==null?void 0:I[1])&&(C-=n[s][0],++s);for(let B=1;B<=C;B++)i.push(y-1-F+B,F-B);return F-=C,o+=C,E?(y+=j-1,i.push(y-F+1,1+F),F+=1,o+=1,h+=1,u.slice(0,j)):u}if(S)return o+=1,h+=1,S.replace(`
|
|
63
63
|
`,"");if(G){const E=G.length-2;return i.push(y-F+E,1+F),F+=1,o+=1,h+=1,G.slice(0,-2)}if(J){const E=J.length-1;return i.push(y-F+E,F),o+=1,h+=1,J.slice(0,-1)}if(Y)return i.push(y-F+1,F-1),F-=1,o+=1,h+=1," ";if(y+h===((O=l[c])==null?void 0:O[1])){const E=l[c][0]-1;++c;for(let j=1;j<=E;j++)i.push(y-(F-j),F-j);F-=E,o+=E}return L}),i.push(a.length,F);const W=new Uint32Array(i.length>>1),Q=new Int32Array(i.length>>1);for(let m=0,N=i.length;m<N;m+=2)W[m>>1]=i[m],Q[m>>1]=i[m+1];return[a,[W,Q],V]}function Xw(e,l,t){if(!e)return[l,t];const[d,n]=e,a=l,i=l+t-1;let s=fF(d,h=>h>=a);d[s]>a&&--s;let c=fF(d,h=>h>=i,s);d[c]>i&&--c;const F=a+n[s],o=i+n[c]+1-F;return[F,o]}var It,HF,fc,bl,aJ,AR,_R,iJ,sJ,qR,cJ,UJ,vV,PF,Kc,ZJ,$R,lr,fV,FJ,tr,er,AF;class Bw{constructor({linkService:l,eventBus:t,updateMatchesCountOnProgress:d=!0}){M(this,bl),M(this,It,null),M(this,HF,!0),M(this,fc,0),this._linkService=l,this._eventBus=t,R(this,HF,d),this.onIsPageVisible=null,p(this,bl,AR).call(this),t._on("find",p(this,bl,aJ).bind(this)),t._on("findbarclose",p(this,bl,FJ).bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return Z(this,It)}setDocument(l){this._pdfDocument&&p(this,bl,AR).call(this),l&&(this._pdfDocument=l,this._firstPageCapability.resolve())}scrollMatchIntoView({element:l=null,selectedLeft:t=0,pageIndex:d=-1,matchIndex:n=-1}){if(!this._scrollMatches||!l||n===-1||n!==this._selected.matchIdx||d===-1||d!==this._selected.pageIdx)return;this._scrollMatches=!1;const a={top:uw,left:t+pw};AT(l,a,!0)}match(l,t,d){const n=this._hasDiacritics[d];let a=!1;if(typeof l=="string"?[a,l]=p(this,bl,qR).call(this,l,n):l=l.sort().reverse().map(h=>{const[V,W]=p(this,bl,qR).call(this,h,n);return a||(a=V),`(${W})`}).join("|"),!l)return;const{caseSensitive:i,entireWord:s}=Z(this,It),c=`g${a?"u":""}${i?"":"i"}`;l=new RegExp(l,c);const F=[];let o;for(;(o=l.exec(t))!==null;)s&&!p(this,bl,sJ).call(this,t,o.index,o[0].length)||F.push({index:o.index,length:o[0].length});return F}}It=new WeakMap,HF=new WeakMap,fc=new WeakMap,bl=new WeakSet,aJ=function(e){if(!e)return;const l=this._pdfDocument,{type:t}=e;(Z(this,It)===null||p(this,bl,iJ).call(this,e))&&(this._dirtyMatch=!0),R(this,It,e),t!=="highlightallchange"&&p(this,bl,AF).call(this,ua.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||l&&this._pdfDocument!==l)return;p(this,bl,UJ).call(this);const d=!this._highlightMatches,n=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),t?this._dirtyMatch?p(this,bl,Kc).call(this):t==="again"?(p(this,bl,Kc).call(this),d&&Z(this,It).highlightAll&&p(this,bl,PF).call(this)):t==="highlightallchange"?(n?p(this,bl,Kc).call(this):this._highlightMatches=!0,p(this,bl,PF).call(this)):p(this,bl,Kc).call(this):this._findTimeout=setTimeout(()=>{p(this,bl,Kc).call(this),this._findTimeout=null},bw)})},AR=function(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],R(this,fc,0),R(this,It,null),this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=Promise.withResolvers()},_R=function(){const{query:e}=Z(this,It);return typeof e=="string"?(e!==this._rawQuery&&(this._rawQuery=e,[this._normalizedQuery]=PR(e)),this._normalizedQuery):(e||[]).filter(l=>!!l).map(l=>PR(l)[0])},iJ=function(e){var l;const t=e.query,d=Z(this,It).query,n=typeof t;if(n!==typeof d)return!0;if(n==="string"){if(t!==d)return!0}else if(JSON.stringify(t)!==JSON.stringify(d))return!0;switch(e.type){case"again":const a=this._selected.pageIdx+1,i=this._linkService;return a>=1&&a<=i.pagesCount&&a!==i.page&&!(((l=this.onIsPageVisible)==null?void 0:l.call(this,a))??!0);case"highlightallchange":return!1}return!0},sJ=function(e,l,t){let d=e.slice(0,l).match(Tw);if(d){const n=e.charCodeAt(l),a=d[1].charCodeAt(0);if(OV(n)===OV(a))return!1}if(d=e.slice(l+t).match(Jw),d){const n=e.charCodeAt(l+t-1),a=d[1].charCodeAt(0);if(OV(n)===OV(a))return!1}return!0},qR=function(e,l){const{matchDiacritics:t}=Z(this,It);let d=!1;e=e.replaceAll(Sw,(a,i,s,c,F,o)=>i?`[ ]*\\${i}[ ]*`:s?`[ ]*${s}[ ]*`:c?"[ ]+":t?F||o:F?eJ.has(F.charCodeAt(0))?F:"":l?(d=!0,`${o}\\p{M}*`):o);const n="[ ]*";return e.endsWith(n)&&(e=e.slice(0,e.length-n.length)),t&&l&&(fR||(fR=String.fromCharCode(...eJ)),d=!0,e=`${e}(?=[${fR}]|[^\\p{M}]|$)`),[d,e]},cJ=function(e){const l=Z(this,bl,_R);if(l.length===0)return;const t=this._pageContents[e],d=this.match(l,t,e),n=this._pageMatches[e]=[],a=this._pageMatchesLength[e]=[],i=this._pageDiffs[e];d==null||d.forEach(({index:c,length:F})=>{const[o,h]=Xw(i,c,F);h&&(n.push(o),a.push(h))}),Z(this,It).highlightAll&&p(this,bl,vV).call(this,e),this._resumePageIdx===e&&(this._resumePageIdx=null,p(this,bl,$R).call(this));const s=n.length;this._matchesCountTotal+=s,Z(this,HF)?s>0&&p(this,bl,er).call(this):++le(this,fc)._===this._linkService.pagesCount&&p(this,bl,er).call(this)},UJ=function(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve();const l={disableNormalization:!0};for(let t=0,d=this._linkService.pagesCount;t<d;t++){const{promise:n,resolve:a}=Promise.withResolvers();this._extractTextPromises[t]=n,e=e.then(()=>this._pdfDocument.getPage(t+1).then(i=>i.getTextContent(l)).then(i=>{const s=[];for(const c of i.items)s.push(c.str),c.hasEOL&&s.push(`
|
|
64
|
-
`);[this._pageContents[t],this._pageDiffs[t],this._hasDiacritics[t]]=PR(s.join("")),a()},i=>{console.error(`Unable to get text content for page ${t+1}`,i),this._pageContents[t]="",this._pageDiffs[t]=null,this._hasDiacritics[t]=!1,a()}))}},vV=function(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})},PF=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},Kc=function(){const e=Z(this,It).findPrevious,l=this._linkService.page-1,t=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=l,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,R(this,fc,0),this._matchesCountTotal=0,p(this,bl,PF).call(this);for(let n=0;n<t;n++)this._pendingFindMatches.has(n)||(this._pendingFindMatches.add(n),this._extractTextPromises[n].then(()=>{this._pendingFindMatches.delete(n),p(this,bl,cJ).call(this,n)}))}if(Z(this,bl,_R).length===0){p(this,bl,AF).call(this,ua.FOUND);return}if(this._resumePageIdx)return;const d=this._offset;if(this._pagesToSearch=t,d.matchIdx!==null){const n=this._pageMatches[d.pageIdx].length;if(!e&&d.matchIdx+1<n||e&&d.matchIdx>0){d.matchIdx=e?d.matchIdx-1:d.matchIdx+1,p(this,bl,fV).call(this,!0);return}p(this,bl,lr).call(this,e)}p(this,bl,$R).call(this)},ZJ=function(e){const l=this._offset,t=e.length,d=Z(this,It).findPrevious;return t?(l.matchIdx=d?t-1:0,p(this,bl,fV).call(this,!0),!0):(p(this,bl,lr).call(this,d),l.wrapped&&(l.matchIdx=null,this._pagesToSearch<0)?(p(this,bl,fV).call(this,!1),!0):!1)},$R=function(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let e=null;do{const l=this._offset.pageIdx;if(e=this._pageMatches[l],!e){this._resumePageIdx=l;break}}while(!p(this,bl,ZJ).call(this,e))},lr=function(e){const l=this._offset,t=this._linkService.pagesCount;l.pageIdx=e?l.pageIdx-1:l.pageIdx+1,l.matchIdx=null,this._pagesToSearch--,(l.pageIdx>=t||l.pageIdx<0)&&(l.pageIdx=e?t-1:0,l.wrapped=!0)},fV=function(e=!1){let l=ua.NOT_FOUND;const t=this._offset.wrapped;if(this._offset.wrapped=!1,e){const d=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,l=t?ua.WRAPPED:ua.FOUND,d!==-1&&d!==this._selected.pageIdx&&p(this,bl,vV).call(this,d)}p(this,bl,AF).call(this,l,Z(this,It).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,p(this,bl,vV).call(this,this._selected.pageIdx))},FJ=function(e){const l=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||l&&this._pdfDocument!==l||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),p(this,bl,AF).call(this,ua.FOUND),this._highlightMatches=!1,p(this,bl,PF).call(this))})},tr=function(){var e;const{pageIdx:l,matchIdx:t}=this._selected;let d=0,n=this._matchesCountTotal;if(t!==-1){for(let a=0;a<l;a++)d+=((e=this._pageMatches[a])==null?void 0:e.length)||0;d+=t+1}return(d<1||d>n)&&(d=n=0),{current:d,total:n}},er=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:p(this,bl,tr).call(this)})},AF=function(e,l=!1){var t,d;!Z(this,HF)&&(Z(this,fc)!==this._linkService.pagesCount||e===ua.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:l,entireWord:((t=Z(this,It))==null?void 0:t.entireWord)??null,matchesCount:p(this,bl,tr).call(this),rawQuery:((d=Z(this,It))==null?void 0:d.query)??null})};const Yw="noopener noreferrer nofollow",wi={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};var dr,oJ;const hJ=class BX{constructor({eventBus:l,externalLinkTarget:t=null,externalLinkRel:d=null,ignoreDestinationZoom:n=!1}={}){Vl(this,"externalLinkEnabled",!0),this.eventBus=l,this.externalLinkTarget=t,this.externalLinkRel=d,this._ignoreDestinationZoom=n,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(l,t=null){this.baseUrl=t,this.pdfDocument=l}setViewer(l){this.pdfViewer=l}setHistory(l){this.pdfHistory=l}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(l){this.pdfDocument&&(this.pdfViewer.currentPageNumber=l)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(l){this.pdfDocument&&(this.pdfViewer.pagesRotation=l)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}async goToDestination(l){if(!this.pdfDocument)return;let t,d,n;if(typeof l=="string"?(t=l,d=await this.pdfDocument.getDestination(l)):(t=null,d=await l),!Array.isArray(d)){console.error(`goToDestination: "${d}" is not a valid destination array, for dest="${l}".`);return}const[a]=d;if(a&&typeof a=="object"){if(n=this.pdfDocument.cachedPageNumber(a),!n)try{n=await this.pdfDocument.getPageIndex(a)+1}catch{console.error(`goToDestination: "${a}" is not a valid page reference, for dest="${l}".`);return}}else Number.isInteger(a)&&(n=a+1);if(!n||n<1||n>this.pagesCount){console.error(`goToDestination: "${n}" is not a valid page number, for dest="${l}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:d,pageNumber:n})),this.pdfViewer.scrollPageIntoView({pageNumber:n,destArray:d,ignoreDestinationZoom:this._ignoreDestinationZoom})}goToPage(l){if(!this.pdfDocument)return;const t=typeof l=="string"&&this.pdfViewer.pageLabelToPageNumber(l)||l|0;if(!(Number.isInteger(t)&&t>0&&t<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${l}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})}addLinkAttributes(l,t,d=!1){if(!t||typeof t!="string")throw new Error('A valid "url" parameter must provided.');const n=d?wi.BLANK:this.externalLinkTarget,a=this.externalLinkRel;this.externalLinkEnabled?l.href=l.title=t:(l.href="",l.title=`Disabled: ${t}`,l.onclick=()=>!1);let i="";switch(n){case wi.NONE:break;case wi.SELF:i="_self";break;case wi.BLANK:i="_blank";break;case wi.PARENT:i="_parent";break;case wi.TOP:i="_top";break}l.target=i,l.rel=typeof a=="string"?a:Yw}getDestinationHash(l){if(typeof l=="string"){if(l.length>0)return this.getAnchorUrl("#"+escape(l))}else if(Array.isArray(l)){const t=JSON.stringify(l);if(t.length>0)return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(l){return this.baseUrl?this.baseUrl+l:l}setHash(l){var t;if(!this.pdfDocument)return;let d,n;if(l.includes("=")){const a=xV(l);if(a.has("search")){const i=a.get("search").replaceAll('"',""),s=a.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:s?i:i.match(/\S+/g)})}if(a.has("page")&&(d=a.get("page")|0||1),a.has("zoom")){const i=a.get("zoom").split(","),s=i[0],c=parseFloat(s);s.includes("Fit")?s==="Fit"||s==="FitB"?n=[null,{name:s}]:s==="FitH"||s==="FitBH"||s==="FitV"||s==="FitBV"?n=[null,{name:s},i.length>1?i[1]|0:null]:s==="FitR"?i.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):n=[null,{name:s},i[1]|0,i[2]|0,i[3]|0,i[4]|0]:console.error(`PDFLinkService.setHash: "${s}" is not a valid zoom value.`):n=[null,{name:"XYZ"},i.length>1?i[1]|0:null,i.length>2?i[2]|0:null,c?c/100:s]}n?this.pdfViewer.scrollPageIntoView({pageNumber:d||this.page,destArray:n,allowNegativeOffset:!0}):d&&(this.page=d),a.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:a.get("pagemode")}),a.has("nameddest")&&this.goToDestination(a.get("nameddest"));return}n=unescape(l);try{n=JSON.parse(n),Array.isArray(n)||(n=n.toString())}catch{}if(typeof n=="string"||p(t=BX,dr,oJ).call(t,n)){this.goToDestination(n);return}console.error(`PDFLinkService.setHash: "${unescape(l)}" is not a valid destination.`)}executeNamedAction(l){var t,d;if(this.pdfDocument){switch(l){case"GoBack":(t=this.pdfHistory)==null||t.back();break;case"GoForward":(d=this.pdfHistory)==null||d.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:l})}}async executeSetOCGState(l){if(!this.pdfDocument)return;const t=this.pdfDocument,d=await this.pdfViewer.optionalContentConfigPromise;t===this.pdfDocument&&(d.setOCGState(l),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(d))}};dr=new WeakSet,oJ=function(e){if(!Array.isArray(e)||e.length<2)return!1;const[l,t,...d]=e;if(!(typeof l=="object"&&Number.isInteger(l==null?void 0:l.num)&&Number.isInteger(l==null?void 0:l.gen))&&!Number.isInteger(l)||!(typeof t=="object"&&typeof(t==null?void 0:t.name)=="string"))return!1;const n=d.length;let a=!0;switch(t.name){case"XYZ":if(n<2||n>3)return!1;break;case"Fit":case"FitB":return n===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(n>1)return!1;break;case"FitR":if(n!==4)return!1;a=!1;break;default:return!1}for(const i of d)if(!(typeof i=="number"||a&&i===null))return!1;return!0},M(hJ,dr);let VJ=hJ;class nr extends VJ{setDocument(l,t=null){}}const{AbortException:kw,AnnotationEditorLayer:zw,AnnotationEditorParamsType:Vg,AnnotationEditorType:Ge,AnnotationEditorUIManager:Lw,AnnotationLayer:Iw,AnnotationMode:bn,build:Wg,ColorPicker:Qg,createValidAbsoluteUrl:Dw,DOMSVGFactory:mg,DrawLayer:ww,FeatureTest:Ng,fetchData:WJ,getDocument:Rg,getFilenameFromUrl:rg,getPdfFilenameFromUrl:Ew,getXfaPageViewport:bg,GlobalWorkerOptions:ug,ImageKind:pg,InvalidPDFException:Mg,isDataScheme:Sg,isPdfFile:Cw,MissingPDFException:Tg,noContextMenu:Jg,normalizeUnicode:xw,OPS:Gg,OutputScale:gw,PasswordResponses:yg,PDFDataRangeTransport:Xg,PDFDateString:Bg,PDFWorker:Yg,PermissionFlag:KV,PixelsPerInch:un,RenderingCancelledException:ar,setLayerDimensions:jw,shadow:HV,stopEvent:ir,TextLayer:Ow,TouchManager:kg,UnexpectedResponseException:zg,Util:Lg,VerbosityLevel:Ig,version:QJ,XfaLayer:sr}=globalThis.pdfjsLib;var PV,Ei,AV,cr;class mJ{constructor({pdfPage:l,linkService:t,downloadManager:d,annotationStorage:n=null,imageResourcesPath:a="",renderForms:i=!0,enableScripting:s=!1,hasJSActionsPromise:c=null,fieldObjectsPromise:F=null,annotationCanvasMap:o=null,accessibilityManager:h=null,annotationEditorUIManager:V=null,onAppend:W=null}){M(this,AV),M(this,PV,null),M(this,Ei,null),this.pdfPage=l,this.linkService=t,this.downloadManager=d,this.imageResourcesPath=a,this.renderForms=i,this.annotationStorage=n,this.enableScripting=s,this._hasJSActionsPromise=c||Promise.resolve(!1),this._fieldObjectsPromise=F||Promise.resolve(null),this._annotationCanvasMap=o,this._accessibilityManager=h,this._annotationEditorUIManager=V,R(this,PV,W),this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=t.eventBus}async render(l,t,d="display"){var n,a;if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:l.clone({dontFlip:!0})});return}const[i,s,c]=await Promise.all([this.pdfPage.getAnnotations({intent:d}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const F=this.div=document.createElement("div");if(F.className="annotationLayer",(n=Z(this,PV))==null||n.call(this,F),i.length===0){this.hide();return}this.annotationLayer=new Iw({div:F,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:l.clone({dontFlip:!0}),structTreeLayer:(t==null?void 0:t.structTreeLayer)||null}),await this.annotationLayer.render({annotations:i,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:s,fieldObjects:c}),this.linkService.isInPresentationMode&&p(this,AV,cr).call(this,jc.FULLSCREEN),Z(this,Ei)||(R(this,Ei,new AbortController),(a=this._eventBus)==null||a._on("presentationmodechanged",o=>{p(this,AV,cr).call(this,o.state)},{signal:Z(this,Ei).signal}))}cancel(){var l;this._cancelled=!0,(l=Z(this,Ei))==null||l.abort(),R(this,Ei,null)}hide(){this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){var l;return!!((l=this.annotationLayer)!=null&&l.hasEditableAnnotations())}}PV=new WeakMap,Ei=new WeakMap,AV=new WeakSet,cr=function(e){if(!this.div)return;let l=!1;switch(e){case jc.FULLSCREEN:l=!0;break;case jc.NORMAL:break;default:return}for(const t of this.div.childNodes)t.hasAttribute("data-internal-link")||(t.inert=l)};function NJ(e,l){const t=document.createElement("a");if(!t.click)throw new Error('DownloadManager: "a.click()" is not supported.');t.href=e,t.target="_parent","download"in t&&(t.download=l),(document.body||document.documentElement).append(t),t.click(),t.remove()}var RJ;class vw{constructor(){M(this,RJ,new WeakMap)}downloadData(l,t,d){const n=URL.createObjectURL(new Blob([l],{type:d}));NJ(n,t)}openOrDownloadData(l,t,d=null){const n=Cw(t)?"application/pdf":"";return this.downloadData(l,t,n),!1}download(l,t,d){let n;if(l)n=URL.createObjectURL(new Blob([l],{type:"application/pdf"}));else{if(!Dw(t,"http://example.com")){console.error(`download - not a valid URL: ${t}`);return}n=t+"#pdfjs.action=download"}NJ(n,d)}}RJ=new WeakMap;const rJ={EVENT:"event",TIMEOUT:"timeout"};async function fw({target:e,name:l,delay:t=0}){if(typeof e!="object"||!(Number.isInteger(t)&&t>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:d,resolve:n}=Promise.withResolvers(),a=new AbortController;function i(F){a.abort(),clearTimeout(c),n(F)}const s=e instanceof bJ?"_on":"addEventListener";e[s](l,i.bind(null,rJ.EVENT),{signal:a.signal});const c=setTimeout(i.bind(null,rJ.TIMEOUT),t);return d}var _F;class bJ{constructor(){M(this,_F,Object.create(null))}on(l,t,d=null){this._on(l,t,{external:!0,once:d==null?void 0:d.once,signal:d==null?void 0:d.signal})}off(l,t,d=null){this._off(l,t)}dispatch(l,t){const d=Z(this,_F)[l];if(!d||d.length===0)return;let n;for(const{listener:a,external:i,once:s}of d.slice(0)){if(s&&this._off(l,a),i){(n||(n=[])).push(a);continue}a(t)}if(n){for(const a of n)a(t);n=null}}_on(l,t,d=null){var n;let a=null;if((d==null?void 0:d.signal)instanceof AbortSignal){const{signal:i}=d;if(i.aborted){console.error("Cannot use an `aborted` signal.");return}const s=()=>this._off(l,t);a=()=>i.removeEventListener("abort",s),i.addEventListener("abort",s)}((n=Z(this,_F))[l]||(n[l]=[])).push({listener:t,external:(d==null?void 0:d.external)===!0,once:(d==null?void 0:d.once)===!0,rmAbort:a})}_off(l,t,d=null){var n;const a=Z(this,_F)[l];if(a)for(let i=0,s=a.length;i<s;i++){const c=a[i];if(c.listener===t){(n=c.rmAbort)==null||n.call(c),a.splice(i,1);return}}}}_F=new WeakMap;class _V{constructor(l){this.value=l}valueOf(){return this.value}}class ot extends _V{constructor(l="???"){super(l)}toString(l){return`{${this.value}}`}}class pn extends _V{constructor(l,t={}){super(l),this.opts=t}toString(l){try{return l.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(t){return l.reportError(t),this.value.toString(10)}}}class qF extends _V{constructor(l,t={}){super(l),this.opts=t}toString(l){try{return l.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(t){return l.reportError(t),new Date(this.value).toISOString()}}}const uJ=100,Kw="",Hw="";function Pw(e,l,t){if(t===l||t instanceof pn&&l instanceof pn&&t.value===l.value)return!0;if(l instanceof pn&&typeof t=="string"){let d=e.memoizeIntlObject(Intl.PluralRules,l.opts).select(l.value);if(t===d)return!0}return!1}function pJ(e,l,t){return l[t]?Hc(e,l[t].value):(e.reportError(new RangeError("No default")),new ot)}function Ur(e,l){const t=[],d=Object.create(null);for(const n of l)n.type==="narg"?d[n.name]=$F(e,n.value):t.push($F(e,n));return{positional:t,named:d}}function $F(e,l){switch(l.type){case"str":return l.value;case"num":return new pn(l.value,{minimumFractionDigits:l.precision});case"var":return Aw(e,l);case"mesg":return _w(e,l);case"term":return qw(e,l);case"func":return $w(e,l);case"select":return lE(e,l);default:return new ot}}function Aw(e,{name:l}){let t;if(e.params)if(Object.prototype.hasOwnProperty.call(e.params,l))t=e.params[l];else return new ot(`$${l}`);else if(e.args&&Object.prototype.hasOwnProperty.call(e.args,l))t=e.args[l];else return e.reportError(new ReferenceError(`Unknown variable: $${l}`)),new ot(`$${l}`);if(t instanceof _V)return t;switch(typeof t){case"string":return t;case"number":return new pn(t);case"object":if(t instanceof Date)return new qF(t.getTime());default:return e.reportError(new TypeError(`Variable type not supported: $${l}, ${typeof t}`)),new ot(`$${l}`)}}function _w(e,{name:l,attr:t}){const d=e.bundle._messages.get(l);if(!d)return e.reportError(new ReferenceError(`Unknown message: ${l}`)),new ot(l);if(t){const n=d.attributes[t];return n?Hc(e,n):(e.reportError(new ReferenceError(`Unknown attribute: ${t}`)),new ot(`${l}.${t}`))}return d.value?Hc(e,d.value):(e.reportError(new ReferenceError(`No value: ${l}`)),new ot(l))}function qw(e,{name:l,attr:t,args:d}){const n=`-${l}`,a=e.bundle._terms.get(n);if(!a)return e.reportError(new ReferenceError(`Unknown term: ${n}`)),new ot(n);if(t){const s=a.attributes[t];if(s){e.params=Ur(e,d).named;const c=Hc(e,s);return e.params=null,c}return e.reportError(new ReferenceError(`Unknown attribute: ${t}`)),new ot(`${n}.${t}`)}e.params=Ur(e,d).named;const i=Hc(e,a.value);return e.params=null,i}function $w(e,{name:l,args:t}){let d=e.bundle._functions[l];if(!d)return e.reportError(new ReferenceError(`Unknown function: ${l}()`)),new ot(`${l}()`);if(typeof d!="function")return e.reportError(new TypeError(`Function ${l}() is not callable`)),new ot(`${l}()`);try{let n=Ur(e,t);return d(n.positional,n.named)}catch(n){return e.reportError(n),new ot(`${l}()`)}}function lE(e,{selector:l,variants:t,star:d}){let n=$F(e,l);if(n instanceof ot)return pJ(e,t,d);for(const a of t){const i=$F(e,a.key);if(Pw(e,n,i))return Hc(e,a.value)}return pJ(e,t,d)}function MJ(e,l){if(e.dirty.has(l))return e.reportError(new RangeError("Cyclic reference")),new ot;e.dirty.add(l);const t=[],d=e.bundle._useIsolating&&l.length>1;for(const n of l){if(typeof n=="string"){t.push(e.bundle._transform(n));continue}if(e.placeables++,e.placeables>uJ)throw e.dirty.delete(l),new RangeError(`Too many placeables expanded: ${e.placeables}, max allowed is ${uJ}`);d&&t.push(Kw),t.push($F(e,n).toString(e)),d&&t.push(Hw)}return e.dirty.delete(l),t.join("")}function Hc(e,l){return typeof l=="string"?e.bundle._transform(l):MJ(e,l)}class tE{constructor(l,t,d){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=l,this.errors=t,this.args=d}reportError(l){if(!this.errors||!(l instanceof Error))throw l;this.errors.push(l)}memoizeIntlObject(l,t){let d=this.bundle._intls.get(l);d||(d={},this.bundle._intls.set(l,d));let n=JSON.stringify(t);return d[n]||(d[n]=new l(this.bundle.locales,t)),d[n]}}function qV(e,l){const t=Object.create(null);for(const[d,n]of Object.entries(e))l.includes(d)&&(t[d]=n.valueOf());return t}const SJ=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function eE(e,l){let t=e[0];if(t instanceof ot)return new ot(`NUMBER(${t.valueOf()})`);if(t instanceof pn)return new pn(t.valueOf(),{...t.opts,...qV(l,SJ)});if(t instanceof qF)return new pn(t.valueOf(),{...qV(l,SJ)});throw new TypeError("Invalid argument to NUMBER")}const TJ=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function dE(e,l){let t=e[0];if(t instanceof ot)return new ot(`DATETIME(${t.valueOf()})`);if(t instanceof qF)return new qF(t.valueOf(),{...t.opts,...qV(l,TJ)});if(t instanceof pn)return new qF(t.valueOf(),{...qV(l,TJ)});throw new TypeError("Invalid argument to DATETIME")}const JJ=new Map;function nE(e){const l=Array.isArray(e)?e.join(" "):e;let t=JJ.get(l);return t===void 0&&(t=new Map,JJ.set(l,t)),t}class aE{constructor(l,{functions:t,useIsolating:d=!0,transform:n=a=>a}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(l)?l:[l],this._functions={NUMBER:eE,DATETIME:dE,...t},this._useIsolating=d,this._transform=n,this._intls=nE(l)}hasMessage(l){return this._messages.has(l)}getMessage(l){return this._messages.get(l)}addResource(l,{allowOverrides:t=!1}={}){const d=[];for(let n=0;n<l.body.length;n++){let a=l.body[n];if(a.id.startsWith("-")){if(t===!1&&this._terms.has(a.id)){d.push(new Error(`Attempt to override an existing term: "${a.id}"`));continue}this._terms.set(a.id,a)}else{if(t===!1&&this._messages.has(a.id)){d.push(new Error(`Attempt to override an existing message: "${a.id}"`));continue}this._messages.set(a.id,a)}}return d}formatPattern(l,t=null,d=null){if(typeof l=="string")return this._transform(l);let n=new tE(this,d,t);try{return MJ(n,l).toString(n)}catch(a){if(n.errors&&a instanceof Error)return n.errors.push(a),new ot().toString(n);throw a}}}const Zr=/^(-?[a-zA-Z][\w-]*) *= */gm,GJ=/\.([a-zA-Z][\w-]*) *= */y,iE=/\*?\[/y,Fr=/(-?[0-9]+(?:\.([0-9]+))?)/y,sE=/([a-zA-Z][\w-]*)/y,yJ=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,cE=/^[A-Z][A-Z0-9_-]*$/,$V=/([^{}\n\r]+)/y,UE=/([^\\"\n\r]*)/y,XJ=/\\([\\"])/y,BJ=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,ZE=/^\n+/,YJ=/ +$/,FE=/ *\r?\n/g,oE=/( *)$/,hE=/{\s*/y,kJ=/\s*}/y,VE=/\[\s*/y,WE=/\s*] */y,QE=/\s*\(\s*/y,mE=/\s*->\s*/y,NE=/\s*:\s*/y,RE=/\s*,?\s*/y,rE=/\s+/y;class bE{constructor(l){this.body=[],Zr.lastIndex=0;let t=0;for(;;){let y=Zr.exec(l);if(y===null)break;t=Zr.lastIndex;try{this.body.push(c(y[1]))}catch(z){if(z instanceof SyntaxError)continue;throw z}}function d(y){return y.lastIndex=t,y.test(l)}function n(y,z){if(l[t]===y)return t++,!0;if(z)throw new z(`Expected ${y}`);return!1}function a(y,z){if(d(y))return t=y.lastIndex,!0;if(z)throw new z(`Expected ${y.toString()}`);return!1}function i(y){y.lastIndex=t;let z=y.exec(l);if(z===null)throw new SyntaxError(`Expected ${y.toString()}`);return t=y.lastIndex,z}function s(y){return i(y)[1]}function c(y){let z=o(),I=F();if(z===null&&Object.keys(I).length===0)throw new SyntaxError("Expected message value or attributes");return{id:y,value:z,attributes:I}}function F(){let y=Object.create(null);for(;d(GJ);){let z=s(GJ),I=o();if(I===null)throw new SyntaxError("Expected attribute value");y[z]=I}return y}function o(){let y;if(d($V)&&(y=s($V)),l[t]==="{"||l[t]==="}")return h(y?[y]:[],1/0);let z=J();return z?y?h([y,z],z.length):(z.value=Y(z.value,ZE),h([z],z.length)):y?Y(y,YJ):null}function h(y=[],z){for(;;){if(d($V)){y.push(s($V));continue}if(l[t]==="{"){y.push(V());continue}if(l[t]==="}")throw new SyntaxError("Unbalanced closing brace");let j=J();if(j){y.push(j),z=Math.min(z,j.length);continue}break}let I=y.length-1,O=y[I];typeof O=="string"&&(y[I]=Y(O,YJ));let E=[];for(let j of y)j instanceof zJ&&(j=j.value.slice(0,j.value.length-z)),j&&E.push(j);return E}function V(){a(hE,SyntaxError);let y=W();if(a(kJ))return y;if(a(mE)){let z=N();return a(kJ,SyntaxError),{type:"select",selector:y,...z}}throw new SyntaxError("Unclosed placeable")}function W(){if(l[t]==="{")return V();if(d(yJ)){let[,y,z,I=null]=i(yJ);if(y==="$")return{type:"var",name:z};if(a(QE)){let O=Q();if(y==="-")return{type:"term",name:z,attr:I,args:O};if(cE.test(z))return{type:"func",name:z,args:O};throw new SyntaxError("Function names must be all upper-case")}return y==="-"?{type:"term",name:z,attr:I,args:[]}:{type:"mesg",name:z,attr:I}}return r()}function Q(){let y=[];for(;;){switch(l[t]){case")":return t++,y;case void 0:throw new SyntaxError("Unclosed argument list")}y.push(m()),a(RE)}}function m(){let y=W();return y.type!=="mesg"?y:a(NE)?{type:"narg",name:y.name,value:r()}:y}function N(){let y=[],z=0,I;for(;d(iE);){n("*")&&(I=z);let O=b(),E=o();if(E===null)throw new SyntaxError("Expected variant value");y[z++]={key:O,value:E}}if(z===0)return null;if(I===void 0)throw new SyntaxError("Expected default variant");return{variants:y,star:I}}function b(){a(VE,SyntaxError);let y;return d(Fr)?y=u():y={type:"str",value:s(sE)},a(WE,SyntaxError),y}function r(){if(d(Fr))return u();if(l[t]==='"')return S();throw new SyntaxError("Invalid expression")}function u(){let[,y,z=""]=i(Fr),I=z.length;return{type:"num",value:parseFloat(y),precision:I}}function S(){n('"',SyntaxError);let y="";for(;;){if(y+=s(UE),l[t]==="\\"){y+=G();continue}if(n('"'))return{type:"str",value:y};throw new SyntaxError("Unclosed string literal")}}function G(){if(d(XJ))return s(XJ);if(d(BJ)){let[,y,z]=i(BJ),I=parseInt(y||z,16);return I<=55295||57344<=I?String.fromCodePoint(I):"�"}throw new SyntaxError("Unknown escape sequence")}function J(){let y=t;switch(a(rE),l[t]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return L(l.slice(y,t))}return l[t-1]===" "?L(l.slice(y,t)):!1}function Y(y,z){return y.replace(z,"")}function L(y){let z=y.replace(FE,`
|
|
64
|
+
`);[this._pageContents[t],this._pageDiffs[t],this._hasDiacritics[t]]=PR(s.join("")),a()},i=>{console.error(`Unable to get text content for page ${t+1}`,i),this._pageContents[t]="",this._pageDiffs[t]=null,this._hasDiacritics[t]=!1,a()}))}},vV=function(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})},PF=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},Kc=function(){const e=Z(this,It).findPrevious,l=this._linkService.page-1,t=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=l,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,R(this,fc,0),this._matchesCountTotal=0,p(this,bl,PF).call(this);for(let n=0;n<t;n++)this._pendingFindMatches.has(n)||(this._pendingFindMatches.add(n),this._extractTextPromises[n].then(()=>{this._pendingFindMatches.delete(n),p(this,bl,cJ).call(this,n)}))}if(Z(this,bl,_R).length===0){p(this,bl,AF).call(this,ua.FOUND);return}if(this._resumePageIdx)return;const d=this._offset;if(this._pagesToSearch=t,d.matchIdx!==null){const n=this._pageMatches[d.pageIdx].length;if(!e&&d.matchIdx+1<n||e&&d.matchIdx>0){d.matchIdx=e?d.matchIdx-1:d.matchIdx+1,p(this,bl,fV).call(this,!0);return}p(this,bl,lr).call(this,e)}p(this,bl,$R).call(this)},ZJ=function(e){const l=this._offset,t=e.length,d=Z(this,It).findPrevious;return t?(l.matchIdx=d?t-1:0,p(this,bl,fV).call(this,!0),!0):(p(this,bl,lr).call(this,d),l.wrapped&&(l.matchIdx=null,this._pagesToSearch<0)?(p(this,bl,fV).call(this,!1),!0):!1)},$R=function(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let e=null;do{const l=this._offset.pageIdx;if(e=this._pageMatches[l],!e){this._resumePageIdx=l;break}}while(!p(this,bl,ZJ).call(this,e))},lr=function(e){const l=this._offset,t=this._linkService.pagesCount;l.pageIdx=e?l.pageIdx-1:l.pageIdx+1,l.matchIdx=null,this._pagesToSearch--,(l.pageIdx>=t||l.pageIdx<0)&&(l.pageIdx=e?t-1:0,l.wrapped=!0)},fV=function(e=!1){let l=ua.NOT_FOUND;const t=this._offset.wrapped;if(this._offset.wrapped=!1,e){const d=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,l=t?ua.WRAPPED:ua.FOUND,d!==-1&&d!==this._selected.pageIdx&&p(this,bl,vV).call(this,d)}p(this,bl,AF).call(this,l,Z(this,It).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,p(this,bl,vV).call(this,this._selected.pageIdx))},FJ=function(e){const l=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||l&&this._pdfDocument!==l||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),p(this,bl,AF).call(this,ua.FOUND),this._highlightMatches=!1,p(this,bl,PF).call(this))})},tr=function(){var e;const{pageIdx:l,matchIdx:t}=this._selected;let d=0,n=this._matchesCountTotal;if(t!==-1){for(let a=0;a<l;a++)d+=((e=this._pageMatches[a])==null?void 0:e.length)||0;d+=t+1}return(d<1||d>n)&&(d=n=0),{current:d,total:n}},er=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:p(this,bl,tr).call(this)})},AF=function(e,l=!1){var t,d;!Z(this,HF)&&(Z(this,fc)!==this._linkService.pagesCount||e===ua.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:l,entireWord:((t=Z(this,It))==null?void 0:t.entireWord)??null,matchesCount:p(this,bl,tr).call(this),rawQuery:((d=Z(this,It))==null?void 0:d.query)??null})};const Yw="noopener noreferrer nofollow",wi={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};var dr,oJ;const hJ=class BX{constructor({eventBus:l,externalLinkTarget:t=null,externalLinkRel:d=null,ignoreDestinationZoom:n=!1}={}){Vl(this,"externalLinkEnabled",!0),this.eventBus=l,this.externalLinkTarget=t,this.externalLinkRel=d,this._ignoreDestinationZoom=n,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(l,t=null){this.baseUrl=t,this.pdfDocument=l}setViewer(l){this.pdfViewer=l}setHistory(l){this.pdfHistory=l}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(l){this.pdfDocument&&(this.pdfViewer.currentPageNumber=l)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(l){this.pdfDocument&&(this.pdfViewer.pagesRotation=l)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}async goToDestination(l){if(!this.pdfDocument)return;let t,d,n;if(typeof l=="string"?(t=l,d=await this.pdfDocument.getDestination(l)):(t=null,d=await l),!Array.isArray(d)){console.error(`goToDestination: "${d}" is not a valid destination array, for dest="${l}".`);return}const[a]=d;if(a&&typeof a=="object"){if(n=this.pdfDocument.cachedPageNumber(a),!n)try{n=await this.pdfDocument.getPageIndex(a)+1}catch{console.error(`goToDestination: "${a}" is not a valid page reference, for dest="${l}".`);return}}else Number.isInteger(a)&&(n=a+1);if(!n||n<1||n>this.pagesCount){console.error(`goToDestination: "${n}" is not a valid page number, for dest="${l}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:d,pageNumber:n})),this.pdfViewer.scrollPageIntoView({pageNumber:n,destArray:d,ignoreDestinationZoom:this._ignoreDestinationZoom})}goToPage(l){if(!this.pdfDocument)return;const t=typeof l=="string"&&this.pdfViewer.pageLabelToPageNumber(l)||l|0;if(!(Number.isInteger(t)&&t>0&&t<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${l}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})}addLinkAttributes(l,t,d=!1){if(!t||typeof t!="string")throw new Error('A valid "url" parameter must provided.');const n=d?wi.BLANK:this.externalLinkTarget,a=this.externalLinkRel;this.externalLinkEnabled?l.href=l.title=t:(l.href="",l.title=`Disabled: ${t}`,l.onclick=()=>!1);let i="";switch(n){case wi.NONE:break;case wi.SELF:i="_self";break;case wi.BLANK:i="_blank";break;case wi.PARENT:i="_parent";break;case wi.TOP:i="_top";break}l.target=i,l.rel=typeof a=="string"?a:Yw}getDestinationHash(l){if(typeof l=="string"){if(l.length>0)return this.getAnchorUrl("#"+escape(l))}else if(Array.isArray(l)){const t=JSON.stringify(l);if(t.length>0)return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(l){return this.baseUrl?this.baseUrl+l:l}setHash(l){var t;if(!this.pdfDocument)return;let d,n;if(l.includes("=")){const a=xV(l);if(a.has("search")){const i=a.get("search").replaceAll('"',""),s=a.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:s?i:i.match(/\S+/g)})}if(a.has("page")&&(d=a.get("page")|0||1),a.has("zoom")){const i=a.get("zoom").split(","),s=i[0],c=parseFloat(s);s.includes("Fit")?s==="Fit"||s==="FitB"?n=[null,{name:s}]:s==="FitH"||s==="FitBH"||s==="FitV"||s==="FitBV"?n=[null,{name:s},i.length>1?i[1]|0:null]:s==="FitR"?i.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):n=[null,{name:s},i[1]|0,i[2]|0,i[3]|0,i[4]|0]:console.error(`PDFLinkService.setHash: "${s}" is not a valid zoom value.`):n=[null,{name:"XYZ"},i.length>1?i[1]|0:null,i.length>2?i[2]|0:null,c?c/100:s]}n?this.pdfViewer.scrollPageIntoView({pageNumber:d||this.page,destArray:n,allowNegativeOffset:!0}):d&&(this.page=d),a.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:a.get("pagemode")}),a.has("nameddest")&&this.goToDestination(a.get("nameddest"));return}n=unescape(l);try{n=JSON.parse(n),Array.isArray(n)||(n=n.toString())}catch{}if(typeof n=="string"||p(t=BX,dr,oJ).call(t,n)){this.goToDestination(n);return}console.error(`PDFLinkService.setHash: "${unescape(l)}" is not a valid destination.`)}executeNamedAction(l){var t,d;if(this.pdfDocument){switch(l){case"GoBack":(t=this.pdfHistory)==null||t.back();break;case"GoForward":(d=this.pdfHistory)==null||d.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:l})}}async executeSetOCGState(l){if(!this.pdfDocument)return;const t=this.pdfDocument,d=await this.pdfViewer.optionalContentConfigPromise;t===this.pdfDocument&&(d.setOCGState(l),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(d))}};dr=new WeakSet,oJ=function(e){if(!Array.isArray(e)||e.length<2)return!1;const[l,t,...d]=e;if(!(typeof l=="object"&&Number.isInteger(l==null?void 0:l.num)&&Number.isInteger(l==null?void 0:l.gen))&&!Number.isInteger(l)||!(typeof t=="object"&&typeof(t==null?void 0:t.name)=="string"))return!1;const n=d.length;let a=!0;switch(t.name){case"XYZ":if(n<2||n>3)return!1;break;case"Fit":case"FitB":return n===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(n>1)return!1;break;case"FitR":if(n!==4)return!1;a=!1;break;default:return!1}for(const i of d)if(!(typeof i=="number"||a&&i===null))return!1;return!0},M(hJ,dr);let VJ=hJ;class nr extends VJ{setDocument(l,t=null){}}const{AbortException:kw,AnnotationEditorLayer:zw,AnnotationEditorParamsType:mg,AnnotationEditorType:Ge,AnnotationEditorUIManager:Lw,AnnotationLayer:Iw,AnnotationMode:bn,build:Ng,ColorPicker:Rg,createValidAbsoluteUrl:Dw,DOMSVGFactory:rg,DrawLayer:ww,FeatureTest:bg,fetchData:WJ,getDocument:ug,getFilenameFromUrl:pg,getPdfFilenameFromUrl:Ew,getXfaPageViewport:Mg,GlobalWorkerOptions:Sg,ImageKind:Tg,InvalidPDFException:Jg,isDataScheme:Gg,isPdfFile:Cw,MissingPDFException:yg,noContextMenu:Xg,normalizeUnicode:xw,OPS:Bg,OutputScale:gw,PasswordResponses:Yg,PDFDataRangeTransport:kg,PDFDateString:zg,PDFWorker:Lg,PermissionFlag:KV,PixelsPerInch:un,RenderingCancelledException:ar,setLayerDimensions:jw,shadow:HV,stopEvent:ir,TextLayer:Ow,TouchManager:Ig,UnexpectedResponseException:Dg,Util:wg,VerbosityLevel:Eg,version:QJ,XfaLayer:sr}=globalThis.pdfjsLib;var PV,Ei,AV,cr;class mJ{constructor({pdfPage:l,linkService:t,downloadManager:d,annotationStorage:n=null,imageResourcesPath:a="",renderForms:i=!0,enableScripting:s=!1,hasJSActionsPromise:c=null,fieldObjectsPromise:F=null,annotationCanvasMap:o=null,accessibilityManager:h=null,annotationEditorUIManager:V=null,onAppend:W=null}){M(this,AV),M(this,PV,null),M(this,Ei,null),this.pdfPage=l,this.linkService=t,this.downloadManager=d,this.imageResourcesPath=a,this.renderForms=i,this.annotationStorage=n,this.enableScripting=s,this._hasJSActionsPromise=c||Promise.resolve(!1),this._fieldObjectsPromise=F||Promise.resolve(null),this._annotationCanvasMap=o,this._accessibilityManager=h,this._annotationEditorUIManager=V,R(this,PV,W),this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=t.eventBus}async render(l,t,d="display"){var n,a;if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:l.clone({dontFlip:!0})});return}const[i,s,c]=await Promise.all([this.pdfPage.getAnnotations({intent:d}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const F=this.div=document.createElement("div");if(F.className="annotationLayer",(n=Z(this,PV))==null||n.call(this,F),i.length===0){this.hide();return}this.annotationLayer=new Iw({div:F,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:l.clone({dontFlip:!0}),structTreeLayer:(t==null?void 0:t.structTreeLayer)||null}),await this.annotationLayer.render({annotations:i,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:s,fieldObjects:c}),this.linkService.isInPresentationMode&&p(this,AV,cr).call(this,jc.FULLSCREEN),Z(this,Ei)||(R(this,Ei,new AbortController),(a=this._eventBus)==null||a._on("presentationmodechanged",o=>{p(this,AV,cr).call(this,o.state)},{signal:Z(this,Ei).signal}))}cancel(){var l;this._cancelled=!0,(l=Z(this,Ei))==null||l.abort(),R(this,Ei,null)}hide(){this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){var l;return!!((l=this.annotationLayer)!=null&&l.hasEditableAnnotations())}}PV=new WeakMap,Ei=new WeakMap,AV=new WeakSet,cr=function(e){if(!this.div)return;let l=!1;switch(e){case jc.FULLSCREEN:l=!0;break;case jc.NORMAL:break;default:return}for(const t of this.div.childNodes)t.hasAttribute("data-internal-link")||(t.inert=l)};function NJ(e,l){const t=document.createElement("a");if(!t.click)throw new Error('DownloadManager: "a.click()" is not supported.');t.href=e,t.target="_parent","download"in t&&(t.download=l),(document.body||document.documentElement).append(t),t.click(),t.remove()}var RJ;class vw{constructor(){M(this,RJ,new WeakMap)}downloadData(l,t,d){const n=URL.createObjectURL(new Blob([l],{type:d}));NJ(n,t)}openOrDownloadData(l,t,d=null){const n=Cw(t)?"application/pdf":"";return this.downloadData(l,t,n),!1}download(l,t,d){let n;if(l)n=URL.createObjectURL(new Blob([l],{type:"application/pdf"}));else{if(!Dw(t,"http://example.com")){console.error(`download - not a valid URL: ${t}`);return}n=t+"#pdfjs.action=download"}NJ(n,d)}}RJ=new WeakMap;const rJ={EVENT:"event",TIMEOUT:"timeout"};async function fw({target:e,name:l,delay:t=0}){if(typeof e!="object"||!(Number.isInteger(t)&&t>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:d,resolve:n}=Promise.withResolvers(),a=new AbortController;function i(F){a.abort(),clearTimeout(c),n(F)}const s=e instanceof bJ?"_on":"addEventListener";e[s](l,i.bind(null,rJ.EVENT),{signal:a.signal});const c=setTimeout(i.bind(null,rJ.TIMEOUT),t);return d}var _F;class bJ{constructor(){M(this,_F,Object.create(null))}on(l,t,d=null){this._on(l,t,{external:!0,once:d==null?void 0:d.once,signal:d==null?void 0:d.signal})}off(l,t,d=null){this._off(l,t)}dispatch(l,t){const d=Z(this,_F)[l];if(!d||d.length===0)return;let n;for(const{listener:a,external:i,once:s}of d.slice(0)){if(s&&this._off(l,a),i){(n||(n=[])).push(a);continue}a(t)}if(n){for(const a of n)a(t);n=null}}_on(l,t,d=null){var n;let a=null;if((d==null?void 0:d.signal)instanceof AbortSignal){const{signal:i}=d;if(i.aborted){console.error("Cannot use an `aborted` signal.");return}const s=()=>this._off(l,t);a=()=>i.removeEventListener("abort",s),i.addEventListener("abort",s)}((n=Z(this,_F))[l]||(n[l]=[])).push({listener:t,external:(d==null?void 0:d.external)===!0,once:(d==null?void 0:d.once)===!0,rmAbort:a})}_off(l,t,d=null){var n;const a=Z(this,_F)[l];if(a)for(let i=0,s=a.length;i<s;i++){const c=a[i];if(c.listener===t){(n=c.rmAbort)==null||n.call(c),a.splice(i,1);return}}}}_F=new WeakMap;class _V{constructor(l){this.value=l}valueOf(){return this.value}}class ot extends _V{constructor(l="???"){super(l)}toString(l){return`{${this.value}}`}}class pn extends _V{constructor(l,t={}){super(l),this.opts=t}toString(l){try{return l.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(t){return l.reportError(t),this.value.toString(10)}}}class qF extends _V{constructor(l,t={}){super(l),this.opts=t}toString(l){try{return l.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(t){return l.reportError(t),new Date(this.value).toISOString()}}}const uJ=100,Kw="",Hw="";function Pw(e,l,t){if(t===l||t instanceof pn&&l instanceof pn&&t.value===l.value)return!0;if(l instanceof pn&&typeof t=="string"){let d=e.memoizeIntlObject(Intl.PluralRules,l.opts).select(l.value);if(t===d)return!0}return!1}function pJ(e,l,t){return l[t]?Hc(e,l[t].value):(e.reportError(new RangeError("No default")),new ot)}function Ur(e,l){const t=[],d=Object.create(null);for(const n of l)n.type==="narg"?d[n.name]=$F(e,n.value):t.push($F(e,n));return{positional:t,named:d}}function $F(e,l){switch(l.type){case"str":return l.value;case"num":return new pn(l.value,{minimumFractionDigits:l.precision});case"var":return Aw(e,l);case"mesg":return _w(e,l);case"term":return qw(e,l);case"func":return $w(e,l);case"select":return lE(e,l);default:return new ot}}function Aw(e,{name:l}){let t;if(e.params)if(Object.prototype.hasOwnProperty.call(e.params,l))t=e.params[l];else return new ot(`$${l}`);else if(e.args&&Object.prototype.hasOwnProperty.call(e.args,l))t=e.args[l];else return e.reportError(new ReferenceError(`Unknown variable: $${l}`)),new ot(`$${l}`);if(t instanceof _V)return t;switch(typeof t){case"string":return t;case"number":return new pn(t);case"object":if(t instanceof Date)return new qF(t.getTime());default:return e.reportError(new TypeError(`Variable type not supported: $${l}, ${typeof t}`)),new ot(`$${l}`)}}function _w(e,{name:l,attr:t}){const d=e.bundle._messages.get(l);if(!d)return e.reportError(new ReferenceError(`Unknown message: ${l}`)),new ot(l);if(t){const n=d.attributes[t];return n?Hc(e,n):(e.reportError(new ReferenceError(`Unknown attribute: ${t}`)),new ot(`${l}.${t}`))}return d.value?Hc(e,d.value):(e.reportError(new ReferenceError(`No value: ${l}`)),new ot(l))}function qw(e,{name:l,attr:t,args:d}){const n=`-${l}`,a=e.bundle._terms.get(n);if(!a)return e.reportError(new ReferenceError(`Unknown term: ${n}`)),new ot(n);if(t){const s=a.attributes[t];if(s){e.params=Ur(e,d).named;const c=Hc(e,s);return e.params=null,c}return e.reportError(new ReferenceError(`Unknown attribute: ${t}`)),new ot(`${n}.${t}`)}e.params=Ur(e,d).named;const i=Hc(e,a.value);return e.params=null,i}function $w(e,{name:l,args:t}){let d=e.bundle._functions[l];if(!d)return e.reportError(new ReferenceError(`Unknown function: ${l}()`)),new ot(`${l}()`);if(typeof d!="function")return e.reportError(new TypeError(`Function ${l}() is not callable`)),new ot(`${l}()`);try{let n=Ur(e,t);return d(n.positional,n.named)}catch(n){return e.reportError(n),new ot(`${l}()`)}}function lE(e,{selector:l,variants:t,star:d}){let n=$F(e,l);if(n instanceof ot)return pJ(e,t,d);for(const a of t){const i=$F(e,a.key);if(Pw(e,n,i))return Hc(e,a.value)}return pJ(e,t,d)}function MJ(e,l){if(e.dirty.has(l))return e.reportError(new RangeError("Cyclic reference")),new ot;e.dirty.add(l);const t=[],d=e.bundle._useIsolating&&l.length>1;for(const n of l){if(typeof n=="string"){t.push(e.bundle._transform(n));continue}if(e.placeables++,e.placeables>uJ)throw e.dirty.delete(l),new RangeError(`Too many placeables expanded: ${e.placeables}, max allowed is ${uJ}`);d&&t.push(Kw),t.push($F(e,n).toString(e)),d&&t.push(Hw)}return e.dirty.delete(l),t.join("")}function Hc(e,l){return typeof l=="string"?e.bundle._transform(l):MJ(e,l)}class tE{constructor(l,t,d){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=l,this.errors=t,this.args=d}reportError(l){if(!this.errors||!(l instanceof Error))throw l;this.errors.push(l)}memoizeIntlObject(l,t){let d=this.bundle._intls.get(l);d||(d={},this.bundle._intls.set(l,d));let n=JSON.stringify(t);return d[n]||(d[n]=new l(this.bundle.locales,t)),d[n]}}function qV(e,l){const t=Object.create(null);for(const[d,n]of Object.entries(e))l.includes(d)&&(t[d]=n.valueOf());return t}const SJ=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function eE(e,l){let t=e[0];if(t instanceof ot)return new ot(`NUMBER(${t.valueOf()})`);if(t instanceof pn)return new pn(t.valueOf(),{...t.opts,...qV(l,SJ)});if(t instanceof qF)return new pn(t.valueOf(),{...qV(l,SJ)});throw new TypeError("Invalid argument to NUMBER")}const TJ=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function dE(e,l){let t=e[0];if(t instanceof ot)return new ot(`DATETIME(${t.valueOf()})`);if(t instanceof qF)return new qF(t.valueOf(),{...t.opts,...qV(l,TJ)});if(t instanceof pn)return new qF(t.valueOf(),{...qV(l,TJ)});throw new TypeError("Invalid argument to DATETIME")}const JJ=new Map;function nE(e){const l=Array.isArray(e)?e.join(" "):e;let t=JJ.get(l);return t===void 0&&(t=new Map,JJ.set(l,t)),t}class aE{constructor(l,{functions:t,useIsolating:d=!0,transform:n=a=>a}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(l)?l:[l],this._functions={NUMBER:eE,DATETIME:dE,...t},this._useIsolating=d,this._transform=n,this._intls=nE(l)}hasMessage(l){return this._messages.has(l)}getMessage(l){return this._messages.get(l)}addResource(l,{allowOverrides:t=!1}={}){const d=[];for(let n=0;n<l.body.length;n++){let a=l.body[n];if(a.id.startsWith("-")){if(t===!1&&this._terms.has(a.id)){d.push(new Error(`Attempt to override an existing term: "${a.id}"`));continue}this._terms.set(a.id,a)}else{if(t===!1&&this._messages.has(a.id)){d.push(new Error(`Attempt to override an existing message: "${a.id}"`));continue}this._messages.set(a.id,a)}}return d}formatPattern(l,t=null,d=null){if(typeof l=="string")return this._transform(l);let n=new tE(this,d,t);try{return MJ(n,l).toString(n)}catch(a){if(n.errors&&a instanceof Error)return n.errors.push(a),new ot().toString(n);throw a}}}const Zr=/^(-?[a-zA-Z][\w-]*) *= */gm,GJ=/\.([a-zA-Z][\w-]*) *= */y,iE=/\*?\[/y,Fr=/(-?[0-9]+(?:\.([0-9]+))?)/y,sE=/([a-zA-Z][\w-]*)/y,yJ=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,cE=/^[A-Z][A-Z0-9_-]*$/,$V=/([^{}\n\r]+)/y,UE=/([^\\"\n\r]*)/y,XJ=/\\([\\"])/y,BJ=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,ZE=/^\n+/,YJ=/ +$/,FE=/ *\r?\n/g,oE=/( *)$/,hE=/{\s*/y,kJ=/\s*}/y,VE=/\[\s*/y,WE=/\s*] */y,QE=/\s*\(\s*/y,mE=/\s*->\s*/y,NE=/\s*:\s*/y,RE=/\s*,?\s*/y,rE=/\s+/y;class bE{constructor(l){this.body=[],Zr.lastIndex=0;let t=0;for(;;){let y=Zr.exec(l);if(y===null)break;t=Zr.lastIndex;try{this.body.push(c(y[1]))}catch(z){if(z instanceof SyntaxError)continue;throw z}}function d(y){return y.lastIndex=t,y.test(l)}function n(y,z){if(l[t]===y)return t++,!0;if(z)throw new z(`Expected ${y}`);return!1}function a(y,z){if(d(y))return t=y.lastIndex,!0;if(z)throw new z(`Expected ${y.toString()}`);return!1}function i(y){y.lastIndex=t;let z=y.exec(l);if(z===null)throw new SyntaxError(`Expected ${y.toString()}`);return t=y.lastIndex,z}function s(y){return i(y)[1]}function c(y){let z=o(),I=F();if(z===null&&Object.keys(I).length===0)throw new SyntaxError("Expected message value or attributes");return{id:y,value:z,attributes:I}}function F(){let y=Object.create(null);for(;d(GJ);){let z=s(GJ),I=o();if(I===null)throw new SyntaxError("Expected attribute value");y[z]=I}return y}function o(){let y;if(d($V)&&(y=s($V)),l[t]==="{"||l[t]==="}")return h(y?[y]:[],1/0);let z=J();return z?y?h([y,z],z.length):(z.value=Y(z.value,ZE),h([z],z.length)):y?Y(y,YJ):null}function h(y=[],z){for(;;){if(d($V)){y.push(s($V));continue}if(l[t]==="{"){y.push(V());continue}if(l[t]==="}")throw new SyntaxError("Unbalanced closing brace");let j=J();if(j){y.push(j),z=Math.min(z,j.length);continue}break}let I=y.length-1,O=y[I];typeof O=="string"&&(y[I]=Y(O,YJ));let E=[];for(let j of y)j instanceof zJ&&(j=j.value.slice(0,j.value.length-z)),j&&E.push(j);return E}function V(){a(hE,SyntaxError);let y=W();if(a(kJ))return y;if(a(mE)){let z=N();return a(kJ,SyntaxError),{type:"select",selector:y,...z}}throw new SyntaxError("Unclosed placeable")}function W(){if(l[t]==="{")return V();if(d(yJ)){let[,y,z,I=null]=i(yJ);if(y==="$")return{type:"var",name:z};if(a(QE)){let O=Q();if(y==="-")return{type:"term",name:z,attr:I,args:O};if(cE.test(z))return{type:"func",name:z,args:O};throw new SyntaxError("Function names must be all upper-case")}return y==="-"?{type:"term",name:z,attr:I,args:[]}:{type:"mesg",name:z,attr:I}}return r()}function Q(){let y=[];for(;;){switch(l[t]){case")":return t++,y;case void 0:throw new SyntaxError("Unclosed argument list")}y.push(m()),a(RE)}}function m(){let y=W();return y.type!=="mesg"?y:a(NE)?{type:"narg",name:y.name,value:r()}:y}function N(){let y=[],z=0,I;for(;d(iE);){n("*")&&(I=z);let O=b(),E=o();if(E===null)throw new SyntaxError("Expected variant value");y[z++]={key:O,value:E}}if(z===0)return null;if(I===void 0)throw new SyntaxError("Expected default variant");return{variants:y,star:I}}function b(){a(VE,SyntaxError);let y;return d(Fr)?y=u():y={type:"str",value:s(sE)},a(WE,SyntaxError),y}function r(){if(d(Fr))return u();if(l[t]==='"')return S();throw new SyntaxError("Invalid expression")}function u(){let[,y,z=""]=i(Fr),I=z.length;return{type:"num",value:parseFloat(y),precision:I}}function S(){n('"',SyntaxError);let y="";for(;;){if(y+=s(UE),l[t]==="\\"){y+=G();continue}if(n('"'))return{type:"str",value:y};throw new SyntaxError("Unclosed string literal")}}function G(){if(d(XJ))return s(XJ);if(d(BJ)){let[,y,z]=i(BJ),I=parseInt(y||z,16);return I<=55295||57344<=I?String.fromCodePoint(I):"�"}throw new SyntaxError("Unknown escape sequence")}function J(){let y=t;switch(a(rE),l[t]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return L(l.slice(y,t))}return l[t-1]===" "?L(l.slice(y,t)):!1}function Y(y,z){return y.replace(z,"")}function L(y){let z=y.replace(FE,`
|
|
65
65
|
`),I=oE.exec(y)[1].length;return new zJ(z,I)}}}class zJ{constructor(l,t){this.value=l,this.length=t}}const uE=/<|&#?\w+;/,pE={"http://www.w3.org/1999/xhtml":["em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr"]},ME={"http://www.w3.org/1999/xhtml":{global:["title","aria-label","aria-valuetext"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","label","title","tooltiptext"],description:["value"],key:["key","keycode"],label:["value"],textbox:["placeholder","value"]}};function SE(e,l){const{value:t}=l;if(typeof t=="string")if(e.localName==="title"&&e.namespaceURI==="http://www.w3.org/1999/xhtml")e.textContent=t;else if(!uE.test(t))e.textContent=t;else{const d=e.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");d.innerHTML=t,TE(d.content,e)}LJ(l,e)}function TE(e,l){for(const t of e.childNodes)if(t.nodeType!==t.TEXT_NODE){if(t.hasAttribute("data-l10n-name")){const d=GE(l,t);e.replaceChild(d,t);continue}if(XE(t)){const d=yE(t);e.replaceChild(d,t);continue}console.warn(`An element of forbidden type "${t.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.`),e.replaceChild(or(t),t)}l.textContent="",l.appendChild(e)}function JE(e,l){if(!e)return!1;for(let t of e)if(t.name===l)return!0;return!1}function LJ(e,l){const t=l.hasAttribute("data-l10n-attrs")?l.getAttribute("data-l10n-attrs").split(",").map(d=>d.trim()):null;for(const d of Array.from(l.attributes))IJ(d.name,l,t)&&!JE(e.attributes,d.name)&&l.removeAttribute(d.name);if(e.attributes)for(const d of Array.from(e.attributes))IJ(d.name,l,t)&&l.getAttribute(d.name)!==d.value&&l.setAttribute(d.name,d.value)}function GE(e,l){const t=l.getAttribute("data-l10n-name"),d=e.querySelector(`[data-l10n-name="${t}"]`);if(!d)return console.warn(`An element named "${t}" wasn't found in the source.`),or(l);if(d.localName!==l.localName)return console.warn(`An element named "${t}" was found in the translation but its type ${l.localName} didn't match the element found in the source (${d.localName}).`),or(l);e.removeChild(d);const n=d.cloneNode(!1);return DJ(l,n)}function yE(e){const l=e.ownerDocument.createElement(e.localName);return DJ(e,l)}function or(e){return e.ownerDocument.createTextNode(e.textContent)}function XE(e){const l=pE[e.namespaceURI];return l&&l.includes(e.localName)}function IJ(e,l,t=null){if(t&&t.includes(e))return!0;const d=ME[l.namespaceURI];if(!d)return!1;const n=e.toLowerCase(),a=l.localName;if(d.global.includes(n))return!0;if(!d[a])return!1;if(d[a].includes(n))return!0;if(l.namespaceURI==="http://www.w3.org/1999/xhtml"&&a==="input"&&n==="value"){const i=l.type.toLowerCase();if(i==="submit"||i==="button"||i==="reset")return!0}return!1}function DJ(e,l){return l.textContent=e.textContent,LJ(e,l),l}class BE extends Array{static from(l){return l instanceof this?l:new this(l)}}class YE extends BE{constructor(l){if(super(),Symbol.asyncIterator in Object(l))this.iterator=l[Symbol.asyncIterator]();else if(Symbol.iterator in Object(l))this.iterator=l[Symbol.iterator]();else throw new TypeError("Argument must implement the iteration protocol.")}[Symbol.asyncIterator](){const l=this;let t=0;return{async next(){return l.length<=t&&l.push(l.iterator.next()),l[t++]}}}async touchNext(l=1){let t=0;for(;t++<l;){const d=this[this.length-1];if(d&&(await d).done)break;this.push(this.iterator.next())}return this[this.length-1]}}class kE{constructor(l=[],t){this.resourceIds=l,this.generateBundles=t,this.onChange(!0)}addResourceIds(l,t=!1){return this.resourceIds.push(...l),this.onChange(t),this.resourceIds.length}removeResourceIds(l){return this.resourceIds=this.resourceIds.filter(t=>!l.includes(t)),this.onChange(),this.resourceIds.length}async formatWithFallback(l,t){const d=[];let n=!1;for await(const a of this.bundles){n=!0;const i=IE(t,a,l,d);if(i.size===0)break;if(typeof console<"u"){const s=a.locales[0],c=Array.from(i).join(", ");console.warn(`[fluent] Missing translations in ${s}: ${c}`)}}return!n&&typeof console<"u"&&console.warn(`[fluent] Request for keys failed because no resource bundles got generated.
|
|
66
66
|
keys: ${JSON.stringify(l)}.
|
|
67
67
|
resourceIds: ${JSON.stringify(this.resourceIds)}.`),d}formatMessages(l){return this.formatWithFallback(l,LE)}formatValues(l){return this.formatWithFallback(l,zE)}async formatValue(l,t){const[d]=await this.formatValues([{id:l,args:t}]);return d}handleEvent(){this.onChange()}onChange(l=!1){this.bundles=YE.from(this.generateBundles(this.resourceIds)),l&&this.bundles.touchNext(2)}}function zE(e,l,t,d){return t.value?e.formatPattern(t.value,d,l):null}function LE(e,l,t,d){const n={value:null,attributes:null};t.value&&(n.value=e.formatPattern(t.value,d,l));let a=Object.keys(t.attributes);if(a.length>0){n.attributes=new Array(a.length);for(let[i,s]of a.entries()){let c=e.formatPattern(t.attributes[s],d,l);n.attributes[i]={name:s,value:c}}}return n}function IE(e,l,t,d){const n=[],a=new Set;return t.forEach(({id:i,args:s},c)=>{if(d[c]!==void 0)return;let F=l.getMessage(i);if(F){if(n.length=0,d[c]=e(l,n,F,s),n.length>0&&typeof console<"u"){const o=l.locales[0],h=n.join(", ");console.warn(`[fluent][resolver] errors in ${o}/${i}: ${h}.`)}}else a.add(i)}),a}const Ci="data-l10n-id",l0="data-l10n-args",DE=`[${Ci}]`;class wE extends kE{constructor(l,t){super(l,t),this.roots=new Set,this.pendingrAF=null,this.pendingElements=new Set,this.windowElement=null,this.mutationObserver=null,this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[Ci,l0]}}onChange(l=!1){super.onChange(l),this.roots&&this.translateRoots()}setAttributes(l,t,d){return l.setAttribute(Ci,t),d?l.setAttribute(l0,JSON.stringify(d)):l.removeAttribute(l0),l}getAttributes(l){return{id:l.getAttribute(Ci),args:JSON.parse(l.getAttribute(l0)||null)}}connectRoot(l){for(const t of this.roots)if(t===l||t.contains(l)||l.contains(t))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==l.ownerDocument.defaultView)throw new Error(`Cannot connect a root:
|
|
@@ -421,4 +421,8 @@ c-58 -10 -181 -38 -275 -61 -807 -204 -1528 -616 -2120 -1210 -726 -728 -1170
|
|
|
421
421
|
19 4525 19 4730 0 495 -47 873 -112 1690 -291 697 -153 961 -197 1230 -208
|
|
422
422
|
254 -10 438 21 605 103 172 84 315 254 390 463 74 203 108 420 117 736 34
|
|
423
423
|
1230 -451 2439 -1332 3320 -707 707 -1608 1156 -2597 1294 -206 29 -201 30
|
|
424
|
-
-283 -33z'/%3E%3C/g%3E%3C/svg%3E`,xW=Nl(ht(U.defineComponent({__name:"JaAvatar",props:{userId:{},username:{},realm:{},doNotLoadAvatar:{type:Boolean,default:!1},hasAvatar:{type:Boolean},firstName:{},size:{},shape:{},icon:{},src:{},alt:{},srcSet:{},fit:{}},setup(e){const l=e,t=Dr(),d=U.ref(!1),n=U.ref(),a=U.ref();d.value=!0,U.onMounted(async()=>{await U.nextTick()});const i=U.computed(()=>{if(!(d.value&&l.hasAvatar&&!l.doNotLoadAvatar))return l.firstName?"":wr;if(l.userId&&l.userId.length>0){const F="/ace-app-service/avatar/"+l.userId;return(window.rawWindow?window.rawWindow:window).appDescriptor.env.isDevMode()?new URL("/ace"+F,location.origin).toString()+"?t="+t.value.toString():new URL(F,location.origin).toString()+"?t="+t.value.toString()}if(l.realm&&l.realm.length>0&&l.username&&l.username.length>0){const F="/ace-app-service/avatar/"+l.realm+"/"+l.username;return(window.rawWindow?window.rawWindow:window).appDescriptor.env.isDevMode()?new URL("/ace"+F,location.origin).toString()+"?t="+t.value.toString():new URL(F,location.origin).toString()+"?t="+t.value.toString()}return l.firstName?"":wr});function s(F){var V;if(!F)return;let h=((V=n.value)==null?void 0:V.$el.clientWidth)/2.8;F.style.fontSize=h+"px"}U.onUnmounted(()=>{}),U.watch(a,()=>s(a.value));const c=U.computed(()=>{const{userId:F,username:o,realm:h,doNotLoadAvatar:V,hasAvatar:W,firstName:Q,...m}=l;return m});return(F,o)=>(U.openBlock(),U.createBlock(U.unref(v.ElAvatar),U.mergeProps({src:i.value},{...c.value,...F.$attrs},{ref_key:"avatar",ref:n,class:"ja-avatar"}),{default:U.withCtx(()=>[l.firstName&&l.firstName.length>0?(U.openBlock(),U.createElementBlock("span",{key:0,class:"user-name-avatar",ref_key:"usernameSpan",ref:a},U.toDisplayString(e.firstName),513)):(U.openBlock(),U.createBlock(U.unref(v.ElImage),{key:1,style:{height:"100%"},src:U.unref(wr),alt:"用户头像"},null,8,["src"]))]),_:1},16,["src"]))}}),[["__scopeId","data-v-52d5c63c"]]));let Er;function a9(){return Er||(Er=$.createAxiosWithoutCache()),Er}const i9={class:"portrait"},s9={class:"user-info"},c9={class:"dropdown"},U9={class:"header"},Z9={class:"tools"},F9={style:{margin:"0","font-weight":"600"}},o9={style:{margin:"0","font-size":"14px",color:"var(--el-color-info-light-3)"}},h9={style:{margin:"0"}},ZU=Nl(ht(U.defineComponent({__name:"UserInfoTag",props:{closable:{type:Boolean,default:!1},userId:{},fullName:{default:"无名氏"},realm:{},username:{},theme:{default:"skyGray"},showAvatarInTag:{type:Boolean},placement:{default:"bottom"},displayType:{default:"tag"},textStyle:{type:[Boolean,null,String,Object,Array],default:()=>({})},width:{}},emits:["closed"],setup(e,{emit:l}){const t={primary:"user-info-tag--root theme-primary",success:"user-info-tag--root theme-success",warning:"user-info-tag--root theme-warning",danger:"user-info-tag--root theme-danger",info:"user-info-tag--root theme-info",lotusPink:"user-info-tag--root theme-lotus-pink",wineRed:"user-info-tag--root theme-wine-red",autumnOrange:"user-info-tag--root theme-autumn-orange",sunYellow:"user-info-tag--root theme-sun-yellow",seaBlue:"user-info-tag--root theme-sea-blue",moonlightBlue:"user-info-tag--root theme-moonlight-blue",clovePurple:"user-info-tag--root theme-clove-purple",skyGray:"user-info-tag--root theme-sky-gray"},d=e,n=U.ref();let a=a9(),i=$.useLoading(a),s=$.useUserApi(a);const c=U.ref(!1),F=U.ref(!1),o=l;U.onUnmounted(()=>{a=void 0,i=void 0,s=void 0});function h(){if(!n.value)if(d.userId)s==null||s.getById(d.userId).then(N=>{n.value=N,V()});else if(d.username&&d.realm){let N=d.username;if(N.indexOf("\\")>=0){const b=N.split("\\");N=b[b.length-1]}s==null||s.getByUserName(d.realm,N).then(b=>{n.value=b,V()})}else throw new Error("user-info-tag组件的userId和(realm, userName)属性不能都为空")}function V(){n.value&&(s==null||s.checkBookmarked(n.value.id).then(N=>c.value=N))}function W(){F.value=!1,o("closed",d.userId,d.realm,d.username)}function Q(){n.value&&(s==null||s.bookmarkUser(n.value.id).then(()=>c.value=!0))}function m(){n.value&&(s==null||s.unbookmarkUser(n.value.id).then(()=>c.value=!1))}return(N,b)=>(U.openBlock(),U.createBlock(U.unref(v.ElPopover),{width:"auto","hide-after":200,onBeforeEnter:h,placement:e.placement,visible:F.value,"onUpdate:visible":b[3]||(b[3]=r=>F.value=r)},{reference:U.withCtx(()=>[e.displayType==="tag"?(U.openBlock(),U.createElementBlock("div",{key:0,class:U.normalizeClass(t[d.theme]),style:U.normalizeStyle({width:typeof e.width=="number"?e.width+"px":e.width})},[U.createElementVNode("div",i9,[U.createVNode(U.unref(xW),{size:24,"user-id":e.userId,realm:e.realm,username:e.username,"has-avatar":e.showAvatarInTag},null,8,["user-id","realm","username","has-avatar"])]),U.createElementVNode("div",s9,[U.createTextVNode(U.toDisplayString(e.fullName)+" ",1),e.closable?(U.openBlock(),U.createElementBlock("div",{key:0,class:"close-btn",onClick:b[0]||(b[0]=r=>W())},[U.createVNode(U.unref(v.ElIcon),{size:10},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.Close))]),_:1})])):U.createCommentVNode("",!0)])],6)):(U.openBlock(),U.createElementBlock("span",{key:1,class:"user-info-text",style:U.normalizeStyle([e.textStyle,e.width?{width:typeof e.width=="number"?e.width+"px":e.width,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"bottom"}:{}])},U.toDisplayString(e.fullName),5))]),default:U.withCtx(()=>{var r,u,S,G,J,Y,L;return[U.withDirectives((U.openBlock(),U.createElementBlock("div",c9,[U.createElementVNode("div",U9,[U.createVNode(U.unref(xW),{"user-id":e.userId,realm:e.realm,username:e.username,size:75,"has-avatar":(r=n.value)==null?void 0:r.hasAvatar,style:{"margin-bottom":"8px"}},null,8,["user-id","realm","username","has-avatar"]),U.createElementVNode("div",Z9,[U.createVNode(U.unref(v.ElTooltip),{content:c.value?"取消常用人员":"设置为常用人员"},{default:U.withCtx(()=>[c.value?(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:1,color:"#FFBF29",onClick:b[2]||(b[2]=y=>m()),size:16},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.StarFilled))]),_:1})):(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:0,onClick:b[1]||(b[1]=y=>Q()),size:16},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.Star))]),_:1}))]),_:1},8,["content"])])]),U.createElementVNode("div",null,[U.createElementVNode("p",F9,U.toDisplayString(e.fullName),1),U.createElementVNode("p",o9," @"+U.toDisplayString(((S=(u=n.value)==null?void 0:u.department)==null?void 0:S.name)??"无归属部门"),1)]),U.createElementVNode("p",h9,[b[4]||(b[4]=U.createElementVNode("span",{class:"label"},"手机:",-1)),U.createTextVNode(" "+U.toDisplayString(!((G=n.value)!=null&&G.mobile)||n.value.mobile.length===0?"(未填写手机号)":(J=n.value)==null?void 0:J.mobile)+" ",1),b[5]||(b[5]=U.createElementVNode("br",null,null,-1)),b[6]||(b[6]=U.createElementVNode("span",{class:"label"},"邮箱:",-1)),U.createTextVNode(" "+U.toDisplayString(!((Y=n.value)!=null&&Y.email)||n.value.email.length===0?"(未填写邮箱号)":(L=n.value)==null?void 0:L.email),1)])])),[[U.vShow,F.value],[U.unref(v.vLoading),!!U.unref(i)]])]}),_:1},8,["placement","visible"]))}}),[["__scopeId","data-v-d0d81b4f"]]));function gW(e){var l=typeof e;return e!=null&&(l=="object"||l=="function")}var V9=typeof global=="object"&&global&&global.Object===Object&&global,W9=typeof self=="object"&&self&&self.Object===Object&&self,ny=V9||W9||Function("return this")(),Cr=function(){return ny.Date.now()},Q9=/\s/;function m9(e){for(var l=e.length;l--&&Q9.test(e.charAt(l)););return l}var N9=/^\s+/;function ay(e){return e&&e.slice(0,m9(e)+1).replace(N9,"")}var FU=ny.Symbol,iy=Object.prototype,R9=iy.hasOwnProperty,r9=iy.toString,p0=FU?FU.toStringTag:void 0;function b9(e){var l=R9.call(e,p0),t=e[p0];try{e[p0]=void 0;var d=!0}catch{}var n=r9.call(e);return d&&(l?e[p0]=t:delete e[p0]),n}var u9=Object.prototype,p9=u9.toString;function M9(e){return p9.call(e)}var S9="[object Null]",T9="[object Undefined]",sy=FU?FU.toStringTag:void 0;function J9(e){return e==null?e===void 0?T9:S9:sy&&sy in Object(e)?b9(e):M9(e)}function G9(e){return e!=null&&typeof e=="object"}var y9="[object Symbol]";function cy(e){return typeof e=="symbol"||G9(e)&&J9(e)==y9}var Uy=NaN,X9=/^[-+]0x[0-9a-f]+$/i,B9=/^0b[01]+$/i,Y9=/^0o[0-7]+$/i,k9=parseInt;function Zy(e){if(typeof e=="number")return e;if(cy(e))return Uy;if(gW(e)){var l=typeof e.valueOf=="function"?e.valueOf():e;e=gW(l)?l+"":l}if(typeof e!="string")return e===0?e:+e;e=ay(e);var t=B9.test(e);return t||Y9.test(e)?k9(e.slice(2),t?2:8):X9.test(e)?Uy:+e}var z9="Expected a function",L9=Math.max,I9=Math.min;function xr(e,l,t){var d,n,a,i,s,c,F=0,o=!1,h=!1,V=!0;if(typeof e!="function")throw new TypeError(z9);l=Zy(l)||0,gW(t)&&(o=!!t.leading,h="maxWait"in t,a=h?L9(Zy(t.maxWait)||0,l):a,V="trailing"in t?!!t.trailing:V);function W(J){var Y=d,L=n;return d=n=void 0,F=J,i=e.apply(L,Y),i}function Q(J){return F=J,s=setTimeout(b,l),o?W(J):i}function m(J){var Y=J-c,L=J-F,y=l-Y;return h?I9(y,a-L):y}function N(J){var Y=J-c,L=J-F;return c===void 0||Y>=l||Y<0||h&&L>=a}function b(){var J=Cr();if(N(J))return r(J);s=setTimeout(b,m(J))}function r(J){return s=void 0,V&&d?W(J):(d=n=void 0,i)}function u(){s!==void 0&&clearTimeout(s),F=0,d=c=n=s=void 0}function S(){return s===void 0?i:r(Cr())}function G(){var J=Cr(),Y=N(J);if(d=arguments,n=this,c=J,Y){if(s===void 0)return Q(c);if(h)return clearTimeout(s),s=setTimeout(b,l),W(c)}return s===void 0&&(s=setTimeout(b,l)),i}return G.cancel=u,G.flush=S,G}const jW=U.ref([]);function OW(){const e=$.useRealmApi(),l=async()=>{if(jW.value.length!==0)return;const d={};jW.value=await e.getAll(d)};return{realms:jW,getAllRealms:l,getDefaultRealm:async()=>(await l(),jW.value.find(d=>d.name==="ace-platform"))}}function gr(e,l,t,d,n,a){const i=U.ref({}),s=U.ref({currentPage:1,pageSize:50}),c=U.ref({total:0,users:[]});n||(n=$.createAxiosWithoutCache());const F=$.useUserApi(n),o=$.useLoading(n),h=U.ref(!1);function V(){m().then(N=>{t&&t(N,h.value),h.value=!1})}const W=xr(V,300);function Q(){c.value.total=0,c.value.users=[],s.value.currentPage!==1?s.value.currentPage=1:W()}U.watch(i,()=>{h.value=!0,Q()},{deep:!0}),U.watch(()=>s.value.pageSize,()=>{h.value=!0,Q()}),U.watch(()=>s.value.currentPage,()=>{m().then(N=>{t&&t(N,h.value),h.value=!1})});async function m(){if(e&&!e())return Promise.resolve(void 0);if(!i.value.realmId){const y=await OW().getDefaultRealm();i.value.realmId=y.id}const N=$.useUserQueryBuilder(),b=N.getQEntity();N.and(b.realm.id.eq(i.value.realmId)).and(b.recycled.eq(!1));const r=i.value.currentDept;r&&(r.id==ly?N.and(b.department.isNull()):r.id!==Ir&&N.and(b.department.sortPath.startWith(r.sortPath)));const u=i.value.classificationLevel;u&&N.and(b.classifiedLevel.loe(u));const S=i.value.currentGroup;S&&N.and(b.userGroups.any().group.sortPath.startWith(S.sortPath));const G=i.value.currentCustomGroup;G&&N.and(b.customGroups.any().customGroup.sortPath.startWith(G.sortPath));const J=i.value.name;if(J){const y="%"+J.split("").join("%")+"%";N.and(b.username.like(y).or(b.fullName.like(y)).or(b.pinYinName.like(y)).or(b.mobile.like(y)))}l&&N.and(l(b));const Y=i.value.currentSort;Y&&N.orderBy(Y);const L=N.build();if(a)return F.queryUserRefs(L).then(y=>(c.value.users=y,y));{const y=s.value.currentPage-1;return F.queryUserRefsPaged(L,y,s.value.pageSize).then(z=>(d&&y>0?c.value.users.push(...z.content):c.value.users=z.content,c.value.total=z.totalElements,z.content))}}return{queryParams:i,pageParams:s,queryResult:c,queryUsers:m,loading:o}}const jr=Nl(ht(U.defineComponent({__name:"departmentTree",props:U.mergeModels({realmId:{},showNoDepartment:{type:Boolean,default:!1},multiple:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change","loaded"],["update:modelValue"]),setup(e,{expose:l,emit:t}){const d=U.ref(),n=$.createAxiosWithoutCache(),a=$.useLoading(n),i=$.useDepartmentApi(n),s=e,c=t,F=U.useModel(e,"modelValue"),o=U.computed({get(){var Q;return(Q=F.value)==null?void 0:Q.id},set(Q){F.value=h.departments.find(m=>m.id===Q)??null}}),h=U.shallowReactive({departments:[]}),V=async()=>{if(!s.realmId)return;const Q=await i.getNormal(s.realmId,$.FromDeptSelect.BT);h.departments=[{id:Ir,label:"所有部门",name:"所有部门",shortCode:"",children:[],hasChildren:!1,sortIndex:-1,sortPath:"",dataVersion:0,entity:!1,attributes:{}},...s.showNoDepartment?[{id:ly,label:"无归属部门",name:"无归属部门",shortCode:"",children:[],hasChildren:!1,sortIndex:-100,sortPath:"no_dept",dataVersion:0,entity:!1,attributes:{}}]:[],...es(Q,"name")],o.value=h.departments[0].id,c("loaded",h.departments)},W=Q=>{F.value=Q,c("change",Q)};return U.watch(()=>s.realmId,()=>{V()}),l({reload:V}),V(),(Q,m)=>U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElTree),{ref_key:"deptTree",ref:d,data:U.unref(h).departments,size:"default","node-key":"id","default-expand-all":"","highlight-current":"","current-node-key":o.value,"expand-on-click-node":!1,onCurrentChange:W,props:{class:N=>{var b;return((b=F.value)==null?void 0:b.id)===N.id?"selected-group":"group"}}},null,8,["data","current-node-key","props"])),[[U.unref(v.vLoading),U.unref(a)]])}}),[["__scopeId","data-v-b247a32f"]])),Or="com.csicit.ace.scrollbar.wrapped";var D9="Expected a function";function M0(e,l,t){var d=!0,n=!0;if(typeof e!="function")throw new TypeError(D9);return gW(t)&&(d="leading"in t?!!t.leading:d,n="trailing"in t?!!t.trailing:n),xr(e,l,{leading:d,maxWait:l,trailing:n})}const Xn=new Map,vr=new Map;let Pl=null,Ll;async function oU(e,l){let t=Xn.get(l);if(t)return t;let d=vr.get(l);return d?await d:(d=e().then(n=>(Xn.set(l,n),n)).finally(()=>{vr.delete(l)}),vr.set(l,d),await d)}async function Fy(e){Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl));const l=await oU(()=>Ll.getAll(!0),"all");return e?l:l.filter(t=>t.name!=="ace-app-manage")}async function w9(e){Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),await oU(()=>Ll.getAll(!0),"all");let l=Xn.get("all").find(t=>t.id===e);return l||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl),l=await Ll.getById(e),l&&(Xn.get("all").find(t=>t.id===l.id)||Xn.get("all").push(l))),l}async function E9(e){Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),await oU(()=>Ll.getAll(!0),"all");let l=Xn.get("all").find(t=>t.name===e);return l||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl),l=await Ll.getByName(e),l&&(Xn.get("all").find(t=>t.id===l.id)||Xn.get("all").push(l))),l}async function oy(){return Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),await oU(Ll.getManageable,"manageable")}async function hy(){return Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),await oU(Ll.getAccessible,"accessible")}async function Vy(){return Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),(await oU(()=>Ll.getGlobalApp().then(e=>[e]),"global"))[0]}async function C9(){Xn.clear(),await Promise.all([Fy(),oy(),hy(),Vy()])}function hU(){return{getAll:Fy,getByName:E9,getById:w9,getManageable:oy,getAccessible:hy,getGlobal:Vy,refresh:C9}}const S0=new Map;let VU=new Map;function Wy(e,l,t,d){return e+":"+l+":"+(t??"")+":"+(d?"all":"by-category")}function Qy(){return{refreshGroupsCache(){S0.clear()},async getGroups(e,l,t,d){const n=Wy(e,l,t,d);let a=S0.get(n);if(a)return a;let i=VU.get(n);if(i)return await i;const s=$.createAxiosWithoutCache(),c=$.useUserGroupApi(s);return d?i=c.getAll(e,l):i=c.getByAppIdAndRealm(e,l,t),i=i.then(F=>(S0.set(n,F),F)).finally(()=>{VU.delete(n)}),VU.set(n,i),await i},async getGlobalGroups(e,l){const d=Wy("[global-app]",e,l,!0);let n=S0.get(d);if(n)return n;let a=VU.get(d);if(a)return await a;const i=$.createAxiosWithoutCache();return a=$.useUserGroupApi(i).getGlobalGroups(e,l).then(c=>(S0.set(d,c),c)).finally(()=>{VU.delete(d)}),VU.set(d,a),await a}}}const x9={class:"ja-user-group-tree"},g9={class:"name"},fr=Nl(ht(U.defineComponent({__name:"userGroupTree",props:U.mergeModels({realmId:{},multiple:{type:Boolean},showConsoleApp:{type:Boolean},appId:{},nodeHeight:{default:"auto"},category:{},global:{type:Boolean},showAllCategory:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change","loaded"],["update:modelValue"]),async setup(e,{expose:l,emit:t}){let d,n;const a=U.ref(),i=$.createAxiosWithoutCache(),s=$.useLoading(i),c=e,F=t,o=U.useModel(e,"modelValue"),h=U.ref(c.appId),V=U.computed({get(){var Y;return(Y=o.value)==null?void 0:Y.id},set(Y){o.value=S.groups.find(L=>L.id===Y)??null}}),{getGlobal:W,getAccessible:Q}=hU(),{getGroups:m,getGlobalGroups:N}=Qy();let[b,r]=([d,n]=U.withAsyncContext(()=>Promise.all([W(),Q()])),d=await d,n(),d);if(r=[...r],r.unshift(b),!c.showConsoleApp){const Y=r.findIndex(L=>L.name=="ace-app-manage");Y>=0&&r.splice(Y,1)}const u=U.ref(r);h.value||(h.value=b.id);const S=U.shallowReactive({groups:[]}),G=async()=>{if(!c.realmId||!h.value)return;let Y;c.global?Y=await N(c.realmId):Y=await m(h.value,c.realmId,c.category,c.showAllCategory),S.groups=[...es(Y,"name")],!o.value&&S.groups.length>0&&(V.value=S.groups[0].id),F("loaded",S.groups)},J=Y=>{o.value=Y,F("change",Y)};return U.watch(()=>({appId:c.appId,realmId:c.realmId,category:c.category}),()=>{G()},{deep:!0,immediate:!0}),U.watch(()=>c.appId,()=>{h.value=c.appId}),l({reload:G,elTree:a}),(Y,L)=>(U.openBlock(),U.createElementBlock("div",x9,[c.appId?U.createCommentVNode("",!0):(U.openBlock(),U.createBlock(U.unref(v.ElSelect),{key:0,modelValue:h.value,"onUpdate:modelValue":L[0]||(L[0]=y=>h.value=y),style:{width:"100%"}},{default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(u.value,y=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:y.id,label:y.caption,value:y.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])),U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElTree),U.mergeProps({style:{width:"100%","--ja-group-tree-node-height":c.nodeHeight},ref_key:"groupTree",ref:a,data:U.unref(S).groups,size:"default","node-key":"id","highlight-current":"","default-expand-all":"","current-node-key":V.value,"expand-on-click-node":!1},Y.$attrs,{onCurrentChange:J,props:{class:y=>{var z;return((z=o.value)==null?void 0:z.id)===y.id?"selected-group":"group"}}}),{default:U.withCtx(({data:y})=>[U.createElementVNode("div",null,[U.createElementVNode("div",g9,[U.createTextVNode(U.toDisplayString(y.label)+" ",1),y.resourceScoped?(U.openBlock(),U.createBlock(U.unref(v.ElTag),{key:0,type:"info"},{default:U.withCtx(()=>[...L[1]||(L[1]=[U.createTextVNode("资源域",-1)])]),_:1})):U.createCommentVNode("",!0)])])]),_:1},16,["style","data","current-node-key","props"])),[[U.unref(v.vLoading),U.unref(s)]])]))}}),[["__scopeId","data-v-029d0f4c"]])),j9=Nl(ht(U.defineComponent({__name:"customGroupTree",props:U.mergeModels({multiple:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change","loaded"],["update:modelValue"]),setup(e,{expose:l,emit:t}){const d=U.ref(),n=$.createAxiosWithoutCache(),a=$.useLoading(n),i=$.useCustomGroupApi(n),s=t,c=U.useModel(e,"modelValue"),F=U.computed({get(){var W;return(W=c.value)==null?void 0:W.id},set(W){c.value=o.groups.find(Q=>Q.id===W)??null}}),o=U.shallowReactive({groups:[]}),h=async()=>{const W=await i.getAll();o.groups=[...es(W,"name")],o.groups.length>0&&(c.value=o.groups[0],F.value=c.value.id),s("loaded",o.groups)},V=W=>{c.value=W,s("change",W)};return l({reload:h}),h(),(W,Q)=>U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElTree),{ref_key:"deptTree",ref:d,data:U.unref(o).groups,size:"default","node-key":"id","default-expand-all":"","highlight-current":"","current-node-key":F.value,"expand-on-click-node":!1,onCurrentChange:V,props:{class:m=>{var N;return((N=c.value)==null?void 0:N.id)===m.id?"selected-group":"group"}}},null,8,["data","current-node-key","props"])),[[U.unref(v.vLoading),U.unref(a)]])}}),[["__scopeId","data-v-4e04bc5c"]])),O9={class:"ja-user-select-dialog"},v9={class:"ja-user-select-dialog__content"},f9={style:{display:"flex","flex-direction":"row","align-content":"baseline",width:"100%",gap:"0"}},Kr=Nl(ht(U.defineComponent({__name:"userSelectDialog",props:U.mergeModels({realmId:{type:String,required:!1},multiple:{type:Boolean,required:!1,default:!1},classificationLevel:{type:Number,required:!1,default:0},customFilter:{type:Function,required:!1},maxSelect:{type:Number,required:!1,default:0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e,{expose:l}){const t=e,d=U.useModel(e,"modelValue"),n=U.ref();async function a(){if(t.realmId)n.value=t.realmId;else{const K=await OW().getDefaultRealm();n.value=K.id}}if(a(),t.multiple){if(d.value||(d.value=[]),!Array.isArray(d.value))throw new Error("多选模式的选择用户对话框(multiple设置为true)的v-model必须是数组类型")}else if(Array.isArray(d.value))throw new Error("单选模式的选择用户对话框(multiple设置为false)的v-model只能为空或是单个UserReference对象");const i=U.ref(!1),s=U.ref(),c=U.ref(),F=U.ref(),o=$.createAxiosWithoutCache(),h=$.useLoading(o),V=U.ref(!1),W=U.ref([]),Q=U.reactive(new Map),m=U.ref("dept");U.provide(Or,void 0);const N=U.ref(Array.isArray(d.value)?[...d.value]:d.value),b=gr(void 0,t.customFilter,K=>{V.value||(W.value=K??[])},!1,o,!0),r=[{key:"user",dataKey:"id",width:290,title:"用户",cellRenderer:({cellData:K,rowData:A,rowIndex:P})=>{const{hasAvatar:q,fullName:_}=A,g=A,tl=P;return U.h("div",{class:"user-row",onMousedown:()=>B(g),onMouseenter:()=>k(g),onMouseup:X,onMouseover:nl=>x(nl,tl)},[U.h(v.ElIcon,{color:"#0D6A9F"},()=>Y(g)?U.h(ml.Check):void 0),U.h(ZU,{userId:K,theme:L(g),placement:"right-start",hasAvatar:!1,fullName:_}),U.h("div",{style:"flex:auto"})])}}],u=U.ref(!1),S=U.ref(),G=M0(D,100),J=M0(y,100);U.watch(s,()=>{m.value=="dept"&&(b.queryParams.value.currentDept=s.value)}),U.watch(c,()=>{m.value=="group"&&(b.queryParams.value.currentGroup=c.value)}),U.watch(F,()=>{m.value=="customGroup"&&(b.queryParams.value.currentCustomGroup=F.value)}),U.watch(()=>t.classificationLevel,()=>{b.queryParams.value.classificationLevel=t.classificationLevel}),U.watch(m,()=>{m.value==="dept"?(b.queryParams.value.currentDept=s.value,b.queryParams.value.currentGroup=void 0,b.queryParams.value.currentCustomGroup=void 0):m.value==="group"?(b.queryParams.value.currentDept=void 0,b.queryParams.value.currentCustomGroup=void 0,b.queryParams.value.currentGroup=c.value):m.value==="customGroup"&&(b.queryParams.value.currentDept=void 0,b.queryParams.value.currentCustomGroup=F.value,b.queryParams.value.currentGroup=void 0)});function Y(K){return Array.isArray(N.value)?Q.has(K.id):N.value&&N.value.id===K.id}function L(K){return Y(K)?"autumnOrange":"skyGray"}function y(K){if(Array.isArray(N.value)){const A=N.value.findIndex(P=>P.id===K.id);if(A>=0)Q.delete(K.id),N.value.splice(A,1);else{if(t.maxSelect>0&&N.value.length>=t.maxSelect){v.ElMessage({message:`已超过最大选择数量 ${t.maxSelect}`,type:"warning",plain:!0});return}Q.set(K.id,K),N.value.push(K)}}else N.value=K}U.onUnmounted(()=>{G.cancel(),J.cancel()});function z(){if(Array.isArray(N.value)){const K=b.queryResult.value.users.filter(A=>!Y(A));if(t.maxSelect>0){const A=t.maxSelect-N.value.length;if(A>0){const P=K.slice(0,A);P.forEach(q=>Q.set(q.id,q)),N.value.push(...P)}}else K.forEach(A=>Q.set(A.id,A)),N.value.push(...K)}}function I(){Array.isArray(N.value)&&(Q.clear(),N.value.splice(0))}function O(){if(Array.isArray(N.value)){const K=b.queryResult.value.users.filter(A=>!Y(A));if(Q.clear(),t.maxSelect>0){const A=K.slice(0,t.maxSelect);A.forEach(P=>Q.set(P.id,P)),N.value.splice(0),N.value.push(...A)}else K.forEach(A=>Q.set(A.id,A)),N.value.splice(0),N.value.push(...K)}}function E(){if(t.multiple&&Array.isArray(N.value)&&t.maxSelect>0&&N.value.length>t.maxSelect){v.ElMessage({message:`已超过最大选择数量 ${t.maxSelect}`,type:"warning",plain:!0});return}d.value=N.value,i.value=!1}function j(){V.value=!V.value,V.value?Array.isArray(N.value)?W.value=[...N.value]:W.value=N.value?[N.value]:[]:W.value=b.queryResult.value.users}function C(){!b.queryParams.value.realmId&&n.value&&(b.queryParams.value.realmId=n.value),N.value=Array.isArray(d.value)?[...d.value]:d.value,Array.isArray(d.value)&&(Q.clear(),d.value.forEach(K=>Q.set(K.id,K)))}function B(K){y(K),u.value=!0}function X(){u.value=!1}function k(K){u.value&&y(K)}let w;function D(){w&&w<W.value.length&&S.value.scrollToRow(w+1),w=void 0}function x(K,A){u.value=K.buttons>0,u.value&&(w=A,G())}return l({show(){i.value=!0}}),(K,A)=>(U.openBlock(),U.createBlock(U.unref(v.ElDialog),{modelValue:i.value,"onUpdate:modelValue":A[5]||(A[5]=P=>i.value=P),"destroy-on-close":"",draggable:"",width:"640",title:"选择人员","append-to-body":"",onOpen:C},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{type:"primary",shortcut:"Ctrl+Alt+Enter",onClick:E,size:"default"},{default:U.withCtx(()=>[...A[10]||(A[10]=[U.createTextVNode("确定 ",-1)])]),_:1}),U.createVNode(U.unref(v.ElButton),{plain:"",size:"default",onClick:A[4]||(A[4]=P=>i.value=!1)},{default:U.withCtx(()=>[...A[11]||(A[11]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createElementVNode("div",O9,[U.createVNode(U.unref(v.ElTabs),{class:"ja-user-select-dialog__left",modelValue:m.value,"onUpdate:modelValue":A[3]||(A[3]=P=>m.value=P)},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElTabPane),{name:"dept",label:"按部门",class:"ja-user-select-dialog__left-dept-pane"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElScrollbar),{height:"400"},{default:U.withCtx(()=>[U.createVNode(U.unref(jr),{modelValue:s.value,"onUpdate:modelValue":A[0]||(A[0]=P=>s.value=P),"realm-id":n.value},null,8,["modelValue","realm-id"])]),_:1})]),_:1}),U.createVNode(U.unref(v.ElTabPane),{name:"group",label:"按用户组"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElScrollbar),{height:"400"},{default:U.withCtx(()=>[U.createVNode(U.unref(fr),{modelValue:c.value,"onUpdate:modelValue":A[1]||(A[1]=P=>c.value=P),"show-all-category":"","realm-id":n.value},null,8,["modelValue","realm-id"])]),_:1})]),_:1}),U.createVNode(U.unref(v.ElTabPane),{name:"customGroup",label:"按自定义组"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElScrollbar),{height:"400"},{default:U.withCtx(()=>[U.createVNode(U.unref(j9),{modelValue:F.value,"onUpdate:modelValue":A[2]||(A[2]=P=>F.value=P)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),U.createElementVNode("div",v9,[U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElTableV2),{ref_key:"userTable",ref:S,"row-height":40,"header-height":40,columns:r,data:W.value,width:300,height:450,fixed:""},{header:U.withCtx(()=>[U.createElementVNode("div",f9,[U.createVNode(U.unref(v.ElText),{style:{flex:"auto","font-weight":"600"}},{default:U.withCtx(()=>[A[6]||(A[6]=U.createTextVNode(" 人员 ",-1)),U.createVNode(U.unref(v.ElTooltip),{content:"切换筛选条件,不会清除已选人员。支持鼠标拖动多选。"},{default:U.withCtx(()=>[t.multiple?(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:0},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.QuestionFilled))]),_:1})):U.createCommentVNode("",!0)]),_:1})]),_:1}),t.multiple?(U.openBlock(),U.createBlock(U.unref(v.ElText),{key:0,style:{flex:"none","margin-right":"12px"}},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElTooltip),{content:V.value?"显示所有人员":"只显示选中人员"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElIcon),{size:"15",onClick:j},{default:U.withCtx(()=>[V.value?(U.openBlock(),U.createBlock(U.unref(ml.View),{key:1})):(U.openBlock(),U.createBlock(U.unref(ml.Hide),{key:0}))]),_:1})]),_:1},8,["content"])]),_:1})):U.createCommentVNode("",!0),t.multiple?(U.openBlock(),U.createBlock(U.unref(Vt),{key:1,plain:"",style:{flex:"none"},link:"",tooltip:"全部选中",shortcut:"Ctrl+A",onClick:z},{default:U.withCtx(()=>[...A[7]||(A[7]=[U.createTextVNode("全选 ",-1)])]),_:1})):U.createCommentVNode("",!0),t.multiple?(U.openBlock(),U.createBlock(U.unref(Vt),{key:2,plain:"",style:{flex:"none"},link:"",tooltip:"清除全部选中项",shortcut:"Ctrl+Q",onClick:I},{default:U.withCtx(()=>[...A[8]||(A[8]=[U.createTextVNode("全消 ",-1)])]),_:1})):U.createCommentVNode("",!0),t.multiple?(U.openBlock(),U.createBlock(U.unref(Vt),{key:3,plain:"",style:{flex:"none"},link:"",tooltip:"清除选中项,并选中之前未被选中项",shortcut:"Ctrl+F",onClick:O},{default:U.withCtx(()=>[...A[9]||(A[9]=[U.createTextVNode("反选 ",-1)])]),_:1})):U.createCommentVNode("",!0)])]),_:1},8,["data"])),[[U.unref(v.vLoading),U.unref(h)]])])])]),_:1},8,["modelValue"]))}}),[["__scopeId","data-v-90712d51"]])),Hr=Nl(U.defineComponent({__name:"Scrollbar",props:{ariaLabel:{},ariaOrientation:{},distance:{},height:{},maxHeight:{},native:{type:Boolean},wrapStyle:{},wrapClass:{},viewClass:{},viewStyle:{},noresize:{type:Boolean},tag:{},always:{type:Boolean},minSize:{},tabindex:{},id:{},role:{}},setup(e,{expose:l}){const t=e,d=U.ref(),n=U.ref([]),a=new Map;l({elScrollbar:d}),U.provide(Or,n);let i=!1;U.watch(n,()=>{i&&c()},{deep:!0});const s=new IntersectionObserver(o=>{o.forEach(h=>{const V=a.get(h.target);V==null||V.onInView(h.isIntersecting)})});async function c(){var h;await U.nextTick();const o=(h=d.value)==null?void 0:h.$el;if(!(!n.value||!o)){try{for(let V=0;V<n.value.length;V++)if(n.value[V]){const W=n.value[V],Q=W.childElement.getBoundingClientRect(),m=o.getBoundingClientRect();Q.top>=m.top&&Q.bottom<=m.bottom&&Q.left>=m.left&&Q.right<=m.right&&W.onInView(!0),a.set(W.childElement,W),s.observe(W.childElement)}}finally{n.value&&n.value.splice(0)}i=!0}}U.onMounted(async()=>{await c()}),U.onUnmounted(()=>{a.forEach(o=>{s.disconnect()})});const F=U.computed(()=>t);return(o,h)=>(U.openBlock(),U.createBlock(U.unref(v.ElScrollbar),U.mergeProps({ref_key:"scroll",ref:d,class:"scroll-container"},{...F.value,...o.$attrs}),U.createSlots({_:2},[U.renderList(o.$slots,(V,W)=>({name:W,fn:U.withCtx(()=>[U.renderSlot(o.$slots,W)])}))]),1040))}}));function K9(e,l){for(var t=-1,d=e==null?0:e.length,n=Array(d);++t<d;)n[t]=l(e[t],t,e);return n}var H9=Array.isArray,my=FU?FU.prototype:void 0,Ny=my?my.toString:void 0;function Pr(e){if(typeof e=="string")return e;if(H9(e))return K9(e,Pr)+"";if(cy(e))return Ny?Ny.call(e):"";var l=e+"";return l=="0"&&1/e==-1/0?"-0":l}function P9(e,l,t,d){for(var n=e.length,a=t+-1;++a<n;)if(l(e[a],a,e))return a;return-1}function A9(e){return e!==e}function _9(e,l,t){for(var d=t-1,n=e.length;++d<n;)if(e[d]===l)return d;return-1}function Ry(e,l,t){return l===l?_9(e,l,t):P9(e,A9,t)}function q9(e){return e==null?"":Pr(e)}function $9(e,l,t){var d=-1,n=e.length;l<0&&(l=-l>n?0:n+l),t=t>n?n:t,t<0&&(t+=n),n=l>t?0:t-l>>>0,l>>>=0;for(var a=Array(n);++d<n;)a[d]=e[d+l];return a}function lx(e,l,t){var d=e.length;return t=t===void 0?d:t,!l&&t>=d?e:$9(e,l,t)}var tx="\\ud800-\\udfff",ex="\\u0300-\\u036f",dx="\\ufe20-\\ufe2f",nx="\\u20d0-\\u20ff",ax=ex+dx+nx,ix="\\ufe0e\\ufe0f",sx="\\u200d",cx=RegExp("["+sx+tx+ax+ix+"]");function Ux(e){return cx.test(e)}function Zx(e){return e.split("")}var ry="\\ud800-\\udfff",Fx="\\u0300-\\u036f",ox="\\ufe20-\\ufe2f",hx="\\u20d0-\\u20ff",Vx=Fx+ox+hx,Wx="\\ufe0e\\ufe0f",Qx="["+ry+"]",Ar="["+Vx+"]",_r="\\ud83c[\\udffb-\\udfff]",mx="(?:"+Ar+"|"+_r+")",by="[^"+ry+"]",uy="(?:\\ud83c[\\udde6-\\uddff]){2}",py="[\\ud800-\\udbff][\\udc00-\\udfff]",Nx="\\u200d",My=mx+"?",Sy="["+Wx+"]?",Rx="(?:"+Nx+"(?:"+[by,uy,py].join("|")+")"+Sy+My+")*",rx=Sy+My+Rx,bx="(?:"+[by+Ar+"?",Ar,uy,py,Qx].join("|")+")",ux=RegExp(_r+"(?="+_r+")|"+bx+rx,"g");function px(e){return e.match(ux)||[]}function Ty(e){return Ux(e)?px(e):Zx(e)}function Mx(e,l){for(var t=e.length;t--&&Ry(l,e[t],0)>-1;);return t}function Sx(e,l){for(var t=-1,d=e.length;++t<d&&Ry(l,e[t],0)>-1;);return t}function Tx(e,l,t){if(e=q9(e),e&&l===void 0)return ay(e);if(!e||!(l=Pr(l)))return e;var d=Ty(e),n=Ty(l),a=Sx(d,n),i=Mx(d,n)+1;return lx(d,a,i).join("")}const T0=new Map,vW={mounted(e){let l;if(e instanceof HTMLInputElement)l=setTimeout(()=>e==null?void 0:e.focus(),500),T0.set(e,l);else{const t=e.querySelectorAll("input");t.length>0&&t.item(0)instanceof HTMLInputElement&&(l=setTimeout(()=>{var d;return(d=t==null?void 0:t.item(0))==null?void 0:d.focus()},500),T0.set(e,l))}},onUnmounted(e){T0.has(e)&&(clearTimeout(T0.get(e)),T0.delete(e))}},Jx={class:"ja-custom-group-manager"},Gx=ht(U.defineComponent({__name:"CustomGroupManager",props:{users:{default:()=>[]}},setup(e,{expose:l}){const t=U.ref(!1),d=$.createAxiosWithoutCache(),n=$.useCustomGroupApi(d),a=U.ref(),i={label:"name",children:"children",isLeaf:(S,G)=>!S.hasChildren,class:S=>{var G;return S.id===((G=s.value)==null?void 0:G.id)?"selected-group":"group"}},s=U.ref(),c=U.ref(!1),F=U.ref(),o=$.useLoading(d),h=e,V={};async function W(){const S=es(await n.getAll()),G={id:"-1",name:"[顶级组]",children:S,dataVersion:0,hasChildren:S.length>0,label:"",parentId:void 0,sortIndex:0,sortPath:""};return a.value=[G],G}async function Q(){s.value=await W()}function m(S){s.value=S}function N(){F.value=void 0,c.value=!0}async function b(){var S,G;await n.create({name:F.value,parentId:((S=s.value)==null?void 0:S.id)=="-1"||(G=s.value)==null?void 0:G.id}),c.value=!1,await W()}async function r(){s.value&&s.value.id!=="-1"&&(await v.ElMessageBox.confirm("确定要删除选中的自定义组?","确认删除"),await n.delete(s.value.id),await W(),s.value=void 0)}async function u(){var S;if(!s.value||s.value.id==="-1"){v.ElMessage.warning("请选择要保存到的自定义用户组");return}await n.setMembers({id:s.value.id,userIds:((S=h.users)==null?void 0:S.map(G=>G.id))??[]},V),t.value=!1}return l({show(){t.value=!0},close(){t.value=!1}}),(S,G)=>(U.openBlock(),U.createElementBlock(U.Fragment,null,[U.createVNode(U.unref(v.ElDialog),{modelValue:t.value,"onUpdate:modelValue":G[1]||(G[1]=J=>t.value=J),"destroy-on-close":"","append-to-body":"",draggable:"",title:"保存为自定义组",width:"360",onOpen:Q},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{type:"primary",shortcut:"Alt+O",loading:U.unref(o),onClick:u},{default:U.withCtx(()=>[...G[6]||(G[6]=[U.createTextVNode("确定 ",-1)])]),_:1},8,["loading"]),U.createVNode(U.unref(v.ElButton),{onClick:G[0]||(G[0]=J=>t.value=!1)},{default:U.withCtx(()=>[...G[7]||(G[7]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createElementVNode("div",Jx,[U.createVNode(U.unref(v.ElSpace),null,{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElText),null,{default:U.withCtx(()=>[...G[5]||(G[5]=[U.createTextVNode("请创建或选择要保存为的自定义组:",-1)])]),_:1}),U.createVNode(U.unref(Vt),{circle:"",icon:U.unref(ml.Plus),tooltip:"添加自定义组",shortcut:"Alt+G",size:"small",onClick:N,loading:U.unref(o)},null,8,["icon","loading"]),U.createVNode(U.unref(Vt),{circle:"",icon:U.unref(ml.Minus),tooltip:"删除自定义组",shortcut:"Alt+D",size:"small",onClick:r,loading:U.unref(o)},null,8,["icon","loading"])]),_:1}),U.createVNode(U.unref(v.ElScrollbar),{height:"360px"},{default:U.withCtx(()=>{var J;return[U.createVNode(U.unref(v.ElTree),{data:a.value,"node-key":"id",props:i,"default-expand-all":"","expand-on-click-node":!1,onCurrentChange:m,"current-node-key":((J=s.value)==null?void 0:J.id)??-1},null,8,["data","current-node-key"])]}),_:1})])]),_:1},8,["modelValue"]),U.createVNode(U.unref(v.ElDialog),{modelValue:c.value,"onUpdate:modelValue":G[4]||(G[4]=J=>c.value=J),"destroy-on-close":"","append-to-body":"",title:"添加自定义组",width:"360px"},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{type:"primary",shortcut:"Alt+P",onClick:b,loading:U.unref(o),size:"default"},{default:U.withCtx(()=>[...G[8]||(G[8]=[U.createTextVNode(" 确定 ",-1)])]),_:1},8,["loading"]),U.createVNode(U.unref(v.ElButton),{onClick:G[3]||(G[3]=J=>c.value=!1),size:"default"},{default:U.withCtx(()=>[...G[9]||(G[9]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createVNode(U.unref(v.ElForm),{"label-position":"top"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElFormItem),{label:"自定义组名",required:""},{default:U.withCtx(()=>[U.withDirectives(U.createVNode(U.unref(v.ElInput),{modelValue:F.value,"onUpdate:modelValue":G[2]||(G[2]=J=>F.value=J),style:{width:"100%"}},null,8,["modelValue"]),[[U.unref(vW)]])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),[["__scopeId","data-v-1bab28b9"]]),yx={class:"ja-user-list"},Xx=["onMouseenter","onMousedown","onMouseover"],Bx={key:0,class:"page-indicator"},Yx={class:"nb-spinner"},kx=1,Jy=ht(U.defineComponent({__name:"JaUserList",props:U.mergeModels({emptyText:{},multiple:{type:Boolean},total:{},pageSize:{},height:{},loading:{type:Boolean},users:{},maxSelect:{}},{modelValue:{required:!0},modelModifiers:{},page:{required:!0},pageModifiers:{}}),emits:U.mergeModels(["arrowKeyDown","itemClicked"],["update:modelValue","update:page"]),setup(e,{expose:l,emit:t}){const d=e,n=U.ref(0),a=U.ref(),i=U.ref(!1),s=U.useModel(e,"modelValue"),c=U.useModel(e,"page"),F=t,h=M0(()=>{var E;const O=(E=a.value)==null?void 0:E.wrapRef;O&&O.scrollHeight-O.scrollTop<=O.clientHeight+kx&&c.value<d.total/d.pageSize&&c.value++},200);function V(O){if(d.multiple){if(!Array.isArray(s.value))throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组");const E=s.value.findIndex(j=>j.id==O.id);if(E<0){if(d.maxSelect&&d.maxSelect>0&&s.value.length>=d.maxSelect){v.ElMessage({message:`已超过最大选择数量 ${d.maxSelect}`,plain:!0,type:"warning"});return}s.value.push(O)}else s.value.splice(E,1)}else{if(Array.isArray(s.value))throw new Error("UserPicker组件设置为单选模式时,v-model必须绑定UserReference对象或null");s.value!==null&&O.id===s.value.id?s.value=null:s.value=O}}let W;function Q(O){V(O),i.value=!0,W=O}function m(){i.value=!1,F("itemClicked",W),W=void 0}function N(O){console.log("点击"),i.value&&V(O)}function b(){n.value<d.users.length-1&&n.value++,u()}function r(){n.value>0&&n.value--,u()}const u=()=>{U.nextTick(()=>{var j,C,B;const O=(j=a.value)==null?void 0:j.$refs.wrapRef,E=O==null?void 0:O.querySelectorAll("li")[n.value];if(E&&O){const X=E.offsetTop,k=E.offsetTop+E.offsetHeight,w=O.scrollTop,D=O.scrollTop+O.clientHeight;k>D?(C=a.value)==null||C.scrollTo(0,k-O.clientHeight+E.offsetHeight-38):X<w&&((B=a.value)==null||B.scrollTo(0,X))}})},S=M0(b,100),G=M0(r,100);function J(O,E){var j;if(n.value=E,i.value=O.buttons>0,i.value){const C=(j=a.value)==null?void 0:j.$refs.wrapRef,B=O.target;if(B&&C){const X=B.offsetTop,k=B.offsetTop+B.offsetHeight,w=C.scrollTop,D=C.scrollTop+C.clientHeight;k+20>D?S():X<w+20&&G()}}}function Y(O){var E;if(d.multiple){if(!Array.isArray(s.value))throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组");return s.value.some(j=>j.id===O.id)}else{if(Array.isArray(s.value))throw new Error("UserPicker组件设置为单选模式时,v-model必须绑定UserReference对象");return((E=s.value)==null?void 0:E.id)===O.id}}const L=O=>{var E;return Array.isArray(y.value)?y.value.some(j=>j.id===O.id)?"autumnOrange":"skyGray":((E=y.value)==null?void 0:E.id)===O.id?"autumnOrange":"skyGray"},y=U.computed(()=>{const O=Array.isArray(s.value);if(d.multiple&&O)return s.value;if(!d.multiple&&!O)return s.value?[s.value]:[];if(!d.multiple&&O)return s.value;throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组")});function z(O){return O===n.value?"active":""}const I=U.computed(()=>d.loading&&d.users.length==0);return l({scrollUp(){r()},scrollDown(){b()},activeIndex:n}),U.watch(()=>d.users,()=>{n.value=0},{deep:!1}),U.onUnmounted(()=>{S.cancel(),G.cancel(),h.cancel()}),(O,E)=>(U.openBlock(),U.createElementBlock("div",yx,[U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElScrollbar),{height:e.height,ref_key:"scrollbar",ref:a,always:"",onScroll:U.unref(h)},{default:U.withCtx(()=>[e.users.length>0?(U.openBlock(),U.createElementBlock("ul",{key:0,onMouseup:m},[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(e.users,(j,C)=>(U.openBlock(),U.createElementBlock("li",{key:j.id,class:U.normalizeClass(z(C)),onMouseenter:B=>i.value&&N(j),onMousedown:B=>Q(j),onMouseover:B=>J(B,C)},[U.createVNode(U.unref(v.ElIcon),{color:"#0D6A9F"},{default:U.withCtx(()=>[Y(j)?(U.openBlock(),U.createBlock(U.unref(ml.Check),{key:0})):U.createCommentVNode("",!0)]),_:2},1024),U.createVNode(U.unref(ZU),{"user-id":j.id,"full-name":j.fullName,placement:"left-start",theme:L(j)},null,8,["user-id","full-name","theme"])],42,Xx))),128))],32)):(U.openBlock(),U.createBlock(U.unref(v.ElEmpty),{key:1,description:e.emptyText},null,8,["description"]))]),_:1},8,["height","onScroll"])),[[U.unref(v.vLoading),I.value]]),e.users.length>0?(U.openBlock(),U.createElementBlock("div",Bx,[U.withDirectives(U.createElementVNode("div",Yx,null,512),[[U.vShow,e.loading]]),U.createTextVNode(" 已加载 "+U.toDisplayString(c.value)+" /"+U.toDisplayString(Math.ceil(e.total/e.pageSize))+"页 ",1)])):U.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-bf81e728"]]),zx={class:"ja-user-picker__root"},Lx={style:{display:"flex","align-items":"center"}},Ix={class:"ja-user-picker-bookmark__dropdown"},Dx={style:{width:"100%",display:"flex","align-content":"center","justify-content":"end","margin-bottom":"4px"}},wx={style:{color:"var(--el-color-info-light-5)"}},Ex={class:"dropdown-header"},Cx={key:0,class:"ja-user-picker__tag-container"},xx={key:0,class:"more-tag"},gx={key:1},J0=0,Gy=ht(U.defineComponent({__name:"UserPicker",props:U.mergeModels({trigger:{default:"hover"},realmId:{},shortcut:{default:"Ctrl+Alt+U"},multiple:{type:Boolean,default:!1},classificationLevel:{default:0},customFilter:{},maxShowCount:{default:20},height:{},maxHeight:{default:"100%"},showUserTag:{type:Boolean,default:!0},maxSelect:{default:0},disabled:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=U.ref(),d=U.ref();async function n(){if(l.realmId)t.value=l.realmId;else{const D=await OW().getDefaultRealm();t.value=D.id}}n(),U.watch(()=>l.realmId,n);const a=$.createAxiosWithoutCache(),i=$.useUserApi(a),s=U.shallowRef([]),c=U.useModel(e,"modelValue"),F=U.ref(),o=U.ref(!1),{queryResult:h,queryParams:V,pageParams:W,loading:Q}=gr(()=>V.value.name!=null&&V.value.name.length>J0,l.customFilter,(D,x)=>{var K,A;D?(s.value=h.value.users,x&&((A=(K=N.value)==null?void 0:K.elScrollbar)==null||A.scrollTo(0,0))):G()},!0,a,!1),m=U.ref(),N=U.ref(),b=U.ref(),r=U.ref(),u=U.ref();function S(D){if(l.multiple){if(!Array.isArray(c.value))throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组");const x=c.value.findIndex(K=>K.id==D.id);if(x<0){if(l.maxSelect>0&&c.value.length>=l.maxSelect){v.ElMessage({message:`已超过最大选择数量 ${l.maxSelect}`,plain:!0,type:"warning"});return}c.value.push(D)}else c.value.splice(x,1)}else{if(Array.isArray(c.value))throw new Error("UserPicker组件设置为单选模式时,v-model必须绑定UserReference对象或者null");c.value!==null&&D.id===c.value.id?c.value=null:c.value=D}}function G(){l.realmId&&(V.value.realmId=l.realmId),V.value.name&&V.value.name.length>J0&&(V.value.name=void 0);const D=$.useUserQueryBuilder();if(l.customFilter){const x=D.getQEntity();D.and(l.customFilter(x))}i.getBookmarkedUsers(D.build()).then(x=>{s.value=x}),setTimeout(()=>{var x;(x=F.value)==null||x.focus()},300)}function J(){var D;o.value=!1,(D=m.value)==null||D.$el.focus()}function Y(){var D;(D=r.value)==null||D.show()}function L(D){if(!l.disabled)if(Array.isArray(c.value)){const x=c.value.findIndex(K=>K.id==D);x>=0&&c.value.splice(x,1)}else c.value=null}function y(){var D;u.value.scrollDown(),(D=F.value)==null||D.focus()}function z(){var D;u.value.scrollUp(),(D=F.value)==null||D.focus()}function I(){var D;S(s.value[(D=u.value)==null?void 0:D.activeIndex])}function O(){l.disabled||(o.value=!0)}function E(){const D=c.value,x=s.value.filter(K=>!D.some(A=>A.id===K.id));if(l.maxSelect>0){const K=l.maxSelect-D.length;K>0&&D.push(...x.slice(0,K))}else D.push(...x)}function j(){l.multiple?c.value=[]:c.value=null}function C(){var D;(D=F.value)==null||D.focus()}const B=U.computed(()=>{if(l.multiple&&Array.isArray(c.value))return c.value;if(!l.multiple&&!Array.isArray(c.value))return c.value?[c.value]:[];throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组")});function X(){var D;l.disabled||((D=b.value)==null||D.show(),o.value=!1)}function k(){l.disabled||(o.value=!0)}const w=U.computed(()=>B.value.slice(0,l.maxShowCount));return U.watch(()=>l.classificationLevel,()=>{V.value.classificationLevel=l.classificationLevel}),(D,x)=>(U.openBlock(),U.createElementBlock(U.Fragment,null,[U.createVNode(U.unref(Hr),U.mergeProps({"max-height":l.maxHeight,height:l.height},D.$attrs,{style:{"overflow-x":"hidden"}}),{default:U.withCtx(()=>[U.withDirectives((U.openBlock(),U.createElementBlock("div",zx,[U.createVNode(U.unref(v.ElPopover),{ref_key:"bookmarkDropdown",ref:d,onShow:G,onHide:J,visible:o.value,"onUpdate:visible":x[3]||(x[3]=K=>o.value=K),width:"auto",teleported:"",trigger:l.trigger,disabled:l.disabled},{reference:U.withCtx(()=>[U.createElementVNode("div",Lx,[D.$slots.default?U.renderSlot(D.$slots,"default",{key:0},void 0,!0):(U.openBlock(),U.createBlock(U.unref(v.ElButton),{key:1,circle:"",icon:U.unref(ml.Plus),size:"small",ref_key:"btn",ref:m,disabled:l.disabled,onMouseover:k},null,8,["icon","disabled"]))])]),default:U.withCtx(()=>[U.createElementVNode("div",Ix,[U.createElementVNode("div",Dx,[U.createVNode(U.unref(v.ElSpace),{style:{flex:"auto"}},{default:U.withCtx(()=>[U.createVNode(U.unref(Vt),{circle:"",size:"small",onClick:X,plain:"",type:"primary",tooltip:"对话框筛选(大批量选择)",shortcut:"Ctrl+Alt+I",icon:U.unref(ml.Notebook)},null,8,["icon"]),U.createVNode(U.unref(Vt),{circle:"",size:"small",onClick:j,type:"danger",plain:"",icon:U.unref(ml.Delete),tooltip:"清空选择",shortcut:"Alt+C"},null,8,["icon"]),l.multiple?(U.openBlock(),U.createBlock(U.unref(Vt),{key:0,circle:"",size:"small",onClick:E,type:"success",plain:"",icon:U.unref(ml.Finished),tooltip:"全选(已加载的数据)",shortcut:"Ctrl+A"},null,8,["icon"])):U.createCommentVNode("",!0),U.createVNode(U.unref(Vt),{circle:"",size:"small",onClick:Y,type:"warning",icon:U.unref(ml.Setting),plain:"",tooltip:"将已选中用户保存为自定义组,方便以后选择使用"},null,8,["icon"])]),_:1}),U.createElementVNode("div",wx," 弹出快捷键:"+U.toDisplayString(l.shortcut),1)]),U.createVNode(U.unref(v.ElInput),{modelValue:U.unref(V).name,"onUpdate:modelValue":x[0]||(x[0]=K=>U.unref(V).name=K),ref_key:"inputSearchText",ref:F,"suffix-icon":U.unref(ml.Search),placeholder:"请输入拼音名、姓名或手机号查询",autocomplete:"off",onKeydown:[U.withKeys(I,["enter"]),U.withKeys(U.withModifiers(z,["stop","prevent"]),["up"]),U.withKeys(U.withModifiers(y,["stop","prevent"]),["down"])]},null,8,["modelValue","suffix-icon","onKeydown"]),U.createElementVNode("div",Ex,[U.createVNode(U.unref(v.ElText),null,{default:U.withCtx(()=>[U.unref(V).name&&U.unref(V).name.length>J0?(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:0},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.Search))]),_:1})):(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:1,color:"#FFBF29"},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.StarFilled))]),_:1})),U.createTextVNode(" "+U.toDisplayString(U.unref(V).name&&U.unref(V).name.length>J0?"查询结果":"常用人员"),1)]),_:1})]),U.createVNode(Jy,{ref_key:"userList",ref:u,total:U.unref(h).total,"empty-text":U.unref(V).name&&U.unref(V).name.length>J0?void 0:"无可选常用人员","page-size":U.unref(W).pageSize,loading:U.unref(Q),users:s.value,height:300,modelValue:c.value,"onUpdate:modelValue":x[1]||(x[1]=K=>c.value=K),page:U.unref(W).currentPage,"onUpdate:page":x[2]||(x[2]=K=>U.unref(W).currentPage=K),multiple:l.multiple,maxSelect:l.maxSelect,onItemClicked:C,onArrowKeyDown:C},null,8,["total","empty-text","page-size","loading","users","modelValue","page","multiple","maxSelect"])])]),_:3},8,["visible","trigger","disabled"]),l.showUserTag?(U.openBlock(),U.createElementBlock("div",Cx,[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(w.value,K=>(U.openBlock(),U.createBlock(U.unref(ZU),{key:K.id,"user-id":K.id,"full-name":K.fullName,closable:!l.disabled,"has-avatar":K.hasAvatar,onClosed:L},null,8,["user-id","full-name","closable","has-avatar"]))),128)),B.value.length>l.maxShowCount?(U.openBlock(),U.createElementBlock("div",xx," +"+U.toDisplayString(B.value.length-l.maxShowCount)+"人 ",1)):U.createCommentVNode("",!0),B.value.length===0?(U.openBlock(),U.createElementBlock("div",gx,[U.createVNode(U.unref(v.ElText),{type:"info"},{default:U.withCtx(()=>[...x[5]||(x[5]=[U.createTextVNode(" <暂无选中人员>",-1)])]),_:1})])):U.createCommentVNode("",!0)])):U.createCommentVNode("",!0),U.createVNode(U.unref(Kr),{ref_key:"dialogUserSelector",ref:b,multiple:l.multiple,"realm-id":t.value,classificationLevel:l.classificationLevel,customFilter:l.customFilter,maxSelect:l.maxSelect,modelValue:c.value,"onUpdate:modelValue":x[4]||(x[4]=K=>c.value=K)},null,8,["multiple","realm-id","classificationLevel","customFilter","maxSelect","modelValue"])])),[[U.unref(CW),l.disabled?void 0:O,l.shortcut]])]),_:3},16,["max-height","height"]),U.createVNode(Gx,{ref_key:"dlgCustomGroupManager",ref:r,users:Array.isArray(c.value)?c.value:c.value?[c.value]:null},null,8,["users"])],64))}}),[["__scopeId","data-v-8c204f38"]]),jx=U.defineComponent({__name:"JaUserPicker",emits:["change"],setup(e,{emit:l}){const t=U.inject("aceFormModel"),d=U.inject("aceFormItemProp"),n=U.inject("aceFormValidator"),a=l;function i(c){n.removeFieldError(d),bt(t.formData,d,s.value),a("change",c)}const s=U.ref(Ml(t.formData,d)??[]);return U.watch(()=>t.formData,()=>{s.value=Ml(t.formData,d)??[]},{deep:!0}),(c,F)=>(U.openBlock(),U.createBlock(Gy,U.mergeProps({modelValue:s.value,"onUpdate:modelValue":F[0]||(F[0]=o=>s.value=o),onChange:i},c.$attrs),{default:U.withCtx(()=>[U.renderSlot(c.$slots,"default")]),_:3},16,["modelValue"]))}}),yy=Nl(Gy),Xy=Nl(jx),By=Nl(Jy),Yy=Nl(U.defineComponent({__name:"JaTimePicker",props:{showNow:{type:Boolean},showConfirm:{type:Boolean},showFooter:{type:Boolean},showWeekNumber:{type:Boolean},ariaLabel:{},emptyValues:{},valueOnClear:{},disabledDate:{},cellClassName:{},shortcuts:{},arrowControl:{type:Boolean},tabindex:{},validateEvent:{type:Boolean},unlinkPanels:{type:Boolean},placement:{},fallbackPlacements:{},disabledHours:{},disabledMinutes:{},disabledSeconds:{},automaticDropdown:{type:Boolean},id:{},name:{},popperClass:{},popperStyle:{},format:{},valueFormat:{},dateFormat:{},timeFormat:{},type:{},clearable:{type:Boolean},clearIcon:{},editable:{type:Boolean},prefixIcon:{},size:{},readonly:{type:Boolean},disabled:{type:Boolean},placeholder:{},popperOptions:{},modelValue:{},rangeSeparator:{},startPlaceholder:{},endPlaceholder:{},defaultValue:{},defaultTime:{},isRange:{type:Boolean}},emits:["change"],setup(e,{expose:l,emit:t}){const d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=t,c=e,F=U.ref({});function o(W){i.removeFieldError(a),bt(n.formData,a,h.value),s("change",W)}const h=U.ref(Ml(n.formData,a));U.watch(()=>n.formData,()=>{h.value=Ml(n.formData,a)},{deep:!0});const V=U.computed(()=>{const{modelValue:W,...Q}=c;return Q});return U.onMounted(()=>{d.value&&Object.entries(d.value).filter(([Q,m])=>m instanceof Function).forEach(([Q,m])=>{F.value[Q]=m})}),l(F.value),(W,Q)=>(U.openBlock(),U.createBlock(U.unref(v.ElTimePicker),U.mergeProps({ref_key:"input",ref:d,modelValue:U.unref(n).formData[U.unref(a)],"onUpdate:modelValue":Q[0]||(Q[0]=m=>U.unref(n).formData[U.unref(a)]=m),onChange:o},{...V.value,...W.$attrs}),U.createSlots({_:2},[U.renderList(W.$slots,(m,N)=>({name:N,fn:U.withCtx(()=>[U.renderSlot(W.$slots,N)])}))]),1040,["modelValue"]))}})),ky=Nl(U.defineComponent({__name:"UserGroupPicker",props:U.mergeModels({realmId:{},appId:{},modelValue:{},size:{default:"default"},multiple:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change"],["update:modelValue"]),setup(e,{emit:l}){const t=$.createAxiosWithoutCache(),d=$.useUserGroupApi(t),n=e,a=U.useModel(e,"modelValue"),i=l;if(n.multiple&&!Array.isArray(a.value))throw new Error("用户组选择器设置multiple为true,但是绑定的v-model值是单值");if(!n.multiple&&Array.isArray(a.value))throw new Error("用户组选择器未设置multiple为true,但是绑定的v-model值是数组");const s=U.reactive({groups:[]}),c=()=>{!n.realmId||!n.appId||d.getByAppIdAndRealm(n.appId,n.realmId??"0").then(o=>{s.groups=[...es(o,"name")],!a.value&&!n.multiple&&(a.value=s.groups[0].id)})},F=o=>{i("change",Array.isArray(o)?s.groups.filter(h=>o.findIndex(V=>h.id===V)>=0):s.groups.find(h=>h.id===o))};return c(),U.watch(()=>n.realmId,()=>{c()}),U.watch(()=>n.appId,c),(o,h)=>(U.openBlock(),U.createBlock(U.unref(v.ElTreeSelect),U.mergeProps({style:{width:"100%"},data:s.groups,size:n.size,"node-key":"id","check-strictly":"","current-node-key":a.value,"highlight-current":"",modelValue:a.value,"onUpdate:modelValue":h[0]||(h[0]=V=>a.value=V),multiple:e.multiple,onChange:F},o.$attrs,{"collapse-tags":"","collapse-tags-tooltip":"","tag-type":"info",teleported:""}),null,16,["data","size","current-node-key","modelValue","multiple"]))}})),zy=Nl(U.defineComponent({__name:"JaAutoComplete",props:{valueKey:{},modelValue:{},debounce:{},placement:{},fetchSuggestions:{},popperClass:{},popperStyle:{},triggerOnFocus:{type:Boolean},selectWhenUnmatched:{type:Boolean},hideLoading:{type:Boolean},teleported:{type:Boolean},appendTo:{},highlightFirstItem:{type:Boolean},fitInputWidth:{type:Boolean},loopNavigation:{type:Boolean},inputmode:{},name:{},ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelModifiers:{},maxlength:{},minlength:{},type:{},resize:{},autosize:{},autocomplete:{},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},clearIcon:{},showPassword:{type:Boolean},showWordLimit:{type:Boolean},wordLimitPosition:{},suffixIcon:{},prefixIcon:{},containerRole:{},tabindex:{},validateEvent:{type:Boolean},inputStyle:{},autofocus:{type:Boolean},rows:{}},emits:["change"],setup(e,{expose:l,emit:t}){const d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=t;function c(V){i.removeFieldError(a),bt(n.formData,a,F.value),s("change",V)}const F=U.ref(Ml(n.formData,a));U.watch(()=>n.formData,()=>{F.value=Ml(n.formData,a)},{deep:!0}),l({elAutocomplete:d});const o=e,h=U.computed(()=>o);return(V,W)=>(U.openBlock(),U.createBlock(U.unref(v.ElAutocomplete),U.mergeProps({ref_key:"input",ref:d,modelValue:F.value,"onUpdate:modelValue":W[0]||(W[0]=Q=>F.value=Q),onChange:c},{...h.value,...V.$attrs}),U.createSlots({_:2},[U.renderList(V.$slots,(Q,m)=>({name:m,fn:U.withCtx(()=>[U.renderSlot(V.$slots,m)])}))]),1040,["modelValue"]))}})),Ly=Nl(U.defineComponent({__name:"JaRadioGroup",props:{ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelValue:{},fill:{},textColor:{},name:{},validateEvent:{type:Boolean},options:{},props:{},type:{}},emits:["change"],setup(e,{expose:l,emit:t}){const d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=t,c=e;function F(V){i.removeFieldError(a),bt(n.formData,a,o.value),s("change",V)}const o=U.ref(Ml(n.formData,a));U.watch(()=>n.formData,()=>{o.value=Ml(n.formData,a)},{deep:!0});const h=U.computed(()=>{const{modelValue:V,...W}=c;return W});return l({focus:()=>{var V,W;return(W=(V=d.value)==null?void 0:V.focus)==null?void 0:W.call(V)},blur:()=>{var V,W;return(W=(V=d.value)==null?void 0:V.blur)==null?void 0:W.call(V)},elRadioGroup:d}),(V,W)=>(U.openBlock(),U.createBlock(U.unref(v.ElRadioGroup),U.mergeProps({ref_key:"input",ref:d,modelValue:o.value,"onUpdate:modelValue":W[0]||(W[0]=Q=>o.value=Q),onChange:F},{...h.value,...V.$attrs}),U.createSlots({_:2},[U.renderList(V.$slots,(Q,m)=>({name:m,fn:U.withCtx(()=>[U.renderSlot(V.$slots,m)])}))]),1040,["modelValue"]))}})),fW=new Map;let qr=new Map;function $r(){return{refreshRolesCache(e){fW.delete(e),console.log("roles cache cleared for app:",e,fW.get(e))},async getRoles(e){let l=fW.get(e);if(l)return l;let t=qr.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useRoleApi(d).getAllRole(e).then(a=>(fW.set(e,a),a)).finally(()=>{qr.delete(e)}),qr.set(e,t),await t}}}const Ox=U.defineComponent({__name:"baseRolePicker",props:U.mergeModels({appName:{}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change"],["update:modelValue"]),setup(e,{expose:l,emit:t}){const{getRoles:d}=$r(),n=e,a=U.ref(),i=U.ref([]),s=hU(),c=async()=>{n.appName&&(a.value=await s.getByName(n.appName),i.value=await d(a.value.id),F.value?h.value=m(F.value,i.value):h.value=void 0)},F=U.useModel(e,"modelValue"),o=t,h=U.ref();U.watch(()=>n.appName,c),c();const V={label:N=>N.caption?N.caption:N.name,isLeaf:N=>!N.hasChildren},W=U.ref();function Q(N){h.value=m(N,i.value),o("change",N)}function m(N,b){for(let r=0;r<b.length;r++){if(b[r].name===N)return b[r];const u=b[r].children;if(u){const S=m(N,u);if(S)return S}}}return l({loadData:c,currentRole:h,elTreeSelect:W}),(N,b)=>(U.openBlock(),U.createBlock(U.unref(v.ElTreeSelect),U.mergeProps({ref_key:"select",ref:W,data:i.value,"node-key":"name","current-node-key":F.value,"value-key":"name",props:V},N.$attrs,{clearable:"","check-strictly":"","highlight-current":!0,onChange:Q,modelValue:F.value,"onUpdate:modelValue":b[0]||(b[0]=r=>F.value=r)}),U.createSlots({_:2},[U.renderList(N.$slots,(r,u)=>({name:u,fn:U.withCtx(()=>[U.renderSlot(N.$slots,u)])}))]),1040,["data","current-node-key","modelValue"]))}}),vx=U.defineComponent({__name:"I18nBundleEditor",props:U.mergeModels({appId:{},preKey:{}},{modelValue:{type:Boolean,default:!1,required:!0},modelModifiers:{}}),emits:U.mergeModels(["success"],["update:modelValue"]),setup(e,{emit:l}){const t=U.useModel(e,"modelValue"),d=e,n=$.createAxiosWithoutCache(),a=$.useAppMessageApi(n),i=U.ref(),s=U.ref(""),c=U.ref({}),F=l,o=hU();function h(){W(),s.value=d.preKey??"",c.value={}}async function V(){const Q={key:s.value,messages:c.value,appInstance:{id:d.appId}};await a.createBundle(Q),t.value=!1,F("success",s.value)}async function W(){i.value=await o.getById(d.appId)}return U.watch(()=>d.appId,async()=>{await W()}),(Q,m)=>{const N=U.resolveDirective("focus");return U.openBlock(),U.createBlock(U.unref(v.ElDrawer),{"destroy-on-close":"","append-to-body":"",modelValue:t.value,"onUpdate:modelValue":m[2]||(m[2]=b=>t.value=b),title:"创建国际化文本",onOpen:h},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{size:"default",shortcut:"Alt+Enter",type:"primary",onClick:V},{default:U.withCtx(()=>[...m[3]||(m[3]=[U.createTextVNode("确定 ",-1)])]),_:1}),U.createVNode(U.unref(v.ElButton),{size:"default",plain:"",onClick:m[1]||(m[1]=b=>t.value=!1)},{default:U.withCtx(()=>[...m[4]||(m[4]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createVNode(U.unref(v.ElForm),{"label-position":"top",size:"default"},{default:U.withCtx(()=>{var b;return[U.createVNode(U.unref(v.ElFormItem),{label:"文本键",required:""},{default:U.withCtx(()=>[U.withDirectives(U.createVNode(U.unref(v.ElInput),{modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=r=>s.value=r)},null,8,["modelValue"]),[[N]])]),_:1}),(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList((b=i.value)==null?void 0:b.supportedLocales,r=>(U.openBlock(),U.createBlock(U.unref(v.ElFormItem),{key:r,label:r},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElInput),{type:"textarea",rows:4,modelValue:c.value[r],"onUpdate:modelValue":u=>c.value[r]=u},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"]))),128))]}),_:1})]),_:1},8,["modelValue"])}}}),fx={class:"ja-input-i18n"},lb=Nl(ht(U.defineComponent({__name:"InputI18n",props:U.mergeModels({appId:{},size:{default:"default"},textarea:{type:Boolean,default:!1},disabled:{type:Boolean}},{modelValue:{default:""},modelModifiers:{}}),emits:U.mergeModels(["change","focus","blur"],["update:modelValue"]),setup(e,{expose:l,emit:t}){const d=e,n=U.useModel(e,"modelValue"),a=$.createAxiosWithoutCache(),i=$.useAppMessageApi(a),s=$.useLoginUser().locale,c=U.ref(),F=U.ref(!1),o=U.ref(!1),h=U.ref(),V=U.ref(""),W=hU(),Q=U.ref(""),m=U.ref(""),N=U.ref(),b=t,r=xr(S,500);let u;async function S(z){if(z||(z=n.value),!d.appId)return;m.value=z;const I=await W.getById(d.appId);if(V.value=I.name,!z||z.length===0||!V.value){m.value="";return}let O=z;z&&z.length>0&&(O=Tx(O),O.startsWith("{")&&O.endsWith("}")&&(O=O.substring(1,O.length-1)));const j=(await i.getByKey(V.value,O,{cancelDuplicatedRequest:!1})).find(C=>C.locale===s);j&&(await U.nextTick(),m.value=j.message)}async function G(z){Q.value=z;const I=await W.getById(d.appId);V.value=I.name,c.value=await i.searchKeys(V.value,z)}async function J(){var z;F.value=!0,await U.nextTick(),b("focus"),(z=h.value)==null||z.focus()}function Y(){u=setTimeout(()=>{F.value=!1},200),b("blur")}U.onUnmounted(()=>{r.cancel(),u&&clearTimeout(u)}),U.watch(n,()=>{r()},{deep:!0}),m.value||r();function L(z){b("change",z)}async function y(z){await G(Q.value),n.value="{"+z+"}",N.value.focus}return l({focus(){N==null||N.value.focus()},blur(){h==null||h.value.blur()}}),(z,I)=>(U.openBlock(),U.createElementBlock("div",fx,[U.withDirectives(U.createVNode(U.unref(v.ElInput),{ref_key:"selectI18n",ref:N,onFocus:J,modelValue:m.value,"onUpdate:modelValue":I[0]||(I[0]=O=>m.value=O),size:e.size,disabled:e.disabled,type:e.textarea?"textarea":void 0},null,8,["modelValue","size","disabled","type"]),[[U.vShow,!F.value]]),U.withDirectives(U.createVNode(U.unref(v.ElSelect),{ref_key:"select",ref:h,filterable:"",remote:"","remote-method":G,disabled:e.disabled,"default-first-option":"","reserve-keyword":"","remote-show-suffix":"",onChange:L,size:e.size,"allow-create":"",clearable:"",onBlur:Y,modelValue:n.value,"onUpdate:modelValue":I[2]||(I[2]=O=>n.value=O)},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{link:"",style:{width:"100%"},type:"primary",onClick:I[1]||(I[1]=O=>o.value=!0),shortcut:"Alt+I"},{default:U.withCtx(()=>[...I[4]||(I[4]=[U.createTextVNode(" 新建国际化文本(Alt+I) ",-1)])]),_:1})]),default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(c.value,O=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:O,value:"{"+O+"}",label:"{"+O+"}"},null,8,["value","label"]))),128))]),_:1},8,["disabled","size","modelValue"]),[[U.vShow,F.value]]),U.createVNode(vx,{"app-id":e.appId,"pre-key":Q.value,modelValue:o.value,"onUpdate:modelValue":I[3]||(I[3]=O=>o.value=O),onSuccess:y},null,8,["app-id","pre-key","modelValue"])]))}}),[["__scopeId","data-v-298978b0"]])),tb=new Map;let eb=new Map;function Iy(){return{refreshRoleCategoryCache(e){tb.delete(e)},async getRoleCategories(e){let l=tb.get(e);if(l)return l;let t=eb.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useRoleCategoryApi(d).getAllRole(e).then(a=>(tb.set(e,a),a)).finally(()=>{eb.delete(e)}),eb.set(e,t),await t}}}const Kx=["onClick"],Hx={style:{flex:"1"}},Px={style:{display:"flex",padding:"0 20px 0 10px"}},Ax={style:{flex:"1"}},_x={key:0,style:{flex:"1","text-align":"right"}},Dy=U.defineComponent({__name:"RoleCategorySelector",props:U.mergeModels({appId:{},allowEdit:{type:Boolean}},{modelValue:{required:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=$.createAxiosWithoutCache(),d=$.useRoleCategoryApi(t),n=U.useModel(e,"modelValue"),{getRoleCategories:a,refreshRoleCategoryCache:i}=Iy(),s=U.ref([]),c=U.ref();async function F(){l.appId&&(s.value=await a(l.appId),s.value.length>0&&(n.value=s.value[0].name),console.log(`Loading categories for ${l.appId}`,s.value))}async function o(){if(!l.appId)throw new Error("appId 参数不能为空");c.value&&!await m()||(c.value={id:"0",name:"",app:{id:l.appId},dataVersion:0},s.value.push(c.value))}async function h(N){c.value&&!await m()||(c.value=N)}async function V(){c.value&&!await m()||(c.value=void 0)}async function W(N){if(c.value){if(!await m())return;c.value=void 0}await d.delete({id:N.id,dataVersion:N.dataVersion}),i(l.appId),s.value.splice(s.value.indexOf(N),1)}function Q(N,b){b===c.value&&(N.preventDefault(),N.stopPropagation())}async function m(){if(!c.value)return!0;if(!c.value.name||c.value.name.length<1)return v.ElMessage.error("类别名称不能为空"),!1;try{let N;return c.value.id=="0"?N=await d.create({name:c.value.name,app:c.value.app},{popValidationErrorNotification:!0}):N=await d.update({...c.value},{popValidationErrorNotification:!0}),i(l.appId),c.value.id=N.id,c.value.dataVersion=N.dataVersion,!0}catch{return!1}}return U.watch(()=>l.appId,F,{immediate:!0}),(N,b)=>(U.openBlock(),U.createBlock(U.unref(v.ElSelect),{modelValue:n.value,"onUpdate:modelValue":b[2]||(b[2]=r=>n.value=r),placeholder:"[未分类]"},{header:U.withCtx(()=>[U.createElementVNode("div",Px,[U.createElementVNode("div",Ax,[U.createVNode(U.unref(v.ElText),null,{default:U.withCtx(()=>[b[3]||(b[3]=U.createElementVNode("b",null,"业务分类",-1)),U.createVNode(U.unref(v.ElTooltip),{content:"业务分类限制角色只能授予同分类的用户组"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElIcon),null,{default:U.withCtx(()=>[U.createVNode(U.unref(ml.InfoFilled))]),_:1})]),_:1})]),_:1})]),e.allowEdit?(U.openBlock(),U.createElementBlock("div",_x,[U.createVNode(u0,{size:"small",type:"primary",plain:"",icon:U.unref(ml.Plus),shortcut:"Alt+A",link:"",tooltip:"添加",onClick:U.withModifiers(o,["prevent","stop"])},null,8,["icon"])])):U.createCommentVNode("",!0)])]),default:U.withCtx(()=>[U.createVNode(U.unref(v.ElOption),{label:"[未分类]",value:""}),(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(s.value,r=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:r.id,label:r.name,value:r.name},{default:U.withCtx(()=>[U.createElementVNode("div",{style:{display:"flex",margin:"0 -32px 0 -20px",padding:"0 32px 0 20px"},onClick:u=>Q(u,r)},[U.createElementVNode("div",Hx,[r!==c.value?(U.openBlock(),U.createBlock(U.unref(v.ElText),{key:0},{default:U.withCtx(()=>[U.createTextVNode(U.toDisplayString(r.name),1)]),_:2},1024)):U.createCommentVNode("",!0),r===c.value?U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElInput),{key:1,onClick:b[0]||(b[0]=U.withModifiers(()=>{},["prevent","stop"])),size:"small",modelValue:c.value.name,"onUpdate:modelValue":b[1]||(b[1]=u=>c.value.name=u),maxlength:"255",onKeydown:U.withKeys(V,["enter"])},null,8,["modelValue"])),[[U.unref(vW)]]):U.createCommentVNode("",!0)]),U.createElementVNode("div",null,[r!==c.value&&e.allowEdit?(U.openBlock(),U.createBlock(u0,{key:0,size:"small",type:"primary",icon:U.unref(ml.Edit),link:"",onClick:U.withModifiers(u=>h(r),["stop","prevent"]),tooltip:"修改"},null,8,["icon","onClick"])):U.createCommentVNode("",!0),r!==c.value&&e.allowEdit?(U.openBlock(),U.createBlock(u0,{key:1,size:"small",type:"danger",icon:U.unref(ml.Delete),link:"",onClick:U.withModifiers(u=>W(r),["stop","prevent"]),tooltip:"删除"},null,8,["icon","onClick"])):U.createCommentVNode("",!0),r===c.value&&e.allowEdit?(U.openBlock(),U.createBlock(u0,{key:2,size:"small",type:"primary",icon:U.unref(ml.Check),link:"",onClick:U.withModifiers(V,["stop","prevent"]),tooltip:"提交"},null,8,["icon"])):U.createCommentVNode("",!0)])],8,Kx)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"]))}}),qx=U.defineComponent({__name:"RoleEditor",props:U.mergeModels({appName:{},category:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:U.mergeModels(["success"],["update:modelValue"]),setup(e,{emit:l}){const t=U.useModel(e,"modelValue"),d=e,n=l,a={hasChildren:!1,parentId:"0",releaseSource:"",app:{id:"0"},caption:"",compositeRoles:[],dataVersion:0,description:"",id:"0",name:"",category:d.category},i=U.ref({formData:{...a}}),s=$.createAxiosWithoutCache(),c=XG(Object.keys(a),s),F=$.useLoading(s),o=$.useRoleApi(s),h=U.ref(),V=U.ref(),W=U.ref(),Q=hU(),{refreshRolesCache:m}=$r();async function N(){if(i.value.formData={...a},!d.appName)throw new Error("rolePicker组件的appName属性不能为空");W.value=await Q.getByName(d.appName)}async function b(){var S,G;if(!d.appName)return;const r=i.value.formData,u=(S=V.value)==null?void 0:S.currentRole;(G=h.value)==null||G.validate(()=>o.create({addTo:u?{id:u.id,name:u.name,app:{id:W.value.id}}:void 0,app:{id:W.value.id},description:r.description,name:r.name,caption:r.caption,category:r.category}).then(J=>{m(W.value.id),n("success",J),t.value=!1}))}return(r,u)=>{const S=U.resolveComponent("ja-form");return U.openBlock(),U.createBlock(U.unref(v.ElDrawer),{"destroy-on-close":"","append-to-body":"",title:"新建角色",modelValue:t.value,"onUpdate:modelValue":u[3]||(u[3]=G=>t.value=G),onOpen:N},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{size:"default",type:"primary",onClick:b,loading:U.unref(F),shortcut:"Alt+Enter"},{default:U.withCtx(()=>[...u[4]||(u[4]=[U.createTextVNode("确定 ",-1)])]),_:1},8,["loading"]),U.createVNode(U.unref(v.ElButton),{size:"default",onClick:u[2]||(u[2]=G=>t.value=!1)},{default:U.withCtx(()=>[...u[5]||(u[5]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createVNode(S,{ref_key:"formRef",ref:h,model:i.value,validator:U.unref(c)},{default:U.withCtx(()=>[U.createVNode(U.unref(ts),{label:"角色名称",prop:"name",required:""},{default:U.withCtx(()=>[U.withDirectives(U.createVNode(U.unref(EW),null,null,512),[[U.unref(vW)]])]),_:1}),U.createVNode(U.unref(ts),{label:"上级角色",prop:"none"},{default:U.withCtx(()=>[U.createVNode(U.unref(KW),{ref_key:"rolePicker",ref:V,placeholder:"请选择上级角色,置空表示添加顶层角色","app-name":d.appName},null,8,["app-name"])]),_:1}),U.createVNode(U.unref(ts),{label:"角色标题",prop:"caption",required:""},{default:U.withCtx(()=>{var G;return[U.createVNode(U.unref(lb),{"app-id":(G=W.value)==null?void 0:G.id,size:"small",modelValue:i.value.formData.caption,"onUpdate:modelValue":u[0]||(u[0]=J=>i.value.formData.caption=J)},null,8,["app-id","modelValue"])]}),_:1}),U.createVNode(U.unref(ts),{label:"业务分类",prop:"category"},{default:U.withCtx(()=>{var G;return[U.createVNode(Dy,{"app-id":(G=W.value)==null?void 0:G.id,modelValue:i.value.formData.category,"onUpdate:modelValue":u[1]||(u[1]=J=>i.value.formData.category=J)},null,8,["app-id","modelValue"])]}),_:1}),U.createVNode(U.unref(ts),{label:"角色说明",prop:"description"},{default:U.withCtx(()=>[U.createVNode(U.unref(EW),{type:"textarea"})]),_:1})]),_:1},8,["model","validator"])]),_:1},8,["modelValue"])}}}),$x={class:"ja-role-picker"},wy=ht(U.defineComponent({__name:"RolePickerRaw",props:U.mergeModels({appName:{}},{modelValue:{required:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=U.useModel(e,"modelValue");function d(s){var c;t.value=s.name,(c=n.value)==null||c.loadData()}const n=U.ref(),a=U.ref(!1);function i(){a.value=!0}return(s,c)=>(U.openBlock(),U.createElementBlock("div",$x,[U.createVNode(U.unref(KW),U.mergeProps({ref_key:"picker",ref:n,"app-name":l.appName,style:{flex:"auto"}},s.$attrs,{modelValue:t.value,"onUpdate:modelValue":c[1]||(c[1]=F=>t.value=F)}),U.createSlots({footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{link:"",type:"primary",icon:U.unref(ml.Plus),shortcut:"Alt+I",style:{width:"100%"},onClick:i},{default:U.withCtx(()=>[...c[2]||(c[2]=[U.createTextVNode(" 新建角色(Alt+I) ",-1)])]),_:1},8,["icon"]),U.createVNode(qx,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=F=>a.value=F),"app-name":l.appName,onSuccess:d},null,8,["modelValue","app-name"])]),_:2},[U.renderList(s.$slots,(F,o)=>({name:o,fn:U.withCtx(()=>[U.renderSlot(s.$slots,o,{},void 0,!0)])}))]),1040,["app-name","modelValue"])]))}}),[["__scopeId","data-v-dd3083a0"]]),l3=U.defineComponent({__name:"RolePicker",props:{appName:{}},emits:["change"],setup(e,{emit:l}){const t=e,d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=l;function c(o){i.removeFieldError(a),bt(n.formData,a,F.value),s("change",o)}const F=U.ref(Ml(n.formData,a));return U.watch(()=>n.formData,()=>{F.value=Ml(n.formData,a)},{deep:!0}),(o,h)=>(U.openBlock(),U.createBlock(wy,U.mergeProps({ref_key:"picker",ref:d,"app-name":t.appName,modelValue:F.value,"onUpdate:modelValue":h[0]||(h[0]=V=>F.value=V),onChange:c},o.$attrs),U.createSlots({_:2},[U.renderList(o.$slots,(V,W)=>({name:W,fn:U.withCtx(()=>[U.renderSlot(o.$slots,W)])}))]),1040,["app-name","modelValue"]))}}),KW=Nl(Ox),Ey=Nl(l3),Cy=Nl(wy),xy=Nl(Dy),gy=U.defineComponent({__name:"ChannelPicker",props:U.mergeModels({appName:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=$.createAxiosWithoutCache(),t=$.useChannelApi(l),d=e,n=U.ref(),a=U.ref(),i=U.useModel(e,"modelValue");U.onBeforeMount(()=>{s()});async function s(){console.log("load channels of app "+d.appName),d.appName&&(n.value=await t.getAll(d.appName),a.value=n.value)}function c(F){var o;a.value=((o=n.value)==null?void 0:o.filter(h=>h.name.indexOf(F)>-1))??[]}return U.watch(()=>d.appName,s),(F,o)=>(U.openBlock(),U.createBlock(U.unref(v.ElSelect),U.mergeProps({filterable:"","filter-method":c,"value-key":"id",modelValue:i.value,"onUpdate:modelValue":o[0]||(o[0]=h=>i.value=h)},F.$attrs),{default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(a.value,h=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:h.id,label:h.name,value:h},null,8,["label","value"]))),128))]),_:1},16,["modelValue"]))}}),jy=Nl(U.defineComponent({__name:"JaChannelPicker",emits:["change"],setup(e,{emit:l}){const t=U.inject("aceFormModel"),d=U.inject("aceFormItemProp"),n=U.inject("aceFormValidator"),a=l;function i(c){n.removeFieldError(d),bt(t.formData,d,s.value),a("change",c)}const s=U.ref(Ml(t.formData,d));return U.watch(()=>t.formData,()=>{s.value=Ml(t.formData,d)},{deep:!0}),(c,F)=>(U.openBlock(),U.createBlock(gy,U.mergeProps({modelValue:s.value,"onUpdate:modelValue":F[0]||(F[0]=o=>s.value=o),onChange:i},c.$attrs),null,16,["modelValue"]))}})),Oy=Nl(gy),db=new Map;let nb=new Map;function vy(){return{refreshProperties(e){db.delete(e)},async getProperties(e){let l=db.get(e);if(l)return l;let t=nb.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useEntityApi(d).getProperties(e).then(a=>(db.set(e,a),a)).finally(()=>{nb.delete(e)}),nb.set(e,t),await t}}}const t3={class:"ja-property-picker__dropdown"},e3={key:0},d3=["onMouseenter","onClick"],n3={key:0,class:"entity-type"},a3={key:1},fy=ht(U.defineComponent({__name:"PropertyPicker",props:U.mergeModels({entityId:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e;let t;const d=U.useModel(e,"modelValue"),n=U.ref([]),a=$.createAxiosWithoutCache(),{getProperties:i}=vy(),s=U.ref(),c={},F=U.ref(0),o=$.useLoading(a),h=U.ref(!1),V=U.ref(!1),W=U.ref(),Q=U.ref(),m=U.ref("");let N=U.ref(!1);async function b(){t||(t=l.entityId),t?s.value=await i(t):s.value=[]}function r(X){let k;X?k=X.join("."):k="",k!==d.value&&(d.value=k),U.nextTick(async()=>{var D;t=l.entityId,await b();let w=c[t];if(w){for(let x=0;x<X.length;x++){const K=X[x];let A=w.find(P=>P.name===K);A&&A.entityType?(t=A.entityType.id,x<X.length-1?(await b(),w=c[t]):A.dataType==="ENTITY"&&A.collectionType==="NONE"?(t=A.entityType.id,b()):(t="-1",b())):(t="-1",b())}(D=W.value)==null||D.focus()}})}function u(X){return X.caption&&X.caption.length>0?X.name+"("+X.caption+")":X.name}function S(X){F.value=X}function G(X){return F.value===X?"active":""}function J(X){var k,w;(k=n.value)==null||k.push(X.name),m.value="",(w=W.value)==null||w.focus()}function Y(X){var k;(k=n.value)==null||k.pop()}function L(){var w;if(!t)return;const X=c[t];if(!X)return;const k=(w=W.value)==null?void 0:w.value;k&&k.length>0?s.value=[...X].filter(D=>D.name.toLowerCase().indexOf(k.toLowerCase())>-1):s.value=X,C()}function y(){s.value&&(F.value<s.value.length-1&&F.value++,C())}function z(){F.value>0&&F.value--,C()}function I(){if(!s.value)return;const X=s.value[F.value];X&&J(X)}function O(){var X;m.value&&m.value.length>0||(X=n.value)==null||X.pop()}function E(X){X&&U.nextTick(()=>{var k;(k=W.value)==null||k.focus()}),N.value=X}const j=U.computed(()=>{var X;return n.value&&n.value.length>0?(X=n.value)==null?void 0:X.join("."):"请选择属性"}),C=()=>{U.nextTick(()=>{var w,D,x;const X=(w=Q.value)==null?void 0:w.$refs.wrapRef,k=X==null?void 0:X.querySelectorAll("li")[F.value];if(k&&X){const K=k.offsetTop,A=k.offsetTop+k.offsetHeight,P=X.scrollTop,q=X.scrollTop+X.clientHeight;A>q?(D=Q.value)==null||D.scrollTo(0,A-X.clientHeight+k.offsetHeight-38):K<P&&((x=Q.value)==null||x.scrollTo(0,K))}})};U.watch(()=>l.entityId,b),U.watch(n,()=>r(n.value),{deep:!0});function B(){if(d.value&&d.value.length>0){const X=d.value.split(".");X.length!==n.value.length&&(n.value=X)}else n.value.length>0&&(n.value=[])}return U.watch(d,()=>{B()}),d.value&&d.value.length>0?B():b(),U.watch(s,()=>{F.value=0,C()}),(X,k)=>(U.openBlock(),U.createBlock(U.unref(v.ElDropdown),{onVisibleChange:E},{dropdown:U.withCtx(()=>[U.createElementVNode("div",t3,[U.createElementVNode("div",{class:U.normalizeClass(["el-input-tag el-input-tag--small el-input-tag__wrapper",{"is-hovering":h.value,"is-focused":V.value}]),onMouseenter:k[3]||(k[3]=w=>h.value=!0),onMouseleave:k[4]||(k[4]=w=>h.value=!1)},[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(n.value,w=>(U.openBlock(),U.createBlock(U.unref(v.ElTag),{id:w,onClose:D=>Y(),closable:""},{default:U.withCtx(()=>[U.createTextVNode(U.toDisplayString(w),1)]),_:2},1032,["id","onClose"]))),256)),U.withDirectives(U.createElementVNode("input",{ref_key:"filterInput",ref:W,type:"text",style:{flex:"auto"},class:"el-input-tag__input","onUpdate:modelValue":k[0]||(k[0]=w=>m.value=w),placeholder:"属性名过滤",onFocus:k[1]||(k[1]=w=>V.value=!0),onBlur:k[2]||(k[2]=w=>V.value=!1),onKeydown:[U.withKeys(O,["delete"]),U.withKeys(y,["down"]),U.withKeys(z,["up"]),U.withKeys(I,["enter"])],onInput:L},null,544),[[U.vModelText,m.value]])],34),U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElScrollbar),{height:"300px",always:"",ref_key:"scrollbar",ref:Q},{default:U.withCtx(()=>{var w;return[((w=s.value)==null?void 0:w.length)??!1?(U.openBlock(),U.createElementBlock("ul",e3,[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(s.value,(D,x)=>(U.openBlock(),U.createElementBlock("li",{key:D.id,onMouseenter:K=>S(x),onClick:K=>J(D),class:U.normalizeClass(G(x))},[D.dataType==="ENTITY"?(U.openBlock(),U.createElementBlock("span",n3,U.toDisplayString(u(D)),1)):(U.openBlock(),U.createElementBlock("span",a3,U.toDisplayString(u(D)),1))],42,d3))),128))])):(U.openBlock(),U.createBlock(U.unref(v.ElEmpty),{key:1,description:"无可选属性"}))]}),_:1})),[[U.unref(v.vLoading),U.unref(o)]])])]),default:U.withCtx(()=>[U.createVNode(U.unref(v.ElTag),{type:"primary"},{default:U.withCtx(()=>[U.createTextVNode(U.toDisplayString(j.value)+" ",1),U.unref(N)?(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:0},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.ArrowUp))]),_:1})):(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:1},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.ArrowDown))]),_:1}))]),_:1})]),_:1}))}}),[["__scopeId","data-v-7bf2d619"]]),Ky=Nl(U.defineComponent({__name:"JaPropertyPicker",emits:["change"],setup(e,{emit:l}){const t=U.inject("aceFormModel"),d=U.inject("aceFormItemProp"),n=U.inject("aceFormValidator"),a=l;function i(c){n.removeFieldError(d),bt(t.formData,d,s.value),a("change",c)}const s=U.ref(Ml(t.formData,d)??"");return U.watch(()=>t.formData,()=>{s.value=Ml(t.formData,d)??""},{deep:!0}),(c,F)=>(U.openBlock(),U.createBlock(fy,U.mergeProps({modelValue:s.value,"onUpdate:modelValue":F[0]||(F[0]=o=>s.value=o),onChange:i},c.$attrs),null,16,["modelValue"]))}})),Hy=Nl(fy),Py=Nl(U.defineComponent({__name:"JaCheckboxGroup",props:{ariaLabel:{},modelValue:{},disabled:{type:Boolean},min:{},max:{},size:{},fill:{},textColor:{},tag:{},validateEvent:{type:Boolean},options:{},props:{},type:{}},emits:["change"],setup(e,{expose:l,emit:t}){const d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=t,c=e;function F(V){i.removeFieldError(a),bt(n.formData,a,o.value),s("change",V)}const o=U.ref(Ml(n.formData,a));U.watch(()=>n.formData,()=>{o.value=Ml(n.formData,a)},{deep:!0});const h=U.computed(()=>{const{modelValue:V,...W}=c;return W});return l({focus:()=>{var V,W;return(W=(V=d.value)==null?void 0:V.focus)==null?void 0:W.call(V)},blur:()=>{var V,W;return(W=(V=d.value)==null?void 0:V.blur)==null?void 0:W.call(V)},elCheckboxGroup:d}),(V,W)=>(U.openBlock(),U.createBlock(U.unref(v.ElCheckboxGroup),U.mergeProps({ref_key:"input",ref:d,modelValue:o.value,"onUpdate:modelValue":W[0]||(W[0]=Q=>o.value=Q),onChange:F},{...h.value,...V.$attrs}),U.createSlots({_:2},[U.renderList(V.$slots,(Q,m)=>({name:m,fn:U.withCtx(()=>[U.renderSlot(V.$slots,m)])}))]),1040,["modelValue"]))}})),Ay=Nl(U.defineComponent({__name:"EnumPicker",props:U.mergeModels({clearable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!0},keyField:{default:"value"},multiple:{type:Boolean,default:!1},name:{},serviceName:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=U.ref([]),d=U.ref(!1),n=U.useModel(e,"modelValue"),a=$.createAxiosWithoutCache(),i=$.useEnumApi(a);async function s(){!l.name||!l.serviceName||(d.value=!0,i.queryByName(l.serviceName,l.name).then(o=>{t.value=o.values}).finally(()=>{d.value=!1}))}const c=U.computed(()=>l.multiple?n.value.map(o=>o[l.keyField])||[]:n.value[0]!==void 0?n.value[0][l.keyField]:""),F=o=>{if(typeof o=="string"){const h=t.value.find(V=>V[l.keyField]===o);n.value=h?[h]:[]}else n.value=t.value.filter(h=>o.includes(h[l.keyField]))};return s(),U.watch(()=>l.name,s),U.watch(()=>l.serviceName,s),(o,h)=>{const V=U.resolveDirective("loading");return U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElSelect),{"model-value":c.value,filterable:l.filterable,multiple:l.multiple,clearable:l.clearable,onChange:F},{default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(t.value,W=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:W.id,value:W[l.keyField],label:W.text},null,8,["value","label"]))),128))]),_:1},8,["model-value","filterable","multiple","clearable"])),[[V,d.value]])}}}));var HW={exports:{}},i3=HW.exports,_y;function qy(){return _y||(_y=1,(function(e,l){(function(t,d){e.exports=d()})(i3,(function(){var t=1e3,d=6e4,n=36e5,a="millisecond",i="second",s="minute",c="hour",F="day",o="week",h="month",V="quarter",W="year",Q="date",m="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,r={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var C=["th","st","nd","rd"],B=j%100;return"["+j+(C[(B-20)%10]||C[B]||C[0])+"]"}},u=function(j,C,B){var X=String(j);return!X||X.length>=C?j:""+Array(C+1-X.length).join(B)+j},S={s:u,z:function(j){var C=-j.utcOffset(),B=Math.abs(C),X=Math.floor(B/60),k=B%60;return(C<=0?"+":"-")+u(X,2,"0")+":"+u(k,2,"0")},m:function j(C,B){if(C.date()<B.date())return-j(B,C);var X=12*(B.year()-C.year())+(B.month()-C.month()),k=C.clone().add(X,h),w=B-k<0,D=C.clone().add(X+(w?-1:1),h);return+(-(X+(B-k)/(w?k-D:D-k))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:h,y:W,w:o,d:F,D:Q,h:c,m:s,s:i,ms:a,Q:V}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},G="en",J={};J[G]=r;var Y="$isDayjsObject",L=function(j){return j instanceof O||!(!j||!j[Y])},y=function j(C,B,X){var k;if(!C)return G;if(typeof C=="string"){var w=C.toLowerCase();J[w]&&(k=w),B&&(J[w]=B,k=w);var D=C.split("-");if(!k&&D.length>1)return j(D[0])}else{var x=C.name;J[x]=C,k=x}return!X&&k&&(G=k),k||!X&&G},z=function(j,C){if(L(j))return j.clone();var B=typeof C=="object"?C:{};return B.date=j,B.args=arguments,new O(B)},I=S;I.l=y,I.i=L,I.w=function(j,C){return z(j,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var O=(function(){function j(B){this.$L=y(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[Y]=!0}var C=j.prototype;return C.parse=function(B){this.$d=(function(X){var k=X.date,w=X.utc;if(k===null)return new Date(NaN);if(I.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var D=k.match(N);if(D){var x=D[2]-1||0,K=(D[7]||"0").substring(0,3);return w?new Date(Date.UTC(D[1],x,D[3]||1,D[4]||0,D[5]||0,D[6]||0,K)):new Date(D[1],x,D[3]||1,D[4]||0,D[5]||0,D[6]||0,K)}}return new Date(k)})(B),this.init()},C.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},C.$utils=function(){return I},C.isValid=function(){return this.$d.toString()!==m},C.isSame=function(B,X){var k=z(B);return this.startOf(X)<=k&&k<=this.endOf(X)},C.isAfter=function(B,X){return z(B)<this.startOf(X)},C.isBefore=function(B,X){return this.endOf(X)<z(B)},C.$g=function(B,X,k){return I.u(B)?this[X]:this.set(k,B)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(B,X){var k=this,w=!!I.u(X)||X,D=I.p(B),x=function(nl,dl){var sl=I.w(k.$u?Date.UTC(k.$y,dl,nl):new Date(k.$y,dl,nl),k);return w?sl:sl.endOf(F)},K=function(nl,dl){return I.w(k.toDate()[nl].apply(k.toDate("s"),(w?[0,0,0,0]:[23,59,59,999]).slice(dl)),k)},A=this.$W,P=this.$M,q=this.$D,_="set"+(this.$u?"UTC":"");switch(D){case W:return w?x(1,0):x(31,11);case h:return w?x(1,P):x(0,P+1);case o:var g=this.$locale().weekStart||0,tl=(A<g?A+7:A)-g;return x(w?q-tl:q+(6-tl),P);case F:case Q:return K(_+"Hours",0);case c:return K(_+"Minutes",1);case s:return K(_+"Seconds",2);case i:return K(_+"Milliseconds",3);default:return this.clone()}},C.endOf=function(B){return this.startOf(B,!1)},C.$set=function(B,X){var k,w=I.p(B),D="set"+(this.$u?"UTC":""),x=(k={},k[F]=D+"Date",k[Q]=D+"Date",k[h]=D+"Month",k[W]=D+"FullYear",k[c]=D+"Hours",k[s]=D+"Minutes",k[i]=D+"Seconds",k[a]=D+"Milliseconds",k)[w],K=w===F?this.$D+(X-this.$W):X;if(w===h||w===W){var A=this.clone().set(Q,1);A.$d[x](K),A.init(),this.$d=A.set(Q,Math.min(this.$D,A.daysInMonth())).$d}else x&&this.$d[x](K);return this.init(),this},C.set=function(B,X){return this.clone().$set(B,X)},C.get=function(B){return this[I.p(B)]()},C.add=function(B,X){var k,w=this;B=Number(B);var D=I.p(X),x=function(P){var q=z(w);return I.w(q.date(q.date()+Math.round(P*B)),w)};if(D===h)return this.set(h,this.$M+B);if(D===W)return this.set(W,this.$y+B);if(D===F)return x(1);if(D===o)return x(7);var K=(k={},k[s]=d,k[c]=n,k[i]=t,k)[D]||1,A=this.$d.getTime()+B*K;return I.w(A,this)},C.subtract=function(B,X){return this.add(-1*B,X)},C.format=function(B){var X=this,k=this.$locale();if(!this.isValid())return k.invalidDate||m;var w=B||"YYYY-MM-DDTHH:mm:ssZ",D=I.z(this),x=this.$H,K=this.$m,A=this.$M,P=k.weekdays,q=k.months,_=k.meridiem,g=function(dl,sl,Dl,ql){return dl&&(dl[sl]||dl(X,w))||Dl[sl].slice(0,ql)},tl=function(dl){return I.s(x%12||12,dl,"0")},nl=_||function(dl,sl,Dl){var ql=dl<12?"AM":"PM";return Dl?ql.toLowerCase():ql};return w.replace(b,(function(dl,sl){return sl||(function(Dl){switch(Dl){case"YY":return String(X.$y).slice(-2);case"YYYY":return I.s(X.$y,4,"0");case"M":return A+1;case"MM":return I.s(A+1,2,"0");case"MMM":return g(k.monthsShort,A,q,3);case"MMMM":return g(q,A);case"D":return X.$D;case"DD":return I.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return g(k.weekdaysMin,X.$W,P,2);case"ddd":return g(k.weekdaysShort,X.$W,P,3);case"dddd":return P[X.$W];case"H":return String(x);case"HH":return I.s(x,2,"0");case"h":return tl(1);case"hh":return tl(2);case"a":return nl(x,K,!0);case"A":return nl(x,K,!1);case"m":return String(K);case"mm":return I.s(K,2,"0");case"s":return String(X.$s);case"ss":return I.s(X.$s,2,"0");case"SSS":return I.s(X.$ms,3,"0");case"Z":return D}return null})(dl)||D.replace(":","")}))},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(B,X,k){var w,D=this,x=I.p(X),K=z(B),A=(K.utcOffset()-this.utcOffset())*d,P=this-K,q=function(){return I.m(D,K)};switch(x){case W:w=q()/12;break;case h:w=q();break;case V:w=q()/3;break;case o:w=(P-A)/6048e5;break;case F:w=(P-A)/864e5;break;case c:w=P/n;break;case s:w=P/d;break;case i:w=P/t;break;default:w=P}return k?w:I.a(w)},C.daysInMonth=function(){return this.endOf(h).$D},C.$locale=function(){return J[this.$L]},C.locale=function(B,X){if(!B)return this.$L;var k=this.clone(),w=y(B,X,!0);return w&&(k.$L=w),k},C.clone=function(){return I.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},j})(),E=O.prototype;return z.prototype=E,[["$ms",a],["$s",i],["$m",s],["$H",c],["$W",F],["$M",h],["$y",W],["$D",Q]].forEach((function(j){E[j[1]]=function(C){return this.$g(C,j[0],j[1])}})),z.extend=function(j,C){return j.$i||(j(C,O,z),j.$i=!0),z},z.locale=y,z.isDayjs=L,z.unix=function(j){return z(1e3*j)},z.en=J[G],z.Ls=J,z.p={},z}))})(HW)),HW.exports}var s3=qy();const PW=Ad(s3);var AW={exports:{}},c3=AW.exports,$y;function U3(){return $y||($y=1,(function(e,l){(function(t,d){e.exports=d()})(c3,(function(){return function(t,d,n){t=t||{};var a=d.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function s(F,o,h,V){return a.fromToBase(F,o,h,V)}n.en.relativeTime=i,a.fromToBase=function(F,o,h,V,W){for(var Q,m,N,b=h.$locale().relativeTime||i,r=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],u=r.length,S=0;S<u;S+=1){var G=r[S];G.d&&(Q=V?n(F).diff(h,G.d,!0):h.diff(F,G.d,!0));var J=(t.rounding||Math.round)(Math.abs(Q));if(N=Q>0,J<=G.r||!G.r){J<=1&&S>0&&(G=r[S-1]);var Y=b[G.l];W&&(J=W(""+J)),m=typeof Y=="string"?Y.replace("%d",J):Y(J,o,G.l,N);break}}if(o)return m;var L=N?b.future:b.past;return typeof L=="function"?L(m):L.replace("%s",m)},a.to=function(F,o){return s(F,o,this,!0)},a.from=function(F,o){return s(F,o,this)};var c=function(F){return F.$u?n.utc():n()};a.toNow=function(F){return this.to(c(this),F)},a.fromNow=function(F){return this.from(c(this),F)}}}))})(AW)),AW.exports}var Z3=U3();const F3=Ad(Z3);var _W={exports:{}},o3=_W.exports,lX;function h3(){return lX||(lX=1,(function(e,l){(function(t,d){e.exports=d(qy())})(o3,(function(t){function d(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var n=d(t),a={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(i,s){return s==="W"?i+"周":i+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(i,s){var c=100*i+s;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return n.default.locale(a,null,!0),a}))})(_W)),_W.exports}h3();const V3={key:0,class:"flow-shell-wrapper"},W3={class:"flow-shell-container"},Q3={class:"flow-shell-header"},m3={class:"header-content"},N3={class:"header-top"},R3={class:"title-section"},r3={class:"flow-title"},b3={key:0,class:"header-bottom"},u3={class:"info-item"},p3={class:"info-item"},M3={class:"value"},S3={key:1,class:"value"},T3={key:0,class:"info-item"},J3={class:"value"},G3={class:"flow-shell-main"},y3={class:"main-content"},X3={class:"content-wrapper"},B3={key:0,class:"error-tip"},Y3={key:1},k3={key:2,class:"no-form-tip"},z3={class:"side-panel"},L3={class:"side-panel-content"},I3={class:"task-info"},D3={class:"handler-info"},w3={class:"handler-name"},E3={class:"task-status"},C3={key:0,class:"task-comment"},x3={class:"comment-content"},g3={key:1,class:"task-comment"},j3={key:1,class:"no-history-tip"},O3={class:"flow-shell-footer"},tX=Nl(ht(U.defineComponent({__name:"FlowFormShell",props:U.mergeModels({appName:{default:void 0},flowKey:{default:void 0},startNodeKey:{default:void 0},taskId:{},formData:{},saveAndForward:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:U.mergeModels(["open","closed"],["update:modelValue"]),setup(e,{emit:l}){PW.extend(F3),PW.locale("zh-cn");const t=e,d=U.useModel(e,"modelValue"),n=$.createAxiosWithoutCache(),a=$.useLoading(n),i=U.ref(!1),s=U.computed(()=>a.value||i.value),c=U.ref(!1),F=U.ref(""),o=U.ref(void 0),h=$.useTaskQueryApi(n),V=$.useFlowDefinitionApi(n),W=l,Q=U.computed(()=>{var y,z;switch((z=(y=o.value)==null?void 0:y.flowInstance)==null?void 0:z.state){case 0:return"warning";case 1:return"success";case 2:return"danger";default:return"info"}}),m=U.computed(()=>{var y,z;return((y=o.value)==null?void 0:y.taskInstance)||!((z=o.value)!=null&&z.flowInstance)}),N=U.computed(()=>{var z,I;if(!((I=(z=o.value)==null?void 0:z.flowInstance)!=null&&I.nodes))return[];let y=[];return Object.values(o.value.flowInstance.nodes).forEach(O=>{y=[...y,...O.tasks]}),y.sort((O,E)=>{const j=O.finishTime?new Date(O.finishTime).getTime():0;return(E.finishTime?new Date(E.finishTime).getTime():0)-j})}),b=y=>y?PW(y).format("YYYY-MM-DD HH:mm:ss"):"",r=y=>y?PW(y).fromNow():"",u=y=>{switch(y){case 0:return"进行中";case 1:return"已完成";case 2:return"已中止";default:return"待发起"}},S=y=>{switch(y){case 0:return"未激活";case 1:return"未接收";case 2:return"已接收";case 3:return"已办结";default:return"未知状态"}};U.watch(()=>d.value,async y=>{G(),y?(W("open"),await U.nextTick(),J()):W("closed")});const G=()=>{F.value="",o.value=void 0},J=async()=>{var z;G();const y=(z=t.formData)==null?void 0:z.flowFormId;if(!t.taskId&&!(t.appName&&t.flowKey)){v.ElMessage.error("参数错误: 必须提供taskId或appName、flowKey和flowFormId");return}try{if(t.taskId)o.value=await h.getTaskInstanceById(t.taskId);else if(y)o.value=await h.getTaskByFormIdAndAppAndFlowKey(y,t.appName,t.flowKey);else{const I=await V.getEffectiveDefinition(t.appName,t.flowKey);o.value={flowDefinition:I}}}catch(I){v.ElMessage.error(I.message||"加载流程信息失败"),F.value=I.message}},Y=async()=>{var y,z;c.value=!0;try{await t.saveAndForward({flowArgs:{taskId:((z=(y=o.value)==null?void 0:y.taskInstance)==null?void 0:z.id)||"",processRequestType:"SAVE_FORM",appName:t.appName||"",flowKey:t.flowKey||"",startNodeKey:t.startNodeKey||"",forwardTo:[]},formCommand:t.formData})}finally{c.value=!1}},L=async()=>{var y;c.value=!0;try{const z=o.value;await t.saveAndForward({flowArgs:{taskId:((y=z==null?void 0:z.taskInstance)==null?void 0:y.id)||"",processRequestType:z!=null&&z.taskInstance?"FORWARD":"INITIATE",appName:t.appName||"",flowKey:t.flowKey||"",startNodeKey:t.startNodeKey||"",forwardTo:[]},formCommand:t.formData}),d.value=!1}finally{c.value=!1}};return(y,z)=>{var O,E,j,C,B,X,k,w,D,x,K,A,P,q,_,g,tl;const I=U.resolveDirective("loading");return d.value?(U.openBlock(),U.createElementBlock("div",V3,[U.withDirectives((U.openBlock(),U.createElementBlock("div",W3,[U.createElementVNode("header",Q3,[U.createElementVNode("div",m3,[U.createElementVNode("div",N3,[U.createElementVNode("div",{class:"back-button-wrapper",onClick:z[0]||(z[0]=nl=>d.value=!1)},[U.createVNode(U.unref(v.ElIcon),{size:40},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.ArrowLeft))]),_:1})]),U.createElementVNode("div",null,[U.createElementVNode("div",R3,[U.createElementVNode("h2",r3,U.toDisplayString(((j=(E=(O=o.value)==null?void 0:O.flowDefinition)==null?void 0:E.flowModel)==null?void 0:j.flowCaption)||"流程详情"),1),U.createVNode(U.unref(v.ElTag),{type:Q.value},{default:U.withCtx(()=>{var nl,dl;return[U.createTextVNode(U.toDisplayString(u((dl=(nl=o.value)==null?void 0:nl.flowInstance)==null?void 0:dl.state)),1)]}),_:1},8,["type"])]),(C=o.value)!=null&&C.flowInstance?(U.openBlock(),U.createElementBlock("div",b3,[U.createElementVNode("div",u3,[z[1]||(z[1]=U.createElementVNode("span",{class:"label"},"发起人:",-1)),U.createVNode(U.unref(ZU),{"user-id":(X=(B=o.value)==null?void 0:B.flowInstance)==null?void 0:X.initiator,"show-avatar-in-tag":"","full-name":(w=(k=o.value)==null?void 0:k.flowInstance)==null?void 0:w.initiatorName},null,8,["user-id","full-name"])]),U.createElementVNode("div",p3,[z[2]||(z[2]=U.createElementVNode("span",{class:"label"},"发起时间:",-1)),(x=(D=o.value)==null?void 0:D.flowInstance)!=null&&x.createTime?(U.openBlock(),U.createBlock(U.unref(v.ElTooltip),{key:0,content:b((A=(K=o.value)==null?void 0:K.flowInstance)==null?void 0:A.createTime),placement:"top"},{default:U.withCtx(()=>{var nl,dl;return[U.createElementVNode("span",M3,U.toDisplayString(r((dl=(nl=o.value)==null?void 0:nl.flowInstance)==null?void 0:dl.createTime)),1)]}),_:1},8,["content"])):(U.openBlock(),U.createElementBlock("span",S3,"-"))]),(q=(P=o.value)==null?void 0:P.flowInstance)!=null&&q.workNo?(U.openBlock(),U.createElementBlock("div",T3,[z[3]||(z[3]=U.createElementVNode("span",{class:"label"},"工作文号:",-1)),U.createElementVNode("span",J3,U.toDisplayString((g=(_=o.value)==null?void 0:_.flowInstance)==null?void 0:g.workNo),1)])):U.createCommentVNode("",!0)])):U.createCommentVNode("",!0)])])])]),U.createElementVNode("main",G3,[U.createElementVNode("section",y3,[U.createElementVNode("div",X3,[F.value?(U.openBlock(),U.createElementBlock("div",B3,[U.createVNode(U.unref(v.ElResult),{icon:"error",title:"加载失败","sub-title":F.value},{extra:U.withCtx(()=>[U.createVNode(U.unref(v.ElButton),{type:"primary",onClick:J},{default:U.withCtx(()=>[...z[4]||(z[4]=[U.createTextVNode("重试",-1)])]),_:1})]),_:1},8,["sub-title"])])):o.value?(U.openBlock(),U.createElementBlock("div",Y3,[U.renderSlot(y.$slots,"default",{flowParam:o.value},void 0,!0)])):(U.openBlock(),U.createElementBlock("div",k3,[U.createVNode(U.unref(v.ElEmpty),{description:"暂无表单内容"})]))])]),U.createElementVNode("aside",z3,[z[7]||(z[7]=U.createElementVNode("div",{class:"side-panel-header"},[U.createElementVNode("h3",null,"办理历史")],-1)),U.createElementVNode("div",L3,[N.value.length>0?(U.openBlock(),U.createBlock(U.unref(v.ElTimeline),{key:0},{default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(N.value,(nl,dl)=>(U.openBlock(),U.createBlock(U.unref(v.ElTimelineItem),{key:dl,timestamp:r(nl.finishTime),placement:"top"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElCard),null,{default:U.withCtx(()=>[U.createElementVNode("div",I3,[U.createElementVNode("div",D3,[U.createElementVNode("span",w3,U.toDisplayString(nl.handlerName||"未知"),1),U.createVNode(U.unref(v.ElTooltip),{content:b(nl.finishTime),placement:"top"},{default:U.withCtx(()=>[U.createElementVNode("span",E3,U.toDisplayString(S(nl.state)),1)]),_:2},1032,["content"])]),nl.comment?(U.openBlock(),U.createElementBlock("div",C3,[z[5]||(z[5]=U.createElementVNode("span",{class:"comment-label"},"意见:",-1)),U.createElementVNode("span",x3,U.toDisplayString(nl.comment),1)])):(U.openBlock(),U.createElementBlock("div",g3,[...z[6]||(z[6]=[U.createElementVNode("span",{class:"comment-label"},"意见:",-1),U.createElementVNode("span",{class:"comment-content empty"},"无",-1)])]))])]),_:2},1024)]),_:2},1032,["timestamp"]))),128))]),_:1})):(U.openBlock(),U.createElementBlock("div",j3,[U.createVNode(U.unref(v.ElEmpty),{description:"暂无办理历史","image-size":100})]))])])]),U.createElementVNode("footer",O3,[U.createVNode(U.unref(Vt),{onClick:Y,shortcut:"Ctrl+S",tooltip:"保存",loading:c.value,disabled:c.value},{default:U.withCtx(()=>[...z[8]||(z[8]=[U.createTextVNode("保存",-1)])]),_:1},8,["loading","disabled"]),m.value?(U.openBlock(),U.createBlock(U.unref(Vt),{key:0,onClick:L,type:"danger",shortcut:"Ctrl+F",tooltip:"保存并"+((tl=o.value)!=null&&tl.taskInstance?"结束当前工作步骤办理":"发起工作"),loading:c.value,disabled:c.value},{default:U.withCtx(()=>{var nl;return[U.createTextVNode(U.toDisplayString((nl=o.value)!=null&&nl.taskInstance?"办理结束":"发起工作"),1)]}),_:1},8,["tooltip","loading","disabled"])):U.createCommentVNode("",!0)])])),[[I,s.value]])])):U.createCommentVNode("",!0)}}}),[["__scopeId","data-v-716e0837"]])),v3=Object.freeze(Object.defineProperty({__proto__:null,AceTip:yG,JaAutocomplete:zy,JaAvatar:xW,JaBaseRolePicker:KW,JaButton:Vt,JaChannelPicker:jy,JaChannelPickerRaw:Oy,JaCheckbox:YG,JaCheckboxGroup:Py,JaDatePicker:LG,JaDepartmentPicker:ty,JaDepartmentTree:jr,JaDropdownButton:CG,JaEnumList:PG,JaEnumListRaw:AG,JaEnumPicker:Ay,JaFilePreviewer:GG,JaFlowFormShell:tX,JaForm:BG,JaFormItem:ts,JaInput:EW,JaInputI18nRaw:lb,JaInputNumber:kG,JaMapItemList:qG,JaMapItemListRaw:$G,JaNumberList:fG,JaNumberListRaw:KG,JaPropertyPicker:Ky,JaPropertyPickerRaw:Hy,JaRadioGroup:Ly,JaRoleCategorySelector:xy,JaRolePicker:Ey,JaRolePickerRaw:Cy,JaScrollbar:Hr,JaSelect:zG,JaStringList:jG,JaStringListRaw:OG,JaSwitch:xG,JaTimePicker:Yy,JaUploader:TG,JaUploaderRaw:JG,JaUserGroupPicker:ky,JaUserGroupTree:fr,JaUserInfoTag:ZU,JaUserList:By,JaUserPicker:Xy,JaUserPickerRaw:yy,JaUserSelectDialog:Kr,getAvatarToken:Dr,updateAvatarToken:dy},Symbol.toStringTag,{value:"Module"}));function eX(e){e.directive("focus",vW),e.directive("shortcut",CW),e.directive("auth",EG)}const f3=[{text:"近一天",value:()=>{const e=new Date,l=new Date;return l.setDate(l.getDate()-1),[l,e]}},{text:"近三天",value:()=>{const e=new Date,l=new Date;return l.setDate(l.getDate()-3),[l,e]}},{text:"近一周",value:()=>{const e=new Date,l=new Date;return l.setDate(l.getDate()-7),[l,e]}},{text:"近一月",value:()=>{const e=new Date,l=new Date;return l.setMonth(l.getMonth()-1),[l,e]}},{text:"近三月",value:()=>{const e=new Date,l=new Date;return l.setMonth(l.getMonth()-3),[l,e]}},{text:"近半年",value:()=>{const e=new Date,l=new Date;return l.setMonth(l.getMonth()-6),[l,e]}},{text:"近一年",value:()=>{const e=new Date,l=new Date;return l.setFullYear(l.getFullYear()-1),[l,e]}}];function K3(e){if(!e)throw new Error("无法获取到应用名称,请确保VITE_APP_NAME环境变量已配置或者在创建时传入appName参数。");if(!window.microApp)throw new Error("无法获取到window.microApp。");const l=U.ref(new Set),t=(F,o=!0,h=!0)=>{const V={sender:e,timestamp:Date.now(),payload:F};o?window.microApp.forceDispatch(V):window.microApp.dispatch(V,W=>{console.log("消息是否有返回值",W)}),h&&i()},d=(F,o=!0)=>{const h={sender:"app-demo",timestamp:Date.now(),payload:F};window.microApp.setGlobalData(h),o&&i()},n=(F,o=!0)=>{window.microApp.addGlobalDataListener(F,o)},a=()=>window.microApp.getData(),i=()=>{window.microApp.clearData()},s=(F,o=!1)=>{window.microApp.addDataListener(F,o),l.value.add(F)},c=F=>{window.microApp.removeDataListener(F),l.value.delete(F)};return U.onUnmounted(()=>{window.microApp.clearDataListener(),l.value.clear()}),{sendMessage:t,onMessage:s,clearCache:i,getBaseAppData:a,offMessage:c,listeners:l,sendGlobalMessage:d,onGlobalMessage:n}}let dX=null,G0;function H3(){return{async getDataTypes(){let e=dX;if(e)return e;if(G0)return await G0;const l=$.createAxiosWithoutCache();return G0=$.useEntityApi(l).getPropertyDataTypes().then(d=>(dX=d,d)).finally(()=>{G0=void 0}),await G0}}}let nX=null,y0;function P3(){return{async getConstraintProviders(){let e=nX;if(e)return e;if(y0)return await y0;const l=$.createAxiosWithoutCache();return y0=$.useConstraintApi(l).getConstraintProviders().then(d=>(nX=d,d)).finally(()=>{y0=void 0}),await y0}}}const ab=new Map;let ib=new Map;function A3(){return{refreshFileConfigurationCache(e){ab.delete(e)},async getFileConfigurations(e){let l=ab.get(e);if(l)return l;let t=ib.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useFileConfigurationApi(d).getByAppService(e,0,9999999).then(a=>(ab.set(e,a.content),a.content)).finally(()=>{ib.delete(e)}),ib.set(e,t),await t}}}const sb=new Map;let cb=new Map;function _3(){return{refreshNumberTemplatesCache(e){sb.delete(e)},async getNumberTemplates(e){let l=sb.get(e);if(l)return l;let t=cb.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useStringIdTemplateApi(d).getByApp(e,0,9999999).then(a=>(sb.set(e,a.content),a.content)).finally(()=>{cb.delete(e)}),cb.set(e,t),await t}}}const Ub=new Map;let Zb=new Map;function q3(){return{refreshEntitiesCache(e){Ub.delete(e)},async getEntities(e){let l=Ub.get(e);if(l)return l;let t=Zb.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useEntityApi(d).getAll(e).then(a=>(Ub.set(e,a),a)).finally(()=>{Zb.delete(e)}),Zb.set(e,t),await t}}}const $3={install(e){for(const[l,t]of Object.entries(v3))e.component(l,t);eX(e)}};el.AceTip=yG,el.AceVueUI=$3,el.JaAutocomplete=zy,el.JaAvatar=xW,el.JaBaseRolePicker=KW,el.JaButton=Vt,el.JaChannelPicker=jy,el.JaChannelPickerRaw=Oy,el.JaCheckbox=YG,el.JaCheckboxGroup=Py,el.JaDatePicker=LG,el.JaDepartmentPicker=ty,el.JaDepartmentTree=jr,el.JaDropdownButton=CG,el.JaEnumList=PG,el.JaEnumListRaw=AG,el.JaEnumPicker=Ay,el.JaFilePreviewer=GG,el.JaFlowFormShell=tX,el.JaForm=BG,el.JaFormItem=ts,el.JaInput=EW,el.JaInputI18nRaw=lb,el.JaInputNumber=kG,el.JaMapItemList=qG,el.JaMapItemListRaw=$G,el.JaNumberList=fG,el.JaNumberListRaw=KG,el.JaPropertyPicker=Ky,el.JaPropertyPickerRaw=Hy,el.JaRadioGroup=Ly,el.JaRoleCategorySelector=xy,el.JaRolePicker=Ey,el.JaRolePickerRaw=Cy,el.JaScrollbar=Hr,el.JaSelect=zG,el.JaStringList=jG,el.JaStringListRaw=OG,el.JaSwitch=xG,el.JaTimePicker=Yy,el.JaUploader=TG,el.JaUploaderRaw=JG,el.JaUserGroupPicker=ky,el.JaUserGroupTree=fr,el.JaUserInfoTag=ZU,el.JaUserList=By,el.JaUserPicker=Xy,el.JaUserPickerRaw=yy,el.JaUserSelectDialog=Kr,el.SCROLL_BAR_WRAPPED_INJECT_KEY=Or,el.getAvatarToken=Dr,el.installDirectives=eX,el.shortcuts=f3,el.updateAvatarToken=dy,el.useAppInstances=hU,el.useBackendValidations=XG,el.useBridge=K3,el.useConstraintProviders=P3,el.useEntities=q3,el.useEntityPropDataTypes=H3,el.useFileConfigurations=A3,el.useGroups=Qy,el.useNumberTemplates=_3,el.useProperties=vy,el.useRealms=OW,el.useRoleCategories=Iy,el.useRoles=$r,el.useSystemClassificationLevelMap=Tb,el.useSystemClassificationLevels=Sb,el.useTreeData=es,el.useUserClassificationLevel=kX,el.useUserClassificationLevelMap=zX,el.useUserRefQuery=gr,Object.defineProperty(el,Symbol.toStringTag,{value:"Module"})}));
|
|
424
|
+
-283 -33z'/%3E%3C/g%3E%3C/svg%3E`,xW=Nl(ht(U.defineComponent({__name:"JaAvatar",props:{userId:{},username:{},realm:{},doNotLoadAvatar:{type:Boolean,default:!1},hasAvatar:{type:Boolean},firstName:{},size:{},shape:{},icon:{},src:{},alt:{},srcSet:{},fit:{}},setup(e){const l=e,t=Dr(),d=U.ref(!1),n=U.ref(),a=U.ref();d.value=!0,U.onMounted(async()=>{await U.nextTick()});const i=U.computed(()=>{if(!(d.value&&l.hasAvatar&&!l.doNotLoadAvatar))return l.firstName?"":wr;if(l.userId&&l.userId.length>0){const F="/ace-app-service/avatar/"+l.userId;return(window.rawWindow?window.rawWindow:window).appDescriptor.env.isDevMode()?new URL("/ace"+F,location.origin).toString()+"?t="+t.value.toString():new URL(F,location.origin).toString()+"?t="+t.value.toString()}if(l.realm&&l.realm.length>0&&l.username&&l.username.length>0){const F="/ace-app-service/avatar/"+l.realm+"/"+l.username;return(window.rawWindow?window.rawWindow:window).appDescriptor.env.isDevMode()?new URL("/ace"+F,location.origin).toString()+"?t="+t.value.toString():new URL(F,location.origin).toString()+"?t="+t.value.toString()}return l.firstName?"":wr});function s(F){var V;if(!F)return;let h=((V=n.value)==null?void 0:V.$el.clientWidth)/2.8;F.style.fontSize=h+"px"}U.onUnmounted(()=>{}),U.watch(a,()=>s(a.value));const c=U.computed(()=>{const{userId:F,username:o,realm:h,doNotLoadAvatar:V,hasAvatar:W,firstName:Q,...m}=l;return m});return(F,o)=>(U.openBlock(),U.createBlock(U.unref(v.ElAvatar),U.mergeProps({src:i.value},{...c.value,...F.$attrs},{ref_key:"avatar",ref:n,class:"ja-avatar"}),{default:U.withCtx(()=>[l.firstName&&l.firstName.length>0?(U.openBlock(),U.createElementBlock("span",{key:0,class:"user-name-avatar",ref_key:"usernameSpan",ref:a},U.toDisplayString(e.firstName),513)):(U.openBlock(),U.createBlock(U.unref(v.ElImage),{key:1,style:{height:"100%"},src:U.unref(wr),alt:"用户头像"},null,8,["src"]))]),_:1},16,["src"]))}}),[["__scopeId","data-v-52d5c63c"]]));let Er;function a9(){return Er||(Er=$.createAxiosWithoutCache()),Er}const i9={class:"portrait"},s9={class:"user-info"},c9={class:"dropdown"},U9={class:"header"},Z9={class:"tools"},F9={style:{margin:"0","font-weight":"600"}},o9={style:{margin:"0","font-size":"14px",color:"var(--el-color-info-light-3)"}},h9={style:{margin:"0"}},ZU=Nl(ht(U.defineComponent({__name:"UserInfoTag",props:{closable:{type:Boolean,default:!1},userId:{},fullName:{default:"无名氏"},realm:{},username:{},theme:{default:"skyGray"},showAvatarInTag:{type:Boolean},placement:{default:"bottom"},displayType:{default:"tag"},textStyle:{type:[Boolean,null,String,Object,Array],default:()=>({})},width:{}},emits:["closed"],setup(e,{emit:l}){const t={primary:"user-info-tag--root theme-primary",success:"user-info-tag--root theme-success",warning:"user-info-tag--root theme-warning",danger:"user-info-tag--root theme-danger",info:"user-info-tag--root theme-info",lotusPink:"user-info-tag--root theme-lotus-pink",wineRed:"user-info-tag--root theme-wine-red",autumnOrange:"user-info-tag--root theme-autumn-orange",sunYellow:"user-info-tag--root theme-sun-yellow",seaBlue:"user-info-tag--root theme-sea-blue",moonlightBlue:"user-info-tag--root theme-moonlight-blue",clovePurple:"user-info-tag--root theme-clove-purple",skyGray:"user-info-tag--root theme-sky-gray"},d=e,n=U.ref();let a=a9(),i=$.useLoading(a),s=$.useUserApi(a);const c=U.ref(!1),F=U.ref(!1),o=l;U.onUnmounted(()=>{a=void 0,i=void 0,s=void 0});function h(){if(!n.value)if(d.userId)s==null||s.getById(d.userId).then(N=>{n.value=N,V()});else if(d.username&&d.realm){let N=d.username;if(N.indexOf("\\")>=0){const b=N.split("\\");N=b[b.length-1]}s==null||s.getByUserName(d.realm,N).then(b=>{n.value=b,V()})}else throw new Error("user-info-tag组件的userId和(realm, userName)属性不能都为空")}function V(){n.value&&(s==null||s.checkBookmarked(n.value.id).then(N=>c.value=N))}function W(){F.value=!1,o("closed",d.userId,d.realm,d.username)}function Q(){n.value&&(s==null||s.bookmarkUser(n.value.id).then(()=>c.value=!0))}function m(){n.value&&(s==null||s.unbookmarkUser(n.value.id).then(()=>c.value=!1))}return(N,b)=>(U.openBlock(),U.createBlock(U.unref(v.ElPopover),{width:"auto","hide-after":200,onBeforeEnter:h,placement:e.placement,visible:F.value,"onUpdate:visible":b[3]||(b[3]=r=>F.value=r)},{reference:U.withCtx(()=>[e.displayType==="tag"?(U.openBlock(),U.createElementBlock("div",{key:0,class:U.normalizeClass(t[d.theme]),style:U.normalizeStyle({width:typeof e.width=="number"?e.width+"px":e.width})},[U.createElementVNode("div",i9,[U.createVNode(U.unref(xW),{size:24,"user-id":e.userId,realm:e.realm,username:e.username,"has-avatar":e.showAvatarInTag},null,8,["user-id","realm","username","has-avatar"])]),U.createElementVNode("div",s9,[U.createTextVNode(U.toDisplayString(e.fullName)+" ",1),e.closable?(U.openBlock(),U.createElementBlock("div",{key:0,class:"close-btn",onClick:b[0]||(b[0]=r=>W())},[U.createVNode(U.unref(v.ElIcon),{size:10},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.Close))]),_:1})])):U.createCommentVNode("",!0)])],6)):(U.openBlock(),U.createElementBlock("span",{key:1,class:"user-info-text",style:U.normalizeStyle([e.textStyle,e.width?{width:typeof e.width=="number"?e.width+"px":e.width,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"bottom"}:{}])},U.toDisplayString(e.fullName),5))]),default:U.withCtx(()=>{var r,u,S,G,J,Y,L;return[U.withDirectives((U.openBlock(),U.createElementBlock("div",c9,[U.createElementVNode("div",U9,[U.createVNode(U.unref(xW),{"user-id":e.userId,realm:e.realm,username:e.username,size:75,"has-avatar":(r=n.value)==null?void 0:r.hasAvatar,style:{"margin-bottom":"8px"}},null,8,["user-id","realm","username","has-avatar"]),U.createElementVNode("div",Z9,[U.createVNode(U.unref(v.ElTooltip),{content:c.value?"取消常用人员":"设置为常用人员"},{default:U.withCtx(()=>[c.value?(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:1,color:"#FFBF29",onClick:b[2]||(b[2]=y=>m()),size:16},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.StarFilled))]),_:1})):(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:0,onClick:b[1]||(b[1]=y=>Q()),size:16},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.Star))]),_:1}))]),_:1},8,["content"])])]),U.createElementVNode("div",null,[U.createElementVNode("p",F9,U.toDisplayString(e.fullName),1),U.createElementVNode("p",o9," @"+U.toDisplayString(((S=(u=n.value)==null?void 0:u.department)==null?void 0:S.name)??"无归属部门"),1)]),U.createElementVNode("p",h9,[b[4]||(b[4]=U.createElementVNode("span",{class:"label"},"手机:",-1)),U.createTextVNode(" "+U.toDisplayString(!((G=n.value)!=null&&G.mobile)||n.value.mobile.length===0?"(未填写手机号)":(J=n.value)==null?void 0:J.mobile)+" ",1),b[5]||(b[5]=U.createElementVNode("br",null,null,-1)),b[6]||(b[6]=U.createElementVNode("span",{class:"label"},"邮箱:",-1)),U.createTextVNode(" "+U.toDisplayString(!((Y=n.value)!=null&&Y.email)||n.value.email.length===0?"(未填写邮箱号)":(L=n.value)==null?void 0:L.email),1)])])),[[U.vShow,F.value],[U.unref(v.vLoading),!!U.unref(i)]])]}),_:1},8,["placement","visible"]))}}),[["__scopeId","data-v-d0d81b4f"]]));function gW(e){var l=typeof e;return e!=null&&(l=="object"||l=="function")}var V9=typeof global=="object"&&global&&global.Object===Object&&global,W9=typeof self=="object"&&self&&self.Object===Object&&self,ny=V9||W9||Function("return this")(),Cr=function(){return ny.Date.now()},Q9=/\s/;function m9(e){for(var l=e.length;l--&&Q9.test(e.charAt(l)););return l}var N9=/^\s+/;function ay(e){return e&&e.slice(0,m9(e)+1).replace(N9,"")}var FU=ny.Symbol,iy=Object.prototype,R9=iy.hasOwnProperty,r9=iy.toString,p0=FU?FU.toStringTag:void 0;function b9(e){var l=R9.call(e,p0),t=e[p0];try{e[p0]=void 0;var d=!0}catch{}var n=r9.call(e);return d&&(l?e[p0]=t:delete e[p0]),n}var u9=Object.prototype,p9=u9.toString;function M9(e){return p9.call(e)}var S9="[object Null]",T9="[object Undefined]",sy=FU?FU.toStringTag:void 0;function J9(e){return e==null?e===void 0?T9:S9:sy&&sy in Object(e)?b9(e):M9(e)}function G9(e){return e!=null&&typeof e=="object"}var y9="[object Symbol]";function cy(e){return typeof e=="symbol"||G9(e)&&J9(e)==y9}var Uy=NaN,X9=/^[-+]0x[0-9a-f]+$/i,B9=/^0b[01]+$/i,Y9=/^0o[0-7]+$/i,k9=parseInt;function Zy(e){if(typeof e=="number")return e;if(cy(e))return Uy;if(gW(e)){var l=typeof e.valueOf=="function"?e.valueOf():e;e=gW(l)?l+"":l}if(typeof e!="string")return e===0?e:+e;e=ay(e);var t=B9.test(e);return t||Y9.test(e)?k9(e.slice(2),t?2:8):X9.test(e)?Uy:+e}var z9="Expected a function",L9=Math.max,I9=Math.min;function xr(e,l,t){var d,n,a,i,s,c,F=0,o=!1,h=!1,V=!0;if(typeof e!="function")throw new TypeError(z9);l=Zy(l)||0,gW(t)&&(o=!!t.leading,h="maxWait"in t,a=h?L9(Zy(t.maxWait)||0,l):a,V="trailing"in t?!!t.trailing:V);function W(J){var Y=d,L=n;return d=n=void 0,F=J,i=e.apply(L,Y),i}function Q(J){return F=J,s=setTimeout(b,l),o?W(J):i}function m(J){var Y=J-c,L=J-F,y=l-Y;return h?I9(y,a-L):y}function N(J){var Y=J-c,L=J-F;return c===void 0||Y>=l||Y<0||h&&L>=a}function b(){var J=Cr();if(N(J))return r(J);s=setTimeout(b,m(J))}function r(J){return s=void 0,V&&d?W(J):(d=n=void 0,i)}function u(){s!==void 0&&clearTimeout(s),F=0,d=c=n=s=void 0}function S(){return s===void 0?i:r(Cr())}function G(){var J=Cr(),Y=N(J);if(d=arguments,n=this,c=J,Y){if(s===void 0)return Q(c);if(h)return clearTimeout(s),s=setTimeout(b,l),W(c)}return s===void 0&&(s=setTimeout(b,l)),i}return G.cancel=u,G.flush=S,G}const jW=U.ref([]);function OW(){const e=$.useRealmApi(),l=async()=>{if(jW.value.length!==0)return;const d={};jW.value=await e.getAll(d)};return{realms:jW,getAllRealms:l,getDefaultRealm:async()=>(await l(),jW.value.find(d=>d.name==="ace-platform"))}}function gr(e,l,t,d,n,a){const i=U.ref({}),s=U.ref({currentPage:1,pageSize:50}),c=U.ref({total:0,users:[]});n||(n=$.createAxiosWithoutCache());const F=$.useUserApi(n),o=$.useLoading(n),h=U.ref(!1);function V(){m().then(N=>{t&&t(N,h.value),h.value=!1})}const W=xr(V,300);function Q(){c.value.total=0,c.value.users=[],s.value.currentPage!==1?s.value.currentPage=1:W()}U.watch(i,()=>{h.value=!0,Q()},{deep:!0}),U.watch(()=>s.value.pageSize,()=>{h.value=!0,Q()}),U.watch(()=>s.value.currentPage,()=>{m().then(N=>{t&&t(N,h.value),h.value=!1})});async function m(){if(e&&!e())return Promise.resolve(void 0);if(!i.value.realmId){const y=await OW().getDefaultRealm();i.value.realmId=y.id}const N=$.useUserQueryBuilder(),b=N.getQEntity();N.and(b.realm.id.eq(i.value.realmId)).and(b.recycled.eq(!1));const r=i.value.currentDept;r&&(r.id==ly?N.and(b.department.isNull()):r.id!==Ir&&N.and(b.department.sortPath.startWith(r.sortPath)));const u=i.value.classificationLevel;u&&N.and(b.classifiedLevel.loe(u));const S=i.value.currentGroup;S&&N.and(b.userGroups.any().group.sortPath.startWith(S.sortPath));const G=i.value.currentCustomGroup;G&&N.and(b.customGroups.any().customGroup.sortPath.startWith(G.sortPath));const J=i.value.name;if(J){const y="%"+J.split("").join("%")+"%";N.and(b.username.like(y).or(b.fullName.like(y)).or(b.pinYinName.like(y)).or(b.mobile.like(y)))}l&&N.and(l(b));const Y=i.value.currentSort;Y&&N.orderBy(Y);const L=N.build();if(a)return F.queryUserRefs(L).then(y=>(c.value.users=y,y));{const y=s.value.currentPage-1;return F.queryUserRefsPaged(L,y,s.value.pageSize).then(z=>(d&&y>0?c.value.users.push(...z.content):c.value.users=z.content,c.value.total=z.totalElements,z.content))}}return{queryParams:i,pageParams:s,queryResult:c,queryUsers:m,loading:o}}const jr=Nl(ht(U.defineComponent({__name:"departmentTree",props:U.mergeModels({realmId:{},showNoDepartment:{type:Boolean,default:!1},multiple:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change","loaded"],["update:modelValue"]),setup(e,{expose:l,emit:t}){const d=U.ref(),n=$.createAxiosWithoutCache(),a=$.useLoading(n),i=$.useDepartmentApi(n),s=e,c=t,F=U.useModel(e,"modelValue"),o=U.computed({get(){var Q;return(Q=F.value)==null?void 0:Q.id},set(Q){F.value=h.departments.find(m=>m.id===Q)??null}}),h=U.shallowReactive({departments:[]}),V=async()=>{if(!s.realmId)return;const Q=await i.getNormal(s.realmId,$.FromDeptSelect.BT);h.departments=[{id:Ir,label:"所有部门",name:"所有部门",shortCode:"",children:[],hasChildren:!1,sortIndex:-1,sortPath:"",dataVersion:0,entity:!1,attributes:{}},...s.showNoDepartment?[{id:ly,label:"无归属部门",name:"无归属部门",shortCode:"",children:[],hasChildren:!1,sortIndex:-100,sortPath:"no_dept",dataVersion:0,entity:!1,attributes:{}}]:[],...es(Q,"name")],o.value=h.departments[0].id,c("loaded",h.departments)},W=Q=>{F.value=Q,c("change",Q)};return U.watch(()=>s.realmId,()=>{V()}),l({reload:V}),V(),(Q,m)=>U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElTree),{ref_key:"deptTree",ref:d,data:U.unref(h).departments,size:"default","node-key":"id","default-expand-all":"","highlight-current":"","current-node-key":o.value,"expand-on-click-node":!1,onCurrentChange:W,props:{class:N=>{var b;return((b=F.value)==null?void 0:b.id)===N.id?"selected-group":"group"}}},null,8,["data","current-node-key","props"])),[[U.unref(v.vLoading),U.unref(a)]])}}),[["__scopeId","data-v-b247a32f"]])),Or="com.csicit.ace.scrollbar.wrapped";var D9="Expected a function";function M0(e,l,t){var d=!0,n=!0;if(typeof e!="function")throw new TypeError(D9);return gW(t)&&(d="leading"in t?!!t.leading:d,n="trailing"in t?!!t.trailing:n),xr(e,l,{leading:d,maxWait:l,trailing:n})}const Xn=new Map,vr=new Map;let Pl=null,Ll;async function oU(e,l){let t=Xn.get(l);if(t)return t;let d=vr.get(l);return d?await d:(d=e().then(n=>(Xn.set(l,n),n)).finally(()=>{vr.delete(l)}),vr.set(l,d),await d)}async function Fy(e){Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl));const l=await oU(()=>Ll.getAll(!0),"all");return e?l:l.filter(t=>t.name!=="ace-app-manage")}async function w9(e){Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),await oU(()=>Ll.getAll(!0),"all");let l=Xn.get("all").find(t=>t.id===e);return l||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl),l=await Ll.getById(e),l&&(Xn.get("all").find(t=>t.id===l.id)||Xn.get("all").push(l))),l}async function E9(e){Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),await oU(()=>Ll.getAll(!0),"all");let l=Xn.get("all").find(t=>t.name===e);return l||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl),l=await Ll.getByName(e),l&&(Xn.get("all").find(t=>t.id===l.id)||Xn.get("all").push(l))),l}async function oy(){return Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),await oU(Ll.getManageable,"manageable")}async function hy(){return Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),await oU(Ll.getAccessible,"accessible")}async function Vy(){return Ll||(Pl=Pl||$.createAxiosWithoutCache(),Ll=Ll||$.useAppApi(Pl)),(await oU(()=>Ll.getGlobalApp().then(e=>[e]),"global"))[0]}async function C9(){Xn.clear(),await Promise.all([Fy(),oy(),hy(),Vy()])}function hU(){return{getAll:Fy,getByName:E9,getById:w9,getManageable:oy,getAccessible:hy,getGlobal:Vy,refresh:C9}}const S0=new Map;let VU=new Map;function Wy(e,l,t,d){return e+":"+l+":"+(t??"")+":"+(d?"all":"by-category")}function Qy(){return{refreshGroupsCache(){S0.clear()},async getGroups(e,l,t,d){const n=Wy(e,l,t,d);let a=S0.get(n);if(a)return a;let i=VU.get(n);if(i)return await i;const s=$.createAxiosWithoutCache(),c=$.useUserGroupApi(s);return d?i=c.getAll(e,l):i=c.getByAppIdAndRealm(e,l,t),i=i.then(F=>(S0.set(n,F),F)).finally(()=>{VU.delete(n)}),VU.set(n,i),await i},async getGlobalGroups(e,l){const d=Wy("[global-app]",e,l,!0);let n=S0.get(d);if(n)return n;let a=VU.get(d);if(a)return await a;const i=$.createAxiosWithoutCache();return a=$.useUserGroupApi(i).getGlobalGroups(e,l).then(c=>(S0.set(d,c),c)).finally(()=>{VU.delete(d)}),VU.set(d,a),await a}}}const x9={class:"ja-user-group-tree"},g9={class:"name"},fr=Nl(ht(U.defineComponent({__name:"userGroupTree",props:U.mergeModels({realmId:{},multiple:{type:Boolean},showConsoleApp:{type:Boolean},appId:{},nodeHeight:{default:"auto"},category:{},global:{type:Boolean},showAllCategory:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change","loaded"],["update:modelValue"]),async setup(e,{expose:l,emit:t}){let d,n;const a=U.ref(),i=$.createAxiosWithoutCache(),s=$.useLoading(i),c=e,F=t,o=U.useModel(e,"modelValue"),h=U.ref(c.appId),V=U.computed({get(){var Y;return(Y=o.value)==null?void 0:Y.id},set(Y){o.value=S.groups.find(L=>L.id===Y)??null}}),{getGlobal:W,getAccessible:Q}=hU(),{getGroups:m,getGlobalGroups:N}=Qy();let[b,r]=([d,n]=U.withAsyncContext(()=>Promise.all([W(),Q()])),d=await d,n(),d);if(r=[...r],r.unshift(b),!c.showConsoleApp){const Y=r.findIndex(L=>L.name=="ace-app-manage");Y>=0&&r.splice(Y,1)}const u=U.ref(r);h.value||(h.value=b.id);const S=U.shallowReactive({groups:[]}),G=async()=>{if(!c.realmId||!h.value)return;let Y;c.global?Y=await N(c.realmId):Y=await m(h.value,c.realmId,c.category,c.showAllCategory),S.groups=[...es(Y,"name")],!o.value&&S.groups.length>0&&(V.value=S.groups[0].id),F("loaded",S.groups)},J=Y=>{o.value=Y,F("change",Y)};return U.watch(()=>({appId:c.appId,realmId:c.realmId,category:c.category}),()=>{G()},{deep:!0,immediate:!0}),U.watch(()=>c.appId,()=>{h.value=c.appId}),l({reload:G,elTree:a}),(Y,L)=>(U.openBlock(),U.createElementBlock("div",x9,[c.appId?U.createCommentVNode("",!0):(U.openBlock(),U.createBlock(U.unref(v.ElSelect),{key:0,modelValue:h.value,"onUpdate:modelValue":L[0]||(L[0]=y=>h.value=y),style:{width:"100%"}},{default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(u.value,y=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:y.id,label:y.caption,value:y.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])),U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElTree),U.mergeProps({style:{width:"100%","--ja-group-tree-node-height":c.nodeHeight},ref_key:"groupTree",ref:a,data:U.unref(S).groups,size:"default","node-key":"id","highlight-current":"","default-expand-all":"","current-node-key":V.value,"expand-on-click-node":!1},Y.$attrs,{onCurrentChange:J,props:{class:y=>{var z;return((z=o.value)==null?void 0:z.id)===y.id?"selected-group":"group"}}}),{default:U.withCtx(({data:y})=>[U.createElementVNode("div",null,[U.createElementVNode("div",g9,[U.createTextVNode(U.toDisplayString(y.label)+" ",1),y.resourceScoped?(U.openBlock(),U.createBlock(U.unref(v.ElTag),{key:0,type:"info"},{default:U.withCtx(()=>[...L[1]||(L[1]=[U.createTextVNode("资源域",-1)])]),_:1})):U.createCommentVNode("",!0)])])]),_:1},16,["style","data","current-node-key","props"])),[[U.unref(v.vLoading),U.unref(s)]])]))}}),[["__scopeId","data-v-029d0f4c"]])),j9=Nl(ht(U.defineComponent({__name:"customGroupTree",props:U.mergeModels({multiple:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change","loaded"],["update:modelValue"]),setup(e,{expose:l,emit:t}){const d=U.ref(),n=$.createAxiosWithoutCache(),a=$.useLoading(n),i=$.useCustomGroupApi(n),s=t,c=U.useModel(e,"modelValue"),F=U.computed({get(){var W;return(W=c.value)==null?void 0:W.id},set(W){c.value=o.groups.find(Q=>Q.id===W)??null}}),o=U.shallowReactive({groups:[]}),h=async()=>{const W=await i.getAll();o.groups=[...es(W,"name")],o.groups.length>0&&(c.value=o.groups[0],F.value=c.value.id),s("loaded",o.groups)},V=W=>{c.value=W,s("change",W)};return l({reload:h}),h(),(W,Q)=>U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElTree),{ref_key:"deptTree",ref:d,data:U.unref(o).groups,size:"default","node-key":"id","default-expand-all":"","highlight-current":"","current-node-key":F.value,"expand-on-click-node":!1,onCurrentChange:V,props:{class:m=>{var N;return((N=c.value)==null?void 0:N.id)===m.id?"selected-group":"group"}}},null,8,["data","current-node-key","props"])),[[U.unref(v.vLoading),U.unref(a)]])}}),[["__scopeId","data-v-4e04bc5c"]])),O9={class:"ja-user-select-dialog"},v9={class:"ja-user-select-dialog__content"},f9={style:{display:"flex","flex-direction":"row","align-content":"baseline",width:"100%",gap:"0"}},Kr=Nl(ht(U.defineComponent({__name:"userSelectDialog",props:U.mergeModels({realmId:{type:String,required:!1},multiple:{type:Boolean,required:!1,default:!1},classificationLevel:{type:Number,required:!1,default:0},customFilter:{type:Function,required:!1},maxSelect:{type:Number,required:!1,default:0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e,{expose:l}){const t=e,d=U.useModel(e,"modelValue"),n=U.ref();async function a(){if(t.realmId)n.value=t.realmId;else{const K=await OW().getDefaultRealm();n.value=K.id}}if(a(),t.multiple){if(d.value||(d.value=[]),!Array.isArray(d.value))throw new Error("多选模式的选择用户对话框(multiple设置为true)的v-model必须是数组类型")}else if(Array.isArray(d.value))throw new Error("单选模式的选择用户对话框(multiple设置为false)的v-model只能为空或是单个UserReference对象");const i=U.ref(!1),s=U.ref(),c=U.ref(),F=U.ref(),o=$.createAxiosWithoutCache(),h=$.useLoading(o),V=U.ref(!1),W=U.ref([]),Q=U.reactive(new Map),m=U.ref("dept");U.provide(Or,void 0);const N=U.ref(Array.isArray(d.value)?[...d.value]:d.value),b=gr(void 0,t.customFilter,K=>{V.value||(W.value=K??[])},!1,o,!0),r=[{key:"user",dataKey:"id",width:290,title:"用户",cellRenderer:({cellData:K,rowData:A,rowIndex:P})=>{const{hasAvatar:q,fullName:_}=A,g=A,tl=P;return U.h("div",{class:"user-row",onMousedown:()=>B(g),onMouseenter:()=>k(g),onMouseup:X,onMouseover:nl=>x(nl,tl)},[U.h(v.ElIcon,{color:"#0D6A9F"},()=>Y(g)?U.h(ml.Check):void 0),U.h(ZU,{userId:K,theme:L(g),placement:"right-start",hasAvatar:!1,fullName:_}),U.h("div",{style:"flex:auto"})])}}],u=U.ref(!1),S=U.ref(),G=M0(D,100),J=M0(y,100);U.watch(s,()=>{m.value=="dept"&&(b.queryParams.value.currentDept=s.value)}),U.watch(c,()=>{m.value=="group"&&(b.queryParams.value.currentGroup=c.value)}),U.watch(F,()=>{m.value=="customGroup"&&(b.queryParams.value.currentCustomGroup=F.value)}),U.watch(()=>t.classificationLevel,()=>{b.queryParams.value.classificationLevel=t.classificationLevel}),U.watch(m,()=>{m.value==="dept"?(b.queryParams.value.currentDept=s.value,b.queryParams.value.currentGroup=void 0,b.queryParams.value.currentCustomGroup=void 0):m.value==="group"?(b.queryParams.value.currentDept=void 0,b.queryParams.value.currentCustomGroup=void 0,b.queryParams.value.currentGroup=c.value):m.value==="customGroup"&&(b.queryParams.value.currentDept=void 0,b.queryParams.value.currentCustomGroup=F.value,b.queryParams.value.currentGroup=void 0)});function Y(K){return Array.isArray(N.value)?Q.has(K.id):N.value&&N.value.id===K.id}function L(K){return Y(K)?"autumnOrange":"skyGray"}function y(K){if(Array.isArray(N.value)){const A=N.value.findIndex(P=>P.id===K.id);if(A>=0)Q.delete(K.id),N.value.splice(A,1);else{if(t.maxSelect>0&&N.value.length>=t.maxSelect){v.ElMessage({message:`已超过最大选择数量 ${t.maxSelect}`,type:"warning",plain:!0});return}Q.set(K.id,K),N.value.push(K)}}else N.value=K}U.onUnmounted(()=>{G.cancel(),J.cancel()});function z(){if(Array.isArray(N.value)){const K=b.queryResult.value.users.filter(A=>!Y(A));if(t.maxSelect>0){const A=t.maxSelect-N.value.length;if(A>0){const P=K.slice(0,A);P.forEach(q=>Q.set(q.id,q)),N.value.push(...P)}}else K.forEach(A=>Q.set(A.id,A)),N.value.push(...K)}}function I(){Array.isArray(N.value)&&(Q.clear(),N.value.splice(0))}function O(){if(Array.isArray(N.value)){const K=b.queryResult.value.users.filter(A=>!Y(A));if(Q.clear(),t.maxSelect>0){const A=K.slice(0,t.maxSelect);A.forEach(P=>Q.set(P.id,P)),N.value.splice(0),N.value.push(...A)}else K.forEach(A=>Q.set(A.id,A)),N.value.splice(0),N.value.push(...K)}}function E(){if(t.multiple&&Array.isArray(N.value)&&t.maxSelect>0&&N.value.length>t.maxSelect){v.ElMessage({message:`已超过最大选择数量 ${t.maxSelect}`,type:"warning",plain:!0});return}d.value=N.value,i.value=!1}function j(){V.value=!V.value,V.value?Array.isArray(N.value)?W.value=[...N.value]:W.value=N.value?[N.value]:[]:W.value=b.queryResult.value.users}function C(){!b.queryParams.value.realmId&&n.value&&(b.queryParams.value.realmId=n.value),N.value=Array.isArray(d.value)?[...d.value]:d.value,Array.isArray(d.value)&&(Q.clear(),d.value.forEach(K=>Q.set(K.id,K)))}function B(K){y(K),u.value=!0}function X(){u.value=!1}function k(K){u.value&&y(K)}let w;function D(){w&&w<W.value.length&&S.value.scrollToRow(w+1),w=void 0}function x(K,A){u.value=K.buttons>0,u.value&&(w=A,G())}return l({show(){i.value=!0}}),(K,A)=>(U.openBlock(),U.createBlock(U.unref(v.ElDialog),{modelValue:i.value,"onUpdate:modelValue":A[5]||(A[5]=P=>i.value=P),"destroy-on-close":"",draggable:"",width:"640",title:"选择人员","append-to-body":"",onOpen:C},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{type:"primary",shortcut:"Ctrl+Alt+Enter",onClick:E,size:"default"},{default:U.withCtx(()=>[...A[10]||(A[10]=[U.createTextVNode("确定 ",-1)])]),_:1}),U.createVNode(U.unref(v.ElButton),{plain:"",size:"default",onClick:A[4]||(A[4]=P=>i.value=!1)},{default:U.withCtx(()=>[...A[11]||(A[11]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createElementVNode("div",O9,[U.createVNode(U.unref(v.ElTabs),{class:"ja-user-select-dialog__left",modelValue:m.value,"onUpdate:modelValue":A[3]||(A[3]=P=>m.value=P)},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElTabPane),{name:"dept",label:"按部门",class:"ja-user-select-dialog__left-dept-pane"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElScrollbar),{height:"400"},{default:U.withCtx(()=>[U.createVNode(U.unref(jr),{modelValue:s.value,"onUpdate:modelValue":A[0]||(A[0]=P=>s.value=P),"realm-id":n.value},null,8,["modelValue","realm-id"])]),_:1})]),_:1}),U.createVNode(U.unref(v.ElTabPane),{name:"group",label:"按用户组"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElScrollbar),{height:"400"},{default:U.withCtx(()=>[U.createVNode(U.unref(fr),{modelValue:c.value,"onUpdate:modelValue":A[1]||(A[1]=P=>c.value=P),"show-all-category":"","realm-id":n.value},null,8,["modelValue","realm-id"])]),_:1})]),_:1}),U.createVNode(U.unref(v.ElTabPane),{name:"customGroup",label:"按自定义组"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElScrollbar),{height:"400"},{default:U.withCtx(()=>[U.createVNode(U.unref(j9),{modelValue:F.value,"onUpdate:modelValue":A[2]||(A[2]=P=>F.value=P)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),U.createElementVNode("div",v9,[U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElTableV2),{ref_key:"userTable",ref:S,"row-height":40,"header-height":40,columns:r,data:W.value,width:300,height:450,fixed:""},{header:U.withCtx(()=>[U.createElementVNode("div",f9,[U.createVNode(U.unref(v.ElText),{style:{flex:"auto","font-weight":"600"}},{default:U.withCtx(()=>[A[6]||(A[6]=U.createTextVNode(" 人员 ",-1)),U.createVNode(U.unref(v.ElTooltip),{content:"切换筛选条件,不会清除已选人员。支持鼠标拖动多选。"},{default:U.withCtx(()=>[t.multiple?(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:0},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.QuestionFilled))]),_:1})):U.createCommentVNode("",!0)]),_:1})]),_:1}),t.multiple?(U.openBlock(),U.createBlock(U.unref(v.ElText),{key:0,style:{flex:"none","margin-right":"12px"}},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElTooltip),{content:V.value?"显示所有人员":"只显示选中人员"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElIcon),{size:"15",onClick:j},{default:U.withCtx(()=>[V.value?(U.openBlock(),U.createBlock(U.unref(ml.View),{key:1})):(U.openBlock(),U.createBlock(U.unref(ml.Hide),{key:0}))]),_:1})]),_:1},8,["content"])]),_:1})):U.createCommentVNode("",!0),t.multiple?(U.openBlock(),U.createBlock(U.unref(Vt),{key:1,plain:"",style:{flex:"none"},link:"",tooltip:"全部选中",shortcut:"Ctrl+A",onClick:z},{default:U.withCtx(()=>[...A[7]||(A[7]=[U.createTextVNode("全选 ",-1)])]),_:1})):U.createCommentVNode("",!0),t.multiple?(U.openBlock(),U.createBlock(U.unref(Vt),{key:2,plain:"",style:{flex:"none"},link:"",tooltip:"清除全部选中项",shortcut:"Ctrl+Q",onClick:I},{default:U.withCtx(()=>[...A[8]||(A[8]=[U.createTextVNode("全消 ",-1)])]),_:1})):U.createCommentVNode("",!0),t.multiple?(U.openBlock(),U.createBlock(U.unref(Vt),{key:3,plain:"",style:{flex:"none"},link:"",tooltip:"清除选中项,并选中之前未被选中项",shortcut:"Ctrl+F",onClick:O},{default:U.withCtx(()=>[...A[9]||(A[9]=[U.createTextVNode("反选 ",-1)])]),_:1})):U.createCommentVNode("",!0)])]),_:1},8,["data"])),[[U.unref(v.vLoading),U.unref(h)]])])])]),_:1},8,["modelValue"]))}}),[["__scopeId","data-v-90712d51"]])),Hr=Nl(U.defineComponent({__name:"Scrollbar",props:{ariaLabel:{},ariaOrientation:{},distance:{},height:{},maxHeight:{},native:{type:Boolean},wrapStyle:{},wrapClass:{},viewClass:{},viewStyle:{},noresize:{type:Boolean},tag:{},always:{type:Boolean},minSize:{},tabindex:{},id:{},role:{}},setup(e,{expose:l}){const t=e,d=U.ref(),n=U.ref([]),a=new Map;l({elScrollbar:d}),U.provide(Or,n);let i=!1;U.watch(n,()=>{i&&c()},{deep:!0});const s=new IntersectionObserver(o=>{o.forEach(h=>{const V=a.get(h.target);V==null||V.onInView(h.isIntersecting)})});async function c(){var h;await U.nextTick();const o=(h=d.value)==null?void 0:h.$el;if(!(!n.value||!o)){try{for(let V=0;V<n.value.length;V++)if(n.value[V]){const W=n.value[V],Q=W.childElement.getBoundingClientRect(),m=o.getBoundingClientRect();Q.top>=m.top&&Q.bottom<=m.bottom&&Q.left>=m.left&&Q.right<=m.right&&W.onInView(!0),a.set(W.childElement,W),s.observe(W.childElement)}}finally{n.value&&n.value.splice(0)}i=!0}}U.onMounted(async()=>{await c()}),U.onUnmounted(()=>{a.forEach(o=>{s.disconnect()})});const F=U.computed(()=>t);return(o,h)=>(U.openBlock(),U.createBlock(U.unref(v.ElScrollbar),U.mergeProps({ref_key:"scroll",ref:d,class:"scroll-container"},{...F.value,...o.$attrs}),U.createSlots({_:2},[U.renderList(o.$slots,(V,W)=>({name:W,fn:U.withCtx(()=>[U.renderSlot(o.$slots,W)])}))]),1040))}}));function K9(e,l){for(var t=-1,d=e==null?0:e.length,n=Array(d);++t<d;)n[t]=l(e[t],t,e);return n}var H9=Array.isArray,my=FU?FU.prototype:void 0,Ny=my?my.toString:void 0;function Pr(e){if(typeof e=="string")return e;if(H9(e))return K9(e,Pr)+"";if(cy(e))return Ny?Ny.call(e):"";var l=e+"";return l=="0"&&1/e==-1/0?"-0":l}function P9(e,l,t,d){for(var n=e.length,a=t+-1;++a<n;)if(l(e[a],a,e))return a;return-1}function A9(e){return e!==e}function _9(e,l,t){for(var d=t-1,n=e.length;++d<n;)if(e[d]===l)return d;return-1}function Ry(e,l,t){return l===l?_9(e,l,t):P9(e,A9,t)}function q9(e){return e==null?"":Pr(e)}function $9(e,l,t){var d=-1,n=e.length;l<0&&(l=-l>n?0:n+l),t=t>n?n:t,t<0&&(t+=n),n=l>t?0:t-l>>>0,l>>>=0;for(var a=Array(n);++d<n;)a[d]=e[d+l];return a}function lx(e,l,t){var d=e.length;return t=t===void 0?d:t,!l&&t>=d?e:$9(e,l,t)}var tx="\\ud800-\\udfff",ex="\\u0300-\\u036f",dx="\\ufe20-\\ufe2f",nx="\\u20d0-\\u20ff",ax=ex+dx+nx,ix="\\ufe0e\\ufe0f",sx="\\u200d",cx=RegExp("["+sx+tx+ax+ix+"]");function Ux(e){return cx.test(e)}function Zx(e){return e.split("")}var ry="\\ud800-\\udfff",Fx="\\u0300-\\u036f",ox="\\ufe20-\\ufe2f",hx="\\u20d0-\\u20ff",Vx=Fx+ox+hx,Wx="\\ufe0e\\ufe0f",Qx="["+ry+"]",Ar="["+Vx+"]",_r="\\ud83c[\\udffb-\\udfff]",mx="(?:"+Ar+"|"+_r+")",by="[^"+ry+"]",uy="(?:\\ud83c[\\udde6-\\uddff]){2}",py="[\\ud800-\\udbff][\\udc00-\\udfff]",Nx="\\u200d",My=mx+"?",Sy="["+Wx+"]?",Rx="(?:"+Nx+"(?:"+[by,uy,py].join("|")+")"+Sy+My+")*",rx=Sy+My+Rx,bx="(?:"+[by+Ar+"?",Ar,uy,py,Qx].join("|")+")",ux=RegExp(_r+"(?="+_r+")|"+bx+rx,"g");function px(e){return e.match(ux)||[]}function Ty(e){return Ux(e)?px(e):Zx(e)}function Mx(e,l){for(var t=e.length;t--&&Ry(l,e[t],0)>-1;);return t}function Sx(e,l){for(var t=-1,d=e.length;++t<d&&Ry(l,e[t],0)>-1;);return t}function Tx(e,l,t){if(e=q9(e),e&&l===void 0)return ay(e);if(!e||!(l=Pr(l)))return e;var d=Ty(e),n=Ty(l),a=Sx(d,n),i=Mx(d,n)+1;return lx(d,a,i).join("")}const T0=new Map,vW={mounted(e){let l;if(e instanceof HTMLInputElement)l=setTimeout(()=>e==null?void 0:e.focus(),500),T0.set(e,l);else{const t=e.querySelectorAll("input");t.length>0&&t.item(0)instanceof HTMLInputElement&&(l=setTimeout(()=>{var d;return(d=t==null?void 0:t.item(0))==null?void 0:d.focus()},500),T0.set(e,l))}},onUnmounted(e){T0.has(e)&&(clearTimeout(T0.get(e)),T0.delete(e))}},Jx={class:"ja-custom-group-manager"},Gx=ht(U.defineComponent({__name:"CustomGroupManager",props:{users:{default:()=>[]}},setup(e,{expose:l}){const t=U.ref(!1),d=$.createAxiosWithoutCache(),n=$.useCustomGroupApi(d),a=U.ref(),i={label:"name",children:"children",isLeaf:(S,G)=>!S.hasChildren,class:S=>{var G;return S.id===((G=s.value)==null?void 0:G.id)?"selected-group":"group"}},s=U.ref(),c=U.ref(!1),F=U.ref(),o=$.useLoading(d),h=e,V={};async function W(){const S=es(await n.getAll()),G={id:"-1",name:"[顶级组]",children:S,dataVersion:0,hasChildren:S.length>0,label:"",parentId:void 0,sortIndex:0,sortPath:""};return a.value=[G],G}async function Q(){s.value=await W()}function m(S){s.value=S}function N(){F.value=void 0,c.value=!0}async function b(){var S,G;await n.create({name:F.value,parentId:((S=s.value)==null?void 0:S.id)=="-1"||(G=s.value)==null?void 0:G.id}),c.value=!1,await W()}async function r(){s.value&&s.value.id!=="-1"&&(await v.ElMessageBox.confirm("确定要删除选中的自定义组?","确认删除"),await n.delete(s.value.id),await W(),s.value=void 0)}async function u(){var S;if(!s.value||s.value.id==="-1"){v.ElMessage.warning("请选择要保存到的自定义用户组");return}await n.setMembers({id:s.value.id,userIds:((S=h.users)==null?void 0:S.map(G=>G.id))??[]},V),t.value=!1}return l({show(){t.value=!0},close(){t.value=!1}}),(S,G)=>(U.openBlock(),U.createElementBlock(U.Fragment,null,[U.createVNode(U.unref(v.ElDialog),{modelValue:t.value,"onUpdate:modelValue":G[1]||(G[1]=J=>t.value=J),"destroy-on-close":"","append-to-body":"",draggable:"",title:"保存为自定义组",width:"360",onOpen:Q},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{type:"primary",shortcut:"Alt+O",loading:U.unref(o),onClick:u},{default:U.withCtx(()=>[...G[6]||(G[6]=[U.createTextVNode("确定 ",-1)])]),_:1},8,["loading"]),U.createVNode(U.unref(v.ElButton),{onClick:G[0]||(G[0]=J=>t.value=!1)},{default:U.withCtx(()=>[...G[7]||(G[7]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createElementVNode("div",Jx,[U.createVNode(U.unref(v.ElSpace),null,{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElText),null,{default:U.withCtx(()=>[...G[5]||(G[5]=[U.createTextVNode("请创建或选择要保存为的自定义组:",-1)])]),_:1}),U.createVNode(U.unref(Vt),{circle:"",icon:U.unref(ml.Plus),tooltip:"添加自定义组",shortcut:"Alt+G",size:"small",onClick:N,loading:U.unref(o)},null,8,["icon","loading"]),U.createVNode(U.unref(Vt),{circle:"",icon:U.unref(ml.Minus),tooltip:"删除自定义组",shortcut:"Alt+D",size:"small",onClick:r,loading:U.unref(o)},null,8,["icon","loading"])]),_:1}),U.createVNode(U.unref(v.ElScrollbar),{height:"360px"},{default:U.withCtx(()=>{var J;return[U.createVNode(U.unref(v.ElTree),{data:a.value,"node-key":"id",props:i,"default-expand-all":"","expand-on-click-node":!1,onCurrentChange:m,"current-node-key":((J=s.value)==null?void 0:J.id)??-1},null,8,["data","current-node-key"])]}),_:1})])]),_:1},8,["modelValue"]),U.createVNode(U.unref(v.ElDialog),{modelValue:c.value,"onUpdate:modelValue":G[4]||(G[4]=J=>c.value=J),"destroy-on-close":"","append-to-body":"",title:"添加自定义组",width:"360px"},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{type:"primary",shortcut:"Alt+P",onClick:b,loading:U.unref(o),size:"default"},{default:U.withCtx(()=>[...G[8]||(G[8]=[U.createTextVNode(" 确定 ",-1)])]),_:1},8,["loading"]),U.createVNode(U.unref(v.ElButton),{onClick:G[3]||(G[3]=J=>c.value=!1),size:"default"},{default:U.withCtx(()=>[...G[9]||(G[9]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createVNode(U.unref(v.ElForm),{"label-position":"top"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElFormItem),{label:"自定义组名",required:""},{default:U.withCtx(()=>[U.withDirectives(U.createVNode(U.unref(v.ElInput),{modelValue:F.value,"onUpdate:modelValue":G[2]||(G[2]=J=>F.value=J),style:{width:"100%"}},null,8,["modelValue"]),[[U.unref(vW)]])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),[["__scopeId","data-v-1bab28b9"]]),yx={class:"ja-user-list"},Xx=["onMouseenter","onMousedown","onMouseover"],Bx={key:0,class:"page-indicator"},Yx={class:"nb-spinner"},kx=1,Jy=ht(U.defineComponent({__name:"JaUserList",props:U.mergeModels({emptyText:{},multiple:{type:Boolean},total:{},pageSize:{},height:{},loading:{type:Boolean},users:{},maxSelect:{}},{modelValue:{required:!0},modelModifiers:{},page:{required:!0},pageModifiers:{}}),emits:U.mergeModels(["arrowKeyDown","itemClicked"],["update:modelValue","update:page"]),setup(e,{expose:l,emit:t}){const d=e,n=U.ref(0),a=U.ref(),i=U.ref(!1),s=U.useModel(e,"modelValue"),c=U.useModel(e,"page"),F=t,h=M0(()=>{var E;const O=(E=a.value)==null?void 0:E.wrapRef;O&&O.scrollHeight-O.scrollTop<=O.clientHeight+kx&&c.value<d.total/d.pageSize&&c.value++},200);function V(O){if(d.multiple){if(!Array.isArray(s.value))throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组");const E=s.value.findIndex(j=>j.id==O.id);if(E<0){if(d.maxSelect&&d.maxSelect>0&&s.value.length>=d.maxSelect){v.ElMessage({message:`已超过最大选择数量 ${d.maxSelect}`,plain:!0,type:"warning"});return}s.value.push(O)}else s.value.splice(E,1)}else{if(Array.isArray(s.value))throw new Error("UserPicker组件设置为单选模式时,v-model必须绑定UserReference对象或null");s.value!==null&&O.id===s.value.id?s.value=null:s.value=O}}let W;function Q(O){V(O),i.value=!0,W=O}function m(){i.value=!1,F("itemClicked",W),W=void 0}function N(O){console.log("点击"),i.value&&V(O)}function b(){n.value<d.users.length-1&&n.value++,u()}function r(){n.value>0&&n.value--,u()}const u=()=>{U.nextTick(()=>{var j,C,B;const O=(j=a.value)==null?void 0:j.$refs.wrapRef,E=O==null?void 0:O.querySelectorAll("li")[n.value];if(E&&O){const X=E.offsetTop,k=E.offsetTop+E.offsetHeight,w=O.scrollTop,D=O.scrollTop+O.clientHeight;k>D?(C=a.value)==null||C.scrollTo(0,k-O.clientHeight+E.offsetHeight-38):X<w&&((B=a.value)==null||B.scrollTo(0,X))}})},S=M0(b,100),G=M0(r,100);function J(O,E){var j;if(n.value=E,i.value=O.buttons>0,i.value){const C=(j=a.value)==null?void 0:j.$refs.wrapRef,B=O.target;if(B&&C){const X=B.offsetTop,k=B.offsetTop+B.offsetHeight,w=C.scrollTop,D=C.scrollTop+C.clientHeight;k+20>D?S():X<w+20&&G()}}}function Y(O){var E;if(d.multiple){if(!Array.isArray(s.value))throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组");return s.value.some(j=>j.id===O.id)}else{if(Array.isArray(s.value))throw new Error("UserPicker组件设置为单选模式时,v-model必须绑定UserReference对象");return((E=s.value)==null?void 0:E.id)===O.id}}const L=O=>{var E;return Array.isArray(y.value)?y.value.some(j=>j.id===O.id)?"autumnOrange":"skyGray":((E=y.value)==null?void 0:E.id)===O.id?"autumnOrange":"skyGray"},y=U.computed(()=>{const O=Array.isArray(s.value);if(d.multiple&&O)return s.value;if(!d.multiple&&!O)return s.value?[s.value]:[];if(!d.multiple&&O)return s.value;throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组")});function z(O){return O===n.value?"active":""}const I=U.computed(()=>d.loading&&d.users.length==0);return l({scrollUp(){r()},scrollDown(){b()},activeIndex:n}),U.watch(()=>d.users,()=>{n.value=0},{deep:!1}),U.onUnmounted(()=>{S.cancel(),G.cancel(),h.cancel()}),(O,E)=>(U.openBlock(),U.createElementBlock("div",yx,[U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElScrollbar),{height:e.height,ref_key:"scrollbar",ref:a,always:"",onScroll:U.unref(h)},{default:U.withCtx(()=>[e.users.length>0?(U.openBlock(),U.createElementBlock("ul",{key:0,onMouseup:m},[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(e.users,(j,C)=>(U.openBlock(),U.createElementBlock("li",{key:j.id,class:U.normalizeClass(z(C)),onMouseenter:B=>i.value&&N(j),onMousedown:B=>Q(j),onMouseover:B=>J(B,C)},[U.createVNode(U.unref(v.ElIcon),{color:"#0D6A9F"},{default:U.withCtx(()=>[Y(j)?(U.openBlock(),U.createBlock(U.unref(ml.Check),{key:0})):U.createCommentVNode("",!0)]),_:2},1024),U.createVNode(U.unref(ZU),{"user-id":j.id,"full-name":j.fullName,placement:"left-start",theme:L(j)},null,8,["user-id","full-name","theme"])],42,Xx))),128))],32)):(U.openBlock(),U.createBlock(U.unref(v.ElEmpty),{key:1,description:e.emptyText},null,8,["description"]))]),_:1},8,["height","onScroll"])),[[U.unref(v.vLoading),I.value]]),e.users.length>0?(U.openBlock(),U.createElementBlock("div",Bx,[U.withDirectives(U.createElementVNode("div",Yx,null,512),[[U.vShow,e.loading]]),U.createTextVNode(" 已加载 "+U.toDisplayString(c.value)+" /"+U.toDisplayString(Math.ceil(e.total/e.pageSize))+"页 ",1)])):U.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-bf81e728"]]),zx={class:"ja-user-picker__root"},Lx={style:{display:"flex","align-items":"center"}},Ix={class:"ja-user-picker-bookmark__dropdown"},Dx={style:{width:"100%",display:"flex","align-content":"center","justify-content":"end","margin-bottom":"4px"}},wx={style:{color:"var(--el-color-info-light-5)"}},Ex={class:"dropdown-header"},Cx={key:0,class:"ja-user-picker__tag-container"},xx={key:0,class:"more-tag"},gx={key:1},J0=0,Gy=ht(U.defineComponent({__name:"UserPicker",props:U.mergeModels({trigger:{default:"hover"},realmId:{},shortcut:{default:"Ctrl+Alt+U"},multiple:{type:Boolean,default:!1},classificationLevel:{default:0},customFilter:{},maxShowCount:{default:20},height:{},maxHeight:{default:"100%"},showUserTag:{type:Boolean,default:!0},maxSelect:{default:0},disabled:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=U.ref(),d=U.ref();async function n(){if(l.realmId)t.value=l.realmId;else{const D=await OW().getDefaultRealm();t.value=D.id}}n(),U.watch(()=>l.realmId,n);const a=$.createAxiosWithoutCache(),i=$.useUserApi(a),s=U.shallowRef([]),c=U.useModel(e,"modelValue"),F=U.ref(),o=U.ref(!1),{queryResult:h,queryParams:V,pageParams:W,loading:Q}=gr(()=>V.value.name!=null&&V.value.name.length>J0,l.customFilter,(D,x)=>{var K,A;D?(s.value=h.value.users,x&&((A=(K=N.value)==null?void 0:K.elScrollbar)==null||A.scrollTo(0,0))):G()},!0,a,!1),m=U.ref(),N=U.ref(),b=U.ref(),r=U.ref(),u=U.ref();function S(D){if(l.multiple){if(!Array.isArray(c.value))throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组");const x=c.value.findIndex(K=>K.id==D.id);if(x<0){if(l.maxSelect>0&&c.value.length>=l.maxSelect){v.ElMessage({message:`已超过最大选择数量 ${l.maxSelect}`,plain:!0,type:"warning"});return}c.value.push(D)}else c.value.splice(x,1)}else{if(Array.isArray(c.value))throw new Error("UserPicker组件设置为单选模式时,v-model必须绑定UserReference对象或者null");c.value!==null&&D.id===c.value.id?c.value=null:c.value=D}}function G(){l.realmId&&(V.value.realmId=l.realmId),V.value.name&&V.value.name.length>J0&&(V.value.name=void 0);const D=$.useUserQueryBuilder();if(l.customFilter){const x=D.getQEntity();D.and(l.customFilter(x))}i.getBookmarkedUsers(D.build()).then(x=>{s.value=x}),setTimeout(()=>{var x;(x=F.value)==null||x.focus()},300)}function J(){var D;o.value=!1,(D=m.value)==null||D.$el.focus()}function Y(){var D;(D=r.value)==null||D.show()}function L(D){if(!l.disabled)if(Array.isArray(c.value)){const x=c.value.findIndex(K=>K.id==D);x>=0&&c.value.splice(x,1)}else c.value=null}function y(){var D;u.value.scrollDown(),(D=F.value)==null||D.focus()}function z(){var D;u.value.scrollUp(),(D=F.value)==null||D.focus()}function I(){var D;S(s.value[(D=u.value)==null?void 0:D.activeIndex])}function O(){l.disabled||(o.value=!0)}function E(){const D=c.value,x=s.value.filter(K=>!D.some(A=>A.id===K.id));if(l.maxSelect>0){const K=l.maxSelect-D.length;K>0&&D.push(...x.slice(0,K))}else D.push(...x)}function j(){l.multiple?c.value=[]:c.value=null}function C(){var D;(D=F.value)==null||D.focus()}const B=U.computed(()=>{if(l.multiple&&Array.isArray(c.value))return c.value;if(!l.multiple&&!Array.isArray(c.value))return c.value?[c.value]:[];throw new Error("UserPicker组件设置为多选模式(multiple)时,v-model必须绑定UserReference数组")});function X(){var D;l.disabled||((D=b.value)==null||D.show(),o.value=!1)}function k(){l.disabled||(o.value=!0)}const w=U.computed(()=>B.value.slice(0,l.maxShowCount));return U.watch(()=>l.classificationLevel,()=>{V.value.classificationLevel=l.classificationLevel}),(D,x)=>(U.openBlock(),U.createElementBlock(U.Fragment,null,[U.createVNode(U.unref(Hr),U.mergeProps({"max-height":l.maxHeight,height:l.height},D.$attrs,{style:{"overflow-x":"hidden"}}),{default:U.withCtx(()=>[U.withDirectives((U.openBlock(),U.createElementBlock("div",zx,[U.createVNode(U.unref(v.ElPopover),{ref_key:"bookmarkDropdown",ref:d,onShow:G,onHide:J,visible:o.value,"onUpdate:visible":x[3]||(x[3]=K=>o.value=K),width:"auto",teleported:"",trigger:l.trigger,disabled:l.disabled},{reference:U.withCtx(()=>[U.createElementVNode("div",Lx,[D.$slots.default?U.renderSlot(D.$slots,"default",{key:0},void 0,!0):(U.openBlock(),U.createBlock(U.unref(v.ElButton),{key:1,circle:"",icon:U.unref(ml.Plus),size:"small",ref_key:"btn",ref:m,disabled:l.disabled,onMouseover:k},null,8,["icon","disabled"]))])]),default:U.withCtx(()=>[U.createElementVNode("div",Ix,[U.createElementVNode("div",Dx,[U.createVNode(U.unref(v.ElSpace),{style:{flex:"auto"}},{default:U.withCtx(()=>[U.createVNode(U.unref(Vt),{circle:"",size:"small",onClick:X,plain:"",type:"primary",tooltip:"对话框筛选(大批量选择)",shortcut:"Ctrl+Alt+I",icon:U.unref(ml.Notebook)},null,8,["icon"]),U.createVNode(U.unref(Vt),{circle:"",size:"small",onClick:j,type:"danger",plain:"",icon:U.unref(ml.Delete),tooltip:"清空选择",shortcut:"Alt+C"},null,8,["icon"]),l.multiple?(U.openBlock(),U.createBlock(U.unref(Vt),{key:0,circle:"",size:"small",onClick:E,type:"success",plain:"",icon:U.unref(ml.Finished),tooltip:"全选(已加载的数据)",shortcut:"Ctrl+A"},null,8,["icon"])):U.createCommentVNode("",!0),U.createVNode(U.unref(Vt),{circle:"",size:"small",onClick:Y,type:"warning",icon:U.unref(ml.Setting),plain:"",tooltip:"将已选中用户保存为自定义组,方便以后选择使用"},null,8,["icon"])]),_:1}),U.createElementVNode("div",wx," 弹出快捷键:"+U.toDisplayString(l.shortcut),1)]),U.createVNode(U.unref(v.ElInput),{modelValue:U.unref(V).name,"onUpdate:modelValue":x[0]||(x[0]=K=>U.unref(V).name=K),ref_key:"inputSearchText",ref:F,"suffix-icon":U.unref(ml.Search),placeholder:"请输入拼音名、姓名或手机号查询",autocomplete:"off",onKeydown:[U.withKeys(I,["enter"]),U.withKeys(U.withModifiers(z,["stop","prevent"]),["up"]),U.withKeys(U.withModifiers(y,["stop","prevent"]),["down"])]},null,8,["modelValue","suffix-icon","onKeydown"]),U.createElementVNode("div",Ex,[U.createVNode(U.unref(v.ElText),null,{default:U.withCtx(()=>[U.unref(V).name&&U.unref(V).name.length>J0?(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:0},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.Search))]),_:1})):(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:1,color:"#FFBF29"},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.StarFilled))]),_:1})),U.createTextVNode(" "+U.toDisplayString(U.unref(V).name&&U.unref(V).name.length>J0?"查询结果":"常用人员"),1)]),_:1})]),U.createVNode(Jy,{ref_key:"userList",ref:u,total:U.unref(h).total,"empty-text":U.unref(V).name&&U.unref(V).name.length>J0?void 0:"无可选常用人员","page-size":U.unref(W).pageSize,loading:U.unref(Q),users:s.value,height:300,modelValue:c.value,"onUpdate:modelValue":x[1]||(x[1]=K=>c.value=K),page:U.unref(W).currentPage,"onUpdate:page":x[2]||(x[2]=K=>U.unref(W).currentPage=K),multiple:l.multiple,maxSelect:l.maxSelect,onItemClicked:C,onArrowKeyDown:C},null,8,["total","empty-text","page-size","loading","users","modelValue","page","multiple","maxSelect"])])]),_:3},8,["visible","trigger","disabled"]),l.showUserTag?(U.openBlock(),U.createElementBlock("div",Cx,[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(w.value,K=>(U.openBlock(),U.createBlock(U.unref(ZU),{key:K.id,"user-id":K.id,"full-name":K.fullName,closable:!l.disabled,"has-avatar":K.hasAvatar,onClosed:L},null,8,["user-id","full-name","closable","has-avatar"]))),128)),B.value.length>l.maxShowCount?(U.openBlock(),U.createElementBlock("div",xx," +"+U.toDisplayString(B.value.length-l.maxShowCount)+"人 ",1)):U.createCommentVNode("",!0),B.value.length===0?(U.openBlock(),U.createElementBlock("div",gx,[U.createVNode(U.unref(v.ElText),{type:"info"},{default:U.withCtx(()=>[...x[5]||(x[5]=[U.createTextVNode(" <暂无选中人员>",-1)])]),_:1})])):U.createCommentVNode("",!0)])):U.createCommentVNode("",!0),U.createVNode(U.unref(Kr),{ref_key:"dialogUserSelector",ref:b,multiple:l.multiple,"realm-id":t.value,classificationLevel:l.classificationLevel,customFilter:l.customFilter,maxSelect:l.maxSelect,modelValue:c.value,"onUpdate:modelValue":x[4]||(x[4]=K=>c.value=K)},null,8,["multiple","realm-id","classificationLevel","customFilter","maxSelect","modelValue"])])),[[U.unref(CW),l.disabled?void 0:O,l.shortcut]])]),_:3},16,["max-height","height"]),U.createVNode(Gx,{ref_key:"dlgCustomGroupManager",ref:r,users:Array.isArray(c.value)?c.value:c.value?[c.value]:null},null,8,["users"])],64))}}),[["__scopeId","data-v-8c204f38"]]),jx=U.defineComponent({__name:"JaUserPicker",emits:["change"],setup(e,{emit:l}){const t=U.inject("aceFormModel"),d=U.inject("aceFormItemProp"),n=U.inject("aceFormValidator"),a=l;function i(c){n.removeFieldError(d),bt(t.formData,d,s.value),a("change",c)}const s=U.ref(Ml(t.formData,d)??[]);return U.watch(()=>t.formData,()=>{s.value=Ml(t.formData,d)??[]},{deep:!0}),(c,F)=>(U.openBlock(),U.createBlock(Gy,U.mergeProps({modelValue:s.value,"onUpdate:modelValue":F[0]||(F[0]=o=>s.value=o),onChange:i},c.$attrs),{default:U.withCtx(()=>[U.renderSlot(c.$slots,"default")]),_:3},16,["modelValue"]))}}),yy=Nl(Gy),Xy=Nl(jx),By=Nl(Jy),Yy=Nl(U.defineComponent({__name:"JaTimePicker",props:{showNow:{type:Boolean},showConfirm:{type:Boolean},showFooter:{type:Boolean},showWeekNumber:{type:Boolean},ariaLabel:{},emptyValues:{},valueOnClear:{},disabledDate:{},cellClassName:{},shortcuts:{},arrowControl:{type:Boolean},tabindex:{},validateEvent:{type:Boolean},unlinkPanels:{type:Boolean},placement:{},fallbackPlacements:{},disabledHours:{},disabledMinutes:{},disabledSeconds:{},automaticDropdown:{type:Boolean},id:{},name:{},popperClass:{},popperStyle:{},format:{},valueFormat:{},dateFormat:{},timeFormat:{},type:{},clearable:{type:Boolean},clearIcon:{},editable:{type:Boolean},prefixIcon:{},size:{},readonly:{type:Boolean},disabled:{type:Boolean},placeholder:{},popperOptions:{},modelValue:{},rangeSeparator:{},startPlaceholder:{},endPlaceholder:{},defaultValue:{},defaultTime:{},isRange:{type:Boolean}},emits:["change"],setup(e,{expose:l,emit:t}){const d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=t,c=e,F=U.ref({});function o(W){i.removeFieldError(a),bt(n.formData,a,h.value),s("change",W)}const h=U.ref(Ml(n.formData,a));U.watch(()=>n.formData,()=>{h.value=Ml(n.formData,a)},{deep:!0});const V=U.computed(()=>{const{modelValue:W,...Q}=c;return Q});return U.onMounted(()=>{d.value&&Object.entries(d.value).filter(([Q,m])=>m instanceof Function).forEach(([Q,m])=>{F.value[Q]=m})}),l(F.value),(W,Q)=>(U.openBlock(),U.createBlock(U.unref(v.ElTimePicker),U.mergeProps({ref_key:"input",ref:d,modelValue:U.unref(n).formData[U.unref(a)],"onUpdate:modelValue":Q[0]||(Q[0]=m=>U.unref(n).formData[U.unref(a)]=m),onChange:o},{...V.value,...W.$attrs}),U.createSlots({_:2},[U.renderList(W.$slots,(m,N)=>({name:N,fn:U.withCtx(()=>[U.renderSlot(W.$slots,N)])}))]),1040,["modelValue"]))}})),ky=Nl(U.defineComponent({__name:"UserGroupPicker",props:U.mergeModels({realmId:{},appId:{},modelValue:{},size:{default:"default"},multiple:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change"],["update:modelValue"]),setup(e,{emit:l}){const t=$.createAxiosWithoutCache(),d=$.useUserGroupApi(t),n=e,a=U.useModel(e,"modelValue"),i=l;if(n.multiple&&!Array.isArray(a.value))throw new Error("用户组选择器设置multiple为true,但是绑定的v-model值是单值");if(!n.multiple&&Array.isArray(a.value))throw new Error("用户组选择器未设置multiple为true,但是绑定的v-model值是数组");const s=U.reactive({groups:[]}),c=()=>{!n.realmId||!n.appId||d.getByAppIdAndRealm(n.appId,n.realmId??"0").then(o=>{s.groups=[...es(o,"name")],!a.value&&!n.multiple&&(a.value=s.groups[0].id)})},F=o=>{i("change",Array.isArray(o)?s.groups.filter(h=>o.findIndex(V=>h.id===V)>=0):s.groups.find(h=>h.id===o))};return c(),U.watch(()=>n.realmId,()=>{c()}),U.watch(()=>n.appId,c),(o,h)=>(U.openBlock(),U.createBlock(U.unref(v.ElTreeSelect),U.mergeProps({style:{width:"100%"},data:s.groups,size:n.size,"node-key":"id","check-strictly":"","current-node-key":a.value,"highlight-current":"",modelValue:a.value,"onUpdate:modelValue":h[0]||(h[0]=V=>a.value=V),multiple:e.multiple,onChange:F},o.$attrs,{"collapse-tags":"","collapse-tags-tooltip":"","tag-type":"info",teleported:""}),null,16,["data","size","current-node-key","modelValue","multiple"]))}})),zy=Nl(U.defineComponent({__name:"JaAutoComplete",props:{valueKey:{},modelValue:{},debounce:{},placement:{},fetchSuggestions:{},popperClass:{},popperStyle:{},triggerOnFocus:{type:Boolean},selectWhenUnmatched:{type:Boolean},hideLoading:{type:Boolean},teleported:{type:Boolean},appendTo:{},highlightFirstItem:{type:Boolean},fitInputWidth:{type:Boolean},loopNavigation:{type:Boolean},inputmode:{},name:{},ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelModifiers:{},maxlength:{},minlength:{},type:{},resize:{},autosize:{},autocomplete:{},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},clearIcon:{},showPassword:{type:Boolean},showWordLimit:{type:Boolean},wordLimitPosition:{},suffixIcon:{},prefixIcon:{},containerRole:{},tabindex:{},validateEvent:{type:Boolean},inputStyle:{},autofocus:{type:Boolean},rows:{}},emits:["change"],setup(e,{expose:l,emit:t}){const d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=t;function c(V){i.removeFieldError(a),bt(n.formData,a,F.value),s("change",V)}const F=U.ref(Ml(n.formData,a));U.watch(()=>n.formData,()=>{F.value=Ml(n.formData,a)},{deep:!0}),l({elAutocomplete:d});const o=e,h=U.computed(()=>o);return(V,W)=>(U.openBlock(),U.createBlock(U.unref(v.ElAutocomplete),U.mergeProps({ref_key:"input",ref:d,modelValue:F.value,"onUpdate:modelValue":W[0]||(W[0]=Q=>F.value=Q),onChange:c},{...h.value,...V.$attrs}),U.createSlots({_:2},[U.renderList(V.$slots,(Q,m)=>({name:m,fn:U.withCtx(()=>[U.renderSlot(V.$slots,m)])}))]),1040,["modelValue"]))}})),Ly=Nl(U.defineComponent({__name:"JaRadioGroup",props:{ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelValue:{},fill:{},textColor:{},name:{},validateEvent:{type:Boolean},options:{},props:{},type:{}},emits:["change"],setup(e,{expose:l,emit:t}){const d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=t,c=e;function F(V){i.removeFieldError(a),bt(n.formData,a,o.value),s("change",V)}const o=U.ref(Ml(n.formData,a));U.watch(()=>n.formData,()=>{o.value=Ml(n.formData,a)},{deep:!0});const h=U.computed(()=>{const{modelValue:V,...W}=c;return W});return l({focus:()=>{var V,W;return(W=(V=d.value)==null?void 0:V.focus)==null?void 0:W.call(V)},blur:()=>{var V,W;return(W=(V=d.value)==null?void 0:V.blur)==null?void 0:W.call(V)},elRadioGroup:d}),(V,W)=>(U.openBlock(),U.createBlock(U.unref(v.ElRadioGroup),U.mergeProps({ref_key:"input",ref:d,modelValue:o.value,"onUpdate:modelValue":W[0]||(W[0]=Q=>o.value=Q),onChange:F},{...h.value,...V.$attrs}),U.createSlots({_:2},[U.renderList(V.$slots,(Q,m)=>({name:m,fn:U.withCtx(()=>[U.renderSlot(V.$slots,m)])}))]),1040,["modelValue"]))}})),fW=new Map;let qr=new Map;function $r(){return{refreshRolesCache(e){fW.delete(e),console.log("roles cache cleared for app:",e,fW.get(e))},async getRoles(e){let l=fW.get(e);if(l)return l;let t=qr.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useRoleApi(d).getAllRole(e).then(a=>(fW.set(e,a),a)).finally(()=>{qr.delete(e)}),qr.set(e,t),await t}}}const Ox=U.defineComponent({__name:"baseRolePicker",props:U.mergeModels({appName:{}},{modelValue:{},modelModifiers:{}}),emits:U.mergeModels(["change"],["update:modelValue"]),setup(e,{expose:l,emit:t}){const{getRoles:d}=$r(),n=e,a=U.ref(),i=U.ref([]),s=hU(),c=async()=>{n.appName&&(a.value=await s.getByName(n.appName),i.value=await d(a.value.id),F.value?h.value=m(F.value,i.value):h.value=void 0)},F=U.useModel(e,"modelValue"),o=t,h=U.ref();U.watch(()=>n.appName,c),c();const V={label:N=>N.caption?N.caption:N.name,isLeaf:N=>!N.hasChildren},W=U.ref();function Q(N){h.value=m(N,i.value),o("change",N)}function m(N,b){for(let r=0;r<b.length;r++){if(b[r].name===N)return b[r];const u=b[r].children;if(u){const S=m(N,u);if(S)return S}}}return l({loadData:c,currentRole:h,elTreeSelect:W}),(N,b)=>(U.openBlock(),U.createBlock(U.unref(v.ElTreeSelect),U.mergeProps({ref_key:"select",ref:W,data:i.value,"node-key":"name","current-node-key":F.value,"value-key":"name",props:V},N.$attrs,{clearable:"","check-strictly":"","highlight-current":!0,onChange:Q,modelValue:F.value,"onUpdate:modelValue":b[0]||(b[0]=r=>F.value=r)}),U.createSlots({_:2},[U.renderList(N.$slots,(r,u)=>({name:u,fn:U.withCtx(()=>[U.renderSlot(N.$slots,u)])}))]),1040,["data","current-node-key","modelValue"]))}}),vx=U.defineComponent({__name:"I18nBundleEditor",props:U.mergeModels({appId:{},preKey:{}},{modelValue:{type:Boolean,default:!1,required:!0},modelModifiers:{}}),emits:U.mergeModels(["success"],["update:modelValue"]),setup(e,{emit:l}){const t=U.useModel(e,"modelValue"),d=e,n=$.createAxiosWithoutCache(),a=$.useAppMessageApi(n),i=U.ref(),s=U.ref(""),c=U.ref({}),F=l,o=hU();function h(){W(),s.value=d.preKey??"",c.value={}}async function V(){const Q={key:s.value,messages:c.value,appInstance:{id:d.appId}};await a.createBundle(Q),t.value=!1,F("success",s.value)}async function W(){i.value=await o.getById(d.appId)}return U.watch(()=>d.appId,async()=>{await W()}),(Q,m)=>{const N=U.resolveDirective("focus");return U.openBlock(),U.createBlock(U.unref(v.ElDrawer),{"destroy-on-close":"","append-to-body":"",modelValue:t.value,"onUpdate:modelValue":m[2]||(m[2]=b=>t.value=b),title:"创建国际化文本",onOpen:h},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{size:"default",shortcut:"Alt+Enter",type:"primary",onClick:V},{default:U.withCtx(()=>[...m[3]||(m[3]=[U.createTextVNode("确定 ",-1)])]),_:1}),U.createVNode(U.unref(v.ElButton),{size:"default",plain:"",onClick:m[1]||(m[1]=b=>t.value=!1)},{default:U.withCtx(()=>[...m[4]||(m[4]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createVNode(U.unref(v.ElForm),{"label-position":"top",size:"default"},{default:U.withCtx(()=>{var b;return[U.createVNode(U.unref(v.ElFormItem),{label:"文本键",required:""},{default:U.withCtx(()=>[U.withDirectives(U.createVNode(U.unref(v.ElInput),{modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=r=>s.value=r)},null,8,["modelValue"]),[[N]])]),_:1}),(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList((b=i.value)==null?void 0:b.supportedLocales,r=>(U.openBlock(),U.createBlock(U.unref(v.ElFormItem),{key:r,label:r},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElInput),{type:"textarea",rows:4,modelValue:c.value[r],"onUpdate:modelValue":u=>c.value[r]=u},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"]))),128))]}),_:1})]),_:1},8,["modelValue"])}}}),fx={class:"ja-input-i18n"},lb=Nl(ht(U.defineComponent({__name:"InputI18n",props:U.mergeModels({appId:{},size:{default:"default"},textarea:{type:Boolean,default:!1},disabled:{type:Boolean}},{modelValue:{default:""},modelModifiers:{}}),emits:U.mergeModels(["change","focus","blur"],["update:modelValue"]),setup(e,{expose:l,emit:t}){const d=e,n=U.useModel(e,"modelValue"),a=$.createAxiosWithoutCache(),i=$.useAppMessageApi(a),s=$.useLoginUser().locale,c=U.ref(),F=U.ref(!1),o=U.ref(!1),h=U.ref(),V=U.ref(""),W=hU(),Q=U.ref(""),m=U.ref(""),N=U.ref(),b=t,r=xr(S,500);let u;async function S(z){if(z||(z=n.value),!d.appId)return;m.value=z;const I=await W.getById(d.appId);if(V.value=I.name,!z||z.length===0||!V.value){m.value="";return}let O=z;z&&z.length>0&&(O=Tx(O),O.startsWith("{")&&O.endsWith("}")&&(O=O.substring(1,O.length-1)));const j=(await i.getByKey(V.value,O,{cancelDuplicatedRequest:!1})).find(C=>C.locale===s);j&&(await U.nextTick(),m.value=j.message)}async function G(z){Q.value=z;const I=await W.getById(d.appId);V.value=I.name,c.value=await i.searchKeys(V.value,z)}async function J(){var z;F.value=!0,await U.nextTick(),b("focus"),(z=h.value)==null||z.focus()}function Y(){u=setTimeout(()=>{F.value=!1},200),b("blur")}U.onUnmounted(()=>{r.cancel(),u&&clearTimeout(u)}),U.watch(n,()=>{r()},{deep:!0}),m.value||r();function L(z){b("change",z)}async function y(z){await G(Q.value),n.value="{"+z+"}",N.value.focus}return l({focus(){N==null||N.value.focus()},blur(){h==null||h.value.blur()}}),(z,I)=>(U.openBlock(),U.createElementBlock("div",fx,[U.withDirectives(U.createVNode(U.unref(v.ElInput),{ref_key:"selectI18n",ref:N,onFocus:J,modelValue:m.value,"onUpdate:modelValue":I[0]||(I[0]=O=>m.value=O),size:e.size,disabled:e.disabled,type:e.textarea?"textarea":void 0},null,8,["modelValue","size","disabled","type"]),[[U.vShow,!F.value]]),U.withDirectives(U.createVNode(U.unref(v.ElSelect),{ref_key:"select",ref:h,filterable:"",remote:"","remote-method":G,disabled:e.disabled,"default-first-option":"","reserve-keyword":"","remote-show-suffix":"",onChange:L,size:e.size,"allow-create":"",clearable:"",onBlur:Y,modelValue:n.value,"onUpdate:modelValue":I[2]||(I[2]=O=>n.value=O)},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{link:"",style:{width:"100%"},type:"primary",onClick:I[1]||(I[1]=O=>o.value=!0),shortcut:"Alt+I"},{default:U.withCtx(()=>[...I[4]||(I[4]=[U.createTextVNode(" 新建国际化文本(Alt+I) ",-1)])]),_:1})]),default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(c.value,O=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:O,value:"{"+O+"}",label:"{"+O+"}"},null,8,["value","label"]))),128))]),_:1},8,["disabled","size","modelValue"]),[[U.vShow,F.value]]),U.createVNode(vx,{"app-id":e.appId,"pre-key":Q.value,modelValue:o.value,"onUpdate:modelValue":I[3]||(I[3]=O=>o.value=O),onSuccess:y},null,8,["app-id","pre-key","modelValue"])]))}}),[["__scopeId","data-v-298978b0"]])),tb=new Map;let eb=new Map;function Iy(){return{refreshRoleCategoryCache(e){tb.delete(e)},async getRoleCategories(e){let l=tb.get(e);if(l)return l;let t=eb.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useRoleCategoryApi(d).getAllRole(e).then(a=>(tb.set(e,a),a)).finally(()=>{eb.delete(e)}),eb.set(e,t),await t}}}const Kx=["onClick"],Hx={style:{flex:"1"}},Px={style:{display:"flex",padding:"0 20px 0 10px"}},Ax={style:{flex:"1"}},_x={key:0,style:{flex:"1","text-align":"right"}},Dy=U.defineComponent({__name:"RoleCategorySelector",props:U.mergeModels({appId:{},allowEdit:{type:Boolean}},{modelValue:{required:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=$.createAxiosWithoutCache(),d=$.useRoleCategoryApi(t),n=U.useModel(e,"modelValue"),{getRoleCategories:a,refreshRoleCategoryCache:i}=Iy(),s=U.ref([]),c=U.ref();async function F(){l.appId&&(s.value=await a(l.appId),s.value.length>0&&(n.value=s.value[0].name),console.log(`Loading categories for ${l.appId}`,s.value))}async function o(){if(!l.appId)throw new Error("appId 参数不能为空");c.value&&!await m()||(c.value={id:"0",name:"",app:{id:l.appId},dataVersion:0},s.value.push(c.value))}async function h(N){c.value&&!await m()||(c.value=N)}async function V(){c.value&&!await m()||(c.value=void 0)}async function W(N){if(c.value){if(!await m())return;c.value=void 0}await d.delete({id:N.id,dataVersion:N.dataVersion}),i(l.appId),s.value.splice(s.value.indexOf(N),1)}function Q(N,b){b===c.value&&(N.preventDefault(),N.stopPropagation())}async function m(){if(!c.value)return!0;if(!c.value.name||c.value.name.length<1)return v.ElMessage.error("类别名称不能为空"),!1;try{let N;return c.value.id=="0"?N=await d.create({name:c.value.name,app:c.value.app},{popValidationErrorNotification:!0}):N=await d.update({...c.value},{popValidationErrorNotification:!0}),i(l.appId),c.value.id=N.id,c.value.dataVersion=N.dataVersion,!0}catch{return!1}}return U.watch(()=>l.appId,F,{immediate:!0}),(N,b)=>(U.openBlock(),U.createBlock(U.unref(v.ElSelect),{modelValue:n.value,"onUpdate:modelValue":b[2]||(b[2]=r=>n.value=r),placeholder:"[未分类]"},{header:U.withCtx(()=>[U.createElementVNode("div",Px,[U.createElementVNode("div",Ax,[U.createVNode(U.unref(v.ElText),null,{default:U.withCtx(()=>[b[3]||(b[3]=U.createElementVNode("b",null,"业务分类",-1)),U.createVNode(U.unref(v.ElTooltip),{content:"业务分类限制角色只能授予同分类的用户组"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElIcon),null,{default:U.withCtx(()=>[U.createVNode(U.unref(ml.InfoFilled))]),_:1})]),_:1})]),_:1})]),e.allowEdit?(U.openBlock(),U.createElementBlock("div",_x,[U.createVNode(u0,{size:"small",type:"primary",plain:"",icon:U.unref(ml.Plus),shortcut:"Alt+A",link:"",tooltip:"添加",onClick:U.withModifiers(o,["prevent","stop"])},null,8,["icon"])])):U.createCommentVNode("",!0)])]),default:U.withCtx(()=>[U.createVNode(U.unref(v.ElOption),{label:"[未分类]",value:""}),(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(s.value,r=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:r.id,label:r.name,value:r.name},{default:U.withCtx(()=>[U.createElementVNode("div",{style:{display:"flex",margin:"0 -32px 0 -20px",padding:"0 32px 0 20px"},onClick:u=>Q(u,r)},[U.createElementVNode("div",Hx,[r!==c.value?(U.openBlock(),U.createBlock(U.unref(v.ElText),{key:0},{default:U.withCtx(()=>[U.createTextVNode(U.toDisplayString(r.name),1)]),_:2},1024)):U.createCommentVNode("",!0),r===c.value?U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElInput),{key:1,onClick:b[0]||(b[0]=U.withModifiers(()=>{},["prevent","stop"])),size:"small",modelValue:c.value.name,"onUpdate:modelValue":b[1]||(b[1]=u=>c.value.name=u),maxlength:"255",onKeydown:U.withKeys(V,["enter"])},null,8,["modelValue"])),[[U.unref(vW)]]):U.createCommentVNode("",!0)]),U.createElementVNode("div",null,[r!==c.value&&e.allowEdit?(U.openBlock(),U.createBlock(u0,{key:0,size:"small",type:"primary",icon:U.unref(ml.Edit),link:"",onClick:U.withModifiers(u=>h(r),["stop","prevent"]),tooltip:"修改"},null,8,["icon","onClick"])):U.createCommentVNode("",!0),r!==c.value&&e.allowEdit?(U.openBlock(),U.createBlock(u0,{key:1,size:"small",type:"danger",icon:U.unref(ml.Delete),link:"",onClick:U.withModifiers(u=>W(r),["stop","prevent"]),tooltip:"删除"},null,8,["icon","onClick"])):U.createCommentVNode("",!0),r===c.value&&e.allowEdit?(U.openBlock(),U.createBlock(u0,{key:2,size:"small",type:"primary",icon:U.unref(ml.Check),link:"",onClick:U.withModifiers(V,["stop","prevent"]),tooltip:"提交"},null,8,["icon"])):U.createCommentVNode("",!0)])],8,Kx)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"]))}}),qx=U.defineComponent({__name:"RoleEditor",props:U.mergeModels({appName:{},category:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:U.mergeModels(["success"],["update:modelValue"]),setup(e,{emit:l}){const t=U.useModel(e,"modelValue"),d=e,n=l,a={hasChildren:!1,parentId:"0",releaseSource:"",app:{id:"0"},caption:"",compositeRoles:[],dataVersion:0,description:"",id:"0",name:"",category:d.category},i=U.ref({formData:{...a}}),s=$.createAxiosWithoutCache(),c=XG(Object.keys(a),s),F=$.useLoading(s),o=$.useRoleApi(s),h=U.ref(),V=U.ref(),W=U.ref(),Q=hU(),{refreshRolesCache:m}=$r();async function N(){if(i.value.formData={...a},!d.appName)throw new Error("rolePicker组件的appName属性不能为空");W.value=await Q.getByName(d.appName)}async function b(){var S,G;if(!d.appName)return;const r=i.value.formData,u=(S=V.value)==null?void 0:S.currentRole;(G=h.value)==null||G.validate(()=>o.create({addTo:u?{id:u.id,name:u.name,app:{id:W.value.id}}:void 0,app:{id:W.value.id},description:r.description,name:r.name,caption:r.caption,category:r.category}).then(J=>{m(W.value.id),n("success",J),t.value=!1}))}return(r,u)=>{const S=U.resolveComponent("ja-form");return U.openBlock(),U.createBlock(U.unref(v.ElDrawer),{"destroy-on-close":"","append-to-body":"",title:"新建角色",modelValue:t.value,"onUpdate:modelValue":u[3]||(u[3]=G=>t.value=G),onOpen:N},{footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{size:"default",type:"primary",onClick:b,loading:U.unref(F),shortcut:"Alt+Enter"},{default:U.withCtx(()=>[...u[4]||(u[4]=[U.createTextVNode("确定 ",-1)])]),_:1},8,["loading"]),U.createVNode(U.unref(v.ElButton),{size:"default",onClick:u[2]||(u[2]=G=>t.value=!1)},{default:U.withCtx(()=>[...u[5]||(u[5]=[U.createTextVNode("取消",-1)])]),_:1})]),default:U.withCtx(()=>[U.createVNode(S,{ref_key:"formRef",ref:h,model:i.value,validator:U.unref(c)},{default:U.withCtx(()=>[U.createVNode(U.unref(ts),{label:"角色名称",prop:"name",required:""},{default:U.withCtx(()=>[U.withDirectives(U.createVNode(U.unref(EW),null,null,512),[[U.unref(vW)]])]),_:1}),U.createVNode(U.unref(ts),{label:"上级角色",prop:"none"},{default:U.withCtx(()=>[U.createVNode(U.unref(KW),{ref_key:"rolePicker",ref:V,placeholder:"请选择上级角色,置空表示添加顶层角色","app-name":d.appName},null,8,["app-name"])]),_:1}),U.createVNode(U.unref(ts),{label:"角色标题",prop:"caption",required:""},{default:U.withCtx(()=>{var G;return[U.createVNode(U.unref(lb),{"app-id":(G=W.value)==null?void 0:G.id,size:"small",modelValue:i.value.formData.caption,"onUpdate:modelValue":u[0]||(u[0]=J=>i.value.formData.caption=J)},null,8,["app-id","modelValue"])]}),_:1}),U.createVNode(U.unref(ts),{label:"业务分类",prop:"category"},{default:U.withCtx(()=>{var G;return[U.createVNode(Dy,{"app-id":(G=W.value)==null?void 0:G.id,modelValue:i.value.formData.category,"onUpdate:modelValue":u[1]||(u[1]=J=>i.value.formData.category=J)},null,8,["app-id","modelValue"])]}),_:1}),U.createVNode(U.unref(ts),{label:"角色说明",prop:"description"},{default:U.withCtx(()=>[U.createVNode(U.unref(EW),{type:"textarea"})]),_:1})]),_:1},8,["model","validator"])]),_:1},8,["modelValue"])}}}),$x={class:"ja-role-picker"},wy=ht(U.defineComponent({__name:"RolePickerRaw",props:U.mergeModels({appName:{}},{modelValue:{required:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=U.useModel(e,"modelValue");function d(s){var c;t.value=s.name,(c=n.value)==null||c.loadData()}const n=U.ref(),a=U.ref(!1);function i(){a.value=!0}return(s,c)=>(U.openBlock(),U.createElementBlock("div",$x,[U.createVNode(U.unref(KW),U.mergeProps({ref_key:"picker",ref:n,"app-name":l.appName,style:{flex:"auto"}},s.$attrs,{modelValue:t.value,"onUpdate:modelValue":c[1]||(c[1]=F=>t.value=F)}),U.createSlots({footer:U.withCtx(()=>[U.createVNode(U.unref(Vt),{link:"",type:"primary",icon:U.unref(ml.Plus),shortcut:"Alt+I",style:{width:"100%"},onClick:i},{default:U.withCtx(()=>[...c[2]||(c[2]=[U.createTextVNode(" 新建角色(Alt+I) ",-1)])]),_:1},8,["icon"]),U.createVNode(qx,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=F=>a.value=F),"app-name":l.appName,onSuccess:d},null,8,["modelValue","app-name"])]),_:2},[U.renderList(s.$slots,(F,o)=>({name:o,fn:U.withCtx(()=>[U.renderSlot(s.$slots,o,{},void 0,!0)])}))]),1040,["app-name","modelValue"])]))}}),[["__scopeId","data-v-dd3083a0"]]),l3=U.defineComponent({__name:"RolePicker",props:{appName:{}},emits:["change"],setup(e,{emit:l}){const t=e,d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=l;function c(o){i.removeFieldError(a),bt(n.formData,a,F.value),s("change",o)}const F=U.ref(Ml(n.formData,a));return U.watch(()=>n.formData,()=>{F.value=Ml(n.formData,a)},{deep:!0}),(o,h)=>(U.openBlock(),U.createBlock(wy,U.mergeProps({ref_key:"picker",ref:d,"app-name":t.appName,modelValue:F.value,"onUpdate:modelValue":h[0]||(h[0]=V=>F.value=V),onChange:c},o.$attrs),U.createSlots({_:2},[U.renderList(o.$slots,(V,W)=>({name:W,fn:U.withCtx(()=>[U.renderSlot(o.$slots,W)])}))]),1040,["app-name","modelValue"]))}}),KW=Nl(Ox),Ey=Nl(l3),Cy=Nl(wy),xy=Nl(Dy),gy=U.defineComponent({__name:"ChannelPicker",props:U.mergeModels({appName:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=$.createAxiosWithoutCache(),t=$.useChannelApi(l),d=e,n=U.ref(),a=U.ref(),i=U.useModel(e,"modelValue");U.onBeforeMount(()=>{s()});async function s(){console.log("load channels of app "+d.appName),d.appName&&(n.value=await t.getAll(d.appName),a.value=n.value)}function c(F){var o;a.value=((o=n.value)==null?void 0:o.filter(h=>h.name.indexOf(F)>-1))??[]}return U.watch(()=>d.appName,s),(F,o)=>(U.openBlock(),U.createBlock(U.unref(v.ElSelect),U.mergeProps({filterable:"","filter-method":c,"value-key":"id",modelValue:i.value,"onUpdate:modelValue":o[0]||(o[0]=h=>i.value=h)},F.$attrs),{default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(a.value,h=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:h.id,label:h.name,value:h},null,8,["label","value"]))),128))]),_:1},16,["modelValue"]))}}),jy=Nl(U.defineComponent({__name:"JaChannelPicker",emits:["change"],setup(e,{emit:l}){const t=U.inject("aceFormModel"),d=U.inject("aceFormItemProp"),n=U.inject("aceFormValidator"),a=l;function i(c){n.removeFieldError(d),bt(t.formData,d,s.value),a("change",c)}const s=U.ref(Ml(t.formData,d));return U.watch(()=>t.formData,()=>{s.value=Ml(t.formData,d)},{deep:!0}),(c,F)=>(U.openBlock(),U.createBlock(gy,U.mergeProps({modelValue:s.value,"onUpdate:modelValue":F[0]||(F[0]=o=>s.value=o),onChange:i},c.$attrs),null,16,["modelValue"]))}})),Oy=Nl(gy),db=new Map;let nb=new Map;function vy(){return{refreshProperties(e){db.delete(e)},async getProperties(e){let l=db.get(e);if(l)return l;let t=nb.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useEntityApi(d).getProperties(e).then(a=>(db.set(e,a),a)).finally(()=>{nb.delete(e)}),nb.set(e,t),await t}}}const t3={class:"ja-property-picker__dropdown"},e3={key:0},d3=["onMouseenter","onClick"],n3={key:0,class:"entity-type"},a3={key:1},fy=ht(U.defineComponent({__name:"PropertyPicker",props:U.mergeModels({entityId:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e;let t;const d=U.useModel(e,"modelValue"),n=U.ref([]),a=$.createAxiosWithoutCache(),{getProperties:i}=vy(),s=U.ref(),c={},F=U.ref(0),o=$.useLoading(a),h=U.ref(!1),V=U.ref(!1),W=U.ref(),Q=U.ref(),m=U.ref("");let N=U.ref(!1);async function b(){t||(t=l.entityId),t?s.value=await i(t):s.value=[]}function r(X){let k;X?k=X.join("."):k="",k!==d.value&&(d.value=k),U.nextTick(async()=>{var D;t=l.entityId,await b();let w=c[t];if(w){for(let x=0;x<X.length;x++){const K=X[x];let A=w.find(P=>P.name===K);A&&A.entityType?(t=A.entityType.id,x<X.length-1?(await b(),w=c[t]):A.dataType==="ENTITY"&&A.collectionType==="NONE"?(t=A.entityType.id,b()):(t="-1",b())):(t="-1",b())}(D=W.value)==null||D.focus()}})}function u(X){return X.caption&&X.caption.length>0?X.name+"("+X.caption+")":X.name}function S(X){F.value=X}function G(X){return F.value===X?"active":""}function J(X){var k,w;(k=n.value)==null||k.push(X.name),m.value="",(w=W.value)==null||w.focus()}function Y(X){var k;(k=n.value)==null||k.pop()}function L(){var w;if(!t)return;const X=c[t];if(!X)return;const k=(w=W.value)==null?void 0:w.value;k&&k.length>0?s.value=[...X].filter(D=>D.name.toLowerCase().indexOf(k.toLowerCase())>-1):s.value=X,C()}function y(){s.value&&(F.value<s.value.length-1&&F.value++,C())}function z(){F.value>0&&F.value--,C()}function I(){if(!s.value)return;const X=s.value[F.value];X&&J(X)}function O(){var X;m.value&&m.value.length>0||(X=n.value)==null||X.pop()}function E(X){X&&U.nextTick(()=>{var k;(k=W.value)==null||k.focus()}),N.value=X}const j=U.computed(()=>{var X;return n.value&&n.value.length>0?(X=n.value)==null?void 0:X.join("."):"请选择属性"}),C=()=>{U.nextTick(()=>{var w,D,x;const X=(w=Q.value)==null?void 0:w.$refs.wrapRef,k=X==null?void 0:X.querySelectorAll("li")[F.value];if(k&&X){const K=k.offsetTop,A=k.offsetTop+k.offsetHeight,P=X.scrollTop,q=X.scrollTop+X.clientHeight;A>q?(D=Q.value)==null||D.scrollTo(0,A-X.clientHeight+k.offsetHeight-38):K<P&&((x=Q.value)==null||x.scrollTo(0,K))}})};U.watch(()=>l.entityId,b),U.watch(n,()=>r(n.value),{deep:!0});function B(){if(d.value&&d.value.length>0){const X=d.value.split(".");X.length!==n.value.length&&(n.value=X)}else n.value.length>0&&(n.value=[])}return U.watch(d,()=>{B()}),d.value&&d.value.length>0?B():b(),U.watch(s,()=>{F.value=0,C()}),(X,k)=>(U.openBlock(),U.createBlock(U.unref(v.ElDropdown),{onVisibleChange:E},{dropdown:U.withCtx(()=>[U.createElementVNode("div",t3,[U.createElementVNode("div",{class:U.normalizeClass(["el-input-tag el-input-tag--small el-input-tag__wrapper",{"is-hovering":h.value,"is-focused":V.value}]),onMouseenter:k[3]||(k[3]=w=>h.value=!0),onMouseleave:k[4]||(k[4]=w=>h.value=!1)},[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(n.value,w=>(U.openBlock(),U.createBlock(U.unref(v.ElTag),{id:w,onClose:D=>Y(),closable:""},{default:U.withCtx(()=>[U.createTextVNode(U.toDisplayString(w),1)]),_:2},1032,["id","onClose"]))),256)),U.withDirectives(U.createElementVNode("input",{ref_key:"filterInput",ref:W,type:"text",style:{flex:"auto"},class:"el-input-tag__input","onUpdate:modelValue":k[0]||(k[0]=w=>m.value=w),placeholder:"属性名过滤",onFocus:k[1]||(k[1]=w=>V.value=!0),onBlur:k[2]||(k[2]=w=>V.value=!1),onKeydown:[U.withKeys(O,["delete"]),U.withKeys(y,["down"]),U.withKeys(z,["up"]),U.withKeys(I,["enter"])],onInput:L},null,544),[[U.vModelText,m.value]])],34),U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElScrollbar),{height:"300px",always:"",ref_key:"scrollbar",ref:Q},{default:U.withCtx(()=>{var w;return[((w=s.value)==null?void 0:w.length)??!1?(U.openBlock(),U.createElementBlock("ul",e3,[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(s.value,(D,x)=>(U.openBlock(),U.createElementBlock("li",{key:D.id,onMouseenter:K=>S(x),onClick:K=>J(D),class:U.normalizeClass(G(x))},[D.dataType==="ENTITY"?(U.openBlock(),U.createElementBlock("span",n3,U.toDisplayString(u(D)),1)):(U.openBlock(),U.createElementBlock("span",a3,U.toDisplayString(u(D)),1))],42,d3))),128))])):(U.openBlock(),U.createBlock(U.unref(v.ElEmpty),{key:1,description:"无可选属性"}))]}),_:1})),[[U.unref(v.vLoading),U.unref(o)]])])]),default:U.withCtx(()=>[U.createVNode(U.unref(v.ElTag),{type:"primary"},{default:U.withCtx(()=>[U.createTextVNode(U.toDisplayString(j.value)+" ",1),U.unref(N)?(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:0},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.ArrowUp))]),_:1})):(U.openBlock(),U.createBlock(U.unref(v.ElIcon),{key:1},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.ArrowDown))]),_:1}))]),_:1})]),_:1}))}}),[["__scopeId","data-v-7bf2d619"]]),Ky=Nl(U.defineComponent({__name:"JaPropertyPicker",emits:["change"],setup(e,{emit:l}){const t=U.inject("aceFormModel"),d=U.inject("aceFormItemProp"),n=U.inject("aceFormValidator"),a=l;function i(c){n.removeFieldError(d),bt(t.formData,d,s.value),a("change",c)}const s=U.ref(Ml(t.formData,d)??"");return U.watch(()=>t.formData,()=>{s.value=Ml(t.formData,d)??""},{deep:!0}),(c,F)=>(U.openBlock(),U.createBlock(fy,U.mergeProps({modelValue:s.value,"onUpdate:modelValue":F[0]||(F[0]=o=>s.value=o),onChange:i},c.$attrs),null,16,["modelValue"]))}})),Hy=Nl(fy),Py=Nl(U.defineComponent({__name:"JaCheckboxGroup",props:{ariaLabel:{},modelValue:{},disabled:{type:Boolean},min:{},max:{},size:{},fill:{},textColor:{},tag:{},validateEvent:{type:Boolean},options:{},props:{},type:{}},emits:["change"],setup(e,{expose:l,emit:t}){const d=U.ref(),n=U.inject("aceFormModel"),a=U.inject("aceFormItemProp"),i=U.inject("aceFormValidator"),s=t,c=e;function F(V){i.removeFieldError(a),bt(n.formData,a,o.value),s("change",V)}const o=U.ref(Ml(n.formData,a));U.watch(()=>n.formData,()=>{o.value=Ml(n.formData,a)},{deep:!0});const h=U.computed(()=>{const{modelValue:V,...W}=c;return W});return l({focus:()=>{var V,W;return(W=(V=d.value)==null?void 0:V.focus)==null?void 0:W.call(V)},blur:()=>{var V,W;return(W=(V=d.value)==null?void 0:V.blur)==null?void 0:W.call(V)},elCheckboxGroup:d}),(V,W)=>(U.openBlock(),U.createBlock(U.unref(v.ElCheckboxGroup),U.mergeProps({ref_key:"input",ref:d,modelValue:o.value,"onUpdate:modelValue":W[0]||(W[0]=Q=>o.value=Q),onChange:F},{...h.value,...V.$attrs}),U.createSlots({_:2},[U.renderList(V.$slots,(Q,m)=>({name:m,fn:U.withCtx(()=>[U.renderSlot(V.$slots,m)])}))]),1040,["modelValue"]))}})),Ay=Nl(U.defineComponent({__name:"EnumPicker",props:U.mergeModels({clearable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!0},keyField:{default:"value"},multiple:{type:Boolean,default:!1},name:{},serviceName:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=U.ref([]),d=U.ref(!1),n=U.useModel(e,"modelValue"),a=$.createAxiosWithoutCache(),i=$.useEnumApi(a);async function s(){!l.name||!l.serviceName||(d.value=!0,i.queryByName(l.serviceName,l.name).then(o=>{t.value=o.values}).finally(()=>{d.value=!1}))}const c=U.computed(()=>l.multiple?n.value.map(o=>o[l.keyField])||[]:n.value[0]!==void 0?n.value[0][l.keyField]:""),F=o=>{if(typeof o=="string"){const h=t.value.find(V=>V[l.keyField]===o);n.value=h?[h]:[]}else n.value=t.value.filter(h=>o.includes(h[l.keyField]))};return s(),U.watch(()=>l.name,s),U.watch(()=>l.serviceName,s),(o,h)=>{const V=U.resolveDirective("loading");return U.withDirectives((U.openBlock(),U.createBlock(U.unref(v.ElSelect),{"model-value":c.value,filterable:l.filterable,multiple:l.multiple,clearable:l.clearable,onChange:F},{default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(t.value,W=>(U.openBlock(),U.createBlock(U.unref(v.ElOption),{key:W.id,value:W[l.keyField],label:W.text},null,8,["value","label"]))),128))]),_:1},8,["model-value","filterable","multiple","clearable"])),[[V,d.value]])}}}));var HW={exports:{}},i3=HW.exports,_y;function qy(){return _y||(_y=1,(function(e,l){(function(t,d){e.exports=d()})(i3,(function(){var t=1e3,d=6e4,n=36e5,a="millisecond",i="second",s="minute",c="hour",F="day",o="week",h="month",V="quarter",W="year",Q="date",m="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,r={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var C=["th","st","nd","rd"],B=j%100;return"["+j+(C[(B-20)%10]||C[B]||C[0])+"]"}},u=function(j,C,B){var X=String(j);return!X||X.length>=C?j:""+Array(C+1-X.length).join(B)+j},S={s:u,z:function(j){var C=-j.utcOffset(),B=Math.abs(C),X=Math.floor(B/60),k=B%60;return(C<=0?"+":"-")+u(X,2,"0")+":"+u(k,2,"0")},m:function j(C,B){if(C.date()<B.date())return-j(B,C);var X=12*(B.year()-C.year())+(B.month()-C.month()),k=C.clone().add(X,h),w=B-k<0,D=C.clone().add(X+(w?-1:1),h);return+(-(X+(B-k)/(w?k-D:D-k))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:h,y:W,w:o,d:F,D:Q,h:c,m:s,s:i,ms:a,Q:V}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},G="en",J={};J[G]=r;var Y="$isDayjsObject",L=function(j){return j instanceof O||!(!j||!j[Y])},y=function j(C,B,X){var k;if(!C)return G;if(typeof C=="string"){var w=C.toLowerCase();J[w]&&(k=w),B&&(J[w]=B,k=w);var D=C.split("-");if(!k&&D.length>1)return j(D[0])}else{var x=C.name;J[x]=C,k=x}return!X&&k&&(G=k),k||!X&&G},z=function(j,C){if(L(j))return j.clone();var B=typeof C=="object"?C:{};return B.date=j,B.args=arguments,new O(B)},I=S;I.l=y,I.i=L,I.w=function(j,C){return z(j,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var O=(function(){function j(B){this.$L=y(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[Y]=!0}var C=j.prototype;return C.parse=function(B){this.$d=(function(X){var k=X.date,w=X.utc;if(k===null)return new Date(NaN);if(I.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var D=k.match(N);if(D){var x=D[2]-1||0,K=(D[7]||"0").substring(0,3);return w?new Date(Date.UTC(D[1],x,D[3]||1,D[4]||0,D[5]||0,D[6]||0,K)):new Date(D[1],x,D[3]||1,D[4]||0,D[5]||0,D[6]||0,K)}}return new Date(k)})(B),this.init()},C.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},C.$utils=function(){return I},C.isValid=function(){return this.$d.toString()!==m},C.isSame=function(B,X){var k=z(B);return this.startOf(X)<=k&&k<=this.endOf(X)},C.isAfter=function(B,X){return z(B)<this.startOf(X)},C.isBefore=function(B,X){return this.endOf(X)<z(B)},C.$g=function(B,X,k){return I.u(B)?this[X]:this.set(k,B)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(B,X){var k=this,w=!!I.u(X)||X,D=I.p(B),x=function(nl,dl){var sl=I.w(k.$u?Date.UTC(k.$y,dl,nl):new Date(k.$y,dl,nl),k);return w?sl:sl.endOf(F)},K=function(nl,dl){return I.w(k.toDate()[nl].apply(k.toDate("s"),(w?[0,0,0,0]:[23,59,59,999]).slice(dl)),k)},A=this.$W,P=this.$M,q=this.$D,_="set"+(this.$u?"UTC":"");switch(D){case W:return w?x(1,0):x(31,11);case h:return w?x(1,P):x(0,P+1);case o:var g=this.$locale().weekStart||0,tl=(A<g?A+7:A)-g;return x(w?q-tl:q+(6-tl),P);case F:case Q:return K(_+"Hours",0);case c:return K(_+"Minutes",1);case s:return K(_+"Seconds",2);case i:return K(_+"Milliseconds",3);default:return this.clone()}},C.endOf=function(B){return this.startOf(B,!1)},C.$set=function(B,X){var k,w=I.p(B),D="set"+(this.$u?"UTC":""),x=(k={},k[F]=D+"Date",k[Q]=D+"Date",k[h]=D+"Month",k[W]=D+"FullYear",k[c]=D+"Hours",k[s]=D+"Minutes",k[i]=D+"Seconds",k[a]=D+"Milliseconds",k)[w],K=w===F?this.$D+(X-this.$W):X;if(w===h||w===W){var A=this.clone().set(Q,1);A.$d[x](K),A.init(),this.$d=A.set(Q,Math.min(this.$D,A.daysInMonth())).$d}else x&&this.$d[x](K);return this.init(),this},C.set=function(B,X){return this.clone().$set(B,X)},C.get=function(B){return this[I.p(B)]()},C.add=function(B,X){var k,w=this;B=Number(B);var D=I.p(X),x=function(P){var q=z(w);return I.w(q.date(q.date()+Math.round(P*B)),w)};if(D===h)return this.set(h,this.$M+B);if(D===W)return this.set(W,this.$y+B);if(D===F)return x(1);if(D===o)return x(7);var K=(k={},k[s]=d,k[c]=n,k[i]=t,k)[D]||1,A=this.$d.getTime()+B*K;return I.w(A,this)},C.subtract=function(B,X){return this.add(-1*B,X)},C.format=function(B){var X=this,k=this.$locale();if(!this.isValid())return k.invalidDate||m;var w=B||"YYYY-MM-DDTHH:mm:ssZ",D=I.z(this),x=this.$H,K=this.$m,A=this.$M,P=k.weekdays,q=k.months,_=k.meridiem,g=function(dl,sl,Dl,ql){return dl&&(dl[sl]||dl(X,w))||Dl[sl].slice(0,ql)},tl=function(dl){return I.s(x%12||12,dl,"0")},nl=_||function(dl,sl,Dl){var ql=dl<12?"AM":"PM";return Dl?ql.toLowerCase():ql};return w.replace(b,(function(dl,sl){return sl||(function(Dl){switch(Dl){case"YY":return String(X.$y).slice(-2);case"YYYY":return I.s(X.$y,4,"0");case"M":return A+1;case"MM":return I.s(A+1,2,"0");case"MMM":return g(k.monthsShort,A,q,3);case"MMMM":return g(q,A);case"D":return X.$D;case"DD":return I.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return g(k.weekdaysMin,X.$W,P,2);case"ddd":return g(k.weekdaysShort,X.$W,P,3);case"dddd":return P[X.$W];case"H":return String(x);case"HH":return I.s(x,2,"0");case"h":return tl(1);case"hh":return tl(2);case"a":return nl(x,K,!0);case"A":return nl(x,K,!1);case"m":return String(K);case"mm":return I.s(K,2,"0");case"s":return String(X.$s);case"ss":return I.s(X.$s,2,"0");case"SSS":return I.s(X.$ms,3,"0");case"Z":return D}return null})(dl)||D.replace(":","")}))},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(B,X,k){var w,D=this,x=I.p(X),K=z(B),A=(K.utcOffset()-this.utcOffset())*d,P=this-K,q=function(){return I.m(D,K)};switch(x){case W:w=q()/12;break;case h:w=q();break;case V:w=q()/3;break;case o:w=(P-A)/6048e5;break;case F:w=(P-A)/864e5;break;case c:w=P/n;break;case s:w=P/d;break;case i:w=P/t;break;default:w=P}return k?w:I.a(w)},C.daysInMonth=function(){return this.endOf(h).$D},C.$locale=function(){return J[this.$L]},C.locale=function(B,X){if(!B)return this.$L;var k=this.clone(),w=y(B,X,!0);return w&&(k.$L=w),k},C.clone=function(){return I.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},j})(),E=O.prototype;return z.prototype=E,[["$ms",a],["$s",i],["$m",s],["$H",c],["$W",F],["$M",h],["$y",W],["$D",Q]].forEach((function(j){E[j[1]]=function(C){return this.$g(C,j[0],j[1])}})),z.extend=function(j,C){return j.$i||(j(C,O,z),j.$i=!0),z},z.locale=y,z.isDayjs=L,z.unix=function(j){return z(1e3*j)},z.en=J[G],z.Ls=J,z.p={},z}))})(HW)),HW.exports}var s3=qy();const PW=Ad(s3);var AW={exports:{}},c3=AW.exports,$y;function U3(){return $y||($y=1,(function(e,l){(function(t,d){e.exports=d()})(c3,(function(){return function(t,d,n){t=t||{};var a=d.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function s(F,o,h,V){return a.fromToBase(F,o,h,V)}n.en.relativeTime=i,a.fromToBase=function(F,o,h,V,W){for(var Q,m,N,b=h.$locale().relativeTime||i,r=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],u=r.length,S=0;S<u;S+=1){var G=r[S];G.d&&(Q=V?n(F).diff(h,G.d,!0):h.diff(F,G.d,!0));var J=(t.rounding||Math.round)(Math.abs(Q));if(N=Q>0,J<=G.r||!G.r){J<=1&&S>0&&(G=r[S-1]);var Y=b[G.l];W&&(J=W(""+J)),m=typeof Y=="string"?Y.replace("%d",J):Y(J,o,G.l,N);break}}if(o)return m;var L=N?b.future:b.past;return typeof L=="function"?L(m):L.replace("%s",m)},a.to=function(F,o){return s(F,o,this,!0)},a.from=function(F,o){return s(F,o,this)};var c=function(F){return F.$u?n.utc():n()};a.toNow=function(F){return this.to(c(this),F)},a.fromNow=function(F){return this.from(c(this),F)}}}))})(AW)),AW.exports}var Z3=U3();const F3=Ad(Z3);var _W={exports:{}},o3=_W.exports,lX;function h3(){return lX||(lX=1,(function(e,l){(function(t,d){e.exports=d(qy())})(o3,(function(t){function d(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var n=d(t),a={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(i,s){return s==="W"?i+"周":i+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(i,s){var c=100*i+s;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return n.default.locale(a,null,!0),a}))})(_W)),_W.exports}h3();const V3={key:0,class:"flow-shell-wrapper"},W3={class:"flow-shell-container"},Q3={class:"flow-shell-header"},m3={class:"header-content"},N3={class:"header-top"},R3={class:"title-section"},r3={class:"flow-title"},b3={key:0,class:"header-bottom"},u3={class:"info-item"},p3={class:"info-item"},M3={class:"value"},S3={key:1,class:"value"},T3={key:0,class:"info-item"},J3={class:"value"},G3={class:"flow-shell-main"},y3={class:"main-content"},X3={class:"content-wrapper"},B3={key:0,class:"error-tip"},Y3={key:1},k3={key:2,class:"no-form-tip"},z3={class:"side-panel"},L3={class:"side-panel-content"},I3={class:"task-info"},D3={class:"handler-info"},w3={class:"handler-name"},E3={class:"task-status"},C3={key:0,class:"task-comment"},x3={class:"comment-content"},g3={key:1,class:"task-comment"},j3={key:1,class:"no-history-tip"},O3={class:"flow-shell-footer"},tX=Nl(ht(U.defineComponent({__name:"FlowFormShell",props:U.mergeModels({appName:{default:void 0},flowKey:{default:void 0},startNodeKey:{default:void 0},taskId:{},formData:{},saveAndForward:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:U.mergeModels(["open","closed"],["update:modelValue"]),setup(e,{emit:l}){PW.extend(F3),PW.locale("zh-cn");const t=e,d=U.useModel(e,"modelValue"),n=$.createAxiosWithoutCache(),a=$.useLoading(n),i=U.ref(!1),s=U.computed(()=>a.value||i.value),c=U.ref(!1),F=U.ref(""),o=U.ref(void 0),h=$.useTaskQueryApi(n),V=$.useFlowDefinitionApi(n),W=l,Q=U.computed(()=>{var y,z;switch((z=(y=o.value)==null?void 0:y.flowInstance)==null?void 0:z.state){case 0:return"warning";case 1:return"success";case 2:return"danger";default:return"info"}}),m=U.computed(()=>{var y,z;return((y=o.value)==null?void 0:y.taskInstance)||!((z=o.value)!=null&&z.flowInstance)}),N=U.computed(()=>{var z,I;if(!((I=(z=o.value)==null?void 0:z.flowInstance)!=null&&I.nodes))return[];let y=[];return Object.values(o.value.flowInstance.nodes).forEach(O=>{y=[...y,...O.tasks]}),y.sort((O,E)=>{const j=O.finishTime?new Date(O.finishTime).getTime():0;return(E.finishTime?new Date(E.finishTime).getTime():0)-j})}),b=y=>y?PW(y).format("YYYY-MM-DD HH:mm:ss"):"",r=y=>y?PW(y).fromNow():"",u=y=>{switch(y){case 0:return"进行中";case 1:return"已完成";case 2:return"已中止";default:return"待发起"}},S=y=>{switch(y){case 0:return"未激活";case 1:return"未接收";case 2:return"已接收";case 3:return"已办结";default:return"未知状态"}};U.watch(()=>d.value,async y=>{G(),y?(W("open"),await U.nextTick(),J()):W("closed")});const G=()=>{F.value="",o.value=void 0},J=async()=>{var z;G();const y=(z=t.formData)==null?void 0:z.flowFormId;if(!t.taskId&&!(t.appName&&t.flowKey)){v.ElMessage.error("参数错误: 必须提供taskId或appName、flowKey和flowFormId");return}try{if(t.taskId)o.value=await h.getTaskInstanceById(t.taskId);else if(y)o.value=await h.getTaskByFormIdAndAppAndFlowKey(y,t.appName,t.flowKey);else{const I=await V.getEffectiveDefinition(t.appName,t.flowKey);o.value={flowDefinition:I}}}catch(I){v.ElMessage.error(I.message||"加载流程信息失败"),F.value=I.message}},Y=async()=>{var y,z;c.value=!0;try{await t.saveAndForward({flowArgs:{taskId:((z=(y=o.value)==null?void 0:y.taskInstance)==null?void 0:z.id)||"",processRequestType:"SAVE_FORM",appName:t.appName||"",flowKey:t.flowKey||"",startNodeKey:t.startNodeKey||"",forwardTo:[]},formCommand:t.formData})}finally{c.value=!1}},L=async()=>{var y;c.value=!0;try{const z=o.value;await t.saveAndForward({flowArgs:{taskId:((y=z==null?void 0:z.taskInstance)==null?void 0:y.id)||"",processRequestType:z!=null&&z.taskInstance?"FORWARD":"INITIATE",appName:t.appName||"",flowKey:t.flowKey||"",startNodeKey:t.startNodeKey||"",forwardTo:[]},formCommand:t.formData}),d.value=!1}finally{c.value=!1}};return(y,z)=>{var O,E,j,C,B,X,k,w,D,x,K,A,P,q,_,g,tl;const I=U.resolveDirective("loading");return d.value?(U.openBlock(),U.createElementBlock("div",V3,[U.withDirectives((U.openBlock(),U.createElementBlock("div",W3,[U.createElementVNode("header",Q3,[U.createElementVNode("div",m3,[U.createElementVNode("div",N3,[U.createElementVNode("div",{class:"back-button-wrapper",onClick:z[0]||(z[0]=nl=>d.value=!1)},[U.createVNode(U.unref(v.ElIcon),{size:40},{default:U.withCtx(()=>[U.createVNode(U.unref(ml.ArrowLeft))]),_:1})]),U.createElementVNode("div",null,[U.createElementVNode("div",R3,[U.createElementVNode("h2",r3,U.toDisplayString(((j=(E=(O=o.value)==null?void 0:O.flowDefinition)==null?void 0:E.flowModel)==null?void 0:j.flowCaption)||"流程详情"),1),U.createVNode(U.unref(v.ElTag),{type:Q.value},{default:U.withCtx(()=>{var nl,dl;return[U.createTextVNode(U.toDisplayString(u((dl=(nl=o.value)==null?void 0:nl.flowInstance)==null?void 0:dl.state)),1)]}),_:1},8,["type"])]),(C=o.value)!=null&&C.flowInstance?(U.openBlock(),U.createElementBlock("div",b3,[U.createElementVNode("div",u3,[z[1]||(z[1]=U.createElementVNode("span",{class:"label"},"发起人:",-1)),U.createVNode(U.unref(ZU),{"user-id":(X=(B=o.value)==null?void 0:B.flowInstance)==null?void 0:X.initiator,"show-avatar-in-tag":"","full-name":(w=(k=o.value)==null?void 0:k.flowInstance)==null?void 0:w.initiatorName},null,8,["user-id","full-name"])]),U.createElementVNode("div",p3,[z[2]||(z[2]=U.createElementVNode("span",{class:"label"},"发起时间:",-1)),(x=(D=o.value)==null?void 0:D.flowInstance)!=null&&x.createTime?(U.openBlock(),U.createBlock(U.unref(v.ElTooltip),{key:0,content:b((A=(K=o.value)==null?void 0:K.flowInstance)==null?void 0:A.createTime),placement:"top"},{default:U.withCtx(()=>{var nl,dl;return[U.createElementVNode("span",M3,U.toDisplayString(r((dl=(nl=o.value)==null?void 0:nl.flowInstance)==null?void 0:dl.createTime)),1)]}),_:1},8,["content"])):(U.openBlock(),U.createElementBlock("span",S3,"-"))]),(q=(P=o.value)==null?void 0:P.flowInstance)!=null&&q.workNo?(U.openBlock(),U.createElementBlock("div",T3,[z[3]||(z[3]=U.createElementVNode("span",{class:"label"},"工作文号:",-1)),U.createElementVNode("span",J3,U.toDisplayString((g=(_=o.value)==null?void 0:_.flowInstance)==null?void 0:g.workNo),1)])):U.createCommentVNode("",!0)])):U.createCommentVNode("",!0)])])])]),U.createElementVNode("main",G3,[U.createElementVNode("section",y3,[U.createElementVNode("div",X3,[F.value?(U.openBlock(),U.createElementBlock("div",B3,[U.createVNode(U.unref(v.ElResult),{icon:"error",title:"加载失败","sub-title":F.value},{extra:U.withCtx(()=>[U.createVNode(U.unref(v.ElButton),{type:"primary",onClick:J},{default:U.withCtx(()=>[...z[4]||(z[4]=[U.createTextVNode("重试",-1)])]),_:1})]),_:1},8,["sub-title"])])):o.value?(U.openBlock(),U.createElementBlock("div",Y3,[U.renderSlot(y.$slots,"default",{flowParam:o.value},void 0,!0)])):(U.openBlock(),U.createElementBlock("div",k3,[U.createVNode(U.unref(v.ElEmpty),{description:"暂无表单内容"})]))])]),U.createElementVNode("aside",z3,[z[7]||(z[7]=U.createElementVNode("div",{class:"side-panel-header"},[U.createElementVNode("h3",null,"办理历史")],-1)),U.createElementVNode("div",L3,[N.value.length>0?(U.openBlock(),U.createBlock(U.unref(v.ElTimeline),{key:0},{default:U.withCtx(()=>[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList(N.value,(nl,dl)=>(U.openBlock(),U.createBlock(U.unref(v.ElTimelineItem),{key:dl,timestamp:r(nl.finishTime),placement:"top"},{default:U.withCtx(()=>[U.createVNode(U.unref(v.ElCard),null,{default:U.withCtx(()=>[U.createElementVNode("div",I3,[U.createElementVNode("div",D3,[U.createElementVNode("span",w3,U.toDisplayString(nl.handlerName||"未知"),1),U.createVNode(U.unref(v.ElTooltip),{content:b(nl.finishTime),placement:"top"},{default:U.withCtx(()=>[U.createElementVNode("span",E3,U.toDisplayString(S(nl.state)),1)]),_:2},1032,["content"])]),nl.comment?(U.openBlock(),U.createElementBlock("div",C3,[z[5]||(z[5]=U.createElementVNode("span",{class:"comment-label"},"意见:",-1)),U.createElementVNode("span",x3,U.toDisplayString(nl.comment),1)])):(U.openBlock(),U.createElementBlock("div",g3,[...z[6]||(z[6]=[U.createElementVNode("span",{class:"comment-label"},"意见:",-1),U.createElementVNode("span",{class:"comment-content empty"},"无",-1)])]))])]),_:2},1024)]),_:2},1032,["timestamp"]))),128))]),_:1})):(U.openBlock(),U.createElementBlock("div",j3,[U.createVNode(U.unref(v.ElEmpty),{description:"暂无办理历史","image-size":100})]))])])]),U.createElementVNode("footer",O3,[U.createVNode(U.unref(Vt),{onClick:Y,shortcut:"Ctrl+S",tooltip:"保存",loading:c.value,disabled:c.value},{default:U.withCtx(()=>[...z[8]||(z[8]=[U.createTextVNode("保存",-1)])]),_:1},8,["loading","disabled"]),m.value?(U.openBlock(),U.createBlock(U.unref(Vt),{key:0,onClick:L,type:"danger",shortcut:"Ctrl+F",tooltip:"保存并"+((tl=o.value)!=null&&tl.taskInstance?"结束当前工作步骤办理":"发起工作"),loading:c.value,disabled:c.value},{default:U.withCtx(()=>{var nl;return[U.createTextVNode(U.toDisplayString((nl=o.value)!=null&&nl.taskInstance?"办理结束":"发起工作"),1)]}),_:1},8,["tooltip","loading","disabled"])):U.createCommentVNode("",!0)])])),[[I,s.value]])])):U.createCommentVNode("",!0)}}}),[["__scopeId","data-v-716e0837"]])),v3=Object.freeze(Object.defineProperty({__proto__:null,AceTip:yG,JaAutocomplete:zy,JaAvatar:xW,JaBaseRolePicker:KW,JaButton:Vt,JaChannelPicker:jy,JaChannelPickerRaw:Oy,JaCheckbox:YG,JaCheckboxGroup:Py,JaDatePicker:LG,JaDepartmentPicker:ty,JaDepartmentTree:jr,JaDropdownButton:CG,JaEnumList:PG,JaEnumListRaw:AG,JaEnumPicker:Ay,JaFilePreviewer:GG,JaFlowFormShell:tX,JaForm:BG,JaFormItem:ts,JaInput:EW,JaInputI18nRaw:lb,JaInputNumber:kG,JaMapItemList:qG,JaMapItemListRaw:$G,JaNumberList:fG,JaNumberListRaw:KG,JaPropertyPicker:Ky,JaPropertyPickerRaw:Hy,JaRadioGroup:Ly,JaRoleCategorySelector:xy,JaRolePicker:Ey,JaRolePickerRaw:Cy,JaScrollbar:Hr,JaSelect:zG,JaStringList:jG,JaStringListRaw:OG,JaSwitch:xG,JaTimePicker:Yy,JaUploader:TG,JaUploaderRaw:JG,JaUserGroupPicker:ky,JaUserGroupTree:fr,JaUserInfoTag:ZU,JaUserList:By,JaUserPicker:Xy,JaUserPickerRaw:yy,JaUserSelectDialog:Kr,getAvatarToken:Dr,updateAvatarToken:dy},Symbol.toStringTag,{value:"Module"}));function eX(e){e.directive("focus",vW),e.directive("shortcut",CW),e.directive("auth",EG)}const f3=[{text:"近一天",value:()=>{const e=new Date,l=new Date;return l.setDate(l.getDate()-1),[l,e]}},{text:"近三天",value:()=>{const e=new Date,l=new Date;return l.setDate(l.getDate()-3),[l,e]}},{text:"近一周",value:()=>{const e=new Date,l=new Date;return l.setDate(l.getDate()-7),[l,e]}},{text:"近一月",value:()=>{const e=new Date,l=new Date;return l.setMonth(l.getMonth()-1),[l,e]}},{text:"近三月",value:()=>{const e=new Date,l=new Date;return l.setMonth(l.getMonth()-3),[l,e]}},{text:"近半年",value:()=>{const e=new Date,l=new Date;return l.setMonth(l.getMonth()-6),[l,e]}},{text:"近一年",value:()=>{const e=new Date,l=new Date;return l.setFullYear(l.getFullYear()-1),[l,e]}}];function K3(e){if(!e)throw new Error("无法获取到应用名称,请确保VITE_APP_NAME环境变量已配置或者在创建时传入appName参数。");if(!window.microApp)throw new Error("无法获取到window.microApp。");const l=U.ref(new Set),t=(F,o=!0,h=!0)=>{const V={sender:e,timestamp:Date.now(),payload:F};o?window.microApp.forceDispatch(V):window.microApp.dispatch(V,W=>{console.log("消息是否有返回值",W)}),h&&i()},d=(F,o=!0)=>{const h={sender:"app-demo",timestamp:Date.now(),payload:F};window.microApp.setGlobalData(h),o&&i()},n=(F,o=!0)=>{window.microApp.addGlobalDataListener(F,o)},a=()=>window.microApp.getData(),i=()=>{window.microApp.clearData()},s=(F,o=!1)=>{window.microApp.addDataListener(F,o),l.value.add(F)},c=F=>{window.microApp.removeDataListener(F),l.value.delete(F)};return U.onUnmounted(()=>{window.microApp.clearDataListener(),l.value.clear()}),{sendMessage:t,onMessage:s,clearCache:i,getBaseAppData:a,offMessage:c,listeners:l,sendGlobalMessage:d,onGlobalMessage:n}}let dX=null,G0;function H3(){return{async getDataTypes(){let e=dX;if(e)return e;if(G0)return await G0;const l=$.createAxiosWithoutCache();return G0=$.useEntityApi(l).getPropertyDataTypes().then(d=>(dX=d,d)).finally(()=>{G0=void 0}),await G0}}}let nX=null,y0;function P3(){return{async getConstraintProviders(){let e=nX;if(e)return e;if(y0)return await y0;const l=$.createAxiosWithoutCache();return y0=$.useConstraintApi(l).getConstraintProviders().then(d=>(nX=d,d)).finally(()=>{y0=void 0}),await y0}}}const ab=new Map;let ib=new Map;function A3(){return{refreshFileConfigurationCache(e){ab.delete(e)},async getFileConfigurations(e){let l=ab.get(e);if(l)return l;let t=ib.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useFileConfigurationApi(d).getByAppService(e,0,9999999).then(a=>(ab.set(e,a.content),a.content)).finally(()=>{ib.delete(e)}),ib.set(e,t),await t}}}const sb=new Map;let cb=new Map;function _3(){return{refreshNumberTemplatesCache(e){sb.delete(e)},async getNumberTemplates(e){let l=sb.get(e);if(l)return l;let t=cb.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useStringIdTemplateApi(d).getByApp(e,0,9999999).then(a=>(sb.set(e,a.content),a.content)).finally(()=>{cb.delete(e)}),cb.set(e,t),await t}}}const Ub=new Map;let Zb=new Map;function q3(){return{refreshEntitiesCache(e){Ub.delete(e)},async getEntities(e){let l=Ub.get(e);if(l)return l;let t=Zb.get(e);if(t)return await t;const d=$.createAxiosWithoutCache();return t=$.useEntityApi(d).getAll(e).then(a=>(Ub.set(e,a),a)).finally(()=>{Zb.delete(e)}),Zb.set(e,t),await t}}}/*!
|
|
425
|
+
* vue-router v5.0.1
|
|
426
|
+
* (c) 2026 Eduardo San Martin Morote
|
|
427
|
+
* @license MIT
|
|
428
|
+
*/Symbol(process.env.NODE_ENV!=="production"?"navigation failure":""),Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const $3=Symbol(process.env.NODE_ENV!=="production"?"router":"");Symbol(process.env.NODE_ENV!=="production"?"route location":""),Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function lg(){return U.inject($3)}function tg(e){const l=lg(),t=U.ref(!0),d=U.computed(()=>e.value===void 0);return{visible:U.computed({get:()=>d.value?t.value:e.value,set:a=>{d.value?(t.value=a,a||l.back()):e.value=a}}),isRouteMode:d}}const eg={install(e){for(const[l,t]of Object.entries(v3))e.component(l,t);eX(e)}};el.AceTip=yG,el.AceVueUI=eg,el.JaAutocomplete=zy,el.JaAvatar=xW,el.JaBaseRolePicker=KW,el.JaButton=Vt,el.JaChannelPicker=jy,el.JaChannelPickerRaw=Oy,el.JaCheckbox=YG,el.JaCheckboxGroup=Py,el.JaDatePicker=LG,el.JaDepartmentPicker=ty,el.JaDepartmentTree=jr,el.JaDropdownButton=CG,el.JaEnumList=PG,el.JaEnumListRaw=AG,el.JaEnumPicker=Ay,el.JaFilePreviewer=GG,el.JaFlowFormShell=tX,el.JaForm=BG,el.JaFormItem=ts,el.JaInput=EW,el.JaInputI18nRaw=lb,el.JaInputNumber=kG,el.JaMapItemList=qG,el.JaMapItemListRaw=$G,el.JaNumberList=fG,el.JaNumberListRaw=KG,el.JaPropertyPicker=Ky,el.JaPropertyPickerRaw=Hy,el.JaRadioGroup=Ly,el.JaRoleCategorySelector=xy,el.JaRolePicker=Ey,el.JaRolePickerRaw=Cy,el.JaScrollbar=Hr,el.JaSelect=zG,el.JaStringList=jG,el.JaStringListRaw=OG,el.JaSwitch=xG,el.JaTimePicker=Yy,el.JaUploader=TG,el.JaUploaderRaw=JG,el.JaUserGroupPicker=ky,el.JaUserGroupTree=fr,el.JaUserInfoTag=ZU,el.JaUserList=By,el.JaUserPicker=Xy,el.JaUserPickerRaw=yy,el.JaUserSelectDialog=Kr,el.SCROLL_BAR_WRAPPED_INJECT_KEY=Or,el.getAvatarToken=Dr,el.installDirectives=eX,el.shortcuts=f3,el.updateAvatarToken=dy,el.useAppInstances=hU,el.useBackendValidations=XG,el.useBridge=K3,el.useConstraintProviders=P3,el.useEntities=q3,el.useEntityPropDataTypes=H3,el.useFileConfigurations=A3,el.useGroups=Qy,el.useNumberTemplates=_3,el.useProperties=vy,el.useRealms=OW,el.useRoleCategories=Iy,el.useRoles=$r,el.useRouteableVisible=tg,el.useSystemClassificationLevelMap=Tb,el.useSystemClassificationLevels=Sb,el.useTreeData=es,el.useUserClassificationLevel=kX,el.useUserClassificationLevelMap=zX,el.useUserRefQuery=gr,Object.defineProperty(el,Symbol.toStringTag,{value:"Module"})}));
|