import{X,o,g as f,x as d,a as g,B as Y,$ as q,aV as A,a6 as R,R as J,y as W,aC as Q,A as I,D as k,t as B,b as F,n as L,w as b,c as h,E as S,F as E,j as C,a_ as V,h as v,f as T,S as $,_ as x,aa as _,u as ee,M as le,N as te}from"./app-SC54XQDl.js";import{s as ie}from"./app-CmrRgGIA.js";import{s as j}from"./app-Ch8j4za4.js";import{s as ne}from"./app-CkINxBL9.js";import{s as ae}from"./app-yUrwy8EY.js";import{T as P}from"./app-DoVkxbmA.js";import{T as N}from"./app-CNHjdV6U.js";var O={name:"UploadIcon",extends:X},se=g("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.58942 9.82197C6.70165 9.93405 6.85328 9.99793 7.012 10C7.17071 9.99793 7.32234 9.93405 7.43458 9.82197C7.54681 9.7099 7.61079 9.55849 7.61286 9.4V2.04798L9.79204 4.22402C9.84752 4.28011 9.91365 4.32457 9.98657 4.35479C10.0595 4.38502 10.1377 4.40039 10.2167 4.40002C10.2956 4.40039 10.3738 4.38502 10.4467 4.35479C10.5197 4.32457 10.5858 4.28011 10.6413 4.22402C10.7538 4.11152 10.817 3.95902 10.817 3.80002C10.817 3.64102 10.7538 3.48852 10.6413 3.37602L7.45127 0.190618C7.44656 0.185584 7.44176 0.180622 7.43687 0.175736C7.32419 0.063214 7.17136 0 7.012 0C6.85264 0 6.69981 0.063214 6.58712 0.175736C6.58181 0.181045 6.5766 0.186443 6.5715 0.191927L3.38282 3.37602C3.27669 3.48976 3.2189 3.6402 3.22165 3.79564C3.2244 3.95108 3.28746 4.09939 3.39755 4.20932C3.50764 4.31925 3.65616 4.38222 3.81182 4.38496C3.96749 4.3877 4.11814 4.33001 4.23204 4.22402L6.41113 2.04807V9.4C6.41321 9.55849 6.47718 9.7099 6.58942 9.82197ZM11.9952 14H2.02883C1.751 13.9887 1.47813 13.9228 1.22584 13.8061C0.973545 13.6894 0.746779 13.5241 0.558517 13.3197C0.370254 13.1154 0.22419 12.876 0.128681 12.6152C0.0331723 12.3545 -0.00990605 12.0775 0.0019109 11.8V9.40005C0.0019109 9.24092 0.065216 9.08831 0.1779 8.97579C0.290584 8.86326 0.443416 8.80005 0.602775 8.80005C0.762134 8.80005 0.914966 8.86326 1.02765 8.97579C1.14033 9.08831 1.20364 9.24092 1.20364 9.40005V11.8C1.18295 12.0376 1.25463 12.274 1.40379 12.4602C1.55296 12.6463 1.76817 12.7681 2.00479 12.8H11.9952C12.2318 12.7681 12.447 12.6463 12.5962 12.4602C12.7453 12.274 12.817 12.0376 12.7963 11.8V9.40005C12.7963 9.24092 12.8596 9.08831 12.9723 8.97579C13.085 8.86326 13.2378 8.80005 13.3972 8.80005C13.5565 8.80005 13.7094 8.86326 13.8221 8.97579C13.9347 9.08831 13.998 9.24092 13.998 9.40005V11.8C14.022 12.3563 13.8251 12.8996 13.45 13.3116C13.0749 13.7236 12.552 13.971 11.9952 14Z",fill:"currentColor"},null,-1),oe=[se];function re(e,l,t,a,n,i){return o(),f("svg",d({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),oe,16)}O.render=re;var ue=function(l){var t=l.dt;return`
.p-fileupload input[type="file"] {
    display: none;
}

.p-fileupload-advanced {
    border: 1px solid `.concat(t("fileupload.border.color"),`;
    border-radius: `).concat(t("fileupload.border.radius"),`;
    background: `).concat(t("fileupload.background"),`;
    color: `).concat(t("fileupload.color"),`;
}

.p-fileupload-header {
    display: flex;
    align-items: center;
    padding: `).concat(t("fileupload.header.padding"),`;
    background: `).concat(t("fileupload.header.background"),`;
    color: `).concat(t("fileupload.header.color"),`;
    border-style: solid;
    border-width: `).concat(t("fileupload.header.border.width"),`;
    border-color: `).concat(t("fileupload.header.border.color"),`;
    border-radius: `).concat(t("fileupload.header.border.radius"),`;
    gap: `).concat(t("fileupload.header.gap"),`;
}

.p-fileupload-content {
    border: 1px solid transparent;
    position: relative;
    transition: border-color `).concat(t("fileupload.transition.duration"),`;
    padding: `).concat(t("fileupload.content.padding"),`;
}

.p-fileupload-content .p-progressbar {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    height: `).concat(t("fileupload.progressbar.height"),`;
}

.p-fileupload-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.125rem;
}

.p-fileupload-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: `).concat(t("fileupload.file.padding"),`;
    border-bottom: 1px solid `).concat(t("fileupload.file.border.color"),`;
    gap: `).concat(t("fileupload.file.gap"),`;
}

.p-fileupload-file:last-child {
    border-bottom: 0;
}

.p-fileupload-file-info {
    display: flex;
    flex-direction: column;
    gap: `).concat(t("fileupload.file.info.gap"),`;
}

.p-fileupload-file-thumbnail {
    flex-shrink: 0;
}

.p-fileupload-file-actions {
    margin-left: auto;
}

.p-fileupload-highlight {
    border: 1px dashed `).concat(t("fileupload.content.highlight.border.color"),`;
}

.p-fileupload-advanced .p-message {
    margin-top: 0;
}

.p-fileupload-basic {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: `).concat(t("fileupload.basic.gap"),`;
}
`)},de={root:function(l){var t=l.props;return["p-fileupload p-fileupload-".concat(t.mode," p-component")]},header:"p-fileupload-header",pcChooseButton:"p-fileupload-choose-button",pcUploadButton:"p-fileupload-upload-button",pcCancelButton:"p-fileupload-cancel-button",content:"p-fileupload-content",fileList:"p-fileupload-file-list",file:"p-fileupload-file",fileThumbnail:"p-fileupload-file-thumbnail",fileInfo:"p-fileupload-file-info",fileName:"p-fileupload-file-name",fileSize:"p-fileupload-file-size",pcFileBadge:"p-fileupload-file-badge",fileActions:"p-fileupload-file-actions",pcFileRemoveButton:"p-fileupload-file-remove-button"},ce=Y.extend({name:"fileupload",theme:ue,classes:de}),pe={name:"BaseFileUpload",extends:W,props:{name:{type:String,default:null},url:{type:String,default:null},mode:{type:String,default:"advanced"},multiple:{type:Boolean,default:!1},accept:{type:String,default:null},disabled:{type:Boolean,default:!1},auto:{type:Boolean,default:!1},maxFileSize:{type:Number,default:null},invalidFileSizeMessage:{type:String,default:"{0}: Invalid file size, file size should be smaller than {1}."},invalidFileTypeMessage:{type:String,default:"{0}: Invalid file type, allowed file types: {1}."},fileLimit:{type:Number,default:null},invalidFileLimitMessage:{type:String,default:"Maximum number of files exceeded, limit is {0} at most."},withCredentials:{type:Boolean,default:!1},previewWidth:{type:Number,default:50},chooseLabel:{type:String,default:null},uploadLabel:{type:String,default:null},cancelLabel:{type:String,default:null},customUpload:{type:Boolean,default:!1},showUploadButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},chooseIcon:{type:String,default:void 0},uploadIcon:{type:String,default:void 0},cancelIcon:{type:String,default:void 0},style:null,class:null,chooseButtonProps:{type:null,default:null},uploadButtonProps:{type:Object,default:function(){return{severity:"secondary"}}},cancelButtonProps:{type:Object,default:function(){return{severity:"secondary"}}}},style:ce,provide:function(){return{$pcFileUpload:this,$parentInstance:this}}},K={name:"FileContent",hostName:"FileUpload",extends:W,emits:["remove"],props:{files:{type:Array,default:function(){return[]}},badgeSeverity:{type:String,default:"warn"},badgeValue:{type:String,default:null},previewWidth:{type:Number,default:50},templates:{type:null,default:null}},methods:{formatSize:function(l){var t,a=1024,n=3,i=((t=this.$primevue.config.locale)===null||t===void 0?void 0:t.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(l===0)return"0 ".concat(i[0]);var u=Math.floor(Math.log(l)/Math.log(a)),r=parseFloat((l/Math.pow(a,u)).toFixed(n));return"".concat(r," ").concat(i[u])}},components:{Button:R,Badge:Q,TimesIcon:j}},fe=["alt","src","width"];function he(e,l,t,a,n,i){var u=I("Badge"),r=I("TimesIcon"),p=I("Button");return o(!0),f(E,null,k(t.files,function(c,s){return o(),f("div",d({key:c.name+c.type+c.size,class:e.cx("file"),ref_for:!0},e.ptm("file")),[g("img",d({role:"presentation",class:e.cx("fileThumbnail"),alt:c.name,src:c.objectURL,width:t.previewWidth,ref_for:!0},e.ptm("fileThumbnail")),null,16,fe),g("div",d({class:e.cx("fileInfo"),ref_for:!0},e.ptm("fileInfo")),[g("div",d({class:e.cx("fileName"),ref_for:!0},e.ptm("fileName")),B(c.name),17),g("span",d({class:e.cx("fileSize"),ref_for:!0},e.ptm("fileSize")),B(i.formatSize(c.size)),17)],16),F(u,{value:t.badgeValue,class:L(e.cx("pcFileBadge")),severity:t.badgeSeverity,unstyled:e.unstyled,pt:e.ptm("pcFileBadge")},null,8,["value","class","severity","unstyled","pt"]),g("div",d({class:e.cx("fileActions"),ref_for:!0},e.ptm("fileActions")),[F(p,{onClick:function(m){return e.$emit("remove",s)},text:"",rounded:"",severity:"danger",class:L(e.cx("pcFileRemoveButton")),unstyled:e.unstyled,pt:e.ptm("pcFileRemoveButton")},{icon:b(function(y){return[t.templates.fileremoveicon?(o(),h(S(t.templates.fileremoveicon),{key:0,class:L(y.class),file:c,index:s},null,8,["class","file","index"])):(o(),h(r,d({key:1,class:y.class,"aria-hidden":"true",ref_for:!0},e.ptm("pcFileRemoveButton").icon),null,16,["class"]))]}),_:2},1032,["onClick","class","unstyled","pt"])],16)],16)}),128)}K.render=he;function U(e){return ye(e)||ge(e)||H(e)||me()}function me(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ye(e){if(Array.isArray(e))return z(e)}function w(e,l){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=H(e))||l){t&&(e=t);var a=0,n=function(){};return{s:n,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(c){throw c},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,r=!1;return{s:function(){t=t.call(e)},n:function(){var c=t.next();return u=c.done,c},e:function(c){r=!0,i=c},f:function(){try{u||t.return==null||t.return()}finally{if(r)throw i}}}}function H(e,l){if(e){if(typeof e=="string")return z(e,l);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?z(e,l):void 0}}function z(e,l){(l==null||l>e.length)&&(l=e.length);for(var t=0,a=Array(l);t<l;t++)a[t]=e[t];return a}var Z={name:"FileUpload",extends:pe,inheritAttrs:!1,emits:["select","uploader","before-upload","progress","upload","error","before-send","clear","remove","remove-uploaded-file"],duplicateIEEvent:!1,data:function(){return{uploadedFileCount:0,files:[],messages:[],focused:!1,progress:null,uploadedFiles:[]}},methods:{upload:function(){this.hasFiles&&this.uploader()},onBasicUploaderClick:function(l){l.button===0&&this.$refs.fileInput.click()},onFileSelect:function(l){if(l.type!=="drop"&&this.isIE11()&&this.duplicateIEEvent){this.duplicateIEEvent=!1;return}this.isBasic&&this.hasFiles&&(this.files=[]),this.messages=[],this.files=this.files||[];var t=l.dataTransfer?l.dataTransfer.files:l.target.files,a=w(t),n;try{for(a.s();!(n=a.n()).done;){var i=n.value;this.isFileSelected(i)||this.validate(i)&&(this.isImage(i)&&(i.objectURL=window.URL.createObjectURL(i)),this.files.push(i))}}catch(u){a.e(u)}finally{a.f()}this.$emit("select",{originalEvent:l,files:this.files}),this.fileLimit&&this.checkFileLimit(),this.auto&&this.hasFiles&&!this.isFileLimitExceeded()&&this.uploader(),l.type!=="drop"&&this.isIE11()?this.clearIEInput():this.clearInputElement()},choose:function(){this.$refs.fileInput.click()},uploader:function(){var l=this;if(this.customUpload)this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.$emit("uploader",{files:this.files}),this.clear();else{var t=new XMLHttpRequest,a=new FormData;this.$emit("before-upload",{xhr:t,formData:a});var n=w(this.files),i;try{for(n.s();!(i=n.n()).done;){var u=i.value;a.append(this.name,u,u.name)}}catch(r){n.e(r)}finally{n.f()}t.upload.addEventListener("progress",function(r){r.lengthComputable&&(l.progress=Math.round(r.loaded*100/r.total)),l.$emit("progress",{originalEvent:r,progress:l.progress})}),t.onreadystatechange=function(){if(t.readyState===4){var r;l.progress=0,t.status>=200&&t.status<300?(l.fileLimit&&(l.uploadedFileCount+=l.files.length),l.$emit("upload",{xhr:t,files:l.files})):l.$emit("error",{xhr:t,files:l.files}),(r=l.uploadedFiles).push.apply(r,U(l.files)),l.clear()}},t.open("POST",this.url,!0),this.$emit("before-send",{xhr:t,formData:a}),t.withCredentials=this.withCredentials,t.send(a)}},clear:function(){this.files=[],this.messages=null,this.$emit("clear"),this.isAdvanced&&this.clearInputElement()},onFocus:function(){this.focused=!0},onBlur:function(){this.focused=!1},isFileSelected:function(l){if(this.files&&this.files.length){var t=w(this.files),a;try{for(t.s();!(a=t.n()).done;){var n=a.value;if(n.name+n.type+n.size===l.name+l.type+l.size)return!0}}catch(i){t.e(i)}finally{t.f()}}return!1},isIE11:function(){return!!window.MSInputMethodContext&&!!document.documentMode},validate:function(l){return this.accept&&!this.isFileTypeValid(l)?(this.messages.push(this.invalidFileTypeMessage.replace("{0}",l.name).replace("{1}",this.accept)),!1):this.maxFileSize&&l.size>this.maxFileSize?(this.messages.push(this.invalidFileSizeMessage.replace("{0}",l.name).replace("{1}",this.formatSize(this.maxFileSize))),!1):!0},isFileTypeValid:function(l){var t=this.accept.split(",").map(function(r){return r.trim()}),a=w(t),n;try{for(a.s();!(n=a.n()).done;){var i=n.value,u=this.isWildcard(i)?this.getTypeClass(l.type)===this.getTypeClass(i):l.type==i||this.getFileExtension(l).toLowerCase()===i.toLowerCase();if(u)return!0}}catch(r){a.e(r)}finally{a.f()}return!1},getTypeClass:function(l){return l.substring(0,l.indexOf("/"))},isWildcard:function(l){return l.indexOf("*")!==-1},getFileExtension:function(l){return"."+l.name.split(".").pop()},isImage:function(l){return/^image\//.test(l.type)},onDragEnter:function(l){this.disabled||(l.stopPropagation(),l.preventDefault())},onDragOver:function(l){this.disabled||(!this.isUnstyled&&q(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!0),l.stopPropagation(),l.preventDefault())},onDragLeave:function(){this.disabled||(!this.isUnstyled&&A(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1))},onDrop:function(l){if(!this.disabled){!this.isUnstyled&&A(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1),l.stopPropagation(),l.preventDefault();var t=l.dataTransfer?l.dataTransfer.files:l.target.files,a=this.multiple||t&&t.length===1;a&&this.onFileSelect(l)}},remove:function(l){this.clearInputElement();var t=this.files.splice(l,1)[0];this.files=U(this.files),this.$emit("remove",{file:t,files:this.files})},removeUploadedFile:function(l){var t=this.uploadedFiles.splice(l,1)[0];this.uploadedFiles=U(this.uploadedFiles),this.$emit("remove-uploaded-file",{file:t,files:this.uploadedFiles})},clearInputElement:function(){this.$refs.fileInput.value=""},clearIEInput:function(){this.$refs.fileInput&&(this.duplicateIEEvent=!0,this.$refs.fileInput.value="")},formatSize:function(l){var t,a=1024,n=3,i=((t=this.$primevue.config.locale)===null||t===void 0?void 0:t.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(l===0)return"0 ".concat(i[0]);var u=Math.floor(Math.log(l)/Math.log(a)),r=parseFloat((l/Math.pow(a,u)).toFixed(n));return"".concat(r," ").concat(i[u])},isFileLimitExceeded:function(){return this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount&&this.focused&&(this.focused=!1),this.fileLimit&&this.fileLimit<this.files.length+this.uploadedFileCount},checkFileLimit:function(){this.isFileLimitExceeded()&&this.messages.push(this.invalidFileLimitMessage.replace("{0}",this.fileLimit.toString()))},onMessageClose:function(){this.messages=null}},computed:{isAdvanced:function(){return this.mode==="advanced"},isBasic:function(){return this.mode==="basic"},chooseButtonClass:function(){return[this.cx("pcChooseButton"),this.class]},basicFileChosenLabel:function(){var l;if(this.auto)return this.chooseButtonLabel;if(this.hasFiles){var t;return this.files&&this.files.length===1?this.files[0].name:(t=this.$primevue.config.locale)===null||t===void 0||(t=t.fileChosenMessage)===null||t===void 0?void 0:t.replace("{0}",this.files.length)}return((l=this.$primevue.config.locale)===null||l===void 0?void 0:l.noFileChosenMessage)||""},hasFiles:function(){return this.files&&this.files.length>0},hasUploadedFiles:function(){return this.uploadedFiles&&this.uploadedFiles.length>0},chooseDisabled:function(){return this.disabled||this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount},uploadDisabled:function(){return this.disabled||!this.hasFiles||this.fileLimit&&this.fileLimit<this.files.length},cancelDisabled:function(){return this.disabled||!this.hasFiles},chooseButtonLabel:function(){return this.chooseLabel||this.$primevue.config.locale.choose},uploadButtonLabel:function(){return this.uploadLabel||this.$primevue.config.locale.upload},cancelButtonLabel:function(){return this.cancelLabel||this.$primevue.config.locale.cancel},completedLabel:function(){return this.$primevue.config.locale.completed},pendingLabel:function(){return this.$primevue.config.locale.pending}},components:{Button:R,ProgressBar:ae,Message:ne,FileContent:K,PlusIcon:ie,UploadIcon:O,TimesIcon:j},directives:{ripple:J}},ve=["multiple","accept","disabled"],be=["files"],Ce=["accept","disabled","multiple"];function Fe(e,l,t,a,n,i){var u=I("Button"),r=I("ProgressBar"),p=I("Message"),c=I("FileContent");return i.isAdvanced?(o(),f("div",d({key:0,class:e.cx("root")},e.ptmi("root")),[g("input",d({ref:"fileInput",type:"file",onChange:l[0]||(l[0]=function(){return i.onFileSelect&&i.onFileSelect.apply(i,arguments)}),multiple:e.multiple,accept:e.accept,disabled:i.chooseDisabled},e.ptm("input")),null,16,ve),g("div",d({class:e.cx("header")},e.ptm("header")),[C(e.$slots,"header",{files:n.files,uploadedFiles:n.uploadedFiles,chooseCallback:i.choose,uploadCallback:i.uploader,clearCallback:i.clear},function(){return[F(u,d({label:i.chooseButtonLabel,class:i.chooseButtonClass,style:e.style,disabled:e.disabled,unstyled:e.unstyled,onClick:i.choose,onKeydown:V(i.choose,["enter"]),onFocus:i.onFocus,onBlur:i.onBlur},e.chooseButtonProps,{pt:e.ptm("pcChooseButton")}),{icon:b(function(s){return[C(e.$slots,"chooseicon",{},function(){return[(o(),h(S(e.chooseIcon?"span":"PlusIcon"),d({class:[s.class,e.chooseIcon],"aria-hidden":"true"},e.ptm("pcChooseButton").icon),null,16,["class"]))]})]}),_:3},16,["label","class","style","disabled","unstyled","onClick","onKeydown","onFocus","onBlur","pt"]),e.showUploadButton?(o(),h(u,d({key:0,class:e.cx("pcUploadButton"),label:i.uploadButtonLabel,onClick:i.uploader,disabled:i.uploadDisabled,unstyled:e.unstyled},e.uploadButtonProps,{pt:e.ptm("pcUploadButton")}),{icon:b(function(s){return[C(e.$slots,"uploadicon",{},function(){return[(o(),h(S(e.uploadIcon?"span":"UploadIcon"),d({class:[s.class,e.uploadIcon],"aria-hidden":"true"},e.ptm("pcUploadButton").icon,{"data-pc-section":"uploadbuttonicon"}),null,16,["class"]))]})]}),_:3},16,["class","label","onClick","disabled","unstyled","pt"])):v("",!0),e.showCancelButton?(o(),h(u,d({key:1,class:e.cx("pcCancelButton"),label:i.cancelButtonLabel,onClick:i.clear,disabled:i.cancelDisabled,unstyled:e.unstyled},e.cancelButtonProps,{pt:e.ptm("pcCancelButton")}),{icon:b(function(s){return[C(e.$slots,"cancelicon",{},function(){return[(o(),h(S(e.cancelIcon?"span":"TimesIcon"),d({class:[s.class,e.cancelIcon],"aria-hidden":"true"},e.ptm("pcCancelButton").icon,{"data-pc-section":"cancelbuttonicon"}),null,16,["class"]))]})]}),_:3},16,["class","label","onClick","disabled","unstyled","pt"])):v("",!0)]})],16),g("div",d({ref:"content",class:e.cx("content"),onDragenter:l[1]||(l[1]=function(){return i.onDragEnter&&i.onDragEnter.apply(i,arguments)}),onDragover:l[2]||(l[2]=function(){return i.onDragOver&&i.onDragOver.apply(i,arguments)}),onDragleave:l[3]||(l[3]=function(){return i.onDragLeave&&i.onDragLeave.apply(i,arguments)}),onDrop:l[4]||(l[4]=function(){return i.onDrop&&i.onDrop.apply(i,arguments)})},e.ptm("content"),{"data-p-highlight":!1}),[C(e.$slots,"content",{files:n.files,uploadedFiles:n.uploadedFiles,removeUploadedFileCallback:i.removeUploadedFile,removeFileCallback:i.remove,progress:n.progress,messages:n.messages},function(){return[i.hasFiles?(o(),h(r,{key:0,value:n.progress,showValue:!1,unstyled:e.unstyled,pt:e.ptm("pcProgressbar")},null,8,["value","unstyled","pt"])):v("",!0),(o(!0),f(E,null,k(n.messages,function(s){return o(),h(p,{key:s,severity:"error",onClose:i.onMessageClose,unstyled:e.unstyled,pt:e.ptm("pcMessage")},{default:b(function(){return[T(B(s),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),i.hasFiles?(o(),f("div",{key:1,class:L(e.cx("fileList"))},[F(c,{files:n.files,onRemove:i.remove,badgeValue:i.pendingLabel,previewWidth:e.previewWidth,templates:e.$slots,unstyled:e.unstyled,pt:e.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])],2)):v("",!0),i.hasUploadedFiles?(o(),f("div",{key:2,class:L(e.cx("fileList"))},[F(c,{files:n.uploadedFiles,onRemove:i.removeUploadedFile,badgeValue:i.completedLabel,badgeSeverity:"success",previewWidth:e.previewWidth,templates:e.$slots,unstyled:e.unstyled,pt:e.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])],2)):v("",!0)]}),e.$slots.empty&&!i.hasFiles&&!i.hasUploadedFiles?(o(),f("div",$(d({key:0},e.ptm("empty"))),[C(e.$slots,"empty")],16)):v("",!0)],16)],16)):i.isBasic?(o(),f("div",d({key:1,class:e.cx("root")},e.ptmi("root")),[(o(!0),f(E,null,k(n.messages,function(s){return o(),h(p,{key:s,severity:"error",onClose:i.onMessageClose,unstyled:e.unstyled,pt:e.ptm("pcMessages")},{default:b(function(){return[T(B(s),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),F(u,d({label:i.chooseButtonLabel,class:i.chooseButtonClass,style:e.style,disabled:e.disabled,unstyled:e.unstyled,onMouseup:i.onBasicUploaderClick,onKeydown:V(i.choose,["enter"]),onFocus:i.onFocus,onBlur:i.onBlur},e.ptm("pcButton")),{icon:b(function(s){return[C(e.$slots,"chooseicon",{},function(){return[(o(),h(S(e.chooseIcon?"span":"PlusIcon"),d({class:[s.class,e.chooseIcon],"aria-hidden":"true"},e.ptm("pcButton").icon),null,16,["class"]))]})]}),_:3},16,["label","class","style","disabled","unstyled","onMouseup","onKeydown","onFocus","onBlur"]),e.auto?v("",!0):C(e.$slots,"filelabel",{key:0,class:L(e.cx("filelabel"))},function(){return[g("span",{class:L(e.cx("filelabel")),files:n.files},B(i.basicFileChosenLabel),11,be)]}),g("input",d({ref:"fileInput",type:"file",accept:e.accept,disabled:e.disabled,multiple:e.multiple,onChange:l[5]||(l[5]=function(){return i.onFileSelect&&i.onFileSelect.apply(i,arguments)}),onFocus:l[6]||(l[6]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onBlur:l[7]||(l[7]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)})},e.ptm("input")),null,16,Ce)],16)):v("",!0)}Z.render=Fe;const Be=e=>(le("data-v-8a644299"),e=e(),te(),e),Ie={class:"flex gap-4"},Le={key:0,class:"flex gap-3 px-4 pb-4"},Se={key:0},we={key:0,class:"flex gap-2"},ke={key:1},Ee={key:1,class:"flex gap-1 items-center"},Te=Be(()=>g("span",null,"已选文件：",-1)),Me={__name:"TInputFile",props:["name","multiple"],emits:["change"],setup(e,{expose:l,emit:t}){const a=e,n=t,i=s=>{n("change",s.files),c(s.files)},u=(s,y)=>{y(s)},r=(s,y)=>{if(y(s),s.files!=null)n("change",s.files),c(s.files);else{const m=new DataTransfer().files;n("change",m),c(m)}},p=_("postFormData"),c=s=>{if(p!=null&&typeof p=="object"){let y=a.name;typeof y!="string"&&(y="file"),p[y]=s}};return l({get files(){let s=a.name;return typeof s!="string"&&(s="file"),typeof p[s]==null?[]:p[s]}}),(s,y)=>(o(),h(ee(Z),{mode:"advanced",onSelect:i,multiple:e.multiple,customUpload:!0,pt:{input:{name:e.name}}},{header:b(({files:m,chooseCallback:M,clearCallback:G})=>[g("div",Ie,[F(N,{secondary:"",icon:"pi pi-plus",onClick:D=>u(D,M),label:"选择文件",disabled:!e.multiple&&m.length>=1,size:"small"},null,8,["onClick","disabled"]),m.length>0?(o(),h(N,{key:0,secondary:"",icon:"pi pi-times",severity:"secondary",onClick:D=>r(D,G),size:"small"},null,8,["onClick"])):v("",!0)])]),content:b(({files:m})=>[m.length>0?(o(),f("div",Le,[e.multiple?(o(),f("div",Se,[m.length<3?(o(),f("div",we,[(o(!0),f(E,null,k(m,M=>(o(),h(P,{size:"small"},{default:b(()=>[T(B(M.name),1)]),_:2},1024))),256))])):(o(),f("div",ke," 已选择"+B(m.length)+"个文件 ",1))])):v("",!0),e.multiple?v("",!0):(o(),f("div",Ee,[Te,F(P,{size:"small"},{default:b(()=>[T(B(m[m.length-1].name),1)]),_:2},1024)]))])):v("",!0)]),_:1},8,["multiple","pt"]))}},Re=x(Me,[["__scopeId","data-v-8a644299"]]);export{Re as T};
