uni-answer-sheet 2.0.0 → 2.1.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,4 +1,6 @@
1
- var kM=Object.defineProperty;var ES=nt=>{throw TypeError(nt)};var HM=(nt,st,It)=>st in nt?kM(nt,st,{enumerable:!0,configurable:!0,writable:!0,value:It}):nt[st]=It;var Qh=(nt,st,It)=>HM(nt,typeof st!="symbol"?st+"":st,It),TS=(nt,st,It)=>st.has(nt)||ES("Cannot "+It);var Ht=(nt,st,It)=>(TS(nt,st,"read from private field"),It?It.call(nt):st.get(nt)),jS=(nt,st,It)=>st.has(nt)?ES("Cannot add the same private member more than once"):st instanceof WeakSet?st.add(nt):st.set(nt,It),Zh=(nt,st,It,jl)=>(TS(nt,st,"write to private field"),jl?jl.call(nt,It):st.set(nt,It),It);var UniAnswerSheet=(function(nt){"use strict";var pt,on;function st(n,r){for(var l=0;l<r.length;l++){const a=r[l];if(typeof a!="string"&&!Array.isArray(a)){for(const c in a)if(c!=="default"&&!(c in n)){const s=Object.getOwnPropertyDescriptor(a,c);s&&Object.defineProperty(n,c,s.get?s:{enumerable:!0,get:()=>a[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const It=["pagination","content-identity","choice-fill","answer-regions","html-codec","status"];function jl(n){const r=n.filter(a=>a?.kind==="answer-sheet-editor");if(r.length!==1)throw new Error("请显式注册一个富文本插件:plugins: [createEditorPlugin()]");const l=r[0];if(l.apiVersion!==1||l.documentVersion!==1||It.some(a=>!l.capabilities?.includes(a))||typeof l.prepare!="function"||typeof l.create!="function"||typeof l.validateDocument!="function"||typeof l.html?.parse!="function"||typeof l.html?.serialize!="function")throw new Error("富文本插件协议不兼容,需要支持制卡协议 v1 的 uni-editor/plugin");return l}function Ol(n){const r=[],l=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,s)=>({id:c.attrs?.id,label:String.fromCharCode(65+s)})).filter(c=>typeof c.id=="string")});return}a.content?.forEach(l)};return l(n.content),r}class Uc extends Error{constructor(r,l){super(l),this.path=r}}const Hn=(n,r)=>{throw new Uc(n,r)},Rl={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",科学:"SCIENCE",物理:"PHYSICAL",化学:"CHEMICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",历史:"HISTORY",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",信息科技:"IT",信息技术:"IT",日语:"JAPANESE"},OS={P:["语文","数学","英语","科学","道德与法治"],J:["语文","数学","英语","物理","化学","生物","地理","历史","道德与法治","信息科技"],S:["语文","数学","英语","物理","化学","生物","政治","历史","地理","信息技术","日语"]},RS=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三"].map((n,r)=>{const l=r<6?"P":r<9?"J":"S";return{label:n,value:`${l}0${r<6?r+1:(r-6)%3+1}`,classify:l}}),Xo=(n,r)=>typeof n=="string"&&n.trim()?n.trim():Hn(r,"字典编码和名称必须是非空字符串"),Nl=(n,r)=>n&&typeof n=="object"&&!Array.isArray(n)?n:Hn(r,"字典必须是对象"),Wh=n=>n.classify||(/^[PJS]/.test(n.value)?n.value[0]:void 0);function Pc(n={}){const r=Nl(n,"dictionaries"),l=(y,S)=>{if(!Array.isArray(y))return Hn(S,"字典选项必须是数组");const E=new Set;return y.map((R,N)=>{const T=Nl(R,`${S}.${N}`),O=Xo(T.value,`${S}.${N}.value`),D=Xo(T.label,`${S}.${N}.label`);return E.has(O)&&Hn(`${S}.${N}.value`,"字典编码重复"),E.add(O),{...T,value:O,label:D}})},a=l(r.grades===void 0?RS:r.grades,"dictionaries.grades").map((y,S)=>(y.classify!==void 0&&!["P","J","S"].includes(String(y.classify))&&Hn(`dictionaries.grades.${S}.classify`,"学段为 P、J 或 S"),{value:y.value,label:y.label,classify:y.classify})),c=r.gradeCourseMap===void 0?void 0:Nl(r.gradeCourseMap,"dictionaries.gradeCourseMap"),s=r.courseCodeToSubjectCode===void 0?{}:Nl(r.courseCodeToSubjectCode,"dictionaries.courseCodeToSubjectCode");for(const[y,S]of Object.entries(s))Xo(S,`dictionaries.courseCodeToSubjectCode.${y}`);const u=new Map,h=Object.fromEntries(a.map(y=>{const S=Wh(y),E=(S?OS[S]:[]).map(T=>({value:Rl[T],label:T,subjectCode:Rl[T]})),R=`dictionaries.gradeCourseMap.${y.value}`,N=l(c?c[y.value]??[]:E,R).map((T,O)=>{const D=s[T.value];T.subjectCode!==void 0&&D!==void 0&&T.subjectCode!==D&&Hn(`${R}.${O}.subjectCode`,"课程对应的学科编码冲突");const M=Xo(T.subjectCode??D??(Object.values(Rl).includes(T.value)?T.value:void 0),`${R}.${O}.subjectCode`);return u.has(T.value)&&u.get(T.value)!==M&&Hn(`${R}.${O}.subjectCode`,"同一课程不能对应不同学科"),u.set(T.value,M),T.custom!==void 0&&typeof T.custom!="boolean"&&Hn(`${R}.${O}.custom`,"custom 必须是布尔值"),{value:T.value,label:T.label,subjectCode:M,...T.custom===void 0?{}:{custom:T.custom}}});return[y.value,N]})),g=a.filter(y=>h[y.value].length),m=r.defaultGradeCode===void 0?void 0:Xo(r.defaultGradeCode,"dictionaries.defaultGradeCode"),b=g.find(y=>y.value===m)?.value||g[0]?.value||"",v=r.defaultCourseCode===void 0?void 0:Xo(r.defaultCourseCode,"dictionaries.defaultCourseCode"),w=h[b]||[],C=w.find(y=>y.value===v)?.value||w[0]?.value||"";return{grades:g,gradeCourseMap:h,defaultGradeCode:b,defaultCourseCode:C}}function ni(n,r,l){const a=n.grades.find(s=>s.value===r);if(!a)return Hn("initialization.gradeCode","年级不在可用字典中");const c=n.gradeCourseMap[r]?.find(s=>s.value===l);return c?{grade:a.label,subject:c.label,gradeCode:r,courseCode:l,subjectCode:c.subjectCode,phaseCode:Wh(a)}:Hn("initialization.courseCode","当前年级没有此课程")}function Jh(n,r={}){const a=n.grades.find(u=>u.value===r.gradeCode||!r.gradeCode&&u.label===r.grade)?.value||n.defaultGradeCode,c=n.gradeCourseMap[a]||[],s=c.find(u=>u.value===r.courseCode||!r.courseCode&&u.label===r.subject)?.value||(a===n.defaultGradeCode?n.defaultCourseCode:c[0]?.value)||"";return a&&s?ni(n,a,s):{grade:"",subject:"",gradeCode:"",courseCode:""}}function em(n){return n?.subjectCode||Rl[n?.subject||""]}const mn={questions:200,options:12,score:15},NS=n=>n.multiple?n.indefinite?"indefinite":"multiple":"single",Bn=n=>Number.isFinite(n)&&Number.isInteger(n*2),ri=n=>!!(em(n)==="MATHS"&&(n?.phaseCode?n.phaseCode==="S":n?.gradeCode?n.gradeCode.startsWith("S"):/^高[一二三]/.test(n?.grade||"")));function AS(n){const r=typeof n.score=="number"&&Bn(n.score)&&n.score>=.5&&n.score<=mn.score?n.score:null,l=[...new Set(n.correctIds)].filter(a=>n.options.some(c=>c.id===a));return{...n,indefinite:!!(n.multiple&&n.indefinite),score:r,scoreType:n.multiple&&n.scoreType==="ITEM_SCORE"?"ITEM_SCORE":"LESS_SCORE",lessScore:n.multiple&&r!==null&&Bn(n.lessScore??0)?Math.max(0,Math.min(r,n.lessScore??0)):0,correctIds:n.multiple?l:l.slice(0,1)}}function $c(n,r,l){let a={...n};if(r.kind!==void 0){const c=r.kind!=="single";c&&!n.multiple&&(a.scoreType=ri(l)?"ITEM_SCORE":"LESS_SCORE",typeof a.score!="number"&&ri(l)&&(a.score=6)),a.multiple=c,a.indefinite=r.kind==="indefinite"}if(r.optionCount!==void 0){const c=Math.max(2,Math.min(mn.options,Math.round(r.optionCount)));a.options=Array.from({length:c},(s,u)=>n.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),AS(a)}function Gc(n){return typeof n.score=="number"&&(!Bn(n.score)||n.score<.5||n.score>mn.score)?"每题分值须为 0.5–15 分,按 0.5 分递增":n.multiple&&n.scoreType==="LESS_SCORE"&&typeof n.score=="number"&&(!Bn(n.lessScore??0)||(n.lessScore??0)<0||(n.lessScore??0)>n.score)?"少选得分须为 0.5 的倍数,且不能超过本题分值":n.multiple&&n.scoreType==="ITEM_SCORE"&&typeof n.score=="number"&&n.correctIds.length&&!Bn(n.score/n.correctIds.length)?"答案个数与分值不匹配,每个正确选项的得分须为 0.5 的倍数":null}function MS(n){return n.multiple&&n.scoreType==="ITEM_SCORE"&&typeof n.score=="number"&&n.correctIds.length&&!Gc(n)?n.score/n.correctIds.length:null}function Vc(n){const r=n.map(c=>Number(c.label)).filter(c=>Number.isSafeInteger(c)&&c>0&&c<1e5);let l=String(Math.max(0,...r)+1);const a=new Set(n.map(c=>c.label));for(;a.has(l);)l=String(Number(l)+1);return l}function _S(n,r){const l=new Map(n.options.map(a=>[a.id,crypto.randomUUID()]));return{...n,id:crypto.randomUUID(),label:r,breakBefore:!1,contentTarget:null,options:n.options.map(a=>({...a,id:l.get(a.id)})),correctIds:n.correctIds.map(a=>l.get(a)).filter(Boolean)}}function tm(n,r,l){return l.trim()?n.some(a=>a.id!==r&&a.label.trim()===l.trim())?"题组内题号不能重复":null:"题号不能为空"}function DS(n,r,l,a){const c=n.questions.filter(g=>r.includes(g.id));if(!c.length)return{error:"请选择要修改的题目"};let s;if(l.type==="settings"){if(!Object.keys(l.patch).length)return{error:"请设置需要修改的属性"};const{optionCount:g,score:m,lessScore:b}=l.patch;if(g!==void 0&&(!Number.isInteger(g)||g<2||g>mn.options))return{error:"选项个数须为 2–12 的整数"};if(typeof m=="number"&&(!Bn(m)||m<.5||m>mn.score))return{error:"每题分值须为 0.5–15 分,按 0.5 分递增"};if(b!==void 0&&(!Bn(b)||b<0))return{error:"少选得分须为非负的 0.5 倍数"};if(s=c.map(v=>$c(v,l.patch,a)),b!==void 0&&s.some(v=>v.multiple&&v.scoreType!=="ITEM_SCORE"&&b>(v.score??0)))return{error:"少选得分不能超过所选题目的分值"}}else if(l.type==="numbering"){if(!Number.isInteger(l.start)||l.start<1||l.start+c.length-1>1e3)return{error:"连续题号须在 1–1000 内"};s=c.map((g,m)=>({...g,label:String(l.start+m)}))}else if(l.type==="average"){const g=l.total/c.length;if(!Bn(g)||g<.5||g>mn.score)return{error:"总分无法平均分配,每题须为 0.5–15 分且为 0.5 的倍数"};s=c.map(m=>$c(m,{score:g}))}else{const g=l.text.toUpperCase().trim().split(/[\s,,;;]+/).filter(Boolean);if(g.length!==c.length)return{error:`需要 ${c.length} 组答案,当前为 ${g.length} 组`};s=[];for(let m=0;m<c.length;m++){const b=c[m],v=g[m];if(v!=="-"&&(!/^[A-T]+$/.test(v)||new Set(v).size!==v.length||[...v].some(C=>!b.options.some(y=>y.label===C))))return{error:`第 ${b.label} 题包含无效或重复选项`};const w=v==="-"?[]:[...v].map(C=>b.options.find(y=>y.label===C).id);if(!b.multiple&&w.length>1)return{error:`第 ${b.label} 题为单选,只能设置一个答案`};s.push({...b,correctIds:w})}}const u=new Map(s.map(g=>[g.id,g])),h=n.questions.map(g=>u.get(g.id)||g);for(const g of s){const m=tm(h,g.id,g.label)||Gc(g);if(m)return{error:`第 ${g.label} 题:${m}`}}return{value:{...n,questions:h}}}const IS={layout:"natural",columns:2,indent:!1,rowGap:0,columnGap:32,marker:"letter"},qc=n=>`question:${n}`,Yc=n=>n.presentation==="stem"?"stem":["option","distributed"].includes(n.presentation)?"option":"concentrated";function Xc(n,r,l){const a=Ol(r),c=new Map,s=(h,g)=>{const m=h.attrs?.contentId||g;h.type==="choiceGroup"&&m&&c.set(h.attrs.id,m),h.content?.forEach(b=>s(b,m))};s(r.content);const u=new Set(n.questions.map(h=>h.contentTarget?.groupId));return{...n,presentation:l,questions:n.questions.map((h,g)=>{const m=a.find(b=>c.get(b.id)===h.id)||(c.size?void 0:a[g]);return l==="concentrated"||h.contentTarget!==void 0||!m||u.has(m.id)?h:(u.add(m.id),{...h,contentTarget:{groupId:m.id,optionIds:m.options.map(b=>b.id)}})})}}function Ko(n,r,l){const a=Yc(n),c=new Map(Ol(r).map(w=>[w.id,w])),s=new Set,u=new Map,h=new Map,g=(w,C)=>{const y=w.attrs?.contentId||C;w.type==="choiceGroup"&&y&&(u.set(y,[...u.get(y)||[],w.attrs.id]),h.set(w.attrs.id,y)),w.type==="choiceStemAnchor"&&typeof w.attrs?.groupId=="string"&&s.add(w.attrs.groupId),w.content?.forEach(S=>g(S,y))};g(r.content);const m=[],b=new Set,v=n.questions.filter(w=>{if(!l||a==="concentrated")return!0;if(a==="stem"&&s.has(qc(w.id)))return m.push({groupId:qc(w.id),questionId:w.id,options:w.options.map(N=>({...N,contentOptionId:N.id}))}),!1;const C=u.get(w.id),y=C?.length===1?c.get(C[0]):void 0,S=y?{groupId:y.id,optionIds:y.options.map(N=>N.id)}:w.contentTarget,E=S&&c.get(S.groupId);if(!S||!E||b.has(E.id)||a==="stem"&&!s.has(E.id)||h.has(E.id)&&h.get(E.id)!==w.id)return!0;const R=S.optionIds.slice(0,w.options.length);return R.length!==w.options.length||new Set(R).size!==R.length||R.some(N=>!E.options.some(T=>T.id===N))?!0:(b.add(E.id),m.push({groupId:E.id,questionId:w.id,options:w.options.map((N,T)=>({...N,contentOptionId:R[T]}))}),!1)});return{position:a==="concentrated"?void 0:a,bindings:m,concentrated:{...n,questions:v}}}function Fo(n,r=4){return{id:crypto.randomUUID(),label:String(n+1),multiple:!1,indefinite:!1,score:null,scoreType:"LESS_SCORE",lessScore:0,correctIds:[],breakBefore:!1,options:Array.from({length:r},(l,a)=>({id:crypto.randomUUID(),label:String.fromCharCode(65+a)}))}}function Kc(n=8){return{source:"manual",presentation:"concentrated",direction:"row",rowsPerColumn:5,marker:"box",rowGap:0,columnGap:0,questions:Array.from({length:n},(r,l)=>Fo(l))}}function Fc(n){return new Set(n.questions.map(r=>r.options.length)).size>1?"column":n.direction}function zS(n){const r=[];for(const l of n.questions){const a=r.at(-1);(!a||a.length>=n.rowsPerColumn||l.breakBefore||a[0].options.length!==l.options.length)&&r.push([]),r[r.length-1].push(l)}return r}function LS(n){const r=[];for(const l of zS(n))(!r.length||l[0].breakBefore)&&r.push([]),r[r.length-1].push(l);return r}const kS={judge:"判断题",fill:"填空题",answer:"解答题",calculation:"计算/证明",matching:"信息匹配/连线",ordering:"排序/分类",correction:"改错题",drawing:"作图题",table:"表格填答",writing:"语文作文",english:"外语写作",reading:"阅读理解",cloze:"完形填空",completion:"语法填空",chunk:"断句题",composite:"材料/复合题",optional:"选做题组",practice:"实践评价"},HS={choice:"选择",judge:"判断",fill:"填空",answer:"简答",calculation:"计算/证明",correction:"改错",drawing:"作图",table:"表格",writing:"作文",english:"外语写作"},nm=["reading","cloze","completion","composite","optional"],Bt=()=>({version:1,content:{type:"doc",content:[{type:"paragraph"}]}}),rm={symbols:["√","×"],letters:["T","F"],words:["正确","错误"]},Al=n=>["writing","english"].includes(n)?70:["answer","calculation","drawing","table","correction"].includes(n)?60:15,om=n=>n==="judge"?200:n==="fill"?50:["reading","cloze","completion"].includes(n)?20:n==="matching"?9:100;function am(n=0){return{id:crypto.randomUUID(),label:String(n+1),width:50,style:"line",characters:6,score:null,answers:[],prefix:"",suffix:"",breakAfter:!1}}function Qc(n,r="1"){const l=crypto.randomUUID();return{id:l,label:r,kind:n,document:Bt(),reference:Bt(),explanation:Bt(),score:null,choice:{...Fo(0,n==="judge"?2:4),id:l,label:r},presentation:"concentrated",blanks:[am()],steps:[],needsReason:!1,judgment:null,targets:[],area:{style:n==="writing"?"characters":n==="english"?"lines":n==="drawing"?"grid":"blank",rows:n==="writing"?20:6,columns:20,rowHeight:n==="writing"?40:28,wordMark:100,title:!1,backgroundUrl:""}}}function Zc(n){return["reading","cloze","chunk"].includes(n)?"choice":["matching","completion"].includes(n)?"fill":["ordering","composite","optional","practice"].includes(n)?"answer":n}function BS(n){return{items:[Qc(Zc(n))],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 Mr(n){return String(Math.max(0,...n.map(r=>/^\d+$/.test(r.label)?Number(r.label):0))+1)}function fo(n){const r=structuredClone(n),l=new Map,a=s=>{!s||typeof s!="object"||Object.entries(s).forEach(([u,h])=>{["id","answerId"].includes(u)&&typeof h=="string"?l.set(h,crypto.randomUUID()):a(h)})};a(r);const c=s=>typeof s=="string"?l.get(s)||s:Array.isArray(s)?s.map(c):s&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([u,h])=>[l.get(u)||u,c(h)])):s;return c(r)}function US(n,r){const l=fo(n);return{...l,label:r,choice:{...l.choice,label:r}}}function Qo(n,r,l){const a=n.findIndex(u=>u.id===r),c=a+l;if(a<0||c<0||c>=n.length)return n;const s=[...n];return s.splice(c,0,...s.splice(a,1)),s}function PS(n,r){return{...n,pool:n.pool.filter(l=>l.id!==r),sequence:n.sequence.filter(l=>l!==r),assignments:Object.fromEntries(Object.entries(n.assignments).filter(([l])=>l!==r)),items:n.items.map(l=>({...l,targets:l.targets.filter(a=>a!==r)}))}}function $S(n,r,l){const a=[...new Set(l)].filter(s=>n.pool.some(u=>u.id===s)),c=n.relation==="one"?a.slice(-1):a;return{...n,items:n.items.map(s=>s.id===r?{...s,targets:c}:n.reuseOptions?s:{...s,targets:s.targets.filter(u=>!c.includes(u))})}}function GS(n,r){let l=0;for(;l<r.length&&l<n.chunkText.length&&r[l]===n.chunkText[l];)l++;let a=0;for(;a<r.length-l&&a<n.chunkText.length-l&&r[r.length-1-a]===n.chunkText[n.chunkText.length-1-a];)a++;const c=n.chunkText.length-a,s=new Set,u=n.chunkPoints.filter(h=>h.offset<=l||h.offset>=c).map(h=>({...h,offset:h.offset<=l?h.offset:h.offset+r.length-n.chunkText.length})).filter(h=>h.offset<=0||h.offset>=r.length||s.has(h.offset)?!1:(s.add(h.offset),!0));return{...n,chunkText:r,chunkPoints:u,chunkCorrect:n.chunkCorrect.filter(h=>u.some(g=>g.id===h))}}function VS(n,r){const l=[],a=n.items.map(c=>c.label.trim());(a.some(c=>!c)||new Set(a).size!==a.length)&&l.push("题号不能为空或重复");for(const c of n.items){c.score!==null&&(!Number.isFinite(c.score)||c.score<.5||c.score>Al(c.kind)||!Number.isInteger(c.score*2))&&l.push(`${c.label} 题分值超出范围或不是 0.5 的倍数`);const u=(c.kind==="fill"?c.blanks:c.steps).map(h=>h.score);u.length&&c.score!==null&&u.every(h=>h!==null)&&u.reduce((h,g)=>h+(g||0),0)!==c.score&&l.push(`${c.label} 题分项分值之和与题分不一致`)}if(["matching","ordering"].includes(r)){const c=n.pool.map(s=>s.label.trim());(c.some(s=>!s)||new Set(c).size!==c.length)&&l.push("共享选项编号不能为空或重复")}return r==="optional"&&n.chooseCount>n.items.length&&l.push("选做数量不能超过题目数量"),r==="chunk"&&n.chunkCorrect.length>n.chunkMax&&l.push("正确断点数不能超过最多选择数"),l}function qS(n=3,r=3){return{version:1,content:{type:"doc",content:[{type:"table",content:Array.from({length:n},()=>({type:"tableRow",content:Array.from({length:r},()=>({type:"tableCell",content:[{type:"paragraph"}]}))}))}]}}}function pn(n){const r=l=>!!(l.text||l.type&&!["doc","paragraph","choiceStemAnchor"].includes(l.type)||l.content?.some(r));return!r(n.content)}const im={choice:"选择题",...kS};function lm(){return{version:1,title:"",questionCard:!1,preset:"a3-two",margin:15,gap:10,blocks:[]}}function YS(n=""){return{id:crypto.randomUUID(),height:70,document:{version:1,content:{type:"doc",content:[{type:"paragraph",attrs:{textAlign:"center",lineSpacing:9},...n?{content:[{type:"text",text:n,marks:[{type:"textStyle",attrs:{fontFamily:"SimSun, 宋体, serif",fontSize:"22px"}}]}]}:{}}]}}}}function Wc(n){return{...lm(),title:n.name,creation:n,paperTitle:YS(n.name),header:{focusText:!0,writeKaohao:!1,missExam:!1,mifeng:!1,kaohao:"school",weishu:8}}}function ho(n,r=96){return n*r/25.4}const oi={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}},mo=44,ai=16;function Jc(n,r){const l=oi[n.preset],a=ho(l.width),c=ho(l.height),s=ho(n.margin),u=ho(n.gap),h=n.header?.mifeng?ho(n.header.kaohao==="code"?26:14):0,g=a-s*2-h,m=(g-u*(l.columns-1))/l.columns,b=c-s*2,v=b-ai,w=n.header?m:g,C=r&&r.id===n.paperTitle?.id&&Math.abs(r.width-w)<1?r:void 0,y=n.paperTitle?Math.min(b,C?.height??n.paperTitle.height+(n.header?260:ai)):0,S=(T,O=0)=>!!n.paperTitle&&(n.header?T%2===0&&O===0:T===0),E=(T,O=0)=>S(T,O)?y:0;return{...l,width:a,height:c,margin:s,gap:u,sealWidth:h,contentWidth:g,contentHeight:b,columnWidth:m,columnX:(T,O)=>s+(T%2===0?h:0)+O*(m+u),titleWidth:w,titleMaxHeight:v,hasHeader:S,headerHeight:E,capacity:(T,O=0)=>b-E(T,O)}}function XS(n,r,l){const a=Jc(n,l);let c=0,s=0,u=0;const h=()=>{s++,s===a.columns&&(s=0,c++),u=0},g=n.blocks.map(b=>{const v=r[b.id],w=v&&Math.abs(v.width-a.columnWidth)<1?v.height:100+b.answerHeight,C=v&&Math.abs(v.width-a.columnWidth)<1?[...new Set([...v.breaks||[],w].filter(O=>Number.isFinite(O)&&O>0&&O<=w))].sort((O,D)=>O-D):[],y=b.reference?.type==="CCOMPOSITION",S=O=>y&&O>0?Math.max(0,6-Math.max(0,(v?.compositionStart||0)-O)):0;if(C.length>1&&C.every((O,D)=>{const M=C[D-1]||0;return O-M+S(M)<=a.capacity(1)+.5})){const O=[];let D=0;for(;D<w-.5;){const z=a.capacity(c,s)-u,H=D,G=S(D),X=C.filter(F=>F>H+.5&&F<=H+z-G+.5).at(-1);if(X===void 0){h();continue}const U=y&&X<w-.5?Math.max(0,z-G-(X-D)):0;O.push({page:c,column:s,x:a.columnX(c,s),y:c*(a.height+mo)+a.margin+a.headerHeight(c,s)+u,from:D,to:X,...G?{topPadding:G}:{},...U?{bottomPadding:U}:{}}),u+=X-D+G,D=X,D<w-.5&&h()}u+=ai;const M=O[0];return{id:b.id,...M,height:w,available:a.capacity(M.page,M.column),overflowing:!1,fragments:O}}for(;u+w>a.capacity(c,s)+.5&&(u>0||a.headerHeight(c,s)>0);)h();const R=a.capacity(c,s),N=w>R+.5,T={id:b.id,page:c,column:s,x:a.columnX(c,s),y:c*(a.height+mo)+a.margin+a.headerHeight(c,s)+u,height:w,available:R,overflowing:N,fragments:[{page:c,column:s,x:a.columnX(c,s),y:c*(a.height+mo)+a.margin+a.headerHeight(c,s)+u,from:0,to:Math.min(w,R)}]};return u+=Math.min(w,R)+ai,T}),m=new Map;return g.forEach((b,v)=>b.fragments.forEach(w=>{const C=`${w.page}/${w.column}`,y=m.get(C)||[];y.push({fragment:w,placement:b,blockIndex:v}),m.set(C,y)})),m.forEach(b=>{const v=b.filter(S=>["answer","writing","english","composite"].includes(n.blocks[S.blockIndex].kind)).at(-1);if(!v||n.blocks[v.blockIndex].reference?.type!=="CCOMPOSITION")return;const w=b.at(-1).fragment,y=w.page*(a.height+mo)+a.height-a.margin-w.y-(w.to-w.from)-(w.topPadding||0)-(w.bottomPadding||0);y<=0||y>30||(v.fragment.bottomPadding=(v.fragment.bottomPadding||0)+y,b.slice(b.indexOf(v)+1).forEach(({fragment:S,placement:E})=>{S.y+=y,E.fragments[0]===S&&(E.y=S.y)}))}),{geometry:a,placements:g,pageCount:c+1}}function ii(n,r){return{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:`${n}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]},...r===null?[]:[{type:"text",text:`(${r}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}]]}]}}}function gn(n,r,l){const a=c=>{if(!c.content)return c;let s;const u=c.content.flatMap(h=>{const g=h.type==="text"&&h.marks?.find(v=>v.type==="documentLabel")?.attrs?.kind,m=g&&g===s;if(s=g,m)return[];if(!g)return[a(h)];const b=g==="number"?`${r}.`:l===null?"":`(${l}分)`;return b?[{...h,text:b}]:[]});return{...c,content:u}};return{...n,content:a(n.content)}}const Wn={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(n,r=!1){const l=em(n),a=r?sm.filter(c=>c!=="MIXED"):sm;return r?["CHINESE","JAPANESE"].includes(l||"")?[...a,"CHUNK_CHOICE"]:a:l==="CHINESE"?[...a,"CCOMPOSITION","CHUNK_CHOICE"]:l==="ENGLISH"?[...a,"CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION","ECOMPOSITION"]:l==="JAPANESE"?Object.keys(Wn):["POLITICAL","HISTORY"].includes(l||"")?[...a,"CCOMPOSITION"]:a}const KS=n=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(n),FS=n=>["SCHOICE","MCHOICE","CLOZE","READTHENANSWER","INFO_MATCHING","JUDGE"].includes(n),_r=n=>({version:1,content:{type:"doc",content:n.length?n:[{type:"paragraph"}]}});function li(n,r,l=!1){return{content:Bt(),numbered:!l,groupId:`options:${r.id}`,layout:{...IS,columns:n==="CLOZE"?4:2,...n==="READTHENANSWER"?{layout:"fixed",columnGap:0}:{}},itemsContent:!l&&FS(n)?r.options.map(a=>({id:a.id,key:a.label,content:Bt()})):[]}}const Ml=n=>{if(n.type==="choiceStemAnchor"||n.type==="text"&&n.marks?.some(a=>a.type==="documentLabel"&&a.attrs?.kind==="number"))return null;const{contentId:r,...l}=n.attrs||{};return{...n,...n.attrs?{attrs:l}:{},...n.content?{content:n.content.map(Ml).filter(a=>a!==null)}:{}}};function _l(n,r,l){const c=(n.content.content.content||[{type:"paragraph"}]).map(s=>({...s,attrs:{...s.attrs,contentId:r}}));if(n.numbered){const s={type:"text",text:`${l}.`,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:[s,...c[0].content||[]]}}return n.itemsContent.length&&c.push({type:"choiceGroup",attrs:{id:n.groupId,contentId:r,...n.layout},content:n.itemsContent.map(s=>({type:"choiceOption",attrs:{id:s.id,label:s.key,sourceKey:s.key,marker:"letter"},content:s.content.content.content||[{type:"paragraph"}]}))}),c}function um(n,r){const l=r.filter(h=>h.type==="choiceGroup"),a=l.find(h=>h.attrs?.id===n.groupId)||(l.length===1?l[0]:void 0),c=r.filter(h=>h!==a);let s=!1;const u=h=>{h.marks?.some(g=>g.type==="documentLabel"&&g.attrs?.kind==="number")&&(s=!0),h.content?.forEach(u)};return c.forEach(u),{...n,numbered:s,content:_r(c.map(Ml).filter(h=>h!==null)),groupId:a?.attrs?.id||n.groupId,layout:a?Object.fromEntries(Object.entries(n.layout).map(([h,g])=>[h,a.attrs?.[h]??g])):n.layout,itemsContent:(a?.content||[]).map((h,g)=>({id:h.attrs?.id||n.itemsContent[g]?.id||crypto.randomUUID(),key:h.attrs?.label||String.fromCharCode(65+g),content:_r((h.content||[]).map(Ml).filter(m=>m!==null))}))}}function dm(n,r,l,a){const c=new Map;r.content.content?.forEach(h=>{h.attrs?.contentId&&c.set(h.attrs.contentId,[...c.get(h.attrs.contentId)||[],h])});const s=new Set(a?.content.content?.map(h=>h.attrs?.contentId).filter(Boolean)),u=(h,g)=>g&&(c.has(h)||s.has(h))?um(g,c.get(h)||[]):g;return{...n,...c.has(l)?{material:_r(c.get(l).map(h=>Ml(h)))}:{},questions:n.questions.map(h=>({...h,text:u(h.id,h.text),parts:h.parts.map(g=>({...g,text:u(g.id,g.text)}))}))}}function eu(n){const r=n.reference,l=[];r.type==="MIXED"&&l.push(...(r.material||Bt()).content.content.map(c=>({...c,attrs:{...c.attrs,contentId:n.id}}))),r.questions.forEach(c=>{c.text&&l.push(..._l(c.text,c.id,c.label)),KS(c.type)&&c.parts.forEach(s=>{s.text&&l.push(..._l(s.text,s.id,s.label))})});const a=(n.document.content.content||[]).filter(c=>!c.attrs?.contentId);return pn(_r(a))||l.push(...a),_r(l)}function QS(n,r){const l=(a,c,s)=>!a||!s||c.options.map(u=>u.id).join()===s.options.map(u=>u.id).join()?a:{...a,itemsContent:c.options.map(u=>({...a.itemsContent.find(h=>h.id===u.id),id:u.id,key:u.label,content:a.itemsContent.find(h=>h.id===u.id)?.content||Bt()}))};return{...n,questions:n.questions.map(a=>{const c=r.questions.find(s=>s.id===a.id);return{...a,text:l(a.text,a.choice,c?.choice),parts:a.parts.map(s=>({...s,text:l(s.text,s.choice,c?.parts.find(u=>u.id===s.id)?.choice)}))}})}}function ZS(n,r,l){if(n.reference?.textVersion!==1)return n;let a=n.reference;if(!r&&!pn(n.document)&&!n.document.content.content?.some(s=>s.attrs?.contentId))return{...n,reference:{...a,textVersion:void 0}};if(r?.reference===a&&r.document===n.document&&!pn(n.document))return n;if(n.document!==r?.document&&(!pn(n.document)||r)&&(a=dm(a,n.document,n.id,r?.document),r&&n.reference===r.reference))return{...n,reference:a};r?.reference&&n.reference!==r.reference&&(a=QS(a,r.reference));const c={...n,reference:a};return l||!pn(n.document)?{...c,document:eu(c)}:c}const Zo={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}},Ct=n=>["SCHOICE","MCHOICE","JUDGE","CHUNK_CHOICE","CLOZE","READTHENANSWER","INFO_MATCHING"].includes(n),ke=n=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(n),si=n=>n==="FILLBLANK"||n==="TEXT_COMPLETION",ci=n=>n==="CCOMPOSITION"||n==="ECOMPOSITION",WS={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 tu(n){return{type:n,textVersion:1,questions:[],layout:Kc(0),fillNewLine:!1,optional:!1,choose:1,optionalHeight:200,scoreType:"LESS_SCORE"}}function fm(n){return{id:crypto.randomUUID(),kind:WS[n],title:Wn[n],answerHeight:0,document:Bt(),reference:tu(n)}}function nu(n,r=1,l){const a=n==="MCHOICE"&&ri(l);return{type:n,start:r,end:r,optionCount:n==="INFO_MATCHING"?null:n==="CHUNK_CHOICE"?12:n==="JUDGE"?2:4,partCount:ke(n)?null:1,score:a?6:null,scoreType:a?"ITEM_SCORE":"LESS_SCORE",lessScore:0,characters:1e3,lines:10,rightAnswers:null,singleScore:1}}function Wo(n,r,l){const a=Array.from({length:l},(c,s)=>({...n.options[s]||{id:crypto.randomUUID()},label:r==="JUDGE"?["T","F"][s]:String.fromCharCode(65+s)}));return{...n,options:a,multiple:r==="MCHOICE"||r==="CHUNK_CHOICE",indefinite:!1,correctIds:n.correctIds.filter(c=>a.some(s=>s.id===c)).slice(0,r==="MCHOICE"||r==="CHUNK_CHOICE"?l:1)}}function ui(n,r,l,a=4){const c=crypto.randomUUID(),s={...Wo(Fo(0),l,a),id:c,label:n,score:r};return{id:c,label:n,score:r,width:25,breakAfter:!1,height:100,document:l==="SHORTANSWER"?ii(n,r):Bt(),choice:s,...ke(l)&&l!=="TEXT_COMPLETION"?{text:li(l,s)}:{}}}function ru(n,r){const l=crypto.randomUUID(),{type:a,score:c}=n,s=String(r),u=n.partCount||1,h=Array.from({length:ke(a)||["FILLBLANK","SHORTANSWER"].includes(a)?u:0},(m,b)=>ui(ke(a)?String(r+b):u===1?s:`${s}.${b+1}`,c,a,n.optionCount||4)),g={...Wo(Fo(0),a,n.optionCount||4),id:l,label:s,score:c,scoreType:n.scoreType,lessScore:n.lessScore};return{id:l,type:a,label:s,score:h.length?Un(h):c,choice:g,text:li(a,g,ke(a)),parts:h,document:a==="ECOMPOSITION"?{version:1,content:{type:"doc",content:[...ii(s,c).content.content,...rC(n.lines,n.paperWidth||600).content.content]}}:a==="CCOMPOSITION"?ii(s,c):Bt(),height:a==="ECOMPOSITION"?50*n.lines+40:100,contentHeight:38,characters:n.characters,lines:n.lines,halfPoint:!1,rightAnswers:n.rightAnswers,singleScore:n.singleScore}}const Un=n=>n.some(r=>r.score===null)?null:n.reduce((r,l)=>r+(l.score||0),0);function ou(n){return n.questions.flatMap(r=>ke(r.type)?r.parts.map(l=>l.label):[r.label])}function Dl(n){return Math.max(0,...ou(n).map(Number).filter(Number.isFinite))+1}function JS(n,r,l=!1){const a=Zo[r.type],c=ci(r.type)?1:r.end-r.start+1;if(!Number.isInteger(r.start)||r.start<1||r.end>1e3||!Number.isInteger(c)||c<1||c>a.count)return`题号须为 1–1000,单次题数为 1–${a.count}`;if(n.type==="CCOMPOSITION"&&n.questions.length)return"语文作文每组只能有一道题";if(n.optional)return"选做题组不能追加题目";const s=ou(n);if(Array.from({length:c},(u,h)=>String(r.start+h)).some(u=>s.includes(u)))return"同一分组内,题号不能重复";if(Ct(r.type)&&(r.optionCount===null||!Number.isInteger(r.optionCount)||r.optionCount<a.options[0]||r.optionCount>a.options[1]))return`选项个数须为 ${a.options[0]}–${a.options[1]}`;if((ke(r.type)||["FILLBLANK","SHORTANSWER"].includes(r.type))&&(!r.partCount||!Number.isInteger(r.partCount)||r.partCount<1||r.partCount>a.parts))return`子题/空数须为 1–${a.parts}`;if(ke(r.type)&&c%r.partCount!==0)return"题目数量无法按子题数量均分,请重新设置";if(r.type==="INFO_MATCHING"&&r.partCount>r.optionCount)return"选项个数需大于等于子题数量";if(r.type==="SHORTANSWER"&&(l||n.optional)&&r.partCount!==1)return"网阅或选做题不支持小题";if(r.score!==null&&(!Number.isFinite(r.score)||r.score<.5||r.score>a.score||!Number.isInteger(r.score*2)))return`分值须为 0.5–${a.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.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 eC(n,r,l){const a=ke(r.type)?r.partCount:1,c=[];for(let h=r.start;h<=(ci(r.type)?r.start:r.end);h+=a)c.push(ru(r,h));const s=[...n.questions],u=s.findIndex(h=>h.id===l||h.parts.some(g=>g.id===l));return s.splice(u<0?s.length:u+1,0,...c),{...n,questions:s}}function Il(n){return n.questions.flatMap(r=>[r,...r.parts])}function Jo(n){return n.questions.filter(r=>Ct(r.type)).flatMap(r=>ke(r.type)?r.parts.map(l=>({...l.choice,label:l.label,score:l.score})):[{...r.choice,label:r.label,score:r.score}])}function tC(n,r){const l=fo(n);return l.referenceData&&(l.referenceData={...l.referenceData,questionId:l.id}),l.text&&(l.text.groupId=`options:${l.id}`),l.label=String(r),l.choice.label=l.label,l.choice.contentTarget=null,l.choice.breakBefore=!1,l.parts.forEach((a,c)=>{a.label=ke(l.type)?String(r+c):l.parts.length===1?l.label:`${r}.${c+1}`,a.choice.label=a.label,a.choice.contentTarget=null,a.choice.breakBefore=!1}),l.parts.forEach(a=>{a.text&&(a.text.groupId=`options:${a.id}`),a.referenceData&&(a.referenceData={...a.referenceData,questionId:a.id,questionPid:l.id})}),l.document=gn(l.document,l.label,l.score),l.parts=l.parts.map(a=>({...a,document:gn(a.document,a.label,a.score)})),l}function nC(n){return Math.max(1,Math.floor((n-6)/31))}function rC(n,r){return{version:1,content:{type:"doc",content:Array.from({length:n},()=>({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 oC(n,r){const l=n.questions.reduce((c,s)=>c+(s.parts.length||1),0),a=r/l;return!l||!Number.isFinite(a)||a<.5||!Number.isInteger(a*2)||n.questions.some(c=>a>Zo[c.type].score||c.type==="CHUNK_CHOICE"&&(c.rightAnswers||0)*(c.singleScore||0)>a)?null:{...n,questions:n.questions.map(c=>({...c,score:a*(c.parts.length||1),document:gn(c.document,c.label,a*(c.parts.length||1)),choice:{...c.choice,score:a,lessScore:Math.min(c.choice.lessScore||0,a)},parts:c.parts.map(s=>({...s,score:a,document:gn(s.document,s.label,a),choice:{...s.choice,score:a}}))}))}}function aC(n,r){return[...n<=17?Array.from({length:18},(l,a)=>17-a<=n?String(17-a):""):[...Array.from({length:7},(l,a)=>7-a<=Math.floor(n/10)?`${7-a}0`:""),"",...Array.from({length:10},(l,a)=>String(9-a))],r?"0.5":""]}class di extends Error{constructor(l){super(l[0]?.message||"题卡数据无效");Qh(this,"issues");this.name="AnswerSheetDataError",this.issues=l}}function au(n,r){const l=(y,S="题卡数据结构无效")=>{throw new di([{code:"INVALID_DATA",path:y,message:S}])},a=(y,S)=>!y||typeof y!="object"||Array.isArray(y)?l(S):y,c=(y,S)=>Array.isArray(y)?y:l(S),s=(y,S)=>{typeof y!="string"&&l(S)},u=(y,S,E=0,R=1e5)=>{(typeof y!="number"||!Number.isFinite(y)||y<E||y>R)&&l(S)},h=(y,S)=>{a(y,S);const E=r.validateDocument(y);E.length&&l(S,E[0])},g=(y,S)=>{const E=a(y,S);if(s(E.id,`${S}.id`),s(E.label,`${S}.label`),(typeof E.multiple!="boolean"||typeof E.breakBefore!="boolean")&&l(S),E.contentTarget!==void 0&&E.contentTarget!==null){const R=a(E.contentTarget,`${S}.contentTarget`);s(R.groupId,`${S}.contentTarget.groupId`),c(R.optionIds,`${S}.contentTarget.optionIds`).forEach((N,T)=>s(N,`${S}.contentTarget.optionIds.${T}`))}c(E.options,`${S}.options`).forEach((R,N)=>{const T=a(R,`${S}.options.${N}`);s(T.id,`${S}.options.${N}.id`),s(T.label,`${S}.options.${N}.label`)}),c(E.correctIds,`${S}.correctIds`).forEach((R,N)=>s(R,`${S}.correctIds.${N}`))},m=(y,S)=>{const E=a(y,S);(!["row","column"].includes(String(E.direction))||!["concentrated","distributed","stem","option"].includes(String(E.presentation))||!["box","check","bubble"].includes(String(E.marker)))&&l(S),u(E.rowsPerColumn,`${S}.rowsPerColumn`,1,5),u(E.rowGap,`${S}.rowGap`,0,64),u(E.columnGap,`${S}.columnGap`,0,64),c(E.questions,`${S}.questions`).forEach((R,N)=>g(R,`${S}.questions.${N}`))},b=new WeakSet,v=(y,S)=>{if(!(!y||typeof y!="object")){if(b.has(y))return l(S,"题卡必须是无循环引用的 JSON 数据");b.add(y),Object.entries(y).forEach(([E,R])=>v(R,`${S}.${E}`)),b.delete(y)}},w=a(n,"");if(w.version!==1&&l("version","不支持的题卡数据版本"),s(w.title,"title"),["questionCard","scanMarking","halfPoint","mergeObjective"].forEach(y=>{w[y]!==void 0&&typeof w[y]!="boolean"&&l(y)}),["a4","a3-two","a3-three"].includes(String(w.preset))||l("preset"),u(w.margin,"margin",0,100),u(w.gap,"gap",0,100),w.creation){const y=a(w.creation,"creation");["template","exam"].includes(String(y.mode))||l("creation.mode"),["name","grade","subject"].forEach(S=>s(y[S],`creation.${S}`));for(const S of["gradeCode","courseCode","subjectCode"])y[S]!==void 0&&(typeof y[S]!="string"||!y[S].trim())&&l(`creation.${S}`);y.phaseCode!==void 0&&!["P","J","S"].includes(String(y.phaseCode))&&l("creation.phaseCode"),y.createMode!==void 0&&!["MANUALLY","IMPORTED","THIRD"].includes(String(y.createMode))&&l("creation.createMode");for(const S of["id","exampaperId"])if(y[S]!==void 0){const E=y[S];typeof E=="string"&&E.trim()||typeof E=="number"&&Number.isSafeInteger(E)&&E>=0||l(`creation.${S}`)}}if(w.paperTitle){const y=a(w.paperTitle,"paperTitle");s(y.id,"paperTitle.id"),u(y.height,"paperTitle.height",1,1e3),h(y.document,"paperTitle.document")}if(w.header){const y=a(w.header,"header");["code","school"].includes(String(y.kaohao))||l("header.kaohao"),u(y.weishu,"header.weishu",1,20)}c(w.blocks,"blocks").forEach((y,S)=>{const E=`blocks.${S}`,R=a(y,E);if(s(R.id,`${E}.id`),s(R.title,`${E}.title`),u(R.answerHeight,`${E}.answerHeight`),h(R.document,`${E}.document`),!R.reference){if(R.choices){m(R.choices,`${E}.choices`);return}l(`${E}.reference`,"请使用包含 reference 题目结构的制卡数据")}const N=a(R.reference,`${E}.reference`);N.material!==void 0&&h(N.material,`${E}.reference.material`),N.textVersion!==void 0&&N.textVersion!==1&&l(`${E}.reference.textVersion`),Object.hasOwn(Wn,String(N.type))||l(`${E}.reference.type`),m(N.layout,`${E}.reference.layout`),u(N.optionalHeight,`${E}.reference.optionalHeight`),c(N.questions,`${E}.reference.questions`).forEach((T,O)=>{const D=`${E}.reference.questions.${O}`,M=a(T,D);Object.hasOwn(Zo,String(M.type))||l(`${D}.type`),s(M.id,`${D}.id`),s(M.label,`${D}.label`),g(M.choice,`${D}.choice`),["height","contentHeight","characters","lines"].forEach(H=>u(M[H],`${D}.${H}`)),h(M.document,`${D}.document`);const z=(H,G)=>{if(!H)return;const X=a(H,G);h(X.content,`${G}.content`),a(X.layout,`${G}.layout`),s(X.groupId,`${G}.groupId`),c(X.itemsContent,`${G}.itemsContent`).forEach((U,F)=>{const J=a(U,`${G}.itemsContent.${F}`);s(J.id,`${G}.itemsContent.${F}.id`),s(J.key,`${G}.itemsContent.${F}.key`),h(J.content,`${G}.itemsContent.${F}.content`)})};z(M.text,`${D}.text`),c(M.parts,`${D}.parts`).forEach((H,G)=>{const X=`${D}.parts.${G}`,U=a(H,X);s(U.id,`${X}.id`),s(U.label,`${X}.label`),u(U.width,`${X}.width`),u(U.height,`${X}.height`),h(U.document,`${X}.document`),g(U.choice,`${X}.choice`),z(U.text,`${X}.text`)})})}),v(n,"");const C=Jc(n);(C.columnWidth<100||C.contentHeight<100)&&l("margin","边距或栏间距过大,纸张没有足够的作答区域")}function zl(n){return!n||n.marks?.some(r=>r.type==="documentLabel")?!1:n.type==="text"?!!n.text?.trim():n.type==="image"?!!n.attrs?.src:n.type==="formula"||n.type==="blockFormula"?!!n.attrs?.latex?.trim():!!n.content?.some(zl)}function iC(n,r){try{au(n,r)}catch(C){return{valid:!1,issues:C instanceof di?C.issues:[{code:"INVALID_DATA",path:"",message:"题卡数据无法读取"}]}}const l=[];let a={};const c=(C,y,S)=>l.push({code:C,path:y,message:S,...a}),s=new Set,u=(C,y)=>{(!C.trim()||s.has(C))&&c("DUPLICATE_ID",y,"题块、题目和选项 ID 必须非空且唯一"),s.add(C)},h=(C,y,S)=>{(C===null||!Number.isFinite(C)||C<.5||C>y||!Number.isInteger(C*2))&&c("INVALID_SCORE",S,`分值须为 0.5–${y} 分,按 0.5 分递增`)},g=(C,y,S)=>{(C.options.length<y[0]||C.options.length>y[1])&&c("INVALID_OPTIONS",`${S}.options`,`选项个数须为 ${y[0]}–${y[1]}`),C.options.forEach((E,R)=>u(E.id,`${S}.options.${R}.id`)),(new Set(C.correctIds).size!==C.correctIds.length||C.correctIds.some(E=>!C.options.some(R=>R.id===E)))&&c("INVALID_ANSWER_REFERENCE",`${S}.correctIds`,"答案引用了不存在或重复的选项")},m=(C,y,S,E=0,R=!0)=>{R&&!zl(C?.content.content)&&c("MISSING_CONTENT",`${y}.content`,"请填写题干或材料"),S&&(C?.itemsContent.length!==E||C.itemsContent.some(N=>!zl(N.content.content)))&&c("MISSING_OPTION_CONTENT",`${y}.itemsContent`,"请补全每个选项的内容")};n.title.trim()||c("MISSING_TITLE","title","请填写题卡名称"),(!n.creation?.grade.trim()||!n.creation.subject.trim())&&c("MISSING_CREATION","creation","请选择年级和学科"),(!n.paperTitle||!zl(n.paperTitle.document.content))&&c("MISSING_PAPER_TITLE","paperTitle","请填写纸面标题"),n.blocks.length||c("EMPTY_CARD","blocks","请至少添加一个题块和一道题目"),n.paperTitle&&u(n.paperTitle.id,"paperTitle.id"),n.blocks.forEach((C,y)=>{a={blockId:C.id};const S=`blocks.${y}`;u(C.id,`${S}.id`),C.title.trim()||c("MISSING_BLOCK_TITLE",`${S}.title`,"请填写题块标题"),C.id==="reference-merged-objective"&&c("RESERVED_ID",`${S}.id`,"题块使用了系统保留 ID");const E=C.reference;if(!E){C.choices?.questions.length||c("EMPTY_BLOCK",S,"题块中没有题目"),C.choices?.questions.forEach((N,T)=>{a={blockId:C.id,questionId:N.id},u(N.id,`${S}.choices.questions.${T}.id`),g(N,[2,12],`${S}.choices.questions.${T}`),h(N.score??null,15,`${S}.choices.questions.${T}.score`)});return}E.questions.length||c("EMPTY_BLOCK",`${S}.reference.questions`,"题块中没有题目");const R=ou(E);if((R.some(N=>!N.trim())||new Set(R).size!==R.length)&&c("INVALID_QUESTION_NUMBER",`${S}.reference.questions`,"同一题块内的题号须非空且不能重复"),E.optional&&(E.type!=="SHORTANSWER"||!Number.isInteger(E.choose)||E.choose<1||E.choose>=E.questions.length)&&c("INVALID_OPTIONAL",`${S}.reference.choose`,"选做题须为解答题,且选做数量小于总题数"),E.type==="CCOMPOSITION"&&E.questions.length>1&&c("INVALID_COUNT",`${S}.reference.questions`,"语文作文每组只能有一道题"),E.questions.forEach((N,T)=>{a={blockId:C.id,questionId:N.id};const O=`${S}.reference.questions.${T}`,D=Zo[N.type];u(N.id,`${O}.id`),E.type!=="MIXED"&&E.type!==N.type&&c("TYPE_MISMATCH",`${O}.type`,"题目类型与题块不一致"),N.choice.id!==N.id&&c("INVALID_BINDING",`${O}.choice.id`,"题目与填涂项 ID 不一致");const M=ke(N.type)||["FILLBLANK","SHORTANSWER"].includes(N.type);(M&&(N.parts.length<1||N.parts.length>D.parts)||!M&&N.parts.length)&&c("INVALID_PARTS",`${O}.parts`,`子题/空数须为 ${M?`1–${D.parts}`:"0"}`),N.parts.length?N.score!==Un(N.parts)&&c("SCORE_MISMATCH",`${O}.score`,"总分与子题分值之和不一致"):h(N.score,D.score,`${O}.score`),Ct(N.type)&&!ke(N.type)&&g(N.choice,D.options,`${O}.choice`),N.type==="INFO_MATCHING"&&(g(N.choice,D.options,`${O}.choice`),N.parts.length>N.choice.options.length&&c("INVALID_OPTIONS",`${O}.choice.options`,"信息匹配的选项数不能少于子题数")),N.type==="MCHOICE"&&(!Number.isFinite(N.choice.lessScore)||N.choice.lessScore<0||N.choice.lessScore>(N.score||0)||!Number.isInteger(N.choice.lessScore*2))&&c("INVALID_LESS_SCORE",`${O}.choice.lessScore`,"少选得分须按 0.5 分递增且不能超过本题分值"),N.type==="CHUNK_CHOICE"&&(!N.rightAnswers||!Number.isInteger(N.rightAnswers)||N.rightAnswers>=N.choice.options.length||!N.singleScore||N.singleScore<.5||!Number.isInteger(N.singleScore*2)||N.singleScore*N.rightAnswers>(N.score||0))&&c("INVALID_CHUNK_SCORE",O,"请检查正确答案个数及每处得分"),N.type==="CCOMPOSITION"&&(!Number.isInteger(N.characters)||N.characters<1||N.characters>1200)&&c("INVALID_GRID_COUNT",`${O}.characters`,"作文格数须为 1–1200"),N.type==="ECOMPOSITION"&&(!Number.isInteger(N.lines)||N.lines<1||N.lines>100)&&c("INVALID_LINE_COUNT",`${O}.lines`,"作文行数须为 1–100"),n.questionCard&&m(N.text,`${O}.text`,["SCHOICE","MCHOICE"].includes(N.type),N.choice.options.length),N.parts.forEach((z,H)=>{const G=`${O}.parts.${H}`;a={blockId:C.id,questionId:z.id},u(z.id,`${G}.id`),h(z.score,D.score,`${G}.score`),ke(N.type)&&Ct(N.type)&&(g(z.choice,D.options,`${G}.choice`),z.choice.id!==z.id&&c("INVALID_BINDING",`${G}.choice.id`,"子题与填涂项 ID 不一致")),n.questionCard&&["CLOZE","READTHENANSWER"].includes(N.type)&&m(z.text,`${G}.text`,!0,z.choice.options.length,N.type==="READTHENANSWER")})}),a={blockId:C.id},n.questionCard&&E.layout.presentation!=="concentrated"){const N=E.questions.filter(O=>Ct(O.type)).flatMap(O=>ke(O.type)?O.parts.map(D=>D.choice):[O.choice]);Ko({...E.layout,questions:N},C.document,!0).concentrated.questions.length&&c("MISSING_FILL_TARGET",`${S}.reference.layout.presentation`,"部分填涂框没有对应的题干或选项位置")}}),a={};const b=(C,y)=>{C.type==="image"&&(!C.attrs?.src||/^blob:/i.test(C.attrs.src))&&c("INVALID_IMAGE_URL",y,"图片缺少可保存的地址,请上传后使用持久 URL 或内嵌图片"),["formula","blockFormula"].includes(C.type||"")&&!String(C.attrs?.latex||"").trim()&&c("EMPTY_FORMULA",y,"请填写公式或删除空公式"),C.content?.forEach((S,E)=>b(S,`${y}.content.${E}`))},v=(C,y)=>{C&&b(C.content,`${y}.content`)},w=(C,y)=>{v(C?.content,`${y}.content`),C?.itemsContent.forEach((S,E)=>v(S.content,`${y}.itemsContent.${E}.content`))};return v(n.paperTitle?.document,"paperTitle.document"),n.blocks.forEach((C,y)=>{a={blockId:C.id};const S=`blocks.${y}`;v(C.document,`${S}.document`),v(C.reference?.material,`${S}.reference.material`),C.reference?.questions.forEach((E,R)=>{a={blockId:C.id,questionId:E.id};const N=`blocks.${y}.reference.questions.${R}`;v(E.document,`${N}.document`),w(E.text,`${N}.text`),E.parts.forEach((T,O)=>{a={blockId:C.id,questionId:T.id},v(T.document,`${N}.parts.${O}.document`),w(T.text,`${N}.parts.${O}.text`)})})}),{valid:l.length===0,issues:l}}function iu(n){if(n!==void 0)try{const r=Pc(n);return{grades:r.grades,gradeCourseMap:r.gradeCourseMap,defaultGradeCode:r.defaultGradeCode||void 0,defaultCourseCode:r.defaultCourseCode||void 0}}catch(r){throw r instanceof Uc?new di([{code:"INVALID_DICTIONARIES",path:r.path,message:r.message}]):r}}function lC(n,r){const l=(O,D)=>{throw new di([{code:"INVALID_INITIALIZATION",path:O,message:D}])},a=(O,D,M)=>{if(!O||typeof O!="object"||Array.isArray(O))return l(D,"初始化配置必须是对象");const z=Object.entries(O);for(const[H]of z)M.includes(H)||l(`${D}.${H}`,"不支持的初始化字段");return Object.fromEntries(z.filter(([,H])=>H!==void 0))},c=(O,D)=>typeof O!="string"||!O.trim()?l(D,"请提供非空的试卷名称、年级和学科"):O.trim(),s=(O,D,M)=>{O!==void 0&&!M.includes(O)&&l(D,`可选值为 ${M.join("、")}`)},u=(O,D)=>{O!==void 0&&typeof O!="boolean"&&l(D,"请使用布尔值")},h=(O,D,M,z)=>{O!==void 0&&(typeof O!="number"||!Number.isFinite(O)||O<M||O>z)&&l(D,`数值必须在 ${M}–${z} 之间`)},g=a(n,"initialization",["name","grade","subject","gradeCode","courseCode","subjectCode","mode","id","exampaperId","createMode","layout","header"]),m=c(g.name,"initialization.name");m.length>30&&l("initialization.name","试卷名称最多 30 个字符");const b=Pc(iu(r)),v=g.gradeCode!==void 0||g.courseCode!==void 0||g.subjectCode!==void 0;let w;if(v){try{w=ni(b,c(g.gradeCode,"initialization.gradeCode"),c(g.courseCode,"initialization.courseCode"))}catch(O){if(O instanceof Uc)return l(O.path,O.message);throw O}for(const O of["grade","subject","subjectCode"])g[O]!==void 0&&c(g[O],`initialization.${O}`)!==w[O]&&l(`initialization.${O}`,"名称或学科编码与课程字典不一致")}else{const O=c(g.grade,"initialization.grade"),D=c(g.subject,"initialization.subject"),M=b.grades.filter(G=>G.label===O);M.length>1&&l("initialization.grade","同名年级不唯一,请使用 gradeCode");const z=M[0],H=z?b.gradeCourseMap[z.value].filter(G=>G.label===D):[];H.length>1&&l("initialization.subject","同名课程不唯一,请使用 courseCode"),r&&(!z||!H.length)&&l(z?"initialization.subject":"initialization.grade","名称不在可用字典中,请使用年级和课程编码"),w=z&&H.length?ni(b,z.value,H[0].value):{grade:O,subject:D}}s(g.mode,"initialization.mode",["template","exam"]),s(g.createMode,"initialization.createMode",["MANUALLY","IMPORTED","THIRD"]);const C={};for(const O of["id","exampaperId"])if(g[O]!==void 0){const D=g[O];typeof D=="string"?C[O]=c(D,`initialization.${O}`):typeof D=="number"&&Number.isSafeInteger(D)&&D>=0?C[O]=D:l(`initialization.${O}`,"ID 必须是非空字符串或非负安全整数")}g.createMode!==void 0&&(C.createMode=g.createMode);const y=g.layout===void 0?{}:a(g.layout,"initialization.layout",["preset","margin","gap","questionCard","scanMarking","halfPoint","choiceDirection","mergeObjective","pageNum","quesCard","scoreType","choiceType","mixOb"]),S=(O,D,M)=>{y[O]!==void 0&&(y[D]!==void 0&&y[D]!==M&&l(`initialization.layout.${O}`,`与 ${D} 设置冲突`),y[D]=M,delete y[O])};y.pageNum!==void 0&&![1,2,3].includes(y.pageNum)&&l("initialization.layout.pageNum","分栏数为 1、2 或 3"),S("pageNum","preset",{1:"a4",2:"a3-two",3:"a3-three"}[y.pageNum]);for(const[O,D]of[["quesCard","questionCard"],["scoreType","halfPoint"],["mixOb","mergeObjective"],["choiceType","choiceDirection"]])u(y[O],`initialization.layout.${O}`),S(O,D,O==="choiceType"?y[O]?"column":"row":y[O]);s(y.preset,"initialization.layout.preset",["a4","a3-two","a3-three"]),s(y.choiceDirection,"initialization.layout.choiceDirection",["row","column"]),h(y.margin,"initialization.layout.margin",0,100),h(y.gap,"initialization.layout.gap",0,100);for(const O of["questionCard","scanMarking","halfPoint","mergeObjective"])u(y[O],`initialization.layout.${O}`);const E=g.header===void 0?{}:a(g.header,"initialization.header",["focusText","writeKaohao","missExam","mifeng","kaohao","weishu"]);for(const O of["focusText","writeKaohao","missExam","mifeng"])u(E[O],`initialization.header.${O}`);s(E.kaohao,"initialization.header.kaohao",["school","code"]),h(E.weishu,"initialization.header.weishu",4,12),E.weishu!==void 0&&!Number.isInteger(E.weishu)&&l("initialization.header.weishu","考号位数必须是整数");const R=Wc({name:m,...w,...C,mode:g.mode??"template"}),N={...R,...y,header:{...R.header,...E}},T=Jc(N);return(T.columnWidth<100||T.contentHeight<100)&&l("initialization.layout","边距或栏间距过大,纸张没有足够的作答区域"),N}function sC(n,r){if(typeof document>"u")throw new Error("请在浏览器挂载后创建制卡实例");const l=jl(r?.plugins||[]),a=iu(r.dictionaries),c=typeof n=="string"?document.querySelector(n):n;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 s=document.createElement("div");s.className="uni-answer-sheet-host",s.dataset.uniAnswerSheetMount="",s.style.height="100%",c.append(s);let u=!1,h={...r,dictionaries:a},g,m,b;const v=new Promise((S,E)=>{m=S,b=E});v.catch(()=>{});const w=()=>{if(u)throw new Error("制卡实例已销毁");if(!g?.isReady())throw new Error("请先等待 sheet.ready");return g},C=async()=>(await v,w()),y={ready:v,async initialize(S){if(u)throw new Error("制卡实例已销毁");const E=lC(S,h.dictionaries);g||(h={...h,initialValue:E}),await(await C()).setDocument(E)},getDocument:()=>w().getDocument(),load:async S=>(await C()).setDocument(S),setDocument:async S=>(await C()).setDocument(S),newDocument:async S=>(await C()).newDocument(S),getReferenceData:()=>w().getReferenceData(),setReferenceData:async S=>(await C()).setReferenceData(S),validate:async()=>(await C()).validate(),save:async()=>(await C()).save(),focusIssue:S=>w().focusIssue(S),setOptions(S){if(u)throw new Error("制卡实例已销毁");const E=Object.hasOwn(S,"dictionaries")?iu(S.dictionaries):h.dictionaries;h={...h,...S,dictionaries:E},g?.update(h)},destroy(){u||(u=!0,g?.destroy(),s.remove(),b(new DOMException("制卡实例已销毁","AbortError")))}};return Promise.all([l.prepare(),Promise.resolve().then(()=>EN)]).then(([,{mountAnswerSheet:S}])=>{u||(g=S(s,l,h,m,E=>{b(E),y.destroy(),h.onError?.(E instanceof Error?E:new Error(String(E)))}))}).catch(S=>{b(S),y.destroy(),h.onError?.(S instanceof Error?S:new Error(String(S)))}),y}function hm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var lu={exports:{}},fi={};/**
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={};/**
2
4
  * @license React
3
5
  * react-jsx-runtime.production.js
4
6
  *
@@ -6,7 +8,7 @@ var kM=Object.defineProperty;var ES=nt=>{throw TypeError(nt)};var HM=(nt,st,It)=
6
8
  *
7
9
  * This source code is licensed under the MIT license found in the
8
10
  * LICENSE file in the root directory of this source tree.
9
- */var mm;function cC(){if(mm)return fi;mm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function l(a,c,s){var u=null;if(s!==void 0&&(u=""+s),c.key!==void 0&&(u=""+c.key),"key"in c){s={};for(var h in c)h!=="key"&&(s[h]=c[h])}else s=c;return c=s.ref,{$$typeof:n,type:a,key:u,ref:c!==void 0?c:null,props:s}}return fi.Fragment=r,fi.jsx=l,fi.jsxs=l,fi}var pm;function uC(){return pm||(pm=1,lu.exports=cC()),lu.exports}var f=uC(),su={exports:{}},Me={};/**
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={};/**
10
12
  * @license React
11
13
  * react.production.js
12
14
  *
@@ -14,7 +16,7 @@ var kM=Object.defineProperty;var ES=nt=>{throw TypeError(nt)};var HM=(nt,st,It)=
14
16
  *
15
17
  * This source code is licensed under the MIT license found in the
16
18
  * LICENSE file in the root directory of this source tree.
17
- */var gm;function dC(){if(gm)return Me;gm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=v&&A[v]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,S={};function E(A,V,K){this.props=A,this.context=V,this.refs=S,this.updater=K||C}E.prototype.isReactComponent={},E.prototype.setState=function(A,V){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,V,"setState")},E.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function R(){}R.prototype=E.prototype;function N(A,V,K){this.props=A,this.context=V,this.refs=S,this.updater=K||C}var T=N.prototype=new R;T.constructor=N,y(T,E.prototype),T.isPureReactComponent=!0;var O=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},M=Object.prototype.hasOwnProperty;function z(A,V,K,ee,le,ce){return K=ce.ref,{$$typeof:n,type:A,key:V,ref:K!==void 0?K:null,props:ce}}function H(A,V){return z(A.type,V,void 0,void 0,void 0,A.props)}function G(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function X(A){var V={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(K){return V[K]})}var U=/\/+/g;function F(A,V){return typeof A=="object"&&A!==null&&A.key!=null?X(""+A.key):V.toString(36)}function J(){}function I(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(J,J):(A.status="pending",A.then(function(V){A.status==="pending"&&(A.status="fulfilled",A.value=V)},function(V){A.status==="pending"&&(A.status="rejected",A.reason=V)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function Y(A,V,K,ee,le){var ce=typeof A;(ce==="undefined"||ce==="boolean")&&(A=null);var ie=!1;if(A===null)ie=!0;else switch(ce){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(A.$$typeof){case n:case r:ie=!0;break;case b:return ie=A._init,Y(ie(A._payload),V,K,ee,le)}}if(ie)return le=le(A),ie=ee===""?"."+F(A,0):ee,O(le)?(K="",ie!=null&&(K=ie.replace(U,"$&/")+"/"),Y(le,V,K,"",function(be){return be})):le!=null&&(G(le)&&(le=H(le,K+(le.key==null||A&&A.key===le.key?"":(""+le.key).replace(U,"$&/")+"/")+ie)),V.push(le)),1;ie=0;var ge=ee===""?".":ee+":";if(O(A))for(var je=0;je<A.length;je++)ee=A[je],ce=ge+F(ee,je),ie+=Y(ee,V,K,ce,le);else if(je=w(A),typeof je=="function")for(A=je.call(A),je=0;!(ee=A.next()).done;)ee=ee.value,ce=ge+F(ee,je++),ie+=Y(ee,V,K,ce,le);else if(ce==="object"){if(typeof A.then=="function")return Y(I(A),V,K,ee,le);throw V=String(A),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ie}function k(A,V,K){if(A==null)return A;var ee=[],le=0;return Y(A,ee,"","",function(ce){return V.call(K,ce,le++)}),ee}function $(A){if(A._status===-1){var V=A._result;V=V(),V.then(function(K){(A._status===0||A._status===-1)&&(A._status=1,A._result=K)},function(K){(A._status===0||A._status===-1)&&(A._status=2,A._result=K)}),A._status===-1&&(A._status=0,A._result=V)}if(A._status===1)return A._result.default;throw A._result}var L=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function Z(){}return Me.Children={map:k,forEach:function(A,V,K){k(A,function(){V.apply(this,arguments)},K)},count:function(A){var V=0;return k(A,function(){V++}),V},toArray:function(A){return k(A,function(V){return V})||[]},only:function(A){if(!G(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Me.Component=E,Me.Fragment=l,Me.Profiler=c,Me.PureComponent=N,Me.StrictMode=a,Me.Suspense=g,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Me.__COMPILER_RUNTIME={__proto__:null,c:function(A){return D.H.useMemoCache(A)}},Me.cache=function(A){return function(){return A.apply(null,arguments)}},Me.cloneElement=function(A,V,K){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var ee=y({},A.props),le=A.key,ce=void 0;if(V!=null)for(ie in V.ref!==void 0&&(ce=void 0),V.key!==void 0&&(le=""+V.key),V)!M.call(V,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&V.ref===void 0||(ee[ie]=V[ie]);var ie=arguments.length-2;if(ie===1)ee.children=K;else if(1<ie){for(var ge=Array(ie),je=0;je<ie;je++)ge[je]=arguments[je+2];ee.children=ge}return z(A.type,le,void 0,void 0,ce,ee)},Me.createContext=function(A){return A={$$typeof:u,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:s,_context:A},A},Me.createElement=function(A,V,K){var ee,le={},ce=null;if(V!=null)for(ee in V.key!==void 0&&(ce=""+V.key),V)M.call(V,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(le[ee]=V[ee]);var ie=arguments.length-2;if(ie===1)le.children=K;else if(1<ie){for(var ge=Array(ie),je=0;je<ie;je++)ge[je]=arguments[je+2];le.children=ge}if(A&&A.defaultProps)for(ee in ie=A.defaultProps,ie)le[ee]===void 0&&(le[ee]=ie[ee]);return z(A,ce,void 0,void 0,null,le)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(A){return{$$typeof:h,render:A}},Me.isValidElement=G,Me.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:$}},Me.memo=function(A,V){return{$$typeof:m,type:A,compare:V===void 0?null:V}},Me.startTransition=function(A){var V=D.T,K={};D.T=K;try{var ee=A(),le=D.S;le!==null&&le(K,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(Z,L)}catch(ce){L(ce)}finally{D.T=V}},Me.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Me.use=function(A){return D.H.use(A)},Me.useActionState=function(A,V,K){return D.H.useActionState(A,V,K)},Me.useCallback=function(A,V){return D.H.useCallback(A,V)},Me.useContext=function(A){return D.H.useContext(A)},Me.useDebugValue=function(){},Me.useDeferredValue=function(A,V){return D.H.useDeferredValue(A,V)},Me.useEffect=function(A,V,K){var ee=D.H;if(typeof K=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(A,V)},Me.useId=function(){return D.H.useId()},Me.useImperativeHandle=function(A,V,K){return D.H.useImperativeHandle(A,V,K)},Me.useInsertionEffect=function(A,V){return D.H.useInsertionEffect(A,V)},Me.useLayoutEffect=function(A,V){return D.H.useLayoutEffect(A,V)},Me.useMemo=function(A,V){return D.H.useMemo(A,V)},Me.useOptimistic=function(A,V){return D.H.useOptimistic(A,V)},Me.useReducer=function(A,V,K){return D.H.useReducer(A,V,K)},Me.useRef=function(A){return D.H.useRef(A)},Me.useState=function(A){return D.H.useState(A)},Me.useSyncExternalStore=function(A,V,K){return D.H.useSyncExternalStore(A,V,K)},Me.useTransition=function(){return D.H.useTransition()},Me.version="19.1.1",Me}var ym;function cu(){return ym||(ym=1,su.exports=dC()),su.exports}var x=cu();const hi=hm(x),po=st({__proto__:null,default:hi},[x]);var uu={exports:{}},mi={},du={exports:{}},fu={};/**
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={};/**
18
20
  * @license React
19
21
  * scheduler.production.js
20
22
  *
@@ -22,7 +24,7 @@ var kM=Object.defineProperty;var ES=nt=>{throw TypeError(nt)};var HM=(nt,st,It)=
22
24
  *
23
25
  * This source code is licensed under the MIT license found in the
24
26
  * LICENSE file in the root directory of this source tree.
25
- */var vm;function fC(){return vm||(vm=1,(function(n){function r(k,$){var L=k.length;k.push($);e:for(;0<L;){var Z=L-1>>>1,A=k[Z];if(0<c(A,$))k[Z]=$,k[L]=A,L=Z;else break e}}function l(k){return k.length===0?null:k[0]}function a(k){if(k.length===0)return null;var $=k[0],L=k.pop();if(L!==$){k[0]=L;e:for(var Z=0,A=k.length,V=A>>>1;Z<V;){var K=2*(Z+1)-1,ee=k[K],le=K+1,ce=k[le];if(0>c(ee,L))le<A&&0>c(ce,ee)?(k[Z]=ce,k[le]=L,Z=le):(k[Z]=ee,k[K]=L,Z=K);else if(le<A&&0>c(ce,L))k[Z]=ce,k[le]=L,Z=le;else break e}}return $}function c(k,$){var L=k.sortIndex-$.sortIndex;return L!==0?L:k.id-$.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var u=Date,h=u.now();n.unstable_now=function(){return u.now()-h}}var g=[],m=[],b=1,v=null,w=3,C=!1,y=!1,S=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function O(k){for(var $=l(m);$!==null;){if($.callback===null)a(m);else if($.startTime<=k)a(m),$.sortIndex=$.expirationTime,r(g,$);else break;$=l(m)}}function D(k){if(S=!1,O(k),!y)if(l(g)!==null)y=!0,M||(M=!0,F());else{var $=l(m);$!==null&&Y(D,$.startTime-k)}}var M=!1,z=-1,H=5,G=-1;function X(){return E?!0:!(n.unstable_now()-G<H)}function U(){if(E=!1,M){var k=n.unstable_now();G=k;var $=!0;try{e:{y=!1,S&&(S=!1,N(z),z=-1),C=!0;var L=w;try{t:{for(O(k),v=l(g);v!==null&&!(v.expirationTime>k&&X());){var Z=v.callback;if(typeof Z=="function"){v.callback=null,w=v.priorityLevel;var A=Z(v.expirationTime<=k);if(k=n.unstable_now(),typeof A=="function"){v.callback=A,O(k),$=!0;break t}v===l(g)&&a(g),O(k)}else a(g);v=l(g)}if(v!==null)$=!0;else{var V=l(m);V!==null&&Y(D,V.startTime-k),$=!1}}break e}finally{v=null,w=L,C=!1}$=void 0}}finally{$?F():M=!1}}}var F;if(typeof T=="function")F=function(){T(U)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,I=J.port2;J.port1.onmessage=U,F=function(){I.postMessage(null)}}else F=function(){R(U,0)};function Y(k,$){z=R(function(){k(n.unstable_now())},$)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return w},n.unstable_next=function(k){switch(w){case 1:case 2:case 3:var $=3;break;default:$=w}var L=w;w=$;try{return k()}finally{w=L}},n.unstable_requestPaint=function(){E=!0},n.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var L=w;w=k;try{return $()}finally{w=L}},n.unstable_scheduleCallback=function(k,$,L){var Z=n.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?Z+L:Z):L=Z,k){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=L+A,k={id:b++,callback:$,priorityLevel:k,startTime:L,expirationTime:A,sortIndex:-1},L>Z?(k.sortIndex=L,r(m,k),l(g)===null&&k===l(m)&&(S?(N(z),z=-1):S=!0,Y(D,L-Z))):(k.sortIndex=A,r(g,k),y||C||(y=!0,M||(M=!0,F()))),k},n.unstable_shouldYield=X,n.unstable_wrapCallback=function(k){var $=w;return function(){var L=w;w=$;try{return k.apply(this,arguments)}finally{w=L}}}})(fu)),fu}var bm;function hC(){return bm||(bm=1,du.exports=fC()),du.exports}var hu={exports:{}},Ut={};/**
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={};/**
26
28
  * @license React
27
29
  * react-dom.production.js
28
30
  *
@@ -30,7 +32,7 @@ var kM=Object.defineProperty;var ES=nt=>{throw TypeError(nt)};var HM=(nt,st,It)=
30
32
  *
31
33
  * This source code is licensed under the MIT license found in the
32
34
  * LICENSE file in the root directory of this source tree.
33
- */var xm;function mC(){if(xm)return Ut;xm=1;var n=cu();function r(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var a={d:{f:l,r:function(){throw Error(r(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},c=Symbol.for("react.portal");function s(g,m,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:v==null?null:""+v,children:g,containerInfo:m,implementation:b}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ut.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(r(299));return s(g,m,null,b)},Ut.flushSync=function(g){var m=u.T,b=a.p;try{if(u.T=null,a.p=2,g)return g()}finally{u.T=m,a.p=b,a.d.f()}},Ut.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(g,m))},Ut.prefetchDNS=function(g){typeof g=="string"&&a.d.D(g)},Ut.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,v=h(b,m.crossOrigin),w=typeof m.integrity=="string"?m.integrity:void 0,C=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?a.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:w,fetchPriority:C}):b==="script"&&a.d.X(g,{crossOrigin:v,integrity:w,fetchPriority:C,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Ut.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=h(m.as,m.crossOrigin);a.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(g)},Ut.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,v=h(b,m.crossOrigin);a.d.L(g,b,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Ut.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=h(m.as,m.crossOrigin);a.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(g)},Ut.requestFormReset=function(g){a.d.r(g)},Ut.unstable_batchedUpdates=function(g,m){return g(m)},Ut.useFormState=function(g,m,b){return u.H.useFormState(g,m,b)},Ut.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ut.version="19.1.1",Ut}var Sm;function Cm(){if(Sm)return hu.exports;Sm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),hu.exports=mC(),hu.exports}/**
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}/**
34
36
  * @license React
35
37
  * react-dom-client.production.js
36
38
  *
@@ -38,163 +40,163 @@ var kM=Object.defineProperty;var ES=nt=>{throw TypeError(nt)};var HM=(nt,st,It)=
38
40
  *
39
41
  * This source code is licensed under the MIT license found in the
40
42
  * LICENSE file in the root directory of this source tree.
41
- */var wm;function pC(){if(wm)return mi;wm=1;var n=hC(),r=cu(),l=Cm();function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)t+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+e+"; visit "+t+" 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 s(e){var t=e,o=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(o=t.return),e=t.return;while(e)}return t.tag===3?o:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(s(e)!==e)throw Error(a(188))}function g(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t!==e?null:e}for(var o=e,i=t;;){var d=o.return;if(d===null)break;var p=d.alternate;if(p===null){if(i=d.return,i!==null){o=i;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===o)return h(d),e;if(p===i)return h(d),t;p=p.sibling}throw Error(a(188))}if(o.return!==i.return)o=d,i=p;else{for(var j=!1,_=d.child;_;){if(_===o){j=!0,o=d,i=p;break}if(_===i){j=!0,i=d,o=p;break}_=_.sibling}if(!j){for(_=p.child;_;){if(_===o){j=!0,o=p,i=d;break}if(_===i){j=!0,i=p,o=d;break}_=_.sibling}if(!j)throw Error(a(189))}}if(o.alternate!==i)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),N=Symbol.for("react.consumer"),T=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function I(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case E:return"Profiler";case S:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case G:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case T:return(e.displayName||"Context")+".Provider";case N:return(e._context.displayName||"Context")+".Consumer";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:I(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return I(e(t))}catch{}}return null}var Y=Array.isArray,k=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},Z=[],A=-1;function V(e){return{current:e}}function K(e){0>A||(e.current=Z[A],Z[A]=null,A--)}function ee(e,t){A++,Z[A]=e.current,e.current=t}var le=V(null),ce=V(null),ie=V(null),ge=V(null);function je(e,t){switch(ee(ie,t),ee(ce,e),ee(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?W0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=W0(t),e=J0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}K(le),ee(le,e)}function be(){K(le),K(ce),K(ie)}function de(e){e.memoizedState!==null&&ee(ge,e);var t=le.current,o=J0(t,e.type);t!==o&&(ee(ce,e),ee(le,o))}function Se(e){ce.current===e&&(K(le),K(ce)),ge.current===e&&(K(ge),Sl._currentValue=L)}var _e=Object.prototype.hasOwnProperty,Ce=n.unstable_scheduleCallback,Ae=n.unstable_cancelCallback,$e=n.unstable_shouldYield,Dn=n.unstable_requestPaint,jt=n.unstable_now,pe=n.unstable_getCurrentPriorityLevel,ct=n.unstable_ImmediatePriority,ut=n.unstable_UserBlockingPriority,an=n.unstable_NormalPriority,hr=n.unstable_LowPriority,pa=n.unstable_IdlePriority,ga=n.log,Pr=n.unstable_setDisableYieldValue,mr=null,se=null;function Re(e){if(typeof ga=="function"&&Pr(e),se&&typeof se.setStrictMode=="function")try{se.setStrictMode(mr,e)}catch{}}var ye=Math.clz32?Math.clz32:Ne,ve=Math.log,Ke=Math.LN2;function Ne(e){return e>>>=0,e===0?32:31-(ve(e)/Ke|0)|0}var Fe=256,Xt=4194304;function Yn(e){var t=e&42;if(t!==0)return t;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 No(e,t,o){var i=e.pendingLanes;if(i===0)return 0;var d=0,p=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var _=i&134217727;return _!==0?(i=_&~p,i!==0?d=Yn(i):(j&=_,j!==0?d=Yn(j):o||(o=_&~e,o!==0&&(d=Yn(o))))):(_=i&~p,_!==0?d=Yn(_):j!==0?d=Yn(j):o||(o=i&~e,o!==0&&(d=Yn(o)))),d===0?0:t!==0&&t!==d&&(t&p)===0&&(p=d&-d,o=t&-t,p>=o||p===32&&(o&4194048)!==0)?t:d}function In(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function pr(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ns(){var e=Fe;return Fe<<=1,(Fe&4194048)===0&&(Fe=256),e}function Lv(){var e=Xt;return Xt<<=1,(Xt&62914560)===0&&(Xt=4194304),e}function Hd(e){for(var t=[],o=0;31>o;o++)t.push(e);return t}function Mi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function TN(e,t,o,i,d,p){var j=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 _=e.entanglements,B=e.expirationTimes,W=e.hiddenUpdates;for(o=j&~o;0<o;){var re=31-ye(o),ae=1<<re;_[re]=0,B[re]=-1;var te=W[re];if(te!==null)for(W[re]=null,re=0;re<te.length;re++){var ne=te[re];ne!==null&&(ne.lane&=-536870913)}o&=~ae}i!==0&&kv(e,i,0),p!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=p&~(j&~t))}function kv(e,t,o){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-ye(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|o&4194090}function Hv(e,t){var o=e.entangledLanes|=t;for(e=e.entanglements;o;){var i=31-ye(o),d=1<<i;d&t|e[i]&t&&(e[i]|=t),o&=~d}}function Bd(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 Ud(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Bv(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:vS(e.type))}function jN(e,t){var o=$.p;try{return $.p=e,t()}finally{$.p=o}}var $r=Math.random().toString(36).slice(2),$t="__reactFiber$"+$r,Zt="__reactProps$"+$r,ya="__reactContainer$"+$r,Pd="__reactEvents$"+$r,ON="__reactListeners$"+$r,RN="__reactHandles$"+$r,Uv="__reactResources$"+$r,_i="__reactMarker$"+$r;function $d(e){delete e[$t],delete e[Zt],delete e[Pd],delete e[ON],delete e[RN]}function va(e){var t=e[$t];if(t)return t;for(var o=e.parentNode;o;){if(t=o[ya]||o[$t]){if(o=t.alternate,t.child!==null||o!==null&&o.child!==null)for(e=rS(e);e!==null;){if(o=e[$t])return o;e=rS(e)}return t}e=o,o=e.parentNode}return null}function ba(e){if(e=e[$t]||e[ya]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Di(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function xa(e){var t=e[Uv];return t||(t=e[Uv]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[_i]=!0}var Pv=new Set,$v={};function Ao(e,t){Sa(e,t),Sa(e+"Capture",t)}function Sa(e,t){for($v[e]=t,e=0;e<t.length;e++)Pv.add(t[e])}var NN=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]*$"),Gv={},Vv={};function AN(e){return _e.call(Vv,e)?!0:_e.call(Gv,e)?!1:NN.test(e)?Vv[e]=!0:(Gv[e]=!0,!1)}function As(e,t,o){if(AN(t))if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+o)}}function Ms(e,t,o){if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+o)}}function gr(e,t,o,i){if(i===null)e.removeAttribute(o);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(t,o,""+i)}}var Gd,qv;function Ca(e){if(Gd===void 0)try{throw Error()}catch(o){var t=o.stack.trim().match(/\n( *(at )?)/);Gd=t&&t[1]||"",qv=-1<o.stack.indexOf(`
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(`
42
44
  at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Gd+e+qv}var Vd=!1;function qd(e,t){if(!e||Vd)return"";Vd=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(ne){var te=ne}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(ne){te=ne}e.call(ae.prototype)}}else{try{throw Error()}catch(ne){te=ne}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(ne){if(ne&&te&&typeof ne.stack=="string")return[ne.stack,te.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=i.DetermineComponentFrameRoot(),j=p[0],_=p[1];if(j&&_){var B=j.split(`
44
- `),W=_.split(`
45
- `);for(d=i=0;i<B.length&&!B[i].includes("DetermineComponentFrameRoot");)i++;for(;d<W.length&&!W[d].includes("DetermineComponentFrameRoot");)d++;if(i===B.length||d===W.length)for(i=B.length-1,d=W.length-1;1<=i&&0<=d&&B[i]!==W[d];)d--;for(;1<=i&&0<=d;i--,d--)if(B[i]!==W[d]){if(i!==1||d!==1)do if(i--,d--,0>d||B[i]!==W[d]){var re=`
46
- `+B[i].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=i&&0<=d);break}}}finally{Vd=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?Ca(o):""}function MN(e){switch(e.tag){case 26:case 27:case 5:return Ca(e.type);case 16:return Ca("Lazy");case 13:return Ca("Suspense");case 19:return Ca("SuspenseList");case 0:case 15:return qd(e.type,!1);case 11:return qd(e.type.render,!1);case 1:return qd(e.type,!0);case 31:return Ca("Activity");default:return""}}function Yv(e){try{var t="";do t+=MN(e),e=e.return;while(e);return t}catch(o){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(`
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
49
  Error generating stack: `+o.message+`
48
- `+o.stack}}function Sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _N(e){var t=Xv(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var d=o.get,p=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(j){i=""+j,p.call(this,j)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return i},setValue:function(j){i=""+j},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _s(e){e._valueTracker||(e._valueTracker=_N(e))}function Kv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),i="";return e&&(i=Xv(e)?e.checked?"true":"false":e.value),e=i,e!==o?(t.setValue(e),!0):!1}function Ds(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 DN=/[\n"\\]/g;function Cn(e){return e.replace(DN,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Yd(e,t,o,i,d,p,j,_){e.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.type=j:e.removeAttribute("type"),t!=null?j==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Sn(t)):e.value!==""+Sn(t)&&(e.value=""+Sn(t)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),t!=null?Xd(e,j,Sn(t)):o!=null?Xd(e,j,Sn(o)):i!=null&&e.removeAttribute("value"),d==null&&p!=null&&(e.defaultChecked=!!p),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+Sn(_):e.removeAttribute("name")}function Fv(e,t,o,i,d,p,j,_){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),t!=null||o!=null){if(!(p!=="submit"&&p!=="reset"||t!=null))return;o=o!=null?""+Sn(o):"",t=t!=null?""+Sn(t):o,_||t===e.value||(e.value=t),e.defaultValue=t}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=_?e.checked:!!i,e.defaultChecked=!!i,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(e.name=j)}function Xd(e,t,o){t==="number"&&Ds(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function wa(e,t,o,i){if(e=e.options,t){t={};for(var d=0;d<o.length;d++)t["$"+o[d]]=!0;for(o=0;o<e.length;o++)d=t.hasOwnProperty("$"+e[o].value),e[o].selected!==d&&(e[o].selected=d),d&&i&&(e[o].defaultSelected=!0)}else{for(o=""+Sn(o),t=null,d=0;d<e.length;d++){if(e[d].value===o){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Qv(e,t,o){if(t!=null&&(t=""+Sn(t),t!==e.value&&(e.value=t),o==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=o!=null?""+Sn(o):""}function Zv(e,t,o,i){if(t==null){if(i!=null){if(o!=null)throw Error(a(92));if(Y(i)){if(1<i.length)throw Error(a(93));i=i[0]}o=i}o==null&&(o=""),t=o}o=Sn(t),e.defaultValue=o,i=e.textContent,i===o&&i!==""&&i!==null&&(e.value=i)}function Ea(e,t){if(t){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=t;return}}e.textContent=t}var IN=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 Wv(e,t,o){var i=t.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,o):typeof o!="number"||o===0||IN.has(t)?t==="float"?e.cssFloat=o:e[t]=(""+o).trim():e[t]=o+"px"}function Jv(e,t,o){if(t!=null&&typeof t!="object")throw Error(a(62));if(e=e.style,o!=null){for(var i in o)!o.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in t)i=t[d],t.hasOwnProperty(d)&&o[d]!==i&&Wv(e,d,i)}else for(var p in t)t.hasOwnProperty(p)&&Wv(e,p,t[p])}function Kd(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 zN=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"]]),LN=/^[\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 Is(e){return LN.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Fd=null;function Qd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ta=null,ja=null;function eb(e){var t=ba(e);if(t&&(e=t.stateNode)){var o=e[Zt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Yd(e,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),t=o.name,o.type==="radio"&&t!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Cn(""+t)+'"][type="radio"]'),t=0;t<o.length;t++){var i=o[t];if(i!==e&&i.form===e.form){var d=i[Zt]||null;if(!d)throw Error(a(90));Yd(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<o.length;t++)i=o[t],i.form===e.form&&Kv(i)}break e;case"textarea":Qv(e,o.value,o.defaultValue);break e;case"select":t=o.value,t!=null&&wa(e,!!o.multiple,t,!1)}}}var Zd=!1;function tb(e,t,o){if(Zd)return e(t,o);Zd=!0;try{var i=e(t);return i}finally{if(Zd=!1,(Ta!==null||ja!==null)&&(bc(),Ta&&(t=Ta,e=ja,ja=Ta=null,eb(t),e)))for(t=0;t<e.length;t++)eb(e[t])}}function Ii(e,t){var o=e.stateNode;if(o===null)return null;var i=o[Zt]||null;if(i===null)return null;o=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(a(231,t,typeof o));return o}var yr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wd=!1;if(yr)try{var zi={};Object.defineProperty(zi,"passive",{get:function(){Wd=!0}}),window.addEventListener("test",zi,zi),window.removeEventListener("test",zi,zi)}catch{Wd=!1}var Gr=null,Jd=null,zs=null;function nb(){if(zs)return zs;var e,t=Jd,o=t.length,i,d="value"in Gr?Gr.value:Gr.textContent,p=d.length;for(e=0;e<o&&t[e]===d[e];e++);var j=o-e;for(i=1;i<=j&&t[o-i]===d[p-i];i++);return zs=d.slice(e,1<i?1-i:void 0)}function Ls(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ks(){return!0}function rb(){return!1}function Wt(e){function t(o,i,d,p,j){this._reactName=o,this._targetInst=d,this.type=i,this.nativeEvent=p,this.target=j,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(o=e[_],this[_]=o?o(p):p[_]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?ks:rb,this.isPropagationStopped=rb,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=ks)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=ks)},persist:function(){},isPersistent:ks}),t}var Mo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hs=Wt(Mo),Li=b({},Mo,{view:0,detail:0}),kN=Wt(Li),ef,tf,ki,Bs=b({},Li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rf,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"?(ef=e.screenX-ki.screenX,tf=e.screenY-ki.screenY):tf=ef=0,ki=e),ef)},movementY:function(e){return"movementY"in e?e.movementY:tf}}),ob=Wt(Bs),HN=b({},Bs,{dataTransfer:0}),BN=Wt(HN),UN=b({},Li,{relatedTarget:0}),nf=Wt(UN),PN=b({},Mo,{animationName:0,elapsedTime:0,pseudoElement:0}),$N=Wt(PN),GN=b({},Mo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),VN=Wt(GN),qN=b({},Mo,{data:0}),ab=Wt(qN),YN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XN={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"},KN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function FN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=KN[e])?!!t[e]:!1}function rf(){return FN}var QN=b({},Li,{key:function(e){if(e.key){var t=YN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ls(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?XN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rf,charCode:function(e){return e.type==="keypress"?Ls(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ls(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ZN=Wt(QN),WN=b({},Bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ib=Wt(WN),JN=b({},Li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rf}),eA=Wt(JN),tA=b({},Mo,{propertyName:0,elapsedTime:0,pseudoElement:0}),nA=Wt(tA),rA=b({},Bs,{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}),oA=Wt(rA),aA=b({},Mo,{newState:0,oldState:0}),iA=Wt(aA),lA=[9,13,27,32],of=yr&&"CompositionEvent"in window,Hi=null;yr&&"documentMode"in document&&(Hi=document.documentMode);var sA=yr&&"TextEvent"in window&&!Hi,lb=yr&&(!of||Hi&&8<Hi&&11>=Hi),sb=" ",cb=!1;function ub(e,t){switch(e){case"keyup":return lA.indexOf(t.keyCode)!==-1;case"keydown":return t.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 Oa=!1;function cA(e,t){switch(e){case"compositionend":return db(t);case"keypress":return t.which!==32?null:(cb=!0,sb);case"textInput":return e=t.data,e===sb&&cb?null:e;default:return null}}function uA(e,t){if(Oa)return e==="compositionend"||!of&&ub(e,t)?(e=nb(),zs=Jd=Gr=null,Oa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return lb&&t.locale!=="ko"?null:t.data;default:return null}}var dA={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 fb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dA[e.type]:t==="textarea"}function hb(e,t,o,i){Ta?ja?ja.push(i):ja=[i]:Ta=i,t=Tc(t,"onChange"),0<t.length&&(o=new Hs("onChange","change",null,o,i),e.push({event:o,listeners:t}))}var Bi=null,Ui=null;function fA(e){X0(e,0)}function Us(e){var t=Di(e);if(Kv(t))return e}function mb(e,t){if(e==="change")return t}var pb=!1;if(yr){var af;if(yr){var lf="oninput"in document;if(!lf){var gb=document.createElement("div");gb.setAttribute("oninput","return;"),lf=typeof gb.oninput=="function"}af=lf}else af=!1;pb=af&&(!document.documentMode||9<document.documentMode)}function yb(){Bi&&(Bi.detachEvent("onpropertychange",vb),Ui=Bi=null)}function vb(e){if(e.propertyName==="value"&&Us(Ui)){var t=[];hb(t,Ui,e,Qd(e)),tb(fA,t)}}function hA(e,t,o){e==="focusin"?(yb(),Bi=t,Ui=o,Bi.attachEvent("onpropertychange",vb)):e==="focusout"&&yb()}function mA(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Us(Ui)}function pA(e,t){if(e==="click")return Us(t)}function gA(e,t){if(e==="input"||e==="change")return Us(t)}function yA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ln=typeof Object.is=="function"?Object.is:yA;function Pi(e,t){if(ln(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(i=0;i<o.length;i++){var d=o[i];if(!_e.call(t,d)||!ln(e[d],t[d]))return!1}return!0}function bb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xb(e,t){var o=bb(e);e=0;for(var i;o;){if(o.nodeType===3){if(i=e+o.textContent.length,e<=t&&i>=t)return{node:o,offset:t-e};e=i}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=bb(o)}}function Sb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cb(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ds(e.document);t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href=="string"}catch{o=!1}if(o)e=t.contentWindow;else break;t=Ds(e.document)}return t}function sf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var vA=yr&&"documentMode"in document&&11>=document.documentMode,Ra=null,cf=null,$i=null,uf=!1;function wb(e,t,o){var i=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;uf||Ra==null||Ra!==Ds(i)||(i=Ra,"selectionStart"in i&&sf(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),$i&&Pi($i,i)||($i=i,i=Tc(cf,"onSelect"),0<i.length&&(t=new Hs("onSelect","select",null,t,o),e.push({event:t,listeners:i}),t.target=Ra)))}function _o(e,t){var o={};return o[e.toLowerCase()]=t.toLowerCase(),o["Webkit"+e]="webkit"+t,o["Moz"+e]="moz"+t,o}var Na={animationend:_o("Animation","AnimationEnd"),animationiteration:_o("Animation","AnimationIteration"),animationstart:_o("Animation","AnimationStart"),transitionrun:_o("Transition","TransitionRun"),transitionstart:_o("Transition","TransitionStart"),transitioncancel:_o("Transition","TransitionCancel"),transitionend:_o("Transition","TransitionEnd")},df={},Eb={};yr&&(Eb=document.createElement("div").style,"AnimationEvent"in window||(delete Na.animationend.animation,delete Na.animationiteration.animation,delete Na.animationstart.animation),"TransitionEvent"in window||delete Na.transitionend.transition);function Do(e){if(df[e])return df[e];if(!Na[e])return e;var t=Na[e],o;for(o in t)if(t.hasOwnProperty(o)&&o in Eb)return df[e]=t[o];return e}var Tb=Do("animationend"),jb=Do("animationiteration"),Ob=Do("animationstart"),bA=Do("transitionrun"),xA=Do("transitionstart"),SA=Do("transitioncancel"),Rb=Do("transitionend"),Nb=new Map,ff="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(" ");ff.push("scrollEnd");function zn(e,t){Nb.set(e,t),Ao(t,[e])}var Ab=new WeakMap;function wn(e,t){if(typeof e=="object"&&e!==null){var o=Ab.get(e);return o!==void 0?o:(t={value:e,source:t,stack:Yv(t)},Ab.set(e,t),t)}return{value:e,source:t,stack:Yv(t)}}var En=[],Aa=0,hf=0;function Ps(){for(var e=Aa,t=hf=Aa=0;t<e;){var o=En[t];En[t++]=null;var i=En[t];En[t++]=null;var d=En[t];En[t++]=null;var p=En[t];if(En[t++]=null,i!==null&&d!==null){var j=i.pending;j===null?d.next=d:(d.next=j.next,j.next=d),i.pending=d}p!==0&&Mb(o,d,p)}}function $s(e,t,o,i){En[Aa++]=e,En[Aa++]=t,En[Aa++]=o,En[Aa++]=i,hf|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function mf(e,t,o,i){return $s(e,t,o,i),Gs(e)}function Ma(e,t){return $s(e,null,null,t),Gs(e)}function Mb(e,t,o){e.lanes|=o;var i=e.alternate;i!==null&&(i.lanes|=o);for(var d=!1,p=e.return;p!==null;)p.childLanes|=o,i=p.alternate,i!==null&&(i.childLanes|=o),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(d=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,d&&t!==null&&(d=31-ye(o),e=p.hiddenUpdates,i=e[d],i===null?e[d]=[t]:i.push(t),t.lane=o|536870912),p):null}function Gs(e){if(50<hl)throw hl=0,xh=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var _a={};function CA(e,t,o,i){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=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(e,t,o,i){return new CA(e,t,o,i)}function pf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vr(e,t){var o=e.alternate;return o===null?(o=sn(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,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,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o.refCleanup=e.refCleanup,o}function _b(e,t){e.flags&=65011714;var o=e.alternate;return o===null?(e.childLanes=0,e.lanes=t,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,t=o.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Vs(e,t,o,i,d,p){var j=0;if(i=e,typeof e=="function")pf(e)&&(j=1);else if(typeof e=="string")j=EM(e,o,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case G:return e=sn(31,o,t,d),e.elementType=G,e.lanes=p,e;case y:return Io(o.children,d,p,t);case S:j=8,d|=24;break;case E:return e=sn(12,o,t,d|2),e.elementType=E,e.lanes=p,e;case D:return e=sn(13,o,t,d),e.elementType=D,e.lanes=p,e;case M:return e=sn(19,o,t,d),e.elementType=M,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:case T:j=10;break e;case N:j=9;break e;case O:j=11;break e;case z:j=14;break e;case H:j=16,i=null;break e}j=29,o=Error(a(130,e===null?"null":typeof e,"")),i=null}return t=sn(j,o,t,d),t.elementType=e,t.type=i,t.lanes=p,t}function Io(e,t,o,i){return e=sn(7,e,i,t),e.lanes=o,e}function gf(e,t,o){return e=sn(6,e,null,t),e.lanes=o,e}function yf(e,t,o){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Da=[],Ia=0,qs=null,Ys=0,Tn=[],jn=0,zo=null,br=1,xr="";function Lo(e,t){Da[Ia++]=Ys,Da[Ia++]=qs,qs=e,Ys=t}function Db(e,t,o){Tn[jn++]=br,Tn[jn++]=xr,Tn[jn++]=zo,zo=e;var i=br;e=xr;var d=32-ye(i)-1;i&=~(1<<d),o+=1;var p=32-ye(t)+d;if(30<p){var j=d-d%5;p=(i&(1<<j)-1).toString(32),i>>=j,d-=j,br=1<<32-ye(t)+d|o<<d|i,xr=p+e}else br=1<<p|o<<d|i,xr=e}function vf(e){e.return!==null&&(Lo(e,1),Db(e,1,0))}function bf(e){for(;e===qs;)qs=Da[--Ia],Da[Ia]=null,Ys=Da[--Ia],Da[Ia]=null;for(;e===zo;)zo=Tn[--jn],Tn[jn]=null,xr=Tn[--jn],Tn[jn]=null,br=Tn[--jn],Tn[jn]=null}var Kt=null,dt=null,Xe=!1,ko=null,Xn=!1,xf=Error(a(519));function Ho(e){var t=Error(a(418,""));throw qi(wn(t,e)),xf}function Ib(e){var t=e.stateNode,o=e.type,i=e.memoizedProps;switch(t[$t]=e,t[Zt]=i,o){case"dialog":Ue("cancel",t),Ue("close",t);break;case"iframe":case"object":case"embed":Ue("load",t);break;case"video":case"audio":for(o=0;o<pl.length;o++)Ue(pl[o],t);break;case"source":Ue("error",t);break;case"img":case"image":case"link":Ue("error",t),Ue("load",t);break;case"details":Ue("toggle",t);break;case"input":Ue("invalid",t),Fv(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),_s(t);break;case"select":Ue("invalid",t);break;case"textarea":Ue("invalid",t),Zv(t,i.value,i.defaultValue,i.children),_s(t)}o=i.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||t.textContent===""+o||i.suppressHydrationWarning===!0||Z0(t.textContent,o)?(i.popover!=null&&(Ue("beforetoggle",t),Ue("toggle",t)),i.onScroll!=null&&Ue("scroll",t),i.onScrollEnd!=null&&Ue("scrollend",t),i.onClick!=null&&(t.onclick=jc),t=!0):t=!1,t||Ho(e)}function zb(e){for(Kt=e.return;Kt;)switch(Kt.tag){case 5:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:Kt=Kt.return}}function Gi(e){if(e!==Kt)return!1;if(!Xe)return zb(e),Xe=!0,!1;var t=e.tag,o;if((o=t!==3&&t!==27)&&((o=t===5)&&(o=e.type,o=!(o!=="form"&&o!=="button")||Lh(e.type,e.memoizedProps)),o=!o),o&&dt&&Ho(e),zb(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(o=e.data,o==="/$"){if(t===0){dt=kn(e.nextSibling);break e}t--}else o!=="$"&&o!=="$!"&&o!=="$?"||t++;e=e.nextSibling}dt=null}}else t===27?(t=dt,ao(e.type)?(e=Uh,Uh=null,dt=e):dt=t):dt=Kt?kn(e.stateNode.nextSibling):null;return!0}function Vi(){dt=Kt=null,Xe=!1}function Lb(){var e=ko;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),ko=null),e}function qi(e){ko===null?ko=[e]:ko.push(e)}var Sf=V(null),Bo=null,Sr=null;function Vr(e,t,o){ee(Sf,t._currentValue),t._currentValue=o}function Cr(e){e._currentValue=Sf.current,K(Sf)}function Cf(e,t,o){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===o)break;e=e.return}}function wf(e,t,o,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var p=d.dependencies;if(p!==null){var j=d.child;p=p.firstContext;e:for(;p!==null;){var _=p;p=d;for(var B=0;B<t.length;B++)if(_.context===t[B]){p.lanes|=o,_=p.alternate,_!==null&&(_.lanes|=o),Cf(p.return,o,e),i||(j=null);break e}p=_.next}}else if(d.tag===18){if(j=d.return,j===null)throw Error(a(341));j.lanes|=o,p=j.alternate,p!==null&&(p.lanes|=o),Cf(j,o,e),j=null}else j=d.child;if(j!==null)j.return=d;else for(j=d;j!==null;){if(j===e){j=null;break}if(d=j.sibling,d!==null){d.return=j.return,j=d;break}j=j.return}d=j}}function Yi(e,t,o,i){e=null;for(var d=t,p=!1;d!==null;){if(!p){if((d.flags&524288)!==0)p=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var j=d.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var _=d.type;ln(d.pendingProps.value,j.value)||(e!==null?e.push(_):e=[_])}}else if(d===ge.current){if(j=d.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Sl):e=[Sl])}d=d.return}e!==null&&wf(t,e,o,i),t.flags|=262144}function Xs(e){for(e=e.firstContext;e!==null;){if(!ln(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Uo(e){Bo=e,Sr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return kb(Bo,e)}function Ks(e,t){return Bo===null&&Uo(e),kb(e,t)}function kb(e,t){var o=t._currentValue;if(t={context:t,memoizedValue:o,next:null},Sr===null){if(e===null)throw Error(a(308));Sr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sr=Sr.next=t;return o}var wA=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(o,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(o){return o()})}},EA=n.unstable_scheduleCallback,TA=n.unstable_NormalPriority,Ot={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ef(){return{controller:new wA,data:new Map,refCount:0}}function Xi(e){e.refCount--,e.refCount===0&&EA(TA,function(){e.controller.abort()})}var Ki=null,Tf=0,za=0,La=null;function jA(e,t){if(Ki===null){var o=Ki=[];Tf=0,za=Oh(),La={status:"pending",value:void 0,then:function(i){o.push(i)}}}return Tf++,t.then(Hb,Hb),t}function Hb(){if(--Tf===0&&Ki!==null){La!==null&&(La.status="fulfilled");var e=Ki;Ki=null,za=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function OA(e,t){var o=[],i={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var d=0;d<o.length;d++)(0,o[d])(t)},function(d){for(i.status="rejected",i.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),i}var Bb=k.S;k.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&jA(e,t),Bb!==null&&Bb(e,t)};var Po=V(null);function jf(){var e=Po.current;return e!==null?e:rt.pooledCache}function Fs(e,t){t===null?ee(Po,Po.current):ee(Po,t.pool)}function Ub(){var e=jf();return e===null?null:{parent:Ot._currentValue,pool:e}}var Fi=Error(a(460)),Pb=Error(a(474)),Qs=Error(a(542)),Of={then:function(){}};function $b(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zs(){}function Gb(e,t,o){switch(o=e[o],o===void 0?e.push(t):o!==t&&(t.then(Zs,Zs),t=o),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qb(e),e;default:if(typeof t.status=="string")t.then(Zs,Zs);else{if(e=rt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=i}},function(i){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qb(e),e}throw Qi=t,Fi}}var Qi=null;function Vb(){if(Qi===null)throw Error(a(459));var e=Qi;return Qi=null,e}function qb(e){if(e===Fi||e===Qs)throw Error(a(483))}var qr=!1;function Rf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Yr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xr(e,t,o){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Qe&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,t=Gs(e),Mb(e,null,o),t}return $s(e,i,t,o),Gs(e)}function Zi(e,t,o){if(t=t.updateQueue,t!==null&&(t=t.shared,(o&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,o|=i,t.lanes=o,Hv(e,o)}}function Af(e,t){var o=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,o===i)){var d=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var j={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};p===null?d=p=j:p=p.next=j,o=o.next}while(o!==null);p===null?d=p=t:p=p.next=t}else d=p=t;o={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:i.shared,callbacks:i.callbacks},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=t:e.next=t,o.lastBaseUpdate=t}var Mf=!1;function Wi(){if(Mf){var e=La;if(e!==null)throw e}}function Ji(e,t,o,i){Mf=!1;var d=e.updateQueue;qr=!1;var p=d.firstBaseUpdate,j=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var B=_,W=B.next;B.next=null,j===null?p=W:j.next=W,j=B;var re=e.alternate;re!==null&&(re=re.updateQueue,_=re.lastBaseUpdate,_!==j&&(_===null?re.firstBaseUpdate=W:_.next=W,re.lastBaseUpdate=B))}if(p!==null){var ae=d.baseState;j=0,re=W=B=null,_=p;do{var te=_.lane&-536870913,ne=te!==_.lane;if(ne?(Ge&te)===te:(i&te)===te){te!==0&&te===za&&(Mf=!0),re!==null&&(re=re.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Oe=e,Ee=_;te=t;var et=o;switch(Ee.tag){case 1:if(Oe=Ee.payload,typeof Oe=="function"){ae=Oe.call(et,ae,te);break e}ae=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ee.payload,te=typeof Oe=="function"?Oe.call(et,ae,te):Oe,te==null)break e;ae=b({},ae,te);break e;case 2:qr=!0}}te=_.callback,te!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=d.callbacks,ne===null?d.callbacks=[te]:ne.push(te))}else ne={lane:te,tag:_.tag,payload:_.payload,callback:_.callback,next:null},re===null?(W=re=ne,B=ae):re=re.next=ne,j|=te;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;ne=_,_=ne.next,ne.next=null,d.lastBaseUpdate=ne,d.shared.pending=null}}while(!0);re===null&&(B=ae),d.baseState=B,d.firstBaseUpdate=W,d.lastBaseUpdate=re,p===null&&(d.shared.lanes=0),to|=j,e.lanes=j,e.memoizedState=ae}}function Yb(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function Xb(e,t){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)Yb(o[e],t)}var ka=V(null),Ws=V(0);function Kb(e,t){e=Nr,ee(Ws,e),ee(ka,t),Nr=e|t.baseLanes}function _f(){ee(Ws,Nr),ee(ka,ka.current)}function Df(){Nr=Ws.current,K(ka),K(Ws)}var Kr=0,ze=null,We=null,xt=null,Js=!1,Ha=!1,$o=!1,ec=0,el=0,Ba=null,RA=0;function gt(){throw Error(a(321))}function If(e,t){if(t===null)return!1;for(var o=0;o<t.length&&o<e.length;o++)if(!ln(e[o],t[o]))return!1;return!0}function zf(e,t,o,i,d,p){return Kr=p,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Mx:_x,$o=!1,p=o(i,d),$o=!1,Ha&&(p=Qb(t,o,i,d)),Fb(e),p}function Fb(e){k.H=ic;var t=We!==null&&We.next!==null;if(Kr=0,xt=We=ze=null,Js=!1,el=0,Ba=null,t)throw Error(a(300));e===null||Mt||(e=e.dependencies,e!==null&&Xs(e)&&(Mt=!0))}function Qb(e,t,o,i){ze=e;var d=0;do{if(Ha&&(Ba=null),el=0,Ha=!1,25<=d)throw Error(a(301));if(d+=1,xt=We=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}k.H=zA,p=t(o,i)}while(Ha);return p}function NA(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?tl(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(ze.flags|=1024),t}function Lf(){var e=ec!==0;return ec=0,e}function kf(e,t,o){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o}function Hf(e){if(Js){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Js=!1}Kr=0,xt=We=ze=null,Ha=!1,el=ec=0,Ba=null}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?ze.memoizedState=xt=e:xt=xt.next=e,xt}function St(){if(We===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=xt===null?ze.memoizedState:xt.next;if(t!==null)xt=t,We=e;else{if(e===null)throw ze.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},xt===null?ze.memoizedState=xt=e:xt=xt.next=e}return xt}function Bf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tl(e){var t=el;return el+=1,Ba===null&&(Ba=[]),e=Gb(Ba,e,t),t=ze,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Mx:_x),e}function tc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return tl(e);if(e.$$typeof===T)return Gt(e)}throw Error(a(438,String(e)))}function Uf(e){var t=null,o=ze.updateQueue;if(o!==null&&(t=o.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),o===null&&(o=Bf(),ze.updateQueue=o),o.memoCache=t,o=t.data[t.index],o===void 0)for(o=t.data[t.index]=Array(e),i=0;i<e;i++)o[i]=X;return t.index++,o}function wr(e,t){return typeof t=="function"?t(e):t}function nc(e){var t=St();return Pf(t,We,e)}function Pf(e,t,o){var i=e.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=o;var d=e.baseQueue,p=i.pending;if(p!==null){if(d!==null){var j=d.next;d.next=p.next,p.next=j}t.baseQueue=d=p,i.pending=null}if(p=e.baseState,d===null)e.memoizedState=p;else{t=d.next;var _=j=null,B=null,W=t,re=!1;do{var ae=W.lane&-536870913;if(ae!==W.lane?(Ge&ae)===ae:(Kr&ae)===ae){var te=W.revertLane;if(te===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ae===za&&(re=!0);else if((Kr&te)===te){W=W.next,te===za&&(re=!0);continue}else ae={lane:0,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},B===null?(_=B=ae,j=p):B=B.next=ae,ze.lanes|=te,to|=te;ae=W.action,$o&&o(p,ae),p=W.hasEagerState?W.eagerState:o(p,ae)}else te={lane:ae,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},B===null?(_=B=te,j=p):B=B.next=te,ze.lanes|=ae,to|=ae;W=W.next}while(W!==null&&W!==t);if(B===null?j=p:B.next=_,!ln(p,e.memoizedState)&&(Mt=!0,re&&(o=La,o!==null)))throw o;e.memoizedState=p,e.baseState=j,e.baseQueue=B,i.lastRenderedState=p}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function $f(e){var t=St(),o=t.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=e;var i=o.dispatch,d=o.pending,p=t.memoizedState;if(d!==null){o.pending=null;var j=d=d.next;do p=e(p,j.action),j=j.next;while(j!==d);ln(p,t.memoizedState)||(Mt=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),o.lastRenderedState=p}return[p,i]}function Zb(e,t,o){var i=ze,d=St(),p=Xe;if(p){if(o===void 0)throw Error(a(407));o=o()}else o=t();var j=!ln((We||d).memoizedState,o);j&&(d.memoizedState=o,Mt=!0),d=d.queue;var _=ex.bind(null,i,d,e);if(nl(2048,8,_,[e]),d.getSnapshot!==t||j||xt!==null&&xt.memoizedState.tag&1){if(i.flags|=2048,Ua(9,rc(),Jb.bind(null,i,d,o,t),null),rt===null)throw Error(a(349));p||(Kr&124)!==0||Wb(i,t,o)}return o}function Wb(e,t,o){e.flags|=16384,e={getSnapshot:t,value:o},t=ze.updateQueue,t===null?(t=Bf(),ze.updateQueue=t,t.stores=[e]):(o=t.stores,o===null?t.stores=[e]:o.push(e))}function Jb(e,t,o,i){t.value=o,t.getSnapshot=i,tx(t)&&nx(e)}function ex(e,t,o){return o(function(){tx(t)&&nx(e)})}function tx(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!ln(e,o)}catch{return!0}}function nx(e){var t=Ma(e,2);t!==null&&hn(t,e,2)}function Gf(e){var t=Jt();if(typeof e=="function"){var o=e;if(e=o(),$o){Re(!0);try{o()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:e},t}function rx(e,t,o,i){return e.baseState=o,Pf(e,We,typeof i=="function"?i:wr)}function AA(e,t,o,i,d){if(ac(e))throw Error(a(485));if(e=t.action,e!==null){var p={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){p.listeners.push(j)}};k.T!==null?o(!0):p.isTransition=!1,i(p),o=t.pending,o===null?(p.next=t.pending=p,ox(t,p)):(p.next=o.next,t.pending=o.next=p)}}function ox(e,t){var o=t.action,i=t.payload,d=e.state;if(t.isTransition){var p=k.T,j={};k.T=j;try{var _=o(d,i),B=k.S;B!==null&&B(j,_),ax(e,t,_)}catch(W){Vf(e,t,W)}finally{k.T=p}}else try{p=o(d,i),ax(e,t,p)}catch(W){Vf(e,t,W)}}function ax(e,t,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(i){ix(e,t,i)},function(i){return Vf(e,t,i)}):ix(e,t,o)}function ix(e,t,o){t.status="fulfilled",t.value=o,lx(t),e.state=o,t=e.pending,t!==null&&(o=t.next,o===t?e.pending=null:(o=o.next,t.next=o,ox(e,o)))}function Vf(e,t,o){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=o,lx(t),t=t.next;while(t!==i)}e.action=null}function lx(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function sx(e,t){return t}function cx(e,t){if(Xe){var o=rt.formState;if(o!==null){e:{var i=ze;if(Xe){if(dt){t:{for(var d=dt,p=Xn;d.nodeType!==8;){if(!p){d=null;break t}if(d=kn(d.nextSibling),d===null){d=null;break t}}p=d.data,d=p==="F!"||p==="F"?d:null}if(d){dt=kn(d.nextSibling),i=d.data==="F!";break e}}Ho(i)}i=!1}i&&(t=o[0])}}return o=Jt(),o.memoizedState=o.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sx,lastRenderedState:t},o.queue=i,o=Rx.bind(null,ze,i),i.dispatch=o,i=Gf(!1),p=Ff.bind(null,ze,!1,i.queue),i=Jt(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,o=AA.bind(null,ze,d,p,o),d.dispatch=o,i.memoizedState=e,[t,o,!1]}function ux(e){var t=St();return dx(t,We,e)}function dx(e,t,o){if(t=Pf(e,t,sx)[0],e=nc(wr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=tl(t)}catch(j){throw j===Fi?Qs:j}else i=t;t=St();var d=t.queue,p=d.dispatch;return o!==t.memoizedState&&(ze.flags|=2048,Ua(9,rc(),MA.bind(null,d,o),null)),[i,p,e]}function MA(e,t){e.action=t}function fx(e){var t=St(),o=We;if(o!==null)return dx(t,o,e);St(),t=t.memoizedState,o=St();var i=o.queue.dispatch;return o.memoizedState=e,[t,i,!1]}function Ua(e,t,o,i){return e={tag:e,create:o,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Bf(),ze.updateQueue=t),o=t.lastEffect,o===null?t.lastEffect=e.next=e:(i=o.next,o.next=e,e.next=i,t.lastEffect=e),e}function rc(){return{destroy:void 0,resource:void 0}}function hx(){return St().memoizedState}function oc(e,t,o,i){var d=Jt();i=i===void 0?null:i,ze.flags|=e,d.memoizedState=Ua(1|t,rc(),o,i)}function nl(e,t,o,i){var d=St();i=i===void 0?null:i;var p=d.memoizedState.inst;We!==null&&i!==null&&If(i,We.memoizedState.deps)?d.memoizedState=Ua(t,p,o,i):(ze.flags|=e,d.memoizedState=Ua(1|t,p,o,i))}function mx(e,t){oc(8390656,8,e,t)}function px(e,t){nl(2048,8,e,t)}function gx(e,t){return nl(4,2,e,t)}function yx(e,t){return nl(4,4,e,t)}function vx(e,t){if(typeof t=="function"){e=e();var o=t(e);return function(){typeof o=="function"?o():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bx(e,t,o){o=o!=null?o.concat([e]):null,nl(4,4,vx.bind(null,t,e),o)}function qf(){}function xx(e,t){var o=St();t=t===void 0?null:t;var i=o.memoizedState;return t!==null&&If(t,i[1])?i[0]:(o.memoizedState=[e,t],e)}function Sx(e,t){var o=St();t=t===void 0?null:t;var i=o.memoizedState;if(t!==null&&If(t,i[1]))return i[0];if(i=e(),$o){Re(!0);try{e()}finally{Re(!1)}}return o.memoizedState=[i,t],i}function Yf(e,t,o){return o===void 0||(Kr&1073741824)!==0?e.memoizedState=t:(e.memoizedState=o,e=E0(),ze.lanes|=e,to|=e,o)}function Cx(e,t,o,i){return ln(o,t)?o:ka.current!==null?(e=Yf(e,o,i),ln(e,t)||(Mt=!0),e):(Kr&42)===0?(Mt=!0,e.memoizedState=o):(e=E0(),ze.lanes|=e,to|=e,t)}function wx(e,t,o,i,d){var p=$.p;$.p=p!==0&&8>p?p:8;var j=k.T,_={};k.T=_,Ff(e,!1,t,o);try{var B=d(),W=k.S;if(W!==null&&W(_,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var re=OA(B,i);rl(e,t,re,fn(e))}else rl(e,t,i,fn(e))}catch(ae){rl(e,t,{then:function(){},status:"rejected",reason:ae},fn())}finally{$.p=p,k.T=j}}function _A(){}function Xf(e,t,o,i){if(e.tag!==5)throw Error(a(476));var d=Ex(e).queue;wx(e,d,t,L,o===null?_A:function(){return Tx(e),o(i)})}function Ex(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:L},next:null};var o={};return t.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:o},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Tx(e){var t=Ex(e).next.queue;rl(e,t,{},fn())}function Kf(){return Gt(Sl)}function jx(){return St().memoizedState}function Ox(){return St().memoizedState}function DA(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var o=fn();e=Yr(o);var i=Xr(t,e,o);i!==null&&(hn(i,t,o),Zi(i,t,o)),t={cache:Ef()},e.payload=t;return}t=t.return}}function IA(e,t,o){var i=fn();o={lane:i,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},ac(e)?Nx(t,o):(o=mf(e,t,o,i),o!==null&&(hn(o,e,i),Ax(o,t,i)))}function Rx(e,t,o){var i=fn();rl(e,t,o,i)}function rl(e,t,o,i){var d={lane:i,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(ac(e))Nx(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var j=t.lastRenderedState,_=p(j,o);if(d.hasEagerState=!0,d.eagerState=_,ln(_,j))return $s(e,t,d,0),rt===null&&Ps(),!1}catch{}finally{}if(o=mf(e,t,d,i),o!==null)return hn(o,e,i),Ax(o,t,i),!0}return!1}function Ff(e,t,o,i){if(i={lane:2,revertLane:Oh(),action:i,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(a(479))}else t=mf(e,o,i,2),t!==null&&hn(t,e,2)}function ac(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Nx(e,t){Ha=Js=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function Ax(e,t,o){if((o&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,o|=i,t.lanes=o,Hv(e,o)}}var ic={readContext:Gt,use:tc,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt},Mx={readContext:Gt,use:tc,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Gt,useEffect:mx,useImperativeHandle:function(e,t,o){o=o!=null?o.concat([e]):null,oc(4194308,4,vx.bind(null,t,e),o)},useLayoutEffect:function(e,t){return oc(4194308,4,e,t)},useInsertionEffect:function(e,t){oc(4,2,e,t)},useMemo:function(e,t){var o=Jt();t=t===void 0?null:t;var i=e();if($o){Re(!0);try{e()}finally{Re(!1)}}return o.memoizedState=[i,t],i},useReducer:function(e,t,o){var i=Jt();if(o!==void 0){var d=o(t);if($o){Re(!0);try{o(t)}finally{Re(!1)}}}else d=t;return i.memoizedState=i.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},i.queue=e,e=e.dispatch=IA.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:function(e){e=Gf(e);var t=e.queue,o=Rx.bind(null,ze,t);return t.dispatch=o,[e.memoizedState,o]},useDebugValue:qf,useDeferredValue:function(e,t){var o=Jt();return Yf(o,e,t)},useTransition:function(){var e=Gf(!1);return e=wx.bind(null,ze,e.queue,!0,!1),Jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,o){var i=ze,d=Jt();if(Xe){if(o===void 0)throw Error(a(407));o=o()}else{if(o=t(),rt===null)throw Error(a(349));(Ge&124)!==0||Wb(i,t,o)}d.memoizedState=o;var p={value:o,getSnapshot:t};return d.queue=p,mx(ex.bind(null,i,p,e),[e]),i.flags|=2048,Ua(9,rc(),Jb.bind(null,i,p,o,t),null),o},useId:function(){var e=Jt(),t=rt.identifierPrefix;if(Xe){var o=xr,i=br;o=(i&~(1<<32-ye(i)-1)).toString(32)+o,t="«"+t+"R"+o,o=ec++,0<o&&(t+="H"+o.toString(32)),t+="»"}else o=RA++,t="«"+t+"r"+o.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Kf,useFormState:cx,useActionState:cx,useOptimistic:function(e){var t=Jt();t.memoizedState=t.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=o,t=Ff.bind(null,ze,!0,o),o.dispatch=t,[e,t]},useMemoCache:Uf,useCacheRefresh:function(){return Jt().memoizedState=DA.bind(null,ze)}},_x={readContext:Gt,use:tc,useCallback:xx,useContext:Gt,useEffect:px,useImperativeHandle:bx,useInsertionEffect:gx,useLayoutEffect:yx,useMemo:Sx,useReducer:nc,useRef:hx,useState:function(){return nc(wr)},useDebugValue:qf,useDeferredValue:function(e,t){var o=St();return Cx(o,We.memoizedState,e,t)},useTransition:function(){var e=nc(wr)[0],t=St().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:Zb,useId:jx,useHostTransitionStatus:Kf,useFormState:ux,useActionState:ux,useOptimistic:function(e,t){var o=St();return rx(o,We,e,t)},useMemoCache:Uf,useCacheRefresh:Ox},zA={readContext:Gt,use:tc,useCallback:xx,useContext:Gt,useEffect:px,useImperativeHandle:bx,useInsertionEffect:gx,useLayoutEffect:yx,useMemo:Sx,useReducer:$f,useRef:hx,useState:function(){return $f(wr)},useDebugValue:qf,useDeferredValue:function(e,t){var o=St();return We===null?Yf(o,e,t):Cx(o,We.memoizedState,e,t)},useTransition:function(){var e=$f(wr)[0],t=St().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:Zb,useId:jx,useHostTransitionStatus:Kf,useFormState:fx,useActionState:fx,useOptimistic:function(e,t){var o=St();return We!==null?rx(o,We,e,t):(o.baseState=e,[e,o.queue.dispatch])},useMemoCache:Uf,useCacheRefresh:Ox},Pa=null,ol=0;function lc(e){var t=ol;return ol+=1,Pa===null&&(Pa=[]),Gb(Pa,e,t)}function al(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function sc(e,t){throw t.$$typeof===v?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Dx(e){var t=e._init;return t(e._payload)}function Ix(e){function t(q,P){if(e){var Q=q.deletions;Q===null?(q.deletions=[P],q.flags|=16):Q.push(P)}}function o(q,P){if(!e)return null;for(;P!==null;)t(q,P),P=P.sibling;return null}function i(q){for(var P=new Map;q!==null;)q.key!==null?P.set(q.key,q):P.set(q.index,q),q=q.sibling;return P}function d(q,P){return q=vr(q,P),q.index=0,q.sibling=null,q}function p(q,P,Q){return q.index=Q,e?(Q=q.alternate,Q!==null?(Q=Q.index,Q<P?(q.flags|=67108866,P):Q):(q.flags|=67108866,P)):(q.flags|=1048576,P)}function j(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function _(q,P,Q,oe){return P===null||P.tag!==6?(P=gf(Q,q.mode,oe),P.return=q,P):(P=d(P,Q),P.return=q,P)}function B(q,P,Q,oe){var me=Q.type;return me===y?re(q,P,Q.props.children,oe,Q.key):P!==null&&(P.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===H&&Dx(me)===P.type)?(P=d(P,Q.props),al(P,Q),P.return=q,P):(P=Vs(Q.type,Q.key,Q.props,null,q.mode,oe),al(P,Q),P.return=q,P)}function W(q,P,Q,oe){return P===null||P.tag!==4||P.stateNode.containerInfo!==Q.containerInfo||P.stateNode.implementation!==Q.implementation?(P=yf(Q,q.mode,oe),P.return=q,P):(P=d(P,Q.children||[]),P.return=q,P)}function re(q,P,Q,oe,me){return P===null||P.tag!==7?(P=Io(Q,q.mode,oe,me),P.return=q,P):(P=d(P,Q),P.return=q,P)}function ae(q,P,Q){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=gf(""+P,q.mode,Q),P.return=q,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case w:return Q=Vs(P.type,P.key,P.props,null,q.mode,Q),al(Q,P),Q.return=q,Q;case C:return P=yf(P,q.mode,Q),P.return=q,P;case H:var oe=P._init;return P=oe(P._payload),ae(q,P,Q)}if(Y(P)||F(P))return P=Io(P,q.mode,Q,null),P.return=q,P;if(typeof P.then=="function")return ae(q,lc(P),Q);if(P.$$typeof===T)return ae(q,Ks(q,P),Q);sc(q,P)}return null}function te(q,P,Q,oe){var me=P!==null?P.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return me!==null?null:_(q,P,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:return Q.key===me?B(q,P,Q,oe):null;case C:return Q.key===me?W(q,P,Q,oe):null;case H:return me=Q._init,Q=me(Q._payload),te(q,P,Q,oe)}if(Y(Q)||F(Q))return me!==null?null:re(q,P,Q,oe,null);if(typeof Q.then=="function")return te(q,P,lc(Q),oe);if(Q.$$typeof===T)return te(q,P,Ks(q,Q),oe);sc(q,Q)}return null}function ne(q,P,Q,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return q=q.get(Q)||null,_(P,q,""+oe,me);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case w:return q=q.get(oe.key===null?Q:oe.key)||null,B(P,q,oe,me);case C:return q=q.get(oe.key===null?Q:oe.key)||null,W(P,q,oe,me);case H:var Le=oe._init;return oe=Le(oe._payload),ne(q,P,Q,oe,me)}if(Y(oe)||F(oe))return q=q.get(Q)||null,re(P,q,oe,me,null);if(typeof oe.then=="function")return ne(q,P,Q,lc(oe),me);if(oe.$$typeof===T)return ne(q,P,Q,Ks(P,oe),me);sc(P,oe)}return null}function Oe(q,P,Q,oe){for(var me=null,Le=null,xe=P,Te=P=0,Dt=null;xe!==null&&Te<Q.length;Te++){xe.index>Te?(Dt=xe,xe=null):Dt=xe.sibling;var Ye=te(q,xe,Q[Te],oe);if(Ye===null){xe===null&&(xe=Dt);break}e&&xe&&Ye.alternate===null&&t(q,xe),P=p(Ye,P,Te),Le===null?me=Ye:Le.sibling=Ye,Le=Ye,xe=Dt}if(Te===Q.length)return o(q,xe),Xe&&Lo(q,Te),me;if(xe===null){for(;Te<Q.length;Te++)xe=ae(q,Q[Te],oe),xe!==null&&(P=p(xe,P,Te),Le===null?me=xe:Le.sibling=xe,Le=xe);return Xe&&Lo(q,Te),me}for(xe=i(xe);Te<Q.length;Te++)Dt=ne(xe,q,Te,Q[Te],oe),Dt!==null&&(e&&Dt.alternate!==null&&xe.delete(Dt.key===null?Te:Dt.key),P=p(Dt,P,Te),Le===null?me=Dt:Le.sibling=Dt,Le=Dt);return e&&xe.forEach(function(uo){return t(q,uo)}),Xe&&Lo(q,Te),me}function Ee(q,P,Q,oe){if(Q==null)throw Error(a(151));for(var me=null,Le=null,xe=P,Te=P=0,Dt=null,Ye=Q.next();xe!==null&&!Ye.done;Te++,Ye=Q.next()){xe.index>Te?(Dt=xe,xe=null):Dt=xe.sibling;var uo=te(q,xe,Ye.value,oe);if(uo===null){xe===null&&(xe=Dt);break}e&&xe&&uo.alternate===null&&t(q,xe),P=p(uo,P,Te),Le===null?me=uo:Le.sibling=uo,Le=uo,xe=Dt}if(Ye.done)return o(q,xe),Xe&&Lo(q,Te),me;if(xe===null){for(;!Ye.done;Te++,Ye=Q.next())Ye=ae(q,Ye.value,oe),Ye!==null&&(P=p(Ye,P,Te),Le===null?me=Ye:Le.sibling=Ye,Le=Ye);return Xe&&Lo(q,Te),me}for(xe=i(xe);!Ye.done;Te++,Ye=Q.next())Ye=ne(xe,q,Te,Ye.value,oe),Ye!==null&&(e&&Ye.alternate!==null&&xe.delete(Ye.key===null?Te:Ye.key),P=p(Ye,P,Te),Le===null?me=Ye:Le.sibling=Ye,Le=Ye);return e&&xe.forEach(function(LM){return t(q,LM)}),Xe&&Lo(q,Te),me}function et(q,P,Q,oe){if(typeof Q=="object"&&Q!==null&&Q.type===y&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:e:{for(var me=Q.key;P!==null;){if(P.key===me){if(me=Q.type,me===y){if(P.tag===7){o(q,P.sibling),oe=d(P,Q.props.children),oe.return=q,q=oe;break e}}else if(P.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===H&&Dx(me)===P.type){o(q,P.sibling),oe=d(P,Q.props),al(oe,Q),oe.return=q,q=oe;break e}o(q,P);break}else t(q,P);P=P.sibling}Q.type===y?(oe=Io(Q.props.children,q.mode,oe,Q.key),oe.return=q,q=oe):(oe=Vs(Q.type,Q.key,Q.props,null,q.mode,oe),al(oe,Q),oe.return=q,q=oe)}return j(q);case C:e:{for(me=Q.key;P!==null;){if(P.key===me)if(P.tag===4&&P.stateNode.containerInfo===Q.containerInfo&&P.stateNode.implementation===Q.implementation){o(q,P.sibling),oe=d(P,Q.children||[]),oe.return=q,q=oe;break e}else{o(q,P);break}else t(q,P);P=P.sibling}oe=yf(Q,q.mode,oe),oe.return=q,q=oe}return j(q);case H:return me=Q._init,Q=me(Q._payload),et(q,P,Q,oe)}if(Y(Q))return Oe(q,P,Q,oe);if(F(Q)){if(me=F(Q),typeof me!="function")throw Error(a(150));return Q=me.call(Q),Ee(q,P,Q,oe)}if(typeof Q.then=="function")return et(q,P,lc(Q),oe);if(Q.$$typeof===T)return et(q,P,Ks(q,Q),oe);sc(q,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,P!==null&&P.tag===6?(o(q,P.sibling),oe=d(P,Q),oe.return=q,q=oe):(o(q,P),oe=gf(Q,q.mode,oe),oe.return=q,q=oe),j(q)):o(q,P)}return function(q,P,Q,oe){try{ol=0;var me=et(q,P,Q,oe);return Pa=null,me}catch(xe){if(xe===Fi||xe===Qs)throw xe;var Le=sn(29,xe,null,q.mode);return Le.lanes=oe,Le.return=q,Le}finally{}}}var $a=Ix(!0),zx=Ix(!1),On=V(null),Kn=null;function Fr(e){var t=e.alternate;ee(Rt,Rt.current&1),ee(On,e),Kn===null&&(t===null||ka.current!==null||t.memoizedState!==null)&&(Kn=e)}function Lx(e){if(e.tag===22){if(ee(Rt,Rt.current),ee(On,e),Kn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Kn=e)}}else Qr()}function Qr(){ee(Rt,Rt.current),ee(On,On.current)}function Er(e){K(On),Kn===e&&(Kn=null),K(Rt)}var Rt=V(0);function cc(e){for(var t=e;t!==null;){if(t.tag===13){var o=t.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||Bh(o)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Qf(e,t,o,i){t=e.memoizedState,o=o(i,t),o=o==null?t:b({},t,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var Zf={enqueueSetState:function(e,t,o){e=e._reactInternals;var i=fn(),d=Yr(i);d.payload=t,o!=null&&(d.callback=o),t=Xr(e,d,i),t!==null&&(hn(t,e,i),Zi(t,e,i))},enqueueReplaceState:function(e,t,o){e=e._reactInternals;var i=fn(),d=Yr(i);d.tag=1,d.payload=t,o!=null&&(d.callback=o),t=Xr(e,d,i),t!==null&&(hn(t,e,i),Zi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var o=fn(),i=Yr(o);i.tag=2,t!=null&&(i.callback=t),t=Xr(e,i,o),t!==null&&(hn(t,e,o),Zi(t,e,o))}};function kx(e,t,o,i,d,p,j){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,p,j):t.prototype&&t.prototype.isPureReactComponent?!Pi(o,i)||!Pi(d,p):!0}function Hx(e,t,o,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(o,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(o,i),t.state!==e&&Zf.enqueueReplaceState(t,t.state,null)}function Go(e,t){var o=t;if("ref"in t){o={};for(var i in t)i!=="ref"&&(o[i]=t[i])}if(e=e.defaultProps){o===t&&(o=b({},o));for(var d in e)o[d]===void 0&&(o[d]=e[d])}return o}var uc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=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(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Bx(e){uc(e)}function Ux(e){console.error(e)}function Px(e){uc(e)}function dc(e,t){try{var o=e.onUncaughtError;o(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function $x(e,t,o){try{var i=e.onCaughtError;i(o.value,{componentStack:o.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Wf(e,t,o){return o=Yr(o),o.tag=3,o.payload={element:null},o.callback=function(){dc(e,t)},o}function Gx(e){return e=Yr(e),e.tag=3,e}function Vx(e,t,o,i){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var p=i.value;e.payload=function(){return d(p)},e.callback=function(){$x(t,o,i)}}var j=o.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(e.callback=function(){$x(t,o,i),typeof d!="function"&&(no===null?no=new Set([this]):no.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})})}function LA(e,t,o,i,d){if(o.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=o.alternate,t!==null&&Yi(t,o,d,!0),o=On.current,o!==null){switch(o.tag){case 13:return Kn===null?Ch():o.alternate===null&&ft===0&&(ft=3),o.flags&=-257,o.flags|=65536,o.lanes=d,i===Of?o.flags|=16384:(t=o.updateQueue,t===null?o.updateQueue=new Set([i]):t.add(i),Eh(e,i,d)),!1;case 22:return o.flags|=65536,i===Of?o.flags|=16384:(t=o.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},o.updateQueue=t):(o=t.retryQueue,o===null?t.retryQueue=new Set([i]):o.add(i)),Eh(e,i,d)),!1}throw Error(a(435,o.tag))}return Eh(e,i,d),Ch(),!1}if(Xe)return t=On.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==xf&&(e=Error(a(422),{cause:i}),qi(wn(e,o)))):(i!==xf&&(t=Error(a(423),{cause:i}),qi(wn(t,o))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=wn(i,o),d=Wf(e.stateNode,i,d),Af(e,d),ft!==4&&(ft=2)),!1;var p=Error(a(520),{cause:i});if(p=wn(p,o),fl===null?fl=[p]:fl.push(p),ft!==4&&(ft=2),t===null)return!0;i=wn(i,o),o=t;do{switch(o.tag){case 3:return o.flags|=65536,e=d&-d,o.lanes|=e,e=Wf(o.stateNode,i,e),Af(o,e),!1;case 1:if(t=o.type,p=o.stateNode,(o.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(no===null||!no.has(p))))return o.flags|=65536,d&=-d,o.lanes|=d,d=Gx(d),Vx(d,e,o,i),Af(o,d),!1}o=o.return}while(o!==null);return!1}var qx=Error(a(461)),Mt=!1;function zt(e,t,o,i){t.child=e===null?zx(t,null,o,i):$a(t,e.child,o,i)}function Yx(e,t,o,i,d){o=o.render;var p=t.ref;if("ref"in i){var j={};for(var _ in i)_!=="ref"&&(j[_]=i[_])}else j=i;return Uo(t),i=zf(e,t,o,j,p,d),_=Lf(),e!==null&&!Mt?(kf(e,t,d),Tr(e,t,d)):(Xe&&_&&vf(t),t.flags|=1,zt(e,t,i,d),t.child)}function Xx(e,t,o,i,d){if(e===null){var p=o.type;return typeof p=="function"&&!pf(p)&&p.defaultProps===void 0&&o.compare===null?(t.tag=15,t.type=p,Kx(e,t,p,i,d)):(e=Vs(o.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,!ih(e,d)){var j=p.memoizedProps;if(o=o.compare,o=o!==null?o:Pi,o(j,i)&&e.ref===t.ref)return Tr(e,t,d)}return t.flags|=1,e=vr(p,i),e.ref=t.ref,e.return=t,t.child=e}function Kx(e,t,o,i,d){if(e!==null){var p=e.memoizedProps;if(Pi(p,i)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=i=p,ih(e,d))(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,Tr(e,t,d)}return Jf(e,t,o,i,d)}function Fx(e,t,o){var i=t.pendingProps,d=i.children,p=e!==null?e.memoizedState:null;if(i.mode==="hidden"){if((t.flags&128)!==0){if(i=p!==null?p.baseLanes|o:o,e!==null){for(d=t.child=e.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;t.childLanes=p&~i}else t.childLanes=0,t.child=null;return Qx(e,t,i,o)}if((o&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fs(t,p!==null?p.cachePool:null),p!==null?Kb(t,p):_f(),Lx(t);else return t.lanes=t.childLanes=536870912,Qx(e,t,p!==null?p.baseLanes|o:o,o)}else p!==null?(Fs(t,p.cachePool),Kb(t,p),Qr(),t.memoizedState=null):(e!==null&&Fs(t,null),_f(),Qr());return zt(e,t,d,o),t.child}function Qx(e,t,o,i){var d=jf();return d=d===null?null:{parent:Ot._currentValue,pool:d},t.memoizedState={baseLanes:o,cachePool:d},e!==null&&Fs(t,null),_f(),Lx(t),e!==null&&Yi(e,t,i,!0),null}function fc(e,t){var o=t.ref;if(o===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(e===null||e.ref!==o)&&(t.flags|=4194816)}}function Jf(e,t,o,i,d){return Uo(t),o=zf(e,t,o,i,void 0,d),i=Lf(),e!==null&&!Mt?(kf(e,t,d),Tr(e,t,d)):(Xe&&i&&vf(t),t.flags|=1,zt(e,t,o,d),t.child)}function Zx(e,t,o,i,d,p){return Uo(t),t.updateQueue=null,o=Qb(t,i,o,d),Fb(e),i=Lf(),e!==null&&!Mt?(kf(e,t,p),Tr(e,t,p)):(Xe&&i&&vf(t),t.flags|=1,zt(e,t,o,p),t.child)}function Wx(e,t,o,i,d){if(Uo(t),t.stateNode===null){var p=_a,j=o.contextType;typeof j=="object"&&j!==null&&(p=Gt(j)),p=new o(i,p),t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Zf,t.stateNode=p,p._reactInternals=t,p=t.stateNode,p.props=i,p.state=t.memoizedState,p.refs={},Rf(t),j=o.contextType,p.context=typeof j=="object"&&j!==null?Gt(j):_a,p.state=t.memoizedState,j=o.getDerivedStateFromProps,typeof j=="function"&&(Qf(t,o,j,i),p.state=t.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(j=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),j!==p.state&&Zf.enqueueReplaceState(p,p.state,null),Ji(t,i,p,d),Wi(),p.state=t.memoizedState),typeof p.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){p=t.stateNode;var _=t.memoizedProps,B=Go(o,_);p.props=B;var W=p.context,re=o.contextType;j=_a,typeof re=="object"&&re!==null&&(j=Gt(re));var ae=o.getDerivedStateFromProps;re=typeof ae=="function"||typeof p.getSnapshotBeforeUpdate=="function",_=t.pendingProps!==_,re||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(_||W!==j)&&Hx(t,p,i,j),qr=!1;var te=t.memoizedState;p.state=te,Ji(t,i,p,d),Wi(),W=t.memoizedState,_||te!==W||qr?(typeof ae=="function"&&(Qf(t,o,ae,i),W=t.memoizedState),(B=qr||kx(t,o,B,i,te,W,j))?(re||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=W),p.props=i,p.state=W,p.context=j,i=B):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{p=t.stateNode,Nf(e,t),j=t.memoizedProps,re=Go(o,j),p.props=re,ae=t.pendingProps,te=p.context,W=o.contextType,B=_a,typeof W=="object"&&W!==null&&(B=Gt(W)),_=o.getDerivedStateFromProps,(W=typeof _=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(j!==ae||te!==B)&&Hx(t,p,i,B),qr=!1,te=t.memoizedState,p.state=te,Ji(t,i,p,d),Wi();var ne=t.memoizedState;j!==ae||te!==ne||qr||e!==null&&e.dependencies!==null&&Xs(e.dependencies)?(typeof _=="function"&&(Qf(t,o,_,i),ne=t.memoizedState),(re=qr||kx(t,o,re,i,te,ne,B)||e!==null&&e.dependencies!==null&&Xs(e.dependencies))?(W||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(i,ne,B),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(i,ne,B)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),p.props=i,p.state=ne,p.context=B,i=re):(typeof p.componentDidUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),i=!1)}return p=i,fc(e,t),i=(t.flags&128)!==0,p||i?(p=t.stateNode,o=i&&typeof o.getDerivedStateFromError!="function"?null:p.render(),t.flags|=1,e!==null&&i?(t.child=$a(t,e.child,null,d),t.child=$a(t,null,o,d)):zt(e,t,o,d),t.memoizedState=p.state,e=t.child):e=Tr(e,t,d),e}function Jx(e,t,o,i){return Vi(),t.flags|=256,zt(e,t,o,i),t.child}var eh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function th(e){return{baseLanes:e,cachePool:Ub()}}function nh(e,t,o){return e=e!==null?e.childLanes&~o:0,t&&(e|=Rn),e}function e0(e,t,o){var i=t.pendingProps,d=!1,p=(t.flags&128)!==0,j;if((j=p)||(j=e!==null&&e.memoizedState===null?!1:(Rt.current&2)!==0),j&&(d=!0,t.flags&=-129),j=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(d?Fr(t):Qr(),Xe){var _=dt,B;if(B=_){e:{for(B=_,_=Xn;B.nodeType!==8;){if(!_){_=null;break e}if(B=kn(B.nextSibling),B===null){_=null;break e}}_=B}_!==null?(t.memoizedState={dehydrated:_,treeContext:zo!==null?{id:br,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},B=sn(18,null,null,0),B.stateNode=_,B.return=t,t.child=B,Kt=t,dt=null,B=!0):B=!1}B||Ho(t)}if(_=t.memoizedState,_!==null&&(_=_.dehydrated,_!==null))return Bh(_)?t.lanes=32:t.lanes=536870912,null;Er(t)}return _=i.children,i=i.fallback,d?(Qr(),d=t.mode,_=hc({mode:"hidden",children:_},d),i=Io(i,d,o,null),_.return=t,i.return=t,_.sibling=i,t.child=_,d=t.child,d.memoizedState=th(o),d.childLanes=nh(e,j,o),t.memoizedState=eh,i):(Fr(t),rh(t,_))}if(B=e.memoizedState,B!==null&&(_=B.dehydrated,_!==null)){if(p)t.flags&256?(Fr(t),t.flags&=-257,t=oh(e,t,o)):t.memoizedState!==null?(Qr(),t.child=e.child,t.flags|=128,t=null):(Qr(),d=i.fallback,_=t.mode,i=hc({mode:"visible",children:i.children},_),d=Io(d,_,o,null),d.flags|=2,i.return=t,d.return=t,i.sibling=d,t.child=i,$a(t,e.child,null,o),i=t.child,i.memoizedState=th(o),i.childLanes=nh(e,j,o),t.memoizedState=eh,t=d);else if(Fr(t),Bh(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var W=j.dgst;j=W,i=Error(a(419)),i.stack="",i.digest=j,qi({value:i,source:null,stack:null}),t=oh(e,t,o)}else if(Mt||Yi(e,t,o,!1),j=(o&e.childLanes)!==0,Mt||j){if(j=rt,j!==null&&(i=o&-o,i=(i&42)!==0?1:Bd(i),i=(i&(j.suspendedLanes|o))!==0?0:i,i!==0&&i!==B.retryLane))throw B.retryLane=i,Ma(e,i),hn(j,e,i),qx;_.data==="$?"||Ch(),t=oh(e,t,o)}else _.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=B.treeContext,dt=kn(_.nextSibling),Kt=t,Xe=!0,ko=null,Xn=!1,e!==null&&(Tn[jn++]=br,Tn[jn++]=xr,Tn[jn++]=zo,br=e.id,xr=e.overflow,zo=t),t=rh(t,i.children),t.flags|=4096);return t}return d?(Qr(),d=i.fallback,_=t.mode,B=e.child,W=B.sibling,i=vr(B,{mode:"hidden",children:i.children}),i.subtreeFlags=B.subtreeFlags&65011712,W!==null?d=vr(W,d):(d=Io(d,_,o,null),d.flags|=2),d.return=t,i.return=t,i.sibling=d,t.child=i,i=d,d=t.child,_=e.child.memoizedState,_===null?_=th(o):(B=_.cachePool,B!==null?(W=Ot._currentValue,B=B.parent!==W?{parent:W,pool:W}:B):B=Ub(),_={baseLanes:_.baseLanes|o,cachePool:B}),d.memoizedState=_,d.childLanes=nh(e,j,o),t.memoizedState=eh,i):(Fr(t),o=e.child,e=o.sibling,o=vr(o,{mode:"visible",children:i.children}),o.return=t,o.sibling=null,e!==null&&(j=t.deletions,j===null?(t.deletions=[e],t.flags|=16):j.push(e)),t.child=o,t.memoizedState=null,o)}function rh(e,t){return t=hc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function hc(e,t){return e=sn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function oh(e,t,o){return $a(t,e.child,null,o),e=rh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function t0(e,t,o){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Cf(e.return,t,o)}function ah(e,t,o,i,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:o,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=o,p.tailMode=d)}function n0(e,t,o){var i=t.pendingProps,d=i.revealOrder,p=i.tail;if(zt(e,t,i.children,o),i=Rt.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&t0(e,o,t);else if(e.tag===19)t0(e,o,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(ee(Rt,i),d){case"forwards":for(o=t.child,d=null;o!==null;)e=o.alternate,e!==null&&cc(e)===null&&(d=o),o=o.sibling;o=d,o===null?(d=t.child,t.child=null):(d=o.sibling,o.sibling=null),ah(t,!1,d,o,p);break;case"backwards":for(o=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&cc(e)===null){t.child=d;break}e=d.sibling,d.sibling=o,o=d,d=e}ah(t,!0,o,null,p);break;case"together":ah(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Tr(e,t,o){if(e!==null&&(t.dependencies=e.dependencies),to|=t.lanes,(o&t.childLanes)===0)if(e!==null){if(Yi(e,t,o,!1),(o&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,o=vr(e,e.pendingProps),t.child=o,o.return=t;e.sibling!==null;)e=e.sibling,o=o.sibling=vr(e,e.pendingProps),o.return=t;o.sibling=null}return t.child}function ih(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Xs(e)))}function kA(e,t,o){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),Vr(t,Ot,e.memoizedState.cache),Vi();break;case 27:case 5:de(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:Vr(t,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Fr(t),t.flags|=128,null):(o&t.child.childLanes)!==0?e0(e,t,o):(Fr(t),e=Tr(e,t,o),e!==null?e.sibling:null);Fr(t);break;case 19:var d=(e.flags&128)!==0;if(i=(o&t.childLanes)!==0,i||(Yi(e,t,o,!1),i=(o&t.childLanes)!==0),d){if(i)return n0(e,t,o);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ee(Rt,Rt.current),i)break;return null;case 22:case 23:return t.lanes=0,Fx(e,t,o);case 24:Vr(t,Ot,e.memoizedState.cache)}return Tr(e,t,o)}function r0(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!ih(e,o)&&(t.flags&128)===0)return Mt=!1,kA(e,t,o);Mt=(e.flags&131072)!==0}else Mt=!1,Xe&&(t.flags&1048576)!==0&&Db(t,Ys,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var i=t.elementType,d=i._init;if(i=d(i._payload),t.type=i,typeof i=="function")pf(i)?(e=Go(i,e),t.tag=1,t=Wx(null,t,i,e,o)):(t.tag=0,t=Jf(null,t,i,e,o));else{if(i!=null){if(d=i.$$typeof,d===O){t.tag=11,t=Yx(null,t,i,e,o);break e}else if(d===z){t.tag=14,t=Xx(null,t,i,e,o);break e}}throw t=I(i)||i,Error(a(306,t,""))}}return t;case 0:return Jf(e,t,t.type,t.pendingProps,o);case 1:return i=t.type,d=Go(i,t.pendingProps),Wx(e,t,i,d,o);case 3:e:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(a(387));i=t.pendingProps;var p=t.memoizedState;d=p.element,Nf(e,t),Ji(t,i,null,o);var j=t.memoizedState;if(i=j.cache,Vr(t,Ot,i),i!==p.cache&&wf(t,[Ot],o,!0),Wi(),i=j.element,p.isDehydrated)if(p={element:i,isDehydrated:!1,cache:j.cache},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){t=Jx(e,t,i,o);break e}else if(i!==d){d=wn(Error(a(424)),t),qi(d),t=Jx(e,t,i,o);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(dt=kn(e.firstChild),Kt=t,Xe=!0,ko=null,Xn=!0,o=zx(t,null,i,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Vi(),i===d){t=Tr(e,t,o);break e}zt(e,t,i,o)}t=t.child}return t;case 26:return fc(e,t),e===null?(o=lS(t.type,null,t.pendingProps,null))?t.memoizedState=o:Xe||(o=t.type,e=t.pendingProps,i=Oc(ie.current).createElement(o),i[$t]=t,i[Zt]=e,kt(i,o,e),At(i),t.stateNode=i):t.memoizedState=lS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&Xe&&(i=t.stateNode=oS(t.type,t.pendingProps,ie.current),Kt=t,Xn=!0,d=dt,ao(t.type)?(Uh=d,dt=kn(i.firstChild)):dt=d),zt(e,t,t.pendingProps.children,o),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((d=i=dt)&&(i=dM(i,t.type,t.pendingProps,Xn),i!==null?(t.stateNode=i,Kt=t,dt=kn(i.firstChild),Xn=!1,d=!0):d=!1),d||Ho(t)),de(t),d=t.type,p=t.pendingProps,j=e!==null?e.memoizedProps:null,i=p.children,Lh(d,p)?i=null:j!==null&&Lh(d,j)&&(t.flags|=32),t.memoizedState!==null&&(d=zf(e,t,NA,null,null,o),Sl._currentValue=d),fc(e,t),zt(e,t,i,o),t.child;case 6:return e===null&&Xe&&((e=o=dt)&&(o=fM(o,t.pendingProps,Xn),o!==null?(t.stateNode=o,Kt=t,dt=null,e=!0):e=!1),e||Ho(t)),null;case 13:return e0(e,t,o);case 4:return je(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=$a(t,null,i,o):zt(e,t,i,o),t.child;case 11:return Yx(e,t,t.type,t.pendingProps,o);case 7:return zt(e,t,t.pendingProps,o),t.child;case 8:return zt(e,t,t.pendingProps.children,o),t.child;case 12:return zt(e,t,t.pendingProps.children,o),t.child;case 10:return i=t.pendingProps,Vr(t,t.type,i.value),zt(e,t,i.children,o),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,Uo(t),d=Gt(d),i=i(d),t.flags|=1,zt(e,t,i,o),t.child;case 14:return Xx(e,t,t.type,t.pendingProps,o);case 15:return Kx(e,t,t.type,t.pendingProps,o);case 19:return n0(e,t,o);case 31:return i=t.pendingProps,o=t.mode,i={mode:i.mode,children:i.children},e===null?(o=hc(i,o),o.ref=t.ref,t.child=o,o.return=t,t=o):(o=vr(e.child,i),o.ref=t.ref,t.child=o,o.return=t,t=o),t;case 22:return Fx(e,t,o);case 24:return Uo(t),i=Gt(Ot),e===null?(d=jf(),d===null&&(d=rt,p=Ef(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=o),d=p),t.memoizedState={parent:i,cache:d},Rf(t),Vr(t,Ot,d)):((e.lanes&o)!==0&&(Nf(e,t),Ji(t,null,null,o),Wi()),d=e.memoizedState,p=t.memoizedState,d.parent!==i?(d={parent:i,cache:i},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),Vr(t,Ot,i)):(i=p.cache,Vr(t,Ot,i),i!==d.cache&&wf(t,[Ot],o,!0))),zt(e,t,t.pendingProps.children,o),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function jr(e){e.flags|=4}function o0(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!fS(t)){if(t=On.current,t!==null&&((Ge&4194048)===Ge?Kn!==null:(Ge&62914560)!==Ge&&(Ge&536870912)===0||t!==Kn))throw Qi=Of,Pb;e.flags|=8192}}function mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Lv():536870912,e.lanes|=t,Ya|=t)}function il(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var o=null;t!==null;)t.alternate!==null&&(o=t),t=t.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var i=null;o!==null;)o.alternate!==null&&(i=o),o=o.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,o=0,i=0;if(t)for(var d=e.child;d!==null;)o|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)o|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=i,e.childLanes=o,t}function HA(e,t,o){var i=t.pendingProps;switch(bf(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return o=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Cr(Ot),be(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(Gi(t)?jr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lb())),lt(t),null;case 26:return o=t.memoizedState,e===null?(jr(t),o!==null?(lt(t),o0(t,o)):(lt(t),t.flags&=-16777217)):o?o!==e.memoizedState?(jr(t),lt(t),o0(t,o)):(lt(t),t.flags&=-16777217):(e.memoizedProps!==i&&jr(t),lt(t),t.flags&=-16777217),null;case 27:Se(t),o=ie.current;var d=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==i&&jr(t);else{if(!i){if(t.stateNode===null)throw Error(a(166));return lt(t),null}e=le.current,Gi(t)?Ib(t):(e=oS(d,i,o),t.stateNode=e,jr(t))}return lt(t),null;case 5:if(Se(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&jr(t);else{if(!i){if(t.stateNode===null)throw Error(a(166));return lt(t),null}if(e=le.current,Gi(t))Ib(t);else{switch(d=Oc(ie.current),e){case 1:e=d.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:e=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":e=d.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":e=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":e=d.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof i.is=="string"?d.createElement("select",{is:i.is}):d.createElement("select"),i.multiple?e.multiple=!0:i.size&&(e.size=i.size);break;default:e=typeof i.is=="string"?d.createElement(o,{is:i.is}):d.createElement(o)}}e[$t]=t,e[Zt]=i;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)e.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=e;e:switch(kt(e,o,i),o){case"button":case"input":case"select":case"textarea":e=!!i.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&jr(t)}}return lt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&jr(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(a(166));if(e=ie.current,Gi(t)){if(e=t.stateNode,o=t.memoizedProps,i=null,d=Kt,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[$t]=t,e=!!(e.nodeValue===o||i!==null&&i.suppressHydrationWarning===!0||Z0(e.nodeValue,o)),e||Ho(t)}else e=Oc(e).createTextNode(i),e[$t]=t,t.stateNode=e}return lt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Gi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(a(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(a(317));d[$t]=t}else Vi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),d=!1}else d=Lb(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Er(t),t):(Er(t),null)}if(Er(t),(t.flags&128)!==0)return t.lanes=o,t;if(o=i!==null,e=e!==null&&e.memoizedState!==null,o){i=t.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool);var p=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(p=i.memoizedState.cachePool.pool),p!==d&&(i.flags|=2048)}return o!==e&&o&&(t.child.flags|=8192),mc(t,t.updateQueue),lt(t),null;case 4:return be(),e===null&&Mh(t.stateNode.containerInfo),lt(t),null;case 10:return Cr(t.type),lt(t),null;case 19:if(K(Rt),d=t.memoizedState,d===null)return lt(t),null;if(i=(t.flags&128)!==0,p=d.rendering,p===null)if(i)il(d,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=cc(e),p!==null){for(t.flags|=128,il(d,!1),e=p.updateQueue,t.updateQueue=e,mc(t,e),t.subtreeFlags=0,e=o,o=t.child;o!==null;)_b(o,e),o=o.sibling;return ee(Rt,Rt.current&1|2),t.child}e=e.sibling}d.tail!==null&&jt()>yc&&(t.flags|=128,i=!0,il(d,!1),t.lanes=4194304)}else{if(!i)if(e=cc(p),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,mc(t,e),il(d,!0),d.tail===null&&d.tailMode==="hidden"&&!p.alternate&&!Xe)return lt(t),null}else 2*jt()-d.renderingStartTime>yc&&o!==536870912&&(t.flags|=128,i=!0,il(d,!1),t.lanes=4194304);d.isBackwards?(p.sibling=t.child,t.child=p):(e=d.last,e!==null?e.sibling=p:t.child=p,d.last=p)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=jt(),t.sibling=null,e=Rt.current,ee(Rt,i?e&1|2:e&1),t):(lt(t),null);case 22:case 23:return Er(t),Df(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(o&536870912)!==0&&(t.flags&128)===0&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),o=t.updateQueue,o!==null&&mc(t,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==o&&(t.flags|=2048),e!==null&&K(Po),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),Cr(Ot),lt(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function BA(e,t){switch(bf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cr(Ot),be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 13:if(Er(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(Rt),null;case 4:return be(),null;case 10:return Cr(t.type),null;case 22:case 23:return Er(t),Df(),e!==null&&K(Po),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Cr(Ot),null;case 25:return null;default:return null}}function a0(e,t){switch(bf(t),t.tag){case 3:Cr(Ot),be();break;case 26:case 27:case 5:Se(t);break;case 4:be();break;case 13:Er(t);break;case 19:K(Rt);break;case 10:Cr(t.type);break;case 22:case 23:Er(t),Df(),e!==null&&K(Po);break;case 24:Cr(Ot)}}function ll(e,t){try{var o=t.updateQueue,i=o!==null?o.lastEffect:null;if(i!==null){var d=i.next;o=d;do{if((o.tag&e)===e){i=void 0;var p=o.create,j=o.inst;i=p(),j.destroy=i}o=o.next}while(o!==d)}}catch(_){tt(t,t.return,_)}}function Zr(e,t,o){try{var i=t.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var p=d.next;i=p;do{if((i.tag&e)===e){var j=i.inst,_=j.destroy;if(_!==void 0){j.destroy=void 0,d=t;var B=o,W=_;try{W()}catch(re){tt(d,B,re)}}}i=i.next}while(i!==p)}}catch(re){tt(t,t.return,re)}}function i0(e){var t=e.updateQueue;if(t!==null){var o=e.stateNode;try{Xb(t,o)}catch(i){tt(e,e.return,i)}}}function l0(e,t,o){o.props=Go(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(i){tt(e,t,i)}}function sl(e,t){try{var o=e.ref;if(o!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof o=="function"?e.refCleanup=o(i):o.current=i}}catch(d){tt(e,t,d)}}function Fn(e,t){var o=e.ref,i=e.refCleanup;if(o!==null)if(typeof i=="function")try{i()}catch(d){tt(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){tt(e,t,d)}else o.current=null}function s0(e){var t=e.type,o=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":o.autoFocus&&i.focus();break e;case"img":o.src?i.src=o.src:o.srcSet&&(i.srcset=o.srcSet)}}catch(d){tt(e,e.return,d)}}function lh(e,t,o){try{var i=e.stateNode;iM(i,e.type,o,t),i[Zt]=t}catch(d){tt(e,e.return,d)}}function c0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ao(e.type)||e.tag===4}function sh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||c0(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&&ao(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,t,o){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(e,t):(t=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,t.appendChild(e),o=o._reactRootContainer,o!=null||t.onclick!==null||(t.onclick=jc));else if(i!==4&&(i===27&&ao(e.type)&&(o=e.stateNode,t=null),e=e.child,e!==null))for(ch(e,t,o),e=e.sibling;e!==null;)ch(e,t,o),e=e.sibling}function pc(e,t,o){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?o.insertBefore(e,t):o.appendChild(e);else if(i!==4&&(i===27&&ao(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(pc(e,t,o),e=e.sibling;e!==null;)pc(e,t,o),e=e.sibling}function u0(e){var t=e.stateNode,o=e.memoizedProps;try{for(var i=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);kt(t,i,o),t[$t]=e,t[Zt]=o}catch(p){tt(e,e.return,p)}}var Or=!1,yt=!1,uh=!1,d0=typeof WeakSet=="function"?WeakSet:Set,_t=null;function UA(e,t){if(e=e.containerInfo,Ih=Dc,e=Cb(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 i=o.getSelection&&o.getSelection();if(i&&i.rangeCount!==0){o=i.anchorNode;var d=i.anchorOffset,p=i.focusNode;i=i.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var j=0,_=-1,B=-1,W=0,re=0,ae=e,te=null;t:for(;;){for(var ne;ae!==o||d!==0&&ae.nodeType!==3||(_=j+d),ae!==p||i!==0&&ae.nodeType!==3||(B=j+i),ae.nodeType===3&&(j+=ae.nodeValue.length),(ne=ae.firstChild)!==null;)te=ae,ae=ne;for(;;){if(ae===e)break t;if(te===o&&++W===d&&(_=j),te===p&&++re===i&&(B=j),(ne=ae.nextSibling)!==null)break;ae=te,te=ae.parentNode}ae=ne}o=_===-1||B===-1?null:{start:_,end:B}}else o=null}o=o||{start:0,end:0}}else o=null;for(zh={focusedElem:e,selectionRange:o},Dc=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){switch(t=_t,p=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,o=t,d=p.memoizedProps,p=p.memoizedState,i=o.stateNode;try{var Oe=Go(o.type,d,o.elementType===o.type);e=i.getSnapshotBeforeUpdate(Oe,p),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){tt(o,o.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,o=e.nodeType,o===9)Hh(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Hh(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=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}}function f0(e,t,o){var i=o.flags;switch(o.tag){case 0:case 11:case 15:Wr(e,o),i&4&&ll(5,o);break;case 1:if(Wr(e,o),i&4)if(e=o.stateNode,t===null)try{e.componentDidMount()}catch(j){tt(o,o.return,j)}else{var d=Go(o.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(j){tt(o,o.return,j)}}i&64&&i0(o),i&512&&sl(o,o.return);break;case 3:if(Wr(e,o),i&64&&(e=o.updateQueue,e!==null)){if(t=null,o.child!==null)switch(o.child.tag){case 27:case 5:t=o.child.stateNode;break;case 1:t=o.child.stateNode}try{Xb(e,t)}catch(j){tt(o,o.return,j)}}break;case 27:t===null&&i&4&&u0(o);case 26:case 5:Wr(e,o),t===null&&i&4&&s0(o),i&512&&sl(o,o.return);break;case 12:Wr(e,o);break;case 13:Wr(e,o),i&4&&p0(e,o),i&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(o=FA.bind(null,o),hM(e,o))));break;case 22:if(i=o.memoizedState!==null||Or,!i){t=t!==null&&t.memoizedState!==null||yt,d=Or;var p=yt;Or=i,(yt=t)&&!p?Jr(e,o,(o.subtreeFlags&8772)!==0):Wr(e,o),Or=d,yt=p}break;case 30:break;default:Wr(e,o)}}function h0(e){var t=e.alternate;t!==null&&(e.alternate=null,h0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$d(t)),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 at=null,en=!1;function Rr(e,t,o){for(o=o.child;o!==null;)m0(e,t,o),o=o.sibling}function m0(e,t,o){if(se&&typeof se.onCommitFiberUnmount=="function")try{se.onCommitFiberUnmount(mr,o)}catch{}switch(o.tag){case 26:yt||Fn(o,t),Rr(e,t,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:yt||Fn(o,t);var i=at,d=en;ao(o.type)&&(at=o.stateNode,en=!1),Rr(e,t,o),yl(o.stateNode),at=i,en=d;break;case 5:yt||Fn(o,t);case 6:if(i=at,d=en,at=null,Rr(e,t,o),at=i,en=d,at!==null)if(en)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(o.stateNode)}catch(p){tt(o,t,p)}else try{at.removeChild(o.stateNode)}catch(p){tt(o,t,p)}break;case 18:at!==null&&(en?(e=at,nS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,o.stateNode),Tl(e)):nS(at,o.stateNode));break;case 4:i=at,d=en,at=o.stateNode.containerInfo,en=!0,Rr(e,t,o),at=i,en=d;break;case 0:case 11:case 14:case 15:yt||Zr(2,o,t),yt||Zr(4,o,t),Rr(e,t,o);break;case 1:yt||(Fn(o,t),i=o.stateNode,typeof i.componentWillUnmount=="function"&&l0(o,t,i)),Rr(e,t,o);break;case 21:Rr(e,t,o);break;case 22:yt=(i=yt)||o.memoizedState!==null,Rr(e,t,o),yt=i;break;default:Rr(e,t,o)}}function p0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Tl(e)}catch(o){tt(t,t.return,o)}}function PA(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new d0),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new d0),t;default:throw Error(a(435,e.tag))}}function dh(e,t){var o=PA(e);t.forEach(function(i){var d=QA.bind(null,e,i);o.has(i)||(o.add(i),i.then(d,d))})}function cn(e,t){var o=t.deletions;if(o!==null)for(var i=0;i<o.length;i++){var d=o[i],p=e,j=t,_=j;e:for(;_!==null;){switch(_.tag){case 27:if(ao(_.type)){at=_.stateNode,en=!1;break e}break;case 5:at=_.stateNode,en=!1;break e;case 3:case 4:at=_.stateNode.containerInfo,en=!0;break e}_=_.return}if(at===null)throw Error(a(160));m0(p,j,d),at=null,en=!1,p=d.alternate,p!==null&&(p.return=null),d.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)g0(t,e),t=t.sibling}var Ln=null;function g0(e,t){var o=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:cn(t,e),un(e),i&4&&(Zr(3,e,e.return),ll(3,e),Zr(5,e,e.return));break;case 1:cn(t,e),un(e),i&512&&(yt||o===null||Fn(o,o.return)),i&64&&Or&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?i:o.concat(i))));break;case 26:var d=Ln;if(cn(t,e),un(e),i&512&&(yt||o===null||Fn(o,o.return)),i&4){var p=o!==null?o.memoizedState:null;if(i=e.memoizedState,o===null)if(i===null)if(e.stateNode===null){e:{i=e.type,o=e.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":p=d.getElementsByTagName("title")[0],(!p||p[_i]||p[$t]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(i),d.head.insertBefore(p,d.querySelector("head > title"))),kt(p,i,o),p[$t]=e,At(p),i=p;break e;case"link":var j=uS("link","href",d).get(i+(o.href||""));if(j){for(var _=0;_<j.length;_++)if(p=j[_],p.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&p.getAttribute("rel")===(o.rel==null?null:o.rel)&&p.getAttribute("title")===(o.title==null?null:o.title)&&p.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){j.splice(_,1);break t}}p=d.createElement(i),kt(p,i,o),d.head.appendChild(p);break;case"meta":if(j=uS("meta","content",d).get(i+(o.content||""))){for(_=0;_<j.length;_++)if(p=j[_],p.getAttribute("content")===(o.content==null?null:""+o.content)&&p.getAttribute("name")===(o.name==null?null:o.name)&&p.getAttribute("property")===(o.property==null?null:o.property)&&p.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&p.getAttribute("charset")===(o.charSet==null?null:o.charSet)){j.splice(_,1);break t}}p=d.createElement(i),kt(p,i,o),d.head.appendChild(p);break;default:throw Error(a(468,i))}p[$t]=e,At(p),i=p}e.stateNode=i}else dS(d,e.type,e.stateNode);else e.stateNode=cS(d,i,e.memoizedProps);else p!==i?(p===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):p.count--,i===null?dS(d,e.type,e.stateNode):cS(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&lh(e,e.memoizedProps,o.memoizedProps)}break;case 27:cn(t,e),un(e),i&512&&(yt||o===null||Fn(o,o.return)),o!==null&&i&4&&lh(e,e.memoizedProps,o.memoizedProps);break;case 5:if(cn(t,e),un(e),i&512&&(yt||o===null||Fn(o,o.return)),e.flags&32){d=e.stateNode;try{Ea(d,"")}catch(ne){tt(e,e.return,ne)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,lh(e,d,o!==null?o.memoizedProps:d)),i&1024&&(uh=!0);break;case 6:if(cn(t,e),un(e),i&4){if(e.stateNode===null)throw Error(a(162));i=e.memoizedProps,o=e.stateNode;try{o.nodeValue=i}catch(ne){tt(e,e.return,ne)}}break;case 3:if(Ac=null,d=Ln,Ln=Rc(t.containerInfo),cn(t,e),Ln=d,un(e),i&4&&o!==null&&o.memoizedState.isDehydrated)try{Tl(t.containerInfo)}catch(ne){tt(e,e.return,ne)}uh&&(uh=!1,y0(e));break;case 4:i=Ln,Ln=Rc(e.stateNode.containerInfo),cn(t,e),un(e),Ln=i;break;case 12:cn(t,e),un(e);break;case 13:cn(t,e),un(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(yh=jt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,dh(e,i)));break;case 22:d=e.memoizedState!==null;var B=o!==null&&o.memoizedState!==null,W=Or,re=yt;if(Or=W||d,yt=re||B,cn(t,e),yt=re,Or=W,un(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(o===null||B||Or||yt||Vo(e)),o=null,t=e;;){if(t.tag===5||t.tag===26){if(o===null){B=o=t;try{if(p=B.stateNode,d)j=p.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{_=B.stateNode;var ae=B.memoizedProps.style,te=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;_.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(ne){tt(B,B.return,ne)}}}else if(t.tag===6){if(o===null){B=t;try{B.stateNode.nodeValue=d?"":B.memoizedProps}catch(ne){tt(B,B.return,ne)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;o===t&&(o=null),t=t.return}o===t&&(o=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(o=i.retryQueue,o!==null&&(i.retryQueue=null,dh(e,o))));break;case 19:cn(t,e),un(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,dh(e,i)));break;case 30:break;case 21:break;default:cn(t,e),un(e)}}function un(e){var t=e.flags;if(t&2){try{for(var o,i=e.return;i!==null;){if(c0(i)){o=i;break}i=i.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var d=o.stateNode,p=sh(e);pc(e,p,d);break;case 5:var j=o.stateNode;o.flags&32&&(Ea(j,""),o.flags&=-33);var _=sh(e);pc(e,_,j);break;case 3:case 4:var B=o.stateNode.containerInfo,W=sh(e);ch(e,W,B);break;default:throw Error(a(161))}}catch(re){tt(e,e.return,re)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function y0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;y0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)f0(e,t.alternate,t),t=t.sibling}function Vo(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Zr(4,t,t.return),Vo(t);break;case 1:Fn(t,t.return);var o=t.stateNode;typeof o.componentWillUnmount=="function"&&l0(t,t.return,o),Vo(t);break;case 27:yl(t.stateNode);case 26:case 5:Fn(t,t.return),Vo(t);break;case 22:t.memoizedState===null&&Vo(t);break;case 30:Vo(t);break;default:Vo(t)}e=e.sibling}}function Jr(e,t,o){for(o=o&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,d=e,p=t,j=p.flags;switch(p.tag){case 0:case 11:case 15:Jr(d,p,o),ll(4,p);break;case 1:if(Jr(d,p,o),i=p,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(W){tt(i,i.return,W)}if(i=p,d=i.updateQueue,d!==null){var _=i.stateNode;try{var B=d.shared.hiddenCallbacks;if(B!==null)for(d.shared.hiddenCallbacks=null,d=0;d<B.length;d++)Yb(B[d],_)}catch(W){tt(i,i.return,W)}}o&&j&64&&i0(p),sl(p,p.return);break;case 27:u0(p);case 26:case 5:Jr(d,p,o),o&&i===null&&j&4&&s0(p),sl(p,p.return);break;case 12:Jr(d,p,o);break;case 13:Jr(d,p,o),o&&j&4&&p0(d,p);break;case 22:p.memoizedState===null&&Jr(d,p,o),sl(p,p.return);break;case 30:break;default:Jr(d,p,o)}t=t.sibling}}function fh(e,t){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&Xi(o))}function hh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xi(e))}function Qn(e,t,o,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)v0(e,t,o,i),t=t.sibling}function v0(e,t,o,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Qn(e,t,o,i),d&2048&&ll(9,t);break;case 1:Qn(e,t,o,i);break;case 3:Qn(e,t,o,i),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xi(e)));break;case 12:if(d&2048){Qn(e,t,o,i),e=t.stateNode;try{var p=t.memoizedProps,j=p.id,_=p.onPostCommit;typeof _=="function"&&_(j,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(B){tt(t,t.return,B)}}else Qn(e,t,o,i);break;case 13:Qn(e,t,o,i);break;case 23:break;case 22:p=t.stateNode,j=t.alternate,t.memoizedState!==null?p._visibility&2?Qn(e,t,o,i):cl(e,t):p._visibility&2?Qn(e,t,o,i):(p._visibility|=2,Ga(e,t,o,i,(t.subtreeFlags&10256)!==0)),d&2048&&fh(j,t);break;case 24:Qn(e,t,o,i),d&2048&&hh(t.alternate,t);break;default:Qn(e,t,o,i)}}function Ga(e,t,o,i,d){for(d=d&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var p=e,j=t,_=o,B=i,W=j.flags;switch(j.tag){case 0:case 11:case 15:Ga(p,j,_,B,d),ll(8,j);break;case 23:break;case 22:var re=j.stateNode;j.memoizedState!==null?re._visibility&2?Ga(p,j,_,B,d):cl(p,j):(re._visibility|=2,Ga(p,j,_,B,d)),d&&W&2048&&fh(j.alternate,j);break;case 24:Ga(p,j,_,B,d),d&&W&2048&&hh(j.alternate,j);break;default:Ga(p,j,_,B,d)}t=t.sibling}}function cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var o=e,i=t,d=i.flags;switch(i.tag){case 22:cl(o,i),d&2048&&fh(i.alternate,i);break;case 24:cl(o,i),d&2048&&hh(i.alternate,i);break;default:cl(o,i)}t=t.sibling}}var ul=8192;function Va(e){if(e.subtreeFlags&ul)for(e=e.child;e!==null;)b0(e),e=e.sibling}function b0(e){switch(e.tag){case 26:Va(e),e.flags&ul&&e.memoizedState!==null&&jM(Ln,e.memoizedState,e.memoizedProps);break;case 5:Va(e);break;case 3:case 4:var t=Ln;Ln=Rc(e.stateNode.containerInfo),Va(e),Ln=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ul,ul=16777216,Va(e),ul=t):Va(e));break;default:Va(e)}}function x0(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function dl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var o=0;o<t.length;o++){var i=t[o];_t=i,C0(i,e)}x0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)S0(e),e=e.sibling}function S0(e){switch(e.tag){case 0:case 11:case 15:dl(e),e.flags&2048&&Zr(9,e,e.return);break;case 3:dl(e);break;case 12:dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,gc(e)):dl(e);break;default:dl(e)}}function gc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var o=0;o<t.length;o++){var i=t[o];_t=i,C0(i,e)}x0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Zr(8,t,t.return),gc(t);break;case 22:o=t.stateNode,o._visibility&2&&(o._visibility&=-3,gc(t));break;default:gc(t)}e=e.sibling}}function C0(e,t){for(;_t!==null;){var o=_t;switch(o.tag){case 0:case 11:case 15:Zr(8,o,t);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var i=o.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Xi(o.memoizedState.cache)}if(i=o.child,i!==null)i.return=o,_t=i;else e:for(o=e;_t!==null;){i=_t;var d=i.sibling,p=i.return;if(h0(i),i===o){_t=null;break e}if(d!==null){d.return=p,_t=d;break e}_t=p}}}var $A={getCacheForType:function(e){var t=Gt(Ot),o=t.data.get(e);return o===void 0&&(o=e(),t.data.set(e,o)),o}},GA=typeof WeakMap=="function"?WeakMap:Map,Qe=0,rt=null,Be=null,Ge=0,Ze=0,dn=null,eo=!1,qa=!1,mh=!1,Nr=0,ft=0,to=0,qo=0,ph=0,Rn=0,Ya=0,fl=null,tn=null,gh=!1,yh=0,yc=1/0,vc=null,no=null,Lt=0,ro=null,Xa=null,Ka=0,vh=0,bh=null,w0=null,hl=0,xh=null;function fn(){if((Qe&2)!==0&&Ge!==0)return Ge&-Ge;if(k.T!==null){var e=za;return e!==0?e:Oh()}return Bv()}function E0(){Rn===0&&(Rn=(Ge&536870912)===0||Xe?Ns():536870912);var e=On.current;return e!==null&&(e.flags|=32),Rn}function hn(e,t,o){(e===rt&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(Fa(e,0),oo(e,Ge,Rn,!1)),Mi(e,o),((Qe&2)===0||e!==rt)&&(e===rt&&((Qe&2)===0&&(qo|=o),ft===4&&oo(e,Ge,Rn,!1)),Zn(e))}function T0(e,t,o){if((Qe&6)!==0)throw Error(a(327));var i=!o&&(t&124)===0&&(t&e.expiredLanes)===0||In(e,t),d=i?YA(e,t):wh(e,t,!0),p=i;do{if(d===0){qa&&!i&&oo(e,t,0,!1);break}else{if(o=e.current.alternate,p&&!VA(o)){d=wh(e,t,!1),p=!1;continue}if(d===2){if(p=t,e.errorRecoveryDisabledLanes&p)var j=0;else j=e.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){t=j;e:{var _=e;d=fl;var B=_.current.memoizedState.isDehydrated;if(B&&(Fa(_,j).flags|=256),j=wh(_,j,!1),j!==2){if(mh&&!B){_.errorRecoveryDisabledLanes|=p,qo|=p,d=4;break e}p=tn,tn=d,p!==null&&(tn===null?tn=p:tn.push.apply(tn,p))}d=j}if(p=!1,d!==2)continue}}if(d===1){Fa(e,0),oo(e,t,0,!0);break}e:{switch(i=e,p=d,p){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:oo(i,t,Rn,!eo);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(d=yh+300-jt(),10<d)){if(oo(i,t,Rn,!eo),No(i,0,!0)!==0)break e;i.timeoutHandle=eS(j0.bind(null,i,o,tn,vc,gh,t,Rn,qo,Ya,eo,p,2,-0,0),d);break e}j0(i,o,tn,vc,gh,t,Rn,qo,Ya,eo,p,0,-0,0)}}break}while(!0);Zn(e)}function j0(e,t,o,i,d,p,j,_,B,W,re,ae,te,ne){if(e.timeoutHandle=-1,ae=t.subtreeFlags,(ae&8192||(ae&16785408)===16785408)&&(xl={stylesheets:null,count:0,unsuspend:TM},b0(t),ae=OM(),ae!==null)){e.cancelPendingCommit=ae(D0.bind(null,e,t,p,o,i,d,j,_,B,re,1,te,ne)),oo(e,p,j,!W);return}D0(e,t,p,o,i,d,j,_,B)}function VA(e){for(var t=e;;){var o=t.tag;if((o===0||o===11||o===15)&&t.flags&16384&&(o=t.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var i=0;i<o.length;i++){var d=o[i],p=d.getSnapshot;d=d.value;try{if(!ln(p(),d))return!1}catch{return!1}}if(o=t.child,t.subtreeFlags&16384&&o!==null)o.return=t,t=o;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function oo(e,t,o,i){t&=~ph,t&=~qo,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var p=31-ye(d),j=1<<p;i[p]=-1,d&=~j}o!==0&&kv(e,o,t)}function bc(){return(Qe&6)===0?(ml(0),!1):!0}function Sh(){if(Be!==null){if(Ze===0)var e=Be.return;else e=Be,Sr=Bo=null,Hf(e),Pa=null,ol=0,e=Be;for(;e!==null;)a0(e.alternate,e),e=e.return;Be=null}}function Fa(e,t){var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,sM(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),Sh(),rt=e,Be=o=vr(e.current,null),Ge=t,Ze=0,dn=null,eo=!1,qa=In(e,t),mh=!1,Ya=Rn=ph=qo=to=ft=0,tn=fl=null,gh=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var d=31-ye(i),p=1<<d;t|=e[d],i&=~p}return Nr=t,Ps(),o}function O0(e,t){ze=null,k.H=ic,t===Fi||t===Qs?(t=Vb(),Ze=3):t===Pb?(t=Vb(),Ze=4):Ze=t===qx?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,dn=t,Be===null&&(ft=1,dc(e,wn(t,e.current)))}function R0(){var e=k.H;return k.H=ic,e===null?ic:e}function N0(){var e=k.A;return k.A=$A,e}function Ch(){ft=4,eo||(Ge&4194048)!==Ge&&On.current!==null||(qa=!0),(to&134217727)===0&&(qo&134217727)===0||rt===null||oo(rt,Ge,Rn,!1)}function wh(e,t,o){var i=Qe;Qe|=2;var d=R0(),p=N0();(rt!==e||Ge!==t)&&(vc=null,Fa(e,t)),t=!1;var j=ft;e:do try{if(Ze!==0&&Be!==null){var _=Be,B=dn;switch(Ze){case 8:Sh(),j=6;break e;case 3:case 2:case 9:case 6:On.current===null&&(t=!0);var W=Ze;if(Ze=0,dn=null,Qa(e,_,B,W),o&&qa){j=0;break e}break;default:W=Ze,Ze=0,dn=null,Qa(e,_,B,W)}}qA(),j=ft;break}catch(re){O0(e,re)}while(!0);return t&&e.shellSuspendCounter++,Sr=Bo=null,Qe=i,k.H=d,k.A=p,Be===null&&(rt=null,Ge=0,Ps()),j}function qA(){for(;Be!==null;)A0(Be)}function YA(e,t){var o=Qe;Qe|=2;var i=R0(),d=N0();rt!==e||Ge!==t?(vc=null,yc=jt()+500,Fa(e,t)):qa=In(e,t);e:do try{if(Ze!==0&&Be!==null){t=Be;var p=dn;t:switch(Ze){case 1:Ze=0,dn=null,Qa(e,t,p,1);break;case 2:case 9:if($b(p)){Ze=0,dn=null,M0(t);break}t=function(){Ze!==2&&Ze!==9||rt!==e||(Ze=7),Zn(e)},p.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:$b(p)?(Ze=0,dn=null,M0(t)):(Ze=0,dn=null,Qa(e,t,p,7));break;case 5:var j=null;switch(Be.tag){case 26:j=Be.memoizedState;case 5:case 27:var _=Be;if(!j||fS(j)){Ze=0,dn=null;var B=_.sibling;if(B!==null)Be=B;else{var W=_.return;W!==null?(Be=W,xc(W)):Be=null}break t}}Ze=0,dn=null,Qa(e,t,p,5);break;case 6:Ze=0,dn=null,Qa(e,t,p,6);break;case 8:Sh(),ft=6;break e;default:throw Error(a(462))}}XA();break}catch(re){O0(e,re)}while(!0);return Sr=Bo=null,k.H=i,k.A=d,Qe=o,Be!==null?0:(rt=null,Ge=0,Ps(),ft)}function XA(){for(;Be!==null&&!$e();)A0(Be)}function A0(e){var t=r0(e.alternate,e,Nr);e.memoizedProps=e.pendingProps,t===null?xc(e):Be=t}function M0(e){var t=e,o=t.alternate;switch(t.tag){case 15:case 0:t=Zx(o,t,t.pendingProps,t.type,void 0,Ge);break;case 11:t=Zx(o,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:Hf(t);default:a0(o,t),t=Be=_b(t,Nr),t=r0(o,t,Nr)}e.memoizedProps=e.pendingProps,t===null?xc(e):Be=t}function Qa(e,t,o,i){Sr=Bo=null,Hf(t),Pa=null,ol=0;var d=t.return;try{if(LA(e,d,t,o,Ge)){ft=1,dc(e,wn(o,e.current)),Be=null;return}}catch(p){if(d!==null)throw Be=d,p;ft=1,dc(e,wn(o,e.current)),Be=null;return}t.flags&32768?(Xe||i===1?e=!0:qa||(Ge&536870912)!==0?e=!1:(eo=e=!0,(i===2||i===9||i===3||i===6)&&(i=On.current,i!==null&&i.tag===13&&(i.flags|=16384))),_0(t,e)):xc(t)}function xc(e){var t=e;do{if((t.flags&32768)!==0){_0(t,eo);return}e=t.return;var o=HA(t.alternate,t,Nr);if(o!==null){Be=o;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);ft===0&&(ft=5)}function _0(e,t){do{var o=BA(e.alternate,e);if(o!==null){o.flags&=32767,Be=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=o}while(e!==null);ft=6,Be=null}function D0(e,t,o,i,d,p,j,_,B){e.cancelPendingCommit=null;do Sc();while(Lt!==0);if((Qe&6)!==0)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(p=t.lanes|t.childLanes,p|=hf,TN(e,o,p,j,_,B),e===rt&&(Be=rt=null,Ge=0),Xa=t,ro=e,Ka=o,vh=p,bh=d,w0=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ZA(an,function(){return H0(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null,d=$.p,$.p=2,j=Qe,Qe|=4;try{UA(e,t,o)}finally{Qe=j,$.p=d,k.T=i}}Lt=1,I0(),z0(),L0()}}function I0(){if(Lt===1){Lt=0;var e=ro,t=Xa,o=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||o){o=k.T,k.T=null;var i=$.p;$.p=2;var d=Qe;Qe|=4;try{g0(t,e);var p=zh,j=Cb(e.containerInfo),_=p.focusedElem,B=p.selectionRange;if(j!==_&&_&&_.ownerDocument&&Sb(_.ownerDocument.documentElement,_)){if(B!==null&&sf(_)){var W=B.start,re=B.end;if(re===void 0&&(re=W),"selectionStart"in _)_.selectionStart=W,_.selectionEnd=Math.min(re,_.value.length);else{var ae=_.ownerDocument||document,te=ae&&ae.defaultView||window;if(te.getSelection){var ne=te.getSelection(),Oe=_.textContent.length,Ee=Math.min(B.start,Oe),et=B.end===void 0?Ee:Math.min(B.end,Oe);!ne.extend&&Ee>et&&(j=et,et=Ee,Ee=j);var q=xb(_,Ee),P=xb(_,et);if(q&&P&&(ne.rangeCount!==1||ne.anchorNode!==q.node||ne.anchorOffset!==q.offset||ne.focusNode!==P.node||ne.focusOffset!==P.offset)){var Q=ae.createRange();Q.setStart(q.node,q.offset),ne.removeAllRanges(),Ee>et?(ne.addRange(Q),ne.extend(P.node,P.offset)):(Q.setEnd(P.node,P.offset),ne.addRange(Q))}}}}for(ae=[],ne=_;ne=ne.parentNode;)ne.nodeType===1&&ae.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ae.length;_++){var oe=ae[_];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Dc=!!Ih,zh=Ih=null}finally{Qe=d,$.p=i,k.T=o}}e.current=t,Lt=2}}function z0(){if(Lt===2){Lt=0;var e=ro,t=Xa,o=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||o){o=k.T,k.T=null;var i=$.p;$.p=2;var d=Qe;Qe|=4;try{f0(e,t.alternate,t)}finally{Qe=d,$.p=i,k.T=o}}Lt=3}}function L0(){if(Lt===4||Lt===3){Lt=0,Dn();var e=ro,t=Xa,o=Ka,i=w0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Lt=5:(Lt=0,Xa=ro=null,k0(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(no=null),Ud(o),t=t.stateNode,se&&typeof se.onCommitFiberRoot=="function")try{se.onCommitFiberRoot(mr,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=k.T,d=$.p,$.p=2,k.T=null;try{for(var p=e.onRecoverableError,j=0;j<i.length;j++){var _=i[j];p(_.value,{componentStack:_.stack})}}finally{k.T=t,$.p=d}}(Ka&3)!==0&&Sc(),Zn(e),d=e.pendingLanes,(o&4194090)!==0&&(d&42)!==0?e===xh?hl++:(hl=0,xh=e):hl=0,ml(0)}}function k0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xi(t)))}function Sc(e){return I0(),z0(),L0(),H0()}function H0(){if(Lt!==5)return!1;var e=ro,t=vh;vh=0;var o=Ud(Ka),i=k.T,d=$.p;try{$.p=32>o?32:o,k.T=null,o=bh,bh=null;var p=ro,j=Ka;if(Lt=0,Xa=ro=null,Ka=0,(Qe&6)!==0)throw Error(a(331));var _=Qe;if(Qe|=4,S0(p.current),v0(p,p.current,j,o),Qe=_,ml(0,!1),se&&typeof se.onPostCommitFiberRoot=="function")try{se.onPostCommitFiberRoot(mr,p)}catch{}return!0}finally{$.p=d,k.T=i,k0(e,t)}}function B0(e,t,o){t=wn(o,t),t=Wf(e.stateNode,t,2),e=Xr(e,t,2),e!==null&&(Mi(e,2),Zn(e))}function tt(e,t,o){if(e.tag===3)B0(e,e,o);else for(;t!==null;){if(t.tag===3){B0(t,e,o);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(no===null||!no.has(i))){e=wn(o,e),o=Gx(2),i=Xr(t,o,2),i!==null&&(Vx(o,i,t,e),Mi(i,2),Zn(i));break}}t=t.return}}function Eh(e,t,o){var i=e.pingCache;if(i===null){i=e.pingCache=new GA;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(o)||(mh=!0,d.add(o),e=KA.bind(null,e,t,o),t.then(e,e))}function KA(e,t,o){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,rt===e&&(Ge&o)===o&&(ft===4||ft===3&&(Ge&62914560)===Ge&&300>jt()-yh?(Qe&2)===0&&Fa(e,0):ph|=o,Ya===Ge&&(Ya=0)),Zn(e)}function U0(e,t){t===0&&(t=Lv()),e=Ma(e,t),e!==null&&(Mi(e,t),Zn(e))}function FA(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),U0(e,o)}function QA(e,t){var o=0;switch(e.tag){case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(o=d.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(a(314))}i!==null&&i.delete(t),U0(e,o)}function ZA(e,t){return Ce(e,t)}var Cc=null,Za=null,Th=!1,wc=!1,jh=!1,Yo=0;function Zn(e){e!==Za&&e.next===null&&(Za===null?Cc=Za=e:Za=Za.next=e),wc=!0,Th||(Th=!0,JA())}function ml(e,t){if(!jh&&wc){jh=!0;do for(var o=!1,i=Cc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var p=0;else{var j=i.suspendedLanes,_=i.pingedLanes;p=(1<<31-ye(42|e)+1)-1,p&=d&~(j&~_),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(o=!0,V0(i,p))}else p=Ge,p=No(i,i===rt?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(p&3)===0||In(i,p)||(o=!0,V0(i,p));i=i.next}while(o);jh=!1}}function WA(){P0()}function P0(){wc=Th=!1;var e=0;Yo!==0&&(lM()&&(e=Yo),Yo=0);for(var t=jt(),o=null,i=Cc;i!==null;){var d=i.next,p=$0(i,t);p===0?(i.next=null,o===null?Cc=d:o.next=d,d===null&&(Za=o)):(o=i,(e!==0||(p&3)!==0)&&(wc=!0)),i=d}ml(e)}function $0(e,t){for(var o=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var j=31-ye(p),_=1<<j,B=d[j];B===-1?((_&o)===0||(_&i)!==0)&&(d[j]=pr(_,t)):B<=t&&(e.expiredLanes|=_),p&=~_}if(t=rt,o=Ge,o=No(e,e===t?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,o===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Ae(i),e.callbackNode=null,e.callbackPriority=0;if((o&3)===0||In(e,o)){if(t=o&-o,t===e.callbackPriority)return t;switch(i!==null&&Ae(i),Ud(o)){case 2:case 8:o=ut;break;case 32:o=an;break;case 268435456:o=pa;break;default:o=an}return i=G0.bind(null,e),o=Ce(o,i),e.callbackPriority=t,e.callbackNode=o,t}return i!==null&&i!==null&&Ae(i),e.callbackPriority=2,e.callbackNode=null,2}function G0(e,t){if(Lt!==0&&Lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var o=e.callbackNode;if(Sc()&&e.callbackNode!==o)return null;var i=Ge;return i=No(e,e===rt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(T0(e,i,t),$0(e,jt()),e.callbackNode!=null&&e.callbackNode===o?G0.bind(null,e):null)}function V0(e,t){if(Sc())return null;T0(e,t,!0)}function JA(){cM(function(){(Qe&6)!==0?Ce(ct,WA):P0()})}function Oh(){return Yo===0&&(Yo=Ns()),Yo}function q0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Is(""+e)}function Y0(e,t){var o=t.ownerDocument.createElement("input");return o.name=t.name,o.value=t.value,e.id&&o.setAttribute("form",e.id),t.parentNode.insertBefore(o,t),e=new FormData(e),o.parentNode.removeChild(o),e}function eM(e,t,o,i,d){if(t==="submit"&&o&&o.stateNode===d){var p=q0((d[Zt]||null).action),j=i.submitter;j&&(t=(t=j[Zt]||null)?q0(t.formAction):j.getAttribute("formAction"),t!==null&&(p=t,j=null));var _=new Hs("action","action",null,i,d);e.push({event:_,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Yo!==0){var B=j?Y0(d,j):new FormData(d);Xf(o,{pending:!0,data:B,method:d.method,action:p},null,B)}}else typeof p=="function"&&(_.preventDefault(),B=j?Y0(d,j):new FormData(d),Xf(o,{pending:!0,data:B,method:d.method,action:p},p,B))},currentTarget:d}]})}}for(var Rh=0;Rh<ff.length;Rh++){var Nh=ff[Rh],tM=Nh.toLowerCase(),nM=Nh[0].toUpperCase()+Nh.slice(1);zn(tM,"on"+nM)}zn(Tb,"onAnimationEnd"),zn(jb,"onAnimationIteration"),zn(Ob,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(bA,"onTransitionRun"),zn(xA,"onTransitionStart"),zn(SA,"onTransitionCancel"),zn(Rb,"onTransitionEnd"),Sa("onMouseEnter",["mouseout","mouseover"]),Sa("onMouseLeave",["mouseout","mouseover"]),Sa("onPointerEnter",["pointerout","pointerover"]),Sa("onPointerLeave",["pointerout","pointerover"]),Ao("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ao("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ao("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ao("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ao("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ao("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pl="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(" "),rM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pl));function X0(e,t){t=(t&4)!==0;for(var o=0;o<e.length;o++){var i=e[o],d=i.event;i=i.listeners;e:{var p=void 0;if(t)for(var j=i.length-1;0<=j;j--){var _=i[j],B=_.instance,W=_.currentTarget;if(_=_.listener,B!==p&&d.isPropagationStopped())break e;p=_,d.currentTarget=W;try{p(d)}catch(re){uc(re)}d.currentTarget=null,p=B}else for(j=0;j<i.length;j++){if(_=i[j],B=_.instance,W=_.currentTarget,_=_.listener,B!==p&&d.isPropagationStopped())break e;p=_,d.currentTarget=W;try{p(d)}catch(re){uc(re)}d.currentTarget=null,p=B}}}}function Ue(e,t){var o=t[Pd];o===void 0&&(o=t[Pd]=new Set);var i=e+"__bubble";o.has(i)||(K0(t,e,2,!1),o.add(i))}function Ah(e,t,o){var i=0;t&&(i|=4),K0(o,e,i,t)}var Ec="_reactListening"+Math.random().toString(36).slice(2);function Mh(e){if(!e[Ec]){e[Ec]=!0,Pv.forEach(function(o){o!=="selectionchange"&&(rM.has(o)||Ah(o,!1,e),Ah(o,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ec]||(t[Ec]=!0,Ah("selectionchange",!1,t))}}function K0(e,t,o,i){switch(vS(t)){case 2:var d=AM;break;case 8:d=MM;break;default:d=qh}o=d.bind(null,t,o,e),d=void 0,!Wd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),i?d!==void 0?e.addEventListener(t,o,{capture:!0,passive:d}):e.addEventListener(t,o,!0):d!==void 0?e.addEventListener(t,o,{passive:d}):e.addEventListener(t,o,!1)}function _h(e,t,o,i,d){var p=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var j=i.tag;if(j===3||j===4){var _=i.stateNode.containerInfo;if(_===d)break;if(j===4)for(j=i.return;j!==null;){var B=j.tag;if((B===3||B===4)&&j.stateNode.containerInfo===d)return;j=j.return}for(;_!==null;){if(j=va(_),j===null)return;if(B=j.tag,B===5||B===6||B===26||B===27){i=p=j;continue e}_=_.parentNode}}i=i.return}tb(function(){var W=p,re=Qd(o),ae=[];e:{var te=Nb.get(e);if(te!==void 0){var ne=Hs,Oe=e;switch(e){case"keypress":if(Ls(o)===0)break e;case"keydown":case"keyup":ne=ZN;break;case"focusin":Oe="focus",ne=nf;break;case"focusout":Oe="blur",ne=nf;break;case"beforeblur":case"afterblur":ne=nf;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=ob;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=BN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=eA;break;case Tb:case jb:case Ob:ne=$N;break;case Rb:ne=nA;break;case"scroll":case"scrollend":ne=kN;break;case"wheel":ne=oA;break;case"copy":case"cut":case"paste":ne=VN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=ib;break;case"toggle":case"beforetoggle":ne=iA}var Ee=(t&4)!==0,et=!Ee&&(e==="scroll"||e==="scrollend"),q=Ee?te!==null?te+"Capture":null:te;Ee=[];for(var P=W,Q;P!==null;){var oe=P;if(Q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Q===null||q===null||(oe=Ii(P,q),oe!=null&&Ee.push(gl(P,oe,Q))),et)break;P=P.return}0<Ee.length&&(te=new ne(te,Oe,null,o,re),ae.push({event:te,listeners:Ee}))}}if((t&7)===0){e:{if(te=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",te&&o!==Fd&&(Oe=o.relatedTarget||o.fromElement)&&(va(Oe)||Oe[ya]))break e;if((ne||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,ne?(Oe=o.relatedTarget||o.toElement,ne=W,Oe=Oe?va(Oe):null,Oe!==null&&(et=s(Oe),Ee=Oe.tag,Oe!==et||Ee!==5&&Ee!==27&&Ee!==6)&&(Oe=null)):(ne=null,Oe=W),ne!==Oe)){if(Ee=ob,oe="onMouseLeave",q="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=ib,oe="onPointerLeave",q="onPointerEnter",P="pointer"),et=ne==null?te:Di(ne),Q=Oe==null?te:Di(Oe),te=new Ee(oe,P+"leave",ne,o,re),te.target=et,te.relatedTarget=Q,oe=null,va(re)===W&&(Ee=new Ee(q,P+"enter",Oe,o,re),Ee.target=Q,Ee.relatedTarget=et,oe=Ee),et=oe,ne&&Oe)t:{for(Ee=ne,q=Oe,P=0,Q=Ee;Q;Q=Wa(Q))P++;for(Q=0,oe=q;oe;oe=Wa(oe))Q++;for(;0<P-Q;)Ee=Wa(Ee),P--;for(;0<Q-P;)q=Wa(q),Q--;for(;P--;){if(Ee===q||q!==null&&Ee===q.alternate)break t;Ee=Wa(Ee),q=Wa(q)}Ee=null}else Ee=null;ne!==null&&F0(ae,te,ne,Ee,!1),Oe!==null&&et!==null&&F0(ae,et,Oe,Ee,!0)}}e:{if(te=W?Di(W):window,ne=te.nodeName&&te.nodeName.toLowerCase(),ne==="select"||ne==="input"&&te.type==="file")var me=mb;else if(fb(te))if(pb)me=gA;else{me=mA;var Le=hA}else ne=te.nodeName,!ne||ne.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?W&&Kd(W.elementType)&&(me=mb):me=pA;if(me&&(me=me(e,W))){hb(ae,me,o,re);break e}Le&&Le(e,te,W),e==="focusout"&&W&&te.type==="number"&&W.memoizedProps.value!=null&&Xd(te,"number",te.value)}switch(Le=W?Di(W):window,e){case"focusin":(fb(Le)||Le.contentEditable==="true")&&(Ra=Le,cf=W,$i=null);break;case"focusout":$i=cf=Ra=null;break;case"mousedown":uf=!0;break;case"contextmenu":case"mouseup":case"dragend":uf=!1,wb(ae,o,re);break;case"selectionchange":if(vA)break;case"keydown":case"keyup":wb(ae,o,re)}var xe;if(of)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 Oa?ub(e,o)&&(Te="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(Te="onCompositionStart");Te&&(lb&&o.locale!=="ko"&&(Oa||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&Oa&&(xe=nb()):(Gr=re,Jd="value"in Gr?Gr.value:Gr.textContent,Oa=!0)),Le=Tc(W,Te),0<Le.length&&(Te=new ab(Te,e,null,o,re),ae.push({event:Te,listeners:Le}),xe?Te.data=xe:(xe=db(o),xe!==null&&(Te.data=xe)))),(xe=sA?cA(e,o):uA(e,o))&&(Te=Tc(W,"onBeforeInput"),0<Te.length&&(Le=new ab("onBeforeInput","beforeinput",null,o,re),ae.push({event:Le,listeners:Te}),Le.data=xe)),eM(ae,e,W,o,re)}X0(ae,t)})}function gl(e,t,o){return{instance:e,listener:t,currentTarget:o}}function Tc(e,t){for(var o=t+"Capture",i=[];e!==null;){var d=e,p=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||p===null||(d=Ii(e,o),d!=null&&i.unshift(gl(e,d,p)),d=Ii(e,t),d!=null&&i.push(gl(e,d,p))),e.tag===3)return i;e=e.return}return[]}function Wa(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function F0(e,t,o,i,d){for(var p=t._reactName,j=[];o!==null&&o!==i;){var _=o,B=_.alternate,W=_.stateNode;if(_=_.tag,B!==null&&B===i)break;_!==5&&_!==26&&_!==27||W===null||(B=W,d?(W=Ii(o,p),W!=null&&j.unshift(gl(o,W,B))):d||(W=Ii(o,p),W!=null&&j.push(gl(o,W,B)))),o=o.return}j.length!==0&&e.push({event:t,listeners:j})}var oM=/\r\n?/g,aM=/\u0000|\uFFFD/g;function Q0(e){return(typeof e=="string"?e:""+e).replace(oM,`
49
- `).replace(aM,"")}function Z0(e,t){return t=Q0(t),Q0(e)===t}function jc(){}function Je(e,t,o,i,d,p){switch(o){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ea(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ea(e,""+i);break;case"className":Ms(e,"class",i);break;case"tabIndex":Ms(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Ms(e,o,i);break;case"style":Jv(e,i,p);break;case"data":if(t!=="object"){Ms(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||o!=="href")){e.removeAttribute(o);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(o);break}i=Is(""+i),e.setAttribute(o,i);break;case"action":case"formAction":if(typeof i=="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 p=="function"&&(o==="formAction"?(t!=="input"&&Je(e,t,"name",d.name,d,null),Je(e,t,"formEncType",d.formEncType,d,null),Je(e,t,"formMethod",d.formMethod,d,null),Je(e,t,"formTarget",d.formTarget,d,null)):(Je(e,t,"encType",d.encType,d,null),Je(e,t,"method",d.method,d,null),Je(e,t,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(o);break}i=Is(""+i),e.setAttribute(o,i);break;case"onClick":i!=null&&(e.onclick=jc);break;case"onScroll":i!=null&&Ue("scroll",e);break;case"onScrollEnd":i!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(a(61));if(o=i.__html,o!=null){if(d.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}o=Is(""+i),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":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(o,""+i):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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":i===!0?e.setAttribute(o,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(o,i):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(o,i):e.removeAttribute(o);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(o):e.setAttribute(o,i);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),As(e,"popover",i);break;case"xlinkActuate":gr(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":gr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":gr(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":gr(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":gr(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":gr(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":gr(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":gr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":gr(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":As(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=zN.get(o)||o,As(e,o,i))}}function Dh(e,t,o,i,d,p){switch(o){case"style":Jv(e,i,p);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(a(61));if(o=i.__html,o!=null){if(d.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"children":typeof i=="string"?Ea(e,i):(typeof i=="number"||typeof i=="bigint")&&Ea(e,""+i);break;case"onScroll":i!=null&&Ue("scroll",e);break;case"onScrollEnd":i!=null&&Ue("scrollend",e);break;case"onClick":i!=null&&(e.onclick=jc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$v.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),t=o.slice(2,d?o.length-7:void 0),p=e[Zt]||null,p=p!=null?p[o]:null,typeof p=="function"&&e.removeEventListener(t,p,d),typeof i=="function")){typeof p!="function"&&p!==null&&(o in e?e[o]=null:e.hasAttribute(o)&&e.removeAttribute(o)),e.addEventListener(t,i,d);break e}o in e?e[o]=i:i===!0?e.setAttribute(o,""):As(e,o,i)}}}function kt(e,t,o){switch(t){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 i=!1,d=!1,p;for(p in o)if(o.hasOwnProperty(p)){var j=o[p];if(j!=null)switch(p){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Je(e,t,p,j,o,null)}}d&&Je(e,t,"srcSet",o.srcSet,o,null),i&&Je(e,t,"src",o.src,o,null);return;case"input":Ue("invalid",e);var _=p=j=d=null,B=null,W=null;for(i in o)if(o.hasOwnProperty(i)){var re=o[i];if(re!=null)switch(i){case"name":d=re;break;case"type":j=re;break;case"checked":B=re;break;case"defaultChecked":W=re;break;case"value":p=re;break;case"defaultValue":_=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,t));break;default:Je(e,t,i,re,o,null)}}Fv(e,p,_,B,W,j,d,!1),_s(e);return;case"select":Ue("invalid",e),i=j=p=null;for(d in o)if(o.hasOwnProperty(d)&&(_=o[d],_!=null))switch(d){case"value":p=_;break;case"defaultValue":j=_;break;case"multiple":i=_;default:Je(e,t,d,_,o,null)}t=p,o=j,e.multiple=!!i,t!=null?wa(e,!!i,t,!1):o!=null&&wa(e,!!i,o,!0);return;case"textarea":Ue("invalid",e),p=d=i=null;for(j in o)if(o.hasOwnProperty(j)&&(_=o[j],_!=null))switch(j){case"value":i=_;break;case"defaultValue":d=_;break;case"children":p=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:Je(e,t,j,_,o,null)}Zv(e,i,d,p),_s(e);return;case"option":for(B in o)if(o.hasOwnProperty(B)&&(i=o[B],i!=null))switch(B){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Je(e,t,B,i,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(i=0;i<pl.length;i++)Ue(pl[i],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)&&(i=o[W],i!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Je(e,t,W,i,o,null)}return;default:if(Kd(t)){for(re in o)o.hasOwnProperty(re)&&(i=o[re],i!==void 0&&Dh(e,t,re,i,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(i=o[_],i!=null&&Je(e,t,_,i,o,null))}function iM(e,t,o,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,p=null,j=null,_=null,B=null,W=null,re=null;for(ne in o){var ae=o[ne];if(o.hasOwnProperty(ne)&&ae!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":B=ae;default:i.hasOwnProperty(ne)||Je(e,t,ne,null,i,ae)}}for(var te in i){var ne=i[te];if(ae=o[te],i.hasOwnProperty(te)&&(ne!=null||ae!=null))switch(te){case"type":p=ne;break;case"name":d=ne;break;case"checked":W=ne;break;case"defaultChecked":re=ne;break;case"value":j=ne;break;case"defaultValue":_=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,t));break;default:ne!==ae&&Je(e,t,te,ne,i,ae)}}Yd(e,j,_,B,W,re,p,d);return;case"select":ne=j=_=te=null;for(p in o)if(B=o[p],o.hasOwnProperty(p)&&B!=null)switch(p){case"value":break;case"multiple":ne=B;default:i.hasOwnProperty(p)||Je(e,t,p,null,i,B)}for(d in i)if(p=i[d],B=o[d],i.hasOwnProperty(d)&&(p!=null||B!=null))switch(d){case"value":te=p;break;case"defaultValue":_=p;break;case"multiple":j=p;default:p!==B&&Je(e,t,d,p,i,B)}t=_,o=j,i=ne,te!=null?wa(e,!!o,te,!1):!!i!=!!o&&(t!=null?wa(e,!!o,t,!0):wa(e,!!o,o?[]:"",!1));return;case"textarea":ne=te=null;for(_ in o)if(d=o[_],o.hasOwnProperty(_)&&d!=null&&!i.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Je(e,t,_,null,i,d)}for(j in i)if(d=i[j],p=o[j],i.hasOwnProperty(j)&&(d!=null||p!=null))switch(j){case"value":te=d;break;case"defaultValue":ne=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(a(91));break;default:d!==p&&Je(e,t,j,d,i,p)}Qv(e,te,ne);return;case"option":for(var Oe in o)if(te=o[Oe],o.hasOwnProperty(Oe)&&te!=null&&!i.hasOwnProperty(Oe))switch(Oe){case"selected":e.selected=!1;break;default:Je(e,t,Oe,null,i,te)}for(B in i)if(te=i[B],ne=o[B],i.hasOwnProperty(B)&&te!==ne&&(te!=null||ne!=null))switch(B){case"selected":e.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Je(e,t,B,te,i,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)te=o[Ee],o.hasOwnProperty(Ee)&&te!=null&&!i.hasOwnProperty(Ee)&&Je(e,t,Ee,null,i,te);for(W in i)if(te=i[W],ne=o[W],i.hasOwnProperty(W)&&te!==ne&&(te!=null||ne!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,t));break;default:Je(e,t,W,te,i,ne)}return;default:if(Kd(t)){for(var et in o)te=o[et],o.hasOwnProperty(et)&&te!==void 0&&!i.hasOwnProperty(et)&&Dh(e,t,et,void 0,i,te);for(re in i)te=i[re],ne=o[re],!i.hasOwnProperty(re)||te===ne||te===void 0&&ne===void 0||Dh(e,t,re,te,i,ne);return}}for(var q in o)te=o[q],o.hasOwnProperty(q)&&te!=null&&!i.hasOwnProperty(q)&&Je(e,t,q,null,i,te);for(ae in i)te=i[ae],ne=o[ae],!i.hasOwnProperty(ae)||te===ne||te==null&&ne==null||Je(e,t,ae,te,i,ne)}var Ih=null,zh=null;function Oc(e){return e.nodeType===9?e:e.ownerDocument}function W0(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 J0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Lh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var kh=null;function lM(){var e=window.event;return e&&e.type==="popstate"?e===kh?!1:(kh=e,!0):(kh=null,!1)}var eS=typeof setTimeout=="function"?setTimeout:void 0,sM=typeof clearTimeout=="function"?clearTimeout:void 0,tS=typeof Promise=="function"?Promise:void 0,cM=typeof queueMicrotask=="function"?queueMicrotask:typeof tS<"u"?function(e){return tS.resolve(null).then(e).catch(uM)}:eS;function uM(e){setTimeout(function(){throw e})}function ao(e){return e==="head"}function nS(e,t){var o=t,i=0,d=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(0<i&&8>i){o=i;var j=e.ownerDocument;if(o&1&&yl(j.documentElement),o&2&&yl(j.body),o&4)for(o=j.head,yl(o),j=o.firstChild;j;){var _=j.nextSibling,B=j.nodeName;j[_i]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&j.rel.toLowerCase()==="stylesheet"||o.removeChild(j),j=_}}if(d===0){e.removeChild(p),Tl(t);return}d--}else o==="$"||o==="$?"||o==="$!"?d++:i=o.charCodeAt(0)-48;else i=0;o=p}while(o);Tl(t)}function Hh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var o=t;switch(t=t.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Hh(o),$d(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function dM(e,t,o,i){for(;e.nodeType===1;){var d=o;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[_i])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var p=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=kn(e.nextSibling),e===null)break}return null}function fM(e,t,o){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o||(e=kn(e.nextSibling),e===null))return null;return e}function Bh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function hM(e,t){var o=e.ownerDocument;if(e.data!=="$?"||o.readyState==="complete")t();else{var i=function(){t(),o.removeEventListener("DOMContentLoaded",i)};o.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function kn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Uh=null;function rS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(t===0)return e;t--}else o==="/$"&&t++}e=e.previousSibling}return null}function oS(e,t,o){switch(t=Oc(o),e){case"html":if(e=t.documentElement,!e)throw Error(a(452));return e;case"head":if(e=t.head,!e)throw Error(a(453));return e;case"body":if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function yl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$d(e)}var Nn=new Map,aS=new Set;function Rc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ar=$.d;$.d={f:mM,r:pM,D:gM,C:yM,L:vM,m:bM,X:SM,S:xM,M:CM};function mM(){var e=Ar.f(),t=bc();return e||t}function pM(e){var t=ba(e);t!==null&&t.tag===5&&t.type==="form"?Tx(t):Ar.r(e)}var Ja=typeof document>"u"?null:document;function iS(e,t,o){var i=Ja;if(i&&typeof t=="string"&&t){var d=Cn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),aS.has(d)||(aS.add(d),e={rel:e,crossOrigin:o,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),kt(t,"link",e),At(t),i.head.appendChild(t)))}}function gM(e){Ar.D(e),iS("dns-prefetch",e,null)}function yM(e,t){Ar.C(e,t),iS("preconnect",e,t)}function vM(e,t,o){Ar.L(e,t,o);var i=Ja;if(i&&e&&t){var d='link[rel="preload"][as="'+Cn(t)+'"]';t==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+Cn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+Cn(o.imageSizes)+'"]')):d+='[href="'+Cn(e)+'"]';var p=d;switch(t){case"style":p=ei(e);break;case"script":p=ti(e)}Nn.has(p)||(e=b({rel:"preload",href:t==="image"&&o&&o.imageSrcSet?void 0:e,as:t},o),Nn.set(p,e),i.querySelector(d)!==null||t==="style"&&i.querySelector(vl(p))||t==="script"&&i.querySelector(bl(p))||(t=i.createElement("link"),kt(t,"link",e),At(t),i.head.appendChild(t)))}}function bM(e,t){Ar.m(e,t);var o=Ja;if(o&&e){var i=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+Cn(i)+'"][href="'+Cn(e)+'"]',p=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ti(e)}if(!Nn.has(p)&&(e=b({rel:"modulepreload",href:e},t),Nn.set(p,e),o.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(bl(p)))return}i=o.createElement("link"),kt(i,"link",e),At(i),o.head.appendChild(i)}}}function xM(e,t,o){Ar.S(e,t,o);var i=Ja;if(i&&e){var d=xa(i).hoistableStyles,p=ei(e);t=t||"default";var j=d.get(p);if(!j){var _={loading:0,preload:null};if(j=i.querySelector(vl(p)))_.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},o),(o=Nn.get(p))&&Ph(e,o);var B=j=i.createElement("link");At(B),kt(B,"link",e),B._p=new Promise(function(W,re){B.onload=W,B.onerror=re}),B.addEventListener("load",function(){_.loading|=1}),B.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Nc(j,t,i)}j={type:"stylesheet",instance:j,count:1,state:_},d.set(p,j)}}}function SM(e,t){Ar.X(e,t);var o=Ja;if(o&&e){var i=xa(o).hoistableScripts,d=ti(e),p=i.get(d);p||(p=o.querySelector(bl(d)),p||(e=b({src:e,async:!0},t),(t=Nn.get(d))&&$h(e,t),p=o.createElement("script"),At(p),kt(p,"link",e),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},i.set(d,p))}}function CM(e,t){Ar.M(e,t);var o=Ja;if(o&&e){var i=xa(o).hoistableScripts,d=ti(e),p=i.get(d);p||(p=o.querySelector(bl(d)),p||(e=b({src:e,async:!0,type:"module"},t),(t=Nn.get(d))&&$h(e,t),p=o.createElement("script"),At(p),kt(p,"link",e),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},i.set(d,p))}}function lS(e,t,o,i){var d=(d=ie.current)?Rc(d):null;if(!d)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(t=ei(o.href),o=xa(d).hoistableStyles,i=o.get(t),i||(i={type:"style",instance:null,count:0,state:null},o.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=ei(o.href);var p=xa(d).hoistableStyles,j=p.get(e);if(j||(d=d.ownerDocument||d,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,j),(p=d.querySelector(vl(e)))&&!p._p&&(j.instance=p,j.state.loading=5),Nn.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},Nn.set(e,o),p||wM(d,e,o,j.state))),t&&i===null)throw Error(a(528,""));return j}if(t&&i!==null)throw Error(a(529,""));return null;case"script":return t=o.async,o=o.src,typeof o=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ti(o),o=xa(d).hoistableScripts,i=o.get(t),i||(i={type:"script",instance:null,count:0,state:null},o.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function ei(e){return'href="'+Cn(e)+'"'}function vl(e){return'link[rel="stylesheet"]['+e+"]"}function sS(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function wM(e,t,o,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),kt(t,"link",o),At(t),e.head.appendChild(t))}function ti(e){return'[src="'+Cn(e)+'"]'}function bl(e){return"script[async]"+e}function cS(e,t,o){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Cn(o.href)+'"]');if(i)return t.instance=i,At(i),i;var d=b({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),At(i),kt(i,"style",d),Nc(i,o.precedence,e),t.instance=i;case"stylesheet":d=ei(o.href);var p=e.querySelector(vl(d));if(p)return t.state.loading|=4,t.instance=p,At(p),p;i=sS(o),(d=Nn.get(d))&&Ph(i,d),p=(e.ownerDocument||e).createElement("link"),At(p);var j=p;return j._p=new Promise(function(_,B){j.onload=_,j.onerror=B}),kt(p,"link",i),t.state.loading|=4,Nc(p,o.precedence,e),t.instance=p;case"script":return p=ti(o.src),(d=e.querySelector(bl(p)))?(t.instance=d,At(d),d):(i=o,(d=Nn.get(p))&&(i=b({},o),$h(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),At(d),kt(d,"link",i),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(a(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Nc(i,o.precedence,e));return t.instance}function Nc(e,t,o){for(var i=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,p=d,j=0;j<i.length;j++){var _=i[j];if(_.dataset.precedence===t)p=_;else if(p!==d)break}p?p.parentNode.insertBefore(e,p.nextSibling):(t=o.nodeType===9?o.head:o,t.insertBefore(e,t.firstChild))}function Ph(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ac=null;function uS(e,t,o){if(Ac===null){var i=new Map,d=Ac=new Map;d.set(o,i)}else d=Ac,i=d.get(o),i||(i=new Map,d.set(o,i));if(i.has(e))return i;for(i.set(e,null),o=o.getElementsByTagName(e),d=0;d<o.length;d++){var p=o[d];if(!(p[_i]||p[$t]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var j=p.getAttribute(t)||"";j=e+j;var _=i.get(j);_?_.push(p):i.set(j,[p])}}return i}function dS(e,t,o){e=e.ownerDocument||e,e.head.insertBefore(o,t==="title"?e.querySelector("head > title"):null)}function EM(e,t,o){if(o===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function fS(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var xl=null;function TM(){}function jM(e,t,o){if(xl===null)throw Error(a(475));var i=xl;if(t.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var d=ei(o.href),p=e.querySelector(vl(d));if(p){e=p._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(i.count++,i=Mc.bind(i),e.then(i,i)),t.state.loading|=4,t.instance=p,At(p);return}p=e.ownerDocument||e,o=sS(o),(d=Nn.get(d))&&Ph(o,d),p=p.createElement("link"),At(p);var j=p;j._p=new Promise(function(_,B){j.onload=_,j.onerror=B}),kt(p,"link",o),t.instance=p}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(i.count++,t=Mc.bind(i),e.addEventListener("load",t),e.addEventListener("error",t))}}function OM(){if(xl===null)throw Error(a(475));var e=xl;return e.stylesheets&&e.count===0&&Gh(e,e.stylesheets),0<e.count?function(t){var o=setTimeout(function(){if(e.stylesheets&&Gh(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(o)}}:null}function Mc(){if(this.count--,this.count===0){if(this.stylesheets)Gh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _c=null;function Gh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_c=new Map,t.forEach(RM,e),_c=null,Mc.call(e))}function RM(e,t){if(!(t.state.loading&4)){var o=_c.get(e);if(o)var i=o.get(null);else{o=new Map,_c.set(e,o);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<d.length;p++){var j=d[p];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(o.set(j.dataset.precedence,j),i=j)}i&&o.set(null,i)}d=t.instance,j=d.getAttribute("data-precedence"),p=o.get(j)||i,p===i&&o.set(null,d),o.set(j,d),this.count++,i=Mc.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),p?p.parentNode.insertBefore(d,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Sl={$$typeof:T,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function NM(e,t,o,i,d,p,j,_){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=Hd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hd(0),this.hiddenUpdates=Hd(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function hS(e,t,o,i,d,p,j,_,B,W,re,ae){return e=new NM(e,t,o,j,_,B,W,ae),t=1,p===!0&&(t|=24),p=sn(3,null,null,t),e.current=p,p.stateNode=e,t=Ef(),t.refCount++,e.pooledCache=t,t.refCount++,p.memoizedState={element:i,isDehydrated:o,cache:t},Rf(p),e}function mS(e){return e?(e=_a,e):_a}function pS(e,t,o,i,d,p){d=mS(d),i.context===null?i.context=d:i.pendingContext=d,i=Yr(t),i.payload={element:o},p=p===void 0?null:p,p!==null&&(i.callback=p),o=Xr(e,i,t),o!==null&&(hn(o,e,t),Zi(o,e,t))}function gS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<t?o:t}}function Vh(e,t){gS(e,t),(e=e.alternate)&&gS(e,t)}function yS(e){if(e.tag===13){var t=Ma(e,67108864);t!==null&&hn(t,e,67108864),Vh(e,67108864)}}var Dc=!0;function AM(e,t,o,i){var d=k.T;k.T=null;var p=$.p;try{$.p=2,qh(e,t,o,i)}finally{$.p=p,k.T=d}}function MM(e,t,o,i){var d=k.T;k.T=null;var p=$.p;try{$.p=8,qh(e,t,o,i)}finally{$.p=p,k.T=d}}function qh(e,t,o,i){if(Dc){var d=Yh(i);if(d===null)_h(e,t,i,Ic,o),bS(e,i);else if(DM(d,e,t,o,i))i.stopPropagation();else if(bS(e,i),t&4&&-1<_M.indexOf(e)){for(;d!==null;){var p=ba(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var j=Yn(p.pendingLanes);if(j!==0){var _=p;for(_.pendingLanes|=2,_.entangledLanes|=2;j;){var B=1<<31-ye(j);_.entanglements[1]|=B,j&=~B}Zn(p),(Qe&6)===0&&(yc=jt()+500,ml(0))}}break;case 13:_=Ma(p,2),_!==null&&hn(_,p,2),bc(),Vh(p,2)}if(p=Yh(i),p===null&&_h(e,t,i,Ic,o),p===d)break;d=p}d!==null&&i.stopPropagation()}else _h(e,t,i,null,o)}}function Yh(e){return e=Qd(e),Xh(e)}var Ic=null;function Xh(e){if(Ic=null,e=va(e),e!==null){var t=s(e);if(t===null)e=null;else{var o=t.tag;if(o===13){if(e=u(t),e!==null)return e;e=null}else if(o===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ic=e,null}function vS(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(pe()){case ct:return 2;case ut:return 8;case an:case hr:return 32;case pa:return 268435456;default:return 32}default:return 32}}var Kh=!1,io=null,lo=null,so=null,Cl=new Map,wl=new Map,co=[],_M="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 bS(e,t){switch(e){case"focusin":case"focusout":io=null;break;case"dragenter":case"dragleave":lo=null;break;case"mouseover":case"mouseout":so=null;break;case"pointerover":case"pointerout":Cl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(t.pointerId)}}function El(e,t,o,i,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:o,eventSystemFlags:i,nativeEvent:p,targetContainers:[d]},t!==null&&(t=ba(t),t!==null&&yS(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function DM(e,t,o,i,d){switch(t){case"focusin":return io=El(io,e,t,o,i,d),!0;case"dragenter":return lo=El(lo,e,t,o,i,d),!0;case"mouseover":return so=El(so,e,t,o,i,d),!0;case"pointerover":var p=d.pointerId;return Cl.set(p,El(Cl.get(p)||null,e,t,o,i,d)),!0;case"gotpointercapture":return p=d.pointerId,wl.set(p,El(wl.get(p)||null,e,t,o,i,d)),!0}return!1}function xS(e){var t=va(e.target);if(t!==null){var o=s(t);if(o!==null){if(t=o.tag,t===13){if(t=u(o),t!==null){e.blockedOn=t,jN(e.priority,function(){if(o.tag===13){var i=fn();i=Bd(i);var d=Ma(o,i);d!==null&&hn(d,o,i),Vh(o,i)}});return}}else if(t===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var o=Yh(e.nativeEvent);if(o===null){o=e.nativeEvent;var i=new o.constructor(o.type,o);Fd=i,o.target.dispatchEvent(i),Fd=null}else return t=ba(o),t!==null&&yS(t),e.blockedOn=o,!1;t.shift()}return!0}function SS(e,t,o){zc(e)&&o.delete(t)}function IM(){Kh=!1,io!==null&&zc(io)&&(io=null),lo!==null&&zc(lo)&&(lo=null),so!==null&&zc(so)&&(so=null),Cl.forEach(SS),wl.forEach(SS)}function Lc(e,t){e.blockedOn===t&&(e.blockedOn=null,Kh||(Kh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,IM)))}var kc=null;function CS(e){kc!==e&&(kc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){kc===e&&(kc=null);for(var t=0;t<e.length;t+=3){var o=e[t],i=e[t+1],d=e[t+2];if(typeof i!="function"){if(Xh(i||o)===null)continue;break}var p=ba(o);p!==null&&(e.splice(t,3),t-=3,Xf(p,{pending:!0,data:d,method:o.method,action:i},i,d))}}))}function Tl(e){function t(B){return Lc(B,e)}io!==null&&Lc(io,e),lo!==null&&Lc(lo,e),so!==null&&Lc(so,e),Cl.forEach(t),wl.forEach(t);for(var o=0;o<co.length;o++){var i=co[o];i.blockedOn===e&&(i.blockedOn=null)}for(;0<co.length&&(o=co[0],o.blockedOn===null);)xS(o),o.blockedOn===null&&co.shift();if(o=(e.ownerDocument||e).$$reactFormReplay,o!=null)for(i=0;i<o.length;i+=3){var d=o[i],p=o[i+1],j=d[Zt]||null;if(typeof p=="function")j||CS(o);else if(j){var _=null;if(p&&p.hasAttribute("formAction")){if(d=p,j=p[Zt]||null)_=j.formAction;else if(Xh(d)!==null)continue}else _=j.action;typeof _=="function"?o[i+1]=_:(o.splice(i,3),i-=3),CS(o)}}}function Fh(e){this._internalRoot=e}Hc.prototype.render=Fh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var o=t.current,i=fn();pS(o,i,e,t,null,null)},Hc.prototype.unmount=Fh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pS(e.current,2,null,e,null,null),bc(),t[ya]=null}};function Hc(e){this._internalRoot=e}Hc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bv();e={blockedOn:null,target:e,priority:t};for(var o=0;o<co.length&&t!==0&&t<co[o].priority;o++);co.splice(o,0,e),o===0&&xS(e)}};var wS=r.version;if(wS!=="19.1.1")throw Error(a(527,wS,"19.1.1"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=g(t),e=e!==null?m(e):null,e=e===null?null:e.stateNode,e};var zM={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bc.isDisabled&&Bc.supportsFiber)try{mr=Bc.inject(zM),se=Bc}catch{}}return mi.createRoot=function(e,t){if(!c(e))throw Error(a(299));var o=!1,i="",d=Bx,p=Ux,j=Px,_=null;return t!=null&&(t.unstable_strictMode===!0&&(o=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(p=t.onCaughtError),t.onRecoverableError!==void 0&&(j=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(_=t.unstable_transitionCallbacks)),t=hS(e,1,!1,null,null,o,i,d,p,j,_,null),e[ya]=t.current,Mh(e),new Fh(t)},mi.hydrateRoot=function(e,t,o){if(!c(e))throw Error(a(299));var i=!1,d="",p=Bx,j=Ux,_=Px,B=null,W=null;return o!=null&&(o.unstable_strictMode===!0&&(i=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(B=o.unstable_transitionCallbacks),o.formState!==void 0&&(W=o.formState)),t=hS(e,1,!0,t,o??null,i,d,p,j,_,B,W),t.context=mS(null),o=t.current,i=fn(),i=Bd(i),d=Yr(i),d.callback=null,Xr(o,d,i),o=i,t.current.lanes=o,Mi(t,o),Zn(t),e[ya]=t.current,Mh(e),new Hc(t)},mi.version="19.1.1",mi}var Em;function gC(){if(Em)return uu.exports;Em=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),uu.exports=pC(),uu.exports}var yC=gC(),Dr=Cm();function Tm(n){var r,l,a="";if(typeof n=="string"||typeof n=="number")a+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(r=0;r<c;r++)n[r]&&(l=Tm(n[r]))&&(a&&(a+=" "),a+=l)}else for(l in n)n[l]&&(a&&(a+=" "),a+=l);return a}function jm(){for(var n,r,l=0,a="",c=arguments.length;l<c;l++)(n=arguments[l])&&(r=Tm(n))&&(a&&(a+=" "),a+=r);return a}const vC=(n,r)=>{const l=new Array(n.length+r.length);for(let a=0;a<n.length;a++)l[a]=n[a];for(let a=0;a<r.length;a++)l[n.length+a]=r[a];return l},bC=(n,r)=>({classGroupId:n,validator:r}),Om=(n=new Map,r=null,l)=>({nextPart:n,validators:r,classGroupId:l}),Ll="-",Rm=[],xC="arbitrary..",SC=n=>{const r=wC(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:a}=n;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return CC(u);const h=u.split(Ll),g=h[0]===""&&h.length>1?1:0;return Nm(h,g,r)},getConflictingClassGroupIds:(u,h)=>{if(h){const g=a[u],m=l[u];return g?m?vC(m,g):g:m||Rm}return l[u]||Rm}}},Nm=(n,r,l)=>{if(n.length-r===0)return l.classGroupId;const c=n[r],s=l.nextPart.get(c);if(s){const m=Nm(n,r+1,s);if(m)return m}const u=l.validators;if(u===null)return;const h=r===0?n.join(Ll):n.slice(r).join(Ll),g=u.length;for(let m=0;m<g;m++){const b=u[m];if(b.validator(h))return b.classGroupId}},CC=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),l=r.indexOf(":"),a=r.slice(0,l);return a?xC+a:void 0})(),wC=n=>{const{theme:r,classGroups:l}=n;return EC(l,r)},EC=(n,r)=>{const l=Om();for(const a in n){const c=n[a];mu(c,l,a,r)}return l},mu=(n,r,l,a)=>{const c=n.length;for(let s=0;s<c;s++){const u=n[s];TC(u,r,l,a)}},TC=(n,r,l,a)=>{if(typeof n=="string"){jC(n,r,l);return}if(typeof n=="function"){OC(n,r,l,a);return}RC(n,r,l,a)},jC=(n,r,l)=>{const a=n===""?r:Am(r,n);a.classGroupId=l},OC=(n,r,l,a)=>{if(NC(n)){mu(n(a),r,l,a);return}r.validators===null&&(r.validators=[]),r.validators.push(bC(l,n))},RC=(n,r,l,a)=>{const c=Object.entries(n),s=c.length;for(let u=0;u<s;u++){const[h,g]=c[u];mu(g,Am(r,h),l,a)}},Am=(n,r)=>{let l=n;const a=r.split(Ll),c=a.length;for(let s=0;s<c;s++){const u=a[s];let h=l.nextPart.get(u);h||(h=Om(),l.nextPart.set(u,h)),l=h}return l},NC=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,AC=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,l=Object.create(null),a=Object.create(null);const c=(s,u)=>{l[s]=u,r++,r>n&&(r=0,a=l,l=Object.create(null))};return{get(s){let u=l[s];if(u!==void 0)return u;if((u=a[s])!==void 0)return c(s,u),u},set(s,u){s in l?l[s]=u:c(s,u)}}},pu="!",Mm=":",MC=[],_m=(n,r,l,a,c)=>({modifiers:n,hasImportantModifier:r,baseClassName:l,maybePostfixModifierPosition:a,isExternal:c}),_C=n=>{const{prefix:r,experimentalParseClassName:l}=n;let a=c=>{const s=[];let u=0,h=0,g=0,m;const b=c.length;for(let S=0;S<b;S++){const E=c[S];if(u===0&&h===0){if(E===Mm){s.push(c.slice(g,S)),g=S+1;continue}if(E==="/"){m=S;continue}}E==="["?u++:E==="]"?u--:E==="("?h++:E===")"&&h--}const v=s.length===0?c:c.slice(g);let w=v,C=!1;v.endsWith(pu)?(w=v.slice(0,-1),C=!0):v.startsWith(pu)&&(w=v.slice(1),C=!0);const y=m&&m>g?m-g:void 0;return _m(s,C,w,y)};if(r){const c=r+Mm,s=a;a=u=>u.startsWith(c)?s(u.slice(c.length)):_m(MC,!1,u,void 0,!0)}if(l){const c=a;a=s=>l({className:s,parseClassName:c})}return a},DC=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((l,a)=>{r.set(l,1e6+a)}),l=>{const a=[];let c=[];for(let s=0;s<l.length;s++){const u=l[s],h=u[0]==="[",g=r.has(u);h||g?(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}},IC=n=>({cache:AC(n.cacheSize),parseClassName:_C(n),sortModifiers:DC(n),postfixLookupClassGroupIds:zC(n),...SC(n)}),zC=n=>{const r=Object.create(null),l=n.postfixLookupClassGroups;if(l)for(let a=0;a<l.length;a++)r[l[a]]=!0;return r},LC=/\s+/,kC=(n,r)=>{const{parseClassName:l,getClassGroupId:a,getConflictingClassGroupIds:c,sortModifiers:s,postfixLookupClassGroupIds:u}=r,h=[],g=n.trim().split(LC);let m="";for(let b=g.length-1;b>=0;b-=1){const v=g[b],{isExternal:w,modifiers:C,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:E}=l(v);if(w){m=v+(m.length>0?" "+m:m);continue}let R=!!E,N;if(R){const z=S.substring(0,E);N=a(z);const H=N&&u[N]?a(S):void 0;H&&H!==N&&(N=H,R=!1)}else N=a(S);if(!N){if(!R){m=v+(m.length>0?" "+m:m);continue}if(N=a(S),!N){m=v+(m.length>0?" "+m:m);continue}R=!1}const T=C.length===0?"":C.length===1?C[0]:s(C).join(":"),O=y?T+pu:T,D=O+N;if(h.indexOf(D)>-1)continue;h.push(D);const M=c(N,R);for(let z=0;z<M.length;++z){const H=M[z];h.push(O+H)}m=v+(m.length>0?" "+m:m)}return m},HC=(...n)=>{let r=0,l,a,c="";for(;r<n.length;)(l=n[r++])&&(a=Dm(l))&&(c&&(c+=" "),c+=a);return c},Dm=n=>{if(typeof n=="string")return n;let r,l="";for(let a=0;a<n.length;a++)n[a]&&(r=Dm(n[a]))&&(l&&(l+=" "),l+=r);return l},BC=(n,...r)=>{let l,a,c,s;const u=g=>{const m=r.reduce((b,v)=>v(b),n());return l=IC(m),a=l.cache.get,c=l.cache.set,s=h,h(g)},h=g=>{const m=a(g);if(m)return m;const b=kC(g,l);return c(g,b),b};return s=u,(...g)=>s(HC(...g))},UC=[],wt=n=>{const r=l=>l[n]||UC;return r.isThemeGetter=!0,r.themeKey=n,r},Im=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zm=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GC=/\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$/,VC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,qC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ir=n=>PC.test(n),De=n=>!!n&&!Number.isNaN(Number(n)),Pn=n=>!!n&&Number.isInteger(Number(n)),gu=n=>n.endsWith("%")&&De(n.slice(0,-1)),Jn=n=>$C.test(n),Lm=()=>!0,XC=n=>GC.test(n)&&!VC.test(n),yu=()=>!1,KC=n=>qC.test(n),FC=n=>YC.test(n),QC=n=>!fe(n)&&!he(n),ZC=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),WC=n=>zr(n,$m,yu),fe=n=>Im.test(n),go=n=>zr(n,Gm,XC),km=n=>zr(n,i1,De),JC=n=>zr(n,qm,Lm),e1=n=>zr(n,Vm,yu),Hm=n=>zr(n,Um,yu),t1=n=>zr(n,Pm,FC),kl=n=>zr(n,Ym,KC),he=n=>zm.test(n),pi=n=>yo(n,Gm),n1=n=>yo(n,Vm),Bm=n=>yo(n,Um),r1=n=>yo(n,$m),o1=n=>yo(n,Pm),Hl=n=>yo(n,Ym,!0),a1=n=>yo(n,qm,!0),zr=(n,r,l)=>{const a=Im.exec(n);return a?a[1]?r(a[1]):l(a[2]):!1},yo=(n,r,l=!1)=>{const a=zm.exec(n);return a?a[1]?r(a[1]):l:!1},Um=n=>n==="position"||n==="percentage",Pm=n=>n==="image"||n==="url",$m=n=>n==="length"||n==="size"||n==="bg-size",Gm=n=>n==="length",i1=n=>n==="number",Vm=n=>n==="family-name",qm=n=>n==="number"||n==="weight",Ym=n=>n==="shadow",l1=BC(()=>{const n=wt("color"),r=wt("font"),l=wt("text"),a=wt("font-weight"),c=wt("tracking"),s=wt("leading"),u=wt("breakpoint"),h=wt("container"),g=wt("spacing"),m=wt("radius"),b=wt("shadow"),v=wt("inset-shadow"),w=wt("text-shadow"),C=wt("drop-shadow"),y=wt("blur"),S=wt("perspective"),E=wt("aspect"),R=wt("ease"),N=wt("animate"),T=()=>["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"],D=()=>[...O(),he,fe],M=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],H=()=>[he,fe,g],G=()=>[Ir,"full","auto",...H()],X=()=>[Pn,"none","subgrid",he,fe],U=()=>["auto",{span:["full",Pn,he,fe]},Pn,he,fe],F=()=>[Pn,"auto",he,fe],J=()=>["auto","min","max","fr",he,fe],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...H()],$=()=>[Ir,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],L=()=>[h,Ir,"screen","full","dvw","lvw","svw","min","max","fit",...H()],Z=()=>[Ir,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],A=()=>[n,he,fe],V=()=>[...O(),Bm,Hm,{position:[he,fe]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ee=()=>["auto","cover","contain",r1,WC,{size:[he,fe]}],le=()=>[gu,pi,go],ce=()=>["","none","full",m,he,fe],ie=()=>["",De,pi,go],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"],be=()=>[De,gu,Bm,Hm],de=()=>["","none",y,he,fe],Se=()=>["none",De,he,fe],_e=()=>["none",De,he,fe],Ce=()=>[De,he,fe],Ae=()=>[Ir,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jn],breakpoint:[Jn],color:[Lm],container:[Jn],"drop-shadow":[Jn],ease:["in","out","in-out"],font:[QC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jn],shadow:[Jn],spacing:["px",De],text:[Jn],"text-shadow":[Jn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ir,fe,he,E]}],container:["container"],"container-type":[{"@container":["","normal","size",he,fe]}],"container-named":[ZC],columns:[{columns:[De,"auto",fe,he,h]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:D()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{"inset-s":G(),start:G()}],end:[{"inset-e":G(),end:G()}],"inset-bs":[{"inset-bs":G()}],"inset-be":[{"inset-be":G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[Pn,"auto",he,fe]}],basis:[{basis:[Ir,"full","auto",h,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Ir,"auto","initial","none",fe]}],grow:[{grow:["",De,he,fe]}],shrink:[{shrink:["",De,he,fe]}],order:[{order:[Pn,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pbs:[{pbs:H()}],pbe:[{pbe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[h,"screen",...$()]}],"min-w":[{"min-w":[h,"screen","none",...$()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[u]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh","none",...$()]}],"font-size":[{text:["base",l,pi,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,a1,JC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gu,fe]}],"font-family":[{font:[n1,e1,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,he,fe]}],"line-clamp":[{"line-clamp":[De,"none",he,km]}],leading:[{leading:["none",s,...H()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",he,go]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[De,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"tab-size":[{tab:[Pn,he,fe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,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",he,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:V()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pn,he,fe],radial:["",he,fe],conic:["",Pn,he,fe]},o1,t1]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,he,fe]}],"outline-w":[{outline:["",De,pi,go]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","inner","none",b,Hl,kl]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",v,Hl,kl]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[De,go]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",w,Hl,kl]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[De,he,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":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:de()}],brightness:[{brightness:[De,he,fe]}],contrast:[{contrast:[De,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",C,Hl,kl]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",De,he,fe]}],"hue-rotate":[{"hue-rotate":[De,he,fe]}],invert:[{invert:["",De,he,fe]}],saturate:[{saturate:[De,he,fe]}],sepia:[{sepia:["",De,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[De,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[De,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",De,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[De,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[De,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",De,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",he,fe]}],ease:[{ease:["linear","initial",R,he,fe]}],delay:[{delay:[De,he,fe]}],animate:[{animate:["none",N,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,he,fe]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ae()}],"translate-x":[{"translate-x":Ae()}],"translate-y":[{"translate-y":Ae()}],"translate-z":[{"translate-z":Ae()}],"translate-none":["translate-none"],zoom:[{zoom:[Pn,he,fe]}],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",he,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":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mbs":[{"scroll-mbs":H()}],"scroll-mbe":[{"scroll-mbe":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pbs":[{"scroll-pbs":H()}],"scroll-pbe":[{"scroll-pbe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",he,fe]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[De,pi,go,km]}],stroke:[{stroke:["none",...A()]}],"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(...n){return l1(jm(n))}var s1=Object.defineProperty,vu=(n,r)=>s1(n,"name",{value:r,configurable:!0});function bu(n,r){if(typeof n=="function")return n(r);n!=null&&(n.current=r)}vu(bu,"setRef");function Xm(...n){return r=>{let l=!1;const a=n.map(c=>{const s=bu(c,r);return!l&&typeof s=="function"&&(l=!0),s});if(l)return()=>{for(let c=0;c<a.length;c++){const s=a[c];typeof s=="function"?s():bu(n[c],null)}}}}vu(Xm,"composeRefs");function Ie(...n){return x.useCallback(Xm(...n),n)}vu(Ie,"useComposedRefs");var c1=Object.defineProperty,nn=(n,r)=>c1(n,"name",{value:r,configurable:!0});function er(n){const r=x.forwardRef((l,a)=>{let{children:c,...s}=l,u=null,h=!1;const g=[];c=ep(c),x.Children.forEach(c,w=>{if(Wm(w)){h=!0;const C=w;let y="child"in C.props?C.props.child:C.props.children;for(;xu(y)&&typeof Bl=="function";)y=Bl(y._payload);u=d1(C,y),g.push(u?.props?.children)}else g.push(w)}),u?u=x.cloneElement(u,void 0,g):!h&&x.Children.count(c)===1&&x.isValidElement(c)&&(u=c);const m=u?Zm(u):void 0,b=Ie(a,m);if(!u){if(c||c===0)throw new Error(h?m1(n):h1(n));return c}const v=Qm(s,u.props??{});return u.type!==x.Fragment&&(v.ref=a?b:m),x.cloneElement(u,v)});return r.displayName=`${n}.Slot`,r}nn(er,"createSlot");var u1=er("Slot"),Km=Symbol.for("radix.slottable");function Fm(n){const r=nn(l=>"child"in l?l.children(l.child):l.children,"Slottable");return r.displayName=`${n}.Slottable`,r.__radixId=Km,r}nn(Fm,"createSlottable");var d1=nn((n,r)=>"child"in n.props?x.isValidElement(r)?x.cloneElement(r,void 0,n.props.children(r.props.children)):null:x.isValidElement(r)?r:null,"getSlottableElementFromSlottable");function Qm(n,r){const l={...r};for(const a in r){const c=n[a],s=r[a];/^on[A-Z]/.test(a)?c&&s?l[a]=(...h)=>{const g=s(...h);return c(...h),g}:c&&(l[a]=c):a==="style"?l[a]={...c,...s}:a==="className"?l[a]=[c,s].filter(Boolean).join(" "):a==="aria-describedby"&&(l[a]=tp(s,c))}return{...n,...l}}nn(Qm,"mergeProps");function Zm(n){let r=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,l=r&&"isReactWarning"in r&&r.isReactWarning;return l?n.ref:(r=Object.getOwnPropertyDescriptor(n,"ref")?.get,l=r&&"isReactWarning"in r&&r.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}nn(Zm,"getElementRef");function Wm(n){return x.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===Km}nn(Wm,"isSlottable");var f1=Symbol.for("react.lazy");function xu(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===f1&&"_payload"in n&&Jm(n._payload)}nn(xu,"isLazyComponent");function Jm(n){return typeof n=="object"&&n!==null&&"then"in n}nn(Jm,"isPromiseLike");function ep(n){let r=n;for(;xu(r)&&typeof Bl=="function";)r=Bl(r._payload);return r}nn(ep,"useUnwrappedLazy");function tp(...n){const r=new Set;for(const l of n)if(typeof l=="string")for(const a of String(l).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}nn(tp,"concatAriaDescribedby");var h1=nn(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),m1=nn(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Bl=po[" use ".trim().toString()],p1=Object.defineProperty,g1=(n,r)=>p1(n,"name",{value:r,configurable:!0}),y1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=y1.reduce((n,r)=>{const l=er(`Primitive.${r}`),a=x.forwardRef((c,s)=>{const{asChild:u,...h}=c,g=u?l:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(g,{...h,ref:s})});return a.displayName=`Primitive.${r}`,{...n,[r]:a}},{});function np(n,r){n&&Dr.flushSync(()=>n.dispatchEvent(r))}g1(np,"dispatchDiscreteCustomEvent");var v1=Object.defineProperty,b1=(n,r)=>v1(n,"name",{value:r,configurable:!0}),rp=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"}),x1=x.forwardRef(b1(function(r,l){return f.jsx(He.span,{...r,ref:l,style:{...rp,...r.style}})},"VisuallyHidden")),S1=Object.defineProperty,yn=(n,r)=>S1(n,"name",{value:r,configurable:!0});function C1(n,r){const l=x.createContext(r);l.displayName=n+"Context";const a=yn(s=>{const{children:u,...h}=s,g=x.useMemo(()=>h,Object.values(h));return f.jsx(l.Provider,{value:g,children:u})},"Provider");a.displayName=n+"Provider";function c(s,u={}){const{optional:h=!1}=u,g=x.useContext(l);if(g)return g;if(r!==void 0)return r;if(!h)throw new Error(`\`${s}\` must be used within \`${n}\``)}return yn(c,"useContext"),[a,c]}yn(C1,"createContext");function vn(n,r=[]){let l=[];function a(s,u){const h=x.createContext(u);h.displayName=s+"Context";const g=l.length;l=[...l,u];const m=yn(v=>{const{scope:w,children:C,...y}=v,S=w?.[n]?.[g]||h,E=x.useMemo(()=>y,Object.values(y));return f.jsx(S.Provider,{value:E,children:C})},"Provider");m.displayName=s+"Provider";function b(v,w,C={}){const{optional:y=!1}=C,S=w?.[n]?.[g]||h,E=x.useContext(S);if(E)return E;if(u!==void 0)return u;if(!y)throw new Error(`\`${v}\` must be used within \`${s}\``)}return yn(b,"useContext"),[m,b]}yn(a,"createContext");const c=yn(()=>{const s=l.map(u=>x.createContext(u));return yn(function(h){const g=h?.[n]||s;return x.useMemo(()=>({[`__scope${n}`]:{...h,[n]:g}}),[h,g])},"useScope")},"createScope");return c.scopeName=n,[a,op(c,...r)]}yn(vn,"createContextScope");function op(...n){const r=n[0];if(n.length===1)return r;const l=yn(()=>{const a=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return yn(function(s){const u=a.reduce((h,{useScope:g,scopeName:m})=>{const v=g(s)[`__scope${m}`];return{...h,...v}},{});return x.useMemo(()=>({[`__scope${r.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return l.scopeName=r.scopeName,l}yn(op,"composeContextScopes");var it=globalThis?.document?x.useLayoutEffect:()=>{},w1=Object.defineProperty,Et=(n,r)=>w1(n,"name",{value:r,configurable:!0});function Ul(n){const r=n+"CollectionProvider",[l,a]=vn(r),[c,s]=l(r,{collectionRef:{current:null},itemMap:new Map}),u=Et(S=>{const{scope:E,children:R}=S,N=x.useRef(null),T=x.useRef(new Map).current;return f.jsx(c,{scope:E,itemMap:T,collectionRef:N,children:R})},"CollectionProvider");u.displayName=r;const h=n+"CollectionSlot",g=er(h),m=x.forwardRef((S,E)=>{const{scope:R,children:N}=S,T=s(h,R),O=Ie(E,T.collectionRef);return f.jsx(g,{ref:O,children:N})});m.displayName=h;const b=n+"CollectionItemSlot",v="data-radix-collection-item",w=er(b),C=x.forwardRef((S,E)=>{const{scope:R,children:N,...T}=S,O=x.useRef(null),D=Ie(E,O),M=s(b,R);return x.useEffect(()=>(M.itemMap.set(O,{ref:O,...T}),()=>void M.itemMap.delete(O))),f.jsx(w,{[v]:"",ref:D,children:N})});C.displayName=b;function y(S){const E=s(n+"CollectionConsumer",S);return x.useCallback(()=>{const N=E.collectionRef.current;if(!N)return[];const T=Array.from(N.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((M,z)=>T.indexOf(M.ref.current)-T.indexOf(z.ref.current))},[E.collectionRef,E.itemMap])}return Et(y,"useCollection"),[{Provider:u,Slot:m,ItemSlot:C},y,a]}Et(Ul,"createCollection");var ap=new WeakMap,Pl=(on=class extends Map{constructor(l){super(l);jS(this,pt);Zh(this,pt,[...super.keys()]),ap.set(this,!0)}set(l,a){return ap.get(this)&&!this.has(l)&&Ht(this,pt).push(l),super.set(l,a),this}insert(l,a,c){const s=this.has(a),u=s?this.size:this.size+1,h=Su(l),g=h>=0?Math.min(h,u-1):Math.max(u+h,0);if(s?Ht(this,pt).indexOf(a)===g:g===this.size)return this.set(a,c),this;const m=Ht(this,pt).filter(v=>v!==a);m.splice(g,0,a);const b=m.map(v=>[v,v===a?c:this.get(v)]);this.clear();for(const[v,w]of b)this.set(v,w);return this}with(l,a,c){const s=new on(this);return s.insert(l,a,c),s}before(l){const a=Ht(this,pt).indexOf(l)-1;if(!(a<0))return this.entryAt(a)}setBefore(l,a,c){const s=Ht(this,pt).indexOf(l);if(s===-1)return this;const u=Ht(this,pt).indexOf(a),h=u!==-1&&u<s?s-1:s;return this.insert(h,a,c)}after(l){let a=Ht(this,pt).indexOf(l);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(l,a,c){const s=Ht(this,pt).indexOf(l);if(s===-1)return this;const u=Ht(this,pt).indexOf(a),h=u!==-1&&u<=s?s:s+1;return this.insert(h,a,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Zh(this,pt,[]),super.clear()}delete(l){const a=super.delete(l);return a&&Ht(this,pt).splice(Ht(this,pt).indexOf(l),1),a}deleteAt(l){const a=this.keyAt(l);return a!==void 0?this.delete(a):!1}at(l){const a=$l(Ht(this,pt),l);if(a!==void 0)return this.get(a)}entryAt(l){const a=$l(Ht(this,pt),l);if(a!==void 0)return[a,this.get(a)]}indexOf(l){return Ht(this,pt).indexOf(l)}keyAt(l){return $l(Ht(this,pt),l)}from(l,a){const c=this.indexOf(l);if(c===-1)return;let s=c+a;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(l,a){const c=this.indexOf(l);if(c===-1)return;let s=c+a;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(l,a){let c=0;for(const s of this){if(Reflect.apply(l,a,[s,c,this]))return s;c++}}findIndex(l,a){let c=0;for(const s of this){if(Reflect.apply(l,a,[s,c,this]))return c;c++}return-1}filter(l,a){const c=[];let s=0;for(const u of this)Reflect.apply(l,a,[u,s,this])&&c.push(u),s++;return new on(c)}map(l,a){const c=[];let s=0;for(const u of this)c.push([u[0],Reflect.apply(l,a,[u,s,this])]),s++;return new on(c)}reduce(...l){const[a,c]=l,s=l.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=0,h=c;for(const g of this)u===0&&!s?h=g:h=Reflect.apply(a,this,[h,g,u,this]),u++;return h}reduceRight(...l){const[a,c]=l,s=l.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=c;for(let h=this.size-1;h>=0;h--){const g=this.entryAt(h);h===this.size-1&&!s?u=g:u=Reflect.apply(a,this,[u,g,h,this])}return u}sort(l){if(typeof l!="function")throw new TypeError("OrderedDict.sort requires a compare function");const a=[...this.entries()].sort(l);this.clear();for(const[c,s]of a)this.set(c,s);return this}toSorted(l){if(typeof l!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const a=[...this.entries()].sort(l);return new on(a)}toReversed(){const l=new on;for(let a=this.size-1;a>=0;a--){const c=this.keyAt(a),s=this.get(c);l.set(c,s)}return l}toSpliced(...l){const a=[...this.entries()];return a.splice(...l),new on(a)}slice(l,a){const c=new on;for(const s of Ht(this,pt).slice(l,a))c.set(s,this.get(s));return c}every(l,a){let c=0;for(const s of this){if(!Reflect.apply(l,a,[s,c,this]))return!1;c++}return!0}some(l,a){let c=0;for(const s of this){if(Reflect.apply(l,a,[s,c,this]))return!0;c++}return!1}},pt=new WeakMap,Et(on,"OrderedDict"),on);function $l(n,r){if("at"in Array.prototype)return Array.prototype.at.call(n,r);const l=ip(n,r);return l===-1?void 0:n[l]}Et($l,"at");function ip(n,r){const l=n.length,a=Su(r),c=a>=0?a:l+a;return c<0||c>=l?-1:c}Et(ip,"toSafeIndex");function Su(n){return n!==n||n===0?0:Math.trunc(n)}Et(Su,"toSafeInteger");function E1(n){const r=n+"CollectionProvider",[l,a]=vn(r),[c,s]=l(r);c.displayName=n+"CollectionStableContextProvider";const[u,h]=l(r);u.displayName=n+"CollectionStatefulContextProvider";const g=Et(({state:M,...z})=>M?f.jsx(b,{...z,state:M}):f.jsx(m,{...z}),"CollectionProvider");g.displayName=r;const m=Et(M=>{const z=N();return f.jsx(b,{...M,state:z})},"CollectionInit");m.displayName=n+"CollectionInit";const b=Et(M=>{const{scope:z,children:H,state:G}=M,X=x.useRef(null),[U,F]=x.useState(null),J=Ie(X,F),[I,Y]=G,k=x.useRef(new Pl),$=x.useCallback(()=>{const L=k.current;return cp(L)||L.sort(Gl),L},[]);return x.useEffect(()=>{if(!U)return;const L=up(()=>{Y(Z=>{const A=Z.toSorted(Gl);return A.some(([K],ee)=>Z.keyAt(ee)!==K)?A:Z})});return L.observe(U,{childList:!0,subtree:!0}),()=>{L.disconnect()}},[U,Y]),f.jsx(c,{scope:z,collectionElementRef:J,collectionElementRefObject:X,getCollection:$,setCollection:Y,registryRef:k,children:f.jsx(u,{scope:z,collectionElement:U,collection:I,children:H})})},"CollectionProviderImpl");b.displayName=n+"CollectionProviderImpl";const v=n+"CollectionSlot",w=er(v),C=x.forwardRef((M,z)=>{const{scope:H,children:G}=M,X=s(v,H),U=Ie(z,X.collectionElementRef);return f.jsx(w,{ref:U,children:G})});C.displayName=v;const y=n+"CollectionItemSlot",S="data-radix-collection-item",E=er(y),R=x.forwardRef((M,z)=>{const{scope:H,children:G,...X}=M,U=x.useRef(null),F=s(y,H),{setCollection:J,registryRef:I}=F,Y=x.useRef(X);lp(Y.current,X)||(Y.current=X);const k=Y.current,$=x.useCallback(A=>{const V=I.current;A?V.set(A,{...Y.current,element:A}):U.current&&V.delete(U.current)},[I]),L=Ie(z,$,U);it(()=>{const A=U.current,V=I.current;A&&V.has(A)&&V.set(A,{...k,element:A})},[k,I]);const Z=x.useRef(null);return x.useEffect(()=>{const A=U.current,V=Z.current;(V?.element??null)===A&&(!A||V?.itemData===k)||(Z.current=A?{element:A,itemData:k}:null,J(K=>{const ee=new Pl(K);return V&&V.element!==A&&ee.delete(V.element),A&&ee.set(A,{...k,element:A}),ee.sort(Gl)}))}),x.useEffect(()=>()=>{const A=Z.current;Z.current=null,A&&J(V=>{if(!V.has(A.element))return V;const K=new Pl(V);return K.delete(A.element),K})},[J]),f.jsx(E,{[S]:"",ref:L,children:G})});R.displayName=y;function N(){return x.useState(new Pl)}Et(N,"useInitCollection");function T(M){const{collection:z}=h(n+"CollectionConsumer",M);return z}Et(T,"useCollection");function O(M){const{getCollection:z}=s(n+"CollectionConsumer",M);return z}return Et(O,"useGetCollection"),[{Provider:g,Slot:C,ItemSlot:R},{createCollectionScope:a,useCollection:T,useGetCollection:O,useInitCollection:N}]}Et(E1,"createCollection");function lp(n,r){if(n===r)return!0;if(typeof n!="object"||typeof r!="object"||n==null||r==null)return!1;const l=Object.keys(n),a=Object.keys(r);if(l.length!==a.length)return!1;for(const c of l)if(!Object.prototype.hasOwnProperty.call(r,c)||n[c]!==r[c])return!1;return!0}Et(lp,"shallowEqual");function sp(n,r){return!!(r.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}Et(sp,"isElementPreceding");function cp(n){let r;for(const l of n.keys()){if(r){const a=r.compareDocumentPosition(l);if(!(a&Node.DOCUMENT_POSITION_DISCONNECTED)&&a&Node.DOCUMENT_POSITION_PRECEDING)return!1}r=l}return!0}Et(cp,"isInDocumentOrder");function Gl(n,r){return!n[1].element||!r[1].element?0:sp(n[1].element,r[1].element)?-1:1}Et(Gl,"sortByDocumentPosition");function up(n){return new MutationObserver(l=>{for(const a of l)if(a.type==="childList"){n();return}})}Et(up,"getChildListObserver");var T1=Object.defineProperty,ea=(n,r)=>T1(n,"name",{value:r,configurable:!0}),dp=!!(typeof window<"u"&&window.document&&window.document.createElement);function we(n,r,{checkForDefaultPrevented:l=!0}={}){return ea(function(c){if(n?.(c),l===!1||!c||!c.defaultPrevented)return r?.(c)},"handleEvent")}ea(we,"composeEventHandlers");function j1(n){if(!dp)throw new Error("Cannot access window outside of the DOM");return n?.ownerDocument?.defaultView??window}ea(j1,"getOwnerWindow");function Cu(n){if(!dp)throw new Error("Cannot access document outside of the DOM");return n?.ownerDocument??document}ea(Cu,"getOwnerDocument");function fp(n,r=!1){const{activeElement:l}=Cu(n);if(!l?.nodeName)return null;if(hp(l)&&l.contentDocument)return fp(l.contentDocument.body,r);if(r){const a=l.getAttribute("aria-activedescendant");if(a){const c=Cu(l).getElementById(a);if(c)return c}}return l}ea(fp,"getActiveElement");function hp(n){return n.tagName==="IFRAME"}ea(hp,"isFrame");var O1=Object.defineProperty,R1=(n,r)=>O1(n,"name",{value:r,configurable:!0}),mp=po[" useEffectEvent ".trim().toString()],pp=po[" useInsertionEffect ".trim().toString()];function gp(n){if(typeof mp=="function")return mp(n);const r=x.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof pp=="function"?pp(()=>{r.current=n}):it(()=>{r.current=n}),x.useMemo(()=>((...l)=>r.current?.(...l)),[])}R1(gp,"useEffectEvent");var N1=Object.defineProperty,gi=(n,r)=>N1(n,"name",{value:r,configurable:!0}),A1=po[" useInsertionEffect ".trim().toString()]||it;function tr({prop:n,defaultProp:r,onChange:l=gi(()=>{},"onChange"),caller:a}){const[c,s,u]=yp({defaultProp:r,onChange:l}),h=n!==void 0,g=h?n:c,m=x.useCallback(b=>{if(h){const v=vp(b)?b(n):b;v!==n&&u.current?.(v)}else s(b)},[h,n,s,u]);return[g,m]}gi(tr,"useControllableState");function yp({defaultProp:n,onChange:r}){const[l,a]=x.useState(n),c=x.useRef(l),s=x.useRef(r);return A1(()=>{s.current=r},[r]),x.useEffect(()=>{c.current!==l&&(s.current?.(l),c.current=l)},[l,c]),[l,a,s]}gi(yp,"useUncontrolledState");function vp(n){return typeof n=="function"}gi(vp,"isFunction");var bp=Symbol("RADIX:SYNC_STATE");function M1(n,r,l,a){const{prop:c,defaultProp:s,onChange:u,caller:h}=r,g=c!==void 0,m=gp(u),b=[{...l,state:s}];a&&b.push(a);const[v,w]=x.useReducer((E,R)=>{if(R.type===bp)return{...E,state:R.state};const N=n(E,R);return g&&!Object.is(N.state,E.state)&&m(N.state),N},...b),C=v.state,y=x.useRef(C);x.useEffect(()=>{y.current!==C&&(y.current=C,g||m(C))},[C,y,g]);const S=x.useMemo(()=>c!==void 0?{...v,state:c}:v,[v,c]);return x.useEffect(()=>{g&&!Object.is(c,v.state)&&w({type:bp,state:c})},[c,v.state,g]),[S,w]}gi(M1,"useControllableStateReducer");var _1=Object.defineProperty,nr=(n,r)=>_1(n,"name",{value:r,configurable:!0});function xp(n,r){return x.useReducer((l,a)=>r[l][a]??l,n)}nr(xp,"useStateMachine");var Lr=nr(n=>{const{present:r,children:l}=n,a=Sp(r),c=typeof l=="function"?l({present:a.isPresent}):x.Children.only(l),s=Cp(a.ref,wp(c));return typeof l=="function"||a.isPresent?x.cloneElement(c,{ref:s}):null},"Presence");function Sp(n){const[r,l]=x.useState(),a=x.useRef(null),c=x.useRef(n),s=x.useRef("none"),u=x.useRef(void 0),h=n?"mounted":"unmounted",[g,m]=xp(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{g==="mounted"?(s.current=u.current??ta(a.current),u.current=void 0):s.current="none"},[g]),it(()=>{const b=a.current,v=c.current;if(v!==n){const C=s.current,y=ta(b);n?(u.current=y,m("MOUNT")):y==="none"||b?.display==="none"?m("UNMOUNT"):m(v&&C!==y?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,m]),it(()=>{if(r){let b;const v=r.ownerDocument.defaultView??window,w=nr(y=>{const E=ta(a.current).includes(CSS.escape(y.animationName));if(y.target===r&&E&&(m("ANIMATION_END"),!c.current)){const R=r.style.animationFillMode;r.style.animationFillMode="forwards",b=v.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=R)})}},"handleAnimationEnd"),C=nr(y=>{y.target===r&&(s.current=ta(a.current))},"handleAnimationStart");return r.addEventListener("animationstart",C),r.addEventListener("animationcancel",w),r.addEventListener("animationend",w),()=>{v.clearTimeout(b),r.removeEventListener("animationstart",C),r.removeEventListener("animationcancel",w),r.removeEventListener("animationend",w)}}else m("ANIMATION_END")},[r,m]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:x.useCallback(b=>{if(b){const v=getComputedStyle(b);a.current=v,u.current=ta(v)}else a.current=null;l(b)},[])}}nr(Sp,"usePresence");function wu(n,r){if(typeof n=="function")return n(r);n!=null&&(n.current=r)}nr(wu,"setRef");function Cp(...n){const r=x.useRef(n);return r.current=n,x.useCallback(l=>{const a=r.current;let c=!1;const s=a.map(u=>{const h=wu(u,l);return!c&&typeof h=="function"&&(c=!0),h});if(c)return()=>{for(let u=0;u<s.length;u++){const h=s[u];typeof h=="function"?h():wu(a[u],null)}}},[])}nr(Cp,"useStableComposedRefs");function ta(n){return n?.animationName||"none"}nr(ta,"getAnimationName");function wp(n){let r=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,l=r&&"isReactWarning"in r&&r.isReactWarning;return l?n.ref:(r=Object.getOwnPropertyDescriptor(n,"ref")?.get,l=r&&"isReactWarning"in r&&r.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}nr(wp,"getElementRef");var D1=Object.defineProperty,I1=(n,r)=>D1(n,"name",{value:r,configurable:!0}),z1=po[" useId ".trim().toString()]||(()=>{}),L1=0;function rr(n){const[r,l]=x.useState(z1());return it(()=>{n||l(a=>a??String(L1++))},[n]),n||(r?`radix-${r}`:"")}I1(rr,"useId");var k1=Object.defineProperty,H1=(n,r)=>k1(n,"name",{value:r,configurable:!0}),B1={LTR:"ltr"},U1=x.createContext(void 0);function yi(n){const r=x.useContext(U1);return n||r||B1.LTR}H1(yi,"useDirection");var P1=Object.defineProperty,$1=(n,r)=>P1(n,"name",{value:r,configurable:!0}),Ep=po[" useInsertionEffect ".trim().toString()];function An(n){const r=x.useRef(n);return typeof Ep=="function"?Ep(()=>{r.current=n}):it(()=>{r.current=n}),x.useMemo(()=>((...l)=>r.current?.(...l)),[])}$1(An,"useCallbackRef");var G1=Object.defineProperty,Nt=(n,r)=>G1(n,"name",{value:r,configurable:!0}),Eu="dismissableLayer.update",V1="dismissableLayer.pointerDownOutside",q1="dismissableLayer.focusOutside",Tp,jp=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Tu=x.forwardRef(Nt(function(r,l){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:g,onDismiss:m,...b}=r,v=x.useContext(jp),[w,C]=x.useState(null),y=w?.ownerDocument??globalThis?.document,[,S]=x.useState({}),E=Ie(l,C),R=Array.from(v.layers),[N]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),T=N?R.indexOf(N):-1,O=w?R.indexOf(w):-1,D=v.layersWithOutsidePointerEventsDisabled.size>0,M=O>=T,z=x.useRef(!1),H=Rp(F=>{u?.(F),g?.(F),F.defaultPrevented||m?.()},{ownerDocument:y,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:z,dismissableSurfaces:v.dismissableSurfaces,shouldHandlePointerDownOutside:x.useCallback(F=>{if(!(F instanceof Node))return!1;const J=[...v.branches].some(I=>I.contains(F));return M&&!J},[v.branches,M])}),G=Np(F=>{if(c&&z.current)return;const J=F.target;[...v.branches].some(Y=>Y.contains(J))||(h?.(F),g?.(F),F.defaultPrevented||m?.())},y),X=w?O===R.length-1:!1,U=An(F=>{F.key==="Escape"&&(s?.(F),!F.defaultPrevented&&m&&(F.preventDefault(),m()))});return x.useEffect(()=>{if(X)return y.addEventListener("keydown",U,{capture:!0}),()=>y.removeEventListener("keydown",U,{capture:!0})},[y,X,U]),x.useEffect(()=>{if(w)return a&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(Tp=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(w)),v.layers.add(w),ju(),()=>{a&&(v.layersWithOutsidePointerEventsDisabled.delete(w),v.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=Tp))}},[w,y,a,v]),x.useEffect(()=>()=>{w&&(v.layers.delete(w),v.layersWithOutsidePointerEventsDisabled.delete(w),ju())},[w,v]),x.useEffect(()=>{const F=Nt(()=>S({}),"handleUpdate");return document.addEventListener(Eu,F),()=>document.removeEventListener(Eu,F)},[]),f.jsx(He.div,{...b,ref:E,style:{pointerEvents:D?M?"auto":"none":void 0,...r.style},onFocusCapture:we(r.onFocusCapture,G.onFocusCapture),onBlurCapture:we(r.onBlurCapture,G.onBlurCapture),onPointerDownCapture:we(r.onPointerDownCapture,H.onPointerDownCapture)})},"DismissableLayer"));function Op(){const n=x.useContext(jp),[r,l]=x.useState(null);return x.useEffect(()=>{if(r)return n.dismissableSurfaces.add(r),()=>{n.dismissableSurfaces.delete(r)}},[r,n.dismissableSurfaces]),l}Nt(Op,"useDismissableLayerSurface");var Y1=Nt(()=>!0,"IS_TRUE");function Rp(n,r){const{ownerDocument:l=globalThis?.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:s,shouldHandlePointerDownOutside:u=Y1}=r,h=An(n),g=x.useRef(!1),m=x.useRef(!1),b=x.useRef(new Map),v=x.useRef(()=>{});return x.useEffect(()=>{function w(){m.current=!1,c.current=!1,b.current.clear()}Nt(w,"resetOutsideInteraction");function C(){return Array.from(b.current.values()).some(Boolean)}Nt(C,"isOutsideInteractionIntercepted");function y(T){if(!m.current)return;const O=T.target;O instanceof Node&&[...s].some(M=>M.contains(O))||b.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{m.current&&v.current()},0)}Nt(y,"handleInteractionCapture");function S(T){m.current&&b.current.set(T.type,!1)}Nt(S,"handleInteractionBubble");const E=Nt(T=>{if(T.target&&!g.current){let O=function(){l.removeEventListener("click",v.current);const M=C();w(),M||Ou(V1,h,D,{discrete:!0})};if(Nt(O,"handleAndDispatchPointerDownOutsideEvent"),!u(T.target)){l.removeEventListener("click",v.current),w(),g.current=!1;return}const D={originalEvent:T};m.current=!0,c.current=a&&T.button===0,b.current.clear(),!a||T.button!==0?O():(l.removeEventListener("click",v.current),v.current=O,l.addEventListener("click",v.current,{once:!0}))}else l.removeEventListener("click",v.current),w();g.current=!1},"handlePointerDown"),R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of R)l.addEventListener(T,y,!0),l.addEventListener(T,S);const N=window.setTimeout(()=>{l.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(N),l.removeEventListener("pointerdown",E),l.removeEventListener("click",v.current);for(const T of R)l.removeEventListener(T,y,!0),l.removeEventListener(T,S)}},[l,h,a,c,s,u]),{onPointerDownCapture:Nt(()=>g.current=!0,"onPointerDownCapture")}}Nt(Rp,"usePointerDownOutside");function Np(n,r=globalThis?.document){const l=An(n),a=x.useRef(!1);return x.useEffect(()=>{const c=Nt(s=>{s.target&&!a.current&&Ou(q1,l,{originalEvent:s},{discrete:!1})},"handleFocus");return r.addEventListener("focusin",c),()=>r.removeEventListener("focusin",c)},[r,l]),{onFocusCapture:Nt(()=>a.current=!0,"onFocusCapture"),onBlurCapture:Nt(()=>a.current=!1,"onBlurCapture")}}Nt(Np,"useFocusOutside");function ju(){const n=new CustomEvent(Eu);document.dispatchEvent(n)}Nt(ju,"dispatchUpdate");function Ou(n,r,l,{discrete:a}){const c=l.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});r&&c.addEventListener(n,r,{once:!0}),a?np(c,s):c.dispatchEvent(s)}Nt(Ou,"handleAndDispatchCustomEvent");var X1=Object.defineProperty,vt=(n,r)=>X1(n,"name",{value:r,configurable:!0}),Ru="focusScope.autoFocusOnMount",Nu="focusScope.autoFocusOnUnmount",Ap={bubbles:!1,cancelable:!0},Mp=x.forwardRef(vt(function(r,l){const{loop:a=!1,trapped:c=!1,branches:s,onMountAutoFocus:u,onUnmountAutoFocus:h,...g}=r,[m,b]=x.useState(null),v=An(u),w=An(h),C=x.useRef(null),y=Ie(l,b),S=x.useRef(s);x.useEffect(()=>{S.current=s});const E=x.useCallback(T=>T?m?.contains(T)?!0:!!S.current?.some(O=>O.contains(T)):!1,[m]),R=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(c){let T=function(z){if(R.paused||!m)return;const H=z.target;E(H)?C.current=H:or(C.current,{select:!0})},O=function(z){if(R.paused||!m)return;const H=z.relatedTarget;H!==null&&(E(H)||or(C.current,{select:!0}))},D=function(z){if(document.activeElement===document.body)for(const G of z)G.removedNodes.length>0&&or(m)};vt(T,"handleFocusIn"),vt(O,"handleFocusOut"),vt(D,"handleMutations"),document.addEventListener("focusin",T),document.addEventListener("focusout",O);const M=new MutationObserver(D);return m&&M.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",O),M.disconnect()}}},[c,m,R.paused,E]),x.useEffect(()=>{if(m){Up.add(R);const T=document.activeElement;if(!m.contains(T)){const D=new CustomEvent(Ru,Ap);m.addEventListener(Ru,v),m.dispatchEvent(D),D.defaultPrevented||(Lp($p(Au(m)),{select:!0}),document.activeElement===T&&or(m))}return()=>{m.removeEventListener(Ru,v);const D=m.ownerDocument,M=CustomEvent;setTimeout(()=>{const z=new M(Nu,Ap);m.addEventListener(Nu,w),m.dispatchEvent(z),z.defaultPrevented||or(T??D.body,{select:!0}),m.removeEventListener(Nu,w),Up.remove(R)},0)}}},[m,v,w,R]);const N=x.useCallback(T=>{if(!a&&!c||R.paused)return;const O=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,D=document.activeElement;if(O&&D){const M=T.currentTarget,[z,H]=kp(M);z&&H?!T.shiftKey&&D===H?(T.preventDefault(),a&&or(z,{select:!0})):T.shiftKey&&D===z&&(T.preventDefault(),a&&or(H,{select:!0})):D===M&&T.preventDefault()}},[a,c,R.paused]);return f.jsx(He.div,{tabIndex:-1,...g,ref:y,onKeyDown:N})},"FocusScope")),_p=x.createContext(null);function Dp({registry:n,children:r}){return n?f.jsx(_p.Provider,{value:n,children:r}):r}vt(Dp,"FocusScopeBranchProvider");function Ip(){const[n,r]=x.useState([]),l=x.useMemo(()=>({add:vt(a=>r(c=>c.includes(a)?c:[...c,a]),"add"),remove:vt(a=>r(c=>c.filter(s=>s!==a)),"remove")}),[]);return{nodes:n,registry:l}}vt(Ip,"useFocusScopeBranchRegistry");function zp(n){const r=x.useContext(_p);x.useEffect(()=>{if(!(!n||!r))return r.add(n),()=>r.remove(n)},[n,r])}vt(zp,"useFocusScopeBranch");function Lp(n,{select:r=!1}={}){const l=document.activeElement;for(const a of n)if(or(a,{select:r}),document.activeElement!==l)return}vt(Lp,"focusFirst");function kp(n){const r=Au(n),l=Mu(r,n),a=Mu(r.reverse(),n);return[l,a]}vt(kp,"getTabbableEdges");function Au(n){const r=[],a=n.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:vt(c=>{const s=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||s?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)r.push(a.currentNode);return r}vt(Au,"getTabbableCandidates");function Mu(n,r){const l=typeof r.checkVisibility=="function"&&r.checkVisibility({checkVisibilityCSS:!0});for(const a of n)if(!(l?!a.checkVisibility({checkVisibilityCSS:!0}):Hp(a,{upTo:r})))return a}vt(Mu,"findVisible");function Hp(n,{upTo:r}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(r!==void 0&&n===r)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}vt(Hp,"isHidden");function Bp(n){return n.tagName==="INPUT"&&typeof n.select=="function"}vt(Bp,"isSelectableInput");function or(n,{select:r=!1}={}){if(n&&n.focus){const a=(n.ownerDocument??document).activeElement;n.focus({preventScroll:!0}),n!==a&&Bp(n)&&r&&n.select()}}vt(or,"focus");var Up=Pp();function Pp(){let n=[];return{add(r){const l=n[0];r!==l&&l?.pause(),n=_u(n,r),n.unshift(r)},remove(r){n=_u(n,r),n[0]?.resume()}}}vt(Pp,"createFocusScopesStack");function _u(n,r){const l=[...n],a=l.indexOf(r);return a!==-1&&l.splice(a,1),l}vt(_u,"arrayRemove");function $p(n){return n.filter(r=>r.tagName!=="A")}vt($p,"removeLinks");var K1=Object.defineProperty,F1=(n,r)=>K1(n,"name",{value:r,configurable:!0}),Du=x.forwardRef(F1(function(r,l){const{container:a,...c}=r,[s,u]=x.useState(!1);it(()=>u(!0),[]);const h=a||s&&globalThis?.document?.body;return h?Dr.createPortal(f.jsx(He.div,{...c,ref:l}),h):null},"Portal")),Q1=Object.defineProperty,Iu=(n,r)=>Q1(n,"name",{value:r,configurable:!0}),Vl=0,na=null;function Z1(n){return ql(),n.children}Iu(Z1,"FocusGuards");function ql(){x.useEffect(()=>{na||(na={start:zu(),end:zu()});const{start:n,end:r}=na;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==r&&document.body.insertAdjacentElement("beforeend",r),Vl++,()=>{Vl===1&&(na?.start.remove(),na?.end.remove(),na=null),Vl=Math.max(0,Vl-1)}},[])}Iu(ql,"useFocusGuards");function zu(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}Iu(zu,"createFocusGuard");var $n=function(){return $n=Object.assign||function(r){for(var l,a=1,c=arguments.length;a<c;a++){l=arguments[a];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(r[s]=l[s])}return r},$n.apply(this,arguments)};function Gp(n,r){var l={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&r.indexOf(a)<0&&(l[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)r.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(l[a[c]]=n[a[c]]);return l}function W1(n,r,l){if(l||arguments.length===2)for(var a=0,c=r.length,s;a<c;a++)(s||!(a in r))&&(s||(s=Array.prototype.slice.call(r,0,a)),s[a]=r[a]);return n.concat(s||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;var Yl="right-scroll-bar-position",Xl="width-before-scroll-bar",J1="with-scroll-bars-hidden",ew="--removed-body-scroll-bar-size";function Lu(n,r){return typeof n=="function"?n(r):n&&(n.current=r),n}function tw(n,r){var l=x.useState(function(){return{value:n,callback:r,facade:{get current(){return l.value},set current(a){var c=l.value;c!==a&&(l.value=a,l.callback(a,c))}}}})[0];return l.callback=r,l.facade}var nw=typeof window<"u"?x.useLayoutEffect:x.useEffect,Vp=new WeakMap;function rw(n,r){var l=tw(null,function(a){return n.forEach(function(c){return Lu(c,a)})});return nw(function(){var a=Vp.get(l);if(a){var c=new Set(a),s=new Set(n),u=l.current;c.forEach(function(h){s.has(h)||Lu(h,null)}),s.forEach(function(h){c.has(h)||Lu(h,u)})}Vp.set(l,n)},[n]),l}function ow(n){return n}function aw(n,r){r===void 0&&(r=ow);var l=[],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 l.length?l[l.length-1]:n},useMedium:function(s){var u=r(s,a);return l.push(u),function(){l=l.filter(function(h){return h!==u})}},assignSyncMedium:function(s){for(a=!0;l.length;){var u=l;l=[],u.forEach(s)}l={push:function(h){return s(h)},filter:function(){return l}}},assignMedium:function(s){a=!0;var u=[];if(l.length){var h=l;l=[],h.forEach(s),u=l}var g=function(){var b=u;u=[],b.forEach(s)},m=function(){return Promise.resolve().then(g)};m(),l={push:function(b){u.push(b),m()},filter:function(b){return u=u.filter(b),l}}}};return c}function iw(n){n===void 0&&(n={});var r=aw(null);return r.options=$n({async:!0,ssr:!1},n),r}var qp=function(n){var r=n.sideCar,l=Gp(n,["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 x.createElement(a,$n({},l))};qp.isSideCarExport=!0;function lw(n,r){return n.useMedium(r),qp}var Yp=iw(),ku=function(){},Kl=x.forwardRef(function(n,r){var l=x.useRef(null),a=x.useState({onScrollCapture:ku,onWheelCapture:ku,onTouchMoveCapture:ku}),c=a[0],s=a[1],u=n.forwardProps,h=n.children,g=n.className,m=n.removeScrollBar,b=n.enabled,v=n.shards,w=n.sideCar,C=n.noRelative,y=n.noIsolation,S=n.inert,E=n.allowPinchZoom,R=n.as,N=R===void 0?"div":R,T=n.gapMode,O=Gp(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=w,M=rw([l,r]),z=$n($n({},O),c);return x.createElement(x.Fragment,null,b&&x.createElement(D,{sideCar:Yp,removeScrollBar:m,shards:v,noRelative:C,noIsolation:y,inert:S,setCallbacks:s,allowPinchZoom:!!E,lockRef:l,gapMode:T}),u?x.cloneElement(x.Children.only(h),$n($n({},z),{ref:M})):x.createElement(N,$n({},z,{className:g,ref:M}),h))});Kl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Kl.classNames={fullWidth:Xl,zeroRight:Yl};var sw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cw(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var r=sw();return r&&n.setAttribute("nonce",r),n}function uw(n,r){n.styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r))}function dw(n){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(n)}var fw=function(){var n=0,r=null;return{add:function(l){n==0&&(r=cw())&&(uw(r,l),dw(r)),n++},remove:function(){n--,!n&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},hw=function(){var n=fw();return function(r,l){x.useEffect(function(){return n.add(r),function(){n.remove()}},[r&&l])}},Xp=function(){var n=hw(),r=function(l){var a=l.styles,c=l.dynamic;return n(a,c),null};return r},mw={left:0,top:0,right:0,gap:0},Hu=function(n){return parseInt(n||"",10)||0},pw=function(n){var r=window.getComputedStyle(document.body),l=r[n==="padding"?"paddingLeft":"marginLeft"],a=r[n==="padding"?"paddingTop":"marginTop"],c=r[n==="padding"?"paddingRight":"marginRight"];return[Hu(l),Hu(a),Hu(c)]},gw=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return mw;var r=pw(n),l=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-l+r[2]-r[0])}},yw=Xp(),ra="data-scroll-locked",vw=function(n,r,l,a){var c=n.left,s=n.top,u=n.right,h=n.gap;return l===void 0&&(l="margin"),`
50
- .`.concat(J1,` {
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,` {
51
53
  overflow: hidden `).concat(a,`;
52
- padding-right: `).concat(h,"px ").concat(a,`;
54
+ padding-right: `).concat(d,"px ").concat(a,`;
53
55
  }
54
- body[`).concat(ra,`] {
56
+ body[`).concat(ha,`] {
55
57
  overflow: hidden `).concat(a,`;
56
58
  overscroll-behavior: contain;
57
- `).concat([r&&"position: relative ".concat(a,";"),l==="margin"&&`
59
+ `).concat([r&&"position: relative ".concat(a,";"),i==="margin"&&`
58
60
  padding-left: `.concat(c,`px;
59
- padding-top: `).concat(s,`px;
61
+ padding-top: `).concat(l,`px;
60
62
  padding-right: `).concat(u,`px;
61
63
  margin-left:0;
62
64
  margin-top:0;
63
- margin-right: `).concat(h,"px ").concat(a,`;
64
- `),l==="padding"&&"padding-right: ".concat(h,"px ").concat(a,";")].filter(Boolean).join(""),`
65
+ margin-right: `).concat(d,"px ").concat(a,`;
66
+ `),i==="padding"&&"padding-right: ".concat(d,"px ").concat(a,";")].filter(Boolean).join(""),`
65
67
  }
66
68
 
67
- .`).concat(Yl,` {
68
- right: `).concat(h,"px ").concat(a,`;
69
+ .`).concat(rl,` {
70
+ right: `).concat(d,"px ").concat(a,`;
69
71
  }
70
72
 
71
- .`).concat(Xl,` {
72
- margin-right: `).concat(h,"px ").concat(a,`;
73
+ .`).concat(ol,` {
74
+ margin-right: `).concat(d,"px ").concat(a,`;
73
75
  }
74
76
 
75
- .`).concat(Yl," .").concat(Yl,` {
77
+ .`).concat(rl," .").concat(rl,` {
76
78
  right: 0 `).concat(a,`;
77
79
  }
78
80
 
79
- .`).concat(Xl," .").concat(Xl,` {
81
+ .`).concat(ol," .").concat(ol,` {
80
82
  margin-right: 0 `).concat(a,`;
81
83
  }
82
84
 
83
- body[`).concat(ra,`] {
84
- `).concat(ew,": ").concat(h,`px;
85
+ body[`).concat(ha,`] {
86
+ `).concat(Iw,": ").concat(d,`px;
85
87
  }
86
- `)},Kp=function(){var n=parseInt(document.body.getAttribute(ra)||"0",10);return isFinite(n)?n:0},bw=function(){x.useEffect(function(){return document.body.setAttribute(ra,(Kp()+1).toString()),function(){var n=Kp()-1;n<=0?document.body.removeAttribute(ra):document.body.setAttribute(ra,n.toString())}},[])},xw=function(n){var r=n.noRelative,l=n.noImportant,a=n.gapMode,c=a===void 0?"margin":a;bw();var s=x.useMemo(function(){return gw(c)},[c]);return x.createElement(yw,{styles:vw(s,!r,c,l?"":"!important")})},Bu=!1;if(typeof window<"u")try{var Fl=Object.defineProperty({},"passive",{get:function(){return Bu=!0,!0}});window.addEventListener("test",Fl,Fl),window.removeEventListener("test",Fl,Fl)}catch{Bu=!1}var oa=Bu?{passive:!1}:!1,Sw=function(n){return n.tagName==="TEXTAREA"},Fp=function(n,r){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[r]!=="hidden"&&!(l.overflowY===l.overflowX&&!Sw(n)&&l[r]==="visible")},Cw=function(n){return Fp(n,"overflowY")},ww=function(n){return Fp(n,"overflowX")},Qp=function(n,r){var l=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var c=Zp(n,a);if(c){var s=Wp(n,a),u=s[1],h=s[2];if(u>h)return!0}a=a.parentNode}while(a&&a!==l.body);return!1},Ew=function(n){var r=n.scrollTop,l=n.scrollHeight,a=n.clientHeight;return[r,l,a]},Tw=function(n){var r=n.scrollLeft,l=n.scrollWidth,a=n.clientWidth;return[r,l,a]},Zp=function(n,r){return n==="v"?Cw(r):ww(r)},Wp=function(n,r){return n==="v"?Ew(r):Tw(r)},jw=function(n,r){return n==="h"&&r==="rtl"?-1:1},Ow=function(n,r,l,a,c){var s=jw(n,window.getComputedStyle(r).direction),u=s*a,h=l.target,g=r.contains(h),m=!1,b=u>0,v=0,w=0;do{if(!h)break;var C=Wp(n,h),y=C[0],S=C[1],E=C[2],R=S-E-s*y;(y||R)&&Zp(n,h)&&(v+=R,w+=y);var N=h.parentNode;h=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!g&&h!==document.body||g&&(r.contains(h)||r===h));return(b&&Math.abs(v)<1||!b&&Math.abs(w)<1)&&(m=!0),m},Ql=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Jp=function(n){return[n.deltaX,n.deltaY]},eg=function(n){return n&&"current"in n?n.current:n},Rw=function(n,r){return n[0]===r[0]&&n[1]===r[1]},Nw=function(n){return`
87
- .block-interactivity-`.concat(n,` {pointer-events: none;}
88
- .allow-interactivity-`).concat(n,` {pointer-events: all;}
89
- `)},Aw=0,aa=[];function Mw(n){var r=x.useRef([]),l=x.useRef([0,0]),a=x.useRef(),c=x.useState(Aw++)[0],s=x.useState(Xp)[0],u=x.useRef(n);x.useEffect(function(){u.current=n},[n]),x.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var S=W1([n.lockRef.current],(n.shards||[]).map(eg),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var h=x.useCallback(function(S,E){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var R=Ql(S),N=l.current,T="deltaX"in S?S.deltaX:N[0]-R[0],O="deltaY"in S?S.deltaY:N[1]-R[1],D,M=S.target,z=Math.abs(T)>Math.abs(O)?"h":"v";if("touches"in S&&z==="h"&&M.type==="range")return!1;var H=window.getSelection(),G=H&&H.anchorNode,X=G?G===M||G.contains(M):!1;if(X)return!1;var U=Qp(z,M);if(!U)return!0;if(U?D=z:(D=z==="v"?"h":"v",U=Qp(z,M)),!U)return!1;if(!a.current&&"changedTouches"in S&&(T||O)&&(a.current=D),!D)return!0;var F=a.current||D;return Ow(F,E,S,F==="h"?T:O)},[]),g=x.useCallback(function(S){var E=S;if(!(!aa.length||aa[aa.length-1]!==s)){var R="deltaY"in E?Jp(E):Ql(E),N=r.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&Rw(D.delta,R)})[0];if(N&&N.should){E.cancelable&&E.preventDefault();return}if(!N){var T=(u.current.shards||[]).map(eg).filter(Boolean).filter(function(D){return D.contains(E.target)}),O=T.length>0?h(E,T[0]):!u.current.noIsolation;O&&E.cancelable&&E.preventDefault()}}},[]),m=x.useCallback(function(S,E,R,N){var T={name:S,delta:E,target:R,should:N,shadowParent:_w(R)};r.current.push(T),setTimeout(function(){r.current=r.current.filter(function(O){return O!==T})},1)},[]),b=x.useCallback(function(S){l.current=Ql(S),a.current=void 0},[]),v=x.useCallback(function(S){m(S.type,Jp(S),S.target,h(S,n.lockRef.current))},[]),w=x.useCallback(function(S){m(S.type,Ql(S),S.target,h(S,n.lockRef.current))},[]);x.useEffect(function(){return aa.push(s),n.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:w}),document.addEventListener("wheel",g,oa),document.addEventListener("touchmove",g,oa),document.addEventListener("touchstart",b,oa),function(){aa=aa.filter(function(S){return S!==s}),document.removeEventListener("wheel",g,oa),document.removeEventListener("touchmove",g,oa),document.removeEventListener("touchstart",b,oa)}},[]);var C=n.removeScrollBar,y=n.inert;return x.createElement(x.Fragment,null,y?x.createElement(s,{styles:Nw(c)}):null,C?x.createElement(xw,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function _w(n){for(var r=null;n!==null;)n instanceof ShadowRoot&&(r=n.host,n=n.host),n=n.parentNode;return r}const Dw=lw(Yp,Mw);var Uu=x.forwardRef(function(n,r){return x.createElement(Kl,$n({},n,{ref:r,sideCar:Dw}))});Uu.classNames=Kl.classNames;var Iw=function(n){if(typeof document>"u")return null;var r=Array.isArray(n)?n[0]:n;return r.ownerDocument.body},ia=new WeakMap,Zl=new WeakMap,Wl={},Pu=0,tg=function(n){return n&&(n.host||tg(n.parentNode))},zw=function(n,r){return r.map(function(l){if(n.contains(l))return l;var a=tg(l);return a&&n.contains(a)?a:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},Lw=function(n,r,l,a){var c=zw(r,Array.isArray(n)?n:[n]);Wl[l]||(Wl[l]=new WeakMap);var s=Wl[l],u=[],h=new Set,g=new Set(c),m=function(v){!v||h.has(v)||(h.add(v),m(v.parentNode))};c.forEach(m);var b=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(w){if(h.has(w))b(w);else try{var C=w.getAttribute(a),y=C!==null&&C!=="false",S=(ia.get(w)||0)+1,E=(s.get(w)||0)+1;ia.set(w,S),s.set(w,E),u.push(w),S===1&&y&&Zl.set(w,!0),E===1&&w.setAttribute(l,"true"),y||w.setAttribute(a,"true")}catch(R){console.error("aria-hidden: cannot operate on ",w,R)}})};return b(r),h.clear(),Pu++,function(){u.forEach(function(v){var w=ia.get(v)-1,C=s.get(v)-1;ia.set(v,w),s.set(v,C),w||(Zl.has(v)||v.removeAttribute(a),Zl.delete(v)),C||v.removeAttribute(l)}),Pu--,Pu||(ia=new WeakMap,ia=new WeakMap,Zl=new WeakMap,Wl={})}},ng=function(n,r,l){l===void 0&&(l="data-aria-hidden");var a=Array.from(Array.isArray(n)?n:[n]),c=Iw(n);return c?(a.push.apply(a,Array.from(c.querySelectorAll("[aria-live], script"))),Lw(a,c,l,"aria-hidden")):function(){return null}},kw=Object.defineProperty,bn=(n,r)=>kw(n,"name",{value:r,configurable:!0}),$u="Dialog",[rg,PM]=vn($u),[Hw,ar]=rg($u),Bw=bn(n=>{const{__scopeDialog:r,children:l,open:a,defaultOpen:c,onOpenChange:s,modal:u=!0}=n,h=x.useRef(null),g=x.useRef(null),{nodes:m,registry:b}=Ip(),[v,w]=tr({prop:a,defaultProp:c??!1,onChange:s,caller:$u}),[C,y]=x.useState(0),[S,E]=x.useState(0);return f.jsx(Hw,{scope:r,triggerRef:h,contentRef:g,contentId:rr(),titleId:rr(),descriptionId:rr(),titlePresent:C>0,descriptionPresent:S>0,setTitleCount:y,setDescriptionCount:E,open:v,onOpenChange:w,onOpenToggle:x.useCallback(()=>w(R=>!R),[w]),modal:u,branchNodes:m,branchRegistry:b,children:l})},"Dialog"),og="DialogPortal",[Uw,ag]=rg(og,{forceMount:void 0}),Pw=bn(n=>{const{__scopeDialog:r,forceMount:l,children:a,container:c}=n,s=ar(og,r);return f.jsx(Uw,{scope:r,forceMount:l,children:x.Children.map(a,u=>f.jsx(Lr,{present:l||s.open,children:f.jsx(Du,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),Gu="DialogOverlay",$w=x.forwardRef(bn(function(r,l){const a=ag(Gu,r.__scopeDialog),{forceMount:c=a.forceMount,...s}=r,u=ar(Gu,r.__scopeDialog);return u.modal?f.jsx(Lr,{present:c||u.open,children:f.jsx(Vw,{...s,ref:l})}):null},"DialogOverlay")),Gw=er("DialogOverlay.RemoveScroll"),Vw=x.forwardRef(bn(function(r,l){const{__scopeDialog:a,...c}=r,s=ar(Gu,a),u=Op(),h=Ie(l,u);return f.jsx(Uu,{as:Gw,allowPinchZoom:!0,shards:x.useMemo(()=>[s.contentRef,...s.branchNodes.map(g=>({current:g}))],[s.contentRef,s.branchNodes]),children:f.jsx(He.div,{"data-state":qu(s.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),vi="DialogContent",qw=x.forwardRef(bn(function(r,l){const a=ag(vi,r.__scopeDialog),{forceMount:c=a.forceMount,...s}=r,u=ar(vi,r.__scopeDialog);return f.jsx(Lr,{present:c||u.open,children:u.modal?f.jsx(Yw,{...s,ref:l}):f.jsx(Xw,{...s,ref:l})})},"DialogContent")),Yw=x.forwardRef(bn(function(r,l){const a=ar(vi,r.__scopeDialog),c=x.useRef(null),s=Ie(l,a.contentRef,c);return x.useEffect(()=>{const u=c.current;if(u)return ng(u)},[]),f.jsx(ig,{...r,ref:s,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:we(r.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:we(r.onPointerDownOutside,u=>{const h=u.detail.originalEvent,g=h.button===0&&h.ctrlKey===!0;(h.button===2||g)&&u.preventDefault()}),onFocusOutside:we(r.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),Xw=x.forwardRef(bn(function(r,l){const a=ar(vi,r.__scopeDialog),c=x.useRef(!1),s=x.useRef(!1);return f.jsx(ig,{...r,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{r.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||a.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,s.current=!1},onInteractOutside:u=>{r.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const h=u.target;a.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&s.current&&u.preventDefault()}})},"DialogContentNonModal")),ig=x.forwardRef(bn(function(r,l){const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:s,onCloseAutoFocus:u,"aria-describedby":h,children:g,...m}=r,b=ar(vi,a);return ql(),f.jsx(Dp,{registry:b.branchRegistry,children:f.jsx(Mp,{asChild:!0,loop:!0,trapped:c,branches:b.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:u,children:f.jsx(Tu,{role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?lg(h,b.descriptionId):h,"data-state":qu(b.open),...m,ref:l,deferPointerDownOutside:!0,onDismiss:()=>b.onOpenChange(!1),children:g})})})},"DialogContentImpl")),Kw=x.forwardRef(bn(function(r,l){const{__scopeDialog:a,...c}=r,s=ar("DialogTitle",a),{setTitleCount:u}=s;return it(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),f.jsx(He.h2,{id:s.titleId,...c,ref:l})},"DialogTitle")),Fw="DialogClose",Vu=x.forwardRef(bn(function(r,l){const{__scopeDialog:a,...c}=r,s=ar(Fw,a);return f.jsx(He.button,{type:"button",...c,ref:l,onClick:we(r.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function lg(...n){const r=new Set;for(const l of n)if(typeof l=="string")for(const a of String(l).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}bn(lg,"concatAriaDescribedby");function qu(n){return n?"open":"closed"}bn(qu,"getState");var Qw=Object.defineProperty,Zw=(n,r)=>Qw(n,"name",{value:r,configurable:!0});function bi(n){const[r,l]=x.useState(void 0);return it(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});let a=0;const c=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const u=s[0];window.cancelAnimationFrame(a),a=window.requestAnimationFrame(()=>{let h,g;if("borderBoxSize"in u){const m=u.borderBoxSize,b=Array.isArray(m)?m[0]:m;h=b.inlineSize,g=b.blockSize}else h=n.offsetWidth,g=n.offsetHeight;l({width:h,height:g})})});return c.observe(n,{box:"border-box"}),()=>{window.cancelAnimationFrame(a),c.unobserve(n)}}else l(void 0)},[n]),r}Zw(bi,"useSize");var Ww=Object.defineProperty,ir=(n,r)=>Ww(n,"name",{value:r,configurable:!0}),Yu="Checkbox",[Jw,$M]=vn(Yu),[eE,Xu]=Jw(Yu);function sg(n){const{__scopeCheckbox:r,checked:l,children:a,defaultChecked:c,disabled:s,form:u,name:h,onCheckedChange:g,required:m,value:b="on",internal_do_not_use_render:v}=n,[w,C]=tr({prop:l,defaultProp:c??!1,onChange:g,caller:Yu}),[y,S]=x.useState(null),[E,R]=x.useState(null),[N,T]=x.useState(null),O=y?!!u||!!y.closest("form"):!0,D={checked:w,disabled:s,setChecked:C,control:y,setControl:S,name:h,form:u,value:b,userClick:N,onUserClick:T,required:m,defaultChecked:xn(c)?!1:c,isFormControl:O,bubbleInput:E,setBubbleInput:R};return f.jsx(eE,{scope:r,...D,children:cg(v)?v(D):a})}ir(sg,"CheckboxProvider");var tE="CheckboxTrigger",nE=x.forwardRef(ir(function({__scopeCheckbox:r,onKeyDown:l,onClick:a,...c},s){const{control:u,value:h,disabled:g,checked:m,required:b,setControl:v,setChecked:w,onUserClick:C,isFormControl:y,bubbleInput:S}=Xu(tE,r),E=Ie(s,v),R=x.useRef(m);return x.useEffect(()=>{const N=u?.form;if(N){const T=ir(()=>w(R.current),"reset");return N.addEventListener("reset",T),()=>N.removeEventListener("reset",T)}},[u,w]),f.jsx(He.button,{type:"button",role:"checkbox","aria-checked":xn(m)?"mixed":m,"aria-required":b,"data-state":Ku(m),"data-disabled":g?"":void 0,disabled:g,value:h,...c,ref:E,onKeyDown:we(l,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:we(a,N=>{const T=N.isPropagationStopped();C({requestedChecked:xn(m)?!0:!m,hasConsumerStoppedPropagation:T}),w(O=>xn(O)?!0:!O),S&&y&&(T||N.stopPropagation())})})},"CheckboxTrigger")),rE=x.forwardRef(ir(function(r,l){const{__scopeCheckbox:a,name:c,checked:s,defaultChecked:u,required:h,disabled:g,value:m,onCheckedChange:b,form:v,...w}=r;return f.jsx(sg,{__scopeCheckbox:a,checked:s,defaultChecked:u,disabled:g,required:h,onCheckedChange:b,name:c,form:v,value:m,internal_do_not_use_render:({isFormControl:C})=>f.jsxs(f.Fragment,{children:[f.jsx(nE,{...w,ref:l,__scopeCheckbox:a}),C&&f.jsx(lE,{__scopeCheckbox:a})]})})},"Checkbox")),oE="CheckboxIndicator",aE=x.forwardRef(ir(function(r,l){const{__scopeCheckbox:a,forceMount:c,...s}=r,u=Xu(oE,a);return f.jsx(Lr,{present:c||xn(u.checked)||u.checked===!0,children:f.jsx(He.span,{"data-state":Ku(u.checked),"data-disabled":u.disabled?"":void 0,...s,ref:l,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),iE="CheckboxBubbleInput",lE=x.forwardRef(ir(function({__scopeCheckbox:r,onClick:l,...a},c){const{control:s,userClick:u,checked:h,defaultChecked:g,required:m,disabled:b,name:v,value:w,form:C,bubbleInput:y,setBubbleInput:S}=Xu(iE,r),E=Ie(c,S),R=bi(s),N=x.useRef(!1),T=x.useRef(h),O=x.useRef(u),D=x.useRef(null);x.useEffect(()=>{const z=y;if(!z)return;const H=window.HTMLInputElement.prototype,X=Object.getOwnPropertyDescriptor(H,"checked").set;if(!X)return;const U=T.current!==h;T.current=h;const F=u!==null&&u!==O.current;if(O.current=u,F)D.current=U?null:u,U&&(z.indeterminate=xn(h),X.call(z,xn(h)?!1:h)),z.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(U){const J=D.current;D.current=null;const I=J?.requestedChecked===h;N.current=!0,z.indeterminate=xn(h),X.call(z,xn(h)?!1:h),z.dispatchEvent(new Event("click",{bubbles:!(I&&J.hasConsumerStoppedPropagation)})),N.current=!1}},[y,h,u]);const M=x.useRef(xn(h)?!1:h);return f.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??M.current,required:m,disabled:b,name:v,value:w,form:C,...a,tabIndex:-1,ref:E,onClick:we(l,z=>{N.current&&z.stopPropagation()}),style:{...a.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function cg(n){return typeof n=="function"}ir(cg,"isFunction");function xn(n){return n==="indeterminate"}ir(xn,"isIndeterminate");function Ku(n){return xn(n)?"indeterminate":n?"checked":"unchecked"}ir(Ku,"getState");const sE=["top","right","bottom","left"],kr=Math.min,lr=Math.max,Jl=Math.round,es=Math.floor,sr=n=>({x:n,y:n}),cE={left:"right",right:"left",bottom:"top",top:"bottom"};function ug(n,r,l){return lr(n,kr(r,l))}function cr(n,r){return typeof n=="function"?n(r):n}function Hr(n){return n.split("-")[0]}function la(n){return n.split("-")[1]}function Fu(n){return n==="x"?"y":"x"}function Qu(n){return n==="y"?"height":"width"}function Gn(n){const r=n[0];return r==="t"||r==="b"?"y":"x"}function Zu(n){return Fu(Gn(n))}function uE(n,r,l){l===void 0&&(l=!1);const a=la(n),c=Zu(n),s=Qu(c);let u=c==="x"?a===(l?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[s]>r.floating[s]&&(u=ts(u)),[u,ts(u)]}function dE(n){const r=ts(n);return[Wu(n),r,Wu(r)]}function Wu(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const dg=["left","right"],fg=["right","left"],fE=["top","bottom"],hE=["bottom","top"];function mE(n,r,l){switch(n){case"top":case"bottom":return l?r?fg:dg:r?dg:fg;case"left":case"right":return r?fE:hE;default:return[]}}function pE(n,r,l,a){const c=la(n);let s=mE(Hr(n),l==="start",a);return c&&(s=s.map(u=>u+"-"+c),r&&(s=s.concat(s.map(Wu)))),s}function ts(n){const r=Hr(n);return cE[r]+n.slice(r.length)}function gE(n){var r,l,a,c;return{top:(r=n.top)!=null?r:0,right:(l=n.right)!=null?l:0,bottom:(a=n.bottom)!=null?a:0,left:(c=n.left)!=null?c:0}}function hg(n){return typeof n!="number"?gE(n):{top:n,right:n,bottom:n,left:n}}function ns(n){const{x:r,y:l,width:a,height:c}=n;return{width:a,height:c,top:l,left:r,right:r+a,bottom:l+c,x:r,y:l}}function mg(n,r,l){let{reference:a,floating:c}=n;const s=Gn(r),u=Zu(r),h=Qu(u),g=Hr(r),m=s==="y",b=a.x+a.width/2-c.width/2,v=a.y+a.height/2-c.height/2,w=a[h]/2-c[h]/2;let C;switch(g){case"top":C={x:b,y:a.y-c.height};break;case"bottom":C={x:b,y:a.y+a.height};break;case"right":C={x:a.x+a.width,y:v};break;case"left":C={x:a.x-c.width,y:v};break;default:C={x:a.x,y:a.y}}const y=la(r);return y&&(C[u]+=w*(y==="end"?1:-1)*(l&&m?-1:1)),C}async function yE(n,r){var l;r===void 0&&(r={});const{x:a,y:c,platform:s,rects:u,elements:h,strategy:g}=n,{boundary:m="clippingAncestors",rootBoundary:b="viewport",elementContext:v="floating",altBoundary:w=!1,padding:C=0}=cr(r,n),y=hg(C),E=h[w?v==="floating"?"reference":"floating":v],R=ns(await s.getClippingRect({element:(l=await(s.isElement==null?void 0:s.isElement(E)))==null||l?E:E.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(h.floating)),boundary:m,rootBoundary:b,strategy:g})),N=v==="floating"?{x:a,y:c,width:u.floating.width,height:u.floating.height}:u.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h.floating)),O=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},D=ns(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:N,offsetParent:T,strategy:g}):N);return{top:(R.top-D.top+y.top)/O.y,bottom:(D.bottom-R.bottom+y.bottom)/O.y,left:(R.left-D.left+y.left)/O.x,right:(D.right-R.right+y.right)/O.x}}const vE=50,bE=async(n,r,l)=>{const{placement:a="bottom",strategy:c="absolute",middleware:s=[],platform:u}=l,h=u.detectOverflow?u:{...u,detectOverflow:yE},g=await(u.isRTL==null?void 0:u.isRTL(r));let m=await u.getElementRects({reference:n,floating:r,strategy:c}),{x:b,y:v}=mg(m,a,g),w=a,C=0;const y={};for(let S=0;S<s.length;S++){const E=s[S];if(!E)continue;const{name:R,fn:N}=E,{x:T,y:O,data:D,reset:M}=await N({x:b,y:v,initialPlacement:a,placement:w,strategy:c,middlewareData:y,rects:m,platform:h,elements:{reference:n,floating:r}});b=T??b,v=O??v,y[R]={...y[R],...D},M&&C<vE&&(C++,typeof M=="object"&&(M.placement&&(w=M.placement),M.rects&&(m=M.rects===!0?await u.getElementRects({reference:n,floating:r,strategy:c}):M.rects),{x:b,y:v}=mg(m,w,g)),S=-1)}return{x:b,y:v,placement:w,strategy:c,middlewareData:y}},xE=n=>({name:"arrow",options:n,async fn(r){const{x:l,y:a,placement:c,rects:s,platform:u,elements:h,middlewareData:g}=r,{element:m,padding:b=0}=cr(n,r)||{};if(m==null)return{};const v=hg(b),w={x:l,y:a},C=Zu(c),y=Qu(C),S=await u.getDimensions(m),E=C==="y",R=E?"top":"left",N=E?"bottom":"right",T=E?"clientHeight":"clientWidth",O=s.reference[y]+s.reference[C]-w[C]-s.floating[y],D=w[C]-s.reference[C],M=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m));let z=M?M[T]:0;(!z||!await(u.isElement==null?void 0:u.isElement(M)))&&(z=h.floating[T]||s.floating[y]);const H=O/2-D/2,G=z/2-S[y]/2-1,X=kr(v[R],G),U=kr(v[N],G),F=z-S[y]-U,J=z/2-S[y]/2+H,I=ug(X,J,F),Y=!g.arrow&&la(c)!=null&&J!==I&&s.reference[y]/2-(J<X?X:U)-S[y]/2<0,k=Y?J<X?J-X:J-F:0;return{[C]:w[C]+k,data:{[C]:I,centerOffset:J-I-k,...Y&&{alignmentOffset:k}},reset:Y}}}),SE=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var l,a;const{placement:c,middlewareData:s,rects:u,initialPlacement:h,platform:g,elements:m}=r,{mainAxis:b=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:S=!0,...E}=cr(n,r);if((l=s.arrow)!=null&&l.alignmentOffset)return{};const R=Hr(c),N=Gn(h),T=Hr(h)===h,O=await(g.isRTL==null?void 0:g.isRTL(m.floating)),D=w||(T||!S?[ts(h)]:dE(h)),M=y!=="none";!w&&M&&D.push(...pE(h,S,y,O));const z=[h,...D],H=await g.detectOverflow(r,E),G=[];let X=((a=s.flip)==null?void 0:a.overflows)||[];if(b&&G.push(H[R]),v){const I=uE(c,u,O);G.push(H[I[0]],H[I[1]])}if(X=[...X,{placement:c,overflows:G}],!G.every(I=>I<=0)){var U,F;const I=(((U=s.flip)==null?void 0:U.index)||0)+1,Y=z[I];if(Y&&(!(v==="alignment"?N!==Gn(Y):!1)||X.every(L=>Gn(L.placement)===N?L.overflows[0]>0:!0)))return{data:{index:I,overflows:X},reset:{placement:Y}};let k=(F=X.filter($=>$.overflows[0]<=0).sort(($,L)=>$.overflows[1]-L.overflows[1])[0])==null?void 0:F.placement;if(!k)switch(C){case"bestFit":{var J;const $=(J=X.filter(L=>{if(M){const Z=Gn(L.placement);return Z===N||Z==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(Z=>Z>0).reduce((Z,A)=>Z+A,0)]).sort((L,Z)=>L[1]-Z[1])[0])==null?void 0:J[0];$&&(k=$);break}case"initialPlacement":k=h;break}if(c!==k)return{reset:{placement:k}}}return{}}}};function pg(n,r){return{top:n.top-r.height,right:n.right-r.width,bottom:n.bottom-r.height,left:n.left-r.width}}function gg(n){return sE.some(r=>n[r]>=0)}const CE=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(r){const{rects:l,platform:a}=r,{strategy:c="referenceHidden",...s}=cr(n,r);switch(c){case"referenceHidden":{const u=await a.detectOverflow(r,{...s,elementContext:"reference"}),h=pg(u,l.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:gg(h)}}}case"escaped":{const u=await a.detectOverflow(r,{...s,altBoundary:!0}),h=pg(u,l.floating);return{data:{escapedOffsets:h,escaped:gg(h)}}}default:return{}}}}},yg=new Set(["left","top"]);async function wE(n,r){const{placement:l,platform:a,elements:c}=n,s=await(a.isRTL==null?void 0:a.isRTL(c.floating)),u=Hr(l),h=la(l),g=Gn(l)==="y",m=yg.has(u)?-1:1,b=s&&g?-1:1,v=cr(r,n);let{mainAxis:w,crossAxis:C,alignmentAxis:y}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return h&&typeof y=="number"&&(C=h==="end"?y*-1:y),g?{x:C*b,y:w*m}:{x:w*m,y:C*b}}const EE=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var l,a;const{x:c,y:s,placement:u,middlewareData:h}=r,g=await wE(r,n);return u===((l=h.offset)==null?void 0:l.placement)&&(a=h.arrow)!=null&&a.alignmentOffset?{}:{x:c+g.x,y:s+g.y,data:{...g,placement:u}}}}},TE=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:l,y:a,placement:c,platform:s}=r,{mainAxis:u=!0,crossAxis:h=!1,limiter:g={fn:N=>{let{x:T,y:O}=N;return{x:T,y:O}}},...m}=cr(n,r),b={x:l,y:a},v=await s.detectOverflow(r,m),w=Gn(c),C=Fu(w);let y=b[C],S=b[w];const E=(N,T)=>ug(T+v[N==="y"?"top":"left"],T,T-v[N==="y"?"bottom":"right"]);u&&(y=E(C,y)),h&&(S=E(w,S));const R=g.fn({...r,[C]:y,[w]:S});return{...R,data:{x:R.x-l,y:R.y-a,enabled:{[C]:u,[w]:h}}}}}},jE=function(n){return n===void 0&&(n={}),{options:n,fn(r){var l,a;const{x:c,y:s,placement:u,rects:h,middlewareData:g}=r,{offset:m=0,mainAxis:b=!0,crossAxis:v=!0}=cr(n,r),w={x:c,y:s},C=Gn(u),y=Fu(C);let S=w[y],E=w[C];const R=cr(m,r),N=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(l=R.mainAxis)!=null?l:0,crossAxis:(a=R.crossAxis)!=null?a:0};if(b){const D=y==="y"?"height":"width",M=h.reference[y]-h.floating[D]+N.mainAxis,z=h.reference[y]+h.reference[D]-N.mainAxis;S<M?S=M:S>z&&(S=z)}if(v){var T,O;const D=y==="y"?"width":"height",M=yg.has(Hr(u)),z=h.reference[C]-h.floating[D]+(M&&((T=g.offset)==null?void 0:T[C])||0)+(M?0:N.crossAxis),H=h.reference[C]+h.reference[D]+(M?0:((O=g.offset)==null?void 0:O[C])||0)-(M?N.crossAxis:0);E<z?E=z:E>H&&(E=H)}return{[y]:S,[C]:E}}}},OE=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){const{placement:l,rects:a,platform:c,elements:s}=r,{apply:u=()=>{},...h}=cr(n,r),g=await c.detectOverflow(r,h),m=Hr(l),b=la(l),v=Gn(l)==="y",{width:w,height:C}=a.floating;let y,S;m==="top"||m==="bottom"?(y=m,S=b===(await(c.isRTL==null?void 0:c.isRTL(s.floating))?"start":"end")?"left":"right"):(S=m,y=b==="end"?"top":"bottom");const E=C-g.top-g.bottom,R=w-g.left-g.right,N=kr(C-g[y],E),T=kr(w-g[S],R),O=r.middlewareData.shift,D=!O;let M=N,z=T;O!=null&&O.enabled.x&&(z=R),O!=null&&O.enabled.y&&(M=E),D&&!b&&(v?z=w-2*lr(g.left,g.right):M=C-2*lr(g.top,g.bottom)),await u({...r,availableWidth:z,availableHeight:M});const H=await c.getDimensions(s.floating);return w!==H.width||C!==H.height?{reset:{rects:!0}}:{}}}};function rs(){return typeof window<"u"}function sa(n){return vg(n)?(n.nodeName||"").toLowerCase():"#document"}function Ft(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function ur(n){var r;return(r=(vg(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function vg(n){return rs()?n instanceof Node||n instanceof Ft(n).Node:!1}function Vn(n){return rs()?n instanceof Element||n instanceof Ft(n).Element:!1}function Br(n){return rs()?n instanceof HTMLElement||n instanceof Ft(n).HTMLElement:!1}function bg(n){return!rs()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Ft(n).ShadowRoot}function os(n){const{overflow:r,overflowX:l,overflowY:a,display:c}=qn(n);return/auto|scroll|overlay|hidden|clip/.test(r+a+l)&&c!=="inline"&&c!=="contents"}function RE(n){return/^(table|td|th)$/.test(sa(n))}function as(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const NE=/transform|translate|scale|rotate|perspective|filter/,AE=/paint|layout|strict|content/,vo=n=>!!n&&n!=="none";let Ju;function ed(n){const r=Vn(n)?qn(n):n;return vo(r.transform)||vo(r.translate)||vo(r.scale)||vo(r.rotate)||vo(r.perspective)||!td()&&(vo(r.backdropFilter)||vo(r.filter))||NE.test(r.willChange||"")||AE.test(r.contain||"")}function ME(n){let r=bo(n);for(;Br(r)&&!xi(r);){if(ed(r))return r;if(as(r))return null;r=bo(r)}return null}function td(){return Ju==null&&(Ju=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ju}function xi(n){return/^(html|body|#document)$/.test(sa(n))}function qn(n){return Ft(n).getComputedStyle(n)}function is(n){return Vn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function bo(n){if(sa(n)==="html")return n;const r=n.assignedSlot||n.parentNode||bg(n)&&n.host||ur(n);return bg(r)?r.host:r}function xg(n){const r=bo(n);return xi(r)?(n.ownerDocument||n).body:Br(r)&&os(r)?r:xg(r)}function Si(n,r,l){var a;r===void 0&&(r=[]),l===void 0&&(l=!0);const c=xg(n),s=c===((a=n.ownerDocument)==null?void 0:a.body),u=Ft(c);if(s){const h=nd(u);return r.concat(u,u.visualViewport||[],os(c)?c:[],h&&l?Si(h):[])}else return r.concat(c,Si(c,[],l))}function nd(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Sg(n){const r=qn(n);let l=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const c=Br(n),s=c?n.offsetWidth:l,u=c?n.offsetHeight:a,h=Jl(l)!==s||Jl(a)!==u;return h&&(l=s,a=u),{width:l,height:a,$:h}}function rd(n){return Vn(n)?n:n.contextElement}function ca(n){const r=rd(n);if(!Br(r))return sr(1);const l=r.getBoundingClientRect(),{width:a,height:c,$:s}=Sg(r);let u=(s?Jl(l.width):l.width)/a,h=(s?Jl(l.height):l.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!h||!Number.isFinite(h))&&(h=1),{x:u,y:h}}const _E=sr(0);function Cg(n){const r=Ft(n);return!td()||!r.visualViewport?_E:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function DE(n,r,l){return r===void 0&&(r=!1),!!l&&r&&l===Ft(n)}function xo(n,r,l,a){r===void 0&&(r=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),s=rd(n);let u=sr(1);r&&(a?Vn(a)&&(u=ca(a)):u=ca(n));const h=DE(s,l,a)?Cg(s):sr(0);let g=(c.left+h.x)/u.x,m=(c.top+h.y)/u.y,b=c.width/u.x,v=c.height/u.y;if(s&&a){const w=Ft(s),C=Vn(a)?Ft(a):a;let y=w,S=nd(y);for(;S&&C!==y;){const E=ca(S),R=S.getBoundingClientRect(),N=qn(S),T=R.left+(S.clientLeft+parseFloat(N.paddingLeft))*E.x,O=R.top+(S.clientTop+parseFloat(N.paddingTop))*E.y;g*=E.x,m*=E.y,b*=E.x,v*=E.y,g+=T,m+=O,y=Ft(S),S=nd(y)}}return ns({width:b,height:v,x:g,y:m})}function ls(n,r){const l=is(n).scrollLeft;return r?r.left+l:xo(ur(n)).left+l}function wg(n,r){const l=n.getBoundingClientRect(),a=l.left+r.scrollLeft-ls(n,l),c=l.top+r.scrollTop;return{x:a,y:c}}function IE(n){let{elements:r,rect:l,offsetParent:a,strategy:c}=n;const s=c==="fixed",u=ur(a),h=r?as(r.floating):!1;if(a===u||h&&s)return l;let g={scrollLeft:0,scrollTop:0},m=sr(1);const b=sr(0),v=Br(a);if((v||!s)&&((sa(a)!=="body"||os(u))&&(g=is(a)),v)){const C=xo(a);m=ca(a),b.x=C.x+a.clientLeft,b.y=C.y+a.clientTop}const w=u&&!v&&!s?wg(u,g):sr(0);return{width:l.width*m.x,height:l.height*m.y,x:l.x*m.x-g.scrollLeft*m.x+b.x+w.x,y:l.y*m.y-g.scrollTop*m.y+b.y+w.y}}function zE(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function LE(n){const r=is(n),l=n.ownerDocument.body,a=lr(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),c=lr(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let s=-r.scrollLeft+ls(n);const u=-r.scrollTop;return qn(l).direction==="rtl"&&(s+=lr(n.clientWidth,l.clientWidth)-a),{width:a,height:c,x:s,y:u}}const kE=25;function HE(n,r,l){l===void 0&&(l="viewport");const a=l==="layoutViewport",c=Ft(n),s=ur(n),u=c.visualViewport;let h=s.clientWidth,g=s.clientHeight,m=0,b=0;if(u){const w=!td()||r==="fixed";a?w||(m=-u.offsetLeft,b=-u.offsetTop):(h=u.width,g=u.height,w&&(m=u.offsetLeft,b=u.offsetTop))}if(ls(s)<=0){const w=s.ownerDocument,C=w.body,y=getComputedStyle(C),S=w.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,E=Math.abs(s.clientWidth-C.clientWidth-S),R=getComputedStyle(s).scrollbarGutter==="stable both-edges"?E/2:E;R<=kE&&(h-=R)}return{width:h,height:g,x:m,y:b}}function BE(n,r){const l=xo(n,!0,r==="fixed"),a=l.top+n.clientTop,c=l.left+n.clientLeft,s=ca(n),u=n.clientWidth*s.x,h=n.clientHeight*s.y,g=c*s.x,m=a*s.y;return{width:u,height:h,x:g,y:m}}function Eg(n,r,l){let a;if(r==="viewport"||r==="layoutViewport")a=HE(n,l,r);else if(r==="document")a=LE(ur(n));else if(Vn(r))a=BE(r,l);else{const c=Cg(n);a={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return ns(a)}function UE(n,r){const l=r.get(n);if(l)return l;let a=Si(n,[],!1).filter(h=>Vn(h)&&sa(h)!=="body"),c=null;const s=qn(n).position==="fixed";let u=s?bo(n):n;for(;Vn(u)&&!xi(u);){const h=qn(u),g=ed(u),m=c?c.position:s?"fixed":"";!g&&(m==="fixed"||m==="absolute"&&h.position==="static")?a=a.filter(v=>v!==u):c=h,u=bo(u)}return r.set(n,a),a}function PE(n){let{element:r,boundary:l,rootBoundary:a,strategy:c}=n;const u=[...l==="clippingAncestors"?as(r)?[]:UE(r,this._c):[].concat(l),a],h=Eg(r,u[0],c);let g=h.top,m=h.right,b=h.bottom,v=h.left;for(let w=1;w<u.length;w++){const C=Eg(r,u[w],c);g=lr(C.top,g),m=kr(C.right,m),b=kr(C.bottom,b),v=lr(C.left,v)}return{width:m-v,height:b-g,x:v,y:g}}function $E(n){const{width:r,height:l}=Sg(n);return{width:r,height:l}}function GE(n,r,l){const a=Br(r),c=ur(r),s=l==="fixed",u=xo(n,!0,s,r);let h={scrollLeft:0,scrollTop:0};const g=sr(0);if((a||!s)&&((sa(r)!=="body"||os(c))&&(h=is(r)),a)){const w=xo(r,!0,s,r);g.x=w.x+r.clientLeft,g.y=w.y+r.clientTop}!a&&c&&(g.x=ls(c));const m=c&&!a&&!s?wg(c,h):sr(0),b=u.left+h.scrollLeft-g.x-m.x,v=u.top+h.scrollTop-g.y-m.y;return{x:b,y:v,width:u.width,height:u.height}}function od(n){return qn(n).position==="static"}function Tg(n,r){if(!Br(n)||qn(n).position==="fixed")return null;if(r)return r(n);let l=n.offsetParent;return ur(n)===l&&(l=l.ownerDocument.body),l}function jg(n,r){const l=Ft(n);if(as(n))return l;if(!Br(n)){let c=bo(n);for(;c&&!xi(c);){if(Vn(c)&&!od(c))return c;c=bo(c)}return l}let a=Tg(n,r);for(;a&&RE(a)&&od(a);)a=Tg(a,r);return a&&xi(a)&&od(a)&&!ed(a)?l:a||ME(n)||l}const VE=async function(n){const r=this.getOffsetParent||jg,l=this.getDimensions,a=await l(n.floating);return{reference:GE(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function qE(n){return qn(n).direction==="rtl"}const YE={convertOffsetParentRelativeRectToViewportRelativeRect:IE,getDocumentElement:ur,getClippingRect:PE,getOffsetParent:jg,getElementRects:VE,getClientRects:zE,getDimensions:$E,getScale:ca,isElement:Vn,isRTL:qE};function Og(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function XE(n,r,l){let a=null,c;const s=ur(n);function u(){var b;clearTimeout(c),(b=a)==null||b.disconnect(),a=null}function h(b,v){b===void 0&&(b=!1),v===void 0&&(v=1),u();const w=n.getBoundingClientRect(),{left:C,top:y,width:S,height:E}=w;if(b||r(),!S||!E)return;const R=es(y),N=es(s.clientWidth-(C+S)),T=es(s.clientHeight-(y+E)),O=es(C),M={rootMargin:-R+"px "+-N+"px "+-T+"px "+-O+"px",threshold:lr(0,kr(1,v))||1};let z=!0;function H(G){const X=G[0].intersectionRatio;if(!Og(w,n.getBoundingClientRect()))return h();if(X!==v){if(!z)return h();X?h(!1,X):c=setTimeout(()=>{h(!1,1e-7)},1e3)}z=!1}try{a=new IntersectionObserver(H,{...M,root:s.ownerDocument})}catch{a=new IntersectionObserver(H,M)}a.observe(n)}const g=Ft(n),m=()=>h(l);return g.addEventListener("resize",m),h(!0),()=>{g.removeEventListener("resize",m),u()}}function KE(n,r,l,a){a===void 0&&(a={});const{ancestorScroll:c=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=a,m=rd(n),b=c||s?[...m?Si(m):[],...r?Si(r):[]]:[];b.forEach(R=>{c&&R.addEventListener("scroll",l),s&&R.addEventListener("resize",l)});const v=m&&h?XE(m,l,s):null;let w=-1,C=null;u&&(C=new ResizeObserver(R=>{let[N]=R;N&&N.target===m&&C&&r&&(C.unobserve(r),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var T;(T=C)==null||T.observe(r)})),l()}),m&&!g&&C.observe(m),r&&C.observe(r));let y,S=g?xo(n):null;g&&E();function E(){const R=xo(n);S&&!Og(S,R)&&l(),S=R,y=requestAnimationFrame(E)}return l(),()=>{var R;b.forEach(N=>{c&&N.removeEventListener("scroll",l),s&&N.removeEventListener("resize",l)}),v?.(),(R=C)==null||R.disconnect(),C=null,g&&cancelAnimationFrame(y)}}const FE=EE,QE=TE,ZE=SE,WE=OE,JE=CE,Rg=xE,eT=jE,tT=(n,r,l)=>{const a=new Map,c=l??{},s={...YE,...c.platform,_c:a};return bE(n,r,{...c,platform:s})};var nT=typeof document<"u",rT=function(){},ss=nT?x.useLayoutEffect:rT;function cs(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let l,a,c;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==r.length)return!1;for(a=l;a--!==0;)if(!cs(n[a],r[a]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(r).length)return!1;for(a=l;a--!==0;)if(!{}.hasOwnProperty.call(r,c[a]))return!1;for(a=l;a--!==0;){const s=c[a];if(!(s==="_owner"&&n.$$typeof)&&!cs(n[s],r[s]))return!1}return!0}return n!==n&&r!==r}function Ng(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ag(n,r){const l=Ng(n);return Math.round(r*l)/l}function ad(n){const r=x.useRef(n);return ss(()=>{r.current=n}),r}function oT(n){n===void 0&&(n={});const{placement:r="bottom",strategy:l="absolute",middleware:a=[],platform:c,elements:{reference:s,floating:u}={},transform:h=!0,whileElementsMounted:g,open:m}=n,[b,v]=x.useState({x:0,y:0,strategy:l,placement:r,middlewareData:{},isPositioned:!1}),[w,C]=x.useState(a);cs(w,a)||C(a);const[y,S]=x.useState(null),[E,R]=x.useState(null),N=x.useCallback(L=>{L!==M.current&&(M.current=L,S(L))},[]),T=x.useCallback(L=>{L!==z.current&&(z.current=L,R(L))},[]),O=s||y,D=u||E,M=x.useRef(null),z=x.useRef(null),H=x.useRef(b),G=g!=null,X=ad(g),U=ad(c),F=ad(m),J=x.useCallback(()=>{if(!M.current||!z.current)return;const L={placement:r,strategy:l,middleware:w};U.current&&(L.platform=U.current),tT(M.current,z.current,L).then(Z=>{const A={...Z,isPositioned:F.current!==!1};I.current&&!cs(H.current,A)&&(H.current=A,Dr.flushSync(()=>{v(A)}))})},[w,r,l,U,F]);ss(()=>{m===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,v(L=>({...L,isPositioned:!1})))},[m]);const I=x.useRef(!1);ss(()=>(I.current=!0,()=>{I.current=!1}),[]),ss(()=>{if(O&&(M.current=O),D&&(z.current=D),O&&D){if(X.current)return X.current(O,D,J);J()}},[O,D,J,X,G]);const Y=x.useMemo(()=>({reference:M,floating:z,setReference:N,setFloating:T}),[N,T]),k=x.useMemo(()=>({reference:O,floating:D}),[O,D]),$=x.useMemo(()=>{const L={position:l,left:0,top:0};if(!k.floating)return L;const Z=Ag(k.floating,b.x),A=Ag(k.floating,b.y);return h?{...L,transform:"translate("+Z+"px, "+A+"px)",...Ng(k.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:Z,top:A}},[l,h,k.floating,b.x,b.y]);return x.useMemo(()=>({...b,update:J,refs:Y,elements:k,floatingStyles:$}),[b,J,Y,k,$])}const aT=n=>{function r(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:a,padding:c}=typeof n=="function"?n(l):n;return a&&r(a)?a.current!=null?Rg({element:a.current,padding:c}).fn(l):{}:a?Rg({element:a,padding:c}).fn(l):{}}}},iT=(n,r)=>{const l=FE(n);return{name:l.name,fn:l.fn,options:[n,r]}},lT=(n,r)=>{const l=QE(n);return{name:l.name,fn:l.fn,options:[n,r]}},sT=(n,r)=>({fn:eT(n).fn,options:[n,r]}),cT=(n,r)=>{const l=ZE(n);return{name:l.name,fn:l.fn,options:[n,r]}},uT=(n,r)=>{const l=WE(n);return{name:l.name,fn:l.fn,options:[n,r]}},dT=(n,r)=>{const l=JE(n);return{name:l.name,fn:l.fn,options:[n,r]}},fT=(n,r)=>{const l=aT(n);return{name:l.name,fn:l.fn,options:[n,r]}};var hT=Object.defineProperty,mT=(n,r)=>hT(n,"name",{value:r,configurable:!0}),pT=x.forwardRef(mT(function(r,l){const{children:a,width:c=10,height:s=5,...u}=r;return f.jsx(He.svg,{...u,ref:l,width:c,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?a:f.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),gT=Object.defineProperty,dr=(n,r)=>gT(n,"name",{value:r,configurable:!0}),Mg={Partial:"partial"},_g={Optimized:"optimized",Always:"always"},Dg="Popper",[Ig,us]=vn(Dg),[yT,zg]=Ig(Dg),Lg=dr(n=>{const{__scopePopper:r,children:l}=n,[a,c]=x.useState(null),[s,u]=x.useState(void 0);return f.jsx(yT,{scope:r,anchor:a,onAnchorChange:c,placementState:s,setPlacementState:u,children:l})},"Popper"),vT="PopperAnchor",kg=x.forwardRef(dr(function(r,l){const{__scopePopper:a,virtualRef:c,...s}=r,u=zg(vT,a),h=x.useRef(null),g=u.onAnchorChange,m=x.useCallback(S=>{h.current=S,S&&g(S)},[g]),b=Ie(l,m),v=x.useRef(null);x.useEffect(()=>{if(!c)return;const S=v.current;v.current=c.current,S!==v.current&&g(v.current)});const w=u.placementState&&ds(u.placementState),C=w?.[0],y=w?.[1];return c?null:f.jsx(He.div,{"data-radix-popper-side":C,"data-radix-popper-align":y,...s,ref:b})},"PopperAnchor")),Hg="PopperContent",[bT,xT]=Ig(Hg),Bg=x.forwardRef(dr(function(r,l){const{__scopePopper:a,side:c="bottom",sideOffset:s=0,align:u="center",alignOffset:h=0,arrowPadding:g=0,avoidCollisions:m=!0,collisionBoundary:b=[],collisionPadding:v=0,sticky:w=Mg.Partial,hideWhenDetached:C=!1,updatePositionStrategy:y=_g.Optimized,onPlaced:S,...E}=r,R=zg(Hg,a),[N,T]=x.useState(null),O=Ie(l,T),[D,M]=x.useState(null),z=bi(D),H=z?.width??0,G=z?.height??0,X=c+(u!=="center"?"-"+u:""),U=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},F=Array.isArray(b)?b:[b],J=F.length>0,I={padding:U,boundary:F.filter(Ug),altBoundary:J},{refs:Y,floatingStyles:k,placement:$,isPositioned:L,middlewareData:Z}=oT({strategy:"fixed",placement:X,whileElementsMounted:dr((...be)=>KE(...be,{animationFrame:y===_g.Always}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[iT({mainAxis:s+G,alignmentAxis:h}),m&&lT({mainAxis:!0,crossAxis:!1,...w===Mg.Partial?{limiter:sT()}:{},...I}),m&&cT({...I}),uT({...I,apply:dr(({elements:be,rects:de,availableWidth:Se,availableHeight:_e})=>{const{width:Ce,height:Ae}=de.reference,$e=be.floating.style;$e.setProperty("--radix-popper-available-width",`${Se}px`),$e.setProperty("--radix-popper-available-height",`${_e}px`),$e.setProperty("--radix-popper-anchor-width",`${Ce}px`),$e.setProperty("--radix-popper-anchor-height",`${Ae}px`)},"apply")}),D&&fT({element:D,padding:g}),ET({arrowWidth:H,arrowHeight:G}),C&&dT(J?{strategy:"referenceHidden",...I}:{strategy:"referenceHidden",padding:I.padding,altBoundary:I.altBoundary})]}),A=R.setPlacementState;it(()=>(A($),()=>{A(void 0)}),[$,A]);const[V,K]=ds($),ee=An(S);it(()=>{L&&ee?.()},[L,ee]);const le=Z.arrow?.x,ce=Z.arrow?.y,ie=Z.arrow?.centerOffset!==0,[ge,je]=x.useState();return it(()=>{N&&je(window.getComputedStyle(N).zIndex)},[N]),f.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:L?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[Z.transformOrigin?.x,Z.transformOrigin?.y].join(" "),...Z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:f.jsx(bT,{scope:a,placedSide:V,placedAlign:K,onArrowChange:M,arrowX:le,arrowY:ce,shouldHideArrow:ie,children:f.jsx(He.div,{"data-side":V,"data-align":K,...E,ref:O,style:{...E.style,animation:L?E.style?.animation:"none"}})})})},"PopperContent")),ST="PopperArrow",CT={top:"bottom",right:"left",bottom:"top",left:"right"},wT=x.forwardRef(dr(function(r,l){const{__scopePopper:a,...c}=r,s=xT(ST,a),u=CT[s.placedSide];return f.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:f.jsx(pT,{...c,ref:l,style:{...c.style,display:"block"}})})},"PopperArrow"));function Ug(n){return n!==null}dr(Ug,"isNotNull");var ET=dr(n=>({name:"transformOrigin",options:n,fn(r){const{placement:l,rects:a,middlewareData:c}=r,u=c.arrow?.centerOffset!==0,h=u?0:n.arrowWidth,g=u?0:n.arrowHeight,[m,b]=ds(l),v={start:"0%",center:"50%",end:"100%"}[b],w=(c.arrow?.x??0)+h/2,C=(c.arrow?.y??0)+g/2;let y="",S="";return m==="bottom"?(y=u?v:`${w}px`,S=`${-g}px`):m==="top"?(y=u?v:`${w}px`,S=`${a.floating.height+g}px`):m==="right"?(y=`${-g}px`,S=u?v:`${C}px`):m==="left"&&(y=`${a.floating.width+g}px`,S=u?v:`${C}px`),{data:{x:y,y:S}}}}),"transformOrigin");function ds(n){const[r,l="center"]=n.split("-");return[r,l]}dr(ds,"getSideAndAlignFromPlacement");var TT=Object.defineProperty,id=(n,r)=>TT(n,"name",{value:r,configurable:!0}),ld=!1;function Pg(){const[n,r]=x.useState(ld);return x.useEffect(()=>{ld||(ld=!0,r(!0))},[]),n}id(Pg,"useIsHydrated");var $g=po[" useSyncExternalStore ".trim().toString()];function Gg(){return()=>{}}id(Gg,"subscribe");function Vg(){return $g(Gg,()=>!0,()=>!1)}id(Vg,"useIsHydratedModern");var jT=typeof $g=="function"?Vg:Pg,OT=Object.defineProperty,So=(n,r)=>OT(n,"name",{value:r,configurable:!0}),sd="rovingFocusGroup.onEntryFocus",RT={bubbles:!1,cancelable:!0},fs="RovingFocusGroup",[cd,qg,NT]=Ul(fs),[AT,Yg]=vn(fs,[NT]),Xg={Vertical:"vertical",Horizontal:"horizontal"},MT={RTL:"rtl"},[_T,DT]=AT(fs),IT=x.forwardRef(So(function(r,l){return f.jsx(cd.Provider,{scope:r.__scopeRovingFocusGroup,children:f.jsx(cd.Slot,{scope:r.__scopeRovingFocusGroup,children:f.jsx(zT,{...r,ref:l})})})},"RovingFocusGroup")),zT=x.forwardRef(So(function(r,l){const{__scopeRovingFocusGroup:a,orientation:c,loop:s=!1,dir:u,currentTabStopId:h,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:m,onEntryFocus:b,preventScrollOnEntryFocus:v=!1,...w}=r,C=x.useRef(null),y=Ie(l,C),S=yi(u),[E,R]=tr({prop:h,defaultProp:g??null,onChange:m,caller:fs}),[N,T]=x.useState(!1),O=An(b),D=qg(a),M=x.useRef(!1),[z,H]=x.useState(0);return x.useEffect(()=>{const G=C.current;if(G)return G.addEventListener(sd,O),()=>G.removeEventListener(sd,O)},[O]),f.jsx(_T,{scope:a,orientation:c,dir:S,loop:s,currentTabStopId:E,onItemFocus:x.useCallback(G=>R(G),[R]),onItemShiftTab:x.useCallback(()=>T(!0),[]),onFocusableItemAdd:x.useCallback(()=>H(G=>G+1),[]),onFocusableItemRemove:x.useCallback(()=>H(G=>G-1),[]),children:f.jsx(He.div,{tabIndex:N||z===0?-1:0,"data-orientation":c,...w,ref:y,style:{outline:"none",...r.style},onMouseDown:we(r.onMouseDown,()=>{M.current=!0}),onFocus:we(r.onFocus,G=>{const X=!M.current;if(G.target===G.currentTarget&&X&&!N){const U=new CustomEvent(sd,RT);if(G.currentTarget.dispatchEvent(U),!U.defaultPrevented){const F=D().filter($=>$.focusable),J=F.find($=>$.active),I=F.find($=>$.id===E),k=[J,I,...F].filter(Boolean).map($=>$.ref.current);ud(k,v)}}M.current=!1}),onBlur:we(r.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),LT="RovingFocusGroupItem",kT=x.forwardRef(So(function(r,l){const{__scopeRovingFocusGroup:a,focusable:c=!0,active:s=!1,tabStopId:u,children:h,...g}=r,m=rr(),b=u||m,v=DT(LT,a),w=v.currentTabStopId===b,C=qg(a),{onFocusableItemAdd:y,onFocusableItemRemove:S,currentTabStopId:E}=v,R=jT();return it(()=>{if(!(!R||!c))return y(),()=>S()},[R,c,y,S]),x.useEffect(()=>{if(!(R||!c))return y(),()=>S()},[R,c,y,S]),f.jsx(cd.ItemSlot,{scope:a,id:b,focusable:c,active:s,children:f.jsx(He.span,{tabIndex:w?0:-1,"data-orientation":v.orientation,...g,ref:l,onMouseDown:we(r.onMouseDown,N=>{c?v.onItemFocus(b):N.preventDefault()}),onFocus:we(r.onFocus,()=>v.onItemFocus(b)),onKeyDown:we(r.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){v.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const T=Fg(N,v.orientation,v.dir);if(T!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let D=C().filter(M=>M.focusable).map(M=>M.ref.current);if(T==="last")D.reverse();else if(T==="prev"||T==="next"){T==="prev"&&D.reverse();const M=D.indexOf(N.currentTarget);D=v.loop?Qg(D,M+1):D.slice(M+1)}setTimeout(()=>ud(D))}}),children:typeof h=="function"?h({isCurrentTabStop:w,hasTabStop:E!=null}):h})})},"RovingFocusGroupItem")),HT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Kg(n,r){return r!==MT.RTL?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}So(Kg,"getDirectionAwareKey");function Fg(n,r,l){const a=Kg(n.key,l);if(!(r===Xg.Vertical&&["ArrowLeft","ArrowRight"].includes(a))&&!(r===Xg.Horizontal&&["ArrowUp","ArrowDown"].includes(a)))return HT[a]}So(Fg,"getFocusIntent");function ud(n,r=!1){const l=document.activeElement;for(const a of n)if(a===l||(a.focus({preventScroll:r}),document.activeElement!==l))return}So(ud,"focusFirst");function Qg(n,r){return n.map((l,a)=>n[(r+a)%n.length])}So(Qg,"wrapArray");var BT=Object.defineProperty,UT=(n,r)=>BT(n,"name",{value:r,configurable:!0});function ua(n,[r,l]){return Math.min(l,Math.max(r,n))}UT(ua,"clamp");var PT=Object.defineProperty,Pt=(n,r)=>PT(n,"name",{value:r,configurable:!0}),Zg="Radio",[$T,Wg]=vn(Zg),[GT,hs]=$T(Zg);function Jg(n){const{__scopeRadio:r,checked:l=!1,children:a,disabled:c,form:s,name:u,onCheck:h,required:g,value:m="on",internal_do_not_use_render:b}=n,[v,w]=x.useState(null),[C,y]=x.useState(null),[S,E]=x.useState(null),R=v?!!s||!!v.closest("form"):!0,N={checked:l,disabled:c,required:g,name:u,form:s,value:m,control:v,setControl:w,userClick:S,onUserClick:E,isFormControl:R,bubbleInput:C,setBubbleInput:y,onCheck:Pt(()=>h?.(),"onCheck")};return f.jsx(GT,{scope:r,...N,children:ey(b)?b(N):a})}Pt(Jg,"RadioProvider");var VT="RadioTrigger",qT=x.forwardRef(Pt(function({__scopeRadio:r,onClick:l,...a},c){const{checked:s,disabled:u,value:h,setControl:g,onCheck:m,onUserClick:b,isFormControl:v,bubbleInput:w}=hs(VT,r),C=Ie(c,g);return f.jsx(He.button,{type:"button",role:"radio","aria-checked":s,"data-state":dd(s),"data-disabled":u?"":void 0,disabled:u,value:h,...a,ref:C,onClick:we(l,y=>{const S=y.isPropagationStopped();s||(b({hasConsumerStoppedPropagation:S}),m()),w&&v&&(S||y.stopPropagation())})})},"RadioTrigger")),YT="RadioIndicator",XT=x.forwardRef(Pt(function(r,l){const{__scopeRadio:a,forceMount:c,...s}=r,u=hs(YT,a);return f.jsx(Lr,{present:c||u.checked,children:f.jsx(He.span,{"data-state":dd(u.checked),"data-disabled":u.disabled?"":void 0,...s,ref:l})})},"RadioIndicator")),KT="RadioBubbleInput",FT=x.forwardRef(Pt(function({__scopeRadio:r,onClick:l,...a},c){const{control:s,checked:u,required:h,disabled:g,name:m,value:b,form:v,bubbleInput:w,setBubbleInput:C,userClick:y}=hs(KT,r),S=Ie(c,C),E=bi(s),R=x.useRef(!1),N=x.useRef(u),T=x.useRef(y),O=x.useRef(null);x.useEffect(()=>{const M=w;if(!M)return;const z=window.HTMLInputElement.prototype,G=Object.getOwnPropertyDescriptor(z,"checked").set;if(!G)return;const X=N.current!==u;N.current=u;const U=y!==null&&y!==T.current;if(T.current=y,U)O.current=X?null:y,X&&G.call(M,u),M.dispatchEvent(new Event("click",{bubbles:!y.hasConsumerStoppedPropagation}));else if(X){const F=O.current;O.current=null;const J=u&&F!==null;R.current=!0,G.call(M,u),M.dispatchEvent(new Event("click",{bubbles:!(J&&F.hasConsumerStoppedPropagation)})),R.current=!1}},[w,u,y]);const D=x.useRef(u);return f.jsx(He.input,{type:"radio","aria-hidden":!0,defaultChecked:D.current,required:h,disabled:g,name:m,value:b,form:v,...a,tabIndex:-1,ref:S,onClick:we(l,M=>{R.current&&M.stopPropagation()}),style:{...a.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function ey(n){return typeof n=="function"}Pt(ey,"isFunction");function dd(n){return n?"checked":"unchecked"}Pt(dd,"getState");var QT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],fd="RadioGroup",[ZT,GM]=vn(fd,[Yg,Wg]),ty=Yg(),ms=Wg(),[WT,JT]=ZT(fd),ej=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,name:c,form:s,defaultValue:u,value:h,required:g=!1,disabled:m=!1,orientation:b,dir:v,loop:w=!0,onValueChange:C,...y}=r,S=ty(a),E=yi(v),[R,N]=tr({prop:h,defaultProp:u??null,onChange:C,caller:fd}),[T,O]=x.useState(null),D=Ie(l,O),M=x.useRef(R);return x.useEffect(()=>{const z=s?T?.ownerDocument.getElementById(s):T?.closest("form");if(z instanceof HTMLFormElement){const H=Pt(()=>N(M.current),"reset");return z.addEventListener("reset",H),()=>z.removeEventListener("reset",H)}},[T,s,N]),f.jsx(WT,{scope:a,name:c,form:s,required:g,disabled:m,value:R,onValueChange:N,children:f.jsx(IT,{asChild:!0,...S,orientation:b,dir:E,loop:w,children:f.jsx(He.div,{role:"radiogroup","aria-required":g,"aria-orientation":b,"data-disabled":m?"":void 0,dir:E,...y,ref:D})})})},"RadioGroup")),tj="RadioGroupItemProvider",nj="RadioGroupItemTrigger";function ny(n){const{__scopeRadioGroup:r,value:l,disabled:a,children:c,internal_do_not_use_render:s}=n,u=JT(tj,r),h=ms(r),g=u.disabled||a;return f.jsx(Jg,{...h,checked:u.value===l,disabled:g,required:u.required,name:u.name,form:u.form,value:l,onCheck:()=>u.onValueChange(l),internal_do_not_use_render:s,children:c})}Pt(ny,"RadioGroupItemProvider");var rj=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,...c}=r,s=ty(a),u=ms(a),{checked:h,disabled:g}=hs(nj,u.__scopeRadio),m=x.useRef(null),b=Ie(l,m),v=x.useRef(!1);return x.useEffect(()=>{const w=Pt(y=>{QT.includes(y.key)&&(v.current=!0)},"handleKeyDown"),C=Pt(()=>v.current=!1,"handleKeyUp");return document.addEventListener("keydown",w),document.addEventListener("keyup",C),()=>{document.removeEventListener("keydown",w),document.removeEventListener("keyup",C)}},[]),f.jsx(kT,{asChild:!0,...s,focusable:!g,active:h,children:f.jsx(qT,{...u,...c,ref:b,onKeyDown:we(c.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onFocus:we(c.onFocus,()=>{v.current&&m.current?.click()})})})},"RadioGroupItemTrigger")),oj=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,value:c,disabled:s,...u}=r;return f.jsx(ny,{__scopeRadioGroup:a,value:c,disabled:s,internal_do_not_use_render:({isFormControl:h})=>f.jsxs(f.Fragment,{children:[f.jsx(rj,{...u,ref:l,__scopeRadioGroup:a}),h&&f.jsx(aj,{__scopeRadioGroup:a})]})})},"RadioGroupItem")),aj=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,...c}=r,s=ms(a);return f.jsx(FT,{...s,...c,ref:l})},"RadioGroupItemBubbleInput")),ij=x.forwardRef(Pt(function(r,l){const{__scopeRadioGroup:a,...c}=r,s=ms(a);return f.jsx(XT,{...s,...c,ref:l})},"RadioGroupIndicator")),lj=Object.defineProperty,Pe=(n,r)=>lj(n,"name",{value:r,configurable:!0}),ry={ItemAligned:"item-aligned",Popper:"popper"},sj={RTL:"rtl"},cj=[" ","Enter","ArrowUp","ArrowDown"],uj=[" ","Enter"],da="Select",[ps,gs,dj]=Ul(da),[Co,VM]=vn(da,[dj,us]),hd=us(),[fj,Ur]=Co(da),[hj,mj]=Co(da);function oy(n){const{__scopeSelect:r,children:l,open:a,defaultOpen:c,onOpenChange:s,value:u,defaultValue:h,onValueChange:g,dir:m,name:b,autoComplete:v,disabled:w,required:C,form:y,internal_do_not_use_render:S}=n,E=hd(r),[R,N]=x.useState(null),[T,O]=x.useState(null),[D,M]=x.useState(!1),z=yi(m),[H,G]=tr({prop:a,defaultProp:c??!1,onChange:s,caller:da}),[X,U]=tr({prop:u,defaultProp:h,onChange:g,caller:da}),F=x.useRef(null),J=x.useRef(!1),[I,Y]=x.useState(null),k=Pe(ie=>{Y({value:ie,hasConsumerStoppedPropagation:J.current}),U(ie)},"handleUserSelect"),$=x.useRef(X);x.useEffect(()=>{const ie=y?R?.ownerDocument.getElementById(y):R?.form;if(ie instanceof HTMLFormElement){const ge=Pe(()=>U($.current),"reset");return ie.addEventListener("reset",ge),()=>ie.removeEventListener("reset",ge)}},[y,R,U]);const L=R?!!y||!!R.closest("form"):!0,[Z,A]=x.useState(new Set),V=rr(),K=Array.from(Z).map(ie=>ie.props.value).join(";"),ee=x.useCallback(ie=>{A(ge=>new Set(ge).add(ie))},[]),le=x.useCallback(ie=>{A(ge=>{const je=new Set(ge);return je.delete(ie),je})},[]),ce={required:C,trigger:R,onTriggerChange:N,valueNode:T,onValueNodeChange:O,valueNodeHasChildren:D,onValueNodeHasChildrenChange:M,contentId:V,value:X,onValueChange:U,hasConsumerStoppedPropagationRef:J,userSelection:I,onUserSelect:k,open:H,onOpenChange:G,dir:z,triggerPointerDownPosRef:F,disabled:w,name:b,autoComplete:v,form:y,nativeOptions:Z,nativeSelectKey:K,isFormControl:L};return f.jsx(Lg,{...E,children:f.jsx(fj,{scope:r,...ce,children:f.jsx(ps.Provider,{scope:r,children:f.jsx(hj,{scope:r,onNativeOptionAdd:ee,onNativeOptionRemove:le,children:fy(S)?S(ce):l})})})})}Pe(oy,"SelectProvider");var pj=Pe(n=>{const{__scopeSelect:r,children:l,...a}=n;return f.jsx(oy,{__scopeSelect:r,...a,internal_do_not_use_render:({isFormControl:c})=>f.jsxs(f.Fragment,{children:[l,c?f.jsx(Yj,{__scopeSelect:r}):null]})})},"Select"),gj="SelectTrigger",yj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,disabled:c=!1,...s}=r,u=hd(a),h=Ur(gj,a),g=h.disabled||c,m=Ie(l,h.onTriggerChange),b=gs(a),v=x.useRef("touch"),[w,C,y]=gd(E=>{const R=b().filter(O=>!O.disabled),N=R.find(O=>O.value===h.value),T=yd(R,E,N);T!==void 0&&h.onUserSelect(T.value)}),S=Pe(E=>{g||(h.onOpenChange(!0),y()),E&&(h.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})},"handleOpen");return f.jsx(kg,{asChild:!0,...u,children:f.jsx(He.button,{type:"button",role:"combobox","aria-controls":h.open?h.contentId:void 0,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":Ci(h.value)?"":void 0,...s,ref:m,onClick:we(s.onClick,E=>{E.currentTarget.focus(),v.current!=="mouse"&&S(E)}),onPointerDown:we(s.onPointerDown,E=>{v.current=E.pointerType;const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(S(E),E.preventDefault())}),onKeyDown:we(s.onKeyDown,E=>{const R=w.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&(h.hasConsumerStoppedPropagationRef.current=E.isPropagationStopped(),C(E.key)),!(R&&E.key===" ")&&cj.includes(E.key)&&(S(),E.preventDefault())})})})},"SelectTrigger")),vj="SelectValue",bj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,className:c,style:s,children:u,placeholder:h="",...g}=r,m=Ur(vj,a),{onValueNodeHasChildrenChange:b}=m,v=u!==void 0,w=Ie(l,m.onValueNodeChange);it(()=>{b(v)},[b,v]);const C=Ci(m.value);return f.jsx(He.span,{...g,asChild:C?!1:g.asChild,ref:w,style:{pointerEvents:"none"},children:f.jsx(x.Fragment,{children:C?h:u},C?"placeholder":"value")})},"SelectValue")),xj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,children:c,...s}=r;return f.jsx(He.span,{"aria-hidden":!0,...s,ref:l,children:c||"▼"})},"SelectIcon")),Sj="SelectPortal",[Cj,wj]=Co(Sj,{forceMount:void 0}),Ej=Pe(n=>{const{__scopeSelect:r,forceMount:l,...a}=n;return f.jsx(Cj,{scope:n.__scopeSelect,forceMount:l,children:f.jsx(Du,{asChild:!0,...a})})},"SelectPortal"),wo="SelectContent",Tj=x.forwardRef(Pe(function(r,l){const a=wj(wo,r.__scopeSelect),{forceMount:c=a.forceMount,...s}=r,u=Ur(wo,r.__scopeSelect),[h,g]=x.useState();return it(()=>{g(new DocumentFragment)},[]),f.jsx(Lr,{present:c||u.open,children:({present:m})=>m?f.jsx(Rj,{...s,ref:l}):f.jsx(jj,{...s,fragment:h})})},"SelectContent")),jj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,children:c,fragment:s}=r;return s?Dr.createPortal(f.jsx(ay,{scope:a,children:f.jsx(ps.Slot,{scope:a,children:f.jsx("div",{ref:l,children:c})})}),s):null},"SelectContentFragment")),Mn=10,[ay,Eo]=Co(wo),Oj=er("SelectContent.RemoveScroll"),Rj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a}=r,{position:c=ry.ItemAligned,onCloseAutoFocus:s,onEscapeKeyDown:u,onPointerDownOutside:h,side:g,sideOffset:m,align:b,alignOffset:v,arrowPadding:w,collisionBoundary:C,collisionPadding:y,sticky:S,hideWhenDetached:E,avoidCollisions:R,...N}=r,T=Ur(wo,a),[O,D]=x.useState(null),[M,z]=x.useState(null),H=Ie(l,D),[G,X]=x.useState(null),[U,F]=x.useState(null),J=gs(a),[I,Y]=x.useState(!1),k=x.useRef(!1),$=x.useRef(!1),L=x.useRef(!1);x.useEffect(()=>{if(O)return ng(O)},[O]),ql();const Z=x.useCallback(de=>{const[Se,..._e]=J().map($e=>$e.ref.current),[Ce]=_e.slice(-1),Ae=document.activeElement;for(const $e of de)if($e===Ae||($e?.scrollIntoView({block:"nearest"}),$e===Se&&M&&(M.scrollTop=0),$e===Ce&&M&&(M.scrollTop=M.scrollHeight),$e?.focus(),document.activeElement!==Ae))return},[J,M]),A=x.useCallback(()=>Z([G,O]),[Z,G,O]);x.useEffect(()=>{I&&A()},[I,A]);const{onOpenChange:V,triggerPointerDownPosRef:K}=T;x.useEffect(()=>{if(O){let de={x:0,y:0};const Se=Pe(Ce=>{de={x:Math.abs(Math.round(Ce.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(Ce.pageY)-(K.current?.y??0))}},"handlePointerMove"),_e=Pe(Ce=>{de.x<=10&&de.y<=10?Ce.preventDefault():Ce.composedPath().includes(O)||V(!1),document.removeEventListener("pointermove",Se),K.current=null},"handlePointerUp");return K.current!==null&&(document.addEventListener("pointermove",Se),document.addEventListener("pointerup",_e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",_e,{capture:!0})}}},[O,V,K]),x.useEffect(()=>{const de=Pe(()=>V(!1),"close");return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[V]);const[ee,le]=gd(de=>{const Se=J().filter(Ae=>!Ae.disabled),_e=Se.find(Ae=>Ae.ref.current===document.activeElement),Ce=yd(Se,de,_e);Ce&&setTimeout(()=>Ce.ref.current?.focus())}),ce=x.useCallback((de,Se,_e)=>{const Ce=!$.current;Ce&&($.current=!0);const Ae=!k.current&&!_e;T.value!==void 0&&T.value===Se||Ae?(X(de),Ae&&(k.current=!0)):Ce&&X(de)},[T.value]),ie=x.useCallback(()=>O?.focus(),[O]),ge=x.useCallback((de,Se,_e)=>{if(!de)return;const Ce=!L.current;Ce&&(L.current=!0);const Ae=!k.current&&!_e;(T.value!==void 0&&T.value===Se||Ae||Ce)&&F(de)},[T.value]),je=c===ry.Popper?iy:Nj,be=je===iy?{side:g,sideOffset:m,align:b,alignOffset:v,arrowPadding:w,collisionBoundary:C,collisionPadding:y,sticky:S,hideWhenDetached:E,avoidCollisions:R}:{};return f.jsx(ay,{scope:a,content:O,viewport:M,onViewportChange:z,itemRefCallback:ce,selectedItem:G,onItemLeave:ie,itemTextRefCallback:ge,focusSelectedItem:A,selectedItemText:U,position:c,isPositioned:I,searchRef:ee,children:f.jsx(Uu,{as:Oj,allowPinchZoom:!0,children:f.jsx(Mp,{asChild:!0,trapped:T.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:we(s,de=>{T.trigger?.focus({preventScroll:!0}),de.preventDefault()}),children:f.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:f.jsx(je,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:de=>de.preventDefault(),...N,...be,onPlaced:()=>Y(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:we(N.onKeyDown,de=>{const Se=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!Se&&de.key.length===1&&le(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let Ce=J().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(de.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const Ae=de.target,$e=Ce.indexOf(Ae);Ce=Ce.slice($e+1)}setTimeout(()=>Z(Ce)),de.preventDefault()}})})})})})})},"SelectContentImpl")),Nj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,onPlaced:c,...s}=r,u=Ur(wo,a),h=Eo(wo,a),[g,m]=x.useState(null),[b,v]=x.useState(null),w=Ie(l,v),C=gs(a),y=x.useRef(!1),S=x.useRef(!0),{viewport:E,selectedItem:R,selectedItemText:N,focusSelectedItem:T}=h,O=x.useCallback(()=>{if(u.trigger&&u.valueNode&&g&&b&&E&&R&&N){const H=u.trigger.getBoundingClientRect(),G=b.getBoundingClientRect(),X=u.valueNode.getBoundingClientRect(),U=N.getBoundingClientRect();if(u.dir!==sj.RTL){const _e=U.left-G.left,Ce=X.left-_e,Ae=H.left-Ce,$e=H.width+Ae,Dn=Math.max($e,G.width),jt=window.innerWidth-Mn,pe=ua(Ce,[Mn,Math.max(Mn,jt-Dn)]);g.style.minWidth=$e+"px",g.style.left=pe+"px"}else{const _e=G.right-U.right,Ce=window.innerWidth-X.right-_e,Ae=window.innerWidth-H.right-Ce,$e=H.width+Ae,Dn=Math.max($e,G.width),jt=window.innerWidth-Mn,pe=ua(Ce,[Mn,Math.max(Mn,jt-Dn)]);g.style.minWidth=$e+"px",g.style.right=pe+"px"}const F=C(),J=window.innerHeight-Mn*2,I=E.scrollHeight,Y=window.getComputedStyle(b),k=parseInt(Y.borderTopWidth,10),$=parseInt(Y.paddingTop,10),L=parseInt(Y.borderBottomWidth,10),Z=parseInt(Y.paddingBottom,10),A=k+$+I+Z+L,V=Math.min(R.offsetHeight*5,A),K=window.getComputedStyle(E),ee=parseInt(K.paddingTop,10),le=parseInt(K.paddingBottom,10),ce=H.top+H.height/2-Mn,ie=J-ce,ge=R.offsetHeight/2,je=R.offsetTop+ge,be=k+$+je,de=A-be;if(be<=ce){const _e=F.length>0&&R===F[F.length-1].ref.current;g.style.bottom="0px";const Ce=b.clientHeight-E.offsetTop-E.offsetHeight,Ae=Math.max(ie,ge+(_e?le:0)+Ce+L),$e=be+Ae;g.style.height=$e+"px"}else{const _e=F.length>0&&R===F[0].ref.current;g.style.top="0px";const Ae=Math.max(ce,k+E.offsetTop+(_e?ee:0)+ge)+de;g.style.height=Ae+"px",E.scrollTop=be-ce+E.offsetTop}g.style.margin=`${Mn}px 0`,g.style.minHeight=V+"px",g.style.maxHeight=J+"px",c?.(),requestAnimationFrame(()=>y.current=!0)}},[C,u.trigger,u.valueNode,g,b,E,R,N,u.dir,c]);it(()=>O(),[O]);const[D,M]=x.useState();it(()=>{b&&M(window.getComputedStyle(b).zIndex)},[b]);const z=x.useCallback(H=>{H&&S.current===!0&&(O(),T?.(),S.current=!1)},[O,T]);return f.jsx(Aj,{scope:a,contentWrapper:g,shouldExpandOnScrollRef:y,onScrollButtonChange:z,children:f.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:f.jsx(He.div,{...s,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),iy=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,align:c="start",collisionPadding:s=Mn,...u}=r,h=hd(a);return f.jsx(Bg,{...h,...u,ref:l,align:c,collisionPadding:s,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")),[Aj,md]=Co(wo,{}),ly="SelectViewport",Mj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,nonce:c,...s}=r,u=Eo(ly,a),h=md(ly,a),g=Ie(l,u.onViewportChange),m=x.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(ps.Slot,{scope:a,children:f.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:we(s.onScroll,b=>{const v=b.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:C}=h;if(C?.current&&w){const y=Math.abs(m.current-v.scrollTop);if(y>0){const S=window.innerHeight-Mn*2,E=parseFloat(w.style.minHeight),R=parseFloat(w.style.height),N=Math.max(E,R);if(N<S){const T=N+y,O=Math.min(S,T),D=T-O;w.style.height=O+"px",w.style.bottom==="0px"&&(v.scrollTop=D>0?D:0,w.style.justifyContent="flex-end")}}}m.current=v.scrollTop})})})]})},"SelectViewport")),_j="SelectGroup",[Dj,Ij]=Co(_j),zj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,...c}=r,s=rr();return f.jsx(Dj,{scope:a,id:s,children:f.jsx(He.div,{role:"group","aria-labelledby":s,...c,ref:l})})},"SelectGroup")),Lj="SelectLabel",kj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,...c}=r,s=Ij(Lj,a);return f.jsx(He.div,{id:s.id,...c,ref:l})},"SelectLabel")),pd="SelectItem",[Hj,sy]=Co(pd),Bj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,value:c,disabled:s=!1,textValue:u,...h}=r,g=Ur(pd,a),m=Eo(pd,a),b=g.value===c,[v,w]=x.useState(u??""),[C,y]=x.useState(!1),S=An(O=>m.itemRefCallback?.(O,c,s)),E=Ie(l,S),R=rr(),N=x.useRef("touch");function T(O){g.hasConsumerStoppedPropagationRef.current=O.isPropagationStopped(),g.onUserSelect(c),g.onOpenChange(!1)}return Pe(T,"handleSelect"),f.jsx(Hj,{scope:a,value:c,disabled:s,textId:R,isSelected:b,onItemTextChange:x.useCallback(O=>{w(D=>D||(O?.textContent??"").trim())},[]),children:f.jsx(ps.ItemSlot,{scope:a,value:c,disabled:s,textValue:v,children:f.jsx(He.div,{role:"option","aria-labelledby":R,"data-highlighted":C?"":void 0,"aria-selected":b&&C,"data-state":b?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...h,ref:E,onFocus:we(h.onFocus,()=>y(!0)),onBlur:we(h.onBlur,()=>y(!1)),onClick:we(h.onClick,O=>{s||N.current!=="mouse"&&T(O)}),onPointerUp:we(h.onPointerUp,O=>{s||N.current==="mouse"&&T(O)}),onPointerDown:we(h.onPointerDown,O=>{N.current=O.pointerType}),onPointerMove:we(h.onPointerMove,O=>{N.current=O.pointerType,s?m.onItemLeave?.():N.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(h.onPointerLeave,O=>{O.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:we(h.onKeyDown,O=>{s||O.target!==O.currentTarget||m.searchRef?.current!==""&&O.key===" "||(uj.includes(O.key)&&T(O),O.key===" "&&O.preventDefault())})})})})},"SelectItem")),ys="SelectItemText",Uj=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,className:c,style:s,...u}=r,h=Ur(ys,a),g=Eo(ys,a),m=sy(ys,a),b=mj(ys,a),[v,w]=x.useState(null),C=An(T=>g.itemTextRefCallback?.(T,m.value,m.disabled)),y=Ie(l,w,m.onItemTextChange,C),S=v?.textContent,E=x.useMemo(()=>f.jsx("option",{value:m.value,disabled:m.disabled,children:S},m.value),[m.disabled,m.value,S]),{onNativeOptionAdd:R,onNativeOptionRemove:N}=b;return it(()=>(R(E),()=>N(E)),[R,N,E]),f.jsxs(f.Fragment,{children:[f.jsx(He.span,{id:m.textId,...u,ref:y}),m.isSelected&&h.valueNode&&!h.valueNodeHasChildren&&!Ci(h.value)?Dr.createPortal(u.children,h.valueNode):null]})},"SelectItemText")),Pj="SelectItemIndicator",$j=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,...c}=r;return sy(Pj,a).isSelected?f.jsx(He.span,{"aria-hidden":!0,...c,ref:l}):null},"SelectItemIndicator")),cy="SelectScrollUpButton",Gj=x.forwardRef(Pe(function(r,l){const a=Eo(cy,r.__scopeSelect),c=md(cy,r.__scopeSelect),[s,u]=x.useState(!1),h=Ie(l,c.onScrollButtonChange);return it(()=>{if(a.viewport&&a.isPositioned){let g=function(){const b=m.scrollTop>0;u(b)};Pe(g,"handleScroll");const m=a.viewport;return g(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[a.viewport,a.isPositioned]),s?f.jsx(dy,{...r,ref:h,onAutoScroll:()=>{const{viewport:g,selectedItem:m}=a;g&&m&&(g.scrollTop=g.scrollTop-m.offsetHeight)}}):null},"SelectScrollUpButton")),uy="SelectScrollDownButton",Vj=x.forwardRef(Pe(function(r,l){const a=Eo(uy,r.__scopeSelect),c=md(uy,r.__scopeSelect),[s,u]=x.useState(!1),h=Ie(l,c.onScrollButtonChange);return it(()=>{if(a.viewport&&a.isPositioned){let g=function(){const b=m.scrollHeight-m.clientHeight,v=Math.ceil(m.scrollTop)<b;u(v)};Pe(g,"handleScroll");const m=a.viewport;return g(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[a.viewport,a.isPositioned]),s?f.jsx(dy,{...r,ref:h,onAutoScroll:()=>{const{viewport:g,selectedItem:m}=a;g&&m&&(g.scrollTop=g.scrollTop+m.offsetHeight)}}):null},"SelectScrollDownButton")),dy=x.forwardRef(Pe(function(r,l){const{__scopeSelect:a,onAutoScroll:c,...s}=r,u=Eo("SelectScrollButton",a),h=x.useRef(null),g=gs(a),m=x.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return x.useEffect(()=>()=>m(),[m]),it(()=>{g().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[g]),f.jsx(He.div,{"aria-hidden":!0,...s,ref:l,style:{flexShrink:0,...s.style},onPointerDown:we(s.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(c,50))}),onPointerMove:we(s.onPointerMove,()=>{u.onItemLeave?.(),h.current===null&&(h.current=window.setInterval(c,50))}),onPointerLeave:we(s.onPointerLeave,()=>{m()})})},"SelectScrollButtonImpl")),qj="SelectBubbleInput",Yj=x.forwardRef(Pe(function({__scopeSelect:r,...l},a){const c=Ur(qj,r),{value:s,onValueChange:u,required:h,disabled:g,name:m,autoComplete:b,form:v,userSelection:w}=c,{nativeOptions:C,nativeSelectKey:y}=c,S=x.useRef(null),E=Ie(a,S),R=s??"",N=x.useRef(R),T=x.useRef(w),O=x.useRef(!1),D=Array.from(C).some(M=>(M.props.value??"")==="");return x.useEffect(()=>{const M=S.current;if(!M)return;const z=window.HTMLSelectElement.prototype,G=Object.getOwnPropertyDescriptor(z,"value").set,X=w!==null&&w!==T.current;T.current=w;const U=N.current!==R;N.current=R;const F=X&&U;if(X&&!U&&w.value!==R&&!w.hasConsumerStoppedPropagation&&G){O.current=!0;try{G.call(M,w.value),M.dispatchEvent(new Event("change",{bubbles:!0}))}finally{O.current=!1,G.call(M,R)}return}const J=F&&!w.hasConsumerStoppedPropagation;if(U&&G){const I=new Event("change",{bubbles:J});G.call(M,R),M.dispatchEvent(I)}},[R,w]),f.jsxs(He.select,{"aria-hidden":!0,required:h,tabIndex:-1,name:m,autoComplete:b,disabled:g,form:v,onChange:M=>{O.current||u(M.target.value)},...l,style:{...rp,...l.style},ref:E,defaultValue:R,children:[Ci(s)&&!D?f.jsx("option",{value:""}):null,Array.from(C)]},y)},"SelectBubbleInput"));function fy(n){return typeof n=="function"}Pe(fy,"isFunction");function Ci(n){return n===""||n===void 0}Pe(Ci,"shouldShowPlaceholder");function gd(n){const r=An(n),l=x.useRef(""),a=x.useRef(0),c=x.useCallback(u=>{const h=l.current+u;r(h);function g(m){l.current=m,window.clearTimeout(a.current),m!==""&&(a.current=window.setTimeout(()=>g(""),1e3))}Pe(g,"updateSearch"),g(h)},[r]),s=x.useCallback(()=>{l.current="",window.clearTimeout(a.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[l,c,s]}Pe(gd,"useTypeaheadSearch");function yd(n,r,l){const c=r.length>1&&Array.from(r).every(m=>m===r[0])?r[0]:r,s=l?n.indexOf(l):-1;let u=hy(n,Math.max(s,0));c.length===1&&(u=u.filter(m=>m!==l));const g=u.find(m=>m.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}Pe(yd,"findNextItem");function hy(n,r){return n.map((l,a)=>n[(r+a)%n.length])}Pe(hy,"wrapArray");var Xj=Object.defineProperty,qe=(n,r)=>Xj(n,"name",{value:r,configurable:!0}),my={Horizontal:"horizontal"},Kj={LTR:"ltr"},py=["PageUp","PageDown"],gy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},wi="Slider",[vd,Fj,Qj]=Ul(wi),[bd,qM]=vn(wi,[Qj]),[Zj,fa]=bd(wi),Wj=x.forwardRef(qe(function(r,l){const{name:a,min:c=0,max:s=100,step:u=1,orientation:h=my.Horizontal,disabled:g=!1,minStepsBetweenThumbs:m=0,preserveThumbOrder:b=!1,defaultValue:v=[c],value:w,onValueChange:C=qe(()=>{},"onValueChange"),onValueCommit:y=qe(()=>{},"onValueCommit"),inverted:S=!1,form:E,...R}=r,N=x.useRef(new Set),T=x.useRef(0),O=x.useRef(!1),[D,M]=x.useState(null),H=h===my.Horizontal?Jj:eO,[G,X]=x.useState(null),U=Ie(l,X),[F=[],J]=tr({prop:w,defaultProp:v,onChange:qe(A=>{[...N.current][T.current]?.focus({preventScroll:!0,focusVisible:O.current}),O.current=!1,C(A)},"onChange")}),I=x.useRef(F),Y=x.useRef(F);x.useEffect(()=>{const A=E?G?.ownerDocument.getElementById(E):G?.closest("form");if(A instanceof HTMLFormElement){const V=qe(()=>J(Y.current),"reset");return A.addEventListener("reset",V),()=>A.removeEventListener("reset",V)}},[G,E,J]);function k(A){const V=Oy(F,A);Z(A,V)}qe(k,"handleSlideStart");function $(A){Z(A,T.current)}qe($,"handleSlideMove");function L(){String(F)!==String(I.current)&&y(F)}qe(L,"handleSlideEnd");function Z(A,V,{commit:K}={commit:!1}){const ee=Cd(u),le=Ei(Math.round((A-c)/u)*u+c,ee),ce=ua(le,[c,s]),ie=m*u;function ge(be){const de=b?ua(ce,[be[V-1]===void 0?c:be[V-1]+ie,be[V+1]===void 0?s:be[V+1]-ie]):ce,Se=Ty(be,de,V);return Ay(Se,ie)?{nextValues:Se,changedIndex:b?V:Se.indexOf(de),hasChanged:String(Se)!==String(be)}:null}qe(ge,"getNextValues");const je=ge(F);je?.hasChanged&&M(je.nextValues),J((be=[])=>{const de=ge(be);return de?(T.current=de.changedIndex,de.hasChanged&&K&&y(de.nextValues),de.hasChanged?de.nextValues:be):be})}return qe(Z,"updateValues"),f.jsx(Zj,{scope:r.__scopeSlider,name:a,disabled:g,min:c,max:s,valueIndexToChangeRef:T,thumbs:N.current,values:F,orientation:h,form:E,userRequestedValues:D,children:f.jsx(vd.Provider,{scope:r.__scopeSlider,children:f.jsx(vd.Slot,{scope:r.__scopeSlider,children:f.jsx(H,{"aria-disabled":g,"data-disabled":g?"":void 0,...R,ref:U,onPointerDown:we(R.onPointerDown,()=>{g||(I.current=F,O.current=!1)}),min:c,max:s,inverted:S,onSlideStart:g?void 0:k,onSlideMove:g?void 0:$,onSlideEnd:g?void 0:L,onHomeKeyDown:()=>{g||(O.current=!0,Z(c,0,{commit:!0}))},onEndKeyDown:()=>{g||(O.current=!0,Z(s,F.length-1,{commit:!0}))},onStepKeyDown:({event:A,direction:V})=>{if(!g){O.current=!0;const le=py.includes(A.key)||A.shiftKey&&gy.includes(A.key)?10:1,ce=T.current,ie=F[ce],ge=My(ie,{min:c,step:u,direction:V,multiplier:le});Z(ge,ce,{commit:!0})}}})})})})},"Slider")),[vy,by]=bd(wi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Jj=x.forwardRef(qe(function(r,l){const{min:a,max:c,dir:s,inverted:u,onSlideStart:h,onSlideMove:g,onSlideEnd:m,onStepKeyDown:b,...v}=r,[w,C]=x.useState(null),y=Ie(l,C),S=x.useRef(void 0),E=yi(s),R=E===Kj.LTR,N=R&&!u||!R&&u;function T(O){const D=S.current||w.getBoundingClientRect(),M=[0,D.width],H=vs(M,N?[a,c]:[c,a]);return S.current=D,H(O-D.left)}return qe(T,"getValueFromPointer"),f.jsx(vy,{scope:r.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:f.jsx(xy,{dir:E,"data-orientation":"horizontal",...v,ref:y,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:O=>{const D=T(O.clientX);h?.(D)},onSlideMove:O=>{const D=T(O.clientX);g?.(D)},onSlideEnd:()=>{S.current=void 0,m?.()},onStepKeyDown:O=>{const M=yy[N?"from-left":"from-right"].includes(O.key);b?.({event:O,direction:M?-1:1})}})})},"SliderHorizontal")),eO=x.forwardRef(qe(function(r,l){const{min:a,max:c,inverted:s,onSlideStart:u,onSlideMove:h,onSlideEnd:g,onStepKeyDown:m,...b}=r,v=x.useRef(null),w=Ie(l,v),C=x.useRef(void 0),y=!s;function S(E){const R=C.current||v.current.getBoundingClientRect(),N=[0,R.height],O=vs(N,y?[c,a]:[a,c]);return C.current=R,O(E-R.top)}return qe(S,"getValueFromPointer"),f.jsx(vy,{scope:r.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:f.jsx(xy,{"data-orientation":"vertical",...b,ref:w,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:E=>{const R=S(E.clientY);u?.(R)},onSlideMove:E=>{const R=S(E.clientY);h?.(R)},onSlideEnd:()=>{C.current=void 0,g?.()},onStepKeyDown:E=>{const N=yy[y?"from-bottom":"from-top"].includes(E.key);m?.({event:E,direction:N?-1:1})}})})},"SliderVertical")),xy=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,onSlideStart:c,onSlideMove:s,onSlideEnd:u,onHomeKeyDown:h,onEndKeyDown:g,onStepKeyDown:m,...b}=r,v=fa(wi,a);return f.jsx(He.span,{...b,ref:l,onKeyDown:we(r.onKeyDown,w=>{w.key==="Home"?(h(w),w.preventDefault()):w.key==="End"?(g(w),w.preventDefault()):py.concat(gy).includes(w.key)&&(m(w),w.preventDefault())}),onPointerDown:we(r.onPointerDown,w=>{const C=w.target;C.setPointerCapture(w.pointerId),w.preventDefault(),v.thumbs.has(C)?C.focus({preventScroll:!0,focusVisible:!1}):c(w)}),onPointerMove:we(r.onPointerMove,w=>{w.target.hasPointerCapture(w.pointerId)&&s(w)}),onPointerUp:we(r.onPointerUp,w=>{const C=w.target;C.hasPointerCapture(w.pointerId)&&(C.releasePointerCapture(w.pointerId),u(w))})})},"SliderImpl")),tO="SliderTrack",nO=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,...c}=r,s=fa(tO,a);return f.jsx(He.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...c,ref:l})},"SliderTrack")),Sy="SliderRange",rO=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,...c}=r,s=fa(Sy,a),u=by(Sy,a),h=x.useRef(null),g=Ie(l,h),m=s.values.length,b=s.values.map(C=>Sd(C,s.min,s.max)),v=m>1?Math.min(...b):0,w=100-Math.max(...b);return f.jsx(He.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...c,ref:g,style:{...r.style,[u.startEdge]:v+"%",[u.endEdge]:w+"%"}})},"SliderRange")),oO="SliderThumb",[aO,Cy]=bd(oO),iO="SliderThumbProvider";function wy(n){const{__scopeSlider:r,name:l,children:a,internal_do_not_use_render:c}=n,s=fa(iO,r),u=Fj(r),[h,g]=x.useState(null),m=x.useMemo(()=>h?u().findIndex(E=>E.ref.current===h):-1,[u,h]),b=bi(h),v=h?!!s.form||!!h.closest("form"):!0,w=s.values[m],C=l??(s.name?s.name+(s.values.length>1?"[]":""):void 0),y=w===void 0?0:Sd(w,s.min,s.max);x.useEffect(()=>{if(h)return s.thumbs.add(h),()=>{s.thumbs.delete(h)}},[h,s.thumbs]);const S={value:w,name:C,form:s.form,isFormControl:v,index:m,thumb:h,onThumbChange:g,percent:y,size:b};return f.jsx(aO,{scope:r,...S,children:_y(c)?c(S):a})}qe(wy,"SliderThumbProvider");var xd="SliderThumbTrigger",lO=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,...c}=r,s=fa(xd,a),u=by(xd,a),{index:h,value:g,percent:m,size:b,onThumbChange:v}=Cy(xd,a),w=Ie(l,v),C=jy(h,s.values.length),y=b?.[u.size],S=y?Ry(y,m,u.direction):0;return f.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${m}% + ${S}px)`},children:f.jsx(vd.ItemSlot,{scope:a,children:f.jsx(He.span,{role:"slider","aria-label":r["aria-label"]||C,"aria-valuemin":s.min,"aria-valuenow":g,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...c,ref:w,style:g===void 0?{display:"none"}:r.style,onFocus:we(r.onFocus,()=>{s.valueIndexToChangeRef.current=h})})})})},"SliderThumbTrigger")),sO=x.forwardRef(qe(function(r,l){const{__scopeSlider:a,name:c,...s}=r;return f.jsx(wy,{__scopeSlider:a,name:c,internal_do_not_use_render:({index:u,isFormControl:h})=>f.jsxs(f.Fragment,{children:[f.jsx(lO,{...s,ref:l,__scopeSlider:a}),h?f.jsx(cO,{__scopeSlider:a},u):null]})})},"SliderThumb")),Ey="SliderBubbleInput",cO=x.forwardRef(qe(function({__scopeSlider:r,onInput:l,...a},c){const{index:s,value:u,name:h,form:g}=Cy(Ey,r),{userRequestedValues:m}=fa(Ey,r),b=x.useRef(null),v=Ie(b,c),w=x.useRef(!1),C=x.useRef(u),y=x.useRef(m),S=x.useRef(m);return x.useEffect(()=>{const E=b.current;if(!E)return;const R=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(R,"value").set,O=C.current,D=O!==u;C.current=u;const M=m!==S.current;if(S.current=m,D&&T){const z=m!==y.current;y.current=m;const H=m?.[s],G=z&&(M&&H!==O||H===u);w.current=!G;const X=new Event("input",{bubbles:!0});T.call(E,u),E.dispatchEvent(X),w.current=!1}},[s,u,m]),f.jsx(He.input,{style:{display:"none"},name:h,form:g,...a,ref:v,defaultValue:u,onInput:we(l,E=>{w.current&&E.stopPropagation()})})},"SliderBubbleInput"));function Ty(n=[],r,l){const a=[...n];return a[l]=r,a.sort((c,s)=>c-s)}qe(Ty,"getNextSortedValues");function Sd(n,r,l){const s=100/(l-r)*(n-r);return ua(s,[0,100])}qe(Sd,"convertValueToPercentage");function jy(n,r){return r>2?`Value ${n+1} of ${r}`:r===2?["Minimum","Maximum"][n]:void 0}qe(jy,"getLabel");function Oy(n,r){if(n.length===1)return 0;const l=n.map(c=>Math.abs(c-r)),a=Math.min(...l);return l.indexOf(a)}qe(Oy,"getClosestValueIndex");function Ry(n,r,l){const a=n/2,s=vs([0,50],[0,a]);return(a-s(r)*l)*l}qe(Ry,"getThumbInBoundsOffset");function Ny(n){return n.slice(0,-1).map((r,l)=>n[l+1]-r)}qe(Ny,"getStepsBetweenValues");function Ay(n,r){if(r>0){const l=Ny(n);return Math.min(...l)>=r}return!0}qe(Ay,"hasMinStepsBetweenValues");function vs(n,r){return l=>{if(n[0]===n[1]||r[0]===r[1])return r[0];const a=(r[1]-r[0])/(n[1]-n[0]);return r[0]+a*(l-n[0])}}qe(vs,"linearScale");function Cd(n){if(!Number.isFinite(n))return 0;const r=n.toString();if(r.includes("e")){const[a,c]=r.split("e"),s=a.split(".")[1]||"",u=Number(c);return Math.max(0,s.length-u)}const l=r.split(".")[1];return l?l.length:0}qe(Cd,"getDecimalCount");function Ei(n,r){const l=Math.pow(10,r);return Math.round(n*l)/l}qe(Ei,"roundValue");function My(n,{min:r,step:l,direction:a,multiplier:c}){const s=Cd(l),u=(n-r)/l,h=Math.round(u),g=Ei(h*l+r,s)===Ei(n,s);let m;return g?m=h+c*a:a>0?m=Math.ceil(u):m=Math.floor(u),Ei(m*l+r,s)}qe(My,"getNextStepValue");function _y(n){return typeof n=="function"}qe(_y,"isFunction");var uO=Object.defineProperty,bt=(n,r)=>uO(n,"name",{value:r,configurable:!0}),[wd,YM]=vn("Tooltip",[us]),bs=us(),dO="TooltipProvider",fO=700,Ed="tooltip.open",[hO,Td]=wd(dO),mO=bt(n=>{const{__scopeTooltip:r,delayDuration:l=fO,skipDelayDuration:a=300,disableHoverableContent:c=!1,children:s}=n,u=x.useRef(!0),h=x.useRef(!1),g=x.useRef(0);return x.useEffect(()=>{const m=g.current;return()=>window.clearTimeout(m)},[]),f.jsx(hO,{scope:r,isOpenDelayedRef:u,delayDuration:l,onOpen:x.useCallback(()=>{a<=0||(window.clearTimeout(g.current),u.current=!1)},[a]),onClose:x.useCallback(()=>{a<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>u.current=!0,a))},[a]),isPointerInTransitRef:h,onPointerInTransitChange:x.useCallback(m=>{h.current=m},[]),disableHoverableContent:c,children:s})},"TooltipProvider"),jd="Tooltip",[pO,Ti]=wd(jd),gO=bt(n=>{const{__scopeTooltip:r,children:l,open:a,defaultOpen:c,onOpenChange:s,disableHoverableContent:u,delayDuration:h}=n,g=Td(jd,n.__scopeTooltip),m=bs(r),[b,v]=x.useState(null),[w,C]=x.useState(void 0),y=rr(),S=x.useRef(0),E=u??g.disableHoverableContent,R=h??g.delayDuration,N=x.useRef(!1),[T,O]=tr({prop:a,defaultProp:c??!1,onChange:bt(X=>{X?(g.onOpen(),document.dispatchEvent(new CustomEvent(Ed))):g.onClose(),s?.(X)},"onChange"),caller:jd}),D=x.useMemo(()=>T?N.current?"delayed-open":"instant-open":"closed",[T]),M=x.useCallback(()=>{window.clearTimeout(S.current),S.current=0,N.current=!1,O(!0)},[O]),z=x.useCallback(()=>{window.clearTimeout(S.current),S.current=0,O(!1)},[O]),H=x.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{N.current=!0,O(!0),S.current=0},R)},[R,O]);x.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const G=w??y;return f.jsx(Lg,{...m,children:f.jsx(pO,{scope:r,contentId:G,setContentId:C,open:T,stateAttribute:D,trigger:b,onTriggerChange:v,onTriggerEnter:x.useCallback(()=>{g.isOpenDelayedRef.current?H():M()},[g.isOpenDelayedRef,H,M]),onTriggerLeave:x.useCallback(()=>{E?z():(window.clearTimeout(S.current),S.current=0)},[z,E]),onOpen:M,onClose:z,disableHoverableContent:E,children:l})})},"Tooltip"),Dy="TooltipTrigger",yO=x.forwardRef(bt(function(r,l){const{__scopeTooltip:a,"aria-describedby":c,...s}=r,u=Ti(Dy,a),h=Td(Dy,a),g=bs(a),m=x.useRef(null),b=Ie(l,m,u.onTriggerChange),v=x.useRef(!1),w=x.useRef(!1),C=x.useCallback(()=>v.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",C),[C]),f.jsx(kg,{asChild:!0,...g,children:f.jsx(He.button,{"aria-describedby":u.open?$y(c,u.contentId):c,"data-state":u.stateAttribute,...s,ref:b,onPointerMove:we(r.onPointerMove,y=>{y.pointerType!=="touch"&&!w.current&&!h.isPointerInTransitRef.current&&(u.onTriggerEnter(),w.current=!0)}),onPointerLeave:we(r.onPointerLeave,()=>{u.onTriggerLeave(),w.current=!1}),onPointerDown:we(r.onPointerDown,()=>{u.open&&u.onClose(),v.current=!0,document.addEventListener("pointerup",C,{once:!0})}),onFocus:we(r.onFocus,()=>{v.current||u.onOpen()}),onBlur:we(r.onBlur,u.onClose),onClick:we(r.onClick,u.onClose)})})},"TooltipTrigger")),Iy="TooltipPortal",[vO,bO]=wd(Iy,{forceMount:void 0}),xO=bt(n=>{const{__scopeTooltip:r,forceMount:l,children:a,container:c}=n,s=Ti(Iy,r);return f.jsx(vO,{scope:r,forceMount:l,children:f.jsx(Lr,{present:l||s.open,children:f.jsx(Du,{asChild:!0,container:c,children:a})})})},"TooltipPortal"),ji="TooltipContent",SO=x.forwardRef(bt(function(r,l){const a=bO(ji,r.__scopeTooltip),{forceMount:c=a.forceMount,side:s="top",...u}=r,h=Ti(ji,r.__scopeTooltip);return f.jsx(Lr,{present:c||h.open,children:h.disableHoverableContent?f.jsx(zy,{side:s,...u,ref:l}):f.jsx(CO,{side:s,...u,ref:l})})},"TooltipContent")),CO=x.forwardRef(bt(function(r,l){const a=Ti(ji,r.__scopeTooltip),c=Td(ji,r.__scopeTooltip),s=x.useRef(null),u=Ie(l,s),[h,g]=x.useState(null),{trigger:m,onClose:b}=a,v=s.current,{onPointerInTransitChange:w}=c,C=x.useCallback(()=>{g(null),w(!1)},[w]),y=x.useCallback((S,E)=>{const R=S.currentTarget,N={x:S.clientX,y:S.clientY},T=Ly(N,R.getBoundingClientRect()),O=ky(N,T),D=Hy(E.getBoundingClientRect()),M=Uy([...O,...D]);g(M),w(!0)},[w]);return x.useEffect(()=>()=>C(),[C]),x.useEffect(()=>{if(m&&v){const S=bt(R=>y(R,v),"handleTriggerLeave"),E=bt(R=>y(R,m),"handleContentLeave");return m.addEventListener("pointerleave",S),v.addEventListener("pointerleave",E),()=>{m.removeEventListener("pointerleave",S),v.removeEventListener("pointerleave",E)}}},[m,v,y,C]),x.useEffect(()=>{if(h){const S=bt(E=>{const R=E.target,N={x:E.clientX,y:E.clientY},T=m?.contains(R)||v?.contains(R),O=!By(N,h);T?C():O&&(C(),b())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[m,v,h,b,C]),f.jsx(zy,{...r,ref:u})},"TooltipContentHoverable")),wO=Fm("TooltipContent"),zy=x.forwardRef(bt(function(r,l){const{__scopeTooltip:a,children:c,"aria-label":s,id:u,onEscapeKeyDown:h,onPointerDownOutside:g,...m}=r,b=Ti(ji,a),v=bs(a),{onClose:w}=b,[C,y]=x.useState(null),S=Ie(l,y);zp(C),x.useEffect(()=>(document.addEventListener(Ed,w),()=>document.removeEventListener(Ed,w)),[w]),x.useEffect(()=>{if(b.trigger){const R=bt(N=>{N.target instanceof Node&&N.target.contains(b.trigger)&&w()},"handleScroll");return window.addEventListener("scroll",R,{capture:!0}),()=>window.removeEventListener("scroll",R,{capture:!0})}},[b.trigger,w]);const{setContentId:E}=b;return it(()=>(E(u),()=>{E(void 0)}),[u,E]),f.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:R=>R.preventDefault(),onDismiss:w,children:f.jsxs(Bg,{"data-state":b.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:b.contentId,...v,...m,ref:S,style:{...m.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(wO,{children:c}),s?f.jsx(x1,{id:b.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),EO=x.forwardRef(bt(function(r,l){const{__scopeTooltip:a,...c}=r,s=bs(a);return f.jsx(wT,{...s,...c,ref:l})},"TooltipArrow"));function Ly(n,r){const l=Math.abs(r.top-n.y),a=Math.abs(r.bottom-n.y),c=Math.abs(r.right-n.x),s=Math.abs(r.left-n.x);switch(Math.min(l,a,c,s)){case s:return"left";case c:return"right";case l:return"top";case a:return"bottom";default:throw new Error("unreachable")}}bt(Ly,"getExitSideFromRect");function ky(n,r,l=5){const a=[];switch(r){case"top":a.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":a.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":a.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":a.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return a}bt(ky,"getPaddedExitPoints");function Hy(n){const{top:r,right:l,bottom:a,left:c}=n;return[{x:c,y:r},{x:l,y:r},{x:l,y:a},{x:c,y:a}]}bt(Hy,"getPointsFromRect");function By(n,r){const{x:l,y:a}=n;let c=!1;for(let s=0,u=r.length-1;s<r.length;u=s++){const h=r[s],g=r[u],m=h.x,b=h.y,v=g.x,w=g.y;b>a!=w>a&&l<(v-m)*(a-b)/(w-b)+m&&(c=!c)}return c}bt(By,"isPointInPolygon");function Uy(n){const r=n.slice();return r.sort((l,a)=>l.x<a.x?-1:l.x>a.x?1:l.y<a.y?-1:l.y>a.y?1:0),Py(r)}bt(Uy,"getHull");function Py(n){if(n.length<=1)return n.slice();const r=[];for(let a=0;a<n.length;a++){const c=n[a];for(;r.length>=2;){const s=r[r.length-1],u=r[r.length-2];if((s.x-u.x)*(c.y-u.y)>=(s.y-u.y)*(c.x-u.x))r.pop();else break}r.push(c)}r.pop();const l=[];for(let a=n.length-1;a>=0;a--){const c=n[a];for(;l.length>=2;){const s=l[l.length-1],u=l[l.length-2];if((s.x-u.x)*(c.y-u.y)>=(s.y-u.y)*(c.x-u.x))l.pop();else break}l.push(c)}return l.pop(),r.length===1&&l.length===1&&r[0].x===l[0].x&&r[0].y===l[0].y?r:r.concat(l)}bt(Py,"getHullPresorted");function $y(...n){const r=new Set;for(const l of n)if(typeof l=="string")for(const a of String(l).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}bt($y,"concatAriaDescribedby");function TO({delayDuration:n=0,...r}){return f.jsx(mO,{"data-slot":"tooltip-provider",delayDuration:n,...r})}function jO({...n}){return f.jsx(gO,{"data-slot":"tooltip",...n})}function OO({...n}){return f.jsx(yO,{"data-slot":"tooltip-trigger",...n})}function RO({container:n,className:r,sideOffset:l=0,children:a,...c}){return f.jsx(xO,{container:n,children:f.jsxs(SO,{"data-slot":"tooltip-content",sideOffset:l,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(EO,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function Gy(n){return n?.closest(".rt-menu-root, .rt-main-menu-root, .ui-dialog")||document.fullscreenElement||document.getElementById("uni-answer-sheet")||document.body}function NO({children:n}){return f.jsx(TO,{delayDuration:400,children:n})}const AO={"portal-wrapper":"_portal-wrapper_1eief_1"},MO={footer:"_footer_yp9z4_1"};/**
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`
89
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
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"};/**
90
92
  * @license lucide-react v1.58.0 - ISC
91
93
  *
92
94
  * This source code is licensed under the ISC license.
93
95
  * See the LICENSE file in the root directory of this source tree.
94
- */const _O=n=>n?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
96
+ */const fA=t=>t?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
95
97
  * @license lucide-react v1.58.0 - ISC
96
98
  *
97
99
  * This source code is licensed under the ISC license.
98
100
  * See the LICENSE file in the root directory of this source tree.
99
- */function DO(n,r,l=[]){if(r==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:_O(n),size:24,node:r,...l.length>0?{aliases:l}:{}}}/**
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}:{}}}/**
100
102
  * @license lucide-react v1.58.0 - ISC
101
103
  *
102
104
  * This source code is licensed under the ISC license.
103
105
  * See the LICENSE file in the root directory of this source tree.
104
- */const IO=n=>{let r="",l=!1;for(const a of n){if(a==="-"||a==="_"||a<=" "){l=r.length>0;continue}r.length===0?r+=a.toLowerCase():r+=l?a.toUpperCase():a,l=!1}return r};/**
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};/**
105
107
  * @license lucide-react v1.58.0 - ISC
106
108
  *
107
109
  * This source code is licensed under the ISC license.
108
110
  * See the LICENSE file in the root directory of this source tree.
109
- */const zO=n=>{const r=IO(n);return r.charAt(0).toUpperCase()+r.slice(1)};/**
111
+ */const pA=t=>{const r=mA(t);return r.charAt(0).toUpperCase()+r.slice(1)};/**
110
112
  * @license lucide-react v1.58.0 - ISC
111
113
  *
112
114
  * This source code is licensed under the ISC license.
113
115
  * See the LICENSE file in the root directory of this source tree.
114
- */const Od=(...n)=>n.filter((r,l,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===l).join(" ").trim();/**
116
+ */const Pd=(...t)=>t.filter((r,i,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===i).join(" ").trim();/**
115
117
  * @license lucide-react v1.58.0 - ISC
116
118
  *
117
119
  * This source code is licensed under the ISC license.
118
120
  * See the LICENSE file in the root directory of this source tree.
119
- */const To={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 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"};/**
120
122
  * @license lucide-react v1.58.0 - ISC
121
123
  *
122
124
  * This source code is licensed under the ISC license.
123
125
  * See the LICENSE file in the root directory of this source tree.
124
- */function Rd(n){return n!=null}function LO(n,r={}){const l=r.attributeNames??{},a=w=>l[w]??w,c=n.size??n.width??To.width,s=n.size??n.height??To.height,u=n.aliases?.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`)??[],h=[...n.name?[`lucide-${n.name}`]:[],...u],g=r.className?.split(" ").filter(Boolean)??[],m=r.includeDefaultClasses===!1?Od(...g):Od("lucide",...h,...g),b=r.absoluteStrokeWidth?Number(r.strokeWidth??To["stroke-width"])*Number(n.size??n.width??To.width)/Number(r.size??r.width??To.width):r.strokeWidth??To["stroke-width"];return["svg",{...Object.entries(To).reduce((w,[C,y])=>(w[a(C)]=y,w),{}),..."color"in r&&r.color&&{[a("stroke")]:r.color},..."size"in r&&Rd(r.size)&&{[a("width")]:r.size,[a("height")]:r.size},..."width"in r&&Rd(r.width)&&{[a("width")]:r.width},..."height"in r&&Rd(r.height)&&{[a("height")]:r.height},[a("stroke-width")]:b,...m&&{[a("class")]:m},[a("viewBox")]:`0 0 ${c} ${s}`,...r.hasA11yProp===!1?{[a("aria-hidden")]:"true"}:{},..."attributes"in r&&r.attributes},n.node.map(w=>{const[C,y,S]=w,E=r.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...y}:y;return S?[C,E,S]:[C,E]})]}/**
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]})]}/**
125
127
  * @license lucide-react v1.58.0 - ISC
126
128
  *
127
129
  * This source code is licensed under the ISC license.
128
130
  * See the LICENSE file in the root directory of this source tree.
129
- */function kO(n,r={}){return LO(n,{...r,attributeNames:{...r.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
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"}})}/**
130
132
  * @license lucide-react v1.58.0 - ISC
131
133
  *
132
134
  * This source code is licensed under the ISC license.
133
135
  * See the LICENSE file in the root directory of this source tree.
134
- */const HO=n=>{for(const r in n)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},BO=x.createContext({}),UO=()=>x.useContext(BO),PO=x.forwardRef(({color:n,size:r,width:l,height:a,strokeWidth:c,absoluteStrokeWidth:s,nonScalingStroke:u,className:h="",children:g,iconNode:m=[],icon:b={node:m,aliases:[],size:24},...v},w)=>{const{size:C=24,strokeWidth:y=2,absoluteStrokeWidth:S=!1,nonScalingStroke:E=!1,color:R="currentColor",className:N=""}=UO()??{},T=!!g||HO(v),[O,D,M=[]]=kO(b,{color:n??R,width:l??r??C,height:a??r??C,strokeWidth:c??y,absoluteStrokeWidth:s??S,nonScalingStroke:u??E,className:Od(N,h),hasA11yProp:T,attributes:v});return x.createElement(O,{ref:w,...D},[...M.map(([z,H])=>x.createElement(z,H)),...Array.isArray(g)?g:[g]])});/**
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]])});/**
135
137
  * @license lucide-react v1.58.0 - ISC
136
138
  *
137
139
  * This source code is licensed under the ISC license.
138
140
  * See the LICENSE file in the root directory of this source tree.
139
- */function _n(n,r=[],l=[]){const a=typeof n=="string"?DO(n,r,l):n,c=x.forwardRef(({className:s,...u},h)=>x.createElement(PO,{ref:h,icon:a,className:s,...u}));return a.name&&(c.displayName=zO(a.name)),c}/**
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}/**
140
142
  * @license lucide-react v1.58.0 - ISC
141
143
  *
142
144
  * This source code is licensed under the ISC license.
143
145
  * See the LICENSE file in the root directory of this source tree.
144
- */const Vy={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Vy.node;const qy=_n(Vy);/**
146
+ */const u0={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};u0.node;const d0=Ln(u0);/**
145
147
  * @license lucide-react v1.58.0 - ISC
146
148
  *
147
149
  * This source code is licensed under the ISC license.
148
150
  * See the LICENSE file in the root directory of this source tree.
149
- */const Yy={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Yy.node;const Xy=_n(Yy);/**
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);/**
150
152
  * @license lucide-react v1.58.0 - ISC
151
153
  *
152
154
  * This source code is licensed under the ISC license.
153
155
  * See the LICENSE file in the root directory of this source tree.
154
- */const Ky={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};Ky.node;const $O=_n(Ky);/**
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);/**
155
157
  * @license lucide-react v1.58.0 - ISC
156
158
  *
157
159
  * This source code is licensed under the ISC license.
158
160
  * See the LICENSE file in the root directory of this source tree.
159
- */const Fy={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Fy.node;const GO=_n(Fy);/**
161
+ */const p0={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};p0.node;const wA=Ln(p0);/**
160
162
  * @license lucide-react v1.58.0 - ISC
161
163
  *
162
164
  * This source code is licensed under the ISC license.
163
165
  * See the LICENSE file in the root directory of this source tree.
164
- */const Qy={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};Qy.node;const VO=_n(Qy);/**
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);/**
165
167
  * @license lucide-react v1.58.0 - ISC
166
168
  *
167
169
  * This source code is licensed under the ISC license.
168
170
  * See the LICENSE file in the root directory of this source tree.
169
- */const Zy={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"}]]};Zy.node;const qO=_n(Zy);/**
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);/**
170
172
  * @license lucide-react v1.58.0 - ISC
171
173
  *
172
174
  * This source code is licensed under the ISC license.
173
175
  * See the LICENSE file in the root directory of this source tree.
174
- */const Wy={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"}]]};Wy.node;const YO=_n(Wy);/**
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);/**
175
177
  * @license lucide-react v1.58.0 - ISC
176
178
  *
177
179
  * This source code is licensed under the ISC license.
178
180
  * See the LICENSE file in the root directory of this source tree.
179
- */const Jy={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};Jy.node;const XO=_n(Jy);/**
181
+ */const x0={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};x0.node;const AA=Ln(x0);/**
180
182
  * @license lucide-react v1.58.0 - ISC
181
183
  *
182
184
  * This source code is licensed under the ISC license.
183
185
  * See the LICENSE file in the root directory of this source tree.
184
- */const ev={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"]};ev.node;const KO=_n(ev);/**
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);/**
185
187
  * @license lucide-react v1.58.0 - ISC
186
188
  *
187
189
  * This source code is licensed under the ISC license.
188
190
  * See the LICENSE file in the root directory of this source tree.
189
- */const tv={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};tv.node;const FO=_n(tv);/**
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);/**
190
192
  * @license lucide-react v1.58.0 - ISC
191
193
  *
192
194
  * This source code is licensed under the ISC license.
193
195
  * See the LICENSE file in the root directory of this source tree.
194
- */const nv={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};nv.node;const QO=_n(nv),Nd={"scale-wrapper":"_scale-wrapper_qmn4q_1",bar:"_bar_qmn4q_8",percent:"_percent_qmn4q_19"},rv={"press-wrapper":"_press-wrapper_1m46f_1",active:"_active_1m46f_8"};var Ad={exports:{}};/*!
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:{}};/*!
195
197
  Copyright (c) 2018 Jed Watson.
196
198
  Licensed under the MIT License (MIT), see
197
199
  http://jedwatson.github.io/classnames
198
- */var ov;function ZO(){return ov||(ov=1,(function(n){(function(){var r={}.hasOwnProperty;function l(){for(var s="",u=0;u<arguments.length;u++){var h=arguments[u];h&&(s=c(s,a(h)))}return s}function a(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return l.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var u="";for(var h in s)r.call(s,h)&&s[h]&&(u=c(u,h));return u}function c(s,u){return u?s?s+" "+u:s+u:s}n.exports?(l.default=l,n.exports=l):window.classNames=l})()})(Ad)),Ad.exports}var WO=ZO();const av=hm(WO),iv=n=>{const{padding:r="",active:l=!1,className:a,...c}=n,s=x.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:av(a,rv["press-wrapper"],l?rv.active:""),style:{padding:s},children:n.children})};function lv({title:n,children:r}){const[l,a]=x.useState(null);return f.jsxs(jO,{children:[f.jsx(OO,{asChild:!0,children:f.jsx("span",{ref:a,className:"ui-tooltip-trigger",children:r})}),f.jsx(RO,{container:Gy(l),className:"ui-tooltip",side:"top",sideOffset:6,children:n})]})}const JO={"icon-quanping":qO,"icon-quxiaoquanping":YO,"icon-shitudaohang":KO},sv=n=>{const{type:r,children:l,tooltip:a,...c}=n,s=JO[r];return a?f.jsx(lv,{title:a,children:f.jsx(iv,{...c,children:f.jsx(s,{size:14,"aria-hidden":"true"})})}):f.jsx(iv,{...c,children:f.jsx(s,{size:14,"aria-hidden":"true"})})};function eR({className:n,type:r,...l}){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",n),...l})}function tR({className:n,...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",n),...r})}const Oi=x.forwardRef(function({className:r,controlSize:l,size:a,status:c,...s},u){return f.jsx(eR,{...s,ref:u,"aria-invalid":c==="error"||s["aria-invalid"],"data-control-size":l||(a==="small"?"compact":a),className:Ve("ui-control ui-input",r)})});function xs({autoSize:n,className:r,...l}){const a=x.useRef(null);return x.useLayoutEffect(()=>{const c=a.current;if(!c||!n)return;const s=getComputedStyle(c),u=parseFloat(s.lineHeight)||20,h=parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)+2;c.style.height="0px",c.style.height=`${Math.max(n.minRows*u+h,Math.min(n.maxRows*u+h,c.scrollHeight+2))}px`},[l.value,n]),f.jsx(tR,{...l,ref:a,className:Ve("ui-control ui-textarea",r)})}function nR({...n}){return f.jsx(pj,{"data-slot":"select",...n})}function rR({...n}){return f.jsx(zj,{"data-slot":"select-group",...n})}function oR({...n}){return f.jsx(bj,{"data-slot":"select-value",...n})}function aR({className:n,size:r="default",children:l,...a}){return f.jsxs(yj,{"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",n),...a,children:[l,f.jsx(xj,{asChild:!0,children:f.jsx(Xy,{className:"size-4 opacity-50"})})]})}function iR({container:n,className:r,children:l,position:a="item-aligned",align:c="center",...s}){return f.jsx(Ej,{container:n,children:f.jsxs(Tj,{"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,...s,children:[f.jsx(cR,{}),f.jsx(Mj,{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:l}),f.jsx(uR,{})]})})}function lR({className:n,...r}){return f.jsx(kj,{"data-slot":"select-label",className:Ve("px-2 py-1.5 text-xs text-muted-foreground",n),...r})}function sR({className:n,children:r,...l}){return f.jsxs(Bj,{"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",n),...l,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx($j,{children:f.jsx(qy,{className:"size-4"})})}),f.jsx(Uj,{children:r})]})}function cR({className:n,...r}){return f.jsx(Gj,{"data-slot":"select-scroll-up-button",className:Ve("flex cursor-default items-center justify-center py-1",n),...r,children:f.jsx($O,{className:"size-4"})})}function uR({className:n,...r}){return f.jsx(Vj,{"data-slot":"select-scroll-down-button",className:Ve("flex cursor-default items-center justify-center py-1",n),...r,children:f.jsx(Xy,{className:"size-4"})})}function Md(n){return x.Children.toArray(n).flatMap(r=>x.isValidElement(r)?r.type===x.Fragment?Md(r.props.children):r.type==="optgroup"?[{label:r.props.label,options:Md(r.props.children)}]:[{value:String(r.props.value??r.props.children??""),label:r.props.children,disabled:r.props.disabled}]:[])}const Ss="__empty_option__";function cv(n,r){return n.map((l,a)=>l.options?f.jsxs(rR,{children:[f.jsx(lR,{children:l.label}),cv(l.options,r)]},a):f.jsx(sR,{value:String(l.value)||Ss,disabled:l.disabled,"data-option-value":l.value,onKeyDown:c=>{c.key==="Enter"&&!l.disabled&&(c.preventDefault(),r(String(l.value)||Ss))},children:l.label},String(l.value)))}function Vt({className:n,controlSize:r,size:l,children:a,options:c,value:s,onChange:u,disabled:h,...g}){const m=x.useRef(null),[b,v]=x.useState(!1),w=y=>{if(y){v(!0);return}const S=!!document.activeElement?.closest('[data-slot="select-content"]');Dr.flushSync(()=>v(!1)),S&&m.current?.focus({preventScroll:!0})},C=y=>{w(!1),u?.(y===Ss?"":y)};return f.jsxs(nR,{value:s===void 0?void 0:String(s)||Ss,onValueChange:C,disabled:h,open:b,onOpenChange:w,children:[f.jsx(aR,{...g,ref:m,className:Ve("ui-control ui-select",n),"data-value":s===void 0?"":String(s),"data-control-size":r||(l==="small"?"compact":l),children:f.jsx(oR,{})}),f.jsx(iR,{container:Gy(m.current),position:"popper",align:"start",className:"ui-select-popup",onCloseAutoFocus:y=>y.preventDefault(),onEscapeKeyDown:y=>{y.preventDefault(),y.stopPropagation(),w(!1)},children:cv(c||Md(a),C)})]})}const uv=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,dv=jm,dR=((n,r)=>l=>{var a;if(r?.variants==null)return dv(n,l?.class,l?.className);const{variants:c,defaultVariants:s}=r,u=Object.keys(c).map(m=>{const b=l?.[m],v=s?.[m];if(b===null)return null;const w=uv(b)||uv(v);return c[m][w]}),h=l&&Object.entries(l).reduce((m,b)=>{let[v,w]=b;return w===void 0||(m[v]=w),m},{}),g=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((m,b)=>{let{class:v,className:w,...C}=b;return Object.entries(C).every(y=>{let[S,E]=y;return Array.isArray(E)?E.includes({...s,...h}[S]):{...s,...h}[S]===E})?[...m,v,w]:m},[]);return dv(n,u,g,l?.class,l?.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 fv({className:n,variant:r="default",size:l="default",asChild:a=!1,...c}){const s=a?u1:"button";return f.jsx(s,{"data-slot":"button","data-variant":r,"data-size":l,className:Ve(dR({variant:r,size:l,className:n})),...c})}function ue({type:n="default",htmlType:r="button",size:l="middle",danger:a,loading:c,className:s,children:u,...h}){return f.jsxs(fv,{variant:n==="primary"?"default":n==="text"?"ghost":"outline",size:l==="small"?"xs":l==="large"?"lg":"sm",...h,type:r,disabled:h.disabled||c,"aria-busy":c||void 0,className:Ve("ui-button",a&&"ui-danger",s),children:[c&&f.jsx(VO,{className:"animate-spin","aria-hidden":"true"}),u]})}function fR({className:n,...r}){return f.jsx(rE,{"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",n),...r,children:f.jsx(aE,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(qy,{className:"size-3.5"})})})}function qt({children:n,className:r,onChange:l,id:a,...c}){const s=x.useId();return f.jsxs("label",{className:Ve("ui-checkbox-label",r),htmlFor:a||s,children:[f.jsx(fR,{...c,id:a||s,className:"ui-checkbox",onCheckedChange:u=>l?.({target:{checked:u===!0}})}),n&&f.jsx("span",{children:n})]})}function ha({value:n,onChange:r,precision:l,className:a,onBlur:c,...s}){const[u,h]=x.useState(n==null?"":String(n));return x.useEffect(()=>{h(n==null?"":String(n))},[n]),f.jsx(Oi,{...s,type:"number",inputMode:"decimal",className:Ve("ui-number",a),value:u,onChange:g=>{const m=g.target.value;h(m),m?Number.isFinite(Number(m))&&r?.(Number(m)):r?.(null)},onBlur:g=>{const m=Number(u),b=u&&Number.isFinite(m)&&l!==void 0?String(Number(m.toFixed(l))):u;h(n==null?"":b||String(n)),c?.(g)}})}function hR({...n}){return f.jsx(Bw,{"data-slot":"dialog",...n})}function mR({...n}){return f.jsx(Pw,{"data-slot":"dialog-portal",...n})}function pR({...n}){return f.jsx(Vu,{"data-slot":"dialog-close",...n})}function gR({className:n,...r}){return f.jsx($w,{"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",n),...r})}function yR({className:n,children:r,showCloseButton:l=!0,portal:a=!0,overlay:c=!0,...s}){const u=f.jsxs(x.Fragment,{children:[c&&f.jsx(gR,{className:"ui-dialog-overlay"}),f.jsxs(qw,{"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",n),...s,children:[r,l&&f.jsxs(Vu,{"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(QO,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]});return a?f.jsx(mR,{children:u}):u}function vR({className:n,...r}){return f.jsx("div",{"data-slot":"dialog-header",className:Ve("flex flex-col gap-2 text-center sm:text-left",n),...r})}function bR({className:n,showCloseButton:r=!1,children:l,...a}){return f.jsxs("div",{"data-slot":"dialog-footer",className:Ve("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...a,children:[l,r&&f.jsx(Vu,{asChild:!0,children:f.jsx(fv,{variant:"outline",children:"Close"})})]})}function xR({className:n,...r}){return f.jsx(Kw,{"data-slot":"dialog-title",className:Ve("text-lg leading-none font-semibold",n),...r})}function Cs({open:n,modal:r=!0,panelRef:l,width:a=460,zIndex:c=900,className:s,title:u,footer:h,children:g,classNames:m,closeLabel:b,closeIcon:v,onCancel:w,onOpenAutoFocus:C,onEscapeKeyDown:y,wrapProps:S}){const E=x.useId(),R=x.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return f.jsx(hR,{open:n,modal:r,onOpenChange:N=>{N||w()},children:f.jsxs(yR,{...S,ref:l,portal:!1,overlay:r,showCloseButton:!1,"aria-describedby":void 0,"aria-labelledby":E,"aria-modal":r,className:Ve("ui-dialog",s),style:{width:a,zIndex:c},onInteractOutside:N=>N.preventDefault(),onOpenAutoFocus:C,onEscapeKeyDown:N=>{if(!r&&N.target instanceof Element&&!N.target.closest(".ui-dialog")){N.preventDefault();return}y?.(N)},onCloseAutoFocus:N=>{N.preventDefault(),r&&R.current?.isConnected&&R.current.focus({preventScroll:!0})},children:[f.jsxs("div",{className:"ui-dialog-surface",children:[f.jsx(vR,{className:Ve("ui-dialog-header",m?.header),children:f.jsx(xR,{asChild:!0,id:E,children:f.jsx("div",{className:"ui-dialog-title",children:u})})}),f.jsx("div",{className:Ve("ui-dialog-body",m?.body),children:g}),h&&f.jsx(bR,{className:Ve("ui-dialog-footer",m?.footer),children:h})]}),f.jsx(pR,{"aria-label":b,className:"ui-dialog-close",children:v})]})})}function SR({className:n,...r}){return f.jsx(ej,{"data-slot":"radio-group",className:Ve("grid gap-3",n),...r})}function CR({children:n,indicator:r=!0,className:l,...a}){return f.jsxs(oj,{"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",l),...a,children:[r&&f.jsx(ij,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(GO,{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary"})}),n]})}function wR(n){return null}function ER({value:n,onChange:r,children:l,className:a,name:c,disabled:s}){const u=x.Children.toArray(l).filter(x.isValidElement);return f.jsx(SR,{name:c,disabled:s,className:Ve("ui-radio-group",a),value:String(n),onValueChange:h=>{const g=u.find(m=>String(m.props.value)===h);g&&r({target:{value:g.props.value}})},children:u.map(({props:h})=>f.jsx(CR,{value:String(h.value),disabled:h.disabled,className:"ui-radio-option",indicator:!1,children:h.children},String(h.value)))})}const ht={Group:ER,Button:wR};function TR({thumbLabel:n,className:r,defaultValue:l,value:a,min:c=0,max:s=100,...u}){const h=x.useMemo(()=>Array.isArray(a)?a:Array.isArray(l)?l:[c,s],[a,l,c,s]);return f.jsxs(Wj,{"data-slot":"slider",defaultValue:l,value:a,min:c,max:s,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(nO,{"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(rO,{"data-slot":"slider-range",className:Ve("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:h.length},(g,m)=>f.jsx(sO,{"data-slot":"slider-thumb","aria-label":n,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"},m))]})}function hv({value:n,onChange:r,ariaLabelForHandle:l,...a}){return f.jsx(TR,{...a,value:[n],onValueChange:c=>r(c[0]),thumbLabel:l})}const mv=n=>{let r;const l=new Set,a=(m,b)=>{const v=typeof m=="function"?m(r):m;if(!Object.is(v,r)){const w=r;r=b??(typeof v!="object"||v===null)?v:Object.assign({},r,v),l.forEach(C=>C(r,w))}},c=()=>r,h={setState:a,getState:c,getInitialState:()=>g,subscribe:m=>(l.add(m),()=>l.delete(m))},g=r=n(a,c,h);return h},jR=(n=>n?mv(n):mv),OR=n=>n;function RR(n,r=OR){const l=hi.useSyncExternalStore(n.subscribe,hi.useCallback(()=>r(n.getState()),[n,r]),hi.useCallback(()=>r(n.getInitialState()),[n,r]));return hi.useDebugValue(l),l}const pv=n=>{const r=jR(n),l=a=>RR(r,a);return Object.assign(l,r),l},NR=(n=>n?pv(n):pv),ws={min:20,max:150},gv={width:4e3,height:2e3},yv={width:210,height:297},jo=NR((n,r)=>({scale:100,navigatorVisible:!0,setScale:l=>n(a=>({...a,scale:Math.max(ws.min,Math.min(ws.max,Math.round(l)))})),getScale:()=>r().scale,setNavigatorVisible:l=>n(a=>({...a,navigatorVisible:l}))})),AR=()=>{const{scale:n,setScale:r,getScale:l}=jo(),a=c=>r(l()+c);return x.useEffect(()=>{const c=document.getElementById("answer-sheet-stadio"),s=h=>{if(!h.ctrlKey)return;h.preventDefault();const g=document.getElementById("answer-sheet"),m=g.getBoundingClientRect(),b=(h.clientX-m.left)/m.width,v=(h.clientY-m.top)/m.height;Dr.flushSync(()=>r(l()+(h.deltaY<0?5:-5)));const w=g.getBoundingClientRect();c.scrollLeft+=w.left+b*w.width-h.clientX,c.scrollTop+=w.top+v*w.height-h.clientY},u=h=>{(h.ctrlKey||h.metaKey)&&(h.key==="+"||h.key==="="||h.key==="-")&&(h.preventDefault(),r(l()+(h.key==="-"?-10:10)))};return c.addEventListener("wheel",s,{passive:!1}),window.addEventListener("keydown",u),()=>{c.removeEventListener("wheel",s),window.removeEventListener("keydown",u)}},[l,r]),f.jsxs("div",{className:Nd["scale-wrapper"],"aria-label":"工作区缩放",children:[f.jsx(ue,{type:"text",size:"small","aria-label":"缩小",onClick:()=>a(-2),children:f.jsx(XO,{})}),f.jsx(hv,{className:Nd.bar,ariaLabelForHandle:"缩放比例",min:ws.min,max:ws.max,step:1,value:n,onChange:r}),f.jsx(ue,{type:"text",size:"small","aria-label":"放大",onClick:()=>a(2),children:f.jsx(FO,{})}),f.jsx(lv,{title:"重置缩放",children:f.jsxs("div",{role:"button",tabIndex:0,"aria-label":"重置缩放",onClick:()=>r(100),onKeyDown:c=>{c.key==="Enter"&&r(100)},className:av("font-12 grey ml-5 pointer",Nd.percent),children:[n,"%"]})})]})},MR=()=>{const[n,r]=x.useState(!1);x.useEffect(()=>{const a=()=>r(document.fullscreenElement===document.getElementById("uni-answer-sheet"));return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]);const l=async()=>{try{document.fullscreenElement?await document.exitFullscreen():await document.getElementById("uni-answer-sheet").requestFullscreen()}catch{}};return f.jsx(sv,{type:n?"icon-quxiaoquanping":"icon-quanping",className:"ml-5",padding:[0,5],role:"button",tabIndex:0,"aria-label":n?"取消全屏":"全屏",tooltip:n?"取消全屏":"全屏",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),l())},onClick:l})},_R=({summary:n})=>{const{navigatorVisible:r,setNavigatorVisible:l}=jo();return f.jsxs("div",{className:MO.footer,"aria-label":"工作区底栏",children:[f.jsx("div",{className:"font-12 grey",children:n}),f.jsxs("div",{children:[f.jsx(sv,{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(),l(!r))},className:"mr-5",onClick:()=>l(!r)}),f.jsx(AR,{}),f.jsx(MR,{})]})]})},vv={"stadio-wrapper":"_stadio-wrapper_jknpq_1",container:"_container_jknpq_15"},DR=({width:n=ho(yv.width),height:r=ho(yv.height),children:l})=>{const{scale:a}=jo();return f.jsx("div",{id:"answer-sheet",style:{transform:`scale(${a/100})`,height:r,width:n},children:l})};var Ri=(n=>(n.STADIO_SCROLL_CHANGE="STADIO_SCROLL_CHANGE",n))(Ri||{});class IR{constructor(){Qh(this,"callbacks",new Map)}on(r,l){this.callbacks.set(r,l)}emit(r,...l){const a=this.callbacks.get(r);a&&a(l)}depose(r){this.callbacks.delete(r)}}const Es=new IR,zR=({width:n,height:r,children:l,onBackgroundClick:a})=>{const c=x.useRef(null),s=x.useRef(null),{scale:u}=jo(),h=u/100,g=Math.max(gv.width,n*h+600),m=Math.max(gv.height,r*h+600),b=x.useRef(null);return x.useLayoutEffect(()=>{const v=s.current,w=(g-n*h)/2,C=(m-r*h)/2,y=b.current;if(!y||y.width!==n)v.scrollLeft=Math.max(0,w+n*h/2-v.clientWidth/2),v.scrollTop=Math.max(0,C-54);else{const S=(v.scrollLeft+v.clientWidth/2-y.left)/y.zoom,E=(v.scrollTop+v.clientHeight/2-y.top)/y.zoom;v.scrollLeft=w+S*h-v.clientWidth/2,v.scrollTop=C+E*h-v.clientHeight/2}b.current={left:w,top:C,zoom:h,width:n},Es.emit(Ri.STADIO_SCROLL_CHANGE)},[g,m,n,r,h]),x.useEffect(()=>{const v=s.current,w=c.current;let C=()=>{};const y=E=>{if(E.button!==1)return;E.preventDefault(),C();const R=E.clientX,N=E.clientY,T=v.scrollLeft,O=v.scrollTop,D=document.body.style.cursor;document.body.style.cursor="grabbing";const M=H=>v.scrollTo({left:T-H.clientX+R,top:O-H.clientY+N}),z=H=>{H.button===1&&C()};C=()=>{document.body.style.cursor=D,window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",z),window.removeEventListener("blur",C)},window.addEventListener("mousemove",M),window.addEventListener("mouseup",z),window.addEventListener("blur",C)},S=()=>Es.emit(Ri.STADIO_SCROLL_CHANGE);return w.addEventListener("mousedown",y),v.addEventListener("scroll",S),()=>{C(),w.removeEventListener("mousedown",y),v.removeEventListener("scroll",S)}},[]),f.jsx("div",{className:vv["stadio-wrapper"],ref:s,id:"answer-sheet-stadio","aria-label":"制卡工作区",children:f.jsx("div",{className:vv.container,ref:c,id:"answer-sheet-container",style:{height:m,width:g},onPointerDown:v=>{v.target===v.currentTarget&&a?.()},children:f.jsx(DR,{width:n,height:r,children:l})})})},_d={"navigator-wrapper":"_navigator-wrapper_rb3fn_1","fake-page":"_fake-page_rb3fn_12",viewport:"_viewport_rb3fn_17"},LR=()=>{const{scale:n}=jo(),[r,l]=x.useState({ratio:20,width:200,height:100,view:{x:0,y:0,width:0,height:0},pages:[]}),a=x.useRef(null),c=x.useRef(()=>{});return x.useEffect(()=>{const s=document.getElementById("answer-sheet-stadio"),u=document.getElementById("answer-sheet-container"),h=document.getElementById("answer-sheet");let g=0;const m=()=>{const w=Math.max(20,u.offsetWidth/200,u.offsetHeight/160),C=u.getBoundingClientRect(),y=Array.from(h.querySelectorAll("[data-paper-page]")),S=(y.length?y:[h]).map(R=>{const N=R.getBoundingClientRect();return{x:(N.left-C.left)/w,y:(N.top-C.top)/w,width:N.width/w,height:N.height/w}}),E={ratio:w,width:u.offsetWidth/w,height:u.offsetHeight/w,view:{x:s.scrollLeft/w,y:s.scrollTop/w,width:s.clientWidth/w,height:s.clientHeight/w},pages:S};l(R=>JSON.stringify(R)===JSON.stringify(E)?R:E)},b=()=>{cancelAnimationFrame(g),g=requestAnimationFrame(m)};c.current=b;const v=new ResizeObserver(b);return[s,u,h].forEach(w=>v.observe(w)),Es.on(Ri.STADIO_SCROLL_CHANGE,b),b(),()=>{c.current=()=>{},cancelAnimationFrame(g),v.disconnect(),Es.depose(Ri.STADIO_SCROLL_CHANGE)}},[]),x.useLayoutEffect(()=>{c.current()},[n]),f.jsxs("div",{className:_d["navigator-wrapper"],"aria-label":"视图导航",style:{width:r.width,height:r.height},children:[r.pages.map((s,u)=>f.jsx("div",{className:_d["fake-page"],"data-nav-page":u+1,style:{left:s.x,top:s.y,width:s.width,height:s.height}},u)),f.jsx("div",{className:_d.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:s=>{if(s.button!==0)return;s.preventDefault();const u=document.getElementById("answer-sheet-stadio");a.current={x:s.clientX,y:s.clientY,left:u.scrollLeft,top:u.scrollTop},s.currentTarget.setPointerCapture(s.pointerId)},onPointerMove:s=>{if(!a.current)return;document.getElementById("answer-sheet-stadio").scrollTo({left:a.current.left+(s.clientX-a.current.x)*r.ratio,top:a.current.top+(s.clientY-a.current.y)*r.ratio})},onPointerUp:s=>{a.current=null,s.currentTarget.releasePointerCapture(s.pointerId)},onLostPointerCapture:()=>{a.current=null},onKeyDown:s=>{const h={ArrowLeft:[-80,0],ArrowRight:[80,0],ArrowUp:[0,-80],ArrowDown:[0,80]}[s.key];h&&(s.preventDefault(),document.getElementById("answer-sheet-stadio").scrollBy({left:h[0],top:h[1]}))}})]})},bv=x.createContext(null),Dd=x.forwardRef((n,r)=>{const l=x.useContext(bv);if(!l)throw new Error("制卡需要显式注册富文本插件");const a=x.useRef(null),c=x.useRef(null),s=x.useRef(n);s.current=n;const u=x.useRef(null),h=x.useRef(null),g=x.useRef(!1),m=x.useRef(0),b=()=>({...s.current,onChange:w=>s.current.onChange?.(w),onLayout:w=>s.current.onLayout?.(w),onContentSelect:w=>s.current.onContentSelect?.(w)}),v=w=>{const C=c.current,y=++m.current;C&&C.ready.then(()=>{let S=0;const E=()=>{y!==m.current||c.current!==C||s.current.readOnly||(C.getStatus().editable?w(C):++S<120&&requestAnimationFrame(E))};requestAnimationFrame(E)}).catch(S=>{h.current=S})};return x.useImperativeHandle(r,()=>({getDocument:()=>g.current?c.current.getDocument():null,getAnswerRegions:()=>g.current?c.current.getAnswerRegions():[],setDocument(w){g.current?c.current.setDocument(w):u.current=w},syncDocument(w){g.current?c.current.syncDocument(w):u.current=w},focus:w=>v(C=>C.focus(w)),focusContent:w=>s.current.contentTargets?.some(C=>C.id===w)?(v(C=>{C.focusContent(w)||C.focus("start")}),!0):!1,insertAnswerRegion:(w,C,y)=>v(S=>S.insertAnswerRegion(w,C,y)),getStatus(){if(h.current)throw h.current;return g.current?c.current.getStatus():{ready:!1,editable:!1,composing:!1,uploading:!1,layoutPending:!0}}}),[]),x.useEffect(()=>{let w=!0;h.current=null;const C=document.createElement("div");C.style.display="contents",a.current.append(C);const y=l.create(C,b());return c.current=y,y.ready.then(()=>{w&&(g.current=!0,y.setOptions(b()),u.current&&(y.syncDocument(u.current),u.current=null))}).catch(S=>{w&&(h.current=S)}),()=>{w=!1,g.current=!1,c.current=null,m.current++,C.remove(),queueMicrotask(()=>y.destroy())}},[l]),x.useEffect(()=>{c.current?.setOptions(b())}),f.jsx("div",{ref:a,"data-card-editor-host":"",style:{display:"contents"}})}),xv={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 kR(n){if(n.reference||!n.exercise)return n;const r=n.exercise,l=xv[n.kind]||"SHORTANSWER",a=tu(l);return a.fillNewLine=r.fillNewLine,a.optional=n.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 s=l==="MIXED"?c.kind==="choice"?c.choice.multiple?"MCHOICE":"SCHOICE":xv[c.kind]||"SHORTANSWER":l,u=s==="MIXED"?"SHORTANSWER":s,h=ru({...nu(u),partCount:1,optionCount:u==="JUDGE"?2:c.choice.options.length,score:c.score},Number(c.label)||1);if(h.id=c.id,h.label=c.label,h.document=c.document,h.choice={...Wo(c.choice,u,u==="JUDGE"?2:Math.min(u==="CHUNK_CHOICE"?26:12,c.choice.options.length)),id:c.id,label:c.label},h.characters=Math.min(1200,Math.max(1,c.area.rows*c.area.columns)),h.lines=Math.min(100,Math.max(1,c.area.rows)),h.height=Math.max(30,c.area.rows*c.area.rowHeight),u==="FILLBLANK"||u==="TEXT_COMPLETION")h.parts=c.blanks.map((g,m)=>({...ui(c.blanks.length===1?c.label:`${c.label}.${m+1}`,g.score,u),id:g.id,width:g.width,breakAfter:g.breakAfter})),h.score=Un(h.parts);else if(u==="SHORTANSWER")h.parts=[{...ui(c.label,c.score,u),document:c.document,height:h.height}];else if(ke(u)){const g=ui(c.label,c.score,u,c.choice.options.length);h.parts=[{...g,choice:{...h.choice,id:g.id}}]}return["SHORTANSWER","CCOMPOSITION","ECOMPOSITION"].includes(u)&&(h.document={...h.document,content:{...h.document.content,content:[...ii(h.label,h.score).content.content,...h.document.content.content||[]]}},h.parts=h.parts.map(g=>({...g,document:{...g.document,content:{...g.document.content,content:[...ii(g.label,g.score).content.content,...g.document.content.content||[]]}}}))),h}),{...n,reference:a}}const fr="reference-merged-objective";function HR(n,r){const l=n.blocks.map(h=>h.reference&&n.choiceDirection&&n.choiceDirection!==h.reference.layout.direction?{...h,reference:{...h.reference,layout:{...h.reference.layout,direction:n.choiceDirection}}}:h);if(!n.mergeObjective)return l;const a=l.find(h=>h.reference?.questions.some(g=>Ct(g.type)));if(!a?.reference)return l;const c=l.flatMap(h=>{if(!h.reference)return[];const g=Ko({...h.reference.layout,questions:Jo(h.reference)},h.document,n.questionCard!==!1||r===h.id).concentrated,m=new Set(g.questions.map(b=>b.id));return h.reference.questions.filter(b=>Ct(b.type)).flatMap(b=>{if(!ke(b.type))return m.has(b.id)?[b]:[];const v=b.parts.filter(w=>m.has(w.id));return v.length?[{...b,parts:v}]:[]})});if(!c.length)return l;const s={...a,id:fr,document:Bt(),reference:{...tu("MIXED"),layout:{...a.reference.layout,presentation:"concentrated"},questions:c}},u=l.flatMap(h=>{if(!h.reference)return[h];const g=h.reference.questions.filter(b=>!Ct(b.type)),m=n.questionCard!==!1&&!pn(h.document)||r===h.id;return!g.length&&!m&&h.reference.questions.length?[]:[h]});return[s,...u]}function Sv(n){const r=n.reference;if(!r)return[];const l=r.type==="MIXED"?[{id:n.id,label:"公共材料",kind:"material"}]:[];return r.questions.forEach(a=>{const c=ke(a.type);l.push({id:a.id,label:c?`第 ${a.parts.map(s=>s.label).join("、")} 题材料`:`第 ${a.label} 题题干`,kind:c?"material":"question",choice:!c&&Ct(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="JUDGE"}),a.parts.filter(s=>r.textVersion!==1||s.text).forEach(s=>l.push({id:s.id,label:`第 ${s.label} ${a.type==="FILLBLANK"?"空":"题"}`,kind:"question",parentId:a.id,choice:c&&Ct(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}))}),l}function Cv(n,r){return{...n,attrs:{...n.attrs,contentId:r}}}function BR(n,r,l){const a=new Map(r.questions.filter(u=>si(u.type)).flatMap(u=>u.parts).map(u=>[u.id,u])),c=u=>{const h=u.type==="answerLine"&&a.get(u.attrs?.id),g=h&&Math.max(24,Math.min(600,l*h.width/100));if(h&&(u.attrs?.label!==h.label||u.attrs?.width!==g))return{...u,attrs:{...u.attrs,label:h.label,width:g}};const m=u.content?.map(c);return m?.some((b,v)=>b!==u.content[v])?{...u,content:m}:u},s=c(n.content);return s===n.content?n:{...n,content:s}}function UR(n){if(!n.reference)return n.document;const r=new Map;n.reference.questions.forEach(c=>{[c.choice,...c.parts.map(s=>s.choice)].forEach(s=>{s.contentTarget&&r.set(s.contentTarget.groupId,s.id)})});let l=!1;const a=n.document.content.content?.map(c=>{if(c.attrs?.contentId)return c;let s;const u=h=>{h.type==="choiceGroup"&&(s=r.get(h.attrs?.id)||s),h.type==="choiceStemAnchor"&&(s=r.get(h.attrs?.groupId)||s),h.content?.forEach(u)};return u(c),s?(l=!0,Cv(c,s)):c});return l?{...n.document,content:{...n.document.content,content:a}}:n.document}function PR(n,r,l){const a=E=>E.questions.flatMap(R=>[R.id,...R.parts.map(N=>N.id)]),c=new Set(a(r)),s=new Set(a(l)),u=new Set([...c].filter(E=>!s.has(E)));let h=!1;const g=E=>{if(u.has(E.attrs?.contentId)||E.type==="answerLine"&&u.has(E.attrs?.id))return h=!0,null;const R=E.content?.map(g).filter(N=>N!==null);return R?{...E,content:R}:E},m=g(n.content),b=m.content||[],v=a(l),w=b.filter(E=>s.has(E.attrs?.contentId)),C=[...w].sort((E,R)=>v.indexOf(E.attrs.contentId)-v.indexOf(R.attrs.contentId));let y=0;const S=b.map(E=>s.has(E.attrs?.contentId)?C[y++]:E);return w.some((E,R)=>E!==C[R])&&(h=!0),h?{...n,content:{...m,content:S.length?S:Bt().content.content}}:n}function $R(n,r,l){const a=new Map([[r.id,l.id],...r.parts.map((C,y)=>[C.id,l.parts[y].id])]),c=new Map([...r.choice.options.map((C,y)=>[C.id,l.choice.options[y].id]),...r.parts.flatMap((C,y)=>C.choice.options.map((S,E)=>[S.id,l.parts[y].choice.options[E].id]))]),s=new Map([[r.text?.groupId,l.text?.groupId],...r.parts.map((C,y)=>[C.text?.groupId,l.parts[y].text?.groupId])].filter(C=>!!(C[0]&&C[1]))),u=n.content.content||[],h=u.filter(C=>a.has(C.attrs?.contentId));if(!h.length)return n;const g=fo(h),m=(C,y)=>({...C,...C.attrs?{attrs:{...C.attrs,...C.type==="choiceOption"&&c.has(y.attrs?.id)?{id:c.get(y.attrs.id)}:{},...C.type==="choiceGroup"&&s.has(y.attrs?.id)?{id:s.get(y.attrs.id)}:{},...a.has(y.attrs?.contentId)?{contentId:a.get(y.attrs.contentId)}:{},...C.type==="choiceStemAnchor"&&a.has(String(y.attrs?.groupId).slice(9))?{groupId:qc(a.get(String(y.attrs.groupId).slice(9)))}:{}}}:{},...C.content?{content:C.content.map((S,E)=>m(S,y.content[E]))}:{}}),b=new Map(r.parts.map((C,y)=>[C.id,l.parts[y].id])),v=(C,y)=>({...C,...y.type==="answerLine"&&b.has(y.attrs?.id)?{attrs:{...C.attrs,id:b.get(y.attrs.id)}}:{},...C.content?{content:C.content.map((S,E)=>v(S,y.content[E]))}:{}}),w=Math.max(...h.map(C=>u.indexOf(C)));return{...n,content:{...n.content,content:[...u.slice(0,w+1),...g.map((C,y)=>v(m(C,h[y]),h[y])),...u.slice(w+1)]}}}function GR(n,r){const l=n.content.content||[],a=new Set(l.map(s=>s.attrs?.contentId).filter(Boolean)),c=(r.content.content||[]).filter(s=>s.attrs?.contentId&&!a.has(s.attrs.contentId));return c.length?{...n,content:{...n.content,content:[...pn(n)?[]:l,...c]}}:n}function VR(n,r){const l={};let a=1;return{sectionInfoList:n.filter(s=>s.reference).map((s,u)=>{const h=s.reference,g=h.textVersion===1?h:dm({...h,questions:h.questions.map(y=>({...y,text:y.text||{...li(y.type,y.choice,ke(y.type)),numbered:!1,itemsContent:[]},parts:y.parts.map(S=>({...S,text:S.text||{...li(y.type,S.choice),numbered:!1,itemsContent:[]}}))}))},s.document,s.id),m=g.sectionSeq??u+1,b=y=>y?.itemsContent.map(S=>({id:S.id,key:S.key,content:r.serialize(S.content)}))||[],v=y=>r.serialize(y?.content||Bt()),w=(y,S,E)=>{const R=y?_l({...y,itemsContent:[]},S,E):[],N=r.serialize(_r(R)),T=r.unwrapParagraphs||(O=>O.replace(/^<p\b[^>]*>([\s\S]*)<\/p>$/,"$1"));return{content:T(N,!0),contentNoP:T(N),items:b(y).map(O=>`${O.key}.${T(O.content)}`)}},C=g.questions.map(y=>{const S=ke(y.type),E=a;a+=S?y.parts.length:1;const R=y.referenceData||{},N=R.questionId??y.id,T=S?y.parts.map((M,z)=>({...M.referenceData,questionId:M.referenceData?.questionId??M.id,questionPid:N,questiontypeCode:y.type,seq:E+z,showSeq:M.label,itemShowNames:[M.label],score:M.score,itemcount:M.choice.options.length,content:v(M.text),itemsContent:b(M.text)})):void 0,O={...R,questionId:N,questiontypeCode:y.type,seq:E,showSeq:y.label,showSeqs:S?y.parts.map(M=>M.label):null,itemShowNames:y.parts.length?y.parts.map(M=>M.label):[y.label],itemcount:Ct(y.type)?y.choice.options.length:y.parts.length||1,childNum:S?y.parts.length:void 0,score:y.score,itemScores:y.parts.length?y.parts.map(M=>M.score):[y.score],content:v(y.text),itemsContent:b(y.text),...T?{items:T}:{},lessScore:y.choice.lessScore,scoreType:y.choice.scoreType,rightAnswers:y.rightAnswers,singleScore:y.singleScore,extension:{...R.extension||{},...y.type==="CCOMPOSITION"?{kong:y.characters}:{},...y.type==="ECOMPOSITION"?{hang:y.lines}:{},uniEditor:{text:y.text,choice:y.choice,height:y.height,contentHeight:y.contentHeight,halfPoint:y.halfPoint,parts:y.parts.map(M=>({id:M.id,text:M.text,width:M.width,height:M.height,breakAfter:M.breakAfter,choice:M.choice,document:M.document})),document:y.document}}},D=w(y.text,y.id,y.label);return l[String(N)]=S?{...D,items:y.parts.map((M,z)=>({seq:E+z,...w(M.text,M.id,M.label)}))}:D,g.type==="MIXED"&&(l[`secContent${N}`]=r.serialize(g.material||Bt())),O});return{...g.referenceData,sectionSeq:m,sectionName:s.title,sectionQuestionType:g.type,questionInfolist:C,...g.type==="MIXED"?{content:r.serialize(g.material||Bt())}:{},extension:{...g.referenceData?.extension||{},uniEditor:{id:s.id,layout:g.layout,material:g.material,document:s.document,optional:g.optional,choose:g.choose,optionalHeight:g.optionalHeight,scoreType:g.scoreType,fillNewLine:g.fillNewLine}}}}),quesTextMap:l}}function wv(n,r){const l=Array.isArray(n)?n:n.sectionInfoList;if(!Array.isArray(l))throw new Error("缺少 sectionInfoList");const a=new Set,c=s=>{const u=s==null||s===""?crypto.randomUUID():String(s);if(a.has(u))throw new Error(`题目 ID 重复:${u}`);return a.add(u),u};return l.map(s=>{if(!(s.sectionQuestionType in Wn)||!Array.isArray(s.questionInfolist))throw new Error("题块类型或 questionInfolist 无效");const u=fm(s.sectionQuestionType),h=s.extension;h?.uniEditor?.id&&(u.id=h.uniEditor.id),u.title=s.sectionName;const{questionInfolist:g,...m}=s,b=[],v=new Map;g.forEach(C=>{if(C.questionPid!==void 0&&C.questionPid!==null&&ke(C.questiontypeCode)){const y=String(C.questionPid);let S=v.get(y);S||(S={...C,questionId:C.questionPid,questionPid:void 0,content:String(C.parentContent||""),items:[],showSeqs:[]},v.set(y,S),b.push(S)),S.items.push(C),S.showSeqs.push(C.showSeq??C.seq??S.items.length)}else b.push(C)}),v.forEach(C=>{C.itemScores=C.items.map(y=>y.score??null),C.score=C.itemScores.some(y=>y===null)?null:C.itemScores.reduce((y,S)=>y+(S||0),0)});const w=b.map((C,y)=>{if(!(C.questiontypeCode in Wn)||C.questiontypeCode==="MIXED")throw new Error("子题类型无效");const S=C.questiontypeCode,E=ke(S),R=E?C.items?.length||C.showSeqs?.length||C.childNum||1:["FILLBLANK","SHORTANSWER"].includes(S)&&(C.itemScores?.length||C.itemcount)||1;if(!Number.isInteger(R)||R<1||R>200)throw new Error("子题数量无效");const N=C.score??null,T=nu(S),O=ru({...T,characters:Number(C.extension?.kong)||T.characters,lines:Number(C.extension?.hang)||T.lines,partCount:R,score:E||["FILLBLANK","SHORTANSWER"].includes(S)?C.itemScores?.[0]??(N===null?null:N/R):N,optionCount:C.itemcount||C.itemsContent?.length||4},Number(C.seq)||y+1);O.id=c(C.questionId??C.id),O.label=String(C.showSeq??C.itemShowNames?.[0]??C.seq??y+1),O.choice.id=O.id,O.choice.label=O.label,O.choice.score=N,O.choice.scoreType=C.scoreType||O.choice.scoreType,O.choice.lessScore=C.lessScore??O.choice.lessScore,O.rightAnswers=C.rightAnswers??O.rightAnswers,O.singleScore=C.singleScore??O.singleScore,O.score=N,O.referenceData=C;const D=C.extension?.uniEditor;D?.choice&&(O.choice={...D.choice,id:O.id,label:O.label,score:N}),O.height=D?.height??O.height,O.contentHeight=D?.contentHeight??O.contentHeight,O.halfPoint=D?.halfPoint??O.halfPoint;const M=(z,H,G,X=!1,U)=>{if(U)return structuredClone(U);const F=li(S,{...G,id:H},X);return{...F,content:r.parse(z.content||""),itemsContent:!X&&z.itemsContent?z.itemsContent.map((J,I)=>({id:J.id===void 0?G.options[I]?.id||crypto.randomUUID():String(J.id),key:J.key,content:r.parse(J.content||"")})):F.itemsContent}};return O.text=M(C,O.id,O.choice,E,D?.text),O.text.itemsContent.length&&(O.choice.options=O.text.itemsContent.map(z=>({id:z.id,label:z.key}))),O.document=D?.document||gn(O.document,O.label,O.score),O.parts=O.parts.map((z,H)=>{const G=C.items?.[H],X=D?.parts?.[H];return z.id=c(X?.id??G?.questionId??G?.id),z.referenceData=G,z.label=String(G?.showSeq??C.itemShowNames?.[H]??C.showSeqs?.[H]??(E?Number(C.seq||1)+H:R===1?O.label:`${O.label}.${H+1}`)),z.score=G?.score??C.itemScores?.[H]??z.score,z.choice={...X?.choice||z.choice,id:z.id,label:z.label,score:z.score,scoreType:G?.scoreType||C.scoreType||z.choice.scoreType,lessScore:G?.lessScore??C.lessScore??z.choice.lessScore},E&&S!=="TEXT_COMPLETION"&&(z.text=M(G||{itemsContent:C.itemsContent?.map(({key:U,content:F})=>({key:U,content:F}))},z.id,z.choice,!1,X?.text)),z.text?.itemsContent.length&&(z.choice.options=z.text.itemsContent.map(U=>({id:U.id,label:U.key}))),z.document=X?.document||gn(z.document,z.label,z.score),{...z,...X?{width:X.width??z.width,height:X.height??z.height,breakAfter:X.breakAfter??z.breakAfter}:{}}}),O.characters=Number(C.extension?.kong)||O.characters,O.lines=Number(C.extension?.hang)||O.lines,O});return u.reference={...u.reference,textVersion:1,sectionSeq:s.sectionSeq,referenceData:m,questions:w,material:h?.uniEditor?.material||r.parse(s.content||""),...h?.uniEditor?{layout:h.uniEditor.layout||u.reference.layout,optional:!!h.uniEditor.optional,choose:h.uniEditor.choose||1,optionalHeight:h.uniEditor.optionalHeight??200,scoreType:h.uniEditor.scoreType||u.reference.scoreType,fillNewLine:!!h.uniEditor.fillNewLine}:{}},h?.uniEditor?.document&&(u.document=h.uniEditor.document),u.document=eu(u),u})}function qR({uploadImage:n,editorPlugin:r,initialValue:l,onSave:a,dictionaries:c}){const s=x.useMemo(()=>Pc(c),[c]),u=r.html,[h,g]=x.useState(l||lm),m=x.useCallback(se=>g(Re=>{let ye=typeof se=="function"?se(Re):se;ye.blocks.some(Ne=>Ne.exercise&&!Ne.reference)&&(ye={...ye,blocks:ye.blocks.map(kR)}),ye={...ye,blocks:ye.blocks.map(Ne=>{const Fe=Re.blocks.find(In=>In.id===Ne.id);if(Ne.reference?.textVersion===1)return ZS(Ne,Fe,!!ye.questionCard);if(!Ne.reference||Fe?.reference===Ne.reference)return Ne;let Xt=Fe?.reference?PR(Ne.document,Fe.reference,Ne.reference):Ne.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&&Ne.reference.questions.length){const In=Ne.reference.questions[0],pr=Ne.reference.type==="MIXED"?Ne.id:In.id;Xt={...Xt,content:{...Xt.content,content:[Cv(Xt.content.content[0],pr)]}}}const Yn=In=>JSON.stringify(In.reference?.questions.flatMap(pr=>[pr.choice,...pr.parts.map(Ns=>Ns.choice)]).map(pr=>[pr.id,pr.contentTarget])),No=!Fe||Yn(Fe)!==Yn(Ne)?UR({...Ne,document:Xt}):Xt;return No===Ne.document?Ne:{...Ne,document:No}})};const ve=ye.blocks.filter(Ne=>Ne.reference).map(Ne=>Jo(Ne.reference));return(ye.mergeObjective?[ve.flat()]:ve).some(Ne=>new Set(Ne.map(Fe=>Fe.options.length)).size>1)&&ye.choiceDirection!=="column"?{...ye,choiceDirection:"column"}:ye}),[]),[b,v]=x.useState(""),[w,C]=x.useState(!l),[y,S]=x.useState(null),[E,R]=x.useState(null),[N,T]=x.useState(null),[O,D]=x.useState(!0),[M,z]=x.useState({}),H=se=>{const Re=se.reference?Il(se.reference):se.exercise?.items||se.choices?.questions;return Re?.find(ye=>ye.id===M[se.id])?.id||Re?.[0]?.id},G=(se,Re)=>z(ye=>ye[se]===Re?ye:{...ye,[se]:Re}),X=se=>{S(se),se===null&&R(null),se&&T(Re=>Re===null?null:se)},[U,F]=x.useState({}),[J,I]=x.useState(),[Y,k]=x.useState(!1),$=se=>{se&&R(null),k(se)},[L,Z]=x.useState(null),A=x.useRef(new Map),V=x.useCallback((se,Re)=>{Re?A.current.set(se,Re):A.current.delete(se)},[]),{scale:K,setScale:ee}=jo(),le=K/100,ce=x.useMemo(()=>HR(h,E),[h,E]),ie=JSON.stringify([h.preset,h.margin,h.gap,h.header,h.paperTitle?.id,h.paperTitle?.height,ce.map(se=>[se.id,se.answerHeight])]),{geometry:ge,placements:je,pageCount:be}=x.useMemo(()=>XS({...h,blocks:ce},U,J),[ie,U,J]),de=h.paperTitle?.id===J?.id&&J?.overflowing,Se=be*ge.height+(be-1)*mo,_e=je.filter(se=>se.overflowing),Ce=new Map(je.map(se=>[se.id,se])),Ae=Ce.get(fr);Ae&&h.blocks.forEach(se=>{Ce.has(se.id)||Ce.set(se.id,Ae)});const $e=()=>{const se=document.getElementById("answer-sheet-stadio");se&&ee(Math.max(20,Math.min(100,Math.floor((se.clientWidth-96)/ge.width*100))))};x.useEffect(()=>{$e()},[h.preset]);const Dn=(se,Re)=>m(ye=>({...ye,blocks:ye.blocks.map(ve=>ve.id===se?{...ve,...Re}:ve)})),jt=(se,Re)=>m(ye=>{const ve=[...ye.blocks],Ke=ve.findIndex(Fe=>Fe.id===se);if(Ke<0||Re<0||Re>=ve.length||Ke===Re)return ye;const[Ne]=ve.splice(Ke,1);return ve.splice(Re,0,Ne),{...ye,blocks:ve}}),pe=(se,Re=!1)=>{if(X(se),!Re)return;const ye=document.getElementById("answer-sheet-stadio"),ve=Array.from(document.querySelectorAll("[data-block-id]")),Ke=ve.find(Ne=>Ne.dataset.blockId===se&&!Ne.hidden)||ve.find(Ne=>Ne.dataset.blockId===fr);if(ye&&Ke){const Ne=Ke.getBoundingClientRect(),Fe=ye.getBoundingClientRect();ye.scrollTo({left:Math.max(0,ye.scrollLeft+Ne.left-Fe.left-40),top:Math.max(0,ye.scrollTop+Ne.top-Fe.top-90),behavior:"smooth"})}},ct=()=>VR(h.blocks,u);return{card:h,creationDictionary:s,saveMessage:b,setSaveMessage:v,saveAction:a?"保存":"导出",editors:A,measurements:U,titleMeasurement:J,paperBlocks:ce,setCard:m,uploadImage:n,setQuestionCard:se=>{R(null),m(Re=>({...Re,questionCard:se}))},editQuestion:(se,Re)=>{X(se),R(se),T(null);const ye=h.blocks.find(Ke=>Ke.id===se),ve=Re||ye&&H(ye);ye?.reference?.textVersion===1&&pn(ye.document)&&Dn(se,{document:eu(ye)}),requestAnimationFrame(()=>{const Ke=A.current.get(`content/${ve}`)||A.current.get(se);(!ve||!Ke?.focusContent(ve))&&Ke?.focus("start")})},insertMaterialBlank:(se,Re,ye,ve)=>{X(se),R(se),requestAnimationFrame(()=>A.current.get(se)?.insertAnswerRegion(Re,ye,ve))},editingQuestionId:E,registerEditor:V,creationOpen:w,setCreationOpen:C,newCard:se=>{m(Wc(se)),X(null),T(null),Z(null),F({}),I(void 0),z({}),$(!1),C(!1)},selectedId:y,setSelectedId:X,selectedChoiceId:H,selectChoice:G,settingsId:N,setSettingsId:T,settingsAutoFocus:O,openSettings:(se,Re=!0)=>{Y||(X(se),T(se),D(Re))},setMeasurements:F,setTitleMeasurement:I,titleOverflow:de,readOnly:Y,setReadOnly:$,deleted:L,setDeleted:Z,scale:le,geometry:ge,placements:je,pageCount:be,totalHeight:Se,overflow:_e,placementById:Ce,fitPage:$e,updateBlock:Dn,moveBlock:jt,selectBlock:pe,download:()=>{if(a){a();return}const se=URL.createObjectURL(new Blob([JSON.stringify({...h,...ct()},null,2)],{type:"application/json"})),Re=document.createElement("a");Re.href=se,Re.download=`${h.title||"答题卡"}.json`,Re.click(),setTimeout(()=>URL.revokeObjectURL(se),1e3)},getReferenceData:ct,setReferenceData:se=>{const Re=wv(se,u);m(ye=>({...ye,blocks:Re})),X(null),T(null),z({})}}}const Ev=x.createContext(null);function YR({children:n,...r}){return f.jsx(bv.Provider,{value:r.editorPlugin,children:f.jsx(Ev.Provider,{value:qR(r),children:n})})}function Tt(){const n=x.useContext(Ev);if(!n)throw new Error("制卡内容需要 CardProvider");return n}const XR={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 Oo({name:n,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:XR[n]})})}function Id(n){const[r,l]=x.useState(null),a=x.useRef(n);a.current=n;const c=x.useRef(null),s=(b,v)=>{if(!r)return;const w=r.getBoundingClientRect();r.style.left=`${Math.max(8,Math.min(window.innerWidth-w.width-8,b))}px`,r.style.top=`${Math.max(8,Math.min(window.innerHeight-w.height-8,v))}px`},u=()=>{if(!r)return;const b=r.getBoundingClientRect(),v=a.current?.(r)||{left:(window.innerWidth-b.width)/2,top:(window.innerHeight-b.height)/2};s(v.left,v.top)},h=()=>{const b=c.current;c.current=null,r&&delete r.dataset.dragging,b?.target.hasPointerCapture(b.pointerId)&&b.target.releasePointerCapture(b.pointerId)},g=()=>c.current?(s(c.current.left,c.current.top),h(),!0):!1;return x.useLayoutEffect(()=>{if(!r)return;u();const b=()=>{const w=r.getBoundingClientRect();s(w.left,w.top)},v=new ResizeObserver(b);return v.observe(r),window.addEventListener("resize",b),document.addEventListener("fullscreenchange",b),window.addEventListener("blur",g),()=>{h(),v.disconnect(),window.removeEventListener("resize",b),document.removeEventListener("fullscreenchange",b),window.removeEventListener("blur",g)}},[r]),{dialog:r,setDialog:l,titleProps:{role:"button",tabIndex:0,onPointerDown:b=>{if(b.button!==0||!b.isPrimary||!r)return;b.preventDefault(),b.stopPropagation(),b.currentTarget.focus({preventScroll:!0});const{left:v,top:w}=r.getBoundingClientRect();c.current={x:b.clientX,y:b.clientY,left:v,top:w,target:b.currentTarget,pointerId:b.pointerId},r.dataset.dragging="true",b.currentTarget.setPointerCapture(b.pointerId)},onPointerMove:b=>{const v=c.current;v?.pointerId===b.pointerId&&s(v.left+b.clientX-v.x,v.top+b.clientY-v.y)},onPointerUp:h,onPointerCancel:g,onLostPointerCapture:h,onKeyDown:b=>{if(b.key==="Escape"&&g()&&(b.preventDefault(),b.stopPropagation()),b.key==="Home"&&(b.preventDefault(),b.stopPropagation(),u()),!r||!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(b.key))return;b.preventDefault(),b.stopPropagation();const v=b.shiftKey?50:10,w=r.getBoundingClientRect();s(w.left+(b.key==="ArrowRight"?v:b.key==="ArrowLeft"?-v:0),w.top+(b.key==="ArrowDown"?v:b.key==="ArrowUp"?-v:0))}},cancelDrag:g}}function KR({creation:n,onAdd:r,onClose:l}){const[a,c]=x.useState(null),s=cm(n),u=x.useId(),{dialog:h,setDialog:g,titleProps:m,cancelDrag:b}=Id();x.useLayoutEffect(()=>{h?.setAttribute("aria-labelledby",u)},[h,u]);const v=f.jsx("div",{...m,className:"card-modal-drag","aria-label":"拖动添加题块",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:u,children:"添加题块"})});return f.jsx(Cs,{open:!0,panelRef:g,width:460,zIndex:910,className:"card-modal card-add-block-modal",title:v,closeLabel:"关闭添加题块",closeIcon:f.jsx(Oo,{name:"close",size:16}),onCancel:l,onEscapeKeyDown:w=>{b()&&(w.preventDefault(),w.stopPropagation())},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ue,{onClick:l,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!a||!s.includes(a),onClick:()=>{a&&s.includes(a)&&r(a)},children:"添加"})]}),children:f.jsx("div",{className:"card-question-types",role:"group","aria-label":"选择题型",children:s.map(w=>f.jsx(ue,{"aria-pressed":a===w,onClick:()=>c(w),children:Wn[w]},w))})})}function Ts({label:n,value:r,min:l,max:a,onChange:c}){const[s,u]=x.useState();return f.jsx(ha,{className:"ui-control ui-number","aria-label":n,min:l,max:a,precision:0,value:s===void 0?r:s,onChange:h=>{u(h),h!==null&&h>=l&&h<=a&&h!==r&&c(h)},onBlur:()=>{if(s!==void 0){const h=Math.max(l,Math.min(a,s??l));h!==r&&c(h),u(void 0)}}})}function Ni({label:n,value:r,min:l=.5,max:a=15,placeholder:c,onChange:s}){const[u,h]=x.useState(),g=u==null||Bn(u)&&u>=l&&u<=a;return f.jsx(ha,{className:"ui-control ui-number","aria-label":n,value:u===void 0?r:u,min:l,max:a,step:.5,placeholder:c,status:g?void 0:"error",onChange:m=>{h(m),(m===null||Bn(m)&&m>=l&&m<=a)&&s(m)},onBlur:()=>h(void 0)})}function FR({value:n,creation:r,onChange:l}){const[a,c]=x.useState("all"),[s,u]=x.useState([]),[h,g]=x.useState("settings"),[m,b]=x.useState("keep"),[v,w]=x.useState(null),[C,y]=x.useState(null),[S,E]=x.useState("keep"),[R,N]=x.useState(null),[T,O]=x.useState(1),[D,M]=x.useState(null),[z,H]=x.useState(""),[G,X]=x.useState(""),U=n.questions.filter(J=>a==="all"||s.includes(J.id)).map(J=>J.id),F=()=>{const J={};m!=="keep"&&(J.kind=m),v!==null&&(J.optionCount=v),C!==null&&(J.score=C),S!=="keep"&&(J.scoreType=S),R!==null&&S!=="ITEM_SCORE"&&(J.lessScore=R);let I;h==="settings"?I={type:h,patch:J}:h==="numbering"?I={type:h,start:T}:h==="average"?I={type:h,total:D??0}:I={type:h,text:z};const Y=DS(n,U,I,r);X(Y.error||""),Y.value&&l(Y.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(Vt,{"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(Vt,{"aria-label":"选择题批量操作",value:h,onChange:J=>{g(J),X("")},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:n.questions.map(J=>f.jsxs(qt,{checked:U.includes(J.id),onChange:I=>u(Y=>I.target.checked?[...Y,J.id]:Y.filter(k=>k!==J.id)),children:["第 ",J.label," 题"]},J.id))}),h==="settings"&&f.jsxs("div",{className:"card-choice-batch-properties",children:[f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Vt,{"aria-label":"批量选择题类型",value:m,onChange:b,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(ha,{className:"ui-control ui-number","aria-label":"批量选项个数",placeholder:"保持不变",min:2,max:mn.options,precision:0,value:v,onChange:w})]}),f.jsxs("label",{className:"card-field",children:["每题分值",f.jsx(Ni,{label:"批量每题分值",value:C,placeholder:"保持不变",onChange:y})]}),f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Vt,{"aria-label":"批量少选计分",value:S,onChange:E,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(Ni,{label:"批量少选得分",min:0,value:R,placeholder:"保持不变",onChange:N})]})]}),h==="numbering"&&f.jsxs("label",{className:"card-field",children:["起始题号",f.jsx(Ts,{label:"批量起始题号",min:1,max:1e3,value:T,onChange:O})]}),h==="average"&&f.jsxs("label",{className:"card-field",children:["所选题目总分",f.jsx(Ni,{label:"平均分配总分",max:mn.score*U.length,value:D,onChange:M})]}),h==="answers"&&f.jsxs("label",{className:"card-field card-choice-batch-answers",children:["按题目顺序录入",f.jsx(xs,{"aria-label":"批量选择题答案",value:z,rows:3,placeholder:"每题一组,如 A BC D;- 表示清空",onChange:J=>H(J.target.value)})]}),G&&f.jsx("div",{className:"card-choice-error",role:"alert",children:G}),f.jsxs(ue,{className:"card-choice-batch-apply",type:"primary",disabled:!U.length,onClick:F,children:["应用到 ",U.length," 题"]})]})]})}function Tv({value:n,document:r,creation:l,selectedId:a,onSelect:c,onChange:s,singleQuestion:u=!1}){const[h,g]=x.useState([]),[m,b]=x.useState([]),v=n.questions.find(U=>U.id===a)||n.questions[0],w=n.questions.indexOf(v),C=Fc(n),y=Yc(n),S=Ol(r),E=new Set(n.questions.map(U=>U.options.length)).size>1,R=()=>({value:n,selectedId:v?.id}),N=(U,F=v?.id)=>{g(I=>[...I.slice(-49),R()]),b([]),s({...U,source:"manual"});const J=U.questions.find(I=>I.id===F)||U.questions[Math.max(0,Math.min(w,U.questions.length-1))];J&&c(J.id)},T=U=>{s(U.value),U.selectedId&&c(U.selectedId)},O=U=>N({...n,questions:n.questions.map(F=>F.id===v.id?{...F,...U}:F)}),D=U=>O($c(v,U,l)),M=U=>{const F=[...n.questions];F.splice(w,1),F.splice(w+U,0,v),N({...n,questions:F})},z=(U=!1)=>{const F=U&&v?_S(v,Vc(n.questions)):{...Fo(0),label:Vc(n.questions)},J=[...n.questions];J.splice(w+1,0,F),N({...n,questions:J},F.id)},H=n.questions.reduce((U,F)=>U+(F.score??0),0),G=n.questions.filter(U=>typeof U.score!="number").length,X=v&&(tm(n.questions,v.id,v.label)||Gc(v));return f.jsxs("div",{className:"card-choice-settings","aria-label":"选择题设置",children:[u&&f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Vt,{"aria-label":"选择题填涂位置",value:y,onChange:U=>N(Xc(n,r,U)),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:[n.questions.length," 题 · ",G===n.questions.length?"未设分":`${H} 分${G?` · ${G} 题未设分`:""}`]}),f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Vt,{"aria-label":"选择题填涂位置",value:y,onChange:U=>N(Xc(n,r,U)),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(Ts,{label:"选择题数量",min:1,max:mn.questions,value:n.questions.length,onChange:U=>{const F=n.questions.slice(0,U);for(;F.length<U;)F.push({...Fo(0),label:Vc(F)});N({...n,questions:F})}})]}),f.jsxs("div",{className:"card-choice-layout-fields",children:[f.jsxs("label",{className:"card-field",children:["题目排列方向",f.jsxs(Vt,{"aria-label":"填涂排列方向",value:C,onChange:U=>N({...n,direction:U}),children:[f.jsx("option",{value:"row",disabled:E,children:"横排(先右后下)"}),f.jsx("option",{value:"column",children:E?"竖排(选项数不同)":"竖排(先下后右)"})]})]}),C==="column"&&f.jsxs("label",{className:"card-field",children:["每列题数",f.jsx(Ts,{label:"每列题数",min:1,max:5,value:n.rowsPerColumn,onChange:U=>N({...n,rowsPerColumn:U})})]})]})]}),v&&f.jsxs("div",{className:"card-choice-question-settings",children:[!u&&f.jsxs("label",{className:"card-field",children:["当前题目",f.jsx(Vt,{"aria-label":"当前选择题",value:v.id,onChange:c,children:n.questions.map(U=>f.jsxs("option",{value:U.id,children:["第 ",U.label," 题"]},U.id))})]}),y!=="concentrated"&&f.jsxs("label",{className:"card-field",children:["对应正文选项",f.jsxs(Vt,{"aria-label":"填涂对应正文选项",value:S.some(U=>U.id===v.contentTarget?.groupId)?v.contentTarget.groupId:"",onChange:U=>{const F=S.find(J=>J.id===U);O({contentTarget:F?{groupId:F.id,optionIds:F.options.map(J=>J.id)}:null})},children:[f.jsx("option",{value:"",children:"未指定(集中显示)"}),S.map((U,F)=>f.jsxs("option",{value:U.id,disabled:n.questions.some(J=>J.id!==v.id&&J.contentTarget?.groupId===U.id),children:["第 ",U.label||F+1," 组选项(",U.options.length," 项)"]},U.id))]})]}),!u&&f.jsxs("label",{className:"card-field",children:["题号",f.jsx(Oi,{"aria-label":"选择题题号",value:v.label,maxLength:12,onChange:U=>O({label:U.target.value})})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(Ts,{label:"选择题选项个数",min:2,max:Math.max(mn.options,v.options.length),value:v.options.length,onChange:U=>D({optionCount:U})})]}),f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Vt,{"aria-label":"选择题类型",value:NS(v),onChange:U=>D({kind:U}),children:[f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),!u&&f.jsxs("label",{className:"card-field",children:["本题分值",f.jsx(Ni,{label:"选择题分值",value:v.score??null,placeholder:"未设置",onChange:U=>D({score:U})})]}),v.multiple&&f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Vt,{"aria-label":"选择题少选计分",value:v.scoreType||"LESS_SCORE",onChange:U=>D({scoreType:U,lessScore:0}),children:[f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),v.multiple&&v.scoreType!=="ITEM_SCORE"&&typeof v.score=="number"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Ni,{label:"选择题少选得分",min:0,max:v.score,value:v.lessScore??0,onChange:U=>D({lessScore:U??0})})]}),f.jsxs("div",{className:"card-answer-key",role:"group","aria-label":"正确答案设置",children:[f.jsx("span",{children:"正确答案"}),f.jsx("div",{children:v.options.map(U=>f.jsx(ue,{type:"text","aria-label":`正确答案 ${U.label}`,"aria-pressed":v.correctIds.includes(U.id),onClick:()=>O({correctIds:v.correctIds.includes(U.id)?v.correctIds.filter(F=>F!==U.id):v.multiple?[...v.correctIds,U.id]:[U.id]}),children:U.label},U.id))})]}),v.multiple&&v.scoreType==="ITEM_SCORE"&&f.jsxs("div",{className:"card-choice-rule","aria-label":"选项得分说明",children:["每项 ",MS(v)??"—"," 分 · 错选、不选 0 分"]}),X&&f.jsx("div",{className:"card-choice-error",role:"alert",children:X}),!u&&f.jsx(qt,{className:"card-choice-break",checked:v.breakBefore,onChange:U=>O({breakBefore:U.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:n.questions.length>=mn.questions,onClick:()=>z(),children:"新增"}),f.jsx(ue,{type:"text","aria-label":"复制选择题配置",title:"复制当前题的填涂与计分配置,放在其后",disabled:n.questions.length>=mn.questions,onClick:()=>z(!0),children:"复制"}),f.jsx(ue,{type:"text","aria-label":"上移选择题",disabled:w<=0,onClick:()=>M(-1),children:"上移"}),f.jsx(ue,{type:"text","aria-label":"下移选择题",disabled:w>=n.questions.length-1,onClick:()=>M(1),children:"下移"}),f.jsx(ue,{type:"text",danger:!0,"aria-label":"删除当前选择题",disabled:n.questions.length<=1,onClick:()=>{const U=n.questions.filter(F=>F.id!==v.id);N({...n,questions:U},U[Math.min(w,U.length-1)]?.id)},children:"删除"})]})]},v.id),!v&&f.jsx(ue,{className:"card-choice-actions",onClick:()=>z(),children:"新增选择题"}),!u&&f.jsx(FR,{value:n,creation:l,onChange:N}),!u&&(h.length>0||m.length>0)&&f.jsxs("div",{className:"card-choice-history",children:[f.jsx(ue,{type:"text",className:"card-choice-undo",disabled:!h.length,onClick:()=>{const U=h.at(-1);g(h.slice(0,-1)),b(F=>[...F,R()]),T(U)},children:"撤销选择题设置"}),f.jsx(ue,{type:"text",disabled:!m.length,onClick:()=>{const U=m.at(-1);b(m.slice(0,-1)),g(F=>[...F,R()]),T(U)},children:"重做"})]})]})}function Yt({label:n,children:r}){return f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:n}),r]})}function mt({label:n,value:r,min:l=0,max:a=200,step:c=1,onChange:s}){return f.jsx(Yt,{label:n,children:f.jsx(ha,{"aria-label":n,value:r,min:l,max:a,step:c,precision:c===1?0:1,onChange:u=>{u!==null&&Number.isFinite(u)&&s(Math.max(l,Math.min(a,Math.round(u/c)*c)))}})})}function Qt({label:n,value:r,max:l=70,onChange:a}){return f.jsx(Yt,{label:n,children:f.jsx(ha,{"aria-label":n,placeholder:"未设置",min:.5,max:l,step:.5,precision:1,value:r,onChange:c=>a(c===null?null:Math.max(.5,Math.min(l,Math.round(c*2)/2)))})})}function rn({label:n,value:r,onChange:l,maxLength:a=200}){return f.jsx(Yt,{label:n,children:f.jsx(Oi,{"aria-label":n,value:r,maxLength:a,onChange:c=>l(c.target.value)})})}function ot({label:n,value:r,options:l,onChange:a}){return f.jsx(Yt,{label:n,children:f.jsx(Vt,{"aria-label":n,value:r,onChange:a,children:Object.entries(l).map(([c,s])=>f.jsx("option",{value:c,children:s},c))})})}function js({index:n,count:r,onAdd:l,onCopy:a,onDelete:c,onMove:s,name:u="小题",maximum:h=200}){return f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small","aria-label":`新增${u}`,disabled:r>=h,onClick:l,children:"新增"}),f.jsx(ue,{size:"small","aria-label":`复制当前${u}`,disabled:n<0||r>=h,onClick:a,children:"复制"}),f.jsx(ue,{size:"small","aria-label":`上移当前${u}`,disabled:n<=0,onClick:()=>s(-1),children:"↑"}),f.jsx(ue,{size:"small","aria-label":`下移当前${u}`,disabled:n<0||n>=r-1,onClick:()=>s(1),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除当前${u}`,disabled:n<0,onClick:c,children:"删除"})]})}function Ai({value:n,onEditor:r,...l}){const a=x.useRef(null),c=x.useCallback(u=>{a.current=u,r?.(u)},[r]),s=x.useRef(JSON.stringify(n));return x.useEffect(()=>{const u=JSON.stringify(n);u!==s.current&&(s.current=u,a.current&&JSON.stringify(a.current.getDocument())!==u&&a.current.syncDocument(n))},[n]),f.jsx(Dd,{ref:c,initialValue:n,...l})}function jv({value:n,onChange:r,drawing:l=!1}){const{uploadImage:a}=Tt(),c=x.useRef(null),[s,u]=x.useState(!1),[h,g]=x.useState(""),m=x.useRef(!0),b=x.useRef({value:n,onChange:r});b.current={value:n,onChange:r},x.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]);const v=w=>r({...n,...w});return f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"作答区样式",value:n.style,options:{blank:"空白",lines:"横线",grid:"方格纸",characters:"作文格","four-lines":"四线三格",coordinates:"坐标网格"},onChange:w=>v({style:w})}),f.jsx(mt,{label:"作答行数",value:n.rows,min:0,max:120,onChange:w=>v({rows:w})}),f.jsx(mt,{label:"作答行高",value:n.rowHeight,min:16,max:80,onChange:w=>v({rowHeight:w})}),["characters","grid","coordinates"].includes(n.style)&&f.jsx(mt,{label:"每行格数",value:n.columns,min:4,max:40,onChange:w=>v({columns:w})}),n.style==="characters"&&f.jsx(mt,{label:"字数标记间隔",value:n.wordMark,min:0,max:500,onChange:w=>v({wordMark:w})})]}),f.jsx(qt,{checked:n.title,onChange:w=>v({title:w.target.checked}),children:"标题填写区"}),l&&f.jsxs("div",{children:[f.jsx(rn,{label:"作图底图 URL",value:n.backgroundUrl,maxLength:4096,onChange:w=>v({backgroundUrl:w})}),f.jsx("input",{ref:c,type:"file",accept:"image/*",hidden:!0,onChange:async w=>{const C=w.target.files?.[0];if(w.target.value="",!!C){u(!0),g("");try{const y=a?await a(C):await new Promise((S,E)=>{const R=new FileReader;R.onload=()=>S(String(R.result)),R.onerror=()=>E(new Error("读取失败")),R.readAsDataURL(C)});if(!/^(https?:\/\/|data:image\/|blob:|\/)/i.test(y))throw new Error("图片地址无效");m.current&&b.current.onChange({...b.current.value,backgroundUrl:y})}catch{m.current&&g("图片上传失败,请重试")}finally{m.current&&u(!1)}}}}),f.jsx(ue,{size:"small",loading:s,onClick:()=>c.current?.click(),children:"上传底图"}),h&&f.jsx("p",{role:"alert",children:h})]})]})}function QR({value:n,onChange:r,correction:l=!1,practice:a=!1}){const[c,s]=x.useState(n[0]?.id),u=n.find(v=>v.id===c)||n[0],h=n.indexOf(u),g=l?"改错位置":a?"评价项":"评分点",m=v=>r(n.map(w=>w.id===u.id?{...w,...v}:w)),b=v=>{const w=v&&u?{...fo(u),label:Mr(n)}:{id:crypto.randomUUID(),label:Mr(n),score:null,prompt:"",answer:""},C=[...n];C.splice(h+1,0,w),r(C),s(w.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":`选择${g}`,children:n.map(v=>f.jsx(ue,{size:"small","aria-pressed":v.id===u?.id,onClick:()=>s(v.id),children:v.label},v.id))}),f.jsx(js,{name:g,maximum:20,index:h,count:n.length,onAdd:()=>b(!1),onCopy:()=>b(!0),onMove:v=>r(Qo(n,u.id,v)),onDelete:()=>r(n.filter(v=>v.id!==u.id))}),u&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:`${g}编号`,value:u.label,onChange:v=>m({label:v})}),f.jsx(Qt,{label:`${g}分值`,value:u.score,onChange:v=>m({score:v})})]}),f.jsx(rn,{label:l?"原文位置/待改文字":a?"评价维度":"作答步骤提示",value:u.prompt,onChange:v=>m({prompt:v})}),f.jsx(Yt,{label:l?"改正答案":a?"评价标准":"评分要点",children:f.jsx(xs,{"aria-label":l?"改正答案":a?"评价标准":"评分要点",value:u.answer,autoSize:{minRows:2,maxRows:5},onChange:v=>m({answer:v.target.value})})})]})]})}function ZR({value:n,onChange:r,onInsert:l}){const[a,c]=x.useState(n[0]?.id),s=n.find(m=>m.id===a)||n[0],u=n.indexOf(s),h=m=>r(n.map(b=>b.id===s.id?{...b,...m}:b)),g=m=>{const b=m&&s?{...fo(s),label:Mr(n)}:{...am(),label:Mr(n)},v=[...n];v.splice(u+1,0,b),r(v),c(b.id)};return f.jsxs("div",{className:"exercise-blank-settings",children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择空位",children:n.map(m=>f.jsx(ue,{size:"small","aria-pressed":m.id===s?.id,onClick:()=>c(m.id),children:m.label},m.id))}),f.jsx(js,{name:"空位",maximum:20,index:u,count:n.length,onAdd:()=>g(!1),onCopy:()=>g(!0),onMove:m=>r(Qo(n,s.id,m)),onDelete:()=>{r(n.filter(m=>m.id!==s.id)),c(n[Math.max(0,u-1)]?.id)}}),s&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:"空位编号",value:s.label,onChange:m=>h({label:m})}),f.jsx(Qt,{label:"每空分值",value:s.score,max:15,onChange:m=>h({score:m})}),f.jsx(ot,{label:"空位样式",value:s.style,options:{line:"横线",brackets:"括号",box:"方框",characters:"字格"},onChange:m=>h({style:m})}),f.jsx(ot,{label:"空位宽度",value:String(s.width),options:{20:"1/5 行",25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:m=>h({width:Number(m)})}),s.style==="characters"&&f.jsx(mt,{label:"字格数量",value:s.characters,min:1,max:40,onChange:m=>h({characters:m})}),f.jsx(rn,{label:"空前提示",value:s.prefix,onChange:m=>h({prefix:m})}),f.jsx(rn,{label:"空后单位",value:s.suffix,onChange:m=>h({suffix:m})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(qt,{checked:s.breakAfter,onChange:m=>h({breakAfter:m.target.checked}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>r(n.map(m=>({...m,width:s.width,style:s.style,characters:s.characters}))),children:"统一空位样式"})]}),f.jsx(ue,{size:"small",onClick:()=>l(s),children:"插入此空到题干"}),f.jsx(Yt,{label:"可接受答案(每行一个)",children:f.jsx(xs,{"aria-label":"可接受答案",value:s.answers.join(`
199
- `),autoSize:{minRows:2,maxRows:5},onChange:m=>h({answers:m.target.value.split(`
200
- `)})})})]})]})}function Ov({value:n,onChange:r,onRemove:l,category:a=!1}){const{uploadImage:c}=Tt(),[s,u]=x.useState(n[0]?.id),h=n.find(v=>v.id===s)||n[0],g=n.indexOf(h),m=a?"类别":"共享选项",b=v=>{const w=v&&h?fo(h):{id:crypto.randomUUID(),label:"",text:""},C=new Set(n.map(S=>S.label));w.label=Array.from({length:26},(S,E)=>String.fromCharCode(65+E)).find(S=>!C.has(S))||Mr(n);const y=[...n];y.splice(g+1,0,w),r(y),u(w.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs",children:n.map(v=>f.jsx(ue,{size:"small","aria-pressed":v.id===h?.id,onClick:()=>u(v.id),children:v.label},v.id))}),f.jsx(js,{name:m,maximum:26,index:g,count:n.length,onAdd:()=>b(!1),onCopy:()=>b(!0),onMove:v=>r(Qo(n,h.id,v)),onDelete:()=>l(h.id)}),h&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:`${m}编号`,value:h.label,onChange:v=>r(n.map(w=>w.id===h.id?{...w,label:v}:w))}),f.jsx(rn,{label:`${m}内容`,value:h.text,onChange:v=>r(n.map(w=>w.id===h.id?{...w,text:v}:w))})]}),h&&!a&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项图文/公式"}),f.jsx(Ai,{value:h.document||Bt(),ariaLabel:`共享选项 ${h.label} 图文内容`,uploadImage:c,onChange:v=>r(n.map(w=>w.id===h.id?{...w,document:v}:w))},h.id)]})]})}function WR({value:n,kind:r,item:l,onChange:a}){const c=s=>a({...n,...s});return f.jsxs("div",{children:[f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:r==="ordering"?"待排序/分类项目":"共享选项池"}),f.jsx(Ov,{value:n.pool,onChange:s=>c({pool:s,sequence:[...n.sequence.filter(u=>s.some(h=>h.id===u)),...s.filter(u=>!n.sequence.includes(u.id)).map(u=>u.id)]}),onRemove:s=>a(PS(n,s))})]}),r==="matching"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"匹配呈现",value:n.matchingDisplay,options:{letters:"字母填答",lines:"左右连线"},onChange:s=>c({matchingDisplay:s})}),f.jsx(ot,{label:"对应关系",value:n.relation,options:{one:"一对一",many:"一对多"},onChange:s=>c({relation:s,items:n.items.map(u=>({...u,targets:s==="one"?u.targets.slice(0,1):u.targets}))})})]}),f.jsx(qt,{checked:n.reuseOptions,onChange:s=>{const u=new Set;c({reuseOptions:s.target.checked,items:n.items.map(h=>({...h,targets:h.targets.filter(g=>s.target.checked?!0:u.has(g)?!1:(u.add(g),!0))}))})},children:"允许选项重复使用"}),l&&f.jsx(Yt,{label:"当前题匹配答案",children:f.jsx("div",{className:"exercise-tabs",children:n.pool.map(s=>f.jsx(ue,{size:"small","aria-pressed":l.targets.includes(s.id),onClick:()=>a($S(n,l.id,l.targets.includes(s.id)?l.targets.filter(u=>u!==s.id):[...l.targets,s.id])),children:s.label},s.id))})})]}),r==="ordering"&&f.jsxs("div",{children:[f.jsx(ot,{label:"排序或分类",value:n.ordering,options:{sequence:"排序",category:"分类"},onChange:s=>c({ordering:s})}),n.ordering==="sequence"?f.jsx("div",{className:"exercise-fields",children:n.sequence.map((s,u)=>f.jsx(ot,{label:`第 ${u+1} 位答案`,value:s,options:Object.fromEntries(n.pool.map(h=>[h.id,`${h.label}. ${h.text}`])),onChange:h=>{const g=[...n.sequence],m=g.indexOf(h);m>=0&&(g[m]=s),g[u]=h,c({sequence:g})}},u))}):f.jsxs("div",{children:[f.jsx(Ov,{category:!0,value:n.categories,onChange:s=>c({categories:s}),onRemove:s=>c({categories:n.categories.filter(u=>u.id!==s),assignments:Object.fromEntries(Object.entries(n.assignments).filter(([,u])=>u!==s))})}),n.pool.map(s=>f.jsx(ot,{label:`${s.label} 所属类别`,value:n.assignments[s.id]||"",options:{"":"未设置",...Object.fromEntries(n.categories.map(u=>[u.id,`${u.label}. ${u.text}`]))},onChange:u=>c({assignments:{...n.assignments,[s.id]:u}})},s.id))]})]})]})}function JR({value:n,onChange:r}){const[l,a]=x.useState(0),c=s=>r({...n,...s});return f.jsxs("div",{children:[f.jsx(Yt,{label:"待断句原文",children:f.jsx(xs,{"aria-label":"待断句原文",value:n.chunkText,autoSize:{minRows:3,maxRows:8},onSelect:s=>a(s.currentTarget.selectionStart),onChange:s=>r(GS(n,s.target.value))})}),f.jsx(ue,{size:"small",disabled:l<=0||l>=n.chunkText.length||n.chunkPoints.length>=26||n.chunkPoints.some(s=>s.offset===l),onClick:()=>{const s=new Set(n.chunkPoints.map(h=>h.label)),u=Array.from({length:26},(h,g)=>String.fromCharCode(65+g)).find(h=>!s.has(h));c({chunkPoints:[...n.chunkPoints,{id:crypto.randomUUID(),offset:l,label:u}].sort((h,g)=>h.offset-g.offset)})},children:"在光标处添加断点"}),f.jsx("div",{className:"exercise-chunk-points",children:n.chunkPoints.map(s=>f.jsxs("div",{children:[f.jsxs(qt,{checked:n.chunkCorrect.includes(s.id),onChange:u=>c({chunkCorrect:u.target.checked?[...n.chunkCorrect,s.id]:n.chunkCorrect.filter(h=>h!==s.id)}),children:[s.label," · ",n.chunkText.slice(Math.max(0,s.offset-4),s.offset),"|",n.chunkText.slice(s.offset,s.offset+4)]}),f.jsx(ue,{size:"small",type:"text","aria-label":`删除断点 ${s.label}`,onClick:()=>c({chunkPoints:n.chunkPoints.filter(u=>u.id!==s.id),chunkCorrect:n.chunkCorrect.filter(u=>u!==s.id)}),children:"删除"})]},s.id))}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(mt,{label:"最多选择断点数",value:n.chunkMax,min:1,max:26,onChange:s=>c({chunkMax:s})}),f.jsx(Qt,{label:"断句满分",value:n.groupScore,max:10,onChange:s=>c({groupScore:s})}),f.jsx(Qt,{label:"每个正确断点分值",value:n.chunkScore,max:10,onChange:s=>c({chunkScore:s})})]})]})}function eN({value:n,kind:r,blockId:l,selectedId:a,onSelect:c,onChange:s}){const{card:u,uploadImage:h,insertMaterialBlank:g,geometry:m}=Tt(),b=x.useRef([]),v=x.useRef([]),[,w]=x.useState(0),[C,y]=x.useState(1),[S,E]=x.useState(1),[R,N]=x.useState(null),T=n.items.find(I=>I.id===a)||n.items[0],O=n.items.indexOf(T),D=(I,Y=T?.id)=>{JSON.stringify(n)!==JSON.stringify(I)&&(b.current.push({value:n,id:T?.id}),b.current=b.current.slice(-50),v.current=[],s(I),Y&&c(Y),w(k=>k+1))},M=I=>D({...n,...I}),z=I=>M({items:n.items.map(Y=>Y.id===T.id?{...Y,...I}:Y)}),H=I=>s({...n,items:n.items.map(Y=>Y.id===T.id?{...Y,...I}:Y)}),G=I=>{const Y=I&&T?US(T,Mr(n.items)):Qc(T?.kind||Zc(r),Mr(n.items)),k=[...n.items];k.splice(O+1,0,Y),D({...n,items:k},Y.id)},X=I=>{const Y=I?v.current:b.current,k=I?b.current:v.current,$=Y.pop();if(!$)return;k.push({value:n,id:T?.id});const L=$.value.items.map(Z=>{const A=n.items.find(V=>V.id===Z.id);return A?{...Z,document:A.document,reference:A.reference,explanation:A.explanation}:Z});s({...$.value,items:L}),$.id&&c($.id),w(Z=>Z+1)},U=nm.includes(r),F=T&&["answer","calculation","correction","drawing","writing","english"].includes(T.kind),J=VS(n,r);return f.jsxs("div",{className:"exercise-panel",children:[r!=="chunk"&&f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择当前小题",children:n.items.map(I=>f.jsx(ue,{size:"small","aria-pressed":T?.id===I.id,onClick:()=>c(I.id),children:I.label},I.id))}),f.jsx(js,{index:O,count:n.items.length,maximum:om(r),onAdd:()=>G(!1),onCopy:()=>G(!0),onMove:I=>M({items:Qo(n.items,T.id,I)}),onDelete:()=>{const I=n.items.filter(Y=>Y.id!==T.id);D({...n,items:I,chooseCount:Math.min(n.chooseCount,Math.max(1,I.length))},I[Math.max(0,O-1)]?.id)}}),f.jsxs("details",{children:[f.jsx("summary",{children:"批量配置"}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(mt,{label:"追加题数",value:C,min:1,max:50,onChange:y}),f.jsx(mt,{label:"起始题号",value:S,min:1,max:1e3,onChange:E}),f.jsx(Qt,{label:"统一题分",value:R,max:Math.min(70,...n.items.map(I=>Al(I.kind))),onChange:N})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:n.items.length+C>om(r),onClick:()=>{const I=[...n.items],Y=[];for(let k=0;k<C;k++)Y.push(Qc(T?.kind||Zc(r),Mr([...I,...Y])));I.splice(O+1,0,...Y),D({...n,items:I},Y[0].id)},children:"追加空白题"}),f.jsx(ue,{size:"small",onClick:()=>M({items:n.items.map((I,Y)=>({...I,label:String(S+Y),choice:{...I.choice,label:String(S+Y)}}))}),children:"连续编号"}),f.jsx(ue,{size:"small",disabled:R!==null&&n.items.some(I=>R>Al(I.kind)),onClick:()=>M({items:n.items.map(I=>({...I,score:R,choice:{...I.choice,score:R}}))}),children:"统一分值"})]})]})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!b.current.length,onClick:()=>X(!1),children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!v.current.length,onClick:()=>X(!0),children:"重做题型配置"})]}),r==="chunk"&&f.jsx(JR,{value:n,onChange:D}),r==="optional"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(mt,{label:"选做题数",value:n.chooseCount,min:1,max:Math.max(1,n.items.length),onChange:I=>M({chooseCount:I})}),f.jsx(Qt,{label:"选做题组总分",value:n.groupScore,max:200,onChange:I=>M({groupScore:I})})]}),T&&r!=="chunk"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:"当前题号",value:T.label,onChange:I=>z({label:I,choice:{...T.choice,label:I}})}),f.jsx(Qt,{label:"当前题分",value:T.score,max:Al(T.kind),onChange:I=>z({score:I,choice:{...T.choice,score:I}})}),U&&r!=="cloze"&&r!=="completion"&&f.jsx(ot,{label:"小题题型",value:T.kind,options:HS,onChange:I=>z({kind:I})})]}),r==="cloze"&&f.jsx(ue,{size:"small",onClick:()=>g(l,T.id,T.label,60),children:"插入题号到公共材料"}),T.kind==="judge"&&f.jsxs("div",{children:[f.jsx(ot,{label:"判断标记",value:n.judgeLabels,options:{symbols:"√/×",letters:"T/F",words:"正确/错误"},onChange:I=>M({judgeLabels:I})}),f.jsx(Yt,{label:"正确判断",children:f.jsx("div",{className:"exercise-tabs",children:rm[n.judgeLabels].map((I,Y)=>f.jsx(ue,{size:"small","aria-pressed":T.judgment===(Y===0),onClick:()=>z({judgment:T.judgment===(Y===0)?null:Y===0}),children:I},Y))})}),f.jsx(qt,{checked:T.needsReason,onChange:I=>z({needsReason:I.target.checked}),children:"判断后改正/说明理由"}),T.needsReason&&f.jsx(jv,{value:T.area,onChange:I=>z({area:I})})]}),T.kind==="choice"&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项与计分规则"}),f.jsx(Tv,{value:{...Kc(0),presentation:T.presentation,questions:[T.choice]},document:T.document,creation:u.creation,selectedId:T.choice.id,onSelect:()=>{},onChange:I=>{const Y=I.questions.find(k=>k.id===T.choice.id);Y&&z({choice:Y,presentation:I.presentation,score:Y.score??null})},singleQuestion:!0})]}),T.kind==="fill"&&r!=="matching"&&f.jsxs("div",{children:[f.jsx(qt,{checked:n.fillNewLine,onChange:I=>M({fillNewLine:I.target.checked}),children:"每题一行"}),f.jsx(ZR,{value:T.blanks,onChange:I=>z({blanks:I}),onInsert:I=>g(l,I.id,`${T.label}.${I.label}`,m.columnWidth*I.width/100-30)})]}),F&&r!=="ordering"&&f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:"作答区域"}),f.jsx(jv,{value:T.area,drawing:T.kind==="drawing",onChange:I=>z({area:I})})]}),["answer","calculation","correction"].includes(T.kind)&&r!=="ordering"&&f.jsxs("details",{children:[f.jsx("summary",{children:r==="practice"?"评价量表":T.kind==="correction"?"改错位置与答案":"分步作答与评分点"}),f.jsx(QR,{value:T.steps,correction:T.kind==="correction",practice:r==="practice",onChange:I=>z({steps:I})})]}),T.kind==="table"&&f.jsx(ue,{size:"small",disabled:!pn(T.document),onClick:()=>z({document:qS()}),children:"建立空白表格"}),["matching","ordering"].includes(r)&&f.jsx(WR,{value:n,kind:r,item:T,onChange:D}),f.jsxs("details",{children:[f.jsx("summary",{children:r==="matching"?"左侧项目内容":"小题正文"}),f.jsx(Ai,{value:T.document,ariaLabel:`小题 ${T.label} 正文设置`,uploadImage:h,onChange:I=>H({document:I})})]}),f.jsxs("details",{children:[f.jsx("summary",{children:"参考答案与解析"}),f.jsx(Yt,{label:"参考答案",children:f.jsx(Ai,{value:T.reference,ariaLabel:"参考答案",uploadImage:h,onChange:I=>H({reference:I})})}),f.jsx(Yt,{label:"解析",children:f.jsx(Ai,{value:T.explanation,ariaLabel:"答案解析",uploadImage:h,onChange:I=>H({explanation:I})})})]})]},T.id),r==="practice"&&f.jsx(rn,{label:"作品/音视频引用 URL",value:n.attachmentUrl,maxLength:4096,onChange:I=>M({attachmentUrl:I})}),J.length>0&&f.jsx("p",{className:"exercise-error",role:"alert",children:J.join(";")})]})}function tN({group:n,creation:r,start:l,scanMarking:a,onAdd:c}){const s=y=>{const S=nu(y,l,r);return n.type==="MIXED"&&y==="MCHOICE"?{...S,scoreType:n.scoreType||"LESS_SCORE",score:n.scoreType==="ITEM_SCORE"?S.score:null}:S},[u,h]=x.useState(()=>s(n.type==="MIXED"?"SCHOICE":n.type)),[g,m]=x.useState(null),[b,v]=x.useState({start:null,end:null}),w=y=>{m(null),h(S=>({...S,...y}))},C=Zo[u.type];return f.jsxs("div",{className:"reference-add-panel",children:[n.type==="MIXED"&&f.jsx(ot,{label:"子题题型",value:u.type,options:Object.fromEntries(cm(r,!0).map(y=>[y,Wn[y]])),onChange:y=>{h(s(y)),v({start:null,end:null}),m(null)}}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ma,{label:"起始题号",value:b.start,min:1,max:1e3,onChange:y=>v(S=>({...S,start:y}))}),!ci(u.type)&&f.jsx(ma,{label:"结束题号",value:b.end,min:b.start||1,max:Math.min(1e3,(b.start||1)+C.count-1),onChange:y=>v(S=>({...S,end:y}))}),Ct(u.type)&&(C.options[0]===C.options[1]?f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:"选项个数"}),f.jsx("span",{children:C.options[0]})]}):f.jsx(ma,{label:"选项个数",value:u.optionCount,min:C.options[0],max:C.options[1],onChange:y=>w({optionCount:y})})),ke(u.type)&&f.jsx(ma,{label:"子题数量",value:u.partCount,min:1,max:C.parts,onChange:y=>w({partCount:y})}),["FILLBLANK","SHORTANSWER"].includes(u.type)&&f.jsx(mt,{label:u.type==="FILLBLANK"?"每题空数":"每题小题数",value:u.partCount||1,min:1,max:u.type==="SHORTANSWER"&&(a||n.optional)?1:C.parts,onChange:y=>w({partCount:y})}),f.jsx(Qt,{label:u.type==="FILLBLANK"?"每空分值":u.type==="SHORTANSWER"?"每小题分值":"每题分值",value:u.score,max:C.score,onChange:y=>w({score:y,lessScore:0})}),u.type==="MCHOICE"&&f.jsxs(x.Fragment,{children:[n.type!=="MIXED"&&f.jsx(ot,{label:"少选计分",value:u.scoreType,options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:y=>w({scoreType:y,lessScore:0})}),u.scoreType==="LESS_SCORE"&&f.jsx(mt,{label:"少选得分",value:u.lessScore,min:0,max:u.score||0,step:.5,onChange:y=>w({lessScore:y})})]}),u.type==="CHUNK_CHOICE"&&f.jsxs(x.Fragment,{children:[f.jsx(ma,{label:"正确答案个数",value:u.rightAnswers,min:1,max:(u.optionCount||2)-1,onChange:y=>w({rightAnswers:y})}),f.jsx(Qt,{label:"每涂对一处得分",value:u.singleScore,max:u.score||10,onChange:y=>w({singleScore:y})})]}),u.type==="CCOMPOSITION"&&f.jsx(mt,{label:"作文格数",value:u.characters,min:1,max:1200,onChange:y=>w({characters:y})}),u.type==="ECOMPOSITION"&&f.jsx(mt,{label:"作文行数",value:u.lines,min:1,max:100,onChange:y=>w({lines:y})})]}),g&&f.jsx("p",{role:"alert",className:"card-choice-error",children:g}),f.jsx(ue,{size:"small",type:"primary",onClick:()=>{if(b.start===null||!ci(u.type)&&b.end===null){m("请输入起始题号和结束题号");return}const y={...u,start:b.start,end:ci(u.type)?b.start:b.end},S=JS(n,y,a);m(S),S||c(y)},children:"添加题目"})]})}function ma({label:n,value:r,min:l,max:a,onChange:c}){return f.jsx(Yt,{label:n,children:f.jsx(ha,{"aria-label":n,value:r,min:l,max:a,precision:0,placeholder:"请输入",onChange:c})})}function nN({value:n,onChange:r,onClose:l}){const a=n.questions.filter(C=>Ct(C.type)).flatMap(C=>ke(C.type)?C.parts:[C]),[c,s]=x.useState([]),[u,h]=x.useState(!1),[g,m]=x.useState(!1),[b,v]=x.useState(2),w=()=>{const C=(y,S)=>!c.includes(y.id)||!y.text?y:{...y,text:{...y.text,layout:{...y.text.layout,indent:u,layout:g?"fixed":"natural",columns:g?b:S?4:2}}};r({...n,questions:n.questions.map(y=>({...C(y,y.type==="CLOZE"),parts:y.parts.map(S=>C(S,y.type==="CLOZE"))}))}),l()};return f.jsx(Cs,{open:!0,title:"客观题选项排版设置",width:400,className:"card-modal",closeLabel:"关闭选项排版",closeIcon:f.jsx(Oo,{name:"close"}),onCancel:l,footer:f.jsxs(f.Fragment,{children:[f.jsx(ue,{onClick:l,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!c.length,onClick:w,children:"确定"})]}),children:f.jsxs("div",{className:"exercise-panel",children:[f.jsx(qt,{checked:c.length===a.length,onChange:C=>s(C.target.checked?a.map(y=>y.id):[]),children:"全选"}),f.jsx("div",{className:"exercise-fields",children:a.map(C=>f.jsxs(qt,{checked:c.includes(C.id),onChange:y=>s(S=>y.target.checked?[...S,C.id]:S.filter(E=>E!==C.id)),children:["第 ",C.label," 题"]},C.id))}),f.jsx(ot,{label:"首行缩进",value:String(u),options:{false:"否",true:"是"},onChange:C=>h(C==="true")}),f.jsx(ot,{label:"个数排版",value:String(g),options:{false:"否",true:"是"},onChange:C=>m(C==="true")}),g&&f.jsx(ot,{label:"排版方式",value:String(b),options:{4:"一行4个",2:"一行2个",1:"一行1个"},onChange:C=>v(Number(C))})]})})}function rN({block:n,value:r,selectedId:l,onSelect:a,onChange:c}){const{card:s,geometry:u,setCard:h,editQuestion:g,insertMaterialBlank:m}=Tt(),[b,v]=x.useState(null),[w,C]=x.useState(!1),[y,S]=x.useState([]),[E,R]=x.useState([]),[N,T]=x.useState(""),[O,D]=x.useState(!1),M=r.questions.find(L=>L.id===l||L.parts.some(Z=>Z.id===l))||r.questions[0],z=r.questions.indexOf(M),H=(L,Z)=>{S(A=>[...A.slice(-49),{value:r,document:n.document}]),R([]),T(""),v(null),c(L,Z)},G=L=>H({...r,questions:r.questions.map(Z=>Z.id===L.id?L:Z)}),X=Jo(r),U=Yc(r.layout),F=Ol(n.document),J={...r.layout,direction:s.choiceDirection||r.layout.direction,questions:X},I=Fc(J),Y=U!=="concentrated"?Ko(J,n.document,!0).concentrated.questions:[],k=Sv(n),$=L=>{const Z=L.value;c({...Z,questions:Z.questions.map(A=>{const V=r.questions.find(K=>K.id===A.id);return V?{...A,text:V.text||A.text,document:gn(V.document,A.label,A.score),parts:A.parts.map(K=>({...K,text:V.parts.find(ee=>ee.id===K.id)?.text||K.text,document:gn(V.parts.find(ee=>ee.id===K.id)?.document||K.document,K.label,K.score)}))}:A})},GR(n.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=>H({...r,scoreType:L,questions:r.questions.map(Z=>Z.type==="MCHOICE"?{...Z,choice:{...Z.choice,scoreType:L,lessScore:L==="ITEM_SCORE"?0:Z.choice.lessScore}}:Z)})}),X.length>0&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"选择题填涂位置",value:U,options:{concentrated:"集中填涂",stem:"题干前整组字母框",option:"各选项前空方框"},onChange:L=>{const Z=Xc(J,n.document,L),A=new Map(Z.questions.map(V=>[V.id,V]));H({...r,layout:{...Z,questions:[]},questions:r.questions.map(V=>({...V,choice:A.get(V.id)||V.choice,parts:V.parts.map(K=>({...K,choice:A.get(K.id)||K.choice}))}))})}}),f.jsx(ot,{label:"填涂排列方向",value:I,options:new Set(X.map(L=>L.options.length)).size>1?{column:"竖排(选项数不同)"}:{row:"横排(先右后下)",column:"竖排(先下后右)"},onChange:L=>h(Z=>({...Z,choiceDirection:L}))}),I==="column"&&f.jsx(mt,{label:"每列题数",value:r.layout.rowsPerColumn,min:1,max:5,onChange:L=>H({...r,layout:{...r.layout,rowsPerColumn:L}})}),r.textVersion===1&&s.questionCard&&r.type!=="INFO_MATCHING"&&f.jsx(ue,{size:"small",onClick:()=>D(!0),children:"选项排版"})]}),r.questions.length>0&&f.jsxs(x.Fragment,{children:[f.jsx(ot,{label:"当前题目",value:M.id,options:Object.fromEntries(r.questions.map(L=>[L.id,`${ke(L.type)?L.parts.map(Z=>Z.label).join("、"):L.label} · ${Wn[L.type]}`])),onChange:a}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional,onClick:()=>C(L=>!L),children:"新增题目"}),f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional||Dl(r)+M.parts.length-1>1e3,onClick:()=>{if(r.type==="CCOMPOSITION"||r.optional)return;const L=tC(M,Dl(r)),Z=[...r.questions];Z.splice(z+1,0,L),H({...r,questions:Z},$R(n.document,M,L)),a(L.id)},children:"复制当前题目"}),f.jsx(ue,{size:"small","aria-label":"上移当前题目",disabled:z<=0,onClick:()=>H({...r,questions:Qo(r.questions,M.id,-1)}),children:"↑"}),f.jsx(ue,{size:"small","aria-label":"下移当前题目",disabled:z>=r.questions.length-1,onClick:()=>H({...r,questions:Qo(r.questions,M.id,1)}),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,onClick:()=>{const L=r.questions.filter(Z=>Z.id!==M.id);H({...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,z-1)].id)},children:"删除当前题目"})]})]}),(!r.questions.length||w)&&f.jsx(tN,{group:r,creation:s.creation,start:Dl(r),scanMarking:!!s.scanMarking,onAdd:L=>{const Z=eC(r,{...L,paperWidth:u.columnWidth},M?.id);H({...Z,questions:Z.questions.map(A=>r.questions.some(V=>V.id===A.id)?A:{...A,halfPoint:!!s.halfPoint})}),a(Z.questions.find(A=>!r.questions.some(V=>V.id===A.id)).id),C(!1)}},`${r.type}/${Dl(r)}/${r.scoreType}`),r.type==="SHORTANSWER"&&r.questions.length>1&&f.jsxs(x.Fragment,{children:[f.jsx(qt,{checked:r.optional,disabled:r.questions.some(L=>L.parts.length>1),onChange:L=>H({...r,optional:L.target.checked,choose:1}),children:"是否选做"}),r.optional&&f.jsx(mt,{label:`${r.questions.length} 选`,value:r.choose,min:1,max:s.scanMarking?r.questions.length-1:1,onChange:L=>H({...r,choose:L})})]}),r.questions.length>0&&!r.optional&&r.type!=="MIXED"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(Qt,{label:"分组总分",value:b??Un(r.questions),max:1e4,onChange:v}),f.jsx(ue,{size:"small",disabled:(b??Un(r.questions))===null,onClick:()=>{const L=oC(r,b??Un(r.questions));L?H(L):T("总分无法平均分配,每题/空的分值须符合题型范围且为 0.5 的倍数")},children:"平均分配"})]}),M&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"编辑正文",value:k.some(L=>L.id===l)?l:M.id,options:Object.fromEntries(k.map(L=>[L.id,L.label])),onChange:L=>{a(L),g(n.id,L)}}),f.jsx(ue,{size:"small",onClick:()=>g(n.id,l||M.id),children:"编辑当前正文"})]}),Y.length>0&&f.jsxs("p",{className:"card-choice-error",role:"status",children:["第 ",Y.map(L=>L.label).join("、")," 题",U==="stem"?"尚未关联题干":"尚未关联完整选项",",暂保留集中填涂。"]}),M&&f.jsx(oN,{value:M,group:r,scanMarking:!!s.scanMarking,onApply:L=>{const Z=r.questions.find(ee=>ee.id===L.id),A={...L,document:gn(Z.document,L.label,L.score),parts:L.parts.map(ee=>({...ee,document:gn(Z.parts.find(le=>le.id===ee.id)?.document||ee.document,ee.label,ee.score)}))},V=r.questions.filter(ee=>ee.id!==A.id).flatMap(ee=>ke(ee.type)?ee.parts.map(le=>le.label):[ee.label]),K=ke(A.type)?A.parts.map(ee=>ee.label):[A.label];return K.some(ee=>!ee.trim()||V.includes(ee))||new Set(K).size!==K.length?(T("题号不能为空或重复"),!1):(r.optional?H({...r,questions:r.questions.map(ee=>ee.id===A.id?A:{...ee,score:A.score,document:gn(ee.document,ee.label,A.score),parts:ee.parts.map(le=>({...le,score:A.score,document:gn(le.document,le.label,A.score)}))})}):G(A),!0)}},M.id),M&&si(M.type)&&f.jsxs(x.Fragment,{children:[f.jsx(qt,{checked:r.fillNewLine,onChange:L=>H({...r,fillNewLine:L.target.checked}),children:"每题一行"}),f.jsx("div",{className:"reference-part-settings",children:M.parts.map(L=>f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:`空位 ${L.label} 显示题号`,maxLength:10,value:L.label,onChange:Z=>G({...M,parts:M.parts.map(A=>A.id===L.id?{...A,label:Z}:A)})}),f.jsx(ot,{label:`空位 ${L.label} 宽度`,value:String(L.width),options:{...s.scanMarking?{20:"1/5 行"}:{},25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:Z=>G({...M,parts:M.parts.map(A=>A.id===L.id?{...A,width:Number(Z)}:A)})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",onClick:()=>m(n.id,L.id,L.label,u.columnWidth*L.width/100),children:"插入此空到正文"}),f.jsx(qt,{checked:L.breakAfter,onChange:Z=>G({...M,parts:M.parts.map(A=>A.id===L.id?{...A,breakAfter:Z.target.checked}:A)}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>H({...r,questions:r.questions.map(Z=>si(Z.type)?{...Z,parts:Z.parts.map(A=>({...A,width:L.width}))}:Z)}),children:"宽度统一设置"})]})]},L.id))})]}),M&&Ct(M.type)&&f.jsx(x.Fragment,{children:(ke(M.type)?M.parts.map(L=>L.choice):[M.choice]).map(L=>f.jsxs("div",{children:[f.jsxs(qt,{checked:L.breakBefore,onChange:Z=>{const A={...L,breakBefore:Z.target.checked};G({...M,choice:M.choice.id===L.id?A:M.choice,parts:M.parts.map(V=>V.choice.id===L.id?{...V,choice:A}:V)})},children:[L.label," 题前换行"]}),U==="option"&&r.textVersion!==1&&f.jsx(ot,{label:`${L.label} 题对应正文选项`,value:L.contentTarget?.groupId||"",options:{"":"按正文归属匹配",...Object.fromEntries(F.map((Z,A)=>[Z.id,`第 ${Z.label||A+1} 组选项`]))},onChange:Z=>{const A=F.find(K=>K.id===Z),V={...L,contentTarget:A?{groupId:Z,optionIds:A.options.map(K=>K.id)}:null};G({...M,choice:M.choice.id===L.id?V:M.choice,parts:M.parts.map(K=>K.choice.id===L.id?{...K,choice:V}:K)})}})]},L.id))}),N&&f.jsx("p",{className:"card-choice-error",role:"alert",children:N}),O&&f.jsx(nN,{value:r,onChange:H,onClose:()=>D(!1)}),(y.length>0||E.length>0)&&f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!y.length,onClick:()=>{const L=y.at(-1);S(y.slice(0,-1)),R(Z=>[...Z,{value:r,document:n.document}]),$(L)},children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!E.length,onClick:()=>{const L=E.at(-1);R(E.slice(0,-1)),S(Z=>[...Z,{value:r,document:n.document}]),$(L)},children:"重做题型配置"})]})]})}function oN({value:n,group:r,scanMarking:l,onApply:a}){const{card:c}=Tt(),[s,u]=x.useState(null),[h,g]=x.useState(""),m=s||n,b=E=>{u({...m,...E}),g("")},v=m.type,w=Zo[v],C=m.choice.options.length,y=m.parts.length,S=E=>{const R=Array.from({length:E},(N,T)=>m.parts[T]||ui(ke(v)?String(Number(m.parts[0]?.label||m.label)+T):E===1?m.label:`${m.label}.${T+1}`,m.parts[0]?.score??null,v,m.choice.options.length));ke(v)||R.forEach((N,T)=>{R[T]={...N,label:E===1?m.label:`${m.label}.${T+1}`}}),b({parts:R,score:Un(R)})};return f.jsxs("div",{className:"reference-question-settings",children:[f.jsxs("div",{className:"exercise-fields",children:[r.type!=="MIXED"&&["SCHOICE","MCHOICE"].includes(v)&&f.jsx(ot,{label:"题型",value:v,options:{SCHOICE:"单选题",MCHOICE:"多选题"},onChange:E=>{const R=E==="MCHOICE"&&ri(c.creation)&&m.score===null?6:m.score;b({type:E,score:R,choice:{...Wo(m.choice,E,C),score:R,scoreType:E==="MCHOICE"&&ri(c.creation)?"ITEM_SCORE":"LESS_SCORE",lessScore:0}})}}),!ke(v)&&f.jsx(rn,{label:"题目题号",value:m.label,maxLength:10,onChange:E=>b({label:E,choice:{...m.choice,label:E},parts:m.parts.map((R,N)=>({...R,label:m.parts.length===1?E:`${E}.${N+1}`}))})}),Ct(v)&&f.jsx(mt,{label:"选项个数",min:w.options[0],max:w.options[1],value:C,onChange:E=>b({choice:Wo(m.choice,v,E),parts:m.parts.map(R=>({...R,choice:Wo(R.choice,v,E)}))})}),y>0&&(v==="INFO_MATCHING"||r.type==="MIXED")&&f.jsx(Yt,{label:"子题数量",children:f.jsx("span",{children:y})}),y>0&&v!=="INFO_MATCHING"&&r.type!=="MIXED"&&f.jsx(mt,{label:ke(v)?"子题数量":v==="FILLBLANK"?"每题空数":"每题小题数",value:y,min:1,max:v==="SHORTANSWER"&&(l||r.optional)?1:w.parts,onChange:S}),!y&&f.jsx(Qt,{label:"本题分值",value:m.score,max:w.score,onChange:E=>b({score:E,choice:{...m.choice,score:E,lessScore:0}})}),ke(v)&&f.jsx(Qt,{label:"每题分值",value:m.parts[0]?.score??null,max:w.score,onChange:E=>{const R=m.parts.map(N=>({...N,score:E,choice:{...N.choice,score:E}}));b({parts:R,score:Un(R)})}}),v==="MCHOICE"&&f.jsxs(x.Fragment,{children:[r.type!=="MIXED"&&f.jsx(ot,{label:"少选计分",value:m.choice.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:E=>b({choice:{...m.choice,scoreType:E,lessScore:0}})}),m.choice.scoreType!=="ITEM_SCORE"&&f.jsx(mt,{label:"少选得分",min:0,max:m.score||0,step:.5,value:m.choice.lessScore||0,onChange:E=>b({choice:{...m.choice,lessScore:E}})})]}),v==="CHUNK_CHOICE"&&f.jsxs(x.Fragment,{children:[f.jsx(ma,{label:"正确答案个数",value:m.rightAnswers,min:1,max:C-1,onChange:E=>b({rightAnswers:E})}),f.jsx(Qt,{label:"每涂对一处得分",value:m.singleScore,max:m.score||10,onChange:E=>b({singleScore:E})})]}),v==="CCOMPOSITION"&&f.jsx(mt,{label:"作文格数",value:m.characters,min:1,max:1200,onChange:E=>b({characters:E})}),v==="ECOMPOSITION"&&f.jsx(Yt,{label:"初始作文行数",children:f.jsx("span",{children:m.lines})}),v==="CCOMPOSITION"&&f.jsx(mt,{label:"题干区域高度",value:m.contentHeight,min:38,max:Number.MAX_SAFE_INTEGER,onChange:E=>b({contentHeight:E})})]}),m.parts.map((E,R)=>f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:`第 ${R+1} ${v==="FILLBLANK"?"空":"小题"}题号`,value:E.label,maxLength:10,onChange:N=>b({parts:m.parts.map(T=>T.id===E.id?{...T,label:N,choice:{...T.choice,label:N}}:T)})}),!ke(v)&&f.jsx(Qt,{label:`第 ${R+1} ${v==="FILLBLANK"?"空":"小题"}分值`,value:E.score,max:w.score,onChange:N=>{const T=m.parts.map(O=>O.id===E.id?{...O,score:N,choice:{...O.choice,score:N}}:O);b({parts:T,score:Un(T)})}}),["FILLBLANK","SHORTANSWER"].includes(v)&&r.type!=="MIXED"&&!r.optional&&y>1&&f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除第 ${R+1} ${v==="FILLBLANK"?"空":"小题"}`,onClick:()=>{const N=m.parts.filter(T=>T.id!==E.id).map((T,O)=>({...T,label:y===2?m.label:`${m.label}.${O+1}`}));b({parts:N,score:Un(N)})},children:"删除"}),v==="SHORTANSWER"&&!r.optional&&f.jsx(mt,{label:`第 ${R+1} 小题作答高度`,value:E.height,min:30,max:Number.MAX_SAFE_INTEGER,onChange:N=>b({parts:m.parts.map(T=>T.id===E.id?{...T,height:N}:T)})})]},E.id)),m.parts.length>0&&f.jsx(Yt,{label:"本题总分",children:f.jsx("span",{children:m.score??"未设置"})}),!Ct(v)&&!si(v)&&f.jsx(qt,{checked:m.halfPoint,onChange:E=>b({halfPoint:E.target.checked}),children:"计分栏显示 0.5"}),h&&f.jsx("p",{className:"card-choice-error",role:"alert",children:h}),f.jsx(ue,{size:"small",disabled:!s,onClick:()=>{if((y?m.parts:[m]).some(E=>E.score===null||E.score<.5||E.score>w.score)){g("请填写符合题型范围的分值");return}if(m.parts.some(E=>!E.label.trim())){g("题号不能为空");return}if(v==="INFO_MATCHING"&&y>C){g("选项个数需大于等于子题数量");return}if(v==="CHUNK_CHOICE"&&(!m.rightAnswers||m.rightAnswers>=C||m.singleScore===null||m.score!==null&&m.rightAnswers*m.singleScore>m.score)){g("正确答案个数须小于选项数,且每处得分之和不能超过题分");return}if(v==="MCHOICE"&&(m.choice.lessScore||0)>(m.score||0)){g("少选得分不能超过本题分值");return}a(m)&&u(null)},children:"应用配置"})]})}function aN({block:n,autoFocus:r,onClose:l}){const{card:a,setCard:c,setSelectedId:s,setDeleted:u,updateBlock:h,editQuestion:g,selectedChoiceId:m,selectChoice:b}=Tt(),{dialog:v,setDialog:w,titleProps:C,cancelDrag:y}=Id(T=>{const O=T.closest(".card-workspace")?.querySelector(".card-sidebar")?.getBoundingClientRect();return{left:(O?.left??window.innerWidth)-T.getBoundingClientRect().width-12,top:(O?.top??0)+12}}),S=x.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);x.useLayoutEffect(()=>{if(!v)return;const T=v;T.setAttribute("aria-modal","false"),T.setAttribute("aria-labelledby","card-block-modal-title");let O=document.activeElement instanceof HTMLElement?document.activeElement:null;const D=M=>{M.target instanceof HTMLElement&&!T.contains(M.target)&&(O=M.target)};return document.addEventListener("focusin",D),()=>{document.removeEventListener("focusin",D),T.contains(document.activeElement)&&O?.isConnected&&O.focus({preventScroll:!0})}},[v]),x.useLayoutEffect(()=>{v&&(v.dataset.settingsBlock=n.id)},[v,n.id]);const E=f.jsxs("div",{...C,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:n.reference?Wn[n.reference.type]:im[n.kind]})]}),R=()=>{u({block:n,index:a.blocks.findIndex(T=>T.id===n.id)}),c(T=>({...T,blocks:T.blocks.filter(O=>O.id!==n.id)})),s(null),l()},N=f.jsxs("div",{className:"card-modal-actions",children:[f.jsxs(ue,{type:"text",danger:!0,className:"card-delete","aria-label":"删除选中题块",onClick:R,children:[f.jsx(Oo,{name:"trash",size:16}),"删除题块"]}),f.jsx(ue,{type:"text",onClick:()=>{const T=fo(n);c(O=>{const D=[...O.blocks];return D.splice(D.findIndex(M=>M.id===n.id)+1,0,T),{...O,blocks:D}}),s(T.id)},children:"复制题块"}),f.jsx(ue,{type:"primary",className:"card-edit-question",onClick:()=>g(n.id),children:"编辑题目"})]});return f.jsx(Cs,{open:!0,modal:!1,panelRef:w,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(Oo,{name:"close",size:16}),onCancel:l,onOpenAutoFocus:T=>{T.preventDefault(),r?v?.querySelector(".ui-dialog-close")?.focus({preventScroll:!0}):S.current?.focus({preventScroll:!0})},onEscapeKeyDown:T=>{T.preventDefault(),T.stopPropagation(),y()||l()},title:E,footer:N,children:f.jsxs("div",{children:[f.jsxs("label",{className:"card-field",children:["标题",f.jsx(Oi,{"aria-label":"题块标题",value:n.title,maxLength:300,onChange:T=>h(n.id,{title:T.target.value})})]}),n.reference&&f.jsx(rN,{block:n,value:n.reference,selectedId:m(n),onSelect:T=>b(n.id,T),onChange:(T,O)=>h(n.id,{reference:T,...O?{document:O}:{}})}),!n.reference&&n.kind==="choice"&&n.choices&&f.jsx(Tv,{value:n.choices,document:n.document,creation:a.creation,selectedId:m(n),onSelect:T=>b(n.id,T),onChange:T=>h(n.id,{choices:T})}),!n.reference&&n.kind!=="choice"&&n.exercise&&f.jsx(eN,{value:n.exercise,kind:n.kind,blockId:n.id,selectedId:m(n),onSelect:T=>b(n.id,T),onChange:T=>h(n.id,{exercise:T})}),!n.reference&&n.kind!=="choice"&&!n.exercise&&f.jsxs("div",{className:"card-range",children:["作答区高度 ",f.jsxs("b",{children:[n.answerHeight," px"]}),f.jsx(hv,{className:"ui-slider",ariaLabelForHandle:"作答区高度",min:0,max:800,step:10,value:n.answerHeight,onChange:T=>h(n.id,{answerHeight:T})}),f.jsx(ue,{size:"small",onClick:()=>{if(n.kind==="choice")return;const T=BS(n.kind);T.items[0].area.rows=Math.ceil(n.answerHeight/T.items[0].area.rowHeight),h(n.id,{exercise:T})},children:"启用题型配置"})]})]},n.id)})}function iN(n){const r=new URLSearchParams(location.search);return{mode:r.get("mode")==="exam"?"exam":"template",name:(r.get("name")||"").slice(0,30),...Jh(n,{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 lN({initial:n,dictionary:r,replacing:l,onCreate:a,onClose:c}){const[s,u]=x.useState(n),h={...s,...Jh(r,s)},g=r.gradeCourseMap[h.gradeCode]||[],[m,b]=x.useState(""),v=x.useId(),w=x.useRef(null),{dialog:C,setDialog:y,titleProps:S}=Id();x.useLayoutEffect(()=>{C?.setAttribute("aria-labelledby",`${v}-title`)},[C,v]);const E=f.jsx("div",{...S,className:"card-modal-drag","aria-label":"拖动新建答题卡",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:`${v}-title`,children:"新建答题卡"})});return f.jsx(Cs,{open:!0,panelRef:y,width:460,className:"card-modal card-create-modal",title:E,closeLabel:"关闭新建答题卡",closeIcon:f.jsx(Oo,{name:"close",size:16}),onCancel:c,onOpenAutoFocus:R=>{R.preventDefault(),w.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:v,disabled:!h.gradeCode||!h.courseCode,children:"确定"})]}),children:f.jsxs("form",{id:v,onSubmit:R=>{if(R.preventDefault(),!h.name.trim()){b("请输入题卡名称"),w.current?.focus();return}if(!h.gradeCode||!h.courseCode){b("没有可用的年级和课程");return}a({...h,name:h.name.trim()})},children:[f.jsx("div",{className:"card-create-mode",role:"group","aria-label":"创建用途",children:["template","exam"].map(R=>f.jsx(ue,{type:h.mode===R?"primary":"default","aria-pressed":h.mode===R,onClick:()=>u(N=>({...N,mode:R})),children:R==="template"?"答题卡模板":"考试答题卡"},R))}),f.jsxs("label",{className:"card-field",children:["题卡名称",f.jsx(Oi,{ref:w,"aria-label":"题卡名称",status:m?"error":void 0,"aria-invalid":!!m,"aria-describedby":m?"card-create-error":void 0,placeholder:"请输入题卡名称",maxLength:30,value:h.name,onChange:R=>{u(N=>({...N,name:R.target.value})),b("")}})]}),f.jsxs("div",{className:"card-create-subject",children:[f.jsxs("label",{className:"card-field",children:["年级",f.jsx(Vt,{"aria-label":"年级",value:h.gradeCode,disabled:!r.grades.length,onChange:R=>u(N=>({...N,...ni(r,R,r.gradeCourseMap[R][0].value)})),children:r.grades.map(R=>f.jsx("option",{value:R.value,children:R.label},R.value))})]}),f.jsxs("label",{className:"card-field",children:["科目",f.jsx(Vt,{"aria-label":"科目",value:h.courseCode,disabled:!g.length,onChange:R=>u(N=>({...N,...ni(r,h.gradeCode,R)})),children:g.map(R=>f.jsx("option",{value:R.value,children:R.label},R.value))})]})]}),!r.grades.length&&f.jsx("p",{className:"card-create-error",role:"alert",children:"没有可用的年级和课程"}),m&&f.jsx("p",{id:"card-create-error",className:"card-create-error",role:"alert",children:m}),l&&f.jsx("p",{className:"card-section-note",children:"确定后将新建空白题卡并替换当前内容。"})]})})}function sN(){const{card:n,setCard:r,setQuestionCard:l,readOnly:a,geometry:c}=Tt(),s=u=>r(h=>h.header?{...h,header:{...h.header,...u}}:h);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(oi).map((u,h)=>f.jsxs(ue,{type:"text","aria-label":oi[u].label,"aria-pressed":n.preset===u,disabled:a,onClick:()=>r(g=>({...g,preset:u})),children:[f.jsx("span",{className:`card-paper-icon cols-${oi[u].columns}`,children:Array.from({length:oi[u].columns},(g,m)=>f.jsx("i",{},m))}),f.jsx("span",{children:["一栏","两栏","三栏"][h]})]},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(ht.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!n.scanMarking,onChange:u=>r(h=>({...h,scanMarking:u.target.value,blocks:h.blocks.map(g=>g.reference?.optional&&!u.target.value?{...g,reference:{...g.reference,choose:1}}:g)})),children:[f.jsx(ht.Button,{value:!1,children:"手阅"}),f.jsx(ht.Button,{value:!0,children:"网阅"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"分值 0.5"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!n.halfPoint,onChange:u=>r(h=>({...h,halfPoint:u.target.value,blocks:h.blocks.map(g=>g.reference?{...g,reference:{...g.reference,questions:g.reference.questions.map(m=>({...m,halfPoint:u.target.value}))}}:g)})),children:[f.jsx(ht.Button,{value:!0,children:"显示"}),f.jsx(ht.Button,{value:!1,children:"不显示"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡合一"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",name:"question-card",disabled:a,value:n.questionCard!==!1,onChange:u=>l(u.target.value),children:[f.jsx(ht.Button,{value:!0,children:"是"}),f.jsx(ht.Button,{value:!1,children:"否"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题排列"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",disabled:a,value:n.choiceDirection||"row",onChange:u=>r(h=>({...h,choiceDirection:u.target.value})),children:[f.jsx(ht.Button,{value:"row",children:"横排"}),f.jsx(ht.Button,{value:"column",children:"竖排"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题合并"}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!n.mergeObjective,onChange:u=>r(h=>({...h,mergeObjective:u.target.value})),children:[f.jsx(ht.Button,{value:!1,children:"不合并"}),f.jsx(ht.Button,{value:!0,children:"合并"})]})]}),n.header&&f.jsxs(x.Fragment,{children:[[["focusText","注意事项"],["writeKaohao","考场/座位号"],["missExam","填涂标记"],["mifeng","密封线"]].map(([u,h])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:h}),f.jsxs(ht.Group,{className:"card-radio-options",size:"small",name:`header-${u}`,disabled:a,value:n.header[u],onChange:g=>s({[u]:g.target.value}),children:[f.jsx(ht.Button,{value:!0,children:"显示"}),f.jsx(ht.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(ht.Group,{className:"card-radio-options",size:"small",name:"header-kaohao",disabled:a,value:n.header.kaohao,onChange:u=>s({kaohao:u.target.value}),children:[f.jsx(ht.Button,{value:"code",children:"条形码"}),f.jsx(ht.Button,{value:"school",children:"校内准考证号"})]})]}),n.header.kaohao==="school"&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"考号位数"}),f.jsx(Vt,{"aria-label":"准考证号位数",size:"small",disabled:a,value:n.header.weishu,onChange:u=>s({weishu:Number(u)}),children:Array.from({length:9},(u,h)=>f.jsxs("option",{value:h+4,children:[h+4,"位"]},h))})]})]})]})]})}function cN(){const{card:n,creationDictionary:r,saveMessage:l,saveAction:a,setCard:c,creationOpen:s,setCreationOpen:u,newCard:h,selectedId:g,setSelectedId:m,settingsId:b,setSettingsId:v,settingsAutoFocus:w,openSettings:C,readOnly:y,setReadOnly:S,titleOverflow:E,deleted:R,setDeleted:N,overflow:T,placementById:O,fitPage:D,moveBlock:M,selectBlock:z,download:H}=Tt(),G=n.blocks.find(I=>I.id===b),[X,U]=x.useState(!1),[F,J]=x.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":!y,onClick:()=>S(!1),children:"编辑"}),f.jsx(ue,{type:"text","aria-pressed":y,onClick:()=>S(!0),children:"预览"})]}),f.jsxs(ue,{type:"text",onClick:H,className:"card-export",children:[f.jsx(Oo,{name:"upload",size:15}),a]})]}),l&&f.jsx("div",{className:"card-overflow-notice",role:"status",children:l}),f.jsx("div",{className:"card-panel-fit",children:f.jsx(ue,{type:"text",onClick:D,children:"适合宽度"})}),T.length>0&&f.jsxs("div",{className:"card-overflow-notice",role:"alert",children:[T.length," 个题块超出单栏,内容可滚动查看。请调整版式、正文或作答高度。"]}),E&&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:n.title||"未新建答题卡"}),n.creation&&f.jsxs("p",{className:"card-section-note",children:[n.creation.mode==="template"?"答题卡模板":"考试答题卡"," · ",n.creation.grade," · ",n.creation.subject]}),f.jsx(ue,{type:"text",className:"card-add-component",onClick:()=>u(!0),children:"新建答题卡"})]}),f.jsx(sN,{}),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:[n.blocks.length," 个"]})]}),f.jsx("p",{className:"card-section-note",children:"拖动列表调整顺序,点击打开题块设置"}),!n.blocks.length&&f.jsx("p",{className:"card-section-note",children:"从一道题开始,添加空白题块后编辑内容。"}),f.jsx("ol",{className:"card-outline",children:n.blocks.map((I,Y)=>{const k=O.get(I.id);return f.jsxs("li",{className:g===I.id?"active":"",draggable:!y,onDragStart:$=>{J(I.id),$.dataTransfer.effectAllowed="move",$.dataTransfer.setData("text/plain",I.id)},onDragEnd:()=>J(null),onDragOver:$=>{!y&&F&&$.preventDefault()},onDrop:$=>{$.preventDefault(),F&&!y&&M(F,Y),J(null)},children:[f.jsxs(ue,{type:"text",className:"card-outline-item","aria-haspopup":y?void 0:"dialog",onClick:()=>{y?z(I.id,!0):C(I.id)},children:[f.jsx("span",{className:"card-outline-number",children:String(Y+1).padStart(2,"0")}),f.jsxs("span",{children:[f.jsx("strong",{children:I.title||im[I.kind]}),f.jsxs("small",{children:["第 ",k.page+1," 页 · 第 ",k.column+1," 栏",k.overflowing?" · 超出":""]})]})]}),!y&&f.jsxs("div",{className:"card-reorder",children:[f.jsx(ue,{type:"text","aria-label":`上移题块 ${Y+1}`,title:"上移",disabled:Y===0,onClick:()=>M(I.id,Y-1),children:"↑"}),f.jsx(ue,{type:"text","aria-label":`下移题块 ${Y+1}`,title:"下移",disabled:Y===n.blocks.length-1,onClick:()=>M(I.id,Y+1),children:"↓"})]})]},I.id)})}),!y&&f.jsx("div",{className:"card-add",children:f.jsx(ue,{type:"text","aria-haspopup":"dialog",onClick:()=>U(!0),children:"+ 添加题块"})})]}),f.jsxs("div",{className:"card-sidebar-bottom",children:[f.jsx("span",{className:"card-version-dot"}),"自动排版已开启",f.jsx("span",{children:"连续换栏"})]})]}),s&&f.jsx(lN,{initial:iN(r),dictionary:r,replacing:!!(n.paperTitle||n.blocks.length),onCreate:h,onClose:()=>u(!1)}),G&&!y&&f.jsx(aN,{block:G,autoFocus:w,onClose:()=>v(null)}),X&&!y&&!s&&f.jsx(KR,{creation:n.creation,onClose:()=>U(!1),onAdd:I=>{const Y=fm(I);c(k=>({...k,blocks:[...k.blocks,Y]})),U(!1),C(Y.id)}}),R&&f.jsxs("div",{className:"card-toast",role:"status",children:["题块已删除",f.jsx(ue,{type:"text",onClick:()=>{c(I=>{const Y=[...I.blocks];return Y.splice(R.index,0,R.block),{...I,blocks:Y}}),m(R.block.id),N(null)},children:"撤销"}),f.jsx(ue,{type:"text","aria-label":"关闭删除提示",onClick:()=>N(null),children:f.jsx(Oo,{name:"close",size:14})})]})]})}function Rv({settings:n,activeQuestionId:r}){if(!n.questions.length)return null;const l=Fc(n),a=s=>f.jsxs("div",{className:`card-choice-row${s.id===r?" is-current-choice":""}`,"data-question-id":s.id,"aria-current":s.id===r?"true":void 0,children:[f.jsxs("b",{children:[s.label,"."]}),f.jsx("div",{className:"card-choice-options","data-marker":n.marker,children:s.options.map(u=>f.jsx("span",{className:"card-choice-glyph","data-option-id":u.id,"data-marker":n.marker,children:n.marker==="check"?`○ ${u.label}.`:u.label},u.id))})]},s.id),c=[[]];for(const s of n.questions)s.breakBefore&&c[c.length-1].length&&c.push([]),c[c.length-1].push(s);return f.jsx("div",{className:"card-choice-grid","aria-label":"选择题填涂区",style:{rowGap:n.rowGap,columnGap:n.columnGap},"data-direction":l,children:l==="column"?LS(n).map((s,u)=>f.jsx("div",{className:"card-choice-band",style:{columnGap:n.columnGap,rowGap:n.rowGap},children:s.map(h=>f.jsx("div",{className:"card-choice-column",style:{gap:n.rowGap,minHeight:n.rowsPerColumn*20+(n.rowsPerColumn-1)*n.rowGap},children:h.map(a)},h[0].id))},u)):c.map((s,u)=>f.jsx("div",{className:"card-choice-band",style:{rowGap:n.rowGap,columnGap:n.columnGap},children:s.map(a)},u))})}function Nv(n){const r=n.getBoundingClientRect(),l=getComputedStyle(n),a=u=>Math.round(u*64)/64,c=a(parseFloat(l.width)+(l.boxSizing==="border-box"?0:parseFloat(l.paddingLeft)+parseFloat(l.paddingRight)+parseFloat(l.borderLeftWidth)+parseFloat(l.borderRightWidth))),s=c>0&&r.width>0?r.width/c:1;return u=>{const h=u.getBoundingClientRect();let g=0;for(let m=u;m&&m!==n;m=m.parentElement)g+=parseFloat(m.style.translate.split(/\s+/)[1])||0;return{top:a((h.top-r.top)/s-g),height:a(h.height/s),width:a(h.width/s)}}}function Av(n){return Nv(n.closest(".card-question")||n)(n)}function uN(n){return Av(n).top}function Os({id:n,label:r,value:l,visible:a,readOnly:c,placement:s,onUnits:u,onChange:h,onActiveFragment:g,uploadImage:m,choiceFillPosition:b,choiceFillBindings:v,activeChoiceQuestionId:w,contentTargets:C,editorKeys:y,onContentSelect:S}){const{geometry:E,registerEditor:R}=Tt(),N=JSON.stringify(y||[]),T=x.useCallback(J=>{JSON.parse(N).forEach(I=>R(`content/${I}`,J))},[N,R]),O=x.useRef(null),D=x.useRef(!1);a&&(D.current=!0);const M=x.useRef([]),[z,H]=x.useState(0),G=x.useRef({id:n,visible:a,onUnits:u});G.current={id:n,visible:a,onUnits:u};const X=x.useCallback(()=>{const J=O.current?.querySelector(".rt-content"),I=J?uN(J):0;H(Y=>Math.abs(Y-I)<.5?Y:I),G.current.onUnits(G.current.id,G.current.visible?M.current.map(Y=>({top:Y.top+I,bottom:Y.bottom+I})):[])},[]),U=x.useCallback(J=>{M.current=J,X()},[X]);x.useLayoutEffect(()=>{X()},[X,a,s.fragments,l]),x.useLayoutEffect(()=>()=>G.current.onUnits(G.current.id,[]),[]);const F=x.useMemo(()=>s.fragments.map(J=>({from:J.from-z,to:J.to-z,x:J.x-s.x,y:J.y-s.y-J.from+(J.topPadding||0)})),[s.fragments,s.x,s.y,z]);return f.jsx("div",{ref:O,className:"exercise-text",hidden:!a,children:D.current&&f.jsx(Ai,{value:l,readOnly:c||!a,uploadImage:m,ariaLabel:r,onChange:h,onEditor:T,contentTargets:C,allowContentAssignment:!1,onContentSelect:S,pagination:{slices:F,maxUnitHeight:E.contentHeight-80,onMeasure:U,onActiveSliceChange:g},choiceFillPosition:b,choiceFillBindings:v,activeChoiceQuestionId:w})})}function dN({rows:n,rowHeight:r,label:l,onChange:a}){const{scale:c}=Tt(),s=x.useRef(null),u=()=>{s.current&&a(s.current.rows),s.current=null};return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":`调整 ${l} 题作答高度`,title:"拖动调整作答高度",onPointerDown:h=>{h.preventDefault(),h.stopPropagation(),h.currentTarget.focus(),s.current={y:h.clientY,rows:n},h.currentTarget.setPointerCapture(h.pointerId)},onPointerMove:h=>{s.current&&a(Math.max(1,Math.min(120,s.current.rows+Math.round((h.clientY-s.current.y)/c/r))))},onPointerUp:h=>{s.current=null,h.currentTarget.releasePointerCapture(h.pointerId)},onPointerCancel:u,onLostPointerCapture:()=>{s.current=null},onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u()),["ArrowUp","ArrowDown"].includes(h.key)&&(h.preventDefault(),a(Math.max(1,Math.min(120,n+(h.key==="ArrowDown"?1:-1)))))}})}function Mv({blank:n,item:r,active:l,fullLabel:a=!1}){return f.jsxs("div",{style:{width:`${n.width}%`},className:`exercise-flow-unit exercise-blank${l?" is-current":""}`,"data-exercise-id":r.id,"data-answer-id":n.id,children:[f.jsxs("span",{children:[a?`${r.label}.${n.label}`:`(${n.label})`," ",n.prefix]}),f.jsx("span",{className:`exercise-blank-space ${n.style}`,children:n.style==="characters"&&Array.from({length:n.characters},(c,s)=>f.jsx("i",{},s))}),f.jsx("span",{children:n.suffix})]})}function fN({area:n,item:r,active:l,readOnly:a,onResize:c,prefix:s=""}){const u={"--area-columns":n.columns,"--area-line":`${n.rowHeight}px`};return f.jsxs("div",{className:"exercise-area","data-style":n.style,style:u,children:[n.title&&f.jsxs("div",{className:`exercise-flow-unit exercise-title-line${l?" is-current":""}`,"data-exercise-id":r.id,children:["题目:",f.jsx("span",{})]}),Array.from({length:n.rows},(h,g)=>f.jsxs("div",{className:`exercise-flow-unit exercise-area-row${l?" is-current":""}`,"data-exercise-id":r.id,"data-area-row":g,style:{height:n.rowHeight,...n.backgroundUrl?{backgroundImage:`url(${JSON.stringify(n.backgroundUrl)})`,backgroundSize:`100% ${n.rows*n.rowHeight}px`,backgroundPosition:`0 -${g*n.rowHeight}px`}:{}},children:[s&&g===0&&f.jsx("span",{className:"exercise-area-prefix",children:s}),n.style==="characters"&&Array.from({length:n.columns},(m,b)=>{const v=g*n.columns+b+1;return f.jsx("span",{className:"exercise-character",children:n.wordMark>0&&v%n.wordMark===0&&f.jsxs("small",{children:[v,"字"]})},b)}),n.style==="coordinates"&&g===Math.floor(n.rows/2)&&f.jsx("span",{className:"exercise-axis-x",children:"x →"}),n.style==="coordinates"&&g===0&&f.jsx("span",{className:"exercise-axis-y",children:"↑ y"})]},g)),!a&&n.rows>0&&f.jsx(dN,{rows:n.rows,rowHeight:n.rowHeight,label:r.label,onChange:c})]})}function hN({value:n,kind:r,placement:l,showQuestion:a,readOnly:c,activeId:s,onUnits:u,onChange:h,onActiveFragment:g,uploadImage:m}){const b=(S,E="")=>`exercise-flow-unit ${E}${S===s?" is-current":""}`,v=n.pool,w=x.useMemo(()=>new Map(n.items.filter(S=>S.kind==="choice").map(S=>[S.id,Ko({...Kc(0),presentation:S.presentation,questions:[S.choice]},S.document,a)])),[n.items,a]),C=(S=!1)=>v.map(E=>f.jsxs("div",{className:"exercise-pool-entry",children:[f.jsxs("div",{className:"exercise-flow-unit exercise-pool-option","data-pool-id":E.id,children:[S?"● ":"",E.label,". ",a?E.text:""]}),E.document&&f.jsx(Os,{id:`pool/${E.id}`,label:`共享选项 ${E.label} 正文`,value:E.document,visible:a,readOnly:c,placement:l,uploadImage:m,onUnits:u,onActiveFragment:g,onChange:R=>h({...n,pool:n.pool.map(N=>N.id===E.id?{...N,document:R}:N)})})]},E.id)),y=["fill","completion"].includes(r)&&(!a||n.items.every(S=>pn(S.document)));if(r==="chunk"){let S=0;const E=n.chunkPoints.map(R=>{const N=n.chunkText.slice(S,R.offset);return S=R.offset,{text:N,...R}});return f.jsxs("div",{className:"exercise-content",children:[f.jsx(Os,{id:"chunk-material",label:"断句题面",value:{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:E.map(R=>`${R.text}〔${R.label}〕`).join("")+n.chunkText.slice(S)||" "}]}]}},visible:a,readOnly:!0,placement:l,onUnits:u,onChange:()=>{},onActiveFragment:g}),f.jsxs("div",{className:"exercise-flow-unit exercise-chunk-answer",children:[n.chunkPoints.map(R=>f.jsx("span",{className:"exercise-mark","data-answer-id":R.id,children:R.label},R.id)),f.jsxs("span",{children:["(最多选 ",n.chunkMax," 处)"]})]})]})}return f.jsxs("div",{className:"exercise-content","data-exercise-kind":r,children:[y&&f.jsx("div",{className:"exercise-blanks",children:n.items.map(S=>f.jsxs(x.Fragment,{children:[S.blanks.map(E=>f.jsxs(x.Fragment,{children:[f.jsx(Mv,{blank:E,item:S,active:S.id===s,fullLabel:!0}),E.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},E.id)),n.fillNewLine&&f.jsx("span",{className:"exercise-line-break"})]},S.id))}),r==="optional"&&f.jsxs("div",{className:"exercise-flow-unit exercise-optional-head",children:["从以下 ",n.items.length," 题中选做 ",n.chooseCount," 题",n.groupScore!==null?`,共 ${n.groupScore} 分`:"","。",f.jsxs("span",{children:["选做题号:",n.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"||n.matchingDisplay==="letters")&&C(),f.jsxs("div",{hidden:y,className:r==="matching"&&n.matchingDisplay==="lines"?"exercise-matching-layout":void 0,children:[f.jsx("div",{children:r==="ordering"?f.jsx("div",{children:n.ordering==="sequence"?f.jsxs("div",{className:"exercise-flow-unit exercise-sequence",children:["排序:",v.map((S,E)=>f.jsxs("span",{children:[f.jsx("span",{className:"exercise-order-slot","data-answer-id":S.id}),E<v.length-1?"→":""]},S.id))]}):n.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))}):n.items.map(S=>{const E=S.id===s,R=w.get(S.id),N=!y&&(S.kind==="table"||a&&(!pn(S.document)||!c&&(nm.includes(r)||n.items.length>1||r==="matching")));return f.jsxs("div",{className:"exercise-item","data-exercise-item":S.id,children:[f.jsxs("div",{className:b(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"&&n.matchingDisplay==="lines"&&f.jsx("span",{className:"exercise-connector",children:"●"})]}),f.jsx(Os,{id:S.id,label:`小题 ${S.label} 正文`,value:S.document,visible:N,readOnly:c,placement:l,uploadImage:m,onUnits:u,onActiveFragment:g,onChange:T=>h({...n,items:n.items.map(O=>O.id===S.id?{...O,document:T}:O)}),choiceFillPosition:R?.position,choiceFillBindings:R?.bindings,activeChoiceQuestionId:E?S.id:void 0}),(S.kind==="judge"||S.kind==="choice"&&!!R?.concentrated.questions.length)&&f.jsx("div",{className:b(S.id,"exercise-choices"),"data-exercise-id":S.id,children:(S.kind==="judge"?S.choice.options.slice(0,2):S.choice.options).map((T,O)=>f.jsx("span",{className:`exercise-mark${S.kind==="choice"||n.judgeLabels!=="words"?" exercise-choice-mark":""}`,"data-answer-id":T.id,children:S.kind==="judge"?rm[n.judgeLabels][O]:T.label},T.id))}),r==="matching"&&n.matchingDisplay==="letters"&&f.jsx("div",{className:b(S.id,"exercise-match-letters"),"data-exercise-id":S.id,children:f.jsx("span",{className:"exercise-order-slot"})}),r!=="matching"&&S.kind==="fill"&&!y&&f.jsx("div",{className:"exercise-blanks","data-new-line":n.fillNewLine,children:S.blanks.map(T=>f.jsxs(x.Fragment,{children:[f.jsx(Mv,{blank:T,item:S,active:E}),T.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},T.id))}),S.steps.map(T=>f.jsxs("div",{className:b(S.id,"exercise-step"),"data-exercise-id":S.id,"data-step-id":T.id,children:[f.jsxs("span",{children:["(",T.label,") ",T.prompt,T.score!==null?`(${T.score} 分)`:""]}),f.jsx("span",{className:"exercise-step-answer"})]},T.id)),(["answer","calculation","correction","drawing","writing","english"].includes(S.kind)||S.kind==="judge"&&S.needsReason)&&f.jsx(fN,{area:S.area,item:S,active:E,readOnly:c,onResize:T=>h({...n,items:n.items.map(O=>O.id===S.id?{...O,area:{...O.area,rows:T}}:O)})})]},S.id)})}),r==="matching"&&n.matchingDisplay==="lines"&&f.jsx("div",{children:C(!0)})]}),r==="practice"&&f.jsxs("div",{className:"exercise-flow-unit exercise-evaluation",children:["评价意见:",f.jsx("span",{})]})]})}function mN({height:n,min:r,label:l,onChange:a}){const{scale:c}=Tt(),s=x.useRef(null);return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":l,onPointerDown:u=>{u.preventDefault(),u.stopPropagation(),s.current={y:u.clientY,height:n},u.currentTarget.setPointerCapture(u.pointerId)},onPointerMove:u=>{s.current&&a(Math.max(r,Math.round(s.current.height+(u.clientY-s.current.y)/c)))},onPointerUp:u=>{s.current=null,u.currentTarget.releasePointerCapture(u.pointerId)},onLostPointerCapture:()=>{s.current=null},onPointerCancel:()=>{s.current&&a(s.current.height),s.current=null},onKeyDown:u=>{u.key==="Escape"&&s.current&&(a(s.current.height),s.current=null),["ArrowUp","ArrowDown"].includes(u.key)&&(u.preventDefault(),a(Math.max(r,n+(u.key==="ArrowDown"?10:-10))))}})}function zd({placement:n,children:r,className:l=""}){const a=x.useRef(null),[c,s]=x.useState({top:0,height:0});return x.useLayoutEffect(()=>{const u=()=>{const{top:g,height:m}=Av(a.current);s(b=>b.top===g&&b.height===m?b:{top:g,height:m})};u();const h=new ResizeObserver(u);return h.observe(a.current),()=>h.disconnect()},[n.fragments,r]),f.jsxs("div",{ref:a,className:`reference-paper-frame ${l}`,children:[r,n.fragments.map((u,h)=>{const g=Math.max(c.top,u.from),m=Math.min(c.top+c.height,u.to);return m>g&&f.jsx("div",{"aria-hidden":"true",className:"reference-paper-border",style:{left:u.x-n.x,top:g-c.top+u.y-n.y-u.from+(g>u.from&&u.topPadding||0),height:m-g+(g===u.from&&u.topPadding||0)+(m===u.to&&u.bottomPadding||0)}},h)})]})}function pN({score:n,halfPoint:r,active:l,id:a}){const{card:c}=Tt();return!c.scanMarking&&n!==null&&f.jsx("div",{className:`exercise-flow-unit reference-score-row${l?" is-current":""}`,"data-exercise-id":a,children:aC(n,r).map((s,u)=>f.jsx("span",{children:s},u))})}function Ld({question:n,part:r,props:l,optional:a=!1}){const{card:c,geometry:s,scale:u,selectChoice:h}=Tt(),{value:g,placement:m,width:b,readOnly:v,activeId:w,uploadImage:C,onUnits:y,onActiveFragment:S,onChange:E}=l,R=r?.id||n.id,N=r?.label||n.label,T=r?.score??n.score,O=w===R||w===n.id,D=x.useRef(null),[M,z]=x.useState(0),[H,G]=x.useState(()=>window.devicePixelRatio||1);x.useEffect(()=>{if(n.type!=="CCOMPOSITION")return;const K=()=>G(window.devicePixelRatio||1);return window.addEventListener("resize",K),()=>window.removeEventListener("resize",K)},[n.type]);const X=r?.document||n.document,U=K=>E({...g,questions:g.questions.map(ee=>ee.id===n.id?{...ee,...K}:ee)}),F=K=>U(r?{parts:n.parts.map(ee=>ee.id===r.id?{...ee,document:K}:ee)}:{document:K}),J=a?g.optionalHeight:r?.height||n.height;x.useLayoutEffect(()=>{const K=D.current.querySelector(".reference-answer-body"),ee=()=>z(K.offsetHeight);ee();const le=new ResizeObserver(ee);return le.observe(K),()=>le.disconnect()},[]);const I=(K="")=>`exercise-flow-unit ${K}${O?" is-current":""}`,Y=Math.max(0,J-M-(!c.scanMarking&&T!==null?18:0)),k=nC(b),$=k*31+1,L=Math.max(1,Math.round(H))/(H*u),Z=`M.5 .5H${$-.5}V32.5H.5Z`+Array.from({length:k-1},(K,ee)=>`M${(ee+1)*31+.5} .5V32.5`).join(""),A=n.type==="CCOMPOSITION"?Math.ceil(n.characters/k):Math.ceil(Y/40),V=K=>a?E({...g,optionalHeight:K}):U(r?{parts:n.parts.map(ee=>ee.id===r.id?{...ee,height:K}:ee)}:{height:K});return f.jsx("div",{ref:D,className:"reference-answer","data-exercise-item":R,children:f.jsxs(zd,{placement:m,className:n.type==="CCOMPOSITION"?"reference-composition":"",children:[f.jsx(pN,{score:T,halfPoint:n.halfPoint,active:O,id:R}),f.jsxs("div",{className:"reference-answer-body",children:[a&&f.jsxs("div",{className:I("reference-optional-head"),style:{minHeight:s.columns===3?104:82},"data-exercise-id":R,children:[f.jsxs("p",{children:[f.jsx("b",{children:"选做题"}),"  请考生从给出的第",g.questions.map(K=>K.label).join("、"),kd(g.questions.length),"题中任选",kd(g.choose),"题作答,并用2B铅笔在答题卡上把所选题目对应的题号涂黑,注意所做题目的题号必须与所涂题号一致,如果多做,则按所做的",g.choose===1?"第一题":`前${kd(g.choose)}题`,"计分。"]}),f.jsxs("p",{children:["我选做的题号是:",g.questions.map(K=>f.jsx("span",{"data-exercise-id":K.id,children:K.label},K.id))]})]}),f.jsx("div",{className:"reference-answer-text",style:{minHeight:n.type==="CCOMPOSITION"?n.contentHeight:void 0},children:(a?g.questions:[n]).map(K=>{const ee=a?K.parts[0]?.id||K.id:R,le=a?K.label:N,ce=a||!r||K.parts[0]?.id===r.id,ie=g.textVersion===1&&g.type!=="MIXED"&&ce,ge=ie&&l.showQuestion&&K.text,je=a?K.parts[0]?.document||K.document:X,be=ge?_r([..._l(K.text,K.id,K.label),...K.type==="ECOMPOSITION"?(je.content.content||[]).slice(1):[]]):je;return f.jsx("div",{"data-exercise-id":ee,className:"reference-answer-entry",children:f.jsx(Os,{id:`reference/${ee}`,label:`第 ${le} 题作答内容`,value:be,editorKeys:ie?[K.id,ee]:[ee],contentTargets:ge?[{id:K.id,label:`第 ${K.label} 题题干`,kind:"question"}]:void 0,onContentSelect:de=>h(l.blockId,de),visible:!0,readOnly:v,placement:m,uploadImage:C,onUnits:y,onActiveFragment:S,onChange:ge?de=>E({...g,questions:g.questions.map(Se=>Se.id===K.id?{...Se,text:um(Se.text,(de.content.content||[]).filter(_e=>Se.type!=="ECOMPOSITION"||_e.attrs?.contentId===Se.id)),...Se.type==="ECOMPOSITION"?{document:_r([Se.document.content.content[0],...(de.content.content||[]).filter(_e=>_e.attrs?.contentId!==Se.id)])}:{}}:Se)}):a?de=>E({...g,questions:g.questions.map(Se=>Se.id===K.id?{...Se,document:de,parts:Se.parts.map((_e,Ce)=>Ce===0?{..._e,document:de}:_e)}:Se)}):F})},ee)})})]}),Array.from({length:A},(K,ee)=>f.jsx("div",{className:I(`reference-answer-row ${n.type==="CCOMPOSITION"?"reference-character-row":""}`),"data-exercise-id":R,style:{height:n.type==="CCOMPOSITION"?39.5:Math.min(40,Y-ee*40)},children:n.type==="CCOMPOSITION"&&f.jsxs("div",{className:"reference-character-grid",children:[f.jsx("svg",{"aria-hidden":"true",className:"reference-character-lines",width:$,height:"33",viewBox:`0 0 ${$} 33`,children:f.jsx("path",{d:Z,fill:"none",stroke:"#000",strokeWidth:L,vectorEffect:"non-scaling-stroke",shapeRendering:"crispEdges"})}),Array.from({length:k},(le,ce)=>{const ie=ee*k+ce+1;return f.jsx("span",{className:"reference-character","data-character":ie<=n.characters?ie:void 0,"data-padding":ie>n.characters||void 0,children:ie<=n.characters&&ie%100===0&&f.jsxs("small",{children:[ie,"字"]})},ce)})]})},ee)),!v&&n.type!=="CCOMPOSITION"&&f.jsx(mN,{height:J,min:30,label:`调整第 ${N} 题作答高度`,onChange:V})]})})}function kd(n){const r="零一二三四五六七八九";return n<10?r[n]:n<100?`${n<20?"":r[Math.floor(n/10)]}十${n%10?r[n%10]:""}`:n===100?"一百":String(n)}function gN(n){const{value:r,placement:l,activeId:a,concentrated:c}=n,{card:s}=Tt(),u=new Set(c.questions.map(g=>g.id)),h=x.useMemo(()=>{const g=[];return r.questions.forEach(m=>{const b=Ct(m.type)?"choice":si(m.type)?"fill":"answer",v=g.at(-1);b!=="answer"&&v?.category===b?v.questions.push(m):g.push({category:b,questions:[m]})}),g},[r.questions]);return r.optional&&r.questions.length>1?f.jsx("div",{className:"reference-content",children:f.jsx(Ld,{question:r.questions[0],props:n,optional:!0})}):f.jsx("div",{className:"reference-content",children:h.map((g,m)=>f.jsxs(x.Fragment,{children:[g.category==="choice"&&Jo({...r,questions:g.questions}).some(b=>u.has(b.id))&&f.jsx(zd,{placement:l,className:"reference-choice-frame",children:f.jsx(Rv,{activeQuestionId:g.questions.find(b=>b.id===a&&ke(b.type))?.parts[0]?.id||a,settings:{...c,questions:Jo({...r,questions:g.questions}).filter(b=>u.has(b.id))}})}),g.category==="fill"&&f.jsx(zd,{placement:l,className:"reference-fill-frame",children:f.jsx("div",{className:"reference-fill-grid",children:g.questions.map(b=>f.jsxs(x.Fragment,{children:[b.parts.map(v=>f.jsxs(x.Fragment,{children:[f.jsxs("div",{className:`exercise-flow-unit reference-blank${s.scanMarking?" is-online":""}${a===b.id||a===v.id?" is-current":""}`,style:{width:`${v.width}%`},"data-exercise-id":v.id,"data-answer-id":v.id,children:[f.jsxs("span",{className:"reference-blank-number",children:[v.label,"."]}),f.jsx("span",{className:"reference-blank-line"}),!s.scanMarking&&f.jsx("span",{className:"reference-blank-score"})]}),v.breakAfter&&f.jsx("span",{className:"exercise-line-break"}),r.fillNewLine&&ke(b.type)&&f.jsx("span",{className:"exercise-line-break"})]},v.id)),r.fillNewLine&&!ke(b.type)&&f.jsx("span",{className:"exercise-line-break"})]},b.id))})}),g.category==="answer"&&g.questions.map(b=>b.type==="SHORTANSWER"?b.parts.map(v=>f.jsx(Ld,{question:b,part:v,props:n},v.id)):f.jsx(Ld,{question:b,props:n},b.id)),m<h.length-1&&f.jsx("div",{className:"reference-section-gap"})]},g.questions[0].id))})}function yN({hidden:n=!1,block:r,index:l,placement:a,width:c,scale:s,selected:u,readOnly:h,showQuestion:g,activeChoiceId:m,uploadImage:b,registerEditor:v,onSelect:w,onActiveFragment:C,onSettings:y,onMeasure:S,onDocument:E,onHeight:R,onExercise:N,onReference:T}){const{card:O,geometry:D,selectChoice:M}=Tt(),z=x.useMemo(()=>r.reference?Sv(r):void 0,[r.id,r.reference]),H=x.useMemo(()=>r.reference?Ko({...r.reference.layout,questions:Jo(r.reference)},r.document,g):r.kind==="choice"&&r.choices?Ko(r.choices,r.document,g):void 0,[r.reference,r.kind,r.choices,r.document,g]),X=!(r.reference?.textVersion===1&&r.reference.questions.length>0&&["SHORTANSWER","ECOMPOSITION","CCOMPOSITION"].includes(r.reference.type))&&!n&&r.id!==fr&&g&&(!h||!(r.exercise||r.reference)||!pn(r.document)||!!H?.bindings.length),U=x.useRef(null),F=x.useCallback(pe=>{U.current=pe,v(r.id,pe)},[r.id,v]),J=x.useMemo(()=>r.reference?BR(r.document,r.reference,c):r.document,[r.document,r.reference,c]);x.useEffect(()=>{U.current?.syncDocument(J)},[J]);const I=x.useRef(null),Y=x.useRef(S);Y.current=S;const k=x.useRef([]),$=x.useRef(new Map),[L,Z]=x.useState(0),[A,V]=x.useState(0),K=x.useRef(()=>{}),ee=pe=>{const ct=a.fragments.find(ut=>pe>=ut.from-.5&&pe<ut.to-.5);return ct?{x:ct.x-a.x,y:ct.y-a.y-ct.from+(ct.topPadding||0)}:{x:0,y:0}};K.current=()=>{const pe=I.current,ct=pe?.querySelector(".card-question-document .rt-content");if(n||!pe||!ct)return;const ut=Nv(pe.parentElement),an=X?ut(ct).top:0;Z(ve=>Math.abs(ve-an)<.5?ve:an);const hr=X?k.current.map(ve=>({top:an+ve.top,bottom:an+ve.bottom})):[];$.current.forEach(ve=>hr.push(...ve)),pe.querySelectorAll(".card-choice-row, .exercise-flow-unit").forEach(ve=>{if(ve.offsetParent===null)return;const{top:Ke,height:Ne}=ut(ve);hr.push({top:Ke,bottom:Ke+Ne});const Fe=ee(Ke);ve.style.translate=`${Fe.x}px ${Fe.y}px`}),pe.querySelectorAll("[data-exercise-resize]").forEach(ve=>{const Ke=ee(ut(ve).top);ve.style.translate=`${Ke.x}px ${Ke.y}px`});const pa=pe.querySelector(".card-answer-space:not(.card-answer-fragment)");if(pa){const{top:ve,height:Ke}=ut(pa);V(Fe=>Math.abs(Fe-ve)<.5?Fe:ve);const Ne=r.kind==="fill"?40:28;for(let Fe=ve;Fe<ve+Ke;Fe+=Ne)hr.push({top:Fe,bottom:Math.min(Fe+Ne,ve+Ke)})}const ga=ut(pe),Pr=pe.querySelectorAll(".reference-character-row"),mr=Pr.length?ut(Pr[0]).top:void 0,se=Pr.length?ut(Pr[Pr.length-1]).top:void 0,Re=Math.min(...hr.map(ve=>ve.bottom)),ye=[...new Set(hr.flatMap(ve=>[ve.top,ve.bottom]))].filter(ve=>ve>=Re&&ve<ga.height&&!hr.some(Ke=>ve>Ke.top+.5&&ve<Ke.bottom-.5)).filter(ve=>se===void 0||ve<=se).sort((ve,Ke)=>ve-Ke);Y.current({width:ga.width,height:ga.height,breaks:ye,...mr!==void 0?{compositionStart:mr}:{}})};const le=x.useCallback(pe=>{k.current=pe,K.current()},[]),ce=x.useCallback((pe,ct)=>{$.current.set(pe,ct),K.current()},[]),ie=x.useMemo(()=>a.fragments.map(pe=>({from:pe.from-L,to:pe.to-L,x:pe.x-a.x,y:pe.y-a.y-pe.from+(pe.topPadding||0)})),[a.fragments,a.x,a.y,L]);x.useLayoutEffect(()=>{K.current()},[a.fragments,r.answerHeight,r.choices,r.exercise,r.reference,g,X,n]);const ge=x.useRef(null),je=pe=>{pe.preventDefault(),pe.stopPropagation(),pe.currentTarget.focus(),ge.current={y:pe.clientY,height:r.answerHeight},pe.currentTarget.setPointerCapture(pe.pointerId)},be=pe=>{ge.current&&R(Math.max(0,Math.min(800,Math.round(ge.current.height+(pe.clientY-ge.current.y)/s))))},de=pe=>{ge.current=null,pe.currentTarget.releasePointerCapture(pe.pointerId)},Se=()=>{ge.current&&R(ge.current.height),ge.current=null},_e=pe=>{pe.key==="Escape"&&ge.current&&Se(),(pe.key==="ArrowUp"||pe.key==="ArrowDown")&&(pe.preventDefault(),R(Math.max(0,Math.min(800,r.answerHeight+(pe.key==="ArrowDown"?10:-10)))))};x.useEffect(()=>{const pe=I.current;let ct=0;const ut=new ResizeObserver(()=>{cancelAnimationFrame(ct),ct=requestAnimationFrame(()=>K.current())});return ut.observe(pe),()=>{ut.disconnect(),cancelAnimationFrame(ct)}},[]);const Ce=ee(A+r.answerHeight-1),Ae=`${Ce.x}px ${Ce.y}px`,$e=a.fragments.length>1,Dn=r.reference&&H&&f.jsx(gN,{blockId:r.id,showQuestion:g,value:r.reference,concentrated:O.mergeObjective&&r.id!==fr?{...H.concentrated,questions:[]}:H.concentrated,placement:a,width:c,readOnly:h,activeId:m,onUnits:ce,onChange:T,onActiveFragment:C,uploadImage:b}),jt=r.reference&&(Ct(r.reference.type)||r.id===fr);return f.jsx("article",{hidden:n,className:`card-question${u&&!h?" is-selected":""}${a.overflowing?" is-overflowing":""}${$e?" 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:!$e&&a.fragments[0]?.bottomPadding?a.height+a.fragments[0].bottomPadding:void 0,maxHeight:a.overflowing?a.available:void 0},onPointerDownCapture:()=>{h||w()},onFocusCapture:()=>{h||w()},"aria-label":r.title||`题块 ${l+1}`,children:f.jsxs("div",{className:"card-question-content",ref:I,children:[f.jsxs("div",{className:"card-question-heading",children:[f.jsx("h2",{children:h?r.title||`题块 ${l+1}`:f.jsx("button",{className:"card-question-title","aria-label":`设置题块 ${l+1}`,"aria-haspopup":"dialog",title:"打开题块设置",onClick:y,children:r.title||`题块 ${l+1}`})}),f.jsx("span",{children:String(l+1).padStart(2,"0")})]}),H&&!r.reference&&f.jsx(Rv,{settings:H.concentrated,activeQuestionId:m}),jt&&Dn,f.jsx("div",{className:"card-question-document",hidden:!X,children:f.jsx(Dd,{ref:F,initialValue:r.document,readOnly:h||!X,uploadImage:b,ariaLabel:`题块 ${l+1} 正文`,onChange:E,pagination:{slices:ie,maxUnitHeight:D.contentHeight-80,onMeasure:le,onActiveSliceChange:C},choiceFillPosition:H?.position,choiceFillBindings:H?.bindings,activeChoiceQuestionId:m,contentTargets:z,allowContentAssignment:r.reference?.textVersion!==1,onContentSelect:pe=>{pe!==r.id&&M(r.id,pe)}})}),!jt&&Dn,!r.reference&&r.exercise&&r.kind!=="choice"&&f.jsx(hN,{value:r.exercise,kind:r.kind,placement:a,showQuestion:g,readOnly:h,activeId:m,onUnits:ce,onChange:N,onActiveFragment:C,uploadImage:b}),!r.reference&&!r.exercise&&r.kind!=="choice"&&f.jsx("div",{className:`card-answer-space ${r.kind}${$e?" is-paginated-space":""}`,style:{height:r.answerHeight},"data-answer-height":r.answerHeight,children:!h&&f.jsxs("div",{className:"card-answer-controls",children:[f.jsx("span",{className:"card-answer-caption",style:{translate:Ae},children:r.kind==="writing"?"作文格":"作答区域"}),f.jsx("button",{className:"card-height-handle","aria-label":`调整题块 ${l+1} 作答高度`,title:"上下拖动调整作答区;方向键微调,Esc 取消",style:{translate:Ae},onPointerDown:je,onPointerMove:be,onPointerUp:de,onPointerCancel:Se,onLostPointerCapture:()=>{ge.current=null},onKeyDown:_e,children:f.jsx("span",{})})]})}),$e&&!r.reference&&!r.exercise&&r.kind!=="choice"&&a.fragments.map((pe,ct)=>{const ut=Math.max(pe.from,A),an=Math.min(pe.to,A+r.answerHeight);return an>ut&&f.jsx("div",{"aria-hidden":"true",className:`card-answer-space card-answer-fragment ${r.kind}`,style:{left:pe.x-a.x,top:ut+pe.y-a.y-pe.from,width:c,height:an-ut,backgroundPositionY:`${A-ut-1}px`}},ct)})]})})}function _v({seat:n=!1}){return f.jsx("div",{className:"card-student-fields",children:["姓名","班级","学号",...n?["考场/座位号"]:[]].map(r=>f.jsxs("div",{children:[f.jsxs("span",{children:[r,":"]}),f.jsx("i",{})]},r))})}function Dv(){return f.jsxs("div",{className:"card-barcode-area",children:[f.jsx("div",{children:"贴条形码区"}),f.jsx("small",{children:"正面朝上,切勿贴出虚线方框"})]})}function Rs(){return f.jsxs("div",{className:"card-header-marks",children:[f.jsxs("div",{children:["正确填涂:",f.jsx("i",{className:"filled"})]}),f.jsxs("div",{children:["缺考标记:",f.jsx("i",{})]})]})}function Iv({marks:n,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.请在规定区域内答题,超出答题区域书写无效。"})]})]}),n&&f.jsx(Rs,{})]})}function vN({settings:n,columns:r}){const l=n.kaohao==="school"&&n.weishu>9,a=!n.mifeng&&r===3||l,c=r!==3&&n.focusText&&n.missExam&&!n.mifeng&&n.kaohao==="code",s=r===3&&n.missExam&&!n.mifeng&&n.kaohao==="code",u=r===3&&n.missExam&&!n.mifeng&&n.kaohao==="school"&&[8,9].includes(n.weishu),h=r===3&&n.focusText&&n.missExam&&n.mifeng&&n.kaohao==="school"&&[8,9].includes(n.weishu),g=r!==3&&n.missExam&&!n.mifeng&&l,m=n.missExam&&!c&&!s&&!u&&!h&&!g,b=n.focusText||m;return f.jsxs("div",{className:"card-header-fields",children:[f.jsxs("div",{className:`card-header-left${n.mifeng&&(n.kaohao==="code"||l)?" full-width":""}`,children:[!n.mifeng&&f.jsx(_v,{seat:n.writeKaohao}),(u||g)&&f.jsx(Rs,{}),!a&&b&&f.jsx(Iv,{focusText:n.focusText,marks:m})]}),f.jsxs("div",{className:"card-header-number",children:[n.kaohao==="school"&&f.jsxs("div",{className:"card-exam-number","aria-label":`${n.weishu}位准考证号码`,children:[f.jsx("div",{className:"card-exam-number-heading",children:"准考证号码"}),f.jsx("div",{className:"card-exam-number-columns",children:Array.from({length:n.weishu},(v,w)=>f.jsxs("div",{className:"card-exam-number-column",children:[f.jsx("div",{className:"card-exam-number-input"}),Array.from({length:10},(C,y)=>f.jsxs("div",{className:"card-exam-number-digit",children:["[",f.jsx("span",{children:y}),"]"]},y))]},w))})]}),n.kaohao==="code"&&!n.mifeng&&f.jsx(Dv,{}),(c||s)&&f.jsx(Rs,{})]}),h&&f.jsx(Rs,{}),a&&b&&f.jsx(Iv,{focusText:n.focusText,marks:m})]})}function bN({settings:n,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${n.kaohao==="code"?" with-barcode":""}`,children:[f.jsx(_v,{seat:n.writeKaohao}),n.kaohao==="code"&&f.jsx(Dv,{})]})]})}function xN({title:n,page:r=0}){const{card:l,setCard:a,readOnly:c,geometry:s,scale:u,setTitleMeasurement:h,uploadImage:g,registerEditor:m}=Tt(),b=x.useRef(null),v=x.useRef(null),w=x.useRef(null);x.useEffect(()=>{const E=`title/${n.id}/${r}`;return m(E,w.current),()=>m(E,null)},[n.id,r,m]);const C=x.useRef(null),y=x.useCallback(()=>{const E=b.current,R=v.current;if(!E||!R||r!==0)return;const N={id:n.id,width:E.offsetWidth,height:E.offsetHeight,overflowing:E.scrollHeight>E.clientHeight+1||R.scrollHeight>R.clientHeight+1};h(T=>T?.id===N.id&&T.width===N.width&&T.height===N.height&&T.overflowing===N.overflowing?T:N)},[n.id,r,h]);x.useLayoutEffect(()=>{const E=new ResizeObserver(y);return E.observe(b.current),E.observe(v.current),y(),()=>E.disconnect()},[y]),x.useEffect(()=>{w.current?.getDocument()&&JSON.stringify(w.current.getDocument())!==JSON.stringify(n.document)&&w.current.setDocument(n.document)},[n.document]);const S=E=>a(R=>R.paperTitle?.id===n.id?{...R,paperTitle:{...R.paperTitle,height:Math.max(24,Math.min(90,Math.round(E)))}}:R);return f.jsxs("div",{ref:b,className:"card-paper-header","data-header-page":r+1,style:{top:r*(s.height+mo)+s.margin,left:s.columnX(r,0),width:s.titleWidth,maxHeight:s.contentHeight,paddingBottom:l.header?10:ai},children:[f.jsxs("div",{className:"card-paper-title",style:{height:n.height},children:[f.jsx("div",{ref:v,className:"card-paper-title-body",children:f.jsx(Dd,{ref:w,initialValue:n.document,readOnly:c,uploadImage:g,ariaLabel:r?`第 ${r+1} 面纸面标题`:"纸面标题",onLayout:y,onChange:E=>a(R=>R.paperTitle?.id===n.id&&JSON.stringify(R.paperTitle.document)!==JSON.stringify(E)?{...R,paperTitle:{...R.paperTitle,document:E}}:R)})}),!c&&f.jsx("button",{className:"card-title-height-handle","aria-label":"调整标题高度",title:"调整输入框高度",onPointerDown:E=>{E.button===0&&(E.preventDefault(),E.stopPropagation(),C.current={y:E.clientY,height:n.height},E.currentTarget.setPointerCapture(E.pointerId))},onPointerMove:E=>{C.current&&S(C.current.height+(E.clientY-C.current.y)/u)},onPointerUp:E=>{C.current=null,E.currentTarget.hasPointerCapture(E.pointerId)&&E.currentTarget.releasePointerCapture(E.pointerId)},onPointerCancel:()=>{C.current&&S(C.current.height),C.current=null},onLostPointerCapture:()=>{C.current=null},onKeyDown:E=>{E.key==="Escape"&&C.current&&(S(C.current.height),C.current=null),(E.key==="ArrowUp"||E.key==="ArrowDown")&&(E.preventDefault(),S(n.height+(E.key==="ArrowDown"?2:-2)))},children:f.jsx("span",{children:"↕"})})]}),l.header&&f.jsx(vN,{settings:l.header,columns:s.columns})]})}function SN(){const{card:n,paperBlocks:r,selectedId:l,setSelectedId:a,selectedChoiceId:c,selectChoice:s,settingsId:u,openSettings:h,registerEditor:g,editingQuestionId:m,setMeasurements:b,readOnly:v,scale:w,geometry:C,pageCount:y,totalHeight:S,placementById:E,updateBlock:R,uploadImage:N}=Tt(),T=x.useRef(null),[O,D]=x.useState(null),M=(I,Y)=>D(k=>k?.id===I&&k.index===Y?k:{id:I,index:Y}),z=I=>{const Y=I instanceof Element?I.closest("[data-block-id], [data-block-fragment]"):null;return Y?.dataset.blockId||Y?.dataset.blockFragment},H=n.blocks.find(I=>I.id===u),G=H&&c(H),X=r.find(I=>I.id===fr),U=X?.reference&&G&&Il(X.reference).some(I=>I.id===G)?H:n.blocks.find(I=>I.reference?.questions.some(Y=>Ct(Y.type))),F=X?[X,...n.blocks.map(I=>r.find(Y=>Y.id===I.id)||I)]:r,J=I=>I===fr&&U?.id||I;return f.jsxs("div",{className:"card-sheet-stack",style:{width:C.width,height:S},onPointerDownCapture:I=>{const Y=z(I.target);T.current=!v&&I.button===0&&Y?{id:Y,x:I.clientX,y:I.clientY}:null},onPointerCancelCapture:()=>{T.current=null},onClickCapture:I=>{const Y=T.current;if(T.current=null,!v&&I.button===0&&Y&&z(I.target)===Y.id&&Math.hypot(I.clientX-Y.x,I.clientY-Y.y)<5){const k=I.target instanceof Element?I.target.closest("[data-question-id], [data-fill-question-id], [data-exercise-id], [data-exercise-item], [data-answer-id], [data-content-id]"):null,$=k?.dataset.answerId||k?.dataset.questionId||k?.dataset.fillQuestionId||k?.dataset.exerciseId||k?.dataset.exerciseItem||k?.dataset.contentId,L=n.blocks.find(Z=>$&&Z.reference&&Il(Z.reference).some(A=>A.id===$))||n.blocks.find(Z=>Z.id===J(Y.id));$&&(L?.reference?Il(L.reference):L?.choices?.questions||L?.exercise?.items)?.some(Z=>Z.id===$)&&s(L.id,$),h(L?.id||J(Y.id),!1)}},children:[Array.from({length:y},(I,Y)=>f.jsxs("div",{className:"card-sheet","data-paper-page":Y+1,style:{top:Y*(C.height+mo),width:C.width,height:C.height},children:[n.header&&!v&&Array.from({length:C.columns},(k,$)=>f.jsx("div",{className:"card-column-guide",style:{left:C.columnX(Y,$),width:C.columnWidth,top:C.margin,bottom:C.margin}},$)),n.header?.mifeng&&f.jsx("div",{className:"card-seal",style:{left:Y%2===0?C.margin:C.width-C.margin-C.sealWidth,width:C.sealWidth},children:f.jsx(bN,{settings:n.header,back:Y%2!==0})}),n.header&&Array.from({length:C.columns},(k,$)=>f.jsxs("div",{className:"card-paper-footer",style:{left:C.columnX(Y,$),width:C.columnWidth,bottom:20},children:["第",Y*C.columns+$+1,"页   共",y*C.columns,"页"]},$))]},Y)),n.paperTitle&&Array.from({length:y},(I,Y)=>C.hasHeader(Y)&&f.jsx(xN,{title:n.paperTitle,page:Y},`${n.paperTitle.id}/${Y}`)),r.flatMap(I=>{const Y=E.get(I.id).fragments,k=O?.id===I.id?Math.min(O.index,Y.length-1):0;return Y.length>1?Y.map(($,L)=>f.jsx("div",{className:`card-fragment-frame${l===J(I.id)&&!v&&L===k?" is-selected":""}`,"data-block-fragment":I.id,"data-page":$.page+1,"data-column":$.column+1,style:{left:$.x,top:$.y,width:C.columnWidth,height:$.to-$.from+($.topPadding||0)+($.bottomPadding||0)},onPointerDown:()=>{v||(M(I.id,L),a(J(I.id)))}},`${I.id}/${L}`)):[]}),F.map((I,Y)=>f.jsx(yN,{hidden:!r.some(k=>k.id===I.id),block:I,index:Y,placement:E.get(I.id),width:C.columnWidth,scale:w,selected:l===J(I.id),readOnly:v,activeChoiceId:!v&&u===J(I.id)?c(n.blocks.find(k=>k.id===J(I.id))||I):void 0,showQuestion:n.questionCard!==!1||!v&&m===I.id,registerEditor:g,uploadImage:N,onSelect:()=>a(J(I.id)),onActiveFragment:k=>M(I.id,k),onSettings:()=>{M(I.id,0),h(J(I.id))},onDocument:k=>R(I.id,{document:k}),onHeight:k=>R(I.id,{answerHeight:k}),onExercise:k=>R(I.id,{exercise:k}),onReference:k=>{I.id!==fr&&R(I.id,{reference:k})},onMeasure:k=>b($=>{const L=$[I.id];return L&&L.compositionStart===k.compositionStart&&Math.abs(L.width-k.width)<.5&&Math.abs(L.height-k.height)<.5&&JSON.stringify(L.breaks)===JSON.stringify(k.breaks)?$:{...$,[I.id]:k}})},I.id))]})}const CN=()=>{const{navigatorVisible:n}=jo(),{geometry:r,totalHeight:l,readOnly:a,pageCount:c,card:s,setSelectedId:u}=Tt();return f.jsxs("div",{className:`${AO["portal-wrapper"]} card-workspace`,id:"uni-answer-sheet","data-mode":a?"preview":"edit",children:[f.jsx(zR,{width:r.width,height:l,onBackgroundClick:()=>u(null),children:f.jsx(SN,{})}),f.jsx(cN,{}),f.jsx(_R,{summary:`${c} 页 · ${s.blocks.length} 个题块`}),n&&f.jsx(LR,{})]})},Ro=n=>structuredClone(n);function zv(){return new Promise(n=>{const r=()=>{clearTimeout(a),cancelAnimationFrame(l),n()},l=requestAnimationFrame(r),a=setTimeout(r,50)})}function wN(n,r,l,a,c){l.initialValue&&au(l.initialValue,r);let s=l,u=l.initialValue&&Ro(l.initialValue),h=0,g,m,b=!1,v;const w=yC.createRoot(n,{onUncaughtError:c});function C({readOnly:M}){const z=Tt();return x.useLayoutEffect(()=>{g=z,a()}),x.useEffect(()=>{z.setReadOnly(!!M)},[M]),x.useEffect(()=>{if(m===z.card)return;const H=!m;m=z.card,H||s.onChange?.(Ro(z.card))},[z.card]),null}const y=()=>{if(b||!g)throw new Error("制卡实例尚未就绪或已经销毁");return g},S=(M,z,H)=>({code:M,path:"",message:z,...H}),E=async()=>{const M=Date.now()+8e3;let z="",H=0,G="LAYOUT_PENDING";for(;Date.now()<M;){await zv();const X=y();if(!n.isConnected||n.clientWidth<100||n.clientHeight<100)return{value:X,issues:[S("LAYOUT_UNAVAILABLE","请显示制卡容器并为其设置有效的宽高后再保存")]};const U=[...new Set(X.editors.current.values())].map($=>$.getStatus());G=U.some($=>$.composing||$.uploading)?"EDITOR_BUSY":"LAYOUT_PENDING";const F=U.every($=>$.ready&&!$.composing&&!$.uploading&&!$.layoutPending),J=X.paperBlocks.every($=>{const L=X.measurements[$.id];return L&&Math.abs(L.width-X.geometry.columnWidth)<1&&L.height>0})&&(!X.card.paperTitle||X.titleMeasurement?.id===X.card.paperTitle.id&&Math.abs(X.titleMeasurement.width-X.geometry.titleWidth)<1),I=Array.from(n.querySelectorAll("img[src], img[srcset]")).filter($=>$.getClientRects().length),Y=I.every($=>$.complete),k=JSON.stringify([X.card,X.measurements,X.titleMeasurement,X.placements]);if(F&&J&&Y&&document.fonts.status==="loaded"&&k===z?H++:H=0,z=k,H>=4){const $=[];return U.forEach(L=>{L.uploadError&&$.push(S("IMAGE_UPLOAD_FAILED",L.uploadError))}),I.some(L=>!L.naturalWidth)&&$.push(S("IMAGE_LOAD_FAILED","有图片加载失败,请检查图片地址")),X.titleOverflow&&$.push(S("TITLE_OVERFLOW","纸面标题超出可用区域",{path:"paperTitle"})),X.overflow.forEach(L=>$.push(S("CONTENT_OVERFLOW","题块中存在无法放入一栏的内容,请调整尺寸或版式",{path:"blocks",blockId:L.id}))),n.querySelectorAll(".rt-content").forEach(L=>{if(!L.getClientRects().length||L.closest("[hidden]"))return;const Z=L.closest("[data-block-id]")?.dataset.blockId,A=Z&&X.placementById.get(Z);(!A||A.fragments.length===1)&&L.scrollWidth>L.clientWidth+2&&$.push(S("CONTENT_OVERFLOW","内容超过输入区域宽度",{path:"blocks",...Z?{blockId:Z}:{}}))}),{value:X,issues:$}}}return{value:y(),issues:[S(G,G==="EDITOR_BUSY"?"输入法输入或图片上传尚未结束,请完成后再保存":"字体、图片或分页尚未稳定,请稍后重试")]}},R=async()=>{try{const{issues:M,value:z}=await E(),G=[...iC(z.card,r).issues,...M];return{value:z,result:{valid:G.length===0,issues:G}}}catch(M){if(b)throw M;return{value:y(),result:{valid:!1,issues:[S("EDITOR_ERROR",M instanceof Error?M.message:"编辑器或数据校验失败")]}}}},N=async()=>(await R()).result,T=()=>v||(v=(async()=>{const{result:M,value:z}=await R();if(y(),!M.valid)return{ok:!1,issues:M.issues};try{return{ok:!0,data:Ro({...z.card,...z.getReferenceData()})}}catch(H){return{ok:!1,issues:[S("EXPORT_FAILED",H instanceof Error?H.message:"题卡数据转换失败")]}}})().finally(()=>{v=void 0})),O=()=>w.render(f.jsx(NO,{children:f.jsxs(YR,{editorPlugin:r,uploadImage:s.uploadImage,dictionaries:s.dictionaries,initialValue:u,onSave:()=>{y().setSaveMessage("正在校验…"),T().then(M=>{y().setSaveMessage(M.ok?"已生成保存数据":M.issues[0].message),s.onSave?.(M)}).catch(M=>{b||y().setSaveMessage("保存失败"),s.onError?.(M)})},children:[f.jsx(C,{readOnly:s.readOnly}),f.jsx(CN,{})]},h)}));O();const D=async M=>{au(M,r);const z=Ro(M);y(),u=z;const H=++h;Dr.flushSync(O);const G=Date.now()+8e3;do{await zv();const X=y();if(H!==h)throw new DOMException("回显已被另一张题卡替换","AbortError");if([...X.editors.current.values()].every(U=>U.getStatus().ready))return}while(Date.now()<G);throw new Error("题卡数据已载入,但编辑器未能及时就绪")};return{isReady:()=>!!g&&!b,getDocument:()=>Ro(y().card),setDocument:D,newDocument:M=>D(Wc(M)),getReferenceData:()=>Ro(y().getReferenceData()),setReferenceData:M=>D({...y().card,blocks:wv(Ro(M),r.html)}),validate:N,save:T,focusIssue:M=>{M.blockId&&(y().selectBlock(M.blockId,!0),y().openSettings(M.blockId,!1))},update(M){s=M,O()},destroy(){b||(b=!0,w.unmount(),g=void 0)}}}const EN=Object.freeze(Object.defineProperty({__proto__:null,mountAnswerSheet:wN},Symbol.toStringTag,{value:"Module"}));return nt.AnswerSheetDataError=di,nt.createAnswerSheet=sC,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"}),nt})({});
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(`
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})({});