authhero 8.3.0 → 8.4.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/assets/u/js/client.js +3 -3
- package/dist/authhero.cjs +6 -6
- package/dist/authhero.d.ts +140 -97
- package/dist/authhero.mjs +40 -27
- package/dist/client.js +3 -3
- package/dist/stats.html +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/authentication-flows/passwordless.d.ts +3 -3
- package/dist/types/client/client-bundle.d.ts +1 -1
- package/dist/types/client/loading-link-handler.d.ts +14 -0
- package/dist/types/components/Button.d.ts +2 -1
- package/dist/types/helpers/dcr/metadata-mapping.d.ts +1 -1
- package/dist/types/index.d.ts +96 -96
- package/dist/types/middlewares/authentication.d.ts +17 -0
- package/dist/types/routes/auth-api/index.d.ts +21 -21
- package/dist/types/routes/auth-api/passwordless.d.ts +18 -18
- package/dist/types/routes/auth-api/register/index.d.ts +2 -2
- package/dist/types/routes/auth-api/well-known.d.ts +1 -1
- package/dist/types/routes/management-api/action-executions.d.ts +1 -1
- package/dist/types/routes/management-api/actions.d.ts +1 -1
- package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
- package/dist/types/routes/management-api/branding.d.ts +6 -6
- package/dist/types/routes/management-api/client-grants.d.ts +8 -8
- package/dist/types/routes/management-api/clients.d.ts +7 -7
- package/dist/types/routes/management-api/connections.d.ts +1 -1
- package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
- package/dist/types/routes/management-api/email-templates.d.ts +18 -18
- package/dist/types/routes/management-api/forms.d.ts +119 -119
- package/dist/types/routes/management-api/guardian.d.ts +5 -5
- package/dist/types/routes/management-api/index.d.ts +190 -190
- package/dist/types/routes/management-api/log-streams.d.ts +6 -6
- package/dist/types/routes/management-api/logs.d.ts +3 -3
- package/dist/types/routes/management-api/organizations.d.ts +2 -2
- package/dist/types/routes/management-api/prompts.d.ts +4 -4
- package/dist/types/routes/management-api/themes.d.ts +3 -3
- package/dist/types/routes/management-api/users.d.ts +2 -2
- package/dist/types/routes/universal-login/common.d.ts +6 -6
- package/dist/types/routes/universal-login/flow-api.d.ts +12 -12
- package/dist/types/routes/universal-login/u2-index.d.ts +6 -6
- package/dist/types/routes/universal-login/u2-routes.d.ts +6 -6
- package/dist/types/types/AuthHeroConfig.d.ts +26 -1
- package/dist/types/types/IdToken.d.ts +2 -2
- package/dist/types/utils/jwks.d.ts +2 -2
- package/dist/types/utils/jwt.d.ts +9 -0
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n={Stringify:1,BeforeStream:2,Stream:3},r=(e,t)=>{let n=new String(e);return n.isEscaped=!0,n.callbacks=t,n},i=/[&<>'"]/,a=async(e,t)=>{let n=``;t||=[];let i=await Promise.all(e);for(let e=i.length-1;n+=i[e],e--,!(e<0);e--){let r=i[e];typeof r==`object`&&t.push(...r.callbacks||[]);let a=r.isEscaped;if(r=await(typeof r==`object`?r.toString():r),typeof r==`object`&&t.push(...r.callbacks||[]),r.isEscaped??a)n+=r;else{let e=[n];o(r,e),n=e[0]}}return r(n,t)},o=(e,t)=>{let n=e.search(i);if(n===-1){t[0]+=e;return}let r,a,o=0;for(a=n;a<e.length;a++){switch(e.charCodeAt(a)){case 34:r=`"`;break;case 39:r=`'`;break;case 38:r=`&`;break;case 60:r=`<`;break;case 62:r=`>`;break;default:continue}t[0]+=e.substring(o,a)+r,o=a+1}t[0]+=e.substring(o,a)},s=e=>{let t=e.callbacks;if(!t?.length)return e;let r=[e],i={};return t.forEach(e=>e({phase:n.Stringify,buffer:r,context:i})),r[0]},c=async(e,t,n,i,a)=>{typeof e==`object`&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));let o=e.callbacks;if(!o?.length)return Promise.resolve(e);a?a[0]+=e:a=[e];let s=Promise.all(o.map(e=>e({phase:t,buffer:a,context:i}))).then(e=>Promise.all(e.filter(Boolean).map(e=>c(e,t,!1,i,a))).then(()=>a[0]));return n?r(await s,o):s},l=Symbol(`RENDERER`),u=Symbol(`ERROR_HANDLER`),d=Symbol(`STASH`),f=Symbol(`INTERNAL`),p=Symbol(`MEMO`),m=Symbol(`PERMALINK`),h=e=>(e[f]=!0,e),g=e=>({value:t,children:n})=>{if(!n)return;let r={children:[{tag:h(()=>{e.push(t)}),props:{}}]};Array.isArray(n)?r.children.push(...n.flat()):r.children.push(n),r.children.push({tag:h(()=>{e.pop()}),props:{}});let i={tag:``,props:r,type:``};return i[u]=t=>{throw e.pop(),t},i},_=e=>{let t=[e],n=g(t);return n.values=t,n.Provider=n,v.push(n),n},v=[],y=e=>{let t=[e],n=(e=>{t.push(e.value);let n;try{n=e.children?(Array.isArray(e.children)?new je(``,{},e.children):e.children).toString():``}catch(e){throw t.pop(),e}return n instanceof Promise?n.finally(()=>t.pop()).then(e=>r(e,e.callbacks)):(t.pop(),r(n))});return n.values=t,n.Provider=n,n[l]=g(t),v.push(n),n},b=e=>e.values.at(-1),x={title:[],script:[`src`],style:[`data-href`],link:[`href`],meta:[`name`,`httpEquiv`,`charset`,`itemProp`]},S={},C=`data-precedence`,ee=e=>e.rel===`stylesheet`&&`precedence`in e,te=(e,t)=>e===`link`?t:x[e].length>0,w=e=>Array.isArray(e)?e:[e],T=t({button:()=>pe,form:()=>ue,input:()=>fe,link:()=>se,meta:()=>ce,script:()=>ae,style:()=>oe,title:()=>ie}),ne=new WeakMap,re=(e,t,n,r)=>({buffer:i,context:a})=>{if(!i)return;let o=ne.get(a)||{};ne.set(a,o);let s=o[e]||=[],c=!1,l=x[e],u=te(e,r!==void 0);if(u){LOOP:for(let[,t]of s)if(!(e===`link`&&!(t.rel===`stylesheet`&&t[`data-precedence`]!==void 0))){for(let e of l)if((t?.[e]??null)===n?.[e]){c=!0;break LOOP}}}if(c?i[0]=i[0].replaceAll(t,``):u||e===`link`?s.push([t,n,r]):s.unshift([t,n,r]),i[0].indexOf(`</head>`)!==-1){let t;if(e===`link`||r!==void 0){let e=[];t=s.map(([t,,n],r)=>{if(n===void 0)return[t,2**53-1,r];let i=e.indexOf(n);return i===-1&&(e.push(n),i=e.length-1),[t,i,r]}).sort((e,t)=>e[1]-t[1]||e[2]-t[2]).map(([e])=>e)}else t=s.map(([e])=>e);t.forEach(e=>{i[0]=i[0].replaceAll(e,``)}),i[0]=i[0].replace(/(?=<\/head>)/,t.join(``))}},E=(e,t,n)=>r(new F(e,n,w(t??[])).toString()),D=(e,t,n,i)=>{if(`itemProp`in n)return E(e,t,n);let{precedence:a,blocking:o,...s}=n;a=i?a??``:void 0,i&&(s[C]=a);let c=new F(e,s,w(t||[])).toString();return c instanceof Promise?c.then(t=>r(c,[...t.callbacks||[],re(e,t,s,a)])):r(c,[re(e,c,s,a)])},ie=({children:e,...t})=>{let n=N();if(n){let r=b(n);if(r===`svg`||r===`head`)return new F(`title`,t,w(e??[]))}return D(`title`,e,t,!1)},ae=({children:e,...t})=>{let n=N();return[`src`,`async`].some(e=>!t[e])||n&&b(n)===`head`?E(`script`,e,t):D(`script`,e,t,!1)},oe=({children:e,...t})=>[`href`,`precedence`].every(e=>e in t)?(t[`data-href`]=t.href,delete t.href,D(`style`,e,t,!0)):E(`style`,e,t),se=({children:e,...t})=>[`onLoad`,`onError`].some(e=>e in t)||t.rel===`stylesheet`&&(!(`precedence`in t)||`disabled`in t)?E(`link`,e,t):D(`link`,e,t,ee(t)),ce=({children:e,...t})=>{let n=N();return n&&b(n)===`head`?E(`meta`,e,t):D(`meta`,e,t,!1)},le=(e,{children:t,...n})=>new F(e,n,w(t??[])),ue=e=>(typeof e.action==`function`&&(e.action=m in e.action?e.action[m]:void 0),le(`form`,e)),de=(e,t)=>(typeof t.formAction==`function`&&(t.formAction=m in t.formAction?t.formAction[m]:void 0),le(e,t)),fe=e=>de(`input`,e),pe=e=>de(`button`,e),me=new Map([[`className`,`class`],[`htmlFor`,`for`],[`crossOrigin`,`crossorigin`],[`httpEquiv`,`http-equiv`],[`itemProp`,`itemprop`],[`fetchPriority`,`fetchpriority`],[`noModule`,`nomodule`],[`formAction`,`formaction`]]),O=e=>me.get(e)||e,he=/[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,k=new Set,ge=1024,_e=/^[!?]|[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,ve=new Set,ye=256,A=(e,t,n)=>{e.size>=t&&e.clear(),e.add(n)},be=e=>ve.has(e)?!0:typeof e==`string`?e.length===0?!0:_e.test(e)?!1:(A(ve,ye,e),!0):!1,xe=e=>{if(k.has(e))return!0;let t=e.length;if(t===0)return!1;for(let n=0;n<t;n++){let t=e.charCodeAt(n);if(!(t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===45||t===95||t===46||t===58))return he.test(e)?!1:(A(k,ge,e),!0)}return A(k,ge,e),!0},Se=/[\s"'():;\\/\[\]{}\x00-\x1f\x7f-\x9f]/,j=new Set,Ce=1024,we=e=>{if(j.has(e))return!0;let t=e.length;if(t===0)return!1;for(let n=0;n<t;n++){let t=e.charCodeAt(n);if(!(t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===45||t===95))return Se.test(e)?!1:(A(j,Ce,e),!0)}return A(j,Ce,e),!0},Te=/[;"'\\/\[\](){}]/,Ee=e=>{if(!Te.test(e))return!1;let t=0,n=[];for(let r=0,i=e.length;r<i;r++){let a=e.charCodeAt(r);if(a===92){if(r===i-1)return!0;r++}else if(t!==0){if(a===10||a===12||a===13)return!0;a===t&&(t=0)}else if(a===47&&e.charCodeAt(r+1)===42){let t=e.indexOf(`*/`,r+2);if(t===-1)return!0;r=t+1}else if(a===34||a===39)t=a;else if(a===40)n.push(41);else if(a===91)n.push(93);else if(a===123||a===125)return!0;else if(a===41||a===93){if(n[n.length-1]!==a)return!0;n.pop()}else if(a===59&&n.length===0)return!0}return t!==0||n.length!==0},De=(e,t)=>{for(let[n,r]of Object.entries(e)){let e=n[0]===`-`||!/[A-Z]/.test(n)?n:n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);if(!we(e))continue;if(r==null){t(e,null);continue}let i;if(typeof r==`number`)i=e.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/)?`${r}`:`${r}px`;else if(typeof r==`string`){if(Ee(r))continue;i=r}else continue;t(e,i)}},M=void 0,N=()=>M,Oe=e=>/[A-Z]/.test(e)&&e.match(/^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/)?e.replace(/([A-Z])/g,`-$1`).toLowerCase():e,ke=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Ae=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.defer.disabled.download.formnovalidate.hidden.inert.ismap.itemscope.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.selected`.split(`.`),P=(e,t)=>{for(let n=0,r=e.length;n<r;n++){let r=e[n];if(typeof r==`string`)o(r,t);else if(typeof r==`boolean`||r==null)continue;else r instanceof F?r.toStringToBuffer(t):typeof r==`number`||r.isEscaped?t[0]+=r:r instanceof Promise?t.unshift(``,r):P(r,t)}},F=class{tag;props;key;children;isEscaped=!0;localContexts;constructor(e,t,n){if(typeof e!=`function`&&!be(e))throw Error(`Invalid JSX tag name: ${e}`);this.tag=e,this.props=t,this.children=n}get type(){return this.tag}get ref(){return this.props.ref||null}toString(){let e=[``];this.localContexts?.forEach(([e,t])=>{e.values.push(t)});try{this.toStringToBuffer(e)}finally{this.localContexts?.forEach(([e])=>{e.values.pop()})}return e.length===1?`callbacks`in e?s(r(e[0],e.callbacks)).toString():e[0]:a(e,e.callbacks)}toStringToBuffer(e){let t=this.tag,n=this.props,{children:i}=this;e[0]+=`<${t}`;let a=t===`svg`||M&&b(M)===`svg`?e=>Oe(O(e)):e=>O(e);for(let[s,c]of Object.entries(n))if(s=a(s),xe(s)&&s!==`children`){if(s===`style`&&typeof c==`object`){let t=``;De(c,(e,n)=>{n!=null&&(t+=`${t?`;`:``}${e}:${n}`)}),e[0]+=` style="`,o(t,e),e[0]+=`"`}else if(typeof c==`string`)e[0]+=` ${s}="`,o(c,e),e[0]+=`"`;else if(c!=null)if(typeof c==`number`||c.isEscaped)e[0]+=` ${s}="${c}"`;else if(typeof c==`boolean`&&Ae.includes(s))c&&(e[0]+=` ${s}=""`);else if(s===`dangerouslySetInnerHTML`){if(i.length>0)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");i=[r(c.__html)]}else if(c instanceof Promise)e[0]+=` ${s}="`,e.unshift(`"`,c);else if(typeof c==`function`){if(!s.startsWith(`on`)&&s!==`ref`)throw Error(`Invalid prop '${s}' of type 'function' supplied to '${t}'.`)}else e[0]+=` ${s}="`,o(c.toString(),e),e[0]+=`"`}if(ke.includes(t)&&i.length===0){e[0]+=`/>`;return}e[0]+=`>`,P(i,e),e[0]+=`</${t}>`}},I=class extends F{toStringToBuffer(e){let{children:t}=this,n={...this.props};t.length&&(n.children=t.length===1?t[0]:t);let r=this.tag.call(null,n);if(!(typeof r==`boolean`||r==null))if(r instanceof Promise)if(v.length===0)e.unshift(``,r);else{let t=v.map(e=>[e,e.values.at(-1)]);e.unshift(``,r.then(e=>(e instanceof F&&(e.localContexts=t),e)))}else r instanceof F?r.toStringToBuffer(e):typeof r==`number`||r.isEscaped?(e[0]+=r,r.callbacks&&(e.callbacks||=[],e.callbacks.push(...r.callbacks))):o(r,e)}},je=class extends F{toStringToBuffer(e){P(this.children,e)}},Me=(e,t,...n)=>{t??={},n.length&&(t.children=n.length===1?n[0]:n);let r=t.key;delete t.key;let i=L(e,t,n);return i.key=r,i},Ne=!1,L=(e,t,n)=>{if(!Ne){for(let e in S)T[e][l]=S[e];Ne=!0}return typeof e==`function`?new I(e,t,n):T[e]?new I(T[e],t,n):e===`svg`||e===`head`?(M||=y(``),new F(e,t,[new I(M,{value:e},n)])):new F(e,t,n)},R=({children:e})=>new je(``,{children:e},Array.isArray(e)?e:e?[e]:[]),z=`_hp`,Pe={Change:`Input`,DoubleClick:`DblClick`},Fe={svg:`2000/svg`,math:`1998/Math/MathML`},B=[],Ie=new WeakMap,V=void 0,Le=()=>V,H=e=>`t`in e,Re={onClick:[`click`,!1]},ze=e=>{if(!e.startsWith(`on`))return;if(Re[e])return Re[e];let t=e.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/);if(t){let[,n,r]=t;return Re[e]=[(Pe[n]||n).toLowerCase(),!!r]}},Be=(e,t)=>V&&e instanceof SVGElement&&/[A-Z]/.test(t)&&(t in e.style||t.match(/^(?:o|pai|str|u|ve)/))?t.replace(/([A-Z])/g,`-$1`).toLowerCase():t,Ve=e=>e==null||e===!1?null:e,He=(e,t)=>{`value`in t&&(e.value=Ve(t.value),!e.multiple&&e.selectedIndex===-1&&(e.selectedIndex=0))},Ue=e=>e instanceof DOMException&&e.name===`InvalidCharacterError`,We=(e,t,n)=>{t||={};for(let r in t){let i=t[r];if(r!==`children`&&(!n||n[r]!==i)){r=O(r);let t=ze(r);if(t){if(n?.[r]!==i&&(n&&e.removeEventListener(t[0],n[r],t[1]),i!=null)){if(typeof i!=`function`)throw Error(`Event handler for "${r}" is not a function`);e.addEventListener(t[0],i,t[1])}}else if(r===`dangerouslySetInnerHTML`&&i)e.innerHTML=i.__html;else if(r===`ref`){let t;typeof i==`function`?t=i(e)||(()=>i(null)):i&&`current`in i&&(i.current=e,t=()=>i.current=null),Ie.set(e,t)}else if(r===`style`){let t=e.style;typeof i==`string`?t.cssText=i:(t.cssText=``,i!=null&&De(i,t.setProperty.bind(t)))}else{if(r===`value`){let t=e.nodeName;if(t===`SELECT`)continue;if((t===`INPUT`||t===`TEXTAREA`)&&(e.value=Ve(i),t===`TEXTAREA`)){e.textContent=i;continue}}else (r===`checked`&&e.nodeName===`INPUT`||r===`selected`&&e.nodeName===`OPTION`)&&(e[r]=i);let t=Be(e,r);try{i==null||i===!1?e.removeAttribute(t):i===!0?e.setAttribute(t,``):typeof i==`string`||typeof i==`number`?e.setAttribute(t,i):e.setAttribute(t,i.toString())}catch(e){if(!Ue(e))throw e}}}}if(n)for(let r in n){let i=n[r];if(r!==`children`&&!(r in t)){r=O(r);let t=ze(r);if(t)e.removeEventListener(t[0],i,t[1]);else if(r===`ref`)Ie.get(e)?.();else try{e.removeAttribute(Be(e,r))}catch(e){if(!Ue(e))throw e}}}},Ge=(e,t)=>{t[d][0]=0,B.push([e,t]);let n=t.tag[l]||t.tag,r=n.defaultProps?{...n.defaultProps,...t.props}:t.props;try{return[n.call(null,r)]}finally{B.pop()}},Ke=(e,t,n,r,i)=>{e.vR?.length&&(r.push(...e.vR),delete e.vR),typeof e.tag==`function`&&e[d][1][1]?.forEach(e=>i.push(e)),e.vC.forEach(e=>{if(H(e))n.push(e);else if(typeof e.tag==`function`||e.tag===``){e.c=t;let a=n.length;if(Ke(e,t,n,r,i),e.s){for(let e=a;e<n.length;e++)n[e].s=!0;e.s=!1}}else n.push(e),e.vR?.length&&(r.push(...e.vR),delete e.vR)})},qe=e=>{for(;e&&(e.tag===z||!e.e);)e=e.tag===z||!e.vC?.[0]?e.nN:e.vC[0];return e?.e},Je=e=>{H(e)||(e[d]?.[1][1]?.forEach(e=>e[2]?.()),Ie.get(e.e)?.(),e.p===2&&e.vC?.forEach(e=>e.p=2),e.vC?.forEach(Je)),e.p||(e.e?.remove(),delete e.e),typeof e.tag==`function`&&(G.delete(e),U.delete(e),delete e[d][3],e.a=!0)},Ye=(e,t,n)=>{e.c=t,Qe(e,t,n)},Xe=(e,t)=>{if(t){for(let n=0,r=e.length;n<r;n++)if(e[n]===t)return n}},Ze=Symbol(),Qe=(e,t,n)=>{let r=[],i=[],a=[];Ke(e,t,r,i,a),i.forEach(Je);let o=n?void 0:t.childNodes,s,c=null;if(n)s=-1;else if(!o.length)s=0;else{let t=Xe(o,qe(e.nN));t===void 0?s=Xe(o,r.find(e=>e.tag!==z&&e.e)?.e)??-1:(c=o[t],s=t),s===-1&&(n=!0)}for(let e=0,i=r.length;e<i;e++,s++){let i=r[e],a;if(i.s&&i.e)a=i.e,i.s=!1;else{let e=n||!i.e;H(i)?(i.e&&i.d&&(i.e.textContent=i.t),i.d=!1,a=i.e||=document.createTextNode(i.t)):(a=i.e||=i.n?document.createElementNS(i.n,i.tag):document.createElement(i.tag),We(a,i.props,i.pP),Qe(i,a,e),i.tag===`select`&&He(a,i.props))}i.tag===z?s--:n?a.parentNode||t.appendChild(a):o[s]!==a&&o[s-1]!==a&&(o[s+1]===a?t.appendChild(o[s]):t.insertBefore(a,c||o[s]||null))}if(e.pP&&=void 0,a.length){let e=[],t=[];a.forEach(([,n,,r,i])=>{n&&e.push(n),r&&t.push(r),i?.()}),e.forEach(e=>e()),t.length&&requestAnimationFrame(()=>{t.forEach(e=>e())})}},$e=(e,t)=>!!(e&&e.length===t.length&&e.every((e,n)=>e[1]===t[n][1])),U=new WeakMap,W=(e,t,n)=>{let r=!n&&t.pC;n&&(t.pC||=t.vC);let i;try{n||=typeof t.tag==`function`?Ge(e,t):w(t.props.children),n[0]?.tag===``&&n[0][u]&&(i=n[0][u],e[5].push([e,i,t]));let a=r?[...t.pC]:t.vC?[...t.vC]:void 0,o=[],s;for(let r=0;r<n.length;r++){if(Array.isArray(n[r])){n.splice(r,1,...n[r].flat(1/0)),r--;continue}let i=et(n[r]);if(i){typeof i.tag==`function`&&!i.tag[f]&&(v.length>0&&(i[d][2]=v.map(e=>[e,e.values.at(-1)])),e[5]?.length&&(i[d][3]=e[5].at(-1)));let n;if(a&&a.length){let e=a.findIndex(H(i)?e=>H(e):i.key===void 0?e=>e.tag===i.tag:e=>e.key===i.key&&e.tag===i.tag);e!==-1&&(n=a[e],a.splice(e,1))}if(n)if(H(i))n.t!==i.t&&(n.t=i.t,n.d=!0),i=n;else{let e=n.pP=n.props;if(n.props=i.props,n.f||=i.f||t.f,typeof i.tag==`function`){let t=n[d][2];n[d][2]=i[d][2]||[],n[d][3]=i[d][3],!n.f&&((n.o||n)===i.o||n.tag[p]?.(e,n.props))&&$e(t,n[d][2])&&(n.s=!0)}i=n}else if(!H(i)&&V){let e=b(V);e&&(i.n=e)}if(!H(i)&&!i.s&&(W(e,i),delete i.f),o.push(i),s&&!s.s&&!i.s)for(let e=s;e&&!H(e);e=e.vC?.at(-1))e.nN=i;s=i}}t.vR=r?[...t.vC,...a||[]]:a||[],t.vC=o,r&&delete t.pC}catch(n){if(t.f=!0,n===Ze){if(i)return;throw n}let[r,a,o]=t[d]?.[3]||[];if(a){let t=()=>K([0,!1,e[2]],o),i=U.get(o)||[];i.push(t),U.set(o,i);let s=a(n,()=>{let e=U.get(o);if(e){let n=e.indexOf(t);if(n!==-1)return e.splice(n,1),t()}});if(s){if(e[0]===1)e[1]=!0;else if(W(e,o,[s]),(a.length===1||e!==r)&&o.c){Ye(o,o.c,!1);return}throw Ze}}throw n}finally{i&&e[5].pop()}},et=e=>{if(!(e==null||typeof e==`boolean`)){if(typeof e==`string`||typeof e==`number`)return{t:e.toString(),d:!0};if(`vR`in e&&(e={tag:e.tag,props:e.props,key:e.key,f:e.f,type:e.tag,ref:e.props.ref,o:e.o||e}),typeof e.tag==`function`)e[d]=[0,[]];else{let t=Fe[e.tag];t&&(V||=_(``),e.props.children=[{tag:V,props:{value:e.n=`http://www.w3.org/${t}`,children:e.props.children}}])}return e}},tt=(e,t,n)=>{e.c===t&&(e.c=n,e.vC.forEach(e=>tt(e,t,n)))},nt=(e,t)=>{t[d][2]?.forEach(([e,t])=>{e.values.push(t)});try{W(e,t,void 0)}catch{return}if(t.a){delete t.a;return}t[d][2]?.forEach(([e])=>{e.values.pop()}),(e[0]!==1||!e[1])&&Ye(t,t.c,!1)},G=new WeakMap,rt=[],K=async(e,t)=>{e[5]||=[];let n=G.get(t);n&&n[0](void 0);let r,i=new Promise(e=>r=e);if(G.set(t,[r,()=>{e[2]?e[2](e,t,e=>{nt(e,t)}).then(()=>r(t)):(nt(e,t),r(t))}]),rt.length)rt.at(-1).add(t);else{await Promise.resolve();let e=G.get(t);e&&(G.delete(t),e[1]())}return i},it=(e,t)=>{let n=[];n[5]=[],n[4]=!0,W(n,e,void 0),n[4]=!1;let r=document.createDocumentFragment();Ye(e,r,!0),tt(e,r,t),t.replaceChildren(r)},at=(e,t,n)=>({tag:z,props:{children:e},key:n,e:t,p:1}),ot=0,st=2,ct=3,lt=new WeakMap,ut=(e,t)=>!e||!t||e.length!==t.length||t.some((t,n)=>t!==e[n]),dt=void 0,ft=[],pt=e=>{let t=()=>typeof e==`function`?e():e,n=B.at(-1);if(!n)return[t(),()=>{}];let[,r]=n,i=r[d][1][ot]||=[],a=r[d][0]++;return i[a]||=[t(),e=>{let t=dt,n=i[a];if(typeof e==`function`&&(e=e(n[0])),!Object.is(e,n[0]))if(n[0]=e,ft.length){let[e,n]=ft.at(-1);Promise.all([e===3?r:K([e,!1,t],r),n]).then(([n])=>{if(!n||!(e===2||e===3))return;let r=n.vC;requestAnimationFrame(()=>{setTimeout(()=>{r===n.vC&&K([+(e===3),!1,t],n)})})})}else K([0,!1,t],r)}]},mt=(e,t,n)=>{let r=B.at(-1);if(!r)return;let[,i]=r,a=i[d][1][1]||=[],o=i[d][0]++,[s,,c]=a[o]||=[];if(ut(s,n)){c&&c();let r=()=>{i[e]=void 0,i[2]=t()},i=[n,void 0,void 0,void 0,void 0];i[e]=r,a[o]=i}},ht=(e,t)=>mt(3,e,t),gt=(e,t)=>{let n=B.at(-1);if(!n)return e;let[,r]=n,i=r[d][1][st]||=[],a=r[d][0]++,o=i[a];return ut(o?.[1],t)?i[a]=[e,t]:e=i[a][0],e},_t=e=>{let t=lt.get(e);if(t){if(t.length===2)throw t[1];return t[0]}throw e.then(t=>lt.set(e,[t]),t=>lt.set(e,[void 0,t])),e},vt=(e,t)=>{let n=B.at(-1);if(!n)return e();let[,r]=n,i=r[d][1][ct]||=[],a=r[d][0]++,o=i[a];return ut(o?.[1],t)&&(i[a]=[e(),t]),i[a][0]},yt=_({pending:!1,data:null,method:null,action:null}),bt=new Set,xt=e=>{bt.add(e),e.finally(()=>bt.delete(e))},St=t({button:()=>Ft,clearCache:()=>Ct,composeRef:()=>q,form:()=>Mt,input:()=>Pt,link:()=>kt,meta:()=>At,script:()=>Dt,style:()=>Ot,title:()=>Et}),Ct=()=>{wt=Object.create(null),Tt=Object.create(null)},q=(e,t)=>vt(()=>n=>{let r;e&&(typeof e==`function`?r=e(n)||(()=>{e(null)}):e&&`current`in e&&(e.current=n,r=()=>{e.current=null}));let i=t(n);return()=>{i?.(),r?.()}},[e]),wt=Object.create(null),Tt=Object.create(null),J=(e,t,n,r,i)=>{if(t?.itemProp)return{tag:e,props:t,type:e,ref:t.ref};let a=document.head,{onLoad:o,onError:s,precedence:c,blocking:l,...u}=t,d=null,f=!1,p=x[e],m=te(e,r),h=e=>e.getAttribute(`rel`)===`stylesheet`&&e.getAttribute(`data-precedence`)!==null,g;if(m){let n=a.querySelectorAll(e);LOOP:for(let r of n)if(!(e===`link`&&!h(r))){for(let e of p)if(r.getAttribute(e)===t[e]){d=r;break LOOP}}if(!d){let n=p.reduce((e,n)=>t[n]===void 0?e:`${e}-${n}-${t[n]}`,e);f=!Tt[n],d=Tt[n]||=(()=>{let n=document.createElement(e);for(let e of p)t[e]!==void 0&&n.setAttribute(e,t[e]);return t.rel&&n.setAttribute(`rel`,t.rel),n})()}}else g=a.querySelectorAll(e);c=r?c??``:void 0,r&&(u[C]=c);let _=gt(t=>{if(m){if(e===`link`&&c!==void 0){let n=!1;for(let r of a.querySelectorAll(e)){let e=r.getAttribute(C);if(e===null){a.insertBefore(t,r);return}if(n&&e!==c){a.insertBefore(t,r);return}e===c&&(n=!0)}a.appendChild(t);return}let n=!1;for(let r of a.querySelectorAll(e)){if(n&&r.getAttribute(`data-precedence`)!==c){a.insertBefore(t,r);return}r.getAttribute(`data-precedence`)===c&&(n=!0)}a.appendChild(t)}else if(e===`link`)a.contains(t)||a.appendChild(t);else if(g){let n=!1;for(let e of g)if(e===t){n=!0;break}n||a.insertBefore(t,a.contains(g[0])?g[0]:a.querySelector(e)),g=void 0}},[m,c,e]),v=q(t.ref,e=>{let t=p[0];if(n===2&&(e.innerHTML=``),(f||g)&&_(e),!s&&!o||!t)return;let r=wt[e.getAttribute(t)]||=new Promise((t,n)=>{e.addEventListener(`load`,t),e.addEventListener(`error`,n)});o&&(r=r.then(o)),s&&(r=r.catch(s)),r.catch(()=>{})});if(i&&l===`render`){let n=x[e][0];if(n&&t[n]){let e=t[n];_t(wt[e]||=new Promise((e,t)=>{_(d),d.addEventListener(`load`,e),d.addEventListener(`error`,t)}))}}let y={tag:e,type:e,props:{...u,ref:v},ref:v};return y.p=n,d&&(y.e=d),at(y,a)},Et=e=>{let t=Le();return(t&&b(t))?.endsWith(`svg`)?{tag:`title`,props:e,type:`title`,ref:e.ref}:J(`title`,e,void 0,!1,!1)},Dt=e=>!e||[`src`,`async`].some(t=>!e[t])?{tag:`script`,props:e,type:`script`,ref:e.ref}:J(`script`,e,1,!1,!0),Ot=e=>!e||![`href`,`precedence`].every(t=>t in e)?{tag:`style`,props:e,type:`style`,ref:e.ref}:(e[`data-href`]=e.href,delete e.href,J(`style`,e,2,!0,!0)),kt=e=>!e||[`onLoad`,`onError`].some(t=>t in e)||e.rel===`stylesheet`&&(!(`precedence`in e)||`disabled`in e)?{tag:`link`,props:e,type:`link`,ref:e.ref}:J(`link`,e,1,ee(e),!0),At=e=>J(`meta`,e,void 0,!1,!1),jt=Symbol(),Mt=e=>{let{action:t,...n}=e;typeof t!=`function`&&(n.action=t);let[r,i]=pt([null,!1]),a=gt(async e=>{let n=e.isTrusted?t:e.detail[jt];if(typeof n!=`function`)return;e.preventDefault();let r=new FormData(e.target);i([r,!0]);let a=n(r);a instanceof Promise&&(xt(a),await a),i([null,!0])},[]),o=q(e.ref,e=>(e.addEventListener(`submit`,a),()=>{e.removeEventListener(`submit`,a)})),[s,c]=r;return r[1]=!1,{tag:yt,props:{value:{pending:s!==null,data:s,method:s?`post`:null,action:s?t:null},children:{tag:`form`,props:{...n,ref:o},type:`form`,ref:o}},f:c}},Nt=(e,{formAction:t,...n})=>{if(typeof t==`function`){let e=gt(e=>{e.preventDefault(),e.currentTarget.form.dispatchEvent(new CustomEvent(`submit`,{detail:{[jt]:t}}))},[]);n.ref=q(n.ref,t=>(t.addEventListener(`click`,e),()=>{t.removeEventListener(`click`,e)}))}return{tag:e,props:n,type:e,ref:n.ref}},Pt=e=>Nt(`input`,e),Ft=e=>Nt(`button`,e);Object.assign(S,{title:Et,script:Dt,style:Ot,link:kt,meta:At,form:Mt,input:Pt,button:Ft});var It=(e,t,n)=>(typeof e==`string`&&St[e]&&(e=St[e]),{tag:e,type:e,props:t,key:n,ref:t.ref}),Lt=e=>It(``,e,void 0),Rt=(({children:e,fallback:t,fallbackRender:n,onError:r})=>{let i=Lt({children:e});return i[u]=e=>{if(e instanceof Promise)throw e;return r?.(e),n?.(e)||t},i}),zt=(({children:e,fallback:t})=>{let n=Lt({children:e});return n[u]=(e,n)=>{if(!(e instanceof Promise))throw e;return e.finally(n),t},n}),Bt=y(null),Vt=0,Ht=async({children:e,fallback:t})=>{Array.isArray(e)||(e=[e]);let i=b(Bt)?.scriptNonce,a=[],o={[d]:[0,[]]},s=e=>(B.pop(),e);try{o[d][0]=0,B.push([[],o]),a=e.map(e=>e==null||typeof e==`boolean`?``:e.toString())}catch(t){if(t instanceof Promise)a=[t.then(()=>(o[d][0]=0,B.push([[],o]),Y(e).then(s)))];else throw t}finally{s()}if(a.some(e=>e instanceof Promise)){let e=Vt++,o=await t.toString();return r(`<template id="H:${e}"></template>${o}<!--/$-->`,[...o.callbacks||[],({phase:t,buffer:o,context:s})=>{if(t!==n.BeforeStream)return Promise.all(a).then(async a=>{a=a.flat();let l=a.join(``);o&&(o[0]=o[0].replace(RegExp(`<template id="H:${e}"></template>.*?<!--/\\$-->`),l));let u=o?``:`<template data-hono-target="H:${e}">${l}</template><script${i?` nonce="${i}"`:``}>
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n={Stringify:1,BeforeStream:2,Stream:3},r=(e,t)=>{let n=new String(e);return n.isEscaped=!0,n.callbacks=t,n},i=/[&<>'"]/,a=async(e,t)=>{let n=``;t||=[];let i=await Promise.all(e);for(let e=i.length-1;n+=i[e],e--,!(e<0);e--){let r=i[e];typeof r==`object`&&t.push(...r.callbacks||[]);let a=r.isEscaped;if(r=await(typeof r==`object`?r.toString():r),typeof r==`object`&&t.push(...r.callbacks||[]),r.isEscaped??a)n+=r;else{let e=[n];o(r,e),n=e[0]}}return r(n,t)},o=(e,t)=>{let n=e.search(i);if(n===-1){t[0]+=e;return}let r,a,o=0;for(a=n;a<e.length;a++){switch(e.charCodeAt(a)){case 34:r=`"`;break;case 39:r=`'`;break;case 38:r=`&`;break;case 60:r=`<`;break;case 62:r=`>`;break;default:continue}t[0]+=e.substring(o,a)+r,o=a+1}t[0]+=e.substring(o,a)},s=e=>{let t=e.callbacks;if(!t?.length)return e;let r=[e],i={};return t.forEach(e=>e({phase:n.Stringify,buffer:r,context:i})),r[0]},c=async(e,t,n,i,a)=>{typeof e==`object`&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));let o=e.callbacks;if(!o?.length)return Promise.resolve(e);a?a[0]+=e:a=[e];let s=Promise.all(o.map(e=>e({phase:t,buffer:a,context:i}))).then(e=>Promise.all(e.filter(Boolean).map(e=>c(e,t,!1,i,a))).then(()=>a[0]));return n?r(await s,o):s},l=Symbol(`RENDERER`),u=Symbol(`ERROR_HANDLER`),d=Symbol(`STASH`),f=Symbol(`INTERNAL`),p=Symbol(`MEMO`),m=Symbol(`PERMALINK`),h=e=>(e[f]=!0,e),g=e=>({value:t,children:n})=>{if(!n)return;let r={children:[{tag:h(()=>{e.push(t)}),props:{}}]};Array.isArray(n)?r.children.push(...n.flat()):r.children.push(n),r.children.push({tag:h(()=>{e.pop()}),props:{}});let i={tag:``,props:r,type:``};return i[u]=t=>{throw e.pop(),t},i},_=e=>{let t=[e],n=g(t);return n.values=t,n.Provider=n,v.push(n),n},v=[],y=e=>{let t=[e],n=(e=>{t.push(e.value);let n;try{n=e.children?(Array.isArray(e.children)?new je(``,{},e.children):e.children).toString():``}catch(e){throw t.pop(),e}return n instanceof Promise?n.finally(()=>t.pop()).then(e=>r(e,e.callbacks)):(t.pop(),r(n))});return n.values=t,n.Provider=n,n[l]=g(t),v.push(n),n},b=e=>e.values.at(-1),x={title:[],script:[`src`],style:[`data-href`],link:[`href`],meta:[`name`,`httpEquiv`,`charset`,`itemProp`]},S={},C=`data-precedence`,ee=e=>e.rel===`stylesheet`&&`precedence`in e,te=(e,t)=>e===`link`?t:x[e].length>0,w=e=>Array.isArray(e)?e:[e],T=t({button:()=>pe,form:()=>ue,input:()=>fe,link:()=>se,meta:()=>ce,script:()=>ae,style:()=>oe,title:()=>ie}),ne=new WeakMap,re=(e,t,n,r)=>({buffer:i,context:a})=>{if(!i)return;let o=ne.get(a)||{};ne.set(a,o);let s=o[e]||=[],c=!1,l=x[e],u=te(e,r!==void 0);if(u){LOOP:for(let[,t]of s)if(!(e===`link`&&!(t.rel===`stylesheet`&&t[`data-precedence`]!==void 0))){for(let e of l)if((t?.[e]??null)===n?.[e]){c=!0;break LOOP}}}if(c?i[0]=i[0].replaceAll(t,``):u||e===`link`?s.push([t,n,r]):s.unshift([t,n,r]),i[0].indexOf(`</head>`)!==-1){let t;if(e===`link`||r!==void 0){let e=[];t=s.map(([t,,n],r)=>{if(n===void 0)return[t,2**53-1,r];let i=e.indexOf(n);return i===-1&&(e.push(n),i=e.length-1),[t,i,r]}).sort((e,t)=>e[1]-t[1]||e[2]-t[2]).map(([e])=>e)}else t=s.map(([e])=>e);t.forEach(e=>{i[0]=i[0].replaceAll(e,``)}),i[0]=i[0].replace(/(?=<\/head>)/,t.join(``))}},E=(e,t,n)=>r(new F(e,n,w(t??[])).toString()),D=(e,t,n,i)=>{if(`itemProp`in n)return E(e,t,n);let{precedence:a,blocking:o,...s}=n;a=i?a??``:void 0,i&&(s[C]=a);let c=new F(e,s,w(t||[])).toString();return c instanceof Promise?c.then(t=>r(c,[...t.callbacks||[],re(e,t,s,a)])):r(c,[re(e,c,s,a)])},ie=({children:e,...t})=>{let n=N();if(n){let r=b(n);if(r===`svg`||r===`head`)return new F(`title`,t,w(e??[]))}return D(`title`,e,t,!1)},ae=({children:e,...t})=>{let n=N();return[`src`,`async`].some(e=>!t[e])||n&&b(n)===`head`?E(`script`,e,t):D(`script`,e,t,!1)},oe=({children:e,...t})=>[`href`,`precedence`].every(e=>e in t)?(t[`data-href`]=t.href,delete t.href,D(`style`,e,t,!0)):E(`style`,e,t),se=({children:e,...t})=>[`onLoad`,`onError`].some(e=>e in t)||t.rel===`stylesheet`&&(!(`precedence`in t)||`disabled`in t)?E(`link`,e,t):D(`link`,e,t,ee(t)),ce=({children:e,...t})=>{let n=N();return n&&b(n)===`head`?E(`meta`,e,t):D(`meta`,e,t,!1)},le=(e,{children:t,...n})=>new F(e,n,w(t??[])),ue=e=>(typeof e.action==`function`&&(e.action=m in e.action?e.action[m]:void 0),le(`form`,e)),de=(e,t)=>(typeof t.formAction==`function`&&(t.formAction=m in t.formAction?t.formAction[m]:void 0),le(e,t)),fe=e=>de(`input`,e),pe=e=>de(`button`,e),me=new Map([[`className`,`class`],[`htmlFor`,`for`],[`crossOrigin`,`crossorigin`],[`httpEquiv`,`http-equiv`],[`itemProp`,`itemprop`],[`fetchPriority`,`fetchpriority`],[`noModule`,`nomodule`],[`formAction`,`formaction`]]),O=e=>me.get(e)||e,he=/[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,k=new Set,ge=1024,_e=/^[!?]|[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/,ve=new Set,ye=256,A=(e,t,n)=>{e.size>=t&&e.clear(),e.add(n)},be=e=>ve.has(e)?!0:typeof e==`string`?e.length===0?!0:_e.test(e)?!1:(A(ve,ye,e),!0):!1,xe=e=>{if(k.has(e))return!0;let t=e.length;if(t===0)return!1;for(let n=0;n<t;n++){let t=e.charCodeAt(n);if(!(t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===45||t===95||t===46||t===58))return he.test(e)?!1:(A(k,ge,e),!0)}return A(k,ge,e),!0},Se=/[\s"'():;\\/\[\]{}\x00-\x1f\x7f-\x9f]/,j=new Set,Ce=1024,we=e=>{if(j.has(e))return!0;let t=e.length;if(t===0)return!1;for(let n=0;n<t;n++){let t=e.charCodeAt(n);if(!(t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===45||t===95))return Se.test(e)?!1:(A(j,Ce,e),!0)}return A(j,Ce,e),!0},Te=/[;"'\\/\[\](){}]/,Ee=e=>{if(!Te.test(e))return!1;let t=0,n=[];for(let r=0,i=e.length;r<i;r++){let a=e.charCodeAt(r);if(a===92){if(r===i-1)return!0;r++}else if(t!==0){if(a===10||a===12||a===13)return!0;a===t&&(t=0)}else if(a===47&&e.charCodeAt(r+1)===42){let t=e.indexOf(`*/`,r+2);if(t===-1)return!0;r=t+1}else if(a===34||a===39)t=a;else if(a===40)n.push(41);else if(a===91)n.push(93);else if(a===123||a===125)return!0;else if(a===41||a===93){if(n[n.length-1]!==a)return!0;n.pop()}else if(a===59&&n.length===0)return!0}return t!==0||n.length!==0},De=(e,t)=>{for(let[n,r]of Object.entries(e)){let e=n[0]===`-`||!/[A-Z]/.test(n)?n:n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);if(!we(e))continue;if(r==null){t(e,null);continue}let i;if(typeof r==`number`)i=e.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/)?`${r}`:`${r}px`;else if(typeof r==`string`){if(Ee(r))continue;i=r}else continue;t(e,i)}},M=void 0,N=()=>M,Oe=e=>/[A-Z]/.test(e)&&e.match(/^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/)?e.replace(/([A-Z])/g,`-$1`).toLowerCase():e,ke=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Ae=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.defer.disabled.download.formnovalidate.hidden.inert.ismap.itemscope.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.selected`.split(`.`),P=(e,t)=>{for(let n=0,r=e.length;n<r;n++){let r=e[n];if(typeof r==`string`)o(r,t);else if(typeof r==`boolean`||r==null)continue;else r instanceof F?r.toStringToBuffer(t):typeof r==`number`||r.isEscaped?t[0]+=r:r instanceof Promise?t.unshift(``,r):P(r,t)}},F=class{tag;props;key;children;isEscaped=!0;localContexts;constructor(e,t,n){if(typeof e!=`function`&&!be(e))throw Error(`Invalid JSX tag name: ${e}`);this.tag=e,this.props=t,this.children=n}get type(){return this.tag}get ref(){return this.props.ref||null}toString(){let e=[``];this.localContexts?.forEach(([e,t])=>{e.values.push(t)});try{this.toStringToBuffer(e)}finally{this.localContexts?.forEach(([e])=>{e.values.pop()})}return e.length===1?`callbacks`in e?s(r(e[0],e.callbacks)).toString():e[0]:a(e,e.callbacks)}toStringToBuffer(e){let t=this.tag,n=this.props,{children:i}=this;e[0]+=`<${t}`;let a=t===`svg`||M&&b(M)===`svg`?e=>Oe(O(e)):e=>O(e);for(let[s,c]of Object.entries(n))if(s=a(s),xe(s)&&s!==`children`){if(s===`style`&&typeof c==`object`){let t=``;De(c,(e,n)=>{n!=null&&(t+=`${t?`;`:``}${e}:${n}`)}),e[0]+=` style="`,o(t,e),e[0]+=`"`}else if(typeof c==`string`)e[0]+=` ${s}="`,o(c,e),e[0]+=`"`;else if(c!=null)if(typeof c==`number`||c.isEscaped)e[0]+=` ${s}="${c}"`;else if(typeof c==`boolean`&&Ae.includes(s))c&&(e[0]+=` ${s}=""`);else if(s===`dangerouslySetInnerHTML`){if(i.length>0)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");i=[r(c.__html)]}else if(c instanceof Promise)e[0]+=` ${s}="`,e.unshift(`"`,c);else if(typeof c==`function`){if(!s.startsWith(`on`)&&s!==`ref`)throw Error(`Invalid prop '${s}' of type 'function' supplied to '${t}'.`)}else e[0]+=` ${s}="`,o(c.toString(),e),e[0]+=`"`}if(ke.includes(t)&&i.length===0){e[0]+=`/>`;return}e[0]+=`>`,P(i,e),e[0]+=`</${t}>`}},I=class extends F{toStringToBuffer(e){let{children:t}=this,n={...this.props};t.length&&(n.children=t.length===1?t[0]:t);let r=this.tag.call(null,n);if(!(typeof r==`boolean`||r==null))if(r instanceof Promise)if(v.length===0)e.unshift(``,r);else{let t=v.map(e=>[e,e.values.at(-1)]);e.unshift(``,r.then(e=>(e instanceof F&&(e.localContexts=t),e)))}else r instanceof F?r.toStringToBuffer(e):typeof r==`number`||r.isEscaped?(e[0]+=r,r.callbacks&&(e.callbacks||=[],e.callbacks.push(...r.callbacks))):o(r,e)}},je=class extends F{toStringToBuffer(e){P(this.children,e)}},Me=(e,t,...n)=>{t??={},n.length&&(t.children=n.length===1?n[0]:n);let r=t.key;delete t.key;let i=L(e,t,n);return i.key=r,i},Ne=!1,L=(e,t,n)=>{if(!Ne){for(let e in S)T[e][l]=S[e];Ne=!0}return typeof e==`function`?new I(e,t,n):T[e]?new I(T[e],t,n):e===`svg`||e===`head`?(M||=y(``),new F(e,t,[new I(M,{value:e},n)])):new F(e,t,n)},R=({children:e})=>new je(``,{children:e},Array.isArray(e)?e:e?[e]:[]),z=`_hp`,Pe={Change:`Input`,DoubleClick:`DblClick`},Fe={svg:`2000/svg`,math:`1998/Math/MathML`},B=[],Ie=new WeakMap,V=void 0,Le=()=>V,H=e=>`t`in e,Re={onClick:[`click`,!1]},ze=e=>{if(!e.startsWith(`on`))return;if(Re[e])return Re[e];let t=e.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/);if(t){let[,n,r]=t;return Re[e]=[(Pe[n]||n).toLowerCase(),!!r]}},Be=(e,t)=>V&&e instanceof SVGElement&&/[A-Z]/.test(t)&&(t in e.style||t.match(/^(?:o|pai|str|u|ve)/))?t.replace(/([A-Z])/g,`-$1`).toLowerCase():t,Ve=e=>e==null||e===!1?null:e,He=(e,t)=>{`value`in t&&(e.value=Ve(t.value),!e.multiple&&e.selectedIndex===-1&&(e.selectedIndex=0))},Ue=e=>e instanceof DOMException&&e.name===`InvalidCharacterError`,We=(e,t,n)=>{t||={};for(let r in t){let i=t[r];if(r!==`children`&&(!n||n[r]!==i)){r=O(r);let t=ze(r);if(t){if(n?.[r]!==i&&(n&&e.removeEventListener(t[0],n[r],t[1]),i!=null)){if(typeof i!=`function`)throw Error(`Event handler for "${r}" is not a function`);e.addEventListener(t[0],i,t[1])}}else if(r===`dangerouslySetInnerHTML`&&i)e.innerHTML=i.__html;else if(r===`ref`){let t;typeof i==`function`?t=i(e)||(()=>i(null)):i&&`current`in i&&(i.current=e,t=()=>i.current=null),Ie.set(e,t)}else if(r===`style`){let t=e.style;typeof i==`string`?t.cssText=i:(t.cssText=``,i!=null&&De(i,t.setProperty.bind(t)))}else{if(r===`value`){let t=e.nodeName;if(t===`SELECT`)continue;if((t===`INPUT`||t===`TEXTAREA`)&&(e.value=Ve(i),t===`TEXTAREA`)){e.textContent=i;continue}}else (r===`checked`&&e.nodeName===`INPUT`||r===`selected`&&e.nodeName===`OPTION`)&&(e[r]=i);let t=Be(e,r);try{i==null||i===!1?e.removeAttribute(t):i===!0?e.setAttribute(t,``):typeof i==`string`||typeof i==`number`?e.setAttribute(t,i):e.setAttribute(t,i.toString())}catch(e){if(!Ue(e))throw e}}}}if(n)for(let r in n){let i=n[r];if(r!==`children`&&!(r in t)){r=O(r);let t=ze(r);if(t)e.removeEventListener(t[0],i,t[1]);else if(r===`ref`)Ie.get(e)?.();else try{e.removeAttribute(Be(e,r))}catch(e){if(!Ue(e))throw e}}}},Ge=(e,t)=>{t[d][0]=0,B.push([e,t]);let n=t.tag[l]||t.tag,r=n.defaultProps?{...n.defaultProps,...t.props}:t.props;try{return[n.call(null,r)]}finally{B.pop()}},Ke=(e,t,n,r,i)=>{e.vR?.length&&(r.push(...e.vR),delete e.vR),typeof e.tag==`function`&&e[d][1][1]?.forEach(e=>i.push(e)),e.vC.forEach(e=>{if(H(e))n.push(e);else if(typeof e.tag==`function`||e.tag===``){e.c=t;let a=n.length;if(Ke(e,t,n,r,i),e.s){for(let e=a;e<n.length;e++)n[e].s=!0;e.s=!1}}else n.push(e),e.vR?.length&&(r.push(...e.vR),delete e.vR)})},qe=e=>{for(;e&&(e.tag===z||!e.e);)e=e.tag===z||!e.vC?.[0]?e.nN:e.vC[0];return e?.e},Je=e=>{H(e)||(e[d]?.[1][1]?.forEach(e=>e[2]?.()),Ie.get(e.e)?.(),e.p===2&&e.vC?.forEach(e=>e.p=2),e.vC?.forEach(Je)),e.p||(e.e?.remove(),delete e.e),typeof e.tag==`function`&&(K.delete(e),W.delete(e),delete e[d][3],e.a=!0)},U=(e,t,n)=>{e.c=t,Ze(e,t,n)},Ye=(e,t)=>{if(t){for(let n=0,r=e.length;n<r;n++)if(e[n]===t)return n}},Xe=Symbol(),Ze=(e,t,n)=>{let r=[],i=[],a=[];Ke(e,t,r,i,a),i.forEach(Je);let o=n?void 0:t.childNodes,s,c=null;if(n)s=-1;else if(!o.length)s=0;else{let t=Ye(o,qe(e.nN));t===void 0?s=Ye(o,r.find(e=>e.tag!==z&&e.e)?.e)??-1:(c=o[t],s=t),s===-1&&(n=!0)}for(let e=0,i=r.length;e<i;e++,s++){let i=r[e],a;if(i.s&&i.e)a=i.e,i.s=!1;else{let e=n||!i.e;H(i)?(i.e&&i.d&&(i.e.textContent=i.t),i.d=!1,a=i.e||=document.createTextNode(i.t)):(a=i.e||=i.n?document.createElementNS(i.n,i.tag):document.createElement(i.tag),We(a,i.props,i.pP),Ze(i,a,e),i.tag===`select`&&He(a,i.props))}i.tag===z?s--:n?a.parentNode||t.appendChild(a):o[s]!==a&&o[s-1]!==a&&(o[s+1]===a?t.appendChild(o[s]):t.insertBefore(a,c||o[s]||null))}if(e.pP&&=void 0,a.length){let e=[],t=[];a.forEach(([,n,,r,i])=>{n&&e.push(n),r&&t.push(r),i?.()}),e.forEach(e=>e()),t.length&&requestAnimationFrame(()=>{t.forEach(e=>e())})}},Qe=(e,t)=>!!(e&&e.length===t.length&&e.every((e,n)=>e[1]===t[n][1])),W=new WeakMap,G=(e,t,n)=>{let r=!n&&t.pC;n&&(t.pC||=t.vC);let i;try{n||=typeof t.tag==`function`?Ge(e,t):w(t.props.children),n[0]?.tag===``&&n[0][u]&&(i=n[0][u],e[5].push([e,i,t]));let a=r?[...t.pC]:t.vC?[...t.vC]:void 0,o=[],s;for(let r=0;r<n.length;r++){if(Array.isArray(n[r])){n.splice(r,1,...n[r].flat(1/0)),r--;continue}let i=$e(n[r]);if(i){typeof i.tag==`function`&&!i.tag[f]&&(v.length>0&&(i[d][2]=v.map(e=>[e,e.values.at(-1)])),e[5]?.length&&(i[d][3]=e[5].at(-1)));let n;if(a&&a.length){let e=a.findIndex(H(i)?e=>H(e):i.key===void 0?e=>e.tag===i.tag:e=>e.key===i.key&&e.tag===i.tag);e!==-1&&(n=a[e],a.splice(e,1))}if(n)if(H(i))n.t!==i.t&&(n.t=i.t,n.d=!0),i=n;else{let e=n.pP=n.props;if(n.props=i.props,n.f||=i.f||t.f,typeof i.tag==`function`){let t=n[d][2];n[d][2]=i[d][2]||[],n[d][3]=i[d][3],!n.f&&((n.o||n)===i.o||n.tag[p]?.(e,n.props))&&Qe(t,n[d][2])&&(n.s=!0)}i=n}else if(!H(i)&&V){let e=b(V);e&&(i.n=e)}if(!H(i)&&!i.s&&(G(e,i),delete i.f),o.push(i),s&&!s.s&&!i.s)for(let e=s;e&&!H(e);e=e.vC?.at(-1))e.nN=i;s=i}}t.vR=r?[...t.vC,...a||[]]:a||[],t.vC=o,r&&delete t.pC}catch(n){if(t.f=!0,n===Xe){if(i)return;throw n}let[r,a,o]=t[d]?.[3]||[];if(a){let t=()=>q([0,!1,e[2]],o),i=W.get(o)||[];i.push(t),W.set(o,i);let s=a(n,()=>{let e=W.get(o);if(e){let n=e.indexOf(t);if(n!==-1)return e.splice(n,1),t()}});if(s){if(e[0]===1)e[1]=!0;else if(G(e,o,[s]),(a.length===1||e!==r)&&o.c){U(o,o.c,!1);return}throw Xe}}throw n}finally{i&&e[5].pop()}},$e=e=>{if(!(e==null||typeof e==`boolean`)){if(typeof e==`string`||typeof e==`number`)return{t:e.toString(),d:!0};if(`vR`in e&&(e={tag:e.tag,props:e.props,key:e.key,f:e.f,type:e.tag,ref:e.props.ref,o:e.o||e}),typeof e.tag==`function`)e[d]=[0,[]];else{let t=Fe[e.tag];t&&(V||=_(``),e.props.children=[{tag:V,props:{value:e.n=`http://www.w3.org/${t}`,children:e.props.children}}])}return e}},et=(e,t,n)=>{e.c===t&&(e.c=n,e.vC.forEach(e=>et(e,t,n)))},tt=(e,t)=>{t[d][2]?.forEach(([e,t])=>{e.values.push(t)});try{G(e,t,void 0)}catch{return}if(t.a){delete t.a;return}t[d][2]?.forEach(([e])=>{e.values.pop()}),(e[0]!==1||!e[1])&&U(t,t.c,!1)},K=new WeakMap,nt=[],q=async(e,t)=>{e[5]||=[];let n=K.get(t);n&&n[0](void 0);let r,i=new Promise(e=>r=e);if(K.set(t,[r,()=>{e[2]?e[2](e,t,e=>{tt(e,t)}).then(()=>r(t)):(tt(e,t),r(t))}]),nt.length)nt.at(-1).add(t);else{await Promise.resolve();let e=K.get(t);e&&(K.delete(t),e[1]())}return i},rt=(e,t)=>{let n=[];n[5]=[],n[4]=!0,G(n,e,void 0),n[4]=!1;let r=document.createDocumentFragment();U(e,r,!0),et(e,r,t),t.replaceChildren(r)},it=(e,t,n)=>({tag:z,props:{children:e},key:n,e:t,p:1}),at=0,ot=2,st=3,ct=new WeakMap,lt=(e,t)=>!e||!t||e.length!==t.length||t.some((t,n)=>t!==e[n]),ut=void 0,dt=[],ft=e=>{let t=()=>typeof e==`function`?e():e,n=B.at(-1);if(!n)return[t(),()=>{}];let[,r]=n,i=r[d][1][at]||=[],a=r[d][0]++;return i[a]||=[t(),e=>{let t=ut,n=i[a];if(typeof e==`function`&&(e=e(n[0])),!Object.is(e,n[0]))if(n[0]=e,dt.length){let[e,n]=dt.at(-1);Promise.all([e===3?r:q([e,!1,t],r),n]).then(([n])=>{if(!n||!(e===2||e===3))return;let r=n.vC;requestAnimationFrame(()=>{setTimeout(()=>{r===n.vC&&q([+(e===3),!1,t],n)})})})}else q([0,!1,t],r)}]},pt=(e,t,n)=>{let r=B.at(-1);if(!r)return;let[,i]=r,a=i[d][1][1]||=[],o=i[d][0]++,[s,,c]=a[o]||=[];if(lt(s,n)){c&&c();let r=()=>{i[e]=void 0,i[2]=t()},i=[n,void 0,void 0,void 0,void 0];i[e]=r,a[o]=i}},mt=(e,t)=>pt(3,e,t),ht=(e,t)=>{let n=B.at(-1);if(!n)return e;let[,r]=n,i=r[d][1][ot]||=[],a=r[d][0]++,o=i[a];return lt(o?.[1],t)?i[a]=[e,t]:e=i[a][0],e},gt=e=>{let t=ct.get(e);if(t){if(t.length===2)throw t[1];return t[0]}throw e.then(t=>ct.set(e,[t]),t=>ct.set(e,[void 0,t])),e},_t=(e,t)=>{let n=B.at(-1);if(!n)return e();let[,r]=n,i=r[d][1][st]||=[],a=r[d][0]++,o=i[a];return lt(o?.[1],t)&&(i[a]=[e(),t]),i[a][0]},vt=_({pending:!1,data:null,method:null,action:null}),yt=new Set,bt=e=>{yt.add(e),e.finally(()=>yt.delete(e))},xt=t({button:()=>Pt,clearCache:()=>St,composeRef:()=>J,form:()=>jt,input:()=>Nt,link:()=>Ot,meta:()=>kt,script:()=>Et,style:()=>Dt,title:()=>Tt}),St=()=>{Ct=Object.create(null),wt=Object.create(null)},J=(e,t)=>_t(()=>n=>{let r;e&&(typeof e==`function`?r=e(n)||(()=>{e(null)}):e&&`current`in e&&(e.current=n,r=()=>{e.current=null}));let i=t(n);return()=>{i?.(),r?.()}},[e]),Ct=Object.create(null),wt=Object.create(null),Y=(e,t,n,r,i)=>{if(t?.itemProp)return{tag:e,props:t,type:e,ref:t.ref};let a=document.head,{onLoad:o,onError:s,precedence:c,blocking:l,...u}=t,d=null,f=!1,p=x[e],m=te(e,r),h=e=>e.getAttribute(`rel`)===`stylesheet`&&e.getAttribute(`data-precedence`)!==null,g;if(m){let n=a.querySelectorAll(e);LOOP:for(let r of n)if(!(e===`link`&&!h(r))){for(let e of p)if(r.getAttribute(e)===t[e]){d=r;break LOOP}}if(!d){let n=p.reduce((e,n)=>t[n]===void 0?e:`${e}-${n}-${t[n]}`,e);f=!wt[n],d=wt[n]||=(()=>{let n=document.createElement(e);for(let e of p)t[e]!==void 0&&n.setAttribute(e,t[e]);return t.rel&&n.setAttribute(`rel`,t.rel),n})()}}else g=a.querySelectorAll(e);c=r?c??``:void 0,r&&(u[C]=c);let _=ht(t=>{if(m){if(e===`link`&&c!==void 0){let n=!1;for(let r of a.querySelectorAll(e)){let e=r.getAttribute(C);if(e===null){a.insertBefore(t,r);return}if(n&&e!==c){a.insertBefore(t,r);return}e===c&&(n=!0)}a.appendChild(t);return}let n=!1;for(let r of a.querySelectorAll(e)){if(n&&r.getAttribute(`data-precedence`)!==c){a.insertBefore(t,r);return}r.getAttribute(`data-precedence`)===c&&(n=!0)}a.appendChild(t)}else if(e===`link`)a.contains(t)||a.appendChild(t);else if(g){let n=!1;for(let e of g)if(e===t){n=!0;break}n||a.insertBefore(t,a.contains(g[0])?g[0]:a.querySelector(e)),g=void 0}},[m,c,e]),v=J(t.ref,e=>{let t=p[0];if(n===2&&(e.innerHTML=``),(f||g)&&_(e),!s&&!o||!t)return;let r=Ct[e.getAttribute(t)]||=new Promise((t,n)=>{e.addEventListener(`load`,t),e.addEventListener(`error`,n)});o&&(r=r.then(o)),s&&(r=r.catch(s)),r.catch(()=>{})});if(i&&l===`render`){let n=x[e][0];if(n&&t[n]){let e=t[n];gt(Ct[e]||=new Promise((e,t)=>{_(d),d.addEventListener(`load`,e),d.addEventListener(`error`,t)}))}}let y={tag:e,type:e,props:{...u,ref:v},ref:v};return y.p=n,d&&(y.e=d),it(y,a)},Tt=e=>{let t=Le();return(t&&b(t))?.endsWith(`svg`)?{tag:`title`,props:e,type:`title`,ref:e.ref}:Y(`title`,e,void 0,!1,!1)},Et=e=>!e||[`src`,`async`].some(t=>!e[t])?{tag:`script`,props:e,type:`script`,ref:e.ref}:Y(`script`,e,1,!1,!0),Dt=e=>!e||![`href`,`precedence`].every(t=>t in e)?{tag:`style`,props:e,type:`style`,ref:e.ref}:(e[`data-href`]=e.href,delete e.href,Y(`style`,e,2,!0,!0)),Ot=e=>!e||[`onLoad`,`onError`].some(t=>t in e)||e.rel===`stylesheet`&&(!(`precedence`in e)||`disabled`in e)?{tag:`link`,props:e,type:`link`,ref:e.ref}:Y(`link`,e,1,ee(e),!0),kt=e=>Y(`meta`,e,void 0,!1,!1),At=Symbol(),jt=e=>{let{action:t,...n}=e;typeof t!=`function`&&(n.action=t);let[r,i]=ft([null,!1]),a=ht(async e=>{let n=e.isTrusted?t:e.detail[At];if(typeof n!=`function`)return;e.preventDefault();let r=new FormData(e.target);i([r,!0]);let a=n(r);a instanceof Promise&&(bt(a),await a),i([null,!0])},[]),o=J(e.ref,e=>(e.addEventListener(`submit`,a),()=>{e.removeEventListener(`submit`,a)})),[s,c]=r;return r[1]=!1,{tag:vt,props:{value:{pending:s!==null,data:s,method:s?`post`:null,action:s?t:null},children:{tag:`form`,props:{...n,ref:o},type:`form`,ref:o}},f:c}},Mt=(e,{formAction:t,...n})=>{if(typeof t==`function`){let e=ht(e=>{e.preventDefault(),e.currentTarget.form.dispatchEvent(new CustomEvent(`submit`,{detail:{[At]:t}}))},[]);n.ref=J(n.ref,t=>(t.addEventListener(`click`,e),()=>{t.removeEventListener(`click`,e)}))}return{tag:e,props:n,type:e,ref:n.ref}},Nt=e=>Mt(`input`,e),Pt=e=>Mt(`button`,e);Object.assign(S,{title:Tt,script:Et,style:Dt,link:Ot,meta:kt,form:jt,input:Nt,button:Pt});var Ft=(e,t,n)=>(typeof e==`string`&&xt[e]&&(e=xt[e]),{tag:e,type:e,props:t,key:n,ref:t.ref}),It=e=>Ft(``,e,void 0),Lt=(({children:e,fallback:t,fallbackRender:n,onError:r})=>{let i=It({children:e});return i[u]=e=>{if(e instanceof Promise)throw e;return r?.(e),n?.(e)||t},i}),Rt=(({children:e,fallback:t})=>{let n=It({children:e});return n[u]=(e,n)=>{if(!(e instanceof Promise))throw e;return e.finally(n),t},n}),zt=y(null),Bt=0,Vt=async({children:e,fallback:t})=>{Array.isArray(e)||(e=[e]);let i=b(zt)?.scriptNonce,a=[],o={[d]:[0,[]]},s=e=>(B.pop(),e);try{o[d][0]=0,B.push([[],o]),a=e.map(e=>e==null||typeof e==`boolean`?``:e.toString())}catch(t){if(t instanceof Promise)a=[t.then(()=>(o[d][0]=0,B.push([[],o]),Ut(e).then(s)))];else throw t}finally{s()}if(a.some(e=>e instanceof Promise)){let e=Bt++,o=await t.toString();return r(`<template id="H:${e}"></template>${o}<!--/$-->`,[...o.callbacks||[],({phase:t,buffer:o,context:s})=>{if(t!==n.BeforeStream)return Promise.all(a).then(async a=>{a=a.flat();let l=a.join(``);o&&(o[0]=o[0].replace(RegExp(`<template id="H:${e}"></template>.*?<!--/\\$-->`),l));let u=o?``:`<template data-hono-target="H:${e}">${l}</template><script${i?` nonce="${i}"`:``}>
|
|
2
2
|
((d,c,n) => {
|
|
3
3
|
c=d.currentScript.previousSibling
|
|
4
4
|
d=d.getElementById('H:${e}')
|
|
@@ -6,7 +6,7 @@ if(!d)return
|
|
|
6
6
|
do{n=d.nextSibling;n.remove()}while(n.nodeType!=8||n.nodeValue!='/$')
|
|
7
7
|
d.replaceWith(c.content)
|
|
8
8
|
})(document)
|
|
9
|
-
<\/script>`,d=a.map(e=>e.callbacks||[]).flat();return d.length?(t===n.Stream&&(u=await c(u,n.BeforeStream,!0,s)),r(u,d)):u})}])}else return r(a.join(``))};
|
|
9
|
+
<\/script>`,d=a.map(e=>e.callbacks||[]).flat();return d.length?(t===n.Stream&&(u=await c(u,n.BeforeStream,!0,s)),r(u,d)):u})}])}else return r(a.join(``))};Vt[l]=Rt,new TextEncoder;var Ht=0,Ut=async e=>{try{return e.flat().map(e=>e==null||typeof e==`boolean`?``:e.toString())}catch(t){if(t instanceof Promise)return await t,Ut(e);throw t}},Wt=e=>{if(e==null||typeof e==`boolean`)return``;if(typeof e==`string`)return e;{let t=e.toString();return t instanceof Promise?t:r(t)}},Gt=async({children:e,fallback:t,fallbackRender:i,onError:a})=>{if(!e)return r(``);Array.isArray(e)||(e=[e]);let o=b(zt)?.scriptNonce,s,l=async()=>{let e=await t;typeof e==`string`?s=e:(s=await e?.toString(),typeof s==`string`&&(s=r(s)))},u=e=>(a?.(e),s||i&&Me(R,{},i(e))||``),d=[];try{d=e.map(Wt)}catch(t){await l(),d=t instanceof Promise?[t.then(()=>Ut(e)).catch(e=>u(e))]:[u(t)]}if(d.some(e=>e instanceof Promise)){await l();let e=Ht++,t=RegExp(`(<template id="E:${e}"></template>.*?)(.*?)(<!--E:${e}-->)`),i=async({error:n,buffer:r})=>{let i=await R({children:u(n)}).toString();return r&&(r[0]=r[0].replace(t,i)),r?``:`<template data-hono-target="E:${e}">${i}</template><script>
|
|
10
10
|
((d,c,n) => {
|
|
11
11
|
c=d.currentScript.previousSibling
|
|
12
12
|
d=d.getElementById('E:${e}')
|
|
@@ -30,4 +30,4 @@ while(n.nodeType!=8||n.nodeValue!='E:${e}'){n=n.nextSibling}
|
|
|
30
30
|
n.remove()
|
|
31
31
|
d.remove()
|
|
32
32
|
})(document)
|
|
33
|
-
<\/script>`:``),n.callbacks))).catch(e=>i({error:e,buffer:u})));return r(p,g)}).catch(e=>i({error:e,buffer:u}))}])}else return R({children:d})};Gt[l]=
|
|
33
|
+
<\/script>`:``),n.callbacks))).catch(e=>i({error:e,buffer:u})));return r(p,g)}).catch(e=>i({error:e,buffer:u}))}])}else return R({children:d})};Gt[l]=Lt;var Kt=(e,t={})=>{let n;return Object.keys(t).length>0&&console.warn(`createRoot options are not supported yet`),{render(t){if(n===null)throw Error(`Cannot update an unmounted root`);n?n(t):rt($e({tag:()=>{let[e,r]=ft(t);return n=r,e},props:{}}),e)},unmount(){n?.(null),n=null}}},qt=(e,t,n={})=>{let r=Kt(e,n);return r.render(t),r};function Jt(){return mt(()=>{let e=document.querySelectorAll(`form`),t=[];return e.forEach(e=>{let n=e=>{if(e.defaultPrevented)return;let t=e.submitter;t&&t.type===`submit`&&(t.classList.add(`is-loading`),t.disabled=!0)};e.addEventListener(`submit`,n);let r=t=>{t.persisted&&e.querySelectorAll(`button[type=submit]`).forEach(e=>{e.classList.remove(`is-loading`),e.disabled=!1})};window.addEventListener(`pageshow`,r),t.push(()=>{e.removeEventListener(`submit`,n),window.removeEventListener(`pageshow`,r)})}),()=>{t.forEach(e=>e())}},[]),null}function Yt(){return mt(()=>{let e=document.querySelectorAll(`a[data-loading-link]`),t=[];return e.forEach(e=>{let n=t=>{t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||e.classList.add(`is-loading`)};e.addEventListener(`click`,n);let r=t=>{t.persisted&&e.classList.remove(`is-loading`)};window.addEventListener(`pageshow`,r),t.push(()=>{e.removeEventListener(`click`,n),window.removeEventListener(`pageshow`,r)})}),()=>{t.forEach(e=>e())}},[]),null}function Xt(){return mt(()=>{let e=document.querySelectorAll(`[data-password-toggle]`),t=[];return e.forEach(e=>{let n=e.querySelector(`input[type='password'], input[data-password-input]`),r=e.querySelector(`[data-password-toggle-btn]`),i=r?.querySelector(`[data-show-icon]`),a=r?.querySelector(`[data-hide-icon]`);if(!n||!r||!i||!a)return;let o=e=>{e?(n.type=`text`,n.setAttribute(`data-password-input`,`text`),i.classList.add(`hidden`),a.classList.remove(`hidden`)):(n.type=`password`,n.setAttribute(`data-password-input`,`password`),a.classList.add(`hidden`),i.classList.remove(`hidden`))},s=e=>{e.preventDefault(),o(n.type===`password`)};r.addEventListener(`click`,s),t.push(()=>{r.removeEventListener(`click`,s)})}),()=>{t.forEach(e=>e())}},[]),null}function Zt(){return document.querySelectorAll(`[data-input-otp-container]`).forEach(e=>{let t=Array.from(e.querySelectorAll(`[data-input-otp-slot]`));if(!t.length)return;let n=e.closest(`form`),r=null;if(n&&t.length>0){let e=t[0]?.getAttribute(`name`);e&&(r=n.querySelector(`input[name="${e}"][type="hidden"]`),r||(r=document.createElement(`input`),r.type=`hidden`,r.name=e,n.appendChild(r)),t.forEach(e=>e.removeAttribute(`name`)))}let i=()=>{if(r){let e=t.map(e=>e.value).join(``);r.value=e,e.length===t.length&&n&&setTimeout(()=>{n.requestSubmit()},100)}};t.forEach((e,n)=>{e.addEventListener(`input`,e=>{let r=e.target,a=r.value;a=a.replace(/[^0-9]/g,``),a.length>1&&(a=a.charAt(0)),r.value=a,a&&n<t.length-1&&t[n+1]?.focus(),i()}),e.addEventListener(`paste`,e=>{e.preventDefault();let r=(e.clipboardData?.getData(`text`)||``).replace(/[^0-9]/g,``);for(let e=0;e<Math.min(r.length,t.length-n);e++){let i=t[n+e],a=r.charAt(e);i&&a&&(i.value=a)}let a=t.findIndex((e,t)=>t>=n&&!e.value);a===-1?t[Math.min(n+r.length,t.length-1)]?.focus():t[a]?.focus(),i()}),e.addEventListener(`keydown`,e=>{if(e.key===`Backspace`){let r=e.target;if(!r.value&&n>0){e.preventDefault();let r=t[n-1];r&&(r.value=``,r.focus()),i()}else r.value&&setTimeout(()=>i(),0)}else e.key===`ArrowLeft`&&n>0?(e.preventDefault(),t[n-1]?.focus()):e.key===`ArrowRight`&&n<t.length-1&&(e.preventDefault(),t[n+1]?.focus())}),e.addEventListener(`focus`,()=>{e.select()})}),i()}),null}var Qt={d:(e,t)=>{for(var n in t)Qt.o(t,n)&&!Qt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},$t={};Qt.d($t,{A:()=>tn,k:()=>en});var X=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},Z=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function en(){return X(this,void 0,Promise,function(){return Z(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e,t){var n=`Unknown`,r=!1;function i(t){r||(r=!0,e({isPrivate:t,browserName:n}))}function a(){var e=0,t=-1;try{t.toFixed(t)}catch(t){e=t.message.length}return e}function o(){return X(this,void 0,void 0,function(){var e,t;return Z(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return n.sent(),i(!1),[3,3];case 2:return e=n.sent(),t=e instanceof Error&&typeof e.message==`string`?e.message:String(e),i(t.includes(`unknown transient reason`)),[3,3];case 3:return[2]}})})}function s(){return X(this,void 0,Promise,function(){return Z(this,function(e){switch(e.label){case 0:return typeof navigator.storage?.getDirectory==`function`?[4,o()]:[3,2];case 1:return e.sent(),[3,3];case 2:navigator.maxTouchPoints===void 0?function(){var e=window.openDatabase,t=window.localStorage;try{e(null,null,null,null)}catch{i(!0);return}try{t.setItem(`test`,`1`),t.removeItem(`test`)}catch{i(!0);return}i(!1)}():function(){var e=String(Math.random());try{var t=indexedDB.open(e,1);t.onupgradeneeded=function(t){var n=t.target.result,r=function(e){i(e)};try{n.createObjectStore(`t`,{autoIncrement:!0}).put(new Blob),r(!1)}catch(e){(e instanceof Error&&typeof e.message==`string`?e.message:String(e)).includes(`are not yet supported`)?r(!0):r(!1)}finally{n.close(),indexedDB.deleteDatabase(e)}},t.onerror=function(){return i(!1)}}catch{i(!1)}}(),e.label=3;case 3:return[2]}})})}function c(){return X(this,void 0,Promise,function(){var e,t,n;return Z(this,function(r){switch(r.label){case 0:if(typeof navigator.storage?.getDirectory!=`function`)return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return r.sent(),i(!1),[3,4];case 3:return e=r.sent(),t=e instanceof Error&&typeof e.message==`string`?e.message:String(e),i(t.includes(`Security error`)),[2];case 4:return[3,6];case 5:(n=indexedDB.open(`inPrivate`)).onerror=function(e){n.error&&n.error.name===`InvalidStateError`&&e.preventDefault(),i(!0)},n.onsuccess=function(){indexedDB.deleteDatabase(`inPrivate`),i(!1)},r.label=6;case 6:return[2]}})})}(function(){return X(this,void 0,Promise,function(){return Z(this,function(e){switch(e.label){case 0:return a()!==44&&a()!==43?[3,2]:(n=`Safari`,[4,s()]);case 1:return e.sent(),[3,6];case 2:return a()===51?(o=navigator.userAgent,n=o.match(/Chrome/)?navigator.brave===void 0?o.match(/Edg/)?`Edge`:o.match(/OPR/)?`Opera`:`Chrome`:`Brave`:`Chromium`,(r=new Worker(URL.createObjectURL(new Blob([`(async()=>{try{const r=await navigator.storage.getDirectory(),f=await(await r.getFileHandle('_',{create:true})).createSyncAccessHandle(),b=new Uint8Array(1);let m=1/0;for(let i=0;i<3;i++){f.write(b,{at:0});const s=performance.now();f.flush();const dt=performance.now()-s;if(dt<m)m=dt}f.close();postMessage(m<.1)}catch{postMessage(false)}})()`])))).onmessage=function(e){r.terminate(),i(e.data)},[3,6]):[3,3];case 3:return a()===25?(n=`Firefox`,[4,c()]):[3,5];case 4:return e.sent(),[3,6];case 5:navigator.msSaveBlob===void 0?t(Error(`detectIncognito cannot determine the browser`)):(n=`Internet Explorer`,i(window.indexedDB===void 0)),e.label=6;case 6:return[2]}var r,o})})})().catch(t)})];case 1:return[2,e.sent()]}})})}typeof window<`u`&&(window.detectIncognito=en);var tn=en;$t.A;var nn=$t.k,Q=`authhero_incognito_mode`;function rn(){try{let e=sessionStorage.getItem(Q);return e===null?void 0:e===`true`}catch{return}}async function an(){try{let e=sessionStorage.getItem(Q);if(e!==null)return e===`true`;let{isPrivate:t}=await nn();return sessionStorage.setItem(Q,t.toString()),t}catch{try{sessionStorage.setItem(Q,`false`)}catch{}return!1}}var on=()=>{let e=rn();if(e!==void 0){e&&sn();return}an().then(e=>{e&&sn()}).catch(()=>{})};function sn(){let e=document.getElementById(`incognito-warning-container`);e&&e.classList.remove(`hidden`)}function $(e,t,n){let r;if(!t||!(`children`in t))r=L(e,t,[]);else{let n=t.children;r=Array.isArray(n)?L(e,t,n):L(e,t,[n])}return r.key=n,r}on();var cn=document.getElementById(`client-root`);cn&&qt(cn,$(R,{children:[$(Jt,{}),$(Yt,{}),$(Xt,{}),$(Zt,{})]}));
|