@kizenapps/cli 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-4Z6S6LWP.js +6134 -0
- package/dist/chunk-4Z6S6LWP.js.map +1 -0
- package/dist/chunk-HJPLDI45.js +6134 -0
- package/dist/chunk-HJPLDI45.js.map +1 -0
- package/dist/chunk-LSHHXCC6.js +3639 -0
- package/dist/chunk-LSHHXCC6.js.map +1 -0
- package/dist/chunk-SEGVTWSK.js +44 -0
- package/dist/chunk-SEGVTWSK.js.map +1 -0
- package/dist/chunk-ZWE3DS7E.js +39 -0
- package/dist/chunk-ZWE3DS7E.js.map +1 -0
- package/dist/devtools-LZRAH4XS.js +90 -0
- package/dist/devtools-LZRAH4XS.js.map +1 -0
- package/dist/dist-C3F6UOWF.js +8472 -0
- package/dist/dist-C3F6UOWF.js.map +1 -0
- package/dist/dist-NUJOSN7W.js +8472 -0
- package/dist/dist-NUJOSN7W.js.map +1 -0
- package/dist/dist-QHDMIBVE.js +135 -0
- package/dist/dist-QHDMIBVE.js.map +1 -0
- package/dist/dist-ZIZQOSY3.js +135 -0
- package/dist/dist-ZIZQOSY3.js.map +1 -0
- package/dist/gzip-size-K37OQCQ2.js +137 -0
- package/dist/gzip-size-K37OQCQ2.js.map +1 -0
- package/dist/gzip-size-QRGIYYEQ.js +137 -0
- package/dist/gzip-size-QRGIYYEQ.js.map +1 -0
- package/dist/index.js +575 -552
- package/dist/index.js.map +1 -1
- package/dist/viewer/assets/AppDetailPage-BJrg5Wsz.js +1 -0
- package/dist/viewer/assets/{BootstrapContext-CEWgv2oI.js → BootstrapContext-D3lhzWap.js} +1 -1
- package/dist/viewer/assets/Card-CPMAuqAb.js +1 -0
- package/dist/viewer/assets/ConfigurationPage-D8I8rWjF.js +1 -0
- package/dist/viewer/assets/SandboxPage-ByixszHi.js +1 -0
- package/dist/viewer/assets/{VersionsPage-DOd2Hv8M.js → VersionsPage-BKul6bXI.js} +1 -1
- package/dist/viewer/assets/index-BoSQQwMQ.css +2 -0
- package/dist/viewer/assets/index-Bomh3C3X.js +5 -0
- package/dist/viewer/assets/useObjectLookups-Cx6A7PGj.js +14 -0
- package/dist/viewer/index.html +4 -4
- package/package.json +10 -10
- package/dist/viewer/assets/AppDetailPage-ObugMPkn.js +0 -1
- package/dist/viewer/assets/Card-BSwG5koM.js +0 -1
- package/dist/viewer/assets/ConfigurationPage-SnFNzZgJ.js +0 -1
- package/dist/viewer/assets/SandboxPage-BFVVe-i3.js +0 -1
- package/dist/viewer/assets/configStorage-Bb-A9Nvj.js +0 -14
- package/dist/viewer/assets/index-B-4D4w_w.js +0 -5
- package/dist/viewer/assets/index-D6Un_G7k.css +0 -2
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{D as t,O as n,k as r,m as i}from"./fa-core-mHW_3JUd.js";import{n as a}from"./react-D_K8ni3_.js";import{A as o,M as s,P as c,R as l,a as u,b as d,c as f,d as p,f as m,h,i as g,l as _,m as v,o as y,p as b,s as x,u as S}from"./Card-BSwG5koM.js";import{o as C}from"./BootstrapContext-CEWgv2oI.js";function w(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function T(e,t,n){let r=e.slice(0);return r[t]=n,r}var E=class extends l{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,d.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!c(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(w(e,n).forEach(e=>{e.destroy()}),w(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=s(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new h(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=T(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&d.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},D=e(r(),1);function O({queries:e,...t},n){let r=v(n),i=p(),a=S(),s=D.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);s.forEach(e=>{g(e),x(e,a,r.getQueryCache().get(e.queryHash))}),_(a);let[c]=D.useState(()=>new E(r,s,t)),[l,m,b]=c.getOptimisticResult(s,t.combine),C=!i&&t.subscribed!==!1;D.useSyncExternalStore(D.useCallback(e=>C?c.subscribe(d.batchCalls(e)):o,[c,C]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),D.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let w=l.some((e,t)=>y(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&y(n,e)?u(n,new h(r,n),a):[]}):[];if(w.length>0)throw Promise.all(w);let T=l.find((e,t)=>{let n=s[t];return n&&f({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(T?.error)throw T.error;return m(b())}var k={QUERY_REQUEST:`query:request`,UI_OUTPUT:`outputui`,IFRAME_OUTPUT:`iframeoutput`,POSTFORMDATA_REQUEST:`postformdata:request`,SETSTATE:`setstate`,DONE:`done`,RUN:`run`,OPEN_WINDOW:`openwindow`,COMMUNICATE:`communicate`,HIDE:`hide`,SHOW:`show`,EXPAND:`expand`,COLLAPSE:`collapse`,HIDE_HEADER:`hideheader`,SHOW_HEADER:`showheader`,OPEN_CREATE_RECORD_MODAL_REQUEST:`opencreaterecordmodal:request`,OPEN_CREATE_RELATED_RECORD_MODAL_REQUEST:`opencreaterelatedrecordmodal:request`,SHOW_TOAST:`showtoast`,CLEAR_TOASTS:`cleartoasts`,REFRESH_TIMELINE:`refreshtimeline`,REFRESH_ENTITY:`refreshentity`,UPLOADFILE_REQUEST:`uploadfile:request`,UPDATE_SESSION_DATA:`updatesessiondata`,INSTALL_THIRD_PARTY_SCRIPT_REQUEST:`installthirdpartyscript:request`,PROMPT_REQUEST:`prompt:request`,DYNAMIC_PROMPT_REQUEST:`dynamicprompt:request`,RELEASE_BLOCKING_SCRIPT:`releaseblockingscript`,AUTHORIZE:`authorize`,COPY_TO_CLIPBOARD:`copytoclipboard`},A={QUERY_RESPONSE:`query:response`,POSTFORMDATA_RESPONSE:`postformdata:response`,ERROR:`error`,UPLOADFILE_RESPONSE:`uploadfile:response`,UPLOADFILE_PROGRESS:`uploadfile:progress`,INSTALL_THIRD_PARTY_SCRIPT_RESPONSE:`installthirdpartyscript:response`,PROMPT_RESPONSE:`prompt:response`,REFRESH_ENTITY_RESPONSE:`refreshentity:response`,CREATE_RECORD_RESPONSE:`createrecord:response`,CREATE_RELATED_RECORD_RESPONSE:`createrelatedrecord:response`},j={RUN_FRAME_SCRIPT:`runframescript`,SEND_MESSAGE_TO_FRAME:`sendmessagetoframe`,CALL_THIRD_PARTY_SCRIPT:`callthirdpartyscript`},M=`integration:route-change`,N=`kizen-route-change`,P=`kzn-integration-frame`,F=[`__plugin_engine`,`0.3.1`],I={CALENDAR_SOURCE_CALENDAR_LIST:(e,t)=>[...F,`calendar-source`,`calendar-list`,e,t],CALENDAR_SOURCE_EVENTS:(e,t,n,r)=>[...F,`calendar-source`,`events`,e,t,n,r]},L=/https:\/\/.*widget\.freshworks\.com\/.*\.js/,R=/https:\/\/widget\.intercom\.io\/widget\/[a-z0-9]+/,z={FRESHWORKS:`freshworks`,INTERCOM:`intercom`},B=e=>{if(L.test(e))return z.FRESHWORKS;if(R.test(e))return z.INTERCOM},V={[z.FRESHWORKS]:`FreshworksWidget`,[z.INTERCOM]:`Intercom`},ee={[z.FRESHWORKS]:e=>{window.fwSettings={widget_id:e.widgetId},(function(...e){if(typeof window[V[z.FRESHWORKS]]!=`function`){let t=function(){t.q.push(...e)};t.__kizen_pending=!0,t.q=[],window[V[z.FRESHWORKS]]=t}})()},[z.INTERCOM]:()=>{(function(){if(typeof window[V[z.INTERCOM]]!=`function`){let e=window,t=function(){t.c(arguments)};t.q=[],t.c=function(e){t.q.push(e)},t.__kizen_pending=!0,e[V[z.INTERCOM]]=t}})()}},te={[z.FRESHWORKS]:()=>window[V[z.FRESHWORKS]]?.__kizen_pending!==!0,[z.INTERCOM]:()=>window[V[z.INTERCOM]]?.__kizen_pending!==!0},ne=()=>({host:window.location.host,hash:window.location.hash,href:window.location.href,origin:window.location.origin,pathname:window.location.pathname,search:window.location.search,port:window.location.port,protocol:window.location.protocol}),re=()=>{let e=new Date().getTime();return typeof performance<`u`&&typeof performance.now==`function`&&(e+=performance.now()),`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t===`x`?n:n&3|8).toString(16)})};Object.getPrototypeOf(async function(){}).constructor;var ie=e=>`${e?.plugin_api_name??``}-${e?.id??``}-${e?.api_name??``}-${e?.script_id??``}`,ae=Object.create,oe=Object.defineProperty,H=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyNames,ce=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty,U=(e,t)=>function(){return t||(0,e[se(e)[0]])((t={exports:{}}).exports,t),t.exports},ue=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of se(t))!le.call(e,i)&&i!==n&&oe(e,i,{get:()=>t[i],enumerable:!(r=H(t,i))||r.enumerable});return e},de=(e,t,n)=>(n=e==null?{}:ae(ce(e)),ue(t||!e||!e.__esModule?oe(n,`default`,{value:e,enumerable:!0}):n,e)),{entries:fe,setPrototypeOf:pe,isFrozen:me,getPrototypeOf:he,getOwnPropertyDescriptor:ge}=Object,{freeze:W,seal:G,create:_e}=Object,{apply:ve,construct:K}=typeof Reflect<`u`&&Reflect;W||=function(e){return e},G||=function(e){return e},ve||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},K||=function(e){return new e(...[...arguments].slice(1))};var ye=J(Array.prototype.forEach),be=J(Array.prototype.lastIndexOf),xe=J(Array.prototype.pop),Se=J(Array.prototype.push),Ce=J(Array.prototype.splice),we=J(String.prototype.toLowerCase),Te=J(String.prototype.toString),Ee=J(String.prototype.match),De=J(String.prototype.replace),Oe=J(String.prototype.indexOf),ke=J(String.prototype.trim),Ae=J(Object.prototype.hasOwnProperty),q=J(RegExp.prototype.test),je=Me(TypeError);function J(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ve(e,t,n)}}function Me(e){return function(){return K(e,[...arguments])}}function Y(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:we;pe&&pe(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(me(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ne(e){for(let t=0;t<e.length;t++)Ae(e,t)||(e[t]=null);return e}function Pe(e){let t=_e(null);for(let[n,r]of fe(e))Ae(e,n)&&(Array.isArray(r)?t[n]=Ne(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=Pe(r):t[n]=r);return t}function Fe(e,t){for(;e!==null;){let n=ge(e,t);if(n){if(n.get)return J(n.get);if(typeof n.value==`function`)return J(n.value)}e=he(e)}function n(){return null}return n}var Ie=W(`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`.split(`.`)),Le=W(`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`.split(`.`)),Re=W([`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`]),ze=W([`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`]),Be=W(`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`.split(`.`)),Ve=W([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),He=W([`#text`]),Ue=W(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.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.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),We=W(`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.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-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`.split(`.`)),Ge=W(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.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`.split(`.`)),Ke=W([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),qe=G(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Je=G(/<%[\w\W]*|[\w\W]*%>/gm),Ye=G(/\$\{[\w\W]*/gm),Xe=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ze=G(/^aria-[\-\w]+$/),Qe=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$e=G(/^(?:\w+script|data):/i),et=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tt=G(/^html$/i),nt=G(/^[a-z][.\w]*(-[.\w]+)+$/i),rt=Object.freeze({__proto__:null,ARIA_ATTR:Ze,ATTR_WHITESPACE:et,CUSTOM_ELEMENT:nt,DATA_ATTR:Xe,DOCTYPE_NAME:tt,ERB_EXPR:Je,IS_ALLOWED_URI:Qe,IS_SCRIPT_OR_DATA:$e,MUSTACHE_EXPR:qe,TMPLIT_EXPR:Ye}),it={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},at=function(){return typeof window>`u`?null:window},ot=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},st=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ct(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:at(),t=e=>ct(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==it.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Fe(m,`cloneNode`),g=Fe(m,`remove`),_=Fe(m,`nextSibling`),v=Fe(m,`childNodes`),y=Fe(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=st();t.isSupported=typeof fe==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:O,ERB_EXPR:k,TMPLIT_EXPR:A,DATA_ATTR:j,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:N,ATTR_WHITESPACE:P,CUSTOM_ELEMENT:F}=rt,{IS_ALLOWED_URI:I}=rt,L=null,R=Y({},[...Ie,...Le,...Re,...Be,...He]),z=null,B=Y({},[...Ue,...We,...Ge,...Ke]),V=Object.seal(_e(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}})),ee=null,te=null,ne=Object.seal(_e(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),re=!0,ie=!0,ae=!1,oe=!0,H=!1,se=!0,ce=!1,le=!1,U=!1,ue=!1,de=!1,pe=!1,me=!0,he=!1,ge=!0,G=!1,ve={},K=null,J=Y({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Me=null,Ne=Y({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=Y({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,Xe=`http://www.w3.org/2000/svg`,Ze=`http://www.w3.org/1999/xhtml`,$e=Ze,et=!1,nt=null,lt=Y({},[Ye,Xe,Ze],Te),ut=Y({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),dt=Y({},[`annotation-xml`]),ft=Y({},[`title`,`style`,`font`,`a`,`script`]),pt=null,mt=[`application/xhtml+xml`,`text/html`],X=null,ht=null,gt=n.createElement(`form`),_t=function(e){return e instanceof RegExp||e instanceof Function},vt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ht&&ht===e)){if((!e||typeof e!=`object`)&&(e={}),e=Pe(e),pt=mt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,X=pt===`application/xhtml+xml`?Te:we,L=Ae(e,`ALLOWED_TAGS`)?Y({},e.ALLOWED_TAGS,X):R,z=Ae(e,`ALLOWED_ATTR`)?Y({},e.ALLOWED_ATTR,X):B,nt=Ae(e,`ALLOWED_NAMESPACES`)?Y({},e.ALLOWED_NAMESPACES,Te):lt,qe=Ae(e,`ADD_URI_SAFE_ATTR`)?Y(Pe(Je),e.ADD_URI_SAFE_ATTR,X):Je,Me=Ae(e,`ADD_DATA_URI_TAGS`)?Y(Pe(Ne),e.ADD_DATA_URI_TAGS,X):Ne,K=Ae(e,`FORBID_CONTENTS`)?Y({},e.FORBID_CONTENTS,X):J,ee=Ae(e,`FORBID_TAGS`)?Y({},e.FORBID_TAGS,X):Pe({}),te=Ae(e,`FORBID_ATTR`)?Y({},e.FORBID_ATTR,X):Pe({}),ve=Ae(e,`USE_PROFILES`)?e.USE_PROFILES:!1,re=e.ALLOW_ARIA_ATTR!==!1,ie=e.ALLOW_DATA_ATTR!==!1,ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,oe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=e.SAFE_FOR_TEMPLATES||!1,se=e.SAFE_FOR_XML!==!1,ce=e.WHOLE_DOCUMENT||!1,ue=e.RETURN_DOM||!1,de=e.RETURN_DOM_FRAGMENT||!1,pe=e.RETURN_TRUSTED_TYPE||!1,U=e.FORCE_BODY||!1,me=e.SANITIZE_DOM!==!1,he=e.SANITIZE_NAMED_PROPS||!1,ge=e.KEEP_CONTENT!==!1,G=e.IN_PLACE||!1,I=e.ALLOWED_URI_REGEXP||Qe,$e=e.NAMESPACE||Ze,ut=e.MATHML_TEXT_INTEGRATION_POINTS||ut,dt=e.HTML_INTEGRATION_POINTS||dt,V=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),H&&(ie=!1),de&&(ue=!0),ve&&(L=Y({},He),z=_e(null),ve.html===!0&&(Y(L,Ie),Y(z,Ue)),ve.svg===!0&&(Y(L,Le),Y(z,We),Y(z,Ke)),ve.svgFilters===!0&&(Y(L,Re),Y(z,We),Y(z,Ke)),ve.mathMl===!0&&(Y(L,Be),Y(z,Ge),Y(z,Ke))),Ae(e,`ADD_TAGS`)||(ne.tagCheck=null),Ae(e,`ADD_ATTR`)||(ne.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?ne.tagCheck=e.ADD_TAGS:(L===R&&(L=Pe(L)),Y(L,e.ADD_TAGS,X))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?ne.attributeCheck=e.ADD_ATTR:(z===B&&(z=Pe(z)),Y(z,e.ADD_ATTR,X))),e.ADD_URI_SAFE_ATTR&&Y(qe,e.ADD_URI_SAFE_ATTR,X),e.FORBID_CONTENTS&&(K===J&&(K=Pe(K)),Y(K,e.FORBID_CONTENTS,X)),e.ADD_FORBID_CONTENTS&&(K===J&&(K=Pe(K)),Y(K,e.ADD_FORBID_CONTENTS,X)),ge&&(L[`#text`]=!0),ce&&Y(L,[`html`,`head`,`body`]),L.table&&(Y(L,[`tbody`]),delete ee.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw je(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw je(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=ot(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));W&&W(e),ht=e}},yt=Y({},[...Le,...Re,...ze]),bt=Y({},[...Be,...Ve]),xt=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:$e,tagName:`template`});let n=we(e.tagName),r=we(t.tagName);return nt[e.namespaceURI]?e.namespaceURI===Xe?t.namespaceURI===Ze?n===`svg`:t.namespaceURI===Ye?n===`svg`&&(r===`annotation-xml`||ut[r]):!!yt[n]:e.namespaceURI===Ye?t.namespaceURI===Ze?n===`math`:t.namespaceURI===Xe?n===`math`&&dt[r]:!!bt[n]:e.namespaceURI===Ze?t.namespaceURI===Xe&&!dt[r]||t.namespaceURI===Ye&&!ut[r]?!1:!bt[n]&&(ft[n]||!yt[n]):!!(pt===`application/xhtml+xml`&&nt[e.namespaceURI]):!1},St=function(e){Se(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},Ct=function(e,n){try{Se(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Se(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(ue||de)try{St(n)}catch{}else try{n.setAttribute(e,``)}catch{}},wt=function(e){let t=null,r=null;if(U)e=`<remove></remove>`+e;else{let t=Ee(e,/^[\r\n\t ]+/);r=t&&t[0]}pt===`application/xhtml+xml`&&$e===Ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if($e===Ze)try{t=new f().parseFromString(i,pt)}catch{}if(!t||!t.documentElement){t=S.createDocument($e,`template`,null);try{t.documentElement.innerHTML=et?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),$e===Ze?T.call(t,ce?`html`:`body`)[0]:ce?t.documentElement:a},Tt=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Et=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},Dt=function(e){return typeof s==`function`&&e instanceof s};function Ot(e,n,r){ye(e,e=>{e.call(t,n,r,ht)})}let kt=function(e){let n=null;if(Ot(D.beforeSanitizeElements,e,null),Et(e))return St(e),!0;let r=X(e.nodeName);if(Ot(D.uponSanitizeElement,e,{tagName:r,allowedTags:L}),se&&e.hasChildNodes()&&!Dt(e.firstElementChild)&&q(/<[/\w!]/g,e.innerHTML)&&q(/<[/\w!]/g,e.textContent)||e.nodeType===it.progressingInstruction||se&&e.nodeType===it.comment&&q(/<[/\w]/g,e.data))return St(e),!0;if(!(ne.tagCheck instanceof Function&&ne.tagCheck(r))&&(!L[r]||ee[r])){if(!ee[r]&&jt(r)&&(V.tagNameCheck instanceof RegExp&&q(V.tagNameCheck,r)||V.tagNameCheck instanceof Function&&V.tagNameCheck(r)))return!1;if(ge&&!K[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,_(e))}}}return St(e),!0}return e instanceof c&&!xt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&q(/<\/no(script|embed|frames)/i,e.innerHTML)?(St(e),!0):(H&&e.nodeType===it.text&&(n=e.textContent,ye([O,k,A],e=>{n=De(n,e,` `)}),e.textContent!==n&&(Se(t.removed,{element:e.cloneNode()}),e.textContent=n)),Ot(D.afterSanitizeElements,e,null),!1)},At=function(e,t,r){if(te[t]||me&&(t===`id`||t===`name`)&&(r in n||r in gt))return!1;if(!(ie&&!te[t]&&q(j,t))&&!(re&&q(M,t))&&!(ne.attributeCheck instanceof Function&&ne.attributeCheck(t,e))){if(!z[t]||te[t]){if(!(jt(e)&&(V.tagNameCheck instanceof RegExp&&q(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&q(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t,e))||t===`is`&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&q(V.tagNameCheck,r)||V.tagNameCheck instanceof Function&&V.tagNameCheck(r))))return!1}else if(!qe[t]&&!q(I,De(r,P,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Oe(r,`data:`)===0&&Me[e])&&!(ae&&!q(N,De(r,P,``)))&&r)return!1}return!0},jt=function(e){return e!==`annotation-xml`&&Ee(e,F)},Mt=function(e){Ot(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||Et(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=X(a),l=s,u=a===`value`?l:ke(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,Ot(D.uponSanitizeAttribute,e,r),u=r.attrValue,he&&(c===`id`||c===`name`)&&(Ct(a,e),u=`user-content-`+u),se&&q(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){Ct(a,e);continue}if(c===`attributename`&&Ee(u,`href`)){Ct(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Ct(a,e);continue}if(!oe&&q(/\/>/i,u)){Ct(a,e);continue}H&&ye([O,k,A],e=>{u=De(u,e,` `)});let d=X(e.nodeName);if(!At(d,c,u)){Ct(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),Et(e)?St(e):xe(t.removed)}catch{Ct(a,e)}}Ot(D.afterSanitizeAttributes,e,null)},Nt=function e(t){let n=null,r=Tt(t);for(Ot(D.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Ot(D.uponSanitizeShadowNode,n,null),kt(n),Mt(n),n.content instanceof a&&e(n.content);Ot(D.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(et=!e,et&&(e=`<!-->`),typeof e!=`string`&&!Dt(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw je(`dirty is not a string, aborting`)}else throw je(`toString is not a function`);if(!t.isSupported)return e;if(le||vt(n),t.removed=[],typeof e==`string`&&(G=!1),G){if(e.nodeName){let t=X(e.nodeName);if(!L[t]||ee[t])throw je(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=wt(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===it.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!ue&&!H&&!ce&&e.indexOf(`<`)===-1)return b&&pe?b.createHTML(e):e;if(i=wt(e),!i)return ue?null:pe?x:``}i&&U&&St(i.firstChild);let u=Tt(G?e:i);for(;c=u.nextNode();)kt(c),Mt(c),c.content instanceof a&&Nt(c.content);if(G)return e;if(ue){if(de)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(z.shadowroot||z.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=ce?i.outerHTML:i.innerHTML;return ce&&L[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&q(tt,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
2
|
-
`+d),H&&ye([O,k,A],e=>{d=De(d,e,` `)}),b&&pe?b.createHTML(d):d},t.setConfig=function(){vt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),le=!0},t.clearConfig=function(){ht=null,le=!1},t.isValidAttribute=function(e,t,n){return ht||vt({}),At(X(e),X(t),n)},t.addHook=function(e,t){typeof t==`function`&&Se(D[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=be(D[e],t);return n===-1?void 0:Ce(D[e],n,1)[0]}return xe(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=st()},t}var lt=ct(),ut=U({"node_modules/.pnpm/jsonify@0.0.1/node_modules/jsonify/lib/parse.js"(e,t){var n,r,i={'"':`"`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:`
|
|
3
|
-
`,r:`\r`,t:` `},a;function o(e){throw{name:`SyntaxError`,message:e,at:n,text:a}}function s(e){return e&&e!==r&&o(`Expected '`+e+`' instead of '`+r+`'`),r=a.charAt(n),n+=1,r}function c(){var e,t=``;for(r===`-`&&(t=`-`,s(`-`));r>=`0`&&r<=`9`;)t+=r,s();if(r===`.`)for(t+=`.`;s()&&r>=`0`&&r<=`9`;)t+=r;if(r===`e`||r===`E`)for(t+=r,s(),(r===`-`||r===`+`)&&(t+=r,s());r>=`0`&&r<=`9`;)t+=r,s();return e=Number(t),isFinite(e)||o(`Bad number`),e}function l(){var e,t,n=``,a;if(r===`"`)for(;s();)if(r===`"`)return s(),n;else if(r===`\\`)if(s(),r===`u`){for(a=0,t=0;t<4&&(e=parseInt(s(),16),isFinite(e));t+=1)a=a*16+e;n+=String.fromCharCode(a)}else if(typeof i[r]==`string`)n+=i[r];else break;else n+=r;o(`Bad string`)}function u(){for(;r&&r<=` `;)s()}function d(){switch(r){case`t`:return s(`t`),s(`r`),s(`u`),s(`e`),!0;case`f`:return s(`f`),s(`a`),s(`l`),s(`s`),s(`e`),!1;case`n`:return s(`n`),s(`u`),s(`l`),s(`l`),null;default:o(`Unexpected '`+r+`'`)}}function f(){var e=[];if(r===`[`){if(s(`[`),u(),r===`]`)return s(`]`),e;for(;r;){if(e.push(m()),u(),r===`]`)return s(`]`),e;s(`,`),u()}}o(`Bad array`)}function p(){var e,t={};if(r===`{`){if(s(`{`),u(),r===`}`)return s(`}`),t;for(;r;){if(e=l(),u(),s(`:`),Object.prototype.hasOwnProperty.call(t,e)&&o(`Duplicate key "`+e+`"`),t[e]=m(),u(),r===`}`)return s(`}`),t;s(`,`),u()}}o(`Bad object`)}function m(){switch(u(),r){case`{`:return p();case`[`:return f();case`"`:return l();case`-`:return c();default:return r>=`0`&&r<=`9`?c():d()}}t.exports=function(e,t){var i;return a=e,n=0,r=` `,i=m(),u(),r&&o(`Syntax error`),typeof t==`function`?(function e(n,r){var i,a,o=n[r];if(o&&typeof o==`object`)for(i in m)Object.prototype.hasOwnProperty.call(o,i)&&(a=e(o,i),a===void 0?delete o[i]:o[i]=a);return t.call(n,r,o)})({"":i},``):i}}}),dt=U({"node_modules/.pnpm/jsonify@0.0.1/node_modules/jsonify/lib/stringify.js"(e,t){var n=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r,i,a={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`},o;function s(e){return n.lastIndex=0,n.test(e)?`"`+e.replace(n,function(e){var t=a[e];return typeof t==`string`?t:`\\u`+(`0000`+e.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+e+`"`}function c(e,t){var n,a,l,u,d=r,f,p=t[e];switch(p&&typeof p==`object`&&typeof p.toJSON==`function`&&(p=p.toJSON(e)),typeof o==`function`&&(p=o.call(t,e,p)),typeof p){case`string`:return s(p);case`number`:return isFinite(p)?String(p):`null`;case`boolean`:case`null`:return String(p);case`object`:if(!p)return`null`;if(r+=i,f=[],Object.prototype.toString.apply(p)===`[object Array]`){for(u=p.length,n=0;n<u;n+=1)f[n]=c(n,p)||`null`;return l=f.length===0?`[]`:r?`[
|
|
4
|
-
`+r+f.join(`,
|
|
5
|
-
`+r)+`
|
|
6
|
-
`+d+`]`:`[`+f.join(`,`)+`]`,r=d,l}if(o&&typeof o==`object`)for(u=o.length,n=0;n<u;n+=1)a=o[n],typeof a==`string`&&(l=c(a,p),l&&f.push(s(a)+(r?`: `:`:`)+l));else for(a in p)Object.prototype.hasOwnProperty.call(p,a)&&(l=c(a,p),l&&f.push(s(a)+(r?`: `:`:`)+l));return l=f.length===0?`{}`:r?`{
|
|
7
|
-
`+r+f.join(`,
|
|
8
|
-
`+r)+`
|
|
9
|
-
`+d+`}`:`{`+f.join(`,`)+`}`,r=d,l}}t.exports=function(e,t,n){var a;if(r=``,i=``,typeof n==`number`)for(a=0;a<n;a+=1)i+=` `;else typeof n==`string`&&(i=n);if(o=t,t&&typeof t!=`function`&&(typeof t!=`object`||typeof t.length!=`number`))throw Error(`JSON.stringify`);return c(``,{"":e})}}}),ft=U({"node_modules/.pnpm/jsonify@0.0.1/node_modules/jsonify/index.js"(e){e.parse=ut(),e.stringify=dt()}}),pt=U({"node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/index.js"(e,t){var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)==`[object Array]`}}}),mt=U({"node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js"(e,t){var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r=t===`[object Arguments]`;return r||=t!==`[object Array]`&&typeof e==`object`&&!!e&&typeof e.length==`number`&&e.length>=0&&n.call(e.callee)===`[object Function]`,r}}}),X=U({"node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js"(e,t){var n;Object.keys||(r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=mt(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},`toString`),c=o.call(function(){},`prototype`),l=[`toString`,`toLocaleString`,`valueOf`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`constructor`],u=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=(function(){if(typeof window>`u`)return!1;for(var e in window)try{if(!d[`$`+e]&&r.call(window,e)&&window[e]!==null&&typeof window[e]==`object`)try{u(window[e])}catch{return!0}}catch{return!0}return!1})(),p=function(e){if(typeof window>`u`||!f)return u(e);try{return u(e)}catch{return!1}},n=function(e){var t=typeof e==`object`&&!!e,n=i.call(e)===`[object Function]`,o=a(e),u=t&&i.call(e)===`[object String]`,d=[];if(!t&&!n&&!o)throw TypeError(`Object.keys called on a non-object`);var f=c&&n;if(u&&e.length>0&&!r.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(o&&e.length>0)for(var h=0;h<e.length;++h)d.push(String(h));else for(var g in e)!(f&&g===`prototype`)&&r.call(e,g)&&d.push(String(g));if(s)for(var _=p(e),v=0;v<l.length;++v)!(_&&l[v]===`constructor`)&&r.call(e,l[v])&&d.push(l[v]);return d});var r,i,a,o,s,c,l,u,d,f,p;t.exports=n}}),ht=U({"node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js"(e,t){var n=Array.prototype.slice,r=mt(),i=Object.keys,a=i?function(e){return i(e)}:X(),o=Object.keys;a.shim=function(){return Object.keys?(function(){var e=Object.keys(arguments);return e&&e.length===arguments.length})(1,2)||(Object.keys=function(e){return r(e)?o(n.call(e)):o(e)}):Object.keys=a,Object.keys||a},t.exports=a}}),gt=U({"node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(e,t){t.exports=Object}}),_t=U({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(e,t){t.exports=Error}}),vt=U({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(e,t){t.exports=EvalError}}),yt=U({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(e,t){t.exports=RangeError}}),bt=U({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(e,t){t.exports=ReferenceError}}),xt=U({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(e,t){t.exports=SyntaxError}}),St=U({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(e,t){t.exports=TypeError}}),Ct=U({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(e,t){t.exports=URIError}}),wt=U({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(e,t){t.exports=Math.abs}}),Tt=U({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(e,t){t.exports=Math.floor}}),Et=U({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(e,t){t.exports=Math.max}}),Dt=U({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(e,t){t.exports=Math.min}}),Ot=U({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(e,t){t.exports=Math.pow}}),kt=U({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(e,t){t.exports=Math.round}}),At=U({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(e,t){t.exports=Number.isNaN||function(e){return e!==e}}}),jt=U({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(e,t){var n=At();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}}}),Mt=U({"node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(e,t){t.exports=Object.getOwnPropertyDescriptor}}),Nt=U({"node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(e,t){var n=Mt();if(n)try{n([],`length`)}catch{n=null}t.exports=n}}),Pt=U({"node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(e,t){var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n}}),Ft=U({"node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(e,t){t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}}}),It=U({"node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(e,t){var n=typeof Symbol<`u`&&Symbol,r=Ft();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}}}),Lt=U({"node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(e,t){t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null}}),Rt=U({"node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(e,t){t.exports=gt().getPrototypeOf||null}}),zt=U({"node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(e,t){var n=`Function.prototype.bind called on incompatible `,r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(n+t);for(var l=s(arguments,1),u,d=function(){if(this instanceof u){var n=t.apply(this,o(l,arguments));return Object(n)===n?n:this}return t.apply(e,o(l,arguments))},f=i(0,t.length-l.length),p=[],m=0;m<f;m++)p[m]=`$`+m;if(u=Function(`binder`,`return function (`+c(p,`,`)+`){ return binder.apply(this,arguments); }`)(d),t.prototype){var h=function(){};h.prototype=t.prototype,u.prototype=new h,h.prototype=null}return u}}}),Bt=U({"node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(e,t){var n=zt();t.exports=Function.prototype.bind||n}}),Vt=U({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(e,t){t.exports=Function.prototype.call}}),Ht=U({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(e,t){t.exports=Function.prototype.apply}}),Ut=U({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(e,t){t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply}}),Wt=U({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(e,t){var n=Bt(),r=Ht(),i=Vt();t.exports=Ut()||n.call(i,r)}}),Gt=U({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(e,t){var n=Bt(),r=St(),i=Vt(),a=Wt();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}}}),Kt=U({"node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(e,t){var n=Gt(),r=Nt(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`?(function(e){return s(e==null?e:o(e))}):!1}}),qt=U({"node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(e,t){var n=Lt(),r=Rt(),i=Kt();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null}}),Jt=U({"node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(e,t){var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=Bt().call(n,r)}}),Yt=U({"node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(e,t){var n,r=gt(),i=_t(),a=vt(),o=yt(),s=bt(),c=xt(),l=St(),u=Ct(),d=wt(),f=Tt(),p=Et(),m=Dt(),h=Ot(),g=kt(),_=jt(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=Nt(),x=Pt(),S=function(){throw new l},C=b?(function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}})():S,w=It()(),T=qt(),E=Rt(),D=Lt(),O=Ht(),k=Vt(),A={},j=typeof Uint8Array>`u`||!T?n:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":j,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":O,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":D};if(T)try{null.error}catch(e){N=T(T(e)),M[`%Error.prototype%`]=N}var N,P=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return M[t]=n,n},F={__proto__:null,"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},I=Bt(),L=Jt(),R=I.call(k,Array.prototype.concat),z=I.call(O,Array.prototype.splice),B=I.call(k,String.prototype.replace),V=I.call(k,String.prototype.slice),ee=I.call(k,RegExp.prototype.exec),te=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ne=/\\(\\)?/g,re=function(e){var t=V(e,0,1),n=V(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return B(e,te,function(e,t,n,i){r[r.length]=n?B(i,ne,`$1`):t||e}),r},ie=function(e,t){var n=e,r;if(L(F,n)&&(r=F[n],n=`%`+r[0]+`%`),L(M,n)){var i=M[n];if(i===A&&(i=P(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(ee(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=re(e),r=n.length>0?n[0]:``,i=ie(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],z(n,R([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=V(p,0,1),h=V(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,L(M,a))o=M[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=L(o,p),o=o[p];f&&!s&&(M[a]=o)}}return o}}}),Xt=U({"node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.js"(e,t){var n=Pt(),r=xt(),i=St(),a=Nt();t.exports=function(e,t,o){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`obj` must be an object or a function`");if(typeof t!=`string`&&typeof t!=`symbol`)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=`boolean`&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=`boolean`&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=`boolean`&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=`boolean`)throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!a&&a(e,t);if(n)n(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:s===null&&d?d.enumerable:!s,value:o,writable:c===null&&d?d.writable:!c});else if(u||!s&&!c&&!l)e[t]=o;else throw new r(`This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.`)}}}),Zt=U({"node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.js"(e,t){var n=Pt(),r=function(){return!!n};r.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],`length`,{value:1}).length!==1}catch{return!0}},t.exports=r}}),Qt=U({"node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js"(e,t){var n=Yt(),r=Xt(),i=Zt()(),a=Nt(),o=St(),s=n(`%Math.floor%`);t.exports=function(e,t){if(typeof e!=`function`)throw new o("`fn` is not a function");if(typeof t!=`number`||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],c=!0,l=!0;if(`length`in e&&a){var u=a(e,`length`);u&&!u.configurable&&(c=!1),u&&!u.writable&&(l=!1)}return(c||l||!n)&&(i?r(e,`length`,t,!0,!0):r(e,`length`,t)),e}}}),$t=U({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js"(e,t){var n=Bt(),r=Ht(),i=Wt();t.exports=function(){return i(n,r,arguments)}}}),en=U({"node_modules/.pnpm/call-bind@1.0.8/node_modules/call-bind/index.js"(e,t){var n=Qt(),r=Pt(),i=Gt(),a=$t();t.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},r?r(t.exports,`apply`,{value:a}):t.exports.apply=a}}),tn=U({"node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(e,t){var n=Yt(),r=Gt(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}}}),nn=de(U({"node_modules/.pnpm/json-stable-stringify@1.3.0/node_modules/json-stable-stringify/index.js"(e,t){var n=(typeof JSON<`u`?JSON:ft()).stringify,r=pt(),i=ht(),a=en(),o=tn(),s=o(`Array.prototype.join`),c=o(`Array.prototype.indexOf`),l=o(`Array.prototype.splice`),u=o(`Array.prototype.sort`),d=function(e,t){for(var n=``,r=0;r<e;r+=1)n+=t;return n},f=function(e,t,n){return n};t.exports=function(e){var t=arguments.length>1?arguments[1]:void 0,o=t&&t.space||``;typeof o==`number`&&(o=d(o,` `));var p=!!t&&typeof t.cycles==`boolean`&&t.cycles,m=t&&t.replacer?a(t.replacer):f;if(t&&t.collapseEmpty!==void 0&&typeof t.collapseEmpty!=`boolean`)throw TypeError("`collapseEmpty` must be a boolean, if provided");var h=!!t&&t.collapseEmpty,g=typeof t==`function`?t:t&&t.cmp,_=g&&function(e){var t=g.length>2&&function(t){return e[t]};return function(n,r){return g({key:n,value:e[n]},{key:r,value:e[r]},t?{__proto__:null,get:t}:void 0)}},v=[];return(function e(t,a,f,g){var y=o?`
|
|
10
|
-
`+d(g,o):``,b=o?`: `:`:`;if(f&&f.toJSON&&typeof f.toJSON==`function`&&(f=f.toJSON()),f=m(t,a,f),f!==void 0){if(typeof f!=`object`||!f)return n(f);var x=function(e,t){return h&&e.length===0?t:(t===`[]`?`[`:`{`)+s(e,`,`)+y+(t===`[]`?`]`:`}`)};if(r(f)){for(var S=[],C=0;C<f.length;C++){var w=e(f,C,f[C],g+1)||n(null);S[S.length]=y+o+w}return x(S,`[]`)}if(c(v,f)!==-1){if(p)return n(`__cycle__`);throw TypeError(`Converting circular structure to JSON`)}else v[v.length]=f;for(var T=u(i(f),_&&_(f)),S=[],C=0;C<T.length;C++){var a=T[C],E=e(f,a,f[a],g+1);if(E){var D=n(a)+b+E;S[S.length]=y+o+D}}return l(v,c(v,f),1),x(S,`{}`)}})({"":e},``,e,0)}}})(),1),rn=e=>localStorage.getItem(`kizen-flag-${e}`)===`true`,an=(e=``)=>e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),on=e=>{try{return an((0,nn.default)(e))}catch(e){return rn(`script-runner-logging`)&&console.warn(`Failed to stringify object for hashing:`,e),an(String(Math.random()))}},sn=e=>e.startsWith(`/`),cn=[`microphone`,`speaker-selection`,`autoplay`,`camera`,`display-capture`,`hid`],ln=[`allow-popups`,`allow-scripts`,`allow-same-origin`],un=3e4,dn=100,fn=class{worker;scriptUIRef;onStateChange;done;onError;waitForFrame=!1;plugin;executionPlugin;frameId;onShowToast;onClearToasts;sessionData={};setSessionData;pluginComponentId;onShowModal;onShowCreateRecordModal;onShowCreateRelatedRecordModal;onReleaseBlockingScript;pluginApiName;onNetworkError;onNetworkRequest;invalidateCache;getPendingCacheCount;createFileId;performFileUpload;pushHistory;appPath;constructor(e){this.scriptUIRef=e.scriptUIRef,this.onStateChange=e.onStateChange,this.done=e.done,this.onError=e.onError,this.onReleaseBlockingScript=e.onReleaseBlockingScript,this.worker=e.worker,this.worker.onmessage=this.handleMessage,this.plugin=e.plugin,this.executionPlugin=e.executionPlugin,this.onShowToast=e.onShowToast,this.onClearToasts=e.onClearToasts,this.pluginComponentId=e.pluginComponentId,this.onShowModal=e.onShowModal,this.onShowCreateRecordModal=e.onShowCreateRecordModal,this.onShowCreateRelatedRecordModal=e.onShowCreateRelatedRecordModal,this.onNetworkError=e.onNetworkError,this.onNetworkRequest=e.onNetworkRequest,this.invalidateCache=e.invalidateCache,this.getPendingCacheCount=e.getPendingCacheCount,this.createFileId=e.createFileId,this.performFileUpload=e.performFileUpload,this.pushHistory=e.pushHistory,this.appPath=e.appPath,this.plugin&&(this.frameId=`${P}-${this.plugin.plugin_api_name}-${this.plugin.api_name}`),this.pluginApiName=this.executionPlugin?.plugin_api_name??this.plugin?.plugin_api_name??``,this.pluginApiName?(this.sessionData=e.sessionData[this.pluginApiName],this.setSessionData=t=>{e.setSessionData?.(this.pluginApiName,t)}):this.setSessionData=()=>{this.onError?.({message:`Script must be associated with a plugin to use session data`})}}handleMessage=async e=>{let t=JSON.parse(e.data),{action:n}=t;switch(n){case k.QUERY_REQUEST:{let e=t;await this.handleQueryRequest(e.id,e.method,e.url,e.payload,e.options);return}case k.UI_OUTPUT:{let e=t;this.handleUIOutput(e.markup);return}case k.IFRAME_OUTPUT:{let e=t;this.handleIframeOutput(e.url,e.allow,e.sandbox,e.preserve);return}case k.POSTFORMDATA_REQUEST:{let e=t;this.handleFormPostRequest(e.id,e.url,e.payload,e.createNewTab);return}case k.UPLOADFILE_REQUEST:{let e=t;await this.handleUploadFileRequest(e.id,e.payload);return}case k.SETSTATE:{let e=t;this.onStateChange?.(e.state);return}case k.DONE:{let e=t;this.handleDone(e.preserve,e.result);return}case A.ERROR:{let e=t;this.onError?.({message:e.error});return}case k.OPEN_WINDOW:{let e=t;this.handleOpenWindow(e.url,e.target,e.features);return}case k.COMMUNICATE:{let e=t;this.handleCommunication(e.type,e.recipient,e.args,e.params);return}case k.HIDE:{let{config:e}=t,n=!1;e.hideTrigger&&(n=!0),this.onStateChange?.({hidden:!0,triggerHidden:n});return}case k.SHOW:{let{config:e}=t,n=!1;e.showTrigger===!1&&(n=!0),this.onStateChange?.({hidden:!1,triggerHidden:n});return}case k.EXPAND:this.onStateChange?.({minimized:!1});return;case k.COLLAPSE:this.onStateChange?.({minimized:!0});return;case k.HIDE_HEADER:this.onStateChange?.({hideHeader:!0});return;case k.SHOW_HEADER:this.onStateChange?.({hideHeader:!1});return;case k.COPY_TO_CLIPBOARD:{let e=t;await this.copyToClipboard(e.text);return}case k.OPEN_CREATE_RECORD_MODAL_REQUEST:{let e=t;this.handleCreateRecordRequest(e.id,e.entityId);return}case k.OPEN_CREATE_RELATED_RECORD_MODAL_REQUEST:{let e=t;this.handleCreateRelatedRecordRequest(e.id,e.objectId,e.relatedEntityId);return}case k.SHOW_TOAST:{let e=t;this.showToast(e.message,e.toastOptions);return}case k.CLEAR_TOASTS:this.clearToasts();return;case k.REFRESH_TIMELINE:{let e=t;this.handleRefreshTimeline(e.entityId);return}case k.REFRESH_ENTITY:{let e=t;await this.handleRefreshEntity(e.entityId,e.id);return}case k.UPDATE_SESSION_DATA:{let e=t;this.handleSetSessionData(e.update);return}case k.INSTALL_THIRD_PARTY_SCRIPT_REQUEST:{let e=t;this.handleInstallThirdPartyScriptRequest(e.id,e.url,e.args);return}case k.PROMPT_REQUEST:{let e=t;this.handlePromptRequest(e.id,e.config,!1);return}case k.DYNAMIC_PROMPT_REQUEST:{let e=t;this.handlePromptRequest(e.id,e.config,!0);return}case k.RELEASE_BLOCKING_SCRIPT:this.handleReleaseBlockingScript();return;case k.AUTHORIZE:{let e=t;this.handleAuthorize(e.serviceName,e.config);return}default:return}};handleCommunication=(e,t,n,r)=>{if(e===j.SEND_MESSAGE_TO_FRAME){if(this.frameId){let e=document.getElementById(this.frameId);e&&e.contentWindow?.postMessage({...n?.payload??{},__kizen:{recipient:t,frameId:this.frameId}},n?.path??`*`)}}else if(e===j.CALL_THIRD_PARTY_SCRIPT)this.handleCallThirdPartyScript(t.type,r);else{let r=this.executionPlugin?.plugin_api_name??this.plugin?.plugin_api_name,i=new CustomEvent(`integration:${e}`,{detail:{recipient:{...t,plugin:r},args:n}});window.dispatchEvent(i)}};handleDone=(e,t)=>{this.waitForFrame||this.done(e,t)};postMessage=(e,t)=>{this.worker.postMessage(JSON.stringify({action:e,...t}))};handleSetSessionData=e=>{this.setSessionData(e)};handleQueryRequest=async(e,t,n,r,i)=>{try{let a=await this.onNetworkRequest?.(t,n,r,i);this.postMessage(A.QUERY_RESPONSE,{data:a,id:e})}catch(t){this.onNetworkError?.(t),this.postMessage(A.QUERY_RESPONSE,{error:t,id:e})}};handleUIOutput=e=>{if(this.scriptUIRef?.current){let t=lt.sanitize(e);this.scriptUIRef.current.innerHTML=t}};onLoad=e=>{e.iframe&&(this.waitForFrame=!1,this.handleDone(e.preserve))};handleIframeOutput=(e,t=[],n=[],r=!1)=>{if(this.scriptUIRef?.current){let i=t.filter(e=>cn.includes(e)),a=n.filter(e=>ln.includes(e));this.waitForFrame=!0;let o=document.createElement(`iframe`);o.src=e,o.allow=i.join(`; `),a.forEach(e=>{o.sandbox.add(e)}),o.style.border=`none`,o.style.width=`100%`,o.style.height=`100%`,o.onload=this.onLoad.bind(this,{iframe:o,preserve:r}),this.frameId&&(o.id=this.frameId),this.scriptUIRef.current.replaceChildren(o)}};handleCreateRecordRequest=(e,t)=>{this.onShowCreateRecordModal?.(t,t=>{this.postMessage(A.CREATE_RECORD_RESPONSE,{id:e,data:t})})};handleCreateRelatedRecordRequest=(e,t,n)=>{this.onShowCreateRelatedRecordModal?.(t,n,t=>{this.postMessage(A.CREATE_RELATED_RECORD_RESPONSE,{id:e,data:t})})};showToast=(e,t)=>{this.onShowToast?.({message:e,variant:t?.variant??`success`,autohide:t?.autohide??!0})};clearToasts=()=>{this.onClearToasts?.()};copyToClipboard=async e=>{try{await navigator.clipboard.writeText(e)}catch(e){this.onError?.({message:e.message})}};handleRefreshTimeline=e=>{this.invalidateCache?.(`timeline`,e)};waitForIdleState=e=>new Promise(t=>{let n=0,r=setInterval(()=>{(this.getPendingCacheCount?.(e)??0)===0?(clearInterval(r),t(!0)):(n+=1,n>Math.floor(un/dn)&&(clearInterval(r),t(!1)))},dn)});handleRefreshEntity=async(e,t)=>{this.invalidateCache?.(`entity`,e);let n=await this.waitForIdleState(e);this.postMessage(A.REFRESH_ENTITY_RESPONSE,{id:t,data:{success:n}})};handleFormPostRequest=(e,t,n,r)=>{let i=document.createElement(`form`);i.method=`POST`,i.action=t,r&&(i.target=`_blank`);for(let e in n){let t=document.createElement(`input`);t.type=`hidden`,t.name=e,t.value=n[e],i.appendChild(t)}document.body.appendChild(i),i.submit(),r&&document.body.removeChild(i),this.postMessage(A.POSTFORMDATA_RESPONSE,{success:!0,id:e})};handleUploadFileRequest=async(e,t)=>{if(!this.performFileUpload){this.postMessage(A.UPLOADFILE_RESPONSE,{error:`File upload not supported`,id:e});return}let{file:n,isPublic:r=!1,fileName:i}=t,a=await(await fetch(n)).blob(),o=new File([a],i??`upload-${new Date().toISOString()}`,{type:a.type});o.$id=this.createFileId?.()??re();let s=await this.performFileUpload({file:o,id:o.$id,publicFile:r,source:`field_value`,handleProgress:e=>{this.postMessage(A.UPLOADFILE_PROGRESS,{fileId:e.id,progress:e.progress})},businessId:void 0});this.postMessage(A.UPLOADFILE_RESPONSE,{data:s,id:e})};waitForReadyState=(e,t,n=0)=>{e||t?.(!0),e?.()?t?.(!0):n<20?setTimeout(()=>{this.waitForReadyState(e,t,n+1)},n*50):t?.(!1)};handleCallThirdPartyScript=(e,t=[])=>{if(e&&V[e]){let n=V[e],r=window[n];r?.(...t)}};handleReleaseBlockingScript=()=>this.onReleaseBlockingScript?.(this.executionPlugin);handlePromptRequest=(e,t,n=!1)=>{this.onShowModal?this.onShowModal({...t,pluginApiName:this.pluginApiName??``,dynamic:n},(t={})=>{this.postMessage(A.PROMPT_RESPONSE,{id:e,data:t})}):this.postMessage(A.PROMPT_RESPONSE,{id:e,data:{canceled:!0}})};handleInstallThirdPartyScriptRequest=(e,t,n={})=>{let r=B(t);if(!r){this.postMessage(A.INSTALL_THIRD_PARTY_SCRIPT_RESPONSE,{data:{success:!1,url:t},id:e});return}let i=ee[r];i(n);let a=document.createElement(`script`);a.onload=()=>{this.waitForReadyState(te[r],n=>{this.postMessage(A.INSTALL_THIRD_PARTY_SCRIPT_RESPONSE,{data:{success:!0,url:t,matched:n},id:e})})},a.onerror=()=>{this.postMessage(A.INSTALL_THIRD_PARTY_SCRIPT_RESPONSE,{data:{success:!1,url:t},id:e})},a.src=t,a.setAttribute(`data-script-url`,t),document.querySelectorAll(`[data-script-url="`+t+`"]`).length>0?this.waitForReadyState(te[r],n=>{this.postMessage(A.INSTALL_THIRD_PARTY_SCRIPT_RESPONSE,{data:{success:!0,url:t,reused:!0,matched:n},id:e})}):document.documentElement.firstChild?.appendChild(a)};handleOpenWindow=(e,t,n)=>{!sn(e)||t===`_blank`||!this.pushHistory?window.open(e,t,n):this.pushHistory(e)};handleAuthorize=(e,t={})=>{let n=new URLSearchParams;if(t.successRedirectPath&&n.append(`success_redirect_path`,t.successRedirectPath),t.errorRedirectPath&&n.append(`error_redirect_path`,t.errorRedirectPath),!this.appPath){this.onError?.({message:`App path is not defined.`});return}if(!this.pluginApiName){this.onError?.({message:`Plugin API name is not defined.`});return}let r=n.toString();this.handleOpenWindow(`${this.appPath}/external-integrations/business-plugin-apps/${this.pluginApiName}/services/${encodeURIComponent(e)}/authorize${r?`?${r}`:``}`,`_blank`,``)};run=(e,t,n)=>{let r=ne();this.postMessage(k.RUN,{script:e,setup:t,args:n,sessionData:this.sessionData,pluginComponentId:this.pluginComponentId,pluginApiName:this.pluginApiName,location:r})}},pn=async({scriptBody:e,user:t,teamMember:n,business:r,onError:i,onReleaseBlockingScript:a,setLoadingState:o,clientObject:s,scriptUIRef:c,onStateChange:l,workerName:u,context:d,args:f=``,plugin:p,onShowToast:m,onClearToasts:h,terminators:g,executionPlugin:_,sessionData:v,setSessionData:y,onShowModal:b,onShowCreateRecordModal:x,onShowCreateRelatedRecordModal:S,onNetworkError:C,onNetworkRequest:w,appPath:T,pushHistory:E,createFileId:D,performFileUpload:O,getPendingCacheCount:k,invalidateCache:A})=>{let j=rn(`script-runner-logging`),M;return M=u===`recordDetail`?new Worker(new URL(`/assets/recordDetail.worker-BIHPFt8Y.js`,``+import.meta.url),{type:`module`}):u===`genericPlugin`?new Worker(new URL(`/assets/generic.worker-DRXu0-5B.js`,``+import.meta.url),{type:`module`}):u===`floatingFramePlugin`?new Worker(new URL(`/assets/floatingFrame.worker-CWLtchq3.js`,``+import.meta.url),{type:`module`}):new Worker(new URL(`/assets/calendarSource.worker-C9iglnKD.js`,``+import.meta.url),{type:`module`}),new Promise(u=>{let N=an(e),P=an(f),F=`${p?.plugin_api_name??``}-${p?.api_name??``}-${String(N)}-${String(P)}`,I=`${p?.plugin_api_name??``}-${p?.api_name??``}`;_?.field_type?(F=`${_.plugin_api_name??``}-${_.field_type}-${String(N)}-${String(P)}`,I=`${_.plugin_api_name??``}-${_.field_type??_.script_id}`):_&&(F=`${_.plugin_api_name??``}-${_.api_name}-${String(N)}-${String(P)}`,I=`${_.plugin_api_name??``}-${_.api_name}`),g.current[F]&&(g.current[F]?.forEach(e=>{e()}),g.current[F]=[]),g.current[F]??=[],g.current[F]?.push(()=>{M.terminate()});let L=new fn({worker:M,done:(e,t)=>{o(!1),e||(g.current[F]?.forEach(e=>{e()}),g.current[F]=[]),u(t)},onError:i,onReleaseBlockingScript:a,scriptUIRef:c,onStateChange:l,plugin:p,executionPlugin:_,onShowToast:m,onClearToasts:h,sessionData:v,setSessionData:y,pluginComponentId:I,onShowModal:b,onShowCreateRecordModal:x,onShowCreateRelatedRecordModal:S,onNetworkError:C,pushHistory:E,onNetworkRequest:w,appPath:T,createFileId:D,performFileUpload:O,getPendingCacheCount:k,invalidateCache:A});o(!0),L.run(e,{...d,user:t,teamMember:n,business:r,clientObject:s,appPath:T,isDebug:j},f)})},mn=(e,t)=>{let n=new Worker(new URL(`/assets/expression.worker-Cin-WNVB.js`,``+import.meta.url),{type:`module`});return new Promise(r=>{n.onmessage=e=>{let t=JSON.parse(e.data);n.terminate(),r(t.result)};let i=rn(`script-runner-logging`);n.postMessage(JSON.stringify({expression:e,args:t,isDebug:i}))})},hn=async(e,t)=>await mn(e,t),gn=async(e,t)=>await mn(e,t),_n=async(e,t)=>await mn(e,t),vn=async(e,t)=>await mn(e,t),yn=e=>({key:`action__${e.api_name}`,type:`custom_object`,label:e.name,allow_multiple:!0}),bn=(e,t)=>{let n=(e.fields??[]).filter(e=>e.type!==`container`&&e.type!==`description`).map(e=>({...e,when:t?`(${t}) && (${e.when??`true`})`:e.when})),r=(e.fields??[]).filter(e=>e.type===`container`).flatMap(e=>bn(e,e.when)),i=e.actions?.filter(e=>e.hint_object_name)??[];return[...n,...r,...i.map(e=>({...yn(e),match_hint:e.hint_object_name??``}))]},xn=(e,t)=>{let n=bn(e).reduce((e,t)=>({...e,[t.key]:t}),{}),r=Object.keys(t),i={};return r.forEach(e=>{let r=t[e],a=n[e];if(a?.type){switch(a.type){case`boolean`:let t=r;if(!t)return;i[e]=t.value;return;case`custom_object`:{let t=r;if(!t)return;i[e]={objectId:t.value?.id,objectName:t.value?.objectName};return}case`field`:{let t=r;if(!t?.value)return;Array.isArray(t.value)?i[e]=t.value.map(e=>({fieldId:e.value,fieldName:e.label,objectId:t.associatedObject?.id,objectName:t.associatedObject?.name})):typeof t.value==`object`&&typeof t.associatedObject==`object`&&(i[e]={fieldId:t.value.value,fieldName:t.value.label,objectId:t.associatedObject.id,objectName:t.associatedObject.name});return}case`number`:{let t=r;if(!t)return;try{let n=Number(t.value);if(!n&&n!==0)return;i[e]=n}catch{i[e]=NaN}return}case`select`:{let t=r;if(!t)return;i[e]=t.value;return}case`text`:{let t=r?.value;if(t){i[e]=t;return}let n=a.default;n&&(i[e]=n);return}case`description`:case`container`:return}return r?.value}}),i},Sn=`integration:${j.RUN_FRAME_SCRIPT}`,Cn={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},wn=(e,t,n)=>{let r,i=Cn[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Tn(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var En={date:Tn({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Tn({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Tn({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Dn={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},On=(e,t,n,r)=>Dn[e];function kn(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var An={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:kn({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:kn({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:kn({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:kn({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:kn({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function jn(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Nn(s,e=>e.test(o)):Mn(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Mn(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Nn(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Pn(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Fn={code:`en-US`,formatDistance:wn,formatLong:En,formatRelative:On,localize:An,match:{ordinalNumber:Pn({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:jn({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:jn({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:jn({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:jn({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:jn({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}},In={};function Ln(){return In}var Rn=365.2425,zn=6048e5,Bn=864e5,Vn=3600*24;Vn*7,Vn*Rn/12*3;var Hn=Symbol.for(`constructDateFrom`);function Un(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Hn in e?e[Hn](t):e instanceof Date?new e.constructor(t):new Date(t)}function Wn(e,t){return Un(t||e,e)}function Gn(e){let t=Wn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function Kn(e,...t){let n=Un.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function qn(e,t){let n=Wn(e,t?.in);return n.setHours(0,0,0,0),n}function Jn(e,t,n){let[r,i]=Kn(n?.in,e,t),a=qn(r),o=qn(i),s=+a-Gn(a),c=+o-Gn(o);return Math.round((s-c)/Bn)}function Yn(e,t){let n=Wn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Xn(e,t){let n=Wn(e,t?.in);return Jn(n,Yn(n))+1}function Zn(e,t){let n=Ln(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Wn(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Qn(e,t){return Zn(e,{...t,weekStartsOn:1})}function $n(e,t){let n=Wn(e,t?.in),r=n.getFullYear(),i=Un(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=Qn(i),o=Un(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=Qn(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function er(e,t){let n=$n(e,t),r=Un(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Qn(r)}function tr(e,t){let n=Wn(e,t?.in),r=Qn(n)-+er(n);return Math.round(r/zn)+1}function nr(e,t){let n=Wn(e,t?.in),r=n.getFullYear(),i=Ln(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=Un(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=Zn(o,t),c=Un(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=Zn(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function rr(e,t){let n=Ln(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=nr(e,t),a=Un(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Zn(a,t)}function ir(e,t){let n=Wn(e,t?.in),r=Zn(n,t)-+rr(n,t);return Math.round(r/zn)+1}function Z(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var ar={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Z(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Z(n+1,2)},d(e,t){return Z(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return Z(e.getHours()%12||12,t.length)},H(e,t){return Z(e.getHours(),t.length)},m(e,t){return Z(e.getMinutes(),t.length)},s(e,t){return Z(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Z(Math.trunc(r*10**(n-3)),t.length)}},or={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},sr={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return ar.y(e,t)},Y:function(e,t,n,r){let i=nr(e,r),a=i>0?i:1-i;return t===`YY`?Z(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Z(a,t.length)},R:function(e,t){return Z($n(e),t.length)},u:function(e,t){return Z(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return Z(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return Z(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return ar.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return Z(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=ir(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Z(i,t.length)},I:function(e,t,n){let r=tr(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Z(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):ar.d(e,t)},D:function(e,t,n){let r=Xn(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Z(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return Z(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return Z(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return Z(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?or.noon:r===0?or.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?or.evening:r>=12?or.afternoon:r>=4?or.morning:or.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return ar.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):ar.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Z(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Z(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):ar.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):ar.s(e,t)},S:function(e,t){return ar.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return lr(r);case`XXXX`:case`XX`:return ur(r);default:return ur(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return lr(r);case`xxxx`:case`xx`:return ur(r);default:return ur(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+cr(r,`:`);default:return`GMT`+ur(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+cr(r,`:`);default:return`GMT`+ur(r,`:`)}},t:function(e,t,n){return Z(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return Z(+e,t.length)}};function cr(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Z(a,2)}function lr(e,t){return e%60==0?(e>0?`-`:`+`)+Z(Math.abs(e)/60,2):ur(e,t)}function ur(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Z(Math.trunc(r/60),2),a=Z(r%60,2);return n+i+t+a}var dr=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},fr=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},pr={p:fr,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return dr(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,dr(r,t)).replace(`{{time}}`,fr(i,t))}},mr=/^D+$/,hr=/^Y+$/,gr=[`D`,`DD`,`YY`,`YYYY`];function _r(e){return mr.test(e)}function vr(e){return hr.test(e)}function yr(e,t,n){let r=br(e,t,n);if(console.warn(r),gr.includes(e))throw RangeError(r)}function br(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function xr(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Sr(e){return!(!xr(e)&&typeof e!=`number`||isNaN(+Wn(e)))}var Cr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,wr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Tr=/^'([^]*?)'?$/,Er=/''/g,Dr=/[a-zA-Z]/;function Or(e,t,n){let r=Ln(),i=n?.locale??r.locale??Fn,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Wn(e,n?.in);if(!Sr(s))throw RangeError(`Invalid time value`);let c=t.match(wr).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=pr[t];return n(e,i.formatLong)}return e}).join(``).match(Cr).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:kr(e)};if(sr[t])return{isToken:!0,value:e};if(t.match(Dr))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&vr(a)||!n?.useAdditionalDayOfYearTokens&&_r(a))&&yr(a,t,String(e));let o=sr[a[0]];return o(s,a,i.localize,l)}).join(``)}function kr(e){let t=e.match(Tr);return t?t[1].replace(Er,`'`):e}function Ar(e,t){let n=Wn(e,t?.in);return n.setHours(23,59,59,999),n}function jr(){return Object.assign({},Ln())}function Mr(e,t,n){let r=jr(),i=Fr(e,n.timeZone,n.locale??r.locale);return`formatToParts`in i?Nr(i,t):Pr(i,t)}function Nr(e,t){let n=e.formatToParts(t);for(let e=n.length-1;e>=0;--e)if(n[e].type===`timeZoneName`)return n[e].value}function Pr(e,t){let n=e.format(t).replace(/\u200E/g,``),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):``}function Fr(e,t,n){return new Intl.DateTimeFormat(n?[n.code,`en-US`]:void 0,{timeZone:t,timeZoneName:e})}function Ir(e,t){let n=Ur(t);return`formatToParts`in n?Rr(n,e):zr(n,e)}var Lr={year:0,month:1,day:2,hour:3,minute:4,second:5};function Rr(e,t){try{let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let t=Lr[n[e].type];t!==void 0&&(r[t]=parseInt(n[e].value,10))}return r}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function zr(e,t){let n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}var Br={},Vr=new Intl.DateTimeFormat(`en-US`,{hourCycle:`h23`,timeZone:`America/New_York`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}).format(new Date(`2014-06-25T04:00:00.123Z`)),Hr=Vr===`06/25/2014, 00:00:00`||Vr===`06/25/2014 00:00:00`;function Ur(e){return Br[e]||(Br[e]=Hr?new Intl.DateTimeFormat(`en-US`,{hourCycle:`h23`,timeZone:e,year:`numeric`,month:`numeric`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`numeric`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})),Br[e]}function Wr(e,t,n,r,i,a,o){let s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(r,i,a,o),s}var Gr=36e5,Kr=6e4,qr={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Jr(e,t,n){if(!e)return 0;let r=qr.timezoneZ.exec(e);if(r)return 0;let i,a;if(r=qr.timezoneHH.exec(e),r)return i=parseInt(r[1],10),Qr(i)?-(i*Gr):NaN;if(r=qr.timezoneHHMM.exec(e),r){i=parseInt(r[2],10);let e=parseInt(r[3],10);return Qr(i,e)?(a=Math.abs(i)*Gr+e*Kr,r[1]===`+`?-a:a):NaN}if(ei(e)){t=new Date(t||Date.now());let r=Xr(n?t:Yr(t),e);return-(n?r:Zr(t,r,e))}return NaN}function Yr(e){return Wr(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Xr(e,t){let n=Ir(e,t),r=Wr(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),i=e.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function Zr(e,t,n){let r=e.getTime()-t,i=Xr(new Date(r),n);if(t===i)return t;r-=i-t;let a=Xr(new Date(r),n);return i===a?i:Math.max(i,a)}function Qr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}var $r={};function ei(e){if($r[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),$r[e]=!0,!0}catch{return!1}}var ti=60*1e3,ni={X:function(e,t,n){let r=ri(n.timeZone,e);if(r===0)return`Z`;switch(t){case`X`:return oi(r);case`XXXX`:case`XX`:return ai(r);default:return ai(r,`:`)}},x:function(e,t,n){let r=ri(n.timeZone,e);switch(t){case`x`:return oi(r);case`xxxx`:case`xx`:return ai(r);default:return ai(r,`:`)}},O:function(e,t,n){let r=ri(n.timeZone,e);switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+si(r,`:`);default:return`GMT`+ai(r,`:`)}},z:function(e,t,n){switch(t){case`z`:case`zz`:case`zzz`:return Mr(`short`,e,n);default:return Mr(`long`,e,n)}}};function ri(e,t){let n=e?Jr(e,t,!0)/ti:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw RangeError(`Invalid time zone specified: `+e);return n}function ii(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString();for(;r.length<t;)r=`0`+r;return n+r}function ai(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=ii(Math.floor(r/60),2),a=ii(Math.floor(r%60),2);return n+i+t+a}function oi(e,t){return e%60==0?(e>0?`-`:`+`)+ii(Math.abs(e)/60,2):ai(e,t)}function si(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.floor(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+ii(a,2)}function ci(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e-+t}var li=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ui=36e5,di=6e4,fi=2,Q={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:li};function pi(e,t={}){if(arguments.length<1)throw TypeError(`1 argument required, but only `+arguments.length+` present`);if(e===null)return new Date(NaN);let n=t.additionalDigits==null?fi:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw RangeError(`additionalDigits must be 0, 1 or 2`);if(e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`)return new Date(e.getTime());if(typeof e==`number`||Object.prototype.toString.call(e)===`[object Number]`)return new Date(e);if(Object.prototype.toString.call(e)!==`[object String]`)return new Date(NaN);let r=mi(e),{year:i,restDateString:a}=hi(r.date,n),o=gi(a,i);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){let e=o.getTime(),n=0,i;if(r.time&&(n=_i(r.time),n===null||isNaN(n)))return new Date(NaN);if(r.timeZone||t.timeZone){if(i=Jr(r.timeZone||t.timeZone,new Date(e+n)),isNaN(i))return new Date(NaN)}else i=ci(new Date(e+n)),i=ci(new Date(e+n+i));return new Date(e+n+i)}else return new Date(NaN)}function mi(e){let t={},n=Q.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=Q.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){let e=Q.timeZone.exec(r);e?(t.time=r.replace(e[1],``),t.timeZone=e[1].trim()):t.time=r}return t}function hi(e,t){if(e){let n=Q.YYY[t],r=Q.YYYYY[t],i=Q.YYYY.exec(e)||r.exec(e);if(i){let t=i[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(i=Q.YY.exec(e)||n.exec(e),i){let t=i[1];return{year:parseInt(t,10)*100,restDateString:e.slice(t.length)}}}return{year:null}}function gi(e,t){if(t===null)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let a=Q.MM.exec(e);if(a)return n=new Date(0),r=parseInt(a[1],10)-1,Si(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(a=Q.DDD.exec(e),a){n=new Date(0);let e=parseInt(a[1],10);return Ci(t,e)?(n.setUTCFullYear(t,0,e),n):new Date(NaN)}if(a=Q.MMDD.exec(e),a){n=new Date(0),r=parseInt(a[1],10)-1;let e=parseInt(a[2],10);return Si(t,r,e)?(n.setUTCFullYear(t,r,e),n):new Date(NaN)}if(a=Q.Www.exec(e),a)return i=parseInt(a[1],10)-1,wi(i)?vi(t,i):new Date(NaN);if(a=Q.WwwD.exec(e),a){i=parseInt(a[1],10)-1;let e=parseInt(a[2],10)-1;return wi(i,e)?vi(t,i,e):new Date(NaN)}return null}function _i(e){let t,n,r=Q.HH.exec(e);if(r)return t=parseFloat(r[1].replace(`,`,`.`)),Ti(t)?t%24*ui:NaN;if(r=Q.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(`,`,`.`)),Ti(t,n)?t%24*ui+n*di:NaN;if(r=Q.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);let e=parseFloat(r[3].replace(`,`,`.`));return Ti(t,n,e)?t%24*ui+n*di+e*1e3:NaN}return null}function vi(e,t,n){t||=0,n||=0;let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=t*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var yi=[31,28,31,30,31,30,31,31,30,31,30,31],bi=[31,29,31,30,31,30,31,31,30,31,30,31];function xi(e){return e%400==0||e%4==0&&e%100!=0}function Si(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;let r=xi(e);if(r&&n>bi[t]||!r&&n>yi[t])return!1}return!0}function Ci(e,t){if(t<1)return!1;let n=xi(e);return!(n&&t>366||!n&&t>365)}function wi(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Ti(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}var Ei=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Di(e,t,n={}){t=String(t);let r=t.match(Ei);if(r){let i=pi(n.originalDate||e,n);t=r.reduce(function(e,t){if(t[0]===`'`)return e;let r=e.indexOf(t),a=e[r-1]===`'`,o=e.replace(t,`'`+ni[t[0]](i,t,n)+`'`);return a?o.substring(0,r-1)+o.substring(r+1):o},t)}return Or(e,t,n)}function Oi(e,t,n){e=pi(e,n);let r=Jr(t,e,!0),i=new Date(e.getTime()-r),a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}function ki(e,t,n,r){return r={...r,timeZone:t,originalDate:e},Di(Oi(e,t,{timeZone:r.timeZone}),n,r)}var $=n(),Ai=a(),ji=(0,D.createContext)(null),Mi=({children:e})=>{let t=(0,D.useRef)({}),n=(0,D.useCallback)(()=>{Object.keys(t.current).forEach(e=>{t.current[e]?.forEach(e=>{e()}),t.current[e]=[]})},[]);return(0,D.useEffect)(()=>()=>{n()},[n]),(0,$.jsx)(ji.Provider,{value:{terminators:t,cleanupWorkers:n},children:e})},Ni=()=>{let e=(0,D.useContext)(ji);if(!e)throw Error(`useTerminators must be used within a TerminatorsWrapper`);return e},Pi=(0,D.createContext)(null),Fi=({children:e})=>{let[t,n]=(0,D.useState)({}),r=(0,D.useCallback)((e,t)=>{n(n=>({...n,[e]:{...n[e],...t}}))},[]);return(0,$.jsx)(Pi.Provider,{value:{sessionData:t,setSessionData:r},children:e})},Ii=()=>{let e=(0,D.useContext)(Pi);if(!e)throw Error(`useSessionData must be used within a SessionDataWrapper`);return e},Li=(0,D.createContext)(null),Ri=({children:e,bootstrapPlugins:t=[],userConfigs:n=[],user:r,teamMember:i,business:a,clientObject:o,appPath:s})=>{let[c,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)({}),f=(0,D.useMemo)(()=>Object.values(u).some(e=>e.waitingOnRouteScript),[u]),p=(0,D.useMemo)(()=>t.reduce((e,t)=>({...e,[t.api_name]:t.id}),{}),[t]),m=(0,D.useMemo)(()=>n.reduce((e,t)=>({...e,[t.api_name]:t.config}),{}),[n]),h=(0,D.useCallback)(()=>{l(!0)},[]);return(0,$.jsx)(Li.Provider,{value:{installedPluginAPINamesToIds:p,userConfigsByApiName:m,user:r,teamMember:i,business:a,clientObject:o,appPath:s,onInitialBootstrap:h,setRouteScriptRunState:d},children:e({waitingOnRouteScript:f,hasFinishedBootstrapping:c})})},zi=()=>{let e=(0,D.useContext)(Li);if(!e)throw Error(`useAppState must be used within an AppStateWrapper`);return e},Bi=(0,D.createContext)(null),Vi=({children:e})=>{let[t,n]=(0,D.useState)({}),r=(0,D.useCallback)(e=>t=>{n(n=>({...n,[e]:t(n[e]??{indicator:`none`,hidden:!1,pending:!1})}))},[]),i=(0,D.useCallback)(e=>!e||!t[e]?{indicator:`none`,hidden:!1,pending:!1}:{...t[e]},[t]),a=(0,D.useMemo)(()=>{let e=Object.keys(t);return e.length>0&&e.some(e=>t[e]?.indicator===`block`)},[t]);return(0,$.jsx)(Bi.Provider,{value:{getRunnerStateUpdater:r,getRunnerState:i},children:e(a)})},Hi=()=>{let e=(0,D.useContext)(Bi);if(!e)throw Error(`useRunnerState must be used within a RunnerStateWrapper`);return e},Ui=(0,D.createContext)(null),Wi=({children:e,showing:t,showPrompt:n,show:r,onConfirm:i,onHide:a})=>{let[o,s]=(0,D.useState)([]),[c,l]=(0,D.useState)([]),[u,d]=(0,D.useState)([]),f=(0,D.useRef)(void 0),p=(0,D.useRef)(void 0),m=(0,D.useCallback)((e,t)=>{s(n=>[...n,{config:e,cb:t}])},[]),h=(0,D.useCallback)((e,t)=>{l(n=>[...n,{objectId:e,cb:t}])},[]),g=(0,D.useCallback)((e,t,n)=>{d(r=>[...r,{objectId:e,relatedEntityId:t,cb:n}])},[]),_=(0,D.useCallback)(e=>{c[0]?.cb(e),l(e=>e.slice(1))},[c]),v=(0,D.useCallback)(e=>{u[0]?.cb(e),d(e=>e.slice(1))},[u]);(0,D.useEffect)(()=>{o.length>0&&!t&&(f.current=o[0]?.config,p.current=o[0]?.cb,n())},[o,t,n]);let y=(0,D.useCallback)(()=>{f.current=void 0,p.current=void 0,s(e=>e.slice(1))},[]),b=(0,D.useMemo)(()=>({props:{show:r,onConfirm:e=>{i(),p.current&&p.current({canceled:!1,values:e}),y()},onHide:(e,...t)=>{a(...t),p.current&&p.current({canceled:!0,values:{},eventSource:e}),y()}},config:f.current??{}}),[i,a,r,y]);return(0,$.jsx)(Ui.Provider,{value:{modalState:b,showModal:m,showCreateRecordModal:h,showCreateRelatedRecordModal:g,onCreateRecordComplete:_,onCreateRelatedRecordComplete:v},children:e({showPluginModal:b.props.show,pluginApiName:b.config.pluginApiName??``,handleShowModal:m,handleShowCreateRecordModal:h,handleShowCreateRelatedRecordModal:g,derivedModalState:b,handleCreateRecordComplete:_,handleCreateRelatedRecordComplete:v,showCreateRecordModal:c.length>0,createRecordModalObjectId:c[0]?.objectId??``,showCreateRelatedRecordModal:u.length>0,createRelatedRecordModalObjectId:u[0]?.objectId??``,createRelatedRecordModalRelatedEntityId:u[0]?.relatedEntityId??``})})},Gi=()=>{let e=(0,D.useContext)(Ui);if(!e)throw Error(`useModals must be used within a ModalsWrapper`);return e},Ki=(0,D.createContext)(null),qi=({children:e,monitoringExceptionHelper:t})=>{let n=(0,D.useCallback)((e,n)=>{t(e,{extra:n})},[t]);return(0,$.jsx)(Ki.Provider,{value:{sendException:n},children:e})},Ji=()=>{let e=(0,D.useContext)(Ki);if(!e)throw Error(`useMonitoring must be used within an MonitoringWrapper`);return e},Yi=(0,D.createContext)(null),Xi=({children:e,onNavigate:t})=>{let n=(0,D.useCallback)(e=>{t(e,{replace:!1})},[t]),r=(0,D.useCallback)(e=>{t(e,{replace:!0})},[t]);return(0,$.jsx)(Yi.Provider,{value:{push:n,replace:r},children:e})},Zi=()=>{let e=(0,D.useContext)(Yi);if(!e)throw Error(`useHistory must be used within an HistoryWrapper`);return e},Qi=(0,D.createContext)(null),$i=({children:e,performRequest:t,createFileId:n,performFileUpload:r,getPendingCacheCount:i,invalidateCache:a})=>(0,$.jsx)(Qi.Provider,{value:{performRequest:t,createFileId:n,performFileUpload:r,getPendingCacheCount:i,invalidateCache:a},children:e}),ea=()=>{let e=(0,D.useContext)(Qi);if(!e)throw Error(`useNetwork must be used within a NetworkWrapper`);return e},ta=e=>e,na=(0,D.createContext)({t:ta}),ra=e=>{let{children:t,t:n=ta}=e;return(0,$.jsx)(na.Provider,{value:{t:n},children:t})},ia=()=>(0,D.useContext)(na),aa=(e,t)=>{if(!Array.isArray(e))throw Error(`Return value must be an array`);t.required.forEach(t=>{e.forEach((e,n)=>{if(!(t.key in e))throw Error(`Missing required field: ${t.key} in result row ${String(n)}`);let r=typeof e[t.key];if(r!==t.type)throw Error(`Invalid type for field: ${t.key} in result row ${String(n)}. Expected ${t.type}, got ${r}`)})}),t.optional.forEach(t=>{e.forEach((e,n)=>{if(t.key in e){let r=typeof e[t.key];if(r!==t.type)throw Error(`Invalid type for field: ${t.key} in result row ${String(n)}. Expected ${t.type}, got ${r}`)}})})},oa=({onError:e,showToast:t,clearToasts:n})=>{let{t:r}=ia(),[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(void 0),{terminators:c}=Ni(),{sessionData:l,setSessionData:u}=Ii(),{installedPluginAPINamesToIds:d,userConfigsByApiName:f,user:p,teamMember:m,business:h,clientObject:g,appPath:_}=zi(),{getRunnerState:v,getRunnerStateUpdater:y}=Hi(),{showModal:b,showCreateRecordModal:x}=Gi(),{sendException:S}=Ji(),C=Zi(),{performRequest:w,createFileId:T,performFileUpload:E,getPendingCacheCount:O,invalidateCache:k}=ea(),A=(0,D.useCallback)(t=>n=>{e?.(n);let r=n?.message??`Unknown plugin error`;S(Error(r),{error:n,workerName:`calendarSource`,pluginApiName:t?.plugin_api_name??``})},[e,S]);return[(0,D.useCallback)(async(i,o,v,S)=>{let D=``,j=ie(o);s(j);try{let e=d[o.plugin_api_name];D=JSON.stringify({...v,pluginId:e,__kizen_user_config:f[o.plugin_api_name]})}catch{A(o)({message:r(`Arguments passed to the script are invalid`)})}let M=!1,N=await pn({user:p,teamMember:m,business:h,onError:A(o),setLoadingState:a,scriptBody:i,clientObject:g,onStateChange:e=>{y(j)(t=>({...t,...e}))},workerName:`calendarSource`,args:D,pushHistory:C.push,onShowToast:t,onClearToasts:n,terminators:c,plugin:o,sessionData:l,setSessionData:u,onShowModal:b,onShowCreateRecordModal:x,onShowCreateRelatedRecordModal:()=>{},onNetworkError:e=>{e?.status===503&&(M=!0)},appPath:_,onNetworkRequest:w,createFileId:T,performFileUpload:E,getPendingCacheCount:O,invalidateCache:k});try{S&&aa(N,S)}catch(t){e?.(t)}return{result:N,authError:M}},[p,m,d,h,g,C,t,n,c,l,u,b,x,A,y,f,e,w,T,_,E,O,k,r]),{...v(o),pending:i}]},sa=(0,D.createContext)(null),ca=({children:e,showToast:t,clearToasts:n})=>(0,$.jsx)(sa.Provider,{value:{showToast:t,clearToasts:n},children:e}),la=()=>{let e=(0,D.useContext)(sa);if(!e)throw Error(`useToast must be used within a ToastWrapper`);return e},ua=async(e,t,n,r)=>{let{result:i,authError:a}=await n(e,t,r,{required:[{key:`id`,type:`string`},{key:`name`,type:`string`}],optional:[{key:`description`,type:`string`}]});return Array.isArray(i)?{result:i,authError:a}:(console.warn(`Expected calendar source script to return an array, but got:`,i),{result:[],authError:a})},da=async(e,t,n,r)=>{let{result:i,authError:a}=await n(e,t,r,{required:[{key:`id`,type:`string`},{key:`calendar_id`,type:`string`},{key:`title`,type:`string`},{key:`start_time`,type:`number`},{key:`end_time`,type:`number`}],optional:[{key:`description`,type:`string`},{key:`url`,type:`string`},{key:`activity_id`,type:`string`},{key:`all_day`,type:`boolean`},{key:`busy`,type:`boolean`}]});return Array.isArray(i)?{result:i,authError:a}:(console.warn(`Expected calendar event script to return an array, but got:`,i),{result:[],authError:a})},fa=(e,t,n={})=>{let{showToast:r,clearToasts:i}=la(),{t:a}=ia(),[o]=oa({onError:e=>{r({message:`${a(`Error fetching calendar options.`)} ${e?.message??``}`,variant:`failure`})},showToast:r,clearToasts:i}),s=O({queries:t.map(t=>({queryKey:I.CALENDAR_SOURCE_CALENDAR_LIST(t.plugin_api_name,t.api_name),queryFn:async()=>{let e=n[t.plugin_api_name]?.business_config??{},{result:r,authError:i}=await ua(t.calendars_script,t,o,e);return{source:t,calendars:r,authError:i}},enabled:e&&!!t.calendars_script}))}),c=s.some(e=>e.isLoading);return{calendars:(0,D.useMemo)(()=>c||!e?{}:s.reduce((e,t)=>{if(!t.data?.source.plugin_api_name||typeof t.data.source.plugin_api_name!=`string`)return e;let n=t.data.source.plugin_api_name;return e[n]??=[],e[n].push(...t.data.calendars.map(e=>({calendar:e,source:t.data.source}))),e},{}),[s,c,e]),errorServices:(0,D.useMemo)(()=>s.filter(e=>e.data?.authError).map(e=>e.data?.source.plugin_api_name),[s]),isLoading:c}},pa=`yyyy-MM-dd'T'HH:mm:ssXXX`,ma=e=>{if(!/^\d{4}-\d{2}-\d{2}$/.test(e))throw Error(`Invalid date string: ${e}. Expected format: YYYY-MM-DD`);let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r)},ha=(e,t)=>ki(e,t,pa),ga=(e,t,n={})=>{let r=Intl.DateTimeFormat().resolvedOptions().timeZone,i=ha(qn(ma(t.rangeStart)),r),a=ha(Ar(ma(t.rangeEnd)),r),{showToast:o,clearToasts:s}=la(),{t:c}=ia(),[l]=oa({onError:e=>{o({message:`${c(`Error fetching calendar events.`)} ${e?.message??``}`,variant:`failure`})},showToast:o,clearToasts:s}),u=O({queries:e.map(({calendar:e,source:r})=>({queryKey:I.CALENDAR_SOURCE_EVENTS(r.plugin_api_name,r.api_name,e.id,t),queryFn:async()=>{let t=n[r.plugin_api_name]?.business_config??{},{result:o,authError:s}=await da(r.events_script,r,l,{...t,calendar:{calendar_id:e.id,range_start:i,range_end:a}});return{calendarId:e.id,events:o,authError:s}}}))}),d=u.some(e=>e.isLoading),f=(0,D.useMemo)(()=>e.reduce((e,{calendar:t,source:n})=>(e[t.id]={source:n,calendar:t},e),{}),[e]);return{events:(0,D.useMemo)(()=>d?{}:u.reduce((e,t)=>(t.data?.calendarId&&(e[t.data.calendarId]=t.data.events),e),{}),[u,d]),sources:f,isLoading:d}},_a=({onError:e,scriptUIRef:t,plugin:n,onChangeMinimized:r})=>{let{terminators:i}=Ni(),{sessionData:a,setSessionData:o}=Ii(),{installedPluginAPINamesToIds:s,userConfigsByApiName:c,user:l,teamMember:u,business:d,clientObject:f,appPath:p}=zi(),{showModal:m,showCreateRecordModal:h,showCreateRelatedRecordModal:g}=Gi(),{sendException:_}=Ji(),{showToast:v,clearToasts:y}=la(),b=Zi(),{performRequest:x,createFileId:S,performFileUpload:C,getPendingCacheCount:w,invalidateCache:T}=ea(),{t:E}=ia(),[O,k]=(0,D.useState)(!1),[A,j]=(0,D.useState)({indicator:`none`,hidden:!0,triggerHidden:!1,hideHeader:!1}),M=(0,D.useRef)(!1),[N,P]=(0,D.useState)(!1);O&&!M.current&&(M.current=!0),!O&&M.current&&!N&&P(!0);let F=(0,D.useCallback)(t=>{e?.(t);let r=t?.message??`Unknown plugin error`;_(Error(r),{error:t,workerName:`floatingFrame`,pluginApiName:n.plugin_api_name})},[e,n,_]);return[(0,D.useCallback)((e,_)=>{let D=``;try{let e=s[n.plugin_api_name];D=JSON.stringify({..._,pluginId:e,__kizen_user_config:c[n.plugin_api_name]})}catch{F({message:E(`Arguments passed to the script are invalid`)})}return pn({user:l,teamMember:u,business:d,onError:F,setLoadingState:(...e)=>{(0,Ai.flushSync)(()=>{k(...e)})},scriptBody:e,clientObject:f,scriptUIRef:t,onStateChange:e=>{let{minimized:t,...n}=e;typeof t==`boolean`&&r?.(t),j(e=>({...e,...n}))},workerName:`floatingFramePlugin`,args:D,pushHistory:b.push,plugin:n,onShowToast:v,onClearToasts:y,terminators:i,sessionData:a,setSessionData:o,onShowModal:m,onShowCreateRecordModal:h,onShowCreateRelatedRecordModal:g,appPath:p,onNetworkRequest:x,createFileId:S,performFileUpload:C,getPendingCacheCount:w,invalidateCache:T})},[l,u,d,s,f,t,b,n,r,v,y,i,a,o,F,j,c,m,h,g,x,p,S,C,w,T,E]),{...A,pending:N?!1:O}]},va=({onError:e,scriptUIRef:t,plugin:n})=>{let{terminators:r}=Ni(),{sessionData:i,setSessionData:a}=Ii(),{installedPluginAPINamesToIds:o,userConfigsByApiName:s,user:c,teamMember:l,business:u,clientObject:d,appPath:f}=zi(),{getRunnerState:p,getRunnerStateUpdater:m}=Hi(),{showModal:h,showCreateRecordModal:g}=Gi(),{sendException:_}=Ji(),{showToast:v,clearToasts:y}=la(),b=Zi(),{performRequest:x,createFileId:S,performFileUpload:C,getPendingCacheCount:w,invalidateCache:T}=ea(),{t:E}=ia(),[O,k]=(0,D.useState)(!1),[A,j]=(0,D.useState)(void 0),M=(0,D.useCallback)((t,r)=>{e?.(t);let i=t?.message??`Unknown plugin error`;_(Error(i),{error:t,workerName:`genericPlugin`,pluginApiName:n?.plugin_api_name??r?.plugin_api_name??``})},[e,n,_]);return[(0,D.useCallback)((e,p,_)=>{let D=``,O=ie(_);j(O);try{let e=o[n?.plugin_api_name??_?.plugin_api_name??``];D=JSON.stringify({...p,pluginId:e,__kizen_user_config:s[n?.plugin_api_name??_?.plugin_api_name??``]})}catch{M({message:E(`Arguments passed to the script are invalid`)})}return pn({user:c,teamMember:l,business:u,onError:M,setLoadingState:k,scriptBody:e,clientObject:d,scriptUIRef:t,onStateChange:e=>{m(O)(t=>({...t,...e}))},workerName:`genericPlugin`,args:D,pushHistory:b.push,onShowToast:v,onClearToasts:y,terminators:r,plugin:n,executionPlugin:_,sessionData:i,setSessionData:a,onShowModal:h,onShowCreateRecordModal:g,onShowCreateRelatedRecordModal:()=>{},appPath:f,onNetworkRequest:x,createFileId:S,performFileUpload:C,getPendingCacheCount:w,invalidateCache:T})},[c,l,o,u,d,t,b,v,y,r,n,i,a,M,m,s,h,g,x,f,S,C,w,T,E]),{...p(A),pending:O}]},ya=({entityId:e,objectId:t,onError:n,scriptUIRef:r,onReleaseBlockingScript:i})=>{let{terminators:a}=Ni(),{sessionData:o,setSessionData:s}=Ii(),{installedPluginAPINamesToIds:c,userConfigsByApiName:l,user:u,teamMember:d,business:f,clientObject:p,appPath:m}=zi(),{getRunnerState:h,getRunnerStateUpdater:g}=Hi(),{showModal:_,showCreateRecordModal:v,showCreateRelatedRecordModal:y}=Gi(),{sendException:b}=Ji(),{showToast:x,clearToasts:S}=la(),C=Zi(),{performRequest:w,createFileId:T,performFileUpload:E,getPendingCacheCount:O,invalidateCache:k}=ea(),{t:A}=ia(),[j,M]=(0,D.useState)(!1),[N,P]=(0,D.useState)(void 0),F=(0,D.useCallback)((r,i)=>{n?.(r);let a=r?.message??`Unknown plugin error`;b(Error(a),{error:r,workerName:`recordDetail`,pluginApiName:i?.plugin_api_name??``,objectId:t,entityId:e})},[n,t,e,b]);return[(0,D.useCallback)((n,h,b,D)=>{let j=``;try{let e=c[b?.plugin_api_name??``];j=JSON.stringify({...h,pluginId:e,__kizen_user_config:l[b?.plugin_api_name??``]})}catch{F({message:A(`Arguments passed to the script are invalid`)},b)}let N=ie(b);return P(N),pn({user:u,teamMember:d,business:f,onReleaseBlockingScript:i,onError:e=>{F(e,b)},setLoadingState:M,scriptBody:n,clientObject:p,scriptUIRef:r,onStateChange:e=>{g(N)(t=>({...t,...e}))},workerName:`recordDetail`,args:j,context:D??{entityId:e,objectId:t},pushHistory:C.push,onShowToast:x,onClearToasts:S,terminators:a,executionPlugin:b,sessionData:o,setSessionData:s,onShowModal:_,onShowCreateRecordModal:v,onShowCreateRelatedRecordModal:y,appPath:m,onNetworkRequest:w,createFileId:T,performFileUpload:E,getPendingCacheCount:O,invalidateCache:k})},[u,d,c,f,e,t,p,r,C,x,S,a,o,s,_,v,y,i,F,g,l,w,m,T,E,O,k,A]),{...h(N),pending:j}]},ba=(e,t)=>{let{showToast:n}=la(),{t:r}=ia(),i=(0,D.useRef)(null),a=(0,D.useRef)(null),o=e?.css,s=(0,D.useMemo)(()=>{let t=e?.html;return t?lt.sanitize(t):null},[e]),c=(0,D.useMemo)(()=>e?.event_scripts??{},[e]),[l,{pending:u}]=va({onError:e=>{n({message:`${r(`Script could not be executed:`)} ${e?.message??`Unknown Error`}`,variant:`failure`})},scriptUIRef:i,plugin:e}),d=(0,D.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!u){let n=e.target.getAttribute(`data-script`);n&&c[n]&&l(c[n],t)}},[u,l,c,t]);return(0,D.useEffect)(()=>{let e=a.current;return e&&e.addEventListener(`click`,d),()=>{e&&e.removeEventListener(`click`,d)}},[d,e]),{scopedCss:`
|
|
11
|
-
@scope {
|
|
12
|
-
${o??``}
|
|
13
|
-
}
|
|
14
|
-
`,sanitizedHtml:s,outputUIRef:i,interactableScriptRef:a}},xa=(e,t,n,r,i={})=>{let a=(0,D.useMemo)(()=>t?.event_scripts??{},[t]),o=(0,D.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),!r){let n=t.target.getAttribute(`data-script`);n&&a[n]&&e(a[n],{...i})}},[r,e,a,i]);(0,D.useEffect)(()=>{let e=n?.current;return e&&e.addEventListener(`click`,o),()=>{e&&e.removeEventListener(`click`,o)}},[o,t,n])},Sa=(e,t,n)=>{let r=e?.iframe_url,i=e?.script,a=e?.callback,o=e?.args,{showToast:s}=la(),{t:c}=ia(),l=(0,D.useRef)(null),[u,{pending:d}]=va({onError:e=>{s({message:`${c(`Plugin error:`)} ${e?.message??``}`,variant:`failure`})},scriptUIRef:l,plugin:e}),f=(0,D.useMemo)(()=>{let e=new URLSearchParams(t);return{...Object.fromEntries(e),...o}},[t,o]),{outputUIRef:p,scopedCss:m,sanitizedHtml:h,interactableScriptRef:g}=ba(e,f);xa(u,e,l,d);let _=(0,D.useRef)(!1);(0,D.useEffect)(()=>{!r&&!_.current&&i&&!n&&(_.current=!0,u(i,f))},[r,u,i,f,n]);let v=(0,D.useCallback)(e=>{let t=e.data;if(t?.type===`kizen:plugin_callback`){let e=t.query;a&&u(a,e)}},[u,a]);return(0,D.useEffect)(()=>(window.addEventListener(`message`,v),()=>{window.removeEventListener(`message`,v)}),[v]),{scriptUIRef:l,outputUIRef:p,scopedCss:m,sanitizedHtml:h,interactableScriptRef:g,iframeURL:r,pending:d}},Ca=(0,D.createContext)(null),wa=({children:e})=>{let[t,n]=(0,D.useState)([]),[r,i]=(0,D.useState)(!1),a=(0,D.useCallback)((e,t)=>{n(n=>{let r=[e,...n.filter(t=>t!==e)];return t?.(r),r})},[]),o=(0,D.useMemo)(()=>[...t].reverse().reduce((e,t,n)=>({...e,[t]:n}),{}),[t]);return(0,D.useEffect)(()=>{let e=new MutationObserver(()=>{document.querySelector(`div[role="dialog"]`)?i(!0):i(!1)});return e.observe(document.body,{childList:!0}),()=>{e.disconnect()}},[]),(0,$.jsx)(Ca.Provider,{value:{touchFloatingFrame:a,floatingFrameOffset:o},children:e(r)})},Ta=()=>{let e=(0,D.useContext)(Ca);if(!e)throw Error(`useFloatingFrame must be used within a FloatingFrameWrapper`);return e},Ea=[`^/$`,`^/login*`,`/settings/mine$`,`/settings/others$`,`/create-new-business$`,`^/choose-business*`,`^/inactive-business$`,`^/reset$`,`/welcome$`,`/embed/*`,`/create-new-business$`,`/businessbuilder`],Da=[`https://js.stripe.com`],Oa=(e,t,n,r)=>e<n?t<r?`top-left`:`top-right`:t<r?`bottom-left`:`bottom-right`,ka=e=>{let{currentWindow:t,pathname:n,id:r,frameHeaderSize:i,defaultPositionGap:a=0,viewportHeight:o=window.innerHeight,hiddenByModal:s,updateEmployeeConfig:c}=e,l=(0,D.useRef)(null),u=(0,D.useRef)(!1),{showToast:d}=la(),{t:f}=ia(),{installedPluginAPINamesToIds:p,clientObject:m}=zi(),{touchFloatingFrame:h,floatingFrameOffset:g}=Ta(),_=g[r]??-1,v=t.minimized_style===`none`,y=t.minimized_style===`circle`||v,b=t.default_position===`bottom-right-fixed`,x=t.default_position===`bottom-left-fixed`,S=b||x,C=t.minimized_config?.icon??`action-drag-handle`,w=t.minimized_config?.color??`blue`,T=(0,D.useMemo)(()=>{let e=n.split(`/`),t=e[1],r=e[2];if(t===`client`)return{objectId:m?.id,entityId:r};if(t===`custom-objects`)return{objectId:r,entityId:e[3]}},[m,n]),E=(0,D.useMemo)(()=>{let e=t.match,r=t.ignore;return!!(e?.length&&!e.some(e=>new RegExp(e).test(n))||Ea.concat(r??[]).filter(Boolean).some(e=>{try{return new RegExp(e).test(n)}catch{return!1}}))},[t,n]),O=t.plugin_api_name?p[t.plugin_api_name]:``,[k,A]=(0,D.useState)(()=>t.employee_config?.[r]?.minimized??!1),j=t.script,M=t.type,N=t.args,P=t.message_handler,F=t.width??0,[I,L]=(0,D.useState)(()=>{let e=window.innerHeight;return Math.min(t.height??0,e-i)}),[R,z]=(0,D.useState)(null),B=t.default_position,V=(0,D.useCallback)(e=>{let n=t.employee_config?.[r]?.position;if(!n?.quadrant){let t=window.innerWidth-F,r=window.innerHeight-I-i;if(k&&!e&&(r=window.innerHeight-i),n)try{let e=n;return e.left>t&&(e.left=t),e.top>r&&(e.top=r),e.left<0&&(e.left=a),e.top<0&&(e.top=a),e}catch{}let o=t;return B===`bottom-left`&&(o=a),{left:o,top:r-a}}else if(n.quadrant===`top-left`){let e=n.deltas?.left??0,t=n.deltas?.top??0;return{...n,left:e,top:t}}else if(n.quadrant===`top-right`){let e=window.innerWidth-F-(n.deltas?.right??0),t=n.deltas?.top??0;return{...n,left:e,top:t}}else if(n.quadrant===`bottom-left`){let e=n.deltas?.left??0,t=window.innerHeight-(k?0:I)-(n.deltas?.bottom??0)-i;return{...n,left:e,top:t}}else{let e=window.innerWidth-F-(n.deltas?.right??0),t=window.innerHeight-(k?0:I)-(n.deltas?.bottom??0)-i;return{...n,left:e,top:t}}},[t,r,B,k,F,I,i,a]),ee=(0,D.useCallback)(e=>{let t=V(e),n=[`bottom-right`,`bottom-left`].includes(t.quadrant??``)&&k?0:I;return t.left<0?t.left=0:t.left>window.innerWidth-F&&(t.left=window.innerWidth-F),t.top<0?t.top=0:t.top>window.innerHeight-n&&(t.top=window.innerHeight-n),t},[V,F,I,k]);(0,D.useEffect)(()=>{let e=t.height??0;if(e>o){L(o-i);let e=V(!0);e.top=0,z(e)}else L(e)},[t.height,V,o,i]);let[te,ne]=(0,D.useState)(k),[re,ie]=(0,D.useState)(k&&y),ae=I*5e-4*1e3,oe=e=>{A(e),e&&y?setTimeout(()=>{ie(e)},ae):y&&ie(e),s?setTimeout(()=>{ne(e)},ae):ne(e),(R?.quadrant===`bottom-left`||R?.quadrant===`bottom-right`)&&z(e?e=>e?{...e,top:e.top+I}:null:e=>{if(!e)return null;let t=window.innerHeight,n=e.top>=0&&e.top+I<=t;return{...e,top:n?e.top:e.top-I}}),c?.(r,k,R)({minimized:e})},[H,{pending:se,hidden:ce,indicator:le,triggerHidden:U,hideHeader:ue}]=_a({onError:e=>{d({message:`${f(`Plugin error:`)} ${e?.message??``}`,variant:`failure`})},scriptUIRef:l,plugin:t,onChangeMinimized:e=>{oe(e)}}),de=(0,D.useMemo)(()=>ue&&S,[ue,S]),fe=(0,D.useMemo)(()=>{if(!R)return`top`;let{left:e,top:t}=R;return window.innerWidth-(e+F)<40?`left`:t<40?`bottom`:`top`},[R,F]),pe=(0,D.useCallback)(()=>{let e=x?`left`:`right`,n=`${t.plugin_api_name}-${t.api_name}-trigger-${e}`;return document.getElementById(n)},[x,t]),me=(0,D.useCallback)(()=>{if(!S)return;let e=pe();if(!e)return;let t=e.getBoundingClientRect(),n=k?0:I,r=de?0:i,o=t.top-(n+r)-a,s=x?t.left:t.right-F,c=n+r,l=Math.max(0,window.innerWidth-F),u=Math.max(0,window.innerHeight-c);s=Math.min(Math.max(0,s),l),o=Math.min(Math.max(0,o),u),z({left:s,top:o,quadrant:x?`bottom-left`:`bottom-right`,deltas:{top:o,left:s,right:window.innerWidth-(s+F),bottom:window.innerHeight-(o+c)}})},[S,x,I,k,F,de,pe,i,a]);(0,D.useEffect)(()=>{S&&me()},[S,I,k,me]),(0,D.useEffect)(()=>{if(!S)return;me();let e=new ResizeObserver(()=>{me()});return e.observe(document.body),()=>{e.disconnect()}},[S,me]),(0,D.useEffect)(()=>{!u.current&&j&&M===`script`&&!E&&(u.current=!0,H(j,{...N}))},[H,j,M,N,E]),(0,D.useEffect)(()=>{let e=e=>{let n=e;if(n?.detail?.recipient?.frame===t.api_name){let e=n.detail;if(e.recipient?.plugin!==t.plugin_api_name)return;e.recipient.script&&t.event_scripts?.[e.recipient.script]&&H(t.event_scripts[e.recipient.script]??``,{...e.args,...N,...T})}};return window.addEventListener(Sn,e),()=>{window.removeEventListener(Sn,e)}},[t,H,N,T]);let[he,ge]=(0,D.useState)(!1),W=(e,t)=>{ge(!1),h(r);let n=window.innerWidth,i=window.innerHeight;if(t.node){let e=t.node.getBoundingClientRect(),a=e.left,o=e.top,s=o+e.height,l=a+e.width,u=o,d=i-s,f=a,p=n-l,m={left:a,right:l,top:o,quadrant:Oa(u,f,d,p),deltas:{top:u,bottom:d,left:f,right:p}};z(m),c?.(r,k,R)({position:m})}};(0,D.useEffect)(()=>{let e=()=>{S?me():z(ee(!1))};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[S,me,ee]),xa(H,t,l,se,N),(0,D.useEffect)(()=>{let e=e=>{e.source!==window&&P&&!Da.includes(e.origin)&&H(P,{...N,eventData:e.data})};return window.addEventListener(`message`,e),()=>{window.removeEventListener(`message`,e)}},[H,N,P]);let{outputUIRef:G,scopedCss:_e,sanitizedHtml:ve,interactableScriptRef:K}=ba(t,{}),ye=te?ce||E||s:ce||E,be=`floating-window-parent--${r}`,xe=`floating-drag-handle--${r}`,Se=`floating-window-content--${r}`,Ce=t.employee_config?.[r]?.position?.quadrant?.split(`-`)[1]===`right`?`right`:`left`;x?Ce=`left`:b&&(Ce=`right`);let we=t.minimized_config?.customIcon,Te=null;return we?.startsWith(`data:image/`)&&(Te=({className:e=``})=>(0,$.jsx)(`img`,{src:we,alt:t.title||`Open Frame`,className:`object-cover select-none pointer-events-none ${e}`})),R||z(ee(!1)),{circleProps:{id:r,side:Ce,circleIcon:C,CustomIcon:Te,circleColor:w,onClick:()=>{oe(!k)},hidden:!!(ye||E||v||U)},parentProps:{className:be,dragging:he,hidden:ye||re||E||v},draggableProps:{onStop:W,onStart:()=>{ge(!0)},bounds:`.${be}`,handle:`.${xe}`,defaultPosition:{x:R?.left??0,y:R?.top??0},position:{x:R?.left??0,y:R?.top??0},disabled:S},floatProps:{pending:se,width:F,dragging:he,height:I,isCircle:y&&k},contentProps:{className:Se,dragging:he,solid:!0},minimized:k,pending:se,indicator:le,hideHeader:de,isFixed:S,isCircle:y,outputUIRef:G,scopedCss:_e,sanitizedHtml:ve,interactableScriptRef:K,tooltipPosition:fe,currentPluginId:O,setMinimized:oe,dragHandleClassName:xe,height:I,script:j,dragging:he,frameOffset:_,scriptUIRef:l}},Aa=()=>{(0,D.useEffect)(()=>{let e=null,t=t=>{if(!t.detail?.location)return;let n=on(t.detail.location);n!==e&&(e=n,document.querySelectorAll(`iframe[id^=${P}-]`).forEach(e=>{let n=null;try{n=new URL(e.src,window.location.href).origin}catch(e){rn(`script-runner-logging`)&&console.warn(`Failed to parse iframe src for location change message target origin:`,e),n=null}n&&e.contentWindow?.postMessage({action:N,location:t.detail?.location},n)}))};return window.addEventListener(M,t),()=>{window.removeEventListener(M,t)}},[])},ja=new C,Ma=({children:e})=>(0,D.useContext)(m)?(0,$.jsx)($.Fragment,{children:e}):(0,$.jsx)(b,{client:ja,children:e}),Na=e=>{let{children:t,bootstrapPlugins:n=[],userConfigs:r=[],user:i,teamMember:a,business:o,clientObject:s,onNavigate:c,modal:l,monitoringExceptionHelper:u,showToast:d,clearToasts:f,performRequest:p,appPath:m,hideFramesOnModal:h=!0,createFileId:g,performFileUpload:_,t:v}=e;return Aa(),(0,$.jsx)(Ma,{children:(0,$.jsx)(Ri,{bootstrapPlugins:n,userConfigs:r,user:i,teamMember:a,business:o,clientObject:s,appPath:m,children:({hasFinishedBootstrapping:e,waitingOnRouteScript:n})=>(0,$.jsx)(ra,{t:v,children:(0,$.jsx)(Vi,{children:r=>(0,$.jsx)(Xi,{onNavigate:c,children:(0,$.jsx)(Wi,{...l,children:i=>(0,$.jsx)(qi,{monitoringExceptionHelper:u,children:(0,$.jsx)(Fi,{children:(0,$.jsx)(Mi,{children:(0,$.jsx)(ca,{showToast:d,clearToasts:f,children:(0,$.jsx)(wa,{children:a=>(0,$.jsx)($i,{performRequest:p,createFileId:g,performFileUpload:_,children:t({...i,showLoadingIndicator:r,hasFinishedBootstrapping:e,waitingOnRouteScript:n,hiddenByModal:h?a:!1})})})})})})})})})})})})})},Pa=(0,D.createContext)(null),Fa=Pa.Provider,Ia=(e,t)=>{if(e===`custom_object`)return t?.id},La=(e,t)=>{if(e.type===`custom_object`)return e.allow_multiple?(t?.value??[]).length>0:!!t?.value?.id;if(e.type===`field`)return e.allow_multiple?(t?.value??[]).length>0:!!t?.value?.value;if(e.type===`text`)return!!(t?.value??``).trim();if(e.type===`number`){let e=Number(t?.value);return!!t?.value&&!isNaN(e)}else if(e.type===`select`)return e.allow_multiple?(t?.value??[]).length>0:!!t?.value?.value;else if(e.type===`boolean`)return!!t?.value;return!1},Ra=e=>{let t=(e.fields??[]).filter(e=>e.type===`custom_object`),n=(e.fields??[]).filter(e=>e.type===`container`).flatMap(e=>Ra(e)),r=e.actions?.filter(e=>e.hint_object_name)??[];return[...t,...n,...r.map(e=>({...yn(e),match_hint:e.hint_object_name??``}))]},za=e=>{let t=(e.fields??[]).filter(e=>e.type===`field`),n=(e.fields??[]).filter(e=>e.type===`container`).flatMap(e=>za(e));return[...t,...n]},Ba=({children:e,config:t,value:n,onStateChange:r,disabledKeys:i,templateAssociationsByActionApiName:a,getObjectByAPIName:o,getCustomObjectDetails:s})=>{let[c,l]=(0,D.useState)(n??{}),u=(0,D.useMemo)(()=>bn(t),[t]),d=(0,D.useMemo)(()=>u.reduce((e,t)=>({...e,[t.key]:{type:t.type,value:t.default}}),{}),[u]),f=(0,D.useMemo)(()=>{let e={...Object.entries(a??{}).reduce((e,[t,n])=>{let r=`action__${t}`,i=n.map(e=>({id:e.custom_object.id??``,objectName:e.custom_object.object_name??`Unknown Object`}));return i.length>0&&n.length>0&&n[0]&&(e[r]={type:`custom_object`,value:i,config:yn(n[0].browser_js_action_template)}),e},{}),...c};return i?.forEach(t=>{e[t]&&(e[t]=void 0)}),e},[c,a,i]),p=(0,D.useRef)(!!n),m=(0,D.useRef)({}),[h,g]=(0,D.useState)(!n),[_,v]=(0,D.useState)({}),[y,b]=(0,D.useState)({}),[x,S]=(0,D.useState)(!1),C=(0,D.useRef)(null),[w,T]=(0,D.useState)({}),[E,O]=(0,D.useState)(!1),[k,A]=(0,D.useState)(!0),j=(0,D.useRef)({}),M=(0,D.useCallback)((e,t)=>{j.current[e]=t},[]),N=(0,D.useCallback)(e=>{typeof e==`function`?l(t=>{let n=e(t);return m.current=n,r?.(n),n}):(m.current=e,l(e),r?.(e)),T({})},[r]),P=(0,D.useCallback)((e,t)=>{if(e.startsWith(`{{`)&&e.endsWith(`}}`)){let n=e.slice(2,-2).trim();return Ia(t[n]?.type,t[n]?.value)}return e},[]),F=(0,D.useCallback)(e=>P(e,f),[f,P]),{clientObject:I}=zi(),L=(0,D.useCallback)(async e=>e===`client_client`&&I?[{id:I.id,object_name:I.objectName}]:await o(e),[I,o]),R=(0,D.useCallback)(async()=>{let e=Ra(t);for(let t of e){if(!t.match_hint)continue;let e=await L(t.match_hint);if(e?.[0]){let n={id:e[0].id,objectName:e[0].object_name};N(e=>({...e,[t.key]:{type:`custom_object`,value:t.allow_multiple?[n]:n}}))}}},[t,N,L]),z=(0,D.useCallback)(()=>za(t),[t]),B=(0,D.useCallback)(async(e,t)=>{let n=z(),r={};for(let i of n){if(!i.object_id)continue;let n=t??P(i.object_id,m.current);if(e&&!i.object_id.includes(e))continue;if(!r[n]&&n)try{r[n]=await s(n)}catch{}let a=r[n];if(a){let e=a.fields.find(e=>e.name===i.match_hint);e&&N(t=>({...t,[i.key]:{type:`field`,value:{value:e.id,label:e.displayName},associatedObject:{id:n,name:a.objectName}}}))}}},[P,z,N,s]),V=(0,D.useCallback)(async e=>{let n=Ra(t).find(t=>t.key===e);if(n?.match_hint){let t=``,r=(await L(n.match_hint))?.[0];r&&(t=r.id,N(t=>({...t,[e]:{type:`custom_object`,value:{id:r.id,objectName:r.object_name}}})),t&&B(void 0,t))}},[t,N,B,L]),ee=(0,D.useCallback)(async()=>{await R(),await B(),g(!1)},[R,B]),te=(0,D.useCallback)(()=>za(t),[t]),ne=(0,D.useCallback)(e=>B(e),[B]),re=(0,D.useCallback)(()=>{C.current&&=(clearTimeout(C.current),null),C.current=setTimeout(()=>{S(!0)},500)},[]),ie=(0,D.useCallback)(async(e,t)=>{re(),v(e=>({...e,[t]:!0})),O(!0);let n=await hn(e,{...d,...f});return b(e=>(e[t]===!1&&typeof n==`boolean`&&n&&(f[t]||V(t)),{...e,[t]:n})),v(e=>({...e,[t]:!1})),n},[f,re,V,d]);p.current||(p.current=!0,ee());let ae=(0,D.useCallback)(e=>y[e]===!1,[y]),oe=(0,D.useCallback)(e=>_[e]===!0,[_]),H=(0,D.useCallback)(e=>{if(w[e])return{message:w[e],showMessage:!0,error:!0}},[w]),se=(0,D.useMemo)(()=>{let e=(t.fields??[]).filter(e=>e.type===`container`).map(e=>e.when),n=u.map(e=>e.when);return[...e,...n].filter(Boolean)},[t,u]),ce=(0,D.useMemo)(()=>u.reduce((e,t)=>(e[t.key]=t,e),{}),[u]),le=(0,D.useCallback)((e,t,n)=>{t.add(e);let r=ce[e];r?.dependencies?.length&&r.dependencies.forEach(e=>{n.has(e)||(n.add(e),le(e,t,n))})},[ce]),U=(0,D.useMemo)(()=>u.map(e=>{let t=new Set,n=e.dependencies??[],r=new Set;return n.forEach(e=>{le(e,t,r)}),{...e,dependencies:Array.from(t)}}),[u,le]),ue=(0,D.useCallback)(e=>{U.filter(t=>t.dependencies.length===0?!1:t.dependencies.includes(e)&&t.key!==e).forEach(e=>{j.current[e.key]?.()})},[U]),de=(0,D.useCallback)(async()=>{let e=(await Promise.all(u.map(async e=>e.when?await hn(e.when,{...d,...f})?e:null:e))).filter(Boolean),t=0;for(let n of e)n&&n.required&&!La(n,f[n.key])?(T(e=>({...e,[n.key]:`This field is required`})),t++):n?.validation_pattern?new RegExp(n.validation_pattern).test(f[n.key]?.value??n.default??``)||(T(e=>({...e,[n.key]:`Value must match the pattern ${n.validation_pattern??``}`})),t++):n&&T(e=>({...e,[n.key]:void 0}));return{isValid:t===0,includedKeys:e.map(e=>e?.key).filter(e=>!!e)}},[f,u,d]);(0,D.useEffect)(()=>{re()},[re]);let fe=Object.values(_).filter(Boolean).length;return!E&&se.length===0&&O(!0),E&&k&&fe===0&&A(!1),(0,$.jsx)(Fa,{value:{state:f,setState:N,interpolateValue:F,getNestedFields:te,reInferFieldsForObject:ne,inferencePending:h,evaluateExpression:ie,shouldHideField:ae,shouldDisableField:oe,expressionsIdle:x,getFieldErrorState:H,validateForm:de,waitingExpressionCount:fe,initialExpressionsPending:k,flattenedFields:u,flattenedFieldsByKey:ce,afterFieldChange:ue,registerFieldResetter:M,disabledKeys:i??[]},children:e})},Va=()=>{let e=(0,D.useContext)(Pa);if(!e)throw Error(`useSetupAssistant must be used within a SetupAssistantController`);return e},Ha=({label:e,value:n,onChange:r,onSelect:a,options:o,loading:s,placeholder:c,disabled:l})=>{let[u,d]=(0,D.useState)(!1);return(0,$.jsxs)(`div`,{className:`relative flex flex-col gap-1`,children:[e&&(0,$.jsx)(`label`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-500`,children:e}),(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(t,{icon:i,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[10px] text-neutral-400`}),(0,$.jsx)(`input`,{type:`text`,className:`w-full rounded border border-black/10 bg-white py-1.5 pl-7 pr-2.5 font-mono text-[12px] text-neutral-800 focus:border-neutral-400 focus:outline-none disabled:opacity-50`,value:n,placeholder:c,disabled:l,onChange:e=>{r(e.target.value)},onFocus:()=>{d(!0)},onBlur:()=>{d(!1)}})]}),u&&(0,$.jsxs)(`ul`,{className:`absolute left-0 top-full z-10 mt-1 max-h-48 w-full overflow-auto rounded border border-black/10 bg-white shadow-lg`,children:[s&&(0,$.jsx)(`li`,{className:`px-3 py-2 text-[12px] text-neutral-400`,children:`Loading…`}),!s&&o.length===0&&n.length===0&&(0,$.jsx)(`li`,{className:`px-3 py-2 text-[12px] text-neutral-400`,children:`Start typing to search…`}),!s&&o.length===0&&n.length>0&&(0,$.jsx)(`li`,{className:`px-3 py-2 text-[12px] text-neutral-400`,children:`No results`}),!s&&o.map(e=>(0,$.jsx)(`li`,{className:`cursor-pointer px-3 py-2 text-[12px] text-neutral-800 hover:bg-neutral-100`,onMouseDown:e=>{e.preventDefault()},onClick:()=>{a(e.id,e.label),d(!1)},children:e.label},e.id))]})]})},Ua=`kizen-plugin-config:`,Wa=`kizen-plugin-user-config:`;function Ga(e){return`${Ua}${e}`}function Ka(e){return`${Wa}${e}`}function qa(e){try{let t=localStorage.getItem(Ga(e));return t?JSON.parse(t):null}catch{return null}}function Ja(e,t,n){let r={__kizen_setup_assistant_values:t,__kizen_clean_config:xn(n,t)};localStorage.setItem(Ga(e),JSON.stringify(r))}function Ya(e,t){let n={__kizen_setup_assistant_values:{},__kizen_clean_config:t};localStorage.setItem(Ga(e),JSON.stringify(n))}function Xa(e){localStorage.removeItem(Ga(e))}function Za(e){try{let t=localStorage.getItem(Ka(e));return t?JSON.parse(t):null}catch{return null}}function Qa(e,t,n){let r={__kizen_setup_assistant_values:t,__kizen_clean_config:xn(n,t)};localStorage.setItem(Ka(e),JSON.stringify(r))}function $a(e){localStorage.removeItem(Ka(e))}export{Va as _,Ja as a,gn as b,Ha as c,Sa as d,ga as f,ya as g,va as h,Za as i,Na as l,ka as m,$a as n,Ya as o,fa as p,qa as r,Qa as s,Xa as t,Ba as u,vn as v,_n as y};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DevSidebar-BiROAoKF.js","assets/rolldown-runtime-DF2fYuay.js","assets/fa-core-mHW_3JUd.js","assets/CredentialsContext-BLZX6RwF.js","assets/AppDetailPage-ObugMPkn.js","assets/Card-BSwG5koM.js","assets/validIcons-TcFXfn-E.js","assets/fa-pro-icons-CIQGXozY.js","assets/SandboxPage-BFVVe-i3.js","assets/configStorage-Bb-A9Nvj.js","assets/BootstrapContext-CEWgv2oI.js","assets/react-D_K8ni3_.js","assets/SidebarContext-Byo6PYOF.js","assets/ConfigurationPage-SnFNzZgJ.js","assets/VersionsPage-DOd2Hv8M.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{D as t,O as n,S as r,_ as i,k as a,p as o,t as s,y as c}from"./fa-core-mHW_3JUd.js";import{n as l,t as u}from"./react-D_K8ni3_.js";import{$ as d,A as f,B as p,E as m,F as h,G as g,H as _,J as v,K as y,P as b,Q as x,R as S,U as C,V as w,W as T,X as E,Y as D,Z as O,b as k,et as A,it as j,m as ee,n as te,nt as M,p as ne,q as N,r as re,rt as P,t as ie,tt as F,z as I}from"./Card-BSwG5koM.js";import{i as ae,o as oe,r as L,s as R,t as se}from"./BootstrapContext-CEWgv2oI.js";import{t as ce}from"./CredentialsContext-BLZX6RwF.js";import{t as le}from"./SidebarContext-Byo6PYOF.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var z=e(a(),1);z.use;var B=typeof window<`u`?z.useLayoutEffect:z.useEffect;function ue(e){let t=z.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function de(e,t,n={},r={}){z.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function fe(e){let t=z.useRef(null);return z.useImperativeHandle(e,()=>t.current,[]),t}function V(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var H=4,pe=5;function me(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function he(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=me(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function ge(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=he(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=W(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=W(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=G(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=G(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=G(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=W(n.fullPath??n.from);e.kind=pe,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=W(n.fullPath??n.from);e.kind=H,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)ge(e,t,r,s,i,a,o)}function _e(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function U(e){if(e.pathless)for(let t of e.pathless)U(t);if(e.static)for(let t of e.static.values())U(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())U(t);if(e.dynamic?.length){e.dynamic.sort(_e);for(let t of e.dynamic)U(t)}if(e.optional?.length){e.optional.sort(_e);for(let t of e.optional)U(t)}if(e.wildcard?.length){e.wildcard.sort(_e);for(let t of e.wildcard)U(t)}}function W(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function G(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function ve(e,t){let n=W(`/`),r=new Uint16Array(6);for(let t of e)ge(!1,r,t,1,n,0);U(n),t.masksTree=n,t.flatCache=V(1e3)}function ye(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=we(e,t.masksTree);return t.flatCache.set(e,r),r}function be(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=W(`/`),ge(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),we(r,o,n)}function xe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=we(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Ee(a.route)),t.matchCache.set(r,a),a}function Se(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ce(e,t=!1,n){let r=W(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return ge(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&g(),a[e.id]=e,s!==0&&e.path){let t=Se(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),U(r),{processedTree:{segmentTree:r,singleCache:V(1e3),matchCache:V(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function we(e,t,n=!1){let r=e.split(`/`),i=Oe(e,r,t,n);if(!i)return null;let[a]=Te(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Te(e,t,n){let r=De(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===H)break;if(u.kind===pe){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Ee(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function De(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Oe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!M(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!ke(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==H&&Ae(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&Ae(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(ke(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;Ae(u,n)&&(u=n)}}if(i.wildcard&&Ae(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!ke(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return Ae(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function ke(e,t,n){try{let[r,i]=Te(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Ae(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===H)>(e.node.kind===H)||t.node.kind===H==(e.node.kind===H)&&t.depth>e.depth))):!0}function je(e){return Me(e.filter(e=>e!==void 0).join(`/`))}function Me(e){return e.replace(/\/{2,}/g,`/`)}function Ne(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function K(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Pe(e){return K(Ne(e))}function Fe(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ie(e,t,n){return Fe(e,n)===Fe(t,n)}function Le({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&M(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(M(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=he(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Me(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function Re(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function ze(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ve(e,n)).join(`/`):Ve(r,n):r}function Be({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=he(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=ze(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=ze(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=ze(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ve(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function q(e){return!!e?.isNotFound}function He(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var Ue=`tsr-scroll-restoration-v1_3`;function We(){let e=He();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);A(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=x(e,t)||t},persist:()=>{try{e.setItem(Ue,JSON.stringify(t))}catch{}}}}var Ge=We(),Ke=e=>e.state.__TSR_key||e.href;function qe(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var Je=!1,Ye=`window`,Xe=`data-scroll-restoration-id`;function Ze(e,t){if(!Ge)return;let n=Ge;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Je=!1;let r=e.options.getScrollRestorationKey||Ke,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(Je||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(Ye,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===Ye)n=Ye;else if(e.isConnected){let t=e.getAttribute(Xe);n=t?`[${Xe}="${t}"]`:qe(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.state??e.stores.location.state)),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){Je=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!A(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===Ye)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===Ye)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{Je=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function Qe(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function $e(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function et(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=$e(r):Array.isArray(t)?t.push($e(r)):n[e]=[t,$e(r)]}return n}var tt=rt(JSON.parse),nt=it(JSON.stringify,JSON.parse);function rt(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=et(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function it(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Qe(e,r);return t?`?${t}`:``}}var at=`__root__`;function ot(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function J(e){return e instanceof Response&&!!e.options}function st(e){return{input:({url:t})=>{for(let n of e)t=lt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ut(e[n],t);return t}}}function ct(e){let t=Pe(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=je([`/`,t,e.pathname]),e)}}function lt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ut(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function dt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>ft(o,_.state)),x=r(()=>ft(s,v.state)),S=r(()=>ft(c,y.state)),C=r(()=>_.state[0]),w=r(()=>_.state.some(e=>o.get(e)?.state.status===`pending`)),T=r(()=>({locationHref:p.state.href,resolvedLocationHref:m.state?.href,status:l.state})),E=r(()=>({status:l.state,loadedAt:u.state,isLoading:d.state,isTransitioning:f.state,matches:b.state,location:p.state,resolvedLocation:m.state,statusCode:h.state,redirect:g.state})),D=V(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.state;for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.state}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingMatchesId:v,cachedMatchesId:y,activeMatchesSnapshot:b,pendingMatchesSnapshot:x,cachedMatchesSnapshot:S,firstMatchId:C,hasPendingMatches:w,matchRouteReactivity:T,activeMatchStoresById:o,pendingMatchStoresById:s,cachedMatchStoresById:c,__store:E,getMatchStoreByRouteId:O,setActiveMatches:A,setPendingMatches:j,setCachedMatches:ee};A(e.matches),a?.(k);function A(e){pt(e,o,_,n,i)}function j(e){pt(e,s,v,n,i)}function ee(e){pt(e,c,y,n,i)}return k}function ft(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.state)}return n}function pt(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.state!==n&&e.setState(()=>n)}N(n.state,a)||n.setState(()=>a)})}var mt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ht=e=>e.stores.matchesId.state.some(t=>e.stores.activeMatchStoresById.get(t)?.state._forcePending),gt=(e,t)=>!!(e.preload&&!e.router.stores.activeMatchStoresById.has(t)),_t=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},vt=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Y=(e,t,n)=>{if(!(!J(n)&&!q(n)))throw J(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:J(n)?`redirected`:r.status===`pending`?`success`:r.status,context:_t(e,t.index),isFetching:!1,error:n})),q(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),J(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},yt=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},bt=(e,t,n)=>{let r=_t(e,n);e.updateMatch(t,e=>({...e,context:r}))},xt=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Y(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,Y(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!J(n)&&!q(n)&&(e.serialError??=n)},St=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!gt(e,t)&&(n.options.loader||n.options.beforeLoad||Nt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{mt(e)},i);r._nonReactive.pendingTimeout=t}},Ct=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;St(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Y(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},wt=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=v(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&xt(e,n,o,`PARSE_PARAMS`),s&&xt(e,n,s,`VALIDATE_SEARCH`),St(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=v();let f={..._t(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=gt(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},y=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(J(r)||q(r))&&(u(),xt(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},b;try{if(b=r.options.beforeLoad(_),F(b))return u(),b.catch(t=>{xt(e,n,t,`BEFORE_LOAD`)}).then(y)}catch(t){u(),xt(e,n,t,`BEFORE_LOAD`)}y(b)},Tt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>wt(e,n,t,i),s=()=>{if(yt(e,n))return;let t=Ct(e,n,i);return F(t)?t.then(o):o()};return a()},Et=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Dt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=_t(e,r),d=gt(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Ot=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Mt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Dt(e,t,n,r,i)),l=!!s&&F(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Y(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:_t(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:_t(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,q(t)&&await i.options.notFoundComponent?.preload?.(),Y(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Y(e,e.router.getMatch(n),t)}!J(o)&&!q(o)&&await Mt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:_t(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Y(e,r,t)}},kt=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Dt(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Ot(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){J(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Ot(e,t,i,n,d):bt(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(yt(e,i)){if(!e.router.getMatch(i))return e.matches[n];bt(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.state[n],s=(o&&e.router.stores.activeMatchStoresById.get(o)||null)?.routeId===a?o:e.router.stores.activeMatchesSnapshot.state.find(e=>e.routeId===a)?.id,l=gt(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Y(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.activeMatchStoresById.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=v(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function At(e){let t=e,n=[];ht(t.router)&&mt(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Tt(t,e);F(n)&&await n}catch(e){if(J(e))throw e;if(q(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?vt(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(kt(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(J(e))throw e;q(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=vt(t,l);e===void 0&&g();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Mt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Mt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Et(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=mt(t);if(F(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function jt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Mt(e,t=Pt){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Pt?(()=>{if(e._componentsPromise===void 0){let t=jt(e,Pt);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():jt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Nt(e){for(let t of Pt)if(e.options[t]?.preload)return!0;return!1}var Pt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],X=`__TSR_index`,Ft=`popstate`,It=`beforeunload`;function Lt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Vt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[X];i=Rt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[X];i=Rt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[X]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Rt(e,t){t||={};let n=Ht();return{...t,key:n,__TSR_key:n,[X]:e}}function zt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Vt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Ht();t.history.replaceState({[X]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Vt(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[X]-l.state[X],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Lt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(It,S,{capture:!0}),t.removeEventListener(Ft,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(It,S,{capture:!0}),t.addEventListener(Ft,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Bt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Vt(e,t){let n=Bt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Ht();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[X]:0,key:a,__TSR_key:a}}}function Ht(){return(Math.random()+1).toString(36).substring(7)}function Ut(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Wt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Re(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=zt()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=V(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=dt(qt(this.latestLocation),e),Ze(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=Pe(o);t&&t!==`/`&&e.push(ct({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:st(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ce(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&ve(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:D(e).path,external:!1,searchStr:o,search:P(t?.search,i),hash:D(r.slice(1)).path,state:j(t?.state,a)}}let o=new URL(i,this.origin),s=lt(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:D(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:P(t?.search,c),hash:D(s.hash.slice(1)).path,state:j(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Le({base:e,to:Me(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Yt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingMatchesId.state.forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.state.forEach(e=>{if(this.stores.pendingMatchStoresById.has(e))return;let t=this.stores.activeMatchStoresById.get(e)?.state;t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,x(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:D(Be({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Jt(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=Xt({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=P(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?x(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?x(t.state,n.state):{};_=j(n.state,_);let v=`${f}${m}${g}`,y,b,S=!1;if(this.rewrite){let e=new URL(v,this.origin),t=ut(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,S=!0)}else y=O(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=ye(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,x(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=E(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=K(this.latestLocation.href)===K(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=v(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Vt(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=lt(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(d(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatchesSnapshot.state.filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.setState(()=>`pending`),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(e),this.stores.setCachedMatches(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.state??this.stores.location.state;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.stores.resolvedLocation.state,r=Ut(t,n);this.stores.redirect.state||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await At({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatchesSnapshot.state,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatchesSnapshot.state,a=i.length,o=this.stores.activeMatchesSnapshot.state;e=a?o.filter(e=>!this.stores.pendingMatchStoresById.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStoresById.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),a&&(this.stores.setActiveMatches(i),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){J(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):q(e)&&(n=e);let r=t?t.status:n?404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>r),this.stores.redirect.setState(()=>t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.setState(()=>a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.state,a=typeof t.types==`function`?t.types(Ut(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStoresById.get(e);if(n){n.setState(t);return}let r=this.stores.activeMatchStoresById.get(e);if(r){r.setState(t);return}let i=this.stores.cachedMatchStoresById.get(e);if(i){let n=t(i.state);n.status===`redirected`?this.stores.cachedMatchStoresById.delete(e)&&this.stores.cachedMatchesId.setState(t=>t.filter(t=>t!==e)):i.setState(()=>n)}})},this.getMatch=e=>this.stores.cachedMatchStoresById.get(e)?.state??this.stores.pendingMatchStoresById.get(e)?.state??this.stores.activeMatchStoresById.get(e)?.state,this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(t)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(t)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&d(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCachedMatches([]):this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=Mt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),i=new Set([...r,...this.stores.cachedMatchesId.state]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...e,...a])}try{return n=await At({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(J(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});q(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.state!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.state:t.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,a=be(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!E(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?E(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??nt,parseSearch:e.parseSearch??tt,protocolAllowlist:e.protocolAllowlist??y}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:K(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?Qt(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&u.set(e.routeId,e.state);for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=Jt(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof Gt||(r=new Gt(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=Be({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),y=r.id+g+h,b=this.getMatch(y),x=u.get(r.id),S=b?._strictParams??_,C;if(!b)try{$t(r,_,a,S)}catch(e){if(C=q(e)||J(e)?e:new Kt(e.message,{cause:e}),t?.throwOnError)throw C}Object.assign(i,S);let w=x?`stay`:`enter`,T;if(b)T={...b,cause:w,params:x?.params??i,_strictParams:S,search:P(x?x.search:b.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Nt(r)?`pending`:`success`;T={id:y,ssr:r.options.ssr,index:n,routeId:r.id,params:x?.params??i,_strictParams:S,pathname:g,updatedAt:Date.now(),search:x?P(x.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:C,__routeContext:void 0,_nonReactive:{loadPromise:v()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:w,loaderDeps:x?j(x.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(T.globalNotFound=c===r.id),T.searchError=p;let E=this.getParentContext(s);T.context={...E,...T.__routeContext,...T.__beforeLoadContext},l[n]=T}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?P(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=M(t),a={...e.search};for(let e of t)try{Object.assign(a,Jt(e.options.validateSearch,a))}catch{}let o=M(this.stores.matchesId.state),s=o&&this.stores.activeMatchStoresById.get(o)?.state,c=s&&s.routeId===i.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{$t(i,n,r??{},e)}catch{}l=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:l}}},Gt=class extends Error{},Kt=class extends Error{};function qt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Jt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Gt(`Async validation not supported`);if(n.issues)throw new Gt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Yt({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=K(e),a,o,s=xe(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function Xt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Zt(n)(e,t,r??!1)}function Zt(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Jt(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:x(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Qt(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return at}function $t(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var en=`Error preloading route! ☝️`,tn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=at:this.parentRoute||g();let r=n?at:t?.path;r&&r!==`/`&&(r=Ne(r));let i=t?.id||r,a=n?at:je([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=je([`/`,a]));let o=a===`__root__`?`/`:je([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=K(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ot({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},nn=class extends tn{constructor(e){super(e)}};function rn(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.state,n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}var Z=n();function an(e){let t=e.errorComponent??sn;return(0,Z.jsx)(on,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?z.createElement(t,{error:n,reset:r}):e.children})}var on=class extends z.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function sn({error:e}){let[t,n]=z.useState(!1);return(0,Z.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Z.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Z.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Z.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Z.jsx)(`div`,{children:(0,Z.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Z.jsx)(`code`,{children:e.message}):null})}):null]})}function cn({children:e,fallback:t=null}){return ln()?(0,Z.jsx)(z.Fragment,{children:e}):(0,Z.jsx)(z.Fragment,{children:t})}function ln(){return z.useSyncExternalStore(un,()=>!0,()=>!1)}function un(){return()=>{}}var Q=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Q||{});function dn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function fn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var pn=[],mn=0,{link:hn,unlink:gn,propagate:_n,checkDirty:vn,shallowPropagate:yn}=dn({update(e){return e._update()},notify(e){pn[xn++]=e,e.flags&=~Q.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Q.Mutable|Q.Dirty,wn(e))}}),bn=0,xn=0,$,Sn=0;function Cn(e){try{++Sn,e()}finally{--Sn||Tn()}}function wn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=gn(n,e)}function Tn(){if(!(Sn>0)){for(;bn<xn;){let e=pn[bn];pn[bn++]=void 0,e.notify()}bn=0,xn=0}}function En(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Q.None:Q.Mutable,get(){return $!==void 0&&hn(i,$,mn),i._snapshot},subscribe(e){let t=fn(e),n={current:!1},r=Dn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=$,o=t?.compare??Object.is;if(n)$=i,++mn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Q.Mutable|Q.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{$=a,n&&(i.flags&=~Q.RecursedCheck),wn(i)}}};return n?(i.flags=Q.Mutable|Q.Dirty,i.get=function(){let e=i.flags;if(e&Q.Dirty||e&Q.Pending&&vn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&yn(e)}}else e&Q.Pending&&(i.flags=e&~Q.Pending);return $!==void 0&&hn(i,$,mn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(_n(e),yn(e),Tn())}},i}function Dn(e){let t=()=>{let t=$;$=n,++mn,n.depsTail=void 0,n.flags=Q.Watching|Q.RecursedCheck;try{return e()}finally{$=t,n.flags&=~Q.RecursedCheck,wn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Q.Watching|Q.RecursedCheck,notify(){let e=this.flags;e&Q.Dirty||e&Q.Pending&&vn(this.deps,this)?t():this.flags=Q.Watching},stop(){this.flags=Q.None,this.depsTail=void 0,wn(this)}};return t(),n}var On=class{constructor(e){this.atom=En(e)}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(fn(e))}},kn=class{constructor(e){this.atom=En(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(fn(e))}};function An(e){return typeof e==`function`?new kn(e):new On(e)}function jn(e){return p({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Mn(e){let{select:t,...n}=e;return p({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Nn(e){return p({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Pn(e){let t=C();return z.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Fn(e){return p({...e,select:t=>e.select?e.select(t.context):t.context})}var In=l();function Ln(e,t){let n=C(),r=fe(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:S,onBlur:T,onFocus:D,onMouseEnter:O,onMouseLeave:k,onTouchStart:A,ignoreBlocker:j,params:ee,search:te,hash:M,state:ne,mask:N,reloadDocument:re,unsafeRelative:P,from:ie,_fromLocation:F,...I}=e,ae=ln(),oe=z.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),L=w(n.stores.location,e=>e,(e,t)=>e.href===t.href),R=z.useMemo(()=>{let e={_fromLocation:L,...oe};return n.buildLocation(e)},[n,L,oe]),se=R.maskedLocation?R.maskedLocation.publicHref:R.publicHref,ce=R.maskedLocation?R.maskedLocation.external:R.external,le=z.useMemo(()=>Kn(se,ce,n.history,v),[v,ce,se,n.history]),B=z.useMemo(()=>{if(le?.external)return d(le.href,n.protocolAllowlist)?void 0:le.href;if(!qn(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),d(s,n.protocolAllowlist)?void 0:s}catch{}},[s,le,n.protocolAllowlist]),ue=z.useMemo(()=>{if(B)return!1;if(o?.exact){if(!Ie(L.pathname,R.pathname,n.basepath))return!1}else{let e=Fe(L.pathname,n.basepath),t=Fe(R.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!E(L.search,R.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ae&&L.hash===R.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,L,B,ae,R.hash,R.pathname,R.search,n.basepath]),V=ue?x(i,{})??zn:Rn,H=ue?Rn:x(a,{})??Rn,pe=[b,V.className,H.className].filter(Boolean).join(` `),me=(y||V.style||H.style)&&{...y,...V.style,...H.style},[he,ge]=z.useState(!1),_e=z.useRef(!1),U=e.reloadDocument||B?!1:c??n.options.defaultPreload,W=l??n.options.defaultPreloadDelay??0,G=z.useCallback(()=>{n.preloadRoute({...oe,_builtLocation:R}).catch(e=>{console.warn(e),console.warn(en)})},[n,oe,R]);de(r,z.useCallback(e=>{e?.isIntersecting&&G()},[G]),Wn,{disabled:!!v||U!==`viewport`}),z.useEffect(()=>{_e.current||!v&&U===`render`&&(G(),_e.current=!0)},[v,G,U]);let ve=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Yn(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,In.flushSync)(()=>{ge(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ge(!1)});n.navigate({...oe,replace:f,resetScroll:m,hashScrollIntoView:u,startTransition:p,viewTransition:h,ignoreBlocker:j})}};if(B)return{...I,ref:r,href:B,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...S&&{onClick:S},...T&&{onBlur:T},...D&&{onFocus:D},...O&&{onMouseEnter:O},...k&&{onMouseLeave:k},...A&&{onTouchStart:A}};let ye=e=>{if(v||U!==`intent`)return;if(!W){G();return}let t=e.currentTarget;if(Un.has(t))return;let n=setTimeout(()=>{Un.delete(t),G()},W);Un.set(t,n)},be=e=>{v||U!==`intent`||G()},xe=e=>{if(v||!U||!W)return;let t=e.currentTarget,n=Un.get(t);n&&(clearTimeout(n),Un.delete(t))};return{...I,...V,...H,href:le?.href,ref:r,onClick:Gn([S,ve]),onBlur:Gn([T,xe]),onFocus:Gn([D,ye]),onMouseEnter:Gn([O,ye]),onMouseLeave:Gn([k,xe]),onTouchStart:Gn([A,be]),disabled:!!v,target:_,...me&&{style:me},...pe&&{className:pe},...v&&Bn,...ue&&Vn,...ae&&he&&Hn}}var Rn={},zn={className:`active`},Bn={role:`link`,"aria-disabled":!0},Vn={"data-status":`active`,"aria-current":`page`},Hn={"data-transitioning":`transitioning`},Un=new WeakMap,Wn={rootMargin:`100px`},Gn=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Kn(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function qn(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Jn=z.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Ln(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return z.createElement(`a`,t,o)}return z.createElement(n,a,o)});function Yn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Xn=class extends tn{constructor(e){super(e),this.useMatch=e=>p({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Fn({...e,from:this.id}),this.useSearch=e=>Nn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>I({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Mn({...e,from:this.id}),this.useLoaderData=e=>jn({...e,from:this.id}),this.useNavigate=()=>Pn({from:this.fullPath}),this.Link=z.forwardRef((e,t)=>(0,Z.jsx)(Jn,{ref:t,from:this.fullPath,...e}))}};function Zn(e){return new Xn(e)}var Qn=class extends nn{constructor(e){super(e),this.useMatch=e=>p({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Fn({...e,from:this.id}),this.useSearch=e=>Nn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>I({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Mn({...e,from:this.id}),this.useLoaderData=e=>jn({...e,from:this.id}),this.useNavigate=()=>Pn({from:this.fullPath}),this.Link=z.forwardRef((e,t)=>(0,Z.jsx)(Jn,{ref:t,from:this.fullPath,...e}))}};function $n(e){return new Qn(e)}function er(e){let t=C(),n=`not-found-${w(t.stores.location,e=>e.pathname)}-${w(t.stores.status,e=>e)}`;return(0,Z.jsx)(an,{getResetKey:()=>n,onCatch:(t,n)=>{if(q(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(q(t))return e.fallback?.(t);throw t},children:e.children})}function tr(){return(0,Z.jsx)(`p`,{children:`Not Found`})}function nr(e){return(0,Z.jsx)(Z.Fragment,{children:e.children})}function rr(e,t,n){return t.options.notFoundComponent?(0,Z.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Z.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Z.jsx)(tr,{})}var ir=z.memo(function({matchId:e}){let t=C(),n=t.stores.activeMatchStoresById.get(e);n||g();let r=w(t.stores.loadedAt,e=>e),i=w(n,e=>e);return(0,Z.jsx)(ar,{router:t,matchId:e,resetKey:r,matchState:z.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function ar({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,Z.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?z.Suspense:nr,f=s?an:nr,p=l?er:nr;return(0,Z.jsxs)(i.isRoot?i.options.shellComponent??nr:nr,{children:[(0,Z.jsx)(_.Provider,{value:t,children:(0,Z.jsx)(d,{fallback:o,children:(0,Z.jsx)(f,{getResetKey:()=>n,errorComponent:s||sn,onCatch:(e,t)=>{if(q(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,Z.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return z.createElement(l,e)},children:u||r._displayPending?(0,Z.jsx)(cn,{fallback:o,children:(0,Z.jsx)(sr,{matchId:t})}):(0,Z.jsx)(sr,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(or,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function or({resetKey:e}){let t=C(),n=z.useRef(void 0);return B(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Ut(t.stores.location.state,t.stores.resolvedLocation.state)}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var sr=z.memo(function({matchId:e}){let t=C(),n=t.stores.activeMatchStoresById.get(e);n||g();let r=w(n,e=>e),i=r.routeId,a=t.routesById[i],o=z.useMemo(()=>{let e=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return e?JSON.stringify(e):void 0},[i,r.loaderDeps,r._strictParams,r._strictSearch,t.options.defaultRemountDeps,t.routesById]),s=z.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,Z.jsx)(e,{},o):(0,Z.jsx)(cr,{})},[o,a.options.component,t.options.defaultComponent]);if(r._displayPending)throw t.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw t.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(r.id);if(n&&!n._nonReactive.minPendingPromise){let t=v();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(r.id)?._nonReactive.loadPromise}if(r.status===`notFound`)return q(r.error)||g(),rr(t,a,r.error);if(r.status===`redirected`)throw J(r.error)||g(),t.getMatch(r.id)?._nonReactive.loadPromise;if(r.status===`error`)throw r.error;return s}),cr=z.memo(function(){let e=C(),t=z.useContext(_),n,r=!1,i;{let a=t?e.stores.activeMatchStoresById.get(t):void 0;[n,r]=w(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=w(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,Z.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||g(),rr(e,a,void 0);if(!i)return null;let s=(0,Z.jsx)(ir,{matchId:i});return n===`__root__`?(0,Z.jsx)(z.Suspense,{fallback:o,children:s}):s});function lr(){let e=C(),t=z.useRef({router:e,mounted:!1}),[n,r]=z.useState(!1),i=w(e.stores.isLoading,e=>e),a=w(e.stores.hasPendingMatches,e=>e),o=ue(i),s=i||n||a,c=ue(s),l=i||a,u=ue(l);return e.startTransition=e=>{r(!0),z.startTransition(()=>{e(),r(!1)})},z.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return K(e.latestLocation.publicHref)!==K(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),B(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),B(()=>{o&&!i&&e.emit({type:`onLoad`,...Ut(e.stores.location.state,e.stores.resolvedLocation.state)})},[o,e,i]),B(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Ut(e.stores.location.state,e.stores.resolvedLocation.state)})},[l,u,e]),B(()=>{if(c&&!s){let t=Ut(e.stores.location.state,e.stores.resolvedLocation.state);e.emit({type:`onResolved`,...t}),Cn(()=>{e.stores.status.setState(()=>`idle`),e.stores.resolvedLocation.setState(()=>e.stores.location.state)}),t.hrefChanged&&rn(e)}},[s,c,e]),null}function ur(){let e=C(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,Z.jsx)(t,{}):null,r=(0,Z.jsxs)(typeof document<`u`&&e.ssr?nr:z.Suspense,{fallback:n,children:[(0,Z.jsx)(lr,{}),(0,Z.jsx)(dr,{})]});return e.options.InnerWrap?(0,Z.jsx)(e.options.InnerWrap,{children:r}):r}function dr(){let e=C(),t=w(e.stores.firstMatchId,e=>e),n=w(e.stores.loadedAt,e=>e),r=t?(0,Z.jsx)(ir,{matchId:t}):null;return(0,Z.jsx)(_.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,Z.jsx)(an,{getResetKey:()=>n,errorComponent:sn,onCatch:void 0,children:r})})}var fr=e=>({createMutableStore:An,createReadonlyStore:An,batch:Cn}),pr=e=>new mr(e),mr=class extends Wt{constructor(e){super(e,fr)}};function hr({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,Z.jsx)(T.Provider,{value:e,children:t});return e.options.Wrap?(0,Z.jsx)(e.options.Wrap,{children:r}):r}function gr({router:e,...t}){return(0,Z.jsx)(hr,{router:e,...t,children:(0,Z.jsx)(ur,{})})}function _r(e){let t=C({warn:e?.router===void 0}),n=e?.router||t,r=(0,z.useRef)(void 0);return w(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=j(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var vr=class extends S{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),b(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&m(t.mutationKey)!==m(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??R();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){k.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function yr(e,t){let n=ee(t),[r]=z.useState(()=>new vr(n,e));z.useEffect(()=>{r.setOptions(e)},[r,e]);let i=z.useSyncExternalStore(z.useCallback(e=>r.subscribe(k.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=z.useCallback((e,t)=>{r.mutate(e,t).catch(f)},[r]);if(i.error&&h(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var br=u();function xr(e){let{apiKey:t,userId:n,businessId:r,environment:i}=e;return{queryKey:[`bootstrap`,i,t,n,r],enabled:!!(t&&n&&r),queryFn:async()=>{let e=await fetch(`/api/proxy/auth/bootstrap`,{headers:{"x-proxy-target":ae[i],"X-API-KEY":t,"X-USER-ID":n,"X-BUSINESS-ID":r}});if(!e.ok)throw Error(`Bootstrap failed: ${String(e.status)} ${e.statusText}`);return e.json()},retry:!1}}function Sr(e){let{apiKey:t,userId:n,businessId:r,environment:i}=e;return{queryKey:[`businessPluginApps`,i,t,n,r],enabled:!!(t&&n&&r),queryFn:async()=>{let e=await fetch(`/api/proxy/external-integrations/business-plugin-apps`,{headers:{"x-proxy-target":ae[i],"X-API-KEY":t,"X-USER-ID":n,"X-BUSINESS-ID":r}});if(!e.ok)throw Error(`businessPluginApps failed: ${String(e.status)} ${e.statusText}`);return e.json()},retry:!1}}function Cr(){let e=ee(),[t,n]=(0,z.useState)([]),[r,i]=(0,z.useState)([]),[a,o]=(0,z.useState)([]),[s,c]=(0,z.useState)(null);return(0,z.useEffect)(()=>{let t=window.location.protocol===`https:`?`wss:`:`ws:`,r=new WebSocket(`${t}//${window.location.host}`);return r.addEventListener(`message`,t=>{let r;try{r=JSON.parse(t.data)}catch{return}if(r.type===`rebuild`)e.invalidateQueries({queryKey:[`bundle`]});else if(r.type===`log`)n(e=>[...e,r.message]);else if(r.type===`proxy-log`){let e=r.entry??{kind:`info`,message:r.message??``};i(t=>[...t,e])}else if(r.type===`console-message`){let e=[`log`,`warn`,`error`,`info`].includes(r.level)?r.level:`log`;o(t=>[...t,{level:e,args:r.args}])}else c(r.credentials)}),()=>{r.close()}},[e]),{buildLogs:t,proxyLogs:r,consoleLogs:a,clearConsoleLogs:()=>{o([])},serverCredentials:s}}var wr=`modulepreload`,Tr=function(e){return`/`+e},Er={},Dr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Tr(t,n),t in Er)return;Er[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:wr,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Or=(0,z.lazy)(()=>Dr(()=>import(`./DevSidebar-BiROAoKF.js`).then(e=>({default:e.DevSidebar})),__vite__mapDeps([0,1,2,3]))),kr=window.open.bind(window),Ar=416,jr=280,Mr=800,Nr={apiKey:``,userId:``,businessId:``,environment:`go`},Pr=()=>{let{buildLogs:e,proxyLogs:n,consoleLogs:a,clearConsoleLogs:l,serverCredentials:u}=Cr(),[d,f]=(0,z.useState)(()=>localStorage.getItem(`devtools-sidebar-open`)===`true`),[p,m]=(0,z.useState)(()=>localStorage.getItem(`kizen-flag-script-runner-logging`)===`true`),[h,g]=(0,z.useState)(()=>{let e=parseInt(localStorage.getItem(`devtools-sidebar-width`)??``,10);return isNaN(e)?Ar:Math.min(Mr,Math.max(jr,e))}),_=()=>{f(e=>{let t=!e;return localStorage.setItem(`devtools-sidebar-open`,String(t)),t})},v=()=>{m(e=>{let t=!e;return localStorage.setItem(`kizen-flag-script-runner-logging`,String(t)),t})},y=(0,z.useCallback)(e=>{g(e),localStorage.setItem(`devtools-sidebar-width`,String(e))},[]),[b,x]=(0,z.useState)(()=>{try{return{...Nr,...JSON.parse(localStorage.getItem(`devtools-credentials`)??`{}`)}}catch{return Nr}});(0,z.useEffect)(()=>{fetch(`/api/credentials`).then(e=>e.json()).then(e=>{if(e.apiKey){let t={...Nr,...e};x(t),localStorage.setItem(`devtools-credentials`,JSON.stringify(t))}}).catch(()=>{})},[]),(0,z.useEffect)(()=>{if(!u)return;let e={...Nr,...u};x(e),localStorage.setItem(`devtools-credentials`,JSON.stringify(e))},[u]);let S=e=>{x(e),localStorage.setItem(`devtools-credentials`,JSON.stringify(e))},{data:C,isLoading:w,isError:T}=re(te),{data:E,isError:D,isLoading:O}=re(xr(b)),{data:k}=re(Sr(b)),A=ee(),j=yr({mutationFn:async({apiName:e,hasExistingEntry:t,nextDisabled:n})=>{let r={"x-proxy-target":ae[b.environment],"X-API-KEY":b.apiKey,"X-USER-ID":b.userId,"X-BUSINESS-ID":b.businessId,"Content-Type":`application/json`},i=t?await fetch(`/api/proxy/external-integrations/business-plugin-apps/${e}`,{method:`PATCH`,headers:r,body:JSON.stringify({disabled:n})}):await fetch(`/api/proxy/external-integrations/business-plugin-apps`,{method:`POST`,headers:r,body:JSON.stringify({plugin_app_api_name:e,disabled:!1,config:{}})});if(!i.ok){let e=await i.text().catch(()=>``);throw Error(`${n?`uninstall`:`install`} failed: ${String(i.status)} ${i.statusText} ${e}`)}},onSuccess:async()=>{await fetch(`/api/proxy-cache/clear`).catch(()=>{}),await Promise.all([A.invalidateQueries({queryKey:[`bootstrap`]}),A.invalidateQueries({queryKey:[`businessPluginApps`]})])}}),M=Pn(),{location:ne}=_r(),N=/^\/([^/]+)\/.+/.exec(ne.pathname)?.[1],P=/^\/[^/]+\/([^/]+)$/.exec(ne.pathname)?.[1],ie=!!N&&!!C?.some(e=>e.api_name===N),F=N?k?.find(e=>e.plugin_app.api_name===N):void 0,I=!!F&&!F.disabled,oe=!!E&&!!k&&ie,R=j.isPending?I?`uninstalling…`:`installing…`:I?`Uninstall Plugin`:`Install Plugin`,B=j.isPending?`cursor-wait opacity-50`:``,ue=w?`loading`:T?`error`:C?`loaded`:`empty`,de=O?`authenticating`:D?`auth error`:E?`authenticated`:`no auth`,fe=w?`bg-neutral-100 text-neutral-400`:T?`bg-red-100 text-red-700`:C?`bg-green-100 text-green-700`:`bg-yellow-100 text-yellow-700`,V=O?`bg-neutral-100 text-neutral-400`:D?`bg-red-100 text-red-700`:E?`bg-green-100 text-green-700`:`bg-yellow-100 text-yellow-700`;return(0,Z.jsx)(ce.Provider,{value:b,children:(0,Z.jsx)(le.Provider,{value:d?h:0,children:(0,Z.jsx)(se.Provider,{value:E,children:(0,Z.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden font-mono`,children:[(0,Z.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-center gap-3 border-b border-black/10 bg-white/85 px-5 py-3 backdrop-blur-sm`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-bold tracking-tight text-neutral-900`,children:`Kizen App Builder`}),C&&C.length>0&&(0,Z.jsx)(`select`,{value:N??``,onChange:e=>void M({to:`/$apiName/summary`,params:{apiName:e.target.value}}),className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:C.map(e=>{let t=e.api_name;return(0,Z.jsx)(`option`,{value:t,children:e.name??t},t)})}),P&&N&&(0,Z.jsxs)(`select`,{value:P,onChange:e=>void M({to:`/${N}/${e.target.value}`}),className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:[(0,Z.jsx)(`option`,{value:`summary`,children:`Summary`}),(0,Z.jsx)(`option`,{value:`sandbox`,children:`Sandbox`}),(0,Z.jsx)(`option`,{value:`configuration`,children:`Configuration`}),(0,Z.jsx)(`option`,{value:`versions`,children:`Versions`})]}),(0,Z.jsx)(`div`,{className:`flex-1`}),(0,Z.jsxs)(`button`,{onClick:()=>{window.location.reload()},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Refresh page`,children:[(0,Z.jsx)(t,{icon:c}),(0,Z.jsx)(`span`,{children:`Refresh`})]}),(0,Z.jsxs)(`button`,{onClick:()=>{kr(L[b.environment],`_blank`,`noopener,height=900`)},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Open Kizen`,children:[(0,Z.jsx)(t,{icon:o}),(0,Z.jsx)(`span`,{children:`Open Kizen`})]}),(0,Z.jsxs)(`button`,{onClick:v,className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Toggle script runner debug logging`,children:[(0,Z.jsx)(t,{icon:s}),(0,Z.jsx)(`span`,{children:`Script Runner Logging`}),(0,Z.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${p?`bg-green-500`:`bg-neutral-300`}`})]}),(0,Z.jsxs)(`button`,{onClick:_,className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Toggle dev tools`,children:[(0,Z.jsx)(t,{icon:r}),(0,Z.jsx)(`span`,{children:`DevTools`}),(0,Z.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${d?`bg-green-500`:`bg-neutral-300`}`})]}),oe&&N&&(0,Z.jsxs)(`button`,{type:`button`,disabled:j.isPending,onClick:()=>{j.mutate({apiName:N,hasExistingEntry:!!F,nextDisabled:I})},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 transition-colors hover:border-black/20 hover:text-neutral-800 ${B}`,"aria-label":R,children:[(0,Z.jsx)(t,{icon:i}),(0,Z.jsx)(`span`,{children:R}),(0,Z.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${I?`bg-green-500`:`bg-neutral-300`}`})]}),(0,Z.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${fe}`,children:ue}),(0,Z.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${V}`,children:de})]}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto p-6`,style:{backgroundImage:`
|
|
3
|
-
linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
|
|
4
|
-
linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px)
|
|
5
|
-
`,backgroundSize:`24px 24px`},children:(0,Z.jsx)(z.Suspense,{fallback:null,children:(0,Z.jsx)(cr,{})})}),d&&(0,Z.jsx)(z.Suspense,{fallback:null,children:(0,Z.jsx)(Or,{onClose:_,buildLogs:e,proxyLogs:n,consoleLogs:a,onClearConsole:()=>{l()},credentials:b,onCredentialsChange:S,width:h,onWidthChange:y})})]})]})})})})},Fr=()=>{let{data:e,isLoading:t,isError:n}=re(te),r=Pn();return(0,z.useEffect)(()=>{e&&e.length>0&&r({to:`/$apiName/summary`,params:{apiName:e[0]?.api_name}})},[e,r]),t?(0,Z.jsx)(ie,{children:(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})}):n?(0,Z.jsx)(ie,{children:(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json. Make sure the dev server is running from a plugin directory.`})}):!e||e.length===0?(0,Z.jsx)(ie,{children:(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-yellow-700`,children:[`bundle.json is empty. Run`,` `,(0,Z.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:`appbuilder build`}),` to generate it.`]})}):null},Ir=(0,z.lazy)(()=>Dr(()=>import(`./AppDetailPage-ObugMPkn.js`).then(e=>({default:e.AppDetailPage})),__vite__mapDeps([4,2,1,5,6,7]))),Lr=(0,z.lazy)(()=>Dr(()=>import(`./SandboxPage-BFVVe-i3.js`).then(e=>({default:e.SandboxPage})),__vite__mapDeps([8,1,2,9,5,10,3,11,12,6,7]))),Rr=(0,z.lazy)(()=>Dr(()=>import(`./ConfigurationPage-SnFNzZgJ.js`).then(e=>({default:e.ConfigurationPage})),__vite__mapDeps([13,1,2,9,5,10,3,11]))),zr=(0,z.lazy)(()=>Dr(()=>import(`./VersionsPage-DOd2Hv8M.js`).then(e=>({default:e.VersionsPage})),__vite__mapDeps([14,1,2,5]))),Br=$n({component:Pr}),Vr=Zn({getParentRoute:()=>Br,path:`/`,component:Fr}),Hr=Zn({getParentRoute:()=>Br,path:`/$apiName/summary`,component:Ir}),Ur=Zn({getParentRoute:()=>Br,path:`/$apiName/sandbox`,component:Lr}),Wr=Zn({getParentRoute:()=>Br,path:`/$apiName/configuration`,component:Rr}),Gr=Zn({getParentRoute:()=>Br,path:`/$apiName/versions`,component:zr}),Kr=pr({routeTree:Br.addChildren([Vr,Hr,Ur,Wr,Gr])}),qr=document.getElementById(`root`),Jr=new oe;if(qr===null)throw Error(`Root element not found`);(0,br.createRoot)(qr).render((0,Z.jsx)(z.StrictMode,{children:(0,Z.jsx)(ne,{client:Jr,children:(0,Z.jsx)(gr,{router:Kr})})}));
|