PageSourceSearch

https://lawbot.ai/assets/index-CWniH-hy.js

js lawbot.ai collected 2026-10-05 12:09:30 UTC 1,823,219 bytes, 725 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-mYa3_IoY.js","assets/vendor-react-C9TCey48.js","assets/vendor-router-B-uqPwnK.js","assets/vendor-utils-cDDyoLF9.js","assets/route.tsx-B751tQim.js","assets/index-BtObsjjt.js","assets/footer-BdOrTtCO.js","assets/fbpixel-hIqBSdQM.js","assets/WebsiteNavbar-C2igNoc4.js","assets/chevron-down-CTVJmiV_.js","assets/settings-8ylnBtUW.js","assets/log-out-BkHW63h2.js","assets/index.tsx-CgGivGLQ.js","assets/route.tsx-CR4OGnrw.js","assets/Loading-B5riM1cH.js","assets/loader-CfjlC1BQ.js","assets/search-dGqE8dG-.js","assets/arrow-up-right-CzQ7sfuT.js","assets/mail-Dc6dZWtf.js","assets/calendar-tM23bAJ5.js","assets/clock-uxhIOrmc.js","assets/index-CBX24K0E.js","assets/colors-BeVyg7uU.js","assets/assistant.tsx-CVYFPf4l.js","assets/ChatContext-44hJp7ti.js","assets/send-VUiCbF7z.js","assets/calls.tsx-BqhO8kZZ.js","assets/CallsPage-BAGdGA7e.js","assets/routingLines-D0lwF7lL.js","assets/chevron-left-BcIgS7-S.js","assets/phone-incoming-Bm-8k2mb.js","assets/route.tsx-B-vIi1rU.js","assets/addContact-DLUidFVu.js","assets/contact-XTKbzjlp.js","assets/star-CCgFTL5v.js","assets/inbox.tsx-SGjXWXqJ.js","assets/route.tsx-Cg4v1n96.js","assets/users-round-DtVUwXxQ.js","assets/numbers.tsx-CJioXs0p.js","assets/triangle-alert-CFxm1iMz.js","assets/circle-alert-BPgFTvTj.js","assets/payments.tsx-DPT6ReST.js","assets/index-DwaAicpo.js","assets/index-DAKo_VG4.js","assets/index-pBb5g1SN.js","assets/index-C2v7yxXw.js","assets/index-BJokQeFa.js","assets/index-CS1dce81.js","assets/Pagination-DHCBiFtD.js","assets/useBreakpoint-m-i75v2Q.js","assets/useForceUpdate-CZkzF2v_.js","assets/index-BQV_sPfo.js","assets/roundedArrow-DJnRWUOe.js","assets/collapse-BbEVqHco.js","assets/useForm-UN5MDij4.js","assets/index-BWrNg5-A.js","assets/credit-card-CL0T4Ig6.js","assets/pencil-DpT_QeeV.js","assets/index-CZ5KHqWN.js","assets/index-7oAzxviH.js","assets/index--TXF_tRJ.js","assets/wallet-BreaN111.js","assets/row-DciRvgjK.js","assets/circle-check-big-j3_xbnq5.js","assets/external-link-BxdY0Z7N.js","assets/reports.tsx-CzvQh0lH.js","assets/settings.tsx-B4P0QuA6.js","assets/SectionTitle-YeNKfq0h.js","assets/users-qI-wl5xk.js","assets/index-BiRY_XpX.js","assets/save-CuDu-R9E.js","assets/eye-RJxAkw7C.js","assets/pen-C6WNXW58.js","assets/sms.tsx-CChiVx0a.js","assets/SmsPage-oLebmIg0.js","assets/voicebots.tsx-BtM-CUAw.js","assets/sparkles-BuC4hNJK.js","assets/arrow-right-DGkPUpK7.js","assets/index.tsx-CUa0-USN.js","assets/mic-4wJDANga.js","assets/arrow-up-BWn7kWNq.js","assets/index.tsx-Cy3NEnsn.js","assets/google.tsx-DR0eEnPH.js","assets/index.tsx-Div-bbIk.js","assets/index.tsx-5X4yrj3s.js","assets/Tooltip-Dd4skvmk.js","assets/index.tsx-CbmrxKWy.js","assets/index.tsx-BQelfwLZ.js","assets/index.tsx-Dv4sm3mG.js","assets/index.tsx-DW-lS02H.js","assets/index.tsx-isUZesD9.js","assets/index.tsx-DLtymz4B.js","assets/index.tsx-Worjh6TH.js","assets/index.tsx-B65TaKuZ.js","assets/index.tsx-CvU4ZRd1.js","assets/googleAds-DiAJdcWn.js","assets/index.tsx-Cl4waMsb.js","assets/index.tsx-Bs_rUNm2.js","assets/route.tsx-BkpvDIUM.js","assets/CallModal-DOv0Oq96.js","assets/square-check-big-C5Tb4cX-.js","assets/wrench-DxFC-ubh.js","assets/book-open-BNj3ksrs.js","assets/index.tsx-ClfxTgfp.js","assets/$chat_id.tsx-CAZ2cGNO.js","assets/ChatView-C2tTdaaS.js","assets/circle-x-lyK9Ua4Q.js","assets/refresh-cw-CVRlW2sw.js","assets/history-DX8_iwQh.js","assets/index.tsx-DXSX56n8.js","assets/crown-DigQq9bu.js","assets/cancel.tsx-BY2IVQPk.js","assets/subscribed.tsx-CreearB0.js","assets/success.tsx-BpXf70Sc.js","assets/calls_.$chat_id.tsx-DljVPlvG.js","assets/$chat_id.tsx-DllRHUvo.js","assets/index.tsx-DokPAqwI.js","assets/$contact_id.tsx-CcV59xD-.js","assets/index.tsx-BballxYc.js","assets/HyperlinkDialog-HGZ2S37Z-BjpTw8RP.js","assets/upload-ovS2U9TM.js","assets/HyperlinkDialog-HGZ2S37Z-baXt2nJh.css","assets/index.tsx-gyCef0Kr.js","assets/index.tsx-B0ULhiYz.js","assets/UpsertFlowModal-DIb9O1u2.js","assets/useSlugAvailability-DDLLwMYc.js","assets/workflow-Us26mKfk.js","assets/$flow_id.tsx-D9TE8eSU.js","assets/inbox_.$contactId.tsx-CRgWa0z5.js","assets/salesforce.tsx-CZdwdtMv.js","assets/SalesforceMonoIcon-DadBTqSl.js","assets/globe-KtWs_0eg.js","assets/link-2-Cto81pni.js","assets/index.tsx-BqKBiqFV.js","assets/FileDropZone-BE6pkbdW.js","assets/clipboard-p_jSbM-F.js","assets/$knowledgebase_id.tsx-DNJu-dpF.js","assets/index.tsx-CzI048lF.js","assets/$chat_id.tsx-Gtmd5bSn.js","assets/sms_.$contact_id.tsx-BVd2feBV.js","assets/index.tsx-xd4ooMxZ.js","assets/calls.tsx-C6OSwR4S.js","assets/incoming.tsx-BmMtiQfG.js","assets/knowledgebases.tsx-Bwgo9zUt.js","assets/leads.tsx-CXUtJETJ.js","assets/target-DQYfSUOi.js","assets/outgoing.tsx-OIg3kG5U.js","assets/questions.tsx-BHuRc3j_.js","assets/tasks.tsx-D03MOqRU.js","assets/tools.tsx-B_
1ykwJWG.js","assets/voicemail.tsx-CSteXmbr.js","assets/salesforce_.auth.tsx-CWZ2Fy7M.js","assets/route.lazy-VbOa5LhX.js","assets/route-DXhkFSlQ.css"])))=>i.map(i=>d[i]);
2var UR=Object.defineProperty;var VR=(t,e,n)=>e in t?UR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Is=(t,e,n)=>VR(t,typeof e!="symbol"?e+"":e,n);import{r as m,j as N,d as N0,g as p$,R as Te,c as l1,e as gp,f as WR,b as Vf,h as GR}from"./vendor-react-C9TCey48.js";import{g as KR,H as XR,O as YR,h as ut,l as ft,r as Cb,u as m$,i as JR,w as QR,c as ZR,j as eI,R as tI}from"./vendor-router-B-uqPwnK.js";import{d as ms,t as nI,c as rI}from"./vendor-utils-cDDyoLF9.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const iI="modulepreload",sI=function(t){return"/"+t},B2={},dt=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=o(n.map(c=>{if(c=sI(c),c in B2)return;B2[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":iI,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */var Dl;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(Dl||(Dl={}));class _0 extends Error{constructor(e,n,r){super(e),this.message=e,this.code=n,this.data=r}}const oI=t=>{var e,n;return t!=null&&t.androidBridge?"android":!((n=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},aI=t=>{const e=t.CapacitorCustomPlatform||null,n=t.Capacitor||{},r=n.Plugins=n.Plugins||{},i=()=>e!==null?e.name:oI(t),s=()=>i()!=="web",o=u=>{const f=c.get(u);return!!(f!=null&&f.platforms.has(i())||a(u))},a=u=>{var f;return(f=n.PluginHeaders)===null||f===void 0?void 0:f.find(h=>h.name===u)},l=u=>t.console.error(u),c=new Map,d=(u,f={})=>{const h=c.get(u);if(h)return h.proxy;const p=i(),g=a(u);let v;const b=async()=>(!v&&p in f?v=typeof f[p]=="function"?v=await f[p]():v=f[p]:e!==null&&!v&&"web"in f&&(v=typeof f.web=="function"?v=await f.web():v=f.web),v),w=(S,_)=>{var A,$;if(g){const E=g==null?void 0:g.methods.find(I=>_===I.name);if(E)return E.rtype==="promise"?I=>n.nativePromise(u,_.toString(),I):(I,D)=>n.nativeCallback(u,_.toString(),I,D);if(S)return(A=S[_])===null||A===void 0?void 0:A.bind(S)}else{if(S)return($=S[_])===null||$===void 0?void 0:$.bind(S);throw new _0(`"${u}" plugin is not implemented on ${p}`,Dl.Unimplemented)}},C=S=>
2{let _;const A=(...$)=>{const E=b().then(I=>{const D=w(I,S);if(D){const B=D(...$);return _=B==null?void 0:B.remove,B}else throw new _0(`"${u}.${S}()" is not implemented on ${p}`,Dl.Unimplemented)});return S==="addListener"&&(E.remove=async()=>_()),E};return A.toString=()=>`${S.toString()}() { [capacitor code] }`,Object.defineProperty(A,"name",{value:S,writable:!1,configurable:!1}),A},x=C("addListener"),R=C("removeListener"),O=(S,_)=>{const A=x({eventName:S},_),$=async()=>{const I=await A;R({eventName:S,callbackId:I},_)},E=new Promise(I=>A.then(()=>I({remove:$})));return E.remove=async()=>{await $()},E},T=new Proxy({},{get(S,_){switch(_){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return g?O:x;case"removeListener":return R;default:return C(_)}}});return r[u]=T,c.set(u,{name:u,proxy:T,platforms:new Set([...Object.keys(f),...g?[p]:[]])}),T};return n.convertFileSrc||(n.convertFileSrc=u=>u),n.getPlatform=i,n.handleError=l,n.isNativePlatform=s,n.isPluginAvailable=o,n.registerPlugin=d,n.Exception=_0,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},lI=t=>t.Capacitor=aI(t),Wf=lI(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),vp=Wf.registerPlugin;class xb{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,n){let r=!1;this.listeners[e]||(this.listeners[e]=[],r=!0),this.listeners[e].push(n);const s=this.windowListeners[e];s&&!s.registered&&this.addWindowListener(s),r&&this.sendRetainedArgumentsForEvent(e);const o=async()=>this.removeListener(e,n);return Promise.resolve({remove:o})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,n,r){const i=this.listeners[e];if(!i){if(r){let s=this.retainedEventArguments[e];s||(s=[]),s.push(n),this.retainedEventArguments[e]=s}return}i.forEach(s=>s(n))}hasListeners(e){var n;return!!(!((n=this.listeners[e])===null||n===void 0)&&n.length)}registerWindowListener(e,n){this.windowListeners[n]={registered:!1,windowEventName:e,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(e="not implemented"){return new Wf.Exception(e,Dl.Unimplemented)}unavailable(e="not available"){return new Wf.Exception(e,Dl.Unavailable)}async removeListener(e,n){const r=this.listeners[e];if(!r)return;const i=r.indexOf(n);i!==-1&&this.listeners[e].splice(i,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const n=this.retainedEventArguments[e];n&&(delete this.retainedEventArguments[e],n.forEach(r=>{this.notifyListeners(e,r)}))}}const H2=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),z2=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class cI extends xb{async getCookies(){const e=document.cookie,n={};return e.split(";").forEach(r=>{if(r.length<=0)return;let[i,s]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");i=z2(i).trim(),s=z2(s).trim(),n[i]=s}),n}async setCookie(e){try{const n=H2(e.key),r=H2(e.value),i=e.expires?`; expires=${e.expires.replace("expires=","")}`:"",s=(e.path||"/").replace("path=",""),o=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${n}=${r||""}${i}; path=${s}; ${o};`}catch(n){return Promise.reject(n)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const n of e)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}vp("CapacitorCookies",{web:()=>new cI});const dI=async t=>new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{const i=r.result;e(i.indexOf(",")>=0?i.split(",")[1]:i)},r.onerror=i=>
2n(i),r.readAsDataURL(t)}),uI=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(i=>i.toLocaleLowerCase()).reduce((i,s,o)=>(i[s]=t[e[o]],i),{})},fI=(t,e=!0)=>t?Object.entries(t).reduce((r,i)=>{const[s,o]=i;let a,l;return Array.isArray(o)?(l="",o.forEach(c=>{a=e?encodeURIComponent(c):c,l+=`${s}=${a}&`}),l.slice(0,-1)):(a=e?encodeURIComponent(o):o,l=`${s}=${a}`),`${r}&${l}`},"").substr(1):null,hI=(t,e={})=>{const n=Object.assign({method:t.method||"GET",headers:t.headers},e),i=uI(t.headers)["content-type"]||"";if(typeof t.data=="string")n.body=t.data;else if(i.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[o,a]of Object.entries(t.data||{}))s.set(o,a);n.body=s.toString()}else if(i.includes("multipart/form-data")||t.data instanceof FormData){const s=new FormData;if(t.data instanceof FormData)t.data.forEach((a,l)=>{s.append(l,a)});else for(const a of Object.keys(t.data))s.append(a,t.data[a]);n.body=s;const o=new Headers(n.headers);o.delete("content-type"),n.headers=o}else(i.includes("application/json")||typeof t.data=="object")&&(n.body=JSON.stringify(t.data));return n};class pI extends xb{async request(e){const n=hI(e,e.webFetchExtra),r=fI(e.params,e.shouldEncodeUrlParams),i=r?`${e.url}?${r}`:e.url,s=await fetch(i,n),o=s.headers.get("content-type")||"";let{responseType:a="text"}=s.ok?e:{};o.includes("application/json")&&(a="json");let l,c;switch(a){case"arraybuffer":case"blob":c=await s.blob(),l=await dI(c);break;case"json":l=await s.json();break;case"document":case"text":default:l=await s.text()}const d={};return s.headers.forEach((u,f)=>{d[f]=u}),{data:l,headers:d,status:s.status,url:s.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}vp("CapacitorHttp",{web:()=>new pI});var q2;(function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"})(q2||(q2={}));var U2;(function(t){t.StatusBar="StatusBar",t.NavigationBar="NavigationBar"})(U2||(U2={}));class mI extends xb{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}vp("SystemBars",{web:()=>new mI});const gI=vp("App",{web:()=>dt(()=>import("./web-mYa3_IoY.js"),__vite__mapDeps([0,1,2,3])).then(t=>new t.AppWeb)});class V2{constructor(){this.lastTs=0,this.lastSuffix=1,this.backDict={},this.getKey=e=>{let n=!1;const r=`__${e}`;if(!this.backDict[r]){n=!0;const i=Date.now()%10**11;let s=i;s===this.lastTs?(s=s*1e4+this.lastSuffix,this.lastSuffix+=1):this.lastSuffix=1,this.backDict[r]=s,this.lastTs=i}return[this.backDict[r],n]}}}class vI{constructor(e){this.sendSetAttribute=(n,r,i)=>{if(this.isDictDisabled){const s=[12,n,r,i];return this.app.send(s)}else{const s=[35,n,this.applyDict(r),this.applyDict(i)];return this.app.send(s)}},this.app=e.app,this.isDictDisabled=e.isDictDisabled,this.dict=new V2}applyDict(e){const[n,r]=this.dict.getKey(e);return r&&this.app.send([34,n,e]),n}clear(){this.dict=new V2}}class bI{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=r=>{const i=yI(r);if(i.type)return i},this.durationInts=[]}setConditions(e){this.conditions=e}async fetchConditions(e,n){try{const r=await fetch(`${this.app.options.ingestPoint}/v1/web/conditions/${e}`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}),{conditions:i}=await r.json(),s=[];i.forEach(o=>{o.filters.forEach(l=>{let c;l.type==="fetch"?(c={type:"network_request",subConditions:[],name:o.name},l.filters.forEach(d=>{const u=this.createConditionFromFilter(d);u&&c.subConditions.push(u)})):c=this.createConditionFromFilter(l),c&&(c.type==="session_duration"&&this.processDuration(c.value[0],o.name),s.push({...c,name:o.name}))})}),this.conditions=s}catch{this.app.debug.error("Critical: cannot fetch start conditions")}}trigger(e){if(!this.hasStarted)try{this.hasStarted=!0,this.app.start(this.startParams,void 0,e)}catch(n){this.app.debug.error(n)}}processMessage(e){if(!this.hasStarted)switch(e[0]){case 78:this.jsExceptionEvent(e);break;case 27:this.customEvent(e);break;case 68:this.clickEvent(e);break;case 122:this.pageLocationEvent(e);break;case 83:this.networkRequest(e);break}}processFlags(e){const n=this.conditions.filter(r=>r.type==="feature_flag");
2n.length&&n.forEach(r=>{const i=Za[r.operator];i&&e.find(s=>i(s.key,r.value))&&this.trigger(r.name)})}clearDurationInt(e){clearInterval(e),this.durationInts=this.durationInts.filter(n=>n!==e)}processDuration(e,n){const r=setInterval(()=>{performance.now()>e&&(this.clearDurationInt(r),this.trigger(n))},1e3);this.durationInts.push(r),this.app.attachStopCallback(()=>this.clearDurationInt(r))}networkRequest(e){const n=this.conditions.filter(r=>r.type==="network_request");n.length&&n.forEach(r=>{const i=r.subConditions.filter(s=>s.operator!=="isAny");i.length?i.every(o=>{let a;switch(o.key){case"url":a=e[3];break;case"status":a=e[6];break;case"method":a=e[2];break;case"duration":a=e[8];break}const l=Za[o.operator];if(l&&l(a,o.value))return!0})&&this.trigger(r.name):i.length===0&&r.subConditions.length&&this.trigger(r.name)})}customEvent(e){const n=this.conditions.filter(r=>r.type==="custom_event");n.length&&n.forEach(r=>{const i=Za[r.operator];i&&(i(e[1],r.value)||i(e[2],r.value))&&this.trigger(r.name)})}clickEvent(e){const n=this.conditions.filter(r=>r.type==="click");n.length&&n.forEach(r=>{const i=Za[r.operator];i&&(i(e[3],r.value)||i(e[4],r.value))&&this.trigger(r.name)})}pageLocationEvent(e){const n=this.conditions.filter(r=>r.type==="visited_url");n&&n.forEach(r=>{const i=Za[r.operator];i&&i(e[1],r.value)&&this.trigger(r.name)})}jsExceptionEvent(e){const n=[e[1],e[2],e[3]],r=this.conditions.filter(i=>i.type==="exception");r&&r.forEach(i=>{const s=Za[i.operator];s&&n.some(o=>s(o,i.value))&&this.trigger(i.name)})}}const Za={is:(t,e)=>e.some(n=>t.includes(n)),isAny:()=>!0,isNot:(t,e)=>!e.some(n=>t.includes(n)),contains:(t,e)=>e.some(n=>t.includes(n)),notContains:(t,e)=>
2!e.some(n=>t.includes(n)),startsWith:(t,e)=>e.some(n=>t.startsWith(n)),endsWith:(t,e)=>e.some(n=>t.endsWith(n)),greaterThan:(t,e)=>t>e,greaterOrEqual:(t,e)=>t>=e,lessOrEqual:(t,e)=>t<=e,lessThan:(t,e)=>t<e},yI=t=>{const e={on:"is",notOn:"isNot",">":"greaterThan","<":"lessThan","=":"is","<=":"lessOrEqual",">=":"greaterOrEqual"},n=i=>{if(Object.keys(e).includes(i))return e[i]};let r={type:"",operator:"",value:t.value,key:""};switch(t.type){case"click":r={type:"click",operator:n(t.operator),value:t.value,key:""};break;case"location":r={type:"visited_url",operator:t.operator,value:t.value,key:""};break;case"custom":r={type:"custom_event",operator:t.operator,value:t.value,key:""};break;case"metadata":r={type:t.source==="featureFlag"?"feature_flag":t.type,operator:t.operator,value:t.value,key:""};break;case"error":r={type:"exception",operator:t.operator,value:t.value,key:""};break;case"duration":r={type:"session_duration",value:t.value,key:"",operator:"is"};break;case"fetchUrl":r={type:"network_request",key:"url",operator:t.operator,value:t.value};break;case"fetchStatusCode":r={type:"network_request",key:"status",operator:n(t.operator),value:t.value};break;case"fetchMethod":r={type:"network_request",key:"method",operator:n(t.operator),value:t.value};break;case"fetchDuration":r={type:"network_request",key:"duration",operator:n(t.operator),value:t.value};break}return r},W2={htmlmasked:"hidden",masked:"obscured"},kt=!(typeof window>"u"),wI=kt&&navigator.userAgent.match(/firefox|fxios/i),SI=1e5;let $b=kt?Date.now()-performance.now():0;function P0(){$b=Date.now()-performance.now()}function Tl(){return $b}const Li=kt&&performance.now?()=>Math.round(performance.now()+$b):()=>Date.now(),G2="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function c1(t){return t?t.trim().replace(/\s+/g," "):""}function g$(t){return t.startsWith("https://")||t.startsWith("http://")}const K2={};function So(t,e,n="/"){K2[t]||(K2[t]=!0)}function v$(t,e){if(!e||e.length===0)return"";const n=[];for(const r of e){const i=t.getAttribute(r);i!==null&&n.push(`[${r}=${i}]`)}return n.join("")}function b$(t){return!t.classList||t.classList.length===0?"":"."+Array.from(t.classList).join(".")}function Eb(t){let e=t.getAttribute("data-openreplay-label");return e!==null||(e=t.getAttribute("data-asayer-label"),e!==null&&So('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),e}function js(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(W2[e]&&So(`"${n}" attribute`,`"${W2[e]}" attribute`,"/en/sdk/sanitize-data"),!0):!1}function CI(t){try{return!!t.contentDocument}catch{return!1}}function y$(t){try{return t instanceof HTMLIFrameElement?t.contentDocument:t instanceof Window?t.document:t instanceof Document?t.defaultView:"nodeType"in t?t.nodeType:"addEventListener"in t&&t.addEventListener,!0}catch(e){if(e instanceof DOMException&&e.name==="SecurityError")return!1}return!0}function X2(t){return t.toString(16).padStart(2,"0")}function xI(t){const e=new Uint8Array(t/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,X2).join("")):Array.from({length:t},()=>X2(Math.floor(Math.random()*16))).join("")}function Y2(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function Tb(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function w$(t,e){if(e)return new MutationObserver(t);{const n=Tb("MutationObserver");return new window[n](t)}}function S$(t,e,n,r,i){if(!y$(t))return;let s="addEventListener";i||(s=Tb("addEventListener"));try{t[s]?t[s](e,n,r):t.addEventListener(e,n,r)}catch(o){const a=o.message}}function C$(t,e,n,r,i){if(!y$(t))return;let s="removeEventListener";i||(s=Tb("removeEventListener"));try{t[s]?t[s](e,n,r):t.removeEventListener(e,n,r)}catch(o){const a=o.message}}class $I{constructor(){this.taskQueue=[],this.isRunning=!1}addTask(e){this.taskQueue.push(e),this.runTasks()}runTasks(){if(this.isRunning||this.taskQueue.length===0)return;this.isRunning=!0;const e=()=>{if(this.taskQueue.length===0){this.isRunning=!1;return}const n=this.taskQueue.shift();Promise.resolve(n()).then(()=>{requestAnimationFrame(()=>e())})};e()}}const EI=new $I;function J2(t){EI.addTask(t)}function x$(t,e){const n={...t};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],s=t[r];typeof i=="object"&&!Array.isArray(i)&&i!==null?n[r]=x$(s||{},i):n[r]=i}return n}function TI(t,e){const n=new Map,r=new Map,i=new Map,s=function(o,...a){const l=Date.now(),c=n.get(o)??0,d=e-(l-c);if(i.set(o,a),d<=0)r.has(o)&&(clearTimeout(r.get(o)),r.delete(o)),n.set(o,l),i.delete(o),t(o,...a);else if(!r.has(o)){const u=setTimeout(()=>{r.delete(o);const f=i.get(o);i.delete(o),n.delete(o),t(o,...f)},d);r.set(o,u)}};return s.clear=()=>{for(const o of r.values())clearTimeout(o);r.clear(),i.clear(),n.clear()},s}function ia(t){return[0,t]}function RI(t,e){return[5,t,e]}function II(t,e){return[6,t,e]}function AI(){return[7]}function Q2(t,e,n,r,i){return[8,t,e,n,r,i]}function Z2(t,e,n){return[9,t,e,n]}function OI(t,e,n){return[10,t,e,n]}function ew(t){return[11,t]}function Gf(t,e,n){return[12,t,e,n]}function tw(t,e){return[13,t,e]}function kI(t,e){return[14,t,e]}function NI(t,e,n){return[16,t,e,n]}function _I(t,e,n){return[18,t,e,n]}function PI(t,e){return[19,t,e]}function MI(t,e){return[20,t,e]}function d1(t,e){return[22,t,e]}function DI(t,e,n,r,i,s,o,a,l){return[23,t,e,n,r,i,s,o,a,l]}function LI(t,e,n){return[24,t,e,n]}function nw(t,e){return[27,t,e]}function jI(t){return[28,t]}function FI(t){return[29,t]}function rw(t,e){return[30,t,e]}function BI(t,e){return[36,t,e]}function HI(t,e,n,r){return[49,t,e,n,r]}function zI(t,e){return[54,t,e]}function qI(t){return[55,t]}function iw(t,e,n,r){return[57,t,e,n,r]}function sw(t){return[58,t]}function u1(t,e,n,r){return[60,t,e,n,r]}function ow(t,e,n){return[61,t,e,n]}function UI(t,e){return[63,t,e]}function VI(t,e){return[64,t,e]}function M0(t,e){return[65,t,e]}function WI(t,e,n,r,i,s){return[68,t,e,n,r,i,s]}function f1(t,e){return[70,t,e]}function aw(t,e,n){return[71,t,e,n]}function yl(t,e,n,r){return[73,t,e,n,r]}function D0(t,e){return[75,t,e]}function Rb(t,e){return[76,t,e]}function GI(t,e){return[77,t,e]}function h1(t,e,n,r){return[78,t,e,n,r]}function vf(t,e,n,r,i,s,o,a,l){return[83,t,e,n,r,i,s,o,a,l]}function KI(t,e,n,r,i,s){return[84,t,e,n,r,i,s]}function $$(t,e,n,r,i,s,o,a,l,c,d,u,f,h,p,g,v){return[85,t,e,n,r,i,s,o,a,l,c,d,u,f,h,p,g,v]}function XI(t,e,n){return[87,t,e,n]}function YI(t,e,n,r,i,s){return[89,t,e,n,r,i,s]}function JI(t,e,n,r,i,s){return[112,t,e,n,r,i,s]}function lw(t,e,n){return[113,t,e,n]}function QI(t){return[114,t]}function cw(t){return[115,t]}function bf(t){return[117,t]}function sa(t){return[118,t]}function ZI(t,e){return[119,t,e]}function eA(t){return[120,t]}function tA(t,e,n,r){return[122,t,e,n,r]}function nA(t,e){return[124,t,e]}const p1=kt&&"performance"in window&&"memory"in performance?performance:{memory:{}},L0=kt?(navigator.deviceMemory||0)*1024:0,j0=p1.memory.jsHeapSizeLimit||0,Nu=-1;function rA(t,e){if(!Object.assign({capturePerformance:!0},e).capturePerformance)return;const r=kt&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,i=kt&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null;let s=!1,o=0,a=0,l=null,c=!1;const d=()=>{l=null,!(!s||o===Nu)&&(o++,!c&&u())},u=()=>{!r||l!==null||(c=!0,l=r(d),c=!1)},f=()=>{l!==null&&i&&i(l),l=null};t.ticker.attach(()=>{!s||a===Nu||a++},0,!1);const h=()=>{s&&(t.send(HI(o,a,p1.memory.totalJSHeapSize||0,p1.memory.usedJSHeapSize||0)),document.hidden?o=a=Nu:(o=a=0,u()))};t.attachStartCallback(()=>{s=!0,o=a=Nu,h()}),t.attachStopCallback(()=>{s=!1,o=a=0,f()}),t.ticker.attach(h,165,!1),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",h,!1,!1)}class iA{constructor(){this.tags=[],this.byId=new Map,this.byDataAttr=new Map,this.byClass=new Map,this.fallback=[]}setTags(e){this.tags=e,this.byId.clear(),this.byDataAttr.clear(),this.byClass.clear(),this.fallback=[];for(const n of e){const r=sA(n.selector);if(!r){this.fallback.push(n);continue}if(r.startsWith("#"))this.byId.set(r.slice(1),n);else if(r.startsWith("[data-"))this.byDataAttr.set(r,n);else{const i=oA(r);i?this.byClass.set(i,n):this.fallback.push(n)}}}getTags(){return this.tags}match(e){const n=this.matchExact(e);if(n)return n;if(e.parentElement){const i=this.matchExact(e.parentElement);if(i)return i}const r=e.children;for(let i=0;i<r.length;i++){const s=this.matchExact(r[i]);if(s)return s}return null}matchExact(e){if(e.id&&this.byId.has(e.id)){const n=this.byId.get(e.id);if(_u(e,n.selector)&&wl(n))return n}if(this.byDataAttr.size>0){const n=e.attributes;for(let r=0;r<n.length;r++){const i=n[r];if(i.name.startsWith("data-")){const s=`[${i.name}="${i.value}"]`;if(this.byDataAttr.has(s)){const o=this.byDataAttr.get(s);if(_u(e,o.selector)&&wl(o))return o}}}}if(this.byClass.size>0&&e.classList)for(let n=0;n<e.classList.length;n++){const r=e.classList[n];if(this.byClass.has(r)){const i=this.byClass.get(r);if(_u(e,i.selector)&&wl(i))return i}}for(const n of this.fallback)if(_u(e,n.selector)&&wl(n))return n;return null}clear(){this.tags=[],this.byId.clear(),this.byDataAttr.clear(),this.byClass.clear(),this.fallback=[]}}function sA(t){var i;const e=t.trim();if(!e)return null;const n=e.split(/\s*[>+~ ]\s*/);return((i=n[n.length-1])==null?void 0:i.trim())||null}function oA(t){const e=t.match(/\.([a-zA-Z_-][\w-]*)/);return e?e[1]:null}function _u(t,e){try{return t.matches(e)}catch{return!1}}function wl(t){if(!t.location)return!0;try{const e=t.location;return e.startsWith("/")?window.location.pathname===e:window.location.href===e}catch{return!0}}const dw="__or__watched_tags__";class aA{constructor(e){this.interval=null,this.tags=[],this.matcher=new iA,this.sessionStorage=e.sessionStorage,this.errLog=e.errLog,this.onTag=e.onTag;const n=JSON.parse(e.sessionStorage.getItem(dw)??"[]");this.setTags(n),this.observer=new IntersectionObserver(r=>{r.forEach(i=>
2{if(i.isIntersecting&&i.target){const s=i.target.__or_watcher_tagname;s&&this.onTagRendered(s),this.observer.unobserve(i.target)}})})}async fetchTags(e,n){return fetch(`${e}/v1/web/tags`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}).then(r=>r.json()).then(({tags:r})=>{if(r&&r.length){this.setTags(r);const i=JSON.stringify(r);this.sessionStorage.setItem(dw,i||"")}}).catch(r=>this.errLog(r))}setTags(e){this.tags=e,this.matcher.setTags(e),this.interval&&(clearInterval(this.interval),this.interval=null),this.interval=setInterval(()=>{this.tags.forEach(n=>{if(!wl(n))return;const r=document.querySelectorAll(n.selector);if(r.length>0){const i=r[0];i.__or_watcher_tagname=n.id,this.observer.observe(i)}})},500)}onTagRendered(e){const n=this.tags.find(r=>r.id===e);n&&(this.tags=this.tags.filter(r=>r.id!==e),!wl(n))||this.onTag(e)}clear(){this.tags=[],this.matcher.clear(),this.interval&&(clearInterval(this.interval),this.interval=null),this.observer.disconnect()}}function E$(t){return!!t&&t.nodeType!=null}function m1(t){return t.namespaceURI==="http://www.w3.org/2000/svg"||t.localName==="svg"}function lA(t){return t.localName==="use"}function li(t){return t.nodeType===Node.ELEMENT_NODE}function cA(t){return t.nodeType===Node.COMMENT_NODE}function qc(t){return t.nodeType===Node.TEXT_NODE}function Kf(t){return t.nodeType===Node.DOCUMENT_NODE}function bp(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Nn(t,e){return t.localName===e}let dA=class{constructor(e,n){this.app=e,this.options=n,this.snapshots={},this.intervals=new Map,this.observers=new Map,this.uploadQueue=0,this.MAX_CONCURRENT_UPLOADS=2,this.MAX_QUEUE_SIZE=50,this.pendingBatches=[],this.isProcessingQueue=!1,this.resanitizeCanvas=(r,i)=>{if(!Nn(r,"canvas"))return;if(this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)){if(this.snapshots[i]||this.observers.has(i)){const o=this.observers.get(i);o&&(o.disconnect(),this.observers.delete(i)),this.cleanupCanvas(i)}}else!this.snapshots[i]&&!this.observers.has(i)&&this.captureCanvas(r)},this.restartTracking=()=>{this.clear(),this.app.nodes.scanTree(this.captureCanvas)},this.captureCanvas=r=>{const i=this.app.nodes.getID(r);if(!i||!Nn(r,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||this.snapshots[i])return;const o=new IntersectionObserver(a=>{a.forEach(l=>{l.isIntersecting?this.snapshots[i]&&this.snapshots[i].createdAt?this.snapshots[i].paused=!1:this.recordCanvas(l.target,i):this.snapshots[i]&&(this.snapshots[i].paused=!0)})});this.observers.set(i,o),o.observe(r)},this.recordCanvas=(r,i)=>{const s=this.app.timestamp();this.snapshots[i]={images:[],createdAt:s,paused:!1,dummy:document.createElement("canvas"),isCapturing:!1,isStopped:!1};const o=ZI(i.toString(),s);this.app.send(o);const a=r,l=d=>{!this.snapshots[i]||this.snapshots[i].isCapturing||this.snapshots[i].isStopped||(this.snapshots[i].isCapturing=!0,uA(d,this.options.quality,this.snapshots[i].dummy,this.options.fixedScaling,this.fileExt,u=>{this.snapshots[i]&&(this.snapshots[i].isCapturing=!1),!(!u||!this.snapshots[i]||this.snapshots[i].isStopped)&&(this.snapshots[i].images.push({id:this.app.timestamp(),data:u}),this.snapshots[i].images.length>9&&(this.sendSnaps(this.snapshots[i].images,i,this.snapshots[i].createdAt),this.snapshots[i].images=[]))}))},c=setInterval(()=>{const d=this.snapshots[i];if(!d||d.isStopped){this.app.debug.log("Canvas is not present in {snapshots}"),this.cleanupCanvas(i);return}if(!document.contains(a)){this.app.debug.log("Canvas element not in sync",a,r),this.cleanupCanvas(i);return}d.paused||(this.options.useAnimationFrame?requestAnimationFrame(()=>{l(a)}):l(a))},this.interval);this.intervals.set(i,c)},this.fileExt="webp",this.interval=1e3/n.fps}startTracking(){setTimeout(()=>{this.app.nodes.scanTree(this.captureCanvas),this.app.nodes.attachNodeCallback(this.captureCanvas),this.app.attachResanitizeCallback(this.resanitizeCanvas)},125)}sendSnaps(e,n,r){if(Object.keys(this.snapshots).length!==0){if(this.pendingBatches.length>=this.MAX_QUEUE_SIZE){this.app.debug.warn("Upload queue full, dropping canvas batch");return}this.pendingBatches.push({images:e,canvasId:n,createdAt:r}),this.isProcessingQueue||this.processUploadQueue()}}async processUploadQueue(){for(this.isProcessingQueue=!0;this.pendingBatches.length>0;){if(this.uploadQueue>=this.MAX_CONCURRENT_UPLOADS){await new Promise(n=>setTimeout(n,100));continue}const e=this.pendingBatches.shift();if(!e)break;this.uploadBatch(e.images,e.canvasId,e.createdAt)}this.isProcessingQueue=!1}async uploadBatch(e,n,r){if(this.options.isDebug){const o=await fA(e);
2if(o){const a=`${r}_${n}.${this.fileExt}.frames`,l=URL.createObjectURL(new Blob([o])),c=document.createElement("a");c.href=l,c.download=a,c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(l)}}let i;if(this.options.framesSupport){const o=[];let a=0;for(const h of e){if(!h.data)continue;const p=await h.data.arrayBuffer();o.push(p),a+=12+p.byteLength}if(a===0)return;const l=new ArrayBuffer(a),c=new DataView(l),d=new Uint8Array(l);let u=0;for(let h=0;h<e.length;h++){if(!e[h].data)continue;const p=o.shift(),g=e[h].id;c.setUint32(u,g%4294967296,!0),c.setUint32(u+4,Math.floor(g/4294967296),!0),u+=8,c.setUint32(u,p.byteLength,!0),u+=4,d.set(new Uint8Array(p),u),u+=p.byteLength}i=new FormData,i.append("type","frames");const f=`${r}_${n}.${this.fileExt}.frames`;i.append("frames",new Blob([l]),f)}else i=new FormData,e.forEach(o=>{const a=o.data;if(!a)return;const l=`${r}_${n}_${o.id}.${this.fileExt}`;i.append("snapshot",a,l)});const s=()=>{this.app.debug.log("Restarting tracker; token expired"),this.app.stop(!1),setTimeout(()=>{this.app.start({},!0)},250)};this.uploadQueue++,fetch(this.app.options.ingestPoint+"/v1/web/images",{method:"POST",headers:{Authorization:`Bearer ${this.app.session.getSessionToken()??""}`},body:i}).then(o=>o.status===401?s():!0).catch(o=>{this.app.debug.error("error saving canvas",o)}).finally(()=>{this.uploadQueue--})}cleanupCanvas(e){var i;this.snapshots[e]&&(this.snapshots[e].isStopped=!0);const n=this.intervals.get(e);n&&(clearInterval(n),this.intervals.delete(e));const r=this.observers.get(e);if(r&&(r.disconnect(),this.observers.delete(e)),(i=this.snapshots[e])!=null&&i.dummy){const s=this.snapshots[e].dummy;s.width=0,s.height=0}delete this.snapshots[e]}clear(){Object.keys(this.snapshots).forEach(e=>{const n=parseInt(e,10),r=this.snapshots[n];r&&r.images.length>0&&(this.sendSnaps(r.images,n,r.createdAt),r.images=[])}),Object.keys(this.snapshots).forEach(e=>{const n=parseInt(e,10);this.cleanupCanvas(n)}),this.intervals.clear(),this.observers.clear(),this.snapshots={}}};const uw={low:.35,medium:.55,high:.8};function uA(t,e="medium",n,r=!1,i,s){const o=`image/${i}`;if(r){const a=window.devicePixelRatio||1;n.width=t.width/a,n.height=t.height/a;const l=n.getContext("2d");if(!l)return"";l.clearRect(0,0,n.width,n.height),l.drawImage(t,0,0,n.width,n.height),n.toBlob(s,o,uw[e])}else t.toBlob(s,o,uw[e])}async function fA(t){const e=[];let n=0;for(const a of t){if(!a.data)continue;const l=await a.data.arrayBuffer();e.push(l),n+=12+l.byteLength}if(n===0)return null;const r=new ArrayBuffer(n),i=new DataView(r),s=new Uint8Array(r);let o=0;for(let a=0;a<t.length;a++){if(!t[a].data)continue;const l=e.shift(),c=t[a].id;i.setUint32(o,c%4294967296,!0),i.setUint32(o+4,Math.floor(c/4294967296),!0),o+=8,i.setUint32(o,l.byteLength,!0),o+=4,s.set(new Uint8Array(l),o),o+=l.byteLength}return r}const ul={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class hA{constructor(e=ul.Silent){this.shouldLog=n=>this.level>=n,this.info=(...n)=>{this.shouldLog(ul.Verbose)},this.log=(...n)=>{this.shouldLog(ul.Log)},this.warn=(...n)=>{this.shouldLog(ul.Warnings)},this.error=(...n)=>{this.shouldLog(ul.Errors)},this.level=e}}const pA=1e3;function mA(t,e,n,r,i){const s=t.entries();function o(){let a=0,l=s.next();for(;!l.done&&a<e;){const c=l.value[1];c&&n(c),a++,l=s.next()}a>0?r(setTimeout(o,50)):i()}o()}function gA(t){var e;try{if(!t.isConnected)return[!1,"not connected"];const n=t.nodeType===Node.DOCUMENT_NODE,r=n?t.defaultView:(e=t.ownerDocument)==null?void 0:e.defaultView,i=n?t:t.ownerDocument;return r?r.closed?[!1,"window closed"]:i!=null&&i.documentElement.isConnected?[!0,"ok"]:[!1,"documentElement not connected"]:[!1,"no window"]}catch(n){return[!1,n]}}const vA={interval:pA*30,batchSize:2500,enabled:!0};class bA{constructor(e,n,r){this.nodes=e,this.unregisterNode=n,this.isScanning=!1,this.start=()=>{this.options.enabled&&(this.stop(),this.interval=setInterval(()=>{this.isScanning||(this.isScanning=!0,mA(this.nodes,this.options.batchSize,i=>{gA(i)[0]||this.unregisterNode(i)},i=>{this.batchTimeout=i},()=>{this.batchTimeout=void 0,this.isScanning=!1}))},this.options.interval))},this.stop=()=>{this.interval&&clearInterval(this.interval),this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=void 0),this.isScanning=!1},this.options={...vA,...r}}}const yA=2,T$=7,Ib=22,wA=Ib,SA=Ib+T$,CA=(1<<Ib)-1,Xf=(1<<T$)-1,fw=(1<<yA)-1;function xA(t,e,n){if(t<0||t>fw)throw new RangeError("OR: nesting level overflow, max 4");if(e<0||e>Xf)throw new RangeError("OR: frame order overflow, max 128");return((t&fw)<<SA|(e&Xf)<<wA|n&CA)>>>0}class $A{constructor(e){this.nodes=new Map,this.totalNodeAmount=0,this.nodeCallbacks=[],this.elementListeners=new Map,this.nextNodeId=0,this.attachNodeCallback=n=>this.nodeCallbacks.push(n),this.scanTree=n=>
2{this.nodes.forEach(r=>r?n(r):void 0)},this.attachNodeListener=(n,r,i,s=!0)=>{const o=this.getID(n);if(o===void 0)return;S$(n,r,i,s,this.forceNgOff);let a=this.elementListeners.get(o);a===void 0&&(a=[],this.elementListeners.set(o,a)),a.push([r,i,s])},this.createFrameId=(n,r)=>xA(n,r,0),this.unregisterNode=n=>{const r=n[this.node_id];if(r!==void 0){n[this.node_id]=void 0,delete n[this.node_id],this.nodes.delete(r);const i=this.elementListeners.get(r);i!==void 0&&(this.elementListeners.delete(r),i.forEach(s=>C$(n,s[0],s[1],s[2],this.forceNgOff))),this.totalNodeAmount--}return r},this.node_id=e.node_id,this.forceNgOff=e.forceNgOff,this.maintainer=new bA(this.nodes,this.unregisterNode,e.maintainer),this.maintainer.start()}crossdomainMode(e,n){this.nextNodeId=this.createFrameId(e,n)}registerNode(e){const n=e[this.node_id],r=n===void 0||this.nodes.get(n)!==e;let i=n;return r&&(i=this.nextNodeId,this.totalNodeAmount++,this.nextNodeId++,this.nodes.set(i,e),e[this.node_id]=i),[i,r]}cleanTree(){for(const[e,n]of this.nodes)n&&!document.contains(n)&&this.unregisterNode(n)}callNodeCallbacks(e,n){this.nodeCallbacks.forEach(r=>r(e,n))}getID(e){if(e)return e[this.node_id]}isBound(e){if(!e)return!1;const n=e[this.node_id];return n!==void 0&&this.nodes.get(n)===e}
2getNode(e){return this.nodes.get(e)}getNodeCount(){return this.totalNodeAmount}clear(){for(const[e,n]of this.nodes)n&&this.unregisterNode(n);this.nextNodeId=0,this.nodes.clear()}}let hw=1e6*99;function EA(t,e,n,r,i,s,o,a,l){const c=a?null:r();a||s(c,e);const d=t.sheet;if(d&&!o)try{const T=p(d);if(T){f(T);return}}catch{}t.href?fetch(t.href).then(T=>{if(!T.ok)throw new Error(`response status ${T.status}`);return T.text()}).then(T=>{a&&l?l(T,hw++):f(T)}).catch(T=>{u()}):u();function u(){const T=()=>{const S=t.sheet;if(S)try{const _=p(S);if(_){a&&l?l(_,hw++):f(_);return}}catch{}};t.sheet?T():t.addEventListener("load",function S(){t.removeEventListener("load",S),T()})}function f(T){T=T.replace(/\/\*[\s\S]*?\*\//g,"");const S=h(T);for(let _=0;_<S.length;_++)i(c,S[_],_,n)}function h(T){const S=[];let _=!1,A=!1,$="",E=0,I="";for(let D=0;D<T.length;D++){const B=T[D],j=T[D+1]||"";if(!A&&B==="/"&&j==="*"){_=!0,D++;continue}if(_){B==="*"&&j==="/"&&(_=!1,D++);continue}if(!A&&(B==='"'||B==="'")){A=!0,$=B,I+=B;continue}if(A){I+=B,B===$&&T[D-1]!=="\\"&&(A=!1);continue}I+=B,B==="{"?E++:B==="}"&&(E--,E===0&&(S.push(I.trim()),I=""))}return I.trim()&&S.push(I.trim()),S}function p(T){try{const S=T.rules||T.cssRules;if(!S)return null;let _=T.href;!_&&T.ownerNode&&T.ownerNode.ownerDocument&&(_=T.ownerNode.ownerDocument.location.href);const A=Array.from(S,$=>g($,_)).join("");return v(A)}catch{return null}}function g(T,S){if(C(T)){let _;try{_=p(T.styleSheet)||b(T)}catch{_=T.cssText}return T.styleSheet.href?R(_,T.styleSheet.href):_}else{let _=T.cssText;return x(T)&&T.selectorText.includes(":")&&(_=w(_)),S?R(_,S):_}}function v(T){return T.includes(" background-clip: text;")&&!T.includes(" -webkit-background-clip: text;")&&(T=T.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),T}function b(T){const{cssText:S}=T;if(S.split('"').length<3)return S;const _=["@import",`url(${JSON.stringify(T.href)})`];return T.layerName===""?_.push("layer"):T.layerName&&_.push(`layer(${T.layerName})`),T.supportsText&&_.push(`supports(${T.supportsText})`),T.media.length&&_.push(T.media.mediaText),_.join(" ")+";"}function w(T){const S=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return T.replace(S,"$1\\$2")}function C(T){return"styleSheet"in T}function x(T){return"selectorText"in T}function R(T,S){if(!T)return"";const _=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,A=/^(?:[a-z+]+:)?\/\//i,$=/^www\..*/i,E=/^(data:)([^,]*),(.*)/i;return T.replace(_,(I,D,B,j,z,q)=>{const ne=B||z||q,Z=D||j||"";if(!ne)return I;if(A.test(ne)||$.test(ne))return`url(${Z}${ne}${Z})`;if(E.test(ne))return`url(${Z}${ne}${Z})`;if(ne[0]==="/")return`url(${Z}${O(S)+ne}${Z})`;const J=S.split("/"),de=ne.split("/");J.pop();for(const X of de)X!=="."&&(X===".."?J.pop():J.push(X));return`url(${Z}${J.join("/")}${Z})`})}function O(T){let S="";return T.indexOf("//")>-1?S=T.split("/").slice(0,3).join("/"):S=T.split("/")[0],S=S.split("?")[0],S}}function pw(t){return bp(t)&&!!t.adoptedStyleSheets}let TA=15;function Ab(){return TA++}const Hs=new Map;function RA(t){if(t===null||!pw(document))return;const e=new Map,n=s=>setTimeout(()=>{let o=t.nodes.getID(s);if(s===document&&(o=0),o===void 0)return;let a=e.get(o);a||(a=[]);const l=[],c=s.adoptedStyleSheets;if(c&&Symbol.iterator in c)for(const d of c){let u=Hs.get(d);const f=!u;if(u||(u=Ab(),Hs.set(d,u)),a.includes(u)||t.send(Rb(u,o)),f)try{const h=d.cssRules;for(let p=0;p<h.length;p++)t.send(yl(u,h[p].cssText,p,t.getBaseHref()))}catch(h){t.debug.log("Couldnt access adopted stylesheet",h)}l.push(u)}if(Symbol.iterator in a)for(const d of a)l.includes(d)||t.send(GI(d,o));e.set(o,l)},20);function r(s){const o=Object.getOwnPropertyDescriptor(s,"adoptedStyleSheets");o&&Object.defineProperty(s,"adoptedStyleSheets",{...o,set:function(a){const l=o.set.call(this,a);return n(this),l}})}const i=s=>{if(s.__openreplay_adpss_patched__)return;s.__openreplay_adpss_patched__=!0,r(s.Document.prototype),r(s.ShadowRoot.prototype);const{replace:o,replaceSync:a}=s.CSSStyleSheet.prototype;s.CSSStyleSheet.prototype.replace=function(l){return o.call(this,l).then(c=>{const d=Hs.get(this);return d&&t.send(aw(d,l,t.getBaseHref())),c})},s.CSSStyleSheet.prototype.replaceSync=function(l){const c=Hs.get(this);return c&&t.send(aw(c,l,t.getBaseHref())),a.call(this,l)}};i(window),t.observer.attachContextCallback(t.safe(i)),t.attachStopCallback(()=>{Hs.clear(),e.clear()}),t.attachStartCallback(()=>{n(document)}),t.nodes.attachNodeCallback(s=>{pw(s)&&n(s)})}var kn;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})(kn||(kn={}));const yf=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff\s]/g,"*");class IA{constructor(e){var r;this.levels=new Map,this.app=e.app;const n={obscureTextEmails:!0,obscureTextNumbers:!1,privateMode:!1,domSanitizer:void 0};this.privateMode=((r=e.options)==null?void 0:r.privateMode)??!1,this.options=Object.assign(n,e.options)}computeLevel(e,n){if(this.options.privateMode&&(li(e)&&!js(e,"unmask")||qc(e)&&!js(e.parentNode,"unmask")))return kn.Obscured;let r=kn.Plain;if((n>=kn.Obscured||li(e)&&(js(e,"masked")||js(e,"obscured")))&&(r=kn.Obscured),(n===kn.Hidden||li(e)&&(js(e,"htmlmasked")||js(e,"hidden")))&&(r=kn.Hidden),this.options.domSanitizer!==void 0&&li(e)){const i=this.options.domSanitizer(e);i===kn.Obscured&&r<kn.Obscured&&(r=kn.Obscured),i===kn.Hidden&&(r=kn.Hidden)}return r}getLevel(e){return this.levels.get(e)??kn.Plain}setLevel(e,n){const r=this.getLevel(e);return n===kn.Plain?this.levels.delete(e):this.levels.set(e,n),r}handleNode(e,n,r){const i=this.computeLevel(r,this.getLevel(n));i>this.getLevel(e)&&this.setLevel(e,i)}sanitize(e,n){return this.getLevel(e)>=kn.Obscured?yf(n):(this.options.obscureTextNumbers&&(n=n.replace(/\d/g,"0")),this.options.obscureTextEmails&&(n=n.replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,r=>{const i=r.lastIndexOf("@"),s=r.slice(0,i),a=r.slice(i+1).split(".").map(l=>G2(l)).join(".");return`${G2(s)}@${a}`})),n)}isObscured(e){return this.getLevel(e)>=kn.Obscured}isHidden(e){return this.getLevel(e)===kn.Hidden}getInnerTextSecure(e){const n=this.app.nodes.getID(e);return n?this.sanitize(n,e.innerText):""}clear(){this.levels.clear()}}const Pu={},ro={};async function AA(t,e,n){try{const r=t.getAttribute("xlink:href")||t.getAttribute("href");if(!r)return;let[i,s]=r.split("#");if(!i&&!s)return;const o=i?`url:${i}#${s}#${e}`:`doc:${s}#${e}`;if(Pu[o])return Pu[o];if(!i&&s){const c=r.startsWith("#");let d;c?d=`#${CSS.escape(r.substring(1))}`:d=CSS.escape(r);const u=document.querySelector(d);if(u){const f=`
3        <svg xmlns="http://www.w3.org/2000/svg" viewBox="${u.getAttribute("viewBox")||"0 0 24 24"}">
4          ${u.innerHTML}
5        </svg>
6      `;return Pu[o]=f,f}else return}let a;if(ro[i])ro[i]===1?await new Promise(c=>{let d=0;const u=setInterval(()=>{d>100&&(clearInterval(u),c(!1)),ro[i]!==1?(a=ro[i],clearInterval(u),c(!0)):d++},100)}):a=ro[i]??'<svg xmlns="http://www.w3.org/2000/svg"></svg>';else{ro[i]=1;try{const d=await(await fetch(i)).text();a=n.parseFromString(d,"image/svg+xml"),ro[i]=a}catch(c){throw delete ro[i],c}}if(!a)return;const l=a.getElementById(s);if(!l)return"";if(e==="svgtext"){const c=`
7        <svg xmlns="http://www.w3.org/2000/svg" viewBox="${l.getAttribute("viewBox")||"0 0 24 24"}">
8          ${l.innerHTML}
9        </svg>
10      `;return Pu[o]=c,c}}catch{}}function fl(t){if(cA(t))return!0;
10if(qc(t))return!1;if(!li(t))return!0;const e=t.tagName.toUpperCase();if(e==="LINK"){const n=t.getAttribute("rel"),r=t.getAttribute("as");return!(n!=null&&n.includes("stylesheet")||r==="style"||r==="font")}return e==="SCRIPT"||e==="NOSCRIPT"||e==="META"||e==="TITLE"||e==="BASE"}function Mu(t){return bp(t)?!0:!fl(t)}const OA=new Set(["button","reset","submit","checkbox","radio"]);function kA(t){return Nn(t,"input")&&!OA.has(t.type)}var Mi;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(Mi||(Mi={}));class Ob{constructor(e,n=!1,r={}){this.app=e,this.isTopContext=n,this.commited=[],this.recents=new Map,this.indexes=[],this.attributesMap=new Map,this.textSet=new Set,this.slotMap=new Map,this.disableSprites=!1,this.inlineRemoteCss=!1,this.inlinerOptions=void 0,this.domParser=new DOMParser,this.generation=0,this.throttling=!0,this.throttledSetNodeData=TI((i,s,o)=>this.sendNodeData(i,s,o),30),this.throttling=!r.disableThrottling,this.disableSprites=!!r.disableSprites,this.inlineRemoteCss=!!r.inlineRemoteCss,this.inlinerOptions=r.inlinerOptions,this.observer=w$(this.app.safe(i=>{for(const s of i)try{const o=s.target,a=s.type;if(!Mu(o))continue;if(a==="childList"){for(let c=0;c<s.removedNodes.length;c++)Mu(s.removedNodes[c])&&this.bindNode(s.removedNodes[c]);for(let c=0;c<s.addedNodes.length;c++)this.bindTree(s.addedNodes[c]);continue}const l=this.app.nodes.getID(o);if(l===void 0)continue;if(this.recents.has(l)||this.recents.set(l,Mi.Changed),a==="attributes"){const c=s.attributeName;if(c===null)continue;let d=this.attributesMap.get(l);d===void 0&&this.attributesMap.set(l,d=new Set),d.add(c);continue}if(a==="characterData"){this.textSet.add(l);continue}}catch{s.target}this.commitNodes()}),this.app.options.forceNgOff)}clear(){this.commited.length=0,this.recents.clear(),this.indexes.length=1,this.attributesMap.clear(),this.textSet.clear()}handleIframeSrcChange(e){const n=e.contentDocument;if(n&&this.app.nodes.getID(n)!==void 0){const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:d=>fl(d)||this.app.nodes.getID(d)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let s=0;const o=this.app.nodes.getNodeCount(),a=e.contentDocument,l=this.app.nodes.unregisterNode.bind(this.app.nodes);for(;i.nextNode();)a.contains(i.currentNode)||(s+=1,l(i.currentNode));const c=Math.floor(s/o*100);c>30&&this.app.send(cw(c))}}sendNodeAttribute(e,n,r,i){if(m1(n)){if(r.startsWith("xlink:")&&(r=r.substring(6)),i===null){this.app.send(tw(e,r));return}if(lA(n)&&r==="href"&&!this.disableSprites){AA(n,"svgtext",this.domParser).then(s=>{s&&this.app.send(Gf(e,r,`_$OPENREPLAY_SPRITE$_${s}`))}).catch(s=>{});return}r==="href"?(i.length>1e5&&(i=""),this.app.send(u1(e,r,i,this.app.getBaseHref()))):this.app.attributeSender.sendSetAttribute(e,r,i);return}if(r==="open"&&Nn(n,"dialog")){let s;if(i===null)s="closed";else{let o=!1;try{o=n.matches("dialog:modal")}catch{}s=o?"modal":"nonmodal"}this.app.send(Gf(e,"__openreplay_dialog",s))}if(!(r==="src"||r==="srcset"||r==="integrity"||r==="crossorigin"||r==="autocomplete"||r.substring(0,2)==="on")&&!(r==="value"&&kA(n))){if(i===null){this.app.send(tw(e,r));return}if(r==="style"||r==="href"&&Nn(n,"link")){if("rel"in n&&n.rel==="stylesheet"&&this.inlineRemoteCss){const s=this.generation;setTimeout(()=>{var o,a;EA(n,e,this.app.getBaseHref(),Ab,(l,c,d,u)=>{this.generation===s&&this.app.send(yl(l,c,d,u))},(l,c)=>{this.generation===s&&this.app.send(Rb(l,c))},(o=this.inlinerOptions)==null?void 0:o.forceFetch,(a=this.inlinerOptions)==null?void 0:a.forcePlain,(l,c)=>{this.generation===s&&(this.app.send(Z2(c,e,0)),this.app.send(ow(c,l,this.app.getBaseHref())))})},0);return}this.app.send(u1(e,r,i,this.app.getBaseHref()));return}(r==="href"||i.length>1e5)&&(i=""),["alt","placeholder"].includes(r)&&this.app.sanitizer.privateMode&&(i=i.replaceAll(/./g,"*")),this.app.attributeSender.sendSetAttribute(e,r,i)}}sendNodeData(e,n,r){if(Nn(n,"style")){this.app.send(ow(e,r,this.app.getBaseHref()));return}r=this.app.sanitizer.sanitize(e,r),this.app.send(kI(e,r))}bindNode(e){const[n,r]=this.app.nodes.registerNode(e);li(e)&&Nn(e,"slot")&&this.app.nodes.attachNodeListener(e,"slotchange",()=>{e.assignedNodes({flatten:!0}
10).forEach(s=>{const o=this.app.nodes.getID(s);o!==void 0&&this.recents.set(o,Mi.Changed)})}),r?this.recents.set(n,Mi.New):this.recents.get(n)!==Mi.New&&this.recents.set(n,Mi.Removed)}bindTree(e){if(!Mu(e))return;this.bindNode(e);const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:r=>fl(r)||this.app.nodes.isBound(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);for(;n.nextNode();)this.bindNode(n.currentNode)}unbindTree(e){const n=this.app.nodes.unregisterNode(e);if(n!==void 0&&this.slotMap.delete(n),n!==void 0&&this.recents.get(n)===Mi.Removed){this.app.send(ew(n));const r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:a=>fl(a)||this.app.nodes.getID(a)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let i=0;const s=this.app.nodes.getNodeCount();for(;r.nextNode();)i+=1,this.app.nodes.unregisterNode(r.currentNode);const o=Math.floor(i/s*100);o>30&&this.app.send(cw(o))}}_commitNode(e,n){if(bp(n))return!0;let r=n.assignedSlot;const i=n.parentNode;let s;if(!Nn(n,"html")||!this.isTopContext){if(i===null)return this.unbindTree(n),!1;if(s=this.app.nodes.getID(i),s===void 0)return this.unbindTree(n),!1;if(!this.commitNode(s))return this.unbindTree(n),!1;if(this.app.sanitizer.handleNode(e,s,n),this.app.sanitizer.isHidden(s))return!1}let o=n.previousSibling;for(;o!==null;){const u=this.app.nodes.getID(o);if(u!==void 0){this.commitNode(u),this.indexes[e]=this.indexes[u]+1;break}o=o.previousSibling}o===null&&(this.indexes[e]=0);const a=this.recents.get(e),l=a===Mi.New,c=this.indexes[e];if(c===void 0)throw"commitNode: missing node index";if(l){if(li(n)){let u=n;if(s!==void 0){if(this.app.sanitizer.isHidden(e)){const f=u.clientWidth,h=u.clientHeight;u=n.cloneNode(),u.style.width=`${f}px`,u.style.height=`${h}px`}"rel"in u&&u.rel==="stylesheet"&&this.inlineRemoteCss?this.app.send(Q2(e,s,c,"STYLE",!1)):this.app.send(Q2(e,s,c,u.tagName,m1(n)))}for(let f=0;f<u.attributes.length;f++){const h=u.attributes[f];this.sendNodeAttribute(e,u,h.nodeName,h.value)}}else qc(n)&&(this.app.send(Z2(e,s,c)),this.throttling?this.throttledSetNodeData(e,i,n.data):this.sendNodeData(e,i,n.data));if(r){const u=this.app.nodes.getID(r);u!==void 0&&(this.slotMap.set(e,u),this.app.send(M0(e,u)))}return!0}if(a===Mi.Removed&&s!==void 0)if(this.app.send(OI(e,s,c)),r){const u=this.app.nodes.getID(r);u!==void 0&&this.slotMap.get(e)!==u&&(this.slotMap.set(e,u),this.app.send(M0(e,u)))}else this.slotMap.has(e)&&(this.slotMap.delete(e),this.app.send(M0(e,0)));const d=this.attributesMap.get(e);if(d!==void 0){if(!li(n))throw"commitNode: node is not an element";for(const u of d)this.sendNodeAttribute(e,n,u,n.getAttribute(u))}
10if(this.textSet.has(e)){if(!qc(n))throw"commitNode: node is not a text";this.throttling?this.throttledSetNodeData(e,i,n.data):this.sendNodeData(e,i,n.data)}return!0}commitNode(e){const n=this.app.nodes.getNode(e);if(!n)return!1;const r=this.commited[e];return r!==void 0?r:this.commited[e]=this._commitNode(e,n)}commitNodes(e=!1){let n;for(const[r,i]of this.recents.entries())this.commitNode(r),i===Mi.New&&(n=this.app.nodes.getNode(r))&&this.app.nodes.callNodeCallbacks(n,e);this.clear()}observeRoot(e,n,r=e){this.observer.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1}),this.bindTree(r),n(this.app.nodes.getID(e)),this.commitNodes(!0)}resanitizeSubtree(e){if(!Mu(e))return;const n=e.parentNode,r=n!==null?this.app.nodes.getID(n):void 0,i=r!==void 0?this.app.sanitizer.getLevel(r):kn.Plain;this.resanitizeNode(e,i)}resanitizeNode(e,n){if(fl(e))return;const r=this.app.nodes.getID(e);if(r===void 0)return;const i=this.app.sanitizer.computeLevel(e,n),s=this.app.sanitizer.getLevel(r),o=s===kn.Hidden,a=i===kn.Hidden;if(o!==a){this.recreateSubtree(e);return}if(!a){s!==i&&(this.app.sanitizer.setLevel(r,i),this.reemitNode(r,e));for(let l=e.firstChild;l!==null;l=l.nextSibling)this.resanitizeNode(l,i)}}recreateSubtree(e){const n=this.app.nodes.getID(e);n!==void 0&&(this.app.send(ew(n)),this.clearSubtreeRegistration(e),this.bindTree(e),this.commitNodes())}clearSubtreeRegistration(e){const n=s=>{const o=this.app.nodes.getID(s);o!==void 0&&this.app.sanitizer.setLevel(o,kn.Plain),this.app.nodes.unregisterNode(s)},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:s=>fl(s)||this.app.nodes.getID(s)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1),i=[];for(;r.nextNode();)i.push(r.currentNode);n(e),i.forEach(n)}reemitNode(e,n){if(qc(n)){const r=n.parentNode;r!==null&&li(r)&&this.sendNodeData(e,r,n.data);return}li(n)&&this.app.callResanitizeCallbacks(n,e)}disconnect(){const e=this.observer.takeRecords();if(e.length){const n=[];for(const r of e)for(let i=0;i<r.addedNodes.length;i++){const s=r.addedNodes[i];s.tagName&&n.length<10&&n.push(s.tagName)}}this.observer.disconnect(),this.clear(),this.throttledSetNodeData.clear(),this.generation++}resetThrottledSetNodeData(){this.throttledSetNodeData.clear()}}class mw extends Ob{observe(e){const n=e.contentDocument,r=this.app.nodes.getID(e);!n||r===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.docId=i,this.app.send(f1(r,i))})}syntheticObserve(e,n){this.observeRoot(n,r=>{if(r===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.app.send(f1(e,r))})}}class NA extends Ob{observe(e){const n=e.shadowRoot,r=this.app.nodes.getID(e);!n||r===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.error("OpenReplay: Shadow Root was not bound");return}this.app.send(f1(r,i))})}}class _A{constructor(){this.states=new WeakMap}calcOffset(e){let n=0,r=0;if(e.parent&&([n,r]=this.calcOffset(e.parent)),!e.offset){const{left:o,top:a}=e.iFrame.getBoundingClientRect();e.offset=[o,a]}const[i,s]=e.offset;return[n+i,r+s]}getDocumentOffset(e){const n=this.states.get(e);return n?this.calcOffset(n):[0,0]}observe(e){var a;const n=e.contentDocument;if(!n)return;const r=e.ownerDocument,i=this.states.get(r),s={offset:null,iFrame:e,parent:i||null,clear:()=>{var l;r.removeEventListener("scroll",o),(l=r.defaultView)==null||l.removeEventListener("resize",o)}},o=()=>{s.offset=null};r.addEventListener("scroll",o),(a=r.defaultView)==null||a.addEventListener("resize",o),this.states.set(n,s)}clear(){this.states=new WeakMap}}var bo;(function(t){t[t.Unset=-1]="Unset",t[t.Disabled=0]="Disabled",t[t.Inline=1]="Inline",t[t.InlineFetched=2]="InlineFetched",t[t.PlainFetched=3]="PlainFetched"})(bo||(bo={}));const PA="https://docs.openreplay.com/en/troubleshooting/localhost/";function Du(t,e){switch(t){case bo.Inline:return{inlineRemoteCss:!0,inlinerOptions:{forceFetch:!1,forcePlain:!1}};case bo.InlineFetched:return{inlineRemoteCss:!0,inlinerOptions:{forceFetch:!0,forcePlain:!1}};case bo.PlainFetched:return{inlineRemoteCss:!0,inlinerOptions:{forceFetch:!0,forcePlain:!0}};case bo.Unset:return/^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?\/?/.test(window.location.href)?(e(`Enabling InlineCssMode.PlainFetched by default on localhost to preserve css styles, refer to ${PA} for details, set InlineCssMode to 0 to skip this behavior`),{inlineRemoteCss:!0,inlinerOptions:{forceFetch:!0,forcePlain:!0}}):{inlineRemoteCss:!1,inlinerOptions:{forceFetch:!1,forcePlain:!1}};case bo.Disabled:default:return{inlineRemoteCss:!1,inlinerOptions:{forceFetch:!1,forcePlain:!1}}}}const F0=kt?Element.prototype.attachShadow:()=>new ShadowRoot;class MA extends Ob{constructor(e){const n=Object.assign({captureIFrames:!0,disableSprites:!1,inl
10ineCss:0},e.options),r={disableSprites:n.disableSprites,disableThrottling:n.disableThrottling,...Du(n.inlineCss,console.warn)};super(e.app,!0,r),this.iframeOffsets=new _A,this.contextCallbacks=[],this.contextsSet=new WeakSet,this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.docObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.colorSchemeMQL=null,this.colorSchemeListener=null,this.app=e.app,this.options=n,this.app.nodes.attachNodeCallback(i=>{Nn(i,"iframe")&&(this.options.captureIFrames&&!js(i,"obscured")||js(i,"capture"))&&this.handleIframe(i)}),this.app.nodes.attachNodeCallback(i=>{li(i)&&i.shadowRoot!==null&&this.handleShadowRoot(i.shadowRoot)})}attachContextCallback(e){this.contextCallbacks.push(e)}getDocumentOffset(e){return this.iframeOffsets.getDocumentOffset(e)}handleIframe(e){const n=this.app.safe(()=>setTimeout(()=>{const r=this.app.nodes.getID(e);if(r===void 0||!CI(e))return;const i=e.contentWindow,s=e.contentDocument;if(!s){this.app.debug.warn("no doc for iframe found",e);return}if(s&&this.docObservers.has(s)){this.app.debug.info("doc already observed for",r);return}const o=new mw(this.app,!1,{disableSprites:this.options.disableSprites,...Du(this.options.inlineCss,console.warn)});this.iframeObservers.set(e,o),this.docObservers.set(s,o),this.iframeObserversArr.push(o),o.observe(e),this.iframeOffsets.observe(e),i&&i===i.window&&!this.contextsSet.has(i)&&(this.contextsSet.add(i),this.contextCallbacks.forEach(a=>a(i)))},250));e.addEventListener("load",n),n()}handleShadowRoot(e){const n=new NA(this.app,!1,{disableSprites:this.options.disableSprites,...Du(this.options.inlineCss,console.warn)});this.shadowRootObservers.set(e,n),n.observe(e.host)}observe(){var n,r;const e=this;Element.prototype.attachShadow=function(){const i=F0.apply(this,arguments);return e.handleShadowRoot(i),i},this.resetThrottledSetNodeData(),this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(AI()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement),this.sendColorScheme(),this.app.send(Gf(0,"orloaded","true")),kt&&window.matchMedia&&(this.colorSchemeMQL=window.matchMedia("(prefers-color-scheme: dark)"),this.colorSchemeListener=this.app.safe(()=>this.sendColorScheme()),(r=(n=this.colorSchemeMQL).addEventListener)==null||r.call(n,"change",this.colorSchemeListener))}sendColorScheme(){if(!kt)return;const e=document.documentElement;let n=getComputedStyle(e).colorScheme;if(!n||n==="normal"){const i=document.querySelector('meta[name="color-scheme" i]'),s=i&&i.getAttribute("content");s&&(n=s)}let r="normal";if(n&&n!=="normal"){const i=!!window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;r=n.includes("dark")&&(i||!n.includes("light"))?"dark":"light"}this.app.send(Gf(0,"__openreplay_color_scheme",r))}crossdomainObserve(e,n,r){const i=this;Element.prototype.attachShadow=function(){const o=F0.apply(this,arguments);return i.handleShadowRoot(o),o},this.app.nodes.clear(),this.app.nodes.crossdomainMode(r,n);const s=new mw(this.app,!1,{disableSprites:this.options.disableSprites,...Du(this.options.inlineCss,console.warn)});this.iframeObservers.set(window.document,s),s.syntheticObserve(e,window.document)}disconnect(){var e,n;this.colorSchemeMQL&&this.colorSchemeListener&&((n=(e=this.colorSchemeMQL).removeEventListener)==null||n.call(e,"change",this.colorSchemeListener)),this.colorSchemeMQL=null,this.colorSchemeListener=null,this.iframeOffsets.clear(),Element.prototype.attachShadow=F0,this.iframeObserversArr.forEach(r=>r.disconnect()),this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.docObservers=new WeakMap,super.disconnect()}}const Lu="_$_";class DA{constructor(e){this.metadata={},this.userID=null,this.callbacks=[],this.timestamp=0,this.getPageNumber=()=>{const n=this.app.sessionStorage.getItem(this.options.session_pageno_key);if(n!=null)return parseInt(n)},this.incPageNo=()=>{let n=this.getPageNumber();return n===void 0?n=0:n++,this.app.sessionStorage.setItem(this.options.session_pageno_key,n.toString()),n}
10,this.getSessionToken=n=>{const r=this.token||this.app.sessionStorage.getItem(this.options.session_token_key);if(n&&r){const s=r.split(Lu)[1];if(!s||s!==n){this.app.sessionStorage.removeItem(this.options.session_token_key),this.token=void 0;return}}return(r?r.split(Lu)[0]:null)||void 0},this.getRawTokenWithProject=()=>this.token||this.app.sessionStorage.getItem(this.options.session_token_key),this.setSessionToken=(n,r)=>{this.token=`${n}${Lu}${r}`,this.app.sessionStorage.setItem(this.options.session_token_key,`${n}${Lu}${r}`)},this.app=e.app,this.options=e.options,this.createTabId()}attachUpdateCallback(e){this.callbacks.push(e)}handleUpdate(e){e.userID==null&&delete e.userID,e.sessionID==null&&delete e.sessionID,this.callbacks.forEach(n=>n(e))}assign(e){e.userID!==void 0&&(this.userID=e.userID),e.metadata!==void 0&&Object.entries(e.metadata).forEach(([n,r])=>this.metadata[n]=r),e.sessionID!==void 0&&(this.sessionID=e.sessionID),e.timestamp!==void 0&&(this.timestamp=e.timestamp),e.projectID!==void 0&&(this.projectID=e.projectID),this.handleUpdate(e)}setMetadata(e,n){this.metadata[e]=n,this.handleUpdate({metadata:{[e]:n}})}setUserID(e){this.userID=e,this.handleUpdate({userID:e})}setUserInfo(e){this.userInfo=e}applySessionHash(e){const n=decodeURI(e).split("&");let r=e,i="100500";n.length==2&&([i,r]=n),!(!i||!r)&&(this.app.sessionStorage.setItem(this.options.session_token_key,r),this.app.sessionStorage.setItem(this.options.session_pageno_key,i))}getSessionHash(){const e=this.getPageNumber(),n=this.getRawTokenWithProject();if(!(e===void 0||n===void 0))return encodeURI(String(e)+"&"+n)}getTabId(){return this.tabId||this.createTabId(),this.tabId}regenerateTabId(){const e=xI(12);this.app.sessionStorage.setItem(this.options.session_tabid_key,e),this.tabId=e}createTabId(){const e=this.app.sessionStorage.getItem(this.options.session_tabid_key);e?this.tabId=e:this.regenerateTabId()}getInfo(){return{sessionID:this.sessionID,metadata:this.metadata,userID:this.userID,timestamp:this.timestamp,projectID:this.projectID}}reset(){this.app.sessionStorage.removeItem(this.options.session_token_key),this.metadata={},this.userID=null,this.sessionID=void 0,this.timestamp=0}}function LA(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class jA{constructor(e){this.app=e,this.timer=null,this.callbacks=[]}attach(e,n=0,r=!0,i){i&&(e=e.bind(i)),r&&(e=this.app.safe(e)),this.callbacks.unshift(n?LA(e,n):e)-1}start(){this.timer===null&&(this.timer=setInterval(()=>this.callbacks.forEach(e=>{e&&e()}),30))}stop(){this.timer!==null&&(clearInterval(this.timer),this.timer=null)}}const FA='!function(){"use strict";class t{constructor(t,s,i,e=10,n=250,h,r){this.onUnauthorised=s,this.onFailure=i,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.onCompress=h,this.pageNo=r,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.lastBatchNum=0,this.inflightKeepaliveBytes=0,this.ingestURL=t+"/v1/web/i",this.isCompressing=void 0!==h}getQueueStatus(){return 0===this.queue.length&&!this.busy}authorise(t){this.token=t,this.busy||this.sendNext()}push(t,s="player",i){if(this.busy||!this.token)this.queue.push({batch:t,dataType:s,split:i});else if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t,s,i);else{const e=++this.lastBatchNum;this.sendBatch(t,!1,e,s,i)}}sendNext(){const t=this.queue.shift();if(t)if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t.batch,t.dataType,t.split);else{const s=++this.lastBatchNum;this.sendBatch(t.batch,!1,s,t.dataType,t.split)}else this.busy=!1}retry(t,s,i,e="player",n){if(this.attemptsCount>=this.MAX_ATTEMPTS_COUNT)return void this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`);this.attemptsCount++;const h=new Uint8Array(t);setTimeout((()=>this.sendBatch(h,s,i,e,n)),this.ATTEMPT_TIMEOUT*this.attemptsCount)}sendBatch(t,s,i,e="player",n){var h,r,a;if(0===t.length)return console.error("OpenReplay: refusing to send 0-byte batch.",{batchNum:i,dataType:e,isCompressed:s,batch:t}),this.attemptsCount=0,void this.sendNext();const u=(null!==(h=null==i?void 0:i.toString())&&void 0!==h?h:"0").match(/^([^_]+)(?:_([^_]+))?/),o=null!==(r=null==u?void 0:u[1])&&void 0!==r?r:"0",l=(null==u?void 0:u[2])?u[2]:"";this.busy=!0;const c={Authorization:`Bearer ${this.token}`,DataType:e};if(s&&(c["Content-Encoding"]="gzip"),null===this.token)return void setTimeout((()=>{this.sendBatch(t,s,`${null!=i?i:"noBatchNum"}_newToken`,e,n)}),500);const d=t.length<65536&&this.inflightKeepaliveBytes+t.length<=65536;d&&(this.inflightKeepaliveBytes+=t.length);const p=()=>{d&&(this.inflightKeepaliveBytes-=t.length)},f=t.byteLength;let g=this.ingestURL;g+=`?batch=${null!==(a=this.pageNo)&&void 0!==a?a:0}`,g+=`_${o}`,g+=`_${f}`,g+="_"+(d?"kyes":"kno"),l&&(g+=`_${l}`),void 0!==n&&(g+=`&split=${n}`),fetch(g,{body:t,method:"POST",headers:c,keepalive:d}).then((h=>{var r;if(p(),null===(r=h.body)||void 0===r||r.cancel().catch((()=>{})),401===h.status)return this.busy=!1,void this.onUnauthorised();h.status>=400?this.retry(t,s,`${null!=i?i:"noBatchNum"}_network:${h.status}`,e,n):(this.attemptsCount=0,this.sendNext())})).catch((h=>{p(),console.warn("OpenReplay:",h),this.retry(t,s,`${null!=i?i:"noBatchNum"}_reject:${h.message}`,e,n)}))}sendCompressed(t,s="player",i){const e=++this.lastBatchNum;this.sendBatch(t,!0,e,s,i)}sendUncompressed(t,s="player",i){const e=++this.lastBatchNum;this.sendBatch(t,!1,e,s,i)}clean(){this.sendNext(),setTimeout((()=>{this.token=null,this.queue.length=0}),10)}}const s=new Set([60,61,71,73]),i=new Set([21,22,40,41,44,45,46,47,48,79,83,84,85,87,89,116,120,121,123]),e=new Set([17,23,24,27,28,29,30,42,63,64,78,112,115,124]),n="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let e=-1;for(let n=0,h=0,r=0;r!==s;){if(n=t.charCodeAt(r),r+=1,n>=55296&&n<=56319){if(r===s){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;break}if(h=t.charCodeAt(r),!(h>=56320&&h<=57343)){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;continue}
10if(n=1024*(n-55296)+h-56320+65536,r+=1,n>65535){i[e+=1]=240|n>>>18,i[e+=1]=128|n>>>12&63,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n;continue}}n<=127?i[e+=1]=0|n:n<=2047?(i[e+=1]=192|n>>>6,i[e+=1]=128|63&n):(i[e+=1]=224|n>>>12,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n)}return i.subarray(0,e+1)}};class h{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}getCurrentCheckpoint(){return this.checkpointOffset}checkpoint(){this.checkpointOffset=this.offset}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,s){this.data.set(t,s)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const s=n.encode(t),i=s.byteLength;return!(!this.uint(i)||this.offset+i>this.size)&&(this.data.set(s,this.offset),this.offset+=i,!0)}reset(){this.offset=0,this.checkpointOffset=0}rewind(t,s){t>this.offset||s>this.checkpointOffset||(this.offset=t,this.checkpointOffset=s)}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}class r extends h{encode(t){switch(t[0]){case 0:case 11:case 114:case 115:return this.uint(t[1]);case 4:case 44:case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:case 20:case 65:case 70:case 75:case 76:case 77:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:case 24:case 35:case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 12:case 52:case 61:case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:case 17:case 34:case 36:case 50:case 54:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:case 27:case 30:case 41:case 45:case 46:case 43:case 63:case 64:case 79:case 124:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 28:case 29:case 42:case 117:case 118:return this.string(t[1]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.int(t[5]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 55:return this.boolean(t[1]);case 57:case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:case 120:return this.int(t[1]);case 68:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 83:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 84:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6]);case 85:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10])&&this.uint(t[11])&&this.uint(t[12])&&this.uint(t[13])&&this.uint(t[14])&&this.uint(t[15])&&this.uint(t[16])&&this.uint(t[17]);case 87:return this.string(t[1])&&this.int(t[2])&&this.int(t[3]);case 89:return this.string(t[1])&&this.int(t[2])&&this.int(t[3])&&this.int(t[4])&&this.int(t[5])&&this.string(t[6]);case 112:return this.uint(t[1])&&this.string(t[2])&&this.boolean(t[3])&&this.string(t[4])&&this.int(t[5])&&this.int(t[6]);case 113:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3]);case 116:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10]);case 119:return this.string(t[1])&&this.uint(t[2]);case 121:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 122:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 123:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])}}}class a{constructor(t,s,i){this.bufferSize=t,this.version=s,this.dataType=i,this.sizeBuffer=new Uint8Array(3),this.snap=null,this.hasNonTimestamp=!1,this.lastPushedTs=0,this.encoder=new r(t)}push(t,s){const i=this.encoder,e=null===this.snap,n=i.getCurrentOffset(),h=i.getCurrentCheckpoint();if(e){const t={pageNo:s.pageNo,firstIndex:s.index,timestamp:s.timestamp,url:s.url,tabId:s.tabId};if(!this.writeHeader(t))return i.rewind(n,h),!1;this.snap=t,this.lastPushedTs=s.timestamp}return 0===t[0]||s.timestamp===this.lastPushedTs||this.writeMessageWithSize([0,s.timestamp])?this.writeMessageWithSize(t)?(this.lastPushedTs=s.timestamp,0!==t[0]&&(this.hasNonTimestamp=!0),!0):(i.rewind(n,h),e&&(this.snap=null),!1):(i.rewind(n,h),!1)}hasContent(){return null!==this.snap&&this.hasNonTimestamp}size(){return null===this.snap?0:this.encoder.getCurrentOffset()}flush(){if(!this.hasContent())return this.reset(),null;const t=this.encoder.flush();return this.snap=null,this.hasNonTimestamp=!1,this.lastPushedTs=0,t}reset(){this.encoder.reset(),this.snap=null,this.hasNonTimestamp=!1,this.lastPushedTs=0}writeHeader(t){const s=this.encoder,i=[81,this.version,t.pageNo,t.firstIndex,t.timestamp,t.url];return!!s.uint(i[0])&&(!!s.encode(i)&&(!(s.getCurrentOffset()>this.bufferSize)&&(s.checkpoint(),!!this.writeMessageWithSize([0,t.timestamp])&&!!this.writeMessageWithSize([118,t.tabId])
10)))}writeMessageWithSize(t){const s=this.encoder;if(!s.uint(t[0])||!s.skip(3))return!1;const i=s.getCurrentOffset();if(!s.encode(t))return!1;const e=s.getCurrentOffset(),n=e-i;return n>16777215?(console.warn("OpenReplay: max message size overflow."),!1):!(e>this.bufferSize)&&(this.writeSizeAt(n,i-3),s.checkpoint(),!0)}writeSizeAt(t,s){for(let s=0;s<3;s++)this.sizeBuffer[s]=t>>8*s;this.encoder.set(this.sizeBuffer,s)}}class u{constructor(t,s,i,e,n,h,r=!1,u){this.pageNo=t,this.timestamp=s,this.url=i,this.onBatch=e,this.tabId=n,this.onOfflineEnd=h,this.localDebug=r,this.onLocalSave=u,this.nextIndex=0,this.beaconSize=2e5,this.beaconSizeLimit=1e6,this.protocolVersion=1,this.visualSent=!1,this.signalSeen=!1,this.heldOther=[],this.playerBuilder=new a(this.beaconSize,this.playerVersion(),"player"),this.assetBuilder=new a(this.beaconSize,3,"assets"),this.devtoolsBuilder=new a(this.beaconSize,4,"devtools"),this.analyticsBuilder=new a(this.beaconSize,5,"analytics")}initActive(){return 2===this.protocolVersion&&!this.visualSent}playerVersion(){return 2===this.protocolVersion?2:1}currentCtx(){return{pageNo:this.pageNo,index:this.nextIndex,timestamp:this.timestamp,url:this.url,tabId:this.tabId}}setBeaconSizeLimit(t){this.beaconSizeLimit=t}setProtocolVersion(t){if(this.protocolVersion!==t){if(this.protocolVersion=t,2===t&&!this.signalSeen)return this.playerBuilder.reset(),this.assetBuilder.reset(),this.playerBuilder=new a(this.beaconSizeLimit,this.playerVersion(),"player"),void(this.assetBuilder=new a(this.beaconSizeLimit,3,"assets"));2===t&&(this.visualSent=!0),this.playerBuilder.reset(),this.playerBuilder=new a(this.beaconSize,this.playerVersion(),"player")}}writeMessage(t){if(-1===t[0])return this.finaliseBatch(),this.onOfflineEnd();if(12===t[0]&&"orloaded"===t[2])return void(this.initActive()?this.finalizeVisual():this.signalSeen=!0);0===t[0]&&(this.timestamp=t[1]),122===t[0]&&(this.url=t[1]);const s=this.routeMessage(t);this.pushTo(s,t)}routeMessage(t){if(2===this.protocolVersion){const n=t[0];if(s.has(n))return this.assetBuilder;if(i.has(n))return this.devtoolsBuilder;if(e.has(n))return this.analyticsBuilder}return this.playerBuilder}pushTo(t,s){const i=this.currentCtx();if(this.initActive())return void this.pushDuringInit(t,s,i);if(t.push(s,i))return void this.nextIndex++;if(t===this.assetBuilder&&this.flushBuilder(this.playerBuilder),this.flushBuilder(t),t.push(s,i))return void this.nextIndex++;const e=new a(this.beaconSizeLimit,t.version,t.dataType);if(!e.push(s,i))return void console.warn("OpenReplay: beacon size overflow. Skipping large message.",s);this.nextIndex++;const n=e.flush();n&&(t===this.assetBuilder&&this.flushBuilder(this.playerBuilder),this.emitBatch(n,t.dataType,!1))}pushDuringInit(t,s,i){const e=t===this.playerBuilder||t===this.assetBuilder;if(t.push(s,i))return this.nextIndex++,void(e&&this.playerBuilder.size()+this.assetBuilder.size()>=this.beaconSizeLimit&&this.finalizeVisual());if(e)return this.finalizeVisual(),void this.pushTo(this.routeMessage(s),s);if(this.flushBuilderToHeld(t),t.push(s,i))return void this.nextIndex++;const n=new a(this.beaconSizeLimit,t.version,t.dataType);if(!n.push(s,i))return void console.warn("OpenReplay: beacon size overflow. Skipping large message.",s);this.nextIndex++;const h=n.flush();h&&this.heldOther.push({batch:h,dataType:t.dataType})}flushBuilderToHeld(t){const s=t.flush();s&&this.heldOther.push({batch:s,dataType:t.dataType})}finalizeVisual(t=!1){const s=this.playerBuilder.flush(),i=this.assetBuilder.flush();if(this.visualSent=!0,this.playerBuilder=new a(this.beaconSize,this.playerVersion(),"player"),this.assetBuilder=new a(this.beaconSize,3,"assets"),s&&i){const e=new Uint8Array(s.length+i.length);e.set(s,0),e.set(i,s.length),this.emitBatch(e,"visual",t,s.length)}else s?this.emitBatch(s,"visual",t):i&&this.emitBatch(i,"assets",t);for(const s of this.heldOther)this.emitBatch(s.batch,s.dataType,t);this.heldOther.length=0,this.flushBuilder(this.devtoolsBuilder,t),this.flushBuilder(this.analyticsBuilder,t)}flushBuilder(t,s=!1){const i=t.flush();return!!i&&(this.emitBatch(i,t.dataType,s),!0)}emitBatch(t,s,i,e){this.localDebug&&this.onLocalSave&&this.onLocalSave(`${s}-${Date.now()}`,t.slice()),this.onBatch(t,i,s,e)}finaliseBatch(t=!1){this.initActive()?this.finalizeVisual(t):(this.flushBuilder(this.playerBuilder,t),this.flushBuilder(this.assetBuilder,t),this.flushBuilder(this.devtoolsBuilder,t),this.flushBuilder(this.analyticsBuilder,t))}clean(){this.playerBuilder.reset(),this.assetBuilder.reset(),this.devtoolsBuilder.reset(),this.analyticsBuilder.reset(),this.heldOther.length=0,this.visualSent=!1,this.signalSeen=!1}}var o;
10!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active",t[t.Stopped=4]="Stopped"}(o||(o={}));let l=null,c=null,d=o.NotActive;function p(t){c&&c.finaliseBatch(t)}function f(){return new Promise((t=>{d=o.Stopping,null!==y&&(clearInterval(y),y=null),c&&(c.clean(),c=null),l&&(l.clean(),setTimeout((()=>{l=null}),20)),setTimeout((()=>{d=o.NotActive,t(null)}),100)}))}function g(){[o.Stopped,o.Stopping].includes(d)||(postMessage("a_stop"),f().then((()=>{postMessage("a_start")})))}let m,y=null;self.onmessage=({data:s})=>{var i;if("stop"===s)return p(),void f().then((()=>{d=o.Stopped}));if("forceFlushBatch"!==s)if("closing"!==s){if(!Array.isArray(s)){if("compressed"===s.type){if(!l)return console.debug("OR WebWorker: sender not initialised. Compressed batch."),void g();s.batch&&l.sendCompressed(s.batch,s.dataType,s.split)}if("uncompressed"===s.type){if(!l)return console.debug("OR WebWorker: sender not initialised. Uncompressed batch."),void g();s.batch&&l.sendUncompressed(s.batch,s.dataType,s.split)}return"start"===s.type?(d=o.Starting,l=new t(s.ingestPoint,(()=>{g()}),(t=>{!function(t){postMessage({type:"failure",reason:t}),f()}(t)}),s.connAttemptCount,s.connAttemptGap,((t,s,i)=>{postMessage({type:"compress",batch:t,dataType:s,split:i},[t.buffer])}),s.pageNo),c=new u(s.pageNo,s.timestamp,s.url,((t,s,i="player",e)=>{l&&(s?l.sendUncompressed(t,i,e):l.push(t,i,e))}),s.tabId,(()=>postMessage({type:"queue_empty"})),null!==(i=s.localDebug)&&void 0!==i&&i,((t,s)=>{postMessage({type:"local_save",name:t,batch:s},[s.buffer])})),null===y&&(y=setInterval(p,3e4)),d=o.Active):"auth"===s.type?l?c?(l.authorise(s.token),s.beaconSizeLimit&&c.setBeaconSizeLimit(s.beaconSizeLimit),void(s.protocolVersion&&c.setProtocolVersion(s.protocolVersion))):(console.debug("OR WebWorker: writer not initialised. Received auth."),void g()):(console.debug("OR WebWorker: sender not initialised. Received auth."),void g()):void 0}if(c){const t=c;s.forEach((s=>{55===s[0]&&(s[1]?m=setTimeout((()=>g()),18e5):clearTimeout(m)),t.writeMessage(s)}))}else postMessage("not_init"),g()}else p(!0);else p()}}();\n',vc="canceled",B0="or_buffer_1",As=t=>({reason:t,success:!1}),gw=t=>({...t,success:!0});var xn;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(xn||(xn={}));const BA="https://api.openreplay.com/ingest";function H0(){const t=new Date().getTimezoneOffset()*-1,e=t>=0?"+":"-",n=Math.floor(Math.abs(t)/60),r=Math.abs(t)%60;return`UTC${e}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}const HA=t=>new Promise(e=>setTimeout(e,t)),Ht={ask:"never-gonna-give-you-up",resp:"never-gonna-let-you-down",reg:"never-gonna-run-around-and-desert-you",iframeSignal:"tracker inside a child iframe",iframeId:"getting node id for child iframe",iframeBatch:"batch of messages from an iframe window",parentAlive:"signal that parent is live",killIframe:"stop tracker inside frame",startIframe:"start tracker inside frame",iframeDebug:"iframe debug snapshot",polling:"hello-how-are-you-im-under-the-water-please-help-me",reset:"reset-your-session-please"},zA=Object.fromEntries(Object.entries(Ht).map(([t,e])=>[e,t]));class qA{get tagMatcher(){return this.tagWatcher.matcher}constructor(e,n,r,i,s){var l,c,d;this.signalError=i,this.insideIframe=s,this.resanitizeCallbacks=[],this.messages=[],this.bufferedMessages1=[],this.bufferedMessages2=[],this.startCallbacks=[],this.stopCallbacks=[],this.commitCallbacks=[],this.activityState=xn.NotActive,this.version="18.1.2",this.socketMode=!1,this.compressionThreshold=24*1e3,this.bc=null,this.canvasRecorder=null,this.conditionsManager=null,this.canStart=!1,this.rootId=null,this.pageFrames=[],this.frameOderNumber=0,this.frameLevel=0,this.emptyBatchCounter=0,this.lastHiddenAt=null,this.parentActive=!1,this.checkStatus=()=>this.parentActive,this.lastTokenReceived=null,this.lastParentMsgAt=0,this.lastSentToParentAt=0,this.iframeDebugInterval=null,this.emitIframeDebug=()=>{var v,b;if(!this.insideIframe||!((v=this.options.crossdomain)!=null&&v.enabled))return;const u=Date.now(),f=w=>w?u-w:null,h={ctx:this.contextId,active:this.active(),state:xn[this.activityState],parentActive:this.parentActive,rootId:this.rootId,frameOrder:this.frameOderNumber,token:this.lastTokenReceived?{tok:this.lastTokenReceived.tok,agoMs:u-this.lastTokenReceived.at}:null,lastParentMsgAgoMs:f(this.lastParentMsgAt),lastSentToParentAgoMs:f(this.lastSentToParentAt)},p=JSON.stringify(h);let g;
10try{g=btoa(p)}catch{g=p}try{window.parent.postMessage({line:Ht.iframeDebug,context:this.contextId,debug:g},((b=this.options.crossdomain)==null?void 0:b.parentDomain)??"*"),this.markSentToParent()}catch(w){this.debug.error("iframe debug post failed",w)}},this.parentCrossDomainFrameListener=u=>{const{data:f}=u;if(!(!f||u.source===window)){if((f.line===Ht.startIframe||f.line===Ht.parentAlive||f.line===Ht.iframeId||f.line===Ht.killIframe)&&(this.lastParentMsgAt=Date.now()),f.line===Ht.startIframe){if(this.activityState===xn.Starting)return;try{this.active()&&this.stop(),f.token&&(this.session.setSessionToken(f.token,this.projectKey),this.lastTokenReceived={tok:String(f.token).slice(-8),at:Date.now()}),f.id!==void 0&&(this.rootId=f.id),this.allowAppStart(),this.start()}catch{}}f.line===Ht.parentAlive&&(this.parentActive=!0),f.line===Ht.iframeId&&(this.parentActive=!0,this.rootId=f.id,this.session.setSessionToken(f.token,this.projectKey),this.lastTokenReceived={tok:String(f.token).slice(-8),at:Date.now()},this.frameOderNumber=f.frameOrderNumber,this.frameLevel=f.frameLevel,this.debug.log("starting iframe tracking",f),this.allowAppStart()),f.line===Ht.killIframe&&this.active()&&this.stop()}},this.trackedFrames=[],this.everTrackedFrames=new Set,this.frameLastSeen=new Map,this.frameOrigin=new Map,this.frameAnyLastSeen=new Map,this.frameBatchLastSeen=new Map,this.frameLastSent=new Map,this.xdomainDebugInterval=null,this.reAdoptCooldown=new Map,this.RE_ADOPT_COOLDOWN_MS=2e3,this.frameAlloc=new Map,this.usedOrdersByLevel=new Map,this.FRAME_STALE_MS=1500,this.XDOMAIN_DEBUG_RETENTION_MS=10*6e4,this.emitCrossdomainDebug=()=>{var x,R;if(this.insideIframe||!((x=this.options.crossdomain)!=null&&x.enabled)||!this.active())return;const u=Date.now(),f=O=>O===void 0?null:u-O,h=new Set(this.trackedFrames),p=new Set([...this.trackedFrames,...this.frameAnyLastSeen.keys(),...this.frameLastSent.keys()]),g=Array.from(p).map((O,T)=>{const S=this.frameLastSent.get(O),_=this.frameAlloc.get(O);return{n:_?_.order:T+1,level:_?_.level:null,id:this.frameOrigin.get(O)||O||`#${T+1}`,tracked:h.has(O),lastAnyMsgAgoMs:f(this.frameAnyLastSeen.get(O)),lastBatchAgoMs:f(this.frameBatchLastSeen.get(O)),lastSent:S?{line:S.line,agoMs:u-S.t}:null}}),v=u-this.XDOMAIN_DEBUG_RETENTION_MS;for(const O of p){if(h.has(O))continue;const T=this.frameAnyLastSeen.get(O)??0,S=((R=this.frameLastSent.get(O))==null?void 0:R.t)??0;Math.max(T,S)<v&&(this.frameOrigin.delete(O),this.frameAnyLastSeen.delete(O),this.frameBatchLastSeen.delete(O),this.frameLastSent.delete(O),this.reAdoptCooldown.delete(O),this.everTrackedFrames.delete(O),this.freeFrameOrder(O))}const b={t:u,count:g.length,frames:g},w=JSON.stringify(b);let C;try{C=btoa(w)}catch{C=w}this.send(d1("info",`[OR_XDOMAIN_DEBUG] ${C}`))},this.crossDomainIframeListener=u=>{var h,p;if(u.source===window)return;const{data:f}=u;if(f&&(f.context&&(this.frameAnyLastSeen.set(f.context,Date.now()),u.origin&&!this.frameOrigin.has(f.context)&&this.frameOrigin.set(f.context,u.origin)),(f.line===Ht.polling||f.line===Ht.iframeSignal)&&f.context&&this.frameLastSeen.set(f.context,Date.now()),!!this.active())){if(f.line===Ht.iframeDebug){this.send(d1("info",`[OR_XDOMAIN_IFRAME_DEBUG] ${f.debug}`));return}if(f.line===Ht.iframeSignal&&((h=u.source)==null||h.postMessage({ping:!0,line:Ht.parentAlive},"*"),this.recordSentToFrame(f.context,Ht.parentAlive),(async()=>{var b;if(u.source===null)return;const v=await this.checkNodeId(u.source);if(!v){this.debug.log("Couldnt get node id for iframe",u.source);return}try{this.trackedFrames.includes(f.context)?this.debug.log("Trying to observe already added iframe; ignore if its a restart"):this.trackedFrames.push(f.context),this.everTrackedFrames.add(f.context),await this.waitStarted();const w=this.session.getSessionToken(this.projectKey),C=this.frameLevel+1,x=this.allocateFrameOrder(f.context,C),R={line:Ht.iframeId,id:v,token:w,frameOrderNumber:x,frameLevel:C};this.debug.log("Got child frame signal; nodeId",v,u.source,R),(b=u.source)==null||b.postMessage(R,"*"),this.recordSentToFrame(f.context,Ht.iframeId)}catch{}})()),f.line===Ht.iframeBatch){f.context&&this.frameBatchLastSeen.set(f.context,Date.now());const g=f.messages,v=[];g.forEach(b=>{if(b[0]===20){let w=b;
10this.pageFrames.forEach(C=>{if(C.contentWindow===u.source){const[x,R,O]=b,{left:T,top:S}=C.getBoundingClientRect();w=[x,R+T,O+S]}}),v.push(w)}if(b[0]===68){let w=b;this.pageFrames.forEach(C=>{if(C.contentWindow===u.source){const[x,R,O,T,S,_,A]=b,{left:$,top:E,width:I,height:D}=C.getBoundingClientRect(),B=document.documentElement.scrollWidth,j=document.documentElement.scrollHeight,z=_/100*I+$,q=A/100*D+E,ne=z/B,Z=q/j;w=[x,R,O,T,S,Math.round(ne*1e3)/10,Math.round(Z*1e3)/10]}}),v.push(w)}[28,29,30].includes(b[0])||v.push(b)}),this.messages.push(...v)}if(f.line===Ht.polling){if(f.context&&this.everTrackedFrames.has(f.context)&&!this.trackedFrames.includes(f.context)){this.reAdoptOrphanFrame(u,f.context);return}if(!this.pollingQueue.order.length)return;this.pruneStaleFrames();const g=new Set(this.trackedFrames);for(;this.pollingQueue.order.length>0;){const b=this.pollingQueue.order[0];if(this.pollingQueue[b]=this.pollingQueue[b].filter(w=>g.has(w)),this.pollingQueue[b].length===0)delete this.pollingQueue[b],this.pollingQueue.order.shift();else break}if(!this.pollingQueue.order.length)return;const v=this.pollingQueue.order[0];if(this.pollingQueue[v].includes(f.context)){this.pollingQueue[v]=this.pollingQueue[v].filter(w=>w!==f.context);const b={line:v};if(v===Ht.startIframe){b.token=this.session.getSessionToken(this.projectKey);const w=this.pageFrames.find(C=>C.contentWindow===u.source)||Array.from(document.querySelectorAll("iframe")).find(C=>C.contentWindow===u.source);if(w){const C=w[this.options.node_id];C!==void 0&&(b.id=C)}}(p=u.source)==null||p.postMessage(b,"*"),this.recordSentToFrame(f.context,v),this.pollingQueue[v].length===0&&(delete this.pollingQueue[v],this.pollingQueue.order.shift())}}}},this.pollingQueue={order:[]},this.addCommand=u=>{if(this.pruneStaleFrames(),this.pollingQueue[u]){this.pollingQueue[u]=Array.from(new Set([...this.pollingQueue[u],...this.trackedFrames]));return}this.pollingQueue.order.push(u),this.pollingQueue[u]=[...this.trackedFrames]},this.bootChildrenFrames=async()=>{await this.waitStarted(),this.addCommand(Ht.startIframe)},this.killChildrenFrames=()=>{this.addCommand(Ht.killIframe)},this.signalIframeTracker=()=>{var w;const u=this.session.getTabId();window.parent.postMessage({line:Ht.iframeSignal,source:u,context:this.contextId},((w=this.options.crossdomain)==null?void 0:w.parentDomain)??"*"),this.markSentToParent();const f=10;let h=0,p=250,g=0,v=!1;const b=()=>{var C;if(v||this.checkStatus()){v=!0;return}window.parent.postMessage({line:Ht.iframeSignal,source:u,context:this.contextId},((C=this.options.crossdomain)==null?void 0:C.parentDomain)??"*"),this.markSentToParent(),this.debug.info("Trying to signal to parent, attempt:",h+1),h++};for(let C=0;C<f;C++){if(this.checkStatus()){v=!0;break}g+=p,setTimeout(()=>{b()},g),p*=1.5}},this.startTimeout=null,this.restart=(u=!1)=>{this.stop(!1),this.waitStatus(xn.NotActive).then(()=>{this.allowAppStart();const f=u?{...this.prevOpts,forceNew:!0}:this.prevOpts;this.start(f,!0).then(h=>{u&&(this.prevOpts={...this.prevOpts,forceNew:!1}),this.debug.info("Session restart",h)}).catch(h=>{this.debug.error("Session restart failed",h)})})},this.handlePageShow=u=>{if(!(!u||!u.persisted)&&this.activityState!==xn.NotActive)try{const f=this.lastHiddenAt!=null?Date.now()-this.lastHiddenAt:null;this.lastHiddenAt=null;const h=this.options.bfcacheRestartThreshold??1800*1e3;f===null||f>=h?(this.debug.info("OpenReplay: restarting session after bfcache restore",{frozenMs:f}),this.restart(!0)):this.debug.info("OpenReplay: resuming session after bfcache restore",{frozenMs:f})}catch(f){this._debug("bfcache_restore",f)}},this.send=(u,f=!1)=>{var h;this.activityState!==xn.NotActive&&(this.activityState===xn.ColdStart?(this.bufferedMessages1.push(u),this.singleBuffer||this.bufferedMessages2.push(u),(h=this.conditionsManager)==null||h.processMessage(u)):this.messages.push(u),this.activityState===xn.Active&&f&&this.commit())},this.coldStartCommitN=0,this.delay=0,this.attachStartCallback=(u,f=!1)=>{f&&(u=this.safe(u)),this.startCallbacks.push(u)},this.attachStopCallback=(u,f=!1)=>{f&&(u=this.safe(u)),this.stopCallbacks.push(u)},this.attachEventListener=(u,f,h,p=!0,g=!0)=>{p&&(h=this.safe(h));const v=()=>u?S$(u,f,h,g,this.options.forceNgOff):null,b=()=>u?C$(u,f,h,g,this.options.forceNgOff):null;this.attachStartCallback(v,p),this.attachStopCallback(b,p)},this.coldInterval=null,this.orderNumber=0,this.coldStartTs=0,this.singleBuffer=!1,this.onSessionSent=()=>{},this.prevOpts={},this.restartCanvasTracking=()=>{var u;(u=this.canvasRecorder)==null||u.restartTracking()},this.attachResanitizeCallback=u=>{this.resanitizeCallbacks.push(u)},this.callResanitizeCallbacks=(u,f)=>{this.resanitizeCallbacks.forEach(h=>h(u,f))},this.resanitize=u=>{const f=u??(kt?document.documentElement:void 0);f&&this.observer.resanitizeSubtree(f)},this.checkSanitization=u=>{const f=this.nodes.getID(u);if(f!==void 0)return this.sanitizer.getLevel(f)},this.flushBuffer=async u=>new Promise((f,h)=>
10{if(u.length===0){f(null);return}let p=1;for(;p<u.length&&u[p][0]!==0;)p++;J2(()=>{try{const g=u.splice(0,p);this.postToWorker(g.map(v=>[...v])),f(null)}catch(g){this._debug("flushBuffer",g),h(new Error("flushBuffer failed"))}})}),this.contextId=Math.random().toString(36).slice(2),this.projectKey=e,this.networkOptions=r.network;const o={revID:"",node_id:"__openreplay_id",session_token_key:"__openreplay_token",session_pageno_key:"__openreplay_pageno",session_reset_key:"__openreplay_reset",session_tabid_key:"__openreplay_tabid",local_uuid_key:"__openreplay_uuid",ingestPoint:BA,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:ul.Silent,__local_debug:!1,localStorage:null,sessionStorage:null,forceSingleTab:!1,bfcacheRestartThreshold:1800*1e3,assistSocketHost:"",captureIFrames:!0,obscureTextEmails:!1,obscureTextNumbers:!1,disableStringDict:!1,crossdomain:{parentDomain:"*"},canvas:{disableCanvas:!1,fixedCanvasScaling:!1,__save_canvas_locally:!1,useAnimationFrame:!1},forceNgOff:!1,inlineCss:bo.Unset,disableSprites:!1,disableThrottling:!1};if(this.options=x$(o,r),!this.insideIframe&&!this.options.forceSingleTab&&globalThis&&"BroadcastChannel"in globalThis){const u=location.hostname.split(".").slice(-2).join("_");this.bc=new BroadcastChannel(`rick_${u}`)}else this.options.forceSingleTab&&this.allowAppStart();this.revID=this.options.revID,this.localStorage=this.options.localStorage??window.localStorage,this.sessionStorage=this.options.sessionStorage??window.sessionStorage,this.sanitizer=new IA({app:this,options:r}),this.nodes=new $A({node_id:this.options.node_id,forceNgOff:!!r.forceNgOff,maintainer:(l=this.options.nodes)==null?void 0:l.maintainer}),this.observer=new MA({app:this,options:r}),this.ticker=new jA(this),this.ticker.attach(()=>this.commit()),this.debug=new hA(this.options.__debug__),this.session=new DA({app:this,options:this.options}),this.attributeSender=new vI({app:this,isDictDisabled:!!(this.options.disableStringDict||(c=this.options.crossdomain)!=null&&c.enabled)}),this.tagWatcher=new aA({sessionStorage:this.sessionStorage,errLog:this.debug.error,onTag:u=>this.send(eA(u))}),this.session.attachUpdateCallback(({userID:u,metadata:f})=>{if(u!=null){if(!u||typeof u!="string"||u.trim().length===0){this.debug.warn("Invalid userID (must be type string), ignoring.");return}this.send(jI(u))}f!=null&&Object.entries(f).forEach(([h,p])=>this.send(rw(h,p)))}),n!=null&&this.session.applySessionHash(n);const a=this.session.getTabId();this.insideIframe?(window.addEventListener("message",this.parentCrossDomainFrameListener),window.addEventListener("message",this.crossDomainIframeListener),setInterval(()=>{var u;window.parent.postMessage({line:Ht.polling,context:this.contextId},((u=r.crossdomain)==null?void 0:u.parentDomain)??"*"),this.markSentToParent()},250),this.iframeDebugInterval&&clearInterval(this.iframeDebugInterval),this.iframeDebugInterval=setInterval(this.emitIframeDebug,6e4)):(this.initWorker(),window.addEventListener("message",this.crossDomainIframeListener),(d=this.options.crossdomain)!=null&&d.enabled&&(this.xdomainDebugInterval&&clearInterval(this.xdomainDebugInterval),this.xdomainDebugInterval=setInterval(this.emitCrossdomainDebug,6e4))),this.bc!==null&&(this.bc.postMessage({line:Ht.ask,source:a,context:this.contextId,projectKey:this.projectKey}),this.startTimeout=setTimeout(()=>{this.allowAppStart()},250),this.bc.onmessage=u=>{if(u.data.context===this.contextId||this.projectKey!==u.data.projectKey){this.debug.log("same ctx event",u);return}if(this.debug.log(u),u.data.line===Ht.resp){const f=u.data.token;this.session.setSessionToken(f,this.projectKey),this.adoptSessionVersion(u.data.version),this.allowAppStart()}if(u.data.line===Ht.reg){const f=u.data.token;this.session.regenerateTabId(),this.session.setSessionToken(f,this.projectKey),this.adoptSessionVersion(u.data.version),this.allowAppStart()}if(u.data.line===Ht.ask){const f=this.session.getSessionToken(this.projectKey);f&&this.bc&&this.bc.postMessage({line:u.data.source===a?Ht.reg:Ht.resp,token:f,version:this.getSessionVersionHash(),source:a,context:this.contextId,projectKey:this.projectKey})}if(u.data.line===Ht.reset){const f=u.data.token;this.debug.log("Received reset signal from another tab"),this.session.setSessionToken(f,this.projectKey),this.restart()}})}markSentToParent(){this.lastSentToParentAt=Date.now()}allocateFrameOrder(e,n){const r=this.frameAlloc.get(e);if(r!==void 0)return r.order;let i=this.usedOrdersByLevel.get(n);i||(i=new Set,this.usedOrdersByLevel.set(n,i));let s=-1;for(let o=1;o<=Xf;o++)if(!i.has(o)){s=o;break}if(s===-1){let o=null,a=1/0;const l=new Set(this.trackedFrames);this.frameAlloc.forEach((c,d)=>
10{if(c.level!==n||l.has(d))return;const u=this.frameAnyLastSeen.get(d)??0;u<a&&(a=u,o=d)}),o!==null?(s=this.frameAlloc.get(o).order,this.frameAlloc.delete(o),this.debug.error("OR: frame order space exhausted, evicting",o,"for",e)):(s=Xf,this.debug.error("OR: frame order overflow, reusing max order for",e))}return i.add(s),this.frameAlloc.set(e,{order:s,level:n}),s}freeFrameOrder(e){var r;const n=this.frameAlloc.get(e);n&&(this.frameAlloc.delete(e),(r=this.usedOrdersByLevel.get(n.level))==null||r.delete(n.order))}pruneStaleFrames(){const e=Date.now()-this.FRAME_STALE_MS;this.trackedFrames=this.trackedFrames.filter(n=>{const r=this.frameLastSeen.get(n);return r!==void 0&&r>=e?!0:(this.frameLastSeen.delete(n),!1)})}recordSentToFrame(e,n){e&&this.frameLastSent.set(e,{line:zA[n]??n,t:Date.now()})}reAdoptOrphanFrame(e,n){var a;const r=Date.now(),i=this.reAdoptCooldown.get(n)??0;if(r-i<this.RE_ADOPT_COOLDOWN_MS)return;this.reAdoptCooldown.set(n,r);const s={line:Ht.startIframe,token:this.session.getSessionToken(this.projectKey)},o=this.pageFrames.find(l=>l.contentWindow===e.source)||Array.from(document.querySelectorAll("iframe")).find(l=>l.contentWindow===e.source);if(o){const l=o[this.options.node_id];l!==void 0&&(s.id=l)}(a=e.source)==null||a.postMessage(s,"*"),this.recordSentToFrame(n,Ht.startIframe),this.debug.log("Re-adopting orphaned crossdomain iframe",n)}allowAppStart(){this.canStart=!0,this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkNodeId(e){let n;if(this.pageFrames.length>0&&(n=this.pageFrames.find(i=>i.contentWindow===e)),!n||!this.pageFrames.length){const i=Array.from(document.querySelectorAll("iframe"));this.pageFrames=i,n=i.find(s=>s.contentWindow===e)}if(!n)return null;let r=0;for(;r<100;){const i=n[this.options.node_id];if(i!==void 0)return r=100,i;r++,await HA(100)}return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob([FA],{type:"text/javascript"}))),this.worker.onerror=r=>{this._debug("webworker_error",r)},this.worker.onmessage=({data:r})=>{this.handleWorkerMsg(r)};let e=!1;const n=()=>{e||(e=!0,setTimeout(()=>{e=!1},500),this.worker&&this.worker.postMessage("closing"))};this.attachEventListener(document.body,"mouseleave",n,!1,!1),this.attachEventListener(window,"pagehide",()=>{this.lastHiddenAt=Date.now(),n()},!1,!1),this.attachEventListener(window,"pageshow",this.handlePageShow,!1,!1),this.attachEventListener(document,"visibilitychange",r=>document.visibilityState==="hidden"&&n(),!1)}catch(e){this._debug("worker_start",e)}}handleWorkerMsg(e){var n;if(e==="a_stop")this.stop(!1);else if(e==="a_start")this.waitStatus(xn.NotActive).then(()=>{this.allowAppStart(),this.start(this.prevOpts,!0).then(r=>{this.debug.info("Worker restart, session too long",r)}).catch(r=>{this.debug.error("Worker restart failed",r)})});else if(e==="not_init")this.debug.warn("OR WebWorker: writer not initialised. Restarting tracker");else if(e.type==="failure")this.stop(!1),this.debug.error("worker_failed",e.reason),this._debug("worker_failed",e.reason);else if(e.type==="compress"){const r=e.batch,i=e.dataType,s=e.split,o=r.byteLength,a="CompressionStream"in globalThis;if(o>this.compressionThreshold&&a){const c=new Blob([r]).stream().pipeThrough(new CompressionStream("gzip"));new Response(c).arrayBuffer().then(d=>{var u;(u=this.worker)==null||u.postMessage({type:"compressed",batch:new Uint8Array(d),dataType:i,split:s})}).catch(d=>{var u;this.debug.error("Openreplay compression error:",d),(u=this.worker)==null||u.postMessage({type:"uncompressed",batch:r,dataType:i,split:s})})}else(n=this.worker)==null||n.postMessage({type:"uncompressed",batch:r,dataType:i,split:s})}else if(e.type==="local_save"){const r=new Blob([e.batch],{type:"application/octet-stream"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=e.name,s.click(),URL.revokeObjectURL(i)}else e.type==="queue_empty"&&this.onSessionSent()}_debug(e,n){this.options.__debug_report_edp!==null&&fetch(this.options.__debug_report_edp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e,error:`${n}`})}),this.debug.error("OpenReplay error: ",e,n)}_nCommit(){var e,n;if(this.socketMode){this.messages.unshift(ia(this.timestamp()),sa(this.session.getTabId())),this.commitCallbacks.forEach(r=>r(this.messages)),this.messages.length=0;return}if(this.insideIframe){window.parent.postMessage({line:Ht.iframeBatch,messages:this.messages,context:this.contextId},((e=this.options.crossdomain)==null?void 0:e.parentDomain)??"*"),this.markSentToParent(),this.commitCallbacks.forEach(r=>r(this.messages)),this.messages.length=0;return}if(this.worker!==void 0){if(!this.messages.length){if(this.emptyBat
10chCounter<1e3){this.emptyBatchCounter++;return}this.emptyBatchCounter=0;try{(n=this.worker)==null||n.postMessage([ia(this.timestamp()),sa(this.session.getTabId())])}catch(r){this._debug("worker_keepalive",r)}return}this.emptyBatchCounter=0;try{J2(()=>{var r;this.messages.length&&(this.messages.unshift(ia(this.timestamp()),sa(this.session.getTabId())),(r=this.worker)==null||r.postMessage(this.messages),this.commitCallbacks.forEach(i=>i(this.messages)),this.messages.length=0)})}catch(r){this._debug("worker_commit",r),this.stop(!0),setTimeout(()=>{this.start()},500)}}}_cStartCommit(){if(this.coldStartCommitN+=1,this.coldStartCommitN===2){const e=[ia(this.timestamp()),sa(this.session.getTabId())];this.bufferedMessages1.push(...e),this.bufferedMessages2.push(...e),this.coldStartCommitN=0}}commit(){this.activityState===xn.ColdStart?this._cStartCommit():this._nCommit()}postToWorker(e){var n;(n=this.worker)==null||n.postMessage(e),this.commitCallbacks.forEach(r=>r(e))}timestamp(){return Li()+this.delay}safe(e){const n=this;return function(...r){try{e.apply(this,r)}catch(i){n._debug("safe_fn_call",i)}}}attachCommitCallback(e){this.commitCallbacks.push(e)}checkRequiredVersion(e){const n=e.split(/[.-]/),r=this.version.split(/[.-]/);for(let i=0;i<3;i++){if(isNaN(Number(r[i]))||isNaN(Number(n[i])))return!1;if(Number(r[i])>Number(n[i]))return!0;if(Number(r[i])<Number(n[i]))return!1}return!0}getTrackerInfo(){return{userUUID:this.localStorage.getItem(this.options.local_uuid_key),projectKey:this.projectKey,revID:this.revID,trackerVersion:this.version,isSnippet:this.options.__is_snippet}}getSessionInfo(){return{...this.session.getInfo(),...this.getTrackerInfo()}}getSessionToken(){return this.session.getSessionToken(this.projectKey)}getSessionID(){return this.session.getInfo().sessionID||void 0}getSessionURL(e){const{projectID:n,sessionID:r,timestamp:i}=this.session.getInfo();if(!n||!r){this.debug.error("OpenReplay error: Unable to build session URL");return}const s=this.options.ingestPoint,l=(/api\.openreplay\.com/.test(s)?"https://app.openreplay.com/ingest":s).replace(/ingest$/,`${n}/session/${r}`);if(e!=null&&e.withCurrentTime){const c=Li()-i;return`${l}?jumpto=${c}`}return l}getHost(){return new URL(this.options.ingestPoint).host}getProjectKey(){return this.projectKey}getBaseHref(){var e,n;return typeof this.options.resourceBaseHref=="string"?this.options.resourceBaseHref:(this.options.resourceBaseHref,document.baseURI?document.baseURI:((n=(e=document.head)==null?void 0:e.getElementsByTagName("base")[0])==null?void 0:n.getAttribute("href"))||location.origin+location.pathname)}resolveResourceURL(e){const n=new URL(this.getBaseHref());return n.pathname+="/"+new URL(e).pathname,n.pathname.replace(/\/+/g,"/"),n.toString()}isServiceURL(e){return e.startsWith(this.options.ingestPoint)}active(){return this.activityState===xn.Active}resetNextPageSession(e){e?this.sessionStorage.setItem(this.options.session_reset_key,"t"):this.sessionStorage.removeItem(this.options.session_reset_key)}getSessionVersionHash(){return`2x${this.version}`}get sessionVersionKey(){return`${this.options.session_token_key}_version`}storeSessionVersion(e){this.sessionStorage.setItem(this.sessionVersionKey,e)}adoptSessionVersion(e){e&&this.storeSessionVersion(e)}checkSessionToken(e){const n=this.getSessionVersionHash(),r=this.sessionStorage.getItem(this.options.session_reset_key)!==null;let i=!!(e||r);const s=this.session.getSessionToken(this.projectKey);if(s){const o=this.sessionStorage.getItem(this.sessionVersionKey);(!o||o!==n)&&(i=!0),this.storeSessionVersion(n)}return i||!s}async coldStart(e={},n){this.singleBuffer=!1;const r=1e3,i=this.checkSessionToken(e.forceNew);n&&await this.setupConditionalStart(e);const s=()=>{this.orderNumber+=1,P0(),this.coldStartTs=Li(),this.orderNumber%2===0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push(ia(this.timestamp())),this.bufferedMessages1.push(sa(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push(ia(this.timestamp())),this.bufferedMessages2.push(sa(this.session.getTabId()))),this.stop(!1),this.activityState=
10xn.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata}),i||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(bf(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{s()},30*r),s()}async setupConditionalStart(e){var f;this.conditionsManager=new bI(this,e);const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:Li(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:L0,jsHeapSizeLimit:j0,timezone:H0(),width:window.screen.width,height:window.screen.height})}),{token:r,userBrowser:i,userCity:s,userCountry:o,userDevice:a,userOS:l,userState:c,projectID:d}=await n.json();this.session.assign({projectID:d}),this.session.setUserInfo({userBrowser:i,userCity:s,userCountry:o,userDevice:a,userOS:l,userState:c});const u={sessionToken:r,userUUID:"",sessionID:""};this.startCallbacks.forEach(h=>h(u)),await((f=this.conditionsManager)==null?void 0:f.fetchConditions(d,r)),await this.tagWatcher.fetchTags(this.options.ingestPoint,r)}offlineRecording(e={},n){this.onSessionSent=n,this.singleBuffer=!0;const r=this.checkSessionToken(e.forceNew);P0(),this.coldStartTs=Li();const i=this.localStorage.getItem(B0);if(i){const o=JSON.parse(i);this.bufferedMessages1=Array.isArray(o)?o:this.bufferedMessages1,this.localStorage.removeItem(B0)}this.bufferedMessages1.push(ia(this.timestamp())),this.bufferedMessages1.push(sa(this.session.getTabId())),this.activityState=xn.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const s={sessionToken:"",userUUID:"",sessionID:""};return this.startCallbacks.forEach(o=>o(s)),r||this.send(bf(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(B0,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var h,p;this.stop(!1);const e=Li();(h=this.worker)==null||h.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:this.coldStartTs,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId(),localDebug:this.options.__local_debug});const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:e,doNotRecord:!1,bufferDiff:e-this.coldStartTs,userID:this.session.getInfo().userID,token:void 0,deviceMemory:L0,jsHeapSizeLimit:j0,timezone:H0()})}),{token:r,userBrowser:i,userCity:s,userCountry:o,userDevice:a,userOS:l,userState:c,beaconSizeLimit:d,projectID:u,protocolVersion:f}=await n.json();for((p=this.worker)==null||p.postMessage({type:"auth",token:r,beaconSizeLimit:d,protocolVersion:f}),this.session.assign({projectID:u}),this.session.setUserInfo({userBrowser:i,userCity:s,userCountry:o,userDevice:a,userOS:l,userState:c});this.bufferedMessages1.length>0;)await this.flushBuffer(this.bufferedMessages1);this.postToWorker([[-1]]),this.clearBuffers()}async _start(e={},n=!1,r){var c,d,u,f,h,p;Object.keys(e).length!==0&&(this.prevOpts=e),e.startCallback&&(this.userStartCallback=e.startCallback);const i=this.activityState===xn.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker&&!this.insideIframe){const g="No w
10orker found: perhaps, CSP is not set.";return this.signalError(g,[]),Promise.resolve(As(g))}if(this.activityState===xn.Active||this.activityState===xn.Starting)return Promise.resolve(As("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=xn.Starting,i||P0(),e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset();const s=e.userID?e.userID.trim():void 0;this.session.assign({userID:s||void 0,metadata:e.metadata});const o=Li();(c=this.worker)==null||c.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:i?this.coldStartTs:o,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId(),localDebug:this.options.__local_debug});const a=this.session.getSessionToken(this.projectKey),l=this.checkSessionToken(e.forceNew);this.sessionStorage.removeItem(this.options.session_reset_key),this.debug.log("OpenReplay: starting session; need new session id?",l,"session token: ",a);try{const g=await window.fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:o,doNotRecord:!1,bufferDiff:this.coldStartTs?o-this.coldStartTs:0,userID:this.session.getInfo().userID,token:l?void 0:a,deviceMemory:L0,jsHeapSizeLimit:j0,timezone:H0(),condition:r,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height,referrer:document.referrer})});if(g.status!==200){const J=await g.text(),de=J===vc?vc:`Server error: ${g.status}. ${J}`;return As(de)}if(!this.worker&&!this.insideIframe){const J="no worker found after start request (this should not happen in real world)";return this.signalError(J,[]),As(J)}const{token:v,userUUID:b,projectID:w,beaconSizeLimit:C,compressionThreshold:x,delay:R,sessionID:O,startTimestamp:T,userBrowser:S,userCity:_,userCountry:A,userDevice:$,userOS:E,userState:I,canvasEnabled:D,canvasQuality:B,canvasFPS:j,framesSupport:z,assistOnly:q,protocolVersion:ne}=await g.json();if(typeof v!="string"||typeof b!="string"||typeof T!="number"&&typeof T<"u"||typeof O!="string"||typeof R!="number"||typeof C!="number"&&typeof C<"u"){const J=`Incorrect server response: ${JSON.stringify(g)}`;return this.signalError(J,[]),As(J)}this.delay=R,this.session.setSessionToken(v,this.projectKey),this.storeSessionVersion(this.getSessionVersionHash()),a&&a!==v&&((d=this.bc)==null||d.postMessage({type:Ht.reset,token:v})),this.session.setUserInfo({userBrowser:S,userCity:_,userCountry:A,userDevice:$,userOS:E,userState:I}),this.session.assign({sessionID:O,timestamp:T||o,projectID:w}),q?(this.socketMode=!0,(u=this.worker)==null||u.postMessage("stop")):(f=this.worker)==null||f.postMessage({type:"auth",token:v,beaconSizeLimit:C,protocolVersion:ne}),!l&&v===a&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(bf(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([J,de])=>this.send(rw(J,de))),this.localStorage.setItem(this.options.local_uuid_key,b),this.compressionThreshold=x;const Z={sessionToken:v,userUUID:b,sessionID:O};if(this.startCallbacks.forEach(J=>J(Z)),this.userStartCallback&&this.userStartCallback(gw(Z)),this.activityState=xn.Active,(h=this.options.crossdomain)!=null&&h.enabled&&this.bootChildrenFrames(),D&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new dA(this,{fps:j,quality:B,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame,framesSupport:!!z})),i){const J=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;J.length>0;)await this.flushBuffer(J);this.clearBuffers(),this.commit()}return this.insideIframe&&this.rootId?this.observer.crossdomainObserve(this.rootId,this.frameOderNumber,this.frameLevel):this.observer.observe(),this.ticker.start(),(p=this.canvasRecorder)==null||p.startTracking(),this.tagWatcher.fetchTags(this.options.ingestPoint,v),gw(Z)}catch(g){if(this.stop(),this.session.reset(),!g)return this.signalError("Unknown error",[]),As("Unknown error");
10if(g===vc)return this.signalError(vc,[]),As(vc);this._debug("session_start",g);const v=g instanceof Error?g.message:g.toString();return this.signalError(v,[]),As(v)}}async waitStart(){return new Promise(e=>{const n=setInterval(()=>{this.canStart&&(clearInterval(n),e(!0))},100)})}async waitStarted(){return this.waitStatus(xn.Active)}async waitStatus(e){return new Promise(n=>{const r=()=>{this.activityState===e?n(!0):setTimeout(r,25)};r()})}async start(...e){return this.activityState===xn.Active||this.activityState===xn.Starting?Promise.resolve(As("OpenReplay: trying to call `start()` on the instance that has been started already.")):(this.insideIframe&&this.signalIframeTracker(),document.hidden?new Promise(n=>{const r=async()=>{document.hidden||(await this.waitStart(),document.removeEventListener("visibilitychange",r),n(this._start(...e)))};document.addEventListener("visibilitychange",r)}):(await this.waitStart(),this._start(...e)))}forceFlushBatch(){var e;(e=this.worker)==null||e.postMessage("forceFlushBatch")}getTabId(){return this.session.getTabId()}clearBuffers(){this.bufferedMessages1.length=0,this.bufferedMessages2.length=0}trackWs(e){const n=e;return(r,i,s="down")=>{typeof r!="string"||typeof i!="string"||i.length>5*1024*1024||r.length>255||this.send(KI("websocket",n,i,this.timestamp(),s,r))}}stop(e=!0){var n,r;if(this.activityState!==xn.NotActive)try{(n=this.options.crossdomain)!=null&&n.enabled&&this.killChildrenFrames(),this.attributeSender.clear(),this.sanitizer.clear(),this.observer.disconnect(),this.nodes.clear(),this.ticker.stop(),this.stopCallbacks.forEach(i=>i()),this.tagWatcher.clear(),this.worker&&e&&this.worker.postMessage("stop"),(r=this.canvasRecorder)==null||r.clear(),this.messages.length=0,this.parentActive=!1,this.pageFrames=[]}finally{this.activityState=xn.NotActive,this.debug.log("OpenReplay tracking stopped.")}}}function UA(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>{t.send(zI(Math.round(e.downlink*1e3),e.effectiveType||"unknown"))};t.attachStartCallback(()=>{n(),e.addEventListener("change",n)}),t.attachStopCallback(()=>{e.removeEventListener("change",n)})}const R$=kt&&"InstallTrigger"in window?t=>t.message+`
11`+t.stack:t=>t.stack||t.message;function g1(t){return t===void 0?"undefined":t===null?"null":t instanceof Error?R$(t):Array.isArray(t)?`Array(${t.length})`:String(t)}function VA(t){return typeof t!="number"?"NaN":t.toString()}function WA(t){return typeof t!="number"?"NaN":Math.floor(t).toString()}function vw(t){if(t===void 0)return"undefined";if(t===null)return"null";if(t instanceof Error)return R$(t);if(Array.isArray(t)){const e=t.length,n=t.slice(0,10).map(g1).join(", ");return`Array(${e})[${n}]`}if(typeof t=="object"){const e=[];let n=0;for(const r in t){if(++n===10)break;const i=t[r];e.push(r+": "+g1(i))}return"{"+e.join(", ")+"}"}return t.toString()}function GA(t){return typeof t[0]=="string"&&t.unshift(t.shift().replace(/%(o|s|f|d|i)/g,(e,n)=>{const r=t.shift();if(r===void 0)return e;switch(n){case"o":return vw(r);case"s":return g1(r);case"f":return VA(r);case"d":case"i":return WA(r);default:return e}})),t.map(vw).join(" ")}const bw=["log","info","warn","error","debug","assert"];function KA(t,e){const n=Object.assign({consoleMethods:bw,consoleThrottling:30},e);if(!Array.isArray(n.consoleMethods)||n.consoleMethods.length===0)return;const r=t.safe((u,f)=>{let h=GA(f);t.sanitizer.privateMode&&(h=h.replaceAll(/./g,"*")),t.send(d1(u,h))});let i=0;const s=()=>{i=0};t.attachStartCallback(s),t.ticker.attach(s,33,!1);const o=[],a=(u,f)=>{const h={apply:function(p,g,v){Reflect.apply(p,f,v),i=i+1,!(i>n.consoleThrottling)&&r(p.name,v)}};n.consoleMethods.forEach(p=>{if(bw.indexOf(p)===-1){t.debug.error(`OpenReplay: unsupported console method "${p}"`);return}const g=f.console[p];u[p]=new Proxy(g,h),o.push(()=>{u[p]=g})})},l=t.safe(u=>a(u.console,u));let c=!1;const d=()=>{c||(c=!0,l(window))};d(),t.attachStartCallback(d),t.attachStopCallback(()=>{c=!1,o.forEach(u=>u()),o.length=0}),t.observer.attachContextCallback(l)}const XA=/(^|@)\S+:\d+/,I$=/^\s*at .*(\S+:\d+|\(native\))/m,YA=/^(eval@)?(\[native code\])?$/;function JA(t,e){if(typeof t.stacktrace<"u"||typeof t["opera#sourceloc"]<"u")return nO(t);if(t.stack&&t.stack.match(I$))return QA(t);if(t.stack)return eO(t);throw new Error("Cannot parse given Error object")}function kb(t){if(!t.includes(":"))return[t,void 0,void 0];const n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[n[1],n[2]||void 0,n[3]||void 0]}function Zd(t,e){return t}function QA(t,e){return ZA(t.stack)}function ZA(t,e){return Zd(t.split(`
12`).filter(r=>!!r.match(I$))).map(r=>{r.includes("(eval ")&&(r=r.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=r.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const s=i.match(/ (\(.+\)$)/);i=s?i.replace(s[0],""):i;const o=kb(s?s[1]:i),a=s&&i||void 0,l=["eval","<anonymous>"].includes(o[0])?void 0:o[0];return{function:a,file:l,line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:r}})}function eO(t,e){return tO(t.stack)}function tO(t,e){return Zd(t.split(`
13`).filter(r=>!r.match(YA))).map(r=>{if(r.includes(" > eval")&&(r=r.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!r.includes("@")&&!r.includes(":"))return{function:r};
13{const i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,s=r.match(i),o=s&&s[1]?s[1]:void 0,a=kb(r.replace(i,""));return{function:o,file:a[0],line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:r}}})}function nO(t,e){return!t.stacktrace||t.message.includes(`
14`)&&t.message.split(`
15`).length>t.stacktrace.split(`
16`).length?rO(t):t.stack?sO(t):iO(t)}function rO(t,e){const n=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split(`
17`),i=[];for(let s=2,o=r.length;s<o;s+=2){const a=n.exec(r[s]);a&&i.push({file:a[2],line:+a[1],raw:r[s]})}return Zd(i)}function iO(t,e){const n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split(`
18`),i=[];for(let s=0,o=r.length;s<o;s+=2){const a=n.exec(r[s]);a&&i.push({function:a[3]||void 0,file:a[2],line:a[1]?+a[1]:void 0,raw:r[s]})}return Zd(i)}function sO(t,e){return Zd(t.stack.split(`
19`).filter(r=>!!r.match(XA)&&!r.match(/^Error created at/))).map(r=>{const i=r.split("@"),s=kb(i.pop()),o=i.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;let l;o.match(/\(([^)]*)\)/)&&(l=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));const c=l===void 0||l==="[arguments not available]"?void 0:l.split(",");return{function:a,args:c,file:s[0],line:s[1]?+s[1]:void 0,col:s[2]?+s[2]:void 0,raw:r}})}function oO(t){return t.map(e=>({functionName:e.function,args:e.args,fileName:e.file,lineNumber:e.line,columnNumber:e.col,source:e.raw}))}function aO(t,e){return oO(JA(t))}function yw(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function Yf(t,e,n={}){let r=e;try{r=aO(t)}catch{}return h1(t.name,t.message,JSON.stringify(r),JSON.stringify(n))}function A$(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return Yf(t.error,yw(t),n);{let[r,i]=t.message.split(":");return i||(r="Error",i=t.message),h1(r,i,JSON.stringify(yw(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return Yf(t.reason,[],n);{let r;try{r=JSON.stringify(t.reason)}catch{r=String(t.reason)}return h1("Unhandled Promise Rejection",r,"[]",JSON.stringify(n))}}return null}function lO(t,e){const n=Object.assign({captureExceptions:!0},e);function r(i){function s(o){const a=A$(o,i);a!=null&&t.send(a)}try{t.attachEventListener(i,"unhandledrejection",s),t.attachEventListener(i,"error",s)}catch{}}n.captureExceptions&&(t.observer.attachContextCallback(r),r(window))}function ww(t,e=document.location){return t=t.trim(),t.startsWith("//")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")?t:t.startsWith("/")?e.origin+t:e.origin+e.pathname+t}function cO(t){return wI&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const dO="https://static.openreplay.com/tracker/placeholder.jpeg";function uO(t){function e(a,l){t.attributeSender.sendSetAttribute(a,"src",dO);const{width:c,height:d}=l.getBoundingClientRect();l.hasAttribute("width")||t.attributeSender.sendSetAttribute(a,"width",String(c)),l.hasAttribute("height")||t.attributeSender.sendSetAttribute(a,"height",String(d))}const n=function(a,l){const{srcset:c}=l;if(!c)return;const d=c.split(c.match(/,\s+/)?/,\s+/:",").map(u=>ww(u)).join(", ");t.attributeSender.sendSetAttribute(a,"srcset",d)},r=function(a,l){l.src.length>SI&&e(a,l),t.send(u1(a,"src",l.src,t.getBaseHref()))},i=t.safe(function(a){const l=ww(a.src||"");g$(l)&&t.send($$(t.timestamp(),0,0,0,0,0,l,"img",0,!1,0,0,0,0,0,0,0))}),s=t.safe(function(a){const l=t.nodes.getID(a);l!==void 0&&a.complete&&(a.naturalHeight===0&&a.naturalWidth===0&&!cO(a.src)?i(a):t.sanitizer.isHidden(l)||t.sanitizer.isObscured(l)?e(l,a):(r(l,a),n(l,a)))}),o=w$(t.safe(a=>{for(const l of a)if(l.type==="attributes"){const c=l.target,d=t.nodes.getID(c);if(d===void 0)continue;l.attributeName==="src"&&r(d,c),l.attributeName==="srcset"&&n(d,c)}}),t.options.forceNgOff);t.attachStopCallback(()=>{o.disconnect()}),t.nodes.attachNodeCallback(a=>{Nn(a,"img")&&(t.nodes.attachNodeListener(a,"error",()=>i(a)),t.nodes.attachNodeListener(a,"load",()=>s(a)),s(a),o.observe(a,{attributes:!0,attributeFilter:["src","srcset"]}))}),t.attachResanitizeCallback(a=>{Nn(a,"img")&&s(a)})}const fO=["text","password","email","search","number","range","date","tel","time"];function Sw(t){return Nn(t,"textarea")?!0:Nn(t,"input")?fO.includes(t.type):!1}function hO(t){if(!Nn(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const pO=kt&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(Nn(e,"label"))return e;const n=t.labels;if(n!==null&&n.length===1)return n[0]}:t=>{let e=t;for(;(e=e.parentNode)!==null;)if(Nn(e,"label"))return e;const n=t.id;if(n){const r=t.ownerDocument.querySelectorAll('label[for="'+n+'"]');if(r!==null&&r.length===1)return r[0]}};function O$(t,e){const n=Eb(t);if(n!==null)return c1(n).slice(0,100);const r=v$(t,e);if(r)return r;if(t.id)return`#${t.id}`;const i=b$(t);if(i)return i;const s=pO(t),o=t.name||t.placeholder||s&&s.innerText||t.type;return c1(o||"").slice(0,100)}const el={Plain:0,Obscured:1,Hidden:2};function mO(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:el.Obscured,obscureInputDates:!1},e),r=new Map;function i(p,g){const v=r.get(p);if(v!==void 0)return v;const b=t.tagMatcher.match(g);return b?(r.set(p,b.selector),b.selector):null}function s(p,g){let v=g.value,b=n.defaultInputMode;g.type==="password"||t.sanitizer.isHidden(p)?b=el.Hidden:(t.sanitizer.isObscured(p)||b===el.Plain&&(n.obscureInputNumbers&&g.type!=="date"&&/\d\d\d\d/.test(v)||n.obscureInputDates&&g.type==="date"||n.obscureInputEmails&&(g.type==="email"||~v.indexOf("@"))))&&(b=el.Obscured);let w=0;switch(b){case el.Hidden:w=-1,v="";break;case el.Obscured:w=v.length,v="";break}return{value:v,mask:w}}function o(p,g){const{value:v,mask:b}=s(p,g);t.send(_I(p,v,b))}const a=new Map,l=new Map,c=new Map;t.attachStopCallback(()=>{a.clear(),l.clear(),c.clear(),r.clear()});
19function d(p,g){a.get(p)!==g.value&&(a.set(p,g.value),o(p,g))}function u(p,g){l.get(p)!==g&&(l.set(p,g),t.send(PI(p,g)))}function f(p,g){c.get(p)!==g.value&&(c.set(p,g.value),o(p,g))}t.ticker.attach(()=>{a.forEach((p,g)=>{const v=t.nodes.getNode(g);if(!v)return a.delete(g);d(g,v)}),l.forEach((p,g)=>{const v=t.nodes.getNode(g);if(!v)return l.delete(g);u(g,v.checked)}),c.forEach((p,g)=>{const v=t.nodes.getNode(g);if(!v)return c.delete(g);f(g,v)})},3);function h(p,g,v,b){const{value:w,mask:C}=s(p,g);let x=i(p,g)||O$(g,n.customAttributes);t.sanitizer.privateMode&&(x=x.replaceAll(/./g,"*")),t.send(JI(p,w,C!==0,x,v,b))}t.attachResanitizeCallback((p,g)=>{(Sw(p)||Nn(p,"select"))&&o(g,p)}),t.nodes.attachNodeCallback(t.safe(p=>{const g=t.nodes.getID(p);if(g!==void 0){if(Nn(p,"select")&&(f(g,p),t.nodes.attachNodeListener(p,"change",()=>f(g,p))),Sw(p)){d(g,p);let v=0,b=0,w=0;const C=()=>{v=Li()},x=()=>{b===0&&v!==0&&(b=Li()-v)},R=()=>{v!==0&&(w=Li()-v),h(g,p,b,w),b=0,w=0,v=0};t.nodes.attachNodeListener(p,"focus",C),t.nodes.attachNodeListener(p,"input",x),t.nodes.attachNodeListener(p,"change",R);return}if(hO(p)){u(g,p.checked),t.nodes.attachNodeListener(p,"change",()=>u(g,p.checked));return}}}))}const hl=typeof CSS<"u"&&CSS.escape||(t=>t),Cw=new WeakMap;function gO(t){return yO(t)||""}function v1(t){const e=t.tagName.toUpperCase();return e==="BUTTON"||e==="A"||e==="LI"||e==="SELECT"||e==="TR"||e==="TH"||t.onclick!=null||t.getAttribute("role")==="button"}function xw(t,e){return t instanceof Element?vO(t,e):null}function vO(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(js(n,"masked"))return null;n=n.parentElement}if(m1(t)){let r=t.ownerSVGElement;for(;r!==null;)t=r,r=r.ownerSVGElement}for(n=t;n!==null&&n!==e.documentElement;){const r=n.tagName.toUpperCase();if(r==="LABEL")return null;if(r==="INPUT"||v1(n)||Eb(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function bO(t,e){const{disableClickmaps:n=!1,customAttributes:r}=e||{};function i(R){const O=Eb(R);if(O!==null)return O;if(Nn(R,"input"))return O$(R,r);const T=v$(R,r);if(T)return T;if(R.id)return`#${R.id}`;const S=b$(R);if(S)return S;if(v1(R)){let _="";return R instanceof HTMLElement&&(_=t.sanitizer.getInnerTextSecure(R)),c1(_).slice(0,100)}return""}let s=-1,o=-1,a=!1,l=null,c=0,d={},u=0,f=0,h=0,p=0,g;const v=.008,b=225;function w(){const R=p/b;if(!u){u=R;return}const O=(R-u)/b;h>4&&O>v&&t.send(QI(Li())),p=0,h=0,u=R}t.attachStartCallback(()=>{g=setInterval(()=>w(),b)}),t.attachStopCallback(()=>{s=-1,o=-1,a=!1,l=null,d={},g&&clearInterval(g)});const C=()=>{a&&(t.send(MI(s,o)),a=!1)},x=(R,O=!1)=>{function T(_,A){if(d[_])return d[_];const $=t.tagMatcher.match(A);return $?d[_]=$.selector:d[_]=gO(A)}const S=O?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);S(R.documentElement,"mouseover",_=>{const A=xw(_.target,R);A!==l&&(l=A,c=performance.now())}),S(R,"mousemove",_=>{const[A,$]=t.observer.getDocumentOffset(R);s=_.clientX+A,o=_.clientY+$,a=!0;const E=Math.sign(_.movementX);p+=Math.abs(_.movementX)+Math.abs(_.movementY),E!==f&&(f=E,h++)},!1),S(R,"click",_=>{const A=xw(_.target,R);if(!_.clientX&&!_.clientY||A===null)return;const $=t.nodes.getID(A);if($!==void 0){const E=_.pageX,I=_.pageY,D=R.documentElement.scrollWidth,B=R.documentElement.scrollHeight,j=$w(E/D),z=$w(I/B);C();const q=i(A);t.send(WI($,l===A?Math.round(performance.now()-c):0,t.sanitizer.privateMode?q.replaceAll(/./g,"*"):q,v1(A)&&!n?T($,A):"",j,z),!0)}l=null})};t.nodes.attachNodeCallback(R=>{Kf(R)&&x(R)}),x(document,!0),t.ticker.attach(C,(e==null?void 0:e.trackingOffset)||7)}function $w(t){return Math.round(t*1e4)}function k$(t,e){let n=Cw.get(e);if(n||(n=Object.create(null),Cw.set(e,n)),t in n)return n[t];const r=e.querySelectorAll(`.${hl(t)}`).length===1;return n[t]=r,r}function N$(t){if(/^[a-z\-]{3,}$/i.test(t)){const e=t.split(/-|[A-Z]/);for(const n of e)if(n.length<=2||/[^aeiou]{4,}/i.test(n))return!1;return!0}return!1}function yO(t){var r;if(!t||t.nodeType!==1)return!1;if(t.id)return`#${hl(t.id)}`;const e=Array.from(t.attributes).find(i=>i.name.startsWith("data-"));if(e)return`[${e.name}="${hl(e.value)}"]`;const n=[];for(;t&&t.nodeType===1&&t!==t.ownerDocument;){if(t.id){n.unshift(`#${hl(t.id)}`);break}const i=t.tagName.toLowerCase();if((r=t.classList)!=null&&r.length){for(const o of t.classList)if(N$(o)&&k$(o,t.ownerDocument))return n.unshift(`${i}.${hl(o)}`),n.join(" > ")}const s=wO(t);if(s)n.unshift(`${i}.${hl(s)}`);else if(t===t.ownerDocument.body||t===t.ownerDocument.documentElement)n.unshift(i);else{let o=1;for(let a=t.previousElementSibling;a;a=a.previousElementSibling)a.tagName.toLowerCase()===i&&o++;n.unshift(`${i}:nth-of-type(${o})`)}t=t.parentNode}return n.join(" > ")}function wO(t){var n,r;if(!((n=t.classList)!=null&&n.length)||!t.parentNode)return null;const e=t.parentNode.children;e:for(const i of t.classList)if(!(!N$(i)||!k$(i,t.ownerDocument))){for(const s of e)if(s!==t&&((r=s.classList)!=null&&r.contains(i)))continue e;return i}return null}let _$=-1;const nc=t=>{addEventListener("pageshow",(e=>{e.persisted&&(_$=e.timeStamp,t(e))}),!0)},vs=(t,e,n,r)=>{let i,s;return o=>{e.value>=0&&(o||r)&&(s=e.value-(i??0),(s||i===void 0)&&(i=e.value,e.delta=s,e.rating=((a,l)=>a>l[1]?"poor":a>l[0]?"needs-improvement":"good")(e.value,n),t(e)))}},Nb=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},_b=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},eu=()=>{const t=_b();return(t==null?void 0:t.activationStart)??0},bs=(t,e=-1)=>{const n=_b();let r="navigate";return _$>=0?r="back-forward-cache":n&&(document.prerendering||eu()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},z0=new WeakMap;function Pb(t,e){return z0.get(t)||z0.set(t,new e),z0.get(t)}class SO{constructor(){Is(this,"t");Is(this,"i",0);Is(this,"o",[])}h(e){var i;if(e.hadRecentInput)return;const n=this.o[0],r=this.o.at(-1);this.i&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),(i=this.t)==null||i.call(this,e)}}const tu=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver((i=>{Promise.resolve().then((()=>{e(i.getEntries())}))}));return r.observe({type:t,buffered:!0,...n}),r}}catch{}},Mb=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let Sl=-1;const P$=new Set,Ew=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,b1=t=>{if(document.visibilityState==="hidden"){if(t.type==="visibilitychange")for(const e of P$)e();isFinite(Sl)||(Sl=t.type==="visibilitychange"?t.timeStamp:0,removeEventListener("prerenderingchange",b1,!0))}},yp=()=>{var t;if(Sl<0){const e=eu();Sl=(document.prerendering||(t=globalThis.performance.getEntriesByType("visibility-state").filter((r=>r.name==="hidden"&&r.startTime>e))[0])==null?void 0:t.startTime)??Ew(),addEventListener("visibilitychange",b1,!0),addEventListener("prerenderingchange",b1,!0),nc((()=>{setTimeout((()=>{Sl=Ew()}))}))}return{get firstHiddenTime(){return Sl},onHidden(e){P$.add(e)}}},wp=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},Tw=[1800,3e3],CO=(t,e={})=>{wp((()=>{const n=yp();let r,i=bs("FCP");const s=tu("paint",(o=>{for(const a of o)a.name==="first-contentful-paint"&&(s.disconnect(),a.startTime<n.firstHiddenTime&&(i.value=Math.max(a.startTime-eu(),0),i.entries.push(a),r(!0)))}));s&&(r=vs(t,i,Tw,e.reportAllChanges),nc((o=>{i=bs("FCP"),r=vs(t,i,Tw,e.reportAllChanges),Nb((()=>{i.value=performance.now()-o.timeStamp,r(!0)}))})))}))},Rw=[.1,.25],xO=(t,e={})=>{const n=yp();CO(Mb((()=>{let r,i=bs("CLS",0);const s=Pb(e,SO),o=l=>{for(const c of l)s.h(c);s.i>i.value&&(i.value=s.i,i.entries=s.o,r())},a=tu("layout-shift",o);a&&(r=vs(t,i,Rw,e.reportAllChanges),n.onHidden((()=>{o(a.takeRecords()),r(!0)})),nc((()=>{s.i=0,i=bs("CLS",0),r=vs(t,i,Rw,e.reportAllChanges),Nb((()=>r()))}
19)),setTimeout(r))})))};let M$=0,q0=1/0,ju=0;const $O=t=>{for(const e of t)e.interactionId&&(q0=Math.min(q0,e.interactionId),ju=Math.max(ju,e.interactionId),M$=ju?(ju-q0)/7+1:0)};let y1;const Iw=()=>y1?M$:performance.interactionCount??0,EO=()=>{"interactionCount"in performance||y1||(y1=tu("event",$O,{type:"event",buffered:!0,durationThreshold:0}))};let Aw=0,TO=class{constructor(){Is(this,"u",[]);Is(this,"l",new Map);Is(this,"m");Is(this,"p")}v(){Aw=Iw(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((Iw()-Aw)/50));return this.u[e]}h(e){var i,s;if((i=this.m)==null||i.call(this,e),!e.interactionId&&e.entryType!=="first-input")return;const n=this.u.at(-1);let r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>n.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort(((o,a)=>a.P-o.P)),this.u.length>10){const o=this.u.splice(10);for(const a of o)this.l.delete(a.id)}(s=this.p)==null||s.call(this,r)}}};const D$=t=>{const e=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?t():(t=Mb(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},Ow=[200,500],RO=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=yp();wp((()=>{EO();let r,i=bs("INP");const s=Pb(e,TO),o=l=>{D$((()=>{for(const d of l)s.h(d);const c=s.L();c&&c.P!==i.value&&(i.value=c.P,i.entries=c.entries,r())}))},a=tu("event",o,{durationThreshold:e.durationThreshold??40});r=vs(t,i,Ow,e.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden((()=>{o(a.takeRecords()),r(!0)})),nc((()=>{s.v(),i=bs("INP"),r=vs(t,i,Ow,e.reportAllChanges)})))}))};class IO{constructor(){Is(this,"m")}h(e){var n;(n=this.m)==null||n.call(this,e)}}const kw=[2500,4e3],AO=(t,e={})=>{wp((()=>{const n=yp();let r,i=bs("LCP");const s=Pb(e,IO),o=l=>{e.reportAllChanges||(l=l.slice(-1));for(const c of l)s.h(c),c.startTime<n.firstHiddenTime&&(i.value=Math.max(c.startTime-eu(),0),i.entries=[c],r())},a=tu("largest-contentful-paint",o);if(a){r=vs(t,i,kw,e.reportAllChanges);const l=Mb((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),c=d=>{d.isTrusted&&(D$(l),removeEventListener(d.type,c,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])addEventListener(d,c,{capture:!0});nc((d=>{i=bs("LCP"),r=vs(t,i,kw,e.reportAllChanges),Nb((()=>{i.value=performance.now()-d.timeStamp,r(!0)}))}))}}))},Nw=[800,1800],w1=t=>{document.prerendering?wp((()=>w1(t))):document.readyState!=="complete"?addEventListener("load",(()=>w1(t)),!0):setTimeout(t)},OO=(t,e={})=>{let n=bs("TTFB"),r=vs(t,n,Nw,e.reportAllChanges);w1((()=>{const i=_b();i&&(n.value=Math.max(i.responseStart-eu(),0),n.entries=[i],r(!0),nc((()=>{n=bs("TTFB",0),r=vs(t,n,Nw,e.reportAllChanges),r(!0)})))}))};function kO(t){const e=[],n=document.getElementsByTagName("*"),r=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const s=n[i];let o="";if(Nn(s,"img")&&(o=s.currentSrc||s.src),!o){const p=getComputedStyle(s).getPropertyValue("background-image");if(p){const g=r.exec(p);g!==null&&(o=g[1],(o.startsWith('"')||o.startsWith("'"))&&(o=o.substr(1,o.length-2)))}}if(!o)continue;const a=o.substr(0,10)==="data:image"?0:t[o];if(a===void 0)continue;const l=s.getBoundingClientRect(),c=Math.max(l.top,0),d=Math.max(l.left,0),u=Math.min(l.bottom,window.innerHeight||document.documentElement&&document.documentElement.clientHeight||0),f=Math.min(l.right,window.innerWidth||document.documentElement&&document.documentElement.clientWidth||0);if(u<=c||f<=d)continue;const h=(u-c)*(f-d);e.push({time:a,area:h})}return e}function NO(t,e){let n=Math.max(document.documentElement&&document.documentElement.clientWidth||0,window.innerWidth||0)*Math.max(document.documentElement&&document.documentElement.clientHeight||0,window.innerHeight||0)/10,r=n*t;for(let i=0;i<e.length;i++){const{time:s,area:o}=e[i];n+=o,r+=o*(s>t?s:t)}return n===0?0:r/n}function _O(t,e){const n=Object.assign({captureResourceTimings:!0,capturePageLoadTimings:!0,capturePageRenderTimings:!0,excludedResourceUrls:[]},e);
19if("PerformanceObserver"in window||(n.captureResourceTimings=!1),!n.captureResourceTimings)return;let r={};function i(c){var b;if(c.duration<0||!g$(c.name)||t.isServiceURL(c.name))return;r!==null&&(r[c.name]=c.startTime+c.duration);let d=!1;if((b=n.excludedResourceUrls)==null||b.forEach(w=>{if(c.name.startsWith(w)){d=!0;return}}),d)return;let u=0;c.connectEnd&&c.connectEnd>c.domainLookupEnd?u=Math.max(0,c.requestStart-c.connectEnd):u=Math.max(0,c.requestStart-c.domainLookupEnd);const f={queueing:c.requestStart-c.fetchStart,dnsLookup:c.domainLookupEnd-c.domainLookupStart,initialConnection:c.connectEnd-c.connectStart,ssl:c.secureConnectionStart>0?c.connectEnd-c.secureConnectionStart:0,ttfb:c.responseStart-c.requestStart,contentDownload:c.responseEnd-c.responseStart,total:c.duration??c.responseEnd-c.startTime,stalled:u},h=n.resourceNameSanitizer?n.resourceNameSanitizer(c.name):c.name,p=c.responseStatus&&c.responseStatus===304||c.deliveryType&&c.deliveryType==="cache"||c.transferSize===0&&c.decodedBodySize>0,v=c.responseStatus&&c.responseStatus>=400?-111:c.decodedBodySize||0;t.send($$(c.startTime+Tl(),c.duration,f.ttfb,c.transferSize>c.encodedBodySize?c.transferSize-c.encodedBodySize:0,c.encodedBodySize||0,v,t.sanitizer.privateMode?c.name.replaceAll(/./g,"*"):h,c.initiatorType,c.transferSize,p,f.queueing,f.dnsLookup,f.initialConnection,f.ssl,f.contentDownload,f.total,f.stalled))}const s=new PerformanceObserver(c=>c.getEntries().forEach(i));function o(c){if(t.active())return t.send(nA(c.name,String(c.value)))}t.attachStartCallback(function({sessionID:c}){s.observe({type:"resource",buffered:!0}),xO(o),RO(o),AO(o),OO(o)}),t.attachStopCallback(function(){s.disconnect()});let a=0,l=0;if(n.capturePageLoadTimings){let c=!1;t.ticker.attach(()=>{if(!c&&((a===0||l===0)&&performance.getEntriesByType("paint").forEach(d=>{const{name:u,startTime:f}=d;switch(u){case"first-paint":a=f;break;case"first-contentful-paint":l=f;break}}),performance.timing.loadEventEnd||performance.now()>3e4)){c=!0;const{navigationStart:d,requestStart:u,responseStart:f,responseEnd:h,domContentLoadedEventStart:p,domContentLoadedEventEnd:g,loadEventStart:v,loadEventEnd:b}=performance.timing;t.send(DI(u-d||0,f-d||0,h-d||0,p-d||0,g-d||0,v-d||0,b-d||0,a,l))}},30)}if(n.capturePageRenderTimings){let c=0,d=0,u=0,f=null,h=!1;t.ticker.attach(()=>{if(h)return;const p=performance.now();if(r!==null&&(c=Math.max.apply(null,Object.keys(r).map(g=>r[g])),p-c>1e3&&(f=kO(r),r=null)),u!==null&&(p-u>50&&(d=p),u=p-d>5e3?null:p),f!==null&&u===null||p>3e4){h=!0,r=null;const g=f===null?0:NO(l||a,f),{domContentLoadedEventEnd:v,navigationStart:b}=performance.timing,w=u===null?Math.max(d,l,v-b||0):0;t.send(LI(g,l>c?l:c,w))}})}}function U0(t){const e=t.defaultView;return[e&&e.scrollX||t.documentElement&&t.documentElement.scrollLeft||t.body&&t.body.scrollLeft||0,e&&e.scrollY||t.documentElement&&t.documentElement.scrollTop||t.body&&t.body.scrollTop||0]}function PO(t,e){let n=!1;const r=new Map;function i(a){E$(a)&&(li(a)&&r.set(a,[a.scrollLeft,a.scrollTop]),Kf(a)&&r.set(a,U0(a)))}const s=t.safe(()=>{e||t.send(II(...U0(document)))}),o=t.safe((a,l)=>{const c=t.nodes.getID(l);c!==void 0&&t.send(NI(c,a[0],a[1]))});t.attachStartCallback(s),t.attachStopCallback(()=>{n=!1,r.clear()}),t.nodes.attachNodeCallback((a,l)=>{l&&(li(a)&&a.scrollLeft+a.scrollTop>0?r.set(a,[a.scrollLeft,a.scrollTop]):Kf(a)&&r.set(a,U0(a))),bp(a)&&t.nodes.attachNodeListener(a,"scroll",c=>{i(c.target)})}),t.attachEventListener(document,"scroll",a=>{const l=a.target;if(l===document){n=!0;return}i(l)}),t.ticker.attach(()=>{n&&(s(),n=!1),r.forEach(o),r.clear()},5,!1)}const MO=t=>{const e=["jwt","password","reset-password","invitation","secret","token"];try{const n=new URL(t);return n.searchParams.forEach((r,i)=>{e.includes(i.toLowerCase())&&n.searchParams.set(i,"*".repeat(r.length))}),n.toString()}catch{return t}};function DO(t,e){let n,r,i,s,o=document.referrer;const a=(e==null?void 0:e.urlSanitizer)||MO,l=(e==null?void 0:e.titleSanitizer)||(f=>f),c=t.safe(()=>{const f=document.URL;if(f!==n){if(n=f,e!=null&&e.replaceHashSymbol){const b=new URL(f),w=b.hash.startsWith("#/")?b.hash.slice(2):"",C=w?"/"+w.replace(/^\/+/,""):"";n=b.origin+b.pathname.replace(/\/$/,"")+C+b.search}const h=a(n),p=t.sanitizer.privateMode?yf(document.title):l(document.title),g=t.sanitizer.privateMode?yf(h):h,v=t.sanitizer.privateMode?yf(o):o;t.send(tA(g,v,s,p)),s=0,o=n}}),d=t.safe(()=>
19{const{innerWidth:f,innerHeight:h}=window;(f!==r||h!==i)&&(r=f,i=h,t.send(RI(r,i)))}),u=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(qI(document.hidden)));t.attachStartCallback(()=>{n=null,s=Tl(),r=i=-1,c(),d(),u()}),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",u,!1,!1),t.ticker.attach(c,1,!1),t.ticker.attach(d,5,!1)}const LO={checkCssInterval:200,scanInMemoryCSS:!1,checkLimit:void 0};function jO(t,e){if(t===null)return;if(!window.CSSStyleSheet){t.send(UI("no_stylesheet_prototype_in_window",""));return}const n={...LO,...e},r=new Map;let i=null;const s=new Set,o=n.checkCssInterval||200;let a={};function l(){if(!n.scanInMemoryCSS)return;const g=s.values();for(const v of g)try{const b=Hs.get(v);if(!b)continue;if(n.checkLimit&&(a[b]=(a[b]??0)+1,a[b]>n.checkLimit)){s.delete(v);continue}for(let C=0;C<v.cssRules.length;C++)try{const x=v.cssRules[C],R=`${b}:${C}`,O=r.get(R),T=x.cssText;O!==T&&(O!==void 0&&t.send(D0(b,C)),t.send(yl(b,T,C,t.getBaseHref())),r.set(R,T))}catch{}const w=Array.from(r.keys()).filter(C=>C.startsWith(`${b}:`));for(const C of w)parseInt(C.split(":")[1],10)>=v.cssRules.length&&r.delete(C)}catch{s.delete(v)}}const c=/{\s*}/;function d(g){return c.test(g)}const u=t.safe((g,v,b)=>{const w=Hs.get(g);w&&(typeof b=="string"?(t.send(yl(w,b,v,t.getBaseHref())),d(b)&&(r.set(`${w}:${v}`,b),s.add(g))):(t.send(D0(w,v)),r.has(`${w}:${v}`)&&r.delete(`${w}:${v}`)))}),f=t.safe(g=>{let v=g;for(;v.parentRule;)v=v.parentRule;const b=v.parentStyleSheet;if(!b)return;const w=Hs.get(b);if(!w)return;const C=v.cssText,x=Array.from(b.cssRules).indexOf(v);x>=0&&(t.send(yl(w,C,x,t.getBaseHref())),t.send(D0(w,x+1)),d(C)&&(r.set(`${w}:${x}`,C),s.add(b)))}),h=t.safe(g=>{if(g.__css_tracking_patched__)return;g.__css_tracking_patched__=!0;const{insertRule:v,deleteRule:b}=g.CSSStyleSheet.prototype,{insertRule:w,deleteRule:C}=g.CSSGroupingRule.prototype;g.CSSStyleSheet.prototype.insertRule=function(x,R=0){const O=v.call(this,x,R);return u(this,O,x),O},g.CSSStyleSheet.prototype.deleteRule=function(x){return u(this,x),b.call(this,x)},g.CSSGroupingRule.prototype.insertRule=function(x,R=0){const O=w.call(this,x,R);return f(this),O},g.CSSGroupingRule.prototype.deleteRule=function(x){const R=C.call(this,x);return f(this),R}});h(window),t.observer.attachContextCallback(h),t.nodes.attachNodeCallback(g=>{if(!Nn(g,"style")||!g.sheet||g.textContent!==null&&g.textContent.trim().length>0)return;const v=t.nodes.getID(g);if(!v)return;const b=g.sheet;let w;try{w=b.cssRules}catch(x){t.debug.log("Couldnt access stylesheet during initial scan",x);return}const C=Ab();Hs.set(b,C),t.send(Rb(C,v));for(let x=0;x<w.length;x++)try{u(b,x,w[x].cssText)}catch(R){t.debug.log("Couldnt access stylesheet rule during initial scan",R)}});function p(){i||!n.scanInMemoryCSS||(i=window.setInterval(l,o))}setTimeout(p,50),t.attachStopCallback(()=>{i&&(clearInterval(i),i=null),r.clear()})}function FO(t){function e(r){const i=t.nodes.getID(r);i!==void 0&&t.send(sw(i))}let n=!1;t.nodes.attachNodeCallback(r=>{Nn(r,"body")&&(t.nodes.attachNodeListener(r,"focus",i=>{E$(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(r,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send(sw(-1))},0))}))}),t.attachStartCallback(()=>{let r=document.activeElement;for(;r&&Nn(r,"iframe")&&r.contentDocument;)r=r.contentDocument.activeElement;r&&r!==r.ownerDocument.body&&e(r)},!0)}function BO(t){if(!window.FontFace)return;const e=new Map,n=r=>{class i extends r.FontFace{constructor(...o){if(typeof o[1]=="string"){let a="";o[2]&&t.safe(()=>{a=JSON.stringify(o[2])});const l=[o[0],o[1],a],c=e.get(r.document)||[];c.push(l),e.set(r.document,c);const d=r===window?0:t.nodes.getID(r.document);if(d===void 0)return;t.active()&&t.send(iw(d,...l))}super(...o)}}r.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(r=>{if(!Kf(r))return;const i=e.get(r);if(!i)return;const s=r.defaultView===window?0:t.nodes.getID(r);s!==void 0&&i.forEach(o=>{t.send(iw(s,...o))})}))}function HO(t,e,n,r,i){t.debug.log("Openreplay: attaching axios spy to instance",e);function s(f){t.debug.log("Openreplay: capturing axios response data",f);const{headers:h,data:p,method:g,url:v,baseURL:b}=f.config,{data:w,headers:C,status:x,response:R}=f,{data:O,headers:T,status:S}=R||{},_=n.ignoreHeaders,A=Array.isArray(_)?q=>_.includes(q):()=>_;function $(q,ne){A(ne[0])||(q[ne[0]]=ne[1])}let E={},I={};h.toJSON?E=h.toJSON():h instanceof Headers?h.forEach((q,ne)=>$(E,[ne,q])):Array.isArray(h)?h.forEach(q=>
19$(E,q)):typeof h=="object"&&Object.entries(h).forEach(q=>$(E,q));const D=T||C;D.toJSON?I=D.toJSON():D instanceof Headers?D.forEach((q,ne)=>$(I,[ne,q])):Array.isArray(D)?D.forEach(q=>$(I,q)):typeof D=="object"&&Object.entries(D).forEach(([q,ne])=>{A(q)||(I[q]=ne)});const B=r({url:v,method:g||"",status:x||S||0,request:{headers:E,body:p},response:{headers:I,body:O||w}});if(!B){t.debug.log("Openreplay: empty request/response info, skipping");return}const j=f.config.__openreplay_timing,z=performance.now()-j;t.debug.log("Openreplay: final req object",B),t.send(vf("xhr",String(g),String(B.url),i(B.request),i(B.response),B.status,j+Tl(),z,0))}function o(f){if(t.debug.log("Openreplay: capturing API request",f),f.__openreplay_timing=performance.now(),n.sessionTokenHeader){const h=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",p=t.getSessionToken();p&&f.headers.set(h,p)}return f}function a(f){return n.failuresOnly||s(f),f}function l(f){return t.debug.log("Openreplay: capturing API request error",f),zO(f)&&f.response?s(f.response):f instanceof Error&&t.send(Yf(f,[])),Promise.reject(f)}function c(f){t.debug.log("Openreplay: failed API request, skipping",f)}const d=e.interceptors.request.use(o,c,{synchronous:!0}),u=e.interceptors.response.use(a,l,{synchronous:!0});t.attachStopCallback(()=>{var f,h,p,g;(h=(f=e.interceptors.request).eject)==null||h.call(f,d),(g=(p=e.interceptors.response).eject)==null||g.call(p,u)})}function zO(t){return qO(t)&&t.isAxiosError===!0}function qO(t){return t!==null&&typeof t=="object"}const fd=new Set(["password","pass","pwd","mdp","token","bearer","jwt","api_key","api-key","apiKey","secret","ssn","zip","zipcode","x-api-key","www-authenticate","x-csrf-token","x-requested-with","x-forwarded-for","x-real-ip","cookie","authorization","auth","proxy-authorization","set-cookie","account_key"]);function UO(t){return(Math.log10((t^t>>31)-(t>>31))|0)+1}function Jf(t){if(typeof t=="number"){const e=UO(t);return"9".repeat(e)}return typeof t=="string"?t.replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff\s]/g,"*"):t}function _w(t){const e={};if(Array.isArray(t))t.forEach(({name:n,value:r})=>{fd.has(n.toLowerCase())?e[n]=Jf(r):e[n]=r});else for(const[n,r]of Object.entries(t))fd.has(n.toLowerCase())?e[n]=Jf(r):e[n]=r;return e}function Pw(t){if(!t)return t;let e,n=!1;try{e=JSON.parse(t),n=!0}catch{}if(n)return Qf(e),JSON.stringify(e);if(typeof t=="string"&&t.includes("?")&&t.includes("="))try{const i=new URLSearchParams(t);for(const s of i.keys())if(fd.has(s.toLowerCase())){const o=Jf(i.get(s));i.set(s,o)}return i.toString()}catch{return t}else return t}function VO(t){return Qf(t),t}function Qf(t){if(Array.isArray(t))t.forEach(Qf);else if(t&&typeof t=="object")for(const e in t)Object.hasOwn(t,e)&&(fd.has(e.toLowerCase())?t[e]=Jf(t[e]):t[e]!==null&&typeof t[e]=="object"&&Qf(t[e]))}function WO(t){if(!t)return"";try{const e=new URL(t);if(e.searchParams)for(const n of e.searchParams.keys())fd.has(n.toLowerCase())&&e.searchParams.set(n,"******");return e.toString()}catch{return t}}class Db{constructor(e=[],n,r){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=r,this.id="",this.name="",this.method="",this.url="",this.status=0,this.statusText="",this.cancelState=0,this.readyState=0,this.header={},this.responseType="",this.requestType="xhr",this.requestHeader={},this.responseSize=0,this.responseSizeText="",this.startTime=0,this.endTime=0,this.duration=0,this.getData={},this.requestData=null}getMessage(){const{reqHs:e,resHs:n}=this.writeHeaders(),r=this.method==="GET"?JSON.stringify(VO(this.getData)):Pw(this.requestData),i={headers:_w(e),body:r},s={headers:_w(n),body:Pw(this.response)},o=this.sanitize({url:WO(this.url),method:this.method,status:this.status,request:i,response:s});if(!o)return null;const a="application/graphql-response";if((o.url.includes("/graphql")||Object.values(o.request.headers).some(c=>c&&typeof c=="string"&&c.includes(a)))&&o.response.body&&typeof o.response.body=="string"){const c=o.response.body.includes("errors");o.status=c?400:200,this.requestType="graphql"}return{requestType:this.requestType,method:o.method,url:o.url,request:JSON.stringify(o.request),response:JSON.stringify(o.response),status:o.status,startTime:this.startTime,duration:this.duration,responseSize:this.responseSize}}writeHeaders(){const e={};Object.entries(this.requestHeader).forEach(([r,i])=>{this.isHeaderIgnored(r)||(e[r]=i)}),this.setSessionTokenHeader((r,i)=>{e[r]=i});const n={};return Object.entries(this.header).forEach(([r,i])=>{this.isHeaderIgnored(r)||(n[r]=i)}),{reqHs:e,resHs:n}}isHeaderIgnored(e){return Array.isArray(this.ignoredHeaders)?this.ignoredHeaders.map(n=>n.toLowerCase()).includes(e.toLowerCase()):this.ignoredHeaders}}const Lb=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:Fb(e)||Array.isArray(e)?n=JSON.stringify(e):typeof e<"u"&&(n=Object.prototype.toString.call(e));break;case"blob":case"document":case"arraybuffer":default:typeof e<"u"&&(n=Object.prototype.toString.call(e));break}return n},jb=t=>{if(!t)return null;let e;try{if(typeof t=="string"){(t[0]==="{"||t[0]==="[")&&(e=t);const n=t.split("&");n.length===1?e=t:e=n.join(",")}else if(KO(t)){const n=[];for(const[r,i]of t)n.push(`${r}=${typeof i=="string"?i:"[object Object]"}`);e=n.join(",")}else t instanceof Blob||t instanceof ReadableStream||ArrayBuffer.isView(t)||t instanceof ArrayBuffer?e="byte data":Fb(t)?e=t:e=`can't parse body ${typeof t}`;return e}catch{return"can't parse body"}},GO=(t,e={})=>{Fb(e)||(e={});let n=t?t.split("?"):[];if(n.shift(),n.length>0){n=n.join("?").split("&");for(const r of n){const i=r.split("=");try{e[i[0]]=decodeURIComponent(i[1])}catch{e[i[0]]=i[1]}}}return e};function Fb(t){return t!==null&&typeof t=="object"}function KO(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function S1(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const C1=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href)),XO=t=>t instanceof Blob?t.type:t instanceof FormData?"multipart/form-data":t instanceof URLSearchParams?"a
19pplication/x-www-form-urlencoded;charset=UTF-8":"text/plain;charset=UTF-8";class YO{constructor(e,n,r,i,s){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=r,this.sendMessage=i,this.isServiceUrl=s}apply(e,n,r){const i=r[0],s=r[1],o=new Db(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(i))return e.apply(n,r);const a=C1(i);if(o.method="POST",o.url=i,o.name=(a.pathname.split("/").pop()||"")+a.search,o.requestType="beacon",o.requestHeader={"Content-Type":XO(s)},o.status=0,o.statusText="Pending",a.search&&a.searchParams){o.getData={};for(const[d,u]of a.searchParams)o.getData[d]=u}o.requestData=jb(s),o.startTime||(o.startTime=performance.now());const l=e.apply(n,r);l?(o.endTime=performance.now(),o.duration=o.endTime-(o.startTime||o.endTime),o.status=0,o.statusText="Sent",o.readyState=4):(o.status=500,o.statusText="Unknown");const c=o.getMessage();return c&&this.sendMessage(c),l}}class JO{static create(e,n,r,i,s,o){if(e)return new Proxy(e,new YO(n,r,i,s,o))}}class QO{constructor(e,n){this.resp=e,this.item=n}set(e,n,r){return Reflect.set(e,n,r)}get(e,n){const r=Reflect.get(e,n);if(n==="arrayBuffer"||n==="blob")return typeof r=="function"?r.bind(e):r;switch(n){case"formData":case"json":case"text":return()=>(this.item.responseType=n.toLowerCase(),r.apply(e).then(i=>(this.item.response=Lb(this.item.responseType,i),i)))}return typeof r=="function"?r.bind(e):r}}class ZO{constructor(e,n,r,i,s,o){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=r,this.sendMessage=i,this.isServiceUrl=s,this.tokenUrlMatcher=o}apply(e,n,r){var i;const s=r[0],o=r[1];if(!s||typeof s!="string"&&!(s!=null&&s.url)||(s instanceof URL||typeof s=="string"?this.isServiceUrl(String(s)):this.isServiceUrl(String(s.url))))return e.apply(window,r);const l=new Db(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);this.beforeFetch(l,s,o);const c=(r[0]instanceof Request?r[0].signal:void 0)||((i=r[1])===null||i===void 0?void 0:i.signal);let d=!1;const u=()=>{if(d)return;d=!0,l.endTime=performance.now(),l.duration=l.endTime-(l.startTime||l.endTime),l.status=0,l.statusText="Aborted",l.readyState=0;const f=l.getMessage();f&&this.sendMessage(f)};return c&&(c.aborted?u():c.addEventListener("abort",u,{once:!0})),this.setSessionTokenHeader((f,h)=>{if(!(this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(l.url))){if(r[1]===void 0&&r[0]instanceof Request)return r[0].headers.append(f,h);r[1]||(r[1]={}),r[1].headers===void 0&&(r[1]=Object.assign(Object.assign({},r[1]),{headers:{}})),r[1].headers instanceof Headers?r[1].headers.append(f,h):Array.isArray(r[1].headers)?r[1].headers.push([f,h]):r[1].headers[f]=h}}),e.apply(window,r).then(this.afterFetch(l,()=>{d=!0})).catch(f=>{if(l.endTime=performance.now(),l.duration=l.endTime-(l.startTime||l.endTime),f&&f.name==="AbortError"&&(l.status=0,l.statusText="Aborted",l.readyState=0,!d)){const h=l.getMessage();h&&this.sendMessage(h)}throw f})}beforeFetch(e,n,r){let i,s="GET",o={};if(typeof n=="string"?(s=(r==null?void 0:r.method)||"GET",i=C1(n),o=(r==null?void 0:r.headers)||{}):(s=n.method||"GET",i=C1(n.url),o=n.headers),e.method=s,e.requestType="fetch",e.requestHeader=o,e.url=i.toString(),e.name=(i.pathname.split("/").pop()||"")+i.search,e.status=0,e.statusText="Pending",e.readyState=1,e.startTime||(e.startTime=performance.now()),Object.prototype.toString.call(o)==="[object Headers]"){e.requestHeader={};for(const[a,l]of o)e.requestHeader[a]=l}else e.requestHeader=o;if(i.search&&i.searchParams){e.getData={};for(const[a,l]of i.searchParams)e.getData[a]=l}r!=null&&r.body&&(e.requestData=jb(r.body))}afterFetch(e,n){return r=>{n&&(n==null||n()),e.endTime=performance.now(),e.duration=e.endTime-(e.startTime||e.endTime),e.status=r.status,e.statusText=String(r.status);let i=!1;e.header={};for(const[a,l]of r.headers)e.header[a]=l,i=l.toLowerCase().indexOf("chunked")>-1?!0:i;i?e.readyState=3:(e.readyState=4,this.handleResponseBody(r.clone(),e).then(a=>{e.responseSize=typeof a=="string"?a.length:a.byteLength,e.responseSizeText=S1(e.responseSize),e.response=Lb(e.responseType,a);const l=e.getMessage();l&&this.sendMessage(l)}).catch(a=>{if(a.name==="AbortError"){e.status=0,e.statusText="Aborted",e.readyState=0;const l=e.getMessage();l&&this.sendMessage(l)}else throw a}));const s=(r.headers.get("content-type")||"").toLowerCase();return s.includes("application/json")||s.startsWith("text/")?new Proxy(r,new QO(r,e)):r}}handleResponseBody(e,n){const r=e.headers.get("content-type");return r&&r.includes("application/json")?(n.responseType="json",e.text()):r&&(r.includes("text/html")||r.includes("text/plain"))?(n.responseType="text",e.text()):(n.responseType="arraybuffer",e.arrayBuffer())}}class ek{static create(e,n,r,i,s,o){return new Proxy(fetch,new ZO(e,n,r,i,s,o))}}var Ds;(function(t){t[t.UNSENT=0]="UNSENT",t[t.OPENED=1]="OPENED",t[t.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",t[t.LOADING=3]="LOADING",t[t.DONE=4]="DONE"})(Ds||(Ds={}));class tk{constructor(e,n,r,i,s,o,a){this.ignoredHeaders=n,this.setSessionTokenHeader=r,this.sanitize=i,this.sendMessage=s,this.isServiceUrl=o,this.tokenUrlMatcher=a,this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new Db(n,r,i),this.item.requestType="xhr"}get(e,n){switch(n){case"open":return this.getOpen(e);case"send":return this.setSessionTokenHeader((i,s)=>{this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(this.item.url)||e.readyState===1&&e.setRequestHeader(i,s)}
19),this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const r=Reflect.get(e,n);return typeof r=="function"?r.bind(e):r}}set(e,n,r){switch(n){case"onreadystatechange":return this.setOnReadyStateChange(e,n,r);case"onabort":return this.setOnAbort(e,n,r);case"ontimeout":return this.setOnTimeout(e,n,r)}return Reflect.set(e,n,r)}onReadyStateChange(){if(this.item.url&&this.isServiceUrl(this.item.url))return;this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=performance.now(),this.item.duration=this.item.endTime-this.item.startTime,this.updateItemByReadyState();const e=this.item.responseType||"";if((e===""||e==="text"||e==="json")&&setTimeout(()=>{this.item.response=Lb(e,this.XMLReq.response)},0),this.XMLReq.readyState===Ds.DONE){const n=this.item.getMessage();n&&this.sendMessage(n)}}onAbort(){this.item.cancelState=1,this.item.statusText="Abort";const e=this.item.getMessage();e&&this.sendMessage(e)}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout";const e=this.item.getMessage();e&&this.sendMessage(e)}getOpen(e){const n=Reflect.get(e,"open");return(...r)=>{var i,s,o;const a=r[0],l=r[1];return this.item.method=a?a.toUpperCase():"GET",this.item.url=((i=l.toString)===null||i===void 0?void 0:i.call(l))||"",this.item.name=(o=(s=this.item.url)===null||s===void 0?void 0:s.replace(new RegExp("/*$"),"").split("/").pop())!==null&&o!==void 0?o:"",this.item.getData=GO(this.item.url,{}),n.apply(e,r)}}getSend(e){const n=Reflect.get(e,"send");return(...r)=>{const i=r[0];return this.item.requestData=jb(i),n.apply(e,r)}}getSetRequestHeader(e){const n=Reflect.get(e,"setRequestHeader");return(...r)=>(this.item.requestHeader||(this.item.requestHeader={}),this.item.requestHeader[r[0]]=r[1],n.apply(e,r))}setOnReadyStateChange(e,n,r){return Reflect.set(e,n,(...i)=>{this.onReadyStateChange(),r==null||r.apply(e,i)})}setOnAbort(e,n,r){return Reflect.set(e,n,(...i)=>{this.onAbort(),r.apply(e,i)})}setOnTimeout(e,n,r){return Reflect.set(e,n,(...i)=>{this.onTimeout(),r.apply(e,i)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case Ds.UNSENT:case Ds.OPENED:this.item.status=Ds.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case Ds.HEADERS_RECEIVED:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=this.XMLReq.getAllResponseHeaders()||"",n=e.split(`
20`);for(let o=0;o<n.length;o++){const a=n[o];if(!a)continue;const l=a.split(": "),c=l[0];this.item.header[c]=l.slice(1).join(": ")}break;case Ds.LOADING:this.item.status=this.XMLReq.status,this.item.statusText="Loading";const r=this.XMLReq.response;if(r){const o=typeof r=="string"?r.length:r instanceof ArrayBuffer?r.byteLength:typeof Blob<"u"&&r instanceof Blob?r.size:0;o&&(this.item.responseSize=o,this.item.responseSizeText=S1(this.item.responseSize))}break;case Ds.DONE:this.item.status=this.XMLReq.status||this.item.status||0,this.item.statusText=String(this.item.status),this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime);const i=this.XMLReq.response,s=this.XMLReq.responseType||"";if((s===""||s==="text"||s==="json")&&(this.item.response=i),i){const o=typeof i=="string"?i.length:i instanceof ArrayBuffer?i.byteLength:typeof Blob<"u"&&i instanceof Blob?i.size:0;o&&(this.item.responseSize=o,this.item.responseSizeText=S1(o))}break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class nk{static create(e,n,r,i,s,o){return new Proxy(XMLHttpRequest,{construct(a){const l=new a;return new Proxy(l,new tk(l,e,n,r,i,s,o))}})}}const Mw=t=>{const e=`Openreplay: Can't find ${t} in global context.`},Bb=Symbol("OpenReplayProxyOriginal"),rk=t=>!!t&&t[Bb]!==void 0,V0=t=>rk(t)?t[Bb]:t,W0=(t,e)=>(t[Bb]=e,t);function ik(t,e,n,r,i,s,o={xhr:!0,fetch:!0,beacon:!0},a){var l;if(t){if(o.xhr){const c=V0(t.XMLHttpRequest);c?t.XMLHttpRequest=W0(nk.create(e,n,r,i,s,a),c):Mw("XMLHttpRequest")}if(o.fetch){const c=V0(t.fetch);c?t.fetch=W0(ek.create(e,n,r,i,s,a),c):Mw("fetch")}if(o.beacon&&(!((l=t.navigator)===null||l===void 0)&&l.sendBeacon)){const c=V0(t.navigator.sendBeacon);t.navigator.sendBeacon=W0(JO.create(c,e,n,r,i,s),c)}}}function G0(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function Dw(t){return typeof t=="string"?t.toUpperCase():"GET"}function sk(t,e={}){if(e.disabled)return;const n=Object.assign({failuresOnly:!1,ignoreHeaders:["cookie","set-cookie","authorization"],capturePayload:!1,sessionTokenHeader:!1,captureInIframes:!0,axiosInstances:void 0,useProxy:!0}
20,e);n.useProxy===!1&&t.debug.warn("Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true");const r=n.ignoreHeaders,i=Array.isArray(r)?d=>r.includes(d):()=>r,s=n.sessionTokenHeader===!0?"X-OpenReplay-SessionToken":n.sessionTokenHeader;function o(d){if(s){const u=t.getSessionToken();u&&t.safe(d)(s,u)}}function a(d){if((!n.capturePayload||t.sanitizer.privateMode)&&(delete d.request.body,delete d.response.body),n.sanitizer){const u=d.response.body;if(typeof u=="string")try{d.response.body=JSON.parse(u)}catch{}return n.sanitizer(d)}return d}function l(d){if(d&&typeof d.body!="string")try{d.body=JSON.stringify(d.body)}catch{d.body="<unable to stringify>",t.notify.warn("Openreplay fetch couldn't stringify body:",d.body)}return JSON.stringify(d)}const c=d=>{if(n.useProxy)return ik(d,t.sanitizer.privateMode?!0:n.ignoreHeaders,o,a,C=>{if(n.failuresOnly&&C.status<400)return;const x=t.sanitizer.privateMode?"************":C.url;t.send(vf(C.requestType,C.method,x,C.request,C.response,C.status,C.startTime+Tl(),C.duration,C.responseSize))},C=>t.isServiceURL(C),{xhr:!0,fetch:!0,beacon:!0},n.tokenUrlMatcher);const u=d.fetch.bind(d),f=(C,x={})=>{if(!(typeof C=="string"||C instanceof URL)||t.isServiceURL(String(C)))return u(C,x);o(function(O,T){x.headers===void 0&&(x.headers={}),x.headers instanceof Headers?x.headers.append(O,T):Array.isArray(x.headers)?x.headers.push([O,T]):x.headers[O]=T});const R=performance.now();return u(C,x).then(O=>{const T=performance.now()-R;if(n.failuresOnly&&O.status<400)return O;const S=O.clone();return S.text().then(_=>{const A={},$={};if(r!==!0){const D=([B,j])=>{i(B)||(A[B]=j)};x.headers instanceof Headers?x.headers.forEach((B,j)=>D([j,B])):Array.isArray(x.headers)?x.headers.forEach(D):typeof x.headers=="object"&&Object.entries(x.headers).forEach(D),S.headers.forEach((B,j)=>{i(j)||($[j]=B)})}const E=Dw(x.method),I=a({url:String(C),method:E,status:S.status,request:{headers:A,body:x.body||null},response:{headers:$,body:_}});I&&t.send(vf("fetch",E,String(I.url),l(I.request),l(I.response),S.status,R+Tl(),T,0))}).catch(_=>t.debug.error("Could not process Fetch response:",_)),O})};d.fetch=f;const h=d.XMLHttpRequest.prototype.open,p=d.XMLHttpRequest.prototype.setRequestHeader,g=d.XMLHttpRequest.prototype.send;function v(C,x){const R=this;o((T,S)=>R.setRequestHeader(T,S));let O=0;return R.addEventListener("loadstart",T=>{O=T.timeStamp}),R.addEventListener("load",t.safe(T=>{const{headers:S,body:_}=G0(R),A=O>0?T.timeStamp-O:0,E=(R.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),I={};E.forEach(function(j){const z=j.split(": "),q=z.shift();i(q)||(I[q]=z.join(": "))});const D=Dw(C),B=a({url:String(x),method:D,status:R.status,request:{headers:S,body:_||null},response:{headers:I,body:R.response}});B&&t.send(vf("xhr",D,String(B.url),l(B.request),l(B.response),R.status,O+Tl(),A,0))})),h.apply(this,arguments)}function b(C){const x=G0(this);return x.body=C,g.apply(this,arguments)}function w(C,x){if(!i(C)){const R=G0(this);R.headers[C]=x}return p.apply(this,arguments)}n.axiosInstances||(d.XMLHttpRequest.prototype.open=v,d.XMLHttpRequest.prototype.send=b,d.XMLHttpRequest.prototype.setRequestHeader=w)};c(window),n.axiosInstances&&n.axiosInstances.forEach(d=>{HO(t,d,n,a,l)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(c))}function ok(t){t.attachEventListener(document,"selectionchange",()=>{const e=document.getSelection();if(e!==null&&!e.isCollapsed){const n=t.nodes.getID(e.anchorNode),r=t.nodes.getID(e.focusNode),i=e.toString().replace(/\s+/g," ");n&&r&&t.send(lw(n,r,i))}else t.send(lw(-1,-1,""))})}function ak(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(bf(t.session.getTabId())))}t.attachStartCallback(()=>{e()}),t.attachEventListener(window,"focus",e,!1,!1)}function lk(t,e){if(!e.longTasks||!("PerformanceObserver"in window))return;const n=i=>{t.send(YI(i.name,i.duration,i.blockingDuration,i.firstUIEventTimestamp,i.startTime,JSON.stringify(i.scripts??[])))},r=new PerformanceObserver(i=>{i.getEntries().forEach(s=>{s.entryType==="long-animation-frame"&&n(s)})});t.attachStartCallback(()=>{performance.getEntriesByType("long-animation-frame").forEach(i=>
20{n(i)}),r.observe({entryTypes:["long-animation-frame"]})}),t.attachStopCallback(()=>{r.disconnect()})}const ck=["composite","computedOffset","easing","offset"];function dk(t,e={}){const{allElements:n=!1}=e;let r=new WeakSet,i=new WeakSet;function s(l,c,d){i.has(l)||(i.add(l),l.addEventListener("finish",()=>{const u=l.effect.getKeyframes().at(-1);if(!u||!c||!(c instanceof Element)||!c.isConnected)return;const f=getComputedStyle(c),h=Object.keys(u).filter(g=>!ck.includes(g)),p={};h.forEach(g=>{p[g]=f[g]}),t.send(BI(d,JSON.stringify(p)))},{once:!0}))}function o(l,c){l.getAnimations({subtree:!1}).forEach(d=>s(d,l,c))}t.nodes.attachNodeCallback(l=>{if((n||l.nodeName.includes("-"))&&"getAnimations"in l){const c=l.getAnimations({subtree:!1}),d=t.nodes.getID(l);c.length>0&&!r.has(l)&&d&&(r.add(l),o(l,d),l.addEventListener("animationstart",()=>o(l,d)))}});const a=Element.prototype.animate;Element.prototype.animate=function(...l){const c=a.apply(this,l),d=t.nodes.getID(this);return d&&s(c,this,d),c},t.attachStopCallback(()=>{Element.prototype.animate=a,r=new WeakSet,i=new WeakSet})}function uk(t,e){let r=0,i=0,s="";t.screen.width&&(r=t.screen.width,i=t.screen.height,s=`${r} x ${i}`);const o=t.navigator.appVersion??"0",a=t.navigator.userAgent??"unknown";let l=t.navigator.appName??"unknown",c=String(parseFloat(o)),d,u,f;(u=a.indexOf("YaBrowser"))!==-1?(l="Yandex",c=a.substring(u+10)):(u=a.indexOf("SamsungBrowser"))!==-1?(l="Samsung",c=a.substring(u+15)):(u=a.indexOf("UCBrowser"))!==-1?(l="UC Browser",c=a.substring(u+10)):(u=a.indexOf("OPR"))!==-1?(l="Opera",c=a.substring(u+4)):(u=a.indexOf("Opera"))!==-1?(l="Opera",c=a.substring(u+6),(u=a.indexOf("Version"))!==-1&&(c=a.substring(u+8))):(u=a.indexOf("Edge"))!==-1?(l="Microsoft Legacy Edge",c=a.substring(u+5)):(u=a.indexOf("Edg"))!==-1?(l="Microsoft Edge",c=a.substring(u+4)):(u=a.indexOf("MSIE"))!==-1?(l="Microsoft Internet Explorer",c=a.substring(u+5)):(u=a.indexOf("Chrome"))!==-1?(l="Chrome",c=a.substring(u+7)):(u=a.indexOf("Safari"))!==-1?(l="Safari",c=a.substring(u+7),(u=a.indexOf("Version"))!==-1&&(c=a.substring(u+8))):(u=a.indexOf("Firefox"))!==-1?(l="Firefox",c=a.substring(u+8)):a.indexOf("Trident/")!==-1?(l="Microsoft Internet Explorer",c=a.substring(a.indexOf("rv:")+3)):(d=a.lastIndexOf(" ")+1)<(u=a.lastIndexOf("/"))&&(l=a.substring(d,u),c=a.substring(u+1),l.toLowerCase()===l.toUpperCase()&&(l=t.navigator.appName)),(f=c.indexOf(";"))!==-1&&(c=c.substring(0,f)),(f=c.indexOf(" "))!==-1&&(c=c.substring(0,f)),(f=c.indexOf(")"))!==-1&&(c=c.substring(0,f));let h=parseInt(c,10);isNaN(h)&&(c=String(parseFloat(o)),h=parseInt(o,10));const p=/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(o);let g=t.navigator.cookieEnabled||!1;typeof navigator.cookieEnabled>"u"&&!g&&(t.document.cookie="testcookie",g=t.document.cookie.indexOf("testcookie")!==-1);let v="-";const b=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(const C of b)if(C.r.test(a)){v=C.s;break}let w="-";if(/Windows/.test(v)){const C=/Windows (.*)/.exec(v);if(C&&C[1]&&(w=C[1],w==="10"&&"userAgentData"in t.navigator)){const x=navigator;x.userAgentData&&x.userAgentData.getHighEntropyValues(["platformVersion"]).then(R=>{const T=parseInt(R.platformVersion.split(".")[0],10)<13?"10":"11";w=T,e==null||e(T)}).catch(()=>{})}v="Windows"}switch(v){case"Mac OS":case"Mac OS X":case"Android":{const C=/(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([\.\_\d]+)/.exec(a);w=C&&C[1]?C[1]:"-";break}case"iOS":{const C=/OS (\d+)_(\d+)_?(\d+)?/.exec(o);C&&C[1]&&(w=`${C[1]}.${C[2]}.${parseInt(C[3]||"0",10)}`);break}}return{screen:s,width:r,height:i,browser:l,browserVersion:c,browserMajorVersion:h,mobile:p,os:v,osVersion:w,cookies:g}}function Uc(t){const e=t===null;return!!(t&&typeof t=="object"&&!Array.isArray(t)&&!e)}function fk(){const e=new Date().getTimezoneOffset(),n=Math.abs(Math.floor(e/60)),r=Math.abs(e%60),i=e<=0?"+":"-",s=n.toString().padStart(2,"0"),o=r.toString().padStart(2,"0");return`UTC${i}${s}:${o}`}const Lw="$__or__initial_ref__$",jw="$__or__distinct_device_id__$",Fw="$__or__utm_params__$",K0="$__or__super_properties__$",Bw="$__or__user_id__$",Hw="window"in globalThis?window:{navigator:{userAgent:""},screen:{},document:{cookie:""},location:{search:""}},hk="document"in globalThis?document:{referrer:""},pk=["google","bing","yahoo","baidu","yandex","duckduckgo","ecosia","ask","aol","wolframalpha","startpage","swisscows","qwant","lycos","dogpile","info","teoma","webcrawler","naver","seznam","perplexity"];class mk{constructor(e,n){this.localStorage=e,this.sessionStorage=n,this.user_id=null,this.setUserId=f=>{this.user_id=f,this.sessionStorage.setItem(Bw,f??"")},this.resetUserId=f=>{this.user_id=null,f&&(this.deviceId=this.getDistinctDeviceId(!0))},this.getDistinctDeviceId=f=>{const h=this.localStorage.getItem(jw);if(h&&!f)return h;{const p=`${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`;return this.localStorage.setItem(jw,p),p}},this.getReferrer=()=>{const f=this.sessionStorage.getItem(Lw);if(f)return f;{const h=hk.referrer;return this.sessionStorage.setItem(Lw,h),h}},this.parseUTM=()=>{const f=this.sessionStorage.getItem(Fw);if(f){const h=JSON.parse(f);this.utmSource=h.utm_source,this.utmMedium=h.utm_medium,this.utmCampaign=h.utm_campaign}else{const h=new URLSearchParams(Hw.location.search);this.utmSource=h.get("utm_source")||null,this.utmMedium=h.get("utm_medium")||null,this.utmCampaign=h.get("utm_campaign")||null;const p={utm_source:this.utmSource,utm_medium:this.utmMedium,utm_campaign:this.utmCampaign};this.sessionStorage.setItem(Fw,JSON.stringify(p))}}
20,this.getSearchEngine=f=>{for(const h of pk)if(f.includes(h))return h;return null},this.getSuperProperties=()=>{const f=this.localStorage.getItem(K0);return f?JSON.parse(f):{}},this.saveSuperProperties=f=>{this.localStorage.setItem(K0,JSON.stringify(f))},this.clearSuperProperties=()=>{this.localStorage.setItem(K0,JSON.stringify({}))};const{width:r,height:i,browser:s,browserVersion:o,browserMajorVersion:a,os:l,osVersion:c,mobile:d}=uk(Hw,f=>{this.osVersion=f}),u=this.sessionStorage.getItem(Bw);u&&(this.user_id=u),this.os=l,this.osVersion=c,this.browser=`${s}`,this.browserVersion=`${o} (${a})`,this.platform=d?"mobile":"desktop",this.screenHeight=i,this.screenWidth=r,this.initialReferrer=this.getReferrer(),this.deviceId=this.getDistinctDeviceId(),this.searchEngine=this.getSearchEngine(this.initialReferrer),this.parseUTM()}get all(){return{os:this.os,os_version:this.osVersion,browser:this.browser,browser_version:this.browserVersion,platform:this.platform,screen_height:this.screenHeight,screen_width:this.screenWidth,initial_referrer:this.initialReferrer,utm_source:this.utmSource,utm_medium:this.utmMedium,utm_campaign:this.utmCampaign,user_id:this.user_id,distinct_id:this.deviceId,sdk_edition:"web",sdk_version:"18.1.2",timezone:fk(),search_engine:this.searchEngine}}get defaultPropertyKeys(){return Object.keys(this.all)}get distinctId(){return this.deviceId}}const oa={identity:"identity",deleteUser:"delete_user",setProperty:"set_property",setPropertyOnce:"set_property_once",appendProperty:"append_property",appendUniqueProperty:"append_unique_property",incrementProperty:"increment_property"},hn={people:"user_actions",events:"events"},uo=(t,e,n,r)=>{if(t===hn.people)return{category:t,data:{type:e,user_id:r.user_id,payload:r.properties,timestamp:n}};if(!r)throw new Error("Payload is required for event creation");return{category:t,data:{name:r.name,payload:r.properties,timestamp:n}}},Fu=["properties","token","timestamp"];class gk{constructor(e,n,r){this.constantProperties=e,this.getTimestamp=n,this.batcher=r,this.ownProperties={},this.sendEvent=(i,s,o)=>{const a={};if(s){if(!Uc(s))throw new Error("Properties must be an object");Object.entries(s).forEach(([d,u])=>{this.constantProperties.defaultPropertyKeys.includes(d)||(a[d]=u)})}const l={name:i,properties:{...this.ownProperties,...a}},c=uo(hn.events,void 0,this.getTimestamp(),l);o!=null&&o.send_immediately?this.batcher.sendImmediately(c):this.batcher.addEvent(c)},this.setProperty=(i,s)=>{let o=!1;Uc(i)&&Object.entries(i).forEach(([a,l])=>{this.constantProperties.defaultPropertyKeys.includes(a)||(this.ownProperties[a]=l,o=!0)}),typeof i=="string"&&s!==void 0&&(this.constantProperties.defaultPropertyKeys.includes(i)||(this.ownProperties[i]=s,o=!0)),o&&this.constantProperties.saveSuperProperties(this.ownProperties)},this.setPropertiesOnce=(i,s)=>{let o=!1;Uc(i)&&Object.entries(i).forEach(([a,l])=>{!this.ownProperties[a]&&!Fu.includes(a)&&(this.ownProperties[a]=l,o=!0)}),typeof i=="string"&&s!==void 0&&!this.ownProperties[i]&&!Fu.includes(i)&&(this.ownProperties[i]=s,o=!0),o&&this.constantProperties.saveSuperProperties(this.ownProperties)},this.unsetProperties=i=>{let s=!1;Array.isArray(i)?i.forEach(o=>{this.ownProperties[o]&&!Fu.includes(o)&&(delete this.ownProperties[o],s=!0)}):this.ownProperties[i]&&!Fu.includes(i)&&(delete this.ownProperties[i],s=!0),s&&this.constantProperties.saveSuperProperties(this.ownProperties)},this.reset=()=>{this.ownProperties={},this.constantProperties.clearSuperProperties()},this.register=this.setProperty,this.register_once=this.setPropertiesOnce,this.unregister=this.unsetProperties,this.track=this.sendEvent,this.ownProperties=this.constantProperties.getSuperProperties()}}class vk{constructor(e,n,r,i){this.constantProperties=e,this.getTimestamp=n,this.onId=r,this.batcher=i,this.ownProperties={},this.identify=(s,o)=>{if(!s||typeof s!="string")throw new Error("OR SDK: user_id (string) is required for .identify()");this.constantProperties.user_id&&this.constantProperties.user_id!==s&&this.reset(),this.constantProperties.setUserId(s),o!=null&&o.fromTracker||this.onId(s);const a=uo(hn.people,oa.identity,this.getTimestamp(),{user_id:s});this.batcher.addEvent(a)},this.reset=s=>{this.constantProperties.resetUserId(s),this.ownProperties={}},this.deleteUser=()=>{const s=this.constantProperties.user_id;if(!s)return;this.constantProperties.setUserId(null),this.ownProperties={};const o=uo(hn.people,oa.deleteUser,void 0,{user_id:s});this.batcher.addEvent(o),this.reset()},this.setProperties=(s,o)=>
20{if(!s)throw new Error("OR SDK: no user properties provided to set");const a={};if(typeof s=="string"&&s&&o)a[s]=o;else if(Uc(s))Object.assign(a,s);else throw new Error("OR SDK: invalid user properties provided to set");Object.entries(a).forEach(([c,d])=>{this.constantProperties.defaultPropertyKeys.includes(c)||(this.ownProperties[c]=d)});const l=uo(hn.people,oa.setProperty,void 0,{user_id:this.user_id,properties:a});this.batcher.addEvent(l)},this.setPropertiesOnce=s=>{if(!Uc(s))throw new Error("Properties must be an object");Object.entries(s).forEach(([a,l])=>{!this.constantProperties.defaultPropertyKeys.includes(a)&&!this.ownProperties[a]&&(this.ownProperties[a]=l)});const o=uo(hn.people,oa.setPropertyOnce,void 0,{user_id:this.user_id,properties:s});this.batcher.addEvent(o)},this.appendValues=(s,o)=>{!this.constantProperties.defaultPropertyKeys.includes(s)&&this.ownProperties[s]&&(Array.isArray(this.ownProperties[s])?this.ownProperties[s].push(o):this.ownProperties[s]=[this.ownProperties[s],o]);const a=uo(hn.people,oa.appendProperty,void 0,{properties:{[s]:o},user_id:this.user_id});this.batcher.addEvent(a)},this.appendUniqueValues=(s,o)=>{if(!this.ownProperties[s])return;Array.isArray(this.ownProperties[s])?this.ownProperties[s].includes(o)||this.appendValues(s,o):this.ownProperties[s]!==o&&this.appendValues(s,o);const a=uo(hn.people,oa.appendUniqueProperty,void 0,{properties:{[s]:o},user_id:this.user_id});this.batcher.addEvent(a)},this.increment=(s,o)=>{if(this.ownProperties[s]||(this.ownProperties[s]=0),this.ownProperties[s]&&typeof this.ownProperties[s]!="number")throw new Error("OR SDK: Property must be a number to increment");this.ownProperties[s]+=o;const a=uo(hn.people,oa.incrementProperty,void 0,{user_id:this.user_id,properties:{[s]:o}});this.batcher.addEvent(a)},this.union=this.appendUniqueValues,this.set=this.setProperties,this.set_once=this.setPropertiesOnce,this.append=this.appendValues,this.incrementBy=this.increment}get user_id(){return this.constantProperties.user_id}}class bk{constructor(e,n,r,i){this.backendUrl=e,this.getToken=n,this.init=r,this.standalone=i,this.autosendInterval=5*1e3,this.retryTimeout=3*1e3,this.retryLimit=3,this.apiEdp="/v1/sdk/i",this.batch={[hn.people]:[],[hn.events]:[]},this.intervalId=null,this.stopped=!1,this.paused=!1,this.onVisibilityChange=()=>{document.hidden?(this.flush(!0),this.paused=!0):this.paused=!1}}getBatches(){return this.batch[hn.people]=this.dedupePeopleEvents(),{data:{[hn.people]:[...this.batch[hn.people]],[hn.events]:[...this.batch[hn.events]]}}}addEvent(e){this.batch[e.category].push(e.data)}sendImmediately(e){this.sendBatch({[e.category]:[e.data]})}dedupePeopleEvents(){const e=this.batch[hn.people],n=[],r=[];for(let i of e)i.type==="identity"?r.length>0?(n.push(...this.squashPeopleEvents(r),i),r.length=0):n.push(i):r.push(i);return r.length>0&&n.push(...this.squashPeopleEvents(r)),n}squashPeopleEvents(e){if(!e||e.length===0)return[];const n=new Map;for(let r of e){const i=n.get(r.type);if(i){if(r.type==="increment_property"){const s=Object.entries(i.payload),o=Object.entries(r.payload),a=new Set([...s.map(([c])=>c),...o.map(([c])=>c)]),l={};a.forEach(c=>{const d=typeof i.payload[c]=="number"?i.payload[c]:0,u=typeof r.payload[c]=="number"?r.payload[c]:0;l[c]=d+u}),n.set(r.type,{type:r.type,timestamp:r.timestamp,payload:l});continue}n.set(r.type,{type:r.type,timestamp:r.timestamp,payload:{...i.payload??{},...r.payload??{}}})}else n.set(r.type,r)}return Array.from(n.values())}sendBatch(e,n=!1,r){if(this.stopped){r==null||r();return}const i=e;let s=0;const o=()=>{const a=this.getToken();if(!a){r==null||r();return}return s++,fetch(`${this.backendUrl}${this.apiEdp}`,{method:"POST",keepalive:n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(i)}).then(async l=>{if(l.status===401){const c=await l.json().catch(()=>null);if(!this.standalone&&(c==null?void 0:c.error)==="token expired"){this.stop();return}if(s<this.retryLimit)return this.init().then(()=>{o()});r==null||r();return}if(l.status===403){if(s<this.retryLimit)return this.init().then(()=>{o()});r==null||r();return}if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`)}).catch(()=>{s<this.retryLimit?setTimeout(()=>void o(),this.retryTimeout):r==null||r()})};o()}startAutosend(){this.intervalId&&clearInterval(this.intervalId),this.paused=document.hidden,document.addEventListener("visibilitychange",this.onVisibilityChange),this.intervalId=setInterval(()=>{this.paused||this.flush()},this.autosendInterval)}flush(e=!1){const n=Object.keys(this.batch);if(n.every(o=>this.batch[o].length===0))return;const i=this.getBatches(),s={[hn.people]:[...i.data[hn.people]],[hn.events]:[...i.data[hn.events]]};
20n.forEach(o=>{this.batch[o]=[]}),this.sendBatch(i,e,()=>this.requeue(s))}requeue(e){this.stopped||(this.batch[hn.people]=[...e[hn.people],...this.batch[hn.people]],this.batch[hn.events]=[...e[hn.events],...this.batch[hn.events]])}stop(){this.flush(),this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.stopped=!0}restart(){this.stopped=!1,this.startAutosend()}}const X0="__or_sdk_analytics_token";class yk{constructor(e){this.token=null,this.standalone=!1,this._getToken=()=>this.standalone?this.token:this.getToken(),this._getTimestamp=()=>this.standalone?Date.now():this.getTimestamp(),this.init=async()=>{if(this.standalone){const n=this.constantProperties.all,r="/v1/sdk/start",i={projectKey:this.projectKey,defaultFields:n},s=await fetch(r,{method:"POST",body:JSON.stringify(i)});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const o=await s.json();if(o.token)this.token=o.token,this.sessionStorage.setItem(X0,o.token);else throw new Error("No token received from server")}else{this.batcher.startAutosend();return}},this.onStart=()=>{this.standalone||this.batcher.restart()},this.onStop=()=>{this.standalone||this.batcher.stop()},this.reset=()=>{this.people.reset(!0),this.events.reset(),this.batcher.stop(),this.standalone&&(this.token=null,this.sessionStorage.setItem(X0,""))},this.identify=n=>this.people.identify(n),this.track=(n,r,i)=>this.events.track(n,r,i),this.sessionStorage=e.sessionStorage||sessionStorage,this.localStorage=e.localStorage||localStorage,this.backendUrl=e.ingestPoint,this.projectKey=e.projectKey,this.getToken=e.getToken||(()=>""),this.getTimestamp=e.getTimestamp||(()=>Date.now()),this.setUserId=e.setUserId||(()=>{}),this.standalone=!e.notStandalone,this.token=this.sessionStorage.getItem(X0),this.constantProperties=new mk(this.localStorage,this.sessionStorage),this.batcher=new bk(this.backendUrl,this._getToken,this.init,this.standalone),this.events=new gk(this.constantProperties,this._getTimestamp,this.batcher),this.people=new vk(this.constantProperties,this._getTimestamp,this.setUserId,this.batcher),e.notStandalone&&this.init()}}const wk="/en/sdk";function Sk(t){if(t==null)return!1;if(typeof t.projectKey!="string")if(typeof t.projectKey!="number"){if(typeof t.projectID!="number")return!1;t.projectKey=t.projectID.toString(),So("`projectID` option","`projectKey` option",wk)}else t.projectKey=t.projectKey.toString();return t.sessionToken!=null&&So("`sessionToken` option","`sessionHash` start() option","/"),!0}const Ck=()=>{var t;try{return!!((t=window.top)!=null&&t.document)}catch{return!1}};let xk=class{constructor(e){var l,c,d,u;if(this.options=e,this.app=null,this.analytics=null,this.crossdomainMode=!1,this.checkDoNotTrack=()=>this.options.respectDoNotTrack&&(navigator.doNotTrack=="1"||window.doNotTrack=="1"),this.signalStartIssue=(f,h)=>{const p=this.checkDoNotTrack()},this.restartCanvasTracking=()=>{this.app!==null&&this.app.restartCanvasTracking()},this.resanitize=f=>{this.app!==null&&this.app.resanitize(f)},this.checkSanitization=f=>{if(this.app!==null)return this.app.checkSanitization(f)},this.getSessionURL=f=>{if(this.app!==null)return this.app.getSessionURL(f)},this.setUserID=f=>{var h;typeof f=="string"&&this.app!==null&&(this.app.session.setUserID(f),(h=this.analytics)==null||h.people.identify(f,{fromTracker:!0}))},this.identify=this.setUserID,this.track=(f,h,p)=>{var g;return(g=this.analytics)==null?void 0:g.track(f,h,p)},this.userID=f=>{So("'userID' method","'setUserID' method","/"),this.setUserID(f)},this.handleError=(f,h={})=>{if(this.app!==null){if(f instanceof Error){const p=Yf(f,[],h);this.app.send(p)}else if(f instanceof ErrorEvent||"PromiseRejectionEvent"in window&&f instanceof PromiseRejectionEvent){const p=A$(f,void 0,h);p!=null&&this.app.send(p)}}},this.incident=f=>{this.app!==null&&this.app.send(XI(f.label??"",f.startTime,f.endTime??f.startTime))},this.analyticsToken=null,this.setAnalyticsToken=f=>{this.analyticsToken=f},this.getAnalyticsToken=()=>{var f;return this.analyticsToken?this.analyticsToken:((f=this.app)==null?void 0:f.session.getSessionToken())??""},this.crossdomainMode=!!(Y2()&&((l=e.crossdomain)!=null&&l.enabled)),!kt||!Sk(e)||window.__OPENREPLAY__||!this.crossdomainMode&&Y2()&&Ck()&&window.top.__OPENREPLAY__||!e.__DISABLE_SECURE_MODE&&location.protocol!=="https:")return;const n=this.checkDoNotTrack(),r=[],i=["Map","Set","MutationObserver","performance","timing","startsWith","Blob","Worker"];if(n)r.push("doNotTrack");else for(const f of i)if(f==="timing"){if("performance"in window&&!(f in performance)){r.push(f);break}}else if(f==="startsWith"){if(!(f in String.prototype)){r.push(f);break}}else if(!(f in window)){r.push(f);break}if(r.length>0){const f=r.join(",");this.signalStartIssue("missing_api",r);return}const s=new qA(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);
20if(this.app=s,e.projectKey&&((c=e.analytics)!=null&&c.active)){let f=!1;e.ingestPoint||(f=!0),e.ingestPoint&&new URL(e.ingestPoint).hostname==="api.openreplay.com"&&(f=!0);const h="https://api.openreplay.com/ingest";this.analytics=new yk({localStorage:e.localStorage??localStorage,sessionStorage:e.sessionStorage??sessionStorage,getToken:()=>this.getAnalyticsToken(),getTimestamp:()=>{var p;return((p=this.app)==null?void 0:p.timestamp())??Date.now()},setUserId:p=>{var g;(g=this.app)==null||g.session.setUserID(p)},notStandalone:!0,ingestPoint:f?h:((d=e.analytics)==null?void 0:d.ingestPoint)??e.ingestPoint??h,projectKey:e.projectKey}),s.attachStartCallback(()=>{var p;(p=this.analytics)==null||p.onStart()}),s.attachStopCallback(()=>{var p;(p=this.analytics)==null||p.onStop()})}this.crossdomainMode||(DO(s,e.urls),UA(s),rA(s,e),ak(s)),bO(s,{...e.mouse,customAttributes:e.customAttributes}),PO(s,this.crossdomainMode),jO(s,e.css),RA(s),KA(s,e),lO(s,e),uO(s),mO(s,e),_O(s,e),lk(s,e),FO(s),BO(s),((u=e.network)==null?void 0:u.disabled)||sk(s,e.network),ok(s),dk(s,e.webAnimations),window.__OPENREPLAY__=this;const a=window.open;(e.autoResetOnWindowOpen||e.resetTabOnWindowOpen)&&(s.attachStartCallback(()=>{const f=s.getTabId(),h=s.sessionStorage??window.sessionStorage;window.open=function(...p){return e.autoResetOnWindowOpen&&s.resetNextPageSession(!0),e.resetTabOnWindowOpen&&h.removeItem(e.session_tabid_key||"__openreplay_tabid"),s.resetNextPageSession(!1),h.setItem(e.session_tabid_key||"__openreplay_tabid",f),a.call(window,...p)}}),s.attachStopCallback(()=>{window.open=a}))}use(e){return e(this.app,this.options)}isActive(){return this.app===null?!1:this.app.active()}trackWs(e){if(this.app!==null)return this.app.trackWs(e)}start(e){var n;return this.browserEnvCheck()?this.app===null?Promise.reject("Browser doesn't support required api, or doNotTrack is active."):(e!=null&&e.userID&&(this.app.session.setUserID(e.userID),(n=this.analytics)==null||n.people.identify(e.userID,{fromTracker:!0})),this.app.start(e)):Promise.reject("Trying to start not in browser.")}browserEnvCheck(){return!!kt}coldStart(e,n){if(this.browserEnvCheck()){if(this.app===null)return Promise.reject("Tracker not initialized");this.app.coldStart(e,n)}else return Promise.reject("Trying to start not in browser.")}startOfflineRecording(e,n){return this.browserEnvCheck()?this.app===null?Promise.reject("Tracker not initialized"):this.app.offlineRecording(e,n):Promise.reject("Trying to start not in browser.")}uploadOfflineRecording(){if(this.app!==null)return this.app.uploadOfflineRecording()}stop(){if(this.app!==null)return this.app.stop(),this.app.session.getSessionHash()}forceFlushBatch(){this.app!==null&&this.app.forceFlushBatch()}getSessionToken(){return this.app===null?null:this.app.getSessionToken()}getSessionInfo(){return this.app===null?null:this.app.session.getInfo()}getSessionID(){return this.app===null?null:this.app.getSessionID()}getTabId(){return this.app===null?null:this.app.getTabId()}sessionID(){return So("'sessionID' method","'getSessionID' method","/"),this.getSessionID()}setUserAnonymousID(e){typeof e=="string"&&this.app!==null&&this.app.send(FI(e))}userAnonymousID(e){So("'userAnonymousID' method","'setUserAnonymousID' method","/"),this.setUserAnonymousID(e)}setMetadata(e,n){typeof e=="string"&&typeof n=="string"&&this.app!==null&&this.app.session.setMetadata(e,n)}metadata(e,n){So("'metadata' method","'setMetadata' method","/"),this.setMetadata(e,n)}event(e,n=null,r=!1){var i;if(typeof e=="string"&&this.app!==null){if(r)return this.issue(e,n);if(!n||typeof n=="string")return this.app.send(nw(e,n));try{if("or_timestamp"in n){const s=((i=this.getSessionInfo())==null?void 0:i.timestamp)??0;n.or_timestamp-s<0}n=JSON.stringify(n)}catch{}this.app.send(nw(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(VI(e,n))}}};class $k{constructor(){this.instance=null,this.isConfigured=!1,this.setUserID=e=>{!kt||!this.ensureConfigured()||!this.instance||this.instance.setUserID(e)},this.identify=this.setUserID,this.track=(e,n,r)=>{var i;!kt||!this.ensureConfigured()||!this.instance||(i=this.instance.analytics)==null||i.track(e,n,r)}}configure(e){kt&&(this.isConfigured||e.projectKey&&(this.instance=new xk(e),this.isConfigured=!0))}get options(){var e;return((e=this.instance)==null?void 0:e.options)||null}start(e){return kt?!this.ensureConfigured()||!this.instance?Promise.resolve({success:!1,reason:"Tracker not configured"}
20):this.instance.start(e).catch(n=>({success:!1,reason:typeof n=="string"?n:String(n)})):Promise.resolve({success:!1,reason:"Not in browser environment"})}stop(){if(!(!kt||!this.ensureConfigured()||!this.instance))return this.instance.stop()}get analytics(){var e;return((e=this.instance)==null?void 0:e.analytics)??null}setMetadata(e,n){!kt||!this.ensureConfigured()||!this.instance||this.instance.setMetadata(e,n)}getSessionURL(e){if(!(!kt||!this.ensureConfigured()||!this.instance))return this.instance.getSessionURL(e)}getSessionID(){return!kt||!this.ensureConfigured()||!this.instance?null:this.instance.getSessionID()}getSessionToken(){return!kt||!this.ensureConfigured()||!this.instance?null:this.instance.getSessionToken()}event(e,n=null,r=!1){!kt||!this.ensureConfigured()||!this.instance||this.instance.event(e,n,r)}issue(e,n=null){!kt||!this.ensureConfigured()||!this.instance||this.instance.issue(e,n)}handleError(e,n={}){!kt||!this.ensureConfigured()||!this.instance||this.instance.handleError(e,n)}restartCanvasTracking(){!kt||!this.ensureConfigured()||!this.instance||this.instance.restartCanvasTracking()}setUserAnonymousID(e){!kt||!this.ensureConfigured()||!this.instance||this.instance.setUserAnonymousID(e)}isActive(){return!kt||!this.ensureConfigured()||!this.instance?!1:this.instance.isActive()}getInstance(){return!this.ensureConfigured()||!kt?null:this.instance}coldStart(e,n){if(!(!kt||!this.ensureConfigured()||!this.instance))return this.instance.coldStart(e,n)}trackWs(e){return!kt||!this.ensureConfigured()||!this.instance?()=>{}:this.instance.trackWs(e)}ensureConfigured(){return!(!this.isConfigured&&kt)}use(e){return!kt||!this.ensureConfigured()||!this.instance?e(null):this.instance.use(e)}startOfflineRecording(...e){if(!(!kt||!this.ensureConfigured()||!this.instance))return this.instance.startOfflineRecording(...e)}uploadOfflineRecording(){if(!(!kt||!this.ensureConfigured()||!this.instance))return this.instance.uploadOfflineRecording()}forceFlushBatch(){if(!(!kt||!this.ensureConfigured()||!this.instance))return this.instance.forceFlushBatch()}getSessionInfo(){return!kt||!this.ensureConfigured()||!this.instance?null:this.instance.getSessionInfo()}getTabId(){return!kt||!this.ensureConfigured()||!this.instance?null:this.instance.getTabId()}resanitize(e){if(!(!kt||!this.ensureConfigured()||!this.instance))return this.instance.resanitize(e)}checkSanitization(e){if(!(!kt||!this.ensureConfigured()||!this.instance))return this.instance.checkSanitization(e)}incident(e){!kt||!this.ensureConfigured()||!this.instance||this.instance.incident(e)}setAnalyticsToken(e){!kt||!this.ensureConfigured()||!this.instance||this.instance.setAnalyticsToken(e)}getAnalyticsToken(){if(!(!kt||!this.ensureConfigured()||!this.instance))return this.instance.getAnalyticsToken()}}const nu=new $k;typeof window<"u"&&(window.parcelRequire=window.parcelRequire||void 0);const ys=Object.create(null);ys.open="0";ys.close="1";ys.ping="2";ys.pong="3";ys.message="4";ys.upgrade="5";ys.noop="6";const wf=Object.create(null);Object.keys(ys).forEach(t=>{wf[ys[t]]=t});const x1={type:"error",data:"parser error"},L$=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",j$=typeof ArrayBuffer=="function",F$=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Hb=({type:t,data:e},n,r)=>L$&&e instanceof Blob?n?r(e):zw(e,r):j$&&(e instanceof ArrayBuffer||F$(e))?n?r(e):zw(new Blob([e]),r):r(ys[t]+(e||"")),zw=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function qw(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Y0;function Ek(t,e){if(L$&&t.data instanceof Blob)return t.data.arrayBuffer().then(qw).then(e);if(j$&&(t.data instanceof ArrayBuffer||F$(t.data)))return e(qw(t.data));Hb(t,!1,n=>{Y0||(Y0=new TextEncoder),e(Y0.encode(n))})}const Uw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_c=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Uw.length;t++)_c[Uw.charCodeAt(t)]=t;const Tk=t=>{let e=t.length*.75,n=t.length,r,i=0,s,o,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=_c[t.charCodeAt(r)],o=_c[t.charCodeAt(r+1)],a=_c[t.charCodeAt(r+2)],l=_c[t.charCodeAt(r+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return c},Rk=typeof ArrayBuffer=="function",zb=(t,e)=>{if(typeof t!="string")return{type:"message",data:B$(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:Ik(t.substring(1),e)}:wf[n]?t.length>1?{type:wf[n],data:t.substring(1)}:{type:wf[n]}:x1},Ik=(t,e)=>{if(Rk){const n=Tk(t);return B$(n,e)}else return{base64:!0,data:t}},B$=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},H$="�",Ak=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,o)=>{Hb(s,!1,a=>{r[o]=a,++i===n&&e(r.join(H$))})})},Ok=(t,e)=>{const n=t.split(H$),r=[];for(let i=0;i<n.length;i++){const s=zb(n[i],e);if(r.push(s),s.type==="error")break}return r};function kk(){return new TransformStream({transform(t,e){Ek(t,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let J0;function Bu(t){return t.reduce((e,n)=>e+n.length,0)}function Hu(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function Nk(t,e){J0||(J0=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(Bu(n)<1)break;const l=Hu(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Bu(n)<2)break;const l=Hu(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Bu(n)<8)break;const l=Hu(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(x1);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Bu(n)<i)break;const l=Hu(n,i);a.enqueue(zb(s?l:J0.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(x1);break}}}})}const z$=4;function Qn(t){if(t)return _k(t)}function _k(t){for(var e in Qn.prototype)t[e]=Qn.prototype[e];return t}Qn.prototype.on=Qn.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Qn.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};Qn.prototype.off=Qn.prototype.removeListener=Qn.prototype.removeAllListeners=Qn.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];
vendor: 4,226 bytes, line 20
20if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this};Qn.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this};Qn.prototype.emitReserved=Qn.prototype.emit;Qn.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Qn.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Sp=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Ei=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Pk="arraybuffer";function q$(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const Mk=Ei.setTimeout,Dk=Ei.clearTimeout;function Cp(t,e){e.useNativeTimers?(t.setTimeoutFn=Mk.bind(Ei),t.clearTimeoutFn=Dk.bind(Ei)):(t.setTimeoutFn=Ei.setTimeout.bind(Ei),t.clearTimeoutFn=Ei.clearTimeout.bind(Ei))}const Lk=1.33;function jk(t){return typeof t=="string"?Fk(t):Math.ceil((t.byteLength||t.size)*Lk)}function Fk(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function U$(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Bk(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function Hk(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}class zk extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class qb extends Qn{constructor(e){super(),this.writable=!1,Cp(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new zk(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=zb(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=Bk(e);return n.length?"?"+n:""}}class qk extends qb{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Ok(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Ak(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=U$()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n
vendor: 24,679 bytes, line 20
20)}}let V$=!1;try{V$=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Uk=V$;function Vk(){}class Wk extends qk{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let Rl=class Sf extends Qn{constructor(e,n,r){super(),this.createRequest=e,Cp(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=q$(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Sf.requestsCount++,Sf.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Vk,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Sf.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Rl.requestsCount=0;Rl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Vw);else if(typeof addEventListener=="function"){const t="onpagehide"in Ei?"pagehide":"unload";addEventListener(t,Vw,!1)}}function Vw(){for(let t in Rl.requests)Rl.requests.hasOwnProperty(t)&&Rl.requests[t].abort()}const Gk=(function(){const t=W$({xdomain:!1});return t&&t.responseType!==null})();class Kk extends Wk{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=Gk&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Rl(W$,this.uri(),e)}}function W$(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Uk))return new XMLHttpRequest}catch{}if(!e)try{return new Ei[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const G$=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Xk extends qb{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=G$?{}:q$(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;Hb(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Sp(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=U$()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const Q0=Ei.WebSocket||Ei.MozWebSocket;let Yk=class extends Xk{createSocket(e,n,r){return G$?new Q0(e,n,r):n?new Q0(e,n):new Q0(e)}doWrite(e,n){this.ws.send(n)}};class Jk extends qb{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=Nk(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=kk();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this._writer.write(r).then(()=>{i&&Sp(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Qk={websocket:Yk,webtransport:Jk,polling:Kk},Zk=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,eN=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function $1(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=Zk.exec(t||""),s={},o=14;for(;o--;)s[eN[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=tN(s,s.path),s.queryKey=nN(s,s.query),s}function tN(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function nN(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const E1=typeof addEventListener=="function"&&typeof removeEventListener=="function",Cf=[];E1&&addEventListener("offline",()=>{Cf.forEach(t=>t())},!1);class Ao extends Qn{constructor(e,n){if(super(),this.binaryType=Pk,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=$1(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=$1(n.host).host);Cp(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Hk(this.opts.query)),E1&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Cf.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=z$,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Ao.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ao.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=jk(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Sp(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:e,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(Ao.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),E1&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Cf.indexOf(this._offlineEventListener);r!==-1&&Cf.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ao.protocol=z$;class rN extends Ao{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;Ao.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ao.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=u=>{const f=new Error("probe error: "+u);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function a(){o("transport closed")}function l(){o("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let iN=class extends rN{constructor(e,n={}){const r=typeof e=="object",i=r?{...e}:{...n};(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(s=>Qk[s]).filter(s=>!!s)),super(r?i:e,i)}};function sN(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=$1(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const oN=typeof ArrayBuffer=="function",aN=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,K$=Object.prototype.toString,lN=typeof Blob=="function"||typeof Blob<"u"&&K$.call(Blob)==="[object BlobConstructor]",cN=typeof File=="function"||typeof File<"u"&&K$.call(File)==="[object FileConstructor]";function Ub(t){return oN&&(t instanceof ArrayBuffer||aN(t))||lN&&t instanceof Blob||cN&&t instanceof File}function xf(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(xf(t[n]))return!0;return!1}if(Ub(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return xf(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&xf(t[n]))return!0;return!1}function dN(t){const e=[],n=t.data,r=t;return r.data=$f(n,e),r.attachments=e.length,{packet:r,buffers:e}}function $f(t,e,n){if(!t)return t;if(Ub(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let i=0;i<t.length;i++)r[i]=$f(t[i],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){if(t.toJSON&&typeof t.toJSON=="function"&&!n)return $f(t.toJSON(),e,!0);const r={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=$f(t[i],e));return r}return t}function uN(t,e){return t.data=T1(t.data,e),delete t.attachments,t}function T1(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=T1(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=T1(t[n],e));return t}const fN=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Wt;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Wt||(Wt={}));class hN{constructor(e){this.replacer=e}encode(e){return(e.type===Wt.EVENT||e.type===Wt.ACK)&&xf(e)?this.encodeAsBinary({type:e.type===Wt.EVENT?Wt.BINARY_EVENT:Wt.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===Wt.BINARY_EVENT||e.type===Wt.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=dN(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Vb extends Qn{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===Wt.BINARY_EVENT;r||n.type===Wt.BINARY_ACK?(n.type=r?Wt.EVENT:Wt.ACK,this.reconstructor=new pN(n)):super.emitReserved("decoded",n)}else if(Ub(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(Wt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Wt.BINARY_EVENT||r.type===Wt.BINARY_ACK){const s=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const o=e.substring(s,n);if(o!=Number(o)||e.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(o);if(!mN(a)||a<1)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}if(e.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(s,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=e.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===e.length)break}r.id=Number(e.substring(s,n+1))}if(e.charAt(++n)){const s=this.tryParse(e.substr(n));if(Vb.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case Wt.CONNECT:return Ww(n);case Wt.DISCONNECT:return n===void 0;case Wt.CONNECT_ERROR:return typeof n=="string"||Ww(n);case Wt.EVENT:case Wt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&fN.indexOf(n[0])===-1);case Wt.ACK:case Wt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class pN{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=uN(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const mN=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function Ww(t){return Object.prototype.toString.call(t)==="[object Object]"}const gN=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Vb,Encoder:hN,get PacketType(){return Wt}},Symbol.toStringTag,{value:"Module"}));function ji(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const vN=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class X$ extends Qn{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[ji(e,"open",this.onopen.bind(this)),ji(e,"packet",this.onpacket.bind(this)),ji(e,"error",this.onerror.bind(this)),ji(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,i,s;if(vN.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Wt.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Wt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}
vendor: 7,087 bytes, line 20
20_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Wt.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Wt.EVENT:case Wt.BINARY_EVENT:this.onevent(e);break;case Wt.ACK:case Wt.BINARY_ACK:this.onack(e);break;case Wt.DISCONNECT:this.ondisconnect();break;case Wt.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Wt.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Wt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function rc(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}rc.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};rc.prototype.reset=function(){this.attempts=0};rc.prototype.setMin=function(t){this.ms=t};rc.prototype.setMax=function(t){this.max=t};rc.prototype.setJitter=function(t){this.jitter=t};class R1 extends Qn{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Cp(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new rc({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||gN;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new iN(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=ji(n,"open",function(){r.onopen(),e&&e()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=ji(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ji(e,"ping",this.onping.bind(this)),ji(e,"data",this.ondata.bind(this)),ji(e,"error",this.onerror.bind(this)),ji(e,"close",this.onclose.bind(this)),ji(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){Sp(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new X$(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}
20cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const bc={};function Ef(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=sN(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=bc[i]&&s in bc[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new R1(r,e):(bc[i]||(bc[i]=new R1(r,e)),l=bc[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(Ef,{Manager:R1,Socket:X$,io:Ef,connect:Ef});function bN(t,e){return navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(n=>{if(!n.getAudioTracks()[0])throw new Error("No audio tracks provided");return n.getTracks().forEach(i=>{t.addTrack(i,n)}),new yN(n,t,e)})}class yN{constructor(e,n,r){this.mediaRequested=!1,this.onVideoTrackCb=null,this.stream=e,this.pc=n,this.toggleVideoCb=r}toggleVideo(){const e=this.stream.getVideoTracks();if(this.mediaRequested)e.forEach(n=>{n.enabled=!n.enabled});else return navigator.mediaDevices.getUserMedia({video:!0}).then(n=>{const r=n.getVideoTracks()[0];if(!r)throw new Error("No video track provided");return this.pc.addTrack(r,this.stream),this.stream.addTrack(r),this.toggleVideoCb&&this.toggleVideoCb(),this.mediaRequested=!0,this.onVideoTrackCb&&this.onVideoTrackCb(r),!0}).catch(n=>!1);return Promise.resolve(e[0].enabled)}toggleAudio(){let e=!0;return this.stream.getAudioTracks().forEach(n=>{n.enabled=e=e&&!n.enabled}),e}onVideoTrack(e){this.onVideoTrackCb=e}stop(){this.stream.getTracks().forEach(e=>e.stop())}}function wN(t,e){return t.localName===e}const Gw={};function SN(t,e,n="/"){Gw[t]||(Gw[t]=!0)}function CN(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(DEPRECATED_ATTRS[e]&&SN(`"${n}" attribute`,`"${DEPRECATED_ATTRS[e]}" attribute`,"/en/sdk/sanitize-data"),!0):!1}class xN{constructor(e,n){this.agentName=e,this.onDragCamera=n,this.position=[0,0],this.isDragging=!1,this.pScrEl=document.scrollingElement||document.documentElement,this.lastScrEl=null,this.resetLastScrEl=()=>{this.lastScrEl=null},this.handleWScroll=o=>{o.target!==this.lastScrEl&&this.lastScrEl!=="window"&&this.resetLastScrEl()},this.mouse=document.createElement("div");const r=document.createElement("div"),i='<svg version="1.1" width="20" height="20" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" xml:space="" viewBox="8.2 4.9 11.6 18.2"><polygon fill="#FFFFFF" points="8.2,20.9 8.2,4.9 19.8,16.5 13,16.5 12.6,16.6 "></polygon><polygon fill="#FFFFFF" points="17.3,21.6 13.7,23.1 9,12 12.7,10.5 "></polygon><rect x="12.5" y="13.6" transform="matrix(0.9221 -0.3871 0.3871 0.9221 -5.7605 6.5909)" width="2" height="8"></rect><polygon points="9.2,7.3 9.2,18.5 12.2,15.6 12.6,15.5 17.4,15.5 "></polygon></svg>';this.mouse.innerHTML=i,this.mouse.setAttribute("data-openreplay-hidden",""),Object.assign(r.style,{position:"absolute",padding:"4px 5px",borderRadius:"4px",backgroundColor:"#394EFF",color:"white",bottom:"-20px",left:"65%",fontSize:"12px",whiteSpace:"nowrap"}),this.onDragCamera=n;const s=this.agentName?this.agentName.length>10?this.agentName.slice(0,9)+"...":this.agentName:"Agent";r.textContent=s,this.mouse.appendChild(r),Object.assign(this.mouse.style,{position:"absolute",zIndex:"999998",pointerEvents:"none",marginTop:"-1px",marginLeft:"-2px"})}mount(){document.body.appendChild(this.mouse),window.addEventListener("scroll",this.handleWScroll),window.addEventListener("resize",this.resetLastScrEl)}move(e){(this.position[0]!==e[0]||this.position[1]!==e[1])&&this.resetLastScrEl(),this.position=e,Object.assign(this.mouse.style,{left:`${e[0]||0}px`,top:`${e[1]||0}px`})}getPosition(){return this.position}click(e){const n=document.elementFromPoint(e[0],e[1]);if(n instanceof HTMLElement||n instanceof SVGElement){try{const r=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window,clientX:e[0],clientY:e[1]});n.dispatchEvent(r)}catch{n.click&&n.click()}return n.focus(),n}return null}startDrag(e){this.move(e);const n=document.elementFromPoint(e[0],e[1]);if(n){const r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,clientX:e[0],clientY:e[1],buttons:1});n.dispatchEvent(r),this.isDragging=!0}}drag(e){const[n,r,i,s]=e;if(this.move([n,r]),!this.isDragging)return;const o=document.elementFromPoint(n,r);if(o){const a=new MouseEvent("mousemove",{bubbles:!0,cancelable:!0,clientX:n,clientY:r,buttons:1});
20o.dispatchEvent(a),CN(o,"draggable")&&this.onDragCamera&&this.onDragCamera(i,s)}}stopDrag(){if(!this.isDragging)return;const[e,n]=this.position,r=document.elementFromPoint(e,n);if(r){const i=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,clientX:e,clientY:n,buttons:0});r.dispatchEvent(i)}this.isDragging=!1}scroll(e){const[n,r]=this.position,[i,s]=e;let o=this.lastScrEl;if(o instanceof Element){o.scrollLeft+=i,o.scrollTop+=s;return}if(o==="window"){window.scroll(this.pScrEl.scrollLeft+i,this.pScrEl.scrollTop+s);return}for(o=document.elementFromPoint(n-this.pScrEl.scrollLeft,r-this.pScrEl.scrollTop);o;){if(o.scrollHeight>o.clientHeight||o.scrollWidth>o.clientWidth){const a=getComputedStyle(o);if(a.overflow.indexOf("scroll")>=0||a.overflow.indexOf("auto")>=0){const l=o.scrollLeft,c=o.scrollTop;if(o.scrollLeft+=i,o.scrollTop+=s,l!==o.scrollLeft||c!==o.scrollTop){this.lastScrEl=o;return}}}o=o.parentElement}window.scroll(this.pScrEl.scrollLeft+i,this.pScrEl.scrollTop+s),this.lastScrEl="window"}remove(){this.mouse.parentElement&&document.body.removeChild(this.mouse),window.removeEventListener("scroll",this.handleWScroll),window.removeEventListener("resize",this.resetLastScrEl)}}function Kw(t,e){if(t instanceof HTMLButtonElement)return t;const n=document.createElement("button");return Object.assign(n.style,{padding:"10px 14px",fontSize:"14px",borderRadius:"3px",border:"none",cursor:"pointer",display:"flex",alignItems:"center",textTransform:"uppercase",marginRight:"10px"},e),typeof t=="string"?n.textContent=t:(n.textContent=t.innerHTML,Object.assign(n.style,t.style)),n}class Zf{constructor(e){this.resolve=()=>{},this.reject=()=>{};const n=document.createElement("div"),r=document.createElement("div"),i=document.createElement("p");n.id="openreplay-confirm-window-wrapper",r.id="openreplay-confirm-window-popup",i.id="openreplay-confirm-window-p",i.innerText=e.text;const s=document.createElement("div");s.id="openreplay-confirm-window-buttons";const o=Kw(e.confirmBtn,{background:"rgba(0, 167, 47, 1)",color:"white"});o.id="openreplay-confirm-window-confirm-btn";const a=Kw(e.declineBtn,{background:"#FFE9E9",color:"#CC0000"});a.id="openreplay-confirm-window-decline-btn",s.appendChild(o),s.appendChild(a),r.appendChild(i),r.appendChild(s),Object.assign(s.style,{marginTop:"10px",display:"flex",alignItems:"center",backgroundColor:"white",padding:"10px",boxShadow:"0px 0px 3.99778px 1.99889px rgba(0, 0, 0, 0.1)",borderRadius:"6px"}),Object.assign(r.style,{font:"14px 'Roboto', sans-serif",position:"relative",pointerEvents:"auto",margin:"4em auto",width:"90%",maxWidth:"fit-content",padding:"20px",background:"#F3F3F3",color:"black",borderRadius:"3px",boxShadow:"0px 0px 3.99778px 1.99889px rgba(0, 0, 0, 0.1)"},e.style),Object.assign(n.style,{position:"fixed",left:0,top:0,height:"100%",width:"100%",pointerEvents:"none",zIndex:2147483646}),n.appendChild(r),n.setAttribute("data-openreplay-hidden",""),this.wrapper=n,o.onclick=()=>{this.resolve(!0)},a.onclick=()=>{this.resolve(!1)}}mount(){return document.body.appendChild(this.wrapper),new Promise((e,n)=>{this.resolve=e,this.reject=n})}_remove(){this.wrapper.parentElement&&this.wrapper.parentElement.removeChild(this.wrapper)}remove(){this._remove(),this.reject("no answer")}}const $N="Grant Remote Control",xp="Reject",EN="Answer",TN="Allow Recording",RN="Allow";function $p(t,e,n,r){const i=typeof t=="string";return Object.assign({text:i?t:r,confirmBtn:e,declineBtn:n},i?void 0:t)}const IN=t=>$p(t,EN,xp,"You have an incoming call. Do you want to answer?"),AN=t=>$p(t,$N,xp,"Agent requested remote control. Allow?"),ON=t=>$p(t,TN,xp,"Agent requested to record activity in this browser tab."),kN=t=>$p(t,RN,xp,"Agent requested to view this session live. Allow?");var ds;(function(t){t[t.Disabled=0]="Disabled",t[t.Requesting=1]="Requesting",t[t.Enabled=2]="Enabled"})(ds||(ds={}));let Y$=function(t){this.value=t};const Z0=typeof window<"u"&&Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value");Z0&&Z0.set&&(Y$=Z0.set);class NN{constructor(e,n,r,i,s){this.options=e,this.onGrand=n,this.onRelease=r,this.onBusy=i,this.updateState=s,this.mouse=null,this.status=ds.Disabled,this.agentID=null,this.confirm=null,this.requestControl=o=>{if(this.status===ds.Enabled)return this.onBusy(o);if(this.agentID!==null){this.releaseControl();return}setTimeout(()=>{this.status===ds.Requesting&&this.releaseControl()},3e4),this.agentID=o,this.status=ds.Requesting,this.confirm=new Zf(AN(this.options.controlConfirm)),this.confirm.mount().then(a=>{var l;a?this.grantControl(o):((l=this.confirm)===null||l===void 0||l.remove(),this.releaseControl(!0))}).then(()=>{var a;(a=this.confirm)===null||a===void 0||a.remove()}).catch(a=>{var l;(l=this.confirm)===null||l===void 0||l.remove()})},this.releaseControl=(o,a,l)=>{this.confirm&&(this.confirm.remove(),this.confirm=null),this.resetMouse(),this.status=ds.Disabled,a||sessionStorage.removeItem(this.options.session_control_peer_key),this.onRelease(this.agentID,o),this.agentID=null,l||this.updateState()},this.grantControl=(o,a)=>{this.agentID=o,this.status=ds.Enabled,sessionStorage.setItem(this.options.session_control_peer_key,o);const l=this.onGrand(o);this.mouse&&this.resetMouse(),a||this.updateState(o),this.mouse=new xN(l,this.options.onDragCamera),this.mouse.mount()},this.resetMouse=()=>{var o;(o=this.mouse)===null||o===void 0||o.remove(),this.mouse=null},this.scroll=(o,a)=>{this.isAuthorized(o)&&this.mouse.scroll(a)},this.move=(o,a)=>
20{if(this.isAuthorized(o))return this.mouse.move(a)},this.focused=null,this.click=(o,a)=>{this.isAuthorized(o)&&(this.focused=this.mouse.click(a))},this.focus=(o,a)=>{this.isAuthorized(o)&&(this.focused=a)},this.startDrag=(o,a)=>{this.isAuthorized(o)&&this.mouse.startDrag(a)},this.drag=(o,a)=>{this.isAuthorized(o)&&this.mouse.drag(a)},this.stopDrag=o=>{this.isAuthorized(o)&&this.mouse.stopDrag()},this.input=(o,a)=>{if(!(!this.isAuthorized(o)||!this.focused))if(this.focused instanceof HTMLTextAreaElement||this.focused instanceof HTMLInputElement||this.focused.tagName==="INPUT"||this.focused.tagName==="TEXTAREA"){Y$.call(this.focused,a);const l=new Event("input",{bubbles:!0});this.focused.dispatchEvent(l)}else this.focused.isContentEditable&&(this.focused.innerText=a)},this.select=(o,a)=>{!this.isAuthorized(o)||!this.focused||this.focused instanceof HTMLSelectElement&&(this.focused.value=a,this.focused.dispatchEvent(new Event("input",{bubbles:!0})),this.focused.dispatchEvent(new Event("change",{bubbles:!0})))}}reconnect(e){const n=sessionStorage.getItem(this.options.session_control_peer_key);n!==null&&e.indexOf(n)!==-1?this.grantControl(n):sessionStorage.removeItem(this.options.session_control_peer_key)}isAuthorized(e){return this.status===ds.Enabled&&e===this.agentID&&this.mouse!==null}}function _N(t,e,n){e.addEventListener("pointerdown",c,{passive:!0});let r,i,s,o,a=0,l=0;function c(h){i=h.clientX,s=h.clientY,r=t.getBoundingClientRect(),n.addEventListener("pointermove",d,{passive:!0}),n.addEventListener("pointerup",f,{passive:!0}),n.addEventListener("pointercancel",f,{passive:!0})}function d(h){o||(a+=h.clientX-i,l+=h.clientY-s,a=Math.min(Math.max(a,-r.left),window.innerWidth-r.right),l=Math.min(Math.max(l,-r.top),window.innerHeight-r.bottom),o=requestAnimationFrame(u))}function u(){t.style.transform="translate3d("+a+"px,"+l+"px, 0px)",o=null}function f(){n.removeEventListener("pointermove",d),n.removeEventListener("pointerup",f),n.removeEventListener("pointercancel",f),o&&(cancelAnimationFrame(o),o=null),t.style.left=r.left+a+"px",t.style.top=r.top+l+"px",t.style.transform="translate3d(0px,0px,0px)",a=l=0}}const em="__openreplay_assist_call_start_ts",PN=`<!doctype html><html><head><meta charset="utf-8"><style>
21*{box-sizing:border-box}
22html,body{margin:0}
23body{font:14px Roboto,sans-serif;background:#fff;color:#222;padding:8px;width:max-content}
24#or-assist{display:flex;flex-direction:column;gap:6px;min-width:160px}
25button{padding:8px 10px;border:none;border-radius:3px;cursor:pointer;font-weight:600;text-transform:uppercase;font-size:12px;width:100%}
26#end-call-btn{background:#cc0000;color:#fff}
27#end-control-btn{background:#394EFF;color:#fff}
28</style></head><body>
29<div id="or-assist">
30<div id="controls" style="display:none"><button id="end-call-btn">End call</button></div>
31<div id="remote-control-row" style="display:none"><button id="end-control-btn">End remote control</button></div>
32</div>
33</body></html>`;class tm{constructor(e,n,r=!1){this.logError=e,this.callUITemplate=n,this.agentShortNames=r,this.vRemote=null,this.vLocal=null,this.audioBtn=null,this.videoBtn=null,this.endCallBtn=null,this.agentNameElem=null,this.remoteStreamVideoContainerSample=null,this.videoContainer=null,this.vPlaceholder=null,this.remoteControlContainer=null,this.remoteControlEndBtn=null,this.controlsContainer=null,this.fallbackMode=!1,this.audioContainer=null,this.localStreams=[];const i=this.iframe=document.createElement("iframe");Object.assign(i.style,{position:"fixed",zIndex:2147483646,border:"none",bottom:"50px",right:"10px",height:"200px",width:"200px"}),i.setAttribute("data-openreplay-obscured",""),i.setAttribute("data-openreplay-hidden",""),i.setAttribute("data-openreplay-ignore",""),document.body.appendChild(i);const s=i.contentDocument;if(!s){e("OpenReplay: CallWindow iframe document is not reachable.");return}const o="https://static.openreplay.com/tracker-assist/widget";this.load=fetch(this.callUITemplate||o+"/index.html").then(a=>{if(!a.ok)throw new Error(`Failed to load call UI: HTTP ${a.status}`);return a.text()}).then(a=>{i.onload=()=>{const d=s.getElementById("or-assist");setTimeout(()=>{d==null||d.classList.remove("status-connecting")},0),this.adjustIframeSize(),i.onload=null},a=a.replace(/href="css/g,`href="${o}/css`),s.open(),s.write(a),s.close(),this.vLocal=s.getElementById("video-local"),this.vRemote=s.getElementById("video-remote"),this.videoContainer=s.getElementById("video-container"),this.audioBtn=s.getElementById("audio-btn"),this.audioBtn&&(this.audioBtn.onclick=()=>this.toggleAudio()),this.videoBtn=s.getElementById("video-btn"),this.videoBtn&&(this.videoBtn.onclick=()=>this.toggleVideo()),this.endCallBtn=s.getElementById("end-call-btn"),this.agentNameElem=s.getElementById("agent-name"),this.vPlaceholder=s.querySelector("#remote-stream p"),this.remoteControlContainer=s.getElementById("remote-control-row"),this.remoteControlEndBtn=s.getElementById("end-control-btn"),this.controlsContainer=s.getElementById("controls"),this.controlsContainer&&(this.controlsContainer.style.display="none");const l=s.getElementById("duration");if(l){const d=Number(sessionStorage.getItem(em))||Date.now();sessionStorage.setItem(em,d.toString()),this.tsInterval=setInterval(()=>{const f=~~((Date.now()-d)/1e3),h=~~(f/60),p=f-h*60;l.innerText=`${h>0?`${h}m`:""}${p<10?0:""}${p}s`},500)}const c=s.querySelector(".drag-area");c&&_N(i,c,s.documentElement),setTimeout(()=>{const d=s.getElementById("or-assist");d==null||d.classList.remove("status-connecting"),this.adjustIframeSize()},250)}).catch(a=>{e("OpenReplay: failed to load call UI, rendering fallback",a),this.renderFallbackUI(s)})}renderFallbackUI(e){this.fallbackMode=!0,e.open(),e.write(PN),e.close(),this.endCallBtn=e.getElementById("end-call-btn"),this.remoteControlEndBtn=e.getElementById("end-control-btn"),this.controlsContainer=e.getElementById("controls"),this.remoteControlContainer=e.getElementById("remote-control-row"),this.iframe.style.display="none"}adjustIframeSize(){const e=this.iframe.contentDocument;if(e&&(this.iframe.style.height=`${e.body.scrollHeight}px`,this.iframe.style.width=`${e.body.scrollWidth}px`,this.fallbackMode)){const n=!!this.controlsContainer&&this.controlsContainer.style.display!=="none",r=!!this.remoteControlContainer&&this.remoteControlContainer.style.display!=="none";this.iframe.style.display=n||r?"":"none"}}addRemoteStream(e,n){this.load.then(()=>{this.vRemote&&!this.vRemote.srcObject&&(this.vRemote.srcObject=e,this.remoteVideo=e.getVideoTracks()[0],this.remoteVideoId=n,this.vPlaceholder&&(this.vPlaceholder.innerText="Video has been paused. Click anyw
33here to resume."),this.checkRemoteVideoInterval&&clearInterval(this.checkRemoteVideoInterval)),this.audioContainer||(this.audioContainer=document.createElement("div"),document.body.appendChild(this.audioContainer));const r=document.createElement("audio");r.autoplay=!0,r.style.display="none",r.srcObject=e,this.audioContainer.appendChild(r)}).catch(r=>this.logError(r))}toggleRemoteVideoUI(e){this.load.then(()=>{this.videoContainer&&(e?this.videoContainer.classList.add("remote"):this.videoContainer.classList.remove("remote"),this.adjustIframeSize())}).catch(n=>this.logError(n))}setLocalStreams(e){this.localStreams=e}playRemote(){this.vRemote&&this.vRemote.play()}setAssistentName(e){this.load.then(()=>{if(this.agentNameElem){const r=Array.from(e.values()).map(s=>this.agentShortNames?s.split(" ")[0]:s).join(", "),i=r.length>20?r.substring(0,20)+"...":r;this.agentNameElem.innerText=i}}).catch(n=>this.logError(n))}toggleAudioUI(e){this.audioBtn&&(e?this.audioBtn.classList.remove("muted"):this.audioBtn.classList.add("muted"))}toggleAudio(){let e=!1;this.localStreams.forEach(n=>{e=n.toggleAudio()||!1}),this.toggleAudioUI(e)}toggleVideoUI(e){!this.videoBtn||!this.videoContainer||(e?(this.videoContainer.classList.add("local"),this.videoBtn.classList.remove("off")):(this.videoContainer.classList.remove("local"),this.videoBtn.classList.add("off")),this.adjustIframeSize())}toggleVideo(){this.localStreams.forEach(e=>{e.toggleVideo().then(n=>{var r;(r=this.onToggleVideo)===null||r===void 0||r.call(this,{streamId:e.stream.id,enabled:n}),this.toggleVideoUI(n),this.load.then(()=>{this.vLocal&&e&&!this.vLocal.srcObject&&(this.vLocal.srcObject=e.stream)}).catch(i=>this.logError(i))}).catch(n=>this.logError(n))})}showRemoteControl(e){this.load.then(()=>{this.remoteControlContainer&&(this.remoteControlContainer.style.display="flex"),this.remoteControlEndBtn&&(this.remoteControlEndBtn.onclick=e),this.adjustIframeSize()}).catch(n=>this.logError(n))}showControls(e){this.load.then(()=>{this.controlsContainer&&(this.controlsContainer.style.display="unset"),this.endCallBtn&&(this.endCallBtn.onclick=e),this.adjustIframeSize()}).catch(n=>this.logError(n))}hideControls(){this.controlsContainer&&(this.controlsContainer.style.display="none"),this.adjustIframeSize()}hideRemoteControl(){this.remoteControlContainer&&(this.remoteControlContainer.style.display="none"),this.adjustIframeSize()}setVideoToggleCallback(e){this.onToggleVideo=e}remove(){clearInterval(this.tsInterval),clearInterval(this.checkRemoteVideoInterval),this.audioContainer&&this.audioContainer.parentElement&&(this.audioContainer.parentElement.removeChild(this.audioContainer),this.audioContainer=null),this.iframe.parentElement&&this.iframe.parentElement.removeChild(this.iframe),sessionStorage.removeItem(em),this.localStreams=[]}toggleVideoStream({streamId:e,enabled:n}){this.remoteVideoId===e&&(this.remoteVideo.enabled=n,this.toggleRemoteVideoUI(n))}}class nm{constructor(){this.ctx=null,this.painting=!1,this.resizeCanvas=()=>{this.canvas.width=window.innerWidth,this.canvas.height=window.innerHeight},this.lastPosition=[0,0],this.start=e=>{this.painting=!0,this.clrTmID&&clearTimeout(this.clrTmID),this.lastPosition=e},this.stop=()=>{this.painting&&(this.painting=!1,this.fadeOut())},this.move=e=>{!this.ctx||!this.painting||(this.ctx.globalAlpha=1,this.ctx.beginPath(),this.ctx.moveTo(this.lastPosition[0],this.lastPosition[1]),this.ctx.lineTo(e[0],e[1]),this.ctx.lineWidth=8,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.ctx.strokeStyle="red",this.ctx.stroke(),this.lastPosition=e)},this.clrTmID=null,this.canvas=document.createElement("canvas"),this.canvas.setAttribute("data-openreplay-hidden","1"),Object.assign(this.canvas.style,{position:"fixed",left:0,top:0,pointerEvents:"none",zIndex:2147483645})}fadeOut(){let e;const n=()=>{!this.ctx||this.painting||(this.ctx.globalCompositeOperation="destination-out",this.ctx.fillStyle="rgba(255, 255, 255, 0.1)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.globalCompositeOperation="source-over",e=setTimeout(n,100))};this.clrTmID=setTimeout(()=>{clearTimeout(e),this.ctx&&this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)},4e3),n()}mount(){document.body.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),window.addEventListener("resize",this.resizeCanvas),this.resizeCanvas()}remove(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),window.removeEventListener("resize",this.resizeCanvas)}}var da;(function(t){t[t.Off=0]="Off",t[t.Requested=1]="Requested",t[t.Recording=2]="Recording"})(da||(da={}));const MN={height:"100vh",width:"100vw",border:"2px dashed red",left:0,top:0,position:"fixed",pointerEvents:"none"};class DN{constructor(e){this.confirmOptions=e,this.status=da.Off,this.overlayAdded=!1,this.confirm=null,this.requestRecording=(n,r,i)=>{this.isActive||(this.status=da.Requested,this.confirm=new Zf(ON(this.confirmOptions)),this.confirm.mount().then(s=>{s?(this.acceptRecording(),r(),this.recordingAgent=n):(this.rejectRecording(),i())}).then(()=>{var s;(s=this.confirm)===null||s===void 0||s.remove()}).catch(s=>{var o;(o=this.confirm)===null||o===void 0||o.remove()}))},this.acceptRecording=()=>{if(!this.overlayAdded){const n=window.document.createElement("div");Object.assign(n.style,MN),n.className="or-recording-border",n.setAttribute("data-openreplay-obscured",""),n.setAttribute("data-openreplay-hidden",""),n.setAttribute("data-openreplay-ignore",""),window.document.body.appendChild(n),this.overlayAdded=!0,this.uiComponents=[n]}this.status=da.Recording},this.stopAgentRecording=n=>{n===this.recordingAgent&&this.rejectRecording()},this.stopRecording=()=>{this.rejectRecording()},this.rejectRecording=()=>{var n,r;(n=this.confirm)===null||n===void 0||n.remove(),this.status=da.Off,this.overlayAdded=!1,(r=this.uiComponents)===null||r===void 0||r.forEach(i=>
33{var s;return(s=i.parentElement)===null||s===void 0?void 0:s.removeChild(i)})}}get isActive(){return this.status!==da.Off}}const LN="11.0.20";class jN{constructor(e,n,r,i,s){this.canvas=e,this.canvasId=n,this.fps=r,this.onStream=i,this.logError=s;const o=this.canvas.captureStream(this.fps);this.emitStream(o)}restart(){const e=this.canvas.captureStream(this.fps);this.stream=e,this.emitStream(e)}toggleLocal(e){const n=document.getElementById("canvas-or-testing");n&&document.body.removeChild(n);const r=document.createElement("video");r.width=520,r.height=400,r.id="canvas-or-testing",r.setAttribute("autoplay","true"),r.setAttribute("muted","true"),r.setAttribute("playsinline","true"),r.crossOrigin="anonymous",document.body.appendChild(r),r.srcObject=e,r.play(),r.addEventListener("error",i=>{this.logError("Video error:",i)})}emitStream(e){if(e)return this.onStream(e);this.stream?this.onStream(this.stream):this.logError("no stream for canvas",this.canvasId)}stop(){var e;(e=this.stream)===null||e===void 0||e.getTracks().forEach(n=>n.stop()),this.stream=null}}var Xw={},FN=(function(t,e,n,r,i){var s=new Worker(Xw[e]||(Xw[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return s.onmessage=function(o){var a=o.data,l=a.$e$;if(l){var c=new Error(l[0]);c.code=l[1],c.stack=l[2],i(c,null)}else i(null,a)},s.postMessage(n,r),s}),Oi=Uint8Array,Kr=Uint16Array,Ep=Int32Array,Tp=new Oi([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Rp=new Oi([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),I1=new Oi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),J$=function(t,e){for(var n=new Kr(31),r
vendor: 9,834 bytes, line 33
33=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new Ep(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},Q$=J$(Tp,2),BN=Q$.b,eh=Q$.r;BN[28]=258,eh[258]=28;var HN=J$(Rp,0),A1=HN.r,th=new Kr(32768);for(var En=0;En<32768;++En){var io=(En&43690)>>1|(En&21845)<<1;io=(io&52428)>>2|(io&13107)<<2,io=(io&61680)>>4|(io&3855)<<4,th[En]=((io&65280)>>8|(io&255)<<8)>>1}var Il=(function(t,e,n){for(var r=t.length,i=0,s=new Kr(e);i<r;++i)t[i]&&++s[t[i]-1];var o=new Kr(e);for(i=1;i<e;++i)o[i]=o[i-1]+s[i-1]<<1;var a;if(n){a=new Kr(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],d=e-t[i],u=o[t[i]-1]++<<d,f=u|(1<<d)-1;u<=f;++u)a[th[u]>>l]=c}else for(a=new Kr(r),i=0;i<r;++i)t[i]&&(a[i]=th[o[t[i]-1]++]>>15-t[i]);return a}),Mo=new Oi(288);for(var En=0;En<144;++En)Mo[En]=8;for(var En=144;En<256;++En)Mo[En]=9;for(var En=256;En<280;++En)Mo[En]=7;for(var En=280;En<288;++En)Mo[En]=8;var hd=new Oi(32);for(var En=0;En<32;++En)hd[En]=5;var Z$=Il(Mo,9,0),e6=Il(hd,5,0),Wb=function(t){return(t+7)/8|0},t6=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Oi(t.subarray(e,n))},zN=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],n6=function(t,e,n){var r=new Error(e||zN[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,n6),!n)throw r;return r},ss=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},pl=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},Tf=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,s=n.slice();if(!i)return{t:Kb,l:0};if(i==1){var o=new Oi(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(R,O){return R.f-O.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,d=1,u=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};d!=i-1;)a=n[n[c].f<n[u].f?c++:u++],l=n[c!=d&&n[c].f<n[u].f?c++:u++],n[d++]={s:-1,f:a.f+l.f,l:a,r:l};for(var f=s[0].s,r=1;r<i;++r)s[r].s>f&&(f=s[r].s);var h=new Kr(f+1),p=nh(n[d-1],h,0);if(p>e){var r=0,g=0,v=p-e,b=1<<v;for(s.sort(function(O,T){return h[T.s]-h[O.s]||O.f-T.f});r<i;++r){var w=s[r].s;if(h[w]>e)g+=b-(1<<p-h[w]),h[w]=e;else break}for(g>>=v;g>0;){var C=s[r].s;h[C]<e?g-=1<<e-h[C]++-1:++r}for(;r>=0&&g;--r){var x=s[r].s;h[x]==e&&(--h[x],++g)}p=e}return{t:new Oi(h),l:p}},nh=function(t,e,n){return t.s==-1?Math.max(nh(t.l,e,n+1),nh(t.r,e,n+1)):e[t.s]=n},O1=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Kr(++e),r=0,i=t[0],s=1,o=function(l){n[r++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=t[a]}return{c:n.subarray(0,r),n:e}},ml=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},Gb=function(t,e,n){var r=n.length,i=Wb(e+2);t[i]=r&255,t[i+1]=r>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var s=0;s<r;++s)t[i+s+4]=n[s];return(i+4+r)*8},k1=function(t,e,n,r,i,s,o,a,l,c,d){ss(e,d++,n),++i[256];for(var u=Tf(i,15),f=u.t,h=u.l,p=Tf(s,15),g=p.t,v=p.l,b=O1(f),w=b.c,C=b.n,x=O1(g),R=x.c,O=x.n,T=new Kr(19),S=0;S<w.length;++S)++T[w[S]&31];for(var S=0;S<R.length;++S)++T[R[S]&31];for(var _=Tf(T,7),A=_.t,$=_.l,E=19;E>4&&!A[I1[E-1]];--E);var I=c+5<<3,D=ml(i,Mo)+ml(s,hd)+o,B=ml(i,f)+ml(s,g)+o+14+3*E+ml(T,A)+2*T[16]+3*T[17]+7*T[18];if(l>=0&&I<=D&&I<=B)return Gb(e,d,t.subarray(l,l+c));var j,z,q,ne;if(ss(e,d,1+(B<D)),d+=2,B<D){j=Il(f,h,0),z=f,q=Il(g,v,0),ne=g;var Z=Il(A,$,0);ss(e,d,C-257),ss(e,d+5,O-1),ss(e,d+10,E-4),d+=14;for(var S=0;S<E;++S)ss(e,d+3*S,A[I1[S]]);d+=3*E;for(var J=[w,R],de=0;de<2;++de)for(var X=J[de],S=0;S<X.length;++S){var V=X[S]&31;ss(e,d,Z[V]),d+=A[V],V>15&&(ss(e,d,X[S]>>5&127),d+=X[S]>>12)}}else j=Z$,z=Mo,q=e6,ne=hd;for(var S=0;S<a;++S){var te=r[S];if(te>255){var V=te>>18&31;pl(e,d,j[V+257]),d+=z[V+257],V>7&&(ss(e,d,te>>23&31),d+=Tp[V]);var ie=te&31;pl(e,d,q[ie]),d+=ne[ie],ie>3&&(pl(e,d,te>>5&8191),d+=Rp[ie])}else pl(e,d,j[te]),d+=z[te]}return pl(e,d,j[256]),d+z[256]},r6=new Ep([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Kb=new Oi(0),i6=function(t,e,n,r,i,s){var o=s.z||t.length,a=new Oi(r+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(r,a.length-i),c=s.l,d=(s.r||0)&7;if(e){d&&(l[0]=s.r>>3);for(var u=r6[e-1],f=u>>13,h=u&8191,p=(1<<n)-1,g=s.p||new Kr(32768),v=s.h||new Kr(p+1),b=Math.ceil(n/3),w=2*b,C=function(Se){return(t[Se]^t[Se+1]<<b^t[Se+2]<<w)&p},x=new Ep(25e3),R=new Kr(288),O=new Kr(32),T=0,S=0,_=s.i||0,A=0,$=s.w||0,E=0;_+2<o;++_){var I=C(_),D=_&32767,B=v[I];if(g[D]=B,v[I]=D,$<=_){var j=o-_;if((T>7e3||A>24576)&&(j>423||!c)){d=k1(t,l,0,x,R,O,S,A,E,_-E,d),A=T=S=0,E=_;for(var z=0;z<286;++z)R[z]=0;for(var z=0;z<30;++z)O[z]=0}var q=2,ne=0,Z=h,J=D-B&32767;if(j>2&&I==C(_-J))for(var de=Math.min(f,j)-1,X=Math.min(32767,_),V=Math.min(258,j);J<=X&&--Z&&D!=B;){if(t[_+q]==t[_+q-J]){for(var te=0;te<V&&t[_+te]==t[_+te-J];++te);if(te>q){if(q=te,ne=J,te>de)break;for(var ie=Math.min(J,te-2),ce=0,z=0;z<ie;++z){var ae=_-J+z&32767,ve=g[ae],xe=ae-ve&32767;xe>ce&&(ce=xe,B=ae)}}}D=B,B=g[D],J+=D-B&32767}if(ne){x[A++]=268435456|eh[q]<<18|A1[ne];var ge=eh[q]&31,le=A1[ne]&31;S+=Tp[ge]+Rp[le],++R[257+ge],++O[le],$=_+q,++T}else x[A++]=t[_],++R[t[_]]}}for(_=Math.max(_,$);_<o;++_)x[A++]=t[_],++R[t[_]];d=k1(t,l,c,x,R,O,S,A,E,_-E,d),c||(s.r=d&7|l[d/8|0]<<3,d-=7,s.h=v,s.p=g,s.i=_,s.w=$)}else{for(var _=s.w||0;_<o+c;_+=65535){var fe=_+65535;fe>=o&&(l[d/8|0]=c,fe=o),d=Gb(l,d+1,t.subarray(_,fe))}s.i=o}return t6(a,0,r+Wb(d)+i)},s6=(function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t})(),o6=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=s6[n&255^e[r]]^n>>>8;t=n},d:function(){return~t}}},Xb=function(t,e,n,r,i){if(!i&&(i={l:1},e.dictionary)){var s=e.dictionary.subarray(-32768),o=new Oi(s.length+t.length);o.set(s),o.set(t,s.length),t=o,i.w=s.length}return i6(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,i)},qN=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},Yw=function(t,e,n){for(var r=t(),i=t.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var a=r[o],l=s[o];if(typeof a=="function"){e+=";"+l+"=";var c=a.toString();if(a.prototype)if(c.indexOf("[native code]")!=-1){var d=c.indexOf(" ",8)+1;e+=c.slice(d,c.indexOf("(",d))}else{e+=c;for(var u in a.prototype)e+=";"+l+".prototype."+u+"="+a.prototype[u].toString()}else e+=c}else n[l]=a}return e},zu=[],UN=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},VN=function(t,e,n,r){if(!zu[n]){for(var i="",s={},o=t.length-1,a=0;a<o;++a)i=Yw(t[a],i,s);zu[n]={c:Yw(t[o],i,s),e:s}}var l=qN({},zu[n].e);return FN(zu[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,l,UN(l),r)},WN=function(){return[Oi,Kr,Ep,Tp,Rp,I1,eh,A1,Z$,Mo,e6,hd,th,r6,Kb,Il,ss,pl,Tf,nh,O1,ml,Gb,k1,Wb,t6,i6,Xb,XN,a6]},GN=function(){return[l6,c6,rh,o6,s6]},a6=function(t){return postMessage(t,[t.buffer])},KN=function(t,e,n,r,i,s){var o=VN(n,r,i,function(a,l){o.terminate(),s(a,l)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},rh=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},l6=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&rh(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},c6=function(t){return 10+(t.filename?t.filename.length+1:0)};function XN(t,e){return Xb(t,e||{},0,0)}function YN(t,e,n){return n||(n=e,e={}),typeof n!="function"&&n6(7),KN(t,e,[WN,GN,function(){return[Jw]}],function(r){return a6(Jw(r.data[0],r.data[1]))},2,n)}function Jw(t,e){e||(e={});var n=o6(),r=t.length;n.p(t);var i=Xb(t,e,c6(e),8),s=i.length;return l6(i,e),rh(i,s-8,n.d()),rh(i,s-4,r),i}var JN=typeof TextDecoder<"u"&&new TextDecoder,QN=0;try{JN.decode(Kb,{stream:!0}),QN=1}catch{}const ZN=new TextEncoder,rm="__openreplay_assist_continue",im="__openreplay_session_confirm";var ua;(function(t){t.Disabled="disabled",t.Continuation="continuation",t.Auto="auto"})(ua||(ua={}));var as;(function(t){t[t.Requesting=0]="Requesting",t[t.True=1]="True",t[t.False=2]="False"})(as||(as={}));class Ll{constructor(e,n,r=!1){var i;if(this.app=e,this.noSecureMode=r,this.version=LN,this.socket=null,this.calls=new Map,this.canvasPeers=new Map,this.canvasNodeCheckers=new Map,this.assistDemandedRestart=!1,this.userStopped=!1,this.pendingStart=null,this.titleNode=null,this.titleObserver=null,this.callingState=as.False,this.remoteControl=null,this.peerReconnectTimeout=null,this.socketReconnectTimeout=null,this.socketStableTimeout=null,this.socketReconnectAttempts=0,this.agents={},this.sessionConfirmed=!1,this.sessionConfirmWindow=null,this.canvasMap=new Map,this.iceCandidatesBuffer=new Map,this.tabBus=null,this.tabState={rcActive:void 0,isCallActive:!1,agentIds:[]},this.beginAssist=()=>{this.onStart(),this.publishState({type:"assist_state_check"}),this.titleObserver&&this.titleNode&&this.titleObserver.observe(this.titleNode,{childList:!0})},this.stop=()=>{this.userStopped=!0,this.pendingStart=null,this.continuationEnabled&&sessionStorage.removeItem(rm),this.options.requestConfirm&&(sessionStorage.removeItem(im),this.sessionConfirmed=!1),this.clean()},this.start=()=>{if(this.userStopped=!1,this.pendingStart=null,this.continuationEnabled&&sessionStorage.setItem(rm,"1"),!!this.app.active()){if(this.socket){this.socket.connect();return}this.beginAssist()}},this.requestSessionConfirm=s=>
33{this.canSendMessages||(this.emit("session_confirm_pending",void 0,!0),!this.sessionConfirmWindow&&(this.sessionConfirmWindow=new Zf(kN(this.options.sessionConfirm)),this.playNotificationSound(),this.sessionConfirmWindow.mount().then(o=>this.answerSessionConfirm(o,s)).catch(()=>{})))},this.answerSessionConfirm=(s,o,a=!1)=>{var l,c,d,u;if(this.closeSessionConfirmWindow(),s){if(this.sessionConfirmed)return;this.sessionConfirmed=!0,sessionStorage.setItem(im,"1"),this.emit("session_confirm_accepted",void 0,!0);try{(c=(l=this.options).onSessionConfirmApprove)===null||c===void 0||c.call(l,o||{})}catch(f){this.app.debug.error(f)}this.restartTracking(()=>{var f;return(f=this.remoteControl)===null||f===void 0?void 0:f.reconnect(Object.keys(this.agents))})}else{this.emit("session_confirm_rejected",void 0,!0);try{(u=(d=this.options).onSessionConfirmDeny)===null||u===void 0||u.call(d,o||{})}catch(f){this.app.debug.error(f)}}a||this.publishState({type:"assist_state",update:"confirm",confirmAnswer:s})},this.closeSessionConfirmWindow=()=>{var s;(s=this.sessionConfirmWindow)===null||s===void 0||s.remove(),this.sessionConfirmWindow=null},this.armSocketStableReset=()=>{this.clearSocketStableReset(),this.socketStableTimeout=setTimeout(()=>{this.socketStableTimeout=null,this.socketReconnectAttempts=0},Ll.SOCKET_STABLE_MS)},this.clearSocketStableReset=()=>{this.socketStableTimeout&&(clearTimeout(this.socketStableTimeout),this.socketStableTimeout=null)},this.scheduleSocketReconnect=()=>{if(this.userStopped||this.socketReconnectAttempts>=Ll.MAX_SOCKET_RECONNECT_ATTEMPTS){this.app.debug.warn("Assist: giving up on reconnecting the socket");return}this.socketReconnectTimeout&&clearTimeout(this.socketReconnectTimeout);const s=Math.min(1e3*2**this.socketReconnectAttempts,1e4);this.socketReconnectAttempts++,this.socketReconnectTimeout=setTimeout(()=>{this.socketReconnectTimeout=null,!(this.userStopped||!this.socket||this.socket.connected)&&this.socket.connect()},s)},this.registerConnectedAgents=s=>{if(s.length!==0){if(this.cleanCanvasConnections(),s.forEach(({socketId:o,agentInfo:a})=>{var l,c;const d=this.agents[o];this.agents[o]=Object.assign(Object.assign({},d),{agentInfo:a??(d==null?void 0:d.agentInfo),onDisconnect:d?d.onDisconnect:(c=(l=this.options).onAgentConnect)===null||c===void 0?void 0:c.call(l,a)})}),!this.canSendMessages){this.requestSessionConfirm(s[0].agentInfo);return}this.restartTracking(()=>{var o;return(o=this.remoteControl)===null||o===void 0?void 0:o.reconnect(Object.keys(this.agents))})}},this.restartInProgress=!1,this.pendingRestartCallbacks=[],this.setCallingState=s=>{this.callingState=s},this.callUI=null,this.annot=null,this.publishState=s=>{var o;Object.assign(this.tabState,s),(o=this.tabBus)===null||o===void 0||o.postMessage(s)},this.handleTabStateMessage=s=>{var o,a,l,c,d;if(s&&(s.data.type==="assist_state_check"&&(this.tabState.isCallActive||this.tabState.rcActive)&&this.publishState(Object.assign({type:"assist_state"},this.tabState)),s.data.type==="assist_state")){if(s.data.update==="call")if(s.data.isCallActive){this.callUI||(this.callUI=new tm(this.app.debug.error,this.options.callUITemplate,this.options.agentShortNames));const u=()=>{this.emit("call_end")};this.callUI.showControls(u),this.annot||(this.annot=new nm,this.annot.mount())}else(o=this.annot)===null||o===void 0||o.remove(),this.annot=null,(a=this.callUI)===null||a===void 0||a.hideControls(),(l=this.callUI)===null||l===void 0||l.remove(),this.callUI=null;s.data.update==="rc"&&(s.data.rcActive?(c=this.remoteControl)===null||c===void 0||c.grantControl(s.data.rcActive,!0):(d=this.remoteControl)===null||d===void 0||d.releaseControl(!1,!1,!0)),s.data.update==="confirm"&&this.options.requestConfirm&&(s.data.confirmAnswer?this.sessionConfirmed||this.answerSessionConfirm(!0,void 0,!0):this.sessionConfirmWindow&&this.answerSessionConfirm(!1,void 0,!0)),Object.assign(this.tabState,s.data)}},window.__OR_ASSIST_VERSION=this.version,this.options=Object.assign({session_calling_peer_key:"__openreplay_calling_peer",session_control_peer_key:"__openreplay_control_peer",config:null,serverURL:null,onCallStart:()=>{},onAgentConnect:()=>{},onRemoteControlStart:()=>{},onDragCamera:()=>{},callConfirm:{},controlConfirm:{},recordingConfirm:{},sessionConfirm:{},requestConfirm:!1,socketHost:"",compressionEnabled:!1,compressionMinBatchSize:5e3,agentShortNames:!1,ignoreAnonymous:!1,autostart:ua.Auto},n),this.app.options.assistSocketHost&&(this.options.socketHost=this.app.options.assistSocketHost),this.options.requestConfirm&&(this.sessionConfirmed=sessionStorage.getItem(im)==="1"),document.hidden!==void 0){const s=()=>
33this.emit("UPDATE_SESSION",{active:!document.hidden});e.attachEventListener(document,"visibilitychange",s,!1,!1)}this.tabBus="BroadcastChannel"in window?new BroadcastChannel("or-assist"):null,(i=this.tabBus)===null||i===void 0||i.addEventListener("message",this.handleTabStateMessage),this.titleNode=document.querySelector("title"),this.titleObserver=this.titleNode?new MutationObserver(()=>{this.emit("UPDATE_SESSION",{pageTitle:document.title})}):null,e.attachStartCallback(()=>{if(!(this.assistDemandedRestart||this.userStopped)&&this.shouldAutoStart()){if(this.options.ignoreAnonymous&&!this.app.getSessionInfo().userID){this.pendingStart=this.beginAssist;return}this.beginAssist()}}),e.attachStopCallback(()=>{var s;this.assistDemandedRestart||(this.clean(),this.socket=null,(s=this.titleObserver)===null||s===void 0||s.disconnect())}),e.attachCommitCallback(s=>{if(this.agentsConnected&&this.canSendMessages){const o=s.length;if(o===2&&s[0]._id===0&&s[1]._id===49)return;if(o>this.options.compressionMinBatchSize&&this.options.compressionEnabled){const a=[];if(o>1e4){const l=Math.floor(o/2),c=s.slice(0,l),d=s.slice(l);a.push(c),a.push(d)}else a.push(s);a.forEach(l=>{const c=JSON.stringify(l),d=ZN.encode(c);YN(d,{mtime:0},(u,f)=>{u?this.emit("messages",l):this.emit("messages_gz",f)})})}else this.emit("messages",s)}}),e.session.attachUpdateCallback(s=>{if(this.pendingStart&&s.userID){const o=this.pendingStart;this.pendingStart=null,o()}this.emit("UPDATE_SESSION",s)})}get continuationEnabled(){return this.options.autostart===ua.Continuation}shouldAutoStart(){switch(this.options.autostart){case ua.Disabled:return!1;case ua.Continuation:return sessionStorage.getItem(rm)==="1";case ua.Auto:default:return!0}}emit(e,n,r=!1){!r&&!this.canSendMessages||this.socket&&this.socket.emit(e,{meta:{tabId:this.app.getTabId()},data:n})}get canSendMessages(){return!this.options.requestConfirm||this.sessionConfirmed}restartTracking(e){if(this.restartInProgress){e&&this.pendingRestartCallbacks.push(e);return}if(!this.app.active())return;this.restartInProgress=!0,e&&this.pendingRestartCallbacks.push(e);const n=()=>{this.restartInProgress=!1;const r=this.pendingRestartCallbacks;return this.pendingRestartCallbacks=[],r};this.assistDemandedRestart=!0;try{this.app.stop(!1),this.app.clearBuffers()}catch(r){this.assistDemandedRestart=!1,n(),this.app.debug.error(r);return}this.app.waitStatus(0).then(()=>{this.app.allowAppStart(),setTimeout(()=>{this.app.start().then(()=>{this.assistDemandedRestart=!1}).then(()=>{n().forEach(r=>{try{r()}catch(i){this.app.debug.error(i)}})}).catch(r=>{this.assistDemandedRestart=!1,n(),this.app.debug.error(r)})},100)})}get agentsConnected(){return Object.keys(this.agents).length>0}getHost(){return this.options.socketHost?this.options.socketHost:this.options.serverURL?new URL(this.options.serverURL).host:this.app.getHost()}getBasePrefixUrl(){return this.options.serverURL?new URL(this.options.serverURL).pathname:""}onStart(){const e=this.app,n=e.getSessionID();let r=null,i=null,s=null;if(!n)return e.debug.error("No session ID");const o=`${e.getProjectKey()}-${n}-${this.app.getTabId()}`,a=this.socket=Ef(this.getHost(),{path:this.getBasePrefixUrl()+"/ws-assist/socket",query:{peerId:o,identity:"session",tabId:this.app.getTabId(),sessionInfo:JSON.stringify(Object.assign({pageTitle:document.title,active:!0,assistOnly:this.app.socketMode},this.app.getSessionInfo()))},extraHeaders:{sessionId:n},transports:["websocket"],withCredentials:!0,reconnection:!0,reconnectionAttempts:30,reconnectionDelay:1e3,reconnectionDelayMax:25e3,randomizationFactor:.5});a.onAny((...A)=>{A[0]==="messages"||A[0]==="UPDATE_SESSION"||A[0]!=="webrtc_call_ice_candidate"&&e.debug.log("Socket:",...A)}),a.on("close",A=>{e.debug.warn("Socket closed:",A)}),a.on("connect",()=>{this.armSocketStableReset()}),a.on("disconnect",()=>{this.clearSocketStableReset()}),a.on("SESSION_ALREADY_CONNECTED",()=>{this.clearSocketStableReset(),this.scheduleSocketReconnect()});const l=A=>{var $,E;return this.callUI||(this.callUI=new tm(e.debug.error,this.options.callUITemplate,this.options.agentShortNames)),this.remoteControl&&(($=this.callUI)===null||$===void 0||$.showRemoteControl(this.remoteControl.releaseControl)),this.agents[A]=Object.assign(Object.assign({},this.agents[A]),{onControlReleased:this.options.onRemoteControlStart((E=this.agents[A])===null||E===void 0?void 0:E.agentInfo)}
33),this.emit("control_granted",A),this.annot=new nm,this.annot.mount(),p.get(A)},c=(A,$)=>{var E,I,D,B,j;if(A){const z=this.agents[A],q=z==null?void 0:z.onControlReleased;z&&delete z.onControlReleased,typeof q=="function"&&q(),this.emit("control_rejected",A)}if(this.annot!=null&&(this.annot.remove(),this.annot=null),(E=this.callUI)===null||E===void 0||E.hideRemoteControl(),this.callingState!==as.True&&((I=this.callUI)===null||I===void 0||I.remove(),this.callUI=null),$){const z=A?(D=this.agents[A])===null||D===void 0?void 0:D.agentInfo:{};(j=(B=this.options).onRemoteControlDeny)===null||j===void 0||j.call(B,z||{})}};this.remoteControl=new NN(this.options,l,c,A=>this.emit("control_busy",A),A=>this.publishState({type:"assist_state",update:"rc",rcActive:A}));const d=()=>{a.emit("recording_accepted")},u=A=>{var $,E;a.emit("recording_rejected"),(E=($=this.options).onRecordingDeny)===null||E===void 0||E.call($,A||{})},f=new DN(this.options.recordingConfirm);function h(A,$,E){if(e.getTabId()===$.meta.tabId)return E==null?void 0:E(A,$.data)}this.remoteControl!==null&&(a.on("request_control",(A,$)=>{var E;this.canSendMessages&&h(A,$,(E=this.remoteControl)===null||E===void 0?void 0:E.requestControl)}),a.on("release_control",(A,$)=>{h(A,$,(E,I)=>{var D;return(D=this.remoteControl)===null||D===void 0?void 0:D.releaseControl(I)})}),a.on("scroll",(A,$)=>{var E;return h(A,$,(E=this.remoteControl)===null||E===void 0?void 0:E.scroll)}),a.on("click",(A,$)=>{var E;return h(A,$,(E=this.remoteControl)===null||E===void 0?void 0:E.click)}),a.on("move",(A,$)=>{var E;return h(A,$,(E=this.remoteControl)===null||E===void 0?void 0:E.move)}),a.on("startDrag",(A,$)=>{var E;return h(A,$,(E=this.remoteControl)===null||E===void 0?void 0:E.startDrag)}),a.on("drag",(A,$)=>{var E;return h(A,$,(E=this.remoteControl)===null||E===void 0?void 0:E.drag)}),a.on("stopDrag",(A,$)=>{var E;return h(A,$,(E=this.remoteControl)===null||E===void 0?void 0:E.stopDrag)}),a.on("focus",(A,$)=>h(A,$,(E,I)=>{const D=e.nodes.getNode(I);D instanceof HTMLElement&&this.remoteControl&&this.remoteControl.focus(E,D)})),a.on("input",(A,$)=>{var E;return h(A,$,(E=this.remoteControl)===null||E===void 0?void 0:E.input)}),a.on("select",(A,$)=>{var E;return h(A,$,(E=this.remoteControl)===null||E===void 0?void 0:E.select)})),a.on("moveAnnotation",(A,$)=>h(A,$,(E,I)=>this.annot&&this.annot.move(I))),a.on("startAnnotation",(A,$)=>h(A,$,(E,I)=>{var D;return(D=this.annot)===null||D===void 0?void 0:D.start(I)})),a.on("stopAnnotation",(A,$)=>{var E;return h(A,$,(E=this.annot)===null||E===void 0?void 0:E.stop)}),a.on("WEBRTC_CONFIG",A=>{A&&(this.config=JSON.parse(A))}),a.on("NEW_AGENT",(A,$)=>{var E,I;if(this.cleanCanvasConnections(),this.agents[A]={onDisconnect:(I=(E=this.options).onAgentConnect)===null||I===void 0?void 0:I.call(E,$),agentInfo:$},!this.canSendMessages){this.requestSessionConfirm($);return}this.restartTracking(()=>{var D;return(D=this.remoteControl)===null||D===void 0?void 0:D.reconnect([A])})}),a.on("AGENTS_INFO_CONNECTED",A=>{this.registerConnectedAgents((A||[]).filter($=>$==null?void 0:$.socketId).map($=>({socketId:$.socketId,agentInfo:$})))}),a.on("AGENTS_CONNECTED",A=>{const $=A||[];setTimeout(()=>{const E=$.filter(I=>I&&!this.agents[I]);E.length!==0&&this.registerConnectedAgents(E.map(I=>({socketId:I})))},0)}),a.on("AGENT_DISCONNECTED",A=>{var $,E,I;($=this.remoteControl)===null||$===void 0||$.releaseControl(),(I=(E=this.agents[A])===null||E===void 0?void 0:E.onDisconnect)===null||I===void 0||I.call(E),delete this.agents[A],this.calls.forEach(D=>D.close()),this.calls.clear(),f.stopAgentRecording(A),b({socketId:A}),this.agentsConnected||this.closeSessionConfirmWindow()}),a.on("NO_AGENT",()=>{var A;(A=this.remoteControl)===null||A===void 0||A.releaseControl(),Object.values(this.agents).forEach($=>{var E;return(E=$.onDisconnect)===null||E===void 0?void 0:E.call($)}),this.cleanCanvasConnections(),this.agents={},f.isActive&&f.stopRecording(),(this.callingState!==as.False||this.calls.size>0)&&C(),this.closeSessionConfirmWindow()}),a.on("call_end",(A,$)=>{if(!p.has(A)||!$){e.debug.warn("Received call_end from unknown agent",A);return}const{data:E}=$;b({socketId:A,callId:E})}),a.on("_agent_name",(A,$)=>{if(e.getTabId()!==$.meta.tabId)return;const E=$.data;p.set(A,E),v()}),a.on("webrtc_canvas_answer",async(A,$)=>
33{const E=this.canvasPeers.get($.id);if(E)try{await E.setRemoteDescription(new RTCSessionDescription($.answer))}catch(I){e.debug.error("Error adding ICE candidate",I)}}),a.on("webrtc_canvas_ice_candidate",async(A,$)=>{var E;const I=this.canvasPeers.get($.id);if(I)try{await I.addIceCandidate(new RTCIceCandidate($.candidate))}catch(D){e.debug.error("Error adding ICE candidate",D)}else this.iceCandidatesBuffer.set($.id,((E=this.iceCandidatesBuffer.get($.id))===null||E===void 0?void 0:E.concat([$.candidate]))||[$.candidate])}),a.on("videofeed",(A,$)=>{var E;if(e.getTabId()!==$.meta.tabId)return;const I=$.data;(E=this.callUI)===null||E===void 0||E.toggleVideoStream(I)}),a.on("request_recording",(A,$)=>{var E,I;if(!this.canSendMessages||e.getTabId()!==$.meta.tabId)return;const D=$.data;f.isActive?this.emit("recording_busy"):((I=(E=this.options).onRecordingRequest)===null||I===void 0||I.call(E,JSON.parse(D)),f.requestRecording(A,d,()=>u(D)))}),a.on("stop_recording",(A,$)=>{e.getTabId()===$.meta.tabId&&f.isActive&&f.stopAgentRecording(A)}),a.on("webrtc_call_offer",async(A,$)=>{this.canSendMessages&&(this.calls.has($.from)||await O($.from,$.offer))}),a.on("webrtc_call_ice_candidate",async(A,$)=>{var E;const I=this.calls.get($.from);if(I)try{await I.addIceCandidate(new RTCIceCandidate($.candidate))}catch(D){e.debug.error("Error adding ICE candidate",D)}else this.iceCandidatesBuffer.set($.from,((E=this.iceCandidatesBuffer.get($.from))===null||E===void 0?void 0:E.concat([$.candidate]))||[$.candidate])});const p=new Map,g={},v=()=>{var A;(A=this.callUI)===null||A===void 0||A.setAssistentName(p)};function b({socketId:A,callId:$}){p.delete(A),p.size===0?C():(v(),$&&w($))}const w=A=>{var $;($=this.calls.get(A))===null||$===void 0||$.close(),this.calls.delete(A)},C=()=>{var A,$,E,I;this.calls.forEach(D=>D.close()),this.calls.clear(),Object.values(g).forEach(D=>{D.stop()}),Object.keys(g).forEach(D=>{delete g[D]}),x(),((A=this.remoteControl)===null||A===void 0?void 0:A.status)===ds.Disabled?(($=this.callUI)===null||$===void 0||$.remove(),(E=this.annot)===null||E===void 0||E.remove(),this.callUI=null,this.annot=null):(I=this.callUI)===null||I===void 0||I.hideControls(),this.emit("UPDATE_SESSION",{agentIds:[],isCallActive:!1}),this.setCallingState(as.False),sessionStorage.removeItem(this.options.session_calling_peer_key),this.publishState({type:"assist_state",update:"call",isCallActive:!1,agentIds:[]}),s==null||s()},x=()=>{r&&(r.remove(),r=null,i=null)},R=async({pc:A,from:$})=>{try{const E=await A.createOffer();await A.setLocalDescription(E),this.emit("webrtc_call_offer",{from:$,offer:E})}catch(E){e.debug.error("Error with renegotiation:",E)}},O=async(A,$)=>{var E,I,D,B,j,z;e.debug.log("handleIncomingCallOffer",A);let q;JSON.parse(sessionStorage.getItem(this.options.session_calling_peer_key)||"[]").includes(A)||this.callingState===as.True?q=Promise.resolve(!0):(this.setCallingState(as.Requesting),q=T(),this.playNotificationSound(),setTimeout(()=>{this.callingState===as.Requesting&&S()},3e4));try{if(!await q){S(),(I=(E=this.options).onCallDeny)===null||I===void 0||I.call(E);return}const J=new RTCPeerConnection({iceServers:this.config});this.calls.set(A,J),this.callUI||(this.callUI=new tm(e.debug.error,this.options.callUITemplate,this.options.agentShortNames),this.callUI.setVideoToggleCallback(V=>{this.emit("videofeed",{streamId:A,enabled:V.enabled})})),this.callUI.showControls(S),this.annot||(this.annot=new nm,this.annot.mount());try{g[A]||(e.debug.log("starting new stream for",A),g[A]=await bN(J,R.bind(null,{pc:J,from:A}))),this.callUI.setLocalStreams(Object.values(g))}catch(V){e.debug.error("Error requesting local stream",V),S(),(B=(D=this.options).onCallDeny)===null||B===void 0||B.call(D);return}J.onicecandidate=V=>{V.candidate&&a.emit("webrtc_call_ice_candidate",{from:A,candidate:V.candidate})},J.ontrack=V=>{const te=V.streams[0];if(te&&this.callUI){this.callUI.addRemoteStream(te,A);const ie=()=>{var ce;(ce=this.callUI)===null||ce===void 0||ce.playRemote(),document.removeEventListener("click",ie)};document.addEventListener("click",ie)}},await J.setRemoteDescription(new RTCSessionDescription($));const de=await J.createAnswer();await J.setLocalDescription(de),a.emit("webrtc_call_answer",{from:A,answer:de}),this.applyBufferedIceCandidates(A),g[A].onVideoTrack(V=>{const te=J.getSenders().find(ie=>{var ce;return((ce=ie.track)===null||ce===void 0?void 0:ce.kind)==="video"});if(!te){e.debug.warn("No video sender found");return}te.replaceTrack(V)}),this.setCallingState(as.True),s||(s=(z=(j=this.options).onCallStart)===null||z===void 0?void 0:z.call(j));const X=Array.from(this.calls.keys());sessionStorage.setItem(this.options.session_calling_peer_key,JSON.stringify(X)),this.emit
33("UPDATE_SESSION",{agentIds:X,isCallActive:!0}),this.publishState({type:"assist_state",update:"call",isCallActive:!0,agentIds:X})}catch(Z){e.debug.log(Z)}},T=()=>i||(r=new Zf(IN(this.options.callConfirm||{text:this.options.confirmText,style:this.options.confirmStyle})),i=r.mount().then(A=>(x(),A))),S=()=>{this.emit("call_end"),C()},_=async(A,$)=>{if(this.canSendMessages)for(const E of Object.values(this.agents)){if(!E.agentInfo)continue;const I=`${E.agentInfo.peerId}-${E.agentInfo.id}-canvas-${$}`;if(!this.canvasPeers.has(I)){const D=new RTCPeerConnection({iceServers:this.config});this.canvasPeers.set(I,D),this.setupPeerListeners(I),this.applyBufferedIceCandidates(I),A.getTracks().forEach(j=>{D.addTrack(j,A)});const B=await D.createOffer();await D.setLocalDescription(B),a.emit("webrtc_canvas_offer",{offer:B,id:I})}}};e.nodes.attachNodeCallback(A=>{const $=e.nodes.getID(A);if($&&wN(A,"canvas")&&!e.sanitizer.isHidden($)){e.debug.log(`Creating stream for canvas ${$}`);const E=new jN(A,$,30,D=>{_(D,$)},e.debug.error);this.canvasMap.set($,E),this.canvasNodeCheckers.has($)&&clearInterval(this.canvasNodeCheckers.get($));const I=setInterval(()=>{A.ownerDocument.defaultView&&A.isConnected||(this.stopCanvasStream($),clearInterval(I))},5e3);this.canvasNodeCheckers.set($,I)}})}setupPeerListeners(e){const n=this.canvasPeers.get(e);n&&(n.onicecandidate=r=>{r.candidate&&this.socket&&this.socket.emit("webrtc_canvas_ice_candidate",{candidate:r.candidate,id:e})})}playNotificationSound(){"Audio"in window&&new Audio("https://static.openreplay.com/tracker-assist/notification.mp3").play().catch(e=>{this.app.debug.warn(e)})}clean(){var e;this.closeSessionConfirmWindow(),(e=this.remoteControl)===null||e===void 0||e.releaseControl(!1,!0),this.peerReconnectTimeout&&(clearTimeout(this.peerReconnectTimeout),this.peerReconnectTimeout=null),this.socketReconnectTimeout&&(clearTimeout(this.socketReconnectTimeout),this.socketReconnectTimeout=null),this.clearSocketStableReset(),this.cleanCanvasConnections(),this.calls.forEach(n=>n.close()),this.calls.clear(),this.socket&&(this.socket.disconnect(),this.app.debug.log("Socket disconnected")),this.canvasMap.clear(),this.canvasPeers.clear(),this.canvasNodeCheckers.forEach(n=>clearInterval(n)),this.canvasNodeCheckers.clear(),this.iceCandidatesBuffer.clear()}cleanCanvasConnections(){var e;this.canvasPeers.forEach(n=>n.close()),this.canvasPeers.clear(),(e=this.socket)===null||e===void 0||e.emit("webrtc_canvas_restart")}stopCanvasStream(e){var n,r;for(const s of Object.values(this.agents)){if(!s.agentInfo)continue;const o=`${s.agentInfo.peerId}-${s.agentInfo.id}-canvas-${e}`,a=this.canvasPeers.get(o);a&&((n=this.socket)===null||n===void 0||n.emit("webrtc_canvas_stop",{id:o}),a.close(),this.canvasPeers.delete(o))}(r=this.canvasMap.get(e))===null||r===void 0||r.stop(),this.canvasMap.delete(e);const i=this.canvasNodeCheckers.get(e);i&&(clearInterval(i),this.canvasNodeCheckers.delete(e))}applyBufferedIceCandidates(e){const n=this.iceCandidatesBuffer.get(e);n&&(n.forEach(r=>{var i;(i=this.calls.get(e))===null||i===void 0||i.addIceCandidate(new RTCIceCandidate(r))}),this.iceCandidatesBuffer.delete(e))}}Ll.MAX_SOCKET_RECONNECT_ATTEMPTS=5;Ll.SOCKET_STABLE_MS=1e4;function e_(t){return function(e,n={}){var r;if(e===null||!(!((r=navigator==null?void 0:navigator.mediaDevices)===null||r===void 0)&&r.getUserMedia)||e.insideIframe||!e.checkRequiredVersion||!e.checkRequiredVersion("14.0.14"))return;const i=new Ll(e,t,n.__DISABLE_SECURE_MODE);return e.debug.log(i),i}}const t_="YPDGafoT5JNgKj8woXyp",n_="https://replay.lawbot.ai/ingest";let Qw=!1,sm=!1,Zw=!1;function r_(){Qw||(nu.configure({projectKey:t_,ingestPoint:n_}),Qw=!0)}function i_(){Zw||(nu.use(e_()),Zw=!0)}async function s_(){if(!(typeof window>"u"||sm)){sm=!0;try{r_(),i_(),await nu.start()}catch{sm=!1}}}function Dce(t){if(typeof window>"u")return;const e=t==null?void 0:t.trim();if(e)try{nu.identify(e)}catch{}}function Lce(t){if(!(typeof window>"u"))for(const[e,n]of Object.entries(t)){const r=n==null?void 0:n.trim();if(r)try{nu.setMetadata(e,r)}catch{}}}const eS="https://chats.lawbot.ai",o_="w8riw7JM8jic7kUTFnXZ9C8p";let tS=!1;function a_(){var n;if(typeof document>"u"||tS)return;tS=!0,window.chatwootSettings={position:"right",type:"standard",launcherTitle:"Chat with us"};const t=document.createElement("script");t.src=`${eS}/packs/js/sdk.js`,t.async=!0,t.onload=()=>{var r;(r=window.chatwootSDK)==null||r.run({websiteToken:o_,baseUrl:eS})};const e=document.getElementsByTagName("script")[0];(n=e.parentNode)==null||n.insertBefore(t,e)}function jce(){if(!(typeof window>"u")){if(window.$chatwoot){window.$chatwoot.toggle("open");return}window.addEventListener("chatwoot:ready",()=>{var t;return(t=window.$chatwoot)==null?void 0:t.toggle("open")},{once:!0})}}const d6=()=>typeof window<"u"&&Wf.isNativePlatform();function l_(){return m.useEffect(()=>{s_(),a_()},[]),m.useEffect(()=>{if(!d6())return;const t=gI.addListener("backButton",({canGoBack:e})=>{e&&window.history.back()});return()=>{t.then(e=>e.remove())}},[]),N.jsxs(N.Fragment,{children:[N.jsx(XR,{}),N.jsx(YR,{})]})}const Ip=KR({component:l_}),c_=()=>dt(()=>import("./route.tsx-B751tQim.js"),__vite__mapDeps([4,1,2,3])),d_=ut("/_public")({component:ft(c_,"component")}),u6="https://lawbot.ai",nS="LawBot",u_=`${u6}/lawbot-engine.png`,f_="@lawbot";function $r(t){const e=`${u6}${t.path}`,n=t.image??u_,r=t.path==="/"?t.title:`${t.title} | ${nS}`,i=[{title:r},{name:"description",content:t.description},{name:"robots",content:t.noindex?"noindex, nofollow":"index, follow, max-image-preview:large"},{property:"og:type",content:"website"},{property:"og:site_name",content:nS},{property:"og:title",content:r},{property:"og:description",content:t.description},{property:"og:url",content:e},{property:"og:image",content:n},{property:"og:image:alt",content:t.title},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:site",content:f_},{name:"twitter:title",content:r},{name:"twitter:description",content:t.description},{name:"twitter:image",content:n}];return t.keywords&&i.push({name:"keywords",content:t.keywords}),{meta:i,links:[{rel:"canonical",href:e}]}}const h_=()=>dt(()=>import("./index-BtObsjjt.js").then(t=>t.i),__vite__mapDeps([5,1,2,6,7,8,9,10,11])),p_=ut("/_public/")({beforeLoad:()=>
vendor: 5,069 bytes, lines 33-43
33{if(d6())throw Cb({to:"/login"})},component:ft(h_,"component"),head:()=>$r({title:"LawBot — AI Receptionist & Voice Platform for Law Firms",description:"AI voice agents for law firms that answer calls 24/7, qualify potential clients, book consultations, perform legal intake, and automate follow-up. A smarter alternative to traditional legal answering services and virtual receptionists.",path:"/"})}),Fce=({text:t})=>N.jsxs("div",{className:"w-screen bg-[#161c3c] overflow-hidden","data-nav-theme":"dark",children:[N.jsx("style",{children:`
34          @keyframes marquee {
35            0% { transform: translateX(0); }
36            100% { transform: translateX(-50%); }
37          }
38          .marquee {
39            display: flex;
40            width: max-content;
41            animation: marquee 60s linear infinite;
42          }
43        `}),N.jsxs("div",{className:"marquee",children:[N.jsx("div",{className:"flex shrink-0",children:[...Array(8)].map((e,n)=>N.jsx("span",{className:"px-[18px] md:px-[24px] font-['Poppins',sans-serif] text-[12px] md:text-[16px] font-semibold leading-[30px] md:leading-[40px] uppercase text-white whitespace-nowrap",children:t},`first-${n}`))}),N.jsx("div",{className:"flex shrink-0",children:[...Array(8)].map((e,n)=>N.jsx("span",{className:"px-[18px] md:px-[24px] font-['Poppins',sans-serif] text-[12px] md:text-[16px] font-semibold leading-[30px] md:leading-[40px] uppercase text-white whitespace-nowrap",children:t},`second-${n}`))})]})]}),m_=()=>dt(()=>import("./index.tsx-CgGivGLQ.js"),__vite__mapDeps([12,1,2,3])),g_=ut("/app/")({component:ft(m_,"component")}),v_=()=>dt(()=>import("./route.tsx-CR4OGnrw.js"),__vite__mapDeps([13,1,14,15,2,3,16,17,18,19,20,21,22])),b_=ut("/app/archives")({component:ft(v_,"component")}),y_=()=>dt(()=>import("./assistant.tsx-CVYFPf4l.js"),__vite__mapDeps([23,1,2,24,25,3])),w_=ut("/app/assistant")({component:ft(y_,"component")}),S_=()=>dt(()=>import("./calls.tsx-BqhO8kZZ.js"),__vite__mapDeps([26,1,27,14,15,2,3,28,29,30])),C_=ut("/app/calls")({component:ft(S_,"component")}),x_=()=>dt(()=>import("./route.tsx-B-vIi1rU.js"),__vite__mapDeps([31,1,14,15,2,32,33,16,34,3])),$_=ut("/app/contacts")({component:ft(x_,"component")});var aa={},Cn={};/*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors */var om,rS;function E_(){if(rS)return om;rS=1;function t(k,P){return function(){return k.apply(P,arguments)}}const{toString:e}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:i}=Symbol,s=(({hasOwnProperty:k})=>(P,F)=>k.call(P,F))(Object.prototype),o=(k,P)=>{let F=k;const H=[];for(;F!=null&&F!==Object.prototype;){if(H.indexOf(F)!==-1)return!1;if(H.push(F),s(F,P))return!0;F=n(F)}return!1},a=(k,P)=>k!=null&&o(k,P)?k[P]:void 0,l=(k=>P=>{const F=e.call(P);return k[F]||(k[F]=F.slice(8,-1).toLowerCase())})(Object.create(null)),c=k=>(k=k.toLowerCase(),P=>l(P)===k),d=k=>P=>typeof P===k,{isArray:u}=Array,f=d("undefined");function h(k){return k!==null&&!f(k)&&k.constructor!==null&&!f(k.constructor)&&b(k.constructor.isBuffer)&&k.constructor.isBuffer(k)}const p=c("ArrayBuffer");function g(k){let P;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?P=ArrayBuffer.isView(k):P=k&&k.buffer&&p(k.buffer),P}const v=d("string"),b=d("function"),w=d("number"),C=k=>k!==null&&typeof k=="object",x=k=>k===!0||k===!1,R=k=>{if(!C(k))return!1;const P=n(k);return(P===null||P===Object.prototype||n(P)===null)&&!o(k,i)&&!o(k,r)},O=k=>{if(!C(k)||h(k))return!1;try{return Object.keys(k).length===0&&Object.getPrototypeOf(k)===Object.prototype}catch{return!1}},T=c("Date"),S=c("File"),_=k=>!!(k&&typeof k.uri<"u"),A=k=>k&&typeof k.getParts<"u",$=c("Blob"),E=c("FileList"),I=k=>C(k)&&b(k.pipe);function D(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof N0<"u"?N0:{}}const B=D(),j=typeof B.FormData<"u"?B.FormData:void 0,z=k=>{if(!k)return!1;if(j&&k instanceof j)return!0;const P=n(k);if(!P||P===Object.prototype||!b(k.append))return!1;const F=l(k);return F==="formdata"||F==="object"&&b(k.toString)&&k.toString()==="[object FormData]"},q=c("URLSearchParams"),[ne,Z,J,de]=["ReadableStream","Request","Response","Headers"].map(c),X=k=>k.trim?k.trim():k.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function V(k,P,{allOwnKeys:F=!1}={}){if(k===null||typeof k>"u")return;let H,U;if(typeof k!="object"&&(k=[k]),u(k))for(H=0,U=k.length;H<U;H++)P.call(null,k[H],H,k);else{if(h(k))return;const Q=F?Object.getOwnPropertyNames(k):Object.keys(k),oe=Q.length;let me;for(H=0;H<oe;H++)me=Q[H],P.call(null,k[me],me,k)}}function te(k,P){if(h(k))return null;P=P.toLowerCase();const F=Object.keys(k);let H=F.length,U;for(;H-- >0;)if(U=F[H],P===U.toLowerCase())return U;return null}const ie=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:N0,ce=k=>!f(k)&&k!==ie;function ae(...k){const{caseless:P,skipUndefined:F}=ce(this)&&this||{},H={},U=(Q,oe)=>{if(oe==="__proto__"||oe==="constructor"||oe==="prototype")return;const me=P&&typeof oe=="string"&&te(H,oe)||oe,Fe=s(H,me)?H[me]:void 0;R(Fe)&&R(Q)?H[me]=ae(Fe,Q):R(Q)?H[me]=ae({}
vendor: 13,548 bytes, lines 43-45
43,Q):u(Q)?H[me]=Q.slice():(!F||!f(Q))&&(H[me]=Q)};for(let Q=0,oe=k.length;Q<oe;Q++){const me=k[Q];if(!me||h(me)||(V(me,U),typeof me!="object"||u(me)))continue;const Fe=Object.getOwnPropertySymbols(me);for(let We=0;We<Fe.length;We++){const Ve=Fe[We];De.call(me,Ve)&&U(me[Ve],Ve)}}return H}const ve=(k,P,F,{allOwnKeys:H}={})=>(V(P,(U,Q)=>{F&&b(U)?Object.defineProperty(k,Q,{__proto__:null,value:t(U,F),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(k,Q,{__proto__:null,value:U,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:H}),k),xe=k=>(k.charCodeAt(0)===65279&&(k=k.slice(1)),k),ge=(k,P,F,H)=>{k.prototype=Object.create(P.prototype,H),Object.defineProperty(k.prototype,"constructor",{__proto__:null,value:k,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(k,"super",{__proto__:null,value:P.prototype}),F&&Object.assign(k.prototype,F)},le=(k,P,F,H)=>{let U,Q,oe;const me={};if(P=P||{},k==null)return P;do{for(U=Object.getOwnPropertyNames(k),Q=U.length;Q-- >0;)oe=U[Q],(!H||H(oe,k,P))&&!me[oe]&&(P[oe]=k[oe],me[oe]=!0);k=F!==!1&&n(k)}while(k&&(!F||F(k,P))&&k!==Object.prototype);return P},fe=(k,P,F)=>{k=String(k),(F===void 0||F>k.length)&&(F=k.length),F-=P.length;const H=k.indexOf(P,F);return H!==-1&&H===F},Se=k=>{if(!k)return null;if(u(k))return k;let P=k.length;if(!w(P))return null;const F=new Array(P);for(;P-- >0;)F[P]=k[P];return F},G=(k=>P=>k&&P instanceof k)(typeof Uint8Array<"u"&&n(Uint8Array)),he=(k,P)=>{const H=(k&&k[r]).call(k);let U;for(;(U=H.next())&&!U.done;){const Q=U.value;P.call(k,Q[0],Q[1])}},Ee=(k,P)=>{let F;const H=[];for(;(F=k.exec(P))!==null;)H.push(F);return H},Ie=c("HTMLFormElement"),ke=k=>k.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(F,H,U){return H.toUpperCase()+U}),{propertyIsEnumerable:De}=Object.prototype,He=c("RegExp"),Je=(k,P)=>{const F=Object.getOwnPropertyDescriptors(k),H={};V(F,(U,Q)=>{let oe;(oe=P(U,Q,k))!==!1&&(H[Q]=oe||U)}),Object.defineProperties(k,H)},ze=k=>{Je(k,(P,F)=>{if(b(k)&&["arguments","caller","callee"].includes(F))return!1;const H=k[F];if(b(H)){if(P.enumerable=!1,"writable"in P){P.writable=!1;return}P.set||(P.set=()=>{throw Error("Can not rewrite read-only method '"+F+"'")})}})},Ne=(k,P)=>{const F={},H=U=>{U.forEach(Q=>{F[Q]=!0})};return u(k)?H(k):H(String(k).split(P)),F},tt=()=>{},pt=(k,P)=>k!=null&&Number.isFinite(k=+k)?k:P;function gt(k){return!!(k&&b(k.append)&&k[i]==="FormData"&&k[r])}const y=k=>{const P=new WeakSet,F=H=>{if(C(H)){if(P.has(H))return;if(h(H))return H;if(!("toJSON"in H)){P.add(H);const U=u(H)?[]:{};return V(H,(Q,oe)=>{const me=F(Q);!f(me)&&(U[oe]=me)}),P.delete(H),U}}return H};return F(k)},K=c("AsyncFunction"),W=k=>k&&(C(k)||b(k))&&b(k.then)&&b(k.catch),re=((k,P)=>k?setImmediate:P?((F,H)=>(ie.addEventListener("message",({source:U,data:Q})=>{U===ie&&Q===F&&H.length&&H.shift()()},!1),U=>{H.push(U),ie.postMessage(F,"*")}))(`axios@${Math.random()}`,[]):F=>setTimeout(F))(typeof setImmediate=="function",b(ie.postMessage)),se=typeof queueMicrotask<"u"?queueMicrotask.bind(ie):typeof process<"u"&&process.nextTick||re,pe=k=>k!=null&&b(k[r]);var L={isArray:u,isArrayBuffer:p,isBuffer:h,isFormData:z,isArrayBufferView:g,isString:v,isNumber:w,isBoolean:x,isObject:C,isPlainObject:R,isEmptyObject:O,isReadableStream:ne,isRequest:Z,isResponse:J,isHeaders:de,isUndefined:f,isDate:T,isFile:S,isReactNativeBlob:_,isReactNative:A,isBlob:$,isRegExp:He,isFunction:b,isStream:I,isURLSearchParams:q,isTypedArray:G,isFileList:E,forEach:V,merge:ae,extend:ve,trim:X,stripBOM:xe,inherits:ge,toFlatObject:le,kindOf:l,kindOfTest:c,endsWith:fe,toArray:Se,forEachEntry:he,matchAll:Ee,isHTMLForm:Ie,hasOwnProperty:s,hasOwnProp:s,hasOwnInPrototypeChain:o,getSafeProp:a,reduceDescriptors:Je,freezeMethods:ze,toObjectSet:Ne,toCamelCase:ke,noop:tt,toFiniteNumber:pt,findKey:te,global:ie,isContextDefined:ce,isSpecCompliantForm:gt,toJSONObject:y,isAsyncFn:K,isThenable:W,setImmediate:re,asap:se,isIterable:pe,isSafeIterable:k=>k!=null&&o(k,r)&&pe(k)};const ye=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var ue=k=>{const P={};let F,H,U;return k&&k.split(`
44`).forEach(function(oe){U=oe.indexOf(":"),F=oe.substring(0,U).trim().toLowerCase(),H=oe.substring(U+1).trim(),!(!F||P[F]&&ye[F])&&(F==="set-cookie"?P[F]?P[F].push(H):P[F]=[H]:P[F]=P[F]?P[F]+", "+H:H)}),P};function be(k){let P=0,F=k.length;for(;P<F;){const H=k.charCodeAt(P);if(H!==9&&H!==32)break;P+=1}for(;F>P;){const H=k.charCodeAt(F-1);if(H!==9&&H!==32)break;F-=1}return P===0&&F===k.length?k:k.slice(P,F)}const we=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ae=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Pe(k,P){return L.isArray(k)?k.map(F=>Pe(F,P)):be(String(k).replace(P,""))}const je=k=>Pe(k,we),Xe=k=>Pe(k,Ae);function Ge(k){const P=Object.create(null);return L.forEach(k.toJSON(),(F,H)=>{P[H]=Xe(F)}),P}const it=Symbol("internals");function nt(k){return k&&String(k).trim().toLowerCase()}function Ut(k){return k===!1||k==null?k:L.isArray(k)?k.map(Ut):je(String(k))}function Bt(k){const P=Object.create(null),F=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let H;for(;H=F.exec(k);)P[H[1]]=H[2];return P}const ht=k=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(k.trim());function Et(k,P,F,H,U){if(L.isFunction(H))return H.call(this,P,F);if(U&&(P=F),!!L.isString(P)){if(L.isString(H))return P.indexOf(H)!==-1;if(L.isRegExp(H))return H.test(P)}}function Vt(k){return k.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(P,F,H)=>F.toUpperCase()+H)}function et(k,P){const F=L.toCamelCase(" "+P);["get","set","has"].forEach(H=>{Object.defineProperty(k,H+F,{__proto__:null,value:function(U,Q,oe){return this[H].call(this,P,U,Q,oe)},configurable:!0})})}class _e{constructor(P){P&&this.set(P)}set(P,F,H){const U=this;function Q(me,Fe,We){const Ve=nt(Fe);if(!Ve)return;const Ze=L.findKey(U,Ve);(!Ze||U[Ze]===void 0||We===!0||We===void 0&&U[Ze]!==!1)&&(U[Ze||Fe]=Ut(me))}const oe=(me,Fe)=>L.forEach(me,(We,Ve)=>Q(We,Ve,Fe));if(L.isPlainObject(P)||P instanceof this.constructor)oe(P,F);else if(L.isString(P)&&(P=P.trim())&&!ht(P))oe(ue(P),F);else if(L.isObject(P)&&L.isSafeIterable(P)){let me=Object.create(null),Fe,We;for(const Ve of P){if(!L.isArray(Ve))throw new TypeError("Object iterator must return a key-value pair");We=Ve[0],L.hasOwnProp(me,We)?(Fe=me[We],me[We]=L.isArray(Fe)?[...Fe,Ve[1]]:[Fe,Ve[1]]):me[We]=Ve[1]}oe(me,F)}else P!=null&&Q(F,P,H);return this}get(P,F){if(P=nt(P),P){const H=L.findKey(this,P);if(H){const U=this[H];if(!F)return U;if(F===!0)return Bt(U);if(L.isFunction(F))return F.call(this,U,H);if(L.isRegExp(F))return F.exec(U);throw new TypeError("parser must be boolean|regexp|function")}}}has(P,F){if(P=nt(P),P){const H=L.findKey(this,P);return!!(H&&this[H]!==void 0&&(!F||Et(this,this[H],H,F)))}return!1}delete(P,F){const H=this;let U=!1;function Q(oe){if(oe=nt(oe),oe){const me=L.findKey(H,oe);me&&(!F||Et(H,H[me],me,F))&&(delete H[me],U=!0)}}return L.isArray(P)?P.forEach(Q):Q(P),U}clear(P){const F=Object.keys(this);let H=F.length,U=!1;for(;H--;){const Q=F[H];(!P||Et(this,this[Q],Q,P,!0))&&(delete this[Q],U=!0)}return U}normalize(P){const F=this,H={};return L.forEach(this,(U,Q)=>{const oe=L.findKey(H,Q);if(oe){F[oe]=Ut(U),delete F[Q];return}const me=P?Vt(Q):String(Q).trim();me!==Q&&delete F[Q],F[me]=Ut(U),H[me]=!0}),this}concat(...P){return this.constructor.concat(this,...P)}toJSON(P){const F=Object.create(null);return L.forEach(this,(H,U)=>{H!=null&&H!==!1&&(F[U]=P&&L.isArray(H)?H.join(", "):H)}),F}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([P,F])=>P+": "+F).join(`
45`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(P){return P instanceof this?P:new this(P)}static concat(P,...F){const H=new this(P);return F.forEach(U=>H.set(U)),H}static accessor(P){const H=(this[it]=this[it]={accessors:{}}).accessors,U=this.prototype;function Q(oe){const me=nt(oe);H[me]||(et(U,oe),H[me]=!0)}return L.isArray(P)?P.forEach(Q):Q(P),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(_e.prototype,({value:k},P)=>{let F=P[0].toUpperCase()+P.slice(1);return{get:()=>k,set(H){this[F]=H}}}),L.freezeMethods(_e);const Me="[REDACTED ****]";function Ue(k){if(L.hasOwnProp(k,"toJSON"))return!0;let P=Object.getPrototypeOf(k);for(;P&&P!==Object.prototype;){if(L.hasOwnProp(P,"toJSON"))return!0;P=Object.getPrototypeOf(P)}return!1}function mt(k,P){const F=new Set(P.map(Q=>String(Q).toLowerCase())),H=[],U=Q=>{if(Q===null||typeof Q!="object"||L.isBuffer(Q))return Q;if(H.indexOf(Q)!==-1)return;Q instanceof _e&&(Q=Q.toJSON()),H.push(Q);let oe;if(L.isArray(Q))oe=[],Q.forEach((me,Fe)=>{const We=U(me);L.isUndefined(We)||(oe[Fe]=We)});else{if(!L.isPlainObject(Q)&&Ue(Q))return H.pop(),Q;oe=Object.create(null);for(const[me,Fe]of Object.entries(Q)){const We=F.has(me.toLowerCase())?Me:U(Fe);L.isUndefined(We)||(oe[me]=We)}}return H.pop(),oe};return U(k)}class $e extends Error{static from(P,F,H,U,Q,oe){const me=new $e(P.message,F||P.code,H,U,Q);return Object.defineProperty(me,"cause",{__proto__:null,value:P,writable:!0,enumerable:!1,configurable:!0}),me.name=P.name,P.status!=null&&me.status==null&&(me.status=P.status),oe&&Object.assign(me,oe),me}constructor(P,F,H,U,Q){super(P),Object.defineProperty(this,"message",{__proto__:null,value:P,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,F&&(this.code=F),H&&(this.config=H),U&&(this.request=U),Q&&(this.response=Q,this.status=Q.status)}toJSON(){const P=this.config,F=P&&L.hasOwnProp(P,"redact")?P.redact:void 0,H=L.isArray(F)&&F.length>0?mt(P,F):L.toJSONObject(P);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:H,code:this.code,status:this.status}}}$e.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",$e.ERR_BAD_OPTION="ERR_BAD_OPTION",$e.ECONNABORTED="ECONNABORTED",$e.ETIMEDOUT="ETIMEDOUT",$e.ECONNREFUSED="ECONNREFUSED",$e.ERR_NETWORK="ERR_NETWORK",$e.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",$e.ERR_DEPRECATED="ERR_DEPRECATED",$e.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",$e.ERR_BAD_REQUEST="ERR_BAD_REQUEST",$e.ERR_CANCELED="ERR_CANCELED",$e.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",$e.ERR_INVALID_URL="ERR_INVALID_URL",$e.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var zt=null;const Kt=100;function Xt(k){return L.isPlainObject(k)||L.isArray(k)}function Gt(k){return L.endsWith(k,"[]")?k.slice(0,-2):k}function _n(k,P,F){return k?k.concat(P).map(function(U,Q){return U=Gt(U),!F&&Q?"["+U+"]":U}).join(F?".":""):P}function Pn(k){return L.isArray(k)&&!k.some(Xt)}const Wn=L.toFlatObject(L,{},null,function(P){return/^is[A-Z]/.test(P)});function Gn(k,P,F){if(!L.isObject(k))throw new TypeError("target must be an object");P=P||new FormData,F=L.toFlatObject(F,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Tt,_t){return!L.isUndefined(_t[Tt])});const H=F.metaTokens,U=F.visitor||tn,Q=F.dots,oe=F.indexes,me=F.Blob||typeof Blob<"u"&&Blob,Fe=F.maxDepth===void 0?Kt:F.maxDepth,We=me&&L.isSpecCompliantForm(P),Ve=[];if(!L.isFunction(U))throw new TypeError("visitor must be a function");function Ze(Ke){if(Ke===null)return"";if(L.isDate(Ke))return Ke.toISOString();if(L.isBoolean(Ke))return Ke.toString();if(!We&&L.isBlob(Ke))throw new $e("Blob is not supported. Use a Buffer instead.");if(L.isArrayBuffer(Ke)||L.isTypedArray(Ke)){if(We&&typeof me=="function")return new me([Ke]);if(typeof Buffer<"u")return Buffer.from(Ke);throw new $e("Blob is not supported. Use a Buffer instead.",$e.ERR_NOT_SUPPORT)}return Ke}function At(Ke){if(Ke>Fe)throw new $e("Object is too deeply nested ("+Ke+" levels). Max depth: "+Fe,$e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ot(Ke,Tt){if(Fe===1/0)return JSON.stringify(Ke);const _t=[];return JSON.stringify(Ke,function(Rr,Mn){if(!L.isObject(Mn))return Mn;for(;_t.length&&_t[_t.length-1]!==this;)_t.pop();return _t.push(Mn),At(Tt+_t.length-1),Mn})}function tn(Ke,Tt,_t){let sn=Ke;if(L.isReactNative(P)&&L.isReactNativeBlob(Ke))return P.append(_n(_t,Tt,Q),Ze(Ke)),!1;if(Ke&&!_t&&typeof Ke=="object"){if(L.endsWith(Tt,"{}"))Tt=H?Tt:Tt.slice(0,-2),Ke=Ot(Ke,1);else if(L.isArray(Ke)&&Pn(Ke)||(L.isFileList(Ke)||L.endsWith(Tt,"[]"))&&(sn=L.toArray(Ke)))return Tt=Gt(Tt),sn.forEach(function(Mn,Qs){!(L.isUndefined(Mn)||Mn===null)&&P.append(oe===!0?_n([Tt],Qs,Q):oe===null?Tt:Tt+"[]",Ze(Mn))}),!1}return Xt(Ke)?!0:(P.append(_n(_t,Tt,Q),Ze(Ke)),!1)}const rn=Object.assign(Wn,{defaultVisitor:tn,convertValue:Ze,isVisitable:Xt});function Ct(Ke,Tt,_t=0){if(!L.isUndefined(Ke)){if(At(_t),Ve.indexOf(Ke)!==-1)throw new Error("Circular reference detected in "+Tt.join("."));Ve.push(Ke),L.forEach(Ke,function(Rr,Mn){(!(L.isUndefined(Rr)||Rr===null)&&U.call(P,Rr,L.isString(Mn)?Mn.trim():Mn,Tt,rn))===!0&&Ct(Rr,Tt?Tt.concat(Mn):[Mn],_t+1)}),Ve.pop()}}if(!L.isObject(k))throw new TypeError("data must be an object");return Ct(k),P}function vn(k){const P={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(k).replace(/[!'()~]|%20/g,function(H){return P[H]})}function On(k,P){this._pairs=[],k&&Gn(k,this,P)}const Ye=On.prototype;Ye.append=function(P,F){this._pairs.push([P,F])},Ye.toString=function(P){const F=P?H=>
vendor: 3,614 bytes, line 45
45P.call(this,H,vn):vn;return this._pairs.map(function(U){return F(U[0])+"="+F(U[1])},"").join("&")};function at(k){return encodeURIComponent(k).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function It(k,P,F){if(!P)return k;k=k||"";const H=L.isFunction(F)?{serialize:F}:F,U=L.getSafeProp(H,"encode")||at,Q=L.getSafeProp(H,"serialize");let oe;if(Q?oe=Q(P,H):oe=L.isURLSearchParams(P)?P.toString():new On(P,H).toString(U),oe){const me=k.indexOf("#");me!==-1&&(k=k.slice(0,me)),k+=(k.indexOf("?")===-1?"?":"&")+oe}return k}class Ft{constructor(){this.handlers=[]}use(P,F,H){return this.handlers.push({fulfilled:P,rejected:F,synchronous:H?H.synchronous:!1,runWhen:H?H.runWhen:null}),this.handlers.length-1}eject(P){this.handlers[P]&&(this.handlers[P]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(P){L.forEach(this.handlers,function(H){H!==null&&P(H)})}}var Zt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Zr=typeof URLSearchParams<"u"?URLSearchParams:On,Mr=typeof FormData<"u"?FormData:null,mi=typeof Blob<"u"?Blob:null,Zi={isBrowser:!0,classes:{URLSearchParams:Zr,FormData:Mr,Blob:mi},protocols:["http","https","file","blob","url","data"]};const mr=typeof window<"u"&&typeof document<"u",gr=typeof navigator=="object"&&navigator||void 0,es=mr&&(!gr||["ReactNative","NativeScript","NS"].indexOf(gr.product)<0),gi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$s=mr&&window.location.href||"http://localhost";var _i=Object.freeze({__proto__:null,hasBrowserEnv:mr,hasStandardBrowserEnv:es,hasStandardBrowserWebWorkerEnv:gi,navigator:gr,origin:$s}),en={..._i,...Zi};function vi(k,P){return Gn(k,new en.classes.URLSearchParams,{visitor:function(F,H,U,Q){return en.isNode&&L.isBuffer(F)?(this.append(H,F.toString("base64")),!1):Q.defaultVisitor.apply(this,arguments)},...P})}const ei=Kt;function ti(k){if(k>ei)throw new $e("FormData field is too deeply nested ("+k+" levels). Max depth: "+ei,$e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function ts(k){const P=[],F=/\w+|\[(\w*)]/g;let H;for(;(H=F.exec(k))!==null;)ti(P.length),P.push(H[0]==="[]"?"":H[1]||H[0]);return P}function Es(k){const P={},F=Object.keys(k);let H;const U=F.length;let Q;for(H=0;H<U;H++)Q=F[H],P[Q]=k[Q];return P}function Pt(k){function P(F,H,U,Q){ti(Q);let oe=F[Q++];if(oe==="__proto__")return!0;const me=Number.isFinite(+oe),Fe=Q>=F.length;return oe=!oe&&L.isArray(U)?U.length:oe,Fe?(L.hasOwnProp(U,oe)?U[oe]=L.isArray(U[oe])?U[oe].concat(H):[U[oe],H]:U[oe]=H,!me):((!L.hasOwnProp(U,oe)||!L.isObject(U[oe]))&&(U[oe]=[]),P(F,H,U[oe],Q)&&L.isArray(U[oe])&&(U[oe]=Es(U[oe])),!me)}if(L.isFormData(k)&&L.isFunction(k.entries)){const F={};return L.forEachEntry(k,(H,U)=>{P(ts(H),U,F,0)}),F}return null}const St=(k,P)=>k!=null&&L.hasOwnProp(k,P)?k[P]:void 0;function Bn(k,P,F){if(L.isString(k))try{return(P||JSON.parse)(k),L.trim(k)}catch(H){if(H.name!=="SyntaxError")throw H}return(F||JSON.stringify)(k)}const Tn={transitional:Zt,adapter:["xhr","http","fetch"],transformRequest:[function(P,F){const H=F.getContentType()||"",U=H.indexOf("application/json")>-1,Q=L.isObject(P);if(Q&&L.isHTMLForm(P)&&(P=new FormData(P)),L.isFormData(P))return U?JSON.stringify(Pt(P)):P;if(L.isArrayBuffer(P)||L.isBuffer(P)||L.isStream(P)||L.isFile(P)||L.isBlob(P)||L.isReadableStream(P))return P;if(L.isArrayBufferView(P))return P.buffer;if(L.isURLSearchParams(P))return F.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),P.toString();let me;
vendor: 25,341 bytes, lines 45-51
45if(Q){const Fe=St(this,"formSerializer");if(H.indexOf("application/x-www-form-urlencoded")>-1)return vi(P,Fe).toString();if((me=L.isFileList(P))||H.indexOf("multipart/form-data")>-1){const We=St(this,"env"),Ve=We&&We.FormData;return Gn(me?{"files[]":P}:P,Ve&&new Ve,Fe)}}return Q||U?(F.setContentType("application/json",!1),Bn(P)):P}],transformResponse:[function(P){const F=St(this,"transitional")||Tn.transitional,H=F&&F.forcedJSONParsing,U=St(this,"responseType"),Q=U==="json";if(L.isResponse(P)||L.isReadableStream(P))return P;if(P&&L.isString(P)&&(H&&!U||Q)){const me=!(F&&F.silentJSONParsing)&&Q;try{return JSON.parse(P,St(this,"parseReviver"))}catch(Fe){if(me)throw Fe.name==="SyntaxError"?$e.from(Fe,$e.ERR_BAD_RESPONSE,this,null,St(this,"response")):Fe}}return P}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:en.classes.FormData,Blob:en.classes.Blob},validateStatus:function(P){return P>=200&&P<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch","query"],k=>{Tn.headers[k]={}});function fn(k,P){const F=this||Tn,H=P||F,U=_e.from(H.headers);let Q=H.data;return L.forEach(k,function(me){Q=me.call(F,Q,U.normalize(),P?P.status:void 0)}),U.normalize(),Q}function Rn(k){return!!(k&&k.__CANCEL__)}class tr extends $e{constructor(P,F,H){super(P??"canceled",$e.ERR_CANCELED,F,H),this.name="CanceledError",this.__CANCEL__=!0}}function vr(k,P,F){const H=F.config.validateStatus;!F.status||!H||H(F.status)?k(F):P(new $e("Request failed with status code "+F.status,F.status>=400&&F.status<500?$e.ERR_BAD_REQUEST:$e.ERR_BAD_RESPONSE,F.config,F.request,F))}function qr(k){const P=/^([-+\w]{1,25}):(?:\/\/)?/.exec(k);return P&&P[1]||""}function bi(k,P){k=k||10;const F=new Array(k),H=new Array(k);let U=0,Q=0,oe;return P=P!==void 0?P:1e3,function(Fe){const We=Date.now(),Ve=H[Q];oe||(oe=We),F[U]=Fe,H[U]=We;let Ze=Q,At=0;for(;Ze!==U;)At+=F[Ze++],Ze=Ze%k;if(U=(U+1)%k,U===Q&&(Q=(Q+1)%k),We-oe<P)return;const Ot=Ve&&We-Ve;return Ot?Math.round(At*1e3/Ot):void 0}}function ni(k,P){let F=0,H=1e3/P,U,Q;const oe=(We,Ve=Date.now())=>{F=Ve,U=null,Q&&(clearTimeout(Q),Q=null),k(...We)};return[(...We)=>{const Ve=Date.now(),Ze=Ve-F;Ze>=H?oe(We,Ve):(U=We,Q||(Q=setTimeout(()=>{Q=null,oe(U)},H-Ze)))},()=>U&&oe(U)]}const ri=(k,P,F=3)=>{let H=0;const U=bi(50,250);return ni(Q=>{if(!Q||typeof Q.loaded!="number")return;const oe=Q.loaded,me=Q.lengthComputable?Q.total:void 0,Fe=me!=null?Math.min(oe,me):oe,We=Math.max(0,Fe-H),Ve=U(We);H=Math.max(H,Fe);const Ze={loaded:Fe,total:me,progress:me?Fe/me:void 0,bytes:We,rate:Ve||void 0,estimated:Ve&&me?(me-Fe)/Ve:void 0,event:Q,lengthComputable:me!=null,[P?"download":"upload"]:!0};k(Ze)},F)},lr=(k,P)=>{const F=k!=null;return[H=>P[0]({lengthComputable:F,total:k,loaded:H}),P[1]]},Ys=k=>(...P)=>L.asap(()=>k(...P));var uc=en.hasStandardBrowserEnv?((k,P)=>F=>(F=new URL(F,en.origin),k.protocol===F.protocol&&k.host===F.host&&(P||k.port===F.port)))(new URL(en.origin),en.navigator&&/(msie|trident)/i.test(en.navigator.userAgent)):()=>!0,Ur=en.hasStandardBrowserEnv?{write(k,P,F,H,U,Q,oe){if(typeof document>"u")return;const me=[`${k}=${encodeURIComponent(P)}`];L.isNumber(F)&&me.push(`expires=${new Date(F).toUTCString()}`),L.isString(H)&&me.push(`path=${H}`),L.isString(U)&&me.push(`domain=${U}`),Q===!0&&me.push("secure"),L.isString(oe)&&me.push(`SameSite=${oe}`),document.cookie=me.join("; ")},read(k){if(typeof document>"u")return null;const P=document.cookie.split(";");for(let F=0;F<P.length;F++){const H=P[F].replace(/^\s+/,""),U=H.indexOf("=");if(U!==-1&&H.slice(0,U)===k)try{return decodeURIComponent(H.slice(U+1))}catch{return H.slice(U+1)}}return null},remove(k){this.write(k,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Js(k){return typeof k!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(k)}function Zo(k,P){return P?k.replace(/\/?\/$/,"")+"/"+P.replace(/^\/+/,""):k}const Pi=/^https?:(?!\/\/)/i,ns=/[\t\n\r]/g;function ea(k){let P=0;for(;P<k.length&&k.charCodeAt(P)<=32;)P++;return k.slice(P)}function Ga(k){return ea(k).replace(ns,"")}function Ka(k,P){if(typeof k=="string"&&Pi.test(Ga(k)))throw new $e('Invalid URL: missing "//" after protocol',$e.ERR_INVALID_URL,P)}function Xa(k,P,F,H){Ka(P,H);let U=!Js(P);return k&&(U||F===!1)?(Ka(k,H),Zo(k,P)):P}const Ya=k=>k instanceof _e?{...k}:k;function ot(k,P){k=k||{},P=P||{};const F=Object.create(null);Object.defineProperty(F,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function H(Ve,Ze,At,Ot){return L.isPlainObject(Ve)&&L.isPlainObject(Ze)?L.merge.call({caseless:Ot},Ve,Ze):L.isPlainObject(Ze)?L.merge({},Ze):L.isArray(Ze)?Ze.slice():Ze}function U(Ve,Ze,At,Ot){if(L.isUndefined(Ze)){if(!L.isUndefined(Ve))return H(void 0,Ve,At,Ot)}else return H(Ve,Ze,At,Ot)}function Q(Ve,Ze){if(!L.isUndefined(Ze))return H(void 0,Ze)}function oe(Ve,Ze){if(L.isUndefined(Ze)){if(!L.isUndefined(Ve))return H(void 0,Ve)}else return H(void 0,Ze)}function me(Ve){const Ze=L.hasOwnProp(P,"transitional")?P.transitional:void 0;if(!L.isUndefined(Ze))if(L.isPlainObject(Ze)){if(L.hasOwnProp(Ze,Ve))return Ze[Ve]}else return;const At=L.hasOwnProp(k,"transitional")?k.transitional:void 0;if(L.isPlainObject(At)&&L.hasOwnProp(At,Ve))return At[Ve]}function Fe(Ve,Ze,At){if(L.hasOwnProp(P,At))return H(Ve,Ze);if(L.hasOwnProp(k,At))return H(void 0,Ve)}const We={url:Q,method:Q,data:Q,baseURL:oe,transformRequest:oe,transformResponse:oe,paramsSerializer:oe,timeout:oe,timeoutMessage:oe,withCredentials:oe,withXSRFToken:oe,adapter:oe,responseType:oe,xsrfCookieName:oe,xsrfHeaderName:oe,onUploadProgress:oe,onDownloadProgress:oe,decompress:oe,maxContentLength:oe,maxBodyLength:oe,beforeRedirect:oe,transport:oe,httpAgent:oe,httpsAgent:oe,cancelToken:oe,socketPath:oe,allowedSocketPaths:oe,responseEncoding:oe,validateStatus:Fe,headers:(Ve,Ze,At)=>U(Ya(Ve),Ya(Ze),At,!0)};return L.forEach(Object.keys({...k,...P}),function(Ze){if(Ze==="__proto__"||Ze==="constructor"||Ze==="prototype")return;const At=L.hasOwnProp(We,Ze)?We[Ze]:U,Ot=L.hasOwnProp(k,Ze)?k[Ze]:void 0,tn=L.hasOwnProp(P,Ze)?P[Ze]:void 0,rn=At(Ot,tn,Ze);L.isUndefined(rn)&&At!==Fe||(F[Ze]=rn)}),L.hasOwnProp(P,"validateStatus")&&L.isUndefined(P.validateStatus)&&me("validateStatusUndefinedResolves")===!1&&(L.hasOwnProp(k,"validateStatus")?F.validateStatus=H(void 0,k.validateStatus):delete F.validateStatus),F}const $t=["content-type","content-length"];function bn(k,P,F){if(F!=="content-only"){k.set(P);return}Object.entries(P||{}).forEach(([H,U])=>{$t.includes(H.toLowerCase())&&k.set(H,U)})}const Hn=k=>encodeURIComponent(k).replace(/%([0-9A-F]{2})/gi,(P,F)=>String.fromCharCode(parseInt(F,16)));function Sn(k){const P=ot({},k),F=At=>L.hasOwnProp(P,At)?P[At]:void 0,H=F("data");let U=F("withXSRFToken");const Q=F("xsrfHeaderName"),oe=F("xsrfCookieName");let me=F("headers");const Fe=F("auth"),We=F("baseURL"),Ve=F("allowAbsoluteUrls"),Ze=F("url");if(P.headers=me=_e.from(me),P.url=It(Xa(We,Ze,Ve,P),F("params"),F("paramsSerializer")),Fe){const At=L.getSafeProp(Fe,"username")||"",Ot=L.getSafeProp(Fe,"password")||"";try{me.set("Authorization","Basic "+btoa(At+":"+(Ot?Hn(Ot):"")))}catch(tn){throw $e.from(tn,$e.ERR_BAD_OPTION_VALUE,k)}}if(L.isFormData(H)&&(en.hasStandardBrowserEnv||en.hasStandardBrowserWebWorkerEnv||L.isReactNative(H)?me.setContentType(void 0):L.isFunction(H.getHeaders)&&bn(me,H.getHeaders(),F("formDataHeaderPolicy"))),en.hasStandardBrowserEnv&&(L.isFunction(U)&&(U=U(P)),U===!0||U==null&&uc(P.url))){const Ot=Q&&oe&&Ur.read(oe);Ot&&me.set(Q,Ot)}return P}var hc=typeof XMLHttpRequest<"u"&&function(k){return new Promise(function(F,H){const U=Sn(k);let Q=U.data;const oe=_e.from(U.headers).normalize();let{responseType:me,onUploadProgress:Fe,onDownloadProgress:We}=U,Ve,Ze,At,Ot,tn;function rn(){Ot&&Ot(),tn&&tn(),U.cancelToken&&U.cancelToken.unsubscribe(Ve),U.signal&&U.signal.removeEventListener("abort",Ve)}let Ct=new XMLHttpRequest;Ct.open(U.method.toUpperCase(),U.url,!0),Ct.timeout=U.timeout;function Ke(){if(!Ct)return;const _t=_e.from("getAllResponseHeaders"in Ct&&Ct.getAllResponseHeaders()),Rr={data:!me||me==="text"||me==="json"?Ct.responseText:Ct.response,status:Ct.status,statusText:Ct.statusText,headers:_t,config:k,request:Ct};vr(function(Qs){F(Qs),rn()},function(Qs){H(Qs),rn()},Rr),Ct=null}"onloadend"in Ct?Ct.onloadend=Ke:Ct.onreadystatechange=function(){!Ct||Ct.readyState!==4||Ct.status===0&&!(Ct.responseURL&&Ct.responseURL.startsWith("file:"))||setTimeout(Ke)},Ct.onabort=function(){Ct&&(H(new $e("Request aborted",$e.ECONNABORTED,k,Ct)),rn(),Ct=null)},Ct.onerror=function(sn){const Rr=sn&&sn.message?sn.message:"Network Error",Mn=new $e(Rr,$e.ERR_NETWORK,k,Ct);Mn.event=sn||null,H(Mn),rn(),Ct=null},Ct.ontimeout=function(){let sn=U.timeout?"timeout of "+U.timeout+"ms exceeded":"timeout exceeded";const Rr=U.transitional||Zt;U.timeoutErrorMessage&&(sn=U.timeoutErrorMessage),H(new $e(sn,Rr.clarifyTimeoutError?$e.ETIMEDOUT:$e.ECONNABORTED,k,Ct)),rn(),Ct=null},Q===void 0&&oe.setContentType(null),"setRequestHeader"in Ct&&L.forEach(Ge(oe),function(sn,Rr){Ct.setRequestHeader(Rr,sn)}),L.isUndefined(U.withCredentials)||(Ct.withCredentials=!!U.withCredentials),me&&me!=="json"&&(Ct.responseType=U.responseType),We&&([At,tn]=ri(We,!0),Ct.addEventListener("progress",At)),Fe&&Ct.upload&&([Ze,Ot]=ri(Fe),Ct.upload.addEventListener("progress",Ze),Ct.upload.addEventListener("loadend",Ot)),(U.cancelToken||U.signal)&&(Ve=_t=>{Ct&&(H(!_t||_t.type?new tr(null,k,Ct):_t),Ct.abort(),rn(),Ct=null)},U.cancelToken&&U.cancelToken.subscribe(Ve),U.signal&&(U.signal.aborted?Ve():U.signal.addEventListener("abort",Ve)));const Tt=qr(U.url);if(Tt&&!en.protocols.includes(Tt)){H(new $e("Unsupported protocol "+Tt+":",$e.ERR_BAD_REQUEST,k)),rn();return}Ct.send(Q||null)})};const $u=(k,P)=>{if(k=k?k.filter(Boolean):[],!P&&!k.length)return;const F=new AbortController;let H=!1;const U=function(Fe){if(!H){H=!0,oe();const We=Fe instanceof Error?Fe:this.reason;F.abort(We instanceof $e?We:new tr(We instanceof Error?We.message:We))}};let Q=P&&setTimeout(()=>{Q=null,U(new $e(`timeout of ${P}ms exceeded`,$e.ETIMEDOUT))},P);const oe=()=>{k&&(Q&&clearTimeout(Q),Q=null,k.forEach(Fe=>{Fe.unsubscribe?Fe.unsubscribe(U):Fe.removeEventListener("abort",U)}),k=null)};k.forEach(Fe=>Fe.addEventListener("abort",U,{once:!0}));const{signal:me}=F;return me.unsubscribe=()=>L.asap(oe),me},Ja=function*(k,P){let F=k.byteLength;if(F<P){yield k;return}let H=0,U;for(;H<F;)U=H+P,yield k.slice(H,U),H=U},IR=async function*(k,P){for await(const F of AR(k))yield*Ja(F,P)},AR=async function*(k){if(k[Symbol.asyncIterator]){yield*k;return}const P=k.getReader();try{for(;;){const{done:F,value:H}=await P.read();if(F)break;yield H}}finally{await P.cancel()}},x2=(k,P,F,H)=>{const U=IR(k,P);let Q=0,oe,me=Fe=>{oe||(oe=!0,H&&H(Fe))};return new ReadableStream({async pull(Fe){try{const{done:We,value:Ve}=await U.next();if(We){me(),Fe.close();return}let Ze=Ve.byteLength;if(F){let At=Q+=Ze;F(At)}Fe.enqueue(new Uint8Array(Ve))}catch(We){throw me(We),We}},cancel(Fe){return me(Fe),U.return()}},{highWaterMark:2})},Eu=k=>k>=48&&k<=57||k>=65&&k<=70||k>=97&&k<=102,OR=(k,P,F)=>P+2<F&&Eu(k.charCodeAt(P+1))&&Eu(k.charCodeAt(P+2));function kR(k){if(!k||typeof k!="string"||!k.startsWith("data:"))return 0;const P=k.indexOf(",");if(P<0)return 0;const F=k.slice(5,P),H=k.slice(P+1);if(/;base64/i.test(F)){let oe=H.length;const me=H.length;for(let Ot=0;Ot<me;Ot++)if(H.charCodeAt(Ot)===37&&Ot+2<me){const tn=H.charCodeAt(Ot+1),rn=H.charCodeAt(Ot+2);Eu(tn)&&Eu(rn)&&(oe-=2,Ot+=2)}let Fe=0,We=me-1;const Ve=Ot=>Ot>=2&&H.charCodeAt(Ot-2)===37&&H.charCodeAt(Ot-1)===51&&(H.charCodeAt(Ot)===68||H.charCodeAt(Ot)===100);We>=0&&(H.charCodeAt(We)===61?(Fe++,We--):Ve(We)&&(Fe++,We-=3)),Fe===1&&We>=0&&(H.charCodeAt(We)===61||Ve(We))&&Fe++;const At=Math.floor(oe/4)*3-(Fe||0);return At>0?At:0}let Q=0;for(let oe=0,me=H.length;oe<me;oe++){const Fe=H.charCodeAt(oe);if(Fe===37&&OR(H,oe,me))Q+=1,oe+=2;else if(Fe<128)Q+=1;else if(Fe<2048)Q+=2;else if(Fe>=55296&&Fe<=56319&&oe+1<me){const We=H.charCodeAt(oe+1);We>=56320&&We<=57343?(Q+=4,oe++):Q+=3}else Q+=3}return Q}const x0="1.18.1",$2=64*1024,{isFunction:Tu}=L,NR=k=>encodeURIComponent(k).replace(/%([0-9A-F]{2})/gi,(P,F)=>String.fromCharCode(parseInt(F,16))),E2=k=>{if(!L.isString(k))return k;try{return decodeURIComponent(k)}catch{return k}},T2=(k,...P)=>{try{return!!k(...P)}catch{return!1}},_R=k=>{const P=k.indexOf("://");let F=k;return P!==-1&&(F=F.slice(P+3)),F.includes("@")||F.includes(":")},PR=k=>{const P=L.global!==void 0&&L.global!==null?L.global:globalThis,{ReadableStream:F,TextEncoder:H}=P;k=L.merge.call({skipUndefined:!0},{Request:P.Request,Response:P.Response},k);const{fetch:U,Request:Q,Response:oe}=k,me=U?Tu(U):typeof fetch=="function",Fe=Tu(Q),We=Tu(oe);if(!me)return!1;const Ve=me&&Tu(F),Ze=me&&(typeof H=="function"?(Ke=>Tt=>Ke.encode(Tt))(new H):async Ke=>new Uint8Array(await new Q(Ke).arrayBuffer())),At=Fe&&Ve&&T2(()=>{let Ke=!1;const Tt=new Q(en.origin,{body:new F,method:"POST",get duplex(){return Ke=!0,"half"}}),_t=Tt.headers.has("Content-Type");return Tt.body!=null&&Tt.body.cancel(),Ke&&!_t}),Ot=We&&Ve&&T2(()=>L.isReadableStream(new oe("").body)),tn={stream:Ot&&(Ke=>Ke.body)};me&&["text","arrayBuffer","blob","formData","stream"].forEach(Ke=>{!tn[Ke]&&(tn[Ke]=(Tt,_t)=>{let sn=Tt&&Tt[Ke];if(sn)return sn.call(Tt);throw new $e(`Response type '${Ke}' is not supported`,$e.ERR_NOT_SUPPORT,_t)})});const rn=async Ke=>{if(Ke==null)return 0;if(L.isBlob(Ke))return Ke.size;if(L.isSpecCompliantForm(Ke))return(await new Q(en.origin,{method:"POST",body:Ke}).arrayBuffer()).byteLength;if(L.isArrayBufferView(Ke)||L.isArrayBuffer(Ke))return Ke.byteLength;if(L.isURLSearchParams(Ke)&&(Ke=Ke+""),L.isString(Ke))return(await Ze(Ke)).byteLength},Ct=async(Ke,Tt)=>{const _t=L.toFiniteNumber(Ke.getContentLength());return _t??rn(Tt)};return async Ke=>{let{url:Tt,method:_t,data:sn,signal:Rr,cancelToken:Mn,timeout:Qs,onDownloadProgress:I0,onUploadProgress:A0,responseType:Zs,headers:eo,withCredentials:Au="same-origin",fetchOptions:_2,maxContentLength:rs,maxBodyLength:Ou}=Sn(Ke);const pc=L.isNumber(rs)&&rs>-1,O0=L.isNumber(Ou)&&Ou>-1,HR=dn=>L.hasOwnProp(Ke,dn)?Ke[dn]:void 0;let P2=U||fetch;Zs=Zs?(Zs+"").toLowerCase():"text";let to=$u([Rr,Mn&&Mn.toAbortSignal()],Qs),br=null;const na=to&&to.unsubscribe&&(()=>{to.unsubscribe()});let Qa,mc=null;const M2=()=>new $e("Request body larger than maxBodyLength limit",$e.ERR_BAD_REQUEST,Ke,br);try{let dn;const yi=HR("auth");if(yi){const Mt=L.getSafeProp(yi,"username")||"",ii=L.getSafeProp(yi,"password")||"";dn={username:Mt,password:ii}}if(_R(Tt)){const Mt=new URL(Tt,en.origin);if(!dn&&(Mt.username||Mt.password)){const ii=E2(Mt.username),no=E2(Mt.password);dn={username:ii,password:no}}(Mt.username||Mt.password)&&(Mt.username="",Mt.password="",Tt=Mt.href)}if(dn&&(eo.delete("authorization"),eo.set("Authorization","Basic "+btoa(NR((dn.username||"")+":"+(dn.password||""))))),pc&&typeof Tt=="string"&&Tt.startsWith("data:")&&kR(Tt)>rs)throw new $e("maxContentLength size of "+rs+" exceeded",$e.ERR_BAD_RESPONSE,Ke,br);if(O0&&_t!=="get"&&_t!=="head"){const Mt=await rn(sn);if(typeof Mt=="number"&&isFinite(Mt)&&(Qa=Mt,Mt>Ou))throw M2()}const ku=O0&&(L.isReadableStream(sn)||L.isStream(sn)),D2=(Mt,ii,no)=>x2(Mt,$2,ra=>{if(O0&&ra>Ou)throw mc=M2();ii&&ii(ra)},no);if(At&&_t!=="get"&&_t!=="head"&&(A0||ku)){if(Qa=Qa??await Ct(eo,sn),Qa!==0||ku){let Mt=new Q(Tt,{method:"POST",body:sn,duplex:"half"}),ii;if(L.isFormData(sn)&&(ii=Mt.headers.get("content-type"))&&eo.setContentType(ii),Mt.body){const[no,ra]=A0&&lr(Qa,ri(Ys(A0)))||[];sn=D2(Mt.body,no,ra)}}}else if(ku&&!Fe&&Ve&&_t!=="get"&&_t!=="head")sn=D2(sn);else if(ku&&Fe&&!At&&_t!=="get"&&_t!=="head")throw new $e("Stream request bodies are not supported by the current fetch implementation",$e.ERR_NOT_SUPPORT,Ke,br);L.isString(Au)||(Au=Au?"include":"omit");const zR=Fe&&"credentials"in Q.prototype;if(L.isFormData(sn)){const Mt=eo.getContentType();Mt&&/^multipart\/form-data/i.test(Mt)&&!/boundary=/i.test(Mt)&&eo.delete("content-type")}eo.set("User-Agent","axios/"+x0,!1);const L2={..._2,signal:to,method:_t.toUpperCase(),headers:Ge(eo.normalize()),body:sn,duplex:"half",credentials:zR?Au:void 0};br=Fe&&new Q(Tt,L2);let Ts=await(Fe?P2(br,_2):P2(Tt,L2));const j2=_e.from(Ts.headers);if(pc){const Mt=L.toFiniteNumber(j2.getContentLength());if(Mt!=null&&Mt>rs)throw new $e("maxContentLength size of "+rs+" exceeded",$e.ERR_BAD_RESPONSE,Ke,br)}const k0=Ot&&(Zs==="stream"||Zs==="response");if(Ot&&Ts.body&&(I0||pc||k0&&na)){const Mt={};["status","statusText","headers"].forEach(gc=>{Mt[gc]=Ts[gc]});const ii=L.toFiniteNumber(j2.getContentLength()),[no,ra]=I0&&lr(ii,ri(Ys(I0),!0))||[];let F2=0;const qR=gc=>{if(pc&&(F2=gc,F2>rs))throw new $e("maxContentLength size of "+rs+" exceeded",$e.ERR_BAD_RESPONSE,Ke,br);no&&no(gc)};Ts=new oe(x2(Ts.body,$2,qR,()=>{ra&&ra(),na&&na()}),Mt)}Zs=Zs||"text";let Rs=await tn[L.findKey(tn,Zs)||"text"](Ts,Ke);if(pc&&!Ot&&!k0){let Mt;if(Rs!=null&&(typeof Rs.byteLength=="number"?Mt=Rs.byteLength:typeof Rs.size=="number"?Mt=Rs.size:typeof Rs=="string"&&(Mt=typeof H=="function"?new H().encode(Rs).byteLength:Rs.length)),typeof Mt=="number"&&Mt>rs)throw new $e("maxContentLength size of "+rs+" exceeded",$e.ERR_BAD_RESPONSE,Ke,br)}return!k0&&na&&na(),await new Promise((Mt,ii)=>{vr(Mt,ii,{data:Rs,headers:_e.from(Ts.headers),status:Ts.status,statusText:Ts.statusText,config:Ke,request:br})})}catch(dn){if(na&&na(),to&&to.aborted&&to.reason instanceof $e){const yi=to.reason;throw yi.config=Ke,br&&(yi.request=br),dn!==yi&&Object.defineProperty(yi,"cause",{__proto__:null,value:dn,writable:!0,enumerable:!1,configurable:!0}),yi}if(mc)throw br&&!mc.request&&(mc.request=br),mc;if(dn instanceof $e)throw br&&!dn.request&&(dn.request=br),dn;if(dn&&dn.name==="TypeError"&&/Load failed|fetch/i.test(dn.message)){const yi=new $e("Network Error",$e.ERR_NETWORK,Ke,br,dn&&dn.response);throw Object.defineProperty(yi,"cause",{__proto__:null,value:dn.cause||dn,writable:!0,enumerable:!1,configurable:!0}),yi}throw $e.from(dn,dn&&dn.code,Ke,br,dn&&dn.response)}}},MR=new Map,R2=k=>{let P=k&&k.env||{};const{fetch:F,Request:H,Response:U}=P,Q=[H,U,F];let oe=Q.length,me=oe,Fe,We,Ve=MR;for(;me--;)Fe=Q[me],We=Ve.get(Fe),We===void 0&&Ve.set(Fe,We=me?new Map:PR(P)),Ve=We;return We};R2();const $0={http:zt,xhr:hc,fetch:{get:R2}};L.forEach($0,(k,P)=>{if(k){try{Object.defineProperty(k,"name",{__proto__:null,value:P})}catch{}Object.defineProperty(k,"adapterName",{__proto__:null,value:P})}});const I2=k=>`- ${k}`,DR=k=>L.isFunction(k)||k===null||k===!1;function LR(k,P){k=L.isArray(k)?k:[k];const{length:F}=k;let H,U;const Q={};for(let oe=0;oe<F;oe++){H=k[oe];let me;if(U=H,!DR(H)&&(U=$0[(me=String(H)).toLowerCase()],U===void 0))throw new $e(`Unknown adapter '${me}'`);if(U&&(L.isFunction(U)||(U=U.get(P))))break;Q[me||"#"+oe]=U}if(!U){const oe=Object.entries(Q).map(([Fe,We])=>`adapter ${Fe} `+(We===!1?"is not supported by the environment":"is not available in the build"));let me=F?oe.length>1?`since :
46`+oe.map(I2).join(`
47`):" "+I2(oe[0]):"as no adapter specified";throw new $e("There is no suitable adapter to dispatch the request "+me,$e.ERR_NOT_SUPPORT)}return U}var A2={getAdapter:LR,adapters:$0};function E0(k){if(k.cancelToken&&k.cancelToken.throwIfRequested(),k.signal&&k.signal.aborted)throw new tr(null,k)}function O2(k){return E0(k),k.headers=_e.from(k.headers),k.data=fn.call(k,k.transformRequest),["post","put","patch"].indexOf(k.method)!==-1&&k.headers.setContentType("application/x-www-form-urlencoded",!1),A2.getAdapter(k.adapter||Tn.adapter,k)(k).then(function(H){E0(k),k.response=H;try{H.data=fn.call(k,k.transformResponse,H)}finally{delete k.response}return H.headers=_e.from(H.headers),H},function(H){if(!Rn(H)&&(E0(k),H&&H.response)){k.response=H.response;try{H.response.data=fn.call(k,k.transformResponse,H.response)}finally{delete k.response}H.response.headers=_e.from(H.response.headers)}return Promise.reject(H)})}const Ru={};["object","boolean","number","function","string","symbol"].forEach((k,P)=>{Ru[k]=function(H){return typeof H===k||"a"+(P<1?"n ":" ")+k}});const k2={};Ru.transitional=function(P,F,H){function U(Q,oe){return"[Axios v"+x0+"] Transitional option '"+Q+"'"+oe+(H?". "+H:"")}return(Q,oe,me)=>{if(P===!1)throw new $e(U(oe," has been removed"+(F?" in "+F:"")),$e.ERR_DEPRECATED);return F&&!k2[oe]&&(k2[oe]=!0),P?P(Q,oe,me):!0}},Ru.spelling=function(P){return(F,H)=>!0};function jR(k,P,F){if(typeof k!="object"||k===null)throw new $e("options must be an object",$e.ERR_BAD_OPTION_VALUE);const H=Object.keys(k);let U=H.length;for(;U-- >0;){const Q=H[U],oe=Object.prototype.hasOwnProperty.call(P,Q)?P[Q]:void 0;if(oe){const me=k[Q],Fe=me===void 0||oe(me,Q,k);if(Fe!==!0)throw new $e("option "+Q+" must be "+Fe,$e.ERR_BAD_OPTION_VALUE);continue}if(F!==!0)throw new $e("Unknown option "+Q,$e.ERR_BAD_OPTION)}}var Iu={assertOptions:jR,validators:Ru};const Tr=Iu.validators;class ta{constructor(P){this.defaults=P||{},this.interceptors={request:new Ft,response:new Ft}}async request(P,F){try{return await this._request(P,F)}catch(H){if(H instanceof Error){let U={};Error.captureStackTrace?Error.captureStackTrace(U):U=new Error;const Q=(()=>{if(!U.stack)return"";const oe=U.stack.indexOf(`
48`);return oe===-1?"":U.stack.slice(oe+1)})();try{if(!H.stack)H.stack=Q;else if(Q){const oe=Q.indexOf(`
49`),me=oe===-1?-1:Q.indexOf(`
50`,oe+1),Fe=me===-1?"":Q.slice(me+1);String(H.stack).endsWith(Fe)||(H.stack+=`
51`+Q)}}catch{}}throw H}}_request(P,F){typeof P=="string"?(F=F||{},F.url=P):F=P||{},F=ot(this.defaults,F);const{transitional:H,paramsSerializer:U,headers:Q}=F;H!==void 0&&Iu.assertOptions(H,{silentJSONParsing:Tr.transitional(Tr.boolean),forcedJSONParsing:Tr.transitional(Tr.boolean),clarifyTimeoutError:Tr.transitional(Tr.boolean),legacyInterceptorReqResOrdering:Tr.transitional(Tr.boolean),advertiseZstdAcceptEncoding:Tr.transitional(Tr.boolean),validateStatusUndefinedResolves:Tr.transitional(Tr.boolean)},!1),U!=null&&(L.isFunction(U)?F.paramsSerializer={serialize:U}:Iu.assertOptions(U,{encode:Tr.function,serialize:Tr.function},!0)),F.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?F.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:F.allowAbsoluteUrls=!0),Iu.assertOptions(F,{baseUrl:Tr.spelling("baseURL"),withXsrfToken:Tr.spelling("withXSRFToken")},!0),F.method=(F.method||this.defaults.method||"get").toLowerCase();let oe=Q&&L.merge(Q.common,Q[F.method]);Q&&L.forEach(["delete","get","head","post","put","patch","query","common"],tn=>{delete Q[tn]}),F.headers=_e.concat(oe,Q);const me=[];let Fe=!0;this.interceptors.request.forEach(function(rn){if(typeof rn.runWhen=="function"&&rn.runWhen(F)===!1)return;Fe=Fe&&rn.synchronous;const Ct=F.transitional||Zt;Ct&&Ct.legacyInterceptorReqResOrdering?me.unshift(rn.fulfilled,rn.rejected):me.push(rn.fulfilled,rn.rejected)});const We=[];this.interceptors.response.forEach(function(rn){We.push(rn.fulfilled,rn.rejected)});let Ve,Ze=0,At;if(!Fe){const tn=[O2.bind(this),void 0];for(tn.unshift(...me),tn.push(...We),At=tn.length,Ve=Promise.resolve(F);Ze<At;)Ve=Ve.then(tn[Ze++],tn[Ze++]);return Ve}At=me.length;let Ot=F;for(;Ze<At;){const tn=me[Ze++],rn=me[Ze++];try{Ot=tn(Ot)}catch(Ct){rn.call(this,Ct);break}}try{Ve=O2.call(this,Ot)}catch(tn){return Promise.reject(tn)}for(Ze=0,At=We.length;Ze<At;)Ve=Ve.then(We[Ze++],We[Ze++]);return Ve}getUri(P){P=ot(this.defaults,P);const F=Xa(P.baseURL,P.url,P.allowAbsoluteUrls,P);return It(F,P.params,P.paramsSerializer)}}L.forEach(["delete","get","head","options"],function(P){ta.prototype[P]=function(F,H){return this.request(ot(H||{},{method:P,url:F,data:H&&L.hasOwnProp(H,"data")?H.data:void 0}))}}),L.forEach(["post","put","patch","query"],function(P){function F(H){return function(Q,oe,me){return this.request(ot(me||{},{method:P,headers:H?{"Content-Type":"multipart/form-data"}:{},url:Q,data:oe}))}}ta.prototype[P]=F(),P!=="query"&&(ta.prototype[P+"Form"]=F(!0))});class T0{constructor(P){if(typeof P!="function")throw new TypeError("executor must be a function.");let F;this.promise=new Promise(function(Q){F=Q});const H=this;this.promise.then(U=>{if(!H._listeners)return;let Q=H._listeners.length;for(;Q-- >0;)H._listeners[Q](U);H._listeners=null}),this.promise.then=U=>{let Q;const oe=new Promise(me=>{H.subscribe(me),Q=me}).then(U);return oe.cancel=function(){H.unsubscribe(Q)},oe},P(function(Q,oe,me){H.reason||(H.reason=new tr(Q,oe,me),F(H.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(P){if(this.reason){P(this.reason);return}this._listeners?this._listeners.push(P):this._listeners=[P]}unsubscribe(P){if(!this._listeners)return;const F=this._listeners.indexOf(P);F!==-1&&this._listeners.splice(F,1)}toAbortSignal(){const P=new AbortController,F=H=>{P.abort(H)};return this.subscribe(F),P.signal.unsubscribe=()=>this.unsubscribe(F),P.signal}static source(){let P;return{token:new T0(function(U){P=U}),cancel:P}}}function FR(k){return function(F){return k.apply(null,F)}}function BR(k){return L.isObject(k)&&k.isAxiosError===!0}const R0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
51alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(R0).forEach(([k,P])=>{R0[P]=k});function N2(k){const P=new ta(k),F=t(ta.prototype.request,P);return L.extend(F,ta.prototype,P,{allOwnKeys:!0}),L.extend(F,P,null,{allOwnKeys:!0}),F.create=function(U){return N2(ot(k,U))},F}const Kn=N2(Tn);return Kn.Axios=ta,Kn.CanceledError=tr,Kn.CancelToken=T0,Kn.isCancel=Rn,Kn.VERSION=x0,Kn.toFormData=Gn,Kn.AxiosError=$e,Kn.Cancel=Kn.CanceledError,Kn.all=function(P){return Promise.all(P)},Kn.spread=FR,Kn.isAxiosError=BR,Kn.mergeConfig=ot,Kn.AxiosHeaders=_e,Kn.formToJSON=k=>Pt(L.isHTMLForm(k)?new FormData(k):k),Kn.getAdapter=A2.getAdapter,Kn.HttpStatusCode=R0,Kn.default=Kn,om=Kn,om}var am={},yc={},wc={},iS;function Yb(){if(iS)return wc;iS=1,Object.defineProperty(wc,"__esModule",{value:!0}),wc.pathTempalteToParameterNames=void 0;const t=e=>{const n=e.match(/\{[A-Za-z0-9_-]+\}/g);return n===null?[]:n.map(r=>r.substring(1,r.length-1))};return wc.pathTempalteToParameterNames=t,wc}var sS;function T_(){if(sS)return yc;sS=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.names=void 0;var t=Yb();const e=n=>(0,t.pathTempalteToParameterNames)(n).filter((i,s,o)=>o.indexOf(i)===s);return yc.names=e,yc}var Sc={},Cc={},oS;function f6(){if(oS)return Cc;oS=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.toParameterPattern=void 0;var t=Yb();const e=(n,r)=>{const i=typeof r>"u"?[]:Object.keys(r).map(a=>{const l=r[a];return{name:a,pattern:typeof l>"u"?null:l}});return(0,t.pathTempalteToParameterNames)(n).map(a=>{const l=i.find(({name:d})=>d===a),c=typeof l>"u"?null:l.pattern;return{name:a,pattern:c}})};return Cc.toParameterPattern=e,Cc}var aS;function R_(){if(aS)return Sc;aS=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.params=void 0;var t=f6();const e=(o,a)=>{const c=s(o),d=(0,t.toParameterPattern)(o,a);return u=>{const f=i(u,c);if(f===null)return null;const h=r(f,d);return h===null?null:n(h)}};Sc.params=e;const n=o=>o.map(({name:a,value:l})=>({[a]:l})).reduce((a,l)=>Object.assign(a,l),{}),r=(o,a)=>{const l=o.map(({value:u})=>decodeURIComponent(u)).map((u,f)=>{const{name:h,pattern:p}=a[f];return{name:h,pattern:p,value:u}});return l.some(({pattern:u,value:f})=>u!==null&&f.match(u)===null)||l.some(({name:u,value:f})=>l.some(({name:h,value:p})=>h===u&&p!==f))?null:l},i=(o,a)=>{const l=o.match(a);return l===null?null:l.slice(1).map(d=>({value:d}))},s=o=>new RegExp("^"+o.replace(/\{[A-Za-z0-9_-]+\}/g,"([^\\/]*)")+"$");return Sc}var xc={},lS;function I_(){if(lS)return xc;lS=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.path=void 0;var t=Yb(),e=f6();const n=(r,i)=>{const s=(0,t.pathTempalteToParameterNames)(r);return o=>s.some(l=>typeof o[l]!="string")||(0,e.toParameterPattern)(r,i).some(({name:l,pattern:c})=>c!==null&&o[l].match(c)===null)?null:s.reduce((l,c)=>l.split("{"+c+"}").join(encodeURIComponent(o[c])),r)};return xc.path=n,xc}var cS;function A_(){return cS||(cS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"names",{enumerable:!0,get:function(){return e.names}}),Object.defineProperty(t,"params",{enumerable:!0,get:function(){return n.params}}),Object.defineProperty(t,"path",{enumerable:!0,get:function(){return r.path}}),t.bath=t.default=void 0;
51var e=T_(),n=R_(),r=I_();const i=(o,a)=>{const l=(0,e.names)(o),c=(0,r.path)(o,a),d=(0,n.params)(o,a);return{names:l,path:c,params:d}};t.bath=i;var s=i;t.default=s})(am)),am}var lm={},cm={},dS;function O_(){return dS||(dS=1,Object.defineProperty(cm,"__esModule",{value:!0})),cm}var dm={},um={},uS;function k_(){return uS||(uS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"klona",{enumerable:!0,get:function(){return e}});function e(n,r){r||(r=new Map);var i,s,o;if(Array.isArray(n)){if(r.has(n))return r.get(n);for(s=Array(i=n.length),r.set(n,s);i--;)s[i]=(o=n[i])&&typeof o=="object"?e(o,r):o;return s}if(Object.prototype.toString.call(n)==="[object Object]"){if(r.has(n))return r.get(n);s={},r.set(n,s);for(i in n)i==="__proto__"?Object.defineProperty(s,i,{value:e(n[i],r),configurable:!0,enumerable:!0,writable:!0}):s[i]=(o=n[i])&&typeof o=="object"?e(o,r):o;return s}return n}})(um)),um}var fm={},fS;function h6(){return fS||(fS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"resolveRefSync",{enumerable:!0,get:function(){return n}});var e=new WeakMap,n=function(r,i){e.has(r)||e.set(r,new Map);var s=e.get(r);if(s.has(i))return s.get(i);var o=i.split("/").slice(1),a=r,l=!0,c=!1,d=void 0;try{for(var u=o[Symbol.iterator](),f;!(l=(f=u.next()).done);l=!0){var h=f.value;(!a||typeof a!="object")&&(a=null);var p;a=(p=a[h])!==null&&p!==void 0?p:null}}catch(g){c=!0,d=g}finally{try{!l&&u.return!=null&&u.return()}finally{if(c)throw d}}return s.set(i,a),a}})(fm)),fm}var hS;function N_(){return hS||(hS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"dereferenceSync",{enumerable:!0,get:function(){return i}});var e=k_(),n=h6(),r=new WeakMap,i=function(s){if(r.has(s))return r.get(s);var o=new Set,a=(0,e.klona)(s),l=function(d,u){if(typeof d=="object"&&d!==null){if(o.has(d))return d;if(o.add(d),Array.isArray(d))for(var f=0;f<d.length;f++)d[f]=l(d[f]);else{if("$ref"in d&&typeof d.$ref=="string")return(0,n.resolveRefSync)(a,d.$ref);for(var h in d)d[h]=l(d[h])}}return d},c=l(a);return r.set(s,c),c}})(dm)),dm}var pS;function __(){return pS||(pS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),e(O_(),t),e(N_(),t),e(h6(),t);function e(n,r){return Object.keys(n).forEach(function(i){i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:function(){return n[i]}})}),n}})(lm)),lm}var hm={},mS;function p6(){return mS||(mS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ParamType=t.HttpMethod=void 0,(function(e){e.Get="get",e.Put="put",e.Post="post",e.Patch="patch",e.Delete="delete",e.Options="options",e.Head="head",e.Trace="trace"})(t.HttpMethod||(t.HttpMethod={})),(function(e){e.Query="query",e.Header="header",e.Path="path",e.Cookie="cookie"})(t.ParamType||(t.ParamType={}))})(hm)),hm}var la={},gS;function P_(){if(gS)return la;gS=1;var t=la&&la.__values||function(i){var s=typeof Symbol=="function"&&Symbol.iterator,o=s&&i[s],a=0;if(o)return o.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&a>=i.length&&(i=void 0),{value:i&&i[a++],done:!i}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(la,"__esModule",{value:!0}),la.serializeQueryParameter=void 0;var e=function(i,s,o){var a=(i==null?void 0:i.style)||"form",l=(i==null?void 0:i.explode)!==void 0?i.explode:!0;return o==null?[]:Array.isArray(o)?n(s,o,a,l):typeof o=="object"?r(s,o,a,l):["".concat(encodeURIComponent(s),"=").concat(encodeURIComponent(String(o)))]};la.serializeQueryParameter=e;var n=function(i,s,o,a){if(s.length===0)return[];switch(o){case"form":if(a)return s.map(function(c){return"".concat(encodeURIComponent(i),"=").concat(encodeURIComponent(String(c)))});var l=s.map(function(c){return encodeURIComponent(String(c))}).join(",");return["".concat(encodeURIComponent(i),"=").concat(l)];case"spaceDelimited":if(a)return s.map(function(c){return"".concat(encodeURIComponent(i),"=").concat(encodeURIComponent(String(c)))});var l=s.map(function(d){return encodeURIComponent(String(d))}).join("%20");return["".concat(encodeURIComponent(i),"=").concat(l)];case"pipeDelimited":if(a)return s.map(function(c){return"".concat(encodeURIComponent(i),"=").concat(encodeURIComponent(String(c)))});var l=s.map(function(d){return encodeURIComponent(String(d))}).join("%7C");return["".concat(encodeURIComponent(i),"=").concat(l)];default:return s.map(function(c){return"".concat(encodeURIComponent(i),"=").concat(encodeURIComponent(String(c)))})}},r=function(i,s,o,a){var l,c,d,u,f=Object.keys(s);if(f.length===0)return[];switch(o){case"deepObject":if(a)return f.map(function(C){return"".concat(encodeURIComponent(i),"[").concat(encodeURIComponent(C),"]=").concat(encodeURIComponent(String(s[C])))});var h=[];try{for(var p=t(f),g=p.next();!g.done;g=p.next()){var v=g.value;h.push(encodeURIComponent(v)),h.push(encodeURIComponent(String(s[v])))}}catch(C){l={error:C}}finally{try{g&&!g.done&&(c=p.return)&&c.call(p)}finally{if(l)throw l.error}}return["".concat(encodeURIComponent(i),"=").concat(h.join(","))];case"form":if(a)return f.map(function(C){return"".concat(encodeURIComponent(C),"=").concat(encodeURIComponent(String(s[C])))});var h=[];try{for(var b=t(f),w=b.next();!w.done;w=b.next()){var v=w.value;h.push(encodeURIComponent(v)),h.push(encodeURIComponent(String(s[v])))}}catch(x){d={error:x}}finally{try{w&&!w.done&&(u=b.return)&&u.call(b)}finally{if(d)throw d.error}}return["".concat(encodeURIComponent(i),"=").concat(h.join(","))];default:return f.map(function(C){return"".concat(encodeURIComponent(C),"=").concat(encodeURIComponent(String(s[C])))})}};return la}var Ir={},qu={},so={},vS;function ru(){if(vS)return so;vS=1;function t(o){return typeof o>"u"||o===null}function e(o){return typeof o=="object"&&o!==null}function n(o){return Array.isArray(o)?o:t(o)?[]:[o]}function r(o,a){if(a){const l=Object.keys(a);for(let c=0,d=l.length;c<d;c+=1){const u=l[c];o[u]=a[u]}}return o}function i(o,a){let l="";for(let c=0;c<a;c+=1)l+=o;return l}function s(o){return o===0&&Number.NEGATIVE_INFINITY===1/o}return so.isNothing=t,so.isObject=e,so.toArray=n,so.repeat=i,so.isNegativeZero=s,so.extend=r,so}var pm,bS;
51function iu(){if(bS)return pm;bS=1;function t(n,r){let i="";const s=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(i+='in "'+n.mark.name+'" '),i+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!r&&n.mark.snippet&&(i+=`
52
53`+n.mark.snippet),s+" "+i):s}function e(n,r){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=r,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.toString=function(r){return this.name+": "+t(this,r)},pm=e,pm}var mm,yS;function M_(){if(yS)return mm;yS=1;const t=ru();function e(i,s,o,a,l){let c="",d="";const u=Math.floor(l/2)-1;return a-s>u&&(c=" ... ",s=a-u+c.length),o-a>u&&(d=" ...",o=a+u-d.length),{str:c+i.slice(s,o).replace(/\t/g,"→")+d,pos:a-s+c.length}}function n(i,s){return t.repeat(" ",s-i.length)+i}function r(i,s){if(s=Object.create(s||null),!i.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);const o=/\r?\n|\r|\0/g,a=[0],l=[];let c,d=-1;for(;c=o.exec(i.buffer);)l.push(c.index),a.push(c.index+c[0].length),i.position<=c.index&&d<0&&(d=a.length-2);d<0&&(d=a.length-1);let u="";const f=Math.min(i.line+s.linesAfter,l.length).toString().length,h=s.maxLength-(s.indent+f+3);for(let g=1;g<=s.linesBefore&&!(d-g<0);g++){const v=e(i.buffer,a[d-g],l[d-g],i.position-(a[d]-a[d-g]),h);u=t.repeat(" ",s.indent)+n((i.line-g+1).toString(),f)+" | "+v.str+`
54`+u}const p=e(i.buffer,a[d],l[d],i.position,h);u+=t.repeat(" ",s.indent)+n((i.line+1).toString(),f)+" | "+p.str+`
55`,u+=t.repeat("-",s.indent+f+3+p.pos)+`^
56`;for(let g=1;g<=s.linesAfter&&!(d+g>=l.length);g++){const v=e(i.buffer,a[d+g],l[d+g],i.position-(a[d]-a[d+g]),h);u+=t.repeat(" ",s.indent)+n((i.line+g+1).toString(),f)+" | "+v.str+`
57`}return u.replace(/\n$/,"")}return mm=r,mm}var gm,wS;function zr(){if(wS)return gm;wS=1;const t=iu(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],n=["scalar","sequence","mapping"];function r(s){const o={};return s!==null&&Object.keys(s).forEach(function(a){s[a].forEach(function(l){o[String(l)]=a})}),o}function i(s,o){if(o=o||{},Object.keys(o).forEach(function(a){if(e.indexOf(a)===-1)throw new t('Unknown option "'+a+'" is met in definition of "'+s+'" YAML type.')}),this.options=o,this.tag=s,this.kind=o.kind||null,this.resolve=o.resolve||function(){return!0},this.construct=o.construct||function(a){return a},this.instanceOf=o.instanceOf||null,this.predicate=o.predicate||null,this.represent=o.represent||null,this.representName=o.representName||null,this.defaultStyle=o.defaultStyle||null,this.multi=o.multi||!1,this.styleAliases=r(o.styleAliases||null),n.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return gm=i,gm}var vm,SS;function m6(){if(SS)return vm;SS=1;const t=iu(),e=zr();function n(s,o){const a=[];return s[o].forEach(function(l){let c=a.length;a.forEach(function(d,u){d.tag===l.tag&&d.kind===l.kind&&d.multi===l.multi&&(c=u)}),a[c]=l}),a}function r(){const s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function o(a){a.multi?(s.multi[a.kind].push(a),s.multi.fallback.push(a)):s[a.kind][a.tag]=s.fallback[a.tag]=a}for(let a=0,l=arguments.length;a<l;a+=1)arguments[a].forEach(o);return s}function i(s){return this.extend(s)}return i.prototype.extend=function(o){let a=[],l=[];if(o instanceof e)l.push(o);else if(Array.isArray(o))l=l.concat(o);else if(o&&(Array.isArray(o.implicit)||Array.isArray(o.explicit)))o.implicit&&(a=a.concat(o.implicit)),o.explicit&&(l=l.concat(o.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");a.forEach(function(d){if(!(d instanceof e))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(d.loadKind&&d.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
57if(d.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(d){if(!(d instanceof e))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const c=Object.create(i.prototype);return c.implicit=(this.implicit||[]).concat(a),c.explicit=(this.explicit||[]).concat(l),c.compiledImplicit=n(c,"implicit"),c.compiledExplicit=n(c,"explicit"),c.compiledTypeMap=r(c.compiledImplicit,c.compiledExplicit),c},vm=i,vm}var bm,CS;function g6(){if(CS)return bm;CS=1;const t=zr();return bm=new t("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),bm}var ym,xS;function v6(){if(xS)return ym;xS=1;const t=zr();return ym=new t("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),ym}var wm,$S;function b6(){if($S)return wm;$S=1;const t=zr();return wm=new t("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),wm}var Sm,ES;function y6(){if(ES)return Sm;ES=1;const t=m6();return Sm=new t({explicit:[g6(),v6(),b6()]}),Sm}var Cm,TS;function w6(){if(TS)return Cm;TS=1;const t=zr();function e(i){if(i===null)return!0;const s=i.length;return s===1&&i==="~"||s===4&&(i==="null"||i==="Null"||i==="NULL")}function n(){return null}function r(i){return i===null}return Cm=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:e,construct:n,predicate:r,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Cm}var xm,RS;function S6(){if(RS)return xm;RS=1;const t=zr();function e(i){if(i===null)return!1;const s=i.length;return s===4&&(i==="true"||i==="True"||i==="TRUE")||s===5&&(i==="false"||i==="False"||i==="FALSE")}function n(i){return i==="true"||i==="True"||i==="TRUE"}function r(i){return Object.prototype.toString.call(i)==="[object Boolean]"}return xm=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:e,construct:n,predicate:r,represent:{lowercase:function(i){return i?"true":"false"},uppercase:function(i){return i?"TRUE":"FALSE"},camelcase:function(i){return i?"True":"False"}},defaultStyle:"lowercase"}),xm}var $m,IS;function C6(){if(IS)return $m;IS=1;const t=ru(),e=zr();function n(c){return c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102}function r(c){return c>=48&&c<=55}function i(c){return c>=48&&c<=57}function s(c){if(c===null)return!1;const d=c.length;let u=0,f=!1;if(!d)return!1;let h=c[u];if((h==="-"||h==="+")&&(h=c[++u]),h==="0"){if(u+1===d)return!0;if(h=c[++u],h==="b"){for(u++;u<d;u++){if(h=c[u],h!=="0"&&h!=="1")return!1;f=!0}return f&&isFinite(o(c))}if(h==="x"){for(u++;u<d;u++){if(!n(c.charCodeAt(u)))return!1;f=!0}return f&&isFinite(o(c))}if(h==="o"){for(u++;u<d;u++){if(!r(c.charCodeAt(u)))return!1;f=!0}return f&&isFinite(o(c))}}for(;u<d;u++){if(!i(c.charCodeAt(u)))return!1;f=!0}return f?isFinite(o(c)):!1}function o(c){let d=c,u=1,f=d[0];if((f==="-"||f==="+")&&(f==="-"&&(u=-1),d=d.slice(1),f=d[0]),d==="0")return 0;if(f==="0"){if(d[1]==="b")return u*parseInt(d.slice(2),2);if(d[1]==="x")return u*parseInt(d.slice(2),16);if(d[1]==="o")return u*parseInt(d.slice(2),8)}return u*parseInt(d,10)}function a(c){return o(c)}function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&c%1===0&&!t.isNegativeZero(c)}return $m=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:a,predicate:l,represent:{binary:function(c){return c>=0?"0b"+c.toString(2):"-0b"+c.toString(2).slice(1)},octal:function(c){return c>=0?"0o"+c.toString(8):"-0o"+c.toString(8).slice(1)},decimal:function(c){return c.toString(10)},hexadecimal:function(c){return c>=0?"0x"+c.toString(16).toUpperCase():"-0x"+c.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),$m}var Em,AS;function x6(){if(AS)return Em;AS=1;const t=ru(),e=zr(),n=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),r=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function i(c){return c===null||!n.test(c)?!1:isFinite(parseFloat(c,10))?!0:r.test(c)}function s(c){let d=c.toLowerCase();const u=d[0]==="-"?-1:1;return"+-".indexOf(d[0])>=0&&(d=d.slice(1)),d===".inf"?u===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:d===".nan"?NaN:u*parseFloat(d,10)}const o=/^[-+]?[0-9]+e/;function a(c,d){if(isNaN(c))switch(d){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===c)switch(d){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===c)switch(d){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(c))return"-0.0";const u=c.toString(10);return o.test(u)?u.replace("e",".e"):u}function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&(c%1!==0||t.isNegativeZero(c))}return Em=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:s,predicate:l,represent:a,defaultStyle:"lowercase"}),Em}var Tm,OS;function $6(){return OS||(OS=1,Tm=y6().extend({implicit:[w6(),S6(),C6(),x6()]})),Tm}var Rm,kS;function E6(){return kS||(kS=1,Rm=$6()),Rm}var Im,NS;function T6(){if(NS)return Im;NS=1;const t=zr(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function r(o){return o===null?!1:e.exec(o)!==null||n.exec(o)!==null}function i(o){let a=0,l=null,c=e.exec(o);if(c===null&&(c=n.exec(o)),c===null)throw new Error("Date resolve error");const d=+c[1],u=+c[2]-1,f=+c[3];if(!c[4])return new Date(Date.UTC(d,u,f));const h=+c[4],p=+c[5],g=+c[6];if(c[7]){for(a=c[7].slice(0,3);a.length<3;)a+="0";a=+a}if(c[9]){const b=+c[10],w=+(c[11]||0);l=(b*60+w)*6e4,c[9]==="-"&&(l=-l)}const v=new Date(Date.UTC(d,u,f,h,p,g,a));return l&&v.setTime(v.getTime()-l),v}function s(o){return o.toISOString()}return Im=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:s}),Im}var Am,_S;function R6(){if(_S)return Am;_S=1;const t=zr();function e(n){return n==="<<"||n===null}return Am=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),Am}var Om,PS;function I6(){if(PS)return Om;PS=1;const t=zr(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
57+/=
58\r`;function n(o){if(o===null)return!1;let a=0;const l=o.length,c=e;for(let d=0;d<l;d++){const u=c.indexOf(o.charAt(d));if(!(u>64)){if(u<0)return!1;a+=6}}return a%8===0}function r(o){const a=o.replace(/[\r\n=]/g,""),l=a.length,c=e;let d=0;const u=[];for(let h=0;h<l;h++)h%4===0&&h&&(u.push(d>>16&255),u.push(d>>8&255),u.push(d&255)),d=d<<6|c.indexOf(a.charAt(h));const f=l%4*6;return f===0?(u.push(d>>16&255),u.push(d>>8&255),u.push(d&255)):f===18?(u.push(d>>10&255),u.push(d>>2&255)):f===12&&u.push(d>>4&255),new Uint8Array(u)}function i(o){let a="",l=0;const c=o.length,d=e;for(let f=0;f<c;f++)f%3===0&&f&&(a+=d[l>>18&63],a+=d[l>>12&63],a+=d[l>>6&63],a+=d[l&63]),l=(l<<8)+o[f];const u=c%3;return u===0?(a+=d[l>>18&63],a+=d[l>>12&63],a+=d[l>>6&63],a+=d[l&63]):u===2?(a+=d[l>>10&63],a+=d[l>>4&63],a+=d[l<<2&63],a+=d[64]):u===1&&(a+=d[l>>2&63],a+=d[l<<4&63],a+=d[64],a+=d[64]),a}function s(o){return Object.prototype.toString.call(o)==="[object Uint8Array]"}return Om=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:r,predicate:s,represent:i}),Om}var km,MS;function A6(){if(MS)return km;MS=1;const t=zr(),e=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(s){if(s===null)return!0;const o=[],a=s;for(let l=0,c=a.length;l<c;l+=1){const d=a[l];let u=!1;if(n.call(d)!=="[object Object]")return!1;let f;for(f in d)if(e.call(d,f))if(!u)u=!0;else return!1;if(!u)return!1;if(o.indexOf(f)===-1)o.push(f);else return!1}return!0}function i(s){return s!==null?s:[]}return km=new t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i}),km}var Nm,DS;function O6(){if(DS)return Nm;DS=1;const t=zr(),e=Object.prototype.toString;function n(i){if(i===null)return!0;const s=i,o=new Array(s.length);for(let a=0,l=s.length;a<l;a+=1){const c=s[a];if(e.call(c)!=="[object Object]")return!1;const d=Object.keys(c);if(d.length!==1)return!1;o[a]=[d[0],c[d[0]]]}return!0}function r(i){if(i===null)return[];const s=i,o=new Array(s.length);for(let a=0,l=s.length;a<l;a+=1){const c=s[a],d=Object.keys(c);o[a]=[d[0],c[d[0]]]}return o}return Nm=new t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:r}),Nm}var _m,LS;function k6(){if(LS)return _m;LS=1;const t=zr(),e=Object.prototype.hasOwnProperty;function n(i){if(i===null)return!0;const s=i;for(const o in s)if(e.call(s,o)&&s[o]!==null)return!1;return!0}function r(i){return i!==null?i:{}}return _m=new t("tag:yaml.org,2002:set",{kind:"mapping",resolve:n,construct:r}),_m}var Pm,jS;function Jb(){return jS||(jS=1,Pm=E6().extend({implicit:[T6(),R6()],explicit:[I6(),A6(),O6(),k6()]})),Pm}var FS;function D_(){if(FS)return qu;FS=1;const t=ru(),e=iu(),n=M_(),r=Jb(),i=Object.prototype.hasOwnProperty,s=1,o=2,a=3,l=4,c=1,d=2,u=3,f=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,h=/[\x85\u2028\u2029]/,p=/[,\[\]{}]/,g=/^(?:!|!!|![0-9A-Za-z-]+!)$/,v=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function b(y){return Object.prototype.toString.call(y)}function w(y){return y===10||y===13}function C(y){return y===9||y===32}function x(y){return y===9||y===32||y===10||y===13}function R(y){return y===44||y===91||y===93||y===123||y===125}function O(y){if(y>=48&&y<=57)return y-48;const K=y|32;return K>=97&&K<=102?K-97+10:-1}function T(y){return y===120?2:y===117?4:y===85?8:0}function S(y){return y>=48&&y<=57?y-48:-1}function _(y){switch(y){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return"	";case 9:return"	";case 110:return`
59`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function A(y){return y<=65535?String.fromCharCode(y):String.fromCharCode((y-65536>>10)+55296,(y-65536&1023)+56320)}function $(y,K,W){K==="__proto__"?Object.defineProperty(y,K,{configurable:!0,enumerable:!0,writable:!0,value:W}):y[K]=W}const E=new Array(256),I=new Array(256);for(let y=0;y<256;y++)E[y]=_(y)?1:0,I[y]=_(y);function D(y,K){this.input=y,this.filename=K.filename||null,this.schema=K.schema||r,this.onWarning=K.onWarning||null,this.legacy=K.legacy||!1,this.json=K.json||!1,this.listener=K.listener||null,this.maxDepth=typeof K.maxDepth=="number"?K.maxDepth:100,this.maxTotalMergeKeys=typeof K.maxTotalMergeKeys=="number"?K.maxTotalMergeKeys:1e4,this.impl
59icitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=y.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function B(y,K){const W={name:y.filename,buffer:y.input.slice(0,-1),position:y.position,line:y.line,column:y.position-y.lineStart};return W.snippet=n(W),new e(K,W)}function j(y,K){throw B(y,K)}function z(y,K){y.onWarning&&y.onWarning.call(null,B(y,K))}function q(y,K,W){const re=y.anchorMapTransactions;if(re.length!==0){const se=re[re.length-1];i.call(se,K)||(se[K]={existed:i.call(y.anchorMap,K),value:y.anchorMap[K]})}y.anchorMap[K]=W}function ne(y){y.anchorMapTransactions.push(Object.create(null))}function Z(y){const K=y.anchorMapTransactions.pop(),W=y.anchorMapTransactions;if(W.length===0)return;const re=W[W.length-1],se=Object.keys(K);for(let pe=0,M=se.length;pe<M;pe+=1){const L=se[pe];i.call(re,L)||(re[L]=K[L])}}function J(y){const K=y.anchorMapTransactions.pop(),W=Object.keys(K);for(let re=W.length-1;re>=0;re-=1){const se=K[W[re]];se.existed?y.anchorMap[W[re]]=se.value:delete y.anchorMap[W[re]]}}function de(y){return{position:y.position,line:y.line,lineStart:y.lineStart,lineIndent:y.lineIndent,firstTabInLine:y.firstTabInLine,tag:y.tag,anchor:y.anchor,kind:y.kind,result:y.result}}function X(y,K){y.position=K.position,y.line=K.line,y.lineStart=K.lineStart,y.lineIndent=K.lineIndent,y.firstTabInLine=K.firstTabInLine,y.tag=K.tag,y.anchor=K.anchor,y.kind=K.kind,y.result=K.result}const V={YAML:function(K,W,re){K.version!==null&&j(K,"duplication of %YAML directive"),re.length!==1&&j(K,"YAML directive accepts exactly one argument");const se=/^([0-9]+)\.([0-9]+)$/.exec(re[0]);se===null&&j(K,"ill-formed argument of the YAML directive");const pe=parseInt(se[1],10),M=parseInt(se[2],10);pe!==1&&j(K,"unacceptable YAML version of the document"),K.version=re[0],K.checkLineBreaks=M<2,M!==1&&M!==2&&z(K,"unsupported YAML version of the document")},TAG:function(K,W,re){let se;re.length!==2&&j(K,"TAG directive accepts exactly two arguments");const pe=re[0];se=re[1],g.test(pe)||j(K,"ill-formed tag handle (first argument) of the TAG directive"),i.call(K.tagMap,pe)&&j(K,'there is a previously declared suffix for "'+pe+'" tag handle'),v.test(se)||j(K,"ill-formed tag prefix (second argument) of the TAG directive");try{se=decodeURIComponent(se)}catch{j(K,"tag prefix is malformed: "+se)}K.tagMap[pe]=se}};function te(y,K,W,re){if(K<W){const se=y.input.slice(K,W);if(re)for(let pe=0,M=se.length;pe<M;pe+=1){const L=se.charCodeAt(pe);L===9||L>=32&&L<=1114111||j(y,"expected valid JSON character")}else f.test(se)&&j(y,"the stream contains non-printable characters");y.result+=se}}function ie(y,K,W,re){t.isObject(W)||j(y,"cannot merge mappings; the provided source object is unacceptable");const se=Object.keys(W);for(let pe=0,M=se.length;pe<M;pe+=1){const L=se[pe];y.maxTotalMergeKeys!==-1&&++y.totalMergeKeys>y.maxTotalMergeKeys&&j(y,"merge keys exceeded maxTotalMergeKeys ("+y.maxTotalMergeKeys+")"),i.call(K,L)||($(K,L,W[L]),re[L]=!0)}}function ce(y,K,W,re,se,pe,M,L,ye){if(Array.isArray(se)){se=Array.prototype.slice.call(se);for(let ue=0,be=se.length;ue<be;ue+=1)Array.isArray(se[ue])&&j(y,"nested arrays are not supported inside keys"),typeof se=="object"&&b(se[ue])==="[object Object]"&&(se[ue]="[object Object]")}if(typeof se=="object"&&b(se)==="[object Object]"&&(se="[object Object]"),se=String(se),K===null&&(K={}),re==="tag:yaml.org,2002:merge")if(Array.isArray(pe))for(let ue=0,be=pe.length;ue<be;ue+=1)ie(y,K,pe[ue],W);else ie(y,K,pe,W);else!y.json&&!i.call(W,se)&&i.call(K,se)&&(y.line=M||y.line,y.lineStart=L||y.lineStart,y.position=ye||y.position,j(y,"duplicated mapping key")),$(K,se,pe),delete W[se];return K}function ae(y){const K=y.input.charCodeAt(y.position);K===10?y.position++:K===13?(y.position++,y.input.charCodeAt(y.position)===10&&y.position++):j(y,"a line break is expected"),y.line+=1,y.lineStart=y.position,y.firstTabInLine=-1}function ve(y,K,W){let re=0,se=y.input.charCodeAt(y.position);for(;se!==0;){for(;C(se);)se===9&&y.firstTabInLine===-1&&(y.firstTabInLine=y.position),se=y.input.charCodeAt(++y.position);if(K&&se===35)do se=y.input.charCodeAt(++y.position);while(se!==10&&se!==13&&se!==0);if(w(se))for(ae(y),se=y.input.charCodeAt(y.position),re++,y.lineIndent=0;se===32;)y.lineIndent++,se=y.input.charCodeAt(++y.position);else break}return W!==-1&&re!==0&&y.lineIndent<W&&z(y,"deficient indentation"),re}function xe(y){let K=y.position,W=y.input.charCodeAt(K);return!!((W===45||W===46)&&W===y.input.charCodeAt(K+1)&&W===y.input.charCodeAt(K+2)&&(K+=3,W=y.input.charCodeAt(K),W===0||x(W)))}function ge(y,K){K===1?y.result+=" ":K>1&&(y.result+=t.repeat(`
60`,K-1))}function le(y,K,W){let re,se,pe,M,L,ye;const ue=y.kind,be=y.result;let we=y.input.charCodeAt(y.position);if(x(we)||R(we)||we===35||we===38||we===42||we===33||we===124||we===62||we===39||we===34||we===37||we===64||we===96)return!1;if(we===63||we===45){const Ae=y.input.charCodeAt(y.position+1);if(x(Ae)||W&&R(Ae))return!1}for(y.kind="scalar",y.result="",re=se=y.position,pe=!1;we!==0;){if(we===58){const Ae=y.input.charCodeAt(y.position+1);if(x(Ae)||W&&R(Ae))break}else if(we===35){const Ae=y.input.charCodeAt(y.position-1);if(x(Ae))break}else{if(y.position===y.lineStart&&xe(y)||W&&R(we))break;if(w(we))if(M=y.line,L=y.lineStart,ye=y.lineIndent,ve(y,!1,-1),y.lineIndent>=K){pe=!0,we=y.input.charCodeAt(y.position);continue}else{y.position=se,y.line=M,y.lineStart=L,y.lineIndent=ye;break}}pe&&(te(y,re,se,!1),ge(y,y.line-M),re=se=y.position,pe=!1),C(we)||(se=y.position+1),we=y.input.charCodeAt(++y.position)}return te(y,re,se,!1),y.result?!0:(y.kind=ue,y.result=be,!1)}function fe(y,K){let W,re,se=y.input.charCodeAt(y.position);if(se!==39)return!1;
vendor: 12,135 bytes, lines 60-66
60for(y.kind="scalar",y.result="",y.position++,W=re=y.position;(se=y.input.charCodeAt(y.position))!==0;)if(se===39)if(te(y,W,y.position,!0),se=y.input.charCodeAt(++y.position),se===39)W=y.position,y.position++,re=y.position;else return!0;else w(se)?(te(y,W,re,!0),ge(y,ve(y,!1,K)),W=re=y.position):y.position===y.lineStart&&xe(y)?j(y,"unexpected end of the document within a single quoted scalar"):(y.position++,C(se)||(re=y.position));j(y,"unexpected end of the stream within a single quoted scalar")}function Se(y,K){let W,re,se,pe=y.input.charCodeAt(y.position);if(pe!==34)return!1;for(y.kind="scalar",y.result="",y.position++,W=re=y.position;(pe=y.input.charCodeAt(y.position))!==0;){if(pe===34)return te(y,W,y.position,!0),y.position++,!0;if(pe===92){if(te(y,W,y.position,!0),pe=y.input.charCodeAt(++y.position),w(pe))ve(y,!1,K);else if(pe<256&&E[pe])y.result+=I[pe],y.position++;else if((se=T(pe))>0){let M=se,L=0;for(;M>0;M--)pe=y.input.charCodeAt(++y.position),(se=O(pe))>=0?L=(L<<4)+se:j(y,"expected hexadecimal character");y.result+=A(L),y.position++}else j(y,"unknown escape sequence");W=re=y.position}else w(pe)?(te(y,W,re,!0),ge(y,ve(y,!1,K)),W=re=y.position):y.position===y.lineStart&&xe(y)?j(y,"unexpected end of the document within a double quoted scalar"):(y.position++,C(pe)||(re=y.position))}j(y,"unexpected end of the stream within a double quoted scalar")}function G(y,K){let W=!0,re,se,pe;const M=y.tag;let L;const ye=y.anchor;let ue,be,we,Ae;const Pe=Object.create(null);let je,Xe,Ge,it=y.input.charCodeAt(y.position);if(it===91)ue=93,Ae=!1,L=[];else if(it===123)ue=125,Ae=!0,L={};else return!1;for(y.anchor!==null&&q(y,y.anchor,L),it=y.input.charCodeAt(++y.position);it!==0;){if(ve(y,!0,K),it=y.input.charCodeAt(y.position),it===ue)return y.position++,y.tag=M,y.anchor=ye,y.kind=Ae?"mapping":"sequence",y.result=L,!0;if(W?it===44&&j(y,"expected the node content, but found ','"):j(y,"missed comma between flow collection entries"),Xe=je=Ge=null,be=we=!1,it===63){const nt=y.input.charCodeAt(y.position+1);x(nt)&&(be=we=!0,y.position++,ve(y,!0,K))}re=y.line,se=y.lineStart,pe=y.position,ze(y,K,s,!1,!0),Xe=y.tag,je=y.result,ve(y,!0,K),it=y.input.charCodeAt(y.position),(we||y.line===re)&&it===58&&(be=!0,it=y.input.charCodeAt(++y.position),ve(y,!0,K),ze(y,K,s,!1,!0),Ge=y.result),Ae?ce(y,L,Pe,Xe,je,Ge,re,se,pe):be?L.push(ce(y,null,Pe,Xe,je,Ge,re,se,pe)):L.push(je),ve(y,!0,K),it=y.input.charCodeAt(y.position),it===44?(W=!0,it=y.input.charCodeAt(++y.position)):W=!1}j(y,"unexpected end of the stream within a flow collection")}function he(y,K){let W,re=c,se=!1,pe=!1,M=K,L=0,ye=!1,ue,be=y.input.charCodeAt(y.position);if(be===124)W=!1;else if(be===62)W=!0;else return!1;for(y.kind="scalar",y.result="";be!==0;)if(be=y.input.charCodeAt(++y.position),be===43||be===45)c===re?re=be===43?u:d:j(y,"repeat of a chomping mode identifier");else if((ue=S(be))>=0)ue===0?j(y,"bad explicit indentation width of a block scalar; it cannot be less than one"):pe?j(y,"repeat of an indentation width identifier"):(M=K+ue-1,pe=!0);else break;if(C(be)){do be=y.input.charCodeAt(++y.position);while(C(be));if(be===35)do be=y.input.charCodeAt(++y.position);while(!w(be)&&be!==0)}for(;be!==0;){for(ae(y),y.lineIndent=0,be=y.input.charCodeAt(y.position);(!pe||y.lineIndent<M)&&be===32;)y.lineIndent++,be=y.input.charCodeAt(++y.position);if(!pe&&y.lineIndent>M&&(M=y.lineIndent),w(be)){L++;continue}if(!pe&&M===0&&j(y,"missing indentation for block scalar"),y.lineIndent<M){re===u?y.result+=t.repeat(`
61`,se?1+L:L):re===c&&se&&(y.result+=`
62`);break}W?C(be)?(ye=!0,y.result+=t.repeat(`
63`,se?1+L:L)):ye?(ye=!1,y.result+=t.repeat(`
64`,L+1)):L===0?se&&(y.result+=" "):y.result+=t.repeat(`
65`,L):y.result+=t.repeat(`
66`,se?1+L:L),se=!0,pe=!0,L=0;const we=y.position;for(;!w(be)&&be!==0;)be=y.input.charCodeAt(++y.position);te(y,we,y.position,!1)}return!0}function Ee(y,K){const W=y.tag,re=y.anchor,se=[];let pe=!1;if(y.firstTabInLine!==-1)return!1;y.anchor!==null&&q(y,y.anchor,se);let M=y.input.charCodeAt(y.position);for(;M!==0&&(y.firstTabInLine!==-1&&(y.position=y.firstTabInLine,j(y,"tab characters must not be used in indentation")),M===45);){const L=y.input.charCodeAt(y.position+1);if(!x(L))break;if(pe=!0,y.position++,ve(y,!0,-1)&&y.lineIndent<=K){se.push(null),M=y.input.charCodeAt(y.position);continue}const ye=y.line;if(ze(y,K,a,!1,!0),se.push(y.result),ve(y,!0,-1),M=y.input.charCodeAt(y.position),(y.line===ye||y.lineIndent>K)&&M!==0)j(y,"bad indentation of a sequence entry");else if(y.lineIndent<K)break}return pe?(y.tag=W,y.anchor=re,y.kind="sequence",y.result=se,!0):!1}function Ie(y,K,W){let re,se,pe,M;const L=y.tag,ye=y.anchor,ue={},be=Object.create(null);let we=null,Ae=null,Pe=null,je=!1,Xe=!1;if(y.firstTabInLine!==-1)return!1;y.anchor!==null&&q(y,y.anchor,ue);let Ge=y.input.charCodeAt(y.position);for(;Ge!==0;){!je&&y.firstTabInLine!==-1&&(y.position=y.firstTabInLine,j(y,"tab characters must not be used in indentation"));const it=y.input.charCodeAt(y.position+1),nt=y.line;if((Ge===63||Ge===58)&&x(it))Ge===63?(je&&(ce(y,ue,be,we,Ae,null,se,pe,M),we=Ae=Pe=null),Xe=!0,je=!0,re=!0):je?(je=!1,re=!0):j(y,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),y.position+=1,Ge=it;else{if(se=y.line,pe=y.lineStart,M=y.position,!ze(y,W,o,!1,!0))break;if(y.line===nt){for(Ge=y.input.charCodeAt(y.position);C(Ge);)Ge=y.input.charCodeAt(++y.position);if(Ge===58)Ge=y.input.charCodeAt(++y.position),x(Ge)||j(y,"a whitespace character is expected after the key-value separator within a block mapping"),je&&(ce(y,ue,be,we,Ae,null,se,pe,M),we=Ae=Pe=null),Xe=!0,je=!1,re=!1,we=y.tag,Ae=y.result;else if(Xe)j(y,"can not read an implicit mapping pair; a colon is missed");else return y.tag=L,y.anchor=ye,!0}else if(Xe)j(y,"can not read a block mapping entry; a multiline key may not be an implicit key");else return y.tag=L,y.anchor=ye,!0}if((y.line===nt||y.lineIndent>K)&&(je&&(se=y.line,pe=y.lineStart,M=y.position),ze(y,K,l,!0,re)&&(je?Ae=y.result:Pe=y.result),je||(ce(y,ue,be,we,Ae,Pe,se,pe,M),we=Ae=Pe=null),ve(y,!0,-1),Ge=y.input.charCodeAt(y.position)),(y.line===nt||y.lineIndent>K)&&Ge!==0)j(y,"bad indentation of a mapping entry");else if(y.lineIndent<K)break}return je&&ce(y,ue,be,we,Ae,null,se,pe,M),Xe&&(y.tag=L,y.anchor=ye,y.kind="mapping",y.result=ue),Xe}function ke(y){let K=!1,W=!1,re,se,pe=y.input.charCodeAt(y.position);if(pe!==33)return!1;y.tag!==null&&j(y,"duplication of a tag property"),pe=y.input.charCodeAt(++y.position),pe===60?(K=!0,pe=y.input.charCodeAt(++y.position)):pe===33?(W=!0,re="!!",pe=y.input.charCodeAt(++y.position)):re="!";let M=y.position;if(K){do pe=y.input.charCodeAt(++y.position);while(pe!==0&&pe!==62);y.position<y.length?(se=y.input.slice(M,y.position),pe=y.input.charCodeAt(++y.position)):j(y,"unexpected end of the stream within a verbatim tag")}else{for(;pe!==0&&!x(pe);)pe===33&&(W?j(y,"tag suffix cannot contain exclamation marks"):(re=y.input.slice(M-1,y.position+1),g.test(re)||j(y,"named tag handle cannot contain such characters"),W=!0,M=y.position+1)),pe=y.input.charCodeAt(++y.position);se=y.input.slice(M,y.position),p.test(se)&&j(y,"tag suffix cannot contain flow indicator characters")}se&&!v.test(se)&&j(y,"tag name cannot contain such characters: "+se);try{se=decodeURIComponent(se)}catch{j(y,"tag name is malformed: "+se)}return K?y.tag=se:i.call(y.tagMap,re)?y.tag=y.tagMap[re]+se:re==="!"?y.tag="!"+se:re==="!!"?y.tag="tag:yaml.org,2002:"+se:j(y,'undeclared tag handle "'+re+'"'),!0}function De(y){let K=y.input.charCodeAt(y.position);if(K!==38)return!1;y.anchor!==null&&j(y,"duplication of an anchor property"),K=y.input.charCodeAt(++y.position);const W=y.position;for(;K!==0&&!x(K)&&!R(K);)K=y.input.charCodeAt(++y.position);return y.position===W&&j(y,"name of an anchor node must contain at least one character"),y.anchor=y.input.slice(W,y.position),!0}function He(y){let K=y.input.charCodeAt(y.position);if(K!==42)return!1;K=y.input.charCodeAt(++y.position);const W=y.position;for(;K!==0&&!x(K)&&!R(K);)K=y.input.charCodeAt(++y.position);y.position===W&&j(y,"name of an alias node must contain at least one character");const re=y.input.slice(W,y.position);return i.call(y.anchorMap,re)||j(y,'unidentified alias "'+re+'"'),y.result=y.anchorMap[re],ve(y,!0,-1),!0}function Je(y,K,W,re){const se=de(y);return ne(y),X(y,K),y.tag=null,y.anchor=null,y.kind=null,y.result=null,Ie(y,W,re)&&y.kind==="mapping"?(Z(y),!0):(J(y),X(y,se),!1)}function ze(y,K,W,re,se){let pe,M,L=1,ye=!1,ue=!1,be=null,we,Ae,Pe;y.depth>=y.maxDepth&&j(y,"nesting exceeded maxDepth ("+y.maxDepth+")"),y.depth+=1,y.listener!==null&&y.listener("open",y),y.tag=null,y.anchor=null,y.kind=null,y.result=null;const je=pe=M=l===W||a===W;if(re&&ve(y,!0,-1)&&(ye=!0,y.lineIndent>K?L=1:y.lineIndent===K?L=0:y.lineIndent<K&&(L=-1)),L===1)for(;;){const Xe=y.input.charCodeAt(y.position),Ge=de(y);if(ye&&(Xe===33&&y.tag!==null||Xe===38&&y.anchor!==null)||!ke(y)&&!De(y))break;be===null&&(be=Ge),ve(y,!0,-1)?(ye=!0,M=je,y.lineIndent>K?L=1:y.lineIndent===K?L=0:y.lineIndent<K&&(L=-1)):M=!1}if(M&&(M=ye||se),L===1||l===W)if(s===W||o===W?Ae=K:Ae=K+1,Pe=y.position-y.lineStart,L===1)if(M&&(Ee(y,Pe)||Ie(y,Pe,Ae))||G(y,Ae))ue=!0;else{const Xe=y.input.charCodeAt(y.position);be!==null&&je&&!M&&Xe!==124&&Xe!==62&&Je(y,be,be.position-be.lineStart,Ae)||pe&&he(y,Ae)||fe(y,Ae)||Se(y,Ae)?ue=!0:He(y)?(ue=!0,(y.tag!==null||y.anchor!==null)&&j(y,"alias node should not have any properties")):le(y,Ae,s===W)&&(ue=!0,y.tag===null&&(y.tag="?")),y.anchor!==null&&q(y,y.anchor,y.result)}else L===0&&(ue=M&&Ee(y,Pe));if(y.tag===null)y.anchor!==null&&q(y,y.anchor,y.result);else if(y.tag==="?"){y.result!==null&&y.kind!=="scalar"&&j(y,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+y.kind+'"');for(let Xe=0,Ge=y.implicitTypes.length;Xe<Ge;Xe+=1)if(we=y.implicitTypes[Xe],we.resolve(y.result)){y.result=we.construct(y.result),y.tag=we.tag,y.anchor!==null&&q(y,y.anchor,y.result);break}}else if(y.tag!=="!"){if(i.call(y.typeMap[y.kind||"fallback"],y.tag))we=y.typeMap[y.kind||"fallback"][y.tag];else{we=null;const Xe=y.typeMap.multi[y.kind||"fallback"];for(let Ge=0,it=Xe.length;Ge<it;Ge+=1)if(y.tag.slice(0,Xe[Ge].tag.length)===Xe[Ge].tag){we=Xe[Ge];break}}we||j(y,"unknown tag !<"+y.tag+">"),y.result!==null&&we.kind!==y.kind&&j(y,"unacceptable node kind for !<"+y.tag+'> tag; it should be "'+we.kind+'", not "'+y.kind+'"'),we.resolve(y.result,y.tag)?(y.result=we.construct(y.result,y.tag),y.anchor!==null&&q(y,y.anchor,y.result)):j(y,"cannot resolve a node with !<"+y.tag+"> explicit tag")}return y.listener!==null&&y.listener("close",y),y.depth-=1,y.tag!==null||y.anchor!==null||ue}function Ne(y){const K=y.position;let W=!1,re;for(y.version=null,y.checkLineBreaks=y.legacy,y.tagMap=Object.create(null),y.anchorMap=Object.create(null);(re=y.input.charCodeAt(y.position))!==0&&(ve(y,!0,-1),re=y.input.charCodeAt(y.position),!(y.lineIndent>0||re!==37));){W=!0,re=y.input.charCodeAt(++y.position);let se=y.position;for(;re!==0&&!x(re);)re=y.input.charCodeAt(++y.position);const pe=y.input.slice(se,y.position),M=[];for(pe.length<1&&j(y,"directive name must not be less than one character in length");re!==0;){for(;C(re);)re=y.input.charCodeAt(++y.position);if(re===35){do re=y.input.charCodeAt(++y.position);while(re!==0&&!w(re));break}if(w(re))break;for(se=y.position;re!==0&&!x(re);)re=y.input.charCodeAt(++y.position);M.push(y.input.slice(se,y.position))}re!==0&&ae(y),i.call(V,pe)?V[pe](y,pe,M):z(y,'unknown document directive "'+pe+'"')}if(ve(y,!0,-1),y.lineIndent===0&&y.input.charCodeAt(y.position)===45&&y.input.charCodeAt(y.position+1)===45&&y.input.charCodeAt(y.position+2)===45?(y.position+=3,ve(y,!0,-1)):W&&j(y,"directives end mark is expected"),ze(y,y.lineIndent-1,l,!1,!0),ve(y,!0,-1),y.checkLineBreaks&&h.test(y.input.slice(K,y.position))&&z(y,"non-ASCII line breaks are interpreted as content"),y.documents.push(y.result),y.position===y.lineStart&&xe(y)){y.input.charCodeAt(y.position)===46&&(y.position+=3,ve(y,!0,-1));return}y.position<y.length-1&&j(y,"end of the stream or a document separator is expected")}function tt(y,K){y=String(y),K=K||{}
66,y.length!==0&&(y.charCodeAt(y.length-1)!==10&&y.charCodeAt(y.length-1)!==13&&(y+=`
67`),y.charCodeAt(0)===65279&&(y=y.slice(1)));const W=new D(y,K),re=y.indexOf("\0");for(re!==-1&&(W.position=re,j(W,"null byte is not allowed in input")),W.input+="\0";W.input.charCodeAt(W.position)===32;)W.lineIndent+=1,W.position+=1;for(;W.position<W.length-1;)Ne(W);return W.documents}function pt(y,K,W){K!==null&&typeof K=="object"&&typeof W>"u"&&(W=K,K=null);const re=tt(y,W);if(typeof K!="function")return re;for(let se=0,pe=re.length;se<pe;se+=1)K(re[se])}function gt(y,K){const W=tt(y,K);if(W.length!==0){if(W.length===1)return W[0];throw new e("expected a single document in the stream, but found more")}}return qu.loadAll=pt,qu.load=gt,qu}var Mm={},BS;function L_(){if(BS)return Mm;BS=1;const t=ru(),e=iu(),n=Jb(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,s=65279,o=9,a=10,l=13,c=32,d=33,u=34,f=35,h=37,p=38,g=39,v=42,b=44,w=45,C=58,x=61,R=62,O=63,T=64,S=91,_=93,A=96,$=123,E=124,I=125,D={};D[0]="\\0",D[7]="\\a",D[8]="\\b",D[9]="\\t",D[10]="\\n",D[11]="\\v",D[12]="\\f",D[13]="\\r",D[27]="\\e",D[34]='\\"',D[92]="\\\\",D[133]="\\N",D[160]="\\_",D[8232]="\\L",D[8233]="\\P";const B=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],j=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function z(M,L){if(L===null)return{};const ye={},ue=Object.keys(L);for(let be=0,we=ue.length;be<we;be+=1){let Ae=ue[be],Pe=String(L[Ae]);Ae.slice(0,2)==="!!"&&(Ae="tag:yaml.org,2002:"+Ae.slice(2));const je=M.compiledTypeMap.fallback[Ae];je&&i.call(je.styleAliases,Pe)&&(Pe=je.styleAliases[Pe]),ye[Ae]=Pe}return ye}function q(M){let L,ye;const ue=M.toString(16).toUpperCase();if(M<=255)L="x",ye=2;else if(M<=65535)L="u",ye=4;else if(M<=4294967295)L="U",ye=8;else throw new e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+L+t.repeat("0",ye-ue.length)+ue}const ne=1,Z=2;function J(M){this.schema=M.schema||n,this.indent=Math.max(1,M.indent||2),this.noArrayIndent=M.noArrayIndent||!1,this.skipInvalid=M.skipInvalid||!1,this.flowLevel=t.isNothing(M.flowLevel)?-1:M.flowLevel,this.styleMap=z(this.schema,M.styles||null),this.sortKeys=M.sortKeys||!1,this.lineWidth=M.lineWidth||80,this.noRefs=M.noRefs||!1,this.noCompatMode=M.noCompatMode||!1,this.condenseFlow=M.condenseFlow||!1,this.quotingType=M.quotingType==='"'?Z:ne,this.forceQuotes=M.forceQuotes||!1,this.replacer=typeof M.replacer=="function"?M.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function de(M,L){const ye=t.repeat(" ",L);let ue=0,be="";const we=M.length;for(;ue<we;){let Ae;const Pe=M.indexOf(`
68`,ue);Pe===-1?(Ae=M.slice(ue),ue=we):(Ae=M.slice(ue,Pe+1),ue=Pe+1),Ae.length&&Ae!==`
69`&&(be+=ye),be+=Ae}return be}function X(M,L){return`
70`+t.repeat(" ",M.indent*L)}function V(M,L){for(let ye=0,ue=M.implicitTypes.length;ye<ue;ye+=1)if(M.implicitTypes[ye].resolve(L))return!0;return!1}function te(M){return M===c||M===o}function ie(M){return M>=32&&M<=126||M>=161&&M<=55295&&M!==8232&&M!==8233||M>=57344&&M<=65533&&M!==s||M>=65536&&M<=1114111}function ce(M){return ie(M)&&M!==s&&M!==l&&M!==a}function ae(M,L,ye){const ue=ce(M),be=ue&&!te(M);return(ye?ue:ue&&M!==b&&M!==S&&M!==_&&M!==$&&M!==I)&&M!==f&&!(L===C&&!be)||ce(L)&&!te(L)&&M===f||L===C&&be}function ve(M){return ie(M)&&M!==s&&!te(M)&&M!==w&&M!==O&&M!==C&&M!==b&&M!==S&&M!==_&&M!==$&&M!==I&&M!==f&&M!==p&&M!==v&&M!==d&&M!==E&&M!==x&&M!==R&&M!==g&&M!==u&&M!==h&&M!==T&&M!==A}function xe(M){return!te(M)&&M!==C}function ge(M,L){const ye=M.charCodeAt(L);let ue;return ye>
70=55296&&ye<=56319&&L+1<M.length&&(ue=M.charCodeAt(L+1),ue>=56320&&ue<=57343)?(ye-55296)*1024+ue-56320+65536:ye}function le(M){return/^\n* /.test(M)}const fe=1,Se=2,G=3,he=4,Ee=5;function Ie(M,L,ye,ue,be,we,Ae,Pe){let je,Xe=0,Ge=null,it=!1,nt=!1;const Ut=ue!==-1;let Bt=-1,ht=ve(ge(M,0))&&xe(ge(M,M.length-1));if(L||Ae)for(je=0;je<M.length;Xe>=65536?je+=2:je++){if(Xe=ge(M,je),!ie(Xe))return Ee;ht=ht&&ae(Xe,Ge,Pe),Ge=Xe}else{for(je=0;je<M.length;Xe>=65536?je+=2:je++){if(Xe=ge(M,je),Xe===a)it=!0,Ut&&(nt=nt||je-Bt-1>ue&&M[Bt+1]!==" ",Bt=je);else if(!ie(Xe))return Ee;ht=ht&&ae(Xe,Ge,Pe),Ge=Xe}nt=nt||Ut&&je-Bt-1>ue&&M[Bt+1]!==" "}return!it&&!nt?ht&&!Ae&&!be(M)?fe:we===Z?Ee:Se:ye>9&&le(M)?Ee:Ae?we===Z?Ee:Se:nt?he:G}function ke(M,L,ye,ue,be){M.dump=(function(){if(L.length===0)return M.quotingType===Z?'""':"''";if(!M.noCompatMode&&(B.indexOf(L)!==-1||j.test(L)))return M.quotingType===Z?'"'+L+'"':"'"+L+"'";const we=M.indent*Math.max(1,ye),Ae=M.lineWidth===-1?-1:Math.max(Math.min(M.lineWidth,40),M.lineWidth-we),Pe=ue||M.flowLevel>-1&&ye>=M.flowLevel;function je(Xe){return V(M,Xe)}switch(Ie(L,Pe,M.indent,Ae,je,M.quotingType,M.forceQuotes&&!ue,be)){case fe:return L;case Se:return"'"+L.replace(/'/g,"''")+"'";case G:return"|"+De(L,M.indent)+He(de(L,we));case he:return">"+De(L,M.indent)+He(de(Je(L,Ae),we));case Ee:return'"'+Ne(L)+'"';default:throw new e("impossible error: invalid scalar style")}})()}function De(M,L){const ye=le(M)?String(L):"",ue=M[M.length-1]===`
71`,we=ue&&(M[M.length-2]===`
72`||M===`
73`)?"+":ue?"":"-";return ye+we+`
74`}function He(M){return M[M.length-1]===`
75`?M.slice(0,-1):M}function Je(M,L){const ye=/(\n+)([^\n]*)/g;let ue=(function(){let Pe=M.indexOf(`
76`);return Pe=Pe!==-1?Pe:M.length,ye.lastIndex=Pe,ze(M.slice(0,Pe),L)})(),be=M[0]===`
77`||M[0]===" ",we,Ae;for(;Ae=ye.exec(M);){const Pe=Ae[1],je=Ae[2];we=je[0]===" ",ue+=Pe+(!be&&!we&&je!==""?`
78`:"")+ze(je,L),be=we}return ue}function ze(M,L){if(M===""||M[0]===" ")return M;const ye=/ [^ ]/g;let ue,be=0,we,Ae=0,Pe=0,je="";for(;ue=ye.exec(M);)Pe=ue.index,Pe-be>L&&(we=Ae>be?Ae:Pe,je+=`
79`+M.slice(be,we),be=we+1),Ae=Pe;return je+=`
80`,M.length-be>L&&Ae>be?je+=M.slice(be,Ae)+`
81`+M.slice(Ae+1):je+=M.slice(be),je.slice(1)}function Ne(M){let L="",ye=0;for(let ue=0;ue<M.length;ye>=65536?ue+=2:ue++){ye=ge(M,ue);const be=D[ye];!be&&ie(ye)?(L+=M[ue],ye>=65536&&(L+=M[ue+1])):L+=be||q(ye)}return L}function tt(M,L,ye){let ue="";const be=M.tag;for(let we=0,Ae=ye.length;we<Ae;we+=1){let Pe=ye[we];M.replacer&&(Pe=M.replacer.call(ye,String(we),Pe)),(W(M,L,Pe,!1,!1)||typeof Pe>"u"&&W(M,L,null,!1,!1))&&(ue!==""&&(ue+=","+(M.condenseFlow?"":" ")),ue+=M.dump)}M.tag=be,M.dump="["+ue+"]"}function pt(M,L,ye,ue){let be="";const we=M.tag;for(let Ae=0,Pe=ye.length;Ae<Pe;Ae+=1){let je=ye[Ae];M.replacer&&(je=M.replacer.call(ye,String(Ae),je)),(W(M,L+1,je,!0,!0,!1,!0)||typeof je>"u"&&W(M,L+1,null,!0,!0,!1,!0))&&((!ue||be!=="")&&(be+=X(M,L)),M.dump&&a===M.dump.charCodeAt(0)?be+="-":be+="- ",be+=M.dump)}M.tag=we,M.dump=be||"[]"}function gt(M,L,ye){let ue="";const be=M.tag,we=Object.keys(ye);for(let Ae=0,Pe=we.length;Ae<Pe;Ae+=1){let je="";ue!==""&&(je+=", "),M.condenseFlow&&(je+='"');const Xe=we[Ae];let Ge=ye[Xe];M.replacer&&(Ge=M.replacer.call(ye,Xe,Ge)),W(M,L,Xe,!1,!1)&&(M.dump.length>1024&&(je+="? "),je+=M.dump+(M.condenseFlow?'"':"")+":"+(M.condenseFlow?"":" "),W(M,L,Ge,!1,!1)&&(je+=M.dump,ue+=je))}M.tag=be,M.dump="{"+ue+"}"}function y(M,L,ye,ue){let be="";const we=M.tag,Ae=Object.keys(ye);if(M.sortKeys===!0)Ae.sort();else if(typeof M.sortKeys=="function")Ae.sort(M.sortKeys);else if(M.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let Pe=0,je=Ae.length;Pe<je;Pe+=1){let Xe="";(!ue||be!=="")&&(Xe+=X(M,L));const Ge=Ae[Pe];let it=ye[Ge];if(M.replacer&&(it=M.replacer.call(ye,Ge,it)),!W(M,L+1,Ge,!0,!0,!0))continue;const nt=M.tag!==null&&M.tag!=="?"||M.dump&&M.dump.length>1024;nt&&(M.dump&&a===M.dump.charCodeAt(0)?Xe+="?":Xe+="? "),Xe+=M.dump,nt&&(Xe+=X(M,L)),W(M,L+1,it,!0,nt)&&(M.dump&&a===M.dump.charCodeAt(0)?Xe+=":":Xe+=": ",Xe+=M.dump,be+=Xe)}M.tag=we,M.dump=be||"{}"}function K(M,L,ye){const ue=ye?M.explicitTypes:M.implicitTypes;for(let be=0,we=ue.length;be<we;be+=1){const Ae=ue[be];
81if((Ae.instanceOf||Ae.predicate)&&(!Ae.instanceOf||typeof L=="object"&&L instanceof Ae.instanceOf)&&(!Ae.predicate||Ae.predicate(L))){if(ye?Ae.multi&&Ae.representName?M.tag=Ae.representName(L):M.tag=Ae.tag:M.tag="?",Ae.represent){const Pe=M.styleMap[Ae.tag]||Ae.defaultStyle;let je;if(r.call(Ae.represent)==="[object Function]")je=Ae.represent(L,Pe);else if(i.call(Ae.represent,Pe))je=Ae.represent[Pe](L,Pe);else throw new e("!<"+Ae.tag+'> tag resolver accepts not "'+Pe+'" style');M.dump=je}return!0}}return!1}function W(M,L,ye,ue,be,we,Ae){M.tag=null,M.dump=ye,K(M,ye,!1)||K(M,ye,!0);const Pe=r.call(M.dump),je=ue;ue&&(ue=M.flowLevel<0||M.flowLevel>L);const Xe=Pe==="[object Object]"||Pe==="[object Array]";let Ge,it;if(Xe&&(Ge=M.duplicates.indexOf(ye),it=Ge!==-1),(M.tag!==null&&M.tag!=="?"||it||M.indent!==2&&L>0)&&(be=!1),it&&M.usedDuplicates[Ge])M.dump="*ref_"+Ge;else{if(Xe&&it&&!M.usedDuplicates[Ge]&&(M.usedDuplicates[Ge]=!0),Pe==="[object Object]")ue&&Object.keys(M.dump).length!==0?(y(M,L,M.dump,be),it&&(M.dump="&ref_"+Ge+M.dump)):(gt(M,L,M.dump),it&&(M.dump="&ref_"+Ge+" "+M.dump));else if(Pe==="[object Array]")ue&&M.dump.length!==0?(M.noArrayIndent&&!Ae&&L>0?pt(M,L-1,M.dump,be):pt(M,L,M.dump,be),it&&(M.dump="&ref_"+Ge+M.dump)):(tt(M,L,M.dump),it&&(M.dump="&ref_"+Ge+" "+M.dump));else if(Pe==="[object String]")M.tag!=="?"&&ke(M,M.dump,L,we,je);else{if(Pe==="[object Undefined]")return!1;if(M.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+Pe)}if(M.tag!==null&&M.tag!=="?"){let nt=encodeURI(M.tag[0]==="!"?M.tag.slice(1):M.tag).replace(/!/g,"%21");M.tag[0]==="!"?nt="!"+nt:nt.slice(0,18)==="tag:yaml.org,2002:"?nt="!!"+nt.slice(18):nt="!<"+nt+">",M.dump=nt+" "+M.dump}}return!0}function re(M,L){const ye=[],ue=[];se(M,ye,ue);const be=ue.length;for(let we=0;we<be;we+=1)L.duplicates.push(ye[ue[we]]);L.usedDuplicates=new Array(be)}function se(M,L,ye){if(M!==null&&typeof M=="object"){const ue=L.indexOf(M);if(ue!==-1)ye.indexOf(ue)===-1&&ye.push(ue);else if(L.push(M),Array.isArray(M))for(let be=0,we=M.length;be<we;be+=1)se(M[be],L,ye);else{const be=Object.keys(M);for(let we=0,Ae=be.length;we<Ae;we+=1)se(M[be[we]],L,ye)}}}function pe(M,L){L=L||{};const ye=new J(L);ye.noRefs||re(M,ye);let ue=M;return ye.replacer&&(ue=ye.replacer.call({"":ue},"",ue)),W(ye,0,ue,!0,!0)?ye.dump+`
82`:""}return Mm.dump=pe,Mm}var HS;function j_(){if(HS)return Ir;HS=1;const t=D_(),e=L_();function n(r,i){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}return Ir.Type=zr(),Ir.Schema=m6(),Ir.FAILSAFE_SCHEMA=y6(),Ir.JSON_SCHEMA=$6(),Ir.CORE_SCHEMA=E6(),Ir.DEFAULT_SCHEMA=Jb(),Ir.load=t.load,Ir.loadAll=t.loadAll,Ir.dump=e.dump,Ir.YAMLException=iu(),Ir.types={binary:I6(),float:x6(),map:b6(),null:w6(),pairs:O6(),set:k6(),timestamp:T6(),bool:S6(),int:C6(),merge:R6(),omap:A6(),seq:v6(),str:g6()},Ir.safeLoad=n("safeLoad","load"),Ir.safeLoadAll=n("safeLoadAll","loadAll"),Ir.safeDump=n("safeDump","dump"),Ir}var zS;function qS(){if(zS)return Cn;zS=1;var t=Cn&&Cn.__assign||function(){return t=Object.assign||function(b){for(var w,C=1,x=arguments.length;C<x;C++){w=arguments[C];for(var R in w)Object.prototype.hasOwnProperty.call(w,R)&&(b[R]=w[R])}return b},t.apply(this,arguments)},e=Cn&&Cn.__createBinding||(Object.create?(function(b,w,C,x){x===void 0&&(x=C);var R=Object.getOwnPropertyDescriptor(w,C);(!R||("get"in R?!w.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return w[C]}}),Object.defineProperty(b,x,R)}):(function(b,w,C,x){x===void 0&&(x=C),b[x]=w[C]})),n=Cn&&Cn.__setModuleDefault||(Object.create?(function(b,w){Object.defineProperty(b,"default",{enumerable:!0,value:w})}):function(b,w){b.default=w}),r=Cn&&Cn.__importStar||function(b){if(b&&b.__esModule)return b;var w={};if(b!=null)for(var C in b)C!=="default"&&Object.prototype.hasOwnProperty.call(b,C)&&e(w,b,C);return n(w,b),w},i=Cn&&Cn.__awaiter||function(b,w,C,x){function R(O){return O instanceof C?O:new C(function(T){T(O)})}return new(C||(C=Promise))(function(O,T){function S($){try{A(x.next($))}catch(E){T(E)}}function _($){try{A(x.throw($))}catch(E){T(E)}}function A($){$.done?O($.value):R($.value).then(S,_)}A((x=x.apply(b,w||[])).next())})},s=Cn&&Cn.__generator||function(b,w){var C={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]}
82,trys:[],ops:[]},x,R,O,T;return T={next:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(T[Symbol.iterator]=function(){return this}),T;function S(A){return function($){return _([A,$])}}function _(A){if(x)throw new TypeError("Generator is already executing.");for(;T&&(T=0,A[0]&&(C=0)),C;)try{if(x=1,R&&(O=A[0]&2?R.return:A[0]?R.throw||((O=R.return)&&O.call(R),0):R.next)&&!(O=O.call(R,A[1])).done)return O;switch(R=0,O&&(A=[A[0]&2,O.value]),A[0]){case 0:case 1:O=A;break;case 4:return C.label++,{value:A[1],done:!1};case 5:C.label++,R=A[1],A=[0];continue;case 7:A=C.ops.pop(),C.trys.pop();continue;default:if(O=C.trys,!(O=O.length>0&&O[O.length-1])&&(A[0]===6||A[0]===2)){C=0;continue}if(A[0]===3&&(!O||A[1]>O[0]&&A[1]<O[3])){C.label=A[1];break}if(A[0]===6&&C.label<O[1]){C.label=O[1],O=A;break}if(O&&C.label<O[2]){C.label=O[2],C.ops.push(A);break}O[2]&&C.ops.pop(),C.trys.pop();continue}A=w.call(b,C)}catch($){A=[6,$],R=0}finally{x=O=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},o=Cn&&Cn.__values||function(b){var w=typeof Symbol=="function"&&Symbol.iterator,C=w&&b[w],x=0;if(C)return C.call(b);if(b&&typeof b.length=="number")return{next:function(){return b&&x>=b.length&&(b=void 0),{value:b&&b[x++],done:!b}}};throw new TypeError(w?"Object is not iterable.":"Symbol.iterator is not defined.")},a=Cn&&Cn.__read||function(b,w){var C=typeof Symbol=="function"&&b[Symbol.iterator];if(!C)return b;var x=C.call(b),R,O=[],T;try{for(;(w===void 0||w-- >0)&&!(R=x.next()).done;)O.push(R.value)}catch(S){T={error:S}}finally{try{R&&!R.done&&(C=x.return)&&C.call(x)}finally{if(T)throw T.error}}return O},l=Cn&&Cn.__spreadArray||function(b,w,C){if(C||arguments.length===2)for(var x=0,R=w.length,O;x<R;x++)(O||!(x in w))&&(O||(O=Array.prototype.slice.call(w,0,x)),O[x]=w[x]);return b.concat(O||Array.prototype.slice.call(w))},c=Cn&&Cn.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.OpenAPIClientAxios=void 0;var d=c(E_()),u=c(A_()),f=__(),h=p6(),p=P_(),g="default",v=(function(){function b(w){var C,x=this,R,O,T,S,_,A,$,E;this.getClient=function(){return i(x,void 0,void 0,function(){return s(this,function(I){return this.initialized?[2,this.instance]:[2,this.init()]})})},this.init=function(){return i(x,void 0,void 0,function(){return s(this,function(I){switch(I.label){case 0:return[4,this.loadDocument()];case 1:return I.sent(),this.definition=(0,f.dereferenceSync)(this.document),this.instance=this.createAxiosInstance(),this.initialized=!0,[2,this.instance]}})})},this.initSync=function(){if(typeof x.inputDocument!="object")throw new Error(".initSync() can't be called with a non-object definition. Please use .init()");return x.document=x.inputDocument,x.definition=(0,f.dereferenceSync)(x.document),x.instance=x.createAxiosInstance(),x.initialized=!0,x.instance},this.getAxiosInstance=function(){var I=x.instance;return I||(I=d.default.create(x.axiosConfigDefaults)),I},this.createAxiosInstance=function(){var I,D,B=x.getAxiosInstance(),j=x.getBaseURL();j&&!B.defaults.baseURL&&(B.defaults.baseURL=j);var z=x.getOperations();try{for(var q=o(z),ne=q.next();!ne.done;ne=q.next()){var Z=ne.value,J=Z.operationId;J&&(B[x.transformOperationName(J)]=x.createOperationMethod(Z))}}catch(V){I={error:V}}finally{try{ne&&!ne.done&&(D=q.return)&&D.call(q)}finally{if(I)throw I.error}}B.paths={};var de=function(V){if(x.definition.paths[V]){B.paths[V]||(B.paths[V]={});var te=x.definition.paths[V],ie=function(ae){if(te[ae]&&Object.values(h.HttpMethod).includes(ae)){var ve=ae,xe=x.getOperations().find(function(ge){return ge.method===ve&&ge.path===V});B.paths[V][ve]=x.createOperationMethod(xe)}};for(var ce in te)ie(ce)}};for(var X in x.definition.paths)de(X);return B.api=x,B},this.getBaseURL=function(I){var D,B,j,z;if(x.definition){if(I&&(typeof I=="string"&&(I=x.getOperation(I)),I.servers&&I.servers[0]))return I.servers[0].url;var q;if(typeof x.defaultServer=="number")x.definition.servers&&x.definition.servers[x.defaultServer]&&(q=x.definition.servers[x.defaultServer]);else if(typeof x.defaultServer=="string")try{for(var ne=o(x.definition.servers),Z=ne.next();!Z.done;Z=ne.next()){var J=Z.value;if(J.description===x.defaultServer){q=J;break}}}catch(ge){D={error:ge}}finally{try{Z&&!Z.done&&(B=ne.return)&&B.call(ne)}finally{if(D)throw D.error}}else x.defaultServer.url&&(q=x.defaultServer);if(q){var de=q.url,X=q.variables,V=(0,u.default)(de);if(!V.names.length)return de;var te={};try{for(var ie=o(V.names),ce=ie.next();!ce.done;ce=ie.next()){var ae=ce.value,ve=x.baseURLVariables[ae];if(ve!==void 0&&X[ae].enum){if(typeof ve=="number"){var xe=X[ae].enum[ve];if(xe)te[ae]=xe;else throw new Error("index ".concat(ve," out of range for enum of baseURL variable: ").concat(ae,";               enum max index is ").concat(X[ae].enum.length-1))}else if(typeof ve=="string")if(X[ae].enum.includes(ve))te[ae]=ve;else throw new Error("".concat(ve," is not a valid entry for baseURL variable ").concat(ae,";                 variable must be of the following: ").concat(X[ae].enum.
82join(", ")))}else te[ae]=X[ae].default}}catch(ge){j={error:ge}}finally{try{ce&&!ce.done&&(z=ie.return)&&z.call(ie)}finally{if(j)throw j.error}}return V.path(te)}}},this.getAxiosConfigForOperation=function(I,D){typeof I=="string"&&(I=x.getOperation(I));var B=x.getRequestConfigForOperation(I,D),j={method:B.method,url:B.path,data:B.payload,params:B.query,headers:B.headers},z=I.servers;z&&z[0]&&(j.baseURL=z[0].url);var q=a(D,3),ne=q[2];return t(t(t({},j),ne),{params:t(t({},j==null?void 0:j.params),ne==null?void 0:ne.params),headers:t(t({},j==null?void 0:j.headers),ne==null?void 0:ne.headers)})},this.getRequestConfigForOperation=function(I,D){var B,j,z,q,ne,Z,J,de,X,V;typeof I=="string"&&(I=x.getOperation(I));var te={},ie={},ce=[],ae={},ve={},xe=I.parameters||[],ge=function(Pe,je,Xe){switch(Xe){case h.ParamType.Path:te[Pe]=je;break;case h.ParamType.Query:{ie[Pe]=je;var Ge=xe.find(function(nt){return nt.name===Pe&&nt.in==="query"}),it=(0,p.serializeQueryParameter)(Ge,Pe,je);ce.push.apply(ce,l([],a(it),!1));break}case h.ParamType.Header:ae[Pe]=je;break;case h.ParamType.Cookie:ve[Pe]=je;break}},le=function(Pe){var je=xe.find(function(Xe){var Ge=Xe.name;return Ge===Pe});return je?je.in:h.ParamType.Query},fe=function(){var Pe=xe.find(function(Xe){var Ge=Xe.required;return Ge===!0});if(Pe)return Pe;var je=xe[0];if(je)return je},Se=a(D,2),G=Se[0],he=Se[1];if(Array.isArray(G))try{for(var Ee=o(G),Ie=Ee.next();!Ie.done;Ie=Ee.next()){var ke=Ie.value;ge(ke.name,ke.value,ke.in||le(ke.name))}}catch(Pe){B={error:Pe}}finally{try{Ie&&!Ie.done&&(j=Ee.return)&&j.call(Ee)}finally{if(B)throw B.error}}else if(typeof G=="object")for(var De in G)G[De]!==void 0&&ge(De,G[De],le(De));else if(G){var He=fe();if(!He)throw new Error("No parameters found for operation ".concat(I.operationId));ge(He.name,G,He.in)}var Je=(0,u.default)(I.path);try{for(var ze=o(Je.names),Ne=ze.next();!Ne.done;Ne=ze.next()){var tt=Ne.value,pt=te[tt];te[tt]="".concat(pt)}}catch(Pe){z={error:Pe}}finally{try{Ne&&!Ne.done&&(q=ze.return)&&q.call(ze)}finally{if(z)throw z.error}}var gt=Je.path(te),y=ce.join("&"),K="".concat(x.getBaseURL(I)).concat(gt).concat(y?"?".concat(y):""),W=x.client.defaults.headers;try{for(var re=o(Object.entries((X=W.common)!==null&&X!==void 0?X:{})),se=re.next();!se.done;se=re.next()){var pe=a(se.value,2),M=pe[0],L=pe[1];ae[M]=L}}catch(Pe){ne={error:Pe}}finally{try{se&&!se.done&&(Z=re.return)&&Z.call(re)}finally{if(ne)throw ne.error}}if(x.applyMethodCommonHeaders){var ye=(V=W[I.method])!==null&&V!==void 0?V:{};try{for(var ue=o(Object.entries(ye)),be=ue.next();!be.done;be=ue.next()){var we=a(be.value,2),M=we[0],L=we[1];ae[M]=L}}catch(Pe){J={error:Pe}}finally{try{be&&!be.done&&(de=ue.return)&&de.call(ue)}finally{if(J)throw J.error}}}var Ae={method:I.method,url:K,path:gt,pathParams:te,query:ie,queryString:y,headers:ae,cookies:ve,payload:he};return Ae},this.getOperations=function(){var I,D=((I=x.definition)===null||I===void 0?void 0:I.paths)||{};return Object.entries(D).flatMap(function(B){var j=a(B,2),z=j[0],q=j[1];return Object.values(h.HttpMethod).map(function(ne){return{path:z,method:ne,operation:q[ne]}}).filter(function(ne){var Z=ne.operation;return Z}).map(function(ne){var Z,J=ne.operation,de=ne.method,X=t(t({},typeof J=="object"?J:{}),{path:z,method:de});return q.parameters&&(X.parameters=l(l([],a(X.parameters||[]),!1),a(q.parameters),!1)),q.servers&&(X.servers=l(l([],a(X.servers||[]),!1),a(q.servers),!1)),X.security=(Z=X.security)!==null&&Z!==void 0?Z:x.definition.security,X})})},this.getOperation=function(I){return x.getOperations().find(function(D){return D.operationId===I})},this.createOperationMethod=function(I){var D=function(){for(var B=[],j=0;j<arguments.length;j++)B[j]=arguments[j];return i(x,void 0,void 0,function(){var z,q;return s(this,function(ne){return z=this.getAxiosConfigForOperation(I,B),q=this.getRunner(I.operationId),[2,q.runRequest(z,I,q.context)]})})};return x.transformOperationMethod(D,I)},this.inputDocument=w.definition,this.quick=(R=w.quick)!==null&&R!==void 0?R:!1,this.axiosConfigDefaults=(O=w.axiosConfigDefaults)!==null&&O!==void 0?O:{},this.instance=w.axiosInstance,this.defaultServer=(T=w.withServer)!==null&&T!==void 0?T:0,this.baseURLVariables=(S=w.baseURLVariables)!==null&&S!==void 0?S:{},this.applyMethodCommonHeaders=(_=w.applyMethodCommonHeaders)!==null&&_!==void 0?_:!1,this.transformOperationName=(A=w.transformOperationName)!==null&&A!==void 0?A:(function(I){return I}),this.transformOperationMethod=($=w.transformOperationMethod)!==null&&$!==void 0?$:(function(I){return I}),this.runners=(C={},C[g]={runRequest:(E=w.axiosRunner)!==null&&E!==void 0?E:(function(I){return x.client.request(I)})},C)}return Object.defineProperty(b.prototype,"client",{get:function(){return this.instance}
82,enumerable:!1,configurable:!0}),b.prototype.withServer=function(w,C){C===void 0&&(C={}),this.defaultServer=w,this.baseURLVariables=C},b.prototype.loadDocument=function(){var w;return i(this,void 0,void 0,function(){var C,x,R,O;return s(this,function(T){switch(T.label){case 0:return typeof this.inputDocument!="object"?[3,1]:(this.document=this.inputDocument,[3,6]);case 1:return C=this.getAxiosInstance(),[4,C.get(this.inputDocument)];case 2:return x=T.sent(),typeof x.data!="object"?[3,3]:(this.document=x.data,[3,6]);case 3:return typeof x.data=="string"&&(!((w=x.headers["content-type"])===null||w===void 0)&&w.match(/ya?ml/))?[4,Promise.resolve().then(function(){return r(j_())})]:[3,5];case 4:return R=T.sent(),this.document=R.load(x.data),[3,6];case 5:throw O=new Error("Invalid response fetching OpenAPI definition: ".concat(x)),O.response=x,O;case 6:return[2,this.document]}})})},b.prototype.registerRunner=function(w,C){this.runners[C??g]=w},b.prototype.getRunner=function(w){var C;return(C=this.runners[w])!==null&&C!==void 0?C:this.runners[g]},b})();return Cn.OpenAPIClientAxios=v,Cn}var US;function F_(){return US||(US=1,(function(t){var e=aa&&aa.__createBinding||(Object.create?(function(i,s,o,a){a===void 0&&(a=o);var l=Object.getOwnPropertyDescriptor(s,o);(!l||("get"in l?!s.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,l)}):(function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]})),n=aa&&aa.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,i,o)};Object.defineProperty(t,"__esModule",{value:!0});var r=qS();t.default=r.OpenAPIClientAxios,n(qS(),t),n(p6(),t)})(aa)),aa}var B_=F_();const H_=p$(B_);let Dm;const In=async()=>{if(!Dm){const t=window.location.origin;Dm=await new H_({definition:`${t}/api/doc?domain=${t}`,axiosConfigDefaults:{baseURL:t,withCredentials:!0}}).init()}return Dm};/**
83 * @license lucide-react v0.536.0 - ISC
84 *
85 * This source code is licensed under the ISC license.
86 * See the LICENSE file in the root directory of this source tree.
87 */const z_=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q_=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),VS=t=>{const e=q_(t);return e.charAt(0).toUpperCase()+e.slice(1)},N6=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),U_=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
88 * @license lucide-react v0.536.0 - ISC
89 *
90 * This source code is licensed under the ISC license.
91 * See the LICENSE file in the root directory of this source tree.
92 */var V_={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
93 * @license lucide-react v0.536.0 - ISC
94 *
95 * This source code is licensed under the ISC license.
96 * See the LICENSE file in the root directory of this source tree.
97 */const W_=m.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>m.createElement("svg",{ref:l,...V_,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:N6("lucide",i),...!s&&!U_(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,d])=>m.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
98 * @license lucide-react v0.536.0 - ISC
99 *
100 * This source code is licensed under the ISC license.
101 * See the LICENSE file in the root directory of this source tree.
102 */const gn=(t,e)=>{const n=m.forwardRef(({className:r,...i},s)=>m.createElement(W_,{ref:s,iconNode:e,className:N6(`lucide-${z_(VS(t))}`,`lucide-${t}`,r),...i}));return n.displayName=VS(t),n};/**
103 * @license lucide-react v0.536.0 - ISC
104 *
105 * This source code is licensed under the ISC license.
106 * See the LICENSE file in the root directory of this source tree.
107 */const G_=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],K_=gn("arrow-left",G_);/**
108 * @license lucide-react v0.536.0 - ISC
109 *
110 * This source code is licensed under the ISC license.
111 * See the LICENSE file in the root directory of this source tree.
112 */const X_=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],_6=gn("bot",X_);/**
113 * @license lucide-react v0.536.0 - ISC
114 *
115 * This source code is licensed under the ISC license.
116 * See the LICENSE file in the root directory of this source tree.
117 */const Y_=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
117],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],J_=gn("building-2",Y_);/**
118 * @license lucide-react v0.536.0 - ISC
119 *
120 * This source code is licensed under the ISC license.
121 * See the LICENSE file in the root directory of this source tree.
122 */const Q_=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],WS=gn("check",Q_);/**
123 * @license lucide-react v0.536.0 - ISC
124 *
125 * This source code is licensed under the ISC license.
126 * See the LICENSE file in the root directory of this source tree.
127 */const Z_=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],P6=gn("chevron-right",Z_);/**
128 * @license lucide-react v0.536.0 - ISC
129 *
130 * This source code is licensed under the ISC license.
131 * See the LICENSE file in the root directory of this source tree.
132 */const eP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tP=gn("circle-check",eP);/**
133 * @license lucide-react v0.536.0 - ISC
134 *
135 * This source code is licensed under the ISC license.
136 * See the LICENSE file in the root directory of this source tree.
137 */const nP=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],rP=gn("file-text",nP);/**
138 * @license lucide-react v0.536.0 - ISC
139 *
140 * This source code is licensed under the ISC license.
141 * See the LICENSE file in the root directory of this source tree.
142 */const iP=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]],M6=gn("headphones",iP);/**
143 * @license lucide-react v0.536.0 - ISC
144 *
145 * This source code is licensed under the ISC license.
146 * See the LICENSE file in the root directory of this source tree.
147 */const sP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],oP=gn("info",sP);/**
148 * @license lucide-react v0.536.0 - ISC
149 *
150 * This source code is licensed under the ISC license.
151 * See the LICENSE file in the root directory of this source tree.
152 */const aP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Lm=gn("loader-circle",aP);/**
153 * @license lucide-react v0.536.0 - ISC
154 *
155 * This source code is licensed under the ISC license.
156 * See the LICENSE file in the root directory of this source tree.
157 */const lP=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],cP=gn("message-square",lP);/**
158 * @license lucide-react v0.536.0 - ISC
159 *
160 * This source code is licensed under the ISC license.
161 * See the LICENSE file in the root directory of this source tree.
162 */const dP=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],uP=gn("paperclip",dP);/**
163 * @license lucide-react v0.536.0 - ISC
164 *
165 * This source code is licensed under the ISC license.
166 * See the LICENSE file in the root directory of this source tree.
167 */const fP=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],hP=gn("pause",fP);/**
168 * @license lucide-react v0.536.0 - ISC
169 *
170 * This source code is licensed under the ISC license.
171 * See the LICENSE file in the root directory of this source tree.
172 */const pP=[["path",{d:"M13 2a9 9 0 0 1 9 9",key:"1itnx2"}],["path",{d:"M13 6a5 5 0 0 1 5 5",key:"11nki7"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],mP=gn("phone-call",pP);/**
173 * @license lucide-react v0.536.0 - ISC
174 *
175 * This source code is licensed under the ISC license.
176 * See the LICENSE file in the root directory of this source tree.
177 */const gP=[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 
1770 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]],vP=gn("phone-off",gP);/**
178 * @license lucide-react v0.536.0 - ISC
179 *
180 * This source code is licensed under the ISC license.
181 * See the LICENSE file in the root directory of this source tree.
182 */const bP=[["path",{d:"m16 8 6-6",key:"oawc05"}],["path",{d:"M22 8V2h-6",key:"oqy2zc"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],yP=gn("phone-outgoing",bP);/**
183 * @license lucide-react v0.536.0 - ISC
184 *
185 * This source code is licensed under the ISC license.
186 * See the LICENSE file in the root directory of this source tree.
187 */const wP=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Al=gn("phone",wP);/**
188 * @license lucide-react v0.536.0 - ISC
189 *
190 * This source code is licensed under the ISC license.
191 * See the LICENSE file in the root directory of this source tree.
192 */const SP=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],D6=gn("play",SP);/**
193 * @license lucide-react v0.536.0 - ISC
194 *
195 * This source code is licensed under the ISC license.
196 * See the LICENSE file in the root directory of this source tree.
197 */const CP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xP=gn("plus",CP);/**
198 * @license lucide-react v0.536.0 - ISC
199 *
200 * This source code is licensed under the ISC license.
201 * See the LICENSE file in the root directory of this source tree.
202 */const $P=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],EP=gn("radio",$P);/**
203 * @license lucide-react v0.536.0 - ISC
204 *
205 * This source code is licensed under the ISC license.
206 * See the LICENSE file in the root directory of this source tree.
207 */const TP=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],RP=gn("send-horizontal",TP);/**
208 * @license lucide-react v0.536.0 - ISC
209 *
210 * This source code is licensed under the ISC license.
211 * See the LICENSE file in the root directory of this source tree.
212 */const IP=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],AP=gn("skip-forward",IP);/**
213 * @license lucide-react v0.536.0 - ISC
214 *
215 * This source code is licensed under the ISC license.
216 * See the LICENSE file in the root directory of this source tree.
217 */const OP=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],L6=gn("trash-2",OP);/**
218 * @license lucide-react v0.536.0 - ISC
219 *
220 * This source code is licensed under the ISC license.
221 * See the LICENSE file in the root directory of this source tree.
222 */const kP=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],NP=gn("user-round-check",kP);/**
223 * @license lucide-react v0.536.0 - ISC
224 *
225 * This source code is licensed under the ISC license.
226 * See the LICENSE file in the root directory of this source tree.
227 */const _P=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Qb=gn("user",_P);/**
228 * @license lucide-react v0.536.0 - ISC
229 *
230 * This source code is licensed under the ISC license.
231 * See the LICENSE file in the root directory of this source tree.
232 */const PP=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],MP=gn("volume-2",PP);/**
233 * @license lucide-react v0.536.0 - ISC
234 *
235 * This source code is licensed under the ISC license.
236 * See the LICENSE file in the root directory of this source tree.
237 */const DP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}
237],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ap=gn("x",DP),ih=t=>{const e=t?new Date(t).getTime():0;return Number.isFinite(e)?e:0},LP=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],jP=(t,e)=>t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),GS=t=>String(t).padStart(2,"0"),FP=t=>{if(!t)return"—";const e=new Date(t);return Number.isFinite(e.getTime())?jP(e,new Date)?`${GS(e.getHours())}:${GS(e.getMinutes())}`:`${LP[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`:"—"},BP=t=>!t||t.endsWith("@sms.lawbot.ai")||t.endsWith("@placeholder.com")||t.startsWith("unknown-"),j6=t=>BP(t.email)?null:t.email,pd=t=>[t.firstName,t.lastName].filter(Boolean).join(" ")||t.phone||j6(t)||"Unknown contact",F6=t=>{var n,r,i,s;return[(n=t.firstName)==null?void 0:n[0],(r=t.lastName)==null?void 0:r[0]].filter(Boolean).join("").toUpperCase()||((s=(i=t.email)==null?void 0:i[0])==null?void 0:s.toUpperCase())||"UC"},B6=t=>t.status==="TRANSFERING"||!!t.assistantUserId||t.activeTarget==="PRACTICE_ASSISTANT"||t.activeTarget==="PERSONAL_ASSISTANT",H6=t=>t.status==="IN_PROGRESS"||t.status==="TRANSFERING",z6=t=>H6(t)&&B6(t),HP=(t,e)=>{var n,r;if(t.type==="CALL")return t.call.callDirection==="INCOMING"?"IN":"OUT";if(t.type==="EMAIL"){const i=((n=t.email.from)==null?void 0:n.toLowerCase())??"",s=((r=e.email)==null?void 0:r.toLowerCase())??"";return s&&i.includes(s)?"IN":"OUT"}return t.type==="SMS"&&t.sms.direction==="INBOUND"?"IN":"OUT"},q6=(t,e=[])=>{const n=(t.chatLog||[]).map((o,a)=>({id:`call-${o.id||a}`,type:"CALL",createdAt:o.createdAt||o.updatedAt||"",call:o})),r=(t.SmsLog||[]).map((o,a)=>({id:`sms-${o.id||a}`,type:"SMS",createdAt:o.createdAt||"",sms:o})),i=(t.EmailLog||[]).map((o,a)=>({id:`email-${o.id||a}`,type:"EMAIL",createdAt:o.createdAt||"",email:o})),s=e.map((o,a)=>({id:`note-${o.id||a}`,type:"NOTE",createdAt:o.createdAt||"",note:o}));return[...n,...r,...i,...s].sort((o,a)=>ih(o.createdAt)-ih(a.createdAt))},zP=t=>{const e=q6(t);return e[e.length-1]},Rf=t=>{const e=zP(t),r=(t.chatLog||[]).some(z6),i=t.inboxStatus==="NEEDS_HUMAN"||r;let s=null,o="No communication history yet";return(e==null?void 0:e.type)==="CALL"?(s="CALL",o=e.call.summary||(H6(e.call)?"Call in progress":"Completed call")):(e==null?void 0:e.type)==="SMS"?(s="SMS",o=e.sms.content||"SMS activity"):(e==null?void 0:e.type)==="EMAIL"&&(s="EMAIL",o=e.email.subject||e.email.content||"Email activity"),{contact:t,latestAt:(e==null?void 0:e.createdAt)||t.updatedAt||t.createdAt||"",latestChannel:s,latestPreview:o,needsHuman:i,hasLiveEscalation:r}},Vc=t=>[...t].sort((e,n)=>ih(n.latestAt)-ih(e.latestAt)),qP=(t,e)=>{if(!e.id)return t;const n=Rf(e);return t.some(i=>i.contact.id===e.id)?Vc(t.map(i=>i.contact.id===e.id?n:i)):Vc([n,...t])};function jm({iconSrc:t,label:e,value:n,placeholder:r,type:i="text",onSave:s}){const[o,a]=m.useState(!1),[l,c]=m.useState(n),[d,u]=m.useState(!1);m.useEffect(()=>{o||c(n)},[n,o]);const f=async()=>{const p=l.trim();if(a(!1),!(!s||p===n.trim())){u(!0);try{await s(p)}catch{c(n)}finally{u(!1)}}},h=!!n;return N.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("img",{src:t,alt:"",className:"size-3"}),N.jsx("span",{className:"text-[11px] font-medium text-[#9ca3af]",children:e})]}),N.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o?N.jsx("input",{autoFocus:!0,t
237ype:i,value:l,disabled:d,onChange:p=>c(p.target.value),onBlur:()=>void f(),onKeyDown:p=>{p.key==="Enter"&&f(),p.key==="Escape"&&(c(n),a(!1))},className:"w-36 min-w-0 rounded border border-[#e2e8f0] bg-white px-1.5 py-0.5 text-right text-[11px] text-[#161c3c] outline-none focus:border-[#7fafff]"}):N.jsx("span",{className:`truncate text-[11px] ${h?"font-semibold text-[#161c3c]":"font-medium text-[#9ca3af]"}`,children:n||r}),s&&!o&&N.jsx("button",{type:"button",onClick:()=>a(!0),className:"shrink-0 text-[11px] font-medium text-[#7fafff] underline",children:h?"Edit":"Add"})]})]})}function Fm({iconSrc:t,count:e}){return N.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-[#f3f4f6] bg-[#f9fafb] px-2.5 py-1",children:[N.jsx("img",{src:t,alt:"",className:"size-3"}),N.jsx("span",{className:"text-[11px] font-semibold text-[#161c3c]",children:e})]})}const UP=t=>t==="NUMBER"?"number":t==="DATE"?"date":"text";function VP({contact:t,tasks:e,propertyDefinitions:n,open:r,savingQualification:i,onClose:s,onToggleQualified:o,onResolve:a,onToggleTask:l,onAddTask:c,onDeleteTask:d,onSetProperty:u,onUpdateContact:f}){var V,te,ie;const[h,p]=m.useState(!1),[g,v]=m.useState(!1),[b,w]=m.useState(!1),[C,x]=m.useState(""),[R,O]=m.useState(""),[T,S]=m.useState(!1),[_,A]=m.useState(),[$,E]=m.useState(""),[I,D]=m.useState(!1),B=m.useRef(null),j=m.useRef(null),z=m.useRef(null),q=m.useRef(s),ne=r||h;m.useEffect(()=>{q.current=s},[s]),m.useEffect(()=>{w(!1),x(""),O(""),A(void 0)},[t.id]);const Z=async()=>{const ce=C.trim();if(!ce)return;const ae=R?new Date(R).toISOString():new Date(Date.now()+7*864e5).toISOString();S(!0);try{await c(ce,ae),x(""),O(""),w(!1)}catch{}finally{S(!1)}},J=async ce=>{D(!0);try{await u(ce,$.trim()),A(void 0)}catch{}finally{D(!1)}};m.useEffect(()=>{const ce=window.matchMedia("(min-width: 1280px)"),ae=()=>p(ce.matches);return ae(),ce.addEventListener("change",ae),()=>ce.removeEventListener("change",ae)},[]),m.useEffect(()=>{var ae;if(!r||h)return;z.current=document.activeElement,(ae=j.current)==null||ae.focus();const ce=ve=>{if(ve.key==="Escape"){ve.preventDefault(),q.current();return}if(ve.key!=="Tab"||!B.current)return;const xe=Array.from(B.current.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'));if(xe.length===0)return;const ge=xe[0],le=xe[xe.length-1];ve.shiftKey&&document.activeElement===ge?(ve.preventDefault(),le.focus()):!ve.shiftKey&&document.activeElement===le&&(ve.preventDefault(),ge.focus())};return document.addEventListener("keydown",ce),()=>{var ve;document.removeEventListener("keydown",ce),(ve=z.current)==null||ve.focus()}},[h,r]);const de=new Map((t.propertyValueOnContact||[]).map(ce=>[ce.propertyId,ce.value])),X=e.filter(ce=>ce.status!=="COMPLETED").length;return N.jsxs(N.Fragment,{children:[r&&!h&&N.jsx("button",{type:"button","aria-label":"Close contact details",onClick:s,className:"fixed inset-0 z-30 bg-black/40 xl:hidden"}),N.jsxs("aside",{ref:B,"aria-label":"Contact details","aria-hidden":!ne,"aria-modal":h?void 0:!0,role:h?void 0:"dialog",inert:!ne,tabIndex:-1,className:`fixed bottom-0 right-0 top-0 z-40 h-[100dvh] w-full max-w-[400px] flex-col border-l border-[#f3f4f6] bg-white transition-transform duration-200 ease-out motion-reduce:transition-none xl:relative xl:z-0 xl:flex xl:h-full xl:w-[320px] xl:max-w-none xl:flex-shrink-0 xl:translate-x-0 ${ne?"flex translate-x-0":"hidden translate-x-full"}`,children:[N.jsx("div",{className:"flex justify-end px-4 pt-4 xl:hidden",children:N.jsx("button",{ref:j,type:"button",onClick:s,className:"inline-flex size-9 items-center justify-center rounded-lg text-[#64748b] hover:bg-[#f3f4f6]","aria-label":"Close contact details",children:N.jsx(Ap,{size:18,"aria-hidden":"true"})})}),N.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto pb-6",children:[N.jsxs("div",{className:"flex flex-col gap-6 p-6",children:[N.jsxs("div",{className:"flex items-start justify-between gap-2",children:[N.jsxs("div",{className:"flex items-center gap-3",children:[N.jsxs("div",{className:"relative size-10 shrink-0",children:[N.jsx("div",{className:"flex size-full items-center justify-center rounded-full bg-[#161c3c] text-sm font-bold text-white",children:F6(t)}),N.jsx("span",{className:"absolute bottom-0.5 right-0.5 size-[7px] rounded-full border border-white bg-[#22c55e]"})]}),N.jsxs("div",{className:"min-w-0",children:[N.jsx("h2",{className:"truncate text-[20px] font-semibold leading-7 text-[#161c3c]",children:pd(t)}),N.jsxs("p",{className:"text-[11px] leading-[13px] text-[#9ca3af]",children:["Since"," ",t.createdAt?ms(t.createdAt).format("MMM D, YYYY"):"—"]})]})]}),N.jsxs("div",{className:"flex shrink-0 items-center gap-3 pt-1",children:[N.jsx("button",{type:"button","aria-label":"Favorite",title:"Favorite",children:N.jsx("img",{src:"/icons/panel/star.svg",alt:"",className:"size-4"})}),N.jsx("button",{type:"button","aria-label":"More",title:"More",children:N.jsx("img",{src:"/icons/panel/kebab.svg",alt:"",className:"size-4"})})]})]}),N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(Fm,{iconSrc:"/icons/panel/chat.svg",count:((V=t.SmsLog)==null?void 0:V.length)||0}),N.jsx(Fm,{iconSrc:"/icons/panel/phone.svg",count:((te=t.chatLog)==null?void 0:te.length)||0}),N.jsx(Fm,{iconSrc:"/icons/panel/mail.svg",count:((ie=t.EmailLog)==null?void 0:ie.length)||0})]}),N.jsxs("div",{className:"flex flex-col gap-3",children:[N.jsx(jm,{iconSrc:"/icons/panel/phone.svg",label:"Phone",value:t.phone||"",placeholder:"Not provided",type:"tel",onSave:f&&(ce=>f({phone:ce}))}),N.jsx(jm,{iconSrc:"/icons/panel/mail.svg",label:"Email",value:j6(t)||"",placeholder:"No email on file",type:"email",onSave:f&&(ce=>f({email:ce}))}),N.jsx(jm,{iconSrc:"/icons/panel/company.svg",label:"Company",value:t.companyName||"",placeholder:"Not provided",onSave:f&&(ce=>f({companyName:ce}))})]}),t.inboxStatus==="NEEDS_HUMAN"&&N.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl bg-[#161c3c] p-4 shadow-[0px_10px_25px_-5px_rgba(76,83,119,0.5)]",children:[N.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[1px] text-white",children:"Needs human"}),N.jsx("button",{type:"button",onClick:()=>void a(),className:"rounded-xl border border-white/20 bg-white/20 px-4 py-1.5 text-[10px] font-semibold text-white backdrop-blur hover:bg-white/30",children:"Mark handled"})]}),t.escalationReason&&N.jsx("p",{className:"text-[12px] leading-[18px] text-white",children:t.escalationReason})]})]}),N.jsxs("div",{className:"mt-3 flex flex-col gap-3 px-6",children:[N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsx("div",{children:t.isQualified?N.jsxs("div",{className:"flex h-12 items-center justify-between rounded-xl border border-[#7fafff] bg-[#eff5ff] px-3",children:[N.jsxs("span",{className:"flex items-center gap-2",children:[N.jsx("span",{className:"text-[12px] font-semibold uppercase tracking-[0.6px] text-[#164e63]",children:"Qualified"}),N.jsx("img",{src:"/icons/panel/check.svg",alt:"",className:"size-[18px]"})]}),N.jsx("button",{type:"button",onClick:()=>void o(),disabled:i,className:"rounded-md border border-[#e2e8f0] bg-white px-2.5 py-1 text-[10px] font-semibold uppercase text-[#9ca3af] hover:text-[#161c3c] disabled:opacity-60",children:i?"…":"Revoke"})]}):N.jsxs("div",{className:"flex h-12 items-center justify-between rounded-xl border border-[#cbd5e1] bg-[#f9fafb] px-3",children:[N.jsx("span",{className:"text-[12px] font-semibold uppercase tracking-[0.6px] text-[#64748b]",children:"Not qualified"}),N.jsx("button",{type:"button",onClick:()=>void o(),disabled:i,className:"rounded-md border border-[#e2e8f0] bg-white px-2.5 py-1 text-[10px] font-semibold uppercase text-[#161c3c] hover:bg-[#f3f4f6] disabled:opacity-60",children:i?"…":"Qualify"})]})}),N.jsxs("div",{children:[N.jsxs("button",{type:"button",onClick:()=>v(ce=>!ce),"aria-expanded":g,className:"flex h-12 w-full items-center justify-between rounded-xl border border-[#cbd5e1] bg-[#f9fafb] px-3",children:[N.jsxs("span",{className:"flex items-center gap-2",children:[N.jsx("span",{className:"text-[12px] font-semibold uppercase tracking-[0.6px] text-[#164e63]",children:"Pending tasks"}),X>0&&N.jsx("span",{className:"flex size-[18px] items-center justify-center rounded-full bg-[#fe6d9a] text-[10px] font-semibold text-white",children:X})]}),N.jsx(P6,{size:18,className:`text-[#64748b] transition-transform ${g?"rotate-90":""}`,"aria-hidden":"true"})]}),g&&N.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[e.length===0&&!b&&N.jsx("p",{className:"text-xs text-[#9ca3af]",children:"No follow-up tasks."}),e.map(ce=>{const ae=ce.status==="COMPLETED";return N.jsxs("div",{className:"flex items-start gap-2",children:[N.jsxs("button",{type:"button",onClick:()=>void l(ce),className:"flex min-w-0 flex-1 items-start gap-2 text-left",children:[N.jsx("span",{className:`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded border ${ae?"border-[#161c3c] bg-[#161c3c] text-white":"border-[#cbd5e1] bg-white"}`,children:ae&&N.jsx(WS,{size:11,"aria-hidden":"true"})}),N.jsxs("span",{className:"min-w-0",children:[N.jsx("span",{className:`block text-[13px] text-[#161c3c] ${ae?"line-through opacity-40":""}`,children:ce.content||"Untitled task"}),ce.toDoBefore&&N.jsxs("span",{className:"mt-0.5 block text-[11px] text-[#9ca3af]",children:["Due ",ms(ce.toDoBefore).format("MMM D, YYYY")]})]})]}),ce.id&&N.jsx("button",{type:"button",onClick:()=>void d(ce.id),className:"flex size-6 shrink-0 items-center justify-center rounded text-[#cbd5e1] hover:bg-[#f3f4f6] hover:text-[#64748b]","aria-label":"Delete task",children:N.jsx(L6,{size:13,"aria-hidden":"true"})})]},ce.id)}),b?N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsx("input",{type:"text",value:C,onChange:ce=>x(ce.target.value),placeholder:"What needs doing?",autoFocus:!0,className:"w-full rounded-lg border border-[#e2e8f0] bg-white px-3 py-2 text-sm text-[#161c3c] outline-none placeholder:text-[#9ca3af] focus:border-[#7fafff]"}),N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("input",{type:"date",value:R,onChange:ce=>O(ce.target.value),"aria-label":"Due date",className:"h-9 min-w-0 flex-1 rounded-lg border border-[#e2e8f0] bg-white px-2 text-xs text-[#161c3c] outline-none focus:border-[#7fafff]"}),N.jsx("button",{type:"button",onClick:Z,disabled:!C.trim()||T,className:"inline-flex h-9 shrink-0 items-center rounded-lg bg-[#161c3c] px-4 text-xs font-semibold text-white hover:bg-[#161c3c]/90 disabled:opacity-40",children:T?"Saving…":"Save"})]})]}):N.jsxs("button",{type:"button",onClick:()=>w(!0),className:"inline-flex items-center gap-1 self-start text-xs font-semibold text-[#7fafff]",children:[N.jsx(xP,{size:13,"aria-hidden":"true"})," Add task"]})]})]})]}),N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsx("h3",{className:"text-[10px] font-semibold uppercase tracking-[0.5px] text-[#9ca3af]",children:"Recent resources"}),N.jsx("div",{className:"flex items-center justify-center rounded-lg border border-dashed border-[#e2e8f0] px-4 py-5 text-[11px] text-[#9ca3af]",children:"No recent resources"})]}),n.length>0&&N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsx("h3",{className:"text-[10px] font-semibold uppercase tracking-[0.5px] text-[#9ca3af]",children:"Properties"}),N.jsx("img",{src:"/icons/panel/props-edit.svg",alt:"",className:"size-3.5"})]}),N.jsx("div",{className:"flex flex-col gap-1",children:n.map((ce,ae)=>{const ve=ce.id&&de.get(ce.id)||"",xe=_===ce.id,ge=ae===0;return N.jsxs("div",{className:`flex items-center justify-between gap-3 ${ge?"rounded-lg border border-[#e2e8f0] bg-[#f8fafc] p-2.5":"p-2"}`,children:[N.jsx("span",{className:`shrink-0 text-[11px] font-semibold ${ge?"text-[#64748b]":"text-[#9ca3af]"}`,children:ce.property||"Property"}),xe?N.jsxs("div",{className:"flex items-center gap-1",children:[N.jsx("input",{type:UP(ce.propertyType),value:$,autoF
237ocus:!0,onChange:le=>E(le.target.value),onKeyDown:le=>{le.key==="Enter"?(le.preventDefault(),J(ce.id)):le.key==="Escape"&&A(void 0)},className:"h-7 w-32 min-w-0 rounded border border-[#e2e8f0] bg-white px-2 text-[11px] text-[#161c3c] outline-none focus:border-[#7fafff]"}),N.jsx("button",{type:"button",onClick:()=>void J(ce.id),disabled:I,className:"flex size-7 shrink-0 items-center justify-center rounded bg-[#161c3c] text-white hover:bg-[#161c3c]/90 disabled:opacity-50","aria-label":"Save property",children:N.jsx(WS,{size:13,"aria-hidden":"true"})})]}):N.jsx("button",{type:"button",onClick:()=>{A(ce.id),E(ve)},className:ge?`truncate rounded border border-[#e2e8f0] bg-white px-2 py-0.5 text-right text-[11px] font-semibold ${ve?"text-[#0f172a]":"text-[#9ca3af]"}`:`truncate border-b-2 border-transparent px-1 pb-0.5 text-right text-[11px] font-semibold hover:border-[#e2e8f0] ${ve?"text-[#161c3c]":"text-[#9ca3af]"}`,title:"Edit value",children:ve||"Set value"})]},ce.id)})})]})]})]})]})]})}const WP=[{key:"ALL",label:"All"},{key:"NEEDS_HUMAN",label:"Needs human"},{key:"QUALIFIED",label:"Qualified"}];function Bm(){return N.jsxs("div",{className:"flex gap-3 rounded-xl border-l-4 border-transparent py-2 pl-3 pr-2 animate-pulse",children:[N.jsx("div",{className:"size-11 shrink-0 rounded-full bg-[#f3f4f6]"}),N.jsxs("div",{className:"flex-1 space-y-2 py-1",children:[N.jsx("div",{className:"h-3 w-2/5 rounded bg-[#f3f4f6]"}),N.jsx("div",{className:"h-3 w-4/5 rounded bg-[#f3f4f6]"}
237),N.jsx("div",{className:"h-4 w-1/2 rounded bg-[#f3f4f6]"})]})]})}function GP({threads:t,selectedId:e,loading:n,filter:r,needsHumanCount:i,search:s,refreshing:o,onSearchChange:a,onRefresh:l,onFilterChange:c,onSelect:d,hasMore:u=!1,loadingMore:f=!1,onLoadMore:h}){const p=m$(),g=m.useRef(null),v=m.useRef(null);m.useEffect(()=>{const w=g.current,C=v.current;if(!w||!C||!u||f||!h)return;const x=new IntersectionObserver(R=>{var O;(O=R[0])!=null&&O.isIntersecting&&h()},{root:w,rootMargin:"200px"});return x.observe(C),()=>x.disconnect()},[u,f,h,t.length]);const b=r==="NEEDS_HUMAN"?`${i} ${i===1?"contact needs":"contacts need"} attention`:r==="QUALIFIED"?"Qualified contacts":"All conversations";return N.jsxs("section",{"aria-label":"Inbox conversations",className:"flex h-full min-h-0 w-full flex-col bg-white",children:[N.jsxs("header",{className:"flex flex-col gap-2 px-8 py-6",children:[N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("img",{src:"/icons/inbox/header.svg",alt:"",className:"size-6"}),N.jsx("h1",{className:"text-[20px] font-semibold leading-7 text-[#161c3c]",children:"Inbox"})]}),N.jsx("button",{type:"button",onClick:l,disabled:o,className:"cursor-pointer disabled:cursor-wait disabled:opacity-50","aria-label":"Refresh Inbox",children:N.jsx("img",{src:"/icons/inbox/refresh.svg",alt:"",className:`size-6 ${o?"animate-spin motion-reduce:animate-none":""}`})})]}),N.jsx("p",{className:"text-xs text-[#9ca3af]",children:b})]}),N.jsx("div",{role:"tablist","aria-label":"Filter conversations",className:"flex border-b border-[#f3f4f6]",children:WP.map(w=>{const C=r===w.key;return N.jsxs("button",{type:"button",role:"tab","aria-selected":C,onClick:()=>c(w.key),className:`flex min-w-0 flex-1 items-center justify-center gap-1 whitespace-nowrap pb-2.5 text-[10px] font-semibold uppercase tracking-[0.5px] transition-colors ${C?"border-b-2 border-[#161c3c] text-[#161c3c]":"border-b-2 border-transparent text-[#9ca3af] hover:text-[#64748b]"}`,children:[N.jsx("span",{className:"truncate",children:w.label}),w.key==="NEEDS_HUMAN"&&i>0&&N.jsx("span",{className:"flex h-[14px] shrink-0 items-center rounded bg-[#161c3c] px-1 text-[10px] font-semibold leading-none text-white",children:i})]},w.key)})}),N.jsx("div",{className:"px-4 pt-4",children:N.jsxs("div",{className:"relative",children:[N.jsx("img",{src:"/icons/topbar/search.svg",alt:"",className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2"}),N.jsx("input",{type:"search",value:s,onChange:w=>a(w.target.value),placeholder:"Search contacts",className:"w-full rounded-xl bg-[#f9fafb] py-2.5 pl-9 pr-9 text-sm text-[#161c3c] outline-none placeholder:text-[#6b7280] focus:ring-2 focus:ring-[#161c3c]/10"}),s&&N.jsx("button",{type:"button",onClick:()=>a(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-[#9ca3af] hover:text-[#161c3c]","aria-label":"Clear search",children:N.jsx(Ap,{size:16,"aria-hidden":"true"})})]})}),N.jsxs("div",{ref:g,className:"mt-4 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-4",children:[n?N.jsxs(N.Fragment,{children:[N.jsx(Bm,{}),N.jsx(Bm,{}),N.jsx(Bm,{})]}):t.length===0?N.jsxs("div",{className:"flex h-full min-h-72 flex-col items-center justify-center px-4 text-center",children:[N.jsx("div",{className:"mb-4 flex size-14 items-center justify-center rounded-xl bg-[#f3f4f6] text-[#64748b]",children:N.jsx(NP,{size:24,"aria-hidden":"true"})}),N.jsx("h2",{className:"text-base font-semibold text-[#161c3c]",children:s?"No matching conversations":r==="NEEDS_HUMAN"?"No escalations waiting":"Nothing here yet"}),N.jsx("p",{className:"mt-2 max-w-64 text-sm leading-6 text-[#9ca3af]",children:s?"Try a different name, email address, or phone number.":r==="NEEDS_HUMAN"?"AI is handling current activity. Switch to All to review the full queue.":"Conversations will appear here as contacts reach out."}),!s&&r==="NEEDS_HUMAN"&&N.jsx("button",{type:"button",onClick:()=>c("ALL"),className:"mt-5 rounded-xl bg-[#161c3c] px-4 py-2 text-sm font-medium text-white hover:bg-[#161c3c]/90",children:"Show all conversations"})]}):t.map(w=>
237{const C=w.contact.id||"",x=C===e;return N.jsxs("button",{type:"button",onClick:()=>d(C),"aria-current":x?"true":void 0,className:`flex w-full gap-3 rounded-xl border-l-4 py-2 pl-3 pr-2 text-left transition-colors ${x?"border-[#e5e7eb] bg-[#eff5ff]":"border-transparent hover:bg-[#f9fafb]"}`,children:[N.jsx("span",{className:`flex size-11 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${x?"bg-[#161c3c] text-white":"bg-[#e5e7eb] text-[#161c3c]"}`,children:F6(w.contact)}),N.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[N.jsxs("span",{className:"flex flex-col",children:[N.jsxs("span",{className:"flex items-start justify-between gap-2",children:[N.jsx("span",{className:"truncate text-sm font-semibold text-[#161c3c]",children:pd(w.contact)}),N.jsx("span",{className:"shrink-0 text-[10px] leading-[14px] text-[#9ca3af]",children:FP(w.latestAt)})]}),N.jsx("span",{className:"truncate text-xs leading-4 text-[#9ca3af]",children:w.latestPreview})]}),N.jsxs("span",{className:"flex items-center gap-1",children:[w.needsHuman&&N.jsx("span",{className:"rounded bg-[#161c3c] px-2 py-1 text-[10px] font-medium leading-none text-white",children:w.hasLiveEscalation?"Live escalation":"Human required"}),w.contact.isQualified&&N.jsx("span",{className:"rounded bg-[#f3f4f6] px-2 py-1 text-[10px] font-medium leading-none text-[#6b7280]",children:"Qualified"})]})]})]},C)}),!n&&t.length>0&&u&&N.jsx("div",{ref:v,className:"py-4 text-center text-xs text-[#9ca3af]",children:"Loading more conversations…"})]}),N.jsxs("div",{className:"border-t border-[#f3f4f6] p-6",children:[N.jsx("p",{className:"text-[11px] leading-[13px] text-[#9ca3af]",children:"Quick action"}),N.jsxs("div",{className:"mt-1 flex items-center justify-between gap-4",children:[N.jsx("span",{className:"text-base font-semibold text-[#161c3c]",children:"Add a new contact"}),N.jsxs("button",{type:"button",onClick:()=>p({to:"/app/contacts"}),className:"flex shrink-0 items-center gap-1.5 rounded-xl border border-[#8a90a4] bg-white px-4 py-1.5 text-sm font-semibold text-[#161c3c] hover:bg-[#f9fafb]",children:[N.jsx("img",{src:"/icons/inbox/plus.svg",alt:"",className:"size-3.5"}),"Add"]})]})]})]})}function KP(t){return N.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center text-black",children:[N.jsx("div",{className:"mb-4",children:N.jsx(t.icon,{size:40,className:t.loading?"animate-spin":""})}),N.jsx("div",{className:"font-semibold text-xl mb-2",children:t.title}),N.jsx("div",{className:"text-black/40",children:t.subtitle})]})}function wr(t){this.content=t}wr.prototype={constructor:wr,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new wr(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new wr(n)},addToStart:function(t,e){return new wr([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new wr(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new wr(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=wr.from(t),t.size?new wr(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=wr.from(t),t.size?new wr(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=wr.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};wr.from=function(t){if(t instanceof wr)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new wr(e)};function U6(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)n++;
vendor: 4,432 bytes, line 237
237return l&&l<o.length&&l<a.length&&G6(o.charCodeAt(l-1))&&W6(o.charCodeAt(l))&&n--,n}if(i.content.size||s.content.size){let o=U6(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function V6(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let c=o.text,d=a.text,u=c.length,f=d.length;for(;u>0&&f>0&&c[u-1]==d[f-1];)u--,f--,n--,r--;return u&&f&&u<c.length&&G6(c.charCodeAt(u-1))&&W6(c.charCodeAt(u))&&(n++,r++),{a:n,b:r}}if(o.content.size||a.content.size){let c=V6(o.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}function W6(t){return t>=56320&&t<57344}function G6(t){return t>=55296&&t<56320}class Be{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new Be(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new Be(r,i)}cutByIndex(e,n){return e==n?Be.empty:e==0&&n==this.content.length?this:new Be(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Be(i,s)}addToStart(e){return new Be([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Be(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return U6(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return V6(this,e,n,r)}findIndex(e){if(e==0)return Uu(0,e);if(e==this.size)return Uu(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?Uu(n+1,s):Uu(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Be.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return Be.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Be.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new Be(n||e,r)}static from(e){if(!e)return Be.empty;if(e instanceof Be)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Be([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Be.empty=new Be([],0);const Hm={index:0,offset:0};function Uu(t,e){return Hm.index=t,Hm.offset=e,Hm}function sh(t,e){if(t===e)return!0;
vendor: 1,566 bytes, line 237
237if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!sh(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!sh(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let pn=class N1{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&sh(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return N1.none;if(e instanceof N1)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};pn.none=[];
vendor: 6,659 bytes, line 237
237class md extends Error{}class lt{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=X6(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new lt(r,this.openStart,this.openEnd)}removeBetween(e,n){return new lt(K6(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return lt.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new lt(Be.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new lt(e,r,i)}}lt.empty=new lt(Be.empty,0,0);function K6(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(K6(s.content,e-i-1,n-i-1)))}function X6(t,e,n,r,i,s){let{index:o,offset:a}=t.findIndex(e),l=t.maybeChild(o);if(a==e||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=X6(l.content,e-a-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,l);return c&&t.replaceChild(o,l.copy(c))}function XP(t,e,n){if(n.openStart>t.depth)throw new md("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new md("Inconsistent open depths");return Y6(t,e,n,0)}function Y6(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=Y6(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return Ea(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=YP(n,t);return Ea(s,Q6(t,o,a,e,r))}else return Ea(s,oh(t,e,r))}function J6(t,e){if(!e.type.compatibleContent(t.type))throw new md("Cannot join "+e.type.name+" onto "+t.type.name)}function _1(t,e,n){let r=t.node(n);return J6(r,e.node(n)),r}function $a(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Wc(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&($a(t.nodeAfter,r),s++));for(let a=s;a<o;a++)$a(i.child(a),r);e&&e.depth==n&&e.textOffset&&$a(e.nodeBefore,r)}function Ea(t,e){if(!t.type.validContent(e))throw new md("Invalid content for node "+t.type.name);return t.copy(e)}function Q6(t,e,n,r,i){let s=t.depth>i&&_1(t,e,i+1),o=r.depth>i&&_1(n,r,i+1),a=[];return Wc(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(J6(s,o),$a(Ea(s,Q6(t,e,n,r,i+1)),a)):(s&&$a(Ea(s,oh(t,e,i+1)),a),Wc(e,n,i,a),o&&$a(Ea(o,oh(n,r,i+1)),a)),Wc(r,null,i,a),new Be(a)}function oh(t,e,n){let r=[];if(Wc(null,t,n,r),t.depth>n){let i=_1(t,e,n+1);$a(Ea(i,oh(t,e,n+1)),r)}return Wc(e,null,n,r),new Be(r)}function YP(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(Be.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class gd{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return pn.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ah(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new gd(n,r,s)}
vendor: 4,385 bytes, line 237
237static resolveCached(e,n){let r=KS.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else KS.set(e,r=new JP);let i=r.elts[r.i]=gd.resolve(e,n);return r.i=(r.i+1)%QP,i}}class JP{constructor(){this.elts=[],this.i=0}}const QP=12,KS=new WeakMap;class ah{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ZP=Object.create(null);let Oo=class P1{constructor(e,n,r,i=pn.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||Be.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&sh(this.attrs,n||e.defaultAttrs||ZP)&&pn.sameSet(this.marks,r||pn.none)}copy(e=null){return e==this.content?this:new P1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new P1(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return lt.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new lt(c,i.depth-o,s.depth-o)}replace(e,n,r){return XP(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return gd.resolveCached(this,e)}resolveNoCache(e){return gd.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Z6(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Be.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=pn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!pn.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}
237`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=Be.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Oo.prototype.text=void 0;class lh extends Oo{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Z6(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new lh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new lh(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Z6(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class _a{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new eM(e,n);if(r.next==null)return _a.empty;let i=e9(r);r.next&&r.err("Unexpected trailing text");let s=aM(oM(i));return lM(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return Be.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:d,next:u}=o.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let f=s(u,a.concat(d));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
238`)}}_a.empty=new _a(!0);class eM{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function e9(t){let e=[];do e.push(tM(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function tM(t){let e=[];do e.push(nM(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function nM(t){let e=sM(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=rM(t,e);else break;return e}function XS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");
vendor: 2,433 bytes, line 238
238let e=Number(t.next);return t.pos++,e}function rM(t,e){let n=XS(t),r=n;return t.eat(",")&&(t.next!="}"?r=XS(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function iM(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function sM(t){if(t.eat("(")){let e=e9(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=iM(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function oM(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let d=n();i(s(o.expr,l),d),l=d}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let d=n();r(l,d),i(s(o.expr,l),d),l=d}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function t9(t,e){return e-t}function YS(t,e){let n=[];return r(e),n.sort(t9);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function aM(t){let e=Object.create(null);return n(YS(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<i.length;d++)i[d][0]==a&&(c=i[d][1]);YS(t,l).forEach(d=>{c||i.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let s=e[r.join(",")]=new _a(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(t9);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function lM(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];
vendor: 11,685 bytes, lines 238-239
238o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function n9(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function r9(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function i9(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}function s9(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new dM(t,r,e[r]);return n}let JS=class o9{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=s9(e,r.attrs),this.defaultAttrs=n9(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==_a.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:r9(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Oo(this,this.computeAttrs(e),Be.from(n),pn.setFrom(r))}createChecked(e=null,n,r){return n=Be.from(n),this.checkContent(n),new Oo(this,this.computeAttrs(e),n,pn.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=Be.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(Be.empty,!0);return s?new Oo(this,e,n.append(s),pn.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){i9(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:pn.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new o9(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function cM(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class dM{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?cM(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Op{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=s9(e,i.attrs),this.excluded=null;let s=n9(this.attrs);this.instance=s?new pn(this,s):null}create(e=null){return!e&&this.instance?this.instance:new pn(this,r9(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Op(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){i9(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let a9=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=wr.from(e.nodes),n.marks=wr.from(e.marks||{}),this.nodes=JS.compile(this.spec.nodes,this),this.marks=Op.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=_a.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?QS(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:QS(this,o.split(" "))}this.nodeFromJSON=i=>Oo.fromJSON(this,i),this.markFromJSON=i=>pn.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof JS){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new lh(r,r.defaultAttrs,e,pn.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function QS(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function uM(t){return t.tag!=null}function fM(t){return t.style!=null}let Gc=class M1{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(uM(i))this.tags.push(i);else if(fM(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new eC(this,n,!1);return r.addAll(e,pn.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new eC(this,n,!0);return r.addAll(e,pn.none,n.from,n.to),lt.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(mM(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=tC(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=tC(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new M1(e,M1.schemaRules(e)))}};const l9={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},hM={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},c9={ol:!0,ul:!0},vd=1,D1=2,Kc=4;function ZS(t,e,n){return e!=null?(e?vd:0)|(e==="full"?D1:0):t&&t.whitespace=="pre"?vd|D1:n&~Kc}class Vu{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=pn.none,this.match=s||(o&Kc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Be.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&vd)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=Be.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Be.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!l9.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class eC{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=ZS(null,n.preserveWhitespace,0)|(r?Kc:0);i?s=new Vu(i.type,i.attrs,pn.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new Vu(null,null,pn.none,!0,null,o):s=new Vu(e.schema.topNodeType,null,pn.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&D1?"full":this.localPreserveWS||(i.options&vd)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
239`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;c9.hasOwnProperty(o)&&this.parser.normalizeLists&&pM(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:hM.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;
vendor: 4,817 bytes, lines 239-240
239if(l9.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let u=l&&l.skip?n:this.readStyles(e,n);u&&this.addAll(e,u),c&&this.sync(s),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
240`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=pn.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):nC(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=ZS(e,s,o.options);o.options&Kc&&o.content.length==0&&(a|=Kc);let l=pn.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):nC(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Vu(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=vd)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let d=l>
vendor: 4,666 bytes, line 240
2400||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function pM(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&c9.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function mM(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function tC(t){let e={};for(let n in t)e[n]=t[n];return e}function nC(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||s.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class La{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Wu(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],d=this.serializeMark(c,o.isInline,n);d&&(s.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return Wu(n).createTextNode(e.text);let{dom:r,contentDOM:i}=If(Wu(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&If(Wu(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:If(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new La(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=rC(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return rC(e.marks)}}function rC(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Wu(t){return t.document||window.document}const iC=new WeakMap;function gM(t){let e=iC.get(t);return e===void 0&&iC.set(t,e=vM(t)),e}function vM(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function If(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=gM(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let f=u.indexOf(" ");f>0?l.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):u=="style"&&l.style?l.style.cssText=c[u]:l.setAttribute(u,c[u])}}for(let u=d;u<e.length;u++){let f=e[u];if(f===0){if(u<e.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(t.createTextNode(f));else{let{dom:h,contentDOM:p}=If(t,f,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const d9=65535,u9=Math.pow(2,16);function bM(t,e){return t+e*u9}function sC(t){return t&d9}function yM(t){return(t-(t&d9))/u9}const f9=1,h9=2,Af=4,p9=8;class L1{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&p9)>0}get deletedBefore(){return(this.delInfo&(f9|Af))>0}get deletedAfter(){return(this.delInfo&(h9|Af))>0}get deletedAcross(){return(this.delInfo&Af)>0}}class ci{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ci.empty)return ci.empty}recover(e){let n=0,r=sC(e);if(!this.inverted)for(let i=0;i<r;
vendor: 3,658 bytes, line 240
240i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+yM(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],d=this.ranges[a+o],u=l+c;if(e<=u){let f=c?e==l?-1:e==u?1:n:n,h=l+i+(f<0?0:d);if(r)return h;let p=e==(n<0?l:u)?null:bM(a/3,e-l),g=e==l?h9:e==u?f9:Af;return(n<0?e!=l:e!=u)&&(g|=p9),new L1(h,g,p)}i+=d-c}return r?e+i:new L1(e+i,0,null)}touches(e,n){let r=0,i=sC(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],d=l+c;if(e<=d&&a==i*3)return!0;r+=this.ranges[a+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+n],d=this.ranges[i+r];e(a,a+c,l,l+d),s+=d-c}}invert(){return new ci(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ci.empty:new ci(e<0?[0,-e,0]:[0,0,e])}}ci.empty=new ci([]);class bd{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new bd(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new bd;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new L1(e,i,null)}}const zm=Object.create(null);class Pr{getMap(){return ci.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=zm[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in zm)throw new RangeError("Duplicate use of step JSON ID "+e);return zm[e]=n,n.prototype.jsonID=e,n}}class Zn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Zn(e,null)}static fail(e){return new Zn(null,e)}static fromReplace(e,n,r,i){try{return Zn.ok(e.replace(n,r,i))}catch(s){if(s instanceof md)return Zn.fail(s.message);throw s}}}function Zb(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Zb(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return Be.fromArray(r)}class Co extends Pr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.no
vendor: 7,186 bytes, line 240
240de(r.sharedDepth(this.to)),s=new lt(Zb(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Zn.fromReplace(e,this.from,this.to,s)}invert(){return new Ui(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Co(n.pos,r.pos,this.mark)}merge(e){return e instanceof Co&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Co(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Co(n.from,n.to,e.markFromJSON(n.mark))}}Pr.jsonID("addMark",Co);class Ui extends Pr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new lt(Zb(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Zn.fromReplace(e,this.from,this.to,r)}invert(){return new Co(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ui(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ui&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ui(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ui(n.from,n.to,e.markFromJSON(n.mark))}}Pr.jsonID("removeMark",Ui);class xo extends Pr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Zn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Zn.fromReplace(e,this.pos,this.pos+1,new lt(Be.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new xo(this.pos,n.marks[i]);return new xo(this.pos,this.mark)}}return new Pa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new xo(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new xo(n.pos,e.markFromJSON(n.mark))}}Pr.jsonID("addNodeMark",xo);class Pa extends Pr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Zn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Zn.fromReplace(e,this.pos,this.pos+1,new lt(Be.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new xo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Pa(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Pa(n.pos,e.markFromJSON(n.mark))}}Pr.jsonID("removeNodeMark",Pa);class Yn extends Pr{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&j1(e,this.from,this.to)?Zn.fail("Structure replace would overwrite content"):Zn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ci([this.from,this.to-this.from,this.slice.size])}invert(e){return new Yn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&Yn.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Yn(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Yn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?lt.empty:new lt(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Yn(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?lt.empty:new lt(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Yn(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Yn(n.from,n.to,lt.fromJSON(e,n.slice),!!n.structure)}}Yn.MAP_BIAS=1;Pr.jsonID("replace",Yn);class fr extends Pr{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(j1(e,this.from,this.gapFrom)||j1(e,this.gapTo,this.to)))return Zn.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Zn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Zn.fromReplace(e,this.from,this.to,r):Zn.fail("Content does not fit in gap")}getMap(){return new ci([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new fr(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new fr(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new fr(n.from,n.to,n.gapFrom,n.gapTo,lt.fromJSON(e,n.slice),n.insert,!!n.structure)}}Pr.jsonID("replaceAround",fr);function j1(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function wM(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,c,d)=>
vendor: 15,297 bytes, lines 240-241
240{if(!l.isInline)return;let u=l.marks;if(!r.isInSet(u)&&d.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,n),p=r.addToSet(u);for(let g=0;g<u.length;g++)u[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(u[g])?o.to=h:i.push(o=new Ui(f,h,u[g])));a&&a.to==f?a.to=h:s.push(a=new Co(f,h,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function SM(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof Op){let c=o.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,n);for(let d=0;d<l.length;d++){let u=l[d],f;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&u.eq(i[h].style)&&(f=p)}f?(f.to=c,f.step=s):i.push({style:u,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>t.step(new Ui(o.from,o.to,o.style)))}function ey(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),d=a+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Yn(a,d,lt.empty));else{r=u;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new Ui(a,d,c.marks[f]));if(i&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new lt(Be.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new Yn(a+f.index,a+f.index+f[0].length,p))}}a=d}if(!r.validEnd){let l=r.fillBefore(Be.empty,!0);t.replace(a,a,new lt(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function CM(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ic(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+i,l=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(a,l,n))return r;if(r==0||o.type.spec.isolating||!CM(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function xM(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,c=a,d=Be.empty,u=0;for(let p=s,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,d=Be.from(r.node(p).copy(d)),u++):l--;let f=Be.empty,h=0;for(let p=s,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,f=Be.from(i.node(p).copy(f)),h++):c++;t.step(new fr(l,c,o,a,new lt(d.append(f),u,h),d.size-u,!0))}function ty(t,e,n=null,r=t){let i=$M(t,e),s=i&&EM(r,e);return s?i.map(oC).concat({type:e,attrs:n}).concat(s.map(oC)):null}function oC(t){return{type:t,attrs:null}}function $M(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function EM(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:o}function TM(t,e,n){let r=Be.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Be.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new fr(i,s,i,s,new lt(r,0,0),n.length,!0))}function RM(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&IM(t.doc,t.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&g9(t,o,a,s),ey(t,t.mapping.slice(s).map(a,1),r,void 0,c===null);let d=t.mapping.slice(s),u=d.map(a,1),f=d.map(a+o.nodeSize,1);return t.step(new fr(u,f,u+1,f-1,new lt(Be.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&m9(t,o,a,s),!1}})}function m9(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function g9(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
241`))}})}function IM(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function AM(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new fr(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new lt(Be.from(o),0,0),1,!0))}function Us(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=n-2;c>s;c--,d--){let u=i.node(c),f=i.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(f,u.childCount),p=r&&r[d+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[d]||u;if(!u.canReplace(f+1,u.childCount)||!g.type.validContent(h))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function OM(t,e,n=1,r){let i=t.doc.resolve(e),s=Be.empty,o=Be.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){s=Be.from(i.node(a).copy(s));let d=r&&r[c];o=Be.from(d?d.type.create(d.attrs,o):i.node(a).copy(o))}t.step(new Yn(e,e,new lt(s.append(o),n,n),!0))}function Uo(t,e){let n=t.resolve(e),r=n.index();return v9(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function kM(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function v9(t,e){return!!(t&&e&&!t.isLeaf&&kM(t,e))}function kp(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&v9(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function NM(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let d=o.whitespace=="pre",u=!!o.contentMatch.matchType(i);d&&!u?r=!1:!d&&u&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);g9(t,d.node(),d.before(),a)}o.inlineContent&&ey(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Yn(c,l.map(e+n,-1),lt.empty,!0)),r===!0){let d=t.doc.resolve(c);m9(t,d.node(),d.before(),t.steps.length)}return t}function _M(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function b9(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),c=r.node(o),d=!1;if(s==1)d=c.canReplace(l,l,i);else{let u=c.contentMatchAt(l).findWrapping(i.firstChild.type);d=u&&c.canReplaceWith(l,l,u[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function Np(t,e,n=e,r=lt.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return y9(i,s,r)?new Yn(e,n,r):new PM(i,s,r).fit()}function y9(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class PM{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Be.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Be.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new lt(s,o,a);return e>-1?new fr(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Yn(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=qm(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,u=null;if(n==1&&(o?c.matchType(o.type)||(u=c.fillBefore(Be.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:u};if(n==2&&o&&(d=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:d};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=qm(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new lt(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=qm(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new lt(Pc(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new lt(Pc(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,c=0,d=[],{match:u,type:f}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)d.push(i.child(g));u=u.matchFragment(i)}let h=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let g=a.child(c),v=u.matchType(g.type);if(!v)break;c++,(c>1||l==0||g.content.size)&&(u=v,d.push(w9(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=Mc(this.placed,n,Be.from(d)),this.frontier[n].match=u,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=a;g<h;g++){let b=v.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),v=b.content}this.unplaced=p?e==0?lt.empty:new lt(Pc(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new lt(Pc(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Um(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=Um(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=Um(e,a,c,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Mc(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Mc(this.placed,this.depth,Be.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Be.empty,!0);n.childCount&&(this.placed=Mc(this.placed,this.frontier.length,n))}}function Pc(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Pc(t.firstChild.content,e-1,n)))}function Mc(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Mc(t.lastChild.content,e-1,n)))}function qm(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function w9(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,w9(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Be.empty,!0)))),t.copy(r)}function Um(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!MM(n,s.content,o)?a:null}function MM(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function DM(t){return t.spec.defining||t.spec.definingForContent}function LM(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(y9(i,s,r))return t.step(new Yn(e,n,r));let o=C9(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let f=i.depth,h=i.pos-1;f>0;f--,h--){let p=i.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(f)>-1?a=f:i.before(f)==h&&o.splice(1,0,-f)}let l=o.indexOf(a),c=[],d=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=d-1;f>=0;f--){let h=c[f],p=DM(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))d=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+d+1)%(r.openStart+1),p=c[h];if(p)for(let g=0;g<o.length;g++){let v=o[(g+l)%o.length],b=!0;v<0&&(b=!1,v=-v);let w=i.node(v-1),C=i.index(v-1);if(w.canReplaceWith(C,C,p.type,p.marks))return t.replace(i.before(v),b?s.after(v):n,new lt(S9(r.content,0,r.openStart,h),h,r.openEnd))}}let u=t.steps.length;for(let f=o.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>u));f--){let h=o[f];h<0||(e=i.before(h),n=s.after(h))}}function S9(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(S9(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(Be.empty,!0))}return t}function jM(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=_M(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new lt(Be.from(r),0,0))}function FM(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let o=r.sharedDepth(n),a=!1;for(let l=r.depth;l>o;
vendor: 13,389 bytes, line 241
241l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>o;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=t.doc.resolve(e),i=t.doc.resolve(n)}}let s=C9(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function C9(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class Ol extends Pr{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Zn.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Zn.fromReplace(e,this.pos,this.pos+1,new lt(Be.from(i),0,n.isLeaf?0:1))}getMap(){return ci.empty}invert(e){return new Ol(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ol(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ol(n.pos,n.attr,n.value)}}Pr.jsonID("attr",Ol);class yd extends Pr{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Zn.ok(r)}getMap(){return ci.empty}invert(e){return new yd(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new yd(n.attr,n.value)}}Pr.jsonID("docAttr",yd);let jl=class extends Error{};jl=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};jl.prototype=Object.create(Error.prototype);jl.prototype.constructor=jl;jl.prototype.name="TransformError";class x9{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new bd}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new jl(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=lt.empty){let i=Np(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new lt(Be.from(r),0,0))}delete(e,n){return this.replace(e,n,lt.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return LM(this,e,n,r),this}replaceRangeWith(e,n,r){return jM(this,e,n,r),this}deleteRange(e,n){return FM(this,e,n),this}lift(e,n){return xM(this,e,n),this}join(e,n=1){return NM(this,e,n),this}wrap(e,n){return TM(this,e,n),this}setBlockType(e,n=e,r,i=null){return RM(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return AM(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Ol(e,n,r)),this}setDocAttribute(e,n){return this.step(new yd(e,n)),this}addNodeMark(e,n){return this.step(new xo(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof pn)n.isInSet(r.marks)&&this.step(new Pa(e,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new Pa(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return OM(this,e,n,r),this}addMark(e,n,r){return wM(this,e,n,r),this}removeMark(e,n,r){return SM(this,e,n,r),this}clearIncompatible(e,n,r){return ey(this,e,n,r),this}}const Vm=Object.create(null);class Dt{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new BM(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=lt.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:c}=o[a],d=e.mapping.slice(s);e.replaceRange(d.map(l.pos),d.map(c.pos),a?lt.empty:n),a==0&&cC(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),c=l.map(o.pos),d=l.map(a.pos);s?e.deleteRange(c,d):(e.replaceRangeWith(c,d,n),cC(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new xt(e):gl(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?gl(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):gl(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Xr(e.node(0))}static atStart(e){return gl(e,e,0,0,1)||new Xr(e)}static atEnd(e){return gl(e,e,e.content.size,e.childCount,-1)||new Xr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Vm[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Vm)throw new RangeError("Duplicate use of selection JSON ID "+e);return Vm[e]=n,n.prototype.jsonID=e,n}getBookmark(){return xt.between(this.$anchor,this.$head).getBookmark()}}Dt.prototype.visible=!0;class BM{constructor(e,n){this.$from=e,this.$to=n}}let aC=!1;function lC(t){!aC&&!t.parent.inlineContent&&(aC=!0)}class xt extends Dt{constructor(e,n=e){lC(e),lC(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Dt.near(r);let i=e.resolve(n.map(this.anchor));return new xt(i.parent.inlineContent?i:r,r)}replace(e,n=lt.empty){if(super.replace(e,n),n==lt.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof xt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new _p(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new xt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=Dt.findFrom(n,r,!0)||Dt.findFrom(n,-r,!0);if(s)n=s.$head;else return Dt.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(Dt.findFrom(e,-r,!0)||Dt.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new xt(e,n)}}Dt.jsonID("text",xt);class _p{constructor(e,n){this.anchor=e,this.head=n}map(e){return new _p(e.map(this.anchor),e.map(this.head))}resolve(e){return xt.between(e.resolve(this.anchor),e.resolve(this.head))}}class wt extends Dt{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?Dt.near(s):new wt(s)}content(){return new lt(Be.from(this.node),0,0)}eq(e){return e instanceof wt&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ny(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new wt(e.resolve(n.anchor))}static create(e,n){return new wt(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}wt.prototype.visible=!1;Dt.jsonID("node",wt);class ny{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new _p(r,r):new ny(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&wt.isSelectable(r)?new wt(n):Dt.near(n)}}class Xr extends Dt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=lt.empty){if(n==lt.empty){e.delete(0,e.doc.content.size);let r=Dt.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Xr(e)}map(e){return new Xr(e)}eq(e){return e instanceof Xr}getBookmark(){return HM}}Dt.jsonID("all",Xr);const HM={map(){return this},resolve(t){return new Xr(t)}};function gl(t,e,n,r,i,s=!1){if(e.inlineContent)return xt.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&wt.isSelectable(a))return wt.create(t,n-(i<0?a.nodeSize:0))}else{let l=gl(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function cC(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Yn||i instanceof fr))return;let s=t.mapping.maps[r],o;s.forEach((a,l,c,d)=>{o==null&&(o=d)}),t.setSelection(Dt.near(t.doc.resolve(o),n))}const dC=1,Gu=2,uC=4;class zM extends x9{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|dC)&~Gu,this.storedMarks=null,this}get selectionSet(){return(this.updated&dC)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Gu,this}ensureMarks(e){return pn.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Gu)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Gu,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||pn.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(Dt.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=uC,this}get scrolledIntoView(){return(this.updated&uC)>0}}function fC(t,e){return!e||!t?t:t.bind(e)}class Dc{constructor(e,n,r){this.name=e,this.init=fC(n.init,r),this.apply=fC(n.apply,r)}}const qM=[new Dc("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Dc("selection",{init(t,e){return t.selection||Dt.atStart(e.doc)},apply(t){return t.selection}}),new Dc("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Dc("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Wm{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=qM.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Dc(r.key,r.spec.state,r))})}}class ma{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}
vendor: 6,347 bytes, line 241
241apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,c=i?i[o].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let u=0;u<this.config.plugins.length;u++)i.push(u<o?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ma(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new zM(this)}static create(e){let n=new Wm(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ma(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Wm(this.schema,e.plugins),r=n.fields,i=new ma(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Wm(e.schema,e.plugins),s=new ma(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Oo.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=Dt.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=c.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function $9(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=$9(i,e,{})),n[r]=i}return n}class An{constructor(e){this.spec=e,this.props={},e.props&&$9(e.props,this,this.props),this.key=e.key?e.key.key:E9("plugin")}getState(e){return e[this.key]}}const Gm=Object.create(null);function E9(t){return t in Gm?t+"$"+ ++Gm[t]:(Gm[t]=0,t+"$")}class sr{constructor(e="key"){this.key=E9(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const T9=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function R9(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const I9=(t,e,n)=>{let r=R9(t,n);if(!r)return!1;let i=ry(r);if(!i){let o=r.blockRange(),a=o&&ic(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(j9(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Fl(s,"end")||wt.isSelectable(s)))for(let o=r.depth;;o--){let a=Np(t.doc,r.before(o),r.after(o),lt.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Fl(s,"end")?Dt.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):wt.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},UM=(t,e,n)=>{let r=R9(t,n);if(!r)return!1;let i=ry(r);return i?A9(t,i,e):!1},VM=(t,e,n)=>{let r=k9(t,n);if(!r)return!1;let i=iy(r);return i?A9(t,i,e):!1};function A9(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let c=Np(t.doc,s,l,lt.empty);if(!c||c.from!=s||c instanceof Yn&&c.slice.size>=l-s)return!1;if(n){let d=t.tr.step(c);d.setSelection(xt.create(d.doc,s)),n(d.scrollIntoView())}return!0}function Fl(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const O9=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=ry(r)}let o=s&&s.nodeBefore;return!o||!wt.isSelectable(o)?!1:(e&&e(t.tr.setSelection(wt.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function ry(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function k9(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const N9=(t,e,n)=>{let r=k9(t,n);if(!r)return!1;let i=iy(r);if(!i)return!1;let s=i.nodeAfter;if(j9(t,i,e,1))return!0;if(r.parent.content.size==0&&(Fl(s,"start")||wt.isSelectable(s))){let o=Np(t.doc,r.before(),r.after(),lt.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(Fl(s,"start")?Dt.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):wt.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},_9=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=iy(r)}let o=s&&s.nodeAfter;return!o||!wt.isSelectable(o)?!1:(e&&e(t.tr.setSelection(wt.create(t.doc,s.pos)).scrollIntoView()),!0)};function iy(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const WM=(t,e)=>
vendor: 5,654 bytes, lines 241-242
241{let n=t.selection,r=n instanceof wt,i;if(r){if(n.node.isTextblock||!Uo(t.doc,n.from))return!1;i=n.from}else if(i=kp(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(wt.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},GM=(t,e)=>{let n=t.selection,r;if(n instanceof wt){if(n.node.isTextblock||!Uo(t.doc,n.to))return!1;r=n.to}else if(r=kp(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},KM=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&ic(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},P9=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
242`).scrollIntoView()),!0)};function sy(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const M9=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=sy(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(Dt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},D9=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Xr||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=sy(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(xt.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},L9=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Us(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ic(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function XM(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof wt&&e.selection.node.isBlock)return!r.parentOffset||!Us(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){l=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),a=sy(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),s.unshift(l&&a?{type:a}:null),o=h;break}else{if(h==1)return!1;s.unshift(null)}let d=e.tr;(e.selection instanceof xt||e.selection instanceof Xr)&&d.deleteSelection();let u=d.mapping.map(r.pos),f=Us(d.doc,u,s.length,s);if(f||(s[0]=a?{type:a}:null,f=Us(d.doc,u,s.length,s)),!f)return!1;if(d.split(u,s.length,s),!l&&c&&r.node(o).type!=a){let h=d.mapping.map(r.before(o)),p=d.doc.resolve(h);a&&r.node(o-1).canReplaceWith(p.index(),p.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(o)),a)}return n&&n(d.scrollIntoView()),!0}}const YM=XM(),JM=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(wt.create(t.doc,i))),!0)},QM=(t,e)=>(e&&e(t.tr.setSelection(new Xr(t.doc))),!0);function ZM(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Uo(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function j9(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&ZM(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let h=e.pos+s.nodeSize,p=Be.empty;for(let b=o.length-1;b>=0;b--)p=Be.from(o[b].create(null,p));p=Be.from(i.copy(p));let g=t.tr.step(new fr(e.pos-1,h,e.pos,h,new lt(p,1,0),o.length,!0)),v=g.doc.resolve(h+2*o.length);v.nodeAfter&&v.nodeAfter.type==i.type&&Uo(g.doc,v.pos)&&g.join(v.pos),n(g.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&l?null:Dt.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),f=u&&ic(u);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(u,f).scrollIntoView()),!0;if(c&&Fl(s,"start",!0)&&Fl(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let g=s,v=1;for(;!g.isTextblock;g=g.firstChild)v++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let b=Be.empty;for(let C=p.length-1;C>=0;C--)b=Be.from(p[C].copy(b));let w=t.tr.step(new fr(e.pos-p.length,e.pos+s.nodeSize,e.pos+v,e.pos+s.nodeSize-v,new lt(b,p.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function F9(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(xt.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const B9=F9(-1),H9=F9(1);function eD(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&ty(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function hC(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=n.doc.resolve(c),u=d.index();i=d.parent.canReplaceWith(u,u+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function tD(t,e,n,r){for(let i=0;i<e.length;i++){let{$from:s,$to:o}=e[i],a=s.depth==0?t.inlineContent&&t.type.allowsMarkType(n):!1;
242if(t.nodesBetween(s.pos,o.pos,(l,c)=>{if(a)return!1;a=l.inlineContent&&l.type.allowsMarkType(n)}),a)return!0}return!1}function Hce(t,e=null,n){return function(r,i){let{empty:s,$cursor:o,ranges:a}=r.selection;if(s&&!o||!tD(r.doc,a,t))return!1;if(i)if(o)t.isInSet(r.storedMarks||o.marks())?i(r.tr.removeStoredMark(t)):i(r.tr.addStoredMark(t.create(e)));else{let l,c=r.tr;l=!a.some(d=>r.doc.rangeHasMark(d.$from.pos,d.$to.pos,t));for(let d=0;d<a.length;d++){let{$from:u,$to:f}=a[d];if(!l)c.removeMark(u.pos,f.pos,t);else{let h=u.pos,p=f.pos,g=u.nodeAfter,v=f.nodeBefore,b=g&&g.isText?/^\s*/.exec(g.text)[0].length:0,w=v&&v.isText?/\s*$/.exec(v.text)[0].length:0;h+b<p&&(h+=b,p-=w),c.addMark(h,p,t.create(e))}}i(c.scrollIntoView())}return!0}}function oy(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let Km=oy(T9,I9,O9),pC=oy(T9,N9,_9);const Fs={Enter:oy(P9,D9,L9,YM),"Mod-Enter":M9,Backspace:Km,"Mod-Backspace":Km,"Shift-Backspace":Km,Delete:pC,"Mod-Delete":pC,"Mod-a":QM},z9={"Ctrl-h":Fs.Backspace,"Alt-Backspace":Fs["Mod-Backspace"],"Ctrl-d":Fs.Delete,"Ctrl-Alt-Backspace":Fs["Mod-Delete"],"Alt-Delete":Fs["Mod-Delete"],"Alt-d":Fs["Mod-Delete"],"Ctrl-a":B9,"Ctrl-e":H9};for(let t in Fs)z9[t]=Fs[t];const nD=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,zce=nD?z9:Fs;function rD(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let a=r?n.tr:null;return iD(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function iD(t,e,n,r=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new ah(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new ah(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=ty(s,n,r,e);return a?(t&&sD(t,e,a,i,n),!0):!1}function sD(t,e,n,r,i){let s=Be.empty;for(let d=n.length-1;d>=0;d--)s=Be.from(n[d].type.create(n[d].attrs,s));t.step(new fr(e.start-(r?2:0),e.end,e.start,e.end,new lt(s,0,0),n.length,!0));let o=0;for(let d=0;d<n.length;d++)n[d].type==i&&(o=d+1);let a=n.length-o,l=e.start+n.length-(r?2:0),c=e.parent;for(let d=e.startIndex,u=e.endIndex,f=!0;d<u;d++,f=!1)!f&&Us(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return t}function oD(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?aD(e,n,t,s):lD(e,n,s):!0:!1}}function aD(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new fr(s-1,o,s,o,new lt(Be.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ah(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=ic(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return Uo(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function lD(t,e,n){let r=t.tr,i=n.parent;for(let h=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=s.node(-1),d=s.index(-1);if(!c.canReplace(d+(a?0:1),d+1,o.content.append(l?Be.empty:Be.from(i))))return!1;let u=s.pos,f=u+o.nodeSize;return r.step(new fr(u-(a?1:0),f+(l?1:0),u+1,f-1,new lt((a?Be.empty:Be.from(i.copy(Be.empty))).append(l?Be.empty:Be.from(i.copy(Be.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function cD(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,d=Be.from(c?t.create():null),u=new lt(Be.from(t.create(null,Be.from(a.type.create(null,d)))),c?3:1,0),f=s.start,h=s.end;n(e.tr.step(new fr(f-(c?3:1),h,f,h,u,1,!0)).scrollIntoView())}return!0}}const Sr=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Bl=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let F1=null;const Ls=function(t,e,n){let r=F1||(F1=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},dD=function(){F1=null},Ma=function(t,e,n,r){return n&&(mC(t,e,n,r,-1)||mC(t,e,n,r,1))},uD=/^(img|br|input|textarea|hr)$/i;function mC(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;
vendor: 6,641 bytes, line 242
242if(e==(i<0?0:Ti(t))){let o=t.parentNode;if(!o||o.nodeType!=1||su(t)||uD.test(t.nodeName)||t.contentEditable=="false")return!1;e=Sr(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?Ti(t):0}else return!1}}function Ti(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function fD(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ti(t)}else if(t.parentNode&&!su(t))e=Sr(t),t=t.parentNode;else return null}}function hD(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!su(t))e=Sr(t)+1,t=t.parentNode;else return null}}function pD(t,e,n){for(let r=e==0,i=e==Ti(t);r||i;){if(t==n)return!0;let s=Sr(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Ti(t)}}function su(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Pp=function(t){return t.focusNode&&Ma(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function fa(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function mD(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function gD(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Ti(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Ti(r.startContainer),r.startOffset)}}}const ws=typeof navigator<"u"?navigator:null,gC=typeof document<"u"?document:null,Vo=ws&&ws.userAgent||"",B1=/Edge\/(\d+)/.exec(Vo),q9=/MSIE \d/.exec(Vo),H1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vo),Yr=!!(q9||H1||B1),ko=q9?document.documentMode:H1?+H1[1]:B1?+B1[1]:0,Ii=!Yr&&/gecko\/(\d+)/i.test(Vo);Ii&&+(/Firefox\/(\d+)/.exec(Vo)||[0,0])[1];const z1=!Yr&&/Chrome\/(\d+)/.exec(Vo),xr=!!z1,U9=z1?+z1[1]:0,kr=!Yr&&!!ws&&/Apple Computer/.test(ws.vendor),Hl=kr&&(/Mobile\/\w+/.test(Vo)||!!ws&&ws.maxTouchPoints>2),$i=Hl||(ws?/Mac/.test(ws.platform):!1),V9=ws?/Win/.test(ws.platform):!1,zs=/Android \d/.test(Vo),ou=!!gC&&"webkitFontSmoothing"in gC.documentElement.style,vD=ou?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function bD(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Os(t,e){return typeof t=="number"?t:t[e]}function yD(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function vC(t,e,n){if(!q1(e)&&e.left==0)return;let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=Bl(o);continue}let a=o,l=a==s.body,c=l?bD(s):yD(a),d=0,u=0;if(e.top<c.top+Os(r,"top")?u=-(c.top-e.top+Os(i,"top")):e.bottom>c.bottom-Os(r,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+Os(i,"top")-c.top:e.bottom-c.bottom+Os(i,"bottom")),e.left<c.left+Os(r,"left")?d=-(c.left-e.left+Os(i,"left")):e.right>c.right-Os(r,"right")&&(d=e.right-c.right+Os(i,"right")),d||u)if(l)s.defaultView.scrollBy(d,u);else{let h=a.scrollLeft,p=a.scrollTop;u&&(a.scrollTop+=u),d&&(a.scrollLeft+=d);let g=a.scrollLeft-h,v=a.scrollTop-p;e={left:e.left-g,top:e.top-v,right:e.right-g,bottom:e.bottom-v}}let f=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:Bl(o)}}function wD(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:W9(t.dom)}}function W9(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Bl(r));return e}function SD({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;G9(n,r==0?0:r-e)}function G9(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let tl=null;function CD(t){if(t.setActive)return t.setActive();if(tl)return t.focus(tl);let e=W9(t);t.focus(tl==null?{get preventScroll(){return tl={preventScroll:!0},!0}}:void 0),tl||(tl=!1,G9(e,0))}function K9(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,c;for(let d=t.firstChild,u=0;d;d=d.nextSibling,u++){let f;if(d.nodeType==1)f=d.getClientRects();else if(d.nodeType==3)f=Ls(d).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=o&&p.bottom>=a){o=Math.max(p.bottom,o),a=Math.min(p.top,a);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=d,r=g,i=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,d.nodeType==1&&g&&(s=u+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=d,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=u+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?xD(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:K9(n,i)}function xD(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let o=fo(r,1);if(o.top!=o.bottom&&ay(e,o)){i={node:t,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function ay(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function $D(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function ED(t,e,n){let{node:r,offset:i}=K9(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function TD(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>
vendor: 4,373 bytes, line 242
242r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function X9(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(ay(e,c))return X9(o,e,c)}}if((s=(s+1)%r)==i)break}return t}function RD(t,e){let n=t.dom.ownerDocument,r,i=0,s=gD(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=t.dom.getBoundingClientRect();if(!ay(e,c)||(o=X9(t.dom,e,c),!o))return null}if(kr)for(let c=o;r&&c;c=Bl(c))c.draggable&&(r=void 0);if(o=$D(o,e),r){if(Ii&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],u;d.nodeName=="IMG"&&(u=d.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&i++}let c;ou&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=TD(t,r,i,e))}a==null&&(a=ED(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function q1(t){return t.top<t.bottom||t.left<t.right}function fo(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(q1(r))return r}return Array.prototype.find.call(n,q1)||t.getBoundingClientRect()}const ID=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Y9(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=ou||Ii;if(r.nodeType==3)if(o&&(ID.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=fo(Ls(r,i,i),n);if(Ii&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=fo(Ls(r,i-1,i-1),-1);if(c.top==l.top){let d=fo(Ls(r,i,i+1),-1);if(d.top!=l.top)return $c(d,d.left<c.left)}}return l}else{let l=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:c++,$c(fo(Ls(r,l,c),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Ti(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Xm(l.getBoundingClientRect(),!1)}if(s==null&&i<Ti(r)){let l=r.childNodes[i];if(l.nodeType==1)return Xm(l.getBoundingClientRect(),!0)}return Xm(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Ti(r))){let l=r.childNodes[i-1],c=l.nodeType==3?Ls(l,Ti(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return $c(fo(c,1),!1)}if(s==null&&i<Ti(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Ls(l,0,o?0:1):l.nodeType==1?l:null:null;if(c)return $c(fo(c,-1),!0)}return $c(fo(r.nodeType==3?Ls(r):r,-n),n>=0)}function $c(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Xm(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function J9(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function AD(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return J9(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=Y9(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Ls(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const OD=/[\u0590-\u08ac]/;function kD(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!OD.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:J9(t,e,()=>
vendor: 19,091 bytes, lines 242-243
242{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:u}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),v=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(d,u),l&&(l!=d||c!=u)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),v}):r.pos==r.start()||r.pos==r.end()}let bC=null,yC=null,wC=!1;function ND(t,e,n){return bC==e&&yC==n?wC:(bC=e,yC=n,wC=n=="up"||n=="down"?AD(t,e,n):kD(t,e,n))}const Ai=0,SC=1,ga=2,Vi=3;class au{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ai,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Sr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof Z9){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Q9&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Sr(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Sr(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],c=o+l.size;if(i==-1&&e<=c){let d=o+l.border;if(e>=d&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let u=a;u>0;u--){let f=this.children[u-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Sr(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let d=a+1;d<this.children.length;d++){let u=this.children[d];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){s=Sr(u.dom);break}n+=u.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let h=0,p=0;h<this.children.length;h++){let g=this.children[h],v=p+g.size;if(s>p&&o<v)return g.setSelection(e-p-g.border,n-p-g.border,r,i);p=v}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),u=!1;if((Ii||kr)&&e==n){let{node:h,offset:p}=a;if(h.nodeType==3){if(u=!!(p&&h.nodeValue[p-1]==`
243`),u&&p==h.nodeValue.length)for(let g=h,v;g;g=g.parentNode){if(v=g.nextSibling){v.nodeName=="BR"&&(a=l={node:v.parentNode,offset:Sr(v)+1});break}let b=g.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=h.childNodes[p-1];u=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Ii&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||u&&kr)&&Ma(a.node,a.offset,d.anchorNode,d.anchorOffset)&&Ma(l.node,l.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(u&&Ii)){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?ga:SC,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Vi:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?ga:Vi}r=o}this.dirty=ga}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?ga:SC;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Q9 extends au{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Ai&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class _D extends au{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class No extends au{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=La.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new No(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Vi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Vi&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Ai){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ai}}slice(e,n,r){let i=No.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=V1(s,n,o,r)),e>0&&(s=V1(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class _o extends au{constructor(e,n,r,i,s,o,a){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,c=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=La.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=n5(d,r,n),c?l=new PD(e,n,r,i,d,u||null,f,c):n.isText?new Mp(e,n,r,i,d,f):new _o(e,n,r,i,d,u||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let i=this.children[r];if(this.dom.contains(i.dom.parentNode)){n.contentElement=i.dom.parentNode;break}}if(!n.contentElement){let r=e&&e.find(i=>i.nodeType==1&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));r?n.contentElement=r:n.getContent=()=>Be.empty}}return n}matchesNode(e,n,r){return this.dirty==Ai&&e.eq(this.node)&&ch(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new DD(this,o&&o.node,e);FD(this.node,this.innerDeco,(c,d,u)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e,d):c.type.side>=0&&!u&&l.syncToMarks(d==this.node.childCount?pn.none:this.node.child(d).marks,r,e,d),l.placeWidget(c,e,i)},(c,d,u,f)=>{l.syncToMarks(c.marks,r,e,f);let h;l.findNodeMatch(c,d,u,f)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(h=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,d,u,h,e)||l.updateNextNode(c,d,u,e,f,i)||l.addNode(c,d,u,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ga)&&(o&&this.protectLocalComposition(e,o),e5(this.contentDOM,this.children,e),Hl&&BD(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof xt)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=HD(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new _D(this,s,n,i);e.input.compositionNodes.push(o),this.children=V1(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==Vi||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ai}updateOuterDeco(e){if(ch(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=t5(this.dom,this.nodeDOM,U1(this.outerDeco,this.node,n),U1(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function CC(t,e,n,r,i){n5(r,e,t);let s=new _o(void 0,t,e,n,r,r,r);return s.contentDOM&&s.updateChildren(i,0),s}class Mp extends _o{constructor(e,n,r,i,s,o){super(e,n,r,i,s,null,o)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Vi||this.dirty!=Ai&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ai||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ai,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Mp(this.parent,i,this.outerDeco,this.innerDeco,s,s)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Vi)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Z9 extends au{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ai&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class PD extends _o{constructor(e,n,r,i,s,o,a,l){super(e,n,r,i,s,o,a),this.spec=l}update(e,n,r,i){if(this.dirty==Vi)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function e5(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=xC(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof No){let l=r?r.previousSibling:t.lastChild;e5(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=xC(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Xc=function(t){t&&(this.nodeName=t)};Xc.prototype=Object.create(null);const va=[new Xc];function U1(t,e,n){if(t.length==0)return va;let r=n?va[0]:new Xc,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Xc(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Xc(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function t5(t,e,n,r){if(n==va&&r==va)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=va[0]),i=l}MD(i,a||va[0],o)}return i}function MD(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function n5(t,e,n){return t5(t,t,va,U1(e,n,t.nodeType!=1))}function ch(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function xC(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class DD{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=LD(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let s=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;s<a&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=Ai,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;i<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let d=this.index;d<c;d++){let u=this.top.children[d];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){l=d;break}}if(l<0&&this.index<this.top.children.length){let d=this.top.children[this.index];d instanceof No&&d.dirty!=Vi&&d.mark.type==e[o].type&&d.spec.update&&!this.isLocked(d.dom)&&d.spec.update(e[o])&&(d.mark=e[o],l=this.index,this.changed=!0)}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];
vendor: 4,219 bytes, line 243
243else{let d=No.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==Vi&&o.dom==o.contentDOM&&(o.dirty=ga),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof _o){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let d=l.dom,u,f=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Vi&&ch(n,l.outerDeco));if(!f&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!f&&(u=this.recreateWrapper(l,e,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=ga,u.updateChildren(i,o+1),u.dirty=Ai),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!ch(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=_o.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=_o.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new Q9(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof No;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Mp)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((kr||xr)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Z9(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function LD(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof No)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function jD(t,e){return t.type.side-e.type.side}function FD(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,i,e.forChild(s,d),c),s+=d.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let d,u;for(;o<i.length&&i[o].to==s;){let v=i[o++];v.widget&&(d?(u||(u=[d])).push(v):d=v)}if(d)if(u){u.sort(jD);for(let v=0;v<u.length;v++)n(u[v],c,!!l)}else n(d,c,!!l);let f,h;if(l)h=-1,f=l,l=null;else if(c<t.childCount)h=c,f=t.child(c++);else break;for(let v=0;v<a.length;v++)a[v].to<=s&&a.splice(v--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let p=s+f.nodeSize;if(f.isText){let v=p;o<i.length&&i[o].from<v&&(v=i[o].from);for(let b=0;b<a.length;
vendor: 5,541 bytes, line 243
243b++)a[b].to<v&&(v=a[b].to);v<p&&(l=f.cut(v-s),f=f.cut(0,v-s),p=v,h=-1)}else for(;o<i.length&&i[o].to<p;)o++;let g=f.isInline&&!f.isLeaf?a.filter(v=>!v.inline):a.slice();r(f,g,e.forChild(s,f),h),s=p}}function BD(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function HD(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let c=t.child(i++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function V1(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],c=a,d=a+=l.size;c>=n||d<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,r)),i&&(s.push(i),i=void 0),d>n&&s.push(l.slice(n-c,l.size,r)))}return s}function ly(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(Pp(n)){for(l=o;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&wt.isSelectable(u)&&i.parent&&!(u.isInline&&pD(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new wt(o==f?a:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let u=o,f=o;for(let h=0;h<n.rangeCount;h++){let p=n.getRangeAt(h);u=Math.min(u,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(u<0)return null;[l,o]=f==t.state.selection.anchor?[f,u]:[u,f],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;c=cy(t,d,a,u)}return c}function r5(t){return t.editable?t.hasFocus():s5(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Vs(t,e=!1){let n=t.state.selection;if(i5(t,n),!r5(t))return;let r=t.input.mouseDown;if(!e&&xr&&r){let i=t.domSelectionRange(),s=t.domObserver.currentSelection;if(i.anchorNode&&s.anchorNode&&Ma(i.anchorNode,i.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)qD(t);else{let{anchor:i,head:s}=n,o,a;$C&&!(n instanceof xt)&&(n.$from.parent.inlineContent||(o=EC(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=EC(t,n.to))),t.docView.setSelection(i,s,t,e),$C&&(o&&TC(o),a&&TC(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&zD(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const $C=kr||xr&&U9<63;function EC(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(kr&&i&&i.contentEditable=="false")return Ym(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Ym(i);if(s)return Ym(s)}}function Ym(t){return t.contentEditable="true",kr&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function TC(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function zD(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!r5(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function qD(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Sr(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Yr&&ko<=11&&(n.disabled=!0,n.disabled=!1)}function i5(t,e){if(e instanceof wt){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(RC(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else RC(t)}function RC(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function cy(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||xt.between(e,n,r)}function IC(t){return t.editable&&!t.hasFocus()?!1:s5(t)}function s5(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function UD(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Ma(e.node,e.offset,n.anchorNode,n.anchorOffset)}function W1(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&Dt.findFrom(s,e)}function mo(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function AC(t,e,n){let r=t.state.selection;if(r instanceof xt)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return mo(t,new xt(r.$anchor,o))}
vendor: 4,167 bytes, line 243
243else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=W1(t.state,e);return i&&i instanceof wt?mo(t,i):!1}else if(!($i&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?wt.isSelectable(s)?mo(t,new wt(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):ou?mo(t,new xt(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof wt&&r.node.isInline)return mo(t,new xt(e>0?r.$to:r.$from));{let i=W1(t.state,e);return i?mo(t,i):!1}}}function dh(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Yc(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function nl(t,e){return e<0?VD(t):WD(t)}function VD(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(Ii&&n.nodeType==1&&r<dh(n)&&Yc(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Yc(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(o5(n))break;{let a=n.previousSibling;for(;a&&Yc(a,-1);)i=n.parentNode,s=Sr(a),a=a.previousSibling;if(a)n=a,r=dh(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?G1(t,n,r):i&&G1(t,i,s)}function WD(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=dh(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Yc(a,1))s=n,o=++r;else break}else{if(o5(n))break;{let a=n.nextSibling;for(;a&&Yc(a,1);)s=a.parentNode,o=Sr(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=dh(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&G1(t,s,o)}function o5(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function GD(t,e){for(;t&&e==t.childNodes.length&&!su(t);)e=Sr(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function KD(t,e){for(;t&&!e&&!su(t);)e=Sr(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function G1(t,e,n){if(e.nodeType!=3){let s,o;(o=GD(e,n))?(e=o,n=0):(s=KD(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Pp(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Vs(t)},50)}function OC(t,e){let n=t.state.doc.resolve(e);if(!(xr||V9)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function kC(t,e,n){let r=t.state.selection;if(r instanceof xt&&!r.empty||n.indexOf("s")>-1||$i&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=W1(t.state,e);if(o&&o instanceof wt)return mo(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Xr?Dt.near(o,e):Dt.findFrom(o,e);return a?mo(t,a):!1}return!1}function NC(t,e){if(!(t.state.selection instanceof xt))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function _C(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function XD(t){if(!kr||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;_C(t,r,"true"),setTimeout(()=>_C(t,r,"false"),20)}return!1}function YD(t){let e="";
vendor: 24,144 bytes, lines 243-246
243return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function JD(t,e){let n=e.keyCode,r=YD(e);if(n==8||$i&&n==72&&r=="c")return NC(t,-1)||nl(t,-1);if(n==46&&!e.shiftKey||$i&&n==68&&r=="c")return NC(t,1)||nl(t,1);if(n==13||n==27)return!0;if(n==37||$i&&n==66&&r=="c"){let i=n==37?OC(t,t.state.selection.from)=="ltr"?-1:1:-1;return AC(t,i,r)||nl(t,i)}else if(n==39||$i&&n==70&&r=="c"){let i=n==39?OC(t,t.state.selection.from)=="ltr"?1:-1:1;return AC(t,i,r)||nl(t,i)}else{if(n==38||$i&&n==80&&r=="c")return kC(t,-1,r)||nl(t,-1);if(n==40||$i&&n==78&&r=="c")return XD(t)||kC(t,1,r)||nl(t,1);if(r==($i?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function dy(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=t.someProp("clipboardSerializer")||La.fromSchema(t.state.schema),a=f5(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,d,u=0;for(;c&&c.nodeType==1&&(d=u5[c.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let p=a.createElement(d[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),u++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${u?` -${u}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
244
245`);return{dom:l,text:f,slice:e}}function a5(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,s||r,t)}),s)return a=new lt(Be.from(t.state.schema.text(e.replace(/\r\n?/g,`
246`))),0,0),t.someProp("transformPasted",f=>{a=f(a,t,!0)}),a;let u=t.someProp("clipboardTextParser",f=>f(e,i,r,t));if(u)a=u;else{let f=i.marks(),{schema:h}=t.state,p=La.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let v=o.appendChild(document.createElement("p"));g&&v.appendChild(p.serializeNode(h.text(g,f)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),o=tL(n),ou&&nL(o);let c=o&&o.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Gc.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!QD.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)a=rL(PC(a,+d[1],+d[2]),d[4]);else if(a=lt.maxOpen(ZD(a.content,i),!0),a.openStart||a.openEnd){let u=0,f=0;for(let h=a.content.firstChild;u<a.openStart&&!h.type.spec.isolating;u++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=PC(a,u,f)}return t.someProp("transformPasted",u=>{a=u(a,t,l)}),a}const QD=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ZD(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&s.length&&c5(l,s,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=d5(o[o.length-1],s.length));let d=l5(a,l);o.push(d),i=i.matchType(d.type),s=l}}),o)return Be.from(o)}return t}function l5(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Be.from(t));return t}function c5(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=c5(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(Be.from(l5(n,t,i+1))))}}function d5(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,d5(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Be.empty,!0);return t.copy(n.append(r))}function K1(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=K1(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(Be.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function PC(t,e,n){return e<t.openStart&&(t=new lt(K1(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new lt(K1(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const u5={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function f5(){return document.implementation.createHTMLDocument("title")}let Jm=null;function eL(t){let e=window.trustedTypes;return e?(Jm||(Jm=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Jm.createHTML(t)):t}function tL(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=f5(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(t),s;if((s=i&&u5[i[1].toLowerCase()])&&(t=s.map(o=>"<"+o+">").join("")+t+s.map(o=>"</"+o+">").reverse().join("")),r.innerHTML=eL(t),s)for(let o=0;o<s.length;o++)r=r.querySelector(s[o])||r;for(let o=0;o<n.styleSheets.length;o++){let a=n.styleSheets[o];for(let l=0;l<a.rules.length;l++){let c=a.rules[l];if(c instanceof CSSStyleRule){let d=r.querySelectorAll(c.selectorText);for(let u=0;u<d.length;u++)d[u].style.cssText+=c.style.cssText}}}return r}function nL(t){let e=t.querySelectorAll(xr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function rL(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=Be.from(l.create(r[a+1],i)),s++,o++}return new lt(i,s,o)}const jr={},Fr={},iL={touchstart:!0,touchmove:!0};class sL{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function oL(t){for(let e in jr){let n=jr[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{lL(t,r)&&!uy(t,r)&&(t.editable||!(r.type in Fr))&&n(t,r)},iL[e]?{passive:!0}:void 0)}kr&&t.dom.addEventListener("input",()=>null),X1(t)}function qs(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function aL(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function X1(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>uy(t,r))})}function uy(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function lL(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function cL(t,e){!uy(t,e)&&jr[e.type]&&(t.editable||!(e.type in Fr))&&jr[e.type](t,e)}Fr.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!g5(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(zs&&xr&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Hl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,fa(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||JD(t,n)?n.preventDefault():qs(t,"key")};Fr.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Fr.keypress=(t,e)=>{let n=e;if(g5(t)||!n.charCode||n.ctrlKey&&!n.altKey||$i&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof xt)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function lu(t){return{left:t.clientX,top:t.clientY}}function dL(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function fy(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function cu(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function uL(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&wt.isSelectable(r)?(cu(t,new wt(n)),!0):!1}function fL(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof wt&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(wt.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(cu(t,wt.create(t.state.doc,i)),!0):!1}function hL(t,e,n,r,i){return fy(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?fL(t,n):uL(t,n))}function pL(t,e,n,r){return fy(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function mL(t,e,n,r){return fy(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||gL(t,n,r)}function gL(t,e,n){if(n.button!=0)return!1;let r=h5(t,e,!0),i=t.state.doc;return r?(cu(t,r),r instanceof xt&&i.eq(t.state.doc)&&(t.input.mouseDown=new bL(t,r)),!0):!1}function h5(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?xt.create(r,0,r.content.size):null;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)return xt.create(r,a+1,a+1+o.content.size);if(n&&wt.isSelectable(o))return wt.create(r,a)}return null}function hy(t){return uh(t)}const p5=$i?"metaKey":"ctrlKey";jr.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=hy(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&dL(n,t.input.lastClick)&&!n[p5]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let o=t.posAtCoords(lu(n));o&&(s=="singleClick"?t.input.mouseDown=new vL(t,o,n,!!r):(s=="doubleClick"?pL:mL)(t,o.pos,o.inside,n)?n.preventDefault():qs(t,"pointer"))};class m5{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class vL extends m5{constructor(e,n,r,i){super(e),this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[p5],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);s=d.parent,o=d.depth?d.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof wt&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ii&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),qs(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Vs(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(lu(e))),this.updateAllowDefault(e),this.allowDefault||!n?qs(this.view,"pointer"):hL(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||kr&&this.mightDrag&&!this.mightDrag.node.isAtom||xr&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(cu(this.view,Dt.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):qs(this.view,"pointer")}move(e){this.updateAllowDefault(e),qs(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class bL extends m5{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),qs(this.view,"pointer");let n=this.view.posAtCoords(lu(e)),r=n&&h5(this.view,n.inside,!1);if(!r)return;let{doc:i}=this.view.state,s=this.startSelection,[o,a]=r.from<s.from?[s.to,r.from]:[s.from,r.to];cu(this.view,xt.create(i,o,a))}}jr.touchstart=t=>{t.input.lastTouch=Date.now(),hy(t),qs(t,"pointer")};jr.touchmove=t=>{t.input.lastTouch=Date.now(),qs(t,"pointer")};jr.contextmenu=t=>hy(t);function g5(t,e){return t.composing?!0:kr&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const yL=zs?5e3:-1;Fr.compositionstart=Fr.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof xt&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||xr&&V9&&wL(t)))t.markCursor=t.state.storedMarks||n.marks(),uh(t,!0),t.markCursor=null;else if(uh(t,!e.selection.empty),Ii&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}v5(t,yL)};function wL(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Fr.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,v5(t,20))};function v5(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>uh(t),e))}function b5(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function SL(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=fD(e.focusNode,e.focusOffset),r=hD(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function uh(t,e=!1){if(!(zs&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),b5(t),e||t.docView&&t.docView.dirty){let n=ly(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function CL(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const wd=Yr&&ko<15||Hl&&vD<604;jr.copy=Fr.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=wd?null:n.clipboardData,o=r.content(),{dom:a,text:l}=dy(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):CL(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function xL(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function $L(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Sd(t,r.value,null,i,e):Sd(t,r.textContent,r.innerHTML,i,e)},50)}function Sd(t,e,n,r,i){let s=a5(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||lt.empty)))return!0;if(!s)return!1;let o=xL(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function y5(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Fr.paste=(t,e)=>{let n=e;if(t.composing&&!zs)return;let r=wd?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Sd(t,y5(r),r.getData("text/html"),i,n)?n.preventDefault():$L(t,n)};class w5{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const EL=$i?"altKey":"ctrlKey";function S5(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[EL]}jr.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(lu(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof wt?i.to-1:i.to))){if(r&&r.mightDrag)o=wt.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let u=t.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&(o=wt.create(t.state.doc,u.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:d}=dy(t,a);(!n.dataTransfer.files.length||!xr||U9>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(wd?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",wd||n.dataTransfer.setData("text/plain",c),t.dragging=new w5(d,S5(t,n),o)};jr.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Fr.dragover=Fr.dragenter=(t,e)=>e.preventDefault();Fr.drop=(t,e)=>{try{TL(t,e,t.dragging)}finally{t.dragging=null}};function TL(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(lu(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",h=>{s=h(s,t,!1)}):s=a5(t,y5(e.dataTransfer),wd?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&S5(t,e));if(t.someProp("handleDrop",h=>h(t,e,s||lt.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?b9(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=t.state.tr;if(o){let{node:h}=n;h?h.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,u=l.doc;if(d?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(u))return;let f=l.doc.resolve(c);if(d&&wt.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new wt(f));else{let h=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((p,g,v,b)=>h=b),l.setSelection(cy(t,f,l.doc.resolve(h)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}jr.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Vs(t)},20))};jr.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};jr.beforeinput=(t,e)=>{if(zs&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,fa(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Fr)jr[t]=Fr[t];function Cd(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class fh{constructor(e,n){this.toDOM=e,this.spec=n||Ta,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new Lr(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof fh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Cd(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Po{constructor(e,n){this.attrs=e,this.spec=n||Ta}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new Lr(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Po&&Cd(this.attrs,e.attrs)&&Cd(this.spec,e.spec)}static is(e){return e.type instanceof Po}destroy(){}}class py{constructor(e,n){this.attrs=e,this.spec=n||Ta}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new Lr(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof py&&Cd(this.attrs,e.attrs)&&Cd(this.spec,e.spec)}destroy(){}}class Lr{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Lr(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Lr(e,e,new fh(n,r))}static inline(e,n,r,i){return new Lr(e,n,new Po(r,i))}
vendor: 4,234 bytes, line 246
246static node(e,n,r,i){return new Lr(e,n,new py(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Po}get widget(){return this.type instanceof fh}}const vl=[],Ta={};class yn{constructor(e,n){this.local=e.length?e:vl,this.children=n.length?n:vl}static create(e,n){return n.length?hh(n,e,0,Ta):Ar}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==Ar||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Ta)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?RL(this.children,o||[],e,n,r,i,s):o?new yn(o.sort(Ra),vl):Ar}add(e,n){return n.length?this==Ar?yn.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let c=l+r,d;if(d=x5(n,a,c)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,d,c+1):i.splice(s,0,l,l+a.nodeSize,hh(d,a,c+1,Ta)),s+=3}});let o=C5(s?$5(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new yn(o.length?this.local.concat(o).sort(Ra):this.local,i||this.children)}remove(e){return e.length==0||this==Ar?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let d=0,u;d<e.length;d++)(u=e[d])&&u.from>a&&u.to<l&&(e[d]=null,(o||(o=[])).push(u));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(o,a+1);c!=Ar?r[s+2]=c:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new yn(i,r):Ar}forChild(e,n){if(this==Ar)return this;if(n.isLeaf)return yn.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof Po){let c=Math.max(s,l.from)-s,d=Math.min(o,l.to)-s;c<d&&(i||(i=[])).push(l.copy(c,d))}}if(i){let a=new yn(i.sort(Ra),vl);return r?new yo([a,r]):a}return r||Ar}eq(e){if(this==e)return!0;if(!(e instanceof yn)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return my(this.localsInner(e))}localsInner(e){if(this==Ar)return vl;if(e.inlineContent||!this.local.some(Po.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Po||n.push(this.local[r]);return n}forEachSet(e){e(this)}}yn.empty=new yn([],[]);yn.removeOverlap=my;const Ar=yn.empty;class yo{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Ta));return yo.from(r)}forChild(e,n){if(n.isLeaf)return yn.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=Ar&&(s instanceof yo?r=r.concat(s.members):r.push(s))}return yo.from(r)}eq(e){if(!(e instanceof yo)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?my(r?n:n.sort(Ra)):vl}static from(e){switch(e.length){case 0:return Ar;case 1:return e[0];default:return new yo(e.every(n=>n instanceof yn)?e:e.reduce((n,r)=>n.concat(r instanceof yn?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;
vendor: 12,126 bytes, line 246
246n++)this.members[n].forEachSet(e)}}function RL(t,e,n,r,i,s,o){let a=t.slice();for(let c=0,d=s;c<n.maps.length;c++){let u=0;n.maps[c].forEach((f,h,p,g)=>{let v=g-p-(h-f);for(let b=0;b<a.length;b+=3){let w=a[b+1];if(w<0||f>w+d-u)continue;let C=a[b]+d-u;h>=C?a[b+1]=f<=C?-2:-1:f>=d&&v&&(a[b]+=v,a[b+1]+=v)}u+=v}),d=n.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=n.map(t[c]+s),u=d-i;if(u<0||u>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+s,-1),h=f-i,{index:p,offset:g}=r.content.findIndex(u),v=r.maybeChild(p);if(v&&g==u&&g+v.nodeSize==h){let b=a[c+2].mapInner(n,v,d+1,t[c]+s+1,o);b!=Ar?(a[c]=u,a[c+1]=h,a[c+2]=b):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=IL(a,t,e,n,i,s,o),d=hh(c,r,0,o);e=d.local;for(let u=0;u<a.length;u+=3)a[u+1]<0&&(a.splice(u,3),u-=3);for(let u=0,f=0;u<d.children.length;u+=3){let h=d.children[u];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,d.children[u],d.children[u+1],d.children[u+2])}}return new yn(e.sort(Ra),a)}function C5(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Lr(i.from+e,i.to+e,i.type))}return n}function IL(t,e,n,r,i,s,o){function a(l,c){for(let d=0;d<l.local.length;d++){let u=l.local[d].map(r,i,c);u?n.push(u):o.onRemove&&o.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function x5(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function $5(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function hh(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let c=x5(t,a,l+n);if(c){s=!0;let d=hh(c,a,n+l+1,r);d!=Ar&&i.push(l,l+a.nodeSize,d)}});let o=C5(s?$5(t):t,-n).sort(Ra);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new yn(o,i):Ar}function Ra(t,e){return t.from-e.from||t.to-e.to}function my(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),MC(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),MC(e,i,r.copy(s.from,r.to)));break}}}return e}function MC(t,e,n){for(;e<t.length&&Ra(n,t[e])>0;)e++;t.splice(e,0,n)}function Qm(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ar&&e.push(r)}),t.cursorWrapper&&e.push(yn.create(t.state.doc,[t.cursorWrapper.deco])),yo.from(e)}const AL={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},OL=Yr&&ko<=11;class kL{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class NL{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new kL,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Yr&&ko<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():kr&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),OL&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,AL)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(IC(this.view)){if(this.suppressingSelectionUpdates)return Vs(this.view);if(Yr&&ko<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ma(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Bl(s))n.add(s);for(let s=e.anchorNode;s;s=Bl(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&IC(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let u=this.registerMutation(n[d],l);u&&(s=s<0?u.from:Math.min(u.from,s),o=o<0?u.to:Math.max(u.to,o),u.typeOver&&(a=!0))}if(l.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||xr&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(d=>d.type=="childList"&&d.removedNodes.length))){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let u=d.nextSibling;for(;u&&u.nodeType==1;){if(u.contentEditable=="false"){d.parentNode.removeChild(d);break}u=u.firstChild}}}else if(Ii&&l.length){let d=l.filter(u=>u.nodeName=="BR");if(d.length==2){let[u,f]=d;u.parentNode&&u.parentNode.parentNode==f.parentNode?f.remove():u.remove()}else{let{focusNode:u}=this.currentSelection;for(let f of d){let h=f.parentNode;h&&h.nodeName=="LI"&&(!u||ML(e,u)!=h)&&f.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Pp(r)&&(c=ly(e))&&c.eq(Dt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Vs(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),_L(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,DL(e,l)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Vs(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let u=e.addedNodes[d];n.push(u),u.nodeType==3&&(this.lastChangedTextNode=u)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Yr&&ko<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:u,nextSibling:f}=e.addedNodes[d];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(i=u),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let o=i&&i.parentNode==e.target?Sr(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?Sr(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let DC=new WeakMap,LC=!1;function _L(t){if(!DC.has(t)&&(DC.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Ii,LC)return;LC=!0}}function jC(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Ma(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function PL(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return jC(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?jC(t,n):null}function ML(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function DL(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(s,a.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function LL(t,e,n,r){let{node:i,fromOffset:s,toOffset:o,from:a,to:l}=t.docView.parseRange(e,n),c=t.domSelectionRange(),d,u=c.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],Pp(c)||d.push({node:c.focusNode,offset:c.focusOffset})),xr&&t.input.lastKeyCode===8)for(let b=o;b>s;b--){let w=i.childNodes[b-1],C=w.pmViewDesc;if(w.nodeName=="BR"&&!C){o=b;break}if(!C||C.size)break}let f=t.state.doc,h=t.someProp("domParser")||Gc.fromSchema(t.state.schema),p=f.resolve(a),g=null,v=h.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:jL(r),context:p});if(d&&d[0].pos!=null){let b=d[0].pos,w=d[1]&&d[1].pos;w==null&&(w=b),g={anchor:b+a,head:w+a}}return{doc:v,sel:g,from:a,to:l}}const jL=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(kr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||kr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},FL=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function BL(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let T=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,S=ly(t,T);if(S&&!t.state.selection.eq(S)){if(xr&&zs&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",A=>A(t,fa(13,"Enter"))))return;let _=t.state.tr.setSelection(S);T=="pointer"?_.setMeta("pointer",!0):T=="key"&&_.scrollIntoView(),s&&_.setMeta("composition",s),t.dis
vendor: 2,380 bytes, line 246
246patch(_)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=LL(t,e,n,i),d=t.state.doc,u=d.slice(c.from,c.to),f,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,h="end"):(f=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let p=qL(u.content,c.doc.content,c.from,f,h);if(p&&t.input.domChangeCount++,(Hl&&t.input.lastIOSEnter>Date.now()-225||zs)&&i.some(T=>T.nodeType==1&&!FL.test(T.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",T=>T(t,fa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof xt&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let T=FC(t,t.state.doc,c.sel);if(T&&!T.eq(t.state.selection)){let S=t.state.tr.setSelection(T);s&&S.setMeta("composition",s),t.dispatch(S)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof xt&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),Yr&&ko<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let g=c.doc.resolveNoCache(p.start-c.from),v=c.doc.resolveNoCache(p.endB-c.from),b=d.resolve(p.start),w=g.sameParent(v)&&g.parent.inlineContent&&b.end()>=p.endA;if((Hl&&t.input.lastIOSEnter>Date.now()-225&&(!w||i.some(T=>T.nodeName=="DIV"||T.nodeName=="P"))||!w&&g.pos<c.doc.content.size&&(!g.sameParent(v)||!g.parent.inlineContent)&&g.pos<v.pos&&!/\S/.test(c.doc.textBetween(g.pos,v.pos,"","")))&&t.someProp("handleKeyDown",T=>T(t,fa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&zL(d,p.start,p.endA,g,v)&&t.someProp("handleKeyDown",T=>T(t,fa(8,"Backspace")))){zs&&xr&&t.domObserver.suppressSelectionUpdates();return}xr&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),zs&&!w&&g.start()!=v.start()&&v.parentOffset==0&&g.depth==v.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,v=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>
vendor: 12,806 bytes, line 246
246{t.someProp("handleKeyDown",function(T){return T(t,fa(13,"Enter"))})},20));let C=p.start,x=p.endA,R=T=>{let S=T||t.state.tr.replace(C,x,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let _=FC(t,S.doc,c.sel);_&&!(xr&&t.composing&&_.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(_.head==C||_.head==S.mapping.map(x)-1)||Yr&&_.empty&&_.head==C)&&S.setSelection(_)}return s&&S.setMeta("composition",s),S.scrollIntoView()},O;if(w)if(g.pos==v.pos){Yr&&ko<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Vs(t),20));let T=R(t.state.tr.delete(C,x)),S=d.resolve(p.start).marksAcross(d.resolve(p.endA));S&&T.ensureMarks(S),t.dispatch(T)}else if(p.endA==p.endB&&(O=HL(g.parent.content.cut(g.parentOffset,v.parentOffset),b.parent.content.cut(b.parentOffset,p.endA-b.start())))){let T=R(t.state.tr);O.type=="add"?T.addMark(C,x,O.mark):T.removeMark(C,x,O.mark),t.dispatch(T)}else if(g.parent.child(g.index()).isText&&g.index()==v.index()-(v.textOffset?0:1)){let T=g.parent.textBetween(g.parentOffset,v.parentOffset),S=()=>R(t.state.tr.insertText(T,C,x));t.someProp("handleTextInput",_=>_(t,C,x,T,S))||t.dispatch(S())}else t.dispatch(R());else t.dispatch(R())}function FC(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:cy(t,e.resolve(n.anchor),e.resolve(n.head))}function HL(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(Be.from(c).eq(t))return{mark:a,type:o}}function zL(t,e,n,r,i){if(n-e<=i.pos-r.pos||Zm(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(Zm(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Zm(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Zm(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function qL(t,e,n,r,i){let s=t.findDiffStart(e,n),o=n+t.size,a=n+e.size;if(s==null)return null;let{a:l,b:c}=t.findDiffEnd(e,o,a);if(i=="end"){let d=Math.max(0,s-Math.min(l,c));r-=l+d-s}if(l<s&&o<a){let d=r<=s&&r>=l?s-r:0;s-=d,c=s+(c-l),l=s}else if(c<s){let d=r<=s&&r>=c?s-r:0;s-=d,l=s+(l-c),c=s}return{start:s,endA:l,endB:c}}class E5{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new sL,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(UC),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=zC(this),HC(this),this.nodeViews=qC(this),this.docView=CC(this.state.doc,BC(this),Qm(this),this.dom,this),this.domObserver=new NL(this,(r,i,s,o)=>BL(this,r,i,s,o)),this.domObserver.start(),oL(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&X1(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(UC),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(b5(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=qC(this);VL(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&X1(this),this.editable=zC(this),HC(this);let l=Qm(this),c=BC(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",u=s||!this.docView.matchesNode(e.doc,c,l);(u||!e.selection.eq(i.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&wD(this);if(o){this.domObserver.stop();let h=u&&(Yr||xr)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&UL(i.selection,e.selection);if(u){let g=xr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=SL(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=CC(e.doc,c,l,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let p=this.input.mouseDown;h||!(p&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&UD(this)&&p.delaySelUpdate())?Vs(this,h):(i5(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&SD(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof wt){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&vC(this,n.getBoundingClientRect(),e)}else vC(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new w5(e.slice,e.move,i<0?void 0:wt.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Yr){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&CD(this.dom),Vs(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return RD(this,e)}coordsAtPos(e,n=1){return Y9(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return ND(this,n||this.state,e)}pasteHTML(e,n){return Sd(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Sd(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return dy(this,e)}destroy(){this.docView&&(aL(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Qm(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,dD())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return cL(this,e)}domSelectionRange(){let e=this.domSelection();return e?kr&&this.root.nodeType===11&&mD(this.dom.ownerDocument)==this.dom&&PL(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}E5.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function BC(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Lr.node(0,t.state.doc.content.size,e)]}function HC(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Lr.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function zC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function UL(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function qC(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function VL(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function UC(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Do={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ph={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},WL=typeof navigator<"u"&&/Mac/.test(navigator.platform),GL=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Cr=0;Cr<10;Cr++)Do[48+Cr]=Do[96+Cr]=String(Cr);for(var Cr=1;Cr<=24;Cr++)Do[Cr+111]="F"+Cr;for(var Cr=65;Cr<=90;Cr++)Do[Cr]=String.fromCharCode(Cr+32),ph[Cr]=String.fromCharCode(Cr);for(var eg in Do)ph.hasOwnProperty(eg)||(ph[eg]=Do[eg]);function KL(t){var e=WL&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||GL&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ph:Do)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const XL=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),YL=typeof navigator<"u"&&/Win/.test(navigator.platform);function JL(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))XL?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function QL(t){let e=Object.create(null);for(let n in t)e[JL(n)]=t[n];return e}
vendor: 5,103 bytes, line 246
246function tg(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function ZL(t){return new An({props:{handleKeyDown:T5(t)}})}function T5(t){let e=QL(t);return function(n,r){let i=KL(r),s,o=e[tg(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[tg(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(YL&&r.ctrlKey&&r.altKey)&&(s=Do[r.keyCode])&&s!=i){let a=e[tg(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var ej=Object.defineProperty,gy=(t,e)=>{for(var n in e)ej(t,n,{get:e[n],enumerable:!0})};function Dp(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var Lp=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([o,a])=>[o,(...c)=>{const d=a(...c)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!t,l=t||i.tr,c=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),o.every(u=>u===!0)),d={...Object.fromEntries(Object.entries(n).map(([u,f])=>[u,(...p)=>{const g=this.buildProps(l,e),v=f(...p)(g);return o.push(v),d}])),run:c};return d}createCan(t){const{rawCommands:e,state:n}=this,r=!1,i=t||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:t,editor:r,view:s,state:Dp({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)(o)]))}};return o}},R5={};gy(R5,{blur:()=>tj,clearContent:()=>nj,clearNodes:()=>rj,command:()=>ij,createParagraphNear:()=>sj,cut:()=>oj,deleteCurrentNode:()=>aj,deleteNode:()=>lj,deleteRange:()=>cj,deleteSelection:()=>fj,enter:()=>hj,exitCode:()=>pj,extendMarkRange:()=>mj,first:()=>gj,focus:()=>bj,forEach:()=>yj,insertContent:()=>wj,insertContentAt:()=>Cj,insertDefaultBlock:()=>xj,joinBackward:()=>Tj,joinDown:()=>Ej,joinForward:()=>Rj,joinItemBackward:()=>Ij,joinItemForward:()=>Aj,joinTextblockBackward:()=>Oj,joinTextblockForward:()=>kj,joinUp:()=>$j,keyboardShortcut:()=>_j,lift:()=>Pj,liftEmptyBlock:()=>Mj,liftListItem:()=>Dj,newlineInCode:()=>Lj,resetAttributes:()=>jj,scrollIntoView:()=>Fj,selectAll:()=>Bj,selectNodeBackward:()=>Hj,selectNodeForward:()=>zj,selectParentNode:()=>qj,selectTextblockEnd:()=>Uj,selectTextblockStart:()=>Vj,setContent:()=>Wj,setMark:()=>fF,setMeta:()=>hF,setNode:()=>pF,setNodeSelection:()=>mF,setTextDirection:()=>gF,setTextSelection:()=>vF,sinkListItem:()=>bF,splitBlock:()=>yF,splitListItem:()=>wF,toggleList:()=>CF,toggleMark:()=>xF,toggleNode:()=>$F,toggleWrap:()=>EF,undoInputRule:()=>TF,unsetAllMarks:()=>RF,unsetMark:()=>IF,unsetTextDirection:()=>AF,updateAttributes:()=>OF,wrapIn:()=>kF,wrapInList:()=>NF});var tj=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),nj=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),rj=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:d}=e,u=c.resolve(d.map(l)),f=c.resolve(d.map(l+a.nodeSize)),h=u.blockRange(f);if(!h)return;const p=ic(h);if(a.type.isTextblock){const{defaultType:g}=u.parent.contentMatchAt(u.index());e.setNodeMarkup(h.start,g)}(p||p===0)&&e.lift(h,p)})}),!0},ij=t=>e=>t(e),sj=()=>({state:t,dispatch:e})=>D9(t,e),oj=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new xt(r.doc.resolve(Math.max(o-1,0)))),!0},aj=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1};function er(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);
246return e.nodes[t]}return t}var lj=t=>({tr:e,state:n,dispatch:r})=>{const i=er(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),c=s.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1},cj=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},dj=t=>t.content?/^text(\*|\+)/.test(t.content):!1,VC=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;const r=e.nodes[t.parent.type.name].spec;return dj(r)?n==="left"?t.start()-1:t.end()+1:t.pos},uj=(t,e,n)=>{const r=VC(t,n,"left"),i=VC(e,n,"right");return{from:r,to:i}},fj=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){const n=t.tr,{ranges:r}=t.selection,i=n.steps.length;r.forEach(s=>{const o=n.mapping.slice(i),a=n.doc.resolve(o.map(s.$from.pos)),l=n.doc.resolve(o.map(s.$to.pos)),{from:c,to:d}=uj(a,l,t.schema);n.deleteRange(c,d)}),n.selection.empty||n.setSelection(xt.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},hj=()=>({commands:t})=>t.keyboardShortcut("Enter"),pj=()=>({state:t,dispatch:e})=>M9(t,e);function vy(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function mh(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:vy(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function I5(t,e,n={}){return t.find(r=>r.type===e&&mh(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function WC(t,e,n={}){return!!I5(t,e,n)}function by(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===e))return;if(!n){const c=r.node.marks.find(d=>d.type===e);c&&(n=c.attrs)}if(!I5([...r.node.marks],e,n))return;let s=r.index,o=t.start()+r.offset,a=s+1,l=o+r.node.nodeSize;for(;s>0&&WC([...t.parent.child(s-1).marks],e,n);)s-=1,o-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&WC([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Xs(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var mj=(t,e)=>({tr:n,state:r,dispatch:i})=>{const s=Xs(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const u=by(l,s,e);if(u&&u.from<=c&&u.to>=d){const f=xt.create(o,u.from,u.to);n.setSelection(f)}}return!0},gj=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function A5(t){return t instanceof xt}function ba(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Y1(t,e=null){if(!e)return null;const n=Dt.atStart(t),r=Dt.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?xt.create(t,ba(0,i,s),ba(t.content.size,i,s)):xt.create(t,ba(e,i,s),ba(e,i,s))}function GC(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function gh(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function vj(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var bj=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(gh()||GC())&&r.dom.focus(),vj()&&!gh()&&!GC()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!A5(n.state.selection))return o(),!0;const a=Y1(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},yj=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),wj=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),O5=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&O5(r)}return t};function Ku(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return O5(n)}function zl(t,e,n){if(t instanceof Oo||t instanceof Be)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return Be.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return zl("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new a9({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Gc.fromSchema(l).parseSlice(Ku(t),n.parseOptions):Gc.fromSchema(l).parse(Ku(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Gc.fromSchema(e);return n.slice?s.parseSlice(Ku(t),n.parseOptions).content:s.parse(Ku(t),n.parseOptions)}return zl("",e,n)}function k5(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Yn||i instanceof fr))return;const s=t.mapping.maps[r];let o=0;
246s.forEach((a,l,c,d)=>{o===0&&(o=d)}),t.setSelection(Dt.near(t.doc.resolve(o),n))}var Sj=t=>!("type"in t),Cj=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=v=>{s.emit("contentError",{editor:s,error:v,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{zl(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(v){l(v)}try{a=zl(e,s.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(v){return l(v),!1}let{from:d,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((Sj(a)?a:[a]).forEach(v=>{v.check(),f=f?v.isText&&v.marks.length===0:!1,h=h?v.isBlock:!1}),d===u&&h){const{parent:v}=r.doc.resolve(d);v.isTextblock&&!v.type.spec.code&&!v.childCount&&(d-=1,u+=1)}let g;if(f){if(Array.isArray(e))g=e.map(v=>v.text||"").join("");else if(e instanceof Be){let v="";e.forEach(b=>{b.text&&(v+=b.text)}),g=v}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,d,u)}else{g=a;const v=r.doc.resolve(d),b=v.node(),w=v.parentOffset===0,C=b.isText||b.isTextblock,x=b.content.size>0;w&&C&&x&&h&&(d=Math.max(0,d-1)),r.replaceWith(d,u,g)}n.updateSelection&&k5(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:g})}return!0};function N5(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var xj=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{pos:i,attrs:s,content:o,updateSelection:a=!0}=t;let l;typeof i=="number"?l=e.doc.resolve(i):i?l=i:l=e.selection.$from;const c=N5(l.parent.contentMatchAt(l.index()));if(!c)return!1;const d=Object.keys(c.spec.attrs||{}),u=s?Object.fromEntries(Object.entries(s).filter(([h])=>d.includes(h))):{};let f;if(o){const h=zl(o,r.schema);f=c.createAndFill(u,h)}else f=c.createAndFill(u);return f?(n&&(e.insert(l.pos,f),a&&k5(e,e.steps.length-1,-1)),!0):!1},$j=()=>({state:t,dispatch:e})=>WM(t,e),Ej=()=>({state:t,dispatch:e})=>GM(t,e),Tj=()=>({state:t,dispatch:e})=>I9(t,e),Rj=()=>({state:t,dispatch:e})=>N9(t,e),Ij=()=>({state:t,dispatch:e,tr:n})=>{try{const r=kp(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Aj=()=>({state:t,dispatch:e,tr:n})=>{try{const r=kp(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Oj=()=>({state:t,dispatch:e})=>UM(t,e),kj=()=>({state:t,dispatch:e})=>VM(t,e);function _5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Nj(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))gh()||_5()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var _j=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=Nj(t).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const d=c.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function Lo(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?er(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(u,f)=>{if(u.isText)return;const h=Math.max(r,f),p=Math.min(i,f+u.nodeSize);a.push({node:u,from:h,to:p})});const l=i-r,c=a.filter(u=>
vendor: 4,108 bytes, line 246
246o?o.name===u.node.type.name:!0).filter(u=>mh(u.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((u,f)=>u+f.to-f.from,0)>=l}var Pj=(t,e={})=>({state:n,dispatch:r})=>{const i=er(t,n.schema);return Lo(n,i,e)?KM(n,r):!1},Mj=()=>({state:t,dispatch:e})=>L9(t,e),Dj=t=>({state:e,dispatch:n})=>{const r=er(t,e.schema);return oD(r)(e,n)},Lj=()=>({state:t,dispatch:e})=>P9(t,e);function jp(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function KC(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var jj=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=jp(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=er(t,r.schema)),a==="mark"&&(o=Xs(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{s&&s===d.type&&(l=!0,i&&n.setNodeMarkup(u,void 0,KC(d.attrs,e))),o&&d.marks.length&&d.marks.forEach(f=>{o===f.type&&(l=!0,i&&n.addMark(u,u+d.nodeSize,o.create(KC(f.attrs,e))))})})}),l},Fj=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Bj=()=>({tr:t,dispatch:e})=>{if(e){const n=new Xr(t.doc);t.setSelection(n)}return!0},Hj=()=>({state:t,dispatch:e})=>O9(t,e),zj=()=>({state:t,dispatch:e})=>_9(t,e),qj=()=>({state:t,dispatch:e})=>JM(t,e),Uj=()=>({state:t,dispatch:e})=>H9(t,e),Vj=()=>({state:t,dispatch:e})=>B9(t,e);function J1(t,e,n={},r={}){return zl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Wj=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const c=J1(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function P5(t,e){const n=Xs(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function M5(t,e){const n=new x9(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Gj(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function Kj(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Fp(t){return e=>Kj(e.$from,t)}function bt(t,e,n){return t.config[e]===void 0&&t.parent?bt(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?bt(t.parent,e,n):null}):t.config[e]}function yy(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=bt(e,"addExtensions",n);return r?[e,...yy(r())]:e}).flat(10)}function wy(t,e){const n=La.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function D5(t){return typeof t=="function"}function an(t,e=void 0,...n){return D5(t)?e?t.bind(e)(...n):t(...n):t}function Xj(t={}){return Object.keys(t).length===0&&t.constructor===Object}function ql(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function L5(t){const e=[],{nodeExtensions:n,markExtensions:r}=ql(t),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(c=>c.name!=="text").map(c=>c.name),a=r.map(c=>c.name),l=[...o,...a];return t.forEach(c=>{const d={name:c.name,options:c.options,storage:c.storage,extensions:i},u=bt(c,"addGlobalAttributes",d);if(!u)return;u().forEach(h=>{let p;Array.isArray(h.types)?p=h.types:h.types==="*"?p=l:h.types==="nodes"?p=o:h.types==="marks"?p=a:p=[],p.forEach(g=>{Object.entries(h.attributes).forEach(([v,b])=>{e.push({type:g,name:v,attribute:{...s,...b}})})})})}
246),i.forEach(c=>{const d={name:c.name,options:c.options,storage:c.storage},u=bt(c,"addAttributes",d);if(!u)return;const f=u();Object.entries(f).forEach(([h,p])=>{const g={...s,...p};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:c.name,name:h,attribute:g})})}),e}function Yj(t){const e=[];let n="",r=!1,i=!1,s=0;const o=t.length;for(let a=0;a<o;a+=1){const l=t[a];if(l==="'"&&!i){r=!r,n+=l;continue}if(l==='"'&&!r){i=!i,n+=l;continue}if(!r&&!i){if(l==="("){s+=1,n+=l;continue}if(l===")"&&s>0){s-=1,n+=l;continue}if(l===";"&&s===0){e.push(n),n="";continue}}n+=l}return n&&e.push(n),e}function XC(t){const e=[],n=Yj(t||""),r=n.length;for(let i=0;i<r;i+=1){const s=n[i],o=s.indexOf(":");if(o===-1)continue;const a=s.slice(0,o).trim(),l=s.slice(o+1).trim();a&&l&&e.push([a,l])}return e}function rr(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?String(s).split(" "):[],l=r[i]?r[i].split(" "):[],c=a.filter(d=>!l.includes(d));r[i]=[...l,...c].join(" ")}else if(i==="style"){const a=new Map([...XC(r[i]),...XC(s)]);r[i]=Array.from(a.entries()).map(([l,c])=>`${l}: ${c}`).join("; ")}else r[i]=s}),r},{})}function xd(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>rr(n,r),{})}function Jj(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function YC(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):Jj(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function JC(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Xj(n)?!1:n!=null))}function QC(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function Qj(t,e){var n;const r=L5(t),{nodeExtensions:i,markExtensions:s}=ql(t),o=(n=i.find(c=>bt(c,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(c=>{const d=r.filter(b=>b.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((b,w)=>{const C=bt(w,"extendNodeSchema",u);return{...b,...C?C(c):{}}},{}),h=JC({...f,content:an(bt(c,"content",u)),marks:an(bt(c,"marks",u)),group:an(bt(c,"group",u)),inline:an(bt(c,"inline",u)),atom:an(bt(c,"atom",u)),selectable:an(bt(c,"selectable",u)),draggable:an(bt(c,"draggable",u)),code:an(bt(c,"code",u)),whitespace:an(bt(c,"whitespace",u)),linebreakReplacement:an(bt(c,"linebreakReplacement",u)),defining:an(bt(c,"defining",u)),isolating:an(bt(c,"isolating",u)),attrs:Object.fromEntries(d.map(QC))}),p=an(bt(c,"parseHTML",u));p&&(h.parseDOM=p.map(b=>YC(b,d)));const g=bt(c,"renderHTML",u);g&&(h.toDOM=b=>g({node:b,HTMLAttributes:xd(b,d)}));const v=bt(c,"renderText",u);return v&&(h.toText=v),[c.name,h]})),l=Object.fromEntries(s.map(c=>{const d=r.filter(v=>v.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((v,b)=>{const w=bt(b,"extendMarkSchema",u);return{...v,...w?w(c):{}}},{}),h=JC({...f,inclusive:an(bt(c,"inclusive",u)),excludes:an(bt(c,"excludes",u)),group:an(bt(c,"group",u)),spanning:an(bt(c,"spanning",u)),code:an(bt(c,"code",u)),attrs:Object.fromEntries(d.map(QC))}),p=an(bt(c,"parseHTML",u));p&&(h.parseDOM=p.map(v=>YC(v,d)));const g=bt(c,"renderHTML",u);return g&&(h.toDOM=v=>g({mark:v,HTMLAttributes:xd(v,d)})),[c.name,h]}));return new a9({topNode:o,nodes:a,marks:l})}function Zj(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Jc(t){return t.sort((n,r)=>{const i=bt(n,"priority")||100,s=bt(r,"priority")||100;return i>s?-1:i<s?1:0})}function j5(t){const e=Jc(yy(t));return Zj(e.map(r=>r.name)).length,e}function F5(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`
247
248`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,c,d,u)=>{var f;l.isBlock&&c>r&&(a+=s);const h=o==null?void 0:o[l.type.name];if(h)return d&&(a+=h({node:l,pos:c,parent:d,index:u,range:e})),!1;l.isText&&(a+=(f=l==null?void 0:l.text)==null?void 0:f.slice(Math.max(r,c)-c,i-c))}),a}function eF(t,e){const n={from:0,to:t.content.size};return F5(t,n,e)}function B5(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function tF(t,e){const n=er(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function H5(t,e){const n=jp(typeof e=="string"?e:e.name,t.schema);return n==="node"?tF(t,e):n==="mark"?P5(t,e):{}}function nF(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function rF(t){const e=nF(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,o)=>o!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function Sy(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const c=e.slice(s).map(a,-1),d=e.slice(s).map(l),u=e.invert().map(c,-1),f=e.invert().map(d);r.push({oldRange:{from:u,to:f},newRange:{from:c,to:d}})})}),rF(r)}function Cy(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=by(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}var iF=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let s=r,o=null;for(;s>0&&o===null;){const a=i.node(s);(a==null?void 0:a.type.name)===e?o=a:s-=1}return[o,s]};function Ec(t,e){return e.nodes[t]||e.marks[t]||null}function Of(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var sF=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,c;const d=((c=(l=i.type.spec).toText)==null?void 0:c.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-s))}),n};function Q1(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?Xs(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>mh(u.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:u,$to:f})=>{const h=u.pos,p=f.pos;t.doc.nodesBetween(h,p,(g,v)=>{if(s&&g.inlineContent&&!g.type.allowsMarkType(s))return!1;if(!g.isText&&!g.marks.length)return;const b=Math.max(h,v),w=Math.min(p,v+g.nodeSize),C=w-b;o+=C,a.push(...g.marks.map(x=>({mark:x,from:b,to:w})))})}),o===0)return!1;const l=a.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>mh(u.mark.attrs,n,{strict:!1})).reduce((u,f)=>u+f.to-f.from,0),c=a.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,f)=>u+f.to-f.from,0);return(l>0?l+c:l)>=o}function oF(t,e,n={}){if(!e)return Lo(t,null,n)||Q1(t,null,n);const r=jp(e,t.schema);return r==="node"?Lo(t,e,n):r==="mark"?Q1(t,e,n):!1}var aF=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const s=Fp(a=>a.type.name===e)(t.selection);if(!s)return!1;const o=t.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},lF=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function ZC(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function ng(t,e){const{nodeExtensions:n}=ql(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=an(bt(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function du(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;
vendor: 4,105 bytes, line 248
248if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(du(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function z5(t){return t instanceof wt}var q5=class U5{constructor(e){this.position=e}static fromJSON(e){return new U5(e.position)}toJSON(){return{position:this.position}}};function cF(t,e){const n=e.mapping.mapResult(t.position);return{position:new q5(n.pos),mapResult:n}}function dF(t){return new q5(t)}function uF(t,e,n){var r;const{selection:i}=e;let s=null;if(A5(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(c=>c.type.excludes(n)))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,u,f)=>{if(c)return!1;if(d.isInline){const h=!f||f.type.allowsMarkType(n),p=!!n.isInSet(d.marks)||!d.marks.some(g=>g.type.excludes(n));c=h&&p}return!c}),c})}var fF=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Xs(t,r.schema);if(i)if(o){const c=P5(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(f,h)=>{const p=Math.max(h,d),g=Math.min(h+f.nodeSize,u);f.marks.find(b=>b.type===l)?f.marks.forEach(b=>{l===b.type&&n.addMark(p,g,l.create({...b.attrs,...e}))}):n.addMark(p,g,l.create(e))})});return uF(r,n,l)},hF=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),pF=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=er(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>hC(s,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>hC(s,{...o,...e})(a,r)).run():!1},mF=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=ba(t,0,r.content.size),s=wt.create(r,i);e.setSelection(s)}return!0},gF=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=s.from,a=s.to),i&&n.doc.nodesBetween(o,a,(l,c)=>{l.isText||n.setNodeMarkup(c,void 0,{...l.attrs,dir:t})}),!0},vF=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=xt.atStart(r).from,a=xt.atEnd(r).to,l=ba(i,o,a),c=ba(s,o,a),d=xt.create(r,l,c);e.setSelection(d)}return!0},bF=t=>({state:e,dispatch:n})=>{const r=er(t,e.schema);return cD(r)(e,n)};function e3(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}var yF=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,c=i.extensionManager.attributes,d=Of(c,a.node().type.name,a.node().attrs);if(s instanceof wt&&s.node.isBlock)return!a.parentOffset||!Us(o,a.pos)?!1:(r&&(t&&e3(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const u=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:N5(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=u&&f?[{type:f,attrs:d}]:void 0,p=Us(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&Us(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:d}]:void 0),r){if(p&&(s instanceof xt&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,h),f&&!u&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),v=e.doc.resolve(g);a.node(-1).canReplaceWith(v.index(),v.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&e3(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},wF=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=er(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;const f=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if
248(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let b=Be.empty;const w=l.index(-1)?1:l.index(-2)?2:3;for(let S=l.depth-w;S>=l.depth-3;S-=1)b=Be.from(l.node(S).copy(b));const C=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,x={...Of(f,l.node().type.name,l.node().attrs),...e},R=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(x))||void 0;b=b.append(Be.from(a.createAndFill(null,R)||void 0));const O=l.before(l.depth-(w-1));n.replace(O,l.after(-C),new lt(b,4-w,0));let T=-1;n.doc.nodesBetween(O,n.doc.content.size,(S,_)=>{if(T>-1)return!1;S.isTextblock&&S.content.size===0&&(T=_+1)}),T>-1&&n.setSelection(xt.near(n.doc.resolve(T))),n.scrollIntoView()}return!0}const h=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...Of(f,u.type.name,u.attrs),...e},g={...Of(f,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const v=h?[{type:a,attrs:p},{type:h,attrs:g}]:[{type:a,attrs:p}];if(!Us(n.doc,l.pos,2))return!1;if(i){const{selection:b,storedMarks:w}=r,{splittableMarks:C}=s.extensionManager,x=w||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,v).scrollIntoView(),!x||!i)return!0;const R=x.filter(O=>C.includes(O.type.name));n.ensureMarks(R)}return!0};function t3(t){return!t||t==="1"?null:t}function V5(t,e){return t3(t)===t3(e)}var rg=(t,e)=>{const n=Fp(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return!(n.node.type===(i==null?void 0:i.type)&&Uo(t.doc,n.pos))||!V5(n.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(n.pos),!0},ig=(t,e)=>{const n=Fp(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return!(n.node.type===(i==null?void 0:i.type)&&Uo(t.doc,r))||!V5(n.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(r),!0};function SF(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),i=e.resolve(n.nodeSize-1);return xt.between(r,i)}var CF=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:f}=i.extensionManager,h=er(t,o.schema),p=er(e,o.schema),{selection:g,storedMarks:v}=o,{$from:b,$to:w}=g,C=b.blockRange(w),x=v||g.$to.parentOffset&&g.$from.marks();if(!C)return!1;const R=Fp(I=>ng(I.type.name,u))(g),O=g.from===0&&g.to===o.doc.content.size,T=o.doc.content.content,S=T.length===1?T[0]:null,_=O&&S&&ng(S.type.name,u)?{node:S,pos:0}:null,A=R??_,$=!!R&&C.depth>=1&&C.depth-R.depth<=1,E=!!_;if(($||E)&&A){if(A.node.type===h)return O&&E?l().command(({tr:I,dispatch:D})=>{const B=SF(I);return B?(I.setSelection(B),D&&D(I),!0):!1}).liftListItem(p).run():c.liftListItem(p);if(ng(A.node.type.name,u)&&h.validContent(A.node.content))return l().command(()=>(s.setNodeMarkup(A.pos,h),!0)).command(()=>rg(s,h)).command(()=>ig(s,h)).run()}return!n||!x||!a?l().command(()=>d().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>rg(s,h)).command(()=>ig(s,h)).run():l().command(()=>{const I=d().wrapInList(h,r),D=x.filter(B=>f.includes(B.type.name));return s.ensureMarks(D),I?!0:c.clearNodes()}).wrapInList(h,r).command(()=>rg(s,h)).command(()=>ig(s,h)).run()},xF=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Xs(t,r.schema);return Q1(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},$F=(t,e,n={})=>({state:r,commands:i})=>{const s=er(t,r.schema),o=er(e,r.schema),a=Lo(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},EF=(t,e={})=>({state:n,commands:r})=>{const i=er(t,n.schema);return Lo(n,i,e)?r.lift(i):r.wrapIn(i,e)},TF=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},RF=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{ignoreClearable:i=!1}=t,{selection:s}=e,{empty:o,ranges:a}=s;if(o)return!0;const{nonClearableMarks:l}=r.extensionManager;if(n){const c=Object.values(r.schema.marks).filter(d=>i||!l.includes(d.name));a.forEach(d=>{for(const u of c)e.removeMark(d.$from.pos,d.$to.pos,u)})}return!0},IF=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Xs(t,r.schema),{$from:c,empty:d,ranges:u}=a;if(!i)return!0;
vendor: 9,702 bytes, lines 248-265
248if(d&&o){let{from:f,to:h}=a;const p=(s=c.marks().find(v=>v.type===l))==null?void 0:s.attrs,g=by(c,l,p);g&&(f=g.from,h=g.to),n.removeMark(f,h,l)}else u.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},AF=t=>({tr:e,state:n,dispatch:r})=>{const{selection:i}=n;let s,o;return typeof t=="number"?(s=t,o=t):t&&"from"in t&&"to"in t?(s=t.from,o=t.to):(s=i.from,o=i.to),r&&e.doc.nodesBetween(s,o,(a,l)=>{if(a.isText)return;const c={...a.attrs};delete c.dir,e.setNodeMarkup(l,void 0,c)}),!0},OF=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=jp(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=er(t,r.schema)),a==="mark"&&(o=Xs(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let f,h,p,g;n.selection.empty?r.doc.nodesBetween(d,u,(v,b)=>{s&&s===v.type&&(l=!0,p=Math.max(b,d),g=Math.min(b+v.nodeSize,u),f=b,h=v)}):r.doc.nodesBetween(d,u,(v,b)=>{b<d&&s&&s===v.type&&(l=!0,p=Math.max(b,d),g=Math.min(b+v.nodeSize,u),f=b,h=v),b>=d&&b<=u&&(s&&s===v.type&&(l=!0,i&&n.setNodeMarkup(b,void 0,{...v.attrs,...e})),o&&v.marks.length&&v.marks.forEach(w=>{if(o===w.type&&(l=!0,i)){const C=Math.max(b,d),x=Math.min(b+v.nodeSize,u);n.addMark(C,x,o.create({...w.attrs,...e}))}}))}),h&&(f!==void 0&&i&&n.setNodeMarkup(f,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(v=>{o===v.type&&i&&n.addMark(p,g,o.create({...v.attrs,...e}))}))}),l},kF=(t,e={})=>({state:n,dispatch:r})=>{const i=er(t,n.schema);return eD(i,e)(n,r)},NF=(t,e={})=>({state:n,dispatch:r})=>{const i=er(t,n.schema);return rD(i,e)(n,r)},_F=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}};function PF(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof wt){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function MF(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}function DF(t){return typeof t=="number"}function LF(t){return Object.prototype.toString.call(t).slice(8,-1)}function Xu(t){return LF(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}var jF={};gy(jF,{createAtomBlockMarkdownSpec:()=>FF,createBlockMarkdownSpec:()=>BF,createInlineMarkdownSpec:()=>qF,parseAttributes:()=>xy,parseIndentedBlocks:()=>Z1,renderNestedMarkdownContent:()=>Ey,serializeAttributes:()=>$y});function xy(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([\w-]+)/g);if(i){const c=i.map(d=>d.trim().slice(1));e.class=c.join(" ")}const s=r.match(/(?:^|\s)#([\w-]+)/);s&&(e.id=s[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,c,d])=>{var u;const f=parseInt(((u=d.match(/__QUOTED_(\d+)__/))==null?void 0:u[1])||"0",10),h=n[f];h&&(e[c]=h.slice(1,-1))});const l=r.replace(/(?:^|\s)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\w-]+)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}function $y(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function FF(t){const{nodeName:e,name:n,parseAttributes:r=xy,serializeAttributes:i=$y,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=t,l=n||e,c=d=>{if(!a)return d;const u={};return a.forEach(f=>{f in d&&(u[f]=d[f])}),u};return{parseMarkdown:(d,u)=>{const f={...s,...d.attributes};return u.createNode(e,f,[])},markdownTokenizer:{name:e,level:"block",start(d){var u;const f=new RegExp(`^:::${l}(?:\\s|$)`,"m"),h=(u=d.match(f))==null?void 0:u.index;return h!==void 0?h:-1},tokenize(d,u,f){const h=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=d.match(h);if(!p)return;const g=p[1]||"",v=r(g);if(!o.find(w=>!(w in v)))return{type:e,raw:p[0],attributes:v}}},renderMarkdown:d=>{const u=c(d.attrs||{}),f=i(u),h=f?` {${f}}`:"";return`:::${l}${h} :::`}}}function BF(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=xy,serializeAttributes:s=$y,defaultAttributes:o={},content:a="block",allowedAttributes:l}=t,c=n||e,d=u=>{if(!l)return u;const f={};return l.forEach(h=>{h in u&&(f[h]=u[h])}),f};return{parseMarkdown:(u,f)=>{let h;if(r){const g=r(u);h=typeof g=="string"?[{type:"text",text:g}]:g}else a==="block"?h=f.parseChildren(u.tokens||[]):h=f.parseInline(u.tokens||[]);const p={...o,...u.attributes};return f.createNode(e,p,h)},markdownTokenizer:{name:e,level:"block",start(u){var f;const h=new RegExp(`^:::${c}`,"m"),p=(f=u.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(u,f,h){var p;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),v=u.match(g);if(!v)return;const[b,w=""]=v,C=i(w);let x=1;const R=b.length;let O="";const T=/^:::([\w-]*)(\s.*)?/gm,S=u.slice(R);for(T.lastIndex=0;;){const _=T.exec(S);if(_===null)break;const A=_.index,$=_[1];if(!((p=_[2])!=null&&p.endsWith(":::"))){if($)x+=1;else if(x-=1,x===0){const E=S.slice(0,A);O=E.trim();const I=u.slice(0,R+A+_[0].length);let D=[];if(O)if(a==="block")for(D=h.blockTokens(E),D.forEach(B=>{B.text&&(!B.tokens||B.tokens.length===0)&&(B.tokens=h.inlineTokens(B.text))});D.length>0;){const B=D[D.length-1];if(B.type==="paragraph"&&(!B.text||B.text.trim()===""))D.pop();else break}else D=h.inlineTokens(O);return{type:e,raw:I,attributes:C,content:O,tokens:D}}}}}},renderMarkdown:(u,f)=>{const h=d(u.attrs||{}),p=s(h),g=p?` {${p}}`:"",v=f.renderChildren(u.content||[],`
249
250`);return`:::${c}${g}
251
252${v}
253
254:::`}}}function HF(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,s,o]=r;e[i]=s||o,r=n.exec(t)}return e}function zF(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function qF(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=HF,serializeAttributes:s=zF,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=t,c=n||e,d=f=>{if(!l)return f;const h={};return l.forEach(p=>{const g=typeof p=="string"?p:p.name,v=typeof p=="string"?void 0:p.skipIfDefault;if(g in f){const b=f[g];if(v!==void 0&&b===v)return;h[g]=b}}),h},u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,h)=>{const p={...o,...f.attributes};if(a)return h.createNode(e,p);const g=r?r(f):f.content||"";return g?h.createNode(e,p,[h.createTextNode(g)]):h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(f){const h=a?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),p=f.match(h),g=p==null?void 0:p.index;return g!==void 0?g:-1},tokenize(f,h,p){const g=a?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),v=f.match(g);if(!v)return;let b="",w="";if(a){const[,x]=v;w=x}else{const[,x,R]=v;w=x,b=R||""}const C=i(w.trim());return{type:e,raw:v[0],content:b.trim(),attributes:C}}},renderMarkdown:f=>{let h="";r?h=r(f):f.content&&f.content.length>0&&(h=f.content.filter(b=>b.type==="text").map(b=>b.text).join(""));const p=d(f.attrs||{}),g=s(p),v=g?` ${g}`:"";return a?`[${c}${v}]`:`[${c}${v}]${h}[/${c}]`}}}function Z1(t,e,n){var r,i,s,o;const a=t.split(`
255`),l=[];let c="",d=0;const u=e.baseIndentSize||2;for(;d<a.length;){const f=a[d],h=f.match(e.itemPattern);if(!h){if(l.length>0)break;if(f.trim()===""){d+=1,c=`${c}${f}
256`;continue}else return}const p=e.extractItemData(h),{indentLevel:g,mainContent:v}=p;c=`${c}${f}
257`;const b=[v];for(d+=1;d<a.length;){const R=a[d];if(R.trim()===""){const T=a.slice(d+1).findIndex(A=>A.trim()!=="");if(T===-1)break;if((((i=(r=a[d+1+T].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>g){b.push(R),c=`${c}${R}
258`,d+=1;continue}else break}if((((o=(s=R.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:o.length)||0)>g)b.push(R),c=`${c}${R}
259`,d+=1;else break}let w;const C=b.slice(1);if(C.length>0){const R=C.map(O=>O.slice(g+u)).join(`
260`);R.trim()&&(e.customNestedParser?w=e.customNestedParser(R):w=n.blockTokens(R))}const x=e.createToken(p,w);l.push(x)}if(l.length!==0)return{items:l,raw:c}}function Ey(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[s,...o]=t.content,a=e.renderChildren([s]);let l=`${i}${a}`;return o&&o.length>0&&o.forEach((c,d)=>{var u,f;const h=(f=(u=e.renderChild)==null?void 0:u.call(e,c,d+1))!=null?f:e.renderChildren([c]);if(h!=null){const p=h.split(`
261`).map(g=>g?e.indent(g):e.indent("")).join(`
262`);l+=c.type==="paragraph"?`
263
264${p}`:`
265${p}`}}),l}function W5(t,e){const n={...t};return Xu(t)&&Xu(e)&&Object.keys(e).forEach(r=>{Xu(e[r])&&Xu(t[r])?n[r]=W5(t[r],e[r]):n[r]=e[r]}),n}function UF(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,o=t;i.descendants((a,l)=>{const c=s.mapping.map(l),d=s.mapping.map(l)+a.nodeSize;let u=null;if(a.marks.forEach(h=>{if(h!==o)return!1;u=h}),!u)return;let f=!1;
265if(Object.keys(n).forEach(h=>{n[h]!==u.attrs[h]&&(f=!0)}),f){const h=t.type.create({...t.attrs,...n});s.removeMark(c,d,t.type),s.addMark(c,d,h)}}),s.docChanged&&e.view.dispatch(s)}var uu=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},VF=(t,e)=>{if(vy(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith),r.push(n.replaceWith)),r};function Yu(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1;const u=sF(c)+s;return o.forEach(f=>{if(d)return;const h=VF(u,f.find);if(!h)return;const p=h[0].length-s.length;if(p>0){const O=c.parentOffset-p;if(O<0||c.parent.textBetween(O,c.parentOffset)!==h[0].slice(0,p))return}const g=l.state.tr,v=Dp({state:l.state,transaction:g}),b={from:r-(h[0].length-s.length),to:i}
vendor: 4,878 bytes, lines 265-266
265,{commands:w,chain:C,can:x}=new Lp({editor:n,state:v});f.handler({state:v,range:b,match:h,commands:w,chain:C,can:x})===null||!g.steps.length||(f.undoable&&g.setMeta(a,{transform:g,from:r,to:i,text:s}),l.dispatch(g),d=!0)}),d}function WF(t){const{editor:e,rules:n}=t,r=new An({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=wy(Be.from(d),o.schema);const{from:u}=l,f=u+d.length;Yu({editor:e,from:u,to:f,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return Yu({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Yu({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Yu({editor:e,from:o.pos,to:o.pos,text:`
266`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Ty=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...an(bt(this,"addOptions",{name:this.name}))}}get storage(){return{...an(bt(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>W5(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},ja=class G5 extends Ty{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new G5(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=o.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},K5=class{constructor(t){this.find=t.find,this.handler=t.handler}},GF=(t,e,n)=>{if(vy(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith),s.push(i.replaceWith)),s}):[]};function KF(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:c,can:d}=new Lp({editor:e,state:n}),u=[];return n.doc.nodesBetween(r,i,(h,p)=>{var g,v,b,w,C;if((v=(g=h.type)==null?void 0:g.spec)!=null&&v.code||!(h.isText||h.isTextblock||h.isInline))return;const x=(C=(w=(b=h.content)==null?void 0:b.size)!=null?w:h.nodeSize)!=null?C:0,R=Math.max(r,p),O=Math.min(i,p+x);if(R>=O)return;const T=h.isText?h.text||"":h.textBetween(R-p,O-p,void 0,"");GF(T,s.find,o).forEach(_=>{if(_.index===void 0)return;const A=R+_.index+1,$=A+_[0].length,E={from:n.tr.mapping.map(A),to:n.tr.mapping.map($)},I=s.handler({state:n,range:E,match:_,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});u.push(I)})}),u.every(h=>h!==null)}var Ju=null,XF=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function YF(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:d,from:u,to:f,rule:h,pasteEvt:p})=>{const g=d.tr,v=Dp({state:d,transaction:g});if(!(!KF({editor:e,state:v,from:Math.max(u-1,0),to:f.b-1,rule:h,pasteEvent:p,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(d=>new An({view(u){const f=p=>{var g;r=(g=u.dom.parentElement)!=null&&g.contains(p.target)?u.dom.parentElement:null,r&&(Ju=e)},h=()=>{Ju&&(Ju=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(u,f)=>{if(s=r===u.dom.parentElement,a=f,!s){const h=Ju;h!=null&&h.isEditable&&setTimeout(()=>{const p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(u,f)=>{var h;const p=(h=f.clipboardData)==null?void 0:h.getData("text/html");return o=f,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(u,f,h)=>{const p=u[0],g=p.getMeta("uiEvent")==="paste"&&!i,v=p.getMeta("uiEvent")==="drop"&&!s,b=p.getMeta("applyPasteRules"),w=!!b;if(!g&&!v&&!w)return;if(w){let{text:R}=b;
266typeof R=="string"?R=R:R=wy(Be.from(R),h.schema);const{from:O}=b,T=O+R.length,S=XF(R);return l({rule:d,state:h,from:O,to:{b:T},pasteEvt:S})}const C=f.doc.content.findDiffStart(h.doc.content),x=f.doc.content.findDiffEnd(h.doc.content);if(!(!DF(C)||!x||C===x.b))return l({rule:d,state:h,from:C,to:x,pasteEvt:o})}}))}var Bp=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=j5(t),this.schema=Qj(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ec(e.name,this.schema)},r=bt(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Jc([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Ec(r.name,this.schema)},s=[],o=bt(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&bt(r,"exitable",i)&&(a.ArrowRight=()=>ja.handleExit({editor:t,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([h,p])=>[h,()=>p({editor:t})]));a={...a,...f}}const l=ZL(a);s.push(l);const c=bt(r,"addInputRules",i);if(ZC(r,t.options.enableInputRules)&&c){const f=c();if(f&&f.length){const h=WF({editor:t,rules:f}),p=Array.isArray(h)?h:[h];s.push(...p)}}const d=bt(r,"addPasteRules",i);if(ZC(r,t.options.enablePasteRules)&&d){const f=d();if(f&&f.length){const h=YF({editor:t,rules:f});s.push(...h)}}const u=bt(r,"addProseMirrorPlugins",i);if(u){const f=u();s.push(...f)}return s})}get attributes(){return L5(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=ql(this.extensions);return Object.fromEntries(e.filter(n=>!!bt(n,"addNodeView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:er(n.name,this.schema)},s=bt(n,"addNodeView",i);if(!s)return[];const o=s();if(!o)return[];const a=(l,c,d,u,f)=>{const h=xd(l,r);return o({node:l,view:c,getPos:d,decorations:u,innerDecorations:f,editor:t,extension:n,HTMLAttributes:h})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return Jc([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Ec(i.name,this.schema)},o=bt(i,"dispatchTransaction",s);return o?a=>{o.call(s,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Jc([...this.extensions]).reduce((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Ec(i.name,this.schema)},o=bt(i,"transformPastedHTML",s);return o?(a,l)=>{const c=r(a,l);return o.call(s,c)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=ql(this.extensions);return Object.fromEntries(e.filter(n=>!!bt(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Xs(n.name,this.schema)},s=bt(n,"addMarkView",i);if(!s)return[];const o=(a,l,c)=>{const d=xd(a,r);return s()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:d,updateAttributes:u=>{UF(a,t,u)}})};return[n.name,o]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n,r;const i={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ec(e.name,this.schema)};e.type==="mark"&&(((n=an(bt(e,"keepOnSplit",i)))==null||n)&&this.splittableMarks.push(e.name),(r=an(bt(e,"clearable",i)))==null||r||this.nonClearableMarks.push(e.name));const s=bt(e,"onBeforeCreate",i),o=bt(e,"onCreate",i),a=bt(e,"onUpdate",i),l=bt(e,"onSelectionUpdate",i),c=bt(e,"onTransaction",i),d=bt(e,"onFocus",
vendor: 9,944 bytes, lines 266-308
266i),u=bt(e,"onBlur",i),f=bt(e,"onDestroy",i);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}};Bp.resolve=j5;Bp.sort=Jc;Bp.flatten=yy;var JF={};gy(JF,{ClipboardTextSerializer:()=>Y5,Commands:()=>J5,Delete:()=>Q5,Drop:()=>Z5,Editable:()=>eE,FocusEvents:()=>nE,Keymap:()=>rE,Paste:()=>iE,Tabindex:()=>sE,TextDirection:()=>oE,focusEventsPluginKey:()=>tE});var Fn=class X5 extends Ty{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new X5(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Y5=Fn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new An({key:new sr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,s=B5(n),{blockSeparator:o}=this.options,a={...o!==void 0?{blockSeparator:o}:{},textSerializers:s};return[...i.ranges].sort((c,d)=>c.$from.pos-d.$from.pos).map(({$from:c,$to:d})=>F5(r,{from:c.pos,to:d.pos},a)).join(o??`
267
268`)}}})]}}),J5=Fn.create({name:"commands",addCommands(){return{...R5}}}),Q5=Fn.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const s=()=>{var o,a,l,c;if((c=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?c:t.getMeta("y-sync$"))return;const d=M5(t.before,[t,...e]);Sy(d).forEach(h=>{d.mapping.mapResult(h.oldRange.from).deletedAfter&&d.mapping.mapResult(h.oldRange.to).deletedBefore&&d.before.nodesBetween(h.oldRange.from,h.oldRange.to,(p,g)=>{const v=g+p.nodeSize-2,b=h.oldRange.from<=g&&v<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:g,to:v,newFrom:d.mapping.map(g),newTo:d.mapping.map(v),deletedRange:h.oldRange,newRange:h.newRange,partial:!b,editor:this.editor,transaction:t,combinedTransform:d})})});const f=d.mapping;d.steps.forEach((h,p)=>{var g,v;if(h instanceof Ui){const b=f.slice(p).map(h.from,-1),w=f.slice(p).map(h.to),C=f.invert().map(b,-1),x=f.invert().map(w),R=b>0?(g=d.doc.nodeAt(b-1))==null?void 0:g.marks.some(T=>T.eq(h.mark)):!1,O=(v=d.doc.nodeAt(w))==null?void 0:v.marks.some(T=>T.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:C,to:x},newRange:{from:b,to:w},partial:!!(O||R),editor:this.editor,transaction:t,combinedTransform:d})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),Z5=Fn.create({name:"drop",addProseMirrorPlugins(){return[new An({key:new sr("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),eE=Fn.create({name:"editable",addProseMirrorPlugins(){return[new An({key:new sr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),tE=new sr("focusEvents"),nE=Fn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new An({key:tE,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),rE=Fn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:u}=l,{pos:f,parent:h}=u,p=u.parent.isTextblock&&f>0?a.doc.resolve(f-1):u,g=p.parent.type.spec.isolating,v=u.pos-u.parentOffset,b=g&&p.parent.childCount===1?v===u.pos:Dt.atStart(c).from===f;return!d||!h.type.isTextblock||h.textContent.length||!b||b&&u.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return gh()||_5()?s:i},addProseMirrorPlugins(){return[new An({key:new sr("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=Dt.atStart(e.doc).from,c=Dt.atEnd(e.doc).to;if(s||!(o===l&&a===c)||!du(n.doc))return;const f=n.tr,h=Dp({state:n,transaction:f}),{commands:p}=new Lp({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),iE=Fn.create({name:"paste",addProseMirrorPlugins(){return[new An({key:new sr("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),sE=Fn.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new An({key:new sr("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),oE=Fn.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=ql(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new An({key:new sr("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),QF=class Lc{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0)return;n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Lc(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Lc(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Lc(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=n.isInline,a=this.pos+r+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!i&&!o&&l.depth<=this.depth)return;const c=new Lc(l,this.editor,i,i||o?n:null);i&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},ZF=`.ProseMirror {
269  position: relative;
270}
271
272.ProseMirror {
273  word-wrap: break-word;
274  white-space: pre-wrap;
275  white-space: break-spaces;
276  -webkit-font-variant-ligatures: none;
277  font-variant-ligatures: none;
278  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
279}
280
281.ProseMirror [contenteditable="false"] {
282  white-space: normal;
283}
284
285.ProseMirror [contenteditable="false"] [contenteditable="true"] {
286  white-space: pre-wrap;
287}
288
289.ProseMirror pre {
290  white-space: pre-wrap;
291}
292
293img.ProseMirror-separator {
294  display: inline !important;
295  border: none !important;
296  margin: 0 !important;
297  width: 0 !important;
298  height: 0 !important;
299}
300
301.ProseMirror-gapcursor {
302  display: none;
303  pointer-events: none;
304  position: absolute;
305  margin: 0;
306}
307
308.ProseMirror-gapcursor:after {
309  content: "";
310  display: block;
311  position: absolute;
312  top: -2px;
313  width: 20px;
314  border-top: 1px solid black;
315  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
316}
317
318@keyframes ProseMirror-cursor-blink {
319  to {
320    visibility: hidden;
321  }
322}
323
324.ProseMirror-hideselection *::selection {
325  background: transparent;
326}
327
328.ProseMirror-hideselection *::-moz-selection {
329  background: transparent;
330}
331
332.ProseMirror-hideselection * {
333  caret-color: transparent;
334}
335
336.ProseMirror-focused .ProseMirror-gapcursor {
337  display: block;
338}`,eB=class extends _F{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:cF,createMappablePosition:dF},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const n=Y1(e,this.options.autofocus);this.editorState=ma.create({doc:e,schema:this.schema,selection:n||void 0})}this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch{}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=MF(ZF,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=D5(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>
338{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(o=>!o.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;const s=[...this.options.enableCoreExtensions?[eE,Y5.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),J5,nE,rE,sE.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),Z5,iE,Q5,oE.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new Bp(s,this)}createCommandManager(){this.commandManager=new Lp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=J1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const n=J1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=ma.create({doc:n,schema:this.schema,selection:Y1(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(s);this.editorView=new E5(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(c)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),l=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return H5(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return oF(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}
vendor: 2,689 bytes, lines 338-340
338getHTML(){return wy(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
339
340`,textSerializers:n={}}=t||{};return eF(this.state.doc,{blockSeparator:e,textSerializers:{...B5(this.schema),...n}})}get isEmpty(){return du(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new QF(e,this,!1,n)}get $doc(){return this.$pos(0)}};function Da(t){return new uu({find:t.find,handler:({state:e,range:n,match:r})=>{const i=an(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),c=n.from+a.indexOf(o),d=c+o.length;if(Cy(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;d<n.to&&s.delete(d,n.to),c>n.from&&s.delete(n.from+l,c);const f=n.from+l+o.length;s.addMark(n.from+l,f,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function tB(t){return new uu({find:t.find,handler:({state:e,range:n,match:r})=>{const i=an(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=o+c;d>a?d=a:a=d+r[1].length;const u=r[0][r[0].length-1];s.insertText(u,o+r[0].length-1),s.replaceWith(d,a,l)}else if(r[0]){const c=t.type.isInline?o:o-1;s.insert(c,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:t.undoable})}function ev(t){return new uu({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=an(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function Ul(t){return new uu({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=an(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),c=l&&ty(l,t.type,s);if(!c)return null;if(o.wrap(l,c),t.keepMarks&&t.editor){const{selection:u,storedMarks:f}=e,{splittableMarks:h}=t.editor.extensionManager,p=f||u.$to.parentOffset&&u.$from.marks();if(p){const g=p.filter(v=>
340h.includes(v.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Uo(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)},undoable:t.undoable})}var hi=class aE extends Ty{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new aE(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function jo(t){return new K5({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=an(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const d=l.search(/\S/),u=n.from+l.indexOf(a),f=u+a.length;if(Cy(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(b=>b===t.type&&b!==g.mark.type)).filter(g=>g.to>u).length)return null;f<n.to&&o.delete(f,n.to),u>n.from&&o.delete(n.from+d,u),c=n.from+d+a.length,o.addMark(n.from+d,c,t.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(t.type)}}})}const nB="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
340ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",rB="ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
340ºÐ´2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3Õ°Õ¡Õµ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1ì»´2삼성2한국2",tv="numeric",nv="ascii",rv="alpha",Qc="asciinumeric",jc="alphanumeric",iv="domain",lE="emoji",iB="scheme",sB="slashscheme",sg="whitespace";function oB(t,e){return t in e||(e[t]=[]),e[t]}function ya(t,e,n){e[tv]&&(e[Qc]=!0,e[jc]=!0),e[nv]&&(e[Qc]=!0,e[rv]=!0),e[Qc]&&(e[jc]=!0),e[rv]&&(e[jc]=!0),e[jc]&&(e[iv]=!0),e[lE]&&(e[iv]=!0);for(const r in e){const i=oB(r,n);i.indexOf(t)<0&&i.push(t)}}function aB(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Vr(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Vr.groups={};Vr.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||Vr.groups;let i;return e&&e.j?i=e:(i=new Vr(e),n&&r&&ya(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(t[o]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||Vr.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let o,a=i.go(t);if(a?(o=new Vr,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new Vr,s){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(aB(o.t,r),n);ya(s,l,r)}else n&&ya(s,n,r);o.t=s}return i.j[t]=o,o}};const Lt=(t,e,n,r,i)=>t.ta(e,n,r,i),Dn=(t,e,n,r,i)=>t.tr(e,n,r,i),n3=(t,e,n,r,i)=>t.ts(e,n,r,i),qe=(t,e,n,r,i)=>t.tt(e,n,r,i),Ms="WORD",sv="UWORD",cE="ASCIINUMERICAL",dE="ALPHANUMERICAL",$d="LOCALHOST",ov="TLD",av="UTLD",kf="SCHEME",bl="SLASH_SCHEME",Ry="NUM",lv="WS",Iy="NL",Zc="OPENBRACE",ed="CLOSEBRACE",vh="OPENBRACKET",bh="CLOSEBRACKET",yh="OPENPAREN",wh="CLOSEPAREN",Sh="OPENANGLEBRACKET",Ch="CLOSEANGLEBRACKET",xh="FULLWIDTHLEFTPAREN",$h="FULLWIDTHRIGHTPAREN",Eh="LEFTCORNERBRACKET",Th="RIGHTCORNERBRACKET",Rh="LEFTWHITECORNERBRACKET",Ih="RIGHTWHITECORNERBRACKET",Ah="FULLWIDTHLESSTHAN",Oh="FULLWIDTHGREATERTHAN",kh="AMPERSAND",Nh="APOSTROPHE",_h="ASTERISK",go="AT",Ph="BACKSLASH",Mh="BACKTICK",Dh="CARET",wa="COLON",Ay="COMMA",Lh="DOLLAR",ls="DOT",jh="EQUALS",Oy="EXCLAMATION",xi="HYPHEN",td="PERCENT",Fh="PIPE",Bh="PLUS",Hh="POUND",nd="QUERY",ky="QUOTE",uE="FULLWIDTHMIDDLEDOT",Ny="SEMI",cs="SLASH",rd="TILDE",zh="UNDERSCORE",fE="EMOJI",qh="SYM";var hE=Object.freeze({__proto__:null,ALPHANUMERICAL:dE,AMPERSAND:kh,APOSTROPHE:Nh,ASCIINUMERICAL:cE,ASTERISK:_h,AT:go,BACKSLASH:Ph,BACKTICK:Mh,CARET:Dh,CLOSEANGLEBRACKET:Ch,CLOSEBRACE:ed,CLOSEBRACKET:bh,CLOSEPAREN:wh,COLON:wa,COMMA:Ay,DOLLAR:Lh,DOT:ls,EMOJI:fE,EQUALS:jh,EXCLAMATION:Oy,FULLWIDTHGREATERTHAN:Oh,FULLWIDTHLEFTPAREN:xh,FULLWIDTHLESSTHAN:Ah,FULLWIDTHMIDDLEDOT:uE,FULLWIDTHRIGHTPAREN:$h,HYPHEN:xi,LEFTCORNERBRACKET:Eh,LEFTWHITECORNERBRACKET:Rh,LOCALHOST:$d,NL:Iy,NUM:Ry,OPENANGLEBRACKET:Sh,OPENBRACE:Zc,OPENBRACKET:vh,OPENPAREN:yh,PERCENT:td,PIPE:Fh,PLUS:Bh,POUND:Hh,QUERY:nd,QUOTE:ky,RIGHTCORNERBRACKET:Th,RIGHTWHITECORNERBRACKET:Ih,SCHEME:kf,SEMI:Ny,SLASH:cs,SLASH_SCHEME:bl,SYM:qh,TILDE:rd,TLD:ov,UNDERSCORE:zh,UTLD:av,UWORD:sv,WORD:Ms,WS:lv});const ks=/[a-z]/,Tc=new RegExp("\\p{L}","u"),og=new RegExp("\\p{Emoji}","u"),Ns=/\d/,ag=/\s/,r3="\r",lg=`
341`,lB="️",cB="‍",cg="";let Qu=null,Zu=null;function dB(t=[]){const e={};Vr.groups=e;const n=new Vr;
vendor: 9,122 bytes, lines 341-344
341Qu==null&&(Qu=i3(nB)),Zu==null&&(Zu=i3(rB)),qe(n,"'",Nh),qe(n,"{",Zc),qe(n,"}",ed),qe(n,"[",vh),qe(n,"]",bh),qe(n,"(",yh),qe(n,")",wh),qe(n,"<",Sh),qe(n,">",Ch),qe(n,"(",xh),qe(n,")",$h),qe(n,"「",Eh),qe(n,"」",Th),qe(n,"『",Rh),qe(n,"』",Ih),qe(n,"<",Ah),qe(n,">",Oh),qe(n,"&",kh),qe(n,"*",_h),qe(n,"@",go),qe(n,"`",Mh),qe(n,"^",Dh),qe(n,":",wa),qe(n,",",Ay),qe(n,"$",Lh),qe(n,".",ls),qe(n,"=",jh),qe(n,"!",Oy),qe(n,"-",xi),qe(n,"%",td),qe(n,"|",Fh),qe(n,"+",Bh),qe(n,"#",Hh),qe(n,"?",nd),qe(n,'"',ky),qe(n,"/",cs),qe(n,";",Ny),qe(n,"~",rd),qe(n,"_",zh),qe(n,"\\",Ph),qe(n,"・",uE);const r=Dn(n,Ns,Ry,{[tv]:!0});Dn(r,Ns,r);const i=Dn(r,ks,cE,{[Qc]:!0}),s=Dn(r,Tc,dE,{[jc]:!0}),o=Dn(n,ks,Ms,{[nv]:!0});Dn(o,Ns,i),Dn(o,ks,o),Dn(i,Ns,i),Dn(i,ks,i);const a=Dn(n,Tc,sv,{[rv]:!0});Dn(a,ks),Dn(a,Ns,s),Dn(a,Tc,a),Dn(s,Ns,s),Dn(s,ks),Dn(s,Tc,s);const l=qe(n,lg,Iy,{[sg]:!0}),c=qe(n,r3,lv,{[sg]:!0}),d=Dn(n,ag,lv,{[sg]:!0});qe(n,cg,d),qe(c,lg,l),qe(c,cg,d),Dn(c,ag,d),qe(d,r3),qe(d,lg),Dn(d,ag,d),qe(d,cg,d);const u=Dn(n,og,fE,{[lE]:!0});qe(u,"#"),Dn(u,og,u),qe(u,lB,u);const f=qe(u,cB);qe(f,"#"),Dn(f,og,u);const h=[[ks,o],[Ns,i]],p=[[ks,null],[Tc,a],[Ns,s]];for(let g=0;g<Qu.length;g++)oo(n,Qu[g],ov,Ms,h);for(let g=0;g<Zu.length;g++)oo(n,Zu[g],av,sv,p);ya(ov,{tld:!0,ascii:!0},e),ya(av,{utld:!0,alpha:!0},e),oo(n,"file",kf,Ms,h),oo(n,"mailto",kf,Ms,h),oo(n,"http",bl,Ms,h),oo(n,"https",bl,Ms,h),oo(n,"ftp",bl,Ms,h),oo(n,"ftps",bl,Ms,h),ya(kf,{scheme:!0,ascii:!0},e),ya(bl,{slashscheme:!0,ascii:!0},e),t=t.sort((g,v)=>g[0]>v[0]?1:-1);for(let g=0;g<t.length;g++){const v=t[g][0],w=t[g][1]?{[iB]:!0}:{[sB]:!0};v.indexOf("-")>=0?w[iv]=!0:ks.test(v)?Ns.test(v)?w[Qc]=!0:w[nv]=!0:w[tv]=!0,n3(n,v,v,w)}return n3(n,"localhost",$d,{ascii:!0}),n.jd=new Vr(qh),{start:n,tokens:Object.assign({groups:e},hE)}}function pE(t,e){const n=uB(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o<r;){let a=t,l=null,c=0,d=null,u=-1,f=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(u=0,f=0,d=a):u>=0&&(u+=n[o].length,f++),c+=n[o].length,s+=n[o].length,o++;s-=u,o-=f,c-=u,i.push({t:d.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function uB(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,o=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function oo(t,e,n,r,i){let s;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];t.j[l]?s=t.j[l]:(s=new Vr(r),s.jr=i.slice(),t.j[l]=s),t=s}return s=new Vr(n),s.jr=i.slice(),t.j[e[o-1]]=s,s}function i3(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Ed={defaultProtocol:"http",events:null,format:s3,formatHref:s3,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function _y(t,e=null){let n=Object.assign({},Ed);t&&(n=Object.assign(n,t instanceof _y?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}_y.prototype={o:Ed,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Ed[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function s3(t){return t}function mE(t,e){this.t="token",this.v=t,this.tk=e}mE.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ed.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),d&&Object.assign(o,d),{tagName:i,attributes:o,content:s,eventListeners:u}}};function Hp(t,e){class n extends mE{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const fB=Hp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),o3=Hp("text"),hB=Hp("nl"),ef=Hp("url",{isLink:!0,toHref(t=Ed.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==$d&&t[1].t===wa}}),wi=t=>new Vr(t);function pB({groups:t}){const e=t.domain.concat([kh,_h,go,Ph,Mh,Dh,Lh,jh,xi,Ry,td,Fh,Bh,Hh,cs,qh,rd,zh]),n=[Nh,wa,Ay,ls,Oy,td,nd,ky,Ny,Sh,Ch,Zc,ed,bh,vh,yh,wh,xh,$h,Eh,Th,Rh,Ih,Ah,Oh],r=[kh,Nh,_h,Ph,Mh,Dh,Lh,jh,xi,Zc,ed,td,Fh,Bh,Hh,nd,cs,qh,rd,zh],i=wi(),s=qe(i,rd);Lt(s,r,s),Lt(s,t.domain,s);const o=wi(),a=wi(),l=wi();Lt(i,t.domain,o),Lt(i,t.scheme,a),Lt(i,t.slashscheme,l),Lt(o,r,s),Lt(o,t.domain,o);const c=qe(o,go);qe(s,go,c),qe(a,go,c),qe(l,go,c);const d=qe(s,ls);Lt(d,r,s),Lt(d,t.domain,s);const u=wi();Lt(c,t.domain,u),Lt(u,t.domain,u);const f=qe(u,ls);Lt(f,t.domain,u);const h=wi(fB);Lt(f,t.tld,h),Lt(f,t.utld,h),qe(c,$d,h);const p=qe(u,xi);qe(p,xi,p),Lt(p,t.domain,u),Lt(h,t.domain,u),qe(h,ls,f),qe(h,xi,p);const g=qe(o,xi),v=qe(o,ls);qe(g,xi,g),Lt(g,t.domain,o),Lt(v,r,s),Lt(v,t.domain,o);const b=wi(ef);Lt(v,t.tld,b),Lt(v,t.utld,b),Lt(b,t.domain,o),Lt(b,r,s),qe(b,ls,v),qe(b,xi,g),qe(b,go,c);const w=qe(b,wa),C=wi(ef);Lt(w,t.numeric,C);const x=wi(ef),R=wi();Lt(x,e,x),Lt(x,n,R),Lt(R,e,x),Lt(R,n,R),qe(b,cs,x),qe(C,cs,x);const O=qe(a,wa),T=qe(l,wa),S=qe(T,cs),_=qe(S,cs);Lt(a,t.domain,o),qe(a,ls,v),qe(a,xi,g),Lt(l,t.domain,o),qe(l,ls,v),qe(l,xi,g),Lt(O,t.domain,x),qe(O,cs,x),qe(O,nd,x),Lt(_,t.domain,x),Lt(_,e,x),qe(_,cs,x);const A=[[Zc,ed],[vh,bh],[yh,wh],[Sh,Ch],[xh,$h],[Eh,Th],[Rh,Ih],[Ah,Oh]];for(let $=0;$<A.length;$++){const[E,I]=A[$],D=qe(x,E);qe(R,E,D);const B=wi(ef);Lt(D,e,B);const j=wi();Lt(D,n,j),qe(D,I,x),Lt(B,e,B),Lt(B,n,j),Lt(j,e,B),Lt(j,n,j),qe(B,I,x),qe(j,I,x)}return qe(i,$d,b),qe(i,Iy,hB),{start:i,tokens:hE}}function mB(t,e,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let a=t,l=null,c=null,d=0,u=null,f=-1;for(;i<r&&!(l=a.go(n[i].t));)o.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,a=c,a.accepts()?(f=0,u=a):f>=0&&f++,i++,d++;if(f<0)i-=d,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push(dg(o3,e,o)),o=[]),i-=f,d-=f;const h=u.t,p=n.slice(i-d,i);s.push(dg(h,e,p))}}return o.length>0&&s.push(dg(o3,e,o)),s}function dg(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const gB=typeof console<"u"&&console&&console.warn||(()=>{}),vB="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",$n={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function bB(){return Vr.groups={},$n.scanner=null,$n.parser=null,$n.tokenQueue=[],$n.pluginQueue=[],$n.customSchemes=[],$n.initialized=!1,$n}function a3(t,e=!1){if($n.initialized&&gB(`linkifyjs: already initialized - will not register custom scheme "${t}" ${vB}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
3421. Must only contain digits, lowercase ASCII letters or "-"
3432. Cannot start or end with "-"
3443. "-" cannot repeat`);$n.customSchemes.push([t,e])}function yB(){$n.scanner=dB($n.customSchemes);for(let t=0;t<$n.tokenQueue.length;t++)$n.tokenQueue[t][1]({scanner:$n.scanner});$n.parser=pB($n.scanner.tokens);for(let t=0;t<$n.pluginQueue.length;t++)$n.pluginQueue[t][1]({scanner:$n.scanner,parser:$n.parser});return $n.initialized=!0,$n}function Py(t){return $n.initialized||yB(),mB($n.parser.start,t,pE($n.scanner.start,t))}Py.scan=pE;function gE(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new _y(n),i=Py(t),s=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}var My="[\0-   ᠎ -\u2029  ]",wB=new RegExp(My),SB=new RegExp(`${My}$`),CB=new RegExp(My,"g");function xB(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function $B(t){return new An({key:new sr("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(c=>
344c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=M5(n.doc,[...e]);if(Sy(a).forEach(({newRange:c})=>{const d=Gj(r.doc,c,h=>h.isTextblock);let u,f;if(d.length>1)u=d[0],f=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!SB.test(h))return;u=d[0],f=r.doc.textBetween(u.pos,c.to,void 0," ")}if(u&&f){const h=f.split(wB).filter(Boolean);if(h.length<=0)return!1;const p=h[h.length-1],g=u.pos+f.lastIndexOf(p);if(!p)return!1;const v=Py(p).map(b=>b.toObject(t.defaultProtocol));if(!xB(v))return!1;v.filter(b=>b.isLink).map(b=>({...b,from:g+b.start+1,to:g+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{Cy(b.from,b.to,r.doc).some(w=>w.mark.type===t.type)||o.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function EB(t){return new An({key:new sr("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const l=r.target;if(!l)return!1;const c=t.editor.view.dom;o=l.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const l=H5(e.state,t.type.name),c=(i=o.href)!=null?i:l.href,d=(s=o.target)!=null?s:l.target;c&&(window.open(c,d),a=!0)}return a}}})}var TB=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,RB=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function vE(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function IB(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&vE(t,r)){r+=1;continue}let i=0;for(;r<e&&t[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function bE(t,e,n){var r,i;const[,s,o]=e;return(e.index?t[e.index-1]:void 0)==="!"||vE(t,(r=e.index)!=null?r:0)||IB(t,(i=e.index)!=null?i:0)?!1:!!s.trim()&&n(o)}function yE(t){var e,n;const[r,i,s,,o,a,l]=t,c=(e=o??a)!=null?e:l;return{index:(n=t.index)!=null?n:0,text:r,replaceWith:i,data:{href:s,title:c||null,markdown:!0}}}function AB(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function wE(t){var e,n,r;return{href:(e=t.data)==null?void 0:e.href,title:(r=(n=t.data)==null?void 0:n.title)!=null?r:null}}function OB(t){const e=Da({find:n=>{const r=TB.exec(n);return!r||!bE(n,r,t.isAllowedHref)?null:yE(r)},type:t.type,getAttributes:wE});return new uu({find:e.find,handler:n=>{const r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function kB(t){const e=jo({find:n=>{var r,i;const s=[];for(const a of n.matchAll(RB))bE(n,a,t.isAllowedHref)&&s.push(yE(a));const o=((i=(r=t.findPlainUrls)==null?void 0:r.call(t,n))!=null?i:[]).filter(a=>!s.some(l=>AB(l,a)));return[...s,...o]},type:t.type,getAttributes:wE});return new K5({find:e.find,handler:n=>{var r;const i=e.handler(n);return i!==null&&n.state.tr.steps.length&&((r=n.match.data)!=null&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),i}})}function NB(t){return new An({key:new sr("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:o}=s,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const c=gE(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c||i!==void 0&&!i(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function _s(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(CB,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var SE=ja.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate),this.options.protocols.forEac
344h(t=>{if(typeof t=="string"){a3(t);return}a3(t.scheme,t.optionalSlashes)})},onDestroy(){bB()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!_s(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){var t,e,n;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!=null?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!=null?e:null},class:{default:(n=this.options.HTMLAttributes.class)!=null?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!_s(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!_s(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",rr(this.options.HTMLAttributes,t),0]:["a",rr(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,i,s;const o=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",a=(s=(i=t.attrs)==null?void 0:i.title)!=null?s:"",l=e.renderChildren(t);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!_s(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!_s(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[OB({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!_s(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const n=[];if(e){const{protocols:r,defaultProtocol:i}=this.options;gE(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a=>!!_s(a,r),protocols:r,defaultProtocol:i})).forEach(o=>{this.options.shouldAutoLink(o.value)&&n.push({text:o.value,data:{href:o.href},index:o.start})})}return n};return this.options.markdownLinks?[kB({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!_s(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[jo({find:t,type:this.type,getAttributes:e=>{var n;return{href:(n=e.data)==null?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push($B({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!_s(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(EB({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(NB({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.t
vendor: 4,333 bytes, line 344
344ype,shouldAutoLink:this.options.shouldAutoLink})),t}}),_B=SE,CE=JR();const{getOwnPropertyNames:PB,getOwnPropertySymbols:MB}=Object,{hasOwnProperty:DB}=Object.prototype;function ug(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function tf(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);const{cache:s}=i,o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);const l=t(n,r,i);return s.delete(n),s.delete(r),l}}function LB(t){return t!=null?t[Symbol.toStringTag]:void 0}function l3(t){return PB(t).concat(MB(t))}const jB=Object.hasOwn||((t,e)=>DB.call(t,e));function Fa(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const FB="__v",BB="__o",HB="_owner",{getOwnPropertyDescriptor:c3,keys:d3}=Object;function zB(t,e){return t.byteLength===e.byteLength&&Uh(new Uint8Array(t),new Uint8Array(e))}function qB(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function UB(t,e){return t.byteLength===e.byteLength&&Uh(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function VB(t,e){return Fa(t.getTime(),e.getTime())}function WB(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function GB(t,e){return t===e}function u3(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.entries();let o,a,l=0;for(;(o=s.next())&&!o.done;){const c=e.entries();let d=!1,u=0;for(;(a=c.next())&&!a.done;){if(i[u]){u++;continue}const f=o.value,h=a.value;if(n.equals(f[0],h[0],l,u,t,e,n)&&n.equals(f[1],h[1],f[0],h[0],t,e,n)){d=i[u]=!0;break}u++}if(!d)return!1;l++}return!0}const KB=Fa;function XB(t,e,n){const r=d3(t);let i=r.length;if(d3(e).length!==i)return!1;for(;i-- >0;)if(!xE(t,e,n,r[i]))return!1;return!0}function Rc(t,e,n){const r=l3(t);let i=r.length;if(l3(e).length!==i)return!1;let s,o,a;for(;i-- >0;)if(s=r[i],!xE(t,e,n,s)||(o=c3(t,s),a=c3(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function YB(t,e){return Fa(t.valueOf(),e.valueOf())}function JB(t,e){return t.source===e.source&&t.flags===e.flags}function f3(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.values();let o,a;for(;(o=s.next())&&!o.done;){const l=e.values();let c=!1,d=0;for(;(a=l.next())&&!a.done;){if(!i[d]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){c=i[d]=!0;break}d++}if(!c)return!1}return!0}function Uh(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function QB(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function xE(t,e,n,r){return(r===HB||r===BB||r===FB)&&(t.$$typeof||e.$$typeof)?!0:jB(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const ZB="[object ArrayBuffer]",eH="[object Arguments]",tH="[object Boolean]",nH="[object DataView]",rH="[object Date]",iH="[object Error]",sH="[object Map]",oH="[object Number]",aH="[object Object]",lH="[object RegExp]",cH="[object Set]",dH="[object String]",uH={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},fH="[object URL]",hH=Object.prototype.toString;function pH({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:p}){return function(v,b,w){if(v===b)return!0;if(v==null||b==null)return!1;const C=typeof v;if(C!==typeof b)return!1;if(C!=="object")return C==="number"?a(v,b,w):C==="function"?s(v,b,w):!1;const x=v.constructor;if(x!==b.constructor)return!1;if(x===Object)return l(v,b,w);if(Array.isArray(v))return e(v,b,w);if(x===Date)return r(v,b,w);if(x===RegExp)return d(v,b,w);if(x===Map)return o(v,b,w);if(x===Set)return u(v,b,w);const R=hH.call(v);
344if(R===rH)return r(v,b,w);if(R===lH)return d(v,b,w);if(R===sH)return o(v,b,w);if(R===cH)return u(v,b,w);if(R===aH)return typeof v.then!="function"&&typeof b.then!="function"&&l(v,b,w);if(R===fH)return h(v,b,w);if(R===iH)return i(v,b,w);if(R===eH)return l(v,b,w);if(uH[R])return f(v,b,w);if(R===ZB)return t(v,b,w);if(R===nH)return n(v,b,w);if(R===tH||R===oH||R===dH)return c(v,b,w);if(p){let O=p[R];if(!O){const T=LB(v);T&&(O=p[T])}if(O)return O(v,b,w)}return!1}}function mH({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:zB,areArraysEqual:n?Rc:qB,areDataViewsEqual:UB,areDatesEqual:VB,areErrorsEqual:WB,areFunctionsEqual:GB,areMapsEqual:n?ug(u3,Rc):u3,areNumbersEqual:KB,areObjectsEqual:n?Rc:XB,arePrimitiveWrappersEqual:YB,areRegExpsEqual:JB,areSetsEqual:n?ug(f3,Rc):f3,areTypedArraysEqual:n?ug(Uh,Rc):Uh,areUrlsEqual:QB,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const i=tf(r.areArraysEqual),s=tf(r.areMapsEqual),o=tf(r.areObjectsEqual),a=tf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:a})}return r}function gH(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function vH({circular:t,comparator:e,createState:n,equals:r,strict:i}){if(n)return function(a,l){const{cache:c=t?new WeakMap:void 0,meta:d}=n();return e(a,l,{cache:c,equals:r,meta:d,strict:i})};if(t)return function(a,l){return e(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,l){return e(a,l,s)}}const bH=Wo();Wo({strict:!0});Wo({circular:!0});Wo({circular:!0,strict:!0});Wo({createInternalComparator:()=>Fa});Wo({strict:!0,createInternalComparator:()=>Fa});Wo({circular:!0,createInternalComparator:()=>Fa});Wo({circular:!0,createInternalComparator:()=>Fa,strict:!0});function Wo(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:i=!1}=t,s=mH(t),o=pH(s),a=n?n(o):gH(o);return vH({circular:e,comparator:o,createState:r,equals:a,strict:i})}var yH=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},wH=({contentComponent:t})=>{const e=CE.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return N.jsx(N.Fragment,{children:Object.values(e)})};function SH(){const t=new Set;let e={},n=!1;const r=()=>{n||!t.size||(n=!0,queueMicrotask(()=>{n=!1,t.forEach(i=>i())}))};return{subscribe(i){return t.add(i),()=>{t.delete(i)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(i,s){e={...e,[i]:l1.createPortal(s.reactElement,s.element,i)},r()},removeRenderer(i){const s={...e};delete s[i],e=s,r()}}}var CH=class extends Te.Component{constructor(t){super(t),this.editorContentRef=Te.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=SH(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return N.jsxs(N.Fragment,{children:[N.jsx("div",{ref:yH(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&N.jsx(wH,{contentComponent:t.contentComponent})]})}},xH=m.forwardRef((t,e)=>{const n=Te.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Te.createElement(CH,{key:n,innerRef:e,...t})}),$E=Te.memo(xH),$H=typeof window<"u"?m.useLayoutEffect:m.useEffect,EH=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0}
344,this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let e;const n=i=>{(i==null?void 0:i.transaction)!==void 0&&i.transaction===e||(e=i==null?void 0:i.transaction,this.transactionNumber+=1,this.subscribers.forEach(s=>s()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function TH(t){var e;const[n]=m.useState(()=>new EH(t.editor)),r=QR.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:bH);return $H(()=>n.watch(t.editor),[t.editor,n]),m.useDebugValue(r),r}var RH=!1,EE=typeof window>"u",IH=EE||!!(typeof window<"u"&&window.next),AH=class TE{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return(EE||IH&&e===void 0)&&(n=!1),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...r)},onDelete:(...r)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...r)},onMount:(...r)=>{var i,s;return(s=(i=this.options.current).onMount)==null?void 0:s.call(i,...r)},onUnmount:(...r)=>{var i,s;return(s=(i=this.options.current).onUnmount)==null?void 0:s.call(i,...r)}};return new eB(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=n.extensions)==null?void 0:o[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?TE.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}
344):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function OH(t={},e=[]){const n=m.useRef(t);n.current=t;const[r]=m.useState(()=>new AH(n)),i=CE.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return m.useDebugValue(i),m.useEffect(r.onRender(e)),TH({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),i}var RE=m.createContext({editor:null});RE.Consumer;var kH=m.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),NH=()=>m.useContext(kH);Te.forwardRef((t,e)=>{const{onDragStart:n}=NH(),r=t.as||"div";return N.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});Te.createContext({markViewContentRef:()=>{}});var Dy=m.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Dy.displayName="TiptapContext";var _H=()=>m.useContext(Dy);function IE({children:t,...e}){const n="editor"in e?e.editor:e.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=m.useMemo(()=>({editor:n}),[n]),i=m.useMemo(()=>({editor:n}),[n]);return N.jsx(RE.Provider,{value:i,children:N.jsx(Dy.Provider,{value:r,children:t})})}IE.displayName="Tiptap";function AE({...t}){const{editor:e}=_H();return N.jsx($E,{editor:e,...t})}AE.displayName="Tiptap.Content";Object.assign(IE,{Content:AE});var Vh=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},PH=(t,e)=>{var n;const{state:r,view:i}=t,{selection:s}=r;if(!s.empty)return!1;const{$from:o}=s;if(o.parentOffset!==0)return!1;const a=o.depth-1;if(a<0)return!1;const l=o.node(a),c=o.index(a);if(c===0)return!1;if(l.type===e)return t.commands.lift(e.name);const d=l.child(c-1);if(d.type!==e||!((n=d.lastChild)!=null&&n.isTextblock))return!1;const u=o.before(),h=u-1-1,{tr:p}=r;return p.delete(u,o.after()).insert(h,o.parent.content),p.setSelection(xt.create(p.doc,h)),i.dispatch(p.scrollIntoView()),!0},MH=/^\s*>\s$/,DH=hi.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Vh("blockquote",{...rr(this.options.HTMLAttributes,t),children:Vh("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((i,s)=>{var o,a;const d=((a=(o=e.renderChild)==null?void 0:o.call(e,i,s))!=null?a:e.renderChildren([i])).split(`
345`).map(u=>u.trim()===""?n:`${n} ${u}`);r.push(d.join(`
346`))}),r.join(`
347${n}
348`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>PH(this.editor,this.type)}}
vendor: 2,310 bytes, line 348
348,addInputRules(){return[Ul({find:MH,type:this.type})]}}),LH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,jH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,FH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,BH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,HH=ja.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Vh("strong",{...rr(this.options.HTMLAttributes,t),children:Vh("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Da({find:LH,type:this.type}),Da({find:FH,type:this.type})]},addPasteRules(){return[jo({find:jH,type:this.type}),jo({find:BH,type:this.type})]}}),zH=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},qH=t=>{const e=/`([^`]+)`(?!`)/g,n=[];let r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},UH=ja.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",rr(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}}
vendor: 7,261 bytes, lines 348-369
348,addInputRules(){return[Da({find:zH,type:this.type})]},addPasteRules(){return[jo({find:qH,type:this.type})]}}),fg=4,VH=/^```([a-z]+)?[\s\n]$/,WH=/^~~~([a-z]+)?[\s\n]$/,GH=hi.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:fg,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",rr(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const i=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
349`):r=`\`\`\`${i}
350
351\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:fg,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?t.commands.insertContent(a):t.commands.command(({tr:l})=>{const{from:c,to:d}=i,h=r.doc.textBetween(c,d,`
352`,`
353`).split(`
354`).map(p=>a+p).join(`
355`);return l.replaceWith(c,d,r.schema.text(h)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:fg,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?t.commands.command(({tr:a})=>{var l;const{pos:c}=s,d=s.start(),u=s.end(),h=r.doc.textBetween(d,u,`
356`,`
357`).split(`
358`);let p=0,g=0;const v=c-d;for(let O=0;O<h.length;O+=1){if(g+h[O].length>=v){p=O;break}g+=h[O].length+1}const w=((l=h[p].match(/^ */))==null?void 0:l[0])||"",C=Math.min(w.length,n);if(C===0)return!0;let x=d;for(let O=0;O<p;O+=1)x+=h[O].length+1;return a.delete(x,x+C),c-x<=C&&a.setSelection(xt.create(a.doc,x)),!0}):t.commands.command(({tr:a})=>{const{from:l,to:c}=i,f=r.doc.textBetween(l,c,`
359`,`
360`).split(`
361`).map(h=>{var p;const g=((p=h.match(/^ */))==null?void 0:p[0])||"",v=Math.min(g.length,n);return h.slice(v)}).join(`
362`);return a.replaceWith(l,c,r.schema.text(f)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
363
364`);return!s||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;const s=r.before();return s>0?!1:t.commands.insertDefaultBlock({pos:s})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(Dt.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[ev({find:VH,type:this.type,getAttributes:t=>({language:t[1]})}),ev({find:WH,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new An({key:new sr("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
365`));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(xt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),KH=hi.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
366
367`):""}),XH=hi.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",rr(this.options.HTMLAttributes,t)]},renderText(){return`
368`},renderMarkdown:()=>`  
369`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&o){const u=l.filter(f=>a.includes(f.type.name));c.ensureMarks(u)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),YH=hi.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,rr(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>ev({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
369)\\s$`),type:this.type,getAttributes:{level:t}}))}}),JH=hi.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",rr(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!PF(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,i=t();return z5(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(xt.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(wt.create(o.doc,l.pos)):o.setSelection(xt.create(o.doc,l.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,u=d==null?void 0:d.create();u&&(o.insert(c,u),o.setSelection(xt.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[tB({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
vendor: 1,046 bytes, line 369
369ype})]}}),QH=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ZH=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ez=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,tz=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,nz=ja.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",rr(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}
369,addInputRules(){return[Da({find:QH,type:this.type}),Da({find:ez,type:this.type})]},addPasteRules(){return[jo({find:ZH,type:this.type}),jo({find:tz,type:this.type})]}}),rz=Object.defineProperty,iz=(t,e)=>{for(var n in e)rz(t,n,{get:e[n],enumerable:!0})},sz="listItem",h3="textStyle",p3=/^\s*([-+*])\s$/,OE=hi.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",rr(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
370`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(sz,this.editor.getAttributes(h3)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ul({find:p3,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ul({find:p3,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(h3),editor:this.editor})),[t]}}),oz=(t,e,n)=>{const{selection:r}=t;if(!r.empty)return null;const{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let s=-1;for(let h=i.depth;h>0;h-=1)if(i.node(h).type.name===e){s=h;break}if(s<0)return null;const o=i.node(s),a=i.index(s);if(a+1>=o.childCount)return null;const l=o.child(a+1);
370if(!n.includes(l.type.name))return null;const c=t.schema.nodes[e];let d=!1;if(l.forEach(h=>{h.type===c&&h.childCount>1&&(d=!0)}),!d)return null;const u=t.doc.resolve(i.after()).nodeAfter;if(!u||!n.includes(u.type.name))return null;const f=[];return u.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:s,nestedList:u,nestedListPos:i.after(),insertPos:i.after(s),items:f}},az=(t,e,n,r)=>{const i=oz(t,n,r);if(!i)return!1;const{selection:s}=t,{nestedList:o,nestedListPos:a,insertPos:l,items:c}=i,d=t.tr;d.delete(a,a+o.nodeSize);const u=d.mapping.map(l);return d.insert(u,Be.from(c)),d.setSelection(s.map(d.doc,d.mapping)),e&&e(d),!0},lz=(t,e,n)=>az(t.state,t.view.dispatch,e,n),kE=(t,e)=>Fn.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>lz(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),NE=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],nf="abcdefghijklmnopqrstuvwxyz",cz="[a-zA-Z]{1,2}",_E=String.raw`\d+|[ivxlcdmIVXLCDM]+|${cz}`;function zp(t){let e=t,n="";for(const[r,i]of NE)for(;e>=r;)n+=i,e-=r;return n}function Ly(t){return zp(t).toUpperCase()}function PE(t){const e=t.toLowerCase();let n=0,r=0;for(;n<e.length;){let i=!1;for(const[s,o]of NE)if(e.startsWith(o,n)){r+=s,n+=o.length,i=!0;break}if(!i)return 0}return r}function dz(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;const e=PE(t);return e<=0?!1:(t===t.toLowerCase()?zp(e):Ly(e))===t}function uz(t){const e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){const n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function Wh(t){if(t<=26)return nf[t-1];const e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?nf[n]:nf[e]+nf[n]}function qp(t){if(!(!t||/^\d+$/.test(t))){if(dz(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function jy(t){if(/^\d+$/.test(t))return parseInt(t,10);const e=qp(t);if(e==="i"||e==="I")return PE(t);if(e==="a"||e==="A"){const r=uz(t);return r>0?r:1}const n=parseInt(t,10);return Number.isNaN(n)?1:n}function fz(t,e){if(t==="numeric")return String(e);switch(t){case"a":return Wh(e);case"A":return Wh(e).toUpperCase();case"i":return zp(e);case"I":return Ly(e);default:return String(e)}}function hz(t){var e;if(t.length===0)return!1;const n=(e=qp(t[0]))!=null?e:"numeric",r=jy(t[0]);if(r<1)return!1;for(let i=0;i<t.length;i++){const s=fz(n,r+i);if(t[i]!==s)return!1}return!0}function pz(t){return{type:qp(t),start:jy(t)}}function mz(t){const{type:e,start:n}=pz(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function gz(t,e,n=". "){const r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${Wh(r)}${n}`;case"A":return`${Wh(r).toUpperCase()}${n}`;case"i":return`${zp(r)}${n}`;case"I":return`${Ly(r)}${n}`;default:return`${r}${n}`}}function vz(t){var e,n;const r=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((n=t.tokens)==null?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===t.text)}function bz(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var ME=hi.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",rr(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let i=[];if(t.tokens&&t.tokens.length>0){if(vz(t))return{type:"listItem",content:[{type:"paragraph",content:bz(t.text||"",e)}]};if(t.tokens.some(o=>o.type==="paragraph"))i=r(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const l=t.tokens.slice(1),c=r(l);i.push(...c)}}else i=r(t.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(t,e,n)=>Ey(t,e,r=>{var i,s,o,a;if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){const l=((s=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:s.start)||1,c=(a=(o=r.meta)==null?void 0:o.parentAttrs)==null?void 0:a.type,d=l-1+(r.index||0);return gz(c,d,". ")}return"- "},n),addExtensions(){return[kE(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),yz={};
370iz(yz,{findListItemPos:()=>Up,getNextListDepth:()=>Fy,handleBackspace:()=>cv,handleDelete:()=>dv,hasListBefore:()=>DE,hasListItemAfter:()=>wz,hasListItemBefore:()=>Sz,listItemHasSubList:()=>Cz,nextListIsDeeper:()=>LE,nextListIsHigher:()=>jE});var Up=(t,e)=>{const{$from:n}=e.selection,r=er(t,e.schema);let i=null,s=n.depth,o=n.pos,a=null;for(;s>0&&a===null;)i=n.node(s),i.type===r?a=s:(s-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},Fy=(t,e)=>{const n=Up(t,e);if(!n)return!1;const[,r]=iF(e,t,n.$pos.pos+4);return r},DE=(t,e,n)=>{const{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},cv=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Lo(t.state,e)&&DE(t.state,e,n)){const{$anchor:r}=t.state.selection,i=t.state.doc.resolve(r.before()-1),s=[];i.node().descendants((l,c)=>{l.type.name===e&&s.push({node:l,pos:c})});const o=s.at(-1);if(!o)return!1;const a=t.state.doc.resolve(i.start()+o.pos+1);return t.chain().cut({from:r.start()-1,to:r.end()+1},a.end()).joinForward().run()}return!Lo(t.state,e)||!lF(t.state)?!1:t.chain().liftListItem(e).run()},LE=(t,e)=>{const n=Fy(t,e),r=Up(t,e);return!r||!n?!1:n>r.depth},jE=(t,e)=>{const n=Fy(t,e),r=Up(t,e);return!r||!n?!1:n<r.depth},dv=(t,e)=>{if(!Lo(t.state,e)||!aF(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:LE(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():jE(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},wz=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},Sz=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},Cz=(t,e,n)=>{if(!n)return!1;const r=er(t,e.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},FE=Fn.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&dv(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&dv(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&cv(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&cv(t,n,r)&&(e=!0)}),e}}}}),uv=new RegExp(`^(\\s*)(${_E})([.)])\\s+(.*)$`),xz=/^\s/,Fc={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function $z(t){return uv.test(t.trimStart())}function Ez(t){const e=t.trimStart();return Fc.bulletItem.test(e)||$z(e)||Fc.heading.test(e)||Fc.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||Fc.codeFence.test(e)}function Tz(t){return Object.values(Fc).some(e=>e.test(t))}function Rz(t){const e=[],n=[];let r=!1;return t.forEach(i=>{if(r){n.push(i);return}if(i.trim()===""){r=!0,n.push(i);return}if(e.length>0&&Ez(i)){r=!0,n.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:n}}function Iz(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n],s=i.match(uv);if(!s)break;const[,o,a,l,c]=s,d=o.length,u=parseInt(a,10),f=isNaN(u)?qp(a):void 0,h=isNaN(u)?jy(a):u,p=[c];let g=n+1;const v=[i];let b=!1;for(;g<t.length;){const w=t[g];if(w.match(uv))break;if(w.trim()==="")v.push(w),p.push(""),b=!0,g+=1;else if(w.match(xz)){const x=w.length-w.trimStart().length,R=d+a.length+1;v.push(w),p.push(w.slice(Math.min(x,R))),g+=1}else{if(b||Tz(w))break;v.push(w),p.push(w),g+=1}}e.push({indent:d,number:h,type:f,content:p.join(`
371`).trim(),contentLines:p,raw:v.join(`
372`)}),r=g,n=g}return[e,r]}var Az=new RegExp(`^(${_E})([.)])\\s+(.+)$`);function Oz(t){const e=t.split(`
373`).filter(s=>s.trim().length>0);if(e.length===0)return null;const n=[];for(const s of e){const o=s.trim().match(Az);if(!o)return null;n.push({marker:o[1],content:o[3]})}const r=n.map(s=>s.marker);return hz(r)?{type:"orderedList",attrs:mz(n[0].marker),content:n.map(s=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:s.content}]}]}))}:null}function BE(t,e,n){const r=[];let i=0;for(;i<t.length;){const s=t[i];if(s.indent===e){const{paragraphLines:o,blockLines:a}=Rz(s.contentLines),l=o.join(`
374`).trim(),c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.join(`
375`).trim();if(d){const h=n.blockTokens(d);c.push(...h)}let u=i+1;const f=[];for(;u<t.length&&t[u].indent>e;)f.push(t[u]),u+=1;if(f.length>0){const h=Math.min(...f.map(g=>g.indent)),p=BE(f,h,n);c.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(g=>g.raw).join(`
376`)})}r.push({type:"list_item",raw:s.raw,tokens:c}),i=u}else i+=1}return r}function kz(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>
376{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var Nz="listItem",m3="textStyle",g3=/^(\d+)\.\s$/;function v3(t){const e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var HE=hi.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{const e=t.getAttribute("type");if(e)return e;const n=t.getAttribute("style");if(n){const i=v3(n);if(i)return i}const r=t.querySelector("li");if(r){const i=r.getAttribute("style");if(i){const s=v3(i);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:n,...r}=t,i=rr(this.options.HTMLAttributes,r);return e!==1&&(i.start=e),n&&n!=="1"&&(i.type=n),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.typeMarker,i=t.items?kz(t.items,e):[],s={};return n!==1&&(s.start=n),r&&(s.type=r),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:i}:{type:"orderedList",content:i}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
377`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,i;const s=t.split(`
378`),[o,a]=Iz(s);if(o.length===0)return;const l=BE(o,o[0].indent,n);if(l.length===0)return;const c=((r=o[0])==null?void 0:r.number)||1,d=(i=o[0])==null?void 0:i.type;return{type:"list",ordered:!0,start:c,typeMarker:d,items:l,raw:s.slice(0,a).join(`
379`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Nz,this.editor.getAttributes(m3)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new An({props:{handlePaste:(t,e)=>{var n,r;const i=(n=e.clipboardData)==null?void 0:n.getData("text/html");if(i!=null&&i.trim())return!1;const s=(r=e.clipboardData)==null?void 0:r.getData("text/plain");if(!s)return!1;const o=Oz(s);if(!o)return!1;try{const a=t.state.schema.nodeFromJSON(o),l=t.state.tr.replaceSelectionWith(a);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1];let e=Ul({find:g3,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ul({find:g3,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(m3)}),joinPredicate:t,editor:this.editor})),[e]}}),_z=/^\s*(\[([( |x])?\])\s$/,Pz=hi.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",rr(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const i=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return Ey(t,e,i)},addExtensions(){return this.options.nested?[kE(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=u=>{var f,h;a.ariaLabel=((h=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:h.call(f,u,a.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};
379c(t),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",u=>u.preventDefault()),a.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const p=n();if(typeof p!="number")return!1;const g=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...g==null?void 0:g.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,f])=>{i.setAttribute(u,f)}),i.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,s.append(a,o),i.append(s,l),Object.entries(e).forEach(([u,f])=>{i.setAttribute(u,f)});let d=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:u=>{if(u.type!==this.type)return!1;i.dataset.checked=u.attrs.checked,a.checked=u.attrs.checked,c(u);const f=r.extensionManager.attributes,h=xd(u,f),p=new Set(Object.keys(h)),g=this.options.HTMLAttributes;return d.forEach(v=>{p.has(v)||(v in g?i.setAttribute(v,g[v]):i.removeAttribute(v))}),Object.entries(h).forEach(([v,b])=>{b==null?v in g?i.setAttribute(v,g[v]):i.removeAttribute(v):i.setAttribute(v,b)}),d=p,!0}}}},addInputRules(){return[Ul({find:_z,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Mz=hi.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",rr(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
380`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=s=>{const o=Z1(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);if(o){const a={type:"taskList",raw:o.raw,items:o.items},l=s.slice(o.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(s)},i=Z1(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Fn.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(OE.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(ME.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(FE.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(HE.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Pz.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(Mz.configure(this.options.taskList)),t}});var rf="&nbsp;",hg=" ",Dz=hi.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",rr(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===rf||n[0].text===rf||n[0].raw===hg||n[0].text===hg)&&r.length===1&&r[0].type==="text"&&(r[0].text===rf||r[0].text===hg)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,i;if(!t)return"";const s=Array.isArray(t.content)?t.content:[];if(s.length===0){const o=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((i=n==null?void 0:n.previousNode)==null?void 0:i.type)==="paragraph"&&o.length===0?rf:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Lz=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,jz=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Fz=ja.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",rr(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>
380e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Da({find:Lz,type:this.type})]},addPasteRules(){return[jo({find:jz,type:this.type})]}}),Bz=hi.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),Hz=ja.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",rr(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function zz(t={}){return new An({view(e){return new qz(e,t)}})}class qz{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){if(this.cursorPos!=null&&n.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(n){let u=e.nodeBefore,f=e.nodeAfter;if(u||f){let h=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(h){let p=h.getBoundingClientRect(),g=u?p.bottom:p.top;u&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*a;r={left:p.left,right:p.right,top:g-v,bottom:g+v}}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:u.left-f,right:u.left+f,top:u.top,bottom:u.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let u=l.getBoundingClientRect(),f=u.width/l.offsetWidth,h=u.height/l.offsetHeight;c=u.left-l.scrollLeft*f,d=u.top-l.scrollTop*h}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(!n||s)return null;let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=b9(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let n=this.computeTarget(e);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Ln extends Dt{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ln.valid(r)?new Ln(r):Dt.near(r)}content(){return lt.empty}eq(e){return e instanceof Ln&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ln(e.resolve(n.pos))}getBookmark(){return new By(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!Uz(e)||!Vz(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ln.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>
vendor: 10,629 bytes, line 380
3800?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(Ln.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!wt.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(Ln.valid(a))return a}return null}}}Ln.prototype.visible=!1;Ln.findFrom=Ln.findGapCursorFrom;Dt.jsonID("gapcursor",Ln);class By{constructor(e){this.pos=e}map(e){return new By(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ln.valid(n)?new Ln(n):Dt.near(n)}}function zE(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function Uz(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||zE(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Vz(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||zE(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Wz(){return new An({props:{decorations:Yz,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ln.valid(n)?new Ln(n):null},handleClick:Kz,handleKeyDown:Gz,handleDOMEvents:{beforeinput:Xz}}})}const Gz=T5({ArrowLeft:sf("horiz",-1),ArrowRight:sf("horiz",1),ArrowUp:sf("vert",-1),ArrowDown:sf("vert",1)});function sf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof xt){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Ln.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new Ln(c))),!0):!1}}function Kz(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ln.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&wt.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ln(r))),!0)}function Xz(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ln))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=Be.empty;for(let o=r.length-1;o>=0;o--)i=Be.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new lt(i,0,0));return s.setSelection(xt.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function Yz(t){if(!(t.selection instanceof Ln))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",yn.create(t.doc,[Lr.widget(t.selection.head,e,{key:"gapcursor"})])}var Gh=200,hr=function(){};hr.prototype.append=function(e){return e.length?(e=hr.from(e),!this.length&&e||e.length<Gh&&this.leafAppend(e)||this.length<Gh&&e.leafPrepend(this)||this.appendInner(e)):this};hr.prototype.prepend=function(e){return e.length?hr.from(e).append(this):this};hr.prototype.appendInner=function(e){return new Jz(this,e)};hr.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?hr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};hr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};hr.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};hr.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i};hr.from=function(e){return e instanceof hr?e:e&&e.length?new qE(e):hr.empty};var qE=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Gh)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Gh)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(hr);hr.empty=new qE([]);var Jz=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(hr);const Qz=500;class zi{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],d=[];return this.items.forEach((u,f)=>{if(!u.step){i||(i=this.remapping(r,f+1),s=i.maps.length),s--,d.push(u);return}if(i){d.push(new ao(u.map));let h=u.step.map(i.slice(s)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new ao(p,void 0,void 0,c.length+d.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(u.step);if(u.selection)return a=i?u.selection.map(i.slice(s)):u.selection,l=new zi(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),f=new ao(e.mapping.maps[d],u,n),h;(h=l&&l.merge(f))&&(f=h,d?s.pop():a=a.slice(0,a.length-1)),s.push(f),n&&(o++,n=void 0),i||(l=f)}let c=o-r.depth;return c>eq&&(a=Zz(a,c),o-=c),new zi(a.append(s),o)}remapping(e,n){let r=new bd;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new zi(this.items.append(e.map(n=>new ao(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},i);let l=n;this.items.forEach(f=>{let h=s.getMirror(--l);if(h==null)return;o=Math.min(o,h);let p=s.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),v=f.selection&&f.selection.map(s.slice(l+1,h));v&&a++,r.push(new ao(p,g,v))}else r.push(new ao(p))},i);let c=[];for(let f=n;f<o;f++)c.push(new ao(s.maps[f]));let d=this.items.slice(0,i).append(c).append(r),u=new zi(d,a);return u.emptyItemCount()>Qz&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&s++;let u=new ao(c.invert(),l,d),f,h=i.length-1;(f=i.length&&i[h].merge(u))?i[h]=f:i.push(u)}}else o.map&&r--},this.items.length,0),new zi(hr.from(i.reverse()),s)}}zi.empty=new zi(hr.empty,0);function Zz(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}let ao=class UE{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new UE(n.getMap().invert(),n,this.selection)}}};class vo{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const eq=20;function tq(t,e,n,r){let i=n.getMeta(Ia),s;if(i)return i.historyState;n.getMeta(iq)&&(t=new vo(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Ia))return o.getMeta(Ia).redo?new vo(t.done.addTransform(n,void 0,r,Nf(e)),t.undone,b3(n.mapping.maps),t.prevTime,t.prevComposition):new vo(t.done,t.undone.addTransform(n,void 0,r,Nf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!nq(n,t.prevRanges)),c=o?pg(t.prevRanges,n.mapping):b3(n.mapping.maps);return new vo(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Nf(e)),zi.empty,c,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new vo(t.done.rebased(n,s),t.undone.rebased(n,s),pg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new vo(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),pg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function nq(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function b3(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;
380n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function pg(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function rq(t,e,n){let r=Nf(e),i=Ia.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new vo(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Ia,{redo:n,historyState:l})}let mg=!1,y3=null;function Nf(t){let e=t.plugins;if(y3!=e){mg=!1,y3=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){mg=!0;break}}return mg}const Ia=new sr("history"),iq=new sr("closeHistory");function sq(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new An({key:Ia,state:{init(){return new vo(zi.empty,zi.empty,null,0,-1)},apply(e,n,r){return tq(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?WE:r=="historyRedo"?GE:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function VE(t,e){return(n,r)=>{let i=Ia.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=rq(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const WE=VE(!1,!0),GE=VE(!0,!0);Fn.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new An({key:new sr("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit,s=this.options.autoTrim;if(i==null||i===0||s===!1){t=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const a=o-i,l=0,c=a,d=r.tr.deleteRange(l,c);return t=!0,d}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=s-r,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>r)}})]}});var oq=Fn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[zz(this.options)]}});Fn.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new An({key:new sr("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return yn.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1});let a=0;return t.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(Lr.node(c,c+l.nodeSize,{class:this.options.className}))}),yn.create(t,s)}}})]}});var aq=Fn.create({name:"gapCursor",addProseMirrorPlugins(){return[Wz()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=an(bt(t,"allowGapCursor",n)))!=null?e:null}}}),KE="placeholder",w3=new sr("tiptap__placeholder");function XE(t){const{editor:e,placeholder:n,dataAttribute:r,pos:i,node:s,isEmptyDoc:o,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=t,d=[l];return o&&d.push(c),Lr.node(i,i+s.nodeSize,{class:d.join(" "),[r]:typeof n=="function"?n({editor:e,node:s,pos:i,hasAnchor:a}):n})}function YE(t,e){return typeof t=="function"?t(e):t}function JE({editor:t,options:e,dataAttribute:n,doc:r,selection:i,from:s,to:o}){const{anchor:a}=i,l=[],c=t.isEmpty;return r.nodesBetween(s,o,(d,u)=>{const f=a>=u&&a<=u+d.nodeSize,h=!d.isLeaf&&du(d);return d.type.isTextblock&&(f||!e.showOnlyCurrent)&&h&&l.push(XE({editor:t,isEmptyDoc:c,dataAttribute:n,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:Y
380E(e.emptyNodeClass,{editor:t,node:d,pos:u,hasAnchor:f})},node:d,pos:u})),e.includeChildren}),l}function QE({editor:t,options:e,dataAttribute:n,doc:r,selection:i}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:o}=i,a=[],l=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const d=r.resolve(o),u=d.depth>0?d.node(1):d.nodeAfter,f=d.depth>0?d.before(1):o;if(u&&u.type.isTextblock&&du(u)){const h=o>=f&&o<=f+u.nodeSize;a.push(XE({editor:t,isEmptyDoc:l,dataAttribute:n,hasAnchor:h,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:YE(e.emptyNodeClass,{editor:t,node:u,pos:f,hasAnchor:h})},node:u,pos:f}))}}else a.push(...JE({editor:t,options:e,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return yn.create(r,a)}function id(t,e){var n;const r=t.resolve(e);if(r.depth===0){const o=(n=r.nodeAfter)!=null?n:r.nodeBefore;if(!o)return{from:e,to:e};const a=r.nodeAfter?e:e-o.nodeSize;return{from:a,to:a+o.nodeSize}}const i=r.before(1),s=r.node(1);return{from:i,to:i+s.nodeSize}}function sd(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function lq(t,e,n){const r=[];return t.forEach((i,s)=>{const o=s,a=o+i.nodeSize,l=o+1,c=a+1;l<n&&c>e&&r.push({from:o,to:a})}),r}function cq(t){if(t.length===0)return[];const e=[...t].sort((r,i)=>r.from-i.from),n=[{...e[0]}];for(let r=1;r<e.length;r+=1){const i=n[n.length-1],s=e[r];s.from<=i.to?i.to=Math.max(i.to,s.to):n.push({...s})}return n}function dq(t,e){const n=lq(t,e.from,e.to);return n.push(sd(t,id(t,e.from))),e.to>e.from?n.push(sd(t,id(t,Math.min(e.to,t.content.size+1)-1))):e.from<t.content.size+1&&n.push(sd(t,id(t,Math.min(e.from+1,t.content.size)))),n}function uq(t,e,n){const r=[];if(t.docChanged){const i=Sy(t);for(const s of i)r.push(...dq(n.doc,s.newRange))}return t.selectionSet&&(r.push(sd(n.doc,id(n.doc,t.mapping.map(e.selection.anchor)))),r.push(sd(n.doc,id(n.doc,n.selection.anchor)))),cq(r)}function fq(t,e,n){const r=Math.max(0,Math.min(t,n.content.size)),i=Math.max(r,Math.min(e,n.content.size));return{from:r,to:i}}function hq({decorations:t,ranges:e,editor:n,options:r,dataAttribute:i,doc:s,selection:o}){let a=t;for(const l of e){const{from:c,to:d}=fq(l.from,l.to,s),u=a.find(c,d).filter(h=>h.from>=c&&h.to<=d);u.length&&(a=a.remove(u));const f=JE({editor:n,options:r,dataAttribute:i,doc:s,selection:o,from:c,to:d});f.length&&(a=a.add(s,f))}return a}function pq({editor:t,options:e,dataAttribute:n}){return{init(r,i){const s=QE({editor:t,options:e,dataAttribute:n,doc:i.doc,selection:i.selection});return s??yn.empty},apply(r,i,s,o){if(!r.docChanged&&!r.selectionSet)return i;const a=i.map(r.mapping,r.doc),l=uq(r,s,o);return hq({decorations:a,ranges:l,editor:t,options:e,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function mq(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function gq({editor:t,options:e}){const n=e.dataAttribute?`data-${mq(e.dataAttribute)}`:`data-${KE}`,r=e.showOnlyCurrent&&!e.includeChildren;return new An({key:w3,...r?{}:{state:pq({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:i,selection:s})=>QE({editor:t,options:e,dataAttribute:n,doc:i,selection:s}):i=>{var s;return e.showOnlyWhenEditable&&!t.isEditable?yn.empty:(s=w3.getState(i))!=null?s:yn.empty}}})}Fn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:KE,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[gq({editor:this.editor,options:this.options})]}});function fv(t,e){return!t.selection.empty&&!z5(t.selection)&&e.isEditable}function vq(t,e){return fv(t,e)&&!e.isFocused&&!e.view.dragging}function bq(){var t;(t=window.getSelection())==null||t.removeAllRanges()}function yq(t){t.focus()}Fn.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new An({key:new sr("selection"),props:{decorations(n){return vq(n,t)?yn.create(n.doc,[Lr.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return fv(n.state,t)&&bq(),!1},focus(n){return fv(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&yq(n)}),!1}}}})]}});var wq="skipTrailingNode";function S3({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var Sq=Fn.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new sr(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new An({key:e,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:c}
380=o,d=e.getState(o),u=a.content.size,f=c.nodes[n];if(!i.some(h=>h.getMeta(wq))&&d)return l.insert(u,f.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!S3({node:o,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!S3({node:o,types:r})}}})]}}),Cq=Fn.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>WE(t,e),redo:()=>({state:t,dispatch:e})=>GE(t,e)}},addProseMirrorPlugins(){return[sq(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),xq=Fn.create({name:"starterKit",addExtensions(){var t,e,n,r;const i=[];return this.options.bold!==!1&&i.push(HH.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(DH.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(OE.configure(this.options.bulletList)),this.options.code!==!1&&i.push(UH.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(GH.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(KH.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(oq.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(aq.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(XH.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(YH.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Cq.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(JH.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(nz.configure(this.options.italic)),this.options.listItem!==!1&&i.push(ME.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(FE.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(SE.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(HE.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(Dz.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(Fz.configure(this.options.strike)),this.options.text!==!1&&i.push(Bz.configure(this.options.text)),this.options.underline!==!1&&i.push(Hz.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(Sq.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),$q=xq;const Eq=[{key:"SMS",label:"SMS",icon:"/icons/chat/tab-sms.svg"},{key:"EMAIL",label:"Email",icon:"/icons/chat/tab-email.svg"},{key:"NOTE",label:"Internal note",icon:"/icons/chat/tab-note.svg"}],C3=320;function ca({src:t,label:e,onClick:n,disabled:r,active:i,title:s}){return N.jsx("button",{type:"button",onClick:n,disabled:r,title:s||e,"aria-label":e,"aria-pressed":i,className:`flex size-6 items-center justify-center rounded transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${i?"bg-[#eff5ff]":"hover:bg-[#f3f4f6]"}`,children:N.jsx("img",{src:t,alt:"",className:"size-3.5"})})}function Tq({contact:t,onSaveNote:e,onSendSms:n,onSendEmail:r,senders:i=[],suggestedSender:s}){var ne;const[o,a]=m.useState("NOTE"),[l,c]=m.useState(""),[d,u]=m.useState(""),[f,h]=m.useState(null),p=f??s??((ne=i[0])==null?void 0:ne.number),[g,v]=m.useState(!1),b=m.useRef(null),w=o==="NOTE",C=o==="EMAIL",x=o==="SMS",[R,O]=m.useState(!0),T=OH({extensions:[$q,_B.configure({openOnClick:!1})],content:"",onUpdate:({editor:Z})=>O(Z.getText().trim().length===0),editorProps:{attributes:{class:"h-full min-h-full overflow-y-auto px-3 py-2 text-sm leading-5 text-[#161c3c] outline-none [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_a]:underline"}}}),S=!T||R,_=w?async()=>e(l.trim()):x?n&&(async()=>n(l.trim(),p)):r&&(async()=>r(d.trim(),(T==null?void 0:T.getHTML())??"")),A=!!_,$=C?S:l.trim().length===0,E=C&&d.trim().length===0,I=A&&!g&&!$&&!E,D=A?g?"":E&&$?"Add a subject and a message":E?"Add a subject":$?"Add a message":"":"Sending is unavailable for this contact",B=async()=>
380{if(!(!I||!_)){v(!0);try{await _(),c(""),u(""),T==null||T.commands.clearContent(),O(!0)}catch{}finally{v(!1)}}},j=Z=>{Z.key==="Enter"&&!Z.shiftKey&&!Z.nativeEvent.isComposing&&(Z.preventDefault(),B())},z=()=>{if(!T)return;const Z=T.getAttributes("link").href,J=window.prompt("Link URL",Z??"https://");if(J!==null){if(J===""){T.chain().focus().extendMarkRange("link").unsetLink().run();return}T.chain().focus().extendMarkRange("link").setLink({href:J}).run()}},q=w?"Write an internal note…":x?`Text ${t.phone||"this contact"}…`:"";return N.jsxs("div",{className:`flex h-[190px] flex-col rounded-2xl p-2 ${w?"bg-[#fefcee]":"bg-[#f9fafb]"}`,children:[N.jsx("div",{className:`flex shrink-0 border-b ${w?"border-[#fff1b9]":"border-[#dbeafe]"}`,children:Eq.map(({key:Z,label:J,icon:de})=>{const X=o===Z,V=Z==="NOTE"?"rounded-t-lg border-b-2 border-[#feb46c] bg-[#ffefb6] font-semibold text-[#374151]":"rounded-t-lg border-b-2 border-[#7fafff] bg-[#eff5ff] font-semibold text-[#161c3c]";return N.jsxs("button",{type:"button",onClick:()=>a(Z),"aria-pressed":X,className:`inline-flex items-center gap-2 px-4 py-2.5 text-xs ${X?V:"font-medium text-[#374151] hover:bg-black/5"}`,children:[N.jsx("img",{src:de,alt:"",className:"size-3.5"}),J]},Z)})}),w&&N.jsx("div",{className:"border-b border-[#fff1b9] px-3 py-2 text-[12px] italic text-[#6b7280]",children:"This note is visible only to you, not the client."}),x&&i.length>0&&N.jsxs("label",{className:"flex items-center gap-2 border-b border-[#f3f4f6] px-3 py-2 text-xs text-[#9ca3af]",children:[N.jsx("span",{className:"flex-shrink-0",children:"From"}),N.jsx("select",{value:p??"",onChange:Z=>h(Z.target.value),className:"min-w-0 flex-1 bg-transparent text-xs text-[#161c3c] outline-none",children:i.map(Z=>N.jsx("option",{value:Z.number,children:Z.label===Z.number?Z.number:`${Z.label} · ${Z.number}`},Z.number))})]}),C&&N.jsx("input",{type:"text",value:d,onChange:Z=>u(Z.target.value),placeholder:"Subject",className:"w-full border-b border-[#f3f4f6] bg-transparent px-3 py-2 text-sm font-medium text-[#161c3c] outline-none placeholder:text-[#6b7280]"}),N.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:C?N.jsx($E,{editor:T,className:"h-full"}):N.jsx("textarea",{ref:b,value:l,onChange:Z=>c(Z.target.value),onKeyDown:j,placeholder:q,className:"h-full w-full resize-none bg-transparent px-3 py-2 text-sm leading-5 text-[#161c3c] outline-none placeholder:text-[#6b7280]"})}),N.jsxs("div",{className:"flex shrink-0 items-end justify-between gap-2 px-1 pt-1",children:[N.jsxs("div",{className:"flex items-center gap-3 px-2",children:[C&&T&&N.jsxs(N.Fragment,{children:[N.jsx(ca,{src:"/icons/chat/tb-bold.svg",label:"Bold",active:T.isActive("bold"),onClick:()=>T.chain().focus().toggleBold().run()}),N.jsx(ca,{src:"/icons/chat/tb-italic.svg",label:"Italic",active:T.isActive("italic"),onClick:()=>T.chain().focus().toggleItalic().run()}),N.jsx(ca,{src:"/icons/chat/tb-list.svg",label:"Bulleted list",active:T.isActive("bulletList"),onClick:()=>T.chain().focus().toggleBulletList().run()}),N.jsx(ca,{src:"/icons/chat/tb-link.svg",label:"Link",active:T.isActive("link"),onClick:z}),N.jsx(ca,{src:"/icons/chat/tb-attach.svg",label:"Attach file",disabled:!0,title:"Attachments connect with the backend phase"})]}),!w&&N.jsxs(N.Fragment,{children:[N.jsx(ca,{src:"/icons/chat/tb-ai.svg",label:"Draft with AI",disabled:!0,title:"AI drafting connects with the AI phase"}),N.jsx(ca,{src:"/icons/chat/tb-format.svg",label:"Improve with AI",disabled:!0,title:"AI rewrite connects with the AI phase"})]})]}),N.jsxs("div",{className:"flex items-center gap-2",children:[x&&N.jsxs("span",{className:`text-xs tabular-nums ${l.length>C3?"text-[#161c3c]":"text-[#9ca3af]"}`,children:[l.length,"/",C3]}),D&&N.jsx("span",{className:"hidden text-xs text-[#9ca3af] sm:inline",children:D}),N.jsx("button",{type:"button",onClick:B,disabled:!I,className:"flex size-9 flex-shrink-0 items-center justify-center rounded-xl bg-[#6366f1] text-white hover:bg-[#6366f1]/90 disabled:cursor-not-allowed disabled:opacity-40","aria-label":w?"Save note":"Send",title:D||(w?"Save note":"Send"),children:N.jsx(RP,{size:16,"aria-hidden":!0})})]})]})]})}var gg={exports:{}};/*!
381	Copyright (c) 2018 Jed Watson.
382	Licensed under the MIT License (MIT), see
383	http://jedwatson.github.io/classnames
384*/var x3;function Rq(){return x3||(x3=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)e.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}
384t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(gg)),gg.exports}var Iq=Rq();const Le=p$(Iq);function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},yt.apply(null,arguments)}function vt(t){"@babel/helpers - typeof";return vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vt(t)}var Aq=Symbol.for("react.element"),Oq=Symbol.for("react.transitional.element"),kq=Symbol.for("react.fragment");function ZE(t){return t&&vt(t)==="object"&&(t.$$typeof===Aq||t.$$typeof===Oq)&&t.type===kq}function Vl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return Te.Children.forEach(t,function(r){r==null&&!e.keepEmpty||(Array.isArray(r)?n=n.concat(Vl(r)):ZE(r)&&r.props?n=n.concat(Vl(r.props.children,e)):n.push(r))}),n}var hv={},Nq=function(e){};function _q(t,e){}function Pq(t,e){}function Mq(){hv={}}function e8(t,e,n){!e&&!hv[n]&&(t(!1,n),hv[n]=!0)}function Jr(t,e){e8(_q,t,e)}function Dq(t,e){e8(Pq,t,e)}Jr.preMessage=Nq;Jr.resetWarned=Mq;Jr.noteOnce=Dq;function Lq(t,e){if(vt(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(vt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function t8(t){var e=Lq(t,"string");return vt(e)=="symbol"?e:e+""}function Y(t,e,n){return(e=t8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ee(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$3(Object(n),!0).forEach(function(r){Y(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Td(t){return t instanceof HTMLElement||t instanceof SVGElement}function jq(t){return t&&vt(t)==="object"&&Td(t.nativeElement)?t.nativeElement:Td(t)?t:null}function _f(t){var e=jq(t);if(e)return e;if(t instanceof Te.Component){var n;return(n=l1.findDOMNode)===null||n===void 0?void 0:n.call(l1,t)}return null}var vg={exports:{}},on={};/**
385 * @license React
386 * react-is.production.min.js
387 *
388 * Copyright (c) Facebook, Inc. and its affiliates.
389 *
390 * This source code is licensed under the MIT license found in the
391 * LICENSE file in the root directory of this source tree.
392 */var E3;function Fq(){if(E3)return on;E3=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),p;p=Symbol.for("react.module.reference");function g(v){if(typeof v=="object"&&v!==null){var b=v.$$typeof;switch(b){case t:switch(v=v.type,v){case n:case i:case r:case c:case d:return v;default:switch(v=v&&v.$$typeof,v){case a:case o:case l:case f:case u:case s:return v;default:return b}}case e:return b}}}return on.ContextConsumer=o,on.ContextProvider=s,on.Element=t,on.ForwardRef=l,on.Fragment=n,on.Lazy=f,on.Memo=u,on.Portal=e,on.Profiler=i,on.StrictMode=r,on.Suspense=c,on.SuspenseList=d,on.isAsyncMode=function(){return!1},on.isConcurrentMode=function(){return!1},on.isContextConsumer=function(v){return g(v)===o},on.isContextProvider=function(v){return g(v)===s},on.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===t},on.isForwardRef=function(v){return g(v)===l},on.isFragment=function(v){return g(v)===n},on.isLazy=function(v){return g(v)===f},on.isMemo=function(v){return g(v)===u},on.isPortal=function(v){return g(v)===e},on.isProfiler=function(v){return g(v)===i},on.isStrictMode=function(v){return g(v)===r},on.isSuspense=function(v){return g(v)===c},on.isSuspenseList=function(v){return g(v)===d},on.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===i||v===r||v===c||v===d||v===h||typeof v=="object"&&v!==null&&(v.$$typeof===f||v.$$typeof===u||v.$$typeof===s||v.$$typeof===o||v.$$typeof===l||v.$$typeof===p||v.getModuleId!==void 0)},on.typeOf=g,on}var T3;
392function Bq(){return T3||(T3=1,vg.exports=Fq()),vg.exports}var bg=Bq();function Vp(t,e,n){var r=m.useRef({});return(!("value"in r.current)||n(r.current.condition,e))&&(r.current.value=t(),r.current.condition=e),r.current.value}var Hq=Number(m.version.split(".")[0]),Hy=function(e,n){typeof e=="function"?e(n):vt(e)==="object"&&e&&"current"in e&&(e.current=n)},Yi=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.filter(Boolean);return i.length<=1?i[0]:function(s){n.forEach(function(o){Hy(o,s)})}},sc=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Vp(function(){return Yi.apply(void 0,n)},n,function(i,s){return i.length!==s.length||i.every(function(o,a){return o!==s[a]})})},oc=function(e){var n,r;if(!e)return!1;if(zy(e)&&Hq>=19)return!0;var i=bg.isMemo(e)?e.type.type:e.type;return!(typeof i=="function"&&!((n=i.prototype)!==null&&n!==void 0&&n.render)&&i.$$typeof!==bg.ForwardRef||typeof e=="function"&&!((r=e.prototype)!==null&&r!==void 0&&r.render)&&e.$$typeof!==bg.ForwardRef)};function zy(t){return m.isValidElement(t)&&!ZE(t)}var qce=function(e){return zy(e)&&oc(e)},Wp=function(e){if(e&&zy(e)){var n=e;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null},pv=m.createContext(null);function zq(t){var e=t.children,n=t.onBatchResize,r=m.useRef(0),i=m.useRef([]),s=m.useContext(pv),o=m.useCallback(function(a,l,c){r.current+=1;var d=r.current;i.current.push({size:a,element:l,data:c}),Promise.resolve().then(function(){d===r.current&&(n==null||n(i.current),i.current=[])}),s==null||s(a,l,c)},[n,s]);return m.createElement(pv.Provider,{value:o},e)}var n8=(function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,s){return i[0]===n?(r=s,!0):!1}),r}return(function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,s=this.__entries__;i<s.length;i++){var o=s[i];n.call(r,o[1],o[0])}},e})()})(),mv=typeof window<"u"&&typeof document<"u"&&window.document===document,Kh=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),qq=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Kh):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}})(),Uq=2;function Vq(t,e){var n=!1,r=!1,i=0;function s(){n&&(n=!1,t()),r&&a()}function o(){qq(s)}function a(){var l=Date.now();if(n){if(l-i<Uq)return;r=!0}else n=!0,r=!1,setTimeout(o,e);i=l}return a}var Wq=20,Gq=["top","right","bottom","left","width","height","size","weight"],Kq=typeof MutationObserver<"u",Xq=(function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Vq(this.refresh.bind(this),Wq)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!mv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Kq?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!mv||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=Gq.some(function(s){return!!~r.indexOf(s)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=ne
vendor: 4,439 bytes, line 392
392w t),this.instance_},t.instance_=null,t})(),r8=(function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t}),Wl=(function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Kh}),i8=Gp(0,0,0,0);function Xh(t){return parseFloat(t)||0}function R3(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,i){var s=t["border-"+i+"-width"];return r+Xh(s)},0)}function Yq(t){for(var e=["top","right","bottom","left"],n={},r=0,i=e;r<i.length;r++){var s=i[r],o=t["padding-"+s];n[s]=Xh(o)}return n}function Jq(t){var e=t.getBBox();return Gp(0,0,e.width,e.height)}function Qq(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return i8;var r=Wl(t).getComputedStyle(t),i=Yq(r),s=i.left+i.right,o=i.top+i.bottom,a=Xh(r.width),l=Xh(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+s)!==e&&(a-=R3(r,"left","right")+s),Math.round(l+o)!==n&&(l-=R3(r,"top","bottom")+o)),!eU(t)){var c=Math.round(a+s)-e,d=Math.round(l+o)-n;Math.abs(c)!==1&&(a-=c),Math.abs(d)!==1&&(l-=d)}return Gp(i.left,i.top,a,l)}var Zq=(function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof Wl(t).SVGGraphicsElement}:function(t){return t instanceof Wl(t).SVGElement&&typeof t.getBBox=="function"}})();function eU(t){return t===Wl(t).document.documentElement}function tU(t){return mv?Zq(t)?Jq(t):Qq(t):i8}function nU(t){var e=t.x,n=t.y,r=t.width,i=t.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(s.prototype);return r8(o,{x:e,y:n,width:r,height:i,top:n,right:e+r,bottom:i+n,left:e}),o}function Gp(t,e,n,r){return{x:t,y:e,width:n,height:r}}var rU=(function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Gp(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=tU(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t})(),iU=(function(){function t(e,n){var r=nU(n);r8(this,{target:e,contentRect:r})}return t})(),sU=(function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new n8,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Wl(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new rU(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Wl(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new iU(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t})(),s8=typeof WeakMap<"u"?new WeakMap:new n8,o8=(function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Xq.getInstance(),r=new sU(e,n,this);s8.set(this,r)}return t})();["observe","unobserve","disconnect"].forEach(function(t){o8.prototype[t]=function(){var e;return(e=s8.get(this))[t].apply(e,arguments)}});var oU=(function(){return typeof Kh.ResizeObserver<"u"?Kh.ResizeObserver:o8})(),$o=new Map;function aU(t){t.forEach(function(e){var n,r=e.target;
392(n=$o.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var a8=new oU(aU);function lU(t,e){$o.has(t)||($o.set(t,new Set),a8.observe(t)),$o.get(t).add(e)}function cU(t,e){$o.has(t)&&($o.get(t).delete(e),$o.get(t).size||(a8.unobserve(t),$o.delete(t)))}function or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I3(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,t8(r.key),r)}}function ar(t,e,n){return e&&I3(t.prototype,e),n&&I3(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rd(t,e){return Rd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Rd(t,e)}function Go(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Rd(t,e)}function Id(t){return Id=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Id(t)}function qy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qy=function(){return!!t})()}function jt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dU(t,e){if(e&&(vt(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(t)}function Ko(t){var e=qy();return function(){var n,r=Id(t);if(e){var i=Id(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return dU(this,n)}}var uU=(function(t){Go(n,t);var e=Ko(n);function n(){return or(this,n),e.apply(this,arguments)}return ar(n,[{key:"render",value:function(){return this.props.children}}]),n})(m.Component);function fU(t,e){var n=t.children,r=t.disabled,i=m.useRef(null),s=m.useRef(null),o=m.useContext(pv),a=typeof n=="function",l=a?n(i):n,c=m.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),d=!a&&m.isValidElement(l)&&oc(l),u=d?Wp(l):null,f=sc(u,i),h=function(){var b;return _f(i.current)||(i.current&&vt(i.current)==="object"?_f((b=i.current)===null||b===void 0?void 0:b.nativeElement):null)||_f(s.current)};m.useImperativeHandle(e,function(){return h()});var p=m.useRef(t);p.current=t;var g=m.useCallback(function(v){var b=p.current,w=b.onResize,C=b.data,x=v.getBoundingClientRect(),R=x.width,O=x.height,T=v.offsetWidth,S=v.offsetHeight,_=Math.floor(R),A=Math.floor(O);if(c.current.width!==_||c.current.height!==A||c.current.offsetWidth!==T||c.current.offsetHeight!==S){var $={width:_,height:A,offsetWidth:T,offsetHeight:S};c.current=$;var E=T===Math.round(R)?R:T,I=S===Math.round(O)?O:S,D=ee(ee({},$),{},{offsetWidth:E,offsetHeight:I});o==null||o(D,v,C),w&&Promise.resolve().then(function(){w(D,v)})}},[]);return m.useEffect(function(){var v=h();return v&&!r&&lU(v,g),function(){return cU(v,g)}},[i.current,r]),m.createElement(uU,{ref:s},d?m.cloneElement(l,{ref:f}):l)}var hU=m.forwardRef(fU),pU="rc-observer-key";function mU(t,e){var n=t.children,r=typeof n=="function"?[n]:Vl(n);return r.map(function(i,s){var o=(i==null?void 0:i.key)||"".concat(pU,"-").concat(s);return m.createElement(hU,yt({},t,{key:o,ref:s===0?e:void 0}),i)})}var Xo=m.forwardRef(mU);Xo.Collection=zq;function gv(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function gU(t){if(Array.isArray(t))return gv(t)}function l8(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Uy(t,e){if(t){if(typeof t=="string")return gv(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gv(t,e):void 0}}function vU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
393In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function st(t){return gU(t)||l8(t)||Uy(t)||vU()}var c8=function(e){return+setTimeout(e,16)},d8=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(c8=function(e){return window.requestAnimationFrame(e)},d8=function(e){return window.cancelAnimationFrame(e)});var A3=0,Vy=new Map;function u8(t){Vy.delete(t)}var Un=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;A3+=1;var r=A3;
393function i(s){if(s===0)u8(r),e();else{var o=c8(function(){i(s-1)});Vy.set(r,o)}}return i(n),r};Un.cancel=function(t){var e=Vy.get(t);return u8(t),d8(e)};function f8(t){if(Array.isArray(t))return t}function bU(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function h8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
394In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Re(t,e){return f8(t)||bU(t,e)||Uy(t,e)||h8()}function Ad(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Br(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function vv(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}var O3="data-rc-order",k3="data-rc-priority",yU="rc-util-key",bv=new Map;function p8(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):yU}function Kp(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function wU(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function Wy(t){return Array.from((bv.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function m8(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Br())return null;var n=e.csp,r=e.prepend,i=e.priority,s=i===void 0?0:i,o=wU(r),a=o==="prependQueue",l=document.createElement("style");l.setAttribute(O3,o),a&&s&&l.setAttribute(k3,"".concat(s)),n!=null&&n.nonce&&(l.nonce=n==null?void 0:n.nonce),l.innerHTML=t;var c=Kp(e),d=c.firstChild;if(r){if(a){var u=(e.styles||Wy(c)).filter(function(f){if(!["prepend","prependQueue"].includes(f.getAttribute(O3)))return!1;var h=Number(f.getAttribute(k3)||0);return s>=h});if(u.length)return c.insertBefore(l,u[u.length-1].nextSibling),l}c.insertBefore(l,d)}else c.appendChild(l);return l}function g8(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Kp(e);return(e.styles||Wy(n)).find(function(r){return r.getAttribute(p8(e))===t})}function Od(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=g8(t,e);if(n){var r=Kp(e);r.removeChild(n)}}function SU(t,e){var n=bv.get(t);if(!n||!vv(document,n)){var r=m8("",e),i=r.parentNode;bv.set(t,i),t.removeChild(r)}}function Ws(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Kp(n),i=Wy(r),s=ee(ee({},n),{},{styles:i});SU(r,s);var o=g8(e,s);if(o){var a,l;if((a=s.csp)!==null&&a!==void 0&&a.nonce&&o.nonce!==((l=s.csp)===null||l===void 0?void 0:l.nonce)){var c;o.nonce=(c=s.csp)===null||c===void 0?void 0:c.nonce}return o.innerHTML!==t&&(o.innerHTML=t),o}var d=m8(t,s);return d.setAttribute(p8(s),e),d}function CU(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function cn(t,e){if(t==null)return{};var n,r,i=CU(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function yv(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(s,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=r.has(s);if(Jr(!l,"Warning: There may be circular references"),l)return!1;if(s===o)return!0;
394if(n&&a>1)return!1;r.add(s);var c=a+1;if(Array.isArray(s)){if(!Array.isArray(o)||s.length!==o.length)return!1;for(var d=0;d<s.length;d++)if(!i(s[d],o[d],c))return!1;return!0}if(s&&o&&vt(s)==="object"&&vt(o)==="object"){var u=Object.keys(s);return u.length!==Object.keys(o).length?!1:u.every(function(f){return i(s[f],o[f],c)})}return!1}return i(t,e)}var xU="%";function wv(t){return t.join(xU)}var $U=(function(){function t(e){or(this,t),Y(this,"instanceId",void 0),Y(this,"cache",new Map),Y(this,"extracted",new Set),this.instanceId=e}return ar(t,[{key:"get",value:function(n){return this.opGet(wv(n))}},{key:"opGet",value:function(n){return this.cache.get(n)||null}},{key:"update",value:function(n,r){return this.opUpdate(wv(n),r)}},{key:"opUpdate",value:function(n,r){var i=this.cache.get(n),s=r(i);s===null?this.cache.delete(n):this.cache.set(n,s)}}]),t})(),Gl="data-token-hash",Wi="data-css-hash",Eo="__cssinjs_instance__";function EU(){var t=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var e=document.body.querySelectorAll("style[".concat(Wi,"]"))||[],n=document.head.firstChild;Array.from(e).forEach(function(i){i[Eo]=i[Eo]||t,i[Eo]===t&&document.head.insertBefore(i,n)});var r={};Array.from(document.querySelectorAll("style[".concat(Wi,"]"))).forEach(function(i){var s=i.getAttribute(Wi);if(r[s]){if(i[Eo]===t){var o;(o=i.parentNode)===null||o===void 0||o.removeChild(i)}}else r[s]=!0})}return new $U(t)}var fu=m.createContext({hashPriority:"low",cache:EU(),defaultCache:!0});function TU(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var Gy=(function(){function t(){or(this,t),Y(this,"cache",void 0),Y(this,"keys",void 0),Y(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return ar(t,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(n){var r,i,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o={map:this.cache};return n.forEach(function(a){if(!o)o=void 0;else{var l;o=(l=o)===null||l===void 0||(l=l.map)===null||l===void 0?void 0:l.get(a)}}),(r=o)!==null&&r!==void 0&&r.value&&s&&(o.value[1]=this.cacheCallTimes++),(i=o)===null||i===void 0?void 0:i.value}},{key:"get",value:function(n){var r;return(r=this.internalGet(n,!0))===null||r===void 0?void 0:r[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,r){var i=this;if(!this.has(n)){if(this.size()+1>t.MAX_CACHE_SIZE+t.MAX_CACHE_OFFSET){var s=this.keys.reduce(function(c,d){var u=Re(c,2),f=u[1];return i.internalGet(d)[1]<f?[d,i.internalGet(d)[1]]:c}
394,[this.keys[0],this.cacheCallTimes]),o=Re(s,1),a=o[0];this.delete(a)}this.keys.push(n)}var l=this.cache;n.forEach(function(c,d){if(d===n.length-1)l.set(c,{value:[r,i.cacheCallTimes++]});else{var u=l.get(c);u?u.map||(u.map=new Map):l.set(c,{map:new Map}),l=l.get(c).map}})}},{key:"deleteByPath",value:function(n,r){var i=n.get(r[0]);if(r.length===1){var s;return i.map?n.set(r[0],{map:i.map}):n.delete(r[0]),(s=i.value)===null||s===void 0?void 0:s[0]}var o=this.deleteByPath(i.map,r.slice(1));return(!i.map||i.map.size===0)&&!i.value&&n.delete(r[0]),o}},{key:"delete",value:function(n){if(this.has(n))return this.keys=this.keys.filter(function(r){return!TU(r,n)}),this.deleteByPath(this.cache,n)}}]),t})();Y(Gy,"MAX_CACHE_SIZE",20);Y(Gy,"MAX_CACHE_OFFSET",5);var N3=0,v8=(function(){function t(e){or(this,t),Y(this,"derivatives",void 0),Y(this,"id",void 0),this.derivatives=Array.isArray(e)?e:[e],this.id=N3,e.length===0&&(e.length>0,void 0),N3+=1}return ar(t,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(r,i){return i(n,r)},void 0)}}]),t})(),yg=new Gy;function Sv(t){var e=Array.isArray(t)?t:[t];return yg.has(e)||yg.set(e,new v8(e)),yg.get(e)}var RU=new WeakMap,wg={};function IU(t,e){for(var n=RU,r=0;r<e.length;r+=1){var i=e[r];n.has(i)||n.set(i,new WeakMap),n=n.get(i)}return n.has(wg)||n.set(wg,t()),n.get(wg)}var _3=new WeakMap;function od(t){var e=_3.get(t)||"";return e||(Object.keys(t).forEach(function(n){var r=t[n];e+=n,r instanceof v8?e+=r.id:r&&vt(r)==="object"?e+=od(r):e+=r}),e=Ad(e),_3.set(t,e)),e}function P3(t,e){return Ad("".concat(e,"_").concat(od(t)))}var Cv=Br();function Qe(t){return typeof t=="number"?"".concat(t,"px"):t}function Yh(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(i)return t;var s=ee(ee({},r),{},Y(Y({},Gl,e),Wi,n)),o=Object.keys(s).map(function(a){var l=s[a];return l?"".concat(a,'="').concat(l,'"'):null}).filter(function(a){return a}).join(" ");return"<style ".concat(o,">").concat(t,"</style>")}var Pf=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},AU=function(e,n,r){return Object.keys(e).length?".".concat(n).concat(r!=null&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(e).map(function(i){var s=Re(i,2),o=s[0],a=s[1];return"".concat(o,":").concat(a,";")}).join(""),"}"):""},b8=function(e,n,r){var i={},s={};return Object.entries(e).forEach(function(o){var a,l,c=Re(o,2),d=c[0],u=c[1];if(r!=null&&(a=r.preserve)!==null&&a!==void 0&&a[d])s[d]=u;else if((typeof u=="string"||typeof u=="number")&&!(r!=null&&(l=r.ignore)!==null&&l!==void 0&&l[d])){var f,h=Pf(d,r==null?void 0:r.prefix);i[h]=typeof u=="number"&&!(r!=null&&(f=r.unitless)!==null&&f!==void 0&&f[d])?"".concat(u,"px"):String(u),s[d]="var(".concat(h,")")}}),[s,AU(i,n,{scope:r==null?void 0:r.scope})]},M3=Br()?m.useLayoutEffect:m.useEffect,wn=function(e,n){var r=m.useRef(!0);M3(function(){return e(r.current)},n),M3(function(){return r.current=!1,function(){r.current=!0}},[])},D3=function(e,n){wn(function(r){if(!r)return e()},n)},OU=ee({},gp),L3=OU.useInsertionEffect,kU=function(e,n,r){m.useMemo(e,r),wn(function(){return n(!0)},r)},NU=L3?function(t,e,n){return L3(function(){return t(),e()},n)}:kU,_U=ee({},gp),PU=_U.useInsertionEffect,MU=function(e){var n=[],r=!1;function i(s){r||n.push(s)}return m.useEffect(function(){return r=!1,function(){r=!0,n.length&&n.forEach(function(s){return s()})}},e),i},DU=function(){return function(e){e()}},LU=typeof PU<"u"?MU:DU;function Ky(t,e,n,r,i){var s=m.useContext(fu),o=s.cache,a=[t].concat(st(e)),l=wv(a),c=LU([l]),d=function(p){o.opUpdate(l,function(g){var v=g||[void 0,void 0],b=Re(v,2),w=b[0],C=w===void 0?0:w,x=b[1],R=x,O=R||n(),T=[C,O];return p?p(T):T})};m.useMemo(function(){d()},[l]);var u=o.opGet(l),f=u[1];return NU(function(){i==null||i(f)},function(h){return d(function(p){var g=Re(p,2),v=g[0],b=g[1];return h&&v===0&&(i==null||i(f)),[v+1,b]}),function(){o.opUpdate(l,function(p){var g=p||[],v=Re(g,2),b=v[0],w=b===void 0?0:b,C=v[1],x=w-1;
394return x===0?(c(function(){(h||!o.opGet(l))&&(r==null||r(C,!1))}),null):[w-1,C]})}},[l]),f}var jU={},FU="css",ha=new Map;function BU(t){ha.set(t,(ha.get(t)||0)+1)}function HU(t,e){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(Gl,'="').concat(t,'"]'));n.forEach(function(r){if(r[Eo]===e){var i;(i=r.parentNode)===null||i===void 0||i.removeChild(r)}})}}var zU=0;function qU(t,e){ha.set(t,(ha.get(t)||0)-1);var n=new Set;ha.forEach(function(r,i){r<=0&&n.add(i)}),ha.size-n.size>zU&&n.forEach(function(r){HU(r,e),ha.delete(r)})}var UU=function(e,n,r,i){var s=r.getDerivativeToken(e),o=ee(ee({},s),n);return i&&(o=i(o)),o},y8="token";function VU(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=m.useContext(fu),i=r.cache.instanceId,s=r.container,o=n.salt,a=o===void 0?"":o,l=n.override,c=l===void 0?jU:l,d=n.formatToken,u=n.getComputedToken,f=n.cssVar,h=IU(function(){return Object.assign.apply(Object,[{}].concat(st(e)))},e),p=od(h),g=od(c),v=f?od(f):"",b=Ky(y8,[a,t.id,p,g,v],function(){var w,C=u?u(h,c,t):UU(h,c,t,d),x=ee({},C),R="";if(f){var O=b8(C,f.key,{prefix:f.prefix,ignore:f.ignore,unitless:f.unitless,preserve:f.preserve}),T=Re(O,2);C=T[0],R=T[1]}var S=P3(C,a);C._tokenKey=S,x._tokenKey=P3(x,a);var _=(w=f==null?void 0:f.key)!==null&&w!==void 0?w:S;C._themeKey=_,BU(_);var A="".concat(FU,"-").concat(Ad(S));return C._hashId=A,[C,A,x,R,(f==null?void 0:f.key)||""]},function(w){qU(w[0]._themeKey,i)},function(w){var C=Re(w,4),x=C[0],R=C[3];if(f&&R){var O=Ws(R,Ad("css-variables-".concat(x._themeKey)),{mark:Wi,prepend:"queue",attachTo:s,priority:-999});O[Eo]=i,O.setAttribute(Gl,x._themeKey)}});return b}var WU=function(e,n,r){var i=Re(e,5),s=i[2],o=i[3],a=i[4],l=r||{},c=l.plain;if(!o)return null;var d=s._tokenKey,u=-999,f={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},h=Yh(o,a,d,f,c);return[u,d,h]},GU={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},w8="comm",S8="rule",C8="decl",KU="@import",XU="@namespace",YU="@keyframes",JU="@layer",QU=Math.abs,ad=String.fromCharCode;function x8(t){return t.trim()}function xv(t,e,n){return t.replace(e,n)}function kl(t,e){return t.charCodeAt(e)|0}function Kl(t,e,n){return t.slice(e,n)}function us(t){return t.length}function ZU(t){return t.length}function of(t,e){return e.push(t),t}var Xp=1,Xl=1,$8=0,ki=0,Jn=0,ac="";function Xy(t,e,n,r,i,s,o,a){return{value:t,root:e,parent:n,type:r,props:i,children:s,line:Xp,column:Xl,length:o,return:"",siblings:a}}function eV(){return Jn}function tV(){return Jn=ki>0?kl(ac,--ki):0,Xl--,Jn===10&&(Xl=1,Xp--),Jn}function Gi(){return Jn=ki<$8?kl(ac,ki++):0,Xl++,Jn===10&&(Xl=1,Xp++),Jn}function To(){return kl(ac,ki)}function Mf(){return ki}function Yp(t,e){return Kl(ac,t,e)}function kd(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function nV(t){return Xp=Xl=1,$8=us(ac=t),ki=0,[]}function rV(t){return ac="",t}function Sg(t){return x8(Yp(ki-1,$v(t===91?t+2:t===40?t+1:t)))}function iV(t){for(;(Jn=To())&&Jn<33;)Gi();return kd(t)>2||kd(Jn)>3?"":" "}function sV(t,e){for(;--e&&Gi()&&!(Jn<48||Jn>102||Jn>57&&Jn<65||Jn>70&&Jn<97););return Yp(t,Mf()+(e<6&&To()==32&&Gi()==32))}function $v(t){for(;Gi();)switch(Jn){case t:return ki;case 34:case 39:t!==34&&t!==39&&$v(Jn);break;case 40:t===41&&$v(t);break;case 92:Gi();break}return ki}function oV(t,e){for(;Gi()&&t+Jn!==57;)if(t+Jn===84&&To()===47)break;
394return"/*"+Yp(e,ki-1)+"*"+ad(t===47?t:Gi())}function aV(t){for(;!kd(To());)Gi();return Yp(t,ki)}function lV(t){return rV(Df("",null,null,null,[""],t=nV(t),0,[0],t))}function Df(t,e,n,r,i,s,o,a,l){for(var c=0,d=0,u=o,f=0,h=0,p=0,g=1,v=1,b=1,w=0,C=0,x="",R=i,O=s,T=r,S=x;v;)switch(p=C,C=Gi()){case 40:p!=108&&kl(S,u-1)==58?(w++,S+="("):S+=Sg(C);break;case 41:w--,S+=")";break;case 34:case 39:case 91:S+=Sg(C);break;case 9:case 10:case 13:case 32:if(w>0){S+=ad(C);break}S+=iV(p);break;case 92:S+=sV(Mf()-1,7);continue;case 47:switch(To()){case 42:case 47:of(cV(oV(Gi(),Mf()),e,n,l),l),(kd(p||1)==5||kd(To()||1)==5)&&us(S)&&Kl(S,-1,void 0)!==" "&&(S+=" ");break;default:S+="/"}break;case 123*g:a[c++]=us(S)*b;case 125*g:case 59:case 0:if(w>0&&C){S+=ad(C);break}switch(C){case 0:case 125:v=0;case 59+d:b==-1&&(S=xv(S,/\f/g,"")),h>0&&(us(S)-u||g===0)&&of(h>32?F3(S+";",r,n,u-1,l):F3(xv(S," ","")+";",r,n,u-2,l),l);break;case 59:S+=";";default:if(of(T=j3(S,e,n,c,d,i,a,x,R=[],O=[],u,s),s),C===123)if(d===0)Df(S,e,T,T,R,s,u,a,O);else{switch(f){case 99:if(kl(S,3)===110)break;case 108:if(kl(S,2)===97)break;default:d=0;case 100:case 109:case 115:}d?Df(t,T,T,r&&of(j3(t,T,T,0,0,i,a,x,i,R=[],u,O),O),i,O,u,a,r?R:O):Df(S,T,T,T,[""],O,0,a,O)}}c=d=h=0,g=b=1,x=S="",u=o;break;case 58:u=1+us(S),h=p;default:if(g<1){if(C==123)--g;else if(C==125&&g++==0&&tV()==125)continue}switch(S+=ad(C),C*g){case 38:b=d>0?1:(S+="\f",-1);break;case 44:if(w>0)break;a[c++]=(us(S)-1)*b,b=1;break;case 64:To()===45&&(S+=Sg(Gi())),f=To(),d=u=us(x=S+=aV(Mf())),C++;break;case 45:p===45&&us(S)==2&&(g=0)}}return s}function j3(t,e,n,r,i,s,o,a,l,c,d,u){for(var f=i-1,h=i===0?s:[""],p=ZU(h),g=0,v=0,b=0;g<r;++g)for(var w=0,C=Kl(t,f+1,f=QU(v=o[g])),x=t;w<p;++w)(x=x8(v>0?h[w]+" "+C:xv(C,/&\f/g,h[w])))&&(l[b++]=x);return Xy(t,e,n,i===0?S8:a,l,c,d,u)}function cV(t,e,n,r){return Xy(t,e,n,w8,ad(eV()),Kl(t,2,-2),0,r)}function F3(t,e,n,r,i){return Xy(t,e,n,C8,Kl(t,0,r),Kl(t,r+1,-1),r,i)}function Ev(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function dV(t,e,n,r){switch(t.type){case JU:if(t.children.length)break;case KU:case XU:case C8:return t.return=t.return||t.value;case w8:return"";case YU:return t.return=t.value+"{"+Ev(t.children,r)+"}";case S8:if(!us(t.value=t.props.join(",")))return""}return us(n=Ev(t.children,r))?t.return=t.value+"{"+n+"}":""}var B3="data-ant-cssinjs-cache-path",E8="_FILE_STYLE__",Aa,T8=!0;function uV(){if(!Aa&&(Aa={},Br())){var t=document.createElement("div");t.className=B3,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);var e=getComputedStyle(t).content||"";e=e.replace(/^"/,"").replace(/"$/,""),e.split(";").forEach(function(i){var s=i.split(":"),o=Re(s,2),a=o[0],l=o[1];Aa[a]=l});var n=document.querySelector("style[".concat(B3,"]"));if(n){var r;T8=!1,(r=n.parentNode)===null||r===void 0||r.removeChild(n)}document.body.removeChild(t)}}function fV(t){return uV(),!!Aa[t]}function hV(t){var e=Aa[t],n=null;if(e&&Br())if(T8)n=E8;else{var r=document.querySelector("style[".concat(Wi,'="').concat(Aa[t],'"]'));r?n=r.innerHTML:delete Aa[t]}return[n,e]}var pV="_skip_check_",R8="_multi_value_";function Lf(t){var e=Ev(lV(t),dV);return e.replace(/\{%%%\:[^;];}/g,";")}function mV(t){return vt(t)==="object"&&t&&(pV in t||R8 in t)}function H3(t,e,n){if(!e)return t;var r=".".concat(e),i=n==="low"?":where(".concat(r,")"):r,s=t.split(",").map(function(o){var a,l=o.trim().split(/\s+/),c=l[0]||"",d=((a=c.match(/^\w+/))===null||a===void 0?void 0:a[0])||"";return c="".concat(d).concat(i).concat(c.slice(d.length)),[c].concat(st(l.slice(1))).join(" ")});return s.join(",")}var gV=function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},i=r.root,s=r.injectHash,o=r.parentSelectors,a=n.hashId,l=n.layer;n.path;var c=n.hashPriority,d=n.transformers,u=d===void 0?[]:d;n.linters;var f="",h={};function p(b){var w=b.getName(a);if(!h[w]){var C=t(b.style,n,{root:!1,parentSelectors:o}),x=Re(C,1),R=x[0];h[w]="@keyframes ".concat(b.getName(a)).concat(R)}}function g(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return b.forEach(function(C){Array.isArray(C)?g(C,w):C&&w.push(C)}),w}var v=g(Array.isArray(e)?e:[e]);return v.forEach(function(b){var w=typeof b=="string"&&!i?{}:b;if(typeof w=="string")f+="".concat(w,`
395`);else if(w._keyframe)p(w);else{var C=u.reduce(function(x,R){var O;return(R==null||(O=R.visit)===null||O===void 0?void 0:O.call(R,x))||x},w);
395Object.keys(C).forEach(function(x){var R=C[x];if(vt(R)==="object"&&R&&(x!=="animationName"||!R._keyframe)&&!mV(R)){var O=!1,T=x.trim(),S=!1;(i||s)&&a?T.startsWith("@")?O=!0:T==="&"?T=H3("",a,c):T=H3(x,a,c):i&&!a&&(T==="&"||T==="")&&(T="",S=!0);var _=t(R,n,{root:S,injectHash:O,parentSelectors:[].concat(st(o),[T])}),A=Re(_,2),$=A[0],E=A[1];h=ee(ee({},h),E),f+="".concat(T).concat($)}else{let B=function(j,z){var q=j.replace(/[A-Z]/g,function(Z){return"-".concat(Z.toLowerCase())}),ne=z;!GU[j]&&typeof ne=="number"&&ne!==0&&(ne="".concat(ne,"px")),j==="animationName"&&z!==null&&z!==void 0&&z._keyframe&&(p(z),ne=z.getName(a)),f+="".concat(q,":").concat(ne,";")};var I,D=(I=R==null?void 0:R.value)!==null&&I!==void 0?I:R;vt(R)==="object"&&R!==null&&R!==void 0&&R[R8]&&Array.isArray(D)?D.forEach(function(j){B(x,j)}):B(x,D)}})}}),i?l&&(f&&(f="@layer ".concat(l.name," {").concat(f,"}")),l.dependencies&&(h["@layer ".concat(l.name)]=l.dependencies.map(function(b){return"@layer ".concat(b,", ").concat(l.name,";")}).join(`
396`))):f="{".concat(f,"}"),[f,h]};function I8(t,e){return Ad("".concat(t.join("%")).concat(e))}function vV(){return null}var A8="style";function Tv(t,e){var n=t.token,r=t.path,i=t.hashId,s=t.layer,o=t.nonce,a=t.clientOnly,l=t.order,c=l===void 0?0:l,d=m.useContext(fu),u=d.autoClear;d.mock;var f=d.defaultCache,h=d.hashPriority,p=d.container,g=d.ssrInline,v=d.transformers,b=d.linters,w=d.cache,C=d.layer,x=n._tokenKey,R=[x];C&&R.push("layer"),R.push.apply(R,st(r));var O=Cv,T=Ky(A8,R,function(){var E=R.join("|");if(fV(E)){var I=hV(E),D=Re(I,2),B=D[0],j=D[1];if(B)return[B,x,j,{},a,c]}var z=e(),q=gV(z,{hashId:i,hashPriority:h,layer:C?s:void 0,path:r.join("-"),transformers:v,linters:b}),ne=Re(q,2),Z=ne[0],J=ne[1],de=Lf(Z),X=I8(R,de);return[de,x,X,J,a,c]},function(E,I){var D=Re(E,3),B=D[2];(I||u)&&Cv&&Od(B,{mark:Wi,attachTo:p})},function(E){var I=Re(E,4),D=I[0];I[1];var B=I[2],j=I[3];if(O&&D!==E8){var z={mark:Wi,prepend:C?!1:"queue",attachTo:p,priority:c},q=typeof o=="function"?o():o;q&&(z.csp={nonce:q});var ne=[],Z=[];Object.keys(j).forEach(function(de){de.startsWith("@layer")?ne.push(de):Z.push(de)}),ne.forEach(function(de){Ws(Lf(j[de]),"_layer-".concat(de),ee(ee({},z),{},{prepend:!0}))});var J=Ws(D,B,z);J[Eo]=w.instanceId,J.setAttribute(Gl,x),Z.forEach(function(de){Ws(Lf(j[de]),"_effect-".concat(de),z)})}}),S=Re(T,3),_=S[0],A=S[1],$=S[2];return function(E){var I;return!g||O||!f?I=m.createElement(vV,null):I=m.createElement("style",yt({},Y(Y({},Gl,A),Wi,$),{dangerouslySetInnerHTML:{__html:_}})),m.createElement(m.Fragment,null,I,E)}}var bV=function(e,n,r){var i=Re(e,6),s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],d=i[5],u=r||{},f=u.plain;if(c)return null;var h=s,p={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)};return h=Yh(s,o,a,p,f),l&&Object.keys(l).forEach(function(g){if(!n[g]){n[g]=!0;var v=Lf(l[g]),b=Yh(v,o,"_effect-".concat(g),p,f);g.startsWith("@layer")?h=b+h:h+=b}}),[d,a,h]},O8="cssVar",yV=function(e,n){var r=e.key,i=e.prefix,s=e.unitless,o=e.ignore,a=e.token,l=e.scope,c=l===void 0?"":l,d=m.useContext(fu),u=d.cache.instanceId,f=d.container,h=a._tokenKey,p=[].concat(st(e.path),[r,c,h]),g=Ky(O8,p,function(){var v=n(),b=b8(v,r,{prefix:i,unitless:s,ignore:o,scope:c}),w=Re(b,2),C=w[0],x=w[1],R=I8(p,x);return[C,x,R,r]},function(v){var b=Re(v,3),w=b[2];Cv&&Od(w,{mark:Wi,attachTo:f})},function(v){var b=Re(v,3),w=b[1],C=b[2];if(w){var x=Ws(w,C,{mark:Wi,prepend:"queue",attachTo:f,priority:-999});x[Eo]=u,x.setAttribute(Gl,r)}});return g},wV=function(e,n,r){var i=Re(e,4),s=i[1],o=i[2],a=i[3],l=r||{},c=l.plain;if(!s)return null;var d=-999,u={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},f=Yh(s,a,o,u,c);return[d,o,f]};Y(Y(Y({},A8,bV),y8,WU),O8,wV);var nn=(function(){function t(e,n){or(this,t),Y(this,"name",void 0),Y(this,"style",void 0),Y(this,"_keyframe",!0),this.name=e,this.style=n}return ar(t,[{key:"getName",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?"".concat(n,"-").concat(this.name):this.name}}]),t})();function rl(t){return t.notSplit=!0,t}rl(["borderTop","borderBottom"]),rl(["borderTop"]),rl(["borderBottom"]),rl(["borderLeft","borderRight"]),rl(["borderLeft"]),rl(["borderRight"]);var Yy=m.createContext({});function k8(t){return f8(t)||l8(t)||Uy(t)||h8()}function ps(t,e){for(var n=t,r=0;r<e.length;r+=1){if(n==null)return;n=n[e[r]]}return n}function N8(t,e,n,r){if(!e.length)return n;var i=k8(e),s=i[0],o=i.slice(1),a;return!t&&typeof s=="number"?a=[]:Array.isArray(t)?a=st(t):a=ee({},t),r&&n===void 0&&o.length===1?delete a[s][o[0]]:a[s]=N8(a[s],o,n,r),a}function Fi(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&r&&n===void 0&&!ps(t,e.slice(0,-1))?t:N8(t,e,n,r)}function SV(t){return vt(t)==="object"&&t!==null&&Object.getPrototypeOf(t)===Object.prototype}function z3(t){return Array.isArray(t)?[]:{}}var CV=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function Cl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=z3(e[0]);
396return e.forEach(function(i){function s(o,a){var l=new Set(a),c=ps(i,o),d=Array.isArray(c);if(d||SV(c)){if(!l.has(c)){l.add(c);var u=ps(r,o);d?r=Fi(r,o,[]):(!u||vt(u)!=="object")&&(r=Fi(r,o,z3(c))),CV(c).forEach(function(f){s([].concat(st(o),[f]),l)})}}else r=Fi(r,o,c)}s([])}),r}function xV(){}const $V=m.createContext({}),EV=()=>{const t=()=>{};return t.deprecated=xV,t},TV=m.createContext(void 0);var RV={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},IV={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},AV=ee(ee({},IV),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const _8={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},q3={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},AV),timePickerLocale:Object.assign({},_8)},si="${label} is not a valid ${type}",Fo={locale:"en",Pagination:RV,DatePicker:q3,TimePicker:_8,Calendar:q3,global:{placeholder:"Please select",close:"Close"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:si,method:si,array:si,object:si,number:si,date:si,boolean:si,integer:si,float:si,regexp:si,email:si,url:si,hex:si},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"}
396,ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};let jf=Object.assign({},Fo.Modal),Ff=[];const U3=()=>Ff.reduce((t,e)=>Object.assign(Object.assign({},t),e),Fo.Modal);function OV(t){if(t){const e=Object.assign({},t);return Ff.push(e),jf=U3(),()=>{Ff=Ff.filter(n=>n!==e),jf=U3()}}jf=Object.assign({},Fo.Modal)}function P8(){return jf}const Jy=m.createContext(void 0),Ba=(t,e)=>{const n=m.useContext(Jy),r=m.useMemo(()=>{var s;const o=e||Fo[t],a=(s=n==null?void 0:n[t])!==null&&s!==void 0?s:{};return Object.assign(Object.assign({},typeof o=="function"?o():o),a||{})},[t,e,n]),i=m.useMemo(()=>{const s=n==null?void 0:n.locale;return n!=null&&n.exist&&!s?Fo.locale:s},[n]);return[r,i]},kV="internalMark",NV=t=>{const{locale:e={},children:n,_ANT_MARK__:r}=t;m.useEffect(()=>OV(e==null?void 0:e.Modal),[e]);const i=m.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return m.createElement(Jy.Provider,{value:i},n)},M8={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},Nd=Object.assign(Object.assign({},M8),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
397'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
398'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),cr=Math.round;function Cg(t,e){const n=t.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(i=>parseFloat(i));for(let i=0;i<3;i+=1)r[i]=e(r[i]||0,n[i]||"",i);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const V3=(t,e,n)=>n===0?t:t/100;function Ic(t,e){const n=e||255;return t>n?n:t<0?0:t}class mn{constructor(e){Y(this,"isValid",!0),Y(this,"r",0),Y(this,"g",0),Y(this,"b",0),Y(this,"a",1),Y(this,"_h",void 0),Y(this,"_s",void 0),Y(this,"_l",void 0),Y(this,"_v",void 0),Y(this,"_max",void 0),Y(this,"_min",void 0),Y(this,"_brightness",void 0);function n(r){return r[0]in e&&r[1]in e&&r[2]in e}if(e)if(typeof e=="string"){let i=function(s){return r.startsWith(s)};const r=e.trim();/^#?[A-F\d]{3,8}$/i.test(r)?this.fromHexString(r):i("rgb")?this.fromRgbString(r):i("hsl")?this.fromHslString(r):(i("hsv")||i("hsb"))&&this.fromHsvString(r)}else if(e instanceof mn)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(n("rgb"))this.r=Ic(e.r),this.g=Ic(e.g),this.b=Ic(e.b),this.a=typeof e.a=="number"?Ic(e.a,1):1;else if(n("hsl"))this.fromHsl(e);else if(n("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const n=this.toHsv();return n.h=e,this._c(n)}getLuminance(){function e(s){const o=s/255;return o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)}const n=e(this.r),r=e(this.g),i=e(this.b);return .2126*n+.7152*r+.0722*i}getHue(){if(typeof this._h>"u"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=cr(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()-e/100;return i<0&&(i=0),this._c({h:n,s:r,l:i,a:this.a})}lighten(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()+e/100;return i>1&&(i=1),this._c({h:n,s:r,l:i,a:this.a})}mix(e,n=50){const r=this._c(e),i=n/100,s=a=>(r[a]-this[a])*i+this[a],o={r:cr(s("r")),g:cr(s("g")),b:cr(s("b")),a:cr(s("a")*100)/100};return this._c(o)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}
398onBackground(e){const n=this._c(e),r=this.a+n.a*(1-this.a),i=s=>cr((this[s]*this.a+n[s]*n.a*(1-this.a))/r);return this._c({r:i("r"),g:i("g"),b:i("b"),a:r})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const n=(this.r||0).toString(16);e+=n.length===2?n:"0"+n;const r=(this.g||0).toString(16);e+=r.length===2?r:"0"+r;const i=(this.b||0).toString(16);if(e+=i.length===2?i:"0"+i,typeof this.a=="number"&&this.a>=0&&this.a<1){const s=cr(this.a*255).toString(16);e+=s.length===2?s:"0"+s}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),n=cr(this.getSaturation()*100),r=cr(this.getLightness()*100);return this.a!==1?`hsla(${e},${n}%,${r}%,${this.a})`:`hsl(${e},${n}%,${r}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,n,r){const i=this.clone();return i[e]=Ic(n,r),i}_c(e){return new this.constructor(e)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const n=e.replace("#","");function r(i,s){return parseInt(n[i]+n[s||i],16)}n.length<6?(this.r=r(0),this.g=r(1),this.b=r(2),this.a=n[3]?r(3)/255:1):(this.r=r(0,1),this.g=r(2,3),this.b=r(4,5),this.a=n[6]?r(6,7)/255:1)}fromHsl({h:e,s:n,l:r,a:i}){if(this._h=e%360,this._s=n,this._l=r,this.a=typeof i=="number"?i:1,n<=0){const f=cr(r*255);this.r=f,this.g=f,this.b=f}let s=0,o=0,a=0;const l=e/60,c=(1-Math.abs(2*r-1))*n,d=c*(1-Math.abs(l%2-1));l>=0&&l<1?(s=c,o=d):l>=1&&l<2?(s=d,o=c):l>=2&&l<3?(o=c,a=d):l>=3&&l<4?(o=d,a=c):l>=4&&l<5?(s=d,a=c):l>=5&&l<6&&(s=c,a=d);const u=r-c/2;this.r=cr((s+u)*255),this.g=cr((o+u)*255),this.b=cr((a+u)*255)}fromHsv({h:e,s:n,v:r,a:i}){this._h=e%360,this._s=n,this._v=r,this.a=typeof i=="number"?i:1;const s=cr(r*255);if(this.r=s,this.g=s,this.b=s,n<=0)return;const o=e/60,a=Math.floor(o),l=o-a,c=cr(r*(1-n)*255),d=cr(r*(1-n*l)*255),u=cr(r*(1-n*(1-l))*255);switch(a){case 0:this.g=u,this.b=c;break;case 1:this.r=d,this.b=c;break;case 2:this.r=c,this.b=u;break;case 3:this.r=c,this.g=d;break;case 4:this.r=u,this.g=c;break;case 5:default:this.g=c,this.b=d;break}}fromHsvString(e){const n=Cg(e,V3);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(e){const n=Cg(e,V3);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(e){const n=Cg(e,(r,i)=>i.includes("%")?cr(r/100*255):r);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}var af=2,W3=.16,_V=.05,PV=.05,MV=.15,D8=5,L8=4,DV=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function G3(t,e,n){var r;return Math.round(t.h)>=60&&Math.round(t.h)<=240?r=n?Math.round(t.h)-af*e:Math.round(t.h)+af*e:r=n?Math.round(t.h)+af*e:Math.round(t.h)-af*e,r<0?r+=360:r>=360&&(r-=360),r}function K3(t,e,n){if(t.h===0&&t.s===0)return t.s;var r;return n?r=t.s-W3*e:e===L8?r=t.s+W3:r=t.s+_V*e,r>1&&(r=1),n&&e===D8&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function X3(t,e,n){var r;return n?r=t.v+PV*e:r=t.v-MV*e,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function _d(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=new mn(t),i=r.toHsv(),s=D8;s>0;s-=1){var o=new mn({h:G3(i,s,!0),s:K3(i,s,!0),v:X3(i,s,!0)});n.push(o)}n.push(r);for(var a=1;a<=L8;a+=1){var l=new mn({h:G3(i,a),s:K3(i,a),v:X3(i,a)});n.push(l)}return e.theme==="dark"?DV.map(function(c){var d=c.index,u=c.amount;return new mn(e.backgroundColor||"#141414").mix(n[d],u).toHexString()}):n.map(function(c){return c.toHexString()})}var xg={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Rv=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];Rv.primary=Rv[5];var Iv=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];Iv.primary=Iv[5];var Av=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];Av.primary=Av[5];var Ov=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];Ov.primary=Ov[5];
398var kv=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];kv.primary=kv[5];var Nv=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];Nv.primary=Nv[5];var _v=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];_v.primary=_v[5];var Pv=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];Pv.primary=Pv[5];var Jh=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Jh.primary=Jh[5];var Mv=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];Mv.primary=Mv[5];var Dv=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];Dv.primary=Dv[5];var Lv=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];Lv.primary=Lv[5];var jv=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];jv.primary=jv[5];var $g={red:Rv,volcano:Iv,orange:Av,gold:Ov,yellow:kv,lime:Nv,green:_v,cyan:Pv,blue:Jh,geekblue:Mv,purple:Dv,magenta:Lv,grey:jv};function LV(t,{generateColorPalettes:e,generateNeutralColorPalettes:n}){const{colorSuccess:r,colorWarning:i,colorError:s,colorInfo:o,colorPrimary:a,colorBgBase:l,colorTextBase:c}=t,d=e(a),u=e(r),f=e(i),h=e(s),p=e(o),g=n(l,c),v=t.colorLink||t.colorInfo,b=e(v),w=new mn(h[1]).mix(new mn(h[3]),50).toHexString();return Object.assign(Object.assign({},g),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:
398d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:u[1],colorSuccessBgHover:u[2],colorSuccessBorder:u[3],colorSuccessBorderHover:u[4],colorSuccessHover:u[4],colorSuccess:u[6],colorSuccessActive:u[7],colorSuccessTextHover:u[8],colorSuccessText:u[9],colorSuccessTextActive:u[10],colorErrorBg:h[1],colorErrorBgHover:h[2],colorErrorBgFilledHover:w,colorErrorBgActive:h[3],colorErrorBorder:h[3],colorErrorBorderHover:h[4],colorErrorHover:h[5],colorError:h[6],colorErrorActive:h[7],colorErrorTextHover:h[8],colorErrorText:h[9],colorErrorTextActive:h[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:p[1],colorInfoBgHover:p[2],colorInfoBorder:p[3],colorInfoBorderHover:p[4],colorInfoHover:p[4],colorInfo:p[6],colorInfoActive:p[7],colorInfoTextHover:p[8],colorInfoText:p[9],colorInfoTextActive:p[10],colorLinkHover:b[4],colorLink:b[6],colorLinkActive:b[7],colorBgMask:new mn("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const jV=t=>{let e=t,n=t,r=t,i=t;return t<6&&t>=5?e=t+1:t<16&&t>=6?e=t+2:t>=16&&(e=16),t<7&&t>=5?n=4:t<8&&t>=7?n=5:t<14&&t>=8?n=6:t<16&&t>=14?n=7:t>=16&&(n=8),t<6&&t>=2?r=1:t>=6&&(r=2),t>4&&t<8?i=4:t>=8&&(i=6),{borderRadius:t,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:e,borderRadiusOuter:i}};function FV(t){const{motionUnit:e,motionBase:n,borderRadius:r,lineWidth:i}=t;return Object.assign({motionDurationFast:`${(n+e).toFixed(1)}s`,motionDurationMid:`${(n+e*2).toFixed(1)}s`,motionDurationSlow:`${(n+e*3).toFixed(1)}s`,lineWidthBold:i+1},jV(r))}const BV=t=>{const{controlHeight:e}=t;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};function Bf(t){return(t+8)/t}function HV(t){const e=Array.from({length:10}).map((n,r)=>{const i=r-1,s=t*Math.pow(Math.E,i/5),o=r>1?Math.floor(s):Math.ceil(s);return Math.floor(o/2)*2});return e[1]=t,e.map(n=>({size:n,lineHeight:Bf(n)}))}const zV=t=>{const e=HV(t),n=e.map(d=>d.size),r=e.map(d=>d.lineHeight),i=n[1],s=n[0],o=n[2],a=r[1],l=r[0],c=r[2];return{fontSizeSM:s,fontSize:i,fontSizeLG:o,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:a,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(a*i),fontHeightLG:Math.round(c*o),fontHeightSM:Math.round(l*s),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function qV(t){const{sizeUnit:e,sizeStep:n}=t;return{sizeXXL:e*(n+8),sizeXL:e*(n+4),sizeLG:e*(n+2),sizeMD:e*(n+1),sizeMS:e*n,size:e*n,sizeSM:e*(n-1),sizeXS:e*(n-2),sizeXXS:e*(n-3)}}const Si=(t,e)=>new mn(t).setA(e).toRgbString(),Ac=(t,e)=>new mn(t).darken(e).toHexString(),UV=t=>{const e=_d(t);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},VV=(t,e)=>{const n=t||"#fff",r=e||"#000";return{colorBgBase:n,colorTextBase:r,colorText:Si(r,.88),colorTextSecondary:Si(r,.65),colorTextTertiary:Si(r,.45),colorTextQuaternary:Si(r,.25),colorFill:Si(r,.15),colorFillSecondary:Si(r,.06),colorFillTertiary:Si(r,.04),colorFillQuaternary:Si(r,.02),colorBgSolid:Si(r,1),colorBgSolidHover:Si(r,.75),colorBgSolidActive:Si(r,.95),colorBgLayout:Ac(n,4),colorBgContainer:Ac(n,0),colorBgElevated:Ac(n,0),colorBgSpotlight:Si(r,.85),colorBgBlur:"transparent",colorBorder:Ac(n,15),colorBorderSecondary:Ac(n,6)}};function WV(t){xg.pink=xg.magenta,$g.pink=$g.magenta;const e=Object.keys(M8).map(n=>{const r=t[n]===xg[n]?$g[n]:_d(t[n]);return Array.from({length:10},()=>1).reduce((i,s,o)=>(i[`${n}-${o+1}`]=r[o],i[`${n}${o+1}`]=r[o],i),{})}).reduce((n,r)=>(n=Object.assign(Object.assign({},n),r),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),e),LV(t,{generateColorPalettes:UV,generateNeutralColorPalettes:VV})),zV(t.fontSize)),qV(t)),BV(t)),FV(t))}const j8=Sv(WV),Fv={token:Nd,override:{override:Nd},hashed:!0},F8=Te.createContext(Fv),Pd="ant",Jp="anticon",GV=["outlined","borderless","filled","underlined"],KV=(t,e)=>e||(t?`${Pd}-${t}`:Pd),ln=m.createContext({getPrefixCls:KV,iconPrefixCls:Jp}),{Consumer:Uce}=ln,Y3={};function Ha(t){const e=m.useContext(ln),{getPrefixCls:n,direction:r,getPopupContainer:i}=e,s=e[t];return Object.assign(Object.assign({classNames:Y3,styles:Y3},s),{getPrefixCls:n,direction:r,getPopupContainer:i})}const XV=`-ant-${Date.now()}-${Math.random()}`;function YV(t,e){const n={},r=(o,a)=>{let l=o.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},i=(o,a)=>{const l=new mn(o),c=_d(l.toRgbString());n[`${a}-color`]=r(l),n[`${a}-color-disabled`]=c[1],n[`${a}-color-hover`]=c[4],n[`${a}-color-active`]=c[6],n[`${a}-color-outline`]=l.clone().setA(.2).toRgbString(),n[`${a}-color-deprecated-bg`]=c[0],n[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){i(e.primaryColor,"primary");const o=new mn(e.primaryColor),a=_d(o.toRgbString());a.forEach((c,d)=>{n[`primary-${d+1}`]=c}),n["primary-color-deprecated-l-35"]=r(o,c=>c.lighten(35)),n["primary-color-deprecated-l-20"]=r(o,c=>c.lighten(20)),n["primary-color-deprecated-t-20"]=r(o,c=>c.tint(20)),n["primary-color-deprecated-t-50"]=r(o,c=>c.tint(50)),n["primary-color-deprecated-f-12"]=r(o,c=>c.setA(c.a*.12));const l=new mn(a[0]);n["primary-color-active-deprecated-f-30"]=r(l,c=>c.setA(c.a*.3)),n["primary-color-active-deprecated-d-02"]=r(l,c=>c.darken(2))}return e.successColor&&i(e.successColor,"success"),e.warningColor&&i(e.warningColor,"warning"),e.errorColor&&i(e.errorColor,"error"),e.infoColor&&i(e.infoColor,"info"),`
399  :root {
400    ${Object.keys(n).map(o=>`--${t}-${o}: ${n[o]};`).join(`
401`)}
402  }
403  `.trim()}function JV(t,e){const n=YV(t,e);Br()&&Ws(n,`${XV}-dynamic-theme`)}const Bo=m.createContext(!1),B8=({children:t,disabled:e})=>{const n=m.useContext(Bo);return m.createElement(Bo.Provider,{value:e??n},t)},Yl=m.createContext(void 0),QV=({children:t,size:e})=>{const n=m.useContext(Yl);return m.createElement(Yl.Provider,{value:e||n},t)};function ZV(){const t=m.useContext(Bo),e=m.useContext(Yl);return{componentDisabled:t,componentSize:e}}var H8=ar(function t(){or(this,t)}),z8="CALC_UNIT",eW=new RegExp(z8,"g");function Eg(t){return typeof t=="number"?"".concat(t).concat(z8):t}var tW=(function(t){Go(n,t);var e=Ko(n);function n(r,i){var s;or(this,n),s=e.call(this),Y(jt(s),"result",""),Y(jt(s),"unitlessCssVar",void 0),Y(jt(s),"lowPriority",void 0);var o=vt(r);return s.unitlessCssVar=i,r instanceof n?s.result="(".concat(r.result,")"):o==="number"?s.result=Eg(r):o==="str
403ing"&&(s.result=r),s}return ar(n,[{key:"add",value:function(i){return i instanceof n?this.result="".concat(this.result," + ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," + ").concat(Eg(i))),this.lowPriority=!0,this}},{key:"sub",value:function(i){return i instanceof n?this.result="".concat(this.result," - ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," - ").concat(Eg(i))),this.lowPriority=!0,this}},{key:"mul",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," * ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," * ").concat(i)),this.lowPriority=!1,this}},{key:"div",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," / ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," / ").concat(i)),this.lowPriority=!1,this}},{key:"getResult",value:function(i){return this.lowPriority||i?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(i){var s=this,o=i||{},a=o.unit,l=!0;return typeof a=="boolean"?l=a:Array.from(this.unitlessCssVar).some(function(c){return s.result.includes(c)})&&(l=!1),this.result=this.result.replace(eW,l?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),n})(H8),nW=(function(t){Go(n,t);var e=Ko(n);function n(r){var i;return or(this,n),i=e.call(this),Y(jt(i),"result",0),r instanceof n?i.result=r.result:typeof r=="number"&&(i.result=r),i}return ar(n,[{key:"add",value:function(i){return i instanceof n?this.result+=i.result:typeof i=="number"&&(this.result+=i),this}},{key:"sub",value:function(i){return i instanceof n?this.result-=i.result:typeof i=="number"&&(this.result-=i),this}},{key:"mul",value:function(i){return i instanceof n?this.result*=i.result:typeof i=="number"&&(this.result*=i),this}},{key:"div",value:function(i){return i instanceof n?this.result/=i.result:typeof i=="number"&&(this.result/=i),this}},{key:"equal",value:function(){return this.result}}]),n})(H8),rW=function(e,n){var r=e==="css"?tW:nW;return function(i){return new r(i,n)}},J3=function(e,n){return"".concat([n,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function nr(t){var e=m.useRef();e.current=t;var n=m.useCallback(function(){for(var r,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return(r=e.current)===null||r===void 0?void 0:r.call.apply(r,[e].concat(s))},[]);return n}function Jl(t){var e=m.useRef(!1),n=m.useState(t),r=Re(n,2),i=r[0],s=r[1];m.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function o(a,l){l&&e.current||s(a)}return[i,o]}function Tg(t){return t!==void 0}function Ho(t,e){var n=e||{},r=n.defaultValue,i=n.value,s=n.onChange,o=n.postState,a=Jl(function(){return Tg(i)?i:Tg(r)?typeof r=="function"?r():r:typeof t=="function"?t():t}),l=Re(a,2),c=l[0],d=l[1],u=i!==void 0?i:c,f=o?o(u):u,h=nr(s),p=Jl([u]),g=Re(p,2),v=g[0],b=g[1];D3(function(){var C=v[0];c!==C&&h(c,C)},[v]),D3(function(){Tg(i)||d(i)},[i]);var w=nr(function(C,x){d(C,x),b([u],x)});return[f,w]}function Q3(t,e,n,r){var i=ee({},e[t]);if(r!=null&&r.deprecatedTokens){var s=r.deprecatedTokens;s.forEach(function(a){var l=Re(a,2),c=l[0],d=l[1];if(i!=null&&i[c]||i!=null&&i[d]){var u;(u=i[d])!==null&&u!==void 0||(i[d]=i==null?void 0:i[c])}})}var o=ee(ee({},n),i);return Object.keys(o).forEach(function(a){o[a]===e[a]&&delete o[a]}),o}var q8=typeof CSSINJS_STATISTIC<"u",Bv=!0;function jn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(!q8)return Object.assign.apply(Object,[{}].concat(e));Bv=!1;var r={};return e.forEach(function(i){if(vt(i)==="object"){var s=Object.keys(i);s.forEach(function(o){Object.defineProperty(r,o,{configurable:!0,enumerable:!0,get:function(){return i[o]}})})}}),Bv=!0,r}var Z3={};function iW(){}var sW=function(e){var n,r=e,i=iW;return q8&&typeof Proxy<"u"&&(n=new Set,r=new Proxy(e,{get:function(o,a){if(Bv){var l;(l=n)===null||l===void 0||l.add(a)}return o[a]}}),i=function(o,a){var l;Z3[o]={global:Array.from(n),component:ee(ee({},(l=Z3[o])===null||l===void 0?void 0:l.component),a)}}),{token:r,keys:n,flush:i}};function ex(t,e,n){if(typeof n=="function"){var r;return n(jn(e,(r=e[t])!==null&&r!==void 0?r:{}))}return n??{}}function oW(t){return t==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return"max(".concat(r.map(function(s){return Qe(s)}).join(","),")")},min:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return"min(".concat(r.map(function(s){return Qe(s)}).join(","),")")}}}var aW=1e3*60*10,lW=(function(){function t(){or(this,t),Y(this,"map",new Map),Y
403(this,"objectIDMap",new WeakMap),Y(this,"nextID",0),Y(this,"lastAccessBeat",new Map),Y(this,"accessBeat",0)}return ar(t,[{key:"set",value:function(n,r){this.clear();var i=this.getCompositeKey(n);this.map.set(i,r),this.lastAccessBeat.set(i,Date.now())}},{key:"get",value:function(n){var r=this.getCompositeKey(n),i=this.map.get(r);return this.lastAccessBeat.set(r,Date.now()),this.accessBeat+=1,i}},{key:"getCompositeKey",value:function(n){var r=this,i=n.map(function(s){return s&&vt(s)==="object"?"obj_".concat(r.getObjectID(s)):"".concat(vt(s),"_").concat(s)});return i.join("|")}},{key:"getObjectID",value:function(n){if(this.objectIDMap.has(n))return this.objectIDMap.get(n);var r=this.nextID;return this.objectIDMap.set(n,r),this.nextID+=1,r}},{key:"clear",value:function(){var n=this;if(this.accessBeat>1e4){var r=Date.now();this.lastAccessBeat.forEach(function(i,s){r-i>aW&&(n.map.delete(s),n.lastAccessBeat.delete(s))}),this.accessBeat=0}}}]),t})(),tx=new lW;function cW(t,e){return Te.useMemo(function(){var n=tx.get(e);if(n)return n;var r=t();return tx.set(e,r),r},e)}var dW=function(){return{}};function uW(t){var e=t.useCSP,n=e===void 0?dW:e,r=t.useToken,i=t.usePrefix,s=t.getResetStyles,o=t.getCommonStyle,a=t.getCompUnitless;function l(f,h,p,g){var v=Array.isArray(f)?f[0]:f;function b(S){return"".concat(String(v)).concat(S.slice(0,1).toUpperCase()).concat(S.slice(1))}var w=(g==null?void 0:g.unitless)||{},C=typeof a=="function"?a(f):{},x=ee(ee({},C),{},Y({},b("zIndexPopup"),!0));
403Object.keys(w).forEach(function(S){x[b(S)]=w[S]});var R=ee(ee({},g),{},{unitless:x,prefixToken:b}),O=d(f,h,p,R),T=c(v,p,R);return function(S){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S,A=O(S,_),$=Re(A,2),E=$[1],I=T(_),D=Re(I,2),B=D[0],j=D[1];return[B,E,j]}}function c(f,h,p){var g=p.unitless,v=p.injectStyle,b=v===void 0?!0:v,w=p.prefixToken,C=p.ignore,x=function(T){var S=T.rootCls,_=T.cssVar,A=_===void 0?{}:_,$=r(),E=$.realToken;return yV({path:[f],prefix:A.prefix,key:A.key,unitless:g,ignore:C,token:E,scope:S},function(){var I=ex(f,E,h),D=Q3(f,E,I,{deprecatedTokens:p==null?void 0:p.deprecatedTokens});return Object.keys(I).forEach(function(B){D[w(B)]=D[B],delete D[B]}),D}),null},R=function(T){var S=r(),_=S.cssVar;return[function(A){return b&&_?Te.createElement(Te.Fragment,null,Te.createElement(x,{rootCls:T,cssVar:_,component:f}),A):A},_==null?void 0:_.key]};return R}function d(f,h,p){var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},v=Array.isArray(f)?f:[f,f],b=Re(v,1),w=b[0],C=v.join("-"),x=t.layer||{name:"antd"};return function(R){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R,T=r(),S=T.theme,_=T.realToken,A=T.hashId,$=T.token,E=T.cssVar,I=i(),D=I.rootPrefixCls,B=I.iconPrefixCls,j=n(),z=E?"css":"js",q=cW(function(){var V=new Set;return E&&Object.keys(g.unitless||{}).forEach(function(te){V.add(Pf(te,E.prefix)),V.add(Pf(te,J3(w,E.prefix)))}),rW(z,V)},[z,w,E==null?void 0:E.prefix]),ne=oW(z),Z=ne.max,J=ne.min,de={theme:S,token:$,hashId:A,nonce:function(){return j.nonce},clientOnly:g.clientOnly,layer:x,order:g.order||-999};typeof s=="function"&&Tv(ee(ee({},de),{},{clientOnly:!1,path:["Shared",D]}),function(){return s($,{prefix:{rootPrefixCls:D,iconPrefixCls:B},csp:j})});var X=Tv(ee(ee({},de),{},{path:[C,R,B]}),function(){if(g.injectStyle===!1)return[];var V=sW($),te=V.token,ie=V.flush,ce=ex(w,_,p),ae=".".concat(R),ve=Q3(w,_,ce,{deprecatedTokens:g.deprecatedTokens});E&&ce&&vt(ce)==="object"&&Object.keys(ce).forEach(function(fe){ce[fe]="var(".concat(Pf(fe,J3(w,E.prefix)),")")});var xe=jn(te,{componentCls:ae,prefixCls:R,iconCls:".".concat(B),antCls:".".concat(D),calc:q,max:Z,min:J},E?ce:ve),ge=h(xe,{hashId:A,prefixCls:R,rootPrefixCls:D,iconPrefixCls:B});ie(w,ve);var le=typeof o=="function"?o(xe,R,O,g.resetFont):null;return[g.resetStyle===!1?null:le,ge]});return[X,A]}}function u(f,h,p){var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},v=d(f,h,p,ee({resetStyle:!1,order:-998},g)),b=function(C){var x=C.prefixCls,R=C.rootCls,O=R===void 0?x:R;return v(x,O),null};return b}return{genStyleHooks:l,genSubStyleComponent:u,genComponentStyleHook:d}}const Qy=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],fW="5.29.3";function Rg(t){return t>=0&&t<=255}function Bc(t,e){const{r:n,g:r,b:i,a:s}=new mn(t).toRgb();if(s<1)return t;const{r:o,g:a,b:l}=new mn(e).toRgb();for(let c=.01;c<=1;c+=.01){const d=Math.round((n-o*(1-c))/c),u=Math.round((r-a*(1-c))/c),f=Math.round((i-l*(1-c))/c);if(Rg(d)&&Rg(u)&&Rg(f))return new mn({r:d,g:u,b:f,a:Math.round(c*100)/100}).toRgbString()}return new mn({r:n,g:r,b:i,a:1}).toRgbString()}var hW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function U8(t){const{override:e}=t,n=hW(t,["override"]),r=Object.assign({},e);Object.keys(Nd).forEach(f=>{delete r[f]});const i=Object.assign(Object.assign({},n),r),s=480,o=576,a=768,l=992,c=1200,d=1600;return i.motion===!1&&(i.motionDurationFast="0s",i.motionDurationMid="0s",i.motionDurationSlow="0s"),Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:Bc(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:Bc(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:Bc(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:Bc(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:`
404      0 6px 16px 0 rgba(0, 0, 0, 0.08),
405      0 3px 6px -4px rgba(0, 0, 0, 0.12),
406      0 9px 28px 8px rgba(0, 0, 0, 0.05)
407    `,boxShadowSecondary:`
408      0 6px 16px 0 rgba(0, 0, 0, 0.08),
409      0 3px 6px -4px rgba(0, 0, 0, 0.12),
410      0 9px 28px 8px rgba(0, 0, 0, 0.05)
411    `,boxShadowTertiary:`
412      0 1px 2px 0 rgba(0, 0, 0, 0.03),
413      0 1px 6px -1px rgba(0, 0, 0, 0.02),
414      0 2px 4px 0 rgba(0, 0, 0, 0.02)
415    `,screenXS:s,screenXSMin:s,screenXSMax:o-1,screenSM:o,screenSMMin:o,screenSMMax:a-1,screenMD:a,screenMDMin:a,screenMDMax:l-1,screenLG:l,screenLGMin:l,screenLGMax:c-1,screenXL:c,screenXLMin:c,screenXLMax:d-1,screenXXL:d,screenXXLMin:d,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`
416      0 1px 2px -2px ${new mn("rgba(0, 0, 0, 0.16)").toRgbString()},
417      0 3px 6px 0 ${new mn("rgba(0, 0, 0, 0.12)").toRgbString()},
418      0 5px 12px 4px ${new mn("rgba(0, 0, 0, 0.09)").toRgbString()}
419    `,boxShadowDrawerRight:`
420      -6px 0 16px 0 rgba(0, 0, 0, 0.08),
421      -3px 0 6px -4px rgba(0, 0, 0, 0.12),
422      -9px 0 28px 8px rgba(0, 0, 0, 0.05)
423    `,boxShadowDrawerLeft:`
424      6px 0 16px 0 rgba(0, 0, 0, 0.08),
425      3px 0 6px -4px rgba(0, 0, 0, 0.12),
426      9px 0 28px 8px rgba(0, 0, 0, 0.05)
427    `,boxShadowDrawerUp:`
428      0 6px 16px 0 rgba(0, 0, 0, 0.08),
429      0 3px 6px -4px rgba(0, 0, 0, 0.12),
430      0 9px 28px 8px rgba(0, 0, 0, 0.05)
431    `,boxShadowDrawerDown:`
432      0 -6px 16px 0 rgba(0, 0, 0, 0.08),
433      0 -3px 6px -4px rgba(0, 0, 0, 0.12),
434      0 -9px 28px 8px rgba(0, 0, 0, 0.05)
435    `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTo
435p:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var nx=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const V8={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},pW={motionBase:!0,motionUnit:!0},mW={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},W8=(t,e,n)=>{const r=n.getDerivativeToken(t),{override:i}=e,s=nx(e,["override"]);let o=Object.assign(Object.assign({},r),{override:i});return o=U8(o),s&&Object.entries(s).forEach(([a,l])=>{const{theme:c}=l,d=nx(l,["theme"]);let u=d;c&&(u=W8(Object.assign(Object.assign({},o),d),{override:d},c)),o[a]=u}),o};function Ji(){const{token:t,hashed:e,theme:n,override:r,cssVar:i}=Te.useContext(F8),s=`${fW}-${e||""}`,o=n||j8,[a,l,c]=VU(o,[Nd,t],{salt:s,override:r,getComputedToken:W8,formatToken:U8,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:V8,ignore:pW,preserve:mW}});return[o,c,e?l:"",a,i]}const Qh={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},za=(t,e=!1)=>({boxSizing:"border-box",margin:0,padding:0,color:t.colorText,fontSize:t.fontSize,lineHeight:t.lineHeight,listStyle:"none",fontFamily:e?"inherit":t.fontFamily}),Qp=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),G8=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),gW=t=>({a:{color:t.colorLink,textDecoration:t.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:t.colorLinkHover},"&:active":{color:t.colorLinkActive},"&:active, &:hover":{textDecoration:t.linkHoverDecoration,outline:0},"&:focus":{textDecoration:t.linkFocusDecoration,outline:0},"&[disabled]":{color:t.colorTextDisabled,cursor:"not-allowed"}}}),vW=(t,e,n,r)=>{const i=`[class^="${e}"], [class*=" ${e}"]`,s=n?`.${n}`:i,o={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let a={};return r!==!1&&(a={fontFamily:t.fontFamily,fontSize:t.fontSize}),{[s]:Object.assign(Object.assign(Object.assign({},a),o),{[i]:o})}},K8=(t,e)=>({outline:`${Qe(t.lineWidthFocus)} solid ${t.colorPrimaryBorder}`,outlineOffset:e??1,transition:"outline-offset 0s, outline 0s"}),Zp=(t,e)=>({"&:focus-visible":K8(t,e)}),X8=t=>({[`.${t}`]:Object.assign(Object.assign({},Qp()),{[`.${t} .${t}-icon`]:{display:"block"}})}),Vce=t=>Object.assign(Object.assign({color:t.colorLink,textDecoration:t.linkDecoration,outline:"none",cursor:"pointer",transition:`all ${t.motionDurationSlow}`,border:0,padding:0,background:"none",userSelect:"none"},Zp(t)),{"&:hover":{color:t.colorLinkHover,textDecoration:t.linkHoverDecoration},"&:focus":{color:t.colorLinkHover,textDecoration:t.linkFocusDecoration},"&:active":{color:t.colorLinkActive,textDecoration:t.linkHoverDecoration}}),{genStyleHooks:pi,genComponentStyleHook:bW,genSubStyleComponent:Y8}=uW({usePrefix:()=>{const{getPrefixCls:t,iconPrefixCls:e}=m.useContext(ln);return{rootPrefixCls:t(),iconPrefixCls:e}},useToken:()=>{const[t,e,n,r,i]=Ji();return{theme:t,realToken:e,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:t}=m.useContext(ln);return t??{}},getResetStyles:(t,e)=>{var n;const r=gW(t);return[r,{"&":r},X8((n=e==null?void 0:e.prefix.iconPrefixCls)!==null&&n!==void 0?n:Jp)]},getCommonStyle:vW,getCompUnitless:()=>V8}),yW=(t,e)=>{const[n,r]=Ji();return Tv({token:r,hashId:"",path:["ant-design-icons",t],nonce:()=>e==null?void 0:e.nonce,layer:{name:"antd"}},()=>X8(t))},wW=Object.assign({},gp),{useId:rx}=wW,SW=()=>"",CW=typeof rx>"u"?SW:rx;function xW(t,e,n){var r;EV();const i=t||{},s=i.inherit===!1||!e?Object.assign(Object.assign({},Fv),{hashed:(r=e==null?void 0:e.hashed)!==null&&r!==void 0?r:Fv.hashed,cssVar:e==null?void 0:e.cssVar}):e,o=CW();return Vp(()=>{var a,l;if(!t)return e;const c=Object.assign({},s.components);Object.keys(t.components||{}
435).forEach(f=>{c[f]=Object.assign(Object.assign({},c[f]),t.components[f])});const d=`css-var-${o.replace(/:/g,"")}`,u=((a=i.cssVar)!==null&&a!==void 0?a:s.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof s.cssVar=="object"?s.cssVar:{}),typeof i.cssVar=="object"?i.cssVar:{}),{key:typeof i.cssVar=="object"&&((l=i.cssVar)===null||l===void 0?void 0:l.key)||d});return Object.assign(Object.assign(Object.assign({},s),i),{token:Object.assign(Object.assign({},s.token),i.token),components:c,cssVar:u})},[i,s],(a,l)=>a.some((c,d)=>{const u=l[d];return!yv(c,u,!0)}))}var $W=["children"],J8=m.createContext({});function EW(t){var e=t.children,n=cn(t,$W);return m.createElement(J8.Provider,{value:n},e)}var TW=(function(t){Go(n,t);var e=Ko(n);function n(){return or(this,n),e.apply(this,arguments)}return ar(n,[{key:"render",value:function(){return this.props.children}}]),n})(m.Component);function RW(t){var e=m.useReducer(function(a){return a+1},0),n=Re(e,2),r=n[1],i=m.useRef(t),s=nr(function(){return i.current}),o=nr(function(a){i.current=typeof a=="function"?a(i.current):a,r()});return[s,o]}var ho="none",lf="appear",cf="enter",df="leave",ix="none",Bi="prepare",xl="start",$l="active",Zy="end",Q8="prepared";function sx(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit".concat(t)]="webkit".concat(e),n["Moz".concat(t)]="moz".concat(e),n["ms".concat(t)]="MS".concat(e),n["O".concat(t)]="o".concat(e.toLowerCase()),n}function IW(t,e){var n={animationend:sx("Animation","AnimationEnd"),transitionend:sx("Transition","TransitionEnd")};return t&&("AnimationEvent"in e||delete n.animationend.animation,"TransitionEvent"in e||delete n.transitionend.transition),n}var AW=IW(Br(),typeof window<"u"?window:{}),Z8={};if(Br()){var OW=document.createElement("div");Z8=OW.style}var uf={};function e7(t){if(uf[t])return uf[t];var e=AW[t];if(e)for(var n=Object.keys(e),r=n.length,i=0;i<r;i+=1){var s=n[i];if(Object.prototype.hasOwnProperty.call(e,s)&&s in Z8)return uf[t]=e[s],uf[t]}return""}var t7=e7("animationend"),n7=e7("transitionend"),r7=!!(t7&&n7),ox=t7||"animationend",ax=n7||"transitionend";function lx(t,e){if(!t)return null;if(vt(t)==="object"){var n=e.replace(/-\w/g,function(r){return r[1].toUpperCase()});return t[n]}return"".concat(t,"-").concat(e)}const kW=(function(t){var e=m.useRef();function n(i){i&&(i.removeEventListener(ax,t),i.removeEventListener(ox,t))}function r(i){e.current&&e.current!==i&&n(e.current),i&&i!==e.current&&(i.addEventListener(ax,t),i.addEventListener(ox,t),e.current=i)}return m.useEffect(function(){return function(){n(e.current)}},[]),[r,n]});var i7=Br()?m.useLayoutEffect:m.useEffect;const NW=(function(){var t=m.useRef(null);function e(){Un.cancel(t.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;e();var s=Un(function(){i<=1?r({isCanceled:function(){return s!==t.current}}):n(r,i-1)});t.current=s}return m.useEffect(function(){return function(){e()}},[]),[n,e]});var _W=[Bi,xl,$l,Zy],PW=[Bi,Q8],s7=!1,MW=!0;function o7(t){return t===$l||t===Zy}const DW=(function(t,e,n){var r=Jl(ix),i=Re(r,2),s=i[0],o=i[1],a=NW(),l=Re(a,2),c=l[0],d=l[1];function u(){o(Bi,!0)}var f=e?PW:_W;return i7(function(){if(s!==ix&&s!==Zy){var h=f.indexOf(s),p=f[h+1],g=n(s);g===s7?o(p,!0):p&&c(function(v){function b(){v.isCanceled()||o(p,!0)}g===!0?b():Promise.resolve(g).then(b)})}},[t,s]),m.useEffect(function(){return function(){d()}},[]),[u,s]});function LW(t,e,n,r){var i=r.motionEnter,s=i===void 0?!0:i,o=r.motionAppear,a=o===void 0?!0:o,l=r.motionLeave,c=l===void 0?!0:l,d=r.motionDeadline,u=r.motionLeaveImmediately,f=r.onAppearPrepare,h=r.onEnterPrepare,p=r.onLeavePrepare,g=r.onAppearStart,v=r.onEnterStart,b=r.onLeaveStart,w=r.onAppearActive,C=r.onEnterActive,x=r.onLeaveActive,R=r.onAppearEnd,O=r.onEnterEnd,T=r.onLeaveEnd,S=r.onVisibleChanged,_=Jl(),A=Re(_,2),$=A[0],E=A[1],I=RW(ho),D=Re(I,2),B=D[0],j=D[1],z=Jl(null),q=Re(z,2),ne=q[0],Z=q[1],J=B(),de=m.useRef(!1),X=m.useRef(null);function V(){return n()}var te=m.useRef(!1);function ie(){j(ho),Z(null,!0)}var ce=nr(function(He){var Je=B();if(Je!==ho){var ze=V();if(!(He&&!He.deadline&&He.target!==ze)){var Ne=te.current,tt;Je===lf&&Ne?tt=R==null?void 0:R(ze,He):Je===cf&&Ne?tt=O==null?void 0:O(ze,He):Je===df&&Ne&&(tt=T==null?void 0:T(ze,He)),Ne&&tt!==!1&&ie()}}}),ae=kW(ce),ve=Re(ae,1),xe=ve[0],ge=function(Je){switch(Je){case lf:return Y(Y(Y({},Bi,f),xl,g),$l,w);case cf:return Y(Y(Y({},Bi,h),xl,v),$l,C);case df:return Y(Y(Y({},Bi,p),xl,b),$l,x);default:return{}}},le=m.useMemo(function(){return ge(J)},[J]),fe=DW(J,!t,function(He){if(He===Bi){var Je=le[Bi];return Je?Je(V()):s7}if(he in le){var ze;Z(((ze=le[he])===null||ze===void 0?void 0:ze.call(le,V(),null))||null)}
435return he===$l&&J!==ho&&(xe(V()),d>0&&(clearTimeout(X.current),X.current=setTimeout(function(){ce({deadline:!0})},d))),he===Q8&&ie(),MW}),Se=Re(fe,2),G=Se[0],he=Se[1],Ee=o7(he);te.current=Ee;var Ie=m.useRef(null);i7(function(){if(!(de.current&&Ie.current===e)){E(e);var He=de.current;de.current=!0;var Je;!He&&e&&a&&(Je=lf),He&&e&&s&&(Je=cf),(He&&!e&&c||!He&&u&&!e&&c)&&(Je=df);var ze=ge(Je);Je&&(t||ze[Bi])?(j(Je),G()):j(ho),Ie.current=e}},[e]),m.useEffect(function(){(J===lf&&!a||J===cf&&!s||J===df&&!c)&&j(ho)},[a,s,c]),m.useEffect(function(){return function(){de.current=!1,clearTimeout(X.current)}},[]);var ke=m.useRef(!1);m.useEffect(function(){$&&(ke.current=!0),$!==void 0&&J===ho&&((ke.current||$)&&(S==null||S($)),ke.current=!0)},[$,J]);var De=ne;return le[Bi]&&he===xl&&(De=ee({transition:"none"},De)),[J,he,De,$??e]}function jW(t){var e=t;vt(t)==="object"&&(e=t.transitionSupport);function n(i,s){return!!(i.motionName&&e&&s!==!1)}var r=m.forwardRef(function(i,s){var o=i.visible,a=o===void 0?!0:o,l=i.removeOnLeave,c=l===void 0?!0:l,d=i.forceRender,u=i.children,f=i.motionName,h=i.leavedClassName,p=i.eventProps,g=m.useContext(J8),v=g.motion,b=n(i,v),w=m.useRef(),C=m.useRef();function x(){try{return w.current instanceof HTMLElement?w.current:_f(C.current)}catch{return null}}var R=LW(b,a,x,i),O=Re(R,4),T=O[0],S=O[1],_=O[2],A=O[3],$=m.useRef(A);A&&($.current=!0);var E=m.useCallback(function(q){w.current=q,Hy(s,q)},[s]),I,D=ee(ee({},p),{},{visible:a});if(!u)I=null;else if(T===ho)A?I=u(ee({},D),E):!c&&$.current&&h?I=u(ee(ee({},D),{},{className:h}),E):d||!c&&!h?I=u(ee(ee({},D),{},{style:{display:"none"}}),E):I=null;else{var B;S===Bi?B="prepare":o7(S)?B="active":S===xl&&(B="start");var j=lx(f,"".concat(T,"-").concat(B));I=u(ee(ee({},D),{},{className:Le(lx(f,T),Y(Y({},j,j&&B),f,typeof f=="string")),style:_}),E)}if(m.isValidElement(I)&&oc(I)){var z=Wp(I);z||(I=m.cloneElement(I,{ref:E}))}return m.createElement(TW,{ref:C},I)});return r.displayName="CSSMotion",r}const Yo=jW(r7);var Hv="add",zv="keep",qv="remove",Ig="removed";function FW(t){var e;return t&&vt(t)==="object"&&"key"in t?e=t:e={key:t},ee(ee({},e),{},{key:String(e.key)})}function Uv(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.map(FW)}function BW(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=e.length,s=Uv(t),o=Uv(e);s.forEach(function(c){for(var d=!1,u=r;u<i;u+=1){var f=o[u];if(f.key===c.key){r<u&&(n=n.concat(o.slice(r,u).map(function(h){return ee(ee({},h),{},{status:Hv})})),r=u),n.push(ee(ee({},f),{},{status:zv})),r+=1,d=!0;break}}d||n.push(ee(ee({},c),{},{status:qv}))}),r<i&&(n=n.concat(o.slice(r).map(function(c){return ee(ee({},c),{},{status:Hv})})));var a={};n.forEach(function(c){var d=c.key;a[d]=(a[d]||0)+1});var l=Object.keys(a).filter(function(c){return a[c]>1});return l.forEach(function(c){n=n.filter(function(d){var u=d.key,f=d.status;return u!==c||f!==qv}
435),n.forEach(function(d){d.key===c&&(d.status=zv)})}),n}var HW=["component","children","onVisibleChanged","onAllRemoved"],zW=["status"],qW=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function UW(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yo,n=(function(r){Go(s,r);var i=Ko(s);function s(){var o;or(this,s);for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return o=i.call.apply(i,[this].concat(l)),Y(jt(o),"state",{keyEntities:[]}),Y(jt(o),"removeKey",function(d){o.setState(function(u){var f=u.keyEntities.map(function(h){return h.key!==d?h:ee(ee({},h),{},{status:Ig})});return{keyEntities:f}},function(){var u=o.state.keyEntities,f=u.filter(function(h){var p=h.status;return p!==Ig}).length;f===0&&o.props.onAllRemoved&&o.props.onAllRemoved()})}),o}return ar(s,[{key:"render",value:function(){var a=this,l=this.state.keyEntities,c=this.props,d=c.component,u=c.children,f=c.onVisibleChanged;c.onAllRemoved;var h=cn(c,HW),p=d||m.Fragment,g={};return qW.forEach(function(v){g[v]=h[v],delete h[v]}),delete h.keys,m.createElement(p,h,l.map(function(v,b){var w=v.status,C=cn(v,zW),x=w===Hv||w===zv;return m.createElement(e,yt({},g,{key:C.key,visible:x,eventProps:C,onVisibleChanged:function(O){f==null||f(O,{key:C.key}),O||a.removeKey(C.key)}}),function(R,O){return u(ee(ee({},R),{},{index:b}),O)})}))}}],[{key:"getDerivedStateFromProps",value:function(a,l){var c=a.keys,d=l.keyEntities,u=Uv(c),f=BW(d,u);return{keyEntities:f.filter(function(h){var p=d.find(function(g){var v=g.key;return h.key===v});return!(p&&p.status===Ig&&h.status===qv)})}}}]),s})(m.Component);return Y(n,"defaultProps",{component:"div"}),n}const Wce=UW(r7),cx=m.createContext(!0);function VW(t){const e=m.useContext(cx),{children:n}=t,[,r]=Ji(),{motion:i}=r,s=m.useRef(!1);return s.current||(s.current=e!==i),s.current?m.createElement(cx.Provider,{value:i},m.createElement(EW,{motion:i},n)):n}const WW=()=>null;var GW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const KW=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let Zh,a7,l7,c7;function Hf(){return Zh||Pd}function XW(){return a7||Jp}function YW(t){return Object.keys(t).some(e=>e.endsWith("Color"))}const JW=t=>{const{prefixCls:e,iconPrefixCls:n,theme:r,holderRender:i}=t;e!==void 0&&(Zh=e),n!==void 0&&(a7=n),"holderRender"in t&&(c7=i),r&&(YW(r)?JV(Hf(),r):l7=r)},QW=()=>({getPrefixCls:(t,e)=>e||(t?`${Hf()}-${t}`:Hf()),getIconPrefixCls:XW,getRootPrefixCls:()=>Zh||Hf(),getTheme:()=>l7,holderRender:c7}),ZW=t=>{const{children:e,csp:n,autoInsertSpaceInButton:r,alert:i,anchor:s,form:o,locale:a,componentSize:l,direction:c,space:d,splitter:u,virtual:f,dropdownMatchSelectWidth:h,popupMatchSelectWidth:p,popupOverflow:g,legacyLocale:v,parentContext:b,iconPrefixCls:w,theme:C,componentDisabled:x,segmented:R,statistic:O,spin:T,calendar:S,carousel:_,cascader:A,collapse:$,typography:E,checkbox:I,descriptions:D,divider:B,drawer:j,skeleton:z,steps:q,image:ne,layout:Z,list:J,mentions:de,modal:X,progress:V,result:te,slider:ie,breadcrumb:ce,menu:ae,pagination:ve,input:xe,textArea:ge,empty:le,badge:fe,radio:Se,rate:G,switch:he,transfer:Ee,avatar:Ie,message:ke,tag:De,table:He,card:Je,tabs:ze,timeline:Ne,timePicker:tt,upload:pt,notification:gt,tree:y,colorPicker:K,datePicker:W,rangePicker:re,flex:se,wave:pe,dropdown:M,warning:L,tour:ye,tooltip:ue,popover:be,popconfirm:we,floatButton:Ae,floatButtonGroup:Pe,variant:je,inputNumber:Xe,treeSelect:Ge}=t,it=m.useCallback(($e,zt)=>{const{prefixCls:Kt}=t;if(zt)return zt;const Xt=Kt||b.getPrefixCls("");return $e?`${Xt}-${$e}`:Xt},[b.getPrefixCls,t.prefixCls]),nt=w||b.iconPrefixCls||Jp,Ut=n||b.csp;yW(nt,Ut);const Bt=xW(C,b.theme,{prefixCls:it("")}),ht={csp:Ut,autoInsertSpaceInButton:r,alert:i,anchor:s,locale:a||v,direction:c,space:d,splitter:u,virtual:f,popupMatchSelectWidth:p??h,popupOverflow:g,getPrefixCls:it,iconPrefixCls:nt,theme:Bt,segmented:R,statistic:O,spin:T,calendar:S,carousel:_,cascader:A,collapse:$,typography:E,checkbox:I,descriptions:D,divider:B,drawer:j,skeleton:z,steps:q,image:ne,input:xe,textArea:ge,layout:Z,list:J,mentions:de,modal:X,progress:V,result:te,slider:ie,breadcrumb:ce,menu:ae,pagination:ve,empty:le,badge:fe,radio:Se,rate:G,switch:he,transfer:Ee,avatar:Ie,message:ke,tag:De,table:He,card:Je,tabs:ze,timeline:Ne,timePicker:tt,upload:pt,notification:gt,tree:y,colorPicker:K,datePicker:W,rangePicker:re,flex:se,wave:pe,dropdown:M,warning:L,tour:ye,tooltip:ue,popover:be,popconfirm:we,floatButton:Ae,floatButtonGroup:Pe,variant:je,inputNumber:Xe,treeSelect:Ge},Et=Object.assign({},b);Object.keys(ht).forEach($e=>{ht[$e]!==void 0&&(Et[$e]=ht[$e])}),KW.forEach($e=>
435{const zt=t[$e];zt&&(Et[$e]=zt)}),typeof r<"u"&&(Et.button=Object.assign({autoInsertSpace:r},Et.button));const Vt=Vp(()=>Et,Et,($e,zt)=>{const Kt=Object.keys($e),Xt=Object.keys(zt);return Kt.length!==Xt.length||Kt.some(Gt=>$e[Gt]!==zt[Gt])}),{layer:et}=m.useContext(fu),_e=m.useMemo(()=>({prefixCls:nt,csp:Ut,layer:et?"antd":void 0}),[nt,Ut,et]);let Me=m.createElement(m.Fragment,null,m.createElement(WW,{dropdownMatchSelectWidth:h}),e);const Ue=m.useMemo(()=>{var $e,zt,Kt,Xt;return Cl((($e=Fo.Form)===null||$e===void 0?void 0:$e.defaultValidateMessages)||{},((Kt=(zt=Vt.locale)===null||zt===void 0?void 0:zt.Form)===null||Kt===void 0?void 0:Kt.defaultValidateMessages)||{},((Xt=Vt.form)===null||Xt===void 0?void 0:Xt.validateMessages)||{},(o==null?void 0:o.validateMessages)||{})},[Vt,o==null?void 0:o.validateMessages]);Object.keys(Ue).length>0&&(Me=m.createElement(TV.Provider,{value:Ue},Me)),a&&(Me=m.createElement(NV,{locale:a,_ANT_MARK__:kV},Me)),Me=m.createElement(Yy.Provider,{value:_e},Me),l&&(Me=m.createElement(QV,{size:l},Me)),Me=m.createElement(VW,null,Me);const mt=m.useMemo(()=>{const $e=Bt||{},{algorithm:zt,token:Kt,components:Xt,cssVar:Gt}=$e,_n=GW($e,["algorithm","token","components","cssVar"]),Pn=zt&&(!Array.isArray(zt)||zt.length>0)?Sv(zt):j8,Wn={};Object.entries(Xt||{}).forEach(([vn,On])=>{const Ye=Object.assign({},On);"algorithm"in Ye&&(Ye.algorithm===!0?Ye.theme=Pn:(Array.isArray(Ye.algorithm)||typeof Ye.algorithm=="function")&&(Ye.theme=Sv(Ye.algorithm)),delete Ye.algorithm),Wn[vn]=Ye});const Gn=Object.assign(Object.assign({},Nd),Kt);return Object.assign(Object.assign({},_n),{theme:Pn,token:Gn,components:Wn,override:Object.assign({override:Gn},Wn),cssVar:Gt})},[Bt]);return C&&(Me=m.createElement(F8.Provider,{value:mt},Me)),Vt.warning&&(Me=m.createElement($V.Provider,{value:Vt.warning},Me)),x!==void 0&&(Me=m.createElement(B8,{disabled:x},Me)),m.createElement(ln.Provider,{value:Vt},Me)},Jo=t=>{const e=m.useContext(ln),n=m.useContext(Jy);return m.createElement(ZW,Object.assign({parentContext:e,legacyLocale:n},t))};Jo.ConfigContext=ln;Jo.SizeContext=Yl;Jo.config=JW;Jo.useConfig=ZV;Object.defineProperty(Jo,"SizeContext",{get:()=>Yl});var eG={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};function d7(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}function tG(t){return d7(t)instanceof ShadowRoot}function ep(t){return tG(t)?d7(t):null}function nG(t){return t.replace(/-(.)/g,function(e,n){return n.toUpperCase()})}function rG(t,e){Jr(t,"[@ant-design/icons] ".concat(e))}function dx(t){return vt(t)==="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(vt(t.icon)==="object"||typeof t.icon=="function")}function ux(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(e,n){var r=t[n];switch(n){case"class":e.className=r,delete e.class;break;default:delete e[n],e[nG(n)]=r}return e},{})}function Vv(t,e,n){return n?Te.createElement(t.tag,ee(ee({key:e},ux(t.attrs)),n),(t.children||[]).map(function(r,i){return Vv(r,"".concat(e,"-").concat(t.tag,"-").concat(i))})):Te.createElement(t.tag,ee({key:e},ux(t.attrs)),(t.children||[]).map(function(r,i){return Vv(r,"".concat(e,"-").concat(t.tag,"-").concat(i))}))}function u7(t){return _d(t)[0]}function f7(t){return t?Array.isArray(t)?t:[t]:[]}var iG=`
436.anticon {
437  display: inline-flex;
438  align-items: center;
439  color: inherit;
440  font-style: normal;
441  line-height: 0;
442  text-align: center;
443  text-transform: none;
444  vertical-align: -0.125em;
445  text-rendering: optimizeLegibility;
446  -webkit-font-smoothing: antialiased;
447  -moz-osx-font-smoothing: grayscale;
448}
449
450.anticon > * {
451  line-height: 1;
452}
453
454.anticon svg {
455  display: inline-block;
456}
457
458.anticon::before {
459  display: none;
460}
461
462.anticon .anticon-icon {
463  display: block;
464}
465
466.anticon[tabindex] {
467  cursor: pointer;
468}
469
470.anticon-spin::before,
471.anticon-spin {
472  display: inline-block;
473  -webkit-animation: loadingCircle 1s infinite linear;
474  animation: loadingCircle 1s infinite linear;
475}
476
477@-webkit-keyframes loadingCircle {
478  100% {
479    -webkit-transform: rotate(360deg);
480    transform: rotate(360deg);
481  }
482}
483
484@keyframes loadingCircle {
485  100% {
486    -webkit-transform: rotate(360deg);
487    transform: rotate(360deg);
488  }
489}
490`,sG=function(e){var n=m.useContext(Yy),r=n.csp,i=n.prefixCls,s=n.layer,o=iG;i&&(o=o.replace(/anticon/g,i)),s&&(o="@layer ".concat(s,` {
491`).concat(o,`
492}`)),m.useEffect(function(){var a=e.current,l=ep(a);Ws(o,"@ant-design-icons",{prepend:!s,csp:r,attachTo:l})},[])},oG=["icon","className","onClick","style","primaryColor","secondaryColor"],ld={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function aG(t){var e=t.primaryColor,n=t.secondaryColor;ld.primaryColor=e,ld.secondaryColor=n||u7(e),ld.calculated=!!n}function lG(){return ee({},ld)}var lc=function(e){var n=e.icon,r=e.className,i=e.onClick,s=e.style,o=e.primaryColor,a=e.secondaryColor,l=cn(e,oG),
492c=m.useRef(),d=ld;if(o&&(d={primaryColor:o,secondaryColor:a||u7(o)}),sG(c),rG(dx(n),"icon should be icon definiton, but got ".concat(n)),!dx(n))return null;var u=n;return u&&typeof u.icon=="function"&&(u=ee(ee({},u),{},{icon:u.icon(d.primaryColor,d.secondaryColor)})),Vv(u.icon,"svg-".concat(u.name),ee(ee({className:r,onClick:i,style:s,"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};lc.displayName="IconReact";lc.getTwoToneColors=lG;lc.setTwoToneColors=aG;function h7(t){var e=f7(t),n=Re(e,2),r=n[0],i=n[1];return lc.setTwoToneColors({primaryColor:r,secondaryColor:i})}function cG(){var t=lc.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var dG=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];h7(Jh.primary);var Qr=m.forwardRef(function(t,e){var n=t.className,r=t.icon,i=t.spin,s=t.rotate,o=t.tabIndex,a=t.onClick,l=t.twoToneColor,c=cn(t,dG),d=m.useContext(Yy),u=d.prefixCls,f=u===void 0?"anticon":u,h=d.rootClassName,p=Le(h,f,Y(Y({},"".concat(f,"-").concat(r.name),!!r.name),"".concat(f,"-spin"),!!i||r.name==="loading"),n),g=o;g===void 0&&a&&(g=-1);var v=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,b=f7(l),w=Re(b,2),C=w[0],x=w[1];return m.createElement("span",yt({role:"img","aria-label":r.name},c,{ref:e,tabIndex:g,onClick:a,className:p}),m.createElement(lc,{icon:r,primaryColor:C,secondaryColor:x,style:v}))});Qr.displayName="AntdIcon";Qr.getTwoToneColor=cG;Qr.setTwoToneColor=h7;var uG=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:eG}))},fG=m.forwardRef(uG),hG={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},pG=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:hG}))},e2=m.forwardRef(pG),mG={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"}
492,children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},gG=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:mG}))},e0=m.forwardRef(gG),vG={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},bG=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:vG}))},yG=m.forwardRef(bG),wG={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},SG=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:wG}))},CG=m.forwardRef(SG),xG=`accept acceptCharset accessKey action allowFullScreen allowTransparency
493    alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
494    charSet checked classID className colSpan cols content contentEditable contextMenu
495    controls coords crossOrigin data dateTime default defer dir disabled download draggable
496    encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
497    headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
498    is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
499    mediaGroup method min minLength multiple muted name noValidate nonce open
500    optimum pattern placeholder poster preload radioGroup readOnly rel required
501    reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
502    shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
503    summary tabIndex target title type useMap value width wmode wrap`,$G=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
504    onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
505    onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
506    onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
507    onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
508    onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
509    onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,EG="".concat(xG," ").concat($G).split(/[\s\n]+/),TG="aria-",RG="data-";function fx(t,e){return t.indexOf(e)===0}function zo(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=ee({},e);var r={};return Object.keys(t).forEach(function(i){(n.aria&&(i==="role"||fx(i,TG))||n.data&&fx(i,RG)||n.attr&&EG.includes(i))&&(r[i]=t[i])}),r}function IG(t){return t&&Te.isValidElement(t)&&t.type===Te.Fragment}const AG=(t,e,n)=>Te.isValidElement(t)?Te.cloneElement(t,typeof n=="function"?n(t.props||{}):n):e;function tp(t,e){return AG(t,t,e)}const hu=t=>{const[,,,,e]=Ji();return e?`${t}-css-var`:""};var Nt={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,N:78,P:80,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEM
509ICOLON:186,EQUALS:187,WIN_KEY:224},OG={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},kG=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:OG}))},p7=m.forwardRef(kG);function hx(...t){const e={};return t.forEach(n=>{n&&Object.keys(n).forEach(r=>{n[r]!==void 0&&(e[r]=n[r])})}),e}function px(t){if(!t)return;const{closable:e,closeIcon:n}=t;return{closable:e,closeIcon:n}}function mx(t){const{closable:e,closeIcon:n}=t||{};return Te.useMemo(()=>{if(!e&&(e===!1||n===!1||n===null))return!1;if(e===void 0&&n===void 0)return null;let r={closeIcon:typeof n!="boolean"&&n!==null?n:void 0};return e&&typeof e=="object"&&(r=Object.assign(Object.assign({},r),e)),r},[e,n])}const NG={},_G=(t,e,n=NG)=>{const r=mx(t),i=mx(e),[s]=Ba("global",Fo.global),o=typeof r!="boolean"?!!(r!=null&&r.disabled):!1,a=Te.useMemo(()=>Object.assign({closeIcon:Te.createElement(e0,null)},n),[n]),l=Te.useMemo(()=>r===!1?!1:r?hx(a,i,r):i===!1?!1:i?hx(a,i):a.closable?a:!1,[r,i,a]);return Te.useMemo(()=>{var c,d;if(l===!1)return[!1,null,o,{}];const{closeIconRender:u}=a,{closeIcon:f}=l;let h=f;const p=zo(l,!0);return h!=null&&(u&&(h=u(f)),h=Te.isValidElement(h)?Te.cloneElement(h,Object.assign(Object.assign(Object.assign({},h.props),{"aria-label":(d=(c=h.props)===null||c===void 0?void 0:c["aria-label"])!==null&&d!==void 0?d:s.close}),p)):Te.createElement("span",Object.assign({"aria-label":s.close},p),h)),[!0,h,o,p]},[o,s.close,l,a])},PG=()=>{const[t,e]=m.useState([]),n=m.useCallback(r=>(e(i=>[].concat(st(i),[r])),()=>{e(i=>i.filter(s=>s!==r))}),[]);return[t,n]},m7=Te.createContext(void 0),po=100,MG=10,DG=po*MG,g7={Modal:po,Drawer:po,Popover:po,Popconfirm:po,Tooltip:po,Tour:po,FloatButton:po},LG={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function jG(t){return t in g7}const v7=(t,e)=>{const[,n]=Ji(),r=Te.useContext(m7),i=jG(t);let s;if(e!==void 0)s=[e,e];else{let o=r??0;i?o+=(r?0:n.zIndexPopupBase)+g7[t]:o+=LG[t],s=[r===void 0?e:o,o]}return s};function b7(t,e){this.v=t,this.k=e}function Or(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Or=function(o,a,l,c){function d(u,f){Or(o,u,function(h){return this._invoke(u,f,h)})}a?i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l:(d("next",0),d("throw",1),d("return",2))},Or(t,e,n,r)}function t2(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,e,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,p,g,v){var b=p&&p.prototype instanceof a?p:a,w=Object.create(b.prototype);return Or(w,"_invoke",(function(C,x,R){var O,T,S,_=0,A=R||[],$=!1,E={p:0,n:0,v:t,a:I,f:I.bind(t,4),d:function(B,j){return O=B,T=0,S=t,E.n=j,o}};function I(D,B){for(T=D,S=B,e=0;!$&&_&&!j&&e<A.length;e++){var j,z=A[e],q=E.p,ne=z[2];D>3?(j=ne===B)&&(S=z[(T=z[4])?5:(T=3,3)],z[4]=z[5]=t):z[0]<=q&&((j=D<2&&q<z[1])?(T=0,E.v=B,E.n=z[1]):q<ne&&(j=D<3||z[0]>B||B>ne)&&(z[4]=D,z[5]=B,E.n=ne,T=0))}if(j||D>1)return o;throw $=!0,B}return function(D,B,j){if(_>1)throw TypeError("Generator is already running");for($&&B===1&&I(B,j),T=B,S=j;(e=T<2?t:S)||!$;){O||(T?T<3?(T>1&&(E.n=-1),I(T,S)):E.n=S:E.v=S);try{if(_=2,O){if(T||(D="next"),e=O[D]){if(!(e=e.call(O,S)))throw TypeError("iterator result is not an object");if(!e.done)return e;S=e.value,T<2&&(T=0)}else T===1&&(e=O.return)&&e.call(O),T<2&&(S=TypeError("The iterator does not provide a '"+D+"' method"),T=1);O=t}else if((e=($=E.n<0)?S:C.call(x,E))!==o)break}catch(z){O=t,T=1,S=z}finally{_=1}}return{value:e,done:$}}})(h,g,v),!0),w}var o={};function a(){}function l(){}function c(){}e=Object.getPrototypeOf;var d=[][r]?e(e([][r]())):(Or(e={},r,function(){return this}),e),u=c.prototype=a.prototype=Object.create(d);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Or(h,i,"GeneratorFunction")),h.prototype=Object.create(u),h}return l.prototype=c,Or(u,"constructor",c),Or(c,"constructor",l),l.displayName="GeneratorFunction",Or(c,i,"GeneratorFunction"),Or(u),Or(u,i,"Generator"),Or(u,r,function(){return this}),Or(u,"toString",function(){return"[object Generator]"}),(t2=function(){return{w:s,m:f}})()}function np(t,e){function n(i,s,o,a){try{var l=t[i](s),c=l.value;return c instanceof b7?e.resolve(c.v).then(function(d){n("next",d,o,a)},function(d){n("throw",d,o,a)}):e.resolve(c).then(function(d){l.value=d,o(l)},function(d){return n("throw",d,o,a)})}catch(d){a(d)}}var r;this.next||(Or(np.prototype),Or(np.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),Or(this,"_invoke",function(i,s,o){function a(){return new e(function(l,c){n(i,o,l,c)})}return r=r?r.then(a,a):a()},!0)}function y7(t,e,n,r,i){return new np(t2().w(t,e,n,r),i||Promise)}function FG(t,e,n,r,i){var s=y7(t,e,n,r,i);return s.next().then(function(o){return o.done?o.value:s.next()})}function BG(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function i(){for(;n.length;)if((r=n.pop())in e)return i.value=r,i.done=!1,i;return i.done=!0,i}}function gx(t){if(t!=null){var e=t[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(vt(t)+" is not iterable")}function Nr(){var t=t2(),e=t.m(Nr),n=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function r(o){var a=typeof o=="function"&&o.constructor;return!!a&&(a===n||(a.displayName||a.name)==="GeneratorFunction")}var i={throw:1,return:2,break:3,continue:3};function s(o){var a,l;return function(c){a||(a={stop:function(){return l(c.a,2)},catch:function(){return c.v},abrupt:function(u,f){return l(c.a,i[u],f)},delegateYield:function(u,f,h){return a.resultName=f,l(c.d,gx(u),h)},finish:function(u){return l(c.f,u)}},l=function(u,f,h){c.p=a.prev,c.n=a.next;try{return u(f,h)}finally{a.next=c.n}}),a.resultName&&(a[a.resultName]=c.v,a.resultName=void 0),a.sent=c.v,a.next=c.n;try{return o.call(this,a)}finally{c.p=a.prev,c.n=a.next}}}return(Nr=function(){return{wrap:function(l,c,d,u){return t.w(s(l),c,d,u&&u.reverse())},isGeneratorFunction:r,mark:t.m,awrap:function(l,c){return new b7(l,c)},AsyncIterator:np,async:function(l,c,d,u,f){return(r(c)?y7:FG)(s(l),c,d,u,f)},keys:BG,values:gx}})()}function vx(t,e,n,r,i,s,o){try{var a=t[s](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(r,i)}function qa(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function o(l){vx(s,r,i,o,a,"next",l)}
509function a(l){vx(s,r,i,o,a,"throw",l)}o(void 0)})}}var pu=ee({},WR),HG=pu.version,Ag=pu.render,zG=pu.unmountComponentAtNode,t0;try{var qG=Number((HG||"").split(".")[0]);qG>=18&&(t0=pu.createRoot)}catch{}function bx(t){var e=pu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&vt(e)==="object"&&(e.usingClientEntryPoint=t)}var rp="__rc_react_root__";function UG(t,e){bx(!0);var n=e[rp]||t0(e);bx(!1),n.render(t),e[rp]=n}function VG(t,e){Ag==null||Ag(t,e)}function WG(t,e){if(t0){UG(t,e);return}VG(t,e)}function GG(t){return Wv.apply(this,arguments)}function Wv(){return Wv=qa(Nr().mark(function t(e){return Nr().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then(function(){var i;(i=e[rp])===null||i===void 0||i.unmount(),delete e[rp]}));case 1:case"end":return r.stop()}},t)})),Wv.apply(this,arguments)}function KG(t){zG(t)}function XG(t){return Gv.apply(this,arguments)}function Gv(){return Gv=qa(Nr().mark(function t(e){return Nr().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t0===void 0){r.next=2;break}return r.abrupt("return",GG(e));case 2:KG(e);case 3:case"end":return r.stop()}},t)})),Gv.apply(this,arguments)}const YG=(t,e)=>(WG(t,e),()=>XG(e));let JG=YG;function w7(t){return JG}const Og=()=>({height:0,opacity:0}),yx=t=>{const{scrollHeight:e}=t;return{height:e,opacity:1}},QG=t=>({height:t?t.offsetHeight:0}),kg=(t,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",Gce=(t=Pd)=>({motionName:`${t}-motion-collapse`,onAppearStart:Og,onEnterStart:Og,onAppearActive:yx,onEnterActive:yx,onLeaveStart:QG,onLeaveActive:Og,onAppearEnd:kg,onEnterEnd:kg,onLeaveEnd:kg,motionDeadline:500}),Md=(t,e,n)=>n!==void 0?n:`${t}-${e}`;function Cs(t,e){var n=Object.assign({},t);return Array.isArray(e)&&e.forEach(function(r){delete n[r]}),n}const S7=(function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,r=e.height;if(n||r)return!0}if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),s=i.width,o=i.height;if(s||o)return!0}}return!1}),ZG=t=>{const{componentCls:e,colorPrimary:n}=t;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${n})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${t.motionEaseOutCirc}`,`opacity 2s ${t.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow ${t.motionDurationSlow} ${t.motionEaseInOut}`,`opacity ${t.motionDurationSlow} ${t.motionEaseInOut}`].join(",")}}}}},eK=bW("Wave",ZG),C7=`${Pd}-wave-target`;function tK(t){return t&&t!=="#fff"&&t!=="#ffffff"&&t!=="rgb(255, 255, 255)"&&t!=="rgba(255, 255, 255, 1)"&&!/rgba\((?:\d*, ){3}0\)/.test(t)&&t!=="transparent"&&t!=="canvastext"}function nK(t){var e;const{borderTopColor:n,borderColor:r,backgroundColor:i}=getComputedStyle(t);return(e=[n,r,i].find(tK))!==null&&e!==void 0?e:null}function Ng(t){return Number.isNaN(t)?0:t}const rK=t=>{const{className:e,target:n,component:r,registerUnmount:i}=t,s=m.useRef(null),o=m.useRef(null);m.useEffect(()=>{o.current=i()},[]);const[a,l]=m.useState(null),[c,d]=m.useState([]),[u,f]=m.useState(0),[h,p]=m.useState(0),[g,v]=m.useState(0),[b,w]=m.useState(0),[C,x]=m.useState(!1),R={left:u,top:h,width:g,height:b,borderRadius:c.map(S=>`${S}px`).join(" ")};a&&(R["--wave-color"]=a);function O(){const S=getComputedStyle(n);l(nK(n));const _=S.position==="static",{borderLeftWidth:A,borderTopWidth:$}=S;f(_?n.offsetLeft:Ng(-Number.parseFloat(A))),p(_?n.offsetTop:Ng(-Number.parseFloat($))),v(n.offsetWidth),w(n.offsetHeight);const{borderTopLeftRadius:E,borderTopRightRadius:I,borderBottomLeftRadius:D,borderBottomRightRadius:B}=S;d([E,I,B,D].map(j=>Ng(Number.parseFloat(j))))}if(m.useEffect(()=>{if(n){const S=Un(()=>{O(),x(!0)});let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(O),_.observe(n)),()=>{Un.cancel(S),_==null||_.disconnect()}}},[n]),!C)return null;const T=(r==="Checkbox"||r==="Radio")&&(n==null?void 0:n.classList.contains(C7));return m.createElement(Yo,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(S,_)=>{var A,$;if(_.deadline||_.propertyName==="opacity"){const E=(A=s.current)===null||A===void 0?void 0:A.parentElement;($=o.current)===null||$===void 0||$.call(o).then(()=>{E==null||E.remove()})}return!1}},({className:S},_)=>m.createElement("div",{ref:Yi(s,_),className:Le(e,S,{"wave-quick":T}),style:R}))},iK=(t,e)=>{var n;const{component:r}=e;if(r==="Checkbox"&&!(!((n=t.querySelector("input"))===null||n===void 0)&&n.checked))return;const i=document.createElement("div");i.style.position="absolute",i.style.left="0px",i.style.top="0px",t==null||t.insertBefore(i,t==null?void 0:t.firstChild);const s=w7();let o=null;function a(){return o}o=s(m.createElement(rK,Object.assign({},e,{target:t,registerUnmount:a})),i)},sK=(t,e,n)=>{const{wave:r}=m.useContext(ln),[,i,s]=Ji(),o=nr(c=>{const d=t.current;if(r!=null&&r.disabled||!d)return;const u=d.querySelector(`.${C7}`)||d,{showEffect:f}=r||{};(f||iK)(u,{className:e,token:i,component:n,event:c,hashId:s})}),a=m.useRef(null);return c=>{Un.cancel(a.current),a.current=Un(()=>{o(c)})}},oK=t=>{const{children:e,disabled:n,component:r}=t,{getPrefixCls:i}=m.useContext(ln),s=m.useRef(null),o=i("wave"),[,a]=eK(o),l=sK(s,Le(o,a),r);if(Te.useEffect(()=>{const d=s.current;if(!d||d.nodeType!==window.Node.ELEMENT_NODE||n)return;const u=f=>{!S7(f.target)||!d.getAttribute||d.getAttribute("disabled")||d.disabled||d.className.includes("disabled")&&!d.className.includes("disabled:")||d.getAttribute("aria-disabled")==="true"||d.className.includes("-leave")||l(f)};return d.addEventListener("click",u,!0),()=>{d.removeEventListener("click",u,!0)}},[n]),!Te.isValidElement(e))return e??null;const c=oc(e)?Yi(Wp(e),s):s;return tp(e,{ref:c})},Qo=t=>{const e=Te.useContext(Yl);return Te.useMemo(()=>t?typeof t=="string"?t??e:typeof t=="function"?t(e):e:e,[t,e])},aK=t=>{const{componentCls:e}=t;return{[e]:{display:"inline-flex","&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"}}}},lK=pi(["Space","Compact"],t=>[aK(t)],()=>({}),{resetStyle:!1});var x7=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const n0=m.createContext(null),mu=(t,e)=>{const n=m.useContext(n0),r=m.useMemo(()=>
509{if(!n)return"";const{compactDirection:i,isFirstItem:s,isLastItem:o}=n,a=i==="vertical"?"-vertical-":"-";return Le(`${t}-compact${a}item`,{[`${t}-compact${a}first-item`]:s,[`${t}-compact${a}last-item`]:o,[`${t}-compact${a}item-rtl`]:e==="rtl"})},[t,e,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:r}},cK=t=>{const{children:e}=t;return m.createElement(n0.Provider,{value:null},e)},dK=t=>{const{children:e}=t,n=x7(t,["children"]);return m.createElement(n0.Provider,{value:m.useMemo(()=>n,[n])},e)},Kce=t=>{const{getPrefixCls:e,direction:n}=m.useContext(ln),{size:r,direction:i,block:s,prefixCls:o,className:a,rootClassName:l,children:c}=t,d=x7(t,["size","direction","block","prefixCls","className","rootClassName","children"]),u=Qo(C=>r??C),f=e("space-compact",o),[h,p]=lK(f),g=Le(f,p,{[`${f}-rtl`]:n==="rtl",[`${f}-block`]:s,[`${f}-vertical`]:i==="vertical"},a,l),v=m.useContext(n0),b=Vl(c),w=m.useMemo(()=>b.map((C,x)=>{const R=(C==null?void 0:C.key)||`${f}-item-${x}`;return m.createElement(dK,{key:R,compactSize:u,compactDirection:i,isFirstItem:x===0&&(!v||(v==null?void 0:v.isFirstItem)),isLastItem:x===b.length-1&&(!v||(v==null?void 0:v.isLastItem))},C)}),[b,v,i,u,f]);return b.length===0?null:h(m.createElement("div",Object.assign({className:g},d),w))};var uK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const $7=m.createContext(void 0),fK=t=>{const{getPrefixCls:e,direction:n}=m.useContext(ln),{prefixCls:r,size:i,className:s}=t,o=uK(t,["prefixCls","size","className"]),a=e("btn-group",r),[,,l]=Ji(),c=m.useMemo(()=>{switch(i){case"large":return"lg";case"small":return"sm";default:return""}},[i]),d=Le(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:n==="rtl"},s,l);return m.createElement($7.Provider,{value:i},m.createElement("div",Object.assign({},o,{className:d})))},wx=/^[\u4E00-\u9FA5]{2}$/,Kv=wx.test.bind(wx);function E7(t){return t==="danger"?{danger:!0}:{type:t}}function Sx(t){return typeof t=="string"}function _g(t){return t==="text"||t==="link"}function hK(t,e){if(t==null)return;const n=e?" ":"";return typeof t!="string"&&typeof t!="number"&&Sx(t.type)&&Kv(t.props.children)?tp(t,{children:t.props.children.split("").join(n)}):Sx(t)?Kv(t)?Te.createElement("span",null,t.split("").join(n)):Te.createElement("span",null,t):IG(t)?Te.createElement("span",null,t):t}function pK(t,e){let n=!1;const r=[];return Te.Children.forEach(t,i=>{const s=typeof i,o=s==="string"||s==="number";if(n&&o){const a=r.length-1,l=r[a];r[a]=`${l}${i}`}else r.push(i);n=o}),Te.Children.map(r,i=>hK(i,e))}["default","primary","danger"].concat(st(Qy));const T7=m.forwardRef((t,e)=>{const{className:n,style:r,children:i,prefixCls:s}=t,o=Le(`${s}-icon`,n);return Te.createElement("span",{ref:e,className:o,style:r},i)}),Cx=m.forwardRef((t,e)=>{const{prefixCls:n,className:r,style:i,iconClassName:s}=t,o=Le(`${n}-loading-icon`,r);return Te.createElement(T7,{prefixCls:n,className:o,style:i,ref:e},Te.createElement(p7,{className:s}))}),Pg=()=>({width:0,opacity:0,transform:"scale(0)"}),Mg=t=>({width:t.scrollWidth,opacity:1,transform:"scale(1)"}),mK=t=>{const{prefixCls:e,loading:n,existIcon:r,className:i,style:s,mount:o}=t,a=!!n;return r?Te.createElement(Cx,{prefixCls:e,className:i,style:s}):Te.createElement(Yo,{visible:a,motionName:`${e}-loading-icon-motion`,motionAppear:!o,motionEnter:!o,motionLeave:!o,removeOnLeave:!0,onAppearStart:Pg,onAppearActive:Mg,onEnterStart:Pg,onEnterActive:Mg,onLeaveStart:Mg,onLeaveActive:Pg},({className:l,style:c},d)=>{const u=Object.assign(Object.assign({},s),c);return Te.createElement(Cx,{prefixCls:e,className:Le(i,l),style:u,ref:d})})},xx=(t,e)=>({[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${t}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),gK=t=>{const{componentCls:e,fontSize:n,lineWidth:r,groupBorderColor:i,colorErrorHover:s}=t;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:t.calc(r).mul(-1).equal(),[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:n}},xx(`${e}-primary`,i),xx(`${e}-danger`,s)]}};var vK=["b"],bK=["v"],Dg=function(e){return Math.round(Number(e||0))},yK=function(e){if(e instanceof mn)return e;if(e&&vt(e)==="object"&&"h"in e&&"b"in e){var n=e,r=n.b,i=cn(n,vK);return ee(ee({},i),{},{v:r})}return typeof e=="string"&&/hsb/.test(e)?e.replace(/hsb/,"hsv"):e},Dd=(function(t){Go(n,t);var e=Ko(n);function n(r){return or(this,n),e.call(this,yK(r))}return ar(n,[{key:"toHsbString",value:function(){var i=this.toHsb(),s=Dg(i.s*100),o=Dg(i.b*100),a=Dg(i.h),l=i.a,c="hsb(".concat(a,", ").concat(s,"%, ").concat(o,"%)"),d="hsba(".concat(a,", ").concat(s,"%, ").concat(o,"%, ").concat(l.toFixed(l===0?0:2),")");return l===1?c:d}},{key:"toHsb",value:function(){var i=this.toHsv(),s=i.v,o=cn(i,bK);return ee(ee({},o),{},{b:s,a:this.a})}}]),n})(mn),wK=function(e){return e instanceof Dd?e:new Dd(e)};wK("#1677ff");const SK=(t,e)=>(t==null?void 0:t.replace(/[^\w/]/g,"").slice(0,e?8:6))||"",CK=(t,e)=>t?SK(t,e):"";let xK=(function(){function t(e){or(this,t);var n;if(this.cleared=!1,e instanceof t){this.metaColor=e.metaColor.clone(),this.colors=(n=e.colors)===null||n===void 0?void 0:n.map(i=>({color:new t(i.color),percent:i.percent})),this.cleared=e.cleared;return}const r=Array.isArray(e);r&&e.length?(this.colors=e.map(({color:i,percent:s})=>({color:new t(i),percent:s})),this.metaColor=new Dd(this.colors[0].color.metaColor)):this.metaColor=new Dd(r?"":e),(!e||r&&!this.colors)&&(this.metaColor=this.metaColor.setA(0),this.cleared=!0)}return ar(t,[{key:"toHsb",value:function(){return this.metaColor.toHsb()}},{key:"toHsbString",value:function(){return this.metaColor.toHsbString()}},{key:"toHex",value:function(){return CK(this.toHexString(),this.metaColor.a<1)}},{key:"toHexString",value:function(){return this.metaColor.toHexString()}},{key:"toRgb",value:function(){return this.metaColor.toRgb()}},{key:"toRgbString",value:function(){return this.metaColor.toRgbString()}},{key:"isGradient",value:function(){return!!this.colors&&!this.cleared}},{key:"getColors",value:function(){return this.colors||[{color:this,percent:0}]}},{key:"toCssString",value:function(){const{colors:n}=this;return n?`linear-gradient(90deg, ${n.map(i=>`${i.color.toRgbString()} ${i.percent}%`).join(", ")})`:this.metaColor.toRgbString()}},{key:"equals",value:function(n){return!n||this.isGradient()!==n.isGradient()?!1:this.isGradient()?this.colors.length===n.colors.length&&this.colors.every((r,i)=>{const s=n.colors[i];return r.percent===s.percent&&r.color.equals(s.color)}):this.toHexString()===n.toHexString()}}])})();const $K=t=>({animationDuration:t,animationFillMode:"both"}),EK=t=>({animationDuration:t,animationFillMode:"both"}),r0=(t,e,n,r,i=!1)=>{const s=i?"&":"";return{[`
510      ${s}${t}-enter,
511      ${s}${t}-appear
512    `]:Object.assign(Object.assign({},$K(r)),{animationPlayState:"paused"}),[`${s}${t}-leave`]:Object.assign(Object.assign({},EK(r)),{animationPlayState:"paused"}),[`
513      ${s}${t}-enter${t}-enter-active,
514      ${s}${t}-appear${t}-appear-active
515    `]:{animationName:e,animationPlayState:"running"},[`${s}${t}-leave${t}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},TK=new nn("antFadeIn",{"0%":{opacity:0}
515,"100%":{opacity:1}}),RK=new nn("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),IK=(t,e=!1)=>{const{antCls:n}=t,r=`${n}-fade`,i=e?"&":"";return[r0(r,TK,RK,t.motionDurationMid,e),{[`
516        ${i}${r}-enter,
517        ${i}${r}-appear
518      `]:{opacity:0,animationTimingFunction:"linear"},[`${i}${r}-leave`]:{animationTimingFunction:"linear"}}]},AK=new nn("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),OK=new nn("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),kK=new nn("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),NK=new nn("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),_K=new nn("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),PK=new nn("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),MK=new nn("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),DK=new nn("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),LK={"move-up":{inKeyframes:MK,outKeyframes:DK},"move-down":{inKeyframes:AK,outKeyframes:OK},"move-left":{inKeyframes:kK,outKeyframes:NK},"move-right":{inKeyframes:_K,outKeyframes:PK}},$x=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:s}=LK[e];return[r0(r,i,s,t.motionDurationMid),{[`
519        ${r}-enter,
520        ${r}-appear
521      `]:{opacity:0,animationTimingFunction:t.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]},R7=new nn("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}
521,"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),I7=new nn("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),A7=new nn("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),O7=new nn("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),jK=new nn("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),FK=new nn("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),BK=new nn("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),HK=new nn("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}
vendor: 1,053 bytes, lines 521-524
521}),zK={"slide-up":{inKeyframes:R7,outKeyframes:I7},"slide-down":{inKeyframes:A7,outKeyframes:O7},"slide-left":{inKeyframes:jK,outKeyframes:FK},"slide-right":{inKeyframes:BK,outKeyframes:HK}},Ex=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:s}=zK[e];return[r0(r,i,s,t.motionDurationMid),{[`
522      ${r}-enter,
523      ${r}-appear
524    `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:t.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInQuint}}]},qK=new nn("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),UK=new nn("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),Tx=new nn("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),Rx=new nn("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),VK=new nn("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}
524,"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),WK=new nn("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),GK=new nn("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),KK=new nn("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),XK=new nn("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),YK=new nn("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),JK=new nn("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),QK=new nn("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}
524}),ZK={zoom:{inKeyframes:qK,outKeyframes:UK},"zoom-big":{inKeyframes:Tx,outKeyframes:Rx},"zoom-big-fast":{inKeyframes:Tx,outKeyframes:Rx},"zoom-left":{inKeyframes:GK,outKeyframes:KK},"zoom-right":{inKeyframes:XK,outKeyframes:YK},"zoom-up":{inKeyframes:VK,outKeyframes:WK},"zoom-down":{inKeyframes:JK,outKeyframes:QK}},eX=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:s}=ZK[e];return[r0(r,i,s,e==="zoom-big-fast"?t.motionDurationFast:t.motionDurationMid),{[`
525        ${r}-enter,
526        ${r}-appear
527      `]:{transform:"scale(0)",opacity:0,animationTimingFunction:t.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]},tX=(t,e)=>{const{r:n,g:r,b:i,a:s}=t.toRgb(),o=new Dd(t.toRgbString()).onBackground(e).toHsv();return s<=.5?o.v>.5:n*.299+r*.587+i*.114>192},k7=t=>{const{paddingInline:e,onlyIconSize:n}=t;return jn(t,{buttonPaddingHorizontal:e,buttonPaddingVertical:0,buttonIconOnlyFontSize:n})},N7=t=>{var e,n,r,i,s,o;const a=(e=t.contentFontSize)!==null&&e!==void 0?e:t.fontSize,l=(n=t.contentFontSizeSM)!==null&&n!==void 0?n:t.fontSize,c=(r=t.contentFontSizeLG)!==null&&r!==void 0?r:t.fontSizeLG,d=(i=t.contentLineHeight)!==null&&i!==void 0?i:Bf(a),u=(s=t.contentLineHeightSM)!==null&&s!==void 0?s:Bf(l),f=(o=t.contentLineHeightLG)!==null&&o!==void 0?o:Bf(c),h=tX(new xK(t.colorBgSolid),"#fff")?"#000":"#fff",p=Qy.reduce((g,v)=>Object.assign(Object.assign({},g),{[`${v}ShadowColor`]:`0 ${Qe(t.controlOutlineWidth)} 0 ${Bc(t[`${v}1`],t.colorBgContainer)}`}),{});return Object.assign(Object.assign({},p),{fontWeight:400,iconGap:t.marginXS,defaultShadow:`0 ${t.controlOutlineWidth}px 0 ${t.controlTmpOutline}`,primaryShadow:`0 ${t.controlOutlineWidth}px 0 ${t.controlOutline}`,dangerShadow:`0 ${t.controlOutlineWidth}px 0 ${t.colorErrorOutline}`,primaryColor:t.colorTextLightSolid,dangerColor:t.colorTextLightSolid,borderColorDisabled:t.colorBorder,defaultGhostColor:t.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:t.colorBgContainer,paddingInline:t.paddingContentHorizontal-t.lineWidth,paddingInlineLG:t.paddingContentHorizontal-t.lineWidth,paddingInlineSM:8-t.lineWidth,onlyIconSize:"inherit",onlyIconSizeSM:"inherit",onlyIconSizeLG:"inherit",groupBorderColor:t.colorPrimaryHover,linkHoverBg:"transparent",textTextColor:t.colorText,textTextHoverColor:t.colorText,textTextActiveColor:t.colorText,textHoverBg:t.colorFillTertiary,defaultColor:t.colorText,defaultBg:t.colorBg
527Container,defaultBorderColor:t.colorBorder,defaultBorderColorDisabled:t.colorBorder,defaultHoverBg:t.colorBgContainer,defaultHoverColor:t.colorPrimaryHover,defaultHoverBorderColor:t.colorPrimaryHover,defaultActiveBg:t.colorBgContainer,defaultActiveColor:t.colorPrimaryActive,defaultActiveBorderColor:t.colorPrimaryActive,solidTextColor:h,contentFontSize:a,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:d,contentLineHeightSM:u,contentLineHeightLG:f,paddingBlock:Math.max((t.controlHeight-a*d)/2-t.lineWidth,0),paddingBlockSM:Math.max((t.controlHeightSM-l*u)/2-t.lineWidth,0),paddingBlockLG:Math.max((t.controlHeightLG-c*f)/2-t.lineWidth,0)})},nX=t=>{const{componentCls:e,iconCls:n,fontWeight:r,opacityLoading:i,motionDurationSlow:s,motionEaseInOut:o,iconGap:a,calc:l}=t;return{[e]:{outline:"none",position:"relative",display:"inline-flex",gap:a,alignItems:"center",justifyContent:"center",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${Qe(t.lineWidth)} ${t.lineType} transparent`,cursor:"pointer",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:t.colorText,"&:disabled > *":{pointerEvents:"none"},[`${e}-icon > svg`]:Qp(),"> a":{color:"currentColor"},"&:not(:disabled)":Zp(t),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&${e}-icon-only`]:{paddingInline:0,[`&${e}-compact-item`]:{flex:"none"}},[`&${e}-loading`]:{opacity:i,cursor:"default"},[`${e}-loading-icon`]:{transition:["width","opacity","margin"].map(c=>`${c} ${s} ${o}`).join(",")},[`&:not(${e}-icon-end)`]:{[`${e}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineEnd:l(a).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:l(a).mul(-1).equal()}}},"&-icon-end":{flexDirection:"row-reverse",[`${e}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineStart:l(a).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:l(a).mul(-1).equal()}}}}}},_7=(t,e,n)=>({[`&:not(:disabled):not(${t}-disabled)`]:{"&:hover":e,"&:active":n}}),rX=t=>({minWidth:t.controlHeight,paddingInline:0,borderRadius:"50%"}),iX=t=>({cursor:"not-allowed",borderColor:t.borderColorDisabled,color:t.colorTextDisabled,background:t.colorBgContainerDisabled,boxShadow:"none"}),i0=(t,e,n,r,i,s,o,a)=>({[`&${t}-background-ghost`]:Object.assign(Object.assign({color:n||void 0,background:e,borderColor:r||void 0,boxShadow:"none"},_7(t,Object.assign({background:e},o),Object.assign({background:e},a))),{"&:disabled":{cursor:"not-allowed",color:i||void 0,borderColor:s||void 0}})}),sX=t=>({[`&:disabled, &${t.componentCls}-disabled`]:Object.assign({},iX(t))}),oX=t=>({[`&:disabled, &${t.componentCls}-disabled`]:{cursor:"not-allowed",color:t.colorTextDisabled}}),s0=(t,e,n,r)=>{const s=r&&["link","text"].includes(r)?oX:sX;return Object.assign(Object.assign({},s(t)),_7(t.componentCls,e,n))},o0=(t,e,n,r,i)=>({[`&${t.componentCls}-variant-solid`]:Object.assign({color:e,background:n},s0(t,r,i))}),a0=(t,e,n,r,i)=>({[`&${t.componentCls}-variant-outlined, &${t.componentCls}-variant-dashed`]:Object.assign({borderColor:e,background:n},s0(t,r,i))}),l0=t=>({[`&${t.componentCls}-variant-dashed`]:{borderStyle:"dashed"}}),c0=(t,e,n,r)=>({[`&${t.componentCls}-variant-filled`]:Object.assign({boxShadow:"none",background:e},s0(t,n,r))}),Ss=(t,e,n,r,i)=>({[`&${t.componentCls}-variant-${n}`]:Object.assign({color:e,boxShadow:"none"},s0(t,r,i,n))}),aX=t=>{const{componentCls:e}=t;return Qy.reduce((n,r)=>{const i=t[`${r}6`],s=t[`${r}1`],o=t[`${r}5`],a=t[`${r}2`],l=t[`${r}3`],c=t[`${r}7`];return Object.assign(Object.assign({},n),{[`&${e}-color-${r}`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:i,boxShadow:t[`${r}ShadowColor`]},o0(t,t.colorTextLightSolid,i,{background:o},{background:c}
527)),a0(t,i,t.colorBgContainer,{color:o,borderColor:o,background:t.colorBgContainer},{color:c,borderColor:c,background:t.colorBgContainer})),l0(t)),c0(t,s,{color:i,background:a},{color:i,background:l})),Ss(t,i,"link",{color:o},{color:c})),Ss(t,i,"text",{color:o,background:s},{color:c,background:l}))})},{})},lX=t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:t.defaultColor,boxShadow:t.defaultShadow},o0(t,t.solidTextColor,t.colorBgSolid,{color:t.solidTextColor,background:t.colorBgSolidHover},{color:t.solidTextColor,background:t.colorBgSolidActive})),l0(t)),c0(t,t.colorFillTertiary,{color:t.defaultColor,background:t.colorFillSecondary},{color:t.defaultColor,background:t.colorFill})),i0(t.componentCls,t.ghostBg,t.defaultGhostColor,t.defaultGhostBorderColor,t.colorTextDisabled,t.colorBorder)),Ss(t,t.textTextColor,"link",{color:t.colorLinkHover,background:t.linkHoverBg},{color:t.colorLinkActive})),cX=t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:t.colorPrimary,boxShadow:t.primaryShadow},a0(t,t.colorPrimary,t.colorBgContainer,{color:t.colorPrimaryTextHover,borderColor:t.colorPrimaryHover,background:t.colorBgContainer},{color:t.colorPrimaryTextActive,borderColor:t.colorPrimaryActive,background:t.colorBgContainer})),l0(t)),c0(t,t.colorPrimaryBg,{color:t.colorPrimary,background:t.colorPrimaryBgHover},{color:t.colorPrimary,background:t.colorPrimaryBorder})),Ss(t,t.colorPrimaryText,"text",{color:t.colorPrimaryTextHover,background:t.colorPrimaryBg},{color:t.colorPrimaryTextActive,background:t.colorPrimaryBorder})),Ss(t,t.colorPrimaryText,"link",{color:t.colorPrimaryTextHover,background:t.linkHoverBg},{color:t.colorPrimaryTextActive})),i0(t.componentCls,t.ghostBg,t.colorPrimary,t.colorPrimary,t.colorTextDisabled,t.colorBorder,{color:t.colorPrimaryHover,borderColor:t.colorPrimaryHover},{color:t.colorPrimaryActive,borderColor:t.colorPrimaryActive})),dX=t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:t.colorError,boxShadow:t.dangerShadow},o0(t,t.dangerColor,t.colorError,{background:t.colorErrorHover},{background:t.colorErrorActive})),a0(t,t.colorError,t.colorBgContainer,{color:t.colorErrorHover,borderColor:t.colorErrorBorderHover},{color:t.colorErrorActive,borderColor:t.colorErrorActive})),l0(t)),c0(t,t.colorErrorBg,{color:t.colorError,background:t.colorErrorBgFilledHover},{color:t.colorError,background:t.colorErrorBgActive})),Ss(t,t.colorError,"text",{color:t.colorErrorHover,background:t.colorErrorBg},{color:t.colorErrorHover,background:t.colorErrorBgActive})),Ss(t,t.colorError,"link",{color:t.colorErrorHover},{color:t.colorErrorActive})),i0(t.componentCls,t.ghostBg,t.colorError,t.colorError,t.colorTextDisabled,t.colorBorder,{color:t.colorErrorHover,borderColor:t.colorErrorHover},{color:t.colorErrorActive,borderColor:t.colorErrorActive})),uX=t=>Object.assign(Object.assign({},Ss(t,t.colorLink,"link",{color:t.colorLinkHover},{color:t.colorLinkActive})),i0(t.componentCls,t.ghostBg,t.colorInfo,t.colorInfo,t.colorTextDisabled,t.colorBorder,{color:t.colorInfoHover,borderColor:t.colorInfoHover},{color:t.colorInfoActive,borderColor:t.colorInfoActive})),fX=t=>{const{componentCls:e}=t;return Object.assign({[`${e}-color-default`]:lX(t),[`${e}-color-primary`]:cX(t),[`${e}-color-dangerous`]:dX(t),[`${e}-color-link`]:uX(t)},aX(t))},hX=t=>Object.assign(Object.assign(Object.assign(Object.assign({},a0(t,t.defaultBorderColor,t.defaultBg,{color:t.defaultHoverColor,borderColor:t.defaultHoverBorderColor,background:t.defaultHoverBg},{color:t.defaultActiveColor,borderColor:t.defaultActiveBorderColor,background:t.defaultActiveBg})),Ss(t,t.textTextColor,"text",{color:t.textTextHoverColor,background:t.textHoverBg},{color:t.textTextActiveColor,background:t.colorBgTextActive})),o0(t,t.primaryColor,t.colorPrimary,{background:t.colorPrimaryHover,color:t.primaryColor},{background:t.colorPrimaryActive,color:t.primaryColor})),Ss(t,t.colorLink,"link",{color:t.colorLinkHover,background:t.linkHoverBg},{color:t.colorLinkActive})),n2=(t,e="")=>{const{componentCls:n,controlHeight:r,fontSize:i,borderRadius:s,buttonPaddingHorizontal:o,iconCls:a,buttonPaddingVertical:l,buttonIconOnlyFontSize:c}=t;return[{[e]:{fontSize:i,height:r,padding:`${Qe(l)} ${Qe(o)}`,borderRadius:s,[`&${n}-icon-only`]:{width:r,[a]:{fontSize:c}}}},{[`${n}${n}-circle${e}`]:rX(t)},{[`${n}${n}-round${e}`]:{borderRadius:t.controlHeight,[`&:not(${n}-icon-only)`]:{paddingInline:t.buttonPaddingHorizontal}}}]},pX=t=>{const e=jn(t,{fontSize:t.contentFontSize});return n2(e,t.componentCls)},mX=t=>{const e=jn(t,{controlHeight:t.controlHeightSM,fontSize:t.contentFontSizeSM,padding:t.paddingXS,buttonPaddingHorizontal:t.paddingInlineSM,buttonPaddingVertical:0,borderRadius:t.borderRadiusSM,buttonIconOnlyFontSize:t.onlyIconSizeSM});return n2(e,`${t.componentCls}-sm`)},gX=t=>{const e=jn(t,{controlHeight:t.controlHeightLG,fontSize:t.contentFontSizeLG,buttonPaddingHorizontal:t.paddingInlineLG,buttonPaddingVertical:0,borderRadius:t.borderRadiusLG,buttonIconOnlyFontSize:t.onlyIconSizeLG});return n2(e,`${t.componentCls}-lg`)},vX=t=>{const{componentCls:e}=t;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},bX=pi("Button",t=>{const e=k7(t);return[nX(e),pX(e),mX(e),gX(e),vX(e),fX(e),hX(e),gK(e)]},N7,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function yX(t,e,n,r){const{focusElCls:i,focus:s,borderElCls:o}=n,a=o?">
527 *":"",l=["hover",s?"focus":null,"active"].filter(Boolean).map(c=>`&:${c} ${a}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal()},[`&-item:not(${r}-status-success)`]:{zIndex:2},"&-item":Object.assign(Object.assign({[l]:{zIndex:3}},i?{[`&${i}`]:{zIndex:3}}:{}),{[`&[disabled] ${a}`]:{zIndex:0}})}}function wX(t,e,n){const{borderElCls:r}=n,i=r?`> ${r}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function r2(t,e={focus:!0}){const{componentCls:n}=t,{componentCls:r}=e,i=r||n,s=`${i}-compact`;return{[s]:Object.assign(Object.assign({},yX(t,s,e,i)),wX(i,s,e))}}function SX(t,e,n){return{[`&-item:not(${e}-last-item)`]:{marginBottom:t.calc(t.lineWidth).mul(-1).equal()},[`&-item:not(${n}-status-success)`]:{zIndex:2},"&-item":{"&:hover,&:focus,&:active":{zIndex:3},"&[disabled]":{zIndex:0}}}}function CX(t,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${t}-sm, &${t}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${t}-sm, &${t}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function xX(t){const e=`${t.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},SX(t,e,t.componentCls)),CX(t.componentCls,e))}}const $X=t=>{const{componentCls:e,colorPrimaryHover:n,lineWidth:r,calc:i}=t,s=i(r).mul(-1).equal(),o=a=>{const l=`${e}-compact${a?"-vertical":""}-item${e}-primary:not([disabled])`;return{[`${l} + ${l}::before`]:{position:"absolute",top:a?s:0,insetInlineStart:a?0:s,backgroundColor:n,content:'""',width:a?"100%":r,height:a?r:"100%"}}};return Object.assign(Object.assign({},o()),o(!0))},EX=Y8(["Button","compact"],t=>{const e=k7(t);return[r2(e),xX(e),$X(e)]},N7);var TX=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function RX(t){if(typeof t=="object"&&t){let e=t==null?void 0:t.delay;return e=!Number.isNaN(e)&&typeof e=="number"?e:0,{loading:e<=0,delay:e}}return{loading:!!t,delay:0}}const IX={default:["default","outlined"],primary:["primary","solid"],dashed:["default","dashed"],link:["link","link"],text:["default","text"]},AX=Te.forwardRef((t,e)=>{var n,r;const{loading:i=!1,prefixCls:s,color:o,variant:a,type:l,danger:c=!1,shape:d,size:u,styles:f,disabled:h,className:p,rootClassName:g,children:v,icon:b,iconPosition:w="start",ghost:C=!1,block:x=!1,htmlType:R="button",classNames:O,style:T={},autoInsertSpace:S,autoFocus:_}=t,A=TX(t,["loading","prefixCls","color","variant","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace","autoFocus"]),$=l||"default",{button:E}=Te.useContext(ln),I=d||(E==null?void 0:E.shape)||"default",[D,B]=m.useMemo(()=>{if(o&&a)return[o,a];if(l||c){const we=IX[$]||[];return c?["danger",we[1]]:we}return E!=null&&E.color&&(E!=null&&E.variant)?[E.color,E.variant]:["default","outlined"]},[o,a,l,c,E==null?void 0:E.color,E==null?void 0:E.variant,$]),z=D==="danger"?"dangerous":D,{getPrefixCls:q,direction:ne,autoInsertSpace:Z,className:J,style:de,classNames:X,styles:V}=Ha("button"),te=(n=S??Z)!==null&&n!==void 0?n:!0,ie=q("btn",s),[ce,ae,ve]=bX(ie),xe=m.useContext(Bo),ge=h??xe,le=m.useContext($7),fe=m.useMemo(()=>RX(i),[i]),[Se,G]=m.useState(fe.loading),[he,Ee]=m.useState(!1),Ie=m.useRef(null),ke=sc(e,Ie),De=m.Children.count(v)===1&&!b&&!_g(B),He=m.useRef(!0);Te.useEffect(()=>(He.current=!1,()=>{He.current=!0}),[]),wn(()=>{let we=null;fe.delay>0?we=setTimeout(()=>{we=null,G(!0)},fe.delay):G(fe.loading);function Ae(){we&&(clearTimeout(we),we=null)}return Ae},[fe.delay,fe.loading]),m.useEffect(()=>{if(!Ie.current||!te)return;const we=Ie.current.textContent||"";De&&Kv(we)?he||Ee(!0):he&&Ee(!1)}),m.useEffect(()=>{_&&Ie.current&&Ie.current.focus()},[]);const Je=Te.useCallback(we=>{var Ae;if(Se||ge){we.preventDefault();return}(Ae=t.onClick)===null||Ae===void 0||Ae.call(t,("href"in t,we))},[t.onClick,Se,ge]),{compactSize:ze,compactItemClassnames:Ne}=mu(ie,ne),tt={large:"lg",small:"sm",middle:void 0},pt=Qo(we=>{var Ae,Pe;return(Pe=(Ae=u??ze)!==null&&Ae!==void 0?Ae:le)!==null&&Pe!==void 0?Pe:we}),gt=pt&&(r=tt[pt])!==null&&r!==void 0?r:"",y=Se?"loading":b,K=Cs(A,["navigate"]),W=Le(ie,ae,ve,{[`${ie}-${I}`]:I!=="default"&&I,[`${ie}-${$}`]:$,[`${ie}-dangerous`]:c,[`${ie}-color-${z}`]:z,[`${ie}-variant-${B}`]:B,[`${ie}-${gt}`]:gt,[`${ie}-icon-only`]:!v&&v!==0&&!!y,[`${ie}-background-ghost`]:C&&!_g(B),[`${ie}-loading`]:Se,[`${ie}-two-chinese-chars`]:he&&te&&!Se,[`${ie}-block`]:x,[`${ie}-rtl`]:ne==="rtl",[`${ie}-icon-end`]:w==="end"},Ne,p,g,J),re=Object.assign(Object.assign({},de),T),se=Le(O==null?void 0:O.icon,X.icon),pe=Object.assign(Object.assign({},(f==null?void 0:f.icon)||{}),V.icon||{}),M=we=>Te.createElement(T7,{prefixCls:ie,className:se,style:pe},we),L=()=>Te.createElement(mK,{existIcon:!!b,prefixCls:ie,loading:Se,mount:He.current});let ye;b&&!Se?ye=M(b):i&&typeof i=="object"&&i.icon?ye=M(i.icon):ye=L();const ue=v||v===0?pK(v,De&&te):null;if(K.href!==void 0)return ce(Te.createElement("a",Object.assign({},K,{className:Le(W,{[`${ie}-disabled`]:ge}),href:ge?void 0:K.href,style:re,onClick:Je,ref:ke,tabIndex:ge?-1:0,"aria-disabled":ge}),ye,ue));let be=Te.createElement("button",Object.assign({},A,{type:R,className:W,style:re,onClick:Je,disabled:ge,ref:ke}),ye,ue,Ne&&Te.createElement(EX,{prefixCls:ie}));return _g(B)||(be=Te.createElement(oK,{component:"Button",disabled:Se},be)),ce(be)}),Ki=AX;Ki.Group=fK;Ki.__ANT_BUTTON=!0;const Lg=t=>typeof(t==null?void 0:t.then)=="function",P7=t=>{const{type:e,children:n,prefixCls:r,buttonProps:i,close:s,autoFocus:o,emitEvent:a,isSilent:l,quitOnNullishReturnValue:c,actionFn:d}=t,u=m.useRef(!1),f=m.useRef(null),[h,p]=Jl(!1),g=(...w)=>{s==null||s.apply(void 0,w)};m.useEffect(()=>{let w=null;return o&&(w=setTimeout(()=>{var C;(C=f.current)===null||C===void 0||C.focus({preventScroll:!0})}
527)),()=>{w&&clearTimeout(w)}},[o]);const v=w=>{Lg(w)&&(p(!0),w.then((...C)=>{p(!1,!0),g.apply(void 0,C),u.current=!1},C=>{if(p(!1,!0),u.current=!1,!(l!=null&&l()))return Promise.reject(C)}))},b=w=>{if(u.current)return;if(u.current=!0,!d){g();return}let C;if(a){if(C=d(w),c&&!Lg(C)){u.current=!1,g(w);return}}else if(d.length)C=d(s),u.current=!1;else if(C=d(),!Lg(C)){g();return}v(C)};return m.createElement(Ki,Object.assign({},E7(e),{onClick:b,loading:h,prefixCls:r},i,{ref:f}),n)},gu=Te.createContext({}),{Provider:M7}=gu,Ix=()=>{const{autoFocusButton:t,cancelButtonProps:e,cancelTextLocale:n,isSilent:r,mergedOkCancel:i,rootPrefixCls:s,close:o,onCancel:a,onConfirm:l}=m.useContext(gu);return i?Te.createElement(P7,{isSilent:r,actionFn:a,close:(...c)=>{o==null||o.apply(void 0,c),l==null||l(!1)},autoFocus:t==="cancel",buttonProps:e,prefixCls:`${s}-btn`},n):null},Ax=()=>{const{autoFocusButton:t,close:e,isSilent:n,okButtonProps:r,rootPrefixCls:i,okTextLocale:s,okType:o,onConfirm:a,onOk:l}=m.useContext(gu);return Te.createElement(P7,{isSilent:n,type:o||"primary",actionFn:l,close:(...c)=>{e==null||e.apply(void 0,c),a==null||a(!0)},autoFocus:t==="ok",buttonProps:r,prefixCls:`${i}-btn`},s)};var D7=m.createContext(null),Ox=[];function OX(t,e){var n=m.useState(function(){if(!Br())return null;var p=document.createElement("div");return p}),r=Re(n,1),i=r[0],s=m.useRef(!1),o=m.useContext(D7),a=m.useState(Ox),l=Re(a,2),c=l[0],d=l[1],u=o||(s.current?void 0:function(p){d(function(g){var v=[p].concat(st(g));return v})});function f(){i.parentElement||document.body.appendChild(i),s.current=!0}function h(){var p;(p=i.parentElement)===null||p===void 0||p.removeChild(i),s.current=!1}return wn(function(){return t?o?o(f):f():h(),h},[t]),wn(function(){c.length&&(c.forEach(function(p){return p()}),d(Ox))},[c]),[i,u]}var jg;function L7(t){var e="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=e;var r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";var i,s;if(t){var o=getComputedStyle(t);r.scrollbarColor=o.scrollbarColor,r.scrollbarWidth=o.scrollbarWidth;var a=getComputedStyle(t,"::-webkit-scrollbar"),l=parseInt(a.width,10),c=parseInt(a.height,10);try{var d=l?"width: ".concat(a.width,";"):"",u=c?"height: ".concat(a.height,";"):"";Ws(`
528#`.concat(e,`::-webkit-scrollbar {
529`).concat(d,`
530`).concat(u,`
531}`),e)}catch{i=l,s=c}}document.body.appendChild(n);var f=t&&i&&!isNaN(i)?i:n.offsetWidth-n.clientWidth,h=t&&s&&!isNaN(s)?s:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),Od(e),{width:f,height:h}}function Xce(t){return typeof document>"u"?0:(jg===void 0&&(jg=L7()),jg.width)}function kX(t){return typeof document>"u"||!t||!(t instanceof Element)?{width:0,height:0}:L7(t)}function NX(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var _X="rc-util-locker-".concat(Date.now()),kx=0;function PX(t){var e=!!t,n=m.useState(function(){return kx+=1,"".concat(_X,"_").concat(kx)}),r=Re(n,1),i=r[0];wn(function(){if(e){var s=kX(document.body).width,o=NX();Ws(`
532html body {
533  overflow-y: hidden;
534  `.concat(o?"width: calc(100% - ".concat(s,"px);"):"",`
535}`),i)}else Od(i);return function(){Od(i)}},[e,i])}var MX=!1;function DX(t){return MX}var Nx=function(e){return e===!1?!1:!Br()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},i2=m.forwardRef(function(t,e){var n=t.open,r=t.autoLock,i=t.getContainer;t.debug;var s=t.autoDestroy,o=s===void 0?!0:s,a=t.children,l=m.useState(n),c=Re(l,2),d=c[0],u=c[1],f=d||n;m.useEffect(function(){(o||n)&&u(n)},[n,o]);var h=m.useState(function(){return Nx(i)}),p=Re(h,2),g=p[0],v=p[1];m.useEffect(function(){var $=Nx(i);v($??null)});var b=OX(f&&!g),w=Re(b,2),C=w[0],x=w[1],R=g??C;PX(r&&n&&Br()&&(R===C||R===document.body));var O=null;if(a&&oc(a)&&e){var T=a;O=T.ref}var S=sc(O,e);if(!f||!Br()||g===void 0)return null;var _=R===!1||DX(),A=a;return e&&(A=m.cloneElement(a,{ref:S})),m.createElement(D7.Provider,{value:x},_?A:Vf.createPortal(A,R))}),j7=m.createContext({});function LX(){var t=ee({},gp);return t.useId}var _x=0,Px=LX();const s2=Px?(function(e){var n=Px();return e||n}):(function(e){var n=m.useState("ssr-id"),r=Re(n,2),i=r[0],s=r[1];return m.useEffect(function(){var o=_x;_x+=1,s("rc_unique_".concat(o))},[]),e||i});function Mx(t,e,n){var r=e;return!r&&n&&(r="".concat(t,"-").concat(n)),r}function Dx(t,e){var n=t["page".concat(e?"Y":"X","Offset")],r="scroll".concat(e?"Top":"Left");if(typeof n!="number"){var i=t.document;n=i.documentElement[r],typeof n!="number"&&(n=i.body[r])}return n}function jX(t){var e=t.getBoundingClientRect(),n={left:e.left,top:e.top},r=t.ownerDocument,i=r.defaultView||r.parentWindow;return n.left+=Dx(i),n.top+=Dx(i,!0),n}const FX=m.memo(function(t){var e=t.children;return e},function(t,e){var n=e.shouldUpdate;return!n});var BX={width:0,height:0,overflow:"hidden",outline:"none"},HX={outline:"none"},F7=Te.forwardRef(function(t,e){var n=t.prefixCls,r=t.className,i=t.style,s=t.title,o=t.ariaId,a=t.footer,l=t.closable,c=t.closeIcon,d=t.onClose,u=t.children,f=t.bodyStyle,h=t.bodyProps,p=t.modalRender,g=t.onMouseDown,v=t.onMouseUp,b=t.holderRef,w=t.visible,C=t.forceRender,x=t.width,R=t.height,O=t.classNames,T=t.styles,S=Te.useContext(j7),_=S.panel,A=sc(b,_),$=m.useRef(),E=m.useRef();Te.useImperativeHandle(e,function(){return{focus:function(){var de;(de=$.current)===null||de===void 0||de.focus({preventScroll:!0})},changeActive:function(de){var X=document,V=X.activeElement;de&&V===E.current?$.current.focus({preventScroll:!0}):!de&&V===$.current&&E.current.focus({preventScroll:!0})}}});var I={};x!==void 0&&(I.width=x),R!==void 0&&(I.height=R);var D=a?Te.createElement("div",{className:Le("".concat(n,"-footer"),O==null?void 0:O.footer),style:ee({},T==null?void 0:T.footer)},a):null,B=s?Te.createElement("div",{className:Le("".concat(n,"-header"),O==null?void 0:O.header),style:ee({},T==null?void 0:T.header)},Te.createElement("div",{className:"".concat(n,"-title"),id:o},s)):null,j=m.useMemo(function(){return vt(l)==="object"&&l!==null?l:l?{closeIcon:c??Te.createElement("span",{className:"".concat(n,"-close-x")})}:{}},[l,c,n]),z=zo(j,!0),q=vt(l)==="object"&&l.disabled,ne=l?Te.createElement("button",yt({type:"button",onClick:d,"aria-label":"Close"},z,{className:"".concat(n,"-close"),disabled:q}),j.closeIcon):null,Z=Te.createElement("div",{className:Le("".concat(n,"-content"),O==null?void 0:O.content),style:T==null?void 0:T.content},ne,B,Te.createElement("div",yt({className:Le("".concat(n,"-body"),O==null?void 0:O.body),style:ee(ee({},f),T==null?void 0:T.body)},h),u),D);return Te.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":s?o:null,"aria-modal":"true",ref:A,style:ee(ee({},i),I),className:Le(n,r),onMouseDown:g,onMouseUp:v},Te.createElement("div",{ref:$,tabIndex:0,style:HX},Te.createElement(FX,{shouldUpdate:w||C},p?p(Z):Z)),Te.createElement("div",{tabIndex:0,ref:E,style:BX}))}),B7=m.forwardRef(function(t,e){var n=t.prefixCls,r=t.title,i=t.style,s=t.className,o=t.visible,a=t.forceRender,l=t.destroyOnClose,c=t.motionName,d=t.ariaId,u=t.onVisibleChanged,f=t.mousePosition,h=m.useRef(),p=m.useState(),g=Re(p,2),v=g[0],b=g[1],w={};v&&(w.transformOrigin=v);function C(){var x=jX(h.current);b(f&&(f.x||f.y)?"".concat(f.x-x.left,"px ").concat(f.y-x.top,"px"):"")}return m.createElement(Yo,{visible:o,onVisibleChanged:u,onAppearPrepare:C,onEnterPrepare:C,forceRender:a,motionName:c,removeOnLeave:l,ref:h},function(x,R){var O=x.className,T=x.style;return m.createElement(F7,yt({},t,{ref:e,title:r,ariaId:d,prefixCls:n,holderRef:R,style:ee(ee(ee({},T),i),w),className:Le(s,O)}))})});B7.displayName="Content";var zX=function(e){var n=e.prefixCls,r=e.style,i=e.visible,s=e.maskProps,o=e.motionName,a=e.className;return m.createElement(Yo,{key:"mask",visible:i,motionName:o,leavedClassName:"".concat(n,"-mask-
535hidden")},function(l,c){var d=l.className,u=l.style;return m.createElement("div",yt({ref:c,style:ee(ee({},u),r),className:Le("".concat(n,"-mask"),d,a)},s))})},qX=function(e){var n=e.prefixCls,r=n===void 0?"rc-dialog":n,i=e.zIndex,s=e.visible,o=s===void 0?!1:s,a=e.keyboard,l=a===void 0?!0:a,c=e.focusTriggerAfterClose,d=c===void 0?!0:c,u=e.wrapStyle,f=e.wrapClassName,h=e.wrapProps,p=e.onClose,g=e.afterOpenChange,v=e.afterClose,b=e.transitionName,w=e.animation,C=e.closable,x=C===void 0?!0:C,R=e.mask,O=R===void 0?!0:R,T=e.maskTransitionName,S=e.maskAnimation,_=e.maskClosable,A=_===void 0?!0:_,$=e.maskStyle,E=e.maskProps,I=e.rootClassName,D=e.classNames,B=e.styles,j=m.useRef(),z=m.useRef(),q=m.useRef(),ne=m.useState(o),Z=Re(ne,2),J=Z[0],de=Z[1],X=s2();function V(){vv(z.current,document.activeElement)||(j.current=document.activeElement)}function te(){if(!vv(z.current,document.activeElement)){var G;(G=q.current)===null||G===void 0||G.focus()}}function ie(G){if(G)te();else{if(de(!1),O&&j.current&&d){try{j.current.focus({preventScroll:!0})}catch{}j.current=null}J&&(v==null||v())}g==null||g(G)}function ce(G){p==null||p(G)}var ae=m.useRef(!1),ve=m.useRef(),xe=function(){clearTimeout(ve.current),ae.current=!0},ge=function(){ve.current=setTimeout(function(){ae.current=!1})},le=null;A&&(le=function(he){ae.current?ae.current=!1:z.current===he.target&&ce(he)});function fe(G){if(l&&G.keyCode===Nt.ESC){G.stopPropagation(),ce(G);return}o&&G.keyCode===Nt.TAB&&q.current.changeActive(!G.shiftKey)}m.useEffect(function(){o&&(de(!0),V())},[o]),m.useEffect(function(){return function(){clearTimeout(ve.current)}},[]);var Se=ee(ee(ee({zIndex:i},u),B==null?void 0:B.wrapper),{},{display:J?null:"none"});return m.createElement("div",yt({className:Le("".concat(r,"-root"),I)},zo(e,{data:!0})),m.createElement(zX,{prefixCls:r,visible:O&&o,motionName:Mx(r,T,S),style:ee(ee({zIndex:i},$),B==null?void 0:B.mask),maskProps:E,className:D==null?void 0:D.mask}),m.createElement("div",yt({tabIndex:-1,onKeyDown:fe,className:Le("".concat(r,"-wrap"),f,D==null?void 0:D.wrapper),ref:z,onClick:le,style:Se},h),m.createElement(B7,yt({},e,{onMouseDown:xe,onMouseUp:ge,ref:q,closable:x,ariaId:X,prefixCls:r,visible:o&&J,onClose:ce,onVisibleChanged:ie,motionName:Mx(r,b,w)}))))},H7=function(e){var n=e.visible,r=e.getContainer,i=e.forceRender,s=e.destroyOnClose,o=s===void 0?!1:s,a=e.afterClose,l=e.panelRef,c=m.useState(n),d=Re(c,2),u=d[0],f=d[1],h=m.useMemo(function(){return{panel:l}},[l]);return m.useEffect(function(){n&&f(!0)},[n]),!i&&o&&!u?null:m.createElement(j7.Provider,{value:h},m.createElement(i2,{open:n||i||u,autoDestroy:!1,getContainer:r,autoLock:n||u},m.createElement(qX,yt({},e,{destroyOnClose:o,afterClose:function(){a==null||a(),f(!1)}}))))};H7.displayName="Dialog";var Sa="RC_FORM_INTERNAL_HOOKS",un=function(){Jr(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Ql=m.createContext({getFieldValue:un,getFieldsValue:un,getFieldError:un,getFieldWarning:un,getFieldsError:un,isFieldsTouched:un,isFieldTouched:un,isFieldValidating:un,isFieldsValidating:un,resetFields:un,setFields:un,setFieldValue:un,setFieldsValue:un,validateFields:un,submit:un,getInternalHooks:function(){return un(),{dispatch:un,initEntityValue:un,registerField:un,useSubscribe:un,setInitialValues:un,destroyForm:un,setCallbacks:un,registerWatch:un,getFields:un,setValidateMessages:un,setPreserve:un,getInitialValue:un}}}),ip=m.createContext(null);function Xv(t){return t==null?[]:Array.isArray(t)?t:[t]}function UX(t){return t&&!!t._init}function Yv(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",tel:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Jv=Yv();function VX(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function WX(t,e,n){if(qy())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Rd(i,n.prototype),i}function Qv(t){var e=typeof Map=="function"?new Map:void 0;return Qv=function(r){if(r===null||!VX(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return WX(r,arguments,Id(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Rd(i,r)},Qv(t)}var GX=/%[sdj%]/g,KX=function(){};function Zv(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var r=n.field;e[r]=e[r]||[],e[r].push(n)}),e}function ui(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=0,s=n.length;if(typeof t=="function")return t.apply(null,n);
535if(typeof t=="string"){var o=t.replace(GX,function(a){if(a==="%%")return"%";if(i>=s)return a;switch(a){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return a}});return o}return t}function XX(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"||t==="tel"}function ir(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||XX(e)&&typeof t=="string"&&!t)}function YX(t,e,n){var r=[],i=0,s=t.length;function o(a){r.push.apply(r,st(a||[])),i++,i===s&&n(r)}t.forEach(function(a){e(a,o)})}function Lx(t,e,n){var r=0,i=t.length;function s(o){if(o&&o.length){n(o);return}var a=r;r=r+1,a<i?e(t[a],s):n([])}s([])}function JX(t){var e=[];return Object.keys(t).forEach(function(n){e.push.apply(e,st(t[n]||[]))}),e}var jx=(function(t){Go(n,t);var e=Ko(n);function n(r,i){var s;return or(this,n),s=e.call(this,"Async Validation Error"),Y(jt(s),"errors",void 0),Y(jt(s),"fields",void 0),s.errors=r,s.fields=i,s}return ar(n)})(Qv(Error));function QX(t,e,n,r,i){if(e.first){var s=new Promise(function(f,h){var p=function(b){return r(b),b.length?h(new jx(b,Zv(b))):f(i)},g=JX(t);Lx(g,n,p)});return s.catch(function(f){return f}),s}var o=e.firstFields===!0?Object.keys(t):e.firstFields||[],a=Object.keys(t),l=a.length,c=0,d=[],u=new Promise(function(f,h){var p=function(v){if(d.push.apply(d,v),c++,c===l)return r(d),d.length?h(new jx(d,Zv(d))):f(i)};a.length||(r(d),f(i)),a.forEach(function(g){var v=t[g];o.indexOf(g)!==-1?Lx(v,n,p):YX(v,n,p)})});return u.catch(function(f){return f}),u}function ZX(t){return!!(t&&t.message!==void 0)}function eY(t,e){for(var n=t,r=0;r<e.length;r++){if(n==null)return n;n=n[e[r]]}return n}function Fx(t,e){return function(n){var r;return t.fullFields?r=eY(e,t.fullFields):r=e[n.field||t.fullField],ZX(n)?(n.field=n.field||t.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||t.fullField}}}function Bx(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];vt(r)==="object"&&vt(t[n])==="object"?t[n]=ee(ee({},t[n]),r):t[n]=r}}return t}var il="enum",tY=function(e,n,r,i,s){e[il]=Array.isArray(e[il])?e[il]:[],e[il].indexOf(n)===-1&&i.push(ui(s.messages[il],e.fullField,e[il].join(", ")))},nY=function(e,n,r,i,s){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(n)||i.push(ui(s.messages.pattern.mismatch,e.fullField,n,e.pattern));else if(typeof e.pattern=="string"){var o=new RegExp(e.pattern);o.test(n)||i.push(ui(s.messages.pattern.mismatch,e.fullField,n,e.pattern))}}},rY=function(e,n,r,i,s){var o=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=n,u=null,f=typeof n=="number",h=typeof n=="string",p=Array.isArray(n);if(f?u="number":h?u="string":p&&(u="array"),!u)return!1;p&&(d=n.length),h&&(d=n.replace(c,"_").length),o?d!==e.len&&i.push(ui(s.messages[u].len,e.fullField,e.len)):a&&!l&&d<e.min?i.push(ui(s.messages[u].min,e.fullField,e.min)):l&&!a&&d>e.max?i.push(ui(s.messages[u].max,e.fullField,e.max)):a&&l&&(d<e.min||d>e.max)&&i.push(ui(s.messages[u].range,e.fullField,e.min,e.max))},z7=function(e,n,r,i,s,o){e.required&&(!r.hasOwnProperty(e.field)||ir(n,o||e.type))&&i.push(ui(s.messages.required,e.fullField))},ff;const iY=(function(){if(ff)return ff;var t="[a-fA-F\\d:]",e=function(O){return O&&O.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(t,")|(?<=").concat(t,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],s="(?:%[0-9a-zA-Z]{1,})?",o="(?:".concat(i.join("|"),")").concat(s),a=new RegExp("(?:^".concat(n,"$)|(?:^").concat(o,"$)")),l=new RegExp("^".concat(n,"$")),c=new RegExp("^".concat(o,"$")),d=function(O){return O&&O.exact?a:new RegExp("(?:".concat(e(O)).concat(n).concat(e(O),")|(?:").concat(e(O)).concat(o).concat(e(O),")"),"g")};
535d.v4=function(R){return R&&R.exact?l:new RegExp("".concat(e(R)).concat(n).concat(e(R)),"g")},d.v6=function(R){return R&&R.exact?c:new RegExp("".concat(e(R)).concat(o).concat(e(R)),"g")};var u="(?:(?:[a-z]+:)?//)",f="(?:\\S+(?::\\S*)?@)?",h=d.v4().source,p=d.v6().source,g="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",v="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",b="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",w="(?::\\d{2,5})?",C='(?:[/?#][^\\s"]*)?',x="(?:".concat(u,"|www\\.)").concat(f,"(?:localhost|").concat(h,"|").concat(p,"|").concat(g).concat(v).concat(b,")").concat(w).concat(C);return ff=new RegExp("(?:^".concat(x,"$)"),"i"),ff});var Fg={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,tel:/^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Hc={integer:function(e){return Hc.number(e)&&parseInt(e,10)===e},float:function(e){return Hc.number(e)&&!Hc.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return vt(e)==="object"&&!Hc.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(Fg.email)},tel:function(e){return typeof e=="string"&&e.length<=32&&!!e.match(Fg.tel)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(iY())},hex:function(e){return typeof e=="string"&&!!e.match(Fg.hex)}},sY=function(e,n,r,i,s){if(e.required&&n===void 0){z7(e,n,r,i,s);return}var o=["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"],a=e.type;o.indexOf(a)>-1?Hc[a](n)||i.push(ui(s.messages.types[a],e.fullField,e.type)):a&&vt(n)!==e.type&&i.push(ui(s.messages.types[a],e.fullField,e.type))},oY=function(e,n,r,i,s){(/^\s+$/.test(n)||n==="")&&i.push(ui(s.messages.whitespace,e.fullField))};const qt={required:z7,whitespace:oY,type:sY,range:rY,enum:tY,pattern:nY};var aY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);
535if(a){if(ir(n)&&!e.required)return r();qt.required(e,n,i,o,s)}r(o)},lY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(n==null&&!e.required)return r();qt.required(e,n,i,o,s,"array"),n!=null&&(qt.type(e,n,i,o,s),qt.range(e,n,i,o,s))}r(o)},cY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ir(n)&&!e.required)return r();qt.required(e,n,i,o,s),n!==void 0&&qt.type(e,n,i,o,s)}r(o)},dY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ir(n,"date")&&!e.required)return r();if(qt.required(e,n,i,o,s),!ir(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),qt.type(e,l,i,o,s),l&&qt.range(e,l.getTime(),i,o,s)}}r(o)},uY="enum",fY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ir(n)&&!e.required)return r();qt.required(e,n,i,o,s),n!==void 0&&qt[uY](e,n,i,o,s)}r(o)},hY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ir(n)&&!e.required)return r();qt.required(e,n,i,o,s),n!==void 0&&(qt.type(e,n,i,o,s),qt.range(e,n,i,o,s))}r(o)},pY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);
535if(a){if(ir(n)&&!e.required)return r();qt.required(e,n,i,o,s),n!==void 0&&(qt.type(e,n,i,o,s),qt.range(e,n,i,o,s))}r(o)},mY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ir(n)&&!e.required)return r();qt.required(e,n,i,o,s),n!==void 0&&qt.type(e,n,i,o,s)}r(o)},gY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(n===""&&(n=void 0),ir(n)&&!e.required)return r();qt.required(e,n,i,o,s),n!==void 0&&(qt.type(e,n,i,o,s),qt.range(e,n,i,o,s))}r(o)},vY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ir(n)&&!e.required)return r();qt.required(e,n,i,o,s),n!==void 0&&qt.type(e,n,i,o,s)}r(o)},bY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ir(n,"string")&&!e.required)return r();qt.required(e,n,i,o,s),ir(n,"string")||qt.pattern(e,n,i,o,s)}r(o)},yY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ir(n)&&!e.required)return r();qt.required(e,n,i,o,s),ir(n)||qt.type(e,n,i,o,s)}r(o)},wY=function(e,n,r,i,s){var o=[],a=Array.isArray(n)?"array":vt(n);qt.required(e,n,i,o,s,a),r(o)},SY=function(e,n,r,i,s){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ir(n,"string")&&!e.required)return r();qt.required(e,n,i,o,s,"string"),ir(n,"string")||(qt.type(e,n,i,o,s),qt.range(e,n,i,o,s),qt.pattern(e,n,i,o,s),e.whitespace===!0&&qt.whitespace(e,n,i,o,s))}r(o)},hf=function(e,n,r,i,s){var o=e.type,a=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ir(n,o)&&!e.required)return r();qt.required(e,n,i,a,s,o),ir(n,o)||qt.type(e,n,i,a,s)}r(a)};const cd={string:SY,method:mY,number:gY,boolean:cY,regexp:yY,integer:pY,float:hY,array:lY,object:vY,enum:fY,pattern:bY,date:dY,url:hf,hex:hf,email:hf,tel:hf,required:wY,any:aY};var vu=(function(){function t(e){or(this,t),Y(this,"rules",null),Y(this,"_messages",Jv),this.define(e)}return ar(t,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(vt(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var s=n[i];r.rules[i]=Array.isArray(s)?s:[s]})}},{key:"messages",value:function(n){return n&&(this._messages=Bx(Yv(),n)),this._messages}},{key:"validate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},o=n,a=i,l=s;if(typeof a=="function"&&(l=a,a={}),!this.rules||Object.keys(this.rules).length===0)return l&&l(null,o),Promise.resolve(o);function c(p){var g=[],v={};function b(C){if(Array.isArray(C)){var x;g=(x=g).concat.apply(x,st(C))}else g.push(C)}for(var w=0;w<p.length;w++)b(p[w]);g.length?(v=Zv(g),l(g,v)):l(null,o)}if(a.messages){var d=this.messages();d===Jv&&(d=Yv()),Bx(d,a.messages),a.messages=d}else a.messages=this.messages();var u={},f=a.keys||Object.keys(this.rules);f.forEach(function(p){var g=r.rules[p],v=o[p];g.forEach(function(b){var w=b;typeof w.transform=="function"&&(o===n&&(o=ee({},o)),v=o[p]=w.transform(v),v!=null&&(w.type=w.type||(Array.isArray(v)?"array":vt(v)))),typeof w=="function"?w={validator:w}:w=ee({},w),w.validator=r.getValidationMethod(w),w.validator&&(w.field=p,w.fullField=w.fullField||p,w.type=r.getType(w),u[p]=u[p]||[],u[p].push({rule:w,value:v,source:o,field:p}))})});var h={};return QX(u,a,function(p,g){var v=p.rule,b=(v.type==="object"||v.type==="array")&&(vt(v.fields)==="object"||vt(v.defaultField)==="object");b=b&&(v.required||!v.required&&p.value),v.field=p.field;function w(T,S){return ee(ee({},S),{},{fullField:"".concat(v.fullField,".").concat(T),fullFields:v.fullFields?[].concat(st(v.fullFields),[T]):[T]})}function C(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],S=Array.isArray(T)?T:[T];!a.suppressWarning&&S.length&&t.warning("async-validator:",S),S.length&&v.message!==void 0&&v.message!==null&&(S=[].concat(v.message));var _=S.map(Fx(v,o));if(a.first&&_.length)return h[v.field]=1,g(_);if(!b)g(_);else{if(v.required&&!p.value)return v.message!==void 0?_=[].concat(v.message).map(Fx(v,o)):a.error&&(_=[a.error(v,ui(a.messages.required,v.field))]),g(_);var A={};v.defaultField&&Object.keys(p.value).map(function(I){A[I]=v.defaultField}),A=ee(ee({},A),p.rule.fields);var $={};Object.keys(A).forEach(function(I){var D=A[I],B=Array.isArray(D)?D:[D];$[I]=B.map(w.bind(null,I))});var E=new t($);E.messages(a.messages),p.rule.options&&(p.rule.options.messages=a.messages,p.rule.options.error=a.error),E.validate(p.value,p.rule.options||a,function(I){var D=[];_&&_.length&&D.push.apply(D,st(_)),I&&I.length&&D.push.apply(D,st(I)),g(D.length?D:null)})}}var x;if(v.asyncValidator)x=v.asyncValidator(v,p.value,C,p.source,a);else if(v.validator){try{x=v.validator(v,p.value,C,p.source,a)}catch(T){var R,O;(R=(O=console).error)===null||R===void 0||R.call(O,T),a.suppressValidatorError||setTimeout(function(){throw T}
535,0),C(T.message)}x===!0?C():x===!1?C(typeof v.message=="function"?v.message(v.fullField||v.field):v.message||"".concat(v.fullField||v.field," fails")):x instanceof Array?C(x):x instanceof Error&&C(x.message)}x&&x.then&&x.then(function(){return C()},function(T){return C(T)})},function(p){c(p)},o)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!cd.hasOwnProperty(n.type))throw new Error(ui("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),i=r.indexOf("message");return i!==-1&&r.splice(i,1),r.length===1&&r[0]==="required"?cd.required:cd[this.getType(n)]||void 0}}]),t})();Y(vu,"register",function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");cd[e]=n});Y(vu,"warning",KX);Y(vu,"messages",Jv);Y(vu,"validators",cd);var oi="'${name}' is not a valid ${type}",q7={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:oi,method:oi,array:oi,object:oi,number:oi,date:oi,boolean:oi,integer:oi,float:oi,regexp:oi,email:oi,url:oi,hex:oi},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},Hx=vu;function CY(t,e){return t.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return e[r]})}var zx="CODE_LOGIC_ERROR";function eb(t,e,n,r,i){return tb.apply(this,arguments)}function tb(){return tb=qa(Nr().mark(function t(e,n,r,i,s){var o,a,l,c,d,u,f,h,p;return Nr().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return o=ee({},r),delete o.ruleIndex,Hx.warning=function(){},o.validator&&(a=o.validator,o.validator=function(){try{return a.apply(void 0,arguments)}catch{return Promise.reject(zx)}}),l=null,o&&o.type==="array"&&o.defaultField&&(l=o.defaultField,delete o.defaultField),c=new Hx(Y({},e,[o])),d=Cl(q7,i.validateMessages),c.messages(d),u=[],v.prev=10,v.next=13,Promise.resolve(c.validate(Y({},e,n),ee({},i)));case 13:v.next=18;break;case 15:v.prev=15,v.t0=v.catch(10),v.t0.errors&&(u=v.t0.errors.map(function(b,w){var C=b.message,x=C===zx?d.default:C;return m.isValidElement(x)?m.cloneElement(x,{key:"error_".concat(w)}):x}));case 18:if(!(!u.length&&l&&Array.isArray(n)&&n.length>0)){v.next=23;break}return v.next=21,Promise.all(n.map(function(b,w){return eb("".concat(e,".").concat(w),b,l,i,s)}));case 21:return f=v.sent,v.abrupt("return",f.reduce(function(b,w){return[].concat(st(b),st(w))},[]));case 23:return h=ee(ee({},r),{},{name:e,enum:(r.enum||[]).join(", ")},s),p=u.map(function(b){return typeof b=="string"?CY(b,h):b}),v.abrupt("return",p);case 26:case"end":return v.stop()}},t,null,[[10,15]])})),tb.apply(this,arguments)}function xY(t,e,n,r,i,s){var o=t.join("."),a=n.map(function(d,u){var f=d.validator,h=ee(ee({},d),{},{ruleIndex:u});return f&&(h.validator=function(p,g,v){var b=!1,w=function(){for(var R=arguments.length,O=new Array(R),T=0;T<R;T++)O[T]=arguments[T];Promise.resolve().then(function(){Jr(!b,"Your validator function has already return a promise. `callback` will be ignored."),b||v.apply(void 0,O)})},C=f(p,g,w);b=C&&typeof C.then=="function"&&typeof C.catch=="function",Jr(b,"`callback` is deprecated. Please return a promise instead."),b&&C.then(function(){v()}).catch(function(x){v(x||" ")})}),h}
535).sort(function(d,u){var f=d.warningOnly,h=d.ruleIndex,p=u.warningOnly,g=u.ruleIndex;return!!f==!!p?h-g:f?1:-1}),l;if(i===!0)l=new Promise((function(){var d=qa(Nr().mark(function u(f,h){var p,g,v;return Nr().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:p=0;case 1:if(!(p<a.length)){w.next=12;break}return g=a[p],w.next=5,eb(o,e,g,r,s);case 5:if(v=w.sent,!v.length){w.next=9;break}return h([{errors:v,rule:g}]),w.abrupt("return");case 9:p+=1,w.next=1;break;case 12:f([]);case 13:case"end":return w.stop()}},u)}));return function(u,f){return d.apply(this,arguments)}})());else{var c=a.map(function(d){return eb(o,e,d,r,s).then(function(u){return{errors:u,rule:d}})});l=(i?EY(c):$Y(c)).then(function(d){return Promise.reject(d)})}return l.catch(function(d){return d}),l}function $Y(t){return nb.apply(this,arguments)}function nb(){return nb=qa(Nr().mark(function t(e){return Nr().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.all(e).then(function(i){var s,o=(s=[]).concat.apply(s,st(i));return o}));case 1:case"end":return r.stop()}},t)})),nb.apply(this,arguments)}function EY(t){return rb.apply(this,arguments)}function rb(){return rb=qa(Nr().mark(function t(e){var n;return Nr().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return n=0,i.abrupt("return",new Promise(function(s){e.forEach(function(o){o.then(function(a){a.errors.length&&s([a]),n+=1,n===e.length&&s([])})})}));case 2:case"end":return i.stop()}},t)})),rb.apply(this,arguments)}function zn(t){return Xv(t)}function qx(t,e){var n={};return e.forEach(function(r){var i=ps(t,r);n=Fi(n,r,i)}),n}function Nl(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return t&&t.some(function(r){return U7(e,r,n)})}function U7(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!t||!e||!n&&t.length!==e.length?!1:e.every(function(r,i){return t[i]===r})}function TY(t,e){if(t===e)return!0;if(!t&&e||t&&!e||!t||!e||vt(t)!=="object"||vt(e)!=="object")return!1;var n=Object.keys(t),r=Object.keys(e),i=new Set([].concat(n,r));return st(i).every(function(s){var o=t[s],a=e[s];return typeof o=="function"&&typeof a=="function"?!0:o===a})}function RY(t){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&vt(e.target)==="object"&&t in e.target?e.target[t]:e}function Ux(t,e,n){var r=t.length;if(e<0||e>=r||n<0||n>=r)return t;var i=t[e],s=e-n;return s>0?[].concat(st(t.slice(0,n)),[i],st(t.slice(n,e)),st(t.slice(e+1,r))):s<0?[].concat(st(t.slice(0,e)),st(t.slice(e+1,n+1)),[i],st(t.slice(n+1,r))):t}var IY=["name"],Ci=[];function Bg(t,e,n,r,i,s){return typeof t=="function"?t(e,n,"source"in s?{source:s.source}:{}):r!==i}var o2=(function(t){Go(n,t);var e=Ko(n);function n(r){var i;if(or(this,n),i=e.call(this,r),Y(jt(i),"state",{resetCount:0}),Y(jt(i),"cancelRegisterFunc",null),Y(jt(i),"mounted",!1),Y(jt(i),"touched",!1),Y(jt(i),"dirty",!1),Y(jt(i),"validatePromise",void 0),Y(jt(i),"prevValidating",void 0),Y(jt(i),"errors",Ci),Y(jt(i),"warnings",Ci),Y(jt(i),"cancelRegister",function(){var l=i.props,c=l.preserve,d=l.isListField,u=l.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(d,c,zn(u)),i.cancelRegisterFunc=null}),Y(jt(i),"getNamePath",function(){var l=i.props,c=l.name,d=l.fieldContext,u=d.prefixName,f=u===void 0?[]:u;return c!==void 0?[].concat(st(f),st(c)):[]}),Y(jt(i),"getRules",function(){var l=i.props,c=l.rules,d=c===void 0?[]:c,u=l.fieldContext;return d.map(function(f){return typeof f=="function"?f(u):f})}),Y(jt(i),"refresh",function(){i.mounted&&i.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),Y(jt(i),"metaCache",null),Y(jt(i),"triggerMetaEvent",function(l){var c=i.props.onMetaChange;if(c){var d=ee(ee({},i.getMeta()),{},{destroy:l});yv(i.metaCache,d)||c(d),i.metaCache=d}else i.metaCache=null}),Y(jt(i),"onStoreChange",function(l,c,d){var u=i.props,f=u.shouldUpdate,h=u.dependencies,p=h===void 0?[]:h,g=u.onReset,v=d.store,b=i.getNamePath(),w=i.getValue(l),C=i.getValue(v),x=c&&Nl(c,b);switch(d.type==="valueUpdate"&&d.source==="external"&&!yv(w,C)&&(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent()),d.type){case"reset":if(!c||x){i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),g==null||g(),i.refresh();return}break;
535case"remove":{if(f&&Bg(f,l,v,w,C,d)){i.reRender();return}break}case"setField":{var R=d.data;if(x){"touched"in R&&(i.touched=R.touched),"validating"in R&&!("originRCField"in R)&&(i.validatePromise=R.validating?Promise.resolve([]):null),"errors"in R&&(i.errors=R.errors||Ci),"warnings"in R&&(i.warnings=R.warnings||Ci),i.dirty=!0,i.triggerMetaEvent(),i.reRender();return}else if("value"in R&&Nl(c,b,!0)){i.reRender();return}if(f&&!b.length&&Bg(f,l,v,w,C,d)){i.reRender();return}break}case"dependenciesUpdate":{var O=p.map(zn);if(O.some(function(T){return Nl(d.relatedFields,T)})){i.reRender();return}break}default:if(x||(!p.length||b.length||f)&&Bg(f,l,v,w,C,d)){i.reRender();return}break}f===!0&&i.reRender()}),Y(jt(i),"validateRules",function(l){var c=i.getNamePath(),d=i.getValue(),u=l||{},f=u.triggerName,h=u.validateOnly,p=h===void 0?!1:h,g=Promise.resolve().then(qa(Nr().mark(function v(){var b,w,C,x,R,O,T;return Nr().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(i.mounted){_.next=2;break}return _.abrupt("return",[]);case 2:if(b=i.props,w=b.validateFirst,C=w===void 0?!1:w,x=b.messageVariables,R=b.validateDebounce,O=i.getRules(),f&&(O=O.filter(function(A){return A}).filter(function(A){var $=A.validateTrigger;if(!$)return!0;var E=Xv($);return E.includes(f)})),!(R&&f)){_.next=10;break}return _.next=8,new Promise(function(A){setTimeout(A,R)});case 8:if(i.validatePromise===g){_.next=10;break}return _.abrupt("return",[]);case 10:return T=xY(c,d,O,l,C,x),T.catch(function(A){return A}).then(function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ci;if(i.validatePromise===g){var $;i.validatePromise=null;var E=[],I=[];($=A.forEach)===null||$===void 0||$.call(A,function(D){var B=D.rule.warningOnly,j=D.errors,z=j===void 0?Ci:j;B?I.push.apply(I,st(z)):E.push.apply(E,st(z))}),i.errors=E,i.warnings=I,i.triggerMetaEvent(),i.reRender()}}),_.abrupt("return",T);case 13:case"end":return _.stop()}},v)})));return p||(i.validatePromise=g,i.dirty=!0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),i.reRender()),g}),Y(jt(i),"isFieldValidating",function(){return!!i.validatePromise}),Y(jt(i),"isFieldTouched",function(){return i.touched}),Y(jt(i),"isFieldDirty",function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var l=i.props.fieldContext,c=l.getInternalHooks(Sa),d=c.getInitialValue;return d(i.getNamePath())!==void 0}),Y(jt(i),"getErrors",function(){return i.errors}),Y(jt(i),"getWarnings",function(){return i.warnings}),Y(jt(i),"isListField",function(){return i.props.isListField}),Y(jt(i),"isList",function(){return i.props.isList}),Y(jt(i),"isPreserve",function(){return i.props.preserve}),Y(jt(i),"getMeta",function(){i.prevValidating=i.isFieldValidating();var l={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:i.validatePromise===null};return l}),Y(jt(i),"getOnlyChild",function(l){if(typeof l=="function"){var c=i.getMeta();return ee(ee({},i.getOnlyChild(l(i.getControlled(),c,i.props.fieldContext))),{},{isFunction:!0})}var d=Vl(l);return d.length!==1||!m.isValidElement(d[0])?{child:d,isFunction:!1}:{child:d[0],isFunction:!1}}),Y(jt(i),"getValue",function(l){var c=i.props.fieldContext.getFieldsValue,d=i.getNamePath();return ps(l||c(!0),d)}),Y(jt(i),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=i.props,d=c.name,u=c.trigger,f=c.validateTrigger,h=c.getValueFromEvent,p=c.normalize,g=c.valuePropName,v=c.getValueProps,b=c.fieldContext,w=f!==void 0?f:b.validateTrigger,C=i.getNamePath(),x=b.getInternalHooks,R=b.getFieldsValue,O=x(Sa),T=O.dispatch,S=i.getValue(),_=v||function(D){return Y({},g,D)},A=l[u],$=d!==void 0?_(S):{},E=ee(ee({},l),$);E[u]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var D,B=arguments.length,j=new Array(B),z=0;z<B;z++)j[z]=arguments[z];h?D=h.apply(void 0,j):D=RY.apply(void 0,[g].concat(j)),p&&(D=p(D,S,R(!0))),D!==S&&T({type:"updateValue",namePath:C,value:D}),A&&A.apply(void 0,j)};var I=Xv(w||[]);return I.forEach(function(D){var B=E[D];E[D]=function(){B&&B.apply(void 0,arguments);var j=i.props.rules;j&&j.length&&T({type:"validateField",namePath:C,triggerName:D})}}),E}),r.fieldContext){var s=r.fieldContext.getInternalHooks,o=s(Sa),a=o.initEntityValue;a(jt(i))}return i}
535return ar(n,[{key:"componentDidMount",value:function(){var i=this.props,s=i.shouldUpdate,o=i.fieldContext;if(this.mounted=!0,o){var a=o.getInternalHooks,l=a(Sa),c=l.registerField;this.cancelRegisterFunc=c(this)}s===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var i=this.state.resetCount,s=this.props.children,o=this.getOnlyChild(s),a=o.child,l=o.isFunction,c;return l?c=a:m.isValidElement(a)?c=m.cloneElement(a,this.getControlled(a.props)):(Jr(!a,"`children` of Field is not validate ReactElement."),c=a),m.createElement(m.Fragment,{key:i},c)}}]),n})(m.Component);Y(o2,"contextType",Ql);Y(o2,"defaultProps",{trigger:"onChange",valuePropName:"value"});function V7(t){var e,n=t.name,r=cn(t,IY),i=m.useContext(Ql),s=m.useContext(ip),o=n!==void 0?zn(n):void 0,a=(e=r.isListField)!==null&&e!==void 0?e:!!s,l="keep";return a||(l="_".concat((o||[]).join("_"))),m.createElement(o2,yt({key:l,name:o,isListField:a},r,{fieldContext:i}))}function AY(t){var e=t.name,n=t.initialValue,r=t.children,i=t.rules,s=t.validateTrigger,o=t.isListField,a=m.useContext(Ql),l=m.useContext(ip),c=m.useRef({keys:[],id:0}),d=c.current,u=m.useMemo(function(){var g=zn(a.prefixName)||[];return[].concat(st(g),st(zn(e)))},[a.prefixName,e]),f=m.useMemo(function(){return ee(ee({},a),{},{prefixName:u})},[a,u]),h=m.useMemo(function(){return{getKey:function(v){var b=u.length,w=v[b];return[d.keys[w],v.slice(b+1)]}}},[u]);if(typeof r!="function")return Jr(!1,"Form.List only accepts function as children."),null;var p=function(v,b,w){var C=w.source;return C==="internal"?!1:v!==b};return m.createElement(ip.Provider,{value:h},m.createElement(Ql.Provider,{value:f},m.createElement(V7,{name:[],shouldUpdate:p,rules:i,validateTrigger:s,initialValue:n,isList:!0,isListField:o??!!l},function(g,v){var b=g.value,w=b===void 0?[]:b,C=g.onChange,x=a.getFieldValue,R=function(){var _=x(u||[]);return _||[]},O={add:function(_,A){var $=R();A>=0&&A<=$.length?(d.keys=[].concat(st(d.keys.slice(0,A)),[d.id],st(d.keys.slice(A))),C([].concat(st($.slice(0,A)),[_],st($.slice(A))))):(d.keys=[].concat(st(d.keys),[d.id]),C([].concat(st($),[_]))),d.id+=1},remove:function(_){var A=R(),$=new Set(Array.isArray(_)?_:[_]);$.size<=0||(d.keys=d.keys.filter(function(E,I){return!$.has(I)}),C(A.filter(function(E,I){return!$.has(I)})))},move:function(_,A){if(_!==A){var $=R();_<0||_>=$.length||A<0||A>=$.length||(d.keys=Ux(d.keys,_,A),C(Ux($,_,A)))}}},T=w||[];return Array.isArray(T)||(T=[]),r(T.map(function(S,_){var A=d.keys[_];return A===void 0&&(d.keys[_]=d.id,A=d.keys[_],d.id+=1),{name:_,key:A,isListField:!0}}),O,v)})))}function OY(t){var e=!1,n=t.length,r=[];return t.length?new Promise(function(i,s){t.forEach(function(o,a){o.catch(function(l){return e=!0,l}).then(function(l){n-=1,r[a]=l,!(n>0)&&(e&&s(r),i(r))})})}):Promise.resolve([])}var W7="__@field_split__";function Hg(t){return t.map(function(e){return"".concat(vt(e),":").concat(e)}).join(W7)}var sl=(function(){function t(){or(this,t),Y(this,"kvs",new Map)}return ar(t,[{key:"set",value:function(n,r){this.kvs.set(Hg(n),r)}},{key:"get",value:function(n){return this.kvs.get(Hg(n))}},{key:"update",value:function(n,r){var i=this.get(n),s=r(i);s?this.set(n,s):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(Hg(n))}},{key:"map",value:function(n){return st(this.kvs.entries()).map(function(r){var i=Re(r,2),s=i[0],o=i[1],a=s.split(W7);return n({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),d=Re(c,3),u=d[1],f=d[2];return u==="number"?Number(f):f}),value:o})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,s=r.value;return n[i.join(".")]=s,null}),n}}]),t})(),kY=["name"],NY=ar(function t(e){var n=this;or(this,t),Y(this,"formHooked",!1),Y(this,"forceRootUpdate",void 0),Y(this,"subscribable",!0),Y(this,"store",{}),Y(this,"fieldEntities",[]),Y(this,"initialValues",{}),Y(this,"callbacks",{}),Y(this,"validateMessages",null),Y(this,"preserve",null),Y(this,"lastValidatePromise",null),Y(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,is
535FieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),Y(this,"getInternalHooks",function(r){return r===Sa?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Jr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),Y(this,"useSubscribe",function(r){n.subscribable=r}),Y(this,"prevWithoutPreserves",null),Y(this,"setInitialValues",function(r,i){if(n.initialValues=r||{},i){var s,o=Cl(r,n.store);(s=n.prevWithoutPreserves)===null||s===void 0||s.map(function(a){var l=a.key;o=Fi(o,l,ps(r,l))}),n.prevWithoutPreserves=null,n.updateStore(o)}}),Y(this,"destroyForm",function(r){if(r)n.updateStore({});else{var i=new sl;n.getFieldEntities(!0).forEach(function(s){n.isMergedPreserve(s.isPreserve())||i.set(s.getNamePath(),!0)}),n.prevWithoutPreserves=i}}),Y(this,"getInitialValue",function(r){var i=ps(n.initialValues,r);return r.length?Cl(i):i}),Y(this,"setCallbacks",function(r){n.callbacks=r}),Y(this,"setValidateMessages",function(r){n.validateMessages=r}),Y(this,"setPreserve",function(r){n.preserve=r}),Y(this,"watchList",[]),Y(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}}),Y(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue(),s=n.getFieldsValue(!0);n.watchList.forEach(function(o){o(i,s,r)})}}),Y(this,"timeoutId",null),Y(this,"warningUnhooked",function(){}),Y(this,"updateStore",function(r){n.store=r}),Y(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(i){return i.getNamePath().length}):n.fieldEntities}),Y(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new sl;return n.getFieldEntities(r).forEach(function(s){var o=s.getNamePath();i.set(o,s)}),i}),Y(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(s){var o=zn(s);return i.get(o)||{INVALIDATE_NAME_PATH:zn(s)}})}),Y(this,"getFieldsValue",function(r,i){n.warningUnhooked();var s,o,a;if(r===!0||Array.isArray(r)?(s=r,o=i):r&&vt(r)==="object"&&(a=r.strict,o=r.filter),s===!0&&!o)return n.store;var l=n.getFieldEntitiesForNamePathList(Array.isArray(s)?s:null),c=[];return l.forEach(function(d){var u,f,h="INVALIDATE_NAME_PATH"in d?d.INVALIDATE_NAME_PATH:d.getNamePath();if(a){var p,g;if((p=(g=d).isList)!==null&&p!==void 0&&p.call(g))return}else if(!s&&(u=(f=d).isListField)!==null&&u!==void 0&&u.call(f))return;if(!o)c.push(h);else{var v="getMeta"in d?d.getMeta():null;o(v)&&c.push(h)}}),qx(n.store,c.map(zn))}),Y(this,"getFieldValue",function(r){n.warningUnhooked();var i=zn(r);return ps(n.store,i)}),Y(this,"getFieldsError",function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(s,o){return s&&!("INVALIDATE_NAME_PATH"in s)?{name:s.getNamePath(),errors:s.getErrors(),warnings:s.getWarnings()}:{name:zn(r[o]),errors:[],warnings:[]}})}),Y(this,"getFieldError",function(r){n.warningUnhooked();var i=zn(r),s=n.getFieldsError([i])[0];return s.errors}),Y(this,"getFieldWarning",function(r){n.warningUnhooked();var i=zn(r),s=n.getFieldsError([i])[0];return s.warnings}),Y(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];var o=i[0],a=i[1],l,c=!1;i.length===0?l=null:i.length===1?Array.isArray(o)?(l=o.map(zn),c=!1):(l=null,c=o):(l=o.map(zn),c=a);var d=n.getFieldEntities(!0),u=function(v){return v.isFieldTouched()};if(!l)return c?d.every(function(g){return u(g)||g.isList()}):d.some(u);var f=new sl;l.forEach(function(g){f.set(g,[])}),d.forEach(function(g){var v=g.getNamePath();l.forEach(function(b){b.every(function(w,C){return v[C]===w})&&f.update(b,function(w){return[].concat(st(w),[g])})})});var h=function(v){return v.some(u)},p=f.map(function(g){var v=g.value;return v});return c?p.every(h):p.some(h)}),Y(this,"isFieldTouched",function(r){return n.warningUnhooked(),n.isFieldsTouched([r])}),Y(this,"isFieldsValidating",function(r){n.warningUnhooked();var i=n.getFieldEntities();if(!r)return i.some(function(o){return o.isFieldValidating()});var s=r.map(zn);return i.some(function(o){var a=o.getNamePath();return Nl(s,a)&&o.isFieldValidating()})}),Y(this,"isFieldValidating",function(r){return n.warningUnhooked(),n.isFieldsValidating([r])}),Y(this,"resetWithFieldInitialValue",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new sl,s=n.getFieldEntities(!0);
535s.forEach(function(l){var c=l.props.initialValue,d=l.getNamePath();if(c!==void 0){var u=i.get(d)||new Set;u.add({entity:l,value:c}),i.set(d,u)}});var o=function(c){c.forEach(function(d){var u=d.props.initialValue;if(u!==void 0){var f=d.getNamePath(),h=n.getInitialValue(f);if(h!==void 0)Jr(!1,"Form already set 'initialValues' with path '".concat(f.join("."),"'. Field can not overwrite it."));else{var p=i.get(f);if(p&&p.size>1)Jr(!1,"Multiple Field with path '".concat(f.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(p){var g=n.getFieldValue(f),v=d.isListField();!v&&(!r.skipExist||g===void 0)&&n.updateStore(Fi(n.store,f,st(p)[0].value))}}}})},a;r.entities?a=r.entities:r.namePathList?(a=[],r.namePathList.forEach(function(l){var c=i.get(l);if(c){var d;(d=a).push.apply(d,st(st(c).map(function(u){return u.entity})))}})):a=s,o(a)}),Y(this,"resetFields",function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(Cl(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var s=r.map(zn);s.forEach(function(o){var a=n.getInitialValue(o);n.updateStore(Fi(n.store,o,a))}),n.resetWithFieldInitialValue({namePathList:s}),n.notifyObservers(i,s,{type:"reset"}),n.notifyWatch(s)}),Y(this,"setFields",function(r){n.warningUnhooked();var i=n.store,s=[];r.forEach(function(o){var a=o.name,l=cn(o,kY),c=zn(a);s.push(c),"value"in l&&n.updateStore(Fi(n.store,c,l.value)),n.notifyObservers(i,[c],{type:"setField",data:o})}),n.notifyWatch(s)}),Y(this,"getFields",function(){var r=n.getFieldEntities(!0),i=r.map(function(s){var o=s.getNamePath(),a=s.getMeta(),l=ee(ee({},a),{},{name:o,value:n.getFieldValue(o)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return i}),Y(this,"initEntityValue",function(r){var i=r.props.initialValue;if(i!==void 0){var s=r.getNamePath(),o=ps(n.store,s);o===void 0&&n.updateStore(Fi(n.store,s,i))}}),Y(this,"isMergedPreserve",function(r){var i=r!==void 0?r:n.preserve;return i??!0}),Y(this,"registerField",function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var s=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(s,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(o,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(u){return u!==r}),!n.isMergedPreserve(a)&&(!o||l.length>1)){var c=o?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==c&&n.fieldEntities.every(function(u){return!U7(u.getNamePath(),i)})){var d=n.store;n.updateStore(Fi(d,i,c,!0)),n.notifyObservers(d,[i],{type:"remove"}),n.triggerDependenciesUpdate(d,i)}}n.notifyWatch([i])}}),Y(this,"dispatch",function(r){switch(r.type){case"updateValue":{var i=r.namePath,s=r.value;n.updateValue(i,s);break}case"validateField":{var o=r.namePath,a=r.triggerName;n.validateFields([o],{triggerName:a});break}}}),Y(this,"notifyObservers",function(r,i,s){if(n.subscribable){var o=ee(ee({},s),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(r,i,o)})}else n.forceRootUpdate()}),Y(this,"triggerDependenciesUpdate",function(r,i){var s=n.getDependencyChildrenFields(i);return s.length&&n.validateFields(s),n.notifyObservers(r,s,{type:"dependenciesUpdate",relatedFields:[i].concat(st(s))}),s}),Y(this,"updateValue",function(r,i){var s=zn(r),o=n.store;n.updateStore(Fi(n.store,s,i)),n.notifyObservers(o,[s],{type:"valueUpdate",source:"internal"}),n.notifyWatch([s]);var a=n.triggerDependenciesUpdate(o,s),l=n.callbacks.onValuesChange;if(l){var c=qx(n.store,[s]);l(c,n.getFieldsValue())}n.triggerOnFieldsChange([s].concat(st(a)))}),Y(this,"setFieldsValue",function(r){n.warningUnhooked();var i=n.store;if(r){var s=Cl(n.store,r);n.updateStore(s)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),Y(this,"setFieldValue",function(r,i){n.setFields([{name:r,value:i,errors:[],warnings:[]}])}),Y(this,"getDependencyChildrenFields",function(r){var i=new Set,s=[],o=new sl;
535n.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(d){var u=zn(d);o.update(u,function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return f.add(l),f})})});var a=function l(c){var d=o.get(c)||new Set;d.forEach(function(u){if(!i.has(u)){i.add(u);var f=u.getNamePath();u.isFieldDirty()&&f.length&&(s.push(f),l(f))}})};return a(r),s}),Y(this,"triggerOnFieldsChange",function(r,i){var s=n.callbacks.onFieldsChange;if(s){var o=n.getFields();if(i){var a=new sl;i.forEach(function(c){var d=c.name,u=c.errors;a.set(d,u)}),o.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=o.filter(function(c){var d=c.name;return Nl(r,d)});l.length&&s(l,o)}}),Y(this,"validateFields",function(r,i){n.warningUnhooked();var s,o;Array.isArray(r)||typeof r=="string"||typeof i=="string"?(s=r,o=i):o=r;var a=!!s,l=a?s.map(zn):[],c=[],d=String(Date.now()),u=new Set,f=o||{},h=f.recursive,p=f.dirty;n.getFieldEntities(!0).forEach(function(w){if(a||l.push(w.getNamePath()),!(!w.props.rules||!w.props.rules.length)&&!(p&&!w.isFieldDirty())){var C=w.getNamePath();if(u.add(C.join(d)),!a||Nl(l,C,h)){var x=w.validateRules(ee({validateMessages:ee(ee({},q7),n.validateMessages)},o));c.push(x.then(function(){return{name:C,errors:[],warnings:[]}}).catch(function(R){var O,T=[],S=[];return(O=R.forEach)===null||O===void 0||O.call(R,function(_){var A=_.rule.warningOnly,$=_.errors;A?S.push.apply(S,st($)):T.push.apply(T,st($))}),T.length?Promise.reject({name:C,errors:T,warnings:S}):{name:C,errors:T,warnings:S}}))}}});var g=OY(c);n.lastValidatePromise=g,g.catch(function(w){return w}).then(function(w){var C=w.map(function(x){var R=x.name;return R});n.notifyObservers(n.store,C,{type:"validateFinish"}),n.triggerOnFieldsChange(C,w)});
535var v=g.then(function(){return n.lastValidatePromise===g?Promise.resolve(n.getFieldsValue(l)):Promise.reject([])}).catch(function(w){var C=w.filter(function(x){return x&&x.errors.length});return Promise.reject({values:n.getFieldsValue(l),errorFields:C,outOfDate:n.lastValidatePromise!==g})});v.catch(function(w){return w});var b=l.filter(function(w){return u.has(w.join(d))});return n.triggerOnFieldsChange(b),v}),Y(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch{}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})}),this.forceRootUpdate=e});function G7(t){var e=m.useRef(),n=m.useState({}),r=Re(n,2),i=r[1];if(!e.current)if(t)e.current=t;else{var s=function(){i({})},o=new NY(s);e.current=o.getForm()}return[e.current]}var ib=m.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),K7=function(e){var n=e.validateMessages,r=e.onFormChange,i=e.onFormFinish,s=e.children,o=m.useContext(ib),a=m.useRef({});return m.createElement(ib.Provider,{value:ee(ee({},o),{},{validateMessages:ee(ee({},o.validateMessages),n),triggerFormChange:function(c,d){r&&r(c,{changedFields:d,forms:a.current}),o.triggerFormChange(c,d)},triggerFormFinish:function(c,d){i&&i(c,{values:d,forms:a.current}),o.triggerFormFinish(c,d)},registerForm:function(c,d){c&&(a.current=ee(ee({},a.current),{},Y({},c,d))),o.registerForm(c,d)},unregisterForm:function(c){var d=ee({},a.current);delete d[c],a.current=d,o.unregisterForm(c)}})},s)},_Y=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],PY=function(e,n){var r=e.name,i=e.initialValues,s=e.fields,o=e.form,a=e.preserve,l=e.children,c=e.component,d=c===void 0?"form":c,u=e.validateMessages,f=e.validateTrigger,h=f===void 0?"onChange":f,p=e.onValuesChange,g=e.onFieldsChange,v=e.onFinish,b=e.onFinishFailed,w=e.clearOnDestroy,C=cn(e,_Y),x=m.useRef(null),R=m.useContext(ib),O=G7(o),T=Re(O,1),S=T[0],_=S.getInternalHooks(Sa),A=_.useSubscribe,$=_.setInitialValues,E=_.setCallbacks,I=_.setValidateMessages,D=_.setPreserve,B=_.destroyForm;m.useImperativeHandle(n,function(){return ee(ee({},S),{},{nativeElement:x.current})}),m.useEffect(function(){return R.registerForm(r,S),function(){R.unregisterForm(r)}},[R,S,r]),I(ee(ee({},R.validateMessages),u)),E({onValuesChange:p,onFieldsChange:function(V){if(R.triggerFormChange(r,V),g){for(var te=arguments.length,ie=new Array(te>1?te-1:0),ce=1;ce<te;ce++)ie[ce-1]=arguments[ce];g.apply(void 0,[V].concat(ie))}},onFinish:function(V){R.triggerFormFinish(r,V),v&&v(V)},onFinishFailed:b}),D(a);var j=m.useRef(null);$(i,!j.current),j.current||(j.current=!0),m.useEffect(function(){return function(){return B(w)}},[]);var z,q=typeof l=="function";if(q){var ne=S.getFieldsValue(!0);z=l(ne,S)}else z=l;A(!q);var Z=m.useRef();m.useEffect(function(){TY(Z.current||[],s||[])||S.setFields(s||[]),Z.current=s},[s,S]);var J=m.useMemo(function(){return ee(ee({},S),{},{validateTrigger:h})},[S,h]),de=m.createElement(ip.Provider,{value:null},m.createElement(Ql.Provider,{value:J},z));return d===!1?de:m.createElement(d,yt({},C,{ref:x,onSubmit:function(V){V.preventDefault(),V.stopPropagation(),S.submit()},onReset:function(V){var te;V.preventDefault(),S.resetFields(),(te=C.onReset)===null||te===void 0||te.call(C,V)}}),de)};function Vx(t){try{return JSON.stringify(t)}catch{return Math.random()}}function MY(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0],i=e[1],s=i===void 0?{}:i,o=UX(s)?{form:s}:s,a=o.form,l=m.useState(),c=Re(l,2),d=c[0],u=c[1],f=m.useMemo(function(){return Vx(d)},[d]),h=m.useRef(f);h.current=f;var p=m.useContext(Ql),g=a||p,v=g&&g._init,b=zn(r),w=m.useRef(b);return w.current=b,m.useEffect(function(){if(v){var C=g.getFieldsValue,x=g.getInternalHooks,R=x(Sa),O=R.registerWatch,T=function($,E){var I=o.preserve?E:$;return typeof r=="function"?r(I):ps(I,w.current)},S=O(function(A,$){var E=T(A,$),I=Vx(E);h.current!==I&&(h.current=I,u(E))}),_=T(C(),C(!0));return d!==_&&u(_),S}},[v]),d}var DY=m.forwardRef(PY),bu=DY;bu.FormProvider=K7;bu.Field=V7;bu.List=AY;bu.useForm=G7;bu.useWatch=MY;const Yce=m.createContext({labelAlign:"right",layout:"horizontal",itemRef:()=>{}}),Jce=m.createContext(null),Qce=t=>{const e=Cs(t,["prefixCls"]);return m.createElement(K7,Object.assign({},e))},Zce=m.createContext({prefixCls:""}),Gs=m.createContext({}),LY=({children:t,status:e,override:n})=>{const r=m.useContext(Gs),i=m.useMemo(()=>{const s=Object.assign({},r);return n&&delete s.isFormItemInput,e&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[e,n,r]);return m.createElement(Gs.Provider,{value:i},t)},jY=m.createContext(void 0),sp=t=>{const{space:e,form:n,children:r}=t;if(r==null)return null;let i=r;return n&&(i=Te.createElement(LY,{override:!0,status:!0},i)),e&&(i=Te.createElement(cK,null,i)),i},FY=()=>Br()&&window.document.documentElement,d0=t=>{const{prefixCls:e,className:n,style:r,size:i,shape:s}=t,o=Le({[`${e}-lg`]:i==="large",[`${e}-sm`]:i==="small"}),a=Le({[`${e}-circle`]:s==="circle",[`${e}-square`]:s==="square",[`${e}-round`]:s==="round"}),l=m.useMemo(()=>typeof i=="number"?{width:i,height:i,lineHeight:`${i}px`}:{},[i]);return m.createElement("span",{className:Le(e,o,a,n),style:Object.assign(Object.assign({},l),r)})},BY=new nn("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),u0=t=>
vendor: 4,431 bytes, lines 535-542
535({height:t,lineHeight:Qe(t)}),_l=t=>Object.assign({width:t},u0(t)),HY=t=>({background:t.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:BY,animationDuration:t.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),zg=(t,e)=>Object.assign({width:e(t).mul(5).equal(),minWidth:e(t).mul(5).equal()},u0(t)),zY=t=>{const{skeletonAvatarCls:e,gradientFromColor:n,controlHeight:r,controlHeightLG:i,controlHeightSM:s}=t;return{[e]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},_l(r)),[`${e}${e}-circle`]:{borderRadius:"50%"},[`${e}${e}-lg`]:Object.assign({},_l(i)),[`${e}${e}-sm`]:Object.assign({},_l(s))}},qY=t=>{const{controlHeight:e,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:i,controlHeightSM:s,gradientFromColor:o,calc:a}=t;return{[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:o,borderRadius:n},zg(e,a)),[`${r}-lg`]:Object.assign({},zg(i,a)),[`${r}-sm`]:Object.assign({},zg(s,a))}},Wx=t=>Object.assign({width:t},u0(t)),UY=t=>{const{skeletonImageCls:e,imageSizeBase:n,gradientFromColor:r,borderRadiusSM:i,calc:s}=t;return{[e]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:r,borderRadius:i},Wx(s(n).mul(2).equal())),{[`${e}-path`]:{fill:"#bfbfbf"},[`${e}-svg`]:Object.assign(Object.assign({},Wx(n)),{maxWidth:s(n).mul(4).equal(),maxHeight:s(n).mul(4).equal()}),[`${e}-svg${e}-svg-circle`]:{borderRadius:"50%"}}),[`${e}${e}-circle`]:{borderRadius:"50%"}}},qg=(t,e,n)=>{const{skeletonButtonCls:r}=t;return{[`${n}${r}-circle`]:{width:e,minWidth:e,borderRadius:"50%"},[`${n}${r}-round`]:{borderRadius:e}}},Ug=(t,e)=>Object.assign({width:e(t).mul(2).equal(),minWidth:e(t).mul(2).equal()},u0(t)),VY=t=>{const{borderRadiusSM:e,skeletonButtonCls:n,controlHeight:r,controlHeightLG:i,controlHeightSM:s,gradientFromColor:o,calc:a}=t;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:o,borderRadius:e,width:a(r).mul(2).equal(),minWidth:a(r).mul(2).equal()},Ug(r,a))},qg(t,r,n)),{[`${n}-lg`]:Object.assign({},Ug(i,a))}),qg(t,i,`${n}-lg`)),{[`${n}-sm`]:Object.assign({},Ug(s,a))}),qg(t,s,`${n}-sm`))},WY=t=>{const{componentCls:e,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:i,skeletonButtonCls:s,skeletonInputCls:o,skeletonImageCls:a,controlHeight:l,controlHeightLG:c,controlHeightSM:d,gradientFromColor:u,padding:f,marginSM:h,borderRadius:p,titleHeight:g,blockRadius:v,paragraphLiHeight:b,controlHeightXS:w,paragraphMarginTop:C}=t;return{[e]:{display:"table",width:"100%",[`${e}-header`]:{display:"table-cell",paddingInlineEnd:f,verticalAlign:"top",[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:u},_l(l)),[`${n}-circle`]:{borderRadius:"50%"},[`${n}-lg`]:Object.assign({},_l(c)),[`${n}-sm`]:Object.assign({},_l(d))},[`${e}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[r]:{width:"100%",height:g,background:u,borderRadius:v,[`+ ${i}`]:{marginBlockStart:d}},[i]:{padding:0,"> li":{width:"100%",height:b,listStyle:"none",background:u,borderRadius:v,"+ li":{marginBlockStart:w}}},[`${i}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${e}-content`]:{[`${r}, ${i} > li`]:{borderRadius:p}}},[`${e}-with-avatar ${e}-content`]:{[r]:{marginBlockStart:h,[`+ ${i}`]:{marginBlockStart:C}}},[`${e}${e}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},VY(t)),zY(t)),qY(t)),UY(t)),[`${e}${e}-block`]:{width:"100%",[s]:{width:"100%"},[o]:{width:"100%"}},[`${e}${e}-active`]:{[`
536        ${r},
537        ${i} > li,
538        ${n},
539        ${s},
540        ${o},
541        ${a}
542      `]:Object.assign({},HY(t))}}},GY=t=>{const{colorFillContent:e,colorFill:n}=t,r=e,i=n;return{color:r,colorGradientEnd:i,gradientFromColor:r,gradientToColor:i,titleHeight:t.controlHeight/2,blockRadius:t.borderRadiusSM,paragraphMarginTop:t.marginLG+t.marginXXS,paragraphLiHeight:t.controlHeight/2}},cc=pi("Skeleton",t=>{const{componentCls:e,calc:n}=t,r=jn(t,{skeletonAvatarCls:`${e}-avatar`,skeletonTitleCls:`${e}-title`,skeletonParagraphCls:`${e}-paragraph`,skeletonButtonCls:`${e}-button`,skeletonInputCls:`${e}-input`,skeletonImageCls:`${e}-image`,imageSizeBase:n(t.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackgroun
542d:`linear-gradient(90deg, ${t.gradientFromColor} 25%, ${t.gradientToColor} 37%, ${t.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"});return WY(r)},GY,{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),KY=t=>{const{prefixCls:e,className:n,rootClassName:r,active:i,shape:s="circle",size:o="default"}=t,{getPrefixCls:a}=m.useContext(ln),l=a("skeleton",e),[c,d,u]=cc(l),f=Cs(t,["prefixCls","className"]),h=Le(l,`${l}-element`,{[`${l}-active`]:i},n,r,d,u);return c(m.createElement("div",{className:h},m.createElement(d0,Object.assign({prefixCls:`${l}-avatar`,shape:s,size:o},f))))},XY=t=>{const{prefixCls:e,className:n,rootClassName:r,active:i,block:s=!1,size:o="default"}=t,{getPrefixCls:a}=m.useContext(ln),l=a("skeleton",e),[c,d,u]=cc(l),f=Cs(t,["prefixCls"]),h=Le(l,`${l}-element`,{[`${l}-active`]:i,[`${l}-block`]:s},n,r,d,u);return c(m.createElement("div",{className:h},m.createElement(d0,Object.assign({prefixCls:`${l}-button`,size:o},f))))},YY="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",JY=t=>{const{prefixCls:e,className:n,rootClassName:r,style:i,active:s}=t,{getPrefixCls:o}=m.useContext(ln),a=o("skeleton",e),[l,c,d]=cc(a),u=Le(a,`${a}-element`,{[`${a}-active`]:s},n,r,c,d);return l(m.createElement("div",{className:u},m.createElement("div",{className:Le(`${a}-image`,n),style:i},m.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${a}-image-svg`},m.createElement("title",null,"Image placeholder"),m.createElement("path",{d:YY,className:`${a}-image-path`})))))},QY=t=>{const{prefixCls:e,className:n,rootClassName:r,active:i,block:s,size:o="default"}=t,{getPrefixCls:a}=m.useContext(ln),l=a("skeleton",e),[c,d,u]=cc(l),f=Cs(t,["prefixCls"]),h=Le(l,`${l}-element`,{[`${l}-active`]:i,[`${l}-block`]:s},n,r,d,u);return c(m.createElement("div",{className:h},m.createElement(d0,Object.assign({prefixCls:`${l}-input`,size:o},f))))},ZY=t=>{const{prefixCls:e,className:n,rootClassName:r,style:i,active:s,children:o}=t,{getPrefixCls:a}=m.useContext(ln),l=a("skeleton",e),[c,d,u]=cc(l),f=Le(l,`${l}-element`,{[`${l}-active`]:s},d,n,r,u);return c(m.createElement("div",{className:f},m.createElement("div",{className:Le(`${l}-image`,n),style:i},o)))},eJ=(t,e)=>{const{width:n,rows:r=2}=e;if(Array.isArray(n))return n[t];if(r-1===t)return n},tJ=t=>{const{prefixCls:e,className:n,style:r,rows:i=0}=t,s=Array.from({length:i}).map((o,a)=>m.createElement("li",{key:a,style:{width:eJ(a,t)}}));return m.createElement("ul",{className:Le(e,n),style:r},s)},nJ=({prefixCls:t,className:e,width:n,style:r})=>m.createElement("h3",{className:Le(t,e),style:Object.assign({width:n},r)});function Vg(t){return t&&typeof t=="object"?t:{}}function rJ(t,e){return t&&!e?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function iJ(t,e){return!t&&e?{width:"38%"}:t&&e?{width:"50%"}:{}}function sJ(t,e){const n={};return(!t||!e)&&(n.width="61%"),!t&&e?n.rows=3:n.rows=2,n}const dc=t=>{const{prefixCls:e,loading:n,className:r,rootClassName:i,style:s,children:o,avatar:a=!1,title:l=!0,paragraph:c=!0,active:d,round:u}=t,{getPrefixCls:f,direction:h,className:p,style:g}=Ha("skeleton"),v=f("skeleton",e),[b,w,C]=cc(v);if(n||!("loading"in t)){const x=!!a,R=!!l,O=!!c;let T;if(x){const A=Object.assign(Object.assign({prefixCls:`${v}-avatar`},rJ(R,O)),Vg(a));T=m.createElement("div",{className:`${v}-header`},m.createElement(d0,Object.assign({},A)))}let S;if(R||O){let A;if(R){const E=Object.assign(Object.assign({prefixCls:`${v}-title`},iJ(x,O)),Vg(l));A=m.createElement(nJ,Object.assign({},E))}let $;if(O){const E=Object.assign(Object.assign({prefixCls:`${v}-paragraph`},sJ(x,R)),Vg(c));$=m.createElement(tJ,Object.assign({},E))}S=m.createElement("div",{className:`${v}-content`},A,$)}const _=Le(v,{[`${v}-with-avatar`]:x,[`${v}-active`]:d,[`${v}-rtl`]:h==="rtl",[`${v}-round`]:u},p,r,i,w,C);return b(m.createElement("div",{className:_,style:Object.assign(Object.assign({},g),s)},T,S))}return o??null};dc.Button=XY;dc.Avatar=KY;dc.Input=QY;dc.Image=JY;dc.Node=ZY;function Gx(){}const oJ=m.createContext({add:Gx,remove:Gx});function aJ(t){const e=m.useContext(oJ),n=m.useRef(null);return nr(i=>{if(i){const s=t?i.querySelector(t):i;s&&(e.add(s),n.current=s)}else e.remove(n.current)})}const Kx=()=>{const{cancelButtonProps:t,cancelTextLocale:e,onCancel:n}=m.useContext(gu);return Te.createElement(Ki,Object.assign({onClick:n},t),e)},Xx=()=>{const{confirmLoading:t,okButtonProps:e,okType:n,okTextLocale:r,onOk:i}=m.useContext(gu);return Te.createElement(Ki,Object.assign({},E7(n),{loading:t,onClick:i},e),r)};function X7(t,e){return Te.createElement("span",{className:`${t}-close-x`},e||Te.createElement(e0,{className:`${t}-close-icon`}))}const Y7=t=>{const{okText:e,okType:n="primary",cancelText:r,confirmLoading:i,onOk:s,onCancel:o,okButtonProps:a,cancelButtonProps:l,footer:c}=t,[d]=Ba("Modal",P8()),u=e||(d==null?void 0:d.okText),f=r||(d==null?void 0:d.cancelText),h=Te.useMemo(()=>({confirmLoading:i,okButtonProps:a,cancelButtonProps:l,okTextLocale:u,cancelTextLocale:f,okType:n,onOk:s,onCancel:o}
542),[i,a,l,u,f,n,s,o]);let p;return typeof c=="function"||typeof c>"u"?(p=Te.createElement(Te.Fragment,null,Te.createElement(Kx,null),Te.createElement(Xx,null)),typeof c=="function"&&(p=c(p,{OkBtn:Xx,CancelBtn:Kx})),p=Te.createElement(M7,{value:h},p)):p=c,Te.createElement(B8,{disabled:!1},p)},lJ=t=>{const{componentCls:e}=t;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},cJ=t=>{const{componentCls:e}=t;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},dJ=(t,e)=>{const{prefixCls:n,componentCls:r,gridColumns:i}=t,s={};for(let o=i;o>=0;o--)o===0?(s[`${r}${e}-${o}`]={display:"none"},s[`${r}-push-${o}`]={insetInlineStart:"auto"},s[`${r}-pull-${o}`]={insetInlineEnd:"auto"},s[`${r}${e}-push-${o}`]={insetInlineStart:"auto"},s[`${r}${e}-pull-${o}`]={insetInlineEnd:"auto"},s[`${r}${e}-offset-${o}`]={marginInlineStart:0},s[`${r}${e}-order-${o}`]={order:0}):(s[`${r}${e}-${o}`]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${o/i*100}%`,maxWidth:`${o/i*100}%`}],s[`${r}${e}-push-${o}`]={insetInlineStart:`${o/i*100}%`},s[`${r}${e}-pull-${o}`]={insetInlineEnd:`${o/i*100}%`},s[`${r}${e}-offset-${o}`]={marginInlineStart:`${o/i*100}%`},s[`${r}${e}-order-${o}`]={order:o});return s[`${r}${e}-flex`]={flex:`var(--${n}${e}-flex)`},s},sb=(t,e)=>dJ(t,e),uJ=(t,e,n)=>({[`@media (min-width: ${Qe(e)})`]:Object.assign({},sb(t,n))}),fJ=()=>({}),hJ=()=>({}),ede=pi("Grid",lJ,fJ),J7=t=>({xs:t.screenXSMin,sm:t.screenSMMin,md:t.screenMDMin,lg:t.screenLGMin,xl:t.screenXLMin,xxl:t.screenXXLMin}),tde=pi("Grid",t=>{const e=jn(t,{gridColumns:24}),n=J7(e);return delete n.xs,[cJ(e),sb(e,""),sb(e,"-xs"),Object.keys(n).map(r=>uJ(e,n[r],`-${r}`)).reduce((r,i)=>Object.assign(Object.assign({},r),i),{})]},hJ);function Yx(t){return{position:t,inset:0}}const pJ=t=>{const{componentCls:e,antCls:n}=t;return[{[`${e}-root`]:{[`${e}${n}-zoom-enter, ${e}${n}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:t.motionDurationSlow,userSelect:"none"},[`${e}${n}-zoom-leave ${e}-content`]:{pointerEvents:"none"},[`${e}-mask`]:Object.assign(Object.assign({},Yx("fixed")),{zIndex:t.zIndexPopupBase,height:"100%",backgroundColor:t.colorBgMask,pointerEvents:"none",[`${e}-hidden`]:{display:"none"}}),[`${e}-wrap`]:Object.assign(Object.assign({},Yx("fixed")),{zIndex:t.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${e}-root`]:IK(t)}]},mJ=t=>{const{componentCls:e}=t;return[{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl"},[`${e}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[e]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${t.screenSMMax}px)`]:{[e]:{maxWidth:"calc(100vw - 16px)",margin:`${Qe(t.marginXS)} auto`},[`${e}-centered`]:{[e]:{flex:1}}}}},{[e]:Object.assign(Object.assign({},za(t)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${Qe(t.calc(t.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:t.paddingLG,[`${e}-title`]:{margin:0,color:t.titleColor,fontWeight:t.fontWeightStrong,fontSize:t.titleFontSize,lineHeight:t.titleLineHeight,wordWrap:"break-word"},[`${e}-content`]:{position:"relative",backgroundColor:t.contentBg,backgroundClip:"padding-box",border:0,borderRadius:t.borderRadiusLG,boxShadow:t.boxShadow,pointerEvents:"auto",padding:t.contentPadding},[`${e}-close`]:Object.assign({position:"absolute",top:t.calc(t.modalHeaderHeight).sub(t.modalCloseBtnSize).div(2).equal(),insetInlineEnd:t.calc(t.modalHeaderHeight).sub(t.modalCloseBtnSize).div(2).equal(),zIndex:t.calc(t.zIndexPopupBase).add(10).equal(),padding:0,color:t.modalCloseIconColor,fontWeight:t.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:t.borderRadiusSM,width:t.modalCloseBtnSize,height:t.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${t.motionDurationMid}, background-color ${t.motionDurationMid}`,"&-x":{display:"flex",fontSize:t.fontSizeLG,fontStyle:"normal",lineHeight:Qe(t.modalCloseBtnSize),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:disabled":{pointerEvents:"none"},"&:hover":{color:t.modalCloseIconHoverColor,backgroundColor:t.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:t.colorBgTextActive}},Zp(t)),[`${e}-header`]:{color:t.colorText,background:t.headerBg,borderRadius:`${Qe(t.borderRadiusLG)} ${Qe(t.borderRadiusLG)} 0 0`,marginBottom:t.headerMarginBottom,padding:t.headerPadding,borderBottom:t.headerBorderBottom},[`${e}-body`]:{fontSize:t.fontSize,lineHeight:t.lineHeight,wordWrap:"break-word",padding:t.bodyPadding,[`${e}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",margin:`${Qe(t.margin)} auto`}},[`${e}-footer`]:{textAlign:"end",background:t.footerBg,marginTop:t.footerMarginTop,padding:t.footerPadding,borderTop:t.footerBorderTop,borderRadius:t.footerBorderRadius,[`> ${t.antCls}-btn + ${t.antCls}-btn`]:{marginInlineStart:t.marginXS}},[`${e}-open`]:{overflow:"hidden"}})},{[`${e}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${e}-content,
543          ${e}-body,
544          ${e}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${e}-confirm-body`]:{marginBottom:"auto"}}}]},gJ=t=>{const{componentCls:e}=t;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},vJ=t=>{const{componentCls:e}=t,n=J7(t),r=Object.assign({},n);delete r.xs;const i=`--${e.replace(".","")}-`,s=Object.keys(r).map(o=>({[`@media (min-width: ${Qe(r[o])})`]:{width:`var(${i}${o}-width)`}}));return{[`${e}-root`]:{[e]:[].concat(st(Object.keys(n).map((o,a)=>{const l=Object.keys(n)[a-1];return l?{[`${i}${o}-width`]:`var(${i}${l}-width)`}:null})),[{width:`var(${i}xs-width)`}],st(s))}}},Q7=t=>{const e=t.padding,n=t.fontSizeHeading5,r=t.lineHeightHeading5;return jn(t,{modalHeaderHeight:t.calc(t.calc(r).mul(n).equal()).add(t.calc(e).mul(2).equal()).equal(),modalFooterBorderColorSplit:t.colorSplit,modalFooterBorderStyle:t.lineType,modalFooterBorderWidth:t.lineWidth,modalCloseIconColor:t.colorIcon,modalCloseIconHoverColor:t.colorIconHover,modalCloseBtnSize:t.controlHeight,modalConfirmIconSize:t.fontHeight,modalTitleHeight:t.calc(t.titleFontSize).mul(t.titleLineHeight).equal()})},Z7=t=>({footerBg:"transparent",headerBg:t.colorBgElevated,titleLineHeight:t.lineHeightHeading5,titleFontSize:t.fontSizeHeading5,contentBg:t.colorBgElevated,titleColor:t.colorTextHeading,contentPadding:t.wireframe?0:`${Qe(t.paddingMD)} ${Qe(t.paddingContentHorizontalLG)}`,headerPadding:t.wireframe?`${Qe(t.padding)} ${Qe(t.paddingLG)}`:0,headerBorderBottom:t.wireframe?`${Qe(t.lineWidth)} ${t.lineType} ${t.colorSplit}`:"none",headerMarginBottom:t.wireframe?0:t.marginXS,bodyPadding:t.wireframe?t.paddingLG:0,footerPadding:t.wireframe?`${Qe(t.paddingXS)} ${Qe(t.padding)}`:0,footerBorderTop:t.wireframe?`${Qe(t.lineWidth)} ${t.lineType} ${t.colorSplit}`:"none",footerBorderRadius:t.wireframe?`0 0 ${Qe(t.borderRadiusLG)} ${Qe(t.borderRadiusLG)}`:0,footerMarginTop:t.wireframe?0:t.marginSM,confirmBodyPadding:t.wireframe?`${Qe(t.padding*2)} ${Qe(t.padding*2)} ${Qe(t.paddingLG)}`:0,confirmIconMarginInlineEnd:t.wireframe?t.margin:t.marginSM,confirmBtnsMarginTop:t.wireframe?t.marginLG:t.marginSM}),eT=pi("Modal",t=>{const e=Q7(t);return[mJ(e),gJ(e),pJ(e),eX(e,"zoom"),vJ(e)]},Z7,{unitless:{titleLineHeight:!0}});var bJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};let ob;const yJ=t=>{ob={x:t.pageX,y:t.pageY},setTimeout(()=>{ob=null},100)};FY()&&document.documentElement.addEventListener("click",yJ,!0);const tT=t=>{const{prefixCls:e,className:n,rootClassName:r,open:i,wrapClassName:s,centered:o,getContainer:a,focusTriggerAfterClose:l=!0,style:c,visible:d,width:u=520,footer:f,classNames:h,styles:p,children:g,loading:v,confirmLoading:b,zIndex:w,mousePosition:C,onOk:x,onCancel:R,destroyOnHidden:O,destroyOnClose:T,panelRef:S=null,modalRender:_}=t,A=bJ(t,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","focusTriggerAfterClose","style","visible","width","footer","classNames","styles","children","loading","confirmLoading","zIndex","mousePosition","onOk","onCancel","destroyOnHidden","destroyOnClose","panelRef","modalRender"]),{getPopupContainer:$,getPrefixCls:E,direction:I,modal:D}=m.useContext(ln),B=Ie=>{b||R==null||R(Ie)},j=Ie=>{x==null||x(Ie)},z=E("modal",e),q=E(),ne=hu(z),[Z,J,de]=eT(z,ne),X=Le(s,{[`${z}-centered`]:o??(D==null?void 0:D.centered),[`${z}-wrap-rtl`]:I==="rtl"}),V=f!==null&&!v?m.createElement(Y7,Object.assign({},t,{onOk:j,onCancel:B})):null,[te,ie,ce,ae]=_G(px(t),px(D),{closable:!0,closeIcon:m.createElement(e0,{className:`${z}-close-icon`}),closeIconRender:Ie=>X7(z,Ie)}),ve=_?Ie=>m.createElement("div",{className:`${z}-render`},_(Ie)):void 0,xe=`.${z}-${_?"render":"content"}`,ge=aJ(xe),le=Yi(S,ge),[fe,Se]=v7("Modal",w),[G,he]=m.useMemo(()=>u&&typeof u=="object"?[void 0,u]:[u,void 0],[u]),Ee=m.useMemo(()=>{const Ie={};return he&&Object.keys(he).forEach(ke=>{const De=he[ke];De!==void 0&&(Ie[`--${z}-${ke}-width`]=typeof De=="number"?`${De}px`:De)}),Ie},[z,he]);return Z(m.createElement(sp,{form:!0,space:!0},m.createElement(m7.Provider,{value:Se}
544,m.createElement(H7,Object.assign({width:G},A,{zIndex:fe,getContainer:a===void 0?$:a,prefixCls:z,rootClassName:Le(J,r,de,ne),footer:V,visible:i??d,mousePosition:C??ob,onClose:B,closable:te&&Object.assign({disabled:ce,closeIcon:ie},ae),closeIcon:ie,focusTriggerAfterClose:l,transitionName:Md(q,"zoom",t.transitionName),maskTransitionName:Md(q,"fade",t.maskTransitionName),className:Le(J,n,D==null?void 0:D.className),style:Object.assign(Object.assign(Object.assign({},D==null?void 0:D.style),c),Ee),classNames:Object.assign(Object.assign(Object.assign({},D==null?void 0:D.classNames),h),{wrapper:Le(X,h==null?void 0:h.wrapper)}),styles:Object.assign(Object.assign({},D==null?void 0:D.styles),p),panelRef:le,destroyOnClose:O??T,modalRender:ve}),v?m.createElement(dc,{active:!0,title:!1,paragraph:{rows:4},className:`${z}-body-skeleton`}):g))))},wJ=t=>{const{componentCls:e,titleFontSize:n,titleLineHeight:r,modalConfirmIconSize:i,fontSize:s,lineHeight:o,modalTitleHeight:a,fontHeight:l,confirmBodyPadding:c}=t,d=`${e}-confirm`;return{[d]:{"&-rtl":{direction:"rtl"},[`${t.antCls}-modal-header`]:{display:"none"},[`${d}-body-wrapper`]:Object.assign({},G8()),[`&${e} ${e}-body`]:{padding:c},[`${d}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t.iconCls}`]:{flex:"none",fontSize:i,marginInlineEnd:t.confirmIconMarginInlineEnd,marginTop:t.calc(t.calc(l).sub(i).equal()).div(2).equal()},[`&-has-title > ${t.iconCls}`]:{marginTop:t.calc(t.calc(a).sub(i).equal()).div(2).equal()}},[`${d}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:t.marginXS,maxWidth:`calc(100% - ${Qe(t.marginSM)})`},[`${t.iconCls} + ${d}-paragraph`]:{maxWidth:`calc(100% - ${Qe(t.calc(t.modalConfirmIconSize).add(t.marginSM).equal())})`},[`${d}-title`]:{color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:n,lineHeight:r},[`${d}-content`]:{color:t.colorText,fontSize:s,lineHeight:o},[`${d}-btns`]:{textAlign:"end",marginTop:t.confirmBtnsMarginTop,[`${t.antCls}-btn + ${t.antCls}-btn`]:{marginBottom:0,marginInlineStart:t.marginXS}}},[`${d}-error ${d}-body > ${t.iconCls}`]:{color:t.colorError},[`${d}-warning ${d}-body > ${t.iconCls},
545        ${d}-confirm ${d}-body > ${t.iconCls}`]:{color:t.colorWarning},[`${d}-info ${d}-body > ${t.iconCls}`]:{color:t.colorInfo},[`${d}-success ${d}-body > ${t.iconCls}`]:{color:t.colorSuccess}}},SJ=Y8(["Modal","confirm"],t=>{const e=Q7(t);return wJ(e)},Z7,{order:-1e3});var CJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const nT=t=>{const{prefixCls:e,icon:n,okText:r,cancelText:i,confirmPrefixCls:s,type:o,okCancel:a,footer:l,locale:c}=t,d=CJ(t,["prefixCls","icon","okText","cancelText","confirmPrefixCls","type","okCancel","footer","locale"]);let u=n;if(!n&&n!==null)switch(o){case"info":u=m.createElement(CG,null);break;case"success":u=m.createElement(fG,null);break;case"error":u=m.createElement(e2,null);break;default:u=m.createElement(yG,null)}const f=a??o==="confirm",h=t.autoFocusButton===null?!1:t.autoFocusButton||"ok",[p]=Ba("Modal"),g=c||p,v=r||(f?g==null?void 0:g.okText:g==null?void 0:g.justOkText),b=i||(g==null?void 0:g.cancelText),w=m.useMemo(()=>Object.assign({autoFocusButton:h,cancelTextLocale:b,okTextLocale:v,mergedOkCancel:f},d),[h,b,v,f,d]),C=m.createElement(m.Fragment,null,m.createElement(Ix,null),m.createElement(Ax,null)),x=t.title!==void 0&&t.title!==null,R=`${s}-body`;return m.createElement("div",{className:`${s}-body-wrapper`},m.createElement("div",{className:Le(R,{[`${R}-has-title`]:x})},u,m.createElement("div",{className:`${s}-paragraph`},x&&m.createElement("span",{className:`${s}-title`},t.title),m.createElement("div",{className:`${s}-content`},t.content))),l===void 0||typeof l=="function"?m.createElement(M7,{value:w},m.createElement("div",{className:`${s}-btns`},typeof l=="function"?l(C,{OkBtn:Ax,CancelBtn:Ix}):C)):l,m.createElement(SJ,{prefixCls:e}))},xJ=t=>{const{close:e,zIndex:n,maskStyle:r,direction:i,prefixCls:s,wrapClassName:o,rootPrefixCls:a,bodyStyle:l,closable:c=!1,onConfirm:d,styles:u,title:f}=t,h=`${s}-confirm`,p=t.width||416,g=t.style||{},v=t.mask===void 0?!0:t.mask,b=t.maskClosable===void 0?!1:t.maskClosable,w=Le(h,`${h}-${t.type}`,{[`${h}-rtl`]:i==="rtl"},t.className),[,C]=Ji(),x=m.useMemo(()=>n!==void 0?n:C.zIndexPopupBase+DG,[n,C]);return m.createElement(tT,Object.assign({},t,{className:w,wrapClassName:Le({[`${h}-centered`]:!!t.centered},o),onCancel:()=>{e==null||e({triggerCancel:!0}),d==null||d(!1)}
545,title:f,footer:null,transitionName:Md(a||"","zoom",t.transitionName),maskTransitionName:Md(a||"","fade",t.maskTransitionName),mask:v,maskClosable:b,style:g,styles:Object.assign({body:l,mask:r},u),width:p,zIndex:x,closable:c}),m.createElement(nT,Object.assign({},t,{confirmPrefixCls:h})))},rT=t=>{const{rootPrefixCls:e,iconPrefixCls:n,direction:r,theme:i}=t;return m.createElement(Jo,{prefixCls:e,iconPrefixCls:n,direction:r,theme:i},m.createElement(xJ,Object.assign({},t)))},Ca=[];let iT="";function sT(){return iT}const $J=t=>{var e,n;const{prefixCls:r,getContainer:i,direction:s}=t,o=P8(),a=m.useContext(ln),l=sT()||a.getPrefixCls(),c=r||`${l}-modal`;let d=i;return d===!1&&(d=void 0),Te.createElement(rT,Object.assign({},t,{rootPrefixCls:l,prefixCls:c,iconPrefixCls:a.iconPrefixCls,theme:a.theme,direction:s??a.direction,locale:(n=(e=a.locale)===null||e===void 0?void 0:e.Modal)!==null&&n!==void 0?n:o,getContainer:d}))};function yu(t){const e=QW(),n=document.createDocumentFragment();let r=Object.assign(Object.assign({},t),{close:l,open:!0}),i,s;function o(...d){var u;if(d.some(p=>p==null?void 0:p.triggerCancel)){var h;(u=t.onCancel)===null||u===void 0||(h=u).call.apply(h,[t,()=>{}].concat(st(d.slice(1))))}for(let p=0;p<Ca.length;p++)if(Ca[p]===l){Ca.splice(p,1);break}s()}const a=d=>{clearTimeout(i),i=setTimeout(()=>{const u=e.getPrefixCls(void 0,sT()),f=e.getIconPrefixCls(),h=e.getTheme(),p=Te.createElement($J,Object.assign({},d));s=w7()(Te.createElement(Jo,{prefixCls:u,iconPrefixCls:f,theme:h},typeof e.holderRender=="function"?e.holderRender(p):p),n)})};function l(...d){r=Object.assign(Object.assign({},r),{open:!1,afterClose:()=>{typeof t.afterClose=="function"&&t.afterClose(),o.apply(this,d)}}),r.visible&&delete r.visible,a(r)}function c(d){typeof d=="function"?r=d(r):r=Object.assign(Object.assign({},r),d),a(r)}return a(r),Ca.push(l),{destroy:l,update:c}}function oT(t){return Object.assign(Object.assign({},t),{type:"warning"})}function aT(t){return Object.assign(Object.assign({},t),{type:"info"})}function lT(t){return Object.assign(Object.assign({},t),{type:"success"})}function cT(t){return Object.assign(Object.assign({},t),{type:"error"})}function dT(t){return Object.assign(Object.assign({},t),{type:"confirm"})}function EJ({rootPrefixCls:t}){iT=t}var TJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const RJ=(t,e)=>{var n,{afterClose:r,config:i}=t,s=TJ(t,["afterClose","config"]);const[o,a]=m.useState(!0),[l,c]=m.useState(i),{direction:d,getPrefixCls:u}=m.useContext(ln),f=u("modal"),h=u(),p=()=>{var w;r(),(w=l.afterClose)===null||w===void 0||w.call(l)},g=(...w)=>{var C;if(a(!1),w.some(O=>O==null?void 0:O.triggerCancel)){var R;(C=l.onCancel)===null||C===void 0||(R=C).call.apply(R,[l,()=>{}].concat(st(w.slice(1))))}};m.useImperativeHandle(e,()=>({destroy:g,update:w=>{c(C=>{const x=typeof w=="function"?w(C):w;return Object.assign(Object.assign({},C),x)})}}));const v=(n=l.okCancel)!==null&&n!==void 0?n:l.type==="confirm",[b]=Ba("Modal",Fo.Modal);return m.createElement(rT,Object.assign({prefixCls:f,rootPrefixCls:h},l,{close:g,open:o,afterClose:p,okText:l.okText||(v?b==null?void 0:b.okText:b==null?void 0:b.justOkText),direction:l.direction||d,cancelText:l.cancelText||(b==null?void 0:b.cancelText)},s))},IJ=m.forwardRef(RJ);let Jx=0;const AJ=m.memo(m.forwardRef((t,e)=>{const[n,r]=PG();return m.useImperativeHandle(e,()=>({patchElement:r}),[r]),m.createElement(m.Fragment,null,n)}));function OJ(){const t=m.useRef(null),[e,n]=m.useState([]);m.useEffect(()=>{e.length&&(st(e).forEach(o=>{o()}),n([]))},[e]);const r=m.useCallback(s=>function(a){var l;Jx+=1;const c=m.createRef();let d;const u=new Promise(v=>{d=v});let f=!1,h;const p=m.createElement(IJ,{key:`modal-${Jx}`,config:s(a),ref:c,afterClose:()=>{h==null||h()},isSilent:()=>f,onConfirm:v=>{d(v)}});return h=(l=t.current)===null||l===void 0?void 0:l.patchElement(p),h&&Ca.push(h),{destroy:()=>{function v(){var b;(b=c.current)===null||b===void 0||b.destroy()}c.current?v():n(b=>[].concat(st(b),[v]))},update:v=>{function b(){var w;(w=c.current)===null||w===void 0||w.update(v)}c.current?b():n(w=>[].concat(st(w),[b]))},then:v=>(f=!0,u.then(v))}},[]);return[m.useMemo(()=>({info:r(aT),success:r(lT),error:r(cT),warning:r(oT),confirm:r(dT)}),[r]),m.createElement(AJ,{key:"modal-holder",ref:t})]}function uT(t){return e=>m.createElement(Jo,{theme:{token:{motion:!1,zIndexPopupBase:0}}},m.createElement(t,Object.assign({},e)))}const kJ=(t,e,n,r,i)=>uT(o=>{const{prefixCls:a,style:l}=o,c=m.useRef(null),[d,u]=m.useState(0),[f,h]=m.useState(0),[p,g]=Ho(!1,{value:o.open}),{getPrefixCls:v}=m.useContext(ln),b=v(r||"select",a);m.useEffect(()=>{if(g(!0),typeof ResizeObserver<"u"){const x=new ResizeObserver(O=>{const T=O[0].target;u(T.offsetHeight+8),h(T.offsetWidth)}),R=setInterval(()=>{var O;const T=i?`.${i(b)}`:`.${b}-dropdown`,S=(O=c.current)===null||O===void 0?void 0:O.querySelector(T);S&&(clearInterval(R),x.observe(S))},10);return()=>{clearInterval(R),x.disconnect()}}},[b]);let w=Object.assign(Object.assign({},o),{style:Object.assign(Object.assign({},l),{margin:0}),open:p,visible:p,getPopupContainer:()=>c.current});e&&Object.assign(w,{[e]:{overflow:{adjustX:!1,adjustY:!1}}});const C={paddingBottom:d,position:"relative",minWidth:f};return m.createElement("div",{ref:c,style:C},m.createElement(t,Object.assign({},w)))}),fT=(function(){if(typeof navigator>"u"||typeof window>"u")return!1;var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|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(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t==null?void 0:t.substr(0,4))});var f0=function(e){var n=e.className,r=e.customizeIcon,i=e.customizeIconProps,s=e.children,o=e.onMouseDown,a=e.onClick,l=typeof r=="function"?r(i):r;return m.createElement("span",{className:n,onMouseDown:function(d){d.preventDefault(),o==null||o(d)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},l!==void 0?l:m.createElement("span",{className:Le(n.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},s))},NJ=function(e,n,r,i,s){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,a=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,c=Te.useMemo(function(){if(vt(i)==="object")return i.clearIcon;if(s)return s},[i,s]),d=Te.useMemo(function(){return!!(!o&&i&&(r.length||a)&&!(l==="combobox"&&a===""))},[i,o,r.length,a,l]);return{allowClear:d,clearIcon:Te.createElement(f0,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:c},"×")}},hT=m.createContext(null);function _J(){return m.useContext(hT)}function PJ(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=m.useState(!1),n=Re(e,2),r=n[0],i=n[1],s=m.useRef(null),o=function(){window.clearTimeout(s.current)};m.useEffect(function(){return o},[]);var a=function(c,d){o(),s.current=window.setTimeout(function(){i(c),d&&d()},t)};return[r,a,o]}function pT(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=m.useRef(null),n=m.useRef(null);m.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(i){(i||e.current===null)&&(e.current=i),window.clearTimeout(n.current),n.current=window.setTimeout(function(){e.current=null},t)}return[function(){return e.current},r]}function MJ(t,e,n,r){var i=m.useRef(null);i.current={open:e,triggerOpen:n,customizedTrigger:r},m.useEffect(function(){function s(o){var a;if(!((a=i.current)!==null&&a!==void 0&&a.customizedTrigger)){var l=o.target;l.shadowRoot&&o.composed&&(l=o.composedPath()[0]||l),i.current.open&&t().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",s),function(){return window.removeEventListener("mousedown",s)}},[])}function DJ(t){return t&&![Nt.ESC,Nt.SHIFT,Nt.BACKSPACE,Nt.TAB,Nt.WIN_KEY,Nt.ALT,Nt.META,Nt.WIN_KEY_RIGHT,Nt.CTRL,Nt.SEMICOLON,Nt.EQUALS,Nt.CAPS_LOCK,Nt.CONTEXT_MENU,Nt.F1,Nt.F2,Nt.F3,Nt.F4,Nt.F5,Nt.F6,Nt.F7,Nt.F8,Nt.F9,Nt.F10,Nt.F11,Nt.F12].includes(t)}
545var LJ=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],ol=void 0;function jJ(t,e){var n=t.prefixCls,r=t.invalidate,i=t.item,s=t.renderItem,o=t.responsive,a=t.responsiveDisabled,l=t.registerSize,c=t.itemKey,d=t.className,u=t.style,f=t.children,h=t.display,p=t.order,g=t.component,v=g===void 0?"div":g,b=cn(t,LJ),w=o&&!h;function C(S){l(c,S)}m.useEffect(function(){return function(){C(null)}},[]);var x=s&&i!==ol?s(i,{index:p}):f,R;r||(R={opacity:w?0:1,height:w?0:ol,overflowY:w?"hidden":ol,order:o?p:ol,pointerEvents:w?"none":ol,position:w?"absolute":ol});var O={};w&&(O["aria-hidden"]=!0);var T=m.createElement(v,yt({className:Le(!r&&n,d),style:ee(ee({},R),u)},O,b,{ref:e}),x);return o&&(T=m.createElement(Xo,{onResize:function(_){var A=_.offsetWidth;C(A)},disabled:a},T)),T}var El=m.forwardRef(jJ);El.displayName="Item";function FJ(t){if(typeof MessageChannel>"u")Un(t);else{var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(void 0)}}function BJ(){var t=m.useRef(null),e=function(r){t.current||(t.current=[],FJ(function(){Vf.unstable_batchedUpdates(function(){t.current.forEach(function(i){i()}),t.current=null})})),t.current.push(r)};return e}function al(t,e){var n=m.useState(e),r=Re(n,2),i=r[0],s=r[1],o=nr(function(a){t(function(){s(a)})});return[i,o]}var op=Te.createContext(null),HJ=["component"],zJ=["className"],qJ=["className"],UJ=function(e,n){var r=m.useContext(op);if(!r){var i=e.component,s=i===void 0?"div":i,o=cn(e,HJ);return m.createElement(s,yt({},o,{ref:n}))}var a=r.className,l=cn(r,zJ),c=e.className,d=cn(e,qJ);return m.createElement(op.Provider,{value:null},m.createElement(El,yt({ref:n,className:Le(a,c)},l,d)))},mT=m.forwardRef(UJ);mT.displayName="RawItem";var VJ=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],gT="responsive",vT="invalidate";function WJ(t){return"+ ".concat(t.length," ...")}function GJ(t,e){var n=t.prefixCls,r=n===void 0?"rc-overflow":n,i=t.data,s=i===void 0?[]:i,o=t.renderItem,a=t.renderRawItem,l=t.itemKey,c=t.itemWidth,d=c===void 0?10:c,u=t.ssr,f=t.style,h=t.className,p=t.maxCount,g=t.renderRest,v=t.renderRawRest,b=t.prefix,w=t.suffix,C=t.component,x=C===void 0?"div":C,R=t.itemComponent,O=t.onVisibleChange,T=cn(t,VJ),S=u==="full",_=BJ(),A=al(_,null),$=Re(A,2),E=$[0],I=$[1],D=E||0,B=al(_,new Map),j=Re(B,2),z=j[0],q=j[1],ne=al(_,0),Z=Re(ne,2),J=Z[0],de=Z[1],X=al(_,0),V=Re(X,2),te=V[0],ie=V[1],ce=al(_,0),ae=Re(ce,2),ve=ae[0],xe=ae[1],ge=al(_,0),le=Re(ge,2),fe=le[0],Se=le[1],G=m.useState(null),he=Re(G,2),Ee=he[0],Ie=he[1],ke=m.useState(null),De=Re(ke,2),He=De[0],Je=De[1],ze=m.useMemo(function(){return He===null&&S?Number.MAX_SAFE_INTEGER:He||0},[He,E]),Ne=m.useState(!1),tt=Re(Ne,2),pt=tt[0],gt=tt[1],y="".concat(r,"-item"),K=Math.max(J,te),W=p===gT,re=s.length&&W,se=p===vT,pe=re||typeof p=="number"&&s.length>p,M=m.useMemo(function(){var _e=s;return re?E===null&&S?_e=s:_e=s.slice(0,Math.min(s.length,D/d)):typeof p=="number"&&(_e=s.slice(0,p)),_e},[s,d,E,p,re]),L=m.useMemo(function(){return re?s.slice(ze+1):s.slice(M.length)},[s,M,re,ze]),ye=m.useCallback(function(_e,Me){var Ue;return typeof l=="function"?l(_e):(Ue=l&&(_e==null?void 0:_e[l]))!==null&&Ue!==void 0?Ue:Me},[l]),ue=m.useCallback(o||function(_e){return _e},[o]);function be(_e,Me,Ue){He===_e&&(Me===void 0||Me===Ee)||(Je(_e),Ue||(gt(_e<s.length-1),O==null||O(_e)),Me!==void 0&&Ie(Me))}function we(_e,Me){I(Me.clientWidth)}function Ae(_e,Me){q(function(Ue){var mt=new Map(Ue);return Me===null?mt.delete(_e):mt.set(_e,Me),mt})}function Pe(_e,Me){ie(Me),de(te)}function je(_e,Me){xe(Me)}function Xe(_e,Me){Se(Me)}function Ge(_e){return z.get(ye(M[_e],_e))}wn(function(){if(D&&typeof K=="number"&&M){var _e=ve+fe,Me=M.length,Ue=Me-1;if(!Me){be(0,null);return}for(var mt=0;mt<Me;mt+=1){var $e=Ge(mt);if(S&&($e=$e||0),$e===void 0){be(mt-1,void 0,!0);break}if(_e+=$e,Ue===0&&_e<=D||mt===Ue-1&&_e+Ge(Ue)<=D){be(Ue,null);break}else if(_e+K>D){be(mt-1,_e-$e-fe+te);break}}w&&Ge(0)+fe>D&&Ie(null)}},[D,z,te,ve,fe,ye,M]);var it=pt&&!!L.length,nt={};Ee!==null&&re&&(nt={position:"absolute",left:Ee,top:0});var Ut={prefixCls:y,responsive:re,component:R,invalidate:se},Bt=a?function(_e,Me){var Ue=ye(_e,Me);return m.createElement(op.Provider,{key:Ue,value:ee(ee({},Ut),{},{order:Me,item:_e,itemKey:Ue,registerSize:Ae,display:Me<=ze})},a(_e,Me))}:function(_e,Me){var Ue=ye(_e,Me);return m.createElement(El,yt({},Ut,{order:Me,key:Ue,item:_e,renderItem:ue,itemKey:Ue,registerSize:Ae,display:Me<=ze}))},ht={order:it?ze:Number.MAX_SAFE_INTEGER,className:"".concat(y,"
545-rest"),registerSize:Pe,display:it},Et=g||WJ,Vt=v?m.createElement(op.Provider,{value:ee(ee({},Ut),ht)},v(L)):m.createElement(El,yt({},Ut,ht),typeof Et=="function"?Et(L):Et),et=m.createElement(x,yt({className:Le(!se&&r,h),style:f,ref:e},T),b&&m.createElement(El,yt({},Ut,{responsive:W,responsiveDisabled:!re,order:-1,className:"".concat(y,"-prefix"),registerSize:je,display:!0}),b),M.map(Bt),pe?Vt:null,w&&m.createElement(El,yt({},Ut,{responsive:W,responsiveDisabled:!re,order:ze,className:"".concat(y,"-suffix"),registerSize:Xe,display:!0,style:nt}),w));return W?m.createElement(Xo,{onResize:we,disabled:!re},et):et}var wu=m.forwardRef(GJ);wu.displayName="Overflow";wu.Item=mT;wu.RESPONSIVE=gT;wu.INVALIDATE=vT;function KJ(t,e,n){var r=ee(ee({},t),e);return Object.keys(e).forEach(function(i){var s=e[i];typeof s=="function"&&(r[i]=function(){for(var o,a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return s.apply(void 0,l),(o=t[i])===null||o===void 0?void 0:o.call.apply(o,[t].concat(l))})}),r}var XJ=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],YJ=function(e,n){var r=e.prefixCls,i=e.id,s=e.inputElement,o=e.autoFocus,a=e.autoComplete,l=e.editable,c=e.activeDescendantId,d=e.value,u=e.open,f=e.attrs,h=cn(e,XJ),p=s||m.createElement("input",null),g=p,v=g.ref,b=g.props;return"maxLength"in p.props,p=m.cloneElement(p,ee(ee(ee({type:"search"},KJ(h,b)),{},{id:i,ref:Yi(n,v),autoComplete:a||"off",autoFocus:o,className:Le("".concat(r,"-selection-search-input"),b==null?void 0:b.className),role:"combobox","aria-expanded":u||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":u?c:void 0},f),{},{value:l?d:"",readOnly:!l,unselectable:l?null:"on",style:ee(ee({},b.style),{},{opacity:l?null:0})})),p},bT=m.forwardRef(YJ);function yT(t){return Array.isArray(t)?t:t!==void 0?[t]:[]}var JJ=typeof window<"u"&&window.document&&window.document.documentElement,QJ=JJ;function ZJ(t){return t!=null}function eQ(t){return!t&&t!==0}function Qx(t){return["string","number"].includes(vt(t))}function wT(t){var e=void 0;return t&&(Qx(t.title)?e=t.title.toString():Qx(t.label)&&(e=t.label.toString())),e}function tQ(t,e){QJ?m.useLayoutEffect(t,e):m.useEffect(t,e)}function nQ(t){var e;return(e=t.key)!==null&&e!==void 0?e:t.value}var Zx=function(e){e.preventDefault(),e.stopPropagation()},rQ=function(e){var n=e.id,r=e.prefixCls,i=e.values,s=e.open,o=e.searchValue,a=e.autoClearSearchValue,l=e.inputRef,c=e.placeholder,d=e.disabled,u=e.mode,f=e.showSearch,h=e.autoFocus,p=e.autoComplete,g=e.activeDescendantId,v=e.tabIndex,b=e.removeIcon,w=e.maxTagCount,C=e.maxTagTextLength,x=e.maxTagPlaceholder,R=x===void 0?function(Se){return"+ ".concat(Se.length," ...")}:x,O=e.tagRender,T=e.onToggleOpen,S=e.onRemove,_=e.onInputChange,A=e.onInputPaste,$=e.onInputKeyDown,E=e.onInputMouseDown,I=e.onInputCompositionStart,D=e.onInputCompositionEnd,B=e.onInputBlur,j=m.useRef(null),z=m.useState(0),q=Re(z,2),ne=q[0],Z=q[1],J=m.useState(!1),de=Re(J,2),X=de[0],V=de[1],te="".concat(r,"-selection"),ie=s||u==="multiple"&&a===!1||u==="tags"?o:"",ce=u==="tags"||u==="multiple"&&a===!1||f&&(s||X);tQ(function(){Z(j.current.scrollWidth)},[ie]);var ae=function(G,he,Ee,Ie,ke){return m.createElement("span",{title:wT(G),className:Le("".concat(te,"-item"),Y({},"".concat(te,"-item-disabled"),Ee))},m.createElement("span",{className:"".concat(te,"-item-content")},he),Ie&&m.createElement(f0,{className:"".concat(te,"-item-remove"),onMouseDown:Zx,onClick:ke,customizeIcon:b},"×"))},ve=function(G,he,Ee,Ie,ke,De){var He=function(ze){Zx(ze),T(!s)};return m.createElement("span",{onMouseDown:He},O({label:he,value:G,disabled:Ee,closable:Ie,onClose:ke,isMaxTag:!!De}))},xe=function(G){var he=G.disabled,Ee=G.label,Ie=G.value,ke=!d&&!he,De=Ee;if(typeof C=="number"&&(typeof Ee=="string"||typeof Ee=="number")){var He=String(De);He.length>C&&(De="".concat(He.slice(0,C),"..."))}var Je=function(Ne){Ne&&Ne.stopPropagation(),S(G)};return typeof O=="function"?ve(Ie,De,he,ke,Je):ae(G,De,he,ke,Je)},ge=function(G){if(!i.length)return null;var he=typeof R=="function"?R(G):R;return typeof O=="function"?ve(void 0,he,!1,!1,void 0,!0):ae({title:he},he,!1)},le=m.createElement("div",{className:"".concat(te,"-search"),style:{width:ne},onFocus:function(){V(!0)},onBlur:function(){V(!1)}},m.createElement(bT,{ref:l,open:s,prefixCls:r,id:n,inputElement:null,disabled:d,autoFocus:h,autoComplete:p,editable:ce,activeDescendantId:g,value:ie,onKeyDown:$,onMouseDown:E,onChange:_,onPaste:A,onCompositionStart:I,onCompositionEnd:D,onBlur:B,tabIndex:v,attrs:zo(e,!0)}),m.createElement("span",{ref:j,className:"".concat(te,"-search-mirror"),"aria-hidden":!0},ie," ")),fe=m.createElement(wu,{prefixCls:"".concat(te,"-overflow"),data:i,renderItem:xe,renderRest:ge,suffix:le,itemKey:nQ,maxCount:w});return m.createElement("span",{className:"".concat(te,"-wrap")},fe,!i.length&&!ie&&m.createElement("span",{className:"".concat(te,"-placeholder")},c))},iQ=function(e){var n=e.inputElement,r=e.prefixCls,i=e.id,s=e.inputRef,o=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,d=e.mode,u=e.open,f=e.values,h=e.placeholder,p=e.tabIndex,g=e.showSearch,v=e.searchValue,b=e.activeValue,w=e.maxLength,C=e.onInputKeyDown,x=e.onInputMouseDown,R=e.onInputChange,O=e.onInputPaste,T=e.onInputCompositionStart,S=e.onInputCompositionEnd,_=e.onInputBlur,A=e.title,$=m.useState(!1),E=Re($,2),I=E[0],D=E[1],B=d==="combobox",j=B||g,z=f[0],q=v||"";B&&b&&!I&&(q=b),m.useEffect(function(){B&&D(!1)},[B,b]);var ne=d!=="combobox"&&!u&&!g?!1:!!q,Z=A===void 0?wT(z):A,J=m.useMemo(function(){return z?null:m.createElement("span",{className:"".concat(r,"-selection-
545placeholder"),style:ne?{visibility:"hidden"}:void 0},h)},[z,ne,h,r]);return m.createElement("span",{className:"".concat(r,"-selection-wrap")},m.createElement("span",{className:"".concat(r,"-selection-search")},m.createElement(bT,{ref:s,prefixCls:r,id:i,open:u,inputElement:n,disabled:o,autoFocus:a,autoComplete:l,editable:j,activeDescendantId:c,value:q,onKeyDown:C,onMouseDown:x,onChange:function(X){D(!0),R(X)},onPaste:O,onCompositionStart:T,onCompositionEnd:S,onBlur:_,tabIndex:p,attrs:zo(e,!0),maxLength:B?w:void 0})),!B&&z?m.createElement("span",{className:"".concat(r,"-selection-item"),title:Z,style:ne?{visibility:"hidden"}:void 0},z.label):null,J)},sQ=function(e,n){var r=m.useRef(null),i=m.useRef(!1),s=e.prefixCls,o=e.open,a=e.mode,l=e.showSearch,c=e.tokenWithEnter,d=e.disabled,u=e.prefix,f=e.autoClearSearchValue,h=e.onSearch,p=e.onSearchSubmit,g=e.onToggleOpen,v=e.onInputKeyDown,b=e.onInputBlur,w=e.domRef;m.useImperativeHandle(n,function(){return{focus:function(Z){r.current.focus(Z)},blur:function(){r.current.blur()}}});var C=pT(0),x=Re(C,2),R=x[0],O=x[1],T=function(Z){var J=Z.which,de=r.current instanceof HTMLTextAreaElement;!de&&o&&(J===Nt.UP||J===Nt.DOWN)&&Z.preventDefault(),v&&v(Z),J===Nt.ENTER&&a==="tags"&&!i.current&&!o&&(p==null||p(Z.target.value)),!(de&&!o&&~[Nt.UP,Nt.DOWN,Nt.LEFT,Nt.RIGHT].indexOf(J))&&DJ(J)&&g(!0)},S=function(){O(!0)},_=m.useRef(null),A=function(Z){h(Z,!0,i.current)!==!1&&g(!0)},$=function(){i.current=!0},E=function(Z){i.current=!1,a!=="combobox"&&A(Z.target.value)},I=function(Z){var J=Z.target.value;if(c&&_.current&&/[\r\n]/.test(_.current)){var de=_.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");J=J.replace(de,_.current)}_.current=null,A(J)},D=function(Z){var J=Z.clipboardData,de=J==null?void 0:J.getData("text");_.current=de||""},B=function(Z){var J=Z.target;if(J!==r.current){var de=document.body.style.msTouchAction!==void 0;de?setTimeout(function(){r.current.focus()}):r.current.focus()}},j=function(Z){var J=R();Z.target!==r.current&&!J&&!(a==="combobox"&&d)&&Z.preventDefault(),(a!=="combobox"&&(!l||!J)||!o)&&(o&&f!==!1&&h("",!0,!1),g())},z={inputRef:r,onInputKeyDown:T,onInputMouseDown:S,onInputChange:I,onInputPaste:D,onInputCompositionStart:$,onInputCompositionEnd:E,onInputBlur:b},q=a==="multiple"||a==="tags"?m.createElement(rQ,yt({},e,z)):m.createElement(iQ,yt({},e,z));return m.createElement("div",{ref:w,className:"".concat(s,"-selector"),onClick:B,onMouseDown:j},u&&m.createElement("div",{className:"".concat(s,"-prefix")},u),q)},oQ=m.forwardRef(sQ);function aQ(t){var e=t.prefixCls,n=t.align,r=t.arrow,i=t.arrowPos,s=r||{},o=s.className,a=s.content,l=i.x,c=l===void 0?0:l,d=i.y,u=d===void 0?0:d,f=m.useRef();if(!n||!n.points)return null;var h={position:"absolute"};if(n.autoArrow!==!1){var p=n.points[0],g=n.points[1],v=p[0],b=p[1],w=g[0],C=g[1];v===w||!["t","b"].includes(v)?h.top=u:v==="t"?h.top=0:h.bottom=0,b===C||!["l","r"].includes(b)?h.left
545=c:b==="l"?h.left=0:h.right=0}return m.createElement("div",{ref:f,className:Le("".concat(e,"-arrow"),o),style:h},a)}function lQ(t){var e=t.prefixCls,n=t.open,r=t.zIndex,i=t.mask,s=t.motion;return i?m.createElement(Yo,yt({},s,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(o){var a=o.className;return m.createElement("div",{style:{zIndex:r},className:Le("".concat(e,"-mask"),a)})}):null}var cQ=m.memo(function(t){var e=t.children;return e},function(t,e){return e.cache}),dQ=m.forwardRef(function(t,e){var n=t.popup,r=t.className,i=t.prefixCls,s=t.style,o=t.target,a=t.onVisibleChanged,l=t.open,c=t.keepDom,d=t.fresh,u=t.onClick,f=t.mask,h=t.arrow,p=t.arrowPos,g=t.align,v=t.motion,b=t.maskMotion,w=t.forceRender,C=t.getPopupContainer,x=t.autoDestroy,R=t.portal,O=t.zIndex,T=t.onMouseEnter,S=t.onMouseLeave,_=t.onPointerEnter,A=t.onPointerDownCapture,$=t.ready,E=t.offsetX,I=t.offsetY,D=t.offsetR,B=t.offsetB,j=t.onAlign,z=t.onPrepare,q=t.stretch,ne=t.targetWidth,Z=t.targetHeight,J=typeof n=="function"?n():n,de=l||c,X=(C==null?void 0:C.length)>0,V=m.useState(!C||!X),te=Re(V,2),ie=te[0],ce=te[1];if(wn(function(){!ie&&X&&o&&ce(!0)},[ie,X,o]),!ie)return null;var ae="auto",ve={left:"-1000vw",top:"-1000vh",right:ae,bottom:ae};if($||!l){var xe,ge=g.points,le=g.dynamicInset||((xe=g._experimental)===null||xe===void 0?void 0:xe.dynamicInset),fe=le&&ge[0][1]==="r",Se=le&&ge[0][0]==="b";fe?(ve.right=D,ve.left=ae):(ve.left=E,ve.right=ae),Se?(ve.bottom=B,ve.top=ae):(ve.top=I,ve.bottom=ae)}var G={};return q&&(q.includes("height")&&Z?G.height=Z:q.includes("minHeight")&&Z&&(G.minHeight=Z),q.includes("width")&&ne?G.width=ne:q.includes("minWidth")&&ne&&(G.minWidth=ne)),l||(G.pointerEvents="none"),m.createElement(R,{open:w||de,getContainer:C&&function(){return C(o)},autoDestroy:x},m.createElement(lQ,{prefixCls:i,open:l,zIndex:O,mask:f,motion:b}),m.createElement(Xo,{onResize:j,disabled:!l},function(he){return m.createElement(Yo,yt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:w,leavedClassName:"".concat(i,"-hidden")},v,{onAppearPrepare:z,onEnterPrepare:z,visible:l,onVisibleChanged:function(Ie){var ke;v==null||(ke=v.onVisibleChanged)===null||ke===void 0||ke.call(v,Ie),a(Ie)}}),function(Ee,Ie){var ke=Ee.className,De=Ee.style,He=Le(i,ke,r);return m.createElement("div",{ref:Yi(he,e,Ie),className:He,style:ee(ee(ee(ee({"--arrow-x":"".concat(p.x||0,"px"),"--arrow-y":"".concat(p.y||0,"px")},ve),G),De),{},{boxSizing:"border-box",zIndex:O},s),onMouseEnter:T,onMouseLeave:S,onPointerEnter:_,onClick:u,onPointerDownCapture:A},h&&m.createElement(aQ,{prefixCls:i,arrow:h,arrowPos:p,align:g}),m.createElement(cQ,{cache:!l&&!d},J))})}))}),uQ=m.forwardRef(function(t,e){var n=t.children,r=t.getTriggerDOMNode,i=oc(n),s=m.useCallback(function(a){Hy(e,r?r(a):a)},[r]),o=sc(s,Wp(n));return i?m.cloneElement(n,{ref:o}):n}),e4=m.createContext(null);function t4(t){return t?Array.isArray(t)?t:[t]:[]}function fQ(t,e,n,r){return m.useMemo(function(){var i=t4(n??e),s=t4(r??e),o=new Set(i),a=new Set(s);return t&&(o.has("hover")&&(o.delete("hover"),o.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[o,a]},[t,e,n,r])}function hQ(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function pQ(t,e,n,r){for(var i=n.points,s=Object.keys(t),o=0;o<s.length;o+=1){var a,l=s[o];if(hQ((a=t[l])===null||a===void 0?void 0:a.points,i,r))return"".concat(e,"-placement-").concat(l)}return""}function n4(t,e,n,r){return e||(n?{motionName:"".concat(t,"-").concat(n)}:r?{motionName:r}:null)}function Su(t){return t.ownerDocument.defaultView}function ab(t){for(var e=[],n=t==null?void 0:t.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=Su(n).getComputedStyle(n),s=i.overflowX,o=i.overflowY,a=i.overflow;[s,o,a].some(function(l){return r.includes(l)})&&e.push(n),n=n.parentElement}return e}function Ld(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(t)?e:t}function Oc(t){return Ld(parseFloat(t),0)}function r4(t,e){var n=ee({},t);
545return(e||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var i=Su(r).getComputedStyle(r),s=i.overflow,o=i.overflowClipMargin,a=i.borderTopWidth,l=i.borderBottomWidth,c=i.borderLeftWidth,d=i.borderRightWidth,u=r.getBoundingClientRect(),f=r.offsetHeight,h=r.clientHeight,p=r.offsetWidth,g=r.clientWidth,v=Oc(a),b=Oc(l),w=Oc(c),C=Oc(d),x=Ld(Math.round(u.width/p*1e3)/1e3),R=Ld(Math.round(u.height/f*1e3)/1e3),O=(p-g-w-C)*x,T=(f-h-v-b)*R,S=v*R,_=b*R,A=w*x,$=C*x,E=0,I=0;if(s==="clip"){var D=Oc(o);E=D*x,I=D*R}var B=u.x+A-E,j=u.y+S-I,z=B+u.width+2*E-A-$-O,q=j+u.height+2*I-S-_-T;n.left=Math.max(n.left,B),n.top=Math.max(n.top,j),n.right=Math.min(n.right,z),n.bottom=Math.min(n.bottom,q)}}),n}function i4(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(e),r=n.match(/^(.*)\%$/);return r?t*(parseFloat(r[1])/100):parseFloat(n)}function s4(t,e){var n=e||[],r=Re(n,2),i=r[0],s=r[1];return[i4(t.width,i),i4(t.height,s)]}function o4(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[t[0],t[1]]}function ll(t,e){var n=e[0],r=e[1],i,s;return n==="t"?s=t.y:n==="b"?s=t.y+t.height:s=t.y+t.height/2,r==="l"?i=t.x:r==="r"?i=t.x+t.width:i=t.x+t.width/2,{x:i,y:s}}function lo(t,e){var n={t:"b",b:"t",l:"r",r:"l"};return t.map(function(r,i){return i===e?n[r]||"c":r}).join("")}function mQ(t,e,n,r,i,s,o){var a=m.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:i[r]||{}}),l=Re(a,2),c=l[0],d=l[1],u=m.useRef(0),f=m.useMemo(function(){return e?ab(e):[]},[e]),h=m.useRef({}),p=function(){h.current={}};t||p();var g=nr(function(){if(e&&n&&t){let Ur=function(Zo,Pi){var ns=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tt,ea=de.x+Zo,Ga=de.y+Pi,Ka=ea+Se,Xa=Ga+fe,Ya=Math.max(ea,ns.left),ot=Math.max(Ga,ns.top),$t=Math.min(Ka,ns.right),bn=Math.min(Xa,ns.bottom);return Math.max(0,($t-Ya)*(bn-ot))},Js=function(){Pn=de.y+Et,Wn=Pn+fe,Gn=de.x+ht,vn=Gn+Se};var w,C,x,R,O=e,T=O.ownerDocument,S=Su(O),_=S.getComputedStyle(O),A=_.position,$=O.style.left,E=O.style.top,I=O.style.right,D=O.style.bottom,B=O.style.overflow,j=ee(ee({},i[r]),s),z=T.createElement("div");(w=O.parentElement)===null||w===void 0||w.appendChild(z),z.style.left="".concat(O.offsetLeft,"px"),z.style.top="".concat(O.offsetTop,"px"),z.style.position=A,z.style.height="".concat(O.offsetHeight,"px"),z.style.width="".concat(O.offsetWidth,"px"),O.style.left="0",O.style.top="0",O.style.right="auto",O.style.bottom="auto",O.style.overflow="hidden";var q;if(Array.isArray(n))q={x:n[0],y:n[1],width:0,height:0};else{var ne,Z,J=n.getBoundingClientRect();J.x=(ne=J.x)!==null&&ne!==void 0?ne:J.left,J.y=(Z=J.y)!==null&&Z!==void 0?Z:J.top,q={x:J.x,y:J.y,width:J.width,height:J.height}}var de=O.getBoundingClientRect(),X=S.getComputedStyle(O),V=X.height,te=X.width;de.x=(C=de.x)!==null&&C!==void 0?C:de.left,de.y=(x=de.y)!==null&&x!==void 0?x:de.top;var ie=T.documentElement,ce=ie.clientWidth,ae=ie.clientHeight,ve=ie.scrollWidth,xe=ie.scrollHeight,ge=ie.scrollTop,le=ie.scrollLeft,fe=de.height,Se=de.width,G=q.height,he=q.width,Ee={left:0,top:0,right:ce,bottom:ae},Ie={left:-le,top:-ge,right:ve-le,bottom:xe-ge},ke=j.htmlRegion,De="visible",He="visibleFirst";ke!=="scroll"&&ke!==He&&(ke=De);var Je=ke===He,ze=r4(Ie,f),Ne=r4(Ee,f),tt=ke===De?Ne:ze,pt=Je?Ne:tt;O.style.left="auto",O.style.top="auto",O.style.right="0",O.style.bottom="0";var gt=O.getBoundingClientRect();O.style.left=$,O.style.top=E,O.style.right=I,O.style.bottom=D,O.style.overflow=B,(R=O.parentElement)===null||R===void 0||R.removeChild(z);var y=Ld(Math.round(Se/parseFloat(te)*1e3)/1e3),K=Ld(Math.round(fe/parseFloat(V)*1e3)/1e3);if(y===0||K===0||Td(n)&&!S7(n))return;var W=j.offset,re=j.targetOffset,se=s4(de,W),pe=Re(se,2),M=pe[0],L=pe[1],ye=s4(q,re),ue=Re(ye,2),be=ue[0],we=ue[1];q.x-=be,q.y-=we;var Ae=j.points||[],Pe=Re(Ae,2),je=Pe[0],Xe=Pe[1],Ge=o4(Xe),it=o4(je),nt=ll(q,Ge),Ut=ll(de,it),Bt=ee({},j),ht=nt.x-Ut.x+M,Et=nt.y-Ut.y+L,Vt=Ur(ht,Et),et=Ur(ht,Et,Ne),_e=ll(q,["t","l"]),Me=ll(de,["t","l"]),Ue=ll(q,["b","r"]),mt=ll(de,["b","r"]),$e=j.overflow||{},zt=$e.adjustX,Kt=$e.adjustY,Xt=$e.shiftX,Gt=$e.shiftY,_n=function(Pi){return typeof Pi=="boolean"?Pi:Pi>=0},Pn,Wn,Gn,vn;Js();var On=_n(Kt),Ye=it[0]===Ge[0];if(On&&it[0]==="t"&&(Wn>pt.bottom||h.current.bt)){var at=Et;Ye?at-=fe-G:at=_e.y-mt.y-L;var It=Ur(ht,at),Ft=Ur(ht,at,Ne);It>Vt||It===Vt&&(!Je||Ft>=et)?(h.current.bt=!0,Et=at,L=-L,Bt.points=[lo(it,0),lo(Ge,0)]):h.current.bt=!1}
545if(On&&it[0]==="b"&&(Pn<pt.top||h.current.tb)){var Zt=Et;Ye?Zt+=fe-G:Zt=Ue.y-Me.y-L;var Zr=Ur(ht,Zt),Mr=Ur(ht,Zt,Ne);Zr>Vt||Zr===Vt&&(!Je||Mr>=et)?(h.current.tb=!0,Et=Zt,L=-L,Bt.points=[lo(it,0),lo(Ge,0)]):h.current.tb=!1}var mi=_n(zt),Zi=it[1]===Ge[1];if(mi&&it[1]==="l"&&(vn>pt.right||h.current.rl)){var mr=ht;Zi?mr-=Se-he:mr=_e.x-mt.x-M;var gr=Ur(mr,Et),es=Ur(mr,Et,Ne);gr>Vt||gr===Vt&&(!Je||es>=et)?(h.current.rl=!0,ht=mr,M=-M,Bt.points=[lo(it,1),lo(Ge,1)]):h.current.rl=!1}if(mi&&it[1]==="r"&&(Gn<pt.left||h.current.lr)){var gi=ht;Zi?gi+=Se-he:gi=Ue.x-Me.x-M;var $s=Ur(gi,Et),_i=Ur(gi,Et,Ne);$s>Vt||$s===Vt&&(!Je||_i>=et)?(h.current.lr=!0,ht=gi,M=-M,Bt.points=[lo(it,1),lo(Ge,1)]):h.current.lr=!1}Js();var en=Xt===!0?0:Xt;typeof en=="number"&&(Gn<Ne.left&&(ht-=Gn-Ne.left-M,q.x+he<Ne.left+en&&(ht+=q.x-Ne.left+he-en)),vn>Ne.right&&(ht-=vn-Ne.right-M,q.x>Ne.right-en&&(ht+=q.x-Ne.right+en)));var vi=Gt===!0?0:Gt;typeof vi=="number"&&(Pn<Ne.top&&(Et-=Pn-Ne.top-L,q.y+G<Ne.top+vi&&(Et+=q.y-Ne.top+G-vi)),Wn>Ne.bottom&&(Et-=Wn-Ne.bottom-L,q.y>Ne.bottom-vi&&(Et+=q.y-Ne.bottom+vi)));var ei=de.x+ht,ti=ei+Se,ts=de.y+Et,Es=ts+fe,Pt=q.x,St=Pt+he,Bn=q.y,Tn=Bn+G,fn=Math.max(ei,Pt),Rn=Math.min(ti,St),tr=(fn+Rn)/2,vr=tr-ei,qr=Math.max(ts,Bn),bi=Math.min(Es,Tn),ni=(qr+bi)/2,ri=ni-ts;o==null||o(e,Bt);var lr=gt.right-de.x-(ht+de.width),Ys=gt.bottom-de.y-(Et+de.height);y===1&&(ht=Math.floor(ht),lr=Math.floor(lr)),K===1&&(Et=Math.floor(Et),Ys=Math.floor(Ys));var uc={ready:!0,offsetX:ht/y,offsetY:Et/K,offsetR:lr/y,offsetB:Ys/K,arrowX:vr/y,arrowY:ri/K,scaleX:y,scaleY:K,align:Bt};d(uc)}}),v=function(){u.current+=1;var C=u.current;Promise.resolve().then(function(){u.current===C&&g()})},b=function(){d(function(C){return ee(ee({},C),{},{ready:!1})})};return wn(b,[r]),wn(function(){t||b()},[t]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function gQ(t,e,n,r,i){wn(function(){if(t&&e&&n){let u=function(){r(),i()};var s=e,o=n,a=ab(s),l=ab(o),c=Su(o),d=new Set([c].concat(st(a),st(l)));return d.forEach(function(f){f.addEventListener("scroll",u,{passive:!0})}),c.addEventListener("resize",u,{passive:!0}),r(),function(){d.forEach(function(f){f.removeEventListener("scroll",u),c.removeEventListener("resize",u)})}}},[t,e,n])}function vQ(t,e,n,r,i,s,o,a){var l=m.useRef(t);l.current=t;var c=m.useRef(!1);m.useEffect(function(){if(e&&r&&(!i||s)){var u=function(){c.current=!1},f=function(v){var b;l.current&&!o(((b=v.composedPath)===null||b===void 0||(b=b.call(v))===null||b===void 0?void 0:b[0])||v.target)&&!c.current&&a(!1)},h=Su(r);h.addEventListener("pointerdown",u,!0),h.addEventListener("mousedown",f,!0),h.addEventListener("contextmenu",f,!0);var p=ep(n);return p&&(p.addEventListener("mousedown",f,!0),p.addEventListener("contextmenu",f,!0)),function(){h.removeEventListener("pointerdown",u,!0),h.removeEventListener("mousedown",f,!0),h.removeEventListener("contextmenu",f,!0),p&&(p.removeEventListener("mousedown",f,!0),p.removeEventListener("contextmenu",f,!0))}}},[e,n,r,i,s]);function d(){c.current=!0}return d}var bQ=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function yQ(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i2,e=m.forwardRef(function(n,r){var i=n.prefixCls,s=i===void 0?"rc-trigger-popup":i,o=n.children,a=n.action,l=a===void 0?"hover":a,c=n.showAction,d=n.hideAction,u=n.popupVisible,f=n.defaultPopupVisible,h=n.onPopupVisibleChange,p=n.afterPopupVisibleChange,g=n.mouseEnterDelay,v=n.mouseLeaveDelay,b=v===void 0?.1:v,w=n.focusDelay,C=n.blurDelay,x=n.mask,R=n.maskClosable,O=R===void 0?!0:R,T=n.getPopupContainer,S=n.forceRender,_=n.autoDestroy,A=n.destroyPopupOnHide,$=n.popup,E=n.popupClassName,I=n.popupStyle,D=n.popupPlacement,B=n.builtinPlacements,j=B===void 0?{}:B,z=n.popupAlign,q=n.zIndex,ne=n.stretch,Z=n.getPopupClassNameFromAlign,J=n.fresh,de=n.alignPoint,X=n.onPopupClick,V=n.onPopupAlign,te=n.arrow,ie=n.popupMotion,ce=n.maskMotion,ae=n.popupTransitionName,ve=n.popupAnimation,xe=n.maskTransitionName,ge=n.maskAnimation,le=n.className,fe=n.getTriggerDOMNode,Se=cn(n,bQ),G=_||A||!1,he=m.useState(!1),Ee=Re(he,2),Ie=Ee[0],ke=Ee[1];wn(function(){ke(fT())},[]);var De=m.useRef({}),He=m.useContext(e4),Je=m.useMemo(function(){return{registerSubPopup:function($t,bn){De.current[$t]=bn,He==null||He.registerSubPopup($t,bn)}}},[He]),ze=s2(),Ne=m.useState(null),tt=Re(Ne,2),pt=tt[0],gt=tt[1],y=m.useRef(null),K=nr(function(ot){y.current=ot,Td(ot)&&pt!==ot&&gt(ot),He==null||He.registerSubPopup(ze,ot)}),W=m.useState(null),re=Re(W,2),se=re[0],pe=re[1],M=m.useRef(null),L=nr(function(ot){Td(ot)&&se!==ot&&(pe(ot),M.current=ot)}),ye=m.Children.only(o),ue=(ye==null?void 0:ye.props)||{},be={},we=nr(function(ot){var $t,bn,Hn=se;return(Hn==null?void 0:Hn.contains(ot))||(($t=ep(Hn))===null||$t===void 0?void 0:$t.host)===ot||ot===Hn||(pt==null?void 0:pt.contains(ot))||((bn=ep(pt))===null||bn===void 0?void 0:bn.host)===ot||ot===pt||Object.values(De.current).some(function(Sn){return(Sn==null?void 0:Sn.contains(ot))||ot===Sn})}),Ae=n4(s,ie,ve,ae),Pe=n4(s,ce,ge,xe),je=m.useState(f||!1),Xe=Re(je,2),Ge=Xe[0],it=Xe[1],nt=u??Ge,Ut=nr(function(ot){u===void 0&&it(ot)});wn(function(){it(u||!1)},[u]);var Bt=m.useRef(nt);Bt.current=nt;var ht=m.useRef([]);ht.current=[];var Et=nr(function(ot){var $t;Ut(ot),(($t=ht.current[ht.current.length-1])!==null&&$t!==void 0?$t:nt)!==ot&&(ht.current.push(ot),h==null||h(ot))}),Vt=m.useRef(),et=function(){clearTimeout(Vt.current)},_e=function($t){var bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;et(),bn===0?Et($t):Vt.current=setTimeout(function(){Et($t)},bn*1e3)};m.useEffect(function(){return et},[]);var Me=m.useState(!1),Ue=Re(Me,2),mt=Ue[0],$e=Ue[1];wn(function(ot){(!ot||nt)&&$e(!0)},[nt]);var zt=m.useState(null),Kt=Re(zt,2),Xt=Kt[0],Gt=Kt[1],_n=m.useState(null),Pn=Re(_n,2),Wn=Pn[0],Gn=Pn[1],vn=function($t){Gn([$t.clientX,$t.clientY])},On=mQ(nt,pt,de&&Wn!==null?Wn:se,D,j,z,V),Ye=Re(On,11),at=Ye[0],It=Ye[1],Ft=Ye[2],Zt=Ye[3],Zr=Ye[4],Mr=Ye[5],mi=Ye[6],Zi=Ye[7],mr=Ye[8],gr=Ye[9],es=Ye[10],gi=fQ(Ie,l,c,d),$s=Re(gi,2),_i=$s[0],en=$s[1],vi=_i.has("click"),ei=en.has("click")||en.has("contextMenu"),ti=nr(function(){mt||es()}),ts=function(){Bt.current&&de&&ei&&_e(!1)};gQ(nt,se,pt,ti,ts),wn(function(){ti()},[Wn,D]),wn(function(){nt&&!(j!=null&&j[D])&&ti()},[JSON.stringify(z)]);var Es=m.useMemo(function(){var ot=pQ(j,s,gr,de);return Le(ot,Z==null?void 0:Z(gr))},[gr,Z,j,s,de]);m.useImperativeHandle(r,function(){return{nativeElement:M.current,popupElement:y.current,forceAlign:ti}});var Pt=m.useState(0),St=Re(Pt,2),Bn=St[0],Tn=St[1],fn=m.useState(0),Rn=Re(fn,2),tr=Rn[0],vr=Rn[1],qr=function(){if(ne&&se){var $t=se.getBoundingClientRect();Tn($t.width),vr($t.height)}},bi=function(){qr(),ti()},ni=function($t){$e(!1),es(),p==null||p($t)},ri=function(){return new Promise(function($t){qr(),Gt(function(){return $t})})};wn(function(){Xt&&(es(),Xt(),Gt(null))},[Xt]);function lr(ot,$t,bn,Hn){be[ot]=function(Sn){var fc;Hn==null||Hn(Sn),_e($t,bn);for(var hc=arguments.length,$u=new Array(hc>1?hc-1:0),Ja=1;Ja<hc;Ja++)$u[Ja-1]=arguments[Ja];
545(fc=ue[ot])===null||fc===void 0||fc.call.apply(fc,[ue,Sn].concat($u))}}(vi||ei)&&(be.onClick=function(ot){var $t;Bt.current&&ei?_e(!1):!Bt.current&&vi&&(vn(ot),_e(!0));for(var bn=arguments.length,Hn=new Array(bn>1?bn-1:0),Sn=1;Sn<bn;Sn++)Hn[Sn-1]=arguments[Sn];($t=ue.onClick)===null||$t===void 0||$t.call.apply($t,[ue,ot].concat(Hn))});var Ys=vQ(nt,ei,se,pt,x,O,we,_e),uc=_i.has("hover"),Ur=en.has("hover"),Js,Zo;uc&&(lr("onMouseEnter",!0,g,function(ot){vn(ot)}),lr("onPointerEnter",!0,g,function(ot){vn(ot)}),Js=function($t){(nt||mt)&&pt!==null&&pt!==void 0&&pt.contains($t.target)&&_e(!0,g)},de&&(be.onMouseMove=function(ot){var $t;($t=ue.onMouseMove)===null||$t===void 0||$t.call(ue,ot)})),Ur&&(lr("onMouseLeave",!1,b),lr("onPointerLeave",!1,b),Zo=function(){_e(!1,b)}),_i.has("focus")&&lr("onFocus",!0,w),en.has("focus")&&lr("onBlur",!1,C),_i.has("contextMenu")&&(be.onContextMenu=function(ot){var $t;Bt.current&&en.has("contextMenu")?_e(!1):(vn(ot),_e(!0)),ot.preventDefault();for(var bn=arguments.length,Hn=new Array(bn>1?bn-1:0),Sn=1;Sn<bn;Sn++)Hn[Sn-1]=arguments[Sn];($t=ue.onContextMenu)===null||$t===void 0||$t.call.apply($t,[ue,ot].concat(Hn))}),le&&(be.className=Le(ue.className,le));var Pi=m.useRef(!1);Pi.current||(Pi.current=S||nt||mt);var ns=ee(ee({},ue),be),ea={},Ga=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Ga.forEach(function(ot){Se[ot]&&(ea[ot]=function(){for(var $t,bn=arguments.length,Hn=new Array(bn),Sn=0;Sn<bn;Sn++)Hn[Sn]=arguments[Sn];($t=ns[ot])===null||$t===void 0||$t.call.apply($t,[ns].concat(Hn)),Se[ot].apply(Se,Hn)})});var Ka=m.cloneElement(ye,ee(ee({},ns),ea)),Xa={x:Mr,y:mi},Ya=te?ee({},te!==!0?te:{}):null;return m.createElement(m.Fragment,null,m.createElement(Xo,{disabled:!nt,ref:L,onResize:bi},m.createElement(uQ,{getTriggerDOMNode:fe},Ka)),Pi.current&&m.createElement(e4.Provider,{value:Je},m.createElement(dQ,{portal:t,ref:K,prefixCls:s,popup:$,className:Le(E,Es),style:I,target:se,onMouseEnter:Js,onMouseLeave:Zo,onPointerEnter:Js,zIndex:q,open:nt,keepDom:mt,fresh:J,onClick:X,onPointerDownCapture:Ys,mask:x,motion:Ae,maskMotion:Pe,onVisibleChanged:ni,onPrepare:ri,forceRender:S,autoDestroy:G,getPopupContainer:T,align:gr,arrow:Ya,arrowPos:Xa,ready:at,offsetX:It,offsetY:Ft,offsetR:Zt,offsetB:Zr,onAlign:ti,stretch:ne,targetWidth:Bn/Zi,targetHeight:tr/mr})))});return e}const wQ=yQ(i2);var SQ=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],CQ=function(e){var n=e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"}}},xQ=function(e,n){var r=e.prefixCls;e.disabled;var i=e.visible,s=e.children,o=e.popupElement,a=e.animation,l=e.transitionName,c=e.dropdownStyle,d=e.dropdownClassName,u=e.direction,f=u===void 0?"ltr":u,h=e.placement,p=e.builtinPlacements,g=e.dropdownMatchSelectWidth,v=e.dropdownRender,b=e.dropdownAlign,w=e.getPopupContainer,C=e.empty,x=e.getTriggerDOMNode,R=e.onPopupVisibleChange,O=e.onPopupMouseEnter,T=cn(e,SQ),S="".concat(r,"-dropdown"),_=o;v&&(_=v(o));var A=m.useMemo(function(){return p||CQ(g)},[p,g]),$=a?"".concat(S,"-").concat(a):l,E=typeof g=="number",I=m.useMemo(function(){return E?null:g===!1?"minWidth":"width"},[g,E]),D=c;E&&(D=ee(ee({},D),{},{width:g}));var B=m.useRef(null);return m.useImperativeHandle(n,function(){return{getPopupElement:function(){var z;return(z=B.current)===null||z===void 0?void 0:z.popupElement}}}),m.createElement(wQ,yt({},T,{showAction:R?["click"]:[],hideAction:R?["click"]:[],popupPlacement:h||(f==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:A,prefixCls:S,popupTransitionName:$,popup:m.createElement("div",{onMouseEnter:O},_),ref:B,stretch:I,popupAlign:b,popupVisible:i,getPopupContainer:w,popupClassName:Le(d,Y({},"".concat(S,"-empty"),C)),popupStyle:D,getTriggerDOMNode:x,onPopupVisibleChange:R}),s)},$Q=m.forwardRef(xQ);function a4(t,e){var n=t.key,r;return"value"in t&&(r=t.value),n??(r!==void 0?r:"rc-index-key-".concat(e))}function lb(t){return typeof t<"u"&&!Number.isNaN(t)}function ST(t,e){var n=t||{},r=n.label,i=n.value,s=n.options,o=n.groupLabel,a=r||(e?"children":"label");return{label:a,value:i||"value",options:s||"options",groupLabel:o||a}}function EQ(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.fieldNames,r=e.childrenAsData,i=[],s=ST(n,!1),o=s.label,a=s.value,l=s.options,c=s.groupLabel;function d(u,f){Array.isArray(u)&&u.forEach(function(h){if(f||!(l in h)){var p=h[a];i.push({key:a4(h,i.length),groupOption:f,data:h,label:h[o],value:p})}else{var g=h[c];g===void 0&&r&&(g=h.label),i.push({key:a4(h,i.length),group:!0,data:h,label:g}),d(h[l],!0)}})}return d(t,!1),i}function cb(t){var e=ee({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return Jr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var TQ=function(e,n,r){if(!n||!n.length)return null;var i=!1,s=function a(l,c){var d=k8(c),u=d[0],f=d.slice(1);if(!u)return[l];var h=l.split(u);return i=i||h.length>1,h.reduce(function(p,g){return[].concat(st(p),st(a(g,f)))}
545,[]).filter(Boolean)},o=s(e,n);return i?typeof r<"u"?o.slice(0,r):o:null},a2=m.createContext(null);function RQ(t){var e=t.visible,n=t.values;if(!e)return null;var r=50;return m.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,r).map(function(i){var s=i.label,o=i.value;return["number","string"].includes(vt(s))?s:o}).join(", ")),n.length>r?", ...":null)}var IQ=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],AQ=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],db=function(e){return e==="tags"||e==="multiple"},OQ=m.forwardRef(function(t,e){var n,r=t.id,i=t.prefixCls,s=t.className,o=t.showSearch,a=t.tagRender,l=t.direction,c=t.omitDomProps,d=t.displayValues,u=t.onDisplayValuesChange,f
545=t.emptyOptions,h=t.notFoundContent,p=h===void 0?"Not Found":h,g=t.onClear,v=t.mode,b=t.disabled,w=t.loading,C=t.getInputElement,x=t.getRawInputElement,R=t.open,O=t.defaultOpen,T=t.onDropdownVisibleChange,S=t.activeValue,_=t.onActiveValueChange,A=t.activeDescendantId,$=t.searchValue,E=t.autoClearSearchValue,I=t.onSearch,D=t.onSearchSplit,B=t.tokenSeparators,j=t.allowClear,z=t.prefix,q=t.suffixIcon,ne=t.clearIcon,Z=t.OptionList,J=t.animation,de=t.transitionName,X=t.dropdownStyle,V=t.dropdownClassName,te=t.dropdownMatchSelectWidth,ie=t.dropdownRender,ce=t.dropdownAlign,ae=t.placement,ve=t.builtinPlacements,xe=t.getPopupContainer,ge=t.showAction,le=ge===void 0?[]:ge,fe=t.onFocus,Se=t.onBlur,G=t.onKeyUp,he=t.onKeyDown,Ee=t.onMouseDown,Ie=cn(t,IQ),ke=db(v),De=(o!==void 0?o:ke)||v==="combobox",He=ee({},Ie);AQ.forEach(function(Pt){delete He[Pt]}),c==null||c.forEach(function(Pt){delete He[Pt]});var Je=m.useState(!1),ze=Re(Je,2),Ne=ze[0],tt=ze[1];m.useEffect(function(){tt(fT())},[]);var pt=m.useRef(null),gt=m.useRef(null),y=m.useRef(null),K=m.useRef(null),W=m.useRef(null),re=m.useRef(!1),se=PJ(),pe=Re(se,3),M=pe[0],L=pe[1],ye=pe[2];m.useImperativeHandle(e,function(){var Pt,St;return{focus:(Pt=K.current)===null||Pt===void 0?void 0:Pt.focus,blur:(St=K.current)===null||St===void 0?void 0:St.blur,scrollTo:function(Tn){var fn;return(fn=W.current)===null||fn===void 0?void 0:fn.scrollTo(Tn)},nativeElement:pt.current||gt.current}});var ue=m.useMemo(function(){var Pt;if(v!=="combobox")return $;var St=(Pt=d[0])===null||Pt===void 0?void 0:Pt.value;return typeof St=="string"||typeof St=="number"?String(St):""},[$,v,d]),be=v==="combobox"&&typeof C=="function"&&C()||null,we=typeof x=="function"&&x(),Ae=sc(gt,we==null||(n=we.props)===null||n===void 0?void 0:n.ref),Pe=m.useState(!1),je=Re(Pe,2),Xe=je[0],Ge=je[1];wn(function(){Ge(!0)},[]);var it=Ho(!1,{defaultValue:O,value:R}),nt=Re(it,2),Ut=nt[0],Bt=nt[1],ht=Xe?Ut:!1,Et=!p&&f;(b||Et&&ht&&v==="combobox")&&(ht=!1);var Vt=Et?!1:ht,et=m.useCallback(function(Pt){var St=Pt!==void 0?Pt:!ht;b||(Bt(St),ht!==St&&(T==null||T(St)))},[b,ht,Bt,T]),_e=m.useMemo(function(){return(B||[]).some(function(Pt){return[`
546`,`\r
547`].includes(Pt)})},[B]),Me=m.useContext(a2)||{},Ue=Me.maxCount,mt=Me.rawValues,$e=function(St,Bn,Tn){if(!(ke&&lb(Ue)&&(mt==null?void 0:mt.size)>=Ue)){var fn=!0,Rn=St;_==null||_(null);var tr=TQ(St,B,lb(Ue)?Ue-mt.size:void 0),vr=Tn?null:tr;return v!=="combobox"&&vr&&(Rn="",D==null||D(vr),et(!1),fn=!1),I&&ue!==Rn&&I(Rn,{source:Bn?"typing":"effect"}),fn}},zt=function(St){!St||!St.trim()||I(St,{source:"submit"})};m.useEffect(function(){!ht&&!ke&&v!=="combobox"&&$e("",!1,!1)},[ht]),m.useEffect(function(){Ut&&b&&Bt(!1),b&&!re.current&&L(!1)},[b]);var Kt=pT(),Xt=Re(Kt,2),Gt=Xt[0],_n=Xt[1],Pn=m.useRef(!1),Wn=function(St){var Bn=Gt(),Tn=St.key,fn=Tn==="Enter";if(fn&&(v!=="combobox"&&St.preventDefault(),ht||et(!0)),_n(!!ue),Tn==="Backspace"&&!Bn&&ke&&!ue&&d.length){for(var Rn=st(d),tr=null,vr=Rn.length-1;vr>=0;vr-=1){var qr=Rn[vr];if(!qr.disabled){Rn.splice(vr,1),tr=qr;break}}tr&&u(Rn,{type:"remove",values:[tr]})}for(var bi=arguments.length,ni=new Array(bi>1?bi-1:0),ri=1;ri<bi;ri++)ni[ri-1]=arguments[ri];if(ht&&(!fn||!Pn.current)){var lr;fn&&(Pn.current=!0),(lr=W.current)===null||lr===void 0||lr.onKeyDown.apply(lr,[St].concat(ni))}he==null||he.apply(void 0,[St].concat(ni))},Gn=function(St){for(var Bn=arguments.length,Tn=new Array(Bn>1?Bn-1:0),fn=1;fn<Bn;fn++)Tn[fn-1]=arguments[fn];if(ht){var Rn;(Rn=W.current)===null||Rn===void 0||Rn.onKeyUp.apply(Rn,[St].concat(Tn))}St.key==="Enter"&&(Pn.current=!1),G==null||G.apply(void 0,[St].concat(Tn))},vn=function(St){var Bn=d.filter(function(Tn){return Tn!==St});u(Bn,{type:"remove",values:[St]})},On=function(){Pn.current=!1},Ye=m.useRef(!1),at=function(){L(!0),b||(fe&&!Ye.current&&fe.apply(void 0,arguments),le.includes("focus")&&et(!0)),Ye.current=!0},It=function(){re.current=!0,L(!1,function(){Ye.current=!1,re.current=!1,et(!1)}),!b&&(ue&&(v==="tags"?I(ue,{source:"submit"}):v==="multiple"&&I("",{source:"blur"})),Se&&Se.apply(void 0,arguments))},Ft=[];m.useEffect(function(){return function(){Ft.forEach(function(Pt){return clearTimeout(Pt)}),Ft.splice(0,Ft.length)}},[]);var Zt=function(St){var Bn,Tn=St.target,fn=(Bn=y.current)===null||Bn===void 0?void 0:Bn.getPopupElement();if(fn&&fn.contains(Tn)){var Rn=setTimeout(function(){var bi=Ft.indexOf(Rn);if(bi!==-1&&Ft.splice(bi,1),ye(),!Ne&&!fn.contains(document.activeElement)){var ni;(ni=K.current)===null||ni===void 0||ni.focus()}});Ft.push(Rn)}for(var tr=arguments.length,vr=new Array(tr>1?tr-1:0),qr=1;qr<tr;qr++)vr[qr-1]=arguments[qr];Ee==null||Ee.apply(void 0,[St].concat(vr))},Zr=m.useState({}),Mr=Re(Zr,2),mi=Mr[1];function Zi(){mi({})}var mr;we&&(mr=function(St){et(St)}),MJ(function(){var Pt;return[pt.current,(Pt=y.current)===null||Pt===void 0?void 0:Pt.getPopupElement()]},Vt,et,!!we);var gr=m.useMemo(function(){return ee(ee({},t),{},{notFoundContent:p,open:ht,triggerOpen:Vt,id:r,showSearch:De,multiple:ke,toggleOpen:et})},[t,p,Vt,ht,r,De,ke,et]),es=!!q||w,gi;es&&(gi=m.createElement(f0,{className:Le("".concat(i,"-arrow"),Y({},"".concat(i,"-arrow-loading"),w)),customizeIcon:q,customizeIconProps:{loading:w,searchValue:ue,open:ht,focused:M,showSearch:De}}));var $s=function(){var St;g==null||g(),(St=K.current)===null||St===void 0||St.focus(),u([],{type:"clear",values:d}),$e("",!1,!1)},_i=NJ(i,$s,d,j,ne,b,ue,v),en=_i.allowClear,vi=_i.clearIcon,ei=m.createElement(Z,{ref:W}),ti=Le(i,s,Y(Y(Y(Y(Y(Y(Y(Y(Y(Y({},"".concat(i,"-focused"),M),"".concat(i,"-multiple"),ke),"".concat(i,"-single"),!ke),"".concat(i,"-allow-clear"),j),"".concat(i,"-show-arrow"),es),"".concat(i,"-disabled"),b),"".concat(i,"-loading"),w),"".concat(i,"-open"),ht),"".concat(i,"-customize-input"),be),"".concat(i,"-show-search"),De)),ts=m.createElement($Q,{ref:y,disabled:b,prefixCls:i,visible:Vt,popupElement:ei,animation:J,transitionName:de,dropdownStyle:X,dropdownClassName:V,direction:l,dropdownMatchSelectWidth:te,dropdownRender:ie,dropdownAlign:ce,placement:ae,builtinPlacements:ve,getPopupContainer:xe,empty:f,getTriggerDOMNode:function(St){return gt.current||St},onPopupVisibleChange:mr,onPopupMouseEnter:Zi},we?m.cloneElement(we,{ref:Ae}):m.createElement(oQ,yt({}
547,t,{domRef:gt,prefixCls:i,inputElement:be,ref:K,id:r,prefix:z,showSearch:De,autoClearSearchValue:E,mode:v,activeDescendantId:A,tagRender:a,values:d,open:ht,onToggleOpen:et,activeValue:S,searchValue:ue,onSearch:$e,onSearchSubmit:zt,onRemove:vn,tokenWithEnter:_e,onInputBlur:On}))),Es;return we?Es=ts:Es=m.createElement("div",yt({className:ti},He,{ref:pt,onMouseDown:Zt,onKeyDown:Wn,onKeyUp:Gn,onFocus:at,onBlur:It}),m.createElement(RQ,{visible:M&&!ht,values:d}),ts,gi,en&&vi),m.createElement(hT.Provider,{value:gr},Es)}),l2=function(){return null};l2.isSelectOptGroup=!0;var c2=function(){return null};c2.isSelectOption=!0;var CT=m.forwardRef(function(t,e){var n=t.height,r=t.offsetY,i=t.offsetX,s=t.children,o=t.prefixCls,a=t.onInnerResize,l=t.innerProps,c=t.rtl,d=t.extra,u={},f={display:"flex",flexDirection:"column"};return r!==void 0&&(u={height:n,position:"relative",overflow:"hidden"},f=ee(ee({},f),{},Y(Y(Y(Y(Y({transform:"translateY(".concat(r,"px)")},c?"marginRight":"marginLeft",-i),"position","absolute"),"left",0),"right",0),"top",0))),m.createElement("div",{style:u},m.createElement(Xo,{onResize:function(p){var g=p.offsetHeight;g&&a&&a()}},m.createElement("div",yt({style:f,className:Le(Y({},"".concat(o,"-holder-inner"),o)),ref:e},l),s,d)))});CT.displayName="Filler";function kQ(t){var e=t.children,n=t.setRef,r=m.useCallback(function(i){n(i)},[]);return m.cloneElement(e,{ref:r})}function NQ(t,e,n,r,i,s,o,a){var l=a.getKey;return t.slice(e,n+1).map(function(c,d){var u=e+d,f=o(c,u,{style:{width:r},offsetX:i}),h=l(c);return m.createElement(kQ,{key:h,setRef:function(g){return s(c,g)}},f)})}function _Q(t,e,n){var r=t.length,i=e.length,s,o;if(r===0&&i===0)return null;r<i?(s=t,o=e):(s=e,o=t);var a={__EMPTY_ITEM__:!0};function l(p){return p!==void 0?n(p):a}for(var c=null,d=Math.abs(r-i)!==1,u=0;u<o.length;u+=1){var f=l(s[u]),h=l(o[u]);if(f!==h){c=u,d=d||f!==l(o[u+1]);break}}return c===null?null:{index:c,multiple:d}}function PQ(t,e,n){var r=m.useState(t),i=Re(r,2),s=i[0],o=i[1],a=m.useState(null),l=Re(a,2),c=l[0],d=l[1];return m.useEffect(function(){var u=_Q(s||[],t||[],e);(u==null?void 0:u.index)!==void 0&&d(t[u.index]),o(t)},[t]),[c]}var l4=(typeof navigator>"u"?"undefined":vt(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const xT=(function(t,e,n,r){var i=m.useRef(!1),s=m.useRef(null);function o(){clearTimeout(s.current),i.current=!0,s.current=setTimeout(function(){i.current=!1},50)}var a=m.useRef({top:t,bottom:e,left:n,right:r});return a.current.top=t,a.current.bottom=e,a.current.left=n,a.current.right=r,function(l,c){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,u=l?c<0&&a.current.left||c>0&&a.current.right:c<0&&a.current.top||c>0&&a.current.bottom;return d&&u?(clearTimeout(s.current),i.current=!1):(!u||i.current)&&o(),!i.current&&u}});function MQ(t,e,n,r,i,s,o){var a=m.useRef(0),l=m.useRef(null),c=m.useRef(null),d=m.useRef(!1),u=xT(e,n,r,i);function f(w,C){if(Un.cancel(l.current),!u(!1,C)){var x=w;if(!x._virtualHandled)x._virtualHandled=!0;else return;a.current+=C,c.current=C,l4||x.preventDefault(),l.current=Un(function(){var R=d.current?10:1;o(a.current*R,!1),a.current=0})}}function h(w,C){o(C,!0),l4||w.preventDefault()}var p=m.useRef(null),g=m.useRef(null);function v(w){if(t){Un.cancel(g.current),g.current=Un(function(){p.current=null},2);var C=w.deltaX,x=w.deltaY,R=w.shiftKey,O=C,T=x;(p.current==="sx"||!p.current&&R&&x&&!C)&&(O=x,T=0,p.current="sx");var S=Math.abs(O),_=Math.abs(T);p.current===null&&(p.current=s&&S>_?"x":"y"),p.current==="y"?f(w,T):h(w,O)}}function b(w){t&&(d.current=w.detail===c.current)}return[v,b]}function DQ(t,e,n,r){var i=m.useMemo(function(){return[new Map,[]]},[t,n.id,r]),s=Re(i,2),o=s[0],a=s[1],l=function(d){var u=arguments.length>
5471&&arguments[1]!==void 0?arguments[1]:d,f=o.get(d),h=o.get(u);if(f===void 0||h===void 0)for(var p=t.length,g=a.length;g<p;g+=1){var v,b=t[g],w=e(b);o.set(w,g);var C=(v=n.get(w))!==null&&v!==void 0?v:r;if(a[g]=(a[g-1]||0)+C,w===d&&(f=g),w===u&&(h=g),f!==void 0&&h!==void 0)break}return{top:a[f-1]||0,bottom:a[h]}};return l}var LQ=(function(){function t(){or(this,t),Y(this,"maps",void 0),Y(this,"id",0),Y(this,"diffRecords",new Map),this.maps=Object.create(null)}return ar(t,[{key:"set",value:function(n,r){this.diffRecords.set(n,this.maps[n]),this.maps[n]=r,this.id+=1}},{key:"get",value:function(n){return this.maps[n]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),t})();function c4(t){var e=parseFloat(t);return isNaN(e)?0:e}function jQ(t,e,n){var r=m.useState(0),i=Re(r,2),s=i[0],o=i[1],a=m.useRef(new Map),l=m.useRef(new LQ),c=m.useRef(0);function d(){c.current+=1}function u(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;d();var p=function(){var b=!1;a.current.forEach(function(w,C){if(w&&w.offsetParent){var x=w.offsetHeight,R=getComputedStyle(w),O=R.marginTop,T=R.marginBottom,S=c4(O),_=c4(T),A=x+S+_;l.current.get(C)!==A&&(l.current.set(C,A),b=!0)}}),b&&o(function(w){return w+1})};if(h)p();else{c.current+=1;var g=c.current;Promise.resolve().then(function(){g===c.current&&p()})}}function f(h,p){var g=t(h);a.current.get(g),p?(a.current.set(g,p),u()):a.current.delete(g)}return m.useEffect(function(){return d},[]),[f,u,l.current,s]}var d4=14/15;function FQ(t,e,n){var r=m.useRef(!1),i=m.useRef(0),s=m.useRef(0),o=m.useRef(null),a=m.useRef(null),l,c=function(h){if(r.current){var p=Math.ceil(h.touches[0].pageX),g=Math.ceil(h.touches[0].pageY),v=i.current-p,b=s.current-g,w=Math.abs(v)>Math.abs(b);w?i.current=p:s.current=g;var C=n(w,w?v:b,!1,h);C&&h.preventDefault(),clearInterval(a.current),C&&(a.current=setInterval(function(){w?v*=d4:b*=d4;var x=Math.floor(w?v:b);(!n(w,x,!0)||Math.abs(x)<=.1)&&clearInterval(a.current)},16))}},d=function(){r.current=!1,l()},u=function(h){l(),h.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(h.touches[0].pageX),s.current=Math.ceil(h.touches[0].pageY),o.current=h.target,o.current.addEventListener("touchmove",c,{passive:!1}),o.current.addEventListener("touchend",d,{passive:!0}))};l=function(){o.current&&(o.current.removeEventListener("touchmove",c),o.current.removeEventListener("touchend",d))},wn(function(){return t&&e.current.addEventListener("touchstart",u,{passive:!0}),function(){var f;(f=e.current)===null||f===void 0||f.removeEventListener("touchstart",u),l(),clearInterval(a.current)}},[t])}function u4(t){return Math.floor(Math.pow(t,.5))}function ub(t,e){var n="touches"in t?t.touches[0]:t;return n[e?"pageX":"pageY"]-window[e?"scrollX":"scrollY"]}function BQ(t,e,n){m.useEffect(function(){var r=e.current;if(t&&r){var i=!1,s,o,a=function(){Un.cancel(s)},l=function f(){a(),s=Un(function(){n(o),f()})},c=function(){i=!1,a()},d=function(h){if(!(h.target.draggable||h.button!==0)){var p=h;p._virtualHandled||(p._virtualHandled=!0,i=!0)}},u=function(h){if(i){var p=ub(h,!1),g=r.getBoundingClientRect(),v=g.top,b=g.bottom;if(p<=v){var w=v-p;o=-u4(w),l()}else if(p>=b){var C=p-b;o=u4(C),l()}else a()}};return r.addEventListener("mousedown",d),r.ownerDocument.addEventListener("mouseup",c),r.ownerDocument.addEventListener("mousemove",u),r.ownerDocument.addEventListener("dragend",c),function(){r.removeEventListener("mousedown",d),r.ownerDocument.removeEventListener("mouseup",c),r.ownerDocument.removeEventListener("mousemove",u),r.ownerDocument.removeEventListener("dragend",c),a()}}},[t])}var HQ=10;function zQ(t,e,n,r,i,s,o,a){var l=m.useRef(),c=m.useState(null),d=Re(c,2),u=d[0],f=d[1];return wn(function(){if(u&&u.times<HQ){if(!t.current){f(function(ne){return ee({},ne)});return}s();var h=u.targetAlign,p=u.originAlign,g=u.index,v=u.offset,b=t.current.clientHeight,w=!1,C=h,x=null;if(b){for(var R=h||p,O=0,T=0,S=0,_=Math.min(e.length-1,g),A=0;A<=_;A+=1){var $=i(e[A]);T=O;var E=n.get($);S=T+(E===void 0?r:E),O=S}for(var I=R==="top"?v:b-v,D=_;D>=0;D-=1){var B=i(e[D]),j=n.get(B);if(j===void 0){w=!0;break}if(I-=j,I<=0)break}switch(R){case"top":x=T-v;break;case"bottom":x=S-b+v;break;default:{var z=t.current.scrollTop,q=z+b;T<z?C="top":S>q&&(C="bottom")}}x!==null&&o(x),x!==u.lastTop&&(w=!0)}w&&f(ee(ee({},u),{},{times:u.times+1,targetAlign:C,lastTop:x}))}},[u,t.current]),function(h){if(h==null){a();return}
547if(Un.cancel(l.current),typeof h=="number")o(h);else if(h&&vt(h)==="object"){var p,g=h.align;"index"in h?p=h.index:p=e.findIndex(function(w){return i(w)===h.key});var v=h.offset,b=v===void 0?0:v;f({times:0,index:p,offset:b,originAlign:g})}}}var f4=m.forwardRef(function(t,e){var n=t.prefixCls,r=t.rtl,i=t.scrollOffset,s=t.scrollRange,o=t.onStartMove,a=t.onStopMove,l=t.onScroll,c=t.horizontal,d=t.spinSize,u=t.containerSize,f=t.style,h=t.thumbStyle,p=t.showScrollBar,g=m.useState(!1),v=Re(g,2),b=v[0],w=v[1],C=m.useState(null),x=Re(C,2),R=x[0],O=x[1],T=m.useState(null),S=Re(T,2),_=S[0],A=S[1],$=!r,E=m.useRef(),I=m.useRef(),D=m.useState(p),B=Re(D,2),j=B[0],z=B[1],q=m.useRef(),ne=function(){p===!0||p===!1||(clearTimeout(q.current),z(!0),q.current=setTimeout(function(){z(!1)},3e3))},Z=s-u||0,J=u-d||0,de=m.useMemo(function(){if(i===0||Z===0)return 0;var ge=i/Z;return ge*J},[i,Z,J]),X=function(le){le.stopPropagation(),le.preventDefault()},V=m.useRef({top:de,dragging:b,pageY:R,startTop:_});V.current={top:de,dragging:b,pageY:R,startTop:_};var te=function(le){w(!0),O(ub(le,c)),A(V.current.top),o(),le.stopPropagation(),le.preventDefault()};m.useEffect(function(){var ge=function(G){G.preventDefault()},le=E.current,fe=I.current;return le.addEventListener("touchstart",ge,{passive:!1}),fe.addEventListener("touchstart",te,{passive:!1}),function(){le.removeEventListener("touchstart",ge),fe.removeEventListener("touchstart",te)}},[]);var ie=m.useRef();ie.current=Z;var ce=m.useRef();ce.current=J,m.useEffect(function(){if(b){var ge,le=function(G){var he=V.current,Ee=he.dragging,Ie=he.pageY,ke=he.startTop;Un.cancel(ge);var De=E.current.getBoundingClientRect(),He=u/(c?De.width:De.height);if(Ee){var Je=(ub(G,c)-Ie)*He,ze=ke;!$&&c?ze-=Je:ze+=Je;var Ne=ie.current,tt=ce.current,pt=tt?ze/tt:0,gt=Math.ceil(pt*Ne);gt=Math.max(gt,0),gt=Math.min(gt,Ne),ge=Un(function(){l(gt,c)})}},fe=function(){w(!1),a()};return window.addEventListener("mousemove",le,{passive:!0}),window.addEventListener("touchmove",le,{passive:!0}),window.addEventListener("mouseup",fe,{passive:!0}),window.addEventListener("touchend",fe,{passive:!0}),function(){window.removeEventListener("mousemove",le),window.removeEventListener("touchmove",le),window.removeEventListener("mouseup",fe),window.removeEventListener("touchend",fe),Un.cancel(ge)}}},[b]),m.useEffect(function(){return ne(),function(){clearTimeout(q.current)}},[i]),m.useImperativeHandle(e,function(){return{delayHidden:ne}});var ae="".concat(n,"-scrollbar"),ve={position:"absolute",visibility:j?null:"hidden"},xe={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return c?(Object.assign(ve,{height:8,left:0,right:0,bottom:0}),Object.assign(xe,Y({height:"100%",width:d},$?"left":"right",de))):(Object.assign(ve,Y({width:8,top:0,bottom:0},$?"right":"left",0)),Object.assign(xe,{width:"100%",height:d,top:de})),m.createElement("div",{ref:E,className:Le(ae,Y(Y(Y({},"".concat(ae,"-horizontal"),c),"".concat(ae,"-vertical"),!c),"".concat(ae,"-visible"),j)),style:ee(ee({},ve),f),onMouseDown:X,onMouseMove:ne},m.createElement("div",{ref:I,className:Le("".concat(ae,"-thumb"),Y({},"".concat(ae,"-thumb-moving"),b)),style:ee(ee({},xe),h),onMouseDown:te}))}),qQ=20;function h4(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t/e*t;return isNaN(n)&&(n=0),n=Math.max(n,qQ),Math.floor(n)}var UQ=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],VQ=[],WQ={overflowY:"auto",overflowAnchor:"none"};function GQ(t,e){var n=t.prefixCls,r=n===void 0?"rc-virtual-list":n,i=t.className,s=t.height,o=t.itemHeight,a=t.fullHeight,l=a===void 0?!0:a,c=t.style,d=t.data,u=t.children,f=t.itemKey,h=t.virtual,p=t.direction,g=t.scrollWidth,v=t.component,b=v===void 0?"div":v,w=t.onScroll,C=t.onVirtualScroll,x=t.onVisibleChange,R=t.innerProps,O=t.extraRender,T=t.styles,S=t.showScrollBar,_=S===void 0?"o
547ptional":S,A=cn(t,UQ),$=m.useCallback(function(Ye){return typeof f=="function"?f(Ye):Ye==null?void 0:Ye[f]},[f]),E=jQ($),I=Re(E,4),D=I[0],B=I[1],j=I[2],z=I[3],q=!!(h!==!1&&s&&o),ne=m.useMemo(function(){return Object.values(j.maps).reduce(function(Ye,at){return Ye+at},0)},[j.id,j.maps]),Z=q&&d&&(Math.max(o*d.length,ne)>s||!!g),J=p==="rtl",de=Le(r,Y({},"".concat(r,"-rtl"),J),i),X=d||VQ,V=m.useRef(),te=m.useRef(),ie=m.useRef(),ce=m.useState(0),ae=Re(ce,2),ve=ae[0],xe=ae[1],ge=m.useState(0),le=Re(ge,2),fe=le[0],Se=le[1],G=m.useState(!1),he=Re(G,2),Ee=he[0],Ie=he[1],ke=function(){Ie(!0)},De=function(){Ie(!1)},He={getKey:$};function Je(Ye){xe(function(at){var It;typeof Ye=="function"?It=Ye(at):It=Ye;var Ft=Ge(It);return V.current.scrollTop=Ft,Ft})}var ze=m.useRef({start:0,end:X.length}),Ne=m.useRef(),tt=PQ(X,$),pt=Re(tt,1),gt=pt[0];Ne.current=gt;var y=m.useMemo(function(){if(!q)return{scrollHeight:void 0,start:0,end:X.length-1,offset:void 0};if(!Z){var Ye;return{scrollHeight:((Ye=te.current)===null||Ye===void 0?void 0:Ye.offsetHeight)||0,start:0,end:X.length-1,offset:void 0}}for(var at=0,It,Ft,Zt,Zr=X.length,Mr=0;Mr<Zr;Mr+=1){var mi=X[Mr],Zi=$(mi),mr=j.get(Zi),gr=at+(mr===void 0?o:mr);gr>=ve&&It===void 0&&(It=Mr,Ft=at),gr>ve+s&&Zt===void 0&&(Zt=Mr),at=gr}return It===void 0&&(It=0,Ft=0,Zt=Math.ceil(s/o)),Zt===void 0&&(Zt=X.length-1),Zt=Math.min(Zt+1,X.length-1),{scrollHeight:at,start:It,end:Zt,offset:Ft}},[Z,q,ve,X,z,s]),K=y.scrollHeight,W=y.start,re=y.end,se=y.offset;ze.current.start=W,ze.current.end=re,m.useLayoutEffect(function(){var Ye=j.getRecord();if(Ye.size===1){var at=Array.from(Ye.keys())[0],It=Ye.get(at),Ft=X[W];if(Ft&&It===void 0){var Zt=$(Ft);if(Zt===at){var Zr=j.get(at),Mr=Zr-o;Je(function(mi){return mi+Mr})}}}j.resetRecord()},[K]);var pe=m.useState({width:0,height:s}),M=Re(pe,2),L=M[0],ye=M[1],ue=function(at){ye({width:at.offsetWidth,height:at.offsetHeight})},be=m.useRef(),we=m.useRef(),Ae=m.useMemo(function(){return h4(L.width,g)},[L.width,g]),Pe=m.useMemo(function(){return h4(L.height,K)},[L.height,K]),je=K-s,Xe=m.useRef(je);Xe.current=je;function Ge(Ye){var at=Ye;return Number.isNaN(Xe.current)||(at=Math.min(at,Xe.current)),at=Math.max(at,0),at}var it=ve<=0,nt=ve>=je,Ut=fe<=0,Bt=fe>=g,ht=xT(it,nt,Ut,Bt),Et=function(){return{x:J?-fe:fe,y:ve}},Vt=m.useRef(Et()),et=nr(function(Ye){if(C){var at=ee(ee({},Et()),Ye);(Vt.current.x!==at.x||Vt.current.y!==at.y)&&(C(at),Vt.current=at)}});function _e(Ye,at){var It=Ye;at?(Vf.flushSync(function(){Se(It)}),et()):Je(It)}function Me(Ye){var at=Ye.currentTarget.scrollTop;at!==ve&&Je(at),w==null||w(Ye),et()}var Ue=function(at){var It=at,Ft=g?g-L.width:0;return It=Math.max(It,0),It=Math.min(It,Ft),It},mt=nr(function(Ye,at){at?(Vf.flushSync(function(){Se(function(It){var Ft=It+(J?-Ye:Ye);return Ue(Ft)})}),et()):Je(function(It){var Ft=It+Ye;return Ft})}),$e=MQ(q,it,nt,Ut,Bt,!!g,mt),zt=Re($e,2),Kt=zt[0],Xt=zt[1];FQ(q,V,function(Ye,at,It,Ft){var Zt=Ft;return ht(Ye,at,It)?!1:!Zt||!Zt._virtualHandled?(Zt&&(Zt._virtualHandled=!0),Kt({preventDefault:function(){},deltaX:Ye?at:0,deltaY:Ye?0:at}),!0):!1}),BQ(Z,V,function(Ye){Je(function(at){return at+Ye})}),wn(function(){function Ye(It){var Ft=it&&It.detail<0,Zt=nt&&It.detail>0;q&&!Ft&&!Zt&&It.preventDefault()}var at=V.current;return at.addEventListener("wheel",Kt,{passive:!1}),at.addEventListener("DOMMouseScroll",Xt,{passive:!0}),at.addEventListener("MozMousePixelScroll",Ye,{passive:!1}),function(){at.removeEventListener("wheel",Kt),at.removeEventListener("DOMMouseScroll",Xt),at.removeEventListener("MozMousePixelScroll",Ye)}},[q,it,nt]),wn(function(){if(g){var Ye=Ue(fe);Se(Ye),et({x:Ye})}},[L.width,g]);var Gt=function(){var at,It;(at=be.current)===null||at===void 0||at.delayHidden(),(It=we.current)===null||It===void 0||It.delayHidden()},_n=zQ(V,X,j,o,$,function(){return B(!0)},Je,Gt);m.useImperativeHandle(e,function(){return{nativeElement:ie.current,getScrollInfo:Et,scrollTo:function(at){function It(Ft){return Ft&&vt(Ft)==="object"&&("left"in Ft||"top"in Ft)}It(at)?(at.left!==void 0&&Se(Ue(at.left)),_n(at.top)):_n(at)}}}),wn(function(){if(x){var Ye=X.slice(W,re+1);x(Ye,X)}},[W,re,X]);var Pn=DQ(X,$,j,o),Wn=O==null?void 0:O({start:W,end:re,virtual:Z,offsetX:fe,offsetY:se,rtl:J,getSize:Pn}),Gn=NQ(X,W,re,g,fe,D,u,He),vn=null;s&&(vn=ee(Y({},l?"height":"maxHeight",s),WQ),q&&(vn.overflowY="hidden",g&&(vn.overflowX="hidden"),Ee&&(vn.pointerEvents="none")));var On={};return J&&(On.dir="rtl"),m.createElement("div",yt({ref:ie,style:ee(ee({},c),{},{position:"relative"}),className:de},On,A),m.createElement(Xo,{onResize:ue},m.createElement(b,{className:"".concat(r,"-holder"),style:vn,ref:V,onScroll:Me,onMouseEnter:Gt},m.createElement(CT,{prefixCls:r,height:K,offsetX:fe,offsetY:se,scrollWidth:g,onInnerResize:B,ref:te,innerProps:R,rtl:J,extra:Wn},Gn))),Z&&K>s&&m.createElement(f4,{ref:be,prefixCls:r,scrollOffset:ve,scrollRange:K,rtl:J,onScroll:_e,onStartMove:ke,onStopMove:De,spinSize:Pe,containerSize:L.height,style:T==null?void 0:T.verticalScrollBar,thumbStyle:T==null?void 0:T.verticalScrollBarThumb,showScrollBar:_}),Z&&g>L.width&&m.createElement(f4,{ref:we,prefixCls:r,scrollOffset:fe,
547scrollRange:g,rtl:J,onScroll:_e,onStartMove:ke,onStopMove:De,spinSize:Ae,containerSize:L.width,horizontal:!0,style:T==null?void 0:T.horizontalScrollBar,thumbStyle:T==null?void 0:T.horizontalScrollBarThumb,showScrollBar:_}))}var $T=m.forwardRef(GQ);$T.displayName="List";function KQ(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var XQ=["disabled","title","children","style","className"];function p4(t){return typeof t=="string"||typeof t=="number"}var YQ=function(e,n){var r=_J(),i=r.prefixCls,s=r.id,o=r.open,a=r.multiple,l=r.mode,c=r.searchValue,d=r.toggleOpen,u=r.notFoundContent,f=r.onPopupScroll,h=m.useContext(a2),p=h.maxCount,g=h.flattenOptions,v=h.onActiveValue,b=h.defaultActiveFirstOption,w=h.onSelect,C=h.menuItemSelectedIcon,x=h.rawValues,R=h.fieldNames,O=h.virtual,T=h.direction,S=h.listHeight,_=h.listItemHeight,A=h.optionRender,$="".concat(i,"-item"),E=Vp(function(){return g},[o,g],function(ge,le){return le[0]&&ge[1]!==le[1]}),I=m.useRef(null),D=m.useMemo(function(){return a&&lb(p)&&(x==null?void 0:x.size)>=p},[a,p,x==null?void 0:x.size]),B=function(le){le.preventDefault()},j=function(le){var fe;(fe=I.current)===null||fe===void 0||fe.scrollTo(typeof le=="number"?{index:le}:le)},z=m.useCallback(function(ge){return l==="combobox"?!1:x.has(ge)},[l,st(x).toString(),x.size]),q=function(le){for(var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Se=E.length,G=0;G<Se;G+=1){var he=(le+G*fe+Se)%Se,Ee=E[he]||{},Ie=Ee.group,ke=Ee.data;if(!Ie&&!(ke!=null&&ke.disabled)&&(z(ke.value)||!D))return he}return-1},ne=m.useState(function(){return q(0)}),Z=Re(ne,2),J=Z[0],de=Z[1],X=function(le){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;de(le);var Se={source:fe?"keyboard":"mouse"},G=E[le];if(!G){v(null,-1,Se);return}v(G.value,le,Se)};m.useEffect(function(){X(b!==!1?q(0):-1)},[E.length,c]);var V=m.useCallback(function(ge){return l==="combobox"?String(ge).toLowerCase()===c.toLowerCase():x.has(ge)},[l,c,st(x).toString(),x.size]);m.useEffect(function(){var ge=setTimeout(function(){if(!a&&o&&x.size===1){var fe=Array.from(x)[0],Se=E.findIndex(function(G){var he=G.data;return c?String(he.value).startsWith(c):he.value===fe});Se!==-1&&(X(Se),j(Se))}});if(o){var le;(le=I.current)===null||le===void 0||le.scrollTo(void 0)}return function(){return clearTimeout(ge)}},[o,c]);var te=function(le){le!==void 0&&w(le,{selected:!x.has(le)}),a||d(!1)};if(m.useImperativeHandle(n,function(){return{onKeyDown:function(le){var fe=le.which,Se=le.ctrlKey;switch(fe){case Nt.N:case Nt.P:case Nt.UP:case Nt.DOWN:{var G=0;if(fe===Nt.UP?G=-1:fe===Nt.DOWN?G=1:KQ()&&Se&&(fe===Nt.N?G=1:fe===Nt.P&&(G=-1)),G!==0){var he=q(J+G,G);j(he),X(he,!0)}break}case Nt.TAB:case Nt.ENTER:{var Ee,Ie=E[J];Ie&&!(Ie!=null&&(Ee=Ie.data)!==null&&Ee!==void 0&&Ee.disabled)&&!D?te(Ie.value):te(void 0),o&&le.preventDefault();break}case Nt.ESC:d(!1),o&&le.stopPropagation()}},onKeyUp:function(){},scrollTo:function(le){j(le)}}}),E.length===0)return m.createElement("div",{role:"listbox",id:"".concat(s,"_list"),className:"".concat($,"-empty"),onMouseDown:B},u);var ie=Object.keys(R).map(function(ge){return R[ge]}),ce=function(le){return le.label};function ae(ge,le){var fe=ge.group;return{role:fe?"presentation":"option",id:"".concat(s,"_list_").concat(le)}}var ve=function(le){var fe=E[le];if(!fe)return null;var Se=fe.data||{},G=Se.value,he=fe.group,Ee=zo(Se,!0),Ie=ce(fe);return fe?m.createElement("div",yt({"aria-label":typeof Ie=="string"&&!he?Ie:null},Ee,{key:le},ae(fe,le),{"aria-selected":V(G)}),G):null},xe={role:"listbox",id:"".concat(s,"_list")};return m.createElement(m.Fragment,null,O&&m.createElement("div",yt({},xe,{style:{height:0,width:0,overflow:"hidden"}}),ve(J-1),ve(J),ve(J+1)),m.createElement($T,{itemKey:"key",ref:I,data:E,height:S,itemHeight:_,fullHeight:!1,onMouseDown:B,onScroll:f,virtual:O,direction:T,innerProps:O?null:xe},function(ge,le){var fe=ge.group,Se=ge.groupOption,G=ge.data,he=ge.label,Ee=ge.value,Ie=G.key;if(fe){var ke,De=(ke=G.title)!==null&&ke!==void 0?ke:p4(he)?he.toString():void 0;return m.createElement("div",{className:Le($,"".concat($,"-group"),G.className),title:De},he!==void 0?he:Ie)}var He=G.disabled,Je=G.title;G.children;var ze=G.style,Ne=G.className,tt=cn(G,XQ),pt=Cs(tt,ie),gt=z(Ee),y=He||!gt&&D,K="".concat($,"-option"),W=Le($,K,Ne,Y(Y(Y(Y({},"".concat(K,"-grouped"),Se),"".concat(K,"-active"),J===le&&!y),"".concat(K,"-disabled"),y),"".concat(K,"-selected"),gt)),re=ce(ge),se=!C||typeof C=="function"||gt,pe=typeof re=="number"?re:re||Ee,M=p4(pe)?pe.toString():void 0;return Je!==void 0&&(M=Je),m.createElement("div",yt({},zo(pt),O?{}:ae(ge,le),{"aria-selected":V(Ee),className:W,title:M,onMouseMove:function(){J===le||y||X(le)},onClick:function(){y||te(Ee)},style:ze}),m.createElement("div",{className:"".concat(K,"-content")},typeof A=="function"?A(ge,{index:le}):pe),m.isValidElement(C)||gt,se&&m.createElement(f0,{className:"".concat($,"-option-state"),customizeIcon:C,customizeIconProps:{value:Ee,disabled:y,isSelected:gt}},gt?"✓":null))}))},JQ=m.forwardRef(YQ);const QQ=(function(t,e){var n=m.useRef({values:new Map,options:new Map}),r=m.useMemo(function(){var s=n.current,o=s.values,a=s.options,l=t.map(function(u){if(u.label===void 0){var f;return ee(ee({},u),{},{label:(f=o.get(u.value))===null||f===void 0?void 0:f.label})}return u}),c=new Map,d=new Map;return l.forEach(function(u){c.set(u.value,u),d.set(u.value,e.get(u.value)||a.get(u.value))}),n.current.values=c,n.current.options=d,l},[t,e]),i=m.useCallback(function(s){return e.get(s)||n.current.options.get(s)},[e]);return[r,i]});function Wg(t,e){return yT(t).join("").toUpperCase().includes(e)}const ZQ=(function(t,e,n,r,i){return m.useMemo(function(){if(!n||r===!1)return t;var s=e.options,o=e.label,a=e.value,l=[],c=typeof r=="function",d=n.toUpperCase(),u=c?r:function(h,p){return i?Wg(p[i],d):p[s]?Wg(p[o!=="children"?o:"label"],d):Wg(p[a],d)},f=c?function(h){return cb(h)}:function(h){return h};return t.forEach(function(h){if(h[s]){var p=u(n,f(h));if(p)l.push(h);else{var g=h[s].filter(function(v){return u(n,f(v))});g.length&&l.push(ee(ee({},h),{},Y({},s,g)))}return}u(n,f(h))&&l.push(h)}),l},[t,r,i,n,e])});var m4=0,eZ=Br();function tZ(){var t;return eZ?(t=m4,m4+=1):t="TEST_OR_SSR",t}function nZ(t){var e=m.useState(),n=Re(e,2),r=n[0],i=n[1];return m.useEffect(function(){i("rc_select_".concat(tZ()))},[]),t||r}var rZ=["children","value"],iZ=["children"];function sZ(t){var e=t,n=e.key,r=e.props,i=r.children,s=r.value,o=cn(r,rZ);return ee({key:n,value:s!==void 0?s:n,children:i},o)}function ET(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Vl(t).map(function(n,r){if(!m.isValidElement(n)||!n.type)return null;var i=n,s=i.type.isSelectOptGroup,o=i.key,a=i.props,l=a.children,c=cn(a,iZ);return e||!s?sZ(n):ee(ee({key:"__RC_SELECT_GRP__".concat(o===null?r:o,"__"),label:o},c),{},{options:ET(l)})}).filter(function(n){return n})}var oZ=function(e,n,r,i,s){return m.useMemo(function(){var o=e,a=!e;a&&(o=ET(n));var l=new Map,c=new Map,d=function(h,p,g){g&&typeof g=="string"&&h.set(p[g],p)},u=function f(h){for(var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=0;g<h.length;g+=1){var v=h[g];!v[r.options]||p?(l.set(v[r.value],v),d(c,v,r.label),d(c,v,i),d(c,v,s)):f(v[r.options],!0)}};return u(o),{options:o,valueOptions:l,labelOptions:c}},[e,n,r,i,s])};function g4(t){var e=m.useRef();e.current=t;var n=m.useCallback(function(){return e.current.apply(e,arguments)},[]);return n}var aZ=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],lZ=["inputValue"];function cZ(t){return!t||vt(t)!=="object"}var dZ=m.forwardRef(function(t,e){var n=t.id,r=t.mode,i=t.prefixCls,s=i===void 0?"rc-select":i,o=t.backfill,a=t.fieldNames,l=t.inputValue,c=t.searchValue,d=t.onSearch,u=t.autoClearSearchValue,f=u===void 0?!0:u,h=t.onSelect,p=t.onDeselect,g=t.dropdownMatchSelectWidth,v=g===void 0?!0:g,b=t.filterOption,w=t.filterSort,C=t.optionFilterProp,x=t.optionLabelProp,R=t.options,O=t.optionRender,T=t.children,S=t.defaultActiveFirstOption,_=t.menuItemSelectedIcon,A=t.virtual,$=t.direction,E=t.listHeight,I=E===void 0?200:E,D=t.listItemHeight,B=D===void 0?20:D,j=t.labelRender,z=t.value,q=t.defaultValue,ne=t.labelInValue,Z=t.onChange,J=t.maxCount,de=cn(t,aZ),X=nZ(n),V=db(r),te=!!(!R&&T),ie=m.useMemo(function(){return b===void 0&&r==="combobox"?!1:b},[b,r]),ce=m.useMemo(function(){return ST(a,te)},[JSON.stringify(a),te]),ae=Ho("",{value:c!==void 0?c:l,postState:function(_e){return _e||""}}),ve=Re(ae,2),xe=ve[0],ge=ve[1],le=oZ(R,T,ce,C,x),fe=le.valueOptions,Se=le.labelOptions,G=le.options,he=m.useCallback(function(et){var _e=yT(et);return _e.map(function(Me){var Ue,mt,$e,zt,Kt;if(cZ(Me))Ue=Me;else{var Xt;$e=Me.key,mt=Me.label,Ue=(Xt=Me.value)!==null&&Xt!==void 0?Xt:$e}var Gt=fe.get(Ue);if(Gt){var _n;mt===void 0&&(mt=Gt==null?void 0:Gt[x||ce.label]),$e===void 0&&($e=(_n=Gt==null?void 0:Gt.key)!==null&&_n!==void 0?_n:Ue),zt=Gt==null?void 0:Gt.disabled,Kt=Gt==null?void 0:Gt.title}return{label:mt,value:Ue,key:$e,disabled:zt,title:Kt}})},[ce,x,fe]),Ee=Ho(q,{value:z}
547),Ie=Re(Ee,2),ke=Ie[0],De=Ie[1],He=m.useMemo(function(){var et,_e=V&&ke===null?[]:ke,Me=he(_e);return r==="combobox"&&eQ((et=Me[0])===null||et===void 0?void 0:et.value)?[]:Me},[ke,he,r,V]),Je=QQ(He,fe),ze=Re(Je,2),Ne=ze[0],tt=ze[1],pt=m.useMemo(function(){if(!r&&Ne.length===1){var et=Ne[0];if(et.value===null&&(et.label===null||et.label===void 0))return[]}return Ne.map(function(_e){var Me;return ee(ee({},_e),{},{label:(Me=typeof j=="function"?j(_e):_e.label)!==null&&Me!==void 0?Me:_e.value})})},[r,Ne,j]),gt=m.useMemo(function(){return new Set(Ne.map(function(et){return et.value}))},[Ne]);m.useEffect(function(){if(r==="combobox"){var et,_e=(et=Ne[0])===null||et===void 0?void 0:et.value;ge(ZJ(_e)?String(_e):"")}},[Ne]);var y=g4(function(et,_e){var Me=_e??et;return Y(Y({},ce.value,et),ce.label,Me)}),K=m.useMemo(function(){if(r!=="tags")return G;var et=st(G),_e=function(Ue){return fe.has(Ue)};return st(Ne).sort(function(Me,Ue){return Me.value<Ue.value?-1:1}).forEach(function(Me){var Ue=Me.value;_e(Ue)||et.push(y(Ue,Me.label))}),et},[y,G,fe,Ne,r]),W=ZQ(K,ce,xe,ie,C),re=m.useMemo(function(){return r!=="tags"||!xe||W.some(function(et){return et[C||"value"]===xe})||W.some(function(et){return et[ce.value]===xe})?W:[y(xe)].concat(st(W))},[y,C,r,W,xe,ce]),se=function et(_e){var Me=st(_e).sort(function(Ue,mt){return w(Ue,mt,{searchValue:xe})});return Me.map(function(Ue){return Array.isArray(Ue.options)?ee(ee({},Ue),{},{options:Ue.options.length>0?et(Ue.options):Ue.options}):Ue})},pe=m.useMemo(function(){return w?se(re):re},[re,w,xe]),M=m.useMemo(function(){return EQ(pe,{fieldNames:ce,childrenAsData:te})},[pe,ce,te]),L=function(_e){var Me=he(_e);if(De(Me),Z&&(Me.length!==Ne.length||Me.some(function($e,zt){var Kt;return((Kt=Ne[zt])===null||Kt===void 0?void 0:Kt.value)!==($e==null?void 0:$e.value)}))){var Ue=ne?Me:Me.map(function($e){return $e.value}),mt=Me.map(function($e){return cb(tt($e.value))});Z(V?Ue:Ue[0],V?mt:mt[0])}},ye=m.useState(null),ue=Re(ye,2),be=ue[0],we=ue[1],Ae=m.useState(0),Pe=Re(Ae,2),je=Pe[0],Xe=Pe[1],Ge=S!==void 0?S:r!=="combobox",it=m.useCallback(function(et,_e){var Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ue=Me.source,mt=Ue===void 0?"keyboard":Ue;Xe(_e),o&&r==="combobox"&&et!==null&&mt==="keyboard"&&we(String(et))},[o,r]),nt=function(_e,Me,Ue){var mt=function(){var vn,On=tt(_e);return[ne?{label:On==null?void 0:On[ce.label],value:_e,key:(vn=On==null?void 0:On.key)!==null&&vn!==void 0?vn:_e}:_e,cb(On)]};if(Me&&h){var $e=mt(),zt=Re($e,2),Kt=zt[0],Xt=zt[1];h(Kt,Xt)}else if(!Me&&p&&Ue!=="clear"){var Gt=mt(),_n=Re(Gt,2),Pn=_n[0],Wn=_n[1];p(Pn,Wn)}},Ut=g4(function(et,_e){var Me,Ue=V?_e.selected:!0;Ue?Me=V?[].concat(st(Ne),[et]):[et]:Me=Ne.filter(function(mt){return mt.value!==et}),L(Me),nt(et,Ue),r==="combobox"?we(""):(!db||f)&&(ge(""),we(""))}),Bt=function(_e,Me){L(_e);var Ue=Me.type,mt=Me.values;(Ue==="remove"||Ue==="clear")&&mt.forEach(function($e){nt($e.value,!1,Ue)})},ht=function(_e,Me){if(ge(_e),we(null),Me.source==="submit"){var Ue=(_e||"").trim();if(Ue){var mt=Array.from(new Set([].concat(st(gt),[Ue])));L(mt),nt(Ue,!0),ge("")}return}Me.source!=="blur"&&(r==="combobox"&&L(_e),d==null||d(_e))},Et=function(_e){var Me=_e;r!=="tags"&&(Me=_e.map(function(mt){var $e=Se.get(mt);return $e==null?void 0:$e.value}).filter(function(mt){return mt!==void 0}));var Ue=Array.from(new Set([].concat(st(gt),st(Me))));L(Ue),Ue.forEach(function(mt){nt(mt,!0)})},Vt=m.useMemo(function(){var et=A!==!1&&v!==!1;return ee(ee({},le),{},{flattenOptions:M,onActiveValue:it,defaultActiveFirstOption:Ge,onSelect:Ut,menuItemSelectedIcon:_,rawValues:gt,fieldNames:ce,virtual:et,direction:$,listHeight:I,listItemHeight:B,childrenAsData:te,maxCount:J,optionRender:O})},[J,le,M,it,Ge,Ut,_,gt,ce,A,v,$,I,B,te,O]);return m.createElement(a2.Provider,{value:Vt},m.createElement(OQ,yt({},de,{id:X,prefixCls:s,ref:e,omitDomProps:lZ,mode:r,displayValues:pt,onDisplayValuesChange:Bt,direction:$,searchValue:xe,onSearch:ht,autoClearSearchValue:f,onSearchSplit:Et,dropdownMatchSelectWidth:v,OptionList:JQ,emptyOptions:!M.length,activeValue:be,activeDescendantId:"".concat(X,"_list_").concat(je)})))}),d2=dZ;d2.Option=c2;d2.OptGroup=l2;function ap(t,e,n){return Le({[`${t}-status-success`]:e==="success",[`${t}-status-warning`]:e==="warning",[`${t}
547-status-error`]:e==="error",[`${t}-status-validating`]:e==="validating",[`${t}-has-feedback`]:n})}const h0=(t,e)=>e||t,uZ=()=>{const[,t]=Ji(),[e]=Ba("Empty"),r=new mn(t.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return m.createElement("svg",{style:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},m.createElement("title",null,(e==null?void 0:e.description)||"Empty"),m.createElement("g",{fill:"none",fillRule:"evenodd"},m.createElement("g",{transform:"translate(24 31.67)"},m.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),m.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),m.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),m.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),m.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),m.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),m.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},m.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),m.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},fZ=()=>{const[,t]=Ji(),[e]=Ba("Empty"),{colorFill:n,colorFillTertiary:r,colorFillQuaternary:i,colorBgContainer:s}=t,{borderColor:o,shadowColor:a,contentColor:l}=m.useMemo(()=>({borderColor:new mn(n).onBackground(s).toHexString(),shadowColor:new mn(r).onBackground(s).toHexString(),contentColor:new mn(i).onBackground(s).toHexString()}),[n,r,i,s]);return m.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},m.createElement("title",null,(e==null?void 0:e.description)||"Empty"),m.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},m.createElement("ellipse",{fill:a,cx:"32",cy:"33",rx:"32",ry:"7"}),m.createElement("g",{fillRule:"nonzero",stroke:o},m.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),m.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:l}))))},hZ=t=>{const{componentCls:e,margin:n,marginXS:r,marginXL:i,fontSize:s,lineHeight:o}=t;return{[e]:{marginInline:r,fontSize:s,lineHeight:o,textAlign:"center",[`${e}-image`]:{height:t.emptyImgHeight,marginBottom:r,opacity:t.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:t.colorTextDescription},[`${e}-footer`]:{marginTop:n},"&-normal":{marginBlock:i,color:t.colorTextDescription,[`${e}-description`]:{color:t.colorTextDescription},[`${e}-image`]:{height:t.emptyImgHeightMD}},"&-small":{marginBlock:r,color:t.colorTextDescription,[`${e}-image`]:{height:t.emptyImgHeightSM}}}}},pZ=pi("Empty",t=>{const{componentCls:e,controlHeightLG:n,calc:r}=t,i=jn(t,{emptyImgCls:`${e}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()});return hZ(i)});var mZ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const TT=m.createElement(uZ,null),RT=m.createElement(fZ,null),pa=t=>{var e;const{className:n,rootClassName:r,prefixCls:i,image:s,description:o,children:a,imageStyle:l,style:c,classNames:d,styles:u}=t,f=mZ(t,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:h,direction:p,className:g,style:v,classNames:b,styles:w,image:C}=Ha("empty"),x=h("empty",i),[R,O,T]=pZ(x),[S]=Ba("Empty"),_=typeof o<"u"?o:S==null?void 0:S.description,A=typeof _=="string"?_:"empty",$=(e=s??C)!==null&&e!==void 0?e:TT;let E=null;return typeof $=="string"?E=m.createElement("img",{draggable:!1,alt:A,src:$}):E=$,R(m.createElement("div",Object.assign({className:Le(O,T,x,g,{[`${x}-normal`]:$===RT,[`${x}-rtl`]:p==="rtl"},n,r,b.root,d==null?void 0:d.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},w.root),v),u==null?void 0:u.root),c)},f),m.createElement("div",{className:Le(`${x}-image`,b.image,d==null?void 0:d.image),style:Object.assign(Object.assign(Object.assign({},l),w.image),u==null?void 0:u.image)},E),_&&m.createElement("div",{className:Le(`${x}-description`,b.description,d==null?void 0:d.description),style:Object.assign(Object.assign({},w.description),u==null?void 0:u.description)},_),a&&m.createElement("div",{className:Le(`${x}-footer`,b.footer,d==null?void 0:d.footer),style:Object.assign(Object.assign({},w.footer),u==null?void 0:u.footer)},a)))};pa.PRESENTED_IMAGE_DEFAULT=TT;pa.PRESENTED_IMAGE_SIMPLE=RT;
547const gZ=t=>{const{componentName:e}=t,{getPrefixCls:n}=m.useContext(ln),r=n("empty");switch(e){case"Table":case"List":return Te.createElement(pa,{image:pa.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return Te.createElement(pa,{image:pa.PRESENTED_IMAGE_SIMPLE,className:`${r}-small`});case"Table.filter":return null;default:return Te.createElement(pa,null)}},u2=(t,e,n)=>{var r,i;const{variant:s,[t]:o}=m.useContext(ln),a=m.useContext(jY),l=o==null?void 0:o.variant;let c;typeof e<"u"?c=e:n===!1?c="borderless":c=(i=(r=a??l)!==null&&r!==void 0?r:s)!==null&&i!==void 0?i:"outlined";const d=GV.includes(c);return[c,d]},vZ=t=>{const n={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:t==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},n),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},n),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},n),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},n),{points:["br","tr"],offset:[0,-4]})}};function bZ(t,e){return t||vZ(e)}const v4=t=>{const{optionHeight:e,optionFontSize:n,optionLineHeight:r,optionPadding:i}=t;return{position:"relative",display:"block",minHeight:e,padding:i,color:t.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}},yZ=t=>{const{antCls:e,componentCls:n}=t,r=`${n}-item`,i=`&${e}-slide-up-enter${e}-slide-up-enter-active`,s=`&${e}-slide-up-appear${e}-slide-up-appear-active`,o=`&${e}-slide-up-leave${e}-slide-up-leave-active`,a=`${n}-dropdown-placement-`,l=`${r}-option-selected`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},za(t)),{position:"absolute",top:-9999,zIndex:t.zIndexPopup,boxSizing:"border-box",padding:t.paddingXXS,overflow:"hidden",fontSize:t.fontSize,fontVariant:"initial",backgroundColor:t.colorBgElevated,borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,[`
548          ${i}${a}bottomLeft,
549          ${s}${a}bottomLeft
550        `]:{animationName:R7},[`
551          ${i}${a}topLeft,
552          ${s}${a}topLeft,
553          ${i}${a}topRight,
554          ${s}${a}topRight
555        `]:{animationName:A7},[`${o}${a}bottomLeft`]:{animationName:I7},[`
556          ${o}${a}topLeft,
557          ${o}${a}topRight
558        `]:{animationName:O7},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},v4(t)),{cursor:"pointer",transition:`background ${t.motionDurationSlow} ease`,borderRadius:t.borderRadiusSM,"&-group":{color:t.colorTextDescription,fontSize:t.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},Qh),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:t.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:t.optionSelectedColor,fontWeight:t.optionSelectedFontWeight,backgroundColor:t.optionSelectedBg,[`${r}-option-state`]:{color:t.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:t.colorBgContainerDisabled},color:t.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:t.calc(t.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},v4(t)),{color:t.colorTextDisabled})}),[`${l}:has(+ ${l})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${l}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})}
558,Ex(t,"slide-up"),Ex(t,"slide-down"),$x(t,"move-up"),$x(t,"move-down")]},wZ=t=>{const{multipleSelectItemHeight:e,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=t,s=t.max(t.calc(n).sub(r).equal(),0),o=t.max(t.calc(s).sub(i).equal(),0);return{basePadding:s,containerPadding:o,itemHeight:Qe(e),itemLineHeight:Qe(t.calc(e).sub(t.calc(t.lineWidth).mul(2)).equal())}},SZ=t=>{const{multipleSelectItemHeight:e,selectHeight:n,lineWidth:r}=t;return t.calc(n).sub(e).div(2).sub(r).equal()},CZ=t=>{const{componentCls:e,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:s,multipleItemColorDisabled:o,multipleItemBorderColorDisabled:a,colorIcon:l,colorIconHover:c,INTERNAL_FIXED_ITEM_MARGIN:d}=t;return{[`${e}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"calc(100% - 4px)",display:"inline-flex"},[`${e}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:d,borderRadius:r,cursor:"default",transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:t.calc(d).mul(2).equal(),paddingInlineStart:s,paddingInlineEnd:t.calc(s).div(2).equal(),[`${e}-disabled&`]:{color:o,borderColor:a,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:t.calc(s).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},Qp()),{display:"inline-flex",alignItems:"center",color:l,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:c}})}}}},xZ=(t,e)=>
558{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=t,i=`${n}-selection-overflow`,s=t.multipleSelectItemHeight,o=SZ(t),a=e?`${n}-${e}`:"",l=wZ(t);return{[`${n}-multiple${a}`]:Object.assign(Object.assign({},CZ(t)),{[`${n}-selector`]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:l.basePadding,paddingBlock:l.containerPadding,borderRadius:t.borderRadius,[`${n}-disabled&`]:{background:t.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Qe(r)} 0`,lineHeight:Qe(s),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:l.itemHeight,lineHeight:Qe(l.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:"flex-start","&:after":{lineHeight:Qe(s),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(l.basePadding).equal()},[`${i}-item + ${i}-item,
559        ${n}-prefix + ${n}-selection-wrap
560      `]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:l.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(o).equal(),"\n          &-input,\n          &-mirror\n        ":{height:s,fontFamily:t.fontFamily,lineHeight:Qe(s),transition:`all ${t.motionDurationSlow}`}
vendor: 1,204 bytes, lines 560-563
560,"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(l.basePadding).equal(),insetInlineEnd:t.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${t.motionDurationSlow}`}})}};function Gg(t,e){const{componentCls:n}=t,r=e?`${n}-${e}`:"",i={[`${n}-multiple${r}`]:{fontSize:t.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[`
561        &${n}-show-arrow ${n}-selector,
562        &${n}-allow-clear ${n}-selector
563      `]:{paddingInlineEnd:t.calc(t.fontSizeIcon).add(t.controlPaddingHorizontal).equal()}}};return[xZ(t,e),i]}const $Z=t=>{const{componentCls:e}=t,n=jn(t,{selectHeight:t.controlHeightSM,multipleSelectItemHeight:t.multipleItemHeightSM,borderRadius:t.borderRadiusSM,borderRadiusSM:t.borderRadiusXS}),r=jn(t,{fontSize:t.fontSizeLG,selectHeight:t.controlHeightLG,multipleSelectItemHeight:t.multipleItemHeightLG,borderRadius:t.borderRadiusLG,borderRadiusSM:t.borderRadius});return[Gg(t),Gg(n,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}
563-selection-placeholder`]:{insetInline:t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},Gg(r,"lg")]};function Kg(t,e){const{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=t,s=t.calc(t.controlHeight).sub(t.calc(t.lineWidth).mul(2)).equal(),o=e?`${n}-${e}`:"";return{[`${n}-single${o}`]:{fontSize:t.fontSize,height:t.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},za(t,!0)),{display:"flex",borderRadius:i,flex:"1 1 auto",[`${n}-selection-wrap:after`]:{lineHeight:Qe(s)},[`${n}-selection-search`]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},[`
564          ${n}-selection-item,
565          ${n}-selection-placeholder
566        `]:{display:"block",padding:0,lineHeight:Qe(s),transition:`all ${t.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${n}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
567        &${n}-show-arrow ${n}-selection-item,
568        &${n}-show-arrow ${n}-selection-search,
569        &${n}-show-arrow ${n}-selection-placeholder
570      `]:{paddingInlineEnd:t.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:t.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:"100%",alignItems:"center",padding:`0 ${Qe(r)}`,[`${n}-selection-search-input`]:{height:s,fontSize:t.fontSize},"&:after":{lineHeight:Qe(s)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Qe(r)}`,"&:after":{display:"none"}}}}}}}function EZ(t){const{componentCls:e}=t,n=t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal();return[Kg(t),Kg(jn(t,{controlHeight:t.controlHeightSM,borderRadius:t.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selector`]:{padding:`0 ${Qe(n)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:t.calc(n).add(t.calc(t.fontSize).mul(1.5)).equal()},[`
571            &${e}-show-arrow ${e}-selection-item,
572            &${e}-show-arrow ${e}
572-selection-placeholder
573          `]:{paddingInlineEnd:t.calc(t.fontSize).mul(1.5).equal()}}}},Kg(jn(t,{controlHeight:t.singleItemHeightLG,fontSize:t.fontSizeLG,borderRadius:t.borderRadiusLG}),"lg")]}const TZ=t=>{const{fontSize:e,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:s,controlHeightLG:o,paddingXXS:a,controlPaddingHorizontal:l,zIndexPopupBase:c,colorText:d,fontWeightStrong:u,controlItemBgActive:f,controlItemBgHover:h,colorBgContainer:p,colorFillSecondary:g,colorBgContainerDisabled:v,colorTextDisabled:b,colorPrimaryHover:w,colorPrimary:C,controlOutline:x}=t,R=a*2,O=r*2,T=Math.min(i-R,i-O),S=Math.min(s-R,s-O),_=Math.min(o-R,o-O);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(a/2),zIndexPopup:c+50,optionSelectedColor:d,optionSelectedFontWeight:u,optionSelectedBg:f,optionActiveBg:h,optionPadding:`${(i-e*n)/2}px ${l}px`,optionFontSize:e,optionLineHeight:n,optionHeight:i,selectorBg:p,clearBg:p,singleItemHeightLG:o,multipleItemBg:g,multipleItemBorderColor:"transparent",multipleItemHeight:T,multipleItemHeightSM:S,multipleItemHeightLG:_,multipleSelectorBgDisabled:v,multipleItemColorDisabled:b,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(t.fontSize*1.25),hoverBorderColor:w,activeBorderColor:C,activeOutlineColor:x,selectAffixPadding:a}},IT=(t,e)=>{const{componentCls:n,antCls:r,controlOutlineWidth:i}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Qe(t.lineWidth)} ${t.lineType} ${e.borderColor}`,background:t.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${Qe(i)} ${e.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:e.color}}}},b4=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},IT(t,e))}),RZ=t=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},IT(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),b4(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),b4(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Qe(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),AT=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:e.bg,border:`${Qe(t.lineWidth)} ${t.lineType} transparent`,color:e.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:e.hoverBg},[`${n}-focused& ${n}-selector`]:{background:t.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},y4=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},AT(t,e))}),IZ=t=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},AT(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.activeBorderColor,color:t.colorText})),y4(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,color:t.colorError})),y4(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{borderColor:t.colorBorder,background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.colorBgContainer,border:`${Qe(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}})}),AZ=t=>({"&-borderless":{[`${t.componentCls}-selector`]:{background:"transparent",border:`${Qe(t.lineWidth)} ${t.lineType} transparent`},[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Qe(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`},[`&${t.componentCls}-status-error`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorError}},[`&${t.componentCls}-status-warning`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorWarning}}}}),OT=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`${Qe(t.lineWidth)} 0`,borderStyle:`${t.lineType} none`,borderColor:`transparent transparent ${e.borderColor} transparent`,background:t.selectorBg,borderRadius:0},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:`transparent transparent ${e.hoverBorderHover} transparent`},[`${n}-focused& ${n}-selector`]:{borderColor:`transparent transparent ${e.activeBorderColor} transparent`,outline:0},[`${n}-prefix`]:{color:e.color}}}},w4=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},OT(t,e))}),OZ=t=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},OT(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),w4(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),w4(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Qe(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),kZ=t=>({[t.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},RZ(t)),IZ(t)),AZ(t)),OZ(t))}),NZ=t=>{const{componentCls:e}=t;return{position:"relative",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}
573-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},_Z=t=>{const{componentCls:e}=t;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none",appearance:"none"}}}},PZ=t=>{const{antCls:e,componentCls:n,inputPaddingHorizontalBase:r,iconCls:i}=t,s={[`${n}-clear`]:{opacity:1,background:t.colorBgBase,borderRadius:"50%"}};return{[n]:Object.assign(Object.assign({},za(t)),{position:"relative",display:"inline-flex",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},NZ(t)),_Z(t)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},Qh),{[`> ${e}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},Qh),{flex:1,color:t.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},Qp()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${t.motionDurationSlow} ease`,[i]:{verticalAlign:"top",transition:`transform ${t.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-selection-wrap`]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},[`${n}-prefix`]:{flex:"none",marginInlineEnd:t.selectAffixPadding},[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:t.fontSizeIcon,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${t.motionDurationMid} ease, opacity ${t.motionDurationSlow} ease`,textRendering:"auto",transform:"translateZ(0)","&:before":{display:"block"},"&:hover":{color:t.colorIcon}},"@media(hover:none)":s,"&:hover":s}),[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:t.calc(r).add(t.fontSize).add(t.paddingXS).equal()}}}}}},MZ=t=>{const{componentCls:e}=t;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},PZ(t),EZ(t),$Z(t),yZ(t),{[`${e}-rtl`]:{direction:"rtl"}},r2(t,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},DZ=pi("Select",(t,{rootPrefixCls:e})=>{const n=jn(t,{rootPrefixCls:e,inputPaddingHorizontalBase:t.calc(t.paddingSM).sub(1).equal(),multipleSelectItemHeight:t.multipleItemHeight,selectHeight:t.controlHeight});return[MZ(n),kZ(n)]},TZ,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var LZ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},jZ=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:LZ}))},FZ=m.forwardRef(jZ),BZ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},HZ=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:BZ}))},zZ=m.forwardRef(HZ),qZ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},UZ=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:qZ}))},kT=m.forwardRef(UZ);function VZ({suffixIcon:t,clearIcon:e,menuItemSelectedIcon:n,removeIcon:r,loading:i,multiple:s,hasFeedback:o,prefixCls:a,showSuffixIcon:l,feedbackIcon:c,showArrow:d,componentName:u}){const f=e??m.createElement(e2,null),h=b=>t===null&&!o&&!d?null:m.createElement(m.Fragment,null,l!==!1&&b,o&&c);let p=null;if(t!==void 0)p=h(t);else if(i)p=h(m.createElement(p7,{spin:!0}));else{const b=`${a}-suffix`;p=({open:w,showSearch:C})=>h(w&&C?m.createElement(kT,{className:b}):m.createElement(zZ,{className:b}))}let g=null;n!==void 0?g=n:s?g=m.createElement(FZ,null):g=null;let v=null;return r!==void 0?v=r:v=m.createElement(e0,null),{clearIcon:f,suffixIcon:p,itemIcon:g,removeIcon:v}}function WZ(t){return Te.useMemo(()=>
573{if(t)return(...e)=>Te.createElement(sp,{space:!0},t.apply(void 0,e))},[t])}function GZ(t,e){return e!==void 0?e:t!==null}var KZ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const NT="SECRET_COMBOBOX_MODE_DO_NOT_USE",XZ=(t,e)=>{var n,r,i,s,o;const{prefixCls:a,bordered:l,className:c,rootClassName:d,getPopupContainer:u,popupClassName:f,dropdownClassName:h,listHeight:p=256,placement:g,listItemHeight:v,size:b,disabled:w,notFoundContent:C,status:x,builtinPlacements:R,dropdownMatchSelectWidth:O,popupMatchSelectWidth:T,direction:S,style:_,allowClear:A,variant:$,dropdownStyle:E,transitionName:I,tagRender:D,maxCount:B,prefix:j,dropdownRender:z,popupRender:q,onDropdownVisibleChange:ne,onOpenChange:Z,styles:J,classNames:de}=t,X=KZ(t,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix","dropdownRender","popupRender","onDropdownVisibleChange","onOpenChange","styles","classNames"]),{getPopupContainer:V,getPrefixCls:te,renderEmpty:ie,direction:ce,virtual:ae,popupMatchSelectWidth:ve,popupOverflow:xe}=m.useContext(ln),{showSearch:ge,style:le,styles:fe,className:Se,classNames:G}=Ha("select"),[,he]=Ji(),Ee=v??(he==null?void 0:he.controlHeight),Ie=te("select",a),ke=te(),De=S??ce,{compactSize:He,compactItemClassnames:Je}=mu(Ie,De),[ze,Ne]=u2("select",$,l),tt=hu(Ie),[pt,gt,y]=DZ(Ie,tt),K=m.useMemo(()=>{const{mode:Ue}=t;if(Ue!=="combobox")return Ue===NT?"combobox":Ue},[t.mode]),W=K==="multiple"||K==="tags",re=GZ(t.suffixIcon,t.showArrow),se=(n=T??O)!==null&&n!==void 0?n:ve,pe=((r=J==null?void 0:J.popup)===null||r===void 0?void 0:r.root)||((i=fe.popup)===null||i===void 0?void 0:i.root)||E,M=WZ(q||z),L=Z||ne,{status:ye,hasFeedback:ue,isFormItemInput:be,feedbackIcon:we}=m.useContext(Gs),Ae=h0(ye,x);let Pe;C!==void 0?Pe=C:K==="combobox"?Pe=null:Pe=(ie==null?void 0:ie("Select"))||m.createElement(gZ,{componentName:"Select"});const{suffixIcon:je,itemIcon:Xe,removeIcon:Ge,clearIcon:it}=VZ(Object.assign(Object.assign({},X),{multiple:W,hasFeedback:ue,feedbackIcon:we,showSuffixIcon:re,prefixCls:Ie,componentName:"Select"})),nt=A===!0?{clearIcon:it}:A,Ut=Cs(X,["suffixIcon","itemIcon"]),Bt=Le(((s=de==null?void 0:de.popup)===null||s===void 0?void 0:s.root)||((o=G==null?void 0:G.popup)===null||o===void 0?void 0:o.root)||f||h,{[`${Ie}-dropdown-${De}`]:De==="rtl"},d,G.root,de==null?void 0:de.root,y,tt,gt),ht=Qo(Ue=>{var mt;return(mt=b??He)!==null&&mt!==void 0?mt:Ue}),Et=m.useContext(Bo),Vt=w??Et,et=Le({[`${Ie}-lg`]:ht==="large",[`${Ie}-sm`]:ht==="small",[`${Ie}-rtl`]:De==="rtl",[`${Ie}-${ze}`]:Ne,[`${Ie}-in-form-item`]:be},ap(Ie,Ae,ue),Je,Se,c,G.root,de==null?void 0:de.root,d,y,tt,gt),_e=m.useMemo(()=>g!==void 0?g:De==="rtl"?"bottomRight":"bottomLeft",[g,De]),[Me]=v7("SelectLike",pe==null?void 0:pe.zIndex);return pt(m.createElement(d2,Object.assign({ref:e,virtual:ae,showSearch:ge},Ut,{style:Object.assign(Object.assign(Object.assign(Object.assign({},fe.root),J==null?void 0:J.root),le),_),dropdownMatchSelectWidth:se,transitionName:Md(ke,"slide-up",I),builtinPlacements:bZ(R,xe),listHeight:p,listItemHeight:Ee,mode:K,prefixCls:Ie,placement:_e,direction:De,prefix:j,suffixIcon:je,menuItemSelectedIcon:Xe,removeIcon:Ge,allowClear:nt,notFoundContent:Pe,className:et,getPopupContainer:u||V,dropdownClassName:Bt,disabled:Vt,dropdownStyle:Object.assign(Object.assign({},pe),{zIndex:Me}),maxCount:W?B:void 0,tagRender:W?D:void 0,dropdownRender:M,onDropdownVisibleChange:L})))},Ua=m.forwardRef(XZ),YZ=kJ(Ua,"dropdownAlign");Ua.SECRET_COMBOBOX_MODE_DO_NOT_USE=NT;Ua.Option=c2;Ua.OptGroup=l2;Ua._InternalPanelDoNotUseOrYouWillBeFired=YZ;function p0(t){return jn(t,{inputAffixPadding:t.paddingXXS})}const m0=t=>{const{controlHeight:e,fontSize:n,lineHeight:r,lineWidth:i,controlHeightSM:s,controlHeightLG:o,fontSizeLG:a,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:d,controlPaddingHorizontal:u,colorFillAlter:f,colorPrimaryHover:h,colorPrimary:p,controlOutlineWidth:g,controlOutline:v,colorErrorOutline:b,colorWarningOutline:w,colorBgContainer:C,inputFontSize:x,inputFontSizeLG:R,inputFontSizeSM:O}=t,T=x||n,S=O||T,_=R||a,A=Math.round((e-T*r)/2*10)/10-i,$=Math.round((s-S*r)/2*10)/10-i,E=Math.ceil((o-_*l)/2*10)/10-i;return{paddingBlock:Math.max(A,0),paddingBlockSM:Math.max($,0),paddingBlockLG:Math.max(E,0),paddingInline:c-i,paddingInlineSM:d-i,paddingInlineLG:u-i,addonBg:f,activeBorderColor:p,hoverBorderColor:h,activeShadow:`0 0 0 ${g}px ${v}`,errorActiveShadow:`0 0 0 ${g}px ${b}`,warningActiveShadow:`0 0 0 ${g}px ${w}`,hoverBg:C,activeBg:C,inputFontSize:T,inputFontSizeLG:_,inputFontSizeSM:S}},JZ=t=>({borderColor:t.hoverBorderColor,backgroundColor:t.hoverBg}),f2=t=>
vendor: 19,229 bytes, lines 573-588
573({color:t.colorTextDisabled,backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},JZ(jn(t,{hoverBorderColor:t.colorBorder,hoverBg:t.colorBgContainerDisabled})))}),_T=(t,e)=>({background:t.colorBgContainer,borderWidth:t.lineWidth,borderStyle:t.lineType,borderColor:e.borderColor,"&:hover":{borderColor:e.hoverBorderColor,backgroundColor:t.hoverBg},"&:focus, &:focus-within":{borderColor:e.activeBorderColor,boxShadow:e.activeShadow,outline:0,backgroundColor:t.activeBg}}),S4=(t,e)=>({[`&${t.componentCls}-status-${e.status}:not(${t.componentCls}-disabled)`]:Object.assign(Object.assign({},_T(t,e)),{[`${t.componentCls}-prefix, ${t.componentCls}-suffix`]:{color:e.affixColor}}),[`&${t.componentCls}-status-${e.status}${t.componentCls}-disabled`]:{borderColor:e.borderColor}}),QZ=(t,e)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},_T(t,{borderColor:t.colorBorder,hoverBorderColor:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeShadow:t.activeShadow})),{[`&${t.componentCls}-disabled, &[disabled]`]:Object.assign({},f2(t))}),S4(t,{status:"error",borderColor:t.colorError,hoverBorderColor:t.colorErrorBorderHover,activeBorderColor:t.colorError,activeShadow:t.errorActiveShadow,affixColor:t.colorError})),S4(t,{status:"warning",borderColor:t.colorWarning,hoverBorderColor:t.colorWarningBorderHover,activeBorderColor:t.colorWarning,activeShadow:t.warningActiveShadow,affixColor:t.colorWarning})),e)}),C4=(t,e)=>({[`&${t.componentCls}-group-wrapper-status-${e.status}`]:{[`${t.componentCls}-group-addon`]:{borderColor:e.addonBorderColor,color:e.addonColor}}}),ZZ=t=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${t.componentCls}-group`]:{"&-addon":{background:t.addonBg,border:`${Qe(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},C4(t,{status:"error",addonBorderColor:t.colorError,addonColor:t.colorErrorText})),C4(t,{status:"warning",addonBorderColor:t.colorWarning,addonColor:t.colorWarningText})),{[`&${t.componentCls}-group-wrapper-disabled`]:{[`${t.componentCls}-group-addon`]:Object.assign({},f2(t))}})}),eee=(t,e)=>{const{componentCls:n}=t;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${n}-disabled, &[disabled]`]:{color:t.colorTextDisabled,cursor:"not-allowed"},[`&${n}-status-error`]:{"&, & input, & textarea":{color:t.colorError}},[`&${n}-status-warning`]:{"&, & input, & textarea":{color:t.colorWarning}}},e)}},PT=(t,e)=>{var n;return{background:e.bg,borderWidth:t.lineWidth,borderStyle:t.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:(n=e==null?void 0:e.inputColor)!==null&&n!==void 0?n:"unset"},"&:hover":{background:e.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:e.activeBorderColor,backgroundColor:t.activeBg}}},x4=(t,e)=>({[`&${t.componentCls}-status-${e.status}:not(${t.componentCls}-disabled)`]:Object.assign(Object.assign({},PT(t,e)),{[`${t.componentCls}-prefix, ${t.componentCls}-suffix`]:{color:e.affixColor}})}),tee=(t,e)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},PT(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.activeBorderColor})),{[`&${t.componentCls}-disabled, &[disabled]`]:Object.assign({},f2(t))}),x4(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,inputColor:t.colorErrorText,affixColor:t.colorError})),x4(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,inputColor:t.colorWarningText,affixColor:t.colorWarning})),e)}),$4=(t,e)=>({[`&${t.componentCls}-group-wrapper-status-${e.status}`]:{[`${t.componentCls}-group-addon`]:{background:e.addonBg,color:e.addonColor}}}),nee=t=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${t.componentCls}-group-addon`]:{background:t.colorFillTertiary,"&:last-child":{position:"static"}}},$4(t,{status:"error",addonBg:t.colorErrorBg,addonColor:t.colorErrorText})),$4(t,{status:"warning",addonBg:t.colorWarningBg,addonColor:t.colorWarningText})),{[`&${t.componentCls}-group-wrapper-disabled`]:{[`${t.componentCls}-group`]:{"&-addon":{background:t.colorFillTertiary,color:t.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Qe(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderTop:`${Qe(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderBottom:`${Qe(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Qe(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderTop:`${Qe(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderBottom:`${Qe(t.lineWidth)} ${t.lineType} ${t.colorBorder}`}}}})}),MT=(t,e)=>({background:t.colorBgContainer,borderWidth:`${Qe(t.lineWidth)} 0`,borderStyle:`${t.lineType} none`,borderColor:`transparent transparent ${e.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${e.hoverBorderColor} transparent`,backgroundColor:t.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${e.activeBorderColor} transparent`,outline:0,backgroundColor:t.activeBg}}),E4=(t,e)=>({[`&${t.componentCls}-status-${e.status}:not(${t.componentCls}-disabled)`]:Object.assign(Object.assign({},MT(t,e)),{[`${t.componentCls}-prefix, ${t.componentCls}-suffix`]:{color:e.affixColor}}),[`&${t.componentCls}-status-${e.status}${t.componentCls}-disabled`]:{borderColor:`transparent transparent ${e.borderColor} transparent`}}),ree=(t,e)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},MT(t,{borderColor:t.colorBorder,hoverBorderColor:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeShadow:t.activeShadow})),{[`&${t.componentCls}-disabled, &[disabled]`]:{color:t.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${t.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),E4(t,{status:"error",borderColor:t.colorError,hoverBorderColor:t.colorErrorBorderHover,activeBorderColor:t.colorError,activeShadow:t.errorActiveShadow,affixColor:t.colorError})),E4(t,{status:"warning",borderColor:t.colorWarning,hoverBorderColor:t.colorWarningBorderHover,activeBorderColor:t.colorWarning,activeShadow:t.warningActiveShadow,affixColor:t.colorWarning})),e)}),iee=t=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:t,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),DT=t=>{const{paddingBlockLG:e,lineHeightLG:n,borderRadiusLG:r,paddingInlineLG:i}=t;return{padding:`${Qe(e)} ${Qe(i)}`,fontSize:t.inputFontSizeLG,lineHeight:n,borderRadius:r}},LT=t=>({padding:`${Qe(t.paddingBlockSM)} ${Qe(t.paddingInlineSM)}`,fontSize:t.inputFontSizeSM,borderRadius:t.borderRadiusSM}),jT=t=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Qe(t.paddingBlock)} ${Qe(t.paddingInline)}`,color:t.colorText,fontSize:t.inputFontSize,lineHeight:t.lineHeight,borderRadius:t.borderRadius,transition:`all ${t.motionDurationMid}`},iee(t.colorTextPlaceholder)),{"&-lg":Object.assign({},DT(t)),"&-sm":Object.assign({},LT(t)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),see=t=>{const{componentCls:e,antCls:n}=t;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:t.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},DT(t)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},LT(t)),[`&-lg ${n}-select-single ${n}-select-selector`]:{height:t.controlHeightLG},[`&-sm ${n}-select-single ${n}-select-selector`]:{height:t.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Qe(t.paddingInline)}`,color:t.colorText,fontWeight:"normal",fontSize:t.inputFontSize,textAlign:"center",borderRadius:t.borderRadius,transition:`all ${t.motionDurationSlow}`,lineHeight:1,[`${n}-select`]:{margin:`${Qe(t.calc(t.paddingBlock).add(1).mul(-1).equal())} ${Qe(t.calc(t.paddingInline).mul(-1).equal())}`,[`&${n}-select-single:not(${n}-select-customize-input):not(${n}-pagination-size-changer)`]:{[`${n}-select-selector`]:{backgroundColor:"inherit",border:`${Qe(t.lineWidth)} ${t.lineType} transparent`,boxShadow:"none"}}},[`${n}-cascader-picker`]:{margin:`-9px ${Qe(t.calc(t.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${n}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[e]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:t.borderRadius,borderEndStartRadius:t.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},G8()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:t.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[`
574        & > ${e}-affix-wrapper,
575        & > ${e}-number-affix-wrapper,
576        & > ${n}-picker-range
577      `]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal(),borderInlineEndWidth:t.lineWidth},[e]:{float:"none"},[`& > ${n}-select > ${n}-select-selector,
578      & > ${n}-select-auto-complete ${e},
579      & > ${n}-cascader-picker ${e},
580      & > ${e}-group-wrapper ${e}`]:{borderInlineEndWidth:t.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child,
581      & > ${n}-select:first-child > ${n}-select-selector,
582      & > ${n}-select-auto-complete:first-child ${e},
583      & > ${n}-cascader-picker:first-child ${e}`]:{borderStartStartRadius:t.borderRadius,borderEndStartRadius:t.borderRadius},[`& > *:last-child,
584      & > ${n}-select:last-child > ${n}-select-selector,
585      & > ${n}-cascader-picker:last-child ${e},
586      & > ${n}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:t.lineWidth,borderStartEndRadius:t.borderRadius,borderEndEndRadius:t.borderRadius},[`& > ${n}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:t.calc(t.lineWidth).mul(-1).equal(),[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:t.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:t.borderRadius}}}})}},oee=t=>{const{componentCls:e,controlHeightSM:n,lineWidth:r,calc:i}=t,o=i(n).sub(i(r).mul(2)).sub(16).div(2).equal();return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},za(t)),jT(t)),QZ(t)),tee(t)),eee(t)),ree(t)),{'&[type="color"]':{height:t.controlHeight,[`&${e}-lg`]:{height:t.controlHeightLG},[`&${e}-sm`]:{height:n,paddingTop:o,paddingBottom:o}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}})}},aee=t=>{const{componentCls:e}=t;return{[`${e}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${t.motionDurationSlow}`,border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:t.colorIcon},"&:active":{color:t.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Qe(t.inputAffixPadding)}`}}}},lee=t=>{const{componentCls:e,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:i,colorIcon:s,colorIconHover:o,iconCls:a}=t,l=`${e}-affix-wrapper`,c=`${e}-affix-wrapper-disabled`;return{[l]:Object.assign(Object.assign(Object.assign(Object.assign({},jT(t)),{display:"inline-flex",[`&:not(${e}-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${e}`]:{padding:0},[`> input${e}, > textarea${e}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[e]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:t.paddingXS}},"&-show-count-suffix":{color:r,direction:"ltr"},"&-show-count-has-suffix":{marginInlineEnd:t.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),aee(t)),{[`${a}${e}-password-icon`]:{color:s,cursor:"pointer",transition:`all ${i}`,"&:hover":{color:o}}}),[`${e}-underlined`]:{borderRadius:0},[c]:{[`${a}${e}-password-icon`]:{color:s,cursor:"not-allowed","&:hover":{color:s}}}}},cee=t=>{const{componentCls:e,borderRadiusLG:n,borderRadiusSM:r}=t;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},za(t)),see(t)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:n,fontSize:t.inputFontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:r}}},ZZ(t)),nee(t)),{[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-item`]:{[`${e}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},dee=t=>{const{componentCls:e,antCls:n}=t,r=`${e}-search`;return{[r]:{[e]:{"&:not([disabled]):hover, &:not([disabled]):focus":{[`+ ${e}-group-addon ${r}-button:not(${n}-btn-color-primary):not(${n}-btn-variant-text)`]:{borderInlineStartColor:t.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{height:t.controlHeight,borderRadius:0},[`${e}-lg`]:{lineHeight:t.calc(t.lineHeightLG).sub(2e-4).equal()},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${r}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:"none"},[`${r}-button:not(${n}-btn-color-primary)`]:{color:t.colorTextDescription,"&:not([disabled]):hover":{color:t.colorPrimaryHover},"&:active":{color:t.colorPrimaryActive},[`&${n}-btn-loading::before`]:{inset:0}}}},[`${r}-button`]:{height:t.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{[`${e}-affix-wrapper, ${r}-button`]:{height:t.controlHeightLG}},"&-small":{[`${e}-affix-wrapper, ${r}-button`]:{height:t.controlHeightSM}},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button,
587        > ${e},
588        ${e}-affix-wrapper`]:{"&:hover, &:focus, &:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}},uee=t=>{const{componentCls:e}=t;return{[`${e}-out-of-range`]:{[`&, & input, & textarea, ${e}-show-count-suffix, ${e}-data-count`]:{color:t.colorError}}}},FT=pi(["Input","Shared"],t=>{const e=jn(t,p0(t));return[oee(e),lee(e)]},m0,{resetFont:!1}),BT=pi(["Input","Component"],t=>{const e=jn(t,p0(t));return[cee(e),dee(e),uee(e),r2(e)]},m0,{resetFont:!1});var T4=function(e,n){if(!e)return null;var r={left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth,top:e.offsetTop,bottom:e.parentElement.clientHeight-e.clientHeight-e.offsetTop,height:e.clientHeight};return n?{left:0,right:0,width:0,top:r.top,bottom:r.bottom,height:r.height}:{left:r.left,right:r.right,width:r.width,top:0,bottom:0,height:0}},is=function(e){return e!==void 0?"".concat(e,"px"):void 0};function fee(t){var e=t.prefixCls,n=t.containerRef,r=t.value,i=t.getValueIndex,s=t.motionName,o=t.onMotionStart,a=t.onMotionEnd,l=t.direction,c=t.vertical,d=c===void 0?!1:c,u=m.useRef(null),f=m.useState(r),h=Re(f,2),p=h[0],g=h[1],v=function(B){var j,z=i(B),q=(j=n.current)===null||j===void 0?void 0:j.querySelectorAll(".".concat(e,"-item"))[z];return(q==null?void 0:q.offsetParent)&&q},b=m.useState(null),w=Re(b,2),C=w[0],x=w[1],R=m.useState(null),O=Re(R,2),T=O[0],S=O[1];wn(function(){if(p!==r){var D=v(p),B=v(r),j=T4(D,d),z=T4(B,d);g(r),x(j),S(z),D&&B?o():a()}},[r]);var _=m.useMemo(function(){if(d){var D;return is((D=C==null?void 0:C.top)!==null&&D!==void 0?D:0)}return is(l==="rtl"?-(C==null?void 0:C.right):C==null?void 0:C.left)},[d,l,C]),A=m.useMemo(function(){if(d){var D;return is((D=T==null?void 0:T.top)!==null&&D!==void 0?D:0)}return is(l==="rtl"?-(T==null?void 0:T.right):T==null?void 0:T.left)},[d,l,T]),$=function(){return d?{transform:"translateY(var(--thumb-start-top))",height:"var(--thumb-start-height)"}:{transform:"translateX(var(--thumb-start-left))",width:"var(--thumb-start-width)"}},E=function(){return d?{transform:"translateY(var(--thumb-active-top))",height:"var(--thumb-active-height)"}:{transform:"translateX(var(--thumb-active-left))",width:"var(--thumb-active-width)"}},I=function(){x(null),S(null),a()};return!C||!T?null:m.createElement(Yo,{visible:!0,motionName:s,motionAppear:!0,onAppearStart:$,onAppearActive:E,onVisibleChanged:I},function(D,B){var j=D.className,z=D.style,q=ee(ee({},z),{},{"--thumb-start-left":_,"--thumb-start-width":is(C==null?void 0:C.width),"--thumb-active-left":A,"--thumb-active-width":is(T
588==null?void 0:T.width),"--thumb-start-top":_,"--thumb-start-height":is(C==null?void 0:C.height),"--thumb-active-top":A,"--thumb-active-height":is(T==null?void 0:T.height)}),ne={ref:Yi(u,B),style:q,className:Le("".concat(e,"-thumb"),j)};return m.createElement("div",ne)})}var hee=["prefixCls","direction","vertical","options","disabled","defaultValue","value","name","onChange","className","motionName"];function pee(t){if(typeof t.title<"u")return t.title;if(vt(t.label)!=="object"){var e;return(e=t.label)===null||e===void 0?void 0:e.toString()}}function mee(t){return t.map(function(e){if(vt(e)==="object"&&e!==null){var n=pee(e);return ee(ee({},e),{},{title:n})}return{label:e==null?void 0:e.toString(),title:e==null?void 0:e.toString(),value:e}})}var gee=function(e){var n=e.prefixCls,r=e.className,i=e.disabled,s=e.checked,o=e.label,a=e.title,l=e.value,c=e.name,d=e.onChange,u=e.onFocus,f=e.onBlur,h=e.onKeyDown,p=e.onKeyUp,g=e.onMouseDown,v=function(w){i||d(w,l)};return m.createElement("label",{className:Le(r,Y({},"".concat(n,"-item-disabled"),i)),onMouseDown:g},m.createElement("input",{name:c,className:"".concat(n,"-item-input"),type:"radio",disabled:i,checked:s,onChange:v,onFocus:u,onBlur:f,onKeyDown:h,onKeyUp:p}),m.createElement("div",{className:"".concat(n,"-item-label"),title:a},o))},vee=m.forwardRef(function(t,e){var n,r=t.prefixCls,i=r===void 0?"rc-segmented":r,s=t.direction,o=t.vertical,a=t.options,l=a===void 0?[]:a,c=t.disabled,d=t.defaultValue,u=t.value,f=t.name,h=t.onChange,p=t.className,g=p===void 0?"":p,v=t.motionName,b=v===void 0?"thumb-motion":v,w=cn(t,hee),C=m.useRef(null),x=m.useMemo(function(){return Yi(C,e)},[C,e]),R=m.useMemo(function(){return mee(l)},[l]),O=Ho((n=R[0])===null||n===void 0?void 0:n.value,{value:u,defaultValue:d}),T=Re(O,2),S=T[0],_=T[1],A=m.useState(!1),$=Re(A,2),E=$[0],I=$[1],D=function(ge,le){_(le),h==null||h(le)},B=Cs(w,["children"]),j=m.useState(!1),z=Re(j,2),q=z[0],ne=z[1],Z=m.useState(!1),J=Re(Z,2),de=J[0],X=J[1],V=function(){X(!0)},te=function(){X(!1)},ie=function(){ne(!1)},ce=function(ge){ge.key==="Tab"&&ne(!0)},ae=function(ge){var le=R.findIndex(function(he){return he.value===S}),fe=R.length,Se=(le+ge+fe)%fe,G=R[Se];G&&(_(G.value),h==null||h(G.value))},ve=function(ge){switch(ge.key){case"ArrowLeft":case"ArrowUp":ae(-1);break;case"ArrowRight":case"ArrowDown":ae(1);break}};return m.createElement("div",yt({role:"radiogroup","aria-label":"segmented control",tabIndex:c?void 0:0,"aria-orientation":o?"vertical":"horizontal"},B,{className:Le(i,Y(Y(Y({},"".concat(i,"-rtl"),s==="rtl"),"".concat(i,"-disabled"),c),"".concat(i,"-vertical"),o),g),ref:x}),m.createElement("div",{className:"".concat(i,"-group")},m.createElement(fee,{vertical:o,prefixCls:i,value:S,containerRef:C,motionName:"".concat(i,"-").concat(b),direction:s,getValueIndex:function(ge){return R.findIndex(function(le){return le.value===ge})},onMotionStart:function(){I(!0)},onMotionEnd:function(){I(!1)}}),R.map(function(xe){return m.createElement(gee,yt({},xe,{name:f,key:xe.value,prefixCls:i,className:Le(xe.className,"".concat(i,"-item"),Y(Y({},"".concat(i,"-item-selected"),xe.value===S&&!E),"".concat(i,"-item-focused"),de&&q&&xe.value===S)),checked:xe.value===S,onChange:D,onFocus:V,onBlur:te,onKeyDown:ve,onKeyUp:ce,onMouseDown:ie,disabled:!!c||!!xe.disabled}))})))}),bee=vee;function R4(t,e){return{[`${t}, ${t}:hover, ${t}:focus`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}}function I4(t){return{background:t.itemSelectedBg,boxShadow:t.boxShadowTertiary}}const yee=Object.assign({overflow:"hidden"},Qh),wee=t=>{const{componentCls:e}=t,n=t.calc(t.controlHeight).sub(t.calc(t.trackPadding).mul(2)).equal(),r=t.calc(t.controlHeightLG).sub(t.calc(t.trackPadding).mul(2)).equal(),i=t.calc(t.controlHeightSM).sub(t.calc(t.trackPadding).mul(2)).equal();return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},za(t)),{display:"inline-block",padding:t.trackPadding,color:t.itemColor,background:t.trackBg,borderRadius:t.borderRadius,transition:`all ${t.motionDurationMid}`}),Zp(t)),{[`${e}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",flexDirection:"row",width:"100%"},[`&${e}-rtl`]:{direction:"rtl"},[`&${e}-vertical`]:{[`${e}-group`]:{flexDirection:"column"},[`${e}-thumb`]:{width:"100%",height:0,padding:`0 ${Qe(t.paddingXXS)}`}},[`&${e}-block`]:{display:"flex"},[`&${e}-block ${e}-item`]:{flex:1,minWidth:0},[`${e}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${t.motionDurationMid}`,borderRadius:t.borderRadiusSM,transform:"translateZ(0)","&-selected":Object.assign(Object.assign({},I4(t)),{color:t.itemSelectedColor}),"&-focused":K8(t),"&::after":{content:'""',position:"absolute",zIndex:-1,width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",opacity:0,transition:`opacity ${t.motionDurationMid}, background-color ${t.motionDurationMid}`,pointerEvents:"none"},[`&:not(${e}-item-selected):not(${e}-item-disabled)`]:{"&:hover, &:active":{color:t.itemHoverColor},"&:hover::after":{opacity:1,backgroundColor:t.itemHoverBg},"&:active::after":{opacity:1,backgroundColor:t.itemActiveBg}},"&-label":Object.assign({minHeight:n,lineHeight:Qe(n),padding:`0 ${Qe(t.segmentedPaddingHorizontal)}`},yee),"&-icon + *":{marginInlineStart:t.calc(t.marginSM).div(2).equal()}
588,"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${e}-thumb`]:Object.assign(Object.assign({},I4(t)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${Qe(t.paddingXXS)} 0`,borderRadius:t.borderRadiusSM,[`& ~ ${e}-item:not(${e}-item-selected):not(${e}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${e}-lg`]:{borderRadius:t.borderRadiusLG,[`${e}-item-label`]:{minHeight:r,lineHeight:Qe(r),padding:`0 ${Qe(t.segmentedPaddingHorizontal)}`,fontSize:t.fontSizeLG},[`${e}-item, ${e}-thumb`]:{borderRadius:t.borderRadius}},[`&${e}-sm`]:{borderRadius:t.borderRadiusSM,[`${e}-item-label`]:{minHeight:i,lineHeight:Qe(i),padding:`0 ${Qe(t.segmentedPaddingHorizontalSM)}`},[`${e}-item, ${e}-thumb`]:{borderRadius:t.borderRadiusXS}}}),R4(`&-disabled ${e}-item`,t)),R4(`${e}-item-disabled`,t)),{[`${e}-thumb-motion-appear-active`]:{transition:`transform ${t.motionDurationSlow} ${t.motionEaseInOut}, width ${t.motionDurationSlow} ${t.motionEaseInOut}`,willChange:"transform, width"},[`&${e}-shape-round`]:{borderRadius:9999,[`${e}-item, ${e}-thumb`]:{borderRadius:9999}}})}},See=t=>{const{colorTextLabel:e,colorText:n,colorFillSecondary:r,colorBgElevated:i,colorFill:s,lineWidthBold:o,colorBgLayout:a}=t;return{trackPadding:o,trackBg:a,itemColor:e,itemHoverColor:n,itemHoverBg:r,itemSelectedBg:i,itemActiveBg:s,itemSelectedColor:n}},Cee=pi("Segmented",t=>{const{lineWidth:e,calc:n}=t,r=jn(t,{segmentedPaddingHorizontal:n(t.controlPaddingHorizontal).sub(e).equal(),segmentedPaddingHorizontalSM:n(t.controlPaddingHorizontalSM).sub(e).equal()});return wee(r)},See);var A4=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function xee(t){return typeof t=="object"&&!!(t!=null&&t.icon)}const $ee=m.forwardRef((t,e)=>{const n=s2(),{prefixCls:r,className:i,rootClassName:s,block:o,options:a=[],size:l="middle",style:c,vertical:d,shape:u="default",name:f=n}=t,h=A4(t,["prefixCls","className","rootClassName","block","options","size","style","vertical","shape","name"]),{getPrefixCls:p,direction:g,className:v,style:b}=Ha("segmented"),w=p("segmented",r),[C,x,R]=Cee(w),O=Qo(l),T=m.useMemo(()=>a.map(A=>{if(xee(A)){const{icon:$,label:E}=A,I=A4(A,["icon","label"]);return Object.assign(Object.assign({},I),{label:m.createElement(m.Fragment,null,m.createElement("span",{className:`${w}-item-icon`},$),E&&m.createElement("span",null,E))})}return A}),[a,w]),S=Le(i,s,v,{[`${w}-block`]:o,[`${w}-sm`]:O==="small",[`${w}-lg`]:O==="large",[`${w}-vertical`]:d,[`${w}-shape-${u}`]:u==="round"},x,R),_=Object.assign(Object.assign({},b),c);return C(m.createElement(bee,Object.assign({},h,{name:f,className:S,style:_,options:T,ref:e,prefixCls:w,direction:g,vertical:d})))}),Eee=$ee;function Tee(t){return!!(t.addonBefore||t.addonAfter)}function Ree(t){return!!(t.prefix||t.suffix||t.allowClear)}function O4(t,e,n){var r=e.cloneNode(!0),i=Object.create(t,{target:{value:r},currentTarget:{value:r}});return r.value=n,typeof e.selectionStart=="number"&&typeof e.selectionEnd=="number"&&(r.selectionStart=e.selectionStart,r.selectionEnd=e.selectionEnd),r.setSelectionRange=function(){e.setSelectionRange.apply(e,arguments)},i}function lp(t,e,n,r){if(n){var i=e;if(e.type==="click"){i=O4(e,t,""),n(i);return}if(t.type!=="file"&&r!==void 0){i=O4(e,t,r),n(i);return}n(i)}}function HT(t,e){if(t){t.focus(e);var n=e||{},r=n.cursor;if(r){var i=t.value.length;switch(r){case"start":t.setSelectionRange(0,0);break;case"end":t.setSelectionRange(i,i);break;default:t.setSelectionRange(0,i)}}}}var zT=Te.forwardRef(function(t,e){var n,r,i,s=t.inputElement,o=t.children,a=t.prefixCls,l=t.prefix,c=t.suffix,d=t.addonBefore,u=t.addonAfter,f=t.className,h=t.style,p=t.disabled,g=t.readOnly,v=t.focused,b=t.triggerFocus,w=t.allowClear,C=t.value,x=t.handleReset,R=t.hidden,O=t.classes,T=t.classNames,S=t.dataAttrs,_=t.styles,A=t.components,$=t.onClear,E=o??s,I=(A==null?void 0:A.affixWrapper)||"span",D=(A==null?void 0:A.groupWrapper)||"span",B=(A==null?void 0:A.wrapper)||"span",j=(A==null?void 0:A.groupAddon)||"span",z=m.useRef(null),q=function(G){var he;(he=z.current)!==null&&he!==void 0&&he.contains(G.target)&&(b==null||b())},ne=Ree(t),Z=m.cloneElement(E,{value:C,className:Le((n=E.props)===null||n===void 0?void 0:n.className,!ne&&(T==null?void 0:T.variant))||null}),J=m.useRef(null);if(Te.useImperativeHandle(e,function(){return{nativeElement:J.current||z.current}}),ne){var de=null;if(w){var X=!p&&!g&&C,V="".concat(a,"-clear-icon"),te=vt(w)==="object"&&w!==null&&w!==void 0&&w.clearIcon?
588w.clearIcon:"✖";de=Te.createElement("button",{type:"button",tabIndex:-1,onClick:function(G){x==null||x(G),$==null||$()},onMouseDown:function(G){return G.preventDefault()},className:Le(V,Y(Y({},"".concat(V,"-hidden"),!X),"".concat(V,"-has-suffix"),!!c))},te)}var ie="".concat(a,"-affix-wrapper"),ce=Le(ie,Y(Y(Y(Y(Y({},"".concat(a,"-disabled"),p),"".concat(ie,"-disabled"),p),"".concat(ie,"-focused"),v),"".concat(ie,"-readonly"),g),"".concat(ie,"-input-with-clear-btn"),c&&w&&C),O==null?void 0:O.affixWrapper,T==null?void 0:T.affixWrapper,T==null?void 0:T.variant),ae=(c||w)&&Te.createElement("span",{className:Le("".concat(a,"-suffix"),T==null?void 0:T.suffix),style:_==null?void 0:_.suffix},de,c);Z=Te.createElement(I,yt({className:ce,style:_==null?void 0:_.affixWrapper,onClick:q},S==null?void 0:S.affixWrapper,{ref:z}),l&&Te.createElement("span",{className:Le("".concat(a,"-prefix"),T==null?void 0:T.prefix),style:_==null?void 0:_.prefix},l),Z,ae)}if(Tee(t)){var ve="".concat(a,"-group"),xe="".concat(ve,"-addon"),ge="".concat(ve,"-wrapper"),le=Le("".concat(a,"-wrapper"),ve,O==null?void 0:O.wrapper,T==null?void 0:T.wrapper),fe=Le(ge,Y({},"".concat(ge,"-disabled"),p),O==null?void 0:O.group,T==null?void 0:T.groupWrapper);Z=Te.createElement(D,{className:fe,ref:J},Te.createElement(B,{className:le},d&&Te.createElement(j,{className:xe},d),Z,u&&Te.createElement(j,{className:xe},u)))}return Te.cloneElement(Z,{className:Le((r=Z.props)===null||r===void 0?void 0:r.className,f)||null,style:ee(ee({},(i=Z.props)===null||i===void 0?void 0:i.style),h),hidden:R})}),Iee=["show"];function qT(t,e){return m.useMemo(function(){var n={};e&&(n.show=vt(e)==="object"&&e.formatter?e.formatter:!!e),n=ee(ee({},n),t);var r=n,i=r.show,s=cn(r,Iee);return ee(ee({},s),{},{show:!!i,showFormatter:typeof i=="function"?i:void 0,strategy:s.strategy||function(o){return o.length}})},[t,e])}var Aee=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Oee=m.forwardRef(function(t,e){var n=t.autoComplete,r=t.onChange,i=t.onF
588ocus,s=t.onBlur,o=t.onPressEnter,a=t.onKeyDown,l=t.onKeyUp,c=t.prefixCls,d=c===void 0?"rc-input":c,u=t.disabled,f=t.htmlSize,h=t.className,p=t.maxLength,g=t.suffix,v=t.showCount,b=t.count,w=t.type,C=w===void 0?"text":w,x=t.classes,R=t.classNames,O=t.styles,T=t.onCompositionStart,S=t.onCompositionEnd,_=cn(t,Aee),A=m.useState(!1),$=Re(A,2),E=$[0],I=$[1],D=m.useRef(!1),B=m.useRef(!1),j=m.useRef(null),z=m.useRef(null),q=function(Ne){j.current&&HT(j.current,Ne)},ne=Ho(t.defaultValue,{value:t.value}),Z=Re(ne,2),J=Z[0],de=Z[1],X=J==null?"":String(J),V=m.useState(null),te=Re(V,2),ie=te[0],ce=te[1],ae=qT(b,v),ve=ae.max||p,xe=ae.strategy(X),ge=!!ve&&xe>ve;m.useImperativeHandle(e,function(){var ze;return{focus:q,blur:function(){var tt;(tt=j.current)===null||tt===void 0||tt.blur()},setSelectionRange:function(tt,pt,gt){var y;(y=j.current)===null||y===void 0||y.setSelectionRange(tt,pt,gt)},select:function(){var tt;(tt=j.current)===null||tt===void 0||tt.select()},input:j.current,nativeElement:((ze=z.current)===null||ze===void 0?void 0:ze.nativeElement)||j.current}}),m.useEffect(function(){B.current&&(B.current=!1),I(function(ze){return ze&&u?!1:ze})},[u]);var le=function(Ne,tt,pt){var gt=tt;if(!D.current&&ae.exceedFormatter&&ae.max&&ae.strategy(tt)>ae.max){if(gt=ae.exceedFormatter(tt,{max:ae.max}),tt!==gt){var y,K;ce([((y=j.current)===null||y===void 0?void 0:y.selectionStart)||0,((K=j.current)===null||K===void 0?void 0:K.selectionEnd)||0])}}else if(pt.source==="compositionEnd")return;de(gt),j.current&&lp(j.current,Ne,r,gt)};m.useEffect(function(){if(ie){var ze;(ze=j.current)===null||ze===void 0||ze.setSelectionRange.apply(ze,st(ie))}},[ie]);var fe=function(Ne){le(Ne,Ne.target.value,{source:"change"})},Se=function(Ne){D.current=!1,le(Ne,Ne.currentTarget.value,{source:"compositionEnd"}),S==null||S(Ne)},G=function(Ne){o&&Ne.key==="Enter"&&!B.current&&(B.current=!0,o(Ne)),a==null||a(Ne)},he=function(Ne){Ne.key==="Enter"&&(B.current=!1),l==null||l(Ne)},Ee=function(Ne){I(!0),i==null||i(Ne)},Ie=function(Ne){B.current&&(B.current=!1),I(!1),s==null||s(Ne)},ke=function(Ne){de(""),q(),j.current&&lp(j.current,Ne,r)},De=ge&&"".concat(d,"-out-of-range"),He=function(){var Ne=Cs(t,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return Te.createElement("input",yt({autoComplete:n},Ne,{onChange:fe,onFocus:Ee,onBlur:Ie,onKeyDown:G,onKeyUp:he,className:Le(d,Y({},"".concat(d,"-disabled"),u),R==null?void 0:R.input),style:O==null?void 0:O.input,ref:j,size:f,type:C,onCompositionStart:function(pt){D.current=!0,T==null||T(pt)},onCompositionEnd:Se}))},Je=function(){var Ne=Number(ve)>0;if(g||ae.show){var tt=ae.showFormatter?ae.showFormatter({value:X,count:xe,maxLength:ve}):"".concat(xe).concat(Ne?" / ".concat(ve):"");return Te.createElement(Te.Fragment,null,ae.show&&Te.createElement("span",{className:Le("".concat(d,"-show-count-suffix"),Y({},"".concat(d,"-show-count-has-suffix"),!!g),R==null?void 0:R.count),style:ee({},O==null?void 0:O.count)},tt),g)}return null};return Te.createElement(zT,yt({},_,{prefixCls:d,className:Le(h,De),handleReset:ke,value:X,focused:E,triggerFocus:q,suffix:Je(),disabled:u,classes:x,classNames:R,styles:O,ref:z}),He())});const UT=t=>{let e;return typeof t=="object"&&(t!=null&&t.clearIcon)?e=t:t&&(e={clearIcon:Te.createElement(e2,null)}),e};function VT(t,e){const n=m.useRef([]),r=()=>{n.current.push(setTimeout(()=>{var i,s,o,a;!((i=t.current)===null||i===void 0)&&i.input&&((s=t.current)===null||s===void 0?void 0:s.input.getAttribute("type"))==="password"&&(!((o=t.current)===null||o===void 0)&&o.input.hasAttribute("value"))&&((a=t.current)===null||a===void 0||a.input.removeAttribute("value"))}))};return m.useEffect(()=>(e&&r(),()=>n.current.forEach(i=>{i&&clearTimeout(i)})),[]),r}function kee(t){return!!(t.prefix||t.suffix||t.allowClear||t.showCount)}var Nee=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const g0=m.forwardRef((t,e)=>{const{prefixCls:n,bordered:r=!0,status:i,size:s,disabled:o,onBlur:a,onFocus:l,suffix:c,allowClear:d,addonAfter:u,addonBefore:f,className:h,style:p,styles:g,rootClassName:v,onCh
588ange:b,classNames:w,variant:C,_skipAddonWarning:x}=t,R=Nee(t,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant","_skipAddonWarning"]),{getPrefixCls:O,direction:T,allowClear:S,autoComplete:_,className:A,style:$,classNames:E,styles:I}=Ha("input"),D=O("input",n),B=m.useRef(null),j=hu(D),[z,q,ne]=FT(D,v),[Z]=BT(D,j),{compactSize:J,compactItemClassnames:de}=mu(D,T),X=Qo(ke=>{var De;return(De=s??J)!==null&&De!==void 0?De:ke}),V=Te.useContext(Bo),te=o??V,{status:ie,hasFeedback:ce,feedbackIcon:ae}=m.useContext(Gs),ve=h0(ie,i),xe=kee(t)||!!ce;m.useRef(xe);const ge=VT(B,!0),le=ke=>{ge(),a==null||a(ke)},fe=ke=>{ge(),l==null||l(ke)},Se=ke=>{ge(),b==null||b(ke)},G=(ce||c)&&Te.createElement(Te.Fragment,null,c,ce&&ae),he=UT(d??S),[Ee,Ie]=u2("input",C,r);return z(Z(Te.createElement(Oee,Object.assign({ref:Yi(e,B),prefixCls:D,autoComplete:_},R,{disabled:te,onBlur:le,onFocus:fe,style:Object.assign(Object.assign({},$),p),styles:Object.assign(Object.assign({},I),g),suffix:G,allowClear:he,className:Le(h,v,ne,j,de,A),onChange:Se,addonBefore:f&&Te.createElement(sp,{form:!0,space:!0},f),addonAfter:u&&Te.createElement(sp,{form:!0,space:!0},u),classNames:Object.assign(Object.assign(Object.assign({},w),E),{input:Le({[`${D}-sm`]:X==="small",[`${D}-lg`]:X==="large",[`${D}-rtl`]:T==="rtl"},w==null?void 0:w.input,E.input,q),variant:Le({[`${D}-${Ee}`]:Ie},ap(D,ve)),affixWrapper:Le({[`${D}-affix-wrapper-sm`]:X==="small",[`${D}-affix-wrapper-lg`]:X==="large",[`${D}-affix-wrapper-rtl`]:T==="rtl"},q),wrapper:Le({[`${D}-group-rtl`]:T==="rtl"},q),groupWrapper:Le({[`${D}-group-wrapper-sm`]:X==="small",[`${D}-group-wrapper-lg`]:X==="large",[`${D}-group-wrapper-rtl`]:T==="rtl",[`${D}-group-wrapper-${Ee}`]:Ie},ap(`${D}-group-wrapper`,ve,ce),q)})}))))});var _ee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},Pee=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:_ee}))},Mee=m.forwardRef(Pee);const Dee=t=>{const{getPrefixCls:e,direction:n}=m.useContext(ln),{prefixCls:r,className:i}=t,s=e("input-group",r),o=e("input"),[a,l,c]=BT(o),d=Le(s,c,{[`${s}-lg`]:t.size==="large",[`${s}-sm`]:t.size==="small",[`${s}-compact`]:t.compact,[`${s}-rtl`]:n==="rtl"},l,i),u=m.useContext(Gs),f=m.useMemo(()=>Object.assign(Object.assign({},u),{isFormItemInput:!1}),[u]);return a(m.createElement("span",{className:d,style:t.style,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onFocus:t.onFocus,onBlur:t.onBlur},m.createElement(Gs.Provider,{value:f},t.children)))},Lee=t=>{const{componentCls:e,paddingXS:n}=t;return{[e]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:n,[`${e}-input-wrapper`]:{position:"relative",[`${e}-mask-icon`]:{position:"absolute",zIndex:"1",top:"50%",right:"50%",transform:"translate(50%, -50%)",pointerEvents:"none"},[`${e}-mask-input`]:{color:"transparent",caretColor:t.colorText},[`${e}-mask-input[type=number]::-webkit-inner-spin-button`]:{"-webkit-appearance":"none",margin:0},[`${e}-mask-input[type=number]`]:{"-moz-appearance":"textfield"}},"&-rtl":{direction:"rtl"},[`${e}-input`]:{textAlign:"center",paddingInline:t.paddingXXS},[`&${e}-sm ${e}-input`]:{paddingInline:t.calc(t.paddingXXS).div(2).equal()},[`&${e}-lg ${e}-input`]:{paddingInline:t.paddingXS}}}},jee=pi(["Input","OTP"],t=>{const e=jn(t,p0(t));return Lee(e)},m0);var Fee=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Bee=m.forwardRef((t,e)=>{const{className:n,value:r,onChange:i,onActiveChange:s,index:o,mask:a}=t,l=Fee(t,["className","value","onChange","onActiveChange","index","mask"]),{getPrefixCls:c}
588=m.useContext(ln),d=c("otp"),u=typeof a=="string"?a:r,f=m.useRef(null);m.useImperativeHandle(e,()=>f.current);const h=v=>{i(o,v.target.value)},p=()=>{Un(()=>{var v;const b=(v=f.current)===null||v===void 0?void 0:v.input;document.activeElement===b&&b&&b.select()})},g=v=>{const{key:b,ctrlKey:w,metaKey:C}=v;b==="ArrowLeft"?s(o-1):b==="ArrowRight"?s(o+1):b==="z"&&(w||C)?v.preventDefault():b==="Backspace"&&!r&&s(o-1),p()};return m.createElement("span",{className:`${d}-input-wrapper`,role:"presentation"},a&&r!==""&&r!==void 0&&m.createElement("span",{className:`${d}-mask-icon`,"aria-hidden":"true"},u),m.createElement(g0,Object.assign({"aria-label":`OTP Input ${o+1}`,type:a===!0?"password":"text"},l,{ref:f,value:r,onInput:h,onFocus:p,onKeyDown:g,onMouseDown:p,onMouseUp:p,className:Le(n,{[`${d}-mask-input`]:a})})))});var Hee=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function pf(t){return(t||"").split("")}const zee=t=>{const{index:e,prefixCls:n,separator:r}=t,i=typeof r=="function"?r(e):r;return i?m.createElement("span",{className:`${n}-separator`},i):null},qee=m.forwardRef((t,e)=>{const{prefixCls:n,length:r=6,size:i,defaultValue:s,value:o,onChange:a,formatter:l,separator:c,variant:d,disabled:u,status:f,autoFocus:h,mask:p,type:g,onInput:v,inputMode:b}=t,w=Hee(t,["prefixCls","length","size","defaultValue","value","onChange","formatter","separator","variant","disabled","status","autoFocus","mask","type","onInput","inputMode"]),{getPrefixCls:C,direction:x}=m.useContext(ln),R=C("otp",n),O=zo(w,{aria:!0,data:!0,attr:!0}),[T,S,_]=jee(R),A=Qo(V=>i??V),$=m.useContext(Gs),E=h0($.status,f),I=m.useMemo(()=>Object.assign(Object.assign({},$),{status:E,hasFeedback:!1,feedbackIcon:null}),[$,E]),D=m.useRef(null),B=m.useRef({});m.useImperativeHandle(e,()=>({focus:()=>{var V;(V=B.current[0])===null||V===void 0||V.focus()},blur:()=>{var V;for(let te=0;te<r;te+=1)(V=B.current[te])===null||V===void 0||V.blur()},nativeElement:D.current}));const j=V=>l?l(V):V,[z,q]=m.useState(()=>pf(j(s||"")));m.useEffect(()=>{o!==void 0&&q(pf(o))},[o]);const ne=nr(V=>{q(V),v&&v(V),a&&V.length===r&&V.every(te=>te)&&V.some((te,ie)=>z[ie]!==te)&&a(V.join(""))}),Z=nr((V,te)=>{let ie=st(z);for(let ae=0;ae<V;ae+=1)ie[ae]||(ie[ae]="");te.length<=1?ie[V]=te:ie=ie.slice(0,V).concat(pf(te)),ie=ie.slice(0,r);for(let ae=ie.length-1;ae>=0&&!ie[ae];ae-=1)ie.pop();const ce=j(ie.map(ae=>ae||" ").join(""));return ie=pf(ce).map((ae,ve)=>ae===" "&&!ie[ve]?ie[ve]:ae),ie}),J=(V,te)=>{var ie;const ce=Z(V,te),ae=Math.min(V+te.length,r-1);ae!==V&&ce[V]!==void 0&&((ie=B.current[ae])===null||ie===void 0||ie.focus()),ne(ce)},de=V=>{var te;(te=B.current[V])===null||te===void 0||te.focus()},X={variant:d,disabled:u,status:E,mask:p,type:g,inputMode:b};return T(m.createElement("div",Object.assign({},O,{ref:D,className:Le(R,{[`${R}-sm`]:A==="small",[`${R}-lg`]:A==="large",[`${R}-rtl`]:x==="rtl"},_,S),role:"group"}),m.createElement(Gs.Provider,{value:I},Array.from({length:r}).map((V,te)=>{const ie=`otp-${te}`,ce=z[te]||"";return m.createElement(m.Fragment,{key:ie},m.createElement(Bee,Object.assign({ref:ae=>{B.current[te]=ae},index:te,size:A,htmlSize:1,className:`${R}-input`,onChange:J,value:ce,onActiveChange:de,autoFocus:te===0&&h},X)),te<r-1&&m.createElement(zee,{separator:c,index:te,prefixCls:R}))}))))});var Uee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},Vee=function(e,n){return m.createElement(Qr,yt({},e,{ref:n,icon:Uee}))},Wee=m.forwardRef(Vee),Gee=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Kee=t=>t?m.createElement(Mee,null):m.createElement(Wee,null),Xee={click:"onClick",hover:"onMouseOver"},Yee=m.forwardRef((t,e)=>{const{disabled:n,action:r="click",visibilityToggle:i=!0,iconRender:s=Kee,suffix:o}=t,a=m.useContext(Bo),l=n??a,c=typeof i=="object"&&i.visible!==void 0,[d,u]=m.useState(()=>c?i.visible:!1),f=m.useRef(null);m.useEffect(()=>{c&&u(i.visible)},[c,i]);const h=VT(f),p=()=>{var $;if(l)return;d&&h();const E=!d;u(E),typeof i=="object"&&(($=i.onVisibleChange)===null||$===void 0||$.call(i,E))},g=$=>{const E=Xee[r]||"",I=s(d),D={[E]:p,className:`${$}-icon`,key:"passwordIcon",onMouseDown:B=>{B.preventDefault()},onMouseUp:B=>{B.preventDefault()}};return m.cloneElement(m.isValidElement(I)?I:m.createElement("span",null,I),D)},{className:v,prefixCls:b,inputPrefixCls:w,size:C}=t,x=Gee(t,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:R}=m.useContext(ln),O=R("input",w),T=R("input-password",b),S=i&&g(T),_=Le(T,v,{[`${T}-${C}`]:!!C}),A=Object.assign(Object.assign({},Cs(x,["suffix","iconRender","visibilityToggle"])),{type:d?"text":"password",className:_,prefixCls:O,suffix:m.createElement(m.Fragment,null,S,o)});return C&&(A.size=C),m.createElement(g0,Object.assign({ref:Yi(e,f)},A))});var Jee=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Qee=m.forwardRef((t,e)=>{const{prefixCls:n,inputPrefixCls:r,className:i,size:s,suffix:o,enterButton:a=!1,addonAfter:l,loading:c,disabled:d,onSearch:u,onChange:f,onCompositionStart:h,onCompositionEnd:p,variant:g,onPressEnter:v}=t,b=Jee(t,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd","variant","onPressEnter"]),{getPrefixCls:w,direction:C}=m.useContext(ln),x=m.useRef(!1),R=w("input-search",n),O=w("input",r),{compactSize:T}=mu(R,C),S=Qo(X=>{var V;return(V=s??T)!==null&&V!==void 0?V:X}),_=m.useRef(null),A=X=>{X!=null&&X.target&&X.type==="click"&&u&&u(X.target.value,X,{source:"clear"}),f==null||f(X)},$=X=>{var V;document.activeElement===((V=_.current)===null||V===void 0?void 0:V.input)&&X.preventDefault()},E=X=>{var V,te;u&&u((te=(V=_.current)===null||V===void 0?void 0:V.input)===null||te===void 0?void 0:te.value,X,{source:"input"})},I=X=>{x.current||c||(v==null||v(X),E(X))},D=typeof a=="boolean"?m.createElement(kT,null):null,B=`${R}-button`;let j;const z=a||{},q=z.type&&z.type.__ANT_BUTTON===!0;q||z.type==="button"?j=tp(z,Object.assign({onMouseDown:$,onClick:X=>{var V,te;(te=(V=z==null?void 0:z.props)===null||V===void 0?void 0:V.onClick)===null||te===void 0||te.call(V,X),E(X)},key:"enterButton"},q?{className:B,size:S}:{})):j=m.createElement(Ki,{className:B,color:a?"primary":"default",size:S,disabled:d,key:"enterButton",onMouseDown:$,onClick:E,loading:c,icon:D,variant:g==="borderless"||g==="filled"||g==="underlined"?"text":a?"solid":void 0},a),l&&(j=[j,tp(l,{key:"addonAfter"})]);const ne=Le(R,{[`${R}-rtl`]:C==="rtl",[`${R}-${S}`]:!!S,[`${R}-with-button`]:!!a},i),Z=X=>{x.current=!0,h==null||h(X)},J=X=>{x.current=!1,p==null||p(X)},de=Object.assign(Object.assign({},b),{className:ne,prefixCls:O,type:"search",size:S,variant:g,onPressEnter:I,onCompositionStart:Z,onCompositionEnd:J,addonAfter:j,suffix:o,onChange:A,disabled:d,_skipAddonWarning:!0});return m.createElement(g0,Object.assign({ref:Yi(_,e)},de))});var Zee=`
589  min-height:0 !important;
590  max-height:none !important;
591  height:0 !important;
592  visibility:hidden !important;
593  overflow:hidden !important;
594  position:absolute !important;
595  z-index:-1000 !important;
596  top:0 !important;
597  right:0 !important;
598  pointer-events: none !important;
599`,ete=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Xg={},ai;function tte(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&Xg[n])return Xg[n];var r=window.getComputedStyle(t),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),s=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),o=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),a=ete.map(function(c){return"".concat(c,":").concat(r.getPropertyValue(c))}).join(";"),l={sizingStyle:a,paddingSize:s,borderSize:o,boxSizing:i};return e&&n&&(Xg[n]=l),l}function nte(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ai||(ai=document.createElement("textarea"),ai.setAttribute("tab-index","-1"),ai.setAttribute("aria-hidden","true"),ai.setAttribute("name","hiddenTextarea"),document.body.appendChild(ai)),t.getAttribute("wrap")?ai.setAttribute("wrap",t.getAttribute("wrap")):ai.removeAttribute("wrap");var i=tte(t,e),s=i.paddingSize,o=i.borderSize,a=i.boxSizing,l=i.sizingStyle;ai.setAttribute("style","".concat(l,";").concat(Zee)),ai.value=t.value||t.placeholder||"";var c=void 0,d=void 0,u,f=ai.scrollHeight;if(a==="border-box"?f+=o:a==="content-box"&&(f-=s),n!==null||r!==null){ai.value=" ";var h=ai.scrollHeight-s;n!==null&&(c=h*n,a==="border-box"&&(c=c+s+o),f=Math.max(c,f)),r!==null&&(d=h*r,a==="border-box"&&(d=d+s+o),u=f>d?"":"hidden",f=Math.min(d,f))}var p={height:f,overflowY:u,resize:"none"};return c&&(p.minHeight=c),d&&(p.maxHeight=d),p}var rte=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Yg=0,Jg=1,Qg=2,ite=m.forwardRef(function(t,e){var n=t,r=n.prefixCls,i=n.defaultValue,s=n.value,o=n.autoSize,a=n.onResize,l=n.className,c=n.style,d=n.disabled,u=n.onChange;n.onInternalAutoSize;var f=cn(n,rte),h=Ho(i,{value:s,postState:function(X){return X??""}}),p=Re(h,2),g=p[0],v=p[1],b=function(X){v(X.target.value),u==null||u(X)},w=m.useRef();m.useImperativeHandle(e,function(){return{textArea:w.current}});var C=m.useMemo(function(){return o&&vt(o)==="object"?[o.minRows,o.maxRows]:[]},[o]),x=Re(C,2),R=x[0],O=x[1],T=!!o,S=m.useState(Qg),_=Re(S,2),A=_[0],$=_[1],E=m.useState(),I=Re(E,2),D=I[0],B=I[1],j=function(){$(Yg)};wn(function(){T&&j()},[s,R,O,T]),wn(function(){if(A===Yg)$(Jg);else if(A===Jg){var de=nte(w.current,!1,R,O);$(Qg),B(de)}},[A]);var z=m.useRef(),q=function(){Un.cancel(z.current)},ne=function(X){A===Qg&&(a==null||a(X),o&&(q(),z.current=Un(function(){j()})))};m.useEffect(function(){return q},[]);var Z=T?D:null,J=ee(ee({},c),Z);return(A===Yg||A===Jg)&&(J.overflowY="hidden",J.overflowX="hidden"),m.createElement(Xo,{onResize:ne,disabled:!(o||a)},m.createElement("textarea",yt({},f,{ref:w,style:J,className:Le(r,l,Y({},"".concat(r,"-disabled"),d)),disabled:d,value:g,onChange:b})))}),ste=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],ote=Te.forwardRef(function(t,e){var n,r=t.defaultValue,i=t.value,s=t.onF
599ocus,o=t.onBlur,a=t.onChange,l=t.allowClear,c=t.maxLength,d=t.onCompositionStart,u=t.onCompositionEnd,f=t.suffix,h=t.prefixCls,p=h===void 0?"rc-textarea":h,g=t.showCount,v=t.count,b=t.className,w=t.style,C=t.disabled,x=t.hidden,R=t.classNames,O=t.styles,T=t.onResize,S=t.onClear,_=t.onPressEnter,A=t.readOnly,$=t.autoSize,E=t.onKeyDown,I=cn(t,ste),D=Ho(r,{value:i,defaultValue:r}),B=Re(D,2),j=B[0],z=B[1],q=j==null?"":String(j),ne=Te.useState(!1),Z=Re(ne,2),J=Z[0],de=Z[1],X=Te.useRef(!1),V=Te.useState(null),te=Re(V,2),ie=te[0],ce=te[1],ae=m.useRef(null),ve=m.useRef(null),xe=function(){var M;return(M=ve.current)===null||M===void 0?void 0:M.textArea},ge=function(){xe().focus()};m.useImperativeHandle(e,function(){var pe;return{resizableTextArea:ve.current,focus:ge,blur:function(){xe().blur()},nativeElement:((pe=ae.current)===null||pe===void 0?void 0:pe.nativeElement)||xe()}}),m.useEffect(function(){de(function(pe){return!C&&pe})},[C]);var le=Te.useState(null),fe=Re(le,2),Se=fe[0],G=fe[1];Te.useEffect(function(){if(Se){var pe;(pe=xe()).setSelectionRange.apply(pe,st(Se))}},[Se]);var he=qT(v,g),Ee=(n=he.max)!==null&&n!==void 0?n:c,Ie=Number(Ee)>0,ke=he.strategy(q),De=!!Ee&&ke>Ee,He=function(M,L){var ye=L;!X.current&&he.exceedFormatter&&he.max&&he.strategy(L)>he.max&&(ye=he.exceedFormatter(L,{max:he.max}),L!==ye&&G([xe().selectionStart||0,xe().selectionEnd||0])),z(ye),lp(M.currentTarget,M,a,ye)},Je=function(M){X.current=!0,d==null||d(M)},ze=function(M){X.current=!1,He(M,M.currentTarget.value),u==null||u(M)},Ne=function(M){He(M,M.target.value)},tt=function(M){M.key==="Enter"&&_&&_(M),E==null||E(M)},pt=function(M){de(!0),s==null||s(M)},gt=function(M){de(!1),o==null||o(M)},y=function(M){z(""),ge(),lp(xe(),M,a)},K=f,W;he.show&&(he.showFormatter?W=he.showFormatter({value:q,count:ke,maxLength:Ee}):W="".concat(ke).concat(Ie?" / ".concat(Ee):""),K=Te.createElement(Te.Fragment,null,K,Te.createElement("span",{className:Le("".concat(p,"-data-count"),R==null?void 0:R.count),style:O==null?void 0:O.count},W)));var re=function(M){var L;T==null||T(M),(L=xe())!==null&&L!==void 0&&L.style.height&&ce(!0)},se=!$&&!g&&!l;return Te.createElement(zT,{ref:ae,value:q,allowClear:l,handleReset:y,suffix:K,prefixCls:p,classNames:ee(ee({},R),{},{affixWrapper:Le(R==null?void 0:R.affixWrapper,Y(Y({},"".concat(p,"-show-count"),g),"".concat(p,"-textarea-allow-clear"),l))}),disabled:C,focused:J,className:Le(b,De&&"".concat(p,"-out-of-range")),style:ee(ee({},w),ie&&!se?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof W=="string"?W:void 0}},hidden:x,readOnly:A,onClear:S},Te.createElement(ite,yt({},I,{autoSize:$,maxLength:c,onKeyDown:tt,onChange:Ne,onFocus:pt,onBlur:gt,onCompositionStart:Je,onCompositionEnd:ze,className:Le(R==null?void 0:R.textarea),style:ee(ee({},O==null?void 0:O.textarea),{},{resize:w==null?void 0:w.resize}),disabled:C,prefixCls:p,onResize:re,ref:ve,readOnly:A})))});const ate=t=>{const{componentCls:e,paddingLG:n}=t,r=`${e}-textarea`;return{[`textarea${e}`]:{maxWidth:"100%",height:"auto",minHeight:t.controlHeight,lineHeight:t.lineHeight,verticalAlign:"bottom",transition:`all ${t.motionDurationSlow}`,resize:"vertical",[`&${e}-mouse-active`]:{transition:`all ${t.motionDurationSlow}, height 0s, width 0s`}},[`${e}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[r]:{position:"relative","&-show-count":{[`${e}-data-count`]:{position:"absolute",bottom:t.calc(t.fontSize).mul(t.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:t.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`
600        &-allow-clear > ${e},
601        &-affix-wrapper${r}-has-feedback ${e}
602      `]:{paddingInlineEnd:n},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:t.calc(t.controlHeight).sub(t.calc(t.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:t.paddingInline,insetBlockStart:t.paddingXS},[`${r}-suffix`]:{position:"absolute",top:0,insetInlineEnd:t.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${e}-affix-wrapper-rtl`]:{[`${e}-suffix`]:{[`${e}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${e}-affix-wrapper-sm`]:{[`${e}-suffix`]:{[`${e}-clear-icon`]:{insetInlineEnd:t.paddingInlineSM}}}}}},lte=pi(["Input","TextArea"],t=>{const e=jn(t,p0(t));return ate(e)},m0,{resetFont:!1});var cte=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const dte=m.forwardRef((t,e)=>{var n;const{prefixCls:r,bordered:i=!0,size:s,disabled:o,status:a,allowClear:l,classNames:c,rootClassName:d,className:u,style:f,styles:h,variant:p,showCount:g,onMouseDown:v,onResize:b}=t,w=cte(t,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant","showCount","onMouseDown","onResize"]),{getPrefixCls:C,direction:x,allowClear:R,autoComplete:O,className:T,style:S,classNames:_,styles:A}=Ha("textArea"),$=m.useContext(Bo),E=o??$,{status:I,hasFeedback:D,feedbackIcon:B}=m.useContext(Gs),j=h0(I,a),z=m.useRef(null);m.useImperativeHandle(e,()=>{var he;return{resizableTextArea:(he=z.current)===null||he===void 0?void 0:he.resizableTextArea,focus:Ee=>{var Ie,ke;HT((ke=(Ie=z.current)===null||Ie===void 0?void 0:Ie.resizableTextArea)===null||ke===void 0?void 0:ke.textArea,Ee)},blur:()=>{var Ee;return(Ee=z.current)===null||Ee===void 0?void 0:Ee.blur()}}});const q=C("input",r),ne=hu(q),[Z,J,de]=FT(q,d),[X]=lte(q,ne),{compactSize:V,compactItemClassnames:te}=mu(q,x),ie=Qo(he=>{var Ee;return(Ee=s??V)!==null&&Ee!==void 0?Ee:he}),[ce,ae]=u2("textArea",p,i),ve=UT(l??R),[xe,ge]=m.useState(!1),[le,fe]=m.useState(!1),Se=he=>{ge(!0),v==null||v(he);const Ee=()=>{ge(!1),document.removeEventListener("mouseup",Ee)};document.addEventListener("mouseup",Ee)},G=he=>{var Ee,Ie;if(b==null||b(he),xe&&typeof getComputedStyle=="function"){const ke=(Ie=(Ee=z.current)===null||Ee===void 0?void 0:Ee.nativeElement)===null||Ie===void 0?void 0:Ie.querySelector("textarea");ke&&getComputedStyle(ke).resize==="both"&&fe(!0)}};return Z(X(m.createElement(ote,Object.assign({autoComplete:O},w,{style:Object.assign(Object.assign({},S),f),styles:Object.assign(Object.assign({},A),h),disabled:E,allowClear:ve,className:Le(de,ne,u,d,te,T,le&&`${q}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},c),_),{textarea:Le({[`${q}-sm`]:ie==="small",[`${q}-lg`]:ie==="large"},J,c==null?void 0:c.textarea,_.textarea,xe&&`${q}-mouse-active`),variant:Le({[`${q}-${ce}`]:ae},ap(q,j)),affixWrapper:Le(`${q}-textarea-affix-wrapper`,{[`${q}-affix-wrapper-rtl`]:x==="rtl",[`${q}-affix-wrapper-sm`]:ie==="small",[`${q}-affix-wrapper-lg`]:ie==="large",[`${q}-textarea-show-count`]:g||((n=t.count)===null||n===void 0?void 0:n.show)},J)}),prefixCls:q,suffix:D&&m.createElement("span",{className:`${q}-textarea-suffix`},B),showCount:g,ref:z,onResize:G,onMouseDown:Se}))))}),Va=g0;Va.Group=Dee;Va.Search=Qee;
602Va.TextArea=dte;Va.Password=Yee;Va.OTP=qee;var ute=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const fte=t=>{const{prefixCls:e,className:n,closeIcon:r,closable:i,type:s,title:o,children:a,footer:l}=t,c=ute(t,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:d}=m.useContext(ln),u=d(),f=e||d("modal"),h=hu(u),[p,g,v]=eT(f,h),b=`${f}-confirm`;let w={};return s?w={closable:i??!1,title:"",footer:"",children:m.createElement(nT,Object.assign({},t,{prefixCls:f,confirmPrefixCls:b,rootPrefixCls:u,content:a}))}:w={closable:i??!0,title:o,footer:l!==null&&m.createElement(Y7,Object.assign({},t)),children:a},p(m.createElement(F7,Object.assign({prefixCls:f,className:Le(g,`${f}-pure-panel`,s&&b,s&&`${b}-${s}`,n,v,h)},c,{closeIcon:X7(f,r),closable:i},w)))},hte=uT(fte);function WT(t){return yu(oT(t))}const Ni=tT;Ni.useModal=OJ;Ni.info=function(e){return yu(aT(e))};Ni.success=function(e){return yu(lT(e))};Ni.error=function(e){return yu(cT(e))};Ni.warning=WT;Ni.warn=WT;Ni.confirm=function(e){return yu(dT(e))};Ni.destroyAll=function(){for(;Ca.length;){const e=Ca.pop();e&&e()}};Ni.config=EJ;Ni._InternalPanelDoNotUseOrYouWillBeFired=hte;const kc=20,pte=100,cl=80;function mte({open:t,onClose:e,call:n,botName:r}){const[i,s]=m.useState("connecting"),[o,a]=m.useState(!1),[l,c]=m.useState(!0),[d,u]=m.useState(0),[f,h]=m.useState(0),[p,g]=m.useState(1),[v,b]=m.useState([]),[w,C]=m.useState(!1),x=m.useRef(null),R=m.useRef(null),O=m.useRef(null),T=m.useRef([]),S=m.useRef(0),_=m.useRef(0),A=m.useRef(!1),$=m.useRef(!0),E=m.useRef(1),I=m.useRef(null),D=m.useRef(null),B=le=>{const fe=Math.floor(le/1e3),Se=Math.floor(fe/60),G=fe%60;return`${Se}:${G.toString().padStart(2,"0")}`},j=()=>{if(!R.current){const le=window.AudioContext||window.webkitAudioContext;R.current=new le,O.current=R.current.createGain(),O.current.gain.value=E.current,O.current.connect(R.current.destination)}return R.current};m.useEffect(()=>{E.current=p,O.current&&(O.current.gain.value=p)},[p]);const z=m.useCallback(()=>{const le=T.current;if(le.length===0){b([]);return}const fe=[],Se=Math.max(1,Math.floor(le.length/cl));for(let G=0;G<cl;G++){const he=G*Se,Ee=Math.min(he+Se,le.length);let Ie=0;for(let ke=he;ke<Ee;ke++){const De=le[ke];if(!De)continue;const He=new DataView(De.data);let Je=0;const ze=Math.min(De.data.byteLength/2,50);for(let tt=0;tt<ze;tt+=2)if(tt*2+1<De.data.byteLength){const pt=He.getInt16(tt*2,!0);Je+=Math.abs(pt/32768)}const Ne=Je/(ze/2);Ie=Math.max(Ie,Ne)}fe.push(Math.max(.15,Math.min(1,Ie*1.5)))}b(fe)},[]),q=()=>{const le=R.current;if(!le||!O.current)return;const fe=le.currentTime;for(;!A.current&&S.current<T.current.length&&(_.current<fe&&(_.current=fe),!(_.current>fe+pte/1e3));){const Se=T.current[S.current];if(!Se)break;try{const G=Se.sampleRate||16e3,he=Se.channels||1,Ee=2*he,Ie=Math.floor(Se.data.byteLength/Ee);if(Ie===0){S.current++;continue}const ke=le.createBuffer(he,Ie,G),De=new DataView(Se.data),He=ke.getChannelData(0),Je=he>1?ke.getChannelData(1):He;for(let Ne=0;Ne<Ie;Ne++){const tt=Ne*Ee,pt=tt+2;tt+1<Se.data.byteLength&&(He[Ne]=De.getInt16(tt,!0)/32768),he>1&&pt+1<Se.data.byteLength&&(Je[Ne]=De.getInt16(pt,!0)/32768)}const ze=le.createBufferSource();ze.buffer=ke,ze.connect(O.current),ze.start(_.current),_.current+=ke.duration,S.current++,S.current>=T.current.length&&($.current=!0,c(!0))}catch{S.current++}}},ne=()=>{const le=!A.current;A.current=le,a(le),!le&&R.current&&(_.current=R.current.currentTime)},Z=()=>{S.current=T.current.length,$.current=!0,c(!0),u(T.current.length*kc),!A.current&&R.current&&(_.current=R.current.currentTime)},J=le=>{if(!I.current)return;const fe=I.current.getBoundingClientRect(),Se=le-fe.left,G=Math.max(0,Math.min(100,Se/fe.width*100)),he=Math.floor(G/100*T.current.length);S.current=Math.max(0,Math.min(he,T.current.length));const Ee=S.current>=T.current.length-5;$.current=Ee,c(Ee),u(S.current*kc),R.current&&(_.current=R.current.currentTime)},de=le=>{xe&&(C(!0),J(le.clientX))},X=le=>{!w||!xe||J(le.clientX)},V=()=>{C(!1)},te=le=>{xe&&(C(!0),J(le.touches[0].clientX))},ie=le=>{!w||!xe||J(le.touches[0].clientX)},ce=()=>{C(!1)};m.useEffect(()=>{var Ie;
602if(!t||!(n!=null&&n.callSid)||((Ie=x.current)==null?void 0:Ie.readyState)===WebSocket.OPEN)return;const le=window.location.host,Se=`${window.location.protocol==="https:"?"wss":"ws"}://${le}/api/ws/listen/${n.callSid}`,G=new WebSocket(Se);x.current=G,s("connecting"),G.onopen=()=>{s("connected"),j()},G.onmessage=async ke=>{if(ke.data instanceof Blob){const De=await ke.data.arrayBuffer(),He=D.current,Je={sequence:(He==null?void 0:He.sequence)??T.current.length,data:De,timestamp:(He==null?void 0:He.timestamp)??Date.now(),sampleRate:(He==null?void 0:He.sampleRate)??8e3,channels:(He==null?void 0:He.channels)??2,encoding:(He==null?void 0:He.encoding)??"PCM"};T.current.push(Je),D.current=null;const ze=T.current.length;h(ze*kc),z(),$.current&&!A.current&&u(ze*kc)}else try{const De=JSON.parse(ke.data);switch(De.type){case"connected":s("connected");break;case"historical_chunks":break;case"chunk_metadata":D.current={sequence:De.sequence,timestamp:De.timestamp,sampleRate:De.sampleRate,channels:De.channels,encoding:De.encoding};break;case"call_ended":s("ended");break}}catch{}},G.onerror=()=>s("disconnected"),G.onclose=()=>{s("disconnected")};const he=setInterval(q,50),Ee=setInterval(()=>{!A.current&&$.current&&u(T.current.length*kc)},50);return()=>{var ke,De;G.close(),x.current=null,clearInterval(he),clearInterval(Ee),((ke=R.current)==null?void 0:ke.state)!=="closed"&&((De=R.current)==null||De.close()),R.current=null,O.current=null,T.current=[],S.current=0,_.current=0,A.current=!1,$.current=!0,b([])}},[t,n==null?void 0:n.callSid,z]);const ae=T.current.length>0?S.current/T.current.length*100:0,xe=T.current.length>0,ge=()=>{switch(i){case"connecting":return N.jsx("span",{className:"text-xs text-black/60",children:"Connecting..."});case"connected":return N.jsx("span",{className:"text-xs text-green-600",children:"● Live"});case"ended":return N.jsx("span",{className:"text-xs text-black/60",children:"Recording"});default:return N.jsx("span",{className:"text-xs text-black/60",children:"Disconnected"})}};return n?N.jsxs(Ni,{open:t,onCancel:e,footer:null,closable:!1,width:480,styles:{body:{padding:0}},className:"listen-call-modal",children:[N.jsx("style",{children:`
603        .listen-call-modal .ant-modal-content {
604          border-radius: 0;
605          border: 1px solid black;
606          box-shadow: none;
607        }
608      `}),N.jsxs("div",{className:"bg-white",children:[N.jsxs("div",{className:"px-6 py-4 border-b border-black flex items-center justify-between",children:[N.jsxs("div",{className:"flex items-center gap-3",children:[N.jsx("div",{className:"w-10 h-10 border border-black bg-black flex items-center justify-center text-white",children:N.jsx(M6,{size:20})}),N.jsxs("div",{children:[N.jsx("h3",{className:"text-lg font-bold text-black",children:i==="ended"?"Call Recording":"Live Call"}),N.jsx("p",{className:"text-xs text-black/60",children:ge()})]})]}),N.jsx("button",{onClick:e,className:"w-8 h-8 flex items-center justify-center text-black/40 hover:text-black",children:N.jsx(Ap,{size:18})})]}),N.jsxs("div",{className:"px-6 py-5",children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsx("span",{className:"text-2xl font-mono font-bold text-black",children:B(d)}),N.jsx("span",{className:"text-sm font-mono text-black/40",children:B(f)})]}),N.jsx("div",{ref:I,className:"relative h-20 mb-6 select-none",onMouseDown:de,onMouseMove:X,onMouseUp:V,onMouseLeave:V,onTouchStart:te,onTouchMove:ie,onTouchEnd:ce,style:{cursor:xe?w?"grabbing":"grab":"default",pointerEvents:xe?"auto":"none"},children:N.jsxs("svg",{width:"100%",height:"100%",className:"overflow-visible",children:[v.map((le,fe)=>{const he=fe*5,Ee=Math.max(4,le*64),Ie=40-Ee/2,ke=ae/100*(cl*5),De=he+3<=ke;return N.jsx("rect",{x:he,y:Ie,width:3,height:Ee,fill:De?"#000":"#ddd",rx:1.5,style:{transition:"fill 0.1s ease"}},fe)}),xe&&N.jsxs(N.Fragment,{children:[N.jsx("line",{x1:ae/100*(cl*5),y1:0,x2:ae/100*(cl*5),y2:80,stroke:"#000",strokeWidth:2,style:{transition:"x1 0.05s ease, x2 0.05s ease"}}),N.jsx("circle",{cx:ae/100*(cl*5),cy:40,r:5,fill:"#000",style:{transition:"cx 0.05s ease"}})]})]})}),N.jsxs("div",{className:"flex items-center gap-4",children:[N.jsx("button",{onClick:ne,disabled:!xe,className:`flex items-center justify-center w-14 h-14 border-2 border-black transition-all active:scale-95 ${xe?o?"bg-black text-white hover:bg-black/80":"bg-white text-black hover:bg-black/5":"bg-black/10 text-black/30 cursor-not-allowed"}`,children:o?N.jsx(D6,{size:28,fill:"currentColor"}):N.jsx(hP,{size:28,fill:"currentColor"})}),N.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[N.jsx(MP,{size:20,className:"text-black"}),N.jsx("input",{type:"range",min:0,max:150,value:p*100,onChange:le=>g(Number(le.target.value)/100),disabled:!xe,className:"flex-1 h-1 bg-black/20 rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:bg-black [&::-webkit-slider-thumb]:rounded-full disabled:opacity-50"}),N.jsxs("span",{className:"text-xs font-mono text-black/60 w-10 text-right",children:[Math.round(p*100),"%"]})]}),!l&&xe&&N.jsxs("button",{onClick:Z,className:"flex items-center gap-1 px-3 py-2 text-xs bg-black text-white hover:bg-black/80 active:scale-95 transition-all",children:[N.jsx(AP,{size:12}),"Live"]}),l&&i==="connected"&&N.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-green-600",children:[N.jsxs("span",{className:"relative flex h-2 w-2",children:[N.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-500 opacity-75"}),N.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-green-500"})]}),"LIVE"]})]}),N.jsxs("div",{className:"mt-5 pt-4 border-t border-black/10 flex items-center justify-between text-sm",children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(Qb,{size:14,className:"text-black/40"}),N.jsx("span",{className:"text-black",children:n.name||n.surname?`${n.name||""} ${n.surname||""}`.trim():"Unknown"})]}),N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(_6,{size:14,className:"text-black/40"}),N.jsx("span",{className:"text-black",children:r})]})]})]})]})]}):null}var Oa=(t=>(t.WAIT_REQUEST_CONNECT="WAIT_REQUEST_CONNECT",t.CONNECTED="CONNECTED",t.DISCONNECTED="DISCONNECTED",t))(Oa||{}),dd=(t=>(t.UNREGISTERED="UNREGISTERED",t.REGISTERED="REGISTERED",t))(dd||{});const gte="0.21.1";
608class Wa extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class fb extends Wa{constructor(e){super(e||"Unsupported content type.")}}class jd extends Wa{constructor(e){super(e||"Request pending.")}}class vte extends Wa{constructor(e){super(e||"Unspecified session description handler error.")}}class Zg extends Wa{constructor(){super("The session has terminated.")}}class Nc extends Wa{constructor(e){super(e||"An error occurred during state transition.")}}class bte{constructor(e){this.incomingAckRequest=e}get request(){return this.incomingAckRequest.message}}class yte{constructor(e){this.incomingByeRequest=e}get request(){return this.incomingByeRequest.message}accept(e){return this.incomingByeRequest.accept(e),Promise.resolve()}reject(e){return this.incomingByeRequest.reject(e),Promise.resolve()}}class wte{constructor(e){this.incomingCancelRequest=e}get request(){return this.incomingCancelRequest}}class Fd{constructor(){this.listeners=new Array}addListener(e,n){const r=i=>{this.removeListener(r),e(i)};(n==null?void 0:n.once)===!0?this.listeners.push(r):this.listeners.push(e)}emit(e){this.listeners.slice().forEach(n=>n(e))}removeAllListeners(){this.listeners=[]}removeListener(e){this.listeners=this.listeners.filter(n=>n!==e)}on(e){return this.addListener(e)}off(e){return this.removeListener(e)}once(e){return this.addListener(e,{once:!0})}}class Ste{constructor(e){this.incomingInfoRequest=e}get request(){return this.incomingInfoRequest.message}accept(e){return this.incomingInfoRequest.accept(e),Promise.resolve()}reject(e){return this.incomingInfoRequest.reject(e),Promise.resolve()}}class GT{constructor(e){this.parameters={};for(const n in e)e.hasOwnProperty(n)&&this.setParam(n,e[n])}setParam(e,n){e&&(this.parameters[e.toLowerCase()]=typeof n>"u"||n===null?null:n.toString())}getParam(e){if(e)return this.parameters[e.toLowerCase()]}hasParam(e){return!!(e&&this.parameters[e.toLowerCase()]!==void 0)}deleteParam(e){if(e=e.toLowerCase(),this.hasParam(e)){const n=this.parameters[e];return delete this.parameters[e],n}}clearParams(){this.parameters={}}}class Wr extends GT{constructor(e,n,r){super(r),this.uri=e,this._displayName=n}get friendlyName(){return this.displayName||this.uri.aor}get displayName(){return this._displayName}set displayName(e){this._displayName=e}clone(){return new Wr(this.uri.clone(),this._displayName,JSON.parse(JSON.stringify(this.parameters)))}toString(){let e=this.displayName||this.displayName==="0"?'"'+this.displayName+'" ':"";e+="<"+this.uri.toString()+">";for(const n in this.parameters)this.parameters.hasOwnProperty(n)&&(e+=";"+n,this.parameters[n]!==null&&(e+="="+this.parameters[n]));return e}}class gs extends GT{constructor(e="sip",n,r,i,s,o){if(super(s||{}),this.headers={},!r)throw new TypeError('missing or invalid "host" parameter');for(const a in o)o.hasOwnProperty(a)&&this.setHeader(a,o[a]);this.raw={scheme:e,user:n,host:r,port:i},this.normal={scheme:e.toLowerCase(),user:n,host:r.toLowerCase(),port:i}}get scheme(){return this.normal.scheme}set scheme(e){this.raw.scheme=e,this.normal.scheme=e.toLowerCase()}get user(){return this.normal.user}set user(e){this.normal.user=this.raw.user=e}get host(){return this.normal.host}set host(e){this.raw.host=e,this.normal.host=e.toLowerCase()}get aor(){return this.normal.user+"@"+this.normal.host}get port(){return this.normal.port}set port(e){this.normal.port=this.raw.port=e}setHeader(e,n){this.headers[this.headerize(e)]=n instanceof Array?n:[n]}getHeader(e){if(e)return this.headers[this.headerize(e)]}hasHeader(e){return!!e&&!!this.headers.hasOwnProperty(this.headerize(e))}deleteHeader(e){if(e=this.headerize(e),this.headers.hasOwnProperty(e)){const n=this.headers[e];return delete this.headers[e],n}}clearHeaders(){this.headers={}}clone(){return new gs(this._raw.scheme,this._raw.user||"",this._raw.host,this._raw.port,JSON.parse(JSON.stringify(this.parameters)),JSON.parse(JSON.stringify(this.headers)))}toRaw(){return this._toString(this._raw)}toString(){return this._toString(this._normal)}get _normal(){return this.normal}get _raw(){return this.raw}
608_toString(e){let n=e.scheme+":";e.scheme.toLowerCase().match("^sips?$")||(n+="//"),e.user&&(n+=this.escapeUser(e.user)+"@"),n+=e.host,(e.port||e.port===0)&&(n+=":"+e.port);for(const i in this.parameters)this.parameters.hasOwnProperty(i)&&(n+=";"+i,this.parameters[i]!==null&&(n+="="+this.parameters[i]));const r=[];for(const i in this.headers)if(this.headers.hasOwnProperty(i))for(const s in this.headers[i])this.headers[i].hasOwnProperty(s)&&r.push(i+"="+this.headers[i][s]);return r.length>0&&(n+="?"+r.join("&")),n}escapeUser(e){let n;try{n=decodeURIComponent(e)}catch(r){throw r}return encodeURIComponent(n).replace(/%3A/ig,":").replace(/%2B/ig,"+").replace(/%3F/ig,"?").replace(/%2F/ig,"/")}headerize(e){const n={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},r=e.toLowerCase().replace(/_/g,"-").split("-"),i=r.length;let s="";for(let o=0;o<i;o++)o!==0&&(s+="-"),s+=r[o].charAt(0).toUpperCase()+r[o].substring(1);return n[s]&&(s=n[s]),s}}function k4(t,e){if(t.scheme!==e.scheme||t.user!==e.user||t.host!==e.host||t.port!==e.port)return!1;function n(s,o){const a=Object.keys(s.parameters),l=Object.keys(o.parameters);return!(!a.filter(c=>l.includes(c)).every(c=>s.parameters[c]===o.parameters[c])||!["user","ttl","method","transport"].every(c=>s.hasParam(c)&&o.hasParam(c)||!s.hasParam(c)&&!o.hasParam(c))||!["maddr"].every(c=>s.hasParam(c)&&o.hasParam(c)||!s.hasParam(c)&&!o.hasParam(c)))}if(!n(t,e))return!1;const r=Object.keys(t.headers),i=Object.keys(e.headers);if(r.length!==0||i.length!==0){if(r.length!==i.length)return!1;const s=r.filter(o=>i.includes(o));if(s.length!==i.length||!s.every(o=>t.headers[o].length&&e.headers[o].length&&t.headers[o][0]===e.headers[o][0]))return!1}return!0}function e1(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}class Pl extends Error{constructor(e,n,r,i){super(),this.message=e,this.expected=n,this.found=r,this.location=i,this.name="SyntaxError",typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf(this,Pl.prototype):this.__proto__=Pl.prototype,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Pl)}static buildMessage(e,n){function r(c){return c.charCodeAt(0).toString(16).toUpperCase()}function i(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,d=>"\\x0"+r(d)).replace(/[\x10-\x1F\x7F-\x9F]/g,d=>"\\x"+r(d))}function s(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,d=>"\\x0"+r(d)).replace(/[\x10-\x1F\x7F-\x9F]/g,d=>"\\x"+r(d))}function o(c){switch(c.type){case"literal":return'"'+i(c.text)+'"';case"class":const d=c.parts.map(u=>Array.isArray(u)?s(u[0])+"-"+s(u[1]):s(u));return"["+(c.inverted?"^":"")+d+"]";case"any":return"any character";case"end":return"end of input";case"other":return c.description}}function a(c){const d=c.map(o);let u,f;if(d.sort(),d.length>0){for(u=1,f=1;u<d.length;u++)d[u-1]!==d[u]&&(d[f]=d[u],f++);d.length=f}switch(d.length){case 1:return d[0];case 2:return d[0]+" or "+d[1];default:return d.slice(0,-1).join(", ")+", or "+d[d.length-1]}}function l(c){return c?'"'+i(c)+'"':"end of input"}return"Expected "+a(e)+" but "+l(n)+" found."}format(e){let n="Error: "+this.message;if(this.location){let r=null,i;for(i=0;i<e.length;i++)if(e[i].source===this.location.source){r=e[i].text.split(/\r\n|\n|\r/g);break}let s=this.location.start,o=this.location.source+":"+s.line+":"+s.column;if(r){let a=this.location.end,l=e1("",s.line.toString().length," "),c=r[s.line-1],d=s.line===a.line?a.column:c.length+1;n+=`
609 --> `+o+`
610`+l+` |
611`+s.line+" | "+c+`
612`+l+" | "+e1("",s.column-1," ")+e1("",d-s.column,"^")}else n+=`
613 at `+o}return n}}function Cte(t,e){e=e!==void 0?e:{};const n={},r=e.grammarSource,i={Contact:119,Name_Addr_Header:156,Record_Route:176,Request_Response:81,SIP_URI:45,Subscription_State:186,Supported:191,Require:182,Via:194,absoluteURI:84,Call_ID:118,Content_Disposition:130,Content_Length:135,Content_Type:136,CSeq:146,displayName:122,Event:149,From:151,host:52,Max_Forwards:154,Min_SE:213,Proxy_Authenticate:157,quoted_string:40,Refer_To:178,Replaces:179,Session_Expires:210,stun_URI:217,To:192,turn_
613URI:223,uuid:226,WWW_Authenticate:209,challenge:158,sipfrag:230,Referred_By:231};let s=119;const o=[`\r
614`,b(`\r
615`,!1),/^[0-9]/,w([["0","9"]],!1,!1),/^[a-zA-Z]/,w([["a","z"],["A","Z"]],!1,!1),/^[0-9a-fA-F]/,w([["0","9"],["a","f"],["A","F"]],!1,!1),/^[\0-\xFF]/,w([["\0","ÿ"]],!1,!1),/^["]/,w(['"'],!1,!1)," ",b(" ",!1),"	",b("	",!1),/^[a-zA-Z0-9]/,w([["a","z"],["A","Z"],["0","9"]],!1,!1),";",b(";",!1),"/",b("/",!1),"?",b("?",!1),":",b(":",!1),"@",b("@",!1),"&",b("&",!1),"=",b("=",!1),"+",b("+",!1),"$",b("$",!1),",",b(",",!1),"-",b("-",!1),"_",b("_",!1),".",b(".",!1),"!",b("!",!1),"~",b("~",!1),"*",b("*",!1),"'",b("'",!1),"(",b("(",!1),")",b(")",!1),"%",b("%",!1),function(){return" "},function(){return":"},/^[!-~]/,w([["!","~"]],!1,!1),/^[\x80-\uFFFF]/,w([["€","ï¿¿"]],!1,!1),/^[\x80-\xBF]/,w([["€","¿"]],!1,!1),/^[a-f]/,w([["a","f"]],!1,!1),"`",b("`",!1),"<",b("<",!1),">",b(">",!1),"\\",b("\\",!1),"[",b("[",!1),"]",b("]",!1),"{",b("{",!1),"}",b("}",!1),function(){return"*"},function(){return"/"},function(){return"="},function(){return"("},function(){return")"},function(){return">"},function(){return"<"},function(){return","},function(){return";"},function(){return":"},function(){return'"'},/^[!-']/,w([["!","'"]],!1,!1),/^[*-[]/,w([["*","["]],!1,!1),/^[\]-~]/,w([["]","~"]],!1,!1),function($){return $},/^[#-[]/,w([["#","["]],!1,!1),/^[\0-\t]/,w([["\0","	"]],!1,!1),/^[\v-\f]/,w([["\v","\f"]],!1,!1),/^[\x0E-\x7F]/,w([["�","�"]],!1,!1),function(){e=e||{data:{}},e.data.uri=new gs(e.data.scheme,e.data.user,e.data.host,e.data.port),delete e.data.scheme,delete e.data.user,delete e.data.host,delete e.data.host_type,delete e.data.port},function(){e=e||{data:{}},e.data.uri=new gs(e.data.scheme,e.data.user,e.data.host,e.data.port,e.data.uri_params,e.data.uri_headers),delete e.data.scheme,delete e.data.user,delete e.data.host,delete e.data.host_type,delete e.data.port,delete e.data.uri_params,e.startRule==="SIP_URI"&&(e.data=e.data.uri)},"sips",b("sips",!0),"sip",b("sip",!0),function($){e=e||{data:{}},e.data.scheme=$},function(){e=e||{data:{}},e.data.user=decodeURIComponent(g().slice(0,-1))},function(){e=e||{data:{}},e.data.password=g()},function(){return e=e||{data:{}},e.data.host=g(),e.data.host},function(){return e=e||{data:{}},e.data.host_type="domain",g()},/^[a-zA-Z0-9_\-]/,w([["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),/^[a-zA-Z0-9\-]/,w([["a","z"],["A","Z"],["0","9"],"-"],!1,!1),function(){return e=e||{data:{}},e.data.host_type="IPv6",g()},"::",b("::",!1),function(){return e=e||{data:{}},e.data.host_type="IPv6",g()},function(){return e=e||{data:{}},e.data.host_type="IPv4",g()},"25",b("25",!1),/^[0-5]/,w([["0","5"]],!1,!1),"2",b("2",!1),/^[0-4]/,w([["0","4"]],!1,!1),"1",b("1",!1),/^[1-9]/,w([["1","9"]],!1,!1),function($){return e=e||{data:{}},$=parseInt($.join("")),e.data.port=$,$},"transport=",b("transport=",!0),"udp",b("udp",!0),"tcp",b("tcp",!0),"sctp",b("sctp",!0),"tls",b("tls",!0),function($){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.transport=$.toLowerCase()},"user=",b("user=",!0),"phone",b("phone",!0),"ip",b("ip",!0),function($){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.user=$.toLowerCase()},"method=",b("method=",!0),function($){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.method=$},"ttl=",b("ttl=",!0),function($){e=e||{data:{}},e.data.params||(e.data.params={}),e.data.params.ttl=$},"maddr=",b("maddr=",!0),function($){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.maddr=$},"lr",b("lr",!0),function(){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.lr=void 0},function($,E){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),E===null?E=void 0:E=E[1],e.data.uri_params[$.toLowerCase()]=E},function($,E){$=$.join("").toLowerCase(),E=E.join(""),e=e||{data:{}},e.data.uri_headers||(e.data.uri_headers={}),e.data.uri_headers[$]?e.data.uri_headers[$].push(E):e.data.uri_headers[$]=[E]},function(){e=e||{data:{}},e.startRule==="Refer_To"&&(e.data.uri=new gs(e.data.scheme,e.data.user,e.data.host,e.data.port,e.data.uri_params,e.data.uri_headers),delete e.data.scheme,delete e.data.user,delete e.data.host,delete e.data.host_type,delete e.data.port,delete e.data.uri_params)},"//",b("//",!1),function(){e=e||{data:{}},e.data.scheme=g()},b("SIP",!0),function(){e=e||{data:{}},e.data.sip_version=g()},"INVITE",b("INVITE",!1),"ACK",b("ACK",!1),"VXACH",b("VXACH",!1),"OPTIONS",b("OPTIONS",!1),"BYE",b("BYE",!1),"CANCEL",b("CANCEL",!1),"REGISTER",b("REGISTER",!1),"SUBSCRIBE",b("SUBSCRIBE",!1),"NOTIFY",b("NOTIFY",!1),"REFER",b("REFER",!1),"PUBLISH",b("PUBLISH",!1),function(){return e=e||{data:{}},e.data.method=g(),e.data.method},function($){e=e||{data:{}},e.data.status_code=parseInt($.join(""))},function(){e=e||{data:{}},e.data.reason_phrase=g()},function(){e=e||{data:{}},e.data=g()},function(){var $,E;for(e=e||{data:{}},E=e.data.multi_header.length,$=0;$<E;$++)if(e.data.multi_header[$].parsed===null){e.data=null;break}e.data!==null?e.data=e.data.multi_header:e.data=-1},function(){var $;e=e||{data:{}},e.data.multi_header||(e.data.multi_header=[]);try{$=new Wr(e.data.uri,e.data.displayName,e.data.params),delete e.data.uri,delete e.data.displayName,delete e.data.params}catch{$=null}e.data.multi_header.push({position:l,offset:v().start.offset,parsed:$})},function($){$=g().trim(),$[0]==='"'&&($=$.substring(1,$.length-1)),e=e||{data:{}},e.data.displayName=$},"q",b("q",!0),function($){e=e||{data:{}},e.data.params||(e.data.params={}),e.data.params.q=$},"expires",b("expires",!0),function($){e=e||{data:{}},e.data.params||(e.data.params={}),e.data.params.expires=$},function($){return parseInt($.join(""))}
615,"0",b("0",!1),function(){return parseFloat(g())},function($,E){e=e||{data:{}},e.data.params||(e.data.params={}),E===null?E=void 0:E=E[1],e.data.params[$.toLowerCase()]=E},"render",b("render",!0),"session",b("session",!0),"icon",b("icon",!0),"alert",b("alert",!0),function(){e=e||{data:{}},e.startRule==="Content_Disposition"&&(e.data.type=g().toLowerCase())},"handling",b("handling",!0),"optional",b("optional",!0),"required",b("required",!0),function($){e=e||{data:{}},e.data=parseInt($.join(""))},function(){e=e||{data:{}},e.data=g()},"text",b("text",!0),"image",b("image",!0),"audio",b("audio",!0),"video",b("video",!0),"application",b("application",!0),"message",b("message",!0),"multipart",b("multipart",!0),"x-",b("x-",!0),function($){e=e||{data:{}},e.data.value=parseInt($.join(""))},function($){e=e||{data:{}},e.data=$},function($){e=e||{data:{}},e.data.event=$.toLowerCase()},function(){e=e||{data:{}};var $=e.data.tag;e.data=new Wr(e.data.uri,e.data.displayName,e.data.params),$&&e.data.setParam("tag",$)},"tag",b("tag",!0),function($){e=e||{data:{}},e.data.tag=$},function($){e=e||{data:{}},e.data=parseInt($.join(""))},function($){e=e||{data:{}},e.data=$},function(){e=e||{data:{}},e.data=new Wr(e.data.uri,e.data.displayName,e.data.params)},"digest",b("Digest",!0),"realm",b("realm",!0),function($){e=e||{data:{}},e.data.realm=$},"domain",b("domain",!0),"nonce",b("nonce",!0),function($){e=e||{data:{}},e.data.nonce=$},"opaque",b("opaque",!0),function($){e=e||{data:{}},e.data.opaque=$},"stale",b("stale",!0),"true",b("true",!0),function(){e=e||{data:{}},e.data.stale=!0},"false",b("false",!0),function(){e=e||{data:{}},e.data.stale=!1},"algorithm",b("algorithm",!0),"md5",b("MD5",!0),"md5-sess",b("MD5-sess",!0),function($){e=e||{data:{}},e.data.algorithm=$.toUpperCase()},"qop",b("qop",!0),"auth-int",b("auth-int",!0),"auth",b("auth",!0),function($){e=e||{data:{}},e.data.qop||(e.data.qop=[]),e.data.qop.push($.toLowerCase())},function($){e=e||{data:{}},e.data.value=parseInt($.join(""))},function(){var $,E;for(e=e||{data:{}},E=e.data.multi_header.length,$=0;$<E;$++)if(e.data.multi_header[$].parsed===null){e.data=null;break}e.data!==null?e.data=e.data.multi_header:e.data=-1},function(){var $;e=e||{data:{}},e.data.multi_header||(e.data.multi_header=[]);try{$=new Wr(e.data.uri,e.data.displayName,e.data.params),delete e.data.uri,delete e.data.displayName,delete e.data.params}catch{$=null}e.data.multi_header.push({position:l,offset:v().start.offset,parsed:$})},function(){e=e||{data:{}},e.data=new Wr(e.data.uri,e.data.displayName,e.data.params)},function(){e=e||{data:{}},e.data.replaces_from_tag&&e.data.replaces_to_tag||(e.data=-1)},function(){e=e||{data:{}},e.data={call_id:e.data}},"from-tag",b("from-tag",!0),function($){e=e||{data:{}},e.data.replaces_from_tag=$},"to-tag",b("to-tag",!0),function($){e=e||{data:{}},e.data.replaces_to_tag=$},"early-only",b("early-only",!0),function(){e=e||{data:{}},e.data.early_only=!0},function($,E){return E},function($,E){return A($,E)},function($){e=e||{data:{}},e.startRule==="Require"&&(e.data=$||[])},function($){e=e||{data:{}},e.data.value=parseInt($.join(""))},"active",b("active",!0),"pending",b("pending",!0),"terminated",b("terminated",!0),function(){e=e||{data:{}},e.data.state=g()},"reason",b("reason",!0),function($){e=e||{data:{}},typeof $<"u"&&(e.data.reason=$)},function($){e=e||{data:{}},typeof $<"u"&&(e.data.expires=$)},"retry_after",b("retry_after",!0),function($){e=e||{data:{}},typeof $<"u"&&(e.data.retry_after=$)},"deactivated",b("deactivated",!0),"probation",b("probation",!0),"rejected",b("rejected",!0),"timeout",b("timeout",!0),"giveup",b("giveup",!0),"noresource",b("noresource",!0),"invariant",b("invariant",!0),function($){e=e||{data:{}},e.startRule==="Supported"&&(e.data=$||[])},function(){e=e||{data:{}};var $=e.data.tag;e.data=new Wr(e.data.uri,e.data.displayName,e.data.params),$&&e.data.setParam("tag",$)},"ttl",b("ttl",!0),function($){e=e||{data:{}},e.data.ttl=$},"maddr",b("maddr",!0),function($){e=e||{data:{}},e.data.maddr=$},"received",b("received",!0),function($){e=e||{data:{}},e.data.received=$},"branch",b("branch",!0),function($){e=e||{data:{}},e.data.branch=$},"rport",b("rport",!0),function($){e=e||{data:{}},typeof $<"u"&&(e.data.rport=$.join(""))},function($){e=e||{data:{}},e.data.protocol=$},b("UDP",!0),b("TCP",!0),b("TLS",!0),b("SCTP",!0),function($){e=e||{data:{}},e.data.transport=$},function(){e=e||{data:{}},e.data.host=g()},function($){e=e||{data:{}},e.data.port=parseInt($.join(""))},function($){return parseInt($.join(""))},function($){e=e||{data:{}},e.startRule==="Session_Expires"&&(e.data.deltaSeconds=$)},"refresher",b("refresher",!1),"uas",b("uas",!1),"uac",b("uac",!1),function($){e=e||{data:{}},e.startRule==="Session_Expires"&&(e.data.refresher=$)}
615,function($){e=e||{data:{}},e.startRule==="Min_SE"&&(e.data=$)},"stuns",b("stuns",!0),"stun",b("stun",!0),function($){e=e||{data:{}},e.data.scheme=$},function($){e=e||{data:{}},e.data.host=$},"?transport=",b("?transport=",!1),"turns",b("turns",!0),"turn",b("turn",!0),function($){e=e||{data:{}},e.data.transport=$},function(){e=e||{data:{}},e.data=g()},"Referred-By",b("Referred-By",!1),"b",b("b",!1),"cid",b("cid",!1)],a=[S('2 ""6 7!'),S('4"""5!7#'),S('4$""5!7%'),S(`4&""5!7'`),S(";'.# &;("),S('4(""5!7)'),S('4*""5!7+'),S('2,""6,7-'),S('2.""6.7/'),S('40""5!71'),S('22""6273.‰ &24""6475.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""[email protected] &2B""6B7C.) &2D""6D7E'),S(";).# &;,"),S('2F""6F7G.} &2H""6H7I.q &2J""6J7K.e &2L""6L7M.Y &2N""6N7O.M &2P""6P7Q.A &2R""6R7S.5 &2T""6T7U.) &2V""6V7W'),S(`%%2X""6X7Y/5#;#/,$;#/#$+#)(#'#("'#&'#/"!&,)`),S(`%%$;$0#*;$&/,#; /#$+")("'#&'#." &"/=#$;$/&#0#*;$&&&#/'$8":Z" )("'#&'#`),S(';.." &"'),S(`%$;'.# &;(0)*;'.# &;(&/?#28""6879/0$;//'$8#:[# )(#'#("'#&'#`),S(`%%$;2/&#0#*;2&&&#/g#$%$;.0#*;.&/,#;2/#$+")("'#&'#0=*%$;.0#*;.&/,#;2/#$+")("'#&'#&/#$+")("'#&'#/"!&,)`),S('4\\""5!7].# &;3'),S('4^""5!7_'),S('4`""5!7a'),S(';!.) &4b""5!7c'),S('%$;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""[email protected] &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/ž#0›*;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""[email protected] &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),S('%$;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""[email protected] &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/’#0*;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""[email protected] &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),S(`2T""6T7U.ã &2V""6V7W.× &2f""6f7g.Ë &2h""6h7i.¿ &2:""6:7;.³ &2D""6D7E.§ &22""6273.› &28""6879. &2j""6j7k.ƒ &;&.} &24""6475.q &2l""6l7m.e &2n""6n7o.Y &26""6677.M &2>""6>7?.A &2p""6p7q.5 &2r""6r7s.) &;'.# &;(`),S('%$;).Ä« &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s/Ä´#0ı*;).Ä« &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s&&&#/"!&,)'),S(`%;//?#2P""6P7Q/0$;//'$8#:t# )(#'#("'#&'#`),S(`%;//?#24""6475/0$;//'$8#:u# )(#'#("'#&'#`),S(`%;//?#2>""6>7?/0$;//'$8#:v# )(#'#("'#&'#`),S(`%;//?#2T""6T7U/0$;//'$8#:w# )(#'#("'#&'#`),S(`%;//?#2V""6V7W/0$;//'$8#:x# )(#'#("'#&'#`),S(`%2h""6h7i/0#;//'$8":y" )("'#&'#`),S(`%;//6#2f""6f7g/'$8":z" )("'#&'#`),S(`%;//?#2D""6D7E/0$;//'$8#:{# )(#'#("'#&'#`),S(`%;//?#22""6273/0$;//'$8#:|# )(#'#("'#&'#`),S(`%;//?#28""6879/0$;//'$8#:}# )(#'#("'#&'#`),S(`%;//0#;&/'$8":~" )("'#&'#`),S(`%;&/0#;//'$8":~" )("'#&'#`),S(`%;=/T#$;G.) &;K.# &;F0/*;G.) &;K.# &;F&/,$;>/#$+#)(#'#("'#&'#`),S('4�""5!7€.A &4""5!7‚.5 &4ƒ""5!7„.) &;3.# &;.'),S(`%%;//Q#;&/H$$;J.# &;K0)*;J.# &;K&/,$;&/#$+$)($'#(#'#("'#&'#/"!&,)`),S(`%;//]#;&/T$%$;J.# &;K0)*;J.# &;K&/"!&,)/1$;&/($8$:…$!!)($'#(#'#("'#&'#`),S(';..G &2L""6L7M.; &4†""5!7‡./ &4ƒ""5!7„.# &;3'),S(`%2j""6j7k/J#4ˆ""5!7‰.5 &4Š""5!7‹.) &4Œ""5!7/#$+")("'#&'#`),S(`%;N/M#28""6879/>$;O." &"/0$;S/'$8$:Ž$ )($'#(#'#("'#&'#`),S(`%;N/d#28""6879/U$;O." &"/G$;S/>$;_/5$;l." &"/'$8&:& )(&'#(%'#($'#(#'#("'#&'#`),S(`%3""5$7‘.) &3’""5#7“/' 8!:”!! )`),S(`%;P/]#%28""6879/,#;R/#$+")("'#&'#." &"/6$2:""6:7;/'$8#:•# )(#'#("'#&'#`),S("$;+.) &;-.# &;Q/2#0/*;+.) &;-.# &;Q&&&#"),S('2<""6<7=.q &2>""6>
6157?.e &2@""[email protected] &2B""6B7C.M &2D""6D7E.A &22""6273.5 &26""6677.) &24""6475'),S('%$;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""[email protected] &2B""6B7C.) &2D""6D7E0e*;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""[email protected] &2B""6B7C.) &2D""6D7E&/& 8!:–! )'),S(`%;T/J#%28""6879/,#;^/#$+")("'#&'#." &"/#$+")("'#&'#`),S("%;U.) &;\\.# &;X/& 8!:—! )"),S(`%$%;V/2#2J""6J7K/#$+")("'#&'#0<*%;V/2#2J""6J7K/#$+")("'#&'#&/D#;W/;$2J""6J7K." &"/'$8#:˜# )(#'#("'#&'#`),S('$4™""5!7š/,#0)*4™""5!7š&&&#'),S(`%4$""5!7%/?#$4›""5!7œ0)*4›""5!7œ&/#$+")("'#&'#`),S(`%2l""6l7m/?#;Y/6$2n""6n7o/'$8#:# )(#'#("'#&'#`),S(`%%;Z/³#28""6879/¤$;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+-)(-'#(,'#(+'#(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.ސ &%2ž""6ž7Ÿ/¤#;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+,)(,'#(+'#(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.Û¹ &%2ž""6ž7Ÿ/Œ#;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ùº &%2ž""6ž7Ÿ/t#;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#.ؓ &%2ž""6ž7Ÿ/\\#;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+&)(&'#(%'#($'#(#'#("'#&'#.ׄ &%2ž""6ž7Ÿ/D#;Z/;$28""6879/,$;[/#$+$)($'#(#'#("'#&'#.֍ &%2ž""6ž7Ÿ/,#;[/#$+")("'#&'#.Õ® &%2ž""6ž7Ÿ/,#;Z/#$+")("'#&'#.Տ &%;Z/›#2ž""6ž7Ÿ/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$++)(+'#(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ӈ &%;Z/ª#%28""6879/,#;Z/#$+")("'#&'#." &"/ƒ$2ž""6ž7Ÿ/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.а &%;Z/¹#%28""6879/,#;Z/#$+")("'#&'#." &"/’$%28""6879/,#;Z/#$+")("'#&'#." &"/k$2ž""6ž7Ÿ/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+))()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ί &%;Z/È#%28""6879/,#;Z/#$+")("'#&'#." &"/¡$%28""6879/,#;Z/#$+")("'#&'#." &"/z$%28""6879/,#;Z/#$+")("'#&'#." &"/S$2ž""6ž7Ÿ/D$;Z/;$28""6879/,$;[/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#.˕ &%;Z/×#%28""6879/,#;Z/#$+")("'#&'#." &"/°$%28""6879/,#;Z/#$+")("'#&'#." &"/‰$%28""6879/,#;Z/#$+")("'#&'#." &"/b$%28""6879/,#;Z/#$+")("'#&'#." &"/;$2ž""6ž7Ÿ/,$;[/#$+')(''#(&'#(%'#($'#(#'#("'#&'#.ȑ &%;Z/þ#%28""6879/,#;Z/#$+")("'#&'#." &"/×$%28""6879/,#;Z/#$+")("'#&'#." &"/°$%28""6879/,#;Z/#$+")("'#&'#." &"/‰$%28""6879/,#;Z/#$+")("'#&'#." &"/b$%28""6879/,#;Z/#$+")("'#&'#." &"/;$2ž""6ž7Ÿ/,$;Z/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ħ &%;Z/Ĝ#%28""6879/,#;Z/#$+")("'#&'#." &"/õ$%28""6879/,#;Z/#$+")("'#&'#." &"/Î$%28""6879/,#;Z/#$+")("'#&'#." &"/§$%28""6879/,#;Z/#$+")("'#&'#." &"/€$%28""6879/,#;Z/#$+")("'#&'#." &"/Y$%28""6879/,#;Z/#$+")("'#&'#." &"/2$2ž""6ž7Ÿ/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#/& 8!: ! )`),S(`%;#/M#;#." &"/?$;#." &"/1$;#." &"/#$+$)($'#(#'#("'#&'#`),S(`%;Z/;#28""6879/,$;Z/#$+#)(#'#("'#&'#.# &;\\`),S(`%;]/o#2J""6J7K/\`$;]/W$2J""6J7K/H$;]/?$2J""6J7K/0$;]/'$8':¡' )(''#(&'#(%'#($'#(#'#("'#&'#`),S(`%2¢""6¢7£/2#4¤""5!7Â¥/#$+")("'#&'#.˜ &%2¦""6¦7§/;#4¨""5!7©/,$;!/#$+#)(#'#("'#&'#.j &%2ª""6ª7«/5#;!/,$;!/#$+#)(#'#("'#&'#.B &%4¬""5!7­/,#;!/#$+")("'#&'#.# &;!`),S(`%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%'#($'#(#'#("'#&'#/' 8!:®!! )`),S(`$%22""6273/,#;\`/#$+")("'#&'#0<*%22""6273/,#;\`/#$+")("'#&'#&`),S(";a.A &;b.; &;c.5 &;d./ &;e.) &;f.# &;g"),S(`%3¯""5*7°/a#3±""5#7².G &3³""5#7´.; &3µ""5$7¶./ &3·""5#7¸.# &;6/($8":¹"! )("'#&'#`),S(`%3º""5%7»/I#3¼""5%7½./ &3¾""5"7¿.# &;6/($8":À"! )("'#&'#`),S(`%3Á""5'7Â/1#;/($8":Ã"! )("'#&'#`),S(`%3Ä""5$7Å/1#;ð/($8":Æ"! )("'#&'#`),S(`%3Ç""5&7È/1#;T/($8":É"! )("'#&'#`),S(`%3Ê""5"7Ë/N#%2>""6>7?/,#;6/#$+")("'#&'#." &"/'$8":Ì" )("'#&'#`),S(`%;h/P#%2>""6>7?/,#;i/#$+")("'#&'#." &"/)$8":Í""! )("'#&'#`),S('%$;j/&#0#*;j&&&#/"!&,)'),S('%$;j/&#0#*;j&&&#/"!&,)'),S(";k.) &;+.# &;-"),S('2l""6l7m.e &2n""6n7o.Y &24""6475.M &28""6879.A &2<""6<7=.5 &2@""6@7A.) &2B""6B7C'),S(`%26""6677/n#;m/e$$%2<""6<7=/,#;m/#$+")("'#&'#0<*%2<""6<7=/,#;m/#$+")("'#&'#&/#$+#)(#'#("'#&'#`),S(`%;n/A#2>""6>7?/2$;o/)$8#:Î#"" )(#'#("'#&'#`),S("$;p.) &;+.# &;-/2#0/*;p.) &;+.# &;-&&&#"),S("$;p.) &;+.# &;-0/*;p.) &;+.# &;-&"),S('2l""6l7m.e &2n""6n7o.Y &24""6475.M &26""6677.A &28""6879.5 &2@""6@7A.) &2B""6B7C'),S(";‘.# &;r"),S(`%;/G#;'/>$;s/5$;'/,$;„/#$+%)(%'#($'#(#'#("'#&'#`),S(";M.# &;t"),S(`%;�/E#28""6879/6$;u.# &;x/'$8#:Ï# )(#'#("'#&'#`),S(`%;v.# &;w/J#%26""6677/,#;ƒ/#$+")("'#&'#." &"/#$+")("'#&'#`),S(`%2Ð""6Ð7Ñ/:#;€/1$;w." &"/#$+#)(#'#("'#&'#`),S(`%24""6475/,#;{/#$+")("'#&'#`),S(`%;z/3#$;y0#*;y&/#$+")("'#&'#`),S(";*.) &;+.# &;-"),S(';+. &;-.‰ &22""6273.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>
6157?.A &2@""[email protected] &2B""6B7C.) &2D""6D7E'),S(`%;|/e#$%24""6475/,#;|/#$+")("'#&'#0<*%24""6475/,#;|/#$+")("'#&'#&/#$+")("'#&'#`),S(`%$;~0#*;~&/e#$%22""6273/,#;}/#$+")("'#&'#0<*%22""6273/,#;}/#$+")("'#&'#&/#$+")("'#&'#`),S("$;~0#*;~&"),S(';+.w &;-.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""[email protected] &2B""6B7C.) &2D""6D7E'),S(`%%;"/‡#$;".G &;!.A &2@""[email protected] &2F""6F7G.) &2J""6J7K0M*;".G &;!.A &2@""[email protected] &2F""6F7G.) &2J""6J7K&/#$+")("'#&'#/& 8!:Ò! )`),S(";.# &;‚"),S(`%%;O/2#2:""6:7;/#$+")("'#&'#." &"/,#;S/#$+")("'#&'#." &"`),S('$;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A/Œ#0‰*;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A&&&#'),S("$;y0#*;y&"),S(`%3’""5#7Ó/q#24""6475/b$$;!/&#0#*;!&&&#/L$2J""6J7K/=$$;!/&#0#*;!&&&#/'$8%:Ô% )(%'#($'#(#'#("'#&'#`),S('2Õ""6Õ7Ö'),S('2×""6×7Ø'),S('2Ù""6Ù7Ú'),S('2Û""6Û7Ü'),S('2Ý""6Ý7Þ'),S('2ß""6ß7à'),S('2á""6á7â'),S('2ã""6ã7ä'),S('2Ã¥""6Ã¥7æ'),S('2ç""6ç7è'),S('2é""6é7ê'),S("%;….Y &;†.S &;ˆ.M &;‰.G &;Š.A &;‹.; &;Œ.5 &;./ &;.) &;Ž.# &;6/& 8!:ë! )"),S(`%;„/G#;'/>$;’/5$;'/,$;”/#$+%)(%'#($'#(#'#("'#&'#`),S("%;“/' 8!:ì!! )"),S(`%;!/5#;!/,$;!/#$+#)(#'#("'#&'#`),S("%$;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(0G*;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(&/& 8!:í! )"),S(`%;¶/Y#$%;A/,#;¶/#$+")("'#&'#06*%;A/,#;¶/#$+")("'#&'#&/#$+")("'#&'#`),S(`%;9/N#%2:""6:7;/,#;9/#$+")("'#&'#." &"/'$8":î" )("'#&'#`),S(`%;:.c &%;˜/Y#$%;A/,#;˜/#$+")("'#&'#06*%;A/,#;˜/#$+")("'#&'#&/#$+")("'#&'#/& 8!:ï! )`),S(`%;L.# &;™/]#$%;B/,#;›/#$+")("'#&'#06*%;B/,#;›/#$+")("'#&'#&/'$8":ð" )("'#&'#`),S(`%;š." &"/>#;@/5$;M/,$;?/#$+$)($'#(#'#("'#&'#`),S(`%%;6/Y#$%;./,#;6/#$+")("'#&'#06*%;./,#;6/#$+")("'#&'#&/#$+")("'#&'#.# &;H/' 8!:ñ!! )`),S(";œ.) &;.# &; "),S(`%3ò""5!7ó/:#;</1$;Ÿ/($8#:ô#! )(#'#("'#&'#`),S(`%3õ""5'7ö/:#;</1$;ž/($8#:÷#! )(#'#("'#&'#`),S("%$;!/&#0#*;!&&&#/' 8!:ø!! )"),S(`%2ù""6ù7ú/o#%2J""6J7K/M#;!." &"/?$;!." &"/1$;!." &"/#$+$)($'#(#'#("'#&'#." &"/'$8":û" )("'#&'#`),S(`%;6/J#%;</,#;¡/#$+")("'#&'#." &"/)$8":ü""! )("'#&'#`),S(";6.) &;T.# &;H"),S(`%;£/Y#$%;B/,#;¤/#$+")("'#&'#06*%;B/,#;¤/#$+")("'#&'#&/#$+")("'#&'#`),S(`%3ý""5&7þ.G &3ÿ""5'7Ā.; &3ā""5$7Ă./ &3ă""5%7Ą.# &;6/& 8!:ą! )`),S(";Â¥.# &; "),S(`%3Ć""5(7ć/M#;</D$3Ĉ""5(7ĉ./ &3Ċ""5(7ċ.# &;6/#$+#)(#'#("'#&'#`),S(`%;6/Y#$%;A/,#;6/#$+")("'#&'#06*%;A/,#;6/#$+")("'#&'#&/#$+")("'#&'#`),S("%$;!/&#0#*;!&&&#/' 8!:Č!! )"),S("%;©/& 8!:č! )"),S(`%;ª/k#;;/b$;¯/Y$$%;B/,#;°/#$+")("'#&'#06*%;B/,#;°/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),S(";«.# &;¬"),S('3Ď""5$7ď.S &3Đ""5%7đ.G &3Ē""5%7ē.; &3Ĕ""5%7ĕ./ &3Ė""5+7ė.# &;­'),S(`3Ę""5'7ę./ &3Ě""5)7ě.# &;­`),S(";6.# &;®"),S(`%3Ĝ""5"7ĝ/,#;6/#$+")("'#&'#`),S(";­.# &;6"),S(`%;6/5#;</,$;±/#$+#)(#'#("'#&'#`),S(";6.# &;H"),S(`%;³/5#;./,$;/#$+#)(#'#("'#&'#`),S("%$;!/&#0#*;!&&&#/' 8!:Ğ!! )"),S("%;ž/' 8!:ğ!! )"),S(`%;¶/^#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/($8":Ä "!!)("'#&'#`),S(`%%;7/e#$%2J""6J7K/,#;7/#$+")("'#&'#0<*%2J""6J7K/,#;7/#$+")("'#&'#&/#$+")("'#&'#/"!&,)`),S(`%;L.# &;™/]#$%;B/,#;¸/#$+")("'#&'#06*%;B/,#;¸/#$+")("'#&'#&/'$8":Ä¡" )("'#&'#`),S(";¹.# &; "),S(`%3Ä¢""5#7Ä£/:#;</1$;6/($8#:Ĥ#! )(#'#("'#&'#`),S("%$;!/&#0#*;!&&&#/' 8!:Ä¥!! )"),S("%;ž/' 8!:Ħ!! )"),S(`%$;š0#*;š&/x#;@/o$;M/f$;?/]$$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/'$8%:ħ% )(%'#($'#(#'#("'#&'#`),S(";¾"),S(`%3Ĩ""5&7Ä©/k#;./b$;Á/Y$$%;A/,#;Á/#$+")("'#&'#06*%;A/,#;Á/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#.# &;¿`),S(`%;6/k#;./b$;À/Y$$%;A/,#;À/#$+")("'#&'#06*%;A/,#;À/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),S(`%;6/;#;</2$;6.# &;H/#$+#)(#'#("'#&'#`),S(";Â.G &;Ä.A &;Æ.; &;È.5 &;É./ &;Ê.) &;Ë.# &;À"),S(`%3Ī""5%7Ä«/5#;</,$;Ã/#$+#)(#'#("'#&'#`),S("%;I/' 8!:Ĭ!! )"),S(`%3Ä­""5&7Ä®/—#;</Ž$;D/…$;Å/|$$%$;'/&#0#*;'&&&#/,#;Å/#$+")("'#&'#0C*%$;'/&#0#*;'&&&#/,#;Å/#$+")("'#&'#&/,$;E/#$+&)(&'#(%'#($'#(#'#("'#&'#`),S(";t.# &;w"),S(`%3į""5%7İ/5#;</,$;Ç/#$+#)(#'#("'#&'#`),S("%;I/' 8!:ı!! )"),S(`%3IJ""5&7ij/:#;</1$;I/($8#:Ä´#! )(#'#("'#&'#`),S(`%3ĵ""5%7Ķ/]#;</T$%3Ä·""5$7ĸ/& 8!:Ĺ! ).4 &%3ĺ""5%7Ä»/& 8!:ļ! )/#$+#)(#'#("'#&'#`),S(`%3Ľ""5)7ľ/R#;</I$3Ä¿""5#7ŀ./ &3Ł""5(7ł.# &;6/($8#:Ń#! )(#'#("'#&'#`),S(`%3ń""5#7Ņ/“#;</Š$;D/$%;Ì/e#$%2D""6D7E/,#;Ì/#$+")("'#&'#0<*%2D""6D7E/,#;Ì/#$+")("'#&'#&/#$+")("'#&'#/,$;E/#$+%)(%'#($'#(#'#("'#&'#`),S(`%3ņ""5(7Ň./ &3ň""5$7ʼn.# &;6/' 8!:Ŋ!! )`),S(`%;6/Y#$%;A/,#;
6156/#$+")("'#&'#06*%;A/,#;6/#$+")("'#&'#&/#$+")("'#&'#`),S(`%;Ï/G#;./>$;Ï/5$;./,$;/#$+%)(%'#($'#(#'#("'#&'#`),S("%$;!/&#0#*;!&&&#/' 8!:ŋ!! )"),S(`%;Ñ/]#$%;A/,#;Ñ/#$+")("'#&'#06*%;A/,#;Ñ/#$+")("'#&'#&/'$8":Ō" )("'#&'#`),S(`%;™/]#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/'$8":ō" )("'#&'#`),S(`%;L.O &;™.I &%;@." &"/:#;t/1$;?." &"/#$+#)(#'#("'#&'#/]#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/'$8":Ŏ" )("'#&'#`),S(`%;Ô/]#$%;B/,#;Õ/#$+")("'#&'#06*%;B/,#;Õ/#$+")("'#&'#&/'$8":ŏ" )("'#&'#`),S("%;–/& 8!:Ő! )"),S(`%3ő""5(7Œ/:#;</1$;6/($8#:œ#! )(#'#("'#&'#.g &%3Ŕ""5&7ŕ/:#;</1$;6/($8#:Ŗ#! )(#'#("'#&'#.: &%3ŗ""5*7Ř/& 8!:ř! ).# &; `),S(`%%;6/k#$%;A/2#;6/)$8":Ś""$ )("'#&'#0<*%;A/2#;6/)$8":Ś""$ )("'#&'#&/)$8":ś""! )("'#&'#." &"/' 8!:Ŝ!! )`),S(`%;Ø/Y#$%;A/,#;Ø/#$+")("'#&'#06*%;A/,#;Ø/#$+")("'#&'#&/#$+")("'#&'#`),S(`%;™/Y#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/#$+")("'#&'#`),S("%$;!/&#0#*;!&&&#/' 8!:ŝ!! )"),S(`%;Û/Y#$%;B/,#;Ü/#$+")("'#&'#06*%;B/,#;Ü/#$+")("'#&'#&/#$+")("'#&'#`),S(`%3Ş""5&7ş.; &3Å ""5'7Å¡./ &3Å¢""5*7Å£.# &;6/& 8!:Ť! )`),S(`%3Å¥""5&7Ŧ/:#;</1$;Ý/($8#:ŧ#! )(#'#("'#&'#.} &%3õ""5'7ö/:#;</1$;ž/($8#:Ũ#! )(#'#("'#&'#.P &%3Å©""5+7Ū/:#;</1$;ž/($8#:Å«#! )(#'#("'#&'#.# &; `),S(`3Ŭ""5+7Å­.k &3Å®""5)7ů._ &3Ű""5(7ű.S &3Ų""5'7ų.G &3Å´""5&7ŵ.; &3Ŷ""5*7Å·./ &3Ÿ""5)7Ź.# &;6`),S(';1." &"'),S(`%%;6/k#$%;A/2#;6/)$8":Ś""$ )("'#&'#0<*%;A/2#;6/)$8":Ś""$ )("'#&'#&/)$8":ś""! )("'#&'#." &"/' 8!:ź!! )`),S(`%;L.# &;™/]#$%;B/,#;á/#$+")("'#&'#06*%;B/,#;á/#$+")("'#&'#&/'$8":Å»" )("'#&'#`),S(";¹.# &; "),S(`%;ã/Y#$%;A/,#;ã/#$+")("'#&'#06*%;A/,#;ã/#$+")("'#&'#&/#$+")("'#&'#`),S(`%;ê/k#;./b$;í/Y$$%;B/,#;ä/#$+")("'#&'#06*%;B/,#;ä/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),S(";Ã¥.; &;æ.5 &;ç./ &;è.) &;é.# &; "),S(`%3ż""5#7Ž/:#;</1$;ð/($8#:ž#! )(#'#("'#&'#`),S(`%3Å¿""5%7ƀ/:#;</1$;T/($8#:Ɓ#! )(#'#("'#&'#`),S(`%3Ƃ""5(7ƃ/F#;</=$;\\.) &;Y.# &;X/($8#:Ƅ#! )(#'#("'#&'#`),S(`%3ƅ""5&7Ɔ/:#;</1$;6/($8#:Ƈ#! )(#'#("'#&'#`),S(`%3ƈ""5%7Ɖ/A#;</8$$;!0#*;!&/($8#:Ɗ#! )(#'#("'#&'#`),S(`%;ë/G#;;/>$;6/5$;;/,$;ì/#$+%)(%'#($'#(#'#("'#&'#`),S(`%3’""5#7Ó.# &;6/' 8!:Ƌ!! )`),S(`%3±""5#7ƌ.G &3³""5#7ƍ.; &3·""5#7Ǝ./ &3µ""5$7Ə.# &;6/' 8!:Ɛ!! )`),S(`%;î/D#%;C/,#;ï/#$+")("'#&'#." &"/#$+")("'#&'#`),S("%;U.) &;\\.# &;X/& 8!:Ƒ! )"),S(`%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%'#($'#(#'#("'#&'#/' 8!:ƒ!! )`),S(`%%;!/?#;!." &"/1$;!." &"/#$+#)(#'#("'#&'#/' 8!:Ɠ!! )`),S(";¾"),S(`%;ž/^#$%;B/,#;ó/#$+")("'#&'#06*%;B/,#;ó/#$+")("'#&'#&/($8":Ɣ"!!)("'#&'#`),S(";ô.# &; "),S(`%2ƕ""6ƕ7Ɩ/L#;</C$2Ɨ""6Ɨ7Ƙ.) &2ƙ""6ƙ7ƚ/($8#:ƛ#! )(#'#("'#&'#`),S(`%;ž/^#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/($8":Ɯ"!!)("'#&'#`),S(`%;6/5#;0/,$;÷/#$+#)(#'#("'#&'#`),S("$;2.) &;4.# &;.0/*;2.) &;4.# &;.&"),S("$;%0#*;%&"),S(`%;ú/;#28""6879/,$;û/#$+#)(#'#("'#&'#`),S(`%3Ɲ""5%7ƞ.) &3Ɵ""5$7Æ /' 8!:Æ¡!! )`),S(`%;ü/J#%28""6879/,#;^/#$+")("'#&'#." &"/#$+")("'#&'#`),S("%;\\.) &;X.# &;‚/' 8!:Æ¢!! )"),S(';".S &;!.M &2F""6F7G.A &2J""6J7K.5 &2H""6H7I.) &2N""6N7O'),S('2L""6L7M.• &2B""6B7C.‰ &2<""6<7=.} &2R""6R7S.q &2T""6T7U.e &2V""6V7W.Y &2P""6P7Q.M &2@""[email protected] &2D""6D7E.5 &22""6273.) &2>""6>7?'),S(`%;Ā/b#28""6879/S$;û/J$%2Æ£""6Æ£7Ƥ/,#;ì/#$+")("'#&'#." &"/#$+$)($'#(#'#("'#&'#`),S(`%3Æ¥""5%7Ʀ.) &3Ƨ""5$7ƨ/' 8!:Æ¡!! )`),S(`%3±""5#7².6 &3³""5#7´.* &$;+0#*;+&/' 8!:Æ©!! )`),S(`%;Ą/‡#2F""6F7G/x$;ă/o$2F""6F7G/\`$;ă/W$2F""6F7G/H$;ă/?$2F""6F7G/0$;ą/'$8):ƪ) )()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#`),S(`%;#/>#;#/5$;#/,$;#/#$+$)($'#(#'#("'#&'#`),S(`%;ă/,#;ă/#$+")("'#&'#`),S(`%;ă/5#;ă/,$;ă/#$+#)(#'#("'#&'#`),S(`%;q/T#$;m0#*;m&/D$%; /,#;ø/#$+")("'#&'#." &"/#$+#)(#'#("'#&'#`),S(`%2Æ«""6Æ«7Ƭ.) &2Æ­""6Æ­7Æ®/w#;0/n$;Ĉ/e$$%;B/2#;ĉ.# &; /#$+")("'#&'#0<*%;B/2#;ĉ.# &; /#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),S(";™.# &;L"),S(`%2Ư""6Ư7ư/5#;</,$;Ċ/#$+#)(#'#("'#&'#`),S(`%;D/S#;,/J$2:""6:7;/;$;,.# &;T/,$;E/#$+%)(%'#($'#(#'#("'#&'#`)];let l=0,c=0;const d=[{line:1,column:1}];let u=0,f=[],h=0,p;if(e.startRule!==void 0){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');
615s=i[e.startRule]}function g(){return t.substring(c,l)}function v(){return R(c,l)}function b($,E){return{type:"literal",text:$,ignoreCase:E}}function w($,E,I){return{type:"class",parts:$,inverted:E,ignoreCase:I}}function C(){return{type:"end"}}function x($){let E=d[$],I;if(E)return E;for(I=$-1;!d[I];)I--;for(E=d[I],E={line:E.line,column:E.column};I<$;)t.charCodeAt(I)===10?(E.line++,E.column=1):E.column++,I++;return d[$]=E,E}function R($,E){const I=x($),D=x(E);return{source:r,start:{offset:$,line:I.line,column:I.column},end:{offset:E,line:D.line,column:D.column}}}function O($){l<u||(l>u&&(u=l,f=[]),f.push($))}function T($,E,I){return new Pl(Pl.buildMessage($,E),$,E,I)}function S($){return $.split("").map(E=>E.charCodeAt(0)-32)}function _($){const E=a[$];let I=0;const D=[];let B=E.length;const j=[],z=[];let q;for(;;){for(;I<B;)switch(E[I]){case 0:z.push(o[E[I+1]]),I+=2;break;case 1:z.push(void 0),I++;break;case 2:z.push(null),I++;break;case 3:z.push(n),I++;break;case 4:z.push([]),I++;break;case 5:z.push(l),I++;break;case 6:z.pop(),I++;break;case 7:l=z.pop(),I++;break;case 8:z.length-=E[I+1],I+=2;break;case 9:z.splice(-2,1),I++;break;case 10:z[z.length-2].push(z.pop()),I++;break;case 11:z.push(z.splice(z.length-E[I+1],E[I+1])),I+=2;break;case 12:z.push(t.substring(z.pop(),l)),I++;break;case 13:j.push(B),D.push(I+3+E[I+1]+E[I+2]),z[z.length-1]?(B=I+3+E[I+1],I+=3):(B=I+3+E[I+1]+E[I+2],I+=3+E[I+1]);break;case 14:j.push(B),D.push(I+3+E[I+1]+E[I+2]),z[z.length-1]===n?(B=I+3+E[I+1],I+=3):(B=I+3+E[I+1]+E[I+2],I+=3+E[I+1]);break;case 15:j.push(B),D.push(I+3+E[I+1]+E[I+2]),z[z.length-1]!==n?(B=I+3+E[I+1],I+=3):(B=I+3+E[I+1]+E[I+2],I+=3+E[I+1]);break;case 16:z[z.length-1]!==n?(j.push(B),D.push(I),B=I+2+E[I+1],I+=2):I+=2+E[I+1];break;case 17:j.push(B),D.push(I+3+E[I+1]+E[I+2]),t.length>l?(B=I+3+E[I+1],I+=3):(B=I+3+E[I+1]+E[I+2],I+=3+E[I+1]);break;case 18:j.push(B),D.push(I+4+E[I+2]+E[I+3]),t.substr(l,o[E[I+1]].length)===o[E[I+1]]?(B=I+4+E[I+2],I+=4):(B=I+4+E[I+2]+E[I+3],I+=4+E[I+2]);break;case 19:j.push(B),D.push(I+4+E[I+2]+E[I+3]),t.substr(l,o[E[I+1]].length).toLowerCase()===o[E[I+1]]?(B=I+4+E[I+2],I+=4):(B=I+4+E[I+2]+E[I+3],I+=4+E[I+2]);break;case 20:j.push(B),D.push(I+4+E[I+2]+E[I+3]),o[E[I+1]].test(t.charAt(l))?(B=I+4+E[I+2],I+=4):(B=I+4+E[I+2]+E[I+3],I+=4+E[I+2]);break;case 21:z.push(t.substr(l,E[I+1])),l+=E[I+1],I+=2;break;case 22:z.push(o[E[I+1]]),l+=o[E[I+1]].length,I+=2;break;case 23:z.push(n),h===0&&O(o[E[I+1]]),I+=2;break;case 24:c=z[z.length-1-E[I+1]],I+=2;break;case 25:c=l,I++;break;case 26:q=E.slice(I+4,I+4+E[I+3]).map(function(ne){return z[z.length-1-ne]}),z.splice(z.length-E[I+2],E[I+2],o[E[I+1]].apply(null,q)),I+=4+E[I+3];break;case 27:z.push(_(E[I+1])),I+=2;break;case 28:h++,I++;break;case 29:h--,I++;break;default:throw new Error("Invalid opcode: "+E[I]+".")}if(j.length>0)B=j.pop(),I=D.pop();else break}return z[0]}e.data={};function A($,E){return[$].concat(E)}if(p=_(s),p!==n&&l===t.length)return p;throw p!==n&&l<t.length&&O(C()),T(f,u<t.length?t.charAt(u):null,u<t.length?R(u,u+1):R(u,u))}const xte=Cte;var Vn;(function(t){function e(i,s){const o={startRule:s};try{xte(i,o)}catch{o.data=-1}return o.data}t.parse=e;function n(i){const s=t.parse(i,"Name_Addr_Header");return s!==-1?s:void 0}t.nameAddrHeaderParse=n;function r(i){const s=t.parse(i,"SIP_URI");return s!==-1?s:void 0}t.URIParse=r})(Vn=Vn||(Vn={}));const $te={100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"};function xa(t,e=32){let n="";for(let r=0;r<t;r++){const i=Math.floor(Math.random()*e);n+=i.toString(e)}return n}function v0(t){return $te[t]||""}function b0(){return xa(10)}function fs(t){const e={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},n=t.toLowerCase().replace(/_/g,"-").split("-"),r=n.length;let i="";for(let s=0;s<r;s++)s!==0&&(i+="-"),i+=n[s].charAt(0).toUpperCase()+n[s].substring(1);return e[i]&&(i=e[i]),i}function Bd(t){return encodeURIComponent(t).replace(/%[A-F\d]{2}/g,"U").length}class KT{constructor(){this.headers={}}addHeader(e,n){const r={raw:n};e=fs(e),this.headers[e]?this.headers[e].push(r):this.headers[e]=[r]}getHeader(e){const n=this.headers[fs(e)];if(n){if(n[0])return n[0].raw}else return}getHeaders(e){const n=this.headers[fs(e)],r=[];if(!n)return[];for(const i of n)r.push(i.raw);return r}hasHeader(e){return!!this.headers[fs(e)]}parseHeader(e,n=0){if(e=fs(e),this.headers[e]){if(n>=this.headers[e].length)return}else return;const r=this.headers[e][n],i=r.raw;if(r.parsed)return r.parsed;const s=Vn.parse(i,e.replace(/-/g,"_"));if(s===-1){this.headers[e].splice(n,1);return}else return r.parsed=s,s}s(e,n=0){return this.parseHeader(e,n)}setHeader(e,n){this.headers[fs(e)]=[{raw:n}]}toString(){return this.data}}class Ml extends KT{constructor(){super()}}class qo extends KT{constructor(){super()}}class ka{constructor(e,n,r,i,s,o,a){this.headers={},this.extraHeaders=[],this.options=ka.getDefaultOptions(),s&&(this.options=Object.assign(Object.assign({},this.options),s),this.options.optionTags&&this.options.optionTags.length&&(this.options.optionTags=this.options.optionTags.slice()),this.options.routeSet&&this.options.routeSet.length&&(this.options.routeSet=this.options.routeSet.slice())),o&&o.length&&(this.extraHeaders=o.slice()),a&&(this.body={body:a.content,contentType:a.contentType}),this.method=e,this.ruri=n.clone(),this.fromURI=r.clone(),this.fromTag=this.options.fromTag?this.options.fromTag:b0(),this.from=ka.makeNameAddrHeader(this.fromURI,this.options.fromDisplayName,this.fromTag),this.toURI=i.clone(),this.toTag=this.options.toTag,this.to=ka.makeNameAddrHeader(this.toURI,this.options.toDisplayName,this.toTag),this.callId=this.options.callId?this.options.callId:this.options.callIdPrefix+xa(15),this.cseq=this.options.cseq,this.setHeader("route",this.options.routeSet),this.setHeader("via",""),this.setHeader("to",this.to.toString()),this.setHeader("from",this.from.toString()),this.setHeader("cseq",this.cseq+" "+this.method),this.setHeader("call-id",this.callId),this.setHeader("max-forwards","70")}static getDefaultOptions(){return{callId:"",callIdPrefix:"",cseq:1,toDisplayName:"",toTag:"",fromDis
615playName:"",fromTag:"",forceRport:!1,hackViaTcp:!1,optionTags:["outbound"],routeSet:[],userAgentString:"sip.js",viaHost:""}}static makeNameAddrHeader(e,n,r){const i={};return r&&(i.tag=r),new Wr(e,n,i)}getHeader(e){const n=this.headers[fs(e)];if(n){if(n[0])return n[0]}else{const r=new RegExp("^\\s*"+e+"\\s*:","i");for(const i of this.extraHeaders)if(r.test(i))return i.substring(i.indexOf(":")+1).trim()}}getHeaders(e){const n=[],r=this.headers[fs(e)];if(r)for(const i of r)n.push(i);else{const i=new RegExp("^\\s*"+e+"\\s*:","i");for(const s of this.extraHeaders)i.test(s)&&n.push(s.substring(s.indexOf(":")+1).trim())}return n}hasHeader(e){if(this.headers[fs(e)])return!0;{const n=new RegExp("^\\s*"+e+"\\s*:","i");for(const r of this.extraHeaders)if(n.test(r))return!0}return!1}setHeader(e,n){this.headers[fs(e)]=n instanceof Array?n:[n]}setViaHeader(e,n){this.options.hackViaTcp&&(n="TCP");let r="SIP/2.0/"+n;r+=" "+this.options.viaHost+";branch="+e,this.options.forceRport&&(r+=";rport"),this.setHeader("via",r),this.branch=e}toString(){let e="";e+=this.method+" "+this.ruri.toRaw()+` SIP/2.0\r
616`;for(const n in this.headers)if(this.headers[n])for(const r of this.headers[n])e+=n+": "+r+`\r
617`;for(const n of this.extraHeaders)e+=n.trim()+`\r
618`;return e+="Supported: "+this.options.optionTags.join(", ")+`\r
619`,e+="User-Agent: "+this.options.userAgentString+`\r
620`,this.body?typeof this.body=="string"?(e+="Content-Length: "+Bd(this.body)+`\r
621\r
622`,e+=this.body):this.body.body&&this.body.contentType?(e+="Content-Type: "+this.body.contentType+`\r
623`,e+="Content-Length: "+Bd(this.body.body)+`\r
624\r
625`,e+=this.body.body):e+=`Content-Length: 0\r
626\r
627`:e+=`Content-Length: 0\r
628\r
629`,e}}function XT(t){return t==="application/sdp"?"session":"render"}function cp(t){const e=typeof t=="string"?t:t.body,n=typeof t=="string"?"application/sdp":t.contentType;return{contentDisposition:XT(n),contentType:n,content:e}}function YT(t){return t&&typeof t.content=="string"&&typeof t.contentType=="string"&&t.contentDisposition===void 0?!0:typeof t.contentDisposition=="str
629ing"}function ud(t){let e,n,r;if(t instanceof Ml&&t.body){const i=t.parseHeader("Content-Disposition");e=i?i.type:void 0,n=t.parseHeader("Content-Type"),r=t.body}if(t instanceof qo&&t.body){const i=t.parseHeader("Content-Disposition");e=i?i.type:void 0,n=t.parseHeader("Content-Type"),r=t.body}if(t instanceof ka&&t.body)if(e=t.getHeader("Content-Disposition"),n=t.getHeader("Content-Type"),typeof t.body=="string"){if(!n)throw new Error("Header content type header does not equal body content type.");r=t.body}else{if(n&&n!==t.body.contentType)throw new Error("Header content type header does not equal body content type.");n=t.body.contentType,r=t.body.body}if(YT(t)&&(e=t.contentDisposition,n=t.contentType,r=t.content),!!r){if(n&&!e&&(e=XT(n)),!e)throw new Error("Content disposition undefined.");if(!n)throw new Error("Content type undefined.");return{contentDisposition:e,contentType:n,content:r}}}var Ri;(function(t){t.Initial="Initial",t.Early="Early",t.AckWait="AckWait",t.Confirmed="Confirmed",t.Terminated="Terminated"})(Ri=Ri||(Ri={}));var rt;(function(t){t.Initial="Initial",t.HaveLocalOffer="HaveLocalOffer",t.HaveRemoteOffer="HaveRemoteOffer",t.Stable="Stable",t.Closed="Closed"})(rt=rt||(rt={}));const Ps=500,Ete=4e3,N4=5e3,ur={T1:Ps,T2:Ete,TIMER_B:64*Ps,TIMER_D:0*Ps,TIMER_F:64*Ps,TIMER_H:64*Ps,TIMER_I:0*N4,TIMER_J:0*Ps,TIMER_K:0*N4,TIMER_L:64*Ps,TIMER_M:64*Ps,TIMER_N:64*Ps,PROVISIONAL_RESPONSE_INTERVAL:6e4};class wo extends Wa{constructor(e){super(e||"Transaction state error.")}}var ct;(function(t){t.ACK="ACK",t.BYE="BYE",t.CANCEL="CANCEL",t.INFO="INFO",t.INVITE="INVITE",t.MESSAGE="MESSAGE",t.NOTIFY="NOTIFY",t.OPTIONS="OPTIONS",t.REGISTER="REGISTER",t.UPDATE="UPDATE",t.SUBSCRIBE="SUBSCRIBE",t.PUBLISH="PUBLISH",t.REFER="REFER",t.PRACK="PRACK"})(ct=ct||(ct={}));const Ro=[ct.ACK,ct.BYE,ct.CANCEL,ct.INFO,ct.INVITE,ct.MESSAGE,ct.NOTIFY,ct.OPTIONS,ct.PRACK,ct.REFER,ct.REGISTER,ct.SUBSCRIBE];class JT{constructor(e){this.incomingMessageRequest=e}get request(){return this.incomingMessageRequest.message}accept(e){return this.incomingMessageRequest.accept(e),Promise.resolve()}reject(e){return this.incomingMessageRequest.reject(e),Promise.resolve()}}class hb{constructor(e){this.incomingNotifyRequest=e}get request(){return this.incomingNotifyRequest.message}accept(e){return this.incomingNotifyRequest.accept(e),Promise.resolve()}reject(e){return this.incomingNotifyRequest.reject(e),Promise.resolve()}}class Tte{constructor(e,n){this.incomingReferRequest=e,this.session=n}get referTo(){const e=this.incomingReferRequest.message.parseHeader("refer-to");if(!(e instanceof Wr))throw new Error("Failed to parse Refer-To header.");return e}get referredBy(){return this.incomingReferRequest.message.getHeader("referred-by")}get replaces(){const e=this.referTo.uri.getHeader("replaces");return e instanceof Array?e[0]:e}get request(){return this.incomingReferRequest.message}accept(e={statusCode:202}){return this.incomingReferRequest.accept(e),Promise.resolve()}reject(e){return this.incomingReferRequest.reject(e),Promise.resolve()}makeInviter(e){if(this.inviter)return this.inviter;const n=this.referTo.uri.clone();n.clearHeaders(),e=e||{};const r=(e.extraHeaders||[]).slice(),i=this.replaces;i&&r.push("Replaces: "+decodeURIComponent(i));const s=this.referredBy;return s&&r.push("Referred-By: "+s),e.extraHeaders=r,this.inviter=this.session.userAgent._makeInviter(n,e),this.inviter._referred=this.session,this.session._referral=this.inviter,this.inviter}}var Oe;(function(t){t.Initial="Initial",t.Establishing="Establishing",t.Established="Established",t.Terminating="Terminating",t.Terminated="Terminated"})(Oe=Oe||(Oe={}));class Zl{constructor(e,n={}){this.pendingReinvite=!1,this.pendingReinviteAck=!1,this._state=Oe.Initial,this.delegate=n.delegate,this._stateEventEmitter=new Fd,this._userAgent=e}dispose(){switch(this.logger.log(`Session ${this.id} in state ${this._state} is being disposed`),delete this.userAgent._sessions[this.id],this._sessionDescriptionHandler&&this._sessionDescriptionHandler.close(),this.state){case Oe.Initial:break;case Oe.Establishing:break;case Oe.Established:return new Promise(e=>{this._bye({onAccept:()=>e(),onRedirect:()=>e(),onReject:()=>e()})});case Oe.Terminating:break;case Oe.Terminated:break;default:throw new Error("Unknown state.")}return Promise.resolve()}get assertedIdentity(){return this._assertedIdentity}get dialog(){return this._dialog}get id(){return this._id}get replacee(){return this._replacee}get sessionDescriptionHandler(){return this._sessionDescriptionHandler}get sessionDescriptionHandlerFactory(){return this.userAgent.configuration.sessionDescriptionHandlerFactory}get sessionDescriptionHandlerModifiers(){return this._sessionDescriptionHandlerModifiers||[]}set sessionDescriptionHandlerModifiers(e){this._sessionDescriptionHandlerModifiers=e.slice()}get sessionDescriptionHandlerOptions(){return this._sessionDescriptionHandlerOptions||{}}set sessionDescriptionHandlerOptions(e){this._sessionDescriptionHandlerOptions=Object.assign({},e)}get sessionDescriptionHandlerModifiersReInvite(){return this._sessionDescriptionHandlerModifiersReInvite||[]}set sessionDescriptionHandlerModifiersReInvite(e){this._sessionDescriptionHandlerModifiersReInvite=e.slice()}get sessionDescriptionHandlerOptionsReInvite(){return this._sessionDescriptionHandlerOptionsReInvite||{}}set sessionDescriptionHandlerOptionsReInvite(e){this._sessionDescriptionHandlerOptionsReInvite=Object.assign({},e)}get state(){return this._state}get stateChange(){return this._stateEventEmitter}get userAgent(){return this._userAgent}bye(e={}){let n="Session.bye() may only be called if established session.";switch(this.state){case Oe.Initial:typeof this.cancel=="function"?(n+=" However Inviter.invite() has not yet been called.",n+=" Perhaps you should have called Inviter.cancel()?"):typeof this.reject=="function"&&(n+=" However Invitation.accept() has not yet been called.",n+=" Perhaps you should have called Invitation.reject()?");break;case Oe.Establishing:typeof this.cancel=="function"?(n+=" However a dialog does not yet exist.",n+=" Perhaps you should have called Inviter.cancel()?"):typeof this.reject=="function"&&(n+=" However Invitation.accept() has not yet been called (or not yet resolved).",n+=" Perhaps you should have called Invitation.reject()?");break;case Oe.Established:{const r=e.requestDelegate,i=this.copyRequestOptions(e.requestOptions);return this._bye(r,i)}case Oe.Terminating:n+=" However this session is already terminating.",typeof this.cancel=="function"?n+=" Perhaps you have already called Inviter.cancel()?":typeof this.reject=="function"&&(n+=" Perhaps you have already called Session.bye()?");break;case Oe.Terminated:n+=" However this session is already terminated.";break;default:throw new Error("Unknown state")}return this.logger.error(n),Promise.reject(new Error(`Invalid session state ${this.state}`))}info(e={}){if(this.state!==Oe.Established)return this.logger.error("Session.info() may only be called if established session."),Promise.reject(new Error(`Invalid session state ${this.state}`));const n=e.requestDelegate,r=this.copyRequestOptions(e.requestOptions);return this._info(n,r)}invite(e={}){if(this.logger.log("Session.invite"),this.state!==Oe.Established)return Promise.reject(new Error(`Invalid session state ${this.state}`));if(this.pendingReinvite)return Promise.reject(new jd("Reinvite in progress. Please wait until complete, then try again."));this.pendingReinvite=!0,e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiersReInvite=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptionsReInvite=e.sessionDescriptionHandlerOptions);const n={onAccept:s=>{const o=ud(s.message);if(!o){this.logger.error("Received 2xx response to re-INVITE without a session description"),this.ackAndBye(s,400,"Missing session description"),this.stateTransition(Oe.Terminated),this.pendingReinvite=!1;return}if(e.withoutSdp){const a={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.setOfferAndGetAnswer(o,a).then(l=>{s.ack({body:l})}).catch(l=>{this.logger.error("Failed to handle offer in 2xx response to re-INVITE"),this.logger.error(l.message),this.state===Oe.Terminated?s.ack():(this.ackAndBye(s,488,"Bad Media Description"),this.stateTransition(Oe.Terminated))}).then(()=>{this.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(s)})}else{const a={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.setAnswer(o,a).then(()=>{s.ack()}).catch(l=>{this.logger.error("Failed to handle answer in 2xx response to re-INVITE"),this.logger.error(l.message),this.state!==Oe.Terminated?(this.ackAndBye(s,488,"Bad Media Description"),this.stateTransition(Oe.Terminated)):s.ack()}).then(()=>{this.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(s)})}},onProgress:s=>{},onRedirect:s=>{},onReject:s=>{this.logger.warn("Received a non-2xx response to re-INVITE"),this.pendingReinvite=!1,e.withoutSdp?e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(s):this.rollbackOffer().catch(o=>{if(this.logger.error("Failed to rollback offer on non-2xx response to re-INVITE"),this.logger.error(o.message),this.state!==Oe.Terminated){if(!this.dialog)throw new Error("Dialog undefined.");const a=[];a.push("Reason: "+this.getReasonHeaderValue(500,"Internal Server Error")),this.dialog.bye(void 0,{extraHeaders:a}),this.stateTransition(Oe.Terminated)}}).then(()=>{e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(s)})},onTrying:s=>{}},r=e.requestOptions||{};if(r.extraHeaders=(r.extraHeaders||[]).slice(),r.extraHeaders.push("Allow: "+Ro.toString()),r.extraHeaders.push("Contact: "+this._contact),e.withoutSdp){if(!this.dialog)throw this.pendingReinvite=!1,new Error("Dialog undefined.");return Promise.resolve(this.dialog.invite(n,r))}const i={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};return this.getOffer(i).then(s=>{if(!this.dialog)throw this.pendingReinvite=!1,new Error("Dialog undefined.");return r.body=s,this.dialog.invite(n,r)}).catch(s=>{throw this.logger.error(s.message),this.logger.error("Failed to send re-INVITE"),this.pendingReinvite=!1,s})}message(e={}){if(this.state!==Oe.Established)return this.logger.error("Session.message() may only be called if established session."),Promise.reject(new Error(`Invalid session state ${this.state}`));const n=e.requestDelegate,r=this.copyRequestOptions(e.requestOptions);return this._message(n,r)}refer(e,n={}){if(this.state!==Oe.Established)return this.logger.error("Session.refer() may only be called if established session."),Promise.reject(new Error(`Invalid session state ${this.state}`));if(e instanceof Zl&&!e.dialog)return this.logger.error("Session.refer() may only be called with session which is established. You are perhaps attempting to attended transfer to a target for which there is not dialog yet established. Perhaps you are attempting a 'semi-attended' tansfer? Regardless, this is not supported. The recommended approached is to check to see if the target Session is in the Established state before calling refer(); if the state is not Established you may proceed by falling back using a URI as the target (blind transfer)."),Promise.reject(new Error(`Invalid session state ${this.state}`));const r=n.requestDelegate,i=this.copyRequestOptions(n.requestOptions);return i.extraHeaders=i.extraHeaders?i.extraHeaders.concat(this.referExtraHeaders(this.referToString(e))):this.referExtraHeaders(this.referToString(e)),this._refer(n.onNotify,r,i)}_bye(e,n){if(!this.dialog)return Promise.reject(new Error("Session dialog undefined."));const r=this.dialog;switch(r.sessionState){case Ri.Initial:throw new Error(`Invalid dialog state ${r.sessionState}`);case Ri.Early:throw new Error(`Invalid dialog state ${r.sessionState}`);case Ri.AckWait:return this.stateTransition(Oe.Terminating),new Promise(i=>{r.delegate={onAck:()=>{const s=r.bye(e,n);return this.stateTransition(Oe.Terminated),i(s),Promise.resolve()},onAckTimeout:()=>{const s=r.bye(e,n);this.stateTransition(Oe.Terminated),i(s)}}});case Ri.Confirmed:{const i=r.bye(e,n);return this.stateTransition(Oe.Terminated),Promise.resolve(i)}case Ri.Terminated:throw new Error(`Invalid dialog state ${r.sessionState}`);default:throw new Error("Unrecognized state.")}}_info(e,n){return this.dialog?Promise.resolve(this.dialog.info(e,n)):Promise.reject(new Error("Session dialog undefined."))}_message(e,n){return this.dialog?Promise.resolve(this.dialog.message(e,n)):Promise.reject(new Error("Session dialog undefined."))}_refer(e,n,r){return this.dialog?(this.onNotify=e,Promise.resolve(this.dialog.refer(n,r))):Promise.reject(new Error("Session dialog undefined."))}ackAndBye(e,n,r){e.ack();const i=[];n&&i.push("Reason: "+this.getReasonHeaderValue(n,r)),e.session.bye(void 0,{extraHeaders:i})}onAckRequest(e){if(this.logger.log("Session.onAckRequest"),this.state!==Oe.Established&&this.state!==Oe.Terminating)return this.logger.error(`ACK received while in state ${this.state}, dropping request`),Promise.resolve();const n=this.dialog;if(!n)throw new Error("Dialog undefined.");const r={sessionDescriptionHandlerOptions:this.pendingReinviteAck?this.sessionDescriptionHandlerOptionsReInvite:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.pendingReinviteAck?this._sessionDescriptionHandlerModifiersReInvite:this._sessionDescriptionHandlerModifiers};if(this.delegate&&this.delegate.onAck){const i=new bte(e);this.delegate.onAck(i)}switch(this.pendingReinviteAck=!1,n.signalingState){case rt.Initial:{this.logger.error(`Invalid signaling state ${n.signalingState}.`);const i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return n.bye(void 0,{extraHeaders:i}),this.stateTransition(Oe.Terminated),Promise.resolve()}case rt.Stable:{const i=ud(e.message);return i?i.contentDisposition==="render"?(this._renderbody=i.content,this._rendertype=i.contentType,Promise.resolve()):i.contentDisposition!=="session"?Promise.resolve():this.setAnswer(i,r).catch(s=>{this.logger.error(s.message);const o=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];n.bye(void 0,{extraHeaders:o}),this.stateTransition(Oe.Terminated)}):Promise.resolve()}case rt.HaveLocalOffer:{this.logger.error(`Invalid signaling state ${n.signalingState}.`);const i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return n.bye(void 0,{extraHeaders:i}),this.stateTransition(Oe.Terminated),Promise.resolve()}case rt.HaveRemoteOffer:{this.logger.error(`Invalid signaling state ${n.signalingState}.`);const i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return n.bye(void 0,{extraHeaders:i}),this.stateTransition(Oe.Terminated),Promise.resolve()}case rt.Closed:throw new Error(`Invalid signaling state ${n.signalingState}.`);default:throw new Error(`Invalid signaling state ${n.signalingState}.`)}}
629onByeRequest(e){if(this.logger.log("Session.onByeRequest"),this.state!==Oe.Established){this.logger.error(`BYE received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onBye){const n=new yte(e);this.delegate.onBye(n)}else e.accept();this.stateTransition(Oe.Terminated)}onInfoRequest(e){if(this.logger.log("Session.onInfoRequest"),this.state!==Oe.Established){this.logger.error(`INFO received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onInfo){const n=new Ste(e);this.delegate.onInfo(n)}else e.accept()}onInviteRequest(e){if(this.logger.log("Session.onInviteRequest"),this.state!==Oe.Established){this.logger.error(`INVITE received while in state ${this.state}, dropping request`);return}this.pendingReinviteAck=!0;const n=["Contact: "+this._contact];if(e.message.hasHeader("P-Asserted-Identity")){const i=e.message.getHeader("P-Asserted-Identity");if(!i)throw new Error("Header undefined.");this._assertedIdentity=Vn.nameAddrHeaderParse(i)}const r={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.generateResponseOfferAnswerInDialog(r).then(i=>{const s=e.accept({statusCode:200,extraHeaders:n,body:i});this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,s.message,200)}).catch(i=>{if(this.logger.error(i.message),this.logger.error("Failed to handle to re-INVITE request"),!this.dialog)throw new Error("Dialog undefined.");if(this.logger.error(this.dialog.signalingState),this.dialog.signalingState===rt.Stable){const s=e.reject({statusCode:488});this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,s.message,488);return}this.rollbackOffer().then(()=>{const s=e.reject({statusCode:488});this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,s.message,488)}).catch(s=>{this.logger.error(s.message),this.logger.error("Failed to rollback offer on re-INVITE request");const o=e.reject({statusCode:488});if(this.state!==Oe.Terminated){if(!this.dialog)throw new Error("Dialog undefined.");const a=[];a.push("Reason: "+this.getReasonHeaderValue(500,"Internal Server Error")),this.dialog.bye(void 0,{extraHeaders:a}),this.stateTransition(Oe.Terminated)}this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,o.message,488)})})}onMessageRequest(e){if(this.logger.log("Session.onMessageRequest"),this.state!==Oe.Established){this.logger.error(`MESSAGE received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onMessage){const n=new JT(e);this.delegate.onMessage(n)}else e.accept()}onNotifyRequest(e){if(this.logger.log("Session.onNotifyRequest"),this.state!==Oe.Established){this.logger.error(`NOTIFY received while in state ${this.state}, dropping request`);return}if(this.onNotify){const n=new hb(e);this.onNotify(n);return}if(this.delegate&&this.delegate.onNotify){const n=new hb(e);this.delegate.onNotify(n)}else e.accept()}onPrackRequest(e){if(this.logger.log("Session.onPrackRequest"),this.state!==Oe.Established){this.logger.error(`PRACK received while in state ${this.state}, dropping request`);return}throw new Error("Unimplemented.")}onReferRequest(e){if(this.logger.log("Session.onReferRequest"),this.state!==Oe.Established){this.logger.error(`REFER received while in state ${this.state}, dropping request`);return}if(!e.message.hasHeader("refer-to")){this.logger.warn("Invalid REFER packet. A refer-to header is required. Rejecting."),e.reject();return}const n=new Tte(e,this);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(n):(this.logger.log("No delegate available to handle REFER, automatically accepting and following."),n.accept().then(()=>n.makeInviter(this._referralInviterOptions).invite()).catch(r=>{this.logger.error(r.message)}))}generateResponseOfferAnswer(e,n){if(this.dialog)return this.generateResponseOfferAnswerInDialog(n);const r=ud(e.message);return!r||r.contentDisposition!=="session"?this.getOffer(n):this.setOfferAndGetAnswer(r,n)}generateResponseOfferAnswerInDialog(e){if(!this.dialog)throw new Error("Dialog undefined.");switch(this.dialog.signalingState){case rt.Initial:return this.getOffer(e);case rt.HaveLocalOffer:return Promise.resolve(void 0);case rt.HaveRemoteOffer:if(!this.dialog.offer)throw new Error(`Session offer undefined in signaling state ${this.dialog.signalingState}.`);return this.setOfferAndGetAnswer(this.dialog.offer,e);case rt.Stable:return this.state!==Oe.Established?Promise.resolve(void 0):this.getOffer(e);case rt.Closed:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);default:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`)}}getOffer(e){const n=this.setupSessionDescriptionHandler(),r=e.sessionDescriptionHandlerOptions,i=e.sessionDescriptionHandlerModifiers;try{return n.getDescription(r,i).then(s=>cp(s)).catch(s=>{this.logger.error("Session.getOffer: SDH getDescription rejected...");const o=s instanceof Error?s:new Error("Session.getOffer unknown error.");throw this.logger.error(o.message),o})}catch(s){this.logger.error("Session.getOffer: SDH getDescription threw...");const o=s instanceof Error?s:new Error(s);return this.logger.error(o.message),Promise.reject(o)}}rollbackOffer(){const e=this.setupSessionDescriptionHandler();if(e.rollbackDescription===void 0)return Promise.resolve();try{return e.rollbackDescription().catch(n=>{this.logger.error("Session.rollbackOffer: SDH rollbackDescription rejected...");const r=n instanceof Error?n:new Error("Session.rollbackOffer unknown error.");throw this.logger.error(r.message),r})}catch(n){this.logger.error("Session.rollbackOffer: SDH rollbackDescription threw...");const r=n instanceof Error?n:new Error(n);return this.logger.error(r.message),Promise.reject(r)}}setAnswer(e,n){const r=this.setupSessionDescriptionHandler(),i=n.sessionDescriptionHandlerOptions,s=n.sessionDescriptionHandlerModifiers;try{if(!r.hasDescription(e.contentType))return Promise.reject(new fb)}catch(o){this.logger.error("Session.setAnswer: SDH hasDescription threw...");const a=o instanceof Error?o:new Error(o);return this.logger.error(a.message),Promise.reject(a)}try{return r.setDescription(e.content,i,s).catch(o=>{this.logger.error("Session.setAnswer: SDH setDescription rejected...");const a=o instanceof Error?o:new Error("Session.setAnswer unknown error.");throw this.logger.error(a.message),a})}catch(o){this.logger.error("Session.setAnswer: SDH setDescription threw...");const a=o instanceof Error?o:new Error(o);return this.logger.error(a.message),Promise.reject(a)}}setOfferAndGetAnswer(e,n){const r=this.setupSessionDescriptionHandler(),i=n.sessionDescriptionHandlerOptions,s=n.sessionDescriptionHandlerModifiers;try{if(!r.hasDescription(e.contentType))return Promise.reject(new fb)}catch(o){this.logger.error("Session.setOfferAndGetAnswer: SDH hasDescription threw...");const a=o instanceof Error?o:new Error(o);return this.logger.error(a.message),Promise.reject(a)}try{return r.setDescription(e.content,i,s).then(()=>r.getDescription(i,s)).then(o=>cp(o)).catch(o=>{this.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription rejected...");const a=o instanceof Error?o:new Error("Session.setOfferAndGetAnswer unknown error.");throw this.logger.error(a.message),a})}catch(o){this.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription threw...");const a=o instanceof Error?o:new Error(o);return this.logger.error(a.message),Promise.reject(a)}}setSessionDescriptionHandler(e){if(this._sessionDescriptionHandler)throw new Error("Session description handler defined.");this._sessionDescriptionHandler=e}setupSessionDescriptionHandler(){var e;return this._sessionDescriptionHandler?this._sessionDescriptionHandler:(this._sessionDescriptionHandler=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions),!((e=this.delegate)===null||e===void 0)&&e.onSessionDescriptionHandler&&this.delegate.onSessionDescriptionHandler(this._sessionDescriptionHandler,!1),this._sessionDescriptionHandler)}stateTransition(e){const n=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};switch(this._state){case Oe.Initial:e!==Oe.Establishing&&e!==Oe.Established&&e!==Oe.Terminating&&e!==Oe.Terminated&&n();break;case Oe.Establishing:e!==Oe.Established&&e!==Oe.Terminating&&e!==Oe.Terminated&&n();break;case Oe.Established:e!==Oe.Terminating&&e!==Oe.Terminated&&n();break;case Oe.Terminating:e!==Oe.Terminated&&n();break;case Oe.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log(`Session ${this.id} transitioned to state ${this._state}`),this._stateEventEmitter.emit(this._state),e===Oe.Terminated&&this.dispose()}copyRequestOptions(e={}){const n=e.extraHeaders?e.extraHeaders.slice():void 0,r=e.body?{contentDisposition:e.body.contentDisposition||"render",contentType:e.body.contentType||"text/plain",content:e.body.content||""}:void 0;return{extraHeaders:n,body:r}}getReasonHeaderValue(e,n){const r=e;let i=v0(e);return!i&&n&&(i=n),"SIP;cause="+r+';text="'+i+'"'}referExtraHeaders(e){const n=[];return n.push("Referred-By: <"+this.userAgent.configuration.uri+">"),n.push("Contact: "+this._contact),n.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),n.push("Refer-To: "+e),n}referToString(e){let n;if(e instanceof gs)n=e.toString();else{if(!e.dialog)throw new Error("Dialog undefined.");const r=e.remoteIdentity.friendlyName,i=e.dialog.remoteTarget.toString(),s=e.dialog.callId,o=e.dialog.remoteTag,a=e.dialog.localTag,l=encodeURIComponent(`${s};to-tag=${o};from-tag=${a}`);n=`"${r}" <${i}?Replaces=${l}>`}return n}}var qi;
629(function(t){t.Required="Required",t.Supported="Supported",t.Unsupported="Unsupported"})(qi=qi||(qi={}));const Rte={"100rel":!0,199:!0,answermode:!0,"early-session":!0,eventlist:!0,explicitsub:!0,"from-change":!0,"geolocation-http":!0,"geolocation-sip":!0,gin:!0,gruu:!0,histinfo:!0,ice:!0,join:!0,"multiple-refer":!0,norefersub:!0,nosub:!0,outbound:!0,path:!0,policy:!0,precondition:!0,pref:!0,privacy:!0,"recipient-list-invite":!0,"recipient-list-message":!0,"recipient-list-subscribe":!0,replaces:!0,"resource-priority":!0,"sdp-anat":!0,"sec-agree":!0,tdialog:!0,timer:!0,uui:!0};class zc extends Zl{constructor(e,n){super(e),this.incomingInviteRequest=n,this.disposed=!1,this.expiresTimer=void 0,this.isCanceled=!1,this.rel100="none",this.rseq=Math.floor(Math.random()*1e4),this.userNoAnswerTimer=void 0,this.waitingForPrack=!1,this.logger=e.getLogger("sip.Invitation");const r=this.incomingInviteRequest.message,i=r.getHeader("require");i&&i.toLowerCase().includes("100rel")&&(this.rel100="required");const s=r.getHeader("supported");if(s&&s.toLowerCase().includes("100rel")&&(this.rel100="supported"),r.toTag=n.toTag,typeof r.toTag!="string")throw new TypeError("toTag should have been a string.");if(this.userNoAnswerTimer=setTimeout(()=>{n.reject({statusCode:480}),this.stateTransition(Oe.Terminated)},this.userAgent.configuration.noAnswerTimeout?this.userAgent.configuration.noAnswerTimeout*1e3:6e4),r.hasHeader("expires")){const l=Number(r.getHeader("expires")||0)*1e3;this.expiresTimer=setTimeout(()=>{this.state===Oe.Initial&&(n.reject({statusCode:487}),this.stateTransition(Oe.Terminated))},l)}const o=this.request.getHeader("P-Asserted-Identity");o&&(this._assertedIdentity=Vn.nameAddrHeaderParse(o)),this._contact=this.userAgent.contact.toString();const a=r.parseHeader("Content-Disposition");a&&a.type==="render"&&(this._renderbody=r.body,this._rendertype=r.getHeader("Content-Type")),this._id=r.callId+r.fromTag,this.userAgent._sessions[this._id]=this}dispose(){if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.expiresTimer&&(clearTimeout(this.expiresTimer),this.expiresTimer=void 0),this.userNoAnswerTimer&&(clearTimeout(this.userNoAnswerTimer),this.userNoAnswerTimer=void 0),this.prackNeverArrived(),this.state){case Oe.Initial:return this.reject().then(()=>super.dispose());case Oe.Establishing:return this.reject().then(()=>super.dispose());case Oe.Established:return super.dispose();case Oe.Terminating:return super.dispose();case Oe.Terminated:return super.dispose();default:throw new Error("Unknown state.")}}get autoSendAnInitialProvisionalResponse(){return this.rel100!=="required"&&this.userAgent.configuration.sendInitialProvisionalResponse}get body(){return this.incomingInviteRequest.message.body}get localIdentity(){return this.request.to}get remoteIdentity(){return this.request.from}get request(){return this.incomingInviteRequest.message}accept(e={}){if(this.logger.log("Invitation.accept"),this.state!==Oe.Initial){const n=new Error(`Invalid session state ${this.state}`);return this.logger.error(n.message),Promise.reject(n)}return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.stateTransition(Oe.Establishing),this.sendAccept(e).then(({message:n,session:r})=>{r.delegate={onAck:i=>this.onAckRequest(i),onAckTimeout:()=>this.onAckTimeout(),onBye:i=>this.onByeRequest(i),onInfo:i=>this.onInfoRequest(i),onInvite:i=>this.onInviteRequest(i),onMessage:i=>this.onMessageRequest(i),onNotify:i=>this.onNotifyRequest(i),onPrack:i=>this.onPrackRequest(i),onRefer:i=>this.onReferRequest(i)},this._dialog=r,this.stateTransition(Oe.Established),this._replacee&&this._replacee._bye()}).catch(n=>this.handleResponseError(n))}progress(e={}){if(this.logger.log("Invitation.progress"),this.state!==Oe.Initial){const r=new Error(`Invalid session state ${this.state}`);return this.logger.error(r.message),Promise.reject(r)}const n=e.statusCode||180;if(n<100||n>199)throw new TypeError("Invalid statusCode: "+n);return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.waitingForPrack?(this.logger.warn("Unexpected call for progress while waiting for prack, ignoring"),Promise.resolve()):e.statusCode===100?this.sendProgressTrying().then(()=>{}).catch(r=>this.handleResponseError(r)):this.rel100!=="required"&&!(this.rel100==="supported"&&e.rel100)&&!(this.rel100==="supported"&&this.userAgent.configuration.sipExtension100rel===qi.Required)?this.sendProgress(e).then(()=>{}).catch(r=>this.handleResponseError(r)):this.sendProgressReliableWaitForPrack(e).then(()=>{}).catch(r=>this.handleResponseError(r))}reject(e={}){if(this.logger.log("Invitation.reject"),this.state!==Oe.Initial&&this.state!==Oe.Establishing){const o=new Error(`Invalid session state ${this.state}`);return this.logger.error(o.message),Promise.reject(o)}const n=e.statusCode||480,r=e.reasonPhrase?e.reasonPhrase:v0(n),i=e.extraHeaders||[];if(n<300||n>699)throw new TypeError("Invalid statusCode: "+n);const s=e.body?cp(e.body):void 0;return n<400?this.incomingInviteRequest.redirect([],{statusCode:n,reasonPhrase:r,extraHeaders:i,body:s}):this.incomingInviteRequest.reject({statusCode:n,reasonPhrase:r,extraHeaders:i,body:s}),this.stateTransition(Oe.Terminated),Promise.resolve()}_onCancel(e){if(this.logger.log("Invitation._onCancel"),this.state!==Oe.Initial&&this.state!==Oe.Establishing){this.logger.error(`CANCEL received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onCancel){const n=new wte(e);this.delegate.onCancel(n)}this.isCanceled=!0,this.incomingInviteRequest.reject({statusCode:487}),this.stateTransition(Oe.Terminated)}handlePrackOfferAnswer(e){if(!this.dialog)throw new Error("Dialog undefined.");const n=ud(e.message);if(!n||n.contentDisposition!=="session")return Promise.resolve(void 0);const r={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers};switch(this.dialog.signalingState){case rt.Initial:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);case rt.Stable:return this.setAnswer(n,r).then(()=>{});case rt.HaveLocalOffer:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);case rt.HaveRemoteOffer:return this.setOfferAndGetAnswer(n,r);case rt.Closed:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);default:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`)}}handleResponseError(e){let n=480;if(e instanceof Error?this.logger.error(e.message):this.logger.error(e),e instanceof fb?(this.logger.error("A session description handler occurred while sending response 
629(content type unsupported"),n=415):e instanceof vte?this.logger.error("A session description handler occurred while sending response"):e instanceof Zg?this.logger.error("Session ended before response could be formulated and sent (while waiting for PRACK)"):e instanceof wo&&this.logger.error("Session changed state before response could be formulated and sent"),this.state===Oe.Initial||this.state===Oe.Establishing)try{this.incomingInviteRequest.reject({statusCode:n}),this.stateTransition(Oe.Terminated)}catch(r){throw this.logger.error("An error occurred attempting to reject the request while handling another error"),r}if(this.isCanceled){this.logger.warn("An error occurred while attempting to formulate and send a response to an incoming INVITE. However a CANCEL was received and processed while doing so which can (and often does) result in errors occurring as the session terminates in the meantime. Said error is being ignored.");return}throw e}onAckTimeout(){if(this.logger.log("Invitation.onAckTimeout"),!this.dialog)throw new Error("Dialog undefined.");this.logger.log("No ACK received for an extended period of time, terminating session"),this.dialog.bye(),this.stateTransition(Oe.Terminated)}sendAccept(e={}){const n={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},r=e.extraHeaders||[];return this.waitingForPrack?this.waitForArrivalOfPrack().then(()=>clearTimeout(this.userNoAnswerTimer)).then(()=>this.generateResponseOfferAnswer(this.incomingInviteRequest,n)).then(i=>this.incomingInviteRequest.accept({statusCode:200,body:i,extraHeaders:r})):(clearTimeout(this.userNoAnswerTimer),this.generateResponseOfferAnswer(this.incomingInviteRequest,n).then(i=>this.incomingInviteRequest.accept({statusCode:200,body:i,extraHeaders:r})))}sendProgress(e={}){const n=e.statusCode||180,r=e.reasonPhrase,i=(e.extraHeaders||[]).slice(),s=e.body?cp(e.body):void 0;if(n===183&&!s)return this.sendProgressWithSDP(e);try{const o=this.incomingInviteRequest.progress({statusCode:n,reasonPhrase:r,extraHeaders:i,body:s});return this._dialog=o.session,Promise.resolve(o)}catch(o){return Promise.reject(o)}}sendProgressWithSDP(e={}){const n={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},r=e.statusCode||183,i=e.reasonPhrase,s=(e.extraHeaders||[]).slice();return this.generateResponseOfferAnswer(this.incomingInviteRequest,n).then(o=>this.incomingInviteRequest.progress({statusCode:r,reasonPhrase:i,extraHeaders:s,body:o})).then(o=>(this._dialog=o.session,o))}sendProgressReliable(e={}){return e.extraHeaders=(e.extraHeaders||[]).slice(),e.extraHeaders.push("Require: 100rel"),e.extraHeaders.push("RSeq: "+Math.floor(Math.random()*1e4)),this.sendProgressWithSDP(e)}sendProgressReliableWaitForPrack(e={}){const n={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},r=e.statusCode||183,i=e.reasonPhrase,s=(e.extraHeaders||[]).slice();s.push("Require: 100rel"),s.push("RSeq: "+this.rseq++);let o;return new Promise((a,l)=>{this.waitingForPrack=!0,this.generateResponseOfferAnswer(this.incomingInviteRequest,n).then(c=>(o=c,this.incomingInviteRequest.progress({statusCode:r,reasonPhrase:i,extraHeaders:s,body:o}))).then(c=>{this._dialog=c.session;let d,u;c.session.delegate={onPrack:v=>{d=v,clearTimeout(f),clearTimeout(g),this.waitingForPrack&&(this.waitingForPrack=!1,this.handlePrackOfferAnswer(d).then(b=>{try{u=d.accept({statusCode:200,body:b}),this.prackArrived(),a({prackRequest:d,prackResponse:u,progressResponse:c})}catch(w){l(w)}}).catch(b=>l(b)))}};const f=setTimeout(()=>{this.waitingForPrack&&(this.waitingForPrack=!1,this.logger.warn("No PRACK received, rejecting INVITE."),clearTimeout(g),this.reject({statusCode:504}).then(()=>l(new Zg)).catch(v=>l(v)))},ur.T1*64),h=()=>{try{this.incomingInviteRequest.progress({statusCode:r,reasonPhrase:i,extraHeaders:s,body:o})}catch(v){this.waitingForPrack=!1,l(v);return}g=setTimeout(h,p*=2)};let p=ur.T1,g=setTimeout(h,p)}).catch(c=>{this.waitingForPrack=!1,l(c)})})}sendProgressTrying(){try{const e=this.incomingInviteRequest.trying();return Promise.resolve(e)}catch(e){return Promise.reject(e)}}waitForArrivalOfPrack(){if(this.waitingForPrackPromise)throw new Error("Already waiting for PRACK");
629return this.waitingForPrackPromise=new Promise((e,n)=>{this.waitingForPrackResolve=e,this.waitingForPrackReject=n}),this.waitingForPrackPromise}prackArrived(){this.waitingForPrackResolve&&this.waitingForPrackResolve(),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0}prackNeverArrived(){this.waitingForPrackReject&&this.waitingForPrackReject(new Zg),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0}}class zf extends Zl{constructor(e,n,r={}){super(e,r),this.disposed=!1,this.earlyMedia=!1,this.earlyMediaSessionDescriptionHandlers=new Map,this.isCanceled=!1,this.inviteWithoutSdp=!1,this.logger=e.getLogger("sip.Inviter"),this.earlyMedia=r.earlyMedia!==void 0?r.earlyMedia:this.earlyMedia,this.fromTag=b0(),this.inviteWithoutSdp=r.inviteWithoutSdp!==void 0?r.inviteWithoutSdp:this.inviteWithoutSdp;const i=Object.assign({},r);i.params=Object.assign({},r.params);const s=r.anonymous||!1,o=e.contact.toString({anonymous:s,outbound:s?!e.contact.tempGruu:!e.contact.pubGruu});s&&e.configuration.uri&&(i.params.fromDisplayName="Anonymous",i.params.fromUri="sip:[email protected]");let a=e.userAgentCore.configuration.aor;if(i.params.fromUri&&(a=typeof i.params.fromUri=="string"?Vn.URIParse(i.params.fromUri):i.params.fromUri),!a)throw new TypeError("Invalid from URI: "+i.params.fromUri);let l=n;if(i.params.toUri&&(l=typeof i.params.toUri=="string"?Vn.URIParse(i.params.toUri):i.params.toUri),!l)throw new TypeError("Invalid to URI: "+i.params.toUri);const c=Object.assign({},i.params);c.fromTag=this.fromTag;const d=(i.extraHeaders||[]).slice();s&&e.configuration.uri&&(d.push("P-Preferred-Identity: "+e.configuration.uri.toString()),d.push("Privacy: id")),d.push("Contact: "+o),d.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),e.configuration.sipExtension100rel===qi.Required&&d.push("Require: 100rel"),e.configuration.sipExtensionReplaces===qi.Required&&d.push("Require: replaces"),i.extraHeaders=d;const u=void 0;this.outgoingRequestMessage=e.userAgentCore.makeOutgoingRequestMessage(ct.INVITE,n,a,l,c,d,u),this._contact=o,this._referralInviterOptions=i,this._renderbody=r.renderbody,this._rendertype=r.rendertype,r.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=r.sessionDescriptionHandlerModifiers),r.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=r.sessionDescriptionHandlerOptions),r.sessionDescriptionHandlerModifiersReInvite&&(this.sessionDescriptionHandlerModifiersReInvite=r.sessionDescriptionHandlerModifiersReInvite),r.sessionDescriptionHandlerOptionsReInvite&&(this.sessionDescriptionHandlerOptionsReInvite=r.sessionDescriptionHandlerOptionsReInvite),this._id=this.outgoingRequestMessage.callId+this.fromTag,this.userAgent._sessions[this._id]=this}dispose(){if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.disposeEarlyMedia(),this.state){case Oe.Initial:return this.cancel().then(()=>super.dispose());case Oe.Establishing:return this.cancel().then(()=>super.dispose());case Oe.Established:return super.dispose();case Oe.Terminating:return super.dispose();case Oe.Terminated:return super.dispose();default:throw new Error("Unknown state.")}}get body(){return this.outgoingRequestMessage.body}get localIdentity(){return this.outgoingRequestMessage.from}get remoteIdentity(){return this.outgoingRequestMessage.to}get request(){return this.outgoingRequestMessage}cancel(e={}){if(this.logger.log("Inviter.cancel"),this.state!==Oe.Initial&&this.state!==Oe.Establishing){const r=new Error(`Invalid session state ${this.state}`);return this.logger.error(r.message),Promise.reject(r)}this.isCanceled=!0,this.stateTransition(Oe.Terminating);function n(r,i){if(r&&r<200||r>699)throw new TypeError("Invalid statusCode: "+r);if(r){const s=r,o=v0(r)||i;return"SIP;cause="+s+';text="'+o+'"'}}if(this.outgoingInviteRequest){let r;e.statusCode&&e.reasonPhrase&&(r=n(e.statusCode,e.reasonPhrase)),this.outgoingInviteRequest.cancel(r,e)}else this.logger.warn("Canceled session before INVITE was sent"),this.stateTransition(Oe.Terminated);return Promise.resolve()}invite(e={}){if(this.logger.log("Inviter.invite"),this.state!==Oe.Initial)return super.invite(e);if(e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),e.withoutSdp||this.inviteWithoutSdp)return this._renderbody&&this._rendertype&&(this.outgoingRequestMessage.body={contentType:this._rendertype,body:this._renderbody}),this.stateTransition(Oe.Establishing),Promise.resolve(this.sendInvite(e));const n={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.getOffer(n).then(r=>(this.outgoingRequestMessage.body={body:r.content,contentType:r.contentType},this.stateTransition(Oe.Establishing),this.sendInvite(e))).catch(r=>{throw this.logger.log(r.message),this.state!==Oe.Terminated&&this.stateTransition(Oe.Terminated),r})}sendInvite(e={}){return this.outgoingInviteRequest=this.userAgent.userAgentCore.invite(this.outgoingRequestMessage,{onAccept:n=>{if(this.dialog){this.logger.log("Additional confirmed dialog, sending ACK and BYE"),this.ackAndBye(n);return}if(this.isCanceled){this.logger.log("Canceled session accepted, sending ACK and BYE"),this.ackAndBye(n),this.stateTransition(Oe.Terminated);return}this.notifyReferer(n),this.onAccept(n).then(()=>{this.disposeEarlyMedia()}).catch(()=>{this.disposeEarlyMedia()}).then(()=>{e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)})},onProgress:n=>{this.isCanceled||(this.notifyReferer(n),this.onProgress(n).catch(()=>{this.disposeEarlyMedia()}).then(()=>{e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(n)}))},onRedirect:n=>{this.notifyReferer(n),this.onRedirect(n),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(n)},onReject:n=>{this.notifyReferer(n),this.onReject(n),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n)},onTrying:n=>{this.notifyReferer(n),this.onTrying(n),e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(n)}}),this.outgoingInviteRequest}disposeEarlyMedia(){this.earlyMediaSessionDescriptionHandlers.forEac
629h(e=>{e.close()}),this.earlyMediaSessionDescriptionHandlers.clear()}notifyReferer(e){if(!this._referred)return;if(!(this._referred instanceof Zl))throw new Error("Referred session not instance of session");if(!this._referred.dialog)return;if(!e.message.statusCode)throw new Error("Status code undefined.");if(!e.message.reasonPhrase)throw new Error("Reason phrase undefined.");const n=e.message.statusCode,r=e.message.reasonPhrase,i=`SIP/2.0 ${n} ${r}`.trim(),s=this._referred.dialog.notify(void 0,{extraHeaders:["Event: refer","Subscription-State: terminated"],body:{contentDisposition:"render",contentType:"message/sipfrag",content:i}});s.delegate={onReject:()=>{this._referred=void 0}}}onAccept(e){if(this.logger.log("Inviter.onAccept"),this.state!==Oe.Establishing)return this.logger.error(`Accept received while in state ${this.state}, dropping response`),Promise.reject(new Error(`Invalid session state ${this.state}`));const n=e.message,r=e.session;switch(n.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=Vn.nameAddrHeaderParse(n.getHeader("P-Asserted-Identity"))),r.delegate={onAck:i=>this.onAckRequest(i),onBye:i=>this.onByeRequest(i),onInfo:i=>this.onInfoRequest(i),onInvite:i=>this.onInviteRequest(i),onMessage:i=>this.onMessageRequest(i),onNotify:i=>this.onNotifyRequest(i),onPrack:i=>this.onPrackRequest(i),onRefer:i=>this.onReferRequest(i)},this._dialog=r,r.signalingState){case rt.Initial:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(Oe.Terminated),Promise.reject(new Error("Bad Media Description"));case rt.HaveLocalOffer:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(Oe.Terminated),Promise.reject(new Error("Bad Media Description"));case rt.HaveRemoteOffer:{if(!this._dialog.offer)throw new Error(`Session offer undefined in signaling state ${this._dialog.signalingState}.`);const i={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setOfferAndGetAnswer(this._dialog.offer,i).then(s=>{e.ack({body:s}),this.stateTransition(Oe.Established)}).catch(s=>{throw this.ackAndBye(e,488,"Invalid session description"),this.stateTransition(Oe.Terminated),s})}case rt.Stable:{if(this.earlyMediaSessionDescriptionHandlers.size>0){const o=this.earlyMediaSessionDescriptionHandlers.get(r.id);if(!o)throw new Error("Session description handler undefined.");return this.setSessionDescriptionHandler(o),this.earlyMediaSessionDescriptionHandlers.delete(r.id),e.ack(),this.stateTransition(Oe.Established),Promise.resolve()}if(this.earlyMediaDialog){if(this.earlyMediaDialog!==r){this.earlyMedia&&this.logger.error("You have set the 'earlyMedia' option to 'true' which requires that your INVITE requests do not fork and yet this INVITE request did in fact fork. Consequentially and not surprisingly the end point which accepted the INVITE (confirmed dialog) does not match the end point with which early media has been setup (early dialog) and thus this session is unable to proceed. In accordance with the SIP specifications, the SIP servers your end point is connected to determine if an INVITE forks and the forking behavior of those servers cannot be controlled by this library. If you wish to use early media with this library you must configure those servers accordingly. Alternatively you may set the 'earlyMedia' to 'false' which will allow this library to function with any INVITE requests which do fork.");const o=new Error("Early media dialog does not equal confirmed dialog, terminating session");return this.logger.error(o.message),this.ackAndBye(e,488,"Not Acceptable Here"),this.stateTransition(Oe.Terminated),Promise.reject(o)}return e.ack(),this.stateTransition(Oe.Established),Promise.resolve()}const i=r.answer;if(!i)throw new Error("Answer is undefined.");const s={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(i,s).then(()=>{let o;this._renderbody&&this._rendertype&&(o={body:{contentDisposition:"render",contentType:this._rendertype,content:this._renderbody}}),e.ack(o),this.stateTransition(Oe.Established)}).catch(o=>{throw this.logger.error(o.message),this.ackAndBye(e,488,"Not Acceptable Here"),this.stateTransition(Oe.Terminated),o})}case rt.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}}onProgress(e){var n;if(this.logger.log("Inviter.onProgress"),this.state!==Oe.Establishing)return this.logger.error(`Progress received while in state ${this.state}, dropping response`),Promise.reject(new Error(`Invalid session state ${this.state}`));if(!this.outgoingInviteRequest)throw new Error("Outgoing INVITE request undefined.");const r=e.message,i=e.session;r.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=Vn.nameAddrHeaderParse(r.getHeader("P-Asserted-Identity")));const s=r.getHeader("require"),o=r.getHeader("rseq"),a=!!(s&&s.includes("100rel")&&o&&Number(o)),l=[];switch(a&&l.push("RAck: "+r.getHeader("rseq")+" "+r.getHeader("cseq")),i.signalingState){case rt.Initial:return a&&(this.logger.warn("First reliable provisional response received MUST contain an offer when INVITE does not contain an offer."),e.prack({extraHeaders:l})),Promise.resolve();case rt.HaveLocalOffer:return a&&e.prack({extraHeaders:l}),Promise.resolve();case rt.HaveRemoteOffer:if(!a)return this.logger.warn("Non-reliable provisional response MUST NOT contain an initial offer, discarding response."),Promise.resolve();{const c=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions||{});return!((n=this.delegate)===null||n===void 0)&&n.onSessionDescriptionHandler&&this.delegate.onSessionDescriptionHandler(c,!0),this.earlyMediaSessionDescriptionHandlers.set(i.id,c),c.setDescription(r.body,this.sessionDescriptionHandlerOptions,this.sessionDescriptionHandlerModifiers).then(()=>c.getDescription(this.sessionDescriptionHandlerOptions,this.sessionDescriptionHandlerModifiers)).then(d=>{const u={contentDisposition:"session",contentType:d.contentType,content:d.body};e.prack({extraHeaders:l,body:u})}).catch(d=>{throw this.stateTransition(Oe.Terminated),d})}case rt.Stable:if(a&&e.prack({extraHeaders:l}),this.earlyMedia&&!this.earlyMediaDialog){this.earlyMediaDialog=i;const c=i.answer;if(!c)throw new Error("Answer is undefined.");const d={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(c,d).catch(u=>{throw this.stateTransition(Oe.Terminated),u})}return Promise.resolve();case rt.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}}onRedirect(e){if(this.logger.log("Inviter.onRedirect"),this.state!==Oe.Establishing&&this.state!==Oe.Terminating){this.logger.error(`Redirect received while in state ${this.state}, dropping response`);return}this.stateTransition(Oe.Terminated)}onReject(e){if(this.logger.log("Inviter.onReject"),this.state!==Oe.Establishing&&this.state!==Oe.Terminating){this.logger.error(`Reject received while in state ${this.state}, dropping response`);return}this.stateTransition(Oe.Terminated)}onTrying(e){if(this.logger.log("Inviter.onTrying"),this.state!==Oe.Establishing){this.logger.error(`Trying received while in state ${this.state}, dropping response`);return}}}class Ite{constructor(e,n,r,i="text/plain",s={}){this.logger=e.getLogger("sip.Messager"),s.params=s.params||{};let o=e.userAgentCore.configuration.aor;if(s.params.fromUri&&(o=typeof s.params.fromUri=="string"?Vn.URIParse(s.params.fromUri):s.params.fromUri),!o)throw new TypeError("Invalid from URI: "+s.params.fromUri);let a=n;if(s.params.toUri&&(a=typeof s.params.toUri=="string"?Vn.URIParse(s.params.toUri):s.params.toUri),!a)throw new TypeError("Invalid to URI: "+s.params.toUri);const l=s.params?Object.assign({},s.params):{},c=(s.extraHeaders||[]).slice(),d={contentDisposition:"render",contentType:i,content:r};this.request=e.userAgentCore.makeOutgoingRequestMessage(ct.MESSAGE,n,o,a,l,c,d),this.userAgent=e}message(e={}){return this.userAgent.userAgentCore.request(this.request,e.requestDelegate),Promise.resolve()}}var Yt;(function(t){t.Initial="Initial",t.Registered="Registered",t.Unregistered="Unregistered",t.Terminated="Terminated"})(Yt=Yt||(Yt={}));class hs{constructor(e,n={}){this.disposed=!1,this._contacts=[],this._retryAfter=void 0,this._state=Yt.Initial,this._waiting=!1,this._stateEventEmitter=new Fd,this._waitingEventEmitter=new Fd,this.userAgent=e;const r=e.configuration.uri.clone();if(r.user=void 0,this.options=Object.assign(Object.assign(Object.assign({},hs.defaultOptions()),{registrar:r}),hs.stripUndefinedProperties(n)),this.options.extraContactHeaderParams=(this.options.extraContactHeaderParams||[]).slice(),this.options.extraHeaders=(this.options.extraHeaders||[]).slice(),!this.options.registrar)throw new Error("Registrar undefined.");if(this.options.registrar=this.options.registrar.clone(),this.options.regId&&!this.options.instanceId?this.options.instanceId=this.userAgent.instanceId:!this.options.regId&&this.options.instanceId&&(this.options.regId=1),this.options.instanceId&&Vn.parse(this.options.instanceId,"uuid")===-1)throw new Error("Invalid instanceId.");if(this.options.regId&&this.options.regId<0)throw new Error("Invalid regId.");const i=this.options.registrar,s=this.options.params&&this.options.params.fromUri||e.userAgentCore.configuration.aor,o=this.options.params&&this.options.params.toUri||e.configuration.uri,a=this.options.params||{},l=(n.extraHeaders||[]).slice();if(this.request=e.userAgentCore.makeOutgoingRequestMessage(ct.REGIST
629ER,i,s,o,a,l,void 0),this.expires=this.options.expires||hs.defaultExpires,this.expires<0)throw new Error("Invalid expires.");if(this.refreshFrequency=this.options.refreshFrequency||hs.defaultRefreshFrequency,this.refreshFrequency<50||this.refreshFrequency>99)throw new Error("Invalid refresh frequency. The value represents a percentage of the expiration time and should be between 50 and 99.");this.logger=e.getLogger("sip.Registerer"),this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach(c=>{const d=this.options[c];switch(c){case"registrar":this.logger.log("· "+c+": "+d);break;default:this.logger.log("· "+c+": "+JSON.stringify(d))}})),this.id=this.request.callId+this.request.from.parameters.tag,this.userAgent._registerers[this.id]=this}static defaultOptions(){return{expires:hs.defaultExpires,extraContactHeaderParams:[],extraHeaders:[],logConfiguration:!0,instanceId:"",params:{},regId:0,registrar:new gs("sip","anonymous","anonymous.invalid"),refreshFrequency:hs.defaultRefreshFrequency}}static stripUndefinedProperties(e){return Object.keys(e).reduce((n,r)=>(e[r]!==void 0&&(n[r]=e[r]),n),{})}get contacts(){return this._contacts.slice()}get retryAfter(){return this._retryAfter}get state(){return this._state}get stateChange(){return this._stateEventEmitter}dispose(){return this.disposed?Promise.resolve():(this.disposed=!0,this.logger.log(`Registerer ${this.id} in state ${this.state} is being disposed`),delete this.userAgent._registerers[this.id],new Promise(e=>{const n=()=>
629{if(!this.waiting&&this._state===Yt.Registered){this.stateChange.addListener(()=>{this.terminated(),e()},{once:!0}),this.unregister();return}this.terminated(),e()};this.waiting?this.waitingChange.addListener(()=>{n()},{once:!0}):n()}))}register(e={}){if(this.state===Yt.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();const i=new jd("REGISTER request already in progress, waiting for final response");return Promise.reject(i)}e.requestOptions&&(this.options=Object.assign(Object.assign({},this.options),e.requestOptions));const n=(this.options.extraHeaders||[]).slice();n.push("Contact: "+this.generateContactHeader(this.expires)),n.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),this.request.extraHeaders=n,this.waitingToggle(!0);const r=this.userAgent.userAgentCore.register(this.request,{onAccept:i=>{let s;i.message.hasHeader("expires")&&(s=Number(i.message.getHeader("expires"))),this._contacts=i.message.getHeaders("contact");let o=this._contacts.length;if(!o){this.logger.error("No Contact header in response to REGISTER, dropping response."),this.unregistered();return}let a;for(;o--;){if(a=i.message.parseHeader("contact",o),!a)throw new Error("Contact undefined");if(this.userAgent.contact.pubGruu&&k4(a.uri,this.userAgent.contact.pubGruu)){s=Number(a.getParam("expires"));break}if(this.userAgent.configuration.contactName===""){if(a.uri.user===this.userAgent.contact.uri.user){s=Number(a.getParam("expires"));break}}else if(k4(a.uri,this.userAgent.contact.uri)){s=Number(a.getParam("expires"));break}a=void 0}if(a===void 0){this.logger.error("No Contact header pointing to us, dropping response"),this.unregistered(),this.waitingToggle(!1);return}if(s===void 0){this.logger.error("Contact pointing to us is missing expires parameter, dropping response"),this.unregistered(),this.waitingToggle(!1);return}if(a.hasParam("temp-gruu")){const l=a.getParam("temp-gruu");l&&(this.userAgent.contact.tempGruu=Vn.URIParse(l.replace(/"/g,"")))}if(a.hasParam("pub-gruu")){const l=a.getParam("pub-gruu");l&&(this.userAgent.contact.pubGruu=Vn.URIParse(l.replace(/"/g,"")))}this.registered(s),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(i),this.waitingToggle(!1)},onProgress:i=>{e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(i)},onRedirect:i=>{this.logger.error("Redirect received. Not supported."),this.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(i),this.waitingToggle(!1)},onReject:i=>{if(i.message.statusCode===423){if(!i.message.hasHeader("min-expires")){this.logger.error("423 response received for REGISTER without Min-Expires, dropping response"),this.unregistered(),this.waitingToggle(!1);return}this.expires=Number(i.message.getHeader("min-expires")),this.waitingToggle(!1),this.register();return}this.logger.warn(`Failed to register, status code ${i.message.statusCode}`);let s=NaN;if(i.message.statusCode===500||i.message.statusCode===503){const o=i.message.getHeader("retry-after");o&&(s=Number.parseInt(o,void 0))}this._retryAfter=isNaN(s)?void 0:s,this.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(i),this._retryAfter=void 0,this.waitingToggle(!1)},onTrying:i=>{e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(i)}});return Promise.resolve(r)}unregister(e={}){if(this.state===Yt.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed&&this.state!==Yt.Registered)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();const i=new jd("REGISTER request already in progress, waiting for final response");return Promise.reject(i)}this._state!==Yt.Registered&&!e.all&&this.logger.warn("Not currently registered, but sending an unregister anyway.");const n=(e.requestOptions&&e.requestOptions.extraHeaders||[]).slice();this.request.extraHeaders=n,e.all?(n.push("Contact: *"),n.push("Expires: 0")):n.push("Contact: "+this.generateContactHeader(0)),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),this.registrationTimer!==void 0&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),this.waitingToggle(!0);const r=this.userAgent.userAgentCore.register(this.request,{onAccept:i=>{this._contacts=i.message.getHeaders("contact"),this.unregistered(),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(i),this.waitingToggle(!1)},onProgress:i=>{e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(i)},onRedirect:i=>{this.logger.error("Unregister redirected. Not currently supported."),this.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(i),this.waitingToggle(!1)},onReject:i=>{this.logger.error(`Unregister rejected with status code ${i.message.statusCode}`),this.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(i),this.waitingToggle(!1)},onTrying:i=>{e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(i)}});return Promise.resolve(r)}clearTimers(){this.registrationTimer!==void 0&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),this.registrationExpiredTimer!==void 0&&(clearTimeout(this.registrationExpiredTimer),this.registrationExpiredTimer=void 0)}generateContactHeader(e){let n=this.userAgent.contact.toString({register:!0});return this.options.regId&&this.options.instanceId&&(n+=";reg-id="+this.options.regId,n+=';+sip.instance="<urn:uuid:'+this.options.instanceId+'>"'),this.options.extraContactHeaderParams&&this.options.extraContactHeaderParams.forEac
629h(r=>{n+=";"+r}),n+=";expires="+e,n}registered(e){this.clearTimers(),this.registrationTimer=setTimeout(()=>{this.registrationTimer=void 0,this.register()},this.refreshFrequency/100*e*1e3),this.registrationExpiredTimer=setTimeout(()=>{this.logger.warn("Registration expired"),this.unregistered()},e*1e3),this._state!==Yt.Registered&&this.stateTransition(Yt.Registered)}unregistered(){this.clearTimers(),this._state!==Yt.Unregistered&&this.stateTransition(Yt.Unregistered)}terminated(){this.clearTimers(),this._state!==Yt.Terminated&&this.stateTransition(Yt.Terminated)}stateTransition(e){const n=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};switch(this._state){case Yt.Initial:e!==Yt.Registered&&e!==Yt.Unregistered&&e!==Yt.Terminated&&n();break;case Yt.Registered:e!==Yt.Unregistered&&e!==Yt.Terminated&&n();break;case Yt.Unregistered:e!==Yt.Registered&&e!==Yt.Terminated&&n();break;case Yt.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log(`Registration transitioned to state ${this._state}`),this._stateEventEmitter.emit(this._state),e===Yt.Terminated&&this.dispose()}get waiting(){return this._waiting}get waitingChange(){return this._waitingEventEmitter}waitingToggle(e){if(this._waiting===e)throw new Error(`Invalid waiting transition from ${this._waiting} to ${e}`);this._waiting=e,this.logger.log(`Waiting toggled to ${this._waiting}`),this._waitingEventEmitter.emit(this._waiting)}waitingWarning(){let e="An attempt was made to send a REGISTER request while a prior one was still in progress.";e+=" RFC 3261 requires UAs MUST NOT send a new registration until they have received a final response",e+=" from the registrar for the previous one or the previous REGISTER request has timed out.",e+=" Note that if the transport disconnects, you still must wait for the prior request to time out before",e+=" sending a new REGISTER request or alternatively dispose of the current Registerer and create a new Registerer.",this.logger.warn(e)}stateError(){let e=`An attempt was made to send a REGISTER request when the Registerer ${this.state===Yt.Terminated?"is in 'Terminated' state":"has been disposed"}.`;e+=" The Registerer transitions to 'Terminated' when Registerer.dispose() is called.",e+=" Perhaps you called UserAgent.stop() which dipsoses of all Registerers?",this.logger.error(e)}}hs.defaultExpires=600;hs.defaultRefreshFrequency=99;var Jt;(function(t){t.Initial="Initial",t.NotifyWait="NotifyWait",t.Pending="Pending",t.Active="Active",t.Terminated="Terminated"})(Jt=Jt||(Jt={}));var Rt;(function(t){t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Disconnected="Disconnected"})(Rt=Rt||(Rt={}));var qn;(function(t){t.Started="Started",t.Stopped="Stopped"})(qn=qn||(qn={}));class Xn{constructor(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashStr(e,n=!1){return this.onePassHasher.start().appendStr(e).end(n)}static hashAsciiStr(e,n=!1){return this.onePassHasher.start().appendAsciiStr(e).end(n)}static _hex(e){const n=Xn.hexChars,r=Xn.hexOut;let i,s,o,a;for(a=0;a<4;a+=1)for(s=a*8,i=e[a],o=0;o<8;o+=2)r[s+1+o]=n.charAt(i&15),i>>>=4,r[s+0+o]=n.charAt(i&15),i>>>=4;return r.join("")}static _md5cycle(e,n){let r=e[0],i=e[1],s=e[2],o=e[3];r+=(i&s|~i&o)+n[0]-680876936|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[1]-389564586|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[2]+606105819|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&o)+n[4]-176418897|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[5]+1200080426|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[6]-1473231341|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[7]-45705983|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&o)+n[8]+1770035416|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[9]-1958414417|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[10]-42063|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[11]-1990404162|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&o)+n[12]+1804603682|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[13]-40341101|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[14]-1502002290|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,r+=(i&o|s&~o)+n[1]-165796510|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[6]-1069501632|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[11]+643717713|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[0]-373897302|0,i=(i<<20|i>>>12)+s|0,r+=(i&o|s&~o)+n[5]-701558691|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[10]+38016083|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[15]-660478335|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[4]-405537848|0,i=(i<<20|i>>>12)+s|0,r+=(i&o|s&~o)+n[9]+568446438|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[14]-1019803690|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[3]-187363961|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[8]+1163531501|0,i=(i<<20|i>>>12)+s|0,r+=(i&o|s&~o)+n[13]-1444681467|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[2]-51403784|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[7]+1735328473|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,r+=(i^s^o)+n[5]-378558|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[8]-2022574463|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[11]+1839030562|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[14]-35309556|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^o)+n[1]-1530992060|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[4]+1272893353|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[7]-155497632|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^o)+n[13]+681279174|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[0]-358537222|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[3]-722521979|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[6]+76029189|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^o)+n[9]-640364487|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[12]-421815835|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[15]+530742520|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[2]-995338651|0,i=(i<<23|i>>>9)+s|0,r+=(s^(i|~o))+n[0]-198630844|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[7]+1126891415|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[14]-1416354905|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[5]-57434055|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~o))+n[12]+1700485571|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[3]-1894986606|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[10]-1051523|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~o))+n[8]+1873313359|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[15]-30611744|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[6]-1560198380|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[13]+1309151649|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~o))+n[4]-145523070|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[11]-1120210379|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[2]+718787259|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=r+e[0]|0,e[1]=i+e[1]|0,e[2]=s+e[2]|0,e[3]=o+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(Xn.stateIdentity),this}appendStr(e){const n=this._buffer8,r=this._buffer32;let i=this._bufferLength,s,o;for(o=0;o<e.length;o+=1){if(s=e.charCodeAt(o),s<128)n[i++]=s;else if(s<2048)n[i++]=(s>>>6)+192,n[i++]=s&63|128;else if(s<55296||s>56319)n[i++]=(s>>>12)+224,n[i++]=s>>>6&63|128,n[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");n[i++]=(s>>>18)+240,n[i++]=s>>>12&63|128,n[i++]=s>>>6&63|128,n[i++]=s&63|128}i>=64&&(this._dataLength+=64,Xn._md5cycle(this._state,r),i-=64,r[0]=r[16])}return this._bufferLength=i,this}appendAsciiStr(e){const n=this._buffer8,r=this._buffer32;let i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length-o,64-i);s--;)n[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,Xn._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}appendByteArray(e){const n=this._buffer8,r=this._buffer32;let i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length-o,64-i);s--;)n[i++]=e[o++];if(i<64)break;this._dataLength+=64,Xn._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}getState(){const e=this,n=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[n[0],n[1],n[2],n[3]]}}setState(e){const n=e.buffer,r=e.state,i=this._state;let s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],s=0;s<n.length;s+=1)this._buffer8[s]=n.charCodeAt(s)}end(e=!1){const n=this._bufferLength,r=this._buffer8,i=this._buffer32,s=(n>>2)+1;let o;if(this._dataLength+=n,r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(Xn.buffer32Identity.subarray(s),s),n>55&&(Xn._md5cycle(this._state,i),i.set(Xn.buffer32Identity)),o=this._dataLength*8,o<=4294967295)i[14]=o;else{const a=o.toString(16).match(/(.*?)(.{0,8})$/);if(a===null)return;const l=parseInt(a[2],16),c=parseInt(a[1],16)||0;i[14]=l,i[15]=c}return Xn._md5cycle(this._state,i),e?this._state:Xn._hex(this._state)}}Xn.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]);Xn.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);Xn.hexChars="0123456789abcdef";Xn.hexOut=[];Xn.onePassHasher=new Xn;Xn.hashStr("hello");function co(t){return Xn.hashStr(t)}class Ate{constructor(e,n,r,i){this.logger=e.getLogger("sipjs.digestauthentication"),this.username=r,this.password=i,this.ha1=n,this.nc=0,this.ncHex="00000000"}authenticate(e,n,r){if(this.algorithm=n.algorithm,this.realm=n.realm,this.nonce=n.nonce,this.opaque=n.opaque,this.stale=n.stale,this.algorithm){if(this.algorithm!=="MD5")return this.logger.warn("challenge with Digest algorithm different than 'MD5', authentication aborted"),!1}else this.algorithm="MD5";if(!this.realm)return this.logger.warn("challenge without Digest realm, authentication aborted"),!1;if(!this.nonce)return this.logger.warn("challenge without Digest nonce, authentication aborted"),!1;if(n.qop)if(n.qop.indexOf("auth")>-1)this.qop="auth";else if(n.qop.indexOf("auth-int")>-1)this.qop="auth-int";else return this.logger.warn("challenge without Digest qop different than 'auth' or 'auth-int', authentication aborted"),!1;else this.qop=void 0;return this.method=e.method,this.uri=e.ruri,this.cnonce=xa(12),this.nc+=1,this.updateNcHex(),this.nc===4294967296&&(this.nc=1,this.ncHex="00000001"),this.calculateResponse(r),!0}toString(){const e=[];
629if(!this.response)throw new Error("response field does not exist, cannot generate Authorization header");return e.push("algorithm="+this.algorithm),e.push('username="'+this.username+'"'),e.push('realm="'+this.realm+'"'),e.push('nonce="'+this.nonce+'"'),e.push('uri="'+this.uri+'"'),e.push('response="'+this.response+'"'),this.opaque&&e.push('opaque="'+this.opaque+'"'),this.qop&&(e.push("qop="+this.qop),e.push('cnonce="'+this.cnonce+'"'),e.push("nc="+this.ncHex)),"Digest "+e.join(", ")}updateNcHex(){const e=Number(this.nc).toString(16);this.ncHex="00000000".substr(0,8-e.length)+e}calculateResponse(e){let n,r;n=this.ha1,(n===""||n===void 0)&&(n=co(this.username+":"+this.realm+":"+this.password)),this.qop==="auth"?(r=co(this.method+":"+this.uri),this.response=co(n+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth:"+r)):this.qop==="auth-int"?(r=co(this.method+":"+this.uri+":"+co(e||"")),this.response=co(n+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth-int:"+r)):this.qop===void 0&&(r=co(this.method+":"+this.uri),this.response=co(n+":"+this.nonce+":"+r))}}var dr;(function(t){t[t.error=0]="error",t[t.warn=1]="warn",t[t.log=2]="log",t[t.debug=3]="debug"})(dr=dr||(dr={}));class _4{constructor(e,n,r){this.logger=e,this.category=n,this.label=r}error(e){this.genericLog(dr.error,e)}warn(e){this.genericLog(dr.warn,e)}log(e){this.genericLog(dr.log,e)}debug(e){this.genericLog(dr.debug,e)}genericLog(e,n){this.logger.genericLog(e,this.category,this.label,n)}get level(){return this.logger.level}set level(e){this.logger.level=e}}class Ote{constructor(){this.builtinEnabled=!0,this._level=dr.log,this.loggers={},this.logger=this.getLogger("sip:loggerfactory")}get level(){return this._level}set level(e){e>=0&&e<=3?this._level=e:e>3?this._level=3:dr.hasOwnProperty(e)?this._level=e:this.logger.error("invalid 'level' parameter value: "+JSON.stringify(e))}get connector(){return this._connector}set connector(e){e?typeof e=="function"?this._connector=e:this.logger.error("invalid 'connector' parameter value: "+JSON.stringify(e)):this._connector=void 0}getLogger(e,n){if(n&&this.level===3)return new _4(this,e,n);if(this.loggers[e])return this.loggers[e];{const r=new _4(this,e);return this.loggers[e]=r,r}}genericLog(e,n,r,i){this.level>=e&&this.builtinEnabled&&this.print(e,n,r,i),this.connector&&this.connector(dr[e],n,r,i)}print(e,n,r,i){if(typeof i=="string"){const s=[new Date,n];r&&s.push(r),i=s.concat(i).join(" | ")}switch(e){case dr.error:break;case dr.warn:break;case dr.log:break;case dr.debug:break}}}var qf;(function(t){function e(i,s){let o=s,a=0,l=0;if(i.substring(o,o+2).match(/(^\r\n)/))return-2;for(;a===0;){if(l=i.indexOf(`\r
630`,o),l===-1)return l;!i.substring(l+2,l+4).match(/(^\r\n)/)&&i.charAt(l+2).match(/(^\s+)/)?o=l+2:a=l}return a}t.getHeader=e;function n(i,s,o,a){const l=s.indexOf(":",o),c=s.substring(o,l).trim(),d=s.substring(l+1,a).trim();let u;switch(c.toLowerCase()){case"via":case"v":i.addHeader("via",d),i.getHeaders("via").length===1?(u=i.parseHeader("Via"),u&&(i.via=u,i.viaBranch=u.branch)):u=0;break;case"from":case"f":i.setHeader("from",d),u=i.parseHeader("from"),u&&(i.from=u,i.fromTag=u.getParam("tag"));break;case"to":case"t":i.setHeader("to",d),u=i.parseHeader("to"),u&&(i.to=u,i.toTag=u.getParam("tag"));break;case"record-route":if(u=Vn.parse(d,"Record_Route"),u===-1){u=void 0;break}if(!(u instanceof Array)){u=void 0;break}u.forEach(f=>{i.addHeader("record-route",d.substring(f.position,f.offset)),i.headers["Record-Route"][i.getHeaders("record-route").length-1].parsed=f.parsed});break;case"call-id":case"i":i.setHeader("call-id",d),u=i.parseHeader("call-id"),u&&(i.callId=d);break;case"contact":case"m":if(u=Vn.parse(d,"Contact"),u===-1){u=void 0;break}if(!(u instanceof Array)){u=void 0;break}u.forEach(f=>{i.addHeader("contact",d.substring(f.position,f.offset)),i.headers.Contact[i.getHeaders("contact").length-1].parsed=f.parsed});break;case"content-length":case"l":i.setHeader("content-length",d),u=i.parseHeader("content-length");break;case"content-type":case"c":i.setHeader("content-type",d),u=i.parseHeader("content-type");break;case"cseq":i.setHeader("cseq",d),u=i.parseHeader("cseq"),u&&(i.cseq=u.value),i instanceof qo&&(i.method=u.method);break;case"max-forwards":i.setHeader("max-forwards",d),u=i.parseHeader("max-forwards");break;case"www-authenticate":i.setHeader("www-authenticate",d),u=i.parseHeader("www-authenticate");break;case"proxy-authenticate":i.setHeader("proxy-authenticate",d),u=i.parseHeader("proxy-authenticate");break;case"refer-to":case"r":i.setHeader("refer-to",d),u=i.parseHeader("refer-to"),u&&(i.referTo=u);break;default:i.addHeader(c.toLowerCase(),d),u=0}return u===void 0?{error:"error parsing header '"+c+"'"}:!0}t.parseHeader=n;function r(i,s){let o=0,a=i.indexOf(`\r
631`);if(a===-1){s.warn("no CRLF found, not a SIP message, discarded");return}const l=i.substring(0,a),c=Vn.parse(l,"Request_Response");let d;if(c===-1){s.warn('error parsing first line of SIP message: "'+l+'"');return}else c.status_code?(d=new qo,d.statusCode=c.status_code,d.reasonPhrase=c.reason_phrase):(d=new Ml,d.method=c.method,d.ruri=c.uri);d.data=i,o=a+2;let u;for(;;){if(a=e(i,o),a===-2){u=o+2;break}else if(a===-1){s.error("malformed message");return}const f=n(d,i,o,a);if(f&&f!==!0){s.error(f.error);return}o=a+2}
631return d.hasHeader("content-length")?d.body=i.substr(u,Number(d.getHeader("content-length"))):d.body=i.substring(u),d}t.parseMessage=r})(qf=qf||(qf={}));function QT(t,e){if(e.statusCode<100||e.statusCode>699)throw new TypeError("Invalid statusCode: "+e.statusCode);const r=e.reasonPhrase?e.reasonPhrase:v0(e.statusCode);let i="SIP/2.0 "+e.statusCode+" "+r+`\r
632`;e.statusCode>=100&&e.statusCode<200,e.statusCode;const s="From: "+t.getHeader("From")+`\r
633`,o="Call-ID: "+t.callId+`\r
634`,a="CSeq: "+t.cseq+" "+t.method+`\r
635`,l=t.getHeaders("via").reduce((h,p)=>h+"Via: "+p+`\r
636`,"");let c="To: "+t.getHeader("to");if(e.statusCode>100&&!t.parseHeader("to").hasParam("tag")){let h=e.toTag;h||(h=b0()),c+=";tag="+h}c+=`\r
637`;let d="";e.supported&&(d="Supported: "+e.supported.join(", ")+`\r
638`);let u="";e.userAgent&&(u="User-Agent: "+e.userAgent+`\r
639`);let f="";return e.extraHeaders&&(f=e.extraHeaders.reduce((h,p)=>h+p.trim()+`\r
640`,"")),i+=l,i+=s,i+=c,i+=a,i+=o,i+=d,i+=u,i+=f,e.body?(i+="Content-Type: "+e.body.contentType+`\r
641`,i+="Content-Length: "+Bd(e.body.content)+`\r
642\r
643`,i+=e.body.content):i+=`Content-Length: 0\r
644\r
645`,{message:i}}class t1 extends Wa{constructor(e){super(e||"Unspecified transport error.")}}class ZT{constructor(e,n,r,i,s){this._transport=e,this._user=n,this._id=r,this._state=i,this.listeners=new Array,this.logger=n.loggerFactory.getLogger(s,r),this.logger.debug(`Constructing ${this.typeToString()} with id ${this.id}.`)}dispose(){this.logger.debug(`Destroyed ${this.typeToString()} with id ${this.id}.`)}get id(){return this._id}get kind(){throw new Error("Invalid kind.")}get state(){return this._state}get transport(){return this._transport}addStateChangeListener(e,n){const r=()=>{this.removeStateChangeListener(r),e()};(n==null?void 0:n.once)===!0?this.listeners.push(r):this.listeners.push(e)}notifyStateChangeListeners(){this.listeners.slice().forEach(e=>e())}removeStateChangeListener(e){this.listeners=this.listeners.filter(n=>n!==e)}logTransportError(e,n){this.logger.error(e.message),this.logger.error(`Transport error occurred in ${this.typeToString()} with id ${this.id}.`),this.logger.error(n)}send(e){return this.transport.send(e).catch(n=>{if(n instanceof t1)throw this.onTransportError(n),n;let r;throw n&&typeof n.message=="string"?r=new t1(n.message):r=new t1,this.onTransportError(r),r})}setState(e){this.logger.debug(`State change to "${e}" on ${this.typeToString()} with id ${this.id}.`),this._state=e,this._user.onStateChange&&this._user.onStateChange(e),this.notifyStateChangeListeners()}typeToString(){return"UnknownType"}}class eR extends ZT{constructor(e,n,r,i,s){super(n,r,e.viaBranch,i,s),this._request=e,this.user=r}get request(){return this._request}}var Ce;(function(t){t.Accepted="Accepted",t.Calling="Calling",t.Completed="Completed",t.Confirmed="Confirmed",t.Proceeding="Proceeding",t.Terminated="Terminated",t.Trying="Trying"})(Ce=Ce||(Ce={}));class Gr extends eR{constructor(e,n,r){super(e,n,r,Ce.Proceeding,"sip.transaction.ist")}dispose(){this.stopProgressExtensionTimer(),this.H&&(clearTimeout(this.H),this.H=void 0),this.I&&(clearTimeout(this.I),this.I=void 0),this.L&&(clearTimeout(this.L),this.L=void 0),super.dispose()}get kind(){return"ist"}receiveRequest(e){switch(this.state){case Ce.Proceeding:if(e.method===ct.INVITE){this.lastProvisionalResponse&&this.send(this.lastProvisionalResponse).catch(r=>{this.logTransportError(r,"Failed to send retransmission of provisional response.")});return}break;case Ce.Accepted:if(e.method===ct.INVITE)return;break;case Ce.Completed:if(e.method===ct.INVITE){if(!this.lastFinalResponse)throw new Error("Last final response undefined.");this.send(this.lastFinalResponse).catch(r=>{this.logTransportError(r,"Failed to send retransmission of final response.")});return}if(e.method===ct.ACK){this.stateTransition(Ce.Confirmed);return}break;case Ce.Confirmed:if(e.method===ct.INVITE||e.method===ct.ACK)return;break;case Ce.Terminated:if(e.method===ct.INVITE||e.method===ct.ACK)return;break;default:throw new Error(`Invalid state ${this.state}`)}const n=`INVITE server transaction received unexpected ${e.method} request while in state ${this.state}.`;this.logger.warn(n)}receiveResponse(e,n){if(e<100||e>699)throw new Error(`Invalid status code ${e}`);switch(this.state){case Ce.Proceeding:if(e>=100&&e<=199){this.lastProvisionalResponse=n,e>100&&this.startProgressExtensionTimer(),this.send(n).catch(i=>{this.logTransportError(i,"Failed to send 1xx response.")});return}if(e>=200&&e<=299){this.lastFinalResponse=n,this.stateTransition(Ce.Accepted),this.send(n).catch(i=>{this.logTransportError(i,"Failed to send 2xx response.")});return}if(e>=300&&e<=699){this.lastFinalResponse=n,this.stateTransition(Ce.Completed),this.send(n).catch(i=>{this.logTransportError(i,"Failed to send non-2xx final response.")});return}break;case Ce.Accepted:if(e>=200&&e<=299){this.send(n).catch(i=>{this.logTransportError(i,"Failed to send 2xx response.")});return}break;case Ce.Completed:break;case Ce.Confirmed:break;case Ce.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}const r=`INVITE server transaction received unexpected ${e} response from TU while in state ${this.state}.`;throw this.logger.error(r),new Error(r)}retransmitAcceptedResponse(){this.state===Ce.Accepted&&this.lastFinalResponse&&this.send(this.lastFinalResponse).catch(e=>{this.logTransportError(e,"Failed to send 2xx response.")})}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e)}typeToString(){return"INVITE server transaction"}stateTransition(e){const n=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case Ce.Proceeding:n();break;case Ce.Accepted:case Ce.Completed:this.state!==Ce.Proceeding&&n();break;case Ce.Confirmed:this.state!==Ce.Completed&&n();break;case Ce.Terminated:this.state!==Ce.Accepted&&this.state!==Ce.Completed&&this.state!==Ce.Confirmed&&n();break;default:n()}this.stopProgressExtensionTimer(),e===Ce.Accepted&&(this.L=setTimeout(()=>this.timerL(),ur.TIMER_L)),e===Ce.Completed&&(this.H=setTimeout(()=>this.timerH(),ur.TIMER_H)),e===Ce.Confirmed&&(this.I=setTimeout(()=>this.timerI(),ur.TIMER_I)),e===Ce.Terminated&&this.dispose(),this.setState(e)}startProgressExtensionTimer(){this.progressExtensionTimer===void 0&&(this.progressExtensionTimer=setInterval(()=>{if(this.logger.debug(`Progress extension timer expired for INVITE server transaction ${this.id}.`),!this.lastProvisionalResponse)throw new Error("Last provisional response undefined.");this.send(this.lastProvisionalResponse).catch(e=>{this.logTransportError(e,"Failed to send retransmission of provisional response.")})},ur.PROVISIONAL_RESPONSE_INTERVAL))}stopProgressExtensionTimer(){this.progressExtensionTimer!==void 0&&(clearInterval(this.progressExtensionTimer),this.progressExtensionTimer=void 0)}timerG(){}timerH(){this.logger.debug(`Timer H expired for INVITE server transaction ${this.id}.`),this.state===Ce.Completed&&(this.logger.warn("ACK to negative final response was never received, terminating transaction."),this.stateTransition(Ce.Terminated))}timerI(){this.logger.debug(`Timer I expired for INVITE server transaction ${this.id}.`),this.stateTransition(Ce.Terminated)}timerL(){this.logger.debug(`Timer L expired for INVITE server transaction ${this.id}.`),this.state===Ce.Accepted&&this.stateTransition(Ce.Terminated)}}class y0 extends ZT{constructor(e,n,r,i,s){super(n,r,y0.makeId(e),i,s),this._request=e,this.user=r,e.setViaHeader(this.id,n.protocol)}static makeId(e){if(e.method==="CANCEL"){if(!e.branch)throw new Error("Outgoing CANCEL request without a branch.");return e.branch}else return"z9hG4bK"+Math.floor(Math.random()*1e7)}get request(){return this._request}onRequestTimeout(){this.user.onRequestTimeout&&this.user.onRequestTimeout()}}class fi extends y0{constructor(e,n,r){super(e,n,r,Ce.Trying,"sip.transaction.nict"),this.F=setTimeout(()=>this.timerF(),ur.TIMER_F),this.send(e.toString()).catch(i=>{this.logTransportError(i,"Failed to send initial outgoing request.")})}dispose(){this.F&&(clearTimeout(this.F),this.F=void 0),this.K&&(clearTimeout(this.K),this.K=void 0),super.dispose()}get kind(){return"nict"}receiveResponse(e){const n=e.statusCode;if(!n||n<100||n>699)throw new Error(`Invalid status code ${n}`);switch(this.state){case Ce.Trying:if(n>=100&&n<=199){this.stateTransition(Ce.Proceeding),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(n>=200&&n<=699){if(this.stateTransition(Ce.Completed),n===408){this.onRequestTimeout();return}this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case Ce.Proceeding:if(n>=100&&n<=199&&this.user.receiveResponse)return this.user.receiveResponse(e);if(n>=200&&n<=699){if(this.stateTransition(Ce.Completed),n===408){this.onRequestTimeout();return}this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case Ce.Completed:return;case Ce.Terminated:return;default:throw new Error(`Invalid state ${this.state}`)}const r=`Non-INVITE client transaction received unexpected ${n} response while in state ${this.state}.`;this.logger.warn(r)}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(Ce.Terminated,!0)}typeToString(){return"non-INVITE client transaction"}stateTransition(e,n=!1){const r=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case Ce.Trying:r();break;case Ce.Proceeding:this.state!==Ce.Trying&&r();break;case Ce.Completed:this.state!==Ce.Trying&&this.state!==Ce.Proceeding&&r();break;case Ce.Terminated:this.state!==Ce.Trying&&this.state!==Ce.Proceeding&&this.state!==Ce.Completed&&(n||r());break;default:r()}e===Ce.Completed&&(this.F&&(clearTimeout(this.F),this.F=void 0),this.K=setTimeout(()=>this.timerK(),ur.TIMER_K)),e===Ce.Terminated&&this.dispose(),this.setState(e)}timerF(){this.logger.debug(`Timer F expired for non-INVITE client transaction ${this.id}.`),(this.state===Ce.Trying||this.state===Ce.Proceeding)&&(this.onRequestTimeout(),this.stateTransition(Ce.Terminated))}timerK(){this.state===Ce.Completed&&this.stateTransition(Ce.Terminated)}}class ec{constructor(e,n){this.core=e,this.dialogState=n,this.core.dialogs.set(this.id,this)}static initialDialogStateForUserAgentClient(e,n){const r=n.getHeaders("record-route").reverse(),i=n.parseHeader("contact");if(!i)throw new Error("Contact undefined.");if(!(i instanceof Wr))throw new Error("Contact not instance of NameAddrHeader.");const s=i.uri,o=e.cseq,a=void 0,l=e.callId,c=e.fromTag,d=n.toTag;if(!l)throw new Error("Call id undefined.");if(!c)throw new Error("From tag undefined.");if(!d)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");
645const u=e.from.uri,f=e.to.uri;if(!n.statusCode)throw new Error("Incoming response status code undefined.");const h=n.statusCode<200;return{id:l+c+d,early:h,callId:l,localTag:c,remoteTag:d,localSequenceNumber:o,remoteSequenceNumber:a,localURI:u,remoteURI:f,remoteTarget:s,routeSet:r,secure:!1}}static initialDialogStateForUserAgentServer(e,n,r=!1){const i=e.getHeaders("record-route"),s=e.parseHeader("contact");if(!s)throw new Error("Contact undefined.");if(!(s instanceof Wr))throw new Error("Contact not instance of NameAddrHeader.");const o=s.uri,a=e.cseq,l=void 0,c=e.callId,d=n,u=e.fromTag,f=e.from.uri,h=e.to.uri;return{id:c+d+u,early:r,callId:c,localTag:d,remoteTag:u,localSequenceNumber:l,remoteSequenceNumber:a,localURI:h,remoteURI:f,remoteTarget:o,routeSet:i,secure:!1}}dispose(){this.core.dialogs.delete(this.id)}get id(){return this.dialogState.id}get early(){return this.dialogState.early}get callId(){return this.dialogState.callId}get localTag(){return this.dialogState.localTag}get remoteTag(){return this.dialogState.remoteTag}get localSequenceNumber(){return this.dialogState.localSequenceNumber}get remoteSequenceNumber(){return this.dialogState.remoteSequenceNumber}get localURI(){return this.dialogState.localURI}get remoteURI(){return this.dialogState.remoteURI}get remoteTarget(){return this.dialogState.remoteTarget}get routeSet(){return this.dialogState.routeSet}get secure(){return this.dialogState.secure}get userAgentCore(){return this.core}confirm(){this.dialogState.early=!1}receiveRequest(e){if(e.method!==ct.ACK){if(this.remoteSequenceNumber){if(e.cseq<=this.remoteSequenceNumber)throw new Error("Out of sequence in dialog request. Did you forget to call sequenceGuard()?");this.dialogState.remoteSequenceNumber=e.cseq}this.remoteSequenceNumber||(this.dialogState.remoteSequenceNumber=e.cseq)}}recomputeRouteSet(e){this.dialogState.routeSet=e.getHeaders("record-route").reverse()}createOutgoingRequestMessage(e,n){const r=this.remoteURI,i=this.remoteTag,s=this.localURI,o=this.localTag,a=this.callId;let l;n&&n.cseq?l=n.cseq:this.dialogState.localSequenceNumber?l=this.dialogState.localSequenceNumber+=1:l=this.dialogState.localSequenceNumber=1;const c=this.remoteTarget,d=this.routeSet,u=n&&n.extraHeaders,f=n&&n.body;return this.userAgentCore.makeOutgoingRequestMessage(e,c,s,r,{callId:a,cseq:l,fromTag:o,toTag:i,routeSet:d},u,f)}incrementLocalSequenceNumber(){if(!this.dialogState.localSequenceNumber)throw new Error("Local sequence number undefined.");this.dialogState.localSequenceNumber+=1}sequenceGuard(e){return e.method===ct.ACK?!0:this.remoteSequenceNumber&&e.cseq<=this.remoteSequenceNumber?(this.core.replyStateless(e,{statusCode:500}),!1):!0}}class Io extends y0{constructor(e,n,r){super(e,n,r,Ce.Calling,"sip.transaction.ict"),this.ackRetransmissionCache=new Map,this.B=setTimeout(()=>this.timerB(),ur.TIMER_B),this.send(e.toString()).catch(i=>{this.logTransportError(i,"Failed to send initial outgoing request.")})}dispose(){this.B&&(clearTimeout(this.B),this.B=void 0),this.D&&(clearTimeout(this.D),this.D=void 0),this.M&&(clearTimeout(this.M),this.M=void 0),super.dispose()}get kind(){return"ict"}ackResponse(e){const n=e.toTag;if(!n)throw new Error("To tag undefined.");const r="z9hG4bK"+Math.floor(Math.random()*1e7);e.setViaHeader(r,this.transport.protocol),this.ackRetransmissionCache.set(n,e),this.send(e.toString()).catch(i=>{this.logTransportError(i,"Failed to send ACK to 2xx response.")})}receiveResponse(e){const n=e.statusCode;if(!n||n<100||n>699)throw new Error(`Invalid status code ${n}`);switch(this.state){case Ce.Calling:if(n>=100&&n<=199){this.stateTransition(Ce.Proceeding),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(n>=200&&n<=299){this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition(Ce.Accepted),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(n>=300&&n<=699){this.stateTransition(Ce.Completed),this.ack(e),this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case Ce.Proceeding:if(n>=100&&n<=199){this.user.receiveResponse&&this.user.receiveResponse(e);return}if(n>=200&&n<=299){this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition(Ce.Accepted),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(n>=300&&n<=699){this.stateTransition(Ce.Completed),this.ack(e),this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case Ce.Accepted:if(n>=200&&n<=299){if(!this.ackRetransmissionCache.has(e.toTag)){this.ackRetransmissionCache.set(e.toTag,void 0),this.user.receiveResponse&&this.user.receiveResponse(e);return}const i=this.ackRetransmissionCache.get(e.toTag);if(i){this.send(i.toString()).catch(s=>{this.logTransportError(s,"Failed to send retransmission of ACK to 2xx response.")});return}return}break;case Ce.Completed:if(n>=300&&n<=699){this.ack(e);return}break;case Ce.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}const r=`Received unexpected ${n} response while in state ${this.state}.`;this.logger.warn(r)}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(Ce.Terminated,!0)}typeToString(){return"INVITE client transaction"}ack(e){const n=this.request.ruri,r=this.request.callId,i=this.request.cseq,s=this.request.getHeader("from"),o=e.getHeader("to"),a=this.request.getHeader("via"),l=this.request.getHeader("route");
645if(!s)throw new Error("From undefined.");if(!o)throw new Error("To undefined.");if(!a)throw new Error("Via undefined.");let c=`ACK ${n} SIP/2.0\r
646`;l&&(c+=`Route: ${l}\r
647`),c+=`Via: ${a}\r
648`,c+=`To: ${o}\r
649`,c+=`From: ${s}\r
650`,c+=`Call-ID: ${r}\r
651`,c+=`CSeq: ${i} ACK\r
652`,c+=`Max-Forwards: 70\r
653`,c+=`Content-Length: 0\r
654\r
655`,this.send(c).catch(d=>{this.logTransportError(d,"Failed to send ACK to non-2xx response.")})}stateTransition(e,n=!1){const r=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case Ce.Calling:r();break;case Ce.Proceeding:this.state!==Ce.Calling&&r();break;case Ce.Accepted:case Ce.Completed:this.state!==Ce.Calling&&this.state!==Ce.Proceeding&&r();break;case Ce.Terminated:this.state!==Ce.Calling&&this.state!==Ce.Accepted&&this.state!==Ce.Completed&&(n||r());break;default:r()}this.B&&(clearTimeout(this.B),this.B=void 0),Ce.Proceeding,e===Ce.Completed&&(this.D=setTimeout(()=>this.timerD(),ur.TIMER_D)),e===Ce.Accepted&&(this.M=setTimeout(()=>this.timerM(),ur.TIMER_M)),e===Ce.Terminated&&this.dispose(),this.setState(e)}timerA(){}timerB(){this.logger.debug(`Timer B expired for INVITE client transaction ${this.id}.`),this.state===Ce.Calling&&(this.onRequestTimeout(),this.stateTransition(Ce.Terminated))}timerD(){this.logger.debug(`Timer D expired for INVITE client transaction ${this.id}.`),this.state===Ce.Completed&&this.stateTransition(Ce.Terminated)}timerM(){this.logger.debug(`Timer M expired for INVITE client transaction ${this.id}.`),this.state===Ce.Accepted&&this.stateTransition(Ce.Terminated)}}class _r{constructor(e,n,r,i){this.transactionConstructor=e,this.core=n,this.message=r,this.delegate=i,this.challenged=!1,this.stale=!1,this.logger=this.loggerFactory.getLogger("sip.user-agent-client"),this.init()}dispose(){this.transaction.dispose()}get loggerFactory(){return this.core.loggerFactory}get transaction(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction}cancel(e,n={}){if(!this.transaction)throw new Error("Transaction undefined.");if(!this.message.to)throw new Error("To undefined.");if(!this.message.from)throw new Error("From undefined.");const r=this.core.makeOutgoingRequestMessage(ct.CANCEL,this.message.ruri,this.message.from.uri,this.message.to.uri,{toTag:this.message.toTag,fromTag:this.message.fromTag,callId:this.message.callId,cseq:this.message.cseq},n.extraHeaders);return r.branch=this.message.branch,this.message.headers.Route&&(r.headers.Route=this.message.headers.Route),e&&r.setHeader("Reason",e),this.transaction.state===Ce.Proceeding?new _r(fi,this.core,r):this.transaction.addStateChangeListener(()=>{this.transaction&&this.transaction.state===Ce.Proceeding&&new _r(fi,this.core,r)},{once:!0}),r}authenticationGuard(e,n){const r=e.statusCode;if(!r)throw new Error("Response status code undefined.");if(r!==401&&r!==407)return!0;let i,s;if(r===401?(i=e.parseHeader("www-authenticate"),s="authorization"):(i=e.parseHeader("proxy-authenticate"),s="proxy-authorization"),!i)return this.logger.warn(r+" with wrong or missing challenge, cannot authenticate"),!0;if(this.challenged&&(this.stale||i.stale!==!0))return this.logger.warn(r+" apparently in authentication loop, cannot authenticate"),!0;if(!this.credentials&&(this.credentials=this.core.configuration.authenticationFactory(),!this.credentials))return this.logger.warn("Unable to obtain credentials, cannot authenticate"),!0;if(!this.credentials.authenticate(this.message,i))return!0;this.challenged=!0,i.stale&&(this.stale=!0);let o=this.message.cseq+=1;return n&&n.localSequenceNumber&&(n.incrementLocalSequenceNumber(),o=this.message.cseq=n.localSequenceNumber),this.message.setHeader("cseq",o+" "+this.message.method),this.message.setHeader(s,this.credentials.toString()),this.init(),!1}onRequestTimeout(){this.logger.warn("User agent client request timed out. Generating internal 408 Request Timeout.");const e=new qo;e.statusCode=408,e.reasonPhrase="Request Timeout",this.receiveResponse(e)}onTransportError(e){this.logger.error(e.message),this.logger.error("User agent client request transport error. Generating internal 503 Service Unavailable.");const n=new qo;n.statusCode=503,n.reasonPhrase="Service Unavailable",this.receiveResponse(n)}receiveResponse(e){if(!this.authenticationGuard(e))return;const n=e.statusCode?e.statusCode.toString():"";if(!n)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(n):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(n):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e});break;case/^2[0-9]{2}$/.test(n):this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e});break;case/^3[0-9]{2}$/.test(n):this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(n):this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error(`Invalid status code ${n}`)}}init(){const e={loggerFactory:this.loggerFactory,onRequestTimeout:()=>this.onRequestTimeout(),onStateChange:i=>{i===Ce.Terminated&&(this.core.userAgentClients.delete(r),n===this._transaction&&this.dispose())},onTransportError:i=>this.onTransportError(i),receiveResponse:i=>this.receiveResponse(i)},n=new this.transactionConstructor(this.message,this.core.transport,e);this._transaction=n;const r=n.id+n.request.method;this.core.userAgentClients.set(r,this)}}class kte extends _r{constructor(e,n,r){const i=e.createOutgoingRequestMessage(ct.BYE,r);super(fi,e.userAgentCore,i,n),e.dispose()}}class di extends eR{constructor(e,n,r){super(e,n,r,Ce.Trying,"sip.transaction.nist")}dispose(){this.J&&(clearTimeout(this.J),this.J=void 0),super.dispose()}get kind(){return"nist"}receiveRequest(e){switch(this.state){case Ce.Trying:break;case Ce.Proceeding:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch(n=>{this.logTransportError(n,"Failed to send retransmission of provisional response.")});break;case Ce.Completed:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch(n=>{this.logTransportError(n,"Failed to send retransmission of final response.")});break;case Ce.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}}receiveResponse(e,n){if(e<100||e>699)throw new Error(`Invalid status code ${e}`);if(e>100&&e<=199)throw new Error("Provisional response other than 100 not allowed.");switch(this.state){case Ce.Trying:if(this.lastResponse=n,e>=100&&e<200){this.stateTransition(Ce.Proceeding),this.send(n).catch(i=>{this.logTransportError(i,"Failed to send provisional response.")});return}if(e>=200&&e<=699){this.stateTransition(Ce.Completed),this.send(n).catch(i=>{this.logTransportError(i,"Failed to send final response.")});return}break;case Ce.Proceeding:if(this.lastResponse=n,e>=200&&e<=699){this.stateTransition(Ce.Completed),this.send(n).catch(i=>{this.logTransportError(i,"Failed to send final response.")});return}break;case Ce.Completed:return;case Ce.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}const r=`Non-INVITE server transaction received unexpected ${e} response from TU while in state ${this.state}.`;throw this.logger.error(r),new Error(r)}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(Ce.Terminated,!0)}typeToString(){return"non-INVITE server transaction"}stateTransition(e,n=!1){const r=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case Ce.Trying:r();break;case Ce.Proceeding:this.state!==Ce.Trying&&r();break;case Ce.Completed:this.state!==Ce.Trying&&this.state!==Ce.Proceeding&&r();break;case Ce.Terminated:this.state!==Ce.Proceeding&&this.state!==Ce.Completed&&(n||r());break;default:r()}e===Ce.Completed&&(this.J=setTimeout(()=>this.timerJ(),ur.TIMER_J)),e===Ce.Terminated&&this.dispose(),this.setState(e)}timerJ(){this.logger.debug(`Timer J expired for NON-INVITE server transaction ${this.id}.`),this.state===Ce.Completed&&this.stateTransition(Ce.Terminated)}}class xs{constructor(e,n,r,i){this.transactionConstructor=e,this.core=n,this.message=r,this.delegate=i,this.logger=this.loggerFactory.getLogger("sip.user-agent-server"),this.toTag=r.toTag?r.toTag:b0(),this.init()}dispose(){this.transaction.dispose()}get loggerFactory(){return this.core.loggerFactory}get transaction(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction}accept(e={statusCode:200}){if(!this.acceptable)throw new wo(`${this.message.method} not acceptable in state ${this.transaction.state}.`);const n=e.statusCode;if(n<200||n>299)throw new TypeError(`Invalid statusCode: ${n}`);return this.reply(e)}
655progress(e={statusCode:180}){if(!this.progressable)throw new wo(`${this.message.method} not progressable in state ${this.transaction.state}.`);const n=e.statusCode;if(n<101||n>199)throw new TypeError(`Invalid statusCode: ${n}`);return this.reply(e)}redirect(e,n={statusCode:302}){if(!this.redirectable)throw new wo(`${this.message.method} not redirectable in state ${this.transaction.state}.`);const r=n.statusCode;if(r<300||r>399)throw new TypeError(`Invalid statusCode: ${r}`);const i=new Array;return e.forEach(s=>i.push(`Contact: ${s.toString()}`)),n.extraHeaders=(n.extraHeaders||[]).concat(i),this.reply(n)}reject(e={statusCode:480}){if(!this.rejectable)throw new wo(`${this.message.method} not rejectable in state ${this.transaction.state}.`);const n=e.statusCode;if(n<400||n>699)throw new TypeError(`Invalid statusCode: ${n}`);return this.reply(e)}trying(e){if(!this.tryingable)throw new wo(`${this.message.method} not tryingable in state ${this.transaction.state}.`);return this.reply({statusCode:100})}receiveCancel(e){this.delegate&&this.delegate.onCancel&&this.delegate.onCancel(e)}get acceptable(){if(this.transaction instanceof Gr)return this.transaction.state===Ce.Proceeding||this.transaction.state===Ce.Accepted;if(this.transaction instanceof di)return this.transaction.state===Ce.Trying||this.transaction.state===Ce.Proceeding;throw new Error("Unknown transaction type.")}get progressable(){if(this.transaction instanceof Gr)return this.transaction.state===Ce.Proceeding;if(this.transaction instanceof di)return!1;throw new Error("Unknown transaction type.")}get redirectable(){if(this.transaction instanceof Gr)return this.transaction.state===Ce.Proceeding;if(this.transaction instanceof di)return this.transaction.state===Ce.Trying||this.transaction.state===Ce.Proceeding;throw new Error("Unknown transaction type.")}get rejectable(){if(this.transaction instanceof Gr)return this.transaction.state===Ce.Proceeding;if(this.transaction instanceof di)return this.transaction.state===Ce.Trying||this.transaction.state===Ce.Proceeding;throw new Error("Unknown transaction type.")}get tryingable(){if(this.transaction instanceof Gr)return this.transaction.state===Ce.Proceeding;if(this.transaction instanceof di)return this.transaction.state===Ce.Trying;throw new Error("Unknown transaction type.")}reply(e){!e.toTag&&e.statusCode!==100&&(e.toTag=this.toTag),e.userAgent=e.userAgent||this.core.configuration.userAgentHeaderFieldValue,e.supported=e.supported||this.core.configuration.supportedOptionTagsResponse;const n=QT(this.message,e);return this.transaction.receiveResponse(e.statusCode,n.message),n}init(){const e={loggerFactory:this.loggerFactory,onStateChange:i=>{i===Ce.Terminated&&(this.core.userAgentServers.delete(r),this.dispose())},onTransportError:i=>{this.logger.error(i.message),this.delegate&&this.delegate.onTransportError?this.delegate.onTransportError(i):this.logger.error("User agent server response transport error.")}},n=new this.transactionConstructor(this.message,this.core.transport,e);this._transaction=n;const r=n.id;this.core.userAgentServers.set(n.id,this)}}class Nte extends xs{constructor(e,n,r){super(di,e.userAgentCore,n,r)}}class _te extends _r{constructor(e,n,r){const i=e.createOutgoingRequestMessage(ct.INFO,r);super(fi,e.userAgentCore,i,n)}}class Pte extends xs{constructor(e,n,r){super(di,e.userAgentCore,n,r)}}class tR extends _r{constructor(e,n,r){super(fi,e,n,r)}}class nR extends xs{constructor(e,n,r){super(di,e,n,r)}}class Mte extends _r{constructor(e,n,r){const i=e.createOutgoingRequestMessage(ct.NOTIFY,r);super(fi,e.userAgentCore,i,n)}}function Dte(t){return t.userAgentCore!==void 0}class dp extends xs{constructor(e,n,r){const i=Dte(e)?e.userAgentCore:e;super(di,i,n,r)}}class Lte extends _r{constructor(e,n,r){const i=e.createOutgoingRequestMessage(ct.PRACK,r);super(fi,e.userAgentCore,i,n),e.signalingStateTransition(i)}}class jte extends xs{constructor(e,n,r){super(di,e.userAgentCore,n,r),e.signalingStateTransition(n),this.dialog=e}accept(e={statusCode:200}){return e.body&&this.dialog.signalingStateTransition(e.body),super.accept(e)}}class Fte extends _r{constructor(e,n,r){const i=e.createOutgoingRequestMessage(ct.INVITE,r);super(Io,e.userAgentCore,i,n),this.delegate=n,e.signalingStateTransition(i),e.reinv
655iteUserAgentClient=this,this.dialog=e}receiveResponse(e){if(!this.authenticationGuard(e,this.dialog))return;const n=e.statusCode?e.statusCode.toString():"";if(!n)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(n):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(n):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:this.dialog,prack:r=>{throw new Error("Unimplemented.")}});break;case/^2[0-9]{2}$/.test(n):this.dialog.signalingStateTransition(e),this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e,session:this.dialog,ack:r=>this.dialog.ack(r)});break;case/^3[0-9]{2}$/.test(n):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(n):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error(`Invalid status code ${n}`)}}}class Bte extends xs{constructor(e,n,r){super(Gr,e.userAgentCore,n,r),e.reinviteUserAgentServer=this,this.dialog=e}accept(e={statusCode:200}){e.extraHeaders=e.extraHeaders||[],e.extraHeaders=e.extraHeaders.concat(this.dialog.routeSet.map(s=>`Record-Route: ${s}`));const n=super.accept(e),r=this.dialog,i=Object.assign(Object.assign({},n),{session:r});return e.body&&this.dialog.signalingStateTransition(e.body),this.dialog.reConfirm(),i}progress(e={statusCode:180}){const n=super.progress(e),r=this.dialog,i=Object.assign(Object.assign({},n),{session:r});return e.body&&this.dialog.signalingStateTransition(e.body),i}redirect(e,n={statusCode:302}){throw this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,new Error("Unimplemented.")}reject(e={statusCode:488}){return this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,super.reject(e)}}class Hte extends _r{constructor(e,n,r){const i=e.createOutgoingRequestMessage(ct.REFER,r);super(fi,e.userAgentCore,i,n)}}function zte(t){return t.userAgentCore!==void 0}class rR extends xs{constructor(e,n,r){const i=zte(e)?e.userAgentCore:e;super(di,i,n,r)}}class up extends ec{constructor(e,n,r,i){super(n,r),this.initialTransaction=e,this._signalingState=rt.Initial,this.ackWait=!1,this.ackProcessing=!1,this.delegate=i,e instanceof Gr&&(this.ackWait=!0),this.early||this.start2xxRetransmissionTimer(),this.signalingStateTransition(e.request),this.logger=n.loggerFactory.getLogger("sip.invite-dialog"),this.logger.log(`INVITE dialog ${this.id} constructed`)}dispose(){super.dispose(),this._signalingState=rt.Closed,this._offer=void 0,this._answer=void 0,this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.logger.log(`INVITE dialog ${this.id} destroyed`)}get sessionState(){return this.early?Ri.Early:this.ackWait?Ri.AckWait:this._signalingState===rt.Closed?Ri.Terminated:Ri.Confirmed}get signalingState(){return this._signalingState}get offer(){return this._offer}get answer(){return this._answer}confirm(){this.early&&this.start2xxRetransmissionTimer(),super.confirm()}reConfirm(){this.reinviteUserAgentServer&&this.startReInvite2xxRetransmissionTimer()}ack(e={}){this.logger.log(`INVITE dialog ${this.id} sending ACK request`);let n;if(this.reinviteUserAgentClient){if(!(this.reinviteUserAgentClient.transaction instanceof Io))throw new Error("Transaction not instance of InviteClientTransaction.");n=this.reinviteUserAgentClient.transaction,this.reinviteUserAgentClient=void 0}else{if(!(this.initialTransaction instanceof Io))throw new Error("Initial transaction not instance of InviteClientTransaction.");n=this.initialTransaction}const r=this.createOutgoingRequestMessage(ct.ACK,{cseq:n.request.cseq,extraHeaders:e.extraHeaders,body:e.body});return n.ackResponse(r),this.signalingStateTransition(r),{message:r}}bye(e,n){if(this.logger.log(`INVITE dialog ${this.id} sending BYE request`),this.initialTransaction instanceof Gr){if(this.early)throw new Error("UAS MUST NOT send a BYE on early dialogs.");if(this.ackWait&&this.initialTransaction.state!==Ce.Terminated)throw new Error("UAS MUST NOT send a BYE on a confirmed dialog until it has received an ACK for its 2xx response or until the server transaction times out.")}return new kte(this,e,n)}info(e,n){if(this.logger.log(`INVITE dialog ${this.id} sending INFO request`),this.early)throw new Error("Dialog not confirmed.");return new _te(this,e,n)}invite(e,n){if(this.logger.log(`INVITE dialog ${this.id} sending INVITE request`),this.early)throw new Error("Dialog not confirmed.");
655if(this.reinviteUserAgentClient)throw new Error("There is an ongoing re-INVITE client transaction.");if(this.reinviteUserAgentServer)throw new Error("There is an ongoing re-INVITE server transaction.");return new Fte(this,e,n)}message(e,n){if(this.logger.log(`INVITE dialog ${this.id} sending MESSAGE request`),this.early)throw new Error("Dialog not confirmed.");const r=this.createOutgoingRequestMessage(ct.MESSAGE,n);return new tR(this.core,r,e)}notify(e,n){if(this.logger.log(`INVITE dialog ${this.id} sending NOTIFY request`),this.early)throw new Error("Dialog not confirmed.");return new Mte(this,e,n)}prack(e,n){return this.logger.log(`INVITE dialog ${this.id} sending PRACK request`),new Lte(this,e,n)}refer(e,n){if(this.logger.log(`INVITE dialog ${this.id} sending REFER request`),this.early)throw new Error("Dialog not confirmed.");return new Hte(this,e,n)}receiveRequest(e){if(this.logger.log(`INVITE dialog ${this.id} received ${e.method} request`),e.method===ct.ACK){if(this.ackWait){if(this.initialTransaction instanceof Io){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}if(this.initialTransaction.request.cseq!==e.cseq){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}this.ackWait=!1}else{if(!this.reinviteUserAgentServer){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}if(this.reinviteUserAgentServer.transaction.request.cseq!==e.cseq){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}this.reinviteUserAgentServer=void 0}if(this.signalingStateTransition(e),this.delegate&&this.delegate.onAck){const n=this.delegate.onAck({message:e});n instanceof Promise&&(this.ackProcessing=!0,n.then(()=>this.ackProcessing=!1).catch(()=>this.ackProcessing=!1))}return}if(!this.sequenceGuard(e)){this.logger.log(`INVITE dialog ${this.id} rejected out of order ${e.method} request.`);return}if(super.receiveRequest(e),e.method===ct.INVITE){const n=()=>{const i=this.ackWait?"waiting for initial ACK":"processing initial ACK";this.logger.warn(`INVITE dialog ${this.id} received re-INVITE while ${i}`);let s="RFC 5407 suggests the following to avoid this race condition... ";s+=" Note: Implementation issues are outside the scope of this document,",s+=" but the following tip is provided for avoiding race conditions of",s+=" this type.  The caller can delay sending re-INVITE F6 for some period",s+=" of time (2 seconds, perhaps), after which the caller can reasonably",s+=" assume that its ACK has been received.  Implementors can decouple the",s+=" actions of the user (e.g., pressing the hold button) from the actions",s+=" of the protocol (the sending of re-INVITE F6), so that the UA can",s+=" behave like this.  In this case, it is the implementor's choice as to",s+=" how long to wait.  In most cases, such an implementation may be",s+=" useful to prevent the type of race condition shown in this section.",s+=" This document expresses no preference about whether or not they",s+=" should wait for an ACK to be delivered.  After considering the impact",s+=" on user experience, implementors should decide whether or not to wait",s+=" for a while, because the user experience depends on the",s+=" implementation and has no direct bearing on protocol behavior.",this.logger.warn(s)},r=[`Retry-After: ${Math.floor(Math.random()*10)+1}`];if(this.ackProcessing){this.core.replyStateless(e,{statusCode:500,extraHeaders:r}),n();return}if(this.ackWait&&this.signalingState!==rt.Stable){this.core.replyStateless(e,{statusCode:500,extraHeaders:r}),n();return}if(this.reinviteUserAgentServer){this.core.replyStateless(e,{statusCode:500,extraHeaders:r});return}if(this.reinviteUserAgentClient){this.core.replyStateless(e,{statusCode:491});return}}if(e.method===ct.INVITE){const n=e.parseHeader("contact");if(!n)throw new Error("Contact undefined.");if(!(n instanceof Wr))throw new Error("Contact not instance of NameAddrHeader.");this.dialogState.remoteTarget=n.uri}switch(e.method){case ct.BYE:{const n=new Nte(this,e);this.delegate&&this.delegate.onBye?this.delegate.onBye(n):n.accept(),this.dispose()}break;case ct.INFO:{const n=new Pte(this,e);this.delegate&&this.delegate.onInfo?this.delegate.onInfo(n):n.reject({statusCode:469,extraHeaders:["Recv-Info:"]})}break;case ct.INVITE:{const n=new Bte(this,e);this.signalingStateTransition(e),this.delegate&&this.delegate.onInv
655ite?this.delegate.onInvite(n):n.reject({statusCode:488})}break;case ct.MESSAGE:{const n=new nR(this.core,e);this.delegate&&this.delegate.onMessage?this.delegate.onMessage(n):n.accept()}break;case ct.NOTIFY:{const n=new dp(this,e);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(n):n.accept()}break;case ct.PRACK:{const n=new jte(this,e);this.delegate&&this.delegate.onPrack?this.delegate.onPrack(n):n.accept()}break;case ct.REFER:{const n=new rR(this,e);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(n):n.reject()}break;default:this.logger.log(`INVITE dialog ${this.id} received unimplemented ${e.method} request`),this.core.replyStateless(e,{statusCode:501});break}}reliableSequenceGuard(e){const n=e.statusCode;if(!n)throw new Error("Status code undefined");if(n>100&&n<200){const r=e.getHeader("require"),i=e.getHeader("rseq"),s=r&&r.includes("100rel")&&i?Number(i):void 0;if(s){if(this.rseq&&this.rseq+1!==s)return!1;this.rseq=this.rseq?this.rseq+1:s}}return!0}signalingStateRollback(){(this._signalingState===rt.HaveLocalOffer||this.signalingState===rt.HaveRemoteOffer)&&this._rollbackOffer&&this._rollbackAnswer&&(this._signalingState=rt.Stable,this._offer=this._rollbackOffer,this._answer=this._rollbackAnswer)}signalingStateTransition(e){const n=ud(e);if(!(!n||n.contentDisposition!=="session")){if(this._signalingState===rt.Stable&&(this._rollbackOffer=this._offer,this._rollbackAnswer=this._answer),e instanceof Ml)switch(this._signalingState){case rt.Initial:case rt.Stable:this._signalingState=rt.HaveRemoteOffer,this._offer=n,this._answer=void 0;break;case rt.HaveLocalOffer:this._signalingState=rt.Stable,this._answer=n;break;case rt.HaveRemoteOffer:break;case rt.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof qo)switch(this._signalingState){case rt.Initial:case rt.Stable:this._signalingState=rt.HaveRemoteOffer,this._offer=n,this._answer=void 0;break;case rt.HaveLocalOffer:this._signalingState=rt.Stable,this._answer=n;break;case rt.HaveRemoteOffer:break;case rt.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof ka)switch(this._signalingState){case rt.Initial:case rt.Stable:this._signalingState=rt.HaveLocalOffer,this._offer=n,this._answer=void 0;break;case rt.HaveLocalOffer:break;case rt.HaveRemoteOffer:this._signalingState=rt.Stable,this._answer=n;break;case rt.Closed:break;default:throw new Error("Unexpected signaling state.")}if(YT(e))switch(this._signalingState){case rt.Initial:case rt.Stable:this._signalingState=rt.HaveLocalOffer,this._offer=n,this._answer=void 0;break;case rt.HaveLocalOffer:break;case rt.HaveRemoteOffer:this._signalingState=rt.Stable,this._answer=n;break;case rt.Closed:break;default:throw new Error("Unexpected signaling state.")}}}start2xxRetransmissionTimer(){if(this.initialTransaction instanceof Gr){const e=this.initialTransaction;let n=ur.T1;const r=()=>{if(!this.ackWait){this.invite2xxTimer=void 0;return}this.logger.log("No ACK for 2xx response received, attempting retransmission"),e.retransmitAcceptedResponse(),n=Math.min(n*2,ur.T2),this.invite2xxTimer=setTimeout(r,n)};this.invite2xxTimer=setTimeout(r,n);const i=()=>{e.state===Ce.Terminated&&(e.removeStateChangeListener(i),this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.ackWait&&(this.delegate&&this.delegate.onAckTimeout?this.delegate.onAckTimeout():this.bye()))};e.addStateChangeListener(i)}}startReInvite2xxRetransmissionTimer(){if(this.reinviteUserAgentServer&&this.reinviteUserAgentServer.transaction instanceof Gr){const e=this.reinviteUserAgentServer.transaction;let n=ur.T1;const r=()=>{if(!this.reinviteUserAgentServer){this.invite2xxTimer=void 0;return}this.logger.log("No ACK for 2xx response received, attempting retransmission"),e.retransmitAcceptedResponse(),n=Math.min(n*2,ur.T2),this.invite2xxTimer=setTimeout(r,n)};this.invite2xxTimer=setTimeout(r,n);const i=()=>{e.state===Ce.Terminated&&(e.removeStateChangeListener(i),this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.reinviteUserAgentServer)};e.addStateChangeListener(i)}}}class qte extends _r{constructor(e,n,r){super(Io,e,n,r),this.confirmedDialogAcks=new Map,this.confirmedDialogs=new Map,this.earlyDialogs=new Map,this.delegate=r}
655dispose(){this.earlyDialogs.forEach(e=>e.dispose()),this.earlyDialogs.clear(),super.dispose()}onTransportError(e){if(this.transaction.state===Ce.Calling)return super.onTransportError(e);this.logger.error(e.message),this.logger.error("User agent client request transport error while sending ACK.")}receiveResponse(e){if(!this.authenticationGuard(e))return;const n=e.statusCode?e.statusCode.toString():"";if(!n)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(n):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});return;case/^1[0-9]{2}$/.test(n):{if(!e.toTag){this.logger.warn("Non-100 1xx INVITE response received without a to tag, dropping.");return}if(!e.parseHeader("contact")){this.logger.error("Non-100 1xx INVITE response received without a Contact header field, dropping.");return}const r=ec.initialDialogStateForUserAgentClient(this.message,e);let i=this.earlyDialogs.get(r.id);if(!i){const o=this.transaction;if(!(o instanceof Io))throw new Error("Transaction not instance of InviteClientTransaction.");i=new up(o,this.core,r),this.earlyDialogs.set(i.id,i)}if(!i.reliableSequenceGuard(e)){this.logger.warn("1xx INVITE reliable response received out of order or is a retransmission, dropping.");return}(i.signalingState===rt.Initial||i.signalingState===rt.HaveLocalOffer)&&i.signalingStateTransition(e);const s=i;this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:s,prack:o=>s.prack(void 0,o)})}return;case/^2[0-9]{2}$/.test(n):{if(!e.toTag){this.logger.error("2xx INVITE response received without a to tag, dropping.");return}if(!e.parseHeader("contact")){this.logger.error("2xx INVITE response received without a Contact header field, dropping.");return}const r=ec.initialDialogStateForUserAgentClient(this.message,e);let i=this.confirmedDialogs.get(r.id);if(i){const o=this.confirmedDialogAcks.get(r.id);if(o){const a=this.transaction;if(!(a instanceof Io))throw new Error("Client transaction not instance of InviteClientTransaction.");a.ackResponse(o.message)}return}if(i=this.earlyDialogs.get(r.id),i)i.confirm(),i.recomputeRouteSet(e),this.earlyDialogs.delete(i.id),this.confirmedDialogs.set(i.id,i);else{const o=this.transaction;if(!(o instanceof Io))throw new Error("Transaction not instance of InviteClientTransaction.");i=new up(o,this.core,r),this.confirmedDialogs.set(i.id,i)}(i.signalingState===rt.Initial||i.signalingState===rt.HaveLocalOffer)&&i.signalingStateTransition(e);const s=i;if(this.delegate&&this.delegate.onAccept)this.delegate.onAccept({message:e,session:s,ack:o=>{const a=s.ack(o);return this.confirmedDialogAcks.set(s.id,a),a}});else{const o=s.ack();this.confirmedDialogAcks.set(s.id,o)}}return;case/^3[0-9]{2}
655$/.test(n):this.earlyDialogs.forEach(r=>r.dispose()),this.earlyDialogs.clear(),this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});return;case/^[4-6][0-9]{2}$/.test(n):this.earlyDialogs.forEach(r=>r.dispose()),this.earlyDialogs.clear(),this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});return;default:throw new Error(`Invalid status code ${n}`)}}}class n1 extends xs{constructor(e,n,r){super(Gr,e,n,r),this.core=e}dispose(){this.earlyDialog&&this.earlyDialog.dispose(),super.dispose()}accept(e={statusCode:200}){if(!this.acceptable)throw new wo(`${this.message.method} not acceptable in state ${this.transaction.state}.`);if(!this.confirmedDialog)if(this.earlyDialog)this.earlyDialog.confirm(),this.confirmedDialog=this.earlyDialog,this.earlyDialog=void 0;else{const l=this.transaction;if(!(l instanceof Gr))throw new Error("Transaction not instance of InviteClientTransaction.");const c=ec.initialDialogStateForUserAgentServer(this.message,this.toTag);this.confirmedDialog=new up(l,this.core,c)}const n=this.message.getHeaders("record-route").map(l=>`Record-Route: ${l}`),r=`Contact: ${this.core.configuration.contact.toString()}`,i="Allow: "+Ro.toString();if(!e.body){if(this.confirmedDialog.signalingState===rt.Stable)e.body=this.confirmedDialog.answer;else if(this.confirmedDialog.signalingState===rt.Initial||this.confirmedDialog.signalingState===rt.HaveRemoteOffer)throw new Error("Response must have a body.")}e.statusCode=e.statusCode||200,e.extraHeaders=e.extraHeaders||[],e.extraHeaders=e.extraHeaders.concat(n),e.extraHeaders.push(i),e.extraHeaders.push(r);const s=super.accept(e),o=this.confirmedDialog,a=Object.assign(Object.assign({},s),{session:o});return e.body&&this.confirmedDialog.signalingState!==rt.Stable&&this.confirmedDialog.signalingStateTransition(e.body),a}progress(e={statusCode:180}){if(!this.progressable)throw new wo(`${this.message.method} not progressable in state ${this.transaction.state}.`);if(!this.earlyDialog){const a=this.transaction;if(!(a instanceof Gr))throw new Error("Transaction not instance of InviteClientTransaction.");const l=ec.initialDialogStateForUserAgentServer(this.message,this.toTag,!0);this.earlyDialog=new up(a,this.core,l)}const n=this.message.getHeaders("record-route").map(a=>`Record-Route: ${a}`),r=`Contact: ${this.core.configuration.contact}`;e.extraHeaders=e.extraHeaders||[],e.extraHeaders=e.extraHeaders.concat(n),e.extraHeaders.push(r);const i=super.progress(e),s=this.earlyDialog,o=Object.assign(Object.assign({},i),{session:s});return e.body&&this.earlyDialog.signalingState!==rt.Stable&&this.earlyDialog.signalingStateTransition(e.body),o}redirect(e,n={statusCode:302}){return super.redirect(e,n)}reject(e={statusCode:486}){return super.reject(e)}}class Ute extends _r{constructor(e,n,r){super(fi,e,n,r)}}class Vte extends _r{constructor(e,n,r){super(fi,e,n,r)}}class Wte extends xs{constructor(e,n,r){super(di,e,n,r),this.core=e}}class Gte extends _r{constructor(e,n,r){const i=e.createOutgoingRequestMessage(ct.SUBSCRIBE,r);super(fi,e.userAgentCore,i,n),this.dialog=e}waitNotifyStop(){}receiveResponse(e){if(e.statusCode&&e.statusCode>=200&&e.statusCode<300){const n=e.getHeader("Expires");if(!n)this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE");else{const r=Number(n);this.dialog.subscriptionExpires>r&&(this.dialog.subscriptionExpires=r)}}e.statusCode&&e.statusCode>=400&&e.statusCode<700&&[404,405,410,416,480,481,482,483,484,485,489,501,604].includes(e.statusCode)&&this.dialog.terminate(),super.receiveResponse(e)}}class P4 extends ec{constructor(e,n,r,i,s,o){super(i,s),this.delegate=o,this._autoRefresh=!1,this._subscriptionEvent=e,this._subscriptionExpires=n,this._subscriptionExpiresInitial=n,this._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),this._subscriptionRefresh=void 0,this._subscriptionRefreshLastSet=void 0,this._subscriptionState=r,this.logger=i.loggerFactory.getLogger("sip.subscribe-dialog"),this.logger.log(`SUBSCRIBE dialog ${this.id} constructed`)}static initialDialogStateForSubscription(e,n){const r=n.getHeaders("record-route"),i=n.parseHeader("contact");if(!i)throw new Error("Contact undefined.");if(!(i instanceof Wr))throw new Error("Contact not instance of NameAddrHeader.");const s=i.uri,o=e.cseq,a=void 0,l=e.callId,c=e.fromTag,d=n.fromTag;if(!l)throw new Error("Call id undefined.");if(!c)throw new Error("From tag undefined.");if(!d)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");
655const u=e.from.uri,f=e.to.uri;return{id:l+c+d,early:!1,callId:l,localTag:c,remoteTag:d,localSequenceNumber:o,remoteSequenceNumber:a,localURI:u,remoteURI:f,remoteTarget:s,routeSet:r,secure:!1}}dispose(){super.dispose(),this.N&&(clearTimeout(this.N),this.N=void 0),this.refreshTimerClear(),this.logger.log(`SUBSCRIBE dialog ${this.id} destroyed`)}get autoRefresh(){return this._autoRefresh}set autoRefresh(e){this._autoRefresh=!0,this.refreshTimerSet()}get subscriptionEvent(){return this._subscriptionEvent}get subscriptionExpires(){const e=Math.floor(Date.now()/1e3)-this._subscriptionExpiresLastSet,n=this._subscriptionExpires-e;return Math.max(n,0)}set subscriptionExpires(e){if(e<0)throw new Error("Expires must be greater than or equal to zero.");if(this._subscriptionExpires=e,this._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),this.autoRefresh){const n=this.subscriptionRefresh;(n===void 0||n>=e)&&this.refreshTimerSet()}}get subscriptionExpiresInitial(){return this._subscriptionExpiresInitial}get subscriptionRefresh(){if(this._subscriptionRefresh===void 0||this._subscriptionRefreshLastSet===void 0)return;const e=Math.floor(Date.now()/1e3)-this._subscriptionRefreshLastSet,n=this._subscriptionRefresh-e;return Math.max(n,0)}get subscriptionState(){return this._subscriptionState}receiveRequest(e){if(this.logger.log(`SUBSCRIBE dialog ${this.id} received ${e.method} request`),!this.sequenceGuard(e)){this.logger.log(`SUBSCRIBE dialog ${this.id} rejected out of order ${e.method} request.`);return}switch(super.receiveRequest(e),e.method){case ct.NOTIFY:this.onNotify(e);break;default:this.logger.log(`SUBSCRIBE dialog ${this.id} received unimplemented ${e.method} request`),this.core.replyStateless(e,{statusCode:501});break}}refresh(){const e="Allow: "+Ro.toString(),n={};return n.extraHeaders=(n.extraHeaders||[]).slice(),n.extraHeaders.push(e),n.extraHeaders.push("Event: "+this.subscriptionEvent),n.extraHeaders.push("Expires: "+this.subscriptionExpiresInitial),n.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,n)}subscribe(e,n={}){var r;if(this.subscriptionState!==Jt.Pending&&this.subscriptionState!==Jt.Active)throw new Error(`Invalid state ${this.subscriptionState}. May only re-subscribe while in state "pending" or "active".`);this.logger.log(`SUBSCRIBE dialog ${this.id} sending SUBSCRIBE request`);const i=new Gte(this,e,n);return this.N&&(clearTimeout(this.N),this.N=void 0),!((r=n.extraHeaders)===null||r===void 0)&&r.includes("Expires: 0")||(this.N=setTimeout(()=>this.timerN(),ur.TIMER_N)),i}terminate(){this.stateTransition(Jt.Terminated),this.onTerminated()}unsubscribe(){const e="Allow: "+Ro.toString(),n={};return n.extraHeaders=(n.extraHeaders||[]).slice(),n.extraHeaders.push(e),n.extraHeaders.push("Event: "+this.subscriptionEvent),n.extraHeaders.push("Expires: 0"),n.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,n)}onNotify(e){const n=e.parseHeader("Event").event;if(!n||n!==this.subscriptionEvent){this.core.replyStateless(e,{statusCode:489});return}this.N&&(clearTimeout(this.N),this.N=void 0);const r=e.parseHeader("Subscription-State");if(!r||!r.state){this.core.replyStateless(e,{statusCode:489});return}const i=r.state,s=r.expires?Math.max(r.expires,0):void 0;switch(i){case"pending":this.stateTransition(Jt.Pending,s);break;case"active":this.stateTransition(Jt.Active,s);break;case"terminated":this.stateTransition(Jt.Terminated,s);break;default:this.logger.warn("Unrecognized subscription state.");break}const o=new dp(this,e);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(o):o.accept()}onRefresh(e){this.delegate&&this.delegate.onRefresh&&this.delegate.onRefresh(e)}onTerminated(){this.delegate&&this.delegate.onTerminated&&this.delegate.onTerminated()}refreshTimerClear(){this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)}refreshTimerSet(){if(this.refreshTimerClear(),this.autoRefresh&&this.subscriptionExpires>0){const e=this.subscriptionExpires*900;this._subscriptionRefresh=Math.floor(e/1e3),this._subscriptionRefreshLastSet=Math.floor(Date.now()/1e3),this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,this._subscriptionRefresh=void 0,this._subscriptionRefreshLastSet=void 0,this.onRefresh(this.refresh())},e)}}stateTransition(e,n){const r=()=>{this.logger.warn(`Invalid subscription state transition from ${this.subscriptionState} to ${e}`)};switch(e){case Jt.Initial:r();return;case Jt.NotifyWait:r();return;case Jt.Pending:if(this.subscriptionState!==Jt.NotifyWait&&this.subscriptionState!==Jt.Pending){r();return}break;case Jt.Active:if(this.subscriptionState!==Jt.NotifyWait&&this.subscriptionState!==Jt.Pending&&this.subscriptionState!==Jt.Active){r();return}break;case Jt.Terminated:if(this.subscriptionState!==Jt.NotifyWait&&this.subscriptionState!==Jt.Pending&&this.subscriptionState!==Jt.Active){r();return}break;default:r();return}e===Jt.Pending&&n&&(this.subscriptionExpires=n),e===Jt.Active&&n&&(this.subscriptionExpires=n),e===Jt.Terminated&&this.dispose(),this._subscriptionState=e}timerN(){this.logger.warn("Timer N expired for SUBSCRIBE dialog. Timed out waiting for NOTIFY."),this.subscriptionState!==Jt.Terminated&&(this.stateTransition(Jt.Terminated),this.onTerminated())}}class Kte extends _r{constructor(e,n,r){const i=n.getHeader("Event");
655if(!i)throw new Error("Event undefined");const s=n.getHeader("Expires");if(!s)throw new Error("Expires undefined");super(fi,e,n,r),this.delegate=r,this.subscriberId=n.callId+n.fromTag+i,this.subscriptionExpiresRequested=this.subscriptionExpires=Number(s),this.subscriptionEvent=i,this.subscriptionState=Jt.NotifyWait,this.waitNotifyStart()}dispose(){super.dispose()}onNotify(e){const n=e.message.parseHeader("Event").event;if(!n||n!==this.subscriptionEvent){this.logger.warn("Failed to parse event."),e.reject({statusCode:489});return}const r=e.message.parseHeader("Subscription-State");if(!r||!r.state){this.logger.warn("Failed to parse subscription state."),e.reject({statusCode:489});return}const i=r.state;switch(i){case"pending":break;case"active":break;case"terminated":break;default:this.logger.warn(`Invalid subscription state ${i}`),e.reject({statusCode:489});return}if(i!=="terminated"&&!e.message.parseHeader("contact")){this.logger.warn("Failed to parse contact."),e.reject({statusCode:489});return}if(this.dialog)throw new Error("Dialog already created. This implementation only supports install of single subscriptions.");switch(this.waitNotifyStop(),this.subscriptionExpires=r.expires?Math.min(this.subscriptionExpires,Math.max(r.expires,0)):this.subscriptionExpires,i){case"pending":this.subscriptionState=Jt.Pending;break;case"active":this.subscriptionState=Jt.Active;break;case"terminated":this.subscriptionState=Jt.Terminated;break;default:throw new Error(`Unrecognized state ${i}.`)}if(this.subscriptionState!==Jt.Terminated){const s=P4.initialDialogStateForSubscription(this.message,e.message);this.dialog=new P4(this.subscriptionEvent,this.subscriptionExpires,this.subscriptionState,this.core,s)}if(this.delegate&&this.delegate.onNotify){const s=e,o=this.dialog;this.delegate.onNotify({request:s,subscription:o})}else e.accept()}waitNotifyStart(){this.N||(this.core.subscribers.set(this.subscriberId,this),this.N=setTimeout(()=>this.timerN(),ur.TIMER_N))}waitNotifyStop(){this.N&&(this.core.subscribers.delete(this.subscriberId),clearTimeout(this.N),this.N=void 0)}receiveResponse(e){if(this.authenticationGuard(e)){if(e.statusCode&&e.statusCode>=200&&e.statusCode<300){const n=e.getHeader("Expires");if(!n)this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE");else{const r=Number(n);r>this.subscriptionExpiresRequested&&this.logger.warn("Expires header in a 200-class response to SUBSCRIBE with a higher value than the one in the request"),r<this.subscriptionExpires&&(this.subscriptionExpires=r)}this.dialog&&this.dialog.subscriptionExpires>this.subscriptionExpires&&(this.dialog.subscriptionExpires=this.subscriptionExpires)}e.statusCode&&e.statusCode>=300&&e.statusCode<700&&this.waitNotifyStop(),super.receiveResponse(e)}}timerN(){this.logger.warn("Timer N expired for SUBSCRIBE user agent client. Timed out waiting for NOTIFY."),this.waitNotifyStop(),this.delegate&&this.delegate.onNotifyTimeout&&this.delegate.onNotifyTimeout()}}class Xte extends xs{constructor(e,n,r){super(di,e,n,r),this.core=e}}const M4=["application/sdp","application/dtmf-relay"];class Yte{constructor(e,n={}){this.userAgentClients=new Map,this.userAgentServers=new Map,this.configuration=e,this.delegate=n,this.dialogs=new Map,this.subscribers=new Map,this.logger=e.loggerFactory.getLogger("sip.user-agent-core")}dispose(){this.reset()}
655reset(){this.dialogs.forEach(e=>e.dispose()),this.dialogs.clear(),this.subscribers.forEach(e=>e.dispose()),this.subscribers.clear(),this.userAgentClients.forEach(e=>e.dispose()),this.userAgentClients.clear(),this.userAgentServers.forEach(e=>e.dispose()),this.userAgentServers.clear()}get loggerFactory(){return this.configuration.loggerFactory}get transport(){const e=this.configuration.transportAccessor();if(!e)throw new Error("Transport undefined.");return e}invite(e,n){return new qte(this,e,n)}message(e,n){return new tR(this,e,n)}publish(e,n){return new Ute(this,e,n)}register(e,n){return new Vte(this,e,n)}subscribe(e,n){return new Kte(this,e,n)}request(e,n){return new _r(fi,this,e,n)}makeOutgoingRequestMessage(e,n,r,i,s,o,a){const l=this.configuration.sipjsId,c=this.configuration.displayName,d=this.configuration.viaForceRport,u=this.configuration.hackViaTcp,f=this.configuration.supportedOptionTags.slice();e===ct.REGISTER&&f.push("path","gruu"),e===ct.INVITE&&(this.configuration.contact.pubGruu||this.configuration.contact.tempGruu)&&f.push("gruu");const h=this.configuration.routeSet,p=this.configuration.userAgentHeaderFieldValue,g=this.configuration.viaHost,v=Object.assign(Object.assign({},{callIdPrefix:l,forceRport:d,fromDisplayName:c,hackViaTcp:u,optionTags:f,routeSet:h,userAgentString:p,viaHost:g}),s);return new ka(e,n,r,i,v,o,a)}receiveIncomingRequestFromTransport(e){this.receiveRequestFromTransport(e)}receiveIncomingResponseFromTransport(e){this.receiveResponseFromTransport(e)}replyStateless(e,n){const r=this.configuration.userAgentHeaderFieldValue,i=this.configuration.supportedOptionTagsResponse;n=Object.assign(Object.assign({},n),{userAgent:r,supported:i});const s=QT(e,n);return this.transport.send(s.message).catch(o=>{o instanceof Error&&this.logger.error(o.message),this.logger.error(`Transport error occurred sending stateless reply to ${e.method} request.`)}),s}receiveRequestFromTransport(e){const n=e.viaBranch,r=this.userAgentServers.get(n);if(e.method===ct.ACK&&r&&r.transaction.state===Ce.Accepted&&r instanceof n1){this.logger.warn(`Discarding out of dialog ACK after 2xx response sent on transaction ${n}.`);return}if(e.method===ct.CANCEL){r?(this.replyStateless(e,{statusCode:200}),r.transaction instanceof Gr&&r.transaction.state===Ce.Proceeding&&r instanceof n1&&r.receiveCancel(e)):this.replyStateless(e,{statusCode:481});return}if(r){r.transaction.receiveRequest(e);return}this.receiveRequest(e)}receiveRequest(e){if(!Ro.includes(e.method)){const i="Allow: "+Ro.toString();this.replyStateless(e,{statusCode:405,extraHeaders:[i]});return}if(!e.ruri)throw new Error("Request-URI undefined.");if(e.ruri.scheme!=="sip"){this.replyStateless(e,{statusCode:416});return}const n=e.ruri,r=i=>!!i&&i.user===n.user;if(!r(this.configuration.aor)&&!(r(this.configuration.contact.uri)||r(this.configuration.contact.pubGruu)||r(this.configuration.contact.tempGruu))){this.logger.warn("Request-URI does not point to us."),e.method!==ct.ACK&&this.replyStateless(e,{statusCode:404});return}if(e.method===ct.INVITE&&!e.hasHeader("Contact")){this.replyStateless(e,{statusCode:400,reasonPhrase:"Missing Contact Header"});return}if(!e.toTag){const i=e.viaBranch;if(!this.userAgentServers.has(i)&&Array.from(this.userAgentServers.values()).some(s=>s.transaction.request.fromTag===e.fromTag&&s.transaction.request.callId===e.callId&&s.transaction.request.cseq===e.cseq)){this.replyStateless(e,{statusCode:482});return}}e.toTag?this.receiveInsideDialogRequest(e):this.receiveOutsideDialogRequest(e)}receiveInsideDialogRequest(e){if(e.method===ct.NOTIFY){const i=e.parseHeader("Event");if(!i||!i.event){this.replyStateless(e,{statusCode:489});return}const s=e.callId+e.toTag+i.event,o=this.subscribers.get(s);if(o){const a=new dp(this,e);o.onNotify(a);return}}const n=e.callId+e.toTag+e.fromTag,r=this.dialogs.get(n);if(r){if(e.method===ct.OPTIONS){const i="Allow: "+Ro.toString(),s="Accept: "+M4.toString();this.replyStateless(e,{statusCode:200,extraHeaders:[i,s]});return}r.receiveRequest(e);return}e.method!==ct.ACK&&this.replyStateless(e,{statusCode:481})}receiveOutsideDialogRequest(e){switch(e.method){case ct.ACK:break;case ct.BYE:this.replyStateless(e,{statusCode:481});break;
655case ct.CANCEL:throw new Error(`Unexpected out of dialog request method ${e.method}.`);case ct.INFO:this.replyStateless(e,{statusCode:405});break;case ct.INVITE:{const n=new n1(this,e);this.delegate.onInvite?this.delegate.onInvite(n):n.reject()}break;case ct.MESSAGE:{const n=new nR(this,e);this.delegate.onMessage?this.delegate.onMessage(n):n.accept()}break;case ct.NOTIFY:{const n=new dp(this,e);this.delegate.onNotify?this.delegate.onNotify(n):n.reject({statusCode:405})}break;case ct.OPTIONS:{const n="Allow: "+Ro.toString(),r="Accept: "+M4.toString();this.replyStateless(e,{statusCode:200,extraHeaders:[n,r]})}break;case ct.REFER:{const n=new rR(this,e);this.delegate.onRefer?this.delegate.onRefer(n):n.reject({statusCode:405})}break;case ct.REGISTER:{const n=new Wte(this,e);this.delegate.onRegister?this.delegate.onRegister(n):n.reject({statusCode:405})}break;case ct.SUBSCRIBE:{const n=new Xte(this,e);this.delegate.onSubscribe?this.delegate.onSubscribe(n):n.reject({statusCode:480})}break;default:throw new Error(`Unexpected out of dialog request method ${e.method}.`)}}receiveResponseFromTransport(e){if(e.getHeaders("via").length>1){this.logger.warn("More than one Via header field present in the response, dropping");return}const n=e.viaBranch+e.method,r=this.userAgentClients.get(n);r?r.transaction.receiveResponse(e):this.logger.warn(`Discarding unmatched ${e.statusCode} response to ${e.method} ${n}.`)}}function Jte(){return t=>!t.audio&&!t.video?Promise.resolve(new MediaStream):navigator.mediaDevices===void 0?Promise.reject(new Error("Media devices not available in insecure contexts.")):navigator.mediaDevices.getUserMedia.call(navigator.mediaDevices,t)}function Qte(){return{bundlePolicy:"balanced",certificates:void 0,iceCandidatePoolSize:0,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",rtcpMuxPolicy:"require"}}class Dr{constructor(e,n,r){e.debug("SessionDescriptionHandler.constructor"),this.logger=e,this.mediaStreamFactory=n,this.sessionDescriptionHandlerConfiguration=r,this._localMediaStream=new MediaStream,this._remoteMediaStream=new MediaStream,this._peerConnection=new RTCPeerConnection(r==null?void 0:r.peerConnectionConfiguration),this.initPeerConnectionEventHandlers()}get localMediaStream(){return this._localMediaStream}get remoteMediaStream(){return this._remoteMediaStream}get dataChannel(){return this._dataChannel}get peerConnection(){return this._peerConnection}get peerConnectionDelegate(){return this._peerConnectionDelegate}set peerConnectionDelegate(e){this._peerConnectionDelegate=e}static dispatchAddTrackEvent(e,n){e.dispatchEvent(new MediaStreamTrackEvent("addtrack",{track:n}))}static dispatchRemoveTrackEvent(e,n){e.dispatchEvent(new MediaStreamTrackEvent("removetrack",{track:n}))}close(){this.logger.debug("SessionDescriptionHandler.close"),this._peerConnection!==void 0&&(this._peerConnection.getReceivers().forEach(e=>{e.track&&e.track.stop()}),this._peerConnection.getSenders().forEach(e=>{e.track&&e.track.stop()}),this._dataChannel&&this._dataChannel.close(),this._peerConnection.close(),this._peerConnection=void 0)}enableReceiverTracks(e){const n=this.peerConnection;if(!n)throw new Error("Peer connection closed.");n.getReceivers().forEach(r=>{r.track&&(r.track.enabled=e)})}enableSenderTracks(e){const n=this.peerConnection;if(!n)throw new Error("Peer connection closed.");n.getSenders().forEach(r=>{r.track&&(r.track.enabled=e)})}getDescription(e,n){var r,i;if(this.logger.debug("SessionDescriptionHandler.getDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=e==null?void 0:e.onDataChannel;const s=(r=e==null?void 0:e.offerOptions)===null||r===void 0?void 0:r.iceRestart,o=(e==null?void 0:e.iceGatheringTimeout)===void 0?(i=this.sessionDescriptionHandlerConfiguration)===null||i===void 0?void 0:i.iceGatheringTimeout:e==null?void 0:e.iceGatheringTimeout;return this.getLocalMediaStream(e).then(()=>this.updateDirection(e)).then(()=>this.createDataChannel(e)).then(()=>this.createLocalOfferOrAnswer(e)).then(a=>this.applyModifiers(a,n)).then(a=>this.setLocalSessionDescription(a)).then(()=>this.waitForIceGatheringComplete(s,o)).then(()=>this.getLocalSessionDescription()).then(a=>({body:a.sdp,contentType:"application/sdp"})).catch(a=>{throw this.logger.error("SessionDescriptionHandler.getDescription failed - "+a),a})}hasDescription(e){return this.logger.debug("SessionDescriptionHandler.hasDescription"),e==="application/sdp"}iceGatheringComplete(){this.logger.debug("SessionDescriptionHandler.iceGatheringComplete"),this.iceGatheringCompleteTimeoutId!==void 0&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - clearing timeout"),clearTimeout(this.iceGatheringCompleteTimeoutId),this.iceGatheringCompleteTimeoutId=void 0),this.iceGatheringCompletePromise!==void 0&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - resolving promise"),this.iceGatheringCompleteResolve&&this.iceGatheringCompleteResolve(),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0)}sendDtmf(e,n){if(this.logger.debug("SessionDescriptionHandler.sendDtmf"),this._peerConnection===void 0)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - peer connection closed"),!1;const r=this._peerConnection.getSenders();if(r.length===0)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no senders"),!1;const i=r[0].dtmf;if(!i)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no DTMF sender"),!1;const s=n==null?void 0:n.duration,o=n==null?void 0:n.interToneGap;try{i.insertDTMF(e,s,o)}catch(a){return this.logger.error(a.toString()),!1}return this.logger.log("SessionDescriptionHandler.sendDtmf sent via RTP: "+e.toString()),!0}setDescription(e,n,r){if(this.logger.debug("SessionDescriptionHandler.setDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=n==null?void 0:n.onDataChannel;const i=this._peerConnection.signalingState==="have-local-offer"?"answer":"offer";return this.getLocalMediaStream(n).then(()=>this.applyModifiers({sdp:e,type:i},r)).then(s=>this.setRemoteSessionDescription(s)).catch(s=>{throw this.logger.error("SessionDescriptionHandler.setDescription failed - "+s),s})}applyModifiers(e,n){return this.logger.debug("SessionDescriptionHandler.applyModifiers"),!n||n.length===0?Promise.resolve(e):n.reduce((r,i)=>r.then(i),Promise.resolve(e)).then(r=>{if(this.logger.debug("SessionDescriptionHandler.applyModifiers - modified sdp"),!r.sdp||!r.type)throw new Error("Invalid SDP.");return{sdp:r.sdp,type:r.type}})}
655createDataChannel(e){if(this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));if((e==null?void 0:e.dataChannel)!==!0||this._dataChannel)return Promise.resolve();switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.createDataChannel - creating data channel");try{return this._dataChannel=this._peerConnection.createDataChannel((e==null?void 0:e.dataChannelLabel)||"",e==null?void 0:e.dataChannelOptions),this.onDataChannel&&this.onDataChannel(this._dataChannel),Promise.resolve()}catch(n){return Promise.reject(n)}case"have-remote-offer":return Promise.resolve();case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}}createLocalOfferOrAnswer(e){if(this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP offer"),this._peerConnection.createOffer(e==null?void 0:e.offerOptions);case"have-remote-offer":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP answer"),this._peerConnection.createAnswer(e==null?void 0:e.answerOptions);case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}}getLocalMediaStream(e){if(this.logger.debug("SessionDescriptionHandler.getLocalMediaStream"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));let n=Object.assign({},e==null?void 0:e.constraints);if(this.localMediaStreamConstraints){if(n.audio=n.audio||this.localMediaStreamConstraints.audio,n.video=n.video||this.localMediaStreamConstraints.video,JSON.stringify(this.localMediaStreamConstraints.audio)===JSON.stringify(n.audio)&&JSON.stringify(this.localMediaStreamConstraints.video)===JSON.stringify(n.video))return Promise.resolve()}else n.audio===void 0&&n.video===void 0&&(n={audio:!0});return this.localMediaStreamConstraints=n,this.mediaStreamFactory(n,this,e).then(r=>this.setLocalMediaStream(r))}setLocalMediaStream(e){if(this.logger.debug("SessionDescriptionHandler.setLocalMediaStream"),!this._peerConnection)throw new Error("Peer connection undefined.");const n=this._peerConnection,r=this._localMediaStream,i=[],s=l=>{const c=l.kind;if(c!=="audio"&&c!=="video")throw new Error(`Unknown new track kind ${c}.`);const d=n.getSenders().find(u=>u.track&&u.track.kind===c);d?i.push(new Promise(u=>{this.logger.debug(`SessionDescriptionHandler.setLocalMediaStream - replacing sender ${c} track`),u()}).then(()=>d.replaceTrack(l).then(()=>{const u=r.getTracks().find(f=>f.kind===c);u&&(u.stop(),r.removeTrack(u),Dr.dispatchRemoveTrackEvent(r,u)),r.addTrack(l),Dr.dispatchAddTrackEvent(r,l)}).catch(u=>{throw this.logger.error(`SessionDescriptionHandler.setLocalMediaStream - failed to replace sender ${c} track`),u}))):i.push(new Promise(u=>{this.logger.debug(`SessionDescriptionHandler.setLocalMediaStream - adding sender ${c} track`),u()}).then(()=>{try{n.addTrack(l,r)}catch(u){throw this.logger.error(`SessionDescriptionHandler.setLocalMediaStream - failed to add sender ${c} track`),u}r.addTrack(l),Dr.dispatchAddTrackEvent(r,l)}))},o=e.getAudioTracks();o.length&&s(o[0]);const a=e.getVideoTracks();return a.length&&s(a[0]),i.reduce((l,c)=>l.then(()=>c),Promise.resolve())}getLocalSessionDescription(){if(this.logger.debug("SessionDescriptionHandler.getLocalSessionDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));const e=this._peerConnection.localDescription;return e?Promise.resolve(e):Promise.reject(new Error("Failed to get local session description"))}setLocalSessionDescription(e){return this.logger.debug("SessionDescriptionHandler.setLocalSessionDescription"),this._peerConnection===void 0?Promise.reject(new Error("Peer connection closed.")):this._peerConnection.setLocalDescription(e)}setRemoteSessionDescription(e){if(this.logger.debug("SessionDescriptionHandler.setRemoteSessionDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));const n=e.sdp;let r;switch(this._peerConnection.signalingState){case"stable":r="offer";break;case"have-local-offer":r="answer";break;case"have-local-pranswer":case"have-remote-offer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return n?this._peerConnection.setRemoteDescription({sdp:n,type:r}):(this.logger.error("SessionDescriptionHandler.setRemoteSessionDescription failed - cannot set null sdp"),Promise.reject(new Error("SDP is undefined")))}setRemoteTrack(e){this.logger.debug("SessionDescriptionHandler.setRemoteTrack");const n=this._remoteMediaStream;n.getTrackById(e.id)?this.logger.debug(`SessionDescriptionHandler.setRemoteTrack - have remote ${e.kind} track`):e.kind==="audio"?(this.logger.debug(`SessionDescriptionHandler.setRemoteTrack - adding remote ${e.kind}
655 track`),n.getAudioTracks().forEach(r=>{r.stop(),n.removeTrack(r),Dr.dispatchRemoveTrackEvent(n,r)}),n.addTrack(e),Dr.dispatchAddTrackEvent(n,e)):e.kind==="video"&&(this.logger.debug(`SessionDescriptionHandler.setRemoteTrack - adding remote ${e.kind} track`),n.getVideoTracks().forEach(r=>{r.stop(),n.removeTrack(r),Dr.dispatchRemoveTrackEvent(n,r)}),n.addTrack(e),Dr.dispatchAddTrackEvent(n,e))}updateDirection(e){if(this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.updateDirection - setting offer direction");{const n=r=>{switch(r){case"inactive":return e!=null&&e.hold?"inactive":"recvonly";case"recvonly":return e!=null&&e.hold?"inactive":"recvonly";case"sendonly":return e!=null&&e.hold?"sendonly":"sendrecv";case"sendrecv":return e!=null&&e.hold?"sendonly":"sendrecv";case"stopped":return"stopped";default:throw new Error("Should never happen")}};this._peerConnection.getTransceivers().forEach(r=>{if(r.direction){const i=n(r.direction);r.direction!==i&&(r.direction=i)}})}break;case"have-remote-offer":this.logger.debug("SessionDescriptionHandler.updateDirection - setting answer direction");{const n=(()=>{const i=this._peerConnection.remoteDescription;if(!i)throw new Error("Failed to read remote offer");const s=/a=sendrecv\r\n|a=sendonly\r\n|a=recvonly\r\n|a=inactive\r\n/.exec(i.sdp);if(s)switch(s[0]){case`a=inactive\r
656`:return"inactive";case`a=recvonly\r
657`:return"recvonly";case`a=sendonly\r
658`:return"sendonly";case`a=sendrecv\r
659`:return"sendrecv";default:throw new Error("Should never happen")}return"sendrecv"})(),r=(()=>{switch(n){case"inactive":return"inactive";case"recvonly":return"sendonly";case"sendonly":return e!=null&&e.hold?"inactive":"recvonly";case"sendrecv":return e!=null&&e.hold?"sendonly":"sendrecv";default:throw new Error("Should never happen")}})();this._peerConnection.getTransceivers().forEach(i=>{i.direction&&i.direction!=="stopped"&&i.direction!==r&&(i.direction=r)})}break;case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return Promise.resolve()}waitForIceGatheringComplete(e=!1,n=0){return this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete"),this._peerConnection===void 0?Promise.reject("Peer connection closed."):!e&&this._peerConnection.iceGatheringState==="complete"?(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - already complete"),Promise.resolve()):(this.iceGatheringCompletePromise!==void 0&&(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - rejecting prior waiting promise"),this.iceGatheringCompleteReject&&this.iceGatheringCompleteReject(new Error("Promise superseded.")),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0),this.iceGatheringCompletePromise=new Promise((r,i)=>{this.iceGatheringCompleteResolve=r,this.iceGatheringCompleteReject=i,n>0&&(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout in "+n),this.iceGatheringCompleteTimeoutId=setTimeout(()=>{this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout"),this.iceGatheringComplete()},n))}),this.iceGatheringCompletePromise)}initPeerConnectionEventHandlers(){if(this.logger.debug("SessionDescriptionHandler.initPeerConnectionEventHandlers"),!this._peerConnection)throw new Error("Peer connection undefined.");const e=this._peerConnection;e.onconnectionstatechange=n=>{var r;const i=e.connectionState;this.logger.debug(`SessionDescriptionHandler.onconnectionstatechange ${i}`),!((r=this._peerConnectionDelegate)===null||r===void 0)&&r.onconnectionstatechange&&this._peerConnectionDelegate.onconnectionstatechange(n)},e.ondatachannel=n=>{var r;this.logger.debug("SessionDescriptionHandler.ondatachannel"),this._dataChannel=n.channel,this.onDataChannel&&this.onDataChannel(this._dataChannel),!((r=this._peerConnectionDelegate)===null||r===void 0)&&r.ondatachannel&&this._peerConnectionDelegate.ondatachannel
659(n)},e.onicecandidate=n=>{var r;this.logger.debug("SessionDescriptionHandler.onicecandidate"),!((r=this._peerConnectionDelegate)===null||r===void 0)&&r.onicecandidate&&this._peerConnectionDelegate.onicecandidate(n)},e.onicecandidateerror=n=>{var r;this.logger.debug("SessionDescriptionHandler.onicecandidateerror"),!((r=this._peerConnectionDelegate)===null||r===void 0)&&r.onicecandidateerror&&this._peerConnectionDelegate.onicecandidateerror(n)},e.oniceconnectionstatechange=n=>{var r;const i=e.iceConnectionState;this.logger.debug(`SessionDescriptionHandler.oniceconnectionstatechange ${i}`),!((r=this._peerConnectionDelegate)===null||r===void 0)&&r.oniceconnectionstatechange&&this._peerConnectionDelegate.oniceconnectionstatechange(n)},e.onicegatheringstatechange=n=>{var r;const i=e.iceGatheringState;this.logger.debug(`SessionDescriptionHandler.onicegatheringstatechange ${i}`),i==="complete"&&this.iceGatheringComplete(),!((r=this._peerConnectionDelegate)===null||r===void 0)&&r.onicegatheringstatechange&&this._peerConnectionDelegate.onicegatheringstatechange(n)},e.onnegotiationneeded=n=>{var r;this.logger.debug("SessionDescriptionHandler.onnegotiationneeded"),!((r=this._peerConnectionDelegate)===null||r===void 0)&&r.onnegotiationneeded&&this._peerConnectionDelegate.onnegotiationneeded(n)},e.onsignalingstatechange=n=>{var r;const i=e.signalingState;this.logger.debug(`SessionDescriptionHandler.onsignalingstatechange ${i}`),!((r=this._peerConnectionDelegate)===null||r===void 0)&&r.onsignalingstatechange&&this._peerConnectionDelegate.onsignalingstatechange(n)},e.ontrack=n=>{var r;const i=n.track.kind,s=n.track.enabled?"enabled":"disabled";this.logger.debug(`SessionDescriptionHandler.ontrack ${i} ${s}`),this.setRemoteTrack(n.track),!((r=this._peerConnectionDelegate)===null||r===void 0)&&r.ontrack&&this._peerConnectionDelegate.ontrack(n)}}}function Zte(t){return(e,n)=>{t===void 0&&(t=Jte());const r={iceGatheringTimeout:(n==null?void 0:n.iceGatheringTimeout)!==void 0?n==null?void 0:n.iceGatheringTimeout:5e3,peerConnectionConfiguration:Object.assign(Object.assign({},Qte()),n==null?void 0:n.peerConnectionConfiguration)},i=e.userAgent.getLogger("sip.SessionDescriptionHandler");return new Dr(i,t,r)}}class Cu{constructor(e,n){if(this._state=Rt.Disconnected,this.transitioningState=!1,this._stateEventEmitter=new Fd,this.logger=e,n){const s=n,o=s==null?void 0:s.wsServers,a=s==null?void 0:s.maxReconnectionAttempts;o!==void 0&&this.logger.warn('The transport option "wsServers" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),a!==void 0&&this.logger.warn('The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),o&&!n.server&&(typeof o=="string"&&(n.server=o),o instanceof Array&&(n.server=o[0]))}this.configuration=Object.assign(Object.assign({},Cu.defaultOptions),n);const r=this.configuration.server,i=Vn.parse(r,"absoluteURI");if(i===-1)throw this.logger.error(`Invalid WebSocket Server URL "${r}"`),new Error("Invalid WebSocket Server URL");if(!["wss","ws","udp"].includes(i.scheme))throw this.logger.error(`Invalid scheme in WebSocket Server URL "${r}"`),new Error("Invalid scheme in WebSocket Server URL");this._protocol=i.scheme.toUpperCase()}dispose(){return this.disconnect()}get protocol(){return this._protocol}get server(){return this.configuration.server}get state(){return this._state}get stateChange(){return this._stateEventEmitter}get ws(){return this._ws}connect(){return this._connect()}disconnect(){return this._disconnect()}isConnected(){return this.state===Rt.Connected}send(e){return this._send(e)}_connect(){switch(this.logger.log(`Connecting ${this.server}`),this.state){case Rt.Connecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(Rt.Connecting));if(!this.connectPromise)throw new Error("Connect promise must be defined.");return this.connectPromise;case Rt.Connected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(Rt.Connecting));if(this.connectPromise)throw new Error("Connect promise must not be defined.");return Promise.resolve();case Rt.Disconnecting:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(Rt.Connecting)}catch(n){if(n instanceof Nc)return Promise.reject(n);throw n}break;case Rt.Disconnected:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(Rt.Connecting)}catch(n){if(n instanceof Nc)return Promise.reject(n);throw n}break;default:throw new Error("Unknown state")}let e;try{e=new WebSocket(this.server,"sip"),e.binaryType="arraybuffer",e.addEventListener("close",n=>
659this.onWebSocketClose(n,e)),e.addEventListener("error",n=>this.onWebSocketError(n,e)),e.addEventListener("open",n=>this.onWebSocketOpen(n,e)),e.addEventListener("message",n=>this.onWebSocketMessage(n,e)),this._ws=e}catch(n){return this._ws=void 0,this.logger.error("WebSocket construction failed."),this.logger.error(n.toString()),new Promise((r,i)=>{this.connectResolve=r,this.connectReject=i,this.transitionState(Rt.Disconnected,n)})}return this.connectPromise=new Promise((n,r)=>{this.connectResolve=n,this.connectReject=r,this.connectTimeout=setTimeout(()=>{this.logger.warn("Connect timed out. Exceeded time set in configuration.connectionTimeout: "+this.configuration.connectionTimeout+"s."),e.close(1e3)},this.configuration.connectionTimeout*1e3)}),this.connectPromise}_disconnect(){switch(this.logger.log(`Disconnecting ${this.server}`),this.state){case Rt.Connecting:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(Rt.Disconnecting)}catch(n){if(n instanceof Nc)return Promise.reject(n);throw n}break;case Rt.Connected:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(Rt.Disconnecting)}catch(n){if(n instanceof Nc)return Promise.reject(n);throw n}break;case Rt.Disconnecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(Rt.Disconnecting));if(!this.disconnectPromise)throw new Error("Disconnect promise must be defined.");return this.disconnectPromise;case Rt.Disconnected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(Rt.Disconnecting));if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");return Promise.resolve();default:throw new Error("Unknown state")}if(!this._ws)throw new Error("WebSocket must be defined.");const e=this._ws;return this.disconnectPromise=new Promise((n,r)=>{this.disconnectResolve=n,this.disconnectReject=r;try{e.close(1e3)}catch(i){throw this.logger.error("WebSocket close failed."),this.logger.error(i.toString()),i}}),this.disconnectPromise}_send(e){if(this.configuration.traceSip===!0&&this.logger.log(`Sending WebSocket message:
660
661`+e+`
662`),this._state!==Rt.Connected)return Promise.reject(new Error("Not connected."));if(!this._ws)throw new Error("WebSocket undefined.");try{this._ws.send(e)}catch(n){return n instanceof Error?Promise.reject(n):Promise.reject(new Error("WebSocket send failed."))}return Promise.resolve()}onWebSocketClose(e,n){if(n!==this._ws)return;const r=`WebSocket closed ${this.server} (code: ${e.code})`,i=this.disconnectPromise?void 0:new Error(r);i&&this.logger.warn("WebSocket closed unexpectedly"),this.logger.log(r),this._ws=void 0,this.transitionState(Rt.Disconnected,i)}onWebSocketError(e,n){n===this._ws&&this.logger.error("WebSocket error occurred.")}onWebSocketMessage(e,n){if(n!==this._ws)return;const r=e.data;let i;if(/^(\r\n)+$/.test(r)){this.clearKeepAliveTimeout(),this.configuration.traceSip===!0&&this.logger.log("Received WebSocket message with CRLF Keep Alive response");return}if(!r){this.logger.warn("Received empty message, discarding...");return}if(typeof r!="string"){try{i=new TextDecoder().decode(new Uint8Array(r))}catch(s){this.logger.error(s.toString()),this.logger.error("Received WebSocket binary message failed to be converted into string, message discarded");return}this.configuration.traceSip===!0&&this.logger.log(`Received WebSocket binary message:
663
664`+i+`
665`)}else i=r,this.configuration.traceSip===!0&&this.logger.log(`Received WebSocket text message:
666
667`+i+`
668`);if(this.state!==Rt.Connected){this.logger.warn("Received message while not connected, discarding...");return}if(this.onMessage)try{this.onMessage(i)}catch(s){throw this.logger.error(s.toString()),this.logger.error("Exception thrown by onMessage callback"),s}}onWebSocketOpen(e,n){n===this._ws&&this._state===Rt.Connecting&&(this.logger.log(`WebSocket opened ${this.server}`),this.transitionState(Rt.Connected))}transitionLoopDetectedError(e){let n="A state transition loop has been detected.";return n+=` An attempt to transition from ${this._state} to ${e} before the prior transition completed.`,n+=" Perhaps you are synchronously calling connect() or disconnect() from a callback or state change handler?",this.logger.error(n),new Nc("Loop detected.")}transitionState(e,n){const r=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};if(this.transitioningState)throw this.transitionLoopDetectedError(e);switch(this.transitioningState=!0,this._state){case Rt.Connecting:e!==Rt.Connected&&e!==Rt.Disconnecting&&e!==Rt.Disconnected&&r();break;case Rt.Connected:e!==Rt.Disconnecting&&e!==Rt.Disconnected&&r();break;case Rt.Disconnecting:e!==Rt.Connecting&&e!==Rt.Disconnected&&r();break;case Rt.Disconnected:e!==Rt.Connecting&&r();break;default:throw new Error("Unknown state.")}const i=this._state;this._state=e;const s=this.connectResolve,o=this.connectReject;i===Rt.Connecting&&(this.connectPromise=void 0,this.connectResolve=void 0,this.connectReject=void 0);const a=this.disconnectResolve,l=this.disconnectReject;if(i===Rt.Disconnecting&&(this.disconnectPromise=void 0,this.disconnectResolve=void 0,this.disconnectReject=void 0),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0),this.logger.log(`Transitioned from ${i} to ${this._state}`),this._stateEventEmitter.emit(this._state),e===Rt.Connected&&(this.startSendingKeepAlives(),this.onConnect))try{this.onConnect()}catch(c){throw this.logger.error(c.toString()),this.logger.error("Exception thrown by onConnect callback"),
668c}if(i===Rt.Connected&&(this.stopSendingKeepAlives(),this.onDisconnect))try{n?this.onDisconnect(n):this.onDisconnect()}catch(c){throw this.logger.error(c.toString()),this.logger.error("Exception thrown by onDisconnect callback"),c}if(i===Rt.Connecting){if(!s)throw new Error("Connect resolve undefined.");if(!o)throw new Error("Connect reject undefined.");e===Rt.Connected?s():o(n||new Error("Connect aborted."))}if(i===Rt.Disconnecting){if(!a)throw new Error("Disconnect resolve undefined.");if(!l)throw new Error("Disconnect reject undefined.");e===Rt.Disconnected?a():l(n||new Error("Disconnect aborted."))}this.transitioningState=!1}clearKeepAliveTimeout(){this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveDebounceTimeout=void 0}sendKeepAlive(){return this.keepAliveDebounceTimeout?Promise.resolve():(this.keepAliveDebounceTimeout=setTimeout(()=>{this.clearKeepAliveTimeout()},this.configuration.keepAliveDebounce*1e3),this.send(`\r
669\r
670`))}startSendingKeepAlives(){const e=n=>{const r=n*.8;return 1e3*(Math.random()*(n-r)+r)};this.configuration.keepAliveInterval&&!this.keepAliveInterval&&(this.keepAliveInterval=setInterval(()=>{this.sendKeepAlive(),this.startSendingKeepAlives()},e(this.configuration.keepAliveInterval)))}stopSendingKeepAlives(){this.keepAliveInterval&&clearInterval(this.keepAliveInterval),this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveInterval=void 0,this.keepAliveDebounceTimeout=void 0}}Cu.defaultOptions={server:"",connectionTimeout:5,keepAliveInterval:0,keepAliveDebounce:10,traceSip:!0};class Hi{constructor(e={}){if(this._publishers={},this._registerers={},this._sessions={},this._subscriptions={},this._state=qn.Stopped,this._stateEventEmitter=new Fd,this.delegate=e.delegate,this.options=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Hi.defaultOptions()),{sipjsId:xa(5)}),{uri:new gs("sip","anonymous."+xa(6),"anonymous.invalid")}),{viaHost:xa(12)+".invalid"}),Hi.stripUndefinedProperties(e)),this.options.hackIpInContact)if(typeof this.options.hackIpInContact=="boolean"&&this.options.hackIpInContact){const n=Math.floor(Math.random()*254+1);this.options.viaHost="192.0.2."+n}else this.options.hackIpInContact&&(this.options.viaHost=this.options.hackIpInContact);switch(this.loggerFactory=new Ote,this.logger=this.loggerFactory.getLogger("sip.UserAgent"),this.loggerFactory.builtinEnabled=this.options.logBuiltinEnabled,this.loggerFactory.connector=this.options.logConnector,this.options.logLevel){case"error":this.loggerFactory.level=dr.error;break;case"warn":this.loggerFactory.level=dr.warn;break;case"log":this.loggerFactory.level=dr.log;break;case"debug":this.loggerFactory.level=dr.debug;break}if(this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach(n=>{const r=this.options[n];switch(n){case"uri":case"sessionDescriptionHandlerFactory":this.logger.log("· "+n+": "+r);break;case"authorizationPassword":this.logger.log("· "+n+": NOT SHOWN");break;case"transportConstructor":this.logger.log("· "+n+": "+r.name);break;default:this.logger.log("· "+n+": "+JSON.stringify(r))}})),this.options.transportOptions){const n=this.options.transportOptions,r=n.maxReconnectionAttempts,i=n.reconnectionTimeout;r!==void 0&&this.logger.warn('The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),i!==void 0&&this.logger.warn('The transport option "reconnectionTimeout" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),e.reconnectionDelay===void 0&&i!==void 0&&(this.options.reconnectionDelay=i),e.reconnectionAttempts===void 0&&r!==void 0&&(this.options.reconnectionAttempts=r)}if(e.reconnectionDelay!==void 0&&this.logger.warn('The user agent option "reconnectionDelay" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),e.reconnectionAttempts!==void 0&&this.logger.warn('The user agent option "reconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),this._transport=new this.options.transportConstructor(this.getLogger("sip.Transport"),this.options.transportOptions),this.initTransportCallbacks(),this._contact=this.initContact(),this._instanceId=this.options.instanceId?this.options.instanceId:Hi.newUUID(),Vn.parse(this._instanceId,"uuid")===-1)throw new Error("Invalid instanceId.");this._userAgentCore=this.initCore()}static makeURI(e){return Vn.URIParse(e)}static defaultOptions(){return{allowLegacyNotifications:!1,authorizationHa1:"",authorizationPassword:"",authorizationUsername:"",delegate:{},contactName:"",contactParams:{transport:"ws"},displayName:"",forceRport:!1,gracefulShutdown:!0,hackAllowUnregisteredOptionTags:!1,hackIpInContact:!1,hackViaTcp:!1,instanceId:"",instanceIdAlwaysAdded:!1,logBuiltinEnabled:!0,logConfiguration:!0,logConnector:()=>{},logLevel:"log",noAnswerTimeout:60,preloadedRouteSet:[],reconnectionAttempts:0,reconnectionDelay:4,sendInitialProvisionalResponse:!0,sessionDescriptionHandlerFactory:Zte(),sessionDescriptionHandlerFactoryOptions:{},sipExtension100rel:qi.Unsupported,sipExtensionReplaces:qi.Unsupported,sipExtensionExtraSupported:[],sipjsId:"",transportConstructor:Cu,transportOptions:{},uri:new gs("sip","anonymous","anonymous.invalid"),userAgentString:"SIP.js/"+gte,viaHost:""}}static newUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=Math.floor(Math.random()*16);return(e==="x"?n:n%4+8).toString(16)})}static stripUndefinedProperties(e){return Object.keys(e).reduce((n,r)=>(e[r]!==void 0&&(n[r]=e[r]),n),{})}get configuration(){return this.options}get contact(){return this._contact}get instanceId(){return this._instanceId}get state(){return this._state}get stateChange(){return this._stateEventEmitter}get transport(){return this._transport}get userAgentCore(){return this._userAgentCore}getLogger(e,n){return this.loggerFactory.getLogger(e,n)}getLoggerFactory(){return this.loggerFactory}isConnected(){return this.transport.isConnected()}reconnect(){return this.state===qn.Stopped?Promise.reject(new Error("User agent stopped.")):Promise.resolve().then(()=>this.transport.connect())}start(){return this.state===qn.Started?(this.logger.warn("User agent already started"),Promise.resolve()):(this.logger.log(`Starting ${this.configuration.uri}`),this.transitionState(qn.Started),this.transport.connect())}async stop(){if(this.state===qn.Stopped)return this.logger.warn("User agent already stopped"),Promise.resolve();if(this.logger.log(`Stopping ${this.configuration.uri}`),!this.options.gracefulShutdown)return this.logger.log("Dispose of transport"),this.transport.dis
670pose().catch(a=>{throw this.logger.error(a.message),a}),this.logger.log("Dispose of core"),this.userAgentCore.dispose(),this._publishers={},this._registerers={},this._sessions={},this._subscriptions={},this.transitionState(qn.Stopped),Promise.resolve();const e=Object.assign({},this._publishers),n=Object.assign({},this._registerers),r=Object.assign({},this._sessions),i=Object.assign({},this._subscriptions),s=this.transport,o=this.userAgentCore;this.logger.log("Dispose of registerers");for(const a in n)n[a]&&await n[a].dispose().catch(l=>{throw this.logger.error(l.message),delete this._registerers[a],l});this.logger.log("Dispose of sessions");for(const a in r)r[a]&&await r[a].dispose().catch(l=>{throw this.logger.error(l.message),delete this._sessions[a],l});this.logger.log("Dispose of subscriptions");for(const a in i)i[a]&&await i[a].dispose().catch(l=>{throw this.logger.error(l.message),delete this._subscriptions[a],l});this.logger.log("Dispose of publishers");for(const a in e)e[a]&&await e[a].dispose().catch(l=>{throw this.logger.error(l.message),delete this._publishers[a],l});this.logger.log("Dispose of transport"),await s.dispose().catch(a=>{throw this.logger.error(a.message),a}),this.logger.log("Dispose of core"),o.dispose(),this.transitionState(qn.Stopped)}_makeInviter(e,n){return new zf(this,e,n)}attemptReconnection(e=1){const n=this.options.reconnectionAttempts,r=this.options.reconnectionDelay;if(e>n){this.logger.log("Maximum reconnection attempts reached");return}this.logger.log(`Reconnection attempt ${e} of ${n} - trying`),setTimeout(()=>{this.reconnect().then(()=>{this.logger.log(`Reconnection attempt ${e} of ${n} - succeeded`)}).catch(i=>{this.logger.error(i.message),this.logger.log(`Reconnection attempt ${e} of ${n} - failed`),this.attemptReconnection(++e)})},e===1?0:r*1e3)}initContact(){const e=this.options.contactName!==""?this.options.contactName:xa(8),n=this.options.contactParams;return{pubGruu:void 0,tempGruu:void 0,uri:new gs("sip",e,this.options.viaHost,void 0,n),toString:(r={})=>{const i=r.anonymous||!1,s=r.outbound||!1,o=r.register||!1;let a="<";return i?a+=this.contact.tempGruu||`sip:[email protected];transport=${n.transport?n.transport:"ws"}`:o?a+=this.contact.uri:a+=this.contact.pubGruu||this.contact.uri,s&&(a+=";ob"),a+=">",this.options.instanceIdAlwaysAdded&&(a+=';+sip.instance="<urn:uuid:'+this._instanceId+'>"'),a}}}initCore(){let e=[];e.push("outbound"),this.options.sipExtension100rel===qi.Supported&&e.push("100rel"),this.options.sipExtensionReplaces===qi.Supported&&e.push("replaces"),this.options.sipExtensionExtraSupported&&e.push(...this.options.sipExtensionExtraSupported),this.options.hackAllowUnregisteredOptionTags||(e=e.filter(s=>Rte[s])),e=Array.from(new Set(e));const n=e.slice();(this.contact.pubGruu||this.contact.tempGruu)&&n.push("gruu");const r={aor:this.options.uri,contact:this.contact,displayName:this.options.displayName,loggerFactory:this.loggerFactory,hackViaTcp:this.options.hackViaTcp,routeSet:this.options.preloadedRouteSet,supportedOptionTags:e,supportedOptionTagsResponse:n,sipjsId:this.options.sipjsId,userAgentHeaderFieldValue:this.options.userAgentString,viaForceRport:this.options.forceRport,viaHost:this.options.viaHost,authenticationFactory:()=>{const s=this.options.authorizationUsername?this.options.authorizationUsername:this.options.uri.user,o=this.options.authorizationPassword?this.options.authorizationPassword:void 0,a=this.options.authorizationHa1?this.options.authorizationHa1:void 0;return new Ate(this.getLoggerFactory(),a,s,o)},transportAccessor:()=>this.transport},i={onInvite:s=>{var o;const a=new zc(this,s);if(s.delegate={onCancel:l=>{a._onCancel(l)},onTransportError:l=>{this.logger.error("A transport error has occurred while handling an incoming INVITE request.")}},s.trying(),this.options.sipExtensionReplaces!==qi.Unsupported){const l=s.message.parseHeader("replaces");if(l){const c=l.call_id;if(typeof c!="string")throw new Error("Type of call id is not string");const d=l.replaces_to_tag;if(typeof d!="string")throw new Error("Type of to tag is not string");const u=l.replaces_from_tag;if(typeof u!="string")throw new Error("type of from tag is not string");const f=c+d+u,h=this.userAgentCore.dialogs.get(f);if(!h){a.reject({statusCode:481});return}if(!h.early&&l.early_only===!0){a.reject({statusCode:486});return}const p=this._sessions[c+u]||this._sessions[c+d]||void 0;if(!p)throw new Error("Session does not exist.");a._replacee=p}}if(!((o=this.delegate)===null||o===void 0)&&o.onInvite){if(a.autoSendAnInitialProvisionalResponse){a.progress().then(()=>{var l;if(((l=this.delegate)===null||l===void 0?void 0:l.onInvite)===void 0)throw new Error("onInvite undefined.");
670this.delegate.onInvite(a)});return}this.delegate.onInvite(a);return}a.reject({statusCode:486})},onMessage:s=>{if(this.delegate&&this.delegate.onMessage){const o=new JT(s);this.delegate.onMessage(o)}else s.accept()},onNotify:s=>{if(this.delegate&&this.delegate.onNotify){const o=new hb(s);this.delegate.onNotify(o)}else this.options.allowLegacyNotifications?s.accept():s.reject({statusCode:481})},onRefer:s=>{this.logger.warn("Received an out of dialog REFER request"),this.delegate&&this.delegate.onReferRequest?this.delegate.onReferRequest(s):s.reject({statusCode:405})},onRegister:s=>{this.logger.warn("Received an out of dialog REGISTER request"),this.delegate&&this.delegate.onRegisterRequest?this.delegate.onRegisterRequest(s):s.reject({statusCode:405})},onSubscribe:s=>{this.logger.warn("Received an out of dialog SUBSCRIBE request"),this.delegate&&this.delegate.onSubscribeRequest?this.delegate.onSubscribeRequest(s):s.reject({statusCode:405})}};return new Yte(r,i)}initTransportCallbacks(){this.transport.onConnect=()=>this.onTransportConnect(),this.transport.onDisconnect=e=>this.onTransportDisconnect(e),this.transport.onMessage=e=>this.onTransportMessage(e)}onTransportConnect(){this.state!==qn.Stopped&&this.delegate&&this.delegate.onConnect&&this.delegate.onConnect()}onTransportDisconnect(e){this.state!==qn.Stopped&&(this.delegate&&this.delegate.onDisconnect&&this.delegate.onDisconnect(e),e&&this.options.reconnectionAttempts>0&&this.attemptReconnection())}onTransportMessage(e){const n=qf.parseMessage(e,this.getLogger("sip.Parser"));if(!n){this.logger.warn("Failed to parse incoming message. Dropping.");return}if(this.state===qn.Stopped&&n instanceof Ml){this.logger.warn(`Received ${n.method} request while stopped. Dropping.`);return}const r=()=>{const i=["from","to","call_id","cseq","via"];for(const s of i)if(!n.hasHeader(s))return this.logger.warn(`Missing mandatory header field : ${s}.`),!1;return!0};if(n instanceof Ml){if(!r()){this.logger.warn("Request missing mandatory header field. Dropping.");return}if(!n.toTag&&n.callId.substr(0,5)===this.options.sipjsId){this.userAgentCore.replyStateless(n,{statusCode:482});return}const i=Bd(n.body),s=n.getHeader("content-length");if(s&&i<Number(s)){this.userAgentCore.replyStateless(n,{statusCode:400});return}}if(n instanceof qo){if(!r()){this.logger.warn("Response missing mandatory header field. Dropping.");return}if(n.getHeaders("via").length>1){this.logger.warn("More than one Via header field present in the response. Dropping.");return}if(n.via.host!==this.options.viaHost||n.via.port!==void 0){this.logger.warn("Via sent-by in the response does not match UA Via host value. Dropping.");return}const i=Bd(n.body),s=n.getHeader("content-length");if(s&&i<Number(s)){this.logger.warn("Message body length is lower than the value in Content-Length header field. Dropping.");return}}if(n instanceof Ml){this.userAgentCore.receiveIncomingRequestFromTransport(n);return}if(n instanceof qo){this.userAgentCore.receiveIncomingResponseFromTransport(n);return}throw new Error("Invalid message type.")}transitionState(e,n){const r=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};switch(this._state){case qn.Started:e!==qn.Stopped&&r();break;case qn.Stopped:e!==qn.Started&&r();break;default:throw new Error("Unknown state.")}this.logger.log(`Transitioned from ${this._state} to ${e}`),this._state=e,this._stateEventEmitter.emit(this._state)}}function ene(){return(t,e)=>({session:e,held:!1,muted:!1})}class h2{constructor(e,n={}){this.managedSessions=[],this.attemptingReconnection=!1,this.optionsPingFailure=!1,this.optionsPingRunning=!1,this.shouldBeConnected=!1,this.shouldBeRegistered=!1,this.delegate=n.delegate,this.options=Object.assign({aor:"",autoStop:!0,delegate:{},iceStopWaitingOnServerReflexive:!1,managedSessionFactory:ene(),maxSimultaneousSessions:2,media:{},optionsPingInterval:-1,optionsPingRequestURI:"",reconnectionAttempts:3,reconnectionDelay:4,registrationRetry:!1,registrationRetryInterval:3,registerGuard:null,registererOptions:{},registererRegisterOptions:{},sendDTMFUsingSessionDescriptionHandler:!1,userAgentOptions:{}},h2.stripUndefinedProperties(n));const r=Object.assign({},n.userAgentOptions);if(r.transportConstructor||(r.transportConstructor=Cu),r.transportOptions||(r.transportOptions={server:e}),!r.uri&&n.aor){const i=Hi.makeURI(n.aor);if(!i)throw new Error(`Failed to create valid URI from ${n.aor}`);r.uri=i}
670if(this.userAgent=new Hi(r),this.userAgent.delegate={onConnect:()=>{this.logger.log("Connected"),this.delegate&&this.delegate.onServerConnect&&this.delegate.onServerConnect(),this.shouldBeRegistered&&this.register(),this.options.optionsPingInterval>0&&this.optionsPingStart()},onDisconnect:async i=>{this.logger.log("Disconnected");let s=!1;this.options.optionsPingInterval>0&&(s=this.optionsPingFailure,this.optionsPingFailure=!1,this.optionsPingStop()),this.delegate&&this.delegate.onServerDisconnect&&this.delegate.onServerDisconnect(i),(i||s)&&(this.registerer&&(this.logger.log("Disposing of registerer..."),this.registerer.dispose().catch(o=>{this.logger.debug("Error occurred disposing of registerer after connection with server was lost."),this.logger.debug(o.toString())}),this.registerer=void 0),this.managedSessions.slice().map(o=>o.session).forEach(async o=>{this.logger.log("Disposing of session..."),o.dispose().catch(a=>{this.logger.debug("Error occurred disposing of a session after connection with server was lost."),this.logger.debug(a.toString())})}),this.shouldBeConnected&&this.attemptReconnection())},onInvite:i=>{this.logger.log(`[${i.id}] Received INVITE`);const s=this.options.maxSimultaneousSessions;if(s!==0&&this.managedSessions.length>s){this.logger.warn(`[${i.id}] Session already in progress, rejecting INVITE...`),i.reject().then(()=>{this.logger.log(`[${i.id}] Rejected INVITE`)}).catch(a=>{this.logger.error(`[${i.id}] Failed to reject INVITE`),this.logger.error(a.toString())});return}const o={sessionDescriptionHandlerOptions:{constraints:this.constraints}};this.initSession(i,o),this.delegate&&this.delegate.onCallReceived?this.delegate.onCallReceived(i):(this.logger.warn(`[${i.id}] No handler available, rejecting INVITE...`),i.reject().then(()=>{this.logger.log(`[${i.id}] Rejected INVITE`)}).catch(a=>{this.logger.error(`[${i.id}] Failed to reject INVITE`),this.logger.error(a.toString())}))},onMessage:i=>{i.accept().then(()=>{this.delegate&&this.delegate.onMessageReceived&&this.delegate.onMessageReceived(i)})},onNotify:i=>{i.accept().then(()=>{this.delegate&&this.delegate.onNotificationReceived&&this.delegate.onNotificationReceived(i)})}},this.registererOptions=Object.assign({},n.registererOptions),this.registererRegisterOptions=Object.assign({},n.registererRegisterOptions),this.options.registrationRetry){this.registererRegisterOptions.requestDelegate=this.registererRegisterOptions.requestDelegate||{};const i=this.registererRegisterOptions.requestDelegate.onReject;this.registererRegisterOptions.requestDelegate.onReject=s=>{i&&i(s),this.attemptRegistration()}}this.logger=this.userAgent.getLogger("sip.SessionManager"),window.addEventListener("online",()=>{this.logger.log("Online"),this.shouldBeConnected&&this.connect()}),this.options.autoStop&&window.addEventListener("beforeunload",async()=>{this.shouldBeConnected=!1,this.shouldBeRegistered=!1,this.userAgent.state!==qn.Stopped&&await this.userAgent.stop()})}static stripUndefinedProperties(e){return Object.keys(e).reduce((n,r)=>(e[r]!==void 0&&(n[r]=e[r]),n),{})}getLocalMediaStream(e){const n=e.sessionDescriptionHandler;if(n){if(!(n instanceof Dr))throw new Error("Session description handler not instance of web SessionDescriptionHandler");return n.localMediaStream}}getRemoteMediaStream(e){const n=e.sessionDescriptionHandler;if(n){if(!(n instanceof Dr))throw new Error("Session description handler not instance of web SessionDescriptionHandler");return n.remoteMediaStream}}getLocalAudioTrack(e){var n;return(n=this.getLocalMediaStream(e))===null||n===void 0?void 0:n.getTracks().find(r=>r.kind==="audio")}getLocalVideoTrack(e){var n;return(n=this.getLocalMediaStream(e))===null||n===void 0?void 0:n.getTracks().find(r=>r.kind==="video")}getRemoteAudioTrack(e){var n;return(n=this.getRemoteMediaStream(e))===null||n===void 0?void 0:n.getTracks().find(r=>r.kind==="audio")}getRemoteVideoTrack(e){var n;return(n=this.getRemoteMediaStream(e))===null||n===void 0?void 0:n.getTracks().find(r=>r.kind==="video")}async connect(){return this.logger.log("Connecting UserAgent..."),this.shouldBeConnected=!0,this.userAgent.
670state!==qn.Started?this.userAgent.start():this.userAgent.reconnect()}async disconnect(){return this.logger.log("Disconnecting UserAgent..."),this.userAgent.state===qn.Stopped?Promise.resolve():(this.shouldBeConnected=!1,this.shouldBeRegistered=!1,this.registerer=void 0,this.userAgent.stop())}isConnected(){return this.userAgent.isConnected()}async register(e){return this.logger.log("Registering UserAgent..."),this.shouldBeRegistered=!0,e!==void 0&&(this.registererRegisterOptions=Object.assign({},e)),this.registerer||(this.registerer=new hs(this.userAgent,this.registererOptions),this.registerer.stateChange.addListener(n=>{switch(n){case Yt.Initial:break;case Yt.Registered:this.delegate&&this.delegate.onRegistered&&this.delegate.onRegistered();break;case Yt.Unregistered:this.delegate&&this.delegate.onUnregistered&&this.delegate.onUnregistered(),this.shouldBeRegistered&&this.attemptRegistration();break;case Yt.Terminated:break;default:throw new Error("Unknown registerer state.")}})),this.attemptRegistration(!0)}async unregister(e){return this.logger.log("Unregistering UserAgent..."),this.shouldBeRegistered=!1,this.registerer?this.registerer.unregister(e).then(()=>{}):(this.logger.warn("No registerer to unregister."),Promise.resolve())}async call(e,n,r){this.logger.log("Beginning Session...");const i=this.options.maxSimultaneousSessions;if(i!==0&&this.managedSessions.length>i)return Promise.reject(new Error("Maximum number of sessions already exists."));const s=Hi.makeURI(e);if(!s)return Promise.reject(new Error(`Failed to create a valid URI from "${e}"`));if(n||(n={}),n.sessionDescriptionHandlerOptions||(n.sessionDescriptionHandlerOptions={}),n.sessionDescriptionHandlerOptions.constraints||(n.sessionDescriptionHandlerOptions.constraints=this.constraints),n.earlyMedia){r=r||{},r.requestDelegate=r.requestDelegate||{};const a=r.requestDelegate.onProgress;r.requestDelegate.onProgress=l=>{l.message.statusCode===183&&this.setupRemoteMedia(o),a&&a(l)}}this.options.iceStopWaitingOnServerReflexive&&(n.delegate=n.delegate||{},n.delegate.onSessionDescriptionHandler=a=>{if(!(a instanceof Dr))throw new Error("Session description handler not instance of SessionDescriptionHandler");a.peerConnectionDelegate={onicecandidate:l=>{var c;((c=l.candidate)===null||c===void 0?void 0:c.type)==="srflx"&&(this.logger.log(`[${o.id}] Found srflx ICE candidate, stop waiting...`),a.iceGatheringComplete())}}});const o=new zf(this.userAgent,s,n);return this.sendInvite(o,n,r).then(()=>o)}async hangup(e){return this.logger.log(`[${e.id}] Hangup...`),this.sessionExists(e)?this.terminate(e):Promise.reject(new Error("Session does not exist."))}async answer(e,n){return this.logger.log(`[${e.id}] Accepting Invitation...`),this.sessionExists(e)?e instanceof zc?(n||(n={}),n.sessionDescriptionHandlerOptions||(n.sessionDescriptionHandlerOptions={}),n.sessionDescriptionHandlerOptions.constraints||(n.sessionDescriptionHandlerOptions.constraints=this.constraints),e.accept(n)):Promise.reject(new Error("Session not instance of Invitation.")):Promise.reject(new Error("Session does not exist."))}async decline(e){return this.logger.log(`[${e.id}] Rejecting Invitation...`),this.sessionExists(e)?e instanceof zc?e.reject():Promise.reject(new Error("Session not instance of Invitation.")):Promise.reject(new Error("Session does not exist."))}async hold(e){return this.logger.log(`[${e.id}] Holding session...`),this.setHold(e,!0)}async unhold(e){return this.logger.log(`[${e.id}] Unholding session...`),this.setHold(e,!1)}isHeld(e){const n=this.sessionManaged(e);return n?n.held:!1}mute(e){this.logger.log(`[${e.id}] Disabling media tracks...`),this.setMute(e,!0)}unmute(e){this.logger.log(`[${e.id}] Enabling media tracks...`),this.setMute(e,!1)}isMuted(e){const n=this.sessionManaged(e);return n?n.muted:!1}async sendDTMF(e,n){if(this.logger.log(`[${e.id}] Sending DTMF...`),!/^[0-9A-D#*,]$/.exec(n))return Promise.reject(new Error("Invalid DTMF tone."));if(!this.sessionExists(e))return Promise.reject(new Error("Session does not exist."));if(this.logger.log(`[${e.id}] Sending DTMF tone: ${n}`),this.options.sendDTMFUsingSessionDescriptionHandler)return e.sessionDescriptionHandler?e.sessionDescriptionHandler.sendDtmf(n)?Promise.resolve():Promise.reject(new Error("Failed to send DTMF")):Promise.reject(new Error("Session desciption handler undefined."));{const r=n,i=2e3,s={body:{contentDisposition:"render",contentType:"application/dtmf-relay",content:"Signal="+r+`\r
671Duration=`+i}};return e.info({requestOptions:s}).then(()=>{})}}async transfer(e,n,r){if(this.logger.log(`[${e.id}] Referring session...`),n instanceof Zl)return e.refer(n,r).then(()=>{});const i=Hi.makeURI(n);return i?e.refer(i,r).then(()=>{}):Promise.reject(new Error(`Failed to create a valid URI from "${n}"`))}async message(e,n){this.logger.log("Sending message...");const r=Hi.makeURI(e);return r?new Ite(this.userAgent,r,n).message():Promise.reject(new Error(`Failed to create a valid URI from "${e}"`))}get constraints(){let e={audio:!0,video:!1};return this.options.media.constraints&&(e=Object.assign({},this.options.media.constraints)),e}attemptReconnection(e=1){const n=this.options.reconnectionAttempts,r=this.options.reconnectionDelay;if(!this.shouldBeConnected){this.logger.log("Should not be connected currently");return}if(this.attemptingReconnection&&this.logger.log("Reconnection attempt already in progress"),e>n){this.logger.log("Reconnection maximum attempts reached");return}e===1?this.logger.log(`Reconnection attempt ${e} of ${n} - trying`):this.logger.log(`Reconnection attempt ${e} of ${n} - trying in ${r} seconds`),this.attemptingReconnection=!0,setTimeout(()=>{if(!this.shouldBeConnected){this.logger.log(`Reconnection attempt ${e} of ${n} - aborted`),this.attemptingReconnection=!1;return}this.userAgent.reconnect().then(()=>{this.logger.log(`Reconnection attempt ${e} of ${n} - succeeded`),this.attemptingReconnection=!1}).catch(i=>{this.logger.log(`Reconnection attempt ${e} of ${n} - failed`),this.logger.error(i.message),this.attemptingReconnection=!1,this.attemptReconnection(++e)})},e===1?0:r*1e3)}attemptRegistration(e=!1){if(this.logger.log(`Registration attempt ${e?"without delay":""}`),!this.shouldBeRegistered)return this.logger.log("Should not be registered currently"),Promise.resolve();if(this.registrationAttemptTimeout!==void 0)return this.logger.log("Registration attempt already in progress"),Promise.resolve();const n=()=>
671this.registerer?this.isConnected()?this.userAgent.state===qn.Stopped?(this.logger.log("User agent stopped"),Promise.resolve()):this.options.registerGuard?this.options.registerGuard().catch(i=>{throw this.logger.log("Register guard rejected will making registration attempt"),i}).then(i=>i||!this.registerer?Promise.resolve():this.registerer.register(this.registererRegisterOptions).then(()=>{})):this.registerer.register(this.registererRegisterOptions).then(()=>{}):(this.logger.log("User agent not connected"),Promise.resolve()):(this.logger.log("Registerer undefined"),Promise.resolve()),r=i=>{const s=i*2;return 1e3*(Math.random()*(s-i)+i)};return new Promise((i,s)=>{this.registrationAttemptTimeout=setTimeout(()=>{n().then(()=>{this.registrationAttemptTimeout=void 0,i()}).catch(o=>{this.registrationAttemptTimeout=void 0,o instanceof jd?i():s(o)})},e?0:r(this.options.registrationRetryInterval))})}cleanupMedia(e){const n=this.sessionManaged(e);if(!n)throw new Error("Managed session does not exist.");n.mediaLocal&&n.mediaLocal.video&&(n.mediaLocal.video.srcObject=null,n.mediaLocal.video.pause()),n.mediaRemote&&(n.mediaRemote.audio&&(n.mediaRemote.audio.srcObject=null,n.mediaRemote.audio.pause()),n.mediaRemote.video&&(n.mediaRemote.video.srcObject=null,n.mediaRemote.video.pause()))}enableReceiverTracks(e,n){if(!this.sessionExists(e))throw new Error("Session does not exist.");const r=e.sessionDescriptionHandler;if(!(r instanceof Dr))throw new Error("Session's session description handler not instance of SessionDescriptionHandler.");r.enableReceiverTracks(n)}enableSenderTracks(e,n){if(!this.sessionExists(e))throw new Error("Session does not exist.");const r=e.sessionDescriptionHandler;if(!(r instanceof Dr))throw new Error("Session's session description handler not instance of SessionDescriptionHandler.");r.enableSenderTracks(n)}initSession(e,n){this.sessionAdd(e),this.delegate&&this.delegate.onCallCreated&&this.delegate.onCallCreated(e),e.stateChange.addListener(r=>{switch(this.logger.log(`[${e.id}] Session state changed to ${r}`),r){case Oe.Initial:break;case Oe.Establishing:break;case Oe.Established:this.setupLocalMedia(e),this.setupRemoteMedia(e),this.delegate&&this.delegate.onCallAnswered&&this.delegate.onCallAnswered(e);break;case Oe.Terminating:case Oe.Terminated:this.sessionExists(e)&&(this.cleanupMedia(e),this.sessionRemove(e),this.delegate&&this.delegate.onCallHangup&&this.delegate.onCallHangup(e));break;default:throw new Error("Unknown session state.")}}),e.delegate=e.delegate||{},e.delegate.onInfo=r=>{var i;if(((i=this.delegate)===null||i===void 0?void 0:i.onCallDTMFReceived)===void 0){r.reject();return}const s=r.request.getHeader("content-type");if(!s||!/^application\/dtmf-relay/i.exec(s)){r.reject();return}const o=r.request.body.split(`\r
672`,2);if(o.length!==2){r.reject();return}let a;const l=/^(Signal\s*?=\s*?)([0-9A-D#*]{1})(\s)?.*/;if(o[0]!==void 0&&l.test(o[0])&&(a=o[0].replace(l,"$2")),!a){r.reject();return}let c;const d=/^(Duration\s?=\s?)([0-9]{1,4})(\s)?.*/;if(o[1]!==void 0&&d.test(o[1])&&(c=parseInt(o[1].replace(d,"$2"),10)),!c){r.reject();return}r.accept().then(()=>{if(this.delegate&&this.delegate.onCallDTMFReceived){if(!a||!c)throw new Error("Tone or duration undefined.");this.delegate.onCallDTMFReceived(e,a,c)}}).catch(u=>{this.logger.error(u.message)})},e.delegate.onRefer=r=>{r.accept().then(()=>this.sendInvite(r.makeInviter(n),n)).catch(i=>{this.logger.error(i.message)})}}optionsPingRun(e,n,r){if(this.options.optionsPingInterval<1)throw new Error("Invalid options ping interval.");this.optionsPingRunning||(this.optionsPingRunning=!0,this.optionsPingTimeout=setTimeout(()=>{this.optionsPingTimeout=void 0;const i=()=>{this.optionsPingFailure=!1,this.optionsPingRunning&&(this.optionsPingRunning=!1,this.optionsPingRun(e,n,r))},s=()=>{this.logger.error("OPTIONS ping failed"),this.optionsPingFailure=!0,this.optionsPingRunning=!1,this.userAgent.transport.disconnect().catch(l=>this.logger.error(l))},o=this.userAgent.userAgentCore,a=o.makeOutgoingRequestMessage("OPTIONS",e,n,r,{});this.optionsPingRequest=o.request(a,{onAccept:()=>{this.optionsPingRequest=void 0,i()},onReject:l=>{this.optionsPingRequest=void 0,l.message.statusCode===408||l.message.statusCode===503?s():i()}})},this.options.optionsPingInterval*1e3))}optionsPingStart(){this.logger.log("OPTIONS pings started");let e,n,r;if(this.options.optionsPingRequestURI){if(e=Hi.makeURI(this.options.optionsPingRequestURI),!e)throw new Error("Failed to create Request URI.");n=this.userAgent.contact.uri.clone(),r=this.userAgent.contact.uri.clone()}else if(this.options.aor){const i=Hi.makeURI(this.options.aor);if(!i)throw new Error("Failed to create URI.");e=i.clone(),e.user=void 0,n=i.clone(),r=i.clone()}else{this.logger.error("You have enabled sending OPTIONS pings and as such 
672you must provide either a) an AOR to register, or b) an RURI to use for the target of the OPTIONS ping requests. ");return}this.optionsPingRun(e,n,r)}optionsPingStop(){this.logger.log("OPTIONS pings stopped"),this.optionsPingRunning=!1,this.optionsPingFailure=!1,this.optionsPingRequest&&(this.optionsPingRequest.dispose(),this.optionsPingRequest=void 0),this.optionsPingTimeout&&(clearTimeout(this.optionsPingTimeout),this.optionsPingTimeout=void 0)}async sendInvite(e,n,r){return this.initSession(e,n),e.invite(r).then(()=>{this.logger.log(`[${e.id}] Sent INVITE`)})}sessionAdd(e){const n=this.options.managedSessionFactory(this,e);this.managedSessions.push(n)}sessionExists(e){return this.sessionManaged(e)!==void 0}sessionManaged(e){return this.managedSessions.find(n=>n.session.id===e.id)}sessionRemove(e){this.managedSessions=this.managedSessions.filter(n=>n.session.id!==e.id)}async setHold(e,n){if(!this.sessionExists(e))return Promise.reject(new Error("Session does not exist."));if(this.isHeld(e)===n)return Promise.resolve();if(!(e.sessionDescriptionHandler instanceof Dr))throw new Error("Session's session description handler not instance of SessionDescriptionHandler.");const r={requestDelegate:{onAccept:()=>{const o=this.sessionManaged(e);o!==void 0&&(o.held=n,this.enableReceiverTracks(e,!o.held),this.enableSenderTracks(e,!o.held&&!o.muted),this.delegate&&this.delegate.onCallHold&&this.delegate.onCallHold(e,o.held))},onReject:()=>{this.logger.warn(`[${e.id}] Re-invite request was rejected`);const o=this.sessionManaged(e);o!==void 0&&(o.held=!n,this.enableReceiverTracks(e,!o.held),this.enableSenderTracks(e,!o.held&&!o.muted),this.delegate&&this.delegate.onCallHold&&this.delegate.onCallHold(e,o.held))}}},i=e.sessionDescriptionHandlerOptionsReInvite;i.hold=n,e.sessionDescriptionHandlerOptionsReInvite=i;const s=this.sessionManaged(e);if(!s)throw new Error("Managed session is undefiend.");return s.held=n,e.invite(r).then(()=>{const o=this.sessionManaged(e);o!==void 0&&(this.enableReceiverTracks(e,!o.held),this.enableSenderTracks(e,!o.held&&!o.muted))}).catch(o=>{throw s.held=!n,o instanceof jd&&this.logger.error(`[${e.id}] A hold request is already in progress.`),o})}setMute(e,n){if(!this.sessionExists(e)){this.logger.warn(`[${e.id}] A session is required to enabled/disable media tracks`);return}if(e.state!==Oe.Established){this.logger.warn(`[${e.id}] An established session is required to enable/disable media tracks`);return}const r=this.sessionManaged(e);r!==void 0&&(r.muted=n,this.enableSenderTracks(e,!r.held&&!r.muted))}setupLocalMedia(e){const n=this.sessionManaged(e);if(!n)throw new Error("Managed session does not exist.");const r=typeof this.options.media.local=="function"?this.options.media.local(e):this.options.media.local;n.mediaLocal=r;const i=r==null?void 0:r.video;if(i){const s=this.getLocalMediaStream(e);if(!s)throw new Error("Local media stream undefiend.");i.srcObject=s,i.volume=0,i.play().catch(o=>{this.logger.error(`[${e.id}] Failed to play local media`),this.logger.error(o.message)})}}setupRemoteMedia(e){const n=this.sessionManaged(e);if(!n)throw new Error("Managed session does not exist.");const r=typeof this.options.media.remote=="function"?this.options.media.remote(e):this.options.media.remote;n.mediaRemote=r;const i=(r==null?void 0:r.video)||(r==null?void 0:r.audio);if(i){const s=this.getRemoteMediaStream(e);if(!s)throw new Error("Remote media stream undefiend.");i.autoplay=!0,i.srcObject=s,i.play().catch(o=>{this.logger.error(`[${e.id}] Failed to play remote media`),this.logger.error(o.message)}),s.onaddtrack=()=>{this.logger.log("Remote media onaddtrack"),i.load(),i.play().catch(o=>{this.logger.error(`[${e.id}] Failed to play remote media`),this.logger.error(o.message)})}}}async terminate(e){switch(this.logger.log(`[${e.id}] Terminating...`),e.state){case Oe.Initial:if(e instanceof zf)return e.cancel().then(()=>{this.logger.log(`[${e.id}] Inviter never sent INVITE (canceled)`)});if(e instanceof zc)return e.reject().then(()=>{this.logger.log(`[${e.id}] Invitation rejected (sent 480)`)});throw new Error("Unknown session type.");case Oe.Establishing:if(e instanceof zf)return e.cancel().then(()=>{this.logger.log(`[${e.id}] Inviter canceled (sent CANCEL)`)});if(e instanceof zc)return e.reject().then(()=>{this.logger.log(`[${e.id}] Invitation rejected (sent 480)`)});throw new Error("Unknown session type.");case Oe.Established:return e.bye().then(()=>{this.logger.log(`[${e.id}] Session ended (sent BYE)`)});case Oe.Terminating:break;case Oe.Terminated:break;default:throw new Error("Unknown state")}return this.logger.log(`[${e.id}] Terminating in state ${e.state}, no action taken`),Promise.resolve()}}const iR=m.createContext({sessionManager:null,connectAndRegister:()=>{},connectStatus:Oa.WAIT_REQUEST_CONNECT,registerStatus:dd.UNREGISTERED,sessions:{},sessionTimer:{}}),tne=()=>m.useContext(iR);const nne=t=>{const{options:e,mergedSessionManagerOptions:n={},children:r}=t,i=m.useRef(null),s=m.useRef(null),[o,a]=m.useState({}),[l,c]=m.useState({}),[d,u]=m.useState(null),[f,h]=m.useState(Oa.WAIT_REQUEST_CONNECT),[p,g]=m.useState(dd.UNREGISTERED),v=m.useCallback(w=>{a(C=>({...C,[w.id]:w}))},[a]),b=m.useCallback(w=>{const C=new h2(e.webSocketServer,{aor:`sip:${w.username}@${e.domain}`,userAgentOptions:{authorizationUsername:w.username,authorizationPassword:w.password},media:{constraints:{audio:!0,video:!0},remote:{audio:t.options.refAudioRemote??i.current,video:t.options.refVideoRemote??s.current}},delegate:{onCallCreated:x=>{x.stateChange.addListener(R=>{v(x)}),v(x),c(R=>({...R,[x.id]:{createdAt:new Date}}))},onCallAnswered:x=>{v(x),c(R=>({...R,[x.id]:{...R[x.id]||{},answeredAt:new Date}}))},onCallHangup:x=>{v(x),c(R=>({...R,[x.id]:{...R[x.id]||{},hangupAt:new Date}}))},onCallReceived:x=>{v(x),c(R=>({...R,[x.id]:{...R[x.id]||{},receivedAt:new Date}}))},onRegistered:()=>{g(dd.REGISTERED)},onUnregistered:()=>{g(dd.UNREGISTERED)},onServerConnect(){h(Oa.CONNECTED),C.register()},onServerDisconnect(x){h(Oa.DISCONNECTED)}},...n});u(C),C.connect()},[]);return Te.createElement(Te.Fragment,null,Te.createElement(iR.Provider,{value:{connectAndRegister:b,sessionManager:d,connectStatus:f,registerStatus:p,sessions:o,sessionTimer:l}},r),Te.createElement("audio",{ref:i}),Te.createElement("video",{ref:s}))};var yr;(function(t){t.Initial="Initial",t.Establishing="Establishing",t.Established="Established",t.Terminating="Terminating",t.Terminated="Terminated"})(yr=yr||(yr={}));function rne(...t){return nI(rI(t))}const D4=({active:t=!1,processing:e=!1,deviceId:n,barWidth:r=3,barGap:i=1,barRadius:s=1.5,barColor:o,fadeEdges:a=!0,fadeWidth:l=24,barHeight:c=4,height:d=64,sensitivity:u=1,smoothingTimeConstant:f=.8,fftSize:h=256,historySize:p=60,updateRate:g=30,stream:v,mode:b="static",onError:w,onStreamReady:C,onStreamEnd:x,className:R,...O})=>{const T=m.useRef(null),S=m.useRef(null),_=m.useRef([]),A=m.useRef(null),$=m.useRef(null),E=m.useRef(v),I=m.useRef(0),D=m.useRef(0),B=m.useRef(null),j=m.useRef([]),z=m.useRef(0),q=m.useRef([]),ne=m.useRef(!0),Z=m.useRef(null),J=m.useRef(0),de=typeof d=="number"?`${d}px`:d;return m.useEffect(()=>{const X=T.current,V=S.current;if(!X||!V)return;const te=new ResizeObserver(()=>{const ie=V.getBoundingClientRect(),ce=window.devicePixelRatio||1;
672X.width=ie.width*ce,X.height=ie.height*ce,X.style.width=`${ie.width}px`,X.style.height=`${ie.height}px`;const ae=X.getContext("2d");ae&&ae.scale(ce,ce),Z.current=null,J.current=ie.width,ne.current=!0});return te.observe(V),()=>te.disconnect()},[]),m.useEffect(()=>{if(e&&!t){let X=0;z.current=0;const V=()=>{var ce;X+=.03,z.current=Math.min(1,z.current+.02);const te=[],ie=Math.floor((((ce=S.current)==null?void 0:ce.getBoundingClientRect().width)||200)/(r+i));if(b==="static"){const ae=Math.floor(ie/2);for(let ve=0;ve<ie;ve++){const xe=(ve-ae)/ae,ge=1-Math.abs(xe)*.4,le=Math.sin(X*1.5+xe*3)*.25,fe=Math.sin(X*.8-xe*2)*.2,Se=Math.cos(X*2+xe)*.15,he=(.2+(le+fe+Se))*ge;let Ee=he;if(j.current.length>0&&z.current<1){const Ie=Math.min(ve,j.current.length-1);Ee=(j.current[Ie]||0)*(1-z.current)+he*z.current}te.push(Math.max(.05,Math.min(1,Ee)))}}else for(let ae=0;ae<ie;ae++){const ve=(ae-ie/2)/(ie/2),xe=1-Math.abs(ve)*.4,ge=Math.sin(X*1.5+ae*.15)*.25,le=Math.sin(X*.8-ae*.1)*.2,fe=Math.cos(X*2+ae*.05)*.15,G=(.2+(ge+le+fe))*xe;let he=G;if(j.current.length>0&&z.current<1){const Ee=Math.floor(ae/ie*j.current.length);he=(j.current[Ee]||0)*(1-z.current)+G*z.current}te.push(Math.max(.05,Math.min(1,he)))}b==="static"?q.current=te:_.current=te,ne.current=!0,B.current=requestAnimationFrame(V)};return V(),()=>{B.current&&cancelAnimationFrame(B.current)}}else if(!t&&!e&&(b==="static"?q.current.length>0:_.current.length>0)){let V=0;const te=()=>{V+=.03,V<1?(b==="static"?q.current=q.current.map(ie=>ie*(1-V)):_.current=_.current.map(ie=>ie*(1-V)),ne.current=!0,requestAnimationFrame(te)):b==="static"?q.current=[]:_.current=[]};te()}},[e,t,r,i,b]),m.useEffect(()=>{if(v){if(!t){E.current&&(E.current.getTracks().forEach(X=>X.stop()),E.current=null,x==null||x()),$.current&&$.current.state!=="closed"&&($.current.close(),$.current=null),I.current&&(cancelAnimationFrame(I.current),I.current=0);return}try{const X=window.AudioContext||window.webkitAudioContext,V=new X,te=V.createAnalyser();te.fftSize=h,te.smoothingTimeConstant=f,V.createMediaStreamSource(v).connect(te),$.current=V,A.current=te,_.current=[]}catch{}return()=>{E.current&&(E.current.getTracks().forEach(X=>X.stop()),E.current=null,x==null||x()),$.current&&$.current.state!=="closed"&&($.current.close(),$.current=null),I.current&&(cancelAnimationFrame(I.current),I.current=0)}}},[t,h,f,w,C,x]),m.useEffect(()=>{const X=T.current;if(!X)return;const V=X.getContext("2d");if(!V)return;let te;const ie=ce=>{const ae=X.getBoundingClientRect();if(t&&ce-D.current>g&&(D.current=ce,A.current)){const fe=new Uint8Array(A.current.frequencyBinCount);if(A.current.getByteFrequencyData(fe),b==="static"){const Se=Math.floor(fe.length*.05),G=Math.floor(fe.length*.4),he=fe.slice(Se,G),Ee=Math.floor(ae.width/(r+i)),Ie=Math.floor(Ee/2),ke=[];for(let De=Ie-1;De>=0;De--){const He=Math.floor(De/Ie*he.length),Je=Math.min(1,he[He]/255*u);ke.push(Math.max(.05,Je))}for(let De=0;De<Ie;De++){const He=Math.floor(De/Ie*he.length),Je=Math.min(1,he[He]/255*u);ke.push(Math.max(.05,Je))}q.current=ke,j.current=ke}else{let Se=0;const G=Math.floor(fe.length*.05),he=Math.floor(fe.length*.4),Ee=fe.slice(G,he);for(let ke=0;ke<Ee.length;ke++)Se+=Ee[ke];const Ie=Se/Ee.length/255*u;_.current.push(Math.min(1,Math.max(.05,Ie))),j.current=[..._.current],_.current.length>p&&_.current.shift()}ne.current=!0}if(!ne.current&&!t){te=requestAnimationFrame(ie);return}ne.current=t,V.clearRect(0,0,ae.width,ae.height);const ve=o||(getComputedStyle(X).color||"#000"),xe=r+i,ge=Math.floor(ae.width/xe),le=ae.height/2;if(b==="static"){const fe=e||t||q.current.length>0?q.current:[];for(let Se=0;Se<ge&&Se<fe.length;Se++){const G=fe[Se]||.1,he=Se*xe,Ee=Math.max(c,G*ae.height*.8),Ie=le-Ee/2;V.fillStyle=ve,V.globalAlpha=.4+G*.6,s>0?(V.beginPath(),V.roundRect(he,Ie,r,Ee,s),V.fill()):V.fillRect(he,Ie,r,Ee)}}else for(let fe=0;fe<ge&&fe<_.current.length;fe++){const Se=_.current.length-1-fe,G=_.current[Se]||.1,he=ae.width-(fe+1)*xe,Ee=Math.max(c,G*ae.height*.8),Ie=le-Ee/2;V.fillStyle=ve,V.globalAlpha=.4+G*.6,s>0?(V.beginPath(),V.roundRect(he,Ie,r,Ee,s),V.fill()):V.fillRect(he,Ie,r,Ee)}if(a&&l>0&&ae.width>0){if(!Z.current||J.current!==ae.width){const fe=V.createLinearGradient(0,0,ae.width,0),Se=Math.min(.3,l/ae.width);fe.addColorStop(0,"rgba(255,255,255,1)"),fe.addColorStop(Se,"rgba(255,255,255,0)"),fe.addColorStop(1-Se,"rgba(255,255,255,0)"),fe.addColorStop(1,"rgba(255,255,255,1)"),Z.current=fe,J.current=ae.width}V.globalCompositeOperation="destination-out",V.fillStyle=Z.current,V.fillRect(0,0,ae.width,ae.height),V.globalCompositeOperation="source-over"}V.globalAlpha=1,te=requestAnimationFrame(ie)};return te=requestAnimationFrame(ie),()=>{te&&cancelAnimationFrame(te)}},[t,e,u,g,p,r,c,i,s,o,a,l,b]),N.jsxs("div",{className:rne("relative h-full w-full",R),ref:S,style:{height:de},"aria-label":t?"Live audio waveform":e?"Processing audio":"Audio waveform idle",role:"img",...O,children:[!t&&!e&&N.jsx("div",{className:"border-muted-foreground
672/20 absolute top-1/2 right-0 left-0 -translate-y-1/2 border-t-2 border-dotted"}),N.jsx("canvas",{className:"block h-full w-full",ref:T,"aria-hidden":"true"})]})},p2="darka.sip.jambonz.cloud",ine=`wss://${p2}:8443`,sR={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[2-467])\\d{4}",[5,6],0,0,0,0,0,0,0,[["6\\d{4}",[5]],["[2-47]\\d{4}",[5]],0,0,0,0,["(?:0[1-9]|[1589]\\d)\\d{4}",[6]]]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[["[78]\\d{5}",[6]],["690\\d{6}|[356]\\d{5}",[6,9]],["180[02]\\d{4}",[8]],["[19]\\d{5}",[6]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["[2-4679][2-8]\\d{6}",[8]],["5[02-68]\\d{7}",[9]],["400\\d{6}|800\\d{2,9}"],["900[02]\\d{5}",[9]],0,0,["600[25]\\d{5}",[9]],0,0,["700[05]\\d{5}",[9]]]],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}"],["7\\d{8}"]]],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268",[["268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}"],["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,0,["26840[69]\\d{4}"],["26848[01]\\d{4}"]]],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264",[["264(?:292|4(?:6[12]|9[78]))\\d{4}"],["264(?:235|4(?:69|7[67])|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]
vendor: 7,049 bytes, line 672
672|44|66|77|88)[2-9]\\d{6}"],0,0,["264724\\d{4}"]]],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0",0,0,0,0,0,[["4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d{4}|(?:[2358][2-5][2-9]|4(?:[2-57-9][2-9]|6\\d))\\d{5}",[8]],["6(?:[78][2-9]|9\\d)\\d{6}",[9]],["800\\d{4}",[7]],["900[1-9]\\d\\d",[6]],["700[2-9]\\d{4}",[8]],0,0,0,0,["808[1-9]\\d\\d",[6]]]],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:1[0-25]|47)\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}"],["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"],["800\\d{5}"],["90[016]\\d{5}"],0,0,0,0,["60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|9[0-2])\\d{4}"],["80[1-4]\\d{5}"]]],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]],0,0,0,0,0,0,[["2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}"],["9[1-79]\\d{7}"]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1",0,0,[["3(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|47[35]|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\\d{5}|(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\\d{5}|(?:(?:11[1-8]|670)\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68])))\\d{6}|(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\\d{5}|2(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}",[10]],["93(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|47[35]|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\\d{5}|9(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68]))))\\d{6}|9(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\\d{5}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}"],["800\\d{7,8}"],["60[04579]\\d{7}",[10]],0,0,["810\\d{7}",[10]]]],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684",[["684
672(?:274|6(?:22|33|44|55|77|88|9[19]))\\d{4}"],["684(?:2(?:48|5[2468]|7[246])|7(?:3[13]|70|82))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["1(?:11\\d|[2-9]\\d{3,11})|(?:316|463)\\d{3,10}|648[34]\\d{3,9}|(?:51|66|73)2\\d{3,10}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-578]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|7[1368]|8[2457])|5(?:2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[135-7]|5[468])|7(?:2[1-8]|35|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{4,10}"],["6(?:485|(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d)\\d{3,9}",[7,8,9,10,11,12,13]],["800\\d{6,10}",[9,10,11,12,13]],["(?:8[69][2-68]|9(?:0[01]|3[019]))\\d{6,10}",[9,10,11,12,13]],0,0,0,0,["5(?:0[1-9]|17|[79]\\d)\\d{2,10}|7[28]0\\d{6,10}",[5,6,7,8,9,10,11,12,13]],["8(?:10|2[018])\\d{6,10}|828\\d{5}",[8,9,10,11,12,13]]]],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]],0,0,0,0,0,0,[["5(?:2\\d|8[1-9])\\d{4}"],["(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}"],["800\\d{4}"],["900\\d{4}"],0,0,0,0,["(?:28\\d|501)\\d{4}"]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",[["18[1-8]\\d{3,6}",[6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12]428|3655[02])\\d{4}|(?:2(?:22[0-79]|63[0-28])|3654)\\d{5}|(?:(?:1[28]|46)\\d|2(?:[014-6]2|[23]3))\\d{6}"],["36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}"],["88\\d{7}"],["900200\\d{3}"]]],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[05-79][2-9]|1[4579]|[23][24-9]|4[2-4689]|8[2457-9])|49[2-579]|5(?:0[2-49]|[13][2-9]|[268][2-4679]|4[4689]|5[2-79]|7[2-69]|9[2-4689]))\\d{5}",[8]],["6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"],["8[08]\\d{6}",[8]],["9[0246]\\d{6}",[8]],0,0,["703[235]0\\d{3}|70(?:2[0-5]|3[0146]|[56]0)\\d{4}",[8]],0,0,["8[12]\\d{6}",[8]]]],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246",[["246521[0369]\\d{3}|246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}"],["246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:246976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,["246(?:292|367|4(?:1[7-9]|3[01]|4[47-9]|67)|7(?:1[2-9]|2\\d|3[016]|53))\\d{4}"],0,["24631\\d{5}"]]],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0",0,0,0,0,0,[["(?:4(?:31\\d\\d|423)|5222)\\d{3}(?:\\d{2})?|8332[6-9]\\d\\d|(?:3(?:03[56]|224)|4(?:22[25]|653))\\d{3,4}|(?:3(?:42[47]|529|823)|4(?:027|525|65(?:28|8))|562|6257|7(?:1(?:5[3-5]|6[12]|7[156]|89)|22[589]56|32|42675|52(?:[25689](?:56|8)|[347]8)|71(?:6[1267]|75|89)|92374)|82(?:2[59]|32)56|9(?:03[23]56|23(?:256|373)|31|5(?:1|2[4589]56)))\\d{3}|(?:3(?:02[348]|22[35]|324|422)|4(?:22[67]|32[236-9]|6(?:2[46]|5[57])|953)|5526|6(?:024|6655)|81)\\d{4,5}|(?:2(?:7(?:1[0-267]|2[0-289]|3[0-29]|4[01]|5[1-3]|6[013]|7[0178]|91)|8(?:0[125]|1[1-6]|2[0157-9]|3[1-69]|41|6[1-35]|7[1-5]|8[1-8]|9[0-6])|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0136-9]|7[0-7]|8[014-9]))|3(?:0(?:2[025-79]|3[2-4])|181|22[12]|32[2356]|824)|4(?:02[09]|22[348]|32[045]|523|6(?:27|54))|666(?:22|53)|7(?:22[57-9]|42[56]|82[35])8|8(?:0[124-9]|2(?:181|2[02-4679]8)|4[12]|[5-7]2)|9(?:[04]2|2(?:2|328)|81))\\d{4}|(?:2(?:[23]\\d|[45])\\d\\d|3(?:1(?:2[5-7]|[5-7])|425|822)|4(?:033|1\\d|[257]1|332|4(?:2[246]|5[25])|6(?:2[35]|56|62)|8(?:23|54)|92[2-5])|5(?:02[03489]|22[457]|32[35-79]|42[46]|6(?:[18]|53)|724|826)|6(?:023|2(?:2[2-5]|5[3-5]|8)|32[3478]|42[34]|52[47]|6(?:[18]|6(?:2[34]|5[24]))|[78]2[2-5]|92[2-6])|7(?:02|21\\d|[3-589]1|6[12]|72[24])|8(?:217|3[12]|[5-7]1)|9[24]1)\\d{5}|(?:(?:3[2-8]|5[2-57-9]|6[03-589])1|4[4689][18])\\d{5}|[59]1\\d{5}"],["(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}",[10]],["80[03]\\d{7}",[10]],0,0,0,0,0,["96(?:0[469]|1[0-47]|3[389]|43|6[69]|7[78])\\d{6}",[10]]]],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0",0,0,0,0,0,[["80[2-8]\\d{5}|(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}",[8]],["4[5-9]\\d{7}",[9]],["800[1-9]\\d{4}",[8]],["(?:70(?:2[0-57]|3[04-7]|44|6[04-69]|7[0579])|90\\d\\d)\\d{4}",[8]],0,0,["78(?:0[578]|1[014-8]|2[25]|3[15-8]|48|5[05]|60|7[06-8]|9\\d)\\d{4}",[8]],0,0,["7879\\d{4}",[8]]]],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]],0,0,0,0,0,0,[["2(?:0(?:49|5[23]|6[5-7]|9[016-9])|4(?:4[569]|5[4-6]|6[5-7]|7[01
67279])|5(?:[34]\\d|50|6[5-8]))\\d{4}"],["(?:0[1-7]|4[4-6]|5[0-8]|[67]\\d)\\d{6}"]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["2\\d{5,7}|(?:43[1-6]|70[1-9])\\d{4,5}|(?:[36]\\d|4[124-7]|[57][1-9]|8[1-6]|9[1-7])\\d{5,6}",[6,7,8]],["(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}",[8,9]],["(?:00800\\d\\d|800)\\d{5}",[8,12]],["90\\d{6}",[8]],0,0,0,0,0,["700\\d{5}",[8]]]],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]],0,0,0,0,0,0,[["(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|55|7[7-9]|88)|9[69][69])|7(?:[07]\\d\\d|1(?:11|78)))\\d{4}"],["(?:3(?:[0-79]\\d|8[0-57-9])\\d|6(?:3(?:00|33|6[16])|441|6(?:3[03-9]|[69]\\d|7[0-689])))\\d{4}"],["8[02369]\\d{6}"],["(?:87|9[0-8])\\d{6}"],0,0,0,0,0,["84\\d{6}"]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]],0,0,0,0,0,0,[["(?:22|31)\\d{6}"],["(?:29|6[1-9]|7[125-9])\\d{6}"]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]],0,0,0,0,0,0,[["012\\d{7}",[10]],["01(?:2[5-9]|[4-69]\\d)\\d{6}",[10]],0,0,0,0,["81\\d{6}",[8]],0,["857[58]\\d{4}",[8]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441",[["441(?:[46]\\d\\d|5(?:4\\d|60|89))\\d{4}"],["441(?:[2378]\\d|5[0-39]|9[02])\\d{5}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["22[0-7]\\d{4}|(?:2[013-9]|[34]\\d|5[0-25-9])\\d{5}"],["(?:22[89]|[78]\\d\\d)\\d{4}"],0,0,0,0,0,0,["5[34]\\d{5}"]]],BO:["591","00(?:1\\d)?","(?:[2-7]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]|50"]],["(\\d{8})","$1",["[5-7]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?",0,0,0,[["(?:2(?:2\\d\\d|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d\\d|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:[27]\\d|3[2-4]|4[248]|5[24]|6[2-6]))|4(?:4\\d\\d|6(?:11|[24689]\\d|72)))\\d{4}",[8]],["(?:57|[67]\\d)\\d{6}",[8]],["8001[07]\\d{4}",[9]],0,0,0,0,0,["50\\d{6}",[8]]]],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]",[["(?:318[023]|41(?:6[023]|70)|7(?:1[578]|2[05]|50)\\d)\\d{3}"],["(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}"]]],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2",0,0,[["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}",[10]],["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}",[10,11]],["800\\d{6,7}",[9,10]],["[59]00\\d{6,7}",[9,10]],0,0,0,0,0,["(?:30[03]\\d{3}|4(?:0(?:0\\d|20)|370|864))\\d{4}|300\\d{5}",[8,10]]]],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242",[["242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-5]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}"],["242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|3[0-4]|[89]9))\\d{4}"],["242300\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,["242225\\d{4}"]]],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]],0,0,0,0,0,0,[["(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}",[7]],["(?:1[67]|[78]7)\\d{6}",[8]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013]|81)|4(?:6[03]|7[1267]|9[0-5])|5(?:3[03489]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[013467]))\\d{4}",[7]],["(?:321|7(?:[1-8]\\d|9[03]))\\d{5}",[8]],["(?:0800|800\\d)\\d{6}",[10]],["90\\d{5}",[7]],0,0,0,0,["79(?:1(?:[0-2]\\d|3[0-8])|2[0-7]\\d)\\d{3}",[8]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,[["(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d\\d)|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}",[9]],["(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}",[9]],["800\\d{3,7}|8(?:0[13]|20\\d)\\d{7}"],["(?:810|902)\\d{7}",[10]],0,0,0,0,["249\\d{6}",[9]]],"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]],0,0,0,0,0,0,[["(?:2(?:[02]\\d|36|[68]0)|[3-58](?:[02]\\d|[68]0)|7(?:[02]\\d|32|[68]0))\\d{4}",[7]],["6[0-35-7]\\d{5}",[7]],["0800\\d{7}",[11]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:12|573)\\d\\d|276)\\d{5}|[1-6]\\d{6}"],["88\\d{5}|(?:8[0-69]|9[016-9])\\d{7}",[7,9]]]],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]],0,0,0,0,0,0,[["(?:2[12]|61)\\d{6}"],["7[02-7]\\d{6}"],0,["8776\\d{4}"]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]],0,0,0,0,0,0,[["222[1-589]\\d{5}"],["026(?:1[0-5]|6[6-9])\\d{4}|0(?:[14-6]\\d\\d|2(?:40|5[5-8]|6[07-9]))\\d{5}"],0,["80[0-2]\\d{6}"]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}",[9]],["(?:6[89]|7[235-9])\\d{7}",[9]],["800\\d{6}",[9]],["90[016]\\d{6}",[9]],["878\\d{6}",[9]],["860\\d{9}",[12]],["5[18]\\d{7}",[9]],["74[0248]\\d{6}",[9]],0,["84[0248]\\d{6}",[9]]]],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]],0,0,0,0,0,0,[["2(?:[15]\\d{3}|7(?:2(?:0[23]|1[2357]|2[245]|3[45]|4[3-5])|3(?:06|1[69]|[2-6]7)))\\d{5}"],["0[157]\\d{8}"]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["(?:2\\d|3[13-7]|4[1-5])\\d{3}"],["[578]\\d{4}"]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]],0,0,0,0,0,0,[["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:(?:[24]\\d|50)\\d|3(?:[034679]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|8[0-389])|600)|646[59])|(?:600|80[1-9])\\d\\d|9(?:(?:10[0-2]|7[1-9]\\d)\\d|3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}",[9]],["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:(?:[24]\\d|50)\\d|3(?:[034679]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|8[0-389])|600)|646[59])|80[1-8]\\d\\d|9(?:(?:10[0-2]|7[1-9]\\d)\\d|3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}",[9]],["(?:123|8)00\\d{6}",[9,11]],0,0,0,0,0,["44\\d{7}",[9]],["600\\d{7,8}",[10,11]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]],0,0,0,0,0,0,[["2(?:22|33)\\d{6}",[9]],["(?:24[23]|6(?:[25-9]\\d|4[0-2]))\\d{6}",[9]],["88\\d{6,7}"]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4}
672)","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,[["(?:10(?:[02-79]\\d\\d|[18](?:0[1-9]|[1-9]\\d))|2(?:[02-57-9]\\d{3}|1(?:[18](?:0[1-9]|[1-9]\\d)|[2-79]\\d\\d))|(?:41[03]|8078|9(?:78|94))\\d\\d)\\d{5}|(?:10|2[0-57-9])(?:1(?:00|23)\\d\\d|95\\d{3,4})|(?:41[03]|9(?:78|94))(?:100\\d\\d|95\\d{3,4})|8078123|(?:43[35]|754|851)\\d{7,8}|(?:43[35]|754|851)(?:1(?:00\\d|23)\\d|95\\d{3,4})|(?:3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:[39]1|5[57]|6[09])|8(?:71|98))(?:[02-8]\\d{7}|1(?:0(?:0\\d\\d(?:\\d{3})?|[1-9]\\d{5})|[13-9]\\d{6}|2(?:[0-24-9]\\d{5}|3\\d(?:\\d{4})?))|9(?:[0-46-9]\\d{6}|5\\d{3}(?:\\d(?:\\d{2})?)?))|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[24-9]|2[179]|3[46-9]|5[2-9]|6[47-9]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|3\\d|5[2-9]|7[02-9]|8[36-8]|9[1-7])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))(?:[02-8]\\d{6}|1(?:0(?:0\\d\\d(?:\\d{2})?|[1-9]\\d{4})|[13-9]\\d{5}|2(?:[0-24-9]\\d{4}|3\\d(?:\\d{3})?))|9(?:[0-46-9]\\d{5}|5\\d{3,5}))",[7,8,9,10,11]],["1(?:610\\d|740[0-5])\\d{6}|1(?:[38]\\d|4[57]|[59][0-35-9]|6[25-7]|7[0-35-8])\\d{8}",[11]],["(?:(?:10|21)8|8)00\\d{7}",[10,12]],["16[08]\\d{5}",[8]],0,0,0,0,0,["10(?:10\\d{4}|96\\d{3,4})|400\\d{7}|950\\d{7,8}|(?:2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}",[7,8,9,10,11]]],"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?",0,0,0,[["601055(?:[0-4]\\d|50)\\d\\d|6010(?:[0-4]\\d|5[0-4])\\d{4}|(?:46|60(?:[18][1-9]|[24-7][2-9]))\\d{6}",[8,10]],["333301[0-5]\\d{3}|3333(?:00|2[5-9]|[3-9]\\d)\\d{4}|(?:3(?:(?:0[0-5]|1\\d|5[01]|70)\\d|2(?:[0-3]\\d|4[1-9])|3(?:00|3[0-24-9]))|9(?:101|408))\\d{6}",[10]],["1800\\d{7}",[11]],["(?:19(?:0[01]|4[78])|901)\\d{7}",[10,11]]]],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))",0,0,0,[["210[7-9]\\d{4}|2(?:[024-7]\\d|1[1-9])\\d{5}",[8]],["(?:3005\\d|6500[01])\\d{3}|(?:5[07]|6[0-4]|7[0-3]|8[3-9])\\d{6}",[8]],["800\\d{7}",[10]],["90[059]\\d{7}",[10]],0,0,0,0,["(?:210[0-6]|4\\d{3}|5100)\\d{4}",[8]]]],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:3[23]|4[89])\\d{4,6}|(?:31|4[36]|8(?:0[25]|78)\\d)\\d{6}|(?:2[1-4]|4[1257]|7\\d)\\d{5,6}"],["(?:5\\d|6[2-4])\\d{6}",[8]],["800\\d{7}",[10]],0,0,0,0,0,0,["807\\d{7}",[10]]]],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[["2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}"],["(?:36|5[1-389]|9\\d)\\d{5}"],["800\\d{4}"],0,0,0,0,0,["(?:3[3-5]|4[356])\\d{5}"]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]",[["9(?:4(?:3[0-5]|4[14]|6\\d)|50\\d|7(?:2[014]|3[02-9]|4[4-9]|6[357]|77|8[7-9])|8(?:3[39]|[46]\\d|7[01]|8[57-9]))\\d{4}"],["953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}"],0,0,0,0,0,["955\\d{5}",[8]],0,["60[0-2]\\d{4}",[7]]]],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]],0,0,0,0,0,0,[["2[2-6]\\d{6}"],["9(?:10|[4-79]\\d)\\d{5}"],["800\\d{5}"],["90[09]\\d{5}"],["700\\d{5}"],0,["(?:50|77)\\d{6}"],0,0,["80[1-9]\\d{5}"]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:2\\d|3[1257-9]|4[16-9]|5[13-9])\\d{7}",[9]],["7060\\d{5}|(?:60[1-8]|7(?:0[2-5]|19|[2379]\\d))\\d{6}",[9]],["800\\d{6}",[9]],["9(?:0[05689]|76)\\d{6}",[9]],["70[01]\\d{6}",[9]],["9(?:3\\d{9}|6\\d{7,10})"],["9(?:5\\d|7[2-4])\\d{6}",[9]],0,["9[17]0\\d{6}",[9]],["8[134]\\d{7}",[9]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0",0,0,0,0,0,[["32\\d{9,11}|49[1-6]\\d{10}|322\\d{6}|49[0-7]\\d{3,9}|(?:[34]0|[68]9)\\d{3,13}|(?:2(?:0[1-689]|[1-3569]\\d|4[0-8]|7[1-7]|8[0-7])|3(?:[3569]\\d|4[0-79]|7[1-7]|8[1-8])|4(?:1[02-9]|[2-48]\\d|5[0-6]|6[0-8]|7[0-79])|5(?:0[2-8]|[124-6]\\d|[38][0-8]|[79][0-7])|6(?:0[02-9]|[1-358]\\d|[47][0-8]|6[1-9])|7(?:0[2-8]|1[1-9]|[27][0-7]|3\\d|[4-6][
6720-8]|8[0-5]|9[013-7])|8(?:0[2-9]|1[0-79]|2\\d|3[0-46-9]|4[0-6]|5[013-9]|6[1-8]|7[0-8]|8[0-24-6])|9(?:0[6-9]|[1-4]\\d|[589][0-7]|6[0-8]|7[0-467]))\\d{3,12}",[5,6,7,8,9,10,11,12,13,14,15]],["1(?:6[023]|7\\d)\\d{7,8}|15(?:[0-25-9]\\d\\d|3(?:10|33))\\d{6}",[10,11]],["800\\d{7,12}",[10,11,12,13,14,15]],["(?:137[7-9]|900(?:[135]|9\\d))\\d{6}",[10,11]],["700\\d{8}",[11]],["1(?:6(?:013|255|399)|7(?:(?:[015]1|[69]3)3|[2-4]55|[78]99))\\d{7,8}|15(?:(?:[03-68]00|113)\\d|2\\d55|7\\d99|9\\d33)\\d{7}",[12,13]],["18(?:1\\d{5,11}|[2-9]\\d{8})",[8,9,10,11,12,13,14]],["16(?:4\\d{1,10}|[89]\\d{1,11})",[4,5,6,7,8,9,10,11,12,13,14]],0,["180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}",[7,8,9,10,11,12,13,14]]]],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]],0,0,0,0,0,0,[["2(?:1[2-5]|7[45])\\d{5}"],["77\\d{6}"]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:[0-59][1-9]|[6-8]\\d)|3(?:[0-3][1-9]|4[13]|5[1-58]|6[1347-9]|7\\d|8[1-8]|9[1-79])|4(?:[0-25][1-9]|[34][2-9]|6[13-579]|7[13579]|8[1-47]|9[127])|5(?:[0-36][1-9]|4[146-9]|5[3-57-9]|7[568]|8[1-358]|9[1-69])|6(?:[0135][1-9]|2[1-68]|4[2-8]|6[1689]|[78]\\d|9[15689])|7(?:[0-69][1-9]|7[3-9]|8[147])|8(?:[16-9][1-9]|2[1-58])|9(?:[1-47-9][1-9]|6\\d))\\d{5}"],["(?:2[6-8]|37|6[78]|96)\\d{6}|(?:2[0-59]|3[0-689]|[457]\\d|6[0-69]|8[126-9]|9[1-47-9])[1-9]\\d{5}"],["80\\d{6}"],["90\\d{6}"]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767",[["767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4])\\d{4}"],["767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-8]|70[1-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9",[["8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}"],["8[024]9[2-9]\\d{6}"],["800(?:14|[2-9]\\d)\\d{5}|8[024]9[01]\\d{6}|8(?:33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0",0,0,0,0,0,[["9619\\d{5}|(?:[1-3]\\d|4[013-689])\\d{6}"],["5(?:4[0-29]|6[0-4])\\d{6}|(?:55|6\\d|7[7-9])\\d{7}",[9]],["800\\d{6}",[9]],["80[3-689]1\\d{5}",[9]],0,0,0,0,["98[23]\\d{6}",[9]],["80[12]1\\d{5}",[9]]]],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["[2-7][2-7]\\d{6}",[8]],["964[0-2]\\d{5}|9(?:39|[57][89]|6[0-36-9]|[89]\\d)\\d{6}",[9]],["1800\\d{7}|1[78]00\\d{6}",[10,11]],0,0,0,0,0,["[2-7]890\\d{4}",[8]]]],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}",[7]],["(?:5\\d{5}|8(?:1(?:0(?:0(?:00|[178]\\d)|[3-9]\\d\\d)|(?:1(?:0[2-6]|1\\d)|[2-79]\\d\\d)\\d)|2(?:0(?:0(?:00|4\\d)|(?:19|[2-7]\\d)\\d)|(?:(?:[124-69]\\d|3[5-9])\\d|7(?:[
6720-79]\\d|8[013-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}",[7,8]],["800(?:(?:0\\d\\d|1)\\d|[2-9])\\d{3}"],["(?:40\\d\\d|900)\\d{4}",[7,8]],["70[0-2]\\d{5}",[8]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0",0,0,0,0,0,[["13[23]\\d{6}|(?:15|57)\\d{6,7}|(?:2\\d|3|4[05-8]|5[05]|6[24-689]|8[2468]|9[235-7])\\d{7}",[8,9]],["1[0-25]\\d{8}",[10]],["800\\d{7}",[10]],["900\\d{7}",[10]]]],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1[12568]|[24]0|55|6[146])|8\\d\\d)\\d{4}"],["(?:17[1-3]|7\\d\\d)\\d{4}"]]],ES:["34","00","(?:400|[5-9]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-9]"]]],0,0,0,0,0,0,[["96906(?:0[0-8]|1[1-9]|[2-9]\\d)\\d\\d|9(?:69(?:0[0-57-9]|[1-9]\\d)|73(?:[0-8]\\d|9[1-9]))\\d{4}|(?:400|8(?:[1356]\\d|[28][0-8]|[47][1-9])|9(?:[135]\\d|[268][0-8]|4[1-9]|7[124-9]))\\d{6}"],["96906(?:09|10)\\d\\d|(?:590(?:10[0-2]|600)|97390\\d)\\d{3}|(?:6\\d|7[1-48])\\d{7}"],["[89]00\\d{6}"],["80[367]\\d{6}"],["70\\d{7}"],0,["51\\d{7}"],0,0,["90[12]\\d{6}"]]],ET:["251","00","(?:11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:11(?:[124]\\d\\d|3(?:[0-79]\\d|8[0-7])|5(?:[02-9]\\d|1[0-57-9])|6(?:[02-79]\\d|1[0-57-9]|8[0-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|(?:22|55)[0-6]|33[0134689]|44[04]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:119|22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:(?:11|22)[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}"],["700[1-9]\\d{5}|(?:7(?:0[1-9]|1[0-8]|2[1-35-79]|3\\d|77|86|99)|(?:8[01]|9\\d)\\d)\\d{6}"]]],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",[["1[3-7][1-8]\\d{3,6}|(?:19[1-8]|[23568][1-8]\\d|9(?:00|[1-8]\\d))\\d{2,6}",[5,6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,[["603\\d{4}|(?:3[0-5]|6[25-7]|8[58])\\d{5}",[7]],["(?:[279]\\d|45|5[01568]|8[034679])\\d{5}",[7]],["0800\\d{7}",[11]]],"00"],FK:["500","00","[2-7]\\d{4}",[5],0,0,0,0,0,0,0,[["[2-47]\\d{4}"],["[56]\\d{4}"]]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]],0,0,0,0,0,0,[["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-6]\\d)\\d)\\d{3}"],["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-7]\\d)\\d)\\d{3}"]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))",0,0,0,[["(?:20|[34]\\d|8[19])\\d{4}"],["(?:[27][1-9]|5\\d|9[136])\\d{4}"],["80[257-9]\\d{3}"],["90(?:[13-5][15-7]|2[125-7]|9\\d)\\d\\d"],0,0,0,0,["(?:6[0-36]|88)\\d{4}"]]],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0",0,0,0,0,0,[["(?:26[013-9]|59[1-35-9])\\d{6}|(?:[13]\\d|2[0-57-9]|4[1-9]|5[0-8])\\d{7}"],["(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7[3-9]\\d)\\d{6}"],["80[0-5]\\d{6}"],["836(?:0[0-36-9]|[1-9]\\d)\\d{4}|8(?:1[2-9]|2[2-47-9]|3[0-57-9]|[569]\\d|8[0-35-9])\\d{6}"],0,0,["80[6-9]\\d{6}"],0,["9\\d{8}"],["8(?:1[01]|2[0156]|4[024]|84)\\d{6}"]]],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1",0,0,[["[01]1\\d{6}",[8]],["(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}"]]],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])
672))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473",[["473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-4]|5[59]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}"],["473(?:4(?:0[2-79]|1[04-9]|2[0-5]|49|5[6-8])|5(?:2[01]|3[3-8])|901)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-46-9]|5[0-57-9])|7","5(?:[0-46-9]|5(?:[0-357-9]|44))|7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-58]"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}"],["5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0(?:1[09]|70)|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|1[12]|22|3[0-6]|44|5[05]|77|88|9[09])|(?:[14]\\d|77)\\d|22[02])|1(?:1(?:[03][01]|[124]\\d|5[2-6]|7[0-6])|4\\d\\d)|2(?:228|555)|3555|4(?:4\\d\\d|555)|5(?:[0157-9]\\d\\d|200|333|4(?:44|55))|6[89]\\d\\d|7(?:(?:[0147-9]\\d|22)\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}"],["800\\d{6}"],0,0,0,0,0,["70[67]\\d{6}"]]],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:4(?:[02-49]\\d|1[0-5]|5[6-9]|6[0-3]|80)|88\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:694(?:[0-249]\\d|3[0-8])|7093[0-3])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:396|76\\d)\\d|476[0-6])\\d{4}"]]],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0",0,0,0,0,0,[["3082[0-5]\\d{4}|3(?:0(?:[237]\\d|8[01])|[167](?:2[0-6]|7\\d|80)|2(?:2[0-5]|7\\d|80)|3(?:2[0-3]|7\\d|80)|4(?:2[013-9]|3[01]|7\\d|80)|5(?:2[0-7]|7\\d|80)|8(?:2[0-2]|7\\d|80)|9(?:[28]0|7\\d))\\d{5}",[9]],["(?:2(?:[0346-9]\\d|5[67])|5(?:[03-7]\\d|9[1-9]))\\d{6}",[9]],["800\\d{5,6}"]]],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]],0,0,0,0,0,0,[["2190[0-2]\\d{3}|2(?:0(?:[02]\\d|3[01])|16[24-9]|2[2-5]\\d)\\d{4}"],["5251[0-4]\\d{3}|(?:5(?:[146-8]\\d\\d|250)|60(?:1[01]|6\\d))\\d{4}"]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]],0,0,0,0,0,0,[["(?:19|3[1-7]|[68][1-9]|70|9\\d)\\d{4}"],["[245]\\d{5}"],["80\\d{4}"],0,0,0,0,0,["3[89]\\d{4}"]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:4(?:[23]\\d\\d|4(?:1[024679]|[6-9]\\d))|5(?:5(?:3\\d|4[0-7])|6[67]\\d|7(?:1[04]|2[035]|3[58]|48))|8[0-389]\\d\\d)\\d{3}"],["556\\d{4}|(?:[23679]\\d|4[015]|5[0-489]|8[4-7])\\d{5}"]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]],0,0,0,0,0,0,[["3(?:0(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])|1\\d\\d)\\d{4}",[8]],["6[0-356]\\d{7}",[9]],0,0,0,0,0,0,["722\\d{6}",[9]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]],0,0,0,0,0,0,[["33[0-24-9]\\d[46]\\d{4}|3(?:33|5\\d)\\d[7-9]\\d{4}"],["(?:222|55\\d)\\d{6}"],["80\\d[1-9]\\d{5}"],["90\\d[1-9]\\d{5}
672"]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:1\\d\\d|2(?:2[1-46-9]|[36][1-8]|4[1-7]|5[1-4]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|[269][1-6]|3[1245]|4[1-7]|5[13-9]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}",[10]],["68[57-9]\\d{7}|(?:69|94)\\d{8}",[10]],["800\\d{7,9}"],["90[19]\\d{7}",[10]],["70\\d{8}",[10]],0,["5005000\\d{3}",[10]],0,0,["8(?:0[16]|12|[27]5|50)\\d{7}",[10]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["[267][2-9]\\d{6}",[8]],["(?:[3-5]\\d\\d|80[0-4])\\d{5}",[8]],["18[01]\\d{8}",[11]],["19\\d{9}",[11]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671",[["671(?:2\\d\\d|3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[02-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[478])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[16-9]))\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]],0,0,0,0,0,0,[["443\\d{6}",[9]],["9(?:5\\d|6[569]|77)\\d{6}",[9]],0,0,0,0,0,0,["40\\d{5}",[7]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56]
672)|50[0-6]|77[1-57])\\d{4}"],["(?:51[01]|6\\d\\d|7(?:[0-5]\\d|6[0-79]|[78]0))\\d{4}"],["(?:289|8(?:00|6[28]|88|99))\\d{4}"],["9008\\d{3}"],0,0,0,0,["515\\d{4}"]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:2(?:[13-9]\\d|2[013-9])\\d|3(?:(?:[1569][0-24-9]|4[0-246-9]|7[0-24-69])\\d|8(?:4[0-8]|[579]\\d|6[0-5]))|58(?:0[1-9]|1[2-9]))\\d{4}",[8]],["(?:4(?:(?:09|24)[3-6]|44[0-35-9]|6(?:4[0-57-9]|6[0-6])|7(?:4[0-48]|6[0-5]))|5(?:25[3-7]|35[4-8]|73[0-6]|95[0-8])|6(?:26[013-8]|(?:66|78)[0-5])|70(?:7[1-8]|8[0-8])|84(?:4[0-2]|8[0-35-9])|9(?:29[013-9]|39[014-9]|59[0-467]|899))\\d{4}|(?:4(?:4[0-35-9]|6[0-357-9]|7[0-35])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|70[1-59]|84[0-39]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}",[8]],["800\\d{6}",[9]],["900(?:[0-24-9]\\d{7}|3\\d{1,4})",[5,6,7,8,11]],["8(?:1[0-4679]\\d|2(?:[0-36]\\d|7[0-4])|3(?:[034]\\d|2[09]|70))\\d{4}",[8]],0,["30(?:0[1-9]|[15-7]\\d|2[047]|89)\\d{4}",[8]],["7(?:1(?:0[0-38]|1[0-3679]|3[013]|69|9[0136])|2(?:[02389]\\d|1[18]|7[27-9])|3(?:[0-38]\\d|7[0-369]|9[2357-9])|47\\d|5(?:[178]\\d|5[0-5])|6(?:0[0-7]|2[236-9]|[35]\\d)|7(?:[27]\\d|8[7-9])|8(?:[23689]\\d|7[1-9])|9(?:[025]\\d|6[0-246-8]|7[0-36-9]|8[238]))\\d{4}",[8]]],"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]],0,0,0,0,0,0,[["2(?:2(?:0[0-59]|1[1-9]|[23]\\d|4[02-8]|5[57]|6[2458]|7[0135689]|8[01346-9]|9[0-2])|4(?:0[578]|2[3-59]|3[13-9]|4[0-68]|5[1-3589]|80)|5(?:0[2357-9]|1[1-6]|4[03-58]|5\\d|6[014-69]|7[04]|80)|6(?:[056]\\d|17|2[067]|3[047]|4[0-378]|[78][0-8]|9[01])|7(?:0[5-79]|2[01]|6[46-9]|7[02-9]|8[034]|91)|8(?:79|8[0-357-9]|9[1-57-9]))\\d{4}",[8]],["[37-9]\\d{7}",[8]],["8002\\d{7}",[11]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}",[8,9]],["9(?:(?:0[1-9]|[12589]\\d)\\d\\d|7(?:[0679]\\d\\d|5(?:[01]\\d|44|55|77|9[5-79])))\\d{4}|98\\d{6}",[8,9]],["80\\d{5,7}"],["6[01459]\\d{6}|6[01]\\d{5}",[7,8]],["7[45]\\d{6}",[8]],0,["62\\d{6,7}|72\\d{6}",[8,9]]]],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[["2(?:2\\d|5[1-5]|81|9[149])\\d{5}"],["(?:[34]\\d|5[568])\\d{6}"],["8\\d{7}"],0,0,0,0,0,["9(?:[67][0-4]|8[0-3589]|9\\d)\\d{5}"]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06",0,0,0,0,0,[["(?:1\\d|[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6[23689]|8[2-57-9]|9[2-69])\\d{6}",[8]],["(?:[257]0|3[01])\\d{7}",[9]],["(?:[48]0\\d|680[29])\\d{5}"],["9[01]\\d{6}",[8]],0,0,["38\\d{7}",[9]],0,["21\\d{7}",[9]]]],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0",0,0,0,0,0,[["2[124]\\d{7,8}|619\\d{8}|2(?:1(?:14|500)|2\\d{3})\\d{3}|61\\d{5,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}",[7,8,9,10,11]],["8[1-35-9]\\d{7,10}",[9,10,11,12]],["00(?:1803\\d{5,11}|7803\\d{7})|(?:177\\d|800)\\d{5,7}",[8,9,10,11,12,13,14,15,16,17]],["809\\d{7}",[10]],0,0,["(?:1500|8071\\d{3})\\d{3}",[7,10]],0,0,["804\\d{7}",[10]]]],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:1\\d|21)\\d{6,7}|(?:2[24-9]|4(?:0[24]|5\\d|7)|5(?:0[45]|1\\d|8)|6(?:1\\d|[237-9])|9(?:1\\d|[35-9]))\\d{5}|(?:23|4(?:[1-469]|8\\d)|5[23679]|6[4-6]|7[14]|9[04])\\d{7}"],["8(?:22|[35-9]\\d)\\d{6}",[9]],["1800\\d{6}",[10]],["15(?:1[2-8]|[2-8]0|9[089])\\d{6}",[10]],["700\\d{6}",[9]],["88210[1-9]\\d{4}|8(?:[35-79]5\\d\\d|8(?:[013-9]\\d\\d|2(?:[01][1-9]|[2-9]\\d)))\\d{5}",[10]],["818\\d{6}",[9]],0,["76\\d{7}",[9]],["18[59]0\\d{6}",[10]]]],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0",0,0,0,0,0,[["153\\d{8,9}|29[1-9]\\d{5}|(?:2[0-8]|[3489]\\d)\\d{6}
672",[8,11,12]],["55(?:4(?:0[0-3]|[16]0)|57[0-289])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[3-5]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}",[9]],["1(?:255|80[019]\\d{3})\\d{3}",[7,10]],["1212\\d{4}|1(?:200|9(?:0[0-2]|19|9\\d))\\d{6}",[8,10]],0,["151\\d{8,9}",[11,12]],["1599\\d{6}",[10]],0,["7(?:38(?:[05]\\d|8[0138])|8(?:33|55|77|81)\\d)\\d{4}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}",[9]],["1700\\d{6}",[10]]]],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24",[["1624(?:230|[5-8]\\d\\d)\\d{3}"],["76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}"],["808162\\d{4}"],["8(?:440[49]06|72299\\d)\\d{3}|(?:8(?:45|70)|90[0167])624\\d{4}"],["70\\d{8}"],0,["3440[49]06\\d{3}|(?:3(?:08162|3\\d{4}|45624|7(?:0624|2299))|55\\d{4})\\d{4}"],0,["56\\d{8}"]]],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0",0,0,0,0,0,[["(?:2717(?:[2-7]\\d|95)|6828[235-7]\\d)\\d{4}|(?:170[24]|280[13468]|4(?:20[24]|72[2-8])|552[1-7])\\d{6}|(?:271[0-689]|682[0-79]|782[0-6])[2-7]\\d{5}|(?:2(?:[02][2-79]|90)|3(?:23|80)|683|79[1-7])\\d{7}|(?:11|33|4[04]|80)[2-7]\\d{7}|(?:342|674|788)(?:[0189][2-7]|[2-7]\\d)\\d{5}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[13]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[014-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[3-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1245]|4[5-8]|5[125689]|6[235-7]|7[157-9]|8[2-46-8])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2
672-689]|6[24578]|7[235689]|8[14-6])|7(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|8[013-7]|9[089])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d[2-7]\\d{5}",[10]],["(?:6(?:1279|828[01489])|7(?:887[02-9]|9(?:313|79[07-9]))|8(?:079[04-9]|(?:84|91)7[02-8]))\\d{5}|(?:160[01]|6(?:(?:12|[2-4]1|5[17]|6[13]|80)[0189]|7(?:1[0189]|86))|7(?:1(?:2[0189]|9[0-5])|3(?:2[5-8]|[34][017-9]|9[016-9])|5(?:[15][017-9]|2[04-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589])|70[0289]|88[089]|97[02-8])|8(?:0(?:6[67]|7[02-8])|70[017-9]|84[01489]|91[0-289]))\\d{6}|(?:731|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[0189]\\d|7[02-8])\\d{5}|(?:6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|4[0189]|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-5])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]|881))[0189]\\d{5}|(?:6(?:[09]\\d|1[04679]|2[03689]|3[05-9]|4[0489]|50|6[069]|7[07]|8[7-9])|7(?:[024]\\d|3[05-8]|5[0346-8]|6[6-9]|7[1-9]|8[0-79]|9[089])|8(?:0[01589]|1[0-57-9]|2[235-9]|3[03-57-9]|[45]\\d|6[02457-9]|7[1-69]|8[0-25-9]|9[02-9])|9\\d\\d)\\d{7}",[10]],["000800\\d{7}|180(?:0\\d{4,9}|3\\d{9})"],["186[12]\\d{9}",[13]],0,0,["140\\d{7}",[10]],0,0,["1860\\d{7}",[11]]]],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]],0,0,0,0,0,0,[["37\\d{5}"],["38\\d{5}"]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}",[8,9]],["7[3-9]\\d{8}",[10]]]],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0",0,0,0,0,0,[["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])(?:[03-57]\\d{7}|[16]\\d{3}(?:\\d{4})?|[289]\\d{3}(?:\\d(?:\\d{3})?)?)|94(?:000[09]|(?:12\\d|30[0-2])\\d|2(?:[02689]0\\d|121)|4(?:111|40\\d))\\d{4}",[6,7,10]],["9(?:(?:0[0-5]|[13]\\d|2[0-3])\\d\\d|9(?:[0-46]\\d\\d|5(?:10|5\\d)|8(?:[12]\\d|3[0-2]|88)|9(?:[01359]\\d|21|69|77|8[7-9])))\\d{5}",[10]],0,0,0,0,["96(?:0[12]|2[16-8]|3(?:08|[14]5|[23]|66)|4(?:0|80)|5[01]|6[89]|86|9[19])",[4,5]]]],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["(?:4(?:1[0-24-69]|2[0-7]|[37][0-8]|4[0-24589]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[0-579]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|872)\\d{4}",[7]],["(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[238]))\\d{4}"],["80[0-8]\\d{4}",[7]],["90(?:0\\d|1[5-79]|2[015-79]|3[135-79]|4[125-7]|5[25-79]|7[1-37]|8[0-35-7])\\d{3}",[7]],0,["(?:689|8(?:7[18]|80)|95[48])\\d{4}",[7]],["809\\d{4}",[7]],0,["49[0-24-79]\\d{4}",[7]]],"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876",[["8766060\\d{3}|(?:658(?:2(?:[5-8]\\d|9[0-46-9])|[3-9]\\d\\d)|876(?:52[35]|6(?:0[1-3579]|1[0235-9]|[23]\\d|40|5[06]|6[2-589]|7[0-25-9]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}"],["(?:6582(?:[0-4]\\d|95)|876(?:2(?:0[1-9]|[13-9]\\d|2[013-9])|[348]\\d\\d|5(?:0[1-9]|[1-9]\\d)|6(?:4[89]|6[
67267])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0",0,0,0,0,0,[["87(?:000|90[01])\\d{3}|(?:2(?:6(?:2[0-35-9]|3[0-578]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[5-7][023])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2(?:[05]0|22)|3(?:00|33)|4(?:0[0-25]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[178]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[0239]))|87(?:20|7[078]|99))\\d{4}",[8]],["(?:427|7(?:[78][0-25-9]|9\\d))\\d{6}",[9]],["80\\d{6}",[8]],["9\\d{7}",[8]],["70\\d{7}",[9]],0,["8(?:10|8\\d)\\d{5}",[8]],["74(?:66|77)\\d{5}",[9]],0,["85\\d{6}",[8]]]],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1",0,0,[["(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|(?:2[2-9]|[36][1-9])\\d|4(?:[2-578]\\d|6[02-8]|9[2-59])|5(?:[2-589]\\d|6[1-9]|7[2-8])|7(?:[25-9]\\d|3[4-9]|4[02-9])|8(?:[2679]\\d|3[2-9]|4[5-9]|5[1-9]|8[03-9])|9(?:[2-58]\\d|[679][1-9]))\\d{6}",[9]],["[6-9]0[1-9]\\d{7}",[10]],["00777(?:[01]|5\\d)\\d\\d|(?:00(?:7778|882[1245])|(?:120|800\\d)\\d\\d)\\d{4}|00(?:37|66|78)\\d{6,13}"],["990\\d{6}",[9]],["60\\d{7}",[9]],0,["570\\d{6}",[9]],["20\\d{8}",[10]],["50[1-9]\\d{7}",[10]]]],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:4[245]|5[1-79]|6[01457-9])\\d{5,7}|(?:4[136]|5[08]|62)\\d{7}|(?:[24]0|66)\\d{6,7}",[7,8,9]],["(?:1(?:0[0-8]|[18]\\d|2[014]|30|4[0-5])|7\\d\\d)\\d{6}",[9]],["800[02-8]\\d{5,6}",[9,10]],["900[02-9]\\d{5}",[9]]]],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["312(?:5[0-79]\\d|9(?:[0-689]\\d|7[0-24-9]))\\d{3}|(?:3(?:1(?:2[0-46-8]|3[1-9]|47|[56]\\d)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}",[9]],["312(?:58\\d|973)\\d{3}|(?:2(?:0[0-35]|2\\d)|5[0-24-7]\\d|600|7(?:[07]\\d|55)|88[08]|9(?:12|9[05-9]))\\d{6}",[9]],["800\\d{6,7}"]]],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["23(?:4(?:[2-4]|[56]\\d)|[568]\\d\\d)\\d{4}|23[236-9]\\d{5}
672|(?:2[4-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:(?:[237-9]|4[56]|5\\d)\\d{5}|6\\d{5,6})",[8,9]],["(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}",[8,9]],["1800(?:1\\d|2[019])\\d{4}",[10]],["1900(?:1\\d|2[09])\\d{4}",[10]]]],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0",0,0,0,0,0,[["(?:[24]\\d|3[1-9]|50|65(?:02[12]|12[56]|22[89]|[3-5]00)|7(?:27\\d\\d|3100|5(?:02[12]|12[56]|22[89]|[34](?:00|81)|500))|8[0-5])\\d{3}"],["(?:6200[01]|7(?:310[1-9]|5(?:02[03-9]|12[0-47-9]|22[0-7]|[34](?:0[1-9]|8[02-9])|50[1-9])))\\d{3}|(?:63\\d\\d|7(?:(?:[0146-9]\\d|2[0-689])\\d|3(?:[02-9]\\d|1[1-9])|5(?:[0-2][013-9]|[34][1-79]|5[1-9]|[6-9]\\d)))\\d{4}",[8]],0,0,0,0,0,0,["30(?:0[01]\\d\\d|12(?:11|20))\\d\\d",[8]]]],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]],0,0,0,0,0,0,[["7[4-7]\\d{5}"],["[34]\\d{6}"],0,["8\\d{6}"]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869",[["869(?:2(?:29|36)|302|4(?:6[015-9]|70)|56[5-7])\\d{4}"],["869(?:48[89]|55[6-8]|66\\d|76[02-7])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:195|2)\\d|3[19]|4[159]|5[37]|6[17]|7[39]|85)\\d{6}"],["19[1-3]\\d{7}",[10]]]],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?",0,0,0,[["(?:2|3[1-3]|[46][1-4]|5[1-5])[1-9]\\d{6,7}|(?:3[1-3]|[46][1-4]|5[1-5])1\\d{2,3}",[5,6,8,9,10]],["1(?:05(?:[0-8]\\d|9[0-6])|22[13]\\d)\\d{4,5}|1(?:0[0-46-9]|[16-9]\\d|2[013-9])\\d{6,7}",[9,10]],["00(?:308\\d{6,7}|798\\d{7,9})|(?:00368|[38]0)\\d{7}",[9,11,12,13,14]],["60[2-9]\\d{6}",[9]],["50\\d{8,9}",[10,11]],0,["1(?:5(?:22|33|44|66|77|88|99)|6(?:[07]0|44|6[0168]|88)|8(?:00|33|55|77|99))\\d{4}",[8]],["15\\d{7,8}",[9,10]],["70\\d{8}",[10]]]],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]],0,0,0,0,0,0,[["2(?:[23]\\d\\d|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7]))\\d{4}",[8]],["(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|1(?:00|11|6[16])|2[26]2|3[36]3|4[46]4|7(?:0[013-9]|[67]\\d)|8[68]8|9(?:[069]\\d|3[039]))|9(?:(?:[04679]\\d|8[057-9])\\d|1(?:00|1[01]|99)|2(?:00|2\\d)|3(?:00|3[03])|5(?:00|5\\d)))\\d{4}",[8]],["18\\d{5}",[7]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345",[["345(?:2(?:22|3[23]|44|66)|333|444|6(?:23|38|40)|7(?:30|4[35-79]|6[6-9]|77)|8(?:00|1[45]|4[89]|88)|9(?:14|4[035-9]))\\d{4}"],["345(?:32[1-9]|4(?:1[2-6]|2[0-4])|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:345976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",[["7(?:1(?:0(?:[23]\\d|4[0-3]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[0-79]|4[0-35-9]|59)|4(?:[24]\\d|3[013-9]|5[1-9]|97)|5(?:2\\d|3[1-9]|4[0-7]|59)|6(?:[2-4]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]|59))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[2-4]\\d|5[139])|4(?:2\\d|3[1-35-9]|59)|5(?:[23]\\d|4[0-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[2379]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59)))\\d{5}",[10]],["7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}",[10]],["8(?:00|108\\d{3})\\d{7}"],["809\\d{7}",[10]],["808\\d{7}",[10]],0,0,0,["751\\d{7}",[10]]],"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[13]|[35-7][14]|41|8[1468])\\d{6}",[8]],["(?:20(?:[23579]\\d|8[78])|30[24]\\d)\\d{6}|30\\d{7}",[9,10]]]],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0",0,0,0,0,0,[["7(?:62|8[0-6]|9[04-9])\\d{4}|(?:[14-69]\\d|2(?:[14-69]\\d|[78][1-9])|7[2-57]|8[02-9])\\d{5}
672"],["(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[7-9]|9[0-4]))\\d{5}"],0,["9[01]\\d{6}",[8]],0,0,0,0,0,["80\\d{6}",[8]]]],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758",[["758(?:234|4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|(?:63|75)8)\\d{4}"],["758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[0-3])|812)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0",0,0,0,[["(?:2(?:01|1[27]|2[024]|3\\d|6[02-578]|96)|3(?:[24]0|33|7[0135-7]|8[048]|9[0269]))\\d{4}",[7]],["(?:6(?:(?:4[5-9]|5\\d)\\d|6(?:[024-68]\\d|1[01]|3[7-9]|70))\\d|7(?:[37-9]\\d|42|56))\\d{4}"],["8002[28]\\d\\d|80(?:05\\d|9)\\d{4}"],["90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d",[7]],0,["697(?:42|56|[78]\\d)\\d{4}",[9]],["870(?:28|87)\\d\\d",[7]]]],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:12[2-9]|602|8[12]\\d|9(?:1\\d|22|9[245]))\\d{6}|(?:11|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}"],["7(?:[0-25-8]\\d|4[0-4])\\d{6}"],0,0,0,0,["1973\\d{5}"]]],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0",0,0,0,0,0,[["2\\d{7}",[8]],["(?:(?:(?:22|33)0|555|7(?:6[01]|7\\d)|88\\d)\\d|4(?:240|[67]))\\d{5}|[56]\\d{6}",[7,9]],0,["332(?:02|[34]\\d)\\d{4}",[9]]]],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]],0,0,0,0,0,0,[["2\\d{7}"],["[56]\\d{7}"],["800[1256]\\d{4}"]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]",0,0,0,[["(?:3[1478]|4[124-6]|52)\\d{6}"],["6\\d{7}"],["80[02]\\d{5}"],["9(?:0[0239]|10)\\d{5}"],["70[05]\\d{5}"],0,["70[67]\\d{5}"],0,["[89]01\\d{5}"],["808\\d{5}"]]],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)",0,0,0,[["(?:35[013-9]|80[2-9]|90[89])\\d{1,8}|(?:2[2-9]|3[0-46-9]|[457]\\d|8[13-9]|9[2-579])\\d{2,9}"],["6(?:[26][18]|5[1568]|7[189]|81|9[128])\\d{6}",[9]],["800\\d{5}",[8]],["90[015]\\d{5}",[8]],0,0,0,0,["20(?:1\\d{5}|[2-689]\\d{1,7})",[4,5,6,7,8,9,10]],["801\\d{5}",[8]]]],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]],0,0,0,0,0,0,[["6\\d{7}"],["2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}"],["80\\d{6}"],["90\\d{6}"],0,0,0,0,0,["81\\d{6}"]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0[56]|[1-6]\\d|7[124579]|8[124])|3(?:1\\d|2[2356])|4(?:[17]\\d|2[1-357]|5[2-4]|8[124])|5(?:[1347]\\d|2[1-469]|5[13-5]|8[1-4])|6(?:[1-479]\\d|5[2-57]|8[1-5])|7(?:[13]\\d|2[13-79])|8(?:[124]\\d|5[124]|84))\\d{6}"],["9[1-6]\\d{7}"]]],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]",[["5(?:(?:18|4[0679]|5[03])\\d|2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-9])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9]))\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0",0,0,0,0,0,[["(?:870|9[2-47-9]\\d)\\d{5}",[8]],["4(?:[46]\\d|5[1-9])\\d{5}|(?:3|[67]\\d)\\d{7}"],["(?:800|90\\d)\\d{5}",[8]]]],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2[1-9]|3[1-79])\\d|5(?:33|5[257]))\\d{5}"],["562\\d{5}|(?:6\\d|7[16-9])\\d{6}"],["800\\d{5}"],["90[056]\\d{5}"],0,0,["803\\d{5}"],0,["3[08]\\d{6}"],["808\\d{5}
672"]]],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:20[2-8]|3(?:[0-2][2-7]|3[24-7])|4(?:0[2-467]|1[2467])|5(?:0[2467]|1[24-7]|2[2-467]))\\d{5}",[8]],["6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}",[8]],["80(?:[0-2578]|9\\d)\\d{5}"],["9(?:4[1568]|5[178])\\d{5}",[8]],0,0,["77[1-9]\\d{5}",[8]],0,["78[1-49]\\d{5}",[8]]]],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1",0,0,[["2072[29]\\d{4}|20(?:2\\d|4[47]|5[3467]|6[279]|7[356]|8[268]|9[2457])\\d{5}"],["3[2-9]\\d{7}"],0,0,0,0,0,0,["22\\d{7}"]]],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1",0,0,0,0,0,[["(?:247|528|625)\\d{4}"],["(?:(?:23|54)5|329|45[35-8])\\d{4}"],0,0,0,0,0,0,["635\\d{4}"]]],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2(?:62|77)0|3444)\\d|4[56]440)\\d{3}|(?:34|4[357])700\\d{3}|(?:2(?:[0-3]\\d|5[0-578]|6[01]|82)|3(?:1[3-68]|[23][2-68]|4[23568])|4(?:[23][2-68]|4[3-68]|5[2568]|6[25-8]|7[24-68]|8[4-68]))\\d{5}"],["7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-478]\\d|6[01])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}"],["800\\d{5}"],["5\\d{7}"],0,0,0,0,0,["8(?:0[1-9]|[1-9]\\d)\\d{5}"]]],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]],0,0,0,0,0,0,[["2(?:07[0-8]|12[67])\\d{4}|(?:2(?:02|1[4-689])|4(?:0[0-4]|4[1-59]))\\d{5}"],["2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[0-3]|[679]\\d|8[2-59])\\d{6}"],["80\\d{6}"]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:(?:12|[28]\\d|3[56]|7[3-6]|9[0-6])\\d|4(?:2[29]|7[0-2]|83)|6)|2(?:2(?:00|8[34])|4(?:0\\d|22|7[0-2]|83)|51\\d\\d)|4(?:2(?:2\\d\\d|48[013])|3(?:20\\d|4(?:70|83)|56)|420\\d|5(?:2\\d|470))|6(?:0(?:[23]|88\\d)|(?:124|[56]2\\d)\\d|2472|3(?:20\\d|470)|4(?:2[04]\\d|472)|7(?:3\\d\\d|4[67]0|8(?:[01459]\\d|8))))\\d{4}|5(?:2(?:2\\d{5,6}|47[02]\\d{4})|(?:3472|4(?:2(?:1|86)|470)|522\\d|6(?:20\\d|483)|7(?:20\\d|48[01])|8(?:20\\d|47[02])|9(?:20\\d|470))\\d{4})|7(?:(?:0470|4(?:25\\d|470)|5(?:202|470|96\\d))\\d{4}|1(?:20\\d{4,5}|4(?:70|83)\\d{4}))|8(?:1(?:2\\d{5,6}|4(?:10|7[01]\\d)\\d{3})|2(?:2\\d{5,6}|(?:320|490\\d)\\d{3})|(?:3(?:2\\d\\d|470)|4[24-7]|5(?:(?:2\\d|51)\\d|4(?:[1-35-9]\\d|4[0-57-9]))|6[23])\\d{4})|(?:1[2-6]\\d|4(?:2[24-8]|3[2-7]|[46][2-6]|5[3-5])|5(?:[27][2-8]|3[2-68]|4[24-8]|5[23]|6[2-4]|8[24-7]|9[2-7])|6(?:[19]20|42[03-6]|(?:52|7[45])\\d)|7(?:[04][24-8]|[15][2-7]|22|3[2-4])|8(?:1[2-689]|2[2-8]|(?:[35]2|64)\\d))\\d{4}|25\\d{5,6}|(?:2[2-9]|6(?:1[2356]|[24][2-6]|3[24-6]|5[2-4]|6[2-8]|7[235-7]|8[245]|9[24])|8(?:3[24]|5[245]))\\d{4}",[6,7,8,9]],["(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6\\d|8[89]|9[4-8])\\d|7(?:3|40|[5-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6])\\d)\\d{4}|9[69]1\\d{6}|9(?:[68]\\d|9[089])\\d{5}",[7,8,9,10]],["80080(?:0[1-9]|2\\d)\\d{3}",[10]],0,0,0,0,0,["1333\\d{4}",[8]]]],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0",0,0,0,0,0,[["[12](?:2[1-3]|(?:3[2-8]|4[2-68]|5[1-4689])\\d)\\d{5,6}|7(?:0(?:[0-5]\\d|7[078]|80)|128)\\d{4}|[12]27\\d{6}|(?:11|2[16]|5[368])\\d{6}"],["(?:87[01]|92[0139])\\d{5}|(?:5[05]|6[069]|7[28]|8[0135689]|9[013-9])\\d{6}",[8]],0,0,0,0,0,0,["712[0-79]\\d{4}|7(?:1[013-9]|[5-79]\\d)\\d{5}",[8]]]],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]],0,0,0,0,0,0,[["(?:28[2-9]|8(?:11|[2-57-9]\\d))\\d{5}",[8]],["6800[0-79]\\d{3}|6(?:[235]\\d\\d|6(?:0[0-5]|[1-9]\\d)|8(?:0[1-9]|[14-8]\\d|2[5-9]|[39][0-4]))\\d{4}",[8]],["0800\\d{3}",[7]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670",[["670(?:2(?:3[3-7]|56|8[4-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:6(?:[03-7]\\d|1[05]|2[7-9]|8[0-39]|9[04-9])|89\\d)|80[6-9]\\d\\d|9(?:477[6-9]|767[4589]))\\d{4}"],["(?:69[67]\\d\\d|7091[0-3])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:397[0-3]|477[0-5]|76(?:6\\d|7[0-367]))\\d{4}"]]],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]],0,0,0,0,0,0,[["(?:25[08]|35\\d|45[1-7])\\d{5}"],["[2-4][0-46-9]\\d{6}"],["800\\d{5}"]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664",[["6644(?:1[0-3]|91)\\d{4}"],["664(?:3(?:49|9[1-6])|49[2-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]],0,0,0,0,0,0,[["20(?:3[1-4]|6[059])\\d{4}|2(?:0[19]|[1-357]\\d|60)\\d{5}"],["(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"],["800(?:02|[3467]\\d)\\d{3}"],["5(?:0(?:0(?:37|43)|(?:6\\d|70|9[0168])\\d)|[12]\\d0[1-5])\\d{3}"],0,0,["501\\d{5}"],["7117\\d{4}"],["3550\\d{4}"]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,[["(?:2(?:[0346-8]\\d|1[0-8])|4(?:[013568]\\d|2[0-24-8]|71|90)|54(?:[3-5]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}",[7,8]],["5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|(?:5(?:2[5-9]|4[3-689]|[57]\\d|8[0-689]|9[0-8])|7(?:0[0-7]|3[013]))\\d{5}",[8]],["802\\d{7}|80[0-2]\\d{4}",[7,10]],["30\\d{5}",[7]],0,0,0,["219\\d{4}",[7]],["3(?:20|9\\d)\\d{4}",[7]]],"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["(?:3(?:0[0-4]|3[0-59])|6(?:[58][024689]|6[024-68]|7[02468]))\\d{4}",[7]],["(?:46[46]|[79]\\d\\d)\\d{4}",[7]],["800\\d{7}",[10]],["900\\d{7}",[10]],0,0,["4(?:0[01]|50)\\d{4}",[7]]],"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-37-9]"],"0$1"]],"0",0,0,0,0,0,[["1[2-9]\\d{5}",[7]],["111\\d{6}|(?:2[12]|31|77|[89][89])\\d{7}",[9]]]],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:0[01]|2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-36-9]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"],["(?:2(?:2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-36-9]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"],["8(?:00|88)\\d{7}"],["900\\d{7}"],["500\\d{7}"],0,0,0,0,["300\\d{7}"]],"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["427[01]\\d{4}|(?:3(?:2[0-36-9]|3[0-368]|4[0-278]|5[0-24-8]|6[0-467]|7[1246-9]|8\\d|9[0-57])\\d|4(?:2[0-689]|[3-79]\\d|8[1-35689])|5(?:2[0-589]|[3468]\\d|5[0-489]|7[1-9]|9[23])|6(?:2[2-9]|3[1357-9]|[46]\\d|5[0-6]|7[0-35-9]|85|9[015-8])|7(?:[2579]\\d|3[03-68]|4[0-8]|6[5-9]|8[0-35-9])|8(?:[24][2-8]|3[2-5]|5[2-7]|6[2-589]|7[2-578]|[89][2-9])|9(?:0[57]|13|[25-7]\\d|[3489][0-8]))\\d{5}",[8,9]],["1(?:(?:1888[689]|4400|8(?:47|8[27])[0-4])\\d{4}|9\\d{7,8})|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d)|7(?:[0-4]\\d|5[0-79]|6[02-4]|8[02-5]))|(?:[26]\\d|[37][1-9]|4[235-9])\\d|5(?:31|9\\d\\d)|8(?:1[23]|[23
6726]\\d|4[06]|5(?:46|[7-9])|7[016-9]|8[01]|9[0-8]))\\d{5}",[9,10]],["1[378]00\\d{6}",[10]],["1600\\d{6}",[10]],0,0,0,0,["15(?:4(?:6[0-4]\\d|8(?:0[125]|[17]\\d|21|3[01]|4[01589]|5[014]|6[02]))|6(?:32[0-6]|78\\d))\\d{4}",[10]]]],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}",[8]],["8(?:[2-79]\\d|80)\\d{6}",[9]],["800\\d{6}",[9]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["64426\\d{3}|6(?:1(?:2[2-7]|3[01378]|4[0-4])|254|32[0237]|4(?:27|41|5[25])|52[236-8]|626|7(?:2[2-4]|30))\\d{4,5}|6(?:1(?:(?:0\\d|2[0189]|3[24-69]|4[5-9])\\d|17|69|7[014])|2(?:17|5[0-36-8]|69|70)|3(?:17|2[14-689]|34|6[289]|7[01]|81)|4(?:17|2[0-2]|4[06]|5[0137]|69|7[01])|5(?:17|2[0459]|69|7[01])|6(?:17|25|38|42|69|7[01])|7(?:17|2[569]|3[13]|6[89]|7[01]))\\d{4}"],["(?:60|8[1245])\\d{7}",[9]],["80\\d{7}",[9]],["8701\\d{5}",[9]],0,0,0,0,["8(?:3\\d\\d|86)\\d{5}"]]],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]],0,0,0,0,0,0,[["(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}"],["(?:[579]\\d|8[0-79])\\d{4}"],["050\\d{3}"],["36\\d{4}"]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]],0,0,0,0,0,0,[["2(?:0(?:20|3[1-8]|4[13-5]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}"],["(?:23|7[0467]|[89]\\d)\\d{6}"],["08\\d{6}"],["09\\d{6}"]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1",0,0,[["(?:1(?:06|17|28|39)|3[0-2]\\d)\\d{3}"],["(?:14|3[58])\\d{4}"]]],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0",0,0,0,0,0,[["20(?:[1259]\\d|3[013-9]|4[1-8]|6[024-689]|7[1-79]|8[2-9])\\d{6}",[10]],["(?:702[0-24-9]|819[01])\\d{6}|(?:7(?:0[13-9]|[12]\\d)|8(?:0[1-9]|1[0-8])|9(?:0[1-9]|1[1-6]))\\d{7}",[10]],["800\\d{7,11}"],0,0,0,["700\\d{7,11}"]]],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]],0,0,0,0,0,0,[["2\\d{7}"],["(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}"],["1800\\d{4}"]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:[035]\\d|1[13-578]|6[124-8]|7[24]|8[0-467])|2(?:[0346]\\d|2[2-46-9]|5[125]|9[479])|3(?:[03568]\\d|1[3-8]|2[01]|4[1-8])|4(?:[0356]\\d|1[1-368]|7[58]|8[15-8]|9[23579])|5(?:[0358]\\d|[19][1-9]|2[1-57-9]|4[13-8]|6[126]|7[0-3578])|7\\d\\d)\\d{6}",[9]],["(?:6[1-58]|970\\d)\\d{7}",[9,11]],["800\\d{4,7}",[7,8,9,10]],["90[069]\\d{4,7}",[7,8,9,10]],0,0,["140(?:1[035]|2[0346]|3[03568]|4[0356]|5[0358]|8[458])|(?:140(?:1[16-8]|2[259]|3[124]|4[17-9]|5[124679]|7)|8[478]\\d{6})\\d",[5,6,9]],["66\\d{7}",[9]],["(?:85|91)\\d{7}",[9]]]],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]",[["(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-46-9]|7[0-8])\\d{6}",[8]],["[49]\\d{7}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}
672",[8]],["81[23]\\d{5}",[8]],["(?:0[235-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0",0,0,0,0,0,[["(?:1[0-6]\\d|99[02-6])\\d{5}|(?:2[13-79]|3[135-8]|4[146-9]|5[135-7]|6[13-9]|7[15-9]|8[1-46-9]|9[1-7])[2-6]\\d{5}",[8]],["9(?:00|6[0-3]|7[0-24-6]|8[0-24-68])\\d{7}",[10]],["1(?:66001|800\\d\\d)\\d{5}",[11]]]],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]],0,0,0,0,0,0,[["444\\d{4}"],["(?:222|55[3-9]|666|777|8\\d\\d|999)\\d{4}"]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]],0,0,0,0,0,0,[["[47]\\d{3}",[4]],["(?:[56]|888[1-9])\\d{3}"]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,[["240\\d{5}|(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}",[8]],["2(?:[0-27-9]\\d|6)\\d{6,7}|2(?:1\\d|75)\\d{5}",[8,9,10]],["508\\d{6,7}|80\\d{6,8}",[8,9,10]],["(?:1[13-57-9]\\d{5}|50(?:0[08]|30|66|77|88))\\d{3}|90\\d{6,8}",[7,8,9,10]],["70\\d{7}",[9]],0,["8(?:1[16-9]|22|3\\d|4[045]|5[459]|6[235-9]|7[0-3579]|90)\\d{2,7}"]],"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]],0,0,0,0,0,0,[["2[1-6]\\d{6}",[8]],["(?:1505|90[1-9]\\d)\\d{4}|(?:7[124-9]|9[1-9])\\d{6}",[8]],["8007\\d{4,5}|(?:500|800[05])\\d{4}"],["900\\d{5}",[8]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:1(?:0\\d|1[0479]|2[37]|3[0137]|4[147]|5[05]|6[058]|7[0167]|8[2358]|9[1389])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[02-9])|3(?:[0147-9]\\d|[25][0-5]|33|6[068])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[0156]|7[0-24-9]|8[4-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}",[7]],["(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}",[7,8]],["800\\d{4,5}|(?:00800|800\\d)\\d{6}"],["(?:8(?:22|55|60|7[78]|86)|9(?:00|81))\\d{4}",[7]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:(?:(?:4[34]|5[14])[0-8]|687)\\d|7(?:173|(?:3[0-8]|55)\\d)|8(?:10[05689]|6(?:0[06-9]|1[6-9]|29)|7(?:0[0569]|[56]0)))\\d{4}|(?:1[0-8]|4[12]|5[236]|6[1-7]|7[246]|8[2-4])\\d{6}",[8]],["9\\d{8}",[9]],["800\\d{5}",[8]],["805\\d{5}",[8]],["80[24]\\d{5}",[8]],0,0,0,0,["801\\d{5}",[8]]],"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["4(?:0[4-689]|9[4-68])\\d{5}",[8]],["8[7-9]\\d{6}",[8]],["80[0-5]\\d{6}",[9]],0,0,0,["44\\d{4}",[6]],0,["499\\d{5}",[8]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,[["(?:(?:3[0-2]|4[257]|5[34]|9[78])\\d|64[1-9]|85[02-46-9])\\d{4}",[7]],["(?:7\\d|8[1-48])\\d{6}",[8]],["180\\d{4}",[7]],0,0,0,0,["27[01]\\d{4}",[7]],["2(?:0[0-57]|7[568])\\d{4}",[7]]],"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0",0,0,0,0,0,[["(?:(?:2[3-8]|3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578])\\d{3}|88(?:22\\d\\d|42))\\d{4}|(?:2|8[2-8]\\d\\d)\\d{5}",[6,8,9,10]],["(?:8(?:1[37]|9[5-8])|9(?:0[5-9]|1[0-24-9]|[235-7]\\d|4[2-9]|8[135-9]|9[1-9]))\\d{7}",[10]],["1800\\d{7,9}",[11,12,13]]]],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:(?:21|42)[2-9]|58[126])\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6,7}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}",[9,10]],["3(?:[0-247]\\d|3[0-79]|55|64)\\d{7}",[10]],["800\\d{5}
672(?:\\d{3})?",[8,11]],["900\\d{5}",[8]],["122\\d{6}",[9]],0,["(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:0[468]|[1-8])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}",[11,12]]]],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:30|47\\d\\d)\\d{5}|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])(?:[02-9]\\d{6}|1(?:[0-8]\\d{5}|9\\d{3}(?:\\d{2})?))",[7,9]],["21(?:1[013-5]|2\\d|3[1-9])\\d{5}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}",[9]],["800\\d{6,7}",[9,10]],["70[01346-8]\\d{6}",[9]],0,0,["804\\d{6}",[9]],["64\\d{4,7}",[6,7,8,9]],["39\\d{7}",[9]],["801\\d{6}",[9]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["80[6-9]\\d{6}|(?:[236-9]\\d|4[1-35-9]|5[0-47-9])\\d{4}"],["708(?:4[0-5]|5[0-6])\\d{4}|(?:[236-9]\\d|4[02-489]|5[02-9])\\d{4}"],["80[0-5]\\d{6}",[9]],["8[129]\\d{7}",[9]]]],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939",[["(?:787|939)[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:22[2-47-9]|42[45]|82[014-68]|92[3569])\\d{5}",[8]],["5[69]\\d{7}",[9]],["1800\\d{6}",[10]],0,0,0,0,0,0,["1700\\d{6}",[10]]]],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]],0,0,0,0,0,0,[["2(?:[12]\\d|3[1-689]|4[1-59]|[57][1-9]|6[1-35689]|8[1-69]|9[1256])\\d{6}"],["6(?:[06]92(?:30|9\\d)|[35]92(?:[049]\\d|3[034]))\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"],["80[02]\\d{6}"],["(?:6(?:0[178]|4[68])\\d|76(?:0[1-57]|1[2-47]|2[237]))\\d{5}"],["884[0-4689]\\d{5}"],["600\\d{6}|6[06]92(?:0\\d|3[349]|49)\\d{3}"],["70(?:38[01]|596|(?:7\\d|8[17])\\d)\\d{4}"],["6(?:222\\d|89(?:00|88|99))\\d{4}"],["30\\d{7}"],["80(?:8\\d|9[1579])\\d{5}"]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:55|77)|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76)|900)\\d{4}"],["(?:(?:46|83)[0-5]|(?:6[2-4689]|78)0)\\d{4}|(?:45|77|88)\\d{5}"]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:3[289]|4[246-8]|61|7[1-3]|8[1-36])\\d{5,7}|(?:2(?:[14-68]\\d|2[4-68]|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51|[67]\\d)|4(?:1\\d|3[12]|5[13]|9[1-47])|5(?:[1-4]\\d|5[02-4])|6(?:3[1-3]|44|7[1-8])|7(?:4[0-4]|5\\d|6[1-
672578]|75|8[0-8])|858)\\d{5,6}",[7,8,9]],["9(?:51|6[129]|7[1-6]|8[1-7]|9[1-5])\\d{6}",[9]],["9800\\d{5,7}",[9,10,11]],0,0,0,["[245]0\\d{6,7}|[36-9]0\\d{4,7}",[6,7,8,9]],0,["8700[0-4]\\d{4}",[9]]]],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]],0,0,0,0,0,0,[["4(?:(?:[014]\\d\\d|999)\\d|2022)\\d{3}",[8]],["[35-7]\\d{7}",[8]],["800\\d{4}|(?:0080[01]|800)\\d{6}",[7,9,11]],0,0,0,0,["2[136]\\d{5}",[7]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,[["[23][13-6]\\d{7}|(?:2(?:19\\d|[3-6]\\d9)|31\\d\\d)\\d\\d"],["(?:630|702)0\\d{5}|(?:6(?:00|2\\d)|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[0-39]))\\d{6}",[9]],["800\\d{6}",[9]],["90[0136]\\d{6}",[9]],0,0,["(?:37\\d|80[578])\\d{6}",[9]],0,0,["801\\d{6}",[9]]],0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0",0,0,0,0,0,[["(?:11[1-9]\\d|(?:2[389]|39)(?:0[2-9]|[2-9]\\d))\\d{3,8}|(?:1[02-9]|2[0-24-7]|3[0-8])[2-9]\\d{4,9}",[7,8,9,10,11,12]],["6(?:[0-689]|7\\d)\\d{6,7}",[8,9,10]],["800\\d{3,9}"],["(?:78\\d|90[0169])\\d{3,7}",[6,7,8,9,10]],0,0,["7[06]\\d{4,10}"]]],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",[["(?:3(?:0[12]|36|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:06|2[23568]\\d)\\d{6}"],["7[237-9]\\d{7}",[9]],["800\\d{6}",[9]],["900\\d{6}",[9]]]],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0",0,0,0,0,0,[["1(?:1\\d|2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}",[9]],["579[0-8]\\d{5}|5(?:[013-689]\\d|7[0-8])\\d{6}",[9]],["800\\d{7}",[10]],["925\\d{6}",[9]],0,0,0,0,0,["920\\d{6}",[9]]]],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]],0,0,0,0,0,0,[["(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}",[5]],["48\\d{3}|(?:(?:6[89]|7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}"],["1[38]\\d{3}",[5]],0,0,0,0,0,["5[12]\\d{3}",[5]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,[["4[2-46]\\d{5}"],["2[125-8]\\d{5}"],["800[08]\\d{3}"],["85\\d{5}"],0,0,0,0,["971\\d{4}|(?:64|95)\\d{5}"]],"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1(?:5\\d|8[35-7])\\d{6}"],["(?:1[0-2]|9[0-3569])\\d{7}"]]],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0",0,0,0,0,0,[["(?:(?:[12][136]|3[356]|4[0246]|6[03]|8\\d)\\d|90[1-9])\\d{4,6}|(?:1(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)|2(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])|3(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])|4(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])|6(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])|9(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8]))\\d{5,6}",[7,8,9]],["7[023689]\\d{7}",[9]],["20\\d{4,7}",[6,7,8,9]],["649\\d{6}|99[1-59]\\d{4}(?:\\d{3})?|9(?:00|39|44)[1-8]\\d{3,6}",[7,8,9,10]],["75[1-8]\\d{6}",[9]],["(?:25[245]|67[3-68])\\d{9}",[12]],["10[1-8]\\d{6}",[9]],["74[02-9]\\d{6}",[9]],0,["77[0-7]\\d{6}",[9]]]],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["662[0-24-9]\\d{4}|6(?:[0-578]\\d|6[013-57-9]|9[0-35-9])\\d{5}",[8]],["80[1-9]\\d{5}|(?:8[1-9]|9[0-8])\\d{6}",[8]],["(?:18|8)00\\d{7}",[10,11]],["1900\\d{7}",[11]],0,0,["7000\\d{7}",[11]],0,["(?:3[12]\\d|666)\\d{5}",[8]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]",[["2(?:[0-57-9]\\d|6[4-9])\\d\\d"],["[56]\\d{4}",[5]],0,0,0,0,0,0,["262\\d\\d",[5]]]],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[013]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:[1-357][2-8]|4[24-8])\\d{6}",[8]],["65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[013]|51|6[489])\\d{6}",[8]],["80\\d{4,6}",[6,7,8]],["89[1-3]\\d{2,5}|90\\d{4,6}"],0,0,0,0,["(?:59\\d\\d|8(?:1(?:[67]\\d|8[0-589])|2(?:0\\d|2[0-37-9]|8[0-2489])|3[389]\\d))\\d{4}",[8]]],"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79",[["79\\d{6}",[8]],["[49]\\d{7}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}
672",[8]],["81[23]\\d{5}",[8]],["(?:0[235-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:16|[2-9]\\d{3})|(?:(?:[3-5][1-8]\\d|819)\\d|601[1-5])\\d)\\d{4}|(?:2|[3-5][1-8])1[67]\\d{3}|[3-5][1-8]16\\d\\d"],["909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}",[9]],["800\\d{6}",[9]],["9(?:00|[78]\\d)\\d{6}",[9]],0,0,["96\\d{7}",[9]],["9090\\d{3}",[7]],["6(?:02|5[0-4]|9[0-6])\\d{6}",[9]],["8[5-9]\\d{7}",[9]]]],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0",0,0,0,0,0,[["22[2-4][2-9]\\d{4}"],["(?:25|3[0-5]|66|7\\d|8[08]|9[09])\\d{6}"]]],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1",0,0,[["0549(?:8[0157-9]|9\\d)\\d{4}",[10]],["6[16]\\d{6}",[8]],0,["7[178]\\d{6}",[8]],0,0,0,0,["5[158]\\d{6}",[8]]]],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]],0,0,0,0,0,0,[["3(?:0(?:1[0-2]|80)|282|3(?:8[1-9]|9[3-9])|611)\\d{5}"],["7(?:[015-8]\\d|21|90)\\d{6}"],["800\\d{6}"],["88[4689]\\d{6}
672"],0,0,0,0,["(?:3(?:392|9[01]\\d)\\d|93(?:3[13]0|929))\\d{4}"],["81[02468]\\d{6}"]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|9[2-9]"]],["(\\d)(\\d{7})","$1 $2",["[267]|904"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[346-9]"]]],"0",0,0,0,0,0,[["(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|5[57-9])\\d{5}|(?:[134]\\d|8[125])\\d{4}",[6,7]],["(?:(?:15|(?:3[59]|4[89]|6\\d|7[0-35-9]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}",[7,8,9]]]],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]],0,0,0,0,0,0,[["(?:2[1-3]|3[0-7]|4\\d|5[2-578])\\d{4}",[6]],["(?:6[08]|7[1-7]|8[1-9])\\d{5}",[7]],["80\\d{5}",[7]],["90\\d{5}",[7]],0,0,0,0,["(?:56|91\\d)\\d{4}"]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1[89]\\d{7}"],["(?:12|9[1257-9])\\d{7}"]]],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]],0,0,0,0,0,0,[["22\\d{5}"],["900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}"]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["2(?:79(?:0[0347-9]|[1-9]\\d)|89(?:0[024589]|[1-9]\\d))\\d{3}|2(?:[1-69]\\d|[78][0-8])\\d{5}",[8]],["[5-7]\\d{7}",[8]],["800\\d{8}|80[01]\\d{4}",[7,11]],["900\\d{4}(?:\\d{4})?",[7,11]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721",[["7215(?:4[2-8]|8[39]|9[056])\\d{4}"],["7215(?:1[02]|2\\d|5[034679]|8[0-24-8])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0",0,0,0,0,0,[["21\\d{6,7}|(?:1(?:[14]\\d|[2356])|2[235]|3(?:[13]\\d|4)|4[134]|5[1-3])\\d{6}"],["(?:50|9[1-9])\\d{7}",[9]]]],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]],0,0,0,0,0,0,[["[23][2-5]\\d{6}",[8]],["7[5-9]\\d{6}",[8]],["0800\\d{4}",[8]],["900\\d{6}",[9]],0,0,0,0,["70\\d{6}",[8]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8",[["8\\d{3}"]]],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649",[["649(?:266|712|9(?:4\\d|50))\\d{4}"],["649(?:2(?:3[129]|4[1-79])|3\\d\\d|4[34][1-3])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,0,0,["649(?:71[01]|966)\\d{4}"]]],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,[["22(?:[37-9]0|5[0-5]|6[89])\\d{4}"],["(?:3[01]|[69]\\d|77|8[5-7])\\d{6}"]],"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]],0,0,0,0,0,0,[["2(?:2[2-7]|3[23]|4[45]|55|6[67]|77)\\d{5}"],["(?:7[0-289]|9[0-36-9])\\d{6}"]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:1[0689]|2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}",[8]],["(?:(?:14|[89]\\d)\\d\\d|6(?:[1-6]\\d\\d|7(?:1[0-8]|2[4-7]|3[1-6])))\\d{5}",[9]],["(?:001800\\d|1800)\\d{6}",[10,13]],["1900\\d{6}",[10]],0,0,0,0,["6[08]\\d{7}",[9]]]],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4}
672)","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,[["(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}"],["(?:33[03-9]|4(?:1[18]|4[02-479])|81[1-9])\\d{6}|(?:[09]\\d|1[0-27-9]|2[0-27]|3[08]|40|5[05]|66|7[0157-9]|8[07-9])\\d{7}"]],"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7],0,0,0,0,0,0,0,[["(?:2[2-4]|[34]\\d)\\d{2,5}"],["7[2-4]\\d{2,5}"]]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]],0,0,0,0,0,0,[["(?:2[1-5]|3[1-9]|4[1-4])\\d{5}",[7]],["7[2-8]\\d{6}",[8]],["80\\d{5}",[7]],["90\\d{5}",[7]],["70\\d{5}",[7]]]],TM:["993","810","[1-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,[["(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}"],["(?:6\\d|7[12])\\d{6}"]],"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]],0,0,0,0,0,0,[["81200\\d{3}|(?:3[0-2]|7\\d)\\d{6}"],["3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-8])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}"],["8010\\d{4}"],["88\\d{6}"],0,0,0,0,0,["8[12]10\\d{4}"]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]],0,0,0,0,0,0,[["(?:2\\d|3[0-8]|4[0-4]|50|6[09]|7[0-24-69]|8[05])\\d{3}",[5]],["(?:5(?:4[0-5]|5[4-6])|6(?:[09]\\d|3[02]|8[15-9])|(?:7\\d|8[46-9])\\d|999)\\d{4}",[7]],["0800\\d{3}",[7]],0,0,0,0,0,["55[0-37-9]\\d{4}",[7]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[0-79]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0",0,0,0,0,0,[["(?:2(?:1[26]|[28][2468]|[3-5][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}",[10]],["561(?:011|61\\d)\\d{4}|5(?:[03-5]\\d|1[06]|24|6[24]|7[245]|9[46])\\d{7}",[10]],["8(?:00\\d{7}(?:\\d{2,3})?|11\\d{7})",[10,12,13]],["(?:8[89]8|900)\\d{7}",[10]],["592(?:21[12]|461)\\d{4}",[10]],0,["444\\d{4}",[7]],["512\\d{7}",[10]],["850\\d{7}",[10]]]],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868",[["868(?:2(?:01|1[5-9]|[23]\\d|4[0-2])|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}"],["868(?:(?:2[5-9]|3\\d)\\d|4(?:3[0-6]|[6-9]\\d)|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}"],["868800\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],["868619\\d{4}"]]],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["2[02-9]\\d{3}",[5]],["(?:7[01]\\d|90)\\d{4}",[6,7]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["(?:2[2-8]\\d|370|55[01]|7[1-9])\\d{6}|4(?:(?:0(?:0[1-9]|[2-48]\\d)|1[023]\\d)\\d{4,5}|(?:[239]\\d\\d|4(?:0[56]|12|49))\\d{5})|6(?:[01]\\d{7}|4(?:0[56]|12|24|4[09])\\d{4,5})|8(?:(?:2(?:3\\d|4[0-269]|[578]0|66)|36[24-9]|90\\d\\d)\\d{4}|4(?:0[56]|12|24|4[09])\\d{4,5})|(?:2(?:2(?:0\\d\\d|4(?:0[68]|[249]0|3[0-467]|5[0-25-9]|6[0235689]))|(?:3(?:[09]\\d|1[0-4])|(?:4\\d|5[0-49]|6[0-29]|7[0-5])\\d)\\d)|(?:(?:3[2-9]|5[2-8]|6[0-35-79]|8[7-9])\\d\\d|4(?:2(?:[089]\\d|7[1-9])|(?:3[0-4]|[78]\\d|9[01])\\d))\\d)\\d{3}",[8,9]],["(?:40001[0-2]|9[0-8]\\d{4})\\d{3}",[9]],["80[0-79]\\d{6}|800\\d{5}",[8,9]],["20(?:[013-9]\\d\\d|2)\\d{4}",[7,9]],["99\\d{7}",[9]],0,["50[0-46-9]\\d{6}
672",[9]],0,["7010(?:[0-2679]\\d|3[0-7]|8[0-5])\\d{5}|70\\d{8}",[10,11]]],0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0",0,0,0,0,0,[["2[2-8]\\d{7}"],["(?:6[1-35-9]|7\\d)\\d{7}"],["80[08]\\d{6}"],["90\\d{7}"],0,0,0,0,["41\\d{7}"],["8(?:40|6[01])\\d{6}"]]],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}",[9]],["790\\d{6}|(?:39|50|6[36-8]|7[1-357]|9[1-9])\\d{7}",[9]],["800[1-8]\\d{5,6}"],["900[239]\\d{5,6}"],0,0,0,0,["89[1-579]\\d{6}",[9]]],"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0",0,0,0,0,0,[["20(?:(?:240|30[67])\\d|6(?:00[0-2]|30[0-4]))\\d{3}|(?:20(?:[017]\\d|2[5-9]|3[1-4]|5[0-4]|6[15-9])|[34]\\d{3})\\d{5}"],["7280\\d{5}|7(?:[014-8]\\d|2[01467]|3[0167]|9[0-589])\\d{6}"],["800[1-3]\\d{5}"],["90[1-3]\\d{6}"]]],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:472[2-47-9]|983[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[02469]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,[["(?:1(?:770|9(?:20|[89]7))|(?:2\\d|4[2-7])\\d\\d)\\d{4}",[8]],["9[1-9]\\d{6}",[8]],["0004\\d{2,9}|(?:405|80[05])\\d{4}",[6,7,8,9,10,11,12,13]],["90[0-8]\\d{4}",[7]],0,0,["21\\d{2,3}",[4,5]]],"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]],0,0,0,0,0,0,[["(?:55\\d\\d|6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|[69]\\d\\d|7(?:[23]\\d|7[69]))|7(?:[168]\\d\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|9(?:22|5[1-9])))\\d{5}"],["(?:(?:[25]0|33|8[078]|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}"]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698",[["06698\\d{1,6}",[6,7,8,9,10,11]],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784",[["784(?:266|3(?:6[6-9]|7\\d|8[0-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}"],["784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4])|720)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,0,0,["78451[0-2]\\d{4}"]]],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:12|3[457-9]|[467]\\d|[58][1-9]|9[1-6])|[4-6]00)\\d{7}"],["4(?:1[24-8]|2[246])\\d{7}"],["800\\d{7}"],["90[01]\\d{7}"],0,0,["501\\d{7}"]]],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284",[["284(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}"],["284(?:245|3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|9[69])|5(?:4[0-7]|68|9[69]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340",[["340(?:2(?:0\\d|10|2[06-8]|4[49]|77)|3(?:32|44)|4(?:2[23]|44|7[34]|89)|5(?:1[34]|55)|6(?:2[56]|4[23]|77|9[023])|7(?:1[2-57-9]|2[57]|7\\d)|884|998)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}",[7,8,9,10],[["(\\d{4})(\\d{4,6})","$1 $2",["1(?:2[02]|[89])"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[26]|6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0",0,0,0,0,0,[["2(?:0[3-9]|1[0-689]|2[0-25-9]|[38][2-9]|4[2-8]|5[124-9]|6[0-39]|7[0-7]|9[0-4679])\\d{7}
672",[10]],["121[0-3]\\d{5}|(?:160|(?:3\\d|7[06-9])\\d|5(?:[1689]\\d|2[238]|59)|8(?:[1-8]\\d|9[6-9])|9(?:[0-8]\\d|9[013-9]))\\d{6}",[9]],["1800\\d{4,6}|12(?:0[13]|28)\\d{4}",[8,9,10]],["1900\\d{4,6}",[8,9,10]],0,0,["[17]99\\d{4}|69\\d{5,6}",[7,8]],0,["672\\d{6}",[9]]]],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]],0,0,0,0,0,0,[["(?:38[0-8]|48[4-9])\\d\\d|(?:2[02-9]|3[4-7]|88)\\d{3}",[5]],["(?:[58]\\d|7[0-7])\\d{5}",[7]],["81[18]\\d\\d",[5]],0,0,0,["(?:3[03]|900\\d)\\d{3}"],0,["9(?:0[1-9]|1[01])\\d{4}",[7]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["72\\d{4}",[6]],["(?:72|8[23])\\d{4}",[6]],["80[0-5]\\d{6}",[9]],0,0,["[48]0\\d{4}",[6]],0,0,["9[23]\\d{4}",[6]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["6[1-9]\\d{3}|(?:[2-5]|60)\\d{4}",[5,6]],["(?:7[1-35-8]|8(?:[3-7]|9\\d{3}))\\d{5}",[7,10]],["800\\d{3}",[6]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0",0,0,0,0,0,[["38\\d{6,10}|(?:2[89]|39)(?:0\\d{5,6}|[1-9]\\d{5})"],["4[3-9]\\d{6}",[8]],["800\\d{5}",[8]],["900\\d{5}",[8]]]],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["78[0-7]\\d{4}|17\\d{6}|(?:[12][2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-6])\\d{5}",[7,8]],["7[01378]\\d{7}",[9]]]],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0330|4302)|52087)0\\d{3}|(?:1[0-8]|2[1-378]|3[1-69]|4\\d|5[1346-8])\\d{7}",[9]],["(?:1(?:3492[0-25]|4495[0235]|549(?:20|5[01]))|4[34]492[01])\\d{3}|8[1-4]\\d{3,7}|(?:2[27]|47|54)4950\\d{3}|(?:1(?:049[2-4]|9[12]\\d\\d)|(?:50[0-2]|[67]\\d\\d)\\d\\d|8(?:5\\d{3}|7(?:08[67]|158|28[5-9]|310)))\\d{4}|(?:1[6-8]|28|3[2-69]|4[025689]|5[36-8])4920\\d{3}|(?:12|[2-5]1)492\\d{4}",[5,6,7,8,9]],["80\\d{7}",[9]],["(?:86[2-9]|9[0-2]\\d)\\d{6}",[9]],0,0,["861\\d{6,7}",[9,10]],0,["87(?:08[0-589]|15[0-79]|28[0-4]|31[1-9])\\d{4}|87(?:[02][0-79]|1[0-46-9]|3[02-9]|[4-9]\\d)\\d{5}",[9]],["860\\d{6}",[9]]]],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0",0,0,0,0,0,[["21[1-8]\\d{6}"],["(?:[59][5-8]|7[5-9])\\d{7}"],["800\\d{6}"],0,0,0,0,0,["63\\d{7}"]]],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:(?:3\\d|9)\\d|[4-8])|2(?:(?:(?
672:0(?:2[014]|5)|(?:2[0157]|31|84|9)\\d\\d|[56](?:[14]\\d\\d|20)|7(?:[089]|2[03]|[35]\\d\\d))\\d|4(?:2\\d\\d|8))\\d|1(?:2|[39]\\d{4}))|3(?:(?:123|(?:29\\d|92)\\d)\\d\\d|7(?:[19]|[56]\\d))|5(?:0|1[2-478]|26|[37]2|4(?:2\\d{3}|83)|5(?:25\\d\\d|[78])|[689]\\d)|6(?:(?:[16-8]21|28|52[013])\\d\\d|[39])|8(?:[1349]28|523)\\d\\d)\\d{3}|(?:4\\d\\d|9[2-9])\\d{4,5}|(?:(?:2(?:(?:(?:0|8[146])\\d|7[1-7])\\d|2(?:[278]\\d|92)|58(?:2\\d|3))|3(?:[26]|9\\d{3})|5(?:4\\d|5)\\d\\d)\\d|6(?:(?:(?:[0-246]|[78]\\d)\\d|37)\\d|5[2-8]))\\d\\d|(?:2(?:[569]\\d|8[2-57-9])|3(?:[013-59]\\d|8[37])|6[89]8)\\d{3}"],["7(?:[1278]\\d|3[1-9]|9[01])\\d{6}",[9]],["80(?:[01]\\d|20|8[0-8])\\d{3}",[7]],0,0,0,0,0,["86(?:1[12]|22|30|44|55|77|8[368])\\d{6}",[10]]]]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function sne(t,e){var n=Array.prototype.slice.call(e);return n.push(sR),t.apply(this,n)}function L4(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),i=0;i<3;i++){var s=Number(n[i]),o=Number(r[i]);if(s>o)return 1;if(o>s)return-1;if(!isNaN(s)&&isNaN(o))return 1;if(isNaN(s)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var one={}.constructor;function Na(t){return t!=null&&t.constructor===one}var ane=/^\d+$/;function lne(t){return ane.test(t)}function tc(t){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tc(t)}function w0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cne(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,dne(r.key),r)}}function S0(t,e,n){return e&&cne(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function dne(t){var e=une(t,"string");return tc(e)=="symbol"?e:e+""}function une(t,e){if(tc(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(tc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var fne="1.2.0",hne="1.7.35",j4=" ext. ",Er=(function(){function t(e){w0(this,t),oR(e),this.metadata=e,lR.call(this,e)}return S0(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(n){return n!=="001"})}},{key:"getCountryMetadata",value:function(n){return this.metadata.countries[n]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(n){return this.getCountryMetadata(n)!==void 0}},{key:"hasCallingCode",value:function(n){if(this.getCountryCodesForCallingCode(n))return!0;
vendor: 5,104 bytes, line 672
672if(this.nonGeographic()){if(this.nonGeographic()[n])return!0}else{var r=this.countryCallingCodes()[n];if(r&&r.length===1&&r[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(n){return this.nonGeographic()?!!this.nonGeographic()[n]:!this.getCountryCodesForCallingCode(n)}},{key:"country",value:function(n){return this.selectNumberingPlan(n)}},{key:"selectNumberingPlan",value:function(n,r){var i,s;if(n&&(lne(n)?s=n:i=n),r&&(s=r),i&&i!=="001"){var o=this.getCountryMetadata(i);if(!o)throw new Error("Unknown country: ".concat(i));this.numberingPlan=new F4(o,this)}else if(s){if(!this.hasCallingCode(s))throw new Error("Unknown calling code: ".concat(s));this.numberingPlan=new F4(this.getNumberingPlanMetadata(s),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(n){var r=this.countryCallingCodes()[n];if(r)return r.length===1&&r[0].length===3?void 0:r}},{key:"getCountryCodeForCallingCode",value:function(n){var r=this.getCountryCodesForCallingCode(n);if(r)return r[0]}},{key:"getNumberingPlanMetadata",value:function(n){var r=this.getCountryCodeForCallingCode(n);if(r)return this.getCountryMetadata(r);if(this.nonGeographic()){var i=this.nonGeographic()[n];if(i)return i}else{var s=this.countryCallingCodes()[n];if(s&&s.length===1&&s[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(n){return this.numberingPlan.type(n)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(n){return this.selectNumberingPlan(n)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])})(),F4=(function(){function t(e,n){w0(this,t),this.globalMetadataObject=n,this.metadata=e,lR.call(this,n.metadata)}return S0(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"_getDefaultCountryMetadataForThisCallingCode",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this._getDefaultCountryMetadataForThisCallingCode()}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(n){return n[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var n=this,r=this._getFormats(this.metadata)||this._getFormats(this._getDefaultCountryMetadataForThisCallingCode())||[];return r.map(function(i){return new pne(i,n)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(n){return n[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}}
vendor: 1,355 bytes, line 672
672,{key:"type",value:function(n){if(this.hasTypes()&&B4(this.types(),n))return new gne(B4(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?j4:this.metadata[13]||j4}}])})(),pne=(function(){function t(e,n){w0(this,t),this._format=e,this.metadata=n}return S0(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!mne.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),mne=/^\(?\$1\)?$/,gne=(function(){function t(e,n){w0(this,t),this.type=e,this.metadata=n}return S0(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.t
vendor: 4,745 bytes, lines 672-673
672ype[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])})();function B4(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function oR(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!Na(t)||!Na(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(Na(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+vne(t)+": "+t,"."))}var vne=function(e){return tc(e)};function aR(t,e){var n=new Er(e);if(n.hasCountry(t))return n.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function bne(t,e){return e.countries.hasOwnProperty(t)}function lR(t){var e=t.version;typeof e=="number"?(this.v1=e===1,this.v2=e===2,this.v3=e===3,this.v4=e===4):e?L4(e,fne)===-1?this.v2=!0:L4(e,hne)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function xu(t,e,n){return yne(t,void 0,e,n)}function yne(t,e,n,r){n&&(r=new Er(r.metadata),r.selectNumberingPlan(n));var i=r.type(e),s=i&&i.possibleLengths()||r.possibleLengths();if(!s)return"IS_POSSIBLE";var o=t.length,a=s[0];return a===o?"IS_POSSIBLE":a>o?"TOO_SHORT":s[s.length-1]<o?"TOO_LONG":s.indexOf(o,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function wne(t,e,n){e===void 0&&(e={});var r=new Er(n);if(e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.country||t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return cR(t.phone||t.nationalNumber,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function cR(t,e){switch(xu(t,void 0,e)){case"IS_POSSIBLE":return!0;default:return!1}}function Ks(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function Sne(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Cne(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
673In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cne(t,e){if(t){if(typeof t=="string")return H4(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H4(t,e):void 0}}function H4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var xne=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function m2(t,e,n){if(e=e||{},!(!t.country&&!t.countryCallingCode)){var r=new Er(n);r.selectNumberingPlan(t.country||t.countryCallingCode);var i=e.v2?t.nationalNumber:t.phone;if(Ks(i,r.nationalNumberPattern())){if(r1(i,"FIXED_LINE",r))return r.type("MOBILE")&&r.type("MOBILE").pattern()===""||!r.type("MOBILE")||r1(i,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var s=Sne(xne),o;!(o=s()).done;){var a=o.value;if(r1(i,a,r))return a}}}}function r1(t,e,n){var r=n.type(e);return!r||!r.pattern()||r.possibleLengths()&&r.possibleLengths().indexOf(t.length)<0?!1:Ks(t,r.pattern())}function $ne(t,e,n){e=e||{};var r=new Er(n);if(r.selectNumberingPlan(t.country||t.countryCallingCode),r.hasTypes())return m2(t,e,r.metadata)!==void 0;var i=e.v2?t.nationalNumber:t.phone;return Ks(i,r.nationalNumberPattern())}var Ene=/^[A-Z]{2}$/;function Tne(t){return Ene.test(t)}function Rne(t,e){var n,r,i=new Er(e);return Tne(t)?(n=t,i.selectNumberingPlan(n),r=i.countryCallingCode()):r=t,{country:n,callingCode:r}}function Ine(t,e,n){var r=new Er(n),i=r.getCountryCodesForCallingCode(t);return i?i.filter(function(s){return Ane(e,s,n)}):[]}function Ane(t,e,n){var r=new Er(n);return r.selectNumberingPlan(e),r.numberingPlan.possibleLengths().indexOf(t.length)>=0}var g2=2,One=17,kne=3,Hr="0-90-9٠-Ù©Û°-Û¹",Nne="-‐-―−ー-",_ne="//",Pne="..",Mne="  ­â€
673‹â ã€€",Dne="()()[]\\[\\]",Lne="~⁓∼~",Xi="".concat(Nne).concat(_ne).concat(Pne).concat(Mne).concat(Dne).concat(Lne),C0="++",jne=new RegExp("(["+Hr+"])");function dR(t,e,n,r){if(e){var i=new Er(r);i.selectNumberingPlan(e||n);var s=new RegExp(i.IDDPrefix());if(t.search(s)===0){t=t.slice(t.match(s)[0].length);var o=t.match(jne);if(!(o&&o[1]!=null&&o[1].length>0&&o[1]==="0"))return t}}}function pb(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var i,s,o=r.length-1,a=o>0&&r[o];if(e.nationalPrefixTransformRule()&&a)i=t.replace(n,e.nationalPrefixTransformRule()),o>1&&(s=r[1]);else{var l=r[0];i=t.slice(l.length),a&&(s=r[1])}var c;if(a){var d=t.indexOf(r[1]),u=t.slice(0,d);u===e.numberingPlan.nationalPrefix()&&(c=e.numberingPlan.nationalPrefix())}else c=r[0];return{nationalNumber:i,nationalPrefix:c,carrierCode:s}}}return{nationalNumber:t}}function Fne(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Bne(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
674In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bne(t,e){if(t){if(typeof t=="string")return z4(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z4(t,e):void 0}}function z4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function uR(t,e,n){for(var r=new Er(n),i=Fne(e),s;!(s=i()).done;){var o=s.value;if(r.selectNumberingPlan(o),r.leadingDigits()){if(t&&t.search(r.leadingDigits())===0)return o}else if(m2({phone:t,country:o},void 0,r.metadata))return o}}function v2(t,e){var n=e.nationalNumber,r=e.metadata,i=r.getCountryCodesForCallingCode(t);if(i)return i.length===1?i[0]:uR(n,i,r.metadata)}function mb(t,e,n){var r=pb(t,n),i=r.carrierCode,s=r.nationalNumber;if(s!==t){if(!Hne(t,s,n))return{nationalNumber:t};if(n.numberingPlan.possibleLengths()&&(e||(e=v2(n.numberingPlan.callingCode(),{nationalNumber:s,metadata:n})),!zne(s,e,n)))return{nationalNumber:t}}return{nationalNumber:s,carrierCode:i}}function Hne(t,e,n){return!(Ks(t,n.nationalNumberPattern())&&!Ks(e,n.nationalNumberPattern()))}function zne(t,e,n){switch(xu(t,e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function fR(t,e,n,r,i){if(!(e||n||r))return{number:t};var s=e||n?aR(e||n,i):r;if(t.indexOf(s)===0){var o=new Er(i);o.selectNumberingPlan(e||n||r);var a=t.slice(s.length),l=mb(a,void 0,o),c=l.nationalNumber,d=mb(t,void 0,o),u=d.nationalNumber;if(!Ks(u,o.nationalNumberPattern())&&Ks(c,o.nationalNumberPattern())||xu(u,void 0,o)==="TOO_LONG")return{countryCallingCode:s,number:a}}return{number:t}}function b2(t,e,n,r,i){if(!t)return{};var s;if(t[0]!=="+"){var o=dR(t,e||n,r,i);if(o&&o!==t)s=!0,t="+"+o;else{if(e||n||r){var a=fR(t,e,n,r,i),l=a.countryCallingCode,c=a.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:c}}return{number:t}}}if(t[1]==="0")return{};for(var d=new Er(i),u=2;u-1<=kne&&u<=t.length;){var f=t.slice(1,u);if(d.hasCallingCode(f))return d.selectNumberingPlan(f),{countryCallingCodeSource:s?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:f,number:t.slice(u)};u++}return{}}function hR(t){return t.replace(new RegExp("[".concat(Xi,"]+"),"g")," ").trim()}var pR=/(\$\d)/;function mR(t,e,n){var r=n.useInternationalFormat,i=n.withNationalPrefix;n.carrierCode,n.metadata;var s=t.replace(new RegExp(e.pattern()),r?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(pR,e.nationalPrefixFormattingRule()):e.format());return r?hR(s):s}var qne=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Une(t,e,n){var r=new Er(n);if(r.selectNumberingPlan(t||e),r.defaultIDDPrefix())return r.defaultIDDPrefix();if(qne.test(r.IDDPrefix()))return r.IDDPrefix()}var Vne=";ext=",dl=function(e){return"([".concat(Hr,"]{1,").concat(e,"})")};function gR(t){var e="20",n="15",r="9",i="6",s="[  \\t,]*",o="[:\\..]?[  \\t,-]*",a="#?",l="(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)",c="(?:[xx##~~]|int|int)",d="[- ]+",u="[  \\t]*",f="(?:,{2}|;)",h=Vne+dl(e),p=s+l+o+dl(e)+a,g=s+c+o+dl(r)+a,v=d+dl(i)+"#",b=u+f+o+dl(n)+a,w=u+"(?:,)+"+o+dl(r)+a;return h+"|"+p+"|"+g+"|"+v+"|"+b+"|"+w}var Wne="["+Hr+"]{"+g2+"}",Gne="["+C0+"]{0,1}(?:["+Xi+"]*["+Hr+"]){3,}["+Xi+Hr+"]*",Kne=new RegExp("^["+C0+"]{0,1}(?:["+Xi+"]*["+Hr+"]){1,2}$","i"),Xne=Gne+"(?:"+gR()+")?",Yne=new RegExp("^"+Wne+"$|^"+Xne+"$","i");function Jne(t){return t.length>=g2&&Yne.test(t)}function Qne(t){return Kne.test(t)}function Zne(t){var e=t.number,n=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}var q4={formatExtension:function(e,n,r){return"".concat(e).concat(r.ext()).concat(n)}};function ere(t,e,n,r){n?n=rre({},q4,n):n=q4;var i=new Er(r);if(t.country&&t.country!=="001"){if(!i.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));i.selectNumberingPlan(t.country)}else if(t.countryCallingCode)i.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var s=i.countryCallingCode(),o=n.v2?t.nationalNumber:t.phone,a;switch(e){case"NATIONAL":return o?(a=fp(o,t.carrierCode,"NATIONAL",i,n),i1(a,t.ext,i,n.formatExtension)):"";case"INTERNATIONAL":return o?(a=fp(o,null,"INTERNATIONAL",i,n),a="+".concat(s," ").concat(a),i1(a,t.ext,i,n.formatExtension)):"+".concat(s);case"E.164":return"+".concat(s).concat(o);case"RFC3966":return Zne({number:"+".concat(s).concat(o),ext:t.ext});case"IDD":if(!n.fromCountry)return;var l=nre(o,t.carrierCode,s,n.fromCountry,i);return l?i1(l,t.ext,i,n.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function fp(t,e,n,r,i){var s=tre(r.formats(),t);return s?mR(t,s,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1),carrierCode:e,metadata:r}):t}function tre(t,e){return ire(t,function(n){if(n.leadingDigitsPatterns().length>0){var r=n.leadingDigitsPatterns()[n.leadingDigitsPatterns().length-1];if(e.search(r)!==0)return!1}return Ks(e,n.pattern())})}function i1(t,e,n,r){return e?r(t,e,n):t}function nre(t,e,n,r,i){var s=aR(r,i.metadata);if(s===n){var o=fp(t,e,"NATIONAL",i);return n==="1"?n+" "+o:o}var a=Une(r,void 0,i.metadata);if(a)return"".concat(a," ").concat(n," ").concat(fp(t,null,"INTERNATIONAL",i))}function rre(){for(var t=1,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(;t<n.length;){if(n[t])for(var i in n[t])n[0][i]=n[t][i];t++}return n[0]}function ire(t,e){for(var n=0;n<t.length;){if(e(t[n]))return t[n];n++}}function Hd(t){"@babel/helpers - typeof";return Hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hd(t)}function U4(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function V4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
vendor: 47,238 bytes, lines 674-684
674e%2?U4(Object(n),!0).forEach(function(r){sre(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U4(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sre(t,e,n){return(e=vR(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ore(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function are(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vR(r.key),r)}}function lre(t,e,n){return e&&are(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function vR(t){var e=cre(t,"string");return Hd(e)=="symbol"?e:e+""}function cre(t,e){if(Hd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var bR=(function(){function t(e,n,r){if(ore(this,t),!e)throw new TypeError("First argument is required");if(typeof e!="string")throw new TypeError("First argument must be a string");if(e[0]==="+"&&!n)throw new TypeError("`metadata` argument not passed");if(Na(n)&&Na(n.countries)){r=n;var i=e;if(!dre.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var s=b2(i,void 0,void 0,void 0,r),o=s.countryCallingCode,a=s.number;if(n=a,e=o,!n)throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if(typeof n!="string")throw new TypeError("`nationalNumber` argument must be a string");oR(r);var l=Rne(e,r),c=l.country,d=l.callingCode;this.country=c,this.countryCallingCode=d,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return lre(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Ine(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return wne(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return $ne(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new Er(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return m2(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return ere(this,n,r?V4(V4({},r),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}])})(),dre=/^\+\d+$/;function gb(t){"@babel/helpers - typeof";return gb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gb(t)}function ure(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}function fre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hre(t,e,n){return e=qd(e),pre(t,y2()?Reflect.construct(e,n||[],qd(t).constructor):e.apply(t,n))}function pre(t,e){if(e&&(gb(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mre(t)}function mre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gre(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zd(t,e)}function vb(t){var e=typeof Map=="function"?new Map:void 0;return vb=function(r){if(r===null||!bre(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return vre(r,arguments,qd(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),zd(i,r)},vb(t)}function vre(t,e,n){if(y2())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&zd(i,n.prototype),i}function y2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y2=function(){return!!t})()}function bre(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function zd(t,e){return zd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},zd(t,e)}function qd(t){return qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qd(t)}var Bs=(function(t){function e(n){var r;return fre(this,e),r=hre(this,e,[n]),Object.setPrototypeOf(r,e.prototype),r.name=r.constructor.name,r}return gre(e,t),ure(e)})(vb(Error)),W4=new RegExp("(?:"+gR()+")$","i");function yre(t){var e=t.search(W4);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(W4),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}function wre(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Sre(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
675In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sre(t,e){if(t){if(typeof t=="string")return G4(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G4(t,e):void 0}}function G4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Cre={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function yR(t){return Cre[t]}function hp(t){for(var e="",n=wre(t.split("")),r;!(r=n()).done;){var i=r.value,s=yR(i);s&&(e+=s)}return e}function xre(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=$re(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
676In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $re(t,e){if(t){if(typeof t=="string")return K4(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K4(t,e):void 0}}function K4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function X4(t){for(var e="",n=xre(t.split("")),r;!(r=n()).done;){var i=r.value;e+=Ere(i,e)||""}return e}function Ere(t,e,n){return t==="+"?e?void 0:"+":yR(t)}var wR="+",Tre="[\\-\\.\\(\\)]?",Y4="(["+Hr+"]|"+Tre+")",Rre="^\\"+wR+Y4+"*["+Hr+"]"+Y4+"*$",Ire=new RegExp(Rre,"g"),bb=Hr,Are="["+bb+"]+((\\-)*["+bb+"])*",Ore="a-zA-Z",kre="["+Ore+"]+((\\-)*["+bb+"])*",Nre="^("+Are+"\\.)*"+kre+"\\.?$",_re=new RegExp(Nre,"g"),J4="tel:",yb=";phone-context=",Pre=";isub=";function Mre(t){var e=t.indexOf(yb);if(e<0)return null;var n=e+yb.length;if(n>=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}function Dre(t){return t===null?!0:t.length===0?!1:Ire.test(t)||_re.test(t)}function Lre(t,e){var n=e.extractFormattedPhoneNumber,r=Mre(t);if(!Dre(r))throw new Bs("NOT_A_NUMBER");var i;if(r===null)i=n(t)||"";else{i="",r.charAt(0)===wR&&(i+=r);var s=t.indexOf(J4),o;s>=0?o=s+J4.length:o=0;var a=t.indexOf(yb);i+=t.substring(o,a)}var l=i.indexOf(Pre);if(l>0&&(i=i.substring(0,l)),i!=="")return i}var jre=250,Fre=new RegExp("["+C0+Hr+"]"),Bre=new RegExp("[^"+Hr+"#]+$");function Hre(t,e,n){e=e||{};var r=new Er(n);if(e.defaultCountry&&!r.hasCountry(e.defaultCountry))throw e.v2?new Bs("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var i=qre(t,e.v2,e.extract),s=i.number,o=i.ext,a=i.error;if(!s){if(e.v2)throw a==="TOO_SHORT"?new Bs("TOO_SHORT"):new Bs("NOT_A_NUMBER");return{}}var l=Vre(s,e.defaultCountry,e.defaultCallingCode,r),c=l.country,d=l.nationalNumber,u=l.countryCallingCode,f=l.countryCallingCodeSource,h=l.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new Bs("INVALID_COUNTRY");return{}}if(!d||d.length<g2){if(e.v2)throw new Bs("TOO_SHORT");return{}}if(d.length>One){if(e.v2)throw new Bs("TOO_LONG");return{}}if(e.v2){var p=new bR(u,d,r.metadata);return c&&(p.country=c),h&&(p.carrierCode=h),o&&(p.ext=o),p.__countryCallingCodeSource=f,p}var g=(e.extended?r.hasSelectedNumberingPlan():c)?Ks(d,r.nationalNumberPattern()):!1;return e.extended?{country:c,countryCallingCode:u,carrierCode:h,valid:g,possible:g?!0:!!(e.extended===!0&&r.possibleLengths()&&cR(d,r)),phone:d,ext:o}:g?Ure(c,d,o):{}}function zre(t,e,n){if(t){if(t.length>jre){if(n)throw new Bs("TOO_LONG");return}if(e===!1)return t;var r=t.search(Fre);if(!(r<0))return t.slice(r).replace(Bre,"")}}function qre(t,e,n){var r=Lre(t,{extractFormattedPhoneNumber:function(o){return zre(o,n,e)}});if(!r)return{};if(!Jne(r))return Qne(r)?{error:"TOO_SHORT"}:{};var i=yre(r);return i.ext?i:{number:r}}function Ure(t,e,n){var r={country:t,phone:e};return n&&(r.ext=n),r}function Vre(t,e,n,r){var i=b2(X4(t),void 0,e,n,r.metadata),s=i.countryCallingCodeSource,o=i.countryCallingCode,a=i.number,l;if(o)r.selectNumberingPlan(o);else if(a&&(e||n))e?(l=e,r.selectNumberingPlan(e),o=r.numberingPlan.callingCode()):(r.selectNumberingPlan(n),o=n);else return{};if(!a)return{countryCallingCodeSource:s,countryCallingCode:o};var c=mb(X4(a),void 0,r),d=c.nationalNumber,u=c.carrierCode,f=v2(o,{nationalNumber:d,metadata:r});return f&&(l=f,f==="001"||r.selectNumberingPlan(l)),{country:l,countryCallingCode:o,countryCallingCodeSource:s,nationalNumber:d,carrierCode:u}}function Ud(t){"@babel/helpers - typeof";return Ud=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ud(t)}function Q4(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Z4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Q4(Object(n),!0).forEach(function(r){Wre(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q4(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Wre(t,e,n){return(e=Gre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gre(t){var e=Kre(t,"string");return Ud(e)=="symbol"?e:e+""}function Kre(t,e){if(Ud(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ud(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xre(t,e,n){return Hre(t,Z4(Z4({},e),{},{v2:!0}),n)}function Vd(t){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vd(t)}function e$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Yre(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?e$(Object(n),!0).forEach(function(r){Jre(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e$(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Jre(t,e,n){return(e=Qre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qre(t){var e=Zre(t,"string");return Vd(e)=="symbol"?e:e+""}function Zre(t,e){if(Vd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eie(t,e){return iie(t)||rie(t,e)||nie(t,e)||tie()}function tie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
677In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nie(t,e){if(t){if(typeof t=="string")return t$(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t$(t,e):void 0}}function t$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function rie(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function iie(t){if(Array.isArray(t))return t}function sie(t){var e=Array.prototype.slice.call(t),n=eie(e,4),r=n[0],i=n[1],s=n[2],o=n[3],a,l,c;if(typeof r=="string")a=r;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")o?(l=s,c=o):(l=void 0,c=s),i&&(l=Yre({defaultCountry:i},l));else if(Na(i))s?(l=i,c=s):c=i;else throw new Error("Invalid second argument: ".concat(i));return{text:a,options:l,metadata:c}}function Wd(t){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wd(t)}function n$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function r$(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?n$(Object(n),!0).forEach(function(r){oie(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):n$(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function oie(t,e,n){return(e=aie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aie(t){var e=lie(t,"string");return Wd(e)=="symbol"?e:e+""}function lie(t,e){if(Wd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cie(t,e,n){e&&e.defaultCountry&&!bne(e.defaultCountry,n)&&(e=r$(r$({},e),{},{defaultCountry:void 0}));try{return Xre(t,e,n)}catch(r){if(!(r instanceof Bs))throw r}}function die(){var t=sie(arguments),e=t.text,n=t.options,r=t.metadata;return cie(e,n,r)}function Gd(t){"@babel/helpers - typeof";return Gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gd(t)}function uie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pie(r.key),r)}}function hie(t,e,n){return e&&fie(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function pie(t){var e=mie(t,"string");return Gd(e)=="symbol"?e:e+""}function mie(t,e){if(Gd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var gie=(function(){function t(e){var n=e.onCountryChange,r=e.onCallingCodeChange;uie(this,t),this.onCountryChange=n,this.onCallingCodeChange=r}return hie(t,[{key:"reset",value:function(n){var r=n.country,i=n.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(r,i)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(n){for(var r=0,i=Object.keys(n);r<i.length;r++){var s=i[r];this[s]=n[s]}}},{key:"initCountryAndCallingCode",value:function(n,r){this.setCountry(n),this.setCallingCode(r)}},{key:"setCountry",value:function(n){this.country=n,this.onCountryChange(n)}},{key:"setCallingCode",value:function(n){this.callingCode=n,this.onCallingCodeChange(n,this.country)}},{key:"startInternationalNumber",value:function(n,r){this.international=!0,this.initCountryAndCallingCode(n,r)}},{key:"appendDigits",value:function(n){this.digits+=n}},{key:"appendNationalSignificantNumberDigits",value:function(n){this.nationalSignificantNumber+=n}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])})();function vie(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=bie(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
678In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bie(t,e){if(t){if(typeof t=="string")return i$(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i$(t,e):void 0}}function i$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Di="x",s1=new RegExp(Di);function Uf(t,e){if(e<1)return"";for(var n="";e>1;)e&1&&(n+=t),e>>=1,t+=t;return n+t}function s$(t,e){return t[e]===")"&&e++,yie(t.slice(0,e))}function yie(t){for(var e=[],n=0;n<t.length;)t[n]==="("?e.push(n):t[n]===")"&&e.pop(),n++;var r=0,i="";e.push(t.length);for(var s=0,o=e;s<o.length;s++){var a=o[s];i+=t.slice(r,a),r=a+1}return i}function wie(t,e,n){for(var r=vie(n.split("")),i;!(i=r()).done;){var s=i.value;if(t.slice(e+1).search(s1)<0)return;e=t.search(s1),t=t.replace(s1,s)}return[t,e]}function Sie(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix,o=new RegExp("^(?:".concat(e.pattern(),")$"));if(o.test(t.nationalSignificantNumber))return xie(t,e,{metadata:r,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:s})}function Cie(t,e){return xu(t,void 0,e)==="IS_POSSIBLE"}function xie(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix;if(t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode,i(e)){var o=o$(t,e,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:s,metadata:r});if(o)return o}return o$(t,e,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:s,metadata:r})}function o$(t,e,n){var r=n.metadata,i=n.useNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix,o=mR(t.nationalSignificantNumber,e,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:i,metadata:r});if(i||(t.nationalPrefix?o=t.nationalPrefix+s(e)+o:t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(o=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+o)),$ie(o,t))return o}function $ie(t,e){return hp(t)===e.getNationalDigits()}function Kd(t){"@babel/helpers - typeof";return Kd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kd(t)}function Eie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Iie(r.key),r)}}function Rie(t,e,n){return e&&Tie(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Iie(t){var e=Aie(t,"string");return Kd(e)=="symbol"?e:e+""}function Aie(t,e){if(Kd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Oie=(function(){function t(){Eie(this,t)}return Rie(t,[{key:"parse",value:function(n){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(n),this.context.length!==1)throw new Error("Non-finalized contexts left when pattern parse ended");var r=this.context[0],i=r.branches,s=r.instructions;if(i)return{op:"|",args:i.concat([o1(s)])};if(s.length===0)throw new Error("Pattern is required");return s.length===1?s[0]:s}},{key:"startContext",value:function(n){this.context.push(n)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(n){if(!n)throw new Error("Pattern is required");var r=n.match(_ie);if(!r){if(Nie.test(n))throw new Error("Illegal characters found in a pattern: ".concat(n));this.getContext().instructions=this.getContext().instructions.concat(n.split(""));return}var i=r[1],s=n.slice(0,r.index),o=n.slice(r.index+i.length);switch(i){case"(?:":s&&this.parsePattern(s),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(s&&this.parsePattern(s),this.getContext().instructions.length===0)throw new Error('No instructions found after "|" operator in an "or" group');var a=this.getContext(),l=a.branches;l.push(o1(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:l});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(s&&this.parsePattern(s),!this.getContext().branches)if(this.context.length===1)this.getContext().branches=[];else throw new Error('"branches" not found in an "or" group context');this.getContext().branches.push(o1(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":s&&this.parsePattern(s),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:kie(s)});break;default:throw new Error("Unknown operator: ".concat(i))}o&&this.parsePattern(o)}}])})();function kie(t){for(var e=[],n=0;n<t.length;){if(t[n]==="-"){if(n===0||n===t.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(t));for(var r=t[n-1].charCodeAt(0)+1,i=t[n+1].charCodeAt(0)-1,s=r;s<=i;)e.push(String.fromCharCode(s)),s++}else e.push(t[n]);n++}return e}var Nie=/[\(\)\[\]\?\:\|]/,_ie=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function o1(t){return t.length===1?t[0]:t}function a$(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Pie(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
679In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pie(t,e){if(t){if(typeof t=="string")return l$(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l$(t,e):void 0}}function l$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Xd(t){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xd(t)}function Mie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Die(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jie(r.key),r)}}function Lie(t,e,n){return e&&Die(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function jie(t){var e=Fie(t,"string");return Xd(e)=="symbol"?e:e+""}function Fie(t,e){if(Xd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Xd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Bie=(function(){function t(e){Mie(this,t),this.matchTree=new Oie().parse(e)}return Lie(t,[{key:"match",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.allowOverflow;if(!n)throw new Error("String is required");var s=wb(n.split(""),this.matchTree,!0);if(s&&s.match&&delete s.matchedChars,!(s&&s.overflow&&!i))return s}}])})();function wb(t,e,n){if(typeof e=="string"){var r=t.join("");return e.indexOf(r)===0?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:r.indexOf(e)===0?n&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var i=t.slice(),s=0;s<e.length;){var o=e[s],a=wb(i,o,n&&s===e.length-1);if(a){if(a.overflow)return a;if(a.match){if(i=i.slice(a.matchedChars.length),i.length===0)return s===e.length-1?{match:!0,matchedChars:t}:{partialMatch:!0}}else{if(a.partialMatch)return{partialMatch:!0};throw new Error(`Unsupported match result:
680`.concat(JSON.stringify(a,null,2)))}}else return;s++}return n?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-i.length)}}switch(e.op){case"|":for(var l,c=a$(e.args),d;!(d=c()).done;){var u=d.value,f=wb(t,u,n);if(f){if(f.overflow)return f;if(f.match)return{match:!0,matchedChars:f.matchedChars};if(f.partialMatch)l=!0;else throw new Error(`Unsupported match result:
681`.concat(JSON.stringify(f,null,2)))}}return l?{partialMatch:!0}:void 0;case"[]":for(var h=a$(e.args),p;!(p=h()).done;){var g=p.value;if(t[0]===g)return t.length===1?{match:!0,matchedChars:t}:n?{overflow:!0}:{match:!0,matchedChars:[g]}}return;default:throw new Error("Unsupported instruction tree: ".concat(e))}}function Yd(t){"@babel/helpers - typeof";return Yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yd(t)}function c$(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Hie(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
682In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hie(t,e){if(t){if(typeof t=="string")return d$(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d$(t,e):void 0}}function d$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function zie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vie(r.key),r)}}function Uie(t,e,n){return e&&qie(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Vie(t){var e=Wie(t,"string");return Yd(e)=="symbol"?e:e+""}function Wie(t,e){if(Yd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Yd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Sb="9",Gie=15,Kie=Uf(Sb,Gie),Xie=/[- ]/,Yie=function(){return/\[([^\[\]])*\]/g},Jie=function(){return/\d(?=[^,}][^,}])/g},Qie=new RegExp("["+Xi+"]*\\$1["+Xi+"]*(\\$\\d["+Xi+"]*)*$"),u$=3,Zie=(function(){function t(e){e.state;var n=e.metadata;zie(this,t),this.metadata=n,this.resetFormat()}return Uie(t,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(n,r){this.resetFormat(),n?(this.isNANP=n.callingCode()==="1",this.matchingFormats=n.formats(),r.nationalSignificantNumber&&this.narrowDownMatchingFormats(r)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(n,r){var i=this;if(Cie(r.nationalSignificantNumber,this.metadata))for(var s=c$(this.matchingFormats),o;!(o=s()).done;){var a=o.value,l=Sie(r,a,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(d){return i.shouldTryNationalPrefixFormattingRule(d,{international:r.international,nationalPrefix:r.nationalPrefix})},getSeparatorAfterNationalPrefix:function(d){return i.getSeparatorAfterNationalPrefix(d)}});if(l)return this.resetFormat(),this.chosenFormat=a,this.setNationalNumberTemplate(l.replace(/\d/g,Di),r),this.populatedNationalNumberTemplate=l,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(Di),l}return this.formatNationalNumberWithNextDigits(n,r)}},{key:"formatNationalNumberWithNextDigits",value:function(n,r){var i=this.chosenFormat,s=this.chooseFormat(r);if(s)return s===i?this.formatNextNationalNumberDigits(n):this.formatNextNationalNumberDigits(r.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(n){var r=this,i=n.nationalSignificantNumber,s=n.nationalPrefix,o=n.international,a=i,l=a.length-u$;l<0&&(l=0),this.matchingFormats=this.matchingFormats.filter(function(c){return r.formatSuits(c,o,s)&&r.formatMatches(c,a,l)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:"formatSuits",value:function(n,r,i){return!(i&&!n.usesNationalPrefix()&&!n.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!r&&!i&&n.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(n,r,i){var s=n.leadingDigitsPatterns().length;if(s===0)return!0;i=Math.min(i,s-1);var o=n.leadingDigitsPatterns()[i];if(r.length<u$)try{return new Bie(o).match(r,{allowOverflow:!0})!==void 0}catch{return!0}return new RegExp("^(".concat(o,")")).test(r)}},{key:"getFormatFormat",value:function(n,r){return r?n.internationalFormat():n.format()}},{key:"chooseFormat",value:function(n){for(var r=this,i=function(){var c=a.value;return r.chosenFormat===c?0:Qie.test(r.getFormatFormat(c,n.international))?r.createTemplateForFormat(c,n)?(r.chosenFormat=c,0):(r.matchingFormats=r.matchingFormats.filter(function(d){return d!==c}),1):1},s,o=c$(this.matchingFormats.slice()),a;!(a=o()).done&&(s=i(),s!==0););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(n,r){if(!(n.pattern().indexOf("|")>=0)){var i=this.getTemplateForFormat(n,r);if(i)return this.setNationalNumberTemplate(i,r),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(n){return this.isNANP||n&&n.nationalPrefixFormattingRule()&&Xie.test(n.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(n,r){var i=n.IDDPrefix,s=n.missingPlus;return i?r&&r.spacing===!1?i:i+" ":s?"":"+"}},{key:"getTemplate",value:function(n){if(this.template){for(var r=-1,i=0,s=n.international?this.getInternationalPrefixBeforeCountryCallingCode(n,{spacing:!1}):"";i<s.length+n.getDigitsWithoutInternationalPrefix().length;)r=this.template.indexOf(Di,r+1),i++;return s$(this.template,r+1)}}},{key:"setNationalNumberTemplate",value:function(n,r){this.nationalNumberTemplate=n,this.populatedNationalNumberTemplate=n,this.populatedNationalNumberTemplatePosition=-1,r.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(r).replace(/[\d\+]/g,Di)+Uf(Di,r.callingCode.length)+" "+n:this.template=n}},{key:"getTemplateForFormat",value:function(n,r){var i=r.nationalSignificantNumber,s=r.international,o=r.nationalPrefix,a=r.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,l=n.pattern();l=l.replace(Yie(),"\\d").replace(Jie(),"\\d");var c=Kie.match(l)[0];if(!(i.length>c.length)){var d=new RegExp("^"+l+"$"),u=i.replace(/\d/g,Sb);d.test(u)&&(c=u);var f=this.getFormatFormat(n,s),h;if(this.shouldTryNationalPrefixFormattingRule(n,{international:s,nationalPrefix:o})){var p=f.replace(pR,n.nationalPrefixFormattingRule());if(hp(n.nationalPrefixFormattingRule())===(o||"")+hp("$1")&&(f=p,h=!0,o))for(var g=o.length;g>0;)f=f.replace(/\d/,Di),g--}var v=c.replace(new RegExp(l),f).replace(new RegExp(Sb,"g"),Di);return h||(a?v=Uf(Di,a.length)+" "+v:o&&(v=Uf(Di,o.length)+this.getSeparatorAfterNationalPrefix(n)+v)),s&&(v=hR(v)),v}}},{key:"formatNextNationalNumberDigits",value:function(n){var r=wie(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,n);if(!r){this.resetFormat();return}return this.populatedNationalNumberTemplate=r[0],this.populatedNationalNumberTemplatePosition=r[1],s$(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(n,r){var i=r.international,s=r.nationalPrefix;if(n.nationalPrefixFormattingRule()){var o=n.usesNationalPrefix();if(o&&s||!o&&!i)return!0}}}])})();function Jd(t){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jd(t)}function SR(t,e){return rse(t)||nse(t,e)||tse(t,e)||ese()}function ese(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
683In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tse(t,e){if(t){if(typeof t=="string")return f$(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f$(t,e):void 0}}function f$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function nse(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function rse(t){if(Array.isArray(t))return t}function ise(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sse(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ase(r.key),r)}}function ose(t,e,n){return e&&sse(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ase(t){var e=lse(t,"string");return Jd(e)=="symbol"?e:e+""}function lse(t,e){if(Jd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Jd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var cse="["+Xi+Hr+"]+",dse=new RegExp("^"+cse+"$","i"),use="(?:["+C0+"]["+Xi+Hr+"]*|["+Xi+Hr+"]+)",fse=new RegExp("[^"+Xi+Hr+"]+.*$"),hse=/[^\d\[\]]/,pse=(function(){function t(e){var n=e.defaultCountry,r=e.defaultCallingCode,i=e.metadata,s=e.onNationalSignificantNumberChange;ise(this,t),this.defaultCountry=n,this.defaultCallingCode=r,this.metadata=i,this.onNationalSignificantNumberChange=s}return ose(t,[{key:"input",value:function(n,r){var i=vse(n),s=SR(i,2),o=s[0],a=s[1],l=hp(o),c;return a&&(r.digits||(r.startInternationalNumber(void 0,void 0),l||(c=!0))),l&&this.inputDigits(l,r),{digits:l,justLeadingPlus:c}}},{key:"inputDigits",value:function(n,r){var i=r.digits,s=i.length<3&&i.length+n.length>=3;if(r.appendDigits(n),s&&this.extractIddPrefix(r),this.isWaitingForCountryCallingCode(r)){if(!this.extractCountryCallingCode(r))return}else r.appendNationalSignificantNumberDigits(n);r.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(r.getNationalDigits(),function(o){return r.update(o)})}},{key:"isWaitingForCountryCallingCode",value:function(n){var r=n.international,i=n.callingCode;return r&&!i}},{key:"extractCountryCallingCode",value:function(n){var r=b2("+"+n.getDigitsWithoutInternationalPrefix(),n.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=r.countryCallingCode,s=r.number;if(i)return n.setCallingCode(i),n.update({nationalSignificantNumber:s}),!0}},{key:"reset",value:function(n){if(n){this.hasSelectedNumberingPlan=!0;var r=n._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=r&&hse.test(r)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(n,r){if(this.hasSelectedNumberingPlan){var i=pb(n,this.metadata),s=i.nationalPrefix,o=i.nationalNumber,a=i.carrierCode;if(o!==n)return this.onExtractedNationalNumber(s,a,o,n,r),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(n,r,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(n,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var s=pb(n,this.metadata),o=s.nationalPrefix,a=s.nationalNumber,l=s.carrierCode;if(a!==r)return this.onExtractedNationalNumber(o,l,a,n,i),!0}}},{key:"onExtractedNationalNumber",value:function(n,r,i,s,o){var a=!1,l,c=s.lastIndexOf(i);if(c<0||c!==s.length-i.length)a=!0;else{var d=s.slice(0,c);d&&d!==n&&(l=d)}o({nationalPrefix:n,carrierCode:r,nationalSignificantNumber:i,nationalSignificantNumberIsModified:a,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:l}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(n){if(this.extractAnotherNationalSignificantNumber(n.getNationalDigits(),n.nationalSignificantNumber,function(r){return n.update(r)}))return!0;if(this.extractIddPrefix(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0;if(this.fixMissingPlus(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0}},{key:"extractIddPrefix",value:function(n){var r=n.international,i=n.IDDPrefix,s=n.digits;if(n.nationalSignificantNumber,!(r||i)){var o=dR(s,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(o!==void 0&&o!==s)return n.update({IDDPrefix:s.slice(0,s.length-o.length)}),this.startInternationalNumber(n,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(n){if(!n.international){var r=fR(n.digits,n.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=r.countryCallingCode;if(i)return n.update({missingPlus:!0}),this.startInternationalNumber(n,{country:n.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(n,r){var i=r.country,s=r.callingCode;n.startInternationalNumber(i,s),n.nationalSignificantNumber&&(n.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(n){this.extractCountryCallingCode(n)&&this.extractNationalSignificantNumber(n.getNationalDigits(),function(r){return n.update(r)})}}])})();function mse(t){var e=t.search(use);if(!(e<0)){t=t.slice(e);var n;return t[0]==="+"&&(n=!0,t=t.slice(1)),t=t.replace(fse,""),n&&(t="+"+t),t}}function gse(t){var e=mse(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function vse(t){var e=gse(t),n=SR(e,2),r=n[0],i=n[1];return dse.test(r)||(r=""),[r,i]}function Qd(t){"@babel/helpers - typeof";return Qd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qd(t)}function bse(t,e){return Cse(t)||Sse(t,e)||wse(t,e)||yse()}function yse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
684In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wse(t,e){if(t){if(typeof t=="string")return h$(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h$(t,e):void 0}}function h$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Sse(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function Cse(t){if(Array.isArray(t))return t}function xse(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $se(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Tse(r.key),r)}}function Ese(t,e,n){return e&&$se(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Tse(t){var e=Rse(t,"string");return Qd(e)=="symbol"?e:e+""}function Rse(t,e){if(Qd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var CR=(function(){function t(e,n){xse(this,t),this.metadata=new Er(n);var r=this.getCountryAndCallingCode(e),i=bse(r,2),s=i[0],o=i[1];this.defaultCountry=s,this.defaultCallingCode=o,this.reset()}return Ese(t,[{key:"getCountryAndCallingCode",value:function(n){var r,i;return n&&(Na(n)?(r=n.defaultCountry,i=n.defaultCallingCode):r=n),r&&!this.metadata.hasCountry(r)&&(r=void 0),[r,i]}},{key:"input",value:function(n){var r=this.parser.input(n,this.state),i=r.digits,s=r.justLeadingPlus;if(s)this.formattedOutput="+";else if(i){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var o;if(this.metadata.hasSelectedNumberingPlan()&&(o=this.formatter.format(i,this.state)),o===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var a=this.state.getNationalDigits();a&&(o=this.formatter.format(a,this.state))}this.formattedOutput=o?this.getFullNumber(o):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var n=this;return this.state=new gie({onCountryChange:function(i){n.country=i},onCallingCodeChange:function(i,s){n.metadata.selectNumberingPlan(s||i),n.formatter.reset(n.metadata.numberingPlan,n.state),n.parser.reset(n.metadata.numberingPlan)}}),this.formatter=new Zie({state:this.state,metadata:this.metadata}),this.parser=new pse({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){n.determineTheCountryIfNeeded(),n.formatter.reset(n.metadata.numberingPlan,n.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var n=this.state.digits;if(n)return this._getCountry()}},{key:"_getCountry",value:function(){var n=this.state.country;return n}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(n){var r=this;if(this.isInternational()){var i=function(a){return r.formatter.getInternationalPrefixBeforeCountryCallingCode(r.state,{spacing:!!a})+a},s=this.state.callingCode;return i(s?n?"".concat(s," ").concat(n):s:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return n}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var n=this.state,r=n.nationalSignificantNumber,i=n.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,s=n.nationalPrefix,o=r,a=i||s;return a&&(o=a+o),o}},{key:"getNonFormattedNumber",value:function(){var n=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(n?this.state.getNationalDigits():this.getNon
684FormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var n=this.getNonFormattedNumber();if(n)return n.replace(/[\+\d]/g,Di)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var n=this.state.callingCode,r=this.metadata.getCountryCodesForCallingCode(n);return r&&r.length>1}},{key:"determineTheCountry",value:function(){var n=v2(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});n!==this.state.country&&(this.state.setCountry(n),n&&this.metadata.selectNumberingPlan(n))}},{key:"getNumberValue",value:function(){var n=this.state,r=n.digits,i=n.callingCode,s=n.country,o=n.nationalSignificantNumber;if(r){if(this.isInternational())return i?"+"+i+o:"+"+r;if(s||i){var a=s?this.metadata.countryCallingCode():i;return"+"+a+o}}}},{key:"getNumber",value:function(){var n=this.state,r=n.nationalSignificantNumber,i=n.carrierCode,s=n.callingCode;if(r){var o=this._getCountry();if(!(!o&&!s)){if(o&&o===this.defaultCountry){var a=this.metadata.numberingPlan.callingCode(),l=Ise(a,r,this.metadata);l&&(o=l)}var c=new bR(o||s,r,this.metadata.metadata);return i&&(c.carrierCode=i),c}}}},{key:"isPossible",value:function(){var n=this.getNumber();return n?n.isPossible():!1}},{key:"isValid",value:function(){var n=this.getNumber();return n?n.isValid():!1}},{key:"validateLength",value:function(){var n=this.state,r=n.digits,i=n.nationalSignificantNumber;if(!r)return"NOT_A_NUMBER";if(!this.metadata.numberingPlan)return"INVALID_COUNTRY";if(!i)return"TOO_SHORT";var s=xu(i,void 0,this.metadata);if(s!=="IS_POSSIBLE")return s}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])})();function Ise(t,e,n){var r=n.getCountryCodesForCallingCode(t);if(r.length>1)return uR(e,r,n.metadata)}function Ase(){return sne(die,arguments)}function pp(t){return CR.call(this,t,sR)}pp.prototype=Object.create(CR.prototype,{});pp.prototype.constructor=pp;const xR=()=>{try{const t=[typeof Intl<"u"?Intl.DateTimeFormat().resolvedOptions().locale:"",...typeof navigator<"u"?[navigator.language,...navigator.languages||[]]:[],"en-US"].filter(Boolean);for(const e of t)try{const n=new Intl.Locale(e).maximize().region;if(n)return n}catch{}}catch{}return"US"},mp=t=>new pp(xR()).input(t),$R=t=>{const e=Ase(t.trim(),xR());return e!=null&&e.isValid()?{e164:e.number,valid:!0}:{e164:"",valid:!1}};function Ose(t){const[e,n]=m.useState(null),{connectAndRegister:r,connectStatus:i,sessionManager:s,sessions:o}=tne(),a=async()=>{try{const A=await In(),{data:$}=await A.getCallCreds();n($)}catch{}},[l,c]=m.useState(),[d,u]=m.useState(null),[f,h]=m.useState(t.defaultToNumber?mp(t.defaultToNumber):null),[p,g]=m.useState(null),[v,b]=m.useState(!1),w=async()=>{var A;try{const $=await In(),{data:E}=await $.appNumbersListNumbers();c(E),u(((A=E[0])==null?void 0:A.number)||null)}catch{}};m.useEffect(()=>{a(),w()},[]),m.useEffect(()=>{e&&r({username:e.username,password:e.password})},[e]);const C=Object.keys(o??{}).at(-1),x=o[C??""],[R,O]=m.useState();m.useEffect(()=>{if(!x){O(void 0);return}O(x.state),b(!1);const A=$=>{O($),$===yr.Established&&t.setHangup({hangup:()=>s==null?void 0:s.hangup(x)})};return x.stateChange.addListener(A),()=>x.stateChange.removeListener(A)},[x]);const T=async()=>{if(!s||!f)return;const{e164:A,valid:$}=$R(f);if(!$){g("Enter a valid phone number, including country code.");return}g(null),b(!0);try{await s.call(`sip:outbound-from-${d}-outbound-to-${A}@${p2}`)}catch{g("Could not start the call. Please try again."),b(!1)}},_=(A=>{switch(A){case yr.Established:return{color:"bg-black",bg:"bg-black",text:"text-white",label:"Connected",pulse:!0};case yr.Establishing:return{color:"bg-black",bg:"bg-black/10",text:"text-black",label:"Connecting...",bounce:!0};case yr.Terminating:return{color:"bg-black",bg:"bg-black/10",text:"text-black",label:"Ending...",bounce:!0};case yr.Terminated:return{color:"bg-black/40",bg:"bg-black/5",text:"text-black/60",label:"Ended"};default:return{color:"bg-black",bg:"transparent",text:"text-black/60",label:"Ready to call",pulse:!0}}})(R);return N.jsxs("div",{className:"flex flex-col gap-5",children:[N.jsxs("div",{className:"space-y-2",children:[N.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-black",children:[N.jsx(J_,{size:16,className:"text-black/40"}),"From Number"]}),N.jsx(Ua,{loading:l===void 0,className:"w-full",placeholder:l===void 0?"Loading...":"Select your number",value:d,onChange:u,size:"large",options:l==null?void 0:l.map(A=>({value:A.number,label:N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(Al,{size:14,className:"text-black/40"}),N.jsx("span",{className:"font-medium",children:A.friendlyName||A.number}),N.jsx("span",{className:"text-black/40 text-xs",children:A.number})]})}))})]}),N.jsxs("div",{className:"space-y-2",children:[N.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-black",children:[N.jsx(Qb,{size:16,className:"text-black/40"}),"To Number"]}),N.jsx(Va,{value:f||"",onChange:A=>{h(mp(A.target.value)),p&&g(null)},status:p?"error":void 0,placeholder:"+1 (555) 000-0000",size:"large",className:"border-black focus:border-black",prefix:N.jsx(Al,{size:16,className:"text-black/40"})}),p&&N.jsx("p",{className:"mt-1.5 text-xs text-red-600",children:p})]}),N.jsxs("div",{className:"relative border border-black bg-white p-6",children:[N.jsx("div",{className:"flex items-center justify-center mb-4",children:N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{className:`w-2 h-2 ${_.color} ${_.pulse?"animate-pulse":""} ${_.bounce?"animate-bounce":""}`}),N.jsx("span",{className:`text-xs ${_.text}`,children:_.label})]})}),N.jsxs("div",{className:"relative h-24 mb-6",children:[N.jsx("div",{className:"absolute inset-0",children:N.jsx(D4,{barColor:"#000000",active:R===yr.Established,fadeEdges:!1,height:96,barWidth:3,barGap:2,processing:!R||R!==yr.Established,stream:x?s==null?void 0:s.getRemoteMediaStream(
684x):void 0})}),N.jsx("div",{className:"absolute inset-0 opacity-60",children:N.jsx(D4,{barGap:2,barColor:"#666666",active:R===yr.Established,fadeEdges:!1,height:96,barWidth:2,processing:!R||R!==yr.Established,stream:x?s==null?void 0:s.getLocalMediaStream(x):void 0})})]}),N.jsx("div",{className:"flex justify-center",children:R===yr.Established?N.jsx(Ki,{danger:!0,type:"primary",size:"large",onClick:()=>s==null?void 0:s.hangup(x),className:"h-14 px-8 bg-black text-white border-black hover:bg-black/80",icon:N.jsx(vP,{size:20}),children:N.jsx("span",{className:"ml-2 text-base font-semibold",children:"End Call"})}):N.jsx(Ki,{size:"large",onClick:T,disabled:i!==Oa.CONNECTED||!d||!f||v||R===yr.Establishing,className:"h-14 px-8 bg-black text-white border-black hover:bg-black/80 disabled:opacity-50 disabled:cursor-not-allowed",icon:v||R===yr.Establishing?N.jsx(Lm,{size:20,className:"animate-spin"}):N.jsx(Al,{size:20}),children:N.jsx("span",{className:"ml-2 text-base font-semibold",children:v||R===yr.Establishing?"Connecting...":"Start Call"})})}),i!==Oa.CONNECTED&&N.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 text-xs text-black bg-black/5 border border-black px-3 py-2",children:[N.jsx(Lm,{size:12,className:"animate-spin"}),"Initializing connection..."]}),R===yr.Establishing&&N.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 text-xs text-black bg-black/5 border border-black px-3 py-2",children:[N.jsx(Lm,{size:12,className:"animate-spin"}),"Initializing call..."]})]}),N.jsx("div",{className:"text-center text-xs text-black/40",children:"Calls are routed through your SIP provider for high-quality voice"})]})}function kse({open:t,onClose:e,defaultPhoneNumber:n,defaultType:r,lockedBotId:i}){var R;const[s,o]=m.useState(i?"ai":r??"direct"),[a,l]=m.useState(n??""),[c,d]=m.useState(),[u,f]=m.useState(i??null),[h,p]=m.useState(!1),[g,v]=m.useState(null),[b,w]=m.useState(null);m.useEffect(()=>{t&&(o(i?"ai":r??"direct"),l(mp(n??"")),f(i??null),v(null),w(null))},[t,n,r,i]),m.useEffect(()=>{!t||i||c||(async()=>{var O;try{const T=await In(),{data:S}=await T.appAgentsList();d(S),u||f(((O=S[0])==null?void 0:O.id)??null)}catch{d([]),v("Couldn't load agents. Please try again.")}})()},[t,i,c]);const C=async()=>{var S,_;if(!u)return;const{e164:O,valid:T}=$R(a);if(!T){v("Enter a valid phone number, including country code.");return}v(null),p(!0);try{await(await In()).appAgentsOutboundCalls({},{botId:u,phoneNumber:O}),w(O)}catch(A){const $=((_=(S=A==null?void 0:A.response)==null?void 0:S.data)==null?void 0:_.error)||(A==null?void 0:A.message)||"Could not start the call. Please try again.";v($)}p(!1)},x=((R=c==null?void 0:c.find(O=>O.id===u))==null?void 0:R.name)||"The AI agent";return N.jsxs(Ni,{open:t,onCancel:e,footer:null,closable:!1,width:480,styles:{body:{padding:0},mask:{backdropFilter:"blur(4px)"}},className:"start-call-modal",children:[N.jsx("style",{children:`
685        .start-call-modal { margin-top: 0px !important; top: 20px !important; }
686        @media (max-width: 768px) {
687          .start-call-modal {
688            margin-top: 10px !important;
689            max-width: calc(100vw - 20px) !important;
690          }
691        }
692        .start-call-modal .ant-modal-content {
693          border-radius: 0 !important;
694          border: 1px solid black !important;
695          box-shadow: none !important;
696        }
697        .start-call-modal .ant-segmented {
698          border-radius: 0 !important;
699          border: 1px solid black;
700          padding: 3px;
701          background: #fff;
702        }
703        .start-call-modal .ant-segmented .ant-segmented-item-selected,
704        .start-call-modal .ant-segmented .ant-segmented-thumb {
705          border-radius: 0 !important;
706          background: #000 !important;
707          color: #fff !important;
708        }
709        .start-call-modal .ant-segmented .ant-segmented-item-selected .ant-segmented-item-label {
710          color: #fff !important;
711        }
712        .start-call-modal .ant-segmented .ant-segmented-item-label {
713          min-height: 32px;
714          line-height: 32px;
715        }
716        .start-call-modal video,
717        .start-call-modal audio {
718          position: absolute;
719          width: 0 !important;
720          height: 0 !important;
721          opacity: 0 !important;
722          pointer-events: none;
723          overflow: hidden;
724        }
725      `}),N.jsxs("div",{className:"bg-white",children:[N.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-black",children:[N.jsxs("div",{className:"flex items-center gap-3",children:[N.jsx("div",{className:"w-10 h-10 border border-black bg-black flex items-center justify-center text-white",children:N.jsx(yP,{size:20})}),N.jsxs("div",{children:[N.jsx("h3",{className:"text-lg font-bold text-black",children:"New Call"}),N.jsx("p",{className:"text-xs text-black/60",children:"Outbound voice call"})]})]}),N.jsx("button",{onClick:e,className:"w-8 h-8 flex items-center justify-center text-black/40 hover:text-black hover:bg-black/5 cursor-pointer",children:N.jsx(Ap,{size:18})})]}),N.jsxs("div",{className:"p-6 space-y-4",children:[!i&&N.jsx(Eee,{block:!0,value:s,onChange:O=>o(O),options:[{label:"Direct (you talk)",value:"direct"},{label:"AI Handled",value:"ai"}]}),s==="direct"?N.jsx(nne,{options:{domain:p2,webSocketServer:ine},children:N.jsx(Ose,{setHangup:()=>{},onClose:e,defaultToNumber:n})}):b?N.jsxs("div",{className:"flex flex-col items-center text-center py-4",children:[N.jsx("div",{className:"w-12 h-12 border border-black bg-black flex items-center justify-center text-white mb-4",children:N.jsx(tP,{size:24})}),N.jsx("h4",{className:"text-base font-bold text-black",children:"Call started"}),N.jsxs("p",{className:"text-sm text-black/60 mt-1",children:[x," is calling"," ",N.jsx("span",{className:"font-medium text-black",children:b})," now."]}),N.jsx(Ki,{type:"primary",onClick:e,className:"mt-5 h-11 px-8 bg-black text-white border-black hover:bg-black/80",children:"Done"})]}):N.jsxs(N.Fragment,{children:[!i&&N.jsxs("div",{children:[N.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-black mb-2",children:[N.jsx(_6,{size:16,className:"text-black/40"}),"Handling Agent"]}),N.jsx(Ua,{loading:c===void 0,className:"w-full",size:"large",placeholder:c===void 0?"Loading...":"Select an agent",value:u,onChange:f,options:c==null?void 0:c.map(O=>({value:O.id,label:O.name||"Untitled agent"}))})]}),N.jsxs("div",{children:[N.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-black mb-2",children:[N.jsx(Qb,{size:16,className:"text-black/40"}),"Phone Number"]}),N.jsx(Va,{type:"tel",placeholder:"+1 (123) 456-7890",value:a,onChange:O=>{l(mp(O.target.value)),g&&v(null)},status:g?"error":void 0,size:"large",className:"border-black focus:border-black"}),g&&N.jsx("p",{className:"mt-1.5 text-xs text-red-600",children:g})]}),N.jsxs("div",{className:"flex gap-3 pt-2",children:[N.jsx(Ki,{onClick:e,className:"flex-1 h-11 border-black text-black hover:bg-black/5",children:"Cancel"}),N.jsx(Ki,{type:"primary",onClick:C,loading:h,disabled:!a||!u,className:"flex-1 h-11 bg-black text-white border-black hover:bg-black/80 disabled:opacity-50",children:h?"Calling...":"Start Call"})]})]})]})]})]})}const ER=m.createContext(void 0);
725function nde({children:t}){const[e,n]=m.useState(null),r=s=>{n(s)},i=()=>{n(null)};return N.jsx(ER.Provider,{value:{activeTakeOver:e,startTakeOver:r,endTakeOver:i},children:t})}function Nse(){const t=m.useContext(ER);if(t===void 0)throw new Error("useTakeOver must be used within a TakeOverProvider");return t}function _se({url:t,barWidth:e=3,barGap:n=2,height:r=48}){const i=m.useRef(null),s=m.useRef(null),o=m.useRef(null),a=m.useRef(0),l=m.useRef(0),[c,d]=m.useState(!1),[u,f]=m.useState(0),[h,p]=m.useState(0),[g,v]=m.useState(null),[b,w]=m.useState({x:0,y:0}),[C,x]=m.useState(!1),R=m.useCallback(E=>{const I=[];for(let D=0;D<E;D++){const B=Math.sin(D*.3)*.3+.5,j=Math.sin(D*.7)*.2+Math.sin(D*1.3)*.15,z=Math.max(.1,Math.min(1,B+j));I.push(z)}return I},[]),O=m.useRef([]),T=E=>{if(!isFinite(E)||E<0)return"0:00";const I=Math.floor(E/60),D=Math.floor(E%60);return`${I}:${D.toString().padStart(2,"0")}`},S=()=>{o.current&&(c?o.current.pause():o.current.play().catch(E=>{x(!0)}))},_=E=>{if(!o.current||!i.current)return;const I=i.current.getBoundingClientRect(),D=E-I.left,j=Math.max(0,Math.min(1,D/I.width))*h;o.current.currentTime=j,f(j)};m.useEffect(()=>{const E=i.current,I=s.current;if(!E||!I)return;const D=new ResizeObserver(()=>{const B=I.getBoundingClientRect(),j=window.devicePixelRatio||1;E.width=B.width*j,E.height=r*j,E.style.width=`${B.width}px`,E.style.height=`${r}px`;const z=E.getContext("2d");z&&z.scale(j,j);const q=e+n,ne=Math.floor(B.width/q);O.current=R(ne),l.current=B.width});return D.observe(I),()=>D.disconnect()},[e,n,r,R]),m.useEffect(()=>{const E=i.current;if(!E)return;const I=E.getContext("2d");if(!I)return;const D=()=>{const B=E.getBoundingClientRect(),j=window.devicePixelRatio||1,z=B.width,q=r;I.clearRect(0,0,z*j,q*j);const ne=e+n,Z=Math.floor(z/ne),J=q/2,de=h>0?u/h:0;O.current.length===0&&(O.current=R(Z));for(let X=0;X<Z;X++){const V=O.current[X]||.1,te=X*ne,ie=Math.max(4,V*q*.8),ce=J-ie/2,ve=X/Z<=de;g!==null&&Math.abs(X-g)<=2&&!c?(I.fillStyle="#161c3c",I.globalAlpha=.9):ve?(I.fillStyle="#161c3c",I.globalAlpha=.85+V*.15):(I.fillStyle="#cbd5e1",I.globalAlpha=1),I.fillRect(te,ce,e,ie)}I.globalAlpha=1,a.current=requestAnimationFrame(D)};return D(),()=>{a.current&&cancelAnimationFrame(a.current)}},[u,h,c,g,e,n,r,R]),m.useEffect(()=>{const E=o.current;if(!E)return;const I=()=>f(E.currentTime),D=()=>p(E.duration),B=()=>d(!0),j=()=>d(!1),z=()=>{d(!1),f(0)},q=()=>{x(!0),d(!1)};return E.addEventListener("timeupdate",I),E.addEventListener("loadedmetadata",D),E.addEventListener("play",B),E.addEventListener("pause",j),E.addEventListener("ended",z),E.addEventListener("error",q),()=>{E.removeEventListener("timeupdate",I),E.removeEventListener("loadedmetadata",D),E.removeEventListener("play",B),E.removeEventListener("pause",j),E.removeEventListener("ended",z),E.removeEventListener("error",q)}},[t]);const A=E=>{if(!s.current)return;const I=s.current.getBoundingClientRect(),D=E.clientX-I.left,B=e+n,j=Math.floor(D/B);v(j),w({x:E.clientX,y:E.clientY})},$=()=>{v(null)};return N.jsxs("div",{className:"rounded-xl border border-[#f3f4f6] bg-[#f9fafb] p-3",children:[N.jsx("audio",{ref:o,src:t,preload:"metadata"}),N.jsxs("div",{className:"flex items-center gap-3",children:[N.jsx("button",{onClick:S,className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-[#161c3c] text-white hover:bg-[#161c3c]/90",children:c?N.jsx("div",{className:"h-3 w-3 bg-white"}):N.jsx(D6,{size:16,fill:"white",className:"ml-0.5"})}),N.jsx("div",{ref:s,className:"flex-1 cursor-pointer",onClick:E=>_(E.nativeEvent.clientX),onMouseMove:A,onMouseLeave:$,children:N.jsx("canvas",{ref:i,className:"w-full",style:{height:`${r}px`}})}),N.jsxs("div",{className:"min-w-[80px] flex-shrink-0 text-right text-xs font-medium text-[#9ca3af]",children:[N.jsx("span",{className:"text-[#161c3c]",children:T(u)}),N.jsx("span",{className:"mx-1",children:"/"}),N.jsx("span",{children:T(h)})]})]}),C&&N.jsx("div",{className:"mt-2 text-xs text-[#b91c1c]",children:"Couldn't load this recording. It may not be available yet — try again shortly, or open on another device."}),g!==null&&!c&&N.jsx("div",{className:"pointer-events-none fixed z-50 rounded-md bg-[#161c3c] px-2 py-1 text-xs text-white",style:{left:`${b.x}px`,top:`${b.y-32}px`,transform:"translateX(-50%)"},children:T(g/(O.current.length||1)*h)})]})}const Pse=t=>
725{if(!t)return"0m";const e=Math.floor(t/60),n=t%60;return`${e}m ${n.toString().padStart(2,"0")}s`};function Mse({date:t}){return N.jsxs("div",{className:"flex items-center gap-3 py-2",children:[N.jsx("span",{className:"h-px flex-1 bg-[#f3f4f6]"}),N.jsx("span",{className:"rounded-full bg-[#f3f4f6] px-3 py-1 text-[11px] font-medium text-[#6b7280]",children:ms(t).isSame(ms(),"day")?"Today":ms(t).format("MMM D, YYYY")}),N.jsx("span",{className:"h-px flex-1 bg-[#f3f4f6]"})]})}const Dse=t=>t&&t.charAt(0).toUpperCase()+t.slice(1);function TR({direction:t,channel:e,time:n,status:r,children:i}){const s=t==="OUT",o=e==="EMAIL"?"/icons/chat/tab-email.svg":"/icons/chat/sms.svg";return N.jsxs("div",{className:`flex flex-col gap-1 ${s?"items-end":"items-start"}`,children:[N.jsx("div",{className:`max-w-[448px] px-6 py-3 text-sm leading-5 text-[#161c3c] [overflow-wrap:anywhere] ${s?"rounded-tl-[20px] rounded-tr-[20px] rounded-bl-[20px] bg-[#eff5ff]":"rounded-tl-[20px] rounded-tr-[20px] rounded-br-[20px] bg-[#f3f4f6]"}`,children:i}),N.jsxs("div",{className:`flex items-center gap-1 text-[10px] leading-4 text-[#9ca3af] ${s?"pr-1":"pl-1"}`,children:[N.jsx("img",{src:o,alt:"",className:"size-3"}),N.jsx("span",{children:e}),N.jsx("img",{src:"/icons/chat/dot.svg",alt:"",className:"size-2.5"}),N.jsx("span",{children:n}),r&&N.jsxs(N.Fragment,{children:[N.jsx("img",{src:"/icons/chat/dot.svg",alt:"",className:"size-2.5"}),N.jsx("span",{children:r})]})]})]})}function Lse({item:t,direction:e}){return N.jsx(TR,{direction:e,channel:"SMS",time:ms(t.createdAt).format("HH:mm"),status:Dse(t.sms.status)||void 0,children:N.jsx("p",{className:"whitespace-pre-wrap",children:t.sms.content||"No message content"})})}const jse=280,mf=30;function Fse({item:t,direction:e}){const[n,r]=m.useState(!1),i=t.email.content||"No email content",s=i.length>jse;return N.jsxs(TR,{direction:e,channel:"EMAIL",time:ms(t.createdAt).format("HH:mm"),children:[N.jsx("p",{className:"font-semibold",children:t.email.subject||"No subject"}),N.jsx("p",{className:`mt-1 whitespace-pre-wrap ${s&&!n?"line-clamp-6":""}`,children:i}),s&&N.jsx("button",{type:"button",onClick:()=>r(o=>!o),className:"mt-1 text-xs font-semibold text-[#6b7280] underline underline-offset-2 hover:text-[#161c3c]","aria-expanded":n,children:n?"Show less":"Show more"}),t.email.attachments&&t.email.attachments.length>0&&N.jsxs("div",{className:"mt-3 flex items-center gap-2 border-t border-[#dbeafe] pt-2 text-xs text-[#6b7280]",children:[N.jsx(uP,{size:13,"aria-hidden":"true"}),t.email.attachments.length," ",t.email.attachments.length===1?"attachment":"attachments"]})]})}function Bse({item:t,autoOpen:e=!1}){var g;const[n,r]=m.useState(e),[i,s]=m.useState(!1),[o,a]=m.useState(),[l,c]=m.useState(""),d=async()=>{if(!(o||!t.call.id))try{s(!0),c("");const b=await(await In()).appChatsGet({},{id:t.call.id});a(b.data)}catch{c("The transcript could not be loaded. Try again.")}finally{s(!1)}};m.useEffect(()=>{if(!e||o||!t.call.id)return;let v=!1;return(async()=>{try{s(!0),c("");const w=await(await In()).appChatsGet({},{id:t.call.id});v||a(w.data)}catch{v||c("The transcript could not be loaded. Try again.")}finally{v||s(!1)}})(),()=>{v=!0}},[e,o,t.call.id]);const u=async()=>{const v=!n;r(v),v&&await d()},f=((g=o==null?void 0:o.data)==null?void 0:g.Message)||[],h=t.call.status==="IN_PROGRESS",p=h?"Live":t.call.status==="TRANSFERING"?"Escalating":"Completed";return N.jsxs("div",{className:"flex flex-col items-start gap-1",children:[N.jsxs("div",{className:"w-full max-w-[520px] overflow-hidden rounded-2xl border border-[#f3f4f6] bg-white",children:[N.jsxs("div",{className:"flex gap-3 p-4",children:[N.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-[#eff5ff] text-[#161c3c]",children:N.jsx(Al,{size:18,"aria-hidden":"true"})}),N.jsxs("div",{className:"min-w-0 flex-1",children:[N.jsxs("div",{className:"flex items-start justify-between gap-2",children:[N.jsxs("div",{children:[N.jsx("div",{className:"text-sm font-semibold text-[#161c3c]",children:t.call.callDirection==="OUTGOING"?"Outgoing call":"Incoming call"}),N.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-1.5 text-xs text-[#9ca3af]",children:[N.jsx("span",{children:Pse(t.call.durationSeconds)}),N.jsx("span",{"aria-hidden":"true",children:"·"}),N.jsx("span",{children:B6(t.call)?"Human handled":"AI handled"})]})]}),N.jsx("span",{className:`shrink-0 rounded-full px-2 py-1 text-[10px] font-medium leading-none ${h?"bg-[#fee2e2] text-[#b91c1c]":"bg-[#f3f4f6] text-[#6b7280]"}`,children:p})]}),N.jsx("p",{className:"mt-2 text-sm leading-5 text-[#64748b]",children:t.call.summary||"No AI summary is available for this call."}),N.jsxs("button",{type:"button",onClick:u,className:"mt-2 inline-flex items-center gap-1 text-xs font-semibold text-[#7fafff] hover:text-[#5b8def]","aria-expanded":n,children:[n?"Hide transcript":"View transcript",N.jsx(P6,{size:14,className:`transition-transform ${n?"rotate-90":""}`,"aria-hidden":"true"})]})]})]}),n&&N.jsxs("div",{className:"max-h-80 overflow-y-auto border-t border-[#f3f4f6] px-4 py-4",children:[(o==null?void 0:o.recordingUrl)&&N.jsxs("div",{className:"mb-4",children:[N.jsx("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wide text-[#9ca3af]",children:"Recording"}),N.jsx(_se,{url:o.recordingUrl})]}),i?N.jsxs("div",{className:"space-y-3 animate-pulse",children:[N.jsx("div",{className:"h-3 w-2/3 rounded bg-[#f3f4f6]"}),N.jsx("div",{className:"h-3 w-5/6 rounded bg-[#f3f4f6]"}
725),N.jsx("div",{className:"h-3 w-1/2 rounded bg-[#f3f4f6]"})]}):l?N.jsx("p",{role:"alert",className:"text-sm text-[#161c3c]",children:l}):f.length>0?N.jsx("div",{className:"space-y-4",children:f.map((v,b)=>N.jsxs("div",{className:"grid grid-cols-[64px_1fr] gap-3 text-sm",children:[N.jsx("span",{className:"text-[10px] font-semibold uppercase leading-5 tracking-wide text-[#9ca3af]",children:v.author==="USER"?"Caller":v.author==="BOT"?"AI":"System"}),N.jsx("p",{className:"whitespace-pre-wrap leading-5 text-[#161c3c]",children:v.content||"—"})]},v.id||b))}):t.call.rawTranscript?N.jsx("p",{className:"whitespace-pre-wrap text-sm leading-5 text-[#161c3c]",children:t.call.rawTranscript}):N.jsx("p",{className:"text-sm text-[#9ca3af]",children:"No transcript is available for this call."})]})]}),N.jsxs("span",{className:"flex items-center gap-1 pl-1 text-[10px] leading-4 text-[#9ca3af]",children:[N.jsx(Al,{size:11,"aria-hidden":"true"}),"Call",N.jsx("img",{src:"/icons/chat/dot.svg",alt:"",className:"size-2.5"}),ms(t.createdAt).format("HH:mm")]})]})}function Hse({item:t,contact:e,onDeleteNote:n,focusCallId:r}){if(t.type==="NOTE")return N.jsx(zse,{item:t,onDeleteNote:n});const i=HP(t,e);return t.type==="SMS"?N.jsx(Lse,{item:t,direction:i}):t.type==="EMAIL"?N.jsx(Fse,{item:t,direction:i}):N.jsx(Bse,{item:t,autoOpen:!!(r&&t.call.id===r)})}function zse({item:t,onDeleteNote:e}){const{note:n}=t;return N.jsxs("div",{className:"flex flex-col items-end gap-1",children:[N.jsxs("div",{className:"group max-w-[448px] rounded-tl-[20px] rounded-tr-[20px] rounded-bl-[20px] border border-[#fff1b9] bg-[#fefcee] px-5 py-3",children:[N.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[N.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-[#b45309]",children:["Internal note",n.author?` · ${n.author}`:""]}),n.id&&N.jsx("button",{type:"button",onClick:()=>void e(n.id),className:"text-[#d6b25f] opacity-0 transition-opacity hover:text-[#b45309] focus-visible:opacity-100 group-hover:opacity-100","aria-label":"Delete note",title:"Delete note",children:N.jsx(L6,{size:12,"aria-hidden":"true"})})]}),N.jsx("p",{className:"whitespace-pre-wrap text-sm leading-5 text-[#161c3c]",children:n.content})]}),N.jsx("span",{className:"pr-1 text-[10px] leading-4 text-[#9ca3af]",children:n.createdAt?ms(n.createdAt).format("HH:mm"):""})]})}function qse({call:t,contact:e}){const{activeTakeOver:n,startTakeOver:r}=Nse(),i=!!n,[s,o]=m.useState(!1);return N.jsxs("section",{className:"border-b border-black bg-black px-4 py-4 text-white",children:[N.jsxs("div",{className:"flex flex-col justify-between gap-4 sm:flex-row sm:items-center",children:[N.jsxs("div",{className:"min-w-0",children:[N.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold",children:[N.jsx(EP,{size:15,className:"animate-pulse motion-reduce:animate-none","aria-hidden":"true"}),"LIVE CALL · ESCALATED BY AI"]}),N.jsx("p",{className:"mt-2 max-w-2xl truncate text-sm text-white/75",children:t.summary||"This call requires human attention. Review the live context before taking over."})]}),N.jsxs("div",{className:"flex flex-shrink-0 gap-2",children:[N.jsxs("button",{type:"button",onClick:()=>o(!0),className:"inline-flex h-10 items-center gap-2 border border-white px-3 text-sm font-medium text-white hover:bg-white/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",children:[N.jsx(M6,{size:16,"aria-hidden":"true"}),"Listen"]}),N.jsxs("button",{type:"button",disabled:i||!t.callSid,onClick:()=>r({callSid:t.callSid||"",phoneNumber:t.phoneNumber||e.phone||"",callerName:pd(e)}),className:"inline-flex h-10 items-center gap-2 border border-white bg-white px-3 text-sm font-semibold text-black hover:bg-white/85 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white disabled:cursor-not-allowed disabled:opacity-50",children:[N.jsx(mP,{size:16,"aria-hidden":"true"}),i?"Takeover active":"Take over"]})]})]}),N.jsx(mte,{open:s,onClose:()=>o(!1),call:t,botName:"AI agent"})]})}function Use({contact:t,focusCallId:e,deepLinkError:n,onBack:r,onShowContact:i,onAddContactNote:s,notes:o,onDeleteNote:a,onSendSms:l,onSendEmail:c,senders:d,suggestedSender:u,readOnly:f=!1}){const[h,p]=m.useState(!1),g=m.useMemo(()=>
725{if(!t)return[];const _=q6(t,f?[]:o);return f?_.filter(A=>A.type==="CALL"||A.type==="SMS"||A.type==="EMAIL"):_},[t,o,f]),v=m.useRef(null),b=m.useRef(null),w=m.useRef(0),[C,x]=m.useState(mf),R=C<g.length,O=m.useMemo(()=>g.slice(Math.max(0,g.length-C)),[g,C]);m.useEffect(()=>{let _=mf;if(e){const $=g.findIndex(E=>E.type==="CALL"&&E.call.id===e);$>=0&&(_=Math.max(mf,g.length-$+2))}x(_);const A=v.current;A&&(A.scrollTop=A.scrollHeight)},[t==null?void 0:t.id,e,g]),m.useEffect(()=>{const _=v.current,A=b.current;if(!_||!A||!R)return;const $=new IntersectionObserver(E=>{var I;(I=E[0])!=null&&I.isIntersecting&&(w.current=_.scrollHeight,x(D=>D+mf))},{root:_,rootMargin:"160px"});return $.observe(A),()=>$.disconnect()},[R,C]),m.useEffect(()=>{const _=v.current,A=w.current;!_||!A||(_.scrollTop+=_.scrollHeight-A,w.current=0)},[C]);const T=m.useMemo(()=>{var _;return(_=t==null?void 0:t.chatLog)==null?void 0:_.find(z6)},[t]);if(!t)return N.jsx("div",{className:"flex h-full w-full items-center justify-center bg-white px-6",children:N.jsxs("div",{className:"text-center",children:[N.jsx("div",{className:"mx-auto mb-4 flex size-14 items-center justify-center rounded-xl bg-[#f3f4f6] text-[#64748b]",children:N.jsx(cP,{size:24,"aria-hidden":"true"})}),N.jsx("h2",{className:"text-base font-semibold text-[#161c3c]",children:n?"Conversation not found":"Select a contact"}),N.jsx("p",{className:"mt-2 max-w-64 text-sm leading-6 text-[#9ca3af]",children:n||"Choose a conversation to review its complete history."})]})});let S="";return N.jsxs("section",{"aria-label":`${pd(t)} communication history`,className:"flex h-full min-h-0 w-full flex-1 flex-col bg-white",children:[!f&&N.jsxs("header",{className:"flex items-center justify-between gap-4 p-6",children:[N.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[N.jsx("button",{type:"button",onClick:r,className:"inline-flex size-9 flex-shrink-0 items-center justify-center rounded-lg text-[#64748b] hover:bg-[#f3f4f6] lg:hidden","aria-label":"Back to Inbox",children:N.jsx(K_,{size:18,"aria-hidden":"true"})}),N.jsxs("div",{className:"min-w-0",children:[N.jsx("p",{className:"text-xs leading-4 text-[#9ca3af]",children:"Chat with"}),N.jsx("h2",{className:"truncate text-[20px] font-semibold leading-7 text-[#161c3c]",children:pd(t)})]})]}),N.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2",children:[t.phone&&N.jsxs("button",{type:"button",onClick:()=>p(!0),className:"inline-flex items-center gap-2 rounded-xl bg-[#161c3c] px-6 py-2 text-sm font-semibold text-white hover:bg-[#161c3c]/90",children:[N.jsx(Al,{size:15,"aria-hidden":"true"}),"Call"]}),N.jsx("button",{type:"button",onClick:i,className:"inline-flex size-9 items-center justify-center rounded-lg text-[#64748b] hover:bg-[#f3f4f6] xl:hidden","aria-label":"Contact details",children:N.jsx(oP,{size:18,"aria-hidden":"true"})})]})]}),T&&N.jsx(qse,{call:T,contact:t}),N.jsx("div",{ref:v,className:"min-h-0 flex-1 overflow-y-auto px-6 py-2",children:g.length===0?N.jsx("div",{className:"flex h-full min-h-80 items-center justify-center",children:N.jsx(KP,{title:"No communication history",subtitle:"Calls, SMS, and email for this contact will appear here.",icon:rP})}):N.jsxs("div",{className:"flex flex-col gap-3 pb-6",children:[R&&N.jsx("div",{ref:b,className:"py-3 text-center text-xs text-[#9ca3af]",children:"Loading earlier messages…"}),O.map(_=>{const A=ms(_.createdAt).format("YYYY-MM-DD"),$=A!==S;return S=A,N.jsxs("div",{className:"flex flex-col gap-3",children:[$&&N.jsx(Mse,{date:_.createdAt}),N.jsx(Hse,{item:_,contact:t,onDeleteNote:a,focusCallId:e})]},_.id)})]})}),!f&&N.jsx("div",{className:"p-6",children:N.jsx(Tq,{contact:t,onSaveNote:s,onSendSms:l,onSendEmail:c,senders:d,suggestedSender:u})}),N.jsx(kse,{open:h,onClose:()=>p(!1),defaultPhoneNumber:t.phone||void 0})]})}const RR=m.createContext({authStatus:"loading",sessionData:void 0,verifySession:()=>{}}),rde=()=>{const{sessionData:t}=m.useContext(RR),e=(t==null?void 0:t.scopes)||[];return{scopes:e,has:n=>e.includes(n),hasAny:(...n)=>n.some(r=>e.includes(r))}},ide=({children:t})=>{const{location:e}=ZR(),r=((e==null?void 0:e.pathname)||"").startsWith("/app"),[i,s]=m.useState(r?"loading":"unauthenticated"),[o,a]=m.useState(),l=m.useRef(0),c=m.useRef(null),d=m.useRef(!1),u=m.useCallback(async h=>{const p=++l.current;s("loading"),a(void 0);try{const g=await In(),{data:v}=await g.verifyAppToken(void 0,void 0,{withCredentials:!0});if(l.current!==p)return;a(v),s("authenticated")}catch{if(l.current!==p)return;a(void 0),s("unauthenticated")}},[]),f=m.useCallback(()=>
725{if(typeof window>"u")return;const h=new URL(window.location.href);h.searchParams.has("ghost_token")&&(h.searchParams.delete("ghost_token"),window.history.replaceState({},document.title,h.pathname+h.search))},[]);return m.useEffect(()=>{if(r){const p=e!=null&&e.search&&new URLSearchParams(e.search).get("ghost_token")||void 0;if(p){if(c.current===p)return;c.current=p,u(p).finally(()=>{d.current=!0,f()});return}if(d.current){d.current=!1;return}c.current=null,u();return}const h=setTimeout(()=>{u()},5e3);return()=>clearTimeout(h)},[r,u,e==null?void 0:e.search,f]),N.jsx(RR.Provider,{value:{authStatus:i,sessionData:o,verifySession:u},children:t})},Vse=m.createContext({authStatus:"loading",sessionData:void 0,message:void 0,modal:void 0,verifySession:()=>{}}),Wse=()=>dt(()=>import("./inbox.tsx-SGjXWXqJ.js"),__vite__mapDeps([35,1,2,3])),gf=30;function Gse(t,e){var r;const n=new Map(t.filter(i=>!!i.id).map(i=>[i.id,{...i,chatLog:[...i.chatLog||[]]}]));for(const i of e){const s=i.contactId;if(!s)continue;const o=n.get(s);o?(r=o.chatLog)!=null&&r.some(a=>a.id===i.id)||(o.chatLog=[i,...o.chatLog||[]]):n.set(s,{id:s,phone:i.phoneNumber,chatLog:[i],inboxStatus:"NEEDS_HUMAN"})}return[...n.values()]}const Kse=ut("/app/inbox")({validateSearch:t=>({contact:typeof t.contact=="string"?t.contact:void 0,call:typeof t.call=="string"?t.call:void 0,includeAiHandled:typeof t.includeAiHandled=="string"?t.includeAiHandled:void 0,view:typeof t.view=="string"?t.view:void 0}),component:ft(Wse,"component")});function sde({contactId:t,callId:e}){const{message:n}=m.useContext(Vse),r=m$(),i=t,[s,o]=m.useState([]),[a,l]=m.useState(!0),[c,d]=m.useState(!1),[u,f]=m.useState(""),[h,p]=m.useState(i?"ALL":"NEEDS_HUMAN"),[g,v]=m.useState(""),[b,w]=m.useState(i),[C,x]=m.useState(!!i),[R,O]=m.useState(""),[T,S]=m.useState(!1),[_,A]=m.useState(1),[$,E]=m.useState(!1),[I,D]=m.useState(!1),[B,j]=m.useState("");m.useEffect(()=>{const W=setTimeout(()=>j(g.trim()),300);return()=>clearTimeout(W)}
725,[g]);const[z,q]=m.useState([]),[ne,Z]=m.useState([]),[J,de]=m.useState([]),[X,V]=m.useState(!1),[te,ie]=m.useState([]),[ce,ae]=m.useState(null),ve=m.useRef(0),xe=m.useMemo(()=>({...B?{query:B}:{},...h==="QUALIFIED"?{isQualified:!0}:{},...h==="NEEDS_HUMAN"?{inboxStatus:"NEEDS_HUMAN"}:{}}),[B,h]),ge=m.useCallback(async(W=!1)=>{W?d(!0):l(!0);try{const re=await In(),[se,pe,M]=await Promise.all([re.appContactsList({},{page:1,limit:gf,...xe}),re.appChatsList({},{page:1,limit:100,status:"IN_PROGRESS"}),re.appChatsList({},{page:1,limit:100,status:"TRANSFERING"})]),L=se.data.contacts||[],ye=[...pe.data,...M.data],ue=Gse(L,ye);o(Vc(ue.map(Rf))),A(1),E(L.length>=gf),f("")}catch{W?n==null||n.error("Inbox refresh failed. Showing the most recent loaded data."):f("The Inbox could not be loaded. Try again.")}finally{l(!1),d(!1)}},[xe,n]),le=m.useCallback(async()=>{if(I||!$)return;D(!0);const W=_+1;try{const pe=(await(await In()).appContactsList({},{page:W,limit:gf,...xe})).data.contacts||[];o(M=>{const L=new Set(M.map(ue=>ue.contact.id)),ye=pe.filter(ue=>ue.id&&!L.has(ue.id)).map(Rf);return ye.length?Vc([...M,...ye]):M}),A(W),E(pe.length>=gf)}catch{n==null||n.error("Could not load more conversations.")}finally{D(!1)}},[_,xe,$,I,n]);m.useEffect(()=>{ge()},[ge]),m.useEffect(()=>{if(!b){ie([]),ae(null);return}let W=!1;return(async()=>{try{const se=await In(),{data:pe}=await se.appSmsSenders({contactId:b});if(W)return;ie((pe.senders||[]).flatMap(M=>M.number?[{number:M.number,label:M.label||M.number}]:[])),ae(pe.suggested??null)}catch{if(W)return;ie([]),ae(null)}})(),()=>{W=!0}},[b]),m.useEffect(()=>{(async()=>{try{const re=await In(),{data:se}=await re.appContactsCustomPropertiesList({});de(se.properties||[])}catch{de([])}})()},[]);const fe=m.useMemo(()=>s.filter(W=>W.needsHuman).length,[s]),Se=m.useMemo(()=>h!=="NEEDS_HUMAN"?s:s.filter(W=>W.needsHuman),[h,s]);m.useEffect(()=>{var W;if(i){w(i),x(!0);return}b&&Se.some(re=>re.contact.id===b)||w((W=Se[0])==null?void 0:W.contact.id)},[i,b,Se]);const G=m.useMemo(()=>{var W;return(W=s.find(re=>re.contact.id===b))==null?void 0:W.contact},[b,s]),he=m.useCallback(async(W,re=!1)=>{var pe;const se=++ve.current;re&&(q([]),Z([]));try{const M=await In(),[L,ye,ue]=await Promise.all([M.appContactsGet({},{id:W}),M.appContactsNotesList({},{contactId:W}),M.appContactsTasksList({},{contactId:W})]);if(ve.current!==se)return;q(ye.data||[]),Z(ue.data||[]),O(""),o(be=>qP(be,L.data))}catch{if(ve.current!==se)return;try{const ye=(pe=(await(await In()).appChatsGet({},{id:W})).data)==null?void 0:pe.data,ue=ye==null?void 0:ye.contactId;if(ue&&ue!==W){r({to:"/app/inbox/$contactId",params:{contactId:ue},search:{call:(ye==null?void 0:ye.id)||W},replace:!0});return}}catch{}q([]),Z([]),i&&O("This conversation could not be found.")}},[i,r]);m.useEffect(()=>{if(!b){q([]),Z([]);return}he(b,!0)},[he,b]);const Ee=W=>{o(re=>Vc(re.map(se=>se.contact.id===W.id?Rf(W):se)))},Ie=async W=>{if(G!=null&&G.id)try{await(await In()).appContactsUpdate({},{id:G.id,...W}),Ee({...G,...W}),n==null||n.success("Contact updated")}catch{throw n==null||n.error("The contact could not be updated"),new Error("Could not update contact")}},ke=async()=>{if(G!=null&&G.id)try{V(!0),await(await In()).appContactsUpdate({},{id:G.id,isQualified:!G.isQualified}),Ee({...G,isQualified:!G.isQualified}),n==null||n.success(G.isQualified?"Contact marked as not qualified":"Contact marked as qualified")}catch{n==null||n.error("Qualification could not be updated")}finally{V(!1)}},De=async W=>{if(G!=null&&G.id)try{await(await In()).appContactsNotesCreate({},{contactId:G.id,content:W}),await he(G.id),n==null||n.success("Contact note added")}catch{throw n==null||n.error("The contact note could not be saved"),new Error("Could not save contact note")}},He=async(W,re)=>{if(G!=null&&G.id)try{await(await In()).appSmsSend({},{contactId:G.id,content:W,...re?{from:re}:{}}),await ge(!0),n==null||n.success("SMS sent")}catch{throw n==null||n.error("The SMS could not be sent"),new Error("Could not send SMS")}},Je=async(W,re)=>{if(G!=null&&G.id)try{await(await In()).appEmailsSend({},{contactId:G.id,subject:W,body:re}),await ge(!0),n==null||n.success("Email sent")}catch{throw n==null||n.error("The email could not be sent"),new Error("Could not send email")}},ze=async()=>
725{if(G!=null&&G.id)try{await(await In()).appContactsResolve({},{contactId:G.id}),await ge(!0),n==null||n.success("Marked as handled")}catch{n==null||n.error("Could not mark as handled")}},Ne=async W=>{if(!(!W.id||!(G!=null&&G.id)))try{await(await In()).appContactsTasksUpdate({},{id:W.id,status:W.status==="COMPLETED"?"PENDING":"COMPLETED"}),await he(G.id)}catch{n==null||n.error("The task could not be updated")}},tt=async W=>{if(G!=null&&G.id)try{await(await In()).appContactsNotesDelete({},{id:W}),await he(G.id)}catch{n==null||n.error("The note could not be deleted")}},pt=async(W,re)=>{if(G!=null&&G.id)try{await(await In()).appContactsTasksCreate({},{contactId:G.id,content:W,toDoBefore:re}),await he(G.id)}catch{throw n==null||n.error("The task could not be created"),new Error("Could not create task")}},gt=async W=>{if(G!=null&&G.id)try{await(await In()).appContactsTasksDelete({},{id:W}),await he(G.id)}catch{n==null||n.error("The task could not be deleted")}},y=async(W,re)=>{if(G!=null&&G.id)try{await(await In()).appContactsSetPropertyValue({},{contactId:G.id,propertyId:W,value:re});const pe=G.propertyValueOnContact||[],M=pe.some(L=>L.propertyId===W)?pe.map(L=>L.propertyId===W?{...L,value:re}:L):[...pe,{propertyId:W,value:re}];Ee({...G,propertyValueOnContact:M}),n==null||n.success("Property updated")}catch{throw n==null||n.error("The property could not be updated"),new Error("Could not update property")}},K=W=>{w(W),x(!0),r({to:"/app/inbox/$contactId",params:{contactId:W},search:{},replace:!0})};return N.jsxs("div",{className:"flex h-[calc(100dvh-65px)] min-h-0 overflow-x-hidden bg-white lg:h-full",children:[N.jsx("div",{className:`h-full min-h-0 w-full flex-shrink-0 border-r border-[#f3f4f6] bg-white lg:flex lg:w-[319px] ${C?"hidden":"flex"}`,children:N.jsx(GP,{threads:Se,selectedId:b,loading:a,filter:h,needsHumanCount:fe,search:g,refreshing:c,onSearchChange:v,onRefresh:()=>void ge(!0),onFilterChange:p,onSelect:K,hasMore:$,loadingMore:I,onLoadMore:()=>void le()})}),N.jsx("div",{className:`h-full min-w-0 flex-1 ${C?"flex":"hidden lg:flex"}`,children:u&&!a?N.jsx("div",{className:"flex h-full w-full items-center justify-center px-6",children:N.jsxs("div",{className:"max-w-sm rounded-2xl border border-[#f3f4f6] p-6 text-center",children:[N.jsx("h2",{className:"text-base font-semibold text-[#161c3c]",children:"Inbox unavailable"}),N.jsx("p",{className:"mt-2 text-sm leading-6 text-[#9ca3af]",children:u}),N.jsx("button",{type:"button",onClick:()=>void ge(),className:"mt-5 rounded-xl bg-[#161c3c] px-4 py-2 text-sm font-medium text-white hover:bg-[#161c3c]/90",children:"Try again"})]})}):N.jsx(Use,{contact:G,focusCallId:e,deepLinkError:R,onBack:()=>x(!1),onShowContact:()=>S(!0),onAddContactNote:De,notes:z,onDeleteNote:tt,onSendSms:He,onSendEmail:Je,senders:te,suggestedSender:ce})}),G&&N.jsx(VP,{contact:G,tasks:ne,propertyDefinitions:J,open:T,savingQualification:X,onClose:()=>S(!1),onToggleQualified:ke,onResolve:ze,onToggleTask:Ne,onAddTask:pt,onDeleteTask:gt,onSetProperty:y,onUpdateContact:Ie})]})}const Xse=()=>dt(()=>import("./route.tsx-Cg4v1n96.js"),__vite__mapDeps([36,1,14,15,2,3,37,16,17,18,19,20,21,22])),Yse=ut("/app/leads")({component:ft(Xse,"component")}),Jse=()=>dt(()=>import("./numbers.tsx-CJioXs0p.js"),__vite__mapDeps([38,1,3,16,21,22,39,40,2])),Qse=ut("/app/numbers")({component:ft(Jse,"component")}),Zse=()=>dt(()=>import("./payments.tsx-DPT6ReST.js"),__vite__mapDeps([41,1,42,43,44,45,46,47,48,49,50,51,52,22,53,54,55,56,57,58,59,60,61,62,63,64,2,3])),eoe=ut("/app/payments")({component:ft(Zse,"component")}),toe=()=>dt(()=>import("./reports.tsx-CzvQh0lH.js"),__vite__mapDeps([65,1,3,2])),noe=ut("/app/reports")({component:ft(toe,"component")}),roe=()=>dt(()=>import("./settings.tsx-B4P0QuA6.js"),__vite__mapDeps([66,1,67,3,68,33,10,44,69,53,54,62,49,50,51,52,22,43,70,71,45,46,47,48,55,72,60,2])),ioe=ut("/app/settings")({component:ft(roe,"component")}),soe=()=>dt(()=>import("./sms.tsx-CChiVx0a.js"),__vite__mapDeps([73,1,74,2,3,29,25])),ooe=ut("/app/sms")({component:ft(soe,"component")}),aoe=()=>dt(()=>import("./voicebots.tsx-BtM-CUAw.js"),__vite__mapDeps([75,1,2,3,14,15,69,53,54,62,49,50,51,52,22,76,16,55,43,44,20,77])),loe=ut("/app/voicebots")({component:ft(aoe,"component")}),coe=()=>dt(()=>import("./index.tsx-CUa0-USN.js"),__vite__mapDeps([78,1,2,77,9,76,79,80,3])),doe=ut("/onboarding/")({component:ft(coe,"component")}),uoe=()=>dt(()=>import("./index.tsx-Cy3NEnsn.js"),__vite__mapDeps([81,1,2,8,9,10,11,6,7,3])),foe=ut("/_public/about/")({component:ft(uoe,"component"),head:()=>$r({title:"About",description:"LawBot is built by lawyers and engineers to help solo practitioners and firms reclaim billable hours and convert every inbound call.",path:"/about"})}),hoe=()=>dt(()=>import("./google.tsx-DR0eEnPH.js"),__vite__mapDeps([82,1,2,3])),poe=ut("/_public/auth/google")({component:ft(hoe,"component"),head:()=>$r({title:"Signing in…",description:"Completing Google sign-in for LawBot.",path:"/auth/google",noindex:!0})}),moe=()=>dt(()=>import("./index.tsx-Div-bbIk.js"),__vite__mapDeps([83,1,6,2,7,8,9,10,11,3])),goe=ut("/_public/buy/")({validateSearch:t=>({pickedPlan:t.plan}),component:ft(moe,"component"),head:()=>$r({title:"Checkout",description:"Complete your LawBot subscription.",path:"/buy",noindex:!0})}),voe=()=>dt(()=>import("./index.tsx-5X4yrj3s.js"),__vite__mapDeps([84,1,6,2,7,8,9,10,11,85,3])),boe=ut("/_public/contact/")({validateSearch:t=>({pickedService:t.service}),component:ft(voe,"component"),head:()=>$r({title:"Contact",description:"Talk to the LawBot team. Sales, support and partnership enquiries — we typically reply within one business day.",path:"/contact"})}),yoe=()=>dt(()=>import("./index.tsx-CbmrxKWy.js"),__vite__mapDeps([86,1,8,2,9,10,11,3])),woe=ut("/_public/docs/")({component:ft(yoe,"component"),head:()=>$r({title:"API Docs",description:"Developer documentation for the LawBot API — authentication, webhooks, call events and CRM integrations.",path:"/docs"})}),Soe=()=>dt(()=>import("./index.tsx-BQelfwLZ.js"),__vite__mapDeps([87,1,2,3])),Coe=ut("/_public/emergency_block/")({component:ft(Soe,"component"),head:()=>
725$r({title:"Emergency Block",description:"Block access to a LawBot account or organization.",path:"/emergency_block",noindex:!0})}),xoe=()=>dt(()=>import("./index.tsx-Dv4sm3mG.js"),__vite__mapDeps([88,1,6,2,7,8,9,10,11,3])),$oe=ut("/_public/faq/")({component:ft(xoe,"component"),head:()=>$r({title:"FAQ",description:"Common questions about LawBot — onboarding, integrations, voice quality, pricing, security and conflict-of-interest checks.",path:"/faq"})}),Eoe=()=>dt(()=>import("./index.tsx-DW-lS02H.js"),__vite__mapDeps([89,1,2,3])),Toe=ut("/_public/forgot_password/")({component:ft(Eoe,"component"),head:()=>$r({title:"Forgot Password",description:"Request a password reset link for your LawBot dashboard account.",path:"/forgot_password",noindex:!0})}),Roe=()=>dt(()=>import("./index.tsx-isUZesD9.js"),__vite__mapDeps([90,1,2,3])),Ioe=ut("/_public/login/")({component:ft(Roe,"component"),head:()=>$r({title:"Sign In",description:"Sign in to your LawBot dashboard.",path:"/login",noindex:!0})}),Aoe=()=>dt(()=>import("./index.tsx-DLtymz4B.js"),__vite__mapDeps([91,1,2])),Ooe=ut("/_public/payment/")({component:ft(Aoe,"component"),head:()=>$r({title:"Payment",description:"Consultation payment status.",path:"/payment",noindex:!0})}),koe=()=>dt(()=>import("./index.tsx-Worjh6TH.js"),__vite__mapDeps([92,1,6,2,7,8,9,10,11,3])),Noe=ut("/_public/pricing/")({component:ft(koe,"component"),head:()=>$r({title:"Pricing",description:"Simple, transparent pricing for law firms of every size. Start a free trial — pay only for the calls and minutes you use.",path:"/pricing"})}),_oe=()=>dt(()=>import("./index.tsx-B65TaKuZ.js"),__vite__mapDeps([93,1,8,2,9,10,11,6,7,3])),Poe=ut("/_public/product/")({component:ft(_oe,"component"),head:()=>$r({title:"Product",description:"See how LawBot's AI voice agent handles intake calls, qualifies prospects, captures case details and integrates with Clio, Google Calendar and your CRM.",path:"/product"})}),Moe=()=>dt(()=>import("./index.tsx-CvU4ZRd1.js"),__vite__mapDeps([94,1,7,95,6,2,8,9,10,11,3])),Doe=ut("/_public/register/")({component:ft(Moe,"component"),head:()=>$r({title:"Create an Account",description:"Start your LawBot free trial in under two minutes.",path:"/register",noindex:!0})}),Loe=()=>dt(()=>import("./index.tsx-Cl4waMsb.js"),__vite__mapDeps([96,1,2,71,3])),joe=ut("/_public/reset_password/")({component:ft(Loe,"component"),head:()=>$r({title:"Reset Password",description:"Reset your LawBot account password.",path:"/reset_password",noindex:!0})}),Foe=()=>dt(()=>import("./index.tsx-Bs_rUNm2.js"),__vite__mapDeps([97,1,6,2,7,8,9,10,11,85,3])),Boe=ut("/_public/security/")({component:ft(Foe,"component"),head:()=>$r({title:"Security & Privacy",description:"How LawBot protects attorney-client confidentiality: encryption, retention, access controls and our privacy policy.",path:"/security"})}),Hoe=()=>dt(()=>import("./index.tsx-DtqBFgK5.js"),[]),zoe=ut("/_public/set_password/")({validateSearch:t=>({token:typeof t.token=="string"?t.token:void 0}),beforeLoad:({search:t})=>{throw Cb({to:"/reset_password",search:t.token?{token:t.token}:{}})},component:ft(Hoe,"component"),head:()=>$r({title:"Set Password",description:"Set a password for your LawBot account.",path:"/set_password",noindex:!0})}),qoe=()=>dt(()=>import("./route.tsx-BkpvDIUM.js"),__vite__mapDeps([98,1,2,99,79,7,10,68,100,101,102,3])),Uoe=m.createContext(void 0),ode=()=>{const t=m.useContext(Uoe);return t||{botId:"",name:"",setName:()=>{},phoneNumberId:"",setPhoneNumberId:()=>{},phoneNumbers:[],reservedPhoneNumbers:{},aiDiscosureMode:"FIRST_MESSAGE",setAiDiscosureMode:()=>{},languages:[],setLanguages:()=>{},empathy_level:2,setEmpathyLevel:()=>{},voiceId:"",setVoiceId:()=>{},backgroundSound:"",setBackgroundSound:()=>{},backgroundSoundLevel:-20,setBackgroundSoundLevel:()=>{},ttsPlaybackSpeed:1,setTtsPlaybackSpeed:()=>{},speakingSpeed:{enabled:!1,min:.5,max:2,default:1.25},provider:"GEMINI",temperature:1,setTemperature:()=>{},rememberPreviousCalls:!1,setRememberPreviousCalls:()=>{},lead_qualification:!1,setLeadQualification:()=>{},lead_acceptance_criteria:"",setLeadAcceptanceCriteria:()=>{},first_message:"",setFirstMessage:()=>{},system_prompt:"",setSystemPrompt:()=>{},outgoing_first_message:"",setOutgoingFirstMessage:()=>{},outgoing_system_prompt:"",setOutgoingSystemPrompt:()=>{},voicemail_message:"",setVoicemailMessage:()=>{},variables:[],setVariables:()=>{},allow_call_transfer:"",setAllowCallTransfer:()=>{},allow_hangup:!0,setAllowHangup:()=>{},send_email:"",setSendEmail:()=>{},send_to_clio:!1,setSendToClio:()=>{},sms_ai_autoreply:!1,setSmsAiAutoreply:()=>{},calendlyEnabled:!1,setCalendlyEnabled:()=>{},calendlyEventTypeUri:"",setCalendlyEventTypeUri:()=>{},googleCalendarEnabled:!1,googleCalendarIntegrationId:"",consultationPaymentConfigId:"",sc
725hedulingTimezone:"",setSchedulingTimezone:()=>{},inboundParseSlug:"",setInboundParseSlug:()=>{},inboundParseAllowedSenders:[],setInboundParseAllowedSenders:()=>{},updateValues:()=>{},loading:!1,save:async()=>{}}},Voe=ut("/app/$bot_id/ai_agent")({component:ft(qoe,"component")}),Woe=()=>dt(()=>import("./index.tsx-ClfxTgfp.js"),__vite__mapDeps([103,1,2,3])),Goe=ut("/app/archives/")({component:ft(Woe,"component")}),Koe=()=>dt(()=>import("./$chat_id.tsx-CAZ2cGNO.js"),__vite__mapDeps([104,1,105,28,3,49,50,59,51,52,22,106,76,79,107,18,19,20,56,108,64,43,44,21,9,14,15,2])),Xoe=ut("/app/archives/$chat_id")({component:ft(Koe,"component")}),Yoe=()=>dt(()=>import("./index.tsx-DXSX56n8.js"),__vite__mapDeps([109,1,2,56,61,110,40,108,17,3])),Joe=ut("/app/billing/")({component:ft(Yoe,"component")}),Qoe=()=>dt(()=>import("./cancel.tsx-BY2IVQPk.js"),__vite__mapDeps([111,1,2,61,106,56,3])),Zoe=ut("/app/billing/cancel")({component:ft(Qoe,"component")}),eae=()=>dt(()=>import("./subscribed.tsx-CreearB0.js"),__vite__mapDeps([112,1,7,95,2,110,63,77,3])),tae=ut("/app/billing/subscribed")({component:ft(eae,"component")}),nae=()=>dt(()=>import("./success.tsx-BpXf70Sc.js"),__vite__mapDeps([113,1,7,2,61,63,77,3])),rae=ut("/app/billing/success")({component:ft(nae,"component")}),iae=()=>dt(()=>import("./calls_.$chat_id.tsx-DljVPlvG.js"),__vite__mapDeps([114,1,27,14,15,2,3,28,29,30])),sae=ut("/app/calls_/$chat_id")({component:ft(iae,"component")}),oae=()=>dt(()=>import("./$chat_id.tsx-DllRHUvo.js"),__vite__mapDeps([115,1,105,28,3,49,50,59,51,52,22,106,76,79,107,18,19,20,56,108,64,43,44,21,9,14,15,2])),aae=ut("/app/chats/$chat_id")({component:ft(oae,"component")}),lae=()=>dt(()=>import("./index.tsx-DokPAqwI.js"),__vite__mapDeps([116,1,32,2,3])),cae=ut("/app/contacts/")({component:ft(lae,"component")}),dae=()=>dt(()=>import("./$contact_id.tsx-CcV59xD-.js"),__vite__mapDeps([117,1,14,15,2,3,18,52,29,34,72])),uae=ut("/app/contacts/$contact_id")({component:ft(dae,"component")}),fae=()=>dt(()=>import("./index.tsx-BballxYc.js"),__vite__mapDeps([118,1,2,3,16])),hae=ut("/app/documents/")({component:ft(fae,"component")}),pae=()=>dt(()=>import("./HyperlinkDialog-HGZ2S37Z-BjpTw8RP.js").then(t=>t.$),__vite__mapDeps([119,1,2,53,51,52,22,50,120,3,70,121])),mae=ut("/app/documents/$document_id")({component:ft(pae,"component")}),gae=()=>dt(()=>import("./index.tsx-gyCef0Kr.js"),__vite__mapDeps([122,1,67,18,2,3])),vae=ut("/app/emails/")({component:ft(gae,"component")}),bae=()=>dt(()=>import("./index.tsx-B0ULhiYz.js"),__vite__mapDeps([123,1,14,15,124,125,69,53,54,62,49,50,51,52,22,126,60,2,3,16,55,43,44,20,77])),yae=ut("/app/flows/")({component:ft(bae,"component")}),wae=()=>dt(()=>import("./$flow_id.tsx-D9TE8eSU.js"),__vite__mapDeps([127,1,2,57,34,60,9,14,15,69,53,54,62,49,50,51,52,22,20,124,125,126,99,79,7,10,39,3])),Sae=ut("/app/flows/$flow_id")({component:ft(wae,"component")}),Cae=()=>dt(()=>import("./inbox_.$contactId.tsx-CRgWa0z5.js"),__vite__mapDeps([128,1,2,3])),xae=ut("/app/inbox_/$contactId")({validateSearch:t=>({call:typeof t.call=="string"?t.call:void 0}),component:ft(Cae,"component")}),$ae=()=>dt(()=>import("./salesforce.tsx-CZdwdtMv.js"),__vite__mapDeps([129,1,130,47,48,49,50,44,51,52,22,53,9,21,131,132,60,58,59,107,39,2,3])),Eae=ut("/app/integrations/salesforce")({component:ft($ae,"component")}),Tae=()=>dt(()=>import("./index.tsx-BqKBiqFV.js"),__vite__mapDeps([133,1,2,3,134,102,16,135,120])),Rae=ut("/app/knowledgebases/")({component:ft(Tae,"component")}),Iae=()=>dt(()=>import("./$knowledgebase_id.tsx-DNJu-dpF.js"),__vite__mapDeps([136,1,2,3,134,102,39,120,132])),Aae=ut("/app/knowledgebases/$knowledgebase_id")({component:ft(Iae,"component")}),Oae=()=>dt(()=>import("./index.tsx-CzI048lF.js"),__vite__mapDeps([137,1,37,2,3])),kae=ut("/app/leads/")({beforeLoad:()=>{throw Cb({to:"/app/inbox",search:{includeAiHandled:"true",view:"qualified"}})},component:ft(Oae,"component")}),Nae=()=>dt(()=>import("./$chat_id.tsx-Gtmd5bSn.js"),__vite__mapDeps([138,1,105,28,3,49,50,59,51,52,22,106,76,79,107,18,19,20,56,108,64,43,44,21,9,14,15,2])),_ae=ut("/app/leads/$chat_id")({component:ft(Nae,"component")}),Pae=()=>dt(()=>import("./sms_.$contact_id.tsx-BVd2feBV.js"),__vite__mapDeps([139,1,74,2,3,29,25])),Mae=ut("/app/sms_/$contact_id")({component:ft(Pae,"component")}),Dae=()=>dt(()=>import("./index.tsx-xd4ooMxZ.js"),__vite__mapDeps([140,1,15,46,125,10,43,44,131,76,51,52,22,60,18,2,3])),Lae=ut("/app/$bot_id/ai_agent/")({component:ft(Dae,"component")}),ade="text-xs font-medium text-black mb-1",jae=()=>dt(()=>import("./calls.tsx-C6OSwR4S.js"),__vite__mapDeps([141,1,30,43,44,76,2,3])),Fae=ut("/app/$bot_id/ai_agent/calls")({component:ft(jae,"component")}),Bae=()=>dt(()=>import("./incoming.tsx-BmMtiQfG.js"),__vite__mapDeps([142,1,2])),Hae=ut("/app/$bot_id/ai_agent/incoming")({component:ft(Bae,"component")}),zae=()=>dt(()=>import("./knowledgebases.tsx-Bwgo9zUt.js"),__vite__mapDeps([143,1,2,102,64,16,43,44,132,120,135,3])),qae=ut("/app/$bot_id/ai_agent/knowledgebases")({component:ft(zae,"component")}),Uae=()=>dt(()=>import("./leads.tsx-CXUtJETJ.js"),__vite__mapDeps([144,1,145,43,44,60,2,3])),Vae=ut("/app/$bot_id/ai_agent/leads")({component:ft(Uae,"component")}),Wae=()=>dt(()=>import("./outgoing.tsx-OIg3kG5U.js"),__vite__mapDeps([146,1,2,3])),Gae=ut("/app/$bot_id/ai_agent/outgoing")({component:ft(Wae,"component")}),Kae=()=>dt(()=>import("./questions.tsx-BHuRc3j_.js"),__vite__mapDeps([147,1,43,44,40,2,3])),Xae=ut("/app/$bot_id/ai_agent/questions")({component:ft(Kae,"component")}),Yae=()=>dt(()=>import("./tasks.tsx-D03MOqRU.js"),__vite__mapDeps([148,1,3,100,43,44,49,50,62,48,55,145,72,2])),Jae=ut("/app/$bot_id/ai_agent/tasks")({component:ft(Yae,"component")}),Qae=()=>dt(()=>
725import("./tools.tsx-B_ykwJWG.js"),__vite__mapDeps([149,1,101,43,44,60,18,64,19,2,3])),Zae=ut("/app/$bot_id/ai_agent/tools")({component:ft(Qae,"component")}),ele=()=>dt(()=>import("./voicemail.tsx-CSteXmbr.js"),__vite__mapDeps([150,1,2,3])),tle=ut("/app/$bot_id/ai_agent/voicemail")({component:ft(ele,"component")}),nle=()=>dt(()=>import("./salesforce_.auth.tsx-CWZ2Fy7M.js"),__vite__mapDeps([151,1,130,63,40,2,3])),rle=ut("/app/integrations/salesforce_/auth")({component:ft(nle,"component")}),ile=ut("/app")(),pr=d_.update({id:"/_public",getParentRoute:()=>Ip}),Qt=ile.update({id:"/app",path:"/app",getParentRoute:()=>Ip}).lazy(()=>dt(()=>import("./route.lazy-VbOa5LhX.js"),__vite__mapDeps([152,1,2,14,15,76,108,16,57,80,24,126,56,10,33,9,11,42,3,153])).then(t=>t.Route)),sle=p_.update({id:"/",path:"/",getParentRoute:()=>pr}),ole=g_.update({id:"/",path:"/",getParentRoute:()=>Qt}),w2=b_.update({id:"/archives",path:"/archives",getParentRoute:()=>Qt}),ale=w_.update({id:"/assistant",path:"/assistant",getParentRoute:()=>Qt}),lle=C_.update({id:"/calls",path:"/calls",getParentRoute:()=>Qt}),S2=$_.update({id:"/contacts",path:"/contacts",getParentRoute:()=>Qt}),cle=Kse.update({id:"/inbox",path:"/inbox",getParentRoute:()=>Qt}),C2=Yse.update({id:"/leads",path:"/leads",getParentRoute:()=>Qt}),dle=Qse.update({id:"/numbers",path:"/numbers",getParentRoute:()=>Qt}),ule=eoe.update({id:"/payments",path:"/payments",getParentRoute:()=>Qt}),fle=noe.update({id:"/reports",path:"/reports",getParentRoute:()=>Qt}),hle=ioe.update({id:"/settings",path:"/settings",getParentRoute:()=>Qt}),ple=ooe.update({id:"/sms",path:"/sms",getParentRoute:()=>Qt}),mle=loe.update({id:"/voicebots",path:"/voicebots",getParentRoute:()=>Qt}),gle=doe.update({id:"/onboarding/",path:"/onboarding/",getParentRoute:()=>Ip}),vle=foe.update({id:"/about/",path:"/about/",getParentRoute:()=>pr}),ble=poe.update({id:"/auth/google",path:"/auth/google",getParentRoute:()=>pr}),yle=goe.update({id:"/buy/",path:"/buy/",getParentRoute:()=>pr}),wle=boe.update({id:"/contact/",path:"/contact/",getParentRoute:()=>pr}),Sle=woe.update({id:"/docs/",path:"/docs/",getParentRoute:()=>pr}),Cle=Coe.update({id:"/emergency_block/",path:"/emergency_block/",getParentRoute:()=>pr}),xle=$oe.update({id:"/faq/",path:"/faq/",getParentRoute:()=>pr}),$le=Toe.update({id:"/forgot_password/",path:"/forgot_password/",getParentRoute:()=>pr}),Ele=Ioe.update({id:"/login/",path:"/login/",getParentRoute:()=>pr}),Tle=Ooe.update({id:"/payment/",path:"/payment/",getParentRoute:()=>pr}),Rle=Noe.update({id:"/pricing/",path:"/pricing/",getParentRoute:()=>pr}),Ile=Poe.update({id:"/product/",path:"/product/",getParentRoute:()=>pr}),Ale=Doe.update({id:"/register/",path:"/register/",getParentRoute:()=>pr}),Ole=joe.update({id:"/reset_password/",path:"/reset_password/",getParentRoute:()=>pr}),kle=Boe.update({id:"/security/",path:"/security/",getParentRoute:()=>pr}),Nle=zoe.update({id:"/set_password/",path:"/set_password/",getParentRoute:()=>pr}),Qi=Voe.update({id:"/$bot_id/ai_agent",path:"/$bot_id/ai_agent",getParentRoute:()=>Qt}),_le=Goe.update({id:"/",path:"/",getParentRoute:()=>w2}),Ple=Xoe.update({id:"/$chat_id",path:"/$chat_id",getParentRoute:()=>w2}),Mle=Joe.update({id:"/billing/",path:"/billing/",getParentRoute:()=>Qt}),Dle=Zoe.update({id:"/billing/cancel",path:"/billing/cancel",getParentRoute:()=>Qt}),Lle=tae.update({id:"/billing/subscribed",path:"/billing/subscribed",getParentRoute:()=>Qt}),jle=rae.update({id:"/billing/success",path:"/billing/success",getParentRoute:()=>Qt}),Fle=sae.update({id:"/calls_/$chat_id",path:"/calls/$chat_id",getParentRoute:()=>Qt}),Ble=aae.update({id:"/chats/$chat_id",path:"/chats/$chat_id",getParentRoute:()=>Qt}),Hle=cae.update({id:"/",path:"/",getParentRoute:()=>S2}),zle=uae.update({id:"/$contact_id",path:"/$contact_id",getParentRoute:()=>S2}),qle=hae.update({id:"/documents/",path:"/documents/",getParentRoute:()=>Qt}),Ule=mae.update({id:"/documents/$document_id",path:"/documents/$document_id",getParentRoute:()=>Qt}),Vle=vae.update({id:"/emails/",path:"/emails/",getParentRoute:()=>Qt}),Wle=yae.update({id:"/flows/",path:"/flows/",getParentRoute:()=>Qt}),Gle=Sae.update({id:"/flows/$flow_id",path:"/flows/$flow_id",getParentRoute:()=>Qt}),Kle=xae.update({id:"/inbox_/$contactId",path:"/inbox/$contactId",getParentRoute:()=>Qt}),Xle=Eae.update({id:"/integrations/salesforce",path:"/integrations/salesforce",getParentRoute:()=>Qt}),Yle=Rae.update({id:"/knowledgebases/",path:"/knowledgebases/",getParentRoute:()=>Qt}),Jle=Aae.update({id:"/knowledgebases/$knowledgebase_id",path:"/knowledgebases/$knowledgebase_id",getParentRoute:()=>Qt}),Qle=kae.update({id:"/",path:"/",getParentRoute:()=>C2}),Zle=_ae.update({id:"/$chat_id",path:"/$chat_id",getParentRoute:()=>C2}),ece=Mae.update({id:"/sms_/$contact_id",path:"/sms/$contact_id",getParentRoute:()=>Qt}),tce=Lae.update({id:"/",path:"/",getParentRoute:()=>Qi}),nce=Fae.update({id:"/calls",path:"/calls",getParentRoute:()=>Qi}),rce=Hae.update({id:"/incoming",path:"/incoming",getParentRoute:()=>Qi}),ice=qae.update({id:"/knowledgebases",path:"/knowledgebases",getParentRoute:()=>Qi}),sce=Vae.update({id:"/leads",path:"/leads",getParentRoute:()=>Qi}),oce=Gae.update({id:"/outgoing",path:"/outgoing",getParentRoute:()=>Qi}),ace=Xae.update({id:"/questions",path:"/questions",getParentRoute:()=>Qi}),lce=Jae.update({id:"/tasks",path:"/tasks",getParentRoute:()=>Qi}),cce=Zae.update({id:"/tools",path:"/tools",getParentRoute:()=>Qi}),dce=tle.update({id:"/voicemail",path:"/voicemail",getParentRoute:()=>Qi}),uce=rle.update({id:"/integrations/salesforce_/auth",path:"/integrations/salesforce/auth",getParentRoute:()=>Qt}),fce={PublicIndexRoute:sle,PublicAuthGoogleRoute:ble,PublicAboutIndexRoute:vle,PublicBuyIndexRoute:yle,PublicContactIndexRoute:wle,PublicDocsIndexRoute:Sle,PublicEmergency_blockIndexRoute:Cle,PublicFaqIndexRoute:xle,PublicForgot_passwordIndexRoute:$le,PublicLoginIndexRoute:Ele,PublicPaymentIndexRoute:Tle,PublicPricingIndexRoute:Rle,PublicProductIndexRoute:Ile,PublicRegisterIndexRoute:Ale,PublicReset_passwordIndexRoute:Ole,PublicSecurityIndexRoute:kle,PublicSet_passwordIndexRoute:Nle},hce=pr._addFileChildren(fce),pce={AppArchivesChat_idRoute:Ple,AppArchivesIndexRoute:_le},mce=w2._addFileChildren(pce),gce={AppContactsContact_idRoute:zle,AppContactsIndexRoute:Hle},vce=S2._addFileChildren(gce),bce={AppLeadsChat_idRoute:Zle,AppLeadsIndexRoute:Qle},yce=C2._addFileChildren(bce),wce={AppBot_idAi_agentCallsRoute:nce,AppBot_idAi_agentIncomingRoute:rce,AppBot_idAi_agentKnowledgebasesRoute:ice,AppBot_idAi_agentLeadsRoute:sce,AppBot_idAi_agentOutgoingRoute:oce,AppBot_idAi_agentQuestionsRoute:ace,AppBot_idAi_agentTasksRoute:lce,AppBot_idAi_agentToolsRoute:cce,AppBot_idAi_agentVoicemailRoute:dce,AppBot_idAi_agentIndexRoute:tce},Sce=Qi._addFileChildren(wce),Cce={AppArchivesRouteRoute:mce,AppContactsRouteRoute:vce,AppLeadsRouteRoute:yce,AppAssistantRoute:ale,AppCallsRoute:lle,AppInboxRoute:cle,AppNumbersRoute:dle,AppPaymentsRoute:ule,AppReportsRoute:fle,AppSettingsRoute:hle,AppSmsRoute:ple,AppVoicebotsRoute:mle,AppIndexRoute:ole,AppBot_idAi_agentRouteRoute:Sce,AppBillingCancelRoute:Dle,AppBillingSubscribedRoute:Lle,AppBillingSuccessRoute:jle,AppCallsChat_idRoute:Fle,AppChatsChat_idRoute:Ble,AppD
725ocumentsDocument_idRoute:Ule,AppFlowsFlow_idRoute:Gle,AppInboxContactIdRoute:Kle,AppIntegrationsSalesforceRoute:Xle,AppKnowledgebasesKnowledgebase_idRoute:Jle,AppSmsContact_idRoute:ece,AppBillingIndexRoute:Mle,AppDocumentsIndexRoute:qle,AppEmailsIndexRoute:Vle,AppFlowsIndexRoute:Wle,AppKnowledgebasesIndexRoute:Yle,AppIntegrationsSalesforceAuthRoute:uce},xce=Qt._addFileChildren(Cce),$ce={PublicRouteRoute:hce,AppRouteLazyRoute:xce,OnboardingIndexRoute:gle},Ece=Ip._addFileChildren($ce)._addFileTypes(),Tce=eI({routeTree:Ece,context:{},defaultPreload:"intent",scrollRestoration:!0,defaultStructuralSharing:!0,defaultPreloadStaleTime:0}),a1=document.getElementById("app");a1&&!a1.innerHTML&&GR.createRoot(a1).render(N.jsx(m.StrictMode,{children:N.jsx(tI,{router:Tce})}));export{yP as $,In as A,J_ as B,WS as C,ode as D,KP as E,rP as F,ade as G,vP as H,Va as I,cP as J,_6 as K,Lm as L,Ni as M,goe as N,jce as O,Al as P,Qy as Q,Kse as R,Vse as S,L6 as T,uP as U,kse as V,xb as W,Ap as X,Ase as Y,Uoe as Z,st as _,Ki as a,Xo as a$,tne as a0,yr as a1,D4 as a2,Oa as a3,p2 as a4,nne as a5,ine as a6,rde as a7,hP as a8,D6 as a9,p7 as aA,Ji as aB,wn as aC,tP as aD,tde as aE,ede as aF,eX as aG,Md as aH,tp as aI,G7 as aJ,jq as aK,G8 as aL,Qh as aM,u2 as aN,dc as aO,hx as aP,gZ as aQ,pa as aR,nn as aS,Yo as aT,ee as aU,Un as aV,K8 as aW,Gs as aX,Yi as aY,hu as aZ,C7 as a_,P6 as aa,Qb as ab,$R as ac,pi as ad,yG as ae,ln as af,Ba as ag,Fo as ah,P7 as ai,E7 as aj,Le as ak,Ha as al,Ho as am,Cs as an,cn as ao,Re as ap,Y as aq,yt as ar,Nt as as,jn as at,za as au,Zp as av,mn as aw,Bo as ax,Qo as ay,oK as az,GP as b,_G as b$,Vl as b0,mP as b1,NP as b2,_se as b3,xK as b4,s2 as b5,wQ as b6,sp as b7,IG as b8,v7 as b9,Gce as bA,TV as bB,jY as bC,B8 as bD,Yl as bE,Qce as bF,Yce as bG,LY as bH,bu as bI,Wp as bJ,ps as bK,Fi as bL,S7 as bM,Jce as bN,Ql as bO,ip as bP,Jl as bQ,V7 as bR,oc as bS,AY as bT,MY as bU,yv as bV,Jr as bW,MP as bX,EP as bY,sc as bZ,i2 as b_,m7 as ba,EV as bb,Fce as bc,vt as bd,zo as be,Wce as bf,nr as bg,DG as bh,e2 as bi,fG as bj,CG as bk,e0 as bl,w7 as bm,Jo as bn,QW as bo,Qr as bp,p0 as bq,m0 as br,jT as bs,_T as bt,f2 as bu,LT as bv,Y8 as bw,RV as bx,qK as by,Zce as bz,Use as c,dt as c$,px as c0,aJ as c1,ide as c2,RR as c3,Nse as c4,rne as c5,nde as c6,qce as c7,Ex as c8,Qp as c9,ZZ as cA,nee as cB,ap as cC,zZ as cD,h0 as cE,Vp as cF,Ko as cG,wu as cH,CZ as cI,wZ as cJ,VZ as cK,q3 as cL,RP as cM,uae as cN,Eee as cO,Br as cP,Hy as cQ,Xce as cR,kX as cS,$T as cT,jt as cU,g0 as cV,kT as cW,Vce as cX,Ov as cY,dte as cZ,FZ as c_,O7 as ca,I7 as cb,A7 as cc,R7 as cd,$x as ce,kJ as cf,r2 as cg,mu as ch,Kce as ci,AG as cj,Id as ck,dU as cl,qy as cm,Go as cn,ar as co,or as cp,fT as cq,zT as cr,HT as cs,D3 as ct,QZ as cu,tee as cv,ree as cw,eee as cx,iee as cy,see as cz,VP as d,xg as d0,qa as d1,Nr as d2,IK as d3,Jh as d4,Mee as d5,Dt as d6,BM as d7,xt as d8,Be as d9,lt as da,An as db,sr as dc,yn as dd,Lr as de,T5 as df,wt as dg,x9 as dh,a9 as di,ZL as dj,ma as dk,E5 as dl,GE as dm,WE as dn,sq as dp,Hce as dq,JM as dr,QM as ds,zce as dt,zz as du,YM as dv,N9 as dw,T9 as dx,I9 as dy,mae as dz,gn as e,boe as f,Dce as g,Lce as h,BP as i,d6 as j,Qe as k,Xoe as l,K_ as m,oP as n,sae as o,aae as p,xP as q,Ua as r,Vc as s,Rf as t,qP as u,xae as v,sde as w,Aae as x,_ae as y,Mae as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.