var he=Object.defineProperty,de=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var Z=(a,e,t)=>e in a?he(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,b=(a,e)=>{for(var t in e||(e={}))ee.call(e,t)&&Z(a,t,e[t]);if(B)for(var t of B(e))te.call(e,t)&&Z(a,t,e[t]);return a},W=(a,e)=>de(a,pe(e));var re=(a,e)=>{var t={};for(var s in a)ee.call(a,s)&&e.indexOf(s)<0&&(t[s]=a[s]);if(a!=null&&B)for(var s of B(a))e.indexOf(s)<0&&te.call(a,s)&&(t[s]=a[s]);return t};import{S as ge,i as me,s as ve,e as we,c as be,a as ye,d as R,b as G,f as I,g as x,t as Ee,h as ke,j as $e,k as Re,l as y,m as Le,n as S,o as E,p as U,q as k,r as Oe,u as xe,v as F,w as A,x as z,y as P,z as q,A as C,B as T,C as j,D as Y,E as se}from"./chunks/vendor-hf-doc-builder.js";import{s as Ae,b as Pe}from"./chunks/paths-hf-doc-builder.js";function Te(a){let e,t,s;const o=[a[1]||{}];var i=a[0][0];function l(r){let n={};for(let c=0;c<o.length;c+=1)n=j(n,o[c]);return{props:n}}return i&&(e=new i(l())),{c(){e&&A(e.$$.fragment),t=y()},l(r){e&&z(e.$$.fragment,r),t=y()},m(r,n){e&&P(e,r,n),x(r,t,n),s=!0},p(r,n){const c=n&2?q(o,[C(r[1]||{})]):{};if(i!==(i=r[0][0])){if(e){S();const f=e;E(f.$$.fragment,1,0,()=>{T(f,1)}),U()}i?(e=new i(l()),A(e.$$.fragment),k(e.$$.fragment,1),P(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(r){s||(e&&k(e.$$.fragment,r),s=!0)},o(r){e&&E(e.$$.fragment,r),s=!1},d(r){r&&R(t),e&&T(e,r)}}}function Ve(a){let e,t,s;const o=[a[1]||{}];var i=a[0][0];function l(r){let n={$$slots:{default:[Ue]},$$scope:{ctx:r}};for(let c=0;c<o.length;c+=1)n=j(n,o[c]);return{props:n}}return i&&(e=new i(l(a))),{c(){e&&A(e.$$.fragment),t=y()},l(r){e&&z(e.$$.fragment,r),t=y()},m(r,n){e&&P(e,r,n),x(r,t,n),s=!0},p(r,n){const c=n&2?q(o,[C(r[1]||{})]):{};if(n&525&&(c.$$scope={dirty:n,ctx:r}),i!==(i=r[0][0])){if(e){S();const f=e;E(f.$$.fragment,1,0,()=>{T(f,1)}),U()}i?(e=new i(l(r)),A(e.$$.fragment),k(e.$$.fragment,1),P(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(r){s||(e&&k(e.$$.fragment,r),s=!0)},o(r){e&&E(e.$$.fragment,r),s=!1},d(r){r&&R(t),e&&T(e,r)}}}function Ie(a){let e,t,s;const o=[a[2]||{}];var i=a[0][1];function l(r){let n={};for(let c=0;c<o.length;c+=1)n=j(n,o[c]);return{props:n}}return i&&(e=new i(l())),{c(){e&&A(e.$$.fragment),t=y()},l(r){e&&z(e.$$.fragment,r),t=y()},m(r,n){e&&P(e,r,n),x(r,t,n),s=!0},p(r,n){const c=n&4?q(o,[C(r[2]||{})]):{};if(i!==(i=r[0][1])){if(e){S();const f=e;E(f.$$.fragment,1,0,()=>{T(f,1)}),U()}i?(e=new i(l()),A(e.$$.fragment),k(e.$$.fragment,1),P(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(r){s||(e&&k(e.$$.fragment,r),s=!0)},o(r){e&&E(e.$$.fragment,r),s=!1},d(r){r&&R(t),e&&T(e,r)}}}function De(a){let e,t,s;const o=[a[2]||{}];var i=a[0][1];function l(r){let n={$$slots:{default:[Se]},$$scope:{ctx:r}};for(let c=0;c<o.length;c+=1)n=j(n,o[c]);return{props:n}}return i&&(e=new i(l(a))),{c(){e&&A(e.$$.fragment),t=y()},l(r){e&&z(e.$$.fragment,r),t=y()},m(r,n){e&&P(e,r,n),x(r,t,n),s=!0},p(r,n){const c=n&4?q(o,[C(r[2]||{})]):{};if(n&521&&(c.$$scope={dirty:n,ctx:r}),i!==(i=r[0][1])){if(e){S();const f=e;E(f.$$.fragment,1,0,()=>{T(f,1)}),U()}i?(e=new i(l(r)),A(e.$$.fragment),k(e.$$.fragment,1),P(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(r){s||(e&&k(e.$$.fragment,r),s=!0)},o(r){e&&E(e.$$.fragment,r),s=!1},d(r){r&&R(t),e&&T(e,r)}}}function Se(a){let e,t,s;const o=[a[3]||{}];var i=a[0][2];function l(r){let n={};for(let c=0;c<o.length;c+=1)n=j(n,o[c]);return{props:n}}return i&&(e=new i(l())),{c(){e&&A(e.$$.fragment),t=y()},l(r){e&&z(e.$$.fragment,r),t=y()},m(r,n){e&&P(e,r,n),x(r,t,n),s=!0},p(r,n){const c=n&8?q(o,[C(r[3]||{})]):{};if(i!==(i=r[0][2])){if(e){S();const f=e;E(f.$$.fragment,1,0,()=>{T(f,1)}),U()}i?(e=new i(l()),A(e.$$.fragment),k(e.$$.fragment,1),P(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(r){s||(e&&k(e.$$.fragment,r),s=!0)},o(r){e&&E(e.$$.fragment,r),s=!1},d(r){r&&R(t),e&&T(e,r)}}}function Ue(a){let e,t,s,o;const i=[De,Ie],l=[];function r(n,c){return n[0][2]?0:1}return e=r(a),t=l[e]=i[e](a),{c(){t.c(),s=y()},l(n){t.l(n),s=y()},m(n,c){l[e].m(n,c),x(n,s,c),o=!0},p(n,c){let f=e;e=r(n),e===f?l[e].p(n,c):(S(),E(l[f],1,1,()=>{l[f]=null}),U(),t=l[e],t?t.p(n,c):(t=l[e]=i[e](n),t.c()),k(t,1),t.m(s.parentNode,s))},i(n){o||(k(t),o=!0)},o(n){E(t),o=!1},d(n){l[e].d(n),n&&R(s)}}}function ie(a){let e,t=a[5]&&ne(a);return{c(){e=we("div"),t&&t.c(),this.h()},l(s){e=be(s,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=ye(e);t&&t.l(o),o.forEach(R),this.h()},h(){G(e,"id","svelte-announcer"),G(e,"aria-live","assertive"),G(e,"aria-atomic","true"),I(e,"position","absolute"),I(e,"left","0"),I(e,"top","0"),I(e,"clip","rect(0 0 0 0)"),I(e,"clip-path","inset(50%)"),I(e,"overflow","hidden"),I(e,"white-space","nowrap"),I(e,"width","1px"),I(e,"height","1px")},m(s,o){x(s,e,o),t&&t.m(e,null)},p(s,o){s[5]?t?t.p(s,o):(t=ne(s),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(s){s&&R(e),t&&t.d()}}}function ne(a){let e;return{c(){e=Ee(a[6])},l(t){e=ke(t,a[6])},m(t,s){x(t,e,s)},p(t,s){s&64&&$e(e,t[6])},d(t){t&&R(e)}}}function Ne(a){let e,t,s,o,i;const l=[Ve,Te],r=[];function n(f,h){return f[0][1]?0:1}e=n(a),t=r[e]=l[e](a);let c=a[4]&&ie(a);return{c(){t.c(),s=Re(),c&&c.c(),o=y()},l(f){t.l(f),s=Le(f),c&&c.l(f),o=y()},m(f,h){r[e].m(f,h),x(f,s,h),c&&c.m(f,h),x(f,o,h),i=!0},p(f,[h]){let _=e;e=n(f),e===_?r[e].p(f,h):(S(),E(r[_],1,1,()=>{r[_]=null}),U(),t=r[e],t?t.p(f,h):(t=r[e]=l[e](f),t.c()),k(t,1),t.m(s.parentNode,s)),f[4]?c?c.p(f,h):(c=ie(f),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null)},i(f){i||(k(t),i=!0)},o(f){E(t),i=!1},d(f){r[e].d(f),f&&R(s),c&&c.d(f),f&&R(o)}}}function ze(a,e,t){let{stores:s}=e,{page:o}=e,{components:i}=e,{props_0:l=null}=e,{props_1:r=null}=e,{props_2:n=null}=e;Oe("__svelte__",s),xe(s.page.notify);let c=!1,f=!1,h=null;return F(()=>{const _=s.page.subscribe(()=>{c&&(t(5,f=!0),t(6,h=document.title||"untitled page"))});return t(4,c=!0),_}),a.$$set=_=>{"stores"in _&&t(7,s=_.stores),"page"in _&&t(8,o=_.page),"components"in _&&t(0,i=_.components),"props_0"in _&&t(1,l=_.props_0),"props_1"in _&&t(2,r=_.props_1),"props_2"in _&&t(3,n=_.props_2)},a.$$.update=()=>{a.$$.dirty&384&&s.page.set(o)},[i,l,r,n,c,f,h,s,o]}class qe extends ge{constructor(e){super();me(this,e,ze,Ne,ve,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const Ce="modulepreload",ae={},je="/docs/optimum/pr_455/en/_app/",p=function(e,t){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=`${je}${s}`,s in ae)return;ae[s]=!0;const o=s.endsWith(".css"),i=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${i}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":Ce,o||(l.as="script",l.crossOrigin=""),l.href=s,document.head.appendChild(l),o)return new Promise((r,n)=>{l.addEventListener("load",r),l.addEventListener("error",n)})})).then(()=>e())},u=[()=>p(()=>import("./pages/__layout.svelte-hf-doc-builder.js"),["pages/__layout.svelte-hf-doc-builder.js","assets/pages/__layout.svelte-hf-doc-builder.css","chunks/vendor-hf-doc-builder.js","chunks/paths-hf-doc-builder.js"]),()=>p(()=>import("./error.svelte-hf-doc-builder.js"),["error.svelte-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js"]),()=>p(()=>import("./pages/index.mdx-hf-doc-builder.js"),["pages/index.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/package_reference/modeling_base.mdx-hf-doc-builder.js"),["pages/package_reference/modeling_base.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Docstring-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/package_reference/benchmark.mdx-hf-doc-builder.js"),["pages/package_reference/benchmark.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Docstring-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/concept_guides/quantization.mdx-hf-doc-builder.js"),["pages/concept_guides/quantization.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/installation.mdx-hf-doc-builder.js"),["pages/installation.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/package_reference/configuration.mdx-hf-doc-builder.js"),["pages/onnxruntime/package_reference/configuration.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Docstring-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/package_reference/modeling_ort.mdx-hf-doc-builder.js"),["pages/onnxruntime/package_reference/modeling_ort.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Tip-hf-doc-builder.js","chunks/Docstring-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js","chunks/ExampleCodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/package_reference/optimization.mdx-hf-doc-builder.js"),["pages/onnxruntime/package_reference/optimization.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Docstring-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/package_reference/quantization.mdx-hf-doc-builder.js"),["pages/onnxruntime/package_reference/quantization.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Docstring-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/package_reference/trainer.mdx-hf-doc-builder.js"),["pages/onnxruntime/package_reference/trainer.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Tip-hf-doc-builder.js","chunks/Docstring-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/concept_guides/onnx.mdx-hf-doc-builder.js"),["pages/onnxruntime/concept_guides/onnx.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Tip-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/usage_guides/optimization.mdx-hf-doc-builder.js"),["pages/onnxruntime/usage_guides/optimization.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/usage_guides/quantization.mdx-hf-doc-builder.js"),["pages/onnxruntime/usage_guides/quantization.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/usage_guides/pipelines.mdx-hf-doc-builder.js"),["pages/onnxruntime/usage_guides/pipelines.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Tip-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/usage_guides/trainer.mdx-hf-doc-builder.js"),["pages/onnxruntime/usage_guides/trainer.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Tip-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/usage_guides/models.mdx-hf-doc-builder.js"),["pages/onnxruntime/usage_guides/models.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/usage_guides/gpu.mdx-hf-doc-builder.js"),["pages/onnxruntime/usage_guides/gpu.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Tip-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/quickstart.mdx-hf-doc-builder.js"),["pages/onnxruntime/quickstart.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/tutorials/overview.mdx-hf-doc-builder.js"),["pages/onnxruntime/tutorials/overview.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/onnxruntime/overview.mdx-hf-doc-builder.js"),["pages/onnxruntime/overview.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/notebooks.mdx-hf-doc-builder.js"),["pages/notebooks.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/quicktour.mdx-hf-doc-builder.js"),["pages/quicktour.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/torch_fx/package_reference/optimization.mdx-hf-doc-builder.js"),["pages/torch_fx/package_reference/optimization.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/Docstring-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js","chunks/ExampleCodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/torch_fx/concept_guides/symbolic_tracer.mdx-hf-doc-builder.js"),["pages/torch_fx/concept_guides/symbolic_tracer.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/torch_fx/usage_guides/optimization.mdx-hf-doc-builder.js"),["pages/torch_fx/usage_guides/optimization.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js","chunks/CodeBlock-hf-doc-builder.js"]),()=>p(()=>import("./pages/torch_fx/tutorials/overview.mdx-hf-doc-builder.js"),["pages/torch_fx/tutorials/overview.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"]),()=>p(()=>import("./pages/torch_fx/overview.mdx-hf-doc-builder.js"),["pages/torch_fx/overview.mdx-hf-doc-builder.js","chunks/vendor-hf-doc-builder.js","chunks/IconCopyLink-hf-doc-builder.js"])],Je=[[/^\/$/,[u[0],u[2]],[u[1]]],[/^\/package_reference\/modeling_base\/?$/,[u[0],u[3]],[u[1]]],[/^\/package_reference\/benchmark\/?$/,[u[0],u[4]],[u[1]]],[/^\/concept_guides\/quantization\/?$/,[u[0],u[5]],[u[1]]],[/^\/installation\/?$/,[u[0],u[6]],[u[1]]],[/^\/onnxruntime\/package_reference\/configuration\/?$/,[u[0],u[7]],[u[1]]],[/^\/onnxruntime\/package_reference\/modeling_ort\/?$/,[u[0],u[8]],[u[1]]],[/^\/onnxruntime\/package_reference\/optimization\/?$/,[u[0],u[9]],[u[1]]],[/^\/onnxruntime\/package_reference\/quantization\/?$/,[u[0],u[10]],[u[1]]],[/^\/onnxruntime\/package_reference\/trainer\/?$/,[u[0],u[11]],[u[1]]],[/^\/onnxruntime\/concept_guides\/onnx\/?$/,[u[0],u[12]],[u[1]]],[/^\/onnxruntime\/usage_guides\/optimization\/?$/,[u[0],u[13]],[u[1]]],[/^\/onnxruntime\/usage_guides\/quantization\/?$/,[u[0],u[14]],[u[1]]],[/^\/onnxruntime\/usage_guides\/pipelines\/?$/,[u[0],u[15]],[u[1]]],[/^\/onnxruntime\/usage_guides\/trainer\/?$/,[u[0],u[16]],[u[1]]],[/^\/onnxruntime\/usage_guides\/models\/?$/,[u[0],u[17]],[u[1]]],[/^\/onnxruntime\/usage_guides\/gpu\/?$/,[u[0],u[18]],[u[1]]],[/^\/onnxruntime\/quickstart\/?$/,[u[0],u[19]],[u[1]]],[/^\/onnxruntime\/tutorials\/overview\/?$/,[u[0],u[20]],[u[1]]],[/^\/onnxruntime\/overview\/?$/,[u[0],u[21]],[u[1]]],[/^\/notebooks\/?$/,[u[0],u[22]],[u[1]]],[/^\/quicktour\/?$/,[u[0],u[23]],[u[1]]],[/^\/torch_fx\/package_reference\/optimization\/?$/,[u[0],u[24]],[u[1]]],[/^\/torch_fx\/concept_guides\/symbolic_tracer\/?$/,[u[0],u[25]],[u[1]]],[/^\/torch_fx\/usage_guides\/optimization\/?$/,[u[0],u[26]],[u[1]]],[/^\/torch_fx\/tutorials\/overview\/?$/,[u[0],u[27]],[u[1]]],[/^\/torch_fx\/overview\/?$/,[u[0],u[28]],[u[1]]]],Ke=[u[0](),u[1]()];function Be(a){let e=a.baseURI;if(!e){const t=a.getElementsByTagName("base");e=t.length?t[0].href:a.URL}return e}function We(a,e){return a==="/"||e==="ignore"?a:e==="never"?a.endsWith("/")?a.slice(0,-1):a:e==="always"&&/\/[^./]+$/.test(a)?a+"/":a}const _e="sveltekit:scroll";let N={};try{N=JSON.parse(sessionStorage[_e])}catch{}function M(a){N[a]=X()}function X(){return{x:pageXOffset,y:pageYOffset}}function oe(a){return a.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function le(a){return a instanceof SVGAElement?new URL(a.href.baseVal,document.baseURI):new URL(a.href)}class Ye{constructor({base:e,routes:t,trailing_slash:s,renderer:o}){var l,r;this.base=e,this.routes=t,this.trailing_slash=s,this.navigating=0,this.renderer=o,o.router=this,this.enabled=!0,this.initialized=!1,document.body.setAttribute("tabindex","-1"),this.current_history_index=(r=(l=history.state)==null?void 0:l["sveltekit:index"])!=null?r:0,this.current_history_index===0&&history.replaceState(W(b({},history.state),{"sveltekit:index":0}),"",location.href);const i=N[this.current_history_index];i&&scrollTo(i.x,i.y),this.hash_navigating=!1,this.callbacks={before_navigate:[],after_navigate:[]}}init_listeners(){history.scrollRestoration="manual",addEventListener("beforeunload",o=>{let i=!1;const l={from:this.renderer.current.url,to:null,cancel:()=>i=!0};this.callbacks.before_navigate.forEach(r=>r(l)),i?(o.preventDefault(),o.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){M(this.current_history_index);try{sessionStorage[_e]=JSON.stringify(N)}catch{}}});const e=o=>{const i=oe(o);i&&i.href&&i.hasAttribute("sveltekit:prefetch")&&this.prefetch(le(i))};let t;const s=o=>{clearTimeout(t),t=setTimeout(()=>{var i;(i=o.target)==null||i.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",e),addEventListener("mousemove",s),addEventListener("sveltekit:trigger_prefetch",e),addEventListener("click",o=>{if(!this.enabled||o.button||o.which!==1||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey||o.defaultPrevented)return;const i=oe(o);if(!i||!i.href)return;const l=i instanceof SVGAElement,r=le(i);if(r.toString()===location.href){location.hash||o.preventDefault();return}if(!l&&r.origin==="null")return;const c=(i.getAttribute("rel")||"").split(/\s+/);if(i.hasAttribute("download")||c&&c.includes("external")||(l?i.target.baseVal:i.target))return;const[f,h]=r.href.split("#");if(h!==void 0&&f===location.href.split("#")[0]){this.hash_navigating=!0,M(this.current_history_index),this.renderer.update_page_store(new URL(r.href));return}this._navigate({url:r,scroll:i.hasAttribute("sveltekit:noscroll")?X():null,keepfocus:!1,chain:[],details:{state:{},replaceState:!1},accepted:()=>o.preventDefault(),blocked:()=>o.preventDefault()})}),addEventListener("popstate",o=>{if(o.state&&this.enabled){if(o.state["sveltekit:index"]===this.current_history_index)return;this._navigate({url:new URL(location.href),scroll:N[o.state["sveltekit:index"]],keepfocus:!1,chain:[],details:null,accepted:()=>{this.current_history_index=o.state["sveltekit:index"]},blocked:()=>{const i=this.current_history_index-o.state["sveltekit:index"];history.go(i)}})}}),addEventListener("hashchange",()=>{this.hash_navigating&&(this.hash_navigating=!1,history.replaceState(W(b({},history.state),{"sveltekit:index":++this.current_history_index}),"",location.href))}),this.initialized=!0}owns(e){return e.origin===location.origin&&e.pathname.startsWith(this.base)}parse(e){if(this.owns(e)){const t=decodeURI(e.pathname.slice(this.base.length)||"/");return{id:e.pathname+e.search,routes:this.routes.filter(([s])=>s.test(t)),url:e,path:t,initial:!this.initialized}}}async goto(e,{noscroll:t=!1,replaceState:s=!1,keepfocus:o=!1,state:i={}}={},l){const r=new URL(e,Be(document));return this.enabled?this._navigate({url:r,scroll:t?X():null,keepfocus:o,chain:l,details:{state:i,replaceState:s},accepted:()=>{},blocked:()=>{}}):(location.href=r.href,new Promise(()=>{}))}enable(){this.enabled=!0}disable(){this.enabled=!1}async prefetch(e){const t=this.parse(e);if(!t)throw new Error("Attempted to prefetch a URL that does not belong to this app");return this.renderer.load(t)}after_navigate(e){F(()=>(this.callbacks.after_navigate.push(e),()=>{const t=this.callbacks.after_navigate.indexOf(e);this.callbacks.after_navigate.splice(t,1)}))}before_navigate(e){F(()=>(this.callbacks.before_navigate.push(e),()=>{const t=this.callbacks.before_navigate.indexOf(e);this.callbacks.before_navigate.splice(t,1)}))}async _navigate({url:e,scroll:t,keepfocus:s,chain:o,details:i,accepted:l,blocked:r}){const n=this.renderer.current.url;let c=!1;const f={from:n,to:e,cancel:()=>c=!0};if(this.callbacks.before_navigate.forEach(g=>g(f)),c){r();return}const h=this.parse(e);if(!h)return location.href=e.href,new Promise(()=>{});M(this.current_history_index),l(),this.navigating++;const _=We(e.pathname,this.trailing_slash);h.url=new URL(e.origin+_+e.search+e.hash);const d=this.navigating_token={};if(await this.renderer.handle_navigation(h,o,!1,{scroll:t,keepfocus:s}),this.navigating--,this.navigating_token===d){if(!this.navigating){const g={from:n,to:e};this.callbacks.after_navigate.forEach(V=>V(g))}if(i){const g=i.replaceState?0:1;i.state["sveltekit:index"]=this.current_history_index+=g,history[i.replaceState?"replaceState":"pushState"](i.state,"",h.url)}}}}function ce(a){return a instanceof Error||a&&a.name&&a.message?a:new Error(JSON.stringify(a))}function Ge(a){let e=5381,t=a.length;if(typeof a=="string")for(;t;)e=e*33^a.charCodeAt(--t);else for(;t;)e=e*33^a[--t];return(e>>>0).toString(36)}function ue(a){const e=a.status&&a.status>=400&&a.status<=599&&!a.redirect;if(a.error||e){const t=a.status;if(!a.error&&e)return{status:t||500,error:new Error};const s=typeof a.error=="string"?new Error(a.error):a.error;return s instanceof Error?!t||t<400||t>599?(console.warn('"error" returned from load() without a valid status code \u2014 defaulting to 500'),{status:500,error:s}):{status:t,error:s}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof s}"`)}}if(a.redirect){if(!a.status||Math.floor(a.status/100)!==3)return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if(typeof a.redirect!="string")return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}if(a.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return a}function fe(a){const e=Y(a);let t=!0;function s(){t=!0,e.update(l=>l)}function o(l){t=!1,e.set(l)}function i(l){let r;return e.subscribe(n=>{(r===void 0||t&&n!==r)&&l(r=n)})}return{notify:s,set:o,subscribe:i}}function Me(){const{set:a,subscribe:e}=Y(!1),t="1667991878759";let s;async function o(){clearTimeout(s);const l=await fetch(`${Pe}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(l.ok){const{version:r}=await l.json(),n=r!==t;return n&&(a(!0),clearTimeout(s)),n}else throw new Error(`Version check failed: ${l.status}`)}return{subscribe:e,check:o}}function Fe(a,e){const t=typeof a=="string"?a:a.url;let s=`script[data-type="svelte-data"][data-url=${JSON.stringify(t)}]`;e&&typeof e.body=="string"&&(s+=`[data-body="${Ge(e.body)}"]`);const o=document.querySelector(s);if(o&&o.textContent){const i=JSON.parse(o.textContent),{body:l}=i,r=re(i,["body"]);return Promise.resolve(new Response(l,r))}return fetch(a,e)}class Xe{constructor({Root:e,fallback:t,target:s,session:o}){this.Root=e,this.fallback=t,this.router,this.target=s,this.started=!1,this.session_id=1,this.invalid=new Set,this.invalidating=null,this.autoscroll=!0,this.updating=!1,this.current={url:null,session_id:0,branch:[]},this.cache=new Map,this.loading={id:null,promise:null},this.stores={url:fe({}),page:fe({}),navigating:Y(null),session:Y(o),updated:Me()},this.$session=null,this.root=null;let i=!1;this.stores.session.subscribe(async l=>{if(this.$session=l,!i||!this.router)return;this.session_id+=1;const r=this.router.parse(new URL(location.href));r&&this.update(r,[],!0)}),i=!0}disable_scroll_handling(){(this.updating||!this.started)&&(this.autoscroll=!1)}async start({status:e,error:t,nodes:s,params:o}){const i=new URL(location.href),l=[];let r={},n,c;try{for(let f=0;f<s.length;f+=1){const h=f===s.length-1;let _;if(h){const g=document.querySelector('[data-type="svelte-props"]');g&&(_=JSON.parse(g.textContent))}const d=await this._load_node({module:await s[f],url:i,params:o,stuff:r,status:h?e:void 0,error:h?t:void 0,props:_});if(_&&(d.uses.dependencies.add(i.href),d.uses.url=!0),l.push(d),d&&d.loaded)if(d.loaded.error){if(t)throw d.loaded.error;c={status:d.loaded.status,error:d.loaded.error,url:i}}else d.loaded.stuff&&(r=b(b({},r),d.loaded.stuff))}n=c?await this._load_error(c):await this._get_navigation_result_from_branch({url:i,params:o,stuff:r,branch:l,status:e,error:t})}catch(f){if(t)throw f;n=await this._load_error({status:500,error:ce(f),url:i})}if(n.redirect){location.href=new URL(n.redirect,location.href).href;return}this._init(n)}async handle_navigation(e,t,s,o){this.started&&this.stores.navigating.set({from:this.current.url,to:e.url}),await this.update(e,t,s,o)}async update(e,t,s,o){var n,c,f;const i=this.token={};let l=await this._get_navigation_result(e,s);if(!l){location.href=e.url.href;return}if(i!==this.token)return;if(this.invalid.clear(),l.redirect)if(t.length>10||t.includes(e.url.pathname))l=await this._load_error({status:500,error:new Error("Redirect loop"),url:e.url});else{this.router?this.router.goto(new URL(l.redirect,e.url).href,{},[...t,e.url.pathname]):location.href=new URL(l.redirect,location.href).href;return}else if(((c=(n=l.props)==null?void 0:n.page)==null?void 0:c.status)>=400&&await this.stores.updated.check()){location.href=e.url.href;return}if(this.updating=!0,this.started?(this.current=l.state,this.root.$set(l.props),this.stores.navigating.set(null)):this._init(l),o){const{scroll:h,keepfocus:_}=o;if(_||((f=getSelection())==null||f.removeAllRanges(),document.body.focus()),await se(),this.autoscroll){const d=e.url.hash&&document.getElementById(e.url.hash.slice(1));h?scrollTo(h.x,h.y):d?d.scrollIntoView():scrollTo(0,0)}}else await se();if(this.loading.promise=null,this.loading.id=null,this.autoscroll=!0,this.updating=!1,l.props.page&&(this.page=l.props.page),!this.router)return;const r=l.state.branch[l.state.branch.length-1];r&&r.module.router===!1?this.router.disable():this.router.enable()}load(e){return this.loading.promise=this._get_navigation_result(e,!1),this.loading.id=e.id,this.loading.promise}invalidate(e){return this.invalid.add(e),this.invalidating||(this.invalidating=Promise.resolve().then(async()=>{const t=this.router&&this.router.parse(new URL(location.href));t&&await this.update(t,[],!0),this.invalidating=null})),this.invalidating}update_page_store(e){this.stores.page.set(W(b({},this.page),{url:e})),this.stores.page.notify()}_init(e){this.current=e.state;const t=document.querySelector("style[data-svelte]");if(t&&t.remove(),this.page=e.props.page,this.root=new this.Root({target:this.target,props:b({stores:this.stores},e.props),hydrate:!0}),this.started=!0,this.router){const s={from:null,to:new URL(location.href)};this.router.callbacks.after_navigate.forEach(o=>o(s))}}async _get_navigation_result(e,t){if(this.loading.id===e.id&&this.loading.promise)return this.loading.promise;for(let s=0;s<e.routes.length;s+=1){const o=e.routes[s];let i=s+1;for(;i<e.routes.length;){const r=e.routes[i];if(r[0].toString()===o[0].toString())r[1].forEach(n=>n()),i+=1;else break}const l=await this._load({route:o,info:e},t);if(l)return l}if(e.initial)return await this._load_error({status:404,error:new Error(`Not found: ${e.url.pathname}`),url:e.url})}async _get_navigation_result_from_branch({url:e,params:t,stuff:s,branch:o,status:i,error:l}){const r=o.filter(Boolean),n=r.find(_=>_.loaded&&_.loaded.redirect),c={redirect:n&&n.loaded?n.loaded.redirect:void 0,state:{url:e,params:t,branch:o,session_id:this.session_id},props:{components:r.map(_=>_.module.default)}};for(let _=0;_<r.length;_+=1){const d=r[_].loaded;c.props[`props_${_}`]=d?await d.props:null}if(!this.current.url||e.href!==this.current.url.href){c.props.page={url:e,params:t,status:i,error:l,stuff:s};const _=(d,g)=>{Object.defineProperty(c.props.page,d,{get:()=>{throw new Error(`$page.${d} has been replaced by $page.url.${g}`)}})};_("origin","origin"),_("path","pathname"),_("query","searchParams")}const f=r[r.length-1],h=f.loaded&&f.loaded.maxage;if(h){const _=e.pathname+e.search;let d=!1;const g=()=>{this.cache.get(_)===c&&this.cache.delete(_),L(),clearTimeout(V)},V=setTimeout(g,h*1e3),L=this.stores.session.subscribe(()=>{d&&g()});d=!0,this.cache.set(_,c)}return c}async _load_node({status:e,error:t,module:s,url:o,params:i,stuff:l,props:r}){const n={module:s,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:new Set},loaded:null,stuff:l};r&&n.uses.dependencies.add(o.href);const c={};for(const h in i)Object.defineProperty(c,h,{get(){return n.uses.params.add(h),i[h]},enumerable:!0});const f=this.$session;if(s.load){const{started:h}=this,_={params:c,props:r||{},get url(){return n.uses.url=!0,o},get session(){return n.uses.session=!0,f},get stuff(){return n.uses.stuff=!0,b({},l)},fetch(g,V){const L=typeof g=="string"?g:g.url,{href:O}=new URL(L,o);return n.uses.dependencies.add(O),h?fetch(g,V):Fe(g,V)}};t&&(_.status=e,_.error=t);const d=await s.load.call(null,_);if(!d)throw new Error("load function must return a value");n.loaded=ue(d),n.loaded.stuff&&(n.stuff=n.loaded.stuff)}else r&&(n.loaded=ue({props:r}));return n}async _load({route:e,info:{url:t,path:s}},o){const i=t.pathname+t.search;if(!o){const m=this.cache.get(i);if(m)return m}const[l,r,n,c,f]=e,h=c?c(l.exec(s)):{},_=this.current.url&&{url:i!==this.current.url.pathname+this.current.url.search,params:Object.keys(h).filter(m=>this.current.params[m]!==h[m]),session:this.session_id!==this.current.session_id};let d=[],g={},V=!1,L=200,O;r.forEach(m=>m());e:for(let m=0;m<r.length;m+=1){let v;try{if(!r[m])continue;const w=await r[m](),$=this.current.branch[m];if(!$||w!==$.module||_.url&&$.uses.url||_.params.some(D=>$.uses.params.has(D))||_.session&&$.uses.session||Array.from($.uses.dependencies).some(D=>this.invalid.has(D))||V&&$.uses.stuff){let D={};const H=f&&m===r.length-1;if(H){const K=await fetch(`${t.pathname}${t.pathname.endsWith("/")?"":"/"}__data.json${t.search}`,{headers:{"x-sveltekit-load":"true"}});if(K.ok){const Q=K.headers.get("x-sveltekit-location");if(Q)return{redirect:Q,props:{},state:this.current};D=await K.json()}else L=K.status,O=new Error("Failed to load data")}if(O||(v=await this._load_node({module:w,url:t,params:h,props:D,stuff:g})),v&&(H&&(v.uses.url=!0),v.loaded)){if(v.loaded.fallthrough)return;if(v.loaded.error&&(L=v.loaded.status,O=v.loaded.error),v.loaded.redirect)return{redirect:v.loaded.redirect,props:{},state:this.current};v.loaded.stuff&&(V=!0)}}else v=$}catch(w){L=500,O=ce(w)}if(O){for(;m--;)if(n[m]){let w,$,J=m;for(;!($=d[J]);)J-=1;try{if(w=await this._load_node({status:L,error:O,module:await n[m](),url:t,params:h,stuff:$.stuff}),w&&w.loaded&&w.loaded.error)continue;w&&w.loaded&&w.loaded.stuff&&(g=b(b({},g),w.loaded.stuff)),d=d.slice(0,J+1).concat(w);break e}catch{continue}}return await this._load_error({status:L,error:O,url:t})}else v&&v.loaded&&v.loaded.stuff&&(g=b(b({},g),v.loaded.stuff)),d.push(v)}return await this._get_navigation_result_from_branch({url:t,params:h,stuff:g,branch:d,status:L,error:O})}async _load_error({status:e,error:t,url:s}){var c,f;const o={},i=await this._load_node({module:await this.fallback[0],url:s,params:o,stuff:{}}),l=await this._load_node({status:e,error:t,module:await this.fallback[1],url:s,params:o,stuff:i&&i.loaded&&i.loaded.stuff||{}}),r=[i,l],n=b(b({},(c=i==null?void 0:i.loaded)==null?void 0:c.stuff),(f=l==null?void 0:l.loaded)==null?void 0:f.stuff);return await this._get_navigation_result_from_branch({url:s,params:o,stuff:n,branch:r,status:e,error:t})}}async function et({paths:a,target:e,session:t,route:s,spa:o,trailing_slash:i,hydrate:l}){const r=new Xe({Root:qe,fallback:Ke,target:e,session:t}),n=s?new Ye({base:a.base,routes:Je,trailing_slash:i,renderer:r}):null;Ae(a),l&&await r.start(l),n&&(o&&n.goto(location.href,{replaceState:!0},[]),n.init_listeners()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{et as start};
