import{j as o,T as Xt,S as on,F as Pe,R as Qe,B as et,C as an,I as sn,P as ln,M as cn,a as un,b as mn,c as fn}from"./semi-ui-C-ZN869V.js";import{r as O}from"./react-core-C8o2IdY8.js";import{az as pn,ay as dn,aL as Pt,A as jt,s as ge,aM as hn}from"./index-BsqrNJOy.js";import{u as gn}from"./i18n-DJWjvQyM.js";import{D as _n}from"./DistributorApplyFileUpload-BWY7FRiB.js";import"./tools-qobPTha0.js";import"./react-components-KaTRN41W.js";/*! @license DOMPurify 3.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.0/LICENSE */const{entries:qt,setPrototypeOf:Ut,isFrozen:Tn,getPrototypeOf:En,getOwnPropertyDescriptor:xn}=Object;let{freeze:N,seal:L,create:be}=Object,{apply:mt,construct:ft}=typeof Reflect<"u"&&Reflect;N||(N=function(r){return r});L||(L=function(r){return r});mt||(mt=function(r,l){for(var s=arguments.length,u=new Array(s>2?s-2:0),T=2;T1?l-1:0),u=1;u1?l-1:0),u=1;u2&&arguments[2]!==void 0?arguments[2]:Ue;Ut&&Ut(n,null);let s=r.length;for(;s--;){let u=r[s];if(typeof u=="string"){const T=l(u);T!==u&&(Tn(r)||(r[s]=T),u=T)}n[u]=!0}return n}function Nn(n){for(let r=0;r/gm),Ln=L(/\$\{[\w\W]*/gm),Cn=L(/^data-[\-\w.\u00B7-\uFFFF]+$/),In=L(/^aria-[\-\w]+$/),Vt=L(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Mn=L(/^(?:\w+script|data):/i),kn=L(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$t=L(/^html$/i),Pn=L(/^[a-z][.\w]*(-[.\w]+)+$/i);var Wt=Object.freeze({__proto__:null,ARIA_ATTR:In,ATTR_WHITESPACE:kn,CUSTOM_ELEMENT:Pn,DATA_ATTR:Cn,DOCTYPE_NAME:$t,ERB_EXPR:On,IS_ALLOWED_URI:Vt,IS_SCRIPT_OR_DATA:Mn,MUSTACHE_EXPR:Dn,TMPLIT_EXPR:Ln});const Ae={element:1,text:3,progressingInstruction:7,comment:8,document:9},jn=function(){return typeof window>"u"?null:window},Un=function(r,l){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let s=null;const u="data-tt-policy-suffix";l&&l.hasAttribute(u)&&(s=l.getAttribute(u));const T="dompurify"+(s?"#"+s:"");try{return r.createPolicy(T,{createHTML(H){return H},createScriptURL(H){return H}})}catch{return console.warn("TrustedTypes policy "+T+" could not be created."),null}},Yt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kt(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jn();const r=a=>Kt(a);if(r.version="3.4.0",r.removed=[],!n||!n.document||n.document.nodeType!==Ae.document||!n.Element)return r.isSupported=!1,r;let{document:l}=n;const s=l,u=s.currentScript,{DocumentFragment:T,HTMLTemplateElement:H,Node:ne,Element:m,NodeFilter:Y,NamedNodeMap:ce=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:we,DOMParser:X,trustedTypes:z}=n,k=m.prototype,Se=xe(k,"cloneNode"),ue=xe(k,"remove"),Ne=xe(k,"nextSibling"),Re=xe(k,"childNodes"),q=xe(k,"parentNode");if(typeof H=="function"){const a=l.createElement("template");a.content&&a.content.ownerDocument&&(l=a.content.ownerDocument)}let E,G="";const{implementation:V,createNodeIterator:Fe,createDocumentFragment:me,getElementsByTagName:ve}=l,{importNode:He}=s;let x=Yt();r.isSupported=typeof qt=="function"&&typeof q=="function"&&V&&V.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:re,ERB_EXPR:$,TMPLIT_EXPR:K,DATA_ATTR:p,ARIA_ATTR:w,IS_SCRIPT_OR_DATA:Z,ATTR_WHITESPACE:C,CUSTOM_ELEMENT:J}=Wt;let{IS_ALLOWED_URI:pt}=Wt,_=null;const dt=c({},[...Ht,...rt,...ot,...it,...zt]);let A=null;const ht=c({},[...Gt,...at,...Bt,...je]);let d=Object.seal(be(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,De=null;const B=Object.seal(be(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let gt=!0,ze=!0,_t=!1,Tt=!0,Q=!1,pe=!0,ee=!1,Ge=!1,Be=!1,oe=!1,Oe=!1,Le=!1,Et=!0,xt=!1;const Zt="user-content-";let We=!0,de=!1,ie={},P=null;const Ye=c({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let At=null;const bt=c({},["audio","video","img","source","image","track"]);let Xe=null;const yt=c({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ce="http://www.w3.org/1998/Math/MathML",Ie="http://www.w3.org/2000/svg",j="http://www.w3.org/1999/xhtml";let ae=j,qe=!1,Ve=null;const Jt=c({},[Ce,Ie,j],tt);let Me=c({},["mi","mo","mn","ms","mtext"]),ke=c({},["annotation-xml"]);const Qt=c({},["title","style","font","a","script"]);let he=null;const en=["application/xhtml+xml","text/html"],tn="text/html";let g=null,se=null;const nn=l.createElement("form"),wt=function(e){return e instanceof RegExp||e instanceof Function},$e=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(se&&se===e)){if((!e||typeof e!="object")&&(e={}),e=U(e),he=en.indexOf(e.PARSER_MEDIA_TYPE)===-1?tn:e.PARSER_MEDIA_TYPE,g=he==="application/xhtml+xml"?tt:Ue,_=M(e,"ALLOWED_TAGS")?c({},e.ALLOWED_TAGS,g):dt,A=M(e,"ALLOWED_ATTR")?c({},e.ALLOWED_ATTR,g):ht,Ve=M(e,"ALLOWED_NAMESPACES")?c({},e.ALLOWED_NAMESPACES,tt):Jt,Xe=M(e,"ADD_URI_SAFE_ATTR")?c(U(yt),e.ADD_URI_SAFE_ATTR,g):yt,At=M(e,"ADD_DATA_URI_TAGS")?c(U(bt),e.ADD_DATA_URI_TAGS,g):bt,P=M(e,"FORBID_CONTENTS")?c({},e.FORBID_CONTENTS,g):Ye,fe=M(e,"FORBID_TAGS")?c({},e.FORBID_TAGS,g):U({}),De=M(e,"FORBID_ATTR")?c({},e.FORBID_ATTR,g):U({}),ie=M(e,"USE_PROFILES")?e.USE_PROFILES:!1,gt=e.ALLOW_ARIA_ATTR!==!1,ze=e.ALLOW_DATA_ATTR!==!1,_t=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Tt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=e.SAFE_FOR_TEMPLATES||!1,pe=e.SAFE_FOR_XML!==!1,ee=e.WHOLE_DOCUMENT||!1,oe=e.RETURN_DOM||!1,Oe=e.RETURN_DOM_FRAGMENT||!1,Le=e.RETURN_TRUSTED_TYPE||!1,Be=e.FORCE_BODY||!1,Et=e.SANITIZE_DOM!==!1,xt=e.SANITIZE_NAMED_PROPS||!1,We=e.KEEP_CONTENT!==!1,de=e.IN_PLACE||!1,pt=e.ALLOWED_URI_REGEXP||Vt,ae=e.NAMESPACE||j,Me=e.MATHML_TEXT_INTEGRATION_POINTS||Me,ke=e.HTML_INTEGRATION_POINTS||ke,d=e.CUSTOM_ELEMENT_HANDLING||be(null),e.CUSTOM_ELEMENT_HANDLING&&wt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(d.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&wt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(d.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(d.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Q&&(ze=!1),Oe&&(oe=!0),ie&&(_=c({},zt),A=be(null),ie.html===!0&&(c(_,Ht),c(A,Gt)),ie.svg===!0&&(c(_,rt),c(A,at),c(A,je)),ie.svgFilters===!0&&(c(_,ot),c(A,at),c(A,je)),ie.mathMl===!0&&(c(_,it),c(A,Bt),c(A,je))),B.tagCheck=null,B.attributeCheck=null,e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?B.tagCheck=e.ADD_TAGS:(_===dt&&(_=U(_)),c(_,e.ADD_TAGS,g))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?B.attributeCheck=e.ADD_ATTR:(A===ht&&(A=U(A)),c(A,e.ADD_ATTR,g))),e.ADD_URI_SAFE_ATTR&&c(Xe,e.ADD_URI_SAFE_ATTR,g),e.FORBID_CONTENTS&&(P===Ye&&(P=U(P)),c(P,e.FORBID_CONTENTS,g)),e.ADD_FORBID_CONTENTS&&(P===Ye&&(P=U(P)),c(P,e.ADD_FORBID_CONTENTS,g)),We&&(_["#text"]=!0),ee&&c(_,["html","head","body"]),_.table&&(c(_,["tbody"]),delete fe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ee('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ee('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=e.TRUSTED_TYPES_POLICY,G=E.createHTML("")}else E===void 0&&(E=Un(z,u)),E!==null&&typeof G=="string"&&(G=E.createHTML(""));N&&N(e),se=e}},St=c({},[...rt,...ot,...Rn]),Nt=c({},[...it,...vn]),rn=function(e){let t=q(e);(!t||!t.tagName)&&(t={namespaceURI:ae,tagName:"template"});const i=Ue(e.tagName),f=Ue(t.tagName);return Ve[e.namespaceURI]?e.namespaceURI===Ie?t.namespaceURI===j?i==="svg":t.namespaceURI===Ce?i==="svg"&&(f==="annotation-xml"||Me[f]):!!St[i]:e.namespaceURI===Ce?t.namespaceURI===j?i==="math":t.namespaceURI===Ie?i==="math"&&ke[f]:!!Nt[i]:e.namespaceURI===j?t.namespaceURI===Ie&&!ke[f]||t.namespaceURI===Ce&&!Me[f]?!1:!Nt[i]&&(Qt[i]||!St[i]):!!(he==="application/xhtml+xml"&&Ve[e.namespaceURI]):!1},I=function(e){Te(r.removed,{element:e});try{q(e).removeChild(e)}catch{ue(e)}},te=function(e,t){try{Te(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch{Te(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(oe||Oe)try{I(t)}catch{}else try{t.setAttribute(e,"")}catch{}},Rt=function(e){let t=null,i=null;if(Be)e=""+e;else{const h=nt(e,/^[\r\n\t ]+/);i=h&&h[0]}he==="application/xhtml+xml"&&ae===j&&(e=''+e+"");const f=E?E.createHTML(e):e;if(ae===j)try{t=new X().parseFromString(f,he)}catch{}if(!t||!t.documentElement){t=V.createDocument(ae,"template",null);try{t.documentElement.innerHTML=qe?G:f}catch{}}const y=t.body||t.documentElement;return e&&i&&y.insertBefore(l.createTextNode(i),y.childNodes[0]||null),ae===j?ve.call(t,ee?"html":"body")[0]:ee?t.documentElement:y},vt=function(e){return Fe.call(e.ownerDocument||e,e,Y.SHOW_ELEMENT|Y.SHOW_COMMENT|Y.SHOW_TEXT|Y.SHOW_PROCESSING_INSTRUCTION|Y.SHOW_CDATA_SECTION,null)},Ke=function(e){return e instanceof we&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof ce)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Ze=function(e){return typeof ne=="function"&&e instanceof ne};function F(a,e,t){_e(a,i=>{i.call(r,e,t,se)})}const Dt=function(e){let t=null;if(F(x.beforeSanitizeElements,e,null),Ke(e))return I(e),!0;const i=g(e.nodeName);if(F(x.uponSanitizeElement,e,{tagName:i,allowedTags:_}),pe&&e.hasChildNodes()&&!Ze(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent)||pe&&e.namespaceURI===j&&i==="style"&&Ze(e.firstElementChild)||e.nodeType===Ae.progressingInstruction||pe&&e.nodeType===Ae.comment&&S(/<[/\w]/g,e.data))return I(e),!0;if(fe[i]||!(B.tagCheck instanceof Function&&B.tagCheck(i))&&!_[i]){if(!fe[i]&&Lt(i)&&(d.tagNameCheck instanceof RegExp&&S(d.tagNameCheck,i)||d.tagNameCheck instanceof Function&&d.tagNameCheck(i)))return!1;if(We&&!P[i]){const f=q(e)||e.parentNode,y=Re(e)||e.childNodes;if(y&&f){const h=y.length;for(let v=h-1;v>=0;--v){const D=Se(y[v],!0);D.__removalCount=(e.__removalCount||0)+1,f.insertBefore(D,Ne(e))}}}return I(e),!0}return e instanceof m&&!rn(e)||(i==="noscript"||i==="noembed"||i==="noframes")&&S(/<\/no(script|embed|frames)/i,e.innerHTML)?(I(e),!0):(Q&&e.nodeType===Ae.text&&(t=e.textContent,_e([re,$,K],f=>{t=le(t,f," ")}),e.textContent!==t&&(Te(r.removed,{element:e.cloneNode()}),e.textContent=t)),F(x.afterSanitizeElements,e,null),!1)},Ot=function(e,t,i){if(De[t]||Et&&(t==="id"||t==="name")&&(i in l||i in nn))return!1;if(!(ze&&!De[t]&&S(p,t))){if(!(gt&&S(w,t))){if(!(B.attributeCheck instanceof Function&&B.attributeCheck(t,e))){if(!A[t]||De[t]){if(!(Lt(e)&&(d.tagNameCheck instanceof RegExp&&S(d.tagNameCheck,e)||d.tagNameCheck instanceof Function&&d.tagNameCheck(e))&&(d.attributeNameCheck instanceof RegExp&&S(d.attributeNameCheck,t)||d.attributeNameCheck instanceof Function&&d.attributeNameCheck(t,e))||t==="is"&&d.allowCustomizedBuiltInElements&&(d.tagNameCheck instanceof RegExp&&S(d.tagNameCheck,i)||d.tagNameCheck instanceof Function&&d.tagNameCheck(i))))return!1}else if(!Xe[t]){if(!S(pt,le(i,C,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&yn(i,"data:")===0&&At[e])){if(!(_t&&!S(Z,le(i,C,"")))){if(i)return!1}}}}}}}return!0},Lt=function(e){return e!=="annotation-xml"&&nt(e,J)},Ct=function(e){F(x.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Ke(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let f=t.length;for(;f--;){const y=t[f],{name:h,namespaceURI:v,value:D}=y,W=g(h),Je=D;let b=h==="value"?Je:wn(Je);if(i.attrName=W,i.attrValue=b,i.keepAttr=!0,i.forceKeepAttr=void 0,F(x.uponSanitizeAttribute,e,i),b=i.attrValue,xt&&(W==="id"||W==="name")&&(te(h,e),b=Zt+b),pe&&S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,b)){te(h,e);continue}if(W==="attributename"&&nt(b,"href")){te(h,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){te(h,e);continue}if(!Tt&&S(/\/>/i,b)){te(h,e);continue}Q&&_e([re,$,K],kt=>{b=le(b,kt," ")});const Mt=g(e.nodeName);if(!Ot(Mt,W,b)){te(h,e);continue}if(E&&typeof z=="object"&&typeof z.getAttributeType=="function"&&!v)switch(z.getAttributeType(Mt,W)){case"TrustedHTML":{b=E.createHTML(b);break}case"TrustedScriptURL":{b=E.createScriptURL(b);break}}if(b!==Je)try{v?e.setAttributeNS(v,h,b):e.setAttribute(h,b),Ke(e)?I(e):Ft(r.removed)}catch{te(h,e)}}F(x.afterSanitizeAttributes,e,null)},It=function(e){let t=null;const i=vt(e);for(F(x.beforeSanitizeShadowDOM,e,null);t=i.nextNode();)F(x.uponSanitizeShadowNode,t,null),Dt(t),Ct(t),t.content instanceof T&&It(t.content);F(x.afterSanitizeShadowDOM,e,null)};return r.sanitize=function(a){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,i=null,f=null,y=null;if(qe=!a,qe&&(a=""),typeof a!="string"&&!Ze(a))if(typeof a.toString=="function"){if(a=a.toString(),typeof a!="string")throw Ee("dirty is not a string, aborting")}else throw Ee("toString is not a function");if(!r.isSupported)return a;if(Ge||$e(e),r.removed=[],typeof a=="string"&&(de=!1),de){if(a.nodeName){const D=g(a.nodeName);if(!_[D]||fe[D])throw Ee("root node is forbidden and cannot be sanitized in-place")}}else if(a instanceof ne)t=Rt(""),i=t.ownerDocument.importNode(a,!0),i.nodeType===Ae.element&&i.nodeName==="BODY"||i.nodeName==="HTML"?t=i:t.appendChild(i);else{if(!oe&&!Q&&!ee&&a.indexOf("<")===-1)return E&&Le?E.createHTML(a):a;if(t=Rt(a),!t)return oe?null:Le?G:""}t&&Be&&I(t.firstChild);const h=vt(de?a:t);for(;f=h.nextNode();)Dt(f),Ct(f),f.content instanceof T&&It(f.content);if(de)return a;if(oe){if(Q){t.normalize();let D=t.innerHTML;_e([re,$,K],W=>{D=le(D,W," ")}),t.innerHTML=D}if(Oe)for(y=me.call(t.ownerDocument);t.firstChild;)y.appendChild(t.firstChild);else y=t;return(A.shadowroot||A.shadowrootmode)&&(y=He.call(s,y,!0)),y}let v=ee?t.outerHTML:t.innerHTML;return ee&&_["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&S($t,t.ownerDocument.doctype.name)&&(v=" `+v),Q&&_e([re,$,K],D=>{v=le(v,D," ")}),E&&Le?E.createHTML(v):v},r.setConfig=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$e(a),Ge=!0},r.clearConfig=function(){se=null,Ge=!1},r.isValidAttribute=function(a,e,t){se||$e({});const i=g(a),f=g(e);return Ot(i,f,t)},r.addHook=function(a,e){typeof e=="function"&&Te(x[a],e)},r.removeHook=function(a,e){if(e!==void 0){const t=An(x[a],e);return t===-1?void 0:bn(x[a],t,1)[0]}return Ft(x[a])},r.removeHooks=function(a){x[a]=[]},r.removeAllHooks=function(){x=Yt()},r}var Fn=Kt();const{Text:ye}=Xt;function st({children:n,className:r=""}){return o.jsxs(ye,{strong:!0,className:`text-[var(--semi-color-text-0)] ${r}`.trim(),children:[o.jsx("span",{className:"text-[var(--semi-color-danger)] mr-1 font-normal","aria-hidden":!0,children:"*"}),n]})}const lt=n=>({validator:(r,l)=>(l==null?"":String(l).trim())?Promise.resolve():Promise.reject(n("必填"))}),ct=22;function ut({variant:n="info",title:r,className:l="",children:s}){const u=n==="danger"?{frame:"border-[var(--semi-color-danger-light-hover)] bg-[var(--semi-color-danger-light-default)]",icon:o.jsx(un,{size:ct,style:{color:"var(--semi-color-danger)"}})}:n==="success"?{frame:"border-[var(--semi-color-success-light-hover)] bg-[var(--semi-color-success-light-default)]",icon:o.jsx(mn,{size:ct,style:{color:"var(--semi-color-success)"}})}:{frame:"border-[var(--semi-color-info-light-hover)] bg-[var(--semi-color-info-light-default)]",icon:o.jsx(fn,{size:ct,style:{color:"var(--semi-color-primary)"}})};return o.jsxs("div",{role:n==="danger"?"alert":"status",className:["distributor-apply-notice flex gap-3 rounded-2xl border border-solid p-3.5 shadow-sm md:p-4",u.frame,l].filter(Boolean).join(" "),children:[o.jsx("span",{className:"shrink-0 pt-0.5","aria-hidden":!0,children:u.icon}),o.jsxs("div",{className:"min-w-0 flex-1 text-[15px] leading-relaxed [overflow-wrap:anywhere] text-[var(--semi-color-text-0)]",children:[r?o.jsx("div",{className:"mb-1.5 font-semibold text-[var(--semi-color-text-0)]",children:r}):null,s]})]})}function qn(){var $,K;const{t:n}=gn(),r=O.useRef(null),[l]=O.useContext(pn),[s]=O.useContext(dn),[u,T]=O.useState(!0),[H,ne]=O.useState(!1),[m,Y]=O.useState(null),[ce,we]=O.useState([]),[X,z]=O.useState(null),[k,Se]=O.useState(1),ue=((($=l==null?void 0:l.status)==null?void 0:$.distributor_apply_cs_image_url)||"").trim(),Ne=!!ue,Re=(((K=l==null?void 0:l.status)==null?void 0:K.distributor_apply_intro_html)||"").trim(),q=Re?Fn.sanitize(Re,{USE_PROFILES:{html:!0}}):"",E=p=>/\.pdf(\?|$)/i.test(p||""),G=async()=>{T(!0);try{const p=await jt.get("/api/distributor/my_application"),{success:w,message:Z,data:C}=p.data;if(!w){ge(Z);return}Y(C||null)}catch{ge(n("加载失败"))}finally{T(!1)}};O.useEffect(()=>{G()},[]);const V=O.useMemo(()=>{const p=s==null?void 0:s.user;if(p)return Pt(p);try{const w=localStorage.getItem("user");if(w)return Pt(JSON.parse(w))}catch{}return!1},[s==null?void 0:s.user]),Fe=(m==null?void 0:m.status)===2&&V,me=(m==null?void 0:m.status)===2&&!V,ve=me||(m==null?void 0:m.status)===3;O.useEffect(()=>{if(!ve||!m||u)return;const p=window.setTimeout(()=>{var w;try{(w=r.current)==null||w.setValues({real_name:m.real_name||"",id_card_no:m.id_card_no||"",contact:m.contact||""});const Z=Number(m.apply_type);Se(Z===2?2:1);const C=m.qualification_urls;if(C){const J=typeof C=="string"?JSON.parse(C):C;Array.isArray(J)&&J.length&&we(J.filter(Boolean))}}catch{}},0);return()=>window.clearTimeout(p)},[ve,m,u]);const He=async()=>{const p=r.current;if(!p)return;try{await p.validate()}catch{return}const w=p.getValues();if(!ce.length){ge(n("请上传资格证书"));return}ne(!0);try{const Z=await jt.post("/api/distributor/application",{apply_type:k,real_name:w.real_name,id_card_no:w.id_card_no,contact:w.contact,qualification_urls:ce}),{success:C,message:J}=Z.data;C?(hn(n("提交成功")),await G()):ge(J)}catch{ge(n("提交失败"))}finally{ne(!1)}};if(V)return o.jsx("div",{className:"distributor-apply-page-root",children:o.jsx("div",{className:"w-full max-w-3xl px-1",children:o.jsx(ut,{variant:"success",className:"w-full",children:n("您已是代理,无需再次申请")})})});const x=Ne?o.jsx("div",{className:"distributor-apply-cs-popover w-[min(100vw-3rem,260px)] max-w-[260px] p-1",children:o.jsx("button",{type:"button",className:"w-full cursor-zoom-in rounded-lg border-0 bg-transparent p-0",onClick:()=>z(ue),children:o.jsx("img",{src:ue,alt:"",className:"h-auto w-full max-w-full rounded-md object-contain"})})}):null,re=(m==null?void 0:m.status)===1?o.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center py-8 text-center",children:o.jsx(ye,{className:"!text-lg md:!text-xl !leading-relaxed !font-medium text-[var(--semi-color-text-0)]",children:n("您的申请正在审核中,请耐心等待。")})}):Fe?o.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center py-8 text-center",children:o.jsx(ye,{className:"!text-lg md:!text-xl !leading-relaxed !font-medium text-[var(--semi-color-text-0)]",children:n("申请已通过,请从侧栏进入「代理分销」。")})}):o.jsxs(on,{spinning:u,className:"w-full min-w-0",children:[(m==null?void 0:m.status)===3?o.jsx(ut,{variant:"danger",className:"mb-4 shrink-0",title:n("申请已被驳回"),children:m!=null&&m.reject_reason?o.jsx("div",{className:"whitespace-pre-wrap font-normal",style:{lineHeight:1.6},children:m.reject_reason}):o.jsx("div",{className:"font-normal",children:n("请根据管理员说明修改资料后重新提交。")})}):null,me?o.jsx(ut,{variant:"info",className:"mb-4 shrink-0",children:n("您的代理资格已失效(例如已被管理员调整),可修改资料后重新提交审核。")}):null,o.jsxs(Pe,{getFormApi:p=>r.current=p,layout:"vertical",children:[o.jsxs("div",{className:"mb-4",children:[o.jsx(ye,{strong:!0,className:"mb-2 block",children:n("申请类型")}),o.jsxs(Qe.Group,{type:"button",value:k,onChange:p=>{const w=p&&typeof p=="object"&&"target"in p?p.target.value:p;Se(Number(w))},children:[o.jsx(Qe,{value:1,children:n("个人申请")}),o.jsx(Qe,{value:2,children:n("企业申请")})]})]}),o.jsx(Pe.Input,{field:"real_name",label:o.jsx(st,{children:n(k===2?"企业名称":"姓名")}),rules:[lt(n)]}),o.jsx(Pe.Input,{field:"id_card_no",label:o.jsx(st,{children:n(k===2?"统一社会信用代码":"身份证")}),rules:[lt(n)]}),o.jsx(Pe.Input,{field:"contact",label:o.jsx(st,{children:n("联系方式")}),rules:[lt(n)]}),o.jsx(_n,{label:n("资格证书"),required:!0,urls:ce,onUrlsChange:we,maxCount:5,multiple:!0,onPreview:z,hint:n("支持图片或 PDF,最多 5 个;点击图片可大图预览")}),o.jsx("div",{className:"flex justify-center pt-1",children:o.jsx(et,{theme:"solid",type:"primary",loading:H,onClick:He,children:n(me?"重新提交审核":"提交申请")})})]})]});return o.jsxs("div",{className:"distributor-apply-page-root",children:[o.jsx("div",{className:"mx-auto flex h-full min-h-0 w-full min-w-0 max-w-6xl flex-1 flex-col",children:o.jsx(an,{className:"distributor-apply-main-card !rounded-2xl flex h-full min-h-0 w-full min-w-0 flex-1 flex-col !overflow-hidden !shadow-none",children:o.jsxs("div",{className:"distributor-apply-card-stacked-scroll flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-y-contain lg:flex-row lg:overflow-hidden",children:[o.jsxs("section",{className:"distributor-apply-panels-divider flex min-w-0 max-lg:shrink-0 flex-col border-b border-solid lg:min-h-0 lg:min-w-0 lg:flex-[3] lg:border-b-0 lg:border-r",children:[o.jsx("div",{className:"shrink-0 p-4 pb-2 md:px-5 md:pt-5",children:o.jsxs("header",{className:"distributor-apply-hero relative rounded-xl p-[12px]",children:[o.jsx("span",{className:"distributor-apply-hero-orb distributor-apply-hero-orb--a","aria-hidden":!0}),o.jsx("span",{className:"distributor-apply-hero-orb distributor-apply-hero-orb--b","aria-hidden":!0}),o.jsx("div",{className:"relative z-[1] min-w-0",children:o.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-2 sm:gap-3",children:[o.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[o.jsx("div",{className:"distributor-apply-hero-icon flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl border border-solid bg-[var(--semi-color-bg-0)] text-[var(--semi-color-primary)] shadow-sm","aria-hidden":!0,children:o.jsx(sn,{size:28})}),o.jsx(Xt.Title,{heading:3,className:"distributor-apply-hero-title !mb-0 !mt-0 min-w-0 !font-semibold !tracking-tight !leading-snug sm:!leading-tight",children:n("代理伙伴招募")})]}),Ne?o.jsx(ln,{content:x,trigger:"click",position:"leftTop",showArrow:!0,children:o.jsx(et,{theme:"outline",type:"primary",size:"small",className:"shrink-0 !font-medium",children:n("联系客服")})}):null]})})]})}),o.jsxs("div",{className:"distributor-apply-intro-scroll min-w-0 px-4 pb-4 pt-0 md:px-5 md:pb-5 max-lg:overflow-visible lg:min-h-0 lg:flex-1 lg:overflow-y-auto lg:overflow-x-hidden lg:overscroll-y-contain",children:[q?o.jsx("div",{className:"distributor-apply-intro-html max-w-full break-words text-[15px] leading-relaxed text-[var(--semi-color-text-0)] [overflow-wrap:anywhere] [&_p]:mb-2 [&_p]:last:mb-0 [&_img]:!max-w-full [&_img]:h-auto [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:!max-w-full [&_table]:table-fixed [&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_a]:break-all [&_a]:text-[var(--semi-color-primary)] [&_blockquote]:border-l-2 [&_blockquote]:border-[var(--semi-color-border)] [&_blockquote]:pl-3",dangerouslySetInnerHTML:{__html:q}}):null,o.jsx(ye,{type:"tertiary",className:"distributor-apply-hero-desc mt-2 !block !text-[15px] !leading-relaxed [overflow-wrap:anywhere]",children:n("请如实填写以下信息,审核通过后即可获得代理资格与邀请分成。")})]})]}),o.jsx("section",{className:"flex min-w-0 max-lg:shrink-0 flex-col p-4 md:p-5 max-lg:overflow-visible lg:min-h-0 lg:min-w-0 lg:flex-[2] lg:overflow-y-auto lg:overscroll-y-contain [scrollbar-gutter:stable]",children:re})]})})}),o.jsx(cn,{title:n("预览"),visible:!!X,onCancel:()=>z(null),footer:null,width:Math.min(960,typeof window<"u"?window.innerWidth-48:960),children:X&&(E(X)?o.jsx("div",{className:"py-6 text-center",children:o.jsx(et,{type:"primary",onClick:()=>window.open(X,"_blank","noopener,noreferrer"),children:n("在新窗口打开 PDF")})}):o.jsx("div",{className:"flex max-h-[85vh] justify-center overflow-auto p-2",children:o.jsx("img",{src:X,alt:"",className:"max-h-[85vh] max-w-full object-contain"})}))})]})}export{qn as default};