uni-answer-sheet 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -1,6 +1,6 @@
1
- var jM=Object.defineProperty;var Y1=nt=>{throw TypeError(nt)};var AM=(nt,ct,kt)=>ct in nt?jM(nt,ct,{enumerable:!0,configurable:!0,writable:!0,value:kt}):nt[ct]=kt;var cm=(nt,ct,kt)=>AM(nt,typeof ct!="symbol"?ct+"":ct,kt),X1=(nt,ct,kt)=>ct.has(nt)||Y1("Cannot "+kt);var Ut=(nt,ct,kt)=>(X1(nt,ct,"read from private field"),kt?kt.call(nt):ct.get(nt)),K1=(nt,ct,kt)=>ct.has(nt)?Y1("Cannot add the same private member more than once"):ct instanceof WeakSet?ct.add(nt):ct.set(nt,kt),um=(nt,ct,kt,zs)=>(X1(nt,ct,"write to private field"),zs?zs.call(nt,kt):ct.set(nt,kt),kt);var UniAnswerSheet=(function(nt){"use strict";var pt,un;function ct(t,r){for(var i=0;i<r.length;i++){const a=r[i];if(typeof a!="string"&&!Array.isArray(a)){for(const c in a)if(c!=="default"&&!(c in t)){const l=Object.getOwnPropertyDescriptor(a,c);l&&Object.defineProperty(t,c,l.get?l:{enumerable:!0,get:()=>a[c]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const kt=["pagination","content-identity","choice-fill","answer-regions","html-codec","status"];function zs(t){const r=t.filter(a=>a?.kind==="answer-sheet-editor");if(r.length!==1)throw new Error("请显式注册一个富文本插件:plugins: [createEditorPlugin()]");const i=r[0];if(i.apiVersion!==1||i.documentVersion!==1||kt.some(a=>!i.capabilities?.includes(a))||typeof i.prepare!="function"||typeof i.create!="function"||typeof i.validateDocument!="function"||typeof i.html?.parse!="function"||typeof i.html?.serialize!="function")throw new Error("富文本插件协议不兼容,需要支持制卡协议 v1 的 uni-editor/plugin");return i}function Bs(t){const r=[],i=a=>{if(a.type==="choiceGroup"){typeof a.attrs?.id=="string"&&r.push({id:a.attrs.id,label:a.attrs.label||String(r.length+1),options:(a.content||[]).map((c,l)=>({id:c.attrs?.id,label:String.fromCharCode(65+l)})).filter(c=>typeof c.id=="string")});return}a.content?.forEach(i)};return i(t.content),r}class Wc extends Error{constructor(r,i){super(i),this.path=r}}const $n=(t,r)=>{throw new Wc(t,r)},Hs={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",科学:"SCIENCE",物理:"PHYSICAL",化学:"CHEMICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",历史:"HISTORY",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",信息科技:"IT",信息技术:"IT",日语:"JAPANESE"},Q1={P:["语文","数学","英语","科学","道德与法治"],J:["语文","数学","英语","物理","化学","生物","地理","历史","道德与法治","信息科技"],S:["语文","数学","英语","物理","化学","生物","政治","历史","地理","信息技术","日语"]},F1=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三"].map((t,r)=>{const i=r<6?"P":r<9?"J":"S";return{label:t,value:`${i}0${r<6?r+1:(r-6)%3+1}`,classify:i}}),ta=(t,r)=>typeof t=="string"&&t.trim()?t.trim():$n(r,"字典编码和名称必须是非空字符串"),Ps=(t,r)=>t&&typeof t=="object"&&!Array.isArray(t)?t:$n(r,"字典必须是对象"),dm=t=>t.classify||(/^[PJS]/.test(t.value)?t.value[0]:void 0);function Jc(t={}){const r=Ps(t,"dictionaries"),i=(x,S)=>{if(!Array.isArray(x))return $n(S,"字典选项必须是数组");const w=new Set;return x.map((T,j)=>{const R=Ps(T,`${S}.${j}`),O=ta(R.value,`${S}.${j}.value`),M=ta(R.label,`${S}.${j}.label`);return w.has(O)&&$n(`${S}.${j}.value`,"字典编码重复"),w.add(O),{...R,value:O,label:M}})},a=i(r.grades===void 0?F1:r.grades,"dictionaries.grades").map((x,S)=>(x.classify!==void 0&&!["P","J","S"].includes(String(x.classify))&&$n(`dictionaries.grades.${S}.classify`,"学段为 P、J 或 S"),{value:x.value,label:x.label,classify:x.classify})),c=r.gradeCourseMap===void 0?void 0:Ps(r.gradeCourseMap,"dictionaries.gradeCourseMap"),l=r.courseCodeToSubjectCode===void 0?{}:Ps(r.courseCodeToSubjectCode,"dictionaries.courseCodeToSubjectCode");for(const[x,S]of Object.entries(l))ta(S,`dictionaries.courseCodeToSubjectCode.${x}`);const u=new Map,d=Object.fromEntries(a.map(x=>{const S=dm(x),w=(S?Q1[S]:[]).map(R=>({value:Hs[R],label:R,subjectCode:Hs[R]})),T=`dictionaries.gradeCourseMap.${x.value}`,j=i(c?c[x.value]??[]:w,T).map((R,O)=>{const M=l[R.value];R.subjectCode!==void 0&&M!==void 0&&R.subjectCode!==M&&$n(`${T}.${O}.subjectCode`,"课程对应的学科编码冲突");const D=ta(R.subjectCode??M??(Object.values(Hs).includes(R.value)?R.value:void 0),`${T}.${O}.subjectCode`);return u.has(R.value)&&u.get(R.value)!==D&&$n(`${T}.${O}.subjectCode`,"同一课程不能对应不同学科"),u.set(R.value,D),R.custom!==void 0&&typeof R.custom!="boolean"&&$n(`${T}.${O}.custom`,"custom 必须是布尔值"),{value:R.value,label:R.label,subjectCode:D,...R.custom===void 0?{}:{custom:R.custom}}});return[x.value,j]})),m=a.filter(x=>d[x.value].length),p=r.defaultGradeCode===void 0?void 0:ta(r.defaultGradeCode,"dictionaries.defaultGradeCode"),C=m.find(x=>x.value===p)?.value||m[0]?.value||"",g=r.defaultCourseCode===void 0?void 0:ta(r.defaultCourseCode,"dictionaries.defaultCourseCode"),b=d[C]||[],v=b.find(x=>x.value===g)?.value||b[0]?.value||"";return{grades:m,gradeCourseMap:d,defaultGradeCode:C,defaultCourseCode:v}}function hi(t,r,i){const a=t.grades.find(l=>l.value===r);if(!a)return $n("initialization.gradeCode","年级不在可用字典中");const c=t.gradeCourseMap[r]?.find(l=>l.value===i);return c?{grade:a.label,subject:c.label,gradeCode:r,courseCode:i,subjectCode:c.subjectCode,phaseCode:dm(a)}:$n("initialization.courseCode","当前年级没有此课程")}function fm(t,r={}){const a=t.grades.find(u=>u.value===r.gradeCode||!r.gradeCode&&u.label===r.grade)?.value||t.defaultGradeCode,c=t.gradeCourseMap[a]||[],l=c.find(u=>u.value===r.courseCode||!r.courseCode&&u.label===r.subject)?.value||(a===t.defaultGradeCode?t.defaultCourseCode:c[0]?.value)||"";return a&&l?hi(t,a,l):{grade:"",subject:"",gradeCode:"",courseCode:""}}function hm(t){return t?.subjectCode||Hs[t?.subject||""]}const bn={questions:200,options:12,score:15},Z1=t=>t.multiple?t.indefinite?"indefinite":"multiple":"single",Gn=t=>Number.isFinite(t)&&Number.isInteger(t*2),mi=t=>!!(hm(t)==="MATHS"&&(t?.phaseCode?t.phaseCode==="S":t?.gradeCode?t.gradeCode.startsWith("S"):/^高[一二三]/.test(t?.grade||"")));function W1(t){const r=typeof t.score=="number"&&Gn(t.score)&&t.score>=.5&&t.score<=bn.score?t.score:null,i=[...new Set(t.correctIds)].filter(a=>t.options.some(c=>c.id===a));return{...t,indefinite:!!(t.multiple&&t.indefinite),score:r,scoreType:t.multiple&&t.scoreType==="ITEM_SCORE"?"ITEM_SCORE":"LESS_SCORE",lessScore:t.multiple&&r!==null&&Gn(t.lessScore??0)?Math.max(0,Math.min(r,t.lessScore??0)):0,correctIds:t.multiple?i:i.slice(0,1)}}function eu(t,r,i){let a={...t};if(r.kind!==void 0){const c=r.kind!=="single";c&&!t.multiple&&(a.scoreType=mi(i)?"ITEM_SCORE":"LESS_SCORE",typeof a.score!="number"&&mi(i)&&(a.score=6)),a.multiple=c,a.indefinite=r.kind==="indefinite"}if(r.optionCount!==void 0){const c=Math.max(2,Math.min(bn.options,Math.round(r.optionCount)));a.options=Array.from({length:c},(l,u)=>t.options[u]||{id:crypto.randomUUID(),label:String.fromCharCode(65+u)})}return r.score!==void 0&&(a.score=r.score),r.scoreType!==void 0&&(a.scoreType=r.scoreType),r.lessScore!==void 0&&(a.lessScore=r.lessScore),W1(a)}function tu(t){return typeof t.score=="number"&&(!Gn(t.score)||t.score<.5||t.score>bn.score)?"每题分值须为 0.5–15 分,按 0.5 分递增":t.multiple&&t.scoreType==="LESS_SCORE"&&typeof t.score=="number"&&(!Gn(t.lessScore??0)||(t.lessScore??0)<0||(t.lessScore??0)>t.score)?"少选得分须为 0.5 的倍数,且不能超过本题分值":t.multiple&&t.scoreType==="ITEM_SCORE"&&typeof t.score=="number"&&t.correctIds.length&&!Gn(t.score/t.correctIds.length)?"答案个数与分值不匹配,每个正确选项的得分须为 0.5 的倍数":null}function J1(t){return t.multiple&&t.scoreType==="ITEM_SCORE"&&typeof t.score=="number"&&t.correctIds.length&&!tu(t)?t.score/t.correctIds.length:null}function nu(t){const r=t.map(c=>Number(c.label)).filter(c=>Number.isSafeInteger(c)&&c>0&&c<1e5);let i=String(Math.max(0,...r)+1);const a=new Set(t.map(c=>c.label));for(;a.has(i);)i=String(Number(i)+1);return i}function eS(t,r){const i=new Map(t.options.map(a=>[a.id,crypto.randomUUID()]));return{...t,id:crypto.randomUUID(),label:r,breakBefore:!1,contentTarget:null,options:t.options.map(a=>({...a,id:i.get(a.id)})),correctIds:t.correctIds.map(a=>i.get(a)).filter(Boolean)}}function mm(t,r,i){return i.trim()?t.some(a=>a.id!==r&&a.label.trim()===i.trim())?"题组内题号不能重复":null:"题号不能为空"}function tS(t,r,i,a){const c=t.questions.filter(m=>r.includes(m.id));if(!c.length)return{error:"请选择要修改的题目"};let l;if(i.type==="settings"){if(!Object.keys(i.patch).length)return{error:"请设置需要修改的属性"};const{optionCount:m,score:p,lessScore:C}=i.patch;if(m!==void 0&&(!Number.isInteger(m)||m<2||m>bn.options))return{error:"选项个数须为 2–12 的整数"};if(typeof p=="number"&&(!Gn(p)||p<.5||p>bn.score))return{error:"每题分值须为 0.5–15 分,按 0.5 分递增"};if(C!==void 0&&(!Gn(C)||C<0))return{error:"少选得分须为非负的 0.5 倍数"};if(l=c.map(g=>eu(g,i.patch,a)),C!==void 0&&l.some(g=>g.multiple&&g.scoreType!=="ITEM_SCORE"&&C>(g.score??0)))return{error:"少选得分不能超过所选题目的分值"}}else if(i.type==="numbering"){if(!Number.isInteger(i.start)||i.start<1||i.start+c.length-1>1e3)return{error:"连续题号须在 1–1000 内"};l=c.map((m,p)=>({...m,label:String(i.start+p)}))}else if(i.type==="average"){const m=i.total/c.length;if(!Gn(m)||m<.5||m>bn.score)return{error:"总分无法平均分配,每题须为 0.5–15 分且为 0.5 的倍数"};l=c.map(p=>eu(p,{score:m}))}else{const m=i.text.toUpperCase().trim().split(/[\s,,;;]+/).filter(Boolean);if(m.length!==c.length)return{error:`需要 ${c.length} 组答案,当前为 ${m.length} 组`};l=[];for(let p=0;p<c.length;p++){const C=c[p],g=m[p];if(g!=="-"&&(!/^[A-T]+$/.test(g)||new Set(g).size!==g.length||[...g].some(v=>!C.options.some(x=>x.label===v))))return{error:`第 ${C.label} 题包含无效或重复选项`};const b=g==="-"?[]:[...g].map(v=>C.options.find(x=>x.label===v).id);if(!C.multiple&&b.length>1)return{error:`第 ${C.label} 题为单选,只能设置一个答案`};l.push({...C,correctIds:b})}}const u=new Map(l.map(m=>[m.id,m])),d=t.questions.map(m=>u.get(m.id)||m);for(const m of l){const p=mm(d,m.id,m.label)||tu(m);if(p)return{error:`第 ${m.label} 题:${p}`}}return{value:{...t,questions:d}}}const nS={layout:"natural",columns:2,indent:!1,rowGap:0,columnGap:32,marker:"letter"},ru=t=>`question:${t}`,ou=t=>t.presentation==="stem"?"stem":["option","distributed"].includes(t.presentation)?"option":"concentrated";function au(t,r,i){const a=Bs(r),c=new Map,l=(d,m)=>{const p=d.attrs?.contentId||m;d.type==="choiceGroup"&&p&&c.set(d.attrs.id,p),d.content?.forEach(C=>l(C,p))};l(r.content);const u=new Set(t.questions.map(d=>d.contentTarget?.groupId));return{...t,presentation:i,questions:t.questions.map((d,m)=>{const p=a.find(C=>c.get(C.id)===d.id)||(c.size?void 0:a[m]);return i==="concentrated"||d.contentTarget!==void 0||!p||u.has(p.id)?d:(u.add(p.id),{...d,contentTarget:{groupId:p.id,optionIds:p.options.map(C=>C.id)}})})}}function na(t,r,i){const a=ou(t),c=new Map(Bs(r).map(b=>[b.id,b])),l=new Set,u=new Map,d=new Map,m=(b,v)=>{const x=b.attrs?.contentId||v;b.type==="choiceGroup"&&x&&(u.set(x,[...u.get(x)||[],b.attrs.id]),d.set(b.attrs.id,x)),b.type==="choiceStemAnchor"&&typeof b.attrs?.groupId=="string"&&l.add(b.attrs.groupId),b.content?.forEach(S=>m(S,x))};m(r.content);const p=[],C=new Set,g=t.questions.filter(b=>{if(!i||a==="concentrated")return!0;if(a==="stem"&&l.has(ru(b.id)))return p.push({groupId:ru(b.id),questionId:b.id,options:b.options.map(j=>({...j,contentOptionId:j.id}))}),!1;const v=u.get(b.id),x=v?.length===1?c.get(v[0]):void 0,S=x?{groupId:x.id,optionIds:x.options.map(j=>j.id)}:b.contentTarget,w=S&&c.get(S.groupId);if(!S||!w||C.has(w.id)||a==="stem"&&!l.has(w.id)||d.has(w.id)&&d.get(w.id)!==b.id)return!0;const T=S.optionIds.slice(0,b.options.length);return T.length!==b.options.length||new Set(T).size!==T.length||T.some(j=>!w.options.some(R=>R.id===j))?!0:(C.add(w.id),p.push({groupId:w.id,questionId:b.id,options:b.options.map((j,R)=>({...j,contentOptionId:T[R]}))}),!1)});return{position:a==="concentrated"?void 0:a,bindings:p,concentrated:{...t,questions:g}}}function ra(t,r=4){return{id:crypto.randomUUID(),label:String(t+1),multiple:!1,indefinite:!1,score:null,scoreType:"LESS_SCORE",lessScore:0,correctIds:[],breakBefore:!1,options:Array.from({length:r},(i,a)=>({id:crypto.randomUUID(),label:String.fromCharCode(65+a)}))}}function iu(t=8){return{source:"manual",presentation:"concentrated",direction:"row",rowsPerColumn:5,marker:"box",rowGap:0,columnGap:0,questions:Array.from({length:t},(r,i)=>ra(i))}}function su(t){return new Set(t.questions.map(r=>r.options.length)).size>1?"column":t.direction}function rS(t){const r=[];for(const i of t.questions){const a=r.at(-1);(!a||a.length>=t.rowsPerColumn||i.breakBefore||a[0].options.length!==i.options.length)&&r.push([]),r[r.length-1].push(i)}return r}function oS(t){const r=[];for(const i of rS(t))(!r.length||i[0].breakBefore)&&r.push([]),r[r.length-1].push(i);return r}const aS={judge:"判断题",fill:"填空题",answer:"解答题",calculation:"计算/证明",matching:"信息匹配/连线",ordering:"排序/分类",correction:"改错题",drawing:"作图题",table:"表格填答",writing:"语文作文",english:"外语写作",reading:"阅读理解",cloze:"完形填空",completion:"语法填空",chunk:"断句题",composite:"材料/复合题",optional:"选做题组",practice:"实践评价"},iS={choice:"选择",judge:"判断",fill:"填空",answer:"简答",calculation:"计算/证明",correction:"改错",drawing:"作图",table:"表格",writing:"作文",english:"外语写作"},pm=["reading","cloze","completion","composite","optional"],$t=()=>({version:1,content:{type:"doc",content:[{type:"paragraph"}]}}),gm={symbols:["√","×"],letters:["T","F"],words:["正确","错误"]},Us=t=>["writing","english"].includes(t)?70:["answer","calculation","drawing","table","correction"].includes(t)?60:15,ym=t=>t==="judge"?200:t==="fill"?50:["reading","cloze","completion"].includes(t)?20:t==="matching"?9:100;function bm(t=0){return{id:crypto.randomUUID(),label:String(t+1),width:50,style:"line",characters:6,score:null,answers:[],prefix:"",suffix:"",breakAfter:!1}}function lu(t,r="1"){const i=crypto.randomUUID();return{id:i,label:r,kind:t,document:$t(),reference:$t(),explanation:$t(),score:null,choice:{...ra(0,t==="judge"?2:4),id:i,label:r},presentation:"concentrated",blanks:[bm()],steps:[],needsReason:!1,judgment:null,targets:[],area:{style:t==="writing"?"characters":t==="english"?"lines":t==="drawing"?"grid":"blank",rows:t==="writing"?20:6,columns:20,rowHeight:t==="writing"?40:28,wordMark:100,title:!1,backgroundUrl:""}}}function cu(t){return["reading","cloze","chunk"].includes(t)?"choice":["matching","completion"].includes(t)?"fill":["ordering","composite","optional","practice"].includes(t)?"answer":t}function sS(t){return{items:[lu(cu(t))],judgeLabels:"symbols",fillNewLine:!0,pool:[],relation:"one",reuseOptions:!0,matchingDisplay:"letters",ordering:"sequence",sequence:[],categories:[],assignments:{},chooseCount:1,groupScore:null,chunkText:"",chunkPoints:[],chunkCorrect:[],chunkMax:3,chunkScore:null,attachmentUrl:""}}function Ir(t){return String(Math.max(0,...t.map(r=>/^\d+$/.test(r.label)?Number(r.label):0))+1)}function vo(t){const r=structuredClone(t),i=new Map,a=l=>{!l||typeof l!="object"||Object.entries(l).forEach(([u,d])=>{["id","answerId"].includes(u)&&typeof d=="string"?i.set(d,crypto.randomUUID()):a(d)})};a(r);const c=l=>typeof l=="string"?i.get(l)||l:Array.isArray(l)?l.map(c):l&&typeof l=="object"?Object.fromEntries(Object.entries(l).map(([u,d])=>[i.get(u)||u,c(d)])):l;return c(r)}function lS(t,r){const i=vo(t);return{...i,label:r,choice:{...i.choice,label:r}}}function oa(t,r,i){const a=t.findIndex(u=>u.id===r),c=a+i;if(a<0||c<0||c>=t.length)return t;const l=[...t];return l.splice(c,0,...l.splice(a,1)),l}function cS(t,r){return{...t,pool:t.pool.filter(i=>i.id!==r),sequence:t.sequence.filter(i=>i!==r),assignments:Object.fromEntries(Object.entries(t.assignments).filter(([i])=>i!==r)),items:t.items.map(i=>({...i,targets:i.targets.filter(a=>a!==r)}))}}function uS(t,r,i){const a=[...new Set(i)].filter(l=>t.pool.some(u=>u.id===l)),c=t.relation==="one"?a.slice(-1):a;return{...t,items:t.items.map(l=>l.id===r?{...l,targets:c}:t.reuseOptions?l:{...l,targets:l.targets.filter(u=>!c.includes(u))})}}function dS(t,r){let i=0;for(;i<r.length&&i<t.chunkText.length&&r[i]===t.chunkText[i];)i++;let a=0;for(;a<r.length-i&&a<t.chunkText.length-i&&r[r.length-1-a]===t.chunkText[t.chunkText.length-1-a];)a++;const c=t.chunkText.length-a,l=new Set,u=t.chunkPoints.filter(d=>d.offset<=i||d.offset>=c).map(d=>({...d,offset:d.offset<=i?d.offset:d.offset+r.length-t.chunkText.length})).filter(d=>d.offset<=0||d.offset>=r.length||l.has(d.offset)?!1:(l.add(d.offset),!0));return{...t,chunkText:r,chunkPoints:u,chunkCorrect:t.chunkCorrect.filter(d=>u.some(m=>m.id===d))}}function fS(t,r){const i=[],a=t.items.map(c=>c.label.trim());(a.some(c=>!c)||new Set(a).size!==a.length)&&i.push("题号不能为空或重复");for(const c of t.items){c.score!==null&&(!Number.isFinite(c.score)||c.score<.5||c.score>Us(c.kind)||!Number.isInteger(c.score*2))&&i.push(`${c.label} 题分值超出范围或不是 0.5 的倍数`);const u=(c.kind==="fill"?c.blanks:c.steps).map(d=>d.score);u.length&&c.score!==null&&u.every(d=>d!==null)&&u.reduce((d,m)=>d+(m||0),0)!==c.score&&i.push(`${c.label} 题分项分值之和与题分不一致`)}if(["matching","ordering"].includes(r)){const c=t.pool.map(l=>l.label.trim());(c.some(l=>!l)||new Set(c).size!==c.length)&&i.push("共享选项编号不能为空或重复")}return r==="optional"&&t.chooseCount>t.items.length&&i.push("选做数量不能超过题目数量"),r==="chunk"&&t.chunkCorrect.length>t.chunkMax&&i.push("正确断点数不能超过最多选择数"),i}function hS(t=3,r=3){return{version:1,content:{type:"doc",content:[{type:"table",content:Array.from({length:t},()=>({type:"tableRow",content:Array.from({length:r},()=>({type:"tableCell",content:[{type:"paragraph"}]}))}))}]}}}function xn(t){const r=i=>!!(i.text||i.type&&!["doc","paragraph","choiceStemAnchor"].includes(i.type)||i.content?.some(r));return!r(t.content)}const xm={choice:"选择题",area:"空白区域",...aS};function mS(t){return{id:crypto.randomUUID(),kind:"area",areaType:t,title:t==="forbiden"?"禁止答题区":"空白答题区",answerHeight:t==="forbiden"?100:200,document:{version:1,content:{type:"doc",content:t==="forbiden"?["请勿在此区域作答","或者做任何标记"].map(r=>({type:"paragraph",attrs:{textAlign:"center",lineSpacing:0},content:[{type:"text",text:r}]})):[{type:"paragraph"}]}}}}function vm(){return{version:1,title:"",questionCard:!1,preset:"a3-two",margin:15,gap:10,blocks:[]}}function pS(t=""){return{id:crypto.randomUUID(),height:70,document:{version:1,content:{type:"doc",content:[{type:"paragraph",attrs:{textAlign:"center",lineSpacing:9},...t?{content:[{type:"text",text:t,marks:[{type:"textStyle",attrs:{fontFamily:"SimSun, 宋体, serif",fontSize:"22px"}}]}]}:{}}]}}}}function uu(t){return{...vm(),title:t.name,creation:t,paperTitle:pS(t.name),header:{focusText:!0,writeKaohao:!1,missExam:!1,mifeng:!1,kaohao:"school",weishu:8}}}function So(t,r=96){return t*r/25.4}const pi={a4:{label:"A4 单栏",width:210,height:297,columns:1},"a3-two":{label:"A3 双栏",width:420,height:297,columns:2},"a3-three":{label:"A3 三栏",width:420,height:297,columns:3}},Co=44,gi=16;function du(t,r){const i=pi[t.preset],a=So(i.width),c=So(i.height),l=So(t.margin),u=So(t.gap),d=t.usage!=="homework"&&t.header?.mifeng?So(t.header.kaohao==="code"?26:14):0,m=a-l*2-d,p=(m-u*(i.columns-1))/i.columns,C=Math.max(l,t.header?t.recognition?.examQrCode?64:39:0),g=Math.max(l,t.header?56:0),b=c-C-g,v=b-gi,x=t.header?p:m,S=r&&r.id===t.paperTitle?.id&&Math.abs(r.width-x)<1?r:void 0,w=t.paperTitle?Math.min(b,S?.height??t.paperTitle.height+(t.header?260:gi)):0,T=(M,D=0)=>!!t.paperTitle&&(t.header?M%2===0&&D===0:M===0),j=(M,D=0)=>T(M,D)?w:0;return{...i,width:a,height:c,margin:l,topInset:C,bottomInset:g,gap:u,sealWidth:d,contentWidth:m,contentHeight:b,columnWidth:p,columnX:(M,D)=>l+(M%2===0?d:0)+D*(p+u),titleWidth:x,titleMaxHeight:v,hasHeader:T,headerHeight:j,capacity:(M,D=0)=>b-j(M,D)}}function gS(t,r,i){const a=du(t,i);let c=0,l=0,u=0;const d=()=>{l++,l===a.columns&&(l=0,c++),u=0},m=t.blocks.map(C=>{const g=r[C.id],b=g&&Math.abs(g.width-a.columnWidth)<1?g.height:100+C.answerHeight,v=g&&Math.abs(g.width-a.columnWidth)<1?[...new Set([...g.breaks||[],b].filter(O=>Number.isFinite(O)&&O>0&&O<=b))].sort((O,M)=>O-M):[],x=C.reference?.type==="CCOMPOSITION",S=O=>x&&O>0?Math.max(0,6-Math.max(0,(g?.compositionStart||0)-O)):0;if(v.length>1&&v.every((O,M)=>{const D=v[M-1]||0;return O-D+S(D)<=a.capacity(1)+.5})){const O=[];let M=0;for(;M<b-.5;){const _=a.capacity(c,l)-u,I=M,z=S(M),H=Y=>g?.markingFrames?.some(U=>U.from>=I-.5&&U.from<Y-.5&&U.to>Y+.5)?22:0,L=v.filter(Y=>Y>I+.5&&Y+H(Y)<=I+_-z+.5).at(-1);if(L===void 0){d();continue}const $=x&&L<b-.5?Math.max(H(L),_-z-(L-M)):H(L);O.push({page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Co)+a.topInset+a.headerHeight(c,l)+u,from:M,to:L,...z?{topPadding:z}:{},...$?{bottomPadding:$}:{}}),u+=L-M+z,M=L,M<b-.5&&d()}u+=gi;const D=O[0];return{id:C.id,...D,height:b,available:a.capacity(D.page,D.column),overflowing:!1,fragments:O}}for(;u+b>a.capacity(c,l)+.5&&(u>0||a.headerHeight(c,l)>0);)d();const T=a.capacity(c,l),j=b>T+.5,R={id:C.id,page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Co)+a.topInset+a.headerHeight(c,l)+u,height:b,available:T,overflowing:j,fragments:[{page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Co)+a.topInset+a.headerHeight(c,l)+u,from:0,to:Math.min(b,T)}]};return u+=Math.min(b,T)+gi,R}),p=new Map;return m.forEach((C,g)=>C.fragments.forEach(b=>{const v=`${b.page}/${b.column}`,x=p.get(v)||[];x.push({fragment:b,placement:C,blockIndex:g}),p.set(v,x)})),p.forEach(C=>{const g=C.filter(S=>["answer","writing","english","composite","area"].includes(t.blocks[S.blockIndex].kind)).at(-1);if(!g||t.blocks[g.blockIndex].reference?.type!=="CCOMPOSITION"&&t.blocks[g.blockIndex].kind!=="area")return;const b=C.at(-1).fragment,x=b.page*(a.height+Co)+a.height-a.bottomInset-b.y-(b.to-b.from)-(b.topPadding||0)-(b.bottomPadding||0);x<=0||x>30||(g.fragment.bottomPadding=(g.fragment.bottomPadding||0)+x,C.slice(C.indexOf(g)+1).forEach(({fragment:S,placement:w})=>{S.y+=x,w.fragments[0]===S&&(w.y=S.y)}))}),{geometry:a,placements:m,pageCount:c+1}}function yi(t,r){return{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:`${t}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]},...r?[{type:"text",text:`(${r}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}]:[]]}]}}}function vn(t,r,i){const a=c=>{if(!c.content)return c;let l;const u=c.content.flatMap(m=>{const p=m.type==="text"&&m.marks?.find(b=>b.type==="documentLabel")?.attrs?.kind,C=p&&p===l;if(l=p,C)return[];if(!p)return[a(m)];const g=p==="number"?`${r}.`:i?`(${i}分)`:"";return g?[{...m,text:g}]:[]}),d=u.findIndex(m=>m.marks?.some(p=>p.type==="documentLabel"&&p.attrs?.kind==="number"));return i&&d>=0&&!u.some(m=>m.marks?.some(p=>p.type==="documentLabel"&&p.attrs?.kind==="score"))&&u.splice(d+1,0,{type:"text",text:`(${i}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}),{...c,content:u}};return{...t,content:a(t.content)}}const nr={SCHOICE:"单选题",MCHOICE:"多选题",JUDGE:"判断题",FILLBLANK:"填空题",SHORTANSWER:"解答题",MIXED:"复合题",CLOZE:"完形填空",READTHENANSWER:"阅读理解",INFO_MATCHING:"信息匹配",TEXT_COMPLETION:"语法填空",ECOMPOSITION:"英语作文",CCOMPOSITION:"语文作文",CHUNK_CHOICE:"断句题"},Sm=["SCHOICE","MCHOICE","JUDGE","FILLBLANK","SHORTANSWER","MIXED"];function Cm(t,r=!1){const i=hm(t),a=r?Sm.filter(c=>c!=="MIXED"):Sm;return r?["CHINESE","JAPANESE"].includes(i||"")?[...a,"CHUNK_CHOICE"]:a:i==="CHINESE"?[...a,"CCOMPOSITION","CHUNK_CHOICE"]:i==="ENGLISH"?[...a,"CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION","ECOMPOSITION"]:i==="JAPANESE"?Object.keys(nr):["POLITICAL","HISTORY"].includes(i||"")?[...a,"CCOMPOSITION"]:a}const yS=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),bS=t=>["SCHOICE","MCHOICE","CLOZE","READTHENANSWER","INFO_MATCHING","JUDGE"].includes(t),kr=t=>({version:1,content:{type:"doc",content:t.length?t:[{type:"paragraph"}]}});function bi(t,r,i=!1){return{content:$t(),numbered:!i,groupId:`options:${r.id}`,layout:{...nS,columns:t==="CLOZE"?4:2,...t==="READTHENANSWER"?{layout:"fixed",columnGap:0}:{}},itemsContent:!i&&bS(t)?r.options.map(a=>({id:a.id,key:a.label,content:$t()})):[]}}const $s=t=>{if(t.type==="choiceStemAnchor"||t.type==="text"&&t.marks?.some(a=>a.type==="documentLabel"&&a.attrs?.kind==="number"))return null;const{contentId:r,...i}=t.attrs||{};return{...t,...t.attrs?{attrs:i}:{},...t.content?{content:t.content.map($s).filter(a=>a!==null)}:{}}};function Gs(t,r,i){const c=(t.content.content.content||[{type:"paragraph"}]).map(l=>({...l,attrs:{...l.attrs,contentId:r}}));if(t.numbered){const l={type:"text",text:`${i}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]};["paragraph","heading"].includes(c[0]?.type||"")||c.unshift({type:"paragraph",attrs:{contentId:r},content:[]}),c[0]={...c[0],content:[l,...c[0].content||[]]}}return t.itemsContent.length&&c.push({type:"choiceGroup",attrs:{id:t.groupId,contentId:r,...t.layout},content:t.itemsContent.map(l=>({type:"choiceOption",attrs:{id:l.id,label:l.key,sourceKey:l.key,marker:"letter"},content:l.content.content.content||[{type:"paragraph"}]}))}),c}function wm(t,r){const i=r.filter(d=>d.type==="choiceGroup"),a=i.find(d=>d.attrs?.id===t.groupId)||(i.length===1?i[0]:void 0),c=r.filter(d=>d!==a);let l=!1;const u=d=>{d.marks?.some(m=>m.type==="documentLabel"&&m.attrs?.kind==="number")&&(l=!0),d.content?.forEach(u)};return c.forEach(u),{...t,numbered:l,content:kr(c.map($s).filter(d=>d!==null)),groupId:a?.attrs?.id||t.groupId,layout:a?Object.fromEntries(Object.entries(t.layout).map(([d,m])=>[d,a.attrs?.[d]??m])):t.layout,itemsContent:(a?.content||[]).map((d,m)=>({id:d.attrs?.id||t.itemsContent[m]?.id||crypto.randomUUID(),key:d.attrs?.label||String.fromCharCode(65+m),content:kr((d.content||[]).map($s).filter(p=>p!==null))}))}}function Em(t,r,i,a){const c=new Map;r.content.content?.forEach(d=>{d.attrs?.contentId&&c.set(d.attrs.contentId,[...c.get(d.attrs.contentId)||[],d])});const l=new Set(a?.content.content?.map(d=>d.attrs?.contentId).filter(Boolean)),u=(d,m)=>m&&(c.has(d)||l.has(d))?wm(m,c.get(d)||[]):m;return{...t,...c.has(i)?{material:kr(c.get(i).map(d=>$s(d)))}:{},questions:t.questions.map(d=>({...d,text:u(d.id,d.text),parts:d.parts.map(m=>({...m,text:u(m.id,m.text)}))}))}}function fu(t){const r=t.reference,i=[];r.type==="MIXED"&&i.push(...(r.material||$t()).content.content.map(c=>({...c,attrs:{...c.attrs,contentId:t.id}}))),r.questions.forEach(c=>{c.text&&i.push(...Gs(c.text,c.id,c.label)),yS(c.type)&&c.parts.forEach(l=>{l.text&&i.push(...Gs(l.text,l.id,l.label))})});const a=(t.document.content.content||[]).filter(c=>!c.attrs?.contentId);return xn(kr(a))||i.push(...a),kr(i)}function xS(t,r){const i=(a,c,l)=>!a||!l||c.options.map(u=>u.id).join()===l.options.map(u=>u.id).join()?a:{...a,itemsContent:c.options.map(u=>({...a.itemsContent.find(d=>d.id===u.id),id:u.id,key:u.label,content:a.itemsContent.find(d=>d.id===u.id)?.content||$t()}))};return{...t,questions:t.questions.map(a=>{const c=r.questions.find(l=>l.id===a.id);return{...a,text:i(a.text,a.choice,c?.choice),parts:a.parts.map(l=>({...l,text:i(l.text,l.choice,c?.parts.find(u=>u.id===l.id)?.choice)}))}})}}function vS(t,r,i){if(t.reference?.textVersion!==1)return t;let a=t.reference;if(!r&&!xn(t.document)&&!t.document.content.content?.some(l=>l.attrs?.contentId))return{...t,reference:{...a,textVersion:void 0}};if(r?.reference===a&&r.document===t.document&&!xn(t.document))return t;if(t.document!==r?.document&&(!xn(t.document)||r)&&(a=Em(a,t.document,t.id,r?.document),r&&t.reference===r.reference))return{...t,reference:a};r?.reference&&t.reference!==r.reference&&(a=xS(a,r.reference));const c={...t,reference:a};return i||!xn(t.document)?{...c,document:fu(c)}:c}const aa={SCHOICE:{count:200,options:[2,12],parts:1,score:15},MCHOICE:{count:200,options:[2,12],parts:1,score:15},JUDGE:{count:200,options:[2,2],parts:1,score:15},CHUNK_CHOICE:{count:100,options:[2,26],parts:1,score:10},FILLBLANK:{count:50,options:[0,0],parts:20,score:15},SHORTANSWER:{count:100,options:[0,0],parts:10,score:60},CLOZE:{count:20,options:[4,4],parts:20,score:15},READTHENANSWER:{count:20,options:[2,12],parts:20,score:15},INFO_MATCHING:{count:20,options:[1,9],parts:9,score:15},TEXT_COMPLETION:{count:20,options:[0,0],parts:20,score:15},CCOMPOSITION:{count:1,options:[0,0],parts:1,score:70},ECOMPOSITION:{count:1,options:[0,0],parts:1,score:70}},wt=t=>["SCHOICE","MCHOICE","JUDGE","CHUNK_CHOICE","CLOZE","READTHENANSWER","INFO_MATCHING"].includes(t),Le=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),xi=t=>t==="FILLBLANK"||t==="TEXT_COMPLETION",vi=t=>t==="CCOMPOSITION"||t==="ECOMPOSITION",SS={SCHOICE:"choice",MCHOICE:"choice",JUDGE:"judge",FILLBLANK:"fill",SHORTANSWER:"answer",MIXED:"composite",CLOZE:"cloze",READTHENANSWER:"reading",INFO_MATCHING:"matching",TEXT_COMPLETION:"completion",ECOMPOSITION:"english",CCOMPOSITION:"writing",CHUNK_CHOICE:"chunk"};function hu(t){return{type:t,textVersion:1,questions:[],layout:iu(0),fillNewLine:!1,optional:!1,choose:1,optionalHeight:200,scoreType:"LESS_SCORE"}}function Tm(t){return{id:crypto.randomUUID(),kind:SS[t],title:nr[t],answerHeight:0,document:$t(),reference:hu(t)}}function mu(t,r=1,i){const a=t==="MCHOICE"&&mi(i);return{type:t,start:r,end:r,optionCount:t==="INFO_MATCHING"?null:t==="CHUNK_CHOICE"?12:t==="JUDGE"?2:4,partCount:Le(t)?null:1,score:a?6:null,scoreType:a?"ITEM_SCORE":"LESS_SCORE",lessScore:0,characters:1e3,lines:10,rightAnswers:null,singleScore:1}}function ia(t,r,i){const a=Array.from({length:i},(c,l)=>({...t.options[l]||{id:crypto.randomUUID()},label:r==="JUDGE"?["T","F"][l]:String.fromCharCode(65+l)}));return{...t,options:a,multiple:r==="MCHOICE"||r==="CHUNK_CHOICE",indefinite:!1,correctIds:t.correctIds.filter(c=>a.some(l=>l.id===c)).slice(0,r==="MCHOICE"||r==="CHUNK_CHOICE"?i:1)}}function Si(t,r,i,a=4){const c=crypto.randomUUID(),l={...ia(ra(0),i,a),id:c,label:t,score:r};return{id:c,label:t,score:r,width:25,breakAfter:!1,height:100,document:i==="SHORTANSWER"?yi(t,r):$t(),choice:l,...Le(i)&&i!=="TEXT_COMPLETION"?{text:bi(i,l)}:{}}}function pu(t,r){const i=crypto.randomUUID(),{type:a,score:c}=t,l=String(r),u=t.partCount||1,d=Array.from({length:Le(a)||["FILLBLANK","SHORTANSWER"].includes(a)?u:0},(p,C)=>Si(Le(a)?String(r+C):u===1?l:`${l}.${C+1}`,c,a,t.optionCount||4)),m={...ia(ra(0),a,t.optionCount||4),id:i,label:l,score:c,scoreType:t.scoreType,lessScore:t.lessScore};return{id:i,type:a,label:l,score:d.length?Vn(d):c,choice:m,text:bi(a,m,Le(a)),parts:d,document:a==="ECOMPOSITION"?{version:1,content:{type:"doc",content:[...yi(l,c).content.content,...jS(t.lines,t.paperWidth||600).content.content]}}:a==="CCOMPOSITION"?yi(l,c):$t(),height:a==="ECOMPOSITION"?50*t.lines+40:100,contentHeight:38,characters:t.characters,lines:t.lines,halfPoint:!1,rightAnswers:t.rightAnswers,singleScore:t.singleScore}}const Vn=t=>t.some(r=>r.score===null)?null:t.reduce((r,i)=>r+(i.score||0),0);function gu(t){return t.questions.flatMap(r=>Le(r.type)?r.parts.map(i=>i.label):[r.label])}function Vs(t){return Math.max(0,...gu(t).map(Number).filter(Number.isFinite))+1}function CS(t,r,i=!1,a=!1){const c=aa[r.type],l=vi(r.type)?1:r.end-r.start+1;if(!Number.isInteger(r.start)||r.start<1||r.end>1e3||!Number.isInteger(l)||l<1||l>c.count)return`题号须为 1–1000,单次题数为 1–${c.count}`;if(t.type==="CCOMPOSITION"&&t.questions.length)return"语文作文每组只能有一道题";if(t.optional)return"选做题组不能追加题目";const u=gu(t);if(Array.from({length:l},(d,m)=>String(r.start+m)).some(d=>u.includes(d)))return"同一分组内,题号不能重复";if(wt(r.type)&&(r.optionCount===null||!Number.isInteger(r.optionCount)||r.optionCount<c.options[0]||r.optionCount>c.options[1]))return`选项个数须为 ${c.options[0]}–${c.options[1]}`;if((Le(r.type)||["FILLBLANK","SHORTANSWER"].includes(r.type))&&(!r.partCount||!Number.isInteger(r.partCount)||r.partCount<1||r.partCount>c.parts))return`子题/空数须为 1–${c.parts}`;if(Le(r.type)&&l%r.partCount!==0)return"题目数量无法按子题数量均分,请重新设置";if(r.type==="INFO_MATCHING"&&r.partCount>r.optionCount)return"选项个数需大于等于子题数量";if(r.type==="SHORTANSWER"&&(i||t.optional)&&r.partCount!==1)return"网阅或选做题不支持小题";if(r.score!==null&&(!Number.isFinite(r.score)||r.score<(a?0:.5)||r.score>c.score||!Number.isInteger(r.score*2)))return`分值须为 ${a?0:.5}–${c.score} 分,按 0.5 分递增`;if(r.type==="MCHOICE"&&(r.lessScore<0||!Number.isInteger(r.lessScore*2)||r.lessScore>(r.score||0)))return"少选得分不能超过本题分值";if(r.type==="CHUNK_CHOICE"){if(!r.rightAnswers||!Number.isInteger(r.rightAnswers)||r.rightAnswers>=r.optionCount)return"正确答案个数需小于选项个数";if(r.singleScore===null||r.singleScore<.5||!Number.isInteger(r.singleScore*2)||r.score!==null&&r.score!==0&&r.singleScore*r.rightAnswers>r.score)return"每处得分乘以正确答案个数不可大于每题分数"}return r.type==="CCOMPOSITION"&&(!Number.isInteger(r.characters)||r.characters<1||r.characters>1200)?"作文格数须为 1–1200":r.type==="ECOMPOSITION"&&(!Number.isInteger(r.lines)||r.lines<1||r.lines>100)?"作文行数须为 1–100":r.score===null?"请输入分值":null}function wS(t,r,i){const a=Le(r.type)?r.partCount:1,c=[];for(let d=r.start;d<=(vi(r.type)?r.start:r.end);d+=a)c.push(pu(r,d));const l=[...t.questions],u=l.findIndex(d=>d.id===i||d.parts.some(m=>m.id===i));return l.splice(u<0?l.length:u+1,0,...c),{...t,questions:l}}function qs(t){return t.questions.flatMap(r=>[r,...r.parts])}function sa(t){return t.questions.filter(r=>wt(r.type)).flatMap(r=>Le(r.type)?r.parts.map(i=>({...i.choice,label:i.label,score:i.score})):[{...r.choice,label:r.label,score:r.score}])}function ES(t,r){const i=vo(t);return i.referenceData&&(i.referenceData={...i.referenceData,questionId:i.id}),i.text&&(i.text.groupId=`options:${i.id}`),i.label=String(r),i.choice.label=i.label,i.choice.contentTarget=null,i.choice.breakBefore=!1,i.parts.forEach((a,c)=>{a.label=Le(i.type)?String(r+c):i.parts.length===1?i.label:`${r}.${c+1}`,a.choice.label=a.label,a.choice.contentTarget=null,a.choice.breakBefore=!1}),i.parts.forEach(a=>{a.text&&(a.text.groupId=`options:${a.id}`),a.referenceData&&(a.referenceData={...a.referenceData,questionId:a.id,questionPid:i.id})}),i.document=vn(i.document,i.label,i.score),i.parts=i.parts.map(a=>({...a,document:vn(a.document,a.label,a.score)})),i}function TS(t){return Math.max(1,Math.floor((t-6)/31))}function jS(t,r){return{version:1,content:{type:"doc",content:Array.from({length:t},()=>({type:"paragraph",attrs:{fixedLineHeight:45.35433070866142},content:[{type:"text",text:" ".repeat(Math.max(1,Math.floor((r-24)/3))),marks:[{type:"underline"},{type:"textStyle",attrs:{fontFamily:"Times New Roman, serif",fontSize:"12px"}}]}]}))}}}function AS(t,r,i=!1){const a=t.questions.reduce((l,u)=>l+(u.parts.length||1),0),c=r/a;return!a||!Number.isFinite(c)||c<(i?0:.5)||!Number.isInteger(c*2)||t.questions.some(l=>c>aa[l.type].score||c!==0&&l.type==="CHUNK_CHOICE"&&(l.rightAnswers||0)*(l.singleScore||0)>c)?null:{...t,questions:t.questions.map(l=>({...l,score:c*(l.parts.length||1),document:vn(l.document,l.label,c*(l.parts.length||1)),choice:{...l.choice,score:c,lessScore:Math.min(l.choice.lessScore||0,c)},parts:l.parts.map(u=>({...u,score:c,document:vn(u.document,u.label,c),choice:{...u.choice,score:c}}))}))}}function RS(t,r){return[...t<=17?Array.from({length:18},(i,a)=>17-a<=t?String(17-a):""):[...Array.from({length:7},(i,a)=>7-a<=Math.floor(t/10)?`${7-a}0`:""),"",...Array.from({length:10},(i,a)=>String(9-a))],r?"0.5":""]}const OS=["000","100","110","111","101","010","011","001"],NS=t=>OS[t-1],yu={CHINESE:[1],MATHS:[2],ENGLISH:[3],PHYSICAL:[4],CHEMICAL:[1,2],POLITICAL:[1,3],BIOLOGICAL:[1,4],GEOGRAPHIC:[2,3],JAPANESE:[2,4],IT:[3,4],GYM:[1,2,3],MUSIC:[1,2,4],ART:[1,3,4],SCIENCE:[2,3,4],HISTORY:[1,2,3,4]},MS={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",物理:"PHYSICAL",化学:"CHEMICAL",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",日语:"JAPANESE",信息科技:"IT",信息技术:"IT",体育:"GYM",音乐:"MUSIC",美术:"ART",科学:"SCIENCE",历史:"HISTORY"};function jm(t){return t?.subjectCode||(t?.courseCode&&yu[t.courseCode]?t.courseCode:MS[t?.subject||""])}const qn=t=>Math.round(t*1e3)/1e3,Am=t=>({x:qn(t.x),y:qn(t.y),width:qn(t.width),height:qn(t.height)});function Rm(t,r){const i=Math.max(t.x,r.x),a=Math.max(t.y,r.y),c=Math.min(t.x+t.width,r.x+r.width)-i,l=Math.min(t.y+t.height,r.y+r.height)-a;return c>.01&&l>.01?{x:i,y:a,width:c,height:l}:void 0}const la=function(t,r){let c=t;const l=Ci[r];let u=null,d=0,m=null;const p=[],C={},g=function(_,I){d=c*4+17,u=(function(z){const H=new Array(z);for(let L=0;L<z;L+=1){H[L]=new Array(z);for(let $=0;$<z;$+=1)H[L][$]=null}return H})(d),b(0,0),b(d-7,0),b(0,d-7),S(),x(),T(_,I),c>=7&&w(_),m==null&&(m=O(c,l,p)),j(m,I)},b=function(_,I){for(let z=-1;z<=7;z+=1)if(!(_+z<=-1||d<=_+z))for(let H=-1;H<=7;H+=1)I+H<=-1||d<=I+H||(0<=z&&z<=6&&(H==0||H==6)||0<=H&&H<=6&&(z==0||z==6)||2<=z&&z<=4&&2<=H&&H<=4?u[_+z][I+H]=!0:u[_+z][I+H]=!1)},v=function(){let _=0,I=0;for(let z=0;z<8;z+=1){g(!0,z);const H=zr.getLostPoint(C);(z==0||_>H)&&(_=H,I=z)}return I},x=function(){for(let _=8;_<d-8;_+=1)u[_][6]==null&&(u[_][6]=_%2==0);for(let _=8;_<d-8;_+=1)u[6][_]==null&&(u[6][_]=_%2==0)},S=function(){const _=zr.getPatternPosition(c);for(let I=0;I<_.length;I+=1)for(let z=0;z<_.length;z+=1){const H=_[I],L=_[z];if(u[H][L]==null)for(let $=-2;$<=2;$+=1)for(let Y=-2;Y<=2;Y+=1)$==-2||$==2||Y==-2||Y==2||$==0&&Y==0?u[H+$][L+Y]=!0:u[H+$][L+Y]=!1}},w=function(_){const I=zr.getBCHTypeNumber(c);for(let z=0;z<18;z+=1){const H=!_&&(I>>z&1)==1;u[Math.floor(z/3)][z%3+d-8-3]=H}for(let z=0;z<18;z+=1){const H=!_&&(I>>z&1)==1;u[z%3+d-8-3][Math.floor(z/3)]=H}},T=function(_,I){const z=l<<3|I,H=zr.getBCHTypeInfo(z);for(let L=0;L<15;L+=1){const $=!_&&(H>>L&1)==1;L<6?u[L][8]=$:L<8?u[L+1][8]=$:u[d-15+L][8]=$}for(let L=0;L<15;L+=1){const $=!_&&(H>>L&1)==1;L<8?u[8][d-L-1]=$:L<9?u[8][15-L-1+1]=$:u[8][15-L-1]=$}u[d-8][8]=!_},j=function(_,I){let z=-1,H=d-1,L=7,$=0;const Y=zr.getMaskFunction(I);for(let U=d-1;U>0;U-=2)for(U==6&&(U-=1);;){for(let q=0;q<2;q+=1)if(u[H][U-q]==null){let P=!1;$<_.length&&(P=(_[$]>>>L&1)==1),Y(H,U-q)&&(P=!P),u[H][U-q]=P,L-=1,L==-1&&($+=1,L=7)}if(H+=z,H<0||d<=H){H-=z,z=-z;break}}},R=function(_,I){let z=0,H=0,L=0;const $=new Array(I.length),Y=new Array(I.length);for(let G=0;G<I.length;G+=1){const B=I[G].dataCount,Q=I[G].totalCount-B;H=Math.max(H,B),L=Math.max(L,Q),$[G]=new Array(B);for(let te=0;te<$[G].length;te+=1)$[G][te]=255&_.getBuffer()[te+z];z+=B;const N=zr.getErrorCorrectPolynomial(Q),ne=wi($[G],N.getLength()-1).mod(N);Y[G]=new Array(N.getLength()-1);for(let te=0;te<Y[G].length;te+=1){const le=te+ne.getLength()-Y[G].length;Y[G][te]=le>=0?ne.getAt(le):0}}let U=0;for(let G=0;G<I.length;G+=1)U+=I[G].totalCount;const q=new Array(U);let P=0;for(let G=0;G<H;G+=1)for(let B=0;B<I.length;B+=1)G<$[B].length&&(q[P]=$[B][G],P+=1);for(let G=0;G<L;G+=1)for(let B=0;B<I.length;B+=1)G<Y[B].length&&(q[P]=Y[B][G],P+=1);return q},O=function(_,I,z){const H=Om.getRSBlocks(_,I),L=Nm();for(let Y=0;Y<z.length;Y+=1){const U=z[Y];L.put(U.getMode(),4),L.put(U.getLength(),zr.getLengthInBits(U.getMode(),_)),U.write(L)}let $=0;for(let Y=0;Y<H.length;Y+=1)$+=H[Y].dataCount;if(L.getLengthInBits()>$*8)throw"code length overflow. ("+L.getLengthInBits()+">"+$*8+")";for(L.getLengthInBits()+4<=$*8&&L.put(0,4);L.getLengthInBits()%8!=0;)L.putBit(!1);for(;!(L.getLengthInBits()>=$*8||(L.put(236,8),L.getLengthInBits()>=$*8));)L.put(17,8);return R(L,H)};C.addData=function(_,I){I=I||"Byte";let z=null;switch(I){case"Numeric":z=_S(_);break;case"Alphanumeric":z=DS(_);break;case"Byte":z=IS(_);break;case"Kanji":z=kS(_);break;default:throw"mode:"+I}p.push(z),m=null},C.isDark=function(_,I){if(_<0||d<=_||I<0||d<=I)throw _+","+I;return u[_][I]},C.getModuleCount=function(){return d},C.make=function(){if(c<1){let _=1;for(;_<40;_++){const I=Om.getRSBlocks(_,l),z=Nm();for(let L=0;L<p.length;L++){const $=p[L];z.put($.getMode(),4),z.put($.getLength(),zr.getLengthInBits($.getMode(),_)),$.write(z)}let H=0;for(let L=0;L<I.length;L++)H+=I[L].dataCount;if(z.getLengthInBits()<=H*8)break}c=_}g(!1,v())},C.createTableTag=function(_,I){_=_||2,I=typeof I>"u"?_*4:I;let z="";z+='<table style="',z+=" border-width: 0px; border-style: none;",z+=" border-collapse: collapse;",z+=" padding: 0px; margin: "+I+"px;",z+='">',z+="<tbody>";for(let H=0;H<C.getModuleCount();H+=1){z+="<tr>";for(let L=0;L<C.getModuleCount();L+=1)z+='<td style="',z+=" border-width: 0px; border-style: none;",z+=" border-collapse: collapse;",z+=" padding: 0px; margin: 0px;",z+=" width: "+_+"px;",z+=" height: "+_+"px;",z+=" background-color: ",z+=C.isDark(H,L)?"#000000":"#ffffff",z+=";",z+='"/>';z+="</tr>"}return z+="</tbody>",z+="</table>",z},C.createSvgTag=function(_,I,z,H){let L={};typeof arguments[0]=="object"&&(L=arguments[0],_=L.cellSize,I=L.margin,z=L.alt,H=L.title),_=_||2,I=typeof I>"u"?_*4:I,z=typeof z=="string"?{text:z}:z||{},z.text=z.text||null,z.id=z.text?z.id||"qrcode-description":null,H=typeof H=="string"?{text:H}:H||{},H.text=H.text||null,H.id=H.text?H.id||"qrcode-title":null;const $=C.getModuleCount()*_+I*2;let Y,U,q,P,G="",B;for(B="l"+_+",0 0,"+_+" -"+_+",0 0,-"+_+"z ",G+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',G+=L.scalable?"":' width="'+$+'px" height="'+$+'px"',G+=' viewBox="0 0 '+$+" "+$+'" ',G+=' preserveAspectRatio="xMinYMin meet"',G+=H.text||z.text?' role="img" aria-labelledby="'+M([H.id,z.id].join(" ").trim())+'"':"",G+=">",G+=H.text?'<title id="'+M(H.id)+'">'+M(H.text)+"</title>":"",G+=z.text?'<description id="'+M(z.id)+'">'+M(z.text)+"</description>":"",G+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',G+='<path d="',q=0;q<C.getModuleCount();q+=1)for(P=q*_+I,Y=0;Y<C.getModuleCount();Y+=1)C.isDark(q,Y)&&(U=Y*_+I,G+="M"+U+","+P+B);return G+='" stroke="transparent" fill="black"/>',G+="</svg>",G},C.createDataURL=function(_,I){_=_||2,I=typeof I>"u"?_*4:I;const z=C.getModuleCount()*_+I*2,H=I,L=z-I;return HS(z,z,function($,Y){if(H<=$&&$<L&&H<=Y&&Y<L){const U=Math.floor(($-H)/_),q=Math.floor((Y-H)/_);return C.isDark(q,U)?0:1}else return 1})},C.createImgTag=function(_,I,z){_=_||2,I=typeof I>"u"?_*4:I;const H=C.getModuleCount()*_+I*2;let L="";return L+="<img",L+=' src="',L+=C.createDataURL(_,I),L+='"',L+=' width="',L+=H,L+='"',L+=' height="',L+=H,L+='"',z&&(L+=' alt="',L+=M(z),L+='"'),L+="/>",L};const M=function(_){let I="";for(let z=0;z<_.length;z+=1){const H=_.charAt(z);switch(H){case"<":I+="&lt;";break;case">":I+="&gt;";break;case"&":I+="&amp;";break;case'"':I+="&quot;";break;default:I+=H;break}}return I},D=function(_){_=typeof _>"u"?2:_;const z=C.getModuleCount()*1+_*2,H=_,L=z-_;let $,Y,U,q,P;const G={"██":"█","█ ":"▀"," █":"▄"," ":" "},B={"██":"▀","█ ":"▀"," █":" "," ":" "};let Q="";for($=0;$<z;$+=2){for(U=Math.floor(($-H)/1),q=Math.floor(($+1-H)/1),Y=0;Y<z;Y+=1)P="█",H<=Y&&Y<L&&H<=$&&$<L&&C.isDark(U,Math.floor((Y-H)/1))&&(P=" "),H<=Y&&Y<L&&H<=$+1&&$+1<L&&C.isDark(q,Math.floor((Y-H)/1))?P+=" ":P+="█",Q+=_<1&&$+1>=L?B[P]:G[P];Q+=`
2
- `}return z%2&&_>0?Q.substring(0,Q.length-z-1)+Array(z+1).join("▀"):Q.substring(0,Q.length-1)};return C.createASCII=function(_,I){if(_=_||1,_<2)return D(I);_-=1,I=typeof I>"u"?_*2:I;const z=C.getModuleCount()*_+I*2,H=I,L=z-I;let $,Y,U,q;const P=Array(_+1).join("██"),G=Array(_+1).join(" ");let B="",Q="";for($=0;$<z;$+=1){for(U=Math.floor(($-H)/_),Q="",Y=0;Y<z;Y+=1)q=1,H<=Y&&Y<L&&H<=$&&$<L&&C.isDark(U,Math.floor((Y-H)/_))&&(q=0),Q+=q?P:G;for(U=0;U<_;U+=1)B+=Q+`
3
- `}return B.substring(0,B.length-1)},C.renderTo2dContext=function(_,I){I=I||2;const z=C.getModuleCount();for(let H=0;H<z;H++)for(let L=0;L<z;L++)_.fillStyle=C.isDark(H,L)?"black":"white",_.fillRect(L*I,H*I,I,I)},C};la.stringToBytes=function(t){const r=[];for(let i=0;i<t.length;i+=1){const a=t.charCodeAt(i);r.push(a&255)}return r},la.createStringToBytes=function(t,r){const i=(function(){const c=zS(t),l=function(){const m=c.read();if(m==-1)throw"eof";return m};let u=0;const d={};for(;;){const m=c.read();if(m==-1)break;const p=l(),C=l(),g=l(),b=String.fromCharCode(m<<8|p),v=C<<8|g;d[b]=v,u+=1}if(u!=r)throw u+" != "+r;return d})(),a=63;return function(c){const l=[];for(let u=0;u<c.length;u+=1){const d=c.charCodeAt(u);if(d<128)l.push(d);else{const m=i[c.charAt(u)];typeof m=="number"?(m&255)==m?l.push(m):(l.push(m>>>8),l.push(m&255)):l.push(a)}}return l}};const Gt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ci={L:1,M:0,Q:3,H:2},Lr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},zr=(function(){const t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,i=7973,a=21522,c={},l=function(u){let d=0;for(;u!=0;)d+=1,u>>>=1;return d};return c.getBCHTypeInfo=function(u){let d=u<<10;for(;l(d)-l(r)>=0;)d^=r<<l(d)-l(r);return(u<<10|d)^a},c.getBCHTypeNumber=function(u){let d=u<<12;for(;l(d)-l(i)>=0;)d^=i<<l(d)-l(i);return u<<12|d},c.getPatternPosition=function(u){return t[u-1]},c.getMaskFunction=function(u){switch(u){case Lr.PATTERN000:return function(d,m){return(d+m)%2==0};case Lr.PATTERN001:return function(d,m){return d%2==0};case Lr.PATTERN010:return function(d,m){return m%3==0};case Lr.PATTERN011:return function(d,m){return(d+m)%3==0};case Lr.PATTERN100:return function(d,m){return(Math.floor(d/2)+Math.floor(m/3))%2==0};case Lr.PATTERN101:return function(d,m){return d*m%2+d*m%3==0};case Lr.PATTERN110:return function(d,m){return(d*m%2+d*m%3)%2==0};case Lr.PATTERN111:return function(d,m){return(d*m%3+(d+m)%2)%2==0};default:throw"bad maskPattern:"+u}},c.getErrorCorrectPolynomial=function(u){let d=wi([1],0);for(let m=0;m<u;m+=1)d=d.multiply(wi([1,Br.gexp(m)],0));return d},c.getLengthInBits=function(u,d){if(1<=d&&d<10)switch(u){case Gt.MODE_NUMBER:return 10;case Gt.MODE_ALPHA_NUM:return 9;case Gt.MODE_8BIT_BYTE:return 8;case Gt.MODE_KANJI:return 8;default:throw"mode:"+u}else if(d<27)switch(u){case Gt.MODE_NUMBER:return 12;case Gt.MODE_ALPHA_NUM:return 11;case Gt.MODE_8BIT_BYTE:return 16;case Gt.MODE_KANJI:return 10;default:throw"mode:"+u}else if(d<41)switch(u){case Gt.MODE_NUMBER:return 14;case Gt.MODE_ALPHA_NUM:return 13;case Gt.MODE_8BIT_BYTE:return 16;case Gt.MODE_KANJI:return 12;default:throw"mode:"+u}else throw"type:"+d},c.getLostPoint=function(u){const d=u.getModuleCount();let m=0;for(let g=0;g<d;g+=1)for(let b=0;b<d;b+=1){let v=0;const x=u.isDark(g,b);for(let S=-1;S<=1;S+=1)if(!(g+S<0||d<=g+S))for(let w=-1;w<=1;w+=1)b+w<0||d<=b+w||S==0&&w==0||x==u.isDark(g+S,b+w)&&(v+=1);v>5&&(m+=3+v-5)}for(let g=0;g<d-1;g+=1)for(let b=0;b<d-1;b+=1){let v=0;u.isDark(g,b)&&(v+=1),u.isDark(g+1,b)&&(v+=1),u.isDark(g,b+1)&&(v+=1),u.isDark(g+1,b+1)&&(v+=1),(v==0||v==4)&&(m+=3)}for(let g=0;g<d;g+=1)for(let b=0;b<d-6;b+=1)u.isDark(g,b)&&!u.isDark(g,b+1)&&u.isDark(g,b+2)&&u.isDark(g,b+3)&&u.isDark(g,b+4)&&!u.isDark(g,b+5)&&u.isDark(g,b+6)&&(m+=40);for(let g=0;g<d;g+=1)for(let b=0;b<d-6;b+=1)u.isDark(b,g)&&!u.isDark(b+1,g)&&u.isDark(b+2,g)&&u.isDark(b+3,g)&&u.isDark(b+4,g)&&!u.isDark(b+5,g)&&u.isDark(b+6,g)&&(m+=40);let p=0;for(let g=0;g<d;g+=1)for(let b=0;b<d;b+=1)u.isDark(b,g)&&(p+=1);const C=Math.abs(100*p/d/d-50)/5;return m+=C*10,m},c})(),Br=(function(){const t=new Array(256),r=new Array(256);for(let a=0;a<8;a+=1)t[a]=1<<a;for(let a=8;a<256;a+=1)t[a]=t[a-4]^t[a-5]^t[a-6]^t[a-8];for(let a=0;a<255;a+=1)r[t[a]]=a;const i={};return i.glog=function(a){if(a<1)throw"glog("+a+")";return r[a]},i.gexp=function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return t[a]},i})(),wi=function(t,r){if(typeof t.length>"u")throw t.length+"/"+r;const i=(function(){let c=0;for(;c<t.length&&t[c]==0;)c+=1;const l=new Array(t.length-c+r);for(let u=0;u<t.length-c;u+=1)l[u]=t[u+c];return l})(),a={};return a.getAt=function(c){return i[c]},a.getLength=function(){return i.length},a.multiply=function(c){const l=new Array(a.getLength()+c.getLength()-1);for(let u=0;u<a.getLength();u+=1)for(let d=0;d<c.getLength();d+=1)l[u+d]^=Br.gexp(Br.glog(a.getAt(u))+Br.glog(c.getAt(d)));return wi(l,0)},a.mod=function(c){if(a.getLength()-c.getLength()<0)return a;const l=Br.glog(a.getAt(0))-Br.glog(c.getAt(0)),u=new Array(a.getLength());for(let d=0;d<a.getLength();d+=1)u[d]=a.getAt(d);for(let d=0;d<c.getLength();d+=1)u[d]^=Br.gexp(Br.glog(c.getAt(d))+l);return wi(u,0).mod(c)},a},Om=(function(){const t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(c,l){const u={};return u.totalCount=c,u.dataCount=l,u},i={},a=function(c,l){switch(l){case Ci.L:return t[(c-1)*4+0];case Ci.M:return t[(c-1)*4+1];case Ci.Q:return t[(c-1)*4+2];case Ci.H:return t[(c-1)*4+3];default:return}};return i.getRSBlocks=function(c,l){const u=a(c,l);if(typeof u>"u")throw"bad rs block @ typeNumber:"+c+"/errorCorrectionLevel:"+l;const d=u.length/3,m=[];for(let p=0;p<d;p+=1){const C=u[p*3+0],g=u[p*3+1],b=u[p*3+2];for(let v=0;v<C;v+=1)m.push(r(g,b))}return m},i})(),Nm=function(){const t=[];let r=0;const i={};return i.getBuffer=function(){return t},i.getAt=function(a){const c=Math.floor(a/8);return(t[c]>>>7-a%8&1)==1},i.put=function(a,c){for(let l=0;l<c;l+=1)i.putBit((a>>>c-l-1&1)==1)},i.getLengthInBits=function(){return r},i.putBit=function(a){const c=Math.floor(r/8);t.length<=c&&t.push(0),a&&(t[c]|=128>>>r%8),r+=1},i},_S=function(t){const r=Gt.MODE_NUMBER,i=t,a={};a.getMode=function(){return r},a.getLength=function(u){return i.length},a.write=function(u){const d=i;let m=0;for(;m+2<d.length;)u.put(c(d.substring(m,m+3)),10),m+=3;m<d.length&&(d.length-m==1?u.put(c(d.substring(m,m+1)),4):d.length-m==2&&u.put(c(d.substring(m,m+2)),7))};const c=function(u){let d=0;for(let m=0;m<u.length;m+=1)d=d*10+l(u.charAt(m));return d},l=function(u){if("0"<=u&&u<="9")return u.charCodeAt(0)-48;throw"illegal char :"+u};return a},DS=function(t){const r=Gt.MODE_ALPHA_NUM,i=t,a={};a.getMode=function(){return r},a.getLength=function(l){return i.length},a.write=function(l){const u=i;let d=0;for(;d+1<u.length;)l.put(c(u.charAt(d))*45+c(u.charAt(d+1)),11),d+=2;d<u.length&&l.put(c(u.charAt(d)),6)};const c=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return a},IS=function(t){const r=Gt.MODE_8BIT_BYTE,i=la.stringToBytes(t),a={};return a.getMode=function(){return r},a.getLength=function(c){return i.length},a.write=function(c){for(let l=0;l<i.length;l+=1)c.put(i[l],8)},a},kS=function(t){const r=Gt.MODE_KANJI,i=la.stringToBytes;(function(l,u){const d=i(l);if(d.length!=2||(d[0]<<8|d[1])!=u)throw"sjis not supported."})("友",38726);const a=i(t),c={};return c.getMode=function(){return r},c.getLength=function(l){return~~(a.length/2)},c.write=function(l){const u=a;let d=0;for(;d+1<u.length;){let m=(255&u[d])<<8|255&u[d+1];if(33088<=m&&m<=40956)m-=33088;else if(57408<=m&&m<=60351)m-=49472;else throw"illegal char at "+(d+1)+"/"+m;m=(m>>>8&255)*192+(m&255),l.put(m,13),d+=2}if(d<u.length)throw"illegal char at "+(d+1)},c},Mm=function(){const t=[],r={};return r.writeByte=function(i){t.push(i&255)},r.writeShort=function(i){r.writeByte(i),r.writeByte(i>>>8)},r.writeBytes=function(i,a,c){a=a||0,c=c||i.length;for(let l=0;l<c;l+=1)r.writeByte(i[l+a])},r.writeString=function(i){for(let a=0;a<i.length;a+=1)r.writeByte(i.charCodeAt(a))},r.toByteArray=function(){return t},r.toString=function(){let i="";i+="[";for(let a=0;a<t.length;a+=1)a>0&&(i+=","),i+=t[a];return i+="]",i},r},LS=function(){let t=0,r=0,i=0,a="";const c={},l=function(d){a+=String.fromCharCode(u(d&63))},u=function(d){if(d<0)throw"n:"+d;if(d<26)return 65+d;if(d<52)return 97+(d-26);if(d<62)return 48+(d-52);if(d==62)return 43;if(d==63)return 47;throw"n:"+d};return c.writeByte=function(d){for(t=t<<8|d&255,r+=8,i+=1;r>=6;)l(t>>>r-6),r-=6},c.flush=function(){if(r>0&&(l(t<<6-r),t=0,r=0),i%3!=0){const d=3-i%3;for(let m=0;m<d;m+=1)a+="="}},c.toString=function(){return a},c},zS=function(t){const r=t;let i=0,a=0,c=0;const l={};l.read=function(){for(;c<8;){if(i>=r.length){if(c==0)return-1;throw"unexpected end of file./"+c}const m=r.charAt(i);if(i+=1,m=="=")return c=0,-1;if(m.match(/^\s$/))continue;a=a<<6|u(m.charCodeAt(0)),c+=6}const d=a>>>c-8&255;return c-=8,d};const u=function(d){if(65<=d&&d<=90)return d-65;if(97<=d&&d<=122)return d-97+26;if(48<=d&&d<=57)return d-48+52;if(d==43)return 62;if(d==47)return 63;throw"c:"+d};return l},BS=function(t,r){const i=t,a=r,c=new Array(t*r),l={};l.setPixel=function(p,C,g){c[C*i+p]=g},l.write=function(p){p.writeString("GIF87a"),p.writeShort(i),p.writeShort(a),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(","),p.writeShort(0),p.writeShort(0),p.writeShort(i),p.writeShort(a),p.writeByte(0);const C=2,g=d(C);p.writeByte(C);let b=0;for(;g.length-b>255;)p.writeByte(255),p.writeBytes(g,b,255),b+=255;p.writeByte(g.length-b),p.writeBytes(g,b,g.length-b),p.writeByte(0),p.writeString(";")};const u=function(p){const C=p;let g=0,b=0;const v={};return v.write=function(x,S){if(x>>>S)throw"length over";for(;g+S>=8;)C.writeByte(255&(x<<g|b)),S-=8-g,x>>>=8-g,b=0,g=0;b=x<<g|b,g=g+S},v.flush=function(){g>0&&C.writeByte(b)},v},d=function(p){const C=1<<p,g=(1<<p)+1;let b=p+1;const v=m();for(let j=0;j<C;j+=1)v.add(String.fromCharCode(j));v.add(String.fromCharCode(C)),v.add(String.fromCharCode(g));const x=Mm(),S=u(x);S.write(C,b);let w=0,T=String.fromCharCode(c[w]);for(w+=1;w<c.length;){const j=String.fromCharCode(c[w]);w+=1,v.contains(T+j)?T=T+j:(S.write(v.indexOf(T),b),v.size()<4095&&(v.size()==1<<b&&(b+=1),v.add(T+j)),T=j)}return S.write(v.indexOf(T),b),S.write(g,b),S.flush(),x.toByteArray()},m=function(){const p={};let C=0;const g={};return g.add=function(b){if(g.contains(b))throw"dup key:"+b;p[b]=C,C+=1},g.size=function(){return C},g.indexOf=function(b){return p[b]},g.contains=function(b){return typeof p[b]<"u"},g};return l},HS=function(t,r,i){const a=BS(t,r);for(let d=0;d<r;d+=1)for(let m=0;m<t;m+=1)a.setPixel(m,d,i(m,d));const c=Mm();a.write(c);const l=LS(),u=c.toByteArray();for(let d=0;d<u.length;d+=1)l.writeByte(u[d]);return l.flush(),"data:image/gif;base64,"+l};la.stringToBytes;function _m(t){const r=la(0,"M"),i=Array.from(new TextEncoder().encode(t),l=>String.fromCharCode(l)).join("");r.addData(i,/^\d+$/.test(t)?"Numeric":"Byte"),r.make();const a=r.getModuleCount();let c="";for(let l=0;l<a;l++)for(let u=0;u<a;u++)r.isDark(l,u)&&(c+=`M${u} ${l}h1v1h-1z`);return{count:a,path:c}}class ca extends Error{constructor(i){super(i[0]?.message||"题卡数据无效");cm(this,"issues");this.name="AnswerSheetDataError",this.issues=i}}function bu(t,r){const i=(x,S="题卡数据结构无效")=>{throw new ca([{code:"INVALID_DATA",path:x,message:S}])},a=(x,S)=>!x||typeof x!="object"||Array.isArray(x)?i(S):x,c=(x,S)=>Array.isArray(x)?x:i(S),l=(x,S)=>{typeof x!="string"&&i(S)},u=(x,S,w=0,T=1e5)=>{(typeof x!="number"||!Number.isFinite(x)||x<w||x>T)&&i(S)},d=(x,S)=>{a(x,S);const w=r.validateDocument(x);w.length&&i(S,w[0])},m=(x,S)=>{const w=a(x,S);if(l(w.id,`${S}.id`),l(w.label,`${S}.label`),(typeof w.multiple!="boolean"||typeof w.breakBefore!="boolean")&&i(S),w.contentTarget!==void 0&&w.contentTarget!==null){const T=a(w.contentTarget,`${S}.contentTarget`);l(T.groupId,`${S}.contentTarget.groupId`),c(T.optionIds,`${S}.contentTarget.optionIds`).forEach((j,R)=>l(j,`${S}.contentTarget.optionIds.${R}`))}c(w.options,`${S}.options`).forEach((T,j)=>{const R=a(T,`${S}.options.${j}`);l(R.id,`${S}.options.${j}.id`),l(R.label,`${S}.options.${j}.label`)}),c(w.correctIds,`${S}.correctIds`).forEach((T,j)=>l(T,`${S}.correctIds.${j}`))},p=(x,S)=>{const w=a(x,S);(!["row","column"].includes(String(w.direction))||!["concentrated","distributed","stem","option"].includes(String(w.presentation))||!["box","check","bubble"].includes(String(w.marker)))&&i(S),u(w.rowsPerColumn,`${S}.rowsPerColumn`,1,5),u(w.rowGap,`${S}.rowGap`,0,64),u(w.columnGap,`${S}.columnGap`,0,64),c(w.questions,`${S}.questions`).forEach((T,j)=>m(T,`${S}.questions.${j}`))},C=new WeakSet,g=(x,S)=>{if(!(!x||typeof x!="object")){if(C.has(x))return i(S,"题卡必须是无循环引用的 JSON 数据");C.add(x),Object.entries(x).forEach(([w,T])=>g(T,`${S}.${w}`)),C.delete(x)}},b=a(t,"");if(b.version!==1&&i("version","不支持的题卡数据版本"),l(b.title,"title"),b.usage!==void 0&&!["exam","homework"].includes(String(b.usage))&&i("usage"),["questionCard","scanMarking","halfPoint","mergeObjective"].forEach(x=>{b[x]!==void 0&&typeof b[x]!="boolean"&&i(x)}),["a4","a3-two","a3-three"].includes(String(b.preset))||i("preset"),u(b.margin,"margin",0,100),u(b.gap,"gap",0,100),b.creation){const x=a(b.creation,"creation");["template","exam"].includes(String(x.mode))||i("creation.mode"),["name","grade","subject"].forEach(S=>l(x[S],`creation.${S}`));for(const S of["gradeCode","courseCode","subjectCode"])x[S]!==void 0&&(typeof x[S]!="string"||!x[S].trim())&&i(`creation.${S}`);x.phaseCode!==void 0&&!["P","J","S"].includes(String(x.phaseCode))&&i("creation.phaseCode"),x.createMode!==void 0&&!["MANUALLY","IMPORTED","THIRD"].includes(String(x.createMode))&&i("creation.createMode");for(const S of["id","exampaperId"])if(x[S]!==void 0){const w=x[S];typeof w=="string"&&w.trim()||typeof w=="number"&&Number.isSafeInteger(w)&&w>=0||i(`creation.${S}`)}}if(b.paperTitle){const x=a(b.paperTitle,"paperTitle");l(x.id,"paperTitle.id"),u(x.height,"paperTitle.height",1,1e3),d(x.document,"paperTitle.document")}if(b.header){const x=a(b.header,"header");["code","school"].includes(String(x.kaohao))||i("header.kaohao"),u(x.weishu,"header.weishu",1,20),x.tiaomaStyle!==void 0&&![1,2].includes(x.tiaomaStyle)&&i("header.tiaomaStyle"),x.classText!==void 0&&typeof x.classText!="boolean"&&i("header.classText")}if(b.recognition!==void 0){const x=a(b.recognition,"recognition");for(const S of["examQrCode","subjectMarkers","pointBlack"])x[S]!==void 0&&typeof x[S]!="boolean"&&i(`recognition.${S}`)}c(b.blocks,"blocks").forEach((x,S)=>{const w=`blocks.${S}`,T=a(x,w);if(l(T.id,`${w}.id`),l(T.title,`${w}.title`),u(T.answerHeight,`${w}.answerHeight`),d(T.document,`${w}.document`),T.kind==="area"){(!["forbiden","editArea"].includes(String(T.areaType))||T.reference||T.choices||T.exercise)&&i(`${w}.areaType`),u(T.answerHeight,`${w}.answerHeight`,100,4e3);return}if(!T.reference){if(T.choices){p(T.choices,`${w}.choices`);return}i(`${w}.reference`,"请使用包含 reference 题目结构的制卡数据")}const j=a(T.reference,`${w}.reference`);j.material!==void 0&&d(j.material,`${w}.reference.material`),j.textVersion!==void 0&&j.textVersion!==1&&i(`${w}.reference.textVersion`),Object.hasOwn(nr,String(j.type))||i(`${w}.reference.type`),p(j.layout,`${w}.reference.layout`),u(j.optionalHeight,`${w}.reference.optionalHeight`),c(j.questions,`${w}.reference.questions`).forEach((R,O)=>{const M=`${w}.reference.questions.${O}`,D=a(R,M);Object.hasOwn(aa,String(D.type))||i(`${M}.type`),l(D.id,`${M}.id`),l(D.label,`${M}.label`),m(D.choice,`${M}.choice`),["height","contentHeight","characters","lines"].forEach(I=>u(D[I],`${M}.${I}`)),d(D.document,`${M}.document`);const _=(I,z)=>{if(!I)return;const H=a(I,z);d(H.content,`${z}.content`),a(H.layout,`${z}.layout`),l(H.groupId,`${z}.groupId`),c(H.itemsContent,`${z}.itemsContent`).forEach((L,$)=>{const Y=a(L,`${z}.itemsContent.${$}`);l(Y.id,`${z}.itemsContent.${$}.id`),l(Y.key,`${z}.itemsContent.${$}.key`),d(Y.content,`${z}.itemsContent.${$}.content`)})};_(D.text,`${M}.text`),c(D.parts,`${M}.parts`).forEach((I,z)=>{const H=`${M}.parts.${z}`,L=a(I,H);l(L.id,`${H}.id`),l(L.label,`${H}.label`),u(L.width,`${H}.width`),u(L.height,`${H}.height`),d(L.document,`${H}.document`),m(L.choice,`${H}.choice`),_(L.text,`${H}.text`)})})}),g(t,"");const v=du(t);(v.columnWidth<100||v.contentHeight<100)&&i("margin","边距或栏间距过大,纸张没有足够的作答区域")}function Ys(t){return!t||t.marks?.some(r=>r.type==="documentLabel")?!1:t.type==="text"?!!t.text?.trim():t.type==="image"?!!t.attrs?.src:t.type==="formula"||t.type==="blockFormula"?!!t.attrs?.latex?.trim():!!t.content?.some(Ys)}function PS(t,r){try{bu(t,r)}catch(v){return{valid:!1,issues:v instanceof ca?v.issues:[{code:"INVALID_DATA",path:"",message:"题卡数据无法读取"}]}}const i=[];let a={};const c=(v,x,S)=>i.push({code:v,path:x,message:S,...a}),l=new Set,u=(v,x)=>{(!v.trim()||l.has(v))&&c("DUPLICATE_ID",x,"题块、题目和选项 ID 必须非空且唯一"),l.add(v)},d=(v,x,S)=>{(v===null||!Number.isFinite(v)||v<(t.usage==="homework"?0:.5)||v>x||!Number.isInteger(v*2))&&c("INVALID_SCORE",S,`分值须为 ${t.usage==="homework"?0:.5}–${x} 分,按 0.5 分递增`)},m=(v,x,S)=>{(v.options.length<x[0]||v.options.length>x[1])&&c("INVALID_OPTIONS",`${S}.options`,`选项个数须为 ${x[0]}–${x[1]}`),v.options.forEach((w,T)=>u(w.id,`${S}.options.${T}.id`)),(new Set(v.correctIds).size!==v.correctIds.length||v.correctIds.some(w=>!v.options.some(T=>T.id===w)))&&c("INVALID_ANSWER_REFERENCE",`${S}.correctIds`,"答案引用了不存在或重复的选项")},p=(v,x,S,w=0,T=!0)=>{T&&!Ys(v?.content.content)&&c("MISSING_CONTENT",`${x}.content`,"请填写题干或材料"),S&&(v?.itemsContent.length!==w||v.itemsContent.some(j=>!Ys(j.content.content)))&&c("MISSING_OPTION_CONTENT",`${x}.itemsContent`,"请补全每个选项的内容")};if(t.title.trim()||c("MISSING_TITLE","title","请填写题卡名称"),t.recognition?.examQrCode){const v=String(t.creation?.exampaperId??"").trim();if(!v)c("MISSING_EXAM_ID","creation.exampaperId","显示试卷二维码需要填写试卷 ID");else try{_m(v)}catch{c("INVALID_QR_PAYLOAD","creation.exampaperId","试卷 ID 太长,无法生成二维码")}}t.header&&t.recognition?.subjectMarkers!==!1&&!yu[jm(t.creation)||""]&&c("UNKNOWN_SUBJECT_MARK","creation.subjectCode","当前学科没有参考识别编码,请配置标准学科或关闭学科标记"),(!t.creation?.grade.trim()||!t.creation.subject.trim())&&c("MISSING_CREATION","creation","请选择年级和学科"),(!t.paperTitle||!Ys(t.paperTitle.document.content))&&c("MISSING_PAPER_TITLE","paperTitle","请填写纸面标题"),t.blocks.some(v=>v.kind!=="area")||c("EMPTY_CARD","blocks","请至少添加一个题块和一道题目"),t.paperTitle&&u(t.paperTitle.id,"paperTitle.id"),t.blocks.forEach((v,x)=>{a={blockId:v.id};const S=`blocks.${x}`;if(u(v.id,`${S}.id`),v.kind==="area"){v.areaType===(t.questionCard?"forbiden":"editArea")&&c("INVALID_AREA_MODE",`${S}.areaType`,"题卡合一使用空白答题区,独立答题卡使用禁止答题区");return}v.title.trim()||c("MISSING_BLOCK_TITLE",`${S}.title`,"请填写题块标题"),v.id==="reference-merged-objective"&&c("RESERVED_ID",`${S}.id`,"题块使用了系统保留 ID");const w=v.reference;if(!w){v.choices?.questions.length||c("EMPTY_BLOCK",S,"题块中没有题目"),v.choices?.questions.forEach((j,R)=>{a={blockId:v.id,questionId:j.id},u(j.id,`${S}.choices.questions.${R}.id`),m(j,[2,12],`${S}.choices.questions.${R}`),d(j.score??null,15,`${S}.choices.questions.${R}.score`)});return}w.questions.length||c("EMPTY_BLOCK",`${S}.reference.questions`,"题块中没有题目");const T=gu(w);if((T.some(j=>!j.trim())||new Set(T).size!==T.length)&&c("INVALID_QUESTION_NUMBER",`${S}.reference.questions`,"同一题块内的题号须非空且不能重复"),w.optional&&(w.type!=="SHORTANSWER"||!Number.isInteger(w.choose)||w.choose<1||w.choose>=w.questions.length)&&c("INVALID_OPTIONAL",`${S}.reference.choose`,"选做题须为解答题,且选做数量小于总题数"),w.type==="CCOMPOSITION"&&w.questions.length>1&&c("INVALID_COUNT",`${S}.reference.questions`,"语文作文每组只能有一道题"),w.questions.forEach((j,R)=>{a={blockId:v.id,questionId:j.id};const O=`${S}.reference.questions.${R}`,M=aa[j.type];u(j.id,`${O}.id`),w.type!=="MIXED"&&w.type!==j.type&&c("TYPE_MISMATCH",`${O}.type`,"题目类型与题块不一致"),j.choice.id!==j.id&&c("INVALID_BINDING",`${O}.choice.id`,"题目与填涂项 ID 不一致");const D=Le(j.type)||["FILLBLANK","SHORTANSWER"].includes(j.type);(D&&(j.parts.length<1||j.parts.length>M.parts)||!D&&j.parts.length)&&c("INVALID_PARTS",`${O}.parts`,`子题/空数须为 ${D?`1–${M.parts}`:"0"}`),j.parts.length?j.score!==Vn(j.parts)&&c("SCORE_MISMATCH",`${O}.score`,"总分与子题分值之和不一致"):d(j.score,M.score,`${O}.score`),wt(j.type)&&!Le(j.type)&&m(j.choice,M.options,`${O}.choice`),j.type==="INFO_MATCHING"&&(m(j.choice,M.options,`${O}.choice`),j.parts.length>j.choice.options.length&&c("INVALID_OPTIONS",`${O}.choice.options`,"信息匹配的选项数不能少于子题数")),j.type==="MCHOICE"&&(!Number.isFinite(j.choice.lessScore)||j.choice.lessScore<0||j.choice.lessScore>(j.score||0)||!Number.isInteger(j.choice.lessScore*2))&&c("INVALID_LESS_SCORE",`${O}.choice.lessScore`,"少选得分须按 0.5 分递增且不能超过本题分值"),j.type==="CHUNK_CHOICE"&&(!j.rightAnswers||!Number.isInteger(j.rightAnswers)||j.rightAnswers>=j.choice.options.length||!j.singleScore||j.singleScore<.5||!Number.isInteger(j.singleScore*2)||j.score!==0&&j.singleScore*j.rightAnswers>(j.score||0))&&c("INVALID_CHUNK_SCORE",O,"请检查正确答案个数及每处得分"),j.type==="CCOMPOSITION"&&(!Number.isInteger(j.characters)||j.characters<1||j.characters>1200)&&c("INVALID_GRID_COUNT",`${O}.characters`,"作文格数须为 1–1200"),j.type==="ECOMPOSITION"&&(!Number.isInteger(j.lines)||j.lines<1||j.lines>100)&&c("INVALID_LINE_COUNT",`${O}.lines`,"作文行数须为 1–100"),t.questionCard&&p(j.text,`${O}.text`,["SCHOICE","MCHOICE"].includes(j.type),j.choice.options.length),j.parts.forEach((_,I)=>{const z=`${O}.parts.${I}`;a={blockId:v.id,questionId:_.id},u(_.id,`${z}.id`),d(_.score,M.score,`${z}.score`),Le(j.type)&&wt(j.type)&&(m(_.choice,M.options,`${z}.choice`),_.choice.id!==_.id&&c("INVALID_BINDING",`${z}.choice.id`,"子题与填涂项 ID 不一致")),t.questionCard&&["CLOZE","READTHENANSWER"].includes(j.type)&&p(_.text,`${z}.text`,!0,_.choice.options.length,j.type==="READTHENANSWER")})}),a={blockId:v.id},t.questionCard&&w.layout.presentation!=="concentrated"){const j=w.questions.filter(O=>wt(O.type)).flatMap(O=>Le(O.type)?O.parts.map(M=>M.choice):[O.choice]);na({...w.layout,questions:j},v.document,!0).concentrated.questions.length&&c("MISSING_FILL_TARGET",`${S}.reference.layout.presentation`,"部分填涂框没有对应的题干或选项位置")}}),a={};const C=(v,x)=>{v.type==="image"&&(!v.attrs?.src||/^blob:/i.test(v.attrs.src))&&c("INVALID_IMAGE_URL",x,"图片缺少可保存的地址,请上传后使用持久 URL 或内嵌图片"),["formula","blockFormula"].includes(v.type||"")&&!String(v.attrs?.latex||"").trim()&&c("EMPTY_FORMULA",x,"请填写公式或删除空公式"),v.content?.forEach((S,w)=>C(S,`${x}.content.${w}`))},g=(v,x)=>{v&&C(v.content,`${x}.content`)},b=(v,x)=>{g(v?.content,`${x}.content`),v?.itemsContent.forEach((S,w)=>g(S.content,`${x}.itemsContent.${w}.content`))};return g(t.paperTitle?.document,"paperTitle.document"),t.blocks.forEach((v,x)=>{a={blockId:v.id};const S=`blocks.${x}`;g(v.document,`${S}.document`),g(v.reference?.material,`${S}.reference.material`),v.reference?.questions.forEach((w,T)=>{a={blockId:v.id,questionId:w.id};const j=`blocks.${x}.reference.questions.${T}`;g(w.document,`${j}.document`),b(w.text,`${j}.text`),w.parts.forEach((R,O)=>{a={blockId:v.id,questionId:R.id},g(R.document,`${j}.parts.${O}.document`),b(R.text,`${j}.parts.${O}.text`)})})}),{valid:i.length===0,issues:i}}function xu(t){if(t!==void 0)try{const r=Jc(t);return{grades:r.grades,gradeCourseMap:r.gradeCourseMap,defaultGradeCode:r.defaultGradeCode||void 0,defaultCourseCode:r.defaultCourseCode||void 0}}catch(r){throw r instanceof Wc?new ca([{code:"INVALID_DICTIONARIES",path:r.path,message:r.message}]):r}}function US(t,r){const i=(M,D)=>{throw new ca([{code:"INVALID_INITIALIZATION",path:M,message:D}])},a=(M,D,_)=>{if(!M||typeof M!="object"||Array.isArray(M))return i(D,"初始化配置必须是对象");const I=Object.entries(M);for(const[z]of I)_.includes(z)||i(`${D}.${z}`,"不支持的初始化字段");return Object.fromEntries(I.filter(([,z])=>z!==void 0))},c=(M,D)=>typeof M!="string"||!M.trim()?i(D,"请提供非空的试卷名称、年级和学科"):M.trim(),l=(M,D,_)=>{M!==void 0&&!_.includes(M)&&i(D,`可选值为 ${_.join("、")}`)},u=(M,D)=>{M!==void 0&&typeof M!="boolean"&&i(D,"请使用布尔值")},d=(M,D,_,I)=>{M!==void 0&&(typeof M!="number"||!Number.isFinite(M)||M<_||M>I)&&i(D,`数值必须在 ${_}–${I} 之间`)},m=a(t,"initialization",["name","grade","subject","gradeCode","courseCode","subjectCode","mode","id","exampaperId","createMode","layout","header","recognition"]),p=c(m.name,"initialization.name");p.length>30&&i("initialization.name","试卷名称最多 30 个字符");const C=Jc(xu(r)),g=m.gradeCode!==void 0||m.courseCode!==void 0||m.subjectCode!==void 0;let b;if(g){try{b=hi(C,c(m.gradeCode,"initialization.gradeCode"),c(m.courseCode,"initialization.courseCode"))}catch(M){if(M instanceof Wc)return i(M.path,M.message);throw M}for(const M of["grade","subject","subjectCode"])m[M]!==void 0&&c(m[M],`initialization.${M}`)!==b[M]&&i(`initialization.${M}`,"名称或学科编码与课程字典不一致")}else{const M=c(m.grade,"initialization.grade"),D=c(m.subject,"initialization.subject"),_=C.grades.filter(H=>H.label===M);_.length>1&&i("initialization.grade","同名年级不唯一,请使用 gradeCode");const I=_[0],z=I?C.gradeCourseMap[I.value].filter(H=>H.label===D):[];z.length>1&&i("initialization.subject","同名课程不唯一,请使用 courseCode"),r&&(!I||!z.length)&&i(I?"initialization.subject":"initialization.grade","名称不在可用字典中,请使用年级和课程编码"),b=I&&z.length?hi(C,I.value,z[0].value):{grade:M,subject:D}}l(m.mode,"initialization.mode",["template","exam"]),l(m.createMode,"initialization.createMode",["MANUALLY","IMPORTED","THIRD"]);const v={};for(const M of["id","exampaperId"])if(m[M]!==void 0){const D=m[M];typeof D=="string"?v[M]=c(D,`initialization.${M}`):typeof D=="number"&&Number.isSafeInteger(D)&&D>=0?v[M]=D:i(`initialization.${M}`,"ID 必须是非空字符串或非负安全整数")}m.createMode!==void 0&&(v.createMode=m.createMode);const x=m.layout===void 0?{}:a(m.layout,"initialization.layout",["usage","preset","margin","gap","questionCard","scanMarking","halfPoint","choiceDirection","mergeObjective","pageNum","quesCard","scoreType","choiceType","mixOb"]),S=(M,D,_)=>{x[M]!==void 0&&(x[D]!==void 0&&x[D]!==_&&i(`initialization.layout.${M}`,`与 ${D} 设置冲突`),x[D]=_,delete x[M])};x.pageNum!==void 0&&![1,2,3].includes(x.pageNum)&&i("initialization.layout.pageNum","分栏数为 1、2 或 3"),S("pageNum","preset",{1:"a4",2:"a3-two",3:"a3-three"}[x.pageNum]);for(const[M,D]of[["quesCard","questionCard"],["scoreType","halfPoint"],["mixOb","mergeObjective"],["choiceType","choiceDirection"]])u(x[M],`initialization.layout.${M}`),S(M,D,M==="choiceType"?x[M]?"column":"row":x[M]);l(x.preset,"initialization.layout.preset",["a4","a3-two","a3-three"]),l(x.usage,"initialization.layout.usage",["exam","homework"]),l(x.choiceDirection,"initialization.layout.choiceDirection",["row","column"]),d(x.margin,"initialization.layout.margin",0,100),d(x.gap,"initialization.layout.gap",0,100);for(const M of["questionCard","scanMarking","halfPoint","mergeObjective"])u(x[M],`initialization.layout.${M}`);const w=m.header===void 0?{}:a(m.header,"initialization.header",["focusText","writeKaohao","missExam","mifeng","kaohao","weishu","tiaomaStyle","classText"]);for(const M of["focusText","writeKaohao","missExam","mifeng","classText"])u(w[M],`initialization.header.${M}`);w.tiaomaStyle!==void 0&&![1,2].includes(w.tiaomaStyle)&&i("initialization.header.tiaomaStyle","考号版式为 1(填涂)或 2(条形码)"),l(w.kaohao,"initialization.header.kaohao",["school","code"]),d(w.weishu,"initialization.header.weishu",4,12),w.weishu!==void 0&&!Number.isInteger(w.weishu)&&i("initialization.header.weishu","考号位数必须是整数");const T=uu({name:p,...b,...v,mode:m.mode??"template"}),j=m.recognition===void 0?void 0:a(m.recognition,"initialization.recognition",["examQrCode","subjectMarkers","pointBlack"]);if(j)for(const M of["examQrCode","subjectMarkers","pointBlack"])u(j[M],`initialization.recognition.${M}`);const R={...T,...x,header:{...T.header,...w},...j?{recognition:j}:{}},O=du(R);return(O.columnWidth<100||O.contentHeight<100)&&i("initialization.layout","边距或栏间距过大,纸张没有足够的作答区域"),R}function $S(t,r){if(typeof document>"u")throw new Error("请在浏览器挂载后创建制卡实例");const i=zs(r?.plugins||[]),a=xu(r.dictionaries),c=typeof t=="string"?document.querySelector(t):t;if(!(c instanceof HTMLElement)||c.ownerDocument!==document||/^(INPUT|TEXTAREA|SELECT|BUTTON|IMG|CANVAS|IFRAME)$/.test(c.tagName))throw new Error("制卡需要一个空的 HTML 容器,例如 div");if(document.querySelector("[data-uni-answer-sheet-mount], #uni-answer-sheet"))throw new Error("当前文档已挂载制卡工作区;切换容器前请先 destroy()");if(c.textContent?.trim()||c.children.length)throw new Error("请提供空容器,已有题卡请通过 initialValue 传入");const l=document.createElement("div");l.className="uni-answer-sheet-host",l.dataset.uniAnswerSheetMount="",l.style.height="100%",c.append(l);let u=!1,d={...r,dictionaries:a},m,p,C;const g=new Promise((S,w)=>{p=S,C=w});g.catch(()=>{});const b=()=>{if(u)throw new Error("制卡实例已销毁");if(!m?.isReady())throw new Error("请先等待 sheet.ready");return m},v=async()=>(await g,b()),x={ready:g,async initialize(S){if(u)throw new Error("制卡实例已销毁");const w=US(S,d.dictionaries);m||(d={...d,initialValue:w}),await(await v()).setDocument(w)},getDocument:()=>b().getDocument(),load:async S=>(await v()).setDocument(S),setDocument:async S=>(await v()).setDocument(S),newDocument:async S=>(await v()).newDocument(S),getReferenceData:()=>b().getReferenceData(),setReferenceData:async S=>(await v()).setReferenceData(S),validate:async()=>(await v()).validate(),save:async()=>(await v()).save(),getRecognitionData:async()=>(await v()).getRecognitionData(),focusIssue:S=>b().focusIssue(S),setOptions(S){if(u)throw new Error("制卡实例已销毁");const w=Object.hasOwn(S,"dictionaries")?xu(S.dictionaries):d.dictionaries;d={...d,...S,dictionaries:w},m?.update(d)},destroy(){u||(u=!0,m?.destroy(),l.remove(),C(new DOMException("制卡实例已销毁","AbortError")))}};return Promise.all([i.prepare(),Promise.resolve().then(()=>hO)]).then(([,{mountAnswerSheet:S}])=>{u||(m=S(l,i,d,p,w=>{C(w),x.destroy(),d.onError?.(w instanceof Error?w:new Error(String(w)))}))}).catch(S=>{C(S),x.destroy(),d.onError?.(S instanceof Error?S:new Error(String(S)))}),x}function Dm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vu={exports:{}},Ei={};/**
1
+ var NM=Object.defineProperty;var Z1=nt=>{throw TypeError(nt)};var MM=(nt,dt,Lt)=>dt in nt?NM(nt,dt,{enumerable:!0,configurable:!0,writable:!0,value:Lt}):nt[dt]=Lt;var gm=(nt,dt,Lt)=>MM(nt,typeof dt!="symbol"?dt+"":dt,Lt),W1=(nt,dt,Lt)=>dt.has(nt)||Z1("Cannot "+Lt);var Gt=(nt,dt,Lt)=>(W1(nt,dt,"read from private field"),Lt?Lt.call(nt):dt.get(nt)),J1=(nt,dt,Lt)=>dt.has(nt)?Z1("Cannot add the same private member more than once"):dt instanceof WeakSet?dt.add(nt):dt.set(nt,Lt),ym=(nt,dt,Lt,qs)=>(W1(nt,dt,"write to private field"),qs?qs.call(nt,Lt):dt.set(nt,Lt),Lt);var UniAnswerSheet=(function(nt){"use strict";var gt,fn;function dt(t,r){for(var i=0;i<r.length;i++){const a=r[i];if(typeof a!="string"&&!Array.isArray(a)){for(const c in a)if(c!=="default"&&!(c in t)){const l=Object.getOwnPropertyDescriptor(a,c);l&&Object.defineProperty(t,c,l.get?l:{enumerable:!0,get:()=>a[c]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Lt=["pagination","content-identity","choice-fill","answer-regions","html-codec","status"];function qs(t){const r=t.filter(a=>a?.kind==="answer-sheet-editor");if(r.length!==1)throw new Error("请显式注册一个富文本插件:plugins: [createEditorPlugin()]");const i=r[0];if(i.apiVersion!==1||i.documentVersion!==1||Lt.some(a=>!i.capabilities?.includes(a))||typeof i.prepare!="function"||typeof i.create!="function"||typeof i.validateDocument!="function"||typeof i.html?.parse!="function"||typeof i.html?.serialize!="function")throw new Error("富文本插件协议不兼容,需要支持制卡协议 v1 的 uni-editor/plugin");return i}function Ys(t){const r=[],i=a=>{if(a.type==="choiceGroup"){typeof a.attrs?.id=="string"&&r.push({id:a.attrs.id,label:a.attrs.label||String(r.length+1),options:(a.content||[]).map((c,l)=>({id:c.attrs?.id,label:String.fromCharCode(65+l)})).filter(c=>typeof c.id=="string")});return}a.content?.forEach(i)};return i(t.content),r}class iu extends Error{constructor(r,i){super(i),this.path=r}}const Xn=(t,r)=>{throw new iu(t,r)},Xs={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",科学:"SCIENCE",物理:"PHYSICAL",化学:"CHEMICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",历史:"HISTORY",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",信息科技:"IT",信息技术:"IT",日语:"JAPANESE"},eS={P:["语文","数学","英语","科学","道德与法治"],J:["语文","数学","英语","物理","化学","生物","地理","历史","道德与法治","信息科技"],S:["语文","数学","英语","物理","化学","生物","政治","历史","地理","信息技术","日语"]},tS=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三"].map((t,r)=>{const i=r<6?"P":r<9?"J":"S";return{label:t,value:`${i}0${r<6?r+1:(r-6)%3+1}`,classify:i}}),sa=(t,r)=>typeof t=="string"&&t.trim()?t.trim():Xn(r,"字典编码和名称必须是非空字符串"),Ks=(t,r)=>t&&typeof t=="object"&&!Array.isArray(t)?t:Xn(r,"字典必须是对象"),bm=t=>t.classify||(/^[PJS]/.test(t.value)?t.value[0]:void 0);function su(t={}){const r=Ks(t,"dictionaries"),i=(v,S)=>{if(!Array.isArray(v))return Xn(S,"字典选项必须是数组");const w=new Set;return v.map((T,j)=>{const R=Ks(T,`${S}.${j}`),O=sa(R.value,`${S}.${j}.value`),M=sa(R.label,`${S}.${j}.label`);return w.has(O)&&Xn(`${S}.${j}.value`,"字典编码重复"),w.add(O),{...R,value:O,label:M}})},a=i(r.grades===void 0?tS:r.grades,"dictionaries.grades").map((v,S)=>(v.classify!==void 0&&!["P","J","S"].includes(String(v.classify))&&Xn(`dictionaries.grades.${S}.classify`,"学段为 P、J 或 S"),{value:v.value,label:v.label,classify:v.classify})),c=r.gradeCourseMap===void 0?void 0:Ks(r.gradeCourseMap,"dictionaries.gradeCourseMap"),l=r.courseCodeToSubjectCode===void 0?{}:Ks(r.courseCodeToSubjectCode,"dictionaries.courseCodeToSubjectCode");for(const[v,S]of Object.entries(l))sa(S,`dictionaries.courseCodeToSubjectCode.${v}`);const u=new Map,d=Object.fromEntries(a.map(v=>{const S=bm(v),w=(S?eS[S]:[]).map(R=>({value:Xs[R],label:R,subjectCode:Xs[R]})),T=`dictionaries.gradeCourseMap.${v.value}`,j=i(c?c[v.value]??[]:w,T).map((R,O)=>{const M=l[R.value];R.subjectCode!==void 0&&M!==void 0&&R.subjectCode!==M&&Xn(`${T}.${O}.subjectCode`,"课程对应的学科编码冲突");const D=sa(R.subjectCode??M??(Object.values(Xs).includes(R.value)?R.value:void 0),`${T}.${O}.subjectCode`);return u.has(R.value)&&u.get(R.value)!==D&&Xn(`${T}.${O}.subjectCode`,"同一课程不能对应不同学科"),u.set(R.value,D),R.custom!==void 0&&typeof R.custom!="boolean"&&Xn(`${T}.${O}.custom`,"custom 必须是布尔值"),{value:R.value,label:R.label,subjectCode:D,...R.custom===void 0?{}:{custom:R.custom}}});return[v.value,j]})),m=a.filter(v=>d[v.value].length),p=r.defaultGradeCode===void 0?void 0:sa(r.defaultGradeCode,"dictionaries.defaultGradeCode"),C=m.find(v=>v.value===p)?.value||m[0]?.value||"",g=r.defaultCourseCode===void 0?void 0:sa(r.defaultCourseCode,"dictionaries.defaultCourseCode"),b=d[C]||[],x=b.find(v=>v.value===g)?.value||b[0]?.value||"";return{grades:m,gradeCourseMap:d,defaultGradeCode:C,defaultCourseCode:x}}function bi(t,r,i){const a=t.grades.find(l=>l.value===r);if(!a)return Xn("initialization.gradeCode","年级不在可用字典中");const c=t.gradeCourseMap[r]?.find(l=>l.value===i);return c?{grade:a.label,subject:c.label,gradeCode:r,courseCode:i,subjectCode:c.subjectCode,phaseCode:bm(a)}:Xn("initialization.courseCode","当前年级没有此课程")}function xm(t,r={}){const a=t.grades.find(u=>u.value===r.gradeCode||!r.gradeCode&&u.label===r.grade)?.value||t.defaultGradeCode,c=t.gradeCourseMap[a]||[],l=c.find(u=>u.value===r.courseCode||!r.courseCode&&u.label===r.subject)?.value||(a===t.defaultGradeCode?t.defaultCourseCode:c[0]?.value)||"";return a&&l?bi(t,a,l):{grade:"",subject:"",gradeCode:"",courseCode:""}}function vm(t){return t?.subjectCode||Xs[t?.subject||""]}const Sn={questions:200,options:12,score:15},nS=t=>t.multiple?t.indefinite?"indefinite":"multiple":"single",Kn=t=>Number.isFinite(t)&&Number.isInteger(t*2),xi=t=>!!(vm(t)==="MATHS"&&(t?.phaseCode?t.phaseCode==="S":t?.gradeCode?t.gradeCode.startsWith("S"):/^高[一二三]/.test(t?.grade||"")));function rS(t){const r=typeof t.score=="number"&&Kn(t.score)&&t.score>=.5&&t.score<=Sn.score?t.score:null,i=[...new Set(t.correctIds)].filter(a=>t.options.some(c=>c.id===a));return{...t,indefinite:!!(t.multiple&&t.indefinite),score:r,scoreType:t.multiple&&t.scoreType==="ITEM_SCORE"?"ITEM_SCORE":"LESS_SCORE",lessScore:t.multiple&&r!==null&&Kn(t.lessScore??0)?Math.max(0,Math.min(r,t.lessScore??0)):0,correctIds:t.multiple?i:i.slice(0,1)}}function lu(t,r,i){let a={...t};if(r.kind!==void 0){const c=r.kind!=="single";c&&!t.multiple&&(a.scoreType=xi(i)?"ITEM_SCORE":"LESS_SCORE",typeof a.score!="number"&&xi(i)&&(a.score=6)),a.multiple=c,a.indefinite=r.kind==="indefinite"}if(r.optionCount!==void 0){const c=Math.max(2,Math.min(Sn.options,Math.round(r.optionCount)));a.options=Array.from({length:c},(l,u)=>t.options[u]||{id:crypto.randomUUID(),label:String.fromCharCode(65+u)})}return r.score!==void 0&&(a.score=r.score),r.scoreType!==void 0&&(a.scoreType=r.scoreType),r.lessScore!==void 0&&(a.lessScore=r.lessScore),rS(a)}function cu(t){return typeof t.score=="number"&&(!Kn(t.score)||t.score<.5||t.score>Sn.score)?"每题分值须为 0.5–15 分,按 0.5 分递增":t.multiple&&t.scoreType==="LESS_SCORE"&&typeof t.score=="number"&&(!Kn(t.lessScore??0)||(t.lessScore??0)<0||(t.lessScore??0)>t.score)?"少选得分须为 0.5 的倍数,且不能超过本题分值":t.multiple&&t.scoreType==="ITEM_SCORE"&&typeof t.score=="number"&&t.correctIds.length&&!Kn(t.score/t.correctIds.length)?"答案个数与分值不匹配,每个正确选项的得分须为 0.5 的倍数":null}function oS(t){return t.multiple&&t.scoreType==="ITEM_SCORE"&&typeof t.score=="number"&&t.correctIds.length&&!cu(t)?t.score/t.correctIds.length:null}function uu(t){const r=t.map(c=>Number(c.label)).filter(c=>Number.isSafeInteger(c)&&c>0&&c<1e5);let i=String(Math.max(0,...r)+1);const a=new Set(t.map(c=>c.label));for(;a.has(i);)i=String(Number(i)+1);return i}function aS(t,r){const i=new Map(t.options.map(a=>[a.id,crypto.randomUUID()]));return{...t,id:crypto.randomUUID(),label:r,breakBefore:!1,contentTarget:null,options:t.options.map(a=>({...a,id:i.get(a.id)})),correctIds:t.correctIds.map(a=>i.get(a)).filter(Boolean)}}function Sm(t,r,i){return i.trim()?t.some(a=>a.id!==r&&a.label.trim()===i.trim())?"题组内题号不能重复":null:"题号不能为空"}function iS(t,r,i,a){const c=t.questions.filter(m=>r.includes(m.id));if(!c.length)return{error:"请选择要修改的题目"};let l;if(i.type==="settings"){if(!Object.keys(i.patch).length)return{error:"请设置需要修改的属性"};const{optionCount:m,score:p,lessScore:C}=i.patch;if(m!==void 0&&(!Number.isInteger(m)||m<2||m>Sn.options))return{error:"选项个数须为 2–12 的整数"};if(typeof p=="number"&&(!Kn(p)||p<.5||p>Sn.score))return{error:"每题分值须为 0.5–15 分,按 0.5 分递增"};if(C!==void 0&&(!Kn(C)||C<0))return{error:"少选得分须为非负的 0.5 倍数"};if(l=c.map(g=>lu(g,i.patch,a)),C!==void 0&&l.some(g=>g.multiple&&g.scoreType!=="ITEM_SCORE"&&C>(g.score??0)))return{error:"少选得分不能超过所选题目的分值"}}else if(i.type==="numbering"){if(!Number.isInteger(i.start)||i.start<1||i.start+c.length-1>1e3)return{error:"连续题号须在 1–1000 内"};l=c.map((m,p)=>({...m,label:String(i.start+p)}))}else if(i.type==="average"){const m=i.total/c.length;if(!Kn(m)||m<.5||m>Sn.score)return{error:"总分无法平均分配,每题须为 0.5–15 分且为 0.5 的倍数"};l=c.map(p=>lu(p,{score:m}))}else{const m=i.text.toUpperCase().trim().split(/[\s,,;;]+/).filter(Boolean);if(m.length!==c.length)return{error:`需要 ${c.length} 组答案,当前为 ${m.length} 组`};l=[];for(let p=0;p<c.length;p++){const C=c[p],g=m[p];if(g!=="-"&&(!/^[A-T]+$/.test(g)||new Set(g).size!==g.length||[...g].some(x=>!C.options.some(v=>v.label===x))))return{error:`第 ${C.label} 题包含无效或重复选项`};const b=g==="-"?[]:[...g].map(x=>C.options.find(v=>v.label===x).id);if(!C.multiple&&b.length>1)return{error:`第 ${C.label} 题为单选,只能设置一个答案`};l.push({...C,correctIds:b})}}const u=new Map(l.map(m=>[m.id,m])),d=t.questions.map(m=>u.get(m.id)||m);for(const m of l){const p=Sm(d,m.id,m.label)||cu(m);if(p)return{error:`第 ${m.label} 题:${p}`}}return{value:{...t,questions:d}}}const sS={layout:"natural",columns:2,indent:!1,rowGap:0,columnGap:32,marker:"letter"},du=t=>`question:${t}`,fu=t=>t.presentation==="stem"?"stem":["option","distributed"].includes(t.presentation)?"option":"concentrated";function hu(t,r,i){const a=Ys(r),c=new Map,l=(d,m)=>{const p=d.attrs?.contentId||m;d.type==="choiceGroup"&&p&&c.set(d.attrs.id,p),d.content?.forEach(C=>l(C,p))};l(r.content);const u=new Set(t.questions.map(d=>d.contentTarget?.groupId));return{...t,presentation:i,questions:t.questions.map((d,m)=>{const p=a.find(C=>c.get(C.id)===d.id)||(c.size?void 0:a[m]);return i==="concentrated"||d.contentTarget!==void 0||!p||u.has(p.id)?d:(u.add(p.id),{...d,contentTarget:{groupId:p.id,optionIds:p.options.map(C=>C.id)}})})}}function la(t,r,i){const a=fu(t),c=new Map(Ys(r).map(b=>[b.id,b])),l=new Set,u=new Map,d=new Map,m=(b,x)=>{const v=b.attrs?.contentId||x;b.type==="choiceGroup"&&v&&(u.set(v,[...u.get(v)||[],b.attrs.id]),d.set(b.attrs.id,v)),b.type==="choiceStemAnchor"&&typeof b.attrs?.groupId=="string"&&l.add(b.attrs.groupId),b.content?.forEach(S=>m(S,v))};m(r.content);const p=[],C=new Set,g=t.questions.filter(b=>{if(!i||a==="concentrated")return!0;if(a==="stem"&&l.has(du(b.id)))return p.push({groupId:du(b.id),questionId:b.id,options:b.options.map(j=>({...j,contentOptionId:j.id}))}),!1;const x=u.get(b.id),v=x?.length===1?c.get(x[0]):void 0,S=v?{groupId:v.id,optionIds:v.options.map(j=>j.id)}:b.contentTarget,w=S&&c.get(S.groupId);if(!S||!w||C.has(w.id)||a==="stem"&&!l.has(w.id)||d.has(w.id)&&d.get(w.id)!==b.id)return!0;const T=S.optionIds.slice(0,b.options.length);return T.length!==b.options.length||new Set(T).size!==T.length||T.some(j=>!w.options.some(R=>R.id===j))?!0:(C.add(w.id),p.push({groupId:w.id,questionId:b.id,options:b.options.map((j,R)=>({...j,contentOptionId:T[R]}))}),!1)});return{position:a==="concentrated"?void 0:a,bindings:p,concentrated:{...t,questions:g}}}function ca(t,r=4){return{id:crypto.randomUUID(),label:String(t+1),multiple:!1,indefinite:!1,score:null,scoreType:"LESS_SCORE",lessScore:0,correctIds:[],breakBefore:!1,options:Array.from({length:r},(i,a)=>({id:crypto.randomUUID(),label:String.fromCharCode(65+a)}))}}function mu(t=8){return{source:"manual",presentation:"concentrated",direction:"row",rowsPerColumn:5,marker:"box",rowGap:0,columnGap:0,questions:Array.from({length:t},(r,i)=>ca(i))}}function pu(t){return new Set(t.questions.map(r=>r.options.length)).size>1?"column":t.direction}function lS(t){const r=[];for(const i of t.questions){const a=r.at(-1);(!a||a.length>=t.rowsPerColumn||i.breakBefore||a[0].options.length!==i.options.length)&&r.push([]),r[r.length-1].push(i)}return r}function cS(t){const r=[];for(const i of lS(t))(!r.length||i[0].breakBefore)&&r.push([]),r[r.length-1].push(i);return r}const uS={judge:"判断题",fill:"填空题",answer:"解答题",calculation:"计算/证明",matching:"信息匹配/连线",ordering:"排序/分类",correction:"改错题",drawing:"作图题",table:"表格填答",writing:"语文作文",english:"外语写作",reading:"阅读理解",cloze:"完形填空",completion:"语法填空",chunk:"断句题",composite:"材料/复合题",optional:"选做题组",practice:"实践评价"},dS={choice:"选择",judge:"判断",fill:"填空",answer:"简答",calculation:"计算/证明",correction:"改错",drawing:"作图",table:"表格",writing:"作文",english:"外语写作"},Cm=["reading","cloze","completion","composite","optional"],Vt=()=>({version:1,content:{type:"doc",content:[{type:"paragraph"}]}}),wm={symbols:["√","×"],letters:["T","F"],words:["正确","错误"]},Fs=t=>["writing","english"].includes(t)?70:["answer","calculation","drawing","table","correction"].includes(t)?60:15,Em=t=>t==="judge"?200:t==="fill"?50:["reading","cloze","completion"].includes(t)?20:t==="matching"?9:100;function Tm(t=0){return{id:crypto.randomUUID(),label:String(t+1),width:50,style:"line",characters:6,score:null,answers:[],prefix:"",suffix:"",breakAfter:!1}}function gu(t,r="1"){const i=crypto.randomUUID();return{id:i,label:r,kind:t,document:Vt(),reference:Vt(),explanation:Vt(),score:null,choice:{...ca(0,t==="judge"?2:4),id:i,label:r},presentation:"concentrated",blanks:[Tm()],steps:[],needsReason:!1,judgment:null,targets:[],area:{style:t==="writing"?"characters":t==="english"?"lines":t==="drawing"?"grid":"blank",rows:t==="writing"?20:6,columns:20,rowHeight:t==="writing"?40:28,wordMark:100,title:!1,backgroundUrl:""}}}function yu(t){return["reading","cloze","chunk"].includes(t)?"choice":["matching","completion"].includes(t)?"fill":["ordering","composite","optional","practice"].includes(t)?"answer":t}function fS(t){return{items:[gu(yu(t))],judgeLabels:"symbols",fillNewLine:!0,pool:[],relation:"one",reuseOptions:!0,matchingDisplay:"letters",ordering:"sequence",sequence:[],categories:[],assignments:{},chooseCount:1,groupScore:null,chunkText:"",chunkPoints:[],chunkCorrect:[],chunkMax:3,chunkScore:null,attachmentUrl:""}}function Ur(t){return String(Math.max(0,...t.map(r=>/^\d+$/.test(r.label)?Number(r.label):0))+1)}function Ao(t){const r=structuredClone(t),i=new Map,a=l=>{!l||typeof l!="object"||Object.entries(l).forEach(([u,d])=>{["id","answerId"].includes(u)&&typeof d=="string"?i.set(d,crypto.randomUUID()):a(d)})};a(r);const c=l=>typeof l=="string"?i.get(l)||l:Array.isArray(l)?l.map(c):l&&typeof l=="object"?Object.fromEntries(Object.entries(l).map(([u,d])=>[i.get(u)||u,c(d)])):l;return c(r)}function hS(t,r){const i=Ao(t);return{...i,label:r,choice:{...i.choice,label:r}}}function ua(t,r,i){const a=t.findIndex(u=>u.id===r),c=a+i;if(a<0||c<0||c>=t.length)return t;const l=[...t];return l.splice(c,0,...l.splice(a,1)),l}function mS(t,r){return{...t,pool:t.pool.filter(i=>i.id!==r),sequence:t.sequence.filter(i=>i!==r),assignments:Object.fromEntries(Object.entries(t.assignments).filter(([i])=>i!==r)),items:t.items.map(i=>({...i,targets:i.targets.filter(a=>a!==r)}))}}function pS(t,r,i){const a=[...new Set(i)].filter(l=>t.pool.some(u=>u.id===l)),c=t.relation==="one"?a.slice(-1):a;return{...t,items:t.items.map(l=>l.id===r?{...l,targets:c}:t.reuseOptions?l:{...l,targets:l.targets.filter(u=>!c.includes(u))})}}function gS(t,r){let i=0;for(;i<r.length&&i<t.chunkText.length&&r[i]===t.chunkText[i];)i++;let a=0;for(;a<r.length-i&&a<t.chunkText.length-i&&r[r.length-1-a]===t.chunkText[t.chunkText.length-1-a];)a++;const c=t.chunkText.length-a,l=new Set,u=t.chunkPoints.filter(d=>d.offset<=i||d.offset>=c).map(d=>({...d,offset:d.offset<=i?d.offset:d.offset+r.length-t.chunkText.length})).filter(d=>d.offset<=0||d.offset>=r.length||l.has(d.offset)?!1:(l.add(d.offset),!0));return{...t,chunkText:r,chunkPoints:u,chunkCorrect:t.chunkCorrect.filter(d=>u.some(m=>m.id===d))}}function yS(t,r){const i=[],a=t.items.map(c=>c.label.trim());(a.some(c=>!c)||new Set(a).size!==a.length)&&i.push("题号不能为空或重复");for(const c of t.items){c.score!==null&&(!Number.isFinite(c.score)||c.score<.5||c.score>Fs(c.kind)||!Number.isInteger(c.score*2))&&i.push(`${c.label} 题分值超出范围或不是 0.5 的倍数`);const u=(c.kind==="fill"?c.blanks:c.steps).map(d=>d.score);u.length&&c.score!==null&&u.every(d=>d!==null)&&u.reduce((d,m)=>d+(m||0),0)!==c.score&&i.push(`${c.label} 题分项分值之和与题分不一致`)}if(["matching","ordering"].includes(r)){const c=t.pool.map(l=>l.label.trim());(c.some(l=>!l)||new Set(c).size!==c.length)&&i.push("共享选项编号不能为空或重复")}return r==="optional"&&t.chooseCount>t.items.length&&i.push("选做数量不能超过题目数量"),r==="chunk"&&t.chunkCorrect.length>t.chunkMax&&i.push("正确断点数不能超过最多选择数"),i}function bS(t=3,r=3){return{version:1,content:{type:"doc",content:[{type:"table",content:Array.from({length:t},()=>({type:"tableRow",content:Array.from({length:r},()=>({type:"tableCell",content:[{type:"paragraph"}]}))}))}]}}}function Cn(t){const r=i=>!!(i.text||i.type&&!["doc","paragraph","choiceStemAnchor"].includes(i.type)||i.content?.some(r));return!r(t.content)}const jm={choice:"选择题",area:"空白区域",...uS};function xS(t){return{id:crypto.randomUUID(),kind:"area",areaType:t,title:t==="forbiden"?"禁止答题区":"空白答题区",answerHeight:t==="forbiden"?100:200,document:{version:1,content:{type:"doc",content:t==="forbiden"?["请勿在此区域作答","或者做任何标记"].map(r=>({type:"paragraph",attrs:{textAlign:"center",lineSpacing:0},content:[{type:"text",text:r}]})):[{type:"paragraph"}]}}}}function Am(){return{version:1,title:"",questionCard:!1,preset:"a3-two",margin:15,gap:10,blocks:[]}}function vS(t=""){return{id:crypto.randomUUID(),height:70,document:{version:1,content:{type:"doc",content:[{type:"paragraph",attrs:{textAlign:"center",lineSpacing:9},...t?{content:[{type:"text",text:t,marks:[{type:"textStyle",attrs:{fontFamily:"SimSun, 宋体, serif",fontSize:"22px"}}]}]}:{}}]}}}}function bu(t){return{...Am(),title:t.name,creation:t,paperTitle:vS(t.name),header:{focusText:!0,writeKaohao:!1,missExam:!1,mifeng:!1,kaohao:"school",weishu:8}}}function Ro(t,r=96){return t*r/25.4}const vi={a4:{label:"A4 单栏",width:210,height:297,columns:1},"a3-two":{label:"A3 双栏",width:420,height:297,columns:2},"a3-three":{label:"A3 三栏",width:420,height:297,columns:3}},Oo=44,Si=16,Qs=1;function xu(t,r){const i=vi[t.preset],a=Ro(i.width),c=Ro(i.height),l=Ro(t.margin),u=Ro(t.gap),d=t.usage!=="homework"&&t.header?.mifeng?Ro(t.header.kaohao==="code"?26:14):0,m=a-l*2-d,p=(m-u*(i.columns-1))/i.columns,C=Math.max(l,t.header?t.recognition?.examQrCode?64:39:0),g=Math.max(l,t.header?56:0),b=c-C-g,x=b-Si,v=t.header?p:m,S=r&&r.id===t.paperTitle?.id&&Math.abs(r.width-v)<1?r:void 0,w=t.paperTitle?Math.min(b,S?.height??t.paperTitle.height+(t.header?260:Si)):0,T=(M,D=0)=>!!t.paperTitle&&(t.header?M%2===0&&D===0:M===0),j=(M,D=0)=>T(M,D)?w:0;return{...i,width:a,height:c,margin:l,topInset:C,bottomInset:g,gap:u,sealWidth:d,contentWidth:m,contentHeight:b,columnWidth:p,columnX:(M,D)=>l+(M%2===0?d:0)+D*(p+u),titleWidth:v,titleMaxHeight:x,hasHeader:T,headerHeight:j,capacity:(M,D=0)=>b-j(M,D)}}function SS(t,r,i){const a=xu(t,i);let c=0,l=0,u=0;const d=()=>{l++,l===a.columns&&(l=0,c++),u=0},m=t.blocks.map(C=>{const g=r[C.id],b=g&&Math.abs(g.width-a.columnWidth)<1?g.height:100+C.answerHeight,x=g&&Math.abs(g.width-a.columnWidth)<1?[...new Set([...g.breaks||[],b].filter(O=>Number.isFinite(O)&&O>0&&O<=b))].sort((O,M)=>O-M):[],v=C.reference?.type==="CCOMPOSITION",S=O=>v&&O>0?Math.max(0,6-Math.max(0,(g?.compositionStart||0)-O)):0;if(x.length>1&&x.every((O,M)=>{const D=x[M-1]||0;return O-D+S(D)<=a.capacity(1)+.5})){const O=[];let M=0;for(;M<b-.5;){const _=a.capacity(c,l)-u,I=M,B=S(M),H=X=>g?.markingFrames?.some(G=>G.from>=I-.5&&G.from<X-.5&&G.to>X+.5)?22:0,z=x.filter(X=>X>I+.5&&X+H(X)<=I+_-B+.5).at(-1);if(z===void 0){d();continue}const $=v&&z<b-.5?Math.max(H(z),_-B-(z-M)):H(z);O.push({page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Oo)+a.topInset+a.headerHeight(c,l)+u,from:M,to:z,...B?{topPadding:B}:{},...$?{bottomPadding:$}:{}}),u+=z-M+B,M=z,M<b-.5&&d()}u+=Si;const D=O[0];return{id:C.id,...D,height:b,available:a.capacity(D.page,D.column),overflowing:!1,fragments:O}}for(;u+b>a.capacity(c,l)+.5&&(u>0||a.headerHeight(c,l)>0);)d();const T=a.capacity(c,l),j=b>T+.5,R={id:C.id,page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Oo)+a.topInset+a.headerHeight(c,l)+u,height:b,available:T,overflowing:j,fragments:[{page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Oo)+a.topInset+a.headerHeight(c,l)+u,from:0,to:Math.min(b,T)}]};return u+=Math.min(b,T)+Si,R}),p=new Map;m.forEach((C,g)=>C.fragments.forEach(b=>{const x=`${b.page}/${b.column}`,v=p.get(x)||[];v.push({fragment:b,placement:C,blockIndex:g}),p.set(x,v)})),p.forEach(C=>{const g=C.filter(S=>["answer","writing","english","composite","area"].includes(t.blocks[S.blockIndex].kind)).at(-1);if(!g||t.blocks[g.blockIndex].reference?.type!=="CCOMPOSITION"&&t.blocks[g.blockIndex].kind!=="area")return;const b=C.at(-1).fragment,v=b.page*(a.height+Oo)+a.height-a.bottomInset-b.y-(b.to-b.from)-(b.topPadding||0)-(b.bottomPadding||0);v<=0||v>30||(g.fragment.bottomPadding=(g.fragment.bottomPadding||0)+v,C.slice(C.indexOf(g)+1).forEach(({fragment:S,placement:w})=>{S.y+=v,w.fragments[0]===S&&(w.y=S.y)}))});for(const C of m)(C.overflowing||C.fragments.some(g=>g.page>=Qs))&&(C.overflowFrom=C.fragments.filter(g=>g.page<Qs).at(-1)?.to||0);return{geometry:a,placements:m,pageCount:Qs,requiredPageCount:c+1}}function Ci(t,r){return{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:`${t}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]},...r?[{type:"text",text:`(${r}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}]:[]]}]}}}function wn(t,r,i){const a=c=>{if(!c.content)return c;let l;const u=c.content.flatMap(m=>{const p=m.type==="text"&&m.marks?.find(b=>b.type==="documentLabel")?.attrs?.kind,C=p&&p===l;if(l=p,C)return[];if(!p)return[a(m)];const g=p==="number"?`${r}.`:i?`(${i}分)`:"";return g?[{...m,text:g}]:[]}),d=u.findIndex(m=>m.marks?.some(p=>p.type==="documentLabel"&&p.attrs?.kind==="number"));return i&&d>=0&&!u.some(m=>m.marks?.some(p=>p.type==="documentLabel"&&p.attrs?.kind==="score"))&&u.splice(d+1,0,{type:"text",text:`(${i}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}),{...c,content:u}};return{...t,content:a(t.content)}}const cr={SCHOICE:"单选题",MCHOICE:"多选题",JUDGE:"判断题",FILLBLANK:"填空题",SHORTANSWER:"解答题",MIXED:"复合题",CLOZE:"完形填空",READTHENANSWER:"阅读理解",INFO_MATCHING:"信息匹配",TEXT_COMPLETION:"语法填空",ECOMPOSITION:"英语作文",CCOMPOSITION:"语文作文",CHUNK_CHOICE:"断句题"},Rm=["SCHOICE","MCHOICE","JUDGE","FILLBLANK","SHORTANSWER","MIXED"];function Om(t,r=!1){const i=vm(t),a=r?Rm.filter(c=>c!=="MIXED"):Rm;return r?["CHINESE","JAPANESE"].includes(i||"")?[...a,"CHUNK_CHOICE"]:a:i==="CHINESE"?[...a,"CCOMPOSITION","CHUNK_CHOICE"]:i==="ENGLISH"?[...a,"CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION","ECOMPOSITION"]:i==="JAPANESE"?Object.keys(cr):["POLITICAL","HISTORY"].includes(i||"")?[...a,"CCOMPOSITION"]:a}const CS=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),wS=t=>["SCHOICE","MCHOICE","CLOZE","READTHENANSWER","INFO_MATCHING","JUDGE"].includes(t),$r=t=>({version:1,content:{type:"doc",content:t.length?t:[{type:"paragraph"}]}});function wi(t,r,i=!1){return{content:Vt(),numbered:!i,groupId:`options:${r.id}`,layout:{...sS,columns:t==="CLOZE"?4:2,...t==="READTHENANSWER"?{layout:"fixed",columnGap:0}:{}},itemsContent:!i&&wS(t)?r.options.map(a=>({id:a.id,key:a.label,content:Vt()})):[]}}const Zs=t=>{if(t.type==="choiceStemAnchor"||t.type==="text"&&t.marks?.some(a=>a.type==="documentLabel"&&a.attrs?.kind==="number"))return null;const{contentId:r,...i}=t.attrs||{};return{...t,...t.attrs?{attrs:i}:{},...t.content?{content:t.content.map(Zs).filter(a=>a!==null)}:{}}};function Ws(t,r,i){const c=(t.content.content.content||[{type:"paragraph"}]).map(l=>({...l,attrs:{...l.attrs,contentId:r}}));if(t.numbered){const l={type:"text",text:`${i}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]};["paragraph","heading"].includes(c[0]?.type||"")||c.unshift({type:"paragraph",attrs:{contentId:r},content:[]}),c[0]={...c[0],content:[l,...c[0].content||[]]}}return t.itemsContent.length&&c.push({type:"choiceGroup",attrs:{id:t.groupId,contentId:r,...t.layout},content:t.itemsContent.map(l=>({type:"choiceOption",attrs:{id:l.id,label:l.key,sourceKey:l.key,marker:"letter"},content:l.content.content.content||[{type:"paragraph"}]}))}),c}function Nm(t,r){const i=r.filter(d=>d.type==="choiceGroup"),a=i.find(d=>d.attrs?.id===t.groupId)||(i.length===1?i[0]:void 0),c=r.filter(d=>d!==a);let l=!1;const u=d=>{d.marks?.some(m=>m.type==="documentLabel"&&m.attrs?.kind==="number")&&(l=!0),d.content?.forEach(u)};return c.forEach(u),{...t,numbered:l,content:$r(c.map(Zs).filter(d=>d!==null)),groupId:a?.attrs?.id||t.groupId,layout:a?Object.fromEntries(Object.entries(t.layout).map(([d,m])=>[d,a.attrs?.[d]??m])):t.layout,itemsContent:(a?.content||[]).map((d,m)=>({id:d.attrs?.id||t.itemsContent[m]?.id||crypto.randomUUID(),key:d.attrs?.label||String.fromCharCode(65+m),content:$r((d.content||[]).map(Zs).filter(p=>p!==null))}))}}function Mm(t,r,i,a){const c=new Map;r.content.content?.forEach(d=>{d.attrs?.contentId&&c.set(d.attrs.contentId,[...c.get(d.attrs.contentId)||[],d])});const l=new Set(a?.content.content?.map(d=>d.attrs?.contentId).filter(Boolean)),u=(d,m)=>m&&(c.has(d)||l.has(d))?Nm(m,c.get(d)||[]):m;return{...t,...c.has(i)?{material:$r(c.get(i).map(d=>Zs(d)))}:{},questions:t.questions.map(d=>({...d,text:u(d.id,d.text),parts:d.parts.map(m=>({...m,text:u(m.id,m.text)}))}))}}function vu(t){const r=t.reference,i=[];r.type==="MIXED"&&i.push(...(r.material||Vt()).content.content.map(c=>({...c,attrs:{...c.attrs,contentId:t.id}}))),r.questions.forEach(c=>{c.text&&i.push(...Ws(c.text,c.id,c.label)),CS(c.type)&&c.parts.forEach(l=>{l.text&&i.push(...Ws(l.text,l.id,l.label))})});const a=(t.document.content.content||[]).filter(c=>!c.attrs?.contentId);return Cn($r(a))||i.push(...a),$r(i)}function ES(t,r){const i=(a,c,l)=>!a||!l||c.options.map(u=>u.id).join()===l.options.map(u=>u.id).join()?a:{...a,itemsContent:c.options.map(u=>({...a.itemsContent.find(d=>d.id===u.id),id:u.id,key:u.label,content:a.itemsContent.find(d=>d.id===u.id)?.content||Vt()}))};return{...t,questions:t.questions.map(a=>{const c=r.questions.find(l=>l.id===a.id);return{...a,text:i(a.text,a.choice,c?.choice),parts:a.parts.map(l=>({...l,text:i(l.text,l.choice,c?.parts.find(u=>u.id===l.id)?.choice)}))}})}}function TS(t,r,i){if(t.reference?.textVersion!==1)return t;let a=t.reference;if(!r&&!Cn(t.document)&&!t.document.content.content?.some(l=>l.attrs?.contentId))return{...t,reference:{...a,textVersion:void 0}};if(r?.reference===a&&r.document===t.document&&!Cn(t.document))return t;if(t.document!==r?.document&&(!Cn(t.document)||r)&&(a=Mm(a,t.document,t.id,r?.document),r&&t.reference===r.reference))return{...t,reference:a};r?.reference&&t.reference!==r.reference&&(a=ES(a,r.reference));const c={...t,reference:a};return i||!Cn(t.document)?{...c,document:vu(c)}:c}const da={SCHOICE:{count:200,options:[2,12],parts:1,score:15},MCHOICE:{count:200,options:[2,12],parts:1,score:15},JUDGE:{count:200,options:[2,2],parts:1,score:15},CHUNK_CHOICE:{count:100,options:[2,26],parts:1,score:10},FILLBLANK:{count:50,options:[0,0],parts:20,score:15},SHORTANSWER:{count:100,options:[0,0],parts:10,score:60},CLOZE:{count:20,options:[4,4],parts:20,score:15},READTHENANSWER:{count:20,options:[2,12],parts:20,score:15},INFO_MATCHING:{count:20,options:[1,9],parts:9,score:15},TEXT_COMPLETION:{count:20,options:[0,0],parts:20,score:15},CCOMPOSITION:{count:1,options:[0,0],parts:1,score:70},ECOMPOSITION:{count:1,options:[0,0],parts:1,score:70}},Et=t=>["SCHOICE","MCHOICE","JUDGE","CHUNK_CHOICE","CLOZE","READTHENANSWER","INFO_MATCHING"].includes(t),Be=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),Ei=t=>t==="FILLBLANK"||t==="TEXT_COMPLETION",Ti=t=>t==="CCOMPOSITION"||t==="ECOMPOSITION",jS={SCHOICE:"choice",MCHOICE:"choice",JUDGE:"judge",FILLBLANK:"fill",SHORTANSWER:"answer",MIXED:"composite",CLOZE:"cloze",READTHENANSWER:"reading",INFO_MATCHING:"matching",TEXT_COMPLETION:"completion",ECOMPOSITION:"english",CCOMPOSITION:"writing",CHUNK_CHOICE:"chunk"};function Su(t){return{type:t,textVersion:1,questions:[],layout:mu(0),fillNewLine:!1,optional:!1,choose:1,optionalHeight:200,scoreType:"LESS_SCORE"}}function _m(t){return{id:crypto.randomUUID(),kind:jS[t],title:cr[t],answerHeight:0,document:Vt(),reference:Su(t)}}function Cu(t,r=1,i){const a=t==="MCHOICE"&&xi(i);return{type:t,start:r,end:r,optionCount:t==="INFO_MATCHING"?null:t==="CHUNK_CHOICE"?12:t==="JUDGE"?2:4,partCount:Be(t)?null:1,score:a?6:null,scoreType:a?"ITEM_SCORE":"LESS_SCORE",lessScore:0,characters:1e3,lines:10,rightAnswers:null,singleScore:1}}function fa(t,r,i){const a=Array.from({length:i},(c,l)=>({...t.options[l]||{id:crypto.randomUUID()},label:r==="JUDGE"?["T","F"][l]:String.fromCharCode(65+l)}));return{...t,options:a,multiple:r==="MCHOICE"||r==="CHUNK_CHOICE",indefinite:!1,correctIds:t.correctIds.filter(c=>a.some(l=>l.id===c)).slice(0,r==="MCHOICE"||r==="CHUNK_CHOICE"?i:1)}}function ji(t,r,i,a=4){const c=crypto.randomUUID(),l={...fa(ca(0),i,a),id:c,label:t,score:r};return{id:c,label:t,score:r,width:25,breakAfter:!1,height:100,document:i==="SHORTANSWER"?Ci(t,r):Vt(),choice:l,...Be(i)&&i!=="TEXT_COMPLETION"?{text:wi(i,l)}:{}}}function wu(t,r){const i=crypto.randomUUID(),{type:a,score:c}=t,l=String(r),u=t.partCount||1,d=Array.from({length:Be(a)||["FILLBLANK","SHORTANSWER"].includes(a)?u:0},(p,C)=>ji(Be(a)?String(r+C):u===1?l:`${l}.${C+1}`,c,a,t.optionCount||4)),m={...fa(ca(0),a,t.optionCount||4),id:i,label:l,score:c,scoreType:t.scoreType,lessScore:t.lessScore};return{id:i,type:a,label:l,score:d.length?Fn(d):c,choice:m,text:wi(a,m,Be(a)),parts:d,document:a==="ECOMPOSITION"?{version:1,content:{type:"doc",content:[...Ci(l,c).content.content,...MS(t.lines,t.paperWidth||600).content.content]}}:a==="CCOMPOSITION"?Ci(l,c):Vt(),height:a==="ECOMPOSITION"?50*t.lines+40:100,contentHeight:38,characters:t.characters,lines:t.lines,halfPoint:!1,rightAnswers:t.rightAnswers,singleScore:t.singleScore}}const Fn=t=>t.some(r=>r.score===null)?null:t.reduce((r,i)=>r+(i.score||0),0);function Eu(t){return t.questions.flatMap(r=>Be(r.type)?r.parts.map(i=>i.label):[r.label])}function Js(t){return Math.max(0,...Eu(t).map(Number).filter(Number.isFinite))+1}function AS(t,r,i=!1,a=!1){const c=da[r.type],l=Ti(r.type)?1:r.end-r.start+1;if(!Number.isInteger(r.start)||r.start<1||r.end>1e3||!Number.isInteger(l)||l<1||l>c.count)return`题号须为 1–1000,单次题数为 1–${c.count}`;if(t.type==="CCOMPOSITION"&&t.questions.length)return"语文作文每组只能有一道题";if(t.optional)return"选做题组不能追加题目";const u=Eu(t);if(Array.from({length:l},(d,m)=>String(r.start+m)).some(d=>u.includes(d)))return"同一分组内,题号不能重复";if(Et(r.type)&&(r.optionCount===null||!Number.isInteger(r.optionCount)||r.optionCount<c.options[0]||r.optionCount>c.options[1]))return`选项个数须为 ${c.options[0]}–${c.options[1]}`;if((Be(r.type)||["FILLBLANK","SHORTANSWER"].includes(r.type))&&(!r.partCount||!Number.isInteger(r.partCount)||r.partCount<1||r.partCount>c.parts))return`子题/空数须为 1–${c.parts}`;if(Be(r.type)&&l%r.partCount!==0)return"题目数量无法按子题数量均分,请重新设置";if(r.type==="INFO_MATCHING"&&r.partCount>r.optionCount)return"选项个数需大于等于子题数量";if(r.type==="SHORTANSWER"&&(i||t.optional)&&r.partCount!==1)return"网阅或选做题不支持小题";if(r.score!==null&&(!Number.isFinite(r.score)||r.score<(a?0:.5)||r.score>c.score||!Number.isInteger(r.score*2)))return`分值须为 ${a?0:.5}–${c.score} 分,按 0.5 分递增`;if(r.type==="MCHOICE"&&(r.lessScore<0||!Number.isInteger(r.lessScore*2)||r.lessScore>(r.score||0)))return"少选得分不能超过本题分值";if(r.type==="CHUNK_CHOICE"){if(!r.rightAnswers||!Number.isInteger(r.rightAnswers)||r.rightAnswers>=r.optionCount)return"正确答案个数需小于选项个数";if(r.singleScore===null||r.singleScore<.5||!Number.isInteger(r.singleScore*2)||r.score!==null&&r.score!==0&&r.singleScore*r.rightAnswers>r.score)return"每处得分乘以正确答案个数不可大于每题分数"}return r.type==="CCOMPOSITION"&&(!Number.isInteger(r.characters)||r.characters<1||r.characters>1200)?"作文格数须为 1–1200":r.type==="ECOMPOSITION"&&(!Number.isInteger(r.lines)||r.lines<1||r.lines>100)?"作文行数须为 1–100":r.score===null?"请输入分值":null}function RS(t,r,i){const a=Be(r.type)?r.partCount:1,c=[];for(let d=r.start;d<=(Ti(r.type)?r.start:r.end);d+=a)c.push(wu(r,d));const l=[...t.questions],u=l.findIndex(d=>d.id===i||d.parts.some(m=>m.id===i));return l.splice(u<0?l.length:u+1,0,...c),{...t,questions:l}}function el(t){return t.questions.flatMap(r=>[r,...r.parts])}function ha(t){return t.questions.filter(r=>Et(r.type)).flatMap(r=>Be(r.type)?r.parts.map(i=>({...i.choice,label:i.label,score:i.score})):[{...r.choice,label:r.label,score:r.score}])}function OS(t,r){const i=Ao(t);return i.referenceData&&(i.referenceData={...i.referenceData,questionId:i.id}),i.text&&(i.text.groupId=`options:${i.id}`),i.label=String(r),i.choice.label=i.label,i.choice.contentTarget=null,i.choice.breakBefore=!1,i.parts.forEach((a,c)=>{a.label=Be(i.type)?String(r+c):i.parts.length===1?i.label:`${r}.${c+1}`,a.choice.label=a.label,a.choice.contentTarget=null,a.choice.breakBefore=!1}),i.parts.forEach(a=>{a.text&&(a.text.groupId=`options:${a.id}`),a.referenceData&&(a.referenceData={...a.referenceData,questionId:a.id,questionPid:i.id})}),i.document=wn(i.document,i.label,i.score),i.parts=i.parts.map(a=>({...a,document:wn(a.document,a.label,a.score)})),i}function NS(t){return Math.max(1,Math.floor((t-6)/31))}function MS(t,r){return{version:1,content:{type:"doc",content:Array.from({length:t},()=>({type:"paragraph",attrs:{fixedLineHeight:45.35433070866142},content:[{type:"text",text:" ".repeat(Math.max(1,Math.floor((r-24)/3))),marks:[{type:"underline"},{type:"textStyle",attrs:{fontFamily:"Times New Roman, serif",fontSize:"12px"}}]}]}))}}}function _S(t,r,i=!1){const a=t.questions.reduce((l,u)=>l+(u.parts.length||1),0),c=r/a;return!a||!Number.isFinite(c)||c<(i?0:.5)||!Number.isInteger(c*2)||t.questions.some(l=>c>da[l.type].score||c!==0&&l.type==="CHUNK_CHOICE"&&(l.rightAnswers||0)*(l.singleScore||0)>c)?null:{...t,questions:t.questions.map(l=>({...l,score:c*(l.parts.length||1),document:wn(l.document,l.label,c*(l.parts.length||1)),choice:{...l.choice,score:c,lessScore:Math.min(l.choice.lessScore||0,c)},parts:l.parts.map(u=>({...u,score:c,document:wn(u.document,u.label,c),choice:{...u.choice,score:c}}))}))}}function DS(t,r){return[...t<=17?Array.from({length:18},(i,a)=>17-a<=t?String(17-a):""):[...Array.from({length:7},(i,a)=>7-a<=Math.floor(t/10)?`${7-a}0`:""),"",...Array.from({length:10},(i,a)=>String(9-a))],r?"0.5":""]}const IS=["000","100","110","111","101","010","011","001"],kS=t=>IS[t-1],Tu={CHINESE:[1],MATHS:[2],ENGLISH:[3],PHYSICAL:[4],CHEMICAL:[1,2],POLITICAL:[1,3],BIOLOGICAL:[1,4],GEOGRAPHIC:[2,3],JAPANESE:[2,4],IT:[3,4],GYM:[1,2,3],MUSIC:[1,2,4],ART:[1,3,4],SCIENCE:[2,3,4],HISTORY:[1,2,3,4]},LS={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",物理:"PHYSICAL",化学:"CHEMICAL",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",日语:"JAPANESE",信息科技:"IT",信息技术:"IT",体育:"GYM",音乐:"MUSIC",美术:"ART",科学:"SCIENCE",历史:"HISTORY"};function Dm(t){return t?.subjectCode||(t?.courseCode&&Tu[t.courseCode]?t.courseCode:LS[t?.subject||""])}const Qn=t=>Math.round(t*1e3)/1e3,Im=t=>({x:Qn(t.x),y:Qn(t.y),width:Qn(t.width),height:Qn(t.height)});function km(t,r){const i=Math.max(t.x,r.x),a=Math.max(t.y,r.y),c=Math.min(t.x+t.width,r.x+r.width)-i,l=Math.min(t.y+t.height,r.y+r.height)-a;return c>.01&&l>.01?{x:i,y:a,width:c,height:l}:void 0}const ma=function(t,r){let c=t;const l=Ai[r];let u=null,d=0,m=null;const p=[],C={},g=function(_,I){d=c*4+17,u=(function(B){const H=new Array(B);for(let z=0;z<B;z+=1){H[z]=new Array(B);for(let $=0;$<B;$+=1)H[z][$]=null}return H})(d),b(0,0),b(d-7,0),b(0,d-7),S(),v(),T(_,I),c>=7&&w(_),m==null&&(m=O(c,l,p)),j(m,I)},b=function(_,I){for(let B=-1;B<=7;B+=1)if(!(_+B<=-1||d<=_+B))for(let H=-1;H<=7;H+=1)I+H<=-1||d<=I+H||(0<=B&&B<=6&&(H==0||H==6)||0<=H&&H<=6&&(B==0||B==6)||2<=B&&B<=4&&2<=H&&H<=4?u[_+B][I+H]=!0:u[_+B][I+H]=!1)},x=function(){let _=0,I=0;for(let B=0;B<8;B+=1){g(!0,B);const H=Vr.getLostPoint(C);(B==0||_>H)&&(_=H,I=B)}return I},v=function(){for(let _=8;_<d-8;_+=1)u[_][6]==null&&(u[_][6]=_%2==0);for(let _=8;_<d-8;_+=1)u[6][_]==null&&(u[6][_]=_%2==0)},S=function(){const _=Vr.getPatternPosition(c);for(let I=0;I<_.length;I+=1)for(let B=0;B<_.length;B+=1){const H=_[I],z=_[B];if(u[H][z]==null)for(let $=-2;$<=2;$+=1)for(let X=-2;X<=2;X+=1)$==-2||$==2||X==-2||X==2||$==0&&X==0?u[H+$][z+X]=!0:u[H+$][z+X]=!1}},w=function(_){const I=Vr.getBCHTypeNumber(c);for(let B=0;B<18;B+=1){const H=!_&&(I>>B&1)==1;u[Math.floor(B/3)][B%3+d-8-3]=H}for(let B=0;B<18;B+=1){const H=!_&&(I>>B&1)==1;u[B%3+d-8-3][Math.floor(B/3)]=H}},T=function(_,I){const B=l<<3|I,H=Vr.getBCHTypeInfo(B);for(let z=0;z<15;z+=1){const $=!_&&(H>>z&1)==1;z<6?u[z][8]=$:z<8?u[z+1][8]=$:u[d-15+z][8]=$}for(let z=0;z<15;z+=1){const $=!_&&(H>>z&1)==1;z<8?u[8][d-z-1]=$:z<9?u[8][15-z-1+1]=$:u[8][15-z-1]=$}u[d-8][8]=!_},j=function(_,I){let B=-1,H=d-1,z=7,$=0;const X=Vr.getMaskFunction(I);for(let G=d-1;G>0;G-=2)for(G==6&&(G-=1);;){for(let te=0;te<2;te+=1)if(u[H][G-te]==null){let V=!1;$<_.length&&(V=(_[$]>>>z&1)==1),X(H,G-te)&&(V=!V),u[H][G-te]=V,z-=1,z==-1&&($+=1,z=7)}if(H+=B,H<0||d<=H){H-=B,B=-B;break}}},R=function(_,I){let B=0,H=0,z=0;const $=new Array(I.length),X=new Array(I.length);for(let Y=0;Y<I.length;Y+=1){const L=I[Y].dataCount,P=I[Y].totalCount-L;H=Math.max(H,L),z=Math.max(z,P),$[Y]=new Array(L);for(let Q=0;Q<$[Y].length;Q+=1)$[Y][Q]=255&_.getBuffer()[Q+B];B+=L;const N=Vr.getErrorCorrectPolynomial(P),J=Ri($[Y],N.getLength()-1).mod(N);X[Y]=new Array(N.getLength()-1);for(let Q=0;Q<X[Y].length;Q+=1){const le=Q+J.getLength()-X[Y].length;X[Y][Q]=le>=0?J.getAt(le):0}}let G=0;for(let Y=0;Y<I.length;Y+=1)G+=I[Y].totalCount;const te=new Array(G);let V=0;for(let Y=0;Y<H;Y+=1)for(let L=0;L<I.length;L+=1)Y<$[L].length&&(te[V]=$[L][Y],V+=1);for(let Y=0;Y<z;Y+=1)for(let L=0;L<I.length;L+=1)Y<X[L].length&&(te[V]=X[L][Y],V+=1);return te},O=function(_,I,B){const H=Lm.getRSBlocks(_,I),z=zm();for(let X=0;X<B.length;X+=1){const G=B[X];z.put(G.getMode(),4),z.put(G.getLength(),Vr.getLengthInBits(G.getMode(),_)),G.write(z)}let $=0;for(let X=0;X<H.length;X+=1)$+=H[X].dataCount;if(z.getLengthInBits()>$*8)throw"code length overflow. ("+z.getLengthInBits()+">"+$*8+")";for(z.getLengthInBits()+4<=$*8&&z.put(0,4);z.getLengthInBits()%8!=0;)z.putBit(!1);for(;!(z.getLengthInBits()>=$*8||(z.put(236,8),z.getLengthInBits()>=$*8));)z.put(17,8);return R(z,H)};C.addData=function(_,I){I=I||"Byte";let B=null;switch(I){case"Numeric":B=zS(_);break;case"Alphanumeric":B=BS(_);break;case"Byte":B=HS(_);break;case"Kanji":B=PS(_);break;default:throw"mode:"+I}p.push(B),m=null},C.isDark=function(_,I){if(_<0||d<=_||I<0||d<=I)throw _+","+I;return u[_][I]},C.getModuleCount=function(){return d},C.make=function(){if(c<1){let _=1;for(;_<40;_++){const I=Lm.getRSBlocks(_,l),B=zm();for(let z=0;z<p.length;z++){const $=p[z];B.put($.getMode(),4),B.put($.getLength(),Vr.getLengthInBits($.getMode(),_)),$.write(B)}let H=0;for(let z=0;z<I.length;z++)H+=I[z].dataCount;if(B.getLengthInBits()<=H*8)break}c=_}g(!1,x())},C.createTableTag=function(_,I){_=_||2,I=typeof I>"u"?_*4:I;let B="";B+='<table style="',B+=" border-width: 0px; border-style: none;",B+=" border-collapse: collapse;",B+=" padding: 0px; margin: "+I+"px;",B+='">',B+="<tbody>";for(let H=0;H<C.getModuleCount();H+=1){B+="<tr>";for(let z=0;z<C.getModuleCount();z+=1)B+='<td style="',B+=" border-width: 0px; border-style: none;",B+=" border-collapse: collapse;",B+=" padding: 0px; margin: 0px;",B+=" width: "+_+"px;",B+=" height: "+_+"px;",B+=" background-color: ",B+=C.isDark(H,z)?"#000000":"#ffffff",B+=";",B+='"/>';B+="</tr>"}return B+="</tbody>",B+="</table>",B},C.createSvgTag=function(_,I,B,H){let z={};typeof arguments[0]=="object"&&(z=arguments[0],_=z.cellSize,I=z.margin,B=z.alt,H=z.title),_=_||2,I=typeof I>"u"?_*4:I,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-description":null,H=typeof H=="string"?{text:H}:H||{},H.text=H.text||null,H.id=H.text?H.id||"qrcode-title":null;const $=C.getModuleCount()*_+I*2;let X,G,te,V,Y="",L;for(L="l"+_+",0 0,"+_+" -"+_+",0 0,-"+_+"z ",Y+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',Y+=z.scalable?"":' width="'+$+'px" height="'+$+'px"',Y+=' viewBox="0 0 '+$+" "+$+'" ',Y+=' preserveAspectRatio="xMinYMin meet"',Y+=H.text||B.text?' role="img" aria-labelledby="'+M([H.id,B.id].join(" ").trim())+'"':"",Y+=">",Y+=H.text?'<title id="'+M(H.id)+'">'+M(H.text)+"</title>":"",Y+=B.text?'<description id="'+M(B.id)+'">'+M(B.text)+"</description>":"",Y+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',Y+='<path d="',te=0;te<C.getModuleCount();te+=1)for(V=te*_+I,X=0;X<C.getModuleCount();X+=1)C.isDark(te,X)&&(G=X*_+I,Y+="M"+G+","+V+L);return Y+='" stroke="transparent" fill="black"/>',Y+="</svg>",Y},C.createDataURL=function(_,I){_=_||2,I=typeof I>"u"?_*4:I;const B=C.getModuleCount()*_+I*2,H=I,z=B-I;return VS(B,B,function($,X){if(H<=$&&$<z&&H<=X&&X<z){const G=Math.floor(($-H)/_),te=Math.floor((X-H)/_);return C.isDark(te,G)?0:1}else return 1})},C.createImgTag=function(_,I,B){_=_||2,I=typeof I>"u"?_*4:I;const H=C.getModuleCount()*_+I*2;let z="";return z+="<img",z+=' src="',z+=C.createDataURL(_,I),z+='"',z+=' width="',z+=H,z+='"',z+=' height="',z+=H,z+='"',B&&(z+=' alt="',z+=M(B),z+='"'),z+="/>",z};const M=function(_){let I="";for(let B=0;B<_.length;B+=1){const H=_.charAt(B);switch(H){case"<":I+="&lt;";break;case">":I+="&gt;";break;case"&":I+="&amp;";break;case'"':I+="&quot;";break;default:I+=H;break}}return I},D=function(_){_=typeof _>"u"?2:_;const B=C.getModuleCount()*1+_*2,H=_,z=B-_;let $,X,G,te,V;const Y={"██":"█","█ ":"▀"," █":"▄"," ":" "},L={"██":"▀","█ ":"▀"," █":" "," ":" "};let P="";for($=0;$<B;$+=2){for(G=Math.floor(($-H)/1),te=Math.floor(($+1-H)/1),X=0;X<B;X+=1)V="█",H<=X&&X<z&&H<=$&&$<z&&C.isDark(G,Math.floor((X-H)/1))&&(V=" "),H<=X&&X<z&&H<=$+1&&$+1<z&&C.isDark(te,Math.floor((X-H)/1))?V+=" ":V+="█",P+=_<1&&$+1>=z?L[V]:Y[V];P+=`
2
+ `}return B%2&&_>0?P.substring(0,P.length-B-1)+Array(B+1).join("▀"):P.substring(0,P.length-1)};return C.createASCII=function(_,I){if(_=_||1,_<2)return D(I);_-=1,I=typeof I>"u"?_*2:I;const B=C.getModuleCount()*_+I*2,H=I,z=B-I;let $,X,G,te;const V=Array(_+1).join("██"),Y=Array(_+1).join(" ");let L="",P="";for($=0;$<B;$+=1){for(G=Math.floor(($-H)/_),P="",X=0;X<B;X+=1)te=1,H<=X&&X<z&&H<=$&&$<z&&C.isDark(G,Math.floor((X-H)/_))&&(te=0),P+=te?V:Y;for(G=0;G<_;G+=1)L+=P+`
3
+ `}return L.substring(0,L.length-1)},C.renderTo2dContext=function(_,I){I=I||2;const B=C.getModuleCount();for(let H=0;H<B;H++)for(let z=0;z<B;z++)_.fillStyle=C.isDark(H,z)?"black":"white",_.fillRect(z*I,H*I,I,I)},C};ma.stringToBytes=function(t){const r=[];for(let i=0;i<t.length;i+=1){const a=t.charCodeAt(i);r.push(a&255)}return r},ma.createStringToBytes=function(t,r){const i=(function(){const c=$S(t),l=function(){const m=c.read();if(m==-1)throw"eof";return m};let u=0;const d={};for(;;){const m=c.read();if(m==-1)break;const p=l(),C=l(),g=l(),b=String.fromCharCode(m<<8|p),x=C<<8|g;d[b]=x,u+=1}if(u!=r)throw u+" != "+r;return d})(),a=63;return function(c){const l=[];for(let u=0;u<c.length;u+=1){const d=c.charCodeAt(u);if(d<128)l.push(d);else{const m=i[c.charAt(u)];typeof m=="number"?(m&255)==m?l.push(m):(l.push(m>>>8),l.push(m&255)):l.push(a)}}return l}};const qt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ai={L:1,M:0,Q:3,H:2},Gr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Vr=(function(){const t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,i=7973,a=21522,c={},l=function(u){let d=0;for(;u!=0;)d+=1,u>>>=1;return d};return c.getBCHTypeInfo=function(u){let d=u<<10;for(;l(d)-l(r)>=0;)d^=r<<l(d)-l(r);return(u<<10|d)^a},c.getBCHTypeNumber=function(u){let d=u<<12;for(;l(d)-l(i)>=0;)d^=i<<l(d)-l(i);return u<<12|d},c.getPatternPosition=function(u){return t[u-1]},c.getMaskFunction=function(u){switch(u){case Gr.PATTERN000:return function(d,m){return(d+m)%2==0};case Gr.PATTERN001:return function(d,m){return d%2==0};case Gr.PATTERN010:return function(d,m){return m%3==0};case Gr.PATTERN011:return function(d,m){return(d+m)%3==0};case Gr.PATTERN100:return function(d,m){return(Math.floor(d/2)+Math.floor(m/3))%2==0};case Gr.PATTERN101:return function(d,m){return d*m%2+d*m%3==0};case Gr.PATTERN110:return function(d,m){return(d*m%2+d*m%3)%2==0};case Gr.PATTERN111:return function(d,m){return(d*m%3+(d+m)%2)%2==0};default:throw"bad maskPattern:"+u}},c.getErrorCorrectPolynomial=function(u){let d=Ri([1],0);for(let m=0;m<u;m+=1)d=d.multiply(Ri([1,qr.gexp(m)],0));return d},c.getLengthInBits=function(u,d){if(1<=d&&d<10)switch(u){case qt.MODE_NUMBER:return 10;case qt.MODE_ALPHA_NUM:return 9;case qt.MODE_8BIT_BYTE:return 8;case qt.MODE_KANJI:return 8;default:throw"mode:"+u}else if(d<27)switch(u){case qt.MODE_NUMBER:return 12;case qt.MODE_ALPHA_NUM:return 11;case qt.MODE_8BIT_BYTE:return 16;case qt.MODE_KANJI:return 10;default:throw"mode:"+u}else if(d<41)switch(u){case qt.MODE_NUMBER:return 14;case qt.MODE_ALPHA_NUM:return 13;case qt.MODE_8BIT_BYTE:return 16;case qt.MODE_KANJI:return 12;default:throw"mode:"+u}else throw"type:"+d},c.getLostPoint=function(u){const d=u.getModuleCount();let m=0;for(let g=0;g<d;g+=1)for(let b=0;b<d;b+=1){let x=0;const v=u.isDark(g,b);for(let S=-1;S<=1;S+=1)if(!(g+S<0||d<=g+S))for(let w=-1;w<=1;w+=1)b+w<0||d<=b+w||S==0&&w==0||v==u.isDark(g+S,b+w)&&(x+=1);x>5&&(m+=3+x-5)}for(let g=0;g<d-1;g+=1)for(let b=0;b<d-1;b+=1){let x=0;u.isDark(g,b)&&(x+=1),u.isDark(g+1,b)&&(x+=1),u.isDark(g,b+1)&&(x+=1),u.isDark(g+1,b+1)&&(x+=1),(x==0||x==4)&&(m+=3)}for(let g=0;g<d;g+=1)for(let b=0;b<d-6;b+=1)u.isDark(g,b)&&!u.isDark(g,b+1)&&u.isDark(g,b+2)&&u.isDark(g,b+3)&&u.isDark(g,b+4)&&!u.isDark(g,b+5)&&u.isDark(g,b+6)&&(m+=40);for(let g=0;g<d;g+=1)for(let b=0;b<d-6;b+=1)u.isDark(b,g)&&!u.isDark(b+1,g)&&u.isDark(b+2,g)&&u.isDark(b+3,g)&&u.isDark(b+4,g)&&!u.isDark(b+5,g)&&u.isDark(b+6,g)&&(m+=40);let p=0;for(let g=0;g<d;g+=1)for(let b=0;b<d;b+=1)u.isDark(b,g)&&(p+=1);const C=Math.abs(100*p/d/d-50)/5;return m+=C*10,m},c})(),qr=(function(){const t=new Array(256),r=new Array(256);for(let a=0;a<8;a+=1)t[a]=1<<a;for(let a=8;a<256;a+=1)t[a]=t[a-4]^t[a-5]^t[a-6]^t[a-8];for(let a=0;a<255;a+=1)r[t[a]]=a;const i={};return i.glog=function(a){if(a<1)throw"glog("+a+")";return r[a]},i.gexp=function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return t[a]},i})(),Ri=function(t,r){if(typeof t.length>"u")throw t.length+"/"+r;const i=(function(){let c=0;for(;c<t.length&&t[c]==0;)c+=1;const l=new Array(t.length-c+r);for(let u=0;u<t.length-c;u+=1)l[u]=t[u+c];return l})(),a={};return a.getAt=function(c){return i[c]},a.getLength=function(){return i.length},a.multiply=function(c){const l=new Array(a.getLength()+c.getLength()-1);for(let u=0;u<a.getLength();u+=1)for(let d=0;d<c.getLength();d+=1)l[u+d]^=qr.gexp(qr.glog(a.getAt(u))+qr.glog(c.getAt(d)));return Ri(l,0)},a.mod=function(c){if(a.getLength()-c.getLength()<0)return a;const l=qr.glog(a.getAt(0))-qr.glog(c.getAt(0)),u=new Array(a.getLength());for(let d=0;d<a.getLength();d+=1)u[d]=a.getAt(d);for(let d=0;d<c.getLength();d+=1)u[d]^=qr.gexp(qr.glog(c.getAt(d))+l);return Ri(u,0).mod(c)},a},Lm=(function(){const t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(c,l){const u={};return u.totalCount=c,u.dataCount=l,u},i={},a=function(c,l){switch(l){case Ai.L:return t[(c-1)*4+0];case Ai.M:return t[(c-1)*4+1];case Ai.Q:return t[(c-1)*4+2];case Ai.H:return t[(c-1)*4+3];default:return}};return i.getRSBlocks=function(c,l){const u=a(c,l);if(typeof u>"u")throw"bad rs block @ typeNumber:"+c+"/errorCorrectionLevel:"+l;const d=u.length/3,m=[];for(let p=0;p<d;p+=1){const C=u[p*3+0],g=u[p*3+1],b=u[p*3+2];for(let x=0;x<C;x+=1)m.push(r(g,b))}return m},i})(),zm=function(){const t=[];let r=0;const i={};return i.getBuffer=function(){return t},i.getAt=function(a){const c=Math.floor(a/8);return(t[c]>>>7-a%8&1)==1},i.put=function(a,c){for(let l=0;l<c;l+=1)i.putBit((a>>>c-l-1&1)==1)},i.getLengthInBits=function(){return r},i.putBit=function(a){const c=Math.floor(r/8);t.length<=c&&t.push(0),a&&(t[c]|=128>>>r%8),r+=1},i},zS=function(t){const r=qt.MODE_NUMBER,i=t,a={};a.getMode=function(){return r},a.getLength=function(u){return i.length},a.write=function(u){const d=i;let m=0;for(;m+2<d.length;)u.put(c(d.substring(m,m+3)),10),m+=3;m<d.length&&(d.length-m==1?u.put(c(d.substring(m,m+1)),4):d.length-m==2&&u.put(c(d.substring(m,m+2)),7))};const c=function(u){let d=0;for(let m=0;m<u.length;m+=1)d=d*10+l(u.charAt(m));return d},l=function(u){if("0"<=u&&u<="9")return u.charCodeAt(0)-48;throw"illegal char :"+u};return a},BS=function(t){const r=qt.MODE_ALPHA_NUM,i=t,a={};a.getMode=function(){return r},a.getLength=function(l){return i.length},a.write=function(l){const u=i;let d=0;for(;d+1<u.length;)l.put(c(u.charAt(d))*45+c(u.charAt(d+1)),11),d+=2;d<u.length&&l.put(c(u.charAt(d)),6)};const c=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return a},HS=function(t){const r=qt.MODE_8BIT_BYTE,i=ma.stringToBytes(t),a={};return a.getMode=function(){return r},a.getLength=function(c){return i.length},a.write=function(c){for(let l=0;l<i.length;l+=1)c.put(i[l],8)},a},PS=function(t){const r=qt.MODE_KANJI,i=ma.stringToBytes;(function(l,u){const d=i(l);if(d.length!=2||(d[0]<<8|d[1])!=u)throw"sjis not supported."})("友",38726);const a=i(t),c={};return c.getMode=function(){return r},c.getLength=function(l){return~~(a.length/2)},c.write=function(l){const u=a;let d=0;for(;d+1<u.length;){let m=(255&u[d])<<8|255&u[d+1];if(33088<=m&&m<=40956)m-=33088;else if(57408<=m&&m<=60351)m-=49472;else throw"illegal char at "+(d+1)+"/"+m;m=(m>>>8&255)*192+(m&255),l.put(m,13),d+=2}if(d<u.length)throw"illegal char at "+(d+1)},c},Bm=function(){const t=[],r={};return r.writeByte=function(i){t.push(i&255)},r.writeShort=function(i){r.writeByte(i),r.writeByte(i>>>8)},r.writeBytes=function(i,a,c){a=a||0,c=c||i.length;for(let l=0;l<c;l+=1)r.writeByte(i[l+a])},r.writeString=function(i){for(let a=0;a<i.length;a+=1)r.writeByte(i.charCodeAt(a))},r.toByteArray=function(){return t},r.toString=function(){let i="";i+="[";for(let a=0;a<t.length;a+=1)a>0&&(i+=","),i+=t[a];return i+="]",i},r},US=function(){let t=0,r=0,i=0,a="";const c={},l=function(d){a+=String.fromCharCode(u(d&63))},u=function(d){if(d<0)throw"n:"+d;if(d<26)return 65+d;if(d<52)return 97+(d-26);if(d<62)return 48+(d-52);if(d==62)return 43;if(d==63)return 47;throw"n:"+d};return c.writeByte=function(d){for(t=t<<8|d&255,r+=8,i+=1;r>=6;)l(t>>>r-6),r-=6},c.flush=function(){if(r>0&&(l(t<<6-r),t=0,r=0),i%3!=0){const d=3-i%3;for(let m=0;m<d;m+=1)a+="="}},c.toString=function(){return a},c},$S=function(t){const r=t;let i=0,a=0,c=0;const l={};l.read=function(){for(;c<8;){if(i>=r.length){if(c==0)return-1;throw"unexpected end of file./"+c}const m=r.charAt(i);if(i+=1,m=="=")return c=0,-1;if(m.match(/^\s$/))continue;a=a<<6|u(m.charCodeAt(0)),c+=6}const d=a>>>c-8&255;return c-=8,d};const u=function(d){if(65<=d&&d<=90)return d-65;if(97<=d&&d<=122)return d-97+26;if(48<=d&&d<=57)return d-48+52;if(d==43)return 62;if(d==47)return 63;throw"c:"+d};return l},GS=function(t,r){const i=t,a=r,c=new Array(t*r),l={};l.setPixel=function(p,C,g){c[C*i+p]=g},l.write=function(p){p.writeString("GIF87a"),p.writeShort(i),p.writeShort(a),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(","),p.writeShort(0),p.writeShort(0),p.writeShort(i),p.writeShort(a),p.writeByte(0);const C=2,g=d(C);p.writeByte(C);let b=0;for(;g.length-b>255;)p.writeByte(255),p.writeBytes(g,b,255),b+=255;p.writeByte(g.length-b),p.writeBytes(g,b,g.length-b),p.writeByte(0),p.writeString(";")};const u=function(p){const C=p;let g=0,b=0;const x={};return x.write=function(v,S){if(v>>>S)throw"length over";for(;g+S>=8;)C.writeByte(255&(v<<g|b)),S-=8-g,v>>>=8-g,b=0,g=0;b=v<<g|b,g=g+S},x.flush=function(){g>0&&C.writeByte(b)},x},d=function(p){const C=1<<p,g=(1<<p)+1;let b=p+1;const x=m();for(let j=0;j<C;j+=1)x.add(String.fromCharCode(j));x.add(String.fromCharCode(C)),x.add(String.fromCharCode(g));const v=Bm(),S=u(v);S.write(C,b);let w=0,T=String.fromCharCode(c[w]);for(w+=1;w<c.length;){const j=String.fromCharCode(c[w]);w+=1,x.contains(T+j)?T=T+j:(S.write(x.indexOf(T),b),x.size()<4095&&(x.size()==1<<b&&(b+=1),x.add(T+j)),T=j)}return S.write(x.indexOf(T),b),S.write(g,b),S.flush(),v.toByteArray()},m=function(){const p={};let C=0;const g={};return g.add=function(b){if(g.contains(b))throw"dup key:"+b;p[b]=C,C+=1},g.size=function(){return C},g.indexOf=function(b){return p[b]},g.contains=function(b){return typeof p[b]<"u"},g};return l},VS=function(t,r,i){const a=GS(t,r);for(let d=0;d<r;d+=1)for(let m=0;m<t;m+=1)a.setPixel(m,d,i(m,d));const c=Bm();a.write(c);const l=US(),u=c.toByteArray();for(let d=0;d<u.length;d+=1)l.writeByte(u[d]);return l.flush(),"data:image/gif;base64,"+l};ma.stringToBytes;function Hm(t){const r=ma(0,"M"),i=Array.from(new TextEncoder().encode(t),l=>String.fromCharCode(l)).join("");r.addData(i,/^\d+$/.test(t)?"Numeric":"Byte"),r.make();const a=r.getModuleCount();let c="";for(let l=0;l<a;l++)for(let u=0;u<a;u++)r.isDark(l,u)&&(c+=`M${u} ${l}h1v1h-1z`);return{count:a,path:c}}class pa extends Error{constructor(i){super(i[0]?.message||"题卡数据无效");gm(this,"issues");this.name="AnswerSheetDataError",this.issues=i}}function ju(t,r){const i=(v,S="题卡数据结构无效")=>{throw new pa([{code:"INVALID_DATA",path:v,message:S}])},a=(v,S)=>!v||typeof v!="object"||Array.isArray(v)?i(S):v,c=(v,S)=>Array.isArray(v)?v:i(S),l=(v,S)=>{typeof v!="string"&&i(S)},u=(v,S,w=0,T=1e5)=>{(typeof v!="number"||!Number.isFinite(v)||v<w||v>T)&&i(S)},d=(v,S)=>{a(v,S);const w=r.validateDocument(v);w.length&&i(S,w[0])},m=(v,S)=>{const w=a(v,S);if(l(w.id,`${S}.id`),l(w.label,`${S}.label`),(typeof w.multiple!="boolean"||typeof w.breakBefore!="boolean")&&i(S),w.contentTarget!==void 0&&w.contentTarget!==null){const T=a(w.contentTarget,`${S}.contentTarget`);l(T.groupId,`${S}.contentTarget.groupId`),c(T.optionIds,`${S}.contentTarget.optionIds`).forEach((j,R)=>l(j,`${S}.contentTarget.optionIds.${R}`))}c(w.options,`${S}.options`).forEach((T,j)=>{const R=a(T,`${S}.options.${j}`);l(R.id,`${S}.options.${j}.id`),l(R.label,`${S}.options.${j}.label`)}),c(w.correctIds,`${S}.correctIds`).forEach((T,j)=>l(T,`${S}.correctIds.${j}`))},p=(v,S)=>{const w=a(v,S);(!["row","column"].includes(String(w.direction))||!["concentrated","distributed","stem","option"].includes(String(w.presentation))||!["box","check","bubble"].includes(String(w.marker)))&&i(S),u(w.rowsPerColumn,`${S}.rowsPerColumn`,1,5),u(w.rowGap,`${S}.rowGap`,0,64),u(w.columnGap,`${S}.columnGap`,0,64),c(w.questions,`${S}.questions`).forEach((T,j)=>m(T,`${S}.questions.${j}`))},C=new WeakSet,g=(v,S)=>{if(!(!v||typeof v!="object")){if(C.has(v))return i(S,"题卡必须是无循环引用的 JSON 数据");C.add(v),Object.entries(v).forEach(([w,T])=>g(T,`${S}.${w}`)),C.delete(v)}},b=a(t,"");if(b.version!==1&&i("version","不支持的题卡数据版本"),l(b.title,"title"),b.usage!==void 0&&!["exam","homework"].includes(String(b.usage))&&i("usage"),["questionCard","scanMarking","halfPoint","mergeObjective"].forEach(v=>{b[v]!==void 0&&typeof b[v]!="boolean"&&i(v)}),["a4","a3-two","a3-three"].includes(String(b.preset))||i("preset"),u(b.margin,"margin",0,100),u(b.gap,"gap",0,100),b.creation){const v=a(b.creation,"creation");["template","exam"].includes(String(v.mode))||i("creation.mode"),["name","grade","subject"].forEach(S=>l(v[S],`creation.${S}`));for(const S of["gradeCode","courseCode","subjectCode"])v[S]!==void 0&&(typeof v[S]!="string"||!v[S].trim())&&i(`creation.${S}`);v.phaseCode!==void 0&&!["P","J","S"].includes(String(v.phaseCode))&&i("creation.phaseCode"),v.createMode!==void 0&&!["MANUALLY","IMPORTED","THIRD"].includes(String(v.createMode))&&i("creation.createMode");for(const S of["id","exampaperId"])if(v[S]!==void 0){const w=v[S];typeof w=="string"&&w.trim()||typeof w=="number"&&Number.isSafeInteger(w)&&w>=0||i(`creation.${S}`)}}if(b.paperTitle){const v=a(b.paperTitle,"paperTitle");l(v.id,"paperTitle.id"),u(v.height,"paperTitle.height",1,1e3),d(v.document,"paperTitle.document")}if(b.header){const v=a(b.header,"header");["code","school"].includes(String(v.kaohao))||i("header.kaohao"),u(v.weishu,"header.weishu",1,20),v.tiaomaStyle!==void 0&&![1,2].includes(v.tiaomaStyle)&&i("header.tiaomaStyle"),v.classText!==void 0&&typeof v.classText!="boolean"&&i("header.classText")}if(b.recognition!==void 0){const v=a(b.recognition,"recognition");for(const S of["examQrCode","subjectMarkers","pointBlack"])v[S]!==void 0&&typeof v[S]!="boolean"&&i(`recognition.${S}`)}c(b.blocks,"blocks").forEach((v,S)=>{const w=`blocks.${S}`,T=a(v,w);if(l(T.id,`${w}.id`),l(T.title,`${w}.title`),u(T.answerHeight,`${w}.answerHeight`),d(T.document,`${w}.document`),T.kind==="area"){(!["forbiden","editArea"].includes(String(T.areaType))||T.reference||T.choices||T.exercise)&&i(`${w}.areaType`),u(T.answerHeight,`${w}.answerHeight`,100,4e3);return}if(!T.reference){if(T.choices){p(T.choices,`${w}.choices`);return}i(`${w}.reference`,"请使用包含 reference 题目结构的制卡数据")}const j=a(T.reference,`${w}.reference`);j.material!==void 0&&d(j.material,`${w}.reference.material`),j.textVersion!==void 0&&j.textVersion!==1&&i(`${w}.reference.textVersion`),Object.hasOwn(cr,String(j.type))||i(`${w}.reference.type`),p(j.layout,`${w}.reference.layout`),u(j.optionalHeight,`${w}.reference.optionalHeight`),c(j.questions,`${w}.reference.questions`).forEach((R,O)=>{const M=`${w}.reference.questions.${O}`,D=a(R,M);Object.hasOwn(da,String(D.type))||i(`${M}.type`),l(D.id,`${M}.id`),l(D.label,`${M}.label`),m(D.choice,`${M}.choice`),["height","contentHeight","characters","lines"].forEach(I=>u(D[I],`${M}.${I}`)),d(D.document,`${M}.document`);const _=(I,B)=>{if(!I)return;const H=a(I,B);d(H.content,`${B}.content`),a(H.layout,`${B}.layout`),l(H.groupId,`${B}.groupId`),c(H.itemsContent,`${B}.itemsContent`).forEach((z,$)=>{const X=a(z,`${B}.itemsContent.${$}`);l(X.id,`${B}.itemsContent.${$}.id`),l(X.key,`${B}.itemsContent.${$}.key`),d(X.content,`${B}.itemsContent.${$}.content`)})};_(D.text,`${M}.text`),c(D.parts,`${M}.parts`).forEach((I,B)=>{const H=`${M}.parts.${B}`,z=a(I,H);l(z.id,`${H}.id`),l(z.label,`${H}.label`),u(z.width,`${H}.width`),u(z.height,`${H}.height`),d(z.document,`${H}.document`),m(z.choice,`${H}.choice`),_(z.text,`${H}.text`)})})}),g(t,"");const x=xu(t);(x.columnWidth<100||x.contentHeight<100)&&i("margin","边距或栏间距过大,纸张没有足够的作答区域")}function tl(t){return!t||t.marks?.some(r=>r.type==="documentLabel")?!1:t.type==="text"?!!t.text?.trim():t.type==="image"?!!t.attrs?.src:t.type==="formula"||t.type==="blockFormula"?!!t.attrs?.latex?.trim():!!t.content?.some(tl)}function qS(t,r){try{ju(t,r)}catch(x){return{valid:!1,issues:x instanceof pa?x.issues:[{code:"INVALID_DATA",path:"",message:"题卡数据无法读取"}]}}const i=[];let a={};const c=(x,v,S)=>i.push({code:x,path:v,message:S,...a}),l=new Set,u=(x,v)=>{(!x.trim()||l.has(x))&&c("DUPLICATE_ID",v,"题块、题目和选项 ID 必须非空且唯一"),l.add(x)},d=(x,v,S)=>{(x===null||!Number.isFinite(x)||x<(t.usage==="homework"?0:.5)||x>v||!Number.isInteger(x*2))&&c("INVALID_SCORE",S,`分值须为 ${t.usage==="homework"?0:.5}–${v} 分,按 0.5 分递增`)},m=(x,v,S)=>{(x.options.length<v[0]||x.options.length>v[1])&&c("INVALID_OPTIONS",`${S}.options`,`选项个数须为 ${v[0]}–${v[1]}`),x.options.forEach((w,T)=>u(w.id,`${S}.options.${T}.id`)),(new Set(x.correctIds).size!==x.correctIds.length||x.correctIds.some(w=>!x.options.some(T=>T.id===w)))&&c("INVALID_ANSWER_REFERENCE",`${S}.correctIds`,"答案引用了不存在或重复的选项")},p=(x,v,S,w=0,T=!0)=>{T&&!tl(x?.content.content)&&c("MISSING_CONTENT",`${v}.content`,"请填写题干或材料"),S&&(x?.itemsContent.length!==w||x.itemsContent.some(j=>!tl(j.content.content)))&&c("MISSING_OPTION_CONTENT",`${v}.itemsContent`,"请补全每个选项的内容")};if(t.title.trim()||c("MISSING_TITLE","title","请填写题卡名称"),t.recognition?.examQrCode){const x=String(t.creation?.exampaperId??"").trim();if(!x)c("MISSING_EXAM_ID","creation.exampaperId","显示试卷二维码需要填写试卷 ID");else try{Hm(x)}catch{c("INVALID_QR_PAYLOAD","creation.exampaperId","试卷 ID 太长,无法生成二维码")}}t.header&&t.recognition?.subjectMarkers!==!1&&!Tu[Dm(t.creation)||""]&&c("UNKNOWN_SUBJECT_MARK","creation.subjectCode","当前学科没有参考识别编码,请配置标准学科或关闭学科标记"),(!t.creation?.grade.trim()||!t.creation.subject.trim())&&c("MISSING_CREATION","creation","请选择年级和学科"),(!t.paperTitle||!tl(t.paperTitle.document.content))&&c("MISSING_PAPER_TITLE","paperTitle","请填写纸面标题"),t.blocks.some(x=>x.kind!=="area")||c("EMPTY_CARD","blocks","请至少添加一个题块和一道题目"),t.paperTitle&&u(t.paperTitle.id,"paperTitle.id"),t.blocks.forEach((x,v)=>{a={blockId:x.id};const S=`blocks.${v}`;if(u(x.id,`${S}.id`),x.kind==="area"){x.areaType===(t.questionCard?"forbiden":"editArea")&&c("INVALID_AREA_MODE",`${S}.areaType`,"题卡合一使用空白答题区,独立答题卡使用禁止答题区");return}x.title.trim()||c("MISSING_BLOCK_TITLE",`${S}.title`,"请填写题块标题"),x.id==="reference-merged-objective"&&c("RESERVED_ID",`${S}.id`,"题块使用了系统保留 ID");const w=x.reference;if(!w){x.choices?.questions.length||c("EMPTY_BLOCK",S,"题块中没有题目"),x.choices?.questions.forEach((j,R)=>{a={blockId:x.id,questionId:j.id},u(j.id,`${S}.choices.questions.${R}.id`),m(j,[2,12],`${S}.choices.questions.${R}`),d(j.score??null,15,`${S}.choices.questions.${R}.score`)});return}w.questions.length||c("EMPTY_BLOCK",`${S}.reference.questions`,"题块中没有题目");const T=Eu(w);if((T.some(j=>!j.trim())||new Set(T).size!==T.length)&&c("INVALID_QUESTION_NUMBER",`${S}.reference.questions`,"同一题块内的题号须非空且不能重复"),w.optional&&(w.type!=="SHORTANSWER"||!Number.isInteger(w.choose)||w.choose<1||w.choose>=w.questions.length)&&c("INVALID_OPTIONAL",`${S}.reference.choose`,"选做题须为解答题,且选做数量小于总题数"),w.type==="CCOMPOSITION"&&w.questions.length>1&&c("INVALID_COUNT",`${S}.reference.questions`,"语文作文每组只能有一道题"),w.questions.forEach((j,R)=>{a={blockId:x.id,questionId:j.id};const O=`${S}.reference.questions.${R}`,M=da[j.type];u(j.id,`${O}.id`),w.type!=="MIXED"&&w.type!==j.type&&c("TYPE_MISMATCH",`${O}.type`,"题目类型与题块不一致"),j.choice.id!==j.id&&c("INVALID_BINDING",`${O}.choice.id`,"题目与填涂项 ID 不一致");const D=Be(j.type)||["FILLBLANK","SHORTANSWER"].includes(j.type);(D&&(j.parts.length<1||j.parts.length>M.parts)||!D&&j.parts.length)&&c("INVALID_PARTS",`${O}.parts`,`子题/空数须为 ${D?`1–${M.parts}`:"0"}`),j.parts.length?j.score!==Fn(j.parts)&&c("SCORE_MISMATCH",`${O}.score`,"总分与子题分值之和不一致"):d(j.score,M.score,`${O}.score`),Et(j.type)&&!Be(j.type)&&m(j.choice,M.options,`${O}.choice`),j.type==="INFO_MATCHING"&&(m(j.choice,M.options,`${O}.choice`),j.parts.length>j.choice.options.length&&c("INVALID_OPTIONS",`${O}.choice.options`,"信息匹配的选项数不能少于子题数")),j.type==="MCHOICE"&&(!Number.isFinite(j.choice.lessScore)||j.choice.lessScore<0||j.choice.lessScore>(j.score||0)||!Number.isInteger(j.choice.lessScore*2))&&c("INVALID_LESS_SCORE",`${O}.choice.lessScore`,"少选得分须按 0.5 分递增且不能超过本题分值"),j.type==="CHUNK_CHOICE"&&(!j.rightAnswers||!Number.isInteger(j.rightAnswers)||j.rightAnswers>=j.choice.options.length||!j.singleScore||j.singleScore<.5||!Number.isInteger(j.singleScore*2)||j.score!==0&&j.singleScore*j.rightAnswers>(j.score||0))&&c("INVALID_CHUNK_SCORE",O,"请检查正确答案个数及每处得分"),j.type==="CCOMPOSITION"&&(!Number.isInteger(j.characters)||j.characters<1||j.characters>1200)&&c("INVALID_GRID_COUNT",`${O}.characters`,"作文格数须为 1–1200"),j.type==="ECOMPOSITION"&&(!Number.isInteger(j.lines)||j.lines<1||j.lines>100)&&c("INVALID_LINE_COUNT",`${O}.lines`,"作文行数须为 1–100"),t.questionCard&&p(j.text,`${O}.text`,["SCHOICE","MCHOICE"].includes(j.type),j.choice.options.length),j.parts.forEach((_,I)=>{const B=`${O}.parts.${I}`;a={blockId:x.id,questionId:_.id},u(_.id,`${B}.id`),d(_.score,M.score,`${B}.score`),Be(j.type)&&Et(j.type)&&(m(_.choice,M.options,`${B}.choice`),_.choice.id!==_.id&&c("INVALID_BINDING",`${B}.choice.id`,"子题与填涂项 ID 不一致")),t.questionCard&&["CLOZE","READTHENANSWER"].includes(j.type)&&p(_.text,`${B}.text`,!0,_.choice.options.length,j.type==="READTHENANSWER")})}),a={blockId:x.id},t.questionCard&&w.layout.presentation!=="concentrated"){const j=w.questions.filter(O=>Et(O.type)).flatMap(O=>Be(O.type)?O.parts.map(M=>M.choice):[O.choice]);la({...w.layout,questions:j},x.document,!0).concentrated.questions.length&&c("MISSING_FILL_TARGET",`${S}.reference.layout.presentation`,"部分填涂框没有对应的题干或选项位置")}}),a={};const C=(x,v)=>{x.type==="image"&&(!x.attrs?.src||/^blob:/i.test(x.attrs.src))&&c("INVALID_IMAGE_URL",v,"图片缺少可保存的地址,请上传后使用持久 URL 或内嵌图片"),["formula","blockFormula"].includes(x.type||"")&&!String(x.attrs?.latex||"").trim()&&c("EMPTY_FORMULA",v,"请填写公式或删除空公式"),x.content?.forEach((S,w)=>C(S,`${v}.content.${w}`))},g=(x,v)=>{x&&C(x.content,`${v}.content`)},b=(x,v)=>{g(x?.content,`${v}.content`),x?.itemsContent.forEach((S,w)=>g(S.content,`${v}.itemsContent.${w}.content`))};return g(t.paperTitle?.document,"paperTitle.document"),t.blocks.forEach((x,v)=>{a={blockId:x.id};const S=`blocks.${v}`;g(x.document,`${S}.document`),g(x.reference?.material,`${S}.reference.material`),x.reference?.questions.forEach((w,T)=>{a={blockId:x.id,questionId:w.id};const j=`blocks.${v}.reference.questions.${T}`;g(w.document,`${j}.document`),b(w.text,`${j}.text`),w.parts.forEach((R,O)=>{a={blockId:x.id,questionId:R.id},g(R.document,`${j}.parts.${O}.document`),b(R.text,`${j}.parts.${O}.text`)})})}),{valid:i.length===0,issues:i}}function Au(t){if(t!==void 0)try{const r=su(t);return{grades:r.grades,gradeCourseMap:r.gradeCourseMap,defaultGradeCode:r.defaultGradeCode||void 0,defaultCourseCode:r.defaultCourseCode||void 0}}catch(r){throw r instanceof iu?new pa([{code:"INVALID_DICTIONARIES",path:r.path,message:r.message}]):r}}function YS(t,r){const i=(M,D)=>{throw new pa([{code:"INVALID_INITIALIZATION",path:M,message:D}])},a=(M,D,_)=>{if(!M||typeof M!="object"||Array.isArray(M))return i(D,"初始化配置必须是对象");const I=Object.entries(M);for(const[B]of I)_.includes(B)||i(`${D}.${B}`,"不支持的初始化字段");return Object.fromEntries(I.filter(([,B])=>B!==void 0))},c=(M,D)=>typeof M!="string"||!M.trim()?i(D,"请提供非空的试卷名称、年级和学科"):M.trim(),l=(M,D,_)=>{M!==void 0&&!_.includes(M)&&i(D,`可选值为 ${_.join("、")}`)},u=(M,D)=>{M!==void 0&&typeof M!="boolean"&&i(D,"请使用布尔值")},d=(M,D,_,I)=>{M!==void 0&&(typeof M!="number"||!Number.isFinite(M)||M<_||M>I)&&i(D,`数值必须在 ${_}–${I} 之间`)},m=a(t,"initialization",["name","grade","subject","gradeCode","courseCode","subjectCode","mode","id","exampaperId","createMode","layout","header","recognition"]),p=c(m.name,"initialization.name");p.length>30&&i("initialization.name","试卷名称最多 30 个字符");const C=su(Au(r)),g=m.gradeCode!==void 0||m.courseCode!==void 0||m.subjectCode!==void 0;let b;if(g){try{b=bi(C,c(m.gradeCode,"initialization.gradeCode"),c(m.courseCode,"initialization.courseCode"))}catch(M){if(M instanceof iu)return i(M.path,M.message);throw M}for(const M of["grade","subject","subjectCode"])m[M]!==void 0&&c(m[M],`initialization.${M}`)!==b[M]&&i(`initialization.${M}`,"名称或学科编码与课程字典不一致")}else{const M=c(m.grade,"initialization.grade"),D=c(m.subject,"initialization.subject"),_=C.grades.filter(H=>H.label===M);_.length>1&&i("initialization.grade","同名年级不唯一,请使用 gradeCode");const I=_[0],B=I?C.gradeCourseMap[I.value].filter(H=>H.label===D):[];B.length>1&&i("initialization.subject","同名课程不唯一,请使用 courseCode"),r&&(!I||!B.length)&&i(I?"initialization.subject":"initialization.grade","名称不在可用字典中,请使用年级和课程编码"),b=I&&B.length?bi(C,I.value,B[0].value):{grade:M,subject:D}}l(m.mode,"initialization.mode",["template","exam"]),l(m.createMode,"initialization.createMode",["MANUALLY","IMPORTED","THIRD"]);const x={};for(const M of["id","exampaperId"])if(m[M]!==void 0){const D=m[M];typeof D=="string"?x[M]=c(D,`initialization.${M}`):typeof D=="number"&&Number.isSafeInteger(D)&&D>=0?x[M]=D:i(`initialization.${M}`,"ID 必须是非空字符串或非负安全整数")}m.createMode!==void 0&&(x.createMode=m.createMode);const v=m.layout===void 0?{}:a(m.layout,"initialization.layout",["usage","preset","margin","gap","questionCard","scanMarking","halfPoint","choiceDirection","mergeObjective","pageNum","quesCard","scoreType","choiceType","mixOb"]),S=(M,D,_)=>{v[M]!==void 0&&(v[D]!==void 0&&v[D]!==_&&i(`initialization.layout.${M}`,`与 ${D} 设置冲突`),v[D]=_,delete v[M])};v.pageNum!==void 0&&![1,2,3].includes(v.pageNum)&&i("initialization.layout.pageNum","分栏数为 1、2 或 3"),S("pageNum","preset",{1:"a4",2:"a3-two",3:"a3-three"}[v.pageNum]);for(const[M,D]of[["quesCard","questionCard"],["scoreType","halfPoint"],["mixOb","mergeObjective"],["choiceType","choiceDirection"]])u(v[M],`initialization.layout.${M}`),S(M,D,M==="choiceType"?v[M]?"column":"row":v[M]);l(v.preset,"initialization.layout.preset",["a4","a3-two","a3-three"]),l(v.usage,"initialization.layout.usage",["exam","homework"]),l(v.choiceDirection,"initialization.layout.choiceDirection",["row","column"]),d(v.margin,"initialization.layout.margin",0,100),d(v.gap,"initialization.layout.gap",0,100);for(const M of["questionCard","scanMarking","halfPoint","mergeObjective"])u(v[M],`initialization.layout.${M}`);const w=m.header===void 0?{}:a(m.header,"initialization.header",["focusText","writeKaohao","missExam","mifeng","kaohao","weishu","tiaomaStyle","classText"]);for(const M of["focusText","writeKaohao","missExam","mifeng","classText"])u(w[M],`initialization.header.${M}`);w.tiaomaStyle!==void 0&&![1,2].includes(w.tiaomaStyle)&&i("initialization.header.tiaomaStyle","考号版式为 1(填涂)或 2(条形码)"),l(w.kaohao,"initialization.header.kaohao",["school","code"]),d(w.weishu,"initialization.header.weishu",4,12),w.weishu!==void 0&&!Number.isInteger(w.weishu)&&i("initialization.header.weishu","考号位数必须是整数");const T=bu({name:p,...b,...x,mode:m.mode??"template"}),j=m.recognition===void 0?void 0:a(m.recognition,"initialization.recognition",["examQrCode","subjectMarkers","pointBlack"]);if(j)for(const M of["examQrCode","subjectMarkers","pointBlack"])u(j[M],`initialization.recognition.${M}`);const R={...T,...v,header:{...T.header,...w},...j?{recognition:j}:{}},O=xu(R);return(O.columnWidth<100||O.contentHeight<100)&&i("initialization.layout","边距或栏间距过大,纸张没有足够的作答区域"),R}function XS(t,r){if(typeof document>"u")throw new Error("请在浏览器挂载后创建制卡实例");const i=qs(r?.plugins||[]),a=Au(r.dictionaries),c=typeof t=="string"?document.querySelector(t):t;if(!(c instanceof HTMLElement)||c.ownerDocument!==document||/^(INPUT|TEXTAREA|SELECT|BUTTON|IMG|CANVAS|IFRAME)$/.test(c.tagName))throw new Error("制卡需要一个空的 HTML 容器,例如 div");if(document.querySelector("[data-uni-answer-sheet-mount], #uni-answer-sheet"))throw new Error("当前文档已挂载制卡工作区;切换容器前请先 destroy()");if(c.textContent?.trim()||c.children.length)throw new Error("请提供空容器,已有题卡请通过 initialValue 传入");const l=document.createElement("div");l.className="uni-answer-sheet-host",l.dataset.uniAnswerSheetMount="",l.style.height="100%",c.append(l);let u=!1,d={...r,dictionaries:a},m,p,C;const g=new Promise((S,w)=>{p=S,C=w});g.catch(()=>{});const b=()=>{if(u)throw new Error("制卡实例已销毁");if(!m?.isReady())throw new Error("请先等待 sheet.ready");return m},x=async()=>(await g,b()),v={ready:g,async initialize(S){if(u)throw new Error("制卡实例已销毁");const w=YS(S,d.dictionaries);m||(d={...d,initialValue:w}),await(await x()).setDocument(w)},getDocument:()=>b().getDocument(),load:async S=>(await x()).setDocument(S),setDocument:async S=>(await x()).setDocument(S),newDocument:async S=>(await x()).newDocument(S),getReferenceData:()=>b().getReferenceData(),setReferenceData:async S=>(await x()).setReferenceData(S),validate:async()=>(await x()).validate(),save:async()=>(await x()).save(),getRecognitionData:async()=>(await x()).getRecognitionData(),focusIssue:S=>b().focusIssue(S),setOptions(S){if(u)throw new Error("制卡实例已销毁");const w=Object.hasOwn(S,"dictionaries")?Au(S.dictionaries):d.dictionaries;d={...d,...S,dictionaries:w},m?.update(d)},destroy(){u||(u=!0,m?.destroy(),l.remove(),C(new DOMException("制卡实例已销毁","AbortError")))}};return Promise.all([i.prepare(),Promise.resolve().then(()=>xO)]).then(([,{mountAnswerSheet:S}])=>{u||(m=S(l,i,d,p,w=>{C(w),v.destroy(),d.onError?.(w instanceof Error?w:new Error(String(w)))}))}).catch(S=>{C(S),v.destroy(),d.onError?.(S instanceof Error?S:new Error(String(S)))}),v}function Pm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ru={exports:{}},Oi={};/**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
6
6
  *
@@ -8,7 +8,7 @@ var jM=Object.defineProperty;var Y1=nt=>{throw TypeError(nt)};var AM=(nt,ct,kt)=
8
8
  *
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
- */var Im;function GS(){if(Im)return Ei;Im=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(a,c,l){var u=null;if(l!==void 0&&(u=""+l),c.key!==void 0&&(u=""+c.key),"key"in c){l={};for(var d in c)d!=="key"&&(l[d]=c[d])}else l=c;return c=l.ref,{$$typeof:t,type:a,key:u,ref:c!==void 0?c:null,props:l}}return Ei.Fragment=r,Ei.jsx=i,Ei.jsxs=i,Ei}var km;function VS(){return km||(km=1,vu.exports=GS()),vu.exports}var f=VS(),Su={exports:{}},Ne={};/**
11
+ */var Um;function KS(){if(Um)return Oi;Um=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(a,c,l){var u=null;if(l!==void 0&&(u=""+l),c.key!==void 0&&(u=""+c.key),"key"in c){l={};for(var d in c)d!=="key"&&(l[d]=c[d])}else l=c;return c=l.ref,{$$typeof:t,type:a,key:u,ref:c!==void 0?c:null,props:l}}return Oi.Fragment=r,Oi.jsx=i,Oi.jsxs=i,Oi}var $m;function FS(){return $m||($m=1,Ru.exports=KS()),Ru.exports}var f=FS(),Ou={exports:{}},Ne={};/**
12
12
  * @license React
13
13
  * react.production.js
14
14
  *
@@ -16,7 +16,7 @@ var jM=Object.defineProperty;var Y1=nt=>{throw TypeError(nt)};var AM=(nt,ct,kt)=
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var Lm;function qS(){if(Lm)return Ne;Lm=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),g=Symbol.iterator;function b(N){return N===null||typeof N!="object"?null:(N=g&&N[g]||N["@@iterator"],typeof N=="function"?N:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,S={};function w(N,K,ne){this.props=N,this.context=K,this.refs=S,this.updater=ne||v}w.prototype.isReactComponent={},w.prototype.setState=function(N,K){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,K,"setState")},w.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function T(){}T.prototype=w.prototype;function j(N,K,ne){this.props=N,this.context=K,this.refs=S,this.updater=ne||v}var R=j.prototype=new T;R.constructor=j,x(R,w.prototype),R.isPureReactComponent=!0;var O=Array.isArray,M={H:null,A:null,T:null,S:null,V:null},D=Object.prototype.hasOwnProperty;function _(N,K,ne,te,le,oe){return ne=oe.ref,{$$typeof:t,type:N,key:K,ref:ne!==void 0?ne:null,props:oe}}function I(N,K){return _(N.type,K,void 0,void 0,void 0,N.props)}function z(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function H(N){var K={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ne){return K[ne]})}var L=/\/+/g;function $(N,K){return typeof N=="object"&&N!==null&&N.key!=null?H(""+N.key):K.toString(36)}function Y(){}function U(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(Y,Y):(N.status="pending",N.then(function(K){N.status==="pending"&&(N.status="fulfilled",N.value=K)},function(K){N.status==="pending"&&(N.status="rejected",N.reason=K)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function q(N,K,ne,te,le){var oe=typeof N;(oe==="undefined"||oe==="boolean")&&(N=null);var ae=!1;if(N===null)ae=!0;else switch(oe){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(N.$$typeof){case t:case r:ae=!0;break;case C:return ae=N._init,q(ae(N._payload),K,ne,te,le)}}if(ae)return le=le(N),ae=te===""?"."+$(N,0):te,O(le)?(ne="",ae!=null&&(ne=ae.replace(L,"$&/")+"/"),q(le,K,ne,"",function(ge){return ge})):le!=null&&(z(le)&&(le=I(le,ne+(le.key==null||N&&N.key===le.key?"":(""+le.key).replace(L,"$&/")+"/")+ae)),K.push(le)),1;ae=0;var xe=te===""?".":te+":";if(O(N))for(var we=0;we<N.length;we++)te=N[we],oe=xe+$(te,we),ae+=q(te,K,ne,oe,le);else if(we=b(N),typeof we=="function")for(N=we.call(N),we=0;!(te=N.next()).done;)te=te.value,oe=xe+$(te,we++),ae+=q(te,K,ne,oe,le);else if(oe==="object"){if(typeof N.then=="function")return q(U(N),K,ne,te,le);throw K=String(N),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return ae}function P(N,K,ne){if(N==null)return N;var te=[],le=0;return q(N,te,"","",function(oe){return K.call(ne,oe,le++)}),te}function G(N){if(N._status===-1){var K=N._result;K=K(),K.then(function(ne){(N._status===0||N._status===-1)&&(N._status=1,N._result=ne)},function(ne){(N._status===0||N._status===-1)&&(N._status=2,N._result=ne)}),N._status===-1&&(N._status=0,N._result=K)}if(N._status===1)return N._result.default;throw N._result}var B=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function Q(){}return Ne.Children={map:P,forEach:function(N,K,ne){P(N,function(){K.apply(this,arguments)},ne)},count:function(N){var K=0;return P(N,function(){K++}),K},toArray:function(N){return P(N,function(K){return K})||[]},only:function(N){if(!z(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},Ne.Component=w,Ne.Fragment=i,Ne.Profiler=c,Ne.PureComponent=j,Ne.StrictMode=a,Ne.Suspense=m,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},Ne.cache=function(N){return function(){return N.apply(null,arguments)}},Ne.cloneElement=function(N,K,ne){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var te=x({},N.props),le=N.key,oe=void 0;if(K!=null)for(ae in K.ref!==void 0&&(oe=void 0),K.key!==void 0&&(le=""+K.key),K)!D.call(K,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&K.ref===void 0||(te[ae]=K[ae]);var ae=arguments.length-2;if(ae===1)te.children=ne;else if(1<ae){for(var xe=Array(ae),we=0;we<ae;we++)xe[we]=arguments[we+2];te.children=xe}return _(N.type,le,void 0,void 0,oe,te)},Ne.createContext=function(N){return N={$$typeof:u,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:l,_context:N},N},Ne.createElement=function(N,K,ne){var te,le={},oe=null;if(K!=null)for(te in K.key!==void 0&&(oe=""+K.key),K)D.call(K,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(le[te]=K[te]);var ae=arguments.length-2;if(ae===1)le.children=ne;else if(1<ae){for(var xe=Array(ae),we=0;we<ae;we++)xe[we]=arguments[we+2];le.children=xe}if(N&&N.defaultProps)for(te in ae=N.defaultProps,ae)le[te]===void 0&&(le[te]=ae[te]);return _(N,oe,void 0,void 0,null,le)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(N){return{$$typeof:d,render:N}},Ne.isValidElement=z,Ne.lazy=function(N){return{$$typeof:C,_payload:{_status:-1,_result:N},_init:G}},Ne.memo=function(N,K){return{$$typeof:p,type:N,compare:K===void 0?null:K}},Ne.startTransition=function(N){var K=M.T,ne={};M.T=ne;try{var te=N(),le=M.S;le!==null&&le(ne,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(Q,B)}catch(oe){B(oe)}finally{M.T=K}},Ne.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ne.use=function(N){return M.H.use(N)},Ne.useActionState=function(N,K,ne){return M.H.useActionState(N,K,ne)},Ne.useCallback=function(N,K){return M.H.useCallback(N,K)},Ne.useContext=function(N){return M.H.useContext(N)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(N,K){return M.H.useDeferredValue(N,K)},Ne.useEffect=function(N,K,ne){var te=M.H;if(typeof ne=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return te.useEffect(N,K)},Ne.useId=function(){return M.H.useId()},Ne.useImperativeHandle=function(N,K,ne){return M.H.useImperativeHandle(N,K,ne)},Ne.useInsertionEffect=function(N,K){return M.H.useInsertionEffect(N,K)},Ne.useLayoutEffect=function(N,K){return M.H.useLayoutEffect(N,K)},Ne.useMemo=function(N,K){return M.H.useMemo(N,K)},Ne.useOptimistic=function(N,K){return M.H.useOptimistic(N,K)},Ne.useReducer=function(N,K,ne){return M.H.useReducer(N,K,ne)},Ne.useRef=function(N){return M.H.useRef(N)},Ne.useState=function(N){return M.H.useState(N)},Ne.useSyncExternalStore=function(N,K,ne){return M.H.useSyncExternalStore(N,K,ne)},Ne.useTransition=function(){return M.H.useTransition()},Ne.version="19.1.1",Ne}var zm;function Cu(){return zm||(zm=1,Su.exports=qS()),Su.exports}var E=Cu();const Ti=Dm(E),wo=ct({__proto__:null,default:Ti},[E]);var wu={exports:{}},ji={},Eu={exports:{}},Tu={};/**
19
+ */var Gm;function QS(){if(Gm)return Ne;Gm=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),g=Symbol.iterator;function b(N){return N===null||typeof N!="object"?null:(N=g&&N[g]||N["@@iterator"],typeof N=="function"?N:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,S={};function w(N,U,J){this.props=N,this.context=U,this.refs=S,this.updater=J||x}w.prototype.isReactComponent={},w.prototype.setState=function(N,U){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,U,"setState")},w.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function T(){}T.prototype=w.prototype;function j(N,U,J){this.props=N,this.context=U,this.refs=S,this.updater=J||x}var R=j.prototype=new T;R.constructor=j,v(R,w.prototype),R.isPureReactComponent=!0;var O=Array.isArray,M={H:null,A:null,T:null,S:null,V:null},D=Object.prototype.hasOwnProperty;function _(N,U,J,Q,le,re){return J=re.ref,{$$typeof:t,type:N,key:U,ref:J!==void 0?J:null,props:re}}function I(N,U){return _(N.type,U,void 0,void 0,void 0,N.props)}function B(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function H(N){var U={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(J){return U[J]})}var z=/\/+/g;function $(N,U){return typeof N=="object"&&N!==null&&N.key!=null?H(""+N.key):U.toString(36)}function X(){}function G(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(X,X):(N.status="pending",N.then(function(U){N.status==="pending"&&(N.status="fulfilled",N.value=U)},function(U){N.status==="pending"&&(N.status="rejected",N.reason=U)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function te(N,U,J,Q,le){var re=typeof N;(re==="undefined"||re==="boolean")&&(N=null);var ae=!1;if(N===null)ae=!0;else switch(re){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(N.$$typeof){case t:case r:ae=!0;break;case C:return ae=N._init,te(ae(N._payload),U,J,Q,le)}}if(ae)return le=le(N),ae=Q===""?"."+$(N,0):Q,O(le)?(J="",ae!=null&&(J=ae.replace(z,"$&/")+"/"),te(le,U,J,"",function(ye){return ye})):le!=null&&(B(le)&&(le=I(le,J+(le.key==null||N&&N.key===le.key?"":(""+le.key).replace(z,"$&/")+"/")+ae)),U.push(le)),1;ae=0;var ge=Q===""?".":Q+":";if(O(N))for(var je=0;je<N.length;je++)Q=N[je],re=ge+$(Q,je),ae+=te(Q,U,J,re,le);else if(je=b(N),typeof je=="function")for(N=je.call(N),je=0;!(Q=N.next()).done;)Q=Q.value,re=ge+$(Q,je++),ae+=te(Q,U,J,re,le);else if(re==="object"){if(typeof N.then=="function")return te(G(N),U,J,Q,le);throw U=String(N),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ae}function V(N,U,J){if(N==null)return N;var Q=[],le=0;return te(N,Q,"","",function(re){return U.call(J,re,le++)}),Q}function Y(N){if(N._status===-1){var U=N._result;U=U(),U.then(function(J){(N._status===0||N._status===-1)&&(N._status=1,N._result=J)},function(J){(N._status===0||N._status===-1)&&(N._status=2,N._result=J)}),N._status===-1&&(N._status=0,N._result=U)}if(N._status===1)return N._result.default;throw N._result}var L=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function P(){}return Ne.Children={map:V,forEach:function(N,U,J){V(N,function(){U.apply(this,arguments)},J)},count:function(N){var U=0;return V(N,function(){U++}),U},toArray:function(N){return V(N,function(U){return U})||[]},only:function(N){if(!B(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},Ne.Component=w,Ne.Fragment=i,Ne.Profiler=c,Ne.PureComponent=j,Ne.StrictMode=a,Ne.Suspense=m,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},Ne.cache=function(N){return function(){return N.apply(null,arguments)}},Ne.cloneElement=function(N,U,J){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var Q=v({},N.props),le=N.key,re=void 0;if(U!=null)for(ae in U.ref!==void 0&&(re=void 0),U.key!==void 0&&(le=""+U.key),U)!D.call(U,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&U.ref===void 0||(Q[ae]=U[ae]);var ae=arguments.length-2;if(ae===1)Q.children=J;else if(1<ae){for(var ge=Array(ae),je=0;je<ae;je++)ge[je]=arguments[je+2];Q.children=ge}return _(N.type,le,void 0,void 0,re,Q)},Ne.createContext=function(N){return N={$$typeof:u,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:l,_context:N},N},Ne.createElement=function(N,U,J){var Q,le={},re=null;if(U!=null)for(Q in U.key!==void 0&&(re=""+U.key),U)D.call(U,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(le[Q]=U[Q]);var ae=arguments.length-2;if(ae===1)le.children=J;else if(1<ae){for(var ge=Array(ae),je=0;je<ae;je++)ge[je]=arguments[je+2];le.children=ge}if(N&&N.defaultProps)for(Q in ae=N.defaultProps,ae)le[Q]===void 0&&(le[Q]=ae[Q]);return _(N,re,void 0,void 0,null,le)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(N){return{$$typeof:d,render:N}},Ne.isValidElement=B,Ne.lazy=function(N){return{$$typeof:C,_payload:{_status:-1,_result:N},_init:Y}},Ne.memo=function(N,U){return{$$typeof:p,type:N,compare:U===void 0?null:U}},Ne.startTransition=function(N){var U=M.T,J={};M.T=J;try{var Q=N(),le=M.S;le!==null&&le(J,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(P,L)}catch(re){L(re)}finally{M.T=U}},Ne.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ne.use=function(N){return M.H.use(N)},Ne.useActionState=function(N,U,J){return M.H.useActionState(N,U,J)},Ne.useCallback=function(N,U){return M.H.useCallback(N,U)},Ne.useContext=function(N){return M.H.useContext(N)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(N,U){return M.H.useDeferredValue(N,U)},Ne.useEffect=function(N,U,J){var Q=M.H;if(typeof J=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return Q.useEffect(N,U)},Ne.useId=function(){return M.H.useId()},Ne.useImperativeHandle=function(N,U,J){return M.H.useImperativeHandle(N,U,J)},Ne.useInsertionEffect=function(N,U){return M.H.useInsertionEffect(N,U)},Ne.useLayoutEffect=function(N,U){return M.H.useLayoutEffect(N,U)},Ne.useMemo=function(N,U){return M.H.useMemo(N,U)},Ne.useOptimistic=function(N,U){return M.H.useOptimistic(N,U)},Ne.useReducer=function(N,U,J){return M.H.useReducer(N,U,J)},Ne.useRef=function(N){return M.H.useRef(N)},Ne.useState=function(N){return M.H.useState(N)},Ne.useSyncExternalStore=function(N,U,J){return M.H.useSyncExternalStore(N,U,J)},Ne.useTransition=function(){return M.H.useTransition()},Ne.version="19.1.1",Ne}var Vm;function Nu(){return Vm||(Vm=1,Ou.exports=QS()),Ou.exports}var E=Nu();const Ni=Pm(E),No=dt({__proto__:null,default:Ni},[E]);var Mu={exports:{}},Mi={},_u={exports:{}},Du={};/**
20
20
  * @license React
21
21
  * scheduler.production.js
22
22
  *
@@ -24,7 +24,7 @@ var jM=Object.defineProperty;var Y1=nt=>{throw TypeError(nt)};var AM=(nt,ct,kt)=
24
24
  *
25
25
  * This source code is licensed under the MIT license found in the
26
26
  * LICENSE file in the root directory of this source tree.
27
- */var Bm;function YS(){return Bm||(Bm=1,(function(t){function r(P,G){var B=P.length;P.push(G);e:for(;0<B;){var Q=B-1>>>1,N=P[Q];if(0<c(N,G))P[Q]=G,P[B]=N,B=Q;else break e}}function i(P){return P.length===0?null:P[0]}function a(P){if(P.length===0)return null;var G=P[0],B=P.pop();if(B!==G){P[0]=B;e:for(var Q=0,N=P.length,K=N>>>1;Q<K;){var ne=2*(Q+1)-1,te=P[ne],le=ne+1,oe=P[le];if(0>c(te,B))le<N&&0>c(oe,te)?(P[Q]=oe,P[le]=B,Q=le):(P[Q]=te,P[ne]=B,Q=ne);else if(le<N&&0>c(oe,B))P[Q]=oe,P[le]=B,Q=le;else break e}}return G}function c(P,G){var B=P.sortIndex-G.sortIndex;return B!==0?B:P.id-G.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();t.unstable_now=function(){return u.now()-d}}var m=[],p=[],C=1,g=null,b=3,v=!1,x=!1,S=!1,w=!1,T=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function O(P){for(var G=i(p);G!==null;){if(G.callback===null)a(p);else if(G.startTime<=P)a(p),G.sortIndex=G.expirationTime,r(m,G);else break;G=i(p)}}function M(P){if(S=!1,O(P),!x)if(i(m)!==null)x=!0,D||(D=!0,$());else{var G=i(p);G!==null&&q(M,G.startTime-P)}}var D=!1,_=-1,I=5,z=-1;function H(){return w?!0:!(t.unstable_now()-z<I)}function L(){if(w=!1,D){var P=t.unstable_now();z=P;var G=!0;try{e:{x=!1,S&&(S=!1,j(_),_=-1),v=!0;var B=b;try{t:{for(O(P),g=i(m);g!==null&&!(g.expirationTime>P&&H());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,b=g.priorityLevel;var N=Q(g.expirationTime<=P);if(P=t.unstable_now(),typeof N=="function"){g.callback=N,O(P),G=!0;break t}g===i(m)&&a(m),O(P)}else a(m);g=i(m)}if(g!==null)G=!0;else{var K=i(p);K!==null&&q(M,K.startTime-P),G=!1}}break e}finally{g=null,b=B,v=!1}G=void 0}}finally{G?$():D=!1}}}var $;if(typeof R=="function")$=function(){R(L)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,U=Y.port2;Y.port1.onmessage=L,$=function(){U.postMessage(null)}}else $=function(){T(L,0)};function q(P,G){_=T(function(){P(t.unstable_now())},G)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(P){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var B=b;b=G;try{return P()}finally{b=B}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(P,G){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var B=b;b=P;try{return G()}finally{b=B}},t.unstable_scheduleCallback=function(P,G,B){var Q=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?Q+B:Q):B=Q,P){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=B+N,P={id:C++,callback:G,priorityLevel:P,startTime:B,expirationTime:N,sortIndex:-1},B>Q?(P.sortIndex=B,r(p,P),i(m)===null&&P===i(p)&&(S?(j(_),_=-1):S=!0,q(M,B-Q))):(P.sortIndex=N,r(m,P),x||v||(x=!0,D||(D=!0,$()))),P},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(P){var G=b;return function(){var B=b;b=G;try{return P.apply(this,arguments)}finally{b=B}}}})(Tu)),Tu}var Hm;function XS(){return Hm||(Hm=1,Eu.exports=YS()),Eu.exports}var ju={exports:{}},Vt={};/**
27
+ */var qm;function ZS(){return qm||(qm=1,(function(t){function r(V,Y){var L=V.length;V.push(Y);e:for(;0<L;){var P=L-1>>>1,N=V[P];if(0<c(N,Y))V[P]=Y,V[L]=N,L=P;else break e}}function i(V){return V.length===0?null:V[0]}function a(V){if(V.length===0)return null;var Y=V[0],L=V.pop();if(L!==Y){V[0]=L;e:for(var P=0,N=V.length,U=N>>>1;P<U;){var J=2*(P+1)-1,Q=V[J],le=J+1,re=V[le];if(0>c(Q,L))le<N&&0>c(re,Q)?(V[P]=re,V[le]=L,P=le):(V[P]=Q,V[J]=L,P=J);else if(le<N&&0>c(re,L))V[P]=re,V[le]=L,P=le;else break e}}return Y}function c(V,Y){var L=V.sortIndex-Y.sortIndex;return L!==0?L:V.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();t.unstable_now=function(){return u.now()-d}}var m=[],p=[],C=1,g=null,b=3,x=!1,v=!1,S=!1,w=!1,T=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function O(V){for(var Y=i(p);Y!==null;){if(Y.callback===null)a(p);else if(Y.startTime<=V)a(p),Y.sortIndex=Y.expirationTime,r(m,Y);else break;Y=i(p)}}function M(V){if(S=!1,O(V),!v)if(i(m)!==null)v=!0,D||(D=!0,$());else{var Y=i(p);Y!==null&&te(M,Y.startTime-V)}}var D=!1,_=-1,I=5,B=-1;function H(){return w?!0:!(t.unstable_now()-B<I)}function z(){if(w=!1,D){var V=t.unstable_now();B=V;var Y=!0;try{e:{v=!1,S&&(S=!1,j(_),_=-1),x=!0;var L=b;try{t:{for(O(V),g=i(m);g!==null&&!(g.expirationTime>V&&H());){var P=g.callback;if(typeof P=="function"){g.callback=null,b=g.priorityLevel;var N=P(g.expirationTime<=V);if(V=t.unstable_now(),typeof N=="function"){g.callback=N,O(V),Y=!0;break t}g===i(m)&&a(m),O(V)}else a(m);g=i(m)}if(g!==null)Y=!0;else{var U=i(p);U!==null&&te(M,U.startTime-V),Y=!1}}break e}finally{g=null,b=L,x=!1}Y=void 0}}finally{Y?$():D=!1}}}var $;if(typeof R=="function")$=function(){R(z)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,G=X.port2;X.port1.onmessage=z,$=function(){G.postMessage(null)}}else $=function(){T(z,0)};function te(V,Y){_=T(function(){V(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(V){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var L=b;b=Y;try{return V()}finally{b=L}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(V,Y){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var L=b;b=V;try{return Y()}finally{b=L}},t.unstable_scheduleCallback=function(V,Y,L){var P=t.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?P+L:P):L=P,V){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=L+N,V={id:C++,callback:Y,priorityLevel:V,startTime:L,expirationTime:N,sortIndex:-1},L>P?(V.sortIndex=L,r(p,V),i(m)===null&&V===i(p)&&(S?(j(_),_=-1):S=!0,te(M,L-P))):(V.sortIndex=N,r(m,V),v||x||(v=!0,D||(D=!0,$()))),V},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(V){var Y=b;return function(){var L=b;b=Y;try{return V.apply(this,arguments)}finally{b=L}}}})(Du)),Du}var Ym;function WS(){return Ym||(Ym=1,_u.exports=ZS()),_u.exports}var Iu={exports:{}},Yt={};/**
28
28
  * @license React
29
29
  * react-dom.production.js
30
30
  *
@@ -32,7 +32,7 @@ var jM=Object.defineProperty;var Y1=nt=>{throw TypeError(nt)};var AM=(nt,ct,kt)=
32
32
  *
33
33
  * This source code is licensed under the MIT license found in the
34
34
  * LICENSE file in the root directory of this source tree.
35
- */var Pm;function KS(){if(Pm)return Vt;Pm=1;var t=Cu();function r(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)p+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal");function l(m,p,C){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:g==null?null:""+g,children:m,containerInfo:p,implementation:C}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Vt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Vt.createPortal=function(m,p){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return l(m,p,null,C)},Vt.flushSync=function(m){var p=u.T,C=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=p,a.p=C,a.d.f()}},Vt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},Vt.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Vt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var C=p.as,g=d(C,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;C==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:v}):C==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Vt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var C=d(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:C,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},Vt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var C=p.as,g=d(C,p.crossOrigin);a.d.L(m,C,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Vt.preloadModule=function(m,p){if(typeof m=="string")if(p){var C=d(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:C,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},Vt.requestFormReset=function(m){a.d.r(m)},Vt.unstable_batchedUpdates=function(m,p){return m(p)},Vt.useFormState=function(m,p,C){return u.H.useFormState(m,p,C)},Vt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Vt.version="19.1.1",Vt}var Um;function $m(){if(Um)return ju.exports;Um=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),ju.exports=KS(),ju.exports}/**
35
+ */var Xm;function JS(){if(Xm)return Yt;Xm=1;var t=Nu();function r(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)p+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal");function l(m,p,C){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:g==null?null:""+g,children:m,containerInfo:p,implementation:C}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Yt.createPortal=function(m,p){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return l(m,p,null,C)},Yt.flushSync=function(m){var p=u.T,C=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=p,a.p=C,a.d.f()}},Yt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},Yt.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Yt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var C=p.as,g=d(C,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;C==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:x}):C==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Yt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var C=d(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:C,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},Yt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var C=p.as,g=d(C,p.crossOrigin);a.d.L(m,C,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Yt.preloadModule=function(m,p){if(typeof m=="string")if(p){var C=d(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:C,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},Yt.requestFormReset=function(m){a.d.r(m)},Yt.unstable_batchedUpdates=function(m,p){return m(p)},Yt.useFormState=function(m,p,C){return u.H.useFormState(m,p,C)},Yt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Yt.version="19.1.1",Yt}var Km;function Fm(){if(Km)return Iu.exports;Km=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Iu.exports=JS(),Iu.exports}/**
36
36
  * @license React
37
37
  * react-dom-client.production.js
38
38
  *
@@ -40,20 +40,20 @@ var jM=Object.defineProperty;var Y1=nt=>{throw TypeError(nt)};var AM=(nt,ct,kt)=
40
40
  *
41
41
  * This source code is licensed under the MIT license found in the
42
42
  * LICENSE file in the root directory of this source tree.
43
- */var Gm;function QS(){if(Gm)return ji;Gm=1;var t=XS(),r=Cu(),i=$m();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function u(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(l(e)!==e)throw Error(a(188))}function m(e){var n=e.alternate;if(!n){if(n=l(e),n===null)throw Error(a(188));return n!==e?null:e}for(var o=e,s=n;;){var h=o.return;if(h===null)break;var y=h.alternate;if(y===null){if(s=h.return,s!==null){o=s;continue}break}if(h.child===y.child){for(y=h.child;y;){if(y===o)return d(h),e;if(y===s)return d(h),n;y=y.sibling}throw Error(a(188))}if(o.return!==s.return)o=h,s=y;else{for(var A=!1,k=h.child;k;){if(k===o){A=!0,o=h,s=y;break}if(k===s){A=!0,s=h,o=y;break}k=k.sibling}if(!A){for(k=y.child;k;){if(k===o){A=!0,o=y,s=h;break}if(k===s){A=!0,s=y,o=h;break}k=k.sibling}if(!A)throw Error(a(189))}}if(o.alternate!==s)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?e:n}function p(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=p(e),n!==null)return n;e=e.sibling}return null}var C=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),j=Symbol.for("react.consumer"),R=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=L&&e[L]||e["@@iterator"],typeof e=="function"?e:null)}var Y=Symbol.for("react.client.reference");function U(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Y?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case M:return"Suspense";case D:return"SuspenseList";case z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case v:return"Portal";case R:return(e.displayName||"Context")+".Provider";case j:return(e._context.displayName||"Context")+".Consumer";case O:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return n=e.displayName||null,n!==null?n:U(e.type)||"Memo";case I:n=e._payload,e=e._init;try{return U(e(n))}catch{}}return null}var q=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},Q=[],N=-1;function K(e){return{current:e}}function ne(e){0>N||(e.current=Q[N],Q[N]=null,N--)}function te(e,n){N++,Q[N]=e.current,e.current=n}var le=K(null),oe=K(null),ae=K(null),xe=K(null);function we(e,n){switch(te(ae,n),te(oe,e),te(le,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?v1(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=v1(n),e=S1(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ne(le),te(le,e)}function ge(){ne(le),ne(oe),ne(ae)}function de(e){e.memoizedState!==null&&te(xe,e);var n=le.current,o=S1(n,e.type);n!==o&&(te(oe,e),te(le,o))}function Me(e){oe.current===e&&(ne(le),ne(oe)),xe.current===e&&(ne(xe),_s._currentValue=B)}var Be=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,Ot=t.unstable_requestPaint,dt=t.unstable_now,be=t.unstable_getCurrentPriorityLevel,gt=t.unstable_ImmediatePriority,ot=t.unstable_UserBlockingPriority,Wt=t.unstable_NormalPriority,yr=t.unstable_LowPriority,ja=t.unstable_IdlePriority,Aa=t.log,Kr=t.unstable_setDisableYieldValue,br=null,zt=null;function zn(e){if(typeof Aa=="function"&&Kr(e),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(br,e)}catch{}}var Yt=Math.clz32?Math.clz32:he,fe=Math.log,ue=Math.LN2;function he(e){return e>>>=0,e===0?32:31-(fe(e)/ue|0)|0}var $e=256,Ze=4194304;function Oe(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Nt(e,n,o){var s=e.pendingLanes;if(s===0)return 0;var h=0,y=e.suspendedLanes,A=e.pingedLanes;e=e.warmLanes;var k=s&134217727;return k!==0?(s=k&~y,s!==0?h=Oe(s):(A&=k,A!==0?h=Oe(A):o||(o=k&~e,o!==0&&(h=Oe(o))))):(k=s&~y,k!==0?h=Oe(k):A!==0?h=Oe(A):o||(o=s&~e,o!==0&&(h=Oe(o)))),h===0?0:n!==0&&n!==h&&(n&y)===0&&(y=h&-h,o=n&-n,y>=o||y===32&&(o&4194048)!==0)?n:h}function Xt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Ul(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $i(){var e=$e;return $e<<=1,($e&4194048)===0&&($e=256),e}function Qr(){var e=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),e}function Bn(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function zo(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mO(e,n,o,s,h,y){var A=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var k=e.entanglements,V=e.expirationTimes,W=e.hiddenUpdates;for(o=A&~o;0<o;){var re=31-Yt(o),se=1<<re;k[re]=0,V[re]=-1;var J=W[re];if(J!==null)for(W[re]=null,re=0;re<J.length;re++){var ee=J[re];ee!==null&&(ee.lane&=-536870913)}o&=~se}s!==0&&ab(e,s,0),y!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=y&~(A&~n))}function ab(e,n,o){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Yt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|o&4194090}function ib(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var s=31-Yt(o),h=1<<s;h&n|e[s]&n&&(e[s]|=n),o&=~h}}function Wd(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Jd(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function sb(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:P1(e.type))}function pO(e,n){var o=G.p;try{return G.p=e,n()}finally{G.p=o}}var Fr=Math.random().toString(36).slice(2),Kt="__reactFiber$"+Fr,nn="__reactProps$"+Fr,Ra="__reactContainer$"+Fr,ef="__reactEvents$"+Fr,gO="__reactListeners$"+Fr,yO="__reactHandles$"+Fr,lb="__reactResources$"+Fr,Gi="__reactMarker$"+Fr;function tf(e){delete e[Kt],delete e[nn],delete e[ef],delete e[gO],delete e[yO]}function Oa(e){var n=e[Kt];if(n)return n;for(var o=e.parentNode;o;){if(n=o[Ra]||o[Kt]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=T1(e);e!==null;){if(o=e[Kt])return o;e=T1(e)}return n}e=o,o=e.parentNode}return null}function Na(e){if(e=e[Kt]||e[Ra]){var n=e.tag;if(n===5||n===6||n===13||n===26||n===27||n===3)return e}return null}function Vi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function Ma(e){var n=e[lb];return n||(n=e[lb]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Mt(e){e[Gi]=!0}var cb=new Set,ub={};function Bo(e,n){_a(e,n),_a(e+"Capture",n)}function _a(e,n){for(ub[e]=n,e=0;e<n.length;e++)cb.add(n[e])}var bO=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),db={},fb={};function xO(e){return Be.call(fb,e)?!0:Be.call(db,e)?!1:bO.test(e)?fb[e]=!0:(db[e]=!0,!1)}function $l(e,n,o){if(xO(n))if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+o)}}function Gl(e,n,o){if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+o)}}function xr(e,n,o,s){if(s===null)e.removeAttribute(o);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(n,o,""+s)}}var nf,hb;function Da(e){if(nf===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);nf=n&&n[1]||"",hb=-1<o.stack.indexOf(`
43
+ */var Qm;function eC(){if(Qm)return Mi;Qm=1;var t=WS(),r=Nu(),i=Fm();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function u(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(l(e)!==e)throw Error(a(188))}function m(e){var n=e.alternate;if(!n){if(n=l(e),n===null)throw Error(a(188));return n!==e?null:e}for(var o=e,s=n;;){var h=o.return;if(h===null)break;var y=h.alternate;if(y===null){if(s=h.return,s!==null){o=s;continue}break}if(h.child===y.child){for(y=h.child;y;){if(y===o)return d(h),e;if(y===s)return d(h),n;y=y.sibling}throw Error(a(188))}if(o.return!==s.return)o=h,s=y;else{for(var A=!1,k=h.child;k;){if(k===o){A=!0,o=h,s=y;break}if(k===s){A=!0,s=h,o=y;break}k=k.sibling}if(!A){for(k=y.child;k;){if(k===o){A=!0,o=y,s=h;break}if(k===s){A=!0,s=y,o=h;break}k=k.sibling}if(!A)throw Error(a(189))}}if(o.alternate!==s)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?e:n}function p(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=p(e),n!==null)return n;e=e.sibling}return null}var C=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),j=Symbol.for("react.consumer"),R=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var X=Symbol.for("react.client.reference");function G(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case M:return"Suspense";case D:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case x:return"Portal";case R:return(e.displayName||"Context")+".Provider";case j:return(e._context.displayName||"Context")+".Consumer";case O:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return n=e.displayName||null,n!==null?n:G(e.type)||"Memo";case I:n=e._payload,e=e._init;try{return G(e(n))}catch{}}return null}var te=Array.isArray,V=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},P=[],N=-1;function U(e){return{current:e}}function J(e){0>N||(e.current=P[N],P[N]=null,N--)}function Q(e,n){N++,P[N]=e.current,e.current=n}var le=U(null),re=U(null),ae=U(null),ge=U(null);function je(e,n){switch(Q(ae,n),Q(re,e),Q(le,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?T1(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=T1(n),e=j1(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}J(le),Q(le,e)}function ye(){J(le),J(re),J(ae)}function de(e){e.memoizedState!==null&&Q(ge,e);var n=le.current,o=j1(n,e.type);n!==o&&(Q(re,e),Q(le,o))}function Me(e){re.current===e&&(J(le),J(re)),ge.current===e&&(J(ge),Ps._currentValue=L)}var De=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Bt=t.unstable_requestPaint,ht=t.unstable_now,he=t.unstable_getCurrentPriorityLevel,at=t.unstable_ImmediatePriority,it=t.unstable_UserBlockingPriority,Mt=t.unstable_NormalPriority,$n=t.unstable_LowPriority,to=t.unstable_IdlePriority,Go=t.log,Er=t.unstable_setDisableYieldValue,Gn=null,At=null;function Rn(e){if(typeof Go=="function"&&Er(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(Gn,e)}catch{}}var Ht=Math.clz32?Math.clz32:St,Ki=Math.log,_e=Math.LN2;function St(e){return e>>>=0,e===0?32:31-(Ki(e)/_e|0)|0}var On=256,Kt=4194304;function no(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fi(e,n,o){var s=e.pendingLanes;if(s===0)return 0;var h=0,y=e.suspendedLanes,A=e.pingedLanes;e=e.warmLanes;var k=s&134217727;return k!==0?(s=k&~y,s!==0?h=no(s):(A&=k,A!==0?h=no(A):o||(o=k&~e,o!==0&&(h=no(o))))):(k=s&~y,k!==0?h=no(k):A!==0?h=no(A):o||(o=s&~e,o!==0&&(h=no(o)))),h===0?0:n!==0&&n!==h&&(n&y)===0&&(y=h&-h,o=n&-n,y>=o||y===32&&(o&4194048)!==0)?n:h}function ce(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Re(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ve(){var e=On;return On<<=1,(On&4194048)===0&&(On=256),e}function et(){var e=Kt;return Kt<<=1,(Kt&62914560)===0&&(Kt=4194304),e}function Ft(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function Oe(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function en(e,n,o,s,h,y){var A=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var k=e.entanglements,q=e.expirationTimes,W=e.hiddenUpdates;for(o=A&~o;0<o;){var oe=31-Ht(o),se=1<<oe;k[oe]=0,q[oe]=-1;var ee=W[oe];if(ee!==null)for(W[oe]=null,oe=0;oe<ee.length;oe++){var ne=ee[oe];ne!==null&&(ne.lane&=-536870913)}o&=~se}s!==0&&hn(e,s,0),y!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=y&~(A&~n))}function hn(e,n,o){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Ht(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|o&4194090}function Qi(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var s=31-Ht(o),h=1<<s;h&n|e[s]&n&&(e[s]|=n),o&=~h}}function _a(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Tr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function rr(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:q1(e.type))}function sf(e,n){var o=Y.p;try{return Y.p=e,n()}finally{Y.p=o}}var ro=Math.random().toString(36).slice(2),Qt="__reactFiber$"+ro,on="__reactProps$"+ro,Da="__reactContainer$"+ro,lf="__reactEvents$"+ro,vO="__reactListeners$"+ro,SO="__reactHandles$"+ro,hb="__reactResources$"+ro,Zi="__reactMarker$"+ro;function cf(e){delete e[Qt],delete e[on],delete e[lf],delete e[vO],delete e[SO]}function Ia(e){var n=e[Qt];if(n)return n;for(var o=e.parentNode;o;){if(n=o[Da]||o[Qt]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=N1(e);e!==null;){if(o=e[Qt])return o;e=N1(e)}return n}e=o,o=e.parentNode}return null}function ka(e){if(e=e[Qt]||e[Da]){var n=e.tag;if(n===5||n===6||n===13||n===26||n===27||n===3)return e}return null}function Wi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function La(e){var n=e[hb];return n||(n=e[hb]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function _t(e){e[Zi]=!0}var mb=new Set,pb={};function Vo(e,n){za(e,n),za(e+"Capture",n)}function za(e,n){for(pb[e]=n,e=0;e<n.length;e++)mb.add(n[e])}var CO=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),gb={},yb={};function wO(e){return De.call(yb,e)?!0:De.call(gb,e)?!1:CO.test(e)?yb[e]=!0:(gb[e]=!0,!1)}function Ql(e,n,o){if(wO(n))if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+o)}}function Zl(e,n,o){if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+o)}}function jr(e,n,o,s){if(s===null)e.removeAttribute(o);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(n,o,""+s)}}var uf,bb;function Ba(e){if(uf===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);uf=n&&n[1]||"",bb=-1<o.stack.indexOf(`
44
44
  at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
45
- `+nf+e+hb}var rf=!1;function of(e,n){if(!e||rf)return"";rf=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(ee){var J=ee}Reflect.construct(e,[],se)}else{try{se.call()}catch(ee){J=ee}e.call(se.prototype)}}else{try{throw Error()}catch(ee){J=ee}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(ee){if(ee&&J&&typeof ee.stack=="string")return[ee.stack,J.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=s.DetermineComponentFrameRoot(),A=y[0],k=y[1];if(A&&k){var V=A.split(`
45
+ `+uf+e+bb}var df=!1;function ff(e,n){if(!e||df)return"";df=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(ne){var ee=ne}Reflect.construct(e,[],se)}else{try{se.call()}catch(ne){ee=ne}e.call(se.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=s.DetermineComponentFrameRoot(),A=y[0],k=y[1];if(A&&k){var q=A.split(`
46
46
  `),W=k.split(`
47
- `);for(h=s=0;s<V.length&&!V[s].includes("DetermineComponentFrameRoot");)s++;for(;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;if(s===V.length||h===W.length)for(s=V.length-1,h=W.length-1;1<=s&&0<=h&&V[s]!==W[h];)h--;for(;1<=s&&0<=h;s--,h--)if(V[s]!==W[h]){if(s!==1||h!==1)do if(s--,h--,0>h||V[s]!==W[h]){var re=`
48
- `+V[s].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=s&&0<=h);break}}}finally{rf=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?Da(o):""}function vO(e){switch(e.tag){case 26:case 27:case 5:return Da(e.type);case 16:return Da("Lazy");case 13:return Da("Suspense");case 19:return Da("SuspenseList");case 0:case 15:return of(e.type,!1);case 11:return of(e.type.render,!1);case 1:return of(e.type,!0);case 31:return Da("Activity");default:return""}}function mb(e){try{var n="";do n+=vO(e),e=e.return;while(e);return n}catch(o){return`
47
+ `);for(h=s=0;s<q.length&&!q[s].includes("DetermineComponentFrameRoot");)s++;for(;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;if(s===q.length||h===W.length)for(s=q.length-1,h=W.length-1;1<=s&&0<=h&&q[s]!==W[h];)h--;for(;1<=s&&0<=h;s--,h--)if(q[s]!==W[h]){if(s!==1||h!==1)do if(s--,h--,0>h||q[s]!==W[h]){var oe=`
48
+ `+q[s].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=s&&0<=h);break}}}finally{df=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?Ba(o):""}function EO(e){switch(e.tag){case 26:case 27:case 5:return Ba(e.type);case 16:return Ba("Lazy");case 13:return Ba("Suspense");case 19:return Ba("SuspenseList");case 0:case 15:return ff(e.type,!1);case 11:return ff(e.type.render,!1);case 1:return ff(e.type,!0);case 31:return Ba("Activity");default:return""}}function xb(e){try{var n="";do n+=EO(e),e=e.return;while(e);return n}catch(o){return`
49
49
  Error generating stack: `+o.message+`
50
- `+o.stack}}function Tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pb(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function SO(e){var n=pb(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),s=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,y=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return h.call(this)},set:function(A){s=""+A,y.call(this,A)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(A){s=""+A},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Vl(e){e._valueTracker||(e._valueTracker=SO(e))}function gb(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),s="";return e&&(s=pb(e)?e.checked?"true":"false":e.value),e=s,e!==o?(n.setValue(e),!0):!1}function ql(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var CO=/[\n"\\]/g;function jn(e){return e.replace(CO,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function af(e,n,o,s,h,y,A,k){e.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.type=A:e.removeAttribute("type"),n!=null?A==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Tn(n)):e.value!==""+Tn(n)&&(e.value=""+Tn(n)):A!=="submit"&&A!=="reset"||e.removeAttribute("value"),n!=null?sf(e,A,Tn(n)):o!=null?sf(e,A,Tn(o)):s!=null&&e.removeAttribute("value"),h==null&&y!=null&&(e.defaultChecked=!!y),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+Tn(k):e.removeAttribute("name")}function yb(e,n,o,s,h,y,A,k){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.type=y),n!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||n!=null))return;o=o!=null?""+Tn(o):"",n=n!=null?""+Tn(n):o,k||n===e.value||(e.value=n),e.defaultValue=n}s=s??h,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=k?e.checked:!!s,e.defaultChecked=!!s,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(e.name=A)}function sf(e,n,o){n==="number"&&ql(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function Ia(e,n,o,s){if(e=e.options,n){n={};for(var h=0;h<o.length;h++)n["$"+o[h]]=!0;for(o=0;o<e.length;o++)h=n.hasOwnProperty("$"+e[o].value),e[o].selected!==h&&(e[o].selected=h),h&&s&&(e[o].defaultSelected=!0)}else{for(o=""+Tn(o),n=null,h=0;h<e.length;h++){if(e[h].value===o){e[h].selected=!0,s&&(e[h].defaultSelected=!0);return}n!==null||e[h].disabled||(n=e[h])}n!==null&&(n.selected=!0)}}function bb(e,n,o){if(n!=null&&(n=""+Tn(n),n!==e.value&&(e.value=n),o==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=o!=null?""+Tn(o):""}function xb(e,n,o,s){if(n==null){if(s!=null){if(o!=null)throw Error(a(92));if(q(s)){if(1<s.length)throw Error(a(93));s=s[0]}o=s}o==null&&(o=""),n=o}o=Tn(n),e.defaultValue=o,s=e.textContent,s===o&&s!==""&&s!==null&&(e.value=s)}function ka(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var wO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function vb(e,n,o){var s=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,o):typeof o!="number"||o===0||wO.has(n)?n==="float"?e.cssFloat=o:e[n]=(""+o).trim():e[n]=o+"px"}function Sb(e,n,o){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,o!=null){for(var s in o)!o.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var h in n)s=n[h],n.hasOwnProperty(h)&&o[h]!==s&&vb(e,h,s)}else for(var y in n)n.hasOwnProperty(y)&&vb(e,y,n[y])}function lf(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var EO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),TO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yl(e){return TO.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var cf=null;function uf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var La=null,za=null;function Cb(e){var n=Na(e);if(n&&(e=n.stateNode)){var o=e[nn]||null;e:switch(e=n.stateNode,n.type){case"input":if(af(e,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+jn(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var s=o[n];if(s!==e&&s.form===e.form){var h=s[nn]||null;if(!h)throw Error(a(90));af(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<o.length;n++)s=o[n],s.form===e.form&&gb(s)}break e;case"textarea":bb(e,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&Ia(e,!!o.multiple,n,!1)}}}var df=!1;function wb(e,n,o){if(df)return e(n,o);df=!0;try{var s=e(n);return s}finally{if(df=!1,(La!==null||za!==null)&&(Mc(),La&&(n=La,e=za,za=La=null,Cb(n),e)))for(n=0;n<e.length;n++)Cb(e[n])}}function qi(e,n){var o=e.stateNode;if(o===null)return null;var s=o[nn]||null;if(s===null)return null;o=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(a(231,n,typeof o));return o}var vr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ff=!1;if(vr)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){ff=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{ff=!1}var Zr=null,hf=null,Xl=null;function Eb(){if(Xl)return Xl;var e,n=hf,o=n.length,s,h="value"in Zr?Zr.value:Zr.textContent,y=h.length;for(e=0;e<o&&n[e]===h[e];e++);var A=o-e;for(s=1;s<=A&&n[o-s]===h[y-s];s++);return Xl=h.slice(e,1<s?1-s:void 0)}function Kl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ql(){return!0}function Tb(){return!1}function rn(e){function n(o,s,h,y,A){this._reactName=o,this._targetInst=h,this.type=s,this.nativeEvent=y,this.target=A,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(o=e[k],this[k]=o?o(y):y[k]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ql:Tb,this.isPropagationStopped=Tb,this}return C(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ql)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ql)},persist:function(){},isPersistent:Ql}),n}var Ho={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fl=rn(Ho),Xi=C({},Ho,{view:0,detail:0}),jO=rn(Xi),mf,pf,Ki,Zl=C({},Xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ki&&(Ki&&e.type==="mousemove"?(mf=e.screenX-Ki.screenX,pf=e.screenY-Ki.screenY):pf=mf=0,Ki=e),mf)},movementY:function(e){return"movementY"in e?e.movementY:pf}}),jb=rn(Zl),AO=C({},Zl,{dataTransfer:0}),RO=rn(AO),OO=C({},Xi,{relatedTarget:0}),gf=rn(OO),NO=C({},Ho,{animationName:0,elapsedTime:0,pseudoElement:0}),MO=rn(NO),_O=C({},Ho,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DO=rn(_O),IO=C({},Ho,{data:0}),Ab=rn(IO),kO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},zO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BO(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=zO[e])?!!n[e]:!1}function yf(){return BO}var HO=C({},Xi,{key:function(e){if(e.key){var n=kO[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Kl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?LO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yf,charCode:function(e){return e.type==="keypress"?Kl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Kl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),PO=rn(HO),UO=C({},Zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rb=rn(UO),$O=C({},Xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yf}),GO=rn($O),VO=C({},Ho,{propertyName:0,elapsedTime:0,pseudoElement:0}),qO=rn(VO),YO=C({},Zl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),XO=rn(YO),KO=C({},Ho,{newState:0,oldState:0}),QO=rn(KO),FO=[9,13,27,32],bf=vr&&"CompositionEvent"in window,Qi=null;vr&&"documentMode"in document&&(Qi=document.documentMode);var ZO=vr&&"TextEvent"in window&&!Qi,Ob=vr&&(!bf||Qi&&8<Qi&&11>=Qi),Nb=" ",Mb=!1;function _b(e,n){switch(e){case"keyup":return FO.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Db(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ba=!1;function WO(e,n){switch(e){case"compositionend":return Db(n);case"keypress":return n.which!==32?null:(Mb=!0,Nb);case"textInput":return e=n.data,e===Nb&&Mb?null:e;default:return null}}function JO(e,n){if(Ba)return e==="compositionend"||!bf&&_b(e,n)?(e=Eb(),Xl=hf=Zr=null,Ba=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Ob&&n.locale!=="ko"?null:n.data;default:return null}}var eN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ib(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!eN[e.type]:n==="textarea"}function kb(e,n,o,s){La?za?za.push(s):za=[s]:La=s,n=zc(n,"onChange"),0<n.length&&(o=new Fl("onChange","change",null,o,s),e.push({event:o,listeners:n}))}var Fi=null,Zi=null;function tN(e){p1(e,0)}function Wl(e){var n=Vi(e);if(gb(n))return e}function Lb(e,n){if(e==="change")return n}var zb=!1;if(vr){var xf;if(vr){var vf="oninput"in document;if(!vf){var Bb=document.createElement("div");Bb.setAttribute("oninput","return;"),vf=typeof Bb.oninput=="function"}xf=vf}else xf=!1;zb=xf&&(!document.documentMode||9<document.documentMode)}function Hb(){Fi&&(Fi.detachEvent("onpropertychange",Pb),Zi=Fi=null)}function Pb(e){if(e.propertyName==="value"&&Wl(Zi)){var n=[];kb(n,Zi,e,uf(e)),wb(tN,n)}}function nN(e,n,o){e==="focusin"?(Hb(),Fi=n,Zi=o,Fi.attachEvent("onpropertychange",Pb)):e==="focusout"&&Hb()}function rN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wl(Zi)}function oN(e,n){if(e==="click")return Wl(n)}function aN(e,n){if(e==="input"||e==="change")return Wl(n)}function iN(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var dn=typeof Object.is=="function"?Object.is:iN;function Wi(e,n){if(dn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),s=Object.keys(n);if(o.length!==s.length)return!1;for(s=0;s<o.length;s++){var h=o[s];if(!Be.call(n,h)||!dn(e[h],n[h]))return!1}return!0}function Ub(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $b(e,n){var o=Ub(e);e=0;for(var s;o;){if(o.nodeType===3){if(s=e+o.textContent.length,e<=n&&s>=n)return{node:o,offset:n-e};e=s}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Ub(o)}}function Gb(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Gb(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Vb(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=ql(e.document);n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=ql(e.document)}return n}function Sf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var sN=vr&&"documentMode"in document&&11>=document.documentMode,Ha=null,Cf=null,Ji=null,wf=!1;function qb(e,n,o){var s=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;wf||Ha==null||Ha!==ql(s)||(s=Ha,"selectionStart"in s&&Sf(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ji&&Wi(Ji,s)||(Ji=s,s=zc(Cf,"onSelect"),0<s.length&&(n=new Fl("onSelect","select",null,n,o),e.push({event:n,listeners:s}),n.target=Ha)))}function Po(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Pa={animationend:Po("Animation","AnimationEnd"),animationiteration:Po("Animation","AnimationIteration"),animationstart:Po("Animation","AnimationStart"),transitionrun:Po("Transition","TransitionRun"),transitionstart:Po("Transition","TransitionStart"),transitioncancel:Po("Transition","TransitionCancel"),transitionend:Po("Transition","TransitionEnd")},Ef={},Yb={};vr&&(Yb=document.createElement("div").style,"AnimationEvent"in window||(delete Pa.animationend.animation,delete Pa.animationiteration.animation,delete Pa.animationstart.animation),"TransitionEvent"in window||delete Pa.transitionend.transition);function Uo(e){if(Ef[e])return Ef[e];if(!Pa[e])return e;var n=Pa[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Yb)return Ef[e]=n[o];return e}var Xb=Uo("animationend"),Kb=Uo("animationiteration"),Qb=Uo("animationstart"),lN=Uo("transitionrun"),cN=Uo("transitionstart"),uN=Uo("transitioncancel"),Fb=Uo("transitionend"),Zb=new Map,Tf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Tf.push("scrollEnd");function Hn(e,n){Zb.set(e,n),Bo(n,[e])}var Wb=new WeakMap;function An(e,n){if(typeof e=="object"&&e!==null){var o=Wb.get(e);return o!==void 0?o:(n={value:e,source:n,stack:mb(n)},Wb.set(e,n),n)}return{value:e,source:n,stack:mb(n)}}var Rn=[],Ua=0,jf=0;function Jl(){for(var e=Ua,n=jf=Ua=0;n<e;){var o=Rn[n];Rn[n++]=null;var s=Rn[n];Rn[n++]=null;var h=Rn[n];Rn[n++]=null;var y=Rn[n];if(Rn[n++]=null,s!==null&&h!==null){var A=s.pending;A===null?h.next=h:(h.next=A.next,A.next=h),s.pending=h}y!==0&&Jb(o,h,y)}}function ec(e,n,o,s){Rn[Ua++]=e,Rn[Ua++]=n,Rn[Ua++]=o,Rn[Ua++]=s,jf|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Af(e,n,o,s){return ec(e,n,o,s),tc(e)}function $a(e,n){return ec(e,null,null,n),tc(e)}function Jb(e,n,o){e.lanes|=o;var s=e.alternate;s!==null&&(s.lanes|=o);for(var h=!1,y=e.return;y!==null;)y.childLanes|=o,s=y.alternate,s!==null&&(s.childLanes|=o),y.tag===22&&(e=y.stateNode,e===null||e._visibility&1||(h=!0)),e=y,y=y.return;return e.tag===3?(y=e.stateNode,h&&n!==null&&(h=31-Yt(o),e=y.hiddenUpdates,s=e[h],s===null?e[h]=[n]:s.push(n),n.lane=o|536870912),y):null}function tc(e){if(50<Es)throw Es=0,Dh=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ga={};function dN(e,n,o,s){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,n,o,s){return new dN(e,n,o,s)}function Rf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sr(e,n){var o=e.alternate;return o===null?(o=fn(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&65011712,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o.refCleanup=e.refCleanup,o}function ex(e,n){e.flags&=65011714;var o=e.alternate;return o===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=o.childLanes,e.lanes=o.lanes,e.child=o.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=o.memoizedProps,e.memoizedState=o.memoizedState,e.updateQueue=o.updateQueue,e.type=o.type,n=o.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function nc(e,n,o,s,h,y){var A=0;if(s=e,typeof e=="function")Rf(e)&&(A=1);else if(typeof e=="string")A=hM(e,o,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case z:return e=fn(31,o,n,h),e.elementType=z,e.lanes=y,e;case x:return $o(o.children,h,y,n);case S:A=8,h|=24;break;case w:return e=fn(12,o,n,h|2),e.elementType=w,e.lanes=y,e;case M:return e=fn(13,o,n,h),e.elementType=M,e.lanes=y,e;case D:return e=fn(19,o,n,h),e.elementType=D,e.lanes=y,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:case R:A=10;break e;case j:A=9;break e;case O:A=11;break e;case _:A=14;break e;case I:A=16,s=null;break e}A=29,o=Error(a(130,e===null?"null":typeof e,"")),s=null}return n=fn(A,o,n,h),n.elementType=e,n.type=s,n.lanes=y,n}function $o(e,n,o,s){return e=fn(7,e,s,n),e.lanes=o,e}function Of(e,n,o){return e=fn(6,e,null,n),e.lanes=o,e}function Nf(e,n,o){return n=fn(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Va=[],qa=0,rc=null,oc=0,On=[],Nn=0,Go=null,Cr=1,wr="";function Vo(e,n){Va[qa++]=oc,Va[qa++]=rc,rc=e,oc=n}function tx(e,n,o){On[Nn++]=Cr,On[Nn++]=wr,On[Nn++]=Go,Go=e;var s=Cr;e=wr;var h=32-Yt(s)-1;s&=~(1<<h),o+=1;var y=32-Yt(n)+h;if(30<y){var A=h-h%5;y=(s&(1<<A)-1).toString(32),s>>=A,h-=A,Cr=1<<32-Yt(n)+h|o<<h|s,wr=y+e}else Cr=1<<y|o<<h|s,wr=e}function Mf(e){e.return!==null&&(Vo(e,1),tx(e,1,0))}function _f(e){for(;e===rc;)rc=Va[--qa],Va[qa]=null,oc=Va[--qa],Va[qa]=null;for(;e===Go;)Go=On[--Nn],On[Nn]=null,wr=On[--Nn],On[Nn]=null,Cr=On[--Nn],On[Nn]=null}var Jt=null,ft=null,Ke=!1,qo=null,Zn=!1,Df=Error(a(519));function Yo(e){var n=Error(a(418,""));throw ns(An(n,e)),Df}function nx(e){var n=e.stateNode,o=e.type,s=e.memoizedProps;switch(n[Kt]=e,n[nn]=s,o){case"dialog":Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":case"embed":Pe("load",n);break;case"video":case"audio":for(o=0;o<js.length;o++)Pe(js[o],n);break;case"source":Pe("error",n);break;case"img":case"image":case"link":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"input":Pe("invalid",n),yb(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),Vl(n);break;case"select":Pe("invalid",n);break;case"textarea":Pe("invalid",n),xb(n,s.value,s.defaultValue,s.children),Vl(n)}o=s.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||s.suppressHydrationWarning===!0||x1(n.textContent,o)?(s.popover!=null&&(Pe("beforetoggle",n),Pe("toggle",n)),s.onScroll!=null&&Pe("scroll",n),s.onScrollEnd!=null&&Pe("scrollend",n),s.onClick!=null&&(n.onclick=Bc),n=!0):n=!1,n||Yo(e)}function rx(e){for(Jt=e.return;Jt;)switch(Jt.tag){case 5:case 13:Zn=!1;return;case 27:case 3:Zn=!0;return;default:Jt=Jt.return}}function es(e){if(e!==Jt)return!1;if(!Ke)return rx(e),Ke=!0,!1;var n=e.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=e.type,o=!(o!=="form"&&o!=="button")||Qh(e.type,e.memoizedProps)),o=!o),o&&ft&&Yo(e),rx(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8)if(o=e.data,o==="/$"){if(n===0){ft=Un(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++;e=e.nextSibling}ft=null}}else n===27?(n=ft,mo(e.type)?(e=Jh,Jh=null,ft=e):ft=n):ft=Jt?Un(e.stateNode.nextSibling):null;return!0}function ts(){ft=Jt=null,Ke=!1}function ox(){var e=qo;return e!==null&&(sn===null?sn=e:sn.push.apply(sn,e),qo=null),e}function ns(e){qo===null?qo=[e]:qo.push(e)}var If=K(null),Xo=null,Er=null;function Wr(e,n,o){te(If,n._currentValue),n._currentValue=o}function Tr(e){e._currentValue=If.current,ne(If)}function kf(e,n,o){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===o)break;e=e.return}}function Lf(e,n,o,s){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var y=h.dependencies;if(y!==null){var A=h.child;y=y.firstContext;e:for(;y!==null;){var k=y;y=h;for(var V=0;V<n.length;V++)if(k.context===n[V]){y.lanes|=o,k=y.alternate,k!==null&&(k.lanes|=o),kf(y.return,o,e),s||(A=null);break e}y=k.next}}else if(h.tag===18){if(A=h.return,A===null)throw Error(a(341));A.lanes|=o,y=A.alternate,y!==null&&(y.lanes|=o),kf(A,o,e),A=null}else A=h.child;if(A!==null)A.return=h;else for(A=h;A!==null;){if(A===e){A=null;break}if(h=A.sibling,h!==null){h.return=A.return,A=h;break}A=A.return}h=A}}function rs(e,n,o,s){e=null;for(var h=n,y=!1;h!==null;){if(!y){if((h.flags&524288)!==0)y=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var A=h.alternate;if(A===null)throw Error(a(387));if(A=A.memoizedProps,A!==null){var k=h.type;dn(h.pendingProps.value,A.value)||(e!==null?e.push(k):e=[k])}}else if(h===xe.current){if(A=h.alternate,A===null)throw Error(a(387));A.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(_s):e=[_s])}h=h.return}e!==null&&Lf(n,e,o,s),n.flags|=262144}function ac(e){for(e=e.firstContext;e!==null;){if(!dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ko(e){Xo=e,Er=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qt(e){return ax(Xo,e)}function ic(e,n){return Xo===null&&Ko(e),ax(e,n)}function ax(e,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},Er===null){if(e===null)throw Error(a(308));Er=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Er=Er.next=n;return o}var fN=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(o,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(o){return o()})}},hN=t.unstable_scheduleCallback,mN=t.unstable_NormalPriority,jt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zf(){return{controller:new fN,data:new Map,refCount:0}}function os(e){e.refCount--,e.refCount===0&&hN(mN,function(){e.controller.abort()})}var as=null,Bf=0,Ya=0,Xa=null;function pN(e,n){if(as===null){var o=as=[];Bf=0,Ya=Ph(),Xa={status:"pending",value:void 0,then:function(s){o.push(s)}}}return Bf++,n.then(ix,ix),n}function ix(){if(--Bf===0&&as!==null){Xa!==null&&(Xa.status="fulfilled");var e=as;as=null,Ya=0,Xa=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function gN(e,n){var o=[],s={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var h=0;h<o.length;h++)(0,o[h])(n)},function(h){for(s.status="rejected",s.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),s}var sx=P.S;P.S=function(e,n){typeof n=="object"&&n!==null&&typeof n.then=="function"&&pN(e,n),sx!==null&&sx(e,n)};var Qo=K(null);function Hf(){var e=Qo.current;return e!==null?e:rt.pooledCache}function sc(e,n){n===null?te(Qo,Qo.current):te(Qo,n.pool)}function lx(){var e=Hf();return e===null?null:{parent:jt._currentValue,pool:e}}var is=Error(a(460)),cx=Error(a(474)),lc=Error(a(542)),Pf={then:function(){}};function ux(e){return e=e.status,e==="fulfilled"||e==="rejected"}function cc(){}function dx(e,n,o){switch(o=e[o],o===void 0?e.push(n):o!==n&&(n.then(cc,cc),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,hx(e),e;default:if(typeof n.status=="string")n.then(cc,cc);else{if(e=rt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=s}},function(s){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,hx(e),e}throw ss=n,is}}var ss=null;function fx(){if(ss===null)throw Error(a(459));var e=ss;return ss=null,e}function hx(e){if(e===is||e===lc)throw Error(a(483))}var Jr=!1;function Uf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $f(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function eo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function to(e,n,o){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Qe&2)!==0){var h=s.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),s.pending=n,n=tc(e),Jb(e,null,o),n}return ec(e,s,n,o),tc(e)}function ls(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,ib(e,o)}}function Gf(e,n){var o=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,o===s)){var h=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var A={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?h=y=A:y=y.next=A,o=o.next}while(o!==null);y===null?h=y=n:y=y.next=n}else h=y=n;o={baseState:s.baseState,firstBaseUpdate:h,lastBaseUpdate:y,shared:s.shared,callbacks:s.callbacks},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}var Vf=!1;function cs(){if(Vf){var e=Xa;if(e!==null)throw e}}function us(e,n,o,s){Vf=!1;var h=e.updateQueue;Jr=!1;var y=h.firstBaseUpdate,A=h.lastBaseUpdate,k=h.shared.pending;if(k!==null){h.shared.pending=null;var V=k,W=V.next;V.next=null,A===null?y=W:A.next=W,A=V;var re=e.alternate;re!==null&&(re=re.updateQueue,k=re.lastBaseUpdate,k!==A&&(k===null?re.firstBaseUpdate=W:k.next=W,re.lastBaseUpdate=V))}if(y!==null){var se=h.baseState;A=0,re=W=V=null,k=y;do{var J=k.lane&-536870913,ee=J!==k.lane;if(ee?(Ge&J)===J:(s&J)===J){J!==0&&J===Ya&&(Vf=!0),re!==null&&(re=re.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Re=e,Te=k;J=n;var et=o;switch(Te.tag){case 1:if(Re=Te.payload,typeof Re=="function"){se=Re.call(et,se,J);break e}se=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Te.payload,J=typeof Re=="function"?Re.call(et,se,J):Re,J==null)break e;se=C({},se,J);break e;case 2:Jr=!0}}J=k.callback,J!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=h.callbacks,ee===null?h.callbacks=[J]:ee.push(J))}else ee={lane:J,tag:k.tag,payload:k.payload,callback:k.callback,next:null},re===null?(W=re=ee,V=se):re=re.next=ee,A|=J;if(k=k.next,k===null){if(k=h.shared.pending,k===null)break;ee=k,k=ee.next,ee.next=null,h.lastBaseUpdate=ee,h.shared.pending=null}}while(!0);re===null&&(V=se),h.baseState=V,h.firstBaseUpdate=W,h.lastBaseUpdate=re,y===null&&(h.shared.lanes=0),co|=A,e.lanes=A,e.memoizedState=se}}function mx(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function px(e,n){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)mx(o[e],n)}var Ka=K(null),uc=K(0);function gx(e,n){e=_r,te(uc,e),te(Ka,n),_r=e|n.baseLanes}function qf(){te(uc,_r),te(Ka,Ka.current)}function Yf(){_r=uc.current,ne(Ka),ne(uc)}var no=0,Ie=null,We=null,St=null,dc=!1,Qa=!1,Fo=!1,fc=0,ds=0,Fa=null,yN=0;function yt(){throw Error(a(321))}function Xf(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!dn(e[o],n[o]))return!1;return!0}function Kf(e,n,o,s,h,y){return no=y,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,P.H=e===null||e.memoizedState===null?Jx:ev,Fo=!1,y=o(s,h),Fo=!1,Qa&&(y=bx(n,o,s,h)),yx(e),y}function yx(e){P.H=bc;var n=We!==null&&We.next!==null;if(no=0,St=We=Ie=null,dc=!1,ds=0,Fa=null,n)throw Error(a(300));e===null||_t||(e=e.dependencies,e!==null&&ac(e)&&(_t=!0))}function bx(e,n,o,s){Ie=e;var h=0;do{if(Qa&&(Fa=null),ds=0,Qa=!1,25<=h)throw Error(a(301));if(h+=1,St=We=null,e.updateQueue!=null){var y=e.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}P.H=EN,y=n(o,s)}while(Qa);return y}function bN(){var e=P.H,n=e.useState()[0];return n=typeof n.then=="function"?fs(n):n,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Ie.flags|=1024),n}function Qf(){var e=fc!==0;return fc=0,e}function Ff(e,n,o){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~o}function Zf(e){if(dc){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}dc=!1}no=0,St=We=Ie=null,Qa=!1,ds=fc=0,Fa=null}function on(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Ie.memoizedState=St=e:St=St.next=e,St}function Ct(){if(We===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var n=St===null?Ie.memoizedState:St.next;if(n!==null)St=n,We=e;else{if(e===null)throw Ie.alternate===null?Error(a(467)):Error(a(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},St===null?Ie.memoizedState=St=e:St=St.next=e}return St}function Wf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fs(e){var n=ds;return ds+=1,Fa===null&&(Fa=[]),e=dx(Fa,e,n),n=Ie,(St===null?n.memoizedState:St.next)===null&&(n=n.alternate,P.H=n===null||n.memoizedState===null?Jx:ev),e}function hc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fs(e);if(e.$$typeof===R)return Qt(e)}throw Error(a(438,String(e)))}function Jf(e){var n=null,o=Ie.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var s=Ie.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=Wf(),Ie.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(e),s=0;s<e;s++)o[s]=H;return n.index++,o}function jr(e,n){return typeof n=="function"?n(e):n}function mc(e){var n=Ct();return eh(n,We,e)}function eh(e,n,o){var s=e.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=o;var h=e.baseQueue,y=s.pending;if(y!==null){if(h!==null){var A=h.next;h.next=y.next,y.next=A}n.baseQueue=h=y,s.pending=null}if(y=e.baseState,h===null)e.memoizedState=y;else{n=h.next;var k=A=null,V=null,W=n,re=!1;do{var se=W.lane&-536870913;if(se!==W.lane?(Ge&se)===se:(no&se)===se){var J=W.revertLane;if(J===0)V!==null&&(V=V.next={lane:0,revertLane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),se===Ya&&(re=!0);else if((no&J)===J){W=W.next,J===Ya&&(re=!0);continue}else se={lane:0,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},V===null?(k=V=se,A=y):V=V.next=se,Ie.lanes|=J,co|=J;se=W.action,Fo&&o(y,se),y=W.hasEagerState?W.eagerState:o(y,se)}else J={lane:se,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},V===null?(k=V=J,A=y):V=V.next=J,Ie.lanes|=se,co|=se;W=W.next}while(W!==null&&W!==n);if(V===null?A=y:V.next=k,!dn(y,e.memoizedState)&&(_t=!0,re&&(o=Xa,o!==null)))throw o;e.memoizedState=y,e.baseState=A,e.baseQueue=V,s.lastRenderedState=y}return h===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function th(e){var n=Ct(),o=n.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=e;var s=o.dispatch,h=o.pending,y=n.memoizedState;if(h!==null){o.pending=null;var A=h=h.next;do y=e(y,A.action),A=A.next;while(A!==h);dn(y,n.memoizedState)||(_t=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),o.lastRenderedState=y}return[y,s]}function xx(e,n,o){var s=Ie,h=Ct(),y=Ke;if(y){if(o===void 0)throw Error(a(407));o=o()}else o=n();var A=!dn((We||h).memoizedState,o);A&&(h.memoizedState=o,_t=!0),h=h.queue;var k=Cx.bind(null,s,h,e);if(hs(2048,8,k,[e]),h.getSnapshot!==n||A||St!==null&&St.memoizedState.tag&1){if(s.flags|=2048,Za(9,pc(),Sx.bind(null,s,h,o,n),null),rt===null)throw Error(a(349));y||(no&124)!==0||vx(s,n,o)}return o}function vx(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Ie.updateQueue,n===null?(n=Wf(),Ie.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Sx(e,n,o,s){n.value=o,n.getSnapshot=s,wx(n)&&Ex(e)}function Cx(e,n,o){return o(function(){wx(n)&&Ex(e)})}function wx(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!dn(e,o)}catch{return!0}}function Ex(e){var n=$a(e,2);n!==null&&yn(n,e,2)}function nh(e){var n=on();if(typeof e=="function"){var o=e;if(e=o(),Fo){zn(!0);try{o()}finally{zn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:e},n}function Tx(e,n,o,s){return e.baseState=o,eh(e,We,typeof s=="function"?s:jr)}function xN(e,n,o,s,h){if(yc(e))throw Error(a(485));if(e=n.action,e!==null){var y={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){y.listeners.push(A)}};P.T!==null?o(!0):y.isTransition=!1,s(y),o=n.pending,o===null?(y.next=n.pending=y,jx(n,y)):(y.next=o.next,n.pending=o.next=y)}}function jx(e,n){var o=n.action,s=n.payload,h=e.state;if(n.isTransition){var y=P.T,A={};P.T=A;try{var k=o(h,s),V=P.S;V!==null&&V(A,k),Ax(e,n,k)}catch(W){rh(e,n,W)}finally{P.T=y}}else try{y=o(h,s),Ax(e,n,y)}catch(W){rh(e,n,W)}}function Ax(e,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(s){Rx(e,n,s)},function(s){return rh(e,n,s)}):Rx(e,n,o)}function Rx(e,n,o){n.status="fulfilled",n.value=o,Ox(n),e.state=o,n=e.pending,n!==null&&(o=n.next,o===n?e.pending=null:(o=o.next,n.next=o,jx(e,o)))}function rh(e,n,o){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=o,Ox(n),n=n.next;while(n!==s)}e.action=null}function Ox(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Nx(e,n){return n}function Mx(e,n){if(Ke){var o=rt.formState;if(o!==null){e:{var s=Ie;if(Ke){if(ft){t:{for(var h=ft,y=Zn;h.nodeType!==8;){if(!y){h=null;break t}if(h=Un(h.nextSibling),h===null){h=null;break t}}y=h.data,h=y==="F!"||y==="F"?h:null}if(h){ft=Un(h.nextSibling),s=h.data==="F!";break e}}Yo(s)}s=!1}s&&(n=o[0])}}return o=on(),o.memoizedState=o.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nx,lastRenderedState:n},o.queue=s,o=Fx.bind(null,Ie,s),s.dispatch=o,s=nh(!1),y=lh.bind(null,Ie,!1,s.queue),s=on(),h={state:n,dispatch:null,action:e,pending:null},s.queue=h,o=xN.bind(null,Ie,h,y,o),h.dispatch=o,s.memoizedState=e,[n,o,!1]}function _x(e){var n=Ct();return Dx(n,We,e)}function Dx(e,n,o){if(n=eh(e,n,Nx)[0],e=mc(jr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=fs(n)}catch(A){throw A===is?lc:A}else s=n;n=Ct();var h=n.queue,y=h.dispatch;return o!==n.memoizedState&&(Ie.flags|=2048,Za(9,pc(),vN.bind(null,h,o),null)),[s,y,e]}function vN(e,n){e.action=n}function Ix(e){var n=Ct(),o=We;if(o!==null)return Dx(n,o,e);Ct(),n=n.memoizedState,o=Ct();var s=o.queue.dispatch;return o.memoizedState=e,[n,s,!1]}function Za(e,n,o,s){return e={tag:e,create:o,deps:s,inst:n,next:null},n=Ie.updateQueue,n===null&&(n=Wf(),Ie.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=e.next=e:(s=o.next,o.next=e,e.next=s,n.lastEffect=e),e}function pc(){return{destroy:void 0,resource:void 0}}function kx(){return Ct().memoizedState}function gc(e,n,o,s){var h=on();s=s===void 0?null:s,Ie.flags|=e,h.memoizedState=Za(1|n,pc(),o,s)}function hs(e,n,o,s){var h=Ct();s=s===void 0?null:s;var y=h.memoizedState.inst;We!==null&&s!==null&&Xf(s,We.memoizedState.deps)?h.memoizedState=Za(n,y,o,s):(Ie.flags|=e,h.memoizedState=Za(1|n,y,o,s))}function Lx(e,n){gc(8390656,8,e,n)}function zx(e,n){hs(2048,8,e,n)}function Bx(e,n){return hs(4,2,e,n)}function Hx(e,n){return hs(4,4,e,n)}function Px(e,n){if(typeof n=="function"){e=e();var o=n(e);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Ux(e,n,o){o=o!=null?o.concat([e]):null,hs(4,4,Px.bind(null,n,e),o)}function oh(){}function $x(e,n){var o=Ct();n=n===void 0?null:n;var s=o.memoizedState;return n!==null&&Xf(n,s[1])?s[0]:(o.memoizedState=[e,n],e)}function Gx(e,n){var o=Ct();n=n===void 0?null:n;var s=o.memoizedState;if(n!==null&&Xf(n,s[1]))return s[0];if(s=e(),Fo){zn(!0);try{e()}finally{zn(!1)}}return o.memoizedState=[s,n],s}function ah(e,n,o){return o===void 0||(no&1073741824)!==0?e.memoizedState=n:(e.memoizedState=o,e=Yv(),Ie.lanes|=e,co|=e,o)}function Vx(e,n,o,s){return dn(o,n)?o:Ka.current!==null?(e=ah(e,o,s),dn(e,n)||(_t=!0),e):(no&42)===0?(_t=!0,e.memoizedState=o):(e=Yv(),Ie.lanes|=e,co|=e,n)}function qx(e,n,o,s,h){var y=G.p;G.p=y!==0&&8>y?y:8;var A=P.T,k={};P.T=k,lh(e,!1,n,o);try{var V=h(),W=P.S;if(W!==null&&W(k,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var re=gN(V,s);ms(e,n,re,gn(e))}else ms(e,n,s,gn(e))}catch(se){ms(e,n,{then:function(){},status:"rejected",reason:se},gn())}finally{G.p=y,P.T=A}}function SN(){}function ih(e,n,o,s){if(e.tag!==5)throw Error(a(476));var h=Yx(e).queue;qx(e,h,n,B,o===null?SN:function(){return Xx(e),o(s)})}function Yx(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:B},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:o},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Xx(e){var n=Yx(e).next.queue;ms(e,n,{},gn())}function sh(){return Qt(_s)}function Kx(){return Ct().memoizedState}function Qx(){return Ct().memoizedState}function CN(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var o=gn();e=eo(o);var s=to(n,e,o);s!==null&&(yn(s,n,o),ls(s,n,o)),n={cache:zf()},e.payload=n;return}n=n.return}}function wN(e,n,o){var s=gn();o={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},yc(e)?Zx(n,o):(o=Af(e,n,o,s),o!==null&&(yn(o,e,s),Wx(o,n,s)))}function Fx(e,n,o){var s=gn();ms(e,n,o,s)}function ms(e,n,o,s){var h={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(yc(e))Zx(n,h);else{var y=e.alternate;if(e.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null))try{var A=n.lastRenderedState,k=y(A,o);if(h.hasEagerState=!0,h.eagerState=k,dn(k,A))return ec(e,n,h,0),rt===null&&Jl(),!1}catch{}finally{}if(o=Af(e,n,h,s),o!==null)return yn(o,e,s),Wx(o,n,s),!0}return!1}function lh(e,n,o,s){if(s={lane:2,revertLane:Ph(),action:s,hasEagerState:!1,eagerState:null,next:null},yc(e)){if(n)throw Error(a(479))}else n=Af(e,o,s,2),n!==null&&yn(n,e,2)}function yc(e){var n=e.alternate;return e===Ie||n!==null&&n===Ie}function Zx(e,n){Qa=dc=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function Wx(e,n,o){if((o&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,ib(e,o)}}var bc={readContext:Qt,use:hc,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt},Jx={readContext:Qt,use:hc,useCallback:function(e,n){return on().memoizedState=[e,n===void 0?null:n],e},useContext:Qt,useEffect:Lx,useImperativeHandle:function(e,n,o){o=o!=null?o.concat([e]):null,gc(4194308,4,Px.bind(null,n,e),o)},useLayoutEffect:function(e,n){return gc(4194308,4,e,n)},useInsertionEffect:function(e,n){gc(4,2,e,n)},useMemo:function(e,n){var o=on();n=n===void 0?null:n;var s=e();if(Fo){zn(!0);try{e()}finally{zn(!1)}}return o.memoizedState=[s,n],s},useReducer:function(e,n,o){var s=on();if(o!==void 0){var h=o(n);if(Fo){zn(!0);try{o(n)}finally{zn(!1)}}}else h=n;return s.memoizedState=s.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},s.queue=e,e=e.dispatch=wN.bind(null,Ie,e),[s.memoizedState,e]},useRef:function(e){var n=on();return e={current:e},n.memoizedState=e},useState:function(e){e=nh(e);var n=e.queue,o=Fx.bind(null,Ie,n);return n.dispatch=o,[e.memoizedState,o]},useDebugValue:oh,useDeferredValue:function(e,n){var o=on();return ah(o,e,n)},useTransition:function(){var e=nh(!1);return e=qx.bind(null,Ie,e.queue,!0,!1),on().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,o){var s=Ie,h=on();if(Ke){if(o===void 0)throw Error(a(407));o=o()}else{if(o=n(),rt===null)throw Error(a(349));(Ge&124)!==0||vx(s,n,o)}h.memoizedState=o;var y={value:o,getSnapshot:n};return h.queue=y,Lx(Cx.bind(null,s,y,e),[e]),s.flags|=2048,Za(9,pc(),Sx.bind(null,s,y,o,n),null),o},useId:function(){var e=on(),n=rt.identifierPrefix;if(Ke){var o=wr,s=Cr;o=(s&~(1<<32-Yt(s)-1)).toString(32)+o,n="«"+n+"R"+o,o=fc++,0<o&&(n+="H"+o.toString(32)),n+="»"}else o=yN++,n="«"+n+"r"+o.toString(32)+"»";return e.memoizedState=n},useHostTransitionStatus:sh,useFormState:Mx,useActionState:Mx,useOptimistic:function(e){var n=on();n.memoizedState=n.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=lh.bind(null,Ie,!0,o),o.dispatch=n,[e,n]},useMemoCache:Jf,useCacheRefresh:function(){return on().memoizedState=CN.bind(null,Ie)}},ev={readContext:Qt,use:hc,useCallback:$x,useContext:Qt,useEffect:zx,useImperativeHandle:Ux,useInsertionEffect:Bx,useLayoutEffect:Hx,useMemo:Gx,useReducer:mc,useRef:kx,useState:function(){return mc(jr)},useDebugValue:oh,useDeferredValue:function(e,n){var o=Ct();return Vx(o,We.memoizedState,e,n)},useTransition:function(){var e=mc(jr)[0],n=Ct().memoizedState;return[typeof e=="boolean"?e:fs(e),n]},useSyncExternalStore:xx,useId:Kx,useHostTransitionStatus:sh,useFormState:_x,useActionState:_x,useOptimistic:function(e,n){var o=Ct();return Tx(o,We,e,n)},useMemoCache:Jf,useCacheRefresh:Qx},EN={readContext:Qt,use:hc,useCallback:$x,useContext:Qt,useEffect:zx,useImperativeHandle:Ux,useInsertionEffect:Bx,useLayoutEffect:Hx,useMemo:Gx,useReducer:th,useRef:kx,useState:function(){return th(jr)},useDebugValue:oh,useDeferredValue:function(e,n){var o=Ct();return We===null?ah(o,e,n):Vx(o,We.memoizedState,e,n)},useTransition:function(){var e=th(jr)[0],n=Ct().memoizedState;return[typeof e=="boolean"?e:fs(e),n]},useSyncExternalStore:xx,useId:Kx,useHostTransitionStatus:sh,useFormState:Ix,useActionState:Ix,useOptimistic:function(e,n){var o=Ct();return We!==null?Tx(o,We,e,n):(o.baseState=e,[e,o.queue.dispatch])},useMemoCache:Jf,useCacheRefresh:Qx},Wa=null,ps=0;function xc(e){var n=ps;return ps+=1,Wa===null&&(Wa=[]),dx(Wa,e,n)}function gs(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function vc(e,n){throw n.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function tv(e){var n=e._init;return n(e._payload)}function nv(e){function n(F,X){if(e){var Z=F.deletions;Z===null?(F.deletions=[X],F.flags|=16):Z.push(X)}}function o(F,X){if(!e)return null;for(;X!==null;)n(F,X),X=X.sibling;return null}function s(F){for(var X=new Map;F!==null;)F.key!==null?X.set(F.key,F):X.set(F.index,F),F=F.sibling;return X}function h(F,X){return F=Sr(F,X),F.index=0,F.sibling=null,F}function y(F,X,Z){return F.index=Z,e?(Z=F.alternate,Z!==null?(Z=Z.index,Z<X?(F.flags|=67108866,X):Z):(F.flags|=67108866,X)):(F.flags|=1048576,X)}function A(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function k(F,X,Z,ie){return X===null||X.tag!==6?(X=Of(Z,F.mode,ie),X.return=F,X):(X=h(X,Z),X.return=F,X)}function V(F,X,Z,ie){var ye=Z.type;return ye===x?re(F,X,Z.props.children,ie,Z.key):X!==null&&(X.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===I&&tv(ye)===X.type)?(X=h(X,Z.props),gs(X,Z),X.return=F,X):(X=nc(Z.type,Z.key,Z.props,null,F.mode,ie),gs(X,Z),X.return=F,X)}function W(F,X,Z,ie){return X===null||X.tag!==4||X.stateNode.containerInfo!==Z.containerInfo||X.stateNode.implementation!==Z.implementation?(X=Nf(Z,F.mode,ie),X.return=F,X):(X=h(X,Z.children||[]),X.return=F,X)}function re(F,X,Z,ie,ye){return X===null||X.tag!==7?(X=$o(Z,F.mode,ie,ye),X.return=F,X):(X=h(X,Z),X.return=F,X)}function se(F,X,Z){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Of(""+X,F.mode,Z),X.return=F,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return Z=nc(X.type,X.key,X.props,null,F.mode,Z),gs(Z,X),Z.return=F,Z;case v:return X=Nf(X,F.mode,Z),X.return=F,X;case I:var ie=X._init;return X=ie(X._payload),se(F,X,Z)}if(q(X)||$(X))return X=$o(X,F.mode,Z,null),X.return=F,X;if(typeof X.then=="function")return se(F,xc(X),Z);if(X.$$typeof===R)return se(F,ic(F,X),Z);vc(F,X)}return null}function J(F,X,Z,ie){var ye=X!==null?X.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return ye!==null?null:k(F,X,""+Z,ie);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===ye?V(F,X,Z,ie):null;case v:return Z.key===ye?W(F,X,Z,ie):null;case I:return ye=Z._init,Z=ye(Z._payload),J(F,X,Z,ie)}if(q(Z)||$(Z))return ye!==null?null:re(F,X,Z,ie,null);if(typeof Z.then=="function")return J(F,X,xc(Z),ie);if(Z.$$typeof===R)return J(F,X,ic(F,Z),ie);vc(F,Z)}return null}function ee(F,X,Z,ie,ye){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return F=F.get(Z)||null,k(X,F,""+ie,ye);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:return F=F.get(ie.key===null?Z:ie.key)||null,V(X,F,ie,ye);case v:return F=F.get(ie.key===null?Z:ie.key)||null,W(X,F,ie,ye);case I:var ke=ie._init;return ie=ke(ie._payload),ee(F,X,Z,ie,ye)}if(q(ie)||$(ie))return F=F.get(Z)||null,re(X,F,ie,ye,null);if(typeof ie.then=="function")return ee(F,X,Z,xc(ie),ye);if(ie.$$typeof===R)return ee(F,X,Z,ic(X,ie),ye);vc(X,ie)}return null}function Re(F,X,Z,ie){for(var ye=null,ke=null,ve=X,je=X=0,It=null;ve!==null&&je<Z.length;je++){ve.index>je?(It=ve,ve=null):It=ve.sibling;var Xe=J(F,ve,Z[je],ie);if(Xe===null){ve===null&&(ve=It);break}e&&ve&&Xe.alternate===null&&n(F,ve),X=y(Xe,X,je),ke===null?ye=Xe:ke.sibling=Xe,ke=Xe,ve=It}if(je===Z.length)return o(F,ve),Ke&&Vo(F,je),ye;if(ve===null){for(;je<Z.length;je++)ve=se(F,Z[je],ie),ve!==null&&(X=y(ve,X,je),ke===null?ye=ve:ke.sibling=ve,ke=ve);return Ke&&Vo(F,je),ye}for(ve=s(ve);je<Z.length;je++)It=ee(ve,F,je,Z[je],ie),It!==null&&(e&&It.alternate!==null&&ve.delete(It.key===null?je:It.key),X=y(It,X,je),ke===null?ye=It:ke.sibling=It,ke=It);return e&&ve.forEach(function(xo){return n(F,xo)}),Ke&&Vo(F,je),ye}function Te(F,X,Z,ie){if(Z==null)throw Error(a(151));for(var ye=null,ke=null,ve=X,je=X=0,It=null,Xe=Z.next();ve!==null&&!Xe.done;je++,Xe=Z.next()){ve.index>je?(It=ve,ve=null):It=ve.sibling;var xo=J(F,ve,Xe.value,ie);if(xo===null){ve===null&&(ve=It);break}e&&ve&&xo.alternate===null&&n(F,ve),X=y(xo,X,je),ke===null?ye=xo:ke.sibling=xo,ke=xo,ve=It}if(Xe.done)return o(F,ve),Ke&&Vo(F,je),ye;if(ve===null){for(;!Xe.done;je++,Xe=Z.next())Xe=se(F,Xe.value,ie),Xe!==null&&(X=y(Xe,X,je),ke===null?ye=Xe:ke.sibling=Xe,ke=Xe);return Ke&&Vo(F,je),ye}for(ve=s(ve);!Xe.done;je++,Xe=Z.next())Xe=ee(ve,F,je,Xe.value,ie),Xe!==null&&(e&&Xe.alternate!==null&&ve.delete(Xe.key===null?je:Xe.key),X=y(Xe,X,je),ke===null?ye=Xe:ke.sibling=Xe,ke=Xe);return e&&ve.forEach(function(TM){return n(F,TM)}),Ke&&Vo(F,je),ye}function et(F,X,Z,ie){if(typeof Z=="object"&&Z!==null&&Z.type===x&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var ye=Z.key;X!==null;){if(X.key===ye){if(ye=Z.type,ye===x){if(X.tag===7){o(F,X.sibling),ie=h(X,Z.props.children),ie.return=F,F=ie;break e}}else if(X.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===I&&tv(ye)===X.type){o(F,X.sibling),ie=h(X,Z.props),gs(ie,Z),ie.return=F,F=ie;break e}o(F,X);break}else n(F,X);X=X.sibling}Z.type===x?(ie=$o(Z.props.children,F.mode,ie,Z.key),ie.return=F,F=ie):(ie=nc(Z.type,Z.key,Z.props,null,F.mode,ie),gs(ie,Z),ie.return=F,F=ie)}return A(F);case v:e:{for(ye=Z.key;X!==null;){if(X.key===ye)if(X.tag===4&&X.stateNode.containerInfo===Z.containerInfo&&X.stateNode.implementation===Z.implementation){o(F,X.sibling),ie=h(X,Z.children||[]),ie.return=F,F=ie;break e}else{o(F,X);break}else n(F,X);X=X.sibling}ie=Nf(Z,F.mode,ie),ie.return=F,F=ie}return A(F);case I:return ye=Z._init,Z=ye(Z._payload),et(F,X,Z,ie)}if(q(Z))return Re(F,X,Z,ie);if($(Z)){if(ye=$(Z),typeof ye!="function")throw Error(a(150));return Z=ye.call(Z),Te(F,X,Z,ie)}if(typeof Z.then=="function")return et(F,X,xc(Z),ie);if(Z.$$typeof===R)return et(F,X,ic(F,Z),ie);vc(F,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,X!==null&&X.tag===6?(o(F,X.sibling),ie=h(X,Z),ie.return=F,F=ie):(o(F,X),ie=Of(Z,F.mode,ie),ie.return=F,F=ie),A(F)):o(F,X)}return function(F,X,Z,ie){try{ps=0;var ye=et(F,X,Z,ie);return Wa=null,ye}catch(ve){if(ve===is||ve===lc)throw ve;var ke=fn(29,ve,null,F.mode);return ke.lanes=ie,ke.return=F,ke}finally{}}}var Ja=nv(!0),rv=nv(!1),Mn=K(null),Wn=null;function ro(e){var n=e.alternate;te(At,At.current&1),te(Mn,e),Wn===null&&(n===null||Ka.current!==null||n.memoizedState!==null)&&(Wn=e)}function ov(e){if(e.tag===22){if(te(At,At.current),te(Mn,e),Wn===null){var n=e.alternate;n!==null&&n.memoizedState!==null&&(Wn=e)}}else oo()}function oo(){te(At,At.current),te(Mn,Mn.current)}function Ar(e){ne(Mn),Wn===e&&(Wn=null),ne(At)}var At=K(0);function Sc(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||Wh(o)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function ch(e,n,o,s){n=e.memoizedState,o=o(s,n),o=o==null?n:C({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var uh={enqueueSetState:function(e,n,o){e=e._reactInternals;var s=gn(),h=eo(s);h.payload=n,o!=null&&(h.callback=o),n=to(e,h,s),n!==null&&(yn(n,e,s),ls(n,e,s))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var s=gn(),h=eo(s);h.tag=1,h.payload=n,o!=null&&(h.callback=o),n=to(e,h,s),n!==null&&(yn(n,e,s),ls(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=gn(),s=eo(o);s.tag=2,n!=null&&(s.callback=n),n=to(e,s,o),n!==null&&(yn(n,e,o),ls(n,e,o))}};function av(e,n,o,s,h,y,A){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,y,A):n.prototype&&n.prototype.isPureReactComponent?!Wi(o,s)||!Wi(h,y):!0}function iv(e,n,o,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,s),n.state!==e&&uh.enqueueReplaceState(n,n.state,null)}function Zo(e,n){var o=n;if("ref"in n){o={};for(var s in n)s!=="ref"&&(o[s]=n[s])}if(e=e.defaultProps){o===n&&(o=C({},o));for(var h in e)o[h]===void 0&&(o[h]=e[h])}return o}var Cc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function sv(e){Cc(e)}function lv(e){console.error(e)}function cv(e){Cc(e)}function wc(e,n){try{var o=e.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function uv(e,n,o){try{var s=e.onCaughtError;s(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function dh(e,n,o){return o=eo(o),o.tag=3,o.payload={element:null},o.callback=function(){wc(e,n)},o}function dv(e){return e=eo(e),e.tag=3,e}function fv(e,n,o,s){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var y=s.value;e.payload=function(){return h(y)},e.callback=function(){uv(n,o,s)}}var A=o.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(e.callback=function(){uv(n,o,s),typeof h!="function"&&(uo===null?uo=new Set([this]):uo.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function TN(e,n,o,s,h){if(o.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=o.alternate,n!==null&&rs(n,o,h,!0),o=Mn.current,o!==null){switch(o.tag){case 13:return Wn===null?kh():o.alternate===null&&ht===0&&(ht=3),o.flags&=-257,o.flags|=65536,o.lanes=h,s===Pf?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([s]):n.add(s),zh(e,s,h)),!1;case 22:return o.flags|=65536,s===Pf?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([s]):o.add(s)),zh(e,s,h)),!1}throw Error(a(435,o.tag))}return zh(e,s,h),kh(),!1}if(Ke)return n=Mn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,s!==Df&&(e=Error(a(422),{cause:s}),ns(An(e,o)))):(s!==Df&&(n=Error(a(423),{cause:s}),ns(An(n,o))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,s=An(s,o),h=dh(e.stateNode,s,h),Gf(e,h),ht!==4&&(ht=2)),!1;var y=Error(a(520),{cause:s});if(y=An(y,o),ws===null?ws=[y]:ws.push(y),ht!==4&&(ht=2),n===null)return!0;s=An(s,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,e=h&-h,o.lanes|=e,e=dh(o.stateNode,s,e),Gf(o,e),!1;case 1:if(n=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(uo===null||!uo.has(y))))return o.flags|=65536,h&=-h,o.lanes|=h,h=dv(h),fv(h,e,o,s),Gf(o,h),!1}o=o.return}while(o!==null);return!1}var hv=Error(a(461)),_t=!1;function Bt(e,n,o,s){n.child=e===null?rv(n,null,o,s):Ja(n,e.child,o,s)}function mv(e,n,o,s,h){o=o.render;var y=n.ref;if("ref"in s){var A={};for(var k in s)k!=="ref"&&(A[k]=s[k])}else A=s;return Ko(n),s=Kf(e,n,o,A,y,h),k=Qf(),e!==null&&!_t?(Ff(e,n,h),Rr(e,n,h)):(Ke&&k&&Mf(n),n.flags|=1,Bt(e,n,s,h),n.child)}function pv(e,n,o,s,h){if(e===null){var y=o.type;return typeof y=="function"&&!Rf(y)&&y.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=y,gv(e,n,y,s,h)):(e=nc(o.type,null,s,n,n.mode,h),e.ref=n.ref,e.return=n,n.child=e)}if(y=e.child,!xh(e,h)){var A=y.memoizedProps;if(o=o.compare,o=o!==null?o:Wi,o(A,s)&&e.ref===n.ref)return Rr(e,n,h)}return n.flags|=1,e=Sr(y,s),e.ref=n.ref,e.return=n,n.child=e}function gv(e,n,o,s,h){if(e!==null){var y=e.memoizedProps;if(Wi(y,s)&&e.ref===n.ref)if(_t=!1,n.pendingProps=s=y,xh(e,h))(e.flags&131072)!==0&&(_t=!0);else return n.lanes=e.lanes,Rr(e,n,h)}return fh(e,n,o,s,h)}function yv(e,n,o){var s=n.pendingProps,h=s.children,y=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if((n.flags&128)!==0){if(s=y!==null?y.baseLanes|o:o,e!==null){for(h=n.child=e.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;n.childLanes=y&~s}else n.childLanes=0,n.child=null;return bv(e,n,s,o)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&sc(n,y!==null?y.cachePool:null),y!==null?gx(n,y):qf(),ov(n);else return n.lanes=n.childLanes=536870912,bv(e,n,y!==null?y.baseLanes|o:o,o)}else y!==null?(sc(n,y.cachePool),gx(n,y),oo(),n.memoizedState=null):(e!==null&&sc(n,null),qf(),oo());return Bt(e,n,h,o),n.child}function bv(e,n,o,s){var h=Hf();return h=h===null?null:{parent:jt._currentValue,pool:h},n.memoizedState={baseLanes:o,cachePool:h},e!==null&&sc(n,null),qf(),ov(n),e!==null&&rs(e,n,s,!0),null}function Ec(e,n){var o=n.ref;if(o===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(e===null||e.ref!==o)&&(n.flags|=4194816)}}function fh(e,n,o,s,h){return Ko(n),o=Kf(e,n,o,s,void 0,h),s=Qf(),e!==null&&!_t?(Ff(e,n,h),Rr(e,n,h)):(Ke&&s&&Mf(n),n.flags|=1,Bt(e,n,o,h),n.child)}function xv(e,n,o,s,h,y){return Ko(n),n.updateQueue=null,o=bx(n,s,o,h),yx(e),s=Qf(),e!==null&&!_t?(Ff(e,n,y),Rr(e,n,y)):(Ke&&s&&Mf(n),n.flags|=1,Bt(e,n,o,y),n.child)}function vv(e,n,o,s,h){if(Ko(n),n.stateNode===null){var y=Ga,A=o.contextType;typeof A=="object"&&A!==null&&(y=Qt(A)),y=new o(s,y),n.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=uh,n.stateNode=y,y._reactInternals=n,y=n.stateNode,y.props=s,y.state=n.memoizedState,y.refs={},Uf(n),A=o.contextType,y.context=typeof A=="object"&&A!==null?Qt(A):Ga,y.state=n.memoizedState,A=o.getDerivedStateFromProps,typeof A=="function"&&(ch(n,o,A,s),y.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(A=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),A!==y.state&&uh.enqueueReplaceState(y,y.state,null),us(n,s,y,h),cs(),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){y=n.stateNode;var k=n.memoizedProps,V=Zo(o,k);y.props=V;var W=y.context,re=o.contextType;A=Ga,typeof re=="object"&&re!==null&&(A=Qt(re));var se=o.getDerivedStateFromProps;re=typeof se=="function"||typeof y.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,re||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k||W!==A)&&iv(n,y,s,A),Jr=!1;var J=n.memoizedState;y.state=J,us(n,s,y,h),cs(),W=n.memoizedState,k||J!==W||Jr?(typeof se=="function"&&(ch(n,o,se,s),W=n.memoizedState),(V=Jr||av(n,o,V,s,J,W,A))?(re||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(n.flags|=4194308)):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=W),y.props=s,y.state=W,y.context=A,s=V):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{y=n.stateNode,$f(e,n),A=n.memoizedProps,re=Zo(o,A),y.props=re,se=n.pendingProps,J=y.context,W=o.contextType,V=Ga,typeof W=="object"&&W!==null&&(V=Qt(W)),k=o.getDerivedStateFromProps,(W=typeof k=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(A!==se||J!==V)&&iv(n,y,s,V),Jr=!1,J=n.memoizedState,y.state=J,us(n,s,y,h),cs();var ee=n.memoizedState;A!==se||J!==ee||Jr||e!==null&&e.dependencies!==null&&ac(e.dependencies)?(typeof k=="function"&&(ch(n,o,k,s),ee=n.memoizedState),(re=Jr||av(n,o,re,s,J,ee,V)||e!==null&&e.dependencies!==null&&ac(e.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(s,ee,V),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(s,ee,V)),typeof y.componentDidUpdate=="function"&&(n.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof y.componentDidUpdate!="function"||A===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=ee),y.props=s,y.state=ee,y.context=V,s=re):(typeof y.componentDidUpdate!="function"||A===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),s=!1)}return y=s,Ec(e,n),s=(n.flags&128)!==0,y||s?(y=n.stateNode,o=s&&typeof o.getDerivedStateFromError!="function"?null:y.render(),n.flags|=1,e!==null&&s?(n.child=Ja(n,e.child,null,h),n.child=Ja(n,null,o,h)):Bt(e,n,o,h),n.memoizedState=y.state,e=n.child):e=Rr(e,n,h),e}function Sv(e,n,o,s){return ts(),n.flags|=256,Bt(e,n,o,s),n.child}var hh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mh(e){return{baseLanes:e,cachePool:lx()}}function ph(e,n,o){return e=e!==null?e.childLanes&~o:0,n&&(e|=_n),e}function Cv(e,n,o){var s=n.pendingProps,h=!1,y=(n.flags&128)!==0,A;if((A=y)||(A=e!==null&&e.memoizedState===null?!1:(At.current&2)!==0),A&&(h=!0,n.flags&=-129),A=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ke){if(h?ro(n):oo(),Ke){var k=ft,V;if(V=k){e:{for(V=k,k=Zn;V.nodeType!==8;){if(!k){k=null;break e}if(V=Un(V.nextSibling),V===null){k=null;break e}}k=V}k!==null?(n.memoizedState={dehydrated:k,treeContext:Go!==null?{id:Cr,overflow:wr}:null,retryLane:536870912,hydrationErrors:null},V=fn(18,null,null,0),V.stateNode=k,V.return=n,n.child=V,Jt=n,ft=null,V=!0):V=!1}V||Yo(n)}if(k=n.memoizedState,k!==null&&(k=k.dehydrated,k!==null))return Wh(k)?n.lanes=32:n.lanes=536870912,null;Ar(n)}return k=s.children,s=s.fallback,h?(oo(),h=n.mode,k=Tc({mode:"hidden",children:k},h),s=$o(s,h,o,null),k.return=n,s.return=n,k.sibling=s,n.child=k,h=n.child,h.memoizedState=mh(o),h.childLanes=ph(e,A,o),n.memoizedState=hh,s):(ro(n),gh(n,k))}if(V=e.memoizedState,V!==null&&(k=V.dehydrated,k!==null)){if(y)n.flags&256?(ro(n),n.flags&=-257,n=yh(e,n,o)):n.memoizedState!==null?(oo(),n.child=e.child,n.flags|=128,n=null):(oo(),h=s.fallback,k=n.mode,s=Tc({mode:"visible",children:s.children},k),h=$o(h,k,o,null),h.flags|=2,s.return=n,h.return=n,s.sibling=h,n.child=s,Ja(n,e.child,null,o),s=n.child,s.memoizedState=mh(o),s.childLanes=ph(e,A,o),n.memoizedState=hh,n=h);else if(ro(n),Wh(k)){if(A=k.nextSibling&&k.nextSibling.dataset,A)var W=A.dgst;A=W,s=Error(a(419)),s.stack="",s.digest=A,ns({value:s,source:null,stack:null}),n=yh(e,n,o)}else if(_t||rs(e,n,o,!1),A=(o&e.childLanes)!==0,_t||A){if(A=rt,A!==null&&(s=o&-o,s=(s&42)!==0?1:Wd(s),s=(s&(A.suspendedLanes|o))!==0?0:s,s!==0&&s!==V.retryLane))throw V.retryLane=s,$a(e,s),yn(A,e,s),hv;k.data==="$?"||kh(),n=yh(e,n,o)}else k.data==="$?"?(n.flags|=192,n.child=e.child,n=null):(e=V.treeContext,ft=Un(k.nextSibling),Jt=n,Ke=!0,qo=null,Zn=!1,e!==null&&(On[Nn++]=Cr,On[Nn++]=wr,On[Nn++]=Go,Cr=e.id,wr=e.overflow,Go=n),n=gh(n,s.children),n.flags|=4096);return n}return h?(oo(),h=s.fallback,k=n.mode,V=e.child,W=V.sibling,s=Sr(V,{mode:"hidden",children:s.children}),s.subtreeFlags=V.subtreeFlags&65011712,W!==null?h=Sr(W,h):(h=$o(h,k,o,null),h.flags|=2),h.return=n,s.return=n,s.sibling=h,n.child=s,s=h,h=n.child,k=e.child.memoizedState,k===null?k=mh(o):(V=k.cachePool,V!==null?(W=jt._currentValue,V=V.parent!==W?{parent:W,pool:W}:V):V=lx(),k={baseLanes:k.baseLanes|o,cachePool:V}),h.memoizedState=k,h.childLanes=ph(e,A,o),n.memoizedState=hh,s):(ro(n),o=e.child,e=o.sibling,o=Sr(o,{mode:"visible",children:s.children}),o.return=n,o.sibling=null,e!==null&&(A=n.deletions,A===null?(n.deletions=[e],n.flags|=16):A.push(e)),n.child=o,n.memoizedState=null,o)}function gh(e,n){return n=Tc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Tc(e,n){return e=fn(22,e,null,n),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function yh(e,n,o){return Ja(n,e.child,null,o),e=gh(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function wv(e,n,o){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),kf(e.return,n,o)}function bh(e,n,o,s,h){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:o,tailMode:h}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=o,y.tailMode=h)}function Ev(e,n,o){var s=n.pendingProps,h=s.revealOrder,y=s.tail;if(Bt(e,n,s.children,o),s=At.current,(s&2)!==0)s=s&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wv(e,o,n);else if(e.tag===19)wv(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}switch(te(At,s),h){case"forwards":for(o=n.child,h=null;o!==null;)e=o.alternate,e!==null&&Sc(e)===null&&(h=o),o=o.sibling;o=h,o===null?(h=n.child,n.child=null):(h=o.sibling,o.sibling=null),bh(n,!1,h,o,y);break;case"backwards":for(o=null,h=n.child,n.child=null;h!==null;){if(e=h.alternate,e!==null&&Sc(e)===null){n.child=h;break}e=h.sibling,h.sibling=o,o=h,h=e}bh(n,!0,o,null,y);break;case"together":bh(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Rr(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),co|=n.lanes,(o&n.childLanes)===0)if(e!==null){if(rs(e,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,o=Sr(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=Sr(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function xh(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&ac(e)))}function jN(e,n,o){switch(n.tag){case 3:we(n,n.stateNode.containerInfo),Wr(n,jt,e.memoizedState.cache),ts();break;case 27:case 5:de(n);break;case 4:we(n,n.stateNode.containerInfo);break;case 10:Wr(n,n.type,n.memoizedProps.value);break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(ro(n),n.flags|=128,null):(o&n.child.childLanes)!==0?Cv(e,n,o):(ro(n),e=Rr(e,n,o),e!==null?e.sibling:null);ro(n);break;case 19:var h=(e.flags&128)!==0;if(s=(o&n.childLanes)!==0,s||(rs(e,n,o,!1),s=(o&n.childLanes)!==0),h){if(s)return Ev(e,n,o);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),te(At,At.current),s)break;return null;case 22:case 23:return n.lanes=0,yv(e,n,o);case 24:Wr(n,jt,e.memoizedState.cache)}return Rr(e,n,o)}function Tv(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps)_t=!0;else{if(!xh(e,o)&&(n.flags&128)===0)return _t=!1,jN(e,n,o);_t=(e.flags&131072)!==0}else _t=!1,Ke&&(n.flags&1048576)!==0&&tx(n,oc,n.index);switch(n.lanes=0,n.tag){case 16:e:{e=n.pendingProps;var s=n.elementType,h=s._init;if(s=h(s._payload),n.type=s,typeof s=="function")Rf(s)?(e=Zo(s,e),n.tag=1,n=vv(null,n,s,e,o)):(n.tag=0,n=fh(null,n,s,e,o));else{if(s!=null){if(h=s.$$typeof,h===O){n.tag=11,n=mv(null,n,s,e,o);break e}else if(h===_){n.tag=14,n=pv(null,n,s,e,o);break e}}throw n=U(s)||s,Error(a(306,n,""))}}return n;case 0:return fh(e,n,n.type,n.pendingProps,o);case 1:return s=n.type,h=Zo(s,n.pendingProps),vv(e,n,s,h,o);case 3:e:{if(we(n,n.stateNode.containerInfo),e===null)throw Error(a(387));s=n.pendingProps;var y=n.memoizedState;h=y.element,$f(e,n),us(n,s,null,o);var A=n.memoizedState;if(s=A.cache,Wr(n,jt,s),s!==y.cache&&Lf(n,[jt],o,!0),cs(),s=A.element,y.isDehydrated)if(y={element:s,isDehydrated:!1,cache:A.cache},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){n=Sv(e,n,s,o);break e}else if(s!==h){h=An(Error(a(424)),n),ns(h),n=Sv(e,n,s,o);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ft=Un(e.firstChild),Jt=n,Ke=!0,qo=null,Zn=!0,o=rv(n,null,s,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(ts(),s===h){n=Rr(e,n,o);break e}Bt(e,n,s,o)}n=n.child}return n;case 26:return Ec(e,n),e===null?(o=O1(n.type,null,n.pendingProps,null))?n.memoizedState=o:Ke||(o=n.type,e=n.pendingProps,s=Hc(ae.current).createElement(o),s[Kt]=n,s[nn]=e,Pt(s,o,e),Mt(s),n.stateNode=s):n.memoizedState=O1(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return de(n),e===null&&Ke&&(s=n.stateNode=j1(n.type,n.pendingProps,ae.current),Jt=n,Zn=!0,h=ft,mo(n.type)?(Jh=h,ft=Un(s.firstChild)):ft=h),Bt(e,n,n.pendingProps.children,o),Ec(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ke&&((h=s=ft)&&(s=eM(s,n.type,n.pendingProps,Zn),s!==null?(n.stateNode=s,Jt=n,ft=Un(s.firstChild),Zn=!1,h=!0):h=!1),h||Yo(n)),de(n),h=n.type,y=n.pendingProps,A=e!==null?e.memoizedProps:null,s=y.children,Qh(h,y)?s=null:A!==null&&Qh(h,A)&&(n.flags|=32),n.memoizedState!==null&&(h=Kf(e,n,bN,null,null,o),_s._currentValue=h),Ec(e,n),Bt(e,n,s,o),n.child;case 6:return e===null&&Ke&&((e=o=ft)&&(o=tM(o,n.pendingProps,Zn),o!==null?(n.stateNode=o,Jt=n,ft=null,e=!0):e=!1),e||Yo(n)),null;case 13:return Cv(e,n,o);case 4:return we(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Ja(n,null,s,o):Bt(e,n,s,o),n.child;case 11:return mv(e,n,n.type,n.pendingProps,o);case 7:return Bt(e,n,n.pendingProps,o),n.child;case 8:return Bt(e,n,n.pendingProps.children,o),n.child;case 12:return Bt(e,n,n.pendingProps.children,o),n.child;case 10:return s=n.pendingProps,Wr(n,n.type,s.value),Bt(e,n,s.children,o),n.child;case 9:return h=n.type._context,s=n.pendingProps.children,Ko(n),h=Qt(h),s=s(h),n.flags|=1,Bt(e,n,s,o),n.child;case 14:return pv(e,n,n.type,n.pendingProps,o);case 15:return gv(e,n,n.type,n.pendingProps,o);case 19:return Ev(e,n,o);case 31:return s=n.pendingProps,o=n.mode,s={mode:s.mode,children:s.children},e===null?(o=Tc(s,o),o.ref=n.ref,n.child=o,o.return=n,n=o):(o=Sr(e.child,s),o.ref=n.ref,n.child=o,o.return=n,n=o),n;case 22:return yv(e,n,o);case 24:return Ko(n),s=Qt(jt),e===null?(h=Hf(),h===null&&(h=rt,y=zf(),h.pooledCache=y,y.refCount++,y!==null&&(h.pooledCacheLanes|=o),h=y),n.memoizedState={parent:s,cache:h},Uf(n),Wr(n,jt,h)):((e.lanes&o)!==0&&($f(e,n),us(n,null,null,o),cs()),h=e.memoizedState,y=n.memoizedState,h.parent!==s?(h={parent:s,cache:s},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),Wr(n,jt,s)):(s=y.cache,Wr(n,jt,s),s!==h.cache&&Lf(n,[jt],o,!0))),Bt(e,n,n.pendingProps.children,o),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Or(e){e.flags|=4}function jv(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!I1(n)){if(n=Mn.current,n!==null&&((Ge&4194048)===Ge?Wn!==null:(Ge&62914560)!==Ge&&(Ge&536870912)===0||n!==Wn))throw ss=Pf,cx;e.flags|=8192}}function jc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Qr():536870912,e.lanes|=n,ri|=n)}function ys(e,n){if(!Ke)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var s=null;o!==null;)o.alternate!==null&&(s=o),o=o.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function lt(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,s=0;if(n)for(var h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags&65011712,s|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags,s|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=s,e.childLanes=o,n}function AN(e,n,o){var s=n.pendingProps;switch(_f(n),n.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(n),null;case 1:return lt(n),null;case 3:return o=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Tr(jt),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(es(n)?Or(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ox())),lt(n),null;case 26:return o=n.memoizedState,e===null?(Or(n),o!==null?(lt(n),jv(n,o)):(lt(n),n.flags&=-16777217)):o?o!==e.memoizedState?(Or(n),lt(n),jv(n,o)):(lt(n),n.flags&=-16777217):(e.memoizedProps!==s&&Or(n),lt(n),n.flags&=-16777217),null;case 27:Me(n),o=ae.current;var h=n.type;if(e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Or(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return lt(n),null}e=le.current,es(n)?nx(n):(e=j1(h,s,o),n.stateNode=e,Or(n))}return lt(n),null;case 5:if(Me(n),o=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Or(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return lt(n),null}if(e=le.current,es(n))nx(n);else{switch(h=Hc(ae.current),e){case 1:e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}e[Kt]=n,e[nn]=s;e:for(h=n.child;h!==null;){if(h.tag===5||h.tag===6)e.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}n.stateNode=e;e:switch(Pt(e,o,s),o){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Or(n)}}return lt(n),n.flags&=-16777217,null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Or(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=ae.current,es(n)){if(e=n.stateNode,o=n.memoizedProps,s=null,h=Jt,h!==null)switch(h.tag){case 27:case 5:s=h.memoizedProps}e[Kt]=n,e=!!(e.nodeValue===o||s!==null&&s.suppressHydrationWarning===!0||x1(e.nodeValue,o)),e||Yo(n)}else e=Hc(e).createTextNode(s),e[Kt]=n,n.stateNode=e}return lt(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=es(n),s!==null&&s.dehydrated!==null){if(e===null){if(!h)throw Error(a(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Kt]=n}else ts(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;lt(n),h=!1}else h=ox(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(Ar(n),n):(Ar(n),null)}if(Ar(n),(n.flags&128)!==0)return n.lanes=o,n;if(o=s!==null,e=e!==null&&e.memoizedState!==null,o){s=n.child,h=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(h=s.alternate.memoizedState.cachePool.pool);var y=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==h&&(s.flags|=2048)}return o!==e&&o&&(n.child.flags|=8192),jc(n,n.updateQueue),lt(n),null;case 4:return ge(),e===null&&Vh(n.stateNode.containerInfo),lt(n),null;case 10:return Tr(n.type),lt(n),null;case 19:if(ne(At),h=n.memoizedState,h===null)return lt(n),null;if(s=(n.flags&128)!==0,y=h.rendering,y===null)if(s)ys(h,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(y=Sc(e),y!==null){for(n.flags|=128,ys(h,!1),e=y.updateQueue,n.updateQueue=e,jc(n,e),n.subtreeFlags=0,e=o,o=n.child;o!==null;)ex(o,e),o=o.sibling;return te(At,At.current&1|2),n.child}e=e.sibling}h.tail!==null&&dt()>Oc&&(n.flags|=128,s=!0,ys(h,!1),n.lanes=4194304)}else{if(!s)if(e=Sc(y),e!==null){if(n.flags|=128,s=!0,e=e.updateQueue,n.updateQueue=e,jc(n,e),ys(h,!0),h.tail===null&&h.tailMode==="hidden"&&!y.alternate&&!Ke)return lt(n),null}else 2*dt()-h.renderingStartTime>Oc&&o!==536870912&&(n.flags|=128,s=!0,ys(h,!1),n.lanes=4194304);h.isBackwards?(y.sibling=n.child,n.child=y):(e=h.last,e!==null?e.sibling=y:n.child=y,h.last=y)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=dt(),n.sibling=null,e=At.current,te(At,s?e&1|2:e&1),n):(lt(n),null);case 22:case 23:return Ar(n),Yf(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(o&536870912)!==0&&(n.flags&128)===0&&(lt(n),n.subtreeFlags&6&&(n.flags|=8192)):lt(n),o=n.updateQueue,o!==null&&jc(n,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==o&&(n.flags|=2048),e!==null&&ne(Qo),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Tr(jt),lt(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function RN(e,n){switch(_f(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Tr(jt),ge(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Me(n),null;case 13:if(Ar(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));ts()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ne(At),null;case 4:return ge(),null;case 10:return Tr(n.type),null;case 22:case 23:return Ar(n),Yf(),e!==null&&ne(Qo),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Tr(jt),null;case 25:return null;default:return null}}function Av(e,n){switch(_f(n),n.tag){case 3:Tr(jt),ge();break;case 26:case 27:case 5:Me(n);break;case 4:ge();break;case 13:Ar(n);break;case 19:ne(At);break;case 10:Tr(n.type);break;case 22:case 23:Ar(n),Yf(),e!==null&&ne(Qo);break;case 24:Tr(jt)}}function bs(e,n){try{var o=n.updateQueue,s=o!==null?o.lastEffect:null;if(s!==null){var h=s.next;o=h;do{if((o.tag&e)===e){s=void 0;var y=o.create,A=o.inst;s=y(),A.destroy=s}o=o.next}while(o!==h)}}catch(k){tt(n,n.return,k)}}function ao(e,n,o){try{var s=n.updateQueue,h=s!==null?s.lastEffect:null;if(h!==null){var y=h.next;s=y;do{if((s.tag&e)===e){var A=s.inst,k=A.destroy;if(k!==void 0){A.destroy=void 0,h=n;var V=o,W=k;try{W()}catch(re){tt(h,V,re)}}}s=s.next}while(s!==y)}}catch(re){tt(n,n.return,re)}}function Rv(e){var n=e.updateQueue;if(n!==null){var o=e.stateNode;try{px(n,o)}catch(s){tt(e,e.return,s)}}}function Ov(e,n,o){o.props=Zo(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(s){tt(e,n,s)}}function xs(e,n){try{var o=e.ref;if(o!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof o=="function"?e.refCleanup=o(s):o.current=s}}catch(h){tt(e,n,h)}}function Jn(e,n){var o=e.ref,s=e.refCleanup;if(o!==null)if(typeof s=="function")try{s()}catch(h){tt(e,n,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){tt(e,n,h)}else o.current=null}function Nv(e){var n=e.type,o=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&s.focus();break e;case"img":o.src?s.src=o.src:o.srcSet&&(s.srcset=o.srcSet)}}catch(h){tt(e,e.return,h)}}function vh(e,n,o){try{var s=e.stateNode;QN(s,e.type,o,n),s[nn]=n}catch(h){tt(e,e.return,h)}}function Mv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mo(e.type)||e.tag===4}function Sh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&mo(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ch(e,n,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(e,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(e),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Bc));else if(s!==4&&(s===27&&mo(e.type)&&(o=e.stateNode,n=null),e=e.child,e!==null))for(Ch(e,n,o),e=e.sibling;e!==null;)Ch(e,n,o),e=e.sibling}function Ac(e,n,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(s!==4&&(s===27&&mo(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(Ac(e,n,o),e=e.sibling;e!==null;)Ac(e,n,o),e=e.sibling}function _v(e){var n=e.stateNode,o=e.memoizedProps;try{for(var s=e.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);Pt(n,s,o),n[Kt]=e,n[nn]=o}catch(y){tt(e,e.return,y)}}var Nr=!1,bt=!1,wh=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function ON(e,n){if(e=e.containerInfo,Xh=qc,e=Vb(e),Sf(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var s=o.getSelection&&o.getSelection();if(s&&s.rangeCount!==0){o=s.anchorNode;var h=s.anchorOffset,y=s.focusNode;s=s.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var A=0,k=-1,V=-1,W=0,re=0,se=e,J=null;t:for(;;){for(var ee;se!==o||h!==0&&se.nodeType!==3||(k=A+h),se!==y||s!==0&&se.nodeType!==3||(V=A+s),se.nodeType===3&&(A+=se.nodeValue.length),(ee=se.firstChild)!==null;)J=se,se=ee;for(;;){if(se===e)break t;if(J===o&&++W===h&&(k=A),J===y&&++re===s&&(V=A),(ee=se.nextSibling)!==null)break;se=J,J=se.parentNode}se=ee}o=k===-1||V===-1?null:{start:k,end:V}}else o=null}o=o||{start:0,end:0}}else o=null;for(Kh={focusedElem:e,selectionRange:o},qc=!1,Dt=n;Dt!==null;)if(n=Dt,e=n.child,(n.subtreeFlags&1024)!==0&&e!==null)e.return=n,Dt=e;else for(;Dt!==null;){switch(n=Dt,y=n.alternate,e=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&y!==null){e=void 0,o=n,h=y.memoizedProps,y=y.memoizedState,s=o.stateNode;try{var Re=Zo(o.type,h,o.elementType===o.type);e=s.getSnapshotBeforeUpdate(Re,y),s.__reactInternalSnapshotBeforeUpdate=e}catch(Te){tt(o,o.return,Te)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,o=e.nodeType,o===9)Zh(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Zh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=n.sibling,e!==null){e.return=n.return,Dt=e;break}Dt=n.return}}function Iv(e,n,o){var s=o.flags;switch(o.tag){case 0:case 11:case 15:io(e,o),s&4&&bs(5,o);break;case 1:if(io(e,o),s&4)if(e=o.stateNode,n===null)try{e.componentDidMount()}catch(A){tt(o,o.return,A)}else{var h=Zo(o.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(h,n,e.__reactInternalSnapshotBeforeUpdate)}catch(A){tt(o,o.return,A)}}s&64&&Rv(o),s&512&&xs(o,o.return);break;case 3:if(io(e,o),s&64&&(e=o.updateQueue,e!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{px(e,n)}catch(A){tt(o,o.return,A)}}break;case 27:n===null&&s&4&&_v(o);case 26:case 5:io(e,o),n===null&&s&4&&Nv(o),s&512&&xs(o,o.return);break;case 12:io(e,o);break;case 13:io(e,o),s&4&&zv(e,o),s&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(o=BN.bind(null,o),nM(e,o))));break;case 22:if(s=o.memoizedState!==null||Nr,!s){n=n!==null&&n.memoizedState!==null||bt,h=Nr;var y=bt;Nr=s,(bt=n)&&!y?so(e,o,(o.subtreeFlags&8772)!==0):io(e,o),Nr=h,bt=y}break;case 30:break;default:io(e,o)}}function kv(e){var n=e.alternate;n!==null&&(e.alternate=null,kv(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&tf(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var it=null,an=!1;function Mr(e,n,o){for(o=o.child;o!==null;)Lv(e,n,o),o=o.sibling}function Lv(e,n,o){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(br,o)}catch{}switch(o.tag){case 26:bt||Jn(o,n),Mr(e,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:bt||Jn(o,n);var s=it,h=an;mo(o.type)&&(it=o.stateNode,an=!1),Mr(e,n,o),Rs(o.stateNode),it=s,an=h;break;case 5:bt||Jn(o,n);case 6:if(s=it,h=an,it=null,Mr(e,n,o),it=s,an=h,it!==null)if(an)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(o.stateNode)}catch(y){tt(o,n,y)}else try{it.removeChild(o.stateNode)}catch(y){tt(o,n,y)}break;case 18:it!==null&&(an?(e=it,E1(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,o.stateNode),Ls(e)):E1(it,o.stateNode));break;case 4:s=it,h=an,it=o.stateNode.containerInfo,an=!0,Mr(e,n,o),it=s,an=h;break;case 0:case 11:case 14:case 15:bt||ao(2,o,n),bt||ao(4,o,n),Mr(e,n,o);break;case 1:bt||(Jn(o,n),s=o.stateNode,typeof s.componentWillUnmount=="function"&&Ov(o,n,s)),Mr(e,n,o);break;case 21:Mr(e,n,o);break;case 22:bt=(s=bt)||o.memoizedState!==null,Mr(e,n,o),bt=s;break;default:Mr(e,n,o)}}function zv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ls(e)}catch(o){tt(n,n.return,o)}}function NN(e){switch(e.tag){case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Dv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Dv),n;default:throw Error(a(435,e.tag))}}function Eh(e,n){var o=NN(e);n.forEach(function(s){var h=HN.bind(null,e,s);o.has(s)||(o.add(s),s.then(h,h))})}function hn(e,n){var o=n.deletions;if(o!==null)for(var s=0;s<o.length;s++){var h=o[s],y=e,A=n,k=A;e:for(;k!==null;){switch(k.tag){case 27:if(mo(k.type)){it=k.stateNode,an=!1;break e}break;case 5:it=k.stateNode,an=!1;break e;case 3:case 4:it=k.stateNode.containerInfo,an=!0;break e}k=k.return}if(it===null)throw Error(a(160));Lv(y,A,h),it=null,an=!1,y=h.alternate,y!==null&&(y.return=null),h.return=null}if(n.subtreeFlags&13878)for(n=n.child;n!==null;)Bv(n,e),n=n.sibling}var Pn=null;function Bv(e,n){var o=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hn(n,e),mn(e),s&4&&(ao(3,e,e.return),bs(3,e),ao(5,e,e.return));break;case 1:hn(n,e),mn(e),s&512&&(bt||o===null||Jn(o,o.return)),s&64&&Nr&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?s:o.concat(s))));break;case 26:var h=Pn;if(hn(n,e),mn(e),s&512&&(bt||o===null||Jn(o,o.return)),s&4){var y=o!==null?o.memoizedState:null;if(s=e.memoizedState,o===null)if(s===null)if(e.stateNode===null){e:{s=e.type,o=e.memoizedProps,h=h.ownerDocument||h;t:switch(s){case"title":y=h.getElementsByTagName("title")[0],(!y||y[Gi]||y[Kt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=h.createElement(s),h.head.insertBefore(y,h.querySelector("head > title"))),Pt(y,s,o),y[Kt]=e,Mt(y),s=y;break e;case"link":var A=_1("link","href",h).get(s+(o.href||""));if(A){for(var k=0;k<A.length;k++)if(y=A[k],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){A.splice(k,1);break t}}y=h.createElement(s),Pt(y,s,o),h.head.appendChild(y);break;case"meta":if(A=_1("meta","content",h).get(s+(o.content||""))){for(k=0;k<A.length;k++)if(y=A[k],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){A.splice(k,1);break t}}y=h.createElement(s),Pt(y,s,o),h.head.appendChild(y);break;default:throw Error(a(468,s))}y[Kt]=e,Mt(y),s=y}e.stateNode=s}else D1(h,e.type,e.stateNode);else e.stateNode=M1(h,s,e.memoizedProps);else y!==s?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,s===null?D1(h,e.type,e.stateNode):M1(h,s,e.memoizedProps)):s===null&&e.stateNode!==null&&vh(e,e.memoizedProps,o.memoizedProps)}break;case 27:hn(n,e),mn(e),s&512&&(bt||o===null||Jn(o,o.return)),o!==null&&s&4&&vh(e,e.memoizedProps,o.memoizedProps);break;case 5:if(hn(n,e),mn(e),s&512&&(bt||o===null||Jn(o,o.return)),e.flags&32){h=e.stateNode;try{ka(h,"")}catch(ee){tt(e,e.return,ee)}}s&4&&e.stateNode!=null&&(h=e.memoizedProps,vh(e,h,o!==null?o.memoizedProps:h)),s&1024&&(wh=!0);break;case 6:if(hn(n,e),mn(e),s&4){if(e.stateNode===null)throw Error(a(162));s=e.memoizedProps,o=e.stateNode;try{o.nodeValue=s}catch(ee){tt(e,e.return,ee)}}break;case 3:if($c=null,h=Pn,Pn=Pc(n.containerInfo),hn(n,e),Pn=h,mn(e),s&4&&o!==null&&o.memoizedState.isDehydrated)try{Ls(n.containerInfo)}catch(ee){tt(e,e.return,ee)}wh&&(wh=!1,Hv(e));break;case 4:s=Pn,Pn=Pc(e.stateNode.containerInfo),hn(n,e),mn(e),Pn=s;break;case 12:hn(n,e),mn(e);break;case 13:hn(n,e),mn(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Nh=dt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Eh(e,s)));break;case 22:h=e.memoizedState!==null;var V=o!==null&&o.memoizedState!==null,W=Nr,re=bt;if(Nr=W||h,bt=re||V,hn(n,e),bt=re,Nr=W,mn(e),s&8192)e:for(n=e.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(o===null||V||Nr||bt||Wo(e)),o=null,n=e;;){if(n.tag===5||n.tag===26){if(o===null){V=o=n;try{if(y=V.stateNode,h)A=y.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{k=V.stateNode;var se=V.memoizedProps.style,J=se!=null&&se.hasOwnProperty("display")?se.display:null;k.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(ee){tt(V,V.return,ee)}}}else if(n.tag===6){if(o===null){V=n;try{V.stateNode.nodeValue=h?"":V.memoizedProps}catch(ee){tt(V,V.return,ee)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;o===n&&(o=null),n=n.return}o===n&&(o=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(o=s.retryQueue,o!==null&&(s.retryQueue=null,Eh(e,o))));break;case 19:hn(n,e),mn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Eh(e,s)));break;case 30:break;case 21:break;default:hn(n,e),mn(e)}}function mn(e){var n=e.flags;if(n&2){try{for(var o,s=e.return;s!==null;){if(Mv(s)){o=s;break}s=s.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,y=Sh(e);Ac(e,y,h);break;case 5:var A=o.stateNode;o.flags&32&&(ka(A,""),o.flags&=-33);var k=Sh(e);Ac(e,k,A);break;case 3:case 4:var V=o.stateNode.containerInfo,W=Sh(e);Ch(e,W,V);break;default:throw Error(a(161))}}catch(re){tt(e,e.return,re)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Hv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Hv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function io(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Iv(e,n.alternate,n),n=n.sibling}function Wo(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ao(4,n,n.return),Wo(n);break;case 1:Jn(n,n.return);var o=n.stateNode;typeof o.componentWillUnmount=="function"&&Ov(n,n.return,o),Wo(n);break;case 27:Rs(n.stateNode);case 26:case 5:Jn(n,n.return),Wo(n);break;case 22:n.memoizedState===null&&Wo(n);break;case 30:Wo(n);break;default:Wo(n)}e=e.sibling}}function so(e,n,o){for(o=o&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,h=e,y=n,A=y.flags;switch(y.tag){case 0:case 11:case 15:so(h,y,o),bs(4,y);break;case 1:if(so(h,y,o),s=y,h=s.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(W){tt(s,s.return,W)}if(s=y,h=s.updateQueue,h!==null){var k=s.stateNode;try{var V=h.shared.hiddenCallbacks;if(V!==null)for(h.shared.hiddenCallbacks=null,h=0;h<V.length;h++)mx(V[h],k)}catch(W){tt(s,s.return,W)}}o&&A&64&&Rv(y),xs(y,y.return);break;case 27:_v(y);case 26:case 5:so(h,y,o),o&&s===null&&A&4&&Nv(y),xs(y,y.return);break;case 12:so(h,y,o);break;case 13:so(h,y,o),o&&A&4&&zv(h,y);break;case 22:y.memoizedState===null&&so(h,y,o),xs(y,y.return);break;case 30:break;default:so(h,y,o)}n=n.sibling}}function Th(e,n){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&os(o))}function jh(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&os(e))}function er(e,n,o,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Pv(e,n,o,s),n=n.sibling}function Pv(e,n,o,s){var h=n.flags;switch(n.tag){case 0:case 11:case 15:er(e,n,o,s),h&2048&&bs(9,n);break;case 1:er(e,n,o,s);break;case 3:er(e,n,o,s),h&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&os(e)));break;case 12:if(h&2048){er(e,n,o,s),e=n.stateNode;try{var y=n.memoizedProps,A=y.id,k=y.onPostCommit;typeof k=="function"&&k(A,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(V){tt(n,n.return,V)}}else er(e,n,o,s);break;case 13:er(e,n,o,s);break;case 23:break;case 22:y=n.stateNode,A=n.alternate,n.memoizedState!==null?y._visibility&2?er(e,n,o,s):vs(e,n):y._visibility&2?er(e,n,o,s):(y._visibility|=2,ei(e,n,o,s,(n.subtreeFlags&10256)!==0)),h&2048&&Th(A,n);break;case 24:er(e,n,o,s),h&2048&&jh(n.alternate,n);break;default:er(e,n,o,s)}}function ei(e,n,o,s,h){for(h=h&&(n.subtreeFlags&10256)!==0,n=n.child;n!==null;){var y=e,A=n,k=o,V=s,W=A.flags;switch(A.tag){case 0:case 11:case 15:ei(y,A,k,V,h),bs(8,A);break;case 23:break;case 22:var re=A.stateNode;A.memoizedState!==null?re._visibility&2?ei(y,A,k,V,h):vs(y,A):(re._visibility|=2,ei(y,A,k,V,h)),h&&W&2048&&Th(A.alternate,A);break;case 24:ei(y,A,k,V,h),h&&W&2048&&jh(A.alternate,A);break;default:ei(y,A,k,V,h)}n=n.sibling}}function vs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=e,s=n,h=s.flags;switch(s.tag){case 22:vs(o,s),h&2048&&Th(s.alternate,s);break;case 24:vs(o,s),h&2048&&jh(s.alternate,s);break;default:vs(o,s)}n=n.sibling}}var Ss=8192;function ti(e){if(e.subtreeFlags&Ss)for(e=e.child;e!==null;)Uv(e),e=e.sibling}function Uv(e){switch(e.tag){case 26:ti(e),e.flags&Ss&&e.memoizedState!==null&&pM(Pn,e.memoizedState,e.memoizedProps);break;case 5:ti(e);break;case 3:case 4:var n=Pn;Pn=Pc(e.stateNode.containerInfo),ti(e),Pn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Ss,Ss=16777216,ti(e),Ss=n):ti(e));break;default:ti(e)}}function $v(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Cs(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var s=n[o];Dt=s,Vv(s,e)}$v(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gv(e),e=e.sibling}function Gv(e){switch(e.tag){case 0:case 11:case 15:Cs(e),e.flags&2048&&ao(9,e,e.return);break;case 3:Cs(e);break;case 12:Cs(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Rc(e)):Cs(e);break;default:Cs(e)}}function Rc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var s=n[o];Dt=s,Vv(s,e)}$v(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ao(8,n,n.return),Rc(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,Rc(n));break;default:Rc(n)}e=e.sibling}}function Vv(e,n){for(;Dt!==null;){var o=Dt;switch(o.tag){case 0:case 11:case 15:ao(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var s=o.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:os(o.memoizedState.cache)}if(s=o.child,s!==null)s.return=o,Dt=s;else e:for(o=e;Dt!==null;){s=Dt;var h=s.sibling,y=s.return;if(kv(s),s===o){Dt=null;break e}if(h!==null){h.return=y,Dt=h;break e}Dt=y}}}var MN={getCacheForType:function(e){var n=Qt(jt),o=n.data.get(e);return o===void 0&&(o=e(),n.data.set(e,o)),o}},_N=typeof WeakMap=="function"?WeakMap:Map,Qe=0,rt=null,He=null,Ge=0,Fe=0,pn=null,lo=!1,ni=!1,Ah=!1,_r=0,ht=0,co=0,Jo=0,Rh=0,_n=0,ri=0,ws=null,sn=null,Oh=!1,Nh=0,Oc=1/0,Nc=null,uo=null,Ht=0,fo=null,oi=null,ai=0,Mh=0,_h=null,qv=null,Es=0,Dh=null;function gn(){if((Qe&2)!==0&&Ge!==0)return Ge&-Ge;if(P.T!==null){var e=Ya;return e!==0?e:Ph()}return sb()}function Yv(){_n===0&&(_n=(Ge&536870912)===0||Ke?$i():536870912);var e=Mn.current;return e!==null&&(e.flags|=32),_n}function yn(e,n,o){(e===rt&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)&&(ii(e,0),ho(e,Ge,_n,!1)),zo(e,o),((Qe&2)===0||e!==rt)&&(e===rt&&((Qe&2)===0&&(Jo|=o),ht===4&&ho(e,Ge,_n,!1)),tr(e))}function Xv(e,n,o){if((Qe&6)!==0)throw Error(a(327));var s=!o&&(n&124)===0&&(n&e.expiredLanes)===0||Xt(e,n),h=s?kN(e,n):Lh(e,n,!0),y=s;do{if(h===0){ni&&!s&&ho(e,n,0,!1);break}else{if(o=e.current.alternate,y&&!DN(o)){h=Lh(e,n,!1),y=!1;continue}if(h===2){if(y=n,e.errorRecoveryDisabledLanes&y)var A=0;else A=e.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){n=A;e:{var k=e;h=ws;var V=k.current.memoizedState.isDehydrated;if(V&&(ii(k,A).flags|=256),A=Lh(k,A,!1),A!==2){if(Ah&&!V){k.errorRecoveryDisabledLanes|=y,Jo|=y,h=4;break e}y=sn,sn=h,y!==null&&(sn===null?sn=y:sn.push.apply(sn,y))}h=A}if(y=!1,h!==2)continue}}if(h===1){ii(e,0),ho(e,n,0,!0);break}e:{switch(s=e,y=h,y){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:ho(s,n,_n,!lo);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(h=Nh+300-dt(),10<h)){if(ho(s,n,_n,!lo),Nt(s,0,!0)!==0)break e;s.timeoutHandle=C1(Kv.bind(null,s,o,sn,Nc,Oh,n,_n,Jo,ri,lo,y,2,-0,0),h);break e}Kv(s,o,sn,Nc,Oh,n,_n,Jo,ri,lo,y,0,-0,0)}}break}while(!0);tr(e)}function Kv(e,n,o,s,h,y,A,k,V,W,re,se,J,ee){if(e.timeoutHandle=-1,se=n.subtreeFlags,(se&8192||(se&16785408)===16785408)&&(Ms={stylesheets:null,count:0,unsuspend:mM},Uv(n),se=gM(),se!==null)){e.cancelPendingCommit=se(t1.bind(null,e,n,y,o,s,h,A,k,V,re,1,J,ee)),ho(e,y,A,!W);return}t1(e,n,y,o,s,h,A,k,V)}function DN(e){for(var n=e;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var s=0;s<o.length;s++){var h=o[s],y=h.getSnapshot;h=h.value;try{if(!dn(y(),h))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ho(e,n,o,s){n&=~Rh,n&=~Jo,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var h=n;0<h;){var y=31-Yt(h),A=1<<y;s[y]=-1,h&=~A}o!==0&&ab(e,o,n)}function Mc(){return(Qe&6)===0?(Ts(0),!1):!0}function Ih(){if(He!==null){if(Fe===0)var e=He.return;else e=He,Er=Xo=null,Zf(e),Wa=null,ps=0,e=He;for(;e!==null;)Av(e.alternate,e),e=e.return;He=null}}function ii(e,n){var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,ZN(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),Ih(),rt=e,He=o=Sr(e.current,null),Ge=n,Fe=0,pn=null,lo=!1,ni=Xt(e,n),Ah=!1,ri=_n=Rh=Jo=co=ht=0,sn=ws=null,Oh=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var h=31-Yt(s),y=1<<h;n|=e[h],s&=~y}return _r=n,Jl(),o}function Qv(e,n){Ie=null,P.H=bc,n===is||n===lc?(n=fx(),Fe=3):n===cx?(n=fx(),Fe=4):Fe=n===hv?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,pn=n,He===null&&(ht=1,wc(e,An(n,e.current)))}function Fv(){var e=P.H;return P.H=bc,e===null?bc:e}function Zv(){var e=P.A;return P.A=MN,e}function kh(){ht=4,lo||(Ge&4194048)!==Ge&&Mn.current!==null||(ni=!0),(co&134217727)===0&&(Jo&134217727)===0||rt===null||ho(rt,Ge,_n,!1)}function Lh(e,n,o){var s=Qe;Qe|=2;var h=Fv(),y=Zv();(rt!==e||Ge!==n)&&(Nc=null,ii(e,n)),n=!1;var A=ht;e:do try{if(Fe!==0&&He!==null){var k=He,V=pn;switch(Fe){case 8:Ih(),A=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(n=!0);var W=Fe;if(Fe=0,pn=null,si(e,k,V,W),o&&ni){A=0;break e}break;default:W=Fe,Fe=0,pn=null,si(e,k,V,W)}}IN(),A=ht;break}catch(re){Qv(e,re)}while(!0);return n&&e.shellSuspendCounter++,Er=Xo=null,Qe=s,P.H=h,P.A=y,He===null&&(rt=null,Ge=0,Jl()),A}function IN(){for(;He!==null;)Wv(He)}function kN(e,n){var o=Qe;Qe|=2;var s=Fv(),h=Zv();rt!==e||Ge!==n?(Nc=null,Oc=dt()+500,ii(e,n)):ni=Xt(e,n);e:do try{if(Fe!==0&&He!==null){n=He;var y=pn;t:switch(Fe){case 1:Fe=0,pn=null,si(e,n,y,1);break;case 2:case 9:if(ux(y)){Fe=0,pn=null,Jv(n);break}n=function(){Fe!==2&&Fe!==9||rt!==e||(Fe=7),tr(e)},y.then(n,n);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:ux(y)?(Fe=0,pn=null,Jv(n)):(Fe=0,pn=null,si(e,n,y,7));break;case 5:var A=null;switch(He.tag){case 26:A=He.memoizedState;case 5:case 27:var k=He;if(!A||I1(A)){Fe=0,pn=null;var V=k.sibling;if(V!==null)He=V;else{var W=k.return;W!==null?(He=W,_c(W)):He=null}break t}}Fe=0,pn=null,si(e,n,y,5);break;case 6:Fe=0,pn=null,si(e,n,y,6);break;case 8:Ih(),ht=6;break e;default:throw Error(a(462))}}LN();break}catch(re){Qv(e,re)}while(!0);return Er=Xo=null,P.H=s,P.A=h,Qe=o,He!==null?0:(rt=null,Ge=0,Jl(),ht)}function LN(){for(;He!==null&&!Ce();)Wv(He)}function Wv(e){var n=Tv(e.alternate,e,_r);e.memoizedProps=e.pendingProps,n===null?_c(e):He=n}function Jv(e){var n=e,o=n.alternate;switch(n.tag){case 15:case 0:n=xv(o,n,n.pendingProps,n.type,void 0,Ge);break;case 11:n=xv(o,n,n.pendingProps,n.type.render,n.ref,Ge);break;case 5:Zf(n);default:Av(o,n),n=He=ex(n,_r),n=Tv(o,n,_r)}e.memoizedProps=e.pendingProps,n===null?_c(e):He=n}function si(e,n,o,s){Er=Xo=null,Zf(n),Wa=null,ps=0;var h=n.return;try{if(TN(e,h,n,o,Ge)){ht=1,wc(e,An(o,e.current)),He=null;return}}catch(y){if(h!==null)throw He=h,y;ht=1,wc(e,An(o,e.current)),He=null;return}n.flags&32768?(Ke||s===1?e=!0:ni||(Ge&536870912)!==0?e=!1:(lo=e=!0,(s===2||s===9||s===3||s===6)&&(s=Mn.current,s!==null&&s.tag===13&&(s.flags|=16384))),e1(n,e)):_c(n)}function _c(e){var n=e;do{if((n.flags&32768)!==0){e1(n,lo);return}e=n.return;var o=AN(n.alternate,n,_r);if(o!==null){He=o;return}if(n=n.sibling,n!==null){He=n;return}He=n=e}while(n!==null);ht===0&&(ht=5)}function e1(e,n){do{var o=RN(e.alternate,e);if(o!==null){o.flags&=32767,He=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(e=e.sibling,e!==null)){He=e;return}He=e=o}while(e!==null);ht=6,He=null}function t1(e,n,o,s,h,y,A,k,V){e.cancelPendingCommit=null;do Dc();while(Ht!==0);if((Qe&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(y=n.lanes|n.childLanes,y|=jf,mO(e,o,y,A,k,V),e===rt&&(He=rt=null,Ge=0),oi=n,fo=e,ai=o,Mh=y,_h=h,qv=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,PN(Wt,function(){return i1(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null,h=G.p,G.p=2,A=Qe,Qe|=4;try{ON(e,n,o)}finally{Qe=A,G.p=h,P.T=s}}Ht=1,n1(),r1(),o1()}}function n1(){if(Ht===1){Ht=0;var e=fo,n=oi,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=P.T,P.T=null;var s=G.p;G.p=2;var h=Qe;Qe|=4;try{Bv(n,e);var y=Kh,A=Vb(e.containerInfo),k=y.focusedElem,V=y.selectionRange;if(A!==k&&k&&k.ownerDocument&&Gb(k.ownerDocument.documentElement,k)){if(V!==null&&Sf(k)){var W=V.start,re=V.end;if(re===void 0&&(re=W),"selectionStart"in k)k.selectionStart=W,k.selectionEnd=Math.min(re,k.value.length);else{var se=k.ownerDocument||document,J=se&&se.defaultView||window;if(J.getSelection){var ee=J.getSelection(),Re=k.textContent.length,Te=Math.min(V.start,Re),et=V.end===void 0?Te:Math.min(V.end,Re);!ee.extend&&Te>et&&(A=et,et=Te,Te=A);var F=$b(k,Te),X=$b(k,et);if(F&&X&&(ee.rangeCount!==1||ee.anchorNode!==F.node||ee.anchorOffset!==F.offset||ee.focusNode!==X.node||ee.focusOffset!==X.offset)){var Z=se.createRange();Z.setStart(F.node,F.offset),ee.removeAllRanges(),Te>et?(ee.addRange(Z),ee.extend(X.node,X.offset)):(Z.setEnd(X.node,X.offset),ee.addRange(Z))}}}}for(se=[],ee=k;ee=ee.parentNode;)ee.nodeType===1&&se.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<se.length;k++){var ie=se[k];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}qc=!!Xh,Kh=Xh=null}finally{Qe=h,G.p=s,P.T=o}}e.current=n,Ht=2}}function r1(){if(Ht===2){Ht=0;var e=fo,n=oi,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=P.T,P.T=null;var s=G.p;G.p=2;var h=Qe;Qe|=4;try{Iv(e,n.alternate,n)}finally{Qe=h,G.p=s,P.T=o}}Ht=3}}function o1(){if(Ht===4||Ht===3){Ht=0,Ot();var e=fo,n=oi,o=ai,s=qv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ht=5:(Ht=0,oi=fo=null,a1(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(uo=null),Jd(o),n=n.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(br,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=P.T,h=G.p,G.p=2,P.T=null;try{for(var y=e.onRecoverableError,A=0;A<s.length;A++){var k=s[A];y(k.value,{componentStack:k.stack})}}finally{P.T=n,G.p=h}}(ai&3)!==0&&Dc(),tr(e),h=e.pendingLanes,(o&4194090)!==0&&(h&42)!==0?e===Dh?Es++:(Es=0,Dh=e):Es=0,Ts(0)}}function a1(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,os(n)))}function Dc(e){return n1(),r1(),o1(),i1()}function i1(){if(Ht!==5)return!1;var e=fo,n=Mh;Mh=0;var o=Jd(ai),s=P.T,h=G.p;try{G.p=32>o?32:o,P.T=null,o=_h,_h=null;var y=fo,A=ai;if(Ht=0,oi=fo=null,ai=0,(Qe&6)!==0)throw Error(a(331));var k=Qe;if(Qe|=4,Gv(y.current),Pv(y,y.current,A,o),Qe=k,Ts(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(br,y)}catch{}return!0}finally{G.p=h,P.T=s,a1(e,n)}}function s1(e,n,o){n=An(o,n),n=dh(e.stateNode,n,2),e=to(e,n,2),e!==null&&(zo(e,2),tr(e))}function tt(e,n,o){if(e.tag===3)s1(e,e,o);else for(;n!==null;){if(n.tag===3){s1(n,e,o);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(uo===null||!uo.has(s))){e=An(o,e),o=dv(2),s=to(n,o,2),s!==null&&(fv(o,s,n,e),zo(s,2),tr(s));break}}n=n.return}}function zh(e,n,o){var s=e.pingCache;if(s===null){s=e.pingCache=new _N;var h=new Set;s.set(n,h)}else h=s.get(n),h===void 0&&(h=new Set,s.set(n,h));h.has(o)||(Ah=!0,h.add(o),e=zN.bind(null,e,n,o),n.then(e,e))}function zN(e,n,o){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,rt===e&&(Ge&o)===o&&(ht===4||ht===3&&(Ge&62914560)===Ge&&300>dt()-Nh?(Qe&2)===0&&ii(e,0):Rh|=o,ri===Ge&&(ri=0)),tr(e)}function l1(e,n){n===0&&(n=Qr()),e=$a(e,n),e!==null&&(zo(e,n),tr(e))}function BN(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),l1(e,o)}function HN(e,n){var o=0;switch(e.tag){case 13:var s=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),l1(e,o)}function PN(e,n){return Ae(e,n)}var Ic=null,li=null,Bh=!1,kc=!1,Hh=!1,ea=0;function tr(e){e!==li&&e.next===null&&(li===null?Ic=li=e:li=li.next=e),kc=!0,Bh||(Bh=!0,$N())}function Ts(e,n){if(!Hh&&kc){Hh=!0;do for(var o=!1,s=Ic;s!==null;){if(e!==0){var h=s.pendingLanes;if(h===0)var y=0;else{var A=s.suspendedLanes,k=s.pingedLanes;y=(1<<31-Yt(42|e)+1)-1,y&=h&~(A&~k),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,f1(s,y))}else y=Ge,y=Nt(s,s===rt?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(y&3)===0||Xt(s,y)||(o=!0,f1(s,y));s=s.next}while(o);Hh=!1}}function UN(){c1()}function c1(){kc=Bh=!1;var e=0;ea!==0&&(FN()&&(e=ea),ea=0);for(var n=dt(),o=null,s=Ic;s!==null;){var h=s.next,y=u1(s,n);y===0?(s.next=null,o===null?Ic=h:o.next=h,h===null&&(li=o)):(o=s,(e!==0||(y&3)!==0)&&(kc=!0)),s=h}Ts(e)}function u1(e,n){for(var o=e.suspendedLanes,s=e.pingedLanes,h=e.expirationTimes,y=e.pendingLanes&-62914561;0<y;){var A=31-Yt(y),k=1<<A,V=h[A];V===-1?((k&o)===0||(k&s)!==0)&&(h[A]=Ul(k,n)):V<=n&&(e.expiredLanes|=k),y&=~k}if(n=rt,o=Ge,o=Nt(e,e===n?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,o===0||e===n&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Se(s),e.callbackNode=null,e.callbackPriority=0;if((o&3)===0||Xt(e,o)){if(n=o&-o,n===e.callbackPriority)return n;switch(s!==null&&Se(s),Jd(o)){case 2:case 8:o=ot;break;case 32:o=Wt;break;case 268435456:o=ja;break;default:o=Wt}return s=d1.bind(null,e),o=Ae(o,s),e.callbackPriority=n,e.callbackNode=o,n}return s!==null&&s!==null&&Se(s),e.callbackPriority=2,e.callbackNode=null,2}function d1(e,n){if(Ht!==0&&Ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var o=e.callbackNode;if(Dc()&&e.callbackNode!==o)return null;var s=Ge;return s=Nt(e,e===rt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Xv(e,s,n),u1(e,dt()),e.callbackNode!=null&&e.callbackNode===o?d1.bind(null,e):null)}function f1(e,n){if(Dc())return null;Xv(e,n,!0)}function $N(){WN(function(){(Qe&6)!==0?Ae(gt,UN):c1()})}function Ph(){return ea===0&&(ea=$i()),ea}function h1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yl(""+e)}function m1(e,n){var o=n.ownerDocument.createElement("input");return o.name=n.name,o.value=n.value,e.id&&o.setAttribute("form",e.id),n.parentNode.insertBefore(o,n),e=new FormData(e),o.parentNode.removeChild(o),e}function GN(e,n,o,s,h){if(n==="submit"&&o&&o.stateNode===h){var y=h1((h[nn]||null).action),A=s.submitter;A&&(n=(n=A[nn]||null)?h1(n.formAction):A.getAttribute("formAction"),n!==null&&(y=n,A=null));var k=new Fl("action","action",null,s,h);e.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ea!==0){var V=A?m1(h,A):new FormData(h);ih(o,{pending:!0,data:V,method:h.method,action:y},null,V)}}else typeof y=="function"&&(k.preventDefault(),V=A?m1(h,A):new FormData(h),ih(o,{pending:!0,data:V,method:h.method,action:y},y,V))},currentTarget:h}]})}}for(var Uh=0;Uh<Tf.length;Uh++){var $h=Tf[Uh],VN=$h.toLowerCase(),qN=$h[0].toUpperCase()+$h.slice(1);Hn(VN,"on"+qN)}Hn(Xb,"onAnimationEnd"),Hn(Kb,"onAnimationIteration"),Hn(Qb,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(lN,"onTransitionRun"),Hn(cN,"onTransitionStart"),Hn(uN,"onTransitionCancel"),Hn(Fb,"onTransitionEnd"),_a("onMouseEnter",["mouseout","mouseover"]),_a("onMouseLeave",["mouseout","mouseover"]),_a("onPointerEnter",["pointerout","pointerover"]),_a("onPointerLeave",["pointerout","pointerover"]),Bo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var js="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),YN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(js));function p1(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var s=e[o],h=s.event;s=s.listeners;e:{var y=void 0;if(n)for(var A=s.length-1;0<=A;A--){var k=s[A],V=k.instance,W=k.currentTarget;if(k=k.listener,V!==y&&h.isPropagationStopped())break e;y=k,h.currentTarget=W;try{y(h)}catch(re){Cc(re)}h.currentTarget=null,y=V}else for(A=0;A<s.length;A++){if(k=s[A],V=k.instance,W=k.currentTarget,k=k.listener,V!==y&&h.isPropagationStopped())break e;y=k,h.currentTarget=W;try{y(h)}catch(re){Cc(re)}h.currentTarget=null,y=V}}}}function Pe(e,n){var o=n[ef];o===void 0&&(o=n[ef]=new Set);var s=e+"__bubble";o.has(s)||(g1(n,e,2,!1),o.add(s))}function Gh(e,n,o){var s=0;n&&(s|=4),g1(o,e,s,n)}var Lc="_reactListening"+Math.random().toString(36).slice(2);function Vh(e){if(!e[Lc]){e[Lc]=!0,cb.forEach(function(o){o!=="selectionchange"&&(YN.has(o)||Gh(o,!1,e),Gh(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Lc]||(n[Lc]=!0,Gh("selectionchange",!1,n))}}function g1(e,n,o,s){switch(P1(n)){case 2:var h=xM;break;case 8:h=vM;break;default:h=om}o=h.bind(null,n,o,e),h=void 0,!ff||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),s?h!==void 0?e.addEventListener(n,o,{capture:!0,passive:h}):e.addEventListener(n,o,!0):h!==void 0?e.addEventListener(n,o,{passive:h}):e.addEventListener(n,o,!1)}function qh(e,n,o,s,h){var y=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var A=s.tag;if(A===3||A===4){var k=s.stateNode.containerInfo;if(k===h)break;if(A===4)for(A=s.return;A!==null;){var V=A.tag;if((V===3||V===4)&&A.stateNode.containerInfo===h)return;A=A.return}for(;k!==null;){if(A=Oa(k),A===null)return;if(V=A.tag,V===5||V===6||V===26||V===27){s=y=A;continue e}k=k.parentNode}}s=s.return}wb(function(){var W=y,re=uf(o),se=[];e:{var J=Zb.get(e);if(J!==void 0){var ee=Fl,Re=e;switch(e){case"keypress":if(Kl(o)===0)break e;case"keydown":case"keyup":ee=PO;break;case"focusin":Re="focus",ee=gf;break;case"focusout":Re="blur",ee=gf;break;case"beforeblur":case"afterblur":ee=gf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=jb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=RO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=GO;break;case Xb:case Kb:case Qb:ee=MO;break;case Fb:ee=qO;break;case"scroll":case"scrollend":ee=jO;break;case"wheel":ee=XO;break;case"copy":case"cut":case"paste":ee=DO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Rb;break;case"toggle":case"beforetoggle":ee=QO}var Te=(n&4)!==0,et=!Te&&(e==="scroll"||e==="scrollend"),F=Te?J!==null?J+"Capture":null:J;Te=[];for(var X=W,Z;X!==null;){var ie=X;if(Z=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Z===null||F===null||(ie=qi(X,F),ie!=null&&Te.push(As(X,ie,Z))),et)break;X=X.return}0<Te.length&&(J=new ee(J,Re,null,o,re),se.push({event:J,listeners:Te}))}}if((n&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",J&&o!==cf&&(Re=o.relatedTarget||o.fromElement)&&(Oa(Re)||Re[Ra]))break e;if((ee||J)&&(J=re.window===re?re:(J=re.ownerDocument)?J.defaultView||J.parentWindow:window,ee?(Re=o.relatedTarget||o.toElement,ee=W,Re=Re?Oa(Re):null,Re!==null&&(et=l(Re),Te=Re.tag,Re!==et||Te!==5&&Te!==27&&Te!==6)&&(Re=null)):(ee=null,Re=W),ee!==Re)){if(Te=jb,ie="onMouseLeave",F="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&(Te=Rb,ie="onPointerLeave",F="onPointerEnter",X="pointer"),et=ee==null?J:Vi(ee),Z=Re==null?J:Vi(Re),J=new Te(ie,X+"leave",ee,o,re),J.target=et,J.relatedTarget=Z,ie=null,Oa(re)===W&&(Te=new Te(F,X+"enter",Re,o,re),Te.target=Z,Te.relatedTarget=et,ie=Te),et=ie,ee&&Re)t:{for(Te=ee,F=Re,X=0,Z=Te;Z;Z=ci(Z))X++;for(Z=0,ie=F;ie;ie=ci(ie))Z++;for(;0<X-Z;)Te=ci(Te),X--;for(;0<Z-X;)F=ci(F),Z--;for(;X--;){if(Te===F||F!==null&&Te===F.alternate)break t;Te=ci(Te),F=ci(F)}Te=null}else Te=null;ee!==null&&y1(se,J,ee,Te,!1),Re!==null&&et!==null&&y1(se,et,Re,Te,!0)}}e:{if(J=W?Vi(W):window,ee=J.nodeName&&J.nodeName.toLowerCase(),ee==="select"||ee==="input"&&J.type==="file")var ye=Lb;else if(Ib(J))if(zb)ye=aN;else{ye=rN;var ke=nN}else ee=J.nodeName,!ee||ee.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?W&&lf(W.elementType)&&(ye=Lb):ye=oN;if(ye&&(ye=ye(e,W))){kb(se,ye,o,re);break e}ke&&ke(e,J,W),e==="focusout"&&W&&J.type==="number"&&W.memoizedProps.value!=null&&sf(J,"number",J.value)}switch(ke=W?Vi(W):window,e){case"focusin":(Ib(ke)||ke.contentEditable==="true")&&(Ha=ke,Cf=W,Ji=null);break;case"focusout":Ji=Cf=Ha=null;break;case"mousedown":wf=!0;break;case"contextmenu":case"mouseup":case"dragend":wf=!1,qb(se,o,re);break;case"selectionchange":if(sN)break;case"keydown":case"keyup":qb(se,o,re)}var ve;if(bf)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else Ba?_b(e,o)&&(je="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(je="onCompositionStart");je&&(Ob&&o.locale!=="ko"&&(Ba||je!=="onCompositionStart"?je==="onCompositionEnd"&&Ba&&(ve=Eb()):(Zr=re,hf="value"in Zr?Zr.value:Zr.textContent,Ba=!0)),ke=zc(W,je),0<ke.length&&(je=new Ab(je,e,null,o,re),se.push({event:je,listeners:ke}),ve?je.data=ve:(ve=Db(o),ve!==null&&(je.data=ve)))),(ve=ZO?WO(e,o):JO(e,o))&&(je=zc(W,"onBeforeInput"),0<je.length&&(ke=new Ab("onBeforeInput","beforeinput",null,o,re),se.push({event:ke,listeners:je}),ke.data=ve)),GN(se,e,W,o,re)}p1(se,n)})}function As(e,n,o){return{instance:e,listener:n,currentTarget:o}}function zc(e,n){for(var o=n+"Capture",s=[];e!==null;){var h=e,y=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||y===null||(h=qi(e,o),h!=null&&s.unshift(As(e,h,y)),h=qi(e,n),h!=null&&s.push(As(e,h,y))),e.tag===3)return s;e=e.return}return[]}function ci(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function y1(e,n,o,s,h){for(var y=n._reactName,A=[];o!==null&&o!==s;){var k=o,V=k.alternate,W=k.stateNode;if(k=k.tag,V!==null&&V===s)break;k!==5&&k!==26&&k!==27||W===null||(V=W,h?(W=qi(o,y),W!=null&&A.unshift(As(o,W,V))):h||(W=qi(o,y),W!=null&&A.push(As(o,W,V)))),o=o.return}A.length!==0&&e.push({event:n,listeners:A})}var XN=/\r\n?/g,KN=/\u0000|\uFFFD/g;function b1(e){return(typeof e=="string"?e:""+e).replace(XN,`
51
- `).replace(KN,"")}function x1(e,n){return n=b1(n),b1(e)===n}function Bc(){}function Je(e,n,o,s,h,y){switch(o){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||ka(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&ka(e,""+s);break;case"className":Gl(e,"class",s);break;case"tabIndex":Gl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Gl(e,o,s);break;case"style":Sb(e,s,y);break;case"data":if(n!=="object"){Gl(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||o!=="href")){e.removeAttribute(o);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(o);break}s=Yl(""+s),e.setAttribute(o,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(o==="formAction"?(n!=="input"&&Je(e,n,"name",h.name,h,null),Je(e,n,"formEncType",h.formEncType,h,null),Je(e,n,"formMethod",h.formMethod,h,null),Je(e,n,"formTarget",h.formTarget,h,null)):(Je(e,n,"encType",h.encType,h,null),Je(e,n,"method",h.method,h,null),Je(e,n,"target",h.target,h,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(o);break}s=Yl(""+s),e.setAttribute(o,s);break;case"onClick":s!=null&&(e.onclick=Bc);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}o=Yl(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""+s):e.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":s===!0?e.setAttribute(o,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,s):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(o,s):e.removeAttribute(o);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(o):e.setAttribute(o,s);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),$l(e,"popover",s);break;case"xlinkActuate":xr(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":xr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":xr(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":xr(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":xr(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":xr(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":xr(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":xr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":xr(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":$l(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=EO.get(o)||o,$l(e,o,s))}}function Yh(e,n,o,s,h,y){switch(o){case"style":Sb(e,s,y);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"children":typeof s=="string"?ka(e,s):(typeof s=="number"||typeof s=="bigint")&&ka(e,""+s);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Bc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ub.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),n=o.slice(2,h?o.length-7:void 0),y=e[nn]||null,y=y!=null?y[o]:null,typeof y=="function"&&e.removeEventListener(n,y,h),typeof s=="function")){typeof y!="function"&&y!==null&&(o in e?e[o]=null:e.hasAttribute(o)&&e.removeAttribute(o)),e.addEventListener(n,s,h);break e}o in e?e[o]=s:s===!0?e.setAttribute(o,""):$l(e,o,s)}}}function Pt(e,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var s=!1,h=!1,y;for(y in o)if(o.hasOwnProperty(y)){var A=o[y];if(A!=null)switch(y){case"src":s=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Je(e,n,y,A,o,null)}}h&&Je(e,n,"srcSet",o.srcSet,o,null),s&&Je(e,n,"src",o.src,o,null);return;case"input":Pe("invalid",e);var k=y=A=h=null,V=null,W=null;for(s in o)if(o.hasOwnProperty(s)){var re=o[s];if(re!=null)switch(s){case"name":h=re;break;case"type":A=re;break;case"checked":V=re;break;case"defaultChecked":W=re;break;case"value":y=re;break;case"defaultValue":k=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,n));break;default:Je(e,n,s,re,o,null)}}yb(e,y,k,V,W,A,h,!1),Vl(e);return;case"select":Pe("invalid",e),s=A=y=null;for(h in o)if(o.hasOwnProperty(h)&&(k=o[h],k!=null))switch(h){case"value":y=k;break;case"defaultValue":A=k;break;case"multiple":s=k;default:Je(e,n,h,k,o,null)}n=y,o=A,e.multiple=!!s,n!=null?Ia(e,!!s,n,!1):o!=null&&Ia(e,!!s,o,!0);return;case"textarea":Pe("invalid",e),y=h=s=null;for(A in o)if(o.hasOwnProperty(A)&&(k=o[A],k!=null))switch(A){case"value":s=k;break;case"defaultValue":h=k;break;case"children":y=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:Je(e,n,A,k,o,null)}xb(e,s,h,y),Vl(e);return;case"option":for(V in o)if(o.hasOwnProperty(V)&&(s=o[V],s!=null))switch(V){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Je(e,n,V,s,o,null)}return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(s=0;s<js.length;s++)Pe(js[s],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in o)if(o.hasOwnProperty(W)&&(s=o[W],s!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Je(e,n,W,s,o,null)}return;default:if(lf(n)){for(re in o)o.hasOwnProperty(re)&&(s=o[re],s!==void 0&&Yh(e,n,re,s,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(s=o[k],s!=null&&Je(e,n,k,s,o,null))}function QN(e,n,o,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,y=null,A=null,k=null,V=null,W=null,re=null;for(ee in o){var se=o[ee];if(o.hasOwnProperty(ee)&&se!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":V=se;default:s.hasOwnProperty(ee)||Je(e,n,ee,null,s,se)}}for(var J in s){var ee=s[J];if(se=o[J],s.hasOwnProperty(J)&&(ee!=null||se!=null))switch(J){case"type":y=ee;break;case"name":h=ee;break;case"checked":W=ee;break;case"defaultChecked":re=ee;break;case"value":A=ee;break;case"defaultValue":k=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,n));break;default:ee!==se&&Je(e,n,J,ee,s,se)}}af(e,A,k,V,W,re,y,h);return;case"select":ee=A=k=J=null;for(y in o)if(V=o[y],o.hasOwnProperty(y)&&V!=null)switch(y){case"value":break;case"multiple":ee=V;default:s.hasOwnProperty(y)||Je(e,n,y,null,s,V)}for(h in s)if(y=s[h],V=o[h],s.hasOwnProperty(h)&&(y!=null||V!=null))switch(h){case"value":J=y;break;case"defaultValue":k=y;break;case"multiple":A=y;default:y!==V&&Je(e,n,h,y,s,V)}n=k,o=A,s=ee,J!=null?Ia(e,!!o,J,!1):!!s!=!!o&&(n!=null?Ia(e,!!o,n,!0):Ia(e,!!o,o?[]:"",!1));return;case"textarea":ee=J=null;for(k in o)if(h=o[k],o.hasOwnProperty(k)&&h!=null&&!s.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Je(e,n,k,null,s,h)}for(A in s)if(h=s[A],y=o[A],s.hasOwnProperty(A)&&(h!=null||y!=null))switch(A){case"value":J=h;break;case"defaultValue":ee=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==y&&Je(e,n,A,h,s,y)}bb(e,J,ee);return;case"option":for(var Re in o)if(J=o[Re],o.hasOwnProperty(Re)&&J!=null&&!s.hasOwnProperty(Re))switch(Re){case"selected":e.selected=!1;break;default:Je(e,n,Re,null,s,J)}for(V in s)if(J=s[V],ee=o[V],s.hasOwnProperty(V)&&J!==ee&&(J!=null||ee!=null))switch(V){case"selected":e.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:Je(e,n,V,J,s,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Te in o)J=o[Te],o.hasOwnProperty(Te)&&J!=null&&!s.hasOwnProperty(Te)&&Je(e,n,Te,null,s,J);for(W in s)if(J=s[W],ee=o[W],s.hasOwnProperty(W)&&J!==ee&&(J!=null||ee!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,n));break;default:Je(e,n,W,J,s,ee)}return;default:if(lf(n)){for(var et in o)J=o[et],o.hasOwnProperty(et)&&J!==void 0&&!s.hasOwnProperty(et)&&Yh(e,n,et,void 0,s,J);for(re in s)J=s[re],ee=o[re],!s.hasOwnProperty(re)||J===ee||J===void 0&&ee===void 0||Yh(e,n,re,J,s,ee);return}}for(var F in o)J=o[F],o.hasOwnProperty(F)&&J!=null&&!s.hasOwnProperty(F)&&Je(e,n,F,null,s,J);for(se in s)J=s[se],ee=o[se],!s.hasOwnProperty(se)||J===ee||J==null&&ee==null||Je(e,n,se,J,s,ee)}var Xh=null,Kh=null;function Hc(e){return e.nodeType===9?e:e.ownerDocument}function v1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function S1(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Qh(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Fh=null;function FN(){var e=window.event;return e&&e.type==="popstate"?e===Fh?!1:(Fh=e,!0):(Fh=null,!1)}var C1=typeof setTimeout=="function"?setTimeout:void 0,ZN=typeof clearTimeout=="function"?clearTimeout:void 0,w1=typeof Promise=="function"?Promise:void 0,WN=typeof queueMicrotask=="function"?queueMicrotask:typeof w1<"u"?function(e){return w1.resolve(null).then(e).catch(JN)}:C1;function JN(e){setTimeout(function(){throw e})}function mo(e){return e==="head"}function E1(e,n){var o=n,s=0,h=0;do{var y=o.nextSibling;if(e.removeChild(o),y&&y.nodeType===8)if(o=y.data,o==="/$"){if(0<s&&8>s){o=s;var A=e.ownerDocument;if(o&1&&Rs(A.documentElement),o&2&&Rs(A.body),o&4)for(o=A.head,Rs(o),A=o.firstChild;A;){var k=A.nextSibling,V=A.nodeName;A[Gi]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&A.rel.toLowerCase()==="stylesheet"||o.removeChild(A),A=k}}if(h===0){e.removeChild(y),Ls(n);return}h--}else o==="$"||o==="$?"||o==="$!"?h++:s=o.charCodeAt(0)-48;else s=0;o=y}while(o);Ls(n)}function Zh(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Zh(o),tf(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function eM(e,n,o,s){for(;e.nodeType===1;){var h=o;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Gi])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(y=e.getAttribute("rel"),y==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(y!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(y=e.getAttribute("src"),(y!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&y&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var y=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===y)return e}else return e;if(e=Un(e.nextSibling),e===null)break}return null}function tM(e,n,o){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o||(e=Un(e.nextSibling),e===null))return null;return e}function Wh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function nM(e,n){var o=e.ownerDocument;if(e.data!=="$?"||o.readyState==="complete")n();else{var s=function(){n(),o.removeEventListener("DOMContentLoaded",s)};o.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Un(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="F!"||n==="F")break;if(n==="/$")return null}}return e}var Jh=null;function T1(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}function j1(e,n,o){switch(n=Hc(o),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Rs(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);tf(e)}var Dn=new Map,A1=new Set;function Pc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Dr=G.d;G.d={f:rM,r:oM,D:aM,C:iM,L:sM,m:lM,X:uM,S:cM,M:dM};function rM(){var e=Dr.f(),n=Mc();return e||n}function oM(e){var n=Na(e);n!==null&&n.tag===5&&n.type==="form"?Xx(n):Dr.r(e)}var ui=typeof document>"u"?null:document;function R1(e,n,o){var s=ui;if(s&&typeof n=="string"&&n){var h=jn(n);h='link[rel="'+e+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),A1.has(h)||(A1.add(h),e={rel:e,crossOrigin:o,href:n},s.querySelector(h)===null&&(n=s.createElement("link"),Pt(n,"link",e),Mt(n),s.head.appendChild(n)))}}function aM(e){Dr.D(e),R1("dns-prefetch",e,null)}function iM(e,n){Dr.C(e,n),R1("preconnect",e,n)}function sM(e,n,o){Dr.L(e,n,o);var s=ui;if(s&&e&&n){var h='link[rel="preload"][as="'+jn(n)+'"]';n==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+jn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+jn(o.imageSizes)+'"]')):h+='[href="'+jn(e)+'"]';var y=h;switch(n){case"style":y=di(e);break;case"script":y=fi(e)}Dn.has(y)||(e=C({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:e,as:n},o),Dn.set(y,e),s.querySelector(h)!==null||n==="style"&&s.querySelector(Os(y))||n==="script"&&s.querySelector(Ns(y))||(n=s.createElement("link"),Pt(n,"link",e),Mt(n),s.head.appendChild(n)))}}function lM(e,n){Dr.m(e,n);var o=ui;if(o&&e){var s=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+jn(s)+'"][href="'+jn(e)+'"]',y=h;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=fi(e)}if(!Dn.has(y)&&(e=C({rel:"modulepreload",href:e},n),Dn.set(y,e),o.querySelector(h)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ns(y)))return}s=o.createElement("link"),Pt(s,"link",e),Mt(s),o.head.appendChild(s)}}}function cM(e,n,o){Dr.S(e,n,o);var s=ui;if(s&&e){var h=Ma(s).hoistableStyles,y=di(e);n=n||"default";var A=h.get(y);if(!A){var k={loading:0,preload:null};if(A=s.querySelector(Os(y)))k.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":n},o),(o=Dn.get(y))&&em(e,o);var V=A=s.createElement("link");Mt(V),Pt(V,"link",e),V._p=new Promise(function(W,re){V.onload=W,V.onerror=re}),V.addEventListener("load",function(){k.loading|=1}),V.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Uc(A,n,s)}A={type:"stylesheet",instance:A,count:1,state:k},h.set(y,A)}}}function uM(e,n){Dr.X(e,n);var o=ui;if(o&&e){var s=Ma(o).hoistableScripts,h=fi(e),y=s.get(h);y||(y=o.querySelector(Ns(h)),y||(e=C({src:e,async:!0},n),(n=Dn.get(h))&&tm(e,n),y=o.createElement("script"),Mt(y),Pt(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function dM(e,n){Dr.M(e,n);var o=ui;if(o&&e){var s=Ma(o).hoistableScripts,h=fi(e),y=s.get(h);y||(y=o.querySelector(Ns(h)),y||(e=C({src:e,async:!0,type:"module"},n),(n=Dn.get(h))&&tm(e,n),y=o.createElement("script"),Mt(y),Pt(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function O1(e,n,o,s){var h=(h=ae.current)?Pc(h):null;if(!h)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(n=di(o.href),o=Ma(h).hoistableStyles,s=o.get(n),s||(s={type:"style",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=di(o.href);var y=Ma(h).hoistableStyles,A=y.get(e);if(A||(h=h.ownerDocument||h,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(e,A),(y=h.querySelector(Os(e)))&&!y._p&&(A.instance=y,A.state.loading=5),Dn.has(e)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Dn.set(e,o),y||fM(h,e,o,A.state))),n&&s===null)throw Error(a(528,""));return A}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=fi(o),o=Ma(h).hoistableScripts,s=o.get(n),s||(s={type:"script",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function di(e){return'href="'+jn(e)+'"'}function Os(e){return'link[rel="stylesheet"]['+e+"]"}function N1(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function fM(e,n,o,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),Pt(n,"link",o),Mt(n),e.head.appendChild(n))}function fi(e){return'[src="'+jn(e)+'"]'}function Ns(e){return"script[async]"+e}function M1(e,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+jn(o.href)+'"]');if(s)return n.instance=s,Mt(s),s;var h=C({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Mt(s),Pt(s,"style",h),Uc(s,o.precedence,e),n.instance=s;case"stylesheet":h=di(o.href);var y=e.querySelector(Os(h));if(y)return n.state.loading|=4,n.instance=y,Mt(y),y;s=N1(o),(h=Dn.get(h))&&em(s,h),y=(e.ownerDocument||e).createElement("link"),Mt(y);var A=y;return A._p=new Promise(function(k,V){A.onload=k,A.onerror=V}),Pt(y,"link",s),n.state.loading|=4,Uc(y,o.precedence,e),n.instance=y;case"script":return y=fi(o.src),(h=e.querySelector(Ns(y)))?(n.instance=h,Mt(h),h):(s=o,(h=Dn.get(y))&&(s=C({},o),tm(s,h)),e=e.ownerDocument||e,h=e.createElement("script"),Mt(h),Pt(h,"link",s),e.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Uc(s,o.precedence,e));return n.instance}function Uc(e,n,o){for(var s=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=s.length?s[s.length-1]:null,y=h,A=0;A<s.length;A++){var k=s[A];if(k.dataset.precedence===n)y=k;else if(y!==h)break}y?y.parentNode.insertBefore(e,y.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(e,n.firstChild))}function em(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function tm(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var $c=null;function _1(e,n,o){if($c===null){var s=new Map,h=$c=new Map;h.set(o,s)}else h=$c,s=h.get(o),s||(s=new Map,h.set(o,s));if(s.has(e))return s;for(s.set(e,null),o=o.getElementsByTagName(e),h=0;h<o.length;h++){var y=o[h];if(!(y[Gi]||y[Kt]||e==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var A=y.getAttribute(n)||"";A=e+A;var k=s.get(A);k?k.push(y):s.set(A,[y])}}return s}function D1(e,n,o){e=e.ownerDocument||e,e.head.insertBefore(o,n==="title"?e.querySelector("head > title"):null)}function hM(e,n,o){if(o===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function I1(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Ms=null;function mM(){}function pM(e,n,o){if(Ms===null)throw Error(a(475));var s=Ms;if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var h=di(o.href),y=e.querySelector(Os(h));if(y){e=y._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=Gc.bind(s),e.then(s,s)),n.state.loading|=4,n.instance=y,Mt(y);return}y=e.ownerDocument||e,o=N1(o),(h=Dn.get(h))&&em(o,h),y=y.createElement("link"),Mt(y);var A=y;A._p=new Promise(function(k,V){A.onload=k,A.onerror=V}),Pt(y,"link",o),n.instance=y}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(s.count++,n=Gc.bind(s),e.addEventListener("load",n),e.addEventListener("error",n))}}function gM(){if(Ms===null)throw Error(a(475));var e=Ms;return e.stylesheets&&e.count===0&&nm(e,e.stylesheets),0<e.count?function(n){var o=setTimeout(function(){if(e.stylesheets&&nm(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(o)}}:null}function Gc(){if(this.count--,this.count===0){if(this.stylesheets)nm(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Vc=null;function nm(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Vc=new Map,n.forEach(yM,e),Vc=null,Gc.call(e))}function yM(e,n){if(!(n.state.loading&4)){var o=Vc.get(e);if(o)var s=o.get(null);else{o=new Map,Vc.set(e,o);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<h.length;y++){var A=h[y];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(o.set(A.dataset.precedence,A),s=A)}s&&o.set(null,s)}h=n.instance,A=h.getAttribute("data-precedence"),y=o.get(A)||s,y===s&&o.set(null,h),o.set(A,h),this.count++,s=Gc.bind(this),h.addEventListener("load",s),h.addEventListener("error",s),y?y.parentNode.insertBefore(h,y.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),n.state.loading|=4}}var _s={$$typeof:R,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function bM(e,n,o,s,h,y,A,k){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Bn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bn(0),this.hiddenUpdates=Bn(null),this.identifierPrefix=s,this.onUncaughtError=h,this.onCaughtError=y,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function k1(e,n,o,s,h,y,A,k,V,W,re,se){return e=new bM(e,n,o,A,k,V,W,se),n=1,y===!0&&(n|=24),y=fn(3,null,null,n),e.current=y,y.stateNode=e,n=zf(),n.refCount++,e.pooledCache=n,n.refCount++,y.memoizedState={element:s,isDehydrated:o,cache:n},Uf(y),e}function L1(e){return e?(e=Ga,e):Ga}function z1(e,n,o,s,h,y){h=L1(h),s.context===null?s.context=h:s.pendingContext=h,s=eo(n),s.payload={element:o},y=y===void 0?null:y,y!==null&&(s.callback=y),o=to(e,s,n),o!==null&&(yn(o,e,n),ls(o,e,n))}function B1(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function rm(e,n){B1(e,n),(e=e.alternate)&&B1(e,n)}function H1(e){if(e.tag===13){var n=$a(e,67108864);n!==null&&yn(n,e,67108864),rm(e,67108864)}}var qc=!0;function xM(e,n,o,s){var h=P.T;P.T=null;var y=G.p;try{G.p=2,om(e,n,o,s)}finally{G.p=y,P.T=h}}function vM(e,n,o,s){var h=P.T;P.T=null;var y=G.p;try{G.p=8,om(e,n,o,s)}finally{G.p=y,P.T=h}}function om(e,n,o,s){if(qc){var h=am(s);if(h===null)qh(e,n,s,Yc,o),U1(e,s);else if(CM(h,e,n,o,s))s.stopPropagation();else if(U1(e,s),n&4&&-1<SM.indexOf(e)){for(;h!==null;){var y=Na(h);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var A=Oe(y.pendingLanes);if(A!==0){var k=y;for(k.pendingLanes|=2,k.entangledLanes|=2;A;){var V=1<<31-Yt(A);k.entanglements[1]|=V,A&=~V}tr(y),(Qe&6)===0&&(Oc=dt()+500,Ts(0))}}break;case 13:k=$a(y,2),k!==null&&yn(k,y,2),Mc(),rm(y,2)}if(y=am(s),y===null&&qh(e,n,s,Yc,o),y===h)break;h=y}h!==null&&s.stopPropagation()}else qh(e,n,s,null,o)}}function am(e){return e=uf(e),im(e)}var Yc=null;function im(e){if(Yc=null,e=Oa(e),e!==null){var n=l(e);if(n===null)e=null;else{var o=n.tag;if(o===13){if(e=u(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Yc=e,null}function P1(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(be()){case gt:return 2;case ot:return 8;case Wt:case yr:return 32;case ja:return 268435456;default:return 32}default:return 32}}var sm=!1,po=null,go=null,yo=null,Ds=new Map,Is=new Map,bo=[],SM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function U1(e,n){switch(e){case"focusin":case"focusout":po=null;break;case"dragenter":case"dragleave":go=null;break;case"mouseover":case"mouseout":yo=null;break;case"pointerover":case"pointerout":Ds.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Is.delete(n.pointerId)}}function ks(e,n,o,s,h,y){return e===null||e.nativeEvent!==y?(e={blockedOn:n,domEventName:o,eventSystemFlags:s,nativeEvent:y,targetContainers:[h]},n!==null&&(n=Na(n),n!==null&&H1(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),e)}function CM(e,n,o,s,h){switch(n){case"focusin":return po=ks(po,e,n,o,s,h),!0;case"dragenter":return go=ks(go,e,n,o,s,h),!0;case"mouseover":return yo=ks(yo,e,n,o,s,h),!0;case"pointerover":var y=h.pointerId;return Ds.set(y,ks(Ds.get(y)||null,e,n,o,s,h)),!0;case"gotpointercapture":return y=h.pointerId,Is.set(y,ks(Is.get(y)||null,e,n,o,s,h)),!0}return!1}function $1(e){var n=Oa(e.target);if(n!==null){var o=l(n);if(o!==null){if(n=o.tag,n===13){if(n=u(o),n!==null){e.blockedOn=n,pO(e.priority,function(){if(o.tag===13){var s=gn();s=Wd(s);var h=$a(o,s);h!==null&&yn(h,o,s),rm(o,s)}});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=am(e.nativeEvent);if(o===null){o=e.nativeEvent;var s=new o.constructor(o.type,o);cf=s,o.target.dispatchEvent(s),cf=null}else return n=Na(o),n!==null&&H1(n),e.blockedOn=o,!1;n.shift()}return!0}function G1(e,n,o){Xc(e)&&o.delete(n)}function wM(){sm=!1,po!==null&&Xc(po)&&(po=null),go!==null&&Xc(go)&&(go=null),yo!==null&&Xc(yo)&&(yo=null),Ds.forEach(G1),Is.forEach(G1)}function Kc(e,n){e.blockedOn===n&&(e.blockedOn=null,sm||(sm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,wM)))}var Qc=null;function V1(e){Qc!==e&&(Qc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Qc===e&&(Qc=null);for(var n=0;n<e.length;n+=3){var o=e[n],s=e[n+1],h=e[n+2];if(typeof s!="function"){if(im(s||o)===null)continue;break}var y=Na(o);y!==null&&(e.splice(n,3),n-=3,ih(y,{pending:!0,data:h,method:o.method,action:s},s,h))}}))}function Ls(e){function n(V){return Kc(V,e)}po!==null&&Kc(po,e),go!==null&&Kc(go,e),yo!==null&&Kc(yo,e),Ds.forEach(n),Is.forEach(n);for(var o=0;o<bo.length;o++){var s=bo[o];s.blockedOn===e&&(s.blockedOn=null)}for(;0<bo.length&&(o=bo[0],o.blockedOn===null);)$1(o),o.blockedOn===null&&bo.shift();if(o=(e.ownerDocument||e).$$reactFormReplay,o!=null)for(s=0;s<o.length;s+=3){var h=o[s],y=o[s+1],A=h[nn]||null;if(typeof y=="function")A||V1(o);else if(A){var k=null;if(y&&y.hasAttribute("formAction")){if(h=y,A=y[nn]||null)k=A.formAction;else if(im(h)!==null)continue}else k=A.action;typeof k=="function"?o[s+1]=k:(o.splice(s,3),s-=3),V1(o)}}}function lm(e){this._internalRoot=e}Fc.prototype.render=lm.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var o=n.current,s=gn();z1(o,s,e,n,null,null)},Fc.prototype.unmount=lm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;z1(e.current,2,null,e,null,null),Mc(),n[Ra]=null}};function Fc(e){this._internalRoot=e}Fc.prototype.unstable_scheduleHydration=function(e){if(e){var n=sb();e={blockedOn:null,target:e,priority:n};for(var o=0;o<bo.length&&n!==0&&n<bo[o].priority;o++);bo.splice(o,0,e),o===0&&$1(e)}};var q1=r.version;if(q1!=="19.1.1")throw Error(a(527,q1,"19.1.1"));G.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=m(n),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var EM={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zc.isDisabled&&Zc.supportsFiber)try{br=Zc.inject(EM),zt=Zc}catch{}}return ji.createRoot=function(e,n){if(!c(e))throw Error(a(299));var o=!1,s="",h=sv,y=lv,A=cv,k=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(A=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(k=n.unstable_transitionCallbacks)),n=k1(e,1,!1,null,null,o,s,h,y,A,k,null),e[Ra]=n.current,Vh(e),new lm(n)},ji.hydrateRoot=function(e,n,o){if(!c(e))throw Error(a(299));var s=!1,h="",y=sv,A=lv,k=cv,V=null,W=null;return o!=null&&(o.unstable_strictMode===!0&&(s=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(A=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(V=o.unstable_transitionCallbacks),o.formState!==void 0&&(W=o.formState)),n=k1(e,1,!0,n,o??null,s,h,y,A,k,V,W),n.context=L1(null),o=n.current,s=gn(),s=Wd(s),h=eo(s),h.callback=null,to(o,h,s),o=s,n.current.lanes=o,zo(n,o),tr(n),e[Ra]=n.current,Vh(e),new Fc(n)},ji.version="19.1.1",ji}var Vm;function FS(){if(Vm)return wu.exports;Vm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),wu.exports=QS(),wu.exports}var ZS=FS(),Hr=$m();function qm(t){var r,i,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var c=t.length;for(r=0;r<c;r++)t[r]&&(i=qm(t[r]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}function Ym(){for(var t,r,i=0,a="",c=arguments.length;i<c;i++)(t=arguments[i])&&(r=qm(t))&&(a&&(a+=" "),a+=r);return a}const WS=(t,r)=>{const i=new Array(t.length+r.length);for(let a=0;a<t.length;a++)i[a]=t[a];for(let a=0;a<r.length;a++)i[t.length+a]=r[a];return i},JS=(t,r)=>({classGroupId:t,validator:r}),Xm=(t=new Map,r=null,i)=>({nextPart:t,validators:r,classGroupId:i}),Xs="-",Km=[],eC="arbitrary..",tC=t=>{const r=rC(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return nC(u);const d=u.split(Xs),m=d[0]===""&&d.length>1?1:0;return Qm(d,m,r)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=a[u],p=i[u];return m?p?WS(p,m):m:p||Km}return i[u]||Km}}},Qm=(t,r,i)=>{if(t.length-r===0)return i.classGroupId;const c=t[r],l=i.nextPart.get(c);if(l){const p=Qm(t,r+1,l);if(p)return p}const u=i.validators;if(u===null)return;const d=r===0?t.join(Xs):t.slice(r).join(Xs),m=u.length;for(let p=0;p<m;p++){const C=u[p];if(C.validator(d))return C.classGroupId}},nC=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=t.slice(1,-1),i=r.indexOf(":"),a=r.slice(0,i);return a?eC+a:void 0})(),rC=t=>{const{theme:r,classGroups:i}=t;return oC(i,r)},oC=(t,r)=>{const i=Xm();for(const a in t){const c=t[a];Au(c,i,a,r)}return i},Au=(t,r,i,a)=>{const c=t.length;for(let l=0;l<c;l++){const u=t[l];aC(u,r,i,a)}},aC=(t,r,i,a)=>{if(typeof t=="string"){iC(t,r,i);return}if(typeof t=="function"){sC(t,r,i,a);return}lC(t,r,i,a)},iC=(t,r,i)=>{const a=t===""?r:Fm(r,t);a.classGroupId=i},sC=(t,r,i,a)=>{if(cC(t)){Au(t(a),r,i,a);return}r.validators===null&&(r.validators=[]),r.validators.push(JS(i,t))},lC=(t,r,i,a)=>{const c=Object.entries(t),l=c.length;for(let u=0;u<l;u++){const[d,m]=c[u];Au(m,Fm(r,d),i,a)}},Fm=(t,r)=>{let i=t;const a=r.split(Xs),c=a.length;for(let l=0;l<c;l++){const u=a[l];let d=i.nextPart.get(u);d||(d=Xm(),i.nextPart.set(u,d)),i=d}return i},cC=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,uC=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,i=Object.create(null),a=Object.create(null);const c=(l,u)=>{i[l]=u,r++,r>t&&(r=0,a=i,i=Object.create(null))};return{get(l){let u=i[l];if(u!==void 0)return u;if((u=a[l])!==void 0)return c(l,u),u},set(l,u){l in i?i[l]=u:c(l,u)}}},Ru="!",Zm=":",dC=[],Wm=(t,r,i,a,c)=>({modifiers:t,hasImportantModifier:r,baseClassName:i,maybePostfixModifierPosition:a,isExternal:c}),fC=t=>{const{prefix:r,experimentalParseClassName:i}=t;let a=c=>{const l=[];let u=0,d=0,m=0,p;const C=c.length;for(let S=0;S<C;S++){const w=c[S];if(u===0&&d===0){if(w===Zm){l.push(c.slice(m,S)),m=S+1;continue}if(w==="/"){p=S;continue}}w==="["?u++:w==="]"?u--:w==="("?d++:w===")"&&d--}const g=l.length===0?c:c.slice(m);let b=g,v=!1;g.endsWith(Ru)?(b=g.slice(0,-1),v=!0):g.startsWith(Ru)&&(b=g.slice(1),v=!0);const x=p&&p>m?p-m:void 0;return Wm(l,v,b,x)};if(r){const c=r+Zm,l=a;a=u=>u.startsWith(c)?l(u.slice(c.length)):Wm(dC,!1,u,void 0,!0)}if(i){const c=a;a=l=>i({className:l,parseClassName:c})}return a},hC=t=>{const r=new Map;return t.orderSensitiveModifiers.forEach((i,a)=>{r.set(i,1e6+a)}),i=>{const a=[];let c=[];for(let l=0;l<i.length;l++){const u=i[l],d=u[0]==="[",m=r.has(u);d||m?(c.length>0&&(c.sort(),a.push(...c),c=[]),a.push(u)):c.push(u)}return c.length>0&&(c.sort(),a.push(...c)),a}},mC=t=>({cache:uC(t.cacheSize),parseClassName:fC(t),sortModifiers:hC(t),postfixLookupClassGroupIds:pC(t),...tC(t)}),pC=t=>{const r=Object.create(null),i=t.postfixLookupClassGroups;if(i)for(let a=0;a<i.length;a++)r[i[a]]=!0;return r},gC=/\s+/,yC=(t,r)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:c,sortModifiers:l,postfixLookupClassGroupIds:u}=r,d=[],m=t.trim().split(gC);let p="";for(let C=m.length-1;C>=0;C-=1){const g=m[C],{isExternal:b,modifiers:v,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:w}=i(g);if(b){p=g+(p.length>0?" "+p:p);continue}let T=!!w,j;if(T){const _=S.substring(0,w);j=a(_);const I=j&&u[j]?a(S):void 0;I&&I!==j&&(j=I,T=!1)}else j=a(S);if(!j){if(!T){p=g+(p.length>0?" "+p:p);continue}if(j=a(S),!j){p=g+(p.length>0?" "+p:p);continue}T=!1}const R=v.length===0?"":v.length===1?v[0]:l(v).join(":"),O=x?R+Ru:R,M=O+j;if(d.indexOf(M)>-1)continue;d.push(M);const D=c(j,T);for(let _=0;_<D.length;++_){const I=D[_];d.push(O+I)}p=g+(p.length>0?" "+p:p)}return p},bC=(...t)=>{let r=0,i,a,c="";for(;r<t.length;)(i=t[r++])&&(a=Jm(i))&&(c&&(c+=" "),c+=a);return c},Jm=t=>{if(typeof t=="string")return t;let r,i="";for(let a=0;a<t.length;a++)t[a]&&(r=Jm(t[a]))&&(i&&(i+=" "),i+=r);return i},xC=(t,...r)=>{let i,a,c,l;const u=m=>{const p=r.reduce((C,g)=>g(C),t());return i=mC(p),a=i.cache.get,c=i.cache.set,l=d,d(m)},d=m=>{const p=a(m);if(p)return p;const C=yC(m,i);return c(m,C),C};return l=u,(...m)=>l(bC(...m))},vC=[],Et=t=>{const r=i=>i[t]||vC;return r.isThemeGetter=!0,r.themeKey=t,r},ep=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,CC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,EC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,TC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pr=t=>SC.test(t),_e=t=>!!t&&!Number.isNaN(Number(t)),Yn=t=>!!t&&Number.isInteger(Number(t)),Ou=t=>t.endsWith("%")&&_e(t.slice(0,-1)),rr=t=>CC.test(t),np=()=>!0,AC=t=>wC.test(t)&&!EC.test(t),Nu=()=>!1,RC=t=>TC.test(t),OC=t=>jC.test(t),NC=t=>!me(t)&&!pe(t),MC=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),_C=t=>Ur(t,lp,Nu),me=t=>ep.test(t),Eo=t=>Ur(t,cp,AC),rp=t=>Ur(t,PC,_e),DC=t=>Ur(t,dp,np),IC=t=>Ur(t,up,Nu),op=t=>Ur(t,ip,Nu),kC=t=>Ur(t,sp,OC),Ks=t=>Ur(t,fp,RC),pe=t=>tp.test(t),Ai=t=>To(t,cp),LC=t=>To(t,up),ap=t=>To(t,ip),zC=t=>To(t,lp),BC=t=>To(t,sp),Qs=t=>To(t,fp,!0),HC=t=>To(t,dp,!0),Ur=(t,r,i)=>{const a=ep.exec(t);return a?a[1]?r(a[1]):i(a[2]):!1},To=(t,r,i=!1)=>{const a=tp.exec(t);return a?a[1]?r(a[1]):i:!1},ip=t=>t==="position"||t==="percentage",sp=t=>t==="image"||t==="url",lp=t=>t==="length"||t==="size"||t==="bg-size",cp=t=>t==="length",PC=t=>t==="number",up=t=>t==="family-name",dp=t=>t==="number"||t==="weight",fp=t=>t==="shadow",UC=xC(()=>{const t=Et("color"),r=Et("font"),i=Et("text"),a=Et("font-weight"),c=Et("tracking"),l=Et("leading"),u=Et("breakpoint"),d=Et("container"),m=Et("spacing"),p=Et("radius"),C=Et("shadow"),g=Et("inset-shadow"),b=Et("text-shadow"),v=Et("drop-shadow"),x=Et("blur"),S=Et("perspective"),w=Et("aspect"),T=Et("ease"),j=Et("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...O(),pe,me],D=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],I=()=>[pe,me,m],z=()=>[Pr,"full","auto",...I()],H=()=>[Yn,"none","subgrid",pe,me],L=()=>["auto",{span:["full",Yn,pe,me]},Yn,pe,me],$=()=>[Yn,"auto",pe,me],Y=()=>["auto","min","max","fr",pe,me],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...I()],G=()=>[Pr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],B=()=>[d,Pr,"screen","full","dvw","lvw","svw","min","max","fit",...I()],Q=()=>[Pr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],N=()=>[t,pe,me],K=()=>[...O(),ap,op,{position:[pe,me]}],ne=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",zC,_C,{size:[pe,me]}],le=()=>[Ou,Ai,Eo],oe=()=>["","none","full",p,pe,me],ae=()=>["",_e,Ai,Eo],xe=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[_e,Ou,ap,op],de=()=>["","none",x,pe,me],Me=()=>["none",_e,pe,me],Be=()=>["none",_e,pe,me],Ae=()=>[_e,pe,me],Se=()=>[Pr,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rr],breakpoint:[rr],color:[np],container:[rr],"drop-shadow":[rr],ease:["in","out","in-out"],font:[NC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rr],shadow:[rr],spacing:["px",_e],text:[rr],"text-shadow":[rr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pr,me,pe,w]}],container:["container"],"container-type":[{"@container":["","normal","size",pe,me]}],"container-named":[MC],columns:[{columns:[_e,"auto",me,pe,d]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[Yn,"auto",pe,me]}],basis:[{basis:[Pr,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Pr,"auto","initial","none",me]}],grow:[{grow:["",_e,pe,me]}],shrink:[{shrink:["",_e,pe,me]}],order:[{order:[Yn,"first","last","none",pe,me]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[d,"screen",...G()]}],"min-w":[{"min-w":[d,"screen","none",...G()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh","none",...G()]}],"font-size":[{text:["base",i,Ai,Eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,HC,DC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ou,me]}],"font-family":[{font:[LC,IC,r]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,pe,me]}],"line-clamp":[{"line-clamp":[_e,"none",pe,rp]}],leading:[{leading:["none",l,...I()]}],"list-image":[{"list-image":["none",pe,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",pe,Eo]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[_e,"auto",pe,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[Yn,pe,me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yn,pe,me],radial:["",pe,me],conic:["",Yn,pe,me]},BC,kC]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,pe,me]}],"outline-w":[{outline:["",_e,Ai,Eo]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","inner","none",C,Qs,Ks]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",g,Qs,Ks]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[_e,Eo]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",b,Qs,Ks]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[_e,pe,me]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[pe,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,me]}],filter:[{filter:["","none",pe,me]}],blur:[{blur:de()}],brightness:[{brightness:[_e,pe,me]}],contrast:[{contrast:[_e,pe,me]}],"drop-shadow":[{"drop-shadow":["","none",v,Qs,Ks]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",_e,pe,me]}],"hue-rotate":[{"hue-rotate":[_e,pe,me]}],invert:[{invert:["",_e,pe,me]}],saturate:[{saturate:[_e,pe,me]}],sepia:[{sepia:["",_e,pe,me]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,me]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[_e,pe,me]}],"backdrop-contrast":[{"backdrop-contrast":[_e,pe,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,pe,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,pe,me]}],"backdrop-invert":[{"backdrop-invert":["",_e,pe,me]}],"backdrop-opacity":[{"backdrop-opacity":[_e,pe,me]}],"backdrop-saturate":[{"backdrop-saturate":[_e,pe,me]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,pe,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",pe,me]}],ease:[{ease:["linear","initial",T,pe,me]}],delay:[{delay:[_e,pe,me]}],animate:[{animate:["none",j,pe,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pe,me]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:Be()}],"scale-x":[{"scale-x":Be()}],"scale-y":[{"scale-y":Be()}],"scale-z":[{"scale-z":Be()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[pe,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],zoom:[{zoom:[Yn,pe,me]}],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,me]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[_e,Ai,Eo,rp]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ve(...t){return UC(Ym(t))}var $C=Object.defineProperty,Mu=(t,r)=>$C(t,"name",{value:r,configurable:!0});function _u(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}Mu(_u,"setRef");function hp(...t){return r=>{let i=!1;const a=t.map(c=>{const l=_u(c,r);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let c=0;c<a.length;c++){const l=a[c];typeof l=="function"?l():_u(t[c],null)}}}}Mu(hp,"composeRefs");function De(...t){return E.useCallback(hp(...t),t)}Mu(De,"useComposedRefs");var GC=Object.defineProperty,ln=(t,r)=>GC(t,"name",{value:r,configurable:!0});function or(t){const r=E.forwardRef((i,a)=>{let{children:c,...l}=i,u=null,d=!1;const m=[];c=vp(c),E.Children.forEach(c,b=>{if(bp(b)){d=!0;const v=b;let x="child"in v.props?v.props.child:v.props.children;for(;Du(x)&&typeof Fs=="function";)x=Fs(x._payload);u=qC(v,x),m.push(u?.props?.children)}else m.push(b)}),u?u=E.cloneElement(u,void 0,m):!d&&E.Children.count(c)===1&&E.isValidElement(c)&&(u=c);const p=u?yp(u):void 0,C=De(a,p);if(!u){if(c||c===0)throw new Error(d?KC(t):XC(t));return c}const g=gp(l,u.props??{});return u.type!==E.Fragment&&(g.ref=a?C:p),E.cloneElement(u,g)});return r.displayName=`${t}.Slot`,r}ln(or,"createSlot");var VC=or("Slot"),mp=Symbol.for("radix.slottable");function pp(t){const r=ln(i=>"child"in i?i.children(i.child):i.children,"Slottable");return r.displayName=`${t}.Slottable`,r.__radixId=mp,r}ln(pp,"createSlottable");var qC=ln((t,r)=>"child"in t.props?E.isValidElement(r)?E.cloneElement(r,void 0,t.props.children(r.props.children)):null:E.isValidElement(r)?r:null,"getSlottableElementFromSlottable");function gp(t,r){const i={...r};for(const a in r){const c=t[a],l=r[a];/^on[A-Z]/.test(a)?c&&l?i[a]=(...d)=>{const m=l(...d);return c(...d),m}:c&&(i[a]=c):a==="style"?i[a]={...c,...l}:a==="className"?i[a]=[c,l].filter(Boolean).join(" "):a==="aria-describedby"&&(i[a]=Sp(l,c))}return{...t,...i}}ln(gp,"mergeProps");function yp(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}ln(yp,"getElementRef");function bp(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===mp}ln(bp,"isSlottable");var YC=Symbol.for("react.lazy");function Du(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===YC&&"_payload"in t&&xp(t._payload)}ln(Du,"isLazyComponent");function xp(t){return typeof t=="object"&&t!==null&&"then"in t}ln(xp,"isPromiseLike");function vp(t){let r=t;for(;Du(r)&&typeof Fs=="function";)r=Fs(r._payload);return r}ln(vp,"useUnwrappedLazy");function Sp(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}ln(Sp,"concatAriaDescribedby");var XC=ln(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),KC=ln(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Fs=wo[" use ".trim().toString()],QC=Object.defineProperty,FC=(t,r)=>QC(t,"name",{value:r,configurable:!0}),ZC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=ZC.reduce((t,r)=>{const i=or(`Primitive.${r}`),a=E.forwardRef((c,l)=>{const{asChild:u,...d}=c,m=u?i:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(m,{...d,ref:l})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{});function Cp(t,r){t&&Hr.flushSync(()=>t.dispatchEvent(r))}FC(Cp,"dispatchDiscreteCustomEvent");var WC=Object.defineProperty,JC=(t,r)=>WC(t,"name",{value:r,configurable:!0}),wp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ew=E.forwardRef(JC(function(r,i){return f.jsx(ze.span,{...r,ref:i,style:{...wp,...r.style}})},"VisuallyHidden")),tw=Object.defineProperty,Sn=(t,r)=>tw(t,"name",{value:r,configurable:!0});function nw(t,r){const i=E.createContext(r);i.displayName=t+"Context";const a=Sn(l=>{const{children:u,...d}=l,m=E.useMemo(()=>d,Object.values(d));return f.jsx(i.Provider,{value:m,children:u})},"Provider");a.displayName=t+"Provider";function c(l,u={}){const{optional:d=!1}=u,m=E.useContext(i);if(m)return m;if(r!==void 0)return r;if(!d)throw new Error(`\`${l}\` must be used within \`${t}\``)}return Sn(c,"useContext"),[a,c]}Sn(nw,"createContext");function Cn(t,r=[]){let i=[];function a(l,u){const d=E.createContext(u);d.displayName=l+"Context";const m=i.length;i=[...i,u];const p=Sn(g=>{const{scope:b,children:v,...x}=g,S=b?.[t]?.[m]||d,w=E.useMemo(()=>x,Object.values(x));return f.jsx(S.Provider,{value:w,children:v})},"Provider");p.displayName=l+"Provider";function C(g,b,v={}){const{optional:x=!1}=v,S=b?.[t]?.[m]||d,w=E.useContext(S);if(w)return w;if(u!==void 0)return u;if(!x)throw new Error(`\`${g}\` must be used within \`${l}\``)}return Sn(C,"useContext"),[p,C]}Sn(a,"createContext");const c=Sn(()=>{const l=i.map(u=>E.createContext(u));return Sn(function(d){const m=d?.[t]||l;return E.useMemo(()=>({[`__scope${t}`]:{...d,[t]:m}}),[d,m])},"useScope")},"createScope");return c.scopeName=t,[a,Ep(c,...r)]}Sn(Cn,"createContextScope");function Ep(...t){const r=t[0];if(t.length===1)return r;const i=Sn(()=>{const a=t.map(c=>({useScope:c(),scopeName:c.scopeName}));return Sn(function(l){const u=a.reduce((d,{useScope:m,scopeName:p})=>{const g=m(l)[`__scope${p}`];return{...d,...g}},{});return E.useMemo(()=>({[`__scope${r.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return i.scopeName=r.scopeName,i}Sn(Ep,"composeContextScopes");var st=globalThis?.document?E.useLayoutEffect:()=>{},rw=Object.defineProperty,Tt=(t,r)=>rw(t,"name",{value:r,configurable:!0});function Zs(t){const r=t+"CollectionProvider",[i,a]=Cn(r),[c,l]=i(r,{collectionRef:{current:null},itemMap:new Map}),u=Tt(S=>{const{scope:w,children:T}=S,j=E.useRef(null),R=E.useRef(new Map).current;return f.jsx(c,{scope:w,itemMap:R,collectionRef:j,children:T})},"CollectionProvider");u.displayName=r;const d=t+"CollectionSlot",m=or(d),p=E.forwardRef((S,w)=>{const{scope:T,children:j}=S,R=l(d,T),O=De(w,R.collectionRef);return f.jsx(m,{ref:O,children:j})});p.displayName=d;const C=t+"CollectionItemSlot",g="data-radix-collection-item",b=or(C),v=E.forwardRef((S,w)=>{const{scope:T,children:j,...R}=S,O=E.useRef(null),M=De(w,O),D=l(C,T);return E.useEffect(()=>(D.itemMap.set(O,{ref:O,...R}),()=>void D.itemMap.delete(O))),f.jsx(b,{[g]:"",ref:M,children:j})});v.displayName=C;function x(S){const w=l(t+"CollectionConsumer",S);return E.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const R=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((D,_)=>R.indexOf(D.ref.current)-R.indexOf(_.ref.current))},[w.collectionRef,w.itemMap])}return Tt(x,"useCollection"),[{Provider:u,Slot:p,ItemSlot:v},x,a]}Tt(Zs,"createCollection");var Tp=new WeakMap,Ws=(un=class extends Map{constructor(i){super(i);K1(this,pt);um(this,pt,[...super.keys()]),Tp.set(this,!0)}set(i,a){return Tp.get(this)&&!this.has(i)&&Ut(this,pt).push(i),super.set(i,a),this}insert(i,a,c){const l=this.has(a),u=l?this.size:this.size+1,d=Iu(i),m=d>=0?Math.min(d,u-1):Math.max(u+d,0);if(l?Ut(this,pt).indexOf(a)===m:m===this.size)return this.set(a,c),this;const p=Ut(this,pt).filter(g=>g!==a);p.splice(m,0,a);const C=p.map(g=>[g,g===a?c:this.get(g)]);this.clear();for(const[g,b]of C)this.set(g,b);return this}with(i,a,c){const l=new un(this);return l.insert(i,a,c),l}before(i){const a=Ut(this,pt).indexOf(i)-1;if(!(a<0))return this.entryAt(a)}setBefore(i,a,c){const l=Ut(this,pt).indexOf(i);if(l===-1)return this;const u=Ut(this,pt).indexOf(a),d=u!==-1&&u<l?l-1:l;return this.insert(d,a,c)}after(i){let a=Ut(this,pt).indexOf(i);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(i,a,c){const l=Ut(this,pt).indexOf(i);if(l===-1)return this;const u=Ut(this,pt).indexOf(a),d=u!==-1&&u<=l?l:l+1;return this.insert(d,a,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return um(this,pt,[]),super.clear()}delete(i){const a=super.delete(i);return a&&Ut(this,pt).splice(Ut(this,pt).indexOf(i),1),a}deleteAt(i){const a=this.keyAt(i);return a!==void 0?this.delete(a):!1}at(i){const a=Js(Ut(this,pt),i);if(a!==void 0)return this.get(a)}entryAt(i){const a=Js(Ut(this,pt),i);if(a!==void 0)return[a,this.get(a)]}indexOf(i){return Ut(this,pt).indexOf(i)}keyAt(i){return Js(Ut(this,pt),i)}from(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return l;c++}}findIndex(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return c;c++}return-1}filter(i,a){const c=[];let l=0;for(const u of this)Reflect.apply(i,a,[u,l,this])&&c.push(u),l++;return new un(c)}map(i,a){const c=[];let l=0;for(const u of this)c.push([u[0],Reflect.apply(i,a,[u,l,this])]),l++;return new un(c)}reduce(...i){const[a,c]=i,l=i.length>1;if(!l&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=0,d=c;for(const m of this)u===0&&!l?d=m:d=Reflect.apply(a,this,[d,m,u,this]),u++;return d}reduceRight(...i){const[a,c]=i,l=i.length>1;if(!l&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=c;for(let d=this.size-1;d>=0;d--){const m=this.entryAt(d);d===this.size-1&&!l?u=m:u=Reflect.apply(a,this,[u,m,d,this])}return u}sort(i){if(typeof i!="function")throw new TypeError("OrderedDict.sort requires a compare function");const a=[...this.entries()].sort(i);this.clear();for(const[c,l]of a)this.set(c,l);return this}toSorted(i){if(typeof i!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const a=[...this.entries()].sort(i);return new un(a)}toReversed(){const i=new un;for(let a=this.size-1;a>=0;a--){const c=this.keyAt(a),l=this.get(c);i.set(c,l)}return i}toSpliced(...i){const a=[...this.entries()];return a.splice(...i),new un(a)}slice(i,a){const c=new un;for(const l of Ut(this,pt).slice(i,a))c.set(l,this.get(l));return c}every(i,a){let c=0;for(const l of this){if(!Reflect.apply(i,a,[l,c,this]))return!1;c++}return!0}some(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return!0;c++}return!1}},pt=new WeakMap,Tt(un,"OrderedDict"),un);function Js(t,r){if("at"in Array.prototype)return Array.prototype.at.call(t,r);const i=jp(t,r);return i===-1?void 0:t[i]}Tt(Js,"at");function jp(t,r){const i=t.length,a=Iu(r),c=a>=0?a:i+a;return c<0||c>=i?-1:c}Tt(jp,"toSafeIndex");function Iu(t){return t!==t||t===0?0:Math.trunc(t)}Tt(Iu,"toSafeInteger");function ow(t){const r=t+"CollectionProvider",[i,a]=Cn(r),[c,l]=i(r);c.displayName=t+"CollectionStableContextProvider";const[u,d]=i(r);u.displayName=t+"CollectionStatefulContextProvider";const m=Tt(({state:D,..._})=>D?f.jsx(C,{..._,state:D}):f.jsx(p,{..._}),"CollectionProvider");m.displayName=r;const p=Tt(D=>{const _=j();return f.jsx(C,{...D,state:_})},"CollectionInit");p.displayName=t+"CollectionInit";const C=Tt(D=>{const{scope:_,children:I,state:z}=D,H=E.useRef(null),[L,$]=E.useState(null),Y=De(H,$),[U,q]=z,P=E.useRef(new Ws),G=E.useCallback(()=>{const B=P.current;return Op(B)||B.sort(el),B},[]);return E.useEffect(()=>{if(!L)return;const B=Np(()=>{q(Q=>{const N=Q.toSorted(el);return N.some(([ne],te)=>Q.keyAt(te)!==ne)?N:Q})});return B.observe(L,{childList:!0,subtree:!0}),()=>{B.disconnect()}},[L,q]),f.jsx(c,{scope:_,collectionElementRef:Y,collectionElementRefObject:H,getCollection:G,setCollection:q,registryRef:P,children:f.jsx(u,{scope:_,collectionElement:L,collection:U,children:I})})},"CollectionProviderImpl");C.displayName=t+"CollectionProviderImpl";const g=t+"CollectionSlot",b=or(g),v=E.forwardRef((D,_)=>{const{scope:I,children:z}=D,H=l(g,I),L=De(_,H.collectionElementRef);return f.jsx(b,{ref:L,children:z})});v.displayName=g;const x=t+"CollectionItemSlot",S="data-radix-collection-item",w=or(x),T=E.forwardRef((D,_)=>{const{scope:I,children:z,...H}=D,L=E.useRef(null),$=l(x,I),{setCollection:Y,registryRef:U}=$,q=E.useRef(H);Ap(q.current,H)||(q.current=H);const P=q.current,G=E.useCallback(N=>{const K=U.current;N?K.set(N,{...q.current,element:N}):L.current&&K.delete(L.current)},[U]),B=De(_,G,L);st(()=>{const N=L.current,K=U.current;N&&K.has(N)&&K.set(N,{...P,element:N})},[P,U]);const Q=E.useRef(null);return E.useEffect(()=>{const N=L.current,K=Q.current;(K?.element??null)===N&&(!N||K?.itemData===P)||(Q.current=N?{element:N,itemData:P}:null,Y(ne=>{const te=new Ws(ne);return K&&K.element!==N&&te.delete(K.element),N&&te.set(N,{...P,element:N}),te.sort(el)}))}),E.useEffect(()=>()=>{const N=Q.current;Q.current=null,N&&Y(K=>{if(!K.has(N.element))return K;const ne=new Ws(K);return ne.delete(N.element),ne})},[Y]),f.jsx(w,{[S]:"",ref:B,children:z})});T.displayName=x;function j(){return E.useState(new Ws)}Tt(j,"useInitCollection");function R(D){const{collection:_}=d(t+"CollectionConsumer",D);return _}Tt(R,"useCollection");function O(D){const{getCollection:_}=l(t+"CollectionConsumer",D);return _}return Tt(O,"useGetCollection"),[{Provider:m,Slot:v,ItemSlot:T},{createCollectionScope:a,useCollection:R,useGetCollection:O,useInitCollection:j}]}Tt(ow,"createCollection");function Ap(t,r){if(t===r)return!0;if(typeof t!="object"||typeof r!="object"||t==null||r==null)return!1;const i=Object.keys(t),a=Object.keys(r);if(i.length!==a.length)return!1;for(const c of i)if(!Object.prototype.hasOwnProperty.call(r,c)||t[c]!==r[c])return!1;return!0}Tt(Ap,"shallowEqual");function Rp(t,r){return!!(r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Tt(Rp,"isElementPreceding");function Op(t){let r;for(const i of t.keys()){if(r){const a=r.compareDocumentPosition(i);if(!(a&Node.DOCUMENT_POSITION_DISCONNECTED)&&a&Node.DOCUMENT_POSITION_PRECEDING)return!1}r=i}return!0}Tt(Op,"isInDocumentOrder");function el(t,r){return!t[1].element||!r[1].element?0:Rp(t[1].element,r[1].element)?-1:1}Tt(el,"sortByDocumentPosition");function Np(t){return new MutationObserver(i=>{for(const a of i)if(a.type==="childList"){t();return}})}Tt(Np,"getChildListObserver");var aw=Object.defineProperty,ua=(t,r)=>aw(t,"name",{value:r,configurable:!0}),Mp=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ee(t,r,{checkForDefaultPrevented:i=!0}={}){return ua(function(c){if(t?.(c),i===!1||!c||!c.defaultPrevented)return r?.(c)},"handleEvent")}ua(Ee,"composeEventHandlers");function iw(t){if(!Mp)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}ua(iw,"getOwnerWindow");function ku(t){if(!Mp)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}ua(ku,"getOwnerDocument");function _p(t,r=!1){const{activeElement:i}=ku(t);if(!i?.nodeName)return null;if(Dp(i)&&i.contentDocument)return _p(i.contentDocument.body,r);if(r){const a=i.getAttribute("aria-activedescendant");if(a){const c=ku(i).getElementById(a);if(c)return c}}return i}ua(_p,"getActiveElement");function Dp(t){return t.tagName==="IFRAME"}ua(Dp,"isFrame");var sw=Object.defineProperty,lw=(t,r)=>sw(t,"name",{value:r,configurable:!0}),Ip=wo[" useEffectEvent ".trim().toString()],kp=wo[" useInsertionEffect ".trim().toString()];function Lp(t){if(typeof Ip=="function")return Ip(t);const r=E.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof kp=="function"?kp(()=>{r.current=t}):st(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}lw(Lp,"useEffectEvent");var cw=Object.defineProperty,Ri=(t,r)=>cw(t,"name",{value:r,configurable:!0}),uw=wo[" useInsertionEffect ".trim().toString()]||st;function ar({prop:t,defaultProp:r,onChange:i=Ri(()=>{},"onChange"),caller:a}){const[c,l,u]=zp({defaultProp:r,onChange:i}),d=t!==void 0,m=d?t:c,p=E.useCallback(C=>{if(d){const g=Bp(C)?C(t):C;g!==t&&u.current?.(g)}else l(C)},[d,t,l,u]);return[m,p]}Ri(ar,"useControllableState");function zp({defaultProp:t,onChange:r}){const[i,a]=E.useState(t),c=E.useRef(i),l=E.useRef(r);return uw(()=>{l.current=r},[r]),E.useEffect(()=>{c.current!==i&&(l.current?.(i),c.current=i)},[i,c]),[i,a,l]}Ri(zp,"useUncontrolledState");function Bp(t){return typeof t=="function"}Ri(Bp,"isFunction");var Hp=Symbol("RADIX:SYNC_STATE");function dw(t,r,i,a){const{prop:c,defaultProp:l,onChange:u,caller:d}=r,m=c!==void 0,p=Lp(u),C=[{...i,state:l}];a&&C.push(a);const[g,b]=E.useReducer((w,T)=>{if(T.type===Hp)return{...w,state:T.state};const j=t(w,T);return m&&!Object.is(j.state,w.state)&&p(j.state),j},...C),v=g.state,x=E.useRef(v);E.useEffect(()=>{x.current!==v&&(x.current=v,m||p(v))},[v,x,m]);const S=E.useMemo(()=>c!==void 0?{...g,state:c}:g,[g,c]);return E.useEffect(()=>{m&&!Object.is(c,g.state)&&b({type:Hp,state:c})},[c,g.state,m]),[S,b]}Ri(dw,"useControllableStateReducer");var fw=Object.defineProperty,ir=(t,r)=>fw(t,"name",{value:r,configurable:!0});function Pp(t,r){return E.useReducer((i,a)=>r[i][a]??i,t)}ir(Pp,"useStateMachine");var $r=ir(t=>{const{present:r,children:i}=t,a=Up(r),c=typeof i=="function"?i({present:a.isPresent}):E.Children.only(i),l=$p(a.ref,Gp(c));return typeof i=="function"||a.isPresent?E.cloneElement(c,{ref:l}):null},"Presence");function Up(t){const[r,i]=E.useState(),a=E.useRef(null),c=E.useRef(t),l=E.useRef("none"),u=E.useRef(void 0),d=t?"mounted":"unmounted",[m,p]=Pp(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{m==="mounted"?(l.current=u.current??da(a.current),u.current=void 0):l.current="none"},[m]),st(()=>{const C=a.current,g=c.current;if(g!==t){const v=l.current,x=da(C);t?(u.current=x,p("MOUNT")):x==="none"||C?.display==="none"?p("UNMOUNT"):p(g&&v!==x?"ANIMATION_OUT":"UNMOUNT"),c.current=t}},[t,p]),st(()=>{if(r){let C;const g=r.ownerDocument.defaultView??window,b=ir(x=>{const w=da(a.current).includes(CSS.escape(x.animationName));if(x.target===r&&w&&(p("ANIMATION_END"),!c.current)){const T=r.style.animationFillMode;r.style.animationFillMode="forwards",C=g.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=T)})}},"handleAnimationEnd"),v=ir(x=>{x.target===r&&(l.current=da(a.current))},"handleAnimationStart");return r.addEventListener("animationstart",v),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{g.clearTimeout(C),r.removeEventListener("animationstart",v),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[r,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:E.useCallback(C=>{if(C){const g=getComputedStyle(C);a.current=g,u.current=da(g)}else a.current=null;i(C)},[])}}ir(Up,"usePresence");function Lu(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}ir(Lu,"setRef");function $p(...t){const r=E.useRef(t);return r.current=t,E.useCallback(i=>{const a=r.current;let c=!1;const l=a.map(u=>{const d=Lu(u,i);return!c&&typeof d=="function"&&(c=!0),d});if(c)return()=>{for(let u=0;u<l.length;u++){const d=l[u];typeof d=="function"?d():Lu(a[u],null)}}},[])}ir($p,"useStableComposedRefs");function da(t){return t?.animationName||"none"}ir(da,"getAnimationName");function Gp(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}ir(Gp,"getElementRef");var hw=Object.defineProperty,mw=(t,r)=>hw(t,"name",{value:r,configurable:!0}),pw=wo[" useId ".trim().toString()]||(()=>{}),gw=0;function sr(t){const[r,i]=E.useState(pw());return st(()=>{t||i(a=>a??String(gw++))},[t]),t||(r?`radix-${r}`:"")}mw(sr,"useId");var yw=Object.defineProperty,bw=(t,r)=>yw(t,"name",{value:r,configurable:!0}),xw={LTR:"ltr"},vw=E.createContext(void 0);function Oi(t){const r=E.useContext(vw);return t||r||xw.LTR}bw(Oi,"useDirection");var Sw=Object.defineProperty,Cw=(t,r)=>Sw(t,"name",{value:r,configurable:!0}),Vp=wo[" useInsertionEffect ".trim().toString()];function In(t){const r=E.useRef(t);return typeof Vp=="function"?Vp(()=>{r.current=t}):st(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}Cw(In,"useCallbackRef");var ww=Object.defineProperty,Rt=(t,r)=>ww(t,"name",{value:r,configurable:!0}),zu="dismissableLayer.update",Ew="dismissableLayer.pointerDownOutside",Tw="dismissableLayer.focusOutside",qp,Yp=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Bu=E.forwardRef(Rt(function(r,i){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,onDismiss:p,...C}=r,g=E.useContext(Yp),[b,v]=E.useState(null),x=b?.ownerDocument??globalThis?.document,[,S]=E.useState({}),w=De(i,v),T=Array.from(g.layers),[j]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),R=j?T.indexOf(j):-1,O=b?T.indexOf(b):-1,M=g.layersWithOutsidePointerEventsDisabled.size>0,D=O>=R,_=E.useRef(!1),I=Kp($=>{u?.($),m?.($),$.defaultPrevented||p?.()},{ownerDocument:x,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:E.useCallback($=>{if(!($ instanceof Node))return!1;const Y=[...g.branches].some(U=>U.contains($));return D&&!Y},[g.branches,D])}),z=Qp($=>{if(c&&_.current)return;const Y=$.target;[...g.branches].some(q=>q.contains(Y))||(d?.($),m?.($),$.defaultPrevented||p?.())},x),H=b?O===T.length-1:!1,L=In($=>{$.key==="Escape"&&(l?.($),!$.defaultPrevented&&p&&($.preventDefault(),p()))});return E.useEffect(()=>{if(H)return x.addEventListener("keydown",L,{capture:!0}),()=>x.removeEventListener("keydown",L,{capture:!0})},[x,H,L]),E.useEffect(()=>{if(b)return a&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(qp=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(b)),g.layers.add(b),Hu(),()=>{a&&(g.layersWithOutsidePointerEventsDisabled.delete(b),g.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=qp))}},[b,x,a,g]),E.useEffect(()=>()=>{b&&(g.layers.delete(b),g.layersWithOutsidePointerEventsDisabled.delete(b),Hu())},[b,g]),E.useEffect(()=>{const $=Rt(()=>S({}),"handleUpdate");return document.addEventListener(zu,$),()=>document.removeEventListener(zu,$)},[]),f.jsx(ze.div,{...C,ref:w,style:{pointerEvents:M?D?"auto":"none":void 0,...r.style},onFocusCapture:Ee(r.onFocusCapture,z.onFocusCapture),onBlurCapture:Ee(r.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Ee(r.onPointerDownCapture,I.onPointerDownCapture)})},"DismissableLayer"));function Xp(){const t=E.useContext(Yp),[r,i]=E.useState(null);return E.useEffect(()=>{if(r)return t.dismissableSurfaces.add(r),()=>{t.dismissableSurfaces.delete(r)}},[r,t.dismissableSurfaces]),i}Rt(Xp,"useDismissableLayerSurface");var jw=Rt(()=>!0,"IS_TRUE");function Kp(t,r){const{ownerDocument:i=globalThis?.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=jw}=r,d=In(t),m=E.useRef(!1),p=E.useRef(!1),C=E.useRef(new Map),g=E.useRef(()=>{});return E.useEffect(()=>{function b(){p.current=!1,c.current=!1,C.current.clear()}Rt(b,"resetOutsideInteraction");function v(){return Array.from(C.current.values()).some(Boolean)}Rt(v,"isOutsideInteractionIntercepted");function x(R){if(!p.current)return;const O=R.target;O instanceof Node&&[...l].some(D=>D.contains(O))||C.current.set(R.type,!0),R.type==="click"&&window.setTimeout(()=>{p.current&&g.current()},0)}Rt(x,"handleInteractionCapture");function S(R){p.current&&C.current.set(R.type,!1)}Rt(S,"handleInteractionBubble");const w=Rt(R=>{if(R.target&&!m.current){let O=function(){i.removeEventListener("click",g.current);const D=v();b(),D||Pu(Ew,d,M,{discrete:!0})};if(Rt(O,"handleAndDispatchPointerDownOutsideEvent"),!u(R.target)){i.removeEventListener("click",g.current),b(),m.current=!1;return}const M={originalEvent:R};p.current=!0,c.current=a&&R.button===0,C.current.clear(),!a||R.button!==0?O():(i.removeEventListener("click",g.current),g.current=O,i.addEventListener("click",g.current,{once:!0}))}else i.removeEventListener("click",g.current),b();m.current=!1},"handlePointerDown"),T=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const R of T)i.addEventListener(R,x,!0),i.addEventListener(R,S);const j=window.setTimeout(()=>{i.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(j),i.removeEventListener("pointerdown",w),i.removeEventListener("click",g.current);for(const R of T)i.removeEventListener(R,x,!0),i.removeEventListener(R,S)}},[i,d,a,c,l,u]),{onPointerDownCapture:Rt(()=>m.current=!0,"onPointerDownCapture")}}Rt(Kp,"usePointerDownOutside");function Qp(t,r=globalThis?.document){const i=In(t),a=E.useRef(!1);return E.useEffect(()=>{const c=Rt(l=>{l.target&&!a.current&&Pu(Tw,i,{originalEvent:l},{discrete:!1})},"handleFocus");return r.addEventListener("focusin",c),()=>r.removeEventListener("focusin",c)},[r,i]),{onFocusCapture:Rt(()=>a.current=!0,"onFocusCapture"),onBlurCapture:Rt(()=>a.current=!1,"onBlurCapture")}}Rt(Qp,"useFocusOutside");function Hu(){const t=new CustomEvent(zu);document.dispatchEvent(t)}Rt(Hu,"dispatchUpdate");function Pu(t,r,i,{discrete:a}){const c=i.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:i});r&&c.addEventListener(t,r,{once:!0}),a?Cp(c,l):c.dispatchEvent(l)}Rt(Pu,"handleAndDispatchCustomEvent");var Aw=Object.defineProperty,xt=(t,r)=>Aw(t,"name",{value:r,configurable:!0}),Uu="focusScope.autoFocusOnMount",$u="focusScope.autoFocusOnUnmount",Fp={bubbles:!1,cancelable:!0},Zp=E.forwardRef(xt(function(r,i){const{loop:a=!1,trapped:c=!1,branches:l,onMountAutoFocus:u,onUnmountAutoFocus:d,...m}=r,[p,C]=E.useState(null),g=In(u),b=In(d),v=E.useRef(null),x=De(i,C),S=E.useRef(l);E.useEffect(()=>{S.current=l});const w=E.useCallback(R=>R?p?.contains(R)?!0:!!S.current?.some(O=>O.contains(R)):!1,[p]),T=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(c){let R=function(_){if(T.paused||!p)return;const I=_.target;w(I)?v.current=I:lr(v.current,{select:!0})},O=function(_){if(T.paused||!p)return;const I=_.relatedTarget;I!==null&&(w(I)||lr(v.current,{select:!0}))},M=function(_){if(document.activeElement===document.body)for(const z of _)z.removedNodes.length>0&&lr(p)};xt(R,"handleFocusIn"),xt(O,"handleFocusOut"),xt(M,"handleMutations"),document.addEventListener("focusin",R),document.addEventListener("focusout",O);const D=new MutationObserver(M);return p&&D.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",R),document.removeEventListener("focusout",O),D.disconnect()}}},[c,p,T.paused,w]),E.useEffect(()=>{if(p){ig.add(T);const R=document.activeElement;if(!p.contains(R)){const M=new CustomEvent(Uu,Fp);p.addEventListener(Uu,g),p.dispatchEvent(M),M.defaultPrevented||(ng(lg(Gu(p)),{select:!0}),document.activeElement===R&&lr(p))}return()=>{p.removeEventListener(Uu,g);const M=p.ownerDocument,D=CustomEvent;setTimeout(()=>{const _=new D($u,Fp);p.addEventListener($u,b),p.dispatchEvent(_),_.defaultPrevented||lr(R??M.body,{select:!0}),p.removeEventListener($u,b),ig.remove(T)},0)}}},[p,g,b,T]);const j=E.useCallback(R=>{if(!a&&!c||T.paused)return;const O=R.key==="Tab"&&!R.altKey&&!R.ctrlKey&&!R.metaKey,M=document.activeElement;if(O&&M){const D=R.currentTarget,[_,I]=rg(D);_&&I?!R.shiftKey&&M===I?(R.preventDefault(),a&&lr(_,{select:!0})):R.shiftKey&&M===_&&(R.preventDefault(),a&&lr(I,{select:!0})):M===D&&R.preventDefault()}},[a,c,T.paused]);return f.jsx(ze.div,{tabIndex:-1,...m,ref:x,onKeyDown:j})},"FocusScope")),Wp=E.createContext(null);function Jp({registry:t,children:r}){return t?f.jsx(Wp.Provider,{value:t,children:r}):r}xt(Jp,"FocusScopeBranchProvider");function eg(){const[t,r]=E.useState([]),i=E.useMemo(()=>({add:xt(a=>r(c=>c.includes(a)?c:[...c,a]),"add"),remove:xt(a=>r(c=>c.filter(l=>l!==a)),"remove")}),[]);return{nodes:t,registry:i}}xt(eg,"useFocusScopeBranchRegistry");function tg(t){const r=E.useContext(Wp);E.useEffect(()=>{if(!(!t||!r))return r.add(t),()=>r.remove(t)},[t,r])}xt(tg,"useFocusScopeBranch");function ng(t,{select:r=!1}={}){const i=document.activeElement;for(const a of t)if(lr(a,{select:r}),document.activeElement!==i)return}xt(ng,"focusFirst");function rg(t){const r=Gu(t),i=Vu(r,t),a=Vu(r.reverse(),t);return[i,a]}xt(rg,"getTabbableEdges");function Gu(t){const r=[],a=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:xt(c=>{const l=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||l?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)r.push(a.currentNode);return r}xt(Gu,"getTabbableCandidates");function Vu(t,r){const i=typeof r.checkVisibility=="function"&&r.checkVisibility({checkVisibilityCSS:!0});for(const a of t)if(!(i?!a.checkVisibility({checkVisibilityCSS:!0}):og(a,{upTo:r})))return a}xt(Vu,"findVisible");function og(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}xt(og,"isHidden");function ag(t){return t.tagName==="INPUT"&&typeof t.select=="function"}xt(ag,"isSelectableInput");function lr(t,{select:r=!1}={}){if(t&&t.focus){const a=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==a&&ag(t)&&r&&t.select()}}xt(lr,"focus");var ig=sg();function sg(){let t=[];return{add(r){const i=t[0];r!==i&&i?.pause(),t=qu(t,r),t.unshift(r)},remove(r){t=qu(t,r),t[0]?.resume()}}}xt(sg,"createFocusScopesStack");function qu(t,r){const i=[...t],a=i.indexOf(r);return a!==-1&&i.splice(a,1),i}xt(qu,"arrayRemove");function lg(t){return t.filter(r=>r.tagName!=="A")}xt(lg,"removeLinks");var Rw=Object.defineProperty,Ow=(t,r)=>Rw(t,"name",{value:r,configurable:!0}),Yu=E.forwardRef(Ow(function(r,i){const{container:a,...c}=r,[l,u]=E.useState(!1);st(()=>u(!0),[]);const d=a||l&&globalThis?.document?.body;return d?Hr.createPortal(f.jsx(ze.div,{...c,ref:i}),d):null},"Portal")),Nw=Object.defineProperty,Xu=(t,r)=>Nw(t,"name",{value:r,configurable:!0}),tl=0,fa=null;function Mw(t){return nl(),t.children}Xu(Mw,"FocusGuards");function nl(){E.useEffect(()=>{fa||(fa={start:Ku(),end:Ku()});const{start:t,end:r}=fa;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==r&&document.body.insertAdjacentElement("beforeend",r),tl++,()=>{tl===1&&(fa?.start.remove(),fa?.end.remove(),fa=null),tl=Math.max(0,tl-1)}},[])}Xu(nl,"useFocusGuards");function Ku(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Xu(Ku,"createFocusGuard");var Xn=function(){return Xn=Object.assign||function(r){for(var i,a=1,c=arguments.length;a<c;a++){i=arguments[a];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(r[l]=i[l])}return r},Xn.apply(this,arguments)};function cg(t,r){var i={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(t);c<a.length;c++)r.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(t,a[c])&&(i[a[c]]=t[a[c]]);return i}function _w(t,r,i){if(i||arguments.length===2)for(var a=0,c=r.length,l;a<c;a++)(l||!(a in r))&&(l||(l=Array.prototype.slice.call(r,0,a)),l[a]=r[a]);return t.concat(l||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;var rl="right-scroll-bar-position",ol="width-before-scroll-bar",Dw="with-scroll-bars-hidden",Iw="--removed-body-scroll-bar-size";function Qu(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function kw(t,r){var i=E.useState(function(){return{value:t,callback:r,facade:{get current(){return i.value},set current(a){var c=i.value;c!==a&&(i.value=a,i.callback(a,c))}}}})[0];return i.callback=r,i.facade}var Lw=typeof window<"u"?E.useLayoutEffect:E.useEffect,ug=new WeakMap;function zw(t,r){var i=kw(null,function(a){return t.forEach(function(c){return Qu(c,a)})});return Lw(function(){var a=ug.get(i);if(a){var c=new Set(a),l=new Set(t),u=i.current;c.forEach(function(d){l.has(d)||Qu(d,null)}),l.forEach(function(d){c.has(d)||Qu(d,u)})}ug.set(i,t)},[t]),i}function Bw(t){return t}function Hw(t,r){r===void 0&&(r=Bw);var i=[],a=!1,c={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:t},useMedium:function(l){var u=r(l,a);return i.push(u),function(){i=i.filter(function(d){return d!==u})}},assignSyncMedium:function(l){for(a=!0;i.length;){var u=i;i=[],u.forEach(l)}i={push:function(d){return l(d)},filter:function(){return i}}},assignMedium:function(l){a=!0;var u=[];if(i.length){var d=i;i=[],d.forEach(l),u=i}var m=function(){var C=u;u=[],C.forEach(l)},p=function(){return Promise.resolve().then(m)};p(),i={push:function(C){u.push(C),p()},filter:function(C){return u=u.filter(C),i}}}};return c}function Pw(t){t===void 0&&(t={});var r=Hw(null);return r.options=Xn({async:!0,ssr:!1},t),r}var dg=function(t){var r=t.sideCar,i=cg(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=r.read();if(!a)throw new Error("Sidecar medium not found");return E.createElement(a,Xn({},i))};dg.isSideCarExport=!0;function Uw(t,r){return t.useMedium(r),dg}var fg=Pw(),Fu=function(){},al=E.forwardRef(function(t,r){var i=E.useRef(null),a=E.useState({onScrollCapture:Fu,onWheelCapture:Fu,onTouchMoveCapture:Fu}),c=a[0],l=a[1],u=t.forwardProps,d=t.children,m=t.className,p=t.removeScrollBar,C=t.enabled,g=t.shards,b=t.sideCar,v=t.noRelative,x=t.noIsolation,S=t.inert,w=t.allowPinchZoom,T=t.as,j=T===void 0?"div":T,R=t.gapMode,O=cg(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,D=zw([i,r]),_=Xn(Xn({},O),c);return E.createElement(E.Fragment,null,C&&E.createElement(M,{sideCar:fg,removeScrollBar:p,shards:g,noRelative:v,noIsolation:x,inert:S,setCallbacks:l,allowPinchZoom:!!w,lockRef:i,gapMode:R}),u?E.cloneElement(E.Children.only(d),Xn(Xn({},_),{ref:D})):E.createElement(j,Xn({},_,{className:m,ref:D}),d))});al.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},al.classNames={fullWidth:ol,zeroRight:rl};var $w=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gw(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=$w();return r&&t.setAttribute("nonce",r),t}function Vw(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function qw(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var Yw=function(){var t=0,r=null;return{add:function(i){t==0&&(r=Gw())&&(Vw(r,i),qw(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},Xw=function(){var t=Yw();return function(r,i){E.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&i])}},hg=function(){var t=Xw(),r=function(i){var a=i.styles,c=i.dynamic;return t(a,c),null};return r},Kw={left:0,top:0,right:0,gap:0},Zu=function(t){return parseInt(t||"",10)||0},Qw=function(t){var r=window.getComputedStyle(document.body),i=r[t==="padding"?"paddingLeft":"marginLeft"],a=r[t==="padding"?"paddingTop":"marginTop"],c=r[t==="padding"?"paddingRight":"marginRight"];return[Zu(i),Zu(a),Zu(c)]},Fw=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Kw;var r=Qw(t),i=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-i+r[2]-r[0])}},Zw=hg(),ha="data-scroll-locked",Ww=function(t,r,i,a){var c=t.left,l=t.top,u=t.right,d=t.gap;return i===void 0&&(i="margin"),`
52
- .`.concat(Dw,` {
50
+ `+o.stack}}function Nn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vb(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function TO(e){var n=vb(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),s=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,y=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return h.call(this)},set:function(A){s=""+A,y.call(this,A)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(A){s=""+A},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Wl(e){e._valueTracker||(e._valueTracker=TO(e))}function Sb(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),s="";return e&&(s=vb(e)?e.checked?"true":"false":e.value),e=s,e!==o?(n.setValue(e),!0):!1}function Jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var jO=/[\n"\\]/g;function Mn(e){return e.replace(jO,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function hf(e,n,o,s,h,y,A,k){e.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.type=A:e.removeAttribute("type"),n!=null?A==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Nn(n)):e.value!==""+Nn(n)&&(e.value=""+Nn(n)):A!=="submit"&&A!=="reset"||e.removeAttribute("value"),n!=null?mf(e,A,Nn(n)):o!=null?mf(e,A,Nn(o)):s!=null&&e.removeAttribute("value"),h==null&&y!=null&&(e.defaultChecked=!!y),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+Nn(k):e.removeAttribute("name")}function Cb(e,n,o,s,h,y,A,k){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.type=y),n!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||n!=null))return;o=o!=null?""+Nn(o):"",n=n!=null?""+Nn(n):o,k||n===e.value||(e.value=n),e.defaultValue=n}s=s??h,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=k?e.checked:!!s,e.defaultChecked=!!s,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(e.name=A)}function mf(e,n,o){n==="number"&&Jl(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function Ha(e,n,o,s){if(e=e.options,n){n={};for(var h=0;h<o.length;h++)n["$"+o[h]]=!0;for(o=0;o<e.length;o++)h=n.hasOwnProperty("$"+e[o].value),e[o].selected!==h&&(e[o].selected=h),h&&s&&(e[o].defaultSelected=!0)}else{for(o=""+Nn(o),n=null,h=0;h<e.length;h++){if(e[h].value===o){e[h].selected=!0,s&&(e[h].defaultSelected=!0);return}n!==null||e[h].disabled||(n=e[h])}n!==null&&(n.selected=!0)}}function wb(e,n,o){if(n!=null&&(n=""+Nn(n),n!==e.value&&(e.value=n),o==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=o!=null?""+Nn(o):""}function Eb(e,n,o,s){if(n==null){if(s!=null){if(o!=null)throw Error(a(92));if(te(s)){if(1<s.length)throw Error(a(93));s=s[0]}o=s}o==null&&(o=""),n=o}o=Nn(n),e.defaultValue=o,s=e.textContent,s===o&&s!==""&&s!==null&&(e.value=s)}function Pa(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var AO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Tb(e,n,o){var s=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,o):typeof o!="number"||o===0||AO.has(n)?n==="float"?e.cssFloat=o:e[n]=(""+o).trim():e[n]=o+"px"}function jb(e,n,o){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,o!=null){for(var s in o)!o.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var h in n)s=n[h],n.hasOwnProperty(h)&&o[h]!==s&&Tb(e,h,s)}else for(var y in n)n.hasOwnProperty(y)&&Tb(e,y,n[y])}function pf(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var RO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),OO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ec(e){return OO.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var gf=null;function yf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ua=null,$a=null;function Ab(e){var n=ka(e);if(n&&(e=n.stateNode)){var o=e[on]||null;e:switch(e=n.stateNode,n.type){case"input":if(hf(e,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Mn(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var s=o[n];if(s!==e&&s.form===e.form){var h=s[on]||null;if(!h)throw Error(a(90));hf(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<o.length;n++)s=o[n],s.form===e.form&&Sb(s)}break e;case"textarea":wb(e,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&Ha(e,!!o.multiple,n,!1)}}}var bf=!1;function Rb(e,n,o){if(bf)return e(n,o);bf=!0;try{var s=e(n);return s}finally{if(bf=!1,(Ua!==null||$a!==null)&&(Hc(),Ua&&(n=Ua,e=$a,$a=Ua=null,Ab(n),e)))for(n=0;n<e.length;n++)Ab(e[n])}}function Ji(e,n){var o=e.stateNode;if(o===null)return null;var s=o[on]||null;if(s===null)return null;o=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(a(231,n,typeof o));return o}var Ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xf=!1;if(Ar)try{var es={};Object.defineProperty(es,"passive",{get:function(){xf=!0}}),window.addEventListener("test",es,es),window.removeEventListener("test",es,es)}catch{xf=!1}var oo=null,vf=null,tc=null;function Ob(){if(tc)return tc;var e,n=vf,o=n.length,s,h="value"in oo?oo.value:oo.textContent,y=h.length;for(e=0;e<o&&n[e]===h[e];e++);var A=o-e;for(s=1;s<=A&&n[o-s]===h[y-s];s++);return tc=h.slice(e,1<s?1-s:void 0)}function nc(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function rc(){return!0}function Nb(){return!1}function an(e){function n(o,s,h,y,A){this._reactName=o,this._targetInst=h,this.type=s,this.nativeEvent=y,this.target=A,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(o=e[k],this[k]=o?o(y):y[k]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?rc:Nb,this.isPropagationStopped=Nb,this}return C(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=rc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=rc)},persist:function(){},isPersistent:rc}),n}var qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oc=an(qo),ts=C({},qo,{view:0,detail:0}),NO=an(ts),Sf,Cf,ns,ac=C({},ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ef,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ns&&(ns&&e.type==="mousemove"?(Sf=e.screenX-ns.screenX,Cf=e.screenY-ns.screenY):Cf=Sf=0,ns=e),Sf)},movementY:function(e){return"movementY"in e?e.movementY:Cf}}),Mb=an(ac),MO=C({},ac,{dataTransfer:0}),_O=an(MO),DO=C({},ts,{relatedTarget:0}),wf=an(DO),IO=C({},qo,{animationName:0,elapsedTime:0,pseudoElement:0}),kO=an(IO),LO=C({},qo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zO=an(LO),BO=C({},qo,{data:0}),_b=an(BO),HO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},UO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $O(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=UO[e])?!!n[e]:!1}function Ef(){return $O}var GO=C({},ts,{key:function(e){if(e.key){var n=HO[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=nc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?PO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ef,charCode:function(e){return e.type==="keypress"?nc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),VO=an(GO),qO=C({},ac,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Db=an(qO),YO=C({},ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ef}),XO=an(YO),KO=C({},qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),FO=an(KO),QO=C({},ac,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ZO=an(QO),WO=C({},qo,{newState:0,oldState:0}),JO=an(WO),eN=[9,13,27,32],Tf=Ar&&"CompositionEvent"in window,rs=null;Ar&&"documentMode"in document&&(rs=document.documentMode);var tN=Ar&&"TextEvent"in window&&!rs,Ib=Ar&&(!Tf||rs&&8<rs&&11>=rs),kb=" ",Lb=!1;function zb(e,n){switch(e){case"keyup":return eN.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ga=!1;function nN(e,n){switch(e){case"compositionend":return Bb(n);case"keypress":return n.which!==32?null:(Lb=!0,kb);case"textInput":return e=n.data,e===kb&&Lb?null:e;default:return null}}function rN(e,n){if(Ga)return e==="compositionend"||!Tf&&zb(e,n)?(e=Ob(),tc=vf=oo=null,Ga=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Ib&&n.locale!=="ko"?null:n.data;default:return null}}var oN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hb(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!oN[e.type]:n==="textarea"}function Pb(e,n,o,s){Ua?$a?$a.push(s):$a=[s]:Ua=s,n=qc(n,"onChange"),0<n.length&&(o=new oc("onChange","change",null,o,s),e.push({event:o,listeners:n}))}var os=null,as=null;function aN(e){v1(e,0)}function ic(e){var n=Wi(e);if(Sb(n))return e}function Ub(e,n){if(e==="change")return n}var $b=!1;if(Ar){var jf;if(Ar){var Af="oninput"in document;if(!Af){var Gb=document.createElement("div");Gb.setAttribute("oninput","return;"),Af=typeof Gb.oninput=="function"}jf=Af}else jf=!1;$b=jf&&(!document.documentMode||9<document.documentMode)}function Vb(){os&&(os.detachEvent("onpropertychange",qb),as=os=null)}function qb(e){if(e.propertyName==="value"&&ic(as)){var n=[];Pb(n,as,e,yf(e)),Rb(aN,n)}}function iN(e,n,o){e==="focusin"?(Vb(),os=n,as=o,os.attachEvent("onpropertychange",qb)):e==="focusout"&&Vb()}function sN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ic(as)}function lN(e,n){if(e==="click")return ic(n)}function cN(e,n){if(e==="input"||e==="change")return ic(n)}function uN(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var mn=typeof Object.is=="function"?Object.is:uN;function is(e,n){if(mn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),s=Object.keys(n);if(o.length!==s.length)return!1;for(s=0;s<o.length;s++){var h=o[s];if(!De.call(n,h)||!mn(e[h],n[h]))return!1}return!0}function Yb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xb(e,n){var o=Yb(e);e=0;for(var s;o;){if(o.nodeType===3){if(s=e+o.textContent.length,e<=n&&s>=n)return{node:o,offset:n-e};e=s}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Yb(o)}}function Kb(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Kb(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Fb(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Jl(e.document);n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Jl(e.document)}return n}function Rf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var dN=Ar&&"documentMode"in document&&11>=document.documentMode,Va=null,Of=null,ss=null,Nf=!1;function Qb(e,n,o){var s=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Nf||Va==null||Va!==Jl(s)||(s=Va,"selectionStart"in s&&Rf(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ss&&is(ss,s)||(ss=s,s=qc(Of,"onSelect"),0<s.length&&(n=new oc("onSelect","select",null,n,o),e.push({event:n,listeners:s}),n.target=Va)))}function Yo(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var qa={animationend:Yo("Animation","AnimationEnd"),animationiteration:Yo("Animation","AnimationIteration"),animationstart:Yo("Animation","AnimationStart"),transitionrun:Yo("Transition","TransitionRun"),transitionstart:Yo("Transition","TransitionStart"),transitioncancel:Yo("Transition","TransitionCancel"),transitionend:Yo("Transition","TransitionEnd")},Mf={},Zb={};Ar&&(Zb=document.createElement("div").style,"AnimationEvent"in window||(delete qa.animationend.animation,delete qa.animationiteration.animation,delete qa.animationstart.animation),"TransitionEvent"in window||delete qa.transitionend.transition);function Xo(e){if(Mf[e])return Mf[e];if(!qa[e])return e;var n=qa[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Zb)return Mf[e]=n[o];return e}var Wb=Xo("animationend"),Jb=Xo("animationiteration"),ex=Xo("animationstart"),fN=Xo("transitionrun"),hN=Xo("transitionstart"),mN=Xo("transitioncancel"),tx=Xo("transitionend"),nx=new Map,_f="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");_f.push("scrollEnd");function Vn(e,n){nx.set(e,n),Vo(n,[e])}var rx=new WeakMap;function _n(e,n){if(typeof e=="object"&&e!==null){var o=rx.get(e);return o!==void 0?o:(n={value:e,source:n,stack:xb(n)},rx.set(e,n),n)}return{value:e,source:n,stack:xb(n)}}var Dn=[],Ya=0,Df=0;function sc(){for(var e=Ya,n=Df=Ya=0;n<e;){var o=Dn[n];Dn[n++]=null;var s=Dn[n];Dn[n++]=null;var h=Dn[n];Dn[n++]=null;var y=Dn[n];if(Dn[n++]=null,s!==null&&h!==null){var A=s.pending;A===null?h.next=h:(h.next=A.next,A.next=h),s.pending=h}y!==0&&ox(o,h,y)}}function lc(e,n,o,s){Dn[Ya++]=e,Dn[Ya++]=n,Dn[Ya++]=o,Dn[Ya++]=s,Df|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function If(e,n,o,s){return lc(e,n,o,s),cc(e)}function Xa(e,n){return lc(e,null,null,n),cc(e)}function ox(e,n,o){e.lanes|=o;var s=e.alternate;s!==null&&(s.lanes|=o);for(var h=!1,y=e.return;y!==null;)y.childLanes|=o,s=y.alternate,s!==null&&(s.childLanes|=o),y.tag===22&&(e=y.stateNode,e===null||e._visibility&1||(h=!0)),e=y,y=y.return;return e.tag===3?(y=e.stateNode,h&&n!==null&&(h=31-Ht(o),e=y.hiddenUpdates,s=e[h],s===null?e[h]=[n]:s.push(n),n.lane=o|536870912),y):null}function cc(e){if(50<_s)throw _s=0,Ph=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ka={};function pN(e,n,o,s){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pn(e,n,o,s){return new pN(e,n,o,s)}function kf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rr(e,n){var o=e.alternate;return o===null?(o=pn(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&65011712,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o.refCleanup=e.refCleanup,o}function ax(e,n){e.flags&=65011714;var o=e.alternate;return o===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=o.childLanes,e.lanes=o.lanes,e.child=o.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=o.memoizedProps,e.memoizedState=o.memoizedState,e.updateQueue=o.updateQueue,e.type=o.type,n=o.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function uc(e,n,o,s,h,y){var A=0;if(s=e,typeof e=="function")kf(e)&&(A=1);else if(typeof e=="string")A=yM(e,o,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=pn(31,o,n,h),e.elementType=B,e.lanes=y,e;case v:return Ko(o.children,h,y,n);case S:A=8,h|=24;break;case w:return e=pn(12,o,n,h|2),e.elementType=w,e.lanes=y,e;case M:return e=pn(13,o,n,h),e.elementType=M,e.lanes=y,e;case D:return e=pn(19,o,n,h),e.elementType=D,e.lanes=y,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:case R:A=10;break e;case j:A=9;break e;case O:A=11;break e;case _:A=14;break e;case I:A=16,s=null;break e}A=29,o=Error(a(130,e===null?"null":typeof e,"")),s=null}return n=pn(A,o,n,h),n.elementType=e,n.type=s,n.lanes=y,n}function Ko(e,n,o,s){return e=pn(7,e,s,n),e.lanes=o,e}function Lf(e,n,o){return e=pn(6,e,null,n),e.lanes=o,e}function zf(e,n,o){return n=pn(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Fa=[],Qa=0,dc=null,fc=0,In=[],kn=0,Fo=null,Or=1,Nr="";function Qo(e,n){Fa[Qa++]=fc,Fa[Qa++]=dc,dc=e,fc=n}function ix(e,n,o){In[kn++]=Or,In[kn++]=Nr,In[kn++]=Fo,Fo=e;var s=Or;e=Nr;var h=32-Ht(s)-1;s&=~(1<<h),o+=1;var y=32-Ht(n)+h;if(30<y){var A=h-h%5;y=(s&(1<<A)-1).toString(32),s>>=A,h-=A,Or=1<<32-Ht(n)+h|o<<h|s,Nr=y+e}else Or=1<<y|o<<h|s,Nr=e}function Bf(e){e.return!==null&&(Qo(e,1),ix(e,1,0))}function Hf(e){for(;e===dc;)dc=Fa[--Qa],Fa[Qa]=null,fc=Fa[--Qa],Fa[Qa]=null;for(;e===Fo;)Fo=In[--kn],In[kn]=null,Nr=In[--kn],In[kn]=null,Or=In[--kn],In[kn]=null}var tn=null,mt=null,Ke=!1,Zo=null,or=!1,Pf=Error(a(519));function Wo(e){var n=Error(a(418,""));throw us(_n(n,e)),Pf}function sx(e){var n=e.stateNode,o=e.type,s=e.memoizedProps;switch(n[Qt]=e,n[on]=s,o){case"dialog":Ue("cancel",n),Ue("close",n);break;case"iframe":case"object":case"embed":Ue("load",n);break;case"video":case"audio":for(o=0;o<Is.length;o++)Ue(Is[o],n);break;case"source":Ue("error",n);break;case"img":case"image":case"link":Ue("error",n),Ue("load",n);break;case"details":Ue("toggle",n);break;case"input":Ue("invalid",n),Cb(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),Wl(n);break;case"select":Ue("invalid",n);break;case"textarea":Ue("invalid",n),Eb(n,s.value,s.defaultValue,s.children),Wl(n)}o=s.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||s.suppressHydrationWarning===!0||E1(n.textContent,o)?(s.popover!=null&&(Ue("beforetoggle",n),Ue("toggle",n)),s.onScroll!=null&&Ue("scroll",n),s.onScrollEnd!=null&&Ue("scrollend",n),s.onClick!=null&&(n.onclick=Yc),n=!0):n=!1,n||Wo(e)}function lx(e){for(tn=e.return;tn;)switch(tn.tag){case 5:case 13:or=!1;return;case 27:case 3:or=!0;return;default:tn=tn.return}}function ls(e){if(e!==tn)return!1;if(!Ke)return lx(e),Ke=!0,!1;var n=e.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=e.type,o=!(o!=="form"&&o!=="button")||nm(e.type,e.memoizedProps)),o=!o),o&&mt&&Wo(e),lx(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8)if(o=e.data,o==="/$"){if(n===0){mt=Yn(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++;e=e.nextSibling}mt=null}}else n===27?(n=mt,So(e.type)?(e=im,im=null,mt=e):mt=n):mt=tn?Yn(e.stateNode.nextSibling):null;return!0}function cs(){mt=tn=null,Ke=!1}function cx(){var e=Zo;return e!==null&&(cn===null?cn=e:cn.push.apply(cn,e),Zo=null),e}function us(e){Zo===null?Zo=[e]:Zo.push(e)}var Uf=U(null),Jo=null,Mr=null;function ao(e,n,o){Q(Uf,n._currentValue),n._currentValue=o}function _r(e){e._currentValue=Uf.current,J(Uf)}function $f(e,n,o){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===o)break;e=e.return}}function Gf(e,n,o,s){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var y=h.dependencies;if(y!==null){var A=h.child;y=y.firstContext;e:for(;y!==null;){var k=y;y=h;for(var q=0;q<n.length;q++)if(k.context===n[q]){y.lanes|=o,k=y.alternate,k!==null&&(k.lanes|=o),$f(y.return,o,e),s||(A=null);break e}y=k.next}}else if(h.tag===18){if(A=h.return,A===null)throw Error(a(341));A.lanes|=o,y=A.alternate,y!==null&&(y.lanes|=o),$f(A,o,e),A=null}else A=h.child;if(A!==null)A.return=h;else for(A=h;A!==null;){if(A===e){A=null;break}if(h=A.sibling,h!==null){h.return=A.return,A=h;break}A=A.return}h=A}}function ds(e,n,o,s){e=null;for(var h=n,y=!1;h!==null;){if(!y){if((h.flags&524288)!==0)y=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var A=h.alternate;if(A===null)throw Error(a(387));if(A=A.memoizedProps,A!==null){var k=h.type;mn(h.pendingProps.value,A.value)||(e!==null?e.push(k):e=[k])}}else if(h===ge.current){if(A=h.alternate,A===null)throw Error(a(387));A.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(Ps):e=[Ps])}h=h.return}e!==null&&Gf(n,e,o,s),n.flags|=262144}function hc(e){for(e=e.firstContext;e!==null;){if(!mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Jo=e,Mr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zt(e){return ux(Jo,e)}function mc(e,n){return Jo===null&&ea(e),ux(e,n)}function ux(e,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},Mr===null){if(e===null)throw Error(a(308));Mr=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Mr=Mr.next=n;return o}var gN=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(o,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(o){return o()})}},yN=t.unstable_scheduleCallback,bN=t.unstable_NormalPriority,Rt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vf(){return{controller:new gN,data:new Map,refCount:0}}function fs(e){e.refCount--,e.refCount===0&&yN(bN,function(){e.controller.abort()})}var hs=null,qf=0,Za=0,Wa=null;function xN(e,n){if(hs===null){var o=hs=[];qf=0,Za=Xh(),Wa={status:"pending",value:void 0,then:function(s){o.push(s)}}}return qf++,n.then(dx,dx),n}function dx(){if(--qf===0&&hs!==null){Wa!==null&&(Wa.status="fulfilled");var e=hs;hs=null,Za=0,Wa=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function vN(e,n){var o=[],s={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var h=0;h<o.length;h++)(0,o[h])(n)},function(h){for(s.status="rejected",s.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),s}var fx=V.S;V.S=function(e,n){typeof n=="object"&&n!==null&&typeof n.then=="function"&&xN(e,n),fx!==null&&fx(e,n)};var ta=U(null);function Yf(){var e=ta.current;return e!==null?e:rt.pooledCache}function pc(e,n){n===null?Q(ta,ta.current):Q(ta,n.pool)}function hx(){var e=Yf();return e===null?null:{parent:Rt._currentValue,pool:e}}var ms=Error(a(460)),mx=Error(a(474)),gc=Error(a(542)),Xf={then:function(){}};function px(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yc(){}function gx(e,n,o){switch(o=e[o],o===void 0?e.push(n):o!==n&&(n.then(yc,yc),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,bx(e),e;default:if(typeof n.status=="string")n.then(yc,yc);else{if(e=rt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=s}},function(s){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,bx(e),e}throw ps=n,ms}}var ps=null;function yx(){if(ps===null)throw Error(a(459));var e=ps;return ps=null,e}function bx(e){if(e===ms||e===gc)throw Error(a(483))}var io=!1;function Kf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ff(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function so(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function lo(e,n,o){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Fe&2)!==0){var h=s.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),s.pending=n,n=cc(e),ox(e,null,o),n}return lc(e,s,n,o),cc(e)}function gs(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,Qi(e,o)}}function Qf(e,n){var o=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,o===s)){var h=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var A={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?h=y=A:y=y.next=A,o=o.next}while(o!==null);y===null?h=y=n:y=y.next=n}else h=y=n;o={baseState:s.baseState,firstBaseUpdate:h,lastBaseUpdate:y,shared:s.shared,callbacks:s.callbacks},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}var Zf=!1;function ys(){if(Zf){var e=Wa;if(e!==null)throw e}}function bs(e,n,o,s){Zf=!1;var h=e.updateQueue;io=!1;var y=h.firstBaseUpdate,A=h.lastBaseUpdate,k=h.shared.pending;if(k!==null){h.shared.pending=null;var q=k,W=q.next;q.next=null,A===null?y=W:A.next=W,A=q;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,k=oe.lastBaseUpdate,k!==A&&(k===null?oe.firstBaseUpdate=W:k.next=W,oe.lastBaseUpdate=q))}if(y!==null){var se=h.baseState;A=0,oe=W=q=null,k=y;do{var ee=k.lane&-536870913,ne=ee!==k.lane;if(ne?(Ge&ee)===ee:(s&ee)===ee){ee!==0&&ee===Za&&(Zf=!0),oe!==null&&(oe=oe.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ae=e,Ee=k;ee=n;var Je=o;switch(Ee.tag){case 1:if(Ae=Ee.payload,typeof Ae=="function"){se=Ae.call(Je,se,ee);break e}se=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Ee.payload,ee=typeof Ae=="function"?Ae.call(Je,se,ee):Ae,ee==null)break e;se=C({},se,ee);break e;case 2:io=!0}}ee=k.callback,ee!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=h.callbacks,ne===null?h.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:k.tag,payload:k.payload,callback:k.callback,next:null},oe===null?(W=oe=ne,q=se):oe=oe.next=ne,A|=ee;if(k=k.next,k===null){if(k=h.shared.pending,k===null)break;ne=k,k=ne.next,ne.next=null,h.lastBaseUpdate=ne,h.shared.pending=null}}while(!0);oe===null&&(q=se),h.baseState=q,h.firstBaseUpdate=W,h.lastBaseUpdate=oe,y===null&&(h.shared.lanes=0),yo|=A,e.lanes=A,e.memoizedState=se}}function xx(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function vx(e,n){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)xx(o[e],n)}var Ja=U(null),bc=U(0);function Sx(e,n){e=Hr,Q(bc,e),Q(Ja,n),Hr=e|n.baseLanes}function Wf(){Q(bc,Hr),Q(Ja,Ja.current)}function Jf(){Hr=bc.current,J(Ja),J(bc)}var co=0,Le=null,Ze=null,Ct=null,xc=!1,ei=!1,na=!1,vc=0,xs=0,ti=null,SN=0;function yt(){throw Error(a(321))}function eh(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!mn(e[o],n[o]))return!1;return!0}function th(e,n,o,s,h,y){return co=y,Le=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=e===null||e.memoizedState===null?ov:av,na=!1,y=o(s,h),na=!1,ei&&(y=wx(n,o,s,h)),Cx(e),y}function Cx(e){V.H=jc;var n=Ze!==null&&Ze.next!==null;if(co=0,Ct=Ze=Le=null,xc=!1,xs=0,ti=null,n)throw Error(a(300));e===null||Dt||(e=e.dependencies,e!==null&&hc(e)&&(Dt=!0))}function wx(e,n,o,s){Le=e;var h=0;do{if(ei&&(ti=null),xs=0,ei=!1,25<=h)throw Error(a(301));if(h+=1,Ct=Ze=null,e.updateQueue!=null){var y=e.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}V.H=RN,y=n(o,s)}while(ei);return y}function CN(){var e=V.H,n=e.useState()[0];return n=typeof n.then=="function"?vs(n):n,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(Le.flags|=1024),n}function nh(){var e=vc!==0;return vc=0,e}function rh(e,n,o){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~o}function oh(e){if(xc){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}xc=!1}co=0,Ct=Ze=Le=null,ei=!1,xs=vc=0,ti=null}function sn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Le.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function wt(){if(Ze===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var n=Ct===null?Le.memoizedState:Ct.next;if(n!==null)Ct=n,Ze=e;else{if(e===null)throw Le.alternate===null?Error(a(467)):Error(a(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},Ct===null?Le.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function ah(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vs(e){var n=xs;return xs+=1,ti===null&&(ti=[]),e=gx(ti,e,n),n=Le,(Ct===null?n.memoizedState:Ct.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?ov:av),e}function Sc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vs(e);if(e.$$typeof===R)return Zt(e)}throw Error(a(438,String(e)))}function ih(e){var n=null,o=Le.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var s=Le.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=ah(),Le.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(e),s=0;s<e;s++)o[s]=H;return n.index++,o}function Dr(e,n){return typeof n=="function"?n(e):n}function Cc(e){var n=wt();return sh(n,Ze,e)}function sh(e,n,o){var s=e.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=o;var h=e.baseQueue,y=s.pending;if(y!==null){if(h!==null){var A=h.next;h.next=y.next,y.next=A}n.baseQueue=h=y,s.pending=null}if(y=e.baseState,h===null)e.memoizedState=y;else{n=h.next;var k=A=null,q=null,W=n,oe=!1;do{var se=W.lane&-536870913;if(se!==W.lane?(Ge&se)===se:(co&se)===se){var ee=W.revertLane;if(ee===0)q!==null&&(q=q.next={lane:0,revertLane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),se===Za&&(oe=!0);else if((co&ee)===ee){W=W.next,ee===Za&&(oe=!0);continue}else se={lane:0,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},q===null?(k=q=se,A=y):q=q.next=se,Le.lanes|=ee,yo|=ee;se=W.action,na&&o(y,se),y=W.hasEagerState?W.eagerState:o(y,se)}else ee={lane:se,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},q===null?(k=q=ee,A=y):q=q.next=ee,Le.lanes|=se,yo|=se;W=W.next}while(W!==null&&W!==n);if(q===null?A=y:q.next=k,!mn(y,e.memoizedState)&&(Dt=!0,oe&&(o=Wa,o!==null)))throw o;e.memoizedState=y,e.baseState=A,e.baseQueue=q,s.lastRenderedState=y}return h===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function lh(e){var n=wt(),o=n.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=e;var s=o.dispatch,h=o.pending,y=n.memoizedState;if(h!==null){o.pending=null;var A=h=h.next;do y=e(y,A.action),A=A.next;while(A!==h);mn(y,n.memoizedState)||(Dt=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),o.lastRenderedState=y}return[y,s]}function Ex(e,n,o){var s=Le,h=wt(),y=Ke;if(y){if(o===void 0)throw Error(a(407));o=o()}else o=n();var A=!mn((Ze||h).memoizedState,o);A&&(h.memoizedState=o,Dt=!0),h=h.queue;var k=Ax.bind(null,s,h,e);if(Ss(2048,8,k,[e]),h.getSnapshot!==n||A||Ct!==null&&Ct.memoizedState.tag&1){if(s.flags|=2048,ni(9,wc(),jx.bind(null,s,h,o,n),null),rt===null)throw Error(a(349));y||(co&124)!==0||Tx(s,n,o)}return o}function Tx(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Le.updateQueue,n===null?(n=ah(),Le.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function jx(e,n,o,s){n.value=o,n.getSnapshot=s,Rx(n)&&Ox(e)}function Ax(e,n,o){return o(function(){Rx(n)&&Ox(e)})}function Rx(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!mn(e,o)}catch{return!0}}function Ox(e){var n=Xa(e,2);n!==null&&vn(n,e,2)}function ch(e){var n=sn();if(typeof e=="function"){var o=e;if(e=o(),na){Rn(!0);try{o()}finally{Rn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:e},n}function Nx(e,n,o,s){return e.baseState=o,sh(e,Ze,typeof s=="function"?s:Dr)}function wN(e,n,o,s,h){if(Tc(e))throw Error(a(485));if(e=n.action,e!==null){var y={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){y.listeners.push(A)}};V.T!==null?o(!0):y.isTransition=!1,s(y),o=n.pending,o===null?(y.next=n.pending=y,Mx(n,y)):(y.next=o.next,n.pending=o.next=y)}}function Mx(e,n){var o=n.action,s=n.payload,h=e.state;if(n.isTransition){var y=V.T,A={};V.T=A;try{var k=o(h,s),q=V.S;q!==null&&q(A,k),_x(e,n,k)}catch(W){uh(e,n,W)}finally{V.T=y}}else try{y=o(h,s),_x(e,n,y)}catch(W){uh(e,n,W)}}function _x(e,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(s){Dx(e,n,s)},function(s){return uh(e,n,s)}):Dx(e,n,o)}function Dx(e,n,o){n.status="fulfilled",n.value=o,Ix(n),e.state=o,n=e.pending,n!==null&&(o=n.next,o===n?e.pending=null:(o=o.next,n.next=o,Mx(e,o)))}function uh(e,n,o){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=o,Ix(n),n=n.next;while(n!==s)}e.action=null}function Ix(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function kx(e,n){return n}function Lx(e,n){if(Ke){var o=rt.formState;if(o!==null){e:{var s=Le;if(Ke){if(mt){t:{for(var h=mt,y=or;h.nodeType!==8;){if(!y){h=null;break t}if(h=Yn(h.nextSibling),h===null){h=null;break t}}y=h.data,h=y==="F!"||y==="F"?h:null}if(h){mt=Yn(h.nextSibling),s=h.data==="F!";break e}}Wo(s)}s=!1}s&&(n=o[0])}}return o=sn(),o.memoizedState=o.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kx,lastRenderedState:n},o.queue=s,o=tv.bind(null,Le,s),s.dispatch=o,s=ch(!1),y=ph.bind(null,Le,!1,s.queue),s=sn(),h={state:n,dispatch:null,action:e,pending:null},s.queue=h,o=wN.bind(null,Le,h,y,o),h.dispatch=o,s.memoizedState=e,[n,o,!1]}function zx(e){var n=wt();return Bx(n,Ze,e)}function Bx(e,n,o){if(n=sh(e,n,kx)[0],e=Cc(Dr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=vs(n)}catch(A){throw A===ms?gc:A}else s=n;n=wt();var h=n.queue,y=h.dispatch;return o!==n.memoizedState&&(Le.flags|=2048,ni(9,wc(),EN.bind(null,h,o),null)),[s,y,e]}function EN(e,n){e.action=n}function Hx(e){var n=wt(),o=Ze;if(o!==null)return Bx(n,o,e);wt(),n=n.memoizedState,o=wt();var s=o.queue.dispatch;return o.memoizedState=e,[n,s,!1]}function ni(e,n,o,s){return e={tag:e,create:o,deps:s,inst:n,next:null},n=Le.updateQueue,n===null&&(n=ah(),Le.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=e.next=e:(s=o.next,o.next=e,e.next=s,n.lastEffect=e),e}function wc(){return{destroy:void 0,resource:void 0}}function Px(){return wt().memoizedState}function Ec(e,n,o,s){var h=sn();s=s===void 0?null:s,Le.flags|=e,h.memoizedState=ni(1|n,wc(),o,s)}function Ss(e,n,o,s){var h=wt();s=s===void 0?null:s;var y=h.memoizedState.inst;Ze!==null&&s!==null&&eh(s,Ze.memoizedState.deps)?h.memoizedState=ni(n,y,o,s):(Le.flags|=e,h.memoizedState=ni(1|n,y,o,s))}function Ux(e,n){Ec(8390656,8,e,n)}function $x(e,n){Ss(2048,8,e,n)}function Gx(e,n){return Ss(4,2,e,n)}function Vx(e,n){return Ss(4,4,e,n)}function qx(e,n){if(typeof n=="function"){e=e();var o=n(e);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Yx(e,n,o){o=o!=null?o.concat([e]):null,Ss(4,4,qx.bind(null,n,e),o)}function dh(){}function Xx(e,n){var o=wt();n=n===void 0?null:n;var s=o.memoizedState;return n!==null&&eh(n,s[1])?s[0]:(o.memoizedState=[e,n],e)}function Kx(e,n){var o=wt();n=n===void 0?null:n;var s=o.memoizedState;if(n!==null&&eh(n,s[1]))return s[0];if(s=e(),na){Rn(!0);try{e()}finally{Rn(!1)}}return o.memoizedState=[s,n],s}function fh(e,n,o){return o===void 0||(co&1073741824)!==0?e.memoizedState=n:(e.memoizedState=o,e=Zv(),Le.lanes|=e,yo|=e,o)}function Fx(e,n,o,s){return mn(o,n)?o:Ja.current!==null?(e=fh(e,o,s),mn(e,n)||(Dt=!0),e):(co&42)===0?(Dt=!0,e.memoizedState=o):(e=Zv(),Le.lanes|=e,yo|=e,n)}function Qx(e,n,o,s,h){var y=Y.p;Y.p=y!==0&&8>y?y:8;var A=V.T,k={};V.T=k,ph(e,!1,n,o);try{var q=h(),W=V.S;if(W!==null&&W(k,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var oe=vN(q,s);Cs(e,n,oe,xn(e))}else Cs(e,n,s,xn(e))}catch(se){Cs(e,n,{then:function(){},status:"rejected",reason:se},xn())}finally{Y.p=y,V.T=A}}function TN(){}function hh(e,n,o,s){if(e.tag!==5)throw Error(a(476));var h=Zx(e).queue;Qx(e,h,n,L,o===null?TN:function(){return Wx(e),o(s)})}function Zx(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:L},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:o},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Wx(e){var n=Zx(e).next.queue;Cs(e,n,{},xn())}function mh(){return Zt(Ps)}function Jx(){return wt().memoizedState}function ev(){return wt().memoizedState}function jN(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var o=xn();e=so(o);var s=lo(n,e,o);s!==null&&(vn(s,n,o),gs(s,n,o)),n={cache:Vf()},e.payload=n;return}n=n.return}}function AN(e,n,o){var s=xn();o={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Tc(e)?nv(n,o):(o=If(e,n,o,s),o!==null&&(vn(o,e,s),rv(o,n,s)))}function tv(e,n,o){var s=xn();Cs(e,n,o,s)}function Cs(e,n,o,s){var h={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Tc(e))nv(n,h);else{var y=e.alternate;if(e.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null))try{var A=n.lastRenderedState,k=y(A,o);if(h.hasEagerState=!0,h.eagerState=k,mn(k,A))return lc(e,n,h,0),rt===null&&sc(),!1}catch{}finally{}if(o=If(e,n,h,s),o!==null)return vn(o,e,s),rv(o,n,s),!0}return!1}function ph(e,n,o,s){if(s={lane:2,revertLane:Xh(),action:s,hasEagerState:!1,eagerState:null,next:null},Tc(e)){if(n)throw Error(a(479))}else n=If(e,o,s,2),n!==null&&vn(n,e,2)}function Tc(e){var n=e.alternate;return e===Le||n!==null&&n===Le}function nv(e,n){ei=xc=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function rv(e,n,o){if((o&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,Qi(e,o)}}var jc={readContext:Zt,use:Sc,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt},ov={readContext:Zt,use:Sc,useCallback:function(e,n){return sn().memoizedState=[e,n===void 0?null:n],e},useContext:Zt,useEffect:Ux,useImperativeHandle:function(e,n,o){o=o!=null?o.concat([e]):null,Ec(4194308,4,qx.bind(null,n,e),o)},useLayoutEffect:function(e,n){return Ec(4194308,4,e,n)},useInsertionEffect:function(e,n){Ec(4,2,e,n)},useMemo:function(e,n){var o=sn();n=n===void 0?null:n;var s=e();if(na){Rn(!0);try{e()}finally{Rn(!1)}}return o.memoizedState=[s,n],s},useReducer:function(e,n,o){var s=sn();if(o!==void 0){var h=o(n);if(na){Rn(!0);try{o(n)}finally{Rn(!1)}}}else h=n;return s.memoizedState=s.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},s.queue=e,e=e.dispatch=AN.bind(null,Le,e),[s.memoizedState,e]},useRef:function(e){var n=sn();return e={current:e},n.memoizedState=e},useState:function(e){e=ch(e);var n=e.queue,o=tv.bind(null,Le,n);return n.dispatch=o,[e.memoizedState,o]},useDebugValue:dh,useDeferredValue:function(e,n){var o=sn();return fh(o,e,n)},useTransition:function(){var e=ch(!1);return e=Qx.bind(null,Le,e.queue,!0,!1),sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,o){var s=Le,h=sn();if(Ke){if(o===void 0)throw Error(a(407));o=o()}else{if(o=n(),rt===null)throw Error(a(349));(Ge&124)!==0||Tx(s,n,o)}h.memoizedState=o;var y={value:o,getSnapshot:n};return h.queue=y,Ux(Ax.bind(null,s,y,e),[e]),s.flags|=2048,ni(9,wc(),jx.bind(null,s,y,o,n),null),o},useId:function(){var e=sn(),n=rt.identifierPrefix;if(Ke){var o=Nr,s=Or;o=(s&~(1<<32-Ht(s)-1)).toString(32)+o,n="«"+n+"R"+o,o=vc++,0<o&&(n+="H"+o.toString(32)),n+="»"}else o=SN++,n="«"+n+"r"+o.toString(32)+"»";return e.memoizedState=n},useHostTransitionStatus:mh,useFormState:Lx,useActionState:Lx,useOptimistic:function(e){var n=sn();n.memoizedState=n.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=ph.bind(null,Le,!0,o),o.dispatch=n,[e,n]},useMemoCache:ih,useCacheRefresh:function(){return sn().memoizedState=jN.bind(null,Le)}},av={readContext:Zt,use:Sc,useCallback:Xx,useContext:Zt,useEffect:$x,useImperativeHandle:Yx,useInsertionEffect:Gx,useLayoutEffect:Vx,useMemo:Kx,useReducer:Cc,useRef:Px,useState:function(){return Cc(Dr)},useDebugValue:dh,useDeferredValue:function(e,n){var o=wt();return Fx(o,Ze.memoizedState,e,n)},useTransition:function(){var e=Cc(Dr)[0],n=wt().memoizedState;return[typeof e=="boolean"?e:vs(e),n]},useSyncExternalStore:Ex,useId:Jx,useHostTransitionStatus:mh,useFormState:zx,useActionState:zx,useOptimistic:function(e,n){var o=wt();return Nx(o,Ze,e,n)},useMemoCache:ih,useCacheRefresh:ev},RN={readContext:Zt,use:Sc,useCallback:Xx,useContext:Zt,useEffect:$x,useImperativeHandle:Yx,useInsertionEffect:Gx,useLayoutEffect:Vx,useMemo:Kx,useReducer:lh,useRef:Px,useState:function(){return lh(Dr)},useDebugValue:dh,useDeferredValue:function(e,n){var o=wt();return Ze===null?fh(o,e,n):Fx(o,Ze.memoizedState,e,n)},useTransition:function(){var e=lh(Dr)[0],n=wt().memoizedState;return[typeof e=="boolean"?e:vs(e),n]},useSyncExternalStore:Ex,useId:Jx,useHostTransitionStatus:mh,useFormState:Hx,useActionState:Hx,useOptimistic:function(e,n){var o=wt();return Ze!==null?Nx(o,Ze,e,n):(o.baseState=e,[e,o.queue.dispatch])},useMemoCache:ih,useCacheRefresh:ev},ri=null,ws=0;function Ac(e){var n=ws;return ws+=1,ri===null&&(ri=[]),gx(ri,e,n)}function Es(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Rc(e,n){throw n.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function iv(e){var n=e._init;return n(e._payload)}function sv(e){function n(F,K){if(e){var Z=F.deletions;Z===null?(F.deletions=[K],F.flags|=16):Z.push(K)}}function o(F,K){if(!e)return null;for(;K!==null;)n(F,K),K=K.sibling;return null}function s(F){for(var K=new Map;F!==null;)F.key!==null?K.set(F.key,F):K.set(F.index,F),F=F.sibling;return K}function h(F,K){return F=Rr(F,K),F.index=0,F.sibling=null,F}function y(F,K,Z){return F.index=Z,e?(Z=F.alternate,Z!==null?(Z=Z.index,Z<K?(F.flags|=67108866,K):Z):(F.flags|=67108866,K)):(F.flags|=1048576,K)}function A(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function k(F,K,Z,ie){return K===null||K.tag!==6?(K=Lf(Z,F.mode,ie),K.return=F,K):(K=h(K,Z),K.return=F,K)}function q(F,K,Z,ie){var pe=Z.type;return pe===v?oe(F,K,Z.props.children,ie,Z.key):K!==null&&(K.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===I&&iv(pe)===K.type)?(K=h(K,Z.props),Es(K,Z),K.return=F,K):(K=uc(Z.type,Z.key,Z.props,null,F.mode,ie),Es(K,Z),K.return=F,K)}function W(F,K,Z,ie){return K===null||K.tag!==4||K.stateNode.containerInfo!==Z.containerInfo||K.stateNode.implementation!==Z.implementation?(K=zf(Z,F.mode,ie),K.return=F,K):(K=h(K,Z.children||[]),K.return=F,K)}function oe(F,K,Z,ie,pe){return K===null||K.tag!==7?(K=Ko(Z,F.mode,ie,pe),K.return=F,K):(K=h(K,Z),K.return=F,K)}function se(F,K,Z){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Lf(""+K,F.mode,Z),K.return=F,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case b:return Z=uc(K.type,K.key,K.props,null,F.mode,Z),Es(Z,K),Z.return=F,Z;case x:return K=zf(K,F.mode,Z),K.return=F,K;case I:var ie=K._init;return K=ie(K._payload),se(F,K,Z)}if(te(K)||$(K))return K=Ko(K,F.mode,Z,null),K.return=F,K;if(typeof K.then=="function")return se(F,Ac(K),Z);if(K.$$typeof===R)return se(F,mc(F,K),Z);Rc(F,K)}return null}function ee(F,K,Z,ie){var pe=K!==null?K.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return pe!==null?null:k(F,K,""+Z,ie);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===pe?q(F,K,Z,ie):null;case x:return Z.key===pe?W(F,K,Z,ie):null;case I:return pe=Z._init,Z=pe(Z._payload),ee(F,K,Z,ie)}if(te(Z)||$(Z))return pe!==null?null:oe(F,K,Z,ie,null);if(typeof Z.then=="function")return ee(F,K,Ac(Z),ie);if(Z.$$typeof===R)return ee(F,K,mc(F,Z),ie);Rc(F,Z)}return null}function ne(F,K,Z,ie,pe){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return F=F.get(Z)||null,k(K,F,""+ie,pe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:return F=F.get(ie.key===null?Z:ie.key)||null,q(K,F,ie,pe);case x:return F=F.get(ie.key===null?Z:ie.key)||null,W(K,F,ie,pe);case I:var ze=ie._init;return ie=ze(ie._payload),ne(F,K,Z,ie,pe)}if(te(ie)||$(ie))return F=F.get(Z)||null,oe(K,F,ie,pe,null);if(typeof ie.then=="function")return ne(F,K,Z,Ac(ie),pe);if(ie.$$typeof===R)return ne(F,K,Z,mc(K,ie),pe);Rc(K,ie)}return null}function Ae(F,K,Z,ie){for(var pe=null,ze=null,be=K,Te=K=0,kt=null;be!==null&&Te<Z.length;Te++){be.index>Te?(kt=be,be=null):kt=be.sibling;var Xe=ee(F,be,Z[Te],ie);if(Xe===null){be===null&&(be=kt);break}e&&be&&Xe.alternate===null&&n(F,be),K=y(Xe,K,Te),ze===null?pe=Xe:ze.sibling=Xe,ze=Xe,be=kt}if(Te===Z.length)return o(F,be),Ke&&Qo(F,Te),pe;if(be===null){for(;Te<Z.length;Te++)be=se(F,Z[Te],ie),be!==null&&(K=y(be,K,Te),ze===null?pe=be:ze.sibling=be,ze=be);return Ke&&Qo(F,Te),pe}for(be=s(be);Te<Z.length;Te++)kt=ne(be,F,Te,Z[Te],ie),kt!==null&&(e&&kt.alternate!==null&&be.delete(kt.key===null?Te:kt.key),K=y(kt,K,Te),ze===null?pe=kt:ze.sibling=kt,ze=kt);return e&&be.forEach(function(jo){return n(F,jo)}),Ke&&Qo(F,Te),pe}function Ee(F,K,Z,ie){if(Z==null)throw Error(a(151));for(var pe=null,ze=null,be=K,Te=K=0,kt=null,Xe=Z.next();be!==null&&!Xe.done;Te++,Xe=Z.next()){be.index>Te?(kt=be,be=null):kt=be.sibling;var jo=ee(F,be,Xe.value,ie);if(jo===null){be===null&&(be=kt);break}e&&be&&jo.alternate===null&&n(F,be),K=y(jo,K,Te),ze===null?pe=jo:ze.sibling=jo,ze=jo,be=kt}if(Xe.done)return o(F,be),Ke&&Qo(F,Te),pe;if(be===null){for(;!Xe.done;Te++,Xe=Z.next())Xe=se(F,Xe.value,ie),Xe!==null&&(K=y(Xe,K,Te),ze===null?pe=Xe:ze.sibling=Xe,ze=Xe);return Ke&&Qo(F,Te),pe}for(be=s(be);!Xe.done;Te++,Xe=Z.next())Xe=ne(be,F,Te,Xe.value,ie),Xe!==null&&(e&&Xe.alternate!==null&&be.delete(Xe.key===null?Te:Xe.key),K=y(Xe,K,Te),ze===null?pe=Xe:ze.sibling=Xe,ze=Xe);return e&&be.forEach(function(OM){return n(F,OM)}),Ke&&Qo(F,Te),pe}function Je(F,K,Z,ie){if(typeof Z=="object"&&Z!==null&&Z.type===v&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var pe=Z.key;K!==null;){if(K.key===pe){if(pe=Z.type,pe===v){if(K.tag===7){o(F,K.sibling),ie=h(K,Z.props.children),ie.return=F,F=ie;break e}}else if(K.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===I&&iv(pe)===K.type){o(F,K.sibling),ie=h(K,Z.props),Es(ie,Z),ie.return=F,F=ie;break e}o(F,K);break}else n(F,K);K=K.sibling}Z.type===v?(ie=Ko(Z.props.children,F.mode,ie,Z.key),ie.return=F,F=ie):(ie=uc(Z.type,Z.key,Z.props,null,F.mode,ie),Es(ie,Z),ie.return=F,F=ie)}return A(F);case x:e:{for(pe=Z.key;K!==null;){if(K.key===pe)if(K.tag===4&&K.stateNode.containerInfo===Z.containerInfo&&K.stateNode.implementation===Z.implementation){o(F,K.sibling),ie=h(K,Z.children||[]),ie.return=F,F=ie;break e}else{o(F,K);break}else n(F,K);K=K.sibling}ie=zf(Z,F.mode,ie),ie.return=F,F=ie}return A(F);case I:return pe=Z._init,Z=pe(Z._payload),Je(F,K,Z,ie)}if(te(Z))return Ae(F,K,Z,ie);if($(Z)){if(pe=$(Z),typeof pe!="function")throw Error(a(150));return Z=pe.call(Z),Ee(F,K,Z,ie)}if(typeof Z.then=="function")return Je(F,K,Ac(Z),ie);if(Z.$$typeof===R)return Je(F,K,mc(F,Z),ie);Rc(F,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,K!==null&&K.tag===6?(o(F,K.sibling),ie=h(K,Z),ie.return=F,F=ie):(o(F,K),ie=Lf(Z,F.mode,ie),ie.return=F,F=ie),A(F)):o(F,K)}return function(F,K,Z,ie){try{ws=0;var pe=Je(F,K,Z,ie);return ri=null,pe}catch(be){if(be===ms||be===gc)throw be;var ze=pn(29,be,null,F.mode);return ze.lanes=ie,ze.return=F,ze}finally{}}}var oi=sv(!0),lv=sv(!1),Ln=U(null),ar=null;function uo(e){var n=e.alternate;Q(Ot,Ot.current&1),Q(Ln,e),ar===null&&(n===null||Ja.current!==null||n.memoizedState!==null)&&(ar=e)}function cv(e){if(e.tag===22){if(Q(Ot,Ot.current),Q(Ln,e),ar===null){var n=e.alternate;n!==null&&n.memoizedState!==null&&(ar=e)}}else fo()}function fo(){Q(Ot,Ot.current),Q(Ln,Ln.current)}function Ir(e){J(Ln),ar===e&&(ar=null),J(Ot)}var Ot=U(0);function Oc(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||am(o)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function gh(e,n,o,s){n=e.memoizedState,o=o(s,n),o=o==null?n:C({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var yh={enqueueSetState:function(e,n,o){e=e._reactInternals;var s=xn(),h=so(s);h.payload=n,o!=null&&(h.callback=o),n=lo(e,h,s),n!==null&&(vn(n,e,s),gs(n,e,s))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var s=xn(),h=so(s);h.tag=1,h.payload=n,o!=null&&(h.callback=o),n=lo(e,h,s),n!==null&&(vn(n,e,s),gs(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=xn(),s=so(o);s.tag=2,n!=null&&(s.callback=n),n=lo(e,s,o),n!==null&&(vn(n,e,o),gs(n,e,o))}};function uv(e,n,o,s,h,y,A){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,y,A):n.prototype&&n.prototype.isPureReactComponent?!is(o,s)||!is(h,y):!0}function dv(e,n,o,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,s),n.state!==e&&yh.enqueueReplaceState(n,n.state,null)}function ra(e,n){var o=n;if("ref"in n){o={};for(var s in n)s!=="ref"&&(o[s]=n[s])}if(e=e.defaultProps){o===n&&(o=C({},o));for(var h in e)o[h]===void 0&&(o[h]=e[h])}return o}var Nc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function fv(e){Nc(e)}function hv(e){console.error(e)}function mv(e){Nc(e)}function Mc(e,n){try{var o=e.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function pv(e,n,o){try{var s=e.onCaughtError;s(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function bh(e,n,o){return o=so(o),o.tag=3,o.payload={element:null},o.callback=function(){Mc(e,n)},o}function gv(e){return e=so(e),e.tag=3,e}function yv(e,n,o,s){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var y=s.value;e.payload=function(){return h(y)},e.callback=function(){pv(n,o,s)}}var A=o.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(e.callback=function(){pv(n,o,s),typeof h!="function"&&(bo===null?bo=new Set([this]):bo.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function ON(e,n,o,s,h){if(o.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=o.alternate,n!==null&&ds(n,o,h,!0),o=Ln.current,o!==null){switch(o.tag){case 13:return ar===null?$h():o.alternate===null&&pt===0&&(pt=3),o.flags&=-257,o.flags|=65536,o.lanes=h,s===Xf?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([s]):n.add(s),Vh(e,s,h)),!1;case 22:return o.flags|=65536,s===Xf?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([s]):o.add(s)),Vh(e,s,h)),!1}throw Error(a(435,o.tag))}return Vh(e,s,h),$h(),!1}if(Ke)return n=Ln.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,s!==Pf&&(e=Error(a(422),{cause:s}),us(_n(e,o)))):(s!==Pf&&(n=Error(a(423),{cause:s}),us(_n(n,o))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,s=_n(s,o),h=bh(e.stateNode,s,h),Qf(e,h),pt!==4&&(pt=2)),!1;var y=Error(a(520),{cause:s});if(y=_n(y,o),Ms===null?Ms=[y]:Ms.push(y),pt!==4&&(pt=2),n===null)return!0;s=_n(s,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,e=h&-h,o.lanes|=e,e=bh(o.stateNode,s,e),Qf(o,e),!1;case 1:if(n=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(bo===null||!bo.has(y))))return o.flags|=65536,h&=-h,o.lanes|=h,h=gv(h),yv(h,e,o,s),Qf(o,h),!1}o=o.return}while(o!==null);return!1}var bv=Error(a(461)),Dt=!1;function Pt(e,n,o,s){n.child=e===null?lv(n,null,o,s):oi(n,e.child,o,s)}function xv(e,n,o,s,h){o=o.render;var y=n.ref;if("ref"in s){var A={};for(var k in s)k!=="ref"&&(A[k]=s[k])}else A=s;return ea(n),s=th(e,n,o,A,y,h),k=nh(),e!==null&&!Dt?(rh(e,n,h),kr(e,n,h)):(Ke&&k&&Bf(n),n.flags|=1,Pt(e,n,s,h),n.child)}function vv(e,n,o,s,h){if(e===null){var y=o.type;return typeof y=="function"&&!kf(y)&&y.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=y,Sv(e,n,y,s,h)):(e=uc(o.type,null,s,n,n.mode,h),e.ref=n.ref,e.return=n,n.child=e)}if(y=e.child,!jh(e,h)){var A=y.memoizedProps;if(o=o.compare,o=o!==null?o:is,o(A,s)&&e.ref===n.ref)return kr(e,n,h)}return n.flags|=1,e=Rr(y,s),e.ref=n.ref,e.return=n,n.child=e}function Sv(e,n,o,s,h){if(e!==null){var y=e.memoizedProps;if(is(y,s)&&e.ref===n.ref)if(Dt=!1,n.pendingProps=s=y,jh(e,h))(e.flags&131072)!==0&&(Dt=!0);else return n.lanes=e.lanes,kr(e,n,h)}return xh(e,n,o,s,h)}function Cv(e,n,o){var s=n.pendingProps,h=s.children,y=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if((n.flags&128)!==0){if(s=y!==null?y.baseLanes|o:o,e!==null){for(h=n.child=e.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;n.childLanes=y&~s}else n.childLanes=0,n.child=null;return wv(e,n,s,o)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&pc(n,y!==null?y.cachePool:null),y!==null?Sx(n,y):Wf(),cv(n);else return n.lanes=n.childLanes=536870912,wv(e,n,y!==null?y.baseLanes|o:o,o)}else y!==null?(pc(n,y.cachePool),Sx(n,y),fo(),n.memoizedState=null):(e!==null&&pc(n,null),Wf(),fo());return Pt(e,n,h,o),n.child}function wv(e,n,o,s){var h=Yf();return h=h===null?null:{parent:Rt._currentValue,pool:h},n.memoizedState={baseLanes:o,cachePool:h},e!==null&&pc(n,null),Wf(),cv(n),e!==null&&ds(e,n,s,!0),null}function _c(e,n){var o=n.ref;if(o===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(e===null||e.ref!==o)&&(n.flags|=4194816)}}function xh(e,n,o,s,h){return ea(n),o=th(e,n,o,s,void 0,h),s=nh(),e!==null&&!Dt?(rh(e,n,h),kr(e,n,h)):(Ke&&s&&Bf(n),n.flags|=1,Pt(e,n,o,h),n.child)}function Ev(e,n,o,s,h,y){return ea(n),n.updateQueue=null,o=wx(n,s,o,h),Cx(e),s=nh(),e!==null&&!Dt?(rh(e,n,y),kr(e,n,y)):(Ke&&s&&Bf(n),n.flags|=1,Pt(e,n,o,y),n.child)}function Tv(e,n,o,s,h){if(ea(n),n.stateNode===null){var y=Ka,A=o.contextType;typeof A=="object"&&A!==null&&(y=Zt(A)),y=new o(s,y),n.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=yh,n.stateNode=y,y._reactInternals=n,y=n.stateNode,y.props=s,y.state=n.memoizedState,y.refs={},Kf(n),A=o.contextType,y.context=typeof A=="object"&&A!==null?Zt(A):Ka,y.state=n.memoizedState,A=o.getDerivedStateFromProps,typeof A=="function"&&(gh(n,o,A,s),y.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(A=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),A!==y.state&&yh.enqueueReplaceState(y,y.state,null),bs(n,s,y,h),ys(),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){y=n.stateNode;var k=n.memoizedProps,q=ra(o,k);y.props=q;var W=y.context,oe=o.contextType;A=Ka,typeof oe=="object"&&oe!==null&&(A=Zt(oe));var se=o.getDerivedStateFromProps;oe=typeof se=="function"||typeof y.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,oe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k||W!==A)&&dv(n,y,s,A),io=!1;var ee=n.memoizedState;y.state=ee,bs(n,s,y,h),ys(),W=n.memoizedState,k||ee!==W||io?(typeof se=="function"&&(gh(n,o,se,s),W=n.memoizedState),(q=io||uv(n,o,q,s,ee,W,A))?(oe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(n.flags|=4194308)):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=W),y.props=s,y.state=W,y.context=A,s=q):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{y=n.stateNode,Ff(e,n),A=n.memoizedProps,oe=ra(o,A),y.props=oe,se=n.pendingProps,ee=y.context,W=o.contextType,q=Ka,typeof W=="object"&&W!==null&&(q=Zt(W)),k=o.getDerivedStateFromProps,(W=typeof k=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(A!==se||ee!==q)&&dv(n,y,s,q),io=!1,ee=n.memoizedState,y.state=ee,bs(n,s,y,h),ys();var ne=n.memoizedState;A!==se||ee!==ne||io||e!==null&&e.dependencies!==null&&hc(e.dependencies)?(typeof k=="function"&&(gh(n,o,k,s),ne=n.memoizedState),(oe=io||uv(n,o,oe,s,ee,ne,q)||e!==null&&e.dependencies!==null&&hc(e.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(s,ne,q),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(s,ne,q)),typeof y.componentDidUpdate=="function"&&(n.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof y.componentDidUpdate!="function"||A===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=ne),y.props=s,y.state=ne,y.context=q,s=oe):(typeof y.componentDidUpdate!="function"||A===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),s=!1)}return y=s,_c(e,n),s=(n.flags&128)!==0,y||s?(y=n.stateNode,o=s&&typeof o.getDerivedStateFromError!="function"?null:y.render(),n.flags|=1,e!==null&&s?(n.child=oi(n,e.child,null,h),n.child=oi(n,null,o,h)):Pt(e,n,o,h),n.memoizedState=y.state,e=n.child):e=kr(e,n,h),e}function jv(e,n,o,s){return cs(),n.flags|=256,Pt(e,n,o,s),n.child}var vh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sh(e){return{baseLanes:e,cachePool:hx()}}function Ch(e,n,o){return e=e!==null?e.childLanes&~o:0,n&&(e|=zn),e}function Av(e,n,o){var s=n.pendingProps,h=!1,y=(n.flags&128)!==0,A;if((A=y)||(A=e!==null&&e.memoizedState===null?!1:(Ot.current&2)!==0),A&&(h=!0,n.flags&=-129),A=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ke){if(h?uo(n):fo(),Ke){var k=mt,q;if(q=k){e:{for(q=k,k=or;q.nodeType!==8;){if(!k){k=null;break e}if(q=Yn(q.nextSibling),q===null){k=null;break e}}k=q}k!==null?(n.memoizedState={dehydrated:k,treeContext:Fo!==null?{id:Or,overflow:Nr}:null,retryLane:536870912,hydrationErrors:null},q=pn(18,null,null,0),q.stateNode=k,q.return=n,n.child=q,tn=n,mt=null,q=!0):q=!1}q||Wo(n)}if(k=n.memoizedState,k!==null&&(k=k.dehydrated,k!==null))return am(k)?n.lanes=32:n.lanes=536870912,null;Ir(n)}return k=s.children,s=s.fallback,h?(fo(),h=n.mode,k=Dc({mode:"hidden",children:k},h),s=Ko(s,h,o,null),k.return=n,s.return=n,k.sibling=s,n.child=k,h=n.child,h.memoizedState=Sh(o),h.childLanes=Ch(e,A,o),n.memoizedState=vh,s):(uo(n),wh(n,k))}if(q=e.memoizedState,q!==null&&(k=q.dehydrated,k!==null)){if(y)n.flags&256?(uo(n),n.flags&=-257,n=Eh(e,n,o)):n.memoizedState!==null?(fo(),n.child=e.child,n.flags|=128,n=null):(fo(),h=s.fallback,k=n.mode,s=Dc({mode:"visible",children:s.children},k),h=Ko(h,k,o,null),h.flags|=2,s.return=n,h.return=n,s.sibling=h,n.child=s,oi(n,e.child,null,o),s=n.child,s.memoizedState=Sh(o),s.childLanes=Ch(e,A,o),n.memoizedState=vh,n=h);else if(uo(n),am(k)){if(A=k.nextSibling&&k.nextSibling.dataset,A)var W=A.dgst;A=W,s=Error(a(419)),s.stack="",s.digest=A,us({value:s,source:null,stack:null}),n=Eh(e,n,o)}else if(Dt||ds(e,n,o,!1),A=(o&e.childLanes)!==0,Dt||A){if(A=rt,A!==null&&(s=o&-o,s=(s&42)!==0?1:_a(s),s=(s&(A.suspendedLanes|o))!==0?0:s,s!==0&&s!==q.retryLane))throw q.retryLane=s,Xa(e,s),vn(A,e,s),bv;k.data==="$?"||$h(),n=Eh(e,n,o)}else k.data==="$?"?(n.flags|=192,n.child=e.child,n=null):(e=q.treeContext,mt=Yn(k.nextSibling),tn=n,Ke=!0,Zo=null,or=!1,e!==null&&(In[kn++]=Or,In[kn++]=Nr,In[kn++]=Fo,Or=e.id,Nr=e.overflow,Fo=n),n=wh(n,s.children),n.flags|=4096);return n}return h?(fo(),h=s.fallback,k=n.mode,q=e.child,W=q.sibling,s=Rr(q,{mode:"hidden",children:s.children}),s.subtreeFlags=q.subtreeFlags&65011712,W!==null?h=Rr(W,h):(h=Ko(h,k,o,null),h.flags|=2),h.return=n,s.return=n,s.sibling=h,n.child=s,s=h,h=n.child,k=e.child.memoizedState,k===null?k=Sh(o):(q=k.cachePool,q!==null?(W=Rt._currentValue,q=q.parent!==W?{parent:W,pool:W}:q):q=hx(),k={baseLanes:k.baseLanes|o,cachePool:q}),h.memoizedState=k,h.childLanes=Ch(e,A,o),n.memoizedState=vh,s):(uo(n),o=e.child,e=o.sibling,o=Rr(o,{mode:"visible",children:s.children}),o.return=n,o.sibling=null,e!==null&&(A=n.deletions,A===null?(n.deletions=[e],n.flags|=16):A.push(e)),n.child=o,n.memoizedState=null,o)}function wh(e,n){return n=Dc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Dc(e,n){return e=pn(22,e,null,n),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Eh(e,n,o){return oi(n,e.child,null,o),e=wh(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Rv(e,n,o){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),$f(e.return,n,o)}function Th(e,n,o,s,h){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:o,tailMode:h}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=o,y.tailMode=h)}function Ov(e,n,o){var s=n.pendingProps,h=s.revealOrder,y=s.tail;if(Pt(e,n,s.children,o),s=Ot.current,(s&2)!==0)s=s&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rv(e,o,n);else if(e.tag===19)Rv(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}switch(Q(Ot,s),h){case"forwards":for(o=n.child,h=null;o!==null;)e=o.alternate,e!==null&&Oc(e)===null&&(h=o),o=o.sibling;o=h,o===null?(h=n.child,n.child=null):(h=o.sibling,o.sibling=null),Th(n,!1,h,o,y);break;case"backwards":for(o=null,h=n.child,n.child=null;h!==null;){if(e=h.alternate,e!==null&&Oc(e)===null){n.child=h;break}e=h.sibling,h.sibling=o,o=h,h=e}Th(n,!0,o,null,y);break;case"together":Th(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function kr(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),yo|=n.lanes,(o&n.childLanes)===0)if(e!==null){if(ds(e,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,o=Rr(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=Rr(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function jh(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&hc(e)))}function NN(e,n,o){switch(n.tag){case 3:je(n,n.stateNode.containerInfo),ao(n,Rt,e.memoizedState.cache),cs();break;case 27:case 5:de(n);break;case 4:je(n,n.stateNode.containerInfo);break;case 10:ao(n,n.type,n.memoizedProps.value);break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(uo(n),n.flags|=128,null):(o&n.child.childLanes)!==0?Av(e,n,o):(uo(n),e=kr(e,n,o),e!==null?e.sibling:null);uo(n);break;case 19:var h=(e.flags&128)!==0;if(s=(o&n.childLanes)!==0,s||(ds(e,n,o,!1),s=(o&n.childLanes)!==0),h){if(s)return Ov(e,n,o);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Q(Ot,Ot.current),s)break;return null;case 22:case 23:return n.lanes=0,Cv(e,n,o);case 24:ao(n,Rt,e.memoizedState.cache)}return kr(e,n,o)}function Nv(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps)Dt=!0;else{if(!jh(e,o)&&(n.flags&128)===0)return Dt=!1,NN(e,n,o);Dt=(e.flags&131072)!==0}else Dt=!1,Ke&&(n.flags&1048576)!==0&&ix(n,fc,n.index);switch(n.lanes=0,n.tag){case 16:e:{e=n.pendingProps;var s=n.elementType,h=s._init;if(s=h(s._payload),n.type=s,typeof s=="function")kf(s)?(e=ra(s,e),n.tag=1,n=Tv(null,n,s,e,o)):(n.tag=0,n=xh(null,n,s,e,o));else{if(s!=null){if(h=s.$$typeof,h===O){n.tag=11,n=xv(null,n,s,e,o);break e}else if(h===_){n.tag=14,n=vv(null,n,s,e,o);break e}}throw n=G(s)||s,Error(a(306,n,""))}}return n;case 0:return xh(e,n,n.type,n.pendingProps,o);case 1:return s=n.type,h=ra(s,n.pendingProps),Tv(e,n,s,h,o);case 3:e:{if(je(n,n.stateNode.containerInfo),e===null)throw Error(a(387));s=n.pendingProps;var y=n.memoizedState;h=y.element,Ff(e,n),bs(n,s,null,o);var A=n.memoizedState;if(s=A.cache,ao(n,Rt,s),s!==y.cache&&Gf(n,[Rt],o,!0),ys(),s=A.element,y.isDehydrated)if(y={element:s,isDehydrated:!1,cache:A.cache},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){n=jv(e,n,s,o);break e}else if(s!==h){h=_n(Error(a(424)),n),us(h),n=jv(e,n,s,o);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(mt=Yn(e.firstChild),tn=n,Ke=!0,Zo=null,or=!0,o=lv(n,null,s,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(cs(),s===h){n=kr(e,n,o);break e}Pt(e,n,s,o)}n=n.child}return n;case 26:return _c(e,n),e===null?(o=I1(n.type,null,n.pendingProps,null))?n.memoizedState=o:Ke||(o=n.type,e=n.pendingProps,s=Xc(ae.current).createElement(o),s[Qt]=n,s[on]=e,$t(s,o,e),_t(s),n.stateNode=s):n.memoizedState=I1(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return de(n),e===null&&Ke&&(s=n.stateNode=M1(n.type,n.pendingProps,ae.current),tn=n,or=!0,h=mt,So(n.type)?(im=h,mt=Yn(s.firstChild)):mt=h),Pt(e,n,n.pendingProps.children,o),_c(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ke&&((h=s=mt)&&(s=oM(s,n.type,n.pendingProps,or),s!==null?(n.stateNode=s,tn=n,mt=Yn(s.firstChild),or=!1,h=!0):h=!1),h||Wo(n)),de(n),h=n.type,y=n.pendingProps,A=e!==null?e.memoizedProps:null,s=y.children,nm(h,y)?s=null:A!==null&&nm(h,A)&&(n.flags|=32),n.memoizedState!==null&&(h=th(e,n,CN,null,null,o),Ps._currentValue=h),_c(e,n),Pt(e,n,s,o),n.child;case 6:return e===null&&Ke&&((e=o=mt)&&(o=aM(o,n.pendingProps,or),o!==null?(n.stateNode=o,tn=n,mt=null,e=!0):e=!1),e||Wo(n)),null;case 13:return Av(e,n,o);case 4:return je(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=oi(n,null,s,o):Pt(e,n,s,o),n.child;case 11:return xv(e,n,n.type,n.pendingProps,o);case 7:return Pt(e,n,n.pendingProps,o),n.child;case 8:return Pt(e,n,n.pendingProps.children,o),n.child;case 12:return Pt(e,n,n.pendingProps.children,o),n.child;case 10:return s=n.pendingProps,ao(n,n.type,s.value),Pt(e,n,s.children,o),n.child;case 9:return h=n.type._context,s=n.pendingProps.children,ea(n),h=Zt(h),s=s(h),n.flags|=1,Pt(e,n,s,o),n.child;case 14:return vv(e,n,n.type,n.pendingProps,o);case 15:return Sv(e,n,n.type,n.pendingProps,o);case 19:return Ov(e,n,o);case 31:return s=n.pendingProps,o=n.mode,s={mode:s.mode,children:s.children},e===null?(o=Dc(s,o),o.ref=n.ref,n.child=o,o.return=n,n=o):(o=Rr(e.child,s),o.ref=n.ref,n.child=o,o.return=n,n=o),n;case 22:return Cv(e,n,o);case 24:return ea(n),s=Zt(Rt),e===null?(h=Yf(),h===null&&(h=rt,y=Vf(),h.pooledCache=y,y.refCount++,y!==null&&(h.pooledCacheLanes|=o),h=y),n.memoizedState={parent:s,cache:h},Kf(n),ao(n,Rt,h)):((e.lanes&o)!==0&&(Ff(e,n),bs(n,null,null,o),ys()),h=e.memoizedState,y=n.memoizedState,h.parent!==s?(h={parent:s,cache:s},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),ao(n,Rt,s)):(s=y.cache,ao(n,Rt,s),s!==h.cache&&Gf(n,[Rt],o,!0))),Pt(e,n,n.pendingProps.children,o),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Lr(e){e.flags|=4}function Mv(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!H1(n)){if(n=Ln.current,n!==null&&((Ge&4194048)===Ge?ar!==null:(Ge&62914560)!==Ge&&(Ge&536870912)===0||n!==ar))throw ps=Xf,mx;e.flags|=8192}}function Ic(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?et():536870912,e.lanes|=n,li|=n)}function Ts(e,n){if(!Ke)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var s=null;o!==null;)o.alternate!==null&&(s=o),o=o.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function ut(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,s=0;if(n)for(var h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags&65011712,s|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags,s|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=s,e.childLanes=o,n}function MN(e,n,o){var s=n.pendingProps;switch(Hf(n),n.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(n),null;case 1:return ut(n),null;case 3:return o=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),_r(Rt),ye(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(ls(n)?Lr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,cx())),ut(n),null;case 26:return o=n.memoizedState,e===null?(Lr(n),o!==null?(ut(n),Mv(n,o)):(ut(n),n.flags&=-16777217)):o?o!==e.memoizedState?(Lr(n),ut(n),Mv(n,o)):(ut(n),n.flags&=-16777217):(e.memoizedProps!==s&&Lr(n),ut(n),n.flags&=-16777217),null;case 27:Me(n),o=ae.current;var h=n.type;if(e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Lr(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return ut(n),null}e=le.current,ls(n)?sx(n):(e=M1(h,s,o),n.stateNode=e,Lr(n))}return ut(n),null;case 5:if(Me(n),o=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Lr(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return ut(n),null}if(e=le.current,ls(n))sx(n);else{switch(h=Xc(ae.current),e){case 1:e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}e[Qt]=n,e[on]=s;e:for(h=n.child;h!==null;){if(h.tag===5||h.tag===6)e.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}n.stateNode=e;e:switch($t(e,o,s),o){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Lr(n)}}return ut(n),n.flags&=-16777217,null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Lr(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=ae.current,ls(n)){if(e=n.stateNode,o=n.memoizedProps,s=null,h=tn,h!==null)switch(h.tag){case 27:case 5:s=h.memoizedProps}e[Qt]=n,e=!!(e.nodeValue===o||s!==null&&s.suppressHydrationWarning===!0||E1(e.nodeValue,o)),e||Wo(n)}else e=Xc(e).createTextNode(s),e[Qt]=n,n.stateNode=e}return ut(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=ls(n),s!==null&&s.dehydrated!==null){if(e===null){if(!h)throw Error(a(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Qt]=n}else cs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ut(n),h=!1}else h=cx(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(Ir(n),n):(Ir(n),null)}if(Ir(n),(n.flags&128)!==0)return n.lanes=o,n;if(o=s!==null,e=e!==null&&e.memoizedState!==null,o){s=n.child,h=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(h=s.alternate.memoizedState.cachePool.pool);var y=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==h&&(s.flags|=2048)}return o!==e&&o&&(n.child.flags|=8192),Ic(n,n.updateQueue),ut(n),null;case 4:return ye(),e===null&&Zh(n.stateNode.containerInfo),ut(n),null;case 10:return _r(n.type),ut(n),null;case 19:if(J(Ot),h=n.memoizedState,h===null)return ut(n),null;if(s=(n.flags&128)!==0,y=h.rendering,y===null)if(s)Ts(h,!1);else{if(pt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(y=Oc(e),y!==null){for(n.flags|=128,Ts(h,!1),e=y.updateQueue,n.updateQueue=e,Ic(n,e),n.subtreeFlags=0,e=o,o=n.child;o!==null;)ax(o,e),o=o.sibling;return Q(Ot,Ot.current&1|2),n.child}e=e.sibling}h.tail!==null&&ht()>zc&&(n.flags|=128,s=!0,Ts(h,!1),n.lanes=4194304)}else{if(!s)if(e=Oc(y),e!==null){if(n.flags|=128,s=!0,e=e.updateQueue,n.updateQueue=e,Ic(n,e),Ts(h,!0),h.tail===null&&h.tailMode==="hidden"&&!y.alternate&&!Ke)return ut(n),null}else 2*ht()-h.renderingStartTime>zc&&o!==536870912&&(n.flags|=128,s=!0,Ts(h,!1),n.lanes=4194304);h.isBackwards?(y.sibling=n.child,n.child=y):(e=h.last,e!==null?e.sibling=y:n.child=y,h.last=y)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=ht(),n.sibling=null,e=Ot.current,Q(Ot,s?e&1|2:e&1),n):(ut(n),null);case 22:case 23:return Ir(n),Jf(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(o&536870912)!==0&&(n.flags&128)===0&&(ut(n),n.subtreeFlags&6&&(n.flags|=8192)):ut(n),o=n.updateQueue,o!==null&&Ic(n,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==o&&(n.flags|=2048),e!==null&&J(ta),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),_r(Rt),ut(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function _N(e,n){switch(Hf(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return _r(Rt),ye(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Me(n),null;case 13:if(Ir(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));cs()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return J(Ot),null;case 4:return ye(),null;case 10:return _r(n.type),null;case 22:case 23:return Ir(n),Jf(),e!==null&&J(ta),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return _r(Rt),null;case 25:return null;default:return null}}function _v(e,n){switch(Hf(n),n.tag){case 3:_r(Rt),ye();break;case 26:case 27:case 5:Me(n);break;case 4:ye();break;case 13:Ir(n);break;case 19:J(Ot);break;case 10:_r(n.type);break;case 22:case 23:Ir(n),Jf(),e!==null&&J(ta);break;case 24:_r(Rt)}}function js(e,n){try{var o=n.updateQueue,s=o!==null?o.lastEffect:null;if(s!==null){var h=s.next;o=h;do{if((o.tag&e)===e){s=void 0;var y=o.create,A=o.inst;s=y(),A.destroy=s}o=o.next}while(o!==h)}}catch(k){tt(n,n.return,k)}}function ho(e,n,o){try{var s=n.updateQueue,h=s!==null?s.lastEffect:null;if(h!==null){var y=h.next;s=y;do{if((s.tag&e)===e){var A=s.inst,k=A.destroy;if(k!==void 0){A.destroy=void 0,h=n;var q=o,W=k;try{W()}catch(oe){tt(h,q,oe)}}}s=s.next}while(s!==y)}}catch(oe){tt(n,n.return,oe)}}function Dv(e){var n=e.updateQueue;if(n!==null){var o=e.stateNode;try{vx(n,o)}catch(s){tt(e,e.return,s)}}}function Iv(e,n,o){o.props=ra(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(s){tt(e,n,s)}}function As(e,n){try{var o=e.ref;if(o!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof o=="function"?e.refCleanup=o(s):o.current=s}}catch(h){tt(e,n,h)}}function ir(e,n){var o=e.ref,s=e.refCleanup;if(o!==null)if(typeof s=="function")try{s()}catch(h){tt(e,n,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){tt(e,n,h)}else o.current=null}function kv(e){var n=e.type,o=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&s.focus();break e;case"img":o.src?s.src=o.src:o.srcSet&&(s.srcset=o.srcSet)}}catch(h){tt(e,e.return,h)}}function Ah(e,n,o){try{var s=e.stateNode;JN(s,e.type,o,n),s[on]=n}catch(h){tt(e,e.return,h)}}function Lv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&So(e.type)||e.tag===4}function Rh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&So(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Oh(e,n,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(e,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(e),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Yc));else if(s!==4&&(s===27&&So(e.type)&&(o=e.stateNode,n=null),e=e.child,e!==null))for(Oh(e,n,o),e=e.sibling;e!==null;)Oh(e,n,o),e=e.sibling}function kc(e,n,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(s!==4&&(s===27&&So(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(kc(e,n,o),e=e.sibling;e!==null;)kc(e,n,o),e=e.sibling}function zv(e){var n=e.stateNode,o=e.memoizedProps;try{for(var s=e.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);$t(n,s,o),n[Qt]=e,n[on]=o}catch(y){tt(e,e.return,y)}}var zr=!1,bt=!1,Nh=!1,Bv=typeof WeakSet=="function"?WeakSet:Set,It=null;function DN(e,n){if(e=e.containerInfo,em=Jc,e=Fb(e),Rf(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var s=o.getSelection&&o.getSelection();if(s&&s.rangeCount!==0){o=s.anchorNode;var h=s.anchorOffset,y=s.focusNode;s=s.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var A=0,k=-1,q=-1,W=0,oe=0,se=e,ee=null;t:for(;;){for(var ne;se!==o||h!==0&&se.nodeType!==3||(k=A+h),se!==y||s!==0&&se.nodeType!==3||(q=A+s),se.nodeType===3&&(A+=se.nodeValue.length),(ne=se.firstChild)!==null;)ee=se,se=ne;for(;;){if(se===e)break t;if(ee===o&&++W===h&&(k=A),ee===y&&++oe===s&&(q=A),(ne=se.nextSibling)!==null)break;se=ee,ee=se.parentNode}se=ne}o=k===-1||q===-1?null:{start:k,end:q}}else o=null}o=o||{start:0,end:0}}else o=null;for(tm={focusedElem:e,selectionRange:o},Jc=!1,It=n;It!==null;)if(n=It,e=n.child,(n.subtreeFlags&1024)!==0&&e!==null)e.return=n,It=e;else for(;It!==null;){switch(n=It,y=n.alternate,e=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&y!==null){e=void 0,o=n,h=y.memoizedProps,y=y.memoizedState,s=o.stateNode;try{var Ae=ra(o.type,h,o.elementType===o.type);e=s.getSnapshotBeforeUpdate(Ae,y),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){tt(o,o.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,o=e.nodeType,o===9)om(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":om(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=n.sibling,e!==null){e.return=n.return,It=e;break}It=n.return}}function Hv(e,n,o){var s=o.flags;switch(o.tag){case 0:case 11:case 15:mo(e,o),s&4&&js(5,o);break;case 1:if(mo(e,o),s&4)if(e=o.stateNode,n===null)try{e.componentDidMount()}catch(A){tt(o,o.return,A)}else{var h=ra(o.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(h,n,e.__reactInternalSnapshotBeforeUpdate)}catch(A){tt(o,o.return,A)}}s&64&&Dv(o),s&512&&As(o,o.return);break;case 3:if(mo(e,o),s&64&&(e=o.updateQueue,e!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{vx(e,n)}catch(A){tt(o,o.return,A)}}break;case 27:n===null&&s&4&&zv(o);case 26:case 5:mo(e,o),n===null&&s&4&&kv(o),s&512&&As(o,o.return);break;case 12:mo(e,o);break;case 13:mo(e,o),s&4&&$v(e,o),s&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(o=$N.bind(null,o),iM(e,o))));break;case 22:if(s=o.memoizedState!==null||zr,!s){n=n!==null&&n.memoizedState!==null||bt,h=zr;var y=bt;zr=s,(bt=n)&&!y?po(e,o,(o.subtreeFlags&8772)!==0):mo(e,o),zr=h,bt=y}break;case 30:break;default:mo(e,o)}}function Pv(e){var n=e.alternate;n!==null&&(e.alternate=null,Pv(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&cf(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var st=null,ln=!1;function Br(e,n,o){for(o=o.child;o!==null;)Uv(e,n,o),o=o.sibling}function Uv(e,n,o){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(Gn,o)}catch{}switch(o.tag){case 26:bt||ir(o,n),Br(e,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:bt||ir(o,n);var s=st,h=ln;So(o.type)&&(st=o.stateNode,ln=!1),Br(e,n,o),Ls(o.stateNode),st=s,ln=h;break;case 5:bt||ir(o,n);case 6:if(s=st,h=ln,st=null,Br(e,n,o),st=s,ln=h,st!==null)if(ln)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(o.stateNode)}catch(y){tt(o,n,y)}else try{st.removeChild(o.stateNode)}catch(y){tt(o,n,y)}break;case 18:st!==null&&(ln?(e=st,O1(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,o.stateNode),Vs(e)):O1(st,o.stateNode));break;case 4:s=st,h=ln,st=o.stateNode.containerInfo,ln=!0,Br(e,n,o),st=s,ln=h;break;case 0:case 11:case 14:case 15:bt||ho(2,o,n),bt||ho(4,o,n),Br(e,n,o);break;case 1:bt||(ir(o,n),s=o.stateNode,typeof s.componentWillUnmount=="function"&&Iv(o,n,s)),Br(e,n,o);break;case 21:Br(e,n,o);break;case 22:bt=(s=bt)||o.memoizedState!==null,Br(e,n,o),bt=s;break;default:Br(e,n,o)}}function $v(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vs(e)}catch(o){tt(n,n.return,o)}}function IN(e){switch(e.tag){case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Bv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Bv),n;default:throw Error(a(435,e.tag))}}function Mh(e,n){var o=IN(e);n.forEach(function(s){var h=GN.bind(null,e,s);o.has(s)||(o.add(s),s.then(h,h))})}function gn(e,n){var o=n.deletions;if(o!==null)for(var s=0;s<o.length;s++){var h=o[s],y=e,A=n,k=A;e:for(;k!==null;){switch(k.tag){case 27:if(So(k.type)){st=k.stateNode,ln=!1;break e}break;case 5:st=k.stateNode,ln=!1;break e;case 3:case 4:st=k.stateNode.containerInfo,ln=!0;break e}k=k.return}if(st===null)throw Error(a(160));Uv(y,A,h),st=null,ln=!1,y=h.alternate,y!==null&&(y.return=null),h.return=null}if(n.subtreeFlags&13878)for(n=n.child;n!==null;)Gv(n,e),n=n.sibling}var qn=null;function Gv(e,n){var o=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gn(n,e),yn(e),s&4&&(ho(3,e,e.return),js(3,e),ho(5,e,e.return));break;case 1:gn(n,e),yn(e),s&512&&(bt||o===null||ir(o,o.return)),s&64&&zr&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?s:o.concat(s))));break;case 26:var h=qn;if(gn(n,e),yn(e),s&512&&(bt||o===null||ir(o,o.return)),s&4){var y=o!==null?o.memoizedState:null;if(s=e.memoizedState,o===null)if(s===null)if(e.stateNode===null){e:{s=e.type,o=e.memoizedProps,h=h.ownerDocument||h;t:switch(s){case"title":y=h.getElementsByTagName("title")[0],(!y||y[Zi]||y[Qt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=h.createElement(s),h.head.insertBefore(y,h.querySelector("head > title"))),$t(y,s,o),y[Qt]=e,_t(y),s=y;break e;case"link":var A=z1("link","href",h).get(s+(o.href||""));if(A){for(var k=0;k<A.length;k++)if(y=A[k],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){A.splice(k,1);break t}}y=h.createElement(s),$t(y,s,o),h.head.appendChild(y);break;case"meta":if(A=z1("meta","content",h).get(s+(o.content||""))){for(k=0;k<A.length;k++)if(y=A[k],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){A.splice(k,1);break t}}y=h.createElement(s),$t(y,s,o),h.head.appendChild(y);break;default:throw Error(a(468,s))}y[Qt]=e,_t(y),s=y}e.stateNode=s}else B1(h,e.type,e.stateNode);else e.stateNode=L1(h,s,e.memoizedProps);else y!==s?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,s===null?B1(h,e.type,e.stateNode):L1(h,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Ah(e,e.memoizedProps,o.memoizedProps)}break;case 27:gn(n,e),yn(e),s&512&&(bt||o===null||ir(o,o.return)),o!==null&&s&4&&Ah(e,e.memoizedProps,o.memoizedProps);break;case 5:if(gn(n,e),yn(e),s&512&&(bt||o===null||ir(o,o.return)),e.flags&32){h=e.stateNode;try{Pa(h,"")}catch(ne){tt(e,e.return,ne)}}s&4&&e.stateNode!=null&&(h=e.memoizedProps,Ah(e,h,o!==null?o.memoizedProps:h)),s&1024&&(Nh=!0);break;case 6:if(gn(n,e),yn(e),s&4){if(e.stateNode===null)throw Error(a(162));s=e.memoizedProps,o=e.stateNode;try{o.nodeValue=s}catch(ne){tt(e,e.return,ne)}}break;case 3:if(Qc=null,h=qn,qn=Kc(n.containerInfo),gn(n,e),qn=h,yn(e),s&4&&o!==null&&o.memoizedState.isDehydrated)try{Vs(n.containerInfo)}catch(ne){tt(e,e.return,ne)}Nh&&(Nh=!1,Vv(e));break;case 4:s=qn,qn=Kc(e.stateNode.containerInfo),gn(n,e),yn(e),qn=s;break;case 12:gn(n,e),yn(e);break;case 13:gn(n,e),yn(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(zh=ht()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Mh(e,s)));break;case 22:h=e.memoizedState!==null;var q=o!==null&&o.memoizedState!==null,W=zr,oe=bt;if(zr=W||h,bt=oe||q,gn(n,e),bt=oe,zr=W,yn(e),s&8192)e:for(n=e.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(o===null||q||zr||bt||oa(e)),o=null,n=e;;){if(n.tag===5||n.tag===26){if(o===null){q=o=n;try{if(y=q.stateNode,h)A=y.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{k=q.stateNode;var se=q.memoizedProps.style,ee=se!=null&&se.hasOwnProperty("display")?se.display:null;k.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ne){tt(q,q.return,ne)}}}else if(n.tag===6){if(o===null){q=n;try{q.stateNode.nodeValue=h?"":q.memoizedProps}catch(ne){tt(q,q.return,ne)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;o===n&&(o=null),n=n.return}o===n&&(o=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(o=s.retryQueue,o!==null&&(s.retryQueue=null,Mh(e,o))));break;case 19:gn(n,e),yn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Mh(e,s)));break;case 30:break;case 21:break;default:gn(n,e),yn(e)}}function yn(e){var n=e.flags;if(n&2){try{for(var o,s=e.return;s!==null;){if(Lv(s)){o=s;break}s=s.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,y=Rh(e);kc(e,y,h);break;case 5:var A=o.stateNode;o.flags&32&&(Pa(A,""),o.flags&=-33);var k=Rh(e);kc(e,k,A);break;case 3:case 4:var q=o.stateNode.containerInfo,W=Rh(e);Oh(e,W,q);break;default:throw Error(a(161))}}catch(oe){tt(e,e.return,oe)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Vv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Vv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function mo(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Hv(e,n.alternate,n),n=n.sibling}function oa(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ho(4,n,n.return),oa(n);break;case 1:ir(n,n.return);var o=n.stateNode;typeof o.componentWillUnmount=="function"&&Iv(n,n.return,o),oa(n);break;case 27:Ls(n.stateNode);case 26:case 5:ir(n,n.return),oa(n);break;case 22:n.memoizedState===null&&oa(n);break;case 30:oa(n);break;default:oa(n)}e=e.sibling}}function po(e,n,o){for(o=o&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,h=e,y=n,A=y.flags;switch(y.tag){case 0:case 11:case 15:po(h,y,o),js(4,y);break;case 1:if(po(h,y,o),s=y,h=s.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(W){tt(s,s.return,W)}if(s=y,h=s.updateQueue,h!==null){var k=s.stateNode;try{var q=h.shared.hiddenCallbacks;if(q!==null)for(h.shared.hiddenCallbacks=null,h=0;h<q.length;h++)xx(q[h],k)}catch(W){tt(s,s.return,W)}}o&&A&64&&Dv(y),As(y,y.return);break;case 27:zv(y);case 26:case 5:po(h,y,o),o&&s===null&&A&4&&kv(y),As(y,y.return);break;case 12:po(h,y,o);break;case 13:po(h,y,o),o&&A&4&&$v(h,y);break;case 22:y.memoizedState===null&&po(h,y,o),As(y,y.return);break;case 30:break;default:po(h,y,o)}n=n.sibling}}function _h(e,n){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&fs(o))}function Dh(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&fs(e))}function sr(e,n,o,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)qv(e,n,o,s),n=n.sibling}function qv(e,n,o,s){var h=n.flags;switch(n.tag){case 0:case 11:case 15:sr(e,n,o,s),h&2048&&js(9,n);break;case 1:sr(e,n,o,s);break;case 3:sr(e,n,o,s),h&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&fs(e)));break;case 12:if(h&2048){sr(e,n,o,s),e=n.stateNode;try{var y=n.memoizedProps,A=y.id,k=y.onPostCommit;typeof k=="function"&&k(A,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(q){tt(n,n.return,q)}}else sr(e,n,o,s);break;case 13:sr(e,n,o,s);break;case 23:break;case 22:y=n.stateNode,A=n.alternate,n.memoizedState!==null?y._visibility&2?sr(e,n,o,s):Rs(e,n):y._visibility&2?sr(e,n,o,s):(y._visibility|=2,ai(e,n,o,s,(n.subtreeFlags&10256)!==0)),h&2048&&_h(A,n);break;case 24:sr(e,n,o,s),h&2048&&Dh(n.alternate,n);break;default:sr(e,n,o,s)}}function ai(e,n,o,s,h){for(h=h&&(n.subtreeFlags&10256)!==0,n=n.child;n!==null;){var y=e,A=n,k=o,q=s,W=A.flags;switch(A.tag){case 0:case 11:case 15:ai(y,A,k,q,h),js(8,A);break;case 23:break;case 22:var oe=A.stateNode;A.memoizedState!==null?oe._visibility&2?ai(y,A,k,q,h):Rs(y,A):(oe._visibility|=2,ai(y,A,k,q,h)),h&&W&2048&&_h(A.alternate,A);break;case 24:ai(y,A,k,q,h),h&&W&2048&&Dh(A.alternate,A);break;default:ai(y,A,k,q,h)}n=n.sibling}}function Rs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=e,s=n,h=s.flags;switch(s.tag){case 22:Rs(o,s),h&2048&&_h(s.alternate,s);break;case 24:Rs(o,s),h&2048&&Dh(s.alternate,s);break;default:Rs(o,s)}n=n.sibling}}var Os=8192;function ii(e){if(e.subtreeFlags&Os)for(e=e.child;e!==null;)Yv(e),e=e.sibling}function Yv(e){switch(e.tag){case 26:ii(e),e.flags&Os&&e.memoizedState!==null&&xM(qn,e.memoizedState,e.memoizedProps);break;case 5:ii(e);break;case 3:case 4:var n=qn;qn=Kc(e.stateNode.containerInfo),ii(e),qn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Os,Os=16777216,ii(e),Os=n):ii(e));break;default:ii(e)}}function Xv(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Ns(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var s=n[o];It=s,Fv(s,e)}Xv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kv(e),e=e.sibling}function Kv(e){switch(e.tag){case 0:case 11:case 15:Ns(e),e.flags&2048&&ho(9,e,e.return);break;case 3:Ns(e);break;case 12:Ns(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Lc(e)):Ns(e);break;default:Ns(e)}}function Lc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var s=n[o];It=s,Fv(s,e)}Xv(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ho(8,n,n.return),Lc(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,Lc(n));break;default:Lc(n)}e=e.sibling}}function Fv(e,n){for(;It!==null;){var o=It;switch(o.tag){case 0:case 11:case 15:ho(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var s=o.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:fs(o.memoizedState.cache)}if(s=o.child,s!==null)s.return=o,It=s;else e:for(o=e;It!==null;){s=It;var h=s.sibling,y=s.return;if(Pv(s),s===o){It=null;break e}if(h!==null){h.return=y,It=h;break e}It=y}}}var kN={getCacheForType:function(e){var n=Zt(Rt),o=n.data.get(e);return o===void 0&&(o=e(),n.data.set(e,o)),o}},LN=typeof WeakMap=="function"?WeakMap:Map,Fe=0,rt=null,Pe=null,Ge=0,Qe=0,bn=null,go=!1,si=!1,Ih=!1,Hr=0,pt=0,yo=0,aa=0,kh=0,zn=0,li=0,Ms=null,cn=null,Lh=!1,zh=0,zc=1/0,Bc=null,bo=null,Ut=0,xo=null,ci=null,ui=0,Bh=0,Hh=null,Qv=null,_s=0,Ph=null;function xn(){if((Fe&2)!==0&&Ge!==0)return Ge&-Ge;if(V.T!==null){var e=Za;return e!==0?e:Xh()}return rr()}function Zv(){zn===0&&(zn=(Ge&536870912)===0||Ke?ve():536870912);var e=Ln.current;return e!==null&&(e.flags|=32),zn}function vn(e,n,o){(e===rt&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(di(e,0),vo(e,Ge,zn,!1)),Oe(e,o),((Fe&2)===0||e!==rt)&&(e===rt&&((Fe&2)===0&&(aa|=o),pt===4&&vo(e,Ge,zn,!1)),lr(e))}function Wv(e,n,o){if((Fe&6)!==0)throw Error(a(327));var s=!o&&(n&124)===0&&(n&e.expiredLanes)===0||ce(e,n),h=s?HN(e,n):Gh(e,n,!0),y=s;do{if(h===0){si&&!s&&vo(e,n,0,!1);break}else{if(o=e.current.alternate,y&&!zN(o)){h=Gh(e,n,!1),y=!1;continue}if(h===2){if(y=n,e.errorRecoveryDisabledLanes&y)var A=0;else A=e.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){n=A;e:{var k=e;h=Ms;var q=k.current.memoizedState.isDehydrated;if(q&&(di(k,A).flags|=256),A=Gh(k,A,!1),A!==2){if(Ih&&!q){k.errorRecoveryDisabledLanes|=y,aa|=y,h=4;break e}y=cn,cn=h,y!==null&&(cn===null?cn=y:cn.push.apply(cn,y))}h=A}if(y=!1,h!==2)continue}}if(h===1){di(e,0),vo(e,n,0,!0);break}e:{switch(s=e,y=h,y){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:vo(s,n,zn,!go);break e;case 2:cn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(h=zh+300-ht(),10<h)){if(vo(s,n,zn,!go),Fi(s,0,!0)!==0)break e;s.timeoutHandle=A1(Jv.bind(null,s,o,cn,Bc,Lh,n,zn,aa,li,go,y,2,-0,0),h);break e}Jv(s,o,cn,Bc,Lh,n,zn,aa,li,go,y,0,-0,0)}}break}while(!0);lr(e)}function Jv(e,n,o,s,h,y,A,k,q,W,oe,se,ee,ne){if(e.timeoutHandle=-1,se=n.subtreeFlags,(se&8192||(se&16785408)===16785408)&&(Hs={stylesheets:null,count:0,unsuspend:bM},Yv(n),se=vM(),se!==null)){e.cancelPendingCommit=se(i1.bind(null,e,n,y,o,s,h,A,k,q,oe,1,ee,ne)),vo(e,y,A,!W);return}i1(e,n,y,o,s,h,A,k,q)}function zN(e){for(var n=e;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var s=0;s<o.length;s++){var h=o[s],y=h.getSnapshot;h=h.value;try{if(!mn(y(),h))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function vo(e,n,o,s){n&=~kh,n&=~aa,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var h=n;0<h;){var y=31-Ht(h),A=1<<y;s[y]=-1,h&=~A}o!==0&&hn(e,o,n)}function Hc(){return(Fe&6)===0?(Ds(0),!1):!0}function Uh(){if(Pe!==null){if(Qe===0)var e=Pe.return;else e=Pe,Mr=Jo=null,oh(e),ri=null,ws=0,e=Pe;for(;e!==null;)_v(e.alternate,e),e=e.return;Pe=null}}function di(e,n){var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,tM(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),Uh(),rt=e,Pe=o=Rr(e.current,null),Ge=n,Qe=0,bn=null,go=!1,si=ce(e,n),Ih=!1,li=zn=kh=aa=yo=pt=0,cn=Ms=null,Lh=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var h=31-Ht(s),y=1<<h;n|=e[h],s&=~y}return Hr=n,sc(),o}function e1(e,n){Le=null,V.H=jc,n===ms||n===gc?(n=yx(),Qe=3):n===mx?(n=yx(),Qe=4):Qe=n===bv?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,bn=n,Pe===null&&(pt=1,Mc(e,_n(n,e.current)))}function t1(){var e=V.H;return V.H=jc,e===null?jc:e}function n1(){var e=V.A;return V.A=kN,e}function $h(){pt=4,go||(Ge&4194048)!==Ge&&Ln.current!==null||(si=!0),(yo&134217727)===0&&(aa&134217727)===0||rt===null||vo(rt,Ge,zn,!1)}function Gh(e,n,o){var s=Fe;Fe|=2;var h=t1(),y=n1();(rt!==e||Ge!==n)&&(Bc=null,di(e,n)),n=!1;var A=pt;e:do try{if(Qe!==0&&Pe!==null){var k=Pe,q=bn;switch(Qe){case 8:Uh(),A=6;break e;case 3:case 2:case 9:case 6:Ln.current===null&&(n=!0);var W=Qe;if(Qe=0,bn=null,fi(e,k,q,W),o&&si){A=0;break e}break;default:W=Qe,Qe=0,bn=null,fi(e,k,q,W)}}BN(),A=pt;break}catch(oe){e1(e,oe)}while(!0);return n&&e.shellSuspendCounter++,Mr=Jo=null,Fe=s,V.H=h,V.A=y,Pe===null&&(rt=null,Ge=0,sc()),A}function BN(){for(;Pe!==null;)r1(Pe)}function HN(e,n){var o=Fe;Fe|=2;var s=t1(),h=n1();rt!==e||Ge!==n?(Bc=null,zc=ht()+500,di(e,n)):si=ce(e,n);e:do try{if(Qe!==0&&Pe!==null){n=Pe;var y=bn;t:switch(Qe){case 1:Qe=0,bn=null,fi(e,n,y,1);break;case 2:case 9:if(px(y)){Qe=0,bn=null,o1(n);break}n=function(){Qe!==2&&Qe!==9||rt!==e||(Qe=7),lr(e)},y.then(n,n);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:px(y)?(Qe=0,bn=null,o1(n)):(Qe=0,bn=null,fi(e,n,y,7));break;case 5:var A=null;switch(Pe.tag){case 26:A=Pe.memoizedState;case 5:case 27:var k=Pe;if(!A||H1(A)){Qe=0,bn=null;var q=k.sibling;if(q!==null)Pe=q;else{var W=k.return;W!==null?(Pe=W,Pc(W)):Pe=null}break t}}Qe=0,bn=null,fi(e,n,y,5);break;case 6:Qe=0,bn=null,fi(e,n,y,6);break;case 8:Uh(),pt=6;break e;default:throw Error(a(462))}}PN();break}catch(oe){e1(e,oe)}while(!0);return Mr=Jo=null,V.H=s,V.A=h,Fe=o,Pe!==null?0:(rt=null,Ge=0,sc(),pt)}function PN(){for(;Pe!==null&&!Se();)r1(Pe)}function r1(e){var n=Nv(e.alternate,e,Hr);e.memoizedProps=e.pendingProps,n===null?Pc(e):Pe=n}function o1(e){var n=e,o=n.alternate;switch(n.tag){case 15:case 0:n=Ev(o,n,n.pendingProps,n.type,void 0,Ge);break;case 11:n=Ev(o,n,n.pendingProps,n.type.render,n.ref,Ge);break;case 5:oh(n);default:_v(o,n),n=Pe=ax(n,Hr),n=Nv(o,n,Hr)}e.memoizedProps=e.pendingProps,n===null?Pc(e):Pe=n}function fi(e,n,o,s){Mr=Jo=null,oh(n),ri=null,ws=0;var h=n.return;try{if(ON(e,h,n,o,Ge)){pt=1,Mc(e,_n(o,e.current)),Pe=null;return}}catch(y){if(h!==null)throw Pe=h,y;pt=1,Mc(e,_n(o,e.current)),Pe=null;return}n.flags&32768?(Ke||s===1?e=!0:si||(Ge&536870912)!==0?e=!1:(go=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ln.current,s!==null&&s.tag===13&&(s.flags|=16384))),a1(n,e)):Pc(n)}function Pc(e){var n=e;do{if((n.flags&32768)!==0){a1(n,go);return}e=n.return;var o=MN(n.alternate,n,Hr);if(o!==null){Pe=o;return}if(n=n.sibling,n!==null){Pe=n;return}Pe=n=e}while(n!==null);pt===0&&(pt=5)}function a1(e,n){do{var o=_N(e.alternate,e);if(o!==null){o.flags&=32767,Pe=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=o}while(e!==null);pt=6,Pe=null}function i1(e,n,o,s,h,y,A,k,q){e.cancelPendingCommit=null;do Uc();while(Ut!==0);if((Fe&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(y=n.lanes|n.childLanes,y|=Df,en(e,o,y,A,k,q),e===rt&&(Pe=rt=null,Ge=0),ci=n,xo=e,ui=o,Bh=y,Hh=h,Qv=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,VN(Mt,function(){return d1(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=V.T,V.T=null,h=Y.p,Y.p=2,A=Fe,Fe|=4;try{DN(e,n,o)}finally{Fe=A,Y.p=h,V.T=s}}Ut=1,s1(),l1(),c1()}}function s1(){if(Ut===1){Ut=0;var e=xo,n=ci,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=V.T,V.T=null;var s=Y.p;Y.p=2;var h=Fe;Fe|=4;try{Gv(n,e);var y=tm,A=Fb(e.containerInfo),k=y.focusedElem,q=y.selectionRange;if(A!==k&&k&&k.ownerDocument&&Kb(k.ownerDocument.documentElement,k)){if(q!==null&&Rf(k)){var W=q.start,oe=q.end;if(oe===void 0&&(oe=W),"selectionStart"in k)k.selectionStart=W,k.selectionEnd=Math.min(oe,k.value.length);else{var se=k.ownerDocument||document,ee=se&&se.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),Ae=k.textContent.length,Ee=Math.min(q.start,Ae),Je=q.end===void 0?Ee:Math.min(q.end,Ae);!ne.extend&&Ee>Je&&(A=Je,Je=Ee,Ee=A);var F=Xb(k,Ee),K=Xb(k,Je);if(F&&K&&(ne.rangeCount!==1||ne.anchorNode!==F.node||ne.anchorOffset!==F.offset||ne.focusNode!==K.node||ne.focusOffset!==K.offset)){var Z=se.createRange();Z.setStart(F.node,F.offset),ne.removeAllRanges(),Ee>Je?(ne.addRange(Z),ne.extend(K.node,K.offset)):(Z.setEnd(K.node,K.offset),ne.addRange(Z))}}}}for(se=[],ne=k;ne=ne.parentNode;)ne.nodeType===1&&se.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<se.length;k++){var ie=se[k];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Jc=!!em,tm=em=null}finally{Fe=h,Y.p=s,V.T=o}}e.current=n,Ut=2}}function l1(){if(Ut===2){Ut=0;var e=xo,n=ci,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=V.T,V.T=null;var s=Y.p;Y.p=2;var h=Fe;Fe|=4;try{Hv(e,n.alternate,n)}finally{Fe=h,Y.p=s,V.T=o}}Ut=3}}function c1(){if(Ut===4||Ut===3){Ut=0,Bt();var e=xo,n=ci,o=ui,s=Qv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ut=5:(Ut=0,ci=xo=null,u1(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(bo=null),Tr(o),n=n.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(Gn,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=V.T,h=Y.p,Y.p=2,V.T=null;try{for(var y=e.onRecoverableError,A=0;A<s.length;A++){var k=s[A];y(k.value,{componentStack:k.stack})}}finally{V.T=n,Y.p=h}}(ui&3)!==0&&Uc(),lr(e),h=e.pendingLanes,(o&4194090)!==0&&(h&42)!==0?e===Ph?_s++:(_s=0,Ph=e):_s=0,Ds(0)}}function u1(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,fs(n)))}function Uc(e){return s1(),l1(),c1(),d1()}function d1(){if(Ut!==5)return!1;var e=xo,n=Bh;Bh=0;var o=Tr(ui),s=V.T,h=Y.p;try{Y.p=32>o?32:o,V.T=null,o=Hh,Hh=null;var y=xo,A=ui;if(Ut=0,ci=xo=null,ui=0,(Fe&6)!==0)throw Error(a(331));var k=Fe;if(Fe|=4,Kv(y.current),qv(y,y.current,A,o),Fe=k,Ds(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(Gn,y)}catch{}return!0}finally{Y.p=h,V.T=s,u1(e,n)}}function f1(e,n,o){n=_n(o,n),n=bh(e.stateNode,n,2),e=lo(e,n,2),e!==null&&(Oe(e,2),lr(e))}function tt(e,n,o){if(e.tag===3)f1(e,e,o);else for(;n!==null;){if(n.tag===3){f1(n,e,o);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(bo===null||!bo.has(s))){e=_n(o,e),o=gv(2),s=lo(n,o,2),s!==null&&(yv(o,s,n,e),Oe(s,2),lr(s));break}}n=n.return}}function Vh(e,n,o){var s=e.pingCache;if(s===null){s=e.pingCache=new LN;var h=new Set;s.set(n,h)}else h=s.get(n),h===void 0&&(h=new Set,s.set(n,h));h.has(o)||(Ih=!0,h.add(o),e=UN.bind(null,e,n,o),n.then(e,e))}function UN(e,n,o){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,rt===e&&(Ge&o)===o&&(pt===4||pt===3&&(Ge&62914560)===Ge&&300>ht()-zh?(Fe&2)===0&&di(e,0):kh|=o,li===Ge&&(li=0)),lr(e)}function h1(e,n){n===0&&(n=et()),e=Xa(e,n),e!==null&&(Oe(e,n),lr(e))}function $N(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),h1(e,o)}function GN(e,n){var o=0;switch(e.tag){case 13:var s=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),h1(e,o)}function VN(e,n){return we(e,n)}var $c=null,hi=null,qh=!1,Gc=!1,Yh=!1,ia=0;function lr(e){e!==hi&&e.next===null&&(hi===null?$c=hi=e:hi=hi.next=e),Gc=!0,qh||(qh=!0,YN())}function Ds(e,n){if(!Yh&&Gc){Yh=!0;do for(var o=!1,s=$c;s!==null;){if(e!==0){var h=s.pendingLanes;if(h===0)var y=0;else{var A=s.suspendedLanes,k=s.pingedLanes;y=(1<<31-Ht(42|e)+1)-1,y&=h&~(A&~k),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,y1(s,y))}else y=Ge,y=Fi(s,s===rt?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(y&3)===0||ce(s,y)||(o=!0,y1(s,y));s=s.next}while(o);Yh=!1}}function qN(){m1()}function m1(){Gc=qh=!1;var e=0;ia!==0&&(eM()&&(e=ia),ia=0);for(var n=ht(),o=null,s=$c;s!==null;){var h=s.next,y=p1(s,n);y===0?(s.next=null,o===null?$c=h:o.next=h,h===null&&(hi=o)):(o=s,(e!==0||(y&3)!==0)&&(Gc=!0)),s=h}Ds(e)}function p1(e,n){for(var o=e.suspendedLanes,s=e.pingedLanes,h=e.expirationTimes,y=e.pendingLanes&-62914561;0<y;){var A=31-Ht(y),k=1<<A,q=h[A];q===-1?((k&o)===0||(k&s)!==0)&&(h[A]=Re(k,n)):q<=n&&(e.expiredLanes|=k),y&=~k}if(n=rt,o=Ge,o=Fi(e,e===n?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,o===0||e===n&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&xe(s),e.callbackNode=null,e.callbackPriority=0;if((o&3)===0||ce(e,o)){if(n=o&-o,n===e.callbackPriority)return n;switch(s!==null&&xe(s),Tr(o)){case 2:case 8:o=it;break;case 32:o=Mt;break;case 268435456:o=to;break;default:o=Mt}return s=g1.bind(null,e),o=we(o,s),e.callbackPriority=n,e.callbackNode=o,n}return s!==null&&s!==null&&xe(s),e.callbackPriority=2,e.callbackNode=null,2}function g1(e,n){if(Ut!==0&&Ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var o=e.callbackNode;if(Uc()&&e.callbackNode!==o)return null;var s=Ge;return s=Fi(e,e===rt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Wv(e,s,n),p1(e,ht()),e.callbackNode!=null&&e.callbackNode===o?g1.bind(null,e):null)}function y1(e,n){if(Uc())return null;Wv(e,n,!0)}function YN(){nM(function(){(Fe&6)!==0?we(at,qN):m1()})}function Xh(){return ia===0&&(ia=ve()),ia}function b1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ec(""+e)}function x1(e,n){var o=n.ownerDocument.createElement("input");return o.name=n.name,o.value=n.value,e.id&&o.setAttribute("form",e.id),n.parentNode.insertBefore(o,n),e=new FormData(e),o.parentNode.removeChild(o),e}function XN(e,n,o,s,h){if(n==="submit"&&o&&o.stateNode===h){var y=b1((h[on]||null).action),A=s.submitter;A&&(n=(n=A[on]||null)?b1(n.formAction):A.getAttribute("formAction"),n!==null&&(y=n,A=null));var k=new oc("action","action",null,s,h);e.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ia!==0){var q=A?x1(h,A):new FormData(h);hh(o,{pending:!0,data:q,method:h.method,action:y},null,q)}}else typeof y=="function"&&(k.preventDefault(),q=A?x1(h,A):new FormData(h),hh(o,{pending:!0,data:q,method:h.method,action:y},y,q))},currentTarget:h}]})}}for(var Kh=0;Kh<_f.length;Kh++){var Fh=_f[Kh],KN=Fh.toLowerCase(),FN=Fh[0].toUpperCase()+Fh.slice(1);Vn(KN,"on"+FN)}Vn(Wb,"onAnimationEnd"),Vn(Jb,"onAnimationIteration"),Vn(ex,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(fN,"onTransitionRun"),Vn(hN,"onTransitionStart"),Vn(mN,"onTransitionCancel"),Vn(tx,"onTransitionEnd"),za("onMouseEnter",["mouseout","mouseover"]),za("onMouseLeave",["mouseout","mouseover"]),za("onPointerEnter",["pointerout","pointerover"]),za("onPointerLeave",["pointerout","pointerover"]),Vo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Is="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),QN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Is));function v1(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var s=e[o],h=s.event;s=s.listeners;e:{var y=void 0;if(n)for(var A=s.length-1;0<=A;A--){var k=s[A],q=k.instance,W=k.currentTarget;if(k=k.listener,q!==y&&h.isPropagationStopped())break e;y=k,h.currentTarget=W;try{y(h)}catch(oe){Nc(oe)}h.currentTarget=null,y=q}else for(A=0;A<s.length;A++){if(k=s[A],q=k.instance,W=k.currentTarget,k=k.listener,q!==y&&h.isPropagationStopped())break e;y=k,h.currentTarget=W;try{y(h)}catch(oe){Nc(oe)}h.currentTarget=null,y=q}}}}function Ue(e,n){var o=n[lf];o===void 0&&(o=n[lf]=new Set);var s=e+"__bubble";o.has(s)||(S1(n,e,2,!1),o.add(s))}function Qh(e,n,o){var s=0;n&&(s|=4),S1(o,e,s,n)}var Vc="_reactListening"+Math.random().toString(36).slice(2);function Zh(e){if(!e[Vc]){e[Vc]=!0,mb.forEach(function(o){o!=="selectionchange"&&(QN.has(o)||Qh(o,!1,e),Qh(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Vc]||(n[Vc]=!0,Qh("selectionchange",!1,n))}}function S1(e,n,o,s){switch(q1(n)){case 2:var h=wM;break;case 8:h=EM;break;default:h=dm}o=h.bind(null,n,o,e),h=void 0,!xf||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),s?h!==void 0?e.addEventListener(n,o,{capture:!0,passive:h}):e.addEventListener(n,o,!0):h!==void 0?e.addEventListener(n,o,{passive:h}):e.addEventListener(n,o,!1)}function Wh(e,n,o,s,h){var y=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var A=s.tag;if(A===3||A===4){var k=s.stateNode.containerInfo;if(k===h)break;if(A===4)for(A=s.return;A!==null;){var q=A.tag;if((q===3||q===4)&&A.stateNode.containerInfo===h)return;A=A.return}for(;k!==null;){if(A=Ia(k),A===null)return;if(q=A.tag,q===5||q===6||q===26||q===27){s=y=A;continue e}k=k.parentNode}}s=s.return}Rb(function(){var W=y,oe=yf(o),se=[];e:{var ee=nx.get(e);if(ee!==void 0){var ne=oc,Ae=e;switch(e){case"keypress":if(nc(o)===0)break e;case"keydown":case"keyup":ne=VO;break;case"focusin":Ae="focus",ne=wf;break;case"focusout":Ae="blur",ne=wf;break;case"beforeblur":case"afterblur":ne=wf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Mb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=_O;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=XO;break;case Wb:case Jb:case ex:ne=kO;break;case tx:ne=FO;break;case"scroll":case"scrollend":ne=NO;break;case"wheel":ne=ZO;break;case"copy":case"cut":case"paste":ne=zO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Db;break;case"toggle":case"beforetoggle":ne=JO}var Ee=(n&4)!==0,Je=!Ee&&(e==="scroll"||e==="scrollend"),F=Ee?ee!==null?ee+"Capture":null:ee;Ee=[];for(var K=W,Z;K!==null;){var ie=K;if(Z=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Z===null||F===null||(ie=Ji(K,F),ie!=null&&Ee.push(ks(K,ie,Z))),Je)break;K=K.return}0<Ee.length&&(ee=new ne(ee,Ae,null,o,oe),se.push({event:ee,listeners:Ee}))}}if((n&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",ee&&o!==gf&&(Ae=o.relatedTarget||o.fromElement)&&(Ia(Ae)||Ae[Da]))break e;if((ne||ee)&&(ee=oe.window===oe?oe:(ee=oe.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(Ae=o.relatedTarget||o.toElement,ne=W,Ae=Ae?Ia(Ae):null,Ae!==null&&(Je=l(Ae),Ee=Ae.tag,Ae!==Je||Ee!==5&&Ee!==27&&Ee!==6)&&(Ae=null)):(ne=null,Ae=W),ne!==Ae)){if(Ee=Mb,ie="onMouseLeave",F="onMouseEnter",K="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=Db,ie="onPointerLeave",F="onPointerEnter",K="pointer"),Je=ne==null?ee:Wi(ne),Z=Ae==null?ee:Wi(Ae),ee=new Ee(ie,K+"leave",ne,o,oe),ee.target=Je,ee.relatedTarget=Z,ie=null,Ia(oe)===W&&(Ee=new Ee(F,K+"enter",Ae,o,oe),Ee.target=Z,Ee.relatedTarget=Je,ie=Ee),Je=ie,ne&&Ae)t:{for(Ee=ne,F=Ae,K=0,Z=Ee;Z;Z=mi(Z))K++;for(Z=0,ie=F;ie;ie=mi(ie))Z++;for(;0<K-Z;)Ee=mi(Ee),K--;for(;0<Z-K;)F=mi(F),Z--;for(;K--;){if(Ee===F||F!==null&&Ee===F.alternate)break t;Ee=mi(Ee),F=mi(F)}Ee=null}else Ee=null;ne!==null&&C1(se,ee,ne,Ee,!1),Ae!==null&&Je!==null&&C1(se,Je,Ae,Ee,!0)}}e:{if(ee=W?Wi(W):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var pe=Ub;else if(Hb(ee))if($b)pe=cN;else{pe=sN;var ze=iN}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&pf(W.elementType)&&(pe=Ub):pe=lN;if(pe&&(pe=pe(e,W))){Pb(se,pe,o,oe);break e}ze&&ze(e,ee,W),e==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&mf(ee,"number",ee.value)}switch(ze=W?Wi(W):window,e){case"focusin":(Hb(ze)||ze.contentEditable==="true")&&(Va=ze,Of=W,ss=null);break;case"focusout":ss=Of=Va=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,Qb(se,o,oe);break;case"selectionchange":if(dN)break;case"keydown":case"keyup":Qb(se,o,oe)}var be;if(Tf)e:{switch(e){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else Ga?zb(e,o)&&(Te="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(Te="onCompositionStart");Te&&(Ib&&o.locale!=="ko"&&(Ga||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&Ga&&(be=Ob()):(oo=oe,vf="value"in oo?oo.value:oo.textContent,Ga=!0)),ze=qc(W,Te),0<ze.length&&(Te=new _b(Te,e,null,o,oe),se.push({event:Te,listeners:ze}),be?Te.data=be:(be=Bb(o),be!==null&&(Te.data=be)))),(be=tN?nN(e,o):rN(e,o))&&(Te=qc(W,"onBeforeInput"),0<Te.length&&(ze=new _b("onBeforeInput","beforeinput",null,o,oe),se.push({event:ze,listeners:Te}),ze.data=be)),XN(se,e,W,o,oe)}v1(se,n)})}function ks(e,n,o){return{instance:e,listener:n,currentTarget:o}}function qc(e,n){for(var o=n+"Capture",s=[];e!==null;){var h=e,y=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||y===null||(h=Ji(e,o),h!=null&&s.unshift(ks(e,h,y)),h=Ji(e,n),h!=null&&s.push(ks(e,h,y))),e.tag===3)return s;e=e.return}return[]}function mi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function C1(e,n,o,s,h){for(var y=n._reactName,A=[];o!==null&&o!==s;){var k=o,q=k.alternate,W=k.stateNode;if(k=k.tag,q!==null&&q===s)break;k!==5&&k!==26&&k!==27||W===null||(q=W,h?(W=Ji(o,y),W!=null&&A.unshift(ks(o,W,q))):h||(W=Ji(o,y),W!=null&&A.push(ks(o,W,q)))),o=o.return}A.length!==0&&e.push({event:n,listeners:A})}var ZN=/\r\n?/g,WN=/\u0000|\uFFFD/g;function w1(e){return(typeof e=="string"?e:""+e).replace(ZN,`
51
+ `).replace(WN,"")}function E1(e,n){return n=w1(n),w1(e)===n}function Yc(){}function We(e,n,o,s,h,y){switch(o){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||Pa(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&Pa(e,""+s);break;case"className":Zl(e,"class",s);break;case"tabIndex":Zl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Zl(e,o,s);break;case"style":jb(e,s,y);break;case"data":if(n!=="object"){Zl(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||o!=="href")){e.removeAttribute(o);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(o);break}s=ec(""+s),e.setAttribute(o,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(o==="formAction"?(n!=="input"&&We(e,n,"name",h.name,h,null),We(e,n,"formEncType",h.formEncType,h,null),We(e,n,"formMethod",h.formMethod,h,null),We(e,n,"formTarget",h.formTarget,h,null)):(We(e,n,"encType",h.encType,h,null),We(e,n,"method",h.method,h,null),We(e,n,"target",h.target,h,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(o);break}s=ec(""+s),e.setAttribute(o,s);break;case"onClick":s!=null&&(e.onclick=Yc);break;case"onScroll":s!=null&&Ue("scroll",e);break;case"onScrollEnd":s!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}o=ec(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""+s):e.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":s===!0?e.setAttribute(o,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,s):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(o,s):e.removeAttribute(o);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(o):e.setAttribute(o,s);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),Ql(e,"popover",s);break;case"xlinkActuate":jr(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":jr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":jr(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":jr(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":jr(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":jr(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":jr(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":jr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":jr(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ql(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=RO.get(o)||o,Ql(e,o,s))}}function Jh(e,n,o,s,h,y){switch(o){case"style":jb(e,s,y);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"children":typeof s=="string"?Pa(e,s):(typeof s=="number"||typeof s=="bigint")&&Pa(e,""+s);break;case"onScroll":s!=null&&Ue("scroll",e);break;case"onScrollEnd":s!=null&&Ue("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Yc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pb.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),n=o.slice(2,h?o.length-7:void 0),y=e[on]||null,y=y!=null?y[o]:null,typeof y=="function"&&e.removeEventListener(n,y,h),typeof s=="function")){typeof y!="function"&&y!==null&&(o in e?e[o]=null:e.hasAttribute(o)&&e.removeAttribute(o)),e.addEventListener(n,s,h);break e}o in e?e[o]=s:s===!0?e.setAttribute(o,""):Ql(e,o,s)}}}function $t(e,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var s=!1,h=!1,y;for(y in o)if(o.hasOwnProperty(y)){var A=o[y];if(A!=null)switch(y){case"src":s=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:We(e,n,y,A,o,null)}}h&&We(e,n,"srcSet",o.srcSet,o,null),s&&We(e,n,"src",o.src,o,null);return;case"input":Ue("invalid",e);var k=y=A=h=null,q=null,W=null;for(s in o)if(o.hasOwnProperty(s)){var oe=o[s];if(oe!=null)switch(s){case"name":h=oe;break;case"type":A=oe;break;case"checked":q=oe;break;case"defaultChecked":W=oe;break;case"value":y=oe;break;case"defaultValue":k=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,n));break;default:We(e,n,s,oe,o,null)}}Cb(e,y,k,q,W,A,h,!1),Wl(e);return;case"select":Ue("invalid",e),s=A=y=null;for(h in o)if(o.hasOwnProperty(h)&&(k=o[h],k!=null))switch(h){case"value":y=k;break;case"defaultValue":A=k;break;case"multiple":s=k;default:We(e,n,h,k,o,null)}n=y,o=A,e.multiple=!!s,n!=null?Ha(e,!!s,n,!1):o!=null&&Ha(e,!!s,o,!0);return;case"textarea":Ue("invalid",e),y=h=s=null;for(A in o)if(o.hasOwnProperty(A)&&(k=o[A],k!=null))switch(A){case"value":s=k;break;case"defaultValue":h=k;break;case"children":y=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:We(e,n,A,k,o,null)}Eb(e,s,h,y),Wl(e);return;case"option":for(q in o)if(o.hasOwnProperty(q)&&(s=o[q],s!=null))switch(q){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:We(e,n,q,s,o,null)}return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(s=0;s<Is.length;s++)Ue(Is[s],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in o)if(o.hasOwnProperty(W)&&(s=o[W],s!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:We(e,n,W,s,o,null)}return;default:if(pf(n)){for(oe in o)o.hasOwnProperty(oe)&&(s=o[oe],s!==void 0&&Jh(e,n,oe,s,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(s=o[k],s!=null&&We(e,n,k,s,o,null))}function JN(e,n,o,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,y=null,A=null,k=null,q=null,W=null,oe=null;for(ne in o){var se=o[ne];if(o.hasOwnProperty(ne)&&se!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":q=se;default:s.hasOwnProperty(ne)||We(e,n,ne,null,s,se)}}for(var ee in s){var ne=s[ee];if(se=o[ee],s.hasOwnProperty(ee)&&(ne!=null||se!=null))switch(ee){case"type":y=ne;break;case"name":h=ne;break;case"checked":W=ne;break;case"defaultChecked":oe=ne;break;case"value":A=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,n));break;default:ne!==se&&We(e,n,ee,ne,s,se)}}hf(e,A,k,q,W,oe,y,h);return;case"select":ne=A=k=ee=null;for(y in o)if(q=o[y],o.hasOwnProperty(y)&&q!=null)switch(y){case"value":break;case"multiple":ne=q;default:s.hasOwnProperty(y)||We(e,n,y,null,s,q)}for(h in s)if(y=s[h],q=o[h],s.hasOwnProperty(h)&&(y!=null||q!=null))switch(h){case"value":ee=y;break;case"defaultValue":k=y;break;case"multiple":A=y;default:y!==q&&We(e,n,h,y,s,q)}n=k,o=A,s=ne,ee!=null?Ha(e,!!o,ee,!1):!!s!=!!o&&(n!=null?Ha(e,!!o,n,!0):Ha(e,!!o,o?[]:"",!1));return;case"textarea":ne=ee=null;for(k in o)if(h=o[k],o.hasOwnProperty(k)&&h!=null&&!s.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:We(e,n,k,null,s,h)}for(A in s)if(h=s[A],y=o[A],s.hasOwnProperty(A)&&(h!=null||y!=null))switch(A){case"value":ee=h;break;case"defaultValue":ne=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==y&&We(e,n,A,h,s,y)}wb(e,ee,ne);return;case"option":for(var Ae in o)if(ee=o[Ae],o.hasOwnProperty(Ae)&&ee!=null&&!s.hasOwnProperty(Ae))switch(Ae){case"selected":e.selected=!1;break;default:We(e,n,Ae,null,s,ee)}for(q in s)if(ee=s[q],ne=o[q],s.hasOwnProperty(q)&&ee!==ne&&(ee!=null||ne!=null))switch(q){case"selected":e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:We(e,n,q,ee,s,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ee in o)ee=o[Ee],o.hasOwnProperty(Ee)&&ee!=null&&!s.hasOwnProperty(Ee)&&We(e,n,Ee,null,s,ee);for(W in s)if(ee=s[W],ne=o[W],s.hasOwnProperty(W)&&ee!==ne&&(ee!=null||ne!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,n));break;default:We(e,n,W,ee,s,ne)}return;default:if(pf(n)){for(var Je in o)ee=o[Je],o.hasOwnProperty(Je)&&ee!==void 0&&!s.hasOwnProperty(Je)&&Jh(e,n,Je,void 0,s,ee);for(oe in s)ee=s[oe],ne=o[oe],!s.hasOwnProperty(oe)||ee===ne||ee===void 0&&ne===void 0||Jh(e,n,oe,ee,s,ne);return}}for(var F in o)ee=o[F],o.hasOwnProperty(F)&&ee!=null&&!s.hasOwnProperty(F)&&We(e,n,F,null,s,ee);for(se in s)ee=s[se],ne=o[se],!s.hasOwnProperty(se)||ee===ne||ee==null&&ne==null||We(e,n,se,ee,s,ne)}var em=null,tm=null;function Xc(e){return e.nodeType===9?e:e.ownerDocument}function T1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function j1(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function nm(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var rm=null;function eM(){var e=window.event;return e&&e.type==="popstate"?e===rm?!1:(rm=e,!0):(rm=null,!1)}var A1=typeof setTimeout=="function"?setTimeout:void 0,tM=typeof clearTimeout=="function"?clearTimeout:void 0,R1=typeof Promise=="function"?Promise:void 0,nM=typeof queueMicrotask=="function"?queueMicrotask:typeof R1<"u"?function(e){return R1.resolve(null).then(e).catch(rM)}:A1;function rM(e){setTimeout(function(){throw e})}function So(e){return e==="head"}function O1(e,n){var o=n,s=0,h=0;do{var y=o.nextSibling;if(e.removeChild(o),y&&y.nodeType===8)if(o=y.data,o==="/$"){if(0<s&&8>s){o=s;var A=e.ownerDocument;if(o&1&&Ls(A.documentElement),o&2&&Ls(A.body),o&4)for(o=A.head,Ls(o),A=o.firstChild;A;){var k=A.nextSibling,q=A.nodeName;A[Zi]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&A.rel.toLowerCase()==="stylesheet"||o.removeChild(A),A=k}}if(h===0){e.removeChild(y),Vs(n);return}h--}else o==="$"||o==="$?"||o==="$!"?h++:s=o.charCodeAt(0)-48;else s=0;o=y}while(o);Vs(n)}function om(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":om(o),cf(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function oM(e,n,o,s){for(;e.nodeType===1;){var h=o;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Zi])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(y=e.getAttribute("rel"),y==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(y!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(y=e.getAttribute("src"),(y!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&y&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var y=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===y)return e}else return e;if(e=Yn(e.nextSibling),e===null)break}return null}function aM(e,n,o){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o||(e=Yn(e.nextSibling),e===null))return null;return e}function am(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function iM(e,n){var o=e.ownerDocument;if(e.data!=="$?"||o.readyState==="complete")n();else{var s=function(){n(),o.removeEventListener("DOMContentLoaded",s)};o.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Yn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="F!"||n==="F")break;if(n==="/$")return null}}return e}var im=null;function N1(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}function M1(e,n,o){switch(n=Xc(o),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Ls(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);cf(e)}var Bn=new Map,_1=new Set;function Kc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pr=Y.d;Y.d={f:sM,r:lM,D:cM,C:uM,L:dM,m:fM,X:mM,S:hM,M:pM};function sM(){var e=Pr.f(),n=Hc();return e||n}function lM(e){var n=ka(e);n!==null&&n.tag===5&&n.type==="form"?Wx(n):Pr.r(e)}var pi=typeof document>"u"?null:document;function D1(e,n,o){var s=pi;if(s&&typeof n=="string"&&n){var h=Mn(n);h='link[rel="'+e+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),_1.has(h)||(_1.add(h),e={rel:e,crossOrigin:o,href:n},s.querySelector(h)===null&&(n=s.createElement("link"),$t(n,"link",e),_t(n),s.head.appendChild(n)))}}function cM(e){Pr.D(e),D1("dns-prefetch",e,null)}function uM(e,n){Pr.C(e,n),D1("preconnect",e,n)}function dM(e,n,o){Pr.L(e,n,o);var s=pi;if(s&&e&&n){var h='link[rel="preload"][as="'+Mn(n)+'"]';n==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Mn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Mn(o.imageSizes)+'"]')):h+='[href="'+Mn(e)+'"]';var y=h;switch(n){case"style":y=gi(e);break;case"script":y=yi(e)}Bn.has(y)||(e=C({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:e,as:n},o),Bn.set(y,e),s.querySelector(h)!==null||n==="style"&&s.querySelector(zs(y))||n==="script"&&s.querySelector(Bs(y))||(n=s.createElement("link"),$t(n,"link",e),_t(n),s.head.appendChild(n)))}}function fM(e,n){Pr.m(e,n);var o=pi;if(o&&e){var s=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+Mn(s)+'"][href="'+Mn(e)+'"]',y=h;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=yi(e)}if(!Bn.has(y)&&(e=C({rel:"modulepreload",href:e},n),Bn.set(y,e),o.querySelector(h)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Bs(y)))return}s=o.createElement("link"),$t(s,"link",e),_t(s),o.head.appendChild(s)}}}function hM(e,n,o){Pr.S(e,n,o);var s=pi;if(s&&e){var h=La(s).hoistableStyles,y=gi(e);n=n||"default";var A=h.get(y);if(!A){var k={loading:0,preload:null};if(A=s.querySelector(zs(y)))k.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":n},o),(o=Bn.get(y))&&sm(e,o);var q=A=s.createElement("link");_t(q),$t(q,"link",e),q._p=new Promise(function(W,oe){q.onload=W,q.onerror=oe}),q.addEventListener("load",function(){k.loading|=1}),q.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Fc(A,n,s)}A={type:"stylesheet",instance:A,count:1,state:k},h.set(y,A)}}}function mM(e,n){Pr.X(e,n);var o=pi;if(o&&e){var s=La(o).hoistableScripts,h=yi(e),y=s.get(h);y||(y=o.querySelector(Bs(h)),y||(e=C({src:e,async:!0},n),(n=Bn.get(h))&&lm(e,n),y=o.createElement("script"),_t(y),$t(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function pM(e,n){Pr.M(e,n);var o=pi;if(o&&e){var s=La(o).hoistableScripts,h=yi(e),y=s.get(h);y||(y=o.querySelector(Bs(h)),y||(e=C({src:e,async:!0,type:"module"},n),(n=Bn.get(h))&&lm(e,n),y=o.createElement("script"),_t(y),$t(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function I1(e,n,o,s){var h=(h=ae.current)?Kc(h):null;if(!h)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(n=gi(o.href),o=La(h).hoistableStyles,s=o.get(n),s||(s={type:"style",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=gi(o.href);var y=La(h).hoistableStyles,A=y.get(e);if(A||(h=h.ownerDocument||h,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(e,A),(y=h.querySelector(zs(e)))&&!y._p&&(A.instance=y,A.state.loading=5),Bn.has(e)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Bn.set(e,o),y||gM(h,e,o,A.state))),n&&s===null)throw Error(a(528,""));return A}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=yi(o),o=La(h).hoistableScripts,s=o.get(n),s||(s={type:"script",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function gi(e){return'href="'+Mn(e)+'"'}function zs(e){return'link[rel="stylesheet"]['+e+"]"}function k1(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function gM(e,n,o,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),$t(n,"link",o),_t(n),e.head.appendChild(n))}function yi(e){return'[src="'+Mn(e)+'"]'}function Bs(e){return"script[async]"+e}function L1(e,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+Mn(o.href)+'"]');if(s)return n.instance=s,_t(s),s;var h=C({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),_t(s),$t(s,"style",h),Fc(s,o.precedence,e),n.instance=s;case"stylesheet":h=gi(o.href);var y=e.querySelector(zs(h));if(y)return n.state.loading|=4,n.instance=y,_t(y),y;s=k1(o),(h=Bn.get(h))&&sm(s,h),y=(e.ownerDocument||e).createElement("link"),_t(y);var A=y;return A._p=new Promise(function(k,q){A.onload=k,A.onerror=q}),$t(y,"link",s),n.state.loading|=4,Fc(y,o.precedence,e),n.instance=y;case"script":return y=yi(o.src),(h=e.querySelector(Bs(y)))?(n.instance=h,_t(h),h):(s=o,(h=Bn.get(y))&&(s=C({},o),lm(s,h)),e=e.ownerDocument||e,h=e.createElement("script"),_t(h),$t(h,"link",s),e.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Fc(s,o.precedence,e));return n.instance}function Fc(e,n,o){for(var s=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=s.length?s[s.length-1]:null,y=h,A=0;A<s.length;A++){var k=s[A];if(k.dataset.precedence===n)y=k;else if(y!==h)break}y?y.parentNode.insertBefore(e,y.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(e,n.firstChild))}function sm(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function lm(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Qc=null;function z1(e,n,o){if(Qc===null){var s=new Map,h=Qc=new Map;h.set(o,s)}else h=Qc,s=h.get(o),s||(s=new Map,h.set(o,s));if(s.has(e))return s;for(s.set(e,null),o=o.getElementsByTagName(e),h=0;h<o.length;h++){var y=o[h];if(!(y[Zi]||y[Qt]||e==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var A=y.getAttribute(n)||"";A=e+A;var k=s.get(A);k?k.push(y):s.set(A,[y])}}return s}function B1(e,n,o){e=e.ownerDocument||e,e.head.insertBefore(o,n==="title"?e.querySelector("head > title"):null)}function yM(e,n,o){if(o===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function H1(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Hs=null;function bM(){}function xM(e,n,o){if(Hs===null)throw Error(a(475));var s=Hs;if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var h=gi(o.href),y=e.querySelector(zs(h));if(y){e=y._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=Zc.bind(s),e.then(s,s)),n.state.loading|=4,n.instance=y,_t(y);return}y=e.ownerDocument||e,o=k1(o),(h=Bn.get(h))&&sm(o,h),y=y.createElement("link"),_t(y);var A=y;A._p=new Promise(function(k,q){A.onload=k,A.onerror=q}),$t(y,"link",o),n.instance=y}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(s.count++,n=Zc.bind(s),e.addEventListener("load",n),e.addEventListener("error",n))}}function vM(){if(Hs===null)throw Error(a(475));var e=Hs;return e.stylesheets&&e.count===0&&cm(e,e.stylesheets),0<e.count?function(n){var o=setTimeout(function(){if(e.stylesheets&&cm(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(o)}}:null}function Zc(){if(this.count--,this.count===0){if(this.stylesheets)cm(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Wc=null;function cm(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wc=new Map,n.forEach(SM,e),Wc=null,Zc.call(e))}function SM(e,n){if(!(n.state.loading&4)){var o=Wc.get(e);if(o)var s=o.get(null);else{o=new Map,Wc.set(e,o);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<h.length;y++){var A=h[y];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(o.set(A.dataset.precedence,A),s=A)}s&&o.set(null,s)}h=n.instance,A=h.getAttribute("data-precedence"),y=o.get(A)||s,y===s&&o.set(null,h),o.set(A,h),this.count++,s=Zc.bind(this),h.addEventListener("load",s),h.addEventListener("error",s),y?y.parentNode.insertBefore(h,y.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),n.state.loading|=4}}var Ps={$$typeof:R,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function CM(e,n,o,s,h,y,A,k){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.hiddenUpdates=Ft(null),this.identifierPrefix=s,this.onUncaughtError=h,this.onCaughtError=y,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function P1(e,n,o,s,h,y,A,k,q,W,oe,se){return e=new CM(e,n,o,A,k,q,W,se),n=1,y===!0&&(n|=24),y=pn(3,null,null,n),e.current=y,y.stateNode=e,n=Vf(),n.refCount++,e.pooledCache=n,n.refCount++,y.memoizedState={element:s,isDehydrated:o,cache:n},Kf(y),e}function U1(e){return e?(e=Ka,e):Ka}function $1(e,n,o,s,h,y){h=U1(h),s.context===null?s.context=h:s.pendingContext=h,s=so(n),s.payload={element:o},y=y===void 0?null:y,y!==null&&(s.callback=y),o=lo(e,s,n),o!==null&&(vn(o,e,n),gs(o,e,n))}function G1(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function um(e,n){G1(e,n),(e=e.alternate)&&G1(e,n)}function V1(e){if(e.tag===13){var n=Xa(e,67108864);n!==null&&vn(n,e,67108864),um(e,67108864)}}var Jc=!0;function wM(e,n,o,s){var h=V.T;V.T=null;var y=Y.p;try{Y.p=2,dm(e,n,o,s)}finally{Y.p=y,V.T=h}}function EM(e,n,o,s){var h=V.T;V.T=null;var y=Y.p;try{Y.p=8,dm(e,n,o,s)}finally{Y.p=y,V.T=h}}function dm(e,n,o,s){if(Jc){var h=fm(s);if(h===null)Wh(e,n,s,eu,o),Y1(e,s);else if(jM(h,e,n,o,s))s.stopPropagation();else if(Y1(e,s),n&4&&-1<TM.indexOf(e)){for(;h!==null;){var y=ka(h);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var A=no(y.pendingLanes);if(A!==0){var k=y;for(k.pendingLanes|=2,k.entangledLanes|=2;A;){var q=1<<31-Ht(A);k.entanglements[1]|=q,A&=~q}lr(y),(Fe&6)===0&&(zc=ht()+500,Ds(0))}}break;case 13:k=Xa(y,2),k!==null&&vn(k,y,2),Hc(),um(y,2)}if(y=fm(s),y===null&&Wh(e,n,s,eu,o),y===h)break;h=y}h!==null&&s.stopPropagation()}else Wh(e,n,s,null,o)}}function fm(e){return e=yf(e),hm(e)}var eu=null;function hm(e){if(eu=null,e=Ia(e),e!==null){var n=l(e);if(n===null)e=null;else{var o=n.tag;if(o===13){if(e=u(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return eu=e,null}function q1(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(he()){case at:return 2;case it:return 8;case Mt:case $n:return 32;case to:return 268435456;default:return 32}default:return 32}}var mm=!1,Co=null,wo=null,Eo=null,Us=new Map,$s=new Map,To=[],TM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Y1(e,n){switch(e){case"focusin":case"focusout":Co=null;break;case"dragenter":case"dragleave":wo=null;break;case"mouseover":case"mouseout":Eo=null;break;case"pointerover":case"pointerout":Us.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":$s.delete(n.pointerId)}}function Gs(e,n,o,s,h,y){return e===null||e.nativeEvent!==y?(e={blockedOn:n,domEventName:o,eventSystemFlags:s,nativeEvent:y,targetContainers:[h]},n!==null&&(n=ka(n),n!==null&&V1(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),e)}function jM(e,n,o,s,h){switch(n){case"focusin":return Co=Gs(Co,e,n,o,s,h),!0;case"dragenter":return wo=Gs(wo,e,n,o,s,h),!0;case"mouseover":return Eo=Gs(Eo,e,n,o,s,h),!0;case"pointerover":var y=h.pointerId;return Us.set(y,Gs(Us.get(y)||null,e,n,o,s,h)),!0;case"gotpointercapture":return y=h.pointerId,$s.set(y,Gs($s.get(y)||null,e,n,o,s,h)),!0}return!1}function X1(e){var n=Ia(e.target);if(n!==null){var o=l(n);if(o!==null){if(n=o.tag,n===13){if(n=u(o),n!==null){e.blockedOn=n,sf(e.priority,function(){if(o.tag===13){var s=xn();s=_a(s);var h=Xa(o,s);h!==null&&vn(h,o,s),um(o,s)}});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tu(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=fm(e.nativeEvent);if(o===null){o=e.nativeEvent;var s=new o.constructor(o.type,o);gf=s,o.target.dispatchEvent(s),gf=null}else return n=ka(o),n!==null&&V1(n),e.blockedOn=o,!1;n.shift()}return!0}function K1(e,n,o){tu(e)&&o.delete(n)}function AM(){mm=!1,Co!==null&&tu(Co)&&(Co=null),wo!==null&&tu(wo)&&(wo=null),Eo!==null&&tu(Eo)&&(Eo=null),Us.forEach(K1),$s.forEach(K1)}function nu(e,n){e.blockedOn===n&&(e.blockedOn=null,mm||(mm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,AM)))}var ru=null;function F1(e){ru!==e&&(ru=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ru===e&&(ru=null);for(var n=0;n<e.length;n+=3){var o=e[n],s=e[n+1],h=e[n+2];if(typeof s!="function"){if(hm(s||o)===null)continue;break}var y=ka(o);y!==null&&(e.splice(n,3),n-=3,hh(y,{pending:!0,data:h,method:o.method,action:s},s,h))}}))}function Vs(e){function n(q){return nu(q,e)}Co!==null&&nu(Co,e),wo!==null&&nu(wo,e),Eo!==null&&nu(Eo,e),Us.forEach(n),$s.forEach(n);for(var o=0;o<To.length;o++){var s=To[o];s.blockedOn===e&&(s.blockedOn=null)}for(;0<To.length&&(o=To[0],o.blockedOn===null);)X1(o),o.blockedOn===null&&To.shift();if(o=(e.ownerDocument||e).$$reactFormReplay,o!=null)for(s=0;s<o.length;s+=3){var h=o[s],y=o[s+1],A=h[on]||null;if(typeof y=="function")A||F1(o);else if(A){var k=null;if(y&&y.hasAttribute("formAction")){if(h=y,A=y[on]||null)k=A.formAction;else if(hm(h)!==null)continue}else k=A.action;typeof k=="function"?o[s+1]=k:(o.splice(s,3),s-=3),F1(o)}}}function pm(e){this._internalRoot=e}ou.prototype.render=pm.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var o=n.current,s=xn();$1(o,s,e,n,null,null)},ou.prototype.unmount=pm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;$1(e.current,2,null,e,null,null),Hc(),n[Da]=null}};function ou(e){this._internalRoot=e}ou.prototype.unstable_scheduleHydration=function(e){if(e){var n=rr();e={blockedOn:null,target:e,priority:n};for(var o=0;o<To.length&&n!==0&&n<To[o].priority;o++);To.splice(o,0,e),o===0&&X1(e)}};var Q1=r.version;if(Q1!=="19.1.1")throw Error(a(527,Q1,"19.1.1"));Y.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=m(n),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var RM={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!au.isDisabled&&au.supportsFiber)try{Gn=au.inject(RM),At=au}catch{}}return Mi.createRoot=function(e,n){if(!c(e))throw Error(a(299));var o=!1,s="",h=fv,y=hv,A=mv,k=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(A=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(k=n.unstable_transitionCallbacks)),n=P1(e,1,!1,null,null,o,s,h,y,A,k,null),e[Da]=n.current,Zh(e),new pm(n)},Mi.hydrateRoot=function(e,n,o){if(!c(e))throw Error(a(299));var s=!1,h="",y=fv,A=hv,k=mv,q=null,W=null;return o!=null&&(o.unstable_strictMode===!0&&(s=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(A=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(q=o.unstable_transitionCallbacks),o.formState!==void 0&&(W=o.formState)),n=P1(e,1,!0,n,o??null,s,h,y,A,k,q,W),n.context=U1(null),o=n.current,s=xn(),s=_a(s),h=so(s),h.callback=null,lo(o,h,s),o=s,n.current.lanes=o,Oe(n,o),lr(n),e[Da]=n.current,Zh(e),new ou(n)},Mi.version="19.1.1",Mi}var Zm;function tC(){if(Zm)return Mu.exports;Zm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Mu.exports=eC(),Mu.exports}var nC=tC(),Yr=Fm();function Wm(t){var r,i,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var c=t.length;for(r=0;r<c;r++)t[r]&&(i=Wm(t[r]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}function Jm(){for(var t,r,i=0,a="",c=arguments.length;i<c;i++)(t=arguments[i])&&(r=Wm(t))&&(a&&(a+=" "),a+=r);return a}const rC=(t,r)=>{const i=new Array(t.length+r.length);for(let a=0;a<t.length;a++)i[a]=t[a];for(let a=0;a<r.length;a++)i[t.length+a]=r[a];return i},oC=(t,r)=>({classGroupId:t,validator:r}),ep=(t=new Map,r=null,i)=>({nextPart:t,validators:r,classGroupId:i}),nl="-",tp=[],aC="arbitrary..",iC=t=>{const r=lC(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return sC(u);const d=u.split(nl),m=d[0]===""&&d.length>1?1:0;return np(d,m,r)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=a[u],p=i[u];return m?p?rC(p,m):m:p||tp}return i[u]||tp}}},np=(t,r,i)=>{if(t.length-r===0)return i.classGroupId;const c=t[r],l=i.nextPart.get(c);if(l){const p=np(t,r+1,l);if(p)return p}const u=i.validators;if(u===null)return;const d=r===0?t.join(nl):t.slice(r).join(nl),m=u.length;for(let p=0;p<m;p++){const C=u[p];if(C.validator(d))return C.classGroupId}},sC=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=t.slice(1,-1),i=r.indexOf(":"),a=r.slice(0,i);return a?aC+a:void 0})(),lC=t=>{const{theme:r,classGroups:i}=t;return cC(i,r)},cC=(t,r)=>{const i=ep();for(const a in t){const c=t[a];ku(c,i,a,r)}return i},ku=(t,r,i,a)=>{const c=t.length;for(let l=0;l<c;l++){const u=t[l];uC(u,r,i,a)}},uC=(t,r,i,a)=>{if(typeof t=="string"){dC(t,r,i);return}if(typeof t=="function"){fC(t,r,i,a);return}hC(t,r,i,a)},dC=(t,r,i)=>{const a=t===""?r:rp(r,t);a.classGroupId=i},fC=(t,r,i,a)=>{if(mC(t)){ku(t(a),r,i,a);return}r.validators===null&&(r.validators=[]),r.validators.push(oC(i,t))},hC=(t,r,i,a)=>{const c=Object.entries(t),l=c.length;for(let u=0;u<l;u++){const[d,m]=c[u];ku(m,rp(r,d),i,a)}},rp=(t,r)=>{let i=t;const a=r.split(nl),c=a.length;for(let l=0;l<c;l++){const u=a[l];let d=i.nextPart.get(u);d||(d=ep(),i.nextPart.set(u,d)),i=d}return i},mC=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,pC=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,i=Object.create(null),a=Object.create(null);const c=(l,u)=>{i[l]=u,r++,r>t&&(r=0,a=i,i=Object.create(null))};return{get(l){let u=i[l];if(u!==void 0)return u;if((u=a[l])!==void 0)return c(l,u),u},set(l,u){l in i?i[l]=u:c(l,u)}}},Lu="!",op=":",gC=[],ap=(t,r,i,a,c)=>({modifiers:t,hasImportantModifier:r,baseClassName:i,maybePostfixModifierPosition:a,isExternal:c}),yC=t=>{const{prefix:r,experimentalParseClassName:i}=t;let a=c=>{const l=[];let u=0,d=0,m=0,p;const C=c.length;for(let S=0;S<C;S++){const w=c[S];if(u===0&&d===0){if(w===op){l.push(c.slice(m,S)),m=S+1;continue}if(w==="/"){p=S;continue}}w==="["?u++:w==="]"?u--:w==="("?d++:w===")"&&d--}const g=l.length===0?c:c.slice(m);let b=g,x=!1;g.endsWith(Lu)?(b=g.slice(0,-1),x=!0):g.startsWith(Lu)&&(b=g.slice(1),x=!0);const v=p&&p>m?p-m:void 0;return ap(l,x,b,v)};if(r){const c=r+op,l=a;a=u=>u.startsWith(c)?l(u.slice(c.length)):ap(gC,!1,u,void 0,!0)}if(i){const c=a;a=l=>i({className:l,parseClassName:c})}return a},bC=t=>{const r=new Map;return t.orderSensitiveModifiers.forEach((i,a)=>{r.set(i,1e6+a)}),i=>{const a=[];let c=[];for(let l=0;l<i.length;l++){const u=i[l],d=u[0]==="[",m=r.has(u);d||m?(c.length>0&&(c.sort(),a.push(...c),c=[]),a.push(u)):c.push(u)}return c.length>0&&(c.sort(),a.push(...c)),a}},xC=t=>({cache:pC(t.cacheSize),parseClassName:yC(t),sortModifiers:bC(t),postfixLookupClassGroupIds:vC(t),...iC(t)}),vC=t=>{const r=Object.create(null),i=t.postfixLookupClassGroups;if(i)for(let a=0;a<i.length;a++)r[i[a]]=!0;return r},SC=/\s+/,CC=(t,r)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:c,sortModifiers:l,postfixLookupClassGroupIds:u}=r,d=[],m=t.trim().split(SC);let p="";for(let C=m.length-1;C>=0;C-=1){const g=m[C],{isExternal:b,modifiers:x,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:w}=i(g);if(b){p=g+(p.length>0?" "+p:p);continue}let T=!!w,j;if(T){const _=S.substring(0,w);j=a(_);const I=j&&u[j]?a(S):void 0;I&&I!==j&&(j=I,T=!1)}else j=a(S);if(!j){if(!T){p=g+(p.length>0?" "+p:p);continue}if(j=a(S),!j){p=g+(p.length>0?" "+p:p);continue}T=!1}const R=x.length===0?"":x.length===1?x[0]:l(x).join(":"),O=v?R+Lu:R,M=O+j;if(d.indexOf(M)>-1)continue;d.push(M);const D=c(j,T);for(let _=0;_<D.length;++_){const I=D[_];d.push(O+I)}p=g+(p.length>0?" "+p:p)}return p},wC=(...t)=>{let r=0,i,a,c="";for(;r<t.length;)(i=t[r++])&&(a=ip(i))&&(c&&(c+=" "),c+=a);return c},ip=t=>{if(typeof t=="string")return t;let r,i="";for(let a=0;a<t.length;a++)t[a]&&(r=ip(t[a]))&&(i&&(i+=" "),i+=r);return i},EC=(t,...r)=>{let i,a,c,l;const u=m=>{const p=r.reduce((C,g)=>g(C),t());return i=xC(p),a=i.cache.get,c=i.cache.set,l=d,d(m)},d=m=>{const p=a(m);if(p)return p;const C=CC(m,i);return c(m,C),C};return l=u,(...m)=>l(wC(...m))},TC=[],Tt=t=>{const r=i=>i[t]||TC;return r.isThemeGetter=!0,r.themeKey=t,r},sp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,AC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,OC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,NC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xr=t=>jC.test(t),Ie=t=>!!t&&!Number.isNaN(Number(t)),Zn=t=>!!t&&Number.isInteger(Number(t)),zu=t=>t.endsWith("%")&&Ie(t.slice(0,-1)),ur=t=>AC.test(t),cp=()=>!0,_C=t=>RC.test(t)&&!OC.test(t),Bu=()=>!1,DC=t=>NC.test(t),IC=t=>MC.test(t),kC=t=>!fe(t)&&!me(t),LC=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),zC=t=>Kr(t,pp,Bu),fe=t=>sp.test(t),Mo=t=>Kr(t,gp,_C),up=t=>Kr(t,qC,Ie),BC=t=>Kr(t,bp,cp),HC=t=>Kr(t,yp,Bu),dp=t=>Kr(t,hp,Bu),PC=t=>Kr(t,mp,IC),rl=t=>Kr(t,xp,DC),me=t=>lp.test(t),_i=t=>_o(t,gp),UC=t=>_o(t,yp),fp=t=>_o(t,hp),$C=t=>_o(t,pp),GC=t=>_o(t,mp),ol=t=>_o(t,xp,!0),VC=t=>_o(t,bp,!0),Kr=(t,r,i)=>{const a=sp.exec(t);return a?a[1]?r(a[1]):i(a[2]):!1},_o=(t,r,i=!1)=>{const a=lp.exec(t);return a?a[1]?r(a[1]):i:!1},hp=t=>t==="position"||t==="percentage",mp=t=>t==="image"||t==="url",pp=t=>t==="length"||t==="size"||t==="bg-size",gp=t=>t==="length",qC=t=>t==="number",yp=t=>t==="family-name",bp=t=>t==="number"||t==="weight",xp=t=>t==="shadow",YC=EC(()=>{const t=Tt("color"),r=Tt("font"),i=Tt("text"),a=Tt("font-weight"),c=Tt("tracking"),l=Tt("leading"),u=Tt("breakpoint"),d=Tt("container"),m=Tt("spacing"),p=Tt("radius"),C=Tt("shadow"),g=Tt("inset-shadow"),b=Tt("text-shadow"),x=Tt("drop-shadow"),v=Tt("blur"),S=Tt("perspective"),w=Tt("aspect"),T=Tt("ease"),j=Tt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...O(),me,fe],D=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],I=()=>[me,fe,m],B=()=>[Xr,"full","auto",...I()],H=()=>[Zn,"none","subgrid",me,fe],z=()=>["auto",{span:["full",Zn,me,fe]},Zn,me,fe],$=()=>[Zn,"auto",me,fe],X=()=>["auto","min","max","fr",me,fe],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...I()],Y=()=>[Xr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],L=()=>[d,Xr,"screen","full","dvw","lvw","svw","min","max","fit",...I()],P=()=>[Xr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],N=()=>[t,me,fe],U=()=>[...O(),fp,dp,{position:[me,fe]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Q=()=>["auto","cover","contain",$C,zC,{size:[me,fe]}],le=()=>[zu,_i,Mo],re=()=>["","none","full",p,me,fe],ae=()=>["",Ie,_i,Mo],ge=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[Ie,zu,fp,dp],de=()=>["","none",v,me,fe],Me=()=>["none",Ie,me,fe],De=()=>["none",Ie,me,fe],we=()=>[Ie,me,fe],xe=()=>[Xr,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ur],breakpoint:[ur],color:[cp],container:[ur],"drop-shadow":[ur],ease:["in","out","in-out"],font:[kC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ur],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ur],shadow:[ur],spacing:["px",Ie],text:[ur],"text-shadow":[ur],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xr,fe,me,w]}],container:["container"],"container-type":[{"@container":["","normal","size",me,fe]}],"container-named":[LC],columns:[{columns:[Ie,"auto",fe,me,d]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Zn,"auto",me,fe]}],basis:[{basis:[Xr,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,Xr,"auto","initial","none",fe]}],grow:[{grow:["",Ie,me,fe]}],shrink:[{shrink:["",Ie,me,fe]}],order:[{order:[Zn,"first","last","none",me,fe]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],w:[{w:[d,"screen",...Y()]}],"min-w":[{"min-w":[d,"screen","none",...Y()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh","none",...Y()]}],"font-size":[{text:["base",i,_i,Mo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,VC,BC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zu,fe]}],"font-family":[{font:[UC,HC,r]}],"font-features":[{"font-features":[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,me,fe]}],"line-clamp":[{"line-clamp":[Ie,"none",me,up]}],leading:[{leading:["none",l,...I()]}],"list-image":[{"list-image":["none",me,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",me,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",me,Mo]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Ie,"auto",me,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[Zn,me,fe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zn,me,fe],radial:["",me,fe],conic:["",Zn,me,fe]},GC,PC]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,me,fe]}],"outline-w":[{outline:["",Ie,_i,Mo]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","inner","none",C,ol,rl]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",g,ol,rl]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Ie,Mo]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",b,ol,rl]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Ie,me,fe]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[me,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",me,fe]}],filter:[{filter:["","none",me,fe]}],blur:[{blur:de()}],brightness:[{brightness:[Ie,me,fe]}],contrast:[{contrast:[Ie,me,fe]}],"drop-shadow":[{"drop-shadow":["","none",x,ol,rl]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",Ie,me,fe]}],"hue-rotate":[{"hue-rotate":[Ie,me,fe]}],invert:[{invert:["",Ie,me,fe]}],saturate:[{saturate:[Ie,me,fe]}],sepia:[{sepia:["",Ie,me,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",me,fe]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,me,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,me,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,me,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,me,fe]}],"backdrop-invert":[{"backdrop-invert":["",Ie,me,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,me,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,me,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,me,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",me,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",me,fe]}],ease:[{ease:["linear","initial",T,me,fe]}],delay:[{delay:[Ie,me,fe]}],animate:[{animate:["none",j,me,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,me,fe]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[me,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],zoom:[{zoom:[Zn,me,fe]}],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me,fe]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[Ie,_i,Mo,up]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ve(...t){return YC(Jm(t))}var XC=Object.defineProperty,Hu=(t,r)=>XC(t,"name",{value:r,configurable:!0});function Pu(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}Hu(Pu,"setRef");function vp(...t){return r=>{let i=!1;const a=t.map(c=>{const l=Pu(c,r);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let c=0;c<a.length;c++){const l=a[c];typeof l=="function"?l():Pu(t[c],null)}}}}Hu(vp,"composeRefs");function ke(...t){return E.useCallback(vp(...t),t)}Hu(ke,"useComposedRefs");var KC=Object.defineProperty,un=(t,r)=>KC(t,"name",{value:r,configurable:!0});function dr(t){const r=E.forwardRef((i,a)=>{let{children:c,...l}=i,u=null,d=!1;const m=[];c=Ap(c),E.Children.forEach(c,b=>{if(Tp(b)){d=!0;const x=b;let v="child"in x.props?x.props.child:x.props.children;for(;Uu(v)&&typeof al=="function";)v=al(v._payload);u=QC(x,v),m.push(u?.props?.children)}else m.push(b)}),u?u=E.cloneElement(u,void 0,m):!d&&E.Children.count(c)===1&&E.isValidElement(c)&&(u=c);const p=u?Ep(u):void 0,C=ke(a,p);if(!u){if(c||c===0)throw new Error(d?JC(t):WC(t));return c}const g=wp(l,u.props??{});return u.type!==E.Fragment&&(g.ref=a?C:p),E.cloneElement(u,g)});return r.displayName=`${t}.Slot`,r}un(dr,"createSlot");var FC=dr("Slot"),Sp=Symbol.for("radix.slottable");function Cp(t){const r=un(i=>"child"in i?i.children(i.child):i.children,"Slottable");return r.displayName=`${t}.Slottable`,r.__radixId=Sp,r}un(Cp,"createSlottable");var QC=un((t,r)=>"child"in t.props?E.isValidElement(r)?E.cloneElement(r,void 0,t.props.children(r.props.children)):null:E.isValidElement(r)?r:null,"getSlottableElementFromSlottable");function wp(t,r){const i={...r};for(const a in r){const c=t[a],l=r[a];/^on[A-Z]/.test(a)?c&&l?i[a]=(...d)=>{const m=l(...d);return c(...d),m}:c&&(i[a]=c):a==="style"?i[a]={...c,...l}:a==="className"?i[a]=[c,l].filter(Boolean).join(" "):a==="aria-describedby"&&(i[a]=Rp(l,c))}return{...t,...i}}un(wp,"mergeProps");function Ep(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}un(Ep,"getElementRef");function Tp(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Sp}un(Tp,"isSlottable");var ZC=Symbol.for("react.lazy");function Uu(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===ZC&&"_payload"in t&&jp(t._payload)}un(Uu,"isLazyComponent");function jp(t){return typeof t=="object"&&t!==null&&"then"in t}un(jp,"isPromiseLike");function Ap(t){let r=t;for(;Uu(r)&&typeof al=="function";)r=al(r._payload);return r}un(Ap,"useUnwrappedLazy");function Rp(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}un(Rp,"concatAriaDescribedby");var WC=un(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),JC=un(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),al=No[" use ".trim().toString()],ew=Object.defineProperty,tw=(t,r)=>ew(t,"name",{value:r,configurable:!0}),nw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=nw.reduce((t,r)=>{const i=dr(`Primitive.${r}`),a=E.forwardRef((c,l)=>{const{asChild:u,...d}=c,m=u?i:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(m,{...d,ref:l})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{});function Op(t,r){t&&Yr.flushSync(()=>t.dispatchEvent(r))}tw(Op,"dispatchDiscreteCustomEvent");var rw=Object.defineProperty,ow=(t,r)=>rw(t,"name",{value:r,configurable:!0}),Np=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),aw=E.forwardRef(ow(function(r,i){return f.jsx(He.span,{...r,ref:i,style:{...Np,...r.style}})},"VisuallyHidden")),iw=Object.defineProperty,En=(t,r)=>iw(t,"name",{value:r,configurable:!0});function sw(t,r){const i=E.createContext(r);i.displayName=t+"Context";const a=En(l=>{const{children:u,...d}=l,m=E.useMemo(()=>d,Object.values(d));return f.jsx(i.Provider,{value:m,children:u})},"Provider");a.displayName=t+"Provider";function c(l,u={}){const{optional:d=!1}=u,m=E.useContext(i);if(m)return m;if(r!==void 0)return r;if(!d)throw new Error(`\`${l}\` must be used within \`${t}\``)}return En(c,"useContext"),[a,c]}En(sw,"createContext");function Tn(t,r=[]){let i=[];function a(l,u){const d=E.createContext(u);d.displayName=l+"Context";const m=i.length;i=[...i,u];const p=En(g=>{const{scope:b,children:x,...v}=g,S=b?.[t]?.[m]||d,w=E.useMemo(()=>v,Object.values(v));return f.jsx(S.Provider,{value:w,children:x})},"Provider");p.displayName=l+"Provider";function C(g,b,x={}){const{optional:v=!1}=x,S=b?.[t]?.[m]||d,w=E.useContext(S);if(w)return w;if(u!==void 0)return u;if(!v)throw new Error(`\`${g}\` must be used within \`${l}\``)}return En(C,"useContext"),[p,C]}En(a,"createContext");const c=En(()=>{const l=i.map(u=>E.createContext(u));return En(function(d){const m=d?.[t]||l;return E.useMemo(()=>({[`__scope${t}`]:{...d,[t]:m}}),[d,m])},"useScope")},"createScope");return c.scopeName=t,[a,Mp(c,...r)]}En(Tn,"createContextScope");function Mp(...t){const r=t[0];if(t.length===1)return r;const i=En(()=>{const a=t.map(c=>({useScope:c(),scopeName:c.scopeName}));return En(function(l){const u=a.reduce((d,{useScope:m,scopeName:p})=>{const g=m(l)[`__scope${p}`];return{...d,...g}},{});return E.useMemo(()=>({[`__scope${r.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return i.scopeName=r.scopeName,i}En(Mp,"composeContextScopes");var lt=globalThis?.document?E.useLayoutEffect:()=>{},lw=Object.defineProperty,jt=(t,r)=>lw(t,"name",{value:r,configurable:!0});function il(t){const r=t+"CollectionProvider",[i,a]=Tn(r),[c,l]=i(r,{collectionRef:{current:null},itemMap:new Map}),u=jt(S=>{const{scope:w,children:T}=S,j=E.useRef(null),R=E.useRef(new Map).current;return f.jsx(c,{scope:w,itemMap:R,collectionRef:j,children:T})},"CollectionProvider");u.displayName=r;const d=t+"CollectionSlot",m=dr(d),p=E.forwardRef((S,w)=>{const{scope:T,children:j}=S,R=l(d,T),O=ke(w,R.collectionRef);return f.jsx(m,{ref:O,children:j})});p.displayName=d;const C=t+"CollectionItemSlot",g="data-radix-collection-item",b=dr(C),x=E.forwardRef((S,w)=>{const{scope:T,children:j,...R}=S,O=E.useRef(null),M=ke(w,O),D=l(C,T);return E.useEffect(()=>(D.itemMap.set(O,{ref:O,...R}),()=>void D.itemMap.delete(O))),f.jsx(b,{[g]:"",ref:M,children:j})});x.displayName=C;function v(S){const w=l(t+"CollectionConsumer",S);return E.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const R=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((D,_)=>R.indexOf(D.ref.current)-R.indexOf(_.ref.current))},[w.collectionRef,w.itemMap])}return jt(v,"useCollection"),[{Provider:u,Slot:p,ItemSlot:x},v,a]}jt(il,"createCollection");var _p=new WeakMap,sl=(fn=class extends Map{constructor(i){super(i);J1(this,gt);ym(this,gt,[...super.keys()]),_p.set(this,!0)}set(i,a){return _p.get(this)&&!this.has(i)&&Gt(this,gt).push(i),super.set(i,a),this}insert(i,a,c){const l=this.has(a),u=l?this.size:this.size+1,d=$u(i),m=d>=0?Math.min(d,u-1):Math.max(u+d,0);if(l?Gt(this,gt).indexOf(a)===m:m===this.size)return this.set(a,c),this;const p=Gt(this,gt).filter(g=>g!==a);p.splice(m,0,a);const C=p.map(g=>[g,g===a?c:this.get(g)]);this.clear();for(const[g,b]of C)this.set(g,b);return this}with(i,a,c){const l=new fn(this);return l.insert(i,a,c),l}before(i){const a=Gt(this,gt).indexOf(i)-1;if(!(a<0))return this.entryAt(a)}setBefore(i,a,c){const l=Gt(this,gt).indexOf(i);if(l===-1)return this;const u=Gt(this,gt).indexOf(a),d=u!==-1&&u<l?l-1:l;return this.insert(d,a,c)}after(i){let a=Gt(this,gt).indexOf(i);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(i,a,c){const l=Gt(this,gt).indexOf(i);if(l===-1)return this;const u=Gt(this,gt).indexOf(a),d=u!==-1&&u<=l?l:l+1;return this.insert(d,a,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ym(this,gt,[]),super.clear()}delete(i){const a=super.delete(i);return a&&Gt(this,gt).splice(Gt(this,gt).indexOf(i),1),a}deleteAt(i){const a=this.keyAt(i);return a!==void 0?this.delete(a):!1}at(i){const a=ll(Gt(this,gt),i);if(a!==void 0)return this.get(a)}entryAt(i){const a=ll(Gt(this,gt),i);if(a!==void 0)return[a,this.get(a)]}indexOf(i){return Gt(this,gt).indexOf(i)}keyAt(i){return ll(Gt(this,gt),i)}from(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return l;c++}}findIndex(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return c;c++}return-1}filter(i,a){const c=[];let l=0;for(const u of this)Reflect.apply(i,a,[u,l,this])&&c.push(u),l++;return new fn(c)}map(i,a){const c=[];let l=0;for(const u of this)c.push([u[0],Reflect.apply(i,a,[u,l,this])]),l++;return new fn(c)}reduce(...i){const[a,c]=i,l=i.length>1;if(!l&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=0,d=c;for(const m of this)u===0&&!l?d=m:d=Reflect.apply(a,this,[d,m,u,this]),u++;return d}reduceRight(...i){const[a,c]=i,l=i.length>1;if(!l&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=c;for(let d=this.size-1;d>=0;d--){const m=this.entryAt(d);d===this.size-1&&!l?u=m:u=Reflect.apply(a,this,[u,m,d,this])}return u}sort(i){if(typeof i!="function")throw new TypeError("OrderedDict.sort requires a compare function");const a=[...this.entries()].sort(i);this.clear();for(const[c,l]of a)this.set(c,l);return this}toSorted(i){if(typeof i!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const a=[...this.entries()].sort(i);return new fn(a)}toReversed(){const i=new fn;for(let a=this.size-1;a>=0;a--){const c=this.keyAt(a),l=this.get(c);i.set(c,l)}return i}toSpliced(...i){const a=[...this.entries()];return a.splice(...i),new fn(a)}slice(i,a){const c=new fn;for(const l of Gt(this,gt).slice(i,a))c.set(l,this.get(l));return c}every(i,a){let c=0;for(const l of this){if(!Reflect.apply(i,a,[l,c,this]))return!1;c++}return!0}some(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return!0;c++}return!1}},gt=new WeakMap,jt(fn,"OrderedDict"),fn);function ll(t,r){if("at"in Array.prototype)return Array.prototype.at.call(t,r);const i=Dp(t,r);return i===-1?void 0:t[i]}jt(ll,"at");function Dp(t,r){const i=t.length,a=$u(r),c=a>=0?a:i+a;return c<0||c>=i?-1:c}jt(Dp,"toSafeIndex");function $u(t){return t!==t||t===0?0:Math.trunc(t)}jt($u,"toSafeInteger");function cw(t){const r=t+"CollectionProvider",[i,a]=Tn(r),[c,l]=i(r);c.displayName=t+"CollectionStableContextProvider";const[u,d]=i(r);u.displayName=t+"CollectionStatefulContextProvider";const m=jt(({state:D,..._})=>D?f.jsx(C,{..._,state:D}):f.jsx(p,{..._}),"CollectionProvider");m.displayName=r;const p=jt(D=>{const _=j();return f.jsx(C,{...D,state:_})},"CollectionInit");p.displayName=t+"CollectionInit";const C=jt(D=>{const{scope:_,children:I,state:B}=D,H=E.useRef(null),[z,$]=E.useState(null),X=ke(H,$),[G,te]=B,V=E.useRef(new sl),Y=E.useCallback(()=>{const L=V.current;return Lp(L)||L.sort(cl),L},[]);return E.useEffect(()=>{if(!z)return;const L=zp(()=>{te(P=>{const N=P.toSorted(cl);return N.some(([J],Q)=>P.keyAt(Q)!==J)?N:P})});return L.observe(z,{childList:!0,subtree:!0}),()=>{L.disconnect()}},[z,te]),f.jsx(c,{scope:_,collectionElementRef:X,collectionElementRefObject:H,getCollection:Y,setCollection:te,registryRef:V,children:f.jsx(u,{scope:_,collectionElement:z,collection:G,children:I})})},"CollectionProviderImpl");C.displayName=t+"CollectionProviderImpl";const g=t+"CollectionSlot",b=dr(g),x=E.forwardRef((D,_)=>{const{scope:I,children:B}=D,H=l(g,I),z=ke(_,H.collectionElementRef);return f.jsx(b,{ref:z,children:B})});x.displayName=g;const v=t+"CollectionItemSlot",S="data-radix-collection-item",w=dr(v),T=E.forwardRef((D,_)=>{const{scope:I,children:B,...H}=D,z=E.useRef(null),$=l(v,I),{setCollection:X,registryRef:G}=$,te=E.useRef(H);Ip(te.current,H)||(te.current=H);const V=te.current,Y=E.useCallback(N=>{const U=G.current;N?U.set(N,{...te.current,element:N}):z.current&&U.delete(z.current)},[G]),L=ke(_,Y,z);lt(()=>{const N=z.current,U=G.current;N&&U.has(N)&&U.set(N,{...V,element:N})},[V,G]);const P=E.useRef(null);return E.useEffect(()=>{const N=z.current,U=P.current;(U?.element??null)===N&&(!N||U?.itemData===V)||(P.current=N?{element:N,itemData:V}:null,X(J=>{const Q=new sl(J);return U&&U.element!==N&&Q.delete(U.element),N&&Q.set(N,{...V,element:N}),Q.sort(cl)}))}),E.useEffect(()=>()=>{const N=P.current;P.current=null,N&&X(U=>{if(!U.has(N.element))return U;const J=new sl(U);return J.delete(N.element),J})},[X]),f.jsx(w,{[S]:"",ref:L,children:B})});T.displayName=v;function j(){return E.useState(new sl)}jt(j,"useInitCollection");function R(D){const{collection:_}=d(t+"CollectionConsumer",D);return _}jt(R,"useCollection");function O(D){const{getCollection:_}=l(t+"CollectionConsumer",D);return _}return jt(O,"useGetCollection"),[{Provider:m,Slot:x,ItemSlot:T},{createCollectionScope:a,useCollection:R,useGetCollection:O,useInitCollection:j}]}jt(cw,"createCollection");function Ip(t,r){if(t===r)return!0;if(typeof t!="object"||typeof r!="object"||t==null||r==null)return!1;const i=Object.keys(t),a=Object.keys(r);if(i.length!==a.length)return!1;for(const c of i)if(!Object.prototype.hasOwnProperty.call(r,c)||t[c]!==r[c])return!1;return!0}jt(Ip,"shallowEqual");function kp(t,r){return!!(r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}jt(kp,"isElementPreceding");function Lp(t){let r;for(const i of t.keys()){if(r){const a=r.compareDocumentPosition(i);if(!(a&Node.DOCUMENT_POSITION_DISCONNECTED)&&a&Node.DOCUMENT_POSITION_PRECEDING)return!1}r=i}return!0}jt(Lp,"isInDocumentOrder");function cl(t,r){return!t[1].element||!r[1].element?0:kp(t[1].element,r[1].element)?-1:1}jt(cl,"sortByDocumentPosition");function zp(t){return new MutationObserver(i=>{for(const a of i)if(a.type==="childList"){t();return}})}jt(zp,"getChildListObserver");var uw=Object.defineProperty,ga=(t,r)=>uw(t,"name",{value:r,configurable:!0}),Bp=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ce(t,r,{checkForDefaultPrevented:i=!0}={}){return ga(function(c){if(t?.(c),i===!1||!c||!c.defaultPrevented)return r?.(c)},"handleEvent")}ga(Ce,"composeEventHandlers");function dw(t){if(!Bp)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}ga(dw,"getOwnerWindow");function Gu(t){if(!Bp)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}ga(Gu,"getOwnerDocument");function Hp(t,r=!1){const{activeElement:i}=Gu(t);if(!i?.nodeName)return null;if(Pp(i)&&i.contentDocument)return Hp(i.contentDocument.body,r);if(r){const a=i.getAttribute("aria-activedescendant");if(a){const c=Gu(i).getElementById(a);if(c)return c}}return i}ga(Hp,"getActiveElement");function Pp(t){return t.tagName==="IFRAME"}ga(Pp,"isFrame");var fw=Object.defineProperty,hw=(t,r)=>fw(t,"name",{value:r,configurable:!0}),Up=No[" useEffectEvent ".trim().toString()],$p=No[" useInsertionEffect ".trim().toString()];function Gp(t){if(typeof Up=="function")return Up(t);const r=E.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof $p=="function"?$p(()=>{r.current=t}):lt(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}hw(Gp,"useEffectEvent");var mw=Object.defineProperty,Di=(t,r)=>mw(t,"name",{value:r,configurable:!0}),pw=No[" useInsertionEffect ".trim().toString()]||lt;function fr({prop:t,defaultProp:r,onChange:i=Di(()=>{},"onChange"),caller:a}){const[c,l,u]=Vp({defaultProp:r,onChange:i}),d=t!==void 0,m=d?t:c,p=E.useCallback(C=>{if(d){const g=qp(C)?C(t):C;g!==t&&u.current?.(g)}else l(C)},[d,t,l,u]);return[m,p]}Di(fr,"useControllableState");function Vp({defaultProp:t,onChange:r}){const[i,a]=E.useState(t),c=E.useRef(i),l=E.useRef(r);return pw(()=>{l.current=r},[r]),E.useEffect(()=>{c.current!==i&&(l.current?.(i),c.current=i)},[i,c]),[i,a,l]}Di(Vp,"useUncontrolledState");function qp(t){return typeof t=="function"}Di(qp,"isFunction");var Yp=Symbol("RADIX:SYNC_STATE");function gw(t,r,i,a){const{prop:c,defaultProp:l,onChange:u,caller:d}=r,m=c!==void 0,p=Gp(u),C=[{...i,state:l}];a&&C.push(a);const[g,b]=E.useReducer((w,T)=>{if(T.type===Yp)return{...w,state:T.state};const j=t(w,T);return m&&!Object.is(j.state,w.state)&&p(j.state),j},...C),x=g.state,v=E.useRef(x);E.useEffect(()=>{v.current!==x&&(v.current=x,m||p(x))},[x,v,m]);const S=E.useMemo(()=>c!==void 0?{...g,state:c}:g,[g,c]);return E.useEffect(()=>{m&&!Object.is(c,g.state)&&b({type:Yp,state:c})},[c,g.state,m]),[S,b]}Di(gw,"useControllableStateReducer");var yw=Object.defineProperty,hr=(t,r)=>yw(t,"name",{value:r,configurable:!0});function Xp(t,r){return E.useReducer((i,a)=>r[i][a]??i,t)}hr(Xp,"useStateMachine");var Fr=hr(t=>{const{present:r,children:i}=t,a=Kp(r),c=typeof i=="function"?i({present:a.isPresent}):E.Children.only(i),l=Fp(a.ref,Qp(c));return typeof i=="function"||a.isPresent?E.cloneElement(c,{ref:l}):null},"Presence");function Kp(t){const[r,i]=E.useState(),a=E.useRef(null),c=E.useRef(t),l=E.useRef("none"),u=E.useRef(void 0),d=t?"mounted":"unmounted",[m,p]=Xp(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{m==="mounted"?(l.current=u.current??ya(a.current),u.current=void 0):l.current="none"},[m]),lt(()=>{const C=a.current,g=c.current;if(g!==t){const x=l.current,v=ya(C);t?(u.current=v,p("MOUNT")):v==="none"||C?.display==="none"?p("UNMOUNT"):p(g&&x!==v?"ANIMATION_OUT":"UNMOUNT"),c.current=t}},[t,p]),lt(()=>{if(r){let C;const g=r.ownerDocument.defaultView??window,b=hr(v=>{const w=ya(a.current).includes(CSS.escape(v.animationName));if(v.target===r&&w&&(p("ANIMATION_END"),!c.current)){const T=r.style.animationFillMode;r.style.animationFillMode="forwards",C=g.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=T)})}},"handleAnimationEnd"),x=hr(v=>{v.target===r&&(l.current=ya(a.current))},"handleAnimationStart");return r.addEventListener("animationstart",x),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{g.clearTimeout(C),r.removeEventListener("animationstart",x),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[r,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:E.useCallback(C=>{if(C){const g=getComputedStyle(C);a.current=g,u.current=ya(g)}else a.current=null;i(C)},[])}}hr(Kp,"usePresence");function Vu(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}hr(Vu,"setRef");function Fp(...t){const r=E.useRef(t);return r.current=t,E.useCallback(i=>{const a=r.current;let c=!1;const l=a.map(u=>{const d=Vu(u,i);return!c&&typeof d=="function"&&(c=!0),d});if(c)return()=>{for(let u=0;u<l.length;u++){const d=l[u];typeof d=="function"?d():Vu(a[u],null)}}},[])}hr(Fp,"useStableComposedRefs");function ya(t){return t?.animationName||"none"}hr(ya,"getAnimationName");function Qp(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}hr(Qp,"getElementRef");var bw=Object.defineProperty,xw=(t,r)=>bw(t,"name",{value:r,configurable:!0}),vw=No[" useId ".trim().toString()]||(()=>{}),Sw=0;function mr(t){const[r,i]=E.useState(vw());return lt(()=>{t||i(a=>a??String(Sw++))},[t]),t||(r?`radix-${r}`:"")}xw(mr,"useId");var Cw=Object.defineProperty,ww=(t,r)=>Cw(t,"name",{value:r,configurable:!0}),Ew={LTR:"ltr"},Tw=E.createContext(void 0);function Ii(t){const r=E.useContext(Tw);return t||r||Ew.LTR}ww(Ii,"useDirection");var jw=Object.defineProperty,Aw=(t,r)=>jw(t,"name",{value:r,configurable:!0}),Zp=No[" useInsertionEffect ".trim().toString()];function Hn(t){const r=E.useRef(t);return typeof Zp=="function"?Zp(()=>{r.current=t}):lt(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}Aw(Hn,"useCallbackRef");var Rw=Object.defineProperty,Nt=(t,r)=>Rw(t,"name",{value:r,configurable:!0}),qu="dismissableLayer.update",Ow="dismissableLayer.pointerDownOutside",Nw="dismissableLayer.focusOutside",Wp,Jp=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Yu=E.forwardRef(Nt(function(r,i){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,onDismiss:p,...C}=r,g=E.useContext(Jp),[b,x]=E.useState(null),v=b?.ownerDocument??globalThis?.document,[,S]=E.useState({}),w=ke(i,x),T=Array.from(g.layers),[j]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),R=j?T.indexOf(j):-1,O=b?T.indexOf(b):-1,M=g.layersWithOutsidePointerEventsDisabled.size>0,D=O>=R,_=E.useRef(!1),I=tg($=>{u?.($),m?.($),$.defaultPrevented||p?.()},{ownerDocument:v,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:E.useCallback($=>{if(!($ instanceof Node))return!1;const X=[...g.branches].some(G=>G.contains($));return D&&!X},[g.branches,D])}),B=ng($=>{if(c&&_.current)return;const X=$.target;[...g.branches].some(te=>te.contains(X))||(d?.($),m?.($),$.defaultPrevented||p?.())},v),H=b?O===T.length-1:!1,z=Hn($=>{$.key==="Escape"&&(l?.($),!$.defaultPrevented&&p&&($.preventDefault(),p()))});return E.useEffect(()=>{if(H)return v.addEventListener("keydown",z,{capture:!0}),()=>v.removeEventListener("keydown",z,{capture:!0})},[v,H,z]),E.useEffect(()=>{if(b)return a&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Wp=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(b)),g.layers.add(b),Xu(),()=>{a&&(g.layersWithOutsidePointerEventsDisabled.delete(b),g.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=Wp))}},[b,v,a,g]),E.useEffect(()=>()=>{b&&(g.layers.delete(b),g.layersWithOutsidePointerEventsDisabled.delete(b),Xu())},[b,g]),E.useEffect(()=>{const $=Nt(()=>S({}),"handleUpdate");return document.addEventListener(qu,$),()=>document.removeEventListener(qu,$)},[]),f.jsx(He.div,{...C,ref:w,style:{pointerEvents:M?D?"auto":"none":void 0,...r.style},onFocusCapture:Ce(r.onFocusCapture,B.onFocusCapture),onBlurCapture:Ce(r.onBlurCapture,B.onBlurCapture),onPointerDownCapture:Ce(r.onPointerDownCapture,I.onPointerDownCapture)})},"DismissableLayer"));function eg(){const t=E.useContext(Jp),[r,i]=E.useState(null);return E.useEffect(()=>{if(r)return t.dismissableSurfaces.add(r),()=>{t.dismissableSurfaces.delete(r)}},[r,t.dismissableSurfaces]),i}Nt(eg,"useDismissableLayerSurface");var Mw=Nt(()=>!0,"IS_TRUE");function tg(t,r){const{ownerDocument:i=globalThis?.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=Mw}=r,d=Hn(t),m=E.useRef(!1),p=E.useRef(!1),C=E.useRef(new Map),g=E.useRef(()=>{});return E.useEffect(()=>{function b(){p.current=!1,c.current=!1,C.current.clear()}Nt(b,"resetOutsideInteraction");function x(){return Array.from(C.current.values()).some(Boolean)}Nt(x,"isOutsideInteractionIntercepted");function v(R){if(!p.current)return;const O=R.target;O instanceof Node&&[...l].some(D=>D.contains(O))||C.current.set(R.type,!0),R.type==="click"&&window.setTimeout(()=>{p.current&&g.current()},0)}Nt(v,"handleInteractionCapture");function S(R){p.current&&C.current.set(R.type,!1)}Nt(S,"handleInteractionBubble");const w=Nt(R=>{if(R.target&&!m.current){let O=function(){i.removeEventListener("click",g.current);const D=x();b(),D||Ku(Ow,d,M,{discrete:!0})};if(Nt(O,"handleAndDispatchPointerDownOutsideEvent"),!u(R.target)){i.removeEventListener("click",g.current),b(),m.current=!1;return}const M={originalEvent:R};p.current=!0,c.current=a&&R.button===0,C.current.clear(),!a||R.button!==0?O():(i.removeEventListener("click",g.current),g.current=O,i.addEventListener("click",g.current,{once:!0}))}else i.removeEventListener("click",g.current),b();m.current=!1},"handlePointerDown"),T=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const R of T)i.addEventListener(R,v,!0),i.addEventListener(R,S);const j=window.setTimeout(()=>{i.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(j),i.removeEventListener("pointerdown",w),i.removeEventListener("click",g.current);for(const R of T)i.removeEventListener(R,v,!0),i.removeEventListener(R,S)}},[i,d,a,c,l,u]),{onPointerDownCapture:Nt(()=>m.current=!0,"onPointerDownCapture")}}Nt(tg,"usePointerDownOutside");function ng(t,r=globalThis?.document){const i=Hn(t),a=E.useRef(!1);return E.useEffect(()=>{const c=Nt(l=>{l.target&&!a.current&&Ku(Nw,i,{originalEvent:l},{discrete:!1})},"handleFocus");return r.addEventListener("focusin",c),()=>r.removeEventListener("focusin",c)},[r,i]),{onFocusCapture:Nt(()=>a.current=!0,"onFocusCapture"),onBlurCapture:Nt(()=>a.current=!1,"onBlurCapture")}}Nt(ng,"useFocusOutside");function Xu(){const t=new CustomEvent(qu);document.dispatchEvent(t)}Nt(Xu,"dispatchUpdate");function Ku(t,r,i,{discrete:a}){const c=i.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:i});r&&c.addEventListener(t,r,{once:!0}),a?Op(c,l):c.dispatchEvent(l)}Nt(Ku,"handleAndDispatchCustomEvent");var _w=Object.defineProperty,xt=(t,r)=>_w(t,"name",{value:r,configurable:!0}),Fu="focusScope.autoFocusOnMount",Qu="focusScope.autoFocusOnUnmount",rg={bubbles:!1,cancelable:!0},og=E.forwardRef(xt(function(r,i){const{loop:a=!1,trapped:c=!1,branches:l,onMountAutoFocus:u,onUnmountAutoFocus:d,...m}=r,[p,C]=E.useState(null),g=Hn(u),b=Hn(d),x=E.useRef(null),v=ke(i,C),S=E.useRef(l);E.useEffect(()=>{S.current=l});const w=E.useCallback(R=>R?p?.contains(R)?!0:!!S.current?.some(O=>O.contains(R)):!1,[p]),T=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(c){let R=function(_){if(T.paused||!p)return;const I=_.target;w(I)?x.current=I:pr(x.current,{select:!0})},O=function(_){if(T.paused||!p)return;const I=_.relatedTarget;I!==null&&(w(I)||pr(x.current,{select:!0}))},M=function(_){if(document.activeElement===document.body)for(const B of _)B.removedNodes.length>0&&pr(p)};xt(R,"handleFocusIn"),xt(O,"handleFocusOut"),xt(M,"handleMutations"),document.addEventListener("focusin",R),document.addEventListener("focusout",O);const D=new MutationObserver(M);return p&&D.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",R),document.removeEventListener("focusout",O),D.disconnect()}}},[c,p,T.paused,w]),E.useEffect(()=>{if(p){hg.add(T);const R=document.activeElement;if(!p.contains(R)){const M=new CustomEvent(Fu,rg);p.addEventListener(Fu,g),p.dispatchEvent(M),M.defaultPrevented||(cg(pg(Zu(p)),{select:!0}),document.activeElement===R&&pr(p))}return()=>{p.removeEventListener(Fu,g);const M=p.ownerDocument,D=CustomEvent;setTimeout(()=>{const _=new D(Qu,rg);p.addEventListener(Qu,b),p.dispatchEvent(_),_.defaultPrevented||pr(R??M.body,{select:!0}),p.removeEventListener(Qu,b),hg.remove(T)},0)}}},[p,g,b,T]);const j=E.useCallback(R=>{if(!a&&!c||T.paused)return;const O=R.key==="Tab"&&!R.altKey&&!R.ctrlKey&&!R.metaKey,M=document.activeElement;if(O&&M){const D=R.currentTarget,[_,I]=ug(D);_&&I?!R.shiftKey&&M===I?(R.preventDefault(),a&&pr(_,{select:!0})):R.shiftKey&&M===_&&(R.preventDefault(),a&&pr(I,{select:!0})):M===D&&R.preventDefault()}},[a,c,T.paused]);return f.jsx(He.div,{tabIndex:-1,...m,ref:v,onKeyDown:j})},"FocusScope")),ag=E.createContext(null);function ig({registry:t,children:r}){return t?f.jsx(ag.Provider,{value:t,children:r}):r}xt(ig,"FocusScopeBranchProvider");function sg(){const[t,r]=E.useState([]),i=E.useMemo(()=>({add:xt(a=>r(c=>c.includes(a)?c:[...c,a]),"add"),remove:xt(a=>r(c=>c.filter(l=>l!==a)),"remove")}),[]);return{nodes:t,registry:i}}xt(sg,"useFocusScopeBranchRegistry");function lg(t){const r=E.useContext(ag);E.useEffect(()=>{if(!(!t||!r))return r.add(t),()=>r.remove(t)},[t,r])}xt(lg,"useFocusScopeBranch");function cg(t,{select:r=!1}={}){const i=document.activeElement;for(const a of t)if(pr(a,{select:r}),document.activeElement!==i)return}xt(cg,"focusFirst");function ug(t){const r=Zu(t),i=Wu(r,t),a=Wu(r.reverse(),t);return[i,a]}xt(ug,"getTabbableEdges");function Zu(t){const r=[],a=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:xt(c=>{const l=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||l?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)r.push(a.currentNode);return r}xt(Zu,"getTabbableCandidates");function Wu(t,r){const i=typeof r.checkVisibility=="function"&&r.checkVisibility({checkVisibilityCSS:!0});for(const a of t)if(!(i?!a.checkVisibility({checkVisibilityCSS:!0}):dg(a,{upTo:r})))return a}xt(Wu,"findVisible");function dg(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}xt(dg,"isHidden");function fg(t){return t.tagName==="INPUT"&&typeof t.select=="function"}xt(fg,"isSelectableInput");function pr(t,{select:r=!1}={}){if(t&&t.focus){const a=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==a&&fg(t)&&r&&t.select()}}xt(pr,"focus");var hg=mg();function mg(){let t=[];return{add(r){const i=t[0];r!==i&&i?.pause(),t=Ju(t,r),t.unshift(r)},remove(r){t=Ju(t,r),t[0]?.resume()}}}xt(mg,"createFocusScopesStack");function Ju(t,r){const i=[...t],a=i.indexOf(r);return a!==-1&&i.splice(a,1),i}xt(Ju,"arrayRemove");function pg(t){return t.filter(r=>r.tagName!=="A")}xt(pg,"removeLinks");var Dw=Object.defineProperty,Iw=(t,r)=>Dw(t,"name",{value:r,configurable:!0}),ed=E.forwardRef(Iw(function(r,i){const{container:a,...c}=r,[l,u]=E.useState(!1);lt(()=>u(!0),[]);const d=a||l&&globalThis?.document?.body;return d?Yr.createPortal(f.jsx(He.div,{...c,ref:i}),d):null},"Portal")),kw=Object.defineProperty,td=(t,r)=>kw(t,"name",{value:r,configurable:!0}),ul=0,ba=null;function Lw(t){return dl(),t.children}td(Lw,"FocusGuards");function dl(){E.useEffect(()=>{ba||(ba={start:nd(),end:nd()});const{start:t,end:r}=ba;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==r&&document.body.insertAdjacentElement("beforeend",r),ul++,()=>{ul===1&&(ba?.start.remove(),ba?.end.remove(),ba=null),ul=Math.max(0,ul-1)}},[])}td(dl,"useFocusGuards");function nd(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}td(nd,"createFocusGuard");var Wn=function(){return Wn=Object.assign||function(r){for(var i,a=1,c=arguments.length;a<c;a++){i=arguments[a];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(r[l]=i[l])}return r},Wn.apply(this,arguments)};function gg(t,r){var i={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(t);c<a.length;c++)r.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(t,a[c])&&(i[a[c]]=t[a[c]]);return i}function zw(t,r,i){if(i||arguments.length===2)for(var a=0,c=r.length,l;a<c;a++)(l||!(a in r))&&(l||(l=Array.prototype.slice.call(r,0,a)),l[a]=r[a]);return t.concat(l||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;var fl="right-scroll-bar-position",hl="width-before-scroll-bar",Bw="with-scroll-bars-hidden",Hw="--removed-body-scroll-bar-size";function rd(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function Pw(t,r){var i=E.useState(function(){return{value:t,callback:r,facade:{get current(){return i.value},set current(a){var c=i.value;c!==a&&(i.value=a,i.callback(a,c))}}}})[0];return i.callback=r,i.facade}var Uw=typeof window<"u"?E.useLayoutEffect:E.useEffect,yg=new WeakMap;function $w(t,r){var i=Pw(null,function(a){return t.forEach(function(c){return rd(c,a)})});return Uw(function(){var a=yg.get(i);if(a){var c=new Set(a),l=new Set(t),u=i.current;c.forEach(function(d){l.has(d)||rd(d,null)}),l.forEach(function(d){c.has(d)||rd(d,u)})}yg.set(i,t)},[t]),i}function Gw(t){return t}function Vw(t,r){r===void 0&&(r=Gw);var i=[],a=!1,c={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:t},useMedium:function(l){var u=r(l,a);return i.push(u),function(){i=i.filter(function(d){return d!==u})}},assignSyncMedium:function(l){for(a=!0;i.length;){var u=i;i=[],u.forEach(l)}i={push:function(d){return l(d)},filter:function(){return i}}},assignMedium:function(l){a=!0;var u=[];if(i.length){var d=i;i=[],d.forEach(l),u=i}var m=function(){var C=u;u=[],C.forEach(l)},p=function(){return Promise.resolve().then(m)};p(),i={push:function(C){u.push(C),p()},filter:function(C){return u=u.filter(C),i}}}};return c}function qw(t){t===void 0&&(t={});var r=Vw(null);return r.options=Wn({async:!0,ssr:!1},t),r}var bg=function(t){var r=t.sideCar,i=gg(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=r.read();if(!a)throw new Error("Sidecar medium not found");return E.createElement(a,Wn({},i))};bg.isSideCarExport=!0;function Yw(t,r){return t.useMedium(r),bg}var xg=qw(),od=function(){},ml=E.forwardRef(function(t,r){var i=E.useRef(null),a=E.useState({onScrollCapture:od,onWheelCapture:od,onTouchMoveCapture:od}),c=a[0],l=a[1],u=t.forwardProps,d=t.children,m=t.className,p=t.removeScrollBar,C=t.enabled,g=t.shards,b=t.sideCar,x=t.noRelative,v=t.noIsolation,S=t.inert,w=t.allowPinchZoom,T=t.as,j=T===void 0?"div":T,R=t.gapMode,O=gg(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,D=$w([i,r]),_=Wn(Wn({},O),c);return E.createElement(E.Fragment,null,C&&E.createElement(M,{sideCar:xg,removeScrollBar:p,shards:g,noRelative:x,noIsolation:v,inert:S,setCallbacks:l,allowPinchZoom:!!w,lockRef:i,gapMode:R}),u?E.cloneElement(E.Children.only(d),Wn(Wn({},_),{ref:D})):E.createElement(j,Wn({},_,{className:m,ref:D}),d))});ml.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ml.classNames={fullWidth:hl,zeroRight:fl};var Xw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Kw(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=Xw();return r&&t.setAttribute("nonce",r),t}function Fw(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function Qw(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var Zw=function(){var t=0,r=null;return{add:function(i){t==0&&(r=Kw())&&(Fw(r,i),Qw(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},Ww=function(){var t=Zw();return function(r,i){E.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&i])}},vg=function(){var t=Ww(),r=function(i){var a=i.styles,c=i.dynamic;return t(a,c),null};return r},Jw={left:0,top:0,right:0,gap:0},ad=function(t){return parseInt(t||"",10)||0},eE=function(t){var r=window.getComputedStyle(document.body),i=r[t==="padding"?"paddingLeft":"marginLeft"],a=r[t==="padding"?"paddingTop":"marginTop"],c=r[t==="padding"?"paddingRight":"marginRight"];return[ad(i),ad(a),ad(c)]},tE=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Jw;var r=eE(t),i=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-i+r[2]-r[0])}},nE=vg(),xa="data-scroll-locked",rE=function(t,r,i,a){var c=t.left,l=t.top,u=t.right,d=t.gap;return i===void 0&&(i="margin"),`
52
+ .`.concat(Bw,` {
53
53
  overflow: hidden `).concat(a,`;
54
54
  padding-right: `).concat(d,"px ").concat(a,`;
55
55
  }
56
- body[`).concat(ha,`] {
56
+ body[`).concat(xa,`] {
57
57
  overflow: hidden `).concat(a,`;
58
58
  overscroll-behavior: contain;
59
59
  `).concat([r&&"position: relative ".concat(a,";"),i==="margin"&&`
@@ -66,137 +66,137 @@ Error generating stack: `+o.message+`
66
66
  `),i==="padding"&&"padding-right: ".concat(d,"px ").concat(a,";")].filter(Boolean).join(""),`
67
67
  }
68
68
 
69
- .`).concat(rl,` {
69
+ .`).concat(fl,` {
70
70
  right: `).concat(d,"px ").concat(a,`;
71
71
  }
72
72
 
73
- .`).concat(ol,` {
73
+ .`).concat(hl,` {
74
74
  margin-right: `).concat(d,"px ").concat(a,`;
75
75
  }
76
76
 
77
- .`).concat(rl," .").concat(rl,` {
77
+ .`).concat(fl," .").concat(fl,` {
78
78
  right: 0 `).concat(a,`;
79
79
  }
80
80
 
81
- .`).concat(ol," .").concat(ol,` {
81
+ .`).concat(hl," .").concat(hl,` {
82
82
  margin-right: 0 `).concat(a,`;
83
83
  }
84
84
 
85
- body[`).concat(ha,`] {
86
- `).concat(Iw,": ").concat(d,`px;
85
+ body[`).concat(xa,`] {
86
+ `).concat(Hw,": ").concat(d,`px;
87
87
  }
88
- `)},mg=function(){var t=parseInt(document.body.getAttribute(ha)||"0",10);return isFinite(t)?t:0},Jw=function(){E.useEffect(function(){return document.body.setAttribute(ha,(mg()+1).toString()),function(){var t=mg()-1;t<=0?document.body.removeAttribute(ha):document.body.setAttribute(ha,t.toString())}},[])},eE=function(t){var r=t.noRelative,i=t.noImportant,a=t.gapMode,c=a===void 0?"margin":a;Jw();var l=E.useMemo(function(){return Fw(c)},[c]);return E.createElement(Zw,{styles:Ww(l,!r,c,i?"":"!important")})},Wu=!1;if(typeof window<"u")try{var il=Object.defineProperty({},"passive",{get:function(){return Wu=!0,!0}});window.addEventListener("test",il,il),window.removeEventListener("test",il,il)}catch{Wu=!1}var ma=Wu?{passive:!1}:!1,tE=function(t){return t.tagName==="TEXTAREA"},pg=function(t,r){if(!(t instanceof Element))return!1;var i=window.getComputedStyle(t);return i[r]!=="hidden"&&!(i.overflowY===i.overflowX&&!tE(t)&&i[r]==="visible")},nE=function(t){return pg(t,"overflowY")},rE=function(t){return pg(t,"overflowX")},gg=function(t,r){var i=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var c=yg(t,a);if(c){var l=bg(t,a),u=l[1],d=l[2];if(u>d)return!0}a=a.parentNode}while(a&&a!==i.body);return!1},oE=function(t){var r=t.scrollTop,i=t.scrollHeight,a=t.clientHeight;return[r,i,a]},aE=function(t){var r=t.scrollLeft,i=t.scrollWidth,a=t.clientWidth;return[r,i,a]},yg=function(t,r){return t==="v"?nE(r):rE(r)},bg=function(t,r){return t==="v"?oE(r):aE(r)},iE=function(t,r){return t==="h"&&r==="rtl"?-1:1},sE=function(t,r,i,a,c){var l=iE(t,window.getComputedStyle(r).direction),u=l*a,d=i.target,m=r.contains(d),p=!1,C=u>0,g=0,b=0;do{if(!d)break;var v=bg(t,d),x=v[0],S=v[1],w=v[2],T=S-w-l*x;(x||T)&&yg(t,d)&&(g+=T,b+=x);var j=d.parentNode;d=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!m&&d!==document.body||m&&(r.contains(d)||r===d));return(C&&Math.abs(g)<1||!C&&Math.abs(b)<1)&&(p=!0),p},sl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},xg=function(t){return[t.deltaX,t.deltaY]},vg=function(t){return t&&"current"in t?t.current:t},lE=function(t,r){return t[0]===r[0]&&t[1]===r[1]},cE=function(t){return`
88
+ `)},Sg=function(){var t=parseInt(document.body.getAttribute(xa)||"0",10);return isFinite(t)?t:0},oE=function(){E.useEffect(function(){return document.body.setAttribute(xa,(Sg()+1).toString()),function(){var t=Sg()-1;t<=0?document.body.removeAttribute(xa):document.body.setAttribute(xa,t.toString())}},[])},aE=function(t){var r=t.noRelative,i=t.noImportant,a=t.gapMode,c=a===void 0?"margin":a;oE();var l=E.useMemo(function(){return tE(c)},[c]);return E.createElement(nE,{styles:rE(l,!r,c,i?"":"!important")})},id=!1;if(typeof window<"u")try{var pl=Object.defineProperty({},"passive",{get:function(){return id=!0,!0}});window.addEventListener("test",pl,pl),window.removeEventListener("test",pl,pl)}catch{id=!1}var va=id?{passive:!1}:!1,iE=function(t){return t.tagName==="TEXTAREA"},Cg=function(t,r){if(!(t instanceof Element))return!1;var i=window.getComputedStyle(t);return i[r]!=="hidden"&&!(i.overflowY===i.overflowX&&!iE(t)&&i[r]==="visible")},sE=function(t){return Cg(t,"overflowY")},lE=function(t){return Cg(t,"overflowX")},wg=function(t,r){var i=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var c=Eg(t,a);if(c){var l=Tg(t,a),u=l[1],d=l[2];if(u>d)return!0}a=a.parentNode}while(a&&a!==i.body);return!1},cE=function(t){var r=t.scrollTop,i=t.scrollHeight,a=t.clientHeight;return[r,i,a]},uE=function(t){var r=t.scrollLeft,i=t.scrollWidth,a=t.clientWidth;return[r,i,a]},Eg=function(t,r){return t==="v"?sE(r):lE(r)},Tg=function(t,r){return t==="v"?cE(r):uE(r)},dE=function(t,r){return t==="h"&&r==="rtl"?-1:1},fE=function(t,r,i,a,c){var l=dE(t,window.getComputedStyle(r).direction),u=l*a,d=i.target,m=r.contains(d),p=!1,C=u>0,g=0,b=0;do{if(!d)break;var x=Tg(t,d),v=x[0],S=x[1],w=x[2],T=S-w-l*v;(v||T)&&Eg(t,d)&&(g+=T,b+=v);var j=d.parentNode;d=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!m&&d!==document.body||m&&(r.contains(d)||r===d));return(C&&Math.abs(g)<1||!C&&Math.abs(b)<1)&&(p=!0),p},gl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},jg=function(t){return[t.deltaX,t.deltaY]},Ag=function(t){return t&&"current"in t?t.current:t},hE=function(t,r){return t[0]===r[0]&&t[1]===r[1]},mE=function(t){return`
89
89
  .block-interactivity-`.concat(t,` {pointer-events: none;}
90
90
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
91
- `)},uE=0,pa=[];function dE(t){var r=E.useRef([]),i=E.useRef([0,0]),a=E.useRef(),c=E.useState(uE++)[0],l=E.useState(hg)[0],u=E.useRef(t);E.useEffect(function(){u.current=t},[t]),E.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(c));var S=_w([t.lockRef.current],(t.shards||[]).map(vg),!0).filter(Boolean);return S.forEach(function(w){return w.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(c))})}}},[t.inert,t.lockRef.current,t.shards]);var d=E.useCallback(function(S,w){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var T=sl(S),j=i.current,R="deltaX"in S?S.deltaX:j[0]-T[0],O="deltaY"in S?S.deltaY:j[1]-T[1],M,D=S.target,_=Math.abs(R)>Math.abs(O)?"h":"v";if("touches"in S&&_==="h"&&D.type==="range")return!1;var I=window.getSelection(),z=I&&I.anchorNode,H=z?z===D||z.contains(D):!1;if(H)return!1;var L=gg(_,D);if(!L)return!0;if(L?M=_:(M=_==="v"?"h":"v",L=gg(_,D)),!L)return!1;if(!a.current&&"changedTouches"in S&&(R||O)&&(a.current=M),!M)return!0;var $=a.current||M;return sE($,w,S,$==="h"?R:O)},[]),m=E.useCallback(function(S){var w=S;if(!(!pa.length||pa[pa.length-1]!==l)){var T="deltaY"in w?xg(w):sl(w),j=r.current.filter(function(M){return M.name===w.type&&(M.target===w.target||w.target===M.shadowParent)&&lE(M.delta,T)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var R=(u.current.shards||[]).map(vg).filter(Boolean).filter(function(M){return M.contains(w.target)}),O=R.length>0?d(w,R[0]):!u.current.noIsolation;O&&w.cancelable&&w.preventDefault()}}},[]),p=E.useCallback(function(S,w,T,j){var R={name:S,delta:w,target:T,should:j,shadowParent:fE(T)};r.current.push(R),setTimeout(function(){r.current=r.current.filter(function(O){return O!==R})},1)},[]),C=E.useCallback(function(S){i.current=sl(S),a.current=void 0},[]),g=E.useCallback(function(S){p(S.type,xg(S),S.target,d(S,t.lockRef.current))},[]),b=E.useCallback(function(S){p(S.type,sl(S),S.target,d(S,t.lockRef.current))},[]);E.useEffect(function(){return pa.push(l),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,ma),document.addEventListener("touchmove",m,ma),document.addEventListener("touchstart",C,ma),function(){pa=pa.filter(function(S){return S!==l}),document.removeEventListener("wheel",m,ma),document.removeEventListener("touchmove",m,ma),document.removeEventListener("touchstart",C,ma)}},[]);var v=t.removeScrollBar,x=t.inert;return E.createElement(E.Fragment,null,x?E.createElement(l,{styles:cE(c)}):null,v?E.createElement(eE,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function fE(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const hE=Uw(fg,dE);var Ju=E.forwardRef(function(t,r){return E.createElement(al,Xn({},t,{ref:r,sideCar:hE}))});Ju.classNames=al.classNames;var mE=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},ga=new WeakMap,ll=new WeakMap,cl={},ed=0,Sg=function(t){return t&&(t.host||Sg(t.parentNode))},pE=function(t,r){return r.map(function(i){if(t.contains(i))return i;var a=Sg(i);return a&&t.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},gE=function(t,r,i,a){var c=pE(r,Array.isArray(t)?t:[t]);cl[i]||(cl[i]=new WeakMap);var l=cl[i],u=[],d=new Set,m=new Set(c),p=function(g){!g||d.has(g)||(d.add(g),p(g.parentNode))};c.forEach(p);var C=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(d.has(b))C(b);else try{var v=b.getAttribute(a),x=v!==null&&v!=="false",S=(ga.get(b)||0)+1,w=(l.get(b)||0)+1;ga.set(b,S),l.set(b,w),u.push(b),S===1&&x&&ll.set(b,!0),w===1&&b.setAttribute(i,"true"),x||b.setAttribute(a,"true")}catch(T){console.error("aria-hidden: cannot operate on ",b,T)}})};return C(r),d.clear(),ed++,function(){u.forEach(function(g){var b=ga.get(g)-1,v=l.get(g)-1;ga.set(g,b),l.set(g,v),b||(ll.has(g)||g.removeAttribute(a),ll.delete(g)),v||g.removeAttribute(i)}),ed--,ed||(ga=new WeakMap,ga=new WeakMap,ll=new WeakMap,cl={})}},Cg=function(t,r,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),c=mE(t);return c?(a.push.apply(a,Array.from(c.querySelectorAll("[aria-live], script"))),gE(a,c,i,"aria-hidden")):function(){return null}},yE=Object.defineProperty,wn=(t,r)=>yE(t,"name",{value:r,configurable:!0}),td="Dialog",[wg,NM]=Cn(td),[bE,cr]=wg(td),xE=wn(t=>{const{__scopeDialog:r,children:i,open:a,defaultOpen:c,onOpenChange:l,modal:u=!0}=t,d=E.useRef(null),m=E.useRef(null),{nodes:p,registry:C}=eg(),[g,b]=ar({prop:a,defaultProp:c??!1,onChange:l,caller:td}),[v,x]=E.useState(0),[S,w]=E.useState(0);return f.jsx(bE,{scope:r,triggerRef:d,contentRef:m,contentId:sr(),titleId:sr(),descriptionId:sr(),titlePresent:v>0,descriptionPresent:S>0,setTitleCount:x,setDescriptionCount:w,open:g,onOpenChange:b,onOpenToggle:E.useCallback(()=>b(T=>!T),[b]),modal:u,branchNodes:p,branchRegistry:C,children:i})},"Dialog"),Eg="DialogPortal",[vE,Tg]=wg(Eg,{forceMount:void 0}),SE=wn(t=>{const{__scopeDialog:r,forceMount:i,children:a,container:c}=t,l=cr(Eg,r);return f.jsx(vE,{scope:r,forceMount:i,children:E.Children.map(a,u=>f.jsx($r,{present:i||l.open,children:f.jsx(Yu,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),nd="DialogOverlay",CE=E.forwardRef(wn(function(r,i){const a=Tg(nd,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=cr(nd,r.__scopeDialog);return u.modal?f.jsx($r,{present:c||u.open,children:f.jsx(EE,{...l,ref:i})}):null},"DialogOverlay")),wE=or("DialogOverlay.RemoveScroll"),EE=E.forwardRef(wn(function(r,i){const{__scopeDialog:a,...c}=r,l=cr(nd,a),u=Xp(),d=De(i,u);return f.jsx(Ju,{as:wE,allowPinchZoom:!0,shards:E.useMemo(()=>[l.contentRef,...l.branchNodes.map(m=>({current:m}))],[l.contentRef,l.branchNodes]),children:f.jsx(ze.div,{"data-state":od(l.open),...c,ref:d,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),Ni="DialogContent",TE=E.forwardRef(wn(function(r,i){const a=Tg(Ni,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=cr(Ni,r.__scopeDialog);return f.jsx($r,{present:c||u.open,children:u.modal?f.jsx(jE,{...l,ref:i}):f.jsx(AE,{...l,ref:i})})},"DialogContent")),jE=E.forwardRef(wn(function(r,i){const a=cr(Ni,r.__scopeDialog),c=E.useRef(null),l=De(i,a.contentRef,c);return E.useEffect(()=>{const u=c.current;if(u)return Cg(u)},[]),f.jsx(jg,{...r,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Ee(r.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Ee(r.onPointerDownOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&u.preventDefault()}),onFocusOutside:Ee(r.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),AE=E.forwardRef(wn(function(r,i){const a=cr(Ni,r.__scopeDialog),c=E.useRef(!1),l=E.useRef(!1);return f.jsx(jg,{...r,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{r.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||a.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,l.current=!1},onInteractOutside:u=>{r.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"DialogContentNonModal")),jg=E.forwardRef(wn(function(r,i){const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:u,"aria-describedby":d,children:m,...p}=r,C=cr(Ni,a);return nl(),f.jsx(Jp,{registry:C.branchRegistry,children:f.jsx(Zp,{asChild:!0,loop:!0,trapped:c,branches:C.branchNodes,onMountAutoFocus:l,onUnmountAutoFocus:u,children:f.jsx(Bu,{role:"dialog",id:C.contentId,"aria-labelledby":C.titlePresent?C.titleId:void 0,"aria-describedby":C.descriptionPresent?Ag(d,C.descriptionId):d,"data-state":od(C.open),...p,ref:i,deferPointerDownOutside:!0,onDismiss:()=>C.onOpenChange(!1),children:m})})})},"DialogContentImpl")),RE=E.forwardRef(wn(function(r,i){const{__scopeDialog:a,...c}=r,l=cr("DialogTitle",a),{setTitleCount:u}=l;return st(()=>(u(d=>d+1),()=>u(d=>d-1)),[u]),f.jsx(ze.h2,{id:l.titleId,...c,ref:i})},"DialogTitle")),OE="DialogClose",rd=E.forwardRef(wn(function(r,i){const{__scopeDialog:a,...c}=r,l=cr(OE,a);return f.jsx(ze.button,{type:"button",...c,ref:i,onClick:Ee(r.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Ag(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}wn(Ag,"concatAriaDescribedby");function od(t){return t?"open":"closed"}wn(od,"getState");var NE=Object.defineProperty,ME=(t,r)=>NE(t,"name",{value:r,configurable:!0});function Mi(t){const[r,i]=E.useState(void 0);return st(()=>{if(t){i({width:t.offsetWidth,height:t.offsetHeight});let a=0;const c=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];window.cancelAnimationFrame(a),a=window.requestAnimationFrame(()=>{let d,m;if("borderBoxSize"in u){const p=u.borderBoxSize,C=Array.isArray(p)?p[0]:p;d=C.inlineSize,m=C.blockSize}else d=t.offsetWidth,m=t.offsetHeight;i({width:d,height:m})})});return c.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(a),c.unobserve(t)}}else i(void 0)},[t]),r}ME(Mi,"useSize");var _E=Object.defineProperty,ur=(t,r)=>_E(t,"name",{value:r,configurable:!0}),ad="Checkbox",[DE,MM]=Cn(ad),[IE,id]=DE(ad);function Rg(t){const{__scopeCheckbox:r,checked:i,children:a,defaultChecked:c,disabled:l,form:u,name:d,onCheckedChange:m,required:p,value:C="on",internal_do_not_use_render:g}=t,[b,v]=ar({prop:i,defaultProp:c??!1,onChange:m,caller:ad}),[x,S]=E.useState(null),[w,T]=E.useState(null),[j,R]=E.useState(null),O=x?!!u||!!x.closest("form"):!0,M={checked:b,disabled:l,setChecked:v,control:x,setControl:S,name:d,form:u,value:C,userClick:j,onUserClick:R,required:p,defaultChecked:En(c)?!1:c,isFormControl:O,bubbleInput:w,setBubbleInput:T};return f.jsx(IE,{scope:r,...M,children:Og(g)?g(M):a})}ur(Rg,"CheckboxProvider");var kE="CheckboxTrigger",LE=E.forwardRef(ur(function({__scopeCheckbox:r,onKeyDown:i,onClick:a,...c},l){const{control:u,value:d,disabled:m,checked:p,required:C,setControl:g,setChecked:b,onUserClick:v,isFormControl:x,bubbleInput:S}=id(kE,r),w=De(l,g),T=E.useRef(p);return E.useEffect(()=>{const j=u?.form;if(j){const R=ur(()=>b(T.current),"reset");return j.addEventListener("reset",R),()=>j.removeEventListener("reset",R)}},[u,b]),f.jsx(ze.button,{type:"button",role:"checkbox","aria-checked":En(p)?"mixed":p,"aria-required":C,"data-state":sd(p),"data-disabled":m?"":void 0,disabled:m,value:d,...c,ref:w,onKeyDown:Ee(i,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ee(a,j=>{const R=j.isPropagationStopped();v({requestedChecked:En(p)?!0:!p,hasConsumerStoppedPropagation:R}),b(O=>En(O)?!0:!O),S&&x&&(R||j.stopPropagation())})})},"CheckboxTrigger")),zE=E.forwardRef(ur(function(r,i){const{__scopeCheckbox:a,name:c,checked:l,defaultChecked:u,required:d,disabled:m,value:p,onCheckedChange:C,form:g,...b}=r;return f.jsx(Rg,{__scopeCheckbox:a,checked:l,defaultChecked:u,disabled:m,required:d,onCheckedChange:C,name:c,form:g,value:p,internal_do_not_use_render:({isFormControl:v})=>f.jsxs(f.Fragment,{children:[f.jsx(LE,{...b,ref:i,__scopeCheckbox:a}),v&&f.jsx(UE,{__scopeCheckbox:a})]})})},"Checkbox")),BE="CheckboxIndicator",HE=E.forwardRef(ur(function(r,i){const{__scopeCheckbox:a,forceMount:c,...l}=r,u=id(BE,a);return f.jsx($r,{present:c||En(u.checked)||u.checked===!0,children:f.jsx(ze.span,{"data-state":sd(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),PE="CheckboxBubbleInput",UE=E.forwardRef(ur(function({__scopeCheckbox:r,onClick:i,...a},c){const{control:l,userClick:u,checked:d,defaultChecked:m,required:p,disabled:C,name:g,value:b,form:v,bubbleInput:x,setBubbleInput:S}=id(PE,r),w=De(c,S),T=Mi(l),j=E.useRef(!1),R=E.useRef(d),O=E.useRef(u),M=E.useRef(null);E.useEffect(()=>{const _=x;if(!_)return;const I=window.HTMLInputElement.prototype,H=Object.getOwnPropertyDescriptor(I,"checked").set;if(!H)return;const L=R.current!==d;R.current=d;const $=u!==null&&u!==O.current;if(O.current=u,$)M.current=L?null:u,L&&(_.indeterminate=En(d),H.call(_,En(d)?!1:d)),_.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(L){const Y=M.current;M.current=null;const U=Y?.requestedChecked===d;j.current=!0,_.indeterminate=En(d),H.call(_,En(d)?!1:d),_.dispatchEvent(new Event("click",{bubbles:!(U&&Y.hasConsumerStoppedPropagation)})),j.current=!1}},[x,d,u]);const D=E.useRef(En(d)?!1:d);return f.jsx(ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??D.current,required:p,disabled:C,name:g,value:b,form:v,...a,tabIndex:-1,ref:w,onClick:Ee(i,_=>{j.current&&_.stopPropagation()}),style:{...a.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Og(t){return typeof t=="function"}ur(Og,"isFunction");function En(t){return t==="indeterminate"}ur(En,"isIndeterminate");function sd(t){return En(t)?"indeterminate":t?"checked":"unchecked"}ur(sd,"getState");const $E=["top","right","bottom","left"],Gr=Math.min,dr=Math.max,ul=Math.round,dl=Math.floor,fr=t=>({x:t,y:t}),GE={left:"right",right:"left",bottom:"top",top:"bottom"};function Ng(t,r,i){return dr(t,Gr(r,i))}function hr(t,r){return typeof t=="function"?t(r):t}function Vr(t){return t.split("-")[0]}function ya(t){return t.split("-")[1]}function ld(t){return t==="x"?"y":"x"}function cd(t){return t==="y"?"height":"width"}function Kn(t){const r=t[0];return r==="t"||r==="b"?"y":"x"}function ud(t){return ld(Kn(t))}function VE(t,r,i){i===void 0&&(i=!1);const a=ya(t),c=ud(t),l=cd(c);let u=c==="x"?a===(i?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[l]>r.floating[l]&&(u=fl(u)),[u,fl(u)]}function qE(t){const r=fl(t);return[dd(t),r,dd(r)]}function dd(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Mg=["left","right"],_g=["right","left"],YE=["top","bottom"],XE=["bottom","top"];function KE(t,r,i){switch(t){case"top":case"bottom":return i?r?_g:Mg:r?Mg:_g;case"left":case"right":return r?YE:XE;default:return[]}}function QE(t,r,i,a){const c=ya(t);let l=KE(Vr(t),i==="start",a);return c&&(l=l.map(u=>u+"-"+c),r&&(l=l.concat(l.map(dd)))),l}function fl(t){const r=Vr(t);return GE[r]+t.slice(r.length)}function FE(t){var r,i,a,c;return{top:(r=t.top)!=null?r:0,right:(i=t.right)!=null?i:0,bottom:(a=t.bottom)!=null?a:0,left:(c=t.left)!=null?c:0}}function Dg(t){return typeof t!="number"?FE(t):{top:t,right:t,bottom:t,left:t}}function hl(t){const{x:r,y:i,width:a,height:c}=t;return{width:a,height:c,top:i,left:r,right:r+a,bottom:i+c,x:r,y:i}}function Ig(t,r,i){let{reference:a,floating:c}=t;const l=Kn(r),u=ud(r),d=cd(u),m=Vr(r),p=l==="y",C=a.x+a.width/2-c.width/2,g=a.y+a.height/2-c.height/2,b=a[d]/2-c[d]/2;let v;switch(m){case"top":v={x:C,y:a.y-c.height};break;case"bottom":v={x:C,y:a.y+a.height};break;case"right":v={x:a.x+a.width,y:g};break;case"left":v={x:a.x-c.width,y:g};break;default:v={x:a.x,y:a.y}}const x=ya(r);return x&&(v[u]+=b*(x==="end"?1:-1)*(i&&p?-1:1)),v}async function ZE(t,r){var i;r===void 0&&(r={});const{x:a,y:c,platform:l,rects:u,elements:d,strategy:m}=t,{boundary:p="clippingAncestors",rootBoundary:C="viewport",elementContext:g="floating",altBoundary:b=!1,padding:v=0}=hr(r,t),x=Dg(v),w=d[b?g==="floating"?"reference":"floating":g],T=hl(await l.getClippingRect({element:(i=await(l.isElement==null?void 0:l.isElement(w)))==null||i?w:w.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:C,strategy:m})),j=g==="floating"?{x:a,y:c,width:u.floating.width,height:u.floating.height}:u.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),O=await(l.isElement==null?void 0:l.isElement(R))&&await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1},M=hl(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:j,offsetParent:R,strategy:m}):j);return{top:(T.top-M.top+x.top)/O.y,bottom:(M.bottom-T.bottom+x.bottom)/O.y,left:(T.left-M.left+x.left)/O.x,right:(M.right-T.right+x.right)/O.x}}const WE=50,JE=async(t,r,i)=>{const{placement:a="bottom",strategy:c="absolute",middleware:l=[],platform:u}=i,d=u.detectOverflow?u:{...u,detectOverflow:ZE},m=await(u.isRTL==null?void 0:u.isRTL(r));let p=await u.getElementRects({reference:t,floating:r,strategy:c}),{x:C,y:g}=Ig(p,a,m),b=a,v=0;const x={};for(let S=0;S<l.length;S++){const w=l[S];if(!w)continue;const{name:T,fn:j}=w,{x:R,y:O,data:M,reset:D}=await j({x:C,y:g,initialPlacement:a,placement:b,strategy:c,middlewareData:x,rects:p,platform:d,elements:{reference:t,floating:r}});C=R??C,g=O??g,x[T]={...x[T],...M},D&&v<WE&&(v++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(p=D.rects===!0?await u.getElementRects({reference:t,floating:r,strategy:c}):D.rects),{x:C,y:g}=Ig(p,b,m)),S=-1)}return{x:C,y:g,placement:b,strategy:c,middlewareData:x}},eT=t=>({name:"arrow",options:t,async fn(r){const{x:i,y:a,placement:c,rects:l,platform:u,elements:d,middlewareData:m}=r,{element:p,padding:C=0}=hr(t,r)||{};if(p==null)return{};const g=Dg(C),b={x:i,y:a},v=ud(c),x=cd(v),S=await u.getDimensions(p),w=v==="y",T=w?"top":"left",j=w?"bottom":"right",R=w?"clientHeight":"clientWidth",O=l.reference[x]+l.reference[v]-b[v]-l.floating[x],M=b[v]-l.reference[v],D=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let _=D?D[R]:0;(!_||!await(u.isElement==null?void 0:u.isElement(D)))&&(_=d.floating[R]||l.floating[x]);const I=O/2-M/2,z=_/2-S[x]/2-1,H=Gr(g[T],z),L=Gr(g[j],z),$=_-S[x]-L,Y=_/2-S[x]/2+I,U=Ng(H,Y,$),q=!m.arrow&&ya(c)!=null&&Y!==U&&l.reference[x]/2-(Y<H?H:L)-S[x]/2<0,P=q?Y<H?Y-H:Y-$:0;return{[v]:b[v]+P,data:{[v]:U,centerOffset:Y-U-P,...q&&{alignmentOffset:P}},reset:q}}}),tT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var i,a;const{placement:c,middlewareData:l,rects:u,initialPlacement:d,platform:m,elements:p}=r,{mainAxis:C=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...w}=hr(t,r);if((i=l.arrow)!=null&&i.alignmentOffset)return{};const T=Vr(c),j=Kn(d),R=Vr(d)===d,O=await(m.isRTL==null?void 0:m.isRTL(p.floating)),M=b||(R||!S?[fl(d)]:qE(d)),D=x!=="none";!b&&D&&M.push(...QE(d,S,x,O));const _=[d,...M],I=await m.detectOverflow(r,w),z=[];let H=((a=l.flip)==null?void 0:a.overflows)||[];if(C&&z.push(I[T]),g){const U=VE(c,u,O);z.push(I[U[0]],I[U[1]])}if(H=[...H,{placement:c,overflows:z}],!z.every(U=>U<=0)){var L,$;const U=(((L=l.flip)==null?void 0:L.index)||0)+1,q=_[U];if(q&&(!(g==="alignment"?j!==Kn(q):!1)||H.every(B=>Kn(B.placement)===j?B.overflows[0]>0:!0)))return{data:{index:U,overflows:H},reset:{placement:q}};let P=($=H.filter(G=>G.overflows[0]<=0).sort((G,B)=>G.overflows[1]-B.overflows[1])[0])==null?void 0:$.placement;if(!P)switch(v){case"bestFit":{var Y;const G=(Y=H.filter(B=>{if(D){const Q=Kn(B.placement);return Q===j||Q==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(Q=>Q>0).reduce((Q,N)=>Q+N,0)]).sort((B,Q)=>B[1]-Q[1])[0])==null?void 0:Y[0];G&&(P=G);break}case"initialPlacement":P=d;break}if(c!==P)return{reset:{placement:P}}}return{}}}};function kg(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function Lg(t){return $E.some(r=>t[r]>=0)}const nT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:i,platform:a}=r,{strategy:c="referenceHidden",...l}=hr(t,r);switch(c){case"referenceHidden":{const u=await a.detectOverflow(r,{...l,elementContext:"reference"}),d=kg(u,i.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Lg(d)}}}case"escaped":{const u=await a.detectOverflow(r,{...l,altBoundary:!0}),d=kg(u,i.floating);return{data:{escapedOffsets:d,escaped:Lg(d)}}}default:return{}}}}},zg=new Set(["left","top"]);async function rT(t,r){const{placement:i,platform:a,elements:c}=t,l=await(a.isRTL==null?void 0:a.isRTL(c.floating)),u=Vr(i),d=ya(i),m=Kn(i)==="y",p=zg.has(u)?-1:1,C=l&&m?-1:1,g=hr(r,t);let{mainAxis:b,crossAxis:v,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof x=="number"&&(v=d==="end"?x*-1:x),m?{x:v*C,y:b*p}:{x:b*p,y:v*C}}const oT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var i,a;const{x:c,y:l,placement:u,middlewareData:d}=r,m=await rT(r,t);return u===((i=d.offset)==null?void 0:i.placement)&&(a=d.arrow)!=null&&a.alignmentOffset?{}:{x:c+m.x,y:l+m.y,data:{...m,placement:u}}}}},aT=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:i,y:a,placement:c,platform:l}=r,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:j=>{let{x:R,y:O}=j;return{x:R,y:O}}},...p}=hr(t,r),C={x:i,y:a},g=await l.detectOverflow(r,p),b=Kn(c),v=ld(b);let x=C[v],S=C[b];const w=(j,R)=>Ng(R+g[j==="y"?"top":"left"],R,R-g[j==="y"?"bottom":"right"]);u&&(x=w(v,x)),d&&(S=w(b,S));const T=m.fn({...r,[v]:x,[b]:S});return{...T,data:{x:T.x-i,y:T.y-a,enabled:{[v]:u,[b]:d}}}}}},iT=function(t){return t===void 0&&(t={}),{options:t,fn(r){var i,a;const{x:c,y:l,placement:u,rects:d,middlewareData:m}=r,{offset:p=0,mainAxis:C=!0,crossAxis:g=!0}=hr(t,r),b={x:c,y:l},v=Kn(u),x=ld(v);let S=b[x],w=b[v];const T=hr(p,r),j=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(i=T.mainAxis)!=null?i:0,crossAxis:(a=T.crossAxis)!=null?a:0};if(C){const M=x==="y"?"height":"width",D=d.reference[x]-d.floating[M]+j.mainAxis,_=d.reference[x]+d.reference[M]-j.mainAxis;S<D?S=D:S>_&&(S=_)}if(g){var R,O;const M=x==="y"?"width":"height",D=zg.has(Vr(u)),_=d.reference[v]-d.floating[M]+(D&&((R=m.offset)==null?void 0:R[v])||0)+(D?0:j.crossAxis),I=d.reference[v]+d.reference[M]+(D?0:((O=m.offset)==null?void 0:O[v])||0)-(D?j.crossAxis:0);w<_?w=_:w>I&&(w=I)}return{[x]:S,[v]:w}}}},sT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){const{placement:i,rects:a,platform:c,elements:l}=r,{apply:u=()=>{},...d}=hr(t,r),m=await c.detectOverflow(r,d),p=Vr(i),C=ya(i),g=Kn(i)==="y",{width:b,height:v}=a.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=C===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(S=p,x=C==="end"?"top":"bottom");const w=v-m.top-m.bottom,T=b-m.left-m.right,j=Gr(v-m[x],w),R=Gr(b-m[S],T),O=r.middlewareData.shift,M=!O;let D=j,_=R;O!=null&&O.enabled.x&&(_=T),O!=null&&O.enabled.y&&(D=w),M&&!C&&(g?_=b-2*dr(m.left,m.right):D=v-2*dr(m.top,m.bottom)),await u({...r,availableWidth:_,availableHeight:D});const I=await c.getDimensions(l.floating);return b!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function ml(){return typeof window<"u"}function ba(t){return Bg(t)?(t.nodeName||"").toLowerCase():"#document"}function en(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function mr(t){var r;return(r=(Bg(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function Bg(t){return ml()?t instanceof Node||t instanceof en(t).Node:!1}function Qn(t){return ml()?t instanceof Element||t instanceof en(t).Element:!1}function qr(t){return ml()?t instanceof HTMLElement||t instanceof en(t).HTMLElement:!1}function Hg(t){return!ml()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof en(t).ShadowRoot}function pl(t){const{overflow:r,overflowX:i,overflowY:a,display:c}=Fn(t);return/auto|scroll|overlay|hidden|clip/.test(r+a+i)&&c!=="inline"&&c!=="contents"}function lT(t){return/^(table|td|th)$/.test(ba(t))}function gl(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const cT=/transform|translate|scale|rotate|perspective|filter/,uT=/paint|layout|strict|content/,jo=t=>!!t&&t!=="none";let fd;function hd(t){const r=Qn(t)?Fn(t):t;return jo(r.transform)||jo(r.translate)||jo(r.scale)||jo(r.rotate)||jo(r.perspective)||!md()&&(jo(r.backdropFilter)||jo(r.filter))||cT.test(r.willChange||"")||uT.test(r.contain||"")}function dT(t){let r=Ao(t);for(;qr(r)&&!_i(r);){if(hd(r))return r;if(gl(r))return null;r=Ao(r)}return null}function md(){return fd==null&&(fd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),fd}function _i(t){return/^(html|body|#document)$/.test(ba(t))}function Fn(t){return en(t).getComputedStyle(t)}function yl(t){return Qn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ao(t){if(ba(t)==="html")return t;const r=t.assignedSlot||t.parentNode||Hg(t)&&t.host||mr(t);return Hg(r)?r.host:r}function Pg(t){const r=Ao(t);return _i(r)?(t.ownerDocument||t).body:qr(r)&&pl(r)?r:Pg(r)}function Di(t,r,i){var a;r===void 0&&(r=[]),i===void 0&&(i=!0);const c=Pg(t),l=c===((a=t.ownerDocument)==null?void 0:a.body),u=en(c);if(l){const d=pd(u);return r.concat(u,u.visualViewport||[],pl(c)?c:[],d&&i?Di(d):[])}else return r.concat(c,Di(c,[],i))}function pd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ug(t){const r=Fn(t);let i=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const c=qr(t),l=c?t.offsetWidth:i,u=c?t.offsetHeight:a,d=ul(i)!==l||ul(a)!==u;return d&&(i=l,a=u),{width:i,height:a,$:d}}function gd(t){return Qn(t)?t:t.contextElement}function xa(t){const r=gd(t);if(!qr(r))return fr(1);const i=r.getBoundingClientRect(),{width:a,height:c,$:l}=Ug(r);let u=(l?ul(i.width):i.width)/a,d=(l?ul(i.height):i.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const fT=fr(0);function $g(t){const r=en(t);return!md()||!r.visualViewport?fT:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function hT(t,r,i){return r===void 0&&(r=!1),!!i&&r&&i===en(t)}function Ro(t,r,i,a){r===void 0&&(r=!1),i===void 0&&(i=!1);const c=t.getBoundingClientRect(),l=gd(t);let u=fr(1);r&&(a?Qn(a)&&(u=xa(a)):u=xa(t));const d=hT(l,i,a)?$g(l):fr(0);let m=(c.left+d.x)/u.x,p=(c.top+d.y)/u.y,C=c.width/u.x,g=c.height/u.y;if(l&&a){const b=en(l),v=Qn(a)?en(a):a;let x=b,S=pd(x);for(;S&&v!==x;){const w=xa(S),T=S.getBoundingClientRect(),j=Fn(S),R=T.left+(S.clientLeft+parseFloat(j.paddingLeft))*w.x,O=T.top+(S.clientTop+parseFloat(j.paddingTop))*w.y;m*=w.x,p*=w.y,C*=w.x,g*=w.y,m+=R,p+=O,x=en(S),S=pd(x)}}return hl({width:C,height:g,x:m,y:p})}function bl(t,r){const i=yl(t).scrollLeft;return r?r.left+i:Ro(mr(t)).left+i}function Gg(t,r){const i=t.getBoundingClientRect(),a=i.left+r.scrollLeft-bl(t,i),c=i.top+r.scrollTop;return{x:a,y:c}}function mT(t){let{elements:r,rect:i,offsetParent:a,strategy:c}=t;const l=c==="fixed",u=mr(a),d=r?gl(r.floating):!1;if(a===u||d&&l)return i;let m={scrollLeft:0,scrollTop:0},p=fr(1);const C=fr(0),g=qr(a);if((g||!l)&&((ba(a)!=="body"||pl(u))&&(m=yl(a)),g)){const v=Ro(a);p=xa(a),C.x=v.x+a.clientLeft,C.y=v.y+a.clientTop}const b=u&&!g&&!l?Gg(u,m):fr(0);return{width:i.width*p.x,height:i.height*p.y,x:i.x*p.x-m.scrollLeft*p.x+C.x+b.x,y:i.y*p.y-m.scrollTop*p.y+C.y+b.y}}function pT(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function gT(t){const r=yl(t),i=t.ownerDocument.body,a=dr(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),c=dr(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-r.scrollLeft+bl(t);const u=-r.scrollTop;return Fn(i).direction==="rtl"&&(l+=dr(t.clientWidth,i.clientWidth)-a),{width:a,height:c,x:l,y:u}}const yT=25;function bT(t,r,i){i===void 0&&(i="viewport");const a=i==="layoutViewport",c=en(t),l=mr(t),u=c.visualViewport;let d=l.clientWidth,m=l.clientHeight,p=0,C=0;if(u){const b=!md()||r==="fixed";a?b||(p=-u.offsetLeft,C=-u.offsetTop):(d=u.width,m=u.height,b&&(p=u.offsetLeft,C=u.offsetTop))}if(bl(l)<=0){const b=l.ownerDocument,v=b.body,x=getComputedStyle(v),S=b.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(l.clientWidth-v.clientWidth-S),T=getComputedStyle(l).scrollbarGutter==="stable both-edges"?w/2:w;T<=yT&&(d-=T)}return{width:d,height:m,x:p,y:C}}function xT(t,r){const i=Ro(t,!0,r==="fixed"),a=i.top+t.clientTop,c=i.left+t.clientLeft,l=xa(t),u=t.clientWidth*l.x,d=t.clientHeight*l.y,m=c*l.x,p=a*l.y;return{width:u,height:d,x:m,y:p}}function Vg(t,r,i){let a;if(r==="viewport"||r==="layoutViewport")a=bT(t,i,r);else if(r==="document")a=gT(mr(t));else if(Qn(r))a=xT(r,i);else{const c=$g(t);a={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return hl(a)}function vT(t,r){const i=r.get(t);if(i)return i;let a=Di(t,[],!1).filter(d=>Qn(d)&&ba(d)!=="body"),c=null;const l=Fn(t).position==="fixed";let u=l?Ao(t):t;for(;Qn(u)&&!_i(u);){const d=Fn(u),m=hd(u),p=c?c.position:l?"fixed":"";!m&&(p==="fixed"||p==="absolute"&&d.position==="static")?a=a.filter(g=>g!==u):c=d,u=Ao(u)}return r.set(t,a),a}function ST(t){let{element:r,boundary:i,rootBoundary:a,strategy:c}=t;const u=[...i==="clippingAncestors"?gl(r)?[]:vT(r,this._c):[].concat(i),a],d=Vg(r,u[0],c);let m=d.top,p=d.right,C=d.bottom,g=d.left;for(let b=1;b<u.length;b++){const v=Vg(r,u[b],c);m=dr(v.top,m),p=Gr(v.right,p),C=Gr(v.bottom,C),g=dr(v.left,g)}return{width:p-g,height:C-m,x:g,y:m}}function CT(t){const{width:r,height:i}=Ug(t);return{width:r,height:i}}function wT(t,r,i){const a=qr(r),c=mr(r),l=i==="fixed",u=Ro(t,!0,l,r);let d={scrollLeft:0,scrollTop:0};const m=fr(0);if((a||!l)&&((ba(r)!=="body"||pl(c))&&(d=yl(r)),a)){const b=Ro(r,!0,l,r);m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}!a&&c&&(m.x=bl(c));const p=c&&!a&&!l?Gg(c,d):fr(0),C=u.left+d.scrollLeft-m.x-p.x,g=u.top+d.scrollTop-m.y-p.y;return{x:C,y:g,width:u.width,height:u.height}}function yd(t){return Fn(t).position==="static"}function qg(t,r){if(!qr(t)||Fn(t).position==="fixed")return null;if(r)return r(t);let i=t.offsetParent;return mr(t)===i&&(i=i.ownerDocument.body),i}function Yg(t,r){const i=en(t);if(gl(t))return i;if(!qr(t)){let c=Ao(t);for(;c&&!_i(c);){if(Qn(c)&&!yd(c))return c;c=Ao(c)}return i}let a=qg(t,r);for(;a&&lT(a)&&yd(a);)a=qg(a,r);return a&&_i(a)&&yd(a)&&!hd(a)?i:a||dT(t)||i}const ET=async function(t){const r=this.getOffsetParent||Yg,i=this.getDimensions,a=await i(t.floating);return{reference:wT(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function TT(t){return Fn(t).direction==="rtl"}const jT={convertOffsetParentRelativeRectToViewportRelativeRect:mT,getDocumentElement:mr,getClippingRect:ST,getOffsetParent:Yg,getElementRects:ET,getClientRects:pT,getDimensions:CT,getScale:xa,isElement:Qn,isRTL:TT};function Xg(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function AT(t,r,i){let a=null,c;const l=mr(t);function u(){var C;clearTimeout(c),(C=a)==null||C.disconnect(),a=null}function d(C,g){C===void 0&&(C=!1),g===void 0&&(g=1),u();const b=t.getBoundingClientRect(),{left:v,top:x,width:S,height:w}=b;if(C||r(),!S||!w)return;const T=dl(x),j=dl(l.clientWidth-(v+S)),R=dl(l.clientHeight-(x+w)),O=dl(v),D={rootMargin:-T+"px "+-j+"px "+-R+"px "+-O+"px",threshold:dr(0,Gr(1,g))||1};let _=!0;function I(z){const H=z[0].intersectionRatio;if(!Xg(b,t.getBoundingClientRect()))return d();if(H!==g){if(!_)return d();H?d(!1,H):c=setTimeout(()=>{d(!1,1e-7)},1e3)}_=!1}try{a=new IntersectionObserver(I,{...D,root:l.ownerDocument})}catch{a=new IntersectionObserver(I,D)}a.observe(t)}const m=en(t),p=()=>d(i);return m.addEventListener("resize",p),d(!0),()=>{m.removeEventListener("resize",p),u()}}function RT(t,r,i,a){a===void 0&&(a={});const{ancestorScroll:c=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=a,p=gd(t),C=c||l?[...p?Di(p):[],...r?Di(r):[]]:[];C.forEach(T=>{c&&T.addEventListener("scroll",i),l&&T.addEventListener("resize",i)});const g=p&&d?AT(p,i,l):null;let b=-1,v=null;u&&(v=new ResizeObserver(T=>{let[j]=T;j&&j.target===p&&v&&r&&(v.unobserve(r),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=v)==null||R.observe(r)})),i()}),p&&!m&&v.observe(p),r&&v.observe(r));let x,S=m?Ro(t):null;m&&w();function w(){const T=Ro(t);S&&!Xg(S,T)&&i(),S=T,x=requestAnimationFrame(w)}return i(),()=>{var T;C.forEach(j=>{c&&j.removeEventListener("scroll",i),l&&j.removeEventListener("resize",i)}),g?.(),(T=v)==null||T.disconnect(),v=null,m&&cancelAnimationFrame(x)}}const OT=oT,NT=aT,MT=tT,_T=sT,DT=nT,Kg=eT,IT=iT,kT=(t,r,i)=>{const a=new Map,c=i??{},l={...jT,...c.platform,_c:a};return JE(t,r,{...c,platform:l})};var LT=typeof document<"u",zT=function(){},xl=LT?E.useLayoutEffect:zT;function vl(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let i,a,c;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(i=t.length,i!==r.length)return!1;for(a=i;a--!==0;)if(!vl(t[a],r[a]))return!1;return!0}if(c=Object.keys(t),i=c.length,i!==Object.keys(r).length)return!1;for(a=i;a--!==0;)if(!{}.hasOwnProperty.call(r,c[a]))return!1;for(a=i;a--!==0;){const l=c[a];if(!(l==="_owner"&&t.$$typeof)&&!vl(t[l],r[l]))return!1}return!0}return t!==t&&r!==r}function Qg(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Fg(t,r){const i=Qg(t);return Math.round(r*i)/i}function bd(t){const r=E.useRef(t);return xl(()=>{r.current=t}),r}function BT(t){t===void 0&&(t={});const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:c,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:p}=t,[C,g]=E.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[b,v]=E.useState(a);vl(b,a)||v(a);const[x,S]=E.useState(null),[w,T]=E.useState(null),j=E.useCallback(B=>{B!==D.current&&(D.current=B,S(B))},[]),R=E.useCallback(B=>{B!==_.current&&(_.current=B,T(B))},[]),O=l||x,M=u||w,D=E.useRef(null),_=E.useRef(null),I=E.useRef(C),z=m!=null,H=bd(m),L=bd(c),$=bd(p),Y=E.useCallback(()=>{if(!D.current||!_.current)return;const B={placement:r,strategy:i,middleware:b};L.current&&(B.platform=L.current),kT(D.current,_.current,B).then(Q=>{const N={...Q,isPositioned:$.current!==!1};U.current&&!vl(I.current,N)&&(I.current=N,Hr.flushSync(()=>{g(N)}))})},[b,r,i,L,$]);xl(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(B=>({...B,isPositioned:!1})))},[p]);const U=E.useRef(!1);xl(()=>(U.current=!0,()=>{U.current=!1}),[]),xl(()=>{if(O&&(D.current=O),M&&(_.current=M),O&&M){if(H.current)return H.current(O,M,Y);Y()}},[O,M,Y,H,z]);const q=E.useMemo(()=>({reference:D,floating:_,setReference:j,setFloating:R}),[j,R]),P=E.useMemo(()=>({reference:O,floating:M}),[O,M]),G=E.useMemo(()=>{const B={position:i,left:0,top:0};if(!P.floating)return B;const Q=Fg(P.floating,C.x),N=Fg(P.floating,C.y);return d?{...B,transform:"translate("+Q+"px, "+N+"px)",...Qg(P.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:Q,top:N}},[i,d,P.floating,C.x,C.y]);return E.useMemo(()=>({...C,update:Y,refs:q,elements:P,floatingStyles:G}),[C,Y,q,P,G])}const HT=t=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:t,fn(i){const{element:a,padding:c}=typeof t=="function"?t(i):t;return a&&r(a)?a.current!=null?Kg({element:a.current,padding:c}).fn(i):{}:a?Kg({element:a,padding:c}).fn(i):{}}}},PT=(t,r)=>{const i=OT(t);return{name:i.name,fn:i.fn,options:[t,r]}},UT=(t,r)=>{const i=NT(t);return{name:i.name,fn:i.fn,options:[t,r]}},$T=(t,r)=>({fn:IT(t).fn,options:[t,r]}),GT=(t,r)=>{const i=MT(t);return{name:i.name,fn:i.fn,options:[t,r]}},VT=(t,r)=>{const i=_T(t);return{name:i.name,fn:i.fn,options:[t,r]}},qT=(t,r)=>{const i=DT(t);return{name:i.name,fn:i.fn,options:[t,r]}},YT=(t,r)=>{const i=HT(t);return{name:i.name,fn:i.fn,options:[t,r]}};var XT=Object.defineProperty,KT=(t,r)=>XT(t,"name",{value:r,configurable:!0}),QT=E.forwardRef(KT(function(r,i){const{children:a,width:c=10,height:l=5,...u}=r;return f.jsx(ze.svg,{...u,ref:i,width:c,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?a:f.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),FT=Object.defineProperty,pr=(t,r)=>FT(t,"name",{value:r,configurable:!0}),Zg={Partial:"partial"},Wg={Optimized:"optimized",Always:"always"},Jg="Popper",[ey,Sl]=Cn(Jg),[ZT,ty]=ey(Jg),ny=pr(t=>{const{__scopePopper:r,children:i}=t,[a,c]=E.useState(null),[l,u]=E.useState(void 0);return f.jsx(ZT,{scope:r,anchor:a,onAnchorChange:c,placementState:l,setPlacementState:u,children:i})},"Popper"),WT="PopperAnchor",ry=E.forwardRef(pr(function(r,i){const{__scopePopper:a,virtualRef:c,...l}=r,u=ty(WT,a),d=E.useRef(null),m=u.onAnchorChange,p=E.useCallback(S=>{d.current=S,S&&m(S)},[m]),C=De(i,p),g=E.useRef(null);E.useEffect(()=>{if(!c)return;const S=g.current;g.current=c.current,S!==g.current&&m(g.current)});const b=u.placementState&&Cl(u.placementState),v=b?.[0],x=b?.[1];return c?null:f.jsx(ze.div,{"data-radix-popper-side":v,"data-radix-popper-align":x,...l,ref:C})},"PopperAnchor")),oy="PopperContent",[JT,ej]=ey(oy),ay=E.forwardRef(pr(function(r,i){const{__scopePopper:a,side:c="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:C=[],collisionPadding:g=0,sticky:b=Zg.Partial,hideWhenDetached:v=!1,updatePositionStrategy:x=Wg.Optimized,onPlaced:S,...w}=r,T=ty(oy,a),[j,R]=E.useState(null),O=De(i,R),[M,D]=E.useState(null),_=Mi(M),I=_?.width??0,z=_?.height??0,H=c+(u!=="center"?"-"+u:""),L=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},$=Array.isArray(C)?C:[C],Y=$.length>0,U={padding:L,boundary:$.filter(iy),altBoundary:Y},{refs:q,floatingStyles:P,placement:G,isPositioned:B,middlewareData:Q}=BT({strategy:"fixed",placement:H,whileElementsMounted:pr((...ge)=>RT(...ge,{animationFrame:x===Wg.Always}),"whileElementsMounted"),elements:{reference:T.anchor},middleware:[PT({mainAxis:l+z,alignmentAxis:d}),p&&UT({mainAxis:!0,crossAxis:!1,...b===Zg.Partial?{limiter:$T()}:{},...U}),p&&GT({...U}),VT({...U,apply:pr(({elements:ge,rects:de,availableWidth:Me,availableHeight:Be})=>{const{width:Ae,height:Se}=de.reference,Ce=ge.floating.style;Ce.setProperty("--radix-popper-available-width",`${Me}px`),Ce.setProperty("--radix-popper-available-height",`${Be}px`),Ce.setProperty("--radix-popper-anchor-width",`${Ae}px`),Ce.setProperty("--radix-popper-anchor-height",`${Se}px`)},"apply")}),M&&YT({element:M,padding:m}),oj({arrowWidth:I,arrowHeight:z}),v&&qT(Y?{strategy:"referenceHidden",...U}:{strategy:"referenceHidden",padding:U.padding,altBoundary:U.altBoundary})]}),N=T.setPlacementState;st(()=>(N(G),()=>{N(void 0)}),[G,N]);const[K,ne]=Cl(G),te=In(S);st(()=>{B&&te?.()},[B,te]);const le=Q.arrow?.x,oe=Q.arrow?.y,ae=Q.arrow?.centerOffset!==0,[xe,we]=E.useState();return st(()=>{j&&we(window.getComputedStyle(j).zIndex)},[j]),f.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:B?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[Q.transformOrigin?.x,Q.transformOrigin?.y].join(" "),...Q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:f.jsx(JT,{scope:a,placedSide:K,placedAlign:ne,onArrowChange:D,arrowX:le,arrowY:oe,shouldHideArrow:ae,children:f.jsx(ze.div,{"data-side":K,"data-align":ne,...w,ref:O,style:{...w.style,animation:B?w.style?.animation:"none"}})})})},"PopperContent")),tj="PopperArrow",nj={top:"bottom",right:"left",bottom:"top",left:"right"},rj=E.forwardRef(pr(function(r,i){const{__scopePopper:a,...c}=r,l=ej(tj,a),u=nj[l.placedSide];return f.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:f.jsx(QT,{...c,ref:i,style:{...c.style,display:"block"}})})},"PopperArrow"));function iy(t){return t!==null}pr(iy,"isNotNull");var oj=pr(t=>({name:"transformOrigin",options:t,fn(r){const{placement:i,rects:a,middlewareData:c}=r,u=c.arrow?.centerOffset!==0,d=u?0:t.arrowWidth,m=u?0:t.arrowHeight,[p,C]=Cl(i),g={start:"0%",center:"50%",end:"100%"}[C],b=(c.arrow?.x??0)+d/2,v=(c.arrow?.y??0)+m/2;let x="",S="";return p==="bottom"?(x=u?g:`${b}px`,S=`${-m}px`):p==="top"?(x=u?g:`${b}px`,S=`${a.floating.height+m}px`):p==="right"?(x=`${-m}px`,S=u?g:`${v}px`):p==="left"&&(x=`${a.floating.width+m}px`,S=u?g:`${v}px`),{data:{x,y:S}}}}),"transformOrigin");function Cl(t){const[r,i="center"]=t.split("-");return[r,i]}pr(Cl,"getSideAndAlignFromPlacement");var aj=Object.defineProperty,xd=(t,r)=>aj(t,"name",{value:r,configurable:!0}),vd=!1;function sy(){const[t,r]=E.useState(vd);return E.useEffect(()=>{vd||(vd=!0,r(!0))},[]),t}xd(sy,"useIsHydrated");var ly=wo[" useSyncExternalStore ".trim().toString()];function cy(){return()=>{}}xd(cy,"subscribe");function uy(){return ly(cy,()=>!0,()=>!1)}xd(uy,"useIsHydratedModern");var ij=typeof ly=="function"?uy:sy,sj=Object.defineProperty,Oo=(t,r)=>sj(t,"name",{value:r,configurable:!0}),Sd="rovingFocusGroup.onEntryFocus",lj={bubbles:!1,cancelable:!0},wl="RovingFocusGroup",[Cd,dy,cj]=Zs(wl),[uj,fy]=Cn(wl,[cj]),hy={Vertical:"vertical",Horizontal:"horizontal"},dj={RTL:"rtl"},[fj,hj]=uj(wl),mj=E.forwardRef(Oo(function(r,i){return f.jsx(Cd.Provider,{scope:r.__scopeRovingFocusGroup,children:f.jsx(Cd.Slot,{scope:r.__scopeRovingFocusGroup,children:f.jsx(pj,{...r,ref:i})})})},"RovingFocusGroup")),pj=E.forwardRef(Oo(function(r,i){const{__scopeRovingFocusGroup:a,orientation:c,loop:l=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:C,preventScrollOnEntryFocus:g=!1,...b}=r,v=E.useRef(null),x=De(i,v),S=Oi(u),[w,T]=ar({prop:d,defaultProp:m??null,onChange:p,caller:wl}),[j,R]=E.useState(!1),O=In(C),M=dy(a),D=E.useRef(!1),[_,I]=E.useState(0);return E.useEffect(()=>{const z=v.current;if(z)return z.addEventListener(Sd,O),()=>z.removeEventListener(Sd,O)},[O]),f.jsx(fj,{scope:a,orientation:c,dir:S,loop:l,currentTabStopId:w,onItemFocus:E.useCallback(z=>T(z),[T]),onItemShiftTab:E.useCallback(()=>R(!0),[]),onFocusableItemAdd:E.useCallback(()=>I(z=>z+1),[]),onFocusableItemRemove:E.useCallback(()=>I(z=>z-1),[]),children:f.jsx(ze.div,{tabIndex:j||_===0?-1:0,"data-orientation":c,...b,ref:x,style:{outline:"none",...r.style},onMouseDown:Ee(r.onMouseDown,()=>{D.current=!0}),onFocus:Ee(r.onFocus,z=>{const H=!D.current;if(z.target===z.currentTarget&&H&&!j){const L=new CustomEvent(Sd,lj);if(z.currentTarget.dispatchEvent(L),!L.defaultPrevented){const $=M().filter(G=>G.focusable),Y=$.find(G=>G.active),U=$.find(G=>G.id===w),P=[Y,U,...$].filter(Boolean).map(G=>G.ref.current);wd(P,g)}}D.current=!1}),onBlur:Ee(r.onBlur,()=>R(!1))})})},"RovingFocusGroupImpl")),gj="RovingFocusGroupItem",yj=E.forwardRef(Oo(function(r,i){const{__scopeRovingFocusGroup:a,focusable:c=!0,active:l=!1,tabStopId:u,children:d,...m}=r,p=sr(),C=u||p,g=hj(gj,a),b=g.currentTabStopId===C,v=dy(a),{onFocusableItemAdd:x,onFocusableItemRemove:S,currentTabStopId:w}=g,T=ij();return st(()=>{if(!(!T||!c))return x(),()=>S()},[T,c,x,S]),E.useEffect(()=>{if(!(T||!c))return x(),()=>S()},[T,c,x,S]),f.jsx(Cd.ItemSlot,{scope:a,id:C,focusable:c,active:l,children:f.jsx(ze.span,{tabIndex:b?0:-1,"data-orientation":g.orientation,...m,ref:i,onMouseDown:Ee(r.onMouseDown,j=>{c?g.onItemFocus(C):j.preventDefault()}),onFocus:Ee(r.onFocus,()=>g.onItemFocus(C)),onKeyDown:Ee(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){g.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const R=py(j,g.orientation,g.dir);if(R!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let M=v().filter(D=>D.focusable).map(D=>D.ref.current);if(R==="last")M.reverse();else if(R==="prev"||R==="next"){R==="prev"&&M.reverse();const D=M.indexOf(j.currentTarget);M=g.loop?gy(M,D+1):M.slice(D+1)}setTimeout(()=>wd(M))}}),children:typeof d=="function"?d({isCurrentTabStop:b,hasTabStop:w!=null}):d})})},"RovingFocusGroupItem")),bj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function my(t,r){return r!==dj.RTL?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}Oo(my,"getDirectionAwareKey");function py(t,r,i){const a=my(t.key,i);if(!(r===hy.Vertical&&["ArrowLeft","ArrowRight"].includes(a))&&!(r===hy.Horizontal&&["ArrowUp","ArrowDown"].includes(a)))return bj[a]}Oo(py,"getFocusIntent");function wd(t,r=!1){const i=document.activeElement;for(const a of t)if(a===i||(a.focus({preventScroll:r}),document.activeElement!==i))return}Oo(wd,"focusFirst");function gy(t,r){return t.map((i,a)=>t[(r+a)%t.length])}Oo(gy,"wrapArray");var xj=Object.defineProperty,vj=(t,r)=>xj(t,"name",{value:r,configurable:!0});function va(t,[r,i]){return Math.min(i,Math.max(r,t))}vj(va,"clamp");var Sj=Object.defineProperty,qt=(t,r)=>Sj(t,"name",{value:r,configurable:!0}),yy="Radio",[Cj,by]=Cn(yy),[wj,El]=Cj(yy);function xy(t){const{__scopeRadio:r,checked:i=!1,children:a,disabled:c,form:l,name:u,onCheck:d,required:m,value:p="on",internal_do_not_use_render:C}=t,[g,b]=E.useState(null),[v,x]=E.useState(null),[S,w]=E.useState(null),T=g?!!l||!!g.closest("form"):!0,j={checked:i,disabled:c,required:m,name:u,form:l,value:p,control:g,setControl:b,userClick:S,onUserClick:w,isFormControl:T,bubbleInput:v,setBubbleInput:x,onCheck:qt(()=>d?.(),"onCheck")};return f.jsx(wj,{scope:r,...j,children:vy(C)?C(j):a})}qt(xy,"RadioProvider");var Ej="RadioTrigger",Tj=E.forwardRef(qt(function({__scopeRadio:r,onClick:i,...a},c){const{checked:l,disabled:u,value:d,setControl:m,onCheck:p,onUserClick:C,isFormControl:g,bubbleInput:b}=El(Ej,r),v=De(c,m);return f.jsx(ze.button,{type:"button",role:"radio","aria-checked":l,"data-state":Ed(l),"data-disabled":u?"":void 0,disabled:u,value:d,...a,ref:v,onClick:Ee(i,x=>{const S=x.isPropagationStopped();l||(C({hasConsumerStoppedPropagation:S}),p()),b&&g&&(S||x.stopPropagation())})})},"RadioTrigger")),jj="RadioIndicator",Aj=E.forwardRef(qt(function(r,i){const{__scopeRadio:a,forceMount:c,...l}=r,u=El(jj,a);return f.jsx($r,{present:c||u.checked,children:f.jsx(ze.span,{"data-state":Ed(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i})})},"RadioIndicator")),Rj="RadioBubbleInput",Oj=E.forwardRef(qt(function({__scopeRadio:r,onClick:i,...a},c){const{control:l,checked:u,required:d,disabled:m,name:p,value:C,form:g,bubbleInput:b,setBubbleInput:v,userClick:x}=El(Rj,r),S=De(c,v),w=Mi(l),T=E.useRef(!1),j=E.useRef(u),R=E.useRef(x),O=E.useRef(null);E.useEffect(()=>{const D=b;if(!D)return;const _=window.HTMLInputElement.prototype,z=Object.getOwnPropertyDescriptor(_,"checked").set;if(!z)return;const H=j.current!==u;j.current=u;const L=x!==null&&x!==R.current;if(R.current=x,L)O.current=H?null:x,H&&z.call(D,u),D.dispatchEvent(new Event("click",{bubbles:!x.hasConsumerStoppedPropagation}));else if(H){const $=O.current;O.current=null;const Y=u&&$!==null;T.current=!0,z.call(D,u),D.dispatchEvent(new Event("click",{bubbles:!(Y&&$.hasConsumerStoppedPropagation)})),T.current=!1}},[b,u,x]);const M=E.useRef(u);return f.jsx(ze.input,{type:"radio","aria-hidden":!0,defaultChecked:M.current,required:d,disabled:m,name:p,value:C,form:g,...a,tabIndex:-1,ref:S,onClick:Ee(i,D=>{T.current&&D.stopPropagation()}),style:{...a.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function vy(t){return typeof t=="function"}qt(vy,"isFunction");function Ed(t){return t?"checked":"unchecked"}qt(Ed,"getState");var Nj=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Td="RadioGroup",[Mj,_M]=Cn(Td,[fy,by]),Sy=fy(),Tl=by(),[_j,Dj]=Mj(Td),Ij=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,name:c,form:l,defaultValue:u,value:d,required:m=!1,disabled:p=!1,orientation:C,dir:g,loop:b=!0,onValueChange:v,...x}=r,S=Sy(a),w=Oi(g),[T,j]=ar({prop:d,defaultProp:u??null,onChange:v,caller:Td}),[R,O]=E.useState(null),M=De(i,O),D=E.useRef(T);return E.useEffect(()=>{const _=l?R?.ownerDocument.getElementById(l):R?.closest("form");if(_ instanceof HTMLFormElement){const I=qt(()=>j(D.current),"reset");return _.addEventListener("reset",I),()=>_.removeEventListener("reset",I)}},[R,l,j]),f.jsx(_j,{scope:a,name:c,form:l,required:m,disabled:p,value:T,onValueChange:j,children:f.jsx(mj,{asChild:!0,...S,orientation:C,dir:w,loop:b,children:f.jsx(ze.div,{role:"radiogroup","aria-required":m,"aria-orientation":C,"data-disabled":p?"":void 0,dir:w,...x,ref:M})})})},"RadioGroup")),kj="RadioGroupItemProvider",Lj="RadioGroupItemTrigger";function Cy(t){const{__scopeRadioGroup:r,value:i,disabled:a,children:c,internal_do_not_use_render:l}=t,u=Dj(kj,r),d=Tl(r),m=u.disabled||a;return f.jsx(xy,{...d,checked:u.value===i,disabled:m,required:u.required,name:u.name,form:u.form,value:i,onCheck:()=>u.onValueChange(i),internal_do_not_use_render:l,children:c})}qt(Cy,"RadioGroupItemProvider");var zj=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Sy(a),u=Tl(a),{checked:d,disabled:m}=El(Lj,u.__scopeRadio),p=E.useRef(null),C=De(i,p),g=E.useRef(!1);return E.useEffect(()=>{const b=qt(x=>{Nj.includes(x.key)&&(g.current=!0)},"handleKeyDown"),v=qt(()=>g.current=!1,"handleKeyUp");return document.addEventListener("keydown",b),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",b),document.removeEventListener("keyup",v)}},[]),f.jsx(yj,{asChild:!0,...l,focusable:!m,active:d,children:f.jsx(Tj,{...u,...c,ref:C,onKeyDown:Ee(c.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onFocus:Ee(c.onFocus,()=>{g.current&&p.current?.click()})})})},"RadioGroupItemTrigger")),Bj=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,value:c,disabled:l,...u}=r;return f.jsx(Cy,{__scopeRadioGroup:a,value:c,disabled:l,internal_do_not_use_render:({isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx(zj,{...u,ref:i,__scopeRadioGroup:a}),d&&f.jsx(Hj,{__scopeRadioGroup:a})]})})},"RadioGroupItem")),Hj=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Tl(a);return f.jsx(Oj,{...l,...c,ref:i})},"RadioGroupItemBubbleInput")),Pj=E.forwardRef(qt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Tl(a);return f.jsx(Aj,{...l,...c,ref:i})},"RadioGroupIndicator")),Uj=Object.defineProperty,Ue=(t,r)=>Uj(t,"name",{value:r,configurable:!0}),wy={ItemAligned:"item-aligned",Popper:"popper"},$j={RTL:"rtl"},Gj=[" ","Enter","ArrowUp","ArrowDown"],Vj=[" ","Enter"],Sa="Select",[jl,Al,qj]=Zs(Sa),[No,DM]=Cn(Sa,[qj,Sl]),jd=Sl(),[Yj,Yr]=No(Sa),[Xj,Kj]=No(Sa);function Ey(t){const{__scopeSelect:r,children:i,open:a,defaultOpen:c,onOpenChange:l,value:u,defaultValue:d,onValueChange:m,dir:p,name:C,autoComplete:g,disabled:b,required:v,form:x,internal_do_not_use_render:S}=t,w=jd(r),[T,j]=E.useState(null),[R,O]=E.useState(null),[M,D]=E.useState(!1),_=Oi(p),[I,z]=ar({prop:a,defaultProp:c??!1,onChange:l,caller:Sa}),[H,L]=ar({prop:u,defaultProp:d,onChange:m,caller:Sa}),$=E.useRef(null),Y=E.useRef(!1),[U,q]=E.useState(null),P=Ue(ae=>{q({value:ae,hasConsumerStoppedPropagation:Y.current}),L(ae)},"handleUserSelect"),G=E.useRef(H);E.useEffect(()=>{const ae=x?T?.ownerDocument.getElementById(x):T?.form;if(ae instanceof HTMLFormElement){const xe=Ue(()=>L(G.current),"reset");return ae.addEventListener("reset",xe),()=>ae.removeEventListener("reset",xe)}},[x,T,L]);const B=T?!!x||!!T.closest("form"):!0,[Q,N]=E.useState(new Set),K=sr(),ne=Array.from(Q).map(ae=>ae.props.value).join(";"),te=E.useCallback(ae=>{N(xe=>new Set(xe).add(ae))},[]),le=E.useCallback(ae=>{N(xe=>{const we=new Set(xe);return we.delete(ae),we})},[]),oe={required:v,trigger:T,onTriggerChange:j,valueNode:R,onValueNodeChange:O,valueNodeHasChildren:M,onValueNodeHasChildrenChange:D,contentId:K,value:H,onValueChange:L,hasConsumerStoppedPropagationRef:Y,userSelection:U,onUserSelect:P,open:I,onOpenChange:z,dir:_,triggerPointerDownPosRef:$,disabled:b,name:C,autoComplete:g,form:x,nativeOptions:Q,nativeSelectKey:ne,isFormControl:B};return f.jsx(ny,{...w,children:f.jsx(Yj,{scope:r,...oe,children:f.jsx(jl.Provider,{scope:r,children:f.jsx(Xj,{scope:r,onNativeOptionAdd:te,onNativeOptionRemove:le,children:_y(S)?S(oe):i})})})})}Ue(Ey,"SelectProvider");var Qj=Ue(t=>{const{__scopeSelect:r,children:i,...a}=t;return f.jsx(Ey,{__scopeSelect:r,...a,internal_do_not_use_render:({isFormControl:c})=>f.jsxs(f.Fragment,{children:[i,c?f.jsx(j2,{__scopeSelect:r}):null]})})},"Select"),Fj="SelectTrigger",Zj=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,disabled:c=!1,...l}=r,u=jd(a),d=Yr(Fj,a),m=d.disabled||c,p=De(i,d.onTriggerChange),C=Al(a),g=E.useRef("touch"),[b,v,x]=Od(w=>{const T=C().filter(O=>!O.disabled),j=T.find(O=>O.value===d.value),R=Nd(T,w,j);R!==void 0&&d.onUserSelect(R.value)}),S=Ue(w=>{m||(d.onOpenChange(!0),x()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})},"handleOpen");return f.jsx(ry,{asChild:!0,...u,children:f.jsx(ze.button,{type:"button",role:"combobox","aria-controls":d.open?d.contentId:void 0,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":Ii(d.value)?"":void 0,...l,ref:p,onClick:Ee(l.onClick,w=>{w.currentTarget.focus(),g.current!=="mouse"&&S(w)}),onPointerDown:Ee(l.onPointerDown,w=>{g.current=w.pointerType;const T=w.target;T.hasPointerCapture(w.pointerId)&&T.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(S(w),w.preventDefault())}),onKeyDown:Ee(l.onKeyDown,w=>{const T=b.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&(d.hasConsumerStoppedPropagationRef.current=w.isPropagationStopped(),v(w.key)),!(T&&w.key===" ")&&Gj.includes(w.key)&&(S(),w.preventDefault())})})})},"SelectTrigger")),Wj="SelectValue",Jj=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,className:c,style:l,children:u,placeholder:d="",...m}=r,p=Yr(Wj,a),{onValueNodeHasChildrenChange:C}=p,g=u!==void 0,b=De(i,p.onValueNodeChange);st(()=>{C(g)},[C,g]);const v=Ii(p.value);return f.jsx(ze.span,{...m,asChild:v?!1:m.asChild,ref:b,style:{pointerEvents:"none"},children:f.jsx(E.Fragment,{children:v?d:u},v?"placeholder":"value")})},"SelectValue")),e2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,children:c,...l}=r;return f.jsx(ze.span,{"aria-hidden":!0,...l,ref:i,children:c||"▼"})},"SelectIcon")),t2="SelectPortal",[n2,r2]=No(t2,{forceMount:void 0}),o2=Ue(t=>{const{__scopeSelect:r,forceMount:i,...a}=t;return f.jsx(n2,{scope:t.__scopeSelect,forceMount:i,children:f.jsx(Yu,{asChild:!0,...a})})},"SelectPortal"),Mo="SelectContent",a2=E.forwardRef(Ue(function(r,i){const a=r2(Mo,r.__scopeSelect),{forceMount:c=a.forceMount,...l}=r,u=Yr(Mo,r.__scopeSelect),[d,m]=E.useState();return st(()=>{m(new DocumentFragment)},[]),f.jsx($r,{present:c||u.open,children:({present:p})=>p?f.jsx(l2,{...l,ref:i}):f.jsx(i2,{...l,fragment:d})})},"SelectContent")),i2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,children:c,fragment:l}=r;return l?Hr.createPortal(f.jsx(Ty,{scope:a,children:f.jsx(jl.Slot,{scope:a,children:f.jsx("div",{ref:i,children:c})})}),l):null},"SelectContentFragment")),kn=10,[Ty,_o]=No(Mo),s2=or("SelectContent.RemoveScroll"),l2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a}=r,{position:c=wy.ItemAligned,onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:b,collisionBoundary:v,collisionPadding:x,sticky:S,hideWhenDetached:w,avoidCollisions:T,...j}=r,R=Yr(Mo,a),[O,M]=E.useState(null),[D,_]=E.useState(null),I=De(i,M),[z,H]=E.useState(null),[L,$]=E.useState(null),Y=Al(a),[U,q]=E.useState(!1),P=E.useRef(!1),G=E.useRef(!1),B=E.useRef(!1);E.useEffect(()=>{if(O)return Cg(O)},[O]),nl();const Q=E.useCallback(de=>{const[Me,...Be]=Y().map(Ce=>Ce.ref.current),[Ae]=Be.slice(-1),Se=document.activeElement;for(const Ce of de)if(Ce===Se||(Ce?.scrollIntoView({block:"nearest"}),Ce===Me&&D&&(D.scrollTop=0),Ce===Ae&&D&&(D.scrollTop=D.scrollHeight),Ce?.focus(),document.activeElement!==Se))return},[Y,D]),N=E.useCallback(()=>Q([z,O]),[Q,z,O]);E.useEffect(()=>{U&&N()},[U,N]);const{onOpenChange:K,triggerPointerDownPosRef:ne}=R;E.useEffect(()=>{if(O){let de={x:0,y:0};const Me=Ue(Ae=>{de={x:Math.abs(Math.round(Ae.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(Ae.pageY)-(ne.current?.y??0))}},"handlePointerMove"),Be=Ue(Ae=>{de.x<=10&&de.y<=10?Ae.preventDefault():Ae.composedPath().includes(O)||K(!1),document.removeEventListener("pointermove",Me),ne.current=null},"handlePointerUp");return ne.current!==null&&(document.addEventListener("pointermove",Me),document.addEventListener("pointerup",Be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Me),document.removeEventListener("pointerup",Be,{capture:!0})}}},[O,K,ne]),E.useEffect(()=>{const de=Ue(()=>K(!1),"close");return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[K]);const[te,le]=Od(de=>{const Me=Y().filter(Se=>!Se.disabled),Be=Me.find(Se=>Se.ref.current===document.activeElement),Ae=Nd(Me,de,Be);Ae&&setTimeout(()=>Ae.ref.current?.focus())}),oe=E.useCallback((de,Me,Be)=>{const Ae=!G.current;Ae&&(G.current=!0);const Se=!P.current&&!Be;R.value!==void 0&&R.value===Me||Se?(H(de),Se&&(P.current=!0)):Ae&&H(de)},[R.value]),ae=E.useCallback(()=>O?.focus(),[O]),xe=E.useCallback((de,Me,Be)=>{if(!de)return;const Ae=!B.current;Ae&&(B.current=!0);const Se=!P.current&&!Be;(R.value!==void 0&&R.value===Me||Se||Ae)&&$(de)},[R.value]),we=c===wy.Popper?jy:c2,ge=we===jy?{side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:b,collisionBoundary:v,collisionPadding:x,sticky:S,hideWhenDetached:w,avoidCollisions:T}:{};return f.jsx(Ty,{scope:a,content:O,viewport:D,onViewportChange:_,itemRefCallback:oe,selectedItem:z,onItemLeave:ae,itemTextRefCallback:xe,focusSelectedItem:N,selectedItemText:L,position:c,isPositioned:U,searchRef:te,children:f.jsx(Ju,{as:s2,allowPinchZoom:!0,children:f.jsx(Zp,{asChild:!0,trapped:R.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ee(l,de=>{R.trigger?.focus({preventScroll:!0}),de.preventDefault()}),children:f.jsx(Bu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:f.jsx(we,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:de=>de.preventDefault(),...j,...ge,onPlaced:()=>q(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ee(j.onKeyDown,de=>{const Me=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!Me&&de.key.length===1&&le(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let Ae=Y().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(de.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const Se=de.target,Ce=Ae.indexOf(Se);Ae=Ae.slice(Ce+1)}setTimeout(()=>Q(Ae)),de.preventDefault()}})})})})})})},"SelectContentImpl")),c2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,onPlaced:c,...l}=r,u=Yr(Mo,a),d=_o(Mo,a),[m,p]=E.useState(null),[C,g]=E.useState(null),b=De(i,g),v=Al(a),x=E.useRef(!1),S=E.useRef(!0),{viewport:w,selectedItem:T,selectedItemText:j,focusSelectedItem:R}=d,O=E.useCallback(()=>{if(u.trigger&&u.valueNode&&m&&C&&w&&T&&j){const I=u.trigger.getBoundingClientRect(),z=C.getBoundingClientRect(),H=u.valueNode.getBoundingClientRect(),L=j.getBoundingClientRect();if(u.dir!==$j.RTL){const Be=L.left-z.left,Ae=H.left-Be,Se=I.left-Ae,Ce=I.width+Se,Ot=Math.max(Ce,z.width),dt=window.innerWidth-kn,be=va(Ae,[kn,Math.max(kn,dt-Ot)]);m.style.minWidth=Ce+"px",m.style.left=be+"px"}else{const Be=z.right-L.right,Ae=window.innerWidth-H.right-Be,Se=window.innerWidth-I.right-Ae,Ce=I.width+Se,Ot=Math.max(Ce,z.width),dt=window.innerWidth-kn,be=va(Ae,[kn,Math.max(kn,dt-Ot)]);m.style.minWidth=Ce+"px",m.style.right=be+"px"}const $=v(),Y=window.innerHeight-kn*2,U=w.scrollHeight,q=window.getComputedStyle(C),P=parseInt(q.borderTopWidth,10),G=parseInt(q.paddingTop,10),B=parseInt(q.borderBottomWidth,10),Q=parseInt(q.paddingBottom,10),N=P+G+U+Q+B,K=Math.min(T.offsetHeight*5,N),ne=window.getComputedStyle(w),te=parseInt(ne.paddingTop,10),le=parseInt(ne.paddingBottom,10),oe=I.top+I.height/2-kn,ae=Y-oe,xe=T.offsetHeight/2,we=T.offsetTop+xe,ge=P+G+we,de=N-ge;if(ge<=oe){const Be=$.length>0&&T===$[$.length-1].ref.current;m.style.bottom="0px";const Ae=C.clientHeight-w.offsetTop-w.offsetHeight,Se=Math.max(ae,xe+(Be?le:0)+Ae+B),Ce=ge+Se;m.style.height=Ce+"px"}else{const Be=$.length>0&&T===$[0].ref.current;m.style.top="0px";const Se=Math.max(oe,P+w.offsetTop+(Be?te:0)+xe)+de;m.style.height=Se+"px",w.scrollTop=ge-oe+w.offsetTop}m.style.margin=`${kn}px 0`,m.style.minHeight=K+"px",m.style.maxHeight=Y+"px",c?.(),requestAnimationFrame(()=>x.current=!0)}},[v,u.trigger,u.valueNode,m,C,w,T,j,u.dir,c]);st(()=>O(),[O]);const[M,D]=E.useState();st(()=>{C&&D(window.getComputedStyle(C).zIndex)},[C]);const _=E.useCallback(I=>{I&&S.current===!0&&(O(),R?.(),S.current=!1)},[O,R]);return f.jsx(u2,{scope:a,contentWrapper:m,shouldExpandOnScrollRef:x,onScrollButtonChange:_,children:f.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx(ze.div,{...l,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),jy=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,align:c="start",collisionPadding:l=kn,...u}=r,d=jd(a);return f.jsx(ay,{...d,...u,ref:i,align:c,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[u2,Ad]=No(Mo,{}),Ay="SelectViewport",d2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,nonce:c,...l}=r,u=_o(Ay,a),d=Ad(Ay,a),m=De(i,u.onViewportChange),p=E.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),f.jsx(jl.Slot,{scope:a,children:f.jsx(ze.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ee(l.onScroll,C=>{const g=C.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:v}=d;if(v?.current&&b){const x=Math.abs(p.current-g.scrollTop);if(x>0){const S=window.innerHeight-kn*2,w=parseFloat(b.style.minHeight),T=parseFloat(b.style.height),j=Math.max(w,T);if(j<S){const R=j+x,O=Math.min(S,R),M=R-O;b.style.height=O+"px",b.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,b.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),f2="SelectGroup",[h2,m2]=No(f2),p2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,...c}=r,l=sr();return f.jsx(h2,{scope:a,id:l,children:f.jsx(ze.div,{role:"group","aria-labelledby":l,...c,ref:i})})},"SelectGroup")),g2="SelectLabel",y2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,...c}=r,l=m2(g2,a);return f.jsx(ze.div,{id:l.id,...c,ref:i})},"SelectLabel")),Rd="SelectItem",[b2,Ry]=No(Rd),x2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,value:c,disabled:l=!1,textValue:u,...d}=r,m=Yr(Rd,a),p=_o(Rd,a),C=m.value===c,[g,b]=E.useState(u??""),[v,x]=E.useState(!1),S=In(O=>p.itemRefCallback?.(O,c,l)),w=De(i,S),T=sr(),j=E.useRef("touch");function R(O){m.hasConsumerStoppedPropagationRef.current=O.isPropagationStopped(),m.onUserSelect(c),m.onOpenChange(!1)}return Ue(R,"handleSelect"),f.jsx(b2,{scope:a,value:c,disabled:l,textId:T,isSelected:C,onItemTextChange:E.useCallback(O=>{b(M=>M||(O?.textContent??"").trim())},[]),children:f.jsx(jl.ItemSlot,{scope:a,value:c,disabled:l,textValue:g,children:f.jsx(ze.div,{role:"option","aria-labelledby":T,"data-highlighted":v?"":void 0,"aria-selected":C&&v,"data-state":C?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:w,onFocus:Ee(d.onFocus,()=>x(!0)),onBlur:Ee(d.onBlur,()=>x(!1)),onClick:Ee(d.onClick,O=>{l||j.current!=="mouse"&&R(O)}),onPointerUp:Ee(d.onPointerUp,O=>{l||j.current==="mouse"&&R(O)}),onPointerDown:Ee(d.onPointerDown,O=>{j.current=O.pointerType}),onPointerMove:Ee(d.onPointerMove,O=>{j.current=O.pointerType,l?p.onItemLeave?.():j.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(d.onPointerLeave,O=>{O.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:Ee(d.onKeyDown,O=>{l||O.target!==O.currentTarget||p.searchRef?.current!==""&&O.key===" "||(Vj.includes(O.key)&&R(O),O.key===" "&&O.preventDefault())})})})})},"SelectItem")),Rl="SelectItemText",v2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,className:c,style:l,...u}=r,d=Yr(Rl,a),m=_o(Rl,a),p=Ry(Rl,a),C=Kj(Rl,a),[g,b]=E.useState(null),v=In(R=>m.itemTextRefCallback?.(R,p.value,p.disabled)),x=De(i,b,p.onItemTextChange,v),S=g?.textContent,w=E.useMemo(()=>f.jsx("option",{value:p.value,disabled:p.disabled,children:S},p.value),[p.disabled,p.value,S]),{onNativeOptionAdd:T,onNativeOptionRemove:j}=C;return st(()=>(T(w),()=>j(w)),[T,j,w]),f.jsxs(f.Fragment,{children:[f.jsx(ze.span,{id:p.textId,...u,ref:x}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren&&!Ii(d.value)?Hr.createPortal(u.children,d.valueNode):null]})},"SelectItemText")),S2="SelectItemIndicator",C2=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,...c}=r;return Ry(S2,a).isSelected?f.jsx(ze.span,{"aria-hidden":!0,...c,ref:i}):null},"SelectItemIndicator")),Oy="SelectScrollUpButton",w2=E.forwardRef(Ue(function(r,i){const a=_o(Oy,r.__scopeSelect),c=Ad(Oy,r.__scopeSelect),[l,u]=E.useState(!1),d=De(i,c.onScrollButtonChange);return st(()=>{if(a.viewport&&a.isPositioned){let m=function(){const C=p.scrollTop>0;u(C)};Ue(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(My,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),Ny="SelectScrollDownButton",E2=E.forwardRef(Ue(function(r,i){const a=_o(Ny,r.__scopeSelect),c=Ad(Ny,r.__scopeSelect),[l,u]=E.useState(!1),d=De(i,c.onScrollButtonChange);return st(()=>{if(a.viewport&&a.isPositioned){let m=function(){const C=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)<C;u(g)};Ue(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(My,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),My=E.forwardRef(Ue(function(r,i){const{__scopeSelect:a,onAutoScroll:c,...l}=r,u=_o("SelectScrollButton",a),d=E.useRef(null),m=Al(a),p=E.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return E.useEffect(()=>()=>p(),[p]),st(()=>{m().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[m]),f.jsx(ze.div,{"aria-hidden":!0,...l,ref:i,style:{flexShrink:0,...l.style},onPointerDown:Ee(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(c,50))}),onPointerMove:Ee(l.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(c,50))}),onPointerLeave:Ee(l.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),T2="SelectBubbleInput",j2=E.forwardRef(Ue(function({__scopeSelect:r,...i},a){const c=Yr(T2,r),{value:l,onValueChange:u,required:d,disabled:m,name:p,autoComplete:C,form:g,userSelection:b}=c,{nativeOptions:v,nativeSelectKey:x}=c,S=E.useRef(null),w=De(a,S),T=l??"",j=E.useRef(T),R=E.useRef(b),O=E.useRef(!1),M=Array.from(v).some(D=>(D.props.value??"")==="");return E.useEffect(()=>{const D=S.current;if(!D)return;const _=window.HTMLSelectElement.prototype,z=Object.getOwnPropertyDescriptor(_,"value").set,H=b!==null&&b!==R.current;R.current=b;const L=j.current!==T;j.current=T;const $=H&&L;if(H&&!L&&b.value!==T&&!b.hasConsumerStoppedPropagation&&z){O.current=!0;try{z.call(D,b.value),D.dispatchEvent(new Event("change",{bubbles:!0}))}finally{O.current=!1,z.call(D,T)}return}const Y=$&&!b.hasConsumerStoppedPropagation;if(L&&z){const U=new Event("change",{bubbles:Y});z.call(D,T),D.dispatchEvent(U)}},[T,b]),f.jsxs(ze.select,{"aria-hidden":!0,required:d,tabIndex:-1,name:p,autoComplete:C,disabled:m,form:g,onChange:D=>{O.current||u(D.target.value)},...i,style:{...wp,...i.style},ref:w,defaultValue:T,children:[Ii(l)&&!M?f.jsx("option",{value:""}):null,Array.from(v)]},x)},"SelectBubbleInput"));function _y(t){return typeof t=="function"}Ue(_y,"isFunction");function Ii(t){return t===""||t===void 0}Ue(Ii,"shouldShowPlaceholder");function Od(t){const r=In(t),i=E.useRef(""),a=E.useRef(0),c=E.useCallback(u=>{const d=i.current+u;r(d);function m(p){i.current=p,window.clearTimeout(a.current),p!==""&&(a.current=window.setTimeout(()=>m(""),1e3))}Ue(m,"updateSearch"),m(d)},[r]),l=E.useCallback(()=>{i.current="",window.clearTimeout(a.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(a.current),[]),[i,c,l]}Ue(Od,"useTypeaheadSearch");function Nd(t,r,i){const c=r.length>1&&Array.from(r).every(p=>p===r[0])?r[0]:r,l=i?t.indexOf(i):-1;let u=Dy(t,Math.max(l,0));c.length===1&&(u=u.filter(p=>p!==i));const m=u.find(p=>p.textValue.toLowerCase().startsWith(c.toLowerCase()));return m!==i?m:void 0}Ue(Nd,"findNextItem");function Dy(t,r){return t.map((i,a)=>t[(r+a)%t.length])}Ue(Dy,"wrapArray");var A2=Object.defineProperty,qe=(t,r)=>A2(t,"name",{value:r,configurable:!0}),Iy={Horizontal:"horizontal"},R2={LTR:"ltr"},ky=["PageUp","PageDown"],Ly=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],zy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ki="Slider",[Md,O2,N2]=Zs(ki),[_d,IM]=Cn(ki,[N2]),[M2,Ca]=_d(ki),_2=E.forwardRef(qe(function(r,i){const{name:a,min:c=0,max:l=100,step:u=1,orientation:d=Iy.Horizontal,disabled:m=!1,minStepsBetweenThumbs:p=0,preserveThumbOrder:C=!1,defaultValue:g=[c],value:b,onValueChange:v=qe(()=>{},"onValueChange"),onValueCommit:x=qe(()=>{},"onValueCommit"),inverted:S=!1,form:w,...T}=r,j=E.useRef(new Set),R=E.useRef(0),O=E.useRef(!1),[M,D]=E.useState(null),I=d===Iy.Horizontal?D2:I2,[z,H]=E.useState(null),L=De(i,H),[$=[],Y]=ar({prop:b,defaultProp:g,onChange:qe(N=>{[...j.current][R.current]?.focus({preventScroll:!0,focusVisible:O.current}),O.current=!1,v(N)},"onChange")}),U=E.useRef($),q=E.useRef($);E.useEffect(()=>{const N=w?z?.ownerDocument.getElementById(w):z?.closest("form");if(N instanceof HTMLFormElement){const K=qe(()=>Y(q.current),"reset");return N.addEventListener("reset",K),()=>N.removeEventListener("reset",K)}},[z,w,Y]);function P(N){const K=Xy($,N);Q(N,K)}qe(P,"handleSlideStart");function G(N){Q(N,R.current)}qe(G,"handleSlideMove");function B(){String($)!==String(U.current)&&x($)}qe(B,"handleSlideEnd");function Q(N,K,{commit:ne}={commit:!1}){const te=kd(u),le=Li(Math.round((N-c)/u)*u+c,te),oe=va(le,[c,l]),ae=p*u;function xe(ge){const de=C?va(oe,[ge[K-1]===void 0?c:ge[K-1]+ae,ge[K+1]===void 0?l:ge[K+1]-ae]):oe,Me=qy(ge,de,K);return Fy(Me,ae)?{nextValues:Me,changedIndex:C?K:Me.indexOf(de),hasChanged:String(Me)!==String(ge)}:null}qe(xe,"getNextValues");const we=xe($);we?.hasChanged&&D(we.nextValues),Y((ge=[])=>{const de=xe(ge);return de?(R.current=de.changedIndex,de.hasChanged&&ne&&x(de.nextValues),de.hasChanged?de.nextValues:ge):ge})}return qe(Q,"updateValues"),f.jsx(M2,{scope:r.__scopeSlider,name:a,disabled:m,min:c,max:l,valueIndexToChangeRef:R,thumbs:j.current,values:$,orientation:d,form:w,userRequestedValues:M,children:f.jsx(Md.Provider,{scope:r.__scopeSlider,children:f.jsx(Md.Slot,{scope:r.__scopeSlider,children:f.jsx(I,{"aria-disabled":m,"data-disabled":m?"":void 0,...T,ref:L,onPointerDown:Ee(T.onPointerDown,()=>{m||(U.current=$,O.current=!1)}),min:c,max:l,inverted:S,onSlideStart:m?void 0:P,onSlideMove:m?void 0:G,onSlideEnd:m?void 0:B,onHomeKeyDown:()=>{m||(O.current=!0,Q(c,0,{commit:!0}))},onEndKeyDown:()=>{m||(O.current=!0,Q(l,$.length-1,{commit:!0}))},onStepKeyDown:({event:N,direction:K})=>{if(!m){O.current=!0;const le=ky.includes(N.key)||N.shiftKey&&Ly.includes(N.key)?10:1,oe=R.current,ae=$[oe],xe=Zy(ae,{min:c,step:u,direction:K,multiplier:le});Q(xe,oe,{commit:!0})}}})})})})},"Slider")),[By,Hy]=_d(ki,{startEdge:"left",endEdge:"right",size:"width",direction:1}),D2=E.forwardRef(qe(function(r,i){const{min:a,max:c,dir:l,inverted:u,onSlideStart:d,onSlideMove:m,onSlideEnd:p,onStepKeyDown:C,...g}=r,[b,v]=E.useState(null),x=De(i,v),S=E.useRef(void 0),w=Oi(l),T=w===R2.LTR,j=T&&!u||!T&&u;function R(O){const M=S.current||b.getBoundingClientRect(),D=[0,M.width],I=Ol(D,j?[a,c]:[c,a]);return S.current=M,I(O-M.left)}return qe(R,"getValueFromPointer"),f.jsx(By,{scope:r.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:f.jsx(Py,{dir:w,"data-orientation":"horizontal",...g,ref:x,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:O=>{const M=R(O.clientX);d?.(M)},onSlideMove:O=>{const M=R(O.clientX);m?.(M)},onSlideEnd:()=>{S.current=void 0,p?.()},onStepKeyDown:O=>{const D=zy[j?"from-left":"from-right"].includes(O.key);C?.({event:O,direction:D?-1:1})}})})},"SliderHorizontal")),I2=E.forwardRef(qe(function(r,i){const{min:a,max:c,inverted:l,onSlideStart:u,onSlideMove:d,onSlideEnd:m,onStepKeyDown:p,...C}=r,g=E.useRef(null),b=De(i,g),v=E.useRef(void 0),x=!l;function S(w){const T=v.current||g.current.getBoundingClientRect(),j=[0,T.height],O=Ol(j,x?[c,a]:[a,c]);return v.current=T,O(w-T.top)}return qe(S,"getValueFromPointer"),f.jsx(By,{scope:r.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:f.jsx(Py,{"data-orientation":"vertical",...C,ref:b,style:{...C.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const T=S(w.clientY);u?.(T)},onSlideMove:w=>{const T=S(w.clientY);d?.(T)},onSlideEnd:()=>{v.current=void 0,m?.()},onStepKeyDown:w=>{const j=zy[x?"from-bottom":"from-top"].includes(w.key);p?.({event:w,direction:j?-1:1})}})})},"SliderVertical")),Py=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onHomeKeyDown:d,onEndKeyDown:m,onStepKeyDown:p,...C}=r,g=Ca(ki,a);return f.jsx(ze.span,{...C,ref:i,onKeyDown:Ee(r.onKeyDown,b=>{b.key==="Home"?(d(b),b.preventDefault()):b.key==="End"?(m(b),b.preventDefault()):ky.concat(Ly).includes(b.key)&&(p(b),b.preventDefault())}),onPointerDown:Ee(r.onPointerDown,b=>{const v=b.target;v.setPointerCapture(b.pointerId),b.preventDefault(),g.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):c(b)}),onPointerMove:Ee(r.onPointerMove,b=>{b.target.hasPointerCapture(b.pointerId)&&l(b)}),onPointerUp:Ee(r.onPointerUp,b=>{const v=b.target;v.hasPointerCapture(b.pointerId)&&(v.releasePointerCapture(b.pointerId),u(b))})})},"SliderImpl")),k2="SliderTrack",L2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ca(k2,a);return f.jsx(ze.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...c,ref:i})},"SliderTrack")),Uy="SliderRange",z2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ca(Uy,a),u=Hy(Uy,a),d=E.useRef(null),m=De(i,d),p=l.values.length,C=l.values.map(v=>Id(v,l.min,l.max)),g=p>1?Math.min(...C):0,b=100-Math.max(...C);return f.jsx(ze.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...c,ref:m,style:{...r.style,[u.startEdge]:g+"%",[u.endEdge]:b+"%"}})},"SliderRange")),B2="SliderThumb",[H2,$y]=_d(B2),P2="SliderThumbProvider";function Gy(t){const{__scopeSlider:r,name:i,children:a,internal_do_not_use_render:c}=t,l=Ca(P2,r),u=O2(r),[d,m]=E.useState(null),p=E.useMemo(()=>d?u().findIndex(w=>w.ref.current===d):-1,[u,d]),C=Mi(d),g=d?!!l.form||!!d.closest("form"):!0,b=l.values[p],v=i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),x=b===void 0?0:Id(b,l.min,l.max);E.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]);const S={value:b,name:v,form:l.form,isFormControl:g,index:p,thumb:d,onThumbChange:m,percent:x,size:C};return f.jsx(H2,{scope:r,...S,children:Wy(c)?c(S):a})}qe(Gy,"SliderThumbProvider");var Dd="SliderThumbTrigger",U2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ca(Dd,a),u=Hy(Dd,a),{index:d,value:m,percent:p,size:C,onThumbChange:g}=$y(Dd,a),b=De(i,g),v=Yy(d,l.values.length),x=C?.[u.size],S=x?Ky(x,p,u.direction):0;return f.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${p}% + ${S}px)`},children:f.jsx(Md.ItemSlot,{scope:a,children:f.jsx(ze.span,{role:"slider","aria-label":r["aria-label"]||v,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...c,ref:b,style:m===void 0?{display:"none"}:r.style,onFocus:Ee(r.onFocus,()=>{l.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),$2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,name:c,...l}=r;return f.jsx(Gy,{__scopeSlider:a,name:c,internal_do_not_use_render:({index:u,isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx(U2,{...l,ref:i,__scopeSlider:a}),d?f.jsx(G2,{__scopeSlider:a},u):null]})})},"SliderThumb")),Vy="SliderBubbleInput",G2=E.forwardRef(qe(function({__scopeSlider:r,onInput:i,...a},c){const{index:l,value:u,name:d,form:m}=$y(Vy,r),{userRequestedValues:p}=Ca(Vy,r),C=E.useRef(null),g=De(C,c),b=E.useRef(!1),v=E.useRef(u),x=E.useRef(p),S=E.useRef(p);return E.useEffect(()=>{const w=C.current;if(!w)return;const T=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(T,"value").set,O=v.current,M=O!==u;v.current=u;const D=p!==S.current;if(S.current=p,M&&R){const _=p!==x.current;x.current=p;const I=p?.[l],z=_&&(D&&I!==O||I===u);b.current=!z;const H=new Event("input",{bubbles:!0});R.call(w,u),w.dispatchEvent(H),b.current=!1}},[l,u,p]),f.jsx(ze.input,{style:{display:"none"},name:d,form:m,...a,ref:g,defaultValue:u,onInput:Ee(i,w=>{b.current&&w.stopPropagation()})})},"SliderBubbleInput"));function qy(t=[],r,i){const a=[...t];return a[i]=r,a.sort((c,l)=>c-l)}qe(qy,"getNextSortedValues");function Id(t,r,i){const l=100/(i-r)*(t-r);return va(l,[0,100])}qe(Id,"convertValueToPercentage");function Yy(t,r){return r>2?`Value ${t+1} of ${r}`:r===2?["Minimum","Maximum"][t]:void 0}qe(Yy,"getLabel");function Xy(t,r){if(t.length===1)return 0;const i=t.map(c=>Math.abs(c-r)),a=Math.min(...i);return i.indexOf(a)}qe(Xy,"getClosestValueIndex");function Ky(t,r,i){const a=t/2,l=Ol([0,50],[0,a]);return(a-l(r)*i)*i}qe(Ky,"getThumbInBoundsOffset");function Qy(t){return t.slice(0,-1).map((r,i)=>t[i+1]-r)}qe(Qy,"getStepsBetweenValues");function Fy(t,r){if(r>0){const i=Qy(t);return Math.min(...i)>=r}return!0}qe(Fy,"hasMinStepsBetweenValues");function Ol(t,r){return i=>{if(t[0]===t[1]||r[0]===r[1])return r[0];const a=(r[1]-r[0])/(t[1]-t[0]);return r[0]+a*(i-t[0])}}qe(Ol,"linearScale");function kd(t){if(!Number.isFinite(t))return 0;const r=t.toString();if(r.includes("e")){const[a,c]=r.split("e"),l=a.split(".")[1]||"",u=Number(c);return Math.max(0,l.length-u)}const i=r.split(".")[1];return i?i.length:0}qe(kd,"getDecimalCount");function Li(t,r){const i=Math.pow(10,r);return Math.round(t*i)/i}qe(Li,"roundValue");function Zy(t,{min:r,step:i,direction:a,multiplier:c}){const l=kd(i),u=(t-r)/i,d=Math.round(u),m=Li(d*i+r,l)===Li(t,l);let p;return m?p=d+c*a:a>0?p=Math.ceil(u):p=Math.floor(u),Li(p*i+r,l)}qe(Zy,"getNextStepValue");function Wy(t){return typeof t=="function"}qe(Wy,"isFunction");var V2=Object.defineProperty,vt=(t,r)=>V2(t,"name",{value:r,configurable:!0}),[Ld,kM]=Cn("Tooltip",[Sl]),Nl=Sl(),q2="TooltipProvider",Y2=700,zd="tooltip.open",[X2,Bd]=Ld(q2),K2=vt(t=>{const{__scopeTooltip:r,delayDuration:i=Y2,skipDelayDuration:a=300,disableHoverableContent:c=!1,children:l}=t,u=E.useRef(!0),d=E.useRef(!1),m=E.useRef(0);return E.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),f.jsx(X2,{scope:r,isOpenDelayedRef:u,delayDuration:i,onOpen:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),u.current=!1)},[a]),onClose:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,a))},[a]),isPointerInTransitRef:d,onPointerInTransitChange:E.useCallback(p=>{d.current=p},[]),disableHoverableContent:c,children:l})},"TooltipProvider"),Hd="Tooltip",[Q2,zi]=Ld(Hd),F2=vt(t=>{const{__scopeTooltip:r,children:i,open:a,defaultOpen:c,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=t,m=Bd(Hd,t.__scopeTooltip),p=Nl(r),[C,g]=E.useState(null),[b,v]=E.useState(void 0),x=sr(),S=E.useRef(0),w=u??m.disableHoverableContent,T=d??m.delayDuration,j=E.useRef(!1),[R,O]=ar({prop:a,defaultProp:c??!1,onChange:vt(H=>{H?(m.onOpen(),document.dispatchEvent(new CustomEvent(zd))):m.onClose(),l?.(H)},"onChange"),caller:Hd}),M=E.useMemo(()=>R?j.current?"delayed-open":"instant-open":"closed",[R]),D=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,j.current=!1,O(!0)},[O]),_=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,O(!1)},[O]),I=E.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{j.current=!0,O(!0),S.current=0},T)},[T,O]);E.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const z=b??x;return f.jsx(ny,{...p,children:f.jsx(Q2,{scope:r,contentId:z,setContentId:v,open:R,stateAttribute:M,trigger:C,onTriggerChange:g,onTriggerEnter:E.useCallback(()=>{m.isOpenDelayedRef.current?I():D()},[m.isOpenDelayedRef,I,D]),onTriggerLeave:E.useCallback(()=>{w?_():(window.clearTimeout(S.current),S.current=0)},[_,w]),onOpen:D,onClose:_,disableHoverableContent:w,children:i})})},"Tooltip"),Jy="TooltipTrigger",Z2=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,"aria-describedby":c,...l}=r,u=zi(Jy,a),d=Bd(Jy,a),m=Nl(a),p=E.useRef(null),C=De(i,p,u.onTriggerChange),g=E.useRef(!1),b=E.useRef(!1),v=E.useCallback(()=>g.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),f.jsx(ry,{asChild:!0,...m,children:f.jsx(ze.button,{"aria-describedby":u.open?l0(c,u.contentId):c,"data-state":u.stateAttribute,...l,ref:C,onPointerMove:Ee(r.onPointerMove,x=>{x.pointerType!=="touch"&&!b.current&&!d.isPointerInTransitRef.current&&(u.onTriggerEnter(),b.current=!0)}),onPointerLeave:Ee(r.onPointerLeave,()=>{u.onTriggerLeave(),b.current=!1}),onPointerDown:Ee(r.onPointerDown,()=>{u.open&&u.onClose(),g.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Ee(r.onFocus,()=>{g.current||u.onOpen()}),onBlur:Ee(r.onBlur,u.onClose),onClick:Ee(r.onClick,u.onClose)})})},"TooltipTrigger")),e0="TooltipPortal",[W2,J2]=Ld(e0,{forceMount:void 0}),eA=vt(t=>{const{__scopeTooltip:r,forceMount:i,children:a,container:c}=t,l=zi(e0,r);return f.jsx(W2,{scope:r,forceMount:i,children:f.jsx($r,{present:i||l.open,children:f.jsx(Yu,{asChild:!0,container:c,children:a})})})},"TooltipPortal"),Bi="TooltipContent",tA=E.forwardRef(vt(function(r,i){const a=J2(Bi,r.__scopeTooltip),{forceMount:c=a.forceMount,side:l="top",...u}=r,d=zi(Bi,r.__scopeTooltip);return f.jsx($r,{present:c||d.open,children:d.disableHoverableContent?f.jsx(t0,{side:l,...u,ref:i}):f.jsx(nA,{side:l,...u,ref:i})})},"TooltipContent")),nA=E.forwardRef(vt(function(r,i){const a=zi(Bi,r.__scopeTooltip),c=Bd(Bi,r.__scopeTooltip),l=E.useRef(null),u=De(i,l),[d,m]=E.useState(null),{trigger:p,onClose:C}=a,g=l.current,{onPointerInTransitChange:b}=c,v=E.useCallback(()=>{m(null),b(!1)},[b]),x=E.useCallback((S,w)=>{const T=S.currentTarget,j={x:S.clientX,y:S.clientY},R=n0(j,T.getBoundingClientRect()),O=r0(j,R),M=o0(w.getBoundingClientRect()),D=i0([...O,...M]);m(D),b(!0)},[b]);return E.useEffect(()=>()=>v(),[v]),E.useEffect(()=>{if(p&&g){const S=vt(T=>x(T,g),"handleTriggerLeave"),w=vt(T=>x(T,p),"handleContentLeave");return p.addEventListener("pointerleave",S),g.addEventListener("pointerleave",w),()=>{p.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",w)}}},[p,g,x,v]),E.useEffect(()=>{if(d){const S=vt(w=>{const T=w.target,j={x:w.clientX,y:w.clientY},R=p?.contains(T)||g?.contains(T),O=!a0(j,d);R?v():O&&(v(),C())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[p,g,d,C,v]),f.jsx(t0,{...r,ref:u})},"TooltipContentHoverable")),rA=pp("TooltipContent"),t0=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,children:c,"aria-label":l,id:u,onEscapeKeyDown:d,onPointerDownOutside:m,...p}=r,C=zi(Bi,a),g=Nl(a),{onClose:b}=C,[v,x]=E.useState(null),S=De(i,x);tg(v),E.useEffect(()=>(document.addEventListener(zd,b),()=>document.removeEventListener(zd,b)),[b]),E.useEffect(()=>{if(C.trigger){const T=vt(j=>{j.target instanceof Node&&j.target.contains(C.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",T,{capture:!0}),()=>window.removeEventListener("scroll",T,{capture:!0})}},[C.trigger,b]);const{setContentId:w}=C;return st(()=>(w(u),()=>{w(void 0)}),[u,w]),f.jsx(Bu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:T=>T.preventDefault(),onDismiss:b,children:f.jsxs(ay,{"data-state":C.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:C.contentId,...g,...p,ref:S,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(rA,{children:c}),l?f.jsx(ew,{id:C.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl")),oA=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,...c}=r,l=Nl(a);return f.jsx(rj,{...l,...c,ref:i})},"TooltipArrow"));function n0(t,r){const i=Math.abs(r.top-t.y),a=Math.abs(r.bottom-t.y),c=Math.abs(r.right-t.x),l=Math.abs(r.left-t.x);switch(Math.min(i,a,c,l)){case l:return"left";case c:return"right";case i:return"top";case a:return"bottom";default:throw new Error("unreachable")}}vt(n0,"getExitSideFromRect");function r0(t,r,i=5){const a=[];switch(r){case"top":a.push({x:t.x-i,y:t.y+i},{x:t.x+i,y:t.y+i});break;case"bottom":a.push({x:t.x-i,y:t.y-i},{x:t.x+i,y:t.y-i});break;case"left":a.push({x:t.x+i,y:t.y-i},{x:t.x+i,y:t.y+i});break;case"right":a.push({x:t.x-i,y:t.y-i},{x:t.x-i,y:t.y+i});break}return a}vt(r0,"getPaddedExitPoints");function o0(t){const{top:r,right:i,bottom:a,left:c}=t;return[{x:c,y:r},{x:i,y:r},{x:i,y:a},{x:c,y:a}]}vt(o0,"getPointsFromRect");function a0(t,r){const{x:i,y:a}=t;let c=!1;for(let l=0,u=r.length-1;l<r.length;u=l++){const d=r[l],m=r[u],p=d.x,C=d.y,g=m.x,b=m.y;C>a!=b>a&&i<(g-p)*(a-C)/(b-C)+p&&(c=!c)}return c}vt(a0,"isPointInPolygon");function i0(t){const r=t.slice();return r.sort((i,a)=>i.x<a.x?-1:i.x>a.x?1:i.y<a.y?-1:i.y>a.y?1:0),s0(r)}vt(i0,"getHull");function s0(t){if(t.length<=1)return t.slice();const r=[];for(let a=0;a<t.length;a++){const c=t[a];for(;r.length>=2;){const l=r[r.length-1],u=r[r.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))r.pop();else break}r.push(c)}r.pop();const i=[];for(let a=t.length-1;a>=0;a--){const c=t[a];for(;i.length>=2;){const l=i[i.length-1],u=i[i.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))i.pop();else break}i.push(c)}return i.pop(),r.length===1&&i.length===1&&r[0].x===i[0].x&&r[0].y===i[0].y?r:r.concat(i)}vt(s0,"getHullPresorted");function l0(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}vt(l0,"concatAriaDescribedby");function aA({delayDuration:t=0,...r}){return f.jsx(K2,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function iA({...t}){return f.jsx(F2,{"data-slot":"tooltip",...t})}function sA({...t}){return f.jsx(Z2,{"data-slot":"tooltip-trigger",...t})}function lA({container:t,className:r,sideOffset:i=0,children:a,...c}){return f.jsx(eA,{container:t,children:f.jsxs(tA,{"data-slot":"tooltip-content",sideOffset:i,className:Ve("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",r),...c,children:[a,f.jsx(oA,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function c0(t){return t?.closest(".rt-menu-root, .rt-main-menu-root, .ui-dialog")||document.fullscreenElement||document.getElementById("uni-answer-sheet")||document.body}function cA({children:t}){return f.jsx(aA,{delayDuration:400,children:t})}const uA={"portal-wrapper":"_portal-wrapper_1eief_1"},dA={footer:"_footer_yp9z4_1"};/**
91
+ `)},pE=0,Sa=[];function gE(t){var r=E.useRef([]),i=E.useRef([0,0]),a=E.useRef(),c=E.useState(pE++)[0],l=E.useState(vg)[0],u=E.useRef(t);E.useEffect(function(){u.current=t},[t]),E.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(c));var S=zw([t.lockRef.current],(t.shards||[]).map(Ag),!0).filter(Boolean);return S.forEach(function(w){return w.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(c))})}}},[t.inert,t.lockRef.current,t.shards]);var d=E.useCallback(function(S,w){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var T=gl(S),j=i.current,R="deltaX"in S?S.deltaX:j[0]-T[0],O="deltaY"in S?S.deltaY:j[1]-T[1],M,D=S.target,_=Math.abs(R)>Math.abs(O)?"h":"v";if("touches"in S&&_==="h"&&D.type==="range")return!1;var I=window.getSelection(),B=I&&I.anchorNode,H=B?B===D||B.contains(D):!1;if(H)return!1;var z=wg(_,D);if(!z)return!0;if(z?M=_:(M=_==="v"?"h":"v",z=wg(_,D)),!z)return!1;if(!a.current&&"changedTouches"in S&&(R||O)&&(a.current=M),!M)return!0;var $=a.current||M;return fE($,w,S,$==="h"?R:O)},[]),m=E.useCallback(function(S){var w=S;if(!(!Sa.length||Sa[Sa.length-1]!==l)){var T="deltaY"in w?jg(w):gl(w),j=r.current.filter(function(M){return M.name===w.type&&(M.target===w.target||w.target===M.shadowParent)&&hE(M.delta,T)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var R=(u.current.shards||[]).map(Ag).filter(Boolean).filter(function(M){return M.contains(w.target)}),O=R.length>0?d(w,R[0]):!u.current.noIsolation;O&&w.cancelable&&w.preventDefault()}}},[]),p=E.useCallback(function(S,w,T,j){var R={name:S,delta:w,target:T,should:j,shadowParent:yE(T)};r.current.push(R),setTimeout(function(){r.current=r.current.filter(function(O){return O!==R})},1)},[]),C=E.useCallback(function(S){i.current=gl(S),a.current=void 0},[]),g=E.useCallback(function(S){p(S.type,jg(S),S.target,d(S,t.lockRef.current))},[]),b=E.useCallback(function(S){p(S.type,gl(S),S.target,d(S,t.lockRef.current))},[]);E.useEffect(function(){return Sa.push(l),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,va),document.addEventListener("touchmove",m,va),document.addEventListener("touchstart",C,va),function(){Sa=Sa.filter(function(S){return S!==l}),document.removeEventListener("wheel",m,va),document.removeEventListener("touchmove",m,va),document.removeEventListener("touchstart",C,va)}},[]);var x=t.removeScrollBar,v=t.inert;return E.createElement(E.Fragment,null,v?E.createElement(l,{styles:mE(c)}):null,x?E.createElement(aE,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function yE(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const bE=Yw(xg,gE);var sd=E.forwardRef(function(t,r){return E.createElement(ml,Wn({},t,{ref:r,sideCar:bE}))});sd.classNames=ml.classNames;var xE=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},Ca=new WeakMap,yl=new WeakMap,bl={},ld=0,Rg=function(t){return t&&(t.host||Rg(t.parentNode))},vE=function(t,r){return r.map(function(i){if(t.contains(i))return i;var a=Rg(i);return a&&t.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},SE=function(t,r,i,a){var c=vE(r,Array.isArray(t)?t:[t]);bl[i]||(bl[i]=new WeakMap);var l=bl[i],u=[],d=new Set,m=new Set(c),p=function(g){!g||d.has(g)||(d.add(g),p(g.parentNode))};c.forEach(p);var C=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(d.has(b))C(b);else try{var x=b.getAttribute(a),v=x!==null&&x!=="false",S=(Ca.get(b)||0)+1,w=(l.get(b)||0)+1;Ca.set(b,S),l.set(b,w),u.push(b),S===1&&v&&yl.set(b,!0),w===1&&b.setAttribute(i,"true"),v||b.setAttribute(a,"true")}catch(T){console.error("aria-hidden: cannot operate on ",b,T)}})};return C(r),d.clear(),ld++,function(){u.forEach(function(g){var b=Ca.get(g)-1,x=l.get(g)-1;Ca.set(g,b),l.set(g,x),b||(yl.has(g)||g.removeAttribute(a),yl.delete(g)),x||g.removeAttribute(i)}),ld--,ld||(Ca=new WeakMap,Ca=new WeakMap,yl=new WeakMap,bl={})}},Og=function(t,r,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),c=xE(t);return c?(a.push.apply(a,Array.from(c.querySelectorAll("[aria-live], script"))),SE(a,c,i,"aria-hidden")):function(){return null}},CE=Object.defineProperty,jn=(t,r)=>CE(t,"name",{value:r,configurable:!0}),cd="Dialog",[Ng,IM]=Tn(cd),[wE,gr]=Ng(cd),EE=jn(t=>{const{__scopeDialog:r,children:i,open:a,defaultOpen:c,onOpenChange:l,modal:u=!0}=t,d=E.useRef(null),m=E.useRef(null),{nodes:p,registry:C}=sg(),[g,b]=fr({prop:a,defaultProp:c??!1,onChange:l,caller:cd}),[x,v]=E.useState(0),[S,w]=E.useState(0);return f.jsx(wE,{scope:r,triggerRef:d,contentRef:m,contentId:mr(),titleId:mr(),descriptionId:mr(),titlePresent:x>0,descriptionPresent:S>0,setTitleCount:v,setDescriptionCount:w,open:g,onOpenChange:b,onOpenToggle:E.useCallback(()=>b(T=>!T),[b]),modal:u,branchNodes:p,branchRegistry:C,children:i})},"Dialog"),Mg="DialogPortal",[TE,_g]=Ng(Mg,{forceMount:void 0}),jE=jn(t=>{const{__scopeDialog:r,forceMount:i,children:a,container:c}=t,l=gr(Mg,r);return f.jsx(TE,{scope:r,forceMount:i,children:E.Children.map(a,u=>f.jsx(Fr,{present:i||l.open,children:f.jsx(ed,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),ud="DialogOverlay",AE=E.forwardRef(jn(function(r,i){const a=_g(ud,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=gr(ud,r.__scopeDialog);return u.modal?f.jsx(Fr,{present:c||u.open,children:f.jsx(OE,{...l,ref:i})}):null},"DialogOverlay")),RE=dr("DialogOverlay.RemoveScroll"),OE=E.forwardRef(jn(function(r,i){const{__scopeDialog:a,...c}=r,l=gr(ud,a),u=eg(),d=ke(i,u);return f.jsx(sd,{as:RE,allowPinchZoom:!0,shards:E.useMemo(()=>[l.contentRef,...l.branchNodes.map(m=>({current:m}))],[l.contentRef,l.branchNodes]),children:f.jsx(He.div,{"data-state":fd(l.open),...c,ref:d,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),ki="DialogContent",NE=E.forwardRef(jn(function(r,i){const a=_g(ki,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=gr(ki,r.__scopeDialog);return f.jsx(Fr,{present:c||u.open,children:u.modal?f.jsx(ME,{...l,ref:i}):f.jsx(_E,{...l,ref:i})})},"DialogContent")),ME=E.forwardRef(jn(function(r,i){const a=gr(ki,r.__scopeDialog),c=E.useRef(null),l=ke(i,a.contentRef,c);return E.useEffect(()=>{const u=c.current;if(u)return Og(u)},[]),f.jsx(Dg,{...r,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Ce(r.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Ce(r.onPointerDownOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&u.preventDefault()}),onFocusOutside:Ce(r.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),_E=E.forwardRef(jn(function(r,i){const a=gr(ki,r.__scopeDialog),c=E.useRef(!1),l=E.useRef(!1);return f.jsx(Dg,{...r,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{r.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||a.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,l.current=!1},onInteractOutside:u=>{r.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"DialogContentNonModal")),Dg=E.forwardRef(jn(function(r,i){const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:u,"aria-describedby":d,children:m,...p}=r,C=gr(ki,a);return dl(),f.jsx(ig,{registry:C.branchRegistry,children:f.jsx(og,{asChild:!0,loop:!0,trapped:c,branches:C.branchNodes,onMountAutoFocus:l,onUnmountAutoFocus:u,children:f.jsx(Yu,{role:"dialog",id:C.contentId,"aria-labelledby":C.titlePresent?C.titleId:void 0,"aria-describedby":C.descriptionPresent?Ig(d,C.descriptionId):d,"data-state":fd(C.open),...p,ref:i,deferPointerDownOutside:!0,onDismiss:()=>C.onOpenChange(!1),children:m})})})},"DialogContentImpl")),DE=E.forwardRef(jn(function(r,i){const{__scopeDialog:a,...c}=r,l=gr("DialogTitle",a),{setTitleCount:u}=l;return lt(()=>(u(d=>d+1),()=>u(d=>d-1)),[u]),f.jsx(He.h2,{id:l.titleId,...c,ref:i})},"DialogTitle")),IE="DialogClose",dd=E.forwardRef(jn(function(r,i){const{__scopeDialog:a,...c}=r,l=gr(IE,a);return f.jsx(He.button,{type:"button",...c,ref:i,onClick:Ce(r.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Ig(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}jn(Ig,"concatAriaDescribedby");function fd(t){return t?"open":"closed"}jn(fd,"getState");var kE=Object.defineProperty,LE=(t,r)=>kE(t,"name",{value:r,configurable:!0});function Li(t){const[r,i]=E.useState(void 0);return lt(()=>{if(t){i({width:t.offsetWidth,height:t.offsetHeight});let a=0;const c=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];window.cancelAnimationFrame(a),a=window.requestAnimationFrame(()=>{let d,m;if("borderBoxSize"in u){const p=u.borderBoxSize,C=Array.isArray(p)?p[0]:p;d=C.inlineSize,m=C.blockSize}else d=t.offsetWidth,m=t.offsetHeight;i({width:d,height:m})})});return c.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(a),c.unobserve(t)}}else i(void 0)},[t]),r}LE(Li,"useSize");var zE=Object.defineProperty,yr=(t,r)=>zE(t,"name",{value:r,configurable:!0}),hd="Checkbox",[BE,kM]=Tn(hd),[HE,md]=BE(hd);function kg(t){const{__scopeCheckbox:r,checked:i,children:a,defaultChecked:c,disabled:l,form:u,name:d,onCheckedChange:m,required:p,value:C="on",internal_do_not_use_render:g}=t,[b,x]=fr({prop:i,defaultProp:c??!1,onChange:m,caller:hd}),[v,S]=E.useState(null),[w,T]=E.useState(null),[j,R]=E.useState(null),O=v?!!u||!!v.closest("form"):!0,M={checked:b,disabled:l,setChecked:x,control:v,setControl:S,name:d,form:u,value:C,userClick:j,onUserClick:R,required:p,defaultChecked:An(c)?!1:c,isFormControl:O,bubbleInput:w,setBubbleInput:T};return f.jsx(HE,{scope:r,...M,children:Lg(g)?g(M):a})}yr(kg,"CheckboxProvider");var PE="CheckboxTrigger",UE=E.forwardRef(yr(function({__scopeCheckbox:r,onKeyDown:i,onClick:a,...c},l){const{control:u,value:d,disabled:m,checked:p,required:C,setControl:g,setChecked:b,onUserClick:x,isFormControl:v,bubbleInput:S}=md(PE,r),w=ke(l,g),T=E.useRef(p);return E.useEffect(()=>{const j=u?.form;if(j){const R=yr(()=>b(T.current),"reset");return j.addEventListener("reset",R),()=>j.removeEventListener("reset",R)}},[u,b]),f.jsx(He.button,{type:"button",role:"checkbox","aria-checked":An(p)?"mixed":p,"aria-required":C,"data-state":pd(p),"data-disabled":m?"":void 0,disabled:m,value:d,...c,ref:w,onKeyDown:Ce(i,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ce(a,j=>{const R=j.isPropagationStopped();x({requestedChecked:An(p)?!0:!p,hasConsumerStoppedPropagation:R}),b(O=>An(O)?!0:!O),S&&v&&(R||j.stopPropagation())})})},"CheckboxTrigger")),$E=E.forwardRef(yr(function(r,i){const{__scopeCheckbox:a,name:c,checked:l,defaultChecked:u,required:d,disabled:m,value:p,onCheckedChange:C,form:g,...b}=r;return f.jsx(kg,{__scopeCheckbox:a,checked:l,defaultChecked:u,disabled:m,required:d,onCheckedChange:C,name:c,form:g,value:p,internal_do_not_use_render:({isFormControl:x})=>f.jsxs(f.Fragment,{children:[f.jsx(UE,{...b,ref:i,__scopeCheckbox:a}),x&&f.jsx(YE,{__scopeCheckbox:a})]})})},"Checkbox")),GE="CheckboxIndicator",VE=E.forwardRef(yr(function(r,i){const{__scopeCheckbox:a,forceMount:c,...l}=r,u=md(GE,a);return f.jsx(Fr,{present:c||An(u.checked)||u.checked===!0,children:f.jsx(He.span,{"data-state":pd(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),qE="CheckboxBubbleInput",YE=E.forwardRef(yr(function({__scopeCheckbox:r,onClick:i,...a},c){const{control:l,userClick:u,checked:d,defaultChecked:m,required:p,disabled:C,name:g,value:b,form:x,bubbleInput:v,setBubbleInput:S}=md(qE,r),w=ke(c,S),T=Li(l),j=E.useRef(!1),R=E.useRef(d),O=E.useRef(u),M=E.useRef(null);E.useEffect(()=>{const _=v;if(!_)return;const I=window.HTMLInputElement.prototype,H=Object.getOwnPropertyDescriptor(I,"checked").set;if(!H)return;const z=R.current!==d;R.current=d;const $=u!==null&&u!==O.current;if(O.current=u,$)M.current=z?null:u,z&&(_.indeterminate=An(d),H.call(_,An(d)?!1:d)),_.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(z){const X=M.current;M.current=null;const G=X?.requestedChecked===d;j.current=!0,_.indeterminate=An(d),H.call(_,An(d)?!1:d),_.dispatchEvent(new Event("click",{bubbles:!(G&&X.hasConsumerStoppedPropagation)})),j.current=!1}},[v,d,u]);const D=E.useRef(An(d)?!1:d);return f.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??D.current,required:p,disabled:C,name:g,value:b,form:x,...a,tabIndex:-1,ref:w,onClick:Ce(i,_=>{j.current&&_.stopPropagation()}),style:{...a.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Lg(t){return typeof t=="function"}yr(Lg,"isFunction");function An(t){return t==="indeterminate"}yr(An,"isIndeterminate");function pd(t){return An(t)?"indeterminate":t?"checked":"unchecked"}yr(pd,"getState");const XE=["top","right","bottom","left"],Qr=Math.min,br=Math.max,xl=Math.round,vl=Math.floor,xr=t=>({x:t,y:t}),KE={left:"right",right:"left",bottom:"top",top:"bottom"};function zg(t,r,i){return br(t,Qr(r,i))}function vr(t,r){return typeof t=="function"?t(r):t}function Zr(t){return t.split("-")[0]}function wa(t){return t.split("-")[1]}function gd(t){return t==="x"?"y":"x"}function yd(t){return t==="y"?"height":"width"}function Jn(t){const r=t[0];return r==="t"||r==="b"?"y":"x"}function bd(t){return gd(Jn(t))}function FE(t,r,i){i===void 0&&(i=!1);const a=wa(t),c=bd(t),l=yd(c);let u=c==="x"?a===(i?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[l]>r.floating[l]&&(u=Sl(u)),[u,Sl(u)]}function QE(t){const r=Sl(t);return[xd(t),r,xd(r)]}function xd(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Bg=["left","right"],Hg=["right","left"],ZE=["top","bottom"],WE=["bottom","top"];function JE(t,r,i){switch(t){case"top":case"bottom":return i?r?Hg:Bg:r?Bg:Hg;case"left":case"right":return r?ZE:WE;default:return[]}}function eT(t,r,i,a){const c=wa(t);let l=JE(Zr(t),i==="start",a);return c&&(l=l.map(u=>u+"-"+c),r&&(l=l.concat(l.map(xd)))),l}function Sl(t){const r=Zr(t);return KE[r]+t.slice(r.length)}function tT(t){var r,i,a,c;return{top:(r=t.top)!=null?r:0,right:(i=t.right)!=null?i:0,bottom:(a=t.bottom)!=null?a:0,left:(c=t.left)!=null?c:0}}function Pg(t){return typeof t!="number"?tT(t):{top:t,right:t,bottom:t,left:t}}function Cl(t){const{x:r,y:i,width:a,height:c}=t;return{width:a,height:c,top:i,left:r,right:r+a,bottom:i+c,x:r,y:i}}function Ug(t,r,i){let{reference:a,floating:c}=t;const l=Jn(r),u=bd(r),d=yd(u),m=Zr(r),p=l==="y",C=a.x+a.width/2-c.width/2,g=a.y+a.height/2-c.height/2,b=a[d]/2-c[d]/2;let x;switch(m){case"top":x={x:C,y:a.y-c.height};break;case"bottom":x={x:C,y:a.y+a.height};break;case"right":x={x:a.x+a.width,y:g};break;case"left":x={x:a.x-c.width,y:g};break;default:x={x:a.x,y:a.y}}const v=wa(r);return v&&(x[u]+=b*(v==="end"?1:-1)*(i&&p?-1:1)),x}async function nT(t,r){var i;r===void 0&&(r={});const{x:a,y:c,platform:l,rects:u,elements:d,strategy:m}=t,{boundary:p="clippingAncestors",rootBoundary:C="viewport",elementContext:g="floating",altBoundary:b=!1,padding:x=0}=vr(r,t),v=Pg(x),w=d[b?g==="floating"?"reference":"floating":g],T=Cl(await l.getClippingRect({element:(i=await(l.isElement==null?void 0:l.isElement(w)))==null||i?w:w.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:C,strategy:m})),j=g==="floating"?{x:a,y:c,width:u.floating.width,height:u.floating.height}:u.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),O=await(l.isElement==null?void 0:l.isElement(R))&&await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1},M=Cl(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:j,offsetParent:R,strategy:m}):j);return{top:(T.top-M.top+v.top)/O.y,bottom:(M.bottom-T.bottom+v.bottom)/O.y,left:(T.left-M.left+v.left)/O.x,right:(M.right-T.right+v.right)/O.x}}const rT=50,oT=async(t,r,i)=>{const{placement:a="bottom",strategy:c="absolute",middleware:l=[],platform:u}=i,d=u.detectOverflow?u:{...u,detectOverflow:nT},m=await(u.isRTL==null?void 0:u.isRTL(r));let p=await u.getElementRects({reference:t,floating:r,strategy:c}),{x:C,y:g}=Ug(p,a,m),b=a,x=0;const v={};for(let S=0;S<l.length;S++){const w=l[S];if(!w)continue;const{name:T,fn:j}=w,{x:R,y:O,data:M,reset:D}=await j({x:C,y:g,initialPlacement:a,placement:b,strategy:c,middlewareData:v,rects:p,platform:d,elements:{reference:t,floating:r}});C=R??C,g=O??g,v[T]={...v[T],...M},D&&x<rT&&(x++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(p=D.rects===!0?await u.getElementRects({reference:t,floating:r,strategy:c}):D.rects),{x:C,y:g}=Ug(p,b,m)),S=-1)}return{x:C,y:g,placement:b,strategy:c,middlewareData:v}},aT=t=>({name:"arrow",options:t,async fn(r){const{x:i,y:a,placement:c,rects:l,platform:u,elements:d,middlewareData:m}=r,{element:p,padding:C=0}=vr(t,r)||{};if(p==null)return{};const g=Pg(C),b={x:i,y:a},x=bd(c),v=yd(x),S=await u.getDimensions(p),w=x==="y",T=w?"top":"left",j=w?"bottom":"right",R=w?"clientHeight":"clientWidth",O=l.reference[v]+l.reference[x]-b[x]-l.floating[v],M=b[x]-l.reference[x],D=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let _=D?D[R]:0;(!_||!await(u.isElement==null?void 0:u.isElement(D)))&&(_=d.floating[R]||l.floating[v]);const I=O/2-M/2,B=_/2-S[v]/2-1,H=Qr(g[T],B),z=Qr(g[j],B),$=_-S[v]-z,X=_/2-S[v]/2+I,G=zg(H,X,$),te=!m.arrow&&wa(c)!=null&&X!==G&&l.reference[v]/2-(X<H?H:z)-S[v]/2<0,V=te?X<H?X-H:X-$:0;return{[x]:b[x]+V,data:{[x]:G,centerOffset:X-G-V,...te&&{alignmentOffset:V}},reset:te}}}),iT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var i,a;const{placement:c,middlewareData:l,rects:u,initialPlacement:d,platform:m,elements:p}=r,{mainAxis:C=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:S=!0,...w}=vr(t,r);if((i=l.arrow)!=null&&i.alignmentOffset)return{};const T=Zr(c),j=Jn(d),R=Zr(d)===d,O=await(m.isRTL==null?void 0:m.isRTL(p.floating)),M=b||(R||!S?[Sl(d)]:QE(d)),D=v!=="none";!b&&D&&M.push(...eT(d,S,v,O));const _=[d,...M],I=await m.detectOverflow(r,w),B=[];let H=((a=l.flip)==null?void 0:a.overflows)||[];if(C&&B.push(I[T]),g){const G=FE(c,u,O);B.push(I[G[0]],I[G[1]])}if(H=[...H,{placement:c,overflows:B}],!B.every(G=>G<=0)){var z,$;const G=(((z=l.flip)==null?void 0:z.index)||0)+1,te=_[G];if(te&&(!(g==="alignment"?j!==Jn(te):!1)||H.every(L=>Jn(L.placement)===j?L.overflows[0]>0:!0)))return{data:{index:G,overflows:H},reset:{placement:te}};let V=($=H.filter(Y=>Y.overflows[0]<=0).sort((Y,L)=>Y.overflows[1]-L.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(x){case"bestFit":{var X;const Y=(X=H.filter(L=>{if(D){const P=Jn(L.placement);return P===j||P==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(P=>P>0).reduce((P,N)=>P+N,0)]).sort((L,P)=>L[1]-P[1])[0])==null?void 0:X[0];Y&&(V=Y);break}case"initialPlacement":V=d;break}if(c!==V)return{reset:{placement:V}}}return{}}}};function $g(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function Gg(t){return XE.some(r=>t[r]>=0)}const sT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:i,platform:a}=r,{strategy:c="referenceHidden",...l}=vr(t,r);switch(c){case"referenceHidden":{const u=await a.detectOverflow(r,{...l,elementContext:"reference"}),d=$g(u,i.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Gg(d)}}}case"escaped":{const u=await a.detectOverflow(r,{...l,altBoundary:!0}),d=$g(u,i.floating);return{data:{escapedOffsets:d,escaped:Gg(d)}}}default:return{}}}}},Vg=new Set(["left","top"]);async function lT(t,r){const{placement:i,platform:a,elements:c}=t,l=await(a.isRTL==null?void 0:a.isRTL(c.floating)),u=Zr(i),d=wa(i),m=Jn(i)==="y",p=Vg.has(u)?-1:1,C=l&&m?-1:1,g=vr(r,t);let{mainAxis:b,crossAxis:x,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof v=="number"&&(x=d==="end"?v*-1:v),m?{x:x*C,y:b*p}:{x:b*p,y:x*C}}const cT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var i,a;const{x:c,y:l,placement:u,middlewareData:d}=r,m=await lT(r,t);return u===((i=d.offset)==null?void 0:i.placement)&&(a=d.arrow)!=null&&a.alignmentOffset?{}:{x:c+m.x,y:l+m.y,data:{...m,placement:u}}}}},uT=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:i,y:a,placement:c,platform:l}=r,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:j=>{let{x:R,y:O}=j;return{x:R,y:O}}},...p}=vr(t,r),C={x:i,y:a},g=await l.detectOverflow(r,p),b=Jn(c),x=gd(b);let v=C[x],S=C[b];const w=(j,R)=>zg(R+g[j==="y"?"top":"left"],R,R-g[j==="y"?"bottom":"right"]);u&&(v=w(x,v)),d&&(S=w(b,S));const T=m.fn({...r,[x]:v,[b]:S});return{...T,data:{x:T.x-i,y:T.y-a,enabled:{[x]:u,[b]:d}}}}}},dT=function(t){return t===void 0&&(t={}),{options:t,fn(r){var i,a;const{x:c,y:l,placement:u,rects:d,middlewareData:m}=r,{offset:p=0,mainAxis:C=!0,crossAxis:g=!0}=vr(t,r),b={x:c,y:l},x=Jn(u),v=gd(x);let S=b[v],w=b[x];const T=vr(p,r),j=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(i=T.mainAxis)!=null?i:0,crossAxis:(a=T.crossAxis)!=null?a:0};if(C){const M=v==="y"?"height":"width",D=d.reference[v]-d.floating[M]+j.mainAxis,_=d.reference[v]+d.reference[M]-j.mainAxis;S<D?S=D:S>_&&(S=_)}if(g){var R,O;const M=v==="y"?"width":"height",D=Vg.has(Zr(u)),_=d.reference[x]-d.floating[M]+(D&&((R=m.offset)==null?void 0:R[x])||0)+(D?0:j.crossAxis),I=d.reference[x]+d.reference[M]+(D?0:((O=m.offset)==null?void 0:O[x])||0)-(D?j.crossAxis:0);w<_?w=_:w>I&&(w=I)}return{[v]:S,[x]:w}}}},fT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){const{placement:i,rects:a,platform:c,elements:l}=r,{apply:u=()=>{},...d}=vr(t,r),m=await c.detectOverflow(r,d),p=Zr(i),C=wa(i),g=Jn(i)==="y",{width:b,height:x}=a.floating;let v,S;p==="top"||p==="bottom"?(v=p,S=C===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(S=p,v=C==="end"?"top":"bottom");const w=x-m.top-m.bottom,T=b-m.left-m.right,j=Qr(x-m[v],w),R=Qr(b-m[S],T),O=r.middlewareData.shift,M=!O;let D=j,_=R;O!=null&&O.enabled.x&&(_=T),O!=null&&O.enabled.y&&(D=w),M&&!C&&(g?_=b-2*br(m.left,m.right):D=x-2*br(m.top,m.bottom)),await u({...r,availableWidth:_,availableHeight:D});const I=await c.getDimensions(l.floating);return b!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function wl(){return typeof window<"u"}function Ea(t){return qg(t)?(t.nodeName||"").toLowerCase():"#document"}function nn(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Sr(t){var r;return(r=(qg(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function qg(t){return wl()?t instanceof Node||t instanceof nn(t).Node:!1}function er(t){return wl()?t instanceof Element||t instanceof nn(t).Element:!1}function Wr(t){return wl()?t instanceof HTMLElement||t instanceof nn(t).HTMLElement:!1}function Yg(t){return!wl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof nn(t).ShadowRoot}function El(t){const{overflow:r,overflowX:i,overflowY:a,display:c}=tr(t);return/auto|scroll|overlay|hidden|clip/.test(r+a+i)&&c!=="inline"&&c!=="contents"}function hT(t){return/^(table|td|th)$/.test(Ea(t))}function Tl(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const mT=/transform|translate|scale|rotate|perspective|filter/,pT=/paint|layout|strict|content/,Do=t=>!!t&&t!=="none";let vd;function Sd(t){const r=er(t)?tr(t):t;return Do(r.transform)||Do(r.translate)||Do(r.scale)||Do(r.rotate)||Do(r.perspective)||!Cd()&&(Do(r.backdropFilter)||Do(r.filter))||mT.test(r.willChange||"")||pT.test(r.contain||"")}function gT(t){let r=Io(t);for(;Wr(r)&&!zi(r);){if(Sd(r))return r;if(Tl(r))return null;r=Io(r)}return null}function Cd(){return vd==null&&(vd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vd}function zi(t){return/^(html|body|#document)$/.test(Ea(t))}function tr(t){return nn(t).getComputedStyle(t)}function jl(t){return er(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Io(t){if(Ea(t)==="html")return t;const r=t.assignedSlot||t.parentNode||Yg(t)&&t.host||Sr(t);return Yg(r)?r.host:r}function Xg(t){const r=Io(t);return zi(r)?(t.ownerDocument||t).body:Wr(r)&&El(r)?r:Xg(r)}function Bi(t,r,i){var a;r===void 0&&(r=[]),i===void 0&&(i=!0);const c=Xg(t),l=c===((a=t.ownerDocument)==null?void 0:a.body),u=nn(c);if(l){const d=wd(u);return r.concat(u,u.visualViewport||[],El(c)?c:[],d&&i?Bi(d):[])}else return r.concat(c,Bi(c,[],i))}function wd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Kg(t){const r=tr(t);let i=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const c=Wr(t),l=c?t.offsetWidth:i,u=c?t.offsetHeight:a,d=xl(i)!==l||xl(a)!==u;return d&&(i=l,a=u),{width:i,height:a,$:d}}function Ed(t){return er(t)?t:t.contextElement}function Ta(t){const r=Ed(t);if(!Wr(r))return xr(1);const i=r.getBoundingClientRect(),{width:a,height:c,$:l}=Kg(r);let u=(l?xl(i.width):i.width)/a,d=(l?xl(i.height):i.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const yT=xr(0);function Fg(t){const r=nn(t);return!Cd()||!r.visualViewport?yT:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function bT(t,r,i){return r===void 0&&(r=!1),!!i&&r&&i===nn(t)}function ko(t,r,i,a){r===void 0&&(r=!1),i===void 0&&(i=!1);const c=t.getBoundingClientRect(),l=Ed(t);let u=xr(1);r&&(a?er(a)&&(u=Ta(a)):u=Ta(t));const d=bT(l,i,a)?Fg(l):xr(0);let m=(c.left+d.x)/u.x,p=(c.top+d.y)/u.y,C=c.width/u.x,g=c.height/u.y;if(l&&a){const b=nn(l),x=er(a)?nn(a):a;let v=b,S=wd(v);for(;S&&x!==v;){const w=Ta(S),T=S.getBoundingClientRect(),j=tr(S),R=T.left+(S.clientLeft+parseFloat(j.paddingLeft))*w.x,O=T.top+(S.clientTop+parseFloat(j.paddingTop))*w.y;m*=w.x,p*=w.y,C*=w.x,g*=w.y,m+=R,p+=O,v=nn(S),S=wd(v)}}return Cl({width:C,height:g,x:m,y:p})}function Al(t,r){const i=jl(t).scrollLeft;return r?r.left+i:ko(Sr(t)).left+i}function Qg(t,r){const i=t.getBoundingClientRect(),a=i.left+r.scrollLeft-Al(t,i),c=i.top+r.scrollTop;return{x:a,y:c}}function xT(t){let{elements:r,rect:i,offsetParent:a,strategy:c}=t;const l=c==="fixed",u=Sr(a),d=r?Tl(r.floating):!1;if(a===u||d&&l)return i;let m={scrollLeft:0,scrollTop:0},p=xr(1);const C=xr(0),g=Wr(a);if((g||!l)&&((Ea(a)!=="body"||El(u))&&(m=jl(a)),g)){const x=ko(a);p=Ta(a),C.x=x.x+a.clientLeft,C.y=x.y+a.clientTop}const b=u&&!g&&!l?Qg(u,m):xr(0);return{width:i.width*p.x,height:i.height*p.y,x:i.x*p.x-m.scrollLeft*p.x+C.x+b.x,y:i.y*p.y-m.scrollTop*p.y+C.y+b.y}}function vT(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function ST(t){const r=jl(t),i=t.ownerDocument.body,a=br(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),c=br(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-r.scrollLeft+Al(t);const u=-r.scrollTop;return tr(i).direction==="rtl"&&(l+=br(t.clientWidth,i.clientWidth)-a),{width:a,height:c,x:l,y:u}}const CT=25;function wT(t,r,i){i===void 0&&(i="viewport");const a=i==="layoutViewport",c=nn(t),l=Sr(t),u=c.visualViewport;let d=l.clientWidth,m=l.clientHeight,p=0,C=0;if(u){const b=!Cd()||r==="fixed";a?b||(p=-u.offsetLeft,C=-u.offsetTop):(d=u.width,m=u.height,b&&(p=u.offsetLeft,C=u.offsetTop))}if(Al(l)<=0){const b=l.ownerDocument,x=b.body,v=getComputedStyle(x),S=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(l.clientWidth-x.clientWidth-S),T=getComputedStyle(l).scrollbarGutter==="stable both-edges"?w/2:w;T<=CT&&(d-=T)}return{width:d,height:m,x:p,y:C}}function ET(t,r){const i=ko(t,!0,r==="fixed"),a=i.top+t.clientTop,c=i.left+t.clientLeft,l=Ta(t),u=t.clientWidth*l.x,d=t.clientHeight*l.y,m=c*l.x,p=a*l.y;return{width:u,height:d,x:m,y:p}}function Zg(t,r,i){let a;if(r==="viewport"||r==="layoutViewport")a=wT(t,i,r);else if(r==="document")a=ST(Sr(t));else if(er(r))a=ET(r,i);else{const c=Fg(t);a={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return Cl(a)}function TT(t,r){const i=r.get(t);if(i)return i;let a=Bi(t,[],!1).filter(d=>er(d)&&Ea(d)!=="body"),c=null;const l=tr(t).position==="fixed";let u=l?Io(t):t;for(;er(u)&&!zi(u);){const d=tr(u),m=Sd(u),p=c?c.position:l?"fixed":"";!m&&(p==="fixed"||p==="absolute"&&d.position==="static")?a=a.filter(g=>g!==u):c=d,u=Io(u)}return r.set(t,a),a}function jT(t){let{element:r,boundary:i,rootBoundary:a,strategy:c}=t;const u=[...i==="clippingAncestors"?Tl(r)?[]:TT(r,this._c):[].concat(i),a],d=Zg(r,u[0],c);let m=d.top,p=d.right,C=d.bottom,g=d.left;for(let b=1;b<u.length;b++){const x=Zg(r,u[b],c);m=br(x.top,m),p=Qr(x.right,p),C=Qr(x.bottom,C),g=br(x.left,g)}return{width:p-g,height:C-m,x:g,y:m}}function AT(t){const{width:r,height:i}=Kg(t);return{width:r,height:i}}function RT(t,r,i){const a=Wr(r),c=Sr(r),l=i==="fixed",u=ko(t,!0,l,r);let d={scrollLeft:0,scrollTop:0};const m=xr(0);if((a||!l)&&((Ea(r)!=="body"||El(c))&&(d=jl(r)),a)){const b=ko(r,!0,l,r);m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}!a&&c&&(m.x=Al(c));const p=c&&!a&&!l?Qg(c,d):xr(0),C=u.left+d.scrollLeft-m.x-p.x,g=u.top+d.scrollTop-m.y-p.y;return{x:C,y:g,width:u.width,height:u.height}}function Td(t){return tr(t).position==="static"}function Wg(t,r){if(!Wr(t)||tr(t).position==="fixed")return null;if(r)return r(t);let i=t.offsetParent;return Sr(t)===i&&(i=i.ownerDocument.body),i}function Jg(t,r){const i=nn(t);if(Tl(t))return i;if(!Wr(t)){let c=Io(t);for(;c&&!zi(c);){if(er(c)&&!Td(c))return c;c=Io(c)}return i}let a=Wg(t,r);for(;a&&hT(a)&&Td(a);)a=Wg(a,r);return a&&zi(a)&&Td(a)&&!Sd(a)?i:a||gT(t)||i}const OT=async function(t){const r=this.getOffsetParent||Jg,i=this.getDimensions,a=await i(t.floating);return{reference:RT(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function NT(t){return tr(t).direction==="rtl"}const MT={convertOffsetParentRelativeRectToViewportRelativeRect:xT,getDocumentElement:Sr,getClippingRect:jT,getOffsetParent:Jg,getElementRects:OT,getClientRects:vT,getDimensions:AT,getScale:Ta,isElement:er,isRTL:NT};function ey(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function _T(t,r,i){let a=null,c;const l=Sr(t);function u(){var C;clearTimeout(c),(C=a)==null||C.disconnect(),a=null}function d(C,g){C===void 0&&(C=!1),g===void 0&&(g=1),u();const b=t.getBoundingClientRect(),{left:x,top:v,width:S,height:w}=b;if(C||r(),!S||!w)return;const T=vl(v),j=vl(l.clientWidth-(x+S)),R=vl(l.clientHeight-(v+w)),O=vl(x),D={rootMargin:-T+"px "+-j+"px "+-R+"px "+-O+"px",threshold:br(0,Qr(1,g))||1};let _=!0;function I(B){const H=B[0].intersectionRatio;if(!ey(b,t.getBoundingClientRect()))return d();if(H!==g){if(!_)return d();H?d(!1,H):c=setTimeout(()=>{d(!1,1e-7)},1e3)}_=!1}try{a=new IntersectionObserver(I,{...D,root:l.ownerDocument})}catch{a=new IntersectionObserver(I,D)}a.observe(t)}const m=nn(t),p=()=>d(i);return m.addEventListener("resize",p),d(!0),()=>{m.removeEventListener("resize",p),u()}}function DT(t,r,i,a){a===void 0&&(a={});const{ancestorScroll:c=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=a,p=Ed(t),C=c||l?[...p?Bi(p):[],...r?Bi(r):[]]:[];C.forEach(T=>{c&&T.addEventListener("scroll",i),l&&T.addEventListener("resize",i)});const g=p&&d?_T(p,i,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(T=>{let[j]=T;j&&j.target===p&&x&&r&&(x.unobserve(r),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=x)==null||R.observe(r)})),i()}),p&&!m&&x.observe(p),r&&x.observe(r));let v,S=m?ko(t):null;m&&w();function w(){const T=ko(t);S&&!ey(S,T)&&i(),S=T,v=requestAnimationFrame(w)}return i(),()=>{var T;C.forEach(j=>{c&&j.removeEventListener("scroll",i),l&&j.removeEventListener("resize",i)}),g?.(),(T=x)==null||T.disconnect(),x=null,m&&cancelAnimationFrame(v)}}const IT=cT,kT=uT,LT=iT,zT=fT,BT=sT,ty=aT,HT=dT,PT=(t,r,i)=>{const a=new Map,c=i??{},l={...MT,...c.platform,_c:a};return oT(t,r,{...c,platform:l})};var UT=typeof document<"u",$T=function(){},Rl=UT?E.useLayoutEffect:$T;function Ol(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let i,a,c;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(i=t.length,i!==r.length)return!1;for(a=i;a--!==0;)if(!Ol(t[a],r[a]))return!1;return!0}if(c=Object.keys(t),i=c.length,i!==Object.keys(r).length)return!1;for(a=i;a--!==0;)if(!{}.hasOwnProperty.call(r,c[a]))return!1;for(a=i;a--!==0;){const l=c[a];if(!(l==="_owner"&&t.$$typeof)&&!Ol(t[l],r[l]))return!1}return!0}return t!==t&&r!==r}function ny(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ry(t,r){const i=ny(t);return Math.round(r*i)/i}function jd(t){const r=E.useRef(t);return Rl(()=>{r.current=t}),r}function GT(t){t===void 0&&(t={});const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:c,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:p}=t,[C,g]=E.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[b,x]=E.useState(a);Ol(b,a)||x(a);const[v,S]=E.useState(null),[w,T]=E.useState(null),j=E.useCallback(L=>{L!==D.current&&(D.current=L,S(L))},[]),R=E.useCallback(L=>{L!==_.current&&(_.current=L,T(L))},[]),O=l||v,M=u||w,D=E.useRef(null),_=E.useRef(null),I=E.useRef(C),B=m!=null,H=jd(m),z=jd(c),$=jd(p),X=E.useCallback(()=>{if(!D.current||!_.current)return;const L={placement:r,strategy:i,middleware:b};z.current&&(L.platform=z.current),PT(D.current,_.current,L).then(P=>{const N={...P,isPositioned:$.current!==!1};G.current&&!Ol(I.current,N)&&(I.current=N,Yr.flushSync(()=>{g(N)}))})},[b,r,i,z,$]);Rl(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(L=>({...L,isPositioned:!1})))},[p]);const G=E.useRef(!1);Rl(()=>(G.current=!0,()=>{G.current=!1}),[]),Rl(()=>{if(O&&(D.current=O),M&&(_.current=M),O&&M){if(H.current)return H.current(O,M,X);X()}},[O,M,X,H,B]);const te=E.useMemo(()=>({reference:D,floating:_,setReference:j,setFloating:R}),[j,R]),V=E.useMemo(()=>({reference:O,floating:M}),[O,M]),Y=E.useMemo(()=>{const L={position:i,left:0,top:0};if(!V.floating)return L;const P=ry(V.floating,C.x),N=ry(V.floating,C.y);return d?{...L,transform:"translate("+P+"px, "+N+"px)",...ny(V.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:P,top:N}},[i,d,V.floating,C.x,C.y]);return E.useMemo(()=>({...C,update:X,refs:te,elements:V,floatingStyles:Y}),[C,X,te,V,Y])}const VT=t=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:t,fn(i){const{element:a,padding:c}=typeof t=="function"?t(i):t;return a&&r(a)?a.current!=null?ty({element:a.current,padding:c}).fn(i):{}:a?ty({element:a,padding:c}).fn(i):{}}}},qT=(t,r)=>{const i=IT(t);return{name:i.name,fn:i.fn,options:[t,r]}},YT=(t,r)=>{const i=kT(t);return{name:i.name,fn:i.fn,options:[t,r]}},XT=(t,r)=>({fn:HT(t).fn,options:[t,r]}),KT=(t,r)=>{const i=LT(t);return{name:i.name,fn:i.fn,options:[t,r]}},FT=(t,r)=>{const i=zT(t);return{name:i.name,fn:i.fn,options:[t,r]}},QT=(t,r)=>{const i=BT(t);return{name:i.name,fn:i.fn,options:[t,r]}},ZT=(t,r)=>{const i=VT(t);return{name:i.name,fn:i.fn,options:[t,r]}};var WT=Object.defineProperty,JT=(t,r)=>WT(t,"name",{value:r,configurable:!0}),ej=E.forwardRef(JT(function(r,i){const{children:a,width:c=10,height:l=5,...u}=r;return f.jsx(He.svg,{...u,ref:i,width:c,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?a:f.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),tj=Object.defineProperty,Cr=(t,r)=>tj(t,"name",{value:r,configurable:!0}),oy={Partial:"partial"},ay={Optimized:"optimized",Always:"always"},iy="Popper",[sy,Nl]=Tn(iy),[nj,ly]=sy(iy),cy=Cr(t=>{const{__scopePopper:r,children:i}=t,[a,c]=E.useState(null),[l,u]=E.useState(void 0);return f.jsx(nj,{scope:r,anchor:a,onAnchorChange:c,placementState:l,setPlacementState:u,children:i})},"Popper"),rj="PopperAnchor",uy=E.forwardRef(Cr(function(r,i){const{__scopePopper:a,virtualRef:c,...l}=r,u=ly(rj,a),d=E.useRef(null),m=u.onAnchorChange,p=E.useCallback(S=>{d.current=S,S&&m(S)},[m]),C=ke(i,p),g=E.useRef(null);E.useEffect(()=>{if(!c)return;const S=g.current;g.current=c.current,S!==g.current&&m(g.current)});const b=u.placementState&&Ml(u.placementState),x=b?.[0],v=b?.[1];return c?null:f.jsx(He.div,{"data-radix-popper-side":x,"data-radix-popper-align":v,...l,ref:C})},"PopperAnchor")),dy="PopperContent",[oj,aj]=sy(dy),fy=E.forwardRef(Cr(function(r,i){const{__scopePopper:a,side:c="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:C=[],collisionPadding:g=0,sticky:b=oy.Partial,hideWhenDetached:x=!1,updatePositionStrategy:v=ay.Optimized,onPlaced:S,...w}=r,T=ly(dy,a),[j,R]=E.useState(null),O=ke(i,R),[M,D]=E.useState(null),_=Li(M),I=_?.width??0,B=_?.height??0,H=c+(u!=="center"?"-"+u:""),z=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},$=Array.isArray(C)?C:[C],X=$.length>0,G={padding:z,boundary:$.filter(hy),altBoundary:X},{refs:te,floatingStyles:V,placement:Y,isPositioned:L,middlewareData:P}=GT({strategy:"fixed",placement:H,whileElementsMounted:Cr((...ye)=>DT(...ye,{animationFrame:v===ay.Always}),"whileElementsMounted"),elements:{reference:T.anchor},middleware:[qT({mainAxis:l+B,alignmentAxis:d}),p&&YT({mainAxis:!0,crossAxis:!1,...b===oy.Partial?{limiter:XT()}:{},...G}),p&&KT({...G}),FT({...G,apply:Cr(({elements:ye,rects:de,availableWidth:Me,availableHeight:De})=>{const{width:we,height:xe}=de.reference,Se=ye.floating.style;Se.setProperty("--radix-popper-available-width",`${Me}px`),Se.setProperty("--radix-popper-available-height",`${De}px`),Se.setProperty("--radix-popper-anchor-width",`${we}px`),Se.setProperty("--radix-popper-anchor-height",`${xe}px`)},"apply")}),M&&ZT({element:M,padding:m}),cj({arrowWidth:I,arrowHeight:B}),x&&QT(X?{strategy:"referenceHidden",...G}:{strategy:"referenceHidden",padding:G.padding,altBoundary:G.altBoundary})]}),N=T.setPlacementState;lt(()=>(N(Y),()=>{N(void 0)}),[Y,N]);const[U,J]=Ml(Y),Q=Hn(S);lt(()=>{L&&Q?.()},[L,Q]);const le=P.arrow?.x,re=P.arrow?.y,ae=P.arrow?.centerOffset!==0,[ge,je]=E.useState();return lt(()=>{j&&je(window.getComputedStyle(j).zIndex)},[j]),f.jsx("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:L?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:f.jsx(oj,{scope:a,placedSide:U,placedAlign:J,onArrowChange:D,arrowX:le,arrowY:re,shouldHideArrow:ae,children:f.jsx(He.div,{"data-side":U,"data-align":J,...w,ref:O,style:{...w.style,animation:L?w.style?.animation:"none"}})})})},"PopperContent")),ij="PopperArrow",sj={top:"bottom",right:"left",bottom:"top",left:"right"},lj=E.forwardRef(Cr(function(r,i){const{__scopePopper:a,...c}=r,l=aj(ij,a),u=sj[l.placedSide];return f.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:f.jsx(ej,{...c,ref:i,style:{...c.style,display:"block"}})})},"PopperArrow"));function hy(t){return t!==null}Cr(hy,"isNotNull");var cj=Cr(t=>({name:"transformOrigin",options:t,fn(r){const{placement:i,rects:a,middlewareData:c}=r,u=c.arrow?.centerOffset!==0,d=u?0:t.arrowWidth,m=u?0:t.arrowHeight,[p,C]=Ml(i),g={start:"0%",center:"50%",end:"100%"}[C],b=(c.arrow?.x??0)+d/2,x=(c.arrow?.y??0)+m/2;let v="",S="";return p==="bottom"?(v=u?g:`${b}px`,S=`${-m}px`):p==="top"?(v=u?g:`${b}px`,S=`${a.floating.height+m}px`):p==="right"?(v=`${-m}px`,S=u?g:`${x}px`):p==="left"&&(v=`${a.floating.width+m}px`,S=u?g:`${x}px`),{data:{x:v,y:S}}}}),"transformOrigin");function Ml(t){const[r,i="center"]=t.split("-");return[r,i]}Cr(Ml,"getSideAndAlignFromPlacement");var uj=Object.defineProperty,Ad=(t,r)=>uj(t,"name",{value:r,configurable:!0}),Rd=!1;function my(){const[t,r]=E.useState(Rd);return E.useEffect(()=>{Rd||(Rd=!0,r(!0))},[]),t}Ad(my,"useIsHydrated");var py=No[" useSyncExternalStore ".trim().toString()];function gy(){return()=>{}}Ad(gy,"subscribe");function yy(){return py(gy,()=>!0,()=>!1)}Ad(yy,"useIsHydratedModern");var dj=typeof py=="function"?yy:my,fj=Object.defineProperty,Lo=(t,r)=>fj(t,"name",{value:r,configurable:!0}),Od="rovingFocusGroup.onEntryFocus",hj={bubbles:!1,cancelable:!0},_l="RovingFocusGroup",[Nd,by,mj]=il(_l),[pj,xy]=Tn(_l,[mj]),vy={Vertical:"vertical",Horizontal:"horizontal"},gj={RTL:"rtl"},[yj,bj]=pj(_l),xj=E.forwardRef(Lo(function(r,i){return f.jsx(Nd.Provider,{scope:r.__scopeRovingFocusGroup,children:f.jsx(Nd.Slot,{scope:r.__scopeRovingFocusGroup,children:f.jsx(vj,{...r,ref:i})})})},"RovingFocusGroup")),vj=E.forwardRef(Lo(function(r,i){const{__scopeRovingFocusGroup:a,orientation:c,loop:l=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:C,preventScrollOnEntryFocus:g=!1,...b}=r,x=E.useRef(null),v=ke(i,x),S=Ii(u),[w,T]=fr({prop:d,defaultProp:m??null,onChange:p,caller:_l}),[j,R]=E.useState(!1),O=Hn(C),M=by(a),D=E.useRef(!1),[_,I]=E.useState(0);return E.useEffect(()=>{const B=x.current;if(B)return B.addEventListener(Od,O),()=>B.removeEventListener(Od,O)},[O]),f.jsx(yj,{scope:a,orientation:c,dir:S,loop:l,currentTabStopId:w,onItemFocus:E.useCallback(B=>T(B),[T]),onItemShiftTab:E.useCallback(()=>R(!0),[]),onFocusableItemAdd:E.useCallback(()=>I(B=>B+1),[]),onFocusableItemRemove:E.useCallback(()=>I(B=>B-1),[]),children:f.jsx(He.div,{tabIndex:j||_===0?-1:0,"data-orientation":c,...b,ref:v,style:{outline:"none",...r.style},onMouseDown:Ce(r.onMouseDown,()=>{D.current=!0}),onFocus:Ce(r.onFocus,B=>{const H=!D.current;if(B.target===B.currentTarget&&H&&!j){const z=new CustomEvent(Od,hj);if(B.currentTarget.dispatchEvent(z),!z.defaultPrevented){const $=M().filter(Y=>Y.focusable),X=$.find(Y=>Y.active),G=$.find(Y=>Y.id===w),V=[X,G,...$].filter(Boolean).map(Y=>Y.ref.current);Md(V,g)}}D.current=!1}),onBlur:Ce(r.onBlur,()=>R(!1))})})},"RovingFocusGroupImpl")),Sj="RovingFocusGroupItem",Cj=E.forwardRef(Lo(function(r,i){const{__scopeRovingFocusGroup:a,focusable:c=!0,active:l=!1,tabStopId:u,children:d,...m}=r,p=mr(),C=u||p,g=bj(Sj,a),b=g.currentTabStopId===C,x=by(a),{onFocusableItemAdd:v,onFocusableItemRemove:S,currentTabStopId:w}=g,T=dj();return lt(()=>{if(!(!T||!c))return v(),()=>S()},[T,c,v,S]),E.useEffect(()=>{if(!(T||!c))return v(),()=>S()},[T,c,v,S]),f.jsx(Nd.ItemSlot,{scope:a,id:C,focusable:c,active:l,children:f.jsx(He.span,{tabIndex:b?0:-1,"data-orientation":g.orientation,...m,ref:i,onMouseDown:Ce(r.onMouseDown,j=>{c?g.onItemFocus(C):j.preventDefault()}),onFocus:Ce(r.onFocus,()=>g.onItemFocus(C)),onKeyDown:Ce(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){g.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const R=Cy(j,g.orientation,g.dir);if(R!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let M=x().filter(D=>D.focusable).map(D=>D.ref.current);if(R==="last")M.reverse();else if(R==="prev"||R==="next"){R==="prev"&&M.reverse();const D=M.indexOf(j.currentTarget);M=g.loop?wy(M,D+1):M.slice(D+1)}setTimeout(()=>Md(M))}}),children:typeof d=="function"?d({isCurrentTabStop:b,hasTabStop:w!=null}):d})})},"RovingFocusGroupItem")),wj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Sy(t,r){return r!==gj.RTL?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}Lo(Sy,"getDirectionAwareKey");function Cy(t,r,i){const a=Sy(t.key,i);if(!(r===vy.Vertical&&["ArrowLeft","ArrowRight"].includes(a))&&!(r===vy.Horizontal&&["ArrowUp","ArrowDown"].includes(a)))return wj[a]}Lo(Cy,"getFocusIntent");function Md(t,r=!1){const i=document.activeElement;for(const a of t)if(a===i||(a.focus({preventScroll:r}),document.activeElement!==i))return}Lo(Md,"focusFirst");function wy(t,r){return t.map((i,a)=>t[(r+a)%t.length])}Lo(wy,"wrapArray");var Ej=Object.defineProperty,Tj=(t,r)=>Ej(t,"name",{value:r,configurable:!0});function ja(t,[r,i]){return Math.min(i,Math.max(r,t))}Tj(ja,"clamp");var jj=Object.defineProperty,Xt=(t,r)=>jj(t,"name",{value:r,configurable:!0}),Ey="Radio",[Aj,Ty]=Tn(Ey),[Rj,Dl]=Aj(Ey);function jy(t){const{__scopeRadio:r,checked:i=!1,children:a,disabled:c,form:l,name:u,onCheck:d,required:m,value:p="on",internal_do_not_use_render:C}=t,[g,b]=E.useState(null),[x,v]=E.useState(null),[S,w]=E.useState(null),T=g?!!l||!!g.closest("form"):!0,j={checked:i,disabled:c,required:m,name:u,form:l,value:p,control:g,setControl:b,userClick:S,onUserClick:w,isFormControl:T,bubbleInput:x,setBubbleInput:v,onCheck:Xt(()=>d?.(),"onCheck")};return f.jsx(Rj,{scope:r,...j,children:Ay(C)?C(j):a})}Xt(jy,"RadioProvider");var Oj="RadioTrigger",Nj=E.forwardRef(Xt(function({__scopeRadio:r,onClick:i,...a},c){const{checked:l,disabled:u,value:d,setControl:m,onCheck:p,onUserClick:C,isFormControl:g,bubbleInput:b}=Dl(Oj,r),x=ke(c,m);return f.jsx(He.button,{type:"button",role:"radio","aria-checked":l,"data-state":_d(l),"data-disabled":u?"":void 0,disabled:u,value:d,...a,ref:x,onClick:Ce(i,v=>{const S=v.isPropagationStopped();l||(C({hasConsumerStoppedPropagation:S}),p()),b&&g&&(S||v.stopPropagation())})})},"RadioTrigger")),Mj="RadioIndicator",_j=E.forwardRef(Xt(function(r,i){const{__scopeRadio:a,forceMount:c,...l}=r,u=Dl(Mj,a);return f.jsx(Fr,{present:c||u.checked,children:f.jsx(He.span,{"data-state":_d(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i})})},"RadioIndicator")),Dj="RadioBubbleInput",Ij=E.forwardRef(Xt(function({__scopeRadio:r,onClick:i,...a},c){const{control:l,checked:u,required:d,disabled:m,name:p,value:C,form:g,bubbleInput:b,setBubbleInput:x,userClick:v}=Dl(Dj,r),S=ke(c,x),w=Li(l),T=E.useRef(!1),j=E.useRef(u),R=E.useRef(v),O=E.useRef(null);E.useEffect(()=>{const D=b;if(!D)return;const _=window.HTMLInputElement.prototype,B=Object.getOwnPropertyDescriptor(_,"checked").set;if(!B)return;const H=j.current!==u;j.current=u;const z=v!==null&&v!==R.current;if(R.current=v,z)O.current=H?null:v,H&&B.call(D,u),D.dispatchEvent(new Event("click",{bubbles:!v.hasConsumerStoppedPropagation}));else if(H){const $=O.current;O.current=null;const X=u&&$!==null;T.current=!0,B.call(D,u),D.dispatchEvent(new Event("click",{bubbles:!(X&&$.hasConsumerStoppedPropagation)})),T.current=!1}},[b,u,v]);const M=E.useRef(u);return f.jsx(He.input,{type:"radio","aria-hidden":!0,defaultChecked:M.current,required:d,disabled:m,name:p,value:C,form:g,...a,tabIndex:-1,ref:S,onClick:Ce(i,D=>{T.current&&D.stopPropagation()}),style:{...a.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function Ay(t){return typeof t=="function"}Xt(Ay,"isFunction");function _d(t){return t?"checked":"unchecked"}Xt(_d,"getState");var kj=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Dd="RadioGroup",[Lj,LM]=Tn(Dd,[xy,Ty]),Ry=xy(),Il=Ty(),[zj,Bj]=Lj(Dd),Hj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,name:c,form:l,defaultValue:u,value:d,required:m=!1,disabled:p=!1,orientation:C,dir:g,loop:b=!0,onValueChange:x,...v}=r,S=Ry(a),w=Ii(g),[T,j]=fr({prop:d,defaultProp:u??null,onChange:x,caller:Dd}),[R,O]=E.useState(null),M=ke(i,O),D=E.useRef(T);return E.useEffect(()=>{const _=l?R?.ownerDocument.getElementById(l):R?.closest("form");if(_ instanceof HTMLFormElement){const I=Xt(()=>j(D.current),"reset");return _.addEventListener("reset",I),()=>_.removeEventListener("reset",I)}},[R,l,j]),f.jsx(zj,{scope:a,name:c,form:l,required:m,disabled:p,value:T,onValueChange:j,children:f.jsx(xj,{asChild:!0,...S,orientation:C,dir:w,loop:b,children:f.jsx(He.div,{role:"radiogroup","aria-required":m,"aria-orientation":C,"data-disabled":p?"":void 0,dir:w,...v,ref:M})})})},"RadioGroup")),Pj="RadioGroupItemProvider",Uj="RadioGroupItemTrigger";function Oy(t){const{__scopeRadioGroup:r,value:i,disabled:a,children:c,internal_do_not_use_render:l}=t,u=Bj(Pj,r),d=Il(r),m=u.disabled||a;return f.jsx(jy,{...d,checked:u.value===i,disabled:m,required:u.required,name:u.name,form:u.form,value:i,onCheck:()=>u.onValueChange(i),internal_do_not_use_render:l,children:c})}Xt(Oy,"RadioGroupItemProvider");var $j=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Ry(a),u=Il(a),{checked:d,disabled:m}=Dl(Uj,u.__scopeRadio),p=E.useRef(null),C=ke(i,p),g=E.useRef(!1);return E.useEffect(()=>{const b=Xt(v=>{kj.includes(v.key)&&(g.current=!0)},"handleKeyDown"),x=Xt(()=>g.current=!1,"handleKeyUp");return document.addEventListener("keydown",b),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",b),document.removeEventListener("keyup",x)}},[]),f.jsx(Cj,{asChild:!0,...l,focusable:!m,active:d,children:f.jsx(Nj,{...u,...c,ref:C,onKeyDown:Ce(c.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onFocus:Ce(c.onFocus,()=>{g.current&&p.current?.click()})})})},"RadioGroupItemTrigger")),Gj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,value:c,disabled:l,...u}=r;return f.jsx(Oy,{__scopeRadioGroup:a,value:c,disabled:l,internal_do_not_use_render:({isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx($j,{...u,ref:i,__scopeRadioGroup:a}),d&&f.jsx(Vj,{__scopeRadioGroup:a})]})})},"RadioGroupItem")),Vj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Il(a);return f.jsx(Ij,{...l,...c,ref:i})},"RadioGroupItemBubbleInput")),qj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Il(a);return f.jsx(_j,{...l,...c,ref:i})},"RadioGroupIndicator")),Yj=Object.defineProperty,$e=(t,r)=>Yj(t,"name",{value:r,configurable:!0}),Ny={ItemAligned:"item-aligned",Popper:"popper"},Xj={RTL:"rtl"},Kj=[" ","Enter","ArrowUp","ArrowDown"],Fj=[" ","Enter"],Aa="Select",[kl,Ll,Qj]=il(Aa),[zo,zM]=Tn(Aa,[Qj,Nl]),Id=Nl(),[Zj,Jr]=zo(Aa),[Wj,Jj]=zo(Aa);function My(t){const{__scopeSelect:r,children:i,open:a,defaultOpen:c,onOpenChange:l,value:u,defaultValue:d,onValueChange:m,dir:p,name:C,autoComplete:g,disabled:b,required:x,form:v,internal_do_not_use_render:S}=t,w=Id(r),[T,j]=E.useState(null),[R,O]=E.useState(null),[M,D]=E.useState(!1),_=Ii(p),[I,B]=fr({prop:a,defaultProp:c??!1,onChange:l,caller:Aa}),[H,z]=fr({prop:u,defaultProp:d,onChange:m,caller:Aa}),$=E.useRef(null),X=E.useRef(!1),[G,te]=E.useState(null),V=$e(ae=>{te({value:ae,hasConsumerStoppedPropagation:X.current}),z(ae)},"handleUserSelect"),Y=E.useRef(H);E.useEffect(()=>{const ae=v?T?.ownerDocument.getElementById(v):T?.form;if(ae instanceof HTMLFormElement){const ge=$e(()=>z(Y.current),"reset");return ae.addEventListener("reset",ge),()=>ae.removeEventListener("reset",ge)}},[v,T,z]);const L=T?!!v||!!T.closest("form"):!0,[P,N]=E.useState(new Set),U=mr(),J=Array.from(P).map(ae=>ae.props.value).join(";"),Q=E.useCallback(ae=>{N(ge=>new Set(ge).add(ae))},[]),le=E.useCallback(ae=>{N(ge=>{const je=new Set(ge);return je.delete(ae),je})},[]),re={required:x,trigger:T,onTriggerChange:j,valueNode:R,onValueNodeChange:O,valueNodeHasChildren:M,onValueNodeHasChildrenChange:D,contentId:U,value:H,onValueChange:z,hasConsumerStoppedPropagationRef:X,userSelection:G,onUserSelect:V,open:I,onOpenChange:B,dir:_,triggerPointerDownPosRef:$,disabled:b,name:C,autoComplete:g,form:v,nativeOptions:P,nativeSelectKey:J,isFormControl:L};return f.jsx(cy,{...w,children:f.jsx(Zj,{scope:r,...re,children:f.jsx(kl.Provider,{scope:r,children:f.jsx(Wj,{scope:r,onNativeOptionAdd:Q,onNativeOptionRemove:le,children:Hy(S)?S(re):i})})})})}$e(My,"SelectProvider");var e2=$e(t=>{const{__scopeSelect:r,children:i,...a}=t;return f.jsx(My,{__scopeSelect:r,...a,internal_do_not_use_render:({isFormControl:c})=>f.jsxs(f.Fragment,{children:[i,c?f.jsx(M2,{__scopeSelect:r}):null]})})},"Select"),t2="SelectTrigger",n2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,disabled:c=!1,...l}=r,u=Id(a),d=Jr(t2,a),m=d.disabled||c,p=ke(i,d.onTriggerChange),C=Ll(a),g=E.useRef("touch"),[b,x,v]=zd(w=>{const T=C().filter(O=>!O.disabled),j=T.find(O=>O.value===d.value),R=Bd(T,w,j);R!==void 0&&d.onUserSelect(R.value)}),S=$e(w=>{m||(d.onOpenChange(!0),v()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})},"handleOpen");return f.jsx(uy,{asChild:!0,...u,children:f.jsx(He.button,{type:"button",role:"combobox","aria-controls":d.open?d.contentId:void 0,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":Hi(d.value)?"":void 0,...l,ref:p,onClick:Ce(l.onClick,w=>{w.currentTarget.focus(),g.current!=="mouse"&&S(w)}),onPointerDown:Ce(l.onPointerDown,w=>{g.current=w.pointerType;const T=w.target;T.hasPointerCapture(w.pointerId)&&T.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(S(w),w.preventDefault())}),onKeyDown:Ce(l.onKeyDown,w=>{const T=b.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&(d.hasConsumerStoppedPropagationRef.current=w.isPropagationStopped(),x(w.key)),!(T&&w.key===" ")&&Kj.includes(w.key)&&(S(),w.preventDefault())})})})},"SelectTrigger")),r2="SelectValue",o2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,className:c,style:l,children:u,placeholder:d="",...m}=r,p=Jr(r2,a),{onValueNodeHasChildrenChange:C}=p,g=u!==void 0,b=ke(i,p.onValueNodeChange);lt(()=>{C(g)},[C,g]);const x=Hi(p.value);return f.jsx(He.span,{...m,asChild:x?!1:m.asChild,ref:b,style:{pointerEvents:"none"},children:f.jsx(E.Fragment,{children:x?d:u},x?"placeholder":"value")})},"SelectValue")),a2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,children:c,...l}=r;return f.jsx(He.span,{"aria-hidden":!0,...l,ref:i,children:c||"▼"})},"SelectIcon")),i2="SelectPortal",[s2,l2]=zo(i2,{forceMount:void 0}),c2=$e(t=>{const{__scopeSelect:r,forceMount:i,...a}=t;return f.jsx(s2,{scope:t.__scopeSelect,forceMount:i,children:f.jsx(ed,{asChild:!0,...a})})},"SelectPortal"),Bo="SelectContent",u2=E.forwardRef($e(function(r,i){const a=l2(Bo,r.__scopeSelect),{forceMount:c=a.forceMount,...l}=r,u=Jr(Bo,r.__scopeSelect),[d,m]=E.useState();return lt(()=>{m(new DocumentFragment)},[]),f.jsx(Fr,{present:c||u.open,children:({present:p})=>p?f.jsx(h2,{...l,ref:i}):f.jsx(d2,{...l,fragment:d})})},"SelectContent")),d2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,children:c,fragment:l}=r;return l?Yr.createPortal(f.jsx(_y,{scope:a,children:f.jsx(kl.Slot,{scope:a,children:f.jsx("div",{ref:i,children:c})})}),l):null},"SelectContentFragment")),Pn=10,[_y,Ho]=zo(Bo),f2=dr("SelectContent.RemoveScroll"),h2=E.forwardRef($e(function(r,i){const{__scopeSelect:a}=r,{position:c=Ny.ItemAligned,onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:b,collisionBoundary:x,collisionPadding:v,sticky:S,hideWhenDetached:w,avoidCollisions:T,...j}=r,R=Jr(Bo,a),[O,M]=E.useState(null),[D,_]=E.useState(null),I=ke(i,M),[B,H]=E.useState(null),[z,$]=E.useState(null),X=Ll(a),[G,te]=E.useState(!1),V=E.useRef(!1),Y=E.useRef(!1),L=E.useRef(!1);E.useEffect(()=>{if(O)return Og(O)},[O]),dl();const P=E.useCallback(de=>{const[Me,...De]=X().map(Se=>Se.ref.current),[we]=De.slice(-1),xe=document.activeElement;for(const Se of de)if(Se===xe||(Se?.scrollIntoView({block:"nearest"}),Se===Me&&D&&(D.scrollTop=0),Se===we&&D&&(D.scrollTop=D.scrollHeight),Se?.focus(),document.activeElement!==xe))return},[X,D]),N=E.useCallback(()=>P([B,O]),[P,B,O]);E.useEffect(()=>{G&&N()},[G,N]);const{onOpenChange:U,triggerPointerDownPosRef:J}=R;E.useEffect(()=>{if(O){let de={x:0,y:0};const Me=$e(we=>{de={x:Math.abs(Math.round(we.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(we.pageY)-(J.current?.y??0))}},"handlePointerMove"),De=$e(we=>{de.x<=10&&de.y<=10?we.preventDefault():we.composedPath().includes(O)||U(!1),document.removeEventListener("pointermove",Me),J.current=null},"handlePointerUp");return J.current!==null&&(document.addEventListener("pointermove",Me),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Me),document.removeEventListener("pointerup",De,{capture:!0})}}},[O,U,J]),E.useEffect(()=>{const de=$e(()=>U(!1),"close");return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[U]);const[Q,le]=zd(de=>{const Me=X().filter(xe=>!xe.disabled),De=Me.find(xe=>xe.ref.current===document.activeElement),we=Bd(Me,de,De);we&&setTimeout(()=>we.ref.current?.focus())}),re=E.useCallback((de,Me,De)=>{const we=!Y.current;we&&(Y.current=!0);const xe=!V.current&&!De;R.value!==void 0&&R.value===Me||xe?(H(de),xe&&(V.current=!0)):we&&H(de)},[R.value]),ae=E.useCallback(()=>O?.focus(),[O]),ge=E.useCallback((de,Me,De)=>{if(!de)return;const we=!L.current;we&&(L.current=!0);const xe=!V.current&&!De;(R.value!==void 0&&R.value===Me||xe||we)&&$(de)},[R.value]),je=c===Ny.Popper?Dy:m2,ye=je===Dy?{side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:b,collisionBoundary:x,collisionPadding:v,sticky:S,hideWhenDetached:w,avoidCollisions:T}:{};return f.jsx(_y,{scope:a,content:O,viewport:D,onViewportChange:_,itemRefCallback:re,selectedItem:B,onItemLeave:ae,itemTextRefCallback:ge,focusSelectedItem:N,selectedItemText:z,position:c,isPositioned:G,searchRef:Q,children:f.jsx(sd,{as:f2,allowPinchZoom:!0,children:f.jsx(og,{asChild:!0,trapped:R.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ce(l,de=>{R.trigger?.focus({preventScroll:!0}),de.preventDefault()}),children:f.jsx(Yu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:f.jsx(je,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:de=>de.preventDefault(),...j,...ye,onPlaced:()=>te(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ce(j.onKeyDown,de=>{const Me=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!Me&&de.key.length===1&&le(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let we=X().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(de.key)&&(we=we.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const xe=de.target,Se=we.indexOf(xe);we=we.slice(Se+1)}setTimeout(()=>P(we)),de.preventDefault()}})})})})})})},"SelectContentImpl")),m2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,onPlaced:c,...l}=r,u=Jr(Bo,a),d=Ho(Bo,a),[m,p]=E.useState(null),[C,g]=E.useState(null),b=ke(i,g),x=Ll(a),v=E.useRef(!1),S=E.useRef(!0),{viewport:w,selectedItem:T,selectedItemText:j,focusSelectedItem:R}=d,O=E.useCallback(()=>{if(u.trigger&&u.valueNode&&m&&C&&w&&T&&j){const I=u.trigger.getBoundingClientRect(),B=C.getBoundingClientRect(),H=u.valueNode.getBoundingClientRect(),z=j.getBoundingClientRect();if(u.dir!==Xj.RTL){const De=z.left-B.left,we=H.left-De,xe=I.left-we,Se=I.width+xe,Bt=Math.max(Se,B.width),ht=window.innerWidth-Pn,he=ja(we,[Pn,Math.max(Pn,ht-Bt)]);m.style.minWidth=Se+"px",m.style.left=he+"px"}else{const De=B.right-z.right,we=window.innerWidth-H.right-De,xe=window.innerWidth-I.right-we,Se=I.width+xe,Bt=Math.max(Se,B.width),ht=window.innerWidth-Pn,he=ja(we,[Pn,Math.max(Pn,ht-Bt)]);m.style.minWidth=Se+"px",m.style.right=he+"px"}const $=x(),X=window.innerHeight-Pn*2,G=w.scrollHeight,te=window.getComputedStyle(C),V=parseInt(te.borderTopWidth,10),Y=parseInt(te.paddingTop,10),L=parseInt(te.borderBottomWidth,10),P=parseInt(te.paddingBottom,10),N=V+Y+G+P+L,U=Math.min(T.offsetHeight*5,N),J=window.getComputedStyle(w),Q=parseInt(J.paddingTop,10),le=parseInt(J.paddingBottom,10),re=I.top+I.height/2-Pn,ae=X-re,ge=T.offsetHeight/2,je=T.offsetTop+ge,ye=V+Y+je,de=N-ye;if(ye<=re){const De=$.length>0&&T===$[$.length-1].ref.current;m.style.bottom="0px";const we=C.clientHeight-w.offsetTop-w.offsetHeight,xe=Math.max(ae,ge+(De?le:0)+we+L),Se=ye+xe;m.style.height=Se+"px"}else{const De=$.length>0&&T===$[0].ref.current;m.style.top="0px";const xe=Math.max(re,V+w.offsetTop+(De?Q:0)+ge)+de;m.style.height=xe+"px",w.scrollTop=ye-re+w.offsetTop}m.style.margin=`${Pn}px 0`,m.style.minHeight=U+"px",m.style.maxHeight=X+"px",c?.(),requestAnimationFrame(()=>v.current=!0)}},[x,u.trigger,u.valueNode,m,C,w,T,j,u.dir,c]);lt(()=>O(),[O]);const[M,D]=E.useState();lt(()=>{C&&D(window.getComputedStyle(C).zIndex)},[C]);const _=E.useCallback(I=>{I&&S.current===!0&&(O(),R?.(),S.current=!1)},[O,R]);return f.jsx(p2,{scope:a,contentWrapper:m,shouldExpandOnScrollRef:v,onScrollButtonChange:_,children:f.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx(He.div,{...l,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),Dy=E.forwardRef($e(function(r,i){const{__scopeSelect:a,align:c="start",collisionPadding:l=Pn,...u}=r,d=Id(a);return f.jsx(fy,{...d,...u,ref:i,align:c,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[p2,kd]=zo(Bo,{}),Iy="SelectViewport",g2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,nonce:c,...l}=r,u=Ho(Iy,a),d=kd(Iy,a),m=ke(i,u.onViewportChange),p=E.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),f.jsx(kl.Slot,{scope:a,children:f.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ce(l.onScroll,C=>{const g=C.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:x}=d;if(x?.current&&b){const v=Math.abs(p.current-g.scrollTop);if(v>0){const S=window.innerHeight-Pn*2,w=parseFloat(b.style.minHeight),T=parseFloat(b.style.height),j=Math.max(w,T);if(j<S){const R=j+v,O=Math.min(S,R),M=R-O;b.style.height=O+"px",b.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,b.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),y2="SelectGroup",[b2,x2]=zo(y2),v2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,...c}=r,l=mr();return f.jsx(b2,{scope:a,id:l,children:f.jsx(He.div,{role:"group","aria-labelledby":l,...c,ref:i})})},"SelectGroup")),S2="SelectLabel",C2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,...c}=r,l=x2(S2,a);return f.jsx(He.div,{id:l.id,...c,ref:i})},"SelectLabel")),Ld="SelectItem",[w2,ky]=zo(Ld),E2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,value:c,disabled:l=!1,textValue:u,...d}=r,m=Jr(Ld,a),p=Ho(Ld,a),C=m.value===c,[g,b]=E.useState(u??""),[x,v]=E.useState(!1),S=Hn(O=>p.itemRefCallback?.(O,c,l)),w=ke(i,S),T=mr(),j=E.useRef("touch");function R(O){m.hasConsumerStoppedPropagationRef.current=O.isPropagationStopped(),m.onUserSelect(c),m.onOpenChange(!1)}return $e(R,"handleSelect"),f.jsx(w2,{scope:a,value:c,disabled:l,textId:T,isSelected:C,onItemTextChange:E.useCallback(O=>{b(M=>M||(O?.textContent??"").trim())},[]),children:f.jsx(kl.ItemSlot,{scope:a,value:c,disabled:l,textValue:g,children:f.jsx(He.div,{role:"option","aria-labelledby":T,"data-highlighted":x?"":void 0,"aria-selected":C&&x,"data-state":C?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:w,onFocus:Ce(d.onFocus,()=>v(!0)),onBlur:Ce(d.onBlur,()=>v(!1)),onClick:Ce(d.onClick,O=>{l||j.current!=="mouse"&&R(O)}),onPointerUp:Ce(d.onPointerUp,O=>{l||j.current==="mouse"&&R(O)}),onPointerDown:Ce(d.onPointerDown,O=>{j.current=O.pointerType}),onPointerMove:Ce(d.onPointerMove,O=>{j.current=O.pointerType,l?p.onItemLeave?.():j.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(d.onPointerLeave,O=>{O.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:Ce(d.onKeyDown,O=>{l||O.target!==O.currentTarget||p.searchRef?.current!==""&&O.key===" "||(Fj.includes(O.key)&&R(O),O.key===" "&&O.preventDefault())})})})})},"SelectItem")),zl="SelectItemText",T2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,className:c,style:l,...u}=r,d=Jr(zl,a),m=Ho(zl,a),p=ky(zl,a),C=Jj(zl,a),[g,b]=E.useState(null),x=Hn(R=>m.itemTextRefCallback?.(R,p.value,p.disabled)),v=ke(i,b,p.onItemTextChange,x),S=g?.textContent,w=E.useMemo(()=>f.jsx("option",{value:p.value,disabled:p.disabled,children:S},p.value),[p.disabled,p.value,S]),{onNativeOptionAdd:T,onNativeOptionRemove:j}=C;return lt(()=>(T(w),()=>j(w)),[T,j,w]),f.jsxs(f.Fragment,{children:[f.jsx(He.span,{id:p.textId,...u,ref:v}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren&&!Hi(d.value)?Yr.createPortal(u.children,d.valueNode):null]})},"SelectItemText")),j2="SelectItemIndicator",A2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,...c}=r;return ky(j2,a).isSelected?f.jsx(He.span,{"aria-hidden":!0,...c,ref:i}):null},"SelectItemIndicator")),Ly="SelectScrollUpButton",R2=E.forwardRef($e(function(r,i){const a=Ho(Ly,r.__scopeSelect),c=kd(Ly,r.__scopeSelect),[l,u]=E.useState(!1),d=ke(i,c.onScrollButtonChange);return lt(()=>{if(a.viewport&&a.isPositioned){let m=function(){const C=p.scrollTop>0;u(C)};$e(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(By,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),zy="SelectScrollDownButton",O2=E.forwardRef($e(function(r,i){const a=Ho(zy,r.__scopeSelect),c=kd(zy,r.__scopeSelect),[l,u]=E.useState(!1),d=ke(i,c.onScrollButtonChange);return lt(()=>{if(a.viewport&&a.isPositioned){let m=function(){const C=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)<C;u(g)};$e(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(By,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),By=E.forwardRef($e(function(r,i){const{__scopeSelect:a,onAutoScroll:c,...l}=r,u=Ho("SelectScrollButton",a),d=E.useRef(null),m=Ll(a),p=E.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return E.useEffect(()=>()=>p(),[p]),lt(()=>{m().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[m]),f.jsx(He.div,{"aria-hidden":!0,...l,ref:i,style:{flexShrink:0,...l.style},onPointerDown:Ce(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(c,50))}),onPointerMove:Ce(l.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(c,50))}),onPointerLeave:Ce(l.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),N2="SelectBubbleInput",M2=E.forwardRef($e(function({__scopeSelect:r,...i},a){const c=Jr(N2,r),{value:l,onValueChange:u,required:d,disabled:m,name:p,autoComplete:C,form:g,userSelection:b}=c,{nativeOptions:x,nativeSelectKey:v}=c,S=E.useRef(null),w=ke(a,S),T=l??"",j=E.useRef(T),R=E.useRef(b),O=E.useRef(!1),M=Array.from(x).some(D=>(D.props.value??"")==="");return E.useEffect(()=>{const D=S.current;if(!D)return;const _=window.HTMLSelectElement.prototype,B=Object.getOwnPropertyDescriptor(_,"value").set,H=b!==null&&b!==R.current;R.current=b;const z=j.current!==T;j.current=T;const $=H&&z;if(H&&!z&&b.value!==T&&!b.hasConsumerStoppedPropagation&&B){O.current=!0;try{B.call(D,b.value),D.dispatchEvent(new Event("change",{bubbles:!0}))}finally{O.current=!1,B.call(D,T)}return}const X=$&&!b.hasConsumerStoppedPropagation;if(z&&B){const G=new Event("change",{bubbles:X});B.call(D,T),D.dispatchEvent(G)}},[T,b]),f.jsxs(He.select,{"aria-hidden":!0,required:d,tabIndex:-1,name:p,autoComplete:C,disabled:m,form:g,onChange:D=>{O.current||u(D.target.value)},...i,style:{...Np,...i.style},ref:w,defaultValue:T,children:[Hi(l)&&!M?f.jsx("option",{value:""}):null,Array.from(x)]},v)},"SelectBubbleInput"));function Hy(t){return typeof t=="function"}$e(Hy,"isFunction");function Hi(t){return t===""||t===void 0}$e(Hi,"shouldShowPlaceholder");function zd(t){const r=Hn(t),i=E.useRef(""),a=E.useRef(0),c=E.useCallback(u=>{const d=i.current+u;r(d);function m(p){i.current=p,window.clearTimeout(a.current),p!==""&&(a.current=window.setTimeout(()=>m(""),1e3))}$e(m,"updateSearch"),m(d)},[r]),l=E.useCallback(()=>{i.current="",window.clearTimeout(a.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(a.current),[]),[i,c,l]}$e(zd,"useTypeaheadSearch");function Bd(t,r,i){const c=r.length>1&&Array.from(r).every(p=>p===r[0])?r[0]:r,l=i?t.indexOf(i):-1;let u=Py(t,Math.max(l,0));c.length===1&&(u=u.filter(p=>p!==i));const m=u.find(p=>p.textValue.toLowerCase().startsWith(c.toLowerCase()));return m!==i?m:void 0}$e(Bd,"findNextItem");function Py(t,r){return t.map((i,a)=>t[(r+a)%t.length])}$e(Py,"wrapArray");var _2=Object.defineProperty,qe=(t,r)=>_2(t,"name",{value:r,configurable:!0}),Uy={Horizontal:"horizontal"},D2={LTR:"ltr"},$y=["PageUp","PageDown"],Gy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Vy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Pi="Slider",[Hd,I2,k2]=il(Pi),[Pd,BM]=Tn(Pi,[k2]),[L2,Ra]=Pd(Pi),z2=E.forwardRef(qe(function(r,i){const{name:a,min:c=0,max:l=100,step:u=1,orientation:d=Uy.Horizontal,disabled:m=!1,minStepsBetweenThumbs:p=0,preserveThumbOrder:C=!1,defaultValue:g=[c],value:b,onValueChange:x=qe(()=>{},"onValueChange"),onValueCommit:v=qe(()=>{},"onValueCommit"),inverted:S=!1,form:w,...T}=r,j=E.useRef(new Set),R=E.useRef(0),O=E.useRef(!1),[M,D]=E.useState(null),I=d===Uy.Horizontal?B2:H2,[B,H]=E.useState(null),z=ke(i,H),[$=[],X]=fr({prop:b,defaultProp:g,onChange:qe(N=>{[...j.current][R.current]?.focus({preventScroll:!0,focusVisible:O.current}),O.current=!1,x(N)},"onChange")}),G=E.useRef($),te=E.useRef($);E.useEffect(()=>{const N=w?B?.ownerDocument.getElementById(w):B?.closest("form");if(N instanceof HTMLFormElement){const U=qe(()=>X(te.current),"reset");return N.addEventListener("reset",U),()=>N.removeEventListener("reset",U)}},[B,w,X]);function V(N){const U=e0($,N);P(N,U)}qe(V,"handleSlideStart");function Y(N){P(N,R.current)}qe(Y,"handleSlideMove");function L(){String($)!==String(G.current)&&v($)}qe(L,"handleSlideEnd");function P(N,U,{commit:J}={commit:!1}){const Q=Gd(u),le=Ui(Math.round((N-c)/u)*u+c,Q),re=ja(le,[c,l]),ae=p*u;function ge(ye){const de=C?ja(re,[ye[U-1]===void 0?c:ye[U-1]+ae,ye[U+1]===void 0?l:ye[U+1]-ae]):re,Me=Wy(ye,de,U);return r0(Me,ae)?{nextValues:Me,changedIndex:C?U:Me.indexOf(de),hasChanged:String(Me)!==String(ye)}:null}qe(ge,"getNextValues");const je=ge($);je?.hasChanged&&D(je.nextValues),X((ye=[])=>{const de=ge(ye);return de?(R.current=de.changedIndex,de.hasChanged&&J&&v(de.nextValues),de.hasChanged?de.nextValues:ye):ye})}return qe(P,"updateValues"),f.jsx(L2,{scope:r.__scopeSlider,name:a,disabled:m,min:c,max:l,valueIndexToChangeRef:R,thumbs:j.current,values:$,orientation:d,form:w,userRequestedValues:M,children:f.jsx(Hd.Provider,{scope:r.__scopeSlider,children:f.jsx(Hd.Slot,{scope:r.__scopeSlider,children:f.jsx(I,{"aria-disabled":m,"data-disabled":m?"":void 0,...T,ref:z,onPointerDown:Ce(T.onPointerDown,()=>{m||(G.current=$,O.current=!1)}),min:c,max:l,inverted:S,onSlideStart:m?void 0:V,onSlideMove:m?void 0:Y,onSlideEnd:m?void 0:L,onHomeKeyDown:()=>{m||(O.current=!0,P(c,0,{commit:!0}))},onEndKeyDown:()=>{m||(O.current=!0,P(l,$.length-1,{commit:!0}))},onStepKeyDown:({event:N,direction:U})=>{if(!m){O.current=!0;const le=$y.includes(N.key)||N.shiftKey&&Gy.includes(N.key)?10:1,re=R.current,ae=$[re],ge=o0(ae,{min:c,step:u,direction:U,multiplier:le});P(ge,re,{commit:!0})}}})})})})},"Slider")),[qy,Yy]=Pd(Pi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),B2=E.forwardRef(qe(function(r,i){const{min:a,max:c,dir:l,inverted:u,onSlideStart:d,onSlideMove:m,onSlideEnd:p,onStepKeyDown:C,...g}=r,[b,x]=E.useState(null),v=ke(i,x),S=E.useRef(void 0),w=Ii(l),T=w===D2.LTR,j=T&&!u||!T&&u;function R(O){const M=S.current||b.getBoundingClientRect(),D=[0,M.width],I=Bl(D,j?[a,c]:[c,a]);return S.current=M,I(O-M.left)}return qe(R,"getValueFromPointer"),f.jsx(qy,{scope:r.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:f.jsx(Xy,{dir:w,"data-orientation":"horizontal",...g,ref:v,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:O=>{const M=R(O.clientX);d?.(M)},onSlideMove:O=>{const M=R(O.clientX);m?.(M)},onSlideEnd:()=>{S.current=void 0,p?.()},onStepKeyDown:O=>{const D=Vy[j?"from-left":"from-right"].includes(O.key);C?.({event:O,direction:D?-1:1})}})})},"SliderHorizontal")),H2=E.forwardRef(qe(function(r,i){const{min:a,max:c,inverted:l,onSlideStart:u,onSlideMove:d,onSlideEnd:m,onStepKeyDown:p,...C}=r,g=E.useRef(null),b=ke(i,g),x=E.useRef(void 0),v=!l;function S(w){const T=x.current||g.current.getBoundingClientRect(),j=[0,T.height],O=Bl(j,v?[c,a]:[a,c]);return x.current=T,O(w-T.top)}return qe(S,"getValueFromPointer"),f.jsx(qy,{scope:r.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:f.jsx(Xy,{"data-orientation":"vertical",...C,ref:b,style:{...C.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const T=S(w.clientY);u?.(T)},onSlideMove:w=>{const T=S(w.clientY);d?.(T)},onSlideEnd:()=>{x.current=void 0,m?.()},onStepKeyDown:w=>{const j=Vy[v?"from-bottom":"from-top"].includes(w.key);p?.({event:w,direction:j?-1:1})}})})},"SliderVertical")),Xy=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onHomeKeyDown:d,onEndKeyDown:m,onStepKeyDown:p,...C}=r,g=Ra(Pi,a);return f.jsx(He.span,{...C,ref:i,onKeyDown:Ce(r.onKeyDown,b=>{b.key==="Home"?(d(b),b.preventDefault()):b.key==="End"?(m(b),b.preventDefault()):$y.concat(Gy).includes(b.key)&&(p(b),b.preventDefault())}),onPointerDown:Ce(r.onPointerDown,b=>{const x=b.target;x.setPointerCapture(b.pointerId),b.preventDefault(),g.thumbs.has(x)?x.focus({preventScroll:!0,focusVisible:!1}):c(b)}),onPointerMove:Ce(r.onPointerMove,b=>{b.target.hasPointerCapture(b.pointerId)&&l(b)}),onPointerUp:Ce(r.onPointerUp,b=>{const x=b.target;x.hasPointerCapture(b.pointerId)&&(x.releasePointerCapture(b.pointerId),u(b))})})},"SliderImpl")),P2="SliderTrack",U2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ra(P2,a);return f.jsx(He.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...c,ref:i})},"SliderTrack")),Ky="SliderRange",$2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ra(Ky,a),u=Yy(Ky,a),d=E.useRef(null),m=ke(i,d),p=l.values.length,C=l.values.map(x=>$d(x,l.min,l.max)),g=p>1?Math.min(...C):0,b=100-Math.max(...C);return f.jsx(He.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...c,ref:m,style:{...r.style,[u.startEdge]:g+"%",[u.endEdge]:b+"%"}})},"SliderRange")),G2="SliderThumb",[V2,Fy]=Pd(G2),q2="SliderThumbProvider";function Qy(t){const{__scopeSlider:r,name:i,children:a,internal_do_not_use_render:c}=t,l=Ra(q2,r),u=I2(r),[d,m]=E.useState(null),p=E.useMemo(()=>d?u().findIndex(w=>w.ref.current===d):-1,[u,d]),C=Li(d),g=d?!!l.form||!!d.closest("form"):!0,b=l.values[p],x=i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),v=b===void 0?0:$d(b,l.min,l.max);E.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]);const S={value:b,name:x,form:l.form,isFormControl:g,index:p,thumb:d,onThumbChange:m,percent:v,size:C};return f.jsx(V2,{scope:r,...S,children:a0(c)?c(S):a})}qe(Qy,"SliderThumbProvider");var Ud="SliderThumbTrigger",Y2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ra(Ud,a),u=Yy(Ud,a),{index:d,value:m,percent:p,size:C,onThumbChange:g}=Fy(Ud,a),b=ke(i,g),x=Jy(d,l.values.length),v=C?.[u.size],S=v?t0(v,p,u.direction):0;return f.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${p}% + ${S}px)`},children:f.jsx(Hd.ItemSlot,{scope:a,children:f.jsx(He.span,{role:"slider","aria-label":r["aria-label"]||x,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...c,ref:b,style:m===void 0?{display:"none"}:r.style,onFocus:Ce(r.onFocus,()=>{l.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),X2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,name:c,...l}=r;return f.jsx(Qy,{__scopeSlider:a,name:c,internal_do_not_use_render:({index:u,isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx(Y2,{...l,ref:i,__scopeSlider:a}),d?f.jsx(K2,{__scopeSlider:a},u):null]})})},"SliderThumb")),Zy="SliderBubbleInput",K2=E.forwardRef(qe(function({__scopeSlider:r,onInput:i,...a},c){const{index:l,value:u,name:d,form:m}=Fy(Zy,r),{userRequestedValues:p}=Ra(Zy,r),C=E.useRef(null),g=ke(C,c),b=E.useRef(!1),x=E.useRef(u),v=E.useRef(p),S=E.useRef(p);return E.useEffect(()=>{const w=C.current;if(!w)return;const T=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(T,"value").set,O=x.current,M=O!==u;x.current=u;const D=p!==S.current;if(S.current=p,M&&R){const _=p!==v.current;v.current=p;const I=p?.[l],B=_&&(D&&I!==O||I===u);b.current=!B;const H=new Event("input",{bubbles:!0});R.call(w,u),w.dispatchEvent(H),b.current=!1}},[l,u,p]),f.jsx(He.input,{style:{display:"none"},name:d,form:m,...a,ref:g,defaultValue:u,onInput:Ce(i,w=>{b.current&&w.stopPropagation()})})},"SliderBubbleInput"));function Wy(t=[],r,i){const a=[...t];return a[i]=r,a.sort((c,l)=>c-l)}qe(Wy,"getNextSortedValues");function $d(t,r,i){const l=100/(i-r)*(t-r);return ja(l,[0,100])}qe($d,"convertValueToPercentage");function Jy(t,r){return r>2?`Value ${t+1} of ${r}`:r===2?["Minimum","Maximum"][t]:void 0}qe(Jy,"getLabel");function e0(t,r){if(t.length===1)return 0;const i=t.map(c=>Math.abs(c-r)),a=Math.min(...i);return i.indexOf(a)}qe(e0,"getClosestValueIndex");function t0(t,r,i){const a=t/2,l=Bl([0,50],[0,a]);return(a-l(r)*i)*i}qe(t0,"getThumbInBoundsOffset");function n0(t){return t.slice(0,-1).map((r,i)=>t[i+1]-r)}qe(n0,"getStepsBetweenValues");function r0(t,r){if(r>0){const i=n0(t);return Math.min(...i)>=r}return!0}qe(r0,"hasMinStepsBetweenValues");function Bl(t,r){return i=>{if(t[0]===t[1]||r[0]===r[1])return r[0];const a=(r[1]-r[0])/(t[1]-t[0]);return r[0]+a*(i-t[0])}}qe(Bl,"linearScale");function Gd(t){if(!Number.isFinite(t))return 0;const r=t.toString();if(r.includes("e")){const[a,c]=r.split("e"),l=a.split(".")[1]||"",u=Number(c);return Math.max(0,l.length-u)}const i=r.split(".")[1];return i?i.length:0}qe(Gd,"getDecimalCount");function Ui(t,r){const i=Math.pow(10,r);return Math.round(t*i)/i}qe(Ui,"roundValue");function o0(t,{min:r,step:i,direction:a,multiplier:c}){const l=Gd(i),u=(t-r)/i,d=Math.round(u),m=Ui(d*i+r,l)===Ui(t,l);let p;return m?p=d+c*a:a>0?p=Math.ceil(u):p=Math.floor(u),Ui(p*i+r,l)}qe(o0,"getNextStepValue");function a0(t){return typeof t=="function"}qe(a0,"isFunction");var F2=Object.defineProperty,vt=(t,r)=>F2(t,"name",{value:r,configurable:!0}),[Vd,HM]=Tn("Tooltip",[Nl]),Hl=Nl(),Q2="TooltipProvider",Z2=700,qd="tooltip.open",[W2,Yd]=Vd(Q2),J2=vt(t=>{const{__scopeTooltip:r,delayDuration:i=Z2,skipDelayDuration:a=300,disableHoverableContent:c=!1,children:l}=t,u=E.useRef(!0),d=E.useRef(!1),m=E.useRef(0);return E.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),f.jsx(W2,{scope:r,isOpenDelayedRef:u,delayDuration:i,onOpen:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),u.current=!1)},[a]),onClose:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,a))},[a]),isPointerInTransitRef:d,onPointerInTransitChange:E.useCallback(p=>{d.current=p},[]),disableHoverableContent:c,children:l})},"TooltipProvider"),Xd="Tooltip",[eA,$i]=Vd(Xd),tA=vt(t=>{const{__scopeTooltip:r,children:i,open:a,defaultOpen:c,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=t,m=Yd(Xd,t.__scopeTooltip),p=Hl(r),[C,g]=E.useState(null),[b,x]=E.useState(void 0),v=mr(),S=E.useRef(0),w=u??m.disableHoverableContent,T=d??m.delayDuration,j=E.useRef(!1),[R,O]=fr({prop:a,defaultProp:c??!1,onChange:vt(H=>{H?(m.onOpen(),document.dispatchEvent(new CustomEvent(qd))):m.onClose(),l?.(H)},"onChange"),caller:Xd}),M=E.useMemo(()=>R?j.current?"delayed-open":"instant-open":"closed",[R]),D=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,j.current=!1,O(!0)},[O]),_=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,O(!1)},[O]),I=E.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{j.current=!0,O(!0),S.current=0},T)},[T,O]);E.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const B=b??v;return f.jsx(cy,{...p,children:f.jsx(eA,{scope:r,contentId:B,setContentId:x,open:R,stateAttribute:M,trigger:C,onTriggerChange:g,onTriggerEnter:E.useCallback(()=>{m.isOpenDelayedRef.current?I():D()},[m.isOpenDelayedRef,I,D]),onTriggerLeave:E.useCallback(()=>{w?_():(window.clearTimeout(S.current),S.current=0)},[_,w]),onOpen:D,onClose:_,disableHoverableContent:w,children:i})})},"Tooltip"),i0="TooltipTrigger",nA=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,"aria-describedby":c,...l}=r,u=$i(i0,a),d=Yd(i0,a),m=Hl(a),p=E.useRef(null),C=ke(i,p,u.onTriggerChange),g=E.useRef(!1),b=E.useRef(!1),x=E.useCallback(()=>g.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),f.jsx(uy,{asChild:!0,...m,children:f.jsx(He.button,{"aria-describedby":u.open?p0(c,u.contentId):c,"data-state":u.stateAttribute,...l,ref:C,onPointerMove:Ce(r.onPointerMove,v=>{v.pointerType!=="touch"&&!b.current&&!d.isPointerInTransitRef.current&&(u.onTriggerEnter(),b.current=!0)}),onPointerLeave:Ce(r.onPointerLeave,()=>{u.onTriggerLeave(),b.current=!1}),onPointerDown:Ce(r.onPointerDown,()=>{u.open&&u.onClose(),g.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Ce(r.onFocus,()=>{g.current||u.onOpen()}),onBlur:Ce(r.onBlur,u.onClose),onClick:Ce(r.onClick,u.onClose)})})},"TooltipTrigger")),s0="TooltipPortal",[rA,oA]=Vd(s0,{forceMount:void 0}),aA=vt(t=>{const{__scopeTooltip:r,forceMount:i,children:a,container:c}=t,l=$i(s0,r);return f.jsx(rA,{scope:r,forceMount:i,children:f.jsx(Fr,{present:i||l.open,children:f.jsx(ed,{asChild:!0,container:c,children:a})})})},"TooltipPortal"),Gi="TooltipContent",iA=E.forwardRef(vt(function(r,i){const a=oA(Gi,r.__scopeTooltip),{forceMount:c=a.forceMount,side:l="top",...u}=r,d=$i(Gi,r.__scopeTooltip);return f.jsx(Fr,{present:c||d.open,children:d.disableHoverableContent?f.jsx(l0,{side:l,...u,ref:i}):f.jsx(sA,{side:l,...u,ref:i})})},"TooltipContent")),sA=E.forwardRef(vt(function(r,i){const a=$i(Gi,r.__scopeTooltip),c=Yd(Gi,r.__scopeTooltip),l=E.useRef(null),u=ke(i,l),[d,m]=E.useState(null),{trigger:p,onClose:C}=a,g=l.current,{onPointerInTransitChange:b}=c,x=E.useCallback(()=>{m(null),b(!1)},[b]),v=E.useCallback((S,w)=>{const T=S.currentTarget,j={x:S.clientX,y:S.clientY},R=c0(j,T.getBoundingClientRect()),O=u0(j,R),M=d0(w.getBoundingClientRect()),D=h0([...O,...M]);m(D),b(!0)},[b]);return E.useEffect(()=>()=>x(),[x]),E.useEffect(()=>{if(p&&g){const S=vt(T=>v(T,g),"handleTriggerLeave"),w=vt(T=>v(T,p),"handleContentLeave");return p.addEventListener("pointerleave",S),g.addEventListener("pointerleave",w),()=>{p.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",w)}}},[p,g,v,x]),E.useEffect(()=>{if(d){const S=vt(w=>{const T=w.target,j={x:w.clientX,y:w.clientY},R=p?.contains(T)||g?.contains(T),O=!f0(j,d);R?x():O&&(x(),C())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[p,g,d,C,x]),f.jsx(l0,{...r,ref:u})},"TooltipContentHoverable")),lA=Cp("TooltipContent"),l0=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,children:c,"aria-label":l,id:u,onEscapeKeyDown:d,onPointerDownOutside:m,...p}=r,C=$i(Gi,a),g=Hl(a),{onClose:b}=C,[x,v]=E.useState(null),S=ke(i,v);lg(x),E.useEffect(()=>(document.addEventListener(qd,b),()=>document.removeEventListener(qd,b)),[b]),E.useEffect(()=>{if(C.trigger){const T=vt(j=>{j.target instanceof Node&&j.target.contains(C.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",T,{capture:!0}),()=>window.removeEventListener("scroll",T,{capture:!0})}},[C.trigger,b]);const{setContentId:w}=C;return lt(()=>(w(u),()=>{w(void 0)}),[u,w]),f.jsx(Yu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:T=>T.preventDefault(),onDismiss:b,children:f.jsxs(fy,{"data-state":C.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:C.contentId,...g,...p,ref:S,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(lA,{children:c}),l?f.jsx(aw,{id:C.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl")),cA=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,...c}=r,l=Hl(a);return f.jsx(lj,{...l,...c,ref:i})},"TooltipArrow"));function c0(t,r){const i=Math.abs(r.top-t.y),a=Math.abs(r.bottom-t.y),c=Math.abs(r.right-t.x),l=Math.abs(r.left-t.x);switch(Math.min(i,a,c,l)){case l:return"left";case c:return"right";case i:return"top";case a:return"bottom";default:throw new Error("unreachable")}}vt(c0,"getExitSideFromRect");function u0(t,r,i=5){const a=[];switch(r){case"top":a.push({x:t.x-i,y:t.y+i},{x:t.x+i,y:t.y+i});break;case"bottom":a.push({x:t.x-i,y:t.y-i},{x:t.x+i,y:t.y-i});break;case"left":a.push({x:t.x+i,y:t.y-i},{x:t.x+i,y:t.y+i});break;case"right":a.push({x:t.x-i,y:t.y-i},{x:t.x-i,y:t.y+i});break}return a}vt(u0,"getPaddedExitPoints");function d0(t){const{top:r,right:i,bottom:a,left:c}=t;return[{x:c,y:r},{x:i,y:r},{x:i,y:a},{x:c,y:a}]}vt(d0,"getPointsFromRect");function f0(t,r){const{x:i,y:a}=t;let c=!1;for(let l=0,u=r.length-1;l<r.length;u=l++){const d=r[l],m=r[u],p=d.x,C=d.y,g=m.x,b=m.y;C>a!=b>a&&i<(g-p)*(a-C)/(b-C)+p&&(c=!c)}return c}vt(f0,"isPointInPolygon");function h0(t){const r=t.slice();return r.sort((i,a)=>i.x<a.x?-1:i.x>a.x?1:i.y<a.y?-1:i.y>a.y?1:0),m0(r)}vt(h0,"getHull");function m0(t){if(t.length<=1)return t.slice();const r=[];for(let a=0;a<t.length;a++){const c=t[a];for(;r.length>=2;){const l=r[r.length-1],u=r[r.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))r.pop();else break}r.push(c)}r.pop();const i=[];for(let a=t.length-1;a>=0;a--){const c=t[a];for(;i.length>=2;){const l=i[i.length-1],u=i[i.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))i.pop();else break}i.push(c)}return i.pop(),r.length===1&&i.length===1&&r[0].x===i[0].x&&r[0].y===i[0].y?r:r.concat(i)}vt(m0,"getHullPresorted");function p0(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}vt(p0,"concatAriaDescribedby");function uA({delayDuration:t=0,...r}){return f.jsx(J2,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function dA({...t}){return f.jsx(tA,{"data-slot":"tooltip",...t})}function fA({...t}){return f.jsx(nA,{"data-slot":"tooltip-trigger",...t})}function hA({container:t,className:r,sideOffset:i=0,children:a,...c}){return f.jsx(aA,{container:t,children:f.jsxs(iA,{"data-slot":"tooltip-content",sideOffset:i,className:Ve("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",r),...c,children:[a,f.jsx(cA,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function g0(t){return t?.closest(".rt-menu-root, .rt-main-menu-root, .ui-dialog")||document.fullscreenElement||document.getElementById("uni-answer-sheet")||document.body}function mA({children:t}){return f.jsx(uA,{delayDuration:400,children:t})}const pA={"portal-wrapper":"_portal-wrapper_1eief_1"},gA={footer:"_footer_yp9z4_1"};/**
92
92
  * @license lucide-react v1.58.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
- */const fA=t=>t?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
96
+ */const yA=t=>t?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
97
97
  * @license lucide-react v1.58.0 - ISC
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */function hA(t,r,i=[]){if(r==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:fA(t),size:24,node:r,...i.length>0?{aliases:i}:{}}}/**
101
+ */function bA(t,r,i=[]){if(r==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:yA(t),size:24,node:r,...i.length>0?{aliases:i}:{}}}/**
102
102
  * @license lucide-react v1.58.0 - ISC
103
103
  *
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
- */const mA=t=>{let r="",i=!1;for(const a of t){if(a==="-"||a==="_"||a<=" "){i=r.length>0;continue}r.length===0?r+=a.toLowerCase():r+=i?a.toUpperCase():a,i=!1}return r};/**
106
+ */const xA=t=>{let r="",i=!1;for(const a of t){if(a==="-"||a==="_"||a<=" "){i=r.length>0;continue}r.length===0?r+=a.toLowerCase():r+=i?a.toUpperCase():a,i=!1}return r};/**
107
107
  * @license lucide-react v1.58.0 - ISC
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
- */const pA=t=>{const r=mA(t);return r.charAt(0).toUpperCase()+r.slice(1)};/**
111
+ */const vA=t=>{const r=xA(t);return r.charAt(0).toUpperCase()+r.slice(1)};/**
112
112
  * @license lucide-react v1.58.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
- */const Pd=(...t)=>t.filter((r,i,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===i).join(" ").trim();/**
116
+ */const Kd=(...t)=>t.filter((r,i,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===i).join(" ").trim();/**
117
117
  * @license lucide-react v1.58.0 - ISC
118
118
  *
119
119
  * This source code is licensed under the ISC license.
120
120
  * See the LICENSE file in the root directory of this source tree.
121
- */const Do={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
121
+ */const Po={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
122
122
  * @license lucide-react v1.58.0 - ISC
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
126
- */function Ud(t){return t!=null}function gA(t,r={}){const i=r.attributeNames??{},a=b=>i[b]??b,c=t.size??t.width??Do.width,l=t.size??t.height??Do.height,u=t.aliases?.filter(b=>typeof b=="string"&&b.trim()!=="").map(b=>`lucide-${b}`)??[],d=[...t.name?[`lucide-${t.name}`]:[],...u],m=r.className?.split(" ").filter(Boolean)??[],p=r.includeDefaultClasses===!1?Pd(...m):Pd("lucide",...d,...m),C=r.absoluteStrokeWidth?Number(r.strokeWidth??Do["stroke-width"])*Number(t.size??t.width??Do.width)/Number(r.size??r.width??Do.width):r.strokeWidth??Do["stroke-width"];return["svg",{...Object.entries(Do).reduce((b,[v,x])=>(b[a(v)]=x,b),{}),..."color"in r&&r.color&&{[a("stroke")]:r.color},..."size"in r&&Ud(r.size)&&{[a("width")]:r.size,[a("height")]:r.size},..."width"in r&&Ud(r.width)&&{[a("width")]:r.width},..."height"in r&&Ud(r.height)&&{[a("height")]:r.height},[a("stroke-width")]:C,...p&&{[a("class")]:p},[a("viewBox")]:`0 0 ${c} ${l}`,...r.hasA11yProp===!1?{[a("aria-hidden")]:"true"}:{},..."attributes"in r&&r.attributes},t.node.map(b=>{const[v,x,S]=b,w=r.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...x}:x;return S?[v,w,S]:[v,w]})]}/**
126
+ */function Fd(t){return t!=null}function SA(t,r={}){const i=r.attributeNames??{},a=b=>i[b]??b,c=t.size??t.width??Po.width,l=t.size??t.height??Po.height,u=t.aliases?.filter(b=>typeof b=="string"&&b.trim()!=="").map(b=>`lucide-${b}`)??[],d=[...t.name?[`lucide-${t.name}`]:[],...u],m=r.className?.split(" ").filter(Boolean)??[],p=r.includeDefaultClasses===!1?Kd(...m):Kd("lucide",...d,...m),C=r.absoluteStrokeWidth?Number(r.strokeWidth??Po["stroke-width"])*Number(t.size??t.width??Po.width)/Number(r.size??r.width??Po.width):r.strokeWidth??Po["stroke-width"];return["svg",{...Object.entries(Po).reduce((b,[x,v])=>(b[a(x)]=v,b),{}),..."color"in r&&r.color&&{[a("stroke")]:r.color},..."size"in r&&Fd(r.size)&&{[a("width")]:r.size,[a("height")]:r.size},..."width"in r&&Fd(r.width)&&{[a("width")]:r.width},..."height"in r&&Fd(r.height)&&{[a("height")]:r.height},[a("stroke-width")]:C,...p&&{[a("class")]:p},[a("viewBox")]:`0 0 ${c} ${l}`,...r.hasA11yProp===!1?{[a("aria-hidden")]:"true"}:{},..."attributes"in r&&r.attributes},t.node.map(b=>{const[x,v,S]=b,w=r.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...v}:v;return S?[x,w,S]:[x,w]})]}/**
127
127
  * @license lucide-react v1.58.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
- */function yA(t,r={}){return gA(t,{...r,attributeNames:{...r.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
131
+ */function CA(t,r={}){return SA(t,{...r,attributeNames:{...r.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
132
132
  * @license lucide-react v1.58.0 - ISC
133
133
  *
134
134
  * This source code is licensed under the ISC license.
135
135
  * See the LICENSE file in the root directory of this source tree.
136
- */const bA=t=>{for(const r in t)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},xA=E.createContext({}),vA=()=>E.useContext(xA),SA=E.forwardRef(({color:t,size:r,width:i,height:a,strokeWidth:c,absoluteStrokeWidth:l,nonScalingStroke:u,className:d="",children:m,iconNode:p=[],icon:C={node:p,aliases:[],size:24},...g},b)=>{const{size:v=24,strokeWidth:x=2,absoluteStrokeWidth:S=!1,nonScalingStroke:w=!1,color:T="currentColor",className:j=""}=vA()??{},R=!!m||bA(g),[O,M,D=[]]=yA(C,{color:t??T,width:i??r??v,height:a??r??v,strokeWidth:c??x,absoluteStrokeWidth:l??S,nonScalingStroke:u??w,className:Pd(j,d),hasA11yProp:R,attributes:g});return E.createElement(O,{ref:b,...M},[...D.map(([_,I])=>E.createElement(_,I)),...Array.isArray(m)?m:[m]])});/**
136
+ */const wA=t=>{for(const r in t)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},EA=E.createContext({}),TA=()=>E.useContext(EA),jA=E.forwardRef(({color:t,size:r,width:i,height:a,strokeWidth:c,absoluteStrokeWidth:l,nonScalingStroke:u,className:d="",children:m,iconNode:p=[],icon:C={node:p,aliases:[],size:24},...g},b)=>{const{size:x=24,strokeWidth:v=2,absoluteStrokeWidth:S=!1,nonScalingStroke:w=!1,color:T="currentColor",className:j=""}=TA()??{},R=!!m||wA(g),[O,M,D=[]]=CA(C,{color:t??T,width:i??r??x,height:a??r??x,strokeWidth:c??v,absoluteStrokeWidth:l??S,nonScalingStroke:u??w,className:Kd(j,d),hasA11yProp:R,attributes:g});return E.createElement(O,{ref:b,...M},[...D.map(([_,I])=>E.createElement(_,I)),...Array.isArray(m)?m:[m]])});/**
137
137
  * @license lucide-react v1.58.0 - ISC
138
138
  *
139
139
  * This source code is licensed under the ISC license.
140
140
  * See the LICENSE file in the root directory of this source tree.
141
- */function Ln(t,r=[],i=[]){const a=typeof t=="string"?hA(t,r,i):t,c=E.forwardRef(({className:l,...u},d)=>E.createElement(SA,{ref:d,icon:a,className:l,...u}));return a.name&&(c.displayName=pA(a.name)),c}/**
141
+ */function Un(t,r=[],i=[]){const a=typeof t=="string"?bA(t,r,i):t,c=E.forwardRef(({className:l,...u},d)=>E.createElement(jA,{ref:d,icon:a,className:l,...u}));return a.name&&(c.displayName=vA(a.name)),c}/**
142
142
  * @license lucide-react v1.58.0 - ISC
143
143
  *
144
144
  * This source code is licensed under the ISC license.
145
145
  * See the LICENSE file in the root directory of this source tree.
146
- */const u0={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};u0.node;const d0=Ln(u0);/**
146
+ */const y0={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};y0.node;const b0=Un(y0);/**
147
147
  * @license lucide-react v1.58.0 - ISC
148
148
  *
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
- */const f0={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};f0.node;const h0=Ln(f0);/**
151
+ */const x0={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};x0.node;const v0=Un(x0);/**
152
152
  * @license lucide-react v1.58.0 - ISC
153
153
  *
154
154
  * This source code is licensed under the ISC license.
155
155
  * See the LICENSE file in the root directory of this source tree.
156
- */const m0={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};m0.node;const CA=Ln(m0);/**
156
+ */const S0={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};S0.node;const AA=Un(S0);/**
157
157
  * @license lucide-react v1.58.0 - ISC
158
158
  *
159
159
  * This source code is licensed under the ISC license.
160
160
  * See the LICENSE file in the root directory of this source tree.
161
- */const p0={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};p0.node;const wA=Ln(p0);/**
161
+ */const C0={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};C0.node;const RA=Un(C0);/**
162
162
  * @license lucide-react v1.58.0 - ISC
163
163
  *
164
164
  * This source code is licensed under the ISC license.
165
165
  * See the LICENSE file in the root directory of this source tree.
166
- */const g0={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};g0.node;const EA=Ln(g0);/**
166
+ */const w0={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};w0.node;const OA=Un(w0);/**
167
167
  * @license lucide-react v1.58.0 - ISC
168
168
  *
169
169
  * This source code is licensed under the ISC license.
170
170
  * See the LICENSE file in the root directory of this source tree.
171
- */const y0={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]};y0.node;const TA=Ln(y0);/**
171
+ */const E0={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]};E0.node;const NA=Un(E0);/**
172
172
  * @license lucide-react v1.58.0 - ISC
173
173
  *
174
174
  * This source code is licensed under the ISC license.
175
175
  * See the LICENSE file in the root directory of this source tree.
176
- */const b0={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]};b0.node;const jA=Ln(b0);/**
176
+ */const T0={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]};T0.node;const MA=Un(T0);/**
177
177
  * @license lucide-react v1.58.0 - ISC
178
178
  *
179
179
  * This source code is licensed under the ISC license.
180
180
  * See the LICENSE file in the root directory of this source tree.
181
- */const x0={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};x0.node;const AA=Ln(x0);/**
181
+ */const j0={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};j0.node;const _A=Un(j0);/**
182
182
  * @license lucide-react v1.58.0 - ISC
183
183
  *
184
184
  * This source code is licensed under the ISC license.
185
185
  * See the LICENSE file in the root directory of this source tree.
186
- */const v0={name:"panels-top-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],aliases:["layout"]};v0.node;const RA=Ln(v0);/**
186
+ */const A0={name:"panels-top-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],aliases:["layout"]};A0.node;const DA=Un(A0);/**
187
187
  * @license lucide-react v1.58.0 - ISC
188
188
  *
189
189
  * This source code is licensed under the ISC license.
190
190
  * See the LICENSE file in the root directory of this source tree.
191
- */const S0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};S0.node;const OA=Ln(S0);/**
191
+ */const R0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};R0.node;const IA=Un(R0);/**
192
192
  * @license lucide-react v1.58.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const C0={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};C0.node;const NA=Ln(C0),$d={"scale-wrapper":"_scale-wrapper_qmn4q_1",bar:"_bar_qmn4q_8",percent:"_percent_qmn4q_19"},w0={"press-wrapper":"_press-wrapper_1m46f_1",active:"_active_1m46f_8"};var Gd={exports:{}};/*!
196
+ */const O0={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};O0.node;const kA=Un(O0),Qd={"scale-wrapper":"_scale-wrapper_qmn4q_1",bar:"_bar_qmn4q_8",percent:"_percent_qmn4q_19"},N0={"press-wrapper":"_press-wrapper_1m46f_1",active:"_active_1m46f_8"};var Zd={exports:{}};/*!
197
197
  Copyright (c) 2018 Jed Watson.
198
198
  Licensed under the MIT License (MIT), see
199
199
  http://jedwatson.github.io/classnames
200
- */var E0;function MA(){return E0||(E0=1,(function(t){(function(){var r={}.hasOwnProperty;function i(){for(var l="",u=0;u<arguments.length;u++){var d=arguments[u];d&&(l=c(l,a(d)))}return l}function a(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return i.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var u="";for(var d in l)r.call(l,d)&&l[d]&&(u=c(u,d));return u}function c(l,u){return u?l?l+" "+u:l+u:l}t.exports?(i.default=i,t.exports=i):window.classNames=i})()})(Gd)),Gd.exports}var _A=MA();const T0=Dm(_A),j0=t=>{const{padding:r="",active:i=!1,className:a,...c}=t,l=E.useMemo(()=>{if(!r)return"unset";if(typeof r=="string")return r;if(typeof r=="number")return r+"px";if(Array.isArray(r))return r.map(u=>u+"px").join(" ")},[r]);return f.jsx("div",{...c,className:T0(a,w0["press-wrapper"],i?w0.active:""),style:{padding:l},children:t.children})};function A0({title:t,children:r}){const[i,a]=E.useState(null);return f.jsxs(iA,{children:[f.jsx(sA,{asChild:!0,children:f.jsx("span",{ref:a,className:"ui-tooltip-trigger",children:r})}),f.jsx(lA,{container:c0(i),className:"ui-tooltip",side:"top",sideOffset:6,children:t})]})}const DA={"icon-quanping":TA,"icon-quxiaoquanping":jA,"icon-shitudaohang":RA},R0=t=>{const{type:r,children:i,tooltip:a,...c}=t,l=DA[r];return a?f.jsx(A0,{title:a,children:f.jsx(j0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})}):f.jsx(j0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})};function IA({className:t,type:r,...i}){return f.jsx("input",{type:r,"data-slot":"input",className:Ve("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...i})}function kA({className:t,...r}){return f.jsx("textarea",{"data-slot":"textarea",className:Ve("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",t),...r})}const wa=E.forwardRef(function({className:r,controlSize:i,size:a,status:c,...l},u){return f.jsx(IA,{...l,ref:u,"aria-invalid":c==="error"||l["aria-invalid"],"data-control-size":i||(a==="small"?"compact":a),className:Ve("ui-control ui-input",r)})});function Ml({autoSize:t,className:r,...i}){const a=E.useRef(null);return E.useLayoutEffect(()=>{const c=a.current;if(!c||!t)return;const l=getComputedStyle(c),u=parseFloat(l.lineHeight)||20,d=parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)+2;c.style.height="0px",c.style.height=`${Math.max(t.minRows*u+d,Math.min(t.maxRows*u+d,c.scrollHeight+2))}px`},[i.value,t]),f.jsx(kA,{...i,ref:a,className:Ve("ui-control ui-textarea",r)})}function LA({...t}){return f.jsx(Qj,{"data-slot":"select",...t})}function zA({...t}){return f.jsx(p2,{"data-slot":"select-group",...t})}function BA({...t}){return f.jsx(Jj,{"data-slot":"select-value",...t})}function HA({className:t,size:r="default",children:i,...a}){return f.jsxs(Zj,{"data-slot":"select-trigger","data-size":r,className:Ve("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...a,children:[i,f.jsx(e2,{asChild:!0,children:f.jsx(h0,{className:"size-4 opacity-50"})})]})}function PA({container:t,className:r,children:i,position:a="item-aligned",align:c="center",...l}){return f.jsx(o2,{container:t,children:f.jsxs(a2,{"data-slot":"select-content",className:Ve("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:a,align:c,...l,children:[f.jsx(GA,{}),f.jsx(d2,{className:Ve("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:i}),f.jsx(VA,{})]})})}function UA({className:t,...r}){return f.jsx(y2,{"data-slot":"select-label",className:Ve("px-2 py-1.5 text-xs text-muted-foreground",t),...r})}function $A({className:t,children:r,...i}){return f.jsxs(x2,{"data-slot":"select-item",className:Ve("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(C2,{children:f.jsx(d0,{className:"size-4"})})}),f.jsx(v2,{children:r})]})}function GA({className:t,...r}){return f.jsx(w2,{"data-slot":"select-scroll-up-button",className:Ve("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(CA,{className:"size-4"})})}function VA({className:t,...r}){return f.jsx(E2,{"data-slot":"select-scroll-down-button",className:Ve("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(h0,{className:"size-4"})})}function Vd(t){return E.Children.toArray(t).flatMap(r=>E.isValidElement(r)?r.type===E.Fragment?Vd(r.props.children):r.type==="optgroup"?[{label:r.props.label,options:Vd(r.props.children)}]:[{value:String(r.props.value??r.props.children??""),label:r.props.children,disabled:r.props.disabled}]:[])}const _l="__empty_option__";function O0(t,r){return t.map((i,a)=>i.options?f.jsxs(zA,{children:[f.jsx(UA,{children:i.label}),O0(i.options,r)]},a):f.jsx($A,{value:String(i.value)||_l,disabled:i.disabled,"data-option-value":i.value,onKeyDown:c=>{c.key==="Enter"&&!i.disabled&&(c.preventDefault(),r(String(i.value)||_l))},children:i.label},String(i.value)))}function Ft({className:t,controlSize:r,size:i,children:a,options:c,value:l,onChange:u,disabled:d,...m}){const p=E.useRef(null),[C,g]=E.useState(!1),b=x=>{if(x){g(!0);return}const S=!!document.activeElement?.closest('[data-slot="select-content"]');Hr.flushSync(()=>g(!1)),S&&p.current?.focus({preventScroll:!0})},v=x=>{b(!1),u?.(x===_l?"":x)};return f.jsxs(LA,{value:l===void 0?void 0:String(l)||_l,onValueChange:v,disabled:d,open:C,onOpenChange:b,children:[f.jsx(HA,{...m,ref:p,className:Ve("ui-control ui-select",t),"data-value":l===void 0?"":String(l),"data-control-size":r||(i==="small"?"compact":i),children:f.jsx(BA,{})}),f.jsx(PA,{container:c0(p.current),position:"popper",align:"start",className:"ui-select-popup",onCloseAutoFocus:x=>x.preventDefault(),onEscapeKeyDown:x=>{x.preventDefault(),x.stopPropagation(),b(!1)},children:O0(c||Vd(a),v)})]})}const N0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,M0=Ym,qA=((t,r)=>i=>{var a;if(r?.variants==null)return M0(t,i?.class,i?.className);const{variants:c,defaultVariants:l}=r,u=Object.keys(c).map(p=>{const C=i?.[p],g=l?.[p];if(C===null)return null;const b=N0(C)||N0(g);return c[p][b]}),d=i&&Object.entries(i).reduce((p,C)=>{let[g,b]=C;return b===void 0||(p[g]=b),p},{}),m=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((p,C)=>{let{class:g,className:b,...v}=C;return Object.entries(v).every(x=>{let[S,w]=x;return Array.isArray(w)?w.includes({...l,...d}[S]):{...l,...d}[S]===w})?[...p,g,b]:p},[]);return M0(t,u,m,i?.class,i?.className)})("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function _0({className:t,variant:r="default",size:i="default",asChild:a=!1,...c}){const l=a?VC:"button";return f.jsx(l,{"data-slot":"button","data-variant":r,"data-size":i,className:Ve(qA({variant:r,size:i,className:t})),...c})}function ce({type:t="default",htmlType:r="button",size:i="middle",danger:a,loading:c,className:l,children:u,...d}){return f.jsxs(_0,{variant:t==="primary"?"default":t==="text"?"ghost":"outline",size:i==="small"?"xs":i==="large"?"lg":"sm",...d,type:r,disabled:d.disabled||c,"aria-busy":c||void 0,className:Ve("ui-button",a&&"ui-danger",l),children:[c&&f.jsx(EA,{className:"animate-spin","aria-hidden":"true"}),u]})}function YA({className:t,...r}){return f.jsx(zE,{"data-slot":"checkbox",className:Ve("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",t),...r,children:f.jsx(HE,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(d0,{className:"size-3.5"})})})}function Lt({children:t,className:r,onChange:i,id:a,...c}){const l=E.useId();return f.jsxs("label",{className:Ve("ui-checkbox-label",r),htmlFor:a||l,children:[f.jsx(YA,{...c,id:a||l,className:"ui-checkbox",onCheckedChange:u=>i?.({target:{checked:u===!0}})}),t&&f.jsx("span",{children:t})]})}function Ea({value:t,onChange:r,precision:i,className:a,onBlur:c,...l}){const[u,d]=E.useState(t==null?"":String(t));return E.useEffect(()=>{d(t==null?"":String(t))},[t]),f.jsx(wa,{...l,type:"number",inputMode:"decimal",className:Ve("ui-number",a),value:u,onChange:m=>{const p=m.target.value;d(p),p?Number.isFinite(Number(p))&&r?.(Number(p)):r?.(null)},onBlur:m=>{const p=Number(u),C=u&&Number.isFinite(p)&&i!==void 0?String(Number(p.toFixed(i))):u;d(t==null?"":C||String(t)),c?.(m)}})}function XA({...t}){return f.jsx(xE,{"data-slot":"dialog",...t})}function KA({...t}){return f.jsx(SE,{"data-slot":"dialog-portal",...t})}function QA({...t}){return f.jsx(rd,{"data-slot":"dialog-close",...t})}function FA({className:t,...r}){return f.jsx(CE,{"data-slot":"dialog-overlay",className:Ve("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...r})}function ZA({className:t,children:r,showCloseButton:i=!0,portal:a=!0,overlay:c=!0,...l}){const u=f.jsxs(E.Fragment,{children:[c&&f.jsx(FA,{className:"ui-dialog-overlay"}),f.jsxs(TE,{"data-slot":"dialog-content",className:Ve("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",t),...l,children:[r,i&&f.jsxs(rd,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(NA,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]});return a?f.jsx(KA,{children:u}):u}function WA({className:t,...r}){return f.jsx("div",{"data-slot":"dialog-header",className:Ve("flex flex-col gap-2 text-center sm:text-left",t),...r})}function JA({className:t,showCloseButton:r=!1,children:i,...a}){return f.jsxs("div",{"data-slot":"dialog-footer",className:Ve("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a,children:[i,r&&f.jsx(rd,{asChild:!0,children:f.jsx(_0,{variant:"outline",children:"Close"})})]})}function eR({className:t,...r}){return f.jsx(RE,{"data-slot":"dialog-title",className:Ve("text-lg leading-none font-semibold",t),...r})}function Dl({open:t,modal:r=!0,panelRef:i,width:a=460,zIndex:c=900,className:l,title:u,footer:d,children:m,classNames:p,closeLabel:C,closeIcon:g,onCancel:b,onOpenAutoFocus:v,onEscapeKeyDown:x,wrapProps:S}){const w=E.useId(),T=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return f.jsx(XA,{open:t,modal:r,onOpenChange:j=>{j||b()},children:f.jsxs(ZA,{...S,ref:i,portal:!1,overlay:r,showCloseButton:!1,"aria-describedby":void 0,"aria-labelledby":w,"aria-modal":r,className:Ve("ui-dialog",l),style:{width:a,zIndex:c},onInteractOutside:j=>j.preventDefault(),onOpenAutoFocus:v,onEscapeKeyDown:j=>{if(!r&&j.target instanceof Element&&!j.target.closest(".ui-dialog")){j.preventDefault();return}x?.(j)},onCloseAutoFocus:j=>{j.preventDefault(),r&&T.current?.isConnected&&T.current.focus({preventScroll:!0})},children:[f.jsxs("div",{className:"ui-dialog-surface",children:[f.jsx(WA,{className:Ve("ui-dialog-header",p?.header),children:f.jsx(eR,{asChild:!0,id:w,children:f.jsx("div",{className:"ui-dialog-title",children:u})})}),f.jsx("div",{className:Ve("ui-dialog-body",p?.body),children:m}),d&&f.jsx(JA,{className:Ve("ui-dialog-footer",p?.footer),children:d})]}),f.jsx(QA,{"aria-label":C,className:"ui-dialog-close",children:g})]})})}function tR({className:t,...r}){return f.jsx(Ij,{"data-slot":"radio-group",className:Ve("grid gap-3",t),...r})}function nR({children:t,indicator:r=!0,className:i,...a}){return f.jsxs(Bj,{"data-slot":"radio-group-item",className:Ve("aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",i),...a,children:[r&&f.jsx(Pj,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(wA,{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary"})}),t]})}function rR(t){return null}function oR({value:t,onChange:r,children:i,className:a,name:c,disabled:l}){const u=E.Children.toArray(i).filter(E.isValidElement);return f.jsx(tR,{name:c,disabled:l,className:Ve("ui-radio-group",a),value:String(t),onValueChange:d=>{const m=u.find(p=>String(p.props.value)===d);m&&r({target:{value:m.props.value}})},children:u.map(({props:d})=>f.jsx(nR,{value:String(d.value),disabled:d.disabled,className:"ui-radio-option",indicator:!1,children:d.children},String(d.value)))})}const Ye={Group:oR,Button:rR};function aR({thumbLabel:t,className:r,defaultValue:i,value:a,min:c=0,max:l=100,...u}){const d=E.useMemo(()=>Array.isArray(a)?a:Array.isArray(i)?i:[c,l],[a,i,c,l]);return f.jsxs(_2,{"data-slot":"slider",defaultValue:i,value:a,min:c,max:l,className:Ve("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",r),...u,children:[f.jsx(L2,{"data-slot":"slider-track",className:Ve("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(z2,{"data-slot":"slider-range",className:Ve("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:d.length},(m,p)=>f.jsx($2,{"data-slot":"slider-thumb","aria-label":t,className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},p))]})}function D0({value:t,onChange:r,ariaLabelForHandle:i,...a}){return f.jsx(aR,{...a,value:[t],onValueChange:c=>r(c[0]),thumbLabel:i})}const I0=t=>{let r;const i=new Set,a=(p,C)=>{const g=typeof p=="function"?p(r):p;if(!Object.is(g,r)){const b=r;r=C??(typeof g!="object"||g===null)?g:Object.assign({},r,g),i.forEach(v=>v(r,b))}},c=()=>r,d={setState:a,getState:c,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p))},m=r=t(a,c,d);return d},iR=(t=>t?I0(t):I0),sR=t=>t;function lR(t,r=sR){const i=Ti.useSyncExternalStore(t.subscribe,Ti.useCallback(()=>r(t.getState()),[t,r]),Ti.useCallback(()=>r(t.getInitialState()),[t,r]));return Ti.useDebugValue(i),i}const k0=t=>{const r=iR(t),i=a=>lR(r,a);return Object.assign(i,r),i},cR=(t=>t?k0(t):k0),Il={min:20,max:150},L0={width:4e3,height:2e3},z0={width:210,height:297},Io=cR((t,r)=>({scale:100,navigatorVisible:!0,setScale:i=>t(a=>({...a,scale:Math.max(Il.min,Math.min(Il.max,Math.round(i)))})),getScale:()=>r().scale,setNavigatorVisible:i=>t(a=>({...a,navigatorVisible:i}))})),uR=()=>{const{scale:t,setScale:r,getScale:i}=Io(),a=c=>r(i()+c);return E.useEffect(()=>{const c=document.getElementById("answer-sheet-stadio"),l=d=>{if(!d.ctrlKey)return;d.preventDefault();const m=document.getElementById("answer-sheet"),p=m.getBoundingClientRect(),C=(d.clientX-p.left)/p.width,g=(d.clientY-p.top)/p.height;Hr.flushSync(()=>r(i()+(d.deltaY<0?5:-5)));const b=m.getBoundingClientRect();c.scrollLeft+=b.left+C*b.width-d.clientX,c.scrollTop+=b.top+g*b.height-d.clientY},u=d=>{(d.ctrlKey||d.metaKey)&&(d.key==="+"||d.key==="="||d.key==="-")&&(d.preventDefault(),r(i()+(d.key==="-"?-10:10)))};return c.addEventListener("wheel",l,{passive:!1}),window.addEventListener("keydown",u),()=>{c.removeEventListener("wheel",l),window.removeEventListener("keydown",u)}},[i,r]),f.jsxs("div",{className:$d["scale-wrapper"],"aria-label":"工作区缩放",children:[f.jsx(ce,{type:"text",size:"small","aria-label":"缩小",onClick:()=>a(-2),children:f.jsx(AA,{})}),f.jsx(D0,{className:$d.bar,ariaLabelForHandle:"缩放比例",min:Il.min,max:Il.max,step:1,value:t,onChange:r}),f.jsx(ce,{type:"text",size:"small","aria-label":"放大",onClick:()=>a(2),children:f.jsx(OA,{})}),f.jsx(A0,{title:"重置缩放",children:f.jsxs("div",{role:"button",tabIndex:0,"aria-label":"重置缩放",onClick:()=>r(100),onKeyDown:c=>{c.key==="Enter"&&r(100)},className:T0("font-12 grey ml-5 pointer",$d.percent),children:[t,"%"]})})]})},dR=()=>{const[t,r]=E.useState(!1);E.useEffect(()=>{const a=()=>r(document.fullscreenElement===document.getElementById("uni-answer-sheet"));return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]);const i=async()=>{try{document.fullscreenElement?await document.exitFullscreen():await document.getElementById("uni-answer-sheet").requestFullscreen()}catch{}};return f.jsx(R0,{type:t?"icon-quxiaoquanping":"icon-quanping",className:"ml-5",padding:[0,5],role:"button",tabIndex:0,"aria-label":t?"取消全屏":"全屏",tooltip:t?"取消全屏":"全屏",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i())},onClick:i})},fR=({summary:t})=>{const{navigatorVisible:r,setNavigatorVisible:i}=Io();return f.jsxs("div",{className:dA.footer,"aria-label":"工作区底栏",children:[f.jsx("div",{className:"font-12 grey",children:t}),f.jsxs("div",{children:[f.jsx(R0,{type:"icon-shitudaohang",padding:[0,5],tooltip:(r?"隐藏":"显示")+"视图导航",active:r,role:"button",tabIndex:0,"aria-label":(r?"隐藏":"显示")+"视图导航",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i(!r))},className:"mr-5",onClick:()=>i(!r)}),f.jsx(uR,{}),f.jsx(dR,{})]})]})},B0={"stadio-wrapper":"_stadio-wrapper_jknpq_1",container:"_container_jknpq_15"},hR=({width:t=So(z0.width),height:r=So(z0.height),children:i})=>{const{scale:a}=Io();return f.jsx("div",{id:"answer-sheet",style:{transform:`scale(${a/100})`,height:r,width:t},children:i})};var Hi=(t=>(t.STADIO_SCROLL_CHANGE="STADIO_SCROLL_CHANGE",t))(Hi||{});class mR{constructor(){cm(this,"callbacks",new Map)}on(r,i){this.callbacks.set(r,i)}emit(r,...i){const a=this.callbacks.get(r);a&&a(i)}depose(r){this.callbacks.delete(r)}}const kl=new mR,pR=({width:t,height:r,children:i,onBackgroundClick:a})=>{const c=E.useRef(null),l=E.useRef(null),{scale:u}=Io(),d=u/100,m=Math.max(L0.width,t*d+600),p=Math.max(L0.height,r*d+600),C=E.useRef(null);return E.useLayoutEffect(()=>{const g=l.current,b=(m-t*d)/2,v=(p-r*d)/2,x=C.current;if(!x||x.width!==t)g.scrollLeft=Math.max(0,b+t*d/2-g.clientWidth/2),g.scrollTop=Math.max(0,v-54);else{const S=(g.scrollLeft+g.clientWidth/2-x.left)/x.zoom,w=(g.scrollTop+g.clientHeight/2-x.top)/x.zoom;g.scrollLeft=b+S*d-g.clientWidth/2,g.scrollTop=v+w*d-g.clientHeight/2}C.current={left:b,top:v,zoom:d,width:t},kl.emit(Hi.STADIO_SCROLL_CHANGE)},[m,p,t,r,d]),E.useEffect(()=>{const g=l.current,b=c.current;let v=()=>{};const x=w=>{if(w.button!==1)return;w.preventDefault(),v();const T=w.clientX,j=w.clientY,R=g.scrollLeft,O=g.scrollTop,M=document.body.style.cursor;document.body.style.cursor="grabbing";const D=I=>g.scrollTo({left:R-I.clientX+T,top:O-I.clientY+j}),_=I=>{I.button===1&&v()};v=()=>{document.body.style.cursor=M,window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",_),window.removeEventListener("blur",v)},window.addEventListener("mousemove",D),window.addEventListener("mouseup",_),window.addEventListener("blur",v)},S=()=>kl.emit(Hi.STADIO_SCROLL_CHANGE);return b.addEventListener("mousedown",x),g.addEventListener("scroll",S),()=>{v(),b.removeEventListener("mousedown",x),g.removeEventListener("scroll",S)}},[]),f.jsx("div",{className:B0["stadio-wrapper"],ref:l,id:"answer-sheet-stadio","aria-label":"制卡工作区",children:f.jsx("div",{className:B0.container,ref:c,id:"answer-sheet-container",style:{height:p,width:m},onPointerDown:g=>{g.target===g.currentTarget&&a?.()},children:f.jsx(hR,{width:t,height:r,children:i})})})},qd={"navigator-wrapper":"_navigator-wrapper_rb3fn_1","fake-page":"_fake-page_rb3fn_12",viewport:"_viewport_rb3fn_17"},gR=()=>{const{scale:t}=Io(),[r,i]=E.useState({ratio:20,width:200,height:100,view:{x:0,y:0,width:0,height:0},pages:[]}),a=E.useRef(null),c=E.useRef(()=>{});return E.useEffect(()=>{const l=document.getElementById("answer-sheet-stadio"),u=document.getElementById("answer-sheet-container"),d=document.getElementById("answer-sheet");let m=0;const p=()=>{const b=Math.max(20,u.offsetWidth/200,u.offsetHeight/160),v=u.getBoundingClientRect(),x=Array.from(d.querySelectorAll("[data-paper-page]")),S=(x.length?x:[d]).map(T=>{const j=T.getBoundingClientRect();return{x:(j.left-v.left)/b,y:(j.top-v.top)/b,width:j.width/b,height:j.height/b}}),w={ratio:b,width:u.offsetWidth/b,height:u.offsetHeight/b,view:{x:l.scrollLeft/b,y:l.scrollTop/b,width:l.clientWidth/b,height:l.clientHeight/b},pages:S};i(T=>JSON.stringify(T)===JSON.stringify(w)?T:w)},C=()=>{cancelAnimationFrame(m),m=requestAnimationFrame(p)};c.current=C;const g=new ResizeObserver(C);return[l,u,d].forEach(b=>g.observe(b)),kl.on(Hi.STADIO_SCROLL_CHANGE,C),C(),()=>{c.current=()=>{},cancelAnimationFrame(m),g.disconnect(),kl.depose(Hi.STADIO_SCROLL_CHANGE)}},[]),E.useLayoutEffect(()=>{c.current()},[t]),f.jsxs("div",{className:qd["navigator-wrapper"],"aria-label":"视图导航",style:{width:r.width,height:r.height},children:[r.pages.map((l,u)=>f.jsx("div",{className:qd["fake-page"],"data-nav-page":u+1,style:{left:l.x,top:l.y,width:l.width,height:l.height}},u)),f.jsx("div",{className:qd.viewport,role:"button",tabIndex:0,"aria-label":"拖动导航视口",style:{left:r.view.x,top:r.view.y,width:r.view.width,height:r.view.height},onPointerDown:l=>{if(l.button!==0)return;l.preventDefault();const u=document.getElementById("answer-sheet-stadio");a.current={x:l.clientX,y:l.clientY,left:u.scrollLeft,top:u.scrollTop},l.currentTarget.setPointerCapture(l.pointerId)},onPointerMove:l=>{if(!a.current)return;document.getElementById("answer-sheet-stadio").scrollTo({left:a.current.left+(l.clientX-a.current.x)*r.ratio,top:a.current.top+(l.clientY-a.current.y)*r.ratio})},onPointerUp:l=>{a.current=null,l.currentTarget.releasePointerCapture(l.pointerId)},onLostPointerCapture:()=>{a.current=null},onKeyDown:l=>{const d={ArrowLeft:[-80,0],ArrowRight:[80,0],ArrowUp:[0,-80],ArrowDown:[0,80]}[l.key];d&&(l.preventDefault(),document.getElementById("answer-sheet-stadio").scrollBy({left:d[0],top:d[1]}))}})]})},Yd=new WeakMap;function yR(t){return Array.from(t.querySelectorAll("[data-card-editor-host]")).flatMap(r=>{const i=Yd.get(r),a=r.querySelector(".rt-content");if(!i||!a||a.closest("[hidden]")||!a.getClientRects().length)return[];const c=a.getBoundingClientRect(),l=c.width/a.offsetWidth,u=[...i.getAnswerRegions()],d=new Set(u.map(m=>m.id));return a.querySelectorAll(".rt-choice-stem-glyph").forEach(m=>{const p=m.dataset.optionId,C=m.getBoundingClientRect();!p||d.has(p)||C.width<=0||C.height<=0||(d.add(p),u.push({id:p,pos:-1,type:"choiceOption",attrs:{label:m.textContent||"",questionId:m.dataset.fillQuestionId},x:(C.x-c.x)/l,y:(C.y-c.y)/l,width:C.width/l,height:C.height/l}))}),u.map(m=>({element:a,region:m,rect:{x:c.x+m.x*l,y:c.y+m.y*l,width:m.width*l,height:m.height*l}}))})}const H0=E.createContext(null),Ll=E.forwardRef((t,r)=>{const i=E.useContext(H0);if(!i)throw new Error("制卡需要显式注册富文本插件");const a=E.useRef(null),c=E.useRef(null),l=E.useRef(t);l.current=t;const u=E.useRef(null),d=E.useRef(null),m=E.useRef(!1),p=E.useRef(0),C=()=>({...l.current,onChange:b=>l.current.onChange?.(b),onLayout:b=>l.current.onLayout?.(b),onContentSelect:b=>l.current.onContentSelect?.(b)}),g=b=>{const v=c.current,x=++p.current;v&&v.ready.then(()=>{let S=0;const w=()=>{x!==p.current||c.current!==v||l.current.readOnly||(v.getStatus().editable?b(v):++S<120&&requestAnimationFrame(w))};requestAnimationFrame(w)}).catch(S=>{d.current=S})};return E.useImperativeHandle(r,()=>({getDocument:()=>m.current?c.current.getDocument():null,getAnswerRegions:()=>m.current?c.current.getAnswerRegions():[],setDocument(b){m.current?c.current.setDocument(b):u.current=b},syncDocument(b){m.current?c.current.syncDocument(b):u.current=b},focus:b=>g(v=>v.focus(b)),focusContent:b=>l.current.contentTargets?.some(v=>v.id===b)?(g(v=>{v.focusContent(b)||v.focus("start")}),!0):!1,insertAnswerRegion:(b,v,x)=>g(S=>S.insertAnswerRegion(b,v,x)),getStatus(){if(d.current)throw d.current;return m.current?c.current.getStatus():{ready:!1,editable:!1,composing:!1,uploading:!1,layoutPending:!0}}}),[]),E.useEffect(()=>{let b=!0;d.current=null;const v=document.createElement("div");v.style.display="contents",a.current.append(v);const x=i.create(v,C()),S=a.current;return Yd.set(S,x),c.current=x,x.ready.then(()=>{b&&(m.current=!0,x.setOptions(C()),u.current&&(x.syncDocument(u.current),u.current=null))}).catch(w=>{b&&(d.current=w)}),()=>{b=!1,m.current=!1,c.current=null,p.current++,Yd.delete(S),v.remove(),queueMicrotask(()=>x.destroy())}},[i]),E.useEffect(()=>{c.current?.setOptions(C())}),f.jsx("div",{ref:a,"data-card-editor-host":"",style:{display:"contents"}})}),P0={judge:"JUDGE",fill:"FILLBLANK",answer:"SHORTANSWER",writing:"CCOMPOSITION",english:"ECOMPOSITION",reading:"READTHENANSWER",cloze:"CLOZE",completion:"TEXT_COMPLETION",matching:"INFO_MATCHING",chunk:"CHUNK_CHOICE",composite:"MIXED",optional:"SHORTANSWER"};function bR(t){if(t.reference||!t.exercise)return t;const r=t.exercise,i=P0[t.kind]||"SHORTANSWER",a=hu(i);return a.fillNewLine=r.fillNewLine,a.optional=t.kind==="optional"&&r.items.length>1,a.choose=Math.max(1,Math.min(r.chooseCount,r.items.length-1)),a.questions=r.items.map(c=>{const l=i==="MIXED"?c.kind==="choice"?c.choice.multiple?"MCHOICE":"SCHOICE":P0[c.kind]||"SHORTANSWER":i,u=l==="MIXED"?"SHORTANSWER":l,d=pu({...mu(u),partCount:1,optionCount:u==="JUDGE"?2:c.choice.options.length,score:c.score},Number(c.label)||1);if(d.id=c.id,d.label=c.label,d.document=c.document,d.choice={...ia(c.choice,u,u==="JUDGE"?2:Math.min(u==="CHUNK_CHOICE"?26:12,c.choice.options.length)),id:c.id,label:c.label},d.characters=Math.min(1200,Math.max(1,c.area.rows*c.area.columns)),d.lines=Math.min(100,Math.max(1,c.area.rows)),d.height=Math.max(30,c.area.rows*c.area.rowHeight),u==="FILLBLANK"||u==="TEXT_COMPLETION")d.parts=c.blanks.map((m,p)=>({...Si(c.blanks.length===1?c.label:`${c.label}.${p+1}`,m.score,u),id:m.id,width:m.width,breakAfter:m.breakAfter})),d.score=Vn(d.parts);else if(u==="SHORTANSWER")d.parts=[{...Si(c.label,c.score,u),document:c.document,height:d.height}];else if(Le(u)){const m=Si(c.label,c.score,u,c.choice.options.length);d.parts=[{...m,choice:{...d.choice,id:m.id}}]}return["SHORTANSWER","CCOMPOSITION","ECOMPOSITION"].includes(u)&&(d.document={...d.document,content:{...d.document.content,content:[...yi(d.label,d.score).content.content,...d.document.content.content||[]]}},d.parts=d.parts.map(m=>({...m,document:{...m.document,content:{...m.document.content,content:[...yi(m.label,m.score).content.content,...m.document.content.content||[]]}}}))),d}),{...t,reference:a}}const gr="reference-merged-objective";function xR(t,r){const i=t.blocks.map(d=>d.reference&&t.choiceDirection&&t.choiceDirection!==d.reference.layout.direction?{...d,reference:{...d.reference,layout:{...d.reference.layout,direction:t.choiceDirection}}}:d);if(!t.mergeObjective)return i;const a=i.find(d=>d.reference?.questions.some(m=>wt(m.type)));if(!a?.reference)return i;const c=i.flatMap(d=>{if(!d.reference)return[];const m=na({...d.reference.layout,questions:sa(d.reference)},d.document,t.questionCard!==!1||r===d.id).concentrated,p=new Set(m.questions.map(C=>C.id));return d.reference.questions.filter(C=>wt(C.type)).flatMap(C=>{if(!Le(C.type))return p.has(C.id)?[C]:[];const g=C.parts.filter(b=>p.has(b.id));return g.length?[{...C,parts:g}]:[]})});if(!c.length)return i;const l={...a,id:gr,document:$t(),reference:{...hu("MIXED"),layout:{...a.reference.layout,presentation:"concentrated"},questions:c}},u=i.flatMap(d=>{if(!d.reference)return[d];const m=d.reference.questions.filter(C=>!wt(C.type)),p=t.questionCard!==!1&&!xn(d.document)||r===d.id;return!m.length&&!p&&d.reference.questions.length?[]:[d]});return[l,...u]}function U0(t){const r=t.reference;if(!r)return[];const i=r.type==="MIXED"?[{id:t.id,label:"公共材料",kind:"material"}]:[];return r.questions.forEach(a=>{const c=Le(a.type);i.push({id:a.id,label:c?`第 ${a.parts.map(l=>l.label).join("、")} 题材料`:`第 ${a.label} 题题干`,kind:c?"material":"question",choice:!c&&wt(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="JUDGE"}),a.parts.filter(l=>r.textVersion!==1||l.text).forEach(l=>i.push({id:l.id,label:`第 ${l.label} ${a.type==="FILLBLANK"?"空":"题"}`,kind:"question",parentId:a.id,choice:c&&wt(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="INFO_MATCHING",inlineOptions:r.textVersion===1&&["CLOZE","INFO_MATCHING"].includes(a.type),optionWidth:r.textVersion===1&&a.type==="INFO_MATCHING"?70:void 0}))}),i}function $0(t,r){return{...t,attrs:{...t.attrs,contentId:r}}}function vR(t,r,i){const a=new Map(r.questions.filter(u=>xi(u.type)).flatMap(u=>u.parts).map(u=>[u.id,u])),c=u=>{const d=u.type==="answerLine"&&a.get(u.attrs?.id),m=d&&Math.max(24,Math.min(600,i*d.width/100));if(d&&(u.attrs?.label!==d.label||u.attrs?.width!==m))return{...u,attrs:{...u.attrs,label:d.label,width:m}};const p=u.content?.map(c);return p?.some((C,g)=>C!==u.content[g])?{...u,content:p}:u},l=c(t.content);return l===t.content?t:{...t,content:l}}function SR(t){if(!t.reference)return t.document;const r=new Map;t.reference.questions.forEach(c=>{[c.choice,...c.parts.map(l=>l.choice)].forEach(l=>{l.contentTarget&&r.set(l.contentTarget.groupId,l.id)})});let i=!1;const a=t.document.content.content?.map(c=>{if(c.attrs?.contentId)return c;let l;const u=d=>{d.type==="choiceGroup"&&(l=r.get(d.attrs?.id)||l),d.type==="choiceStemAnchor"&&(l=r.get(d.attrs?.groupId)||l),d.content?.forEach(u)};return u(c),l?(i=!0,$0(c,l)):c});return i?{...t.document,content:{...t.document.content,content:a}}:t.document}function CR(t,r,i){const a=w=>w.questions.flatMap(T=>[T.id,...T.parts.map(j=>j.id)]),c=new Set(a(r)),l=new Set(a(i)),u=new Set([...c].filter(w=>!l.has(w)));let d=!1;const m=w=>{if(u.has(w.attrs?.contentId)||w.type==="answerLine"&&u.has(w.attrs?.id))return d=!0,null;const T=w.content?.map(m).filter(j=>j!==null);return T?{...w,content:T}:w},p=m(t.content),C=p.content||[],g=a(i),b=C.filter(w=>l.has(w.attrs?.contentId)),v=[...b].sort((w,T)=>g.indexOf(w.attrs.contentId)-g.indexOf(T.attrs.contentId));let x=0;const S=C.map(w=>l.has(w.attrs?.contentId)?v[x++]:w);return b.some((w,T)=>w!==v[T])&&(d=!0),d?{...t,content:{...p,content:S.length?S:$t().content.content}}:t}function wR(t,r,i){const a=new Map([[r.id,i.id],...r.parts.map((v,x)=>[v.id,i.parts[x].id])]),c=new Map([...r.choice.options.map((v,x)=>[v.id,i.choice.options[x].id]),...r.parts.flatMap((v,x)=>v.choice.options.map((S,w)=>[S.id,i.parts[x].choice.options[w].id]))]),l=new Map([[r.text?.groupId,i.text?.groupId],...r.parts.map((v,x)=>[v.text?.groupId,i.parts[x].text?.groupId])].filter(v=>!!(v[0]&&v[1]))),u=t.content.content||[],d=u.filter(v=>a.has(v.attrs?.contentId));if(!d.length)return t;const m=vo(d),p=(v,x)=>({...v,...v.attrs?{attrs:{...v.attrs,...v.type==="choiceOption"&&c.has(x.attrs?.id)?{id:c.get(x.attrs.id)}:{},...v.type==="choiceGroup"&&l.has(x.attrs?.id)?{id:l.get(x.attrs.id)}:{},...a.has(x.attrs?.contentId)?{contentId:a.get(x.attrs.contentId)}:{},...v.type==="choiceStemAnchor"&&a.has(String(x.attrs?.groupId).slice(9))?{groupId:ru(a.get(String(x.attrs.groupId).slice(9)))}:{}}}:{},...v.content?{content:v.content.map((S,w)=>p(S,x.content[w]))}:{}}),C=new Map(r.parts.map((v,x)=>[v.id,i.parts[x].id])),g=(v,x)=>({...v,...x.type==="answerLine"&&C.has(x.attrs?.id)?{attrs:{...v.attrs,id:C.get(x.attrs.id)}}:{},...v.content?{content:v.content.map((S,w)=>g(S,x.content[w]))}:{}}),b=Math.max(...d.map(v=>u.indexOf(v)));return{...t,content:{...t.content,content:[...u.slice(0,b+1),...m.map((v,x)=>g(p(v,d[x]),d[x])),...u.slice(b+1)]}}}function ER(t,r){const i=t.content.content||[],a=new Set(i.map(l=>l.attrs?.contentId).filter(Boolean)),c=(r.content.content||[]).filter(l=>l.attrs?.contentId&&!a.has(l.attrs.contentId));return c.length?{...t,content:{...t.content,content:[...xn(t)?[]:i,...c]}}:t}function TR(t,r){const i={};let a=1;return{sectionInfoList:t.filter(l=>l.reference).map((l,u)=>{const d=l.reference,m=d.textVersion===1?d:Em({...d,questions:d.questions.map(x=>({...x,text:x.text||{...bi(x.type,x.choice,Le(x.type)),numbered:!1,itemsContent:[]},parts:x.parts.map(S=>({...S,text:S.text||{...bi(x.type,S.choice),numbered:!1,itemsContent:[]}}))}))},l.document,l.id),p=m.sectionSeq??u+1,C=x=>x?.itemsContent.map(S=>({id:S.id,key:S.key,content:r.serialize(S.content)}))||[],g=x=>r.serialize(x?.content||$t()),b=(x,S,w)=>{const T=x?Gs({...x,itemsContent:[]},S,w):[],j=r.serialize(kr(T)),R=r.unwrapParagraphs||(O=>O.replace(/^<p\b[^>]*>([\s\S]*)<\/p>$/,"$1"));return{content:R(j,!0),contentNoP:R(j),items:C(x).map(O=>`${O.key}.${R(O.content)}`)}},v=m.questions.map(x=>{const S=Le(x.type),w=a;a+=S?x.parts.length:1;const T=x.referenceData||{},j=T.questionId??x.id,R=S?x.parts.map((D,_)=>({...D.referenceData,questionId:D.referenceData?.questionId??D.id,questionPid:j,questiontypeCode:x.type,seq:w+_,showSeq:D.label,itemShowNames:[D.label],score:D.score,itemcount:D.choice.options.length,content:g(D.text),itemsContent:C(D.text)})):void 0,O={...T,questionId:j,questiontypeCode:x.type,seq:w,showSeq:x.label,showSeqs:S?x.parts.map(D=>D.label):null,itemShowNames:x.parts.length?x.parts.map(D=>D.label):[x.label],itemcount:wt(x.type)?x.choice.options.length:x.parts.length||1,childNum:S?x.parts.length:void 0,score:x.score,itemScores:x.parts.length?x.parts.map(D=>D.score):[x.score],content:g(x.text),itemsContent:C(x.text),...R?{items:R}:{},lessScore:x.choice.lessScore,scoreType:x.choice.scoreType,rightAnswers:x.rightAnswers,singleScore:x.singleScore,extension:{...T.extension||{},...x.type==="CCOMPOSITION"?{kong:x.characters}:{},...x.type==="ECOMPOSITION"?{hang:x.lines}:{},uniEditor:{text:x.text,choice:x.choice,height:x.height,contentHeight:x.contentHeight,halfPoint:x.halfPoint,parts:x.parts.map(D=>({id:D.id,text:D.text,width:D.width,height:D.height,breakAfter:D.breakAfter,choice:D.choice,document:D.document})),document:x.document}}},M=b(x.text,x.id,x.label);return i[String(j)]=S?{...M,items:x.parts.map((D,_)=>({seq:w+_,...b(D.text,D.id,D.label)}))}:M,m.type==="MIXED"&&(i[`secContent${j}`]=r.serialize(m.material||$t())),O});return{...m.referenceData,sectionSeq:p,sectionName:l.title,sectionQuestionType:m.type,questionInfolist:v,...m.type==="MIXED"?{content:r.serialize(m.material||$t())}:{},extension:{...m.referenceData?.extension||{},uniEditor:{id:l.id,layout:m.layout,material:m.material,document:l.document,optional:m.optional,choose:m.choose,optionalHeight:m.optionalHeight,scoreType:m.scoreType,fillNewLine:m.fillNewLine}}}}),quesTextMap:i}}function G0(t,r){const i=Array.isArray(t)?t:t.sectionInfoList;if(!Array.isArray(i))throw new Error("缺少 sectionInfoList");const a=new Set,c=l=>{const u=l==null||l===""?crypto.randomUUID():String(l);if(a.has(u))throw new Error(`题目 ID 重复:${u}`);return a.add(u),u};return i.map(l=>{if(!(l.sectionQuestionType in nr)||!Array.isArray(l.questionInfolist))throw new Error("题块类型或 questionInfolist 无效");const u=Tm(l.sectionQuestionType),d=l.extension;d?.uniEditor?.id&&(u.id=d.uniEditor.id),u.title=l.sectionName;const{questionInfolist:m,...p}=l,C=[],g=new Map;m.forEach(v=>{if(v.questionPid!==void 0&&v.questionPid!==null&&Le(v.questiontypeCode)){const x=String(v.questionPid);let S=g.get(x);S||(S={...v,questionId:v.questionPid,questionPid:void 0,content:String(v.parentContent||""),items:[],showSeqs:[]},g.set(x,S),C.push(S)),S.items.push(v),S.showSeqs.push(v.showSeq??v.seq??S.items.length)}else C.push(v)}),g.forEach(v=>{v.itemScores=v.items.map(x=>x.score??null),v.score=v.itemScores.some(x=>x===null)?null:v.itemScores.reduce((x,S)=>x+(S||0),0)});const b=C.map((v,x)=>{if(!(v.questiontypeCode in nr)||v.questiontypeCode==="MIXED")throw new Error("子题类型无效");const S=v.questiontypeCode,w=Le(S),T=w?v.items?.length||v.showSeqs?.length||v.childNum||1:["FILLBLANK","SHORTANSWER"].includes(S)&&(v.itemScores?.length||v.itemcount)||1;if(!Number.isInteger(T)||T<1||T>200)throw new Error("子题数量无效");const j=v.score??null,R=mu(S),O=pu({...R,characters:Number(v.extension?.kong)||R.characters,lines:Number(v.extension?.hang)||R.lines,partCount:T,score:w||["FILLBLANK","SHORTANSWER"].includes(S)?v.itemScores?.[0]??(j===null?null:j/T):j,optionCount:v.itemcount||v.itemsContent?.length||4},Number(v.seq)||x+1);O.id=c(v.questionId??v.id),O.label=String(v.showSeq??v.itemShowNames?.[0]??v.seq??x+1),O.choice.id=O.id,O.choice.label=O.label,O.choice.score=j,O.choice.scoreType=v.scoreType||O.choice.scoreType,O.choice.lessScore=v.lessScore??O.choice.lessScore,O.rightAnswers=v.rightAnswers??O.rightAnswers,O.singleScore=v.singleScore??O.singleScore,O.score=j,O.referenceData=v;const M=v.extension?.uniEditor;M?.choice&&(O.choice={...M.choice,id:O.id,label:O.label,score:j}),O.height=M?.height??O.height,O.contentHeight=M?.contentHeight??O.contentHeight,O.halfPoint=M?.halfPoint??O.halfPoint;const D=(_,I,z,H=!1,L)=>{if(L)return structuredClone(L);const $=bi(S,{...z,id:I},H);return{...$,content:r.parse(_.content||""),itemsContent:!H&&_.itemsContent?_.itemsContent.map((Y,U)=>({id:Y.id===void 0?z.options[U]?.id||crypto.randomUUID():String(Y.id),key:Y.key,content:r.parse(Y.content||"")})):$.itemsContent}};return O.text=D(v,O.id,O.choice,w,M?.text),O.text.itemsContent.length&&(O.choice.options=O.text.itemsContent.map(_=>({id:_.id,label:_.key}))),O.document=M?.document||vn(O.document,O.label,O.score),O.parts=O.parts.map((_,I)=>{const z=v.items?.[I],H=M?.parts?.[I];return _.id=c(H?.id??z?.questionId??z?.id),_.referenceData=z,_.label=String(z?.showSeq??v.itemShowNames?.[I]??v.showSeqs?.[I]??(w?Number(v.seq||1)+I:T===1?O.label:`${O.label}.${I+1}`)),_.score=z?.score??v.itemScores?.[I]??_.score,_.choice={...H?.choice||_.choice,id:_.id,label:_.label,score:_.score,scoreType:z?.scoreType||v.scoreType||_.choice.scoreType,lessScore:z?.lessScore??v.lessScore??_.choice.lessScore},w&&S!=="TEXT_COMPLETION"&&(_.text=D(z||{itemsContent:v.itemsContent?.map(({key:L,content:$})=>({key:L,content:$}))},_.id,_.choice,!1,H?.text)),_.text?.itemsContent.length&&(_.choice.options=_.text.itemsContent.map(L=>({id:L.id,label:L.key}))),_.document=H?.document||vn(_.document,_.label,_.score),{..._,...H?{width:H.width??_.width,height:H.height??_.height,breakAfter:H.breakAfter??_.breakAfter}:{}}}),O.characters=Number(v.extension?.kong)||O.characters,O.lines=Number(v.extension?.hang)||O.lines,O});return u.reference={...u.reference,textVersion:1,sectionSeq:l.sectionSeq,referenceData:p,questions:b,material:d?.uniEditor?.material||r.parse(l.content||""),...d?.uniEditor?{layout:d.uniEditor.layout||u.reference.layout,optional:!!d.uniEditor.optional,choose:d.uniEditor.choose||1,optionalHeight:d.uniEditor.optionalHeight??200,scoreType:d.uniEditor.scoreType||u.reference.scoreType,fillNewLine:!!d.uniEditor.fillNewLine}:{}},d?.uniEditor?.document&&(u.document=d.uniEditor.document),u.document=fu(u),u})}class Xr extends Error{constructor(r,i){super(i),this.code=r}}const V0=t=>!t.closest("[hidden]")&&t.getClientRects().length>0;function jR(t,r,i){const a=t.getBoundingClientRect(),c=a.width/i.width;if(!t.isConnected||!(c>0))throw new Xr("LAYOUT_UNAVAILABLE","请显示题卡后再获取识别坐标");const l=g=>({x:(g.x-a.x)/c,y:(g.y-a.y)/c,width:g.width/c,height:g.height/c}),u=Array.from(t.querySelectorAll(".card-sheet[data-paper-page]")).map(g=>{const b=l(g.getBoundingClientRect()),v=Object.fromEntries(Array.from(g.querySelectorAll("[data-anchor]")).map(j=>[j.dataset.anchor,l(j.getBoundingClientRect())]));if(Object.keys(v).length!==4)throw new Xr("MISSING_ANCHORS","缺少纸面定位点,请先完成题卡初始化");const x=v.topLeft,S=j=>Am({...j,x:j.x-b.x,y:j.y-b.y}),w={pageNumber:Number(g.dataset.paperPage),pageSize:{width:qn(i.width),height:qn(i.height)},anchorOrigin:{x:qn(x.x-b.x),y:qn(x.y-b.y)},anchorSize:{width:26,height:13},panelSize:{width:qn(v.topRight.x+v.topRight.width-x.x),height:qn(v.bottomRight.y+v.bottomRight.height-x.y)},anchors:{topLeft:S(v.topLeft),topRight:S(v.topRight),bottomLeft:S(v.bottomLeft),bottomRight:S(v.bottomRight)},regions:[]};for(const j of Object.values(v))if(j.x<b.x-.1||j.y<b.y-.1||j.x+j.width>b.x+b.width+.1||j.y+j.height>b.y+b.height+.1)throw new Xr("MARK_OUTSIDE_PAPER","定位点超出纸面,请调整边距");const T=Array.from(g.querySelectorAll("[data-anchor], .card-code-marks, .card-exam-qr, .card-paper-footer > span")).map(j=>l(j.getBoundingClientRect()));return T.forEach((j,R)=>T.slice(R+1).forEach(O=>{const M=Rm(j,O);if(M&&M.width>.3&&M.height>.3)throw new Xr("OVERLAPPING_PAPER_MARKS","纸面识别标记与页码重叠,请调整边距或版式")})),{data:w,paper:b,toPaper:S}});if(u.length>8)throw new Xr("PAGE_CODE_LIMIT","参考纸面编码最多支持 8 个纸面,请减少页数或调整版式");const d=new Map;r.blocks.forEach(g=>{g.reference?.questions.forEach(b=>{const v={blockId:g.id,questionId:b.id,answerId:b.id};d.set(b.id,v),b.choice.options.forEach(x=>d.set(x.id,v)),b.parts.forEach(x=>{const S={...v,partId:x.id,answerId:x.id};d.set(x.id,S),x.choice.options.forEach(w=>d.set(w.id,S))})}),g.choices?.questions.forEach(b=>{const v={blockId:g.id,questionId:b.id,answerId:b.id};d.set(b.id,v),b.options.forEach(x=>d.set(x.id,v))})});const m=new Map,p=(g,b,v)=>{if(![g.x,g.y,g.width,g.height].every(Number.isFinite)||g.width<=0||g.height<=0)throw new Xr("INVALID_RECOGNITION_RECT","识别区域尺寸无效,请检查内容是否已完成布局");const x=u.flatMap(M=>{const D=Rm(g,M.paper);return D?[{page:M,rect:D}]:[]}),S=x.reduce((M,D)=>M+D.rect.width*D.rect.height,0);if(!x.length||g.width*g.height-S>Math.max(g.width,g.height)*.2||x.length!==1)throw new Xr("REGION_OUTSIDE_PAPER","识别区域超出纸面,请调整内容或版式");const{page:w}=x[0],T=`${w.data.pageNumber}/${v}`,j=m.get(T)||0;m.set(T,j+1);const R=Array.from({length:i.columns},(M,D)=>D).find(M=>g.x>=i.columnX(w.data.pageNumber-1,M)-1&&g.x<i.columnX(w.data.pageNumber-1,M)+i.columnWidth+1),O={...b,id:`${T}/${j}`,rect:w.toPaper(g),...R!==void 0?{columnNumber:R+1}:{}};return w.data.regions.push(O),O},C=(g,b)=>{const v=g.closest("[data-exercise-item], [data-exercise-id], [data-question-id]"),x=v?.dataset.exerciseItem||v?.dataset.exerciseId||v?.dataset.questionId;return{blockId:g.closest("[data-block-id]")?.dataset.blockId,...d.get(b||"")||d.get(x||"")}};return t.querySelectorAll("[data-recognition]").forEach(g=>{if(!V0(g))return;const b=g.dataset.recognition,v=g.dataset.answerId,x=C(g,g.dataset.optionId||v),S=g.dataset.recognitionRole||"region",w={...x,sectionType:b,role:S,...g.dataset.recognitionScope==="section"?{scope:"section"}:{},...v?{answerId:v}:{},...g.dataset.optionId?{optionId:g.dataset.optionId}:{},...g.dataset.value!==void 0?{value:g.dataset.value}:{},...g.dataset.questionIds?{questionIds:g.dataset.questionIds.split(",")}:{}},T=`${b}/${x.blockId||"paper"}/${v||""}/${g.dataset.optionId||""}/${S}/${g.dataset.value||""}/${g.dataset.fragment||""}`,j=p(l(g.getBoundingClientRect()),w,T);g.querySelectorAll("[data-recognition-cell]").forEach(R=>{R.closest("[data-recognition]")!==g||!V0(R)||p(l(R.getBoundingClientRect()),{...w,role:"cell",parentId:j.id,value:R.dataset.recognitionCell},`${T}/cell/${R.dataset.recognitionCell}`)})}),yR(t).forEach(({element:g,region:b,rect:v})=>{const x=b.id||`position-${b.pos}`,S=C(g,x),w=b.type==="choiceOption"||b.type==="choiceMarker",T=w?"MultiChoice":"Checkbox";p(l(v),{...S,sectionType:T,role:b.type==="answerLine"?"line":"cell",answerId:d.get(x)?.answerId||x,...w?{optionId:x}:{},...b.attrs.label?{value:String(b.attrs.label)}:{}},`editor/${S.blockId||"paper"}/${x}/${b.pos}`)}),u.forEach(({data:g})=>{const b=new Map;g.regions.filter(v=>v.sectionType==="MultiChoice"&&v.role==="cell").forEach(v=>{const x=`${v.blockId||""}/${v.answerId||""}/${v.columnNumber||""}`,S=b.get(x)||[];S.push(v),b.set(x,S)}),b.forEach((v,x)=>{const S=v[0],w=Math.min(...v.map(M=>M.rect.x)),T=Math.min(...v.map(M=>M.rect.y)),j=Math.max(...v.map(M=>M.rect.x+M.rect.width)),R=Math.max(...v.map(M=>M.rect.y+M.rect.height)),O=`${g.pageNumber}/MultiChoice/group/${x}`;g.regions.push({id:O,sectionType:"MultiChoice",role:"region",blockId:S.blockId,questionId:S.questionId,partId:S.partId,answerId:S.answerId,columnNumber:S.columnNumber,rect:Am({x:w,y:T,width:j-w,height:R-T})}),v.forEach(M=>{M.parentId=O})}),g.regions.filter(v=>!v.parentId&&v.scope!=="section").forEach(v=>{const x=g.regions.filter(S=>S!==v&&S.role==="region"&&(v.role!=="region"||S.scope==="section")&&(S.blockId===v.blockId||S.questionIds?.includes(v.questionId||""))&&(S.answerId===v.answerId||S.questionIds?.includes(v.questionId||"")||S.questionId&&S.questionId===v.questionId&&!S.partId)&&v.rect.x>=S.rect.x-.1&&v.rect.y>=S.rect.y-.1&&v.rect.x+v.rect.width<=S.rect.x+S.rect.width+.1&&v.rect.y+v.rect.height<=S.rect.y+S.rect.height+.1).sort((S,w)=>S.rect.width*S.rect.height-w.rect.width*w.rect.height)[0];x&&(v.parentId=x.id)})}),{version:2,unit:"px",dpi:96,origin:"topLeftPaper",singlePagePartition:i.columns,pages:u.map(g=>g.data)}}function AR({uploadImage:t,editorPlugin:r,initialValue:i,onSave:a,dictionaries:c}){const l=E.useMemo(()=>Jc(c),[c]),u=r.html,[d,m]=E.useState(i||vm),p=E.useCallback(fe=>m(ue=>{let he=typeof fe=="function"?fe(ue):fe;he.blocks.some(Oe=>Oe.exercise&&!Oe.reference)&&(he={...he,blocks:he.blocks.map(bR)}),he={...he,blocks:he.blocks.map(Oe=>{const Nt=ue.blocks.find(Qr=>Qr.id===Oe.id);if(Oe.reference?.textVersion===1)return vS(Oe,Nt,!!he.questionCard);if(!Oe.reference||Nt?.reference===Oe.reference)return Oe;let Xt=Nt?.reference?CR(Oe.document,Nt.reference,Oe.reference):Oe.document;if(Xt.content.content?.length===1&&Xt.content.content[0].type==="paragraph"&&!Xt.content.content[0].content?.length&&!Xt.content.content[0].attrs?.contentId&&Oe.reference.questions.length){const Qr=Oe.reference.questions[0],Bn=Oe.reference.type==="MIXED"?Oe.id:Qr.id;Xt={...Xt,content:{...Xt.content,content:[$0(Xt.content.content[0],Bn)]}}}const Ul=Qr=>JSON.stringify(Qr.reference?.questions.flatMap(Bn=>[Bn.choice,...Bn.parts.map(zo=>zo.choice)]).map(Bn=>[Bn.id,Bn.contentTarget])),$i=!Nt||Ul(Nt)!==Ul(Oe)?SR({...Oe,document:Xt}):Xt;return $i===Oe.document?Oe:{...Oe,document:$i}})};const $e=he.blocks.filter(Oe=>Oe.reference).map(Oe=>sa(Oe.reference));return(he.mergeObjective?[$e.flat()]:$e).some(Oe=>new Set(Oe.map(Nt=>Nt.options.length)).size>1)&&he.choiceDirection!=="column"?{...he,choiceDirection:"column"}:he}),[]),[C,g]=E.useState(""),[b,v]=E.useState(!i),[x,S]=E.useState(null),[w,T]=E.useState(null),[j,R]=E.useState(null),[O,M]=E.useState(!0),[D,_]=E.useState({}),I=fe=>{const ue=fe.reference?qs(fe.reference):fe.exercise?.items||fe.choices?.questions;return ue?.find(he=>he.id===D[fe.id])?.id||ue?.[0]?.id},z=(fe,ue)=>_(he=>he[fe]===ue?he:{...he,[fe]:ue}),H=fe=>{S(fe),fe===null&&T(null),fe&&R(ue=>ue===null?null:fe)},[L,$]=E.useState({}),[Y,U]=E.useState(),[q,P]=E.useState(!1),G=fe=>{fe&&T(null),P(fe)},[B,Q]=E.useState(null),N=E.useRef(new Map),K=E.useRef(null),ne=E.useCallback((fe,ue)=>{ue?N.current.set(fe,ue):N.current.delete(fe)},[]),{scale:te,setScale:le}=Io(),oe=te/100,ae=E.useMemo(()=>xR(d,w),[d,w]),xe=JSON.stringify([d.usage,d.preset,d.margin,d.gap,d.header,d.recognition,d.paperTitle?.id,d.paperTitle?.height,ae.map(fe=>[fe.id,fe.answerHeight])]),{geometry:we,placements:ge,pageCount:de}=E.useMemo(()=>gS({...d,blocks:ae},L,Y),[xe,L,Y]),Me=d.paperTitle?.id===Y?.id&&Y?.overflowing,Be=de*we.height+(de-1)*Co,Ae=ge.filter(fe=>fe.overflowing),Se=new Map(ge.map(fe=>[fe.id,fe])),Ce=Se.get(gr);Ce&&d.blocks.forEach(fe=>{Se.has(fe.id)||Se.set(fe.id,Ce)});const Ot=()=>{const fe=document.getElementById("answer-sheet-stadio");fe&&le(Math.max(20,Math.min(100,Math.floor((fe.clientWidth-96)/we.width*100))))};E.useEffect(()=>{Ot()},[d.preset]);const dt=(fe,ue)=>p(he=>({...he,blocks:he.blocks.map($e=>$e.id===fe?{...$e,...ue}:$e)})),be=(fe,ue)=>p(he=>{const $e=[...he.blocks],Ze=$e.findIndex(Nt=>Nt.id===fe);if(Ze<0||ue<0||ue>=$e.length||Ze===ue)return he;const[Oe]=$e.splice(Ze,1);return $e.splice(ue,0,Oe),{...he,blocks:$e}}),gt=(fe,ue=!1)=>{if(H(fe),!ue)return;const he=document.getElementById("answer-sheet-stadio"),$e=Array.from(document.querySelectorAll("[data-block-id]")),Ze=$e.find(Oe=>Oe.dataset.blockId===fe&&!Oe.hidden)||$e.find(Oe=>Oe.dataset.blockId===gr);if(he&&Ze){const Oe=Ze.getBoundingClientRect(),Nt=he.getBoundingClientRect();he.scrollTo({left:Math.max(0,he.scrollLeft+Oe.left-Nt.left-40),top:Math.max(0,he.scrollTop+Oe.top-Nt.top-90),behavior:"smooth"})}},ot=()=>TR(d.blocks,u),Wt=()=>{if(!K.current)throw new Error("题卡尚未完成渲染");return jR(K.current,d,we)};return{card:d,paperRoot:K,creationDictionary:l,saveMessage:C,setSaveMessage:g,saveAction:a?"保存":"导出",editors:N,measurements:L,titleMeasurement:Y,paperBlocks:ae,setCard:p,uploadImage:t,setQuestionCard:fe=>{T(null),p(ue=>({...ue,questionCard:fe,blocks:ue.blocks.filter(he=>he.areaType!==(fe?"forbiden":"editArea"))}))},editQuestion:(fe,ue)=>{H(fe),T(fe),R(null);const he=d.blocks.find(Ze=>Ze.id===fe),$e=ue||he&&I(he);he?.reference?.textVersion===1&&xn(he.document)&&dt(fe,{document:fu(he)}),requestAnimationFrame(()=>{const Ze=N.current.get(`content/${$e}`)||N.current.get(fe);(!$e||!Ze?.focusContent($e))&&Ze?.focus("start")})},finishQuestionEditing:()=>T(null),insertMaterialBlank:(fe,ue,he,$e)=>{H(fe),T(fe),requestAnimationFrame(()=>N.current.get(fe)?.insertAnswerRegion(ue,he,$e))},editingQuestionId:w,registerEditor:ne,creationOpen:b,setCreationOpen:v,newCard:fe=>{p(uu(fe)),H(null),R(null),Q(null),$({}),U(void 0),_({}),G(!1),v(!1)},selectedId:x,setSelectedId:H,selectedChoiceId:I,selectChoice:z,settingsId:j,setSettingsId:R,settingsAutoFocus:O,openSettings:(fe,ue=!0)=>{q||(H(fe),R(fe),M(ue))},setMeasurements:$,setTitleMeasurement:U,titleOverflow:Me,readOnly:q,setReadOnly:G,deleted:B,setDeleted:Q,scale:oe,geometry:we,placements:ge,pageCount:de,totalHeight:Be,overflow:Ae,placementById:Se,fitPage:Ot,updateBlock:dt,moveBlock:be,selectBlock:gt,download:()=>{if(a){a();return}let fe;try{fe=Wt()}catch($e){g($e instanceof Error?$e.message:"识别坐标生成失败");return}const ue=URL.createObjectURL(new Blob([JSON.stringify({...d,...ot(),recognitionData:fe},null,2)],{type:"application/json"})),he=document.createElement("a");he.href=ue,he.download=`${d.title||"答题卡"}.json`,he.click(),setTimeout(()=>URL.revokeObjectURL(ue),1e3)},getReferenceData:ot,getRecognitionData:Wt,setReferenceData:fe=>{const ue=G0(fe,u);p(he=>({...he,blocks:ue})),H(null),R(null),_({})}}}const q0=E.createContext(null);function RR({children:t,...r}){return f.jsx(H0.Provider,{value:r.editorPlugin,children:f.jsx(q0.Provider,{value:AR(r),children:t})})}function mt(){const t=E.useContext(q0);if(!t)throw new Error("制卡内容需要 CardProvider");return t}const OR={undo:"M9 5 4 10l5 5M4 10h10a6 6 0 0 1 0 12",redo:"m15 5 5 5-5 5m5-5H10a6 6 0 0 0 0 12",image:"M4 4h16v16H4zM4 16l5-5 4 4 3-3 4 4M16 8h.01",table:"M4 4h16v16H4zM4 10h16M10 4v16M4 15h16",check:"m5 12 4 4L19 6",back:"m14 5-7 7 7 7",close:"m6 6 12 12M6 18 18 6",upload:"M12 16V3m-4 4 4-4 4 4M5 13v7h14v-7",download:"M12 3v13m-4-4 4 4 4-4M5 17v4h14v-4",settings:"M4 7h16M4 17h16M8 4v6m8 4v6",chevronUp:"m7 14 5-5 5 5",answerLine:"M4 17h16M5 10h2m4 0h2m4 0h2",alignLeft:"M4 5h16M4 10h10M4 15h16M4 20h10",alignCenter:"M4 5h16M7 10h10M4 15h16M7 20h10",alignRight:"M4 5h16M10 10h10M4 15h16M10 20h10",alignJustify:"M4 5h16M4 10h16M4 15h16M4 20h16",document:"M6 3h8l4 4v14H6zM14 3v5h4M9 12h6m-6 4h6",trash:"M4 6h16M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",listOrdered:"M10 6h10M10 12h10M10 18h10M3 4h1v5M3 9h2M3 15a1.5 1.5 0 0 1 3 0c0 1-3 3-3 4h3"};function ko({name:t,size:r=18}){return f.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:OR[t]})})}function Xd(t){const[r,i]=E.useState(null),a=E.useRef(t);a.current=t;const c=E.useRef(null),l=(C,g)=>{if(!r)return;const b=r.getBoundingClientRect();r.style.left=`${Math.max(8,Math.min(window.innerWidth-b.width-8,C))}px`,r.style.top=`${Math.max(8,Math.min(window.innerHeight-b.height-8,g))}px`},u=()=>{if(!r)return;const C=r.getBoundingClientRect(),g=a.current?.(r)||{left:(window.innerWidth-C.width)/2,top:(window.innerHeight-C.height)/2};l(g.left,g.top)},d=()=>{const C=c.current;c.current=null,r&&delete r.dataset.dragging,C?.target.hasPointerCapture(C.pointerId)&&C.target.releasePointerCapture(C.pointerId)},m=()=>c.current?(l(c.current.left,c.current.top),d(),!0):!1;return E.useLayoutEffect(()=>{if(!r)return;u();const C=()=>{const b=r.getBoundingClientRect();l(b.left,b.top)},g=new ResizeObserver(C);return g.observe(r),window.addEventListener("resize",C),document.addEventListener("fullscreenchange",C),window.addEventListener("blur",m),()=>{d(),g.disconnect(),window.removeEventListener("resize",C),document.removeEventListener("fullscreenchange",C),window.removeEventListener("blur",m)}},[r]),{dialog:r,setDialog:i,titleProps:{role:"button",tabIndex:0,onPointerDown:C=>{if(C.button!==0||!C.isPrimary||!r)return;C.preventDefault(),C.stopPropagation(),C.currentTarget.focus({preventScroll:!0});const{left:g,top:b}=r.getBoundingClientRect();c.current={x:C.clientX,y:C.clientY,left:g,top:b,target:C.currentTarget,pointerId:C.pointerId},r.dataset.dragging="true",C.currentTarget.setPointerCapture(C.pointerId)},onPointerMove:C=>{const g=c.current;g?.pointerId===C.pointerId&&l(g.left+C.clientX-g.x,g.top+C.clientY-g.y)},onPointerUp:d,onPointerCancel:m,onLostPointerCapture:d,onKeyDown:C=>{if(C.key==="Escape"&&m()&&(C.preventDefault(),C.stopPropagation()),C.key==="Home"&&(C.preventDefault(),C.stopPropagation(),u()),!r||!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(C.key))return;C.preventDefault(),C.stopPropagation();const g=C.shiftKey?50:10,b=r.getBoundingClientRect();l(b.left+(C.key==="ArrowRight"?g:C.key==="ArrowLeft"?-g:0),b.top+(C.key==="ArrowDown"?g:C.key==="ArrowUp"?-g:0))}},cancelDrag:m}}function NR({creation:t,questionCard:r,onAdd:i,onClose:a}){const[c,l]=E.useState(null),u=Cm(t),d=r?"editArea":"forbiden",m=[...u,d],p={...nr,forbiden:"禁止答题区",editArea:"空白答题区"},C=E.useId(),{dialog:g,setDialog:b,titleProps:v,cancelDrag:x}=Xd();E.useLayoutEffect(()=>{g?.setAttribute("aria-labelledby",C)},[g,C]);const S=f.jsx("div",{...v,className:"card-modal-drag","aria-label":"拖动添加题块",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:C,children:"添加题块"})});return f.jsxs(Dl,{open:!0,panelRef:b,width:460,zIndex:910,className:"card-modal card-add-block-modal",title:S,closeLabel:"关闭添加题块",closeIcon:f.jsx(ko,{name:"close",size:16}),onCancel:a,onEscapeKeyDown:w=>{x()&&(w.preventDefault(),w.stopPropagation())},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ce,{onClick:a,children:"取消"}),f.jsx(ce,{type:"primary",disabled:!c||!m.includes(c),onClick:()=>{c&&m.includes(c)&&i(c)},children:"添加"})]}),children:[f.jsx("div",{className:"card-question-types",role:"group","aria-label":"选择题型",children:u.map(w=>f.jsx(ce,{"aria-pressed":c===w,onClick:()=>l(w),children:p[w]},w))}),f.jsx("div",{className:"card-question-types card-area-types",role:"group","aria-label":"纸面区域",children:f.jsx(ce,{"aria-pressed":c===d,onClick:()=>l(d),children:p[d]})})]})}function zl({label:t,value:r,min:i,max:a,onChange:c}){const[l,u]=E.useState();return f.jsx(Ea,{className:"ui-control ui-number","aria-label":t,min:i,max:a,precision:0,value:l===void 0?r:l,onChange:d=>{u(d),d!==null&&d>=i&&d<=a&&d!==r&&c(d)},onBlur:()=>{if(l!==void 0){const d=Math.max(i,Math.min(a,l??i));d!==r&&c(d),u(void 0)}}})}function Pi({label:t,value:r,min:i=.5,max:a=15,placeholder:c,onChange:l}){const[u,d]=E.useState(),m=u==null||Gn(u)&&u>=i&&u<=a;return f.jsx(Ea,{className:"ui-control ui-number","aria-label":t,value:u===void 0?r:u,min:i,max:a,step:.5,placeholder:c,status:m?void 0:"error",onChange:p=>{d(p),(p===null||Gn(p)&&p>=i&&p<=a)&&l(p)},onBlur:()=>d(void 0)})}function MR({value:t,creation:r,onChange:i}){const[a,c]=E.useState("all"),[l,u]=E.useState([]),[d,m]=E.useState("settings"),[p,C]=E.useState("keep"),[g,b]=E.useState(null),[v,x]=E.useState(null),[S,w]=E.useState("keep"),[T,j]=E.useState(null),[R,O]=E.useState(1),[M,D]=E.useState(null),[_,I]=E.useState(""),[z,H]=E.useState(""),L=t.questions.filter(Y=>a==="all"||l.includes(Y.id)).map(Y=>Y.id),$=()=>{const Y={};p!=="keep"&&(Y.kind=p),g!==null&&(Y.optionCount=g),v!==null&&(Y.score=v),S!=="keep"&&(Y.scoreType=S),T!==null&&S!=="ITEM_SCORE"&&(Y.lessScore=T);let U;d==="settings"?U={type:d,patch:Y}:d==="numbering"?U={type:d,start:R}:d==="average"?U={type:d,total:M??0}:U={type:d,text:_};const q=tS(t,L,U,r);H(q.error||""),q.value&&i(q.value)};return f.jsxs("details",{className:"card-choice-batch",children:[f.jsx("summary",{children:"批量设置"}),f.jsxs("div",{className:"card-choice-batch-fields",children:[f.jsxs("label",{className:"card-field",children:["范围",f.jsxs(Ft,{"aria-label":"批量修改范围",value:a,onChange:c,children:[f.jsx("option",{value:"all",children:"全部题目"}),f.jsx("option",{value:"selected",children:"指定题目"})]})]}),f.jsxs("label",{className:"card-field",children:["操作",f.jsxs(Ft,{"aria-label":"选择题批量操作",value:d,onChange:Y=>{m(Y),H("")},children:[f.jsx("option",{value:"settings",children:"修改属性"}),f.jsx("option",{value:"numbering",children:"连续题号"}),f.jsx("option",{value:"average",children:"平均分配总分"}),f.jsx("option",{value:"answers",children:"录入答案"})]})]}),a==="selected"&&f.jsx("div",{className:"card-choice-batch-selection",role:"group","aria-label":"选择批量修改题目",children:t.questions.map(Y=>f.jsxs(Lt,{checked:L.includes(Y.id),onChange:U=>u(q=>U.target.checked?[...q,Y.id]:q.filter(P=>P!==Y.id)),children:["第 ",Y.label," 题"]},Y.id))}),d==="settings"&&f.jsxs("div",{className:"card-choice-batch-properties",children:[f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Ft,{"aria-label":"批量选择题类型",value:p,onChange:C,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(Ea,{className:"ui-control ui-number","aria-label":"批量选项个数",placeholder:"保持不变",min:2,max:bn.options,precision:0,value:g,onChange:b})]}),f.jsxs("label",{className:"card-field",children:["每题分值",f.jsx(Pi,{label:"批量每题分值",value:v,placeholder:"保持不变",onChange:x})]}),f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Ft,{"aria-label":"批量少选计分",value:S,onChange:w,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),S!=="ITEM_SCORE"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Pi,{label:"批量少选得分",min:0,value:T,placeholder:"保持不变",onChange:j})]})]}),d==="numbering"&&f.jsxs("label",{className:"card-field",children:["起始题号",f.jsx(zl,{label:"批量起始题号",min:1,max:1e3,value:R,onChange:O})]}),d==="average"&&f.jsxs("label",{className:"card-field",children:["所选题目总分",f.jsx(Pi,{label:"平均分配总分",max:bn.score*L.length,value:M,onChange:D})]}),d==="answers"&&f.jsxs("label",{className:"card-field card-choice-batch-answers",children:["按题目顺序录入",f.jsx(Ml,{"aria-label":"批量选择题答案",value:_,rows:3,placeholder:"每题一组,如 A BC D;- 表示清空",onChange:Y=>I(Y.target.value)})]}),z&&f.jsx("div",{className:"card-choice-error",role:"alert",children:z}),f.jsxs(ce,{className:"card-choice-batch-apply",type:"primary",disabled:!L.length,onClick:$,children:["应用到 ",L.length," 题"]})]})]})}function Y0({value:t,document:r,creation:i,selectedId:a,onSelect:c,onChange:l,singleQuestion:u=!1}){const[d,m]=E.useState([]),[p,C]=E.useState([]),g=t.questions.find(L=>L.id===a)||t.questions[0],b=t.questions.indexOf(g),v=su(t),x=ou(t),S=Bs(r),w=new Set(t.questions.map(L=>L.options.length)).size>1,T=()=>({value:t,selectedId:g?.id}),j=(L,$=g?.id)=>{m(U=>[...U.slice(-49),T()]),C([]),l({...L,source:"manual"});const Y=L.questions.find(U=>U.id===$)||L.questions[Math.max(0,Math.min(b,L.questions.length-1))];Y&&c(Y.id)},R=L=>{l(L.value),L.selectedId&&c(L.selectedId)},O=L=>j({...t,questions:t.questions.map($=>$.id===g.id?{...$,...L}:$)}),M=L=>O(eu(g,L,i)),D=L=>{const $=[...t.questions];$.splice(b,1),$.splice(b+L,0,g),j({...t,questions:$})},_=(L=!1)=>{const $=L&&g?eS(g,nu(t.questions)):{...ra(0),label:nu(t.questions)},Y=[...t.questions];Y.splice(b+1,0,$),j({...t,questions:Y},$.id)},I=t.questions.reduce((L,$)=>L+($.score??0),0),z=t.questions.filter(L=>typeof L.score!="number").length,H=g&&(mm(t.questions,g.id,g.label)||tu(g));return f.jsxs("div",{className:"card-choice-settings","aria-label":"选择题设置",children:[u&&f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Ft,{"aria-label":"选择题填涂位置",value:x,onChange:L=>j(au(t,r,L)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),!u&&f.jsxs("div",{children:[f.jsxs("div",{className:"card-choice-summary","aria-label":"选择题配置概况",children:[t.questions.length," 题 · ",z===t.questions.length?"未设分":`${I} 分${z?` · ${z} 题未设分`:""}`]}),f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Ft,{"aria-label":"选择题填涂位置",value:x,onChange:L=>j(au(t,r,L)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),f.jsxs("label",{className:"card-field",children:["题目数量",f.jsx(zl,{label:"选择题数量",min:1,max:bn.questions,value:t.questions.length,onChange:L=>{const $=t.questions.slice(0,L);for(;$.length<L;)$.push({...ra(0),label:nu($)});j({...t,questions:$})}})]}),f.jsxs("div",{className:"card-choice-layout-fields",children:[f.jsxs("label",{className:"card-field",children:["题目排列方向",f.jsxs(Ft,{"aria-label":"填涂排列方向",value:v,onChange:L=>j({...t,direction:L}),children:[f.jsx("option",{value:"row",disabled:w,children:"横排(先右后下)"}),f.jsx("option",{value:"column",children:w?"竖排(选项数不同)":"竖排(先下后右)"})]})]}),v==="column"&&f.jsxs("label",{className:"card-field",children:["每列题数",f.jsx(zl,{label:"每列题数",min:1,max:5,value:t.rowsPerColumn,onChange:L=>j({...t,rowsPerColumn:L})})]})]})]}),g&&f.jsxs("div",{className:"card-choice-question-settings",children:[!u&&f.jsxs("label",{className:"card-field",children:["当前题目",f.jsx(Ft,{"aria-label":"当前选择题",value:g.id,onChange:c,children:t.questions.map(L=>f.jsxs("option",{value:L.id,children:["第 ",L.label," 题"]},L.id))})]}),x!=="concentrated"&&f.jsxs("label",{className:"card-field",children:["对应正文选项",f.jsxs(Ft,{"aria-label":"填涂对应正文选项",value:S.some(L=>L.id===g.contentTarget?.groupId)?g.contentTarget.groupId:"",onChange:L=>{const $=S.find(Y=>Y.id===L);O({contentTarget:$?{groupId:$.id,optionIds:$.options.map(Y=>Y.id)}:null})},children:[f.jsx("option",{value:"",children:"未指定(集中显示)"}),S.map((L,$)=>f.jsxs("option",{value:L.id,disabled:t.questions.some(Y=>Y.id!==g.id&&Y.contentTarget?.groupId===L.id),children:["第 ",L.label||$+1," 组选项(",L.options.length," 项)"]},L.id))]})]}),!u&&f.jsxs("label",{className:"card-field",children:["题号",f.jsx(wa,{"aria-label":"选择题题号",value:g.label,maxLength:12,onChange:L=>O({label:L.target.value})})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(zl,{label:"选择题选项个数",min:2,max:Math.max(bn.options,g.options.length),value:g.options.length,onChange:L=>M({optionCount:L})})]}),f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Ft,{"aria-label":"选择题类型",value:Z1(g),onChange:L=>M({kind:L}),children:[f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),!u&&f.jsxs("label",{className:"card-field",children:["本题分值",f.jsx(Pi,{label:"选择题分值",value:g.score??null,placeholder:"未设置",onChange:L=>M({score:L})})]}),g.multiple&&f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Ft,{"aria-label":"选择题少选计分",value:g.scoreType||"LESS_SCORE",onChange:L=>M({scoreType:L,lessScore:0}),children:[f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),g.multiple&&g.scoreType!=="ITEM_SCORE"&&typeof g.score=="number"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Pi,{label:"选择题少选得分",min:0,max:g.score,value:g.lessScore??0,onChange:L=>M({lessScore:L??0})})]}),f.jsxs("div",{className:"card-answer-key",role:"group","aria-label":"正确答案设置",children:[f.jsx("span",{children:"正确答案"}),f.jsx("div",{children:g.options.map(L=>f.jsx(ce,{type:"text","aria-label":`正确答案 ${L.label}`,"aria-pressed":g.correctIds.includes(L.id),onClick:()=>O({correctIds:g.correctIds.includes(L.id)?g.correctIds.filter($=>$!==L.id):g.multiple?[...g.correctIds,L.id]:[L.id]}),children:L.label},L.id))})]}),g.multiple&&g.scoreType==="ITEM_SCORE"&&f.jsxs("div",{className:"card-choice-rule","aria-label":"选项得分说明",children:["每项 ",J1(g)??"—"," 分 · 错选、不选 0 分"]}),H&&f.jsx("div",{className:"card-choice-error",role:"alert",children:H}),!u&&f.jsx(Lt,{className:"card-choice-break",checked:g.breakBefore,onChange:L=>O({breakBefore:L.target.checked}),children:"此题前换行"}),!u&&f.jsxs("div",{className:"card-choice-actions",role:"group","aria-label":"选择题操作",children:[f.jsx(ce,{type:"text","aria-label":"新增选择题",title:"在当前题后新增",disabled:t.questions.length>=bn.questions,onClick:()=>_(),children:"新增"}),f.jsx(ce,{type:"text","aria-label":"复制选择题配置",title:"复制当前题的填涂与计分配置,放在其后",disabled:t.questions.length>=bn.questions,onClick:()=>_(!0),children:"复制"}),f.jsx(ce,{type:"text","aria-label":"上移选择题",disabled:b<=0,onClick:()=>D(-1),children:"上移"}),f.jsx(ce,{type:"text","aria-label":"下移选择题",disabled:b>=t.questions.length-1,onClick:()=>D(1),children:"下移"}),f.jsx(ce,{type:"text",danger:!0,"aria-label":"删除当前选择题",disabled:t.questions.length<=1,onClick:()=>{const L=t.questions.filter($=>$.id!==g.id);j({...t,questions:L},L[Math.min(b,L.length-1)]?.id)},children:"删除"})]})]},g.id),!g&&f.jsx(ce,{className:"card-choice-actions",onClick:()=>_(),children:"新增选择题"}),!u&&f.jsx(MR,{value:t,creation:i,onChange:j}),!u&&(d.length>0||p.length>0)&&f.jsxs("div",{className:"card-choice-history",children:[f.jsx(ce,{type:"text",className:"card-choice-undo",disabled:!d.length,onClick:()=>{const L=d.at(-1);m(d.slice(0,-1)),C($=>[...$,T()]),R(L)},children:"撤销选择题设置"}),f.jsx(ce,{type:"text",disabled:!p.length,onClick:()=>{const L=p.at(-1);C(p.slice(0,-1)),m($=>[...$,T()]),R(L)},children:"重做"})]})]})}function Zt({label:t,children:r}){return f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:t}),r]})}function ut({label:t,value:r,min:i=0,max:a=200,step:c=1,onChange:l}){return f.jsx(Zt,{label:t,children:f.jsx(Ea,{"aria-label":t,value:r,min:i,max:a,step:c,precision:c===1?0:1,onChange:u=>{u!==null&&Number.isFinite(u)&&l(Math.max(i,Math.min(a,Math.round(u/c)*c)))}})})}function tn({label:t,value:r,min:i=.5,max:a=70,onChange:c}){return f.jsx(Zt,{label:t,children:f.jsx(Ea,{"aria-label":t,placeholder:"未设置",min:i,max:a,step:.5,precision:1,value:r,onChange:l=>c(l===null?null:Math.max(i,Math.min(a,Math.round(l*2)/2)))})})}function cn({label:t,value:r,onChange:i,maxLength:a=200}){return f.jsx(Zt,{label:t,children:f.jsx(wa,{"aria-label":t,value:r,maxLength:a,onChange:c=>i(c.target.value)})})}function at({label:t,value:r,options:i,onChange:a}){return f.jsx(Zt,{label:t,children:f.jsx(Ft,{"aria-label":t,value:r,onChange:a,children:Object.entries(i).map(([c,l])=>f.jsx("option",{value:c,children:l},c))})})}function Bl({index:t,count:r,onAdd:i,onCopy:a,onDelete:c,onMove:l,name:u="小题",maximum:d=200}){return f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small","aria-label":`新增${u}`,disabled:r>=d,onClick:i,children:"新增"}),f.jsx(ce,{size:"small","aria-label":`复制当前${u}`,disabled:t<0||r>=d,onClick:a,children:"复制"}),f.jsx(ce,{size:"small","aria-label":`上移当前${u}`,disabled:t<=0,onClick:()=>l(-1),children:"↑"}),f.jsx(ce,{size:"small","aria-label":`下移当前${u}`,disabled:t<0||t>=r-1,onClick:()=>l(1),children:"↓"}),f.jsx(ce,{size:"small",danger:!0,"aria-label":`删除当前${u}`,disabled:t<0,onClick:c,children:"删除"})]})}function Ui({value:t,onEditor:r,...i}){const a=E.useRef(null),c=E.useCallback(u=>{a.current=u,r?.(u)},[r]),l=E.useRef(JSON.stringify(t));return E.useEffect(()=>{const u=JSON.stringify(t);u!==l.current&&(l.current=u,a.current&&JSON.stringify(a.current.getDocument())!==u&&a.current.syncDocument(t))},[t]),f.jsx(Ll,{ref:c,initialValue:t,...i})}function X0({value:t,onChange:r,drawing:i=!1}){const{uploadImage:a}=mt(),c=E.useRef(null),[l,u]=E.useState(!1),[d,m]=E.useState(""),p=E.useRef(!0),C=E.useRef({value:t,onChange:r});C.current={value:t,onChange:r},E.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const g=b=>r({...t,...b});return f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"作答区样式",value:t.style,options:{blank:"空白",lines:"横线",grid:"方格纸",characters:"作文格","four-lines":"四线三格",coordinates:"坐标网格"},onChange:b=>g({style:b})}),f.jsx(ut,{label:"作答行数",value:t.rows,min:0,max:120,onChange:b=>g({rows:b})}),f.jsx(ut,{label:"作答行高",value:t.rowHeight,min:16,max:80,onChange:b=>g({rowHeight:b})}),["characters","grid","coordinates"].includes(t.style)&&f.jsx(ut,{label:"每行格数",value:t.columns,min:4,max:40,onChange:b=>g({columns:b})}),t.style==="characters"&&f.jsx(ut,{label:"字数标记间隔",value:t.wordMark,min:0,max:500,onChange:b=>g({wordMark:b})})]}),f.jsx(Lt,{checked:t.title,onChange:b=>g({title:b.target.checked}),children:"标题填写区"}),i&&f.jsxs("div",{children:[f.jsx(cn,{label:"作图底图 URL",value:t.backgroundUrl,maxLength:4096,onChange:b=>g({backgroundUrl:b})}),f.jsx("input",{ref:c,type:"file",accept:"image/*",hidden:!0,onChange:async b=>{const v=b.target.files?.[0];if(b.target.value="",!!v){u(!0),m("");try{const x=a?await a(v):await new Promise((S,w)=>{const T=new FileReader;T.onload=()=>S(String(T.result)),T.onerror=()=>w(new Error("读取失败")),T.readAsDataURL(v)});if(!/^(https?:\/\/|data:image\/|blob:|\/)/i.test(x))throw new Error("图片地址无效");p.current&&C.current.onChange({...C.current.value,backgroundUrl:x})}catch{p.current&&m("图片上传失败,请重试")}finally{p.current&&u(!1)}}}}),f.jsx(ce,{size:"small",loading:l,onClick:()=>c.current?.click(),children:"上传底图"}),d&&f.jsx("p",{role:"alert",children:d})]})]})}function _R({value:t,onChange:r,correction:i=!1,practice:a=!1}){const[c,l]=E.useState(t[0]?.id),u=t.find(g=>g.id===c)||t[0],d=t.indexOf(u),m=i?"改错位置":a?"评价项":"评分点",p=g=>r(t.map(b=>b.id===u.id?{...b,...g}:b)),C=g=>{const b=g&&u?{...vo(u),label:Ir(t)}:{id:crypto.randomUUID(),label:Ir(t),score:null,prompt:"",answer:""},v=[...t];v.splice(d+1,0,b),r(v),l(b.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":`选择${m}`,children:t.map(g=>f.jsx(ce,{size:"small","aria-pressed":g.id===u?.id,onClick:()=>l(g.id),children:g.label},g.id))}),f.jsx(Bl,{name:m,maximum:20,index:d,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(oa(t,u.id,g)),onDelete:()=>r(t.filter(g=>g.id!==u.id))}),u&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:`${m}编号`,value:u.label,onChange:g=>p({label:g})}),f.jsx(tn,{label:`${m}分值`,value:u.score,onChange:g=>p({score:g})})]}),f.jsx(cn,{label:i?"原文位置/待改文字":a?"评价维度":"作答步骤提示",value:u.prompt,onChange:g=>p({prompt:g})}),f.jsx(Zt,{label:i?"改正答案":a?"评价标准":"评分要点",children:f.jsx(Ml,{"aria-label":i?"改正答案":a?"评价标准":"评分要点",value:u.answer,autoSize:{minRows:2,maxRows:5},onChange:g=>p({answer:g.target.value})})})]})]})}function DR({value:t,onChange:r,onInsert:i}){const[a,c]=E.useState(t[0]?.id),l=t.find(p=>p.id===a)||t[0],u=t.indexOf(l),d=p=>r(t.map(C=>C.id===l.id?{...C,...p}:C)),m=p=>{const C=p&&l?{...vo(l),label:Ir(t)}:{...bm(),label:Ir(t)},g=[...t];g.splice(u+1,0,C),r(g),c(C.id)};return f.jsxs("div",{className:"exercise-blank-settings",children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择空位",children:t.map(p=>f.jsx(ce,{size:"small","aria-pressed":p.id===l?.id,onClick:()=>c(p.id),children:p.label},p.id))}),f.jsx(Bl,{name:"空位",maximum:20,index:u,count:t.length,onAdd:()=>m(!1),onCopy:()=>m(!0),onMove:p=>r(oa(t,l.id,p)),onDelete:()=>{r(t.filter(p=>p.id!==l.id)),c(t[Math.max(0,u-1)]?.id)}}),l&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:"空位编号",value:l.label,onChange:p=>d({label:p})}),f.jsx(tn,{label:"每空分值",value:l.score,max:15,onChange:p=>d({score:p})}),f.jsx(at,{label:"空位样式",value:l.style,options:{line:"横线",brackets:"括号",box:"方框",characters:"字格"},onChange:p=>d({style:p})}),f.jsx(at,{label:"空位宽度",value:String(l.width),options:{20:"1/5 行",25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:p=>d({width:Number(p)})}),l.style==="characters"&&f.jsx(ut,{label:"字格数量",value:l.characters,min:1,max:40,onChange:p=>d({characters:p})}),f.jsx(cn,{label:"空前提示",value:l.prefix,onChange:p=>d({prefix:p})}),f.jsx(cn,{label:"空后单位",value:l.suffix,onChange:p=>d({suffix:p})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(Lt,{checked:l.breakAfter,onChange:p=>d({breakAfter:p.target.checked}),children:"此空后换行"}),f.jsx(ce,{size:"small",onClick:()=>r(t.map(p=>({...p,width:l.width,style:l.style,characters:l.characters}))),children:"统一空位样式"})]}),f.jsx(ce,{size:"small",onClick:()=>i(l),children:"插入此空到题干"}),f.jsx(Zt,{label:"可接受答案(每行一个)",children:f.jsx(Ml,{"aria-label":"可接受答案",value:l.answers.join(`
200
+ */var M0;function LA(){return M0||(M0=1,(function(t){(function(){var r={}.hasOwnProperty;function i(){for(var l="",u=0;u<arguments.length;u++){var d=arguments[u];d&&(l=c(l,a(d)))}return l}function a(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return i.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var u="";for(var d in l)r.call(l,d)&&l[d]&&(u=c(u,d));return u}function c(l,u){return u?l?l+" "+u:l+u:l}t.exports?(i.default=i,t.exports=i):window.classNames=i})()})(Zd)),Zd.exports}var zA=LA();const _0=Pm(zA),D0=t=>{const{padding:r="",active:i=!1,className:a,...c}=t,l=E.useMemo(()=>{if(!r)return"unset";if(typeof r=="string")return r;if(typeof r=="number")return r+"px";if(Array.isArray(r))return r.map(u=>u+"px").join(" ")},[r]);return f.jsx("div",{...c,className:_0(a,N0["press-wrapper"],i?N0.active:""),style:{padding:l},children:t.children})};function I0({title:t,children:r}){const[i,a]=E.useState(null);return f.jsxs(dA,{children:[f.jsx(fA,{asChild:!0,children:f.jsx("span",{ref:a,className:"ui-tooltip-trigger",children:r})}),f.jsx(hA,{container:g0(i),className:"ui-tooltip",side:"top",sideOffset:6,children:t})]})}const BA={"icon-quanping":NA,"icon-quxiaoquanping":MA,"icon-shitudaohang":DA},k0=t=>{const{type:r,children:i,tooltip:a,...c}=t,l=BA[r];return a?f.jsx(I0,{title:a,children:f.jsx(D0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})}):f.jsx(D0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})};function HA({className:t,type:r,...i}){return f.jsx("input",{type:r,"data-slot":"input",className:Ve("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...i})}function PA({className:t,...r}){return f.jsx("textarea",{"data-slot":"textarea",className:Ve("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",t),...r})}const Oa=E.forwardRef(function({className:r,controlSize:i,size:a,status:c,...l},u){return f.jsx(HA,{...l,ref:u,"aria-invalid":c==="error"||l["aria-invalid"],"data-control-size":i||(a==="small"?"compact":a),className:Ve("ui-control ui-input",r)})});function Pl({autoSize:t,className:r,...i}){const a=E.useRef(null);return E.useLayoutEffect(()=>{const c=a.current;if(!c||!t)return;const l=getComputedStyle(c),u=parseFloat(l.lineHeight)||20,d=parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)+2;c.style.height="0px",c.style.height=`${Math.max(t.minRows*u+d,Math.min(t.maxRows*u+d,c.scrollHeight+2))}px`},[i.value,t]),f.jsx(PA,{...i,ref:a,className:Ve("ui-control ui-textarea",r)})}function UA({...t}){return f.jsx(e2,{"data-slot":"select",...t})}function $A({...t}){return f.jsx(v2,{"data-slot":"select-group",...t})}function GA({...t}){return f.jsx(o2,{"data-slot":"select-value",...t})}function VA({className:t,size:r="default",children:i,...a}){return f.jsxs(n2,{"data-slot":"select-trigger","data-size":r,className:Ve("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...a,children:[i,f.jsx(a2,{asChild:!0,children:f.jsx(v0,{className:"size-4 opacity-50"})})]})}function qA({container:t,className:r,children:i,position:a="item-aligned",align:c="center",...l}){return f.jsx(c2,{container:t,children:f.jsxs(u2,{"data-slot":"select-content",className:Ve("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:a,align:c,...l,children:[f.jsx(KA,{}),f.jsx(g2,{className:Ve("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:i}),f.jsx(FA,{})]})})}function YA({className:t,...r}){return f.jsx(C2,{"data-slot":"select-label",className:Ve("px-2 py-1.5 text-xs text-muted-foreground",t),...r})}function XA({className:t,children:r,...i}){return f.jsxs(E2,{"data-slot":"select-item",className:Ve("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(A2,{children:f.jsx(b0,{className:"size-4"})})}),f.jsx(T2,{children:r})]})}function KA({className:t,...r}){return f.jsx(R2,{"data-slot":"select-scroll-up-button",className:Ve("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(AA,{className:"size-4"})})}function FA({className:t,...r}){return f.jsx(O2,{"data-slot":"select-scroll-down-button",className:Ve("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(v0,{className:"size-4"})})}function Wd(t){return E.Children.toArray(t).flatMap(r=>E.isValidElement(r)?r.type===E.Fragment?Wd(r.props.children):r.type==="optgroup"?[{label:r.props.label,options:Wd(r.props.children)}]:[{value:String(r.props.value??r.props.children??""),label:r.props.children,disabled:r.props.disabled}]:[])}const Ul="__empty_option__";function L0(t,r){return t.map((i,a)=>i.options?f.jsxs($A,{children:[f.jsx(YA,{children:i.label}),L0(i.options,r)]},a):f.jsx(XA,{value:String(i.value)||Ul,disabled:i.disabled,"data-option-value":i.value,onKeyDown:c=>{c.key==="Enter"&&!i.disabled&&(c.preventDefault(),r(String(i.value)||Ul))},children:i.label},String(i.value)))}function Wt({className:t,controlSize:r,size:i,children:a,options:c,value:l,onChange:u,disabled:d,...m}){const p=E.useRef(null),[C,g]=E.useState(!1),b=v=>{if(v){g(!0);return}const S=!!document.activeElement?.closest('[data-slot="select-content"]');Yr.flushSync(()=>g(!1)),S&&p.current?.focus({preventScroll:!0})},x=v=>{b(!1),u?.(v===Ul?"":v)};return f.jsxs(UA,{value:l===void 0?void 0:String(l)||Ul,onValueChange:x,disabled:d,open:C,onOpenChange:b,children:[f.jsx(VA,{...m,ref:p,className:Ve("ui-control ui-select",t),"data-value":l===void 0?"":String(l),"data-control-size":r||(i==="small"?"compact":i),children:f.jsx(GA,{})}),f.jsx(qA,{container:g0(p.current),position:"popper",align:"start",className:"ui-select-popup",onCloseAutoFocus:v=>v.preventDefault(),onEscapeKeyDown:v=>{v.preventDefault(),v.stopPropagation(),b(!1)},children:L0(c||Wd(a),x)})]})}const z0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,B0=Jm,QA=((t,r)=>i=>{var a;if(r?.variants==null)return B0(t,i?.class,i?.className);const{variants:c,defaultVariants:l}=r,u=Object.keys(c).map(p=>{const C=i?.[p],g=l?.[p];if(C===null)return null;const b=z0(C)||z0(g);return c[p][b]}),d=i&&Object.entries(i).reduce((p,C)=>{let[g,b]=C;return b===void 0||(p[g]=b),p},{}),m=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((p,C)=>{let{class:g,className:b,...x}=C;return Object.entries(x).every(v=>{let[S,w]=v;return Array.isArray(w)?w.includes({...l,...d}[S]):{...l,...d}[S]===w})?[...p,g,b]:p},[]);return B0(t,u,m,i?.class,i?.className)})("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function H0({className:t,variant:r="default",size:i="default",asChild:a=!1,...c}){const l=a?FC:"button";return f.jsx(l,{"data-slot":"button","data-variant":r,"data-size":i,className:Ve(QA({variant:r,size:i,className:t})),...c})}function ue({type:t="default",htmlType:r="button",size:i="middle",danger:a,loading:c,className:l,children:u,...d}){return f.jsxs(H0,{variant:t==="primary"?"default":t==="text"?"ghost":"outline",size:i==="small"?"xs":i==="large"?"lg":"sm",...d,type:r,disabled:d.disabled||c,"aria-busy":c||void 0,className:Ve("ui-button",a&&"ui-danger",l),children:[c&&f.jsx(OA,{className:"animate-spin","aria-hidden":"true"}),u]})}function ZA({className:t,...r}){return f.jsx($E,{"data-slot":"checkbox",className:Ve("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",t),...r,children:f.jsx(VE,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(b0,{className:"size-3.5"})})})}function zt({children:t,className:r,onChange:i,id:a,...c}){const l=E.useId();return f.jsxs("label",{className:Ve("ui-checkbox-label",r),htmlFor:a||l,children:[f.jsx(ZA,{...c,id:a||l,className:"ui-checkbox",onCheckedChange:u=>i?.({target:{checked:u===!0}})}),t&&f.jsx("span",{children:t})]})}function Na({value:t,onChange:r,precision:i,className:a,onBlur:c,...l}){const[u,d]=E.useState(t==null?"":String(t));return E.useEffect(()=>{d(t==null?"":String(t))},[t]),f.jsx(Oa,{...l,type:"number",inputMode:"decimal",className:Ve("ui-number",a),value:u,onChange:m=>{const p=m.target.value;d(p),p?Number.isFinite(Number(p))&&r?.(Number(p)):r?.(null)},onBlur:m=>{const p=Number(u),C=u&&Number.isFinite(p)&&i!==void 0?String(Number(p.toFixed(i))):u;d(t==null?"":C||String(t)),c?.(m)}})}function WA({...t}){return f.jsx(EE,{"data-slot":"dialog",...t})}function JA({...t}){return f.jsx(jE,{"data-slot":"dialog-portal",...t})}function eR({...t}){return f.jsx(dd,{"data-slot":"dialog-close",...t})}function tR({className:t,...r}){return f.jsx(AE,{"data-slot":"dialog-overlay",className:Ve("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...r})}function nR({className:t,children:r,showCloseButton:i=!0,portal:a=!0,overlay:c=!0,...l}){const u=f.jsxs(E.Fragment,{children:[c&&f.jsx(tR,{className:"ui-dialog-overlay"}),f.jsxs(NE,{"data-slot":"dialog-content",className:Ve("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",t),...l,children:[r,i&&f.jsxs(dd,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(kA,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]});return a?f.jsx(JA,{children:u}):u}function rR({className:t,...r}){return f.jsx("div",{"data-slot":"dialog-header",className:Ve("flex flex-col gap-2 text-center sm:text-left",t),...r})}function oR({className:t,showCloseButton:r=!1,children:i,...a}){return f.jsxs("div",{"data-slot":"dialog-footer",className:Ve("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a,children:[i,r&&f.jsx(dd,{asChild:!0,children:f.jsx(H0,{variant:"outline",children:"Close"})})]})}function aR({className:t,...r}){return f.jsx(DE,{"data-slot":"dialog-title",className:Ve("text-lg leading-none font-semibold",t),...r})}function Vi({open:t,modal:r=!0,panelRef:i,width:a=460,zIndex:c=900,className:l,title:u,footer:d,children:m,classNames:p,closeLabel:C,closeIcon:g,onCancel:b,onOpenAutoFocus:x,onEscapeKeyDown:v,wrapProps:S}){const w=E.useId(),T=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return f.jsx(WA,{open:t,modal:r,onOpenChange:j=>{j||b()},children:f.jsxs(nR,{...S,ref:i,portal:!1,overlay:r,showCloseButton:!1,"aria-describedby":void 0,"aria-labelledby":w,"aria-modal":r,className:Ve("ui-dialog",l),style:{width:a,zIndex:c},onInteractOutside:j=>j.preventDefault(),onOpenAutoFocus:x,onEscapeKeyDown:j=>{if(!r&&j.target instanceof Element&&!j.target.closest(".ui-dialog")){j.preventDefault();return}v?.(j)},onCloseAutoFocus:j=>{j.preventDefault(),r&&T.current?.isConnected&&T.current.focus({preventScroll:!0})},children:[f.jsxs("div",{className:"ui-dialog-surface",children:[f.jsx(rR,{className:Ve("ui-dialog-header",p?.header),children:f.jsx(aR,{asChild:!0,id:w,children:f.jsx("div",{className:"ui-dialog-title",children:u})})}),f.jsx("div",{className:Ve("ui-dialog-body",p?.body),children:m}),d&&f.jsx(oR,{className:Ve("ui-dialog-footer",p?.footer),children:d})]}),f.jsx(eR,{"aria-label":C,className:"ui-dialog-close",children:g})]})})}function iR({className:t,...r}){return f.jsx(Hj,{"data-slot":"radio-group",className:Ve("grid gap-3",t),...r})}function sR({children:t,indicator:r=!0,className:i,...a}){return f.jsxs(Gj,{"data-slot":"radio-group-item",className:Ve("aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",i),...a,children:[r&&f.jsx(qj,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(RA,{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary"})}),t]})}function lR(t){return null}function cR({value:t,onChange:r,children:i,className:a,name:c,disabled:l}){const u=E.Children.toArray(i).filter(E.isValidElement);return f.jsx(iR,{name:c,disabled:l,className:Ve("ui-radio-group",a),value:String(t),onValueChange:d=>{const m=u.find(p=>String(p.props.value)===d);m&&r({target:{value:m.props.value}})},children:u.map(({props:d})=>f.jsx(sR,{value:String(d.value),disabled:d.disabled,className:"ui-radio-option",indicator:!1,children:d.children},String(d.value)))})}const Ye={Group:cR,Button:lR};function uR({thumbLabel:t,className:r,defaultValue:i,value:a,min:c=0,max:l=100,...u}){const d=E.useMemo(()=>Array.isArray(a)?a:Array.isArray(i)?i:[c,l],[a,i,c,l]);return f.jsxs(z2,{"data-slot":"slider",defaultValue:i,value:a,min:c,max:l,className:Ve("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",r),...u,children:[f.jsx(U2,{"data-slot":"slider-track",className:Ve("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx($2,{"data-slot":"slider-range",className:Ve("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:d.length},(m,p)=>f.jsx(X2,{"data-slot":"slider-thumb","aria-label":t,className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},p))]})}function P0({value:t,onChange:r,ariaLabelForHandle:i,...a}){return f.jsx(uR,{...a,value:[t],onValueChange:c=>r(c[0]),thumbLabel:i})}const U0=t=>{let r;const i=new Set,a=(p,C)=>{const g=typeof p=="function"?p(r):p;if(!Object.is(g,r)){const b=r;r=C??(typeof g!="object"||g===null)?g:Object.assign({},r,g),i.forEach(x=>x(r,b))}},c=()=>r,d={setState:a,getState:c,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p))},m=r=t(a,c,d);return d},dR=(t=>t?U0(t):U0),fR=t=>t;function hR(t,r=fR){const i=Ni.useSyncExternalStore(t.subscribe,Ni.useCallback(()=>r(t.getState()),[t,r]),Ni.useCallback(()=>r(t.getInitialState()),[t,r]));return Ni.useDebugValue(i),i}const $0=t=>{const r=dR(t),i=a=>hR(r,a);return Object.assign(i,r),i},mR=(t=>t?$0(t):$0),$l={min:20,max:150},G0={width:4e3,height:2e3},V0={width:210,height:297},Uo=mR((t,r)=>({scale:100,navigatorVisible:!0,setScale:i=>t(a=>({...a,scale:Math.max($l.min,Math.min($l.max,Math.round(i)))})),getScale:()=>r().scale,setNavigatorVisible:i=>t(a=>({...a,navigatorVisible:i}))})),pR=()=>{const{scale:t,setScale:r,getScale:i}=Uo(),a=c=>r(i()+c);return E.useEffect(()=>{const c=document.getElementById("answer-sheet-stadio"),l=d=>{if(!d.ctrlKey)return;d.preventDefault();const m=document.getElementById("answer-sheet"),p=m.getBoundingClientRect(),C=(d.clientX-p.left)/p.width,g=(d.clientY-p.top)/p.height;Yr.flushSync(()=>r(i()+(d.deltaY<0?5:-5)));const b=m.getBoundingClientRect();c.scrollLeft+=b.left+C*b.width-d.clientX,c.scrollTop+=b.top+g*b.height-d.clientY},u=d=>{(d.ctrlKey||d.metaKey)&&(d.key==="+"||d.key==="="||d.key==="-")&&(d.preventDefault(),r(i()+(d.key==="-"?-10:10)))};return c.addEventListener("wheel",l,{passive:!1}),window.addEventListener("keydown",u),()=>{c.removeEventListener("wheel",l),window.removeEventListener("keydown",u)}},[i,r]),f.jsxs("div",{className:Qd["scale-wrapper"],"aria-label":"工作区缩放",children:[f.jsx(ue,{type:"text",size:"small","aria-label":"缩小",onClick:()=>a(-2),children:f.jsx(_A,{})}),f.jsx(P0,{className:Qd.bar,ariaLabelForHandle:"缩放比例",min:$l.min,max:$l.max,step:1,value:t,onChange:r}),f.jsx(ue,{type:"text",size:"small","aria-label":"放大",onClick:()=>a(2),children:f.jsx(IA,{})}),f.jsx(I0,{title:"重置缩放",children:f.jsxs("div",{role:"button",tabIndex:0,"aria-label":"重置缩放",onClick:()=>r(100),onKeyDown:c=>{c.key==="Enter"&&r(100)},className:_0("font-12 grey ml-5 pointer",Qd.percent),children:[t,"%"]})})]})},gR=()=>{const[t,r]=E.useState(!1);E.useEffect(()=>{const a=()=>r(document.fullscreenElement===document.getElementById("uni-answer-sheet"));return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]);const i=async()=>{try{document.fullscreenElement?await document.exitFullscreen():await document.getElementById("uni-answer-sheet").requestFullscreen()}catch{}};return f.jsx(k0,{type:t?"icon-quxiaoquanping":"icon-quanping",className:"ml-5",padding:[0,5],role:"button",tabIndex:0,"aria-label":t?"取消全屏":"全屏",tooltip:t?"取消全屏":"全屏",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i())},onClick:i})},yR=({summary:t})=>{const{navigatorVisible:r,setNavigatorVisible:i}=Uo();return f.jsxs("div",{className:gA.footer,"aria-label":"工作区底栏",children:[f.jsx("div",{className:"font-12 grey",children:t}),f.jsxs("div",{children:[f.jsx(k0,{type:"icon-shitudaohang",padding:[0,5],tooltip:(r?"隐藏":"显示")+"视图导航",active:r,role:"button",tabIndex:0,"aria-label":(r?"隐藏":"显示")+"视图导航",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i(!r))},className:"mr-5",onClick:()=>i(!r)}),f.jsx(pR,{}),f.jsx(gR,{})]})]})},q0={"stadio-wrapper":"_stadio-wrapper_jknpq_1",container:"_container_jknpq_15"},bR=({width:t=Ro(V0.width),height:r=Ro(V0.height),children:i})=>{const{scale:a}=Uo();return f.jsx("div",{id:"answer-sheet",style:{transform:`scale(${a/100})`,height:r,width:t},children:i})};var qi=(t=>(t.STADIO_SCROLL_CHANGE="STADIO_SCROLL_CHANGE",t))(qi||{});class xR{constructor(){gm(this,"callbacks",new Map)}on(r,i){this.callbacks.set(r,i)}emit(r,...i){const a=this.callbacks.get(r);a&&a(i)}depose(r){this.callbacks.delete(r)}}const Gl=new xR,vR=({width:t,height:r,children:i,onBackgroundClick:a})=>{const c=E.useRef(null),l=E.useRef(null),{scale:u}=Uo(),d=u/100,m=Math.max(G0.width,t*d+600),p=Math.max(G0.height,r*d+600),C=E.useRef(null);return E.useLayoutEffect(()=>{const g=l.current,b=(m-t*d)/2,x=(p-r*d)/2,v=C.current;if(!v||v.width!==t)g.scrollLeft=Math.max(0,b+t*d/2-g.clientWidth/2),g.scrollTop=Math.max(0,x-54);else{const S=(g.scrollLeft+g.clientWidth/2-v.left)/v.zoom,w=(g.scrollTop+g.clientHeight/2-v.top)/v.zoom;g.scrollLeft=b+S*d-g.clientWidth/2,g.scrollTop=x+w*d-g.clientHeight/2}C.current={left:b,top:x,zoom:d,width:t},Gl.emit(qi.STADIO_SCROLL_CHANGE)},[m,p,t,r,d]),E.useEffect(()=>{const g=l.current,b=c.current;let x=()=>{};const v=w=>{if(w.button!==1)return;w.preventDefault(),x();const T=w.clientX,j=w.clientY,R=g.scrollLeft,O=g.scrollTop,M=document.body.style.cursor;document.body.style.cursor="grabbing";const D=I=>g.scrollTo({left:R-I.clientX+T,top:O-I.clientY+j}),_=I=>{I.button===1&&x()};x=()=>{document.body.style.cursor=M,window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",_),window.removeEventListener("blur",x)},window.addEventListener("mousemove",D),window.addEventListener("mouseup",_),window.addEventListener("blur",x)},S=()=>Gl.emit(qi.STADIO_SCROLL_CHANGE);return b.addEventListener("mousedown",v),g.addEventListener("scroll",S),()=>{x(),b.removeEventListener("mousedown",v),g.removeEventListener("scroll",S)}},[]),f.jsx("div",{className:q0["stadio-wrapper"],ref:l,id:"answer-sheet-stadio","aria-label":"制卡工作区",children:f.jsx("div",{className:q0.container,ref:c,id:"answer-sheet-container",style:{height:p,width:m},onPointerDown:g=>{g.target===g.currentTarget&&a?.()},children:f.jsx(bR,{width:t,height:r,children:i})})})},Jd={"navigator-wrapper":"_navigator-wrapper_rb3fn_1","fake-page":"_fake-page_rb3fn_12",viewport:"_viewport_rb3fn_17"},SR=()=>{const{scale:t}=Uo(),[r,i]=E.useState({ratio:20,width:200,height:100,view:{x:0,y:0,width:0,height:0},pages:[]}),a=E.useRef(null),c=E.useRef(()=>{});return E.useEffect(()=>{const l=document.getElementById("answer-sheet-stadio"),u=document.getElementById("answer-sheet-container"),d=document.getElementById("answer-sheet");let m=0;const p=()=>{const b=Math.max(20,u.offsetWidth/200,u.offsetHeight/160),x=u.getBoundingClientRect(),v=Array.from(d.querySelectorAll("[data-paper-page]")),S=(v.length?v:[d]).map(T=>{const j=T.getBoundingClientRect();return{x:(j.left-x.left)/b,y:(j.top-x.top)/b,width:j.width/b,height:j.height/b}}),w={ratio:b,width:u.offsetWidth/b,height:u.offsetHeight/b,view:{x:l.scrollLeft/b,y:l.scrollTop/b,width:l.clientWidth/b,height:l.clientHeight/b},pages:S};i(T=>JSON.stringify(T)===JSON.stringify(w)?T:w)},C=()=>{cancelAnimationFrame(m),m=requestAnimationFrame(p)};c.current=C;const g=new ResizeObserver(C);return[l,u,d].forEach(b=>g.observe(b)),Gl.on(qi.STADIO_SCROLL_CHANGE,C),C(),()=>{c.current=()=>{},cancelAnimationFrame(m),g.disconnect(),Gl.depose(qi.STADIO_SCROLL_CHANGE)}},[]),E.useLayoutEffect(()=>{c.current()},[t]),f.jsxs("div",{className:Jd["navigator-wrapper"],"aria-label":"视图导航",style:{width:r.width,height:r.height},children:[r.pages.map((l,u)=>f.jsx("div",{className:Jd["fake-page"],"data-nav-page":u+1,style:{left:l.x,top:l.y,width:l.width,height:l.height}},u)),f.jsx("div",{className:Jd.viewport,role:"button",tabIndex:0,"aria-label":"拖动导航视口",style:{left:r.view.x,top:r.view.y,width:r.view.width,height:r.view.height},onPointerDown:l=>{if(l.button!==0)return;l.preventDefault();const u=document.getElementById("answer-sheet-stadio");a.current={x:l.clientX,y:l.clientY,left:u.scrollLeft,top:u.scrollTop},l.currentTarget.setPointerCapture(l.pointerId)},onPointerMove:l=>{if(!a.current)return;document.getElementById("answer-sheet-stadio").scrollTo({left:a.current.left+(l.clientX-a.current.x)*r.ratio,top:a.current.top+(l.clientY-a.current.y)*r.ratio})},onPointerUp:l=>{a.current=null,l.currentTarget.releasePointerCapture(l.pointerId)},onLostPointerCapture:()=>{a.current=null},onKeyDown:l=>{const d={ArrowLeft:[-80,0],ArrowRight:[80,0],ArrowUp:[0,-80],ArrowDown:[0,80]}[l.key];d&&(l.preventDefault(),document.getElementById("answer-sheet-stadio").scrollBy({left:d[0],top:d[1]}))}})]})},ef=new WeakMap;function CR(t){return Array.from(t.querySelectorAll("[data-card-editor-host]")).flatMap(r=>{const i=ef.get(r),a=r.querySelector(".rt-content");if(!i||!a||a.closest("[hidden]")||!a.getClientRects().length)return[];const c=a.getBoundingClientRect(),l=c.width/a.offsetWidth,u=[...i.getAnswerRegions()],d=new Set(u.map(m=>m.id));return a.querySelectorAll(".rt-choice-stem-glyph").forEach(m=>{const p=m.dataset.optionId,C=m.getBoundingClientRect();!p||d.has(p)||C.width<=0||C.height<=0||(d.add(p),u.push({id:p,pos:-1,type:"choiceOption",attrs:{label:m.textContent||"",questionId:m.dataset.fillQuestionId},x:(C.x-c.x)/l,y:(C.y-c.y)/l,width:C.width/l,height:C.height/l}))}),u.map(m=>({element:a,region:m,rect:{x:c.x+m.x*l,y:c.y+m.y*l,width:m.width*l,height:m.height*l}}))})}const Y0=E.createContext(null),Vl=E.forwardRef((t,r)=>{const i=E.useContext(Y0);if(!i)throw new Error("制卡需要显式注册富文本插件");const a=E.useRef(null),c=E.useRef(null),l=E.useRef(t);l.current=t;const u=E.useRef(null),d=E.useRef(null),m=E.useRef(!1),p=E.useRef(0),C=()=>({...l.current,onChange:b=>l.current.onChange?.(b),onLayout:b=>l.current.onLayout?.(b),onContentSelect:b=>l.current.onContentSelect?.(b)}),g=b=>{const x=c.current,v=++p.current;x&&x.ready.then(()=>{let S=0;const w=()=>{v!==p.current||c.current!==x||l.current.readOnly||(x.getStatus().editable?b(x):++S<120&&requestAnimationFrame(w))};requestAnimationFrame(w)}).catch(S=>{d.current=S})};return E.useImperativeHandle(r,()=>({getDocument:()=>m.current?c.current.getDocument():null,getAnswerRegions:()=>m.current?c.current.getAnswerRegions():[],setDocument(b){m.current?c.current.setDocument(b):u.current=b},syncDocument(b){m.current?c.current.syncDocument(b):u.current=b},focus:b=>g(x=>x.focus(b)),focusContent:b=>l.current.contentTargets?.some(x=>x.id===b)?(g(x=>{x.focusContent(b)||x.focus("start")}),!0):!1,insertAnswerRegion:(b,x,v)=>g(S=>S.insertAnswerRegion(b,x,v)),getStatus(){if(d.current)throw d.current;return m.current?c.current.getStatus():{ready:!1,editable:!1,composing:!1,uploading:!1,layoutPending:!0}}}),[]),E.useEffect(()=>{let b=!0;d.current=null;const x=document.createElement("div");x.style.display="contents",a.current.append(x);const v=i.create(x,C()),S=a.current;return ef.set(S,v),c.current=v,v.ready.then(()=>{b&&(m.current=!0,v.setOptions(C()),u.current&&(v.syncDocument(u.current),u.current=null))}).catch(w=>{b&&(d.current=w)}),()=>{b=!1,m.current=!1,c.current=null,p.current++,ef.delete(S),x.remove(),queueMicrotask(()=>v.destroy())}},[i]),E.useEffect(()=>{c.current?.setOptions(C())}),f.jsx("div",{ref:a,"data-card-editor-host":"",style:{display:"contents"}})}),X0={judge:"JUDGE",fill:"FILLBLANK",answer:"SHORTANSWER",writing:"CCOMPOSITION",english:"ECOMPOSITION",reading:"READTHENANSWER",cloze:"CLOZE",completion:"TEXT_COMPLETION",matching:"INFO_MATCHING",chunk:"CHUNK_CHOICE",composite:"MIXED",optional:"SHORTANSWER"};function wR(t){if(t.reference||!t.exercise)return t;const r=t.exercise,i=X0[t.kind]||"SHORTANSWER",a=Su(i);return a.fillNewLine=r.fillNewLine,a.optional=t.kind==="optional"&&r.items.length>1,a.choose=Math.max(1,Math.min(r.chooseCount,r.items.length-1)),a.questions=r.items.map(c=>{const l=i==="MIXED"?c.kind==="choice"?c.choice.multiple?"MCHOICE":"SCHOICE":X0[c.kind]||"SHORTANSWER":i,u=l==="MIXED"?"SHORTANSWER":l,d=wu({...Cu(u),partCount:1,optionCount:u==="JUDGE"?2:c.choice.options.length,score:c.score},Number(c.label)||1);if(d.id=c.id,d.label=c.label,d.document=c.document,d.choice={...fa(c.choice,u,u==="JUDGE"?2:Math.min(u==="CHUNK_CHOICE"?26:12,c.choice.options.length)),id:c.id,label:c.label},d.characters=Math.min(1200,Math.max(1,c.area.rows*c.area.columns)),d.lines=Math.min(100,Math.max(1,c.area.rows)),d.height=Math.max(30,c.area.rows*c.area.rowHeight),u==="FILLBLANK"||u==="TEXT_COMPLETION")d.parts=c.blanks.map((m,p)=>({...ji(c.blanks.length===1?c.label:`${c.label}.${p+1}`,m.score,u),id:m.id,width:m.width,breakAfter:m.breakAfter})),d.score=Fn(d.parts);else if(u==="SHORTANSWER")d.parts=[{...ji(c.label,c.score,u),document:c.document,height:d.height}];else if(Be(u)){const m=ji(c.label,c.score,u,c.choice.options.length);d.parts=[{...m,choice:{...d.choice,id:m.id}}]}return["SHORTANSWER","CCOMPOSITION","ECOMPOSITION"].includes(u)&&(d.document={...d.document,content:{...d.document.content,content:[...Ci(d.label,d.score).content.content,...d.document.content.content||[]]}},d.parts=d.parts.map(m=>({...m,document:{...m.document,content:{...m.document.content,content:[...Ci(m.label,m.score).content.content,...m.document.content.content||[]]}}}))),d}),{...t,reference:a}}const nr="reference-merged-objective";function ER(t,r){const i=t.blocks.map(d=>d.reference&&t.choiceDirection&&t.choiceDirection!==d.reference.layout.direction?{...d,reference:{...d.reference,layout:{...d.reference.layout,direction:t.choiceDirection}}}:d);if(!t.mergeObjective)return i;const a=i.find(d=>d.reference?.questions.some(m=>Et(m.type)));if(!a?.reference)return i;const c=i.flatMap(d=>{if(!d.reference)return[];const m=la({...d.reference.layout,questions:ha(d.reference)},d.document,t.questionCard!==!1||r===d.id).concentrated,p=new Set(m.questions.map(C=>C.id));return d.reference.questions.filter(C=>Et(C.type)).flatMap(C=>{if(!Be(C.type))return p.has(C.id)?[C]:[];const g=C.parts.filter(b=>p.has(b.id));return g.length?[{...C,parts:g}]:[]})});if(!c.length)return i;const l={...a,id:nr,document:Vt(),reference:{...Su("MIXED"),layout:{...a.reference.layout,presentation:"concentrated"},questions:c}},u=i.flatMap(d=>{if(!d.reference)return[d];const m=d.reference.questions.filter(C=>!Et(C.type)),p=t.questionCard!==!1&&!Cn(d.document)||r===d.id;return!m.length&&!p&&d.reference.questions.length?[]:[d]});return[l,...u]}function K0(t){const r=t.reference;if(!r)return[];const i=r.type==="MIXED"?[{id:t.id,label:"公共材料",kind:"material"}]:[];return r.questions.forEach(a=>{const c=Be(a.type);i.push({id:a.id,label:c?`第 ${a.parts.map(l=>l.label).join("、")} 题材料`:`第 ${a.label} 题题干`,kind:c?"material":"question",choice:!c&&Et(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="JUDGE"}),a.parts.filter(l=>r.textVersion!==1||l.text).forEach(l=>i.push({id:l.id,label:`第 ${l.label} ${a.type==="FILLBLANK"?"空":"题"}`,kind:"question",parentId:a.id,choice:c&&Et(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="INFO_MATCHING",inlineOptions:r.textVersion===1&&["CLOZE","INFO_MATCHING"].includes(a.type),optionWidth:r.textVersion===1&&a.type==="INFO_MATCHING"?70:void 0}))}),i}function F0(t,r){return{...t,attrs:{...t.attrs,contentId:r}}}function TR(t,r,i){const a=new Map(r.questions.filter(u=>Ei(u.type)).flatMap(u=>u.parts).map(u=>[u.id,u])),c=u=>{const d=u.type==="answerLine"&&a.get(u.attrs?.id),m=d&&Math.max(24,Math.min(600,i*d.width/100));if(d&&(u.attrs?.label!==d.label||u.attrs?.width!==m))return{...u,attrs:{...u.attrs,label:d.label,width:m}};const p=u.content?.map(c);return p?.some((C,g)=>C!==u.content[g])?{...u,content:p}:u},l=c(t.content);return l===t.content?t:{...t,content:l}}function jR(t){if(!t.reference)return t.document;const r=new Map;t.reference.questions.forEach(c=>{[c.choice,...c.parts.map(l=>l.choice)].forEach(l=>{l.contentTarget&&r.set(l.contentTarget.groupId,l.id)})});let i=!1;const a=t.document.content.content?.map(c=>{if(c.attrs?.contentId)return c;let l;const u=d=>{d.type==="choiceGroup"&&(l=r.get(d.attrs?.id)||l),d.type==="choiceStemAnchor"&&(l=r.get(d.attrs?.groupId)||l),d.content?.forEach(u)};return u(c),l?(i=!0,F0(c,l)):c});return i?{...t.document,content:{...t.document.content,content:a}}:t.document}function AR(t,r,i){const a=w=>w.questions.flatMap(T=>[T.id,...T.parts.map(j=>j.id)]),c=new Set(a(r)),l=new Set(a(i)),u=new Set([...c].filter(w=>!l.has(w)));let d=!1;const m=w=>{if(u.has(w.attrs?.contentId)||w.type==="answerLine"&&u.has(w.attrs?.id))return d=!0,null;const T=w.content?.map(m).filter(j=>j!==null);return T?{...w,content:T}:w},p=m(t.content),C=p.content||[],g=a(i),b=C.filter(w=>l.has(w.attrs?.contentId)),x=[...b].sort((w,T)=>g.indexOf(w.attrs.contentId)-g.indexOf(T.attrs.contentId));let v=0;const S=C.map(w=>l.has(w.attrs?.contentId)?x[v++]:w);return b.some((w,T)=>w!==x[T])&&(d=!0),d?{...t,content:{...p,content:S.length?S:Vt().content.content}}:t}function RR(t,r,i){const a=new Map([[r.id,i.id],...r.parts.map((x,v)=>[x.id,i.parts[v].id])]),c=new Map([...r.choice.options.map((x,v)=>[x.id,i.choice.options[v].id]),...r.parts.flatMap((x,v)=>x.choice.options.map((S,w)=>[S.id,i.parts[v].choice.options[w].id]))]),l=new Map([[r.text?.groupId,i.text?.groupId],...r.parts.map((x,v)=>[x.text?.groupId,i.parts[v].text?.groupId])].filter(x=>!!(x[0]&&x[1]))),u=t.content.content||[],d=u.filter(x=>a.has(x.attrs?.contentId));if(!d.length)return t;const m=Ao(d),p=(x,v)=>({...x,...x.attrs?{attrs:{...x.attrs,...x.type==="choiceOption"&&c.has(v.attrs?.id)?{id:c.get(v.attrs.id)}:{},...x.type==="choiceGroup"&&l.has(v.attrs?.id)?{id:l.get(v.attrs.id)}:{},...a.has(v.attrs?.contentId)?{contentId:a.get(v.attrs.contentId)}:{},...x.type==="choiceStemAnchor"&&a.has(String(v.attrs?.groupId).slice(9))?{groupId:du(a.get(String(v.attrs.groupId).slice(9)))}:{}}}:{},...x.content?{content:x.content.map((S,w)=>p(S,v.content[w]))}:{}}),C=new Map(r.parts.map((x,v)=>[x.id,i.parts[v].id])),g=(x,v)=>({...x,...v.type==="answerLine"&&C.has(v.attrs?.id)?{attrs:{...x.attrs,id:C.get(v.attrs.id)}}:{},...x.content?{content:x.content.map((S,w)=>g(S,v.content[w]))}:{}}),b=Math.max(...d.map(x=>u.indexOf(x)));return{...t,content:{...t.content,content:[...u.slice(0,b+1),...m.map((x,v)=>g(p(x,d[v]),d[v])),...u.slice(b+1)]}}}function OR(t,r){const i=t.content.content||[],a=new Set(i.map(l=>l.attrs?.contentId).filter(Boolean)),c=(r.content.content||[]).filter(l=>l.attrs?.contentId&&!a.has(l.attrs.contentId));return c.length?{...t,content:{...t.content,content:[...Cn(t)?[]:i,...c]}}:t}function NR(t,r){const i={};let a=1;return{sectionInfoList:t.filter(l=>l.reference).map((l,u)=>{const d=l.reference,m=d.textVersion===1?d:Mm({...d,questions:d.questions.map(v=>({...v,text:v.text||{...wi(v.type,v.choice,Be(v.type)),numbered:!1,itemsContent:[]},parts:v.parts.map(S=>({...S,text:S.text||{...wi(v.type,S.choice),numbered:!1,itemsContent:[]}}))}))},l.document,l.id),p=m.sectionSeq??u+1,C=v=>v?.itemsContent.map(S=>({id:S.id,key:S.key,content:r.serialize(S.content)}))||[],g=v=>r.serialize(v?.content||Vt()),b=(v,S,w)=>{const T=v?Ws({...v,itemsContent:[]},S,w):[],j=r.serialize($r(T)),R=r.unwrapParagraphs||(O=>O.replace(/^<p\b[^>]*>([\s\S]*)<\/p>$/,"$1"));return{content:R(j,!0),contentNoP:R(j),items:C(v).map(O=>`${O.key}.${R(O.content)}`)}},x=m.questions.map(v=>{const S=Be(v.type),w=a;a+=S?v.parts.length:1;const T=v.referenceData||{},j=T.questionId??v.id,R=S?v.parts.map((D,_)=>({...D.referenceData,questionId:D.referenceData?.questionId??D.id,questionPid:j,questiontypeCode:v.type,seq:w+_,showSeq:D.label,itemShowNames:[D.label],score:D.score,itemcount:D.choice.options.length,content:g(D.text),itemsContent:C(D.text)})):void 0,O={...T,questionId:j,questiontypeCode:v.type,seq:w,showSeq:v.label,showSeqs:S?v.parts.map(D=>D.label):null,itemShowNames:v.parts.length?v.parts.map(D=>D.label):[v.label],itemcount:Et(v.type)?v.choice.options.length:v.parts.length||1,childNum:S?v.parts.length:void 0,score:v.score,itemScores:v.parts.length?v.parts.map(D=>D.score):[v.score],content:g(v.text),itemsContent:C(v.text),...R?{items:R}:{},lessScore:v.choice.lessScore,scoreType:v.choice.scoreType,rightAnswers:v.rightAnswers,singleScore:v.singleScore,extension:{...T.extension||{},...v.type==="CCOMPOSITION"?{kong:v.characters}:{},...v.type==="ECOMPOSITION"?{hang:v.lines}:{},uniEditor:{text:v.text,choice:v.choice,height:v.height,contentHeight:v.contentHeight,halfPoint:v.halfPoint,parts:v.parts.map(D=>({id:D.id,text:D.text,width:D.width,height:D.height,breakAfter:D.breakAfter,choice:D.choice,document:D.document})),document:v.document}}},M=b(v.text,v.id,v.label);return i[String(j)]=S?{...M,items:v.parts.map((D,_)=>({seq:w+_,...b(D.text,D.id,D.label)}))}:M,m.type==="MIXED"&&(i[`secContent${j}`]=r.serialize(m.material||Vt())),O});return{...m.referenceData,sectionSeq:p,sectionName:l.title,sectionQuestionType:m.type,questionInfolist:x,...m.type==="MIXED"?{content:r.serialize(m.material||Vt())}:{},extension:{...m.referenceData?.extension||{},uniEditor:{id:l.id,layout:m.layout,material:m.material,document:l.document,optional:m.optional,choose:m.choose,optionalHeight:m.optionalHeight,scoreType:m.scoreType,fillNewLine:m.fillNewLine}}}}),quesTextMap:i}}function Q0(t,r){const i=Array.isArray(t)?t:t.sectionInfoList;if(!Array.isArray(i))throw new Error("缺少 sectionInfoList");const a=new Set,c=l=>{const u=l==null||l===""?crypto.randomUUID():String(l);if(a.has(u))throw new Error(`题目 ID 重复:${u}`);return a.add(u),u};return i.map(l=>{if(!(l.sectionQuestionType in cr)||!Array.isArray(l.questionInfolist))throw new Error("题块类型或 questionInfolist 无效");const u=_m(l.sectionQuestionType),d=l.extension;d?.uniEditor?.id&&(u.id=d.uniEditor.id),u.title=l.sectionName;const{questionInfolist:m,...p}=l,C=[],g=new Map;m.forEach(x=>{if(x.questionPid!==void 0&&x.questionPid!==null&&Be(x.questiontypeCode)){const v=String(x.questionPid);let S=g.get(v);S||(S={...x,questionId:x.questionPid,questionPid:void 0,content:String(x.parentContent||""),items:[],showSeqs:[]},g.set(v,S),C.push(S)),S.items.push(x),S.showSeqs.push(x.showSeq??x.seq??S.items.length)}else C.push(x)}),g.forEach(x=>{x.itemScores=x.items.map(v=>v.score??null),x.score=x.itemScores.some(v=>v===null)?null:x.itemScores.reduce((v,S)=>v+(S||0),0)});const b=C.map((x,v)=>{if(!(x.questiontypeCode in cr)||x.questiontypeCode==="MIXED")throw new Error("子题类型无效");const S=x.questiontypeCode,w=Be(S),T=w?x.items?.length||x.showSeqs?.length||x.childNum||1:["FILLBLANK","SHORTANSWER"].includes(S)&&(x.itemScores?.length||x.itemcount)||1;if(!Number.isInteger(T)||T<1||T>200)throw new Error("子题数量无效");const j=x.score??null,R=Cu(S),O=wu({...R,characters:Number(x.extension?.kong)||R.characters,lines:Number(x.extension?.hang)||R.lines,partCount:T,score:w||["FILLBLANK","SHORTANSWER"].includes(S)?x.itemScores?.[0]??(j===null?null:j/T):j,optionCount:x.itemcount||x.itemsContent?.length||4},Number(x.seq)||v+1);O.id=c(x.questionId??x.id),O.label=String(x.showSeq??x.itemShowNames?.[0]??x.seq??v+1),O.choice.id=O.id,O.choice.label=O.label,O.choice.score=j,O.choice.scoreType=x.scoreType||O.choice.scoreType,O.choice.lessScore=x.lessScore??O.choice.lessScore,O.rightAnswers=x.rightAnswers??O.rightAnswers,O.singleScore=x.singleScore??O.singleScore,O.score=j,O.referenceData=x;const M=x.extension?.uniEditor;M?.choice&&(O.choice={...M.choice,id:O.id,label:O.label,score:j}),O.height=M?.height??O.height,O.contentHeight=M?.contentHeight??O.contentHeight,O.halfPoint=M?.halfPoint??O.halfPoint;const D=(_,I,B,H=!1,z)=>{if(z)return structuredClone(z);const $=wi(S,{...B,id:I},H);return{...$,content:r.parse(_.content||""),itemsContent:!H&&_.itemsContent?_.itemsContent.map((X,G)=>({id:X.id===void 0?B.options[G]?.id||crypto.randomUUID():String(X.id),key:X.key,content:r.parse(X.content||"")})):$.itemsContent}};return O.text=D(x,O.id,O.choice,w,M?.text),O.text.itemsContent.length&&(O.choice.options=O.text.itemsContent.map(_=>({id:_.id,label:_.key}))),O.document=M?.document||wn(O.document,O.label,O.score),O.parts=O.parts.map((_,I)=>{const B=x.items?.[I],H=M?.parts?.[I];return _.id=c(H?.id??B?.questionId??B?.id),_.referenceData=B,_.label=String(B?.showSeq??x.itemShowNames?.[I]??x.showSeqs?.[I]??(w?Number(x.seq||1)+I:T===1?O.label:`${O.label}.${I+1}`)),_.score=B?.score??x.itemScores?.[I]??_.score,_.choice={...H?.choice||_.choice,id:_.id,label:_.label,score:_.score,scoreType:B?.scoreType||x.scoreType||_.choice.scoreType,lessScore:B?.lessScore??x.lessScore??_.choice.lessScore},w&&S!=="TEXT_COMPLETION"&&(_.text=D(B||{itemsContent:x.itemsContent?.map(({key:z,content:$})=>({key:z,content:$}))},_.id,_.choice,!1,H?.text)),_.text?.itemsContent.length&&(_.choice.options=_.text.itemsContent.map(z=>({id:z.id,label:z.key}))),_.document=H?.document||wn(_.document,_.label,_.score),{..._,...H?{width:H.width??_.width,height:H.height??_.height,breakAfter:H.breakAfter??_.breakAfter}:{}}}),O.characters=Number(x.extension?.kong)||O.characters,O.lines=Number(x.extension?.hang)||O.lines,O});return u.reference={...u.reference,textVersion:1,sectionSeq:l.sectionSeq,referenceData:p,questions:b,material:d?.uniEditor?.material||r.parse(l.content||""),...d?.uniEditor?{layout:d.uniEditor.layout||u.reference.layout,optional:!!d.uniEditor.optional,choose:d.uniEditor.choose||1,optionalHeight:d.uniEditor.optionalHeight??200,scoreType:d.uniEditor.scoreType||u.reference.scoreType,fillNewLine:!!d.uniEditor.fillNewLine}:{}},d?.uniEditor?.document&&(u.document=d.uniEditor.document),u.document=vu(u),u})}class wr extends Error{constructor(r,i){super(i),this.code=r}}const Z0=t=>!t.closest("[hidden]")&&t.getClientRects().length>0;function MR(t,r,i){const a=t.getBoundingClientRect(),c=a.width/i.width;if(!t.isConnected||!(c>0))throw new wr("LAYOUT_UNAVAILABLE","请显示题卡后再获取识别坐标");const l=g=>({x:(g.x-a.x)/c,y:(g.y-a.y)/c,width:g.width/c,height:g.height/c}),u=Array.from(t.querySelectorAll(".card-sheet[data-paper-page]")).map(g=>{const b=l(g.getBoundingClientRect()),x=Object.fromEntries(Array.from(g.querySelectorAll("[data-anchor]")).map(j=>[j.dataset.anchor,l(j.getBoundingClientRect())]));if(Object.keys(x).length!==4)throw new wr("MISSING_ANCHORS","缺少纸面定位点,请先完成题卡初始化");const v=x.topLeft,S=j=>Im({...j,x:j.x-b.x,y:j.y-b.y}),w={pageNumber:Number(g.dataset.paperPage),pageSize:{width:Qn(i.width),height:Qn(i.height)},anchorOrigin:{x:Qn(v.x-b.x),y:Qn(v.y-b.y)},anchorSize:{width:26,height:13},panelSize:{width:Qn(x.topRight.x+x.topRight.width-v.x),height:Qn(x.bottomRight.y+x.bottomRight.height-v.y)},anchors:{topLeft:S(x.topLeft),topRight:S(x.topRight),bottomLeft:S(x.bottomLeft),bottomRight:S(x.bottomRight)},regions:[]};for(const j of Object.values(x))if(j.x<b.x-.1||j.y<b.y-.1||j.x+j.width>b.x+b.width+.1||j.y+j.height>b.y+b.height+.1)throw new wr("MARK_OUTSIDE_PAPER","定位点超出纸面,请调整边距");const T=Array.from(g.querySelectorAll("[data-anchor], .card-code-marks, .card-exam-qr, .card-paper-footer > span")).map(j=>l(j.getBoundingClientRect()));return T.forEach((j,R)=>T.slice(R+1).forEach(O=>{const M=km(j,O);if(M&&M.width>.3&&M.height>.3)throw new wr("OVERLAPPING_PAPER_MARKS","纸面识别标记与页码重叠,请调整边距或版式")})),{data:w,paper:b,toPaper:S}});if(u.length>Qs)throw new wr("PAPER_PAGE_LIMIT","题卡仅支持一张纸,请调整内容或版式");const d=new Map;r.blocks.forEach(g=>{g.reference?.questions.forEach(b=>{const x={blockId:g.id,questionId:b.id,answerId:b.id};d.set(b.id,x),b.choice.options.forEach(v=>d.set(v.id,x)),b.parts.forEach(v=>{const S={...x,partId:v.id,answerId:v.id};d.set(v.id,S),v.choice.options.forEach(w=>d.set(w.id,S))})}),g.choices?.questions.forEach(b=>{const x={blockId:g.id,questionId:b.id,answerId:b.id};d.set(b.id,x),b.options.forEach(v=>d.set(v.id,x))})});const m=new Map,p=(g,b,x)=>{if(![g.x,g.y,g.width,g.height].every(Number.isFinite)||g.width<=0||g.height<=0)throw new wr("INVALID_RECOGNITION_RECT","识别区域尺寸无效,请检查内容是否已完成布局");const v=u.flatMap(M=>{const D=km(g,M.paper);return D?[{page:M,rect:D}]:[]}),S=v.reduce((M,D)=>M+D.rect.width*D.rect.height,0);if(!v.length||g.width*g.height-S>Math.max(g.width,g.height)*.2||v.length!==1)throw new wr("REGION_OUTSIDE_PAPER","识别区域超出纸面,请调整内容或版式");const{page:w}=v[0],T=`${w.data.pageNumber}/${x}`,j=m.get(T)||0;m.set(T,j+1);const R=Array.from({length:i.columns},(M,D)=>D).find(M=>g.x>=i.columnX(w.data.pageNumber-1,M)-1&&g.x<i.columnX(w.data.pageNumber-1,M)+i.columnWidth+1),O={...b,id:`${T}/${j}`,rect:w.toPaper(g),...R!==void 0?{columnNumber:R+1}:{}};return w.data.regions.push(O),O},C=(g,b)=>{const x=g.closest("[data-exercise-item], [data-exercise-id], [data-question-id]"),v=x?.dataset.exerciseItem||x?.dataset.exerciseId||x?.dataset.questionId;return{blockId:g.closest("[data-block-id]")?.dataset.blockId,...d.get(b||"")||d.get(v||"")}};return t.querySelectorAll("[data-recognition]").forEach(g=>{if(!Z0(g))return;const b=g.dataset.recognition,x=g.dataset.answerId,v=C(g,g.dataset.optionId||x),S=g.dataset.recognitionRole||"region",w={...v,sectionType:b,role:S,...g.dataset.recognitionScope==="section"?{scope:"section"}:{},...x?{answerId:x}:{},...g.dataset.optionId?{optionId:g.dataset.optionId}:{},...g.dataset.value!==void 0?{value:g.dataset.value}:{},...g.dataset.questionIds?{questionIds:g.dataset.questionIds.split(",")}:{}},T=`${b}/${v.blockId||"paper"}/${x||""}/${g.dataset.optionId||""}/${S}/${g.dataset.value||""}/${g.dataset.fragment||""}`,j=p(l(g.getBoundingClientRect()),w,T);g.querySelectorAll("[data-recognition-cell]").forEach(R=>{R.closest("[data-recognition]")!==g||!Z0(R)||p(l(R.getBoundingClientRect()),{...w,role:"cell",parentId:j.id,value:R.dataset.recognitionCell},`${T}/cell/${R.dataset.recognitionCell}`)})}),CR(t).forEach(({element:g,region:b,rect:x})=>{const v=b.id||`position-${b.pos}`,S=C(g,v),w=b.type==="choiceOption"||b.type==="choiceMarker",T=w?"MultiChoice":"Checkbox";p(l(x),{...S,sectionType:T,role:b.type==="answerLine"?"line":"cell",answerId:d.get(v)?.answerId||v,...w?{optionId:v}:{},...b.attrs.label?{value:String(b.attrs.label)}:{}},`editor/${S.blockId||"paper"}/${v}/${b.pos}`)}),u.forEach(({data:g})=>{const b=new Map;g.regions.filter(x=>x.sectionType==="MultiChoice"&&x.role==="cell").forEach(x=>{const v=`${x.blockId||""}/${x.answerId||""}/${x.columnNumber||""}`,S=b.get(v)||[];S.push(x),b.set(v,S)}),b.forEach((x,v)=>{const S=x[0],w=Math.min(...x.map(M=>M.rect.x)),T=Math.min(...x.map(M=>M.rect.y)),j=Math.max(...x.map(M=>M.rect.x+M.rect.width)),R=Math.max(...x.map(M=>M.rect.y+M.rect.height)),O=`${g.pageNumber}/MultiChoice/group/${v}`;g.regions.push({id:O,sectionType:"MultiChoice",role:"region",blockId:S.blockId,questionId:S.questionId,partId:S.partId,answerId:S.answerId,columnNumber:S.columnNumber,rect:Im({x:w,y:T,width:j-w,height:R-T})}),x.forEach(M=>{M.parentId=O})}),g.regions.filter(x=>!x.parentId&&x.scope!=="section").forEach(x=>{const v=g.regions.filter(S=>S!==x&&S.role==="region"&&(x.role!=="region"||S.scope==="section")&&(S.blockId===x.blockId||S.questionIds?.includes(x.questionId||""))&&(S.answerId===x.answerId||S.questionIds?.includes(x.questionId||"")||S.questionId&&S.questionId===x.questionId&&!S.partId)&&x.rect.x>=S.rect.x-.1&&x.rect.y>=S.rect.y-.1&&x.rect.x+x.rect.width<=S.rect.x+S.rect.width+.1&&x.rect.y+x.rect.height<=S.rect.y+S.rect.height+.1).sort((S,w)=>S.rect.width*S.rect.height-w.rect.width*w.rect.height)[0];v&&(x.parentId=v.id)})}),{version:2,unit:"px",dpi:96,origin:"topLeftPaper",singlePagePartition:i.columns,pages:u.map(g=>g.data)}}function _R({uploadImage:t,editorPlugin:r,initialValue:i,onSave:a,dictionaries:c}){const l=E.useMemo(()=>su(c),[c]),u=r.html,[d,m]=E.useState(i||Am),p=E.useCallback(ce=>m(Re=>{let ve=typeof ce=="function"?ce(Re):ce;ve.blocks.some(Oe=>Oe.exercise&&!Oe.reference)&&(ve={...ve,blocks:ve.blocks.map(wR)}),ve={...ve,blocks:ve.blocks.map(Oe=>{const en=Re.blocks.find(Tr=>Tr.id===Oe.id);if(Oe.reference?.textVersion===1)return TS(Oe,en,!!ve.questionCard);if(!Oe.reference||en?.reference===Oe.reference)return Oe;let hn=en?.reference?AR(Oe.document,en.reference,Oe.reference):Oe.document;if(hn.content.content?.length===1&&hn.content.content[0].type==="paragraph"&&!hn.content.content[0].content?.length&&!hn.content.content[0].attrs?.contentId&&Oe.reference.questions.length){const Tr=Oe.reference.questions[0],rr=Oe.reference.type==="MIXED"?Oe.id:Tr.id;hn={...hn,content:{...hn.content,content:[F0(hn.content.content[0],rr)]}}}const Qi=Tr=>JSON.stringify(Tr.reference?.questions.flatMap(rr=>[rr.choice,...rr.parts.map(sf=>sf.choice)]).map(rr=>[rr.id,rr.contentTarget])),_a=!en||Qi(en)!==Qi(Oe)?jR({...Oe,document:hn}):hn;return _a===Oe.document?Oe:{...Oe,document:_a}})};const et=ve.blocks.filter(Oe=>Oe.reference).map(Oe=>ha(Oe.reference));return(ve.mergeObjective?[et.flat()]:et).some(Oe=>new Set(Oe.map(en=>en.options.length)).size>1)&&ve.choiceDirection!=="column"?{...ve,choiceDirection:"column"}:ve}),[]),[C,g]=E.useState(""),[b,x]=E.useState(!i),[v,S]=E.useState(null),[w,T]=E.useState(null),[j,R]=E.useState(null),[O,M]=E.useState(null),[D,_]=E.useState(!1),[I,B]=E.useState(!0),[H,z]=E.useState({}),$=ce=>{const Re=ce.reference?el(ce.reference):ce.exercise?.items||ce.choices?.questions;return Re?.find(ve=>ve.id===H[ce.id])?.id||Re?.[0]?.id},X=(ce,Re)=>z(ve=>ve[ce]===Re?ve:{...ve,[ce]:Re}),G=ce=>{S(ce),ce===null&&T(null),ce&&R(Re=>Re===null?null:ce)},[te,V]=E.useState({}),[Y,L]=E.useState(),[P,N]=E.useState(!1),U=ce=>{ce&&T(null),N(ce)},[J,Q]=E.useState(null),le=E.useRef(new Map),re=E.useRef(null),ae=E.useCallback((ce,Re)=>{Re?le.current.set(ce,Re):le.current.delete(ce)},[]),{scale:ge,setScale:je}=Uo(),ye=ge/100,de=E.useMemo(()=>ER(d,w),[d,w]),Me=JSON.stringify([d.usage,d.preset,d.margin,d.gap,d.header,d.recognition,d.paperTitle?.id,d.paperTitle?.height,de.map(ce=>[ce.id,ce.answerHeight])]),{geometry:De,placements:we,pageCount:xe}=E.useMemo(()=>SS({...d,blocks:de},te,Y),[Me,te,Y]),Se=d.paperTitle?.id===Y?.id&&Y?.overflowing,Bt=xe*De.height+(xe-1)*Oo,ht=we.filter(ce=>ce.overflowFrom!==void 0),he=new Map(we.map(ce=>[ce.id,ce])),at=he.get(nr);at&&d.blocks.forEach(ce=>{he.has(ce.id)||he.set(ce.id,at)});const it=new Set(de.find(ce=>ce.id===nr)?.reference?.questions.map(ce=>ce.id)),Mt=new Map;d.blocks.forEach(ce=>{const Re=he.get(ce.id);Re?.overflowFrom!==void 0?Mt.set(ce.id,Re):at?.overflowFrom!==void 0&&ce.reference?.questions.some(ve=>it.has(ve.id))&&Mt.set(ce.id,at)});const $n=()=>{const ce=document.getElementById("answer-sheet-stadio");ce&&je(Math.max(20,Math.min(100,Math.floor((ce.clientWidth-96)/De.width*100))))};E.useEffect(()=>{$n()},[d.preset]);const to=(ce,Re)=>p(ve=>({...ve,blocks:ve.blocks.map(et=>et.id===ce?{...et,...Re}:et)})),Go=(ce,Re)=>p(ve=>{const et=[...ve.blocks],Ft=et.findIndex(en=>en.id===ce);if(Ft<0||Re<0||Re>=et.length||Ft===Re)return ve;const[Oe]=et.splice(Ft,1);return et.splice(Re,0,Oe),{...ve,blocks:et}}),Er=(ce,Re=!1)=>{if(G(ce),!Re)return;if(Mt.has(ce)){R(null),_(!1),M(ce);return}const ve=document.getElementById("answer-sheet-stadio"),et=Array.from(document.querySelectorAll("[data-block-id]")),Ft=et.find(Oe=>Oe.dataset.blockId===ce&&!Oe.hidden)||et.find(Oe=>Oe.dataset.blockId===nr);if(ve&&Ft){const Oe=Ft.getBoundingClientRect(),en=ve.getBoundingClientRect();ve.scrollTo({left:Math.max(0,ve.scrollLeft+Oe.left-en.left-40),top:Math.max(0,ve.scrollTop+Oe.top-en.top-90),behavior:"smooth"})}},Gn=()=>NR(d.blocks,u),At=()=>{if(!re.current)throw new Error("题卡尚未完成渲染");if(ht.length)throw new wr("CONTENT_OVERFLOW","内容超出一张纸,请调整未排入纸张的题块后再保存");return MR(re.current,d,De)},Rn=ce=>{const Re=Q0(ce,u);p(ve=>({...ve,blocks:Re})),G(null),R(null),z({})},Ht=()=>{if(a){a();return}let ce;try{ce=At()}catch(et){g(et instanceof Error?et.message:"识别坐标生成失败");return}const Re=URL.createObjectURL(new Blob([JSON.stringify({...d,...Gn(),recognitionData:ce},null,2)],{type:"application/json"})),ve=document.createElement("a");ve.href=Re,ve.download=`${d.title||"答题卡"}.json`,ve.click(),setTimeout(()=>URL.revokeObjectURL(Re),1e3)},Ki=(ce,Re=!0)=>{P||(M(null),G(ce),R(ce),B(Re))},_e=(ce,Re=!1)=>{G(ce),R(null),_(Re),M(ce)};return{card:d,paperRoot:re,creationDictionary:l,saveMessage:C,setSaveMessage:g,saveAction:a?"保存":"导出",editors:le,measurements:te,titleMeasurement:Y,paperBlocks:de,setCard:p,uploadImage:t,setQuestionCard:ce=>{T(null),p(Re=>({...Re,questionCard:ce,blocks:Re.blocks.filter(ve=>ve.areaType!==(ce?"forbiden":"editArea"))}))},editQuestion:(ce,Re)=>{if(Mt.has(ce)){_e(ce,!0);return}G(ce),T(ce),R(null);const ve=d.blocks.find(Ft=>Ft.id===ce),et=Re||ve&&$(ve);ve?.reference?.textVersion===1&&Cn(ve.document)&&to(ce,{document:vu(ve)}),requestAnimationFrame(()=>{const Ft=le.current.get(`content/${et}`)||le.current.get(ce);(!et||!Ft?.focusContent(et))&&Ft?.focus("start")})},finishQuestionEditing:()=>T(null),insertMaterialBlank:(ce,Re,ve,et)=>{G(ce),T(ce),requestAnimationFrame(()=>le.current.get(ce)?.insertAnswerRegion(Re,ve,et))},editingQuestionId:w,registerEditor:ae,creationOpen:b,setCreationOpen:x,newCard:ce=>{p(bu(ce)),G(null),R(null),M(null),Q(null),V({}),L(void 0),z({}),U(!1),x(!1)},selectedId:v,setSelectedId:G,selectedChoiceId:$,selectChoice:X,settingsId:j,setSettingsId:R,settingsAutoFocus:I,openSettings:Ki,draftBlockId:O,setDraftBlockId:M,draftQuestionMode:D,openDraft:_e,setMeasurements:V,setTitleMeasurement:L,titleOverflow:Se,readOnly:P,setReadOnly:U,deleted:J,setDeleted:Q,scale:ye,geometry:De,placements:we,pageCount:xe,totalHeight:Bt,overflow:ht,overflowById:Mt,placementById:he,fitPage:$n,updateBlock:to,moveBlock:Go,selectBlock:Er,download:Ht,getReferenceData:Gn,getRecognitionData:At,setReferenceData:Rn}}const tf=E.createContext(null);function DR({children:t}){const r=ct(),i=E.useCallback((a,c)=>r.registerEditor(`draft/${a}`,c),[r.registerEditor]);return f.jsx(tf.Provider,{value:{...r,scale:1,card:{...r.card,mergeObjective:!1},registerEditor:i},children:t})}function IR({children:t,...r}){return f.jsx(Y0.Provider,{value:r.editorPlugin,children:f.jsx(tf.Provider,{value:_R(r),children:t})})}function ct(){const t=E.useContext(tf);if(!t)throw new Error("制卡内容需要 CardProvider");return t}const kR={undo:"M9 5 4 10l5 5M4 10h10a6 6 0 0 1 0 12",redo:"m15 5 5 5-5 5m5-5H10a6 6 0 0 0 0 12",image:"M4 4h16v16H4zM4 16l5-5 4 4 3-3 4 4M16 8h.01",table:"M4 4h16v16H4zM4 10h16M10 4v16M4 15h16",check:"m5 12 4 4L19 6",back:"m14 5-7 7 7 7",close:"m6 6 12 12M6 18 18 6",upload:"M12 16V3m-4 4 4-4 4 4M5 13v7h14v-7",download:"M12 3v13m-4-4 4 4 4-4M5 17v4h14v-4",settings:"M4 7h16M4 17h16M8 4v6m8 4v6",chevronUp:"m7 14 5-5 5 5",answerLine:"M4 17h16M5 10h2m4 0h2m4 0h2",alignLeft:"M4 5h16M4 10h10M4 15h16M4 20h10",alignCenter:"M4 5h16M7 10h10M4 15h16M7 20h10",alignRight:"M4 5h16M10 10h10M4 15h16M10 20h10",alignJustify:"M4 5h16M4 10h16M4 15h16M4 20h16",document:"M6 3h8l4 4v14H6zM14 3v5h4M9 12h6m-6 4h6",trash:"M4 6h16M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",listOrdered:"M10 6h10M10 12h10M10 18h10M3 4h1v5M3 9h2M3 15a1.5 1.5 0 0 1 3 0c0 1-3 3-3 4h3"};function eo({name:t,size:r=18}){return f.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:kR[t]})})}function ql(t){const[r,i]=E.useState(null),a=E.useRef(t);a.current=t;const c=E.useRef(null),l=(C,g)=>{if(!r)return;const b=r.getBoundingClientRect();r.style.left=`${Math.max(8,Math.min(window.innerWidth-b.width-8,C))}px`,r.style.top=`${Math.max(8,Math.min(window.innerHeight-b.height-8,g))}px`},u=()=>{if(!r)return;const C=r.getBoundingClientRect(),g=a.current?.(r)||{left:(window.innerWidth-C.width)/2,top:(window.innerHeight-C.height)/2};l(g.left,g.top)},d=()=>{const C=c.current;c.current=null,r&&delete r.dataset.dragging,C?.target.hasPointerCapture(C.pointerId)&&C.target.releasePointerCapture(C.pointerId)},m=()=>c.current?(l(c.current.left,c.current.top),d(),!0):!1;return E.useLayoutEffect(()=>{if(!r)return;u();const C=()=>{const b=r.getBoundingClientRect();l(b.left,b.top)},g=new ResizeObserver(C);return g.observe(r),window.addEventListener("resize",C),document.addEventListener("fullscreenchange",C),window.addEventListener("blur",m),()=>{d(),g.disconnect(),window.removeEventListener("resize",C),document.removeEventListener("fullscreenchange",C),window.removeEventListener("blur",m)}},[r]),{dialog:r,setDialog:i,titleProps:{role:"button",tabIndex:0,onPointerDown:C=>{if(C.button!==0||!C.isPrimary||!r)return;C.preventDefault(),C.stopPropagation(),C.currentTarget.focus({preventScroll:!0});const{left:g,top:b}=r.getBoundingClientRect();c.current={x:C.clientX,y:C.clientY,left:g,top:b,target:C.currentTarget,pointerId:C.pointerId},r.dataset.dragging="true",C.currentTarget.setPointerCapture(C.pointerId)},onPointerMove:C=>{const g=c.current;g?.pointerId===C.pointerId&&l(g.left+C.clientX-g.x,g.top+C.clientY-g.y)},onPointerUp:d,onPointerCancel:m,onLostPointerCapture:d,onKeyDown:C=>{if(C.key==="Escape"&&m()&&(C.preventDefault(),C.stopPropagation()),C.key==="Home"&&(C.preventDefault(),C.stopPropagation(),u()),!r||!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(C.key))return;C.preventDefault(),C.stopPropagation();const g=C.shiftKey?50:10,b=r.getBoundingClientRect();l(b.left+(C.key==="ArrowRight"?g:C.key==="ArrowLeft"?-g:0),b.top+(C.key==="ArrowDown"?g:C.key==="ArrowUp"?-g:0))}},cancelDrag:m}}function LR({creation:t,questionCard:r,onAdd:i,onClose:a}){const[c,l]=E.useState(null),u=Om(t),d=r?"editArea":"forbiden",m=[...u,d],p={...cr,forbiden:"禁止答题区",editArea:"空白答题区"},C=E.useId(),{dialog:g,setDialog:b,titleProps:x,cancelDrag:v}=ql();E.useLayoutEffect(()=>{g?.setAttribute("aria-labelledby",C)},[g,C]);const S=f.jsx("div",{...x,className:"card-modal-drag","aria-label":"拖动添加题块",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:C,children:"添加题块"})});return f.jsxs(Vi,{open:!0,panelRef:b,width:460,zIndex:910,className:"card-modal card-add-block-modal",title:S,closeLabel:"关闭添加题块",closeIcon:f.jsx(eo,{name:"close",size:16}),onCancel:a,onEscapeKeyDown:w=>{v()&&(w.preventDefault(),w.stopPropagation())},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ue,{onClick:a,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!c||!m.includes(c),onClick:()=>{c&&m.includes(c)&&i(c)},children:"添加"})]}),children:[f.jsx("div",{className:"card-question-types",role:"group","aria-label":"选择题型",children:u.map(w=>f.jsx(ue,{"aria-pressed":c===w,onClick:()=>l(w),children:p[w]},w))}),f.jsx("div",{className:"card-question-types card-area-types",role:"group","aria-label":"纸面区域",children:f.jsx(ue,{"aria-pressed":c===d,onClick:()=>l(d),children:p[d]})})]})}function Yl({label:t,value:r,min:i,max:a,onChange:c}){const[l,u]=E.useState();return f.jsx(Na,{className:"ui-control ui-number","aria-label":t,min:i,max:a,precision:0,value:l===void 0?r:l,onChange:d=>{u(d),d!==null&&d>=i&&d<=a&&d!==r&&c(d)},onBlur:()=>{if(l!==void 0){const d=Math.max(i,Math.min(a,l??i));d!==r&&c(d),u(void 0)}}})}function Yi({label:t,value:r,min:i=.5,max:a=15,placeholder:c,onChange:l}){const[u,d]=E.useState(),m=u==null||Kn(u)&&u>=i&&u<=a;return f.jsx(Na,{className:"ui-control ui-number","aria-label":t,value:u===void 0?r:u,min:i,max:a,step:.5,placeholder:c,status:m?void 0:"error",onChange:p=>{d(p),(p===null||Kn(p)&&p>=i&&p<=a)&&l(p)},onBlur:()=>d(void 0)})}function zR({value:t,creation:r,onChange:i}){const[a,c]=E.useState("all"),[l,u]=E.useState([]),[d,m]=E.useState("settings"),[p,C]=E.useState("keep"),[g,b]=E.useState(null),[x,v]=E.useState(null),[S,w]=E.useState("keep"),[T,j]=E.useState(null),[R,O]=E.useState(1),[M,D]=E.useState(null),[_,I]=E.useState(""),[B,H]=E.useState(""),z=t.questions.filter(X=>a==="all"||l.includes(X.id)).map(X=>X.id),$=()=>{const X={};p!=="keep"&&(X.kind=p),g!==null&&(X.optionCount=g),x!==null&&(X.score=x),S!=="keep"&&(X.scoreType=S),T!==null&&S!=="ITEM_SCORE"&&(X.lessScore=T);let G;d==="settings"?G={type:d,patch:X}:d==="numbering"?G={type:d,start:R}:d==="average"?G={type:d,total:M??0}:G={type:d,text:_};const te=iS(t,z,G,r);H(te.error||""),te.value&&i(te.value)};return f.jsxs("details",{className:"card-choice-batch",children:[f.jsx("summary",{children:"批量设置"}),f.jsxs("div",{className:"card-choice-batch-fields",children:[f.jsxs("label",{className:"card-field",children:["范围",f.jsxs(Wt,{"aria-label":"批量修改范围",value:a,onChange:c,children:[f.jsx("option",{value:"all",children:"全部题目"}),f.jsx("option",{value:"selected",children:"指定题目"})]})]}),f.jsxs("label",{className:"card-field",children:["操作",f.jsxs(Wt,{"aria-label":"选择题批量操作",value:d,onChange:X=>{m(X),H("")},children:[f.jsx("option",{value:"settings",children:"修改属性"}),f.jsx("option",{value:"numbering",children:"连续题号"}),f.jsx("option",{value:"average",children:"平均分配总分"}),f.jsx("option",{value:"answers",children:"录入答案"})]})]}),a==="selected"&&f.jsx("div",{className:"card-choice-batch-selection",role:"group","aria-label":"选择批量修改题目",children:t.questions.map(X=>f.jsxs(zt,{checked:z.includes(X.id),onChange:G=>u(te=>G.target.checked?[...te,X.id]:te.filter(V=>V!==X.id)),children:["第 ",X.label," 题"]},X.id))}),d==="settings"&&f.jsxs("div",{className:"card-choice-batch-properties",children:[f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Wt,{"aria-label":"批量选择题类型",value:p,onChange:C,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(Na,{className:"ui-control ui-number","aria-label":"批量选项个数",placeholder:"保持不变",min:2,max:Sn.options,precision:0,value:g,onChange:b})]}),f.jsxs("label",{className:"card-field",children:["每题分值",f.jsx(Yi,{label:"批量每题分值",value:x,placeholder:"保持不变",onChange:v})]}),f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Wt,{"aria-label":"批量少选计分",value:S,onChange:w,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),S!=="ITEM_SCORE"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Yi,{label:"批量少选得分",min:0,value:T,placeholder:"保持不变",onChange:j})]})]}),d==="numbering"&&f.jsxs("label",{className:"card-field",children:["起始题号",f.jsx(Yl,{label:"批量起始题号",min:1,max:1e3,value:R,onChange:O})]}),d==="average"&&f.jsxs("label",{className:"card-field",children:["所选题目总分",f.jsx(Yi,{label:"平均分配总分",max:Sn.score*z.length,value:M,onChange:D})]}),d==="answers"&&f.jsxs("label",{className:"card-field card-choice-batch-answers",children:["按题目顺序录入",f.jsx(Pl,{"aria-label":"批量选择题答案",value:_,rows:3,placeholder:"每题一组,如 A BC D;- 表示清空",onChange:X=>I(X.target.value)})]}),B&&f.jsx("div",{className:"card-choice-error",role:"alert",children:B}),f.jsxs(ue,{className:"card-choice-batch-apply",type:"primary",disabled:!z.length,onClick:$,children:["应用到 ",z.length," 题"]})]})]})}function W0({value:t,document:r,creation:i,selectedId:a,onSelect:c,onChange:l,singleQuestion:u=!1}){const[d,m]=E.useState([]),[p,C]=E.useState([]),g=t.questions.find(z=>z.id===a)||t.questions[0],b=t.questions.indexOf(g),x=pu(t),v=fu(t),S=Ys(r),w=new Set(t.questions.map(z=>z.options.length)).size>1,T=()=>({value:t,selectedId:g?.id}),j=(z,$=g?.id)=>{m(G=>[...G.slice(-49),T()]),C([]),l({...z,source:"manual"});const X=z.questions.find(G=>G.id===$)||z.questions[Math.max(0,Math.min(b,z.questions.length-1))];X&&c(X.id)},R=z=>{l(z.value),z.selectedId&&c(z.selectedId)},O=z=>j({...t,questions:t.questions.map($=>$.id===g.id?{...$,...z}:$)}),M=z=>O(lu(g,z,i)),D=z=>{const $=[...t.questions];$.splice(b,1),$.splice(b+z,0,g),j({...t,questions:$})},_=(z=!1)=>{const $=z&&g?aS(g,uu(t.questions)):{...ca(0),label:uu(t.questions)},X=[...t.questions];X.splice(b+1,0,$),j({...t,questions:X},$.id)},I=t.questions.reduce((z,$)=>z+($.score??0),0),B=t.questions.filter(z=>typeof z.score!="number").length,H=g&&(Sm(t.questions,g.id,g.label)||cu(g));return f.jsxs("div",{className:"card-choice-settings","aria-label":"选择题设置",children:[u&&f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Wt,{"aria-label":"选择题填涂位置",value:v,onChange:z=>j(hu(t,r,z)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),!u&&f.jsxs("div",{children:[f.jsxs("div",{className:"card-choice-summary","aria-label":"选择题配置概况",children:[t.questions.length," 题 · ",B===t.questions.length?"未设分":`${I} 分${B?` · ${B} 题未设分`:""}`]}),f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Wt,{"aria-label":"选择题填涂位置",value:v,onChange:z=>j(hu(t,r,z)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),f.jsxs("label",{className:"card-field",children:["题目数量",f.jsx(Yl,{label:"选择题数量",min:1,max:Sn.questions,value:t.questions.length,onChange:z=>{const $=t.questions.slice(0,z);for(;$.length<z;)$.push({...ca(0),label:uu($)});j({...t,questions:$})}})]}),f.jsxs("div",{className:"card-choice-layout-fields",children:[f.jsxs("label",{className:"card-field",children:["题目排列方向",f.jsxs(Wt,{"aria-label":"填涂排列方向",value:x,onChange:z=>j({...t,direction:z}),children:[f.jsx("option",{value:"row",disabled:w,children:"横排(先右后下)"}),f.jsx("option",{value:"column",children:w?"竖排(选项数不同)":"竖排(先下后右)"})]})]}),x==="column"&&f.jsxs("label",{className:"card-field",children:["每列题数",f.jsx(Yl,{label:"每列题数",min:1,max:5,value:t.rowsPerColumn,onChange:z=>j({...t,rowsPerColumn:z})})]})]})]}),g&&f.jsxs("div",{className:"card-choice-question-settings",children:[!u&&f.jsxs("label",{className:"card-field",children:["当前题目",f.jsx(Wt,{"aria-label":"当前选择题",value:g.id,onChange:c,children:t.questions.map(z=>f.jsxs("option",{value:z.id,children:["第 ",z.label," 题"]},z.id))})]}),v!=="concentrated"&&f.jsxs("label",{className:"card-field",children:["对应正文选项",f.jsxs(Wt,{"aria-label":"填涂对应正文选项",value:S.some(z=>z.id===g.contentTarget?.groupId)?g.contentTarget.groupId:"",onChange:z=>{const $=S.find(X=>X.id===z);O({contentTarget:$?{groupId:$.id,optionIds:$.options.map(X=>X.id)}:null})},children:[f.jsx("option",{value:"",children:"未指定(集中显示)"}),S.map((z,$)=>f.jsxs("option",{value:z.id,disabled:t.questions.some(X=>X.id!==g.id&&X.contentTarget?.groupId===z.id),children:["第 ",z.label||$+1," 组选项(",z.options.length," 项)"]},z.id))]})]}),!u&&f.jsxs("label",{className:"card-field",children:["题号",f.jsx(Oa,{"aria-label":"选择题题号",value:g.label,maxLength:12,onChange:z=>O({label:z.target.value})})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(Yl,{label:"选择题选项个数",min:2,max:Math.max(Sn.options,g.options.length),value:g.options.length,onChange:z=>M({optionCount:z})})]}),f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Wt,{"aria-label":"选择题类型",value:nS(g),onChange:z=>M({kind:z}),children:[f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),!u&&f.jsxs("label",{className:"card-field",children:["本题分值",f.jsx(Yi,{label:"选择题分值",value:g.score??null,placeholder:"未设置",onChange:z=>M({score:z})})]}),g.multiple&&f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Wt,{"aria-label":"选择题少选计分",value:g.scoreType||"LESS_SCORE",onChange:z=>M({scoreType:z,lessScore:0}),children:[f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),g.multiple&&g.scoreType!=="ITEM_SCORE"&&typeof g.score=="number"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Yi,{label:"选择题少选得分",min:0,max:g.score,value:g.lessScore??0,onChange:z=>M({lessScore:z??0})})]}),f.jsxs("div",{className:"card-answer-key",role:"group","aria-label":"正确答案设置",children:[f.jsx("span",{children:"正确答案"}),f.jsx("div",{children:g.options.map(z=>f.jsx(ue,{type:"text","aria-label":`正确答案 ${z.label}`,"aria-pressed":g.correctIds.includes(z.id),onClick:()=>O({correctIds:g.correctIds.includes(z.id)?g.correctIds.filter($=>$!==z.id):g.multiple?[...g.correctIds,z.id]:[z.id]}),children:z.label},z.id))})]}),g.multiple&&g.scoreType==="ITEM_SCORE"&&f.jsxs("div",{className:"card-choice-rule","aria-label":"选项得分说明",children:["每项 ",oS(g)??"—"," 分 · 错选、不选 0 分"]}),H&&f.jsx("div",{className:"card-choice-error",role:"alert",children:H}),!u&&f.jsx(zt,{className:"card-choice-break",checked:g.breakBefore,onChange:z=>O({breakBefore:z.target.checked}),children:"此题前换行"}),!u&&f.jsxs("div",{className:"card-choice-actions",role:"group","aria-label":"选择题操作",children:[f.jsx(ue,{type:"text","aria-label":"新增选择题",title:"在当前题后新增",disabled:t.questions.length>=Sn.questions,onClick:()=>_(),children:"新增"}),f.jsx(ue,{type:"text","aria-label":"复制选择题配置",title:"复制当前题的填涂与计分配置,放在其后",disabled:t.questions.length>=Sn.questions,onClick:()=>_(!0),children:"复制"}),f.jsx(ue,{type:"text","aria-label":"上移选择题",disabled:b<=0,onClick:()=>D(-1),children:"上移"}),f.jsx(ue,{type:"text","aria-label":"下移选择题",disabled:b>=t.questions.length-1,onClick:()=>D(1),children:"下移"}),f.jsx(ue,{type:"text",danger:!0,"aria-label":"删除当前选择题",disabled:t.questions.length<=1,onClick:()=>{const z=t.questions.filter($=>$.id!==g.id);j({...t,questions:z},z[Math.min(b,z.length-1)]?.id)},children:"删除"})]})]},g.id),!g&&f.jsx(ue,{className:"card-choice-actions",onClick:()=>_(),children:"新增选择题"}),!u&&f.jsx(zR,{value:t,creation:i,onChange:j}),!u&&(d.length>0||p.length>0)&&f.jsxs("div",{className:"card-choice-history",children:[f.jsx(ue,{type:"text",className:"card-choice-undo",disabled:!d.length,onClick:()=>{const z=d.at(-1);m(d.slice(0,-1)),C($=>[...$,T()]),R(z)},children:"撤销选择题设置"}),f.jsx(ue,{type:"text",disabled:!p.length,onClick:()=>{const z=p.at(-1);C(p.slice(0,-1)),m($=>[...$,T()]),R(z)},children:"重做"})]})]})}function Jt({label:t,children:r}){return f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:t}),r]})}function ft({label:t,value:r,min:i=0,max:a=200,step:c=1,onChange:l}){return f.jsx(Jt,{label:t,children:f.jsx(Na,{"aria-label":t,value:r,min:i,max:a,step:c,precision:c===1?0:1,onChange:u=>{u!==null&&Number.isFinite(u)&&l(Math.max(i,Math.min(a,Math.round(u/c)*c)))}})})}function rn({label:t,value:r,min:i=.5,max:a=70,onChange:c}){return f.jsx(Jt,{label:t,children:f.jsx(Na,{"aria-label":t,placeholder:"未设置",min:i,max:a,step:.5,precision:1,value:r,onChange:l=>c(l===null?null:Math.max(i,Math.min(a,Math.round(l*2)/2)))})})}function dn({label:t,value:r,onChange:i,maxLength:a=200}){return f.jsx(Jt,{label:t,children:f.jsx(Oa,{"aria-label":t,value:r,maxLength:a,onChange:c=>i(c.target.value)})})}function ot({label:t,value:r,options:i,onChange:a}){return f.jsx(Jt,{label:t,children:f.jsx(Wt,{"aria-label":t,value:r,onChange:a,children:Object.entries(i).map(([c,l])=>f.jsx("option",{value:c,children:l},c))})})}function Xl({index:t,count:r,onAdd:i,onCopy:a,onDelete:c,onMove:l,name:u="小题",maximum:d=200}){return f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small","aria-label":`新增${u}`,disabled:r>=d,onClick:i,children:"新增"}),f.jsx(ue,{size:"small","aria-label":`复制当前${u}`,disabled:t<0||r>=d,onClick:a,children:"复制"}),f.jsx(ue,{size:"small","aria-label":`上移当前${u}`,disabled:t<=0,onClick:()=>l(-1),children:"↑"}),f.jsx(ue,{size:"small","aria-label":`下移当前${u}`,disabled:t<0||t>=r-1,onClick:()=>l(1),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除当前${u}`,disabled:t<0,onClick:c,children:"删除"})]})}function Xi({value:t,onEditor:r,...i}){const a=E.useRef(null),c=E.useCallback(u=>{a.current=u,r?.(u)},[r]),l=E.useRef(JSON.stringify(t));return E.useEffect(()=>{const u=JSON.stringify(t);u!==l.current&&(l.current=u,a.current&&JSON.stringify(a.current.getDocument())!==u&&a.current.syncDocument(t))},[t]),f.jsx(Vl,{ref:c,initialValue:t,...i})}function J0({value:t,onChange:r,drawing:i=!1}){const{uploadImage:a}=ct(),c=E.useRef(null),[l,u]=E.useState(!1),[d,m]=E.useState(""),p=E.useRef(!0),C=E.useRef({value:t,onChange:r});C.current={value:t,onChange:r},E.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const g=b=>r({...t,...b});return f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"作答区样式",value:t.style,options:{blank:"空白",lines:"横线",grid:"方格纸",characters:"作文格","four-lines":"四线三格",coordinates:"坐标网格"},onChange:b=>g({style:b})}),f.jsx(ft,{label:"作答行数",value:t.rows,min:0,max:120,onChange:b=>g({rows:b})}),f.jsx(ft,{label:"作答行高",value:t.rowHeight,min:16,max:80,onChange:b=>g({rowHeight:b})}),["characters","grid","coordinates"].includes(t.style)&&f.jsx(ft,{label:"每行格数",value:t.columns,min:4,max:40,onChange:b=>g({columns:b})}),t.style==="characters"&&f.jsx(ft,{label:"字数标记间隔",value:t.wordMark,min:0,max:500,onChange:b=>g({wordMark:b})})]}),f.jsx(zt,{checked:t.title,onChange:b=>g({title:b.target.checked}),children:"标题填写区"}),i&&f.jsxs("div",{children:[f.jsx(dn,{label:"作图底图 URL",value:t.backgroundUrl,maxLength:4096,onChange:b=>g({backgroundUrl:b})}),f.jsx("input",{ref:c,type:"file",accept:"image/*",hidden:!0,onChange:async b=>{const x=b.target.files?.[0];if(b.target.value="",!!x){u(!0),m("");try{const v=a?await a(x):await new Promise((S,w)=>{const T=new FileReader;T.onload=()=>S(String(T.result)),T.onerror=()=>w(new Error("读取失败")),T.readAsDataURL(x)});if(!/^(https?:\/\/|data:image\/|blob:|\/)/i.test(v))throw new Error("图片地址无效");p.current&&C.current.onChange({...C.current.value,backgroundUrl:v})}catch{p.current&&m("图片上传失败,请重试")}finally{p.current&&u(!1)}}}}),f.jsx(ue,{size:"small",loading:l,onClick:()=>c.current?.click(),children:"上传底图"}),d&&f.jsx("p",{role:"alert",children:d})]})]})}function BR({value:t,onChange:r,correction:i=!1,practice:a=!1}){const[c,l]=E.useState(t[0]?.id),u=t.find(g=>g.id===c)||t[0],d=t.indexOf(u),m=i?"改错位置":a?"评价项":"评分点",p=g=>r(t.map(b=>b.id===u.id?{...b,...g}:b)),C=g=>{const b=g&&u?{...Ao(u),label:Ur(t)}:{id:crypto.randomUUID(),label:Ur(t),score:null,prompt:"",answer:""},x=[...t];x.splice(d+1,0,b),r(x),l(b.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":`选择${m}`,children:t.map(g=>f.jsx(ue,{size:"small","aria-pressed":g.id===u?.id,onClick:()=>l(g.id),children:g.label},g.id))}),f.jsx(Xl,{name:m,maximum:20,index:d,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(ua(t,u.id,g)),onDelete:()=>r(t.filter(g=>g.id!==u.id))}),u&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:`${m}编号`,value:u.label,onChange:g=>p({label:g})}),f.jsx(rn,{label:`${m}分值`,value:u.score,onChange:g=>p({score:g})})]}),f.jsx(dn,{label:i?"原文位置/待改文字":a?"评价维度":"作答步骤提示",value:u.prompt,onChange:g=>p({prompt:g})}),f.jsx(Jt,{label:i?"改正答案":a?"评价标准":"评分要点",children:f.jsx(Pl,{"aria-label":i?"改正答案":a?"评价标准":"评分要点",value:u.answer,autoSize:{minRows:2,maxRows:5},onChange:g=>p({answer:g.target.value})})})]})]})}function HR({value:t,onChange:r,onInsert:i}){const[a,c]=E.useState(t[0]?.id),l=t.find(p=>p.id===a)||t[0],u=t.indexOf(l),d=p=>r(t.map(C=>C.id===l.id?{...C,...p}:C)),m=p=>{const C=p&&l?{...Ao(l),label:Ur(t)}:{...Tm(),label:Ur(t)},g=[...t];g.splice(u+1,0,C),r(g),c(C.id)};return f.jsxs("div",{className:"exercise-blank-settings",children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择空位",children:t.map(p=>f.jsx(ue,{size:"small","aria-pressed":p.id===l?.id,onClick:()=>c(p.id),children:p.label},p.id))}),f.jsx(Xl,{name:"空位",maximum:20,index:u,count:t.length,onAdd:()=>m(!1),onCopy:()=>m(!0),onMove:p=>r(ua(t,l.id,p)),onDelete:()=>{r(t.filter(p=>p.id!==l.id)),c(t[Math.max(0,u-1)]?.id)}}),l&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:"空位编号",value:l.label,onChange:p=>d({label:p})}),f.jsx(rn,{label:"每空分值",value:l.score,max:15,onChange:p=>d({score:p})}),f.jsx(ot,{label:"空位样式",value:l.style,options:{line:"横线",brackets:"括号",box:"方框",characters:"字格"},onChange:p=>d({style:p})}),f.jsx(ot,{label:"空位宽度",value:String(l.width),options:{20:"1/5 行",25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:p=>d({width:Number(p)})}),l.style==="characters"&&f.jsx(ft,{label:"字格数量",value:l.characters,min:1,max:40,onChange:p=>d({characters:p})}),f.jsx(dn,{label:"空前提示",value:l.prefix,onChange:p=>d({prefix:p})}),f.jsx(dn,{label:"空后单位",value:l.suffix,onChange:p=>d({suffix:p})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(zt,{checked:l.breakAfter,onChange:p=>d({breakAfter:p.target.checked}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>r(t.map(p=>({...p,width:l.width,style:l.style,characters:l.characters}))),children:"统一空位样式"})]}),f.jsx(ue,{size:"small",onClick:()=>i(l),children:"插入此空到题干"}),f.jsx(Jt,{label:"可接受答案(每行一个)",children:f.jsx(Pl,{"aria-label":"可接受答案",value:l.answers.join(`
201
201
  `),autoSize:{minRows:2,maxRows:5},onChange:p=>d({answers:p.target.value.split(`
202
- `)})})})]})]})}function K0({value:t,onChange:r,onRemove:i,category:a=!1}){const{uploadImage:c}=mt(),[l,u]=E.useState(t[0]?.id),d=t.find(g=>g.id===l)||t[0],m=t.indexOf(d),p=a?"类别":"共享选项",C=g=>{const b=g&&d?vo(d):{id:crypto.randomUUID(),label:"",text:""},v=new Set(t.map(S=>S.label));b.label=Array.from({length:26},(S,w)=>String.fromCharCode(65+w)).find(S=>!v.has(S))||Ir(t);const x=[...t];x.splice(m+1,0,b),r(x),u(b.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs",children:t.map(g=>f.jsx(ce,{size:"small","aria-pressed":g.id===d?.id,onClick:()=>u(g.id),children:g.label},g.id))}),f.jsx(Bl,{name:p,maximum:26,index:m,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(oa(t,d.id,g)),onDelete:()=>i(d.id)}),d&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:`${p}编号`,value:d.label,onChange:g=>r(t.map(b=>b.id===d.id?{...b,label:g}:b))}),f.jsx(cn,{label:`${p}内容`,value:d.text,onChange:g=>r(t.map(b=>b.id===d.id?{...b,text:g}:b))})]}),d&&!a&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项图文/公式"}),f.jsx(Ui,{value:d.document||$t(),ariaLabel:`共享选项 ${d.label} 图文内容`,uploadImage:c,onChange:g=>r(t.map(b=>b.id===d.id?{...b,document:g}:b))},d.id)]})]})}function IR({value:t,kind:r,item:i,onChange:a}){const c=l=>a({...t,...l});return f.jsxs("div",{children:[f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:r==="ordering"?"待排序/分类项目":"共享选项池"}),f.jsx(K0,{value:t.pool,onChange:l=>c({pool:l,sequence:[...t.sequence.filter(u=>l.some(d=>d.id===u)),...l.filter(u=>!t.sequence.includes(u.id)).map(u=>u.id)]}),onRemove:l=>a(cS(t,l))})]}),r==="matching"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"匹配呈现",value:t.matchingDisplay,options:{letters:"字母填答",lines:"左右连线"},onChange:l=>c({matchingDisplay:l})}),f.jsx(at,{label:"对应关系",value:t.relation,options:{one:"一对一",many:"一对多"},onChange:l=>c({relation:l,items:t.items.map(u=>({...u,targets:l==="one"?u.targets.slice(0,1):u.targets}))})})]}),f.jsx(Lt,{checked:t.reuseOptions,onChange:l=>{const u=new Set;c({reuseOptions:l.target.checked,items:t.items.map(d=>({...d,targets:d.targets.filter(m=>l.target.checked?!0:u.has(m)?!1:(u.add(m),!0))}))})},children:"允许选项重复使用"}),i&&f.jsx(Zt,{label:"当前题匹配答案",children:f.jsx("div",{className:"exercise-tabs",children:t.pool.map(l=>f.jsx(ce,{size:"small","aria-pressed":i.targets.includes(l.id),onClick:()=>a(uS(t,i.id,i.targets.includes(l.id)?i.targets.filter(u=>u!==l.id):[...i.targets,l.id])),children:l.label},l.id))})})]}),r==="ordering"&&f.jsxs("div",{children:[f.jsx(at,{label:"排序或分类",value:t.ordering,options:{sequence:"排序",category:"分类"},onChange:l=>c({ordering:l})}),t.ordering==="sequence"?f.jsx("div",{className:"exercise-fields",children:t.sequence.map((l,u)=>f.jsx(at,{label:`第 ${u+1} 位答案`,value:l,options:Object.fromEntries(t.pool.map(d=>[d.id,`${d.label}. ${d.text}`])),onChange:d=>{const m=[...t.sequence],p=m.indexOf(d);p>=0&&(m[p]=l),m[u]=d,c({sequence:m})}},u))}):f.jsxs("div",{children:[f.jsx(K0,{category:!0,value:t.categories,onChange:l=>c({categories:l}),onRemove:l=>c({categories:t.categories.filter(u=>u.id!==l),assignments:Object.fromEntries(Object.entries(t.assignments).filter(([,u])=>u!==l))})}),t.pool.map(l=>f.jsx(at,{label:`${l.label} 所属类别`,value:t.assignments[l.id]||"",options:{"":"未设置",...Object.fromEntries(t.categories.map(u=>[u.id,`${u.label}. ${u.text}`]))},onChange:u=>c({assignments:{...t.assignments,[l.id]:u}})},l.id))]})]})]})}function kR({value:t,onChange:r}){const[i,a]=E.useState(0),c=l=>r({...t,...l});return f.jsxs("div",{children:[f.jsx(Zt,{label:"待断句原文",children:f.jsx(Ml,{"aria-label":"待断句原文",value:t.chunkText,autoSize:{minRows:3,maxRows:8},onSelect:l=>a(l.currentTarget.selectionStart),onChange:l=>r(dS(t,l.target.value))})}),f.jsx(ce,{size:"small",disabled:i<=0||i>=t.chunkText.length||t.chunkPoints.length>=26||t.chunkPoints.some(l=>l.offset===i),onClick:()=>{const l=new Set(t.chunkPoints.map(d=>d.label)),u=Array.from({length:26},(d,m)=>String.fromCharCode(65+m)).find(d=>!l.has(d));c({chunkPoints:[...t.chunkPoints,{id:crypto.randomUUID(),offset:i,label:u}].sort((d,m)=>d.offset-m.offset)})},children:"在光标处添加断点"}),f.jsx("div",{className:"exercise-chunk-points",children:t.chunkPoints.map(l=>f.jsxs("div",{children:[f.jsxs(Lt,{checked:t.chunkCorrect.includes(l.id),onChange:u=>c({chunkCorrect:u.target.checked?[...t.chunkCorrect,l.id]:t.chunkCorrect.filter(d=>d!==l.id)}),children:[l.label," · ",t.chunkText.slice(Math.max(0,l.offset-4),l.offset),"|",t.chunkText.slice(l.offset,l.offset+4)]}),f.jsx(ce,{size:"small",type:"text","aria-label":`删除断点 ${l.label}`,onClick:()=>c({chunkPoints:t.chunkPoints.filter(u=>u.id!==l.id),chunkCorrect:t.chunkCorrect.filter(u=>u!==l.id)}),children:"删除"})]},l.id))}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ut,{label:"最多选择断点数",value:t.chunkMax,min:1,max:26,onChange:l=>c({chunkMax:l})}),f.jsx(tn,{label:"断句满分",value:t.groupScore,max:10,onChange:l=>c({groupScore:l})}),f.jsx(tn,{label:"每个正确断点分值",value:t.chunkScore,max:10,onChange:l=>c({chunkScore:l})})]})]})}function LR({value:t,kind:r,blockId:i,selectedId:a,onSelect:c,onChange:l}){const{card:u,uploadImage:d,insertMaterialBlank:m,geometry:p}=mt(),C=E.useRef([]),g=E.useRef([]),[,b]=E.useState(0),[v,x]=E.useState(1),[S,w]=E.useState(1),[T,j]=E.useState(null),R=t.items.find(U=>U.id===a)||t.items[0],O=t.items.indexOf(R),M=(U,q=R?.id)=>{JSON.stringify(t)!==JSON.stringify(U)&&(C.current.push({value:t,id:R?.id}),C.current=C.current.slice(-50),g.current=[],l(U),q&&c(q),b(P=>P+1))},D=U=>M({...t,...U}),_=U=>D({items:t.items.map(q=>q.id===R.id?{...q,...U}:q)}),I=U=>l({...t,items:t.items.map(q=>q.id===R.id?{...q,...U}:q)}),z=U=>{const q=U&&R?lS(R,Ir(t.items)):lu(R?.kind||cu(r),Ir(t.items)),P=[...t.items];P.splice(O+1,0,q),M({...t,items:P},q.id)},H=U=>{const q=U?g.current:C.current,P=U?C.current:g.current,G=q.pop();if(!G)return;P.push({value:t,id:R?.id});const B=G.value.items.map(Q=>{const N=t.items.find(K=>K.id===Q.id);return N?{...Q,document:N.document,reference:N.reference,explanation:N.explanation}:Q});l({...G.value,items:B}),G.id&&c(G.id),b(Q=>Q+1)},L=pm.includes(r),$=R&&["answer","calculation","correction","drawing","writing","english"].includes(R.kind),Y=fS(t,r);return f.jsxs("div",{className:"exercise-panel",children:[r!=="chunk"&&f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择当前小题",children:t.items.map(U=>f.jsx(ce,{size:"small","aria-pressed":R?.id===U.id,onClick:()=>c(U.id),children:U.label},U.id))}),f.jsx(Bl,{index:O,count:t.items.length,maximum:ym(r),onAdd:()=>z(!1),onCopy:()=>z(!0),onMove:U=>D({items:oa(t.items,R.id,U)}),onDelete:()=>{const U=t.items.filter(q=>q.id!==R.id);M({...t,items:U,chooseCount:Math.min(t.chooseCount,Math.max(1,U.length))},U[Math.max(0,O-1)]?.id)}}),f.jsxs("details",{children:[f.jsx("summary",{children:"批量配置"}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ut,{label:"追加题数",value:v,min:1,max:50,onChange:x}),f.jsx(ut,{label:"起始题号",value:S,min:1,max:1e3,onChange:w}),f.jsx(tn,{label:"统一题分",value:T,max:Math.min(70,...t.items.map(U=>Us(U.kind))),onChange:j})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",disabled:t.items.length+v>ym(r),onClick:()=>{const U=[...t.items],q=[];for(let P=0;P<v;P++)q.push(lu(R?.kind||cu(r),Ir([...U,...q])));U.splice(O+1,0,...q),M({...t,items:U},q[0].id)},children:"追加空白题"}),f.jsx(ce,{size:"small",onClick:()=>D({items:t.items.map((U,q)=>({...U,label:String(S+q),choice:{...U.choice,label:String(S+q)}}))}),children:"连续编号"}),f.jsx(ce,{size:"small",disabled:T!==null&&t.items.some(U=>T>Us(U.kind)),onClick:()=>D({items:t.items.map(U=>({...U,score:T,choice:{...U.choice,score:T}}))}),children:"统一分值"})]})]})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",disabled:!C.current.length,onClick:()=>H(!1),children:"撤销题型配置"}),f.jsx(ce,{size:"small",disabled:!g.current.length,onClick:()=>H(!0),children:"重做题型配置"})]}),r==="chunk"&&f.jsx(kR,{value:t,onChange:M}),r==="optional"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ut,{label:"选做题数",value:t.chooseCount,min:1,max:Math.max(1,t.items.length),onChange:U=>D({chooseCount:U})}),f.jsx(tn,{label:"选做题组总分",value:t.groupScore,max:200,onChange:U=>D({groupScore:U})})]}),R&&r!=="chunk"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:"当前题号",value:R.label,onChange:U=>_({label:U,choice:{...R.choice,label:U}})}),f.jsx(tn,{label:"当前题分",value:R.score,max:Us(R.kind),onChange:U=>_({score:U,choice:{...R.choice,score:U}})}),L&&r!=="cloze"&&r!=="completion"&&f.jsx(at,{label:"小题题型",value:R.kind,options:iS,onChange:U=>_({kind:U})})]}),r==="cloze"&&f.jsx(ce,{size:"small",onClick:()=>m(i,R.id,R.label,60),children:"插入题号到公共材料"}),R.kind==="judge"&&f.jsxs("div",{children:[f.jsx(at,{label:"判断标记",value:t.judgeLabels,options:{symbols:"√/×",letters:"T/F",words:"正确/错误"},onChange:U=>D({judgeLabels:U})}),f.jsx(Zt,{label:"正确判断",children:f.jsx("div",{className:"exercise-tabs",children:gm[t.judgeLabels].map((U,q)=>f.jsx(ce,{size:"small","aria-pressed":R.judgment===(q===0),onClick:()=>_({judgment:R.judgment===(q===0)?null:q===0}),children:U},q))})}),f.jsx(Lt,{checked:R.needsReason,onChange:U=>_({needsReason:U.target.checked}),children:"判断后改正/说明理由"}),R.needsReason&&f.jsx(X0,{value:R.area,onChange:U=>_({area:U})})]}),R.kind==="choice"&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项与计分规则"}),f.jsx(Y0,{value:{...iu(0),presentation:R.presentation,questions:[R.choice]},document:R.document,creation:u.creation,selectedId:R.choice.id,onSelect:()=>{},onChange:U=>{const q=U.questions.find(P=>P.id===R.choice.id);q&&_({choice:q,presentation:U.presentation,score:q.score??null})},singleQuestion:!0})]}),R.kind==="fill"&&r!=="matching"&&f.jsxs("div",{children:[f.jsx(Lt,{checked:t.fillNewLine,onChange:U=>D({fillNewLine:U.target.checked}),children:"每题一行"}),f.jsx(DR,{value:R.blanks,onChange:U=>_({blanks:U}),onInsert:U=>m(i,U.id,`${R.label}.${U.label}`,p.columnWidth*U.width/100-30)})]}),$&&r!=="ordering"&&f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:"作答区域"}),f.jsx(X0,{value:R.area,drawing:R.kind==="drawing",onChange:U=>_({area:U})})]}),["answer","calculation","correction"].includes(R.kind)&&r!=="ordering"&&f.jsxs("details",{children:[f.jsx("summary",{children:r==="practice"?"评价量表":R.kind==="correction"?"改错位置与答案":"分步作答与评分点"}),f.jsx(_R,{value:R.steps,correction:R.kind==="correction",practice:r==="practice",onChange:U=>_({steps:U})})]}),R.kind==="table"&&f.jsx(ce,{size:"small",disabled:!xn(R.document),onClick:()=>_({document:hS()}),children:"建立空白表格"}),["matching","ordering"].includes(r)&&f.jsx(IR,{value:t,kind:r,item:R,onChange:M}),f.jsxs("details",{children:[f.jsx("summary",{children:r==="matching"?"左侧项目内容":"小题正文"}),f.jsx(Ui,{value:R.document,ariaLabel:`小题 ${R.label} 正文设置`,uploadImage:d,onChange:U=>I({document:U})})]}),f.jsxs("details",{children:[f.jsx("summary",{children:"参考答案与解析"}),f.jsx(Zt,{label:"参考答案",children:f.jsx(Ui,{value:R.reference,ariaLabel:"参考答案",uploadImage:d,onChange:U=>I({reference:U})})}),f.jsx(Zt,{label:"解析",children:f.jsx(Ui,{value:R.explanation,ariaLabel:"答案解析",uploadImage:d,onChange:U=>I({explanation:U})})})]})]},R.id),r==="practice"&&f.jsx(cn,{label:"作品/音视频引用 URL",value:t.attachmentUrl,maxLength:4096,onChange:U=>D({attachmentUrl:U})}),Y.length>0&&f.jsx("p",{className:"exercise-error",role:"alert",children:Y.join(";")})]})}function zR({group:t,creation:r,start:i,scanMarking:a,onAdd:c}){const{card:l}=mt(),u=l.usage==="homework",d=w=>{const T=mu(w,i,r);return t.type==="MIXED"&&w==="MCHOICE"?{...T,scoreType:t.scoreType||"LESS_SCORE",score:t.scoreType==="ITEM_SCORE"?T.score:null}:T},[m,p]=E.useState(()=>d(t.type==="MIXED"?"SCHOICE":t.type)),[C,g]=E.useState(null),[b,v]=E.useState({start:null,end:null}),x=w=>{g(null),p(T=>({...T,...w}))},S=aa[m.type];return f.jsxs("div",{className:"reference-add-panel",children:[t.type==="MIXED"&&f.jsx(at,{label:"子题题型",value:m.type,options:Object.fromEntries(Cm(r,!0).map(w=>[w,nr[w]])),onChange:w=>{p(d(w)),v({start:null,end:null}),g(null)}}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(Ta,{label:"起始题号",value:b.start,min:1,max:1e3,onChange:w=>v(T=>({...T,start:w}))}),!vi(m.type)&&f.jsx(Ta,{label:"结束题号",value:b.end,min:b.start||1,max:Math.min(1e3,(b.start||1)+S.count-1),onChange:w=>v(T=>({...T,end:w}))}),wt(m.type)&&(S.options[0]===S.options[1]?f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:"选项个数"}),f.jsx("span",{children:S.options[0]})]}):f.jsx(Ta,{label:"选项个数",value:m.optionCount,min:S.options[0],max:S.options[1],onChange:w=>x({optionCount:w})})),Le(m.type)&&f.jsx(Ta,{label:"子题数量",value:m.partCount,min:1,max:S.parts,onChange:w=>x({partCount:w})}),["FILLBLANK","SHORTANSWER"].includes(m.type)&&f.jsx(ut,{label:m.type==="FILLBLANK"?"每题空数":"每题小题数",value:m.partCount||1,min:1,max:m.type==="SHORTANSWER"&&(a||t.optional)?1:S.parts,onChange:w=>x({partCount:w})}),u&&f.jsx(Lt,{checked:m.score===0,onChange:w=>x({score:w.target.checked?0:null,lessScore:0}),children:"无分值"}),f.jsx(tn,{min:u?0:.5,label:m.type==="FILLBLANK"?"每空分值":m.type==="SHORTANSWER"?"每小题分值":"每题分值",value:m.score,max:S.score,onChange:w=>x({score:w,lessScore:0})}),m.type==="MCHOICE"&&f.jsxs(E.Fragment,{children:[t.type!=="MIXED"&&f.jsx(at,{label:"少选计分",value:m.scoreType,options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:w=>x({scoreType:w,lessScore:0})}),m.scoreType==="LESS_SCORE"&&f.jsx(ut,{label:"少选得分",value:m.lessScore,min:0,max:m.score||0,step:.5,onChange:w=>x({lessScore:w})})]}),m.type==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Ta,{label:"正确答案个数",value:m.rightAnswers,min:1,max:(m.optionCount||2)-1,onChange:w=>x({rightAnswers:w})}),f.jsx(tn,{label:"每涂对一处得分",value:m.singleScore,max:m.score||10,onChange:w=>x({singleScore:w})})]}),m.type==="CCOMPOSITION"&&f.jsx(ut,{label:"作文格数",value:m.characters,min:1,max:1200,onChange:w=>x({characters:w})}),m.type==="ECOMPOSITION"&&f.jsx(ut,{label:"作文行数",value:m.lines,min:1,max:100,onChange:w=>x({lines:w})})]}),C&&f.jsx("p",{role:"alert",className:"card-choice-error",children:C}),f.jsx(ce,{size:"small",type:"primary",onClick:()=>{if(b.start===null||!vi(m.type)&&b.end===null){g("请输入起始题号和结束题号");return}const w={...m,start:b.start,end:vi(m.type)?b.start:b.end},T=CS(t,w,a,u);g(T),T||c(w)},children:"添加题目"})]})}function Ta({label:t,value:r,min:i,max:a,onChange:c}){return f.jsx(Zt,{label:t,children:f.jsx(Ea,{"aria-label":t,value:r,min:i,max:a,precision:0,placeholder:"请输入",onChange:c})})}function BR({value:t,onChange:r,onClose:i}){const a=t.questions.filter(v=>wt(v.type)).flatMap(v=>Le(v.type)?v.parts:[v]),[c,l]=E.useState([]),[u,d]=E.useState(!1),[m,p]=E.useState(!1),[C,g]=E.useState(2),b=()=>{const v=(x,S)=>!c.includes(x.id)||!x.text?x:{...x,text:{...x.text,layout:{...x.text.layout,indent:u,layout:m?"fixed":"natural",columns:m?C:S?4:2}}};r({...t,questions:t.questions.map(x=>({...v(x,x.type==="CLOZE"),parts:x.parts.map(S=>v(S,x.type==="CLOZE"))}))}),i()};return f.jsx(Dl,{open:!0,title:"客观题选项排版设置",width:400,className:"card-modal",closeLabel:"关闭选项排版",closeIcon:f.jsx(ko,{name:"close"}),onCancel:i,footer:f.jsxs(f.Fragment,{children:[f.jsx(ce,{onClick:i,children:"取消"}),f.jsx(ce,{type:"primary",disabled:!c.length,onClick:b,children:"确定"})]}),children:f.jsxs("div",{className:"exercise-panel",children:[f.jsx(Lt,{checked:c.length===a.length,onChange:v=>l(v.target.checked?a.map(x=>x.id):[]),children:"全选"}),f.jsx("div",{className:"exercise-fields",children:a.map(v=>f.jsxs(Lt,{checked:c.includes(v.id),onChange:x=>l(S=>x.target.checked?[...S,v.id]:S.filter(w=>w!==v.id)),children:["第 ",v.label," 题"]},v.id))}),f.jsx(at,{label:"首行缩进",value:String(u),options:{false:"否",true:"是"},onChange:v=>d(v==="true")}),f.jsx(at,{label:"个数排版",value:String(m),options:{false:"否",true:"是"},onChange:v=>p(v==="true")}),m&&f.jsx(at,{label:"排版方式",value:String(C),options:{4:"一行4个",2:"一行2个",1:"一行1个"},onChange:v=>g(Number(v))})]})})}function HR({block:t,value:r,selectedId:i,onSelect:a,onChange:c}){const{card:l,geometry:u,setCard:d,editQuestion:m,insertMaterialBlank:p}=mt(),[C,g]=E.useState(null),[b,v]=E.useState(!1),[x,S]=E.useState([]),[w,T]=E.useState([]),[j,R]=E.useState(""),[O,M]=E.useState(!1),D=r.questions.find(B=>B.id===i||B.parts.some(Q=>Q.id===i))||r.questions[0],_=r.questions.indexOf(D),I=(B,Q)=>{S(N=>[...N.slice(-49),{value:r,document:t.document}]),T([]),R(""),g(null),c(B,Q)},z=B=>I({...r,questions:r.questions.map(Q=>Q.id===B.id?B:Q)}),H=sa(r),L=ou(r.layout),$=Bs(t.document),Y={...r.layout,direction:l.choiceDirection||r.layout.direction,questions:H},U=su(Y),q=L!=="concentrated"?na(Y,t.document,!0).concentrated.questions:[],P=U0(t),G=B=>{const Q=B.value;c({...Q,questions:Q.questions.map(N=>{const K=r.questions.find(ne=>ne.id===N.id);return K?{...N,text:K.text||N.text,document:vn(K.document,N.label,N.score),parts:N.parts.map(ne=>({...ne,text:K.parts.find(te=>te.id===ne.id)?.text||ne.text,document:vn(K.parts.find(te=>te.id===ne.id)?.document||ne.document,ne.label,ne.score)}))}:N})},ER(t.document,B.document))};return f.jsxs("div",{className:"exercise-panel reference-panel",children:[r.type==="MIXED"&&f.jsx(at,{label:"复合题少选计分",value:r.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:B=>I({...r,scoreType:B,questions:r.questions.map(Q=>Q.type==="MCHOICE"?{...Q,choice:{...Q.choice,scoreType:B,lessScore:B==="ITEM_SCORE"?0:Q.choice.lessScore}}:Q)})}),H.length>0&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"选择题填涂位置",value:L,options:r.questions.some(B=>B.type==="CHUNK_CHOICE")?{concentrated:"集中填涂",stem:"题干前整组字母框"}:{concentrated:"集中填涂",stem:"题干前整组字母框",option:"各选项前空方框"},onChange:B=>{const Q=au(Y,t.document,B),N=new Map(Q.questions.map(K=>[K.id,K]));I({...r,layout:{...Q,questions:[]},questions:r.questions.map(K=>({...K,choice:N.get(K.id)||K.choice,parts:K.parts.map(ne=>({...ne,choice:N.get(ne.id)||ne.choice}))}))})}}),f.jsx(at,{label:"填涂排列方向",value:U,options:new Set(H.map(B=>B.options.length)).size>1?{column:"竖排(选项数不同)"}:{row:"横排(先右后下)",column:"竖排(先下后右)"},onChange:B=>d(Q=>({...Q,choiceDirection:B}))}),U==="column"&&f.jsx(ut,{label:"每列题数",value:r.layout.rowsPerColumn,min:1,max:5,onChange:B=>I({...r,layout:{...r.layout,rowsPerColumn:B}})}),r.textVersion===1&&l.questionCard&&r.type!=="INFO_MATCHING"&&f.jsx(ce,{size:"small",onClick:()=>M(!0),children:"选项排版"})]}),r.questions.length>0&&f.jsxs(E.Fragment,{children:[f.jsx(at,{label:"当前题目",value:D.id,options:Object.fromEntries(r.questions.map(B=>[B.id,`${Le(B.type)?B.parts.map(Q=>Q.label).join("、"):B.label} · ${nr[B.type]}`])),onChange:a}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional,onClick:()=>v(B=>!B),children:"新增题目"}),f.jsx(ce,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional||Vs(r)+D.parts.length-1>1e3,onClick:()=>{if(r.type==="CCOMPOSITION"||r.optional)return;const B=ES(D,Vs(r)),Q=[...r.questions];Q.splice(_+1,0,B),I({...r,questions:Q},wR(t.document,D,B)),a(B.id)},children:"复制当前题目"}),f.jsx(ce,{size:"small","aria-label":"上移当前题目",disabled:_<=0,onClick:()=>I({...r,questions:oa(r.questions,D.id,-1)}),children:"↑"}),f.jsx(ce,{size:"small","aria-label":"下移当前题目",disabled:_>=r.questions.length-1,onClick:()=>I({...r,questions:oa(r.questions,D.id,1)}),children:"↓"}),f.jsx(ce,{size:"small",danger:!0,onClick:()=>{const B=r.questions.filter(Q=>Q.id!==D.id);I({...r,questions:B,optional:r.optional&&B.length>1,choose:Math.max(1,Math.min(r.choose,B.length-1))}),B.length&&a(B[Math.max(0,_-1)].id)},children:"删除当前题目"})]})]}),(!r.questions.length||b)&&f.jsx(zR,{group:r,creation:l.creation,start:Vs(r),scanMarking:!!l.scanMarking,onAdd:B=>{const Q=wS(r,{...B,paperWidth:u.columnWidth},D?.id);I({...Q,questions:Q.questions.map(N=>r.questions.some(K=>K.id===N.id)?N:{...N,halfPoint:!!l.halfPoint})}),a(Q.questions.find(N=>!r.questions.some(K=>K.id===N.id)).id),v(!1)}},`${r.type}/${Vs(r)}/${r.scoreType}`),r.type==="SHORTANSWER"&&r.questions.length>1&&f.jsxs(E.Fragment,{children:[f.jsx(Lt,{checked:r.optional,disabled:r.questions.some(B=>B.parts.length>1),onChange:B=>I({...r,optional:B.target.checked,choose:1}),children:"是否选做"}),r.optional&&f.jsx(ut,{label:`${r.questions.length} 选`,value:r.choose,min:1,max:l.scanMarking?r.questions.length-1:1,onChange:B=>I({...r,choose:B})})]}),r.questions.length>0&&!r.optional&&r.type!=="MIXED"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(tn,{label:"分组总分",min:l.usage==="homework"?0:.5,value:C??Vn(r.questions),max:1e4,onChange:g}),f.jsx(ce,{size:"small",disabled:(C??Vn(r.questions))===null,onClick:()=>{const B=AS(r,C??Vn(r.questions),l.usage==="homework");B?I(B):R("总分无法平均分配,每题/空的分值须符合题型范围且为 0.5 的倍数")},children:"平均分配"})]}),D&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"编辑正文",value:P.some(B=>B.id===i)?i:D.id,options:Object.fromEntries(P.map(B=>[B.id,B.label])),onChange:B=>{a(B),m(t.id,B)}}),f.jsx(ce,{size:"small",onClick:()=>m(t.id,i||D.id),children:"编辑当前正文"})]}),q.length>0&&f.jsxs("p",{className:"card-choice-error",role:"status",children:["第 ",q.map(B=>B.label).join("、")," 题",L==="stem"?"尚未关联题干":"尚未关联完整选项",",暂保留集中填涂。"]}),D&&f.jsx(PR,{value:D,group:r,scanMarking:!!l.scanMarking,onApply:B=>{const Q=r.questions.find(te=>te.id===B.id),N={...B,document:vn(Q.document,B.label,B.score),parts:B.parts.map(te=>({...te,document:vn(Q.parts.find(le=>le.id===te.id)?.document||te.document,te.label,te.score)}))},K=r.questions.filter(te=>te.id!==N.id).flatMap(te=>Le(te.type)?te.parts.map(le=>le.label):[te.label]),ne=Le(N.type)?N.parts.map(te=>te.label):[N.label];return ne.some(te=>!te.trim()||K.includes(te))||new Set(ne).size!==ne.length?(R("题号不能为空或重复"),!1):(r.optional?I({...r,questions:r.questions.map(te=>te.id===N.id?N:{...te,score:N.score,document:vn(te.document,te.label,N.score),parts:te.parts.map(le=>({...le,score:N.score,document:vn(le.document,le.label,N.score)}))})}):z(N),!0)}},D.id),D&&xi(D.type)&&f.jsxs(E.Fragment,{children:[f.jsx(Lt,{checked:r.fillNewLine,onChange:B=>I({...r,fillNewLine:B.target.checked}),children:"每题一行"}),f.jsx("div",{className:"reference-part-settings",children:D.parts.map(B=>f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:`空位 ${B.label} 显示题号`,maxLength:10,value:B.label,onChange:Q=>z({...D,parts:D.parts.map(N=>N.id===B.id?{...N,label:Q}:N)})}),f.jsx(at,{label:`空位 ${B.label} 宽度`,value:String(B.width),options:{...l.scanMarking?{20:"1/5 行"}:{},25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:Q=>z({...D,parts:D.parts.map(N=>N.id===B.id?{...N,width:Number(Q)}:N)})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",onClick:()=>p(t.id,B.id,B.label,u.columnWidth*B.width/100),children:"插入此空到正文"}),f.jsx(Lt,{checked:B.breakAfter,onChange:Q=>z({...D,parts:D.parts.map(N=>N.id===B.id?{...N,breakAfter:Q.target.checked}:N)}),children:"此空后换行"}),f.jsx(ce,{size:"small",onClick:()=>I({...r,questions:r.questions.map(Q=>xi(Q.type)?{...Q,parts:Q.parts.map(N=>({...N,width:B.width}))}:Q)}),children:"宽度统一设置"})]})]},B.id))})]}),D&&wt(D.type)&&f.jsx(E.Fragment,{children:(Le(D.type)?D.parts.map(B=>B.choice):[D.choice]).map(B=>f.jsxs("div",{children:[f.jsxs(Lt,{checked:B.breakBefore,onChange:Q=>{const N={...B,breakBefore:Q.target.checked};z({...D,choice:D.choice.id===B.id?N:D.choice,parts:D.parts.map(K=>K.choice.id===B.id?{...K,choice:N}:K)})},children:[B.label," 题前换行"]}),L==="option"&&r.textVersion!==1&&f.jsx(at,{label:`${B.label} 题对应正文选项`,value:B.contentTarget?.groupId||"",options:{"":"按正文归属匹配",...Object.fromEntries($.map((Q,N)=>[Q.id,`第 ${Q.label||N+1} 组选项`]))},onChange:Q=>{const N=$.find(ne=>ne.id===Q),K={...B,contentTarget:N?{groupId:Q,optionIds:N.options.map(ne=>ne.id)}:null};z({...D,choice:D.choice.id===B.id?K:D.choice,parts:D.parts.map(ne=>ne.choice.id===B.id?{...ne,choice:K}:ne)})}})]},B.id))}),j&&f.jsx("p",{className:"card-choice-error",role:"alert",children:j}),O&&f.jsx(BR,{value:r,onChange:I,onClose:()=>M(!1)}),(x.length>0||w.length>0)&&f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ce,{size:"small",disabled:!x.length,onClick:()=>{const B=x.at(-1);S(x.slice(0,-1)),T(Q=>[...Q,{value:r,document:t.document}]),G(B)},children:"撤销题型配置"}),f.jsx(ce,{size:"small",disabled:!w.length,onClick:()=>{const B=w.at(-1);T(w.slice(0,-1)),S(Q=>[...Q,{value:r,document:t.document}]),G(B)},children:"重做题型配置"})]})]})}function PR({value:t,group:r,scanMarking:i,onApply:a}){const{card:c}=mt(),[l,u]=E.useState(null),[d,m]=E.useState(""),p=l||t,C=w=>{u({...p,...w}),m("")},g=p.type,b=aa[g],v=p.choice.options.length,x=p.parts.length,S=w=>{const T=Array.from({length:w},(j,R)=>p.parts[R]||Si(Le(g)?String(Number(p.parts[0]?.label||p.label)+R):w===1?p.label:`${p.label}.${R+1}`,p.parts[0]?.score??null,g,p.choice.options.length));Le(g)||T.forEach((j,R)=>{T[R]={...j,label:w===1?p.label:`${p.label}.${R+1}`}}),C({parts:T,score:Vn(T)})};return f.jsxs("div",{className:"reference-question-settings",children:[f.jsxs("div",{className:"exercise-fields",children:[r.type!=="MIXED"&&["SCHOICE","MCHOICE"].includes(g)&&f.jsx(at,{label:"题型",value:g,options:{SCHOICE:"单选题",MCHOICE:"多选题"},onChange:w=>{const T=w==="MCHOICE"&&mi(c.creation)&&p.score===null?6:p.score;C({type:w,score:T,choice:{...ia(p.choice,w,v),score:T,scoreType:w==="MCHOICE"&&mi(c.creation)?"ITEM_SCORE":"LESS_SCORE",lessScore:0}})}}),!Le(g)&&f.jsx(cn,{label:"题目题号",value:p.label,maxLength:10,onChange:w=>C({label:w,choice:{...p.choice,label:w},parts:p.parts.map((T,j)=>({...T,label:p.parts.length===1?w:`${w}.${j+1}`}))})}),wt(g)&&f.jsx(ut,{label:"选项个数",min:b.options[0],max:b.options[1],value:v,onChange:w=>C({choice:ia(p.choice,g,w),parts:p.parts.map(T=>({...T,choice:ia(T.choice,g,w)}))})}),x>0&&(g==="INFO_MATCHING"||r.type==="MIXED")&&f.jsx(Zt,{label:"子题数量",children:f.jsx("span",{children:x})}),x>0&&g!=="INFO_MATCHING"&&r.type!=="MIXED"&&f.jsx(ut,{label:Le(g)?"子题数量":g==="FILLBLANK"?"每题空数":"每题小题数",value:x,min:1,max:g==="SHORTANSWER"&&(i||r.optional)?1:b.parts,onChange:S}),c.usage==="homework"&&f.jsx(Lt,{checked:p.score===0,onChange:w=>{const T=w.target.checked?0:null;C({score:T,choice:{...p.choice,score:T,lessScore:0},parts:p.parts.map(j=>({...j,score:T,choice:{...j.choice,score:T,lessScore:0}}))})},children:"无分值"}),!x&&f.jsx(tn,{min:c.usage==="homework"?0:.5,label:"本题分值",value:p.score,max:b.score,onChange:w=>C({score:w,choice:{...p.choice,score:w,lessScore:0}})}),Le(g)&&f.jsx(tn,{min:c.usage==="homework"?0:.5,label:"每题分值",value:p.parts[0]?.score??null,max:b.score,onChange:w=>{const T=p.parts.map(j=>({...j,score:w,choice:{...j.choice,score:w}}));C({parts:T,score:Vn(T)})}}),g==="MCHOICE"&&f.jsxs(E.Fragment,{children:[r.type!=="MIXED"&&f.jsx(at,{label:"少选计分",value:p.choice.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:w=>C({choice:{...p.choice,scoreType:w,lessScore:0}})}),p.choice.scoreType!=="ITEM_SCORE"&&f.jsx(ut,{label:"少选得分",min:0,max:p.score||0,step:.5,value:p.choice.lessScore||0,onChange:w=>C({choice:{...p.choice,lessScore:w}})})]}),g==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Ta,{label:"正确答案个数",value:p.rightAnswers,min:1,max:v-1,onChange:w=>C({rightAnswers:w})}),f.jsx(tn,{label:"每涂对一处得分",value:p.singleScore,max:p.score||10,onChange:w=>C({singleScore:w})})]}),g==="CCOMPOSITION"&&f.jsx(ut,{label:"作文格数",value:p.characters,min:1,max:1200,onChange:w=>C({characters:w})}),g==="ECOMPOSITION"&&f.jsx(Zt,{label:"初始作文行数",children:f.jsx("span",{children:p.lines})}),g==="CCOMPOSITION"&&f.jsx(ut,{label:"题干区域高度",value:p.contentHeight,min:38,max:Number.MAX_SAFE_INTEGER,onChange:w=>C({contentHeight:w})})]}),p.parts.map((w,T)=>f.jsxs("div",{className:"exercise-fields",children:[f.jsx(cn,{label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}题号`,value:w.label,maxLength:10,onChange:j=>C({parts:p.parts.map(R=>R.id===w.id?{...R,label:j,choice:{...R.choice,label:j}}:R)})}),!Le(g)&&f.jsx(tn,{min:c.usage==="homework"?0:.5,label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}分值`,value:w.score,max:b.score,onChange:j=>{const R=p.parts.map(O=>O.id===w.id?{...O,score:j,choice:{...O.choice,score:j}}:O);C({parts:R,score:Vn(R)})}}),["FILLBLANK","SHORTANSWER"].includes(g)&&r.type!=="MIXED"&&!r.optional&&x>1&&f.jsx(ce,{size:"small",danger:!0,"aria-label":`删除第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}`,onClick:()=>{const j=p.parts.filter(R=>R.id!==w.id).map((R,O)=>({...R,label:x===2?p.label:`${p.label}.${O+1}`}));C({parts:j,score:Vn(j)})},children:"删除"}),g==="SHORTANSWER"&&!r.optional&&f.jsx(ut,{label:`第 ${T+1} 小题作答高度`,value:w.height,min:30,max:Number.MAX_SAFE_INTEGER,onChange:j=>C({parts:p.parts.map(R=>R.id===w.id?{...R,height:j}:R)})})]},w.id)),p.parts.length>0&&f.jsx(Zt,{label:"本题总分",children:f.jsx("span",{children:p.score??"未设置"})}),!wt(g)&&!xi(g)&&f.jsx(Lt,{checked:p.halfPoint,onChange:w=>C({halfPoint:w.target.checked}),children:"计分栏显示 0.5"}),d&&f.jsx("p",{className:"card-choice-error",role:"alert",children:d}),f.jsx(ce,{size:"small",disabled:!l,onClick:()=>{if((x?p.parts:[p]).some(w=>w.score===null||w.score<(c.usage==="homework"?0:.5)||w.score>b.score)){m("请填写符合题型范围的分值");return}if(p.parts.some(w=>!w.label.trim())){m("题号不能为空");return}if(g==="INFO_MATCHING"&&x>v){m("选项个数需大于等于子题数量");return}if(g==="CHUNK_CHOICE"&&(!p.rightAnswers||p.rightAnswers>=v||p.singleScore===null||p.score!==null&&p.score!==0&&p.rightAnswers*p.singleScore>p.score)){m("正确答案个数须小于选项数,且每处得分之和不能超过题分");return}if(g==="MCHOICE"&&(p.choice.lessScore||0)>(p.score||0)){m("少选得分不能超过本题分值");return}a(p)&&u(null)},children:"应用配置"})]})}function UR({block:t,autoFocus:r,onClose:i}){const{card:a,geometry:c,setCard:l,setSelectedId:u,setDeleted:d,updateBlock:m,editQuestion:p,selectedChoiceId:C,selectChoice:g}=mt(),{dialog:b,setDialog:v,titleProps:x,cancelDrag:S}=Xd(O=>{const M=O.closest(".card-workspace")?.querySelector(".card-sidebar")?.getBoundingClientRect();return{left:(M?.left??window.innerWidth)-O.getBoundingClientRect().width-12,top:(M?.top??0)+12}}),w=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);E.useLayoutEffect(()=>{if(!b)return;const O=b;O.setAttribute("aria-modal","false"),O.setAttribute("aria-labelledby","card-block-modal-title");let M=document.activeElement instanceof HTMLElement?document.activeElement:null;const D=_=>{_.target instanceof HTMLElement&&!O.contains(_.target)&&(M=_.target)};return document.addEventListener("focusin",D),()=>{document.removeEventListener("focusin",D),O.contains(document.activeElement)&&M?.isConnected&&M.focus({preventScroll:!0})}},[b]),E.useLayoutEffect(()=>{b&&(b.dataset.settingsBlock=t.id)},[b,t.id]);const T=f.jsxs("div",{...x,className:"card-modal-drag","aria-label":"拖动题块设置",title:"拖动移动;方向键微调,Home 复位","data-editor-menu-avoid":!0,children:[f.jsx("h2",{id:"card-block-modal-title",children:"题块设置"}),f.jsx("p",{"aria-hidden":"true",children:t.reference?nr[t.reference.type]:xm[t.kind]})]}),j=()=>{d({block:t,index:a.blocks.findIndex(O=>O.id===t.id)}),l(O=>({...O,blocks:O.blocks.filter(M=>M.id!==t.id)})),u(null),i()},R=f.jsxs("div",{className:"card-modal-actions",children:[f.jsxs(ce,{type:"text",danger:!0,className:"card-delete","aria-label":"删除选中题块",onClick:j,children:[f.jsx(ko,{name:"trash",size:16}),"删除题块"]}),f.jsx(ce,{type:"text",onClick:()=>{const O=vo(t);l(M=>{const D=[...M.blocks];return D.splice(D.findIndex(_=>_.id===t.id)+1,0,O),{...M,blocks:D}}),u(O.id)},children:"复制题块"}),f.jsx(ce,{type:"primary",className:"card-edit-question",onClick:()=>p(t.id),children:t.areaType?"编辑文字":"编辑题目"})]});return f.jsx(Dl,{open:!0,modal:!1,panelRef:v,className:"card-modal card-block-modal",width:400,zIndex:900,classNames:{header:"card-modal-header",body:"card-modal-body card-inspector",footer:"card-modal-footer"},closeLabel:"关闭题块设置",closeIcon:f.jsx(ko,{name:"close",size:16}),onCancel:i,onOpenAutoFocus:O=>{O.preventDefault(),r?b?.querySelector(".ui-dialog-close")?.focus({preventScroll:!0}):w.current?.focus({preventScroll:!0})},onEscapeKeyDown:O=>{O.preventDefault(),O.stopPropagation(),S()||i()},title:T,footer:R,children:f.jsxs("div",{children:[f.jsxs("label",{className:"card-field",children:["标题",f.jsx(wa,{"aria-label":"题块标题",value:t.title,maxLength:300,onChange:O=>m(t.id,{title:O.target.value})})]}),t.reference&&f.jsx(HR,{block:t,value:t.reference,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:(O,M)=>m(t.id,{reference:O,...M?{document:M}:{}})}),!t.reference&&t.kind==="choice"&&t.choices&&f.jsx(Y0,{value:t.choices,document:t.document,creation:a.creation,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:O=>m(t.id,{choices:O})}),t.kind==="area"&&f.jsx(ut,{label:"区域高度",min:100,max:t.areaType==="forbiden"?Math.floor(c.contentHeight):4e3,value:t.answerHeight,onChange:O=>m(t.id,{answerHeight:O})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&t.exercise&&f.jsx(LR,{value:t.exercise,kind:t.kind,blockId:t.id,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:O=>m(t.id,{exercise:O})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&!t.exercise&&f.jsxs("div",{className:"card-range",children:["作答区高度 ",f.jsxs("b",{children:[t.answerHeight," px"]}),f.jsx(D0,{className:"ui-slider",ariaLabelForHandle:"作答区高度",min:0,max:800,step:10,value:t.answerHeight,onChange:O=>m(t.id,{answerHeight:O})}),f.jsx(ce,{size:"small",onClick:()=>{if(t.kind==="choice"||t.kind==="area")return;const O=sS(t.kind);O.items[0].area.rows=Math.ceil(t.answerHeight/O.items[0].area.rowHeight),m(t.id,{exercise:O})},children:"启用题型配置"})]})]},t.id)})}function $R(t){const r=new URLSearchParams(location.search);return{mode:r.get("mode")==="exam"?"exam":"template",name:(r.get("name")||"").slice(0,30),...fm(t,{gradeCode:r.get("gradeCode")||void 0,courseCode:r.get("courseCode")||void 0,grade:r.get("grade")||void 0,subject:r.get("subject")||void 0}),...r.get("id")?{id:r.get("id")}:{},...r.get("exampaperId")?{exampaperId:r.get("exampaperId")}:{}}}function GR({initial:t,dictionary:r,replacing:i,onCreate:a,onClose:c}){const[l,u]=E.useState(t),d={...l,...fm(r,l)},m=r.gradeCourseMap[d.gradeCode]||[],[p,C]=E.useState(""),g=E.useId(),b=E.useRef(null),{dialog:v,setDialog:x,titleProps:S}=Xd();E.useLayoutEffect(()=>{v?.setAttribute("aria-labelledby",`${g}-title`)},[v,g]);const w=f.jsx("div",{...S,className:"card-modal-drag","aria-label":"拖动新建答题卡",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:`${g}-title`,children:"新建答题卡"})});return f.jsx(Dl,{open:!0,panelRef:x,width:460,className:"card-modal card-create-modal",title:w,closeLabel:"关闭新建答题卡",closeIcon:f.jsx(ko,{name:"close",size:16}),onCancel:c,onOpenAutoFocus:T=>{T.preventDefault(),b.current?.focus({preventScroll:!0})},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ce,{onClick:c,children:"取消"}),f.jsx(ce,{type:"primary",htmlType:"submit",form:g,disabled:!d.gradeCode||!d.courseCode,children:"确定"})]}),children:f.jsxs("form",{id:g,onSubmit:T=>{if(T.preventDefault(),!d.name.trim()){C("请输入题卡名称"),b.current?.focus();return}if(!d.gradeCode||!d.courseCode){C("没有可用的年级和课程");return}a({...d,name:d.name.trim()})},children:[f.jsx("div",{className:"card-create-mode",role:"group","aria-label":"创建用途",children:["template","exam"].map(T=>f.jsx(ce,{type:d.mode===T?"primary":"default","aria-pressed":d.mode===T,onClick:()=>u(j=>({...j,mode:T})),children:T==="template"?"答题卡模板":"考试答题卡"},T))}),f.jsxs("label",{className:"card-field",children:["题卡名称",f.jsx(wa,{ref:b,"aria-label":"题卡名称",status:p?"error":void 0,"aria-invalid":!!p,"aria-describedby":p?"card-create-error":void 0,placeholder:"请输入题卡名称",maxLength:30,value:d.name,onChange:T=>{u(j=>({...j,name:T.target.value})),C("")}})]}),f.jsxs("div",{className:"card-create-subject",children:[f.jsxs("label",{className:"card-field",children:["年级",f.jsx(Ft,{"aria-label":"年级",value:d.gradeCode,disabled:!r.grades.length,onChange:T=>u(j=>({...j,...hi(r,T,r.gradeCourseMap[T][0].value)})),children:r.grades.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]}),f.jsxs("label",{className:"card-field",children:["科目",f.jsx(Ft,{"aria-label":"科目",value:d.courseCode,disabled:!m.length,onChange:T=>u(j=>({...j,...hi(r,d.gradeCode,T)})),children:m.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]})]}),!r.grades.length&&f.jsx("p",{className:"card-create-error",role:"alert",children:"没有可用的年级和课程"}),p&&f.jsx("p",{id:"card-create-error",className:"card-create-error",role:"alert",children:p}),i&&f.jsx("p",{className:"card-section-note",children:"确定后将新建空白题卡并替换当前内容。"})]})})}function VR(){const{card:t,setCard:r,setQuestionCard:i,readOnly:a,geometry:c}=mt(),l=u=>r(d=>d.header?{...d,header:{...d.header,...u}}:d);return f.jsxs("div",{className:"card-sidebar-section card-paper-settings",children:[f.jsx("h1",{children:"页面布局"}),f.jsx("div",{className:"card-preset-grid",children:Object.keys(pi).map((u,d)=>f.jsxs(ce,{type:"text","aria-label":pi[u].label,"aria-pressed":t.preset===u,disabled:a,onClick:()=>r(m=>({...m,preset:u})),children:[f.jsx("span",{className:`card-paper-icon cols-${pi[u].columns}`,children:Array.from({length:pi[u].columns},(m,p)=>f.jsx("i",{},p))}),f.jsx("span",{children:["一栏","两栏","三栏"][d]})]},u))}),f.jsx("p",{className:"card-section-note",children:c.columns===1?"一栏适用于 A4、16K 纸张":`${c.columns===2?"二":"三"}栏适用于 A3、8K 纸张`}),f.jsxs("div",{className:"card-paper-options",children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡用途"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:t.usage||"exam",onChange:u=>r(d=>({...d,usage:u.target.value})),children:[f.jsx(Ye.Button,{value:"exam",children:"考试"}),f.jsx(Ye.Button,{value:"homework",children:"作业"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"批阅模式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.scanMarking,onChange:u=>r(d=>({...d,scanMarking:u.target.value,blocks:d.blocks.map(m=>m.reference?.optional&&!u.target.value?{...m,reference:{...m.reference,choose:1}}:m)})),children:[f.jsx(Ye.Button,{value:!1,children:"手阅"}),f.jsx(Ye.Button,{value:!0,children:"网阅"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"分值 0.5"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.halfPoint,onChange:u=>r(d=>({...d,halfPoint:u.target.value,blocks:d.blocks.map(m=>m.reference?{...m,reference:{...m.reference,questions:m.reference.questions.map(p=>({...p,halfPoint:u.target.value}))}}:m)})),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡合一"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:"question-card",disabled:a,value:t.questionCard!==!1,onChange:u=>i(u.target.value),children:[f.jsx(Ye.Button,{value:!0,children:"是"}),f.jsx(Ye.Button,{value:!1,children:"否"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题排列"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:t.choiceDirection||"row",onChange:u=>r(d=>({...d,choiceDirection:u.target.value})),children:[f.jsx(Ye.Button,{value:"row",children:"横排"}),f.jsx(Ye.Button,{value:"column",children:"竖排"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题合并"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.mergeObjective,onChange:u=>r(d=>({...d,mergeObjective:u.target.value})),children:[f.jsx(Ye.Button,{value:!1,children:"不合并"}),f.jsx(Ye.Button,{value:!0,children:"合并"})]})]}),t.header&&f.jsxs(E.Fragment,{children:[[["subjectMarkers","学科标记"],["pointBlack","辅助识别点"],["examQrCode","试卷二维码"]].filter(([u])=>u!=="pointBlack"||t.usage!=="homework").map(([u,d])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:d}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:u==="subjectMarkers"?t.recognition?.[u]!==!1:!!t.recognition?.[u],onChange:m=>r(p=>({...p,recognition:{...p.recognition,[u]:m.target.value}})),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]},u)),t.recognition?.examQrCode&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"试卷 ID"}),f.jsx(wa,{"aria-label":"二维码试卷 ID",value:String(t.creation?.exampaperId??""),disabled:a,maxLength:128,onChange:u=>r(d=>d.creation?{...d,creation:{...d.creation,exampaperId:u.target.value||void 0}}:d)})]}),t.usage!=="homework"&&f.jsxs(E.Fragment,{children:[[["focusText","注意事项"],["writeKaohao","考场/座位号"],["missExam","填涂标记"],["mifeng","密封线"]].map(([u,d])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:d}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:`header-${u}`,disabled:a,value:t.header[u],onChange:m=>l({[u]:m.target.value}),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]},u)),f.jsxs("fieldset",{className:"card-setting-row card-exam-number-setting",disabled:a,children:[f.jsx("legend",{children:"考号版式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:"header-kaohao",disabled:a,value:t.header.kaohao,onChange:u=>l({kaohao:u.target.value}),children:[f.jsx(Ye.Button,{value:"code",children:"条形码"}),f.jsx(Ye.Button,{value:"school",children:"校内准考证号"})]})]}),t.header.kaohao==="school"&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"考号位数"}),f.jsx(Ft,{"aria-label":"准考证号位数",size:"small",disabled:a,value:t.header.weishu,onChange:u=>l({weishu:Number(u)}),children:Array.from({length:9},(u,d)=>f.jsxs("option",{value:d+4,children:[d+4,"位"]},d))})]})]}),t.usage==="homework"&&f.jsxs(E.Fragment,{children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"作业考号版式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",value:t.header.tiaomaStyle||1,onChange:u=>l({tiaomaStyle:u.target.value}),children:[f.jsx(Ye.Button,{value:1,children:"填涂"}),f.jsx(Ye.Button,{value:2,children:"条形码"})]})]}),t.header.tiaomaStyle!==2&&f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"班级填涂"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",value:t.header.classText!==!1,onChange:u=>l({classText:u.target.value}),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]})]})]})]})]})}function qR(){const{card:t,creationDictionary:r,saveMessage:i,saveAction:a,setCard:c,creationOpen:l,setCreationOpen:u,newCard:d,selectedId:m,setSelectedId:p,settingsId:C,setSettingsId:g,settingsAutoFocus:b,openSettings:v,readOnly:x,setReadOnly:S,titleOverflow:w,deleted:T,setDeleted:j,overflow:R,placementById:O,fitPage:M,moveBlock:D,selectBlock:_,download:I}=mt(),z=t.blocks.find(U=>U.id===C),[H,L]=E.useState(!1),[$,Y]=E.useState(null);return f.jsxs("div",{className:"card-controls",children:[f.jsxs("aside",{className:"card-sidebar","aria-label":"制卡设置",children:[f.jsxs("div",{className:"card-panel-header",children:[f.jsx("strong",{children:"制卡设置"}),f.jsx("a",{"data-card-demo-link":"",href:"/rich-text",children:"富文本编辑 ↗"})]}),f.jsxs("div",{className:"card-panel-actions",children:[f.jsxs("div",{className:"card-mode","aria-label":"制卡模式",children:[f.jsx(ce,{type:"text","aria-pressed":!x,onClick:()=>S(!1),children:"编辑"}),f.jsx(ce,{type:"text","aria-pressed":x,onClick:()=>S(!0),children:"预览"})]}),f.jsxs(ce,{type:"text",onClick:I,className:"card-export",children:[f.jsx(ko,{name:"upload",size:15}),a]})]}),i&&f.jsx("div",{className:"card-overflow-notice",role:"status",children:i}),f.jsx("div",{className:"card-panel-fit",children:f.jsx(ce,{type:"text",onClick:M,children:"适合宽度"})}),R.length>0&&f.jsxs("div",{className:"card-overflow-notice",role:"alert",children:[R.length," 个题块超出单栏,内容可滚动查看。请调整版式、正文或作答高度。"]}),w&&f.jsx("div",{className:"card-overflow-notice",role:"alert",children:"卷头内容超出可用区域,请拖高标题或调整内容、版式。"}),f.jsxs("div",{className:"card-sidebar-section card-document-section",children:[f.jsx("strong",{className:"card-document-name",children:t.title||"未新建答题卡"}),t.creation&&f.jsxs("p",{className:"card-section-note",children:[t.creation.mode==="template"?"答题卡模板":"考试答题卡"," · ",t.creation.grade," · ",t.creation.subject]}),f.jsx(ce,{type:"text",className:"card-add-component",onClick:()=>u(!0),children:"新建答题卡"})]}),f.jsx(VR,{}),f.jsxs("div",{className:"card-sidebar-section card-outline-section",children:[f.jsxs("div",{className:"card-section-heading",children:[f.jsx("h2",{children:"题块"}),f.jsxs("span",{children:[t.blocks.length," 个"]})]}),f.jsx("p",{className:"card-section-note",children:"拖动列表调整顺序,点击打开题块设置"}),!t.blocks.length&&f.jsx("p",{className:"card-section-note",children:"从一道题开始,添加空白题块后编辑内容。"}),f.jsx("ol",{className:"card-outline",children:t.blocks.map((U,q)=>{const P=O.get(U.id);return f.jsxs("li",{className:m===U.id?"active":"",draggable:!x,onDragStart:G=>{Y(U.id),G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",U.id)},onDragEnd:()=>Y(null),onDragOver:G=>{!x&&$&&G.preventDefault()},onDrop:G=>{G.preventDefault(),$&&!x&&D($,q),Y(null)},children:[f.jsxs(ce,{type:"text",className:"card-outline-item","aria-haspopup":x?void 0:"dialog",onClick:()=>{x?_(U.id,!0):v(U.id)},children:[f.jsx("span",{className:"card-outline-number",children:String(q+1).padStart(2,"0")}),f.jsxs("span",{children:[f.jsx("strong",{children:U.title||xm[U.kind]}),f.jsxs("small",{children:["第 ",P.page+1," 页 · 第 ",P.column+1," 栏",P.overflowing?" · 超出":""]})]})]}),!x&&f.jsxs("div",{className:"card-reorder",children:[f.jsx(ce,{type:"text","aria-label":`上移题块 ${q+1}`,title:"上移",disabled:q===0,onClick:()=>D(U.id,q-1),children:"↑"}),f.jsx(ce,{type:"text","aria-label":`下移题块 ${q+1}`,title:"下移",disabled:q===t.blocks.length-1,onClick:()=>D(U.id,q+1),children:"↓"})]})]},U.id)})}),!x&&f.jsx("div",{className:"card-add",children:f.jsx(ce,{type:"text","aria-haspopup":"dialog",onClick:()=>L(!0),children:"+ 添加题块"})})]}),f.jsxs("div",{className:"card-sidebar-bottom",children:[f.jsx("span",{className:"card-version-dot"}),"自动排版已开启",f.jsx("span",{children:"连续换栏"})]})]}),l&&f.jsx(GR,{initial:$R(r),dictionary:r,replacing:!!(t.paperTitle||t.blocks.length),onCreate:d,onClose:()=>u(!1)}),z&&!x&&f.jsx(UR,{block:z,autoFocus:b,onClose:()=>g(null)}),H&&!x&&!l&&f.jsx(NR,{creation:t.creation,questionCard:t.questionCard,onClose:()=>L(!1),onAdd:U=>{const q=U==="forbiden"||U==="editArea"?mS(U):Tm(U);c(P=>{const G=[...P.blocks],B=G.findIndex(Q=>Q.id===m);return G.splice(B>=0?B+1:G.length,0,q),{...P,blocks:G}}),L(!1),v(q.id)}}),T&&f.jsxs("div",{className:"card-toast",role:"status",children:["题块已删除",f.jsx(ce,{type:"text",onClick:()=>{c(U=>{const q=[...U.blocks];return q.splice(T.index,0,T.block),{...U,blocks:q}}),p(T.block.id),j(null)},children:"撤销"}),f.jsx(ce,{type:"text","aria-label":"关闭删除提示",onClick:()=>j(null),children:f.jsx(ko,{name:"close",size:14})})]})]})}function Q0({settings:t,activeQuestionId:r}){if(!t.questions.length)return null;const i=su(t),a=l=>f.jsxs("div",{className:`card-choice-row${l.id===r?" is-current-choice":""}`,"data-question-id":l.id,"aria-current":l.id===r?"true":void 0,children:[f.jsxs("b",{children:[l.label,"."]}),f.jsx("div",{className:"card-choice-options","data-marker":t.marker,children:l.options.map(u=>f.jsx("span",{className:"card-choice-glyph","data-recognition":"MultiChoice","data-recognition-role":"cell","data-answer-id":l.id,"data-option-id":u.id,"data-value":u.label,"data-marker":t.marker,children:t.marker==="check"?`○ ${u.label}.`:u.label},u.id))})]},l.id),c=[[]];for(const l of t.questions)l.breakBefore&&c[c.length-1].length&&c.push([]),c[c.length-1].push(l);return f.jsx("div",{className:"card-choice-grid","aria-label":"选择题填涂区",style:{rowGap:t.rowGap,columnGap:t.columnGap},"data-direction":i,children:i==="column"?oS(t).map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{columnGap:t.columnGap,rowGap:t.rowGap},children:l.map(d=>f.jsx("div",{className:"card-choice-column",style:{gap:t.rowGap,minHeight:t.rowsPerColumn*20+(t.rowsPerColumn-1)*t.rowGap},children:d.map(a)},d[0].id))},u)):c.map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{rowGap:t.rowGap,columnGap:t.columnGap},children:l.map(a)},u))})}function F0(t){const r=t.getBoundingClientRect(),i=getComputedStyle(t),a=u=>Math.round(u*64)/64,c=a(parseFloat(i.width)+(i.boxSizing==="border-box"?0:parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth))),l=c>0&&r.width>0?r.width/c:1;return u=>{const d=u.getBoundingClientRect();let m=0;for(let p=u;p&&p!==t;p=p.parentElement)m+=parseFloat(p.style.translate.split(/\s+/)[1])||0;return{top:a((d.top-r.top)/l-m),height:a(d.height/l),width:a(d.width/l)}}}function Z0(t){return F0(t.closest(".card-question")||t)(t)}function YR(t){return Z0(t).top}function Hl({id:t,label:r,value:i,visible:a,readOnly:c,placement:l,onUnits:u,onChange:d,onActiveFragment:m,uploadImage:p,choiceFillPosition:C,choiceFillBindings:g,activeChoiceQuestionId:b,contentTargets:v,editorKeys:x,onContentSelect:S}){const{geometry:w,registerEditor:T}=mt(),j=JSON.stringify(x||[]),R=E.useCallback(Y=>{JSON.parse(j).forEach(U=>T(`content/${U}`,Y))},[j,T]),O=E.useRef(null),M=E.useRef(!1);a&&(M.current=!0);const D=E.useRef([]),[_,I]=E.useState(0),z=E.useRef({id:t,visible:a,onUnits:u});z.current={id:t,visible:a,onUnits:u};const H=E.useCallback(()=>{const Y=O.current?.querySelector(".rt-content"),U=Y?YR(Y):0;I(q=>Math.abs(q-U)<.5?q:U),z.current.onUnits(z.current.id,z.current.visible?D.current.map(q=>({top:q.top+U,bottom:q.bottom+U})):[])},[]),L=E.useCallback(Y=>{D.current=Y,H()},[H]);E.useLayoutEffect(()=>{H()},[H,a,l.fragments,i]),E.useLayoutEffect(()=>()=>z.current.onUnits(z.current.id,[]),[]);const $=E.useMemo(()=>l.fragments.map(Y=>({from:Y.from-_,to:Y.to-_,x:Y.x-l.x,y:Y.y-l.y-Y.from+(Y.topPadding||0)})),[l.fragments,l.x,l.y,_]);return f.jsx("div",{ref:O,className:"exercise-text",hidden:!a,children:M.current&&f.jsx(Ui,{value:i,readOnly:c||!a,uploadImage:p,ariaLabel:r,onChange:d,onEditor:R,contentTargets:v,allowContentAssignment:!1,onContentSelect:S,pagination:{slices:$,maxUnitHeight:w.contentHeight-80,onMeasure:L,onActiveSliceChange:m},choiceFillPosition:C,choiceFillBindings:g,activeChoiceQuestionId:b})})}function XR({rows:t,rowHeight:r,label:i,onChange:a}){const{scale:c}=mt(),l=E.useRef(null),u=()=>{l.current&&a(l.current.rows),l.current=null};return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":`调整 ${i} 题作答高度`,title:"拖动调整作答高度",onPointerDown:d=>{d.preventDefault(),d.stopPropagation(),d.currentTarget.focus(),l.current={y:d.clientY,rows:t},d.currentTarget.setPointerCapture(d.pointerId)},onPointerMove:d=>{l.current&&a(Math.max(1,Math.min(120,l.current.rows+Math.round((d.clientY-l.current.y)/c/r))))},onPointerUp:d=>{l.current=null,d.currentTarget.releasePointerCapture(d.pointerId)},onPointerCancel:u,onLostPointerCapture:()=>{l.current=null},onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),u()),["ArrowUp","ArrowDown"].includes(d.key)&&(d.preventDefault(),a(Math.max(1,Math.min(120,t+(d.key==="ArrowDown"?1:-1)))))}})}function W0({blank:t,item:r,active:i,fullLabel:a=!1}){return f.jsxs("div",{style:{width:`${t.width}%`},className:`exercise-flow-unit exercise-blank${i?" is-current":""}`,"data-exercise-id":r.id,"data-answer-id":t.id,children:[f.jsxs("span",{children:[a?`${r.label}.${t.label}`:`(${t.label})`," ",t.prefix]}),f.jsx("span",{className:`exercise-blank-space ${t.style}`,children:t.style==="characters"&&Array.from({length:t.characters},(c,l)=>f.jsx("i",{},l))}),f.jsx("span",{children:t.suffix})]})}function KR({area:t,item:r,active:i,readOnly:a,onResize:c,prefix:l=""}){const u={"--area-columns":t.columns,"--area-line":`${t.rowHeight}px`};return f.jsxs("div",{className:"exercise-area","data-style":t.style,style:u,children:[t.title&&f.jsxs("div",{className:`exercise-flow-unit exercise-title-line${i?" is-current":""}`,"data-exercise-id":r.id,children:["题目:",f.jsx("span",{})]}),Array.from({length:t.rows},(d,m)=>f.jsxs("div",{className:`exercise-flow-unit exercise-area-row${i?" is-current":""}`,"data-exercise-id":r.id,"data-area-row":m,style:{height:t.rowHeight,...t.backgroundUrl?{backgroundImage:`url(${JSON.stringify(t.backgroundUrl)})`,backgroundSize:`100% ${t.rows*t.rowHeight}px`,backgroundPosition:`0 -${m*t.rowHeight}px`}:{}},children:[l&&m===0&&f.jsx("span",{className:"exercise-area-prefix",children:l}),t.style==="characters"&&Array.from({length:t.columns},(p,C)=>{const g=m*t.columns+C+1;return f.jsx("span",{className:"exercise-character",children:t.wordMark>0&&g%t.wordMark===0&&f.jsxs("small",{children:[g,"字"]})},C)}),t.style==="coordinates"&&m===Math.floor(t.rows/2)&&f.jsx("span",{className:"exercise-axis-x",children:"x →"}),t.style==="coordinates"&&m===0&&f.jsx("span",{className:"exercise-axis-y",children:"↑ y"})]},m)),!a&&t.rows>0&&f.jsx(XR,{rows:t.rows,rowHeight:t.rowHeight,label:r.label,onChange:c})]})}function QR({value:t,kind:r,placement:i,showQuestion:a,readOnly:c,activeId:l,onUnits:u,onChange:d,onActiveFragment:m,uploadImage:p}){const C=(S,w="")=>`exercise-flow-unit ${w}${S===l?" is-current":""}`,g=t.pool,b=E.useMemo(()=>new Map(t.items.filter(S=>S.kind==="choice").map(S=>[S.id,na({...iu(0),presentation:S.presentation,questions:[S.choice]},S.document,a)])),[t.items,a]),v=(S=!1)=>g.map(w=>f.jsxs("div",{className:"exercise-pool-entry",children:[f.jsxs("div",{className:"exercise-flow-unit exercise-pool-option","data-pool-id":w.id,children:[S?"● ":"",w.label,". ",a?w.text:""]}),w.document&&f.jsx(Hl,{id:`pool/${w.id}`,label:`共享选项 ${w.label} 正文`,value:w.document,visible:a,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:T=>d({...t,pool:t.pool.map(j=>j.id===w.id?{...j,document:T}:j)})})]},w.id)),x=["fill","completion"].includes(r)&&(!a||t.items.every(S=>xn(S.document)));if(r==="chunk"){let S=0;const w=t.chunkPoints.map(T=>{const j=t.chunkText.slice(S,T.offset);return S=T.offset,{text:j,...T}});return f.jsxs("div",{className:"exercise-content",children:[f.jsx(Hl,{id:"chunk-material",label:"断句题面",value:{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:w.map(T=>`${T.text}〔${T.label}〕`).join("")+t.chunkText.slice(S)||" "}]}]}},visible:a,readOnly:!0,placement:i,onUnits:u,onChange:()=>{},onActiveFragment:m}),f.jsxs("div",{className:"exercise-flow-unit exercise-chunk-answer",children:[t.chunkPoints.map(T=>f.jsx("span",{className:"exercise-mark","data-answer-id":T.id,children:T.label},T.id)),f.jsxs("span",{children:["(最多选 ",t.chunkMax," 处)"]})]})]})}return f.jsxs("div",{className:"exercise-content","data-exercise-kind":r,children:[x&&f.jsx("div",{className:"exercise-blanks",children:t.items.map(S=>f.jsxs(E.Fragment,{children:[S.blanks.map(w=>f.jsxs(E.Fragment,{children:[f.jsx(W0,{blank:w,item:S,active:S.id===l,fullLabel:!0}),w.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},w.id)),t.fillNewLine&&f.jsx("span",{className:"exercise-line-break"})]},S.id))}),r==="optional"&&f.jsxs("div",{className:"exercise-flow-unit exercise-optional-head",children:["从以下 ",t.items.length," 题中选做 ",t.chooseCount," 题",t.groupScore!==null?`,共 ${t.groupScore} 分`:"","。",f.jsxs("span",{children:["选做题号:",t.items.map(S=>f.jsx("span",{className:"exercise-mark","data-exercise-id":S.id,children:S.label},S.id))]})]}),["matching","ordering"].includes(r)&&a&&(r!=="matching"||t.matchingDisplay==="letters")&&v(),f.jsxs("div",{hidden:x,className:r==="matching"&&t.matchingDisplay==="lines"?"exercise-matching-layout":void 0,children:[f.jsx("div",{children:r==="ordering"?f.jsx("div",{children:t.ordering==="sequence"?f.jsxs("div",{className:"exercise-flow-unit exercise-sequence",children:["排序:",g.map((S,w)=>f.jsxs("span",{children:[f.jsx("span",{className:"exercise-order-slot","data-answer-id":S.id}),w<g.length-1?"→":""]},S.id))]}):t.categories.map(S=>f.jsxs("div",{className:"exercise-flow-unit exercise-category","data-category-id":S.id,children:[f.jsxs("span",{children:[S.label,". ",S.text]}),f.jsx("span",{})]},S.id))}):t.items.map(S=>{const w=S.id===l,T=b.get(S.id),j=!x&&(S.kind==="table"||a&&(!xn(S.document)||!c&&(pm.includes(r)||t.items.length>1||r==="matching")));return f.jsxs("div",{className:"exercise-item","data-exercise-item":S.id,children:[f.jsxs("div",{className:C(S.id,"exercise-item-heading"),"data-exercise-id":S.id,children:[f.jsxs("b",{children:[S.label,"."]}),S.score!==null&&f.jsxs("span",{children:["(",S.score," 分)"]}),r==="matching"&&t.matchingDisplay==="lines"&&f.jsx("span",{className:"exercise-connector",children:"●"})]}),f.jsx(Hl,{id:S.id,label:`小题 ${S.label} 正文`,value:S.document,visible:j,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:R=>d({...t,items:t.items.map(O=>O.id===S.id?{...O,document:R}:O)}),choiceFillPosition:T?.position,choiceFillBindings:T?.bindings,activeChoiceQuestionId:w?S.id:void 0}),(S.kind==="judge"||S.kind==="choice"&&!!T?.concentrated.questions.length)&&f.jsx("div",{className:C(S.id,"exercise-choices"),"data-exercise-id":S.id,children:(S.kind==="judge"?S.choice.options.slice(0,2):S.choice.options).map((R,O)=>f.jsx("span",{className:`exercise-mark${S.kind==="choice"||t.judgeLabels!=="words"?" exercise-choice-mark":""}`,"data-answer-id":R.id,children:S.kind==="judge"?gm[t.judgeLabels][O]:R.label},R.id))}),r==="matching"&&t.matchingDisplay==="letters"&&f.jsx("div",{className:C(S.id,"exercise-match-letters"),"data-exercise-id":S.id,children:f.jsx("span",{className:"exercise-order-slot"})}),r!=="matching"&&S.kind==="fill"&&!x&&f.jsx("div",{className:"exercise-blanks","data-new-line":t.fillNewLine,children:S.blanks.map(R=>f.jsxs(E.Fragment,{children:[f.jsx(W0,{blank:R,item:S,active:w}),R.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},R.id))}),S.steps.map(R=>f.jsxs("div",{className:C(S.id,"exercise-step"),"data-exercise-id":S.id,"data-step-id":R.id,children:[f.jsxs("span",{children:["(",R.label,") ",R.prompt,R.score!==null?`(${R.score} 分)`:""]}),f.jsx("span",{className:"exercise-step-answer"})]},R.id)),(["answer","calculation","correction","drawing","writing","english"].includes(S.kind)||S.kind==="judge"&&S.needsReason)&&f.jsx(KR,{area:S.area,item:S,active:w,readOnly:c,onResize:R=>d({...t,items:t.items.map(O=>O.id===S.id?{...O,area:{...O.area,rows:R}}:O)})})]},S.id)})}),r==="matching"&&t.matchingDisplay==="lines"&&f.jsx("div",{children:v(!0)})]}),r==="practice"&&f.jsxs("div",{className:"exercise-flow-unit exercise-evaluation",children:["评价意见:",f.jsx("span",{})]})]})}function J0({height:t,min:r,label:i,onChange:a}){const{scale:c}=mt(),l=E.useRef(null);return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":i,onPointerDown:u=>{u.preventDefault(),u.stopPropagation(),l.current={y:u.clientY,height:t},u.currentTarget.setPointerCapture(u.pointerId)},onPointerMove:u=>{l.current&&a(Math.max(r,Math.round(l.current.height+(u.clientY-l.current.y)/c)))},onPointerUp:u=>{l.current=null,u.currentTarget.releasePointerCapture(u.pointerId)},onLostPointerCapture:()=>{l.current=null},onPointerCancel:()=>{l.current&&a(l.current.height),l.current=null},onKeyDown:u=>{u.key==="Escape"&&l.current&&(a(l.current.height),l.current=null),["ArrowUp","ArrowDown"].includes(u.key)&&(u.preventDefault(),a(Math.max(r,t+(u.key==="ArrowDown"?10:-10))))}})}const FR="M1009 734Q994 750 972 750Q950 750 935 734L694 479L522 661Q507 677 485.5 677Q464 677 449 661Q434 645 434 622.5Q434 600 449 584L621 402L383 151L91 462Q76 478 54 478Q32 478 17 462Q2 446 1 423.5Q0 401 15 384L346 34Q361 19 382.5 19Q404 19 419 34L693 327L810 201Q825 186 847 186Q869 186 884 201.5Q899 217 899 239.5Q899 262 884 279L768 402L1009 656Q1024 672 1024 694.5Q1024 717 1009 734Z",ZR="M585 384 860 659Q869 675 867 693Q865 711 852 724Q839 737 821 739Q803 741 787 732L512 457L237 734Q221 744 203 741.5Q185 739 172 726Q159 713 157 695Q155 677 164 661L439 384L162 109Q152 93 154.5 75Q157 57 170 44Q183 31 201 29Q219 27 235 36L512 311L787 36Q803 27 821 29Q839 31 852 44Q865 57 867 75Q869 93 860 109Z";function WR({question:t,part:r}){const i=!r&&t.parts.length>1;return f.jsx("div",{className:"reference-homework-marking",children:i?t.parts.map((a,c)=>f.jsxs("span",{"data-recognition":"Checkbox","data-recognition-role":"cell","data-answer-id":a.id,"data-value":String(c+1),children:["(",c+1,")"]},a.id)):[FR,ZR].map((a,c)=>f.jsx("span",{"data-recognition":"ScoreBox","data-recognition-role":"cell","data-answer-id":r?.id||t.parts[0]?.id||t.id,"data-value":c===0?"partial":"incorrect",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 -128 1024 1024",children:f.jsx("path",{transform:"translate(0 768) scale(1 -1)",d:a,fill:"currentColor"})})},c))})}function Kd({placement:t,children:r,className:i="",answerId:a,sectionType:c,questionIds:l,scope:u,footer:d}){const m=E.useRef(null),[p,C]=E.useState({top:0,height:0});return E.useLayoutEffect(()=>{const g=()=>{const{top:v,height:x}=Z0(m.current);C(S=>S.top===v&&S.height===x?S:{top:v,height:x})};g();const b=new ResizeObserver(g);return b.observe(m.current),()=>b.disconnect()},[t.fragments,r]),f.jsxs("div",{ref:m,className:`reference-paper-frame ${i}`,"data-marking-frame":d?"":void 0,children:[r,d&&f.jsx("div",{className:"exercise-flow-unit reference-marking-space"}),t.fragments.map((g,b)=>{const v=Math.max(p.top,g.from),x=Math.min(p.top+p.height,g.to),S=v<=p.top+.5;return x>v&&f.jsx("div",{"aria-hidden":"true",className:"reference-paper-border","data-recognition":!S&&u!=="section"&&c?"FrameOnly":c,"data-recognition-scope":u,"data-answer-id":a,"data-question-ids":l?.join(","),"data-fragment":b,style:{left:g.x-t.x,top:v-p.top+g.y-t.y-g.from+(v>g.from&&g.topPadding||0),height:x-v+(v===g.from&&g.topPadding||0)+(x===g.to&&g.bottomPadding||0)},children:S&&d},b)})]})}function JR({score:t,halfPoint:r,active:i,id:a}){const{card:c}=mt();return!c.scanMarking&&t!==null&&t>0&&f.jsx("div",{className:`exercise-flow-unit reference-score-row${i?" is-current":""}`,"data-exercise-id":a,children:RS(t,r).map((l,u)=>f.jsx("span",{"data-recognition":l?"ScoreBox":void 0,"data-answer-id":a,"data-recognition-role":"cell","data-value":l,children:l},u))})}function Qd({question:t,part:r,props:i,optional:a=!1}){const{card:c,geometry:l,scale:u,selectChoice:d}=mt(),{value:m,placement:p,width:C,readOnly:g,activeId:b,uploadImage:v,onUnits:x,onActiveFragment:S,onChange:w}=i,T=r?.id||t.id,j=r?.label||t.label,R=r?.score??t.score,O=c.usage==="homework"&&R===0,M=O&&!r&&t.type==="SHORTANSWER"&&!a,D=O&&!c.scanMarking,_=b===T||b===t.id,I=E.useRef(null),[z,H]=E.useState(0),[L,$]=E.useState(()=>window.devicePixelRatio||1);E.useEffect(()=>{if(t.type!=="CCOMPOSITION")return;const oe=()=>$(window.devicePixelRatio||1);return window.addEventListener("resize",oe),()=>window.removeEventListener("resize",oe)},[t.type]);const Y=r?.document||t.document,U=oe=>w({...m,questions:m.questions.map(ae=>ae.id===t.id?{...ae,...oe}:ae)}),q=oe=>U(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,document:oe}:ae)}:{document:oe}),P=a?m.optionalHeight:r?.height||t.height;E.useLayoutEffect(()=>{const oe=I.current.querySelector(".reference-answer-body"),ae=()=>H(oe.offsetHeight);ae();const xe=new ResizeObserver(ae);return xe.observe(oe),()=>xe.disconnect()},[]);const G=(oe="")=>`exercise-flow-unit ${oe}${_?" is-current":""}`,B=Math.max(0,P-z-(D?22:!c.scanMarking&&R!==null&&R>0?18:0)),Q=TS(C),N=Q*31+1,K=Math.max(1,Math.round(L))/(L*u),ne=`M.5 .5H${N-.5}V32.5H.5Z`+Array.from({length:Q-1},(oe,ae)=>`M${(ae+1)*31+.5} .5V32.5`).join(""),te=t.type==="CCOMPOSITION"?Math.ceil(t.characters/Q):Math.ceil(B/40),le=oe=>a?w({...m,optionalHeight:oe}):U(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,height:oe}:ae)}:{height:oe});return f.jsx("div",{ref:I,className:"reference-answer","data-exercise-item":T,children:f.jsxs(Kd,{placement:p,answerId:T,sectionType:c.scanMarking?"FrameOnly":M&&t.parts.length>1?"Checkbox":"ScoreBox",questionIds:a?m.questions.map(oe=>oe.id):void 0,className:t.type==="CCOMPOSITION"?"reference-composition":"",footer:D?f.jsx(WR,{question:t,part:r}):void 0,children:[f.jsx(JR,{score:R,halfPoint:t.halfPoint,active:_,id:T}),f.jsxs("div",{className:"reference-answer-body",children:[a&&f.jsxs("div",{className:G("reference-optional-head"),style:{minHeight:l.columns===3?104:82},"data-exercise-id":T,children:[f.jsxs("p",{children:[f.jsx("b",{children:"选做题"}),"  请考生从给出的第",m.questions.map(oe=>oe.label).join("、"),Fd(m.questions.length),"题中任选",Fd(m.choose),"题作答,并用2B铅笔在答题卡上把所选题目对应的题号涂黑,注意所做题目的题号必须与所涂题号一致,如果多做,则按所做的",m.choose===1?"第一题":`前${Fd(m.choose)}题`,"计分。"]}),f.jsxs("p",{children:["我选做的题号是:",m.questions.map(oe=>f.jsx("span",{"data-exercise-id":oe.id,"data-recognition":"QuestionChoice","data-answer-id":oe.id,"data-recognition-role":"cell","data-value":oe.label,children:oe.label},oe.id))]})]}),f.jsx("div",{className:"reference-answer-text",style:{minHeight:t.type==="CCOMPOSITION"?t.contentHeight:void 0},children:(a?m.questions.map(oe=>({item:oe,entryPart:void 0})):M?t.parts.map(oe=>({item:t,entryPart:oe})):[{item:t,entryPart:r}]).map(({item:oe,entryPart:ae})=>{const xe=a?oe.parts[0]?.id||oe.id:ae?.id||T,we=a?oe.label:ae?.label||j,ge=a||!ae||oe.parts[0]?.id===ae.id,de=m.textVersion===1&&m.type!=="MIXED"&&ge,Me=de&&i.showQuestion&&oe.text,Be=a?oe.parts[0]?.document||oe.document:ae?.document||Y,Ae=Me?kr([...Gs(oe.text,oe.id,oe.label),...oe.type==="ECOMPOSITION"?(Be.content.content||[]).slice(1):[]]):Be;return f.jsx("div",{"data-exercise-id":xe,className:"reference-answer-entry",children:f.jsx(Hl,{id:`reference/${xe}`,label:`第 ${we} 题作答内容`,value:Ae,editorKeys:de?[oe.id,xe]:[xe],contentTargets:Me?[{id:oe.id,label:`第 ${oe.label} 题题干`,kind:"question"}]:void 0,onContentSelect:Se=>d(i.blockId,Se),visible:!0,readOnly:g,placement:p,uploadImage:v,onUnits:x,onActiveFragment:S,onChange:Me?Se=>w({...m,questions:m.questions.map(Ce=>Ce.id===oe.id?{...Ce,text:wm(Ce.text,(Se.content.content||[]).filter(Ot=>Ce.type!=="ECOMPOSITION"||Ot.attrs?.contentId===Ce.id)),...Ce.type==="ECOMPOSITION"?{document:kr([Ce.document.content.content[0],...(Se.content.content||[]).filter(Ot=>Ot.attrs?.contentId!==Ce.id)])}:{}}:Ce)}):a?Se=>w({...m,questions:m.questions.map(Ce=>Ce.id===oe.id?{...Ce,document:Se,parts:Ce.parts.map((Ot,dt)=>dt===0?{...Ot,document:Se}:Ot)}:Ce)}):M&&ae?Se=>U({parts:t.parts.map(Ce=>Ce.id===ae.id?{...Ce,document:Se}:Ce)}):q})},xe)})})]}),Array.from({length:te},(oe,ae)=>f.jsx("div",{className:G(`reference-answer-row ${t.type==="CCOMPOSITION"?"reference-character-row":""}`),"data-exercise-id":T,style:{height:t.type==="CCOMPOSITION"?39.5:Math.min(40,B-ae*40)},children:t.type==="CCOMPOSITION"&&f.jsxs("div",{className:"reference-character-grid",children:[f.jsx("svg",{"aria-hidden":"true",className:"reference-character-lines",width:N,height:"33",viewBox:`0 0 ${N} 33`,children:f.jsx("path",{d:ne,fill:"none",stroke:"#000",strokeWidth:K,vectorEffect:"non-scaling-stroke",shapeRendering:"crispEdges"})}),Array.from({length:Q},(xe,we)=>{const ge=ae*Q+we+1;return f.jsx("span",{className:"reference-character","data-character":ge<=t.characters?ge:void 0,"data-padding":ge>t.characters||void 0,children:ge<=t.characters&&ge%100===0&&f.jsxs("small",{children:[ge,"字"]})},we)})]})},ae)),!g&&t.type!=="CCOMPOSITION"&&f.jsx(J0,{height:P,min:30,label:`调整第 ${j} 题作答高度`,onChange:le})]})})}function Fd(t){const r="零一二三四五六七八九";return t<10?r[t]:t<100?`${t<20?"":r[Math.floor(t/10)]}十${t%10?r[t%10]:""}`:t===100?"一百":String(t)}function eO(t){const{value:r,placement:i,activeId:a,concentrated:c}=t,{card:l}=mt(),u=new Set(c.questions.map(m=>m.id)),d=E.useMemo(()=>{const m=[];return r.questions.forEach(p=>{const C=wt(p.type)?"choice":xi(p.type)?"fill":"answer",g=m.at(-1);C!=="answer"&&g?.category===C?g.questions.push(p):m.push({category:C,questions:[p]})}),m},[r.questions]);return r.optional&&r.questions.length>1?f.jsx("div",{className:"reference-content",children:f.jsx(Qd,{question:r.questions[0],props:t,optional:!0})}):f.jsx("div",{className:"reference-content",children:d.map((m,p)=>f.jsxs(E.Fragment,{children:[m.category==="choice"&&sa({...r,questions:m.questions}).some(C=>u.has(C.id))&&f.jsx(Kd,{placement:i,className:"reference-choice-frame",sectionType:"MultiChoice",scope:"section",answerId:`${t.blockId}/choice/${p}`,questionIds:m.questions.map(C=>C.id),children:f.jsx(Q0,{activeQuestionId:m.questions.find(C=>C.id===a&&Le(C.type))?.parts[0]?.id||a,settings:{...c,questions:sa({...r,questions:m.questions}).filter(C=>u.has(C.id))}})}),m.category==="fill"&&f.jsx(Kd,{placement:i,className:"reference-fill-frame",sectionType:"Checkbox",scope:"section",answerId:`${t.blockId}/fill/${p}`,questionIds:m.questions.map(C=>C.id),children:f.jsx("div",{className:"reference-fill-grid",children:m.questions.map(C=>f.jsxs(E.Fragment,{children:[C.parts.map(g=>f.jsxs(E.Fragment,{children:[f.jsxs("div",{className:`exercise-flow-unit reference-blank${l.scanMarking?" is-online":""}${a===C.id||a===g.id?" is-current":""}`,style:{width:`${g.width}%`},"data-exercise-id":g.id,"data-answer-id":g.id,"data-recognition":"Checkbox",children:[f.jsxs("span",{className:"reference-blank-number",children:[g.label,"."]}),f.jsx("span",{className:"reference-blank-line","data-recognition":"Checkbox","data-recognition-role":"line","data-answer-id":g.id}),!l.scanMarking&&f.jsx("span",{className:"reference-blank-score","data-recognition":"ScoreBox","data-recognition-role":"cell","data-answer-id":g.id})]}),g.breakAfter&&f.jsx("span",{className:"exercise-line-break"}),r.fillNewLine&&Le(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},g.id)),r.fillNewLine&&!Le(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},C.id))})}),m.category==="answer"&&m.questions.map(C=>C.type==="SHORTANSWER"&&!(l.usage==="homework"&&C.score===0)?C.parts.map(g=>f.jsx(Qd,{question:C,part:g,props:t},g.id)):f.jsx(Qd,{question:C,props:t},C.id)),p<d.length-1&&f.jsx("div",{className:"reference-section-gap"})]},m.questions[0].id))})}function tO({hidden:t=!1,block:r,index:i,placement:a,width:c,scale:l,selected:u,readOnly:d,showQuestion:m,activeChoiceId:p,uploadImage:C,registerEditor:g,onSelect:b,onActiveFragment:v,onSettings:x,onMeasure:S,onDocument:w,onHeight:T,onExercise:j,onReference:R}){const{card:O,geometry:M,selectChoice:D}=mt(),_=E.useMemo(()=>r.reference?U0(r):void 0,[r.id,r.reference]),I=E.useMemo(()=>r.reference?na({...r.reference.layout,questions:sa(r.reference)},r.document,m):r.kind==="choice"&&r.choices?na(r.choices,r.document,m):void 0,[r.reference,r.kind,r.choices,r.document,m]),H=!(r.reference?.textVersion===1&&r.reference.questions.length>0&&["SHORTANSWER","ECOMPOSITION","CCOMPOSITION"].includes(r.reference.type))&&!t&&r.id!==gr&&m&&(!d||!(r.exercise||r.reference)||!xn(r.document)||!!I?.bindings.length),L=E.useRef(null),$=E.useCallback(be=>{L.current=be,g(r.id,be)},[r.id,g]),Y=E.useMemo(()=>r.reference?vR(r.document,r.reference,c):r.document,[r.document,r.reference,c]);E.useEffect(()=>{L.current?.syncDocument(Y)},[Y]);const U=E.useRef(null),q=E.useRef(S);q.current=S;const P=E.useRef([]),G=E.useRef(new Map),[B,Q]=E.useState(0),[N,K]=E.useState(0),ne=E.useRef(()=>{}),te=be=>{const gt=a.fragments.find(ot=>be>=ot.from-.5&&be<ot.to-.5);return gt?{x:gt.x-a.x,y:gt.y-a.y-gt.from+(gt.topPadding||0)}:{x:0,y:0}};ne.current=()=>{const be=U.current,gt=be?.querySelector(".card-question-document .rt-content");if(t||!be||!gt)return;const ot=F0(be.parentElement),Wt=H?ot(gt).top:0;Q(ue=>Math.abs(ue-Wt)<.5?ue:Wt);const yr=H?P.current.map(ue=>({top:Wt+ue.top,bottom:Wt+ue.bottom})):[];G.current.forEach(ue=>yr.push(...ue)),be.querySelectorAll(".card-choice-row, .exercise-flow-unit").forEach(ue=>{if(ue.offsetParent===null)return;const{top:he,height:$e}=ot(ue);yr.push({top:he,bottom:he+$e});const Ze=te(he);ue.style.translate=`${Ze.x}px ${Ze.y}px`}),be.querySelectorAll("[data-exercise-resize]").forEach(ue=>{const he=te(ot(ue).top);ue.style.translate=`${he.x}px ${he.y}px`});const ja=be.querySelector(".card-answer-space:not(.card-answer-fragment)");if(ja){const{top:ue,height:he}=ot(ja);K(Ze=>Math.abs(Ze-ue)<.5?Ze:ue);const $e=r.kind==="fill"?40:28;for(let Ze=ue;Ze<ue+he;Ze+=$e)yr.push({top:Ze,bottom:Math.min(Ze+$e,ue+he)})}const Aa=ot(be),Kr=be.querySelectorAll(".reference-character-row"),br=Kr.length?ot(Kr[0]).top:void 0,zt=Kr.length?ot(Kr[Kr.length-1]).top:void 0,zn=Math.min(...yr.map(ue=>ue.bottom)),Yt=[...new Set(yr.flatMap(ue=>[ue.top,ue.bottom]))].filter(ue=>ue>=zn&&ue<Aa.height&&!yr.some(he=>ue>he.top+.5&&ue<he.bottom-.5)).filter(ue=>zt===void 0||ue<=zt).sort((ue,he)=>ue-he),fe=Array.from(be.querySelectorAll("[data-marking-frame]")).map(ue=>{const{top:he,height:$e}=ot(ue);return{from:he,to:he+$e}});q.current({width:Aa.width,height:Aa.height,breaks:Yt,markingFrames:fe,...br!==void 0?{compositionStart:br}:{}})};const le=E.useCallback(be=>{P.current=be,ne.current()},[]),oe=E.useCallback((be,gt)=>{G.current.set(be,gt),ne.current()},[]),ae=E.useMemo(()=>a.fragments.map(be=>({from:be.from-B,to:be.to-B,x:be.x-a.x,y:be.y-a.y-be.from+(be.topPadding||0)})),[a.fragments,a.x,a.y,B]);E.useLayoutEffect(()=>{ne.current()},[a.fragments,r.answerHeight,r.choices,r.exercise,r.reference,m,H,t]);const xe=E.useRef(null),we=be=>{be.preventDefault(),be.stopPropagation(),be.currentTarget.focus(),xe.current={y:be.clientY,height:r.answerHeight},be.currentTarget.setPointerCapture(be.pointerId)},ge=be=>{xe.current&&T(Math.max(0,Math.min(800,Math.round(xe.current.height+(be.clientY-xe.current.y)/l))))},de=be=>{xe.current=null,be.currentTarget.releasePointerCapture(be.pointerId)},Me=()=>{xe.current&&T(xe.current.height),xe.current=null},Be=be=>{be.key==="Escape"&&xe.current&&Me(),(be.key==="ArrowUp"||be.key==="ArrowDown")&&(be.preventDefault(),T(Math.max(0,Math.min(800,r.answerHeight+(be.key==="ArrowDown"?10:-10)))))};E.useEffect(()=>{const be=U.current;let gt=0;const ot=new ResizeObserver(()=>{cancelAnimationFrame(gt),gt=requestAnimationFrame(()=>ne.current())});return ot.observe(be),()=>{ot.disconnect(),cancelAnimationFrame(gt)}},[]);const Ae=te(N+r.answerHeight-1),Se=`${Ae.x}px ${Ae.y}px`,Ce=a.fragments.length>1,Ot=r.reference&&I&&f.jsx(eO,{blockId:r.id,showQuestion:m,value:r.reference,concentrated:O.mergeObjective&&r.id!==gr?{...I.concentrated,questions:[]}:I.concentrated,placement:a,width:c,readOnly:d,activeId:p,onUnits:oe,onChange:R,onActiveFragment:v,uploadImage:C}),dt=r.reference&&(wt(r.reference.type)||r.id===gr);return f.jsx("article",{hidden:t,className:`card-question${u&&!d?" is-selected":""}${a.overflowing?" is-overflowing":""}${Ce?" is-fragmented":""}${r.reference?.type==="CCOMPOSITION"?" is-composition":""}`,"data-block-id":r.id,"data-page":a.page+1,"data-column":a.column+1,style:{left:a.x,top:a.y,width:c,minHeight:!Ce&&a.fragments[0]?.bottomPadding?a.height+a.fragments[0].bottomPadding:void 0,maxHeight:a.overflowing?a.available:void 0},onPointerDownCapture:()=>{d||b()},onFocusCapture:()=>{d||b()},"aria-label":r.title||`题块 ${i+1}`,children:f.jsxs("div",{className:"card-question-content",ref:U,children:[f.jsxs("div",{className:"card-question-heading",children:[f.jsx("h2",{children:d?r.title||`题块 ${i+1}`:f.jsx("button",{className:"card-question-title","aria-label":`设置题块 ${i+1}`,"aria-haspopup":"dialog",title:"打开题块设置",onClick:x,children:r.title||`题块 ${i+1}`})}),f.jsx("span",{children:String(i+1).padStart(2,"0")})]}),I&&!r.reference&&f.jsx(Q0,{settings:I.concentrated,activeQuestionId:p}),dt&&Ot,f.jsx("div",{className:"card-question-document",hidden:!H,children:f.jsx(Ll,{ref:$,initialValue:r.document,readOnly:d||!H,uploadImage:C,ariaLabel:`题块 ${i+1} 正文`,onChange:w,pagination:{slices:ae,maxUnitHeight:M.contentHeight-80,onMeasure:le,onActiveSliceChange:v},choiceFillPosition:I?.position,choiceFillBindings:I?.bindings,activeChoiceQuestionId:p,contentTargets:_,allowContentAssignment:r.reference?.textVersion!==1,onContentSelect:be=>{be!==r.id&&D(r.id,be)}})}),!dt&&Ot,!r.reference&&r.exercise&&r.kind!=="choice"&&r.kind!=="area"&&f.jsx(QR,{value:r.exercise,kind:r.kind,placement:a,showQuestion:m,readOnly:d,activeId:p,onUnits:oe,onChange:j,onActiveFragment:v,uploadImage:C}),!r.reference&&!r.exercise&&r.kind!=="choice"&&f.jsx("div",{className:`card-answer-space ${r.kind}${Ce?" is-paginated-space":""}`,style:{height:r.answerHeight},"data-answer-height":r.answerHeight,children:!d&&f.jsxs("div",{className:"card-answer-controls",children:[f.jsx("span",{className:"card-answer-caption",style:{translate:Se},children:r.kind==="writing"?"作文格":"作答区域"}),f.jsx("button",{className:"card-height-handle","aria-label":`调整题块 ${i+1} 作答高度`,title:"上下拖动调整作答区;方向键微调,Esc 取消",style:{translate:Se},onPointerDown:we,onPointerMove:ge,onPointerUp:de,onPointerCancel:Me,onLostPointerCapture:()=>{xe.current=null},onKeyDown:Be,children:f.jsx("span",{})})]})}),Ce&&!r.reference&&!r.exercise&&r.kind!=="choice"&&a.fragments.map((be,gt)=>{const ot=Math.max(be.from,N),Wt=Math.min(be.to,N+r.answerHeight);return Wt>ot&&f.jsx("div",{"aria-hidden":"true",className:`card-answer-space card-answer-fragment ${r.kind}`,style:{left:be.x-a.x,top:ot+be.y-a.y-be.from,width:c,height:Wt-ot,backgroundPositionY:`${N-ot-1}px`}},gt)})]})})}function eb({seat:t=!1}){return f.jsx("div",{className:"card-student-fields",children:["姓名","班级","学号",...t?["考场/座位号"]:[]].map(r=>f.jsxs("div",{children:[f.jsxs("span",{children:[r,":"]}),f.jsx("i",{})]},r))})}function Zd(){return f.jsxs("div",{className:"card-barcode-area","data-recognition":"StudentId","data-value":"barcode",children:[f.jsx("div",{children:"贴条形码区"}),f.jsx("small",{children:"正面朝上,切勿贴出虚线方框"})]})}function Pl(){return f.jsxs("div",{className:"card-header-marks",children:[f.jsxs("div",{children:["正确填涂:",f.jsx("i",{className:"filled"})]}),f.jsxs("div",{"data-recognition":"IgnoreFlag",children:["缺考标记:",f.jsx("i",{"data-recognition-cell":"absent"})]})]})}function tb({marks:t,focusText:r}){return f.jsxs("div",{className:"card-attentions",children:[r&&f.jsxs("div",{className:"card-attention-box",children:[f.jsx("div",{children:"注意事项"}),f.jsxs("section",{children:[f.jsx("p",{children:"1.答题前请将姓名、班级和准考证号(或学号)填写清楚并填涂完整。"}),f.jsx("p",{children:"2.客观题答题必须使用2B铅笔填涂,修改时用橡皮擦干净。主观题答题必须使用黑色签字笔书写。"}),f.jsx("p",{children:"3.请在规定区域内答题,超出答题区域书写无效。"})]})]}),t&&f.jsx(Pl,{})]})}function nO({settings:t,columns:r,pointBlack:i}){const a=t.kaohao==="school"&&t.weishu>9,c=!t.mifeng&&r===3||a,l=r!==3&&t.focusText&&t.missExam&&!t.mifeng&&t.kaohao==="code",u=r===3&&t.missExam&&!t.mifeng&&t.kaohao==="code",d=r===3&&t.missExam&&!t.mifeng&&t.kaohao==="school"&&[8,9].includes(t.weishu),m=r===3&&t.focusText&&t.missExam&&t.mifeng&&t.kaohao==="school"&&[8,9].includes(t.weishu),p=r!==3&&t.missExam&&!t.mifeng&&a,C=t.missExam&&!l&&!u&&!d&&!m&&!p,g=t.focusText||C;return f.jsxs("div",{className:"card-header-fields",children:[f.jsxs("div",{className:`card-header-left${t.mifeng&&(t.kaohao==="code"||a)?" full-width":""}`,children:[!t.mifeng&&f.jsx(eb,{seat:t.writeKaohao}),(d||p)&&f.jsx(Pl,{}),!c&&g&&f.jsx(tb,{focusText:t.focusText,marks:C})]}),f.jsxs("div",{className:"card-header-number",children:[t.kaohao==="school"&&f.jsxs("div",{className:`card-exam-number${i&&t.weishu>=8?" with-reference-points":""}`,"data-recognition":"StudentId","data-value":String(t.weishu),"aria-label":`${t.weishu}位准考证号码`,children:[f.jsx("div",{className:"card-exam-number-heading",children:"准考证号码"}),f.jsx("div",{className:"card-exam-number-columns",children:Array.from({length:t.weishu},(b,v)=>f.jsxs("div",{className:"card-exam-number-column",children:[f.jsx("div",{className:"card-exam-number-input"}),Array.from({length:10},(x,S)=>f.jsxs("div",{className:"card-exam-number-digit","data-recognition-cell":`${v+1}:${S}`,children:["[",f.jsx("span",{children:S}),"]",i&&v===7&&(S===0||S===9)&&f.jsx("i",{className:`card-reference-point ${S===0?"top":"bottom"}`,"data-recognition":"ReferencePoint"})]},S))]},v))})]}),t.kaohao==="code"&&!t.mifeng&&f.jsx(Zd,{}),(l||u)&&f.jsx(Pl,{})]}),m&&f.jsx(Pl,{}),c&&g&&f.jsx(tb,{focusText:t.focusText,marks:C})]})}function rO({settings:t,back:r}){return f.jsxs("div",{className:`card-seal-line${r?" back":""}`,children:[f.jsx("span",{className:"card-seal-label",children:"密封线"}),!r&&f.jsxs("div",{className:`card-seal-details${t.kaohao==="code"?" with-barcode":""}`,children:[f.jsx(eb,{seat:t.writeKaohao}),t.kaohao==="code"&&f.jsx(Zd,{})]})]})}function nb({kind:t}){const r=t==="ClassId"?"班级":"学号";return f.jsxs("div",{className:"card-homework-id","data-recognition":t,"data-value":"2","aria-label":`${r}填涂区`,children:[f.jsxs("span",{className:"card-homework-id-label",children:[r,f.jsx("br",{}),"填涂:"]}),f.jsx("div",{className:"card-homework-digits",children:["十位","个位"].map((i,a)=>f.jsxs("div",{className:"card-homework-digit-row",children:[f.jsx("span",{className:"card-homework-place",children:i}),Array.from({length:10},(c,l)=>f.jsx("span",{className:"card-homework-digit",children:f.jsxs("i",{"data-recognition-cell":`${a+1}:${9-l}`,children:["[",f.jsx("span",{children:9-l}),"]"]})},l))]},i))})]})}function oO({settings:t,columns:r}){return f.jsxs("div",{className:`card-homework-header${r===3?" three":""}`,children:[f.jsx("div",{className:"card-homework-student",children:["姓名","班级","学号"].map(i=>f.jsxs("div",{children:[i,":",f.jsx("i",{})]},i))}),t.tiaomaStyle===2?f.jsx(Zd,{}):f.jsxs("div",{className:"card-homework-number",children:[t.classText!==!1&&f.jsx(nb,{kind:"ClassId"}),f.jsx(nb,{kind:"StudentId"})]})]})}function aO({title:t,page:r=0}){const{card:i,setCard:a,readOnly:c,geometry:l,scale:u,setTitleMeasurement:d,uploadImage:m,registerEditor:p}=mt(),C=E.useRef(null),g=E.useRef(null),b=E.useRef(null);E.useEffect(()=>{const w=`title/${t.id}/${r}`;return p(w,b.current),()=>p(w,null)},[t.id,r,p]);const v=E.useRef(null),x=E.useCallback(()=>{const w=C.current,T=g.current;if(!w||!T||r!==0)return;const j={id:t.id,width:w.offsetWidth,height:w.offsetHeight,overflowing:w.scrollHeight>w.clientHeight+1||T.scrollHeight>T.clientHeight+1};d(R=>R?.id===j.id&&R.width===j.width&&R.height===j.height&&R.overflowing===j.overflowing?R:j)},[t.id,r,d]);E.useLayoutEffect(()=>{const w=new ResizeObserver(x);return w.observe(C.current),w.observe(g.current),x(),()=>w.disconnect()},[x]),E.useEffect(()=>{b.current?.getDocument()&&JSON.stringify(b.current.getDocument())!==JSON.stringify(t.document)&&b.current.setDocument(t.document)},[t.document]);const S=w=>a(T=>T.paperTitle?.id===t.id?{...T,paperTitle:{...T.paperTitle,height:Math.max(24,Math.min(90,Math.round(w)))}}:T);return f.jsxs("div",{ref:C,className:"card-paper-header","data-header-page":r+1,style:{top:r*(l.height+Co)+l.topInset,left:l.columnX(r,0),width:l.titleWidth,maxHeight:l.contentHeight,paddingBottom:i.header?10:gi},children:[f.jsxs("div",{className:"card-paper-title",style:{height:t.height},children:[f.jsx("div",{ref:g,className:"card-paper-title-body",children:f.jsx(Ll,{ref:b,initialValue:t.document,readOnly:c,uploadImage:m,ariaLabel:r?`第 ${r+1} 面纸面标题`:"纸面标题",onLayout:x,onChange:w=>a(T=>T.paperTitle?.id===t.id&&JSON.stringify(T.paperTitle.document)!==JSON.stringify(w)?{...T,paperTitle:{...T.paperTitle,document:w}}:T)})}),!c&&f.jsx("button",{className:"card-title-height-handle","aria-label":"调整标题高度",title:"调整输入框高度",onPointerDown:w=>{w.button===0&&(w.preventDefault(),w.stopPropagation(),v.current={y:w.clientY,height:t.height},w.currentTarget.setPointerCapture(w.pointerId))},onPointerMove:w=>{v.current&&S(v.current.height+(w.clientY-v.current.y)/u)},onPointerUp:w=>{v.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId)},onPointerCancel:()=>{v.current&&S(v.current.height),v.current=null},onLostPointerCapture:()=>{v.current=null},onKeyDown:w=>{w.key==="Escape"&&v.current&&(S(v.current.height),v.current=null),(w.key==="ArrowUp"||w.key==="ArrowDown")&&(w.preventDefault(),S(t.height+(w.key==="ArrowDown"?2:-2)))},children:f.jsx("span",{children:"↕"})})]}),i.header&&(i.usage==="homework"?f.jsx(oO,{settings:i.header,columns:l.columns}):f.jsx(nO,{settings:i.header,columns:l.columns,pointBlack:i.recognition?.pointBlack}))]})}function iO({value:t,left:r,top:i}){const a=E.useMemo(()=>{try{return _m(t)}catch{return null}},[t]);return a&&f.jsxs("svg",{className:"card-exam-qr","data-recognition":"ExamQrCode","data-value":t,"aria-label":"试卷二维码",style:{left:r,top:i},width:"40",height:"40",viewBox:`0 0 ${a.count} ${a.count}`,shapeRendering:"crispEdges",children:[f.jsx("rect",{width:a.count,height:a.count,fill:"white"}),f.jsx("path",{d:a.path,fill:"black"})]})}const sO=["topLeft","topRight","bottomLeft","bottomRight"];function lO({card:t,geometry:r,page:i,pageCount:a}){const c=r.columnX(i,0),l=r.columnX(i,r.columns-1)+r.columnWidth,u=r.topInset-31,d=r.height-r.bottomInset+16,m=NS(i+1),p=jm(t.creation),C=p&&yu[p],g=t.recognition?.examQrCode&&t.creation?.exampaperId!==void 0&&i%2===0,b=v=>({left:v%2?l-(v<2?26:13):c,top:v<2?u:d,width:v<2?26:13,height:v<2?13:26});return f.jsxs(E.Fragment,{children:[sO.map((v,x)=>f.jsx("div",{className:"card-registration-mark","data-anchor":v,style:b(x)},v)),a>1&&m&&f.jsx("div",{className:"card-code-marks","data-recognition":"PageCode","data-value":String(i+1),"aria-label":`纸面识别 ${i+1}`,style:{left:c+Math.max(30,r.columnWidth-180),top:d-14},children:[...m].map((v,x)=>f.jsx("i",{"data-value":v,"data-recognition-cell":String(x+1),className:v==="1"?"is-filled":""},x))}),i%2===0&&t.recognition?.subjectMarkers!==!1&&C&&f.jsx("div",{className:"card-code-marks","data-recognition":"SubjectCode","data-value":p,"aria-label":"学科识别标记",style:{left:r.columnX(i,r.columns>1?1:0)+Math.min(100,Math.max(30,r.columnWidth-140)),top:d-14},children:[1,2,3,4].map(v=>f.jsx("i",{"data-value":C.includes(v)?"1":"0","data-recognition-cell":String(v),className:C.includes(v)?"is-filled":""},v))}),g&&f.jsx(iO,{value:String(t.creation.exampaperId),left:r.columns===1?c+(r.columnWidth-40)/2:c+r.columnWidth-40,top:r.topInset-56})]})}function cO({block:t,index:r,placement:i,onMeasure:a,onActiveFragment:c}){const{geometry:l,readOnly:u,selectedId:d,setSelectedId:m,updateBlock:p,registerEditor:C,uploadImage:g}=mt(),b=E.useRef(null),[v,x]=E.useState([]),S=E.useRef(null),w=E.useCallback(M=>{S.current=M,C(t.id,M)},[t.id,C]);E.useEffect(()=>{JSON.stringify(S.current?.getDocument())!==JSON.stringify(t.document)&&S.current?.syncDocument(t.document)},[t.document]);const T=Math.max(t.answerHeight,(v.at(-1)?.bottom||0)+12),j=E.useRef(a);j.current=a,E.useLayoutEffect(()=>{const M=(v.at(-1)?.bottom||0)+6,D=[...v.map(_=>_.bottom+6),...Array.from({length:Math.max(0,Math.floor((T-M)/40))},(_,I)=>M+(I+1)*40)];j.current({width:l.columnWidth,height:T,breaks:t.areaType==="forbiden"?[]:D})},[l.columnWidth,T,v,t.areaType]);const R=E.useMemo(()=>i.fragments.map(M=>({from:M.from-6,to:M.to-6,x:M.x-i.x,y:M.y-i.y-M.from})),[i]),O=i.fragments.at(-1);return f.jsxs("article",{className:`card-question card-area-block${d===t.id&&!u?" is-selected":""}${i.overflowing?" is-overflowing":""}${i.fragments.length>1?" is-fragmented":""}`,"data-block-id":t.id,"data-page":i.page+1,"data-column":i.column+1,"data-area-type":t.areaType,"aria-label":t.title,style:{left:i.x,top:i.y,width:l.columnWidth,height:T+(i.fragments.length===1&&O.bottomPadding||0),maxHeight:i.overflowing?i.available:void 0},onPointerDownCapture:()=>{u||m(t.id)},children:[i.fragments.map((M,D)=>f.jsx("div",{className:"card-area-border","data-recognition":t.areaType==="forbiden"?"Blank":"FrameOnly","data-answer-id":t.id,"data-fragment":D,style:{left:M.x-i.x,top:M.y-i.y,height:M.to-M.from+(M.bottomPadding||0),width:l.columnWidth}},D)),f.jsx("div",{className:"card-area-text",ref:b,children:f.jsx(Ll,{ref:w,initialValue:t.document,readOnly:u,ariaLabel:`题块 ${r+1} 区域文字`,uploadImage:g,onChange:M=>p(t.id,{document:M}),pagination:{slices:R,maxUnitHeight:l.contentHeight-12,onMeasure:x,onActiveSliceChange:c}})}),!u&&f.jsx("div",{className:"card-area-resize",style:{left:O.x-i.x,top:O.y-i.y+O.to-O.from+(O.bottomPadding||0)-12,width:l.columnWidth},children:f.jsx(J0,{height:t.answerHeight,min:100,label:"调整区域高度",onChange:M=>p(t.id,{answerHeight:Math.min(t.areaType==="forbiden"?l.contentHeight:4e3,M)})})})]})}function uO(){const{card:t,paperRoot:r,paperBlocks:i,selectedId:a,setSelectedId:c,selectedChoiceId:l,selectChoice:u,settingsId:d,openSettings:m,registerEditor:p,editingQuestionId:C,setMeasurements:g,readOnly:b,scale:v,geometry:x,pageCount:S,totalHeight:w,placementById:T,updateBlock:j,uploadImage:R}=mt(),O=E.useRef(null),[M,D]=E.useState(null),_=(q,P)=>D(G=>G?.id===q&&G.index===P?G:{id:q,index:P}),I=q=>{const P=q instanceof Element?q.closest("[data-block-id], [data-block-fragment]"):null;return P?.dataset.blockId||P?.dataset.blockFragment},z=t.blocks.find(q=>q.id===d),H=z&&l(z),L=i.find(q=>q.id===gr),$=L?.reference&&H&&qs(L.reference).some(q=>q.id===H)?z:t.blocks.find(q=>q.reference?.questions.some(P=>wt(P.type))),Y=L?[L,...t.blocks.map(q=>i.find(P=>P.id===q.id)||q)]:i,U=q=>q===gr&&$?.id||q;return f.jsxs("div",{ref:r,className:"card-sheet-stack",style:{width:x.width,height:w},onPointerDownCapture:q=>{const P=I(q.target);O.current=!b&&q.button===0&&P?{id:P,x:q.clientX,y:q.clientY}:null},onPointerCancelCapture:()=>{O.current=null},onClickCapture:q=>{const P=O.current;if(O.current=null,!b&&q.button===0&&P&&I(q.target)===P.id&&Math.hypot(q.clientX-P.x,q.clientY-P.y)<5){const G=q.target instanceof Element?q.target.closest("[data-question-id], [data-fill-question-id], [data-exercise-id], [data-exercise-item], [data-answer-id], [data-content-id]"):null,B=G?.dataset.answerId||G?.dataset.questionId||G?.dataset.fillQuestionId||G?.dataset.exerciseId||G?.dataset.exerciseItem||G?.dataset.contentId,Q=t.blocks.find(N=>B&&N.reference&&qs(N.reference).some(K=>K.id===B))||t.blocks.find(N=>N.id===U(P.id));B&&(Q?.reference?qs(Q.reference):Q?.choices?.questions||Q?.exercise?.items)?.some(N=>N.id===B)&&u(Q.id,B),m(Q?.id||U(P.id),!1)}},children:[Array.from({length:S},(q,P)=>f.jsxs("div",{className:"card-sheet","data-paper-page":P+1,style:{top:P*(x.height+Co),width:x.width,height:x.height},children:[t.header&&f.jsx(lO,{card:t,geometry:x,page:P,pageCount:S}),t.header&&!b&&Array.from({length:x.columns},(G,B)=>f.jsx("div",{className:"card-column-guide",style:{left:x.columnX(P,B),width:x.columnWidth,top:x.topInset,bottom:x.bottomInset}},B)),t.usage!=="homework"&&t.header?.mifeng&&f.jsx("div",{className:"card-seal",style:{left:P%2===0?x.margin:x.width-x.margin-x.sealWidth,width:x.sealWidth},children:f.jsx(rO,{settings:t.header,back:P%2!==0})}),t.header&&Array.from({length:x.columns},(G,B)=>f.jsx("div",{className:"card-paper-footer",style:{left:x.columnX(P,B),width:x.columnWidth,bottom:20},children:f.jsxs("span",{children:["第",P*x.columns+B+1,"页   共",S*x.columns,"页"]})},B))]},P)),t.paperTitle&&Array.from({length:S},(q,P)=>x.hasHeader(P)&&f.jsx(aO,{title:t.paperTitle,page:P},`${t.paperTitle.id}/${P}`)),i.flatMap(q=>{const P=T.get(q.id).fragments,G=M?.id===q.id?Math.min(M.index,P.length-1):0;return P.length>1?P.map((B,Q)=>f.jsx("div",{className:`card-fragment-frame${a===U(q.id)&&!b&&Q===G?" is-selected":""}`,"data-block-fragment":q.id,"data-page":B.page+1,"data-column":B.column+1,style:{left:B.x,top:B.y,width:x.columnWidth,height:B.to-B.from+(B.topPadding||0)+(B.bottomPadding||0)},onPointerDown:()=>{b||(_(q.id,Q),c(U(q.id)))}},`${q.id}/${Q}`)):[]}),Y.map((q,P)=>{const G=B=>g(Q=>{const N=Q[q.id];return N&&N.compositionStart===B.compositionStart&&JSON.stringify(N.markingFrames)===JSON.stringify(B.markingFrames)&&Math.abs(N.width-B.width)<.5&&Math.abs(N.height-B.height)<.5&&JSON.stringify(N.breaks)===JSON.stringify(B.breaks)?Q:{...Q,[q.id]:B}});return q.kind==="area"?f.jsx(cO,{block:q,index:P,placement:T.get(q.id),onMeasure:G,onActiveFragment:B=>_(q.id,B)},q.id):f.jsx(tO,{hidden:!i.some(B=>B.id===q.id),block:q,index:P,placement:T.get(q.id),width:x.columnWidth,scale:v,selected:a===U(q.id),readOnly:b,activeChoiceId:!b&&d===U(q.id)?l(t.blocks.find(B=>B.id===U(q.id))||q):void 0,showQuestion:t.questionCard!==!1||!b&&C===q.id,registerEditor:p,uploadImage:R,onSelect:()=>c(U(q.id)),onActiveFragment:B=>_(q.id,B),onSettings:()=>{_(q.id,0),m(U(q.id))},onDocument:B=>j(q.id,{document:B}),onHeight:B=>j(q.id,{answerHeight:B}),onExercise:B=>j(q.id,{exercise:B}),onReference:B=>{q.id!==gr&&j(q.id,{reference:B})},onMeasure:G},q.id)})]})}const dO=()=>{const{navigatorVisible:t}=Io(),{geometry:r,totalHeight:i,readOnly:a,pageCount:c,card:l,setSelectedId:u}=mt();return f.jsxs("div",{className:`${uA["portal-wrapper"]} card-workspace`,id:"uni-answer-sheet","data-mode":a?"preview":"edit",children:[f.jsx(pR,{width:r.width,height:i,onBackgroundClick:()=>u(null),children:f.jsx(uO,{})}),f.jsx(qR,{}),f.jsx(fR,{summary:`${c} 页 · ${l.blocks.length} 个题块`}),t&&f.jsx(gR,{})]})},Lo=t=>structuredClone(t),rb=t=>{const r=Lo(t);return delete r.recognitionData,r};function ob(){return new Promise(t=>{const r=()=>{clearTimeout(a),cancelAnimationFrame(i),t()},i=requestAnimationFrame(r),a=setTimeout(r,50)})}function fO(t,r,i,a,c){i.initialValue&&bu(i.initialValue,r);let l=i,u=i.initialValue&&rb(i.initialValue),d=0,m,p,C=!1,g;const b=ZS.createRoot(t,{onUncaughtError:c});function v({readOnly:D}){const _=mt();return E.useLayoutEffect(()=>{m=_,a()}),E.useEffect(()=>{_.setReadOnly(!!D)},[D]),E.useEffect(()=>{if(p===_.card)return;const I=!p;p=_.card,I||l.onChange?.(Lo(_.card))},[_.card]),null}const x=()=>{if(C||!m)throw new Error("制卡实例尚未就绪或已经销毁");return m},S=(D,_,I)=>({code:D,path:"",message:_,...I}),w=async()=>{const D=Date.now()+8e3;let _="",I=0,z="LAYOUT_PENDING";for(;Date.now()<D;){await ob();const H=x();if(!t.isConnected||t.clientWidth<100||t.clientHeight<100)return{value:H,issues:[S("LAYOUT_UNAVAILABLE","请显示制卡容器并为其设置有效的宽高后再保存")]};const L=[...new Set(H.editors.current.values())].map(G=>G.getStatus());z=L.some(G=>G.composing||G.uploading)?"EDITOR_BUSY":"LAYOUT_PENDING";const $=L.every(G=>G.ready&&!G.composing&&!G.uploading&&!G.layoutPending);if($&&H.editingQuestionId&&!H.card.questionCard){H.finishQuestionEditing(),I=0;continue}const Y=H.paperBlocks.every(G=>{const B=H.measurements[G.id];return B&&Math.abs(B.width-H.geometry.columnWidth)<1&&B.height>0})&&(!H.card.paperTitle||H.titleMeasurement?.id===H.card.paperTitle.id&&Math.abs(H.titleMeasurement.width-H.geometry.titleWidth)<1),U=Array.from(t.querySelectorAll("img[src], img[srcset]")).filter(G=>G.getClientRects().length),q=U.every(G=>G.complete),P=JSON.stringify([H.card,H.measurements,H.titleMeasurement,H.placements]);if($&&Y&&q&&document.fonts.status==="loaded"&&P===_?I++:I=0,_=P,I>=4){const G=[];return L.forEach(B=>{B.uploadError&&G.push(S("IMAGE_UPLOAD_FAILED",B.uploadError))}),U.some(B=>!B.naturalWidth)&&G.push(S("IMAGE_LOAD_FAILED","有图片加载失败,请检查图片地址")),H.titleOverflow&&G.push(S("TITLE_OVERFLOW","纸面标题超出可用区域",{path:"paperTitle"})),H.overflow.forEach(B=>G.push(S("CONTENT_OVERFLOW","题块中存在无法放入一栏的内容,请调整尺寸或版式",{path:"blocks",blockId:B.id}))),t.querySelectorAll(".rt-content").forEach(B=>{if(!B.getClientRects().length||B.closest("[hidden]"))return;const Q=B.closest("[data-block-id]")?.dataset.blockId,N=Q&&H.placementById.get(Q);(!N||N.fragments.length===1)&&B.scrollWidth>B.clientWidth+2&&G.push(S("CONTENT_OVERFLOW","内容超过输入区域宽度",{path:"blocks",...Q?{blockId:Q}:{}}))}),{value:H,issues:G}}}return{value:x(),issues:[S(z,z==="EDITOR_BUSY"?"输入法输入或图片上传尚未结束,请完成后再保存":"字体、图片或分页尚未稳定,请稍后重试")]}},T=async()=>{try{const{issues:D,value:_}=await w(),z=[...PS(_.card,r).issues,...D];let H;if(!z.length)try{H=_.getRecognitionData()}catch(L){z.push(S(L instanceof Xr?L.code:"RECOGNITION_FAILED",L instanceof Error?L.message:"识别坐标生成失败"))}return{value:_,recognitionData:H,result:{valid:z.length===0,issues:z}}}catch(D){if(C)throw D;return{value:x(),result:{valid:!1,issues:[S("EDITOR_ERROR",D instanceof Error?D.message:"编辑器或数据校验失败")]}}}},j=async()=>(await T()).result,R=()=>g||(g=(async()=>{const{result:D,value:_,recognitionData:I}=await T();if(x(),!D.valid)return{ok:!1,issues:D.issues};try{return{ok:!0,data:Lo({..._.card,..._.getReferenceData(),recognitionData:I})}}catch(z){return{ok:!1,issues:[S("EXPORT_FAILED",z instanceof Error?z.message:"题卡数据转换失败")]}}})().finally(()=>{g=void 0})),O=()=>b.render(f.jsx(cA,{children:f.jsxs(RR,{editorPlugin:r,uploadImage:l.uploadImage,dictionaries:l.dictionaries,initialValue:u,onSave:()=>{x().setSaveMessage("正在校验…"),R().then(D=>{x().setSaveMessage(D.ok?"已生成保存数据":D.issues[0].message),l.onSave?.(D)}).catch(D=>{C||x().setSaveMessage("保存失败"),l.onError?.(D)})},children:[f.jsx(v,{readOnly:l.readOnly}),f.jsx(dO,{})]},d)}));O();const M=async D=>{bu(D,r);const _=rb(D);x(),u=_;const I=++d;Hr.flushSync(O);const z=Date.now()+8e3;do{await ob();const H=x();if(I!==d)throw new DOMException("回显已被另一张题卡替换","AbortError");if([...H.editors.current.values()].every(L=>L.getStatus().ready))return}while(Date.now()<z);throw new Error("题卡数据已载入,但编辑器未能及时就绪")};return{isReady:()=>!!m&&!C,getDocument:()=>Lo(x().card),setDocument:M,newDocument:D=>M(uu(D)),getReferenceData:()=>Lo(x().getReferenceData()),setReferenceData:D=>M({...x().card,blocks:G0(Lo(D),r.html)}),validate:j,save:R,async getRecognitionData(){const D=await T();if(!D.result.valid)throw new ca(D.result.issues);return Lo(D.recognitionData)},focusIssue:D=>{D.blockId&&(x().selectBlock(D.blockId,!0),x().openSettings(D.blockId,!1))},update(D){l=D,O()},destroy(){C||(C=!0,b.unmount(),m=void 0)}}}const hO=Object.freeze(Object.defineProperty({__proto__:null,mountAnswerSheet:fO},Symbol.toStringTag,{value:"Module"}));return nt.AnswerSheetDataError=ca,nt.createAnswerSheet=$S,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"}),nt})({});
202
+ `)})})})]})]})}function eb({value:t,onChange:r,onRemove:i,category:a=!1}){const{uploadImage:c}=ct(),[l,u]=E.useState(t[0]?.id),d=t.find(g=>g.id===l)||t[0],m=t.indexOf(d),p=a?"类别":"共享选项",C=g=>{const b=g&&d?Ao(d):{id:crypto.randomUUID(),label:"",text:""},x=new Set(t.map(S=>S.label));b.label=Array.from({length:26},(S,w)=>String.fromCharCode(65+w)).find(S=>!x.has(S))||Ur(t);const v=[...t];v.splice(m+1,0,b),r(v),u(b.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs",children:t.map(g=>f.jsx(ue,{size:"small","aria-pressed":g.id===d?.id,onClick:()=>u(g.id),children:g.label},g.id))}),f.jsx(Xl,{name:p,maximum:26,index:m,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(ua(t,d.id,g)),onDelete:()=>i(d.id)}),d&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:`${p}编号`,value:d.label,onChange:g=>r(t.map(b=>b.id===d.id?{...b,label:g}:b))}),f.jsx(dn,{label:`${p}内容`,value:d.text,onChange:g=>r(t.map(b=>b.id===d.id?{...b,text:g}:b))})]}),d&&!a&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项图文/公式"}),f.jsx(Xi,{value:d.document||Vt(),ariaLabel:`共享选项 ${d.label} 图文内容`,uploadImage:c,onChange:g=>r(t.map(b=>b.id===d.id?{...b,document:g}:b))},d.id)]})]})}function PR({value:t,kind:r,item:i,onChange:a}){const c=l=>a({...t,...l});return f.jsxs("div",{children:[f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:r==="ordering"?"待排序/分类项目":"共享选项池"}),f.jsx(eb,{value:t.pool,onChange:l=>c({pool:l,sequence:[...t.sequence.filter(u=>l.some(d=>d.id===u)),...l.filter(u=>!t.sequence.includes(u.id)).map(u=>u.id)]}),onRemove:l=>a(mS(t,l))})]}),r==="matching"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"匹配呈现",value:t.matchingDisplay,options:{letters:"字母填答",lines:"左右连线"},onChange:l=>c({matchingDisplay:l})}),f.jsx(ot,{label:"对应关系",value:t.relation,options:{one:"一对一",many:"一对多"},onChange:l=>c({relation:l,items:t.items.map(u=>({...u,targets:l==="one"?u.targets.slice(0,1):u.targets}))})})]}),f.jsx(zt,{checked:t.reuseOptions,onChange:l=>{const u=new Set;c({reuseOptions:l.target.checked,items:t.items.map(d=>({...d,targets:d.targets.filter(m=>l.target.checked?!0:u.has(m)?!1:(u.add(m),!0))}))})},children:"允许选项重复使用"}),i&&f.jsx(Jt,{label:"当前题匹配答案",children:f.jsx("div",{className:"exercise-tabs",children:t.pool.map(l=>f.jsx(ue,{size:"small","aria-pressed":i.targets.includes(l.id),onClick:()=>a(pS(t,i.id,i.targets.includes(l.id)?i.targets.filter(u=>u!==l.id):[...i.targets,l.id])),children:l.label},l.id))})})]}),r==="ordering"&&f.jsxs("div",{children:[f.jsx(ot,{label:"排序或分类",value:t.ordering,options:{sequence:"排序",category:"分类"},onChange:l=>c({ordering:l})}),t.ordering==="sequence"?f.jsx("div",{className:"exercise-fields",children:t.sequence.map((l,u)=>f.jsx(ot,{label:`第 ${u+1} 位答案`,value:l,options:Object.fromEntries(t.pool.map(d=>[d.id,`${d.label}. ${d.text}`])),onChange:d=>{const m=[...t.sequence],p=m.indexOf(d);p>=0&&(m[p]=l),m[u]=d,c({sequence:m})}},u))}):f.jsxs("div",{children:[f.jsx(eb,{category:!0,value:t.categories,onChange:l=>c({categories:l}),onRemove:l=>c({categories:t.categories.filter(u=>u.id!==l),assignments:Object.fromEntries(Object.entries(t.assignments).filter(([,u])=>u!==l))})}),t.pool.map(l=>f.jsx(ot,{label:`${l.label} 所属类别`,value:t.assignments[l.id]||"",options:{"":"未设置",...Object.fromEntries(t.categories.map(u=>[u.id,`${u.label}. ${u.text}`]))},onChange:u=>c({assignments:{...t.assignments,[l.id]:u}})},l.id))]})]})]})}function UR({value:t,onChange:r}){const[i,a]=E.useState(0),c=l=>r({...t,...l});return f.jsxs("div",{children:[f.jsx(Jt,{label:"待断句原文",children:f.jsx(Pl,{"aria-label":"待断句原文",value:t.chunkText,autoSize:{minRows:3,maxRows:8},onSelect:l=>a(l.currentTarget.selectionStart),onChange:l=>r(gS(t,l.target.value))})}),f.jsx(ue,{size:"small",disabled:i<=0||i>=t.chunkText.length||t.chunkPoints.length>=26||t.chunkPoints.some(l=>l.offset===i),onClick:()=>{const l=new Set(t.chunkPoints.map(d=>d.label)),u=Array.from({length:26},(d,m)=>String.fromCharCode(65+m)).find(d=>!l.has(d));c({chunkPoints:[...t.chunkPoints,{id:crypto.randomUUID(),offset:i,label:u}].sort((d,m)=>d.offset-m.offset)})},children:"在光标处添加断点"}),f.jsx("div",{className:"exercise-chunk-points",children:t.chunkPoints.map(l=>f.jsxs("div",{children:[f.jsxs(zt,{checked:t.chunkCorrect.includes(l.id),onChange:u=>c({chunkCorrect:u.target.checked?[...t.chunkCorrect,l.id]:t.chunkCorrect.filter(d=>d!==l.id)}),children:[l.label," · ",t.chunkText.slice(Math.max(0,l.offset-4),l.offset),"|",t.chunkText.slice(l.offset,l.offset+4)]}),f.jsx(ue,{size:"small",type:"text","aria-label":`删除断点 ${l.label}`,onClick:()=>c({chunkPoints:t.chunkPoints.filter(u=>u.id!==l.id),chunkCorrect:t.chunkCorrect.filter(u=>u!==l.id)}),children:"删除"})]},l.id))}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ft,{label:"最多选择断点数",value:t.chunkMax,min:1,max:26,onChange:l=>c({chunkMax:l})}),f.jsx(rn,{label:"断句满分",value:t.groupScore,max:10,onChange:l=>c({groupScore:l})}),f.jsx(rn,{label:"每个正确断点分值",value:t.chunkScore,max:10,onChange:l=>c({chunkScore:l})})]})]})}function $R({value:t,kind:r,blockId:i,selectedId:a,onSelect:c,onChange:l}){const{card:u,uploadImage:d,insertMaterialBlank:m,geometry:p}=ct(),C=E.useRef([]),g=E.useRef([]),[,b]=E.useState(0),[x,v]=E.useState(1),[S,w]=E.useState(1),[T,j]=E.useState(null),R=t.items.find(G=>G.id===a)||t.items[0],O=t.items.indexOf(R),M=(G,te=R?.id)=>{JSON.stringify(t)!==JSON.stringify(G)&&(C.current.push({value:t,id:R?.id}),C.current=C.current.slice(-50),g.current=[],l(G),te&&c(te),b(V=>V+1))},D=G=>M({...t,...G}),_=G=>D({items:t.items.map(te=>te.id===R.id?{...te,...G}:te)}),I=G=>l({...t,items:t.items.map(te=>te.id===R.id?{...te,...G}:te)}),B=G=>{const te=G&&R?hS(R,Ur(t.items)):gu(R?.kind||yu(r),Ur(t.items)),V=[...t.items];V.splice(O+1,0,te),M({...t,items:V},te.id)},H=G=>{const te=G?g.current:C.current,V=G?C.current:g.current,Y=te.pop();if(!Y)return;V.push({value:t,id:R?.id});const L=Y.value.items.map(P=>{const N=t.items.find(U=>U.id===P.id);return N?{...P,document:N.document,reference:N.reference,explanation:N.explanation}:P});l({...Y.value,items:L}),Y.id&&c(Y.id),b(P=>P+1)},z=Cm.includes(r),$=R&&["answer","calculation","correction","drawing","writing","english"].includes(R.kind),X=yS(t,r);return f.jsxs("div",{className:"exercise-panel",children:[r!=="chunk"&&f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择当前小题",children:t.items.map(G=>f.jsx(ue,{size:"small","aria-pressed":R?.id===G.id,onClick:()=>c(G.id),children:G.label},G.id))}),f.jsx(Xl,{index:O,count:t.items.length,maximum:Em(r),onAdd:()=>B(!1),onCopy:()=>B(!0),onMove:G=>D({items:ua(t.items,R.id,G)}),onDelete:()=>{const G=t.items.filter(te=>te.id!==R.id);M({...t,items:G,chooseCount:Math.min(t.chooseCount,Math.max(1,G.length))},G[Math.max(0,O-1)]?.id)}}),f.jsxs("details",{children:[f.jsx("summary",{children:"批量配置"}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ft,{label:"追加题数",value:x,min:1,max:50,onChange:v}),f.jsx(ft,{label:"起始题号",value:S,min:1,max:1e3,onChange:w}),f.jsx(rn,{label:"统一题分",value:T,max:Math.min(70,...t.items.map(G=>Fs(G.kind))),onChange:j})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:t.items.length+x>Em(r),onClick:()=>{const G=[...t.items],te=[];for(let V=0;V<x;V++)te.push(gu(R?.kind||yu(r),Ur([...G,...te])));G.splice(O+1,0,...te),M({...t,items:G},te[0].id)},children:"追加空白题"}),f.jsx(ue,{size:"small",onClick:()=>D({items:t.items.map((G,te)=>({...G,label:String(S+te),choice:{...G.choice,label:String(S+te)}}))}),children:"连续编号"}),f.jsx(ue,{size:"small",disabled:T!==null&&t.items.some(G=>T>Fs(G.kind)),onClick:()=>D({items:t.items.map(G=>({...G,score:T,choice:{...G.choice,score:T}}))}),children:"统一分值"})]})]})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!C.current.length,onClick:()=>H(!1),children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!g.current.length,onClick:()=>H(!0),children:"重做题型配置"})]}),r==="chunk"&&f.jsx(UR,{value:t,onChange:M}),r==="optional"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ft,{label:"选做题数",value:t.chooseCount,min:1,max:Math.max(1,t.items.length),onChange:G=>D({chooseCount:G})}),f.jsx(rn,{label:"选做题组总分",value:t.groupScore,max:200,onChange:G=>D({groupScore:G})})]}),R&&r!=="chunk"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:"当前题号",value:R.label,onChange:G=>_({label:G,choice:{...R.choice,label:G}})}),f.jsx(rn,{label:"当前题分",value:R.score,max:Fs(R.kind),onChange:G=>_({score:G,choice:{...R.choice,score:G}})}),z&&r!=="cloze"&&r!=="completion"&&f.jsx(ot,{label:"小题题型",value:R.kind,options:dS,onChange:G=>_({kind:G})})]}),r==="cloze"&&f.jsx(ue,{size:"small",onClick:()=>m(i,R.id,R.label,60),children:"插入题号到公共材料"}),R.kind==="judge"&&f.jsxs("div",{children:[f.jsx(ot,{label:"判断标记",value:t.judgeLabels,options:{symbols:"√/×",letters:"T/F",words:"正确/错误"},onChange:G=>D({judgeLabels:G})}),f.jsx(Jt,{label:"正确判断",children:f.jsx("div",{className:"exercise-tabs",children:wm[t.judgeLabels].map((G,te)=>f.jsx(ue,{size:"small","aria-pressed":R.judgment===(te===0),onClick:()=>_({judgment:R.judgment===(te===0)?null:te===0}),children:G},te))})}),f.jsx(zt,{checked:R.needsReason,onChange:G=>_({needsReason:G.target.checked}),children:"判断后改正/说明理由"}),R.needsReason&&f.jsx(J0,{value:R.area,onChange:G=>_({area:G})})]}),R.kind==="choice"&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项与计分规则"}),f.jsx(W0,{value:{...mu(0),presentation:R.presentation,questions:[R.choice]},document:R.document,creation:u.creation,selectedId:R.choice.id,onSelect:()=>{},onChange:G=>{const te=G.questions.find(V=>V.id===R.choice.id);te&&_({choice:te,presentation:G.presentation,score:te.score??null})},singleQuestion:!0})]}),R.kind==="fill"&&r!=="matching"&&f.jsxs("div",{children:[f.jsx(zt,{checked:t.fillNewLine,onChange:G=>D({fillNewLine:G.target.checked}),children:"每题一行"}),f.jsx(HR,{value:R.blanks,onChange:G=>_({blanks:G}),onInsert:G=>m(i,G.id,`${R.label}.${G.label}`,p.columnWidth*G.width/100-30)})]}),$&&r!=="ordering"&&f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:"作答区域"}),f.jsx(J0,{value:R.area,drawing:R.kind==="drawing",onChange:G=>_({area:G})})]}),["answer","calculation","correction"].includes(R.kind)&&r!=="ordering"&&f.jsxs("details",{children:[f.jsx("summary",{children:r==="practice"?"评价量表":R.kind==="correction"?"改错位置与答案":"分步作答与评分点"}),f.jsx(BR,{value:R.steps,correction:R.kind==="correction",practice:r==="practice",onChange:G=>_({steps:G})})]}),R.kind==="table"&&f.jsx(ue,{size:"small",disabled:!Cn(R.document),onClick:()=>_({document:bS()}),children:"建立空白表格"}),["matching","ordering"].includes(r)&&f.jsx(PR,{value:t,kind:r,item:R,onChange:M}),f.jsxs("details",{children:[f.jsx("summary",{children:r==="matching"?"左侧项目内容":"小题正文"}),f.jsx(Xi,{value:R.document,ariaLabel:`小题 ${R.label} 正文设置`,uploadImage:d,onChange:G=>I({document:G})})]}),f.jsxs("details",{children:[f.jsx("summary",{children:"参考答案与解析"}),f.jsx(Jt,{label:"参考答案",children:f.jsx(Xi,{value:R.reference,ariaLabel:"参考答案",uploadImage:d,onChange:G=>I({reference:G})})}),f.jsx(Jt,{label:"解析",children:f.jsx(Xi,{value:R.explanation,ariaLabel:"答案解析",uploadImage:d,onChange:G=>I({explanation:G})})})]})]},R.id),r==="practice"&&f.jsx(dn,{label:"作品/音视频引用 URL",value:t.attachmentUrl,maxLength:4096,onChange:G=>D({attachmentUrl:G})}),X.length>0&&f.jsx("p",{className:"exercise-error",role:"alert",children:X.join(";")})]})}function GR({group:t,creation:r,start:i,scanMarking:a,onAdd:c}){const{card:l}=ct(),u=l.usage==="homework",d=w=>{const T=Cu(w,i,r);return t.type==="MIXED"&&w==="MCHOICE"?{...T,scoreType:t.scoreType||"LESS_SCORE",score:t.scoreType==="ITEM_SCORE"?T.score:null}:T},[m,p]=E.useState(()=>d(t.type==="MIXED"?"SCHOICE":t.type)),[C,g]=E.useState(null),[b,x]=E.useState({start:null,end:null}),v=w=>{g(null),p(T=>({...T,...w}))},S=da[m.type];return f.jsxs("div",{className:"reference-add-panel",children:[t.type==="MIXED"&&f.jsx(ot,{label:"子题题型",value:m.type,options:Object.fromEntries(Om(r,!0).map(w=>[w,cr[w]])),onChange:w=>{p(d(w)),x({start:null,end:null}),g(null)}}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(Ma,{label:"起始题号",value:b.start,min:1,max:1e3,onChange:w=>x(T=>({...T,start:w}))}),!Ti(m.type)&&f.jsx(Ma,{label:"结束题号",value:b.end,min:b.start||1,max:Math.min(1e3,(b.start||1)+S.count-1),onChange:w=>x(T=>({...T,end:w}))}),Et(m.type)&&(S.options[0]===S.options[1]?f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:"选项个数"}),f.jsx("span",{children:S.options[0]})]}):f.jsx(Ma,{label:"选项个数",value:m.optionCount,min:S.options[0],max:S.options[1],onChange:w=>v({optionCount:w})})),Be(m.type)&&f.jsx(Ma,{label:"子题数量",value:m.partCount,min:1,max:S.parts,onChange:w=>v({partCount:w})}),["FILLBLANK","SHORTANSWER"].includes(m.type)&&f.jsx(ft,{label:m.type==="FILLBLANK"?"每题空数":"每题小题数",value:m.partCount||1,min:1,max:m.type==="SHORTANSWER"&&(a||t.optional)?1:S.parts,onChange:w=>v({partCount:w})}),u&&f.jsx(zt,{checked:m.score===0,onChange:w=>v({score:w.target.checked?0:null,lessScore:0}),children:"无分值"}),f.jsx(rn,{min:u?0:.5,label:m.type==="FILLBLANK"?"每空分值":m.type==="SHORTANSWER"?"每小题分值":"每题分值",value:m.score,max:S.score,onChange:w=>v({score:w,lessScore:0})}),m.type==="MCHOICE"&&f.jsxs(E.Fragment,{children:[t.type!=="MIXED"&&f.jsx(ot,{label:"少选计分",value:m.scoreType,options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:w=>v({scoreType:w,lessScore:0})}),m.scoreType==="LESS_SCORE"&&f.jsx(ft,{label:"少选得分",value:m.lessScore,min:0,max:m.score||0,step:.5,onChange:w=>v({lessScore:w})})]}),m.type==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Ma,{label:"正确答案个数",value:m.rightAnswers,min:1,max:(m.optionCount||2)-1,onChange:w=>v({rightAnswers:w})}),f.jsx(rn,{label:"每涂对一处得分",value:m.singleScore,max:m.score||10,onChange:w=>v({singleScore:w})})]}),m.type==="CCOMPOSITION"&&f.jsx(ft,{label:"作文格数",value:m.characters,min:1,max:1200,onChange:w=>v({characters:w})}),m.type==="ECOMPOSITION"&&f.jsx(ft,{label:"作文行数",value:m.lines,min:1,max:100,onChange:w=>v({lines:w})})]}),C&&f.jsx("p",{role:"alert",className:"card-choice-error",children:C}),f.jsx(ue,{size:"small",type:"primary",onClick:()=>{if(b.start===null||!Ti(m.type)&&b.end===null){g("请输入起始题号和结束题号");return}const w={...m,start:b.start,end:Ti(m.type)?b.start:b.end},T=AS(t,w,a,u);g(T),T||c(w)},children:"添加题目"})]})}function Ma({label:t,value:r,min:i,max:a,onChange:c}){return f.jsx(Jt,{label:t,children:f.jsx(Na,{"aria-label":t,value:r,min:i,max:a,precision:0,placeholder:"请输入",onChange:c})})}function VR({value:t,onChange:r,onClose:i}){const a=t.questions.filter(x=>Et(x.type)).flatMap(x=>Be(x.type)?x.parts:[x]),[c,l]=E.useState([]),[u,d]=E.useState(!1),[m,p]=E.useState(!1),[C,g]=E.useState(2),b=()=>{const x=(v,S)=>!c.includes(v.id)||!v.text?v:{...v,text:{...v.text,layout:{...v.text.layout,indent:u,layout:m?"fixed":"natural",columns:m?C:S?4:2}}};r({...t,questions:t.questions.map(v=>({...x(v,v.type==="CLOZE"),parts:v.parts.map(S=>x(S,v.type==="CLOZE"))}))}),i()};return f.jsx(Vi,{open:!0,title:"客观题选项排版设置",width:400,className:"card-modal",closeLabel:"关闭选项排版",closeIcon:f.jsx(eo,{name:"close"}),onCancel:i,footer:f.jsxs(f.Fragment,{children:[f.jsx(ue,{onClick:i,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!c.length,onClick:b,children:"确定"})]}),children:f.jsxs("div",{className:"exercise-panel",children:[f.jsx(zt,{checked:c.length===a.length,onChange:x=>l(x.target.checked?a.map(v=>v.id):[]),children:"全选"}),f.jsx("div",{className:"exercise-fields",children:a.map(x=>f.jsxs(zt,{checked:c.includes(x.id),onChange:v=>l(S=>v.target.checked?[...S,x.id]:S.filter(w=>w!==x.id)),children:["第 ",x.label," 题"]},x.id))}),f.jsx(ot,{label:"首行缩进",value:String(u),options:{false:"否",true:"是"},onChange:x=>d(x==="true")}),f.jsx(ot,{label:"个数排版",value:String(m),options:{false:"否",true:"是"},onChange:x=>p(x==="true")}),m&&f.jsx(ot,{label:"排版方式",value:String(C),options:{4:"一行4个",2:"一行2个",1:"一行1个"},onChange:x=>g(Number(x))})]})})}function qR({block:t,value:r,selectedId:i,onSelect:a,onChange:c}){const{card:l,geometry:u,setCard:d,editQuestion:m,insertMaterialBlank:p}=ct(),[C,g]=E.useState(null),[b,x]=E.useState(!1),[v,S]=E.useState([]),[w,T]=E.useState([]),[j,R]=E.useState(""),[O,M]=E.useState(!1),D=r.questions.find(L=>L.id===i||L.parts.some(P=>P.id===i))||r.questions[0],_=r.questions.indexOf(D),I=(L,P)=>{S(N=>[...N.slice(-49),{value:r,document:t.document}]),T([]),R(""),g(null),c(L,P)},B=L=>I({...r,questions:r.questions.map(P=>P.id===L.id?L:P)}),H=ha(r),z=fu(r.layout),$=Ys(t.document),X={...r.layout,direction:l.choiceDirection||r.layout.direction,questions:H},G=pu(X),te=z!=="concentrated"?la(X,t.document,!0).concentrated.questions:[],V=K0(t),Y=L=>{const P=L.value;c({...P,questions:P.questions.map(N=>{const U=r.questions.find(J=>J.id===N.id);return U?{...N,text:U.text||N.text,document:wn(U.document,N.label,N.score),parts:N.parts.map(J=>({...J,text:U.parts.find(Q=>Q.id===J.id)?.text||J.text,document:wn(U.parts.find(Q=>Q.id===J.id)?.document||J.document,J.label,J.score)}))}:N})},OR(t.document,L.document))};return f.jsxs("div",{className:"exercise-panel reference-panel",children:[r.type==="MIXED"&&f.jsx(ot,{label:"复合题少选计分",value:r.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:L=>I({...r,scoreType:L,questions:r.questions.map(P=>P.type==="MCHOICE"?{...P,choice:{...P.choice,scoreType:L,lessScore:L==="ITEM_SCORE"?0:P.choice.lessScore}}:P)})}),H.length>0&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"选择题填涂位置",value:z,options:r.questions.some(L=>L.type==="CHUNK_CHOICE")?{concentrated:"集中填涂",stem:"题干前整组字母框"}:{concentrated:"集中填涂",stem:"题干前整组字母框",option:"各选项前空方框"},onChange:L=>{const P=hu(X,t.document,L),N=new Map(P.questions.map(U=>[U.id,U]));I({...r,layout:{...P,questions:[]},questions:r.questions.map(U=>({...U,choice:N.get(U.id)||U.choice,parts:U.parts.map(J=>({...J,choice:N.get(J.id)||J.choice}))}))})}}),f.jsx(ot,{label:"填涂排列方向",value:G,options:new Set(H.map(L=>L.options.length)).size>1?{column:"竖排(选项数不同)"}:{row:"横排(先右后下)",column:"竖排(先下后右)"},onChange:L=>d(P=>({...P,choiceDirection:L}))}),G==="column"&&f.jsx(ft,{label:"每列题数",value:r.layout.rowsPerColumn,min:1,max:5,onChange:L=>I({...r,layout:{...r.layout,rowsPerColumn:L}})}),r.textVersion===1&&l.questionCard&&r.type!=="INFO_MATCHING"&&f.jsx(ue,{size:"small",onClick:()=>M(!0),children:"选项排版"})]}),r.questions.length>0&&f.jsxs(E.Fragment,{children:[f.jsx(ot,{label:"当前题目",value:D.id,options:Object.fromEntries(r.questions.map(L=>[L.id,`${Be(L.type)?L.parts.map(P=>P.label).join("、"):L.label} · ${cr[L.type]}`])),onChange:a}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional,onClick:()=>x(L=>!L),children:"新增题目"}),f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional||Js(r)+D.parts.length-1>1e3,onClick:()=>{if(r.type==="CCOMPOSITION"||r.optional)return;const L=OS(D,Js(r)),P=[...r.questions];P.splice(_+1,0,L),I({...r,questions:P},RR(t.document,D,L)),a(L.id)},children:"复制当前题目"}),f.jsx(ue,{size:"small","aria-label":"上移当前题目",disabled:_<=0,onClick:()=>I({...r,questions:ua(r.questions,D.id,-1)}),children:"↑"}),f.jsx(ue,{size:"small","aria-label":"下移当前题目",disabled:_>=r.questions.length-1,onClick:()=>I({...r,questions:ua(r.questions,D.id,1)}),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,onClick:()=>{const L=r.questions.filter(P=>P.id!==D.id);I({...r,questions:L,optional:r.optional&&L.length>1,choose:Math.max(1,Math.min(r.choose,L.length-1))}),L.length&&a(L[Math.max(0,_-1)].id)},children:"删除当前题目"})]})]}),(!r.questions.length||b)&&f.jsx(GR,{group:r,creation:l.creation,start:Js(r),scanMarking:!!l.scanMarking,onAdd:L=>{const P=RS(r,{...L,paperWidth:u.columnWidth},D?.id);I({...P,questions:P.questions.map(N=>r.questions.some(U=>U.id===N.id)?N:{...N,halfPoint:!!l.halfPoint})}),a(P.questions.find(N=>!r.questions.some(U=>U.id===N.id)).id),x(!1)}},`${r.type}/${Js(r)}/${r.scoreType}`),r.type==="SHORTANSWER"&&r.questions.length>1&&f.jsxs(E.Fragment,{children:[f.jsx(zt,{checked:r.optional,disabled:r.questions.some(L=>L.parts.length>1),onChange:L=>I({...r,optional:L.target.checked,choose:1}),children:"是否选做"}),r.optional&&f.jsx(ft,{label:`${r.questions.length} 选`,value:r.choose,min:1,max:l.scanMarking?r.questions.length-1:1,onChange:L=>I({...r,choose:L})})]}),r.questions.length>0&&!r.optional&&r.type!=="MIXED"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:"分组总分",min:l.usage==="homework"?0:.5,value:C??Fn(r.questions),max:1e4,onChange:g}),f.jsx(ue,{size:"small",disabled:(C??Fn(r.questions))===null,onClick:()=>{const L=_S(r,C??Fn(r.questions),l.usage==="homework");L?I(L):R("总分无法平均分配,每题/空的分值须符合题型范围且为 0.5 的倍数")},children:"平均分配"})]}),D&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"编辑正文",value:V.some(L=>L.id===i)?i:D.id,options:Object.fromEntries(V.map(L=>[L.id,L.label])),onChange:L=>{a(L),m(t.id,L)}}),f.jsx(ue,{size:"small",onClick:()=>m(t.id,i||D.id),children:"编辑当前正文"})]}),te.length>0&&f.jsxs("p",{className:"card-choice-error",role:"status",children:["第 ",te.map(L=>L.label).join("、")," 题",z==="stem"?"尚未关联题干":"尚未关联完整选项",",暂保留集中填涂。"]}),D&&f.jsx(YR,{value:D,group:r,scanMarking:!!l.scanMarking,onApply:L=>{const P=r.questions.find(Q=>Q.id===L.id),N={...L,document:wn(P.document,L.label,L.score),parts:L.parts.map(Q=>({...Q,document:wn(P.parts.find(le=>le.id===Q.id)?.document||Q.document,Q.label,Q.score)}))},U=r.questions.filter(Q=>Q.id!==N.id).flatMap(Q=>Be(Q.type)?Q.parts.map(le=>le.label):[Q.label]),J=Be(N.type)?N.parts.map(Q=>Q.label):[N.label];return J.some(Q=>!Q.trim()||U.includes(Q))||new Set(J).size!==J.length?(R("题号不能为空或重复"),!1):(r.optional?I({...r,questions:r.questions.map(Q=>Q.id===N.id?N:{...Q,score:N.score,document:wn(Q.document,Q.label,N.score),parts:Q.parts.map(le=>({...le,score:N.score,document:wn(le.document,le.label,N.score)}))})}):B(N),!0)}},D.id),D&&Ei(D.type)&&f.jsxs(E.Fragment,{children:[f.jsx(zt,{checked:r.fillNewLine,onChange:L=>I({...r,fillNewLine:L.target.checked}),children:"每题一行"}),f.jsx("div",{className:"reference-part-settings",children:D.parts.map(L=>f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:`空位 ${L.label} 显示题号`,maxLength:10,value:L.label,onChange:P=>B({...D,parts:D.parts.map(N=>N.id===L.id?{...N,label:P}:N)})}),f.jsx(ot,{label:`空位 ${L.label} 宽度`,value:String(L.width),options:{...l.scanMarking?{20:"1/5 行"}:{},25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:P=>B({...D,parts:D.parts.map(N=>N.id===L.id?{...N,width:Number(P)}:N)})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",onClick:()=>p(t.id,L.id,L.label,u.columnWidth*L.width/100),children:"插入此空到正文"}),f.jsx(zt,{checked:L.breakAfter,onChange:P=>B({...D,parts:D.parts.map(N=>N.id===L.id?{...N,breakAfter:P.target.checked}:N)}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>I({...r,questions:r.questions.map(P=>Ei(P.type)?{...P,parts:P.parts.map(N=>({...N,width:L.width}))}:P)}),children:"宽度统一设置"})]})]},L.id))})]}),D&&Et(D.type)&&f.jsx(E.Fragment,{children:(Be(D.type)?D.parts.map(L=>L.choice):[D.choice]).map(L=>f.jsxs("div",{children:[f.jsxs(zt,{checked:L.breakBefore,onChange:P=>{const N={...L,breakBefore:P.target.checked};B({...D,choice:D.choice.id===L.id?N:D.choice,parts:D.parts.map(U=>U.choice.id===L.id?{...U,choice:N}:U)})},children:[L.label," 题前换行"]}),z==="option"&&r.textVersion!==1&&f.jsx(ot,{label:`${L.label} 题对应正文选项`,value:L.contentTarget?.groupId||"",options:{"":"按正文归属匹配",...Object.fromEntries($.map((P,N)=>[P.id,`第 ${P.label||N+1} 组选项`]))},onChange:P=>{const N=$.find(J=>J.id===P),U={...L,contentTarget:N?{groupId:P,optionIds:N.options.map(J=>J.id)}:null};B({...D,choice:D.choice.id===L.id?U:D.choice,parts:D.parts.map(J=>J.choice.id===L.id?{...J,choice:U}:J)})}})]},L.id))}),j&&f.jsx("p",{className:"card-choice-error",role:"alert",children:j}),O&&f.jsx(VR,{value:r,onChange:I,onClose:()=>M(!1)}),(v.length>0||w.length>0)&&f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!v.length,onClick:()=>{const L=v.at(-1);S(v.slice(0,-1)),T(P=>[...P,{value:r,document:t.document}]),Y(L)},children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!w.length,onClick:()=>{const L=w.at(-1);T(w.slice(0,-1)),S(P=>[...P,{value:r,document:t.document}]),Y(L)},children:"重做题型配置"})]})]})}function YR({value:t,group:r,scanMarking:i,onApply:a}){const{card:c}=ct(),[l,u]=E.useState(null),[d,m]=E.useState(""),p=l||t,C=w=>{u({...p,...w}),m("")},g=p.type,b=da[g],x=p.choice.options.length,v=p.parts.length,S=w=>{const T=Array.from({length:w},(j,R)=>p.parts[R]||ji(Be(g)?String(Number(p.parts[0]?.label||p.label)+R):w===1?p.label:`${p.label}.${R+1}`,p.parts[0]?.score??null,g,p.choice.options.length));Be(g)||T.forEach((j,R)=>{T[R]={...j,label:w===1?p.label:`${p.label}.${R+1}`}}),C({parts:T,score:Fn(T)})};return f.jsxs("div",{className:"reference-question-settings",children:[f.jsxs("div",{className:"exercise-fields",children:[r.type!=="MIXED"&&["SCHOICE","MCHOICE"].includes(g)&&f.jsx(ot,{label:"题型",value:g,options:{SCHOICE:"单选题",MCHOICE:"多选题"},onChange:w=>{const T=w==="MCHOICE"&&xi(c.creation)&&p.score===null?6:p.score;C({type:w,score:T,choice:{...fa(p.choice,w,x),score:T,scoreType:w==="MCHOICE"&&xi(c.creation)?"ITEM_SCORE":"LESS_SCORE",lessScore:0}})}}),!Be(g)&&f.jsx(dn,{label:"题目题号",value:p.label,maxLength:10,onChange:w=>C({label:w,choice:{...p.choice,label:w},parts:p.parts.map((T,j)=>({...T,label:p.parts.length===1?w:`${w}.${j+1}`}))})}),Et(g)&&f.jsx(ft,{label:"选项个数",min:b.options[0],max:b.options[1],value:x,onChange:w=>C({choice:fa(p.choice,g,w),parts:p.parts.map(T=>({...T,choice:fa(T.choice,g,w)}))})}),v>0&&(g==="INFO_MATCHING"||r.type==="MIXED")&&f.jsx(Jt,{label:"子题数量",children:f.jsx("span",{children:v})}),v>0&&g!=="INFO_MATCHING"&&r.type!=="MIXED"&&f.jsx(ft,{label:Be(g)?"子题数量":g==="FILLBLANK"?"每题空数":"每题小题数",value:v,min:1,max:g==="SHORTANSWER"&&(i||r.optional)?1:b.parts,onChange:S}),c.usage==="homework"&&f.jsx(zt,{checked:p.score===0,onChange:w=>{const T=w.target.checked?0:null;C({score:T,choice:{...p.choice,score:T,lessScore:0},parts:p.parts.map(j=>({...j,score:T,choice:{...j.choice,score:T,lessScore:0}}))})},children:"无分值"}),!v&&f.jsx(rn,{min:c.usage==="homework"?0:.5,label:"本题分值",value:p.score,max:b.score,onChange:w=>C({score:w,choice:{...p.choice,score:w,lessScore:0}})}),Be(g)&&f.jsx(rn,{min:c.usage==="homework"?0:.5,label:"每题分值",value:p.parts[0]?.score??null,max:b.score,onChange:w=>{const T=p.parts.map(j=>({...j,score:w,choice:{...j.choice,score:w}}));C({parts:T,score:Fn(T)})}}),g==="MCHOICE"&&f.jsxs(E.Fragment,{children:[r.type!=="MIXED"&&f.jsx(ot,{label:"少选计分",value:p.choice.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:w=>C({choice:{...p.choice,scoreType:w,lessScore:0}})}),p.choice.scoreType!=="ITEM_SCORE"&&f.jsx(ft,{label:"少选得分",min:0,max:p.score||0,step:.5,value:p.choice.lessScore||0,onChange:w=>C({choice:{...p.choice,lessScore:w}})})]}),g==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Ma,{label:"正确答案个数",value:p.rightAnswers,min:1,max:x-1,onChange:w=>C({rightAnswers:w})}),f.jsx(rn,{label:"每涂对一处得分",value:p.singleScore,max:p.score||10,onChange:w=>C({singleScore:w})})]}),g==="CCOMPOSITION"&&f.jsx(ft,{label:"作文格数",value:p.characters,min:1,max:1200,onChange:w=>C({characters:w})}),g==="ECOMPOSITION"&&f.jsx(Jt,{label:"初始作文行数",children:f.jsx("span",{children:p.lines})}),g==="CCOMPOSITION"&&f.jsx(ft,{label:"题干区域高度",value:p.contentHeight,min:38,max:Number.MAX_SAFE_INTEGER,onChange:w=>C({contentHeight:w})})]}),p.parts.map((w,T)=>f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}题号`,value:w.label,maxLength:10,onChange:j=>C({parts:p.parts.map(R=>R.id===w.id?{...R,label:j,choice:{...R.choice,label:j}}:R)})}),!Be(g)&&f.jsx(rn,{min:c.usage==="homework"?0:.5,label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}分值`,value:w.score,max:b.score,onChange:j=>{const R=p.parts.map(O=>O.id===w.id?{...O,score:j,choice:{...O.choice,score:j}}:O);C({parts:R,score:Fn(R)})}}),["FILLBLANK","SHORTANSWER"].includes(g)&&r.type!=="MIXED"&&!r.optional&&v>1&&f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}`,onClick:()=>{const j=p.parts.filter(R=>R.id!==w.id).map((R,O)=>({...R,label:v===2?p.label:`${p.label}.${O+1}`}));C({parts:j,score:Fn(j)})},children:"删除"}),g==="SHORTANSWER"&&!r.optional&&f.jsx(ft,{label:`第 ${T+1} 小题作答高度`,value:w.height,min:30,max:Number.MAX_SAFE_INTEGER,onChange:j=>C({parts:p.parts.map(R=>R.id===w.id?{...R,height:j}:R)})})]},w.id)),p.parts.length>0&&f.jsx(Jt,{label:"本题总分",children:f.jsx("span",{children:p.score??"未设置"})}),!Et(g)&&!Ei(g)&&f.jsx(zt,{checked:p.halfPoint,onChange:w=>C({halfPoint:w.target.checked}),children:"计分栏显示 0.5"}),d&&f.jsx("p",{className:"card-choice-error",role:"alert",children:d}),f.jsx(ue,{size:"small",disabled:!l,onClick:()=>{if((v?p.parts:[p]).some(w=>w.score===null||w.score<(c.usage==="homework"?0:.5)||w.score>b.score)){m("请填写符合题型范围的分值");return}if(p.parts.some(w=>!w.label.trim())){m("题号不能为空");return}if(g==="INFO_MATCHING"&&v>x){m("选项个数需大于等于子题数量");return}if(g==="CHUNK_CHOICE"&&(!p.rightAnswers||p.rightAnswers>=x||p.singleScore===null||p.score!==null&&p.score!==0&&p.rightAnswers*p.singleScore>p.score)){m("正确答案个数须小于选项数,且每处得分之和不能超过题分");return}if(g==="MCHOICE"&&(p.choice.lessScore||0)>(p.score||0)){m("少选得分不能超过本题分值");return}a(p)&&u(null)},children:"应用配置"})]})}function XR({block:t,autoFocus:r,onClose:i}){const{card:a,geometry:c,setCard:l,setSelectedId:u,setDeleted:d,updateBlock:m,editQuestion:p,selectedChoiceId:C,selectChoice:g}=ct(),{dialog:b,setDialog:x,titleProps:v,cancelDrag:S}=ql(O=>{const M=O.closest(".card-workspace")?.querySelector(".card-sidebar")?.getBoundingClientRect();return{left:(M?.left??window.innerWidth)-O.getBoundingClientRect().width-12,top:(M?.top??0)+12}}),w=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);E.useLayoutEffect(()=>{if(!b)return;const O=b;O.setAttribute("aria-modal","false"),O.setAttribute("aria-labelledby","card-block-modal-title");let M=document.activeElement instanceof HTMLElement?document.activeElement:null;const D=_=>{_.target instanceof HTMLElement&&!O.contains(_.target)&&(M=_.target)};return document.addEventListener("focusin",D),()=>{document.removeEventListener("focusin",D),O.contains(document.activeElement)&&M?.isConnected&&M.focus({preventScroll:!0})}},[b]),E.useLayoutEffect(()=>{b&&(b.dataset.settingsBlock=t.id)},[b,t.id]);const T=f.jsxs("div",{...v,className:"card-modal-drag","aria-label":"拖动题块设置",title:"拖动移动;方向键微调,Home 复位","data-editor-menu-avoid":!0,children:[f.jsx("h2",{id:"card-block-modal-title",children:"题块设置"}),f.jsx("p",{"aria-hidden":"true",children:t.reference?cr[t.reference.type]:jm[t.kind]})]}),j=()=>{d({block:t,index:a.blocks.findIndex(O=>O.id===t.id)}),l(O=>({...O,blocks:O.blocks.filter(M=>M.id!==t.id)})),u(null),i()},R=f.jsxs("div",{className:"card-modal-actions",children:[f.jsxs(ue,{type:"text",danger:!0,className:"card-delete","aria-label":"删除选中题块",onClick:j,children:[f.jsx(eo,{name:"trash",size:16}),"删除题块"]}),f.jsx(ue,{type:"text",onClick:()=>{const O=Ao(t);l(M=>{const D=[...M.blocks];return D.splice(D.findIndex(_=>_.id===t.id)+1,0,O),{...M,blocks:D}}),u(O.id)},children:"复制题块"}),f.jsx(ue,{type:"primary",className:"card-edit-question",onClick:()=>p(t.id),children:t.areaType?"编辑文字":"编辑题目"})]});return f.jsx(Vi,{open:!0,modal:!1,panelRef:x,className:"card-modal card-block-modal",width:400,zIndex:900,classNames:{header:"card-modal-header",body:"card-modal-body card-inspector",footer:"card-modal-footer"},closeLabel:"关闭题块设置",closeIcon:f.jsx(eo,{name:"close",size:16}),onCancel:i,onOpenAutoFocus:O=>{O.preventDefault(),r?b?.querySelector(".ui-dialog-close")?.focus({preventScroll:!0}):w.current?.focus({preventScroll:!0})},onEscapeKeyDown:O=>{O.preventDefault(),O.stopPropagation(),S()||i()},title:T,footer:R,children:f.jsxs("div",{children:[f.jsxs("label",{className:"card-field",children:["标题",f.jsx(Oa,{"aria-label":"题块标题",value:t.title,maxLength:300,onChange:O=>m(t.id,{title:O.target.value})})]}),t.reference&&f.jsx(qR,{block:t,value:t.reference,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:(O,M)=>m(t.id,{reference:O,...M?{document:M}:{}})}),!t.reference&&t.kind==="choice"&&t.choices&&f.jsx(W0,{value:t.choices,document:t.document,creation:a.creation,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:O=>m(t.id,{choices:O})}),t.kind==="area"&&f.jsx(ft,{label:"区域高度",min:100,max:t.areaType==="forbiden"?Math.floor(c.contentHeight):4e3,value:t.answerHeight,onChange:O=>m(t.id,{answerHeight:O})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&t.exercise&&f.jsx($R,{value:t.exercise,kind:t.kind,blockId:t.id,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:O=>m(t.id,{exercise:O})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&!t.exercise&&f.jsxs("div",{className:"card-range",children:["作答区高度 ",f.jsxs("b",{children:[t.answerHeight," px"]}),f.jsx(P0,{className:"ui-slider",ariaLabelForHandle:"作答区高度",min:0,max:800,step:10,value:t.answerHeight,onChange:O=>m(t.id,{answerHeight:O})}),f.jsx(ue,{size:"small",onClick:()=>{if(t.kind==="choice"||t.kind==="area")return;const O=fS(t.kind);O.items[0].area.rows=Math.ceil(t.answerHeight/O.items[0].area.rowHeight),m(t.id,{exercise:O})},children:"启用题型配置"})]})]},t.id)})}function KR(t){const r=new URLSearchParams(location.search);return{mode:r.get("mode")==="exam"?"exam":"template",name:(r.get("name")||"").slice(0,30),...xm(t,{gradeCode:r.get("gradeCode")||void 0,courseCode:r.get("courseCode")||void 0,grade:r.get("grade")||void 0,subject:r.get("subject")||void 0}),...r.get("id")?{id:r.get("id")}:{},...r.get("exampaperId")?{exampaperId:r.get("exampaperId")}:{}}}function FR({initial:t,dictionary:r,replacing:i,onCreate:a,onClose:c}){const[l,u]=E.useState(t),d={...l,...xm(r,l)},m=r.gradeCourseMap[d.gradeCode]||[],[p,C]=E.useState(""),g=E.useId(),b=E.useRef(null),{dialog:x,setDialog:v,titleProps:S}=ql();E.useLayoutEffect(()=>{x?.setAttribute("aria-labelledby",`${g}-title`)},[x,g]);const w=f.jsx("div",{...S,className:"card-modal-drag","aria-label":"拖动新建答题卡",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:`${g}-title`,children:"新建答题卡"})});return f.jsx(Vi,{open:!0,panelRef:v,width:460,className:"card-modal card-create-modal",title:w,closeLabel:"关闭新建答题卡",closeIcon:f.jsx(eo,{name:"close",size:16}),onCancel:c,onOpenAutoFocus:T=>{T.preventDefault(),b.current?.focus({preventScroll:!0})},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ue,{onClick:c,children:"取消"}),f.jsx(ue,{type:"primary",htmlType:"submit",form:g,disabled:!d.gradeCode||!d.courseCode,children:"确定"})]}),children:f.jsxs("form",{id:g,onSubmit:T=>{if(T.preventDefault(),!d.name.trim()){C("请输入题卡名称"),b.current?.focus();return}if(!d.gradeCode||!d.courseCode){C("没有可用的年级和课程");return}a({...d,name:d.name.trim()})},children:[f.jsx("div",{className:"card-create-mode",role:"group","aria-label":"创建用途",children:["template","exam"].map(T=>f.jsx(ue,{type:d.mode===T?"primary":"default","aria-pressed":d.mode===T,onClick:()=>u(j=>({...j,mode:T})),children:T==="template"?"答题卡模板":"考试答题卡"},T))}),f.jsxs("label",{className:"card-field",children:["题卡名称",f.jsx(Oa,{ref:b,"aria-label":"题卡名称",status:p?"error":void 0,"aria-invalid":!!p,"aria-describedby":p?"card-create-error":void 0,placeholder:"请输入题卡名称",maxLength:30,value:d.name,onChange:T=>{u(j=>({...j,name:T.target.value})),C("")}})]}),f.jsxs("div",{className:"card-create-subject",children:[f.jsxs("label",{className:"card-field",children:["年级",f.jsx(Wt,{"aria-label":"年级",value:d.gradeCode,disabled:!r.grades.length,onChange:T=>u(j=>({...j,...bi(r,T,r.gradeCourseMap[T][0].value)})),children:r.grades.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]}),f.jsxs("label",{className:"card-field",children:["科目",f.jsx(Wt,{"aria-label":"科目",value:d.courseCode,disabled:!m.length,onChange:T=>u(j=>({...j,...bi(r,d.gradeCode,T)})),children:m.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]})]}),!r.grades.length&&f.jsx("p",{className:"card-create-error",role:"alert",children:"没有可用的年级和课程"}),p&&f.jsx("p",{id:"card-create-error",className:"card-create-error",role:"alert",children:p}),i&&f.jsx("p",{className:"card-section-note",children:"确定后将新建空白题卡并替换当前内容。"})]})})}function QR(){const{card:t,setCard:r,setQuestionCard:i,readOnly:a,geometry:c}=ct(),l=u=>r(d=>d.header?{...d,header:{...d.header,...u}}:d);return f.jsxs("div",{className:"card-sidebar-section card-paper-settings",children:[f.jsx("h1",{children:"页面布局"}),f.jsx("div",{className:"card-preset-grid",children:Object.keys(vi).map((u,d)=>f.jsxs(ue,{type:"text","aria-label":vi[u].label,"aria-pressed":t.preset===u,disabled:a,onClick:()=>r(m=>({...m,preset:u})),children:[f.jsx("span",{className:`card-paper-icon cols-${vi[u].columns}`,children:Array.from({length:vi[u].columns},(m,p)=>f.jsx("i",{},p))}),f.jsx("span",{children:["一栏","两栏","三栏"][d]})]},u))}),f.jsx("p",{className:"card-section-note",children:c.columns===1?"一栏适用于 A4、16K 纸张":`${c.columns===2?"二":"三"}栏适用于 A3、8K 纸张`}),f.jsxs("div",{className:"card-paper-options",children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡用途"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:t.usage||"exam",onChange:u=>r(d=>({...d,usage:u.target.value})),children:[f.jsx(Ye.Button,{value:"exam",children:"考试"}),f.jsx(Ye.Button,{value:"homework",children:"作业"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"批阅模式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.scanMarking,onChange:u=>r(d=>({...d,scanMarking:u.target.value,blocks:d.blocks.map(m=>m.reference?.optional&&!u.target.value?{...m,reference:{...m.reference,choose:1}}:m)})),children:[f.jsx(Ye.Button,{value:!1,children:"手阅"}),f.jsx(Ye.Button,{value:!0,children:"网阅"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"分值 0.5"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.halfPoint,onChange:u=>r(d=>({...d,halfPoint:u.target.value,blocks:d.blocks.map(m=>m.reference?{...m,reference:{...m.reference,questions:m.reference.questions.map(p=>({...p,halfPoint:u.target.value}))}}:m)})),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡合一"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:"question-card",disabled:a,value:t.questionCard!==!1,onChange:u=>i(u.target.value),children:[f.jsx(Ye.Button,{value:!0,children:"是"}),f.jsx(Ye.Button,{value:!1,children:"否"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题排列"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:t.choiceDirection||"row",onChange:u=>r(d=>({...d,choiceDirection:u.target.value})),children:[f.jsx(Ye.Button,{value:"row",children:"横排"}),f.jsx(Ye.Button,{value:"column",children:"竖排"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题合并"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.mergeObjective,onChange:u=>r(d=>({...d,mergeObjective:u.target.value})),children:[f.jsx(Ye.Button,{value:!1,children:"不合并"}),f.jsx(Ye.Button,{value:!0,children:"合并"})]})]}),t.header&&f.jsxs(E.Fragment,{children:[[["subjectMarkers","学科标记"],["pointBlack","辅助识别点"],["examQrCode","试卷二维码"]].filter(([u])=>u!=="pointBlack"||t.usage!=="homework").map(([u,d])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:d}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:u==="subjectMarkers"?t.recognition?.[u]!==!1:!!t.recognition?.[u],onChange:m=>r(p=>({...p,recognition:{...p.recognition,[u]:m.target.value}})),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]},u)),t.recognition?.examQrCode&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"试卷 ID"}),f.jsx(Oa,{"aria-label":"二维码试卷 ID",value:String(t.creation?.exampaperId??""),disabled:a,maxLength:128,onChange:u=>r(d=>d.creation?{...d,creation:{...d.creation,exampaperId:u.target.value||void 0}}:d)})]}),t.usage!=="homework"&&f.jsxs(E.Fragment,{children:[[["focusText","注意事项"],["writeKaohao","考场/座位号"],["missExam","填涂标记"],["mifeng","密封线"]].map(([u,d])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:d}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:`header-${u}`,disabled:a,value:t.header[u],onChange:m=>l({[u]:m.target.value}),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]},u)),f.jsxs("fieldset",{className:"card-setting-row card-exam-number-setting",disabled:a,children:[f.jsx("legend",{children:"考号版式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:"header-kaohao",disabled:a,value:t.header.kaohao,onChange:u=>l({kaohao:u.target.value}),children:[f.jsx(Ye.Button,{value:"code",children:"条形码"}),f.jsx(Ye.Button,{value:"school",children:"校内准考证号"})]})]}),t.header.kaohao==="school"&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"考号位数"}),f.jsx(Wt,{"aria-label":"准考证号位数",size:"small",disabled:a,value:t.header.weishu,onChange:u=>l({weishu:Number(u)}),children:Array.from({length:9},(u,d)=>f.jsxs("option",{value:d+4,children:[d+4,"位"]},d))})]})]}),t.usage==="homework"&&f.jsxs(E.Fragment,{children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"作业考号版式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",value:t.header.tiaomaStyle||1,onChange:u=>l({tiaomaStyle:u.target.value}),children:[f.jsx(Ye.Button,{value:1,children:"填涂"}),f.jsx(Ye.Button,{value:2,children:"条形码"})]})]}),t.header.tiaomaStyle!==2&&f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"班级填涂"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",value:t.header.classText!==!1,onChange:u=>l({classText:u.target.value}),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]})]})]})]})]})}function tb({settings:t,activeQuestionId:r}){if(!t.questions.length)return null;const i=pu(t),a=l=>f.jsxs("div",{className:`card-choice-row${l.id===r?" is-current-choice":""}`,"data-question-id":l.id,"aria-current":l.id===r?"true":void 0,children:[f.jsxs("b",{children:[l.label,"."]}),f.jsx("div",{className:"card-choice-options","data-marker":t.marker,children:l.options.map(u=>f.jsx("span",{className:"card-choice-glyph","data-recognition":"MultiChoice","data-recognition-role":"cell","data-answer-id":l.id,"data-option-id":u.id,"data-value":u.label,"data-marker":t.marker,children:t.marker==="check"?`○ ${u.label}.`:u.label},u.id))})]},l.id),c=[[]];for(const l of t.questions)l.breakBefore&&c[c.length-1].length&&c.push([]),c[c.length-1].push(l);return f.jsx("div",{className:"card-choice-grid","aria-label":"选择题填涂区",style:{rowGap:t.rowGap,columnGap:t.columnGap},"data-direction":i,children:i==="column"?cS(t).map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{columnGap:t.columnGap,rowGap:t.rowGap},children:l.map(d=>f.jsx("div",{className:"card-choice-column",style:{gap:t.rowGap,minHeight:t.rowsPerColumn*20+(t.rowsPerColumn-1)*t.rowGap},children:d.map(a)},d[0].id))},u)):c.map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{rowGap:t.rowGap,columnGap:t.columnGap},children:l.map(a)},u))})}function nb(t){const r=t.getBoundingClientRect(),i=getComputedStyle(t),a=u=>Math.round(u*64)/64,c=a(parseFloat(i.width)+(i.boxSizing==="border-box"?0:parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth))),l=c>0&&r.width>0?r.width/c:1;return u=>{const d=u.getBoundingClientRect();let m=0;for(let p=u;p&&p!==t;p=p.parentElement)m+=parseFloat(p.style.translate.split(/\s+/)[1])||0;return{top:a((d.top-r.top)/l-m),height:a(d.height/l),width:a(d.width/l)}}}function rb(t){return nb(t.closest(".card-question")||t)(t)}function ZR(t){return rb(t).top}function Kl({id:t,label:r,value:i,visible:a,readOnly:c,placement:l,onUnits:u,onChange:d,onActiveFragment:m,uploadImage:p,choiceFillPosition:C,choiceFillBindings:g,activeChoiceQuestionId:b,contentTargets:x,editorKeys:v,onContentSelect:S}){const{geometry:w,registerEditor:T}=ct(),j=JSON.stringify(v||[]),R=E.useCallback(X=>{JSON.parse(j).forEach(G=>T(`content/${G}`,X))},[j,T]),O=E.useRef(null),M=E.useRef(!1);a&&(M.current=!0);const D=E.useRef([]),[_,I]=E.useState(0),B=E.useRef({id:t,visible:a,onUnits:u});B.current={id:t,visible:a,onUnits:u};const H=E.useCallback(()=>{const X=O.current?.querySelector(".rt-content"),G=X?ZR(X):0;I(te=>Math.abs(te-G)<.5?te:G),B.current.onUnits(B.current.id,B.current.visible?D.current.map(te=>({top:te.top+G,bottom:te.bottom+G})):[])},[]),z=E.useCallback(X=>{D.current=X,H()},[H]);E.useLayoutEffect(()=>{H()},[H,a,l.fragments,i]),E.useLayoutEffect(()=>()=>B.current.onUnits(B.current.id,[]),[]);const $=E.useMemo(()=>l.fragments.map(X=>({from:X.from-_,to:X.to-_,x:X.x-l.x,y:X.y-l.y-X.from+(X.topPadding||0)})),[l.fragments,l.x,l.y,_]);return f.jsx("div",{ref:O,className:"exercise-text",hidden:!a,children:M.current&&f.jsx(Xi,{value:i,readOnly:c||!a,uploadImage:p,ariaLabel:r,onChange:d,onEditor:R,contentTargets:x,allowContentAssignment:!1,onContentSelect:S,pagination:{slices:$,maxUnitHeight:w.contentHeight-80,onMeasure:z,onActiveSliceChange:m},choiceFillPosition:C,choiceFillBindings:g,activeChoiceQuestionId:b})})}function WR({rows:t,rowHeight:r,label:i,onChange:a}){const{scale:c}=ct(),l=E.useRef(null),u=()=>{l.current&&a(l.current.rows),l.current=null};return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":`调整 ${i} 题作答高度`,title:"拖动调整作答高度",onPointerDown:d=>{d.preventDefault(),d.stopPropagation(),d.currentTarget.focus(),l.current={y:d.clientY,rows:t},d.currentTarget.setPointerCapture(d.pointerId)},onPointerMove:d=>{l.current&&a(Math.max(1,Math.min(120,l.current.rows+Math.round((d.clientY-l.current.y)/c/r))))},onPointerUp:d=>{l.current=null,d.currentTarget.releasePointerCapture(d.pointerId)},onPointerCancel:u,onLostPointerCapture:()=>{l.current=null},onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),u()),["ArrowUp","ArrowDown"].includes(d.key)&&(d.preventDefault(),a(Math.max(1,Math.min(120,t+(d.key==="ArrowDown"?1:-1)))))}})}function ob({blank:t,item:r,active:i,fullLabel:a=!1}){return f.jsxs("div",{style:{width:`${t.width}%`},className:`exercise-flow-unit exercise-blank${i?" is-current":""}`,"data-exercise-id":r.id,"data-answer-id":t.id,children:[f.jsxs("span",{children:[a?`${r.label}.${t.label}`:`(${t.label})`," ",t.prefix]}),f.jsx("span",{className:`exercise-blank-space ${t.style}`,children:t.style==="characters"&&Array.from({length:t.characters},(c,l)=>f.jsx("i",{},l))}),f.jsx("span",{children:t.suffix})]})}function JR({area:t,item:r,active:i,readOnly:a,onResize:c,prefix:l=""}){const u={"--area-columns":t.columns,"--area-line":`${t.rowHeight}px`};return f.jsxs("div",{className:"exercise-area","data-style":t.style,style:u,children:[t.title&&f.jsxs("div",{className:`exercise-flow-unit exercise-title-line${i?" is-current":""}`,"data-exercise-id":r.id,children:["题目:",f.jsx("span",{})]}),Array.from({length:t.rows},(d,m)=>f.jsxs("div",{className:`exercise-flow-unit exercise-area-row${i?" is-current":""}`,"data-exercise-id":r.id,"data-area-row":m,style:{height:t.rowHeight,...t.backgroundUrl?{backgroundImage:`url(${JSON.stringify(t.backgroundUrl)})`,backgroundSize:`100% ${t.rows*t.rowHeight}px`,backgroundPosition:`0 -${m*t.rowHeight}px`}:{}},children:[l&&m===0&&f.jsx("span",{className:"exercise-area-prefix",children:l}),t.style==="characters"&&Array.from({length:t.columns},(p,C)=>{const g=m*t.columns+C+1;return f.jsx("span",{className:"exercise-character",children:t.wordMark>0&&g%t.wordMark===0&&f.jsxs("small",{children:[g,"字"]})},C)}),t.style==="coordinates"&&m===Math.floor(t.rows/2)&&f.jsx("span",{className:"exercise-axis-x",children:"x →"}),t.style==="coordinates"&&m===0&&f.jsx("span",{className:"exercise-axis-y",children:"↑ y"})]},m)),!a&&t.rows>0&&f.jsx(WR,{rows:t.rows,rowHeight:t.rowHeight,label:r.label,onChange:c})]})}function eO({value:t,kind:r,placement:i,showQuestion:a,readOnly:c,activeId:l,onUnits:u,onChange:d,onActiveFragment:m,uploadImage:p}){const C=(S,w="")=>`exercise-flow-unit ${w}${S===l?" is-current":""}`,g=t.pool,b=E.useMemo(()=>new Map(t.items.filter(S=>S.kind==="choice").map(S=>[S.id,la({...mu(0),presentation:S.presentation,questions:[S.choice]},S.document,a)])),[t.items,a]),x=(S=!1)=>g.map(w=>f.jsxs("div",{className:"exercise-pool-entry",children:[f.jsxs("div",{className:"exercise-flow-unit exercise-pool-option","data-pool-id":w.id,children:[S?"● ":"",w.label,". ",a?w.text:""]}),w.document&&f.jsx(Kl,{id:`pool/${w.id}`,label:`共享选项 ${w.label} 正文`,value:w.document,visible:a,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:T=>d({...t,pool:t.pool.map(j=>j.id===w.id?{...j,document:T}:j)})})]},w.id)),v=["fill","completion"].includes(r)&&(!a||t.items.every(S=>Cn(S.document)));if(r==="chunk"){let S=0;const w=t.chunkPoints.map(T=>{const j=t.chunkText.slice(S,T.offset);return S=T.offset,{text:j,...T}});return f.jsxs("div",{className:"exercise-content",children:[f.jsx(Kl,{id:"chunk-material",label:"断句题面",value:{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:w.map(T=>`${T.text}〔${T.label}〕`).join("")+t.chunkText.slice(S)||" "}]}]}},visible:a,readOnly:!0,placement:i,onUnits:u,onChange:()=>{},onActiveFragment:m}),f.jsxs("div",{className:"exercise-flow-unit exercise-chunk-answer",children:[t.chunkPoints.map(T=>f.jsx("span",{className:"exercise-mark","data-answer-id":T.id,children:T.label},T.id)),f.jsxs("span",{children:["(最多选 ",t.chunkMax," 处)"]})]})]})}return f.jsxs("div",{className:"exercise-content","data-exercise-kind":r,children:[v&&f.jsx("div",{className:"exercise-blanks",children:t.items.map(S=>f.jsxs(E.Fragment,{children:[S.blanks.map(w=>f.jsxs(E.Fragment,{children:[f.jsx(ob,{blank:w,item:S,active:S.id===l,fullLabel:!0}),w.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},w.id)),t.fillNewLine&&f.jsx("span",{className:"exercise-line-break"})]},S.id))}),r==="optional"&&f.jsxs("div",{className:"exercise-flow-unit exercise-optional-head",children:["从以下 ",t.items.length," 题中选做 ",t.chooseCount," 题",t.groupScore!==null?`,共 ${t.groupScore} 分`:"","。",f.jsxs("span",{children:["选做题号:",t.items.map(S=>f.jsx("span",{className:"exercise-mark","data-exercise-id":S.id,children:S.label},S.id))]})]}),["matching","ordering"].includes(r)&&a&&(r!=="matching"||t.matchingDisplay==="letters")&&x(),f.jsxs("div",{hidden:v,className:r==="matching"&&t.matchingDisplay==="lines"?"exercise-matching-layout":void 0,children:[f.jsx("div",{children:r==="ordering"?f.jsx("div",{children:t.ordering==="sequence"?f.jsxs("div",{className:"exercise-flow-unit exercise-sequence",children:["排序:",g.map((S,w)=>f.jsxs("span",{children:[f.jsx("span",{className:"exercise-order-slot","data-answer-id":S.id}),w<g.length-1?"→":""]},S.id))]}):t.categories.map(S=>f.jsxs("div",{className:"exercise-flow-unit exercise-category","data-category-id":S.id,children:[f.jsxs("span",{children:[S.label,". ",S.text]}),f.jsx("span",{})]},S.id))}):t.items.map(S=>{const w=S.id===l,T=b.get(S.id),j=!v&&(S.kind==="table"||a&&(!Cn(S.document)||!c&&(Cm.includes(r)||t.items.length>1||r==="matching")));return f.jsxs("div",{className:"exercise-item","data-exercise-item":S.id,children:[f.jsxs("div",{className:C(S.id,"exercise-item-heading"),"data-exercise-id":S.id,children:[f.jsxs("b",{children:[S.label,"."]}),S.score!==null&&f.jsxs("span",{children:["(",S.score," 分)"]}),r==="matching"&&t.matchingDisplay==="lines"&&f.jsx("span",{className:"exercise-connector",children:"●"})]}),f.jsx(Kl,{id:S.id,label:`小题 ${S.label} 正文`,value:S.document,visible:j,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:R=>d({...t,items:t.items.map(O=>O.id===S.id?{...O,document:R}:O)}),choiceFillPosition:T?.position,choiceFillBindings:T?.bindings,activeChoiceQuestionId:w?S.id:void 0}),(S.kind==="judge"||S.kind==="choice"&&!!T?.concentrated.questions.length)&&f.jsx("div",{className:C(S.id,"exercise-choices"),"data-exercise-id":S.id,children:(S.kind==="judge"?S.choice.options.slice(0,2):S.choice.options).map((R,O)=>f.jsx("span",{className:`exercise-mark${S.kind==="choice"||t.judgeLabels!=="words"?" exercise-choice-mark":""}`,"data-answer-id":R.id,children:S.kind==="judge"?wm[t.judgeLabels][O]:R.label},R.id))}),r==="matching"&&t.matchingDisplay==="letters"&&f.jsx("div",{className:C(S.id,"exercise-match-letters"),"data-exercise-id":S.id,children:f.jsx("span",{className:"exercise-order-slot"})}),r!=="matching"&&S.kind==="fill"&&!v&&f.jsx("div",{className:"exercise-blanks","data-new-line":t.fillNewLine,children:S.blanks.map(R=>f.jsxs(E.Fragment,{children:[f.jsx(ob,{blank:R,item:S,active:w}),R.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},R.id))}),S.steps.map(R=>f.jsxs("div",{className:C(S.id,"exercise-step"),"data-exercise-id":S.id,"data-step-id":R.id,children:[f.jsxs("span",{children:["(",R.label,") ",R.prompt,R.score!==null?`(${R.score} 分)`:""]}),f.jsx("span",{className:"exercise-step-answer"})]},R.id)),(["answer","calculation","correction","drawing","writing","english"].includes(S.kind)||S.kind==="judge"&&S.needsReason)&&f.jsx(JR,{area:S.area,item:S,active:w,readOnly:c,onResize:R=>d({...t,items:t.items.map(O=>O.id===S.id?{...O,area:{...O.area,rows:R}}:O)})})]},S.id)})}),r==="matching"&&t.matchingDisplay==="lines"&&f.jsx("div",{children:x(!0)})]}),r==="practice"&&f.jsxs("div",{className:"exercise-flow-unit exercise-evaluation",children:["评价意见:",f.jsx("span",{})]})]})}function ab({height:t,min:r,label:i,onChange:a}){const{scale:c}=ct(),l=E.useRef(null);return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":i,onPointerDown:u=>{u.preventDefault(),u.stopPropagation(),l.current={y:u.clientY,height:t},u.currentTarget.setPointerCapture(u.pointerId)},onPointerMove:u=>{l.current&&a(Math.max(r,Math.round(l.current.height+(u.clientY-l.current.y)/c)))},onPointerUp:u=>{l.current=null,u.currentTarget.releasePointerCapture(u.pointerId)},onLostPointerCapture:()=>{l.current=null},onPointerCancel:()=>{l.current&&a(l.current.height),l.current=null},onKeyDown:u=>{u.key==="Escape"&&l.current&&(a(l.current.height),l.current=null),["ArrowUp","ArrowDown"].includes(u.key)&&(u.preventDefault(),a(Math.max(r,t+(u.key==="ArrowDown"?10:-10))))}})}const tO="M1009 734Q994 750 972 750Q950 750 935 734L694 479L522 661Q507 677 485.5 677Q464 677 449 661Q434 645 434 622.5Q434 600 449 584L621 402L383 151L91 462Q76 478 54 478Q32 478 17 462Q2 446 1 423.5Q0 401 15 384L346 34Q361 19 382.5 19Q404 19 419 34L693 327L810 201Q825 186 847 186Q869 186 884 201.5Q899 217 899 239.5Q899 262 884 279L768 402L1009 656Q1024 672 1024 694.5Q1024 717 1009 734Z",nO="M585 384 860 659Q869 675 867 693Q865 711 852 724Q839 737 821 739Q803 741 787 732L512 457L237 734Q221 744 203 741.5Q185 739 172 726Q159 713 157 695Q155 677 164 661L439 384L162 109Q152 93 154.5 75Q157 57 170 44Q183 31 201 29Q219 27 235 36L512 311L787 36Q803 27 821 29Q839 31 852 44Q865 57 867 75Q869 93 860 109Z";function rO({question:t,part:r}){const i=!r&&t.parts.length>1;return f.jsx("div",{className:"reference-homework-marking",children:i?t.parts.map((a,c)=>f.jsxs("span",{"data-recognition":"Checkbox","data-recognition-role":"cell","data-answer-id":a.id,"data-value":String(c+1),children:["(",c+1,")"]},a.id)):[tO,nO].map((a,c)=>f.jsx("span",{"data-recognition":"ScoreBox","data-recognition-role":"cell","data-answer-id":r?.id||t.parts[0]?.id||t.id,"data-value":c===0?"partial":"incorrect",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 -128 1024 1024",children:f.jsx("path",{transform:"translate(0 768) scale(1 -1)",d:a,fill:"currentColor"})})},c))})}function nf({placement:t,children:r,className:i="",answerId:a,sectionType:c,questionIds:l,scope:u,footer:d}){const m=E.useRef(null),[p,C]=E.useState({top:0,height:0});return E.useLayoutEffect(()=>{const g=()=>{const{top:x,height:v}=rb(m.current);C(S=>S.top===x&&S.height===v?S:{top:x,height:v})};g();const b=new ResizeObserver(g);return b.observe(m.current),()=>b.disconnect()},[t.fragments,r]),f.jsxs("div",{ref:m,className:`reference-paper-frame ${i}`,"data-marking-frame":d?"":void 0,children:[r,d&&f.jsx("div",{className:"exercise-flow-unit reference-marking-space"}),t.fragments.map((g,b)=>{const x=Math.max(p.top,g.from),v=Math.min(p.top+p.height,g.to),S=x<=p.top+.5;return v>x&&f.jsx("div",{"aria-hidden":"true",className:"reference-paper-border","data-recognition":!S&&u!=="section"&&c?"FrameOnly":c,"data-recognition-scope":u,"data-answer-id":a,"data-question-ids":l?.join(","),"data-fragment":b,style:{left:g.x-t.x,top:x-p.top+g.y-t.y-g.from+(x>g.from&&g.topPadding||0),height:v-x+(x===g.from&&g.topPadding||0)+(v===g.to&&g.bottomPadding||0)},children:S&&d},b)})]})}function oO({score:t,halfPoint:r,active:i,id:a}){const{card:c}=ct();return!c.scanMarking&&t!==null&&t>0&&f.jsx("div",{className:`exercise-flow-unit reference-score-row${i?" is-current":""}`,"data-exercise-id":a,children:DS(t,r).map((l,u)=>f.jsx("span",{"data-recognition":l?"ScoreBox":void 0,"data-answer-id":a,"data-recognition-role":"cell","data-value":l,children:l},u))})}function rf({question:t,part:r,props:i,optional:a=!1}){const{card:c,geometry:l,scale:u,selectChoice:d}=ct(),{value:m,placement:p,width:C,readOnly:g,activeId:b,uploadImage:x,onUnits:v,onActiveFragment:S,onChange:w}=i,T=r?.id||t.id,j=r?.label||t.label,R=r?.score??t.score,O=c.usage==="homework"&&R===0,M=O&&!r&&t.type==="SHORTANSWER"&&!a,D=O&&!c.scanMarking,_=b===T||b===t.id,I=E.useRef(null),[B,H]=E.useState(0),[z,$]=E.useState(()=>window.devicePixelRatio||1);E.useEffect(()=>{if(t.type!=="CCOMPOSITION")return;const re=()=>$(window.devicePixelRatio||1);return window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[t.type]);const X=r?.document||t.document,G=re=>w({...m,questions:m.questions.map(ae=>ae.id===t.id?{...ae,...re}:ae)}),te=re=>G(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,document:re}:ae)}:{document:re}),V=a?m.optionalHeight:r?.height||t.height;E.useLayoutEffect(()=>{const re=I.current.querySelector(".reference-answer-body"),ae=()=>H(re.offsetHeight);ae();const ge=new ResizeObserver(ae);return ge.observe(re),()=>ge.disconnect()},[]);const Y=(re="")=>`exercise-flow-unit ${re}${_?" is-current":""}`,L=Math.max(0,V-B-(D?22:!c.scanMarking&&R!==null&&R>0?18:0)),P=NS(C),N=P*31+1,U=Math.max(1,Math.round(z))/(z*u),J=`M.5 .5H${N-.5}V32.5H.5Z`+Array.from({length:P-1},(re,ae)=>`M${(ae+1)*31+.5} .5V32.5`).join(""),Q=t.type==="CCOMPOSITION"?Math.ceil(t.characters/P):Math.ceil(L/40),le=re=>a?w({...m,optionalHeight:re}):G(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,height:re}:ae)}:{height:re});return f.jsx("div",{ref:I,className:"reference-answer","data-exercise-item":T,children:f.jsxs(nf,{placement:p,answerId:T,sectionType:c.scanMarking?"FrameOnly":M&&t.parts.length>1?"Checkbox":"ScoreBox",questionIds:a?m.questions.map(re=>re.id):void 0,className:t.type==="CCOMPOSITION"?"reference-composition":"",footer:D?f.jsx(rO,{question:t,part:r}):void 0,children:[f.jsx(oO,{score:R,halfPoint:t.halfPoint,active:_,id:T}),f.jsxs("div",{className:"reference-answer-body",children:[a&&f.jsxs("div",{className:Y("reference-optional-head"),style:{minHeight:l.columns===3?104:82},"data-exercise-id":T,children:[f.jsxs("p",{children:[f.jsx("b",{children:"选做题"}),"  请考生从给出的第",m.questions.map(re=>re.label).join("、"),of(m.questions.length),"题中任选",of(m.choose),"题作答,并用2B铅笔在答题卡上把所选题目对应的题号涂黑,注意所做题目的题号必须与所涂题号一致,如果多做,则按所做的",m.choose===1?"第一题":`前${of(m.choose)}题`,"计分。"]}),f.jsxs("p",{children:["我选做的题号是:",m.questions.map(re=>f.jsx("span",{"data-exercise-id":re.id,"data-recognition":"QuestionChoice","data-answer-id":re.id,"data-recognition-role":"cell","data-value":re.label,children:re.label},re.id))]})]}),f.jsx("div",{className:"reference-answer-text",style:{minHeight:t.type==="CCOMPOSITION"?t.contentHeight:void 0},children:(a?m.questions.map(re=>({item:re,entryPart:void 0})):M?t.parts.map(re=>({item:t,entryPart:re})):[{item:t,entryPart:r}]).map(({item:re,entryPart:ae})=>{const ge=a?re.parts[0]?.id||re.id:ae?.id||T,je=a?re.label:ae?.label||j,ye=a||!ae||re.parts[0]?.id===ae.id,de=m.textVersion===1&&m.type!=="MIXED"&&ye,Me=de&&i.showQuestion&&re.text,De=a?re.parts[0]?.document||re.document:ae?.document||X,we=Me?$r([...Ws(re.text,re.id,re.label),...re.type==="ECOMPOSITION"?(De.content.content||[]).slice(1):[]]):De;return f.jsx("div",{"data-exercise-id":ge,className:"reference-answer-entry",children:f.jsx(Kl,{id:`reference/${ge}`,label:`第 ${je} 题作答内容`,value:we,editorKeys:de?[re.id,ge]:[ge],contentTargets:Me?[{id:re.id,label:`第 ${re.label} 题题干`,kind:"question"}]:void 0,onContentSelect:xe=>d(i.blockId,xe),visible:!0,readOnly:g,placement:p,uploadImage:x,onUnits:v,onActiveFragment:S,onChange:Me?xe=>w({...m,questions:m.questions.map(Se=>Se.id===re.id?{...Se,text:Nm(Se.text,(xe.content.content||[]).filter(Bt=>Se.type!=="ECOMPOSITION"||Bt.attrs?.contentId===Se.id)),...Se.type==="ECOMPOSITION"?{document:$r([Se.document.content.content[0],...(xe.content.content||[]).filter(Bt=>Bt.attrs?.contentId!==Se.id)])}:{}}:Se)}):a?xe=>w({...m,questions:m.questions.map(Se=>Se.id===re.id?{...Se,document:xe,parts:Se.parts.map((Bt,ht)=>ht===0?{...Bt,document:xe}:Bt)}:Se)}):M&&ae?xe=>G({parts:t.parts.map(Se=>Se.id===ae.id?{...Se,document:xe}:Se)}):te})},ge)})})]}),Array.from({length:Q},(re,ae)=>f.jsx("div",{className:Y(`reference-answer-row ${t.type==="CCOMPOSITION"?"reference-character-row":""}`),"data-exercise-id":T,style:{height:t.type==="CCOMPOSITION"?39.5:Math.min(40,L-ae*40)},children:t.type==="CCOMPOSITION"&&f.jsxs("div",{className:"reference-character-grid",children:[f.jsx("svg",{"aria-hidden":"true",className:"reference-character-lines",width:N,height:"33",viewBox:`0 0 ${N} 33`,children:f.jsx("path",{d:J,fill:"none",stroke:"#000",strokeWidth:U,vectorEffect:"non-scaling-stroke",shapeRendering:"crispEdges"})}),Array.from({length:P},(ge,je)=>{const ye=ae*P+je+1;return f.jsx("span",{className:"reference-character","data-character":ye<=t.characters?ye:void 0,"data-padding":ye>t.characters||void 0,children:ye<=t.characters&&ye%100===0&&f.jsxs("small",{children:[ye,"字"]})},je)})]})},ae)),!g&&t.type!=="CCOMPOSITION"&&f.jsx(ab,{height:V,min:30,label:`调整第 ${j} 题作答高度`,onChange:le})]})})}function of(t){const r="零一二三四五六七八九";return t<10?r[t]:t<100?`${t<20?"":r[Math.floor(t/10)]}十${t%10?r[t%10]:""}`:t===100?"一百":String(t)}function aO(t){const{value:r,placement:i,activeId:a,concentrated:c}=t,{card:l}=ct(),u=new Set(c.questions.map(m=>m.id)),d=E.useMemo(()=>{const m=[];return r.questions.forEach(p=>{const C=Et(p.type)?"choice":Ei(p.type)?"fill":"answer",g=m.at(-1);C!=="answer"&&g?.category===C?g.questions.push(p):m.push({category:C,questions:[p]})}),m},[r.questions]);return r.optional&&r.questions.length>1?f.jsx("div",{className:"reference-content",children:f.jsx(rf,{question:r.questions[0],props:t,optional:!0})}):f.jsx("div",{className:"reference-content",children:d.map((m,p)=>f.jsxs(E.Fragment,{children:[m.category==="choice"&&ha({...r,questions:m.questions}).some(C=>u.has(C.id))&&f.jsx(nf,{placement:i,className:"reference-choice-frame",sectionType:"MultiChoice",scope:"section",answerId:`${t.blockId}/choice/${p}`,questionIds:m.questions.map(C=>C.id),children:f.jsx(tb,{activeQuestionId:m.questions.find(C=>C.id===a&&Be(C.type))?.parts[0]?.id||a,settings:{...c,questions:ha({...r,questions:m.questions}).filter(C=>u.has(C.id))}})}),m.category==="fill"&&f.jsx(nf,{placement:i,className:"reference-fill-frame",sectionType:"Checkbox",scope:"section",answerId:`${t.blockId}/fill/${p}`,questionIds:m.questions.map(C=>C.id),children:f.jsx("div",{className:"reference-fill-grid",children:m.questions.map(C=>f.jsxs(E.Fragment,{children:[C.parts.map(g=>f.jsxs(E.Fragment,{children:[f.jsxs("div",{className:`exercise-flow-unit reference-blank${l.scanMarking?" is-online":""}${a===C.id||a===g.id?" is-current":""}`,style:{width:`${g.width}%`},"data-exercise-id":g.id,"data-answer-id":g.id,"data-recognition":"Checkbox",children:[f.jsxs("span",{className:"reference-blank-number",children:[g.label,"."]}),f.jsx("span",{className:"reference-blank-line","data-recognition":"Checkbox","data-recognition-role":"line","data-answer-id":g.id}),!l.scanMarking&&f.jsx("span",{className:"reference-blank-score","data-recognition":"ScoreBox","data-recognition-role":"cell","data-answer-id":g.id})]}),g.breakAfter&&f.jsx("span",{className:"exercise-line-break"}),r.fillNewLine&&Be(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},g.id)),r.fillNewLine&&!Be(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},C.id))})}),m.category==="answer"&&m.questions.map(C=>C.type==="SHORTANSWER"&&!(l.usage==="homework"&&C.score===0)?C.parts.map(g=>f.jsx(rf,{question:C,part:g,props:t},g.id)):f.jsx(rf,{question:C,props:t},C.id)),p<d.length-1&&f.jsx("div",{className:"reference-section-gap"})]},m.questions[0].id))})}function ib({hidden:t=!1,block:r,index:i,placement:a,width:c,scale:l,selected:u,readOnly:d,showQuestion:m,activeChoiceId:p,uploadImage:C,registerEditor:g,onSelect:b,onActiveFragment:x,onSettings:v,onMeasure:S,onDocument:w,onHeight:T,onExercise:j,onReference:R}){const{card:O,geometry:M,selectChoice:D}=ct(),_=E.useMemo(()=>r.reference?K0(r):void 0,[r.id,r.reference]),I=E.useMemo(()=>r.reference?la({...r.reference.layout,questions:ha(r.reference)},r.document,m):r.kind==="choice"&&r.choices?la(r.choices,r.document,m):void 0,[r.reference,r.kind,r.choices,r.document,m]),H=!(r.reference?.textVersion===1&&r.reference.questions.length>0&&["SHORTANSWER","ECOMPOSITION","CCOMPOSITION"].includes(r.reference.type))&&!t&&r.id!==nr&&m&&(!d||!(r.exercise||r.reference)||!Cn(r.document)||!!I?.bindings.length),z=E.useRef(null),$=E.useCallback(he=>{z.current=he,g(r.id,he)},[r.id,g]),X=E.useMemo(()=>r.reference?TR(r.document,r.reference,c):r.document,[r.document,r.reference,c]);E.useEffect(()=>{z.current?.syncDocument(X)},[X]);const G=E.useRef(null),te=E.useRef(S);te.current=S;const V=E.useRef([]),Y=E.useRef(new Map),[L,P]=E.useState(0),[N,U]=E.useState(0),J=E.useRef(()=>{}),Q=he=>{const at=a.fragments.find(it=>he>=it.from-.5&&he<it.to-.5);return at?{x:at.x-a.x,y:at.y-a.y-at.from+(at.topPadding||0)}:{x:0,y:0}};J.current=()=>{const he=G.current,at=he?.querySelector(".card-question-document .rt-content");if(t||!he||!at)return;const it=nb(he.parentElement),Mt=H?it(at).top:0;P(_e=>Math.abs(_e-Mt)<.5?_e:Mt);const $n=H?V.current.map(_e=>({top:Mt+_e.top,bottom:Mt+_e.bottom})):[];Y.current.forEach(_e=>$n.push(..._e)),he.querySelectorAll(".card-choice-row, .exercise-flow-unit").forEach(_e=>{if(_e.offsetParent===null)return;const{top:St,height:On}=it(_e);$n.push({top:St,bottom:St+On});const Kt=Q(St);_e.style.translate=`${Kt.x}px ${Kt.y}px`}),he.querySelectorAll("[data-exercise-resize]").forEach(_e=>{const St=Q(it(_e).top);_e.style.translate=`${St.x}px ${St.y}px`});const to=he.querySelector(".card-answer-space:not(.card-answer-fragment)");if(to){const{top:_e,height:St}=it(to);U(Kt=>Math.abs(Kt-_e)<.5?Kt:_e);const On=r.kind==="fill"?40:28;for(let Kt=_e;Kt<_e+St;Kt+=On)$n.push({top:Kt,bottom:Math.min(Kt+On,_e+St)})}const Go=it(he),Er=he.querySelectorAll(".reference-character-row"),Gn=Er.length?it(Er[0]).top:void 0,At=Er.length?it(Er[Er.length-1]).top:void 0,Rn=Math.min(...$n.map(_e=>_e.bottom)),Ht=[...new Set($n.flatMap(_e=>[_e.top,_e.bottom]))].filter(_e=>_e>=Rn&&_e<Go.height&&!$n.some(St=>_e>St.top+.5&&_e<St.bottom-.5)).filter(_e=>At===void 0||_e<=At).sort((_e,St)=>_e-St),Ki=Array.from(he.querySelectorAll("[data-marking-frame]")).map(_e=>{const{top:St,height:On}=it(_e);return{from:St,to:St+On}});te.current({width:Go.width,height:Go.height,breaks:Ht,markingFrames:Ki,...Gn!==void 0?{compositionStart:Gn}:{}})};const le=E.useCallback(he=>{V.current=he,J.current()},[]),re=E.useCallback((he,at)=>{Y.current.set(he,at),J.current()},[]),ae=E.useMemo(()=>a.fragments.map(he=>({from:he.from-L,to:he.to-L,x:he.x-a.x,y:he.y-a.y-he.from+(he.topPadding||0)})),[a.fragments,a.x,a.y,L]);E.useLayoutEffect(()=>{J.current()},[a.fragments,r.answerHeight,r.choices,r.exercise,r.reference,m,H,t]);const ge=E.useRef(null),je=he=>{he.preventDefault(),he.stopPropagation(),he.currentTarget.focus(),ge.current={y:he.clientY,height:r.answerHeight},he.currentTarget.setPointerCapture(he.pointerId)},ye=he=>{ge.current&&T(Math.max(0,Math.min(800,Math.round(ge.current.height+(he.clientY-ge.current.y)/l))))},de=he=>{ge.current=null,he.currentTarget.releasePointerCapture(he.pointerId)},Me=()=>{ge.current&&T(ge.current.height),ge.current=null},De=he=>{he.key==="Escape"&&ge.current&&Me(),(he.key==="ArrowUp"||he.key==="ArrowDown")&&(he.preventDefault(),T(Math.max(0,Math.min(800,r.answerHeight+(he.key==="ArrowDown"?10:-10)))))};E.useEffect(()=>{const he=G.current;let at=0;const it=new ResizeObserver(()=>{cancelAnimationFrame(at),at=requestAnimationFrame(()=>J.current())});return it.observe(he),()=>{it.disconnect(),cancelAnimationFrame(at)}},[]);const we=Q(N+r.answerHeight-1),xe=`${we.x}px ${we.y}px`,Se=a.fragments.length>1,Bt=r.reference&&I&&f.jsx(aO,{blockId:r.id,showQuestion:m,value:r.reference,concentrated:O.mergeObjective&&r.id!==nr?{...I.concentrated,questions:[]}:I.concentrated,placement:a,width:c,readOnly:d,activeId:p,onUnits:re,onChange:R,onActiveFragment:x,uploadImage:C}),ht=r.reference&&(Et(r.reference.type)||r.id===nr);return f.jsx("article",{hidden:t,inert:a.page>0,"aria-hidden":a.page>0?!0:void 0,className:`card-question${u&&!d?" is-selected":""}${a.overflowing?" is-overflowing":""}${Se?" is-fragmented":""}${r.reference?.type==="CCOMPOSITION"?" is-composition":""}`,"data-block-id":r.id,"data-page":a.page+1,"data-column":a.column+1,style:{left:a.x,top:a.y,width:c,minHeight:!Se&&a.fragments[0]?.bottomPadding?a.height+a.fragments[0].bottomPadding:void 0,maxHeight:a.overflowing?a.available:void 0},onPointerDownCapture:()=>{d||b()},onFocusCapture:()=>{d||b()},"aria-label":r.title||`题块 ${i+1}`,children:f.jsxs("div",{className:"card-question-content",ref:G,children:[f.jsxs("div",{className:"card-question-heading",children:[f.jsx("h2",{children:d?r.title||`题块 ${i+1}`:f.jsx("button",{className:"card-question-title","aria-label":`设置题块 ${i+1}`,"aria-haspopup":"dialog",title:"打开题块设置",onClick:v,children:r.title||`题块 ${i+1}`})}),f.jsx("span",{children:String(i+1).padStart(2,"0")})]}),I&&!r.reference&&f.jsx(tb,{settings:I.concentrated,activeQuestionId:p}),ht&&Bt,f.jsx("div",{className:"card-question-document",hidden:!H,children:f.jsx(Vl,{ref:$,initialValue:r.document,readOnly:d||!H,uploadImage:C,ariaLabel:`题块 ${i+1} 正文`,onChange:w,pagination:{slices:ae,maxUnitHeight:M.contentHeight-80,onMeasure:le,onActiveSliceChange:x},choiceFillPosition:I?.position,choiceFillBindings:I?.bindings,activeChoiceQuestionId:p,contentTargets:_,allowContentAssignment:r.reference?.textVersion!==1,onContentSelect:he=>{he!==r.id&&D(r.id,he)}})}),!ht&&Bt,!r.reference&&r.exercise&&r.kind!=="choice"&&r.kind!=="area"&&f.jsx(eO,{value:r.exercise,kind:r.kind,placement:a,showQuestion:m,readOnly:d,activeId:p,onUnits:re,onChange:j,onActiveFragment:x,uploadImage:C}),!r.reference&&!r.exercise&&r.kind!=="choice"&&f.jsx("div",{className:`card-answer-space ${r.kind}${Se?" is-paginated-space":""}`,style:{height:r.answerHeight},"data-answer-height":r.answerHeight,children:!d&&f.jsxs("div",{className:"card-answer-controls",children:[f.jsx("span",{className:"card-answer-caption",style:{translate:xe},children:r.kind==="writing"?"作文格":"作答区域"}),f.jsx("button",{className:"card-height-handle","aria-label":`调整题块 ${i+1} 作答高度`,title:"上下拖动调整作答区;方向键微调,Esc 取消",style:{translate:xe},onPointerDown:je,onPointerMove:ye,onPointerUp:de,onPointerCancel:Me,onLostPointerCapture:()=>{ge.current=null},onKeyDown:De,children:f.jsx("span",{})})]})}),Se&&!r.reference&&!r.exercise&&r.kind!=="choice"&&a.fragments.map((he,at)=>{const it=Math.max(he.from,N),Mt=Math.min(he.to,N+r.answerHeight);return Mt>it&&f.jsx("div",{"aria-hidden":"true",className:`card-answer-space card-answer-fragment ${r.kind}`,style:{left:he.x-a.x,top:it+he.y-a.y-he.from,width:c,height:Mt-it,backgroundPositionY:`${N-it-1}px`}},at)})]})})}function sb({block:t,index:r,placement:i,onMeasure:a,onActiveFragment:c}){const{geometry:l,readOnly:u,selectedId:d,setSelectedId:m,updateBlock:p,registerEditor:C,uploadImage:g}=ct(),b=E.useRef(null),[x,v]=E.useState([]),S=E.useRef(null),w=E.useCallback(M=>{S.current=M,C(t.id,M)},[t.id,C]);E.useEffect(()=>{JSON.stringify(S.current?.getDocument())!==JSON.stringify(t.document)&&S.current?.syncDocument(t.document)},[t.document]);const T=Math.max(t.answerHeight,(x.at(-1)?.bottom||0)+12),j=E.useRef(a);j.current=a,E.useLayoutEffect(()=>{const M=(x.at(-1)?.bottom||0)+6,D=[...x.map(_=>_.bottom+6),...Array.from({length:Math.max(0,Math.floor((T-M)/40))},(_,I)=>M+(I+1)*40)];j.current({width:l.columnWidth,height:T,breaks:t.areaType==="forbiden"?[]:D})},[l.columnWidth,T,x,t.areaType]);const R=E.useMemo(()=>i.fragments.map(M=>({from:M.from-6,to:M.to-6,x:M.x-i.x,y:M.y-i.y-M.from})),[i]),O=i.fragments.at(-1);return f.jsxs("article",{inert:i.page>0,"aria-hidden":i.page>0?!0:void 0,className:`card-question card-area-block${d===t.id&&!u?" is-selected":""}${i.overflowing?" is-overflowing":""}${i.fragments.length>1?" is-fragmented":""}`,"data-block-id":t.id,"data-page":i.page+1,"data-column":i.column+1,"data-area-type":t.areaType,"aria-label":t.title,style:{left:i.x,top:i.y,width:l.columnWidth,height:T+(i.fragments.length===1&&O.bottomPadding||0),maxHeight:i.overflowing?i.available:void 0},onPointerDownCapture:()=>{u||m(t.id)},children:[i.fragments.map((M,D)=>f.jsx("div",{className:"card-area-border","data-recognition":t.areaType==="forbiden"?"Blank":"FrameOnly","data-answer-id":t.id,"data-fragment":D,style:{left:M.x-i.x,top:M.y-i.y,height:M.to-M.from+(M.bottomPadding||0),width:l.columnWidth}},D)),f.jsx("div",{className:"card-area-text",ref:b,children:f.jsx(Vl,{ref:w,initialValue:t.document,readOnly:u,ariaLabel:`题块 ${r+1} 区域文字`,uploadImage:g,onChange:M=>p(t.id,{document:M}),pagination:{slices:R,maxUnitHeight:l.contentHeight-12,onMeasure:v,onActiveSliceChange:c}})}),!u&&f.jsx("div",{className:"card-area-resize",style:{left:O.x-i.x,top:O.y-i.y+O.to-O.from+(O.bottomPadding||0)-12,width:l.columnWidth},children:f.jsx(ab,{height:t.answerHeight,min:100,label:"调整区域高度",onChange:M=>p(t.id,{answerHeight:Math.min(t.areaType==="forbiden"?l.contentHeight:4e3,M)})})})]})}function iO({block:t,onClose:r}){return f.jsx(DR,{children:f.jsx(sO,{block:t,onClose:r})})}function sO({block:t,onClose:r}){const{card:i,geometry:a,measurements:c,placementById:l,overflowById:u,draftQuestionMode:d,readOnly:m,registerEditor:p,updateBlock:C,uploadImage:g,selectedChoiceId:b,openSettings:x}=ct(),{setDialog:v,titleProps:S,cancelDrag:w}=ql(),[T,j]=E.useState(c[t.id]?.height||400),R=E.useCallback(H=>j(z=>Math.abs(z-H.height)<.5?z:H.height),[]),O=E.useMemo(()=>({id:t.id,page:0,column:0,x:0,y:0,height:T,available:T,overflowing:!1,fragments:[{page:0,column:0,x:0,y:0,from:0,to:T}]}),[t.id,T]),M=u.get(t.id)||l.get(t.id),D=M?.overflowFrom,_=M?.id===t.id&&(!d||i.questionCard||t.areaType)?D:D===void 0?void 0:0,I=i.blocks.findIndex(H=>H.id===t.id),B=()=>{r(),x(t.id)};return f.jsx(Vi,{open:!0,modal:!1,panelRef:v,className:"card-modal card-draft-modal",width:Math.min(window.innerWidth-32,a.columnWidth+48),zIndex:950,closeLabel:"关闭完整内容",closeIcon:f.jsx(eo,{name:"close",size:16}),onCancel:r,onOpenAutoFocus:H=>H.preventDefault(),onEscapeKeyDown:H=>{H.preventDefault(),H.stopPropagation(),w()||r()},title:f.jsxs("div",{...S,className:"card-modal-drag","aria-label":"拖动完整内容窗口",children:[f.jsx("h2",{children:"完整内容"}),f.jsx("p",{children:t.title})]}),footer:f.jsxs(f.Fragment,{children:[f.jsx("span",{role:"status",className:D===void 0?"card-draft-fits":"card-draft-warning",children:D===void 0?"已全部排入纸张":"有内容未排入纸张"}),!m&&f.jsx(ue,{type:"text",onClick:B,children:"题块设置"}),f.jsx(ue,{onClick:r,children:"关闭"})]}),children:f.jsxs("div",{className:"card-draft-canvas",style:{width:a.columnWidth,height:T},children:[t.kind==="area"?f.jsx(sb,{block:t,index:I,placement:O,onMeasure:R,onActiveFragment:()=>{}}):f.jsx(ib,{block:t,index:I,placement:O,width:a.columnWidth,scale:1,selected:!1,readOnly:m,showQuestion:d||i.questionCard!==!1,activeChoiceId:b(t),uploadImage:g,registerEditor:p,onSelect:()=>{},onActiveFragment:()=>{},onSettings:B,onMeasure:R,onDocument:H=>C(t.id,{document:H}),onHeight:H=>C(t.id,{answerHeight:H}),onExercise:H=>C(t.id,{exercise:H}),onReference:H=>C(t.id,{reference:H})}),_!==void 0&&f.jsx("div",{className:"card-draft-overflow-range","data-overflow-from":_,style:{top:Math.min(_,T),bottom:0},children:f.jsx("span",{children:_>0?"以下内容未排入纸张":"此题块有内容未排入纸张"})})]})})}function lO(){const{card:t,creationDictionary:r,saveMessage:i,saveAction:a,setCard:c,creationOpen:l,setCreationOpen:u,newCard:d,selectedId:m,setSelectedId:p,settingsId:C,setSettingsId:g,settingsAutoFocus:b,openSettings:x,draftBlockId:v,setDraftBlockId:S,openDraft:w,readOnly:T,setReadOnly:j,titleOverflow:R,deleted:O,setDeleted:M,overflow:D,overflowById:_,placementById:I,fitPage:B,moveBlock:H,selectBlock:z,download:$}=ct(),X=t.blocks.find(P=>P.id===C),G=t.blocks.find(P=>P.id===v),[te,V]=E.useState(!1),[Y,L]=E.useState(null);return f.jsxs("div",{className:"card-controls",children:[f.jsxs("aside",{className:"card-sidebar","aria-label":"制卡设置",children:[f.jsxs("div",{className:"card-panel-header",children:[f.jsx("strong",{children:"制卡设置"}),f.jsx("a",{"data-card-demo-link":"",href:"/rich-text",children:"富文本编辑 ↗"})]}),f.jsxs("div",{className:"card-panel-actions",children:[f.jsxs("div",{className:"card-mode","aria-label":"制卡模式",children:[f.jsx(ue,{type:"text","aria-pressed":!T,onClick:()=>j(!1),children:"编辑"}),f.jsx(ue,{type:"text","aria-pressed":T,onClick:()=>j(!0),children:"预览"})]}),f.jsxs(ue,{type:"text",onClick:$,className:"card-export",children:[f.jsx(eo,{name:"upload",size:15}),a]})]}),i&&f.jsx("div",{className:"card-overflow-notice",role:"status",children:i}),f.jsx("div",{className:"card-panel-fit",children:f.jsx(ue,{type:"text",onClick:B,children:"适合宽度"})}),D.length>0&&f.jsx("div",{className:"card-overflow-notice",role:"alert",children:"内容超出一张纸,暂不可保存或导出。请编辑标记的题块。"}),R&&f.jsx("div",{className:"card-overflow-notice",role:"alert",children:"卷头内容超出可用区域,请拖高标题或调整内容、版式。"}),f.jsxs("div",{className:"card-sidebar-section card-document-section",children:[f.jsx("strong",{className:"card-document-name",children:t.title||"未新建答题卡"}),t.creation&&f.jsxs("p",{className:"card-section-note",children:[t.creation.mode==="template"?"答题卡模板":"考试答题卡"," · ",t.creation.grade," · ",t.creation.subject]}),f.jsx(ue,{type:"text",className:"card-add-component",onClick:()=>u(!0),children:"新建答题卡"})]}),f.jsx(QR,{}),f.jsxs("div",{className:"card-sidebar-section card-outline-section",children:[f.jsxs("div",{className:"card-section-heading",children:[f.jsx("h2",{children:"题块"}),f.jsxs("span",{children:[t.blocks.length," 个"]})]}),f.jsx("p",{className:"card-section-note",children:"拖动列表调整顺序,点击打开题块设置"}),!t.blocks.length&&f.jsx("p",{className:"card-section-note",children:"从一道题开始,添加空白题块后编辑内容。"}),f.jsx("ol",{className:"card-outline",children:t.blocks.map((P,N)=>{const U=I.get(P.id),J=_.has(P.id);return f.jsxs("li",{className:m===P.id?"active":"",draggable:!T,onDragStart:Q=>{L(P.id),Q.dataTransfer.effectAllowed="move",Q.dataTransfer.setData("text/plain",P.id)},onDragEnd:()=>L(null),onDragOver:Q=>{!T&&Y&&Q.preventDefault()},onDrop:Q=>{Q.preventDefault(),Y&&!T&&H(Y,N),L(null)},children:[f.jsxs(ue,{type:"text",className:"card-outline-item","aria-haspopup":T?void 0:"dialog",onClick:()=>{T?z(P.id,!0):x(P.id)},children:[f.jsx("span",{className:"card-outline-number",children:String(N+1).padStart(2,"0")}),f.jsxs("span",{children:[f.jsx("strong",{children:P.title||jm[P.kind]}),f.jsx("small",{children:J?"有内容未排入纸张":`第 ${U.column+1} 栏`})]})]}),J&&f.jsx(ue,{type:"text",className:"card-open-draft","aria-label":`编辑题块 ${N+1} 完整内容`,onClick:()=>w(P.id),children:"查看完整内容"}),!T&&f.jsxs("div",{className:"card-reorder",children:[f.jsx(ue,{type:"text","aria-label":`上移题块 ${N+1}`,title:"上移",disabled:N===0,onClick:()=>H(P.id,N-1),children:"↑"}),f.jsx(ue,{type:"text","aria-label":`下移题块 ${N+1}`,title:"下移",disabled:N===t.blocks.length-1,onClick:()=>H(P.id,N+1),children:"↓"})]})]},P.id)})}),!T&&f.jsx("div",{className:"card-add",children:f.jsx(ue,{type:"text","aria-haspopup":"dialog",onClick:()=>V(!0),children:"+ 添加题块"})})]}),f.jsxs("div",{className:"card-sidebar-bottom",children:[f.jsx("span",{className:"card-version-dot"}),"自动排版已开启",f.jsx("span",{children:"连续换栏"})]})]}),l&&f.jsx(FR,{initial:KR(r),dictionary:r,replacing:!!(t.paperTitle||t.blocks.length),onCreate:d,onClose:()=>u(!1)}),X&&!T&&f.jsx(XR,{block:X,autoFocus:b,onClose:()=>g(null)}),G&&f.jsx(iO,{block:G,onClose:()=>S(null)},G.id),te&&!T&&!l&&f.jsx(LR,{creation:t.creation,questionCard:t.questionCard,onClose:()=>V(!1),onAdd:P=>{const N=P==="forbiden"||P==="editArea"?xS(P):_m(P);c(U=>{const J=[...U.blocks],Q=J.findIndex(le=>le.id===m);return J.splice(Q>=0?Q+1:J.length,0,N),{...U,blocks:J}}),V(!1),x(N.id)}}),O&&f.jsxs("div",{className:"card-toast",role:"status",children:["题块已删除",f.jsx(ue,{type:"text",onClick:()=>{c(P=>{const N=[...P.blocks];return N.splice(O.index,0,O.block),{...P,blocks:N}}),p(O.block.id),M(null)},children:"撤销"}),f.jsx(ue,{type:"text","aria-label":"关闭删除提示",onClick:()=>M(null),children:f.jsx(eo,{name:"close",size:14})})]})]})}function lb({seat:t=!1}){return f.jsx("div",{className:"card-student-fields",children:["姓名","班级","学号",...t?["考场/座位号"]:[]].map(r=>f.jsxs("div",{children:[f.jsxs("span",{children:[r,":"]}),f.jsx("i",{})]},r))})}function af(){return f.jsxs("div",{className:"card-barcode-area","data-recognition":"StudentId","data-value":"barcode",children:[f.jsx("div",{children:"贴条形码区"}),f.jsx("small",{children:"正面朝上,切勿贴出虚线方框"})]})}function Fl(){return f.jsxs("div",{className:"card-header-marks",children:[f.jsxs("div",{children:["正确填涂:",f.jsx("i",{className:"filled"})]}),f.jsxs("div",{"data-recognition":"IgnoreFlag",children:["缺考标记:",f.jsx("i",{"data-recognition-cell":"absent"})]})]})}function cb({marks:t,focusText:r}){return f.jsxs("div",{className:"card-attentions",children:[r&&f.jsxs("div",{className:"card-attention-box",children:[f.jsx("div",{children:"注意事项"}),f.jsxs("section",{children:[f.jsx("p",{children:"1.答题前请将姓名、班级和准考证号(或学号)填写清楚并填涂完整。"}),f.jsx("p",{children:"2.客观题答题必须使用2B铅笔填涂,修改时用橡皮擦干净。主观题答题必须使用黑色签字笔书写。"}),f.jsx("p",{children:"3.请在规定区域内答题,超出答题区域书写无效。"})]})]}),t&&f.jsx(Fl,{})]})}function cO({settings:t,columns:r,pointBlack:i}){const a=t.kaohao==="school"&&t.weishu>9,c=!t.mifeng&&r===3||a,l=r!==3&&t.focusText&&t.missExam&&!t.mifeng&&t.kaohao==="code",u=r===3&&t.missExam&&!t.mifeng&&t.kaohao==="code",d=r===3&&t.missExam&&!t.mifeng&&t.kaohao==="school"&&[8,9].includes(t.weishu),m=r===3&&t.focusText&&t.missExam&&t.mifeng&&t.kaohao==="school"&&[8,9].includes(t.weishu),p=r!==3&&t.missExam&&!t.mifeng&&a,C=t.missExam&&!l&&!u&&!d&&!m&&!p,g=t.focusText||C;return f.jsxs("div",{className:"card-header-fields",children:[f.jsxs("div",{className:`card-header-left${t.mifeng&&(t.kaohao==="code"||a)?" full-width":""}`,children:[!t.mifeng&&f.jsx(lb,{seat:t.writeKaohao}),(d||p)&&f.jsx(Fl,{}),!c&&g&&f.jsx(cb,{focusText:t.focusText,marks:C})]}),f.jsxs("div",{className:"card-header-number",children:[t.kaohao==="school"&&f.jsxs("div",{className:`card-exam-number${i&&t.weishu>=8?" with-reference-points":""}`,"data-recognition":"StudentId","data-value":String(t.weishu),"aria-label":`${t.weishu}位准考证号码`,children:[f.jsx("div",{className:"card-exam-number-heading",children:"准考证号码"}),f.jsx("div",{className:"card-exam-number-columns",children:Array.from({length:t.weishu},(b,x)=>f.jsxs("div",{className:"card-exam-number-column",children:[f.jsx("div",{className:"card-exam-number-input"}),Array.from({length:10},(v,S)=>f.jsxs("div",{className:"card-exam-number-digit","data-recognition-cell":`${x+1}:${S}`,children:["[",f.jsx("span",{children:S}),"]",i&&x===7&&(S===0||S===9)&&f.jsx("i",{className:`card-reference-point ${S===0?"top":"bottom"}`,"data-recognition":"ReferencePoint"})]},S))]},x))})]}),t.kaohao==="code"&&!t.mifeng&&f.jsx(af,{}),(l||u)&&f.jsx(Fl,{})]}),m&&f.jsx(Fl,{}),c&&g&&f.jsx(cb,{focusText:t.focusText,marks:C})]})}function uO({settings:t,back:r}){return f.jsxs("div",{className:`card-seal-line${r?" back":""}`,children:[f.jsx("span",{className:"card-seal-label",children:"密封线"}),!r&&f.jsxs("div",{className:`card-seal-details${t.kaohao==="code"?" with-barcode":""}`,children:[f.jsx(lb,{seat:t.writeKaohao}),t.kaohao==="code"&&f.jsx(af,{})]})]})}function ub({kind:t}){const r=t==="ClassId"?"班级":"学号";return f.jsxs("div",{className:"card-homework-id","data-recognition":t,"data-value":"2","aria-label":`${r}填涂区`,children:[f.jsxs("span",{className:"card-homework-id-label",children:[r,f.jsx("br",{}),"填涂:"]}),f.jsx("div",{className:"card-homework-digits",children:["十位","个位"].map((i,a)=>f.jsxs("div",{className:"card-homework-digit-row",children:[f.jsx("span",{className:"card-homework-place",children:i}),Array.from({length:10},(c,l)=>f.jsx("span",{className:"card-homework-digit",children:f.jsxs("i",{"data-recognition-cell":`${a+1}:${9-l}`,children:["[",f.jsx("span",{children:9-l}),"]"]})},l))]},i))})]})}function dO({settings:t,columns:r}){return f.jsxs("div",{className:`card-homework-header${r===3?" three":""}`,children:[f.jsx("div",{className:"card-homework-student",children:["姓名","班级","学号"].map(i=>f.jsxs("div",{children:[i,":",f.jsx("i",{})]},i))}),t.tiaomaStyle===2?f.jsx(af,{}):f.jsxs("div",{className:"card-homework-number",children:[t.classText!==!1&&f.jsx(ub,{kind:"ClassId"}),f.jsx(ub,{kind:"StudentId"})]})]})}function fO({title:t,page:r=0}){const{card:i,setCard:a,readOnly:c,geometry:l,scale:u,setTitleMeasurement:d,uploadImage:m,registerEditor:p}=ct(),C=E.useRef(null),g=E.useRef(null),b=E.useRef(null);E.useEffect(()=>{const w=`title/${t.id}/${r}`;return p(w,b.current),()=>p(w,null)},[t.id,r,p]);const x=E.useRef(null),v=E.useCallback(()=>{const w=C.current,T=g.current;if(!w||!T||r!==0)return;const j={id:t.id,width:w.offsetWidth,height:w.offsetHeight,overflowing:w.scrollHeight>w.clientHeight+1||T.scrollHeight>T.clientHeight+1};d(R=>R?.id===j.id&&R.width===j.width&&R.height===j.height&&R.overflowing===j.overflowing?R:j)},[t.id,r,d]);E.useLayoutEffect(()=>{const w=new ResizeObserver(v);return w.observe(C.current),w.observe(g.current),v(),()=>w.disconnect()},[v]),E.useEffect(()=>{b.current?.getDocument()&&JSON.stringify(b.current.getDocument())!==JSON.stringify(t.document)&&b.current.setDocument(t.document)},[t.document]);const S=w=>a(T=>T.paperTitle?.id===t.id?{...T,paperTitle:{...T.paperTitle,height:Math.max(24,Math.min(90,Math.round(w)))}}:T);return f.jsxs("div",{ref:C,className:"card-paper-header","data-header-page":r+1,style:{top:r*(l.height+Oo)+l.topInset,left:l.columnX(r,0),width:l.titleWidth,maxHeight:l.contentHeight,paddingBottom:i.header?10:Si},children:[f.jsxs("div",{className:"card-paper-title",style:{height:t.height},children:[f.jsx("div",{ref:g,className:"card-paper-title-body",children:f.jsx(Vl,{ref:b,initialValue:t.document,readOnly:c,uploadImage:m,ariaLabel:r?`第 ${r+1} 面纸面标题`:"纸面标题",onLayout:v,onChange:w=>a(T=>T.paperTitle?.id===t.id&&JSON.stringify(T.paperTitle.document)!==JSON.stringify(w)?{...T,paperTitle:{...T.paperTitle,document:w}}:T)})}),!c&&f.jsx("button",{className:"card-title-height-handle","aria-label":"调整标题高度",title:"调整输入框高度",onPointerDown:w=>{w.button===0&&(w.preventDefault(),w.stopPropagation(),x.current={y:w.clientY,height:t.height},w.currentTarget.setPointerCapture(w.pointerId))},onPointerMove:w=>{x.current&&S(x.current.height+(w.clientY-x.current.y)/u)},onPointerUp:w=>{x.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId)},onPointerCancel:()=>{x.current&&S(x.current.height),x.current=null},onLostPointerCapture:()=>{x.current=null},onKeyDown:w=>{w.key==="Escape"&&x.current&&(S(x.current.height),x.current=null),(w.key==="ArrowUp"||w.key==="ArrowDown")&&(w.preventDefault(),S(t.height+(w.key==="ArrowDown"?2:-2)))},children:f.jsx("span",{children:"↕"})})]}),i.header&&(i.usage==="homework"?f.jsx(dO,{settings:i.header,columns:l.columns}):f.jsx(cO,{settings:i.header,columns:l.columns,pointBlack:i.recognition?.pointBlack}))]})}function hO({value:t,left:r,top:i}){const a=E.useMemo(()=>{try{return Hm(t)}catch{return null}},[t]);return a&&f.jsxs("svg",{className:"card-exam-qr","data-recognition":"ExamQrCode","data-value":t,"aria-label":"试卷二维码",style:{left:r,top:i},width:"40",height:"40",viewBox:`0 0 ${a.count} ${a.count}`,shapeRendering:"crispEdges",children:[f.jsx("rect",{width:a.count,height:a.count,fill:"white"}),f.jsx("path",{d:a.path,fill:"black"})]})}const mO=["topLeft","topRight","bottomLeft","bottomRight"];function pO({card:t,geometry:r,page:i,pageCount:a}){const c=r.columnX(i,0),l=r.columnX(i,r.columns-1)+r.columnWidth,u=r.topInset-31,d=r.height-r.bottomInset+16,m=kS(i+1),p=Dm(t.creation),C=p&&Tu[p],g=t.recognition?.examQrCode&&t.creation?.exampaperId!==void 0&&i%2===0,b=x=>({left:x%2?l-(x<2?26:13):c,top:x<2?u:d,width:x<2?26:13,height:x<2?13:26});return f.jsxs(E.Fragment,{children:[mO.map((x,v)=>f.jsx("div",{className:"card-registration-mark","data-anchor":x,style:b(v)},x)),a>1&&m&&f.jsx("div",{className:"card-code-marks","data-recognition":"PageCode","data-value":String(i+1),"aria-label":`纸面识别 ${i+1}`,style:{left:c+Math.max(30,r.columnWidth-180),top:d-14},children:[...m].map((x,v)=>f.jsx("i",{"data-value":x,"data-recognition-cell":String(v+1),className:x==="1"?"is-filled":""},v))}),i%2===0&&t.recognition?.subjectMarkers!==!1&&C&&f.jsx("div",{className:"card-code-marks","data-recognition":"SubjectCode","data-value":p,"aria-label":"学科识别标记",style:{left:r.columnX(i,r.columns>1?1:0)+Math.min(100,Math.max(30,r.columnWidth-140)),top:d-14},children:[1,2,3,4].map(x=>f.jsx("i",{"data-value":C.includes(x)?"1":"0","data-recognition-cell":String(x),className:C.includes(x)?"is-filled":""},x))}),g&&f.jsx(hO,{value:String(t.creation.exampaperId),left:r.columns===1?c+(r.columnWidth-40)/2:c+r.columnWidth-40,top:r.topInset-56})]})}function gO(){const{card:t,paperRoot:r,paperBlocks:i,selectedId:a,setSelectedId:c,selectedChoiceId:l,selectChoice:u,settingsId:d,openSettings:m,openDraft:p,overflow:C,overflowById:g,registerEditor:b,editingQuestionId:x,setMeasurements:v,readOnly:S,scale:w,geometry:T,pageCount:j,totalHeight:R,placementById:O,updateBlock:M,uploadImage:D}=ct(),_=E.useRef(null),[I,B]=E.useState(null),H=(L,P)=>B(N=>N?.id===L&&N.index===P?N:{id:L,index:P}),z=L=>{const P=L instanceof Element?L.closest("[data-block-id], [data-block-fragment]"):null;return P?.dataset.blockId||P?.dataset.blockFragment},$=t.blocks.find(L=>L.id===d),X=$&&l($),G=i.find(L=>L.id===nr),te=G?.reference&&X&&el(G.reference).some(L=>L.id===X)?$:t.blocks.find(L=>L.reference?.questions.some(P=>Et(P.type))),V=G?[G,...t.blocks.map(L=>i.find(P=>P.id===L.id)||L)]:i,Y=L=>L===nr&&te?.id||L;return f.jsxs("div",{ref:r,className:"card-sheet-stack",style:{width:T.width,height:R},onPointerDownCapture:L=>{const P=z(L.target);_.current=!S&&L.button===0&&P?{id:P,x:L.clientX,y:L.clientY}:null},onPointerCancelCapture:()=>{_.current=null},onClickCapture:L=>{const P=_.current;if(_.current=null,!S&&L.button===0&&P&&z(L.target)===P.id&&Math.hypot(L.clientX-P.x,L.clientY-P.y)<5){const N=L.target instanceof Element?L.target.closest("[data-question-id], [data-fill-question-id], [data-exercise-id], [data-exercise-item], [data-answer-id], [data-content-id]"):null,U=N?.dataset.answerId||N?.dataset.questionId||N?.dataset.fillQuestionId||N?.dataset.exerciseId||N?.dataset.exerciseItem||N?.dataset.contentId,J=t.blocks.find(Q=>U&&Q.reference&&el(Q.reference).some(le=>le.id===U))||t.blocks.find(Q=>Q.id===Y(P.id));U&&(J?.reference?el(J.reference):J?.choices?.questions||J?.exercise?.items)?.some(Q=>Q.id===U)&&u(J.id,U),m(J?.id||Y(P.id),!1)}},children:[Array.from({length:j},(L,P)=>f.jsxs("div",{className:"card-sheet","data-paper-page":P+1,style:{top:P*(T.height+Oo),width:T.width,height:T.height},children:[t.header&&f.jsx(pO,{card:t,geometry:T,page:P,pageCount:j}),t.header&&!S&&Array.from({length:T.columns},(N,U)=>f.jsx("div",{className:"card-column-guide",style:{left:T.columnX(P,U),width:T.columnWidth,top:T.topInset,bottom:T.bottomInset}},U)),t.usage!=="homework"&&t.header?.mifeng&&f.jsx("div",{className:"card-seal",style:{left:P%2===0?T.margin:T.width-T.margin-T.sealWidth,width:T.sealWidth},children:f.jsx(uO,{settings:t.header,back:P%2!==0})}),t.header&&Array.from({length:T.columns},(N,U)=>f.jsx("div",{className:"card-paper-footer",style:{left:T.columnX(P,U),width:T.columnWidth,bottom:20},children:f.jsxs("span",{children:["第",P*T.columns+U+1,"页   共",j*T.columns,"页"]})},U))]},P)),t.paperTitle&&Array.from({length:j},(L,P)=>T.hasHeader(P)&&f.jsx(fO,{title:t.paperTitle,page:P},`${t.paperTitle.id}/${P}`)),f.jsxs("div",{className:"card-paper-content",style:{width:T.width,height:T.height-T.bottomInset},children:[i.flatMap(L=>{const P=O.get(L.id).fragments,N=I?.id===L.id?Math.min(I.index,P.length-1):0;return P.length>1?P.map((U,J)=>U.page<j&&f.jsx("div",{className:`card-fragment-frame${a===Y(L.id)&&!S&&J===N?" is-selected":""}`,"data-block-fragment":L.id,"data-page":U.page+1,"data-column":U.column+1,style:{left:U.x,top:U.y,width:T.columnWidth,height:U.to-U.from+(U.topPadding||0)+(U.bottomPadding||0)},onPointerDown:()=>{S||(H(L.id,J),c(Y(L.id)))}},`${L.id}/${J}`)):[]}),V.map((L,P)=>{const N=U=>v(J=>{const Q=J[L.id];return Q&&Q.compositionStart===U.compositionStart&&JSON.stringify(Q.markingFrames)===JSON.stringify(U.markingFrames)&&Math.abs(Q.width-U.width)<.5&&Math.abs(Q.height-U.height)<.5&&JSON.stringify(Q.breaks)===JSON.stringify(U.breaks)?J:{...J,[L.id]:U}});return L.kind==="area"?f.jsx(sb,{block:L,index:P,placement:O.get(L.id),onMeasure:N,onActiveFragment:U=>H(L.id,U)},L.id):f.jsx(ib,{hidden:!i.some(U=>U.id===L.id),block:L,index:P,placement:O.get(L.id),width:T.columnWidth,scale:w,selected:a===Y(L.id),readOnly:S,activeChoiceId:!S&&d===Y(L.id)?l(t.blocks.find(U=>U.id===Y(L.id))||L):void 0,showQuestion:t.questionCard!==!1||!S&&x===L.id,registerEditor:b,uploadImage:D,onSelect:()=>c(Y(L.id)),onActiveFragment:U=>H(L.id,U),onSettings:()=>{H(L.id,0),m(Y(L.id))},onDocument:U=>M(L.id,{document:U}),onHeight:U=>M(L.id,{answerHeight:U}),onExercise:U=>M(L.id,{exercise:U}),onReference:U=>{L.id!==nr&&M(L.id,{reference:U})},onMeasure:N},L.id)})]}),C.length>0&&f.jsx("button",{type:"button",className:"card-paper-capacity-notice",style:{right:T.margin+22,top:Math.min(T.height-T.bottomInset+2,T.height-22),maxWidth:T.columnWidth*.5},onClick:()=>{const L=g.keys().next().value;L&&p(L)},children:"还有内容未排入纸张 · 查看"})]})}const yO=()=>{const{navigatorVisible:t}=Uo(),{geometry:r,totalHeight:i,readOnly:a,pageCount:c,card:l,setSelectedId:u}=ct();return f.jsxs("div",{className:`${pA["portal-wrapper"]} card-workspace`,id:"uni-answer-sheet","data-mode":a?"preview":"edit",children:[f.jsx(vR,{width:r.width,height:i,onBackgroundClick:()=>u(null),children:f.jsx(gO,{})}),f.jsx(lO,{}),f.jsx(yR,{summary:`${c} 页 · ${l.blocks.length} 个题块`}),t&&f.jsx(SR,{})]})},$o=t=>structuredClone(t),db=t=>{const r=$o(t);return delete r.recognitionData,r};function fb(){return new Promise(t=>{const r=()=>{clearTimeout(a),cancelAnimationFrame(i),t()},i=requestAnimationFrame(r),a=setTimeout(r,50)})}function bO(t,r,i,a,c){i.initialValue&&ju(i.initialValue,r);let l=i,u=i.initialValue&&db(i.initialValue),d=0,m,p,C=!1,g;const b=nC.createRoot(t,{onUncaughtError:c});function x({readOnly:D}){const _=ct();return E.useLayoutEffect(()=>{m=_,a()}),E.useEffect(()=>{_.setReadOnly(!!D)},[D]),E.useEffect(()=>{if(p===_.card)return;const I=!p;p=_.card,I||l.onChange?.($o(_.card))},[_.card]),null}const v=()=>{if(C||!m)throw new Error("制卡实例尚未就绪或已经销毁");return m},S=(D,_,I)=>({code:D,path:"",message:_,...I}),w=async()=>{const D=Date.now()+8e3;let _="",I=0,B="LAYOUT_PENDING";for(;Date.now()<D;){await fb();const H=v();if(!t.isConnected||t.clientWidth<100||t.clientHeight<100)return{value:H,issues:[S("LAYOUT_UNAVAILABLE","请显示制卡容器并为其设置有效的宽高后再保存")]};const z=[...new Set(H.editors.current.values())].map(Y=>Y.getStatus());B=z.some(Y=>Y.composing||Y.uploading)?"EDITOR_BUSY":"LAYOUT_PENDING";const $=z.every(Y=>Y.ready&&!Y.composing&&!Y.uploading&&!Y.layoutPending);if($&&H.editingQuestionId&&!H.card.questionCard){H.finishQuestionEditing(),I=0;continue}const X=H.paperBlocks.every(Y=>{const L=H.measurements[Y.id];return L&&Math.abs(L.width-H.geometry.columnWidth)<1&&L.height>0})&&(!H.card.paperTitle||H.titleMeasurement?.id===H.card.paperTitle.id&&Math.abs(H.titleMeasurement.width-H.geometry.titleWidth)<1),G=Array.from(t.querySelectorAll("img[src], img[srcset]")).filter(Y=>Y.getClientRects().length),te=G.every(Y=>Y.complete),V=JSON.stringify([H.card,H.measurements,H.titleMeasurement,H.placements]);if($&&X&&te&&document.fonts.status==="loaded"&&V===_?I++:I=0,_=V,I>=4){const Y=[];return z.forEach(L=>{L.uploadError&&Y.push(S("IMAGE_UPLOAD_FAILED",L.uploadError))}),G.some(L=>!L.naturalWidth)&&Y.push(S("IMAGE_LOAD_FAILED","有图片加载失败,请检查图片地址")),H.titleOverflow&&Y.push(S("TITLE_OVERFLOW","纸面标题超出可用区域",{path:"paperTitle"})),H.overflowById.forEach((L,P)=>Y.push(S("CONTENT_OVERFLOW","内容超出一张纸,请调整未排入纸张的题块后再保存",{path:"blocks",blockId:P}))),H.paperRoot.current?.querySelectorAll(".rt-content").forEach(L=>{if(!L.getClientRects().length||L.closest("[hidden]"))return;const P=L.closest("[data-block-id]")?.dataset.blockId,N=P&&H.placementById.get(P);(!N||N.fragments.length===1)&&L.scrollWidth>L.clientWidth+2&&Y.push(S("CONTENT_OVERFLOW","内容超过输入区域宽度",{path:"blocks",...P?{blockId:P}:{}}))}),{value:H,issues:Y}}}return{value:v(),issues:[S(B,B==="EDITOR_BUSY"?"输入法输入或图片上传尚未结束,请完成后再保存":"字体、图片或分页尚未稳定,请稍后重试")]}},T=async()=>{try{const{issues:D,value:_}=await w(),B=[...qS(_.card,r).issues,...D];let H;if(!B.length)try{H=_.getRecognitionData()}catch(z){B.push(S(z instanceof wr?z.code:"RECOGNITION_FAILED",z instanceof Error?z.message:"识别坐标生成失败"))}return{value:_,recognitionData:H,result:{valid:B.length===0,issues:B}}}catch(D){if(C)throw D;return{value:v(),result:{valid:!1,issues:[S("EDITOR_ERROR",D instanceof Error?D.message:"编辑器或数据校验失败")]}}}},j=async()=>(await T()).result,R=()=>g||(g=(async()=>{const{result:D,value:_,recognitionData:I}=await T();if(v(),!D.valid)return{ok:!1,issues:D.issues};try{return{ok:!0,data:$o({..._.card,..._.getReferenceData(),recognitionData:I})}}catch(B){return{ok:!1,issues:[S("EXPORT_FAILED",B instanceof Error?B.message:"题卡数据转换失败")]}}})().finally(()=>{g=void 0})),O=()=>b.render(f.jsx(mA,{children:f.jsxs(IR,{editorPlugin:r,uploadImage:l.uploadImage,dictionaries:l.dictionaries,initialValue:u,onSave:()=>{v().setSaveMessage("正在校验…"),R().then(D=>{v().setSaveMessage(D.ok?"已生成保存数据":D.issues[0].message),l.onSave?.(D)}).catch(D=>{C||v().setSaveMessage("保存失败"),l.onError?.(D)})},children:[f.jsx(x,{readOnly:l.readOnly}),f.jsx(yO,{})]},d)}));O();const M=async D=>{ju(D,r);const _=db(D);v(),u=_;const I=++d;Yr.flushSync(O);const B=Date.now()+8e3;do{await fb();const H=v();if(I!==d)throw new DOMException("回显已被另一张题卡替换","AbortError");if([...H.editors.current.values()].every(z=>z.getStatus().ready))return}while(Date.now()<B);throw new Error("题卡数据已载入,但编辑器未能及时就绪")};return{isReady:()=>!!m&&!C,getDocument:()=>$o(v().card),setDocument:M,newDocument:D=>M(bu(D)),getReferenceData:()=>$o(v().getReferenceData()),setReferenceData:D=>M({...v().card,blocks:Q0($o(D),r.html)}),validate:j,save:R,async getRecognitionData(){const D=await T();if(!D.result.valid)throw new pa(D.result.issues);return $o(D.recognitionData)},focusIssue:D=>{if(!D.blockId)return;const _=v();_.overflowById.has(D.blockId)?_.openDraft(D.blockId):(_.selectBlock(D.blockId,!0),_.openSettings(D.blockId,!1))},update(D){l=D,O()},destroy(){C||(C=!0,b.unmount(),m=void 0)}}}const xO=Object.freeze(Object.defineProperty({__proto__:null,mountAnswerSheet:bO},Symbol.toStringTag,{value:"Module"}));return nt.AnswerSheetDataError=pa,nt.createAnswerSheet=XS,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"}),nt})({});