@sevn/elections-components 1.0.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.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +297 -0
  3. package/dist/index.cjs +603 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +351 -0
  6. package/dist/index.d.ts +351 -0
  7. package/dist/index.js +15609 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/styles.css +38 -0
  10. package/dist/umd/candidate-by-state.js +98 -0
  11. package/dist/umd/candidate-carrousel-state-results-viewer.js +108 -0
  12. package/dist/umd/candidate-counting-progress.js +77 -0
  13. package/dist/umd/candidate-duel-state-result-viewer.js +91 -0
  14. package/dist/umd/candidate-map-by-state.js +104 -0
  15. package/dist/umd/candidate-multi-ring-chart-performance-by-municipality.js +105 -0
  16. package/dist/umd/candidate-performance-by-municipality.js +105 -0
  17. package/dist/umd/candidate-ranking.js +59 -0
  18. package/dist/umd/candidate-results-by-municipality.js +103 -0
  19. package/dist/umd/counting-progress.js +125 -0
  20. package/dist/umd/current-leader.js +43 -0
  21. package/dist/umd/election-round-analysis.js +100 -0
  22. package/dist/umd/election-status.js +135 -0
  23. package/dist/umd/final-results.js +141 -0
  24. package/dist/umd/live-summary.js +36 -0
  25. package/dist/umd/municipality-perfomance-map.js +82 -0
  26. package/dist/umd/party-performance.js +99 -0
  27. package/dist/umd/results-by-office.js +94 -0
  28. package/dist/umd/round-results-analysis.js +99 -0
  29. package/dist/umd/state-leaders.js +118 -0
  30. package/dist/umd/state-winners.js +129 -0
  31. package/dist/umd/top-dispute.js +43 -0
  32. package/dist/umd/vote-comparison-by-round.js +76 -0
  33. package/dist/umd/vote-counting-progress.js +23 -0
  34. package/dist/umd/voting-map.js +112 -0
  35. package/package.json +96 -0
@@ -0,0 +1,99 @@
1
+ (function(K,V){typeof exports=="object"&&typeof module<"u"?module.exports=V():typeof define=="function"&&define.amd?define(V):(K=typeof globalThis<"u"?globalThis:K||self,K.PartyPerformance=V())})(this,(function(){"use strict";var xo=Object.defineProperty;var tl=K=>{throw TypeError(K)};var yo=(K,V,re)=>V in K?xo(K,V,{enumerable:!0,configurable:!0,writable:!0,value:re}):K[V]=re;var We=(K,V,re)=>yo(K,typeof V!="symbol"?V+"":V,re),zn=(K,V,re)=>V.has(K)||tl("Cannot "+re);var d=(K,V,re)=>(zn(K,V,"read from private field"),re?re.call(K):V.get(K)),P=(K,V,re)=>V.has(K)?tl("Cannot add the same private member more than once"):V instanceof WeakSet?V.add(K):V.set(K,re),T=(K,V,re,Nt)=>(zn(K,V,"write to private field"),Nt?Nt.call(K,re):V.set(K,re),re),se=(K,V,re)=>(zn(K,V,"access private method"),re);var Qt,$t,Lt,er,mr,wr,Mt,nt,tr,ze,An,Tn,Pn,rl,He,Cn,at,It,Ye,Je,Ae,Xe,lt,Rt,_t,rr,nr,ar,it,jr,fe,ko,Eo,Ln,qr,Kr,Mn,qe,Ze,Te,Dt,xr,yr,Ur,gt,lr,kr,Br,nl,el;class K extends Error{constructor(){super('Chave de acesso não configurada. Chame Core.applyKey("sua-chave") antes de montar o componente, ou carregue o script com ?cid=sua-chave.'),this.name="SevnKeyMissingError"}}class V extends Error{constructor(t,r){super(`Não foi possível contatar a API para ${t}.`),this.name="SevnNetworkError",this.cause=r}}const re="__sevnElectionsState_v1__",Nt=globalThis;function In(e){return Nt[re]||(Nt[re]={config:e(),transport:{activeIndex:0,pinnedAt:0}}),Nt[re]}const al="https://failover-api.sevntech.com",ll=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Rn(){return{key:null,apiHosts:[],assetsBase:"https://cdn.sevnelections.com/static",assetsVersion:"v1",cache:{storageKey:"election_cache",maxEntries:200},request:{timeoutMs:8e3,retriesPerHost:3,retryDelayMs:300,stickyWindowMs:12e4},theme:null}}const il=Rn;function Ft(){return In(Rn)}function sl(e){return[`https://${e}-api1.sevnelections.com`,`https://${e}-api2.sevnelections.com`,al]}function Vr(e){if(typeof e!="string"||!ll.test(e))throw new Error(`[sevn] Chave inválida: ${JSON.stringify(e)}. Use apenas letras, números e hífen (a chave vira subdomínio da API).`);const t=Ft();t.config.key=e,t.config.apiHosts=sl(e)}function Dn(e){const{cache:t,request:r,key:n,...a}=e,l=Ft();l.config={...l.config,...a,cache:{...l.config.cache,...t},request:{...l.config.request,...r}},n&&(Vr(n),a.apiHosts&&(l.config.apiHosts=a.apiHosts))}function sr(){return Ft().config}function On(){return Ft().config.apiHosts.length>0}function Nn(){if(!On())throw new K;return Ft().config.apiHosts}function ol(e){const{assetsBase:t,assetsVersion:r}=Ft().config,n=t.replace(/\/+$/,""),a=String(e).replace(/^\/+/,"");return`${n}/${r}/${a}`}const cl=':root{--sevn-color-primary: #0a3e27;--sevn-color-secondary: #c38214;--sevn-color-tertiary: #1c1c1c;--sevn-color-red: #da0000;--sevn-color-yellow: #e4a615;--sevn-color-green: #1e6704;--sevn-color-blue: #0e2a41;--sevn-color-neutral: #f2f2f7;--sevn-color-text-secondary: #6b7280}[class^=sevn_],[class*=" sevn_"],[class^=sevn_] *,[class^=sevn_] *:before,[class^=sevn_] *:after,[class*=" sevn_"] *,[class*=" sevn_"] *:before,[class*=" sevn_"] *:after{box-sizing:border-box}[class^=sevn_] *,[class*=" sevn_"] *{margin:0;padding:0}',zr=typeof window<"u"&&typeof document<"u",Fn="data-sevn-tokens",jn="data-sevn-theme",Un={primary:"--sevn-color-primary",secondary:"--sevn-color-secondary",tertiary:"--sevn-color-tertiary",neutral:"--sevn-color-neutral",red:"--sevn-color-red",green:"--sevn-color-green",blue:"--sevn-color-blue",yellow:"--sevn-color-yellow",textSecondary:"--sevn-color-text-secondary"};function fl(){if(!zr||document.querySelector(`style[${Fn}]`))return;const e=document.createElement("style");e.setAttribute(Fn,""),e.textContent=cl,document.head.prepend(e);const t=sr().theme;t&&Wr(t)}function Wr(e){if(!zr)return;const t=Object.keys(Un).filter(n=>e[n]).map(n=>` ${Un[n]}: ${e[n]};`);if(t.length===0)return;let r=document.querySelector(`style[${jn}]`);r||(r=document.createElement("style"),r.setAttribute(jn,""),document.head.appendChild(r)),r.textContent=`:root {
2
+ ${t.join(`
3
+ `)}
4
+ }`}function Bn(){return In(il).transport}function Hn(e){return new Promise(t=>setTimeout(t,e))}function ul(e,t){const r=AbortSignal.timeout(e);return t&&typeof AbortSignal.any=="function"?AbortSignal.any([t,r]):r}function dl(e,t){const r=new URL(e),n=new URL(t);return r.protocol=n.protocol,r.host=n.host,r.toString()}function vl(e,t){return Array.from({length:t},(r,n)=>(e+n)%t)}const hl=async(e,t)=>{const r=typeof e=="string"?e:e instanceof URL?e.toString():e.url,n=Nn(),{timeoutMs:a,retriesPerHost:l,retryDelayMs:i,stickyWindowMs:s}=sr().request,c=Bn();c.activeIndex!==0&&Date.now()-c.pinnedAt>=s&&(c.activeIndex=0);let o=null;for(const v of vl(c.activeIndex,n.length)){const p=dl(r,n[v]);for(let u=0;u<l;u++)try{const _=await fetch(p,{...t,signal:ul(a,t?.signal)});if(_.status>=500){o=new Error(`HTTP ${_.status} em ${n[v]}`),u<l-1&&await Hn(i);continue}return c.activeIndex=v,c.pinnedAt=Date.now(),_}catch(_){o=_,u<l-1&&await Hn(i)}}throw new V(r,o)};function pl(){return sr().apiHosts[Bn().activeIndex]??null}const _l={applyKey:Vr,configure(e){Dn(e),e.theme&&Wr(e.theme)},getConfig:sr,isReady:On,assetUrl:ol,setTheme(e){Dn({theme:e}),Wr(e)},activeHost:pl},Gr=!1;var qn=Array.isArray,gl=Array.prototype.indexOf,jt=Array.prototype.includes,Ar=Array.from,bl=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,ml=Object.getOwnPropertyDescriptors,wl=Object.prototype,xl=Array.prototype,Kn=Object.getPrototypeOf,Vn=Object.isExtensible;const yl=()=>{};function kl(e){for(var t=0;t<e.length;t++)e[t]()}function Wn(){var e,t,r=new Promise((n,a)=>{e=n,t=a});return{promise:r,resolve:e,reject:t}}const ve=2,or=4,Tr=8,Gn=1<<24,$e=16,De=32,mt=64,Yr=128,Le=512,oe=1024,he=2048,Oe=4096,Ee=8192,et=16384,wt=32768,Bt=65536,Yn=1<<17,Jn=1<<18,Ht=1<<19,El=1<<20,ot=1<<25,xt=65536,Jr=1<<21,Xr=1<<22,ct=1<<23,cr=Symbol("$state"),Sl=Symbol("legacy props"),Cl=Symbol(""),yt=new class extends Error{constructor(){super(...arguments);We(this,"name","StaleReactionError");We(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function zl(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Al(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Tl(e,t,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Pl(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ll(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ml(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Il(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Rl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Dl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ol(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Nl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Fl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const jl=1,Ul=2,Bl=16,Hl=1,ql=4,Kl=8,Vl=16,Wl=2,pe=Symbol(),Xn="http://www.w3.org/1999/xhtml";function Gl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Zn(e){return e===this.v}function Yl(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Qn(e){return!Yl(e,this.v)}let Jl=!1,Se=null;function qt(e){Se=e}function Kt(e,t=!1,r){Se={p:Se,i:!1,c:null,e:null,s:e,x:null,l:null}}function Vt(e){var t=Se,r=t.e;if(r!==null){t.e=null;for(var n of r)ya(n)}return t.i=!0,Se=t.p,{}}function $n(){return!0}let kt=[];function ea(){var e=kt;kt=[],kl(e)}function Et(e){if(kt.length===0&&!fr){var t=kt;queueMicrotask(()=>{t===kt&&ea()})}kt.push(e)}function Xl(){for(;kt.length>0;)ea()}function ta(e){var t=F;if(t===null)return I.f|=ct,e;if((t.f&wt)===0&&(t.f&or)===0)throw e;Wt(e,t)}function Wt(e,t){for(;t!==null;){if((t.f&Yr)!==0){if((t.f&wt)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw e}const Zl=-7169;function ne(e,t){e.f=e.f&Zl|t}function Zr(e){(e.f&Le)!==0||e.deps===null?ne(e,oe):ne(e,Oe)}function ra(e){if(e!==null)for(const t of e)(t.f&ve)===0||(t.f&xt)===0||(t.f^=xt,ra(t.deps))}function na(e,t,r){(e.f&he)!==0?t.add(e):(e.f&Oe)!==0&&r.add(e),ra(e.deps),ne(e,oe)}const Pr=new Set;let B=null,Qr=null,Ne=null,we=[],Lr=null,$r=!1,fr=!1;const Sn=class Sn{constructor(){P(this,ze);We(this,"committed",!1);We(this,"current",new Map);We(this,"previous",new Map);P(this,Qt,new Set);P(this,$t,new Set);P(this,Lt,0);P(this,er,0);P(this,mr,null);P(this,wr,new Set);P(this,Mt,new Set);P(this,nt,new Map);We(this,"is_fork",!1);P(this,tr,!1)}skip_effect(t){d(this,nt).has(t)||d(this,nt).set(t,{d:[],m:[]})}unskip_effect(t){var r=d(this,nt).get(t);if(r){d(this,nt).delete(t);for(var n of r.d)ne(n,he),Fe(n);for(n of r.m)ne(n,Oe),Fe(n)}}process(t){we=[],this.apply();var r=[],n=[];for(const a of t)se(this,ze,Tn).call(this,a,r,n);if(se(this,ze,An).call(this)){se(this,ze,Pn).call(this,n),se(this,ze,Pn).call(this,r);for(const[a,l]of d(this,nt))oa(a,l)}else{for(const a of d(this,Qt))a();d(this,Qt).clear(),d(this,Lt)===0&&se(this,ze,rl).call(this),Qr=this,B=null,la(n),la(r),Qr=null,d(this,mr)?.resolve()}Ne=null}capture(t,r){r!==pe&&!this.previous.has(t)&&this.previous.set(t,r),(t.f&ct)===0&&(this.current.set(t,t.v),Ne?.set(t,t.v))}activate(){B=this,this.apply()}deactivate(){B===this&&(B=null,Ne=null)}flush(){if(this.activate(),we.length>0){if(aa(),B!==null&&B!==this)return}else d(this,Lt)===0&&this.process([]);this.deactivate()}discard(){for(const t of d(this,$t))t(this);d(this,$t).clear()}increment(t){T(this,Lt,d(this,Lt)+1),t&&T(this,er,d(this,er)+1)}decrement(t){T(this,Lt,d(this,Lt)-1),t&&T(this,er,d(this,er)-1),!d(this,tr)&&(T(this,tr,!0),Et(()=>{T(this,tr,!1),se(this,ze,An).call(this)?we.length>0&&this.flush():this.revive()}))}revive(){for(const t of d(this,wr))d(this,Mt).delete(t),ne(t,he),Fe(t);for(const t of d(this,Mt))ne(t,Oe),Fe(t);this.flush()}oncommit(t){d(this,Qt).add(t)}ondiscard(t){d(this,$t).add(t)}settled(){return(d(this,mr)??T(this,mr,Wn())).promise}static ensure(){if(B===null){const t=B=new Sn;Pr.add(B),fr||Et(()=>{B===t&&t.flush()})}return B}apply(){}};Qt=new WeakMap,$t=new WeakMap,Lt=new WeakMap,er=new WeakMap,mr=new WeakMap,wr=new WeakMap,Mt=new WeakMap,nt=new WeakMap,tr=new WeakMap,ze=new WeakSet,An=function(){return this.is_fork||d(this,er)>0},Tn=function(t,r,n){t.f^=oe;for(var a=t.first;a!==null;){var l=a.f,i=(l&(De|mt))!==0,s=i&&(l&oe)!==0,c=s||(l&Ee)!==0||d(this,nt).has(a);if(!c&&a.fn!==null){i?a.f^=oe:(l&or)!==0?r.push(a):vr(a)&&((l&$e)!==0&&d(this,Mt).add(a),Jt(a));var o=a.first;if(o!==null){a=o;continue}}for(;a!==null;){var v=a.next;if(v!==null){a=v;break}a=a.parent}}},Pn=function(t){for(var r=0;r<t.length;r+=1)na(t[r],d(this,wr),d(this,Mt))},rl=function(){var a;if(Pr.size>1){this.previous.clear();var t=Ne,r=!0;for(const l of Pr){if(l===this){r=!1;continue}const i=[];for(const[c,o]of this.current){if(l.current.has(c))if(r&&o!==l.current.get(c))l.current.set(c,o);else continue;i.push(c)}if(i.length===0)continue;const s=[...l.current.keys()].filter(c=>!this.current.has(c));if(s.length>0){var n=we;we=[];const c=new Set,o=new Map;for(const v of i)ia(v,s,c,o);if(we.length>0){B=l,l.apply();for(const v of we)se(a=l,ze,Tn).call(a,v,[],[]);l.deactivate()}we=n}}B=null,Ne=t}this.committed=!0,Pr.delete(this)};let ft=Sn;function Ql(e){var t=fr;fr=!0;try{for(var r;;){if(Xl(),we.length===0&&(B?.flush(),we.length===0))return Lr=null,r;aa()}}finally{fr=t}}function aa(){$r=!0;var e=null;try{for(var t=0;we.length>0;){var r=ft.ensure();if(t++>1e3){var n,a;$l()}r.process(we),ut.clear()}}finally{we=[],$r=!1,Lr=null}}function $l(){try{Il()}catch(e){Wt(e,Lr)}}let tt=null;function la(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(et|Ee))===0&&vr(n)&&(tt=new Set,Jt(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&Ea(n),tt?.size>0)){ut.clear();for(const a of tt){if((a.f&(et|Ee))!==0)continue;const l=[a];let i=a.parent;for(;i!==null;)tt.has(i)&&(tt.delete(i),l.push(i)),i=i.parent;for(let s=l.length-1;s>=0;s--){const c=l[s];(c.f&(et|Ee))===0&&Jt(c)}}tt.clear()}}tt=null}}function ia(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const a of e.reactions){const l=a.f;(l&ve)!==0?ia(a,t,r,n):(l&(Xr|$e))!==0&&(l&he)===0&&sa(a,t,n)&&(ne(a,he),Fe(a))}}function sa(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const a of e.deps){if(jt.call(t,a))return!0;if((a.f&ve)!==0&&sa(a,t,r))return r.set(a,!0),!0}return r.set(e,!1),!1}function Fe(e){var t=Lr=e,r=t.b;if(r?.is_pending&&(e.f&(or|Tr|Gn))!==0&&(e.f&wt)===0){r.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var n=t.f;if($r&&t===F&&(n&$e)!==0&&(n&Jn)===0&&(n&wt)!==0)return;if((n&(mt|De))!==0){if((n&oe)===0)return;t.f^=oe}}we.push(t)}function oa(e,t){if(!((e.f&De)!==0&&(e.f&oe)!==0)){(e.f&he)!==0?t.d.push(e):(e.f&Oe)!==0&&t.m.push(e),ne(e,oe);for(var r=e.first;r!==null;)oa(r,t),r=r.next}}function ei(e){let t=0,r=St(0),n;return()=>{ln()&&(f(r),on(()=>(t===0&&(n=Xt(()=>e(()=>ur(r)))),t+=1,()=>{Et(()=>{t-=1,t===0&&(n?.(),n=void 0,ur(r))})})))}}var ti=Bt|Ht;function ri(e,t,r){new ni(e,t,r)}class ni{constructor(t,r,n){P(this,fe);We(this,"parent");We(this,"is_pending",!1);P(this,He);P(this,Cn,null);P(this,at);P(this,It);P(this,Ye);P(this,Je,null);P(this,Ae,null);P(this,Xe,null);P(this,lt,null);P(this,Rt,0);P(this,_t,0);P(this,rr,!1);P(this,nr,new Set);P(this,ar,new Set);P(this,it,null);P(this,jr,ei(()=>(T(this,it,St(d(this,Rt))),()=>{T(this,it,null)})));T(this,He,t),T(this,at,r),T(this,It,a=>{var l=F;l.b=this,l.f|=Yr,n(a)}),this.parent=F.b,T(this,Ye,cn(()=>{se(this,fe,Ln).call(this)},ti))}defer_effect(t){na(t,d(this,nr),d(this,ar))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!d(this,at).pending}update_pending_count(t){se(this,fe,Mn).call(this,t),T(this,Rt,d(this,Rt)+t),!(!d(this,it)||d(this,rr))&&(T(this,rr,!0),Et(()=>{T(this,rr,!1),d(this,it)&&Gt(d(this,it),d(this,Rt))}))}get_effect_pending(){return d(this,jr).call(this),f(d(this,it))}error(t){var r=d(this,at).onerror;let n=d(this,at).failed;if(!r&&!n)throw t;d(this,Je)&&(xe(d(this,Je)),T(this,Je,null)),d(this,Ae)&&(xe(d(this,Ae)),T(this,Ae,null)),d(this,Xe)&&(xe(d(this,Xe)),T(this,Xe,null));var a=!1,l=!1;const i=()=>{if(a){Gl();return}a=!0,l&&Fl(),d(this,Xe)!==null&&zt(d(this,Xe),()=>{T(this,Xe,null)}),se(this,fe,Kr).call(this,()=>{ft.ensure(),se(this,fe,Ln).call(this)})};Et(()=>{try{l=!0,r?.(t,i),l=!1}catch(s){Wt(s,d(this,Ye)&&d(this,Ye).parent)}n&&T(this,Xe,se(this,fe,Kr).call(this,()=>{ft.ensure();try{return je(()=>{var s=F;s.b=this,s.f|=Yr,n(d(this,He),()=>t,()=>i)})}catch(s){return Wt(s,d(this,Ye).parent),null}}))})}}He=new WeakMap,Cn=new WeakMap,at=new WeakMap,It=new WeakMap,Ye=new WeakMap,Je=new WeakMap,Ae=new WeakMap,Xe=new WeakMap,lt=new WeakMap,Rt=new WeakMap,_t=new WeakMap,rr=new WeakMap,nr=new WeakMap,ar=new WeakMap,it=new WeakMap,jr=new WeakMap,fe=new WeakSet,ko=function(){try{T(this,Je,je(()=>d(this,It).call(this,d(this,He))))}catch(t){this.error(t)}},Eo=function(){const t=d(this,at).pending;t&&(this.is_pending=!0,T(this,Ae,je(()=>t(d(this,He)))),Et(()=>{var r=T(this,lt,document.createDocumentFragment()),n=dt();r.append(n),T(this,Je,se(this,fe,Kr).call(this,()=>(ft.ensure(),je(()=>d(this,It).call(this,n))))),d(this,_t)===0&&(d(this,He).before(r),T(this,lt,null),zt(d(this,Ae),()=>{T(this,Ae,null)}),se(this,fe,qr).call(this))}))},Ln=function(){try{if(this.is_pending=this.has_pending_snippet(),T(this,_t,0),T(this,Rt,0),T(this,Je,je(()=>{d(this,It).call(this,d(this,He))})),d(this,_t)>0){var t=T(this,lt,document.createDocumentFragment());za(d(this,Je),t);const r=d(this,at).pending;T(this,Ae,je(()=>r(d(this,He))))}else se(this,fe,qr).call(this)}catch(r){this.error(r)}},qr=function(){this.is_pending=!1;for(const t of d(this,nr))ne(t,he),Fe(t);for(const t of d(this,ar))ne(t,Oe),Fe(t);d(this,nr).clear(),d(this,ar).clear()},Kr=function(t){var r=F,n=I,a=Se;Ge(d(this,Ye)),Me(d(this,Ye)),qt(d(this,Ye).ctx);try{return t()}catch(l){return ta(l),null}finally{Ge(r),Me(n),qt(a)}},Mn=function(t){var r;if(!this.has_pending_snippet()){this.parent&&se(r=this.parent,fe,Mn).call(r,t);return}T(this,_t,d(this,_t)+t),d(this,_t)===0&&(se(this,fe,qr).call(this),d(this,Ae)&&zt(d(this,Ae),()=>{T(this,Ae,null)}),d(this,lt)&&(d(this,He).before(d(this,lt)),T(this,lt,null)))};function ai(e,t,r,n){const a=Mr;var l=e.filter(u=>!u.settled);if(r.length===0&&l.length===0){n(t.map(a));return}var i=B,s=F,c=li(),o=l.length===1?l[0].promise:l.length>1?Promise.all(l.map(u=>u.promise)):null;function v(u){c();try{n(u)}catch(_){(s.f&et)===0&&Wt(_,s)}i?.deactivate(),en()}if(r.length===0){o.then(()=>v(t.map(a)));return}function p(){c(),Promise.all(r.map(u=>si(u))).then(u=>v([...t.map(a),...u])).catch(u=>Wt(u,s))}o?o.then(p):p()}function li(){var e=F,t=I,r=Se,n=B;return function(l=!0){Ge(e),Me(t),qt(r),l&&n?.activate()}}function en(){Ge(null),Me(null),qt(null)}function ii(){var e=F.b,t=B,r=e.is_rendered();return e.update_pending_count(1),t.increment(r),()=>{e.update_pending_count(-1),t.decrement(r)}}function Mr(e){var t=ve|he,r=I!==null&&(I.f&ve)!==0?I:null;return F!==null&&(F.f|=Ht),{ctx:Se,deps:null,effects:null,equals:Zn,f:t,fn:e,reactions:null,rv:0,v:pe,wv:0,parent:r??F,ac:null}}function si(e,t,r){F===null&&Al();var a=void 0,l=St(pe),i=!I,s=new Map;return xi(()=>{var c=Wn();a=c.promise;try{Promise.resolve(e()).then(c.resolve,c.reject).then(()=>{o===B&&o.committed&&o.deactivate(),en()})}catch(u){c.reject(u),en()}var o=B;if(i){var v=ii();s.get(o)?.reject(yt),s.delete(o),s.set(o,c)}const p=(u,_=void 0)=>{if(o.activate(),_)_!==yt&&(l.f|=ct,Gt(l,_));else{(l.f&ct)!==0&&(l.f^=ct),Gt(l,u);for(const[h,k]of s){if(s.delete(h),h===o)break;k.reject(yt)}}v&&v()};c.promise.then(p,u=>p(null,u||"unknown"))}),mi(()=>{for(const c of s.values())c.reject(yt)}),new Promise(c=>{function o(v){function p(){v===a?c(l):o(a)}v.then(p,p)}o(a)})}function ce(e){const t=Mr(e);return Ta(t),t}function ca(e){const t=Mr(e);return t.equals=Qn,t}function oi(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)xe(t[r])}}function ci(e){for(var t=e.parent;t!==null;){if((t.f&ve)===0)return(t.f&et)===0?t:null;t=t.parent}return null}function tn(e){var t,r=F;Ge(ci(e));try{e.f&=~xt,oi(e),t=Ra(e)}finally{Ge(r)}return t}function fa(e){var t=tn(e);if(!e.equals(t)&&(e.wv=Ma(),(!B?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){ne(e,oe);return}vt||(Ne!==null?(ln()||B?.is_fork)&&Ne.set(e,t):Zr(e))}function fi(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(yt),t.teardown=yl,t.ac=null,hr(t,0),fn(t))}function ua(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&Jt(t)}let rn=new Set;const ut=new Map;let da=!1;function St(e,t){var r={f:0,v:e,reactions:null,equals:Zn,rv:0,wv:0};return r}function G(e,t){const r=St(e);return Ta(r),r}function ui(e,t=!1,r=!0){const n=St(e);return t||(n.equals=Qn),n}function E(e,t,r=!1){I!==null&&(!Ue||(I.f&Yn)!==0)&&$n()&&(I.f&(ve|$e|Xr|Yn))!==0&&(Ie===null||!jt.call(Ie,e))&&Nl();let n=r?Ct(t):t;return Gt(e,n)}function Gt(e,t){if(!e.equals(t)){var r=e.v;vt?ut.set(e,t):ut.set(e,r),e.v=t;var n=ft.ensure();if(n.capture(e,r),(e.f&ve)!==0){const a=e;(e.f&he)!==0&&tn(a),Zr(a)}e.wv=Ma(),va(e,he),F!==null&&(F.f&oe)!==0&&(F.f&(De|mt))===0&&(Re===null?Ei([e]):Re.push(e)),!n.is_fork&&rn.size>0&&!da&&di()}return t}function di(){da=!1;for(const e of rn)(e.f&oe)!==0&&ne(e,Oe),vr(e)&&Jt(e);rn.clear()}function ur(e){E(e,e.v+1)}function va(e,t){var r=e.reactions;if(r!==null)for(var n=r.length,a=0;a<n;a++){var l=r[a],i=l.f,s=(i&he)===0;if(s&&ne(l,t),(i&ve)!==0){var c=l;Ne?.delete(c),(i&xt)===0&&(i&Le&&(l.f|=xt),va(c,Oe))}else s&&((i&$e)!==0&&tt!==null&&tt.add(l),Fe(l))}}function Ct(e){if(typeof e!="object"||e===null||cr in e)return e;const t=Kn(e);if(t!==wl&&t!==xl)return e;var r=new Map,n=qn(e),a=G(0),l=Tt,i=s=>{if(Tt===l)return s();var c=I,o=Tt;Me(null),La(l);var v=s();return Me(c),La(o),v};return n&&r.set("length",G(e.length)),new Proxy(e,{defineProperty(s,c,o){(!("value"in o)||o.configurable===!1||o.enumerable===!1||o.writable===!1)&&Dl();var v=r.get(c);return v===void 0?i(()=>{var p=G(o.value);return r.set(c,p),p}):E(v,o.value,!0),!0},deleteProperty(s,c){var o=r.get(c);if(o===void 0){if(c in s){const v=i(()=>G(pe));r.set(c,v),ur(a)}}else E(o,pe),ur(a);return!0},get(s,c,o){if(c===cr)return e;var v=r.get(c),p=c in s;if(v===void 0&&(!p||Ut(s,c)?.writable)&&(v=i(()=>{var _=Ct(p?s[c]:pe),h=G(_);return h}),r.set(c,v)),v!==void 0){var u=f(v);return u===pe?void 0:u}return Reflect.get(s,c,o)},getOwnPropertyDescriptor(s,c){var o=Reflect.getOwnPropertyDescriptor(s,c);if(o&&"value"in o){var v=r.get(c);v&&(o.value=f(v))}else if(o===void 0){var p=r.get(c),u=p?.v;if(p!==void 0&&u!==pe)return{enumerable:!0,configurable:!0,value:u,writable:!0}}return o},has(s,c){if(c===cr)return!0;var o=r.get(c),v=o!==void 0&&o.v!==pe||Reflect.has(s,c);if(o!==void 0||F!==null&&(!v||Ut(s,c)?.writable)){o===void 0&&(o=i(()=>{var u=v?Ct(s[c]):pe,_=G(u);return _}),r.set(c,o));var p=f(o);if(p===pe)return!1}return v},set(s,c,o,v){var p=r.get(c),u=c in s;if(n&&c==="length")for(var _=o;_<p.v;_+=1){var h=r.get(_+"");h!==void 0?E(h,pe):_ in s&&(h=i(()=>G(pe)),r.set(_+"",h))}if(p===void 0)(!u||Ut(s,c)?.writable)&&(p=i(()=>G(void 0)),E(p,Ct(o)),r.set(c,p));else{u=p.v!==pe;var k=i(()=>Ct(o));E(p,k)}var x=Reflect.getOwnPropertyDescriptor(s,c);if(x?.set&&x.set.call(v,o),!u){if(n&&typeof c=="string"){var j=r.get("length"),g=Number(c);Number.isInteger(g)&&g>=j.v&&E(j,g+1)}ur(a)}return!0},ownKeys(s){f(a);var c=Reflect.ownKeys(s).filter(p=>{var u=r.get(p);return u===void 0||u.v!==pe});for(var[o,v]of r)v.v!==pe&&!(o in s)&&c.push(o);return c},setPrototypeOf(){Ol()}})}var ha,pa,_a,ga;function vi(){if(ha===void 0){ha=window,pa=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;_a=Ut(t,"firstChild").get,ga=Ut(t,"nextSibling").get,Vn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Vn(r)&&(r.__t=void 0)}}function dt(e=""){return document.createTextNode(e)}function nn(e){return _a.call(e)}function dr(e){return ga.call(e)}function m(e,t){return nn(e)}function ba(e,t=!1){{var r=nn(e);return r instanceof Comment&&r.data===""?dr(r):r}}function D(e,t=1,r=!1){let n=e;for(;t--;)n=dr(n);return n}function hi(e){e.textContent=""}function ma(){return!1}function wa(e,t,r){return document.createElementNS(Xn,e,void 0)}let xa=!1;function pi(){xa||(xa=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function an(e){var t=I,r=F;Me(null),Ge(null);try{return e()}finally{Me(t),Ge(r)}}function _i(e,t,r,n=r){e.addEventListener(t,()=>an(r));const a=e.__on_r;a?e.__on_r=()=>{a(),n(!0)}:e.__on_r=()=>n(!0),pi()}function gi(e){F===null&&(I===null&&Ml(),Ll()),vt&&Pl()}function bi(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function rt(e,t,r){var n=F;n!==null&&(n.f&Ee)!==0&&(e|=Ee);var a={ctx:Se,deps:null,nodes:null,f:e|he|Le,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{Jt(a)}catch(s){throw xe(a),s}else t!==null&&Fe(a);var l=a;if(r&&l.deps===null&&l.teardown===null&&l.nodes===null&&l.first===l.last&&(l.f&Ht)===0&&(l=l.first,(e&$e)!==0&&(e&Bt)!==0&&l!==null&&(l.f|=Bt)),l!==null&&(l.parent=n,n!==null&&bi(l,n),I!==null&&(I.f&ve)!==0&&(e&mt)===0)){var i=I;(i.effects??(i.effects=[])).push(l)}return a}function ln(){return I!==null&&!Ue}function mi(e){const t=rt(Tr,null,!1);return ne(t,oe),t.teardown=e,t}function Yt(e){gi();var t=F.f,r=!I&&(t&De)!==0&&(t&wt)===0;if(r){var n=Se;(n.e??(n.e=[])).push(e)}else return ya(e)}function ya(e){return rt(or|El,e,!1)}function wi(e){ft.ensure();const t=rt(mt|Ht,e,!0);return(r={})=>new Promise(n=>{r.outro?zt(t,()=>{xe(t),n(void 0)}):(xe(t),n(void 0))})}function sn(e){return rt(or,e,!1)}function xi(e){return rt(Xr|Ht,e,!0)}function on(e,t=0){return rt(Tr|t,e,!0)}function S(e,t=[],r=[],n=[]){ai(n,t,r,a=>{rt(Tr,()=>e(...a.map(f)),!0)})}function cn(e,t=0){var r=rt($e|t,e,!0);return r}function je(e){return rt(De|Ht,e,!0)}function ka(e){var t=e.teardown;if(t!==null){const r=vt,n=I;Aa(!0),Me(null);try{t.call(null)}finally{Aa(r),Me(n)}}}function fn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const a=r.ac;a!==null&&an(()=>{a.abort(yt)});var n=r.next;(r.f&mt)!==0?r.parent=null:xe(r,t),r=n}}function yi(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&De)===0&&xe(t),t=r}}function xe(e,t=!0){var r=!1;(t||(e.f&Jn)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(ki(e.nodes.start,e.nodes.end),r=!0),fn(e,t&&!r),hr(e,0),ne(e,et);var n=e.nodes&&e.nodes.t;if(n!==null)for(const l of n)l.stop();ka(e);var a=e.parent;a!==null&&a.first!==null&&Ea(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function ki(e,t){for(;e!==null;){var r=e===t?null:dr(e);e.remove(),e=r}}function Ea(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function zt(e,t,r=!0){var n=[];Sa(e,n,!0);var a=()=>{r&&xe(e),t&&t()},l=n.length;if(l>0){var i=()=>--l||a();for(var s of n)s.out(i)}else a()}function Sa(e,t,r){if((e.f&Ee)===0){e.f^=Ee;var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)(s.is_global||r)&&t.push(s);for(var a=e.first;a!==null;){var l=a.next,i=(a.f&Bt)!==0||(a.f&De)!==0&&(e.f&$e)!==0;Sa(a,t,i?r:!1),a=l}}}function un(e){Ca(e,!0)}function Ca(e,t){if((e.f&Ee)!==0){e.f^=Ee,(e.f&oe)===0&&(ne(e,he),Fe(e));for(var r=e.first;r!==null;){var n=r.next,a=(r.f&Bt)!==0||(r.f&De)!==0;Ca(r,a?t:!1),r=n}var l=e.nodes&&e.nodes.t;if(l!==null)for(const i of l)(i.is_global||t)&&i.in()}}function za(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var a=r===n?null:dr(r);t.append(r),r=a}}let Ir=!1,vt=!1;function Aa(e){vt=e}let I=null,Ue=!1;function Me(e){I=e}let F=null;function Ge(e){F=e}let Ie=null;function Ta(e){I!==null&&(Ie===null?Ie=[e]:Ie.push(e))}let ye=null,Ce=0,Re=null;function Ei(e){Re=e}let Pa=1,At=0,Tt=At;function La(e){Tt=e}function Ma(){return++Pa}function vr(e){var t=e.f;if((t&he)!==0)return!0;if(t&ve&&(e.f&=~xt),(t&Oe)!==0){for(var r=e.deps,n=r.length,a=0;a<n;a++){var l=r[a];if(vr(l)&&fa(l),l.wv>e.wv)return!0}(t&Le)!==0&&Ne===null&&ne(e,oe)}return!1}function Ia(e,t,r=!0){var n=e.reactions;if(n!==null&&!(Ie!==null&&jt.call(Ie,e)))for(var a=0;a<n.length;a++){var l=n[a];(l.f&ve)!==0?Ia(l,t,!1):t===l&&(r?ne(l,he):(l.f&oe)!==0&&ne(l,Oe),Fe(l))}}function Ra(e){var k;var t=ye,r=Ce,n=Re,a=I,l=Ie,i=Se,s=Ue,c=Tt,o=e.f;ye=null,Ce=0,Re=null,I=(o&(De|mt))===0?e:null,Ie=null,qt(e.ctx),Ue=!1,Tt=++At,e.ac!==null&&(an(()=>{e.ac.abort(yt)}),e.ac=null);try{e.f|=Jr;var v=e.fn,p=v();e.f|=wt;var u=e.deps,_=B?.is_fork;if(ye!==null){var h;if(_||hr(e,Ce),u!==null&&Ce>0)for(u.length=Ce+ye.length,h=0;h<ye.length;h++)u[Ce+h]=ye[h];else e.deps=u=ye;if(ln()&&(e.f&Le)!==0)for(h=Ce;h<u.length;h++)((k=u[h]).reactions??(k.reactions=[])).push(e)}else!_&&u!==null&&Ce<u.length&&(hr(e,Ce),u.length=Ce);if($n()&&Re!==null&&!Ue&&u!==null&&(e.f&(ve|Oe|he))===0)for(h=0;h<Re.length;h++)Ia(Re[h],e);if(a!==null&&a!==e){if(At++,a.deps!==null)for(let x=0;x<r;x+=1)a.deps[x].rv=At;if(t!==null)for(const x of t)x.rv=At;Re!==null&&(n===null?n=Re:n.push(...Re))}return(e.f&ct)!==0&&(e.f^=ct),p}catch(x){return ta(x)}finally{e.f^=Jr,ye=t,Ce=r,Re=n,I=a,Ie=l,qt(i),Ue=s,Tt=c}}function Si(e,t){let r=t.reactions;if(r!==null){var n=gl.call(r,e);if(n!==-1){var a=r.length-1;a===0?r=t.reactions=null:(r[n]=r[a],r.pop())}}if(r===null&&(t.f&ve)!==0&&(ye===null||!jt.call(ye,t))){var l=t;(l.f&Le)!==0&&(l.f^=Le,l.f&=~xt),Zr(l),fi(l),hr(l,0)}}function hr(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)Si(e,r[n])}function Jt(e){var t=e.f;if((t&et)===0){ne(e,oe);var r=F,n=Ir;F=e,Ir=!0;try{(t&($e|Gn))!==0?yi(e):fn(e),ka(e);var a=Ra(e);e.teardown=typeof a=="function"?a:null,e.wv=Pa;var l;Gr&&Jl&&(e.f&he)!==0&&e.deps}finally{Ir=n,F=r}}}async function Ci(){await Promise.resolve(),Ql()}function f(e){var t=e.f,r=(t&ve)!==0;if(I!==null&&!Ue){var n=F!==null&&(F.f&et)!==0;if(!n&&(Ie===null||!jt.call(Ie,e))){var a=I.deps;if((I.f&Jr)!==0)e.rv<At&&(e.rv=At,ye===null&&a!==null&&a[Ce]===e?Ce++:ye===null?ye=[e]:ye.push(e));else{(I.deps??(I.deps=[])).push(e);var l=e.reactions;l===null?e.reactions=[I]:jt.call(l,I)||l.push(I)}}}if(vt&&ut.has(e))return ut.get(e);if(r){var i=e;if(vt){var s=i.v;return((i.f&oe)===0&&i.reactions!==null||Oa(i))&&(s=tn(i)),ut.set(i,s),s}var c=(i.f&Le)===0&&!Ue&&I!==null&&(Ir||(I.f&Le)!==0),o=(i.f&wt)===0;vr(i)&&(c&&(i.f|=Le),fa(i)),c&&!o&&(ua(i),Da(i))}if(Ne?.has(e))return Ne.get(e);if((e.f&ct)!==0)throw e.v;return e.v}function Da(e){if(e.f|=Le,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&ve)!==0&&(t.f&Le)===0&&(ua(t),Da(t))}function Oa(e){if(e.v===pe)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(ut.has(t)||(t.f&ve)!==0&&Oa(t))return!0;return!1}function Xt(e){var t=Ue;try{return Ue=!0,e()}finally{Ue=t}}const zi=["touchstart","touchmove"];function Ai(e){return zi.includes(e)}const Pt=Symbol("events"),Na=new Set,dn=new Set;function ge(e,t,r){(t[Pt]??(t[Pt]={}))[e]=r}function Rr(e){for(var t=0;t<e.length;t++)Na.add(e[t]);for(var r of dn)r(e)}let Fa=null;function ja(e){var t=this,r=t.ownerDocument,n=e.type,a=e.composedPath?.()||[],l=a[0]||e.target;Fa=e;var i=0,s=Fa===e&&e[Pt];if(s){var c=a.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Pt]=t;return}var o=a.indexOf(t);if(o===-1)return;c<=o&&(i=c)}if(l=a[i]||e.target,l!==t){bl(e,"currentTarget",{configurable:!0,get(){return l||r}});var v=I,p=F;Me(null),Ge(null);try{for(var u,_=[];l!==null;){var h=l.assignedSlot||l.parentNode||l.host||null;try{var k=l[Pt]?.[n];k!=null&&(!l.disabled||e.target===l)&&k.call(l,e)}catch(x){u?_.push(x):u=x}if(e.cancelBubble||h===t||h===null)break;l=h}if(u){for(let x of _)queueMicrotask(()=>{throw x});throw u}}finally{e[Pt]=t,delete e.currentTarget,Me(v),Ge(p)}}}const Ti=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Pi(e){return Ti?.createHTML(e)??e}function Li(e,t=!1){var r=wa("template");return e=e.replaceAll("<!>","<!---->"),r.innerHTML=t?Pi(e):e,r.content}function Ua(e,t){var r=F;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function y(e,t){var r=(t&Wl)!==0,n,a=!e.startsWith("<!>");return()=>{n===void 0&&(n=Li(a?e:"<!>"+e,!0),n=nn(n));var l=r||pa?document.importNode(n,!0):n.cloneNode(!0);return Ua(l,l),l}}function Ba(){var e=document.createDocumentFragment(),t=document.createComment(""),r=dt();return e.append(t,r),Ua(t,r),e}function w(e,t){e!==null&&e.before(t)}function $(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=r,e.nodeValue=r+"")}function Mi(e,t){return Ii(e,t)}const Dr=new Map;function Ii(e,{target:t,anchor:r,props:n={},events:a,context:l,intro:i=!0}){vi();var s=void 0,c=wi(()=>{var o=r??t.appendChild(dt());ri(o,{pending:()=>{}},u=>{Kt({});var _=Se;l&&(_.c=l),a&&(n.$$events=a),s=e(u,n)||{},Vt()});var v=new Set,p=u=>{for(var _=0;_<u.length;_++){var h=u[_];if(!v.has(h)){v.add(h);var k=Ai(h);for(const g of[t,document]){var x=Dr.get(g);x===void 0&&(x=new Map,Dr.set(g,x));var j=x.get(h);j===void 0?(g.addEventListener(h,ja,{passive:k}),x.set(h,1)):x.set(h,j+1)}}}};return p(Ar(Na)),dn.add(p),()=>{for(var u of v)for(const k of[t,document]){var _=Dr.get(k),h=_.get(u);--h==0?(k.removeEventListener(u,ja),_.delete(u),_.size===0&&Dr.delete(k)):_.set(u,h)}dn.delete(p),o!==r&&o.parentNode?.removeChild(o)}});return vn.set(s,c),s}let vn=new WeakMap;function Ri(e,t){const r=vn.get(e);return r?(vn.delete(e),r(t)):Promise.resolve()}class Di{constructor(t,r=!0){We(this,"anchor");P(this,qe,new Map);P(this,Ze,new Map);P(this,Te,new Map);P(this,Dt,new Set);P(this,xr,!0);P(this,yr,()=>{var t=B;if(d(this,qe).has(t)){var r=d(this,qe).get(t),n=d(this,Ze).get(r);if(n)un(n),d(this,Dt).delete(r);else{var a=d(this,Te).get(r);a&&(d(this,Ze).set(r,a.effect),d(this,Te).delete(r),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),n=a.effect)}for(const[l,i]of d(this,qe)){if(d(this,qe).delete(l),l===t)break;const s=d(this,Te).get(i);s&&(xe(s.effect),d(this,Te).delete(i))}for(const[l,i]of d(this,Ze)){if(l===r||d(this,Dt).has(l))continue;const s=()=>{if(Array.from(d(this,qe).values()).includes(l)){var o=document.createDocumentFragment();za(i,o),o.append(dt()),d(this,Te).set(l,{effect:i,fragment:o})}else xe(i);d(this,Dt).delete(l),d(this,Ze).delete(l)};d(this,xr)||!n?(d(this,Dt).add(l),zt(i,s,!1)):s()}}});P(this,Ur,t=>{d(this,qe).delete(t);const r=Array.from(d(this,qe).values());for(const[n,a]of d(this,Te))r.includes(n)||(xe(a.effect),d(this,Te).delete(n))});this.anchor=t,T(this,xr,r)}ensure(t,r){var n=B,a=ma();if(r&&!d(this,Ze).has(t)&&!d(this,Te).has(t))if(a){var l=document.createDocumentFragment(),i=dt();l.append(i),d(this,Te).set(t,{effect:je(()=>r(i)),fragment:l})}else d(this,Ze).set(t,je(()=>r(this.anchor)));if(d(this,qe).set(n,t),a){for(const[s,c]of d(this,Ze))s===t?n.unskip_effect(c):n.skip_effect(c);for(const[s,c]of d(this,Te))s===t?n.unskip_effect(c.effect):n.skip_effect(c.effect);n.oncommit(d(this,yr)),n.ondiscard(d(this,Ur))}else d(this,yr).call(this)}}qe=new WeakMap,Ze=new WeakMap,Te=new WeakMap,Dt=new WeakMap,xr=new WeakMap,yr=new WeakMap,Ur=new WeakMap;function W(e,t,r=!1){var n=new Di(e),a=r?Bt:0;function l(i,s){n.ensure(i,s)}cn(()=>{var i=!1;t((s,c=0)=>{i=!0,l(c,s)}),i||l(!1,null)},a)}function Ha(e,t){return t}function Oi(e,t,r){for(var n=[],a=t.length,l,i=t.length,s=0;s<a;s++){let p=t[s];zt(p,()=>{if(l){if(l.pending.delete(p),l.done.add(p),l.pending.size===0){var u=e.outrogroups;hn(Ar(l.done)),u.delete(l),u.size===0&&(e.outrogroups=null)}}else i-=1},!1)}if(i===0){var c=n.length===0&&r!==null;if(c){var o=r,v=o.parentNode;hi(v),v.append(o),e.items.clear()}hn(t,!c)}else l={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(l)}function hn(e,t=!0){for(var r=0;r<e.length;r++)xe(e[r],t)}var qa;function pr(e,t,r,n,a,l=null){var i=e,s=new Map;{var c=e;i=c.appendChild(dt())}var o=null,v=ca(()=>{var x=r();return qn(x)?x:x==null?[]:Ar(x)}),p,u=!0;function _(){k.fallback=o,Ni(k,p,i,t,n),o!==null&&(p.length===0?(o.f&ot)===0?un(o):(o.f^=ot,gr(o,null,i)):zt(o,()=>{o=null}))}var h=cn(()=>{p=f(v);for(var x=p.length,j=new Set,g=B,U=ma(),J=0;J<x;J+=1){var X=p[J],R=n(X,J),L=u?null:s.get(R);L?(L.v&&Gt(L.v,X),L.i&&Gt(L.i,J),U&&g.unskip_effect(L.e)):(L=Fi(s,u?i:qa??(qa=dt()),X,R,J,a,t,r),u||(L.e.f|=ot),s.set(R,L)),j.add(R)}if(x===0&&l&&!o&&(u?o=je(()=>l(i)):(o=je(()=>l(qa??(qa=dt()))),o.f|=ot)),x>j.size&&Tl(),!u)if(U){for(const[Z,M]of s)j.has(Z)||g.skip_effect(M.e);g.oncommit(_),g.ondiscard(()=>{})}else _();f(v)}),k={effect:h,items:s,outrogroups:null,fallback:o};u=!1}function _r(e){for(;e!==null&&(e.f&De)===0;)e=e.next;return e}function Ni(e,t,r,n,a){var l=t.length,i=e.items,s=_r(e.effect.first),c,o=null,v=[],p=[],u,_,h,k;for(k=0;k<l;k+=1){if(u=t[k],_=a(u,k),h=i.get(_).e,e.outrogroups!==null)for(const Z of e.outrogroups)Z.pending.delete(h),Z.done.delete(h);if((h.f&ot)!==0)if(h.f^=ot,h===s)gr(h,null,r);else{var x=o?o.next:s;h===e.effect.last&&(e.effect.last=h.prev),h.prev&&(h.prev.next=h.next),h.next&&(h.next.prev=h.prev),ht(e,o,h),ht(e,h,x),gr(h,x,r),o=h,v=[],p=[],s=_r(o.next);continue}if((h.f&Ee)!==0&&un(h),h!==s){if(c!==void 0&&c.has(h)){if(v.length<p.length){var j=p[0],g;o=j.prev;var U=v[0],J=v[v.length-1];for(g=0;g<v.length;g+=1)gr(v[g],j,r);for(g=0;g<p.length;g+=1)c.delete(p[g]);ht(e,U.prev,J.next),ht(e,o,U),ht(e,J,j),s=j,o=J,k-=1,v=[],p=[]}else c.delete(h),gr(h,s,r),ht(e,h.prev,h.next),ht(e,h,o===null?e.effect.first:o.next),ht(e,o,h),o=h;continue}for(v=[],p=[];s!==null&&s!==h;)(c??(c=new Set)).add(s),p.push(s),s=_r(s.next);if(s===null)continue}(h.f&ot)===0&&v.push(h),o=h,s=_r(h.next)}if(e.outrogroups!==null){for(const Z of e.outrogroups)Z.pending.size===0&&(hn(Ar(Z.done)),e.outrogroups?.delete(Z));e.outrogroups.size===0&&(e.outrogroups=null)}if(s!==null||c!==void 0){var X=[];if(c!==void 0)for(h of c)(h.f&Ee)===0&&X.push(h);for(;s!==null;)(s.f&Ee)===0&&s!==e.fallback&&X.push(s),s=_r(s.next);var R=X.length;if(R>0){var L=l===0?r:null;Oi(e,X,L)}}}function Fi(e,t,r,n,a,l,i,s){var c=(i&jl)!==0?(i&Bl)===0?ui(r,!1,!1):St(r):null,o=(i&Ul)!==0?St(a):null;return{v:c,i:o,e:je(()=>(l(t,c??r,o??a,s),()=>{e.delete(n)}))}}function gr(e,t,r){if(e.nodes)for(var n=e.nodes.start,a=e.nodes.end,l=t&&(t.f&ot)===0?t.nodes.start:r;n!==null;){var i=dr(n);if(l.before(n),n===a)return;n=i}}function ht(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function pt(e,t){sn(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const a=wa("style");a.id=t.hash,a.textContent=t.code,n.appendChild(a)}})}const Ka=[...`
5
+ \r\f \v\uFEFF`];function ji(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var a in r)if(r[a])n=n?n+" "+a:a;else if(n.length)for(var l=a.length,i=0;(i=n.indexOf(a,i))>=0;){var s=i+l;(i===0||Ka.includes(n[i-1]))&&(s===n.length||Ka.includes(n[s]))?n=(i===0?"":n.substring(0,i))+n.substring(s+1):i=s}}return n===""?null:n}function Ui(e,t){return e==null?null:String(e)}function Be(e,t,r,n,a,l){var i=e.__className;if(i!==r||i===void 0){var s=ji(r,n,l);s==null?e.removeAttribute("class"):e.className=s,e.__className=r}else if(l&&a!==l)for(var c in l){var o=!!l[c];(a==null||o!==!!a[c])&&e.classList.toggle(c,o)}return l}function Zt(e,t,r,n){var a=e.__style;if(a!==t){var l=Ui(t);l==null?e.removeAttribute("style"):e.style.cssText=l,e.__style=t}return n}const Bi=Symbol("is custom element"),Hi=Symbol("is html");function H(e,t,r,n){var a=qi(e);a[t]!==(a[t]=r)&&(t==="loading"&&(e[Cl]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Ki(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function qi(e){return e.__attributes??(e.__attributes={[Bi]:e.nodeName.includes("-"),[Hi]:e.namespaceURI===Xn})}var Va=new Map;function Ki(e){var t=e.getAttribute("is")||e.nodeName,r=Va.get(t);if(r)return r;Va.set(t,r=[]);for(var n,a=e,l=Element.prototype;l!==a;){n=ml(a);for(var i in n)n[i].set&&r.push(i);a=Kn(a)}return r}function Vi(e,t,r=t){var n=new WeakSet;_i(e,"input",async a=>{var l=a?e.defaultValue:e.value;if(l=pn(e)?_n(l):l,r(l),B!==null&&n.add(B),await Ci(),l!==(l=t())){var i=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=l??"",s!==null){var o=e.value.length;i===s&&s===c&&o>c?(e.selectionStart=o,e.selectionEnd=o):(e.selectionStart=i,e.selectionEnd=Math.min(s,o))}}}),Xt(t)==null&&e.value&&(r(pn(e)?_n(e.value):e.value),B!==null&&n.add(B)),on(()=>{var a=t();if(e===document.activeElement){var l=Qr??B;if(n.has(l))return}pn(e)&&a===_n(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function pn(e){var t=e.type;return t==="number"||t==="range"}function _n(e){return e===""?null:+e}const Hr=class Hr{constructor(t){P(this,Br);P(this,gt,new WeakMap);P(this,lr);P(this,kr);T(this,kr,t)}observe(t,r){var n=d(this,gt).get(t)||new Set;return n.add(r),d(this,gt).set(t,n),se(this,Br,nl).call(this).observe(t,d(this,kr)),()=>{var a=d(this,gt).get(t);a.delete(r),a.size===0&&(d(this,gt).delete(t),d(this,lr).unobserve(t))}}};gt=new WeakMap,lr=new WeakMap,kr=new WeakMap,Br=new WeakSet,nl=function(){return d(this,lr)??T(this,lr,new ResizeObserver(t=>{for(var r of t){Hr.entries.set(r.target,r);for(var n of d(this,gt).get(r.target)||[])n(r)}}))},We(Hr,"entries",new WeakMap);let gn=Hr;var Wi=new gn({box:"border-box"});function Gi(e,t,r){var n=Wi.observe(e,()=>r(e[t]));sn(()=>(Xt(()=>r(e[t])),n))}function Wa(e,t){return e===t||e?.[cr]===t}function br(e={},t,r,n){return sn(()=>{var a,l;return on(()=>{a=l,l=[],Xt(()=>{e!==r(...l)&&(t(e,...l),a&&Wa(r(...a),e)&&t(null,...a))})}),()=>{Et(()=>{l&&Wa(r(...l),e)&&t(null,...l)})}}),e}let Or=!1;function Yi(e){var t=Or;try{return Or=!1,[e(),Or]}finally{Or=t}}function z(e,t,r,n){var a=(r&Kl)!==0,l=(r&Vl)!==0,i=n,s=!0,c=()=>(s&&(s=!1,i=l?Xt(n):n),i),o;if(a){var v=cr in e||Sl in e;o=Ut(e,t)?.set??(v&&t in e?g=>e[t]=g:void 0)}var p,u=!1;a?[p,u]=Yi(()=>e[t]):p=e[t],p===void 0&&n!==void 0&&(p=c(),o&&(Rl(),o(p)));var _;if(_=()=>{var g=e[t];return g===void 0?c():(s=!0,g)},(r&ql)===0)return _;if(o){var h=e.$$legacy;return(function(g,U){return arguments.length>0?((!U||h||u)&&o(U?_():g),g):_()})}var k=!1,x=((r&Hl)!==0?Mr:ca)(()=>(k=!1,_()));a&&f(x);var j=F;return(function(g,U){if(arguments.length>0){const J=U?f(x):a?Ct(g):g;return E(x,J),k=!0,i!==void 0&&(i=J),g}return vt&&k||(j.f&et)!==0?x.v:f(x)})}function bn(e){Se===null&&zl(),Yt(()=>{const t=Xt(e);if(typeof t=="function")return t})}function Ji(e,t){var r,n;return n=class{constructor(l){P(this,r,null);if(!zr)throw new Error(`[sevn] ${t} só pode ser instanciado no navegador. Em SSR, monte o componente dentro de um efeito de cliente.`);const{target:i,...s}=l??{},c=typeof i=="string"?document.querySelector(i):i;if(!c)throw new Error(`[sevn] ${t}: alvo não encontrado`+(typeof i=="string"?` para o seletor "${i}".`:"."));fl(),T(this,r,Mi(e,{target:c,props:s}))}destroy(){if(!d(this,r))return Promise.resolve();const l=d(this,r);return T(this,r,null),Ri(l)}},r=new WeakMap,n}function Ga(e){try{return new URL(e,document.baseURI).searchParams.get("cid")}catch{return null}}function Xi(){const e=document.currentScript;if(e?.src){const r=Ga(e.src);if(r)return r}const t=document.querySelectorAll('script[src*="cid="]');for(const r of t){const n=Ga(r.src);if(n)return n}return null}function Zi(){if(!zr)return;const e=Xi();if(e)try{Vr(e)}catch(t){console.error("[sevn] Chave inválida na tag <script>:",t)}}const Qi="5";typeof window<"u"&&((el=window.__svelte??(window.__svelte={})).v??(el.v=new Set)).add(Qi);const $i="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M25.9798%2026.872L17.6305%2018.5227C16.9638%2019.0907%2016.1971%2019.5302%2015.3305%2019.8413C14.4638%2020.1524%2013.5927%2020.308%2012.7171%2020.308C10.582%2020.308%208.77493%2019.5689%207.29582%2018.0907C5.8167%2016.6124%205.07715%2014.8058%205.07715%2012.6707C5.07715%2010.5356%205.81581%208.728%207.29315%207.248C8.77048%205.768%2010.5767%205.02711%2012.7118%205.02533C14.8469%205.02356%2016.6549%205.76311%2018.1358%207.244C19.6167%208.72489%2020.3571%2010.5324%2020.3571%2012.6667C20.3571%2013.5929%2020.1931%2014.4893%2019.8651%2015.356C19.5371%2016.2227%2019.106%2016.964%2018.5718%2017.58L26.9211%2025.928L25.9798%2026.872ZM12.7185%2018.9733C14.4874%2018.9733%2015.9807%2018.3644%2017.1985%2017.1467C18.4163%2015.9289%2019.0251%2014.4351%2019.0251%2012.6653C19.0251%2010.8956%2018.4163%209.40222%2017.1985%208.18533C15.9807%206.96844%2014.4874%206.35956%2012.7185%206.35867C10.9496%206.35778%209.45581%206.96667%208.23715%208.18533C7.01848%209.404%206.40959%2010.8973%206.41048%2012.6653C6.41137%2014.4333%207.02026%2015.9267%208.23715%2017.1453C9.45404%2018.364%2010.9474%2018.9729%2012.7171%2018.972'%20fill='%231C1C1C'/%3e%3c/svg%3e",mn="data:image/svg+xml,%3csvg%20width='13'%20height='8'%20viewBox='0%200%2013%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.91%20-0.00016065L12.97%201.06084L7.193%206.83984C7.10043%206.93299%206.99036%207.00692%206.86911%207.05737C6.74786%207.10782%206.61783%207.13379%206.4865%207.13379C6.35517%207.13379%206.22514%207.10782%206.10389%207.05737C5.98264%207.00692%205.87257%206.93299%205.78%206.83984L2.65457e-07%201.06084L1.06%200.000838803L6.485%205.42484L11.91%20-0.00016065Z'%20fill='black'/%3e%3c/svg%3e",wn="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.5%201.5L1.5%2010.5M1.5%201.5L10.5%2010.5'%20stroke='black'%20stroke-width='1.6'%20stroke-linecap='round'/%3e%3c/svg%3e";var es=y('<span class="mobile-label svelte-1dw55dz"> </span>'),ts=y('<input class="search-input svelte-1dw55dz" type="text"/>'),rs=y('<span class="field-label-prefix svelte-1dw55dz"> </span>'),ns=y('<span class="field-text svelte-1dw55dz"><!> </span>'),as=y("<span> </span>"),ls=y('<button class="icon-clear svelte-1dw55dz" type="button" aria-label="Limpar seleção"><img alt="" aria-hidden="true"/></button>'),is=y('<img alt="" aria-hidden="true"/>'),ss=y('<img class="icon-search svelte-1dw55dz" alt="" aria-hidden="true"/>'),os=y('<span class="meta svelte-1dw55dz"> </span>'),cs=y('<div class="web-info svelte-1dw55dz"><span class="selected-label svelte-1dw55dz"><strong class="svelte-1dw55dz">Você selecionou:</strong> </span> <!></div>'),fs=y('<button type="button" role="option"> </button>'),us=y('<div class="no-results svelte-1dw55dz">Nenhum resultado encontrado</div>'),ds=y('<div class="dropdown svelte-1dw55dz" role="listbox"></div>'),vs=y('<div><!> <div role="combobox" aria-haspopup="listbox"><!> <!></div> <!> <!></div>');const hs={hash:"svelte-1dw55dz",code:`.autocomplete.svelte-1dw55dz {position:relative;width:var(--field-width);font-family:inherit;}
6
+
7
+ /* ── Label (mobile only) ─────────────────────────────── */.mobile-label.svelte-1dw55dz {display:none;font-size:0.875rem;font-weight:600;color:var(--sevn-color-tertiary);margin-bottom:6px;}
8
+
9
+ @media (max-width: 768px) {.mobile-label.svelte-1dw55dz {display:block;}
10
+ }
11
+
12
+ /* ── Campo principal ─────────────────────────────────── */.field.svelte-1dw55dz {display:flex;align-items:center;width:100%;height:var(--field-height);padding:0 14px;background:var(--sevn-color-neutral);border:1px solid transparent;border-radius:8px;cursor:pointer;gap:8px;transition:border-color 0.15s, box-shadow 0.15s;color:var(--sevn-color-tertiary);}.field.svelte-1dw55dz:hover {border-color:#d1d1d6;}.field.disabled.svelte-1dw55dz {cursor:not-allowed;opacity:0.55;}.field.disabled.svelte-1dw55dz:hover {border-color:transparent;}.field.open.svelte-1dw55dz {border-color:var(--sevn-color-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--sevn-color-primary) 15%, transparent);background:#fff;}
13
+
14
+ /* ── Texto do campo ──────────────────────────────────── */.field-text.svelte-1dw55dz {flex:1;text-align:left;font-size:0.9375rem;color:var(--sevn-color-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.field-text.is-placeholder.svelte-1dw55dz {color:#9a9aaa;}.field-label-prefix.svelte-1dw55dz {font-weight:600;margin-right:4px;}
15
+
16
+ /* ── Input de busca ──────────────────────────────────── */.search-input.svelte-1dw55dz {flex:1;border:none;outline:none;font-size:0.9375rem;font-family:inherit;color:var(--sevn-color-tertiary);background:transparent;min-width:0;}.search-input.svelte-1dw55dz::placeholder {color:#9a9aaa;}
17
+
18
+ /* ── Ícone de lupa ───────────────────────────────────── */.icon-search.svelte-1dw55dz {flex-shrink:0;}.field.open.svelte-1dw55dz .icon-search:where(.svelte-1dw55dz) {opacity:1;}
19
+
20
+ /* ── Botão de limpar ─────────────────────────────────── */.icon-clear.svelte-1dw55dz {display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;background:none;border:none;border-radius:50%;cursor:pointer;transition:background 0.15s;}.icon-clear.svelte-1dw55dz:hover,
21
+ .icon-clear.svelte-1dw55dz:focus-visible {background:rgba(0, 0, 0, 0.08);}
22
+
23
+ /* ── Ícone de chevron ────────────────────────────────── */.icon-chevron.svelte-1dw55dz {flex-shrink:0;transition:transform 0.2s ease;}.icon-chevron.open.svelte-1dw55dz {transform:rotate(180deg);}
24
+
25
+ /* ── "Você selecionou" (web only) ────────────────────── */.web-info.svelte-1dw55dz {display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:20px;font-size:0.8125rem;color:var(--sevn-color-tertiary);}.selected-label.svelte-1dw55dz strong:where(.svelte-1dw55dz) {font-weight:600;}.meta.svelte-1dw55dz {font-size:0.7rem;opacity:50%;}
26
+
27
+ @media (max-width: 768px) {.web-info.svelte-1dw55dz {display:none;}.field-text.svelte-1dw55dz {font-weight:600;}.field-text.is-placeholder.svelte-1dw55dz:not(.force-placeholder) {display:none;}.search-input.svelte-1dw55dz::placeholder {color:transparent;}.show-placeholder-mobile.svelte-1dw55dz .search-input:where(.svelte-1dw55dz)::placeholder {color:#9a9aaa;}.icon-search.svelte-1dw55dz {margin-left:auto;}
28
+ }
29
+
30
+ /* ── Dropdown ────────────────────────────────────────── */.dropdown.svelte-1dw55dz {position:absolute;top:calc(var(--field-height) + 6px);left:0;right:0;background:#fff;border:1px solid #d1d1d6;border-radius:8px;max-height:240px;overflow-y:auto;z-index:200;box-shadow:0 6px 16px rgba(0, 0, 0, 0.1);scrollbar-width:thin;scrollbar-color:#d1d1d6 transparent;}.dropdown.svelte-1dw55dz::-webkit-scrollbar {width:4px;}.dropdown.svelte-1dw55dz::-webkit-scrollbar-track {background:transparent;}.dropdown.svelte-1dw55dz::-webkit-scrollbar-thumb {background-color:#d1d1d6;border-radius:4px;}
31
+
32
+ /* ── Opção ───────────────────────────────────────────── */.option.svelte-1dw55dz {display:block;width:100%;padding:11px 14px;text-align:left;background:none;border:none;border-bottom:1px solid #f0f0f5;cursor:pointer;font-size:0.9375rem;font-family:inherit;color:var(--sevn-color-tertiary);transition:background 0.1s;line-height:1.4;}.option.svelte-1dw55dz:last-child {border-bottom:none;}.option.svelte-1dw55dz:hover {background:var(--sevn-color-neutral);}.option.selected.svelte-1dw55dz {background:color-mix(in srgb, var(--sevn-color-primary) 8%, transparent);color:var(--sevn-color-primary);font-weight:600;}.no-results.svelte-1dw55dz {padding:14px;color:#9a9aaa;font-size:0.875rem;text-align:center;}`};function Ya(e,t){Kt(t,!0),pt(e,hs);let r=z(t,"label",3,""),n=z(t,"showLabel",3,!0),a=z(t,"options",19,()=>[]),l=z(t,"value",15,null),i=z(t,"meta",3,""),s=z(t,"width",3,"100%"),c=z(t,"height",3,"48px"),o=z(t,"icon",3,$i),v=z(t,"iconSize",3,13),p=z(t,"showLabelInField",3,!1),u=z(t,"showDescriptionSelection",3,!0),_=z(t,"labelAsPlaceholder",3,!0),h=z(t,"showPlaceholderOnMobile",3,!1),k=z(t,"disabled",3,!1),x=z(t,"clearable",3,!0);const j=`autocomplete-listbox-${Math.random().toString(36).slice(2,9)}`;let g=G(!1),U=G(""),J=G(null),X=G(null),R=ce(()=>f(U).trim()?a().filter(b=>b.label.toLowerCase().includes(f(U).trim().toLowerCase())):a()),L=ce(()=>l()!=null?a().find(b=>b.value===l())??null:null);function Z(b){l(b.value),E(U,""),E(g,!1)}function M(){k()||(E(g,!f(g)),f(g)||E(U,""))}function Y(b){b.stopPropagation(),l(null),E(U,""),E(g,!1)}function ae(b){b.target===b.currentTarget&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),M())}function ue(b){f(J)&&!f(J).contains(b.target)&&(E(g,!1),E(U,""))}function A(b){b.key==="Escape"&&(E(g,!1),E(U,""))}Yt(()=>{f(g)&&f(X)&&f(X).focus()}),Yt(()=>{k()&&(E(g,!1),E(U,""))}),bn(()=>(document.addEventListener("mousedown",ue),()=>document.removeEventListener("mousedown",ue)));var O=vs();let le;var Q=m(O);{var te=b=>{var C=es(),q=m(C);S(()=>$(q,r())),w(b,C)};W(Q,b=>{n()&&r()&&b(te)})}var ee=D(Q,2);let de;var Pe=m(ee);{var bt=b=>{var C=ts();br(C,q=>E(X,q),()=>f(X)),S(()=>H(C,"placeholder",r())),ge("keydown",C,A),ge("click",C,q=>q.stopPropagation()),Vi(C,()=>f(U),q=>E(U,q)),w(b,C)},Er=b=>{var C=ns(),q=m(C);{var be=ke=>{var Ve=rs(),ir=m(Ve);S(()=>$(ir,r())),w(ke,Ve)};W(q,ke=>{p()&&ke(be)})}var me=D(q,1,!0);S(()=>$(me,f(L).label)),w(b,C)},Sr=b=>{var C=Ba(),q=ba(C);{var be=me=>{var ke=as();let Ve;var ir=m(ke);S(()=>{Ve=Be(ke,1,"field-text is-placeholder svelte-1dw55dz",null,Ve,{"force-placeholder":h()}),$(ir,r())}),w(me,ke)};W(q,me=>{_()&&me(be)})}w(b,C)};W(Pe,b=>{f(g)?b(bt):f(L)?b(Er,1):b(Sr,!1)})}var Ot=D(Pe,2);{var N=b=>{var C=ls(),q=m(C);S(()=>{H(q,"src",wn),H(q,"width",v()?v():12),H(q,"height",v()?v():12)}),ge("click",C,Y),w(b,C)},ie=b=>{var C=is();let q;S(()=>{q=Be(C,1,"icon-chevron svelte-1dw55dz",null,q,{open:f(g)}),H(C,"src",mn),H(C,"width",v()?v():12),H(C,"height",v()?v():12)}),w(b,C)},Qe=b=>{var C=ss();S(()=>{H(C,"src",o()),H(C,"width",v()),H(C,"height",v())}),w(b,C)};W(Ot,b=>{f(L)&&x()&&!k()?b(N):f(L)?b(ie,1):b(Qe,!1)})}var _e=D(ee,2);{var st=b=>{var C=cs(),q=m(C),be=D(m(q)),me=D(q,2);{var ke=Ve=>{var ir=os(),wo=m(ir);S(()=>$(wo,i())),w(Ve,ir)};W(me,Ve=>{i()&&Ve(ke)})}S(()=>$(be,` ${f(L).label??""}`)),w(b,C)};W(_e,b=>{f(L)&&u()&&b(st)})}var Cr=D(_e,2);{var Ke=b=>{var C=ds();pr(C,21,()=>f(R),q=>q.value,(q,be)=>{var me=fs();let ke;var Ve=m(me);S(()=>{ke=Be(me,1,"option svelte-1dw55dz",null,ke,{selected:f(be).value===l()}),H(me,"aria-selected",f(be).value===l()),$(Ve,f(be).label)}),ge("click",me,()=>Z(f(be))),w(q,me)},q=>{var be=us();w(q,be)}),S(()=>H(C,"id",j)),w(b,C)};W(Cr,b=>{f(g)&&b(Ke)})}br(O,b=>E(J,b),()=>f(J)),S(()=>{le=Be(O,1,"autocomplete svelte-1dw55dz",null,le,{"show-placeholder-mobile":h()}),Zt(O,`--field-width: ${s()??""}; --field-height: ${c()??""}`),de=Be(ee,1,"field svelte-1dw55dz",null,de,{open:f(g),"has-value":f(L)&&!f(g),disabled:k()}),H(ee,"tabindex",k()?-1:0),H(ee,"aria-controls",j),H(ee,"aria-expanded",f(g)),H(ee,"aria-disabled",k())}),ge("click",ee,M),ge("keydown",ee,ae),w(e,O),Vt()}Rr(["click","keydown"]);const Nr="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.5%206.5L19%2012L13.5%2017.5M17.75%2012L4.75%2012'%20stroke='%231C1C1C'%20stroke-width='2'%20stroke-linecap='square'/%3e%3c/svg%3e",Fr="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.6'%3e%3cpath%20d='M10.5%206.5L5%2012L10.5%2017.5M6.25%2012L19.25%2012'%20stroke='%231C1C1C'%20stroke-width='2'%20stroke-linecap='square'/%3e%3c/g%3e%3c/svg%3e";var ps=y('<span class="bar-value svelte-7xr7wg"> </span>'),_s=y('<div class="bar-col svelte-7xr7wg"><div class="bar-track svelte-7xr7wg"><!> <div class="bar-fill svelte-7xr7wg"></div></div> <div class="bar-label-area svelte-7xr7wg"><span class="bar-label svelte-7xr7wg"> <strong class="svelte-7xr7wg"> </strong></span></div></div>'),gs=y('<img alt="" class="flip svelte-7xr7wg"/>'),bs=y('<img alt="" class="svelte-7xr7wg"/>'),ms=y('<img alt="" class="svelte-7xr7wg"/>'),ws=y('<img alt="" class="flip svelte-7xr7wg"/>'),xs=y('<div class="bar-chart-footer svelte-7xr7wg"><button class="bar-chart-arrow svelte-7xr7wg" aria-label="Anterior"><!></button> <button class="bar-chart-arrow svelte-7xr7wg" aria-label="Próximo"><!></button></div>'),ys=y('<div class="bar-chart svelte-7xr7wg"><div class="bar-chart-scroll svelte-7xr7wg" role="img" aria-label="Gráfico de barras"></div> <!></div>');const ks={hash:"svelte-7xr7wg",code:`
33
+ /* ── Wrapper ──────────────────────────────── */.bar-chart.svelte-7xr7wg {display:flex;flex-direction:column;gap:4px;contain:layout;}
34
+
35
+ /* ── Scroll container ─────────────────────── */.bar-chart-scroll.svelte-7xr7wg {width:100%;display:flex;gap:16px;
36
+ /* padding-top gives room for bar-value above tallest bar.
37
+ overflow-x: auto forces overflow-y: auto (CSS spec), which would clip
38
+ the value label — padding prevents that. CLS = 0: total height is fixed. */padding-top:24px;height:calc(var(--track-h) + 24px);overflow-x:auto;scrollbar-width:none;border-bottom:3px solid #e5e5ea;}.bar-chart-scroll.svelte-7xr7wg::-webkit-scrollbar {display:none;}
39
+
40
+ /* ── Column ───────────────────────────────── */.bar-col.svelte-7xr7wg {flex:0 0 var(--col-w);display:flex;flex-direction:row;}
41
+
42
+ /* ── Bar track ────────────────────────────── */.bar-track.svelte-7xr7wg {flex:1;position:relative;align-self:stretch;border-bottom:1.5px solid #e5e5ea;}.bar-fill.svelte-7xr7wg {position:absolute;bottom:0;left:0;right:0;height:var(--bar-pct);background:var(--bar-color);border-radius:50px 50px 0 0;}
43
+
44
+ /* Value label — sits just above the bar top */.bar-value.svelte-7xr7wg {position:absolute;left:50%;bottom:calc(var(--bar-pct) + 6px);transform:translateX(-50%);font-size:0.8125rem;font-weight:500;color:var(--sevn-color-tertiary);white-space:nowrap;line-height:1;}
45
+
46
+ /* ── Label area — à direita da barra ─────── */.bar-label-area.svelte-7xr7wg {display:flex;align-items:flex-end;padding:0 0 6px 6px;}
47
+
48
+ /* writing-mode: vertical-rl + rotate(180deg)
49
+ → characters read bottom-to-top, base on left */.bar-label.svelte-7xr7wg {writing-mode:vertical-rl;transform:rotate(180deg);font-size:0.75rem;font-weight:500;color:var(--sevn-color-tertiary);white-space:nowrap;line-height:1;}.bar-label.svelte-7xr7wg strong:where(.svelte-7xr7wg) {font-weight:700;}
50
+
51
+ /* ── Footer ───────────────────────────────── */.bar-chart-footer.svelte-7xr7wg {display:flex;justify-content:space-between;align-items:center;padding:0 2px;}.bar-chart-arrow.svelte-7xr7wg {display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;flex-shrink:0;}.bar-chart-arrow.svelte-7xr7wg:disabled {cursor:default;}.bar-chart-arrow.svelte-7xr7wg img:where(.svelte-7xr7wg) {width:24px;height:24px;display:block;}.bar-chart-arrow.svelte-7xr7wg .flip:where(.svelte-7xr7wg) {transform:scaleX(-1);}`};function Es(e,t){Kt(t,!0),pt(e,ks);let r=z(t,"items",19,()=>[]),n=z(t,"unit",3,""),a=z(t,"showValues",3,!0),l=z(t,"trackHeight",3,200),i=z(t,"visibleCount",3,6),s=z(t,"colWidth",3,60);const c=ce(()=>i()*s()+(i()-1)*16),o=ce(()=>t.max??Math.max(...r().map(R=>R.value),1));function v(R){return`${R/f(o)*100}%`}function p(R){const L=R.lastIndexOf(" ");return L===-1?{prefix:"",bold:R}:{prefix:R.slice(0,L+1),bold:R.slice(L+1)}}let u=G(null),_=G(!1),h=G(!1);function k(){f(u)&&(E(_,f(u).scrollLeft>0),E(h,f(u).scrollLeft+f(u).clientWidth<f(u).scrollWidth-1))}Yt(()=>{if(!f(u))return;k(),f(u).addEventListener("scroll",k,{passive:!0});const R=new ResizeObserver(k);return R.observe(f(u)),()=>{f(u).removeEventListener("scroll",k),R.disconnect()}});function x(){f(u)?.scrollBy({left:-200,behavior:"smooth"})}function j(){f(u)?.scrollBy({left:200,behavior:"smooth"})}var g=ys(),U=m(g);pr(U,21,r,Ha,(R,L)=>{const Z=ce(()=>{const{prefix:ee,bold:de}=p(f(L).label);return{prefix:ee,bold:de}});var M=_s(),Y=m(M),ae=m(Y);{var ue=ee=>{var de=ps(),Pe=m(de);S(()=>$(Pe,`${f(L).value??""}${n()??""}`)),w(ee,de)};W(ae,ee=>{a()&&ee(ue)})}var A=D(Y,2),O=m(A),le=m(O),Q=D(le),te=m(Q);S(ee=>{Zt(M,`--bar-pct: ${ee??""}; --bar-color: ${f(L).color??""};`),$(le,f(Z).prefix),$(te,f(Z).bold)},[()=>v(f(L).value)]),w(R,M)}),br(U,R=>E(u,R),()=>f(u));var J=D(U,2);{var X=R=>{var L=xs(),Z=m(L),M=m(Z);{var Y=Q=>{var te=gs();S(()=>H(te,"src",Nr)),w(Q,te)},ae=Q=>{var te=bs();S(()=>H(te,"src",Fr)),w(Q,te)};W(M,Q=>{f(_)?Q(Y):Q(ae,!1)})}var ue=D(Z,2),A=m(ue);{var O=Q=>{var te=ms();S(()=>H(te,"src",Nr)),w(Q,te)},le=Q=>{var te=ws();S(()=>H(te,"src",Fr)),w(Q,te)};W(A,Q=>{f(h)?Q(O):Q(le,!1)})}S(()=>{Z.disabled=!f(_),ue.disabled=!f(h)}),ge("click",Z,x),ge("click",ue,j),w(R,L)};W(J,R=>{r().length>i()&&R(X)})}S(()=>Zt(g,`--track-h: ${l()??""}px; --col-w: ${s()??""}px; width: ${f(c)??""}px;`)),w(e,g),Vt()}Rr(["click"]);var Ss=y("<span> </span>");const Cs={hash:"svelte-pamnib",code:".tag.svelte-pamnib {display:inline-flex;align-items:center;padding:4px 8px;border-radius:5px;font-family:inherit;font-weight:700;color:#ffffff;white-space:nowrap;letter-spacing:0.03em;width:fit-content;}"};function xn(e,t){pt(e,Cs);let r=z(t,"color",3,"#1C1C1C"),n=z(t,"fontSize",3,"0.6875rem"),a=z(t,"class",3,"");var l=Ss(),i=m(l);S(()=>{Be(l,1,`tag ${a()??""}`,"svelte-pamnib"),Zt(l,`background-color: ${r()??""}; font-size: ${n()??""}`),$(i,t.label)}),w(e,l)}var zs=y('<span class="trigger-label svelte-hkzjiw"> </span>'),As=y('<img alt="" aria-hidden="true" width="10" height="10"/>'),Ts=y('<button class="clear svelte-hkzjiw" type="button"><img alt="" aria-hidden="true" width="8" height="8"/></button>'),Ps=y('<button type="button" role="option"> </button>'),Ls=y('<div class="dropdown svelte-hkzjiw" role="listbox"></div>'),Ms=y('<div class="filter-dropdown svelte-hkzjiw"><button type="button" aria-haspopup="listbox"><!> <span class="trigger-value svelte-hkzjiw"> </span> <!></button> <!> <!></div>');const Is={hash:"svelte-hkzjiw",code:`.filter-dropdown.svelte-hkzjiw {position:relative;display:inline-flex;align-items:center;}
52
+
53
+ /* ── Trigger ─────────────────────────────── */.trigger.svelte-hkzjiw {display:inline-flex;align-items:center;gap:4px;padding:0;background:none;border:none;cursor:pointer;font-family:inherit;font-size:0.875rem;color:var(--sevn-color-tertiary);white-space:nowrap;}.trigger-label.svelte-hkzjiw {font-weight:700;}.trigger-value.svelte-hkzjiw {font-weight:400;}.trigger-chevron.svelte-hkzjiw {flex-shrink:0;transition:transform 0.2s ease;margin-left:2px;}.trigger-chevron.rotated.svelte-hkzjiw {transform:rotate(180deg);}
54
+
55
+ /* ── Botão de limpar ─────────────────────── */.clear.svelte-hkzjiw {display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;margin-left:4px;padding:0;background:none;border:none;border-radius:50%;cursor:pointer;transition:background 0.15s;}.clear.svelte-hkzjiw:hover,
56
+ .clear.svelte-hkzjiw:focus-visible {background:rgba(0, 0, 0, 0.08);}
57
+
58
+ /* ── Dropdown ────────────────────────────── */.dropdown.svelte-hkzjiw {position:absolute;top:calc(100% + 6px);left:0;min-width:100%;background:#fff;border:1px solid #d1d1d6;border-radius:8px;box-shadow:0 6px 16px rgba(0, 0, 0, 0.1);z-index:200;overflow:hidden;}
59
+
60
+ /* ── Options ─────────────────────────────── */.option.svelte-hkzjiw {display:block;width:100%;padding:10px 14px;text-align:left;background:none;border:none;border-bottom:1px solid #f0f0f5;cursor:pointer;font-size:0.875rem;font-family:inherit;color:var(--sevn-color-tertiary);white-space:nowrap;transition:background 0.1s;}.option.svelte-hkzjiw:last-child {border-bottom:none;}.option.svelte-hkzjiw:hover {background:var(--sevn-color-neutral);}.option.selected.svelte-hkzjiw {background:color-mix(in srgb, var(--sevn-color-primary) 8%, transparent);color:var(--sevn-color-primary);font-weight:600;}`};function Rs(e,t){Kt(t,!0),pt(e,Is);let r=z(t,"label",3,""),n=z(t,"options",19,()=>[]),a=z(t,"value",15,null),l=z(t,"clearable",3,!0),i=G(!1),s=G(null);const c=ce(()=>a()!=null?n().find(M=>M.value===a())??null:null);function o(M){a(M.value),E(i,!1)}function v(){a(null),E(i,!1)}function p(M){f(s)&&!f(s).contains(M.target)&&E(i,!1)}bn(()=>(document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)));var u=Ms(),_=m(u);let h;var k=m(_);{var x=M=>{var Y=zs(),ae=m(Y);S(()=>$(ae,`${r()??""}:`)),w(M,Y)};W(k,M=>{r()&&M(x)})}var j=D(k,2),g=m(j),U=D(j,2);{var J=M=>{var Y=As();let ae;S(()=>{ae=Be(Y,1,"trigger-chevron svelte-hkzjiw",null,ae,{rotated:f(i)}),H(Y,"src",mn)}),w(M,Y)};W(U,M=>{f(c)&&l()||M(J)})}var X=D(_,2);{var R=M=>{var Y=Ts(),ae=m(Y);S(()=>{H(Y,"aria-label",`Limpar ${(r()||"filtro")??""}`),H(ae,"src",wn)}),ge("click",Y,v),w(M,Y)};W(X,M=>{f(c)&&l()&&M(R)})}var L=D(X,2);{var Z=M=>{var Y=Ls();pr(Y,21,n,ae=>ae.value,(ae,ue)=>{var A=Ps();let O;var le=m(A);S(()=>{O=Be(A,1,"option svelte-hkzjiw",null,O,{selected:f(ue).value===a()}),H(A,"aria-selected",f(ue).value===a()),$(le,f(ue).label)}),ge("click",A,()=>o(f(ue))),w(ae,A)}),w(M,Y)};W(L,M=>{f(i)&&M(Z)})}br(u,M=>E(s,M),()=>f(s)),S(()=>{h=Be(_,1,"trigger svelte-hkzjiw",null,h,{open:f(i)}),H(_,"aria-expanded",f(i)),$(g,f(c)?f(c).label:"")}),ge("click",_,()=>E(i,!f(i))),w(e,u),Vt()}Rr(["click"]);var Ds=y('<img alt="" class="flip svelte-18tlobi"/>'),Os=y('<img alt="" class="svelte-18tlobi"/>'),Ns=y("<button> </button>"),Fs=y('<img alt="" class="svelte-18tlobi"/>'),js=y('<img alt="" class="flip svelte-18tlobi"/>'),Us=y('<button class="filter-state-clear svelte-18tlobi" type="button" aria-label="Limpar estado selecionado"><img alt="" aria-hidden="true" width="9" height="9"/></button>'),Bs=y('<span class="filter-state-selected svelte-18tlobi"><strong class="svelte-18tlobi">Você selecionou:</strong> <!></span>'),Hs=y('<span class="filter-state-meta svelte-18tlobi"> </span>'),qs=y('<div class="filter-state-info svelte-18tlobi"><!> <!></div>'),Ks=y('<div class="filter-state svelte-18tlobi"><div class="filter-state-bar svelte-18tlobi"><button class="filter-state-arrow svelte-18tlobi" aria-label="Anterior"><!></button> <div class="filter-state-track svelte-18tlobi"></div> <button class="filter-state-arrow svelte-18tlobi" aria-label="Próximo"><!></button></div> <!></div>');const Vs={hash:"svelte-18tlobi",code:`.filter-state.svelte-18tlobi {display:flex;flex-direction:column;gap:20px;}
61
+
62
+ /* ── Bar ──────────────────────────────── */.filter-state-bar.svelte-18tlobi {display:flex;align-items:center;gap:4px;}
63
+
64
+ /* ── Arrows ───────────────────────────── */.filter-state-arrow.svelte-18tlobi {display:flex;align-items:center;justify-content:center;flex-shrink:0;background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;}.filter-state-arrow.svelte-18tlobi:disabled {cursor:default;}.filter-state-arrow.svelte-18tlobi img:where(.svelte-18tlobi) {width:24px;height:24px;display:block;}.filter-state-arrow.svelte-18tlobi .flip:where(.svelte-18tlobi) {transform:scaleX(-1);}
65
+
66
+ /* ── Track ────────────────────────────── */.filter-state-track.svelte-18tlobi {flex:1;display:flex;gap:6px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;}.filter-state-track.svelte-18tlobi::-webkit-scrollbar {display:none;}
67
+
68
+ /* ── Pills ────────────────────────────── */.filter-state-pill.svelte-18tlobi {flex-shrink:0;scroll-snap-align:start;padding:6px 12px;border-radius:8px;border:none;cursor:pointer;font-family:inherit;font-size:var(--pill-font-size);font-weight:600;background-color:var(--sevn-color-neutral);color:var(--sevn-color-tertiary);transition:background-color 0.15s, color 0.15s;white-space:nowrap;line-height:1;}.filter-state-pill.svelte-18tlobi:hover:not(.active) {background-color:#e2e2ea;}.filter-state-pill.active.svelte-18tlobi {background-color:var(--pill-active-bg);color:var(--pill-active-color);}
69
+
70
+ /* ── Info row ─────────────────────────── */.filter-state-info.svelte-18tlobi {display:flex;align-items:baseline;gap:12px;font-size:0.875rem;color:var(--sevn-color-tertiary);}.filter-state-selected.svelte-18tlobi strong:where(.svelte-18tlobi) {font-weight:700;}.filter-state-clear.svelte-18tlobi {display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-left:2px;padding:0;vertical-align:middle;background:none;border:none;border-radius:50%;cursor:pointer;transition:background 0.15s;}.filter-state-clear.svelte-18tlobi:hover,
71
+ .filter-state-clear.svelte-18tlobi:focus-visible {background:rgba(0, 0, 0, 0.08);}.filter-state-meta.svelte-18tlobi {font-size:0.75rem;color:#9a9aaa;}`};function Ws(e,t){Kt(t,!0),pt(e,Vs);let r=z(t,"states",19,()=>[]),n=z(t,"value",15,null),a=z(t,"activeBackground",3,"var(--sevn-color-tertiary)"),l=z(t,"activeColor",3,"#fff"),i=z(t,"fontSize",3,"0.8125rem"),s=z(t,"showDescriptionSelection",3,!0),c=z(t,"clearable",3,!0),o=G(null),v=G(!1),p=G(!1);function u(){f(o)&&(E(v,f(o).scrollLeft>0),E(p,f(o).scrollLeft+f(o).clientWidth<f(o).scrollWidth-1))}Yt(()=>{if(!f(o))return;u(),f(o).addEventListener("scroll",u);const A=new ResizeObserver(u);return A.observe(f(o)),()=>{f(o).removeEventListener("scroll",u),A.disconnect()}});function _(){f(o)?.scrollBy({left:-160,behavior:"smooth"})}function h(){f(o)?.scrollBy({left:160,behavior:"smooth"})}const k=ce(()=>r().find(A=>A.value===n())?.label??null);var x=Ks(),j=m(x),g=m(j),U=m(g);{var J=A=>{var O=Ds();S(()=>H(O,"src",Nr)),w(A,O)},X=A=>{var O=Os();S(()=>H(O,"src",Fr)),w(A,O)};W(U,A=>{f(v)?A(J):A(X,!1)})}var R=D(g,2);pr(R,21,r,Ha,(A,O)=>{var le=Ns();let Q;var te=m(le);S(ee=>{Q=Be(le,1,"filter-state-pill svelte-18tlobi",null,Q,{active:n()===f(O).value}),$(te,ee)},[()=>f(O).value.toUpperCase()]),ge("click",le,()=>n(n()===f(O).value?null:f(O).value)),w(A,le)}),br(R,A=>E(o,A),()=>f(o));var L=D(R,2),Z=m(L);{var M=A=>{var O=Fs();S(()=>H(O,"src",Nr)),w(A,O)},Y=A=>{var O=js();S(()=>H(O,"src",Fr)),w(A,O)};W(Z,A=>{f(p)?A(M):A(Y,!1)})}var ae=D(j,2);{var ue=A=>{var O=qs(),le=m(O);{var Q=de=>{var Pe=Bs(),bt=D(m(Pe)),Er=D(bt);{var Sr=Ot=>{var N=Us(),ie=m(N);S(()=>H(ie,"src",wn)),ge("click",N,()=>n(null)),w(Ot,N)};W(Er,Ot=>{c()&&Ot(Sr)})}S(()=>$(bt,` ${f(k)??""} `)),w(de,Pe)};W(le,de=>{f(k)&&de(Q)})}var te=D(le,2);{var ee=de=>{var Pe=Hs(),bt=m(Pe);S(()=>$(bt,t.meta)),w(de,Pe)};W(te,de=>{t.meta&&de(ee)})}w(A,O)};W(ae,A=>{s()&&(f(k)||t.meta)&&A(ue)})}S(()=>{Zt(j,`--pill-active-bg: ${a()??""}; --pill-active-color: ${l()??""}; --pill-font-size: ${i()??""};`),g.disabled=!f(v),L.disabled=!f(p)}),ge("click",g,_),ge("click",L,h),w(e,x),Vt()}Rr(["click"]);var Gs=y('<span class="header-tag-above svelte-1xm1ks6"><!></span>'),Ys=y('<span class="header-tag-inline svelte-1xm1ks6"><!></span>'),Js=y('<p class="header-description svelte-1xm1ks6"> </p>'),Xs=y('<header class="header svelte-1xm1ks6"><!> <div class="header-title-row svelte-1xm1ks6"><h1 class="header-title svelte-1xm1ks6"> </h1> <!></div> <!></header>');const Zs={hash:"svelte-1xm1ks6",code:`.header.svelte-1xm1ks6 {display:flex;flex-direction:column;gap:4px;}.header-tag-inline.svelte-1xm1ks6 {display:none;}.header-title-row.svelte-1xm1ks6 {display:flex;align-items:center;gap:10px;}.header-title.svelte-1xm1ks6 {font-size:var(--header-title-font-size);font-weight:var(--header-title-font-weight);color:var(--sevn-color-tertiary);line-height:1.15;}.header-description.svelte-1xm1ks6 {font-size:var(--header-description-font-size);color:var(--sevn-color-tertiary);}
72
+
73
+ @media (max-width: 767px) {.header-title.svelte-1xm1ks6 {font-size:calc(var(--header-title-font-size) * 0.75);max-width:60%;}.header-description.svelte-1xm1ks6 {font-size:calc(var(--header-description-font-size) * 0.9);}
74
+ }
75
+
76
+ @media (min-width: 768px) {.header-tag-above.svelte-1xm1ks6 {display:none;}.header-tag-inline.svelte-1xm1ks6 {display:inline-flex;}
77
+ }`};function Qs(e,t){pt(e,Zs);var r=Xs(),n=m(r);{var a=u=>{var _=Gs(),h=m(_);xn(h,{get label(){return t.tag},get color(){return t.tagColor}}),w(u,_)};W(n,u=>{t.tag&&u(a)})}var l=D(n,2),i=m(l),s=m(i),c=D(i,2);{var o=u=>{var _=Ys(),h=m(_);xn(h,{get label(){return t.tag},get color(){return t.tagColor}}),w(u,_)};W(c,u=>{t.tag&&u(o)})}var v=D(l,2);{var p=u=>{var _=Js(),h=m(_);S(()=>$(h,t.description)),w(u,_)};W(v,u=>{t.description&&u(p)})}S(()=>{Zt(r,`
78
+ --header-title-font-size: ${t.titleFontSize??"1.75rem"??""};
79
+ --header-title-font-weight: ${t.titleFontWeight??700??""};
80
+ --header-description-font-size: ${t.descriptionFontSize??"0.875rem"??""};
81
+ `),$(s,t.title)}),w(e,r)}var $s=y('<div class="ranking-tag-row svelte-x90jc1"><span class="ranking-tag-position svelte-x90jc1"> </span> <!> <span class="ranking-tag-votes svelte-x90jc1"> </span></div>'),eo=y('<div class="ranking-tag svelte-x90jc1"></div>');const to={hash:"svelte-x90jc1",code:`.ranking-tag.svelte-x90jc1 {display:flex;flex-direction:column;width:100%;}.ranking-tag-row.svelte-x90jc1 {display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid var(--sevn-color-neutral, #EBEBEF);}.ranking-tag-row.svelte-x90jc1:last-child {border-bottom:none;}.ranking-tag-position.svelte-x90jc1 {font-size:0.9375rem;font-weight:700;color:var(--sevn-color-tertiary, #1C1C1C);min-width:28px;text-align:right;flex-shrink:0;}.ranking-tag-votes.svelte-x90jc1 {font-size:0.9375rem;font-weight:400;color:var(--sevn-color-tertiary, #1C1C1C);white-space:nowrap;}
82
+
83
+ /* Mobile */
84
+ @media (max-width: 640px) {.ranking-tag-row.svelte-x90jc1 {gap:10px;padding:12px 0;}.ranking-tag-position.svelte-x90jc1 {font-size:0.8125rem;min-width:24px;}.ranking-tag-votes.svelte-x90jc1 {font-size:0.8125rem;}
85
+ }`};function ro(e,t){pt(e,to);let r=z(t,"items",19,()=>[]),n=z(t,"voteLabel",3,"Votos");function a(i){return i.toLocaleString("pt-BR")}var l=eo();pr(l,21,r,i=>i.position,(i,s)=>{var c=$s(),o=m(c),v=m(o),p=D(o,2);{let h=ce(()=>f(s).tagColor??"#1C1C1C");xn(p,{get label(){return f(s).tag},get color(){return f(h)}})}var u=D(p,2),_=m(u);S(h=>{$(v,`${f(s).position??""}°`),$(_,`${h??""} ${n()??""}`)},[()=>a(f(s).votes)]),w(i,c)}),w(e,l)}class Ja{constructor(t={}){var r,n,a;this.inflight=new Map,this.tick=0,this.storageKey=(r=t.storageKey)!==null&&r!==void 0?r:"reqcache",this.maxEntries=(n=t.maxEntries)!==null&&n!==void 0?n:100,this.storage=(a=t.storage)!==null&&a!==void 0?a:ao()}async getFetch(t,r,n={}){const a=Date.now(),l=this.readAll(),i=l.find(o=>o.rota===t);if(i&&a<i.expiresAt)return i.lastAccess=this.nextAccess(),this.writeAll(l),i.data;const s=this.inflight.get(t);if(s)return s;const c=this.revalidate(t,r,n,i??null).finally(()=>this.inflight.delete(t));return this.inflight.set(t,c),c}invalidate(t){const r=this.readAll().filter(n=>n.rota!==t);this.writeAll(r)}cleanup(t=3600){const r=Date.now()-t*1e3,n=this.readAll(),a=n.filter(l=>l.expiresAt>r);return this.writeAll(a),n.length-a.length}clear(){if(this.storage)try{this.storage.removeItem(this.storageKey)}catch{}}nextAccess(){return this.tick=Math.max(Date.now(),this.tick+1),this.tick}async revalidate(t,r,n,a){var l,i;const s=(l=n.fetcher)!==null&&l!==void 0?l:fetch;let c;try{const v=await s(t,n.fetchOptions);if(!v.ok)throw new Error(`HTTP ${v.status} ao buscar ${t}`);c=await v.json()}catch(v){if(a&&(!((i=n.staleOnError)!==null&&i!==void 0)||i))return this.upsert({...a,expiresAt:Date.now()+r,lastAccess:this.nextAccess()}),a.data;throw v}if(a&&n.monotonicKey){const v=Xa(a.data,n.monotonicKey),p=Xa(c,n.monotonicKey);if(typeof v=="number"&&typeof p=="number"&&p<=v)return this.upsert({...a,expiresAt:Date.now()+r,lastAccess:this.nextAccess()}),a.data}const o=Date.now();return this.upsert({rota:t,data:c,createdAt:o,expiresAt:o+r,lastAccess:this.nextAccess()}),c}upsert(t){const r=this.readAll().filter(n=>n.rota!==t.rota);r.push(t),this.evictIfNeeded(r),this.writeAll(r)}evictIfNeeded(t){for(;t.length>this.maxEntries;){let r=0;for(let n=1;n<t.length;n++)t[n].lastAccess<t[r].lastAccess&&(r=n);t.splice(r,1)}}readAll(){if(!this.storage)return[];try{const t=this.storage.getItem(this.storageKey);if(!t)return[];const r=JSON.parse(t);return Array.isArray(r)?r:[]}catch{return[]}}writeAll(t){if(this.storage)try{this.storage.setItem(this.storageKey,JSON.stringify(t))}catch(r){if(no(r)&&t.length>0){const n=[...t].sort((a,l)=>a.lastAccess-l.lastAccess);n.splice(0,Math.ceil(n.length/2));try{this.storage.setItem(this.storageKey,JSON.stringify(n))}catch{}}}}}function Xa(e,t){return t.split(".").reduce((r,n)=>{if(r&&typeof r=="object"&&n in r)return r[n]},e)}function no(e){return e instanceof Error&&(e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")}function ao(){try{if(typeof localStorage<"u"){const e="__reqcache_probe__";return localStorage.setItem(e,"1"),localStorage.removeItem(e),localStorage}}catch{}return null}new Ja;const lo=300,yn=new Map;function kn(){try{return typeof window<"u"&&typeof localStorage<"u"}catch{return!1}}const io={getItem(e){return kn()?localStorage.getItem(e):yn.get(e)??null},setItem(e,t){if(kn())try{localStorage.setItem(e,t)}catch{console.warn("[api] Cota do localStorage excedida, ignorando escrita")}else yn.set(e,t)},removeItem(e){kn()?localStorage.removeItem(e):yn.delete(e)}};let En=null;function so(){if(!En){const{storageKey:e,maxEntries:t}=sr().cache;En=new Ja({storage:io,storageKey:e,maxEntries:t})}return En}async function oo(e,t,r=lo,n){const[a]=Nn(),l=e.replace(/^\/+/,""),i=new URL(l,`${a.replace(/\/+$/,"")}/`);let s;try{s=await so().getFetch(i.toString(),r*1e3,{monotonicKey:n,fetcher:hl})}catch(c){throw c instanceof Error&&/^HTTP 404 /.test(c.message)?new Error("Dados ainda não publicados"):c}if(s&&typeof s=="object"&&s.published===!1)throw new Error(s.reason??"Dados ainda não publicados");return s}function co(e,t,r,n){return oo(`v1/elections/${e}/r${r}/${t}/uf/${n.toUpperCase()}/by-party.json`)}function fo(e){if(typeof e=="string"){const r=e.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2}))?/);if(r)return new Date(Date.UTC(Number(r[1]),Number(r[2])-1,Number(r[3]),Number(r[4]),Number(r[5]),Number(r[6]??0)))}const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Za(e){if(e==null||e==="")return"";const t=fo(e);if(!t)return"";const r=String(t.getUTCDate()).padStart(2,"0"),n=String(t.getUTCMonth()+1).padStart(2,"0"),a=t.getUTCFullYear(),l=String(t.getUTCHours()).padStart(2,"0"),i=String(t.getUTCMinutes()).padStart(2,"0");return`${r}/${n}/${a} às ${l}h${i}`}function Qa(e,t="TSE"){const r=Za(e);return r?`Atualizado em ${r} | Fonte ${t}`:`Fonte ${t}`}Za("2022-10-31T00:18:00Z");const uo=Qa("2022-10-31T00:18:00Z");var vo=y('<div class="sevn_party_perf__selection-info svelte-176mhm6"><span class="svelte-176mhm6"><strong class="svelte-176mhm6">Você selecionou:</strong> </span> <span class="sevn_party_perf__selection-meta svelte-176mhm6"> </span></div>'),ho=y('<p class="sevn_party_perf__status svelte-176mhm6">Carregando...</p>'),po=y('<p class="sevn_party_perf__status sevn_party_perf__status--error svelte-176mhm6"> </p>'),_o=y('<div class="sevn_party_perf__body svelte-176mhm6"><div class="sevn_party_perf__chart-col svelte-176mhm6"><!></div> <div class="sevn_party_perf__ranking-col svelte-176mhm6"><!></div></div>'),go=y('<div><!> <div class="sevn_party_perf__filters-row-web svelte-176mhm6"><!></div> <div class="sevn_party_perf__filter-web svelte-176mhm6"><!></div> <!> <div class="sevn_party_perf__filters-mobile svelte-176mhm6"><!> <p class="sevn_party_perf__filter-section-label svelte-176mhm6">Filtrar por:</p> <!></div> <!></div>');const bo={hash:"svelte-176mhm6",code:`.sevn_party_perf.svelte-176mhm6 {display:flex;flex-direction:column;gap:24px;}.sevn_party_perf--raw.svelte-176mhm6,
86
+ .sevn_party_perf--raw.svelte-176mhm6 :where(.svelte-176mhm6) {all:revert;}.sevn_party_perf__status.svelte-176mhm6 {font-size:0.875rem;color:var(--sevn-color-text-secondary, #6b7280);}.sevn_party_perf__status--error.svelte-176mhm6 {color:#e11d48;}
87
+
88
+ /* ── Web (oculto no mobile) ─────────────────────────── */.sevn_party_perf__filter-web.svelte-176mhm6 {display:none;}.sevn_party_perf__filters-row-web.svelte-176mhm6 {display:none;}
89
+
90
+ /* ── Mobile (visível por padrão) ────────────────────── */.sevn_party_perf__filters-mobile.svelte-176mhm6 {display:flex;flex-direction:column;gap:8px;}.sevn_party_perf__filter-section-label.svelte-176mhm6 {font-size:0.875rem;font-weight:600;color:var(--sevn-color-tertiary);margin:8px 0 0;}.sevn_party_perf__body.svelte-176mhm6 {display:flex;flex-direction:column;gap:24px;}
91
+
92
+ @media (max-width: 767px) {.sevn_party_perf.svelte-176mhm6 .dropdown {position:static;margin-top:10px;}
93
+ }
94
+
95
+ /* ── Info seleção (web only) ────────────────────────── */.sevn_party_perf__selection-info.svelte-176mhm6 {display:none;}
96
+
97
+ /* ── Desktop overrides ──────────────────────────────── */
98
+ @media (min-width: 768px) {.sevn_party_perf__filter-web.svelte-176mhm6 {display:block;}.sevn_party_perf__filters-row-web.svelte-176mhm6 {display:flex;gap:40px;align-items:flex-start;}.sevn_party_perf__filters-mobile.svelte-176mhm6 {display:none;}.sevn_party_perf__selection-info.svelte-176mhm6 {display:flex;align-items:center;gap:16px;font-size:0.8125rem;color:var(--sevn-color-tertiary);}.sevn_party_perf__selection-meta.svelte-176mhm6 {font-size:0.75rem;opacity:0.5;}.sevn_party_perf__body.svelte-176mhm6 {flex-direction:row;align-items:flex-start;gap:40px;}.sevn_party_perf__chart-col.svelte-176mhm6 {flex:3;min-width:0;align-self:flex-end;}.sevn_party_perf__ranking-col.svelte-176mhm6 {flex:2;min-width:0;}
99
+ }`};function mo(e,t){Kt(t,!0),pt(e,bo);let r=z(t,"mock",3,!1),n=z(t,"rawStyle",3,!1),a=z(t,"year",3,2026),l=z(t,"header",19,()=>({title:"Desempenho por Partido (senador/deputado)",description:"Acompanhe a distribuição de votos por partido, comparando desempenho eleitoral, força regional e evolução da apuração em tempo real."})),i=G(null),s=G(!1),c=G(null);const o=[{value:"ac",label:"Acre AC"},{value:"al",label:"Alagoas AL"},{value:"ap",label:"Amapá AP"},{value:"am",label:"Amazonas AM"},{value:"ba",label:"Bahia BA"},{value:"ce",label:"Ceará CE"},{value:"df",label:"Distrito Federal DF"},{value:"es",label:"Espírito Santo ES"},{value:"go",label:"Goiás GO"},{value:"ma",label:"Maranhão MA"},{value:"mg",label:"Minas Gerais MG"},{value:"ms",label:"Mato Grosso do Sul MS"},{value:"mt",label:"Mato Grosso MT"},{value:"pa",label:"Pará PA"},{value:"pb",label:"Paraíba PB"},{value:"pe",label:"Pernambuco PE"},{value:"pi",label:"Piauí PI"},{value:"pr",label:"Paraná PR"},{value:"rj",label:"Rio de Janeiro RJ"},{value:"rn",label:"Rio Grande do Norte RN"},{value:"ro",label:"Rondônia RO"},{value:"rr",label:"Roraima RR"},{value:"rs",label:"Rio Grande do Sul RS"},{value:"sc",label:"Santa Catarina SC"},{value:"se",label:"Sergipe SE"},{value:"sp",label:"São Paulo SP"},{value:"to",label:"Tocantins TO"}],v=[{value:"federal_deputy",label:"Deputado Federal"},{value:"state_deputy",label:"Deputado Estadual"},{value:"senator",label:"Senador"}];let p=G(null),u=G(Ct(v[0].value));const _={federal_deputy:"federal_deputy",state_deputy:"state_deputy",senator:"senator"};Yt(()=>{if(!r()&&f(p)&&f(u).trim()){const N=_[f(u)]||"federal_deputy";E(s,!0),E(c,null),E(i,null),co(a(),N,1,f(p)).then(ie=>{E(i,ie,!0),E(s,!1)}).catch(ie=>{console.error("Failed to fetch party results:",ie),E(c,"Failed to load data"),E(s,!1)})}});let h=ce(()=>o.find(N=>N.value===f(p))?.label??null);const k=[{label:"Partido ABC",value:32,color:"#166534"},{label:"Partido DEF",value:24,color:"#d97706"},{label:"Partido GHI",value:11,color:"#1e3461"},{label:"Partido JKL",value:8,color:"#1C1C1C"},{label:"Partido MNO",value:20,color:"#e11d48"},{label:"Partido PQR",value:5,color:"#15803d"},{label:"Partido STU",value:3,color:"#dc2626"},{label:"Partido VWX",value:2,color:"#7c2d12"}],x=[{position:1,tag:"ABC",tagColor:"#166534",votes:20526},{position:2,tag:"DEF",tagColor:"#d97706",votes:18022},{position:3,tag:"GHI",tagColor:"#1e3461",votes:13302},{position:4,tag:"JKL",tagColor:"#1C1C1C",votes:13257},{position:5,tag:"MNO",tagColor:"#e11d48",votes:11789},{position:6,tag:"PQR",tagColor:"#15803d",votes:11647},{position:7,tag:"STU",tagColor:"#dc2626",votes:9526},{position:8,tag:"VWX",tagColor:"#7c2d12",votes:7478}],j=ce(()=>{if(!r()&&f(i)?.parties&&Array.isArray(f(i).parties)){const N=[...f(i).parties].sort((_e,st)=>st.votes-_e.votes),ie=N.map(_e=>({label:`Partido ${_e.party_abbr||""}`,value:_e.pct_with_blank_null??0,color:_e.party_color||"#ccc"})),Qe=N.map((_e,st)=>({position:st+1,tag:_e.party_abbr||"",tagColor:_e.party_color||"#ccc",votes:_e.votes??0}));return{barItems:ie,rankingItems:Qe}}return r()?{barItems:k,rankingItems:x}:{barItems:[],rankingItems:[]}}),g=ce(()=>r()?uo:Qa(f(i)?.last_updated)),U=ce(()=>f(j).barItems),J=ce(()=>f(j).rankingItems);let X=G(!1),R=ce(()=>f(X)?4:6),L=ce(()=>f(X)?80:86),Z=G(0),M=ce(()=>Math.max(f(Z)-64,150));bn(()=>{const N=window.matchMedia("(max-width: 480px)");E(X,N.matches,!0);const ie=Qe=>{E(X,Qe.matches,!0)};return N.addEventListener("change",ie),()=>N.removeEventListener("change",ie)});var Y=go();let ae;var ue=m(Y);Qs(ue,{get title(){return l().title},get description(){return l().description},get tag(){return l().tag},get tagColor(){return l().tagColor}});var A=D(ue,2),O=m(A);Rs(O,{label:"Cargo",get options(){return v},get value(){return f(u)},set value(N){E(u,N,!0)}});var le=D(A,2),Q=m(le);Ws(Q,{get states(){return o},showDescriptionSelection:!1,get meta(){return f(g)},get value(){return f(p)},set value(N){E(p,N,!0)}});var te=D(le,2);{var ee=N=>{var ie=vo(),Qe=m(ie),_e=D(m(Qe)),st=D(Qe,2),Cr=m(st);S(()=>{$(_e,` ${f(h)??""}`),$(Cr,f(g))}),w(N,ie)};W(te,N=>{f(h)&&N(ee)})}var de=D(te,2),Pe=m(de);{let N=ce(()=>f(p)?"Você selecionou:":"Selecione o estado:");Ya(Pe,{get label(){return f(N)},get options(){return o},get icon(){return mn},iconSize:13,get value(){return f(p)},set value(ie){E(p,ie,!0)}})}var bt=D(Pe,4);Ya(bt,{label:"Cargo:",showLabel:!1,showLabelInField:!0,labelAsPlaceholder:!0,showPlaceholderOnMobile:!0,get options(){return v},get value(){return f(u)},set value(N){E(u,N,!0)}});var Er=D(de,2);{var Sr=N=>{var ie=Ba(),Qe=ba(ie);{var _e=Ke=>{var b=ho();w(Ke,b)},st=Ke=>{var b=po(),C=m(b);S(()=>$(C,f(c))),w(Ke,b)},Cr=Ke=>{var b=_o(),C=m(b),q=m(C);Es(q,{get items(){return f(U)},unit:"%",get trackHeight(){return f(M)},get visibleCount(){return f(R)},get colWidth(){return f(L)}});var be=D(C,2),me=m(be);ro(me,{get items(){return f(J)}}),Gi(be,"clientHeight",ke=>E(Z,ke)),w(Ke,b)};W(Qe,Ke=>{f(s)?Ke(_e):f(c)?Ke(st,1):Ke(Cr,!1)})}w(N,ie)},Ot=ce(()=>f(p)&&f(u).trim());W(Er,N=>{f(Ot)&&N(Sr)})}S(()=>ae=Be(Y,1,"sevn_party_perf svelte-176mhm6",null,ae,{"sevn_party_perf--raw":n()})),w(e,Y),Vt()}const $a=Ji(mo,"PartyPerformance");return typeof window<"u"&&(window.SevnElections=Object.assign(window.SevnElections||{},{Core:_l,PartyPerformance:$a}),Zi()),$a}));