1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-lu35bfH-.js","assets/recharts-BP1V14u_.js","assets/jszip-Dj6QSqRp.js","assets/index-Cpvm7ooB.css"])))=>i.map(i=>d[i]); 2var Ls=Object.defineProperty;var Ds=(t,e,r)=>e in t?Ls(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ee=(t,e,r)=>Ds(t,typeof e!="symbol"?e+"":e,r);import{s as W,j as a,a9 as Tt,I as tt,u as Me,b1 as Wt,aH as Or,aI as Pr,aJ as $n,aK as zn,N as Le,aN as Fn,aO as Un,Q as Ke,O as St,H as Dt,aR as at,aP as Hn,b as _r,c as kr,d as wr,e as Tr,f as Sr,V as ke,_ as Bn,W as Gn,k as qs,m as Os,c3 as Ps,aY as Ms,a6 as Wn,b0 as Yn,l as $s,p as dn,x as zs,c4 as Fs,c5 as Us,c6 as Hs,L as rt,h as vr,S as Bs,v as ur,G as pn,aX as Gs,F as Ar,bl as Ws,J as Ys,a8 as Ks,bn as Vs,R as Xs,U as Nt,c7 as Zs,X as Qs,c8 as hn}from"./index-lu35bfH-.js";import{r as N}from"./recharts-BP1V14u_.js";import{T as Er}from"./textarea-BrTmMTCQ.js";import{C as Kn}from"./calendar-B_D_7OSW.js";import{b as Js,c as dr,f as ei}from"./RatesManager-DYCFwjsZ.js";import{t as Vn}from"./bookingFormat-lnrfYxNT.js";import{f as ti,t as qt,a as ri,b as pr,i as ni}from"./imageAnalytics-B_-C2kn4.js";import{u as si}from"./memberAccess-BubGCfDF.js";import{I as ii}from"./info-BcNfa69f.js";import{C as Nr}from"./checkbox-M0Ounu5N.js";import{T as ai}from"./triangle-alert-CPVCdGqw.js";import{c as Xn,a as Zn}from"./contactValidation-upeUioIV.js";import{S as oi}
2from"./SmartImage-DKlHqa9K.js";import{R as Qn,a as Jn}from"./radio-group-zt9J74ea.js";import{e as et,n as li,r as ci,i as ui}from"./inquiryButtons-Cmbh5cBE.js";import{S as di}from"./SimilarModelsRail-CVcpOeAU.js";import{P as pi}from"./plane-ut2KYFZN.js";import{C as Rr}from"./chevron-left-CIcPYjTl.js";import{C as Ir}from"./chevron-right-CPLYn1VZ.js";import"./jszip-Dj6QSqRp.js";import"./endOfMonth-Cy4cDoqF.js";import"./badge-BkT0zbOP.js";import"./plus-CV48nmK1.js";import"./star-BpwD9sNF.js";import"./lock-DiLCbhAE.js";import"./pencil-C3yfETXo.js";import"./trash-2-B1TzmbsI.js";import"./buildInfo-vjnZ047R.js";import"./index-Df4yjaAi.js";import"./circle-BD7xlLA7.js";const mn=(t,e,r)=>t.some(n=>n.city_id===e&&n.start_date<=r&&n.end_date>=r);function hi(t){const{requestedCityId:e,requestedDate:r}=t;if(!e||!r)return"unknown";const n=t.primaryHomeCityId!==null&&t.primaryHomeCityId===e||mn(t.primaryTravelWindows,e,r),s=t.partnerHomeCityId!==null&&t.partnerHomeCityId===e||mn(t.partnerTravelWindows,e,r);return n&&s?"same":"cross"}async function mi(t){const{data:e,error:r}=await W.rpc("get_duo_partner_candidates",{_model_id:t});if(r)throw r;return e??[]}async function fi(t){var c;const e=Array.from(new Set(t.filter(Boolean)));if(e.length===0)return{};const r=new Date().toISOString().slice(0,10),{data:n,error:s}=await W.from("model_travel").select("model_id, city_id, start_date, end_date").in("model_id",e).gte("end_date",r);if(s)throw s;const o={};for(const p of n??[])(o[c=p.model_id]||(o[c]=[])).push({city_id:p.city_id,start_date:p.start_date,end_date:p.end_date});return o}const gi="These models are not available in the same city at this time. If you would like to make this happen, additional fees may need to be covered for flight, travel, and additional time.",xi="I understand additional travel fees may apply.",hr="__not_listed__";function es({primaryModelId:t,primaryHomeCityId:e,requestedDate:r,requestedCityId:n,onChange:s}){const[o,c]=N.useState([]),[p,l]=N.useState(!0),[f,h]=N.useState(""),[b,y]=N.useState(""),[A,g]=N.useState({});N.useEffect(()=>{let q=!0;return l(!0),mi(t).then($=>{if(!q)return;c($);const X=[t,...$.map(te=>te.id)];fi(X).then(te=>{q&&g(te)}).catch(()=>{})}).catch(()=>c([])).finally(()=>q&&l(!1)),()=>{q=!1}},[t]);const P=N.useMemo(()=>o.find(q=>q.id===f)??null,[o,f]),k=r?r.toISOString().slice(0,10):null,ie=N.useMemo(()=>P?hi({primaryHomeCityId:e,partnerHomeCityId:P.home_city_id,primaryTravelWindows:A[t]??[],partnerTravelWindows:A[P.id]??[],requestedCityId:n??null,requestedDate:k}):"unknown",[P,e,A,t,n,k]);return N.useEffect(()=>{let q=null;if(f===hr){const $=b.trim();q=$?{source:"not_listed_text",partnerNameText:$}:null}else P&&(q={source:P.in_linked_group?"linked_group":"unlinked_directory",partnerModelId:P.id,partnerName:P.stage_name,partnerHomeCityId:P.home_city_id});s(q,{status:ie,partnerName:(P==null?void 0:P.stage_name)??null,partnerHomeCityName:(P==null?void 0:P.home_city_name)??null})},[f,b,P,ie]),a.jsxs("div",{className:"space-y-2 rounded-md border border-border/50 bg-muted/30 p-3",children:[a.jsx(Tt,{className:"text-sm font-medium",children:"Duo partner"}),p?a.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading available partnersâ¦"}):a.jsxs("select",{className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:f,onChange:q=>h(q.target.value),children:[a.jsx("option",{value:"",children:"Select a partnerâ¦"}),o.map(q=>a.jsxs("option",{value:q.id,children:[q.stage_name,q.home_city_name?` â ${q.home_city_name}`:"",q.in_linked_group?" (linked)":""]},q.id)),a.jsx("option",{value:hr,children:"Not listed â enter name"})]}),f===hr&&a.jsxs("div",{className:"space-y-1",children:[a.jsx(Tt,{htmlFor:"duo-partner-freetext",className:"text-xs",children:"Partner name"}),a.jsx(tt,{id:"duo-partner-freetext",value:b,onChange:q=>y(q.target.value.slice(0,120)),placeholder:"Their stage name"}),a.jsxs("p",{className:"flex items-start gap-1 text-[11px] text-muted-foreground",children:[a.jsx(ii,{className:"mt-0.5 h-3 w-3"}),"We'll try to match the name to a profile, otherwise we'll pass this through to the team."]})]})]})}function ts({status:t,ack:e,onAckChange:r,partnerName:n,partnerHomeCityName:s}){return t!=="cross"?null:a.jsxs("div",{className:"space-y-2 rounded-md border border-destructive/40 bg-destructive/10 p-3 text-xs",children:[a.jsxs("p",{className:"flex items-start gap-2 text-foreground",children:[a.jsx(ai,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),a.jsxs("span",{children:[gi,n&&s&&a.jsxs("span",{className:"mt-1 block text-muted-foreground",children:[n," is based in ",s,"."]})]})]}),a.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground",children:[a.jsx(Nr,{checked:e,onCheckedChange:o=>r(o===!0)}),a.jsx("span",{children:xi})]})]})}function Mr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var mt=Mr();function rs(t){mt=t}var pt={exec:()=>null};function yt(t){let e=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),s=e[n];return s||(s=t(n),e[n]=s),s}}function Y(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(s,o)=>
vendor: 4,277 bytes, line 2
2{let c=typeof o=="string"?o:o.source;return c=c.replace(Ne.caret,"$1"),r=r.replace(s,c),n},getRegex:()=>new RegExp(r,e)};return n}var bi=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ne={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:yt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:yt(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:yt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:yt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:yt(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:yt(t=>new RegExp(`^ {0,${t}}>`))},yi=/^(?:[ \t]*(?:\n|$))+/,_i=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ki=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ot=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$r=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ns=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ss=Y(ns).replace(/bull/g,$r).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ti=Y(ns).replace(/bull/g,$r).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Si=/^[^\n]+/,Fr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vi=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Fr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ai=Y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,$r).getRegex(),Xt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ur=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ei=Y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n+|$)|</?(tag)(?: +|\\n|/?>
2)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ur).replace("tag",Xt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),is=t=>Y(zr).replace("hr",Ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xt).getRegex(),Ni=is(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ri=is(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/),Ii=Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ri).getRegex(),Hr={blockquote:Ii,code:_i,def:vi,fences:ki,heading:wi,hr:Ot,html:Ei,lheading:ss,list:Ai,newline:yi,paragraph:Ni,table:pt,text:Si},fn=Y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xt).getRegex(),Ci={...Hr,lheading:Ti,table:fn,paragraph:Y(zr).replace("hr",Ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",fn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xt).getRegex()},ji={...Hr,html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ur).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:pt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(zr).replace("hr",Ot).replace("heading",` *#{1,6} *[^ 3]`).replace("lheading",ss).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Li=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Di=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,as=/^( {2,}|\\)\n(?!\s*$)/,qi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vt=/[\p{P}\p{S}]/u,Zt=/[\s\p{P}\p{S}]/u,Br=/[^\s\p{P}\p{S}]/u,Oi=Y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zt).getRegex(),os=/(?!~)[\p{P}\p{S}]/u,Pi=/(?!~)[\s\p{P}\p{S}]/u,Mi=/(?:[^\s\p{P}\p{S}]|~)/u,$i=Y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",bi?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ls=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,zi=Y(ls,"u").replace(/punct/g,vt).getRegex(),Fi=Y(ls,"u").replace(/punct/g,os).getRegex(),cs="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ui=Y(cs,"gu").replace(/notPunctSpace/g,Br).replace(/punctSpace/g,Zt).replace(/punct/g,vt).getRegex(),Hi=Y(cs,"gu").replace(/notPunctSpace/g,Mi).replace(/punctSpace/g,Pi).replace(/punct/g,os).getRegex(),Bi=Y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Br).replace(/punctSpace/g,Zt).replace(/punct/g,vt).getRegex(),Gi=Y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,vt).getRegex(),Wi="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Yi=Y(Wi,"gu").replace(/notPunctSpace/g,Br).replace(/punctSpace/g,Zt).replace(/punct/g,vt).getRegex(),Ki=Y(/\\(punct)/,"gu").replace(/punct/g,vt).getRegex(),Vi=Y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xi=Y(Ur).replace("(?:-->|$)","-->").getRegex(),Zi=Y("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Xi).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Qi=Y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Yt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),us=Y(/^!?\[(label)\]\[(ref)\]/).replace("label",Yt).replace("ref",Fr).getRegex(),ds=Y(/^!?\[(ref)\](?:\[\])?/).replace("ref",Fr).getRegex(),Ji=Y("reflink|nolink(?!\\()","g").replace("reflink",us).replace("nolink",ds).getRegex(),gn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Gr={_backpedal:pt,anyPunctuation:Ki,autolink:Vi,blockSkip:$i,br:as,co
vendor: 15,291 bytes, lines 3-33
3de:Di,del:pt,delLDelim:pt,delRDelim:pt,emStrongLDelim:zi,emStrongRDelimAst:Ui,emStrongRDelimUnd:Bi,escape:Li,link:Qi,nolink:ds,punctuation:Oi,reflink:us,reflinkSearch:Ji,tag:Zi,text:qi,url:pt},ea={...Gr,link:Y(/^!?\[(label)\]\((.*?)\)/).replace("label",Yt).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yt).getRegex()},Cr={...Gr,emStrongRDelimAst:Hi,emStrongLDelim:Fi,delLDelim:Gi,delRDelim:Yi,url:Y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",gn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Y(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",gn).getRegex()},ta={...Cr,br:Y(as).replace("{2,}","*").getRegex(),text:Y(Cr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ht={normal:Hr,gfm:Ci,pedantic:ji},Rt={normal:Gr,gfm:Cr,breaks:ta,pedantic:ea},ra={"&":"&","<":"<",">":">",'"':""","'":"'"},xn=t=>ra[t];function Qe(t,e){if(e){if(Ne.escapeTest.test(t))return t.replace(Ne.escapeReplace,xn)}else if(Ne.escapeTestNoEncode.test(t))return t.replace(Ne.escapeReplaceNoEncode,xn);return t}function bn(t){try{t=encodeURI(t).replace(Ne.percentDecode,"%")}catch{return null}return t}function yn(t,e){var o;let r=t.replace(Ne.findPipe,(c,p,l)=>{let f=!1,h=p;for(;--h>=0&&l[h]==="\\";)f=!f;return f?"|":" |"}),n=r.split(Ne.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!((o=n.at(-1))!=null&&o.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(Ne.slashPipe,"|");return n}function st(t,e,r){let n=t.length;if(n===0)return"";let s=0;for(;s<n;){let o=t.charAt(n-s-1);if(o===e&&!r)s++;else if(o!==e&&r)s++;else break}return t.slice(0,n-s)}function _n(t){let e=t.split(` 4`),r=e.length-1;for(;r>=0&&Ne.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(` 5`)}function na(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function sa(t,e=0){let r=e,n="";for(let s of t)if(s===" "){let o=4-r%4;n+=" ".repeat(o),r+=o}else n+=s,r++;return n}function kn(t,e,r,n,s){let o=e.href,c=e.title||null,p=t[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:c,text:p,tokens:n.inlineTokens(p)};return n.state.inLink=!1,l}function ia(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(` 6`).map(o=>{let c=o.match(r.other.beginningSpace);if(c===null)return o;let[p]=c;return p.length>=s.length?o.slice(s.length):o}).join(` 7`)}var Kt=class{constructor(t){ee(this,"options");ee(this,"rules");ee(this,"lexer");this.options=t||mt}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=this.options.pedantic?e[0]:_n(e[0]),n=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],n=ia(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let n=st(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:st(e[0],` 8`),depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:st(e[0],` 9`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=st(e[0],` 10`).split(` 11`),n="",s="",o=[];for(;r.length>0;){let c=!1,p=[],l;for(l=0;l<r.length;l++)if(this.rules.other.blockquoteStart.test(r[l]))p.push(r[l]),c=!0;else if(!c)p.push(r[l]);else break;r=r.slice(l);let f=p.join(` 12`),h=f.replace(this.rules.other.blockquoteSetextReplace,` 13 $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n} 14${f}`:f,s=s?`${s} 15${h}`:h;let b=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,o,!0),this.lexer.state.top=b,r.length===0)break;let y=o.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let A=y,g=A.raw+` 16`+r.join(` 17`),P=this.blockquote(g);o[o.length-1]=P,n=n.substring(0,n.length-A.raw.length)+P.raw,s=s.substring(0,s.length-A.text.length)+P.text;break}else if((y==null?void 0:y.type)==="list"){let A=y,g=A.raw+` 18`+r.join(` 19`),P=this.list(g);o[o.length-1]=P,n=n.substring(0,n.length-y.raw.length)+P.raw,s=s.substring(0,s.length-A.raw.length)+P.raw,r=g.substring(o.at(-1).raw.length).split(` 20`);continue}}return{type:"blockquote",raw:n,tokens:o,text:s}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),n=r.length>1,s={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let o=this.rules.other.listItemRegex(r),c=!1;for(;t;){let l=!1,f="",h="";if(!(e=o.exec(t))||this.rules.block.hr.test(t))break;f=e[0],t=t.substring(f.length);let b=sa(e[2].split(` 21`,1)[0],e[1].length),y=t.split(` 22`,1)[0],A=!b.trim(),g=0;if(this.options.pedantic?(g=2,h=b.trimStart()):A?g=e[1].length+1:(g=b.search(this.rules.other.nonSpaceChar),g=g>4?1:g,h=b.slice(g),g+=e[1].length),A&&this.rules.other.blankLine.test(y)&&(f+=y+` 23`,t=t.substring(y.length+1),l=!0),!l){let P=this.rules.other.nextBulletRegex(g),k=this.rules.other.hrRegex(g),ie=this.rules.other.fencesBeginRegex(g),q=this.rules.other.headingBeginRegex(g),$=this.rules.other.htmlBeginRegex(g),X=this.rules.other.blockquoteBeginRegex(g);for(;t;){let te=t.split(` 24`,1)[0],H;if(y=te,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),H=y):H=y.replace(this.rules.other.tabCharGlobal," "),ie.test(y)||q.test(y)||$.test(y)||X.test(y)||P.test(y)||k.test(y))break;if(H.search(this.rules.other.nonSpaceChar)>=g||!y.trim())h+=` 25`+H.slice(g);else{if(A||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ie.test(b)||q.test(b)||k.test(b))break;h+=` 26`+y}A=!y.trim(),f+=te+` 27`,t=t.substring(te.length+1),b=H.slice(g)}}s.loose||(c?s.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(c=!0)),s.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),s.raw+=f}let p=s.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]);let f=l.tokens[0];if(l.task&&((f==null?void 0:f.type)==="text"||(f==null?void 0:f.type)==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),f.raw=f.raw.replace(this.rules.other.listReplaceTask,""),f.text=f.text.replace(this.rules.other.listReplaceTask,"");for(let b=this.lexer.inlineQueue.length-1;b>=0;b--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)){this.lexer.inlineQueue[b].src=this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let b={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=b.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=b.raw+l.tokens[0].raw,l.tokens[0].text=b.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(b)):l.tokens.unshift({type:"paragraph",raw:b.raw,text:b.raw,tokens:[b]}):l.tokens.unshift(b)}}else l.task&&(l.task=!1);if(!s.loose){let h=l.tokens.filter(y=>y.type==="space"),b=h.length>0&&h.some(y=>this.rules.other.anyLine.test(y.raw));s.loose=b}}if(s.loose)for(let l of s.items){l.loose=!0;for(let f of l.tokens)f.type==="text"&&(f.type="paragraph")}return s}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=_n(e[0]);return{type:"html",block:!0,raw:r,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:r}}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:st(e[0],` 28`),href:n,title:s}}}table(t){var c;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=yn(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(c=e[3])!=null&&c.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` 29`):[],o={type:"table",raw:st(e[0],` 30`),header:[],align:[],rows:[]};if(r.length===n.length){for(let p of n)this.rules.other.tableAlignRight.test(p)?o.align.push("right"):this.rules.other.tableAlignCenter.test(p)?o.align.push("center"):this.rules.other.tableAlignLeft.test(p)?o.align.push("left"):o.align.push(null);for(let p=0;p<r.length;p++)o.header.push({text:r[p],tokens:this.lexer.inline(r[p]),header:!0,align:o.align[p]});for(let p of s)o.rows.push(yn(p,o.header.length).map((l,f)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[f]})));return o}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:st(e[0],` 31`),depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===` 32`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=st(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=na(e[2],"()");if(o===-2)return;if(o>-1){let c=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,c).trim(),e[3]=""}}let n=e[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],s=o[3])}else s=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),kn(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[n.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return kn(r,s,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,o,c,p=s,l=0,f=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,e=e.slice(-1*t.length+s);(n=f.exec(e))!==null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(c=[...o].length,n[3]||n[4]){p+=c;continue}else if((n[5]||n[6])&&s%3&&!((s+c)%3)){l+=c;continue}if(p-=c,p>0)continue;c=Math.min(c,c+p+l);let h=[...n[0]][0].length,b=t.slice(0,s+n.index+h+c);if(Math.min(s,c)%2){let A=b.slice(1,-1);return{type:"em",raw:b,text:A,tokens:this.lexer.inlineTokens(A)}}let y=b.slice(2,-2);return{type:"strong",raw:b,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,o,c,p=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+s);(n=l.exec(e))!==null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o||(c=[...o].length,c!==s))continue;if(n[3]||n[4]){p+=c;continue}if(p-=c,p>0)continue;c=Math.min(c,c+p);let f=[...n[0]][0].length,h=t.slice(0,s+n.index+f+c),b=h.slice(s,-s);return{type:"del",raw:h,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,n;return e[2]==="@"?(r=e[1],n="mailto:"+r):(r=e[1],n=r),{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let o;do o=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(o!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},We=class jr{constructor(e){ee(this,"tokens");ee(this,"options");ee(this,"state");ee(this,"inlineQueue");ee(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||mt,this.options.tokenizer=this.options.tokenizer||new Kt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Ne,block:Ht.normal,inline:Rt.normal};this.options.pedantic?(r.block=Ht.pedantic,r.inline=Rt.pedantic):this.options.gfm&&(r.block=Ht.gfm,this.options.breaks?r.inline=Rt.breaks:r.inline=Rt.gfm),this.tokenizer.rules=r}static get rules(){return{block:Ht,inline:Rt}}static lex(e,r){return new jr(r).lex(e)}static lexInline(e,r){return new jr(r).inlineTokens(e)}lex(e){e=e.replace(Ne.carriageReturn,` 33`),this.blockTokens(e,this.tokens);for(let r=0;
33r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var o,c,p;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Ne.tabCharGlobal," ").replace(Ne.spaceLine,""));let s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let l;if((c=(o=this.options.extensions)==null?void 0:o.block)!=null&&c.some(h=>(l=h.call({lexer:this},e,r))?(e=e.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let h=r.at(-1);l.raw.length===1&&h!==void 0?h.raw+=` 34`:r.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let h=r.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(` 35`)?"":` 36`)+l.raw,h.text+=` 37`+l.text,this.inlineQueue.at(-1).src=h.text):r.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);let h=r.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(` 38`)?"":` 39`)+l.raw,h.text+=` 40`+l.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},r.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),r.push(l);continue}let f=e;if((p=this.options.extensions)!=null&&p.startBlock){let h=1/0,b=e.slice(1),y;this.options.extensions.startBlock.forEach(A=>{y=A.call({lexer:this},b),typeof y=="number"&&y>=0&&(h=Math.min(h,y))}),h<1/0&&h>=0&&(f=e.substring(0,h+1))}if(this.state.top&&(l=this.tokenizer.paragraph(f))){let h=r.at(-1);n&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(` 41`)?"":` 42`)+l.raw,h.text+=` 43`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):r.push(l),n=f.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);let h=r.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(` 44`)?"":` 45`)+l.raw,h.text+=` 46`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):r.push(l);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var f,h,b,y,A;this.tokenizer.lexer=this;let n=e,s=null;if(this.tokens.links){let g=Object.keys(this.tokens.links);if(g.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)g.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)o=s[2]?s[2].length:0,n=n.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((h=(f=this.options.hooks)==null?void 0:f.emStrongMask)==null?void 0:h.call({lexer:this},n))??n;let c=!1,p="",l=1/0;for(;e;){if(e.length<l)l=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}c||(p=""),c=!1;let g;if((y=(b=this.options.extensions)==null?void 0:b.inline)!=null&&y.some(k=>(g=k.call({lexer:this},e,r))?(e=e.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.escape(e)){e=e.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.tag(e)){e=e.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.link(e)){e=e.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(g.raw.length);let k=r.at(-1);g.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=g.raw,k.text+=g.text):r.push(g);continue}if(g=this.tokenizer.emStrong(e,n,p)){e=e.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.codespan(e)){e=e.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.br(e)){e=e.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.del(e,n,p)){e=e.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.autolink(e)){e=e.substring(g.raw.length),r.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(e))){e=e.substring(g.raw.length),r.push(g);continue}let P=e;if((A=this.options.extensions)!=null&&A.startInline){let k=1/0,ie=e.slice(1),q;this.options.extensions.startInline.forEach($=>{q=$.call({lexer:this},ie),typeof q=="number"&&q>=0&&(k=Math.min(k,q))}),k<1/0&&k>=0&&(P=e.substring(0,k+1))}if(g=this.tokenizer.inlineText(P)){e=e.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(p=g.raw.slice(-1)),c=!0;let k=r.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=g.raw,k.text+=g.text):r.push(g);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return r}infiniteLoopError(e){let r="Infinite loop on byte: "+e;if(this.options.silent)console.error(r);else throw new Error(r)}},Vt=class{constructor(t){ee(this,"options");ee(this,"parser");this.options=t||mt}space(t){return""}code({text:t,lang:e,escaped:r}){var o;let n=(o=(e||"").match(Ne.notSpaceStart))==null?void 0:o[0],s=t.replace(Ne.endingNewline,"")+` 47`;return n?'<pre><code class="language-'+Qe(n)+'">'+(r?s:Qe(s,!0))+`</code></pre> 48`:"<pre><code>"+(r?s:Qe(s,!0))+`</code></pre> 49`}blockquote({tokens:t}){return`<blockquote> 50${this.parser.parse(t)}</blockquote> 51`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}> 52`}hr(t){return`<hr> 53`}list(t){let e=t.ordered,r=t.start,n="";for(let c=0;c<t.items.length;c++){let p=t.items[c];n+=this.listitem(p)}let s=e?"ol":"ul",o=e&&r!==1?' start="'+r+'"':"";return"<"+s+o+`> 54`+n+"</"+s+`> 55`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li> 56`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p> 57`}table(t){let e="",r="";for(let s=0;s<t.header.length;s++)r+=this.tablecell(t.header[s]);e+=this.tablerow({text:r});let n="";for(let s=0;s<t.rows.length;s++){let o=t.rows[s];r="";for(let c=0;c<o.length;c++)r+=this.tablecell(o[c]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table> 58<thead> 59`+e+`</thead> 60`+n+`</table> 61`}tablerow({text:t}){return`<tr> 62${t}</tr> 63`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}> 64`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Qe(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let n=this.parser.parseInline(r),s=bn(t);if(s===null)return n;t=s;let o='<a href="'+t+'"';return e&&(o+=' title="'+Qe(e)+'"'),o+=">"+n+"</a>",o}image({href:t,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let s=bn(t);if(s===null)return Qe(r);t=s;let o=`<img src="${t}" alt="${Qe(r)}"`;return e&&(o+=` title="${Qe(e)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Qe(t.text)}},Wr=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Ye=class Lr{constructor(e){ee(this,"options");ee(this,"renderer");ee(this,"textRenderer");this.options=e||mt,this.options.renderer=this.options.renderer||new Vt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Wr}static parse(e,r){return new Lr(r).parse(e)}static parseInline(e,r){return new Lr(r).parseInline(e)}parse(e){var n,s;this.renderer.parser=this;let r="";for(let o=0;o<e.length;o++){let c=e[o];if((s=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&s[c.type]){let l=c,f=this.options.extensions.renderers[l.type].call({parser:this},l);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=f||"";continue}}let p=c;switch(p.type){case"space":{r+=this.renderer.space(p);break}case"hr":{r+=this.renderer.hr(p);break}case"heading":{r+=this.renderer.heading(p);break}case"code":{r+=this.renderer.code(p);break}case"table":{r+=this.renderer.table(p);break}case"blockquote":{r+=this.renderer.blockquote(p);break}case"list":{r+=this.renderer.list(p);break}case"checkbox":{r+=this.renderer.checkbox(p);break}case"html":{r+=this.renderer.html(p);break}case"def":{r+=this.renderer.def(p);break}case"paragraph":{r+=this.renderer.paragraph(p);break}case"text":{r+=this.renderer.text(p);break}default:{let l='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,r=this.renderer){var s,o;this.renderer.parser=this;let n="";for(let c=0;c<e.length;c++){let p=e[c];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[p.type]){let f=this.options.extensions.renderers[p.type].call({parser:this},p);if(f!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){n+=f||"";continue}}let l=p;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"checkbox":{n+=r.checkbox(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let f='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return n}},Gt,jt=(Gt=class{constructor(t){ee(this,"options");ee(this,"block");this.options=t||mt}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?We.lex:We.lexInline}provideParser(t=this.block){return t?Ye.parse:Ye.parseInline}},ee(Gt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ee(Gt,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Gt),aa=class{constructor(...t){ee(this,"defaults",Mr());ee(this,"options",this.setOptions);ee(this,"parse",this.parseMarkdown(!0));ee(this,"parseInline",this.parseMarkdown(!1));ee(this,"Parser",Ye);ee(this,"Renderer",Vt);ee(this,"TextRenderer",Wr);ee(this,"Lexer",We);ee(this,"Tokenizer",Kt);ee(this,"Hooks",jt);this.use(...t)}walkTokens(t,e){var n,s;let r=[];for(let o of t)switch(r=r.concat(e.call(this,o)),o.type){case"table":{let c=o;for(let p of c.header)r=r.concat(this.walkTokens(p.tokens,e));for(let p of c.rows)for(let l of p)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let c=o;r=r.concat(this.walkTokens(c.items,e));break}default:{let c=o;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[c.type]?this.defaults.extensions.childTokens[c.type].forEach(p=>{let l=c[p].flat(1/0);r=r.concat(this.walkTokens(l,e))}):c.tokens&&(r=r.concat(this.walkTokens(c.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=e.renderers[s.name];o?e.renderers[s.name]=function(...c){let p=s.renderer.apply(this,c);return p===!1&&(p=o.apply(this,c)),p}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[s.level];o?o.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),n.extensions=e),r.renderer){let s=this.defaults.renderer||new Vt(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let c=o,p=r.renderer[c],l=s[c];s[c]=(...f)=>{let h=p.apply(s,f);return h===!1&&(h=l.apply(s,f)),h||""}}n.renderer=s}
vendor: 4,058 bytes, lines 64-65
64if(r.tokenizer){let s=this.defaults.tokenizer||new Kt(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let c=o,p=r.tokenizer[c],l=s[c];s[c]=(...f)=>{let h=p.apply(s,f);return h===!1&&(h=l.apply(s,f)),h}}n.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new jt;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let c=o,p=r.hooks[c],l=s[c];jt.passThroughHooks.has(o)?s[c]=f=>{if(this.defaults.async&&jt.passThroughHooksRespectAsync.has(o))return(async()=>{let b=await p.call(s,f);return l.call(s,b)})();let h=p.call(s,f);return l.call(s,h)}:s[c]=(...f)=>{if(this.defaults.async)return(async()=>{let b=await p.apply(s,f);return b===!1&&(b=await l.apply(s,f)),b})();let h=p.apply(s,f);return h===!1&&(h=l.apply(s,f)),h}}n.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;n.walkTokens=function(c){let p=[];return p.push(o.call(this,c)),s&&(p=p.concat(s.call(this,c))),p}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return We.lex(t,e??this.defaults)}parser(t,e){return Ye.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let n={...r},s={...this.defaults,...n},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let c=s.hooks?await s.hooks.preprocess(e):e,p=await(s.hooks?await s.hooks.provideLexer(t):t?We.lex:We.lexInline)(c,s),l=s.hooks?await s.hooks.processAllTokens(p):p;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let f=await(s.hooks?await s.hooks.provideParser(t):t?Ye.parse:Ye.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(f):f})().catch(o);try{s.hooks&&(e=s.hooks.preprocess(e));let c=(s.hooks?s.hooks.provideLexer(t):t?We.lex:We.lexInline)(e,s);s.hooks&&(c=s.hooks.processAllTokens(c)),s.walkTokens&&this.walkTokens(c,s.walkTokens);let p=(s.hooks?s.hooks.provideParser(t):t?Ye.parse:Ye.parseInline)(c,s);return s.hooks&&(p=s.hooks.postprocess(p)),p}catch(c){return o(c)}}}onError(t,e){return r=>{if(r.message+=` 65Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+Qe(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},ht=new aa;function Q(t,e){return ht.parse(t,e)}Q.options=Q.setOptions=function(t){return ht.setOptions(t),Q.defaults=ht.defaults,rs(Q.defaults),Q};Q.getDefaults=Mr;Q.defaults=mt;Q.use=function(...t){return ht.use(...t),Q.defaults=ht.defaults,rs(Q.defaults),Q};Q.walkTokens=function(t,e){return ht.walkTokens(t,e)};Q.parseInline=ht.parseInline;Q.Parser=Ye;Q.parser=Ye.parse;Q.Renderer=Vt;Q.TextRenderer=Wr;Q.Lexer=We;Q.lexer=We.lex;Q.Tokenizer=Kt;Q.Hooks=jt;Q.parse=Q;Q.options;Q.setOptions;Q.use;Q.walkTokens;Q.parseInline;Ye.parse;We.lex;/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function wn(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function oa(t){if(Array.isArray(t))return t}function la(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,o,c,p=[],l=!0,f=!1;try{if(o=(r=r.call(t)).next,e!==0)for(;!(l=(n=o.call(r)).done)&&(p.push(n.value),p.length!==e);l=!0);}catch(h){f=!0,s=h}finally{try{if(!l&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(f)throw s}}return p}}
vendor: 6,567 bytes, lines 65-66
65function ca(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 66In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ua(t,e){return oa(t)||la(t,e)||da(t,e)||ca()}function da(t,e){if(t){if(typeof t=="string")return wn(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wn(t,e):void 0}}const ps=Object.entries,Tn=Object.setPrototypeOf,pa=Object.isFrozen,ha=Object.getPrototypeOf,ma=Object.getOwnPropertyDescriptor;let we=Object.freeze,Te=Object.seal,wt=Object.create,hs=typeof Reflect<"u"&&Reflect,Dr=hs.apply,qr=hs.construct;we||(we=function(e){return e});Te||(Te=function(e){return e});Dr||(Dr=function(e,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),o=2;o<n;o++)s[o-2]=arguments[o];return e.apply(r,s)});qr||(qr=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return new e(...n)});const _t=pe(Array.prototype.forEach),fa=pe(Array.prototype.lastIndexOf),Sn=pe(Array.prototype.pop),kt=pe(Array.prototype.push),ga=pe(Array.prototype.splice),ot=Array.isArray,Lt=pe(String.prototype.toLowerCase),mr=pe(String.prototype.toString),vn=pe(String.prototype.match),It=pe(String.prototype.replace),An=pe(String.prototype.indexOf),xa=pe(String.prototype.trim),ba=pe(Number.prototype.toString),ya=pe(Boolean.prototype.toString),En=typeof BigInt>"u"?null:pe(BigInt.prototype.toString),Nn=typeof Symbol>"u"?null:pe(Symbol.prototype.toString),ge=pe(Object.prototype.hasOwnProperty),Ct=pe(Object.prototype.toString),fe=pe(RegExp.prototype.test),dt=_a(TypeError);function pe(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return Dr(t,e,n)}}function _a(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return qr(t,r)}}function G(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Lt;if(Tn&&Tn(t,null),!ot(e))return t;let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const o=r(s);o!==s&&(pa(e)||(e[n]=o),s=o)}t[s]=!0}return t}function ka(t){for(let e=0;e<t.length;e++)ge(t,e)||(t[e]=null);return t}function je(t){const e=wt(null);for(const n of ps(t)){var r=ua(n,2);const s=r[0],o=r[1];ge(t,s)&&(ot(o)?e[s]=ka(o):o&&typeof o=="object"&&o.constructor===Object?e[s]=je(o):e[s]=o)}return e}function wa(t){switch(typeof t){case"string":return t;case"number":return ba(t);case"boolean":return ya(t);case"bigint":return En?En(t):"0";case"symbol":return Nn?Nn(t):"Symbol()";case"undefined":return Ct(t);case"function":case"object":{if(t===null)return Ct(t);const e=t,r=Je(e,"toString");if(typeof r=="function"){const n=r(e);return typeof n=="string"?n:Ct(n)}return Ct(t)}default:return Ct(t)}}function Je(t,e){for(;t!==null;){const n=ma(t,e);if(n){if(n.get)return pe(n.get);if(typeof n.value=="function")return pe(n.value)}t=ha(t)}function r(){return null}return r}function Ta(t){try{return fe(t,""),!0}catch{return!1}}const Rn=we(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fr=we(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),gr=we(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Sa=we(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),xr=we(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),va=we(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),In=we(["#text"]),Cn=we(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
66spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),br=we(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),jn=we(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Bt=we(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Aa=Te(/{{[\w\W]*|^[\w\W]*}}/g),Ea=Te(/<%[\w\W]*|^[\w\W]*%>
vendor: 4,621 bytes, line 66
66/g),Na=Te(/\${[\w\W]*/g),Ra=Te(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ia=Te(/^aria-[\-\w]+$/),Ln=Te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ca=Te(/^(?:\w+script|data):/i),ja=Te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),La=Te(/^html$/i),Da=Te(/^[a-z][.\w]*(-[.\w]+)+$/i),Dn=Te(/<[/\w!]/g),qn=Te(/<[/\w]/g),qa=Te(/<\/no(script|embed|frames)/i),Oa=Te(/\/>/i),ze={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Pa=function(){return typeof window>"u"?null:window},Ma=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";r&&r.hasAttribute(s)&&(n=r.getAttribute(s));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},On=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},it=function(e,r,n,s){return ge(e,r)&&ot(e[r])?G(s.base?je(s.base):{},e[r],s.transform):n};function ms(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pa();const e=_=>ms(_);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==ze.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,s=n.currentScript;t.DocumentFragment;const o=t.HTMLTemplateElement,c=t.Node,p=t.Element,l=t.NodeFilter,f=t.NamedNodeMap;f===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,b=t.trustedTypes,y=p.prototype,A=Je(y,"cloneNode"),g=Je(y,"remove"),P=Je(y,"nextSibling"),k=Je(y,"childNodes"),ie=Je(y,"parentNode"),q=Je(y,"shadowRoot"),$=Je(y,"attributes"),X=c&&c.prototype?Je(c.prototype,"nodeType"):null,te=c&&c.prototype?Je(c.prototype,"nodeName"):null;if(typeof o=="function"){const _=r.createElement("template");_.content&&_.content.ownerDocument&&(r=_.content.ownerDocument)}let H,ce="",me,u=!1,Re=0;const Fe=function(){if(Re>0)throw dt('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ue=function(i){Fe(),Re++;try{return H.createHTML(i)}finally{Re--}},De=function(i){Fe(),Re++;try{return H.createScriptURL(i)}finally{Re--}},L=function(){return u||(me=Ma(b,s),u=!0),me},re=r,qe=re.implementation,Se=re.createNodeIterator,z=re.createDocumentFragment,K=re.getElementsByTagName,de=n.importNode;let J=On();e.isSupported=typeof ps=="function"&&typeof ie=="function"&&qe&&qe.createHTMLDocument!==void 0;const Oe=Aa,xe=Ea,v=Na,I=Ra,V=Ia,ve=Ca,be=ja,B=Da;let se=Ln,M=null;const ye=G({},[...Rn,...fr,...gr,...xr,...In]);let w=null;const j=G({},[...Cn,...br,...jn,...Bt]);let R=Object.seal(wt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ne=null,F=null;const U=Object.seal(wt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let _e=!0,$e=!0,m=!1,T=!0,S=!1,C=!0,Z=!1,Ae=!1,ae=null,Ie=null,Ue=!1,He=!1,lt=!1,ct=!1,Yr=!0,Kr=!1;const Vr="user-content-";let Qt=!0,Jt=!1,ft={},Ve=null;const er=G({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Xr=null;const Zr=G({},["audio","video","img","source","image","track"]);let tr=null;const Qr=G({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pt="http://www.w3.org/1998/Math/MathML",Mt="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml";let gt=Xe,rr=!1,nr=null;const xs=G({},[Pt,Mt,Xe],mr),Jr=we(["mi","mo","mn","ms","mtext"]);let sr=G({},Jr);const en=we(["annotation-xml"]);let ir=G({},en);const bs=G({},["title","style","font","a","script"]);let At=null;const ys=["application/xhtml+xml","text/html"],_s="text/html";let oe=null,xt=null;
66const ks=r.createElement("form"),tn=function(i){return i instanceof RegExp||i instanceof Function},ar=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(xt&&xt===i)return;(!i||typeof i!="object")&&(i={}),i=je(i),At=ys.indexOf(i.PARSER_MEDIA_TYPE)===-1?_s:i.PARSER_MEDIA_TYPE,oe=At==="application/xhtml+xml"?mr:Lt,M=it(i,"ALLOWED_TAGS",ye,{transform:oe}),w=it(i,"ALLOWED_ATTR",j,{transform:oe}),nr=it(i,"ALLOWED_NAMESPACES",xs,{transform:mr}),tr=it(i,"ADD_URI_SAFE_ATTR",Qr,{transform:oe,base:Qr}),Xr=it(i,"ADD_DATA_URI_TAGS",Zr,{transform:oe,base:Zr}),Ve=it(i,"FORBID_CONTENTS",er,{transform:oe}),ne=it(i,"FORBID_TAGS",je({}),{transform:oe}),F=it(i,"FORBID_ATTR",je({}),{transform:oe}),ft=ge(i,"USE_PROFILES")?i.USE_PROFILES&&typeof i.USE_PROFILES=="object"?je(i.USE_PROFILES):i.USE_PROFILES:!1,_e=i.ALLOW_ARIA_ATTR!==!1,$e=i.ALLOW_DATA_ATTR!==!1,m=i.ALLOW_UNKNOWN_PROTOCOLS||!1,T=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,S=i.SAFE_FOR_TEMPLATES||!1,C=i.SAFE_FOR_XML!==!1,Z=i.WHOLE_DOCUMENT||!1,He=i.RETURN_DOM||!1,lt=i.RETURN_DOM_FRAGMENT||!1,ct=i.RETURN_TRUSTED_TYPE||!1,Ue=i.FORCE_BODY||!1,Yr=i.SANITIZE_DOM!==!1,Kr=i.SANITIZE_NAMED_PROPS||!1,Qt=i.KEEP_CONTENT!==!1,Jt=i.IN_PLACE||!1,se=Ta(i.ALLOWED_URI_REGEXP)?i.ALLOWED_URI_REGEXP:Ln,gt=typeof i.NAMESPACE=="string"?i.NAMESPACE:Xe,sr=ge(i,"MATHML_TEXT_INTEGRATION_POINTS")&&i.MATHML_TEXT_INTEGRATION_POINTS&&typeof i.MATHML_TEXT_INTEGRATION_POINTS=="object"?je(i.MATHML_TEXT_INTEGRATION_POINTS):G({},Jr),ir=ge(i,"HTML_INTEGRATION_POINTS")&&i.HTML_INTEGRATION_POINTS&&typeof i.HTML_INTEGRATION_POINTS=="object"?je(i.HTML_INTEGRATION_POINTS):G({},en);const d=ge(i,"CUSTOM_ELEMENT_HANDLING")&&i.CUSTOM_ELEMENT_HANDLING&&typeof i.CUSTOM_ELEMENT_HANDLING=="object"?je(i.CUSTOM_ELEMENT_HANDLING):wt(null);if(R=wt(null),ge(d,"tagNameCheck")&&tn(d.tagNameCheck)&&(R.tagNameCheck=d.tagNameCheck),ge(d,"attributeNameCheck")&&tn(d.attributeNameCheck)&&(R.attributeNameCheck=d.attributeNameCheck),ge(d,"allowCustomizedBuiltInElements")&&typeof d.allowCustomizedBuiltInElements=="boolean"&&(R.allowCustomizedBuiltInElements=d.allowCustomizedBuiltInElements),Te(R),S&&($e=!1),lt&&(He=!0),ft&&(M=G({},In),w=wt(null),ft.html===!0&&(G(M,Rn),G(w,Cn)),ft.svg===!0&&(G(M,fr),G(w,br),G(w,Bt)),ft.svgFilters===!0&&(G(M,gr),G(w,br),G(w,Bt)),ft.mathMl===!0&&(G(M,xr),G(w,jn),G(w,Bt))),U.tagCheck=null,U.attributeCheck=null,ge(i,"ADD_TAGS")&&(typeof i.ADD_TAGS=="function"?U.tagCheck=i.ADD_TAGS:ot(i.ADD_TAGS)&&(M===ye&&(M=je(M)),G(M,i.ADD_TAGS,oe))),ge(i,"ADD_ATTR")&&(typeof i.ADD_ATTR=="function"?U.attributeCheck=i.ADD_ATTR:ot(i.ADD_ATTR)&&(w===j&&(w=je(w)),G(w,i.ADD_ATTR,oe))),ge(i,"ADD_URI_SAFE_ATTR")&&ot(i.ADD_URI_SAFE_ATTR)&&G(tr,i.ADD_URI_SAFE_ATTR,oe),ge(i,"FORBID_CONTENTS")&&ot(i.FORBID_CONTENTS)&&(Ve===er&&(Ve=je(Ve)),G(Ve,i.FORBID_CONTENTS,oe)),ge(i,"ADD_FORBID_CONTENTS")&&ot(i.ADD_FORBID_CONTENTS)&&(Ve===er&&(Ve=je(Ve)),G(Ve,i.ADD_FORBID_CONTENTS,oe)),Qt&&(M["#text"]=!0),Z&&G(M,["html","head","body"]),M.table&&(G(M,["tbody"]),delete ne.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const x=H;H=i.TRUSTED_TYPES_POLICY;try{ce=ue("")}catch(E){throw H=x,E}}else i.TRUSTED_TYPES_POLICY===null?(H=void 0,ce=""):(H===void 0&&(H=L()),H&&typeof ce=="string"&&(ce=ue("")));we&&we(i),xt=i},rn=G({},[...fr,...gr,...Sa]),nn=G({},[...xr,...va]),ws=function(i,d,x){return d.namespaceURI===Xe?i==="svg":d.namespaceURI===Pt?i==="svg"&&(x==="annotation-xml"||sr[x]):!!rn[i]},Ts=function(i,d,x){return d.namespaceURI===Xe?i==="math":d.namespaceURI===Mt?i==="math"&&ir[x]:!!nn[i]},Ss=function(i,d,x){return d.namespaceURI===Mt&&!ir[x]||d.namespaceURI===Pt&&!sr[x]?!1:!nn[i]&&(bs[i]||!rn[i])},vs=function(i){let d=ie(i);(!d||!d.tagName)&&(d={namespaceURI:gt,tagName:"template"});const x=Lt(i.tagName),E=Lt(d.tagName);return nr[i.namespaceURI]?i.namespaceURI===Mt?ws(x,d,E):i.namespaceURI===Pt?Ts(x,d,E):i.namespaceURI===Xe?Ss(x,d,E):!!(At==="application/xhtml+xml"&&nr[i.namespaceURI]):!1},nt=function(i){kt(e.removed,{element:i});try{ie(i).removeChild(i)}catch{if(g(i),!ie(i))throw dt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},$t=function(i){or(i);const d=k(i);if(d){const E=[];_t(d,D=>{kt(E,D)}),_t(E,D=>{try{g(D)}catch{}})}const x=$(i);if(x)for(let E=x.length-1;E>=0;--E){const D=x[E],O=D&&D.name;if(typeof O=="string")try{i.removeAttribute(O)}catch{}}},ut=function(i,d){try{kt(e.removed,{attribute:d.getAttributeNode(i),from:d})}catch{kt(e.removed,{attribute:null,from:d})}if(d.removeAttribute(i),i==="is")if(He||lt)try{nt(d)}catch{}else try{d.setAttribute(i,"")}catch{}},As=function(i){const d=$(i);if(d)for(let x=d.length-1;x>=0;--x){const E=d[x],D=E&&E.name;if(!(typeof D!="string"||w[oe(D)]))try{i.removeAttribute(D)}catch{}}},or=function(i){const d=[i];for(;d.length>0;){const x=d.pop();(X?X(x):x.nodeType)===ze.element&&As(x);const D=k(x);if(D)for(let O=D.length-1;O>=0;--O)d.push(D[O])}},Es=function(i){if(!C)return;const d=[i];for(;d.length>0;){const x=d.pop(),E=X?X(x):x.nodeType;if(E===ze.processingInstruction||E===ze.comment&&fe(qn,x.data)){try{g(x)}catch{}continue}if(E===ze.element){const O=x,le=oe(te?te(x):x.nodeName);try{O.hasAttribute&&O.hasAttribute("patchsrc")&&O.removeAttribute("patchsrc"),O.hasAttribute&&O.hasAttribute("for")&&le!=="label"&&le!=="output"&&O.removeAttribute("for")}catch{}}const D=k(x);if(D)for(let O=D.length-1;O>=0;--O)d.push(D[O])}},sn=function(i){let d=null,x=null;if(Ue)i="<remove></remove>"+i;else{const O=vn(i,/^[\r\n\t ]+/);x=O&&O[0]}At==="application/xhtml+xml"&>===Xe&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const E=H?ue(i):i;if(gt===Xe)try{d=new h().parseFromString(E,At)}catch{}if(!d||!d.documentElement){d=qe.createDocument(gt,"template",null);try{d.documentElement.innerHTML=rr?ce:E}catch{}}const D=d.body||d.documentElement;return i&&x&&D.insertBefore(r.createTextNode(x),D.childNodes[0]||null),gt===Xe?K.call(d,Z?"html":"body")[0]:Z?d.documentElement:D},an=function(i){return Se.call(i.ownerDocument||i,i,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},zt=function(i){return i=It(i,Oe," "),i=It(i,xe," "),i=It(i,v," "),i},lr=function(i){var d;i.normalize();const x=Se.call(i.ownerDocument||i,i,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let E=x.nextNode();for(;E;)E.data=zt(E.data),E=x.nextNode();const D=(d=i.querySelectorAll)===null||d===void 0?void 0:d.call(i,"template");D&&_t(D,O=>{bt(O.content)&&lr(O.content)})},Ft=function(i){const d=te?te(i):null;return typeof d!="string"||oe(d)!=="form"?!1:typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||i.attributes!==$(i)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function"||i.nodeType!==X(i)||i.childNodes!==k(i)},bt=function(i){if(!X||typeof i!="object"||i===null)return!1;try{return X(i)===ze.documentFragment}catch{return!1}},Et=function(i){if(!X||typeof i!="object"||i===null)return!1;try{return typeof X(i)=="number"}catch{return!1}};function Ze(_,i,d){_.length!==0&&_t(_,x=>{x.call(e,i,d,xt)})}const Ns=function(i,d){return!!(C&&i.hasChildNodes()&&!Et(i.firstElementChild)&&fe(Dn,i.textContent)&&fe(Dn,i.innerHTML)||C&&i.namespaceURI===Xe&&d==="style"&&Et(i.firstElementChild)||i.nodeType===ze.processingInstruction||C&&i.nodeType===ze.comment&&fe(qn,i.data))},Rs=function(i,d){if(!ne[d]&&cn(d)&&(R.tagNameCheck instanceof RegExp&&fe(R.tagNameCheck,d)||R.tagNameCheck instanceof Function&&R.tagNameCheck(d)))return!1;if(Qt&&!Ve[d]){const x=ie(i),E=k(i);if(E&&x){const D=E.length;for(let O=D-1;O>=0;--O){const le=Jt?E[O]:A(E[O],!0);x.insertBefore(le,P(i))}}}return nt(i),!0},on=function(i,d){if(Ze(J.beforeSanitizeElements,i,null),i!==d&&ie(i)===null)return!0;
66if(Ft(i))return nt(i),!0;const x=oe(te?te(i):i.nodeName);if(Ze(J.uponSanitizeElement,i,{tagName:x,allowedTags:M}),i!==d&&ie(i)===null)return!0;if(Ns(i,x))return nt(i),!0;if(ne[x]||!(U.tagCheck instanceof Function&&U.tagCheck(x))&&!M[x]){const D=Rs(i,x);return D===!1&&Ze(J.afterSanitizeElements,i,null),D}if((X?X(i):i.nodeType)===ze.element&&!vs(i)||(x==="noscript"||x==="noembed"||x==="noframes")&&fe(qa,i.innerHTML))return nt(i),!0;if(S&&i.nodeType===ze.text){const D=zt(i.textContent);i.textContent!==D&&(kt(e.removed,{element:i.cloneNode()}),i.textContent=D)}return Ze(J.afterSanitizeElements,i,null),!1},ln=function(i,d,x){if(F[d]||C&&d==="patchsrc"||C&&d==="for"&&i!=="label"&&i!=="output"||Yr&&(d==="id"||d==="name")&&(x in r||x in ks))return!1;const E=w[d]||U.attributeCheck instanceof Function&&U.attributeCheck(d,i);if(!($e&&fe(I,d))){if(!(_e&&fe(V,d))){if(E){if(!tr[d]){if(!fe(se,It(x,be,""))){if(!((d==="src"||d==="xlink:href"||d==="href")&&i!=="script"&&An(x,"data:")===0&&Xr[i])){if(!(m&&!fe(ve,It(x,be,"")))){if(x)return!1}}}}}else if(!(cn(i)&&(R.tagNameCheck instanceof RegExp&&fe(R.tagNameCheck,i)||R.tagNameCheck instanceof Function&&R.tagNameCheck(i))&&(R.attributeNameCheck instanceof RegExp&&fe(R.attributeNameCheck,d)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(d,i))||d==="is"&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&fe(R.tagNameCheck,x)||R.tagNameCheck instanceof Function&&R.tagNameCheck(x))))return!1}}return!0},Is=G({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),cn=function(i){return!Is[Lt(i)]&&fe(B,i)},Cs=function(i,d,x,E){if(H&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!x)switch(b.getAttributeType(i,d)){case"TrustedHTML":return ue(E);case"TrustedScriptURL":return De(E)}return E},js=function(i,d,x,E){try{x?i.setAttributeNS(x,d,E):i.setAttribute(d,E),Ft(i)?nt(i):Sn(e.removed)}catch{ut(d,i)}},un=function(i){Ze(J.beforeSanitizeAttributes,i,null);const d=i.attributes;if(!d||Ft(i))return;const x={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0};let E=d.length;const D=oe(i.nodeName);for(;E--;){const O=d[E],le=O.name,Ee=O.namespaceURI,Be=O.value,Pe=oe(le),Ge=Be;let Ce=le==="value"?Ge:xa(Ge);if(x.attrName=Pe,x.attrValue=Ce,x.keepAttr=!0,x.forceKeepAttr=void 0,Ze(J.uponSanitizeAttribute,i,x),Ce=x.attrValue,Kr&&(Pe==="id"||Pe==="name")&&An(Ce,Vr)!==0&&(ut(le,i),Ce=Vr+Ce),C&&fe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ce)){ut(le,i);continue}if(Pe==="attributename"&&vn(Ce,"href")){ut(le,i);continue}if(!x.forceKeepAttr){if(!x.keepAttr){ut(le,i);continue}if(!T&&fe(Oa,Ce)){ut(le,i);continue}if(S&&(Ce=zt(Ce)),!ln(D,Pe,Ce)){ut(le,i);continue}Ce=Cs(D,Pe,Ee,Ce),Ce!==Ge&&js(i,le,Ee,Ce)}}Ze(J.afterSanitizeAttributes,i,null)},Ut=function(i){let d=null;const x=an(i);for(Ze(J.beforeSanitizeShadowDOM,i,null);d=x.nextNode();)if(Ze(J.uponSanitizeShadowNode,d,null),on(d,i),un(d),bt(d.content)&&Ut(d.content),(X?X(d):d.nodeType)===ze.element){const D=q(d);bt(D)&&(cr(D),Ut(D))}Ze(J.afterSanitizeShadowDOM,i,null)},cr=function(i){const d=[{node:i,shadow:null}];for(;d.length>0;){const x=d.pop();if(x.shadow){Ut(x.shadow);continue}const E=x.node,O=(X?X(E):E.nodeType)===ze.element,le=k(E);if(le)for(let Ee=le.length-1;Ee>=0;--Ee)d.push({node:le[Ee],shadow:null});if(O){const Ee=te?te(E):null;if(typeof Ee=="string"&&oe(Ee)==="template"){const Be=E.content;bt(Be)&&d.push({node:Be,shadow:null})}}if(O){const Ee=q(E);bt(Ee)&&d.push({node:null,shadow:Ee},{node:Ee,shadow:null})}}};return e.sanitize=function(_){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=null,x=null,E=null,D=null;if(rr=!_,rr&&(_="<!-->"),typeof _!="string"&&!Et(_)&&(_=wa(_),typeof _!="string"))throw dt("dirty is not a string, aborting");if(!e.isSupported)return _;Ae?(M=ae,w=Ie):ar(i),(J.uponSanitizeElement.length>0||J.uponSanitizeAttribute.length>0)&&(M=je(M)),J.uponSanitizeAttribute.length>0&&(w=je(w)),e.removed=[];const O=Jt&&typeof _!="string"&&Et(_);
66if(O){Es(_);const Pe=te?te(_):_.nodeName;if(typeof Pe=="string"){const Ge=oe(Pe);if(!M[Ge]||ne[Ge])throw $t(_),dt("root node is forbidden and cannot be sanitized in-place")}if(Ft(_))throw $t(_),dt("root node is clobbered and cannot be sanitized in-place");try{cr(_)}catch(Ge){throw $t(_),Ge}}else if(Et(_))d=sn("<!---->"),x=d.ownerDocument.importNode(_,!0),x.nodeType===ze.element&&x.nodeName==="BODY"||x.nodeName==="HTML"?d=x:d.appendChild(x),cr(x);else{if(!He&&!S&&!Z&&_.indexOf("<")===-1)return H&&ct?ue(_):_;if(d=sn(_),!d)return He?null:ct?ce:""}d&&Ue&&nt(d.firstChild);const le=O?_:d,Ee=an(le);try{for(;E=Ee.nextNode();)on(E,le),un(E),bt(E.content)&&Ut(E.content)}catch(Pe){throw O&&($t(_),_t(e.removed,Ge=>{Ge.element&&or(Ge.element)})),Pe}if(O)return _t(e.removed,Pe=>{Pe.element&&or(Pe.element)}),S&&lr(_),_;if(He){if(S&&lr(d),lt)for(D=z.call(d.ownerDocument);d.firstChild;)D.appendChild(d.firstChild);else D=d;return(w.shadowroot||w.shadowrootmode)&&(D=de.call(n,D,!0)),D}let Be=Z?d.outerHTML:d.innerHTML;return Z&&M["!doctype"]&&d.ownerDocument&&d.ownerDocument.doctype&&d.ownerDocument.doctype.name&&fe(La,d.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+d.ownerDocument.doctype.name+`> 67`+Be),S&&(Be=zt(Be)),H&&ct?ue(Be):Be},e.setConfig=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ar(_),Ae=!0,ae=M,Ie=w},e.clearConfig=function(){xt=null,Ae=!1,ae=null,Ie=null,H=me,ce=""},e.isValidAttribute=function(_,i,d){xt||ar({});const x=oe(_),E=oe(i);return ln(x,E,d)},e.addHook=function(_,i){typeof i=="function"&&ge(J,_)&&kt(J[_],i)},e.removeHook=function(_,i){if(ge(J,_)){if(i!==void 0){const d=fa(J[_],i);return d===-1?void 0:ga(J[_],d,1)[0]}return Sn(J[_])}},e.removeHooks=function(_){ge(J,_)&&(J[_]=[])},e.removeAllHooks=function(){J=On()},e}var he=ms(),$a=he;he.sanitize.bind(he);he.isSupported;he.addHook.bind(he);he.removeHook.bind(he);he.removeHooks.bind(he);he.removeAllHooks.bind(he);he.setConfig.bind(he);he.clearConfig.bind(he);he.isValidAttribute.bind(he);he.version;he.removed;const za=["p","br","strong","em","b","i","u","ul","ol","li","a","code"],Fa=["href","target","rel"];Q.setOptions({gfm:!0,breaks:!0});function Ua(t){const e=Q.parse(t,{async:!1});return $a.sanitize(e,{ALLOWED_TAGS:za,ALLOWED_ATTR:Fa,ALLOWED_URI_REGEXP:/^(?:https?:|mailto:|tel:)/i}).replace(/<a /g,'<a target="_blank" rel="noopener noreferrer nofollow" ')}function fs({markdown:t,paymentMethods:e,selectable:r=!1,selectedMethod:n,onSelectMethod:s,errorMessage:o}){const c=(t??"").trim().slice(0,2e3),p=(e??[]).map(h=>h.trim()).filter(h=>h.length>0).slice(0,12),l=N.useMemo(()=>c?Ua(c):"",[c]),f=N.useId();return!l&&p.length===0?null:a.jsxs("div",{className:"rounded-md border border-border/60 bg-muted/30 p-3 text-sm space-y-2",children:[l&&a.jsx("div",{className:"prose prose-sm max-w-none text-foreground [&_a]:text-primary [&_a]:underline [&_ul]:list-disc [&_ol]:list-decimal [&_ul]:pl-5 [&_ol]:pl-5",dangerouslySetInnerHTML:{__html:l}}),p.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:r?"Preferred payment method (choose one) *":"Accepted payment methods"}),r?a.jsxs(a.Fragment,{children:[a.jsx(Qn,{value:n??"",onValueChange:h=>s==null?void 0:s(h),className:"grid grid-cols-2 gap-1.5 pt-0.5 sm:grid-cols-3",children:p.map(h=>{const b=`${f}-${h}`;return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Jn,{id:b,value:h}),a.jsx(Tt,{htmlFor:b,className:"cursor-pointer text-xs font-normal",children:h})]},h)})}),o&&a.jsx("p",{className:"text-xs text-destructive",role:"alert",children:o})]}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(h=>a.jsx("span",{className:"inline-flex items-center rounded-full border border-border bg-background px-2.5 py-0.5 text-xs text-foreground",children:h},h))})]})]})}function gs(){const{data:t,isLoading:e}=Me({queryKey:["inquiry-privileged-viewer"],staleTime:6e4,queryFn:async()=>{var l;const{data:r}=await W.auth.getUser(),n=r==null?void 0:r.user;if(!n)return{canSeeGatedInquiryContent:!1};const[s,o]=await Promise.all([W.from("user_roles").select("role").eq("user_id",n.id).limit(1),W.from("member_status").select("status").eq("user_id",n.id).maybeSingle()]),c=Array.isArray(s.data)&&s.data.length>0,p=((l=o.data)==null?void 0:l.status)==="approved";return{canSeeGatedInquiryContent:c||p}}});return{canSeeGatedInquiryContent:!!(t!=null&&t.canSeeGatedInquiryContent),isLoading:e}}function Ha({open:t,onOpenChange:e,modelId:r,modelName:n,modelHomeCityId:s,resolved:o}){const c=o.config,{canSeeGatedInquiryContent:p}=gs(),l=!o.notesMembersOnly||p,f=!o.paymentMethodsMembersOnly||p,[h,b]=N.useState(!1),[y,A]=N.useState(""),[g,P]=N.useState(""),[k,ie]=N.useState(""),[q,$]=N.useState(),[X,te]=N.useState(""),[H,ce]=N.useState(""),[me,u]=N.useState({}),[Re,Fe]=N.useState(""),[ue,De]=N.useState(null),L=f&&o.paymentMethods.length>0,[re,qe]=N.useState(null),[Se,z]=N.useState({status:"unknown",partnerName:null,partnerHomeCityName:null}),[K,de]=N.useState(!1);N.useEffect(()=>{de(!1)},[re,Se.status]);const J=Vn();N.useEffect(()=>{t&&(Wt("inquiry_started",r,{template_id:o.templateId,label:o.buttonLabel}),W.auth.getUser().then(async({data:v})=>
67{if(!v.user)return;const{data:I}=await W.from("member_profiles").select("name, email, phone, city").eq("user_id",v.user.id).maybeSingle();A(V=>V||(I==null?void 0:I.name)||""),P(V=>V||(I==null?void 0:I.email)||v.user.email||""),ie(V=>V||(I==null?void 0:I.phone)||""),ce(V=>V||(I==null?void 0:I.city)||"")}))},[t,r,o.templateId,o.buttonLabel]);const Oe=()=>{A(""),P(""),ie(""),$(void 0),te(""),ce(""),u({}),Fe(""),De(null),qe(null),z({status:"unknown",partnerName:null,partnerHomeCityName:null}),de(!1)},xe=async v=>{var R,ne;v.preventDefault();const I=[],V=c.fields;if(V.name.enabled&&V.name.required&&!y.trim()&&I.push("Name is required"),V.email.enabled){if(V.email.required&&!g.trim())I.push("Email is required");else if(g.trim()){const F=Xn.safeParse(g);F.success||I.push(((R=F.error.issues[0])==null?void 0:R.message)??"Invalid email")}}if(V.phone.enabled){if(V.phone.required&&!k.trim())I.push("Phone is required");else if(k.trim()){const F=Zn.safeParse(k);F.success||I.push(((ne=F.error.issues[0])==null?void 0:ne.message)??"Invalid phone")}}if(V.requested_date.enabled&&V.requested_date.required&&!q&&I.push("Date is required"),V.requested_time.enabled&&V.requested_time.required&&!X&&I.push("Time is required"),V.location.enabled&&V.location.required&&!H.trim()&&I.push("Location is required"),L&&!Re?(De("Please choose a payment method."),I.push("Please choose a payment method.")):De(null),o.duoOnly&&(re?Se.status==="cross"&&!K&&I.push("Please acknowledge the additional travel fees"):I.push("Please choose a duo partner")),c.custom_fields.forEach(F=>{const U=me[F.label];F.required&&(F.type==="checkbox"?U!==!0&&I.push(`${F.label} is required`):F.type==="multi_select"?(!Array.isArray(U)||U.length===0)&&I.push(`${F.label} is required`):F.type==="multi_choice"?(typeof U!="string"||!U.trim())&&I.push(`${F.label} is required`):(typeof U!="string"||!U.trim())&&I.push(`${F.label} is required`))}),I.length){ke.error(I[0]);return}b(!0);const ve=(re==null?void 0:re.source)==="not_listed_text"?re.partnerNameText:re&&"partnerName"in re?re.partnerName:o.partnerName,be=[];c.custom_fields.forEach(F=>{const U=me[F.label];F.type==="checkbox"?U===!0&&be.push(et(F.label,n,ve)):F.type==="multi_select"?Array.isArray(U)&&U.length&&be.push(U.map(_e=>et(String(_e),n,ve)).join(", ")):typeof U=="string"&&U.trim()&&be.push(et(U.trim(),n,ve))});const B=be.join(` 68`),se=crypto.randomUUID(),M=(await Bn(async()=>{const{getCampaignAttribution:F}=await import("./index-lu35bfH-.js").then(U=>U.cK);return{getCampaignAttribution:F}},__vite__mapDeps([0,1,2,3]))).getCampaignAttribution(),{data:ye,error:w}=await W.functions.invoke("submit-inquiry",{body:{inquiryId:se,inquiryType:"booking",sourceCampaignId:M==null?void 0:M.campaignId,sourceRecipientId:M==null?void 0:M.recipientId,payload:{name:y.trim(),email:g.trim(),phone:k.trim(),message:B,modelId:r,requestedDate:q?at(q,"yyyy-MM-dd"):void 0,requestedTime:X||void 0,location:H.trim(),buttonTemplateId:o.templateId,buttonLabel:o.buttonLabel,partnerModelId:re&&"partnerModelId"in re?re.partnerModelId:void 0,partnerNameText:(re==null?void 0:re.source)==="not_listed_text"?re.partnerNameText:void 0,crossCityAcknowledged:Se.status==="cross"?K:void 0,selectedPaymentMethod:L?Re:void 0,customResponses:c.custom_fields.map(F=>{const U=me[F.label];let _e;return F.type==="checkbox"?_e=!!U:F.type==="multi_select"?_e=Array.isArray(U)?U:[]:_e=U??"",{label:F.label,type:F.type,value:_e}})}}});b(!1);const j=ye==null?void 0:ye.error;j==="blocked"?ke.error(Gn):j==="temp_blocked"?ke.error((ye==null?void 0:ye.message)??"Too many requests, try later."):w||ye&&ye.success===!1?ke.error(`Could not send inquiry: ${(w==null?void 0:w.message)??"Please try again."}`):(ke.success("Inquiry saved. We'll be in touch shortly."),Wt("inquiry_submitted",r,{template_id:o.templateId,label:o.buttonLabel}),e(!1),Oe())};return a.jsx(Or,{open:t,onOpenChange:v=>{e(v),v||Oe()},children:a.jsxs(Pr,{className:"max-w-md max-h-[90vh] overflow-y-auto",children:[a.jsx($n,{children:a.jsx(zn,{className:"font-display text-3xl",children:o.inquiryTitle})}),a.jsx(fs,{markdown:l?o.customNotesMarkdown:null,paymentMethods:f?o.paymentMethods:[],selectable:L,selectedMethod:Re,onSelectMethod:v=>{Fe(v),De(null)},errorMessage:ue}),a.jsxs("form",{onSubmit:xe,className:"space-y-4",children:[c.fields.name.enabled&&a.jsxs("div",{children:[a.jsx(Le,{requirement:c.fields.name.required?"required":"optional",children:"Name"}),a.jsx(tt,{value:y,onChange:v=>A(v.target.value),maxLength:100,required:c.fields.name.required})]}),c.fields.email.enabled&&a.jsxs("div",{children:[a.jsx(Le,{requirement:c.fields.email.required?"required":"optional",children:"Email"}),a.jsx(tt,{type:"email",value:g,onChange:v=>P(v.target.value),maxLength:255,required:c.fields.email.required})]}),c.fields.phone.enabled&&a.jsxs("div",{children:[a.jsx(Le,{requirement:c.fields.phone.required?"required":"optional",children:"Phone"}),a.jsx(tt,{type:"tel",value:k,onChange:v=>ie(v.target.value),maxLength:40,required:c.fields.phone.required})]}),(c.fields.requested_date.enabled||c.fields.requested_time.enabled)&&a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.fields.requested_date.enabled&&a.jsxs("div",{children:[a.jsx(Le,{requirement:c.fields.requested_date.required?"required":"optional",children:"Requested date"}),a.jsxs(Fn,{children:[a.jsx(Un,{asChild:!0,children:a.jsxs(Ke,{type:"button",variant:"outline",className:St("w-full justify-start text-left font-normal",!q&&"text-muted-foreground"),children:[a.jsx(Dt,{className:"mr-2 h-4 w-4"}),q?at(q,"PPP"):a.jsx("span",{children:"Pick a date"})]})}),a.jsx(Hn,{className:"w-auto p-0",align:"start",children:a.jsx(Kn,{mode:"single",selected:q,onSelect:v=>$(v??void 0),disabled:v=>v<new Date(new Date().setHours(0,0,0,0)),initialFocus:!0,className:St("p-3 pointer-events-auto")})})]})]}),c.fields.requested_time.enabled&&a.jsxs("div",{children:[a.jsx(Le,{requirement:c.fields.requested_time.required?"required":"optional",children:"Requested time"}),a.jsxs(_r,{value:X,onValueChange:te,children:[a.jsx(kr,{children:a.jsx(wr,{placeholder:"Pick a time"})}),a.jsx(Tr,{className:"max-h-64",children:J.map(v=>a.jsx(Sr,{value:v.value,children:v.label},v.value))})]})]})]}),c.fields.location.enabled&&a.jsxs("div",{children:[a.jsx(Le,{requirement:c.fields.location.required?"required":"optional",children:"Location"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(tt,{value:H,onChange:v=>ce(v.target.value),maxLength:120,placeholder:"City, State",required:c.fields.location.required}),a.jsx("button",{type:"button",onClick:()=>ce("International"),className:"shrink-0 whitespace-nowrap border border-border px-3 text-xs text-muted-foreground hover:text-foreground hover:border-primary/50 transition-colors","aria-label":"Set location to International",children:"International"})]})]}),o.duoOnly&&a.jsx(es,{primaryModelId:r,primaryHomeCityId:s??null,requestedDate:q??null,requestedCityId:null,onChange:(v,I)=>{qe(v),z(I)}}),c.custom_fields.map((v,I)=>{const V=et(v.label||"",n,o.partnerName),ve=et(v.placeholder??"",n,o.partnerName),be=(v.options??[]).map(B=>({raw:B,display:et(B,n,o.partnerName)}));return a.jsxs("div",{children:[a.jsx(Le,{requirement:v.required?"required":"optional",children:V||`Question ${I+1}`}),v.type==="text_short"&&a.jsx(tt,{value:me[v.label]??"",onChange:B=>u(se=>({...se,[v.label]:B.target.value})),maxLength:500,placeholder:ve,required:v.required}),v.type==="text_long"&&a.jsx(Er,{rows:3,value:me[v.label]??"",onChange:B=>u(se=>({...se,[v.label]:B.target.value})),maxLength:5e3,placeholder:ve,required:v.required}),v.type==="dropdown"&&a.jsxs(_r,{value:me[v.label]??"",onValueChange:B=>u(se=>({...se,[v.label]:B})),children:[a.jsx(kr,{children:a.jsx(wr,{placeholder:"Selectâ¦"})}),a.jsx(Tr,{children:be.map(({raw:B,display:se})=>a.jsx(Sr,{value:B,children:se},B))})]}),v.type==="checkbox"&&a.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[a.jsx(Nr,{checked:!!me[v.label],onCheckedChange:B=>u(se=>({...se,[v.label]:B===!0}))}),a.jsx(Tt,{children:"Yes"})]}),v.type==="multi_choice"&&a.jsx(Qn,{value:me[v.label]??"",onValueChange:B=>u(se=>({...se,[v.label]:B})),className:"pt-1 space-y-2",children:be.map(({raw:B,display:se})=>{const M=`${v.label}-${I}-${B}`;return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Jn,{id:M,value:B}),a.jsx(Tt,{htmlFor:M,className:"font-normal cursor-pointer",children:se})]},B)})}),v.type==="multi_select"&&a.jsx("div",{className:"pt-1 space-y-2",children:be.map(({raw:B,display:se})=>{const M=`${v.label}-${I}-${B}`,w=(Array.isArray(me[v.label])?me[v.label]:[]).includes(B);return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Nr,{id:M,checked:w,onCheckedChange:j=>u(R=>{const ne=Array.isArray(R[v.label])?R[v.label]:[],F=j===!0?Array.from(new Set([...ne,B])):ne.filter(U=>U!==B);return{...R,[v.label]:F}})}),a.jsx(Tt,{htmlFor:M,className:"font-normal cursor-pointer",children:se})]},B)})})]},`${v.label}-${I}`)}),o.duoOnly&&a.jsx(ts,{status:Se.status,ack:K,onAckChange:de,partnerName:Se.partnerName,partnerHomeCityName:Se.partnerHomeCityName}),a.jsx(Ke,{type:"submit",disabled:h,className:"w-full bg-gradient-gold text-primary-foreground hover:opacity-90",children:h?"Sendingâ¦":"Send inquiry"})]})]})})}const Ba=["id","slug","stage_name","short_bio","status","is_featured","is_couple","home_city_id","height_cm","hair_color","has_tattoos","tattoos_notes","has_piercings","piercings_n
68otes","bust","waist","hips","cup","dress_size","shoe_size","duo_partner_id","home_city:cities!models_home_city_id_fkey(id,name,slug,region,country)"].join(",");function Eo(){var j,R,ne,F,U,_e,$e;const{slug:t}=qs(),[e]=Os(),[r,n]=N.useState(!1),[s,o]=N.useState("solo"),[c,p]=N.useState(null),[l,f]=N.useState(null),h=N.useMemo(()=>Ps(),[]),b=si(),y=Ms(),A=Wn();Yn();const g=$s(),P=N.useMemo(()=>{const m=e.get("start"),T=e.get("end");if(!m)return;const S=new Date;S.setHours(0,0,0,0);const C=new Date(m+"T00:00:00"),Z=T?new Date(T+"T00:00:00"):C;if(!Number.isNaN(C.getTime())){if(C>=S)return C;if(S<=Z)return S}},[]);N.useEffect(()=>{const m=e.get("utm_source"),T=e.get("action"),S=e.get("n"),C=e.get("book")==="1",Z=e.get("modal");if((C||Z==="booking_inquiry")&&n(!0),S&&m==="travel_notice"&&(T==="profile"||T==="booking")){const Ae=T==="booking"?"booking_clicked":"profile_clicked";W.functions.invoke("record-notification-event",{body:{notificationId:S,eventType:Ae,source:"email"}}).catch(()=>{})}},[]);const{data:k,isLoading:ie,error:q}=Me({queryKey:["model",t,g.join(",")],enabled:!!t,queryFn:async()=>{const{data:m,error:T}=await W.from("models").select(Ba).eq("slug",t).in("status",g).maybeSingle();if(T)throw console.error(`[ModelProfile] base query failed for slug="${t}":`,T.message),T;return m||console.warn(`[ModelProfile] no visible model for slug="${t}" (statuses=${g.join(",")})`),m}}),{data:$=[]}=Me({queryKey:["model-travel",k==null?void 0:k.id],enabled:!!(k!=null&&k.id),queryFn:async()=>{const{data:m}=await W.from("model_travel").select("id, model_id, city_id, start_date, end_date, created_at, lead_days_override, lead_days_override_enabled, synced_from_travel_id, duo_partner_id, duo_group_id, last_manual_notice_sent_at, is_public_visible, has_admin_notes, city:cities(name, slug)").eq("model_id",k.id).gte("end_date",new Date().toISOString().slice(0,10)).order("start_date");return m??[]}}),{data:X=[]}=Me({queryKey:["model-blackouts-public",k==null?void 0:k.id],enabled:!!(k!=null&&k.id),queryFn:()=>ti(k.id),staleTime:1e3*60*2}),te=N.useMemo(()=>{const m=new Set;k!=null&&k.duo_partner_id&&m.add(k.duo_partner_id);for(const T of $)T!=null&&T.duo_partner_id&&m.add(T.duo_partner_id);return Array.from(m)},[k==null?void 0:k.duo_partner_id,$]),{data:H}=Me({queryKey:["model-extra-relations",k==null?void 0:k.id,te.join(",")],enabled:!!(k!=null&&k.id),queryFn:async()=>{const[m,T]=await Promise.all([W.from("model_home_cities").select("sort_order, city:cities(id, name, slug, region, country)").eq("model_id",k.id).order("sort_order"),te.length>0?W.from("models").select("id, slug, stage_name, status").in("id",te):Promise.resolve({data:[],error:null})]);m.error&&console.warn("[ModelProfile] home_cities embed failed:",m.error.message),"error"in T&&T.error&&console.warn("[ModelProfile] partner profiles embed failed:",T.error.message);const S=(T.data??[]).filter(Z=>g.includes(Z.status)),C=k!=null&&k.duo_partner_id?S.find(Z=>Z.id===k.duo_partner_id)??null:null;return{home_cities:m.data??[],duo_partner:C,partner_profiles:S}},staleTime:1e3*60*5}),ce=N.useMemo(()=>{const m=new Map;for(const T of(H==null?void 0:H.partner_profiles)??[])m.set(T.id,T);return m},[H]),me=m=>{if(m){const T=at(m,"yyyy-MM-dd");for(const S of $)if(S!=null&&S.duo_partner_id&&T>=S.start_date&&T<=S.end_date){const C=ce.get(S.duo_partner_id);if(C)return C}}if(k!=null&&k.duo_partner_id){const T=ce.get(k.duo_partner_id);if(T)return T}return null},u=N.useMemo(()=>k?{...k,home_cities:(H==null?void 0:H.home_cities)??[],duo_partner:(H==null?void 0:H.duo_partner)??null}:null,[k,H]),Re=N.useMemo(()=>me(P),[P,k==null?void 0:k.id,ce,$]),Fe=ce.size>0,ue=Re??(Fe?Array.from(ce.values())[0]:null),De=Me({queryKey:["model-media-signed",u==null?void 0:u.id],enabled:!!(u!=null&&u.id),queryFn:async()=>(await dn([u.id],{includeImages:!0}))[u.id]??null,staleTime:1e3*60*5}),L=De.data,re=zs(L,{requested:!!(u!=null&&u.id),isPending:De.isPending,isFetching:De.isFetching,isError:De.isError,isSuccess:De.isSuccess});N.useEffect(()=>{if(!(u!=null&&u.id))return;const m=window.setTimeout(()=>{Fs({modelId:u.id,slug:u.slug,stageName:u.stage_name,thumbUrl:(L==null?void 0:L.coverUrl)??null})},800);return()=>window.clearTimeout(m)},[u==null?void 0:u.id,u==null?void 0:u.slug,u==null?void 0:u.stage_name,L==null?void 0:L.coverUrl]),N.useEffect(()=>{if(!(u!=null&&u.id))return;const m=u.id,T=Date.now();let S=0;const C=()=>{const Z=document.documentElement.scrollHeight-window.innerHeight;if(Z<=0)return;const Ae=Math.min(100,Math.round(window.scrollY/Z*100));Ae>S&&(S=Ae)};return window.addEventListener("scroll",C,{passive:!0}),()=>{window.removeEventListener("scroll",C);const Z=Math.round((Date.now()-T)/1e3);Z>=2&&Us(m,"profile_dwell",{dwell_seconds:Z,max_scroll_pct:S})}},[u==null?void 0:u.id]);const{data:qe}=Me({queryKey:["model-media-signed",(j=u==null?void 0:u.duo_partner)==null?void 0:j.id],enabled:!!((R=u==null?void 0:u.duo_partner)!=null&&R.id)&&g.includes(((ne=u==null?void 0:u.duo_partner)==null?void 0:ne.status)??""),queryFn:async()=>(await dn([u.duo_partner.id],{includeImages:!1}))[u.duo_partner.id]??null,staleTime:1e3*60*5}),{data:Se=[]}=Me({queryKey:["model-tags-public",u==null?void 0:u.id,b.approved,y.isAdmin],enabled:!!(u!=null&&u.id),queryFn:async()=>{const{data:m}=await W.from("model_tags").select("tags(id, name, members_only)").eq("model_id",u.id),T=(m??[]).map(C=>
68C.tags).filter(Boolean);return!!b.approved||!!y.isAdmin?T:T.filter(C=>!C.members_only)}}),{data:z=[]}=Me({queryKey:["model-inquiry-buttons-public",u==null?void 0:u.id,((F=u==null?void 0:u.duo_partner)==null?void 0:F.id)??null,((U=u==null?void 0:u.duo_partner)==null?void 0:U.status)??null,b.userId,b.loading,y.isAdmin],enabled:!!(u!=null&&u.id)&&(!(u!=null&&u.duo_partner_id)||H!==void 0)&&!b.loading,queryFn:async()=>{const{data:m}=await W.from("model_inquiry_buttons").select("*").eq("model_id",u.id).eq("enabled",!0).order("slot"),T=m??[],S=Array.from(new Set(T.map(ae=>ae.template_id).filter(Boolean)));let C=[];if(S.length){const{data:ae}=await W.from("inquiry_button_templates").select("*").in("id",S).eq("is_active",!0);C=(ae??[]).map(Ie=>({...Ie,config:li(Ie.config)}))}const Z=u!=null&&u.duo_partner&&g.includes(u.duo_partner.status)?u.duo_partner.stage_name:null,Ae=!!b.userId||!!y.isAdmin;return T.map(ae=>{const Ie=C.find(He=>He.id===ae.template_id)??null,Ue=!Ie&&ae.action_type_override==="url"&&!!ae.url_override;return!Ie&&!Ue?null:ci(ae,Ie,u.stage_name,Z)}).filter(ae=>!!ae&&(ae.visibility==="public"||Ae))}}),{data:K}=Me({queryKey:["inquiry-button-templates-system"],staleTime:1e3*60*5,queryFn:async()=>{const{data:m}=await W.from("inquiry_button_templates").select("*").in("slug",["system-solo-inquiry","system-duo-inquiry"]),T=m??[];return{solo:T.find(S=>S.slug==="system-solo-inquiry")??null,duo:T.find(S=>S.slug==="system-duo-inquiry")??null}}}),de=N.useMemo(()=>{var Ue,He,lt,ct;const m=((Ue=u==null?void 0:u.stage_name)==null?void 0:Ue.split(" ")[0])??"",T=((He=ue==null?void 0:ue.stage_name)==null?void 0:He.split(" ")[0])??null,S=(K==null?void 0:K.solo)??null,C=(K==null?void 0:K.duo)??null,Z=S?et(S.button_label??"Inquire about {model}",m,null):`Inquire about ${m}`,Ae=S?et(S.inquiry_title??"Inquire about {model}",m,null):null,ae=C?et(T&&((lt=C.button_label_duo)!=null&<.trim())?C.button_label_duo:C.button_label??"Inquire about {model} & partner",m,T):T?`Inquire about ${m} & ${T}`:`Inquire about ${m} & partner`,Ie=C?et(T&&((ct=C.inquiry_title_duo)!=null&&ct.trim())?C.inquiry_title_duo:C.inquiry_title??"Inquire about {model} & partner",m,T):null;return{soloLabel:Z,soloTitle:Ae,duoLabel:ae,duoTitle:Ie}},[u==null?void 0:u.stage_name,ue==null?void 0:ue.stage_name,K]),J=N.useRef(!1);N.useEffect(()=>{J.current||e.get("modal")==="custom_inquiry"&&(!z||z.length===0||(p(z[0]),J.current=!0))},[z,e]);const{data:Oe=[]}=Me({queryKey:["model-profile-nav-fallback"],queryFn:async()=>{const{data:m}=await W.from("models").select("id, slug, stage_name").in("status",g).order("stage_name");return m??[]},staleTime:1e3*60*10}),xe=N.useMemo(()=>{var S;const m=Hs(),T=e.get("from");return(S=m==null?void 0:m.items)!=null&&S.length&&(!T||m.sourceKey===T)?m:Oe.length>0?{sourceKey:"models:fallback",label:"Roster",backLabel:"Back to roster",backPath:"/models",items:Oe.map(C=>({id:C.id,slug:C.slug,name:C.stage_name}))}:null},[Oe,e]),v=N.useMemo(()=>{var C;if(!t||!((C=xe==null?void 0:xe.items)!=null&&C.length))return null;const m=xe.items.findIndex(Z=>Z.slug===t);if(m<0)return null;const T=m>0?xe.items[m-1]:null,S=m<xe.items.length-1?xe.items[m+1]:null;return{previous:T,next:S,index:m,total:xe.items.length}},[xe,t]),{data:I,refetch:V}=Me({queryKey:["member-favorite-model",b.userId,u==null?void 0:u.id],enabled:!!b.userId&&b.approved&&!!(u!=null&&u.id),queryFn:async()=>{const{data:m}=await W.from("member_favorite_models").select("id, notifications_enabled").eq("user_id",b.userId).eq("model_id",u.id).maybeSingle();return m}}),[ve,be]=N.useState(!1),B=async()=>
68{if(!b.userId||!b.approved||!(u!=null&&u.id)||ve)return;be(!0);const m=!!(I!=null&&I.id);try{(m?await W.from("member_favorite_models").delete().eq("id",I.id):await W.from("member_favorite_models").upsert({user_id:b.userId,model_id:u.id,notifications_enabled:!0},{onConflict:"user_id,model_id",ignoreDuplicates:!0})).error?ke.error("Could not update favorites. Please try again."):(ke.success(m?"Removed from favorites":"Added to favorites"),Vs(m?"favorite_removed":"favorite_added",{model_slug:u.slug},{type:"model",id:u.id}),await V(),A.invalidateQueries({queryKey:["member-favorites",b.userId]}))}catch{ke.error("Could not update favorites. Please try again.")}finally{be(!1)}};if(ie)return a.jsx("div",{className:"container pt-32 pb-24 text-muted-foreground",children:"Loadingâ¦"});if(!u){const m=!!q;return a.jsxs("div",{className:"container pt-32 pb-24 space-y-4",children:[a.jsx("h1",{className:"font-display text-4xl",children:m?"Profile unavailable":"Not found"}),a.jsx("p",{className:"text-muted-foreground max-w-prose",children:m?"We couldn't load this profile right now. Please try again in a moment.":"This model isn't available. The link may be out of date or the profile is no longer published."}),a.jsx("div",{className:"tracked-caps",children:a.jsx(rt,{to:"/models",className:"text-primary hover:underline",children:"â Back to roster"})})]})}const se=[["Height",Js(u.height_cm)],["Hair",u.hair_color],["Bust / Waist / Hips",[u.bust,u.waist,u.hips].every(Boolean)?`${dr(u.bust)}" · ${dr(u.waist)}" · ${dr(u.hips)}"`:null],["Cup",u.cup],["Dress",u.dress_size],["Shoe",u.shoe_size],["Tattoos",u.has_tattoos?u.tattoos_notes||"Yes":"None"],["Piercings",u.has_piercings?u.piercings_notes||"Yes":"None"]].filter(([,m])=>m!=null&&m!==""),M=u.home_city?vr(u.home_city):null,ye=M?`${u.stage_name} â ${M}`:u.stage_name,w=(((_e=u.short_bio)==null?void 0:_e.trim())||`Meet ${u.stage_name}${M?`, based in ${M}`:""}, on Porn Companions.`).slice(0,160);return a.jsxs(a.Fragment,{children:[a.jsx(Bs,{title:ye,description:w,image:(L==null?void 0:L.coverUrl)??void 0,canonicalPath:`/models/${u.slug}`,ogType:"profile",jsonLd:[{"@context":"https://schema.org","@type":"Person",name:u.stage_name,url:`${ur}/models/${u.slug}`,...L!=null&&L.coverUrl?{image:L.coverUrl}:{},...M?{homeLocation:{"@type":"Place",name:M}}:{}},{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Roster",item:`${ur}/models`},{"@type":"ListItem",position:2,name:u.stage_name,item:`${ur}/models/${u.slug}`}]}]}),a.jsxs("div",{className:"container pt-24 sm:pt-28 pb-16 sm:pb-24",children:[a.jsx(Pn,{context:xe,nav:v}),a.jsxs("div",{className:"grid lg:grid-cols-[1.1fr_1fr] gap-8 sm:gap-12 mt-6 sm:mt-8",children:[a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"relative aspect-[3/4] bg-card overflow-hidden group",children:L!=null&&L.coverUrl&&((($e=L==null?void 0:L.images)==null?void 0:$e.length)??0)>0?a.jsx("button",{type:"button","aria-label":"Open photo gallery",onClick:()=>{const m=(L==null?void 0:L.images)??[];let T=m.findIndex(C=>C.signedUrl===L.coverUrl);T<0&&(T=0);const S=m[T];S!=null&&S.id&&qt({modelId:u.id,modelImageId:S.id,eventType:"thumbnail_click",pageLoadId:h}),f(T)},className:"block w-full h-full cursor-zoom-in",children:a.jsx(pn,{media:L,mediaState:re,alt:u.stage_name,targetRatio:3/4,priority:!0,width:900,height:1200,sizes:"(min-width: 1024px) 50vw, 100vw",className:"object-cover transition-transform duration-500 group-hover:scale-[1.02]"})}):a.jsx(pn,{media:L,mediaState:re,alt:u.stage_name,targetRatio:3/4,priority:!0,width:900,height:1200,sizes:"(min-width: 1024px) 50vw, 100vw",className:"object-cover"})})}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[u.is_featured&&a.jsx(Mn,{children:"Featured"}),u.is_couple&&a.jsx(Mn,{children:"Duo"}),(()=>{var S;const m=new Date().toISOString().slice(0,10),T=ri(m,X);return T?a.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] tracked-caps rounded-sm border border-destructive/40 bg-destructive/10 text-destructive",children:["Currently unavailable · until ",((S=pr(T).split("â").pop())==null?void 0:S.trim())??pr(T)]}):null})()]}),a.jsx("h1",{className:"font-display text-4xl sm:text-5xl md:text-6xl mb-3 break-words",children:u.stage_name}),(()=>{const m=(u.home_cities??[]).map(S=>S.city?{sort_order:S.sort_order,city:S.city}:null).filter(S=>!!S).sort((S,C)=>S.sort_order-C.sort_order),T=m.length>0?m.map(S=>S.city):u.home_city?[u.home_city]:[];return T.length===0?null:a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-primary mb-6",children:[a.jsx(Gs,{className:"h-4 w-4"}),T.map((S,C)=>a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(rt,{to:`/cities/${S.slug}`,className:"tracked-caps hover:underline",children:S.name?`${S.name}${S.region?`, ${S.region}`:""}`:S.country}),C<T.length-1&&a.jsx("span",{className:"text-primary/50",children:"·"})]},S.id))]})})(),u.duo_partner&&g.includes(u.duo_partner.status)&&a.jsx("div",{className:"mb-6",children:a.jsxs(rt,{to:Ar(u.duo_partner.slug,"duo_partner"),onClick:()=>{W.rpc("record_duo_partner_click",{_partner_model_id:u.duo_partner.id,_partner_slug:u.duo_partner.slug,_partner_label:u.duo_partner.stage_name})},className:"group inline-flex items-stretch gap-3 rounded-md border border-primary/20 bg-primary/5 hover:bg-primary/10 transition-colors overflow-hidden max-w-sm",children:[a.jsx("div",{className:"relative w-20 h-20 shrink-0 bg-muted overflow-hidden",children:qe!=null&&qe.coverUrl?a.jsx("img",{src:qe.coverUrl,alt:u.duo_partner.stage_name,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground text-xs",children:u.duo_partner.stage_name.slice(0,2).toUpperCase()})}),a.jsxs("div",{className:"flex flex-col justify-center pr-4 py-2",children:[a.jsx("span",{className:"tracked-caps text-xs text-muted-foreground",children:"Can do Duo with"}),a.jsx("span",{className:"text-foreground font-medium group-hover:underline",children:u.duo_partner.stage_name})]})]})}
68),u.short_bio&&a.jsx("p",{className:"text-foreground/80 leading-relaxed mb-6",children:u.short_bio}),Se.length>0&&a.jsx("div",{className:"flex flex-wrap gap-2 mb-8",children:Se.map(m=>a.jsx(rt,{to:`/models?tags=${m.id}`,className:m.members_only?"px-2.5 py-1 text-xs tracked-caps border border-destructive/40 text-destructive bg-destructive/5 rounded-sm hover:bg-destructive/10 transition-colors":"px-2.5 py-1 text-xs tracked-caps border border-primary/30 text-primary/90 bg-primary/5 rounded-sm hover:border-primary hover:text-primary transition-colors",children:m.name},m.id))}),a.jsx(Ga,{modelId:u.id}),a.jsxs("div",{className:"flex flex-wrap gap-3 mb-10",children:[a.jsx(Ke,{onClick:()=>{var T;const m=l!==null?(T=L==null?void 0:L.images)==null?void 0:T[l]:null;m!=null&&m.id&&qt({modelId:u.id,modelImageId:m.id,eventType:"booking_cta",pageLoadId:h}),o("solo"),n(!0)},className:"bg-gradient-gold text-primary-foreground hover:opacity-90 px-8",children:de.soloLabel}),(ue||u.is_couple)&&a.jsx(Ke,{type:"button",onClick:()=>{o("duo"),n(!0)},className:"bg-gradient-gold text-primary-foreground hover:opacity-90 px-8",children:de.duoLabel}),z.map(m=>m.actionType==="url"&&ui(m.url)?a.jsx(Ke,{type:"button",variant:"outline",asChild:!0,className:"border-primary text-primary hover:bg-primary/10 px-6",children:a.jsx("a",{href:m.url,target:m.urlOpenInNewTab?"_blank":"_self",rel:"noopener noreferrer",children:m.buttonLabel})},m.slot):a.jsx(Ke,{type:"button",variant:"outline",onClick:()=>p(m),className:"border-primary text-primary hover:bg-primary/10 px-6",children:m.buttonLabel},m.slot)),b.approved&&a.jsxs(Ke,{type:"button",variant:"outline",onClick:B,disabled:ve,"aria-pressed":!!(I!=null&&I.id),className:"gap-2",children:[a.jsx(Ws,{className:St("h-4 w-4",(I==null?void 0:I.id)&&"fill-primary text-primary")}),ve?"Savingâ¦":I!=null&&I.id?"Favorited":"Favorite"]})]}),a.jsx("dl",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-1 sm:gap-y-3 text-sm border-t border-border pt-6",children:se.map(([m,T])=>a.jsxs("div",{className:"flex justify-between gap-3 border-b border-border/50 py-2",children:[a.jsx("dt",{className:"text-muted-foreground flex-shrink-0",children:m}),a.jsx("dd",{className:"text-foreground text-right break-words min-w-0",children:String(T)})]},m))}),$.length>0&&a.jsxs("div",{className:"mt-10",children:[a.jsxs("h2",{className:"luxury-divider mb-4 justify-start",children:[a.jsx(pi,{className:"h-3 w-3"})," Travel schedule"]}),a.jsx("ul",{className:"space-y-2",children:$.map(m=>a.jsxs("li",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1 sm:gap-2 text-sm border-b border-border/50 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Dt,{className:"h-4 w-4 text-primary flex-shrink-0"}),a.jsx(rt,{to:`/cities/${m.city.slug}`,className:"text-foreground hover:text-primary",children:vr(m.city)||"TBA"})]}),a.jsx("span",{className:"text-muted-foreground text-xs sm:text-sm pl-6 sm:pl-0",children:Ys(m.start_date,m.end_date)})]},m.id))})]}),X.length>0&&a.jsxs("div",{className:"mt-10",children:[a.jsxs("h2",{className:"luxury-divider mb-4 justify-start",children:[a.jsx(Dt,{className:"h-3 w-3"})," Unavailable dates"]}),a.jsx("ul",{className:"space-y-2",children:X.map(m=>a.jsxs("li",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1 sm:gap-2 text-sm border-b border-border/50 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(Dt,{className:"h-4 w-4 text-destructive flex-shrink-0"}),a.jsx("span",{children:"Unavailable"})]}),a.jsx("span",{className:"text-muted-foreground text-xs sm:text-sm pl-6 sm:pl-0",children:pr(m)})]},m.id))})]})]})]}),v&&a.jsx(Pn,{context:xe,nav:v,compact:!0,className:"mt-14 sm:mt-20"}),((L==null?void 0:L.images.length)??0)>0&&a.jsxs("section",{className:"mt-16 sm:mt-24",children:[a.jsx("h2",{className:"luxury-divider mb-6 sm:mb-8",children:"Gallery"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2 sm:gap-3",children:L==null?void 0:L.images.map((m,T)=>a.jsx("button",{onClick:()=>{qt({modelId:u.id,modelImageId:m.id,eventType:"thumbnail_click",pageLoadId:h}),f(T)},className:"relative aspect-[3/4] overflow-hidden bg-card group",children:a.jsx(oi,{src:m.signedUrl??"",alt:m.alt??u.stage_name,targetRatio:3/4,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"})},m.id))})]})]}),a.jsxs("div",{className:"container pb-12 space-y-12",children:[a.jsx(di,{seedModelId:u.id,title:"Similar models",navSourceKey:"similar",limit:5,step:5,maxFetch:25}),a.jsx(Ks,{title:"You recently viewed",excludeModelId:u.id})]}),a.jsx(Ka,{modelId:u.id,images:(L==null?void 0:L.images)??[],index:l,onClose:()=>f(null),onIndexChange:f,alt:u.stage_name,pageLoadId:h}),a.jsx(Ya,{open:r,onOpenChange:n,modelId:u.id,modelName:u.stage_name,modelHomeCityId:u.home_city_id??null,travel:$,blackouts:X,defaultDate:P,bookingMode:s,onBookingModeChange:o,anyPartnerAvailable:Fe,duoEligible:u.is_couple===!0,resolvePartnerForDate:me,defaultPartner:ue,soloTitleOverride:de.soloTitle,duoTitleOverride:de.duoTitle,soloTemplate:(K==null?void 0:K.solo)??null,duoTemplate:(K==null?void 0:K.duo)??null}),c&&a.jsx(Ha,{open:!!c,onOpenChange:m=>{m||p(null)},modelId:u.id,modelName:u.stage_name,modelHomeCityId:u.home_city_id??null,resolved:c})]})}function Pn({context:t,nav:e,compact:r=!1,className:n=""}){const s=(t==null?void 0:t.sourceKey)??"models";return a.jsxs("div",{className:St("flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",n),children:[a.jsxs(rt,{to:(t==null?void 0:t.backPath)??"/models",className:"tracked-caps text-primary hover:underline",children:["â ",(t==null?void 0:t.backLabel)??"Back to roster"]}),e&&a.jsxs("div",{className:"flex items-center gap-2 sm:justify-end",children:[!r&&a.jsxs("span",{className:"hidden md:inline text-xs text-muted-foreground tracked-caps",children:[e.index+1," / ",e.total," · ",(t==null?void 0:t.label)??"Roster"]}),a.jsx(Ke,{asChild:!0,variant:"outline",size:"sm",disabled:!e.previous,children:e.previous?a.jsxs(rt,{to:Ar(e.previous.slug,s),"aria-label":`Previous model: ${e.previous.name}`,children:[a.jsx(Rr,{className:"h-4 w-4"})," Previous"]}):a.jsxs("span",{children:[a.jsx(Rr,{className:"h-4 w-4"})," Previous"]})}),a.jsx(Ke,{asChild:!0,variant:"outline",size:"sm",disabled:!e.next,children:e.next?a.jsxs(rt,{to:Ar(e.next.slug,s),"aria-label":`Next model: ${e.next.name}`,children:["Next ",a.jsx(Ir,{className:"h-4 w-4"})]}):a.jsxs("span",{children:["Next ",a.jsx(Ir,{className:"h-4 w-4"})]})})]})]})}const Mn=({children:t})=>a.jsx("span",{className:"px-2 py-1 text-[10px] tracked-caps border border-primary/40 text-primary",children:t});function Ga({modelId:t}){const{data:e}=Yn(),r=Wn(),[n,s]=N.useState(void 0);N.useEffect(()=>{let f=!0;W.auth.getSession().then(({data:b})=>{var y,A;f&&s(((A=(y=b.session)==null?void 0:y.user)==null?void 0:A.id)??null)});const{data:h}=W.auth.onAuthStateChange((b,y)=>{var g;const A=((g=y==null?void 0:y.user)==null?void 0:g.id)??null;s(A),r.invalidateQueries({queryKey:["rates-viewer-access"]}),r.invalidateQueries({queryKey:["model-rates-public"]})});return()=>{f=!1,h.subscription.unsubscribe()}},[r]);const{data:o,isLoading:c}=Me({queryKey:["rates-viewer-access",n??"anon"],enabled:n!==void 0,queryFn:async()=>{var P;const{data:f}=await W.auth.getSession(),h=(P=f.session)==null?void 0:P.user;if(!h)return{loggedIn:!1,approvedMember:!1,admin:!1,canViewRates:!1};const[{data:b},{data:y}]=await Promise.all([W.from("member_status").select("status").eq("user_id",h.id).maybeSingle(),W.rpc("can_access_admin",{_user_id:h.id})]),A=(b==null?void 0:b.status)==="approved",g=y===!0;return{loggedIn:!0,approvedMember:A,admin:g,canViewRates:A||g}}}),{data:p=[],isLoading:l}=Me({queryKey:["model-rates-public",t,o==null?void 0:o.canViewRates],enabled:(o==null?void 0:o.canViewRates)===!0,queryFn:async()=>{const{data:f}=await W.from("model_rates").select("id, duration_label, price, currency, notes, sort_order").eq("model_id",t).order("sort_order");return f??[]}});if(c||o!=null&&o.canViewRates&&l)return null;if(!(o!=null&&o.canViewRates)){const f=o!=null&&o.loggedIn?"Rates are available once your member profile is approved.":"Rates are available to approved members.";return a.jsxs("div",{className:"mb-8 border border-primary/20 bg-primary/5 p-4 text-sm",children:[a.jsx("div",{className:"tracked-caps text-primary mb-1",children:"Rates"}
68),a.jsxs("p",{className:"text-foreground/80",children:[f," ",!(o!=null&&o.loggedIn)&&(e==null?void 0:e.enabled)!==!1&&a.jsxs(a.Fragment,{children:[a.jsx(rt,{to:"/members/login",className:"text-primary hover:underline",children:"Sign in or apply"})," ","to view pricing."]}),!(o!=null&&o.loggedIn)&&(e==null?void 0:e.enabled)===!1?"Member access is temporarily unavailable.":null]})]})}return p.length===0?null:a.jsxs("div",{className:"mb-8",children:[a.jsx("div",{className:"tracked-caps text-primary text-xs mb-3",children:"Rates"}),a.jsx("div",{className:"space-y-1.5 border-t border-border pt-4",children:p.map(f=>a.jsxs("li",{className:"flex items-baseline justify-between gap-3 text-sm border-b border-border/40 py-1.5",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{className:"text-foreground",children:f.duration_label}),f.notes&&a.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:f.notes})]}),a.jsx("span",{className:"text-primary font-medium flex-shrink-0",children:ei(f.price,f.currency)})]},f.id))})]})}const Wa=Xs({name:Nt().trim().min(1,"Name is required").max(100),email:Xn,phone:Zn,requestedDate:Zs({required_error:"Date is required"}),requestedTime:Nt().min(1,"Time is required"),location:Nt().trim().min(1,"Location is required").max(120),referencesText:Nt().trim().max(1e3).optional().or(Qs("")),message:Nt().trim().min(1,"Message is required").max(5e3)}).superRefine((t,e)=>{const r=new Date;if(r.setHours(0,0,0,0),t.requestedDate<r){e.addIssue({code:hn.custom,path:["requestedDate"],message:"Date cannot be in the past"});return}if(t.requestedDate.toDateString()===r.toDateString()&&t.requestedTime){const[s,o]=t.requestedTime.split(":").map(Number),c=new Date;c.setHours(s,o,0,0),c.getTime()<=Date.now()&&e.addIssue({code:hn.custom,path:["requestedTime"],message:"Time cannot be in the past"})}}),yr=(t,e)=>({name:"",email:"",phone:"",requestedDate:void 0,requestedTime:"",location:"",referencesText:"",message:e?`Hi. I would like to inquire about ${t} & ${e}.`:`I would like to inquire about ${t}.`});function Ya({open:t,onOpenChange:e,modelId:r,modelName:n,modelHomeCityId:s,travel:o,blackouts:c,defaultDate:p,bookingMode:l,onBookingModeChange:f,anyPartnerAvailable:h,duoEligible:b,resolvePartnerForDate:y,defaultPartner:A,soloTitleOverride:g,duoTitleOverride:P,soloTemplate:k,duoTemplate:ie}){var ye;const{canSeeGatedInquiryContent:q}=gs(),$=l==="duo"?ie:k,X=($==null?void 0:$.notes_members_only)!==!1,te=($==null?void 0:$.payment_methods_members_only)!==!1,H=!X||q,ce=!te||q,me=H&&((ye=$==null?void 0:$.custom_notes_markdown)!=null&&ye.trim())?$.custom_notes_markdown:null,u=ce&&Array.isArray($==null?void 0:$.payment_methods)?$.payment_methods:[],Re=u.length>0&&ce,[Fe,ue]=N.useState(""),[De,L]=N.useState(null);N.useEffect(()=>{ue(""),L(null)},[l,$==null?void 0:$.id]);const[re,qe]=N.useState(!1),Se=l==="duo"?A:null,[z,K]=N.useState(yr(n,Se==null?void 0:Se.stage_name)),[de,J]=N.useState(null),[Oe,xe]=N.useState({status:"unknown",partnerName:null,partnerHomeCityName:null}),[v,I]=N.useState(!1);N.useEffect(()=>{I(!1)},[de,Oe.status]);const V=l==="duo"?y(z.requestedDate??p)??A:null,ve=Vn(),be=(()=>{if(!z.requestedDate)return ve;const w=new Date;if(w.setHours(0,0,0,0),!(z.requestedDate.toDateString()===w.toDateString()))return ve;const R=new Date;return ve.filter(ne=>{const[F,U]=ne.value.split(":").map(Number),_e=new Date;return _e.setHours(F,U,0,0),_e.getTime()>R.getTime()})})();N.useEffect(()=>{z.requestedTime&&(be.some(w=>w.value===z.requestedTime)||K(w=>({...w,requestedTime:""})))},[z.requestedDate]);const B=w=>{if(!w)return"";const j=at(w,"yyyy-MM-dd"),R=o.find(ne=>j>=ne.start_date&&j<=ne.end_date);return vr(R==null?void 0:R.city)},se=w=>{if(w){const j=at(w,"yyyy-MM-dd"),R=o.find(ne=>j>=ne.start_date&&j<=ne.end_date);if(R!=null&&R.city_id)return R.city_id}return s};N.useEffect(()=>{t&&(Wt("inquiry_started",r),K(w=>({...w,message:l==="duo"&&(A!=null&&A.stage_name)?`Hi. I would like to inquire about ${n} & ${A.stage_name}.`:`I would like to inquire about ${n}.`})),W.auth.getUser().then(async({data:w})=>{if(!w.user)return;const{data:j}
68=await W.from("member_profiles").select("name, email, phone, city, references_text").eq("user_id",w.user.id).maybeSingle();K(R=>{const ne=R.requestedDate??p;return{...R,requestedDate:ne,name:R.name||(j==null?void 0:j.name)||"",email:R.email||(j==null?void 0:j.email)||w.user.email||"",phone:R.phone||(j==null?void 0:j.phone)||"",location:B(ne)||R.location||(j==null?void 0:j.city)||"",referencesText:R.referencesText||(j==null?void 0:j.references_text)||""}})}))},[t,p,l,A==null?void 0:A.stage_name,n,r]);const M=async w=>{var C,Z;w.preventDefault();const j=Wa.safeParse(z);if(!j.success){ke.error(((C=j.error.issues[0])==null?void 0:C.message)??"Please complete all required fields");return}if(l==="duo"){if(!de){ke.error("Please select a duo partner or choose 'Not listed' and enter a name.");return}if(Oe.status==="cross"&&!v){ke.error("Please acknowledge the cross-city travel notice before submitting.");return}}if(Re&&!Fe){L("Please choose a payment method."),ke.error("Please choose a payment method.");return}L(null),qe(!0);const{data:R}=await W.auth.getUser(),ne=((Z=R==null?void 0:R.user)==null?void 0:Z.id)??null;R!=null&&R.user;let F=!1;try{const Ae=j.data.email.toLowerCase(),{data:ae}=await W.from("member_profiles").select("user_id").ilike("email",Ae).maybeSingle(),Ie=(ae==null?void 0:ae.user_id)??ne;if(Ie){const{data:Ue}=await W.from("member_status").select("status").eq("user_id",Ie).maybeSingle();F=(Ue==null?void 0:Ue.status)==="approved"}}catch{}const U=at(j.data.requestedDate,"yyyy-MM-dd"),_e=crypto.randomUUID(),$e=(await Bn(async()=>{const{getCampaignAttribution:Ae}=await import("./index-lu35bfH-.js").then(ae=>ae.cK);return{getCampaignAttribution:Ae}},__vite__mapDeps([0,1,2,3]))).getCampaignAttribution(),{data:m,error:T}=await W.functions.invoke("submit-inquiry",{body:{inquiryId:_e,inquiryType:"booking",sourceCampaignId:$e==null?void 0:$e.campaignId,sourceRecipientId:$e==null?void 0:$e.recipientId,payload:{name:j.data.name,email:j.data.email,phone:j.data.phone||"",message:j.data.message,modelId:r,requestedDate:U,requestedTime:j.data.requestedTime,location:j.data.location,requestedCityId:se(j.data.requestedDate)??void 0,referencesText:j.data.referencesText||"",bookingType:l,partnerModelId:l==="duo"&&de&&de.source!=="not_listed_text"?de.partnerModelId:null,partnerNameText:l==="duo"&&(de==null?void 0:de.source)==="not_listed_text"?de.partnerNameText:null,crossCityAck:l==="duo"?v:!1,selectedPaymentMethod:Re?Fe:void 0}}});qe(!1);const S=m==null?void 0:m.error;S==="blocked"?ke.error(Gn):S==="cross_city_ack_required"?ke.error((m==null?void 0:m.message)??"Please acknowledge the cross-city travel notice for this duo request."):S==="temp_blocked"?ke.error((m==null?void 0:m.message)??"You've sent too many requests recently. Please try again later."):T||m&&m.success===!1?ke.error(`Could not send inquiry: ${(T==null?void 0:T.message)??"Please try again."}`):(ke.success("Inquiry saved. We'll be in touch shortly."),Wt("inquiry_submitted",r),e(!1),K(yr(n,l==="duo"?A==null?void 0:A.stage_name:null)))};return a.jsx(Or,{open:t,onOpenChange:w=>{e(w),w||K(yr(n,l==="duo"?A==null?void 0:A.stage_name:null))},children:a.jsxs(Pr,{className:"max-w-md max-h-[90vh] overflow-y-auto",children:[a.jsx($n,{children:a.jsx(zn,{className:"font-display text-3xl",children:l==="duo"&&V?P||`Inquire about ${n} & ${V.stage_name}`:l==="solo"?g||`Inquire about ${n}`:`Inquire about ${n}`})}),(h||b)&&a.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-sm border border-border bg-muted/30 px-3 py-2 text-xs",children:[a.jsxs("span",{className:"text-muted-foreground",children:["Inquiry type:"," ",a.jsx("span",{className:"font-medium text-foreground",children:l==="duo"?`Duo with ${(V==null?void 0:V.stage_name)??"partner"}`:"Solo"})]}),a.jsxs("button",{type:"button",onClick:()=>f(l==="duo"?"solo":"duo"),className:"text-primary hover:underline",children:["Switch to ",l==="duo"?"solo":"duo"]})]}),l==="duo"&&a.jsx(es,{primaryModelId:r,primaryHomeCityId:s,requestedDate:z.requestedDate??p??null,requestedCityId:se(z.requestedDate??p??void 0),onChange:(w,j)=>{J(w),xe(j)}}),a.jsxs("form",{onSubmit:M,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Le,{children:"Name"}),a.jsx(tt,{required:!0,maxLength:100,value:z.name,onChange:w=>K({...z,name:w.target.value})})]}),a.jsxs("div",{children:[a.jsx(Le,{children:"Email"}),a.jsx(tt,{type:"email",required:!0,maxLength:255,value:z.email,onChange:w=>K({...z,email:w.target.value})})]}),a.jsxs("div",{children:[a.jsx(Le,{children:"Phone"}),a.jsx(tt,{type:"tel",required:!0,maxLength:40,value:z.phone,onChange:w=>K({...z,phone:w.target.value})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx(Le,{children:"Requested date"}),a.jsxs(Fn,{children:[a.jsx(Un,{asChild:!0,children:a.jsxs(Ke,{type:"button",variant:"outline",className:St("w-full justify-start text-left font-normal",!z.requestedDate&&"text-muted-foreground"),children:[a.jsx(Dt,{className:"mr-2 h-4 w-4"}),z.requestedDate?at(z.requestedDate,"PPP"):a.jsx("span",{children:"Pick a date"})]})}),a.jsx(Hn,{className:"w-auto p-0",align:"start",children:a.jsx(Kn,{mode:"single",selected:z.requestedDate,defaultMonth:z.requestedDate??p??void 0,onSelect:w=>{const j=w??void 0,R=B(j);K({...z,requestedDate:j,location:R||z.location})},disabled:w=>{const j=new Date(new Date().setHours(0,0,0,0));return w<j?!0:ni(at(w,"yyyy-MM-dd"),c)},initialFocus:!0,className:St("p-3 pointer-events-auto")})})]})]}),a.jsxs("div",{children:[a.jsx(Le,{children:"Requested time"}),a.jsxs(_r,{value:z.requestedTime,onValueChange:w=>K({...z,requestedTime:w}),children:[a.jsx(kr,{children:a.jsx(wr,{placeholder:"Pick a time"})}),a.jsx(Tr,{className:"max-h-64",children:be.map(w=>a.jsx(Sr,{value:w.value,children:w.label},w.value))})]})]})]}),a.jsxs("div",{children:[a.jsx(Le,{children:"Location"}),a.jsx(tt,{required:!0,maxLength:120,placeholder:"City, State",value:z.location,onChange:w=>K({...z,location:w.target.value})})]}),a.jsxs("div",{children:[a.jsx(Le,{requirement:"optional",children:"References"}),a.jsx(Er,{rows:3,maxLength:1e3,placeholder:"Names and contact info of people who can vouch for you",value:z.referencesText,onChange:w=>K({...z,referencesText:w.target.value})})]}),a.jsxs("div",{children:[a.jsx(Le,{children:"Special notes"}),a.jsx(Er,{required:!0,rows:4,maxLength:5e3,value:z.message,onChange:w=>K({...z,message:w.target.value})})]}),l==="duo"&&a.jsx(ts,{status:Oe.status,ack:v,onAckChange:I,partnerName:Oe.partnerName,partnerHomeCityName:Oe.partnerHomeCityName}),a.jsx(fs,{markdown:me,paymentMethods:u,selectable:Re,selectedMethod:Fe,onSelectMethod:w=>{ue(w),L(null)},errorMessage:De}),a.jsx(Ke,{type:"submit",disabled:re,className:"w-full bg-gradient-gold text-primary-foreground hover:opacity-90",children:re?"Sendingâ¦":"Send inquiry"})]})]})})}function Ka({modelId:t,images:e,index:r,onClose:n,onIndexChange:s,alt:o,pageLoadId:c}){const p=r!==null,l=e.length,f=N.useRef(null),h=y=>{if(r===null||l===0)return;const A=(r+y+l)%l,g=e[A];g!=null&&g.id&&qt({modelId:t,modelImageId:g.id,eventType:y>0?"lightbox_next":"lightbox_previous",pageLoadId:c}),s(A)};N.useEffect(()=>{if(!p)return;const y=A=>{A.key==="ArrowLeft"?(A.preventDefault(),h(-1)):A.key==="ArrowRight"&&(A.preventDefault(),h(1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[p,r,l]);const b=p?e[r]:null;return N.useEffect(()=>{!p||!(b!=null&&b.id)||qt({modelId:t,modelImageId:b.id,eventType:"lightbox_open",pageLoadId:c})},[b==null?void 0:b.id,t,p,c]),a.jsx(Or,{open:p,onOpenChange:y=>!y&&n(),children:a.jsx(Pr,{className:"max-w-6xl bg-background border-border p-2 sm:p-4",children:b&&a.jsxs("div",{className:"relative",onTouchStart:y=>{f.current=y.touches[0].clientX},onTouchEnd:y=>{if(f.current===null)return;const A=y.changedTouches[0].clientX-f.current;f.current=null,Math.abs(A)>50&&h(A<0?1:-1)},children:[a.jsx("img",{src:b.signedUrl??"",alt:b.alt??o,className:"w-full max-h-[85vh] object-contain select-none",draggable:!1}),l>1&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",onClick:()=>h(-1),"aria-label":"Previous image",className:"absolute left-2 sm:left-4 top-1/2 -translate-y-1/2 h-11 w-11 sm:h-12 sm:w-12 flex items-center justify-center rounded-full bg-background/70 backdrop-blur-sm border border-border text-foreground hover:bg-background hover:text-primary transition",children:a.jsx(Rr,{className:"h-6 w-6"})}),a.jsx("button",{type:"button",onClick:()=>h(1),"aria-label":"Next image",className:"absolute right-2 sm:right-4 top-1/2 -translate-y-1/2 h-11 w-11 sm:h-12 sm:w-12 flex items-center justify-center rounded-full bg-background/70 backdrop-blur-sm border border-border text-foreground hover:bg-background hover:text-primary transition",children:a.jsx(Ir,{className:"h-6 w-6"})}),a.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 px-3 py-1 rounded-full bg-background/70 backdrop-blur-sm border border-border text-xs tracked-caps text-foreground
68/80",children:[r+1," / ",l]})]})]})})})}export{Eo as default};
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.