uni-answer-sheet 2.2.0 → 2.3.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/CHANGELOG.md +8 -0
- package/README.md +9 -7
- package/dist/browser.js +43 -43
- package/dist/chunks/{index-ChLOq9ID.js → index-kGCb-s_b.js} +824 -824
- package/dist/chunks/{runtime-QFMZtUfH.js → runtime-C9TDF-ed.js} +4453 -4443
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var NM=Object.defineProperty;var Z1=nt=>{throw TypeError(nt)};var MM=(nt,dt,Lt)=>dt in nt?NM(nt,dt,{enumerable:!0,configurable:!0,writable:!0,value:Lt}):nt[dt]=Lt;var gm=(nt,dt,Lt)=>MM(nt,typeof dt!="symbol"?dt+"":dt,Lt),W1=(nt,dt,Lt)=>dt.has(nt)||Z1("Cannot "+Lt);var Gt=(nt,dt,Lt)=>(W1(nt,dt,"read from private field"),Lt?Lt.call(nt):dt.get(nt)),J1=(nt,dt,Lt)=>dt.has(nt)?Z1("Cannot add the same private member more than once"):dt instanceof WeakSet?dt.add(nt):dt.set(nt,Lt),ym=(nt,dt,Lt,qs)=>(W1(nt,dt,"write to private field"),qs?qs.call(nt,Lt):dt.set(nt,Lt),Lt);var UniAnswerSheet=(function(nt){"use strict";var gt,fn;function dt(t,r){for(var i=0;i<r.length;i++){const a=r[i];if(typeof a!="string"&&!Array.isArray(a)){for(const c in a)if(c!=="default"&&!(c in t)){const l=Object.getOwnPropertyDescriptor(a,c);l&&Object.defineProperty(t,c,l.get?l:{enumerable:!0,get:()=>a[c]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Lt=["pagination","content-identity","choice-fill","answer-regions","html-codec","status"];function qs(t){const r=t.filter(a=>a?.kind==="answer-sheet-editor");if(r.length!==1)throw new Error("请显式注册一个富文本插件:plugins: [createEditorPlugin()]");const i=r[0];if(i.apiVersion!==1||i.documentVersion!==1||Lt.some(a=>!i.capabilities?.includes(a))||typeof i.prepare!="function"||typeof i.create!="function"||typeof i.validateDocument!="function"||typeof i.html?.parse!="function"||typeof i.html?.serialize!="function")throw new Error("富文本插件协议不兼容,需要支持制卡协议 v1 的 uni-editor/plugin");return i}function Ys(t){const r=[],i=a=>{if(a.type==="choiceGroup"){typeof a.attrs?.id=="string"&&r.push({id:a.attrs.id,label:a.attrs.label||String(r.length+1),options:(a.content||[]).map((c,l)=>({id:c.attrs?.id,label:String.fromCharCode(65+l)})).filter(c=>typeof c.id=="string")});return}a.content?.forEach(i)};return i(t.content),r}class iu extends Error{constructor(r,i){super(i),this.path=r}}const Xn=(t,r)=>{throw new iu(t,r)},Xs={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",科学:"SCIENCE",物理:"PHYSICAL",化学:"CHEMICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",历史:"HISTORY",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",信息科技:"IT",信息技术:"IT",日语:"JAPANESE"},eS={P:["语文","数学","英语","科学","道德与法治"],J:["语文","数学","英语","物理","化学","生物","地理","历史","道德与法治","信息科技"],S:["语文","数学","英语","物理","化学","生物","政治","历史","地理","信息技术","日语"]},tS=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三"].map((t,r)=>{const i=r<6?"P":r<9?"J":"S";return{label:t,value:`${i}0${r<6?r+1:(r-6)%3+1}`,classify:i}}),sa=(t,r)=>typeof t=="string"&&t.trim()?t.trim():Xn(r,"字典编码和名称必须是非空字符串"),Ks=(t,r)=>t&&typeof t=="object"&&!Array.isArray(t)?t:Xn(r,"字典必须是对象"),bm=t=>t.classify||(/^[PJS]/.test(t.value)?t.value[0]:void 0);function su(t={}){const r=Ks(t,"dictionaries"),i=(v,S)=>{if(!Array.isArray(v))return Xn(S,"字典选项必须是数组");const w=new Set;return v.map((T,j)=>{const R=Ks(T,`${S}.${j}`),O=sa(R.value,`${S}.${j}.value`),M=sa(R.label,`${S}.${j}.label`);return w.has(O)&&Xn(`${S}.${j}.value`,"字典编码重复"),w.add(O),{...R,value:O,label:M}})},a=i(r.grades===void 0?tS:r.grades,"dictionaries.grades").map((v,S)=>(v.classify!==void 0&&!["P","J","S"].includes(String(v.classify))&&Xn(`dictionaries.grades.${S}.classify`,"学段为 P、J 或 S"),{value:v.value,label:v.label,classify:v.classify})),c=r.gradeCourseMap===void 0?void 0:Ks(r.gradeCourseMap,"dictionaries.gradeCourseMap"),l=r.courseCodeToSubjectCode===void 0?{}:Ks(r.courseCodeToSubjectCode,"dictionaries.courseCodeToSubjectCode");for(const[v,S]of Object.entries(l))sa(S,`dictionaries.courseCodeToSubjectCode.${v}`);const u=new Map,d=Object.fromEntries(a.map(v=>{const S=bm(v),w=(S?eS[S]:[]).map(R=>({value:Xs[R],label:R,subjectCode:Xs[R]})),T=`dictionaries.gradeCourseMap.${v.value}`,j=i(c?c[v.value]??[]:w,T).map((R,O)=>{const M=l[R.value];R.subjectCode!==void 0&&M!==void 0&&R.subjectCode!==M&&Xn(`${T}.${O}.subjectCode`,"课程对应的学科编码冲突");const D=sa(R.subjectCode??M??(Object.values(Xs).includes(R.value)?R.value:void 0),`${T}.${O}.subjectCode`);return u.has(R.value)&&u.get(R.value)!==D&&Xn(`${T}.${O}.subjectCode`,"同一课程不能对应不同学科"),u.set(R.value,D),R.custom!==void 0&&typeof R.custom!="boolean"&&Xn(`${T}.${O}.custom`,"custom 必须是布尔值"),{value:R.value,label:R.label,subjectCode:D,...R.custom===void 0?{}:{custom:R.custom}}});return[v.value,j]})),m=a.filter(v=>d[v.value].length),p=r.defaultGradeCode===void 0?void 0:sa(r.defaultGradeCode,"dictionaries.defaultGradeCode"),C=m.find(v=>v.value===p)?.value||m[0]?.value||"",g=r.defaultCourseCode===void 0?void 0:sa(r.defaultCourseCode,"dictionaries.defaultCourseCode"),b=d[C]||[],x=b.find(v=>v.value===g)?.value||b[0]?.value||"";return{grades:m,gradeCourseMap:d,defaultGradeCode:C,defaultCourseCode:x}}function bi(t,r,i){const a=t.grades.find(l=>l.value===r);if(!a)return Xn("initialization.gradeCode","年级不在可用字典中");const c=t.gradeCourseMap[r]?.find(l=>l.value===i);return c?{grade:a.label,subject:c.label,gradeCode:r,courseCode:i,subjectCode:c.subjectCode,phaseCode:bm(a)}:Xn("initialization.courseCode","当前年级没有此课程")}function xm(t,r={}){const a=t.grades.find(u=>u.value===r.gradeCode||!r.gradeCode&&u.label===r.grade)?.value||t.defaultGradeCode,c=t.gradeCourseMap[a]||[],l=c.find(u=>u.value===r.courseCode||!r.courseCode&&u.label===r.subject)?.value||(a===t.defaultGradeCode?t.defaultCourseCode:c[0]?.value)||"";return a&&l?bi(t,a,l):{grade:"",subject:"",gradeCode:"",courseCode:""}}function vm(t){return t?.subjectCode||Xs[t?.subject||""]}const Sn={questions:200,options:12,score:15},nS=t=>t.multiple?t.indefinite?"indefinite":"multiple":"single",Kn=t=>Number.isFinite(t)&&Number.isInteger(t*2),xi=t=>!!(vm(t)==="MATHS"&&(t?.phaseCode?t.phaseCode==="S":t?.gradeCode?t.gradeCode.startsWith("S"):/^高[一二三]/.test(t?.grade||"")));function rS(t){const r=typeof t.score=="number"&&Kn(t.score)&&t.score>=.5&&t.score<=Sn.score?t.score:null,i=[...new Set(t.correctIds)].filter(a=>t.options.some(c=>c.id===a));return{...t,indefinite:!!(t.multiple&&t.indefinite),score:r,scoreType:t.multiple&&t.scoreType==="ITEM_SCORE"?"ITEM_SCORE":"LESS_SCORE",lessScore:t.multiple&&r!==null&&Kn(t.lessScore??0)?Math.max(0,Math.min(r,t.lessScore??0)):0,correctIds:t.multiple?i:i.slice(0,1)}}function lu(t,r,i){let a={...t};if(r.kind!==void 0){const c=r.kind!=="single";c&&!t.multiple&&(a.scoreType=xi(i)?"ITEM_SCORE":"LESS_SCORE",typeof a.score!="number"&&xi(i)&&(a.score=6)),a.multiple=c,a.indefinite=r.kind==="indefinite"}if(r.optionCount!==void 0){const c=Math.max(2,Math.min(Sn.options,Math.round(r.optionCount)));a.options=Array.from({length:c},(l,u)=>t.options[u]||{id:crypto.randomUUID(),label:String.fromCharCode(65+u)})}return r.score!==void 0&&(a.score=r.score),r.scoreType!==void 0&&(a.scoreType=r.scoreType),r.lessScore!==void 0&&(a.lessScore=r.lessScore),rS(a)}function cu(t){return typeof t.score=="number"&&(!Kn(t.score)||t.score<.5||t.score>Sn.score)?"每题分值须为 0.5–15 分,按 0.5 分递增":t.multiple&&t.scoreType==="LESS_SCORE"&&typeof t.score=="number"&&(!Kn(t.lessScore??0)||(t.lessScore??0)<0||(t.lessScore??0)>t.score)?"少选得分须为 0.5 的倍数,且不能超过本题分值":t.multiple&&t.scoreType==="ITEM_SCORE"&&typeof t.score=="number"&&t.correctIds.length&&!Kn(t.score/t.correctIds.length)?"答案个数与分值不匹配,每个正确选项的得分须为 0.5 的倍数":null}function oS(t){return t.multiple&&t.scoreType==="ITEM_SCORE"&&typeof t.score=="number"&&t.correctIds.length&&!cu(t)?t.score/t.correctIds.length:null}function uu(t){const r=t.map(c=>Number(c.label)).filter(c=>Number.isSafeInteger(c)&&c>0&&c<1e5);let i=String(Math.max(0,...r)+1);const a=new Set(t.map(c=>c.label));for(;a.has(i);)i=String(Number(i)+1);return i}function aS(t,r){const i=new Map(t.options.map(a=>[a.id,crypto.randomUUID()]));return{...t,id:crypto.randomUUID(),label:r,breakBefore:!1,contentTarget:null,options:t.options.map(a=>({...a,id:i.get(a.id)})),correctIds:t.correctIds.map(a=>i.get(a)).filter(Boolean)}}function Sm(t,r,i){return i.trim()?t.some(a=>a.id!==r&&a.label.trim()===i.trim())?"题组内题号不能重复":null:"题号不能为空"}function iS(t,r,i,a){const c=t.questions.filter(m=>r.includes(m.id));if(!c.length)return{error:"请选择要修改的题目"};let l;if(i.type==="settings"){if(!Object.keys(i.patch).length)return{error:"请设置需要修改的属性"};const{optionCount:m,score:p,lessScore:C}=i.patch;if(m!==void 0&&(!Number.isInteger(m)||m<2||m>Sn.options))return{error:"选项个数须为 2–12 的整数"};if(typeof p=="number"&&(!Kn(p)||p<.5||p>Sn.score))return{error:"每题分值须为 0.5–15 分,按 0.5 分递增"};if(C!==void 0&&(!Kn(C)||C<0))return{error:"少选得分须为非负的 0.5 倍数"};if(l=c.map(g=>lu(g,i.patch,a)),C!==void 0&&l.some(g=>g.multiple&&g.scoreType!=="ITEM_SCORE"&&C>(g.score??0)))return{error:"少选得分不能超过所选题目的分值"}}else if(i.type==="numbering"){if(!Number.isInteger(i.start)||i.start<1||i.start+c.length-1>1e3)return{error:"连续题号须在 1–1000 内"};l=c.map((m,p)=>({...m,label:String(i.start+p)}))}else if(i.type==="average"){const m=i.total/c.length;if(!Kn(m)||m<.5||m>Sn.score)return{error:"总分无法平均分配,每题须为 0.5–15 分且为 0.5 的倍数"};l=c.map(p=>lu(p,{score:m}))}else{const m=i.text.toUpperCase().trim().split(/[\s,,;;]+/).filter(Boolean);if(m.length!==c.length)return{error:`需要 ${c.length} 组答案,当前为 ${m.length} 组`};l=[];for(let p=0;p<c.length;p++){const C=c[p],g=m[p];if(g!=="-"&&(!/^[A-T]+$/.test(g)||new Set(g).size!==g.length||[...g].some(x=>!C.options.some(v=>v.label===x))))return{error:`第 ${C.label} 题包含无效或重复选项`};const b=g==="-"?[]:[...g].map(x=>C.options.find(v=>v.label===x).id);if(!C.multiple&&b.length>1)return{error:`第 ${C.label} 题为单选,只能设置一个答案`};l.push({...C,correctIds:b})}}const u=new Map(l.map(m=>[m.id,m])),d=t.questions.map(m=>u.get(m.id)||m);for(const m of l){const p=Sm(d,m.id,m.label)||cu(m);if(p)return{error:`第 ${m.label} 题:${p}`}}return{value:{...t,questions:d}}}const sS={layout:"natural",columns:2,indent:!1,rowGap:0,columnGap:32,marker:"letter"},du=t=>`question:${t}`,fu=t=>t.presentation==="stem"?"stem":["option","distributed"].includes(t.presentation)?"option":"concentrated";function hu(t,r,i){const a=Ys(r),c=new Map,l=(d,m)=>{const p=d.attrs?.contentId||m;d.type==="choiceGroup"&&p&&c.set(d.attrs.id,p),d.content?.forEach(C=>l(C,p))};l(r.content);const u=new Set(t.questions.map(d=>d.contentTarget?.groupId));return{...t,presentation:i,questions:t.questions.map((d,m)=>{const p=a.find(C=>c.get(C.id)===d.id)||(c.size?void 0:a[m]);return i==="concentrated"||d.contentTarget!==void 0||!p||u.has(p.id)?d:(u.add(p.id),{...d,contentTarget:{groupId:p.id,optionIds:p.options.map(C=>C.id)}})})}}function la(t,r,i){const a=fu(t),c=new Map(Ys(r).map(b=>[b.id,b])),l=new Set,u=new Map,d=new Map,m=(b,x)=>{const v=b.attrs?.contentId||x;b.type==="choiceGroup"&&v&&(u.set(v,[...u.get(v)||[],b.attrs.id]),d.set(b.attrs.id,v)),b.type==="choiceStemAnchor"&&typeof b.attrs?.groupId=="string"&&l.add(b.attrs.groupId),b.content?.forEach(S=>m(S,v))};m(r.content);const p=[],C=new Set,g=t.questions.filter(b=>{if(!i||a==="concentrated")return!0;if(a==="stem"&&l.has(du(b.id)))return p.push({groupId:du(b.id),questionId:b.id,options:b.options.map(j=>({...j,contentOptionId:j.id}))}),!1;const x=u.get(b.id),v=x?.length===1?c.get(x[0]):void 0,S=v?{groupId:v.id,optionIds:v.options.map(j=>j.id)}:b.contentTarget,w=S&&c.get(S.groupId);if(!S||!w||C.has(w.id)||a==="stem"&&!l.has(w.id)||d.has(w.id)&&d.get(w.id)!==b.id)return!0;const T=S.optionIds.slice(0,b.options.length);return T.length!==b.options.length||new Set(T).size!==T.length||T.some(j=>!w.options.some(R=>R.id===j))?!0:(C.add(w.id),p.push({groupId:w.id,questionId:b.id,options:b.options.map((j,R)=>({...j,contentOptionId:T[R]}))}),!1)});return{position:a==="concentrated"?void 0:a,bindings:p,concentrated:{...t,questions:g}}}function ca(t,r=4){return{id:crypto.randomUUID(),label:String(t+1),multiple:!1,indefinite:!1,score:null,scoreType:"LESS_SCORE",lessScore:0,correctIds:[],breakBefore:!1,options:Array.from({length:r},(i,a)=>({id:crypto.randomUUID(),label:String.fromCharCode(65+a)}))}}function mu(t=8){return{source:"manual",presentation:"concentrated",direction:"row",rowsPerColumn:5,marker:"box",rowGap:0,columnGap:0,questions:Array.from({length:t},(r,i)=>ca(i))}}function pu(t){return new Set(t.questions.map(r=>r.options.length)).size>1?"column":t.direction}function lS(t){const r=[];for(const i of t.questions){const a=r.at(-1);(!a||a.length>=t.rowsPerColumn||i.breakBefore||a[0].options.length!==i.options.length)&&r.push([]),r[r.length-1].push(i)}return r}function cS(t){const r=[];for(const i of lS(t))(!r.length||i[0].breakBefore)&&r.push([]),r[r.length-1].push(i);return r}const uS={judge:"判断题",fill:"填空题",answer:"解答题",calculation:"计算/证明",matching:"信息匹配/连线",ordering:"排序/分类",correction:"改错题",drawing:"作图题",table:"表格填答",writing:"语文作文",english:"外语写作",reading:"阅读理解",cloze:"完形填空",completion:"语法填空",chunk:"断句题",composite:"材料/复合题",optional:"选做题组",practice:"实践评价"},dS={choice:"选择",judge:"判断",fill:"填空",answer:"简答",calculation:"计算/证明",correction:"改错",drawing:"作图",table:"表格",writing:"作文",english:"外语写作"},Cm=["reading","cloze","completion","composite","optional"],Vt=()=>({version:1,content:{type:"doc",content:[{type:"paragraph"}]}}),wm={symbols:["√","×"],letters:["T","F"],words:["正确","错误"]},Fs=t=>["writing","english"].includes(t)?70:["answer","calculation","drawing","table","correction"].includes(t)?60:15,Em=t=>t==="judge"?200:t==="fill"?50:["reading","cloze","completion"].includes(t)?20:t==="matching"?9:100;function Tm(t=0){return{id:crypto.randomUUID(),label:String(t+1),width:50,style:"line",characters:6,score:null,answers:[],prefix:"",suffix:"",breakAfter:!1}}function gu(t,r="1"){const i=crypto.randomUUID();return{id:i,label:r,kind:t,document:Vt(),reference:Vt(),explanation:Vt(),score:null,choice:{...ca(0,t==="judge"?2:4),id:i,label:r},presentation:"concentrated",blanks:[Tm()],steps:[],needsReason:!1,judgment:null,targets:[],area:{style:t==="writing"?"characters":t==="english"?"lines":t==="drawing"?"grid":"blank",rows:t==="writing"?20:6,columns:20,rowHeight:t==="writing"?40:28,wordMark:100,title:!1,backgroundUrl:""}}}function yu(t){return["reading","cloze","chunk"].includes(t)?"choice":["matching","completion"].includes(t)?"fill":["ordering","composite","optional","practice"].includes(t)?"answer":t}function fS(t){return{items:[gu(yu(t))],judgeLabels:"symbols",fillNewLine:!0,pool:[],relation:"one",reuseOptions:!0,matchingDisplay:"letters",ordering:"sequence",sequence:[],categories:[],assignments:{},chooseCount:1,groupScore:null,chunkText:"",chunkPoints:[],chunkCorrect:[],chunkMax:3,chunkScore:null,attachmentUrl:""}}function Ur(t){return String(Math.max(0,...t.map(r=>/^\d+$/.test(r.label)?Number(r.label):0))+1)}function Ao(t){const r=structuredClone(t),i=new Map,a=l=>{!l||typeof l!="object"||Object.entries(l).forEach(([u,d])=>{["id","answerId"].includes(u)&&typeof d=="string"?i.set(d,crypto.randomUUID()):a(d)})};a(r);const c=l=>typeof l=="string"?i.get(l)||l:Array.isArray(l)?l.map(c):l&&typeof l=="object"?Object.fromEntries(Object.entries(l).map(([u,d])=>[i.get(u)||u,c(d)])):l;return c(r)}function hS(t,r){const i=Ao(t);return{...i,label:r,choice:{...i.choice,label:r}}}function ua(t,r,i){const a=t.findIndex(u=>u.id===r),c=a+i;if(a<0||c<0||c>=t.length)return t;const l=[...t];return l.splice(c,0,...l.splice(a,1)),l}function mS(t,r){return{...t,pool:t.pool.filter(i=>i.id!==r),sequence:t.sequence.filter(i=>i!==r),assignments:Object.fromEntries(Object.entries(t.assignments).filter(([i])=>i!==r)),items:t.items.map(i=>({...i,targets:i.targets.filter(a=>a!==r)}))}}function pS(t,r,i){const a=[...new Set(i)].filter(l=>t.pool.some(u=>u.id===l)),c=t.relation==="one"?a.slice(-1):a;return{...t,items:t.items.map(l=>l.id===r?{...l,targets:c}:t.reuseOptions?l:{...l,targets:l.targets.filter(u=>!c.includes(u))})}}function gS(t,r){let i=0;for(;i<r.length&&i<t.chunkText.length&&r[i]===t.chunkText[i];)i++;let a=0;for(;a<r.length-i&&a<t.chunkText.length-i&&r[r.length-1-a]===t.chunkText[t.chunkText.length-1-a];)a++;const c=t.chunkText.length-a,l=new Set,u=t.chunkPoints.filter(d=>d.offset<=i||d.offset>=c).map(d=>({...d,offset:d.offset<=i?d.offset:d.offset+r.length-t.chunkText.length})).filter(d=>d.offset<=0||d.offset>=r.length||l.has(d.offset)?!1:(l.add(d.offset),!0));return{...t,chunkText:r,chunkPoints:u,chunkCorrect:t.chunkCorrect.filter(d=>u.some(m=>m.id===d))}}function yS(t,r){const i=[],a=t.items.map(c=>c.label.trim());(a.some(c=>!c)||new Set(a).size!==a.length)&&i.push("题号不能为空或重复");for(const c of t.items){c.score!==null&&(!Number.isFinite(c.score)||c.score<.5||c.score>Fs(c.kind)||!Number.isInteger(c.score*2))&&i.push(`${c.label} 题分值超出范围或不是 0.5 的倍数`);const u=(c.kind==="fill"?c.blanks:c.steps).map(d=>d.score);u.length&&c.score!==null&&u.every(d=>d!==null)&&u.reduce((d,m)=>d+(m||0),0)!==c.score&&i.push(`${c.label} 题分项分值之和与题分不一致`)}if(["matching","ordering"].includes(r)){const c=t.pool.map(l=>l.label.trim());(c.some(l=>!l)||new Set(c).size!==c.length)&&i.push("共享选项编号不能为空或重复")}return r==="optional"&&t.chooseCount>t.items.length&&i.push("选做数量不能超过题目数量"),r==="chunk"&&t.chunkCorrect.length>t.chunkMax&&i.push("正确断点数不能超过最多选择数"),i}function bS(t=3,r=3){return{version:1,content:{type:"doc",content:[{type:"table",content:Array.from({length:t},()=>({type:"tableRow",content:Array.from({length:r},()=>({type:"tableCell",content:[{type:"paragraph"}]}))}))}]}}}function Cn(t){const r=i=>!!(i.text||i.type&&!["doc","paragraph","choiceStemAnchor"].includes(i.type)||i.content?.some(r));return!r(t.content)}const jm={choice:"选择题",area:"空白区域",...uS};function xS(t){return{id:crypto.randomUUID(),kind:"area",areaType:t,title:t==="forbiden"?"禁止答题区":"空白答题区",answerHeight:t==="forbiden"?100:200,document:{version:1,content:{type:"doc",content:t==="forbiden"?["请勿在此区域作答","或者做任何标记"].map(r=>({type:"paragraph",attrs:{textAlign:"center",lineSpacing:0},content:[{type:"text",text:r}]})):[{type:"paragraph"}]}}}}function Am(){return{version:1,title:"",questionCard:!1,preset:"a3-two",margin:15,gap:10,blocks:[]}}function vS(t=""){return{id:crypto.randomUUID(),height:70,document:{version:1,content:{type:"doc",content:[{type:"paragraph",attrs:{textAlign:"center",lineSpacing:9},...t?{content:[{type:"text",text:t,marks:[{type:"textStyle",attrs:{fontFamily:"SimSun, 宋体, serif",fontSize:"22px"}}]}]}:{}}]}}}}function bu(t){return{...Am(),title:t.name,creation:t,paperTitle:vS(t.name),header:{focusText:!0,writeKaohao:!1,missExam:!1,mifeng:!1,kaohao:"school",weishu:8}}}function Ro(t,r=96){return t*r/25.4}const vi={a4:{label:"A4 单栏",width:210,height:297,columns:1},"a3-two":{label:"A3 双栏",width:420,height:297,columns:2},"a3-three":{label:"A3 三栏",width:420,height:297,columns:3}},Oo=44,Si=16,Qs=1;function xu(t,r){const i=vi[t.preset],a=Ro(i.width),c=Ro(i.height),l=Ro(t.margin),u=Ro(t.gap),d=t.usage!=="homework"&&t.header?.mifeng?Ro(t.header.kaohao==="code"?26:14):0,m=a-l*2-d,p=(m-u*(i.columns-1))/i.columns,C=Math.max(l,t.header?t.recognition?.examQrCode?64:39:0),g=Math.max(l,t.header?56:0),b=c-C-g,x=b-Si,v=t.header?p:m,S=r&&r.id===t.paperTitle?.id&&Math.abs(r.width-v)<1?r:void 0,w=t.paperTitle?Math.min(b,S?.height??t.paperTitle.height+(t.header?260:Si)):0,T=(M,D=0)=>!!t.paperTitle&&(t.header?M%2===0&&D===0:M===0),j=(M,D=0)=>T(M,D)?w:0;return{...i,width:a,height:c,margin:l,topInset:C,bottomInset:g,gap:u,sealWidth:d,contentWidth:m,contentHeight:b,columnWidth:p,columnX:(M,D)=>l+(M%2===0?d:0)+D*(p+u),titleWidth:v,titleMaxHeight:x,hasHeader:T,headerHeight:j,capacity:(M,D=0)=>b-j(M,D)}}function SS(t,r,i){const a=xu(t,i);let c=0,l=0,u=0;const d=()=>{l++,l===a.columns&&(l=0,c++),u=0},m=t.blocks.map(C=>{const g=r[C.id],b=g&&Math.abs(g.width-a.columnWidth)<1?g.height:100+C.answerHeight,x=g&&Math.abs(g.width-a.columnWidth)<1?[...new Set([...g.breaks||[],b].filter(O=>Number.isFinite(O)&&O>0&&O<=b))].sort((O,M)=>O-M):[],v=C.reference?.type==="CCOMPOSITION",S=O=>v&&O>0?Math.max(0,6-Math.max(0,(g?.compositionStart||0)-O)):0;if(x.length>1&&x.every((O,M)=>{const D=x[M-1]||0;return O-D+S(D)<=a.capacity(1)+.5})){const O=[];let M=0;for(;M<b-.5;){const _=a.capacity(c,l)-u,I=M,B=S(M),H=X=>g?.markingFrames?.some(G=>G.from>=I-.5&&G.from<X-.5&&G.to>X+.5)?22:0,z=x.filter(X=>X>I+.5&&X+H(X)<=I+_-B+.5).at(-1);if(z===void 0){d();continue}const $=v&&z<b-.5?Math.max(H(z),_-B-(z-M)):H(z);O.push({page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Oo)+a.topInset+a.headerHeight(c,l)+u,from:M,to:z,...B?{topPadding:B}:{},...$?{bottomPadding:$}:{}}),u+=z-M+B,M=z,M<b-.5&&d()}u+=Si;const D=O[0];return{id:C.id,...D,height:b,available:a.capacity(D.page,D.column),overflowing:!1,fragments:O}}for(;u+b>a.capacity(c,l)+.5&&(u>0||a.headerHeight(c,l)>0);)d();const T=a.capacity(c,l),j=b>T+.5,R={id:C.id,page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Oo)+a.topInset+a.headerHeight(c,l)+u,height:b,available:T,overflowing:j,fragments:[{page:c,column:l,x:a.columnX(c,l),y:c*(a.height+Oo)+a.topInset+a.headerHeight(c,l)+u,from:0,to:Math.min(b,T)}]};return u+=Math.min(b,T)+Si,R}),p=new Map;m.forEach((C,g)=>C.fragments.forEach(b=>{const x=`${b.page}/${b.column}`,v=p.get(x)||[];v.push({fragment:b,placement:C,blockIndex:g}),p.set(x,v)})),p.forEach(C=>{const g=C.filter(S=>["answer","writing","english","composite","area"].includes(t.blocks[S.blockIndex].kind)).at(-1);if(!g||t.blocks[g.blockIndex].reference?.type!=="CCOMPOSITION"&&t.blocks[g.blockIndex].kind!=="area")return;const b=C.at(-1).fragment,v=b.page*(a.height+Oo)+a.height-a.bottomInset-b.y-(b.to-b.from)-(b.topPadding||0)-(b.bottomPadding||0);v<=0||v>30||(g.fragment.bottomPadding=(g.fragment.bottomPadding||0)+v,C.slice(C.indexOf(g)+1).forEach(({fragment:S,placement:w})=>{S.y+=v,w.fragments[0]===S&&(w.y=S.y)}))});for(const C of m)(C.overflowing||C.fragments.some(g=>g.page>=Qs))&&(C.overflowFrom=C.fragments.filter(g=>g.page<Qs).at(-1)?.to||0);return{geometry:a,placements:m,pageCount:Qs,requiredPageCount:c+1}}function Ci(t,r){return{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:`${t}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]},...r?[{type:"text",text:`(${r}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}]:[]]}]}}}function wn(t,r,i){const a=c=>{if(!c.content)return c;let l;const u=c.content.flatMap(m=>{const p=m.type==="text"&&m.marks?.find(b=>b.type==="documentLabel")?.attrs?.kind,C=p&&p===l;if(l=p,C)return[];if(!p)return[a(m)];const g=p==="number"?`${r}.`:i?`(${i}分)`:"";return g?[{...m,text:g}]:[]}),d=u.findIndex(m=>m.marks?.some(p=>p.type==="documentLabel"&&p.attrs?.kind==="number"));return i&&d>=0&&!u.some(m=>m.marks?.some(p=>p.type==="documentLabel"&&p.attrs?.kind==="score"))&&u.splice(d+1,0,{type:"text",text:`(${i}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}),{...c,content:u}};return{...t,content:a(t.content)}}const cr={SCHOICE:"单选题",MCHOICE:"多选题",JUDGE:"判断题",FILLBLANK:"填空题",SHORTANSWER:"解答题",MIXED:"复合题",CLOZE:"完形填空",READTHENANSWER:"阅读理解",INFO_MATCHING:"信息匹配",TEXT_COMPLETION:"语法填空",ECOMPOSITION:"英语作文",CCOMPOSITION:"语文作文",CHUNK_CHOICE:"断句题"},Rm=["SCHOICE","MCHOICE","JUDGE","FILLBLANK","SHORTANSWER","MIXED"];function Om(t,r=!1){const i=vm(t),a=r?Rm.filter(c=>c!=="MIXED"):Rm;return r?["CHINESE","JAPANESE"].includes(i||"")?[...a,"CHUNK_CHOICE"]:a:i==="CHINESE"?[...a,"CCOMPOSITION","CHUNK_CHOICE"]:i==="ENGLISH"?[...a,"CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION","ECOMPOSITION"]:i==="JAPANESE"?Object.keys(cr):["POLITICAL","HISTORY"].includes(i||"")?[...a,"CCOMPOSITION"]:a}const CS=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),wS=t=>["SCHOICE","MCHOICE","CLOZE","READTHENANSWER","INFO_MATCHING","JUDGE"].includes(t),$r=t=>({version:1,content:{type:"doc",content:t.length?t:[{type:"paragraph"}]}});function wi(t,r,i=!1){return{content:Vt(),numbered:!i,groupId:`options:${r.id}`,layout:{...sS,columns:t==="CLOZE"?4:2,...t==="READTHENANSWER"?{layout:"fixed",columnGap:0}:{}},itemsContent:!i&&wS(t)?r.options.map(a=>({id:a.id,key:a.label,content:Vt()})):[]}}const Zs=t=>{if(t.type==="choiceStemAnchor"||t.type==="text"&&t.marks?.some(a=>a.type==="documentLabel"&&a.attrs?.kind==="number"))return null;const{contentId:r,...i}=t.attrs||{};return{...t,...t.attrs?{attrs:i}:{},...t.content?{content:t.content.map(Zs).filter(a=>a!==null)}:{}}};function Ws(t,r,i){const c=(t.content.content.content||[{type:"paragraph"}]).map(l=>({...l,attrs:{...l.attrs,contentId:r}}));if(t.numbered){const l={type:"text",text:`${i}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]};["paragraph","heading"].includes(c[0]?.type||"")||c.unshift({type:"paragraph",attrs:{contentId:r},content:[]}),c[0]={...c[0],content:[l,...c[0].content||[]]}}return t.itemsContent.length&&c.push({type:"choiceGroup",attrs:{id:t.groupId,contentId:r,...t.layout},content:t.itemsContent.map(l=>({type:"choiceOption",attrs:{id:l.id,label:l.key,sourceKey:l.key,marker:"letter"},content:l.content.content.content||[{type:"paragraph"}]}))}),c}function Nm(t,r){const i=r.filter(d=>d.type==="choiceGroup"),a=i.find(d=>d.attrs?.id===t.groupId)||(i.length===1?i[0]:void 0),c=r.filter(d=>d!==a);let l=!1;const u=d=>{d.marks?.some(m=>m.type==="documentLabel"&&m.attrs?.kind==="number")&&(l=!0),d.content?.forEach(u)};return c.forEach(u),{...t,numbered:l,content:$r(c.map(Zs).filter(d=>d!==null)),groupId:a?.attrs?.id||t.groupId,layout:a?Object.fromEntries(Object.entries(t.layout).map(([d,m])=>[d,a.attrs?.[d]??m])):t.layout,itemsContent:(a?.content||[]).map((d,m)=>({id:d.attrs?.id||t.itemsContent[m]?.id||crypto.randomUUID(),key:d.attrs?.label||String.fromCharCode(65+m),content:$r((d.content||[]).map(Zs).filter(p=>p!==null))}))}}function Mm(t,r,i,a){const c=new Map;r.content.content?.forEach(d=>{d.attrs?.contentId&&c.set(d.attrs.contentId,[...c.get(d.attrs.contentId)||[],d])});const l=new Set(a?.content.content?.map(d=>d.attrs?.contentId).filter(Boolean)),u=(d,m)=>m&&(c.has(d)||l.has(d))?Nm(m,c.get(d)||[]):m;return{...t,...c.has(i)?{material:$r(c.get(i).map(d=>Zs(d)))}:{},questions:t.questions.map(d=>({...d,text:u(d.id,d.text),parts:d.parts.map(m=>({...m,text:u(m.id,m.text)}))}))}}function vu(t){const r=t.reference,i=[];r.type==="MIXED"&&i.push(...(r.material||Vt()).content.content.map(c=>({...c,attrs:{...c.attrs,contentId:t.id}}))),r.questions.forEach(c=>{c.text&&i.push(...Ws(c.text,c.id,c.label)),CS(c.type)&&c.parts.forEach(l=>{l.text&&i.push(...Ws(l.text,l.id,l.label))})});const a=(t.document.content.content||[]).filter(c=>!c.attrs?.contentId);return Cn($r(a))||i.push(...a),$r(i)}function ES(t,r){const i=(a,c,l)=>!a||!l||c.options.map(u=>u.id).join()===l.options.map(u=>u.id).join()?a:{...a,itemsContent:c.options.map(u=>({...a.itemsContent.find(d=>d.id===u.id),id:u.id,key:u.label,content:a.itemsContent.find(d=>d.id===u.id)?.content||Vt()}))};return{...t,questions:t.questions.map(a=>{const c=r.questions.find(l=>l.id===a.id);return{...a,text:i(a.text,a.choice,c?.choice),parts:a.parts.map(l=>({...l,text:i(l.text,l.choice,c?.parts.find(u=>u.id===l.id)?.choice)}))}})}}function TS(t,r,i){if(t.reference?.textVersion!==1)return t;let a=t.reference;if(!r&&!Cn(t.document)&&!t.document.content.content?.some(l=>l.attrs?.contentId))return{...t,reference:{...a,textVersion:void 0}};if(r?.reference===a&&r.document===t.document&&!Cn(t.document))return t;if(t.document!==r?.document&&(!Cn(t.document)||r)&&(a=Mm(a,t.document,t.id,r?.document),r&&t.reference===r.reference))return{...t,reference:a};r?.reference&&t.reference!==r.reference&&(a=ES(a,r.reference));const c={...t,reference:a};return i||!Cn(t.document)?{...c,document:vu(c)}:c}const da={SCHOICE:{count:200,options:[2,12],parts:1,score:15},MCHOICE:{count:200,options:[2,12],parts:1,score:15},JUDGE:{count:200,options:[2,2],parts:1,score:15},CHUNK_CHOICE:{count:100,options:[2,26],parts:1,score:10},FILLBLANK:{count:50,options:[0,0],parts:20,score:15},SHORTANSWER:{count:100,options:[0,0],parts:10,score:60},CLOZE:{count:20,options:[4,4],parts:20,score:15},READTHENANSWER:{count:20,options:[2,12],parts:20,score:15},INFO_MATCHING:{count:20,options:[1,9],parts:9,score:15},TEXT_COMPLETION:{count:20,options:[0,0],parts:20,score:15},CCOMPOSITION:{count:1,options:[0,0],parts:1,score:70},ECOMPOSITION:{count:1,options:[0,0],parts:1,score:70}},Et=t=>["SCHOICE","MCHOICE","JUDGE","CHUNK_CHOICE","CLOZE","READTHENANSWER","INFO_MATCHING"].includes(t),Be=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),Ei=t=>t==="FILLBLANK"||t==="TEXT_COMPLETION",Ti=t=>t==="CCOMPOSITION"||t==="ECOMPOSITION",jS={SCHOICE:"choice",MCHOICE:"choice",JUDGE:"judge",FILLBLANK:"fill",SHORTANSWER:"answer",MIXED:"composite",CLOZE:"cloze",READTHENANSWER:"reading",INFO_MATCHING:"matching",TEXT_COMPLETION:"completion",ECOMPOSITION:"english",CCOMPOSITION:"writing",CHUNK_CHOICE:"chunk"};function Su(t){return{type:t,textVersion:1,questions:[],layout:mu(0),fillNewLine:!1,optional:!1,choose:1,optionalHeight:200,scoreType:"LESS_SCORE"}}function _m(t){return{id:crypto.randomUUID(),kind:jS[t],title:cr[t],answerHeight:0,document:Vt(),reference:Su(t)}}function Cu(t,r=1,i){const a=t==="MCHOICE"&&xi(i);return{type:t,start:r,end:r,optionCount:t==="INFO_MATCHING"?null:t==="CHUNK_CHOICE"?12:t==="JUDGE"?2:4,partCount:Be(t)?null:1,score:a?6:null,scoreType:a?"ITEM_SCORE":"LESS_SCORE",lessScore:0,characters:1e3,lines:10,rightAnswers:null,singleScore:1}}function fa(t,r,i){const a=Array.from({length:i},(c,l)=>({...t.options[l]||{id:crypto.randomUUID()},label:r==="JUDGE"?["T","F"][l]:String.fromCharCode(65+l)}));return{...t,options:a,multiple:r==="MCHOICE"||r==="CHUNK_CHOICE",indefinite:!1,correctIds:t.correctIds.filter(c=>a.some(l=>l.id===c)).slice(0,r==="MCHOICE"||r==="CHUNK_CHOICE"?i:1)}}function ji(t,r,i,a=4){const c=crypto.randomUUID(),l={...fa(ca(0),i,a),id:c,label:t,score:r};return{id:c,label:t,score:r,width:25,breakAfter:!1,height:100,document:i==="SHORTANSWER"?Ci(t,r):Vt(),choice:l,...Be(i)&&i!=="TEXT_COMPLETION"?{text:wi(i,l)}:{}}}function wu(t,r){const i=crypto.randomUUID(),{type:a,score:c}=t,l=String(r),u=t.partCount||1,d=Array.from({length:Be(a)||["FILLBLANK","SHORTANSWER"].includes(a)?u:0},(p,C)=>ji(Be(a)?String(r+C):u===1?l:`${l}.${C+1}`,c,a,t.optionCount||4)),m={...fa(ca(0),a,t.optionCount||4),id:i,label:l,score:c,scoreType:t.scoreType,lessScore:t.lessScore};return{id:i,type:a,label:l,score:d.length?Fn(d):c,choice:m,text:wi(a,m,Be(a)),parts:d,document:a==="ECOMPOSITION"?{version:1,content:{type:"doc",content:[...Ci(l,c).content.content,...MS(t.lines,t.paperWidth||600).content.content]}}:a==="CCOMPOSITION"?Ci(l,c):Vt(),height:a==="ECOMPOSITION"?50*t.lines+40:100,contentHeight:38,characters:t.characters,lines:t.lines,halfPoint:!1,rightAnswers:t.rightAnswers,singleScore:t.singleScore}}const Fn=t=>t.some(r=>r.score===null)?null:t.reduce((r,i)=>r+(i.score||0),0);function Eu(t){return t.questions.flatMap(r=>Be(r.type)?r.parts.map(i=>i.label):[r.label])}function Js(t){return Math.max(0,...Eu(t).map(Number).filter(Number.isFinite))+1}function AS(t,r,i=!1,a=!1){const c=da[r.type],l=Ti(r.type)?1:r.end-r.start+1;if(!Number.isInteger(r.start)||r.start<1||r.end>1e3||!Number.isInteger(l)||l<1||l>c.count)return`题号须为 1–1000,单次题数为 1–${c.count}`;if(t.type==="CCOMPOSITION"&&t.questions.length)return"语文作文每组只能有一道题";if(t.optional)return"选做题组不能追加题目";const u=Eu(t);if(Array.from({length:l},(d,m)=>String(r.start+m)).some(d=>u.includes(d)))return"同一分组内,题号不能重复";if(Et(r.type)&&(r.optionCount===null||!Number.isInteger(r.optionCount)||r.optionCount<c.options[0]||r.optionCount>c.options[1]))return`选项个数须为 ${c.options[0]}–${c.options[1]}`;if((Be(r.type)||["FILLBLANK","SHORTANSWER"].includes(r.type))&&(!r.partCount||!Number.isInteger(r.partCount)||r.partCount<1||r.partCount>c.parts))return`子题/空数须为 1–${c.parts}`;if(Be(r.type)&&l%r.partCount!==0)return"题目数量无法按子题数量均分,请重新设置";if(r.type==="INFO_MATCHING"&&r.partCount>r.optionCount)return"选项个数需大于等于子题数量";if(r.type==="SHORTANSWER"&&(i||t.optional)&&r.partCount!==1)return"网阅或选做题不支持小题";if(r.score!==null&&(!Number.isFinite(r.score)||r.score<(a?0:.5)||r.score>c.score||!Number.isInteger(r.score*2)))return`分值须为 ${a?0:.5}–${c.score} 分,按 0.5 分递增`;if(r.type==="MCHOICE"&&(r.lessScore<0||!Number.isInteger(r.lessScore*2)||r.lessScore>(r.score||0)))return"少选得分不能超过本题分值";if(r.type==="CHUNK_CHOICE"){if(!r.rightAnswers||!Number.isInteger(r.rightAnswers)||r.rightAnswers>=r.optionCount)return"正确答案个数需小于选项个数";if(r.singleScore===null||r.singleScore<.5||!Number.isInteger(r.singleScore*2)||r.score!==null&&r.score!==0&&r.singleScore*r.rightAnswers>r.score)return"每处得分乘以正确答案个数不可大于每题分数"}return r.type==="CCOMPOSITION"&&(!Number.isInteger(r.characters)||r.characters<1||r.characters>1200)?"作文格数须为 1–1200":r.type==="ECOMPOSITION"&&(!Number.isInteger(r.lines)||r.lines<1||r.lines>100)?"作文行数须为 1–100":r.score===null?"请输入分值":null}function RS(t,r,i){const a=Be(r.type)?r.partCount:1,c=[];for(let d=r.start;d<=(Ti(r.type)?r.start:r.end);d+=a)c.push(wu(r,d));const l=[...t.questions],u=l.findIndex(d=>d.id===i||d.parts.some(m=>m.id===i));return l.splice(u<0?l.length:u+1,0,...c),{...t,questions:l}}function el(t){return t.questions.flatMap(r=>[r,...r.parts])}function ha(t){return t.questions.filter(r=>Et(r.type)).flatMap(r=>Be(r.type)?r.parts.map(i=>({...i.choice,label:i.label,score:i.score})):[{...r.choice,label:r.label,score:r.score}])}function OS(t,r){const i=Ao(t);return i.referenceData&&(i.referenceData={...i.referenceData,questionId:i.id}),i.text&&(i.text.groupId=`options:${i.id}`),i.label=String(r),i.choice.label=i.label,i.choice.contentTarget=null,i.choice.breakBefore=!1,i.parts.forEach((a,c)=>{a.label=Be(i.type)?String(r+c):i.parts.length===1?i.label:`${r}.${c+1}`,a.choice.label=a.label,a.choice.contentTarget=null,a.choice.breakBefore=!1}),i.parts.forEach(a=>{a.text&&(a.text.groupId=`options:${a.id}`),a.referenceData&&(a.referenceData={...a.referenceData,questionId:a.id,questionPid:i.id})}),i.document=wn(i.document,i.label,i.score),i.parts=i.parts.map(a=>({...a,document:wn(a.document,a.label,a.score)})),i}function NS(t){return Math.max(1,Math.floor((t-6)/31))}function MS(t,r){return{version:1,content:{type:"doc",content:Array.from({length:t},()=>({type:"paragraph",attrs:{fixedLineHeight:45.35433070866142},content:[{type:"text",text:" ".repeat(Math.max(1,Math.floor((r-24)/3))),marks:[{type:"underline"},{type:"textStyle",attrs:{fontFamily:"Times New Roman, serif",fontSize:"12px"}}]}]}))}}}function _S(t,r,i=!1){const a=t.questions.reduce((l,u)=>l+(u.parts.length||1),0),c=r/a;return!a||!Number.isFinite(c)||c<(i?0:.5)||!Number.isInteger(c*2)||t.questions.some(l=>c>da[l.type].score||c!==0&&l.type==="CHUNK_CHOICE"&&(l.rightAnswers||0)*(l.singleScore||0)>c)?null:{...t,questions:t.questions.map(l=>({...l,score:c*(l.parts.length||1),document:wn(l.document,l.label,c*(l.parts.length||1)),choice:{...l.choice,score:c,lessScore:Math.min(l.choice.lessScore||0,c)},parts:l.parts.map(u=>({...u,score:c,document:wn(u.document,u.label,c),choice:{...u.choice,score:c}}))}))}}function DS(t,r){return[...t<=17?Array.from({length:18},(i,a)=>17-a<=t?String(17-a):""):[...Array.from({length:7},(i,a)=>7-a<=Math.floor(t/10)?`${7-a}0`:""),"",...Array.from({length:10},(i,a)=>String(9-a))],r?"0.5":""]}const IS=["000","100","110","111","101","010","011","001"],kS=t=>IS[t-1],Tu={CHINESE:[1],MATHS:[2],ENGLISH:[3],PHYSICAL:[4],CHEMICAL:[1,2],POLITICAL:[1,3],BIOLOGICAL:[1,4],GEOGRAPHIC:[2,3],JAPANESE:[2,4],IT:[3,4],GYM:[1,2,3],MUSIC:[1,2,4],ART:[1,3,4],SCIENCE:[2,3,4],HISTORY:[1,2,3,4]},LS={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",物理:"PHYSICAL",化学:"CHEMICAL",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",日语:"JAPANESE",信息科技:"IT",信息技术:"IT",体育:"GYM",音乐:"MUSIC",美术:"ART",科学:"SCIENCE",历史:"HISTORY"};function Dm(t){return t?.subjectCode||(t?.courseCode&&Tu[t.courseCode]?t.courseCode:LS[t?.subject||""])}const Qn=t=>Math.round(t*1e3)/1e3,Im=t=>({x:Qn(t.x),y:Qn(t.y),width:Qn(t.width),height:Qn(t.height)});function km(t,r){const i=Math.max(t.x,r.x),a=Math.max(t.y,r.y),c=Math.min(t.x+t.width,r.x+r.width)-i,l=Math.min(t.y+t.height,r.y+r.height)-a;return c>.01&&l>.01?{x:i,y:a,width:c,height:l}:void 0}const ma=function(t,r){let c=t;const l=Ai[r];let u=null,d=0,m=null;const p=[],C={},g=function(_,I){d=c*4+17,u=(function(B){const H=new Array(B);for(let z=0;z<B;z+=1){H[z]=new Array(B);for(let $=0;$<B;$+=1)H[z][$]=null}return H})(d),b(0,0),b(d-7,0),b(0,d-7),S(),v(),T(_,I),c>=7&&w(_),m==null&&(m=O(c,l,p)),j(m,I)},b=function(_,I){for(let B=-1;B<=7;B+=1)if(!(_+B<=-1||d<=_+B))for(let H=-1;H<=7;H+=1)I+H<=-1||d<=I+H||(0<=B&&B<=6&&(H==0||H==6)||0<=H&&H<=6&&(B==0||B==6)||2<=B&&B<=4&&2<=H&&H<=4?u[_+B][I+H]=!0:u[_+B][I+H]=!1)},x=function(){let _=0,I=0;for(let B=0;B<8;B+=1){g(!0,B);const H=Vr.getLostPoint(C);(B==0||_>H)&&(_=H,I=B)}return I},v=function(){for(let _=8;_<d-8;_+=1)u[_][6]==null&&(u[_][6]=_%2==0);for(let _=8;_<d-8;_+=1)u[6][_]==null&&(u[6][_]=_%2==0)},S=function(){const _=Vr.getPatternPosition(c);for(let I=0;I<_.length;I+=1)for(let B=0;B<_.length;B+=1){const H=_[I],z=_[B];if(u[H][z]==null)for(let $=-2;$<=2;$+=1)for(let X=-2;X<=2;X+=1)$==-2||$==2||X==-2||X==2||$==0&&X==0?u[H+$][z+X]=!0:u[H+$][z+X]=!1}},w=function(_){const I=Vr.getBCHTypeNumber(c);for(let B=0;B<18;B+=1){const H=!_&&(I>>B&1)==1;u[Math.floor(B/3)][B%3+d-8-3]=H}for(let B=0;B<18;B+=1){const H=!_&&(I>>B&1)==1;u[B%3+d-8-3][Math.floor(B/3)]=H}},T=function(_,I){const B=l<<3|I,H=Vr.getBCHTypeInfo(B);for(let z=0;z<15;z+=1){const $=!_&&(H>>z&1)==1;z<6?u[z][8]=$:z<8?u[z+1][8]=$:u[d-15+z][8]=$}for(let z=0;z<15;z+=1){const $=!_&&(H>>z&1)==1;z<8?u[8][d-z-1]=$:z<9?u[8][15-z-1+1]=$:u[8][15-z-1]=$}u[d-8][8]=!_},j=function(_,I){let B=-1,H=d-1,z=7,$=0;const X=Vr.getMaskFunction(I);for(let G=d-1;G>0;G-=2)for(G==6&&(G-=1);;){for(let te=0;te<2;te+=1)if(u[H][G-te]==null){let V=!1;$<_.length&&(V=(_[$]>>>z&1)==1),X(H,G-te)&&(V=!V),u[H][G-te]=V,z-=1,z==-1&&($+=1,z=7)}if(H+=B,H<0||d<=H){H-=B,B=-B;break}}},R=function(_,I){let B=0,H=0,z=0;const $=new Array(I.length),X=new Array(I.length);for(let Y=0;Y<I.length;Y+=1){const L=I[Y].dataCount,P=I[Y].totalCount-L;H=Math.max(H,L),z=Math.max(z,P),$[Y]=new Array(L);for(let Q=0;Q<$[Y].length;Q+=1)$[Y][Q]=255&_.getBuffer()[Q+B];B+=L;const N=Vr.getErrorCorrectPolynomial(P),J=Ri($[Y],N.getLength()-1).mod(N);X[Y]=new Array(N.getLength()-1);for(let Q=0;Q<X[Y].length;Q+=1){const le=Q+J.getLength()-X[Y].length;X[Y][Q]=le>=0?J.getAt(le):0}}let G=0;for(let Y=0;Y<I.length;Y+=1)G+=I[Y].totalCount;const te=new Array(G);let V=0;for(let Y=0;Y<H;Y+=1)for(let L=0;L<I.length;L+=1)Y<$[L].length&&(te[V]=$[L][Y],V+=1);for(let Y=0;Y<z;Y+=1)for(let L=0;L<I.length;L+=1)Y<X[L].length&&(te[V]=X[L][Y],V+=1);return te},O=function(_,I,B){const H=Lm.getRSBlocks(_,I),z=zm();for(let X=0;X<B.length;X+=1){const G=B[X];z.put(G.getMode(),4),z.put(G.getLength(),Vr.getLengthInBits(G.getMode(),_)),G.write(z)}let $=0;for(let X=0;X<H.length;X+=1)$+=H[X].dataCount;if(z.getLengthInBits()>$*8)throw"code length overflow. ("+z.getLengthInBits()+">"+$*8+")";for(z.getLengthInBits()+4<=$*8&&z.put(0,4);z.getLengthInBits()%8!=0;)z.putBit(!1);for(;!(z.getLengthInBits()>=$*8||(z.put(236,8),z.getLengthInBits()>=$*8));)z.put(17,8);return R(z,H)};C.addData=function(_,I){I=I||"Byte";let B=null;switch(I){case"Numeric":B=zS(_);break;case"Alphanumeric":B=BS(_);break;case"Byte":B=HS(_);break;case"Kanji":B=PS(_);break;default:throw"mode:"+I}p.push(B),m=null},C.isDark=function(_,I){if(_<0||d<=_||I<0||d<=I)throw _+","+I;return u[_][I]},C.getModuleCount=function(){return d},C.make=function(){if(c<1){let _=1;for(;_<40;_++){const I=Lm.getRSBlocks(_,l),B=zm();for(let z=0;z<p.length;z++){const $=p[z];B.put($.getMode(),4),B.put($.getLength(),Vr.getLengthInBits($.getMode(),_)),$.write(B)}let H=0;for(let z=0;z<I.length;z++)H+=I[z].dataCount;if(B.getLengthInBits()<=H*8)break}c=_}g(!1,x())},C.createTableTag=function(_,I){_=_||2,I=typeof I>"u"?_*4:I;let B="";B+='<table style="',B+=" border-width: 0px; border-style: none;",B+=" border-collapse: collapse;",B+=" padding: 0px; margin: "+I+"px;",B+='">',B+="<tbody>";for(let H=0;H<C.getModuleCount();H+=1){B+="<tr>";for(let z=0;z<C.getModuleCount();z+=1)B+='<td style="',B+=" border-width: 0px; border-style: none;",B+=" border-collapse: collapse;",B+=" padding: 0px; margin: 0px;",B+=" width: "+_+"px;",B+=" height: "+_+"px;",B+=" background-color: ",B+=C.isDark(H,z)?"#000000":"#ffffff",B+=";",B+='"/>';B+="</tr>"}return B+="</tbody>",B+="</table>",B},C.createSvgTag=function(_,I,B,H){let z={};typeof arguments[0]=="object"&&(z=arguments[0],_=z.cellSize,I=z.margin,B=z.alt,H=z.title),_=_||2,I=typeof I>"u"?_*4:I,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-description":null,H=typeof H=="string"?{text:H}:H||{},H.text=H.text||null,H.id=H.text?H.id||"qrcode-title":null;const $=C.getModuleCount()*_+I*2;let X,G,te,V,Y="",L;for(L="l"+_+",0 0,"+_+" -"+_+",0 0,-"+_+"z ",Y+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',Y+=z.scalable?"":' width="'+$+'px" height="'+$+'px"',Y+=' viewBox="0 0 '+$+" "+$+'" ',Y+=' preserveAspectRatio="xMinYMin meet"',Y+=H.text||B.text?' role="img" aria-labelledby="'+M([H.id,B.id].join(" ").trim())+'"':"",Y+=">",Y+=H.text?'<title id="'+M(H.id)+'">'+M(H.text)+"</title>":"",Y+=B.text?'<description id="'+M(B.id)+'">'+M(B.text)+"</description>":"",Y+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',Y+='<path d="',te=0;te<C.getModuleCount();te+=1)for(V=te*_+I,X=0;X<C.getModuleCount();X+=1)C.isDark(te,X)&&(G=X*_+I,Y+="M"+G+","+V+L);return Y+='" stroke="transparent" fill="black"/>',Y+="</svg>",Y},C.createDataURL=function(_,I){_=_||2,I=typeof I>"u"?_*4:I;const B=C.getModuleCount()*_+I*2,H=I,z=B-I;return VS(B,B,function($,X){if(H<=$&&$<z&&H<=X&&X<z){const G=Math.floor(($-H)/_),te=Math.floor((X-H)/_);return C.isDark(te,G)?0:1}else return 1})},C.createImgTag=function(_,I,B){_=_||2,I=typeof I>"u"?_*4:I;const H=C.getModuleCount()*_+I*2;let z="";return z+="<img",z+=' src="',z+=C.createDataURL(_,I),z+='"',z+=' width="',z+=H,z+='"',z+=' height="',z+=H,z+='"',B&&(z+=' alt="',z+=M(B),z+='"'),z+="/>",z};const M=function(_){let I="";for(let B=0;B<_.length;B+=1){const H=_.charAt(B);switch(H){case"<":I+="<";break;case">":I+=">";break;case"&":I+="&";break;case'"':I+=""";break;default:I+=H;break}}return I},D=function(_){_=typeof _>"u"?2:_;const B=C.getModuleCount()*1+_*2,H=_,z=B-_;let $,X,G,te,V;const Y={"██":"█","█ ":"▀"," █":"▄"," ":" "},L={"██":"▀","█ ":"▀"," █":" "," ":" "};let P="";for($=0;$<B;$+=2){for(G=Math.floor(($-H)/1),te=Math.floor(($+1-H)/1),X=0;X<B;X+=1)V="█",H<=X&&X<z&&H<=$&&$<z&&C.isDark(G,Math.floor((X-H)/1))&&(V=" "),H<=X&&X<z&&H<=$+1&&$+1<z&&C.isDark(te,Math.floor((X-H)/1))?V+=" ":V+="█",P+=_<1&&$+1>=z?L[V]:Y[V];P+=`
|
|
2
|
-
`}return
|
|
3
|
-
`}return L.substring(0,L.length-1)},C.renderTo2dContext=function(_,I){I=I||2;const B=C.getModuleCount();for(let H=0;H<B;H++)for(let z=0;z<B;z++)_.fillStyle=C.isDark(H,z)?"black":"white",_.fillRect(z*I,H*I,I,I)},C};ma.stringToBytes=function(t){const r=[];for(let i=0;i<t.length;i+=1){const a=t.charCodeAt(i);r.push(a&255)}return r},ma.createStringToBytes=function(t,r){const i=(function(){const c=$S(t),l=function(){const m=c.read();if(m==-1)throw"eof";return m};let u=0;const d={};for(;;){const m=c.read();if(m==-1)break;const p=l(),C=l(),g=l(),b=String.fromCharCode(m<<8|p),x=C<<8|g;d[b]=x,u+=1}if(u!=r)throw u+" != "+r;return d})(),a=63;return function(c){const l=[];for(let u=0;u<c.length;u+=1){const d=c.charCodeAt(u);if(d<128)l.push(d);else{const m=i[c.charAt(u)];typeof m=="number"?(m&255)==m?l.push(m):(l.push(m>>>8),l.push(m&255)):l.push(a)}}return l}};const qt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ai={L:1,M:0,Q:3,H:2},Gr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Vr=(function(){const t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,i=7973,a=21522,c={},l=function(u){let d=0;for(;u!=0;)d+=1,u>>>=1;return d};return c.getBCHTypeInfo=function(u){let d=u<<10;for(;l(d)-l(r)>=0;)d^=r<<l(d)-l(r);return(u<<10|d)^a},c.getBCHTypeNumber=function(u){let d=u<<12;for(;l(d)-l(i)>=0;)d^=i<<l(d)-l(i);return u<<12|d},c.getPatternPosition=function(u){return t[u-1]},c.getMaskFunction=function(u){switch(u){case Gr.PATTERN000:return function(d,m){return(d+m)%2==0};case Gr.PATTERN001:return function(d,m){return d%2==0};case Gr.PATTERN010:return function(d,m){return m%3==0};case Gr.PATTERN011:return function(d,m){return(d+m)%3==0};case Gr.PATTERN100:return function(d,m){return(Math.floor(d/2)+Math.floor(m/3))%2==0};case Gr.PATTERN101:return function(d,m){return d*m%2+d*m%3==0};case Gr.PATTERN110:return function(d,m){return(d*m%2+d*m%3)%2==0};case Gr.PATTERN111:return function(d,m){return(d*m%3+(d+m)%2)%2==0};default:throw"bad maskPattern:"+u}},c.getErrorCorrectPolynomial=function(u){let d=Ri([1],0);for(let m=0;m<u;m+=1)d=d.multiply(Ri([1,qr.gexp(m)],0));return d},c.getLengthInBits=function(u,d){if(1<=d&&d<10)switch(u){case qt.MODE_NUMBER:return 10;case qt.MODE_ALPHA_NUM:return 9;case qt.MODE_8BIT_BYTE:return 8;case qt.MODE_KANJI:return 8;default:throw"mode:"+u}else if(d<27)switch(u){case qt.MODE_NUMBER:return 12;case qt.MODE_ALPHA_NUM:return 11;case qt.MODE_8BIT_BYTE:return 16;case qt.MODE_KANJI:return 10;default:throw"mode:"+u}else if(d<41)switch(u){case qt.MODE_NUMBER:return 14;case qt.MODE_ALPHA_NUM:return 13;case qt.MODE_8BIT_BYTE:return 16;case qt.MODE_KANJI:return 12;default:throw"mode:"+u}else throw"type:"+d},c.getLostPoint=function(u){const d=u.getModuleCount();let m=0;for(let g=0;g<d;g+=1)for(let b=0;b<d;b+=1){let x=0;const v=u.isDark(g,b);for(let S=-1;S<=1;S+=1)if(!(g+S<0||d<=g+S))for(let w=-1;w<=1;w+=1)b+w<0||d<=b+w||S==0&&w==0||v==u.isDark(g+S,b+w)&&(x+=1);x>5&&(m+=3+x-5)}for(let g=0;g<d-1;g+=1)for(let b=0;b<d-1;b+=1){let x=0;u.isDark(g,b)&&(x+=1),u.isDark(g+1,b)&&(x+=1),u.isDark(g,b+1)&&(x+=1),u.isDark(g+1,b+1)&&(x+=1),(x==0||x==4)&&(m+=3)}for(let g=0;g<d;g+=1)for(let b=0;b<d-6;b+=1)u.isDark(g,b)&&!u.isDark(g,b+1)&&u.isDark(g,b+2)&&u.isDark(g,b+3)&&u.isDark(g,b+4)&&!u.isDark(g,b+5)&&u.isDark(g,b+6)&&(m+=40);for(let g=0;g<d;g+=1)for(let b=0;b<d-6;b+=1)u.isDark(b,g)&&!u.isDark(b+1,g)&&u.isDark(b+2,g)&&u.isDark(b+3,g)&&u.isDark(b+4,g)&&!u.isDark(b+5,g)&&u.isDark(b+6,g)&&(m+=40);let p=0;for(let g=0;g<d;g+=1)for(let b=0;b<d;b+=1)u.isDark(b,g)&&(p+=1);const C=Math.abs(100*p/d/d-50)/5;return m+=C*10,m},c})(),qr=(function(){const t=new Array(256),r=new Array(256);for(let a=0;a<8;a+=1)t[a]=1<<a;for(let a=8;a<256;a+=1)t[a]=t[a-4]^t[a-5]^t[a-6]^t[a-8];for(let a=0;a<255;a+=1)r[t[a]]=a;const i={};return i.glog=function(a){if(a<1)throw"glog("+a+")";return r[a]},i.gexp=function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return t[a]},i})(),Ri=function(t,r){if(typeof t.length>"u")throw t.length+"/"+r;const i=(function(){let c=0;for(;c<t.length&&t[c]==0;)c+=1;const l=new Array(t.length-c+r);for(let u=0;u<t.length-c;u+=1)l[u]=t[u+c];return l})(),a={};return a.getAt=function(c){return i[c]},a.getLength=function(){return i.length},a.multiply=function(c){const l=new Array(a.getLength()+c.getLength()-1);for(let u=0;u<a.getLength();u+=1)for(let d=0;d<c.getLength();d+=1)l[u+d]^=qr.gexp(qr.glog(a.getAt(u))+qr.glog(c.getAt(d)));return Ri(l,0)},a.mod=function(c){if(a.getLength()-c.getLength()<0)return a;const l=qr.glog(a.getAt(0))-qr.glog(c.getAt(0)),u=new Array(a.getLength());for(let d=0;d<a.getLength();d+=1)u[d]=a.getAt(d);for(let d=0;d<c.getLength();d+=1)u[d]^=qr.gexp(qr.glog(c.getAt(d))+l);return Ri(u,0).mod(c)},a},Lm=(function(){const t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(c,l){const u={};return u.totalCount=c,u.dataCount=l,u},i={},a=function(c,l){switch(l){case Ai.L:return t[(c-1)*4+0];case Ai.M:return t[(c-1)*4+1];case Ai.Q:return t[(c-1)*4+2];case Ai.H:return t[(c-1)*4+3];default:return}};return i.getRSBlocks=function(c,l){const u=a(c,l);if(typeof u>"u")throw"bad rs block @ typeNumber:"+c+"/errorCorrectionLevel:"+l;const d=u.length/3,m=[];for(let p=0;p<d;p+=1){const C=u[p*3+0],g=u[p*3+1],b=u[p*3+2];for(let x=0;x<C;x+=1)m.push(r(g,b))}return m},i})(),zm=function(){const t=[];let r=0;const i={};return i.getBuffer=function(){return t},i.getAt=function(a){const c=Math.floor(a/8);return(t[c]>>>7-a%8&1)==1},i.put=function(a,c){for(let l=0;l<c;l+=1)i.putBit((a>>>c-l-1&1)==1)},i.getLengthInBits=function(){return r},i.putBit=function(a){const c=Math.floor(r/8);t.length<=c&&t.push(0),a&&(t[c]|=128>>>r%8),r+=1},i},zS=function(t){const r=qt.MODE_NUMBER,i=t,a={};a.getMode=function(){return r},a.getLength=function(u){return i.length},a.write=function(u){const d=i;let m=0;for(;m+2<d.length;)u.put(c(d.substring(m,m+3)),10),m+=3;m<d.length&&(d.length-m==1?u.put(c(d.substring(m,m+1)),4):d.length-m==2&&u.put(c(d.substring(m,m+2)),7))};const c=function(u){let d=0;for(let m=0;m<u.length;m+=1)d=d*10+l(u.charAt(m));return d},l=function(u){if("0"<=u&&u<="9")return u.charCodeAt(0)-48;throw"illegal char :"+u};return a},BS=function(t){const r=qt.MODE_ALPHA_NUM,i=t,a={};a.getMode=function(){return r},a.getLength=function(l){return i.length},a.write=function(l){const u=i;let d=0;for(;d+1<u.length;)l.put(c(u.charAt(d))*45+c(u.charAt(d+1)),11),d+=2;d<u.length&&l.put(c(u.charAt(d)),6)};const c=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return a},HS=function(t){const r=qt.MODE_8BIT_BYTE,i=ma.stringToBytes(t),a={};return a.getMode=function(){return r},a.getLength=function(c){return i.length},a.write=function(c){for(let l=0;l<i.length;l+=1)c.put(i[l],8)},a},PS=function(t){const r=qt.MODE_KANJI,i=ma.stringToBytes;(function(l,u){const d=i(l);if(d.length!=2||(d[0]<<8|d[1])!=u)throw"sjis not supported."})("友",38726);const a=i(t),c={};return c.getMode=function(){return r},c.getLength=function(l){return~~(a.length/2)},c.write=function(l){const u=a;let d=0;for(;d+1<u.length;){let m=(255&u[d])<<8|255&u[d+1];if(33088<=m&&m<=40956)m-=33088;else if(57408<=m&&m<=60351)m-=49472;else throw"illegal char at "+(d+1)+"/"+m;m=(m>>>8&255)*192+(m&255),l.put(m,13),d+=2}if(d<u.length)throw"illegal char at "+(d+1)},c},Bm=function(){const t=[],r={};return r.writeByte=function(i){t.push(i&255)},r.writeShort=function(i){r.writeByte(i),r.writeByte(i>>>8)},r.writeBytes=function(i,a,c){a=a||0,c=c||i.length;for(let l=0;l<c;l+=1)r.writeByte(i[l+a])},r.writeString=function(i){for(let a=0;a<i.length;a+=1)r.writeByte(i.charCodeAt(a))},r.toByteArray=function(){return t},r.toString=function(){let i="";i+="[";for(let a=0;a<t.length;a+=1)a>0&&(i+=","),i+=t[a];return i+="]",i},r},US=function(){let t=0,r=0,i=0,a="";const c={},l=function(d){a+=String.fromCharCode(u(d&63))},u=function(d){if(d<0)throw"n:"+d;if(d<26)return 65+d;if(d<52)return 97+(d-26);if(d<62)return 48+(d-52);if(d==62)return 43;if(d==63)return 47;throw"n:"+d};return c.writeByte=function(d){for(t=t<<8|d&255,r+=8,i+=1;r>=6;)l(t>>>r-6),r-=6},c.flush=function(){if(r>0&&(l(t<<6-r),t=0,r=0),i%3!=0){const d=3-i%3;for(let m=0;m<d;m+=1)a+="="}},c.toString=function(){return a},c},$S=function(t){const r=t;let i=0,a=0,c=0;const l={};l.read=function(){for(;c<8;){if(i>=r.length){if(c==0)return-1;throw"unexpected end of file./"+c}const m=r.charAt(i);if(i+=1,m=="=")return c=0,-1;if(m.match(/^\s$/))continue;a=a<<6|u(m.charCodeAt(0)),c+=6}const d=a>>>c-8&255;return c-=8,d};const u=function(d){if(65<=d&&d<=90)return d-65;if(97<=d&&d<=122)return d-97+26;if(48<=d&&d<=57)return d-48+52;if(d==43)return 62;if(d==47)return 63;throw"c:"+d};return l},GS=function(t,r){const i=t,a=r,c=new Array(t*r),l={};l.setPixel=function(p,C,g){c[C*i+p]=g},l.write=function(p){p.writeString("GIF87a"),p.writeShort(i),p.writeShort(a),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(","),p.writeShort(0),p.writeShort(0),p.writeShort(i),p.writeShort(a),p.writeByte(0);const C=2,g=d(C);p.writeByte(C);let b=0;for(;g.length-b>255;)p.writeByte(255),p.writeBytes(g,b,255),b+=255;p.writeByte(g.length-b),p.writeBytes(g,b,g.length-b),p.writeByte(0),p.writeString(";")};const u=function(p){const C=p;let g=0,b=0;const x={};return x.write=function(v,S){if(v>>>S)throw"length over";for(;g+S>=8;)C.writeByte(255&(v<<g|b)),S-=8-g,v>>>=8-g,b=0,g=0;b=v<<g|b,g=g+S},x.flush=function(){g>0&&C.writeByte(b)},x},d=function(p){const C=1<<p,g=(1<<p)+1;let b=p+1;const x=m();for(let j=0;j<C;j+=1)x.add(String.fromCharCode(j));x.add(String.fromCharCode(C)),x.add(String.fromCharCode(g));const v=Bm(),S=u(v);S.write(C,b);let w=0,T=String.fromCharCode(c[w]);for(w+=1;w<c.length;){const j=String.fromCharCode(c[w]);w+=1,x.contains(T+j)?T=T+j:(S.write(x.indexOf(T),b),x.size()<4095&&(x.size()==1<<b&&(b+=1),x.add(T+j)),T=j)}return S.write(x.indexOf(T),b),S.write(g,b),S.flush(),v.toByteArray()},m=function(){const p={};let C=0;const g={};return g.add=function(b){if(g.contains(b))throw"dup key:"+b;p[b]=C,C+=1},g.size=function(){return C},g.indexOf=function(b){return p[b]},g.contains=function(b){return typeof p[b]<"u"},g};return l},VS=function(t,r,i){const a=GS(t,r);for(let d=0;d<r;d+=1)for(let m=0;m<t;m+=1)a.setPixel(m,d,i(m,d));const c=Bm();a.write(c);const l=US(),u=c.toByteArray();for(let d=0;d<u.length;d+=1)l.writeByte(u[d]);return l.flush(),"data:image/gif;base64,"+l};ma.stringToBytes;function Hm(t){const r=ma(0,"M"),i=Array.from(new TextEncoder().encode(t),l=>String.fromCharCode(l)).join("");r.addData(i,/^\d+$/.test(t)?"Numeric":"Byte"),r.make();const a=r.getModuleCount();let c="";for(let l=0;l<a;l++)for(let u=0;u<a;u++)r.isDark(l,u)&&(c+=`M${u} ${l}h1v1h-1z`);return{count:a,path:c}}class pa extends Error{constructor(i){super(i[0]?.message||"题卡数据无效");gm(this,"issues");this.name="AnswerSheetDataError",this.issues=i}}function ju(t,r){const i=(v,S="题卡数据结构无效")=>{throw new pa([{code:"INVALID_DATA",path:v,message:S}])},a=(v,S)=>!v||typeof v!="object"||Array.isArray(v)?i(S):v,c=(v,S)=>Array.isArray(v)?v:i(S),l=(v,S)=>{typeof v!="string"&&i(S)},u=(v,S,w=0,T=1e5)=>{(typeof v!="number"||!Number.isFinite(v)||v<w||v>T)&&i(S)},d=(v,S)=>{a(v,S);const w=r.validateDocument(v);w.length&&i(S,w[0])},m=(v,S)=>{const w=a(v,S);if(l(w.id,`${S}.id`),l(w.label,`${S}.label`),(typeof w.multiple!="boolean"||typeof w.breakBefore!="boolean")&&i(S),w.contentTarget!==void 0&&w.contentTarget!==null){const T=a(w.contentTarget,`${S}.contentTarget`);l(T.groupId,`${S}.contentTarget.groupId`),c(T.optionIds,`${S}.contentTarget.optionIds`).forEach((j,R)=>l(j,`${S}.contentTarget.optionIds.${R}`))}c(w.options,`${S}.options`).forEach((T,j)=>{const R=a(T,`${S}.options.${j}`);l(R.id,`${S}.options.${j}.id`),l(R.label,`${S}.options.${j}.label`)}),c(w.correctIds,`${S}.correctIds`).forEach((T,j)=>l(T,`${S}.correctIds.${j}`))},p=(v,S)=>{const w=a(v,S);(!["row","column"].includes(String(w.direction))||!["concentrated","distributed","stem","option"].includes(String(w.presentation))||!["box","check","bubble"].includes(String(w.marker)))&&i(S),u(w.rowsPerColumn,`${S}.rowsPerColumn`,1,5),u(w.rowGap,`${S}.rowGap`,0,64),u(w.columnGap,`${S}.columnGap`,0,64),c(w.questions,`${S}.questions`).forEach((T,j)=>m(T,`${S}.questions.${j}`))},C=new WeakSet,g=(v,S)=>{if(!(!v||typeof v!="object")){if(C.has(v))return i(S,"题卡必须是无循环引用的 JSON 数据");C.add(v),Object.entries(v).forEach(([w,T])=>g(T,`${S}.${w}`)),C.delete(v)}},b=a(t,"");if(b.version!==1&&i("version","不支持的题卡数据版本"),l(b.title,"title"),b.usage!==void 0&&!["exam","homework"].includes(String(b.usage))&&i("usage"),["questionCard","scanMarking","halfPoint","mergeObjective"].forEach(v=>{b[v]!==void 0&&typeof b[v]!="boolean"&&i(v)}),["a4","a3-two","a3-three"].includes(String(b.preset))||i("preset"),u(b.margin,"margin",0,100),u(b.gap,"gap",0,100),b.creation){const v=a(b.creation,"creation");["template","exam"].includes(String(v.mode))||i("creation.mode"),["name","grade","subject"].forEach(S=>l(v[S],`creation.${S}`));for(const S of["gradeCode","courseCode","subjectCode"])v[S]!==void 0&&(typeof v[S]!="string"||!v[S].trim())&&i(`creation.${S}`);v.phaseCode!==void 0&&!["P","J","S"].includes(String(v.phaseCode))&&i("creation.phaseCode"),v.createMode!==void 0&&!["MANUALLY","IMPORTED","THIRD"].includes(String(v.createMode))&&i("creation.createMode");for(const S of["id","exampaperId"])if(v[S]!==void 0){const w=v[S];typeof w=="string"&&w.trim()||typeof w=="number"&&Number.isSafeInteger(w)&&w>=0||i(`creation.${S}`)}}if(b.paperTitle){const v=a(b.paperTitle,"paperTitle");l(v.id,"paperTitle.id"),u(v.height,"paperTitle.height",1,1e3),d(v.document,"paperTitle.document")}if(b.header){const v=a(b.header,"header");["code","school"].includes(String(v.kaohao))||i("header.kaohao"),u(v.weishu,"header.weishu",1,20),v.tiaomaStyle!==void 0&&![1,2].includes(v.tiaomaStyle)&&i("header.tiaomaStyle"),v.classText!==void 0&&typeof v.classText!="boolean"&&i("header.classText")}if(b.recognition!==void 0){const v=a(b.recognition,"recognition");for(const S of["examQrCode","subjectMarkers","pointBlack"])v[S]!==void 0&&typeof v[S]!="boolean"&&i(`recognition.${S}`)}c(b.blocks,"blocks").forEach((v,S)=>{const w=`blocks.${S}`,T=a(v,w);if(l(T.id,`${w}.id`),l(T.title,`${w}.title`),u(T.answerHeight,`${w}.answerHeight`),d(T.document,`${w}.document`),T.kind==="area"){(!["forbiden","editArea"].includes(String(T.areaType))||T.reference||T.choices||T.exercise)&&i(`${w}.areaType`),u(T.answerHeight,`${w}.answerHeight`,100,4e3);return}if(!T.reference){if(T.choices){p(T.choices,`${w}.choices`);return}i(`${w}.reference`,"请使用包含 reference 题目结构的制卡数据")}const j=a(T.reference,`${w}.reference`);j.material!==void 0&&d(j.material,`${w}.reference.material`),j.textVersion!==void 0&&j.textVersion!==1&&i(`${w}.reference.textVersion`),Object.hasOwn(cr,String(j.type))||i(`${w}.reference.type`),p(j.layout,`${w}.reference.layout`),u(j.optionalHeight,`${w}.reference.optionalHeight`),c(j.questions,`${w}.reference.questions`).forEach((R,O)=>{const M=`${w}.reference.questions.${O}`,D=a(R,M);Object.hasOwn(da,String(D.type))||i(`${M}.type`),l(D.id,`${M}.id`),l(D.label,`${M}.label`),m(D.choice,`${M}.choice`),["height","contentHeight","characters","lines"].forEach(I=>u(D[I],`${M}.${I}`)),d(D.document,`${M}.document`);const _=(I,B)=>{if(!I)return;const H=a(I,B);d(H.content,`${B}.content`),a(H.layout,`${B}.layout`),l(H.groupId,`${B}.groupId`),c(H.itemsContent,`${B}.itemsContent`).forEach((z,$)=>{const X=a(z,`${B}.itemsContent.${$}`);l(X.id,`${B}.itemsContent.${$}.id`),l(X.key,`${B}.itemsContent.${$}.key`),d(X.content,`${B}.itemsContent.${$}.content`)})};_(D.text,`${M}.text`),c(D.parts,`${M}.parts`).forEach((I,B)=>{const H=`${M}.parts.${B}`,z=a(I,H);l(z.id,`${H}.id`),l(z.label,`${H}.label`),u(z.width,`${H}.width`),u(z.height,`${H}.height`),d(z.document,`${H}.document`),m(z.choice,`${H}.choice`),_(z.text,`${H}.text`)})})}),g(t,"");const x=xu(t);(x.columnWidth<100||x.contentHeight<100)&&i("margin","边距或栏间距过大,纸张没有足够的作答区域")}function tl(t){return!t||t.marks?.some(r=>r.type==="documentLabel")?!1:t.type==="text"?!!t.text?.trim():t.type==="image"?!!t.attrs?.src:t.type==="formula"||t.type==="blockFormula"?!!t.attrs?.latex?.trim():!!t.content?.some(tl)}function qS(t,r){try{ju(t,r)}catch(x){return{valid:!1,issues:x instanceof pa?x.issues:[{code:"INVALID_DATA",path:"",message:"题卡数据无法读取"}]}}const i=[];let a={};const c=(x,v,S)=>i.push({code:x,path:v,message:S,...a}),l=new Set,u=(x,v)=>{(!x.trim()||l.has(x))&&c("DUPLICATE_ID",v,"题块、题目和选项 ID 必须非空且唯一"),l.add(x)},d=(x,v,S)=>{(x===null||!Number.isFinite(x)||x<(t.usage==="homework"?0:.5)||x>v||!Number.isInteger(x*2))&&c("INVALID_SCORE",S,`分值须为 ${t.usage==="homework"?0:.5}–${v} 分,按 0.5 分递增`)},m=(x,v,S)=>{(x.options.length<v[0]||x.options.length>v[1])&&c("INVALID_OPTIONS",`${S}.options`,`选项个数须为 ${v[0]}–${v[1]}`),x.options.forEach((w,T)=>u(w.id,`${S}.options.${T}.id`)),(new Set(x.correctIds).size!==x.correctIds.length||x.correctIds.some(w=>!x.options.some(T=>T.id===w)))&&c("INVALID_ANSWER_REFERENCE",`${S}.correctIds`,"答案引用了不存在或重复的选项")},p=(x,v,S,w=0,T=!0)=>{T&&!tl(x?.content.content)&&c("MISSING_CONTENT",`${v}.content`,"请填写题干或材料"),S&&(x?.itemsContent.length!==w||x.itemsContent.some(j=>!tl(j.content.content)))&&c("MISSING_OPTION_CONTENT",`${v}.itemsContent`,"请补全每个选项的内容")};if(t.title.trim()||c("MISSING_TITLE","title","请填写题卡名称"),t.recognition?.examQrCode){const x=String(t.creation?.exampaperId??"").trim();if(!x)c("MISSING_EXAM_ID","creation.exampaperId","显示试卷二维码需要填写试卷 ID");else try{Hm(x)}catch{c("INVALID_QR_PAYLOAD","creation.exampaperId","试卷 ID 太长,无法生成二维码")}}t.header&&t.recognition?.subjectMarkers!==!1&&!Tu[Dm(t.creation)||""]&&c("UNKNOWN_SUBJECT_MARK","creation.subjectCode","当前学科没有参考识别编码,请配置标准学科或关闭学科标记"),(!t.creation?.grade.trim()||!t.creation.subject.trim())&&c("MISSING_CREATION","creation","请选择年级和学科"),(!t.paperTitle||!tl(t.paperTitle.document.content))&&c("MISSING_PAPER_TITLE","paperTitle","请填写纸面标题"),t.blocks.some(x=>x.kind!=="area")||c("EMPTY_CARD","blocks","请至少添加一个题块和一道题目"),t.paperTitle&&u(t.paperTitle.id,"paperTitle.id"),t.blocks.forEach((x,v)=>{a={blockId:x.id};const S=`blocks.${v}`;if(u(x.id,`${S}.id`),x.kind==="area"){x.areaType===(t.questionCard?"forbiden":"editArea")&&c("INVALID_AREA_MODE",`${S}.areaType`,"题卡合一使用空白答题区,独立答题卡使用禁止答题区");return}x.title.trim()||c("MISSING_BLOCK_TITLE",`${S}.title`,"请填写题块标题"),x.id==="reference-merged-objective"&&c("RESERVED_ID",`${S}.id`,"题块使用了系统保留 ID");const w=x.reference;if(!w){x.choices?.questions.length||c("EMPTY_BLOCK",S,"题块中没有题目"),x.choices?.questions.forEach((j,R)=>{a={blockId:x.id,questionId:j.id},u(j.id,`${S}.choices.questions.${R}.id`),m(j,[2,12],`${S}.choices.questions.${R}`),d(j.score??null,15,`${S}.choices.questions.${R}.score`)});return}w.questions.length||c("EMPTY_BLOCK",`${S}.reference.questions`,"题块中没有题目");const T=Eu(w);if((T.some(j=>!j.trim())||new Set(T).size!==T.length)&&c("INVALID_QUESTION_NUMBER",`${S}.reference.questions`,"同一题块内的题号须非空且不能重复"),w.optional&&(w.type!=="SHORTANSWER"||!Number.isInteger(w.choose)||w.choose<1||w.choose>=w.questions.length)&&c("INVALID_OPTIONAL",`${S}.reference.choose`,"选做题须为解答题,且选做数量小于总题数"),w.type==="CCOMPOSITION"&&w.questions.length>1&&c("INVALID_COUNT",`${S}.reference.questions`,"语文作文每组只能有一道题"),w.questions.forEach((j,R)=>{a={blockId:x.id,questionId:j.id};const O=`${S}.reference.questions.${R}`,M=da[j.type];u(j.id,`${O}.id`),w.type!=="MIXED"&&w.type!==j.type&&c("TYPE_MISMATCH",`${O}.type`,"题目类型与题块不一致"),j.choice.id!==j.id&&c("INVALID_BINDING",`${O}.choice.id`,"题目与填涂项 ID 不一致");const D=Be(j.type)||["FILLBLANK","SHORTANSWER"].includes(j.type);(D&&(j.parts.length<1||j.parts.length>M.parts)||!D&&j.parts.length)&&c("INVALID_PARTS",`${O}.parts`,`子题/空数须为 ${D?`1–${M.parts}`:"0"}`),j.parts.length?j.score!==Fn(j.parts)&&c("SCORE_MISMATCH",`${O}.score`,"总分与子题分值之和不一致"):d(j.score,M.score,`${O}.score`),Et(j.type)&&!Be(j.type)&&m(j.choice,M.options,`${O}.choice`),j.type==="INFO_MATCHING"&&(m(j.choice,M.options,`${O}.choice`),j.parts.length>j.choice.options.length&&c("INVALID_OPTIONS",`${O}.choice.options`,"信息匹配的选项数不能少于子题数")),j.type==="MCHOICE"&&(!Number.isFinite(j.choice.lessScore)||j.choice.lessScore<0||j.choice.lessScore>(j.score||0)||!Number.isInteger(j.choice.lessScore*2))&&c("INVALID_LESS_SCORE",`${O}.choice.lessScore`,"少选得分须按 0.5 分递增且不能超过本题分值"),j.type==="CHUNK_CHOICE"&&(!j.rightAnswers||!Number.isInteger(j.rightAnswers)||j.rightAnswers>=j.choice.options.length||!j.singleScore||j.singleScore<.5||!Number.isInteger(j.singleScore*2)||j.score!==0&&j.singleScore*j.rightAnswers>(j.score||0))&&c("INVALID_CHUNK_SCORE",O,"请检查正确答案个数及每处得分"),j.type==="CCOMPOSITION"&&(!Number.isInteger(j.characters)||j.characters<1||j.characters>1200)&&c("INVALID_GRID_COUNT",`${O}.characters`,"作文格数须为 1–1200"),j.type==="ECOMPOSITION"&&(!Number.isInteger(j.lines)||j.lines<1||j.lines>100)&&c("INVALID_LINE_COUNT",`${O}.lines`,"作文行数须为 1–100"),t.questionCard&&p(j.text,`${O}.text`,["SCHOICE","MCHOICE"].includes(j.type),j.choice.options.length),j.parts.forEach((_,I)=>{const B=`${O}.parts.${I}`;a={blockId:x.id,questionId:_.id},u(_.id,`${B}.id`),d(_.score,M.score,`${B}.score`),Be(j.type)&&Et(j.type)&&(m(_.choice,M.options,`${B}.choice`),_.choice.id!==_.id&&c("INVALID_BINDING",`${B}.choice.id`,"子题与填涂项 ID 不一致")),t.questionCard&&["CLOZE","READTHENANSWER"].includes(j.type)&&p(_.text,`${B}.text`,!0,_.choice.options.length,j.type==="READTHENANSWER")})}),a={blockId:x.id},t.questionCard&&w.layout.presentation!=="concentrated"){const j=w.questions.filter(O=>Et(O.type)).flatMap(O=>Be(O.type)?O.parts.map(M=>M.choice):[O.choice]);la({...w.layout,questions:j},x.document,!0).concentrated.questions.length&&c("MISSING_FILL_TARGET",`${S}.reference.layout.presentation`,"部分填涂框没有对应的题干或选项位置")}}),a={};const C=(x,v)=>{x.type==="image"&&(!x.attrs?.src||/^blob:/i.test(x.attrs.src))&&c("INVALID_IMAGE_URL",v,"图片缺少可保存的地址,请上传后使用持久 URL 或内嵌图片"),["formula","blockFormula"].includes(x.type||"")&&!String(x.attrs?.latex||"").trim()&&c("EMPTY_FORMULA",v,"请填写公式或删除空公式"),x.content?.forEach((S,w)=>C(S,`${v}.content.${w}`))},g=(x,v)=>{x&&C(x.content,`${v}.content`)},b=(x,v)=>{g(x?.content,`${v}.content`),x?.itemsContent.forEach((S,w)=>g(S.content,`${v}.itemsContent.${w}.content`))};return g(t.paperTitle?.document,"paperTitle.document"),t.blocks.forEach((x,v)=>{a={blockId:x.id};const S=`blocks.${v}`;g(x.document,`${S}.document`),g(x.reference?.material,`${S}.reference.material`),x.reference?.questions.forEach((w,T)=>{a={blockId:x.id,questionId:w.id};const j=`blocks.${v}.reference.questions.${T}`;g(w.document,`${j}.document`),b(w.text,`${j}.text`),w.parts.forEach((R,O)=>{a={blockId:x.id,questionId:R.id},g(R.document,`${j}.parts.${O}.document`),b(R.text,`${j}.parts.${O}.text`)})})}),{valid:i.length===0,issues:i}}function Au(t){if(t!==void 0)try{const r=su(t);return{grades:r.grades,gradeCourseMap:r.gradeCourseMap,defaultGradeCode:r.defaultGradeCode||void 0,defaultCourseCode:r.defaultCourseCode||void 0}}catch(r){throw r instanceof iu?new pa([{code:"INVALID_DICTIONARIES",path:r.path,message:r.message}]):r}}function YS(t,r){const i=(M,D)=>{throw new pa([{code:"INVALID_INITIALIZATION",path:M,message:D}])},a=(M,D,_)=>{if(!M||typeof M!="object"||Array.isArray(M))return i(D,"初始化配置必须是对象");const I=Object.entries(M);for(const[B]of I)_.includes(B)||i(`${D}.${B}`,"不支持的初始化字段");return Object.fromEntries(I.filter(([,B])=>B!==void 0))},c=(M,D)=>typeof M!="string"||!M.trim()?i(D,"请提供非空的试卷名称、年级和学科"):M.trim(),l=(M,D,_)=>{M!==void 0&&!_.includes(M)&&i(D,`可选值为 ${_.join("、")}`)},u=(M,D)=>{M!==void 0&&typeof M!="boolean"&&i(D,"请使用布尔值")},d=(M,D,_,I)=>{M!==void 0&&(typeof M!="number"||!Number.isFinite(M)||M<_||M>I)&&i(D,`数值必须在 ${_}–${I} 之间`)},m=a(t,"initialization",["name","grade","subject","gradeCode","courseCode","subjectCode","mode","id","exampaperId","createMode","layout","header","recognition"]),p=c(m.name,"initialization.name");p.length>30&&i("initialization.name","试卷名称最多 30 个字符");const C=su(Au(r)),g=m.gradeCode!==void 0||m.courseCode!==void 0||m.subjectCode!==void 0;let b;if(g){try{b=bi(C,c(m.gradeCode,"initialization.gradeCode"),c(m.courseCode,"initialization.courseCode"))}catch(M){if(M instanceof iu)return i(M.path,M.message);throw M}for(const M of["grade","subject","subjectCode"])m[M]!==void 0&&c(m[M],`initialization.${M}`)!==b[M]&&i(`initialization.${M}`,"名称或学科编码与课程字典不一致")}else{const M=c(m.grade,"initialization.grade"),D=c(m.subject,"initialization.subject"),_=C.grades.filter(H=>H.label===M);_.length>1&&i("initialization.grade","同名年级不唯一,请使用 gradeCode");const I=_[0],B=I?C.gradeCourseMap[I.value].filter(H=>H.label===D):[];B.length>1&&i("initialization.subject","同名课程不唯一,请使用 courseCode"),r&&(!I||!B.length)&&i(I?"initialization.subject":"initialization.grade","名称不在可用字典中,请使用年级和课程编码"),b=I&&B.length?bi(C,I.value,B[0].value):{grade:M,subject:D}}l(m.mode,"initialization.mode",["template","exam"]),l(m.createMode,"initialization.createMode",["MANUALLY","IMPORTED","THIRD"]);const x={};for(const M of["id","exampaperId"])if(m[M]!==void 0){const D=m[M];typeof D=="string"?x[M]=c(D,`initialization.${M}`):typeof D=="number"&&Number.isSafeInteger(D)&&D>=0?x[M]=D:i(`initialization.${M}`,"ID 必须是非空字符串或非负安全整数")}m.createMode!==void 0&&(x.createMode=m.createMode);const v=m.layout===void 0?{}:a(m.layout,"initialization.layout",["usage","preset","margin","gap","questionCard","scanMarking","halfPoint","choiceDirection","mergeObjective","pageNum","quesCard","scoreType","choiceType","mixOb"]),S=(M,D,_)=>{v[M]!==void 0&&(v[D]!==void 0&&v[D]!==_&&i(`initialization.layout.${M}`,`与 ${D} 设置冲突`),v[D]=_,delete v[M])};v.pageNum!==void 0&&![1,2,3].includes(v.pageNum)&&i("initialization.layout.pageNum","分栏数为 1、2 或 3"),S("pageNum","preset",{1:"a4",2:"a3-two",3:"a3-three"}[v.pageNum]);for(const[M,D]of[["quesCard","questionCard"],["scoreType","halfPoint"],["mixOb","mergeObjective"],["choiceType","choiceDirection"]])u(v[M],`initialization.layout.${M}`),S(M,D,M==="choiceType"?v[M]?"column":"row":v[M]);l(v.preset,"initialization.layout.preset",["a4","a3-two","a3-three"]),l(v.usage,"initialization.layout.usage",["exam","homework"]),l(v.choiceDirection,"initialization.layout.choiceDirection",["row","column"]),d(v.margin,"initialization.layout.margin",0,100),d(v.gap,"initialization.layout.gap",0,100);for(const M of["questionCard","scanMarking","halfPoint","mergeObjective"])u(v[M],`initialization.layout.${M}`);const w=m.header===void 0?{}:a(m.header,"initialization.header",["focusText","writeKaohao","missExam","mifeng","kaohao","weishu","tiaomaStyle","classText"]);for(const M of["focusText","writeKaohao","missExam","mifeng","classText"])u(w[M],`initialization.header.${M}`);w.tiaomaStyle!==void 0&&![1,2].includes(w.tiaomaStyle)&&i("initialization.header.tiaomaStyle","考号版式为 1(填涂)或 2(条形码)"),l(w.kaohao,"initialization.header.kaohao",["school","code"]),d(w.weishu,"initialization.header.weishu",4,12),w.weishu!==void 0&&!Number.isInteger(w.weishu)&&i("initialization.header.weishu","考号位数必须是整数");const T=bu({name:p,...b,...x,mode:m.mode??"template"}),j=m.recognition===void 0?void 0:a(m.recognition,"initialization.recognition",["examQrCode","subjectMarkers","pointBlack"]);if(j)for(const M of["examQrCode","subjectMarkers","pointBlack"])u(j[M],`initialization.recognition.${M}`);const R={...T,...v,header:{...T.header,...w},...j?{recognition:j}:{}},O=xu(R);return(O.columnWidth<100||O.contentHeight<100)&&i("initialization.layout","边距或栏间距过大,纸张没有足够的作答区域"),R}function XS(t,r){if(typeof document>"u")throw new Error("请在浏览器挂载后创建制卡实例");const i=qs(r?.plugins||[]),a=Au(r.dictionaries),c=typeof t=="string"?document.querySelector(t):t;if(!(c instanceof HTMLElement)||c.ownerDocument!==document||/^(INPUT|TEXTAREA|SELECT|BUTTON|IMG|CANVAS|IFRAME)$/.test(c.tagName))throw new Error("制卡需要一个空的 HTML 容器,例如 div");if(document.querySelector("[data-uni-answer-sheet-mount], #uni-answer-sheet"))throw new Error("当前文档已挂载制卡工作区;切换容器前请先 destroy()");if(c.textContent?.trim()||c.children.length)throw new Error("请提供空容器,已有题卡请通过 initialValue 传入");const l=document.createElement("div");l.className="uni-answer-sheet-host",l.dataset.uniAnswerSheetMount="",l.style.height="100%",c.append(l);let u=!1,d={...r,dictionaries:a},m,p,C;const g=new Promise((S,w)=>{p=S,C=w});g.catch(()=>{});const b=()=>{if(u)throw new Error("制卡实例已销毁");if(!m?.isReady())throw new Error("请先等待 sheet.ready");return m},x=async()=>(await g,b()),v={ready:g,async initialize(S){if(u)throw new Error("制卡实例已销毁");const w=YS(S,d.dictionaries);m||(d={...d,initialValue:w}),await(await x()).setDocument(w)},getDocument:()=>b().getDocument(),load:async S=>(await x()).setDocument(S),setDocument:async S=>(await x()).setDocument(S),newDocument:async S=>(await x()).newDocument(S),getReferenceData:()=>b().getReferenceData(),setReferenceData:async S=>(await x()).setReferenceData(S),validate:async()=>(await x()).validate(),save:async()=>(await x()).save(),getRecognitionData:async()=>(await x()).getRecognitionData(),focusIssue:S=>b().focusIssue(S),setOptions(S){if(u)throw new Error("制卡实例已销毁");const w=Object.hasOwn(S,"dictionaries")?Au(S.dictionaries):d.dictionaries;d={...d,...S,dictionaries:w},m?.update(d)},destroy(){u||(u=!0,m?.destroy(),l.remove(),C(new DOMException("制卡实例已销毁","AbortError")))}};return Promise.all([i.prepare(),Promise.resolve().then(()=>xO)]).then(([,{mountAnswerSheet:S}])=>{u||(m=S(l,i,d,p,w=>{C(w),v.destroy(),d.onError?.(w instanceof Error?w:new Error(String(w)))}))}).catch(S=>{C(S),v.destroy(),d.onError?.(S instanceof Error?S:new Error(String(S)))}),v}function Pm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ru={exports:{}},Oi={};/**
|
|
1
|
+
var OM=Object.defineProperty;var Z1=rt=>{throw TypeError(rt)};var MM=(rt,dt,zt)=>dt in rt?OM(rt,dt,{enumerable:!0,configurable:!0,writable:!0,value:zt}):rt[dt]=zt;var pm=(rt,dt,zt)=>MM(rt,typeof dt!="symbol"?dt+"":dt,zt),W1=(rt,dt,zt)=>dt.has(rt)||Z1("Cannot "+zt);var Gt=(rt,dt,zt)=>(W1(rt,dt,"read from private field"),zt?zt.call(rt):dt.get(rt)),J1=(rt,dt,zt)=>dt.has(rt)?Z1("Cannot add the same private member more than once"):dt instanceof WeakSet?dt.add(rt):dt.set(rt,zt),gm=(rt,dt,zt,qs)=>(W1(rt,dt,"write to private field"),qs?qs.call(rt,zt):dt.set(rt,zt),zt);var UniAnswerSheet=(function(rt){"use strict";var gt,hn;function dt(t,r){for(var i=0;i<r.length;i++){const a=r[i];if(typeof a!="string"&&!Array.isArray(a)){for(const c in a)if(c!=="default"&&!(c in t)){const l=Object.getOwnPropertyDescriptor(a,c);l&&Object.defineProperty(t,c,l.get?l:{enumerable:!0,get:()=>a[c]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const zt=["pagination","content-identity","choice-fill","answer-regions","html-codec","status"];function qs(t){const r=t.filter(a=>a?.kind==="answer-sheet-editor");if(r.length!==1)throw new Error("请显式注册一个富文本插件:plugins: [createEditorPlugin()]");const i=r[0];if(i.apiVersion!==1||i.documentVersion!==1||zt.some(a=>!i.capabilities?.includes(a))||typeof i.prepare!="function"||typeof i.create!="function"||typeof i.validateDocument!="function"||typeof i.html?.parse!="function"||typeof i.html?.serialize!="function")throw new Error("富文本插件协议不兼容,需要支持制卡协议 v1 的 uni-editor/plugin");return i}function Ys(t){const r=[],i=a=>{if(a.type==="choiceGroup"){typeof a.attrs?.id=="string"&&r.push({id:a.attrs.id,label:a.attrs.label||String(r.length+1),options:(a.content||[]).map((c,l)=>({id:c.attrs?.id,label:String.fromCharCode(65+l)})).filter(c=>typeof c.id=="string")});return}a.content?.forEach(i)};return i(t.content),r}class au extends Error{constructor(r,i){super(i),this.path=r}}const Kn=(t,r)=>{throw new au(t,r)},Xs={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",科学:"SCIENCE",物理:"PHYSICAL",化学:"CHEMICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",历史:"HISTORY",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",信息科技:"IT",信息技术:"IT",日语:"JAPANESE"},eS={P:["语文","数学","英语","科学","道德与法治"],J:["语文","数学","英语","物理","化学","生物","地理","历史","道德与法治","信息科技"],S:["语文","数学","英语","物理","化学","生物","政治","历史","地理","信息技术","日语"]},tS=["一年级","二年级","三年级","四年级","五年级","六年级","初一","初二","初三","高一","高二","高三"].map((t,r)=>{const i=r<6?"P":r<9?"J":"S";return{label:t,value:`${i}0${r<6?r+1:(r-6)%3+1}`,classify:i}}),aa=(t,r)=>typeof t=="string"&&t.trim()?t.trim():Kn(r,"字典编码和名称必须是非空字符串"),Ks=(t,r)=>t&&typeof t=="object"&&!Array.isArray(t)?t:Kn(r,"字典必须是对象"),ym=t=>t.classify||(/^[PJS]/.test(t.value)?t.value[0]:void 0);function iu(t={}){const r=Ks(t,"dictionaries"),i=(v,S)=>{if(!Array.isArray(v))return Kn(S,"字典选项必须是数组");const w=new Set;return v.map((T,j)=>{const N=Ks(T,`${S}.${j}`),M=aa(N.value,`${S}.${j}.value`),D=aa(N.label,`${S}.${j}.label`);return w.has(M)&&Kn(`${S}.${j}.value`,"字典编码重复"),w.add(M),{...N,value:M,label:D}})},a=i(r.grades===void 0?tS:r.grades,"dictionaries.grades").map((v,S)=>(v.classify!==void 0&&!["P","J","S"].includes(String(v.classify))&&Kn(`dictionaries.grades.${S}.classify`,"学段为 P、J 或 S"),{value:v.value,label:v.label,classify:v.classify})),c=r.gradeCourseMap===void 0?void 0:Ks(r.gradeCourseMap,"dictionaries.gradeCourseMap"),l=r.courseCodeToSubjectCode===void 0?{}:Ks(r.courseCodeToSubjectCode,"dictionaries.courseCodeToSubjectCode");for(const[v,S]of Object.entries(l))aa(S,`dictionaries.courseCodeToSubjectCode.${v}`);const u=new Map,d=Object.fromEntries(a.map(v=>{const S=ym(v),w=(S?eS[S]:[]).map(N=>({value:Xs[N],label:N,subjectCode:Xs[N]})),T=`dictionaries.gradeCourseMap.${v.value}`,j=i(c?c[v.value]??[]:w,T).map((N,M)=>{const D=l[N.value];N.subjectCode!==void 0&&D!==void 0&&N.subjectCode!==D&&Kn(`${T}.${M}.subjectCode`,"课程对应的学科编码冲突");const O=aa(N.subjectCode??D??(Object.values(Xs).includes(N.value)?N.value:void 0),`${T}.${M}.subjectCode`);return u.has(N.value)&&u.get(N.value)!==O&&Kn(`${T}.${M}.subjectCode`,"同一课程不能对应不同学科"),u.set(N.value,O),N.custom!==void 0&&typeof N.custom!="boolean"&&Kn(`${T}.${M}.custom`,"custom 必须是布尔值"),{value:N.value,label:N.label,subjectCode:O,...N.custom===void 0?{}:{custom:N.custom}}});return[v.value,j]})),m=a.filter(v=>d[v.value].length),p=r.defaultGradeCode===void 0?void 0:aa(r.defaultGradeCode,"dictionaries.defaultGradeCode"),C=m.find(v=>v.value===p)?.value||m[0]?.value||"",g=r.defaultCourseCode===void 0?void 0:aa(r.defaultCourseCode,"dictionaries.defaultCourseCode"),x=d[C]||[],b=x.find(v=>v.value===g)?.value||x[0]?.value||"";return{grades:m,gradeCourseMap:d,defaultGradeCode:C,defaultCourseCode:b}}function xi(t,r,i){const a=t.grades.find(l=>l.value===r);if(!a)return Kn("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:ym(a)}:Kn("initialization.courseCode","当前年级没有此课程")}function xm(t,r={}){const a=t.grades.find(u=>u.value===r.gradeCode||!r.gradeCode&&u.label===r.grade)?.value||t.defaultGradeCode,c=t.gradeCourseMap[a]||[],l=c.find(u=>u.value===r.courseCode||!r.courseCode&&u.label===r.subject)?.value||(a===t.defaultGradeCode?t.defaultCourseCode:c[0]?.value)||"";return a&&l?xi(t,a,l):{grade:"",subject:"",gradeCode:"",courseCode:""}}function bm(t){return t?.subjectCode||Xs[t?.subject||""]}const wn={questions:200,options:12,score:15},nS=t=>t.multiple?t.indefinite?"indefinite":"multiple":"single",Fn=t=>Number.isFinite(t)&&Number.isInteger(t*2),bi=t=>!!(bm(t)==="MATHS"&&(t?.phaseCode?t.phaseCode==="S":t?.gradeCode?t.gradeCode.startsWith("S"):/^高[一二三]/.test(t?.grade||"")));function rS(t){const r=typeof t.score=="number"&&Fn(t.score)&&t.score>=.5&&t.score<=wn.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&&Fn(t.lessScore??0)?Math.max(0,Math.min(r,t.lessScore??0)):0,correctIds:t.multiple?i:i.slice(0,1)}}function su(t,r,i){let a={...t};if(r.kind!==void 0){const c=r.kind!=="single";c&&!t.multiple&&(a.scoreType=bi(i)?"ITEM_SCORE":"LESS_SCORE",typeof a.score!="number"&&bi(i)&&(a.score=6)),a.multiple=c,a.indefinite=r.kind==="indefinite"}if(r.optionCount!==void 0){const c=Math.max(2,Math.min(wn.options,Math.round(r.optionCount)));a.options=Array.from({length:c},(l,u)=>t.options[u]||{id:crypto.randomUUID(),label:String.fromCharCode(65+u)})}return r.score!==void 0&&(a.score=r.score),r.scoreType!==void 0&&(a.scoreType=r.scoreType),r.lessScore!==void 0&&(a.lessScore=r.lessScore),rS(a)}function lu(t){return typeof t.score=="number"&&(!Fn(t.score)||t.score<.5||t.score>wn.score)?"每题分值须为 0.5–15 分,按 0.5 分递增":t.multiple&&t.scoreType==="LESS_SCORE"&&typeof t.score=="number"&&(!Fn(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&&!Fn(t.score/t.correctIds.length)?"答案个数与分值不匹配,每个正确选项的得分须为 0.5 的倍数":null}function oS(t){return t.multiple&&t.scoreType==="ITEM_SCORE"&&typeof t.score=="number"&&t.correctIds.length&&!lu(t)?t.score/t.correctIds.length:null}function cu(t){const r=t.map(c=>Number(c.label)).filter(c=>Number.isSafeInteger(c)&&c>0&&c<1e5);let i=String(Math.max(0,...r)+1);const a=new Set(t.map(c=>c.label));for(;a.has(i);)i=String(Number(i)+1);return i}function aS(t,r){const i=new Map(t.options.map(a=>[a.id,crypto.randomUUID()]));return{...t,id:crypto.randomUUID(),label:r,breakBefore:!1,contentTarget:null,options:t.options.map(a=>({...a,id:i.get(a.id)})),correctIds:t.correctIds.map(a=>i.get(a)).filter(Boolean)}}function vm(t,r,i){return i.trim()?t.some(a=>a.id!==r&&a.label.trim()===i.trim())?"题组内题号不能重复":null:"题号不能为空"}function iS(t,r,i,a){const c=t.questions.filter(m=>r.includes(m.id));if(!c.length)return{error:"请选择要修改的题目"};let l;if(i.type==="settings"){if(!Object.keys(i.patch).length)return{error:"请设置需要修改的属性"};const{optionCount:m,score:p,lessScore:C}=i.patch;if(m!==void 0&&(!Number.isInteger(m)||m<2||m>wn.options))return{error:"选项个数须为 2–12 的整数"};if(typeof p=="number"&&(!Fn(p)||p<.5||p>wn.score))return{error:"每题分值须为 0.5–15 分,按 0.5 分递增"};if(C!==void 0&&(!Fn(C)||C<0))return{error:"少选得分须为非负的 0.5 倍数"};if(l=c.map(g=>su(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(!Fn(m)||m<.5||m>wn.score)return{error:"总分无法平均分配,每题须为 0.5–15 分且为 0.5 的倍数"};l=c.map(p=>su(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(b=>!C.options.some(v=>v.label===b))))return{error:`第 ${C.label} 题包含无效或重复选项`};const x=g==="-"?[]:[...g].map(b=>C.options.find(v=>v.label===b).id);if(!C.multiple&&x.length>1)return{error:`第 ${C.label} 题为单选,只能设置一个答案`};l.push({...C,correctIds:x})}}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=vm(d,m.id,m.label)||lu(m);if(p)return{error:`第 ${m.label} 题:${p}`}}return{value:{...t,questions:d}}}const sS={layout:"natural",columns:2,indent:!1,rowGap:0,columnGap:32,marker:"letter"},uu=t=>`question:${t}`,du=t=>t.presentation==="stem"?"stem":["option","distributed"].includes(t.presentation)?"option":"concentrated";function fu(t,r,i){const a=Ys(r),c=new Map,l=(d,m)=>{const p=d.attrs?.contentId||m;d.type==="choiceGroup"&&p&&c.set(d.attrs.id,p),d.content?.forEach(C=>l(C,p))};l(r.content);const u=new Set(t.questions.map(d=>d.contentTarget?.groupId));return{...t,presentation:i,questions:t.questions.map((d,m)=>{const p=a.find(C=>c.get(C.id)===d.id)||(c.size?void 0:a[m]);return i==="concentrated"||d.contentTarget!==void 0||!p||u.has(p.id)?d:(u.add(p.id),{...d,contentTarget:{groupId:p.id,optionIds:p.options.map(C=>C.id)}})})}}function ia(t,r,i){const a=du(t),c=new Map(Ys(r).map(x=>[x.id,x])),l=new Set,u=new Map,d=new Map,m=(x,b)=>{const v=x.attrs?.contentId||b;x.type==="choiceGroup"&&v&&(u.set(v,[...u.get(v)||[],x.attrs.id]),d.set(x.attrs.id,v)),x.type==="choiceStemAnchor"&&typeof x.attrs?.groupId=="string"&&l.add(x.attrs.groupId),x.content?.forEach(S=>m(S,v))};m(r.content);const p=[],C=new Set,g=t.questions.filter(x=>{if(!i||a==="concentrated")return!0;if(a==="stem"&&l.has(uu(x.id)))return p.push({groupId:uu(x.id),questionId:x.id,options:x.options.map(j=>({...j,contentOptionId:j.id}))}),!1;const b=u.get(x.id),v=b?.length===1?c.get(b[0]):void 0,S=v?{groupId:v.id,optionIds:v.options.map(j=>j.id)}:x.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)!==x.id)return!0;const T=S.optionIds.slice(0,x.options.length);return T.length!==x.options.length||new Set(T).size!==T.length||T.some(j=>!w.options.some(N=>N.id===j))?!0:(C.add(w.id),p.push({groupId:w.id,questionId:x.id,options:x.options.map((j,N)=>({...j,contentOptionId:T[N]}))}),!1)});return{position:a==="concentrated"?void 0:a,bindings:p,concentrated:{...t,questions:g}}}function sa(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 hu(t=8){return{source:"manual",presentation:"concentrated",direction:"row",rowsPerColumn:5,marker:"box",rowGap:0,columnGap:0,questions:Array.from({length:t},(r,i)=>sa(i))}}function mu(t){return new Set(t.questions.map(r=>r.options.length)).size>1?"column":t.direction}function lS(t){const r=[];for(const i of t.questions){const a=r.at(-1);(!a||a.length>=t.rowsPerColumn||i.breakBefore||a[0].options.length!==i.options.length)&&r.push([]),r[r.length-1].push(i)}return r}function cS(t){const r=[];for(const i of lS(t))(!r.length||i[0].breakBefore)&&r.push([]),r[r.length-1].push(i);return r}const uS={judge:"判断题",fill:"填空题",answer:"解答题",calculation:"计算/证明",matching:"信息匹配/连线",ordering:"排序/分类",correction:"改错题",drawing:"作图题",table:"表格填答",writing:"语文作文",english:"外语写作",reading:"阅读理解",cloze:"完形填空",completion:"语法填空",chunk:"断句题",composite:"材料/复合题",optional:"选做题组",practice:"实践评价"},dS={choice:"选择",judge:"判断",fill:"填空",answer:"简答",calculation:"计算/证明",correction:"改错",drawing:"作图",table:"表格",writing:"作文",english:"外语写作"},Sm=["reading","cloze","completion","composite","optional"],Vt=()=>({version:1,content:{type:"doc",content:[{type:"paragraph"}]}}),Cm={symbols:["√","×"],letters:["T","F"],words:["正确","错误"]},Fs=t=>["writing","english"].includes(t)?70:["answer","calculation","drawing","table","correction"].includes(t)?60:15,wm=t=>t==="judge"?200:t==="fill"?50:["reading","cloze","completion"].includes(t)?20:t==="matching"?9:100;function Em(t=0){return{id:crypto.randomUUID(),label:String(t+1),width:50,style:"line",characters:6,score:null,answers:[],prefix:"",suffix:"",breakAfter:!1}}function pu(t,r="1"){const i=crypto.randomUUID();return{id:i,label:r,kind:t,document:Vt(),reference:Vt(),explanation:Vt(),score:null,choice:{...sa(0,t==="judge"?2:4),id:i,label:r},presentation:"concentrated",blanks:[Em()],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 gu(t){return["reading","cloze","chunk"].includes(t)?"choice":["matching","completion"].includes(t)?"fill":["ordering","composite","optional","practice"].includes(t)?"answer":t}function fS(t){return{items:[pu(gu(t))],judgeLabels:"symbols",fillNewLine:!0,pool:[],relation:"one",reuseOptions:!0,matchingDisplay:"letters",ordering:"sequence",sequence:[],categories:[],assignments:{},chooseCount:1,groupScore:null,chunkText:"",chunkPoints:[],chunkCorrect:[],chunkMax:3,chunkScore:null,attachmentUrl:""}}function Ur(t){return String(Math.max(0,...t.map(r=>/^\d+$/.test(r.label)?Number(r.label):0))+1)}function jo(t){const r=structuredClone(t),i=new Map,a=l=>{!l||typeof l!="object"||Object.entries(l).forEach(([u,d])=>{["id","answerId"].includes(u)&&typeof d=="string"?i.set(d,crypto.randomUUID()):a(d)})};a(r);const c=l=>typeof l=="string"?i.get(l)||l:Array.isArray(l)?l.map(c):l&&typeof l=="object"?Object.fromEntries(Object.entries(l).map(([u,d])=>[i.get(u)||u,c(d)])):l;return c(r)}function hS(t,r){const i=jo(t);return{...i,label:r,choice:{...i.choice,label:r}}}function la(t,r,i){const a=t.findIndex(u=>u.id===r),c=a+i;if(a<0||c<0||c>=t.length)return t;const l=[...t];return l.splice(c,0,...l.splice(a,1)),l}function mS(t,r){return{...t,pool:t.pool.filter(i=>i.id!==r),sequence:t.sequence.filter(i=>i!==r),assignments:Object.fromEntries(Object.entries(t.assignments).filter(([i])=>i!==r)),items:t.items.map(i=>({...i,targets:i.targets.filter(a=>a!==r)}))}}function pS(t,r,i){const a=[...new Set(i)].filter(l=>t.pool.some(u=>u.id===l)),c=t.relation==="one"?a.slice(-1):a;return{...t,items:t.items.map(l=>l.id===r?{...l,targets:c}:t.reuseOptions?l:{...l,targets:l.targets.filter(u=>!c.includes(u))})}}function gS(t,r){let i=0;for(;i<r.length&&i<t.chunkText.length&&r[i]===t.chunkText[i];)i++;let a=0;for(;a<r.length-i&&a<t.chunkText.length-i&&r[r.length-1-a]===t.chunkText[t.chunkText.length-1-a];)a++;const c=t.chunkText.length-a,l=new Set,u=t.chunkPoints.filter(d=>d.offset<=i||d.offset>=c).map(d=>({...d,offset:d.offset<=i?d.offset:d.offset+r.length-t.chunkText.length})).filter(d=>d.offset<=0||d.offset>=r.length||l.has(d.offset)?!1:(l.add(d.offset),!0));return{...t,chunkText:r,chunkPoints:u,chunkCorrect:t.chunkCorrect.filter(d=>u.some(m=>m.id===d))}}function yS(t,r){const i=[],a=t.items.map(c=>c.label.trim());(a.some(c=>!c)||new Set(a).size!==a.length)&&i.push("题号不能为空或重复");for(const c of t.items){c.score!==null&&(!Number.isFinite(c.score)||c.score<.5||c.score>Fs(c.kind)||!Number.isInteger(c.score*2))&&i.push(`${c.label} 题分值超出范围或不是 0.5 的倍数`);const u=(c.kind==="fill"?c.blanks:c.steps).map(d=>d.score);u.length&&c.score!==null&&u.every(d=>d!==null)&&u.reduce((d,m)=>d+(m||0),0)!==c.score&&i.push(`${c.label} 题分项分值之和与题分不一致`)}if(["matching","ordering"].includes(r)){const c=t.pool.map(l=>l.label.trim());(c.some(l=>!l)||new Set(c).size!==c.length)&&i.push("共享选项编号不能为空或重复")}return r==="optional"&&t.chooseCount>t.items.length&&i.push("选做数量不能超过题目数量"),r==="chunk"&&t.chunkCorrect.length>t.chunkMax&&i.push("正确断点数不能超过最多选择数"),i}function xS(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 En(t){const r=i=>!!(i.text||i.type&&!["doc","paragraph","choiceStemAnchor"].includes(i.type)||i.content?.some(r));return!r(t.content)}const Tm={choice:"选择题",area:"空白区域",...uS};function bS(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 jm(){return{version:1,title:"",questionCard:!1,duplex:!1,preset:"a3-two",margin:15,gap:10,blocks:[]}}function vS(t=""){return{id:crypto.randomUUID(),height:70,document:{version:1,content:{type:"doc",content:[{type:"paragraph",attrs:{textAlign:"center",lineSpacing:9},...t?{content:[{type:"text",text:t,marks:[{type:"textStyle",attrs:{fontFamily:"SimSun, 宋体, serif",fontSize:"22px"}}]}]}:{}}]}}}}function yu(t){return{...jm(),title:t.name,creation:t,paperTitle:vS(t.name),header:{focusText:!0,writeKaohao:!1,missExam:!1,mifeng:!1,kaohao:"school",weishu:8}}}function Ao(t,r=96){return t*r/25.4}const vi={a4:{label:"A4 单栏",width:210,height:297,columns:1},"a3-two":{label:"A3 双栏",width:420,height:297,columns:2},"a3-three":{label:"A3 三栏",width:420,height:297,columns:3}},$r=44,Si=16,Am=t=>t.duplex===!0?2:1;function xu(t,r){const i=vi[t.preset],a=Ao(i.width),c=Ao(i.height),l=Ao(t.margin),u=Ao(t.gap),d=t.usage!=="homework"&&t.header?.mifeng?Ao(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),x=c-C-g,b=x-Si,v=t.header?p:m,S=r&&r.id===t.paperTitle?.id&&Math.abs(r.width-v)<1?r:void 0,w=t.paperTitle?Math.min(x,S?.height??t.paperTitle.height+(t.header?260:Si)):0,T=(D,O=0)=>!!t.paperTitle&&(t.header?D%2===0&&O===0:D===0),j=(D,O=0)=>T(D,O)?w:0;return{...i,width:a,height:c,margin:l,topInset:C,bottomInset:g,gap:u,sealWidth:d,contentWidth:m,contentHeight:x,columnWidth:p,columnX:(D,O)=>l+(D%2===0?d:0)+O*(p+u),titleWidth:v,titleMaxHeight:b,hasHeader:T,headerHeight:j,capacity:(D,O=0)=>x-j(D,O)}}function SS(t,r,i){const a=xu(t,i),c=Am(t);let l=0,u=0,d=0;const m=()=>{u++,u===a.columns&&(u=0,l++),d=0},p=t.blocks.map(g=>{const x=r[g.id],b=x&&Math.abs(x.width-a.columnWidth)<1?x.height:100+g.answerHeight,v=x&&Math.abs(x.width-a.columnWidth)<1?[...new Set([...x.breaks||[],b].filter(D=>Number.isFinite(D)&&D>0&&D<=b))].sort((D,O)=>D-O):[],S=g.reference?.type==="CCOMPOSITION",w=D=>S&&D>0?Math.max(0,6-Math.max(0,(x?.compositionStart||0)-D)):0;if(v.length>1&&v.every((D,O)=>{const _=v[O-1]||0;return D-_+w(_)<=a.capacity(1)+.5})){const D=[];let O=0;for(;O<b-.5;){const k=a.capacity(l,u)-d,L=O,B=w(O),z=$=>x?.markingFrames?.some(ee=>ee.from>=L-.5&&ee.from<$-.5&&ee.to>$+.5)?22:0,U=v.filter($=>$>L+.5&&$+z($)<=L+k-B+.5).at(-1);if(U===void 0){m();continue}const K=S&&U<b-.5?Math.max(z(U),k-B-(U-O)):z(U);D.push({page:l,column:u,x:a.columnX(l,u),y:l*(a.height+$r)+a.topInset+a.headerHeight(l,u)+d,from:O,to:U,...B?{topPadding:B}:{},...K?{bottomPadding:K}:{}}),d+=U-O+B,O=U,O<b-.5&&m()}d+=Si;const _=D[0];return{id:g.id,..._,height:b,available:a.capacity(_.page,_.column),overflowing:!1,fragments:D}}for(;d+b>a.capacity(l,u)+.5&&(d>0||a.headerHeight(l,u)>0);)m();const j=a.capacity(l,u),N=b>j+.5,M={id:g.id,page:l,column:u,x:a.columnX(l,u),y:l*(a.height+$r)+a.topInset+a.headerHeight(l,u)+d,height:b,available:j,overflowing:N,fragments:[{page:l,column:u,x:a.columnX(l,u),y:l*(a.height+$r)+a.topInset+a.headerHeight(l,u)+d,from:0,to:Math.min(b,j)}]};return d+=Math.min(b,j)+Si,M}),C=new Map;p.forEach((g,x)=>g.fragments.forEach(b=>{const v=`${b.page}/${b.column}`,S=C.get(v)||[];S.push({fragment:b,placement:g,blockIndex:x}),C.set(v,S)})),C.forEach(g=>{const x=g.filter(w=>["answer","writing","english","composite","area"].includes(t.blocks[w.blockIndex].kind)).at(-1);if(!x||t.blocks[x.blockIndex].reference?.type!=="CCOMPOSITION"&&t.blocks[x.blockIndex].kind!=="area")return;const b=g.at(-1).fragment,S=b.page*(a.height+$r)+a.height-a.bottomInset-b.y-(b.to-b.from)-(b.topPadding||0)-(b.bottomPadding||0);S<=0||S>30||(x.fragment.bottomPadding=(x.fragment.bottomPadding||0)+S,g.slice(g.indexOf(x)+1).forEach(({fragment:w,placement:T})=>{w.y+=S,T.fragments[0]===w&&(T.y=w.y)}))});for(const g of p)(g.overflowing||g.fragments.some(x=>x.page>=c))&&(g.overflowFrom=g.fragments.filter(x=>x.page<c).at(-1)?.to||0);return{geometry:a,placements:p,pageCount:Math.min(c,l+1),requiredPageCount:l+1}}function Ci(t,r){return{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:`${t}.`,marks:[{type:"documentLabel",attrs:{kind:"number"}}]},...r?[{type:"text",text:`(${r}分)`,marks:[{type:"documentLabel",attrs:{kind:"score"}}]}]:[]]}]}}}function Tn(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(x=>x.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 ur={SCHOICE:"单选题",MCHOICE:"多选题",JUDGE:"判断题",FILLBLANK:"填空题",SHORTANSWER:"解答题",MIXED:"复合题",CLOZE:"完形填空",READTHENANSWER:"阅读理解",INFO_MATCHING:"信息匹配",TEXT_COMPLETION:"语法填空",ECOMPOSITION:"英语作文",CCOMPOSITION:"语文作文",CHUNK_CHOICE:"断句题"},Rm=["SCHOICE","MCHOICE","JUDGE","FILLBLANK","SHORTANSWER","MIXED"];function Nm(t,r=!1){const i=bm(t),a=r?Rm.filter(c=>c!=="MIXED"):Rm;return r?["CHINESE","JAPANESE"].includes(i||"")?[...a,"CHUNK_CHOICE"]:a:i==="CHINESE"?[...a,"CCOMPOSITION","CHUNK_CHOICE"]:i==="ENGLISH"?[...a,"CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION","ECOMPOSITION"]:i==="JAPANESE"?Object.keys(ur):["POLITICAL","HISTORY"].includes(i||"")?[...a,"CCOMPOSITION"]:a}const CS=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),wS=t=>["SCHOICE","MCHOICE","CLOZE","READTHENANSWER","INFO_MATCHING","JUDGE"].includes(t),Gr=t=>({version:1,content:{type:"doc",content:t.length?t:[{type:"paragraph"}]}});function wi(t,r,i=!1){return{content:Vt(),numbered:!i,groupId:`options:${r.id}`,layout:{...sS,columns:t==="CLOZE"?4:2,...t==="READTHENANSWER"?{layout:"fixed",columnGap:0}:{}},itemsContent:!i&&wS(t)?r.options.map(a=>({id:a.id,key:a.label,content:Vt()})):[]}}const Qs=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(Qs).filter(a=>a!==null)}:{}}};function Zs(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 Om(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:Gr(c.map(Qs).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:Gr((d.content||[]).map(Qs).filter(p=>p!==null))}))}}function Mm(t,r,i,a){const c=new Map;r.content.content?.forEach(d=>{d.attrs?.contentId&&c.set(d.attrs.contentId,[...c.get(d.attrs.contentId)||[],d])});const l=new Set(a?.content.content?.map(d=>d.attrs?.contentId).filter(Boolean)),u=(d,m)=>m&&(c.has(d)||l.has(d))?Om(m,c.get(d)||[]):m;return{...t,...c.has(i)?{material:Gr(c.get(i).map(d=>Qs(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 bu(t){const r=t.reference,i=[];r.type==="MIXED"&&i.push(...(r.material||Vt()).content.content.map(c=>({...c,attrs:{...c.attrs,contentId:t.id}}))),r.questions.forEach(c=>{c.text&&i.push(...Zs(c.text,c.id,c.label)),CS(c.type)&&c.parts.forEach(l=>{l.text&&i.push(...Zs(l.text,l.id,l.label))})});const a=(t.document.content.content||[]).filter(c=>!c.attrs?.contentId);return En(Gr(a))||i.push(...a),Gr(i)}function ES(t,r){const i=(a,c,l)=>!a||!l||c.options.map(u=>u.id).join()===l.options.map(u=>u.id).join()?a:{...a,itemsContent:c.options.map(u=>({...a.itemsContent.find(d=>d.id===u.id),id:u.id,key:u.label,content:a.itemsContent.find(d=>d.id===u.id)?.content||Vt()}))};return{...t,questions:t.questions.map(a=>{const c=r.questions.find(l=>l.id===a.id);return{...a,text:i(a.text,a.choice,c?.choice),parts:a.parts.map(l=>({...l,text:i(l.text,l.choice,c?.parts.find(u=>u.id===l.id)?.choice)}))}})}}function TS(t,r,i){if(t.reference?.textVersion!==1)return t;let a=t.reference;if(!r&&!En(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&&!En(t.document))return t;if(t.document!==r?.document&&(!En(t.document)||r)&&(a=Mm(a,t.document,t.id,r?.document),r&&t.reference===r.reference))return{...t,reference:a};r?.reference&&t.reference!==r.reference&&(a=ES(a,r.reference));const c={...t,reference:a};return i||!En(t.document)?{...c,document:bu(c)}:c}const ca={SCHOICE:{count:200,options:[2,12],parts:1,score:15},MCHOICE:{count:200,options:[2,12],parts:1,score:15},JUDGE:{count:200,options:[2,2],parts:1,score:15},CHUNK_CHOICE:{count:100,options:[2,26],parts:1,score:10},FILLBLANK:{count:50,options:[0,0],parts:20,score:15},SHORTANSWER:{count:100,options:[0,0],parts:10,score:60},CLOZE:{count:20,options:[4,4],parts:20,score:15},READTHENANSWER:{count:20,options:[2,12],parts:20,score:15},INFO_MATCHING:{count:20,options:[1,9],parts:9,score:15},TEXT_COMPLETION:{count:20,options:[0,0],parts:20,score:15},CCOMPOSITION:{count:1,options:[0,0],parts:1,score:70},ECOMPOSITION:{count:1,options:[0,0],parts:1,score:70}},Et=t=>["SCHOICE","MCHOICE","JUDGE","CHUNK_CHOICE","CLOZE","READTHENANSWER","INFO_MATCHING"].includes(t),Be=t=>["CLOZE","READTHENANSWER","INFO_MATCHING","TEXT_COMPLETION"].includes(t),Ei=t=>t==="FILLBLANK"||t==="TEXT_COMPLETION",Ti=t=>t==="CCOMPOSITION"||t==="ECOMPOSITION",jS={SCHOICE:"choice",MCHOICE:"choice",JUDGE:"judge",FILLBLANK:"fill",SHORTANSWER:"answer",MIXED:"composite",CLOZE:"cloze",READTHENANSWER:"reading",INFO_MATCHING:"matching",TEXT_COMPLETION:"completion",ECOMPOSITION:"english",CCOMPOSITION:"writing",CHUNK_CHOICE:"chunk"};function vu(t){return{type:t,textVersion:1,questions:[],layout:hu(0),fillNewLine:!1,optional:!1,choose:1,optionalHeight:200,scoreType:"LESS_SCORE"}}function _m(t){return{id:crypto.randomUUID(),kind:jS[t],title:ur[t],answerHeight:0,document:Vt(),reference:vu(t)}}function Su(t,r=1,i){const a=t==="MCHOICE"&&bi(i);return{type:t,start:r,end:r,optionCount:t==="INFO_MATCHING"?null:t==="CHUNK_CHOICE"?12:t==="JUDGE"?2:4,partCount:Be(t)?null:1,score:a?6:null,scoreType:a?"ITEM_SCORE":"LESS_SCORE",lessScore:0,characters:1e3,lines:10,rightAnswers:null,singleScore:1}}function ua(t,r,i){const a=Array.from({length:i},(c,l)=>({...t.options[l]||{id:crypto.randomUUID()},label:r==="JUDGE"?["T","F"][l]:String.fromCharCode(65+l)}));return{...t,options:a,multiple:r==="MCHOICE"||r==="CHUNK_CHOICE",indefinite:!1,correctIds:t.correctIds.filter(c=>a.some(l=>l.id===c)).slice(0,r==="MCHOICE"||r==="CHUNK_CHOICE"?i:1)}}function ji(t,r,i,a=4){const c=crypto.randomUUID(),l={...ua(sa(0),i,a),id:c,label:t,score:r};return{id:c,label:t,score:r,width:25,breakAfter:!1,height:100,document:i==="SHORTANSWER"?Ci(t,r):Vt(),choice:l,...Be(i)&&i!=="TEXT_COMPLETION"?{text:wi(i,l)}:{}}}function Cu(t,r){const i=crypto.randomUUID(),{type:a,score:c}=t,l=String(r),u=t.partCount||1,d=Array.from({length:Be(a)||["FILLBLANK","SHORTANSWER"].includes(a)?u:0},(p,C)=>ji(Be(a)?String(r+C):u===1?l:`${l}.${C+1}`,c,a,t.optionCount||4)),m={...ua(sa(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?Qn(d):c,choice:m,text:wi(a,m,Be(a)),parts:d,document:a==="ECOMPOSITION"?{version:1,content:{type:"doc",content:[...Ci(l,c).content.content,...MS(t.lines,t.paperWidth||600).content.content]}}:a==="CCOMPOSITION"?Ci(l,c):Vt(),height:a==="ECOMPOSITION"?50*t.lines+40:100,contentHeight:38,characters:t.characters,lines:t.lines,halfPoint:!1,rightAnswers:t.rightAnswers,singleScore:t.singleScore}}const Qn=t=>t.some(r=>r.score===null)?null:t.reduce((r,i)=>r+(i.score||0),0);function wu(t){return t.questions.flatMap(r=>Be(r.type)?r.parts.map(i=>i.label):[r.label])}function Ws(t){return Math.max(0,...wu(t).map(Number).filter(Number.isFinite))+1}function AS(t,r,i=!1,a=!1){const c=ca[r.type],l=Ti(r.type)?1:r.end-r.start+1;if(!Number.isInteger(r.start)||r.start<1||r.end>1e3||!Number.isInteger(l)||l<1||l>c.count)return`题号须为 1–1000,单次题数为 1–${c.count}`;if(t.type==="CCOMPOSITION"&&t.questions.length)return"语文作文每组只能有一道题";if(t.optional)return"选做题组不能追加题目";const u=wu(t);if(Array.from({length:l},(d,m)=>String(r.start+m)).some(d=>u.includes(d)))return"同一分组内,题号不能重复";if(Et(r.type)&&(r.optionCount===null||!Number.isInteger(r.optionCount)||r.optionCount<c.options[0]||r.optionCount>c.options[1]))return`选项个数须为 ${c.options[0]}–${c.options[1]}`;if((Be(r.type)||["FILLBLANK","SHORTANSWER"].includes(r.type))&&(!r.partCount||!Number.isInteger(r.partCount)||r.partCount<1||r.partCount>c.parts))return`子题/空数须为 1–${c.parts}`;if(Be(r.type)&&l%r.partCount!==0)return"题目数量无法按子题数量均分,请重新设置";if(r.type==="INFO_MATCHING"&&r.partCount>r.optionCount)return"选项个数需大于等于子题数量";if(r.type==="SHORTANSWER"&&(i||t.optional)&&r.partCount!==1)return"网阅或选做题不支持小题";if(r.score!==null&&(!Number.isFinite(r.score)||r.score<(a?0:.5)||r.score>c.score||!Number.isInteger(r.score*2)))return`分值须为 ${a?0:.5}–${c.score} 分,按 0.5 分递增`;if(r.type==="MCHOICE"&&(r.lessScore<0||!Number.isInteger(r.lessScore*2)||r.lessScore>(r.score||0)))return"少选得分不能超过本题分值";if(r.type==="CHUNK_CHOICE"){if(!r.rightAnswers||!Number.isInteger(r.rightAnswers)||r.rightAnswers>=r.optionCount)return"正确答案个数需小于选项个数";if(r.singleScore===null||r.singleScore<.5||!Number.isInteger(r.singleScore*2)||r.score!==null&&r.score!==0&&r.singleScore*r.rightAnswers>r.score)return"每处得分乘以正确答案个数不可大于每题分数"}return r.type==="CCOMPOSITION"&&(!Number.isInteger(r.characters)||r.characters<1||r.characters>1200)?"作文格数须为 1–1200":r.type==="ECOMPOSITION"&&(!Number.isInteger(r.lines)||r.lines<1||r.lines>100)?"作文行数须为 1–100":r.score===null?"请输入分值":null}function RS(t,r,i){const a=Be(r.type)?r.partCount:1,c=[];for(let d=r.start;d<=(Ti(r.type)?r.start:r.end);d+=a)c.push(Cu(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 Js(t){return t.questions.flatMap(r=>[r,...r.parts])}function da(t){return t.questions.filter(r=>Et(r.type)).flatMap(r=>Be(r.type)?r.parts.map(i=>({...i.choice,label:i.label,score:i.score})):[{...r.choice,label:r.label,score:r.score}])}function NS(t,r){const i=jo(t);return i.referenceData&&(i.referenceData={...i.referenceData,questionId:i.id}),i.text&&(i.text.groupId=`options:${i.id}`),i.label=String(r),i.choice.label=i.label,i.choice.contentTarget=null,i.choice.breakBefore=!1,i.parts.forEach((a,c)=>{a.label=Be(i.type)?String(r+c):i.parts.length===1?i.label:`${r}.${c+1}`,a.choice.label=a.label,a.choice.contentTarget=null,a.choice.breakBefore=!1}),i.parts.forEach(a=>{a.text&&(a.text.groupId=`options:${a.id}`),a.referenceData&&(a.referenceData={...a.referenceData,questionId:a.id,questionPid:i.id})}),i.document=Tn(i.document,i.label,i.score),i.parts=i.parts.map(a=>({...a,document:Tn(a.document,a.label,a.score)})),i}function OS(t){return Math.max(1,Math.floor((t-6)/31))}function MS(t,r){return{version:1,content:{type:"doc",content:Array.from({length:t},()=>({type:"paragraph",attrs:{fixedLineHeight:45.35433070866142},content:[{type:"text",text:" ".repeat(Math.max(1,Math.floor((r-24)/3))),marks:[{type:"underline"},{type:"textStyle",attrs:{fontFamily:"Times New Roman, serif",fontSize:"12px"}}]}]}))}}}function _S(t,r,i=!1){const a=t.questions.reduce((l,u)=>l+(u.parts.length||1),0),c=r/a;return!a||!Number.isFinite(c)||c<(i?0:.5)||!Number.isInteger(c*2)||t.questions.some(l=>c>ca[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:Tn(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:Tn(u.document,u.label,c),choice:{...u.choice,score:c}}))}))}}function DS(t,r){return[...t<=17?Array.from({length:18},(i,a)=>17-a<=t?String(17-a):""):[...Array.from({length:7},(i,a)=>7-a<=Math.floor(t/10)?`${7-a}0`:""),"",...Array.from({length:10},(i,a)=>String(9-a))],r?"0.5":""]}const IS=["000","100","110","111","101","010","011","001"],kS=t=>IS[t-1],Eu={CHINESE:[1],MATHS:[2],ENGLISH:[3],PHYSICAL:[4],CHEMICAL:[1,2],POLITICAL:[1,3],BIOLOGICAL:[1,4],GEOGRAPHIC:[2,3],JAPANESE:[2,4],IT:[3,4],GYM:[1,2,3],MUSIC:[1,2,4],ART:[1,3,4],SCIENCE:[2,3,4],HISTORY:[1,2,3,4]},LS={语文:"CHINESE",数学:"MATHS",英语:"ENGLISH",物理:"PHYSICAL",化学:"CHEMICAL",政治:"POLITICAL",思想政治:"POLITICAL",道德与法治:"POLITICAL",生物:"BIOLOGICAL",地理:"GEOGRAPHIC",日语:"JAPANESE",信息科技:"IT",信息技术:"IT",体育:"GYM",音乐:"MUSIC",美术:"ART",科学:"SCIENCE",历史:"HISTORY"};function Dm(t){return t?.subjectCode||(t?.courseCode&&Eu[t.courseCode]?t.courseCode:LS[t?.subject||""])}const Zn=t=>Math.round(t*1e3)/1e3,Im=t=>({x:Zn(t.x),y:Zn(t.y),width:Zn(t.width),height:Zn(t.height)});function km(t,r){const i=Math.max(t.x,r.x),a=Math.max(t.y,r.y),c=Math.min(t.x+t.width,r.x+r.width)-i,l=Math.min(t.y+t.height,r.y+r.height)-a;return c>.01&&l>.01?{x:i,y:a,width:c,height:l}:void 0}const fa=function(t,r){let c=t;const l=Ai[r];let u=null,d=0,m=null;const p=[],C={},g=function(_,k){d=c*4+17,u=(function(L){const B=new Array(L);for(let z=0;z<L;z+=1){B[z]=new Array(L);for(let U=0;U<L;U+=1)B[z][U]=null}return B})(d),x(0,0),x(d-7,0),x(0,d-7),S(),v(),T(_,k),c>=7&&w(_),m==null&&(m=M(c,l,p)),j(m,k)},x=function(_,k){for(let L=-1;L<=7;L+=1)if(!(_+L<=-1||d<=_+L))for(let B=-1;B<=7;B+=1)k+B<=-1||d<=k+B||(0<=L&&L<=6&&(B==0||B==6)||0<=B&&B<=6&&(L==0||L==6)||2<=L&&L<=4&&2<=B&&B<=4?u[_+L][k+B]=!0:u[_+L][k+B]=!1)},b=function(){let _=0,k=0;for(let L=0;L<8;L+=1){g(!0,L);const B=qr.getLostPoint(C);(L==0||_>B)&&(_=B,k=L)}return k},v=function(){for(let _=8;_<d-8;_+=1)u[_][6]==null&&(u[_][6]=_%2==0);for(let _=8;_<d-8;_+=1)u[6][_]==null&&(u[6][_]=_%2==0)},S=function(){const _=qr.getPatternPosition(c);for(let k=0;k<_.length;k+=1)for(let L=0;L<_.length;L+=1){const B=_[k],z=_[L];if(u[B][z]==null)for(let U=-2;U<=2;U+=1)for(let K=-2;K<=2;K+=1)U==-2||U==2||K==-2||K==2||U==0&&K==0?u[B+U][z+K]=!0:u[B+U][z+K]=!1}},w=function(_){const k=qr.getBCHTypeNumber(c);for(let L=0;L<18;L+=1){const B=!_&&(k>>L&1)==1;u[Math.floor(L/3)][L%3+d-8-3]=B}for(let L=0;L<18;L+=1){const B=!_&&(k>>L&1)==1;u[L%3+d-8-3][Math.floor(L/3)]=B}},T=function(_,k){const L=l<<3|k,B=qr.getBCHTypeInfo(L);for(let z=0;z<15;z+=1){const U=!_&&(B>>z&1)==1;z<6?u[z][8]=U:z<8?u[z+1][8]=U:u[d-15+z][8]=U}for(let z=0;z<15;z+=1){const U=!_&&(B>>z&1)==1;z<8?u[8][d-z-1]=U:z<9?u[8][15-z-1+1]=U:u[8][15-z-1]=U}u[d-8][8]=!_},j=function(_,k){let L=-1,B=d-1,z=7,U=0;const K=qr.getMaskFunction(k);for(let $=d-1;$>0;$-=2)for($==6&&($-=1);;){for(let ee=0;ee<2;ee+=1)if(u[B][$-ee]==null){let G=!1;U<_.length&&(G=(_[U]>>>z&1)==1),K(B,$-ee)&&(G=!G),u[B][$-ee]=G,z-=1,z==-1&&(U+=1,z=7)}if(B+=L,B<0||d<=B){B-=L,L=-L;break}}},N=function(_,k){let L=0,B=0,z=0;const U=new Array(k.length),K=new Array(k.length);for(let q=0;q<k.length;q+=1){const H=k[q].dataCount,P=k[q].totalCount-H;B=Math.max(B,H),z=Math.max(z,P),U[q]=new Array(H);for(let Z=0;Z<U[q].length;Z+=1)U[q][Z]=255&_.getBuffer()[Z+L];L+=H;const A=qr.getErrorCorrectPolynomial(P),F=Ri(U[q],A.getLength()-1).mod(A);K[q]=new Array(A.getLength()-1);for(let Z=0;Z<K[q].length;Z+=1){const le=Z+F.getLength()-K[q].length;K[q][Z]=le>=0?F.getAt(le):0}}let $=0;for(let q=0;q<k.length;q+=1)$+=k[q].totalCount;const ee=new Array($);let G=0;for(let q=0;q<B;q+=1)for(let H=0;H<k.length;H+=1)q<U[H].length&&(ee[G]=U[H][q],G+=1);for(let q=0;q<z;q+=1)for(let H=0;H<k.length;H+=1)q<K[H].length&&(ee[G]=K[H][q],G+=1);return ee},M=function(_,k,L){const B=Lm.getRSBlocks(_,k),z=zm();for(let K=0;K<L.length;K+=1){const $=L[K];z.put($.getMode(),4),z.put($.getLength(),qr.getLengthInBits($.getMode(),_)),$.write(z)}let U=0;for(let K=0;K<B.length;K+=1)U+=B[K].dataCount;if(z.getLengthInBits()>U*8)throw"code length overflow. ("+z.getLengthInBits()+">"+U*8+")";for(z.getLengthInBits()+4<=U*8&&z.put(0,4);z.getLengthInBits()%8!=0;)z.putBit(!1);for(;!(z.getLengthInBits()>=U*8||(z.put(236,8),z.getLengthInBits()>=U*8));)z.put(17,8);return N(z,B)};C.addData=function(_,k){k=k||"Byte";let L=null;switch(k){case"Numeric":L=zS(_);break;case"Alphanumeric":L=BS(_);break;case"Byte":L=HS(_);break;case"Kanji":L=PS(_);break;default:throw"mode:"+k}p.push(L),m=null},C.isDark=function(_,k){if(_<0||d<=_||k<0||d<=k)throw _+","+k;return u[_][k]},C.getModuleCount=function(){return d},C.make=function(){if(c<1){let _=1;for(;_<40;_++){const k=Lm.getRSBlocks(_,l),L=zm();for(let z=0;z<p.length;z++){const U=p[z];L.put(U.getMode(),4),L.put(U.getLength(),qr.getLengthInBits(U.getMode(),_)),U.write(L)}let B=0;for(let z=0;z<k.length;z++)B+=k[z].dataCount;if(L.getLengthInBits()<=B*8)break}c=_}g(!1,b())},C.createTableTag=function(_,k){_=_||2,k=typeof k>"u"?_*4:k;let L="";L+='<table style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: "+k+"px;",L+='">',L+="<tbody>";for(let B=0;B<C.getModuleCount();B+=1){L+="<tr>";for(let z=0;z<C.getModuleCount();z+=1)L+='<td style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: 0px;",L+=" width: "+_+"px;",L+=" height: "+_+"px;",L+=" background-color: ",L+=C.isDark(B,z)?"#000000":"#ffffff",L+=";",L+='"/>';L+="</tr>"}return L+="</tbody>",L+="</table>",L},C.createSvgTag=function(_,k,L,B){let z={};typeof arguments[0]=="object"&&(z=arguments[0],_=z.cellSize,k=z.margin,L=z.alt,B=z.title),_=_||2,k=typeof k>"u"?_*4:k,L=typeof L=="string"?{text:L}:L||{},L.text=L.text||null,L.id=L.text?L.id||"qrcode-description":null,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-title":null;const U=C.getModuleCount()*_+k*2;let K,$,ee,G,q="",H;for(H="l"+_+",0 0,"+_+" -"+_+",0 0,-"+_+"z ",q+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',q+=z.scalable?"":' width="'+U+'px" height="'+U+'px"',q+=' viewBox="0 0 '+U+" "+U+'" ',q+=' preserveAspectRatio="xMinYMin meet"',q+=B.text||L.text?' role="img" aria-labelledby="'+D([B.id,L.id].join(" ").trim())+'"':"",q+=">",q+=B.text?'<title id="'+D(B.id)+'">'+D(B.text)+"</title>":"",q+=L.text?'<description id="'+D(L.id)+'">'+D(L.text)+"</description>":"",q+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',q+='<path d="',ee=0;ee<C.getModuleCount();ee+=1)for(G=ee*_+k,K=0;K<C.getModuleCount();K+=1)C.isDark(ee,K)&&($=K*_+k,q+="M"+$+","+G+H);return q+='" stroke="transparent" fill="black"/>',q+="</svg>",q},C.createDataURL=function(_,k){_=_||2,k=typeof k>"u"?_*4:k;const L=C.getModuleCount()*_+k*2,B=k,z=L-k;return VS(L,L,function(U,K){if(B<=U&&U<z&&B<=K&&K<z){const $=Math.floor((U-B)/_),ee=Math.floor((K-B)/_);return C.isDark(ee,$)?0:1}else return 1})},C.createImgTag=function(_,k,L){_=_||2,k=typeof k>"u"?_*4:k;const B=C.getModuleCount()*_+k*2;let z="";return z+="<img",z+=' src="',z+=C.createDataURL(_,k),z+='"',z+=' width="',z+=B,z+='"',z+=' height="',z+=B,z+='"',L&&(z+=' alt="',z+=D(L),z+='"'),z+="/>",z};const D=function(_){let k="";for(let L=0;L<_.length;L+=1){const B=_.charAt(L);switch(B){case"<":k+="<";break;case">":k+=">";break;case"&":k+="&";break;case'"':k+=""";break;default:k+=B;break}}return k},O=function(_){_=typeof _>"u"?2:_;const L=C.getModuleCount()*1+_*2,B=_,z=L-_;let U,K,$,ee,G;const q={"██":"█","█ ":"▀"," █":"▄"," ":" "},H={"██":"▀","█ ":"▀"," █":" "," ":" "};let P="";for(U=0;U<L;U+=2){for($=Math.floor((U-B)/1),ee=Math.floor((U+1-B)/1),K=0;K<L;K+=1)G="█",B<=K&&K<z&&B<=U&&U<z&&C.isDark($,Math.floor((K-B)/1))&&(G=" "),B<=K&&K<z&&B<=U+1&&U+1<z&&C.isDark(ee,Math.floor((K-B)/1))?G+=" ":G+="█",P+=_<1&&U+1>=z?H[G]:q[G];P+=`
|
|
2
|
+
`}return L%2&&_>0?P.substring(0,P.length-L-1)+Array(L+1).join("▀"):P.substring(0,P.length-1)};return C.createASCII=function(_,k){if(_=_||1,_<2)return O(k);_-=1,k=typeof k>"u"?_*2:k;const L=C.getModuleCount()*_+k*2,B=k,z=L-k;let U,K,$,ee;const G=Array(_+1).join("██"),q=Array(_+1).join(" ");let H="",P="";for(U=0;U<L;U+=1){for($=Math.floor((U-B)/_),P="",K=0;K<L;K+=1)ee=1,B<=K&&K<z&&B<=U&&U<z&&C.isDark($,Math.floor((K-B)/_))&&(ee=0),P+=ee?G:q;for($=0;$<_;$+=1)H+=P+`
|
|
3
|
+
`}return H.substring(0,H.length-1)},C.renderTo2dContext=function(_,k){k=k||2;const L=C.getModuleCount();for(let B=0;B<L;B++)for(let z=0;z<L;z++)_.fillStyle=C.isDark(B,z)?"black":"white",_.fillRect(z*k,B*k,k,k)},C};fa.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},fa.createStringToBytes=function(t,r){const i=(function(){const c=$S(t),l=function(){const m=c.read();if(m==-1)throw"eof";return m};let u=0;const d={};for(;;){const m=c.read();if(m==-1)break;const p=l(),C=l(),g=l(),x=String.fromCharCode(m<<8|p),b=C<<8|g;d[x]=b,u+=1}if(u!=r)throw u+" != "+r;return d})(),a=63;return function(c){const l=[];for(let u=0;u<c.length;u+=1){const d=c.charCodeAt(u);if(d<128)l.push(d);else{const m=i[c.charAt(u)];typeof m=="number"?(m&255)==m?l.push(m):(l.push(m>>>8),l.push(m&255)):l.push(a)}}return l}};const qt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ai={L:1,M:0,Q:3,H:2},Vr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},qr=(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 Vr.PATTERN000:return function(d,m){return(d+m)%2==0};case Vr.PATTERN001:return function(d,m){return d%2==0};case Vr.PATTERN010:return function(d,m){return m%3==0};case Vr.PATTERN011:return function(d,m){return(d+m)%3==0};case Vr.PATTERN100:return function(d,m){return(Math.floor(d/2)+Math.floor(m/3))%2==0};case Vr.PATTERN101:return function(d,m){return d*m%2+d*m%3==0};case Vr.PATTERN110:return function(d,m){return(d*m%2+d*m%3)%2==0};case Vr.PATTERN111:return function(d,m){return(d*m%3+(d+m)%2)%2==0};default:throw"bad maskPattern:"+u}},c.getErrorCorrectPolynomial=function(u){let d=Ri([1],0);for(let m=0;m<u;m+=1)d=d.multiply(Ri([1,Yr.gexp(m)],0));return d},c.getLengthInBits=function(u,d){if(1<=d&&d<10)switch(u){case qt.MODE_NUMBER:return 10;case qt.MODE_ALPHA_NUM:return 9;case qt.MODE_8BIT_BYTE:return 8;case qt.MODE_KANJI:return 8;default:throw"mode:"+u}else if(d<27)switch(u){case qt.MODE_NUMBER:return 12;case qt.MODE_ALPHA_NUM:return 11;case qt.MODE_8BIT_BYTE:return 16;case qt.MODE_KANJI:return 10;default:throw"mode:"+u}else if(d<41)switch(u){case qt.MODE_NUMBER:return 14;case qt.MODE_ALPHA_NUM:return 13;case qt.MODE_8BIT_BYTE:return 16;case qt.MODE_KANJI:return 12;default:throw"mode:"+u}else throw"type:"+d},c.getLostPoint=function(u){const d=u.getModuleCount();let m=0;for(let g=0;g<d;g+=1)for(let x=0;x<d;x+=1){let b=0;const v=u.isDark(g,x);for(let S=-1;S<=1;S+=1)if(!(g+S<0||d<=g+S))for(let w=-1;w<=1;w+=1)x+w<0||d<=x+w||S==0&&w==0||v==u.isDark(g+S,x+w)&&(b+=1);b>5&&(m+=3+b-5)}for(let g=0;g<d-1;g+=1)for(let x=0;x<d-1;x+=1){let b=0;u.isDark(g,x)&&(b+=1),u.isDark(g+1,x)&&(b+=1),u.isDark(g,x+1)&&(b+=1),u.isDark(g+1,x+1)&&(b+=1),(b==0||b==4)&&(m+=3)}for(let g=0;g<d;g+=1)for(let x=0;x<d-6;x+=1)u.isDark(g,x)&&!u.isDark(g,x+1)&&u.isDark(g,x+2)&&u.isDark(g,x+3)&&u.isDark(g,x+4)&&!u.isDark(g,x+5)&&u.isDark(g,x+6)&&(m+=40);for(let g=0;g<d;g+=1)for(let x=0;x<d-6;x+=1)u.isDark(x,g)&&!u.isDark(x+1,g)&&u.isDark(x+2,g)&&u.isDark(x+3,g)&&u.isDark(x+4,g)&&!u.isDark(x+5,g)&&u.isDark(x+6,g)&&(m+=40);let p=0;for(let g=0;g<d;g+=1)for(let x=0;x<d;x+=1)u.isDark(x,g)&&(p+=1);const C=Math.abs(100*p/d/d-50)/5;return m+=C*10,m},c})(),Yr=(function(){const t=new Array(256),r=new Array(256);for(let a=0;a<8;a+=1)t[a]=1<<a;for(let a=8;a<256;a+=1)t[a]=t[a-4]^t[a-5]^t[a-6]^t[a-8];for(let a=0;a<255;a+=1)r[t[a]]=a;const i={};return i.glog=function(a){if(a<1)throw"glog("+a+")";return r[a]},i.gexp=function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return t[a]},i})(),Ri=function(t,r){if(typeof t.length>"u")throw t.length+"/"+r;const i=(function(){let c=0;for(;c<t.length&&t[c]==0;)c+=1;const l=new Array(t.length-c+r);for(let u=0;u<t.length-c;u+=1)l[u]=t[u+c];return l})(),a={};return a.getAt=function(c){return i[c]},a.getLength=function(){return i.length},a.multiply=function(c){const l=new Array(a.getLength()+c.getLength()-1);for(let u=0;u<a.getLength();u+=1)for(let d=0;d<c.getLength();d+=1)l[u+d]^=Yr.gexp(Yr.glog(a.getAt(u))+Yr.glog(c.getAt(d)));return Ri(l,0)},a.mod=function(c){if(a.getLength()-c.getLength()<0)return a;const l=Yr.glog(a.getAt(0))-Yr.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]^=Yr.gexp(Yr.glog(c.getAt(d))+l);return Ri(u,0).mod(c)},a},Lm=(function(){const t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(c,l){const u={};return u.totalCount=c,u.dataCount=l,u},i={},a=function(c,l){switch(l){case Ai.L:return t[(c-1)*4+0];case Ai.M:return t[(c-1)*4+1];case Ai.Q:return t[(c-1)*4+2];case Ai.H:return t[(c-1)*4+3];default:return}};return i.getRSBlocks=function(c,l){const u=a(c,l);if(typeof u>"u")throw"bad rs block @ typeNumber:"+c+"/errorCorrectionLevel:"+l;const d=u.length/3,m=[];for(let p=0;p<d;p+=1){const C=u[p*3+0],g=u[p*3+1],x=u[p*3+2];for(let b=0;b<C;b+=1)m.push(r(g,x))}return m},i})(),zm=function(){const t=[];let r=0;const i={};return i.getBuffer=function(){return t},i.getAt=function(a){const c=Math.floor(a/8);return(t[c]>>>7-a%8&1)==1},i.put=function(a,c){for(let l=0;l<c;l+=1)i.putBit((a>>>c-l-1&1)==1)},i.getLengthInBits=function(){return r},i.putBit=function(a){const c=Math.floor(r/8);t.length<=c&&t.push(0),a&&(t[c]|=128>>>r%8),r+=1},i},zS=function(t){const r=qt.MODE_NUMBER,i=t,a={};a.getMode=function(){return r},a.getLength=function(u){return i.length},a.write=function(u){const d=i;let m=0;for(;m+2<d.length;)u.put(c(d.substring(m,m+3)),10),m+=3;m<d.length&&(d.length-m==1?u.put(c(d.substring(m,m+1)),4):d.length-m==2&&u.put(c(d.substring(m,m+2)),7))};const c=function(u){let d=0;for(let m=0;m<u.length;m+=1)d=d*10+l(u.charAt(m));return d},l=function(u){if("0"<=u&&u<="9")return u.charCodeAt(0)-48;throw"illegal char :"+u};return a},BS=function(t){const r=qt.MODE_ALPHA_NUM,i=t,a={};a.getMode=function(){return r},a.getLength=function(l){return i.length},a.write=function(l){const u=i;let d=0;for(;d+1<u.length;)l.put(c(u.charAt(d))*45+c(u.charAt(d+1)),11),d+=2;d<u.length&&l.put(c(u.charAt(d)),6)};const c=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return a},HS=function(t){const r=qt.MODE_8BIT_BYTE,i=fa.stringToBytes(t),a={};return a.getMode=function(){return r},a.getLength=function(c){return i.length},a.write=function(c){for(let l=0;l<i.length;l+=1)c.put(i[l],8)},a},PS=function(t){const r=qt.MODE_KANJI,i=fa.stringToBytes;(function(l,u){const d=i(l);if(d.length!=2||(d[0]<<8|d[1])!=u)throw"sjis not supported."})("友",38726);const a=i(t),c={};return c.getMode=function(){return r},c.getLength=function(l){return~~(a.length/2)},c.write=function(l){const u=a;let d=0;for(;d+1<u.length;){let m=(255&u[d])<<8|255&u[d+1];if(33088<=m&&m<=40956)m-=33088;else if(57408<=m&&m<=60351)m-=49472;else throw"illegal char at "+(d+1)+"/"+m;m=(m>>>8&255)*192+(m&255),l.put(m,13),d+=2}if(d<u.length)throw"illegal char at "+(d+1)},c},Bm=function(){const t=[],r={};return r.writeByte=function(i){t.push(i&255)},r.writeShort=function(i){r.writeByte(i),r.writeByte(i>>>8)},r.writeBytes=function(i,a,c){a=a||0,c=c||i.length;for(let l=0;l<c;l+=1)r.writeByte(i[l+a])},r.writeString=function(i){for(let a=0;a<i.length;a+=1)r.writeByte(i.charCodeAt(a))},r.toByteArray=function(){return t},r.toString=function(){let i="";i+="[";for(let a=0;a<t.length;a+=1)a>0&&(i+=","),i+=t[a];return i+="]",i},r},US=function(){let t=0,r=0,i=0,a="";const c={},l=function(d){a+=String.fromCharCode(u(d&63))},u=function(d){if(d<0)throw"n:"+d;if(d<26)return 65+d;if(d<52)return 97+(d-26);if(d<62)return 48+(d-52);if(d==62)return 43;if(d==63)return 47;throw"n:"+d};return c.writeByte=function(d){for(t=t<<8|d&255,r+=8,i+=1;r>=6;)l(t>>>r-6),r-=6},c.flush=function(){if(r>0&&(l(t<<6-r),t=0,r=0),i%3!=0){const d=3-i%3;for(let m=0;m<d;m+=1)a+="="}},c.toString=function(){return a},c},$S=function(t){const r=t;let i=0,a=0,c=0;const l={};l.read=function(){for(;c<8;){if(i>=r.length){if(c==0)return-1;throw"unexpected end of file./"+c}const m=r.charAt(i);if(i+=1,m=="=")return c=0,-1;if(m.match(/^\s$/))continue;a=a<<6|u(m.charCodeAt(0)),c+=6}const d=a>>>c-8&255;return c-=8,d};const u=function(d){if(65<=d&&d<=90)return d-65;if(97<=d&&d<=122)return d-97+26;if(48<=d&&d<=57)return d-48+52;if(d==43)return 62;if(d==47)return 63;throw"c:"+d};return l},GS=function(t,r){const i=t,a=r,c=new Array(t*r),l={};l.setPixel=function(p,C,g){c[C*i+p]=g},l.write=function(p){p.writeString("GIF87a"),p.writeShort(i),p.writeShort(a),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(","),p.writeShort(0),p.writeShort(0),p.writeShort(i),p.writeShort(a),p.writeByte(0);const C=2,g=d(C);p.writeByte(C);let x=0;for(;g.length-x>255;)p.writeByte(255),p.writeBytes(g,x,255),x+=255;p.writeByte(g.length-x),p.writeBytes(g,x,g.length-x),p.writeByte(0),p.writeString(";")};const u=function(p){const C=p;let g=0,x=0;const b={};return b.write=function(v,S){if(v>>>S)throw"length over";for(;g+S>=8;)C.writeByte(255&(v<<g|x)),S-=8-g,v>>>=8-g,x=0,g=0;x=v<<g|x,g=g+S},b.flush=function(){g>0&&C.writeByte(x)},b},d=function(p){const C=1<<p,g=(1<<p)+1;let x=p+1;const b=m();for(let j=0;j<C;j+=1)b.add(String.fromCharCode(j));b.add(String.fromCharCode(C)),b.add(String.fromCharCode(g));const v=Bm(),S=u(v);S.write(C,x);let w=0,T=String.fromCharCode(c[w]);for(w+=1;w<c.length;){const j=String.fromCharCode(c[w]);w+=1,b.contains(T+j)?T=T+j:(S.write(b.indexOf(T),x),b.size()<4095&&(b.size()==1<<x&&(x+=1),b.add(T+j)),T=j)}return S.write(b.indexOf(T),x),S.write(g,x),S.flush(),v.toByteArray()},m=function(){const p={};let C=0;const g={};return g.add=function(x){if(g.contains(x))throw"dup key:"+x;p[x]=C,C+=1},g.size=function(){return C},g.indexOf=function(x){return p[x]},g.contains=function(x){return typeof p[x]<"u"},g};return l},VS=function(t,r,i){const a=GS(t,r);for(let d=0;d<r;d+=1)for(let m=0;m<t;m+=1)a.setPixel(m,d,i(m,d));const c=Bm();a.write(c);const l=US(),u=c.toByteArray();for(let d=0;d<u.length;d+=1)l.writeByte(u[d]);return l.flush(),"data:image/gif;base64,"+l};fa.stringToBytes;function Hm(t){const r=fa(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 ha extends Error{constructor(i){super(i[0]?.message||"题卡数据无效");pm(this,"issues");this.name="AnswerSheetDataError",this.issues=i}}function Tu(t,r){const i=(v,S="题卡数据结构无效")=>{throw new ha([{code:"INVALID_DATA",path:v,message:S}])},a=(v,S)=>!v||typeof v!="object"||Array.isArray(v)?i(S):v,c=(v,S)=>Array.isArray(v)?v:i(S),l=(v,S)=>{typeof v!="string"&&i(S)},u=(v,S,w=0,T=1e5)=>{(typeof v!="number"||!Number.isFinite(v)||v<w||v>T)&&i(S)},d=(v,S)=>{a(v,S);const w=r.validateDocument(v);w.length&&i(S,w[0])},m=(v,S)=>{const w=a(v,S);if(l(w.id,`${S}.id`),l(w.label,`${S}.label`),(typeof w.multiple!="boolean"||typeof w.breakBefore!="boolean")&&i(S),w.contentTarget!==void 0&&w.contentTarget!==null){const T=a(w.contentTarget,`${S}.contentTarget`);l(T.groupId,`${S}.contentTarget.groupId`),c(T.optionIds,`${S}.contentTarget.optionIds`).forEach((j,N)=>l(j,`${S}.contentTarget.optionIds.${N}`))}c(w.options,`${S}.options`).forEach((T,j)=>{const N=a(T,`${S}.options.${j}`);l(N.id,`${S}.options.${j}.id`),l(N.label,`${S}.options.${j}.label`)}),c(w.correctIds,`${S}.correctIds`).forEach((T,j)=>l(T,`${S}.correctIds.${j}`))},p=(v,S)=>{const w=a(v,S);(!["row","column"].includes(String(w.direction))||!["concentrated","distributed","stem","option"].includes(String(w.presentation))||!["box","check","bubble"].includes(String(w.marker)))&&i(S),u(w.rowsPerColumn,`${S}.rowsPerColumn`,1,5),u(w.rowGap,`${S}.rowGap`,0,64),u(w.columnGap,`${S}.columnGap`,0,64),c(w.questions,`${S}.questions`).forEach((T,j)=>m(T,`${S}.questions.${j}`))},C=new WeakSet,g=(v,S)=>{if(!(!v||typeof v!="object")){if(C.has(v))return i(S,"题卡必须是无循环引用的 JSON 数据");C.add(v),Object.entries(v).forEach(([w,T])=>g(T,`${S}.${w}`)),C.delete(v)}},x=a(t,"");if(x.version!==1&&i("version","不支持的题卡数据版本"),l(x.title,"title"),x.usage!==void 0&&!["exam","homework"].includes(String(x.usage))&&i("usage"),["questionCard","duplex","scanMarking","halfPoint","mergeObjective"].forEach(v=>{x[v]!==void 0&&typeof x[v]!="boolean"&&i(v)}),["a4","a3-two","a3-three"].includes(String(x.preset))||i("preset"),u(x.margin,"margin",0,100),u(x.gap,"gap",0,100),x.creation){const v=a(x.creation,"creation");["template","exam"].includes(String(v.mode))||i("creation.mode"),["name","grade","subject"].forEach(S=>l(v[S],`creation.${S}`));for(const S of["gradeCode","courseCode","subjectCode"])v[S]!==void 0&&(typeof v[S]!="string"||!v[S].trim())&&i(`creation.${S}`);v.phaseCode!==void 0&&!["P","J","S"].includes(String(v.phaseCode))&&i("creation.phaseCode"),v.createMode!==void 0&&!["MANUALLY","IMPORTED","THIRD"].includes(String(v.createMode))&&i("creation.createMode");for(const S of["id","exampaperId"])if(v[S]!==void 0){const w=v[S];typeof w=="string"&&w.trim()||typeof w=="number"&&Number.isSafeInteger(w)&&w>=0||i(`creation.${S}`)}}if(x.paperTitle){const v=a(x.paperTitle,"paperTitle");l(v.id,"paperTitle.id"),u(v.height,"paperTitle.height",1,1e3),d(v.document,"paperTitle.document")}if(x.header){const v=a(x.header,"header");["code","school"].includes(String(v.kaohao))||i("header.kaohao"),u(v.weishu,"header.weishu",1,20),v.tiaomaStyle!==void 0&&![1,2].includes(v.tiaomaStyle)&&i("header.tiaomaStyle"),v.classText!==void 0&&typeof v.classText!="boolean"&&i("header.classText")}if(x.recognition!==void 0){const v=a(x.recognition,"recognition");for(const S of["examQrCode","subjectMarkers","pointBlack"])v[S]!==void 0&&typeof v[S]!="boolean"&&i(`recognition.${S}`)}c(x.blocks,"blocks").forEach((v,S)=>{const w=`blocks.${S}`,T=a(v,w);if(l(T.id,`${w}.id`),l(T.title,`${w}.title`),u(T.answerHeight,`${w}.answerHeight`),d(T.document,`${w}.document`),T.kind==="area"){(!["forbiden","editArea"].includes(String(T.areaType))||T.reference||T.choices||T.exercise)&&i(`${w}.areaType`),u(T.answerHeight,`${w}.answerHeight`,100,4e3);return}if(!T.reference){if(T.choices){p(T.choices,`${w}.choices`);return}i(`${w}.reference`,"请使用包含 reference 题目结构的制卡数据")}const j=a(T.reference,`${w}.reference`);j.material!==void 0&&d(j.material,`${w}.reference.material`),j.textVersion!==void 0&&j.textVersion!==1&&i(`${w}.reference.textVersion`),Object.hasOwn(ur,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((N,M)=>{const D=`${w}.reference.questions.${M}`,O=a(N,D);Object.hasOwn(ca,String(O.type))||i(`${D}.type`),l(O.id,`${D}.id`),l(O.label,`${D}.label`),m(O.choice,`${D}.choice`),["height","contentHeight","characters","lines"].forEach(k=>u(O[k],`${D}.${k}`)),d(O.document,`${D}.document`);const _=(k,L)=>{if(!k)return;const B=a(k,L);d(B.content,`${L}.content`),a(B.layout,`${L}.layout`),l(B.groupId,`${L}.groupId`),c(B.itemsContent,`${L}.itemsContent`).forEach((z,U)=>{const K=a(z,`${L}.itemsContent.${U}`);l(K.id,`${L}.itemsContent.${U}.id`),l(K.key,`${L}.itemsContent.${U}.key`),d(K.content,`${L}.itemsContent.${U}.content`)})};_(O.text,`${D}.text`),c(O.parts,`${D}.parts`).forEach((k,L)=>{const B=`${D}.parts.${L}`,z=a(k,B);l(z.id,`${B}.id`),l(z.label,`${B}.label`),u(z.width,`${B}.width`),u(z.height,`${B}.height`),d(z.document,`${B}.document`),m(z.choice,`${B}.choice`),_(z.text,`${B}.text`)})})}),g(t,"");const b=xu(t);(b.columnWidth<100||b.contentHeight<100)&&i("margin","边距或栏间距过大,纸张没有足够的作答区域")}function el(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(el)}function qS(t,r){try{Tu(t,r)}catch(b){return{valid:!1,issues:b instanceof ha?b.issues:[{code:"INVALID_DATA",path:"",message:"题卡数据无法读取"}]}}const i=[];let a={};const c=(b,v,S)=>i.push({code:b,path:v,message:S,...a}),l=new Set,u=(b,v)=>{(!b.trim()||l.has(b))&&c("DUPLICATE_ID",v,"题块、题目和选项 ID 必须非空且唯一"),l.add(b)},d=(b,v,S)=>{(b===null||!Number.isFinite(b)||b<(t.usage==="homework"?0:.5)||b>v||!Number.isInteger(b*2))&&c("INVALID_SCORE",S,`分值须为 ${t.usage==="homework"?0:.5}–${v} 分,按 0.5 分递增`)},m=(b,v,S)=>{(b.options.length<v[0]||b.options.length>v[1])&&c("INVALID_OPTIONS",`${S}.options`,`选项个数须为 ${v[0]}–${v[1]}`),b.options.forEach((w,T)=>u(w.id,`${S}.options.${T}.id`)),(new Set(b.correctIds).size!==b.correctIds.length||b.correctIds.some(w=>!b.options.some(T=>T.id===w)))&&c("INVALID_ANSWER_REFERENCE",`${S}.correctIds`,"答案引用了不存在或重复的选项")},p=(b,v,S,w=0,T=!0)=>{T&&!el(b?.content.content)&&c("MISSING_CONTENT",`${v}.content`,"请填写题干或材料"),S&&(b?.itemsContent.length!==w||b.itemsContent.some(j=>!el(j.content.content)))&&c("MISSING_OPTION_CONTENT",`${v}.itemsContent`,"请补全每个选项的内容")};if(t.title.trim()||c("MISSING_TITLE","title","请填写题卡名称"),t.recognition?.examQrCode){const b=String(t.creation?.exampaperId??"").trim();if(!b)c("MISSING_EXAM_ID","creation.exampaperId","显示试卷二维码需要填写试卷 ID");else try{Hm(b)}catch{c("INVALID_QR_PAYLOAD","creation.exampaperId","试卷 ID 太长,无法生成二维码")}}t.header&&t.recognition?.subjectMarkers!==!1&&!Eu[Dm(t.creation)||""]&&c("UNKNOWN_SUBJECT_MARK","creation.subjectCode","当前学科没有参考识别编码,请配置标准学科或关闭学科标记"),(!t.creation?.grade.trim()||!t.creation.subject.trim())&&c("MISSING_CREATION","creation","请选择年级和学科"),(!t.paperTitle||!el(t.paperTitle.document.content))&&c("MISSING_PAPER_TITLE","paperTitle","请填写纸面标题"),t.blocks.some(b=>b.kind!=="area")||c("EMPTY_CARD","blocks","请至少添加一个题块和一道题目"),t.paperTitle&&u(t.paperTitle.id,"paperTitle.id"),t.blocks.forEach((b,v)=>{a={blockId:b.id};const S=`blocks.${v}`;if(u(b.id,`${S}.id`),b.kind==="area"){b.areaType===(t.questionCard?"forbiden":"editArea")&&c("INVALID_AREA_MODE",`${S}.areaType`,"题卡合一使用空白答题区,独立答题卡使用禁止答题区");return}b.title.trim()||c("MISSING_BLOCK_TITLE",`${S}.title`,"请填写题块标题"),b.id==="reference-merged-objective"&&c("RESERVED_ID",`${S}.id`,"题块使用了系统保留 ID");const w=b.reference;if(!w){b.choices?.questions.length||c("EMPTY_BLOCK",S,"题块中没有题目"),b.choices?.questions.forEach((j,N)=>{a={blockId:b.id,questionId:j.id},u(j.id,`${S}.choices.questions.${N}.id`),m(j,[2,12],`${S}.choices.questions.${N}`),d(j.score??null,15,`${S}.choices.questions.${N}.score`)});return}w.questions.length||c("EMPTY_BLOCK",`${S}.reference.questions`,"题块中没有题目");const T=wu(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,N)=>{a={blockId:b.id,questionId:j.id};const M=`${S}.reference.questions.${N}`,D=ca[j.type];u(j.id,`${M}.id`),w.type!=="MIXED"&&w.type!==j.type&&c("TYPE_MISMATCH",`${M}.type`,"题目类型与题块不一致"),j.choice.id!==j.id&&c("INVALID_BINDING",`${M}.choice.id`,"题目与填涂项 ID 不一致");const O=Be(j.type)||["FILLBLANK","SHORTANSWER"].includes(j.type);(O&&(j.parts.length<1||j.parts.length>D.parts)||!O&&j.parts.length)&&c("INVALID_PARTS",`${M}.parts`,`子题/空数须为 ${O?`1–${D.parts}`:"0"}`),j.parts.length?j.score!==Qn(j.parts)&&c("SCORE_MISMATCH",`${M}.score`,"总分与子题分值之和不一致"):d(j.score,D.score,`${M}.score`),Et(j.type)&&!Be(j.type)&&m(j.choice,D.options,`${M}.choice`),j.type==="INFO_MATCHING"&&(m(j.choice,D.options,`${M}.choice`),j.parts.length>j.choice.options.length&&c("INVALID_OPTIONS",`${M}.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",`${M}.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",M,"请检查正确答案个数及每处得分"),j.type==="CCOMPOSITION"&&(!Number.isInteger(j.characters)||j.characters<1||j.characters>1200)&&c("INVALID_GRID_COUNT",`${M}.characters`,"作文格数须为 1–1200"),j.type==="ECOMPOSITION"&&(!Number.isInteger(j.lines)||j.lines<1||j.lines>100)&&c("INVALID_LINE_COUNT",`${M}.lines`,"作文行数须为 1–100"),t.questionCard&&p(j.text,`${M}.text`,["SCHOICE","MCHOICE"].includes(j.type),j.choice.options.length),j.parts.forEach((_,k)=>{const L=`${M}.parts.${k}`;a={blockId:b.id,questionId:_.id},u(_.id,`${L}.id`),d(_.score,D.score,`${L}.score`),Be(j.type)&&Et(j.type)&&(m(_.choice,D.options,`${L}.choice`),_.choice.id!==_.id&&c("INVALID_BINDING",`${L}.choice.id`,"子题与填涂项 ID 不一致")),t.questionCard&&["CLOZE","READTHENANSWER"].includes(j.type)&&p(_.text,`${L}.text`,!0,_.choice.options.length,j.type==="READTHENANSWER")})}),a={blockId:b.id},t.questionCard&&w.layout.presentation!=="concentrated"){const j=w.questions.filter(M=>Et(M.type)).flatMap(M=>Be(M.type)?M.parts.map(D=>D.choice):[M.choice]);ia({...w.layout,questions:j},b.document,!0).concentrated.questions.length&&c("MISSING_FILL_TARGET",`${S}.reference.layout.presentation`,"部分填涂框没有对应的题干或选项位置")}}),a={};const C=(b,v)=>{b.type==="image"&&(!b.attrs?.src||/^blob:/i.test(b.attrs.src))&&c("INVALID_IMAGE_URL",v,"图片缺少可保存的地址,请上传后使用持久 URL 或内嵌图片"),["formula","blockFormula"].includes(b.type||"")&&!String(b.attrs?.latex||"").trim()&&c("EMPTY_FORMULA",v,"请填写公式或删除空公式"),b.content?.forEach((S,w)=>C(S,`${v}.content.${w}`))},g=(b,v)=>{b&&C(b.content,`${v}.content`)},x=(b,v)=>{g(b?.content,`${v}.content`),b?.itemsContent.forEach((S,w)=>g(S.content,`${v}.itemsContent.${w}.content`))};return g(t.paperTitle?.document,"paperTitle.document"),t.blocks.forEach((b,v)=>{a={blockId:b.id};const S=`blocks.${v}`;g(b.document,`${S}.document`),g(b.reference?.material,`${S}.reference.material`),b.reference?.questions.forEach((w,T)=>{a={blockId:b.id,questionId:w.id};const j=`blocks.${v}.reference.questions.${T}`;g(w.document,`${j}.document`),x(w.text,`${j}.text`),w.parts.forEach((N,M)=>{a={blockId:b.id,questionId:N.id},g(N.document,`${j}.parts.${M}.document`),x(N.text,`${j}.parts.${M}.text`)})})}),{valid:i.length===0,issues:i}}function ju(t){if(t!==void 0)try{const r=iu(t);return{grades:r.grades,gradeCourseMap:r.gradeCourseMap,defaultGradeCode:r.defaultGradeCode||void 0,defaultCourseCode:r.defaultCourseCode||void 0}}catch(r){throw r instanceof au?new ha([{code:"INVALID_DICTIONARIES",path:r.path,message:r.message}]):r}}function YS(t,r){const i=(D,O)=>{throw new ha([{code:"INVALID_INITIALIZATION",path:D,message:O}])},a=(D,O,_)=>{if(!D||typeof D!="object"||Array.isArray(D))return i(O,"初始化配置必须是对象");const k=Object.entries(D);for(const[L]of k)_.includes(L)||i(`${O}.${L}`,"不支持的初始化字段");return Object.fromEntries(k.filter(([,L])=>L!==void 0))},c=(D,O)=>typeof D!="string"||!D.trim()?i(O,"请提供非空的试卷名称、年级和学科"):D.trim(),l=(D,O,_)=>{D!==void 0&&!_.includes(D)&&i(O,`可选值为 ${_.join("、")}`)},u=(D,O)=>{D!==void 0&&typeof D!="boolean"&&i(O,"请使用布尔值")},d=(D,O,_,k)=>{D!==void 0&&(typeof D!="number"||!Number.isFinite(D)||D<_||D>k)&&i(O,`数值必须在 ${_}–${k} 之间`)},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=iu(ju(r)),g=m.gradeCode!==void 0||m.courseCode!==void 0||m.subjectCode!==void 0;let x;if(g){try{x=xi(C,c(m.gradeCode,"initialization.gradeCode"),c(m.courseCode,"initialization.courseCode"))}catch(D){if(D instanceof au)return i(D.path,D.message);throw D}for(const D of["grade","subject","subjectCode"])m[D]!==void 0&&c(m[D],`initialization.${D}`)!==x[D]&&i(`initialization.${D}`,"名称或学科编码与课程字典不一致")}else{const D=c(m.grade,"initialization.grade"),O=c(m.subject,"initialization.subject"),_=C.grades.filter(B=>B.label===D);_.length>1&&i("initialization.grade","同名年级不唯一,请使用 gradeCode");const k=_[0],L=k?C.gradeCourseMap[k.value].filter(B=>B.label===O):[];L.length>1&&i("initialization.subject","同名课程不唯一,请使用 courseCode"),r&&(!k||!L.length)&&i(k?"initialization.subject":"initialization.grade","名称不在可用字典中,请使用年级和课程编码"),x=k&&L.length?xi(C,k.value,L[0].value):{grade:D,subject:O}}l(m.mode,"initialization.mode",["template","exam"]),l(m.createMode,"initialization.createMode",["MANUALLY","IMPORTED","THIRD"]);const b={};for(const D of["id","exampaperId"])if(m[D]!==void 0){const O=m[D];typeof O=="string"?b[D]=c(O,`initialization.${D}`):typeof O=="number"&&Number.isSafeInteger(O)&&O>=0?b[D]=O:i(`initialization.${D}`,"ID 必须是非空字符串或非负安全整数")}m.createMode!==void 0&&(b.createMode=m.createMode);const v=m.layout===void 0?{}:a(m.layout,"initialization.layout",["usage","preset","margin","gap","questionCard","duplex","scanMarking","halfPoint","choiceDirection","mergeObjective","pageNum","quesCard","scoreType","choiceType","mixOb"]),S=(D,O,_)=>{v[D]!==void 0&&(v[O]!==void 0&&v[O]!==_&&i(`initialization.layout.${D}`,`与 ${O} 设置冲突`),v[O]=_,delete v[D])};v.pageNum!==void 0&&![1,2,3].includes(v.pageNum)&&i("initialization.layout.pageNum","分栏数为 1、2 或 3"),S("pageNum","preset",{1:"a4",2:"a3-two",3:"a3-three"}[v.pageNum]);for(const[D,O]of[["quesCard","questionCard"],["scoreType","halfPoint"],["mixOb","mergeObjective"],["choiceType","choiceDirection"]])u(v[D],`initialization.layout.${D}`),S(D,O,D==="choiceType"?v[D]?"column":"row":v[D]);l(v.preset,"initialization.layout.preset",["a4","a3-two","a3-three"]),l(v.usage,"initialization.layout.usage",["exam","homework"]),l(v.choiceDirection,"initialization.layout.choiceDirection",["row","column"]),d(v.margin,"initialization.layout.margin",0,100),d(v.gap,"initialization.layout.gap",0,100);for(const D of["questionCard","duplex","scanMarking","halfPoint","mergeObjective"])u(v[D],`initialization.layout.${D}`);const w=m.header===void 0?{}:a(m.header,"initialization.header",["focusText","writeKaohao","missExam","mifeng","kaohao","weishu","tiaomaStyle","classText"]);for(const D of["focusText","writeKaohao","missExam","mifeng","classText"])u(w[D],`initialization.header.${D}`);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=yu({name:p,...x,...b,mode:m.mode??"template"}),j=m.recognition===void 0?void 0:a(m.recognition,"initialization.recognition",["examQrCode","subjectMarkers","pointBlack"]);if(j)for(const D of["examQrCode","subjectMarkers","pointBlack"])u(j[D],`initialization.recognition.${D}`);const N={...T,...v,header:{...T.header,...w},...j?{recognition:j}:{}},M=xu(N);return(M.columnWidth<100||M.contentHeight<100)&&i("initialization.layout","边距或栏间距过大,纸张没有足够的作答区域"),N}function XS(t,r){if(typeof document>"u")throw new Error("请在浏览器挂载后创建制卡实例");const i=qs(r?.plugins||[]),a=ju(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 x=()=>{if(u)throw new Error("制卡实例已销毁");if(!m?.isReady())throw new Error("请先等待 sheet.ready");return m},b=async()=>(await g,x()),v={ready:g,async initialize(S){if(u)throw new Error("制卡实例已销毁");const w=YS(S,d.dictionaries);m||(d={...d,initialValue:w}),await(await b()).setDocument(w)},getDocument:()=>x().getDocument(),load:async S=>(await b()).setDocument(S),setDocument:async S=>(await b()).setDocument(S),newDocument:async S=>(await b()).newDocument(S),getReferenceData:()=>x().getReferenceData(),setReferenceData:async S=>(await b()).setReferenceData(S),validate:async()=>(await b()).validate(),save:async()=>(await b()).save(),getRecognitionData:async()=>(await b()).getRecognitionData(),focusIssue:S=>x().focusIssue(S),setOptions(S){if(u)throw new Error("制卡实例已销毁");const w=Object.hasOwn(S,"dictionaries")?ju(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(()=>bN)]).then(([,{mountAnswerSheet:S}])=>{u||(m=S(l,i,d,p,w=>{C(w),v.destroy(),d.onError?.(w instanceof Error?w:new Error(String(w)))}))}).catch(S=>{C(S),v.destroy(),d.onError?.(S instanceof Error?S:new Error(String(S)))}),v}function Pm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Au={exports:{}},Ni={};/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
6
6
|
*
|
|
@@ -8,7 +8,7 @@ var NM=Object.defineProperty;var Z1=nt=>{throw TypeError(nt)};var MM=(nt,dt,Lt)=
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var Um;function KS(){if(Um)return
|
|
11
|
+
*/var Um;function KS(){if(Um)return Ni;Um=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(a,c,l){var u=null;if(l!==void 0&&(u=""+l),c.key!==void 0&&(u=""+c.key),"key"in c){l={};for(var d in c)d!=="key"&&(l[d]=c[d])}else l=c;return c=l.ref,{$$typeof:t,type:a,key:u,ref:c!==void 0?c:null,props:l}}return Ni.Fragment=r,Ni.jsx=i,Ni.jsxs=i,Ni}var $m;function FS(){return $m||($m=1,Au.exports=KS()),Au.exports}var f=FS(),Ru={exports:{}},Oe={};/**
|
|
12
12
|
* @license React
|
|
13
13
|
* react.production.js
|
|
14
14
|
*
|
|
@@ -16,7 +16,7 @@ var NM=Object.defineProperty;var Z1=nt=>{throw TypeError(nt)};var MM=(nt,dt,Lt)=
|
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the MIT license found in the
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var Gm;function QS(){if(Gm)return
|
|
19
|
+
*/var Gm;function QS(){if(Gm)return Oe;Gm=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),g=Symbol.iterator;function x(A){return A===null||typeof A!="object"?null:(A=g&&A[g]||A["@@iterator"],typeof A=="function"?A:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,S={};function w(A,Y,F){this.props=A,this.context=Y,this.refs=S,this.updater=F||b}w.prototype.isReactComponent={},w.prototype.setState=function(A,Y){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,Y,"setState")},w.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function T(){}T.prototype=w.prototype;function j(A,Y,F){this.props=A,this.context=Y,this.refs=S,this.updater=F||b}var N=j.prototype=new T;N.constructor=j,v(N,w.prototype),N.isPureReactComponent=!0;var M=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},O=Object.prototype.hasOwnProperty;function _(A,Y,F,Z,le,re){return F=re.ref,{$$typeof:t,type:A,key:Y,ref:F!==void 0?F:null,props:re}}function k(A,Y){return _(A.type,Y,void 0,void 0,void 0,A.props)}function L(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function B(A){var Y={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(F){return Y[F]})}var z=/\/+/g;function U(A,Y){return typeof A=="object"&&A!==null&&A.key!=null?B(""+A.key):Y.toString(36)}function K(){}function $(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(K,K):(A.status="pending",A.then(function(Y){A.status==="pending"&&(A.status="fulfilled",A.value=Y)},function(Y){A.status==="pending"&&(A.status="rejected",A.reason=Y)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function ee(A,Y,F,Z,le){var re=typeof A;(re==="undefined"||re==="boolean")&&(A=null);var ae=!1;if(A===null)ae=!0;else switch(re){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(A.$$typeof){case t:case r:ae=!0;break;case C:return ae=A._init,ee(ae(A._payload),Y,F,Z,le)}}if(ae)return le=le(A),ae=Z===""?"."+U(A,0):Z,M(le)?(F="",ae!=null&&(F=ae.replace(z,"$&/")+"/"),ee(le,Y,F,"",function(ge){return ge})):le!=null&&(L(le)&&(le=k(le,F+(le.key==null||A&&A.key===le.key?"":(""+le.key).replace(z,"$&/")+"/")+ae)),Y.push(le)),1;ae=0;var be=Z===""?".":Z+":";if(M(A))for(var ye=0;ye<A.length;ye++)Z=A[ye],re=be+U(Z,ye),ae+=ee(Z,Y,F,re,le);else if(ye=x(A),typeof ye=="function")for(A=ye.call(A),ye=0;!(Z=A.next()).done;)Z=Z.value,re=be+U(Z,ye++),ae+=ee(Z,Y,F,re,le);else if(re==="object"){if(typeof A.then=="function")return ee($(A),Y,F,Z,le);throw Y=String(A),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ae}function G(A,Y,F){if(A==null)return A;var Z=[],le=0;return ee(A,Z,"","",function(re){return Y.call(F,re,le++)}),Z}function q(A){if(A._status===-1){var Y=A._result;Y=Y(),Y.then(function(F){(A._status===0||A._status===-1)&&(A._status=1,A._result=F)},function(F){(A._status===0||A._status===-1)&&(A._status=2,A._result=F)}),A._status===-1&&(A._status=0,A._result=Y)}if(A._status===1)return A._result.default;throw A._result}var H=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=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(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function P(){}return Oe.Children={map:G,forEach:function(A,Y,F){G(A,function(){Y.apply(this,arguments)},F)},count:function(A){var Y=0;return G(A,function(){Y++}),Y},toArray:function(A){return G(A,function(Y){return Y})||[]},only:function(A){if(!L(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Oe.Component=w,Oe.Fragment=i,Oe.Profiler=c,Oe.PureComponent=j,Oe.StrictMode=a,Oe.Suspense=m,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(A){return D.H.useMemoCache(A)}},Oe.cache=function(A){return function(){return A.apply(null,arguments)}},Oe.cloneElement=function(A,Y,F){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var Z=v({},A.props),le=A.key,re=void 0;if(Y!=null)for(ae in Y.ref!==void 0&&(re=void 0),Y.key!==void 0&&(le=""+Y.key),Y)!O.call(Y,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&Y.ref===void 0||(Z[ae]=Y[ae]);var ae=arguments.length-2;if(ae===1)Z.children=F;else if(1<ae){for(var be=Array(ae),ye=0;ye<ae;ye++)be[ye]=arguments[ye+2];Z.children=be}return _(A.type,le,void 0,void 0,re,Z)},Oe.createContext=function(A){return A={$$typeof:u,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:l,_context:A},A},Oe.createElement=function(A,Y,F){var Z,le={},re=null;if(Y!=null)for(Z in Y.key!==void 0&&(re=""+Y.key),Y)O.call(Y,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(le[Z]=Y[Z]);var ae=arguments.length-2;if(ae===1)le.children=F;else if(1<ae){for(var be=Array(ae),ye=0;ye<ae;ye++)be[ye]=arguments[ye+2];le.children=be}if(A&&A.defaultProps)for(Z in ae=A.defaultProps,ae)le[Z]===void 0&&(le[Z]=ae[Z]);return _(A,re,void 0,void 0,null,le)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(A){return{$$typeof:d,render:A}},Oe.isValidElement=L,Oe.lazy=function(A){return{$$typeof:C,_payload:{_status:-1,_result:A},_init:q}},Oe.memo=function(A,Y){return{$$typeof:p,type:A,compare:Y===void 0?null:Y}},Oe.startTransition=function(A){var Y=D.T,F={};D.T=F;try{var Z=A(),le=D.S;le!==null&&le(F,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(P,H)}catch(re){H(re)}finally{D.T=Y}},Oe.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Oe.use=function(A){return D.H.use(A)},Oe.useActionState=function(A,Y,F){return D.H.useActionState(A,Y,F)},Oe.useCallback=function(A,Y){return D.H.useCallback(A,Y)},Oe.useContext=function(A){return D.H.useContext(A)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(A,Y){return D.H.useDeferredValue(A,Y)},Oe.useEffect=function(A,Y,F){var Z=D.H;if(typeof F=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return Z.useEffect(A,Y)},Oe.useId=function(){return D.H.useId()},Oe.useImperativeHandle=function(A,Y,F){return D.H.useImperativeHandle(A,Y,F)},Oe.useInsertionEffect=function(A,Y){return D.H.useInsertionEffect(A,Y)},Oe.useLayoutEffect=function(A,Y){return D.H.useLayoutEffect(A,Y)},Oe.useMemo=function(A,Y){return D.H.useMemo(A,Y)},Oe.useOptimistic=function(A,Y){return D.H.useOptimistic(A,Y)},Oe.useReducer=function(A,Y,F){return D.H.useReducer(A,Y,F)},Oe.useRef=function(A){return D.H.useRef(A)},Oe.useState=function(A){return D.H.useState(A)},Oe.useSyncExternalStore=function(A,Y,F){return D.H.useSyncExternalStore(A,Y,F)},Oe.useTransition=function(){return D.H.useTransition()},Oe.version="19.1.1",Oe}var Vm;function Nu(){return Vm||(Vm=1,Ru.exports=QS()),Ru.exports}var E=Nu();const Oi=Pm(E),Ro=dt({__proto__:null,default:Oi},[E]);var Ou={exports:{}},Mi={},Mu={exports:{}},_u={};/**
|
|
20
20
|
* @license React
|
|
21
21
|
* scheduler.production.js
|
|
22
22
|
*
|
|
@@ -24,7 +24,7 @@ var NM=Object.defineProperty;var Z1=nt=>{throw TypeError(nt)};var MM=(nt,dt,Lt)=
|
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var qm;function ZS(){return qm||(qm=1,(function(t){function r(
|
|
27
|
+
*/var qm;function ZS(){return qm||(qm=1,(function(t){function r(G,q){var H=G.length;G.push(q);e:for(;0<H;){var P=H-1>>>1,A=G[P];if(0<c(A,q))G[P]=q,G[H]=A,H=P;else break e}}function i(G){return G.length===0?null:G[0]}function a(G){if(G.length===0)return null;var q=G[0],H=G.pop();if(H!==q){G[0]=H;e:for(var P=0,A=G.length,Y=A>>>1;P<Y;){var F=2*(P+1)-1,Z=G[F],le=F+1,re=G[le];if(0>c(Z,H))le<A&&0>c(re,Z)?(G[P]=re,G[le]=H,P=le):(G[P]=Z,G[F]=H,P=F);else if(le<A&&0>c(re,H))G[P]=re,G[le]=H,P=le;else break e}}return q}function c(G,q){var H=G.sortIndex-q.sortIndex;return H!==0?H:G.id-q.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,x=3,b=!1,v=!1,S=!1,w=!1,T=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function M(G){for(var q=i(p);q!==null;){if(q.callback===null)a(p);else if(q.startTime<=G)a(p),q.sortIndex=q.expirationTime,r(m,q);else break;q=i(p)}}function D(G){if(S=!1,M(G),!v)if(i(m)!==null)v=!0,O||(O=!0,U());else{var q=i(p);q!==null&&ee(D,q.startTime-G)}}var O=!1,_=-1,k=5,L=-1;function B(){return w?!0:!(t.unstable_now()-L<k)}function z(){if(w=!1,O){var G=t.unstable_now();L=G;var q=!0;try{e:{v=!1,S&&(S=!1,j(_),_=-1),b=!0;var H=x;try{t:{for(M(G),g=i(m);g!==null&&!(g.expirationTime>G&&B());){var P=g.callback;if(typeof P=="function"){g.callback=null,x=g.priorityLevel;var A=P(g.expirationTime<=G);if(G=t.unstable_now(),typeof A=="function"){g.callback=A,M(G),q=!0;break t}g===i(m)&&a(m),M(G)}else a(m);g=i(m)}if(g!==null)q=!0;else{var Y=i(p);Y!==null&&ee(D,Y.startTime-G),q=!1}}break e}finally{g=null,x=H,b=!1}q=void 0}}finally{q?U():O=!1}}}var U;if(typeof N=="function")U=function(){N(z)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,$=K.port2;K.port1.onmessage=z,U=function(){$.postMessage(null)}}else U=function(){T(z,0)};function ee(G,q){_=T(function(){G(t.unstable_now())},q)}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(G){G.callback=null},t.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<G?Math.floor(1e3/G):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(G){switch(x){case 1:case 2:case 3:var q=3;break;default:q=x}var H=x;x=q;try{return G()}finally{x=H}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(G,q){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var H=x;x=G;try{return q()}finally{x=H}},t.unstable_scheduleCallback=function(G,q,H){var P=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?P+H:P):H=P,G){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=H+A,G={id:C++,callback:q,priorityLevel:G,startTime:H,expirationTime:A,sortIndex:-1},H>P?(G.sortIndex=H,r(p,G),i(m)===null&&G===i(p)&&(S?(j(_),_=-1):S=!0,ee(D,H-P))):(G.sortIndex=A,r(m,G),v||b||(v=!0,O||(O=!0,U()))),G},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(G){var q=x;return function(){var H=x;x=q;try{return G.apply(this,arguments)}finally{x=H}}}})(_u)),_u}var Ym;function WS(){return Ym||(Ym=1,Mu.exports=ZS()),Mu.exports}var Du={exports:{}},Yt={};/**
|
|
28
28
|
* @license React
|
|
29
29
|
* react-dom.production.js
|
|
30
30
|
*
|
|
@@ -32,7 +32,7 @@ var NM=Object.defineProperty;var Z1=nt=>{throw TypeError(nt)};var MM=(nt,dt,Lt)=
|
|
|
32
32
|
*
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/var Xm;function JS(){if(Xm)return Yt;Xm=1;var t=Nu();function r(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)p+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal");function l(m,p,C){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:g==null?null:""+g,children:m,containerInfo:p,implementation:C}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Yt.createPortal=function(m,p){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return l(m,p,null,C)},Yt.flushSync=function(m){var p=u.T,C=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=p,a.p=C,a.d.f()}},Yt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},Yt.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Yt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var C=p.as,g=d(C,p.crossOrigin),
|
|
35
|
+
*/var Xm;function JS(){if(Xm)return Yt;Xm=1;var t=Nu();function r(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)p+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal");function l(m,p,C){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:g==null?null:""+g,children:m,containerInfo:p,implementation:C}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Yt.createPortal=function(m,p){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return l(m,p,null,C)},Yt.flushSync=function(m){var p=u.T,C=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=p,a.p=C,a.d.f()}},Yt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},Yt.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Yt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var C=p.as,g=d(C,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,b=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:x,fetchPriority:b}):C==="script"&&a.d.X(m,{crossOrigin:g,integrity:x,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Yt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var C=d(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:C,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},Yt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var C=p.as,g=d(C,p.crossOrigin);a.d.L(m,C,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Yt.preloadModule=function(m,p){if(typeof m=="string")if(p){var C=d(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:C,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},Yt.requestFormReset=function(m){a.d.r(m)},Yt.unstable_batchedUpdates=function(m,p){return m(p)},Yt.useFormState=function(m,p,C){return u.H.useFormState(m,p,C)},Yt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Yt.version="19.1.1",Yt}var Km;function Fm(){if(Km)return Du.exports;Km=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Du.exports=JS(),Du.exports}/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-dom-client.production.js
|
|
38
38
|
*
|
|
@@ -40,20 +40,20 @@ var NM=Object.defineProperty;var Z1=nt=>{throw TypeError(nt)};var MM=(nt,dt,Lt)=
|
|
|
40
40
|
*
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/var Qm;function eC(){if(Qm)return Mi;Qm=1;var t=WS(),r=Nu(),i=Fm();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function u(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(l(e)!==e)throw Error(a(188))}function m(e){var n=e.alternate;if(!n){if(n=l(e),n===null)throw Error(a(188));return n!==e?null:e}for(var o=e,s=n;;){var h=o.return;if(h===null)break;var y=h.alternate;if(y===null){if(s=h.return,s!==null){o=s;continue}break}if(h.child===y.child){for(y=h.child;y;){if(y===o)return d(h),e;if(y===s)return d(h),n;y=y.sibling}throw Error(a(188))}if(o.return!==s.return)o=h,s=y;else{for(var A=!1,k=h.child;k;){if(k===o){A=!0,o=h,s=y;break}if(k===s){A=!0,s=h,o=y;break}k=k.sibling}if(!A){for(k=y.child;k;){if(k===o){A=!0,o=y,s=h;break}if(k===s){A=!0,s=y,o=h;break}k=k.sibling}if(!A)throw Error(a(189))}}if(o.alternate!==s)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?e:n}function p(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=p(e),n!==null)return n;e=e.sibling}return null}var C=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),j=Symbol.for("react.consumer"),R=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var X=Symbol.for("react.client.reference");function G(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case M:return"Suspense";case D:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case x:return"Portal";case R:return(e.displayName||"Context")+".Provider";case j:return(e._context.displayName||"Context")+".Consumer";case O:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return n=e.displayName||null,n!==null?n:G(e.type)||"Memo";case I:n=e._payload,e=e._init;try{return G(e(n))}catch{}}return null}var te=Array.isArray,V=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},P=[],N=-1;function U(e){return{current:e}}function J(e){0>N||(e.current=P[N],P[N]=null,N--)}function Q(e,n){N++,P[N]=e.current,e.current=n}var le=U(null),re=U(null),ae=U(null),ge=U(null);function je(e,n){switch(Q(ae,n),Q(re,e),Q(le,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?T1(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=T1(n),e=j1(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}J(le),Q(le,e)}function ye(){J(le),J(re),J(ae)}function de(e){e.memoizedState!==null&&Q(ge,e);var n=le.current,o=j1(n,e.type);n!==o&&(Q(re,e),Q(le,o))}function Me(e){re.current===e&&(J(le),J(re)),ge.current===e&&(J(ge),Ps._currentValue=L)}var De=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Bt=t.unstable_requestPaint,ht=t.unstable_now,he=t.unstable_getCurrentPriorityLevel,at=t.unstable_ImmediatePriority,it=t.unstable_UserBlockingPriority,Mt=t.unstable_NormalPriority,$n=t.unstable_LowPriority,to=t.unstable_IdlePriority,Go=t.log,Er=t.unstable_setDisableYieldValue,Gn=null,At=null;function Rn(e){if(typeof Go=="function"&&Er(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(Gn,e)}catch{}}var Ht=Math.clz32?Math.clz32:St,Ki=Math.log,_e=Math.LN2;function St(e){return e>>>=0,e===0?32:31-(Ki(e)/_e|0)|0}var On=256,Kt=4194304;function no(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fi(e,n,o){var s=e.pendingLanes;if(s===0)return 0;var h=0,y=e.suspendedLanes,A=e.pingedLanes;e=e.warmLanes;var k=s&134217727;return k!==0?(s=k&~y,s!==0?h=no(s):(A&=k,A!==0?h=no(A):o||(o=k&~e,o!==0&&(h=no(o))))):(k=s&~y,k!==0?h=no(k):A!==0?h=no(A):o||(o=s&~e,o!==0&&(h=no(o)))),h===0?0:n!==0&&n!==h&&(n&y)===0&&(y=h&-h,o=n&-n,y>=o||y===32&&(o&4194048)!==0)?n:h}function ce(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Re(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ve(){var e=On;return On<<=1,(On&4194048)===0&&(On=256),e}function et(){var e=Kt;return Kt<<=1,(Kt&62914560)===0&&(Kt=4194304),e}function Ft(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function Oe(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function en(e,n,o,s,h,y){var A=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var k=e.entanglements,q=e.expirationTimes,W=e.hiddenUpdates;for(o=A&~o;0<o;){var oe=31-Ht(o),se=1<<oe;k[oe]=0,q[oe]=-1;var ee=W[oe];if(ee!==null)for(W[oe]=null,oe=0;oe<ee.length;oe++){var ne=ee[oe];ne!==null&&(ne.lane&=-536870913)}o&=~se}s!==0&&hn(e,s,0),y!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=y&~(A&~n))}function hn(e,n,o){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Ht(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|o&4194090}function Qi(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var s=31-Ht(o),h=1<<s;h&n|e[s]&n&&(e[s]|=n),o&=~h}}function _a(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Tr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function rr(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:q1(e.type))}function sf(e,n){var o=Y.p;try{return Y.p=e,n()}finally{Y.p=o}}var ro=Math.random().toString(36).slice(2),Qt="__reactFiber$"+ro,on="__reactProps$"+ro,Da="__reactContainer$"+ro,lf="__reactEvents$"+ro,vO="__reactListeners$"+ro,SO="__reactHandles$"+ro,hb="__reactResources$"+ro,Zi="__reactMarker$"+ro;function cf(e){delete e[Qt],delete e[on],delete e[lf],delete e[vO],delete e[SO]}function Ia(e){var n=e[Qt];if(n)return n;for(var o=e.parentNode;o;){if(n=o[Da]||o[Qt]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=N1(e);e!==null;){if(o=e[Qt])return o;e=N1(e)}return n}e=o,o=e.parentNode}return null}function ka(e){if(e=e[Qt]||e[Da]){var n=e.tag;if(n===5||n===6||n===13||n===26||n===27||n===3)return e}return null}function Wi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function La(e){var n=e[hb];return n||(n=e[hb]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function _t(e){e[Zi]=!0}var mb=new Set,pb={};function Vo(e,n){za(e,n),za(e+"Capture",n)}function za(e,n){for(pb[e]=n,e=0;e<n.length;e++)mb.add(n[e])}var CO=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),gb={},yb={};function wO(e){return De.call(yb,e)?!0:De.call(gb,e)?!1:CO.test(e)?yb[e]=!0:(gb[e]=!0,!1)}function Ql(e,n,o){if(wO(n))if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+o)}}function Zl(e,n,o){if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+o)}}function jr(e,n,o,s){if(s===null)e.removeAttribute(o);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(n,o,""+s)}}var uf,bb;function Ba(e){if(uf===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);uf=n&&n[1]||"",bb=-1<o.stack.indexOf(`
|
|
43
|
+
*/var Qm;function eC(){if(Qm)return Mi;Qm=1;var t=WS(),r=Nu(),i=Fm();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function u(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(l(e)!==e)throw Error(a(188))}function m(e){var n=e.alternate;if(!n){if(n=l(e),n===null)throw Error(a(188));return n!==e?null:e}for(var o=e,s=n;;){var h=o.return;if(h===null)break;var y=h.alternate;if(y===null){if(s=h.return,s!==null){o=s;continue}break}if(h.child===y.child){for(y=h.child;y;){if(y===o)return d(h),e;if(y===s)return d(h),n;y=y.sibling}throw Error(a(188))}if(o.return!==s.return)o=h,s=y;else{for(var R=!1,I=h.child;I;){if(I===o){R=!0,o=h,s=y;break}if(I===s){R=!0,s=h,o=y;break}I=I.sibling}if(!R){for(I=y.child;I;){if(I===o){R=!0,o=y,s=h;break}if(I===s){R=!0,s=y,o=h;break}I=I.sibling}if(!R)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"),x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),j=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var K=Symbol.for("react.client.reference");function $(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===K?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case D:return"Suspense";case O:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case b:return"Portal";case N:return(e.displayName||"Context")+".Provider";case j:return(e._context.displayName||"Context")+".Consumer";case M: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:$(e.type)||"Memo";case k:n=e._payload,e=e._init;try{return $(e(n))}catch{}}return null}var ee=Array.isArray,G=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},P=[],A=-1;function Y(e){return{current:e}}function F(e){0>A||(e.current=P[A],P[A]=null,A--)}function Z(e,n){A++,P[A]=e.current,e.current=n}var le=Y(null),re=Y(null),ae=Y(null),be=Y(null);function ye(e,n){switch(Z(ae,n),Z(re,e),Z(le,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?T1(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=T1(n),e=j1(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(le),Z(le,e)}function ge(){F(le),F(re),F(ae)}function de(e){e.memoizedState!==null&&Z(be,e);var n=le.current,o=j1(n,e.type);n!==o&&(Z(re,e),Z(le,o))}function _e(e){re.current===e&&(F(le),F(re)),be.current===e&&(F(be),Ps._currentValue=H)}var Me=Object.prototype.hasOwnProperty,Ee=t.unstable_scheduleCallback,ve=t.unstable_cancelCallback,Te=t.unstable_shouldYield,At=t.unstable_requestPaint,ht=t.unstable_now,rn=t.unstable_getCurrentPriorityLevel,pe=t.unstable_ImmediatePriority,yt=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,On=t.unstable_LowPriority,Mn=t.unstable_IdlePriority,Oa=t.log,Uo=t.unstable_setDisableYieldValue,on=null,Rt=null;function mn(e){if(typeof Oa=="function"&&Uo(e),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(on,e)}catch{}}var Ht=Math.clz32?Math.clz32:ke,Ki=Math.log,Ma=Math.LN2;function ke(e){return e>>>=0,e===0?32:31-(Ki(e)/Ma|0)|0}var ct=256,_n=4194304;function Nt(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fi(e,n,o){var s=e.pendingLanes;if(s===0)return 0;var h=0,y=e.suspendedLanes,R=e.pingedLanes;e=e.warmLanes;var I=s&134217727;return I!==0?(s=I&~y,s!==0?h=Nt(s):(R&=I,R!==0?h=Nt(R):o||(o=I&~e,o!==0&&(h=Nt(o))))):(I=s&~y,I!==0?h=Nt(I):R!==0?h=Nt(R):o||(o=s&~e,o!==0&&(h=Nt(o)))),h===0?0:n!==0&&n!==h&&(n&y)===0&&(y=h&-h,o=n&-n,y>=o||y===32&&(o&4194048)!==0)?n:h}function ce(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Re(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Se(){var e=ct;return ct<<=1,(ct&4194048)===0&&(ct=256),e}function tt(){var e=_n;return _n<<=1,(_n&62914560)===0&&(_n=4194304),e}function Kt(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function Ne(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Jt(e,n,o,s,h,y){var R=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 I=e.entanglements,V=e.expirationTimes,J=e.hiddenUpdates;for(o=R&~o;0<o;){var oe=31-Ht(o),se=1<<oe;I[oe]=0,V[oe]=-1;var te=J[oe];if(te!==null)for(J[oe]=null,oe=0;oe<te.length;oe++){var ne=te[oe];ne!==null&&(ne.lane&=-536870913)}o&=~se}s!==0&&pn(e,s,0),y!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=y&~(R&~n))}function pn(e,n,o){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Ht(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|o&4194090}function Qi(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var s=31-Ht(o),h=1<<s;h&n|e[s]&n&&(e[s]|=n),o&=~h}}function _a(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Tr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function or(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:q1(e.type))}function af(e,n){var o=q.p;try{return q.p=e,n()}finally{q.p=o}}var no=Math.random().toString(36).slice(2),Ft="__reactFiber$"+no,an="__reactProps$"+no,Da="__reactContainer$"+no,sf="__reactEvents$"+no,vN="__reactListeners$"+no,SN="__reactHandles$"+no,hx="__reactResources$"+no,Zi="__reactMarker$"+no;function lf(e){delete e[Ft],delete e[an],delete e[sf],delete e[vN],delete e[SN]}function Ia(e){var n=e[Ft];if(n)return n;for(var o=e.parentNode;o;){if(n=o[Da]||o[Ft]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=O1(e);e!==null;){if(o=e[Ft])return o;e=O1(e)}return n}e=o,o=e.parentNode}return null}function ka(e){if(e=e[Ft]||e[Da]){var n=e.tag;if(n===5||n===6||n===13||n===26||n===27||n===3)return e}return null}function Wi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function La(e){var n=e[hx];return n||(n=e[hx]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Dt(e){e[Zi]=!0}var mx=new Set,px={};function $o(e,n){za(e,n),za(e+"Capture",n)}function za(e,n){for(px[e]=n,e=0;e<n.length;e++)mx.add(n[e])}var CN=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]*$"),gx={},yx={};function wN(e){return Me.call(yx,e)?!0:Me.call(gx,e)?!1:CN.test(e)?yx[e]=!0:(gx[e]=!0,!1)}function Fl(e,n,o){if(wN(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 Ql(e,n,o){if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+o)}}function jr(e,n,o,s){if(s===null)e.removeAttribute(o);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(n,o,""+s)}}var cf,xx;function Ba(e){if(cf===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);cf=n&&n[1]||"",xx=-1<o.stack.indexOf(`
|
|
44
44
|
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
45
|
-
`+
|
|
46
|
-
`),
|
|
47
|
-
`);for(h=s=0;s<
|
|
48
|
-
`+
|
|
45
|
+
`+cf+e+xx}var uf=!1;function df(e,n){if(!e||uf)return"";uf=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(ne){var te=ne}Reflect.construct(e,[],se)}else{try{se.call()}catch(ne){te=ne}e.call(se.prototype)}}else{try{throw Error()}catch(ne){te=ne}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(ne){if(ne&&te&&typeof ne.stack=="string")return[ne.stack,te.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(),R=y[0],I=y[1];if(R&&I){var V=R.split(`
|
|
46
|
+
`),J=I.split(`
|
|
47
|
+
`);for(h=s=0;s<V.length&&!V[s].includes("DetermineComponentFrameRoot");)s++;for(;h<J.length&&!J[h].includes("DetermineComponentFrameRoot");)h++;if(s===V.length||h===J.length)for(s=V.length-1,h=J.length-1;1<=s&&0<=h&&V[s]!==J[h];)h--;for(;1<=s&&0<=h;s--,h--)if(V[s]!==J[h]){if(s!==1||h!==1)do if(s--,h--,0>h||V[s]!==J[h]){var oe=`
|
|
48
|
+
`+V[s].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=s&&0<=h);break}}}finally{uf=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?Ba(o):""}function EN(e){switch(e.tag){case 26:case 27:case 5:return Ba(e.type);case 16:return Ba("Lazy");case 13:return Ba("Suspense");case 19:return Ba("SuspenseList");case 0:case 15:return df(e.type,!1);case 11:return df(e.type.render,!1);case 1:return df(e.type,!0);case 31:return Ba("Activity");default:return""}}function bx(e){try{var n="";do n+=EN(e),e=e.return;while(e);return n}catch(o){return`
|
|
49
49
|
Error generating stack: `+o.message+`
|
|
50
|
-
`+o.stack}}function Nn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vb(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function TO(e){var n=vb(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),s=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,y=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return h.call(this)},set:function(A){s=""+A,y.call(this,A)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(A){s=""+A},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Wl(e){e._valueTracker||(e._valueTracker=TO(e))}function Sb(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),s="";return e&&(s=vb(e)?e.checked?"true":"false":e.value),e=s,e!==o?(n.setValue(e),!0):!1}function Jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var jO=/[\n"\\]/g;function Mn(e){return e.replace(jO,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function hf(e,n,o,s,h,y,A,k){e.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.type=A:e.removeAttribute("type"),n!=null?A==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Nn(n)):e.value!==""+Nn(n)&&(e.value=""+Nn(n)):A!=="submit"&&A!=="reset"||e.removeAttribute("value"),n!=null?mf(e,A,Nn(n)):o!=null?mf(e,A,Nn(o)):s!=null&&e.removeAttribute("value"),h==null&&y!=null&&(e.defaultChecked=!!y),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+Nn(k):e.removeAttribute("name")}function Cb(e,n,o,s,h,y,A,k){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.type=y),n!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||n!=null))return;o=o!=null?""+Nn(o):"",n=n!=null?""+Nn(n):o,k||n===e.value||(e.value=n),e.defaultValue=n}s=s??h,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=k?e.checked:!!s,e.defaultChecked=!!s,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(e.name=A)}function mf(e,n,o){n==="number"&&Jl(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function Ha(e,n,o,s){if(e=e.options,n){n={};for(var h=0;h<o.length;h++)n["$"+o[h]]=!0;for(o=0;o<e.length;o++)h=n.hasOwnProperty("$"+e[o].value),e[o].selected!==h&&(e[o].selected=h),h&&s&&(e[o].defaultSelected=!0)}else{for(o=""+Nn(o),n=null,h=0;h<e.length;h++){if(e[h].value===o){e[h].selected=!0,s&&(e[h].defaultSelected=!0);return}n!==null||e[h].disabled||(n=e[h])}n!==null&&(n.selected=!0)}}function wb(e,n,o){if(n!=null&&(n=""+Nn(n),n!==e.value&&(e.value=n),o==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=o!=null?""+Nn(o):""}function Eb(e,n,o,s){if(n==null){if(s!=null){if(o!=null)throw Error(a(92));if(te(s)){if(1<s.length)throw Error(a(93));s=s[0]}o=s}o==null&&(o=""),n=o}o=Nn(n),e.defaultValue=o,s=e.textContent,s===o&&s!==""&&s!==null&&(e.value=s)}function Pa(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var AO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Tb(e,n,o){var s=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,o):typeof o!="number"||o===0||AO.has(n)?n==="float"?e.cssFloat=o:e[n]=(""+o).trim():e[n]=o+"px"}function jb(e,n,o){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,o!=null){for(var s in o)!o.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var h in n)s=n[h],n.hasOwnProperty(h)&&o[h]!==s&&Tb(e,h,s)}else for(var y in n)n.hasOwnProperty(y)&&Tb(e,y,n[y])}function pf(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var RO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),OO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ec(e){return OO.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var gf=null;function yf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ua=null,$a=null;function Ab(e){var n=ka(e);if(n&&(e=n.stateNode)){var o=e[on]||null;e:switch(e=n.stateNode,n.type){case"input":if(hf(e,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Mn(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var s=o[n];if(s!==e&&s.form===e.form){var h=s[on]||null;if(!h)throw Error(a(90));hf(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<o.length;n++)s=o[n],s.form===e.form&&Sb(s)}break e;case"textarea":wb(e,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&Ha(e,!!o.multiple,n,!1)}}}var bf=!1;function Rb(e,n,o){if(bf)return e(n,o);bf=!0;try{var s=e(n);return s}finally{if(bf=!1,(Ua!==null||$a!==null)&&(Hc(),Ua&&(n=Ua,e=$a,$a=Ua=null,Ab(n),e)))for(n=0;n<e.length;n++)Ab(e[n])}}function Ji(e,n){var o=e.stateNode;if(o===null)return null;var s=o[on]||null;if(s===null)return null;o=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(a(231,n,typeof o));return o}var Ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xf=!1;if(Ar)try{var es={};Object.defineProperty(es,"passive",{get:function(){xf=!0}}),window.addEventListener("test",es,es),window.removeEventListener("test",es,es)}catch{xf=!1}var oo=null,vf=null,tc=null;function Ob(){if(tc)return tc;var e,n=vf,o=n.length,s,h="value"in oo?oo.value:oo.textContent,y=h.length;for(e=0;e<o&&n[e]===h[e];e++);var A=o-e;for(s=1;s<=A&&n[o-s]===h[y-s];s++);return tc=h.slice(e,1<s?1-s:void 0)}function nc(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function rc(){return!0}function Nb(){return!1}function an(e){function n(o,s,h,y,A){this._reactName=o,this._targetInst=h,this.type=s,this.nativeEvent=y,this.target=A,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(o=e[k],this[k]=o?o(y):y[k]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?rc:Nb,this.isPropagationStopped=Nb,this}return C(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=rc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=rc)},persist:function(){},isPersistent:rc}),n}var qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oc=an(qo),ts=C({},qo,{view:0,detail:0}),NO=an(ts),Sf,Cf,ns,ac=C({},ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ef,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ns&&(ns&&e.type==="mousemove"?(Sf=e.screenX-ns.screenX,Cf=e.screenY-ns.screenY):Cf=Sf=0,ns=e),Sf)},movementY:function(e){return"movementY"in e?e.movementY:Cf}}),Mb=an(ac),MO=C({},ac,{dataTransfer:0}),_O=an(MO),DO=C({},ts,{relatedTarget:0}),wf=an(DO),IO=C({},qo,{animationName:0,elapsedTime:0,pseudoElement:0}),kO=an(IO),LO=C({},qo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zO=an(LO),BO=C({},qo,{data:0}),_b=an(BO),HO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},UO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $O(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=UO[e])?!!n[e]:!1}function Ef(){return $O}var GO=C({},ts,{key:function(e){if(e.key){var n=HO[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=nc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?PO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ef,charCode:function(e){return e.type==="keypress"?nc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),VO=an(GO),qO=C({},ac,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Db=an(qO),YO=C({},ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ef}),XO=an(YO),KO=C({},qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),FO=an(KO),QO=C({},ac,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ZO=an(QO),WO=C({},qo,{newState:0,oldState:0}),JO=an(WO),eN=[9,13,27,32],Tf=Ar&&"CompositionEvent"in window,rs=null;Ar&&"documentMode"in document&&(rs=document.documentMode);var tN=Ar&&"TextEvent"in window&&!rs,Ib=Ar&&(!Tf||rs&&8<rs&&11>=rs),kb=" ",Lb=!1;function zb(e,n){switch(e){case"keyup":return eN.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ga=!1;function nN(e,n){switch(e){case"compositionend":return Bb(n);case"keypress":return n.which!==32?null:(Lb=!0,kb);case"textInput":return e=n.data,e===kb&&Lb?null:e;default:return null}}function rN(e,n){if(Ga)return e==="compositionend"||!Tf&&zb(e,n)?(e=Ob(),tc=vf=oo=null,Ga=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Ib&&n.locale!=="ko"?null:n.data;default:return null}}var oN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hb(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!oN[e.type]:n==="textarea"}function Pb(e,n,o,s){Ua?$a?$a.push(s):$a=[s]:Ua=s,n=qc(n,"onChange"),0<n.length&&(o=new oc("onChange","change",null,o,s),e.push({event:o,listeners:n}))}var os=null,as=null;function aN(e){v1(e,0)}function ic(e){var n=Wi(e);if(Sb(n))return e}function Ub(e,n){if(e==="change")return n}var $b=!1;if(Ar){var jf;if(Ar){var Af="oninput"in document;if(!Af){var Gb=document.createElement("div");Gb.setAttribute("oninput","return;"),Af=typeof Gb.oninput=="function"}jf=Af}else jf=!1;$b=jf&&(!document.documentMode||9<document.documentMode)}function Vb(){os&&(os.detachEvent("onpropertychange",qb),as=os=null)}function qb(e){if(e.propertyName==="value"&&ic(as)){var n=[];Pb(n,as,e,yf(e)),Rb(aN,n)}}function iN(e,n,o){e==="focusin"?(Vb(),os=n,as=o,os.attachEvent("onpropertychange",qb)):e==="focusout"&&Vb()}function sN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ic(as)}function lN(e,n){if(e==="click")return ic(n)}function cN(e,n){if(e==="input"||e==="change")return ic(n)}function uN(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var mn=typeof Object.is=="function"?Object.is:uN;function is(e,n){if(mn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),s=Object.keys(n);if(o.length!==s.length)return!1;for(s=0;s<o.length;s++){var h=o[s];if(!De.call(n,h)||!mn(e[h],n[h]))return!1}return!0}function Yb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xb(e,n){var o=Yb(e);e=0;for(var s;o;){if(o.nodeType===3){if(s=e+o.textContent.length,e<=n&&s>=n)return{node:o,offset:n-e};e=s}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Yb(o)}}function Kb(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Kb(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Fb(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Jl(e.document);n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Jl(e.document)}return n}function Rf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var dN=Ar&&"documentMode"in document&&11>=document.documentMode,Va=null,Of=null,ss=null,Nf=!1;function Qb(e,n,o){var s=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Nf||Va==null||Va!==Jl(s)||(s=Va,"selectionStart"in s&&Rf(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ss&&is(ss,s)||(ss=s,s=qc(Of,"onSelect"),0<s.length&&(n=new oc("onSelect","select",null,n,o),e.push({event:n,listeners:s}),n.target=Va)))}function Yo(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var qa={animationend:Yo("Animation","AnimationEnd"),animationiteration:Yo("Animation","AnimationIteration"),animationstart:Yo("Animation","AnimationStart"),transitionrun:Yo("Transition","TransitionRun"),transitionstart:Yo("Transition","TransitionStart"),transitioncancel:Yo("Transition","TransitionCancel"),transitionend:Yo("Transition","TransitionEnd")},Mf={},Zb={};Ar&&(Zb=document.createElement("div").style,"AnimationEvent"in window||(delete qa.animationend.animation,delete qa.animationiteration.animation,delete qa.animationstart.animation),"TransitionEvent"in window||delete qa.transitionend.transition);function Xo(e){if(Mf[e])return Mf[e];if(!qa[e])return e;var n=qa[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Zb)return Mf[e]=n[o];return e}var Wb=Xo("animationend"),Jb=Xo("animationiteration"),ex=Xo("animationstart"),fN=Xo("transitionrun"),hN=Xo("transitionstart"),mN=Xo("transitioncancel"),tx=Xo("transitionend"),nx=new Map,_f="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");_f.push("scrollEnd");function Vn(e,n){nx.set(e,n),Vo(n,[e])}var rx=new WeakMap;function _n(e,n){if(typeof e=="object"&&e!==null){var o=rx.get(e);return o!==void 0?o:(n={value:e,source:n,stack:xb(n)},rx.set(e,n),n)}return{value:e,source:n,stack:xb(n)}}var Dn=[],Ya=0,Df=0;function sc(){for(var e=Ya,n=Df=Ya=0;n<e;){var o=Dn[n];Dn[n++]=null;var s=Dn[n];Dn[n++]=null;var h=Dn[n];Dn[n++]=null;var y=Dn[n];if(Dn[n++]=null,s!==null&&h!==null){var A=s.pending;A===null?h.next=h:(h.next=A.next,A.next=h),s.pending=h}y!==0&&ox(o,h,y)}}function lc(e,n,o,s){Dn[Ya++]=e,Dn[Ya++]=n,Dn[Ya++]=o,Dn[Ya++]=s,Df|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function If(e,n,o,s){return lc(e,n,o,s),cc(e)}function Xa(e,n){return lc(e,null,null,n),cc(e)}function ox(e,n,o){e.lanes|=o;var s=e.alternate;s!==null&&(s.lanes|=o);for(var h=!1,y=e.return;y!==null;)y.childLanes|=o,s=y.alternate,s!==null&&(s.childLanes|=o),y.tag===22&&(e=y.stateNode,e===null||e._visibility&1||(h=!0)),e=y,y=y.return;return e.tag===3?(y=e.stateNode,h&&n!==null&&(h=31-Ht(o),e=y.hiddenUpdates,s=e[h],s===null?e[h]=[n]:s.push(n),n.lane=o|536870912),y):null}function cc(e){if(50<_s)throw _s=0,Ph=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ka={};function pN(e,n,o,s){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pn(e,n,o,s){return new pN(e,n,o,s)}function kf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rr(e,n){var o=e.alternate;return o===null?(o=pn(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&65011712,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o.refCleanup=e.refCleanup,o}function ax(e,n){e.flags&=65011714;var o=e.alternate;return o===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=o.childLanes,e.lanes=o.lanes,e.child=o.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=o.memoizedProps,e.memoizedState=o.memoizedState,e.updateQueue=o.updateQueue,e.type=o.type,n=o.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function uc(e,n,o,s,h,y){var A=0;if(s=e,typeof e=="function")kf(e)&&(A=1);else if(typeof e=="string")A=yM(e,o,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=pn(31,o,n,h),e.elementType=B,e.lanes=y,e;case v:return Ko(o.children,h,y,n);case S:A=8,h|=24;break;case w:return e=pn(12,o,n,h|2),e.elementType=w,e.lanes=y,e;case M:return e=pn(13,o,n,h),e.elementType=M,e.lanes=y,e;case D:return e=pn(19,o,n,h),e.elementType=D,e.lanes=y,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:case R:A=10;break e;case j:A=9;break e;case O:A=11;break e;case _:A=14;break e;case I:A=16,s=null;break e}A=29,o=Error(a(130,e===null?"null":typeof e,"")),s=null}return n=pn(A,o,n,h),n.elementType=e,n.type=s,n.lanes=y,n}function Ko(e,n,o,s){return e=pn(7,e,s,n),e.lanes=o,e}function Lf(e,n,o){return e=pn(6,e,null,n),e.lanes=o,e}function zf(e,n,o){return n=pn(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Fa=[],Qa=0,dc=null,fc=0,In=[],kn=0,Fo=null,Or=1,Nr="";function Qo(e,n){Fa[Qa++]=fc,Fa[Qa++]=dc,dc=e,fc=n}function ix(e,n,o){In[kn++]=Or,In[kn++]=Nr,In[kn++]=Fo,Fo=e;var s=Or;e=Nr;var h=32-Ht(s)-1;s&=~(1<<h),o+=1;var y=32-Ht(n)+h;if(30<y){var A=h-h%5;y=(s&(1<<A)-1).toString(32),s>>=A,h-=A,Or=1<<32-Ht(n)+h|o<<h|s,Nr=y+e}else Or=1<<y|o<<h|s,Nr=e}function Bf(e){e.return!==null&&(Qo(e,1),ix(e,1,0))}function Hf(e){for(;e===dc;)dc=Fa[--Qa],Fa[Qa]=null,fc=Fa[--Qa],Fa[Qa]=null;for(;e===Fo;)Fo=In[--kn],In[kn]=null,Nr=In[--kn],In[kn]=null,Or=In[--kn],In[kn]=null}var tn=null,mt=null,Ke=!1,Zo=null,or=!1,Pf=Error(a(519));function Wo(e){var n=Error(a(418,""));throw us(_n(n,e)),Pf}function sx(e){var n=e.stateNode,o=e.type,s=e.memoizedProps;switch(n[Qt]=e,n[on]=s,o){case"dialog":Ue("cancel",n),Ue("close",n);break;case"iframe":case"object":case"embed":Ue("load",n);break;case"video":case"audio":for(o=0;o<Is.length;o++)Ue(Is[o],n);break;case"source":Ue("error",n);break;case"img":case"image":case"link":Ue("error",n),Ue("load",n);break;case"details":Ue("toggle",n);break;case"input":Ue("invalid",n),Cb(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),Wl(n);break;case"select":Ue("invalid",n);break;case"textarea":Ue("invalid",n),Eb(n,s.value,s.defaultValue,s.children),Wl(n)}o=s.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||s.suppressHydrationWarning===!0||E1(n.textContent,o)?(s.popover!=null&&(Ue("beforetoggle",n),Ue("toggle",n)),s.onScroll!=null&&Ue("scroll",n),s.onScrollEnd!=null&&Ue("scrollend",n),s.onClick!=null&&(n.onclick=Yc),n=!0):n=!1,n||Wo(e)}function lx(e){for(tn=e.return;tn;)switch(tn.tag){case 5:case 13:or=!1;return;case 27:case 3:or=!0;return;default:tn=tn.return}}function ls(e){if(e!==tn)return!1;if(!Ke)return lx(e),Ke=!0,!1;var n=e.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=e.type,o=!(o!=="form"&&o!=="button")||nm(e.type,e.memoizedProps)),o=!o),o&&mt&&Wo(e),lx(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8)if(o=e.data,o==="/$"){if(n===0){mt=Yn(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++;e=e.nextSibling}mt=null}}else n===27?(n=mt,So(e.type)?(e=im,im=null,mt=e):mt=n):mt=tn?Yn(e.stateNode.nextSibling):null;return!0}function cs(){mt=tn=null,Ke=!1}function cx(){var e=Zo;return e!==null&&(cn===null?cn=e:cn.push.apply(cn,e),Zo=null),e}function us(e){Zo===null?Zo=[e]:Zo.push(e)}var Uf=U(null),Jo=null,Mr=null;function ao(e,n,o){Q(Uf,n._currentValue),n._currentValue=o}function _r(e){e._currentValue=Uf.current,J(Uf)}function $f(e,n,o){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===o)break;e=e.return}}function Gf(e,n,o,s){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var y=h.dependencies;if(y!==null){var A=h.child;y=y.firstContext;e:for(;y!==null;){var k=y;y=h;for(var q=0;q<n.length;q++)if(k.context===n[q]){y.lanes|=o,k=y.alternate,k!==null&&(k.lanes|=o),$f(y.return,o,e),s||(A=null);break e}y=k.next}}else if(h.tag===18){if(A=h.return,A===null)throw Error(a(341));A.lanes|=o,y=A.alternate,y!==null&&(y.lanes|=o),$f(A,o,e),A=null}else A=h.child;if(A!==null)A.return=h;else for(A=h;A!==null;){if(A===e){A=null;break}if(h=A.sibling,h!==null){h.return=A.return,A=h;break}A=A.return}h=A}}function ds(e,n,o,s){e=null;for(var h=n,y=!1;h!==null;){if(!y){if((h.flags&524288)!==0)y=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var A=h.alternate;if(A===null)throw Error(a(387));if(A=A.memoizedProps,A!==null){var k=h.type;mn(h.pendingProps.value,A.value)||(e!==null?e.push(k):e=[k])}}else if(h===ge.current){if(A=h.alternate,A===null)throw Error(a(387));A.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(Ps):e=[Ps])}h=h.return}e!==null&&Gf(n,e,o,s),n.flags|=262144}function hc(e){for(e=e.firstContext;e!==null;){if(!mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Jo=e,Mr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zt(e){return ux(Jo,e)}function mc(e,n){return Jo===null&&ea(e),ux(e,n)}function ux(e,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},Mr===null){if(e===null)throw Error(a(308));Mr=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Mr=Mr.next=n;return o}var gN=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(o,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(o){return o()})}},yN=t.unstable_scheduleCallback,bN=t.unstable_NormalPriority,Rt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vf(){return{controller:new gN,data:new Map,refCount:0}}function fs(e){e.refCount--,e.refCount===0&&yN(bN,function(){e.controller.abort()})}var hs=null,qf=0,Za=0,Wa=null;function xN(e,n){if(hs===null){var o=hs=[];qf=0,Za=Xh(),Wa={status:"pending",value:void 0,then:function(s){o.push(s)}}}return qf++,n.then(dx,dx),n}function dx(){if(--qf===0&&hs!==null){Wa!==null&&(Wa.status="fulfilled");var e=hs;hs=null,Za=0,Wa=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function vN(e,n){var o=[],s={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var h=0;h<o.length;h++)(0,o[h])(n)},function(h){for(s.status="rejected",s.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),s}var fx=V.S;V.S=function(e,n){typeof n=="object"&&n!==null&&typeof n.then=="function"&&xN(e,n),fx!==null&&fx(e,n)};var ta=U(null);function Yf(){var e=ta.current;return e!==null?e:rt.pooledCache}function pc(e,n){n===null?Q(ta,ta.current):Q(ta,n.pool)}function hx(){var e=Yf();return e===null?null:{parent:Rt._currentValue,pool:e}}var ms=Error(a(460)),mx=Error(a(474)),gc=Error(a(542)),Xf={then:function(){}};function px(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yc(){}function gx(e,n,o){switch(o=e[o],o===void 0?e.push(n):o!==n&&(n.then(yc,yc),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,bx(e),e;default:if(typeof n.status=="string")n.then(yc,yc);else{if(e=rt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=s}},function(s){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,bx(e),e}throw ps=n,ms}}var ps=null;function yx(){if(ps===null)throw Error(a(459));var e=ps;return ps=null,e}function bx(e){if(e===ms||e===gc)throw Error(a(483))}var io=!1;function Kf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ff(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function so(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function lo(e,n,o){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Fe&2)!==0){var h=s.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),s.pending=n,n=cc(e),ox(e,null,o),n}return lc(e,s,n,o),cc(e)}function gs(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,Qi(e,o)}}function Qf(e,n){var o=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,o===s)){var h=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var A={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?h=y=A:y=y.next=A,o=o.next}while(o!==null);y===null?h=y=n:y=y.next=n}else h=y=n;o={baseState:s.baseState,firstBaseUpdate:h,lastBaseUpdate:y,shared:s.shared,callbacks:s.callbacks},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}var Zf=!1;function ys(){if(Zf){var e=Wa;if(e!==null)throw e}}function bs(e,n,o,s){Zf=!1;var h=e.updateQueue;io=!1;var y=h.firstBaseUpdate,A=h.lastBaseUpdate,k=h.shared.pending;if(k!==null){h.shared.pending=null;var q=k,W=q.next;q.next=null,A===null?y=W:A.next=W,A=q;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,k=oe.lastBaseUpdate,k!==A&&(k===null?oe.firstBaseUpdate=W:k.next=W,oe.lastBaseUpdate=q))}if(y!==null){var se=h.baseState;A=0,oe=W=q=null,k=y;do{var ee=k.lane&-536870913,ne=ee!==k.lane;if(ne?(Ge&ee)===ee:(s&ee)===ee){ee!==0&&ee===Za&&(Zf=!0),oe!==null&&(oe=oe.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ae=e,Ee=k;ee=n;var Je=o;switch(Ee.tag){case 1:if(Ae=Ee.payload,typeof Ae=="function"){se=Ae.call(Je,se,ee);break e}se=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Ee.payload,ee=typeof Ae=="function"?Ae.call(Je,se,ee):Ae,ee==null)break e;se=C({},se,ee);break e;case 2:io=!0}}ee=k.callback,ee!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=h.callbacks,ne===null?h.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:k.tag,payload:k.payload,callback:k.callback,next:null},oe===null?(W=oe=ne,q=se):oe=oe.next=ne,A|=ee;if(k=k.next,k===null){if(k=h.shared.pending,k===null)break;ne=k,k=ne.next,ne.next=null,h.lastBaseUpdate=ne,h.shared.pending=null}}while(!0);oe===null&&(q=se),h.baseState=q,h.firstBaseUpdate=W,h.lastBaseUpdate=oe,y===null&&(h.shared.lanes=0),yo|=A,e.lanes=A,e.memoizedState=se}}function xx(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function vx(e,n){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)xx(o[e],n)}var Ja=U(null),bc=U(0);function Sx(e,n){e=Hr,Q(bc,e),Q(Ja,n),Hr=e|n.baseLanes}function Wf(){Q(bc,Hr),Q(Ja,Ja.current)}function Jf(){Hr=bc.current,J(Ja),J(bc)}var co=0,Le=null,Ze=null,Ct=null,xc=!1,ei=!1,na=!1,vc=0,xs=0,ti=null,SN=0;function yt(){throw Error(a(321))}function eh(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!mn(e[o],n[o]))return!1;return!0}function th(e,n,o,s,h,y){return co=y,Le=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=e===null||e.memoizedState===null?ov:av,na=!1,y=o(s,h),na=!1,ei&&(y=wx(n,o,s,h)),Cx(e),y}function Cx(e){V.H=jc;var n=Ze!==null&&Ze.next!==null;if(co=0,Ct=Ze=Le=null,xc=!1,xs=0,ti=null,n)throw Error(a(300));e===null||Dt||(e=e.dependencies,e!==null&&hc(e)&&(Dt=!0))}function wx(e,n,o,s){Le=e;var h=0;do{if(ei&&(ti=null),xs=0,ei=!1,25<=h)throw Error(a(301));if(h+=1,Ct=Ze=null,e.updateQueue!=null){var y=e.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}V.H=RN,y=n(o,s)}while(ei);return y}function CN(){var e=V.H,n=e.useState()[0];return n=typeof n.then=="function"?vs(n):n,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(Le.flags|=1024),n}function nh(){var e=vc!==0;return vc=0,e}function rh(e,n,o){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~o}function oh(e){if(xc){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}xc=!1}co=0,Ct=Ze=Le=null,ei=!1,xs=vc=0,ti=null}function sn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Le.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function wt(){if(Ze===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var n=Ct===null?Le.memoizedState:Ct.next;if(n!==null)Ct=n,Ze=e;else{if(e===null)throw Le.alternate===null?Error(a(467)):Error(a(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},Ct===null?Le.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function ah(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vs(e){var n=xs;return xs+=1,ti===null&&(ti=[]),e=gx(ti,e,n),n=Le,(Ct===null?n.memoizedState:Ct.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?ov:av),e}function Sc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vs(e);if(e.$$typeof===R)return Zt(e)}throw Error(a(438,String(e)))}function ih(e){var n=null,o=Le.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var s=Le.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=ah(),Le.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(e),s=0;s<e;s++)o[s]=H;return n.index++,o}function Dr(e,n){return typeof n=="function"?n(e):n}function Cc(e){var n=wt();return sh(n,Ze,e)}function sh(e,n,o){var s=e.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=o;var h=e.baseQueue,y=s.pending;if(y!==null){if(h!==null){var A=h.next;h.next=y.next,y.next=A}n.baseQueue=h=y,s.pending=null}if(y=e.baseState,h===null)e.memoizedState=y;else{n=h.next;var k=A=null,q=null,W=n,oe=!1;do{var se=W.lane&-536870913;if(se!==W.lane?(Ge&se)===se:(co&se)===se){var ee=W.revertLane;if(ee===0)q!==null&&(q=q.next={lane:0,revertLane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),se===Za&&(oe=!0);else if((co&ee)===ee){W=W.next,ee===Za&&(oe=!0);continue}else se={lane:0,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},q===null?(k=q=se,A=y):q=q.next=se,Le.lanes|=ee,yo|=ee;se=W.action,na&&o(y,se),y=W.hasEagerState?W.eagerState:o(y,se)}else ee={lane:se,revertLane:W.revertLane,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},q===null?(k=q=ee,A=y):q=q.next=ee,Le.lanes|=se,yo|=se;W=W.next}while(W!==null&&W!==n);if(q===null?A=y:q.next=k,!mn(y,e.memoizedState)&&(Dt=!0,oe&&(o=Wa,o!==null)))throw o;e.memoizedState=y,e.baseState=A,e.baseQueue=q,s.lastRenderedState=y}return h===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function lh(e){var n=wt(),o=n.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=e;var s=o.dispatch,h=o.pending,y=n.memoizedState;if(h!==null){o.pending=null;var A=h=h.next;do y=e(y,A.action),A=A.next;while(A!==h);mn(y,n.memoizedState)||(Dt=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),o.lastRenderedState=y}return[y,s]}function Ex(e,n,o){var s=Le,h=wt(),y=Ke;if(y){if(o===void 0)throw Error(a(407));o=o()}else o=n();var A=!mn((Ze||h).memoizedState,o);A&&(h.memoizedState=o,Dt=!0),h=h.queue;var k=Ax.bind(null,s,h,e);if(Ss(2048,8,k,[e]),h.getSnapshot!==n||A||Ct!==null&&Ct.memoizedState.tag&1){if(s.flags|=2048,ni(9,wc(),jx.bind(null,s,h,o,n),null),rt===null)throw Error(a(349));y||(co&124)!==0||Tx(s,n,o)}return o}function Tx(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Le.updateQueue,n===null?(n=ah(),Le.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function jx(e,n,o,s){n.value=o,n.getSnapshot=s,Rx(n)&&Ox(e)}function Ax(e,n,o){return o(function(){Rx(n)&&Ox(e)})}function Rx(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!mn(e,o)}catch{return!0}}function Ox(e){var n=Xa(e,2);n!==null&&vn(n,e,2)}function ch(e){var n=sn();if(typeof e=="function"){var o=e;if(e=o(),na){Rn(!0);try{o()}finally{Rn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:e},n}function Nx(e,n,o,s){return e.baseState=o,sh(e,Ze,typeof s=="function"?s:Dr)}function wN(e,n,o,s,h){if(Tc(e))throw Error(a(485));if(e=n.action,e!==null){var y={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){y.listeners.push(A)}};V.T!==null?o(!0):y.isTransition=!1,s(y),o=n.pending,o===null?(y.next=n.pending=y,Mx(n,y)):(y.next=o.next,n.pending=o.next=y)}}function Mx(e,n){var o=n.action,s=n.payload,h=e.state;if(n.isTransition){var y=V.T,A={};V.T=A;try{var k=o(h,s),q=V.S;q!==null&&q(A,k),_x(e,n,k)}catch(W){uh(e,n,W)}finally{V.T=y}}else try{y=o(h,s),_x(e,n,y)}catch(W){uh(e,n,W)}}function _x(e,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(s){Dx(e,n,s)},function(s){return uh(e,n,s)}):Dx(e,n,o)}function Dx(e,n,o){n.status="fulfilled",n.value=o,Ix(n),e.state=o,n=e.pending,n!==null&&(o=n.next,o===n?e.pending=null:(o=o.next,n.next=o,Mx(e,o)))}function uh(e,n,o){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=o,Ix(n),n=n.next;while(n!==s)}e.action=null}function Ix(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function kx(e,n){return n}function Lx(e,n){if(Ke){var o=rt.formState;if(o!==null){e:{var s=Le;if(Ke){if(mt){t:{for(var h=mt,y=or;h.nodeType!==8;){if(!y){h=null;break t}if(h=Yn(h.nextSibling),h===null){h=null;break t}}y=h.data,h=y==="F!"||y==="F"?h:null}if(h){mt=Yn(h.nextSibling),s=h.data==="F!";break e}}Wo(s)}s=!1}s&&(n=o[0])}}return o=sn(),o.memoizedState=o.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kx,lastRenderedState:n},o.queue=s,o=tv.bind(null,Le,s),s.dispatch=o,s=ch(!1),y=ph.bind(null,Le,!1,s.queue),s=sn(),h={state:n,dispatch:null,action:e,pending:null},s.queue=h,o=wN.bind(null,Le,h,y,o),h.dispatch=o,s.memoizedState=e,[n,o,!1]}function zx(e){var n=wt();return Bx(n,Ze,e)}function Bx(e,n,o){if(n=sh(e,n,kx)[0],e=Cc(Dr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=vs(n)}catch(A){throw A===ms?gc:A}else s=n;n=wt();var h=n.queue,y=h.dispatch;return o!==n.memoizedState&&(Le.flags|=2048,ni(9,wc(),EN.bind(null,h,o),null)),[s,y,e]}function EN(e,n){e.action=n}function Hx(e){var n=wt(),o=Ze;if(o!==null)return Bx(n,o,e);wt(),n=n.memoizedState,o=wt();var s=o.queue.dispatch;return o.memoizedState=e,[n,s,!1]}function ni(e,n,o,s){return e={tag:e,create:o,deps:s,inst:n,next:null},n=Le.updateQueue,n===null&&(n=ah(),Le.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=e.next=e:(s=o.next,o.next=e,e.next=s,n.lastEffect=e),e}function wc(){return{destroy:void 0,resource:void 0}}function Px(){return wt().memoizedState}function Ec(e,n,o,s){var h=sn();s=s===void 0?null:s,Le.flags|=e,h.memoizedState=ni(1|n,wc(),o,s)}function Ss(e,n,o,s){var h=wt();s=s===void 0?null:s;var y=h.memoizedState.inst;Ze!==null&&s!==null&&eh(s,Ze.memoizedState.deps)?h.memoizedState=ni(n,y,o,s):(Le.flags|=e,h.memoizedState=ni(1|n,y,o,s))}function Ux(e,n){Ec(8390656,8,e,n)}function $x(e,n){Ss(2048,8,e,n)}function Gx(e,n){return Ss(4,2,e,n)}function Vx(e,n){return Ss(4,4,e,n)}function qx(e,n){if(typeof n=="function"){e=e();var o=n(e);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Yx(e,n,o){o=o!=null?o.concat([e]):null,Ss(4,4,qx.bind(null,n,e),o)}function dh(){}function Xx(e,n){var o=wt();n=n===void 0?null:n;var s=o.memoizedState;return n!==null&&eh(n,s[1])?s[0]:(o.memoizedState=[e,n],e)}function Kx(e,n){var o=wt();n=n===void 0?null:n;var s=o.memoizedState;if(n!==null&&eh(n,s[1]))return s[0];if(s=e(),na){Rn(!0);try{e()}finally{Rn(!1)}}return o.memoizedState=[s,n],s}function fh(e,n,o){return o===void 0||(co&1073741824)!==0?e.memoizedState=n:(e.memoizedState=o,e=Zv(),Le.lanes|=e,yo|=e,o)}function Fx(e,n,o,s){return mn(o,n)?o:Ja.current!==null?(e=fh(e,o,s),mn(e,n)||(Dt=!0),e):(co&42)===0?(Dt=!0,e.memoizedState=o):(e=Zv(),Le.lanes|=e,yo|=e,n)}function Qx(e,n,o,s,h){var y=Y.p;Y.p=y!==0&&8>y?y:8;var A=V.T,k={};V.T=k,ph(e,!1,n,o);try{var q=h(),W=V.S;if(W!==null&&W(k,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var oe=vN(q,s);Cs(e,n,oe,xn(e))}else Cs(e,n,s,xn(e))}catch(se){Cs(e,n,{then:function(){},status:"rejected",reason:se},xn())}finally{Y.p=y,V.T=A}}function TN(){}function hh(e,n,o,s){if(e.tag!==5)throw Error(a(476));var h=Zx(e).queue;Qx(e,h,n,L,o===null?TN:function(){return Wx(e),o(s)})}function Zx(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:L},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:o},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Wx(e){var n=Zx(e).next.queue;Cs(e,n,{},xn())}function mh(){return Zt(Ps)}function Jx(){return wt().memoizedState}function ev(){return wt().memoizedState}function jN(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var o=xn();e=so(o);var s=lo(n,e,o);s!==null&&(vn(s,n,o),gs(s,n,o)),n={cache:Vf()},e.payload=n;return}n=n.return}}function AN(e,n,o){var s=xn();o={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Tc(e)?nv(n,o):(o=If(e,n,o,s),o!==null&&(vn(o,e,s),rv(o,n,s)))}function tv(e,n,o){var s=xn();Cs(e,n,o,s)}function Cs(e,n,o,s){var h={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Tc(e))nv(n,h);else{var y=e.alternate;if(e.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null))try{var A=n.lastRenderedState,k=y(A,o);if(h.hasEagerState=!0,h.eagerState=k,mn(k,A))return lc(e,n,h,0),rt===null&&sc(),!1}catch{}finally{}if(o=If(e,n,h,s),o!==null)return vn(o,e,s),rv(o,n,s),!0}return!1}function ph(e,n,o,s){if(s={lane:2,revertLane:Xh(),action:s,hasEagerState:!1,eagerState:null,next:null},Tc(e)){if(n)throw Error(a(479))}else n=If(e,o,s,2),n!==null&&vn(n,e,2)}function Tc(e){var n=e.alternate;return e===Le||n!==null&&n===Le}function nv(e,n){ei=xc=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function rv(e,n,o){if((o&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,Qi(e,o)}}var jc={readContext:Zt,use:Sc,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt},ov={readContext:Zt,use:Sc,useCallback:function(e,n){return sn().memoizedState=[e,n===void 0?null:n],e},useContext:Zt,useEffect:Ux,useImperativeHandle:function(e,n,o){o=o!=null?o.concat([e]):null,Ec(4194308,4,qx.bind(null,n,e),o)},useLayoutEffect:function(e,n){return Ec(4194308,4,e,n)},useInsertionEffect:function(e,n){Ec(4,2,e,n)},useMemo:function(e,n){var o=sn();n=n===void 0?null:n;var s=e();if(na){Rn(!0);try{e()}finally{Rn(!1)}}return o.memoizedState=[s,n],s},useReducer:function(e,n,o){var s=sn();if(o!==void 0){var h=o(n);if(na){Rn(!0);try{o(n)}finally{Rn(!1)}}}else h=n;return s.memoizedState=s.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},s.queue=e,e=e.dispatch=AN.bind(null,Le,e),[s.memoizedState,e]},useRef:function(e){var n=sn();return e={current:e},n.memoizedState=e},useState:function(e){e=ch(e);var n=e.queue,o=tv.bind(null,Le,n);return n.dispatch=o,[e.memoizedState,o]},useDebugValue:dh,useDeferredValue:function(e,n){var o=sn();return fh(o,e,n)},useTransition:function(){var e=ch(!1);return e=Qx.bind(null,Le,e.queue,!0,!1),sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,o){var s=Le,h=sn();if(Ke){if(o===void 0)throw Error(a(407));o=o()}else{if(o=n(),rt===null)throw Error(a(349));(Ge&124)!==0||Tx(s,n,o)}h.memoizedState=o;var y={value:o,getSnapshot:n};return h.queue=y,Ux(Ax.bind(null,s,y,e),[e]),s.flags|=2048,ni(9,wc(),jx.bind(null,s,y,o,n),null),o},useId:function(){var e=sn(),n=rt.identifierPrefix;if(Ke){var o=Nr,s=Or;o=(s&~(1<<32-Ht(s)-1)).toString(32)+o,n="«"+n+"R"+o,o=vc++,0<o&&(n+="H"+o.toString(32)),n+="»"}else o=SN++,n="«"+n+"r"+o.toString(32)+"»";return e.memoizedState=n},useHostTransitionStatus:mh,useFormState:Lx,useActionState:Lx,useOptimistic:function(e){var n=sn();n.memoizedState=n.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=ph.bind(null,Le,!0,o),o.dispatch=n,[e,n]},useMemoCache:ih,useCacheRefresh:function(){return sn().memoizedState=jN.bind(null,Le)}},av={readContext:Zt,use:Sc,useCallback:Xx,useContext:Zt,useEffect:$x,useImperativeHandle:Yx,useInsertionEffect:Gx,useLayoutEffect:Vx,useMemo:Kx,useReducer:Cc,useRef:Px,useState:function(){return Cc(Dr)},useDebugValue:dh,useDeferredValue:function(e,n){var o=wt();return Fx(o,Ze.memoizedState,e,n)},useTransition:function(){var e=Cc(Dr)[0],n=wt().memoizedState;return[typeof e=="boolean"?e:vs(e),n]},useSyncExternalStore:Ex,useId:Jx,useHostTransitionStatus:mh,useFormState:zx,useActionState:zx,useOptimistic:function(e,n){var o=wt();return Nx(o,Ze,e,n)},useMemoCache:ih,useCacheRefresh:ev},RN={readContext:Zt,use:Sc,useCallback:Xx,useContext:Zt,useEffect:$x,useImperativeHandle:Yx,useInsertionEffect:Gx,useLayoutEffect:Vx,useMemo:Kx,useReducer:lh,useRef:Px,useState:function(){return lh(Dr)},useDebugValue:dh,useDeferredValue:function(e,n){var o=wt();return Ze===null?fh(o,e,n):Fx(o,Ze.memoizedState,e,n)},useTransition:function(){var e=lh(Dr)[0],n=wt().memoizedState;return[typeof e=="boolean"?e:vs(e),n]},useSyncExternalStore:Ex,useId:Jx,useHostTransitionStatus:mh,useFormState:Hx,useActionState:Hx,useOptimistic:function(e,n){var o=wt();return Ze!==null?Nx(o,Ze,e,n):(o.baseState=e,[e,o.queue.dispatch])},useMemoCache:ih,useCacheRefresh:ev},ri=null,ws=0;function Ac(e){var n=ws;return ws+=1,ri===null&&(ri=[]),gx(ri,e,n)}function Es(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Rc(e,n){throw n.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function iv(e){var n=e._init;return n(e._payload)}function sv(e){function n(F,K){if(e){var Z=F.deletions;Z===null?(F.deletions=[K],F.flags|=16):Z.push(K)}}function o(F,K){if(!e)return null;for(;K!==null;)n(F,K),K=K.sibling;return null}function s(F){for(var K=new Map;F!==null;)F.key!==null?K.set(F.key,F):K.set(F.index,F),F=F.sibling;return K}function h(F,K){return F=Rr(F,K),F.index=0,F.sibling=null,F}function y(F,K,Z){return F.index=Z,e?(Z=F.alternate,Z!==null?(Z=Z.index,Z<K?(F.flags|=67108866,K):Z):(F.flags|=67108866,K)):(F.flags|=1048576,K)}function A(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function k(F,K,Z,ie){return K===null||K.tag!==6?(K=Lf(Z,F.mode,ie),K.return=F,K):(K=h(K,Z),K.return=F,K)}function q(F,K,Z,ie){var pe=Z.type;return pe===v?oe(F,K,Z.props.children,ie,Z.key):K!==null&&(K.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===I&&iv(pe)===K.type)?(K=h(K,Z.props),Es(K,Z),K.return=F,K):(K=uc(Z.type,Z.key,Z.props,null,F.mode,ie),Es(K,Z),K.return=F,K)}function W(F,K,Z,ie){return K===null||K.tag!==4||K.stateNode.containerInfo!==Z.containerInfo||K.stateNode.implementation!==Z.implementation?(K=zf(Z,F.mode,ie),K.return=F,K):(K=h(K,Z.children||[]),K.return=F,K)}function oe(F,K,Z,ie,pe){return K===null||K.tag!==7?(K=Ko(Z,F.mode,ie,pe),K.return=F,K):(K=h(K,Z),K.return=F,K)}function se(F,K,Z){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Lf(""+K,F.mode,Z),K.return=F,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case b:return Z=uc(K.type,K.key,K.props,null,F.mode,Z),Es(Z,K),Z.return=F,Z;case x:return K=zf(K,F.mode,Z),K.return=F,K;case I:var ie=K._init;return K=ie(K._payload),se(F,K,Z)}if(te(K)||$(K))return K=Ko(K,F.mode,Z,null),K.return=F,K;if(typeof K.then=="function")return se(F,Ac(K),Z);if(K.$$typeof===R)return se(F,mc(F,K),Z);Rc(F,K)}return null}function ee(F,K,Z,ie){var pe=K!==null?K.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return pe!==null?null:k(F,K,""+Z,ie);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===pe?q(F,K,Z,ie):null;case x:return Z.key===pe?W(F,K,Z,ie):null;case I:return pe=Z._init,Z=pe(Z._payload),ee(F,K,Z,ie)}if(te(Z)||$(Z))return pe!==null?null:oe(F,K,Z,ie,null);if(typeof Z.then=="function")return ee(F,K,Ac(Z),ie);if(Z.$$typeof===R)return ee(F,K,mc(F,Z),ie);Rc(F,Z)}return null}function ne(F,K,Z,ie,pe){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return F=F.get(Z)||null,k(K,F,""+ie,pe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:return F=F.get(ie.key===null?Z:ie.key)||null,q(K,F,ie,pe);case x:return F=F.get(ie.key===null?Z:ie.key)||null,W(K,F,ie,pe);case I:var ze=ie._init;return ie=ze(ie._payload),ne(F,K,Z,ie,pe)}if(te(ie)||$(ie))return F=F.get(Z)||null,oe(K,F,ie,pe,null);if(typeof ie.then=="function")return ne(F,K,Z,Ac(ie),pe);if(ie.$$typeof===R)return ne(F,K,Z,mc(K,ie),pe);Rc(K,ie)}return null}function Ae(F,K,Z,ie){for(var pe=null,ze=null,be=K,Te=K=0,kt=null;be!==null&&Te<Z.length;Te++){be.index>Te?(kt=be,be=null):kt=be.sibling;var Xe=ee(F,be,Z[Te],ie);if(Xe===null){be===null&&(be=kt);break}e&&be&&Xe.alternate===null&&n(F,be),K=y(Xe,K,Te),ze===null?pe=Xe:ze.sibling=Xe,ze=Xe,be=kt}if(Te===Z.length)return o(F,be),Ke&&Qo(F,Te),pe;if(be===null){for(;Te<Z.length;Te++)be=se(F,Z[Te],ie),be!==null&&(K=y(be,K,Te),ze===null?pe=be:ze.sibling=be,ze=be);return Ke&&Qo(F,Te),pe}for(be=s(be);Te<Z.length;Te++)kt=ne(be,F,Te,Z[Te],ie),kt!==null&&(e&&kt.alternate!==null&&be.delete(kt.key===null?Te:kt.key),K=y(kt,K,Te),ze===null?pe=kt:ze.sibling=kt,ze=kt);return e&&be.forEach(function(jo){return n(F,jo)}),Ke&&Qo(F,Te),pe}function Ee(F,K,Z,ie){if(Z==null)throw Error(a(151));for(var pe=null,ze=null,be=K,Te=K=0,kt=null,Xe=Z.next();be!==null&&!Xe.done;Te++,Xe=Z.next()){be.index>Te?(kt=be,be=null):kt=be.sibling;var jo=ee(F,be,Xe.value,ie);if(jo===null){be===null&&(be=kt);break}e&&be&&jo.alternate===null&&n(F,be),K=y(jo,K,Te),ze===null?pe=jo:ze.sibling=jo,ze=jo,be=kt}if(Xe.done)return o(F,be),Ke&&Qo(F,Te),pe;if(be===null){for(;!Xe.done;Te++,Xe=Z.next())Xe=se(F,Xe.value,ie),Xe!==null&&(K=y(Xe,K,Te),ze===null?pe=Xe:ze.sibling=Xe,ze=Xe);return Ke&&Qo(F,Te),pe}for(be=s(be);!Xe.done;Te++,Xe=Z.next())Xe=ne(be,F,Te,Xe.value,ie),Xe!==null&&(e&&Xe.alternate!==null&&be.delete(Xe.key===null?Te:Xe.key),K=y(Xe,K,Te),ze===null?pe=Xe:ze.sibling=Xe,ze=Xe);return e&&be.forEach(function(OM){return n(F,OM)}),Ke&&Qo(F,Te),pe}function Je(F,K,Z,ie){if(typeof Z=="object"&&Z!==null&&Z.type===v&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var pe=Z.key;K!==null;){if(K.key===pe){if(pe=Z.type,pe===v){if(K.tag===7){o(F,K.sibling),ie=h(K,Z.props.children),ie.return=F,F=ie;break e}}else if(K.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===I&&iv(pe)===K.type){o(F,K.sibling),ie=h(K,Z.props),Es(ie,Z),ie.return=F,F=ie;break e}o(F,K);break}else n(F,K);K=K.sibling}Z.type===v?(ie=Ko(Z.props.children,F.mode,ie,Z.key),ie.return=F,F=ie):(ie=uc(Z.type,Z.key,Z.props,null,F.mode,ie),Es(ie,Z),ie.return=F,F=ie)}return A(F);case x:e:{for(pe=Z.key;K!==null;){if(K.key===pe)if(K.tag===4&&K.stateNode.containerInfo===Z.containerInfo&&K.stateNode.implementation===Z.implementation){o(F,K.sibling),ie=h(K,Z.children||[]),ie.return=F,F=ie;break e}else{o(F,K);break}else n(F,K);K=K.sibling}ie=zf(Z,F.mode,ie),ie.return=F,F=ie}return A(F);case I:return pe=Z._init,Z=pe(Z._payload),Je(F,K,Z,ie)}if(te(Z))return Ae(F,K,Z,ie);if($(Z)){if(pe=$(Z),typeof pe!="function")throw Error(a(150));return Z=pe.call(Z),Ee(F,K,Z,ie)}if(typeof Z.then=="function")return Je(F,K,Ac(Z),ie);if(Z.$$typeof===R)return Je(F,K,mc(F,Z),ie);Rc(F,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,K!==null&&K.tag===6?(o(F,K.sibling),ie=h(K,Z),ie.return=F,F=ie):(o(F,K),ie=Lf(Z,F.mode,ie),ie.return=F,F=ie),A(F)):o(F,K)}return function(F,K,Z,ie){try{ws=0;var pe=Je(F,K,Z,ie);return ri=null,pe}catch(be){if(be===ms||be===gc)throw be;var ze=pn(29,be,null,F.mode);return ze.lanes=ie,ze.return=F,ze}finally{}}}var oi=sv(!0),lv=sv(!1),Ln=U(null),ar=null;function uo(e){var n=e.alternate;Q(Ot,Ot.current&1),Q(Ln,e),ar===null&&(n===null||Ja.current!==null||n.memoizedState!==null)&&(ar=e)}function cv(e){if(e.tag===22){if(Q(Ot,Ot.current),Q(Ln,e),ar===null){var n=e.alternate;n!==null&&n.memoizedState!==null&&(ar=e)}}else fo()}function fo(){Q(Ot,Ot.current),Q(Ln,Ln.current)}function Ir(e){J(Ln),ar===e&&(ar=null),J(Ot)}var Ot=U(0);function Oc(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||am(o)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function gh(e,n,o,s){n=e.memoizedState,o=o(s,n),o=o==null?n:C({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var yh={enqueueSetState:function(e,n,o){e=e._reactInternals;var s=xn(),h=so(s);h.payload=n,o!=null&&(h.callback=o),n=lo(e,h,s),n!==null&&(vn(n,e,s),gs(n,e,s))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var s=xn(),h=so(s);h.tag=1,h.payload=n,o!=null&&(h.callback=o),n=lo(e,h,s),n!==null&&(vn(n,e,s),gs(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=xn(),s=so(o);s.tag=2,n!=null&&(s.callback=n),n=lo(e,s,o),n!==null&&(vn(n,e,o),gs(n,e,o))}};function uv(e,n,o,s,h,y,A){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,y,A):n.prototype&&n.prototype.isPureReactComponent?!is(o,s)||!is(h,y):!0}function dv(e,n,o,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,s),n.state!==e&&yh.enqueueReplaceState(n,n.state,null)}function ra(e,n){var o=n;if("ref"in n){o={};for(var s in n)s!=="ref"&&(o[s]=n[s])}if(e=e.defaultProps){o===n&&(o=C({},o));for(var h in e)o[h]===void 0&&(o[h]=e[h])}return o}var Nc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function fv(e){Nc(e)}function hv(e){console.error(e)}function mv(e){Nc(e)}function Mc(e,n){try{var o=e.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function pv(e,n,o){try{var s=e.onCaughtError;s(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function bh(e,n,o){return o=so(o),o.tag=3,o.payload={element:null},o.callback=function(){Mc(e,n)},o}function gv(e){return e=so(e),e.tag=3,e}function yv(e,n,o,s){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var y=s.value;e.payload=function(){return h(y)},e.callback=function(){pv(n,o,s)}}var A=o.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(e.callback=function(){pv(n,o,s),typeof h!="function"&&(bo===null?bo=new Set([this]):bo.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function ON(e,n,o,s,h){if(o.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=o.alternate,n!==null&&ds(n,o,h,!0),o=Ln.current,o!==null){switch(o.tag){case 13:return ar===null?$h():o.alternate===null&&pt===0&&(pt=3),o.flags&=-257,o.flags|=65536,o.lanes=h,s===Xf?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([s]):n.add(s),Vh(e,s,h)),!1;case 22:return o.flags|=65536,s===Xf?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([s]):o.add(s)),Vh(e,s,h)),!1}throw Error(a(435,o.tag))}return Vh(e,s,h),$h(),!1}if(Ke)return n=Ln.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,s!==Pf&&(e=Error(a(422),{cause:s}),us(_n(e,o)))):(s!==Pf&&(n=Error(a(423),{cause:s}),us(_n(n,o))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,s=_n(s,o),h=bh(e.stateNode,s,h),Qf(e,h),pt!==4&&(pt=2)),!1;var y=Error(a(520),{cause:s});if(y=_n(y,o),Ms===null?Ms=[y]:Ms.push(y),pt!==4&&(pt=2),n===null)return!0;s=_n(s,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,e=h&-h,o.lanes|=e,e=bh(o.stateNode,s,e),Qf(o,e),!1;case 1:if(n=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(bo===null||!bo.has(y))))return o.flags|=65536,h&=-h,o.lanes|=h,h=gv(h),yv(h,e,o,s),Qf(o,h),!1}o=o.return}while(o!==null);return!1}var bv=Error(a(461)),Dt=!1;function Pt(e,n,o,s){n.child=e===null?lv(n,null,o,s):oi(n,e.child,o,s)}function xv(e,n,o,s,h){o=o.render;var y=n.ref;if("ref"in s){var A={};for(var k in s)k!=="ref"&&(A[k]=s[k])}else A=s;return ea(n),s=th(e,n,o,A,y,h),k=nh(),e!==null&&!Dt?(rh(e,n,h),kr(e,n,h)):(Ke&&k&&Bf(n),n.flags|=1,Pt(e,n,s,h),n.child)}function vv(e,n,o,s,h){if(e===null){var y=o.type;return typeof y=="function"&&!kf(y)&&y.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=y,Sv(e,n,y,s,h)):(e=uc(o.type,null,s,n,n.mode,h),e.ref=n.ref,e.return=n,n.child=e)}if(y=e.child,!jh(e,h)){var A=y.memoizedProps;if(o=o.compare,o=o!==null?o:is,o(A,s)&&e.ref===n.ref)return kr(e,n,h)}return n.flags|=1,e=Rr(y,s),e.ref=n.ref,e.return=n,n.child=e}function Sv(e,n,o,s,h){if(e!==null){var y=e.memoizedProps;if(is(y,s)&&e.ref===n.ref)if(Dt=!1,n.pendingProps=s=y,jh(e,h))(e.flags&131072)!==0&&(Dt=!0);else return n.lanes=e.lanes,kr(e,n,h)}return xh(e,n,o,s,h)}function Cv(e,n,o){var s=n.pendingProps,h=s.children,y=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if((n.flags&128)!==0){if(s=y!==null?y.baseLanes|o:o,e!==null){for(h=n.child=e.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;n.childLanes=y&~s}else n.childLanes=0,n.child=null;return wv(e,n,s,o)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&pc(n,y!==null?y.cachePool:null),y!==null?Sx(n,y):Wf(),cv(n);else return n.lanes=n.childLanes=536870912,wv(e,n,y!==null?y.baseLanes|o:o,o)}else y!==null?(pc(n,y.cachePool),Sx(n,y),fo(),n.memoizedState=null):(e!==null&&pc(n,null),Wf(),fo());return Pt(e,n,h,o),n.child}function wv(e,n,o,s){var h=Yf();return h=h===null?null:{parent:Rt._currentValue,pool:h},n.memoizedState={baseLanes:o,cachePool:h},e!==null&&pc(n,null),Wf(),cv(n),e!==null&&ds(e,n,s,!0),null}function _c(e,n){var o=n.ref;if(o===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(e===null||e.ref!==o)&&(n.flags|=4194816)}}function xh(e,n,o,s,h){return ea(n),o=th(e,n,o,s,void 0,h),s=nh(),e!==null&&!Dt?(rh(e,n,h),kr(e,n,h)):(Ke&&s&&Bf(n),n.flags|=1,Pt(e,n,o,h),n.child)}function Ev(e,n,o,s,h,y){return ea(n),n.updateQueue=null,o=wx(n,s,o,h),Cx(e),s=nh(),e!==null&&!Dt?(rh(e,n,y),kr(e,n,y)):(Ke&&s&&Bf(n),n.flags|=1,Pt(e,n,o,y),n.child)}function Tv(e,n,o,s,h){if(ea(n),n.stateNode===null){var y=Ka,A=o.contextType;typeof A=="object"&&A!==null&&(y=Zt(A)),y=new o(s,y),n.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=yh,n.stateNode=y,y._reactInternals=n,y=n.stateNode,y.props=s,y.state=n.memoizedState,y.refs={},Kf(n),A=o.contextType,y.context=typeof A=="object"&&A!==null?Zt(A):Ka,y.state=n.memoizedState,A=o.getDerivedStateFromProps,typeof A=="function"&&(gh(n,o,A,s),y.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(A=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),A!==y.state&&yh.enqueueReplaceState(y,y.state,null),bs(n,s,y,h),ys(),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){y=n.stateNode;var k=n.memoizedProps,q=ra(o,k);y.props=q;var W=y.context,oe=o.contextType;A=Ka,typeof oe=="object"&&oe!==null&&(A=Zt(oe));var se=o.getDerivedStateFromProps;oe=typeof se=="function"||typeof y.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,oe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k||W!==A)&&dv(n,y,s,A),io=!1;var ee=n.memoizedState;y.state=ee,bs(n,s,y,h),ys(),W=n.memoizedState,k||ee!==W||io?(typeof se=="function"&&(gh(n,o,se,s),W=n.memoizedState),(q=io||uv(n,o,q,s,ee,W,A))?(oe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(n.flags|=4194308)):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=W),y.props=s,y.state=W,y.context=A,s=q):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{y=n.stateNode,Ff(e,n),A=n.memoizedProps,oe=ra(o,A),y.props=oe,se=n.pendingProps,ee=y.context,W=o.contextType,q=Ka,typeof W=="object"&&W!==null&&(q=Zt(W)),k=o.getDerivedStateFromProps,(W=typeof k=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(A!==se||ee!==q)&&dv(n,y,s,q),io=!1,ee=n.memoizedState,y.state=ee,bs(n,s,y,h),ys();var ne=n.memoizedState;A!==se||ee!==ne||io||e!==null&&e.dependencies!==null&&hc(e.dependencies)?(typeof k=="function"&&(gh(n,o,k,s),ne=n.memoizedState),(oe=io||uv(n,o,oe,s,ee,ne,q)||e!==null&&e.dependencies!==null&&hc(e.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(s,ne,q),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(s,ne,q)),typeof y.componentDidUpdate=="function"&&(n.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof y.componentDidUpdate!="function"||A===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=ne),y.props=s,y.state=ne,y.context=q,s=oe):(typeof y.componentDidUpdate!="function"||A===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),s=!1)}return y=s,_c(e,n),s=(n.flags&128)!==0,y||s?(y=n.stateNode,o=s&&typeof o.getDerivedStateFromError!="function"?null:y.render(),n.flags|=1,e!==null&&s?(n.child=oi(n,e.child,null,h),n.child=oi(n,null,o,h)):Pt(e,n,o,h),n.memoizedState=y.state,e=n.child):e=kr(e,n,h),e}function jv(e,n,o,s){return cs(),n.flags|=256,Pt(e,n,o,s),n.child}var vh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sh(e){return{baseLanes:e,cachePool:hx()}}function Ch(e,n,o){return e=e!==null?e.childLanes&~o:0,n&&(e|=zn),e}function Av(e,n,o){var s=n.pendingProps,h=!1,y=(n.flags&128)!==0,A;if((A=y)||(A=e!==null&&e.memoizedState===null?!1:(Ot.current&2)!==0),A&&(h=!0,n.flags&=-129),A=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ke){if(h?uo(n):fo(),Ke){var k=mt,q;if(q=k){e:{for(q=k,k=or;q.nodeType!==8;){if(!k){k=null;break e}if(q=Yn(q.nextSibling),q===null){k=null;break e}}k=q}k!==null?(n.memoizedState={dehydrated:k,treeContext:Fo!==null?{id:Or,overflow:Nr}:null,retryLane:536870912,hydrationErrors:null},q=pn(18,null,null,0),q.stateNode=k,q.return=n,n.child=q,tn=n,mt=null,q=!0):q=!1}q||Wo(n)}if(k=n.memoizedState,k!==null&&(k=k.dehydrated,k!==null))return am(k)?n.lanes=32:n.lanes=536870912,null;Ir(n)}return k=s.children,s=s.fallback,h?(fo(),h=n.mode,k=Dc({mode:"hidden",children:k},h),s=Ko(s,h,o,null),k.return=n,s.return=n,k.sibling=s,n.child=k,h=n.child,h.memoizedState=Sh(o),h.childLanes=Ch(e,A,o),n.memoizedState=vh,s):(uo(n),wh(n,k))}if(q=e.memoizedState,q!==null&&(k=q.dehydrated,k!==null)){if(y)n.flags&256?(uo(n),n.flags&=-257,n=Eh(e,n,o)):n.memoizedState!==null?(fo(),n.child=e.child,n.flags|=128,n=null):(fo(),h=s.fallback,k=n.mode,s=Dc({mode:"visible",children:s.children},k),h=Ko(h,k,o,null),h.flags|=2,s.return=n,h.return=n,s.sibling=h,n.child=s,oi(n,e.child,null,o),s=n.child,s.memoizedState=Sh(o),s.childLanes=Ch(e,A,o),n.memoizedState=vh,n=h);else if(uo(n),am(k)){if(A=k.nextSibling&&k.nextSibling.dataset,A)var W=A.dgst;A=W,s=Error(a(419)),s.stack="",s.digest=A,us({value:s,source:null,stack:null}),n=Eh(e,n,o)}else if(Dt||ds(e,n,o,!1),A=(o&e.childLanes)!==0,Dt||A){if(A=rt,A!==null&&(s=o&-o,s=(s&42)!==0?1:_a(s),s=(s&(A.suspendedLanes|o))!==0?0:s,s!==0&&s!==q.retryLane))throw q.retryLane=s,Xa(e,s),vn(A,e,s),bv;k.data==="$?"||$h(),n=Eh(e,n,o)}else k.data==="$?"?(n.flags|=192,n.child=e.child,n=null):(e=q.treeContext,mt=Yn(k.nextSibling),tn=n,Ke=!0,Zo=null,or=!1,e!==null&&(In[kn++]=Or,In[kn++]=Nr,In[kn++]=Fo,Or=e.id,Nr=e.overflow,Fo=n),n=wh(n,s.children),n.flags|=4096);return n}return h?(fo(),h=s.fallback,k=n.mode,q=e.child,W=q.sibling,s=Rr(q,{mode:"hidden",children:s.children}),s.subtreeFlags=q.subtreeFlags&65011712,W!==null?h=Rr(W,h):(h=Ko(h,k,o,null),h.flags|=2),h.return=n,s.return=n,s.sibling=h,n.child=s,s=h,h=n.child,k=e.child.memoizedState,k===null?k=Sh(o):(q=k.cachePool,q!==null?(W=Rt._currentValue,q=q.parent!==W?{parent:W,pool:W}:q):q=hx(),k={baseLanes:k.baseLanes|o,cachePool:q}),h.memoizedState=k,h.childLanes=Ch(e,A,o),n.memoizedState=vh,s):(uo(n),o=e.child,e=o.sibling,o=Rr(o,{mode:"visible",children:s.children}),o.return=n,o.sibling=null,e!==null&&(A=n.deletions,A===null?(n.deletions=[e],n.flags|=16):A.push(e)),n.child=o,n.memoizedState=null,o)}function wh(e,n){return n=Dc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Dc(e,n){return e=pn(22,e,null,n),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Eh(e,n,o){return oi(n,e.child,null,o),e=wh(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Rv(e,n,o){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),$f(e.return,n,o)}function Th(e,n,o,s,h){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:o,tailMode:h}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=o,y.tailMode=h)}function Ov(e,n,o){var s=n.pendingProps,h=s.revealOrder,y=s.tail;if(Pt(e,n,s.children,o),s=Ot.current,(s&2)!==0)s=s&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rv(e,o,n);else if(e.tag===19)Rv(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}switch(Q(Ot,s),h){case"forwards":for(o=n.child,h=null;o!==null;)e=o.alternate,e!==null&&Oc(e)===null&&(h=o),o=o.sibling;o=h,o===null?(h=n.child,n.child=null):(h=o.sibling,o.sibling=null),Th(n,!1,h,o,y);break;case"backwards":for(o=null,h=n.child,n.child=null;h!==null;){if(e=h.alternate,e!==null&&Oc(e)===null){n.child=h;break}e=h.sibling,h.sibling=o,o=h,h=e}Th(n,!0,o,null,y);break;case"together":Th(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function kr(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),yo|=n.lanes,(o&n.childLanes)===0)if(e!==null){if(ds(e,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,o=Rr(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=Rr(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function jh(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&hc(e)))}function NN(e,n,o){switch(n.tag){case 3:je(n,n.stateNode.containerInfo),ao(n,Rt,e.memoizedState.cache),cs();break;case 27:case 5:de(n);break;case 4:je(n,n.stateNode.containerInfo);break;case 10:ao(n,n.type,n.memoizedProps.value);break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(uo(n),n.flags|=128,null):(o&n.child.childLanes)!==0?Av(e,n,o):(uo(n),e=kr(e,n,o),e!==null?e.sibling:null);uo(n);break;case 19:var h=(e.flags&128)!==0;if(s=(o&n.childLanes)!==0,s||(ds(e,n,o,!1),s=(o&n.childLanes)!==0),h){if(s)return Ov(e,n,o);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Q(Ot,Ot.current),s)break;return null;case 22:case 23:return n.lanes=0,Cv(e,n,o);case 24:ao(n,Rt,e.memoizedState.cache)}return kr(e,n,o)}function Nv(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps)Dt=!0;else{if(!jh(e,o)&&(n.flags&128)===0)return Dt=!1,NN(e,n,o);Dt=(e.flags&131072)!==0}else Dt=!1,Ke&&(n.flags&1048576)!==0&&ix(n,fc,n.index);switch(n.lanes=0,n.tag){case 16:e:{e=n.pendingProps;var s=n.elementType,h=s._init;if(s=h(s._payload),n.type=s,typeof s=="function")kf(s)?(e=ra(s,e),n.tag=1,n=Tv(null,n,s,e,o)):(n.tag=0,n=xh(null,n,s,e,o));else{if(s!=null){if(h=s.$$typeof,h===O){n.tag=11,n=xv(null,n,s,e,o);break e}else if(h===_){n.tag=14,n=vv(null,n,s,e,o);break e}}throw n=G(s)||s,Error(a(306,n,""))}}return n;case 0:return xh(e,n,n.type,n.pendingProps,o);case 1:return s=n.type,h=ra(s,n.pendingProps),Tv(e,n,s,h,o);case 3:e:{if(je(n,n.stateNode.containerInfo),e===null)throw Error(a(387));s=n.pendingProps;var y=n.memoizedState;h=y.element,Ff(e,n),bs(n,s,null,o);var A=n.memoizedState;if(s=A.cache,ao(n,Rt,s),s!==y.cache&&Gf(n,[Rt],o,!0),ys(),s=A.element,y.isDehydrated)if(y={element:s,isDehydrated:!1,cache:A.cache},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){n=jv(e,n,s,o);break e}else if(s!==h){h=_n(Error(a(424)),n),us(h),n=jv(e,n,s,o);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(mt=Yn(e.firstChild),tn=n,Ke=!0,Zo=null,or=!0,o=lv(n,null,s,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(cs(),s===h){n=kr(e,n,o);break e}Pt(e,n,s,o)}n=n.child}return n;case 26:return _c(e,n),e===null?(o=I1(n.type,null,n.pendingProps,null))?n.memoizedState=o:Ke||(o=n.type,e=n.pendingProps,s=Xc(ae.current).createElement(o),s[Qt]=n,s[on]=e,$t(s,o,e),_t(s),n.stateNode=s):n.memoizedState=I1(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return de(n),e===null&&Ke&&(s=n.stateNode=M1(n.type,n.pendingProps,ae.current),tn=n,or=!0,h=mt,So(n.type)?(im=h,mt=Yn(s.firstChild)):mt=h),Pt(e,n,n.pendingProps.children,o),_c(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ke&&((h=s=mt)&&(s=oM(s,n.type,n.pendingProps,or),s!==null?(n.stateNode=s,tn=n,mt=Yn(s.firstChild),or=!1,h=!0):h=!1),h||Wo(n)),de(n),h=n.type,y=n.pendingProps,A=e!==null?e.memoizedProps:null,s=y.children,nm(h,y)?s=null:A!==null&&nm(h,A)&&(n.flags|=32),n.memoizedState!==null&&(h=th(e,n,CN,null,null,o),Ps._currentValue=h),_c(e,n),Pt(e,n,s,o),n.child;case 6:return e===null&&Ke&&((e=o=mt)&&(o=aM(o,n.pendingProps,or),o!==null?(n.stateNode=o,tn=n,mt=null,e=!0):e=!1),e||Wo(n)),null;case 13:return Av(e,n,o);case 4:return je(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=oi(n,null,s,o):Pt(e,n,s,o),n.child;case 11:return xv(e,n,n.type,n.pendingProps,o);case 7:return Pt(e,n,n.pendingProps,o),n.child;case 8:return Pt(e,n,n.pendingProps.children,o),n.child;case 12:return Pt(e,n,n.pendingProps.children,o),n.child;case 10:return s=n.pendingProps,ao(n,n.type,s.value),Pt(e,n,s.children,o),n.child;case 9:return h=n.type._context,s=n.pendingProps.children,ea(n),h=Zt(h),s=s(h),n.flags|=1,Pt(e,n,s,o),n.child;case 14:return vv(e,n,n.type,n.pendingProps,o);case 15:return Sv(e,n,n.type,n.pendingProps,o);case 19:return Ov(e,n,o);case 31:return s=n.pendingProps,o=n.mode,s={mode:s.mode,children:s.children},e===null?(o=Dc(s,o),o.ref=n.ref,n.child=o,o.return=n,n=o):(o=Rr(e.child,s),o.ref=n.ref,n.child=o,o.return=n,n=o),n;case 22:return Cv(e,n,o);case 24:return ea(n),s=Zt(Rt),e===null?(h=Yf(),h===null&&(h=rt,y=Vf(),h.pooledCache=y,y.refCount++,y!==null&&(h.pooledCacheLanes|=o),h=y),n.memoizedState={parent:s,cache:h},Kf(n),ao(n,Rt,h)):((e.lanes&o)!==0&&(Ff(e,n),bs(n,null,null,o),ys()),h=e.memoizedState,y=n.memoizedState,h.parent!==s?(h={parent:s,cache:s},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),ao(n,Rt,s)):(s=y.cache,ao(n,Rt,s),s!==h.cache&&Gf(n,[Rt],o,!0))),Pt(e,n,n.pendingProps.children,o),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Lr(e){e.flags|=4}function Mv(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!H1(n)){if(n=Ln.current,n!==null&&((Ge&4194048)===Ge?ar!==null:(Ge&62914560)!==Ge&&(Ge&536870912)===0||n!==ar))throw ps=Xf,mx;e.flags|=8192}}function Ic(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?et():536870912,e.lanes|=n,li|=n)}function Ts(e,n){if(!Ke)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var s=null;o!==null;)o.alternate!==null&&(s=o),o=o.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function ut(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,s=0;if(n)for(var h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags&65011712,s|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags,s|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=s,e.childLanes=o,n}function MN(e,n,o){var s=n.pendingProps;switch(Hf(n),n.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(n),null;case 1:return ut(n),null;case 3:return o=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),_r(Rt),ye(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(ls(n)?Lr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,cx())),ut(n),null;case 26:return o=n.memoizedState,e===null?(Lr(n),o!==null?(ut(n),Mv(n,o)):(ut(n),n.flags&=-16777217)):o?o!==e.memoizedState?(Lr(n),ut(n),Mv(n,o)):(ut(n),n.flags&=-16777217):(e.memoizedProps!==s&&Lr(n),ut(n),n.flags&=-16777217),null;case 27:Me(n),o=ae.current;var h=n.type;if(e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Lr(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return ut(n),null}e=le.current,ls(n)?sx(n):(e=M1(h,s,o),n.stateNode=e,Lr(n))}return ut(n),null;case 5:if(Me(n),o=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Lr(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return ut(n),null}if(e=le.current,ls(n))sx(n);else{switch(h=Xc(ae.current),e){case 1:e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}e[Qt]=n,e[on]=s;e:for(h=n.child;h!==null;){if(h.tag===5||h.tag===6)e.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}n.stateNode=e;e:switch($t(e,o,s),o){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Lr(n)}}return ut(n),n.flags&=-16777217,null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Lr(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=ae.current,ls(n)){if(e=n.stateNode,o=n.memoizedProps,s=null,h=tn,h!==null)switch(h.tag){case 27:case 5:s=h.memoizedProps}e[Qt]=n,e=!!(e.nodeValue===o||s!==null&&s.suppressHydrationWarning===!0||E1(e.nodeValue,o)),e||Wo(n)}else e=Xc(e).createTextNode(s),e[Qt]=n,n.stateNode=e}return ut(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=ls(n),s!==null&&s.dehydrated!==null){if(e===null){if(!h)throw Error(a(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Qt]=n}else cs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ut(n),h=!1}else h=cx(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(Ir(n),n):(Ir(n),null)}if(Ir(n),(n.flags&128)!==0)return n.lanes=o,n;if(o=s!==null,e=e!==null&&e.memoizedState!==null,o){s=n.child,h=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(h=s.alternate.memoizedState.cachePool.pool);var y=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==h&&(s.flags|=2048)}return o!==e&&o&&(n.child.flags|=8192),Ic(n,n.updateQueue),ut(n),null;case 4:return ye(),e===null&&Zh(n.stateNode.containerInfo),ut(n),null;case 10:return _r(n.type),ut(n),null;case 19:if(J(Ot),h=n.memoizedState,h===null)return ut(n),null;if(s=(n.flags&128)!==0,y=h.rendering,y===null)if(s)Ts(h,!1);else{if(pt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(y=Oc(e),y!==null){for(n.flags|=128,Ts(h,!1),e=y.updateQueue,n.updateQueue=e,Ic(n,e),n.subtreeFlags=0,e=o,o=n.child;o!==null;)ax(o,e),o=o.sibling;return Q(Ot,Ot.current&1|2),n.child}e=e.sibling}h.tail!==null&&ht()>zc&&(n.flags|=128,s=!0,Ts(h,!1),n.lanes=4194304)}else{if(!s)if(e=Oc(y),e!==null){if(n.flags|=128,s=!0,e=e.updateQueue,n.updateQueue=e,Ic(n,e),Ts(h,!0),h.tail===null&&h.tailMode==="hidden"&&!y.alternate&&!Ke)return ut(n),null}else 2*ht()-h.renderingStartTime>zc&&o!==536870912&&(n.flags|=128,s=!0,Ts(h,!1),n.lanes=4194304);h.isBackwards?(y.sibling=n.child,n.child=y):(e=h.last,e!==null?e.sibling=y:n.child=y,h.last=y)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=ht(),n.sibling=null,e=Ot.current,Q(Ot,s?e&1|2:e&1),n):(ut(n),null);case 22:case 23:return Ir(n),Jf(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(o&536870912)!==0&&(n.flags&128)===0&&(ut(n),n.subtreeFlags&6&&(n.flags|=8192)):ut(n),o=n.updateQueue,o!==null&&Ic(n,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==o&&(n.flags|=2048),e!==null&&J(ta),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),_r(Rt),ut(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function _N(e,n){switch(Hf(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return _r(Rt),ye(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Me(n),null;case 13:if(Ir(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));cs()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return J(Ot),null;case 4:return ye(),null;case 10:return _r(n.type),null;case 22:case 23:return Ir(n),Jf(),e!==null&&J(ta),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return _r(Rt),null;case 25:return null;default:return null}}function _v(e,n){switch(Hf(n),n.tag){case 3:_r(Rt),ye();break;case 26:case 27:case 5:Me(n);break;case 4:ye();break;case 13:Ir(n);break;case 19:J(Ot);break;case 10:_r(n.type);break;case 22:case 23:Ir(n),Jf(),e!==null&&J(ta);break;case 24:_r(Rt)}}function js(e,n){try{var o=n.updateQueue,s=o!==null?o.lastEffect:null;if(s!==null){var h=s.next;o=h;do{if((o.tag&e)===e){s=void 0;var y=o.create,A=o.inst;s=y(),A.destroy=s}o=o.next}while(o!==h)}}catch(k){tt(n,n.return,k)}}function ho(e,n,o){try{var s=n.updateQueue,h=s!==null?s.lastEffect:null;if(h!==null){var y=h.next;s=y;do{if((s.tag&e)===e){var A=s.inst,k=A.destroy;if(k!==void 0){A.destroy=void 0,h=n;var q=o,W=k;try{W()}catch(oe){tt(h,q,oe)}}}s=s.next}while(s!==y)}}catch(oe){tt(n,n.return,oe)}}function Dv(e){var n=e.updateQueue;if(n!==null){var o=e.stateNode;try{vx(n,o)}catch(s){tt(e,e.return,s)}}}function Iv(e,n,o){o.props=ra(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(s){tt(e,n,s)}}function As(e,n){try{var o=e.ref;if(o!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof o=="function"?e.refCleanup=o(s):o.current=s}}catch(h){tt(e,n,h)}}function ir(e,n){var o=e.ref,s=e.refCleanup;if(o!==null)if(typeof s=="function")try{s()}catch(h){tt(e,n,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){tt(e,n,h)}else o.current=null}function kv(e){var n=e.type,o=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&s.focus();break e;case"img":o.src?s.src=o.src:o.srcSet&&(s.srcset=o.srcSet)}}catch(h){tt(e,e.return,h)}}function Ah(e,n,o){try{var s=e.stateNode;JN(s,e.type,o,n),s[on]=n}catch(h){tt(e,e.return,h)}}function Lv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&So(e.type)||e.tag===4}function Rh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&So(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Oh(e,n,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(e,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(e),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Yc));else if(s!==4&&(s===27&&So(e.type)&&(o=e.stateNode,n=null),e=e.child,e!==null))for(Oh(e,n,o),e=e.sibling;e!==null;)Oh(e,n,o),e=e.sibling}function kc(e,n,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(s!==4&&(s===27&&So(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(kc(e,n,o),e=e.sibling;e!==null;)kc(e,n,o),e=e.sibling}function zv(e){var n=e.stateNode,o=e.memoizedProps;try{for(var s=e.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);$t(n,s,o),n[Qt]=e,n[on]=o}catch(y){tt(e,e.return,y)}}var zr=!1,bt=!1,Nh=!1,Bv=typeof WeakSet=="function"?WeakSet:Set,It=null;function DN(e,n){if(e=e.containerInfo,em=Jc,e=Fb(e),Rf(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var s=o.getSelection&&o.getSelection();if(s&&s.rangeCount!==0){o=s.anchorNode;var h=s.anchorOffset,y=s.focusNode;s=s.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var A=0,k=-1,q=-1,W=0,oe=0,se=e,ee=null;t:for(;;){for(var ne;se!==o||h!==0&&se.nodeType!==3||(k=A+h),se!==y||s!==0&&se.nodeType!==3||(q=A+s),se.nodeType===3&&(A+=se.nodeValue.length),(ne=se.firstChild)!==null;)ee=se,se=ne;for(;;){if(se===e)break t;if(ee===o&&++W===h&&(k=A),ee===y&&++oe===s&&(q=A),(ne=se.nextSibling)!==null)break;se=ee,ee=se.parentNode}se=ne}o=k===-1||q===-1?null:{start:k,end:q}}else o=null}o=o||{start:0,end:0}}else o=null;for(tm={focusedElem:e,selectionRange:o},Jc=!1,It=n;It!==null;)if(n=It,e=n.child,(n.subtreeFlags&1024)!==0&&e!==null)e.return=n,It=e;else for(;It!==null;){switch(n=It,y=n.alternate,e=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&y!==null){e=void 0,o=n,h=y.memoizedProps,y=y.memoizedState,s=o.stateNode;try{var Ae=ra(o.type,h,o.elementType===o.type);e=s.getSnapshotBeforeUpdate(Ae,y),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){tt(o,o.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,o=e.nodeType,o===9)om(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":om(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=n.sibling,e!==null){e.return=n.return,It=e;break}It=n.return}}function Hv(e,n,o){var s=o.flags;switch(o.tag){case 0:case 11:case 15:mo(e,o),s&4&&js(5,o);break;case 1:if(mo(e,o),s&4)if(e=o.stateNode,n===null)try{e.componentDidMount()}catch(A){tt(o,o.return,A)}else{var h=ra(o.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(h,n,e.__reactInternalSnapshotBeforeUpdate)}catch(A){tt(o,o.return,A)}}s&64&&Dv(o),s&512&&As(o,o.return);break;case 3:if(mo(e,o),s&64&&(e=o.updateQueue,e!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{vx(e,n)}catch(A){tt(o,o.return,A)}}break;case 27:n===null&&s&4&&zv(o);case 26:case 5:mo(e,o),n===null&&s&4&&kv(o),s&512&&As(o,o.return);break;case 12:mo(e,o);break;case 13:mo(e,o),s&4&&$v(e,o),s&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(o=$N.bind(null,o),iM(e,o))));break;case 22:if(s=o.memoizedState!==null||zr,!s){n=n!==null&&n.memoizedState!==null||bt,h=zr;var y=bt;zr=s,(bt=n)&&!y?po(e,o,(o.subtreeFlags&8772)!==0):mo(e,o),zr=h,bt=y}break;case 30:break;default:mo(e,o)}}function Pv(e){var n=e.alternate;n!==null&&(e.alternate=null,Pv(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&cf(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var st=null,ln=!1;function Br(e,n,o){for(o=o.child;o!==null;)Uv(e,n,o),o=o.sibling}function Uv(e,n,o){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(Gn,o)}catch{}switch(o.tag){case 26:bt||ir(o,n),Br(e,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:bt||ir(o,n);var s=st,h=ln;So(o.type)&&(st=o.stateNode,ln=!1),Br(e,n,o),Ls(o.stateNode),st=s,ln=h;break;case 5:bt||ir(o,n);case 6:if(s=st,h=ln,st=null,Br(e,n,o),st=s,ln=h,st!==null)if(ln)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(o.stateNode)}catch(y){tt(o,n,y)}else try{st.removeChild(o.stateNode)}catch(y){tt(o,n,y)}break;case 18:st!==null&&(ln?(e=st,O1(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,o.stateNode),Vs(e)):O1(st,o.stateNode));break;case 4:s=st,h=ln,st=o.stateNode.containerInfo,ln=!0,Br(e,n,o),st=s,ln=h;break;case 0:case 11:case 14:case 15:bt||ho(2,o,n),bt||ho(4,o,n),Br(e,n,o);break;case 1:bt||(ir(o,n),s=o.stateNode,typeof s.componentWillUnmount=="function"&&Iv(o,n,s)),Br(e,n,o);break;case 21:Br(e,n,o);break;case 22:bt=(s=bt)||o.memoizedState!==null,Br(e,n,o),bt=s;break;default:Br(e,n,o)}}function $v(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vs(e)}catch(o){tt(n,n.return,o)}}function IN(e){switch(e.tag){case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Bv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Bv),n;default:throw Error(a(435,e.tag))}}function Mh(e,n){var o=IN(e);n.forEach(function(s){var h=GN.bind(null,e,s);o.has(s)||(o.add(s),s.then(h,h))})}function gn(e,n){var o=n.deletions;if(o!==null)for(var s=0;s<o.length;s++){var h=o[s],y=e,A=n,k=A;e:for(;k!==null;){switch(k.tag){case 27:if(So(k.type)){st=k.stateNode,ln=!1;break e}break;case 5:st=k.stateNode,ln=!1;break e;case 3:case 4:st=k.stateNode.containerInfo,ln=!0;break e}k=k.return}if(st===null)throw Error(a(160));Uv(y,A,h),st=null,ln=!1,y=h.alternate,y!==null&&(y.return=null),h.return=null}if(n.subtreeFlags&13878)for(n=n.child;n!==null;)Gv(n,e),n=n.sibling}var qn=null;function Gv(e,n){var o=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gn(n,e),yn(e),s&4&&(ho(3,e,e.return),js(3,e),ho(5,e,e.return));break;case 1:gn(n,e),yn(e),s&512&&(bt||o===null||ir(o,o.return)),s&64&&zr&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?s:o.concat(s))));break;case 26:var h=qn;if(gn(n,e),yn(e),s&512&&(bt||o===null||ir(o,o.return)),s&4){var y=o!==null?o.memoizedState:null;if(s=e.memoizedState,o===null)if(s===null)if(e.stateNode===null){e:{s=e.type,o=e.memoizedProps,h=h.ownerDocument||h;t:switch(s){case"title":y=h.getElementsByTagName("title")[0],(!y||y[Zi]||y[Qt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=h.createElement(s),h.head.insertBefore(y,h.querySelector("head > title"))),$t(y,s,o),y[Qt]=e,_t(y),s=y;break e;case"link":var A=z1("link","href",h).get(s+(o.href||""));if(A){for(var k=0;k<A.length;k++)if(y=A[k],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){A.splice(k,1);break t}}y=h.createElement(s),$t(y,s,o),h.head.appendChild(y);break;case"meta":if(A=z1("meta","content",h).get(s+(o.content||""))){for(k=0;k<A.length;k++)if(y=A[k],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){A.splice(k,1);break t}}y=h.createElement(s),$t(y,s,o),h.head.appendChild(y);break;default:throw Error(a(468,s))}y[Qt]=e,_t(y),s=y}e.stateNode=s}else B1(h,e.type,e.stateNode);else e.stateNode=L1(h,s,e.memoizedProps);else y!==s?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,s===null?B1(h,e.type,e.stateNode):L1(h,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Ah(e,e.memoizedProps,o.memoizedProps)}break;case 27:gn(n,e),yn(e),s&512&&(bt||o===null||ir(o,o.return)),o!==null&&s&4&&Ah(e,e.memoizedProps,o.memoizedProps);break;case 5:if(gn(n,e),yn(e),s&512&&(bt||o===null||ir(o,o.return)),e.flags&32){h=e.stateNode;try{Pa(h,"")}catch(ne){tt(e,e.return,ne)}}s&4&&e.stateNode!=null&&(h=e.memoizedProps,Ah(e,h,o!==null?o.memoizedProps:h)),s&1024&&(Nh=!0);break;case 6:if(gn(n,e),yn(e),s&4){if(e.stateNode===null)throw Error(a(162));s=e.memoizedProps,o=e.stateNode;try{o.nodeValue=s}catch(ne){tt(e,e.return,ne)}}break;case 3:if(Qc=null,h=qn,qn=Kc(n.containerInfo),gn(n,e),qn=h,yn(e),s&4&&o!==null&&o.memoizedState.isDehydrated)try{Vs(n.containerInfo)}catch(ne){tt(e,e.return,ne)}Nh&&(Nh=!1,Vv(e));break;case 4:s=qn,qn=Kc(e.stateNode.containerInfo),gn(n,e),yn(e),qn=s;break;case 12:gn(n,e),yn(e);break;case 13:gn(n,e),yn(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(zh=ht()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Mh(e,s)));break;case 22:h=e.memoizedState!==null;var q=o!==null&&o.memoizedState!==null,W=zr,oe=bt;if(zr=W||h,bt=oe||q,gn(n,e),bt=oe,zr=W,yn(e),s&8192)e:for(n=e.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(o===null||q||zr||bt||oa(e)),o=null,n=e;;){if(n.tag===5||n.tag===26){if(o===null){q=o=n;try{if(y=q.stateNode,h)A=y.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{k=q.stateNode;var se=q.memoizedProps.style,ee=se!=null&&se.hasOwnProperty("display")?se.display:null;k.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ne){tt(q,q.return,ne)}}}else if(n.tag===6){if(o===null){q=n;try{q.stateNode.nodeValue=h?"":q.memoizedProps}catch(ne){tt(q,q.return,ne)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;o===n&&(o=null),n=n.return}o===n&&(o=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(o=s.retryQueue,o!==null&&(s.retryQueue=null,Mh(e,o))));break;case 19:gn(n,e),yn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Mh(e,s)));break;case 30:break;case 21:break;default:gn(n,e),yn(e)}}function yn(e){var n=e.flags;if(n&2){try{for(var o,s=e.return;s!==null;){if(Lv(s)){o=s;break}s=s.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,y=Rh(e);kc(e,y,h);break;case 5:var A=o.stateNode;o.flags&32&&(Pa(A,""),o.flags&=-33);var k=Rh(e);kc(e,k,A);break;case 3:case 4:var q=o.stateNode.containerInfo,W=Rh(e);Oh(e,W,q);break;default:throw Error(a(161))}}catch(oe){tt(e,e.return,oe)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Vv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Vv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function mo(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Hv(e,n.alternate,n),n=n.sibling}function oa(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ho(4,n,n.return),oa(n);break;case 1:ir(n,n.return);var o=n.stateNode;typeof o.componentWillUnmount=="function"&&Iv(n,n.return,o),oa(n);break;case 27:Ls(n.stateNode);case 26:case 5:ir(n,n.return),oa(n);break;case 22:n.memoizedState===null&&oa(n);break;case 30:oa(n);break;default:oa(n)}e=e.sibling}}function po(e,n,o){for(o=o&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,h=e,y=n,A=y.flags;switch(y.tag){case 0:case 11:case 15:po(h,y,o),js(4,y);break;case 1:if(po(h,y,o),s=y,h=s.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(W){tt(s,s.return,W)}if(s=y,h=s.updateQueue,h!==null){var k=s.stateNode;try{var q=h.shared.hiddenCallbacks;if(q!==null)for(h.shared.hiddenCallbacks=null,h=0;h<q.length;h++)xx(q[h],k)}catch(W){tt(s,s.return,W)}}o&&A&64&&Dv(y),As(y,y.return);break;case 27:zv(y);case 26:case 5:po(h,y,o),o&&s===null&&A&4&&kv(y),As(y,y.return);break;case 12:po(h,y,o);break;case 13:po(h,y,o),o&&A&4&&$v(h,y);break;case 22:y.memoizedState===null&&po(h,y,o),As(y,y.return);break;case 30:break;default:po(h,y,o)}n=n.sibling}}function _h(e,n){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&fs(o))}function Dh(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&fs(e))}function sr(e,n,o,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)qv(e,n,o,s),n=n.sibling}function qv(e,n,o,s){var h=n.flags;switch(n.tag){case 0:case 11:case 15:sr(e,n,o,s),h&2048&&js(9,n);break;case 1:sr(e,n,o,s);break;case 3:sr(e,n,o,s),h&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&fs(e)));break;case 12:if(h&2048){sr(e,n,o,s),e=n.stateNode;try{var y=n.memoizedProps,A=y.id,k=y.onPostCommit;typeof k=="function"&&k(A,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(q){tt(n,n.return,q)}}else sr(e,n,o,s);break;case 13:sr(e,n,o,s);break;case 23:break;case 22:y=n.stateNode,A=n.alternate,n.memoizedState!==null?y._visibility&2?sr(e,n,o,s):Rs(e,n):y._visibility&2?sr(e,n,o,s):(y._visibility|=2,ai(e,n,o,s,(n.subtreeFlags&10256)!==0)),h&2048&&_h(A,n);break;case 24:sr(e,n,o,s),h&2048&&Dh(n.alternate,n);break;default:sr(e,n,o,s)}}function ai(e,n,o,s,h){for(h=h&&(n.subtreeFlags&10256)!==0,n=n.child;n!==null;){var y=e,A=n,k=o,q=s,W=A.flags;switch(A.tag){case 0:case 11:case 15:ai(y,A,k,q,h),js(8,A);break;case 23:break;case 22:var oe=A.stateNode;A.memoizedState!==null?oe._visibility&2?ai(y,A,k,q,h):Rs(y,A):(oe._visibility|=2,ai(y,A,k,q,h)),h&&W&2048&&_h(A.alternate,A);break;case 24:ai(y,A,k,q,h),h&&W&2048&&Dh(A.alternate,A);break;default:ai(y,A,k,q,h)}n=n.sibling}}function Rs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=e,s=n,h=s.flags;switch(s.tag){case 22:Rs(o,s),h&2048&&_h(s.alternate,s);break;case 24:Rs(o,s),h&2048&&Dh(s.alternate,s);break;default:Rs(o,s)}n=n.sibling}}var Os=8192;function ii(e){if(e.subtreeFlags&Os)for(e=e.child;e!==null;)Yv(e),e=e.sibling}function Yv(e){switch(e.tag){case 26:ii(e),e.flags&Os&&e.memoizedState!==null&&xM(qn,e.memoizedState,e.memoizedProps);break;case 5:ii(e);break;case 3:case 4:var n=qn;qn=Kc(e.stateNode.containerInfo),ii(e),qn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Os,Os=16777216,ii(e),Os=n):ii(e));break;default:ii(e)}}function Xv(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Ns(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var s=n[o];It=s,Fv(s,e)}Xv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kv(e),e=e.sibling}function Kv(e){switch(e.tag){case 0:case 11:case 15:Ns(e),e.flags&2048&&ho(9,e,e.return);break;case 3:Ns(e);break;case 12:Ns(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Lc(e)):Ns(e);break;default:Ns(e)}}function Lc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var s=n[o];It=s,Fv(s,e)}Xv(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ho(8,n,n.return),Lc(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,Lc(n));break;default:Lc(n)}e=e.sibling}}function Fv(e,n){for(;It!==null;){var o=It;switch(o.tag){case 0:case 11:case 15:ho(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var s=o.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:fs(o.memoizedState.cache)}if(s=o.child,s!==null)s.return=o,It=s;else e:for(o=e;It!==null;){s=It;var h=s.sibling,y=s.return;if(Pv(s),s===o){It=null;break e}if(h!==null){h.return=y,It=h;break e}It=y}}}var kN={getCacheForType:function(e){var n=Zt(Rt),o=n.data.get(e);return o===void 0&&(o=e(),n.data.set(e,o)),o}},LN=typeof WeakMap=="function"?WeakMap:Map,Fe=0,rt=null,Pe=null,Ge=0,Qe=0,bn=null,go=!1,si=!1,Ih=!1,Hr=0,pt=0,yo=0,aa=0,kh=0,zn=0,li=0,Ms=null,cn=null,Lh=!1,zh=0,zc=1/0,Bc=null,bo=null,Ut=0,xo=null,ci=null,ui=0,Bh=0,Hh=null,Qv=null,_s=0,Ph=null;function xn(){if((Fe&2)!==0&&Ge!==0)return Ge&-Ge;if(V.T!==null){var e=Za;return e!==0?e:Xh()}return rr()}function Zv(){zn===0&&(zn=(Ge&536870912)===0||Ke?ve():536870912);var e=Ln.current;return e!==null&&(e.flags|=32),zn}function vn(e,n,o){(e===rt&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(di(e,0),vo(e,Ge,zn,!1)),Oe(e,o),((Fe&2)===0||e!==rt)&&(e===rt&&((Fe&2)===0&&(aa|=o),pt===4&&vo(e,Ge,zn,!1)),lr(e))}function Wv(e,n,o){if((Fe&6)!==0)throw Error(a(327));var s=!o&&(n&124)===0&&(n&e.expiredLanes)===0||ce(e,n),h=s?HN(e,n):Gh(e,n,!0),y=s;do{if(h===0){si&&!s&&vo(e,n,0,!1);break}else{if(o=e.current.alternate,y&&!zN(o)){h=Gh(e,n,!1),y=!1;continue}if(h===2){if(y=n,e.errorRecoveryDisabledLanes&y)var A=0;else A=e.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){n=A;e:{var k=e;h=Ms;var q=k.current.memoizedState.isDehydrated;if(q&&(di(k,A).flags|=256),A=Gh(k,A,!1),A!==2){if(Ih&&!q){k.errorRecoveryDisabledLanes|=y,aa|=y,h=4;break e}y=cn,cn=h,y!==null&&(cn===null?cn=y:cn.push.apply(cn,y))}h=A}if(y=!1,h!==2)continue}}if(h===1){di(e,0),vo(e,n,0,!0);break}e:{switch(s=e,y=h,y){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:vo(s,n,zn,!go);break e;case 2:cn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(h=zh+300-ht(),10<h)){if(vo(s,n,zn,!go),Fi(s,0,!0)!==0)break e;s.timeoutHandle=A1(Jv.bind(null,s,o,cn,Bc,Lh,n,zn,aa,li,go,y,2,-0,0),h);break e}Jv(s,o,cn,Bc,Lh,n,zn,aa,li,go,y,0,-0,0)}}break}while(!0);lr(e)}function Jv(e,n,o,s,h,y,A,k,q,W,oe,se,ee,ne){if(e.timeoutHandle=-1,se=n.subtreeFlags,(se&8192||(se&16785408)===16785408)&&(Hs={stylesheets:null,count:0,unsuspend:bM},Yv(n),se=vM(),se!==null)){e.cancelPendingCommit=se(i1.bind(null,e,n,y,o,s,h,A,k,q,oe,1,ee,ne)),vo(e,y,A,!W);return}i1(e,n,y,o,s,h,A,k,q)}function zN(e){for(var n=e;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var s=0;s<o.length;s++){var h=o[s],y=h.getSnapshot;h=h.value;try{if(!mn(y(),h))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function vo(e,n,o,s){n&=~kh,n&=~aa,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var h=n;0<h;){var y=31-Ht(h),A=1<<y;s[y]=-1,h&=~A}o!==0&&hn(e,o,n)}function Hc(){return(Fe&6)===0?(Ds(0),!1):!0}function Uh(){if(Pe!==null){if(Qe===0)var e=Pe.return;else e=Pe,Mr=Jo=null,oh(e),ri=null,ws=0,e=Pe;for(;e!==null;)_v(e.alternate,e),e=e.return;Pe=null}}function di(e,n){var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,tM(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),Uh(),rt=e,Pe=o=Rr(e.current,null),Ge=n,Qe=0,bn=null,go=!1,si=ce(e,n),Ih=!1,li=zn=kh=aa=yo=pt=0,cn=Ms=null,Lh=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var h=31-Ht(s),y=1<<h;n|=e[h],s&=~y}return Hr=n,sc(),o}function e1(e,n){Le=null,V.H=jc,n===ms||n===gc?(n=yx(),Qe=3):n===mx?(n=yx(),Qe=4):Qe=n===bv?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,bn=n,Pe===null&&(pt=1,Mc(e,_n(n,e.current)))}function t1(){var e=V.H;return V.H=jc,e===null?jc:e}function n1(){var e=V.A;return V.A=kN,e}function $h(){pt=4,go||(Ge&4194048)!==Ge&&Ln.current!==null||(si=!0),(yo&134217727)===0&&(aa&134217727)===0||rt===null||vo(rt,Ge,zn,!1)}function Gh(e,n,o){var s=Fe;Fe|=2;var h=t1(),y=n1();(rt!==e||Ge!==n)&&(Bc=null,di(e,n)),n=!1;var A=pt;e:do try{if(Qe!==0&&Pe!==null){var k=Pe,q=bn;switch(Qe){case 8:Uh(),A=6;break e;case 3:case 2:case 9:case 6:Ln.current===null&&(n=!0);var W=Qe;if(Qe=0,bn=null,fi(e,k,q,W),o&&si){A=0;break e}break;default:W=Qe,Qe=0,bn=null,fi(e,k,q,W)}}BN(),A=pt;break}catch(oe){e1(e,oe)}while(!0);return n&&e.shellSuspendCounter++,Mr=Jo=null,Fe=s,V.H=h,V.A=y,Pe===null&&(rt=null,Ge=0,sc()),A}function BN(){for(;Pe!==null;)r1(Pe)}function HN(e,n){var o=Fe;Fe|=2;var s=t1(),h=n1();rt!==e||Ge!==n?(Bc=null,zc=ht()+500,di(e,n)):si=ce(e,n);e:do try{if(Qe!==0&&Pe!==null){n=Pe;var y=bn;t:switch(Qe){case 1:Qe=0,bn=null,fi(e,n,y,1);break;case 2:case 9:if(px(y)){Qe=0,bn=null,o1(n);break}n=function(){Qe!==2&&Qe!==9||rt!==e||(Qe=7),lr(e)},y.then(n,n);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:px(y)?(Qe=0,bn=null,o1(n)):(Qe=0,bn=null,fi(e,n,y,7));break;case 5:var A=null;switch(Pe.tag){case 26:A=Pe.memoizedState;case 5:case 27:var k=Pe;if(!A||H1(A)){Qe=0,bn=null;var q=k.sibling;if(q!==null)Pe=q;else{var W=k.return;W!==null?(Pe=W,Pc(W)):Pe=null}break t}}Qe=0,bn=null,fi(e,n,y,5);break;case 6:Qe=0,bn=null,fi(e,n,y,6);break;case 8:Uh(),pt=6;break e;default:throw Error(a(462))}}PN();break}catch(oe){e1(e,oe)}while(!0);return Mr=Jo=null,V.H=s,V.A=h,Fe=o,Pe!==null?0:(rt=null,Ge=0,sc(),pt)}function PN(){for(;Pe!==null&&!Se();)r1(Pe)}function r1(e){var n=Nv(e.alternate,e,Hr);e.memoizedProps=e.pendingProps,n===null?Pc(e):Pe=n}function o1(e){var n=e,o=n.alternate;switch(n.tag){case 15:case 0:n=Ev(o,n,n.pendingProps,n.type,void 0,Ge);break;case 11:n=Ev(o,n,n.pendingProps,n.type.render,n.ref,Ge);break;case 5:oh(n);default:_v(o,n),n=Pe=ax(n,Hr),n=Nv(o,n,Hr)}e.memoizedProps=e.pendingProps,n===null?Pc(e):Pe=n}function fi(e,n,o,s){Mr=Jo=null,oh(n),ri=null,ws=0;var h=n.return;try{if(ON(e,h,n,o,Ge)){pt=1,Mc(e,_n(o,e.current)),Pe=null;return}}catch(y){if(h!==null)throw Pe=h,y;pt=1,Mc(e,_n(o,e.current)),Pe=null;return}n.flags&32768?(Ke||s===1?e=!0:si||(Ge&536870912)!==0?e=!1:(go=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ln.current,s!==null&&s.tag===13&&(s.flags|=16384))),a1(n,e)):Pc(n)}function Pc(e){var n=e;do{if((n.flags&32768)!==0){a1(n,go);return}e=n.return;var o=MN(n.alternate,n,Hr);if(o!==null){Pe=o;return}if(n=n.sibling,n!==null){Pe=n;return}Pe=n=e}while(n!==null);pt===0&&(pt=5)}function a1(e,n){do{var o=_N(e.alternate,e);if(o!==null){o.flags&=32767,Pe=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=o}while(e!==null);pt=6,Pe=null}function i1(e,n,o,s,h,y,A,k,q){e.cancelPendingCommit=null;do Uc();while(Ut!==0);if((Fe&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(y=n.lanes|n.childLanes,y|=Df,en(e,o,y,A,k,q),e===rt&&(Pe=rt=null,Ge=0),ci=n,xo=e,ui=o,Bh=y,Hh=h,Qv=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,VN(Mt,function(){return d1(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=V.T,V.T=null,h=Y.p,Y.p=2,A=Fe,Fe|=4;try{DN(e,n,o)}finally{Fe=A,Y.p=h,V.T=s}}Ut=1,s1(),l1(),c1()}}function s1(){if(Ut===1){Ut=0;var e=xo,n=ci,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=V.T,V.T=null;var s=Y.p;Y.p=2;var h=Fe;Fe|=4;try{Gv(n,e);var y=tm,A=Fb(e.containerInfo),k=y.focusedElem,q=y.selectionRange;if(A!==k&&k&&k.ownerDocument&&Kb(k.ownerDocument.documentElement,k)){if(q!==null&&Rf(k)){var W=q.start,oe=q.end;if(oe===void 0&&(oe=W),"selectionStart"in k)k.selectionStart=W,k.selectionEnd=Math.min(oe,k.value.length);else{var se=k.ownerDocument||document,ee=se&&se.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),Ae=k.textContent.length,Ee=Math.min(q.start,Ae),Je=q.end===void 0?Ee:Math.min(q.end,Ae);!ne.extend&&Ee>Je&&(A=Je,Je=Ee,Ee=A);var F=Xb(k,Ee),K=Xb(k,Je);if(F&&K&&(ne.rangeCount!==1||ne.anchorNode!==F.node||ne.anchorOffset!==F.offset||ne.focusNode!==K.node||ne.focusOffset!==K.offset)){var Z=se.createRange();Z.setStart(F.node,F.offset),ne.removeAllRanges(),Ee>Je?(ne.addRange(Z),ne.extend(K.node,K.offset)):(Z.setEnd(K.node,K.offset),ne.addRange(Z))}}}}for(se=[],ne=k;ne=ne.parentNode;)ne.nodeType===1&&se.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<se.length;k++){var ie=se[k];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Jc=!!em,tm=em=null}finally{Fe=h,Y.p=s,V.T=o}}e.current=n,Ut=2}}function l1(){if(Ut===2){Ut=0;var e=xo,n=ci,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=V.T,V.T=null;var s=Y.p;Y.p=2;var h=Fe;Fe|=4;try{Hv(e,n.alternate,n)}finally{Fe=h,Y.p=s,V.T=o}}Ut=3}}function c1(){if(Ut===4||Ut===3){Ut=0,Bt();var e=xo,n=ci,o=ui,s=Qv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ut=5:(Ut=0,ci=xo=null,u1(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(bo=null),Tr(o),n=n.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(Gn,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=V.T,h=Y.p,Y.p=2,V.T=null;try{for(var y=e.onRecoverableError,A=0;A<s.length;A++){var k=s[A];y(k.value,{componentStack:k.stack})}}finally{V.T=n,Y.p=h}}(ui&3)!==0&&Uc(),lr(e),h=e.pendingLanes,(o&4194090)!==0&&(h&42)!==0?e===Ph?_s++:(_s=0,Ph=e):_s=0,Ds(0)}}function u1(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,fs(n)))}function Uc(e){return s1(),l1(),c1(),d1()}function d1(){if(Ut!==5)return!1;var e=xo,n=Bh;Bh=0;var o=Tr(ui),s=V.T,h=Y.p;try{Y.p=32>o?32:o,V.T=null,o=Hh,Hh=null;var y=xo,A=ui;if(Ut=0,ci=xo=null,ui=0,(Fe&6)!==0)throw Error(a(331));var k=Fe;if(Fe|=4,Kv(y.current),qv(y,y.current,A,o),Fe=k,Ds(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(Gn,y)}catch{}return!0}finally{Y.p=h,V.T=s,u1(e,n)}}function f1(e,n,o){n=_n(o,n),n=bh(e.stateNode,n,2),e=lo(e,n,2),e!==null&&(Oe(e,2),lr(e))}function tt(e,n,o){if(e.tag===3)f1(e,e,o);else for(;n!==null;){if(n.tag===3){f1(n,e,o);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(bo===null||!bo.has(s))){e=_n(o,e),o=gv(2),s=lo(n,o,2),s!==null&&(yv(o,s,n,e),Oe(s,2),lr(s));break}}n=n.return}}function Vh(e,n,o){var s=e.pingCache;if(s===null){s=e.pingCache=new LN;var h=new Set;s.set(n,h)}else h=s.get(n),h===void 0&&(h=new Set,s.set(n,h));h.has(o)||(Ih=!0,h.add(o),e=UN.bind(null,e,n,o),n.then(e,e))}function UN(e,n,o){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,rt===e&&(Ge&o)===o&&(pt===4||pt===3&&(Ge&62914560)===Ge&&300>ht()-zh?(Fe&2)===0&&di(e,0):kh|=o,li===Ge&&(li=0)),lr(e)}function h1(e,n){n===0&&(n=et()),e=Xa(e,n),e!==null&&(Oe(e,n),lr(e))}function $N(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),h1(e,o)}function GN(e,n){var o=0;switch(e.tag){case 13:var s=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),h1(e,o)}function VN(e,n){return we(e,n)}var $c=null,hi=null,qh=!1,Gc=!1,Yh=!1,ia=0;function lr(e){e!==hi&&e.next===null&&(hi===null?$c=hi=e:hi=hi.next=e),Gc=!0,qh||(qh=!0,YN())}function Ds(e,n){if(!Yh&&Gc){Yh=!0;do for(var o=!1,s=$c;s!==null;){if(e!==0){var h=s.pendingLanes;if(h===0)var y=0;else{var A=s.suspendedLanes,k=s.pingedLanes;y=(1<<31-Ht(42|e)+1)-1,y&=h&~(A&~k),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,y1(s,y))}else y=Ge,y=Fi(s,s===rt?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(y&3)===0||ce(s,y)||(o=!0,y1(s,y));s=s.next}while(o);Yh=!1}}function qN(){m1()}function m1(){Gc=qh=!1;var e=0;ia!==0&&(eM()&&(e=ia),ia=0);for(var n=ht(),o=null,s=$c;s!==null;){var h=s.next,y=p1(s,n);y===0?(s.next=null,o===null?$c=h:o.next=h,h===null&&(hi=o)):(o=s,(e!==0||(y&3)!==0)&&(Gc=!0)),s=h}Ds(e)}function p1(e,n){for(var o=e.suspendedLanes,s=e.pingedLanes,h=e.expirationTimes,y=e.pendingLanes&-62914561;0<y;){var A=31-Ht(y),k=1<<A,q=h[A];q===-1?((k&o)===0||(k&s)!==0)&&(h[A]=Re(k,n)):q<=n&&(e.expiredLanes|=k),y&=~k}if(n=rt,o=Ge,o=Fi(e,e===n?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,o===0||e===n&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&xe(s),e.callbackNode=null,e.callbackPriority=0;if((o&3)===0||ce(e,o)){if(n=o&-o,n===e.callbackPriority)return n;switch(s!==null&&xe(s),Tr(o)){case 2:case 8:o=it;break;case 32:o=Mt;break;case 268435456:o=to;break;default:o=Mt}return s=g1.bind(null,e),o=we(o,s),e.callbackPriority=n,e.callbackNode=o,n}return s!==null&&s!==null&&xe(s),e.callbackPriority=2,e.callbackNode=null,2}function g1(e,n){if(Ut!==0&&Ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var o=e.callbackNode;if(Uc()&&e.callbackNode!==o)return null;var s=Ge;return s=Fi(e,e===rt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Wv(e,s,n),p1(e,ht()),e.callbackNode!=null&&e.callbackNode===o?g1.bind(null,e):null)}function y1(e,n){if(Uc())return null;Wv(e,n,!0)}function YN(){nM(function(){(Fe&6)!==0?we(at,qN):m1()})}function Xh(){return ia===0&&(ia=ve()),ia}function b1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ec(""+e)}function x1(e,n){var o=n.ownerDocument.createElement("input");return o.name=n.name,o.value=n.value,e.id&&o.setAttribute("form",e.id),n.parentNode.insertBefore(o,n),e=new FormData(e),o.parentNode.removeChild(o),e}function XN(e,n,o,s,h){if(n==="submit"&&o&&o.stateNode===h){var y=b1((h[on]||null).action),A=s.submitter;A&&(n=(n=A[on]||null)?b1(n.formAction):A.getAttribute("formAction"),n!==null&&(y=n,A=null));var k=new oc("action","action",null,s,h);e.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ia!==0){var q=A?x1(h,A):new FormData(h);hh(o,{pending:!0,data:q,method:h.method,action:y},null,q)}}else typeof y=="function"&&(k.preventDefault(),q=A?x1(h,A):new FormData(h),hh(o,{pending:!0,data:q,method:h.method,action:y},y,q))},currentTarget:h}]})}}for(var Kh=0;Kh<_f.length;Kh++){var Fh=_f[Kh],KN=Fh.toLowerCase(),FN=Fh[0].toUpperCase()+Fh.slice(1);Vn(KN,"on"+FN)}Vn(Wb,"onAnimationEnd"),Vn(Jb,"onAnimationIteration"),Vn(ex,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(fN,"onTransitionRun"),Vn(hN,"onTransitionStart"),Vn(mN,"onTransitionCancel"),Vn(tx,"onTransitionEnd"),za("onMouseEnter",["mouseout","mouseover"]),za("onMouseLeave",["mouseout","mouseover"]),za("onPointerEnter",["pointerout","pointerover"]),za("onPointerLeave",["pointerout","pointerover"]),Vo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Is="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),QN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Is));function v1(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var s=e[o],h=s.event;s=s.listeners;e:{var y=void 0;if(n)for(var A=s.length-1;0<=A;A--){var k=s[A],q=k.instance,W=k.currentTarget;if(k=k.listener,q!==y&&h.isPropagationStopped())break e;y=k,h.currentTarget=W;try{y(h)}catch(oe){Nc(oe)}h.currentTarget=null,y=q}else for(A=0;A<s.length;A++){if(k=s[A],q=k.instance,W=k.currentTarget,k=k.listener,q!==y&&h.isPropagationStopped())break e;y=k,h.currentTarget=W;try{y(h)}catch(oe){Nc(oe)}h.currentTarget=null,y=q}}}}function Ue(e,n){var o=n[lf];o===void 0&&(o=n[lf]=new Set);var s=e+"__bubble";o.has(s)||(S1(n,e,2,!1),o.add(s))}function Qh(e,n,o){var s=0;n&&(s|=4),S1(o,e,s,n)}var Vc="_reactListening"+Math.random().toString(36).slice(2);function Zh(e){if(!e[Vc]){e[Vc]=!0,mb.forEach(function(o){o!=="selectionchange"&&(QN.has(o)||Qh(o,!1,e),Qh(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Vc]||(n[Vc]=!0,Qh("selectionchange",!1,n))}}function S1(e,n,o,s){switch(q1(n)){case 2:var h=wM;break;case 8:h=EM;break;default:h=dm}o=h.bind(null,n,o,e),h=void 0,!xf||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),s?h!==void 0?e.addEventListener(n,o,{capture:!0,passive:h}):e.addEventListener(n,o,!0):h!==void 0?e.addEventListener(n,o,{passive:h}):e.addEventListener(n,o,!1)}function Wh(e,n,o,s,h){var y=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var A=s.tag;if(A===3||A===4){var k=s.stateNode.containerInfo;if(k===h)break;if(A===4)for(A=s.return;A!==null;){var q=A.tag;if((q===3||q===4)&&A.stateNode.containerInfo===h)return;A=A.return}for(;k!==null;){if(A=Ia(k),A===null)return;if(q=A.tag,q===5||q===6||q===26||q===27){s=y=A;continue e}k=k.parentNode}}s=s.return}Rb(function(){var W=y,oe=yf(o),se=[];e:{var ee=nx.get(e);if(ee!==void 0){var ne=oc,Ae=e;switch(e){case"keypress":if(nc(o)===0)break e;case"keydown":case"keyup":ne=VO;break;case"focusin":Ae="focus",ne=wf;break;case"focusout":Ae="blur",ne=wf;break;case"beforeblur":case"afterblur":ne=wf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Mb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=_O;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=XO;break;case Wb:case Jb:case ex:ne=kO;break;case tx:ne=FO;break;case"scroll":case"scrollend":ne=NO;break;case"wheel":ne=ZO;break;case"copy":case"cut":case"paste":ne=zO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Db;break;case"toggle":case"beforetoggle":ne=JO}var Ee=(n&4)!==0,Je=!Ee&&(e==="scroll"||e==="scrollend"),F=Ee?ee!==null?ee+"Capture":null:ee;Ee=[];for(var K=W,Z;K!==null;){var ie=K;if(Z=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Z===null||F===null||(ie=Ji(K,F),ie!=null&&Ee.push(ks(K,ie,Z))),Je)break;K=K.return}0<Ee.length&&(ee=new ne(ee,Ae,null,o,oe),se.push({event:ee,listeners:Ee}))}}if((n&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",ee&&o!==gf&&(Ae=o.relatedTarget||o.fromElement)&&(Ia(Ae)||Ae[Da]))break e;if((ne||ee)&&(ee=oe.window===oe?oe:(ee=oe.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(Ae=o.relatedTarget||o.toElement,ne=W,Ae=Ae?Ia(Ae):null,Ae!==null&&(Je=l(Ae),Ee=Ae.tag,Ae!==Je||Ee!==5&&Ee!==27&&Ee!==6)&&(Ae=null)):(ne=null,Ae=W),ne!==Ae)){if(Ee=Mb,ie="onMouseLeave",F="onMouseEnter",K="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=Db,ie="onPointerLeave",F="onPointerEnter",K="pointer"),Je=ne==null?ee:Wi(ne),Z=Ae==null?ee:Wi(Ae),ee=new Ee(ie,K+"leave",ne,o,oe),ee.target=Je,ee.relatedTarget=Z,ie=null,Ia(oe)===W&&(Ee=new Ee(F,K+"enter",Ae,o,oe),Ee.target=Z,Ee.relatedTarget=Je,ie=Ee),Je=ie,ne&&Ae)t:{for(Ee=ne,F=Ae,K=0,Z=Ee;Z;Z=mi(Z))K++;for(Z=0,ie=F;ie;ie=mi(ie))Z++;for(;0<K-Z;)Ee=mi(Ee),K--;for(;0<Z-K;)F=mi(F),Z--;for(;K--;){if(Ee===F||F!==null&&Ee===F.alternate)break t;Ee=mi(Ee),F=mi(F)}Ee=null}else Ee=null;ne!==null&&C1(se,ee,ne,Ee,!1),Ae!==null&&Je!==null&&C1(se,Je,Ae,Ee,!0)}}e:{if(ee=W?Wi(W):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var pe=Ub;else if(Hb(ee))if($b)pe=cN;else{pe=sN;var ze=iN}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&pf(W.elementType)&&(pe=Ub):pe=lN;if(pe&&(pe=pe(e,W))){Pb(se,pe,o,oe);break e}ze&&ze(e,ee,W),e==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&mf(ee,"number",ee.value)}switch(ze=W?Wi(W):window,e){case"focusin":(Hb(ze)||ze.contentEditable==="true")&&(Va=ze,Of=W,ss=null);break;case"focusout":ss=Of=Va=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,Qb(se,o,oe);break;case"selectionchange":if(dN)break;case"keydown":case"keyup":Qb(se,o,oe)}var be;if(Tf)e:{switch(e){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else Ga?zb(e,o)&&(Te="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(Te="onCompositionStart");Te&&(Ib&&o.locale!=="ko"&&(Ga||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&Ga&&(be=Ob()):(oo=oe,vf="value"in oo?oo.value:oo.textContent,Ga=!0)),ze=qc(W,Te),0<ze.length&&(Te=new _b(Te,e,null,o,oe),se.push({event:Te,listeners:ze}),be?Te.data=be:(be=Bb(o),be!==null&&(Te.data=be)))),(be=tN?nN(e,o):rN(e,o))&&(Te=qc(W,"onBeforeInput"),0<Te.length&&(ze=new _b("onBeforeInput","beforeinput",null,o,oe),se.push({event:ze,listeners:Te}),ze.data=be)),XN(se,e,W,o,oe)}v1(se,n)})}function ks(e,n,o){return{instance:e,listener:n,currentTarget:o}}function qc(e,n){for(var o=n+"Capture",s=[];e!==null;){var h=e,y=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||y===null||(h=Ji(e,o),h!=null&&s.unshift(ks(e,h,y)),h=Ji(e,n),h!=null&&s.push(ks(e,h,y))),e.tag===3)return s;e=e.return}return[]}function mi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function C1(e,n,o,s,h){for(var y=n._reactName,A=[];o!==null&&o!==s;){var k=o,q=k.alternate,W=k.stateNode;if(k=k.tag,q!==null&&q===s)break;k!==5&&k!==26&&k!==27||W===null||(q=W,h?(W=Ji(o,y),W!=null&&A.unshift(ks(o,W,q))):h||(W=Ji(o,y),W!=null&&A.push(ks(o,W,q)))),o=o.return}A.length!==0&&e.push({event:n,listeners:A})}var ZN=/\r\n?/g,WN=/\u0000|\uFFFD/g;function w1(e){return(typeof e=="string"?e:""+e).replace(ZN,`
|
|
51
|
-
`).replace(WN,"")}function E1(e,n){return n=w1(n),w1(e)===n}function Yc(){}function We(e,n,o,s,h,y){switch(o){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||Pa(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&Pa(e,""+s);break;case"className":Zl(e,"class",s);break;case"tabIndex":Zl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Zl(e,o,s);break;case"style":jb(e,s,y);break;case"data":if(n!=="object"){Zl(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||o!=="href")){e.removeAttribute(o);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(o);break}s=ec(""+s),e.setAttribute(o,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(o==="formAction"?(n!=="input"&&We(e,n,"name",h.name,h,null),We(e,n,"formEncType",h.formEncType,h,null),We(e,n,"formMethod",h.formMethod,h,null),We(e,n,"formTarget",h.formTarget,h,null)):(We(e,n,"encType",h.encType,h,null),We(e,n,"method",h.method,h,null),We(e,n,"target",h.target,h,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(o);break}s=ec(""+s),e.setAttribute(o,s);break;case"onClick":s!=null&&(e.onclick=Yc);break;case"onScroll":s!=null&&Ue("scroll",e);break;case"onScrollEnd":s!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}o=ec(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""+s):e.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":s===!0?e.setAttribute(o,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,s):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(o,s):e.removeAttribute(o);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(o):e.setAttribute(o,s);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),Ql(e,"popover",s);break;case"xlinkActuate":jr(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":jr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":jr(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":jr(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":jr(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":jr(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":jr(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":jr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":jr(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ql(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=RO.get(o)||o,Ql(e,o,s))}}function Jh(e,n,o,s,h,y){switch(o){case"style":jb(e,s,y);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"children":typeof s=="string"?Pa(e,s):(typeof s=="number"||typeof s=="bigint")&&Pa(e,""+s);break;case"onScroll":s!=null&&Ue("scroll",e);break;case"onScrollEnd":s!=null&&Ue("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Yc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pb.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),n=o.slice(2,h?o.length-7:void 0),y=e[on]||null,y=y!=null?y[o]:null,typeof y=="function"&&e.removeEventListener(n,y,h),typeof s=="function")){typeof y!="function"&&y!==null&&(o in e?e[o]=null:e.hasAttribute(o)&&e.removeAttribute(o)),e.addEventListener(n,s,h);break e}o in e?e[o]=s:s===!0?e.setAttribute(o,""):Ql(e,o,s)}}}function $t(e,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var s=!1,h=!1,y;for(y in o)if(o.hasOwnProperty(y)){var A=o[y];if(A!=null)switch(y){case"src":s=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:We(e,n,y,A,o,null)}}h&&We(e,n,"srcSet",o.srcSet,o,null),s&&We(e,n,"src",o.src,o,null);return;case"input":Ue("invalid",e);var k=y=A=h=null,q=null,W=null;for(s in o)if(o.hasOwnProperty(s)){var oe=o[s];if(oe!=null)switch(s){case"name":h=oe;break;case"type":A=oe;break;case"checked":q=oe;break;case"defaultChecked":W=oe;break;case"value":y=oe;break;case"defaultValue":k=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,n));break;default:We(e,n,s,oe,o,null)}}Cb(e,y,k,q,W,A,h,!1),Wl(e);return;case"select":Ue("invalid",e),s=A=y=null;for(h in o)if(o.hasOwnProperty(h)&&(k=o[h],k!=null))switch(h){case"value":y=k;break;case"defaultValue":A=k;break;case"multiple":s=k;default:We(e,n,h,k,o,null)}n=y,o=A,e.multiple=!!s,n!=null?Ha(e,!!s,n,!1):o!=null&&Ha(e,!!s,o,!0);return;case"textarea":Ue("invalid",e),y=h=s=null;for(A in o)if(o.hasOwnProperty(A)&&(k=o[A],k!=null))switch(A){case"value":s=k;break;case"defaultValue":h=k;break;case"children":y=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:We(e,n,A,k,o,null)}Eb(e,s,h,y),Wl(e);return;case"option":for(q in o)if(o.hasOwnProperty(q)&&(s=o[q],s!=null))switch(q){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:We(e,n,q,s,o,null)}return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(s=0;s<Is.length;s++)Ue(Is[s],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in o)if(o.hasOwnProperty(W)&&(s=o[W],s!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:We(e,n,W,s,o,null)}return;default:if(pf(n)){for(oe in o)o.hasOwnProperty(oe)&&(s=o[oe],s!==void 0&&Jh(e,n,oe,s,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(s=o[k],s!=null&&We(e,n,k,s,o,null))}function JN(e,n,o,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,y=null,A=null,k=null,q=null,W=null,oe=null;for(ne in o){var se=o[ne];if(o.hasOwnProperty(ne)&&se!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":q=se;default:s.hasOwnProperty(ne)||We(e,n,ne,null,s,se)}}for(var ee in s){var ne=s[ee];if(se=o[ee],s.hasOwnProperty(ee)&&(ne!=null||se!=null))switch(ee){case"type":y=ne;break;case"name":h=ne;break;case"checked":W=ne;break;case"defaultChecked":oe=ne;break;case"value":A=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,n));break;default:ne!==se&&We(e,n,ee,ne,s,se)}}hf(e,A,k,q,W,oe,y,h);return;case"select":ne=A=k=ee=null;for(y in o)if(q=o[y],o.hasOwnProperty(y)&&q!=null)switch(y){case"value":break;case"multiple":ne=q;default:s.hasOwnProperty(y)||We(e,n,y,null,s,q)}for(h in s)if(y=s[h],q=o[h],s.hasOwnProperty(h)&&(y!=null||q!=null))switch(h){case"value":ee=y;break;case"defaultValue":k=y;break;case"multiple":A=y;default:y!==q&&We(e,n,h,y,s,q)}n=k,o=A,s=ne,ee!=null?Ha(e,!!o,ee,!1):!!s!=!!o&&(n!=null?Ha(e,!!o,n,!0):Ha(e,!!o,o?[]:"",!1));return;case"textarea":ne=ee=null;for(k in o)if(h=o[k],o.hasOwnProperty(k)&&h!=null&&!s.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:We(e,n,k,null,s,h)}for(A in s)if(h=s[A],y=o[A],s.hasOwnProperty(A)&&(h!=null||y!=null))switch(A){case"value":ee=h;break;case"defaultValue":ne=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==y&&We(e,n,A,h,s,y)}wb(e,ee,ne);return;case"option":for(var Ae in o)if(ee=o[Ae],o.hasOwnProperty(Ae)&&ee!=null&&!s.hasOwnProperty(Ae))switch(Ae){case"selected":e.selected=!1;break;default:We(e,n,Ae,null,s,ee)}for(q in s)if(ee=s[q],ne=o[q],s.hasOwnProperty(q)&&ee!==ne&&(ee!=null||ne!=null))switch(q){case"selected":e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:We(e,n,q,ee,s,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ee in o)ee=o[Ee],o.hasOwnProperty(Ee)&&ee!=null&&!s.hasOwnProperty(Ee)&&We(e,n,Ee,null,s,ee);for(W in s)if(ee=s[W],ne=o[W],s.hasOwnProperty(W)&&ee!==ne&&(ee!=null||ne!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,n));break;default:We(e,n,W,ee,s,ne)}return;default:if(pf(n)){for(var Je in o)ee=o[Je],o.hasOwnProperty(Je)&&ee!==void 0&&!s.hasOwnProperty(Je)&&Jh(e,n,Je,void 0,s,ee);for(oe in s)ee=s[oe],ne=o[oe],!s.hasOwnProperty(oe)||ee===ne||ee===void 0&&ne===void 0||Jh(e,n,oe,ee,s,ne);return}}for(var F in o)ee=o[F],o.hasOwnProperty(F)&&ee!=null&&!s.hasOwnProperty(F)&&We(e,n,F,null,s,ee);for(se in s)ee=s[se],ne=o[se],!s.hasOwnProperty(se)||ee===ne||ee==null&&ne==null||We(e,n,se,ee,s,ne)}var em=null,tm=null;function Xc(e){return e.nodeType===9?e:e.ownerDocument}function T1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function j1(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function nm(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var rm=null;function eM(){var e=window.event;return e&&e.type==="popstate"?e===rm?!1:(rm=e,!0):(rm=null,!1)}var A1=typeof setTimeout=="function"?setTimeout:void 0,tM=typeof clearTimeout=="function"?clearTimeout:void 0,R1=typeof Promise=="function"?Promise:void 0,nM=typeof queueMicrotask=="function"?queueMicrotask:typeof R1<"u"?function(e){return R1.resolve(null).then(e).catch(rM)}:A1;function rM(e){setTimeout(function(){throw e})}function So(e){return e==="head"}function O1(e,n){var o=n,s=0,h=0;do{var y=o.nextSibling;if(e.removeChild(o),y&&y.nodeType===8)if(o=y.data,o==="/$"){if(0<s&&8>s){o=s;var A=e.ownerDocument;if(o&1&&Ls(A.documentElement),o&2&&Ls(A.body),o&4)for(o=A.head,Ls(o),A=o.firstChild;A;){var k=A.nextSibling,q=A.nodeName;A[Zi]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&A.rel.toLowerCase()==="stylesheet"||o.removeChild(A),A=k}}if(h===0){e.removeChild(y),Vs(n);return}h--}else o==="$"||o==="$?"||o==="$!"?h++:s=o.charCodeAt(0)-48;else s=0;o=y}while(o);Vs(n)}function om(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":om(o),cf(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function oM(e,n,o,s){for(;e.nodeType===1;){var h=o;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Zi])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(y=e.getAttribute("rel"),y==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(y!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(y=e.getAttribute("src"),(y!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&y&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var y=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===y)return e}else return e;if(e=Yn(e.nextSibling),e===null)break}return null}function aM(e,n,o){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o||(e=Yn(e.nextSibling),e===null))return null;return e}function am(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function iM(e,n){var o=e.ownerDocument;if(e.data!=="$?"||o.readyState==="complete")n();else{var s=function(){n(),o.removeEventListener("DOMContentLoaded",s)};o.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Yn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="F!"||n==="F")break;if(n==="/$")return null}}return e}var im=null;function N1(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}function M1(e,n,o){switch(n=Xc(o),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Ls(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);cf(e)}var Bn=new Map,_1=new Set;function Kc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pr=Y.d;Y.d={f:sM,r:lM,D:cM,C:uM,L:dM,m:fM,X:mM,S:hM,M:pM};function sM(){var e=Pr.f(),n=Hc();return e||n}function lM(e){var n=ka(e);n!==null&&n.tag===5&&n.type==="form"?Wx(n):Pr.r(e)}var pi=typeof document>"u"?null:document;function D1(e,n,o){var s=pi;if(s&&typeof n=="string"&&n){var h=Mn(n);h='link[rel="'+e+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),_1.has(h)||(_1.add(h),e={rel:e,crossOrigin:o,href:n},s.querySelector(h)===null&&(n=s.createElement("link"),$t(n,"link",e),_t(n),s.head.appendChild(n)))}}function cM(e){Pr.D(e),D1("dns-prefetch",e,null)}function uM(e,n){Pr.C(e,n),D1("preconnect",e,n)}function dM(e,n,o){Pr.L(e,n,o);var s=pi;if(s&&e&&n){var h='link[rel="preload"][as="'+Mn(n)+'"]';n==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Mn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Mn(o.imageSizes)+'"]')):h+='[href="'+Mn(e)+'"]';var y=h;switch(n){case"style":y=gi(e);break;case"script":y=yi(e)}Bn.has(y)||(e=C({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:e,as:n},o),Bn.set(y,e),s.querySelector(h)!==null||n==="style"&&s.querySelector(zs(y))||n==="script"&&s.querySelector(Bs(y))||(n=s.createElement("link"),$t(n,"link",e),_t(n),s.head.appendChild(n)))}}function fM(e,n){Pr.m(e,n);var o=pi;if(o&&e){var s=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+Mn(s)+'"][href="'+Mn(e)+'"]',y=h;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=yi(e)}if(!Bn.has(y)&&(e=C({rel:"modulepreload",href:e},n),Bn.set(y,e),o.querySelector(h)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Bs(y)))return}s=o.createElement("link"),$t(s,"link",e),_t(s),o.head.appendChild(s)}}}function hM(e,n,o){Pr.S(e,n,o);var s=pi;if(s&&e){var h=La(s).hoistableStyles,y=gi(e);n=n||"default";var A=h.get(y);if(!A){var k={loading:0,preload:null};if(A=s.querySelector(zs(y)))k.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":n},o),(o=Bn.get(y))&&sm(e,o);var q=A=s.createElement("link");_t(q),$t(q,"link",e),q._p=new Promise(function(W,oe){q.onload=W,q.onerror=oe}),q.addEventListener("load",function(){k.loading|=1}),q.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Fc(A,n,s)}A={type:"stylesheet",instance:A,count:1,state:k},h.set(y,A)}}}function mM(e,n){Pr.X(e,n);var o=pi;if(o&&e){var s=La(o).hoistableScripts,h=yi(e),y=s.get(h);y||(y=o.querySelector(Bs(h)),y||(e=C({src:e,async:!0},n),(n=Bn.get(h))&&lm(e,n),y=o.createElement("script"),_t(y),$t(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function pM(e,n){Pr.M(e,n);var o=pi;if(o&&e){var s=La(o).hoistableScripts,h=yi(e),y=s.get(h);y||(y=o.querySelector(Bs(h)),y||(e=C({src:e,async:!0,type:"module"},n),(n=Bn.get(h))&&lm(e,n),y=o.createElement("script"),_t(y),$t(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function I1(e,n,o,s){var h=(h=ae.current)?Kc(h):null;if(!h)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(n=gi(o.href),o=La(h).hoistableStyles,s=o.get(n),s||(s={type:"style",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=gi(o.href);var y=La(h).hoistableStyles,A=y.get(e);if(A||(h=h.ownerDocument||h,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(e,A),(y=h.querySelector(zs(e)))&&!y._p&&(A.instance=y,A.state.loading=5),Bn.has(e)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Bn.set(e,o),y||gM(h,e,o,A.state))),n&&s===null)throw Error(a(528,""));return A}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=yi(o),o=La(h).hoistableScripts,s=o.get(n),s||(s={type:"script",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function gi(e){return'href="'+Mn(e)+'"'}function zs(e){return'link[rel="stylesheet"]['+e+"]"}function k1(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function gM(e,n,o,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),$t(n,"link",o),_t(n),e.head.appendChild(n))}function yi(e){return'[src="'+Mn(e)+'"]'}function Bs(e){return"script[async]"+e}function L1(e,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+Mn(o.href)+'"]');if(s)return n.instance=s,_t(s),s;var h=C({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),_t(s),$t(s,"style",h),Fc(s,o.precedence,e),n.instance=s;case"stylesheet":h=gi(o.href);var y=e.querySelector(zs(h));if(y)return n.state.loading|=4,n.instance=y,_t(y),y;s=k1(o),(h=Bn.get(h))&&sm(s,h),y=(e.ownerDocument||e).createElement("link"),_t(y);var A=y;return A._p=new Promise(function(k,q){A.onload=k,A.onerror=q}),$t(y,"link",s),n.state.loading|=4,Fc(y,o.precedence,e),n.instance=y;case"script":return y=yi(o.src),(h=e.querySelector(Bs(y)))?(n.instance=h,_t(h),h):(s=o,(h=Bn.get(y))&&(s=C({},o),lm(s,h)),e=e.ownerDocument||e,h=e.createElement("script"),_t(h),$t(h,"link",s),e.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Fc(s,o.precedence,e));return n.instance}function Fc(e,n,o){for(var s=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=s.length?s[s.length-1]:null,y=h,A=0;A<s.length;A++){var k=s[A];if(k.dataset.precedence===n)y=k;else if(y!==h)break}y?y.parentNode.insertBefore(e,y.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(e,n.firstChild))}function sm(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function lm(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Qc=null;function z1(e,n,o){if(Qc===null){var s=new Map,h=Qc=new Map;h.set(o,s)}else h=Qc,s=h.get(o),s||(s=new Map,h.set(o,s));if(s.has(e))return s;for(s.set(e,null),o=o.getElementsByTagName(e),h=0;h<o.length;h++){var y=o[h];if(!(y[Zi]||y[Qt]||e==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var A=y.getAttribute(n)||"";A=e+A;var k=s.get(A);k?k.push(y):s.set(A,[y])}}return s}function B1(e,n,o){e=e.ownerDocument||e,e.head.insertBefore(o,n==="title"?e.querySelector("head > title"):null)}function yM(e,n,o){if(o===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function H1(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Hs=null;function bM(){}function xM(e,n,o){if(Hs===null)throw Error(a(475));var s=Hs;if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var h=gi(o.href),y=e.querySelector(zs(h));if(y){e=y._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=Zc.bind(s),e.then(s,s)),n.state.loading|=4,n.instance=y,_t(y);return}y=e.ownerDocument||e,o=k1(o),(h=Bn.get(h))&&sm(o,h),y=y.createElement("link"),_t(y);var A=y;A._p=new Promise(function(k,q){A.onload=k,A.onerror=q}),$t(y,"link",o),n.instance=y}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(s.count++,n=Zc.bind(s),e.addEventListener("load",n),e.addEventListener("error",n))}}function vM(){if(Hs===null)throw Error(a(475));var e=Hs;return e.stylesheets&&e.count===0&&cm(e,e.stylesheets),0<e.count?function(n){var o=setTimeout(function(){if(e.stylesheets&&cm(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(o)}}:null}function Zc(){if(this.count--,this.count===0){if(this.stylesheets)cm(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Wc=null;function cm(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wc=new Map,n.forEach(SM,e),Wc=null,Zc.call(e))}function SM(e,n){if(!(n.state.loading&4)){var o=Wc.get(e);if(o)var s=o.get(null);else{o=new Map,Wc.set(e,o);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<h.length;y++){var A=h[y];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(o.set(A.dataset.precedence,A),s=A)}s&&o.set(null,s)}h=n.instance,A=h.getAttribute("data-precedence"),y=o.get(A)||s,y===s&&o.set(null,h),o.set(A,h),this.count++,s=Zc.bind(this),h.addEventListener("load",s),h.addEventListener("error",s),y?y.parentNode.insertBefore(h,y.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),n.state.loading|=4}}var Ps={$$typeof:R,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function CM(e,n,o,s,h,y,A,k){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.hiddenUpdates=Ft(null),this.identifierPrefix=s,this.onUncaughtError=h,this.onCaughtError=y,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function P1(e,n,o,s,h,y,A,k,q,W,oe,se){return e=new CM(e,n,o,A,k,q,W,se),n=1,y===!0&&(n|=24),y=pn(3,null,null,n),e.current=y,y.stateNode=e,n=Vf(),n.refCount++,e.pooledCache=n,n.refCount++,y.memoizedState={element:s,isDehydrated:o,cache:n},Kf(y),e}function U1(e){return e?(e=Ka,e):Ka}function $1(e,n,o,s,h,y){h=U1(h),s.context===null?s.context=h:s.pendingContext=h,s=so(n),s.payload={element:o},y=y===void 0?null:y,y!==null&&(s.callback=y),o=lo(e,s,n),o!==null&&(vn(o,e,n),gs(o,e,n))}function G1(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function um(e,n){G1(e,n),(e=e.alternate)&&G1(e,n)}function V1(e){if(e.tag===13){var n=Xa(e,67108864);n!==null&&vn(n,e,67108864),um(e,67108864)}}var Jc=!0;function wM(e,n,o,s){var h=V.T;V.T=null;var y=Y.p;try{Y.p=2,dm(e,n,o,s)}finally{Y.p=y,V.T=h}}function EM(e,n,o,s){var h=V.T;V.T=null;var y=Y.p;try{Y.p=8,dm(e,n,o,s)}finally{Y.p=y,V.T=h}}function dm(e,n,o,s){if(Jc){var h=fm(s);if(h===null)Wh(e,n,s,eu,o),Y1(e,s);else if(jM(h,e,n,o,s))s.stopPropagation();else if(Y1(e,s),n&4&&-1<TM.indexOf(e)){for(;h!==null;){var y=ka(h);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var A=no(y.pendingLanes);if(A!==0){var k=y;for(k.pendingLanes|=2,k.entangledLanes|=2;A;){var q=1<<31-Ht(A);k.entanglements[1]|=q,A&=~q}lr(y),(Fe&6)===0&&(zc=ht()+500,Ds(0))}}break;case 13:k=Xa(y,2),k!==null&&vn(k,y,2),Hc(),um(y,2)}if(y=fm(s),y===null&&Wh(e,n,s,eu,o),y===h)break;h=y}h!==null&&s.stopPropagation()}else Wh(e,n,s,null,o)}}function fm(e){return e=yf(e),hm(e)}var eu=null;function hm(e){if(eu=null,e=Ia(e),e!==null){var n=l(e);if(n===null)e=null;else{var o=n.tag;if(o===13){if(e=u(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return eu=e,null}function q1(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(he()){case at:return 2;case it:return 8;case Mt:case $n:return 32;case to:return 268435456;default:return 32}default:return 32}}var mm=!1,Co=null,wo=null,Eo=null,Us=new Map,$s=new Map,To=[],TM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Y1(e,n){switch(e){case"focusin":case"focusout":Co=null;break;case"dragenter":case"dragleave":wo=null;break;case"mouseover":case"mouseout":Eo=null;break;case"pointerover":case"pointerout":Us.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":$s.delete(n.pointerId)}}function Gs(e,n,o,s,h,y){return e===null||e.nativeEvent!==y?(e={blockedOn:n,domEventName:o,eventSystemFlags:s,nativeEvent:y,targetContainers:[h]},n!==null&&(n=ka(n),n!==null&&V1(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),e)}function jM(e,n,o,s,h){switch(n){case"focusin":return Co=Gs(Co,e,n,o,s,h),!0;case"dragenter":return wo=Gs(wo,e,n,o,s,h),!0;case"mouseover":return Eo=Gs(Eo,e,n,o,s,h),!0;case"pointerover":var y=h.pointerId;return Us.set(y,Gs(Us.get(y)||null,e,n,o,s,h)),!0;case"gotpointercapture":return y=h.pointerId,$s.set(y,Gs($s.get(y)||null,e,n,o,s,h)),!0}return!1}function X1(e){var n=Ia(e.target);if(n!==null){var o=l(n);if(o!==null){if(n=o.tag,n===13){if(n=u(o),n!==null){e.blockedOn=n,sf(e.priority,function(){if(o.tag===13){var s=xn();s=_a(s);var h=Xa(o,s);h!==null&&vn(h,o,s),um(o,s)}});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tu(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=fm(e.nativeEvent);if(o===null){o=e.nativeEvent;var s=new o.constructor(o.type,o);gf=s,o.target.dispatchEvent(s),gf=null}else return n=ka(o),n!==null&&V1(n),e.blockedOn=o,!1;n.shift()}return!0}function K1(e,n,o){tu(e)&&o.delete(n)}function AM(){mm=!1,Co!==null&&tu(Co)&&(Co=null),wo!==null&&tu(wo)&&(wo=null),Eo!==null&&tu(Eo)&&(Eo=null),Us.forEach(K1),$s.forEach(K1)}function nu(e,n){e.blockedOn===n&&(e.blockedOn=null,mm||(mm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,AM)))}var ru=null;function F1(e){ru!==e&&(ru=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ru===e&&(ru=null);for(var n=0;n<e.length;n+=3){var o=e[n],s=e[n+1],h=e[n+2];if(typeof s!="function"){if(hm(s||o)===null)continue;break}var y=ka(o);y!==null&&(e.splice(n,3),n-=3,hh(y,{pending:!0,data:h,method:o.method,action:s},s,h))}}))}function Vs(e){function n(q){return nu(q,e)}Co!==null&&nu(Co,e),wo!==null&&nu(wo,e),Eo!==null&&nu(Eo,e),Us.forEach(n),$s.forEach(n);for(var o=0;o<To.length;o++){var s=To[o];s.blockedOn===e&&(s.blockedOn=null)}for(;0<To.length&&(o=To[0],o.blockedOn===null);)X1(o),o.blockedOn===null&&To.shift();if(o=(e.ownerDocument||e).$$reactFormReplay,o!=null)for(s=0;s<o.length;s+=3){var h=o[s],y=o[s+1],A=h[on]||null;if(typeof y=="function")A||F1(o);else if(A){var k=null;if(y&&y.hasAttribute("formAction")){if(h=y,A=y[on]||null)k=A.formAction;else if(hm(h)!==null)continue}else k=A.action;typeof k=="function"?o[s+1]=k:(o.splice(s,3),s-=3),F1(o)}}}function pm(e){this._internalRoot=e}ou.prototype.render=pm.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var o=n.current,s=xn();$1(o,s,e,n,null,null)},ou.prototype.unmount=pm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;$1(e.current,2,null,e,null,null),Hc(),n[Da]=null}};function ou(e){this._internalRoot=e}ou.prototype.unstable_scheduleHydration=function(e){if(e){var n=rr();e={blockedOn:null,target:e,priority:n};for(var o=0;o<To.length&&n!==0&&n<To[o].priority;o++);To.splice(o,0,e),o===0&&X1(e)}};var Q1=r.version;if(Q1!=="19.1.1")throw Error(a(527,Q1,"19.1.1"));Y.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=m(n),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var RM={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!au.isDisabled&&au.supportsFiber)try{Gn=au.inject(RM),At=au}catch{}}return Mi.createRoot=function(e,n){if(!c(e))throw Error(a(299));var o=!1,s="",h=fv,y=hv,A=mv,k=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(A=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(k=n.unstable_transitionCallbacks)),n=P1(e,1,!1,null,null,o,s,h,y,A,k,null),e[Da]=n.current,Zh(e),new pm(n)},Mi.hydrateRoot=function(e,n,o){if(!c(e))throw Error(a(299));var s=!1,h="",y=fv,A=hv,k=mv,q=null,W=null;return o!=null&&(o.unstable_strictMode===!0&&(s=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(A=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(q=o.unstable_transitionCallbacks),o.formState!==void 0&&(W=o.formState)),n=P1(e,1,!0,n,o??null,s,h,y,A,k,q,W),n.context=U1(null),o=n.current,s=xn(),s=_a(s),h=so(s),h.callback=null,lo(o,h,s),o=s,n.current.lanes=o,Oe(n,o),lr(n),e[Da]=n.current,Zh(e),new ou(n)},Mi.version="19.1.1",Mi}var Zm;function tC(){if(Zm)return Mu.exports;Zm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Mu.exports=eC(),Mu.exports}var nC=tC(),Yr=Fm();function Wm(t){var r,i,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var c=t.length;for(r=0;r<c;r++)t[r]&&(i=Wm(t[r]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}function Jm(){for(var t,r,i=0,a="",c=arguments.length;i<c;i++)(t=arguments[i])&&(r=Wm(t))&&(a&&(a+=" "),a+=r);return a}const rC=(t,r)=>{const i=new Array(t.length+r.length);for(let a=0;a<t.length;a++)i[a]=t[a];for(let a=0;a<r.length;a++)i[t.length+a]=r[a];return i},oC=(t,r)=>({classGroupId:t,validator:r}),ep=(t=new Map,r=null,i)=>({nextPart:t,validators:r,classGroupId:i}),nl="-",tp=[],aC="arbitrary..",iC=t=>{const r=lC(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return sC(u);const d=u.split(nl),m=d[0]===""&&d.length>1?1:0;return np(d,m,r)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=a[u],p=i[u];return m?p?rC(p,m):m:p||tp}return i[u]||tp}}},np=(t,r,i)=>{if(t.length-r===0)return i.classGroupId;const c=t[r],l=i.nextPart.get(c);if(l){const p=np(t,r+1,l);if(p)return p}const u=i.validators;if(u===null)return;const d=r===0?t.join(nl):t.slice(r).join(nl),m=u.length;for(let p=0;p<m;p++){const C=u[p];if(C.validator(d))return C.classGroupId}},sC=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=t.slice(1,-1),i=r.indexOf(":"),a=r.slice(0,i);return a?aC+a:void 0})(),lC=t=>{const{theme:r,classGroups:i}=t;return cC(i,r)},cC=(t,r)=>{const i=ep();for(const a in t){const c=t[a];ku(c,i,a,r)}return i},ku=(t,r,i,a)=>{const c=t.length;for(let l=0;l<c;l++){const u=t[l];uC(u,r,i,a)}},uC=(t,r,i,a)=>{if(typeof t=="string"){dC(t,r,i);return}if(typeof t=="function"){fC(t,r,i,a);return}hC(t,r,i,a)},dC=(t,r,i)=>{const a=t===""?r:rp(r,t);a.classGroupId=i},fC=(t,r,i,a)=>{if(mC(t)){ku(t(a),r,i,a);return}r.validators===null&&(r.validators=[]),r.validators.push(oC(i,t))},hC=(t,r,i,a)=>{const c=Object.entries(t),l=c.length;for(let u=0;u<l;u++){const[d,m]=c[u];ku(m,rp(r,d),i,a)}},rp=(t,r)=>{let i=t;const a=r.split(nl),c=a.length;for(let l=0;l<c;l++){const u=a[l];let d=i.nextPart.get(u);d||(d=ep(),i.nextPart.set(u,d)),i=d}return i},mC=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,pC=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,i=Object.create(null),a=Object.create(null);const c=(l,u)=>{i[l]=u,r++,r>t&&(r=0,a=i,i=Object.create(null))};return{get(l){let u=i[l];if(u!==void 0)return u;if((u=a[l])!==void 0)return c(l,u),u},set(l,u){l in i?i[l]=u:c(l,u)}}},Lu="!",op=":",gC=[],ap=(t,r,i,a,c)=>({modifiers:t,hasImportantModifier:r,baseClassName:i,maybePostfixModifierPosition:a,isExternal:c}),yC=t=>{const{prefix:r,experimentalParseClassName:i}=t;let a=c=>{const l=[];let u=0,d=0,m=0,p;const C=c.length;for(let S=0;S<C;S++){const w=c[S];if(u===0&&d===0){if(w===op){l.push(c.slice(m,S)),m=S+1;continue}if(w==="/"){p=S;continue}}w==="["?u++:w==="]"?u--:w==="("?d++:w===")"&&d--}const g=l.length===0?c:c.slice(m);let b=g,x=!1;g.endsWith(Lu)?(b=g.slice(0,-1),x=!0):g.startsWith(Lu)&&(b=g.slice(1),x=!0);const v=p&&p>m?p-m:void 0;return ap(l,x,b,v)};if(r){const c=r+op,l=a;a=u=>u.startsWith(c)?l(u.slice(c.length)):ap(gC,!1,u,void 0,!0)}if(i){const c=a;a=l=>i({className:l,parseClassName:c})}return a},bC=t=>{const r=new Map;return t.orderSensitiveModifiers.forEach((i,a)=>{r.set(i,1e6+a)}),i=>{const a=[];let c=[];for(let l=0;l<i.length;l++){const u=i[l],d=u[0]==="[",m=r.has(u);d||m?(c.length>0&&(c.sort(),a.push(...c),c=[]),a.push(u)):c.push(u)}return c.length>0&&(c.sort(),a.push(...c)),a}},xC=t=>({cache:pC(t.cacheSize),parseClassName:yC(t),sortModifiers:bC(t),postfixLookupClassGroupIds:vC(t),...iC(t)}),vC=t=>{const r=Object.create(null),i=t.postfixLookupClassGroups;if(i)for(let a=0;a<i.length;a++)r[i[a]]=!0;return r},SC=/\s+/,CC=(t,r)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:c,sortModifiers:l,postfixLookupClassGroupIds:u}=r,d=[],m=t.trim().split(SC);let p="";for(let C=m.length-1;C>=0;C-=1){const g=m[C],{isExternal:b,modifiers:x,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:w}=i(g);if(b){p=g+(p.length>0?" "+p:p);continue}let T=!!w,j;if(T){const _=S.substring(0,w);j=a(_);const I=j&&u[j]?a(S):void 0;I&&I!==j&&(j=I,T=!1)}else j=a(S);if(!j){if(!T){p=g+(p.length>0?" "+p:p);continue}if(j=a(S),!j){p=g+(p.length>0?" "+p:p);continue}T=!1}const R=x.length===0?"":x.length===1?x[0]:l(x).join(":"),O=v?R+Lu:R,M=O+j;if(d.indexOf(M)>-1)continue;d.push(M);const D=c(j,T);for(let _=0;_<D.length;++_){const I=D[_];d.push(O+I)}p=g+(p.length>0?" "+p:p)}return p},wC=(...t)=>{let r=0,i,a,c="";for(;r<t.length;)(i=t[r++])&&(a=ip(i))&&(c&&(c+=" "),c+=a);return c},ip=t=>{if(typeof t=="string")return t;let r,i="";for(let a=0;a<t.length;a++)t[a]&&(r=ip(t[a]))&&(i&&(i+=" "),i+=r);return i},EC=(t,...r)=>{let i,a,c,l;const u=m=>{const p=r.reduce((C,g)=>g(C),t());return i=xC(p),a=i.cache.get,c=i.cache.set,l=d,d(m)},d=m=>{const p=a(m);if(p)return p;const C=CC(m,i);return c(m,C),C};return l=u,(...m)=>l(wC(...m))},TC=[],Tt=t=>{const r=i=>i[t]||TC;return r.isThemeGetter=!0,r.themeKey=t,r},sp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,AC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,OC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,NC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xr=t=>jC.test(t),Ie=t=>!!t&&!Number.isNaN(Number(t)),Zn=t=>!!t&&Number.isInteger(Number(t)),zu=t=>t.endsWith("%")&&Ie(t.slice(0,-1)),ur=t=>AC.test(t),cp=()=>!0,_C=t=>RC.test(t)&&!OC.test(t),Bu=()=>!1,DC=t=>NC.test(t),IC=t=>MC.test(t),kC=t=>!fe(t)&&!me(t),LC=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),zC=t=>Kr(t,pp,Bu),fe=t=>sp.test(t),Mo=t=>Kr(t,gp,_C),up=t=>Kr(t,qC,Ie),BC=t=>Kr(t,bp,cp),HC=t=>Kr(t,yp,Bu),dp=t=>Kr(t,hp,Bu),PC=t=>Kr(t,mp,IC),rl=t=>Kr(t,xp,DC),me=t=>lp.test(t),_i=t=>_o(t,gp),UC=t=>_o(t,yp),fp=t=>_o(t,hp),$C=t=>_o(t,pp),GC=t=>_o(t,mp),ol=t=>_o(t,xp,!0),VC=t=>_o(t,bp,!0),Kr=(t,r,i)=>{const a=sp.exec(t);return a?a[1]?r(a[1]):i(a[2]):!1},_o=(t,r,i=!1)=>{const a=lp.exec(t);return a?a[1]?r(a[1]):i:!1},hp=t=>t==="position"||t==="percentage",mp=t=>t==="image"||t==="url",pp=t=>t==="length"||t==="size"||t==="bg-size",gp=t=>t==="length",qC=t=>t==="number",yp=t=>t==="family-name",bp=t=>t==="number"||t==="weight",xp=t=>t==="shadow",YC=EC(()=>{const t=Tt("color"),r=Tt("font"),i=Tt("text"),a=Tt("font-weight"),c=Tt("tracking"),l=Tt("leading"),u=Tt("breakpoint"),d=Tt("container"),m=Tt("spacing"),p=Tt("radius"),C=Tt("shadow"),g=Tt("inset-shadow"),b=Tt("text-shadow"),x=Tt("drop-shadow"),v=Tt("blur"),S=Tt("perspective"),w=Tt("aspect"),T=Tt("ease"),j=Tt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...O(),me,fe],D=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],I=()=>[me,fe,m],B=()=>[Xr,"full","auto",...I()],H=()=>[Zn,"none","subgrid",me,fe],z=()=>["auto",{span:["full",Zn,me,fe]},Zn,me,fe],$=()=>[Zn,"auto",me,fe],X=()=>["auto","min","max","fr",me,fe],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...I()],Y=()=>[Xr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],L=()=>[d,Xr,"screen","full","dvw","lvw","svw","min","max","fit",...I()],P=()=>[Xr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],N=()=>[t,me,fe],U=()=>[...O(),fp,dp,{position:[me,fe]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Q=()=>["auto","cover","contain",$C,zC,{size:[me,fe]}],le=()=>[zu,_i,Mo],re=()=>["","none","full",p,me,fe],ae=()=>["",Ie,_i,Mo],ge=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[Ie,zu,fp,dp],de=()=>["","none",v,me,fe],Me=()=>["none",Ie,me,fe],De=()=>["none",Ie,me,fe],we=()=>[Ie,me,fe],xe=()=>[Xr,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ur],breakpoint:[ur],color:[cp],container:[ur],"drop-shadow":[ur],ease:["in","out","in-out"],font:[kC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ur],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ur],shadow:[ur],spacing:["px",Ie],text:[ur],"text-shadow":[ur],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xr,fe,me,w]}],container:["container"],"container-type":[{"@container":["","normal","size",me,fe]}],"container-named":[LC],columns:[{columns:[Ie,"auto",fe,me,d]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Zn,"auto",me,fe]}],basis:[{basis:[Xr,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,Xr,"auto","initial","none",fe]}],grow:[{grow:["",Ie,me,fe]}],shrink:[{shrink:["",Ie,me,fe]}],order:[{order:[Zn,"first","last","none",me,fe]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],w:[{w:[d,"screen",...Y()]}],"min-w":[{"min-w":[d,"screen","none",...Y()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh","none",...Y()]}],"font-size":[{text:["base",i,_i,Mo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,VC,BC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zu,fe]}],"font-family":[{font:[UC,HC,r]}],"font-features":[{"font-features":[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,me,fe]}],"line-clamp":[{"line-clamp":[Ie,"none",me,up]}],leading:[{leading:["none",l,...I()]}],"list-image":[{"list-image":["none",me,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",me,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",me,Mo]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Ie,"auto",me,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[Zn,me,fe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zn,me,fe],radial:["",me,fe],conic:["",Zn,me,fe]},GC,PC]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,me,fe]}],"outline-w":[{outline:["",Ie,_i,Mo]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","inner","none",C,ol,rl]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",g,ol,rl]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Ie,Mo]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",b,ol,rl]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Ie,me,fe]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[me,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",me,fe]}],filter:[{filter:["","none",me,fe]}],blur:[{blur:de()}],brightness:[{brightness:[Ie,me,fe]}],contrast:[{contrast:[Ie,me,fe]}],"drop-shadow":[{"drop-shadow":["","none",x,ol,rl]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",Ie,me,fe]}],"hue-rotate":[{"hue-rotate":[Ie,me,fe]}],invert:[{invert:["",Ie,me,fe]}],saturate:[{saturate:[Ie,me,fe]}],sepia:[{sepia:["",Ie,me,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",me,fe]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,me,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,me,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,me,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,me,fe]}],"backdrop-invert":[{"backdrop-invert":["",Ie,me,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,me,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,me,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,me,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",me,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",me,fe]}],ease:[{ease:["linear","initial",T,me,fe]}],delay:[{delay:[Ie,me,fe]}],animate:[{animate:["none",j,me,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,me,fe]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[me,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],zoom:[{zoom:[Zn,me,fe]}],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me,fe]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[Ie,_i,Mo,up]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ve(...t){return YC(Jm(t))}var XC=Object.defineProperty,Hu=(t,r)=>XC(t,"name",{value:r,configurable:!0});function Pu(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}Hu(Pu,"setRef");function vp(...t){return r=>{let i=!1;const a=t.map(c=>{const l=Pu(c,r);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let c=0;c<a.length;c++){const l=a[c];typeof l=="function"?l():Pu(t[c],null)}}}}Hu(vp,"composeRefs");function ke(...t){return E.useCallback(vp(...t),t)}Hu(ke,"useComposedRefs");var KC=Object.defineProperty,un=(t,r)=>KC(t,"name",{value:r,configurable:!0});function dr(t){const r=E.forwardRef((i,a)=>{let{children:c,...l}=i,u=null,d=!1;const m=[];c=Ap(c),E.Children.forEach(c,b=>{if(Tp(b)){d=!0;const x=b;let v="child"in x.props?x.props.child:x.props.children;for(;Uu(v)&&typeof al=="function";)v=al(v._payload);u=QC(x,v),m.push(u?.props?.children)}else m.push(b)}),u?u=E.cloneElement(u,void 0,m):!d&&E.Children.count(c)===1&&E.isValidElement(c)&&(u=c);const p=u?Ep(u):void 0,C=ke(a,p);if(!u){if(c||c===0)throw new Error(d?JC(t):WC(t));return c}const g=wp(l,u.props??{});return u.type!==E.Fragment&&(g.ref=a?C:p),E.cloneElement(u,g)});return r.displayName=`${t}.Slot`,r}un(dr,"createSlot");var FC=dr("Slot"),Sp=Symbol.for("radix.slottable");function Cp(t){const r=un(i=>"child"in i?i.children(i.child):i.children,"Slottable");return r.displayName=`${t}.Slottable`,r.__radixId=Sp,r}un(Cp,"createSlottable");var QC=un((t,r)=>"child"in t.props?E.isValidElement(r)?E.cloneElement(r,void 0,t.props.children(r.props.children)):null:E.isValidElement(r)?r:null,"getSlottableElementFromSlottable");function wp(t,r){const i={...r};for(const a in r){const c=t[a],l=r[a];/^on[A-Z]/.test(a)?c&&l?i[a]=(...d)=>{const m=l(...d);return c(...d),m}:c&&(i[a]=c):a==="style"?i[a]={...c,...l}:a==="className"?i[a]=[c,l].filter(Boolean).join(" "):a==="aria-describedby"&&(i[a]=Rp(l,c))}return{...t,...i}}un(wp,"mergeProps");function Ep(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}un(Ep,"getElementRef");function Tp(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Sp}un(Tp,"isSlottable");var ZC=Symbol.for("react.lazy");function Uu(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===ZC&&"_payload"in t&&jp(t._payload)}un(Uu,"isLazyComponent");function jp(t){return typeof t=="object"&&t!==null&&"then"in t}un(jp,"isPromiseLike");function Ap(t){let r=t;for(;Uu(r)&&typeof al=="function";)r=al(r._payload);return r}un(Ap,"useUnwrappedLazy");function Rp(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}un(Rp,"concatAriaDescribedby");var WC=un(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),JC=un(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),al=No[" use ".trim().toString()],ew=Object.defineProperty,tw=(t,r)=>ew(t,"name",{value:r,configurable:!0}),nw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=nw.reduce((t,r)=>{const i=dr(`Primitive.${r}`),a=E.forwardRef((c,l)=>{const{asChild:u,...d}=c,m=u?i:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(m,{...d,ref:l})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{});function Op(t,r){t&&Yr.flushSync(()=>t.dispatchEvent(r))}tw(Op,"dispatchDiscreteCustomEvent");var rw=Object.defineProperty,ow=(t,r)=>rw(t,"name",{value:r,configurable:!0}),Np=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),aw=E.forwardRef(ow(function(r,i){return f.jsx(He.span,{...r,ref:i,style:{...Np,...r.style}})},"VisuallyHidden")),iw=Object.defineProperty,En=(t,r)=>iw(t,"name",{value:r,configurable:!0});function sw(t,r){const i=E.createContext(r);i.displayName=t+"Context";const a=En(l=>{const{children:u,...d}=l,m=E.useMemo(()=>d,Object.values(d));return f.jsx(i.Provider,{value:m,children:u})},"Provider");a.displayName=t+"Provider";function c(l,u={}){const{optional:d=!1}=u,m=E.useContext(i);if(m)return m;if(r!==void 0)return r;if(!d)throw new Error(`\`${l}\` must be used within \`${t}\``)}return En(c,"useContext"),[a,c]}En(sw,"createContext");function Tn(t,r=[]){let i=[];function a(l,u){const d=E.createContext(u);d.displayName=l+"Context";const m=i.length;i=[...i,u];const p=En(g=>{const{scope:b,children:x,...v}=g,S=b?.[t]?.[m]||d,w=E.useMemo(()=>v,Object.values(v));return f.jsx(S.Provider,{value:w,children:x})},"Provider");p.displayName=l+"Provider";function C(g,b,x={}){const{optional:v=!1}=x,S=b?.[t]?.[m]||d,w=E.useContext(S);if(w)return w;if(u!==void 0)return u;if(!v)throw new Error(`\`${g}\` must be used within \`${l}\``)}return En(C,"useContext"),[p,C]}En(a,"createContext");const c=En(()=>{const l=i.map(u=>E.createContext(u));return En(function(d){const m=d?.[t]||l;return E.useMemo(()=>({[`__scope${t}`]:{...d,[t]:m}}),[d,m])},"useScope")},"createScope");return c.scopeName=t,[a,Mp(c,...r)]}En(Tn,"createContextScope");function Mp(...t){const r=t[0];if(t.length===1)return r;const i=En(()=>{const a=t.map(c=>({useScope:c(),scopeName:c.scopeName}));return En(function(l){const u=a.reduce((d,{useScope:m,scopeName:p})=>{const g=m(l)[`__scope${p}`];return{...d,...g}},{});return E.useMemo(()=>({[`__scope${r.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return i.scopeName=r.scopeName,i}En(Mp,"composeContextScopes");var lt=globalThis?.document?E.useLayoutEffect:()=>{},lw=Object.defineProperty,jt=(t,r)=>lw(t,"name",{value:r,configurable:!0});function il(t){const r=t+"CollectionProvider",[i,a]=Tn(r),[c,l]=i(r,{collectionRef:{current:null},itemMap:new Map}),u=jt(S=>{const{scope:w,children:T}=S,j=E.useRef(null),R=E.useRef(new Map).current;return f.jsx(c,{scope:w,itemMap:R,collectionRef:j,children:T})},"CollectionProvider");u.displayName=r;const d=t+"CollectionSlot",m=dr(d),p=E.forwardRef((S,w)=>{const{scope:T,children:j}=S,R=l(d,T),O=ke(w,R.collectionRef);return f.jsx(m,{ref:O,children:j})});p.displayName=d;const C=t+"CollectionItemSlot",g="data-radix-collection-item",b=dr(C),x=E.forwardRef((S,w)=>{const{scope:T,children:j,...R}=S,O=E.useRef(null),M=ke(w,O),D=l(C,T);return E.useEffect(()=>(D.itemMap.set(O,{ref:O,...R}),()=>void D.itemMap.delete(O))),f.jsx(b,{[g]:"",ref:M,children:j})});x.displayName=C;function v(S){const w=l(t+"CollectionConsumer",S);return E.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const R=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((D,_)=>R.indexOf(D.ref.current)-R.indexOf(_.ref.current))},[w.collectionRef,w.itemMap])}return jt(v,"useCollection"),[{Provider:u,Slot:p,ItemSlot:x},v,a]}jt(il,"createCollection");var _p=new WeakMap,sl=(fn=class extends Map{constructor(i){super(i);J1(this,gt);ym(this,gt,[...super.keys()]),_p.set(this,!0)}set(i,a){return _p.get(this)&&!this.has(i)&&Gt(this,gt).push(i),super.set(i,a),this}insert(i,a,c){const l=this.has(a),u=l?this.size:this.size+1,d=$u(i),m=d>=0?Math.min(d,u-1):Math.max(u+d,0);if(l?Gt(this,gt).indexOf(a)===m:m===this.size)return this.set(a,c),this;const p=Gt(this,gt).filter(g=>g!==a);p.splice(m,0,a);const C=p.map(g=>[g,g===a?c:this.get(g)]);this.clear();for(const[g,b]of C)this.set(g,b);return this}with(i,a,c){const l=new fn(this);return l.insert(i,a,c),l}before(i){const a=Gt(this,gt).indexOf(i)-1;if(!(a<0))return this.entryAt(a)}setBefore(i,a,c){const l=Gt(this,gt).indexOf(i);if(l===-1)return this;const u=Gt(this,gt).indexOf(a),d=u!==-1&&u<l?l-1:l;return this.insert(d,a,c)}after(i){let a=Gt(this,gt).indexOf(i);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(i,a,c){const l=Gt(this,gt).indexOf(i);if(l===-1)return this;const u=Gt(this,gt).indexOf(a),d=u!==-1&&u<=l?l:l+1;return this.insert(d,a,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ym(this,gt,[]),super.clear()}delete(i){const a=super.delete(i);return a&&Gt(this,gt).splice(Gt(this,gt).indexOf(i),1),a}deleteAt(i){const a=this.keyAt(i);return a!==void 0?this.delete(a):!1}at(i){const a=ll(Gt(this,gt),i);if(a!==void 0)return this.get(a)}entryAt(i){const a=ll(Gt(this,gt),i);if(a!==void 0)return[a,this.get(a)]}indexOf(i){return Gt(this,gt).indexOf(i)}keyAt(i){return ll(Gt(this,gt),i)}from(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return l;c++}}findIndex(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return c;c++}return-1}filter(i,a){const c=[];let l=0;for(const u of this)Reflect.apply(i,a,[u,l,this])&&c.push(u),l++;return new fn(c)}map(i,a){const c=[];let l=0;for(const u of this)c.push([u[0],Reflect.apply(i,a,[u,l,this])]),l++;return new fn(c)}reduce(...i){const[a,c]=i,l=i.length>1;if(!l&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=0,d=c;for(const m of this)u===0&&!l?d=m:d=Reflect.apply(a,this,[d,m,u,this]),u++;return d}reduceRight(...i){const[a,c]=i,l=i.length>1;if(!l&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=c;for(let d=this.size-1;d>=0;d--){const m=this.entryAt(d);d===this.size-1&&!l?u=m:u=Reflect.apply(a,this,[u,m,d,this])}return u}sort(i){if(typeof i!="function")throw new TypeError("OrderedDict.sort requires a compare function");const a=[...this.entries()].sort(i);this.clear();for(const[c,l]of a)this.set(c,l);return this}toSorted(i){if(typeof i!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const a=[...this.entries()].sort(i);return new fn(a)}toReversed(){const i=new fn;for(let a=this.size-1;a>=0;a--){const c=this.keyAt(a),l=this.get(c);i.set(c,l)}return i}toSpliced(...i){const a=[...this.entries()];return a.splice(...i),new fn(a)}slice(i,a){const c=new fn;for(const l of Gt(this,gt).slice(i,a))c.set(l,this.get(l));return c}every(i,a){let c=0;for(const l of this){if(!Reflect.apply(i,a,[l,c,this]))return!1;c++}return!0}some(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return!0;c++}return!1}},gt=new WeakMap,jt(fn,"OrderedDict"),fn);function ll(t,r){if("at"in Array.prototype)return Array.prototype.at.call(t,r);const i=Dp(t,r);return i===-1?void 0:t[i]}jt(ll,"at");function Dp(t,r){const i=t.length,a=$u(r),c=a>=0?a:i+a;return c<0||c>=i?-1:c}jt(Dp,"toSafeIndex");function $u(t){return t!==t||t===0?0:Math.trunc(t)}jt($u,"toSafeInteger");function cw(t){const r=t+"CollectionProvider",[i,a]=Tn(r),[c,l]=i(r);c.displayName=t+"CollectionStableContextProvider";const[u,d]=i(r);u.displayName=t+"CollectionStatefulContextProvider";const m=jt(({state:D,..._})=>D?f.jsx(C,{..._,state:D}):f.jsx(p,{..._}),"CollectionProvider");m.displayName=r;const p=jt(D=>{const _=j();return f.jsx(C,{...D,state:_})},"CollectionInit");p.displayName=t+"CollectionInit";const C=jt(D=>{const{scope:_,children:I,state:B}=D,H=E.useRef(null),[z,$]=E.useState(null),X=ke(H,$),[G,te]=B,V=E.useRef(new sl),Y=E.useCallback(()=>{const L=V.current;return Lp(L)||L.sort(cl),L},[]);return E.useEffect(()=>{if(!z)return;const L=zp(()=>{te(P=>{const N=P.toSorted(cl);return N.some(([J],Q)=>P.keyAt(Q)!==J)?N:P})});return L.observe(z,{childList:!0,subtree:!0}),()=>{L.disconnect()}},[z,te]),f.jsx(c,{scope:_,collectionElementRef:X,collectionElementRefObject:H,getCollection:Y,setCollection:te,registryRef:V,children:f.jsx(u,{scope:_,collectionElement:z,collection:G,children:I})})},"CollectionProviderImpl");C.displayName=t+"CollectionProviderImpl";const g=t+"CollectionSlot",b=dr(g),x=E.forwardRef((D,_)=>{const{scope:I,children:B}=D,H=l(g,I),z=ke(_,H.collectionElementRef);return f.jsx(b,{ref:z,children:B})});x.displayName=g;const v=t+"CollectionItemSlot",S="data-radix-collection-item",w=dr(v),T=E.forwardRef((D,_)=>{const{scope:I,children:B,...H}=D,z=E.useRef(null),$=l(v,I),{setCollection:X,registryRef:G}=$,te=E.useRef(H);Ip(te.current,H)||(te.current=H);const V=te.current,Y=E.useCallback(N=>{const U=G.current;N?U.set(N,{...te.current,element:N}):z.current&&U.delete(z.current)},[G]),L=ke(_,Y,z);lt(()=>{const N=z.current,U=G.current;N&&U.has(N)&&U.set(N,{...V,element:N})},[V,G]);const P=E.useRef(null);return E.useEffect(()=>{const N=z.current,U=P.current;(U?.element??null)===N&&(!N||U?.itemData===V)||(P.current=N?{element:N,itemData:V}:null,X(J=>{const Q=new sl(J);return U&&U.element!==N&&Q.delete(U.element),N&&Q.set(N,{...V,element:N}),Q.sort(cl)}))}),E.useEffect(()=>()=>{const N=P.current;P.current=null,N&&X(U=>{if(!U.has(N.element))return U;const J=new sl(U);return J.delete(N.element),J})},[X]),f.jsx(w,{[S]:"",ref:L,children:B})});T.displayName=v;function j(){return E.useState(new sl)}jt(j,"useInitCollection");function R(D){const{collection:_}=d(t+"CollectionConsumer",D);return _}jt(R,"useCollection");function O(D){const{getCollection:_}=l(t+"CollectionConsumer",D);return _}return jt(O,"useGetCollection"),[{Provider:m,Slot:x,ItemSlot:T},{createCollectionScope:a,useCollection:R,useGetCollection:O,useInitCollection:j}]}jt(cw,"createCollection");function Ip(t,r){if(t===r)return!0;if(typeof t!="object"||typeof r!="object"||t==null||r==null)return!1;const i=Object.keys(t),a=Object.keys(r);if(i.length!==a.length)return!1;for(const c of i)if(!Object.prototype.hasOwnProperty.call(r,c)||t[c]!==r[c])return!1;return!0}jt(Ip,"shallowEqual");function kp(t,r){return!!(r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}jt(kp,"isElementPreceding");function Lp(t){let r;for(const i of t.keys()){if(r){const a=r.compareDocumentPosition(i);if(!(a&Node.DOCUMENT_POSITION_DISCONNECTED)&&a&Node.DOCUMENT_POSITION_PRECEDING)return!1}r=i}return!0}jt(Lp,"isInDocumentOrder");function cl(t,r){return!t[1].element||!r[1].element?0:kp(t[1].element,r[1].element)?-1:1}jt(cl,"sortByDocumentPosition");function zp(t){return new MutationObserver(i=>{for(const a of i)if(a.type==="childList"){t();return}})}jt(zp,"getChildListObserver");var uw=Object.defineProperty,ga=(t,r)=>uw(t,"name",{value:r,configurable:!0}),Bp=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ce(t,r,{checkForDefaultPrevented:i=!0}={}){return ga(function(c){if(t?.(c),i===!1||!c||!c.defaultPrevented)return r?.(c)},"handleEvent")}ga(Ce,"composeEventHandlers");function dw(t){if(!Bp)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}ga(dw,"getOwnerWindow");function Gu(t){if(!Bp)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}ga(Gu,"getOwnerDocument");function Hp(t,r=!1){const{activeElement:i}=Gu(t);if(!i?.nodeName)return null;if(Pp(i)&&i.contentDocument)return Hp(i.contentDocument.body,r);if(r){const a=i.getAttribute("aria-activedescendant");if(a){const c=Gu(i).getElementById(a);if(c)return c}}return i}ga(Hp,"getActiveElement");function Pp(t){return t.tagName==="IFRAME"}ga(Pp,"isFrame");var fw=Object.defineProperty,hw=(t,r)=>fw(t,"name",{value:r,configurable:!0}),Up=No[" useEffectEvent ".trim().toString()],$p=No[" useInsertionEffect ".trim().toString()];function Gp(t){if(typeof Up=="function")return Up(t);const r=E.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof $p=="function"?$p(()=>{r.current=t}):lt(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}hw(Gp,"useEffectEvent");var mw=Object.defineProperty,Di=(t,r)=>mw(t,"name",{value:r,configurable:!0}),pw=No[" useInsertionEffect ".trim().toString()]||lt;function fr({prop:t,defaultProp:r,onChange:i=Di(()=>{},"onChange"),caller:a}){const[c,l,u]=Vp({defaultProp:r,onChange:i}),d=t!==void 0,m=d?t:c,p=E.useCallback(C=>{if(d){const g=qp(C)?C(t):C;g!==t&&u.current?.(g)}else l(C)},[d,t,l,u]);return[m,p]}Di(fr,"useControllableState");function Vp({defaultProp:t,onChange:r}){const[i,a]=E.useState(t),c=E.useRef(i),l=E.useRef(r);return pw(()=>{l.current=r},[r]),E.useEffect(()=>{c.current!==i&&(l.current?.(i),c.current=i)},[i,c]),[i,a,l]}Di(Vp,"useUncontrolledState");function qp(t){return typeof t=="function"}Di(qp,"isFunction");var Yp=Symbol("RADIX:SYNC_STATE");function gw(t,r,i,a){const{prop:c,defaultProp:l,onChange:u,caller:d}=r,m=c!==void 0,p=Gp(u),C=[{...i,state:l}];a&&C.push(a);const[g,b]=E.useReducer((w,T)=>{if(T.type===Yp)return{...w,state:T.state};const j=t(w,T);return m&&!Object.is(j.state,w.state)&&p(j.state),j},...C),x=g.state,v=E.useRef(x);E.useEffect(()=>{v.current!==x&&(v.current=x,m||p(x))},[x,v,m]);const S=E.useMemo(()=>c!==void 0?{...g,state:c}:g,[g,c]);return E.useEffect(()=>{m&&!Object.is(c,g.state)&&b({type:Yp,state:c})},[c,g.state,m]),[S,b]}Di(gw,"useControllableStateReducer");var yw=Object.defineProperty,hr=(t,r)=>yw(t,"name",{value:r,configurable:!0});function Xp(t,r){return E.useReducer((i,a)=>r[i][a]??i,t)}hr(Xp,"useStateMachine");var Fr=hr(t=>{const{present:r,children:i}=t,a=Kp(r),c=typeof i=="function"?i({present:a.isPresent}):E.Children.only(i),l=Fp(a.ref,Qp(c));return typeof i=="function"||a.isPresent?E.cloneElement(c,{ref:l}):null},"Presence");function Kp(t){const[r,i]=E.useState(),a=E.useRef(null),c=E.useRef(t),l=E.useRef("none"),u=E.useRef(void 0),d=t?"mounted":"unmounted",[m,p]=Xp(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{m==="mounted"?(l.current=u.current??ya(a.current),u.current=void 0):l.current="none"},[m]),lt(()=>{const C=a.current,g=c.current;if(g!==t){const x=l.current,v=ya(C);t?(u.current=v,p("MOUNT")):v==="none"||C?.display==="none"?p("UNMOUNT"):p(g&&x!==v?"ANIMATION_OUT":"UNMOUNT"),c.current=t}},[t,p]),lt(()=>{if(r){let C;const g=r.ownerDocument.defaultView??window,b=hr(v=>{const w=ya(a.current).includes(CSS.escape(v.animationName));if(v.target===r&&w&&(p("ANIMATION_END"),!c.current)){const T=r.style.animationFillMode;r.style.animationFillMode="forwards",C=g.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=T)})}},"handleAnimationEnd"),x=hr(v=>{v.target===r&&(l.current=ya(a.current))},"handleAnimationStart");return r.addEventListener("animationstart",x),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{g.clearTimeout(C),r.removeEventListener("animationstart",x),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[r,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:E.useCallback(C=>{if(C){const g=getComputedStyle(C);a.current=g,u.current=ya(g)}else a.current=null;i(C)},[])}}hr(Kp,"usePresence");function Vu(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}hr(Vu,"setRef");function Fp(...t){const r=E.useRef(t);return r.current=t,E.useCallback(i=>{const a=r.current;let c=!1;const l=a.map(u=>{const d=Vu(u,i);return!c&&typeof d=="function"&&(c=!0),d});if(c)return()=>{for(let u=0;u<l.length;u++){const d=l[u];typeof d=="function"?d():Vu(a[u],null)}}},[])}hr(Fp,"useStableComposedRefs");function ya(t){return t?.animationName||"none"}hr(ya,"getAnimationName");function Qp(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}hr(Qp,"getElementRef");var bw=Object.defineProperty,xw=(t,r)=>bw(t,"name",{value:r,configurable:!0}),vw=No[" useId ".trim().toString()]||(()=>{}),Sw=0;function mr(t){const[r,i]=E.useState(vw());return lt(()=>{t||i(a=>a??String(Sw++))},[t]),t||(r?`radix-${r}`:"")}xw(mr,"useId");var Cw=Object.defineProperty,ww=(t,r)=>Cw(t,"name",{value:r,configurable:!0}),Ew={LTR:"ltr"},Tw=E.createContext(void 0);function Ii(t){const r=E.useContext(Tw);return t||r||Ew.LTR}ww(Ii,"useDirection");var jw=Object.defineProperty,Aw=(t,r)=>jw(t,"name",{value:r,configurable:!0}),Zp=No[" useInsertionEffect ".trim().toString()];function Hn(t){const r=E.useRef(t);return typeof Zp=="function"?Zp(()=>{r.current=t}):lt(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}Aw(Hn,"useCallbackRef");var Rw=Object.defineProperty,Nt=(t,r)=>Rw(t,"name",{value:r,configurable:!0}),qu="dismissableLayer.update",Ow="dismissableLayer.pointerDownOutside",Nw="dismissableLayer.focusOutside",Wp,Jp=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Yu=E.forwardRef(Nt(function(r,i){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,onDismiss:p,...C}=r,g=E.useContext(Jp),[b,x]=E.useState(null),v=b?.ownerDocument??globalThis?.document,[,S]=E.useState({}),w=ke(i,x),T=Array.from(g.layers),[j]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),R=j?T.indexOf(j):-1,O=b?T.indexOf(b):-1,M=g.layersWithOutsidePointerEventsDisabled.size>0,D=O>=R,_=E.useRef(!1),I=tg($=>{u?.($),m?.($),$.defaultPrevented||p?.()},{ownerDocument:v,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:E.useCallback($=>{if(!($ instanceof Node))return!1;const X=[...g.branches].some(G=>G.contains($));return D&&!X},[g.branches,D])}),B=ng($=>{if(c&&_.current)return;const X=$.target;[...g.branches].some(te=>te.contains(X))||(d?.($),m?.($),$.defaultPrevented||p?.())},v),H=b?O===T.length-1:!1,z=Hn($=>{$.key==="Escape"&&(l?.($),!$.defaultPrevented&&p&&($.preventDefault(),p()))});return E.useEffect(()=>{if(H)return v.addEventListener("keydown",z,{capture:!0}),()=>v.removeEventListener("keydown",z,{capture:!0})},[v,H,z]),E.useEffect(()=>{if(b)return a&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Wp=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(b)),g.layers.add(b),Xu(),()=>{a&&(g.layersWithOutsidePointerEventsDisabled.delete(b),g.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=Wp))}},[b,v,a,g]),E.useEffect(()=>()=>{b&&(g.layers.delete(b),g.layersWithOutsidePointerEventsDisabled.delete(b),Xu())},[b,g]),E.useEffect(()=>{const $=Nt(()=>S({}),"handleUpdate");return document.addEventListener(qu,$),()=>document.removeEventListener(qu,$)},[]),f.jsx(He.div,{...C,ref:w,style:{pointerEvents:M?D?"auto":"none":void 0,...r.style},onFocusCapture:Ce(r.onFocusCapture,B.onFocusCapture),onBlurCapture:Ce(r.onBlurCapture,B.onBlurCapture),onPointerDownCapture:Ce(r.onPointerDownCapture,I.onPointerDownCapture)})},"DismissableLayer"));function eg(){const t=E.useContext(Jp),[r,i]=E.useState(null);return E.useEffect(()=>{if(r)return t.dismissableSurfaces.add(r),()=>{t.dismissableSurfaces.delete(r)}},[r,t.dismissableSurfaces]),i}Nt(eg,"useDismissableLayerSurface");var Mw=Nt(()=>!0,"IS_TRUE");function tg(t,r){const{ownerDocument:i=globalThis?.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=Mw}=r,d=Hn(t),m=E.useRef(!1),p=E.useRef(!1),C=E.useRef(new Map),g=E.useRef(()=>{});return E.useEffect(()=>{function b(){p.current=!1,c.current=!1,C.current.clear()}Nt(b,"resetOutsideInteraction");function x(){return Array.from(C.current.values()).some(Boolean)}Nt(x,"isOutsideInteractionIntercepted");function v(R){if(!p.current)return;const O=R.target;O instanceof Node&&[...l].some(D=>D.contains(O))||C.current.set(R.type,!0),R.type==="click"&&window.setTimeout(()=>{p.current&&g.current()},0)}Nt(v,"handleInteractionCapture");function S(R){p.current&&C.current.set(R.type,!1)}Nt(S,"handleInteractionBubble");const w=Nt(R=>{if(R.target&&!m.current){let O=function(){i.removeEventListener("click",g.current);const D=x();b(),D||Ku(Ow,d,M,{discrete:!0})};if(Nt(O,"handleAndDispatchPointerDownOutsideEvent"),!u(R.target)){i.removeEventListener("click",g.current),b(),m.current=!1;return}const M={originalEvent:R};p.current=!0,c.current=a&&R.button===0,C.current.clear(),!a||R.button!==0?O():(i.removeEventListener("click",g.current),g.current=O,i.addEventListener("click",g.current,{once:!0}))}else i.removeEventListener("click",g.current),b();m.current=!1},"handlePointerDown"),T=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const R of T)i.addEventListener(R,v,!0),i.addEventListener(R,S);const j=window.setTimeout(()=>{i.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(j),i.removeEventListener("pointerdown",w),i.removeEventListener("click",g.current);for(const R of T)i.removeEventListener(R,v,!0),i.removeEventListener(R,S)}},[i,d,a,c,l,u]),{onPointerDownCapture:Nt(()=>m.current=!0,"onPointerDownCapture")}}Nt(tg,"usePointerDownOutside");function ng(t,r=globalThis?.document){const i=Hn(t),a=E.useRef(!1);return E.useEffect(()=>{const c=Nt(l=>{l.target&&!a.current&&Ku(Nw,i,{originalEvent:l},{discrete:!1})},"handleFocus");return r.addEventListener("focusin",c),()=>r.removeEventListener("focusin",c)},[r,i]),{onFocusCapture:Nt(()=>a.current=!0,"onFocusCapture"),onBlurCapture:Nt(()=>a.current=!1,"onBlurCapture")}}Nt(ng,"useFocusOutside");function Xu(){const t=new CustomEvent(qu);document.dispatchEvent(t)}Nt(Xu,"dispatchUpdate");function Ku(t,r,i,{discrete:a}){const c=i.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:i});r&&c.addEventListener(t,r,{once:!0}),a?Op(c,l):c.dispatchEvent(l)}Nt(Ku,"handleAndDispatchCustomEvent");var _w=Object.defineProperty,xt=(t,r)=>_w(t,"name",{value:r,configurable:!0}),Fu="focusScope.autoFocusOnMount",Qu="focusScope.autoFocusOnUnmount",rg={bubbles:!1,cancelable:!0},og=E.forwardRef(xt(function(r,i){const{loop:a=!1,trapped:c=!1,branches:l,onMountAutoFocus:u,onUnmountAutoFocus:d,...m}=r,[p,C]=E.useState(null),g=Hn(u),b=Hn(d),x=E.useRef(null),v=ke(i,C),S=E.useRef(l);E.useEffect(()=>{S.current=l});const w=E.useCallback(R=>R?p?.contains(R)?!0:!!S.current?.some(O=>O.contains(R)):!1,[p]),T=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(c){let R=function(_){if(T.paused||!p)return;const I=_.target;w(I)?x.current=I:pr(x.current,{select:!0})},O=function(_){if(T.paused||!p)return;const I=_.relatedTarget;I!==null&&(w(I)||pr(x.current,{select:!0}))},M=function(_){if(document.activeElement===document.body)for(const B of _)B.removedNodes.length>0&&pr(p)};xt(R,"handleFocusIn"),xt(O,"handleFocusOut"),xt(M,"handleMutations"),document.addEventListener("focusin",R),document.addEventListener("focusout",O);const D=new MutationObserver(M);return p&&D.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",R),document.removeEventListener("focusout",O),D.disconnect()}}},[c,p,T.paused,w]),E.useEffect(()=>{if(p){hg.add(T);const R=document.activeElement;if(!p.contains(R)){const M=new CustomEvent(Fu,rg);p.addEventListener(Fu,g),p.dispatchEvent(M),M.defaultPrevented||(cg(pg(Zu(p)),{select:!0}),document.activeElement===R&&pr(p))}return()=>{p.removeEventListener(Fu,g);const M=p.ownerDocument,D=CustomEvent;setTimeout(()=>{const _=new D(Qu,rg);p.addEventListener(Qu,b),p.dispatchEvent(_),_.defaultPrevented||pr(R??M.body,{select:!0}),p.removeEventListener(Qu,b),hg.remove(T)},0)}}},[p,g,b,T]);const j=E.useCallback(R=>{if(!a&&!c||T.paused)return;const O=R.key==="Tab"&&!R.altKey&&!R.ctrlKey&&!R.metaKey,M=document.activeElement;if(O&&M){const D=R.currentTarget,[_,I]=ug(D);_&&I?!R.shiftKey&&M===I?(R.preventDefault(),a&&pr(_,{select:!0})):R.shiftKey&&M===_&&(R.preventDefault(),a&&pr(I,{select:!0})):M===D&&R.preventDefault()}},[a,c,T.paused]);return f.jsx(He.div,{tabIndex:-1,...m,ref:v,onKeyDown:j})},"FocusScope")),ag=E.createContext(null);function ig({registry:t,children:r}){return t?f.jsx(ag.Provider,{value:t,children:r}):r}xt(ig,"FocusScopeBranchProvider");function sg(){const[t,r]=E.useState([]),i=E.useMemo(()=>({add:xt(a=>r(c=>c.includes(a)?c:[...c,a]),"add"),remove:xt(a=>r(c=>c.filter(l=>l!==a)),"remove")}),[]);return{nodes:t,registry:i}}xt(sg,"useFocusScopeBranchRegistry");function lg(t){const r=E.useContext(ag);E.useEffect(()=>{if(!(!t||!r))return r.add(t),()=>r.remove(t)},[t,r])}xt(lg,"useFocusScopeBranch");function cg(t,{select:r=!1}={}){const i=document.activeElement;for(const a of t)if(pr(a,{select:r}),document.activeElement!==i)return}xt(cg,"focusFirst");function ug(t){const r=Zu(t),i=Wu(r,t),a=Wu(r.reverse(),t);return[i,a]}xt(ug,"getTabbableEdges");function Zu(t){const r=[],a=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:xt(c=>{const l=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||l?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)r.push(a.currentNode);return r}xt(Zu,"getTabbableCandidates");function Wu(t,r){const i=typeof r.checkVisibility=="function"&&r.checkVisibility({checkVisibilityCSS:!0});for(const a of t)if(!(i?!a.checkVisibility({checkVisibilityCSS:!0}):dg(a,{upTo:r})))return a}xt(Wu,"findVisible");function dg(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}xt(dg,"isHidden");function fg(t){return t.tagName==="INPUT"&&typeof t.select=="function"}xt(fg,"isSelectableInput");function pr(t,{select:r=!1}={}){if(t&&t.focus){const a=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==a&&fg(t)&&r&&t.select()}}xt(pr,"focus");var hg=mg();function mg(){let t=[];return{add(r){const i=t[0];r!==i&&i?.pause(),t=Ju(t,r),t.unshift(r)},remove(r){t=Ju(t,r),t[0]?.resume()}}}xt(mg,"createFocusScopesStack");function Ju(t,r){const i=[...t],a=i.indexOf(r);return a!==-1&&i.splice(a,1),i}xt(Ju,"arrayRemove");function pg(t){return t.filter(r=>r.tagName!=="A")}xt(pg,"removeLinks");var Dw=Object.defineProperty,Iw=(t,r)=>Dw(t,"name",{value:r,configurable:!0}),ed=E.forwardRef(Iw(function(r,i){const{container:a,...c}=r,[l,u]=E.useState(!1);lt(()=>u(!0),[]);const d=a||l&&globalThis?.document?.body;return d?Yr.createPortal(f.jsx(He.div,{...c,ref:i}),d):null},"Portal")),kw=Object.defineProperty,td=(t,r)=>kw(t,"name",{value:r,configurable:!0}),ul=0,ba=null;function Lw(t){return dl(),t.children}td(Lw,"FocusGuards");function dl(){E.useEffect(()=>{ba||(ba={start:nd(),end:nd()});const{start:t,end:r}=ba;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==r&&document.body.insertAdjacentElement("beforeend",r),ul++,()=>{ul===1&&(ba?.start.remove(),ba?.end.remove(),ba=null),ul=Math.max(0,ul-1)}},[])}td(dl,"useFocusGuards");function nd(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}td(nd,"createFocusGuard");var Wn=function(){return Wn=Object.assign||function(r){for(var i,a=1,c=arguments.length;a<c;a++){i=arguments[a];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(r[l]=i[l])}return r},Wn.apply(this,arguments)};function gg(t,r){var i={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(t);c<a.length;c++)r.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(t,a[c])&&(i[a[c]]=t[a[c]]);return i}function zw(t,r,i){if(i||arguments.length===2)for(var a=0,c=r.length,l;a<c;a++)(l||!(a in r))&&(l||(l=Array.prototype.slice.call(r,0,a)),l[a]=r[a]);return t.concat(l||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;var fl="right-scroll-bar-position",hl="width-before-scroll-bar",Bw="with-scroll-bars-hidden",Hw="--removed-body-scroll-bar-size";function rd(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function Pw(t,r){var i=E.useState(function(){return{value:t,callback:r,facade:{get current(){return i.value},set current(a){var c=i.value;c!==a&&(i.value=a,i.callback(a,c))}}}})[0];return i.callback=r,i.facade}var Uw=typeof window<"u"?E.useLayoutEffect:E.useEffect,yg=new WeakMap;function $w(t,r){var i=Pw(null,function(a){return t.forEach(function(c){return rd(c,a)})});return Uw(function(){var a=yg.get(i);if(a){var c=new Set(a),l=new Set(t),u=i.current;c.forEach(function(d){l.has(d)||rd(d,null)}),l.forEach(function(d){c.has(d)||rd(d,u)})}yg.set(i,t)},[t]),i}function Gw(t){return t}function Vw(t,r){r===void 0&&(r=Gw);var i=[],a=!1,c={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:t},useMedium:function(l){var u=r(l,a);return i.push(u),function(){i=i.filter(function(d){return d!==u})}},assignSyncMedium:function(l){for(a=!0;i.length;){var u=i;i=[],u.forEach(l)}i={push:function(d){return l(d)},filter:function(){return i}}},assignMedium:function(l){a=!0;var u=[];if(i.length){var d=i;i=[],d.forEach(l),u=i}var m=function(){var C=u;u=[],C.forEach(l)},p=function(){return Promise.resolve().then(m)};p(),i={push:function(C){u.push(C),p()},filter:function(C){return u=u.filter(C),i}}}};return c}function qw(t){t===void 0&&(t={});var r=Vw(null);return r.options=Wn({async:!0,ssr:!1},t),r}var bg=function(t){var r=t.sideCar,i=gg(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=r.read();if(!a)throw new Error("Sidecar medium not found");return E.createElement(a,Wn({},i))};bg.isSideCarExport=!0;function Yw(t,r){return t.useMedium(r),bg}var xg=qw(),od=function(){},ml=E.forwardRef(function(t,r){var i=E.useRef(null),a=E.useState({onScrollCapture:od,onWheelCapture:od,onTouchMoveCapture:od}),c=a[0],l=a[1],u=t.forwardProps,d=t.children,m=t.className,p=t.removeScrollBar,C=t.enabled,g=t.shards,b=t.sideCar,x=t.noRelative,v=t.noIsolation,S=t.inert,w=t.allowPinchZoom,T=t.as,j=T===void 0?"div":T,R=t.gapMode,O=gg(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,D=$w([i,r]),_=Wn(Wn({},O),c);return E.createElement(E.Fragment,null,C&&E.createElement(M,{sideCar:xg,removeScrollBar:p,shards:g,noRelative:x,noIsolation:v,inert:S,setCallbacks:l,allowPinchZoom:!!w,lockRef:i,gapMode:R}),u?E.cloneElement(E.Children.only(d),Wn(Wn({},_),{ref:D})):E.createElement(j,Wn({},_,{className:m,ref:D}),d))});ml.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ml.classNames={fullWidth:hl,zeroRight:fl};var Xw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Kw(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=Xw();return r&&t.setAttribute("nonce",r),t}function Fw(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function Qw(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var Zw=function(){var t=0,r=null;return{add:function(i){t==0&&(r=Kw())&&(Fw(r,i),Qw(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},Ww=function(){var t=Zw();return function(r,i){E.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&i])}},vg=function(){var t=Ww(),r=function(i){var a=i.styles,c=i.dynamic;return t(a,c),null};return r},Jw={left:0,top:0,right:0,gap:0},ad=function(t){return parseInt(t||"",10)||0},eE=function(t){var r=window.getComputedStyle(document.body),i=r[t==="padding"?"paddingLeft":"marginLeft"],a=r[t==="padding"?"paddingTop":"marginTop"],c=r[t==="padding"?"paddingRight":"marginRight"];return[ad(i),ad(a),ad(c)]},tE=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Jw;var r=eE(t),i=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-i+r[2]-r[0])}},nE=vg(),xa="data-scroll-locked",rE=function(t,r,i,a){var c=t.left,l=t.top,u=t.right,d=t.gap;return i===void 0&&(i="margin"),`
|
|
50
|
+
`+o.stack}}function Dn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vx(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function TN(e){var n=vx(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(R){s=""+R,y.call(this,R)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(R){s=""+R},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Zl(e){e._valueTracker||(e._valueTracker=TN(e))}function Sx(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),s="";return e&&(s=vx(e)?e.checked?"true":"false":e.value),e=s,e!==o?(n.setValue(e),!0):!1}function Wl(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 jN=/[\n"\\]/g;function In(e){return e.replace(jN,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ff(e,n,o,s,h,y,R,I){e.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.type=R:e.removeAttribute("type"),n!=null?R==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Dn(n)):e.value!==""+Dn(n)&&(e.value=""+Dn(n)):R!=="submit"&&R!=="reset"||e.removeAttribute("value"),n!=null?hf(e,R,Dn(n)):o!=null?hf(e,R,Dn(o)):s!=null&&e.removeAttribute("value"),h==null&&y!=null&&(e.defaultChecked=!!y),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?e.name=""+Dn(I):e.removeAttribute("name")}function Cx(e,n,o,s,h,y,R,I){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?""+Dn(o):"",n=n!=null?""+Dn(n):o,I||n===e.value||(e.value=n),e.defaultValue=n}s=s??h,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=I?e.checked:!!s,e.defaultChecked=!!s,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(e.name=R)}function hf(e,n,o){n==="number"&&Wl(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function Ha(e,n,o,s){if(e=e.options,n){n={};for(var h=0;h<o.length;h++)n["$"+o[h]]=!0;for(o=0;o<e.length;o++)h=n.hasOwnProperty("$"+e[o].value),e[o].selected!==h&&(e[o].selected=h),h&&s&&(e[o].defaultSelected=!0)}else{for(o=""+Dn(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 wx(e,n,o){if(n!=null&&(n=""+Dn(n),n!==e.value&&(e.value=n),o==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=o!=null?""+Dn(o):""}function Ex(e,n,o,s){if(n==null){if(s!=null){if(o!=null)throw Error(a(92));if(ee(s)){if(1<s.length)throw Error(a(93));s=s[0]}o=s}o==null&&(o=""),n=o}o=Dn(n),e.defaultValue=o,s=e.textContent,s===o&&s!==""&&s!==null&&(e.value=s)}function Pa(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var AN=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 Tx(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||AN.has(n)?n==="float"?e.cssFloat=o:e[n]=(""+o).trim():e[n]=o+"px"}function jx(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&&Tx(e,h,s)}else for(var y in n)n.hasOwnProperty(y)&&Tx(e,y,n[y])}function mf(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 RN=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"]]),NN=/^[\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 Jl(e){return NN.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var pf=null;function gf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ua=null,$a=null;function Ax(e){var n=ka(e);if(n&&(e=n.stateNode)){var o=e[an]||null;e:switch(e=n.stateNode,n.type){case"input":if(ff(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="'+In(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var s=o[n];if(s!==e&&s.form===e.form){var h=s[an]||null;if(!h)throw Error(a(90));ff(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&&Sx(s)}break e;case"textarea":wx(e,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&Ha(e,!!o.multiple,n,!1)}}}var yf=!1;function Rx(e,n,o){if(yf)return e(n,o);yf=!0;try{var s=e(n);return s}finally{if(yf=!1,(Ua!==null||$a!==null)&&(Bc(),Ua&&(n=Ua,e=$a,$a=Ua=null,Ax(n),e)))for(n=0;n<e.length;n++)Ax(e[n])}}function Ji(e,n){var o=e.stateNode;if(o===null)return null;var s=o[an]||null;if(s===null)return null;o=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(a(231,n,typeof o));return o}var Ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xf=!1;if(Ar)try{var es={};Object.defineProperty(es,"passive",{get:function(){xf=!0}}),window.addEventListener("test",es,es),window.removeEventListener("test",es,es)}catch{xf=!1}var ro=null,bf=null,ec=null;function Nx(){if(ec)return ec;var e,n=bf,o=n.length,s,h="value"in ro?ro.value:ro.textContent,y=h.length;for(e=0;e<o&&n[e]===h[e];e++);var R=o-e;for(s=1;s<=R&&n[o-s]===h[y-s];s++);return ec=h.slice(e,1<s?1-s:void 0)}function tc(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 nc(){return!0}function Ox(){return!1}function sn(e){function n(o,s,h,y,R){this._reactName=o,this._targetInst=h,this.type=s,this.nativeEvent=y,this.target=R,this.currentTarget=null;for(var I in e)e.hasOwnProperty(I)&&(o=e[I],this[I]=o?o(y):y[I]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?nc:Ox,this.isPropagationStopped=Ox,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=nc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=nc)},persist:function(){},isPersistent:nc}),n}var Go={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rc=sn(Go),ts=C({},Go,{view:0,detail:0}),ON=sn(ts),vf,Sf,ns,oc=C({},ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ns&&(ns&&e.type==="mousemove"?(vf=e.screenX-ns.screenX,Sf=e.screenY-ns.screenY):Sf=vf=0,ns=e),vf)},movementY:function(e){return"movementY"in e?e.movementY:Sf}}),Mx=sn(oc),MN=C({},oc,{dataTransfer:0}),_N=sn(MN),DN=C({},ts,{relatedTarget:0}),Cf=sn(DN),IN=C({},Go,{animationName:0,elapsedTime:0,pseudoElement:0}),kN=sn(IN),LN=C({},Go,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zN=sn(LN),BN=C({},Go,{data:0}),_x=sn(BN),HN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PN={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"},UN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $N(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=UN[e])?!!n[e]:!1}function wf(){return $N}var GN=C({},ts,{key:function(e){if(e.key){var n=HN[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=tc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?PN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wf,charCode:function(e){return e.type==="keypress"?tc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?tc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),VN=sn(GN),qN=C({},oc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dx=sn(qN),YN=C({},ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wf}),XN=sn(YN),KN=C({},Go,{propertyName:0,elapsedTime:0,pseudoElement:0}),FN=sn(KN),QN=C({},oc,{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}),ZN=sn(QN),WN=C({},Go,{newState:0,oldState:0}),JN=sn(WN),eO=[9,13,27,32],Ef=Ar&&"CompositionEvent"in window,rs=null;Ar&&"documentMode"in document&&(rs=document.documentMode);var tO=Ar&&"TextEvent"in window&&!rs,Ix=Ar&&(!Ef||rs&&8<rs&&11>=rs),kx=" ",Lx=!1;function zx(e,n){switch(e){case"keyup":return eO.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ga=!1;function nO(e,n){switch(e){case"compositionend":return Bx(n);case"keypress":return n.which!==32?null:(Lx=!0,kx);case"textInput":return e=n.data,e===kx&&Lx?null:e;default:return null}}function rO(e,n){if(Ga)return e==="compositionend"||!Ef&&zx(e,n)?(e=Nx(),ec=bf=ro=null,Ga=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Ix&&n.locale!=="ko"?null:n.data;default:return null}}var oO={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 Hx(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!oO[e.type]:n==="textarea"}function Px(e,n,o,s){Ua?$a?$a.push(s):$a=[s]:Ua=s,n=Vc(n,"onChange"),0<n.length&&(o=new rc("onChange","change",null,o,s),e.push({event:o,listeners:n}))}var os=null,as=null;function aO(e){v1(e,0)}function ac(e){var n=Wi(e);if(Sx(n))return e}function Ux(e,n){if(e==="change")return n}var $x=!1;if(Ar){var Tf;if(Ar){var jf="oninput"in document;if(!jf){var Gx=document.createElement("div");Gx.setAttribute("oninput","return;"),jf=typeof Gx.oninput=="function"}Tf=jf}else Tf=!1;$x=Tf&&(!document.documentMode||9<document.documentMode)}function Vx(){os&&(os.detachEvent("onpropertychange",qx),as=os=null)}function qx(e){if(e.propertyName==="value"&&ac(as)){var n=[];Px(n,as,e,gf(e)),Rx(aO,n)}}function iO(e,n,o){e==="focusin"?(Vx(),os=n,as=o,os.attachEvent("onpropertychange",qx)):e==="focusout"&&Vx()}function sO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ac(as)}function lO(e,n){if(e==="click")return ac(n)}function cO(e,n){if(e==="input"||e==="change")return ac(n)}function uO(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var gn=typeof Object.is=="function"?Object.is:uO;function is(e,n){if(gn(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(!Me.call(n,h)||!gn(e[h],n[h]))return!1}return!0}function Yx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xx(e,n){var o=Yx(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=Yx(o)}}function Kx(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Kx(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Fx(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Wl(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=Wl(e.document)}return n}function Af(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 dO=Ar&&"documentMode"in document&&11>=document.documentMode,Va=null,Rf=null,ss=null,Nf=!1;function Qx(e,n,o){var s=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Nf||Va==null||Va!==Wl(s)||(s=Va,"selectionStart"in s&&Af(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ss&&is(ss,s)||(ss=s,s=Vc(Rf,"onSelect"),0<s.length&&(n=new rc("onSelect","select",null,n,o),e.push({event:n,listeners:s}),n.target=Va)))}function Vo(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var qa={animationend:Vo("Animation","AnimationEnd"),animationiteration:Vo("Animation","AnimationIteration"),animationstart:Vo("Animation","AnimationStart"),transitionrun:Vo("Transition","TransitionRun"),transitionstart:Vo("Transition","TransitionStart"),transitioncancel:Vo("Transition","TransitionCancel"),transitionend:Vo("Transition","TransitionEnd")},Of={},Zx={};Ar&&(Zx=document.createElement("div").style,"AnimationEvent"in window||(delete qa.animationend.animation,delete qa.animationiteration.animation,delete qa.animationstart.animation),"TransitionEvent"in window||delete qa.transitionend.transition);function qo(e){if(Of[e])return Of[e];if(!qa[e])return e;var n=qa[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Zx)return Of[e]=n[o];return e}var Wx=qo("animationend"),Jx=qo("animationiteration"),eb=qo("animationstart"),fO=qo("transitionrun"),hO=qo("transitionstart"),mO=qo("transitioncancel"),tb=qo("transitionend"),nb=new Map,Mf="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(" ");Mf.push("scrollEnd");function qn(e,n){nb.set(e,n),$o(n,[e])}var rb=new WeakMap;function kn(e,n){if(typeof e=="object"&&e!==null){var o=rb.get(e);return o!==void 0?o:(n={value:e,source:n,stack:bx(n)},rb.set(e,n),n)}return{value:e,source:n,stack:bx(n)}}var Ln=[],Ya=0,_f=0;function ic(){for(var e=Ya,n=_f=Ya=0;n<e;){var o=Ln[n];Ln[n++]=null;var s=Ln[n];Ln[n++]=null;var h=Ln[n];Ln[n++]=null;var y=Ln[n];if(Ln[n++]=null,s!==null&&h!==null){var R=s.pending;R===null?h.next=h:(h.next=R.next,R.next=h),s.pending=h}y!==0&&ob(o,h,y)}}function sc(e,n,o,s){Ln[Ya++]=e,Ln[Ya++]=n,Ln[Ya++]=o,Ln[Ya++]=s,_f|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Df(e,n,o,s){return sc(e,n,o,s),lc(e)}function Xa(e,n){return sc(e,null,null,n),lc(e)}function ob(e,n,o){e.lanes|=o;var s=e.alternate;s!==null&&(s.lanes|=o);for(var h=!1,y=e.return;y!==null;)y.childLanes|=o,s=y.alternate,s!==null&&(s.childLanes|=o),y.tag===22&&(e=y.stateNode,e===null||e._visibility&1||(h=!0)),e=y,y=y.return;return e.tag===3?(y=e.stateNode,h&&n!==null&&(h=31-Ht(o),e=y.hiddenUpdates,s=e[h],s===null?e[h]=[n]:s.push(n),n.lane=o|536870912),y):null}function lc(e){if(50<_s)throw _s=0,Hh=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ka={};function pO(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 yn(e,n,o,s){return new pO(e,n,o,s)}function If(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rr(e,n){var o=e.alternate;return o===null?(o=yn(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 ab(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 cc(e,n,o,s,h,y){var R=0;if(s=e,typeof e=="function")If(e)&&(R=1);else if(typeof e=="string")R=yM(e,o,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=yn(31,o,n,h),e.elementType=L,e.lanes=y,e;case v:return Yo(o.children,h,y,n);case S:R=8,h|=24;break;case w:return e=yn(12,o,n,h|2),e.elementType=w,e.lanes=y,e;case D:return e=yn(13,o,n,h),e.elementType=D,e.lanes=y,e;case O:return e=yn(19,o,n,h),e.elementType=O,e.lanes=y,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:case N:R=10;break e;case j:R=9;break e;case M:R=11;break e;case _:R=14;break e;case k:R=16,s=null;break e}R=29,o=Error(a(130,e===null?"null":typeof e,"")),s=null}return n=yn(R,o,n,h),n.elementType=e,n.type=s,n.lanes=y,n}function Yo(e,n,o,s){return e=yn(7,e,s,n),e.lanes=o,e}function kf(e,n,o){return e=yn(6,e,null,n),e.lanes=o,e}function Lf(e,n,o){return n=yn(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Fa=[],Qa=0,uc=null,dc=0,zn=[],Bn=0,Xo=null,Nr=1,Or="";function Ko(e,n){Fa[Qa++]=dc,Fa[Qa++]=uc,uc=e,dc=n}function ib(e,n,o){zn[Bn++]=Nr,zn[Bn++]=Or,zn[Bn++]=Xo,Xo=e;var s=Nr;e=Or;var h=32-Ht(s)-1;s&=~(1<<h),o+=1;var y=32-Ht(n)+h;if(30<y){var R=h-h%5;y=(s&(1<<R)-1).toString(32),s>>=R,h-=R,Nr=1<<32-Ht(n)+h|o<<h|s,Or=y+e}else Nr=1<<y|o<<h|s,Or=e}function zf(e){e.return!==null&&(Ko(e,1),ib(e,1,0))}function Bf(e){for(;e===uc;)uc=Fa[--Qa],Fa[Qa]=null,dc=Fa[--Qa],Fa[Qa]=null;for(;e===Xo;)Xo=zn[--Bn],zn[Bn]=null,Or=zn[--Bn],zn[Bn]=null,Nr=zn[--Bn],zn[Bn]=null}var en=null,mt=null,Ke=!1,Fo=null,ar=!1,Hf=Error(a(519));function Qo(e){var n=Error(a(418,""));throw us(kn(n,e)),Hf}function sb(e){var n=e.stateNode,o=e.type,s=e.memoizedProps;switch(n[Ft]=e,n[an]=s,o){case"dialog":Ue("cancel",n),Ue("close",n);break;case"iframe":case"object":case"embed":Ue("load",n);break;case"video":case"audio":for(o=0;o<Is.length;o++)Ue(Is[o],n);break;case"source":Ue("error",n);break;case"img":case"image":case"link":Ue("error",n),Ue("load",n);break;case"details":Ue("toggle",n);break;case"input":Ue("invalid",n),Cx(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),Zl(n);break;case"select":Ue("invalid",n);break;case"textarea":Ue("invalid",n),Ex(n,s.value,s.defaultValue,s.children),Zl(n)}o=s.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||s.suppressHydrationWarning===!0||E1(n.textContent,o)?(s.popover!=null&&(Ue("beforetoggle",n),Ue("toggle",n)),s.onScroll!=null&&Ue("scroll",n),s.onScrollEnd!=null&&Ue("scrollend",n),s.onClick!=null&&(n.onclick=qc),n=!0):n=!1,n||Qo(e)}function lb(e){for(en=e.return;en;)switch(en.tag){case 5:case 13:ar=!1;return;case 27:case 3:ar=!0;return;default:en=en.return}}function ls(e){if(e!==en)return!1;if(!Ke)return lb(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")||tm(e.type,e.memoizedProps)),o=!o),o&&mt&&Qo(e),lb(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8)if(o=e.data,o==="/$"){if(n===0){mt=Xn(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++;e=e.nextSibling}mt=null}}else n===27?(n=mt,vo(e.type)?(e=am,am=null,mt=e):mt=n):mt=en?Xn(e.stateNode.nextSibling):null;return!0}function cs(){mt=en=null,Ke=!1}function cb(){var e=Fo;return e!==null&&(un===null?un=e:un.push.apply(un,e),Fo=null),e}function us(e){Fo===null?Fo=[e]:Fo.push(e)}var Pf=Y(null),Zo=null,Mr=null;function oo(e,n,o){Z(Pf,n._currentValue),n._currentValue=o}function _r(e){e._currentValue=Pf.current,F(Pf)}function Uf(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 $f(e,n,o,s){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var y=h.dependencies;if(y!==null){var R=h.child;y=y.firstContext;e:for(;y!==null;){var I=y;y=h;for(var V=0;V<n.length;V++)if(I.context===n[V]){y.lanes|=o,I=y.alternate,I!==null&&(I.lanes|=o),Uf(y.return,o,e),s||(R=null);break e}y=I.next}}else if(h.tag===18){if(R=h.return,R===null)throw Error(a(341));R.lanes|=o,y=R.alternate,y!==null&&(y.lanes|=o),Uf(R,o,e),R=null}else R=h.child;if(R!==null)R.return=h;else for(R=h;R!==null;){if(R===e){R=null;break}if(h=R.sibling,h!==null){h.return=R.return,R=h;break}R=R.return}h=R}}function ds(e,n,o,s){e=null;for(var h=n,y=!1;h!==null;){if(!y){if((h.flags&524288)!==0)y=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var R=h.alternate;if(R===null)throw Error(a(387));if(R=R.memoizedProps,R!==null){var I=h.type;gn(h.pendingProps.value,R.value)||(e!==null?e.push(I):e=[I])}}else if(h===be.current){if(R=h.alternate,R===null)throw Error(a(387));R.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(Ps):e=[Ps])}h=h.return}e!==null&&$f(n,e,o,s),n.flags|=262144}function fc(e){for(e=e.firstContext;e!==null;){if(!gn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wo(e){Zo=e,Mr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qt(e){return ub(Zo,e)}function hc(e,n){return Zo===null&&Wo(e),ub(e,n)}function ub(e,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},Mr===null){if(e===null)throw Error(a(308));Mr=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Mr=Mr.next=n;return o}var gO=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()})}},yO=t.unstable_scheduleCallback,xO=t.unstable_NormalPriority,Ot={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gf(){return{controller:new gO,data:new Map,refCount:0}}function fs(e){e.refCount--,e.refCount===0&&yO(xO,function(){e.controller.abort()})}var hs=null,Vf=0,Za=0,Wa=null;function bO(e,n){if(hs===null){var o=hs=[];Vf=0,Za=Yh(),Wa={status:"pending",value:void 0,then:function(s){o.push(s)}}}return Vf++,n.then(db,db),n}function db(){if(--Vf===0&&hs!==null){Wa!==null&&(Wa.status="fulfilled");var e=hs;hs=null,Za=0,Wa=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function vO(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 fb=G.S;G.S=function(e,n){typeof n=="object"&&n!==null&&typeof n.then=="function"&&bO(e,n),fb!==null&&fb(e,n)};var Jo=Y(null);function qf(){var e=Jo.current;return e!==null?e:ot.pooledCache}function mc(e,n){n===null?Z(Jo,Jo.current):Z(Jo,n.pool)}function hb(){var e=qf();return e===null?null:{parent:Ot._currentValue,pool:e}}var ms=Error(a(460)),mb=Error(a(474)),pc=Error(a(542)),Yf={then:function(){}};function pb(e){return e=e.status,e==="fulfilled"||e==="rejected"}function gc(){}function gb(e,n,o){switch(o=e[o],o===void 0?e.push(n):o!==n&&(n.then(gc,gc),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,xb(e),e;default:if(typeof n.status=="string")n.then(gc,gc);else{if(e=ot,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,xb(e),e}throw ps=n,ms}}var ps=null;function yb(){if(ps===null)throw Error(a(459));var e=ps;return ps=null,e}function xb(e){if(e===ms||e===pc)throw Error(a(483))}var ao=!1;function Xf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(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 io(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function so(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=lc(e),ob(e,null,o),n}return sc(e,s,n,o),lc(e)}function gs(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,Qi(e,o)}}function Ff(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 R={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?h=y=R:y=y.next=R,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 Qf=!1;function ys(){if(Qf){var e=Wa;if(e!==null)throw e}}function xs(e,n,o,s){Qf=!1;var h=e.updateQueue;ao=!1;var y=h.firstBaseUpdate,R=h.lastBaseUpdate,I=h.shared.pending;if(I!==null){h.shared.pending=null;var V=I,J=V.next;V.next=null,R===null?y=J:R.next=J,R=V;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,I=oe.lastBaseUpdate,I!==R&&(I===null?oe.firstBaseUpdate=J:I.next=J,oe.lastBaseUpdate=V))}if(y!==null){var se=h.baseState;R=0,oe=J=V=null,I=y;do{var te=I.lane&-536870913,ne=te!==I.lane;if(ne?(Ve&te)===te:(s&te)===te){te!==0&&te===Za&&(Qf=!0),oe!==null&&(oe=oe.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Ae=e,we=I;te=n;var et=o;switch(we.tag){case 1:if(Ae=we.payload,typeof Ae=="function"){se=Ae.call(et,se,te);break e}se=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=we.payload,te=typeof Ae=="function"?Ae.call(et,se,te):Ae,te==null)break e;se=C({},se,te);break e;case 2:ao=!0}}te=I.callback,te!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=h.callbacks,ne===null?h.callbacks=[te]:ne.push(te))}else ne={lane:te,tag:I.tag,payload:I.payload,callback:I.callback,next:null},oe===null?(J=oe=ne,V=se):oe=oe.next=ne,R|=te;if(I=I.next,I===null){if(I=h.shared.pending,I===null)break;ne=I,I=ne.next,ne.next=null,h.lastBaseUpdate=ne,h.shared.pending=null}}while(!0);oe===null&&(V=se),h.baseState=V,h.firstBaseUpdate=J,h.lastBaseUpdate=oe,y===null&&(h.shared.lanes=0),go|=R,e.lanes=R,e.memoizedState=se}}function bb(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function vb(e,n){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)bb(o[e],n)}var Ja=Y(null),yc=Y(0);function Sb(e,n){e=Hr,Z(yc,e),Z(Ja,n),Hr=e|n.baseLanes}function Zf(){Z(yc,Hr),Z(Ja,Ja.current)}function Wf(){Hr=yc.current,F(Ja),F(yc)}var lo=0,Le=null,We=null,Ct=null,xc=!1,ei=!1,ea=!1,bc=0,bs=0,ti=null,SO=0;function xt(){throw Error(a(321))}function Jf(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!gn(e[o],n[o]))return!1;return!0}function eh(e,n,o,s,h,y){return lo=y,Le=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,G.H=e===null||e.memoizedState===null?ov:av,ea=!1,y=o(s,h),ea=!1,ei&&(y=wb(n,o,s,h)),Cb(e),y}function Cb(e){G.H=Tc;var n=We!==null&&We.next!==null;if(lo=0,Ct=We=Le=null,xc=!1,bs=0,ti=null,n)throw Error(a(300));e===null||It||(e=e.dependencies,e!==null&&fc(e)&&(It=!0))}function wb(e,n,o,s){Le=e;var h=0;do{if(ei&&(ti=null),bs=0,ei=!1,25<=h)throw Error(a(301));if(h+=1,Ct=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)}G.H=RO,y=n(o,s)}while(ei);return y}function CO(){var e=G.H,n=e.useState()[0];return n=typeof n.then=="function"?vs(n):n,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Le.flags|=1024),n}function th(){var e=bc!==0;return bc=0,e}function nh(e,n,o){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~o}function rh(e){if(xc){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}xc=!1}lo=0,Ct=We=Le=null,ei=!1,bs=bc=0,ti=null}function ln(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Le.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function wt(){if(We===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var n=Ct===null?Le.memoizedState:Ct.next;if(n!==null)Ct=n,We=e;else{if(e===null)throw Le.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},Ct===null?Le.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function oh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vs(e){var n=bs;return bs+=1,ti===null&&(ti=[]),e=gb(ti,e,n),n=Le,(Ct===null?n.memoizedState:Ct.next)===null&&(n=n.alternate,G.H=n===null||n.memoizedState===null?ov:av),e}function vc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vs(e);if(e.$$typeof===N)return Qt(e)}throw Error(a(438,String(e)))}function ah(e){var n=null,o=Le.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var s=Le.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=oh(),Le.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(e),s=0;s<e;s++)o[s]=B;return n.index++,o}function Dr(e,n){return typeof n=="function"?n(e):n}function Sc(e){var n=wt();return ih(n,We,e)}function ih(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 R=h.next;h.next=y.next,y.next=R}n.baseQueue=h=y,s.pending=null}if(y=e.baseState,h===null)e.memoizedState=y;else{n=h.next;var I=R=null,V=null,J=n,oe=!1;do{var se=J.lane&-536870913;if(se!==J.lane?(Ve&se)===se:(lo&se)===se){var te=J.revertLane;if(te===0)V!==null&&(V=V.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),se===Za&&(oe=!0);else if((lo&te)===te){J=J.next,te===Za&&(oe=!0);continue}else se={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},V===null?(I=V=se,R=y):V=V.next=se,Le.lanes|=te,go|=te;se=J.action,ea&&o(y,se),y=J.hasEagerState?J.eagerState:o(y,se)}else te={lane:se,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},V===null?(I=V=te,R=y):V=V.next=te,Le.lanes|=se,go|=se;J=J.next}while(J!==null&&J!==n);if(V===null?R=y:V.next=I,!gn(y,e.memoizedState)&&(It=!0,oe&&(o=Wa,o!==null)))throw o;e.memoizedState=y,e.baseState=R,e.baseQueue=V,s.lastRenderedState=y}return h===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function sh(e){var n=wt(),o=n.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=e;var s=o.dispatch,h=o.pending,y=n.memoizedState;if(h!==null){o.pending=null;var R=h=h.next;do y=e(y,R.action),R=R.next;while(R!==h);gn(y,n.memoizedState)||(It=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),o.lastRenderedState=y}return[y,s]}function Eb(e,n,o){var s=Le,h=wt(),y=Ke;if(y){if(o===void 0)throw Error(a(407));o=o()}else o=n();var R=!gn((We||h).memoizedState,o);R&&(h.memoizedState=o,It=!0),h=h.queue;var I=Ab.bind(null,s,h,e);if(Ss(2048,8,I,[e]),h.getSnapshot!==n||R||Ct!==null&&Ct.memoizedState.tag&1){if(s.flags|=2048,ni(9,Cc(),jb.bind(null,s,h,o,n),null),ot===null)throw Error(a(349));y||(lo&124)!==0||Tb(s,n,o)}return o}function Tb(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Le.updateQueue,n===null?(n=oh(),Le.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function jb(e,n,o,s){n.value=o,n.getSnapshot=s,Rb(n)&&Nb(e)}function Ab(e,n,o){return o(function(){Rb(n)&&Nb(e)})}function Rb(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!gn(e,o)}catch{return!0}}function Nb(e){var n=Xa(e,2);n!==null&&Cn(n,e,2)}function lh(e){var n=ln();if(typeof e=="function"){var o=e;if(e=o(),ea){mn(!0);try{o()}finally{mn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:e},n}function Ob(e,n,o,s){return e.baseState=o,ih(e,We,typeof s=="function"?s:Dr)}function wO(e,n,o,s,h){if(Ec(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(R){y.listeners.push(R)}};G.T!==null?o(!0):y.isTransition=!1,s(y),o=n.pending,o===null?(y.next=n.pending=y,Mb(n,y)):(y.next=o.next,n.pending=o.next=y)}}function Mb(e,n){var o=n.action,s=n.payload,h=e.state;if(n.isTransition){var y=G.T,R={};G.T=R;try{var I=o(h,s),V=G.S;V!==null&&V(R,I),_b(e,n,I)}catch(J){ch(e,n,J)}finally{G.T=y}}else try{y=o(h,s),_b(e,n,y)}catch(J){ch(e,n,J)}}function _b(e,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(s){Db(e,n,s)},function(s){return ch(e,n,s)}):Db(e,n,o)}function Db(e,n,o){n.status="fulfilled",n.value=o,Ib(n),e.state=o,n=e.pending,n!==null&&(o=n.next,o===n?e.pending=null:(o=o.next,n.next=o,Mb(e,o)))}function ch(e,n,o){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=o,Ib(n),n=n.next;while(n!==s)}e.action=null}function Ib(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function kb(e,n){return n}function Lb(e,n){if(Ke){var o=ot.formState;if(o!==null){e:{var s=Le;if(Ke){if(mt){t:{for(var h=mt,y=ar;h.nodeType!==8;){if(!y){h=null;break t}if(h=Xn(h.nextSibling),h===null){h=null;break t}}y=h.data,h=y==="F!"||y==="F"?h:null}if(h){mt=Xn(h.nextSibling),s=h.data==="F!";break e}}Qo(s)}s=!1}s&&(n=o[0])}}return o=ln(),o.memoizedState=o.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kb,lastRenderedState:n},o.queue=s,o=tv.bind(null,Le,s),s.dispatch=o,s=lh(!1),y=mh.bind(null,Le,!1,s.queue),s=ln(),h={state:n,dispatch:null,action:e,pending:null},s.queue=h,o=wO.bind(null,Le,h,y,o),h.dispatch=o,s.memoizedState=e,[n,o,!1]}function zb(e){var n=wt();return Bb(n,We,e)}function Bb(e,n,o){if(n=ih(e,n,kb)[0],e=Sc(Dr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=vs(n)}catch(R){throw R===ms?pc:R}else s=n;n=wt();var h=n.queue,y=h.dispatch;return o!==n.memoizedState&&(Le.flags|=2048,ni(9,Cc(),EO.bind(null,h,o),null)),[s,y,e]}function EO(e,n){e.action=n}function Hb(e){var n=wt(),o=We;if(o!==null)return Bb(n,o,e);wt(),n=n.memoizedState,o=wt();var s=o.queue.dispatch;return o.memoizedState=e,[n,s,!1]}function ni(e,n,o,s){return e={tag:e,create:o,deps:s,inst:n,next:null},n=Le.updateQueue,n===null&&(n=oh(),Le.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=e.next=e:(s=o.next,o.next=e,e.next=s,n.lastEffect=e),e}function Cc(){return{destroy:void 0,resource:void 0}}function Pb(){return wt().memoizedState}function wc(e,n,o,s){var h=ln();s=s===void 0?null:s,Le.flags|=e,h.memoizedState=ni(1|n,Cc(),o,s)}function Ss(e,n,o,s){var h=wt();s=s===void 0?null:s;var y=h.memoizedState.inst;We!==null&&s!==null&&Jf(s,We.memoizedState.deps)?h.memoizedState=ni(n,y,o,s):(Le.flags|=e,h.memoizedState=ni(1|n,y,o,s))}function Ub(e,n){wc(8390656,8,e,n)}function $b(e,n){Ss(2048,8,e,n)}function Gb(e,n){return Ss(4,2,e,n)}function Vb(e,n){return Ss(4,4,e,n)}function qb(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 Yb(e,n,o){o=o!=null?o.concat([e]):null,Ss(4,4,qb.bind(null,n,e),o)}function uh(){}function Xb(e,n){var o=wt();n=n===void 0?null:n;var s=o.memoizedState;return n!==null&&Jf(n,s[1])?s[0]:(o.memoizedState=[e,n],e)}function Kb(e,n){var o=wt();n=n===void 0?null:n;var s=o.memoizedState;if(n!==null&&Jf(n,s[1]))return s[0];if(s=e(),ea){mn(!0);try{e()}finally{mn(!1)}}return o.memoizedState=[s,n],s}function dh(e,n,o){return o===void 0||(lo&1073741824)!==0?e.memoizedState=n:(e.memoizedState=o,e=Zv(),Le.lanes|=e,go|=e,o)}function Fb(e,n,o,s){return gn(o,n)?o:Ja.current!==null?(e=dh(e,o,s),gn(e,n)||(It=!0),e):(lo&42)===0?(It=!0,e.memoizedState=o):(e=Zv(),Le.lanes|=e,go|=e,n)}function Qb(e,n,o,s,h){var y=q.p;q.p=y!==0&&8>y?y:8;var R=G.T,I={};G.T=I,mh(e,!1,n,o);try{var V=h(),J=G.S;if(J!==null&&J(I,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var oe=vO(V,s);Cs(e,n,oe,Sn(e))}else Cs(e,n,s,Sn(e))}catch(se){Cs(e,n,{then:function(){},status:"rejected",reason:se},Sn())}finally{q.p=y,G.T=R}}function TO(){}function fh(e,n,o,s){if(e.tag!==5)throw Error(a(476));var h=Zb(e).queue;Qb(e,h,n,H,o===null?TO:function(){return Wb(e),o(s)})}function Zb(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:H},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:o},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Wb(e){var n=Zb(e).next.queue;Cs(e,n,{},Sn())}function hh(){return Qt(Ps)}function Jb(){return wt().memoizedState}function ev(){return wt().memoizedState}function jO(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var o=Sn();e=io(o);var s=so(n,e,o);s!==null&&(Cn(s,n,o),gs(s,n,o)),n={cache:Gf()},e.payload=n;return}n=n.return}}function AO(e,n,o){var s=Sn();o={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Ec(e)?nv(n,o):(o=Df(e,n,o,s),o!==null&&(Cn(o,e,s),rv(o,n,s)))}function tv(e,n,o){var s=Sn();Cs(e,n,o,s)}function Cs(e,n,o,s){var h={lane:s,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Ec(e))nv(n,h);else{var y=e.alternate;if(e.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null))try{var R=n.lastRenderedState,I=y(R,o);if(h.hasEagerState=!0,h.eagerState=I,gn(I,R))return sc(e,n,h,0),ot===null&&ic(),!1}catch{}finally{}if(o=Df(e,n,h,s),o!==null)return Cn(o,e,s),rv(o,n,s),!0}return!1}function mh(e,n,o,s){if(s={lane:2,revertLane:Yh(),action:s,hasEagerState:!1,eagerState:null,next:null},Ec(e)){if(n)throw Error(a(479))}else n=Df(e,o,s,2),n!==null&&Cn(n,e,2)}function Ec(e){var n=e.alternate;return e===Le||n!==null&&n===Le}function nv(e,n){ei=xc=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function rv(e,n,o){if((o&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,o|=s,n.lanes=o,Qi(e,o)}}var Tc={readContext:Qt,use:vc,useCallback:xt,useContext:xt,useEffect:xt,useImperativeHandle:xt,useLayoutEffect:xt,useInsertionEffect:xt,useMemo:xt,useReducer:xt,useRef:xt,useState:xt,useDebugValue:xt,useDeferredValue:xt,useTransition:xt,useSyncExternalStore:xt,useId:xt,useHostTransitionStatus:xt,useFormState:xt,useActionState:xt,useOptimistic:xt,useMemoCache:xt,useCacheRefresh:xt},ov={readContext:Qt,use:vc,useCallback:function(e,n){return ln().memoizedState=[e,n===void 0?null:n],e},useContext:Qt,useEffect:Ub,useImperativeHandle:function(e,n,o){o=o!=null?o.concat([e]):null,wc(4194308,4,qb.bind(null,n,e),o)},useLayoutEffect:function(e,n){return wc(4194308,4,e,n)},useInsertionEffect:function(e,n){wc(4,2,e,n)},useMemo:function(e,n){var o=ln();n=n===void 0?null:n;var s=e();if(ea){mn(!0);try{e()}finally{mn(!1)}}return o.memoizedState=[s,n],s},useReducer:function(e,n,o){var s=ln();if(o!==void 0){var h=o(n);if(ea){mn(!0);try{o(n)}finally{mn(!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=AO.bind(null,Le,e),[s.memoizedState,e]},useRef:function(e){var n=ln();return e={current:e},n.memoizedState=e},useState:function(e){e=lh(e);var n=e.queue,o=tv.bind(null,Le,n);return n.dispatch=o,[e.memoizedState,o]},useDebugValue:uh,useDeferredValue:function(e,n){var o=ln();return dh(o,e,n)},useTransition:function(){var e=lh(!1);return e=Qb.bind(null,Le,e.queue,!0,!1),ln().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,o){var s=Le,h=ln();if(Ke){if(o===void 0)throw Error(a(407));o=o()}else{if(o=n(),ot===null)throw Error(a(349));(Ve&124)!==0||Tb(s,n,o)}h.memoizedState=o;var y={value:o,getSnapshot:n};return h.queue=y,Ub(Ab.bind(null,s,y,e),[e]),s.flags|=2048,ni(9,Cc(),jb.bind(null,s,y,o,n),null),o},useId:function(){var e=ln(),n=ot.identifierPrefix;if(Ke){var o=Or,s=Nr;o=(s&~(1<<32-Ht(s)-1)).toString(32)+o,n="«"+n+"R"+o,o=bc++,0<o&&(n+="H"+o.toString(32)),n+="»"}else o=SO++,n="«"+n+"r"+o.toString(32)+"»";return e.memoizedState=n},useHostTransitionStatus:hh,useFormState:Lb,useActionState:Lb,useOptimistic:function(e){var n=ln();n.memoizedState=n.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=mh.bind(null,Le,!0,o),o.dispatch=n,[e,n]},useMemoCache:ah,useCacheRefresh:function(){return ln().memoizedState=jO.bind(null,Le)}},av={readContext:Qt,use:vc,useCallback:Xb,useContext:Qt,useEffect:$b,useImperativeHandle:Yb,useInsertionEffect:Gb,useLayoutEffect:Vb,useMemo:Kb,useReducer:Sc,useRef:Pb,useState:function(){return Sc(Dr)},useDebugValue:uh,useDeferredValue:function(e,n){var o=wt();return Fb(o,We.memoizedState,e,n)},useTransition:function(){var e=Sc(Dr)[0],n=wt().memoizedState;return[typeof e=="boolean"?e:vs(e),n]},useSyncExternalStore:Eb,useId:Jb,useHostTransitionStatus:hh,useFormState:zb,useActionState:zb,useOptimistic:function(e,n){var o=wt();return Ob(o,We,e,n)},useMemoCache:ah,useCacheRefresh:ev},RO={readContext:Qt,use:vc,useCallback:Xb,useContext:Qt,useEffect:$b,useImperativeHandle:Yb,useInsertionEffect:Gb,useLayoutEffect:Vb,useMemo:Kb,useReducer:sh,useRef:Pb,useState:function(){return sh(Dr)},useDebugValue:uh,useDeferredValue:function(e,n){var o=wt();return We===null?dh(o,e,n):Fb(o,We.memoizedState,e,n)},useTransition:function(){var e=sh(Dr)[0],n=wt().memoizedState;return[typeof e=="boolean"?e:vs(e),n]},useSyncExternalStore:Eb,useId:Jb,useHostTransitionStatus:hh,useFormState:Hb,useActionState:Hb,useOptimistic:function(e,n){var o=wt();return We!==null?Ob(o,We,e,n):(o.baseState=e,[e,o.queue.dispatch])},useMemoCache:ah,useCacheRefresh:ev},ri=null,ws=0;function jc(e){var n=ws;return ws+=1,ri===null&&(ri=[]),gb(ri,e,n)}function Es(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Ac(e,n){throw n.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function iv(e){var n=e._init;return n(e._payload)}function sv(e){function n(Q,X){if(e){var W=Q.deletions;W===null?(Q.deletions=[X],Q.flags|=16):W.push(X)}}function o(Q,X){if(!e)return null;for(;X!==null;)n(Q,X),X=X.sibling;return null}function s(Q){for(var X=new Map;Q!==null;)Q.key!==null?X.set(Q.key,Q):X.set(Q.index,Q),Q=Q.sibling;return X}function h(Q,X){return Q=Rr(Q,X),Q.index=0,Q.sibling=null,Q}function y(Q,X,W){return Q.index=W,e?(W=Q.alternate,W!==null?(W=W.index,W<X?(Q.flags|=67108866,X):W):(Q.flags|=67108866,X)):(Q.flags|=1048576,X)}function R(Q){return e&&Q.alternate===null&&(Q.flags|=67108866),Q}function I(Q,X,W,ie){return X===null||X.tag!==6?(X=kf(W,Q.mode,ie),X.return=Q,X):(X=h(X,W),X.return=Q,X)}function V(Q,X,W,ie){var me=W.type;return me===v?oe(Q,X,W.props.children,ie,W.key):X!==null&&(X.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===k&&iv(me)===X.type)?(X=h(X,W.props),Es(X,W),X.return=Q,X):(X=cc(W.type,W.key,W.props,null,Q.mode,ie),Es(X,W),X.return=Q,X)}function J(Q,X,W,ie){return X===null||X.tag!==4||X.stateNode.containerInfo!==W.containerInfo||X.stateNode.implementation!==W.implementation?(X=Lf(W,Q.mode,ie),X.return=Q,X):(X=h(X,W.children||[]),X.return=Q,X)}function oe(Q,X,W,ie,me){return X===null||X.tag!==7?(X=Yo(W,Q.mode,ie,me),X.return=Q,X):(X=h(X,W),X.return=Q,X)}function se(Q,X,W){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=kf(""+X,Q.mode,W),X.return=Q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case x:return W=cc(X.type,X.key,X.props,null,Q.mode,W),Es(W,X),W.return=Q,W;case b:return X=Lf(X,Q.mode,W),X.return=Q,X;case k:var ie=X._init;return X=ie(X._payload),se(Q,X,W)}if(ee(X)||U(X))return X=Yo(X,Q.mode,W,null),X.return=Q,X;if(typeof X.then=="function")return se(Q,jc(X),W);if(X.$$typeof===N)return se(Q,hc(Q,X),W);Ac(Q,X)}return null}function te(Q,X,W,ie){var me=X!==null?X.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return me!==null?null:I(Q,X,""+W,ie);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case x:return W.key===me?V(Q,X,W,ie):null;case b:return W.key===me?J(Q,X,W,ie):null;case k:return me=W._init,W=me(W._payload),te(Q,X,W,ie)}if(ee(W)||U(W))return me!==null?null:oe(Q,X,W,ie,null);if(typeof W.then=="function")return te(Q,X,jc(W),ie);if(W.$$typeof===N)return te(Q,X,hc(Q,W),ie);Ac(Q,W)}return null}function ne(Q,X,W,ie,me){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Q=Q.get(W)||null,I(X,Q,""+ie,me);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return Q=Q.get(ie.key===null?W:ie.key)||null,V(X,Q,ie,me);case b:return Q=Q.get(ie.key===null?W:ie.key)||null,J(X,Q,ie,me);case k:var ze=ie._init;return ie=ze(ie._payload),ne(Q,X,W,ie,me)}if(ee(ie)||U(ie))return Q=Q.get(W)||null,oe(X,Q,ie,me,null);if(typeof ie.then=="function")return ne(Q,X,W,jc(ie),me);if(ie.$$typeof===N)return ne(Q,X,W,hc(X,ie),me);Ac(X,ie)}return null}function Ae(Q,X,W,ie){for(var me=null,ze=null,xe=X,je=X=0,Lt=null;xe!==null&&je<W.length;je++){xe.index>je?(Lt=xe,xe=null):Lt=xe.sibling;var Xe=te(Q,xe,W[je],ie);if(Xe===null){xe===null&&(xe=Lt);break}e&&xe&&Xe.alternate===null&&n(Q,xe),X=y(Xe,X,je),ze===null?me=Xe:ze.sibling=Xe,ze=Xe,xe=Lt}if(je===W.length)return o(Q,xe),Ke&&Ko(Q,je),me;if(xe===null){for(;je<W.length;je++)xe=se(Q,W[je],ie),xe!==null&&(X=y(xe,X,je),ze===null?me=xe:ze.sibling=xe,ze=xe);return Ke&&Ko(Q,je),me}for(xe=s(xe);je<W.length;je++)Lt=ne(xe,Q,je,W[je],ie),Lt!==null&&(e&&Lt.alternate!==null&&xe.delete(Lt.key===null?je:Lt.key),X=y(Lt,X,je),ze===null?me=Lt:ze.sibling=Lt,ze=Lt);return e&&xe.forEach(function(To){return n(Q,To)}),Ke&&Ko(Q,je),me}function we(Q,X,W,ie){if(W==null)throw Error(a(151));for(var me=null,ze=null,xe=X,je=X=0,Lt=null,Xe=W.next();xe!==null&&!Xe.done;je++,Xe=W.next()){xe.index>je?(Lt=xe,xe=null):Lt=xe.sibling;var To=te(Q,xe,Xe.value,ie);if(To===null){xe===null&&(xe=Lt);break}e&&xe&&To.alternate===null&&n(Q,xe),X=y(To,X,je),ze===null?me=To:ze.sibling=To,ze=To,xe=Lt}if(Xe.done)return o(Q,xe),Ke&&Ko(Q,je),me;if(xe===null){for(;!Xe.done;je++,Xe=W.next())Xe=se(Q,Xe.value,ie),Xe!==null&&(X=y(Xe,X,je),ze===null?me=Xe:ze.sibling=Xe,ze=Xe);return Ke&&Ko(Q,je),me}for(xe=s(xe);!Xe.done;je++,Xe=W.next())Xe=ne(xe,Q,je,Xe.value,ie),Xe!==null&&(e&&Xe.alternate!==null&&xe.delete(Xe.key===null?je:Xe.key),X=y(Xe,X,je),ze===null?me=Xe:ze.sibling=Xe,ze=Xe);return e&&xe.forEach(function(NM){return n(Q,NM)}),Ke&&Ko(Q,je),me}function et(Q,X,W,ie){if(typeof W=="object"&&W!==null&&W.type===v&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case x:e:{for(var me=W.key;X!==null;){if(X.key===me){if(me=W.type,me===v){if(X.tag===7){o(Q,X.sibling),ie=h(X,W.props.children),ie.return=Q,Q=ie;break e}}else if(X.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===k&&iv(me)===X.type){o(Q,X.sibling),ie=h(X,W.props),Es(ie,W),ie.return=Q,Q=ie;break e}o(Q,X);break}else n(Q,X);X=X.sibling}W.type===v?(ie=Yo(W.props.children,Q.mode,ie,W.key),ie.return=Q,Q=ie):(ie=cc(W.type,W.key,W.props,null,Q.mode,ie),Es(ie,W),ie.return=Q,Q=ie)}return R(Q);case b:e:{for(me=W.key;X!==null;){if(X.key===me)if(X.tag===4&&X.stateNode.containerInfo===W.containerInfo&&X.stateNode.implementation===W.implementation){o(Q,X.sibling),ie=h(X,W.children||[]),ie.return=Q,Q=ie;break e}else{o(Q,X);break}else n(Q,X);X=X.sibling}ie=Lf(W,Q.mode,ie),ie.return=Q,Q=ie}return R(Q);case k:return me=W._init,W=me(W._payload),et(Q,X,W,ie)}if(ee(W))return Ae(Q,X,W,ie);if(U(W)){if(me=U(W),typeof me!="function")throw Error(a(150));return W=me.call(W),we(Q,X,W,ie)}if(typeof W.then=="function")return et(Q,X,jc(W),ie);if(W.$$typeof===N)return et(Q,X,hc(Q,W),ie);Ac(Q,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,X!==null&&X.tag===6?(o(Q,X.sibling),ie=h(X,W),ie.return=Q,Q=ie):(o(Q,X),ie=kf(W,Q.mode,ie),ie.return=Q,Q=ie),R(Q)):o(Q,X)}return function(Q,X,W,ie){try{ws=0;var me=et(Q,X,W,ie);return ri=null,me}catch(xe){if(xe===ms||xe===pc)throw xe;var ze=yn(29,xe,null,Q.mode);return ze.lanes=ie,ze.return=Q,ze}finally{}}}var oi=sv(!0),lv=sv(!1),Hn=Y(null),ir=null;function co(e){var n=e.alternate;Z(Mt,Mt.current&1),Z(Hn,e),ir===null&&(n===null||Ja.current!==null||n.memoizedState!==null)&&(ir=e)}function cv(e){if(e.tag===22){if(Z(Mt,Mt.current),Z(Hn,e),ir===null){var n=e.alternate;n!==null&&n.memoizedState!==null&&(ir=e)}}else uo()}function uo(){Z(Mt,Mt.current),Z(Hn,Hn.current)}function Ir(e){F(Hn),ir===e&&(ir=null),F(Mt)}var Mt=Y(0);function Rc(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==="$?"||om(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 ph(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 gh={enqueueSetState:function(e,n,o){e=e._reactInternals;var s=Sn(),h=io(s);h.payload=n,o!=null&&(h.callback=o),n=so(e,h,s),n!==null&&(Cn(n,e,s),gs(n,e,s))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var s=Sn(),h=io(s);h.tag=1,h.payload=n,o!=null&&(h.callback=o),n=so(e,h,s),n!==null&&(Cn(n,e,s),gs(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Sn(),s=io(o);s.tag=2,n!=null&&(s.callback=n),n=so(e,s,o),n!==null&&(Cn(n,e,o),gs(n,e,o))}};function uv(e,n,o,s,h,y,R){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,y,R):n.prototype&&n.prototype.isPureReactComponent?!is(o,s)||!is(h,y):!0}function dv(e,n,o,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,s),n.state!==e&&gh.enqueueReplaceState(n,n.state,null)}function ta(e,n){var o=n;if("ref"in n){o={};for(var s in n)s!=="ref"&&(o[s]=n[s])}if(e=e.defaultProps){o===n&&(o=C({},o));for(var h in e)o[h]===void 0&&(o[h]=e[h])}return o}var Nc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function fv(e){Nc(e)}function hv(e){console.error(e)}function mv(e){Nc(e)}function Oc(e,n){try{var o=e.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function pv(e,n,o){try{var s=e.onCaughtError;s(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function yh(e,n,o){return o=io(o),o.tag=3,o.payload={element:null},o.callback=function(){Oc(e,n)},o}function gv(e){return e=io(e),e.tag=3,e}function yv(e,n,o,s){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var y=s.value;e.payload=function(){return h(y)},e.callback=function(){pv(n,o,s)}}var R=o.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(e.callback=function(){pv(n,o,s),typeof h!="function"&&(yo===null?yo=new Set([this]):yo.add(this));var I=s.stack;this.componentDidCatch(s.value,{componentStack:I!==null?I:""})})}function NO(e,n,o,s,h){if(o.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=o.alternate,n!==null&&ds(n,o,h,!0),o=Hn.current,o!==null){switch(o.tag){case 13:return ir===null?Uh():o.alternate===null&&pt===0&&(pt=3),o.flags&=-257,o.flags|=65536,o.lanes=h,s===Yf?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([s]):n.add(s),Gh(e,s,h)),!1;case 22:return o.flags|=65536,s===Yf?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)),Gh(e,s,h)),!1}throw Error(a(435,o.tag))}return Gh(e,s,h),Uh(),!1}if(Ke)return n=Hn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,s!==Hf&&(e=Error(a(422),{cause:s}),us(kn(e,o)))):(s!==Hf&&(n=Error(a(423),{cause:s}),us(kn(n,o))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,s=kn(s,o),h=yh(e.stateNode,s,h),Ff(e,h),pt!==4&&(pt=2)),!1;var y=Error(a(520),{cause:s});if(y=kn(y,o),Ms===null?Ms=[y]:Ms.push(y),pt!==4&&(pt=2),n===null)return!0;s=kn(s,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,e=h&-h,o.lanes|=e,e=yh(o.stateNode,s,e),Ff(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"&&(yo===null||!yo.has(y))))return o.flags|=65536,h&=-h,o.lanes|=h,h=gv(h),yv(h,e,o,s),Ff(o,h),!1}o=o.return}while(o!==null);return!1}var xv=Error(a(461)),It=!1;function Pt(e,n,o,s){n.child=e===null?lv(n,null,o,s):oi(n,e.child,o,s)}function bv(e,n,o,s,h){o=o.render;var y=n.ref;if("ref"in s){var R={};for(var I in s)I!=="ref"&&(R[I]=s[I])}else R=s;return Wo(n),s=eh(e,n,o,R,y,h),I=th(),e!==null&&!It?(nh(e,n,h),kr(e,n,h)):(Ke&&I&&zf(n),n.flags|=1,Pt(e,n,s,h),n.child)}function vv(e,n,o,s,h){if(e===null){var y=o.type;return typeof y=="function"&&!If(y)&&y.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=y,Sv(e,n,y,s,h)):(e=cc(o.type,null,s,n,n.mode,h),e.ref=n.ref,e.return=n,n.child=e)}if(y=e.child,!Th(e,h)){var R=y.memoizedProps;if(o=o.compare,o=o!==null?o:is,o(R,s)&&e.ref===n.ref)return kr(e,n,h)}return n.flags|=1,e=Rr(y,s),e.ref=n.ref,e.return=n,n.child=e}function Sv(e,n,o,s,h){if(e!==null){var y=e.memoizedProps;if(is(y,s)&&e.ref===n.ref)if(It=!1,n.pendingProps=s=y,Th(e,h))(e.flags&131072)!==0&&(It=!0);else return n.lanes=e.lanes,kr(e,n,h)}return xh(e,n,o,s,h)}function Cv(e,n,o){var s=n.pendingProps,h=s.children,y=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if((n.flags&128)!==0){if(s=y!==null?y.baseLanes|o:o,e!==null){for(h=n.child=e.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;n.childLanes=y&~s}else n.childLanes=0,n.child=null;return wv(e,n,s,o)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&mc(n,y!==null?y.cachePool:null),y!==null?Sb(n,y):Zf(),cv(n);else return n.lanes=n.childLanes=536870912,wv(e,n,y!==null?y.baseLanes|o:o,o)}else y!==null?(mc(n,y.cachePool),Sb(n,y),uo(),n.memoizedState=null):(e!==null&&mc(n,null),Zf(),uo());return Pt(e,n,h,o),n.child}function wv(e,n,o,s){var h=qf();return h=h===null?null:{parent:Ot._currentValue,pool:h},n.memoizedState={baseLanes:o,cachePool:h},e!==null&&mc(n,null),Zf(),cv(n),e!==null&&ds(e,n,s,!0),null}function Mc(e,n){var o=n.ref;if(o===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(e===null||e.ref!==o)&&(n.flags|=4194816)}}function xh(e,n,o,s,h){return Wo(n),o=eh(e,n,o,s,void 0,h),s=th(),e!==null&&!It?(nh(e,n,h),kr(e,n,h)):(Ke&&s&&zf(n),n.flags|=1,Pt(e,n,o,h),n.child)}function Ev(e,n,o,s,h,y){return Wo(n),n.updateQueue=null,o=wb(n,s,o,h),Cb(e),s=th(),e!==null&&!It?(nh(e,n,y),kr(e,n,y)):(Ke&&s&&zf(n),n.flags|=1,Pt(e,n,o,y),n.child)}function Tv(e,n,o,s,h){if(Wo(n),n.stateNode===null){var y=Ka,R=o.contextType;typeof R=="object"&&R!==null&&(y=Qt(R)),y=new o(s,y),n.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=gh,n.stateNode=y,y._reactInternals=n,y=n.stateNode,y.props=s,y.state=n.memoizedState,y.refs={},Xf(n),R=o.contextType,y.context=typeof R=="object"&&R!==null?Qt(R):Ka,y.state=n.memoizedState,R=o.getDerivedStateFromProps,typeof R=="function"&&(ph(n,o,R,s),y.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(R=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),R!==y.state&&gh.enqueueReplaceState(y,y.state,null),xs(n,s,y,h),ys(),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){y=n.stateNode;var I=n.memoizedProps,V=ta(o,I);y.props=V;var J=y.context,oe=o.contextType;R=Ka,typeof oe=="object"&&oe!==null&&(R=Qt(oe));var se=o.getDerivedStateFromProps;oe=typeof se=="function"||typeof y.getSnapshotBeforeUpdate=="function",I=n.pendingProps!==I,oe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(I||J!==R)&&dv(n,y,s,R),ao=!1;var te=n.memoizedState;y.state=te,xs(n,s,y,h),ys(),J=n.memoizedState,I||te!==J||ao?(typeof se=="function"&&(ph(n,o,se,s),J=n.memoizedState),(V=ao||uv(n,o,V,s,te,J,R))?(oe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(n.flags|=4194308)):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=J),y.props=s,y.state=J,y.context=R,s=V):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{y=n.stateNode,Kf(e,n),R=n.memoizedProps,oe=ta(o,R),y.props=oe,se=n.pendingProps,te=y.context,J=o.contextType,V=Ka,typeof J=="object"&&J!==null&&(V=Qt(J)),I=o.getDerivedStateFromProps,(J=typeof I=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R!==se||te!==V)&&dv(n,y,s,V),ao=!1,te=n.memoizedState,y.state=te,xs(n,s,y,h),ys();var ne=n.memoizedState;R!==se||te!==ne||ao||e!==null&&e.dependencies!==null&&fc(e.dependencies)?(typeof I=="function"&&(ph(n,o,I,s),ne=n.memoizedState),(oe=ao||uv(n,o,oe,s,te,ne,V)||e!==null&&e.dependencies!==null&&fc(e.dependencies))?(J||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(s,ne,V),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(s,ne,V)),typeof y.componentDidUpdate=="function"&&(n.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof y.componentDidUpdate!="function"||R===e.memoizedProps&&te===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||R===e.memoizedProps&&te===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=ne),y.props=s,y.state=ne,y.context=V,s=oe):(typeof y.componentDidUpdate!="function"||R===e.memoizedProps&&te===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||R===e.memoizedProps&&te===e.memoizedState||(n.flags|=1024),s=!1)}return y=s,Mc(e,n),s=(n.flags&128)!==0,y||s?(y=n.stateNode,o=s&&typeof o.getDerivedStateFromError!="function"?null:y.render(),n.flags|=1,e!==null&&s?(n.child=oi(n,e.child,null,h),n.child=oi(n,null,o,h)):Pt(e,n,o,h),n.memoizedState=y.state,e=n.child):e=kr(e,n,h),e}function jv(e,n,o,s){return cs(),n.flags|=256,Pt(e,n,o,s),n.child}var bh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vh(e){return{baseLanes:e,cachePool:hb()}}function Sh(e,n,o){return e=e!==null?e.childLanes&~o:0,n&&(e|=Pn),e}function Av(e,n,o){var s=n.pendingProps,h=!1,y=(n.flags&128)!==0,R;if((R=y)||(R=e!==null&&e.memoizedState===null?!1:(Mt.current&2)!==0),R&&(h=!0,n.flags&=-129),R=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ke){if(h?co(n):uo(),Ke){var I=mt,V;if(V=I){e:{for(V=I,I=ar;V.nodeType!==8;){if(!I){I=null;break e}if(V=Xn(V.nextSibling),V===null){I=null;break e}}I=V}I!==null?(n.memoizedState={dehydrated:I,treeContext:Xo!==null?{id:Nr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},V=yn(18,null,null,0),V.stateNode=I,V.return=n,n.child=V,en=n,mt=null,V=!0):V=!1}V||Qo(n)}if(I=n.memoizedState,I!==null&&(I=I.dehydrated,I!==null))return om(I)?n.lanes=32:n.lanes=536870912,null;Ir(n)}return I=s.children,s=s.fallback,h?(uo(),h=n.mode,I=_c({mode:"hidden",children:I},h),s=Yo(s,h,o,null),I.return=n,s.return=n,I.sibling=s,n.child=I,h=n.child,h.memoizedState=vh(o),h.childLanes=Sh(e,R,o),n.memoizedState=bh,s):(co(n),Ch(n,I))}if(V=e.memoizedState,V!==null&&(I=V.dehydrated,I!==null)){if(y)n.flags&256?(co(n),n.flags&=-257,n=wh(e,n,o)):n.memoizedState!==null?(uo(),n.child=e.child,n.flags|=128,n=null):(uo(),h=s.fallback,I=n.mode,s=_c({mode:"visible",children:s.children},I),h=Yo(h,I,o,null),h.flags|=2,s.return=n,h.return=n,s.sibling=h,n.child=s,oi(n,e.child,null,o),s=n.child,s.memoizedState=vh(o),s.childLanes=Sh(e,R,o),n.memoizedState=bh,n=h);else if(co(n),om(I)){if(R=I.nextSibling&&I.nextSibling.dataset,R)var J=R.dgst;R=J,s=Error(a(419)),s.stack="",s.digest=R,us({value:s,source:null,stack:null}),n=wh(e,n,o)}else if(It||ds(e,n,o,!1),R=(o&e.childLanes)!==0,It||R){if(R=ot,R!==null&&(s=o&-o,s=(s&42)!==0?1:_a(s),s=(s&(R.suspendedLanes|o))!==0?0:s,s!==0&&s!==V.retryLane))throw V.retryLane=s,Xa(e,s),Cn(R,e,s),xv;I.data==="$?"||Uh(),n=wh(e,n,o)}else I.data==="$?"?(n.flags|=192,n.child=e.child,n=null):(e=V.treeContext,mt=Xn(I.nextSibling),en=n,Ke=!0,Fo=null,ar=!1,e!==null&&(zn[Bn++]=Nr,zn[Bn++]=Or,zn[Bn++]=Xo,Nr=e.id,Or=e.overflow,Xo=n),n=Ch(n,s.children),n.flags|=4096);return n}return h?(uo(),h=s.fallback,I=n.mode,V=e.child,J=V.sibling,s=Rr(V,{mode:"hidden",children:s.children}),s.subtreeFlags=V.subtreeFlags&65011712,J!==null?h=Rr(J,h):(h=Yo(h,I,o,null),h.flags|=2),h.return=n,s.return=n,s.sibling=h,n.child=s,s=h,h=n.child,I=e.child.memoizedState,I===null?I=vh(o):(V=I.cachePool,V!==null?(J=Ot._currentValue,V=V.parent!==J?{parent:J,pool:J}:V):V=hb(),I={baseLanes:I.baseLanes|o,cachePool:V}),h.memoizedState=I,h.childLanes=Sh(e,R,o),n.memoizedState=bh,s):(co(n),o=e.child,e=o.sibling,o=Rr(o,{mode:"visible",children:s.children}),o.return=n,o.sibling=null,e!==null&&(R=n.deletions,R===null?(n.deletions=[e],n.flags|=16):R.push(e)),n.child=o,n.memoizedState=null,o)}function Ch(e,n){return n=_c({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function _c(e,n){return e=yn(22,e,null,n),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function wh(e,n,o){return oi(n,e.child,null,o),e=Ch(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Rv(e,n,o){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),Uf(e.return,n,o)}function Eh(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 Nv(e,n,o){var s=n.pendingProps,h=s.revealOrder,y=s.tail;if(Pt(e,n,s.children,o),s=Mt.current,(s&2)!==0)s=s&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rv(e,o,n);else if(e.tag===19)Rv(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}switch(Z(Mt,s),h){case"forwards":for(o=n.child,h=null;o!==null;)e=o.alternate,e!==null&&Rc(e)===null&&(h=o),o=o.sibling;o=h,o===null?(h=n.child,n.child=null):(h=o.sibling,o.sibling=null),Eh(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&&Rc(e)===null){n.child=h;break}e=h.sibling,h.sibling=o,o=h,h=e}Eh(n,!0,o,null,y);break;case"together":Eh(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function kr(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),go|=n.lanes,(o&n.childLanes)===0)if(e!==null){if(ds(e,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,o=Rr(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=Rr(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Th(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&fc(e)))}function OO(e,n,o){switch(n.tag){case 3:ye(n,n.stateNode.containerInfo),oo(n,Ot,e.memoizedState.cache),cs();break;case 27:case 5:de(n);break;case 4:ye(n,n.stateNode.containerInfo);break;case 10:oo(n,n.type,n.memoizedProps.value);break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(co(n),n.flags|=128,null):(o&n.child.childLanes)!==0?Av(e,n,o):(co(n),e=kr(e,n,o),e!==null?e.sibling:null);co(n);break;case 19:var h=(e.flags&128)!==0;if(s=(o&n.childLanes)!==0,s||(ds(e,n,o,!1),s=(o&n.childLanes)!==0),h){if(s)return Nv(e,n,o);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Z(Mt,Mt.current),s)break;return null;case 22:case 23:return n.lanes=0,Cv(e,n,o);case 24:oo(n,Ot,e.memoizedState.cache)}return kr(e,n,o)}function Ov(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps)It=!0;else{if(!Th(e,o)&&(n.flags&128)===0)return It=!1,OO(e,n,o);It=(e.flags&131072)!==0}else It=!1,Ke&&(n.flags&1048576)!==0&&ib(n,dc,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")If(s)?(e=ta(s,e),n.tag=1,n=Tv(null,n,s,e,o)):(n.tag=0,n=xh(null,n,s,e,o));else{if(s!=null){if(h=s.$$typeof,h===M){n.tag=11,n=bv(null,n,s,e,o);break e}else if(h===_){n.tag=14,n=vv(null,n,s,e,o);break e}}throw n=$(s)||s,Error(a(306,n,""))}}return n;case 0:return xh(e,n,n.type,n.pendingProps,o);case 1:return s=n.type,h=ta(s,n.pendingProps),Tv(e,n,s,h,o);case 3:e:{if(ye(n,n.stateNode.containerInfo),e===null)throw Error(a(387));s=n.pendingProps;var y=n.memoizedState;h=y.element,Kf(e,n),xs(n,s,null,o);var R=n.memoizedState;if(s=R.cache,oo(n,Ot,s),s!==y.cache&&$f(n,[Ot],o,!0),ys(),s=R.element,y.isDehydrated)if(y={element:s,isDehydrated:!1,cache:R.cache},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){n=jv(e,n,s,o);break e}else if(s!==h){h=kn(Error(a(424)),n),us(h),n=jv(e,n,s,o);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(mt=Xn(e.firstChild),en=n,Ke=!0,Fo=null,ar=!0,o=lv(n,null,s,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(cs(),s===h){n=kr(e,n,o);break e}Pt(e,n,s,o)}n=n.child}return n;case 26:return Mc(e,n),e===null?(o=I1(n.type,null,n.pendingProps,null))?n.memoizedState=o:Ke||(o=n.type,e=n.pendingProps,s=Yc(ae.current).createElement(o),s[Ft]=n,s[an]=e,$t(s,o,e),Dt(s),n.stateNode=s):n.memoizedState=I1(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return de(n),e===null&&Ke&&(s=n.stateNode=M1(n.type,n.pendingProps,ae.current),en=n,ar=!0,h=mt,vo(n.type)?(am=h,mt=Xn(s.firstChild)):mt=h),Pt(e,n,n.pendingProps.children,o),Mc(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ke&&((h=s=mt)&&(s=oM(s,n.type,n.pendingProps,ar),s!==null?(n.stateNode=s,en=n,mt=Xn(s.firstChild),ar=!1,h=!0):h=!1),h||Qo(n)),de(n),h=n.type,y=n.pendingProps,R=e!==null?e.memoizedProps:null,s=y.children,tm(h,y)?s=null:R!==null&&tm(h,R)&&(n.flags|=32),n.memoizedState!==null&&(h=eh(e,n,CO,null,null,o),Ps._currentValue=h),Mc(e,n),Pt(e,n,s,o),n.child;case 6:return e===null&&Ke&&((e=o=mt)&&(o=aM(o,n.pendingProps,ar),o!==null?(n.stateNode=o,en=n,mt=null,e=!0):e=!1),e||Qo(n)),null;case 13:return Av(e,n,o);case 4:return ye(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=oi(n,null,s,o):Pt(e,n,s,o),n.child;case 11:return bv(e,n,n.type,n.pendingProps,o);case 7:return Pt(e,n,n.pendingProps,o),n.child;case 8:return Pt(e,n,n.pendingProps.children,o),n.child;case 12:return Pt(e,n,n.pendingProps.children,o),n.child;case 10:return s=n.pendingProps,oo(n,n.type,s.value),Pt(e,n,s.children,o),n.child;case 9:return h=n.type._context,s=n.pendingProps.children,Wo(n),h=Qt(h),s=s(h),n.flags|=1,Pt(e,n,s,o),n.child;case 14:return vv(e,n,n.type,n.pendingProps,o);case 15:return Sv(e,n,n.type,n.pendingProps,o);case 19:return Nv(e,n,o);case 31:return s=n.pendingProps,o=n.mode,s={mode:s.mode,children:s.children},e===null?(o=_c(s,o),o.ref=n.ref,n.child=o,o.return=n,n=o):(o=Rr(e.child,s),o.ref=n.ref,n.child=o,o.return=n,n=o),n;case 22:return Cv(e,n,o);case 24:return Wo(n),s=Qt(Ot),e===null?(h=qf(),h===null&&(h=ot,y=Gf(),h.pooledCache=y,y.refCount++,y!==null&&(h.pooledCacheLanes|=o),h=y),n.memoizedState={parent:s,cache:h},Xf(n),oo(n,Ot,h)):((e.lanes&o)!==0&&(Kf(e,n),xs(n,null,null,o),ys()),h=e.memoizedState,y=n.memoizedState,h.parent!==s?(h={parent:s,cache:s},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),oo(n,Ot,s)):(s=y.cache,oo(n,Ot,s),s!==h.cache&&$f(n,[Ot],o,!0))),Pt(e,n,n.pendingProps.children,o),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Lr(e){e.flags|=4}function Mv(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!H1(n)){if(n=Hn.current,n!==null&&((Ve&4194048)===Ve?ir!==null:(Ve&62914560)!==Ve&&(Ve&536870912)===0||n!==ir))throw ps=Yf,mb;e.flags|=8192}}function Dc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?tt():536870912,e.lanes|=n,li|=n)}function Ts(e,n){if(!Ke)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var s=null;o!==null;)o.alternate!==null&&(s=o),o=o.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function ut(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,s=0;if(n)for(var h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags&65011712,s|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)o|=h.lanes|h.childLanes,s|=h.subtreeFlags,s|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=s,e.childLanes=o,n}function MO(e,n,o){var s=n.pendingProps;switch(Bf(n),n.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(n),null;case 1:return ut(n),null;case 3:return o=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),_r(Ot),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(ls(n)?Lr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,cb())),ut(n),null;case 26:return o=n.memoizedState,e===null?(Lr(n),o!==null?(ut(n),Mv(n,o)):(ut(n),n.flags&=-16777217)):o?o!==e.memoizedState?(Lr(n),ut(n),Mv(n,o)):(ut(n),n.flags&=-16777217):(e.memoizedProps!==s&&Lr(n),ut(n),n.flags&=-16777217),null;case 27:_e(n),o=ae.current;var h=n.type;if(e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Lr(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return ut(n),null}e=le.current,ls(n)?sb(n):(e=M1(h,s,o),n.stateNode=e,Lr(n))}return ut(n),null;case 5:if(_e(n),o=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Lr(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return ut(n),null}if(e=le.current,ls(n))sb(n);else{switch(h=Yc(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[Ft]=n,e[an]=s;e:for(h=n.child;h!==null;){if(h.tag===5||h.tag===6)e.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}n.stateNode=e;e:switch($t(e,o,s),o){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Lr(n)}}return ut(n),n.flags&=-16777217,null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Lr(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=ae.current,ls(n)){if(e=n.stateNode,o=n.memoizedProps,s=null,h=en,h!==null)switch(h.tag){case 27:case 5:s=h.memoizedProps}e[Ft]=n,e=!!(e.nodeValue===o||s!==null&&s.suppressHydrationWarning===!0||E1(e.nodeValue,o)),e||Qo(n)}else e=Yc(e).createTextNode(s),e[Ft]=n,n.stateNode=e}return ut(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=ls(n),s!==null&&s.dehydrated!==null){if(e===null){if(!h)throw Error(a(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Ft]=n}else cs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ut(n),h=!1}else h=cb(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(Ir(n),n):(Ir(n),null)}if(Ir(n),(n.flags&128)!==0)return n.lanes=o,n;if(o=s!==null,e=e!==null&&e.memoizedState!==null,o){s=n.child,h=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(h=s.alternate.memoizedState.cachePool.pool);var y=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==h&&(s.flags|=2048)}return o!==e&&o&&(n.child.flags|=8192),Dc(n,n.updateQueue),ut(n),null;case 4:return ge(),e===null&&Qh(n.stateNode.containerInfo),ut(n),null;case 10:return _r(n.type),ut(n),null;case 19:if(F(Mt),h=n.memoizedState,h===null)return ut(n),null;if(s=(n.flags&128)!==0,y=h.rendering,y===null)if(s)Ts(h,!1);else{if(pt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(y=Rc(e),y!==null){for(n.flags|=128,Ts(h,!1),e=y.updateQueue,n.updateQueue=e,Dc(n,e),n.subtreeFlags=0,e=o,o=n.child;o!==null;)ab(o,e),o=o.sibling;return Z(Mt,Mt.current&1|2),n.child}e=e.sibling}h.tail!==null&&ht()>Lc&&(n.flags|=128,s=!0,Ts(h,!1),n.lanes=4194304)}else{if(!s)if(e=Rc(y),e!==null){if(n.flags|=128,s=!0,e=e.updateQueue,n.updateQueue=e,Dc(n,e),Ts(h,!0),h.tail===null&&h.tailMode==="hidden"&&!y.alternate&&!Ke)return ut(n),null}else 2*ht()-h.renderingStartTime>Lc&&o!==536870912&&(n.flags|=128,s=!0,Ts(h,!1),n.lanes=4194304);h.isBackwards?(y.sibling=n.child,n.child=y):(e=h.last,e!==null?e.sibling=y:n.child=y,h.last=y)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=ht(),n.sibling=null,e=Mt.current,Z(Mt,s?e&1|2:e&1),n):(ut(n),null);case 22:case 23:return Ir(n),Wf(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(o&536870912)!==0&&(n.flags&128)===0&&(ut(n),n.subtreeFlags&6&&(n.flags|=8192)):ut(n),o=n.updateQueue,o!==null&&Dc(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&&F(Jo),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),_r(Ot),ut(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function _O(e,n){switch(Bf(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return _r(Ot),ge(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return _e(n),null;case 13:if(Ir(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));cs()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return F(Mt),null;case 4:return ge(),null;case 10:return _r(n.type),null;case 22:case 23:return Ir(n),Wf(),e!==null&&F(Jo),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return _r(Ot),null;case 25:return null;default:return null}}function _v(e,n){switch(Bf(n),n.tag){case 3:_r(Ot),ge();break;case 26:case 27:case 5:_e(n);break;case 4:ge();break;case 13:Ir(n);break;case 19:F(Mt);break;case 10:_r(n.type);break;case 22:case 23:Ir(n),Wf(),e!==null&&F(Jo);break;case 24:_r(Ot)}}function js(e,n){try{var o=n.updateQueue,s=o!==null?o.lastEffect:null;if(s!==null){var h=s.next;o=h;do{if((o.tag&e)===e){s=void 0;var y=o.create,R=o.inst;s=y(),R.destroy=s}o=o.next}while(o!==h)}}catch(I){nt(n,n.return,I)}}function fo(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 R=s.inst,I=R.destroy;if(I!==void 0){R.destroy=void 0,h=n;var V=o,J=I;try{J()}catch(oe){nt(h,V,oe)}}}s=s.next}while(s!==y)}}catch(oe){nt(n,n.return,oe)}}function Dv(e){var n=e.updateQueue;if(n!==null){var o=e.stateNode;try{vb(n,o)}catch(s){nt(e,e.return,s)}}}function Iv(e,n,o){o.props=ta(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(s){nt(e,n,s)}}function As(e,n){try{var o=e.ref;if(o!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof o=="function"?e.refCleanup=o(s):o.current=s}}catch(h){nt(e,n,h)}}function sr(e,n){var o=e.ref,s=e.refCleanup;if(o!==null)if(typeof s=="function")try{s()}catch(h){nt(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){nt(e,n,h)}else o.current=null}function kv(e){var n=e.type,o=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&s.focus();break e;case"img":o.src?s.src=o.src:o.srcSet&&(s.srcset=o.srcSet)}}catch(h){nt(e,e.return,h)}}function jh(e,n,o){try{var s=e.stateNode;JO(s,e.type,o,n),s[an]=n}catch(h){nt(e,e.return,h)}}function Lv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&vo(e.type)||e.tag===4}function Ah(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&vo(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 Rh(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=qc));else if(s!==4&&(s===27&&vo(e.type)&&(o=e.stateNode,n=null),e=e.child,e!==null))for(Rh(e,n,o),e=e.sibling;e!==null;)Rh(e,n,o),e=e.sibling}function Ic(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&&vo(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(Ic(e,n,o),e=e.sibling;e!==null;)Ic(e,n,o),e=e.sibling}function zv(e){var n=e.stateNode,o=e.memoizedProps;try{for(var s=e.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);$t(n,s,o),n[Ft]=e,n[an]=o}catch(y){nt(e,e.return,y)}}var zr=!1,bt=!1,Nh=!1,Bv=typeof WeakSet=="function"?WeakSet:Set,kt=null;function DO(e,n){if(e=e.containerInfo,Jh=Wc,e=Fx(e),Af(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 R=0,I=-1,V=-1,J=0,oe=0,se=e,te=null;t:for(;;){for(var ne;se!==o||h!==0&&se.nodeType!==3||(I=R+h),se!==y||s!==0&&se.nodeType!==3||(V=R+s),se.nodeType===3&&(R+=se.nodeValue.length),(ne=se.firstChild)!==null;)te=se,se=ne;for(;;){if(se===e)break t;if(te===o&&++J===h&&(I=R),te===y&&++oe===s&&(V=R),(ne=se.nextSibling)!==null)break;se=te,te=se.parentNode}se=ne}o=I===-1||V===-1?null:{start:I,end:V}}else o=null}o=o||{start:0,end:0}}else o=null;for(em={focusedElem:e,selectionRange:o},Wc=!1,kt=n;kt!==null;)if(n=kt,e=n.child,(n.subtreeFlags&1024)!==0&&e!==null)e.return=n,kt=e;else for(;kt!==null;){switch(n=kt,y=n.alternate,e=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&y!==null){e=void 0,o=n,h=y.memoizedProps,y=y.memoizedState,s=o.stateNode;try{var Ae=ta(o.type,h,o.elementType===o.type);e=s.getSnapshotBeforeUpdate(Ae,y),s.__reactInternalSnapshotBeforeUpdate=e}catch(we){nt(o,o.return,we)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,o=e.nodeType,o===9)rm(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":rm(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,kt=e;break}kt=n.return}}function Hv(e,n,o){var s=o.flags;switch(o.tag){case 0:case 11:case 15:ho(e,o),s&4&&js(5,o);break;case 1:if(ho(e,o),s&4)if(e=o.stateNode,n===null)try{e.componentDidMount()}catch(R){nt(o,o.return,R)}else{var h=ta(o.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(h,n,e.__reactInternalSnapshotBeforeUpdate)}catch(R){nt(o,o.return,R)}}s&64&&Dv(o),s&512&&As(o,o.return);break;case 3:if(ho(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{vb(e,n)}catch(R){nt(o,o.return,R)}}break;case 27:n===null&&s&4&&zv(o);case 26:case 5:ho(e,o),n===null&&s&4&&kv(o),s&512&&As(o,o.return);break;case 12:ho(e,o);break;case 13:ho(e,o),s&4&&$v(e,o),s&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(o=$O.bind(null,o),iM(e,o))));break;case 22:if(s=o.memoizedState!==null||zr,!s){n=n!==null&&n.memoizedState!==null||bt,h=zr;var y=bt;zr=s,(bt=n)&&!y?mo(e,o,(o.subtreeFlags&8772)!==0):ho(e,o),zr=h,bt=y}break;case 30:break;default:ho(e,o)}}function Pv(e){var n=e.alternate;n!==null&&(e.alternate=null,Pv(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&lf(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,cn=!1;function Br(e,n,o){for(o=o.child;o!==null;)Uv(e,n,o),o=o.sibling}function Uv(e,n,o){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(on,o)}catch{}switch(o.tag){case 26:bt||sr(o,n),Br(e,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:bt||sr(o,n);var s=it,h=cn;vo(o.type)&&(it=o.stateNode,cn=!1),Br(e,n,o),Ls(o.stateNode),it=s,cn=h;break;case 5:bt||sr(o,n);case 6:if(s=it,h=cn,it=null,Br(e,n,o),it=s,cn=h,it!==null)if(cn)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(o.stateNode)}catch(y){nt(o,n,y)}else try{it.removeChild(o.stateNode)}catch(y){nt(o,n,y)}break;case 18:it!==null&&(cn?(e=it,N1(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,o.stateNode),Vs(e)):N1(it,o.stateNode));break;case 4:s=it,h=cn,it=o.stateNode.containerInfo,cn=!0,Br(e,n,o),it=s,cn=h;break;case 0:case 11:case 14:case 15:bt||fo(2,o,n),bt||fo(4,o,n),Br(e,n,o);break;case 1:bt||(sr(o,n),s=o.stateNode,typeof s.componentWillUnmount=="function"&&Iv(o,n,s)),Br(e,n,o);break;case 21:Br(e,n,o);break;case 22:bt=(s=bt)||o.memoizedState!==null,Br(e,n,o),bt=s;break;default:Br(e,n,o)}}function $v(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vs(e)}catch(o){nt(n,n.return,o)}}function IO(e){switch(e.tag){case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Bv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Bv),n;default:throw Error(a(435,e.tag))}}function Oh(e,n){var o=IO(e);n.forEach(function(s){var h=GO.bind(null,e,s);o.has(s)||(o.add(s),s.then(h,h))})}function xn(e,n){var o=n.deletions;if(o!==null)for(var s=0;s<o.length;s++){var h=o[s],y=e,R=n,I=R;e:for(;I!==null;){switch(I.tag){case 27:if(vo(I.type)){it=I.stateNode,cn=!1;break e}break;case 5:it=I.stateNode,cn=!1;break e;case 3:case 4:it=I.stateNode.containerInfo,cn=!0;break e}I=I.return}if(it===null)throw Error(a(160));Uv(y,R,h),it=null,cn=!1,y=h.alternate,y!==null&&(y.return=null),h.return=null}if(n.subtreeFlags&13878)for(n=n.child;n!==null;)Gv(n,e),n=n.sibling}var Yn=null;function Gv(e,n){var o=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xn(n,e),bn(e),s&4&&(fo(3,e,e.return),js(3,e),fo(5,e,e.return));break;case 1:xn(n,e),bn(e),s&512&&(bt||o===null||sr(o,o.return)),s&64&&zr&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?s:o.concat(s))));break;case 26:var h=Yn;if(xn(n,e),bn(e),s&512&&(bt||o===null||sr(o,o.return)),s&4){var y=o!==null?o.memoizedState:null;if(s=e.memoizedState,o===null)if(s===null)if(e.stateNode===null){e:{s=e.type,o=e.memoizedProps,h=h.ownerDocument||h;t:switch(s){case"title":y=h.getElementsByTagName("title")[0],(!y||y[Zi]||y[Ft]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=h.createElement(s),h.head.insertBefore(y,h.querySelector("head > title"))),$t(y,s,o),y[Ft]=e,Dt(y),s=y;break e;case"link":var R=z1("link","href",h).get(s+(o.href||""));if(R){for(var I=0;I<R.length;I++)if(y=R[I],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)){R.splice(I,1);break t}}y=h.createElement(s),$t(y,s,o),h.head.appendChild(y);break;case"meta":if(R=z1("meta","content",h).get(s+(o.content||""))){for(I=0;I<R.length;I++)if(y=R[I],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)){R.splice(I,1);break t}}y=h.createElement(s),$t(y,s,o),h.head.appendChild(y);break;default:throw Error(a(468,s))}y[Ft]=e,Dt(y),s=y}e.stateNode=s}else B1(h,e.type,e.stateNode);else e.stateNode=L1(h,s,e.memoizedProps);else y!==s?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,s===null?B1(h,e.type,e.stateNode):L1(h,s,e.memoizedProps)):s===null&&e.stateNode!==null&&jh(e,e.memoizedProps,o.memoizedProps)}break;case 27:xn(n,e),bn(e),s&512&&(bt||o===null||sr(o,o.return)),o!==null&&s&4&&jh(e,e.memoizedProps,o.memoizedProps);break;case 5:if(xn(n,e),bn(e),s&512&&(bt||o===null||sr(o,o.return)),e.flags&32){h=e.stateNode;try{Pa(h,"")}catch(ne){nt(e,e.return,ne)}}s&4&&e.stateNode!=null&&(h=e.memoizedProps,jh(e,h,o!==null?o.memoizedProps:h)),s&1024&&(Nh=!0);break;case 6:if(xn(n,e),bn(e),s&4){if(e.stateNode===null)throw Error(a(162));s=e.memoizedProps,o=e.stateNode;try{o.nodeValue=s}catch(ne){nt(e,e.return,ne)}}break;case 3:if(Fc=null,h=Yn,Yn=Xc(n.containerInfo),xn(n,e),Yn=h,bn(e),s&4&&o!==null&&o.memoizedState.isDehydrated)try{Vs(n.containerInfo)}catch(ne){nt(e,e.return,ne)}Nh&&(Nh=!1,Vv(e));break;case 4:s=Yn,Yn=Xc(e.stateNode.containerInfo),xn(n,e),bn(e),Yn=s;break;case 12:xn(n,e),bn(e);break;case 13:xn(n,e),bn(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Lh=ht()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Oh(e,s)));break;case 22:h=e.memoizedState!==null;var V=o!==null&&o.memoizedState!==null,J=zr,oe=bt;if(zr=J||h,bt=oe||V,xn(n,e),bt=oe,zr=J,bn(e),s&8192)e:for(n=e.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(o===null||V||zr||bt||na(e)),o=null,n=e;;){if(n.tag===5||n.tag===26){if(o===null){V=o=n;try{if(y=V.stateNode,h)R=y.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{I=V.stateNode;var se=V.memoizedProps.style,te=se!=null&&se.hasOwnProperty("display")?se.display:null;I.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(ne){nt(V,V.return,ne)}}}else if(n.tag===6){if(o===null){V=n;try{V.stateNode.nodeValue=h?"":V.memoizedProps}catch(ne){nt(V,V.return,ne)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;o===n&&(o=null),n=n.return}o===n&&(o=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(o=s.retryQueue,o!==null&&(s.retryQueue=null,Oh(e,o))));break;case 19:xn(n,e),bn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Oh(e,s)));break;case 30:break;case 21:break;default:xn(n,e),bn(e)}}function bn(e){var n=e.flags;if(n&2){try{for(var o,s=e.return;s!==null;){if(Lv(s)){o=s;break}s=s.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,y=Ah(e);Ic(e,y,h);break;case 5:var R=o.stateNode;o.flags&32&&(Pa(R,""),o.flags&=-33);var I=Ah(e);Ic(e,I,R);break;case 3:case 4:var V=o.stateNode.containerInfo,J=Ah(e);Rh(e,J,V);break;default:throw Error(a(161))}}catch(oe){nt(e,e.return,oe)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Vv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Vv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function ho(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Hv(e,n.alternate,n),n=n.sibling}function na(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:fo(4,n,n.return),na(n);break;case 1:sr(n,n.return);var o=n.stateNode;typeof o.componentWillUnmount=="function"&&Iv(n,n.return,o),na(n);break;case 27:Ls(n.stateNode);case 26:case 5:sr(n,n.return),na(n);break;case 22:n.memoizedState===null&&na(n);break;case 30:na(n);break;default:na(n)}e=e.sibling}}function mo(e,n,o){for(o=o&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,h=e,y=n,R=y.flags;switch(y.tag){case 0:case 11:case 15:mo(h,y,o),js(4,y);break;case 1:if(mo(h,y,o),s=y,h=s.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(J){nt(s,s.return,J)}if(s=y,h=s.updateQueue,h!==null){var I=s.stateNode;try{var V=h.shared.hiddenCallbacks;if(V!==null)for(h.shared.hiddenCallbacks=null,h=0;h<V.length;h++)bb(V[h],I)}catch(J){nt(s,s.return,J)}}o&&R&64&&Dv(y),As(y,y.return);break;case 27:zv(y);case 26:case 5:mo(h,y,o),o&&s===null&&R&4&&kv(y),As(y,y.return);break;case 12:mo(h,y,o);break;case 13:mo(h,y,o),o&&R&4&&$v(h,y);break;case 22:y.memoizedState===null&&mo(h,y,o),As(y,y.return);break;case 30:break;default:mo(h,y,o)}n=n.sibling}}function Mh(e,n){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&fs(o))}function _h(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&fs(e))}function lr(e,n,o,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)qv(e,n,o,s),n=n.sibling}function qv(e,n,o,s){var h=n.flags;switch(n.tag){case 0:case 11:case 15:lr(e,n,o,s),h&2048&&js(9,n);break;case 1:lr(e,n,o,s);break;case 3:lr(e,n,o,s),h&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&fs(e)));break;case 12:if(h&2048){lr(e,n,o,s),e=n.stateNode;try{var y=n.memoizedProps,R=y.id,I=y.onPostCommit;typeof I=="function"&&I(R,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(V){nt(n,n.return,V)}}else lr(e,n,o,s);break;case 13:lr(e,n,o,s);break;case 23:break;case 22:y=n.stateNode,R=n.alternate,n.memoizedState!==null?y._visibility&2?lr(e,n,o,s):Rs(e,n):y._visibility&2?lr(e,n,o,s):(y._visibility|=2,ai(e,n,o,s,(n.subtreeFlags&10256)!==0)),h&2048&&Mh(R,n);break;case 24:lr(e,n,o,s),h&2048&&_h(n.alternate,n);break;default:lr(e,n,o,s)}}function ai(e,n,o,s,h){for(h=h&&(n.subtreeFlags&10256)!==0,n=n.child;n!==null;){var y=e,R=n,I=o,V=s,J=R.flags;switch(R.tag){case 0:case 11:case 15:ai(y,R,I,V,h),js(8,R);break;case 23:break;case 22:var oe=R.stateNode;R.memoizedState!==null?oe._visibility&2?ai(y,R,I,V,h):Rs(y,R):(oe._visibility|=2,ai(y,R,I,V,h)),h&&J&2048&&Mh(R.alternate,R);break;case 24:ai(y,R,I,V,h),h&&J&2048&&_h(R.alternate,R);break;default:ai(y,R,I,V,h)}n=n.sibling}}function Rs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=e,s=n,h=s.flags;switch(s.tag){case 22:Rs(o,s),h&2048&&Mh(s.alternate,s);break;case 24:Rs(o,s),h&2048&&_h(s.alternate,s);break;default:Rs(o,s)}n=n.sibling}}var Ns=8192;function ii(e){if(e.subtreeFlags&Ns)for(e=e.child;e!==null;)Yv(e),e=e.sibling}function Yv(e){switch(e.tag){case 26:ii(e),e.flags&Ns&&e.memoizedState!==null&&bM(Yn,e.memoizedState,e.memoizedProps);break;case 5:ii(e);break;case 3:case 4:var n=Yn;Yn=Xc(e.stateNode.containerInfo),ii(e),Yn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Ns,Ns=16777216,ii(e),Ns=n):ii(e));break;default:ii(e)}}function Xv(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Os(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];kt=s,Fv(s,e)}Xv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kv(e),e=e.sibling}function Kv(e){switch(e.tag){case 0:case 11:case 15:Os(e),e.flags&2048&&fo(9,e,e.return);break;case 3:Os(e);break;case 12:Os(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,kc(e)):Os(e);break;default:Os(e)}}function kc(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];kt=s,Fv(s,e)}Xv(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:fo(8,n,n.return),kc(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,kc(n));break;default:kc(n)}e=e.sibling}}function Fv(e,n){for(;kt!==null;){var o=kt;switch(o.tag){case 0:case 11:case 15:fo(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var s=o.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:fs(o.memoizedState.cache)}if(s=o.child,s!==null)s.return=o,kt=s;else e:for(o=e;kt!==null;){s=kt;var h=s.sibling,y=s.return;if(Pv(s),s===o){kt=null;break e}if(h!==null){h.return=y,kt=h;break e}kt=y}}}var kO={getCacheForType:function(e){var n=Qt(Ot),o=n.data.get(e);return o===void 0&&(o=e(),n.data.set(e,o)),o}},LO=typeof WeakMap=="function"?WeakMap:Map,Qe=0,ot=null,Pe=null,Ve=0,Ze=0,vn=null,po=!1,si=!1,Dh=!1,Hr=0,pt=0,go=0,ra=0,Ih=0,Pn=0,li=0,Ms=null,un=null,kh=!1,Lh=0,Lc=1/0,zc=null,yo=null,Ut=0,xo=null,ci=null,ui=0,zh=0,Bh=null,Qv=null,_s=0,Hh=null;function Sn(){if((Qe&2)!==0&&Ve!==0)return Ve&-Ve;if(G.T!==null){var e=Za;return e!==0?e:Yh()}return or()}function Zv(){Pn===0&&(Pn=(Ve&536870912)===0||Ke?Se():536870912);var e=Hn.current;return e!==null&&(e.flags|=32),Pn}function Cn(e,n,o){(e===ot&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(di(e,0),bo(e,Ve,Pn,!1)),Ne(e,o),((Qe&2)===0||e!==ot)&&(e===ot&&((Qe&2)===0&&(ra|=o),pt===4&&bo(e,Ve,Pn,!1)),cr(e))}function Wv(e,n,o){if((Qe&6)!==0)throw Error(a(327));var s=!o&&(n&124)===0&&(n&e.expiredLanes)===0||ce(e,n),h=s?HO(e,n):$h(e,n,!0),y=s;do{if(h===0){si&&!s&&bo(e,n,0,!1);break}else{if(o=e.current.alternate,y&&!zO(o)){h=$h(e,n,!1),y=!1;continue}if(h===2){if(y=n,e.errorRecoveryDisabledLanes&y)var R=0;else R=e.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){n=R;e:{var I=e;h=Ms;var V=I.current.memoizedState.isDehydrated;if(V&&(di(I,R).flags|=256),R=$h(I,R,!1),R!==2){if(Dh&&!V){I.errorRecoveryDisabledLanes|=y,ra|=y,h=4;break e}y=un,un=h,y!==null&&(un===null?un=y:un.push.apply(un,y))}h=R}if(y=!1,h!==2)continue}}if(h===1){di(e,0),bo(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:bo(s,n,Pn,!po);break e;case 2:un=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(h=Lh+300-ht(),10<h)){if(bo(s,n,Pn,!po),Fi(s,0,!0)!==0)break e;s.timeoutHandle=A1(Jv.bind(null,s,o,un,zc,kh,n,Pn,ra,li,po,y,2,-0,0),h);break e}Jv(s,o,un,zc,kh,n,Pn,ra,li,po,y,0,-0,0)}}break}while(!0);cr(e)}function Jv(e,n,o,s,h,y,R,I,V,J,oe,se,te,ne){if(e.timeoutHandle=-1,se=n.subtreeFlags,(se&8192||(se&16785408)===16785408)&&(Hs={stylesheets:null,count:0,unsuspend:xM},Yv(n),se=vM(),se!==null)){e.cancelPendingCommit=se(i1.bind(null,e,n,y,o,s,h,R,I,V,oe,1,te,ne)),bo(e,y,R,!J);return}i1(e,n,y,o,s,h,R,I,V)}function zO(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(!gn(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 bo(e,n,o,s){n&=~Ih,n&=~ra,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var h=n;0<h;){var y=31-Ht(h),R=1<<y;s[y]=-1,h&=~R}o!==0&&pn(e,o,n)}function Bc(){return(Qe&6)===0?(Ds(0),!1):!0}function Ph(){if(Pe!==null){if(Ze===0)var e=Pe.return;else e=Pe,Mr=Zo=null,rh(e),ri=null,ws=0,e=Pe;for(;e!==null;)_v(e.alternate,e),e=e.return;Pe=null}}function di(e,n){var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,tM(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),Ph(),ot=e,Pe=o=Rr(e.current,null),Ve=n,Ze=0,vn=null,po=!1,si=ce(e,n),Dh=!1,li=Pn=Ih=ra=go=pt=0,un=Ms=null,kh=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var h=31-Ht(s),y=1<<h;n|=e[h],s&=~y}return Hr=n,ic(),o}function e1(e,n){Le=null,G.H=Tc,n===ms||n===pc?(n=yb(),Ze=3):n===mb?(n=yb(),Ze=4):Ze=n===xv?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,vn=n,Pe===null&&(pt=1,Oc(e,kn(n,e.current)))}function t1(){var e=G.H;return G.H=Tc,e===null?Tc:e}function n1(){var e=G.A;return G.A=kO,e}function Uh(){pt=4,po||(Ve&4194048)!==Ve&&Hn.current!==null||(si=!0),(go&134217727)===0&&(ra&134217727)===0||ot===null||bo(ot,Ve,Pn,!1)}function $h(e,n,o){var s=Qe;Qe|=2;var h=t1(),y=n1();(ot!==e||Ve!==n)&&(zc=null,di(e,n)),n=!1;var R=pt;e:do try{if(Ze!==0&&Pe!==null){var I=Pe,V=vn;switch(Ze){case 8:Ph(),R=6;break e;case 3:case 2:case 9:case 6:Hn.current===null&&(n=!0);var J=Ze;if(Ze=0,vn=null,fi(e,I,V,J),o&&si){R=0;break e}break;default:J=Ze,Ze=0,vn=null,fi(e,I,V,J)}}BO(),R=pt;break}catch(oe){e1(e,oe)}while(!0);return n&&e.shellSuspendCounter++,Mr=Zo=null,Qe=s,G.H=h,G.A=y,Pe===null&&(ot=null,Ve=0,ic()),R}function BO(){for(;Pe!==null;)r1(Pe)}function HO(e,n){var o=Qe;Qe|=2;var s=t1(),h=n1();ot!==e||Ve!==n?(zc=null,Lc=ht()+500,di(e,n)):si=ce(e,n);e:do try{if(Ze!==0&&Pe!==null){n=Pe;var y=vn;t:switch(Ze){case 1:Ze=0,vn=null,fi(e,n,y,1);break;case 2:case 9:if(pb(y)){Ze=0,vn=null,o1(n);break}n=function(){Ze!==2&&Ze!==9||ot!==e||(Ze=7),cr(e)},y.then(n,n);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:pb(y)?(Ze=0,vn=null,o1(n)):(Ze=0,vn=null,fi(e,n,y,7));break;case 5:var R=null;switch(Pe.tag){case 26:R=Pe.memoizedState;case 5:case 27:var I=Pe;if(!R||H1(R)){Ze=0,vn=null;var V=I.sibling;if(V!==null)Pe=V;else{var J=I.return;J!==null?(Pe=J,Hc(J)):Pe=null}break t}}Ze=0,vn=null,fi(e,n,y,5);break;case 6:Ze=0,vn=null,fi(e,n,y,6);break;case 8:Ph(),pt=6;break e;default:throw Error(a(462))}}PO();break}catch(oe){e1(e,oe)}while(!0);return Mr=Zo=null,G.H=s,G.A=h,Qe=o,Pe!==null?0:(ot=null,Ve=0,ic(),pt)}function PO(){for(;Pe!==null&&!Te();)r1(Pe)}function r1(e){var n=Ov(e.alternate,e,Hr);e.memoizedProps=e.pendingProps,n===null?Hc(e):Pe=n}function o1(e){var n=e,o=n.alternate;switch(n.tag){case 15:case 0:n=Ev(o,n,n.pendingProps,n.type,void 0,Ve);break;case 11:n=Ev(o,n,n.pendingProps,n.type.render,n.ref,Ve);break;case 5:rh(n);default:_v(o,n),n=Pe=ab(n,Hr),n=Ov(o,n,Hr)}e.memoizedProps=e.pendingProps,n===null?Hc(e):Pe=n}function fi(e,n,o,s){Mr=Zo=null,rh(n),ri=null,ws=0;var h=n.return;try{if(NO(e,h,n,o,Ve)){pt=1,Oc(e,kn(o,e.current)),Pe=null;return}}catch(y){if(h!==null)throw Pe=h,y;pt=1,Oc(e,kn(o,e.current)),Pe=null;return}n.flags&32768?(Ke||s===1?e=!0:si||(Ve&536870912)!==0?e=!1:(po=e=!0,(s===2||s===9||s===3||s===6)&&(s=Hn.current,s!==null&&s.tag===13&&(s.flags|=16384))),a1(n,e)):Hc(n)}function Hc(e){var n=e;do{if((n.flags&32768)!==0){a1(n,po);return}e=n.return;var o=MO(n.alternate,n,Hr);if(o!==null){Pe=o;return}if(n=n.sibling,n!==null){Pe=n;return}Pe=n=e}while(n!==null);pt===0&&(pt=5)}function a1(e,n){do{var o=_O(e.alternate,e);if(o!==null){o.flags&=32767,Pe=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=o}while(e!==null);pt=6,Pe=null}function i1(e,n,o,s,h,y,R,I,V){e.cancelPendingCommit=null;do Pc();while(Ut!==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|=_f,Jt(e,o,y,R,I,V),e===ot&&(Pe=ot=null,Ve=0),ci=n,xo=e,ui=o,zh=y,Bh=h,Qv=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,VO(Fe,function(){return d1(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=G.T,G.T=null,h=q.p,q.p=2,R=Qe,Qe|=4;try{DO(e,n,o)}finally{Qe=R,q.p=h,G.T=s}}Ut=1,s1(),l1(),c1()}}function s1(){if(Ut===1){Ut=0;var e=xo,n=ci,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=G.T,G.T=null;var s=q.p;q.p=2;var h=Qe;Qe|=4;try{Gv(n,e);var y=em,R=Fx(e.containerInfo),I=y.focusedElem,V=y.selectionRange;if(R!==I&&I&&I.ownerDocument&&Kx(I.ownerDocument.documentElement,I)){if(V!==null&&Af(I)){var J=V.start,oe=V.end;if(oe===void 0&&(oe=J),"selectionStart"in I)I.selectionStart=J,I.selectionEnd=Math.min(oe,I.value.length);else{var se=I.ownerDocument||document,te=se&&se.defaultView||window;if(te.getSelection){var ne=te.getSelection(),Ae=I.textContent.length,we=Math.min(V.start,Ae),et=V.end===void 0?we:Math.min(V.end,Ae);!ne.extend&&we>et&&(R=et,et=we,we=R);var Q=Xx(I,we),X=Xx(I,et);if(Q&&X&&(ne.rangeCount!==1||ne.anchorNode!==Q.node||ne.anchorOffset!==Q.offset||ne.focusNode!==X.node||ne.focusOffset!==X.offset)){var W=se.createRange();W.setStart(Q.node,Q.offset),ne.removeAllRanges(),we>et?(ne.addRange(W),ne.extend(X.node,X.offset)):(W.setEnd(X.node,X.offset),ne.addRange(W))}}}}for(se=[],ne=I;ne=ne.parentNode;)ne.nodeType===1&&se.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<se.length;I++){var ie=se[I];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Wc=!!Jh,em=Jh=null}finally{Qe=h,q.p=s,G.T=o}}e.current=n,Ut=2}}function l1(){if(Ut===2){Ut=0;var e=xo,n=ci,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=G.T,G.T=null;var s=q.p;q.p=2;var h=Qe;Qe|=4;try{Hv(e,n.alternate,n)}finally{Qe=h,q.p=s,G.T=o}}Ut=3}}function c1(){if(Ut===4||Ut===3){Ut=0,At();var e=xo,n=ci,o=ui,s=Qv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ut=5:(Ut=0,ci=xo=null,u1(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(yo=null),Tr(o),n=n.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(on,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=G.T,h=q.p,q.p=2,G.T=null;try{for(var y=e.onRecoverableError,R=0;R<s.length;R++){var I=s[R];y(I.value,{componentStack:I.stack})}}finally{G.T=n,q.p=h}}(ui&3)!==0&&Pc(),cr(e),h=e.pendingLanes,(o&4194090)!==0&&(h&42)!==0?e===Hh?_s++:(_s=0,Hh=e):_s=0,Ds(0)}}function u1(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,fs(n)))}function Pc(e){return s1(),l1(),c1(),d1()}function d1(){if(Ut!==5)return!1;var e=xo,n=zh;zh=0;var o=Tr(ui),s=G.T,h=q.p;try{q.p=32>o?32:o,G.T=null,o=Bh,Bh=null;var y=xo,R=ui;if(Ut=0,ci=xo=null,ui=0,(Qe&6)!==0)throw Error(a(331));var I=Qe;if(Qe|=4,Kv(y.current),qv(y,y.current,R,o),Qe=I,Ds(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(on,y)}catch{}return!0}finally{q.p=h,G.T=s,u1(e,n)}}function f1(e,n,o){n=kn(o,n),n=yh(e.stateNode,n,2),e=so(e,n,2),e!==null&&(Ne(e,2),cr(e))}function nt(e,n,o){if(e.tag===3)f1(e,e,o);else for(;n!==null;){if(n.tag===3){f1(n,e,o);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(yo===null||!yo.has(s))){e=kn(o,e),o=gv(2),s=so(n,o,2),s!==null&&(yv(o,s,n,e),Ne(s,2),cr(s));break}}n=n.return}}function Gh(e,n,o){var s=e.pingCache;if(s===null){s=e.pingCache=new LO;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)||(Dh=!0,h.add(o),e=UO.bind(null,e,n,o),n.then(e,e))}function UO(e,n,o){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,ot===e&&(Ve&o)===o&&(pt===4||pt===3&&(Ve&62914560)===Ve&&300>ht()-Lh?(Qe&2)===0&&di(e,0):Ih|=o,li===Ve&&(li=0)),cr(e)}function h1(e,n){n===0&&(n=tt()),e=Xa(e,n),e!==null&&(Ne(e,n),cr(e))}function $O(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),h1(e,o)}function GO(e,n){var o=0;switch(e.tag){case 13:var s=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),h1(e,o)}function VO(e,n){return Ee(e,n)}var Uc=null,hi=null,Vh=!1,$c=!1,qh=!1,oa=0;function cr(e){e!==hi&&e.next===null&&(hi===null?Uc=hi=e:hi=hi.next=e),$c=!0,Vh||(Vh=!0,YO())}function Ds(e,n){if(!qh&&$c){qh=!0;do for(var o=!1,s=Uc;s!==null;){if(e!==0){var h=s.pendingLanes;if(h===0)var y=0;else{var R=s.suspendedLanes,I=s.pingedLanes;y=(1<<31-Ht(42|e)+1)-1,y&=h&~(R&~I),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,y1(s,y))}else y=Ve,y=Fi(s,s===ot?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(y&3)===0||ce(s,y)||(o=!0,y1(s,y));s=s.next}while(o);qh=!1}}function qO(){m1()}function m1(){$c=Vh=!1;var e=0;oa!==0&&(eM()&&(e=oa),oa=0);for(var n=ht(),o=null,s=Uc;s!==null;){var h=s.next,y=p1(s,n);y===0?(s.next=null,o===null?Uc=h:o.next=h,h===null&&(hi=o)):(o=s,(e!==0||(y&3)!==0)&&($c=!0)),s=h}Ds(e)}function p1(e,n){for(var o=e.suspendedLanes,s=e.pingedLanes,h=e.expirationTimes,y=e.pendingLanes&-62914561;0<y;){var R=31-Ht(y),I=1<<R,V=h[R];V===-1?((I&o)===0||(I&s)!==0)&&(h[R]=Re(I,n)):V<=n&&(e.expiredLanes|=I),y&=~I}if(n=ot,o=Ve,o=Fi(e,e===n?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,o===0||e===n&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&ve(s),e.callbackNode=null,e.callbackPriority=0;if((o&3)===0||ce(e,o)){if(n=o&-o,n===e.callbackPriority)return n;switch(s!==null&&ve(s),Tr(o)){case 2:case 8:o=yt;break;case 32:o=Fe;break;case 268435456:o=Mn;break;default:o=Fe}return s=g1.bind(null,e),o=Ee(o,s),e.callbackPriority=n,e.callbackNode=o,n}return s!==null&&s!==null&&ve(s),e.callbackPriority=2,e.callbackNode=null,2}function g1(e,n){if(Ut!==0&&Ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var o=e.callbackNode;if(Pc()&&e.callbackNode!==o)return null;var s=Ve;return s=Fi(e,e===ot?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Wv(e,s,n),p1(e,ht()),e.callbackNode!=null&&e.callbackNode===o?g1.bind(null,e):null)}function y1(e,n){if(Pc())return null;Wv(e,n,!0)}function YO(){nM(function(){(Qe&6)!==0?Ee(pe,qO):m1()})}function Yh(){return oa===0&&(oa=Se()),oa}function x1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jl(""+e)}function b1(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 XO(e,n,o,s,h){if(n==="submit"&&o&&o.stateNode===h){var y=x1((h[an]||null).action),R=s.submitter;R&&(n=(n=R[an]||null)?x1(n.formAction):R.getAttribute("formAction"),n!==null&&(y=n,R=null));var I=new rc("action","action",null,s,h);e.push({event:I,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(oa!==0){var V=R?b1(h,R):new FormData(h);fh(o,{pending:!0,data:V,method:h.method,action:y},null,V)}}else typeof y=="function"&&(I.preventDefault(),V=R?b1(h,R):new FormData(h),fh(o,{pending:!0,data:V,method:h.method,action:y},y,V))},currentTarget:h}]})}}for(var Xh=0;Xh<Mf.length;Xh++){var Kh=Mf[Xh],KO=Kh.toLowerCase(),FO=Kh[0].toUpperCase()+Kh.slice(1);qn(KO,"on"+FO)}qn(Wx,"onAnimationEnd"),qn(Jx,"onAnimationIteration"),qn(eb,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(fO,"onTransitionRun"),qn(hO,"onTransitionStart"),qn(mO,"onTransitionCancel"),qn(tb,"onTransitionEnd"),za("onMouseEnter",["mouseout","mouseover"]),za("onMouseLeave",["mouseout","mouseover"]),za("onPointerEnter",["pointerout","pointerover"]),za("onPointerLeave",["pointerout","pointerover"]),$o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$o("onBeforeInput",["compositionend","keypress","textInput","paste"]),$o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Is="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),QO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Is));function v1(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var s=e[o],h=s.event;s=s.listeners;e:{var y=void 0;if(n)for(var R=s.length-1;0<=R;R--){var I=s[R],V=I.instance,J=I.currentTarget;if(I=I.listener,V!==y&&h.isPropagationStopped())break e;y=I,h.currentTarget=J;try{y(h)}catch(oe){Nc(oe)}h.currentTarget=null,y=V}else for(R=0;R<s.length;R++){if(I=s[R],V=I.instance,J=I.currentTarget,I=I.listener,V!==y&&h.isPropagationStopped())break e;y=I,h.currentTarget=J;try{y(h)}catch(oe){Nc(oe)}h.currentTarget=null,y=V}}}}function Ue(e,n){var o=n[sf];o===void 0&&(o=n[sf]=new Set);var s=e+"__bubble";o.has(s)||(S1(n,e,2,!1),o.add(s))}function Fh(e,n,o){var s=0;n&&(s|=4),S1(o,e,s,n)}var Gc="_reactListening"+Math.random().toString(36).slice(2);function Qh(e){if(!e[Gc]){e[Gc]=!0,mx.forEach(function(o){o!=="selectionchange"&&(QO.has(o)||Fh(o,!1,e),Fh(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Gc]||(n[Gc]=!0,Fh("selectionchange",!1,n))}}function S1(e,n,o,s){switch(q1(n)){case 2:var h=wM;break;case 8:h=EM;break;default:h=um}o=h.bind(null,n,o,e),h=void 0,!xf||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),s?h!==void 0?e.addEventListener(n,o,{capture:!0,passive:h}):e.addEventListener(n,o,!0):h!==void 0?e.addEventListener(n,o,{passive:h}):e.addEventListener(n,o,!1)}function Zh(e,n,o,s,h){var y=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var R=s.tag;if(R===3||R===4){var I=s.stateNode.containerInfo;if(I===h)break;if(R===4)for(R=s.return;R!==null;){var V=R.tag;if((V===3||V===4)&&R.stateNode.containerInfo===h)return;R=R.return}for(;I!==null;){if(R=Ia(I),R===null)return;if(V=R.tag,V===5||V===6||V===26||V===27){s=y=R;continue e}I=I.parentNode}}s=s.return}Rx(function(){var J=y,oe=gf(o),se=[];e:{var te=nb.get(e);if(te!==void 0){var ne=rc,Ae=e;switch(e){case"keypress":if(tc(o)===0)break e;case"keydown":case"keyup":ne=VN;break;case"focusin":Ae="focus",ne=Cf;break;case"focusout":Ae="blur",ne=Cf;break;case"beforeblur":case"afterblur":ne=Cf;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=Mx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=_N;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=XN;break;case Wx:case Jx:case eb:ne=kN;break;case tb:ne=FN;break;case"scroll":case"scrollend":ne=ON;break;case"wheel":ne=ZN;break;case"copy":case"cut":case"paste":ne=zN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Dx;break;case"toggle":case"beforetoggle":ne=JN}var we=(n&4)!==0,et=!we&&(e==="scroll"||e==="scrollend"),Q=we?te!==null?te+"Capture":null:te;we=[];for(var X=J,W;X!==null;){var ie=X;if(W=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||W===null||Q===null||(ie=Ji(X,Q),ie!=null&&we.push(ks(X,ie,W))),et)break;X=X.return}0<we.length&&(te=new ne(te,Ae,null,o,oe),se.push({event:te,listeners:we}))}}if((n&7)===0){e:{if(te=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",te&&o!==pf&&(Ae=o.relatedTarget||o.fromElement)&&(Ia(Ae)||Ae[Da]))break e;if((ne||te)&&(te=oe.window===oe?oe:(te=oe.ownerDocument)?te.defaultView||te.parentWindow:window,ne?(Ae=o.relatedTarget||o.toElement,ne=J,Ae=Ae?Ia(Ae):null,Ae!==null&&(et=l(Ae),we=Ae.tag,Ae!==et||we!==5&&we!==27&&we!==6)&&(Ae=null)):(ne=null,Ae=J),ne!==Ae)){if(we=Mx,ie="onMouseLeave",Q="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&(we=Dx,ie="onPointerLeave",Q="onPointerEnter",X="pointer"),et=ne==null?te:Wi(ne),W=Ae==null?te:Wi(Ae),te=new we(ie,X+"leave",ne,o,oe),te.target=et,te.relatedTarget=W,ie=null,Ia(oe)===J&&(we=new we(Q,X+"enter",Ae,o,oe),we.target=W,we.relatedTarget=et,ie=we),et=ie,ne&&Ae)t:{for(we=ne,Q=Ae,X=0,W=we;W;W=mi(W))X++;for(W=0,ie=Q;ie;ie=mi(ie))W++;for(;0<X-W;)we=mi(we),X--;for(;0<W-X;)Q=mi(Q),W--;for(;X--;){if(we===Q||Q!==null&&we===Q.alternate)break t;we=mi(we),Q=mi(Q)}we=null}else we=null;ne!==null&&C1(se,te,ne,we,!1),Ae!==null&&et!==null&&C1(se,et,Ae,we,!0)}}e:{if(te=J?Wi(J):window,ne=te.nodeName&&te.nodeName.toLowerCase(),ne==="select"||ne==="input"&&te.type==="file")var me=Ux;else if(Hx(te))if($x)me=cO;else{me=sO;var ze=iO}else ne=te.nodeName,!ne||ne.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?J&&mf(J.elementType)&&(me=Ux):me=lO;if(me&&(me=me(e,J))){Px(se,me,o,oe);break e}ze&&ze(e,te,J),e==="focusout"&&J&&te.type==="number"&&J.memoizedProps.value!=null&&hf(te,"number",te.value)}switch(ze=J?Wi(J):window,e){case"focusin":(Hx(ze)||ze.contentEditable==="true")&&(Va=ze,Rf=J,ss=null);break;case"focusout":ss=Rf=Va=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,Qx(se,o,oe);break;case"selectionchange":if(dO)break;case"keydown":case"keyup":Qx(se,o,oe)}var xe;if(Ef)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 Ga?zx(e,o)&&(je="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(je="onCompositionStart");je&&(Ix&&o.locale!=="ko"&&(Ga||je!=="onCompositionStart"?je==="onCompositionEnd"&&Ga&&(xe=Nx()):(ro=oe,bf="value"in ro?ro.value:ro.textContent,Ga=!0)),ze=Vc(J,je),0<ze.length&&(je=new _x(je,e,null,o,oe),se.push({event:je,listeners:ze}),xe?je.data=xe:(xe=Bx(o),xe!==null&&(je.data=xe)))),(xe=tO?nO(e,o):rO(e,o))&&(je=Vc(J,"onBeforeInput"),0<je.length&&(ze=new _x("onBeforeInput","beforeinput",null,o,oe),se.push({event:ze,listeners:je}),ze.data=xe)),XO(se,e,J,o,oe)}v1(se,n)})}function ks(e,n,o){return{instance:e,listener:n,currentTarget:o}}function Vc(e,n){for(var o=n+"Capture",s=[];e!==null;){var h=e,y=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||y===null||(h=Ji(e,o),h!=null&&s.unshift(ks(e,h,y)),h=Ji(e,n),h!=null&&s.push(ks(e,h,y))),e.tag===3)return s;e=e.return}return[]}function mi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function C1(e,n,o,s,h){for(var y=n._reactName,R=[];o!==null&&o!==s;){var I=o,V=I.alternate,J=I.stateNode;if(I=I.tag,V!==null&&V===s)break;I!==5&&I!==26&&I!==27||J===null||(V=J,h?(J=Ji(o,y),J!=null&&R.unshift(ks(o,J,V))):h||(J=Ji(o,y),J!=null&&R.push(ks(o,J,V)))),o=o.return}R.length!==0&&e.push({event:n,listeners:R})}var ZO=/\r\n?/g,WO=/\u0000|\uFFFD/g;function w1(e){return(typeof e=="string"?e:""+e).replace(ZO,`
|
|
51
|
+
`).replace(WO,"")}function E1(e,n){return n=w1(n),w1(e)===n}function qc(){}function Je(e,n,o,s,h,y){switch(o){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||Pa(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&Pa(e,""+s);break;case"className":Ql(e,"class",s);break;case"tabIndex":Ql(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Ql(e,o,s);break;case"style":jx(e,s,y);break;case"data":if(n!=="object"){Ql(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=Jl(""+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=Jl(""+s),e.setAttribute(o,s);break;case"onClick":s!=null&&(e.onclick=qc);break;case"onScroll":s!=null&&Ue("scroll",e);break;case"onScrollEnd":s!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}o=Jl(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""+s):e.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":s===!0?e.setAttribute(o,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(o,s):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(o,s):e.removeAttribute(o);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(o):e.setAttribute(o,s);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),Fl(e,"popover",s);break;case"xlinkActuate":jr(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":jr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":jr(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":jr(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":jr(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":jr(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":jr(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":jr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":jr(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Fl(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=RN.get(o)||o,Fl(e,o,s))}}function Wh(e,n,o,s,h,y){switch(o){case"style":jx(e,s,y);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(o=s.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"children":typeof s=="string"?Pa(e,s):(typeof s=="number"||typeof s=="bigint")&&Pa(e,""+s);break;case"onScroll":s!=null&&Ue("scroll",e);break;case"onScrollEnd":s!=null&&Ue("scrollend",e);break;case"onClick":s!=null&&(e.onclick=qc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!px.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[an]||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,""):Fl(e,o,s)}}}function $t(e,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var s=!1,h=!1,y;for(y in o)if(o.hasOwnProperty(y)){var R=o[y];if(R!=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,R,o,null)}}h&&Je(e,n,"srcSet",o.srcSet,o,null),s&&Je(e,n,"src",o.src,o,null);return;case"input":Ue("invalid",e);var I=y=R=h=null,V=null,J=null;for(s in o)if(o.hasOwnProperty(s)){var oe=o[s];if(oe!=null)switch(s){case"name":h=oe;break;case"type":R=oe;break;case"checked":V=oe;break;case"defaultChecked":J=oe;break;case"value":y=oe;break;case"defaultValue":I=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,n));break;default:Je(e,n,s,oe,o,null)}}Cx(e,y,I,V,J,R,h,!1),Zl(e);return;case"select":Ue("invalid",e),s=R=y=null;for(h in o)if(o.hasOwnProperty(h)&&(I=o[h],I!=null))switch(h){case"value":y=I;break;case"defaultValue":R=I;break;case"multiple":s=I;default:Je(e,n,h,I,o,null)}n=y,o=R,e.multiple=!!s,n!=null?Ha(e,!!s,n,!1):o!=null&&Ha(e,!!s,o,!0);return;case"textarea":Ue("invalid",e),y=h=s=null;for(R in o)if(o.hasOwnProperty(R)&&(I=o[R],I!=null))switch(R){case"value":s=I;break;case"defaultValue":h=I;break;case"children":y=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(a(91));break;default:Je(e,n,R,I,o,null)}Ex(e,s,h,y),Zl(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":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(s=0;s<Is.length;s++)Ue(Is[s],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in o)if(o.hasOwnProperty(J)&&(s=o[J],s!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Je(e,n,J,s,o,null)}return;default:if(mf(n)){for(oe in o)o.hasOwnProperty(oe)&&(s=o[oe],s!==void 0&&Wh(e,n,oe,s,o,void 0));return}}for(I in o)o.hasOwnProperty(I)&&(s=o[I],s!=null&&Je(e,n,I,s,o,null))}function JO(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,R=null,I=null,V=null,J=null,oe=null;for(ne in o){var se=o[ne];if(o.hasOwnProperty(ne)&&se!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":V=se;default:s.hasOwnProperty(ne)||Je(e,n,ne,null,s,se)}}for(var te in s){var ne=s[te];if(se=o[te],s.hasOwnProperty(te)&&(ne!=null||se!=null))switch(te){case"type":y=ne;break;case"name":h=ne;break;case"checked":J=ne;break;case"defaultChecked":oe=ne;break;case"value":R=ne;break;case"defaultValue":I=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,n));break;default:ne!==se&&Je(e,n,te,ne,s,se)}}ff(e,R,I,V,J,oe,y,h);return;case"select":ne=R=I=te=null;for(y in o)if(V=o[y],o.hasOwnProperty(y)&&V!=null)switch(y){case"value":break;case"multiple":ne=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":te=y;break;case"defaultValue":I=y;break;case"multiple":R=y;default:y!==V&&Je(e,n,h,y,s,V)}n=I,o=R,s=ne,te!=null?Ha(e,!!o,te,!1):!!s!=!!o&&(n!=null?Ha(e,!!o,n,!0):Ha(e,!!o,o?[]:"",!1));return;case"textarea":ne=te=null;for(I in o)if(h=o[I],o.hasOwnProperty(I)&&h!=null&&!s.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:Je(e,n,I,null,s,h)}for(R in s)if(h=s[R],y=o[R],s.hasOwnProperty(R)&&(h!=null||y!=null))switch(R){case"value":te=h;break;case"defaultValue":ne=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==y&&Je(e,n,R,h,s,y)}wx(e,te,ne);return;case"option":for(var Ae in o)if(te=o[Ae],o.hasOwnProperty(Ae)&&te!=null&&!s.hasOwnProperty(Ae))switch(Ae){case"selected":e.selected=!1;break;default:Je(e,n,Ae,null,s,te)}for(V in s)if(te=s[V],ne=o[V],s.hasOwnProperty(V)&&te!==ne&&(te!=null||ne!=null))switch(V){case"selected":e.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Je(e,n,V,te,s,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in o)te=o[we],o.hasOwnProperty(we)&&te!=null&&!s.hasOwnProperty(we)&&Je(e,n,we,null,s,te);for(J in s)if(te=s[J],ne=o[J],s.hasOwnProperty(J)&&te!==ne&&(te!=null||ne!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,n));break;default:Je(e,n,J,te,s,ne)}return;default:if(mf(n)){for(var et in o)te=o[et],o.hasOwnProperty(et)&&te!==void 0&&!s.hasOwnProperty(et)&&Wh(e,n,et,void 0,s,te);for(oe in s)te=s[oe],ne=o[oe],!s.hasOwnProperty(oe)||te===ne||te===void 0&&ne===void 0||Wh(e,n,oe,te,s,ne);return}}for(var Q in o)te=o[Q],o.hasOwnProperty(Q)&&te!=null&&!s.hasOwnProperty(Q)&&Je(e,n,Q,null,s,te);for(se in s)te=s[se],ne=o[se],!s.hasOwnProperty(se)||te===ne||te==null&&ne==null||Je(e,n,se,te,s,ne)}var Jh=null,em=null;function Yc(e){return e.nodeType===9?e:e.ownerDocument}function T1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function j1(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function tm(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 nm=null;function eM(){var e=window.event;return e&&e.type==="popstate"?e===nm?!1:(nm=e,!0):(nm=null,!1)}var A1=typeof setTimeout=="function"?setTimeout:void 0,tM=typeof clearTimeout=="function"?clearTimeout:void 0,R1=typeof Promise=="function"?Promise:void 0,nM=typeof queueMicrotask=="function"?queueMicrotask:typeof R1<"u"?function(e){return R1.resolve(null).then(e).catch(rM)}:A1;function rM(e){setTimeout(function(){throw e})}function vo(e){return e==="head"}function N1(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 R=e.ownerDocument;if(o&1&&Ls(R.documentElement),o&2&&Ls(R.body),o&4)for(o=R.head,Ls(o),R=o.firstChild;R;){var I=R.nextSibling,V=R.nodeName;R[Zi]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&R.rel.toLowerCase()==="stylesheet"||o.removeChild(R),R=I}}if(h===0){e.removeChild(y),Vs(n);return}h--}else o==="$"||o==="$?"||o==="$!"?h++:s=o.charCodeAt(0)-48;else s=0;o=y}while(o);Vs(n)}function rm(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":rm(o),lf(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function oM(e,n,o,s){for(;e.nodeType===1;){var h=o;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Zi])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(y=e.getAttribute("rel"),y==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(y!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(y=e.getAttribute("src"),(y!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&y&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var y=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===y)return e}else return e;if(e=Xn(e.nextSibling),e===null)break}return null}function aM(e,n,o){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o||(e=Xn(e.nextSibling),e===null))return null;return e}function om(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function iM(e,n){var o=e.ownerDocument;if(e.data!=="$?"||o.readyState==="complete")n();else{var s=function(){n(),o.removeEventListener("DOMContentLoaded",s)};o.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Xn(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 am=null;function O1(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}function M1(e,n,o){switch(n=Yc(o),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Ls(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);lf(e)}var Un=new Map,_1=new Set;function Xc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pr=q.d;q.d={f:sM,r:lM,D:cM,C:uM,L:dM,m:fM,X:mM,S:hM,M:pM};function sM(){var e=Pr.f(),n=Bc();return e||n}function lM(e){var n=ka(e);n!==null&&n.tag===5&&n.type==="form"?Wb(n):Pr.r(e)}var pi=typeof document>"u"?null:document;function D1(e,n,o){var s=pi;if(s&&typeof n=="string"&&n){var h=In(n);h='link[rel="'+e+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),_1.has(h)||(_1.add(h),e={rel:e,crossOrigin:o,href:n},s.querySelector(h)===null&&(n=s.createElement("link"),$t(n,"link",e),Dt(n),s.head.appendChild(n)))}}function cM(e){Pr.D(e),D1("dns-prefetch",e,null)}function uM(e,n){Pr.C(e,n),D1("preconnect",e,n)}function dM(e,n,o){Pr.L(e,n,o);var s=pi;if(s&&e&&n){var h='link[rel="preload"][as="'+In(n)+'"]';n==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+In(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+In(o.imageSizes)+'"]')):h+='[href="'+In(e)+'"]';var y=h;switch(n){case"style":y=gi(e);break;case"script":y=yi(e)}Un.has(y)||(e=C({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:e,as:n},o),Un.set(y,e),s.querySelector(h)!==null||n==="style"&&s.querySelector(zs(y))||n==="script"&&s.querySelector(Bs(y))||(n=s.createElement("link"),$t(n,"link",e),Dt(n),s.head.appendChild(n)))}}function fM(e,n){Pr.m(e,n);var o=pi;if(o&&e){var s=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+In(s)+'"][href="'+In(e)+'"]',y=h;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=yi(e)}if(!Un.has(y)&&(e=C({rel:"modulepreload",href:e},n),Un.set(y,e),o.querySelector(h)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Bs(y)))return}s=o.createElement("link"),$t(s,"link",e),Dt(s),o.head.appendChild(s)}}}function hM(e,n,o){Pr.S(e,n,o);var s=pi;if(s&&e){var h=La(s).hoistableStyles,y=gi(e);n=n||"default";var R=h.get(y);if(!R){var I={loading:0,preload:null};if(R=s.querySelector(zs(y)))I.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":n},o),(o=Un.get(y))&&im(e,o);var V=R=s.createElement("link");Dt(V),$t(V,"link",e),V._p=new Promise(function(J,oe){V.onload=J,V.onerror=oe}),V.addEventListener("load",function(){I.loading|=1}),V.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Kc(R,n,s)}R={type:"stylesheet",instance:R,count:1,state:I},h.set(y,R)}}}function mM(e,n){Pr.X(e,n);var o=pi;if(o&&e){var s=La(o).hoistableScripts,h=yi(e),y=s.get(h);y||(y=o.querySelector(Bs(h)),y||(e=C({src:e,async:!0},n),(n=Un.get(h))&&sm(e,n),y=o.createElement("script"),Dt(y),$t(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function pM(e,n){Pr.M(e,n);var o=pi;if(o&&e){var s=La(o).hoistableScripts,h=yi(e),y=s.get(h);y||(y=o.querySelector(Bs(h)),y||(e=C({src:e,async:!0,type:"module"},n),(n=Un.get(h))&&sm(e,n),y=o.createElement("script"),Dt(y),$t(y,"link",e),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(h,y))}}function I1(e,n,o,s){var h=(h=ae.current)?Xc(h):null;if(!h)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(n=gi(o.href),o=La(h).hoistableStyles,s=o.get(n),s||(s={type:"style",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=gi(o.href);var y=La(h).hoistableStyles,R=y.get(e);if(R||(h=h.ownerDocument||h,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(e,R),(y=h.querySelector(zs(e)))&&!y._p&&(R.instance=y,R.state.loading=5),Un.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},Un.set(e,o),y||gM(h,e,o,R.state))),n&&s===null)throw Error(a(528,""));return R}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=yi(o),o=La(h).hoistableScripts,s=o.get(n),s||(s={type:"script",instance:null,count:0,state:null},o.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function gi(e){return'href="'+In(e)+'"'}function zs(e){return'link[rel="stylesheet"]['+e+"]"}function k1(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function gM(e,n,o,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),$t(n,"link",o),Dt(n),e.head.appendChild(n))}function yi(e){return'[src="'+In(e)+'"]'}function Bs(e){return"script[async]"+e}function L1(e,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+In(o.href)+'"]');if(s)return n.instance=s,Dt(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"),Dt(s),$t(s,"style",h),Kc(s,o.precedence,e),n.instance=s;case"stylesheet":h=gi(o.href);var y=e.querySelector(zs(h));if(y)return n.state.loading|=4,n.instance=y,Dt(y),y;s=k1(o),(h=Un.get(h))&&im(s,h),y=(e.ownerDocument||e).createElement("link"),Dt(y);var R=y;return R._p=new Promise(function(I,V){R.onload=I,R.onerror=V}),$t(y,"link",s),n.state.loading|=4,Kc(y,o.precedence,e),n.instance=y;case"script":return y=yi(o.src),(h=e.querySelector(Bs(y)))?(n.instance=h,Dt(h),h):(s=o,(h=Un.get(y))&&(s=C({},o),sm(s,h)),e=e.ownerDocument||e,h=e.createElement("script"),Dt(h),$t(h,"link",s),e.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Kc(s,o.precedence,e));return n.instance}function Kc(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,R=0;R<s.length;R++){var I=s[R];if(I.dataset.precedence===n)y=I;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 im(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function sm(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Fc=null;function z1(e,n,o){if(Fc===null){var s=new Map,h=Fc=new Map;h.set(o,s)}else h=Fc,s=h.get(o),s||(s=new Map,h.set(o,s));if(s.has(e))return s;for(s.set(e,null),o=o.getElementsByTagName(e),h=0;h<o.length;h++){var y=o[h];if(!(y[Zi]||y[Ft]||e==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var R=y.getAttribute(n)||"";R=e+R;var I=s.get(R);I?I.push(y):s.set(R,[y])}}return s}function B1(e,n,o){e=e.ownerDocument||e,e.head.insertBefore(o,n==="title"?e.querySelector("head > title"):null)}function yM(e,n,o){if(o===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function H1(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Hs=null;function xM(){}function bM(e,n,o){if(Hs===null)throw Error(a(475));var s=Hs;if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var h=gi(o.href),y=e.querySelector(zs(h));if(y){e=y._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=Qc.bind(s),e.then(s,s)),n.state.loading|=4,n.instance=y,Dt(y);return}y=e.ownerDocument||e,o=k1(o),(h=Un.get(h))&&im(o,h),y=y.createElement("link"),Dt(y);var R=y;R._p=new Promise(function(I,V){R.onload=I,R.onerror=V}),$t(y,"link",o),n.instance=y}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(s.count++,n=Qc.bind(s),e.addEventListener("load",n),e.addEventListener("error",n))}}function vM(){if(Hs===null)throw Error(a(475));var e=Hs;return e.stylesheets&&e.count===0&&lm(e,e.stylesheets),0<e.count?function(n){var o=setTimeout(function(){if(e.stylesheets&&lm(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 Qc(){if(this.count--,this.count===0){if(this.stylesheets)lm(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zc=null;function lm(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zc=new Map,n.forEach(SM,e),Zc=null,Qc.call(e))}function SM(e,n){if(!(n.state.loading&4)){var o=Zc.get(e);if(o)var s=o.get(null);else{o=new Map,Zc.set(e,o);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<h.length;y++){var R=h[y];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(o.set(R.dataset.precedence,R),s=R)}s&&o.set(null,s)}h=n.instance,R=h.getAttribute("data-precedence"),y=o.get(R)||s,y===s&&o.set(null,h),o.set(R,h),this.count++,s=Qc.bind(this),h.addEventListener("load",s),h.addEventListener("error",s),y?y.parentNode.insertBefore(h,y.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),n.state.loading|=4}}var Ps={$$typeof:N,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function CM(e,n,o,s,h,y,R,I){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=Kt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kt(0),this.hiddenUpdates=Kt(null),this.identifierPrefix=s,this.onUncaughtError=h,this.onCaughtError=y,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function P1(e,n,o,s,h,y,R,I,V,J,oe,se){return e=new CM(e,n,o,R,I,V,J,se),n=1,y===!0&&(n|=24),y=yn(3,null,null,n),e.current=y,y.stateNode=e,n=Gf(),n.refCount++,e.pooledCache=n,n.refCount++,y.memoizedState={element:s,isDehydrated:o,cache:n},Xf(y),e}function U1(e){return e?(e=Ka,e):Ka}function $1(e,n,o,s,h,y){h=U1(h),s.context===null?s.context=h:s.pendingContext=h,s=io(n),s.payload={element:o},y=y===void 0?null:y,y!==null&&(s.callback=y),o=so(e,s,n),o!==null&&(Cn(o,e,n),gs(o,e,n))}function G1(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function cm(e,n){G1(e,n),(e=e.alternate)&&G1(e,n)}function V1(e){if(e.tag===13){var n=Xa(e,67108864);n!==null&&Cn(n,e,67108864),cm(e,67108864)}}var Wc=!0;function wM(e,n,o,s){var h=G.T;G.T=null;var y=q.p;try{q.p=2,um(e,n,o,s)}finally{q.p=y,G.T=h}}function EM(e,n,o,s){var h=G.T;G.T=null;var y=q.p;try{q.p=8,um(e,n,o,s)}finally{q.p=y,G.T=h}}function um(e,n,o,s){if(Wc){var h=dm(s);if(h===null)Zh(e,n,s,Jc,o),Y1(e,s);else if(jM(h,e,n,o,s))s.stopPropagation();else if(Y1(e,s),n&4&&-1<TM.indexOf(e)){for(;h!==null;){var y=ka(h);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var R=Nt(y.pendingLanes);if(R!==0){var I=y;for(I.pendingLanes|=2,I.entangledLanes|=2;R;){var V=1<<31-Ht(R);I.entanglements[1]|=V,R&=~V}cr(y),(Qe&6)===0&&(Lc=ht()+500,Ds(0))}}break;case 13:I=Xa(y,2),I!==null&&Cn(I,y,2),Bc(),cm(y,2)}if(y=dm(s),y===null&&Zh(e,n,s,Jc,o),y===h)break;h=y}h!==null&&s.stopPropagation()}else Zh(e,n,s,null,o)}}function dm(e){return e=gf(e),fm(e)}var Jc=null;function fm(e){if(Jc=null,e=Ia(e),e!==null){var n=l(e);if(n===null)e=null;else{var o=n.tag;if(o===13){if(e=u(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Jc=e,null}function q1(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(rn()){case pe:return 2;case yt:return 8;case Fe:case On:return 32;case Mn:return 268435456;default:return 32}default:return 32}}var hm=!1,So=null,Co=null,wo=null,Us=new Map,$s=new Map,Eo=[],TM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Y1(e,n){switch(e){case"focusin":case"focusout":So=null;break;case"dragenter":case"dragleave":Co=null;break;case"mouseover":case"mouseout":wo=null;break;case"pointerover":case"pointerout":Us.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":$s.delete(n.pointerId)}}function Gs(e,n,o,s,h,y){return e===null||e.nativeEvent!==y?(e={blockedOn:n,domEventName:o,eventSystemFlags:s,nativeEvent:y,targetContainers:[h]},n!==null&&(n=ka(n),n!==null&&V1(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),e)}function jM(e,n,o,s,h){switch(n){case"focusin":return So=Gs(So,e,n,o,s,h),!0;case"dragenter":return Co=Gs(Co,e,n,o,s,h),!0;case"mouseover":return wo=Gs(wo,e,n,o,s,h),!0;case"pointerover":var y=h.pointerId;return Us.set(y,Gs(Us.get(y)||null,e,n,o,s,h)),!0;case"gotpointercapture":return y=h.pointerId,$s.set(y,Gs($s.get(y)||null,e,n,o,s,h)),!0}return!1}function X1(e){var n=Ia(e.target);if(n!==null){var o=l(n);if(o!==null){if(n=o.tag,n===13){if(n=u(o),n!==null){e.blockedOn=n,af(e.priority,function(){if(o.tag===13){var s=Sn();s=_a(s);var h=Xa(o,s);h!==null&&Cn(h,o,s),cm(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 eu(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=dm(e.nativeEvent);if(o===null){o=e.nativeEvent;var s=new o.constructor(o.type,o);pf=s,o.target.dispatchEvent(s),pf=null}else return n=ka(o),n!==null&&V1(n),e.blockedOn=o,!1;n.shift()}return!0}function K1(e,n,o){eu(e)&&o.delete(n)}function AM(){hm=!1,So!==null&&eu(So)&&(So=null),Co!==null&&eu(Co)&&(Co=null),wo!==null&&eu(wo)&&(wo=null),Us.forEach(K1),$s.forEach(K1)}function tu(e,n){e.blockedOn===n&&(e.blockedOn=null,hm||(hm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,AM)))}var nu=null;function F1(e){nu!==e&&(nu=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){nu===e&&(nu=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(fm(s||o)===null)continue;break}var y=ka(o);y!==null&&(e.splice(n,3),n-=3,fh(y,{pending:!0,data:h,method:o.method,action:s},s,h))}}))}function Vs(e){function n(V){return tu(V,e)}So!==null&&tu(So,e),Co!==null&&tu(Co,e),wo!==null&&tu(wo,e),Us.forEach(n),$s.forEach(n);for(var o=0;o<Eo.length;o++){var s=Eo[o];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Eo.length&&(o=Eo[0],o.blockedOn===null);)X1(o),o.blockedOn===null&&Eo.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],R=h[an]||null;if(typeof y=="function")R||F1(o);else if(R){var I=null;if(y&&y.hasAttribute("formAction")){if(h=y,R=y[an]||null)I=R.formAction;else if(fm(h)!==null)continue}else I=R.action;typeof I=="function"?o[s+1]=I:(o.splice(s,3),s-=3),F1(o)}}}function mm(e){this._internalRoot=e}ru.prototype.render=mm.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var o=n.current,s=Sn();$1(o,s,e,n,null,null)},ru.prototype.unmount=mm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;$1(e.current,2,null,e,null,null),Bc(),n[Da]=null}};function ru(e){this._internalRoot=e}ru.prototype.unstable_scheduleHydration=function(e){if(e){var n=or();e={blockedOn:null,target:e,priority:n};for(var o=0;o<Eo.length&&n!==0&&n<Eo[o].priority;o++);Eo.splice(o,0,e),o===0&&X1(e)}};var Q1=r.version;if(Q1!=="19.1.1")throw Error(a(527,Q1,"19.1.1"));q.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=m(n),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var RM={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ou.isDisabled&&ou.supportsFiber)try{on=ou.inject(RM),Rt=ou}catch{}}return Mi.createRoot=function(e,n){if(!c(e))throw Error(a(299));var o=!1,s="",h=fv,y=hv,R=mv,I=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&&(R=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(I=n.unstable_transitionCallbacks)),n=P1(e,1,!1,null,null,o,s,h,y,R,I,null),e[Da]=n.current,Qh(e),new mm(n)},Mi.hydrateRoot=function(e,n,o){if(!c(e))throw Error(a(299));var s=!1,h="",y=fv,R=hv,I=mv,V=null,J=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&&(R=o.onCaughtError),o.onRecoverableError!==void 0&&(I=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(V=o.unstable_transitionCallbacks),o.formState!==void 0&&(J=o.formState)),n=P1(e,1,!0,n,o??null,s,h,y,R,I,V,J),n.context=U1(null),o=n.current,s=Sn(),s=_a(s),h=io(s),h.callback=null,so(o,h,s),o=s,n.current.lanes=o,Ne(n,o),cr(n),e[Da]=n.current,Qh(e),new ru(n)},Mi.version="19.1.1",Mi}var Zm;function tC(){if(Zm)return Ou.exports;Zm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Ou.exports=eC(),Ou.exports}var nC=tC(),Xr=Fm();function Wm(t){var r,i,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var c=t.length;for(r=0;r<c;r++)t[r]&&(i=Wm(t[r]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}function Jm(){for(var t,r,i=0,a="",c=arguments.length;i<c;i++)(t=arguments[i])&&(r=Wm(t))&&(a&&(a+=" "),a+=r);return a}const rC=(t,r)=>{const i=new Array(t.length+r.length);for(let a=0;a<t.length;a++)i[a]=t[a];for(let a=0;a<r.length;a++)i[t.length+a]=r[a];return i},oC=(t,r)=>({classGroupId:t,validator:r}),ep=(t=new Map,r=null,i)=>({nextPart:t,validators:r,classGroupId:i}),tl="-",tp=[],aC="arbitrary..",iC=t=>{const r=lC(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return sC(u);const d=u.split(tl),m=d[0]===""&&d.length>1?1:0;return np(d,m,r)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=a[u],p=i[u];return m?p?rC(p,m):m:p||tp}return i[u]||tp}}},np=(t,r,i)=>{if(t.length-r===0)return i.classGroupId;const c=t[r],l=i.nextPart.get(c);if(l){const p=np(t,r+1,l);if(p)return p}const u=i.validators;if(u===null)return;const d=r===0?t.join(tl):t.slice(r).join(tl),m=u.length;for(let p=0;p<m;p++){const C=u[p];if(C.validator(d))return C.classGroupId}},sC=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=t.slice(1,-1),i=r.indexOf(":"),a=r.slice(0,i);return a?aC+a:void 0})(),lC=t=>{const{theme:r,classGroups:i}=t;return cC(i,r)},cC=(t,r)=>{const i=ep();for(const a in t){const c=t[a];Iu(c,i,a,r)}return i},Iu=(t,r,i,a)=>{const c=t.length;for(let l=0;l<c;l++){const u=t[l];uC(u,r,i,a)}},uC=(t,r,i,a)=>{if(typeof t=="string"){dC(t,r,i);return}if(typeof t=="function"){fC(t,r,i,a);return}hC(t,r,i,a)},dC=(t,r,i)=>{const a=t===""?r:rp(r,t);a.classGroupId=i},fC=(t,r,i,a)=>{if(mC(t)){Iu(t(a),r,i,a);return}r.validators===null&&(r.validators=[]),r.validators.push(oC(i,t))},hC=(t,r,i,a)=>{const c=Object.entries(t),l=c.length;for(let u=0;u<l;u++){const[d,m]=c[u];Iu(m,rp(r,d),i,a)}},rp=(t,r)=>{let i=t;const a=r.split(tl),c=a.length;for(let l=0;l<c;l++){const u=a[l];let d=i.nextPart.get(u);d||(d=ep(),i.nextPart.set(u,d)),i=d}return i},mC=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,pC=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,i=Object.create(null),a=Object.create(null);const c=(l,u)=>{i[l]=u,r++,r>t&&(r=0,a=i,i=Object.create(null))};return{get(l){let u=i[l];if(u!==void 0)return u;if((u=a[l])!==void 0)return c(l,u),u},set(l,u){l in i?i[l]=u:c(l,u)}}},ku="!",op=":",gC=[],ap=(t,r,i,a,c)=>({modifiers:t,hasImportantModifier:r,baseClassName:i,maybePostfixModifierPosition:a,isExternal:c}),yC=t=>{const{prefix:r,experimentalParseClassName:i}=t;let a=c=>{const l=[];let u=0,d=0,m=0,p;const C=c.length;for(let S=0;S<C;S++){const w=c[S];if(u===0&&d===0){if(w===op){l.push(c.slice(m,S)),m=S+1;continue}if(w==="/"){p=S;continue}}w==="["?u++:w==="]"?u--:w==="("?d++:w===")"&&d--}const g=l.length===0?c:c.slice(m);let x=g,b=!1;g.endsWith(ku)?(x=g.slice(0,-1),b=!0):g.startsWith(ku)&&(x=g.slice(1),b=!0);const v=p&&p>m?p-m:void 0;return ap(l,b,x,v)};if(r){const c=r+op,l=a;a=u=>u.startsWith(c)?l(u.slice(c.length)):ap(gC,!1,u,void 0,!0)}if(i){const c=a;a=l=>i({className:l,parseClassName:c})}return a},xC=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}},bC=t=>({cache:pC(t.cacheSize),parseClassName:yC(t),sortModifiers:xC(t),postfixLookupClassGroupIds:vC(t),...iC(t)}),vC=t=>{const r=Object.create(null),i=t.postfixLookupClassGroups;if(i)for(let a=0;a<i.length;a++)r[i[a]]=!0;return r},SC=/\s+/,CC=(t,r)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:c,sortModifiers:l,postfixLookupClassGroupIds:u}=r,d=[],m=t.trim().split(SC);let p="";for(let C=m.length-1;C>=0;C-=1){const g=m[C],{isExternal:x,modifiers:b,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:w}=i(g);if(x){p=g+(p.length>0?" "+p:p);continue}let T=!!w,j;if(T){const _=S.substring(0,w);j=a(_);const k=j&&u[j]?a(S):void 0;k&&k!==j&&(j=k,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 N=b.length===0?"":b.length===1?b[0]:l(b).join(":"),M=v?N+ku:N,D=M+j;if(d.indexOf(D)>-1)continue;d.push(D);const O=c(j,T);for(let _=0;_<O.length;++_){const k=O[_];d.push(M+k)}p=g+(p.length>0?" "+p:p)}return p},wC=(...t)=>{let r=0,i,a,c="";for(;r<t.length;)(i=t[r++])&&(a=ip(i))&&(c&&(c+=" "),c+=a);return c},ip=t=>{if(typeof t=="string")return t;let r,i="";for(let a=0;a<t.length;a++)t[a]&&(r=ip(t[a]))&&(i&&(i+=" "),i+=r);return i},EC=(t,...r)=>{let i,a,c,l;const u=m=>{const p=r.reduce((C,g)=>g(C),t());return i=bC(p),a=i.cache.get,c=i.cache.set,l=d,d(m)},d=m=>{const p=a(m);if(p)return p;const C=CC(m,i);return c(m,C),C};return l=u,(...m)=>l(wC(...m))},TC=[],Tt=t=>{const r=i=>i[t]||TC;return r.isThemeGetter=!0,r.themeKey=t,r},sp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,AC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,NC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,OC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kr=t=>jC.test(t),De=t=>!!t&&!Number.isNaN(Number(t)),Wn=t=>!!t&&Number.isInteger(Number(t)),Lu=t=>t.endsWith("%")&&De(t.slice(0,-1)),dr=t=>AC.test(t),cp=()=>!0,_C=t=>RC.test(t)&&!NC.test(t),zu=()=>!1,DC=t=>OC.test(t),IC=t=>MC.test(t),kC=t=>!fe(t)&&!he(t),LC=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),zC=t=>Fr(t,pp,zu),fe=t=>sp.test(t),No=t=>Fr(t,gp,_C),up=t=>Fr(t,qC,De),BC=t=>Fr(t,xp,cp),HC=t=>Fr(t,yp,zu),dp=t=>Fr(t,hp,zu),PC=t=>Fr(t,mp,IC),nl=t=>Fr(t,bp,DC),he=t=>lp.test(t),_i=t=>Oo(t,gp),UC=t=>Oo(t,yp),fp=t=>Oo(t,hp),$C=t=>Oo(t,pp),GC=t=>Oo(t,mp),rl=t=>Oo(t,bp,!0),VC=t=>Oo(t,xp,!0),Fr=(t,r,i)=>{const a=sp.exec(t);return a?a[1]?r(a[1]):i(a[2]):!1},Oo=(t,r,i=!1)=>{const a=lp.exec(t);return a?a[1]?r(a[1]):i:!1},hp=t=>t==="position"||t==="percentage",mp=t=>t==="image"||t==="url",pp=t=>t==="length"||t==="size"||t==="bg-size",gp=t=>t==="length",qC=t=>t==="number",yp=t=>t==="family-name",xp=t=>t==="number"||t==="weight",bp=t=>t==="shadow",YC=EC(()=>{const t=Tt("color"),r=Tt("font"),i=Tt("text"),a=Tt("font-weight"),c=Tt("tracking"),l=Tt("leading"),u=Tt("breakpoint"),d=Tt("container"),m=Tt("spacing"),p=Tt("radius"),C=Tt("shadow"),g=Tt("inset-shadow"),x=Tt("text-shadow"),b=Tt("drop-shadow"),v=Tt("blur"),S=Tt("perspective"),w=Tt("aspect"),T=Tt("ease"),j=Tt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),he,fe],O=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],k=()=>[he,fe,m],L=()=>[Kr,"full","auto",...k()],B=()=>[Wn,"none","subgrid",he,fe],z=()=>["auto",{span:["full",Wn,he,fe]},Wn,he,fe],U=()=>[Wn,"auto",he,fe],K=()=>["auto","min","max","fr",he,fe],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...k()],q=()=>[Kr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],H=()=>[d,Kr,"screen","full","dvw","lvw","svw","min","max","fit",...k()],P=()=>[Kr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],A=()=>[t,he,fe],Y=()=>[...M(),fp,dp,{position:[he,fe]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",$C,zC,{size:[he,fe]}],le=()=>[Lu,_i,No],re=()=>["","none","full",p,he,fe],ae=()=>["",De,_i,No],be=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[De,Lu,fp,dp],de=()=>["","none",v,he,fe],_e=()=>["none",De,he,fe],Me=()=>["none",De,he,fe],Ee=()=>[De,he,fe],ve=()=>[Kr,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[dr],breakpoint:[dr],color:[cp],container:[dr],"drop-shadow":[dr],ease:["in","out","in-out"],font:[kC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[dr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[dr],shadow:[dr],spacing:["px",De],text:[dr],"text-shadow":[dr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Kr,fe,he,w]}],container:["container"],"container-type":[{"@container":["","normal","size",he,fe]}],"container-named":[LC],columns:[{columns:[De,"auto",fe,he,d]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Wn,"auto",he,fe]}],basis:[{basis:[Kr,"full","auto",d,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Kr,"auto","initial","none",fe]}],grow:[{grow:["",De,he,fe]}],shrink:[{shrink:["",De,he,fe]}],order:[{order:[Wn,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pbs:[{pbs:k()}],pbe:[{pbe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],w:[{w:[d,"screen",...q()]}],"min-w":[{"min-w":[d,"screen","none",...q()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh","none",...q()]}],"font-size":[{text:["base",i,_i,No]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,VC,BC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lu,fe]}],"font-family":[{font:[UC,HC,r]}],"font-features":[{"font-features":[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,he,fe]}],"line-clamp":[{"line-clamp":[De,"none",he,up]}],leading:[{leading:["none",l,...k()]}],"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:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",he,No]}],"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:k()}],"tab-size":[{tab:[Wn,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:Y()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wn,he,fe],radial:["",he,fe],conic:["",Wn,he,fe]},GC,PC]}],"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:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"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:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,he,fe]}],"outline-w":[{outline:["",De,_i,No]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","inner","none",C,rl,nl]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,rl,nl]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[De,No]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",x,rl,nl]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[De,he,fe]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"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":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"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":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"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":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"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":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"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":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"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":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"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":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"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":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"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":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:Y()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:Z()}],"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",b,rl,nl]}],"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":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"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",T,he,fe]}],delay:[{delay:[De,he,fe]}],animate:[{animate:["none",j,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,he,fe]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:Me()}],"scale-x":[{"scale-x":Me()}],"scale-y":[{"scale-y":Me()}],"scale-z":[{"scale-z":Me()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],zoom:[{zoom:[Wn,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":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mbs":[{"scroll-mbs":k()}],"scroll-mbe":[{"scroll-mbe":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pbs":[{"scroll-pbs":k()}],"scroll-pbe":[{"scroll-pbe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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,_i,No,up]}],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 qe(...t){return YC(Jm(t))}var XC=Object.defineProperty,Bu=(t,r)=>XC(t,"name",{value:r,configurable:!0});function Hu(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}Bu(Hu,"setRef");function vp(...t){return r=>{let i=!1;const a=t.map(c=>{const l=Hu(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():Hu(t[c],null)}}}}Bu(vp,"composeRefs");function Ie(...t){return E.useCallback(vp(...t),t)}Bu(Ie,"useComposedRefs");var KC=Object.defineProperty,dn=(t,r)=>KC(t,"name",{value:r,configurable:!0});function fr(t){const r=E.forwardRef((i,a)=>{let{children:c,...l}=i,u=null,d=!1;const m=[];c=Ap(c),E.Children.forEach(c,x=>{if(Tp(x)){d=!0;const b=x;let v="child"in b.props?b.props.child:b.props.children;for(;Pu(v)&&typeof ol=="function";)v=ol(v._payload);u=QC(b,v),m.push(u?.props?.children)}else m.push(x)}),u?u=E.cloneElement(u,void 0,m):!d&&E.Children.count(c)===1&&E.isValidElement(c)&&(u=c);const p=u?Ep(u):void 0,C=Ie(a,p);if(!u){if(c||c===0)throw new Error(d?JC(t):WC(t));return c}const g=wp(l,u.props??{});return u.type!==E.Fragment&&(g.ref=a?C:p),E.cloneElement(u,g)});return r.displayName=`${t}.Slot`,r}dn(fr,"createSlot");var FC=fr("Slot"),Sp=Symbol.for("radix.slottable");function Cp(t){const r=dn(i=>"child"in i?i.children(i.child):i.children,"Slottable");return r.displayName=`${t}.Slottable`,r.__radixId=Sp,r}dn(Cp,"createSlottable");var QC=dn((t,r)=>"child"in t.props?E.isValidElement(r)?E.cloneElement(r,void 0,t.props.children(r.props.children)):null:E.isValidElement(r)?r:null,"getSlottableElementFromSlottable");function wp(t,r){const i={...r};for(const a in r){const c=t[a],l=r[a];/^on[A-Z]/.test(a)?c&&l?i[a]=(...d)=>{const m=l(...d);return c(...d),m}:c&&(i[a]=c):a==="style"?i[a]={...c,...l}:a==="className"?i[a]=[c,l].filter(Boolean).join(" "):a==="aria-describedby"&&(i[a]=Rp(l,c))}return{...t,...i}}dn(wp,"mergeProps");function Ep(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}dn(Ep,"getElementRef");function Tp(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Sp}dn(Tp,"isSlottable");var ZC=Symbol.for("react.lazy");function Pu(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===ZC&&"_payload"in t&&jp(t._payload)}dn(Pu,"isLazyComponent");function jp(t){return typeof t=="object"&&t!==null&&"then"in t}dn(jp,"isPromiseLike");function Ap(t){let r=t;for(;Pu(r)&&typeof ol=="function";)r=ol(r._payload);return r}dn(Ap,"useUnwrappedLazy");function Rp(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}dn(Rp,"concatAriaDescribedby");var WC=dn(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),JC=dn(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ol=Ro[" use ".trim().toString()],ew=Object.defineProperty,tw=(t,r)=>ew(t,"name",{value:r,configurable:!0}),nw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=nw.reduce((t,r)=>{const i=fr(`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 Np(t,r){t&&Xr.flushSync(()=>t.dispatchEvent(r))}tw(Np,"dispatchDiscreteCustomEvent");var rw=Object.defineProperty,ow=(t,r)=>rw(t,"name",{value:r,configurable:!0}),Op=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),aw=E.forwardRef(ow(function(r,i){return f.jsx(He.span,{...r,ref:i,style:{...Op,...r.style}})},"VisuallyHidden")),iw=Object.defineProperty,jn=(t,r)=>iw(t,"name",{value:r,configurable:!0});function sw(t,r){const i=E.createContext(r);i.displayName=t+"Context";const a=jn(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 jn(c,"useContext"),[a,c]}jn(sw,"createContext");function An(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=jn(g=>{const{scope:x,children:b,...v}=g,S=x?.[t]?.[m]||d,w=E.useMemo(()=>v,Object.values(v));return f.jsx(S.Provider,{value:w,children:b})},"Provider");p.displayName=l+"Provider";function C(g,x,b={}){const{optional:v=!1}=b,S=x?.[t]?.[m]||d,w=E.useContext(S);if(w)return w;if(u!==void 0)return u;if(!v)throw new Error(`\`${g}\` must be used within \`${l}\``)}return jn(C,"useContext"),[p,C]}jn(a,"createContext");const c=jn(()=>{const l=i.map(u=>E.createContext(u));return jn(function(d){const m=d?.[t]||l;return E.useMemo(()=>({[`__scope${t}`]:{...d,[t]:m}}),[d,m])},"useScope")},"createScope");return c.scopeName=t,[a,Mp(c,...r)]}jn(An,"createContextScope");function Mp(...t){const r=t[0];if(t.length===1)return r;const i=jn(()=>{const a=t.map(c=>({useScope:c(),scopeName:c.scopeName}));return jn(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}jn(Mp,"composeContextScopes");var st=globalThis?.document?E.useLayoutEffect:()=>{},lw=Object.defineProperty,jt=(t,r)=>lw(t,"name",{value:r,configurable:!0});function al(t){const r=t+"CollectionProvider",[i,a]=An(r),[c,l]=i(r,{collectionRef:{current:null},itemMap:new Map}),u=jt(S=>{const{scope:w,children:T}=S,j=E.useRef(null),N=E.useRef(new Map).current;return f.jsx(c,{scope:w,itemMap:N,collectionRef:j,children:T})},"CollectionProvider");u.displayName=r;const d=t+"CollectionSlot",m=fr(d),p=E.forwardRef((S,w)=>{const{scope:T,children:j}=S,N=l(d,T),M=Ie(w,N.collectionRef);return f.jsx(m,{ref:M,children:j})});p.displayName=d;const C=t+"CollectionItemSlot",g="data-radix-collection-item",x=fr(C),b=E.forwardRef((S,w)=>{const{scope:T,children:j,...N}=S,M=E.useRef(null),D=Ie(w,M),O=l(C,T);return E.useEffect(()=>(O.itemMap.set(M,{ref:M,...N}),()=>void O.itemMap.delete(M))),f.jsx(x,{[g]:"",ref:D,children:j})});b.displayName=C;function v(S){const w=l(t+"CollectionConsumer",S);return E.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const N=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((O,_)=>N.indexOf(O.ref.current)-N.indexOf(_.ref.current))},[w.collectionRef,w.itemMap])}return jt(v,"useCollection"),[{Provider:u,Slot:p,ItemSlot:b},v,a]}jt(al,"createCollection");var _p=new WeakMap,il=(hn=class extends Map{constructor(i){super(i);J1(this,gt);gm(this,gt,[...super.keys()]),_p.set(this,!0)}set(i,a){return _p.get(this)&&!this.has(i)&&Gt(this,gt).push(i),super.set(i,a),this}insert(i,a,c){const l=this.has(a),u=l?this.size:this.size+1,d=Uu(i),m=d>=0?Math.min(d,u-1):Math.max(u+d,0);if(l?Gt(this,gt).indexOf(a)===m:m===this.size)return this.set(a,c),this;const p=Gt(this,gt).filter(g=>g!==a);p.splice(m,0,a);const C=p.map(g=>[g,g===a?c:this.get(g)]);this.clear();for(const[g,x]of C)this.set(g,x);return this}with(i,a,c){const l=new hn(this);return l.insert(i,a,c),l}before(i){const a=Gt(this,gt).indexOf(i)-1;if(!(a<0))return this.entryAt(a)}setBefore(i,a,c){const l=Gt(this,gt).indexOf(i);if(l===-1)return this;const u=Gt(this,gt).indexOf(a),d=u!==-1&&u<l?l-1:l;return this.insert(d,a,c)}after(i){let a=Gt(this,gt).indexOf(i);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(i,a,c){const l=Gt(this,gt).indexOf(i);if(l===-1)return this;const u=Gt(this,gt).indexOf(a),d=u!==-1&&u<=l?l:l+1;return this.insert(d,a,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return gm(this,gt,[]),super.clear()}delete(i){const a=super.delete(i);return a&&Gt(this,gt).splice(Gt(this,gt).indexOf(i),1),a}deleteAt(i){const a=this.keyAt(i);return a!==void 0?this.delete(a):!1}at(i){const a=sl(Gt(this,gt),i);if(a!==void 0)return this.get(a)}entryAt(i){const a=sl(Gt(this,gt),i);if(a!==void 0)return[a,this.get(a)]}indexOf(i){return Gt(this,gt).indexOf(i)}keyAt(i){return sl(Gt(this,gt),i)}from(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(i,a){const c=this.indexOf(i);if(c===-1)return;let l=c+a;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return l;c++}}findIndex(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return c;c++}return-1}filter(i,a){const c=[];let l=0;for(const u of this)Reflect.apply(i,a,[u,l,this])&&c.push(u),l++;return new hn(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 hn(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 hn(a)}toReversed(){const i=new hn;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 hn(a)}slice(i,a){const c=new hn;for(const l of Gt(this,gt).slice(i,a))c.set(l,this.get(l));return c}every(i,a){let c=0;for(const l of this){if(!Reflect.apply(i,a,[l,c,this]))return!1;c++}return!0}some(i,a){let c=0;for(const l of this){if(Reflect.apply(i,a,[l,c,this]))return!0;c++}return!1}},gt=new WeakMap,jt(hn,"OrderedDict"),hn);function sl(t,r){if("at"in Array.prototype)return Array.prototype.at.call(t,r);const i=Dp(t,r);return i===-1?void 0:t[i]}jt(sl,"at");function Dp(t,r){const i=t.length,a=Uu(r),c=a>=0?a:i+a;return c<0||c>=i?-1:c}jt(Dp,"toSafeIndex");function Uu(t){return t!==t||t===0?0:Math.trunc(t)}jt(Uu,"toSafeInteger");function cw(t){const r=t+"CollectionProvider",[i,a]=An(r),[c,l]=i(r);c.displayName=t+"CollectionStableContextProvider";const[u,d]=i(r);u.displayName=t+"CollectionStatefulContextProvider";const m=jt(({state:O,..._})=>O?f.jsx(C,{..._,state:O}):f.jsx(p,{..._}),"CollectionProvider");m.displayName=r;const p=jt(O=>{const _=j();return f.jsx(C,{...O,state:_})},"CollectionInit");p.displayName=t+"CollectionInit";const C=jt(O=>{const{scope:_,children:k,state:L}=O,B=E.useRef(null),[z,U]=E.useState(null),K=Ie(B,U),[$,ee]=L,G=E.useRef(new il),q=E.useCallback(()=>{const H=G.current;return Lp(H)||H.sort(ll),H},[]);return E.useEffect(()=>{if(!z)return;const H=zp(()=>{ee(P=>{const A=P.toSorted(ll);return A.some(([F],Z)=>P.keyAt(Z)!==F)?A:P})});return H.observe(z,{childList:!0,subtree:!0}),()=>{H.disconnect()}},[z,ee]),f.jsx(c,{scope:_,collectionElementRef:K,collectionElementRefObject:B,getCollection:q,setCollection:ee,registryRef:G,children:f.jsx(u,{scope:_,collectionElement:z,collection:$,children:k})})},"CollectionProviderImpl");C.displayName=t+"CollectionProviderImpl";const g=t+"CollectionSlot",x=fr(g),b=E.forwardRef((O,_)=>{const{scope:k,children:L}=O,B=l(g,k),z=Ie(_,B.collectionElementRef);return f.jsx(x,{ref:z,children:L})});b.displayName=g;const v=t+"CollectionItemSlot",S="data-radix-collection-item",w=fr(v),T=E.forwardRef((O,_)=>{const{scope:k,children:L,...B}=O,z=E.useRef(null),U=l(v,k),{setCollection:K,registryRef:$}=U,ee=E.useRef(B);Ip(ee.current,B)||(ee.current=B);const G=ee.current,q=E.useCallback(A=>{const Y=$.current;A?Y.set(A,{...ee.current,element:A}):z.current&&Y.delete(z.current)},[$]),H=Ie(_,q,z);st(()=>{const A=z.current,Y=$.current;A&&Y.has(A)&&Y.set(A,{...G,element:A})},[G,$]);const P=E.useRef(null);return E.useEffect(()=>{const A=z.current,Y=P.current;(Y?.element??null)===A&&(!A||Y?.itemData===G)||(P.current=A?{element:A,itemData:G}:null,K(F=>{const Z=new il(F);return Y&&Y.element!==A&&Z.delete(Y.element),A&&Z.set(A,{...G,element:A}),Z.sort(ll)}))}),E.useEffect(()=>()=>{const A=P.current;P.current=null,A&&K(Y=>{if(!Y.has(A.element))return Y;const F=new il(Y);return F.delete(A.element),F})},[K]),f.jsx(w,{[S]:"",ref:H,children:L})});T.displayName=v;function j(){return E.useState(new il)}jt(j,"useInitCollection");function N(O){const{collection:_}=d(t+"CollectionConsumer",O);return _}jt(N,"useCollection");function M(O){const{getCollection:_}=l(t+"CollectionConsumer",O);return _}return jt(M,"useGetCollection"),[{Provider:m,Slot:b,ItemSlot:T},{createCollectionScope:a,useCollection:N,useGetCollection:M,useInitCollection:j}]}jt(cw,"createCollection");function Ip(t,r){if(t===r)return!0;if(typeof t!="object"||typeof r!="object"||t==null||r==null)return!1;const i=Object.keys(t),a=Object.keys(r);if(i.length!==a.length)return!1;for(const c of i)if(!Object.prototype.hasOwnProperty.call(r,c)||t[c]!==r[c])return!1;return!0}jt(Ip,"shallowEqual");function kp(t,r){return!!(r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}jt(kp,"isElementPreceding");function Lp(t){let r;for(const i of t.keys()){if(r){const a=r.compareDocumentPosition(i);if(!(a&Node.DOCUMENT_POSITION_DISCONNECTED)&&a&Node.DOCUMENT_POSITION_PRECEDING)return!1}r=i}return!0}jt(Lp,"isInDocumentOrder");function ll(t,r){return!t[1].element||!r[1].element?0:kp(t[1].element,r[1].element)?-1:1}jt(ll,"sortByDocumentPosition");function zp(t){return new MutationObserver(i=>{for(const a of i)if(a.type==="childList"){t();return}})}jt(zp,"getChildListObserver");var uw=Object.defineProperty,ma=(t,r)=>uw(t,"name",{value:r,configurable:!0}),Bp=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ce(t,r,{checkForDefaultPrevented:i=!0}={}){return ma(function(c){if(t?.(c),i===!1||!c||!c.defaultPrevented)return r?.(c)},"handleEvent")}ma(Ce,"composeEventHandlers");function dw(t){if(!Bp)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}ma(dw,"getOwnerWindow");function $u(t){if(!Bp)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}ma($u,"getOwnerDocument");function Hp(t,r=!1){const{activeElement:i}=$u(t);if(!i?.nodeName)return null;if(Pp(i)&&i.contentDocument)return Hp(i.contentDocument.body,r);if(r){const a=i.getAttribute("aria-activedescendant");if(a){const c=$u(i).getElementById(a);if(c)return c}}return i}ma(Hp,"getActiveElement");function Pp(t){return t.tagName==="IFRAME"}ma(Pp,"isFrame");var fw=Object.defineProperty,hw=(t,r)=>fw(t,"name",{value:r,configurable:!0}),Up=Ro[" useEffectEvent ".trim().toString()],$p=Ro[" useInsertionEffect ".trim().toString()];function Gp(t){if(typeof Up=="function")return Up(t);const r=E.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof $p=="function"?$p(()=>{r.current=t}):st(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}hw(Gp,"useEffectEvent");var mw=Object.defineProperty,Di=(t,r)=>mw(t,"name",{value:r,configurable:!0}),pw=Ro[" useInsertionEffect ".trim().toString()]||st;function hr({prop:t,defaultProp:r,onChange:i=Di(()=>{},"onChange"),caller:a}){const[c,l,u]=Vp({defaultProp:r,onChange:i}),d=t!==void 0,m=d?t:c,p=E.useCallback(C=>{if(d){const g=qp(C)?C(t):C;g!==t&&u.current?.(g)}else l(C)},[d,t,l,u]);return[m,p]}Di(hr,"useControllableState");function Vp({defaultProp:t,onChange:r}){const[i,a]=E.useState(t),c=E.useRef(i),l=E.useRef(r);return pw(()=>{l.current=r},[r]),E.useEffect(()=>{c.current!==i&&(l.current?.(i),c.current=i)},[i,c]),[i,a,l]}Di(Vp,"useUncontrolledState");function qp(t){return typeof t=="function"}Di(qp,"isFunction");var Yp=Symbol("RADIX:SYNC_STATE");function gw(t,r,i,a){const{prop:c,defaultProp:l,onChange:u,caller:d}=r,m=c!==void 0,p=Gp(u),C=[{...i,state:l}];a&&C.push(a);const[g,x]=E.useReducer((w,T)=>{if(T.type===Yp)return{...w,state:T.state};const j=t(w,T);return m&&!Object.is(j.state,w.state)&&p(j.state),j},...C),b=g.state,v=E.useRef(b);E.useEffect(()=>{v.current!==b&&(v.current=b,m||p(b))},[b,v,m]);const S=E.useMemo(()=>c!==void 0?{...g,state:c}:g,[g,c]);return E.useEffect(()=>{m&&!Object.is(c,g.state)&&x({type:Yp,state:c})},[c,g.state,m]),[S,x]}Di(gw,"useControllableStateReducer");var yw=Object.defineProperty,mr=(t,r)=>yw(t,"name",{value:r,configurable:!0});function Xp(t,r){return E.useReducer((i,a)=>r[i][a]??i,t)}mr(Xp,"useStateMachine");var Qr=mr(t=>{const{present:r,children:i}=t,a=Kp(r),c=typeof i=="function"?i({present:a.isPresent}):E.Children.only(i),l=Fp(a.ref,Qp(c));return typeof i=="function"||a.isPresent?E.cloneElement(c,{ref:l}):null},"Presence");function Kp(t){const[r,i]=E.useState(),a=E.useRef(null),c=E.useRef(t),l=E.useRef("none"),u=E.useRef(void 0),d=t?"mounted":"unmounted",[m,p]=Xp(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{m==="mounted"?(l.current=u.current??pa(a.current),u.current=void 0):l.current="none"},[m]),st(()=>{const C=a.current,g=c.current;if(g!==t){const b=l.current,v=pa(C);t?(u.current=v,p("MOUNT")):v==="none"||C?.display==="none"?p("UNMOUNT"):p(g&&b!==v?"ANIMATION_OUT":"UNMOUNT"),c.current=t}},[t,p]),st(()=>{if(r){let C;const g=r.ownerDocument.defaultView??window,x=mr(v=>{const w=pa(a.current).includes(CSS.escape(v.animationName));if(v.target===r&&w&&(p("ANIMATION_END"),!c.current)){const T=r.style.animationFillMode;r.style.animationFillMode="forwards",C=g.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=T)})}},"handleAnimationEnd"),b=mr(v=>{v.target===r&&(l.current=pa(a.current))},"handleAnimationStart");return r.addEventListener("animationstart",b),r.addEventListener("animationcancel",x),r.addEventListener("animationend",x),()=>{g.clearTimeout(C),r.removeEventListener("animationstart",b),r.removeEventListener("animationcancel",x),r.removeEventListener("animationend",x)}}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=pa(g)}else a.current=null;i(C)},[])}}mr(Kp,"usePresence");function Gu(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}mr(Gu,"setRef");function Fp(...t){const r=E.useRef(t);return r.current=t,E.useCallback(i=>{const a=r.current;let c=!1;const l=a.map(u=>{const d=Gu(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():Gu(a[u],null)}}},[])}mr(Fp,"useStableComposedRefs");function pa(t){return t?.animationName||"none"}mr(pa,"getAnimationName");function Qp(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}mr(Qp,"getElementRef");var xw=Object.defineProperty,bw=(t,r)=>xw(t,"name",{value:r,configurable:!0}),vw=Ro[" useId ".trim().toString()]||(()=>{}),Sw=0;function pr(t){const[r,i]=E.useState(vw());return st(()=>{t||i(a=>a??String(Sw++))},[t]),t||(r?`radix-${r}`:"")}bw(pr,"useId");var Cw=Object.defineProperty,ww=(t,r)=>Cw(t,"name",{value:r,configurable:!0}),Ew={LTR:"ltr"},Tw=E.createContext(void 0);function Ii(t){const r=E.useContext(Tw);return t||r||Ew.LTR}ww(Ii,"useDirection");var jw=Object.defineProperty,Aw=(t,r)=>jw(t,"name",{value:r,configurable:!0}),Zp=Ro[" useInsertionEffect ".trim().toString()];function $n(t){const r=E.useRef(t);return typeof Zp=="function"?Zp(()=>{r.current=t}):st(()=>{r.current=t}),E.useMemo(()=>((...i)=>r.current?.(...i)),[])}Aw($n,"useCallbackRef");var Rw=Object.defineProperty,_t=(t,r)=>Rw(t,"name",{value:r,configurable:!0}),Vu="dismissableLayer.update",Nw="dismissableLayer.pointerDownOutside",Ow="dismissableLayer.focusOutside",Wp,Jp=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),qu=E.forwardRef(_t(function(r,i){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,onDismiss:p,...C}=r,g=E.useContext(Jp),[x,b]=E.useState(null),v=x?.ownerDocument??globalThis?.document,[,S]=E.useState({}),w=Ie(i,b),T=Array.from(g.layers),[j]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),N=j?T.indexOf(j):-1,M=x?T.indexOf(x):-1,D=g.layersWithOutsidePointerEventsDisabled.size>0,O=M>=N,_=E.useRef(!1),k=tg(U=>{u?.(U),m?.(U),U.defaultPrevented||p?.()},{ownerDocument:v,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:E.useCallback(U=>{if(!(U instanceof Node))return!1;const K=[...g.branches].some($=>$.contains(U));return O&&!K},[g.branches,O])}),L=ng(U=>{if(c&&_.current)return;const K=U.target;[...g.branches].some(ee=>ee.contains(K))||(d?.(U),m?.(U),U.defaultPrevented||p?.())},v),B=x?M===T.length-1:!1,z=$n(U=>{U.key==="Escape"&&(l?.(U),!U.defaultPrevented&&p&&(U.preventDefault(),p()))});return E.useEffect(()=>{if(B)return v.addEventListener("keydown",z,{capture:!0}),()=>v.removeEventListener("keydown",z,{capture:!0})},[v,B,z]),E.useEffect(()=>{if(x)return a&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Wp=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(x)),g.layers.add(x),Yu(),()=>{a&&(g.layersWithOutsidePointerEventsDisabled.delete(x),g.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=Wp))}},[x,v,a,g]),E.useEffect(()=>()=>{x&&(g.layers.delete(x),g.layersWithOutsidePointerEventsDisabled.delete(x),Yu())},[x,g]),E.useEffect(()=>{const U=_t(()=>S({}),"handleUpdate");return document.addEventListener(Vu,U),()=>document.removeEventListener(Vu,U)},[]),f.jsx(He.div,{...C,ref:w,style:{pointerEvents:D?O?"auto":"none":void 0,...r.style},onFocusCapture:Ce(r.onFocusCapture,L.onFocusCapture),onBlurCapture:Ce(r.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Ce(r.onPointerDownCapture,k.onPointerDownCapture)})},"DismissableLayer"));function eg(){const t=E.useContext(Jp),[r,i]=E.useState(null);return E.useEffect(()=>{if(r)return t.dismissableSurfaces.add(r),()=>{t.dismissableSurfaces.delete(r)}},[r,t.dismissableSurfaces]),i}_t(eg,"useDismissableLayerSurface");var Mw=_t(()=>!0,"IS_TRUE");function tg(t,r){const{ownerDocument:i=globalThis?.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=Mw}=r,d=$n(t),m=E.useRef(!1),p=E.useRef(!1),C=E.useRef(new Map),g=E.useRef(()=>{});return E.useEffect(()=>{function x(){p.current=!1,c.current=!1,C.current.clear()}_t(x,"resetOutsideInteraction");function b(){return Array.from(C.current.values()).some(Boolean)}_t(b,"isOutsideInteractionIntercepted");function v(N){if(!p.current)return;const M=N.target;M instanceof Node&&[...l].some(O=>O.contains(M))||C.current.set(N.type,!0),N.type==="click"&&window.setTimeout(()=>{p.current&&g.current()},0)}_t(v,"handleInteractionCapture");function S(N){p.current&&C.current.set(N.type,!1)}_t(S,"handleInteractionBubble");const w=_t(N=>{if(N.target&&!m.current){let M=function(){i.removeEventListener("click",g.current);const O=b();x(),O||Xu(Nw,d,D,{discrete:!0})};if(_t(M,"handleAndDispatchPointerDownOutsideEvent"),!u(N.target)){i.removeEventListener("click",g.current),x(),m.current=!1;return}const D={originalEvent:N};p.current=!0,c.current=a&&N.button===0,C.current.clear(),!a||N.button!==0?M():(i.removeEventListener("click",g.current),g.current=M,i.addEventListener("click",g.current,{once:!0}))}else i.removeEventListener("click",g.current),x();m.current=!1},"handlePointerDown"),T=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const N of T)i.addEventListener(N,v,!0),i.addEventListener(N,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 N of T)i.removeEventListener(N,v,!0),i.removeEventListener(N,S)}},[i,d,a,c,l,u]),{onPointerDownCapture:_t(()=>m.current=!0,"onPointerDownCapture")}}_t(tg,"usePointerDownOutside");function ng(t,r=globalThis?.document){const i=$n(t),a=E.useRef(!1);return E.useEffect(()=>{const c=_t(l=>{l.target&&!a.current&&Xu(Ow,i,{originalEvent:l},{discrete:!1})},"handleFocus");return r.addEventListener("focusin",c),()=>r.removeEventListener("focusin",c)},[r,i]),{onFocusCapture:_t(()=>a.current=!0,"onFocusCapture"),onBlurCapture:_t(()=>a.current=!1,"onBlurCapture")}}_t(ng,"useFocusOutside");function Yu(){const t=new CustomEvent(Vu);document.dispatchEvent(t)}_t(Yu,"dispatchUpdate");function Xu(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?Np(c,l):c.dispatchEvent(l)}_t(Xu,"handleAndDispatchCustomEvent");var _w=Object.defineProperty,vt=(t,r)=>_w(t,"name",{value:r,configurable:!0}),Ku="focusScope.autoFocusOnMount",Fu="focusScope.autoFocusOnUnmount",rg={bubbles:!1,cancelable:!0},og=E.forwardRef(vt(function(r,i){const{loop:a=!1,trapped:c=!1,branches:l,onMountAutoFocus:u,onUnmountAutoFocus:d,...m}=r,[p,C]=E.useState(null),g=$n(u),x=$n(d),b=E.useRef(null),v=Ie(i,C),S=E.useRef(l);E.useEffect(()=>{S.current=l});const w=E.useCallback(N=>N?p?.contains(N)?!0:!!S.current?.some(M=>M.contains(N)):!1,[p]),T=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(c){let N=function(_){if(T.paused||!p)return;const k=_.target;w(k)?b.current=k:gr(b.current,{select:!0})},M=function(_){if(T.paused||!p)return;const k=_.relatedTarget;k!==null&&(w(k)||gr(b.current,{select:!0}))},D=function(_){if(document.activeElement===document.body)for(const L of _)L.removedNodes.length>0&&gr(p)};vt(N,"handleFocusIn"),vt(M,"handleFocusOut"),vt(D,"handleMutations"),document.addEventListener("focusin",N),document.addEventListener("focusout",M);const O=new MutationObserver(D);return p&&O.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",M),O.disconnect()}}},[c,p,T.paused,w]),E.useEffect(()=>{if(p){hg.add(T);const N=document.activeElement;if(!p.contains(N)){const D=new CustomEvent(Ku,rg);p.addEventListener(Ku,g),p.dispatchEvent(D),D.defaultPrevented||(cg(pg(Qu(p)),{select:!0}),document.activeElement===N&&gr(p))}return()=>{p.removeEventListener(Ku,g);const D=p.ownerDocument,O=CustomEvent;setTimeout(()=>{const _=new O(Fu,rg);p.addEventListener(Fu,x),p.dispatchEvent(_),_.defaultPrevented||gr(N??D.body,{select:!0}),p.removeEventListener(Fu,x),hg.remove(T)},0)}}},[p,g,x,T]);const j=E.useCallback(N=>{if(!a&&!c||T.paused)return;const M=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,D=document.activeElement;if(M&&D){const O=N.currentTarget,[_,k]=ug(O);_&&k?!N.shiftKey&&D===k?(N.preventDefault(),a&&gr(_,{select:!0})):N.shiftKey&&D===_&&(N.preventDefault(),a&&gr(k,{select:!0})):D===O&&N.preventDefault()}},[a,c,T.paused]);return f.jsx(He.div,{tabIndex:-1,...m,ref:v,onKeyDown:j})},"FocusScope")),ag=E.createContext(null);function ig({registry:t,children:r}){return t?f.jsx(ag.Provider,{value:t,children:r}):r}vt(ig,"FocusScopeBranchProvider");function sg(){const[t,r]=E.useState([]),i=E.useMemo(()=>({add:vt(a=>r(c=>c.includes(a)?c:[...c,a]),"add"),remove:vt(a=>r(c=>c.filter(l=>l!==a)),"remove")}),[]);return{nodes:t,registry:i}}vt(sg,"useFocusScopeBranchRegistry");function lg(t){const r=E.useContext(ag);E.useEffect(()=>{if(!(!t||!r))return r.add(t),()=>r.remove(t)},[t,r])}vt(lg,"useFocusScopeBranch");function cg(t,{select:r=!1}={}){const i=document.activeElement;for(const a of t)if(gr(a,{select:r}),document.activeElement!==i)return}vt(cg,"focusFirst");function ug(t){const r=Qu(t),i=Zu(r,t),a=Zu(r.reverse(),t);return[i,a]}vt(ug,"getTabbableEdges");function Qu(t){const r=[],a=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:vt(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}vt(Qu,"getTabbableCandidates");function Zu(t,r){const i=typeof r.checkVisibility=="function"&&r.checkVisibility({checkVisibilityCSS:!0});for(const a of t)if(!(i?!a.checkVisibility({checkVisibilityCSS:!0}):dg(a,{upTo:r})))return a}vt(Zu,"findVisible");function dg(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}vt(dg,"isHidden");function fg(t){return t.tagName==="INPUT"&&typeof t.select=="function"}vt(fg,"isSelectableInput");function gr(t,{select:r=!1}={}){if(t&&t.focus){const a=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==a&&fg(t)&&r&&t.select()}}vt(gr,"focus");var hg=mg();function mg(){let t=[];return{add(r){const i=t[0];r!==i&&i?.pause(),t=Wu(t,r),t.unshift(r)},remove(r){t=Wu(t,r),t[0]?.resume()}}}vt(mg,"createFocusScopesStack");function Wu(t,r){const i=[...t],a=i.indexOf(r);return a!==-1&&i.splice(a,1),i}vt(Wu,"arrayRemove");function pg(t){return t.filter(r=>r.tagName!=="A")}vt(pg,"removeLinks");var Dw=Object.defineProperty,Iw=(t,r)=>Dw(t,"name",{value:r,configurable:!0}),Ju=E.forwardRef(Iw(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?Xr.createPortal(f.jsx(He.div,{...c,ref:i}),d):null},"Portal")),kw=Object.defineProperty,ed=(t,r)=>kw(t,"name",{value:r,configurable:!0}),cl=0,ga=null;function Lw(t){return ul(),t.children}ed(Lw,"FocusGuards");function ul(){E.useEffect(()=>{ga||(ga={start:td(),end:td()});const{start:t,end:r}=ga;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==r&&document.body.insertAdjacentElement("beforeend",r),cl++,()=>{cl===1&&(ga?.start.remove(),ga?.end.remove(),ga=null),cl=Math.max(0,cl-1)}},[])}ed(ul,"useFocusGuards");function td(){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}ed(td,"createFocusGuard");var Jn=function(){return Jn=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},Jn.apply(this,arguments)};function gg(t,r){var i={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(t);c<a.length;c++)r.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(t,a[c])&&(i[a[c]]=t[a[c]]);return i}function zw(t,r,i){if(i||arguments.length===2)for(var a=0,c=r.length,l;a<c;a++)(l||!(a in r))&&(l||(l=Array.prototype.slice.call(r,0,a)),l[a]=r[a]);return t.concat(l||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;var dl="right-scroll-bar-position",fl="width-before-scroll-bar",Bw="with-scroll-bars-hidden",Hw="--removed-body-scroll-bar-size";function nd(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function Pw(t,r){var i=E.useState(function(){return{value:t,callback:r,facade:{get current(){return i.value},set current(a){var c=i.value;c!==a&&(i.value=a,i.callback(a,c))}}}})[0];return i.callback=r,i.facade}var Uw=typeof window<"u"?E.useLayoutEffect:E.useEffect,yg=new WeakMap;function $w(t,r){var i=Pw(null,function(a){return t.forEach(function(c){return nd(c,a)})});return Uw(function(){var a=yg.get(i);if(a){var c=new Set(a),l=new Set(t),u=i.current;c.forEach(function(d){l.has(d)||nd(d,null)}),l.forEach(function(d){c.has(d)||nd(d,u)})}yg.set(i,t)},[t]),i}function Gw(t){return t}function Vw(t,r){r===void 0&&(r=Gw);var i=[],a=!1,c={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:t},useMedium:function(l){var u=r(l,a);return i.push(u),function(){i=i.filter(function(d){return d!==u})}},assignSyncMedium:function(l){for(a=!0;i.length;){var u=i;i=[],u.forEach(l)}i={push:function(d){return l(d)},filter:function(){return i}}},assignMedium:function(l){a=!0;var u=[];if(i.length){var d=i;i=[],d.forEach(l),u=i}var m=function(){var C=u;u=[],C.forEach(l)},p=function(){return Promise.resolve().then(m)};p(),i={push:function(C){u.push(C),p()},filter:function(C){return u=u.filter(C),i}}}};return c}function qw(t){t===void 0&&(t={});var r=Vw(null);return r.options=Jn({async:!0,ssr:!1},t),r}var xg=function(t){var r=t.sideCar,i=gg(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=r.read();if(!a)throw new Error("Sidecar medium not found");return E.createElement(a,Jn({},i))};xg.isSideCarExport=!0;function Yw(t,r){return t.useMedium(r),xg}var bg=qw(),rd=function(){},hl=E.forwardRef(function(t,r){var i=E.useRef(null),a=E.useState({onScrollCapture:rd,onWheelCapture:rd,onTouchMoveCapture:rd}),c=a[0],l=a[1],u=t.forwardProps,d=t.children,m=t.className,p=t.removeScrollBar,C=t.enabled,g=t.shards,x=t.sideCar,b=t.noRelative,v=t.noIsolation,S=t.inert,w=t.allowPinchZoom,T=t.as,j=T===void 0?"div":T,N=t.gapMode,M=gg(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=x,O=$w([i,r]),_=Jn(Jn({},M),c);return E.createElement(E.Fragment,null,C&&E.createElement(D,{sideCar:bg,removeScrollBar:p,shards:g,noRelative:b,noIsolation:v,inert:S,setCallbacks:l,allowPinchZoom:!!w,lockRef:i,gapMode:N}),u?E.cloneElement(E.Children.only(d),Jn(Jn({},_),{ref:O})):E.createElement(j,Jn({},_,{className:m,ref:O}),d))});hl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},hl.classNames={fullWidth:fl,zeroRight:dl};var Xw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Kw(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=Xw();return r&&t.setAttribute("nonce",r),t}function Fw(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function Qw(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var Zw=function(){var t=0,r=null;return{add:function(i){t==0&&(r=Kw())&&(Fw(r,i),Qw(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},Ww=function(){var t=Zw();return function(r,i){E.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&i])}},vg=function(){var t=Ww(),r=function(i){var a=i.styles,c=i.dynamic;return t(a,c),null};return r},Jw={left:0,top:0,right:0,gap:0},od=function(t){return parseInt(t||"",10)||0},eE=function(t){var r=window.getComputedStyle(document.body),i=r[t==="padding"?"paddingLeft":"marginLeft"],a=r[t==="padding"?"paddingTop":"marginTop"],c=r[t==="padding"?"paddingRight":"marginRight"];return[od(i),od(a),od(c)]},tE=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Jw;var r=eE(t),i=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-i+r[2]-r[0])}},nE=vg(),ya="data-scroll-locked",rE=function(t,r,i,a){var c=t.left,l=t.top,u=t.right,d=t.gap;return i===void 0&&(i="margin"),`
|
|
52
52
|
.`.concat(Bw,` {
|
|
53
53
|
overflow: hidden `).concat(a,`;
|
|
54
54
|
padding-right: `).concat(d,"px ").concat(a,`;
|
|
55
55
|
}
|
|
56
|
-
body[`).concat(
|
|
56
|
+
body[`).concat(ya,`] {
|
|
57
57
|
overflow: hidden `).concat(a,`;
|
|
58
58
|
overscroll-behavior: contain;
|
|
59
59
|
`).concat([r&&"position: relative ".concat(a,";"),i==="margin"&&`
|
|
@@ -66,29 +66,29 @@ Error generating stack: `+o.message+`
|
|
|
66
66
|
`),i==="padding"&&"padding-right: ".concat(d,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.`).concat(
|
|
69
|
+
.`).concat(dl,` {
|
|
70
70
|
right: `).concat(d,"px ").concat(a,`;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.`).concat(
|
|
73
|
+
.`).concat(fl,` {
|
|
74
74
|
margin-right: `).concat(d,"px ").concat(a,`;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
.`).concat(
|
|
77
|
+
.`).concat(dl," .").concat(dl,` {
|
|
78
78
|
right: 0 `).concat(a,`;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.`).concat(
|
|
81
|
+
.`).concat(fl," .").concat(fl,` {
|
|
82
82
|
margin-right: 0 `).concat(a,`;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
body[`).concat(
|
|
85
|
+
body[`).concat(ya,`] {
|
|
86
86
|
`).concat(Hw,": ").concat(d,`px;
|
|
87
87
|
}
|
|
88
|
-
`)},Sg=function(){var t=parseInt(document.body.getAttribute(
|
|
88
|
+
`)},Sg=function(){var t=parseInt(document.body.getAttribute(ya)||"0",10);return isFinite(t)?t:0},oE=function(){E.useEffect(function(){return document.body.setAttribute(ya,(Sg()+1).toString()),function(){var t=Sg()-1;t<=0?document.body.removeAttribute(ya):document.body.setAttribute(ya,t.toString())}},[])},aE=function(t){var r=t.noRelative,i=t.noImportant,a=t.gapMode,c=a===void 0?"margin":a;oE();var l=E.useMemo(function(){return tE(c)},[c]);return E.createElement(nE,{styles:rE(l,!r,c,i?"":"!important")})},ad=!1;if(typeof window<"u")try{var ml=Object.defineProperty({},"passive",{get:function(){return ad=!0,!0}});window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{ad=!1}var xa=ad?{passive:!1}:!1,iE=function(t){return t.tagName==="TEXTAREA"},Cg=function(t,r){if(!(t instanceof Element))return!1;var i=window.getComputedStyle(t);return i[r]!=="hidden"&&!(i.overflowY===i.overflowX&&!iE(t)&&i[r]==="visible")},sE=function(t){return Cg(t,"overflowY")},lE=function(t){return Cg(t,"overflowX")},wg=function(t,r){var i=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var c=Eg(t,a);if(c){var l=Tg(t,a),u=l[1],d=l[2];if(u>d)return!0}a=a.parentNode}while(a&&a!==i.body);return!1},cE=function(t){var r=t.scrollTop,i=t.scrollHeight,a=t.clientHeight;return[r,i,a]},uE=function(t){var r=t.scrollLeft,i=t.scrollWidth,a=t.clientWidth;return[r,i,a]},Eg=function(t,r){return t==="v"?sE(r):lE(r)},Tg=function(t,r){return t==="v"?cE(r):uE(r)},dE=function(t,r){return t==="h"&&r==="rtl"?-1:1},fE=function(t,r,i,a,c){var l=dE(t,window.getComputedStyle(r).direction),u=l*a,d=i.target,m=r.contains(d),p=!1,C=u>0,g=0,x=0;do{if(!d)break;var b=Tg(t,d),v=b[0],S=b[1],w=b[2],T=S-w-l*v;(v||T)&&Eg(t,d)&&(g+=T,x+=v);var j=d.parentNode;d=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!m&&d!==document.body||m&&(r.contains(d)||r===d));return(C&&Math.abs(g)<1||!C&&Math.abs(x)<1)&&(p=!0),p},pl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},jg=function(t){return[t.deltaX,t.deltaY]},Ag=function(t){return t&&"current"in t?t.current:t},hE=function(t,r){return t[0]===r[0]&&t[1]===r[1]},mE=function(t){return`
|
|
89
89
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
90
90
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
91
|
-
`)},pE=0,Sa=[];function gE(t){var r=E.useRef([]),i=E.useRef([0,0]),a=E.useRef(),c=E.useState(pE++)[0],l=E.useState(vg)[0],u=E.useRef(t);E.useEffect(function(){u.current=t},[t]),E.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(c));var S=zw([t.lockRef.current],(t.shards||[]).map(Ag),!0).filter(Boolean);return S.forEach(function(w){return w.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(c))})}}},[t.inert,t.lockRef.current,t.shards]);var d=E.useCallback(function(S,w){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var T=gl(S),j=i.current,R="deltaX"in S?S.deltaX:j[0]-T[0],O="deltaY"in S?S.deltaY:j[1]-T[1],M,D=S.target,_=Math.abs(R)>Math.abs(O)?"h":"v";if("touches"in S&&_==="h"&&D.type==="range")return!1;var I=window.getSelection(),B=I&&I.anchorNode,H=B?B===D||B.contains(D):!1;if(H)return!1;var z=wg(_,D);if(!z)return!0;if(z?M=_:(M=_==="v"?"h":"v",z=wg(_,D)),!z)return!1;if(!a.current&&"changedTouches"in S&&(R||O)&&(a.current=M),!M)return!0;var $=a.current||M;return fE($,w,S,$==="h"?R:O)},[]),m=E.useCallback(function(S){var w=S;if(!(!Sa.length||Sa[Sa.length-1]!==l)){var T="deltaY"in w?jg(w):gl(w),j=r.current.filter(function(M){return M.name===w.type&&(M.target===w.target||w.target===M.shadowParent)&&hE(M.delta,T)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var R=(u.current.shards||[]).map(Ag).filter(Boolean).filter(function(M){return M.contains(w.target)}),O=R.length>0?d(w,R[0]):!u.current.noIsolation;O&&w.cancelable&&w.preventDefault()}}},[]),p=E.useCallback(function(S,w,T,j){var R={name:S,delta:w,target:T,should:j,shadowParent:yE(T)};r.current.push(R),setTimeout(function(){r.current=r.current.filter(function(O){return O!==R})},1)},[]),C=E.useCallback(function(S){i.current=gl(S),a.current=void 0},[]),g=E.useCallback(function(S){p(S.type,jg(S),S.target,d(S,t.lockRef.current))},[]),b=E.useCallback(function(S){p(S.type,gl(S),S.target,d(S,t.lockRef.current))},[]);E.useEffect(function(){return Sa.push(l),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,va),document.addEventListener("touchmove",m,va),document.addEventListener("touchstart",C,va),function(){Sa=Sa.filter(function(S){return S!==l}),document.removeEventListener("wheel",m,va),document.removeEventListener("touchmove",m,va),document.removeEventListener("touchstart",C,va)}},[]);var x=t.removeScrollBar,v=t.inert;return E.createElement(E.Fragment,null,v?E.createElement(l,{styles:mE(c)}):null,x?E.createElement(aE,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function yE(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const bE=Yw(xg,gE);var sd=E.forwardRef(function(t,r){return E.createElement(ml,Wn({},t,{ref:r,sideCar:bE}))});sd.classNames=ml.classNames;var xE=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},Ca=new WeakMap,yl=new WeakMap,bl={},ld=0,Rg=function(t){return t&&(t.host||Rg(t.parentNode))},vE=function(t,r){return r.map(function(i){if(t.contains(i))return i;var a=Rg(i);return a&&t.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},SE=function(t,r,i,a){var c=vE(r,Array.isArray(t)?t:[t]);bl[i]||(bl[i]=new WeakMap);var l=bl[i],u=[],d=new Set,m=new Set(c),p=function(g){!g||d.has(g)||(d.add(g),p(g.parentNode))};c.forEach(p);var C=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(d.has(b))C(b);else try{var x=b.getAttribute(a),v=x!==null&&x!=="false",S=(Ca.get(b)||0)+1,w=(l.get(b)||0)+1;Ca.set(b,S),l.set(b,w),u.push(b),S===1&&v&&yl.set(b,!0),w===1&&b.setAttribute(i,"true"),v||b.setAttribute(a,"true")}catch(T){console.error("aria-hidden: cannot operate on ",b,T)}})};return C(r),d.clear(),ld++,function(){u.forEach(function(g){var b=Ca.get(g)-1,x=l.get(g)-1;Ca.set(g,b),l.set(g,x),b||(yl.has(g)||g.removeAttribute(a),yl.delete(g)),x||g.removeAttribute(i)}),ld--,ld||(Ca=new WeakMap,Ca=new WeakMap,yl=new WeakMap,bl={})}},Og=function(t,r,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),c=xE(t);return c?(a.push.apply(a,Array.from(c.querySelectorAll("[aria-live], script"))),SE(a,c,i,"aria-hidden")):function(){return null}},CE=Object.defineProperty,jn=(t,r)=>CE(t,"name",{value:r,configurable:!0}),cd="Dialog",[Ng,IM]=Tn(cd),[wE,gr]=Ng(cd),EE=jn(t=>{const{__scopeDialog:r,children:i,open:a,defaultOpen:c,onOpenChange:l,modal:u=!0}=t,d=E.useRef(null),m=E.useRef(null),{nodes:p,registry:C}=sg(),[g,b]=fr({prop:a,defaultProp:c??!1,onChange:l,caller:cd}),[x,v]=E.useState(0),[S,w]=E.useState(0);return f.jsx(wE,{scope:r,triggerRef:d,contentRef:m,contentId:mr(),titleId:mr(),descriptionId:mr(),titlePresent:x>0,descriptionPresent:S>0,setTitleCount:v,setDescriptionCount:w,open:g,onOpenChange:b,onOpenToggle:E.useCallback(()=>b(T=>!T),[b]),modal:u,branchNodes:p,branchRegistry:C,children:i})},"Dialog"),Mg="DialogPortal",[TE,_g]=Ng(Mg,{forceMount:void 0}),jE=jn(t=>{const{__scopeDialog:r,forceMount:i,children:a,container:c}=t,l=gr(Mg,r);return f.jsx(TE,{scope:r,forceMount:i,children:E.Children.map(a,u=>f.jsx(Fr,{present:i||l.open,children:f.jsx(ed,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),ud="DialogOverlay",AE=E.forwardRef(jn(function(r,i){const a=_g(ud,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=gr(ud,r.__scopeDialog);return u.modal?f.jsx(Fr,{present:c||u.open,children:f.jsx(OE,{...l,ref:i})}):null},"DialogOverlay")),RE=dr("DialogOverlay.RemoveScroll"),OE=E.forwardRef(jn(function(r,i){const{__scopeDialog:a,...c}=r,l=gr(ud,a),u=eg(),d=ke(i,u);return f.jsx(sd,{as:RE,allowPinchZoom:!0,shards:E.useMemo(()=>[l.contentRef,...l.branchNodes.map(m=>({current:m}))],[l.contentRef,l.branchNodes]),children:f.jsx(He.div,{"data-state":fd(l.open),...c,ref:d,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),ki="DialogContent",NE=E.forwardRef(jn(function(r,i){const a=_g(ki,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=gr(ki,r.__scopeDialog);return f.jsx(Fr,{present:c||u.open,children:u.modal?f.jsx(ME,{...l,ref:i}):f.jsx(_E,{...l,ref:i})})},"DialogContent")),ME=E.forwardRef(jn(function(r,i){const a=gr(ki,r.__scopeDialog),c=E.useRef(null),l=ke(i,a.contentRef,c);return E.useEffect(()=>{const u=c.current;if(u)return Og(u)},[]),f.jsx(Dg,{...r,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Ce(r.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Ce(r.onPointerDownOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&u.preventDefault()}),onFocusOutside:Ce(r.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),_E=E.forwardRef(jn(function(r,i){const a=gr(ki,r.__scopeDialog),c=E.useRef(!1),l=E.useRef(!1);return f.jsx(Dg,{...r,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{r.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||a.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,l.current=!1},onInteractOutside:u=>{r.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"DialogContentNonModal")),Dg=E.forwardRef(jn(function(r,i){const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:u,"aria-describedby":d,children:m,...p}=r,C=gr(ki,a);return dl(),f.jsx(ig,{registry:C.branchRegistry,children:f.jsx(og,{asChild:!0,loop:!0,trapped:c,branches:C.branchNodes,onMountAutoFocus:l,onUnmountAutoFocus:u,children:f.jsx(Yu,{role:"dialog",id:C.contentId,"aria-labelledby":C.titlePresent?C.titleId:void 0,"aria-describedby":C.descriptionPresent?Ig(d,C.descriptionId):d,"data-state":fd(C.open),...p,ref:i,deferPointerDownOutside:!0,onDismiss:()=>C.onOpenChange(!1),children:m})})})},"DialogContentImpl")),DE=E.forwardRef(jn(function(r,i){const{__scopeDialog:a,...c}=r,l=gr("DialogTitle",a),{setTitleCount:u}=l;return lt(()=>(u(d=>d+1),()=>u(d=>d-1)),[u]),f.jsx(He.h2,{id:l.titleId,...c,ref:i})},"DialogTitle")),IE="DialogClose",dd=E.forwardRef(jn(function(r,i){const{__scopeDialog:a,...c}=r,l=gr(IE,a);return f.jsx(He.button,{type:"button",...c,ref:i,onClick:Ce(r.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Ig(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}jn(Ig,"concatAriaDescribedby");function fd(t){return t?"open":"closed"}jn(fd,"getState");var kE=Object.defineProperty,LE=(t,r)=>kE(t,"name",{value:r,configurable:!0});function Li(t){const[r,i]=E.useState(void 0);return lt(()=>{if(t){i({width:t.offsetWidth,height:t.offsetHeight});let a=0;const c=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];window.cancelAnimationFrame(a),a=window.requestAnimationFrame(()=>{let d,m;if("borderBoxSize"in u){const p=u.borderBoxSize,C=Array.isArray(p)?p[0]:p;d=C.inlineSize,m=C.blockSize}else d=t.offsetWidth,m=t.offsetHeight;i({width:d,height:m})})});return c.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(a),c.unobserve(t)}}else i(void 0)},[t]),r}LE(Li,"useSize");var zE=Object.defineProperty,yr=(t,r)=>zE(t,"name",{value:r,configurable:!0}),hd="Checkbox",[BE,kM]=Tn(hd),[HE,md]=BE(hd);function kg(t){const{__scopeCheckbox:r,checked:i,children:a,defaultChecked:c,disabled:l,form:u,name:d,onCheckedChange:m,required:p,value:C="on",internal_do_not_use_render:g}=t,[b,x]=fr({prop:i,defaultProp:c??!1,onChange:m,caller:hd}),[v,S]=E.useState(null),[w,T]=E.useState(null),[j,R]=E.useState(null),O=v?!!u||!!v.closest("form"):!0,M={checked:b,disabled:l,setChecked:x,control:v,setControl:S,name:d,form:u,value:C,userClick:j,onUserClick:R,required:p,defaultChecked:An(c)?!1:c,isFormControl:O,bubbleInput:w,setBubbleInput:T};return f.jsx(HE,{scope:r,...M,children:Lg(g)?g(M):a})}yr(kg,"CheckboxProvider");var PE="CheckboxTrigger",UE=E.forwardRef(yr(function({__scopeCheckbox:r,onKeyDown:i,onClick:a,...c},l){const{control:u,value:d,disabled:m,checked:p,required:C,setControl:g,setChecked:b,onUserClick:x,isFormControl:v,bubbleInput:S}=md(PE,r),w=ke(l,g),T=E.useRef(p);return E.useEffect(()=>{const j=u?.form;if(j){const R=yr(()=>b(T.current),"reset");return j.addEventListener("reset",R),()=>j.removeEventListener("reset",R)}},[u,b]),f.jsx(He.button,{type:"button",role:"checkbox","aria-checked":An(p)?"mixed":p,"aria-required":C,"data-state":pd(p),"data-disabled":m?"":void 0,disabled:m,value:d,...c,ref:w,onKeyDown:Ce(i,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ce(a,j=>{const R=j.isPropagationStopped();x({requestedChecked:An(p)?!0:!p,hasConsumerStoppedPropagation:R}),b(O=>An(O)?!0:!O),S&&v&&(R||j.stopPropagation())})})},"CheckboxTrigger")),$E=E.forwardRef(yr(function(r,i){const{__scopeCheckbox:a,name:c,checked:l,defaultChecked:u,required:d,disabled:m,value:p,onCheckedChange:C,form:g,...b}=r;return f.jsx(kg,{__scopeCheckbox:a,checked:l,defaultChecked:u,disabled:m,required:d,onCheckedChange:C,name:c,form:g,value:p,internal_do_not_use_render:({isFormControl:x})=>f.jsxs(f.Fragment,{children:[f.jsx(UE,{...b,ref:i,__scopeCheckbox:a}),x&&f.jsx(YE,{__scopeCheckbox:a})]})})},"Checkbox")),GE="CheckboxIndicator",VE=E.forwardRef(yr(function(r,i){const{__scopeCheckbox:a,forceMount:c,...l}=r,u=md(GE,a);return f.jsx(Fr,{present:c||An(u.checked)||u.checked===!0,children:f.jsx(He.span,{"data-state":pd(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),qE="CheckboxBubbleInput",YE=E.forwardRef(yr(function({__scopeCheckbox:r,onClick:i,...a},c){const{control:l,userClick:u,checked:d,defaultChecked:m,required:p,disabled:C,name:g,value:b,form:x,bubbleInput:v,setBubbleInput:S}=md(qE,r),w=ke(c,S),T=Li(l),j=E.useRef(!1),R=E.useRef(d),O=E.useRef(u),M=E.useRef(null);E.useEffect(()=>{const _=v;if(!_)return;const I=window.HTMLInputElement.prototype,H=Object.getOwnPropertyDescriptor(I,"checked").set;if(!H)return;const z=R.current!==d;R.current=d;const $=u!==null&&u!==O.current;if(O.current=u,$)M.current=z?null:u,z&&(_.indeterminate=An(d),H.call(_,An(d)?!1:d)),_.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(z){const X=M.current;M.current=null;const G=X?.requestedChecked===d;j.current=!0,_.indeterminate=An(d),H.call(_,An(d)?!1:d),_.dispatchEvent(new Event("click",{bubbles:!(G&&X.hasConsumerStoppedPropagation)})),j.current=!1}},[v,d,u]);const D=E.useRef(An(d)?!1:d);return f.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??D.current,required:p,disabled:C,name:g,value:b,form:x,...a,tabIndex:-1,ref:w,onClick:Ce(i,_=>{j.current&&_.stopPropagation()}),style:{...a.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Lg(t){return typeof t=="function"}yr(Lg,"isFunction");function An(t){return t==="indeterminate"}yr(An,"isIndeterminate");function pd(t){return An(t)?"indeterminate":t?"checked":"unchecked"}yr(pd,"getState");const XE=["top","right","bottom","left"],Qr=Math.min,br=Math.max,xl=Math.round,vl=Math.floor,xr=t=>({x:t,y:t}),KE={left:"right",right:"left",bottom:"top",top:"bottom"};function zg(t,r,i){return br(t,Qr(r,i))}function vr(t,r){return typeof t=="function"?t(r):t}function Zr(t){return t.split("-")[0]}function wa(t){return t.split("-")[1]}function gd(t){return t==="x"?"y":"x"}function yd(t){return t==="y"?"height":"width"}function Jn(t){const r=t[0];return r==="t"||r==="b"?"y":"x"}function bd(t){return gd(Jn(t))}function FE(t,r,i){i===void 0&&(i=!1);const a=wa(t),c=bd(t),l=yd(c);let u=c==="x"?a===(i?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[l]>r.floating[l]&&(u=Sl(u)),[u,Sl(u)]}function QE(t){const r=Sl(t);return[xd(t),r,xd(r)]}function xd(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Bg=["left","right"],Hg=["right","left"],ZE=["top","bottom"],WE=["bottom","top"];function JE(t,r,i){switch(t){case"top":case"bottom":return i?r?Hg:Bg:r?Bg:Hg;case"left":case"right":return r?ZE:WE;default:return[]}}function eT(t,r,i,a){const c=wa(t);let l=JE(Zr(t),i==="start",a);return c&&(l=l.map(u=>u+"-"+c),r&&(l=l.concat(l.map(xd)))),l}function Sl(t){const r=Zr(t);return KE[r]+t.slice(r.length)}function tT(t){var r,i,a,c;return{top:(r=t.top)!=null?r:0,right:(i=t.right)!=null?i:0,bottom:(a=t.bottom)!=null?a:0,left:(c=t.left)!=null?c:0}}function Pg(t){return typeof t!="number"?tT(t):{top:t,right:t,bottom:t,left:t}}function Cl(t){const{x:r,y:i,width:a,height:c}=t;return{width:a,height:c,top:i,left:r,right:r+a,bottom:i+c,x:r,y:i}}function Ug(t,r,i){let{reference:a,floating:c}=t;const l=Jn(r),u=bd(r),d=yd(u),m=Zr(r),p=l==="y",C=a.x+a.width/2-c.width/2,g=a.y+a.height/2-c.height/2,b=a[d]/2-c[d]/2;let x;switch(m){case"top":x={x:C,y:a.y-c.height};break;case"bottom":x={x:C,y:a.y+a.height};break;case"right":x={x:a.x+a.width,y:g};break;case"left":x={x:a.x-c.width,y:g};break;default:x={x:a.x,y:a.y}}const v=wa(r);return v&&(x[u]+=b*(v==="end"?1:-1)*(i&&p?-1:1)),x}async function nT(t,r){var i;r===void 0&&(r={});const{x:a,y:c,platform:l,rects:u,elements:d,strategy:m}=t,{boundary:p="clippingAncestors",rootBoundary:C="viewport",elementContext:g="floating",altBoundary:b=!1,padding:x=0}=vr(r,t),v=Pg(x),w=d[b?g==="floating"?"reference":"floating":g],T=Cl(await l.getClippingRect({element:(i=await(l.isElement==null?void 0:l.isElement(w)))==null||i?w:w.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:C,strategy:m})),j=g==="floating"?{x:a,y:c,width:u.floating.width,height:u.floating.height}:u.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),O=await(l.isElement==null?void 0:l.isElement(R))&&await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1},M=Cl(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:j,offsetParent:R,strategy:m}):j);return{top:(T.top-M.top+v.top)/O.y,bottom:(M.bottom-T.bottom+v.bottom)/O.y,left:(T.left-M.left+v.left)/O.x,right:(M.right-T.right+v.right)/O.x}}const rT=50,oT=async(t,r,i)=>{const{placement:a="bottom",strategy:c="absolute",middleware:l=[],platform:u}=i,d=u.detectOverflow?u:{...u,detectOverflow:nT},m=await(u.isRTL==null?void 0:u.isRTL(r));let p=await u.getElementRects({reference:t,floating:r,strategy:c}),{x:C,y:g}=Ug(p,a,m),b=a,x=0;const v={};for(let S=0;S<l.length;S++){const w=l[S];if(!w)continue;const{name:T,fn:j}=w,{x:R,y:O,data:M,reset:D}=await j({x:C,y:g,initialPlacement:a,placement:b,strategy:c,middlewareData:v,rects:p,platform:d,elements:{reference:t,floating:r}});C=R??C,g=O??g,v[T]={...v[T],...M},D&&x<rT&&(x++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(p=D.rects===!0?await u.getElementRects({reference:t,floating:r,strategy:c}):D.rects),{x:C,y:g}=Ug(p,b,m)),S=-1)}return{x:C,y:g,placement:b,strategy:c,middlewareData:v}},aT=t=>({name:"arrow",options:t,async fn(r){const{x:i,y:a,placement:c,rects:l,platform:u,elements:d,middlewareData:m}=r,{element:p,padding:C=0}=vr(t,r)||{};if(p==null)return{};const g=Pg(C),b={x:i,y:a},x=bd(c),v=yd(x),S=await u.getDimensions(p),w=x==="y",T=w?"top":"left",j=w?"bottom":"right",R=w?"clientHeight":"clientWidth",O=l.reference[v]+l.reference[x]-b[x]-l.floating[v],M=b[x]-l.reference[x],D=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let _=D?D[R]:0;(!_||!await(u.isElement==null?void 0:u.isElement(D)))&&(_=d.floating[R]||l.floating[v]);const I=O/2-M/2,B=_/2-S[v]/2-1,H=Qr(g[T],B),z=Qr(g[j],B),$=_-S[v]-z,X=_/2-S[v]/2+I,G=zg(H,X,$),te=!m.arrow&&wa(c)!=null&&X!==G&&l.reference[v]/2-(X<H?H:z)-S[v]/2<0,V=te?X<H?X-H:X-$:0;return{[x]:b[x]+V,data:{[x]:G,centerOffset:X-G-V,...te&&{alignmentOffset:V}},reset:te}}}),iT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var i,a;const{placement:c,middlewareData:l,rects:u,initialPlacement:d,platform:m,elements:p}=r,{mainAxis:C=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:S=!0,...w}=vr(t,r);if((i=l.arrow)!=null&&i.alignmentOffset)return{};const T=Zr(c),j=Jn(d),R=Zr(d)===d,O=await(m.isRTL==null?void 0:m.isRTL(p.floating)),M=b||(R||!S?[Sl(d)]:QE(d)),D=v!=="none";!b&&D&&M.push(...eT(d,S,v,O));const _=[d,...M],I=await m.detectOverflow(r,w),B=[];let H=((a=l.flip)==null?void 0:a.overflows)||[];if(C&&B.push(I[T]),g){const G=FE(c,u,O);B.push(I[G[0]],I[G[1]])}if(H=[...H,{placement:c,overflows:B}],!B.every(G=>G<=0)){var z,$;const G=(((z=l.flip)==null?void 0:z.index)||0)+1,te=_[G];if(te&&(!(g==="alignment"?j!==Jn(te):!1)||H.every(L=>Jn(L.placement)===j?L.overflows[0]>0:!0)))return{data:{index:G,overflows:H},reset:{placement:te}};let V=($=H.filter(Y=>Y.overflows[0]<=0).sort((Y,L)=>Y.overflows[1]-L.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(x){case"bestFit":{var X;const Y=(X=H.filter(L=>{if(D){const P=Jn(L.placement);return P===j||P==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(P=>P>0).reduce((P,N)=>P+N,0)]).sort((L,P)=>L[1]-P[1])[0])==null?void 0:X[0];Y&&(V=Y);break}case"initialPlacement":V=d;break}if(c!==V)return{reset:{placement:V}}}return{}}}};function $g(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function Gg(t){return XE.some(r=>t[r]>=0)}const sT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:i,platform:a}=r,{strategy:c="referenceHidden",...l}=vr(t,r);switch(c){case"referenceHidden":{const u=await a.detectOverflow(r,{...l,elementContext:"reference"}),d=$g(u,i.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Gg(d)}}}case"escaped":{const u=await a.detectOverflow(r,{...l,altBoundary:!0}),d=$g(u,i.floating);return{data:{escapedOffsets:d,escaped:Gg(d)}}}default:return{}}}}},Vg=new Set(["left","top"]);async function lT(t,r){const{placement:i,platform:a,elements:c}=t,l=await(a.isRTL==null?void 0:a.isRTL(c.floating)),u=Zr(i),d=wa(i),m=Jn(i)==="y",p=Vg.has(u)?-1:1,C=l&&m?-1:1,g=vr(r,t);let{mainAxis:b,crossAxis:x,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof v=="number"&&(x=d==="end"?v*-1:v),m?{x:x*C,y:b*p}:{x:b*p,y:x*C}}const cT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var i,a;const{x:c,y:l,placement:u,middlewareData:d}=r,m=await lT(r,t);return u===((i=d.offset)==null?void 0:i.placement)&&(a=d.arrow)!=null&&a.alignmentOffset?{}:{x:c+m.x,y:l+m.y,data:{...m,placement:u}}}}},uT=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:i,y:a,placement:c,platform:l}=r,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:j=>{let{x:R,y:O}=j;return{x:R,y:O}}},...p}=vr(t,r),C={x:i,y:a},g=await l.detectOverflow(r,p),b=Jn(c),x=gd(b);let v=C[x],S=C[b];const w=(j,R)=>zg(R+g[j==="y"?"top":"left"],R,R-g[j==="y"?"bottom":"right"]);u&&(v=w(x,v)),d&&(S=w(b,S));const T=m.fn({...r,[x]:v,[b]:S});return{...T,data:{x:T.x-i,y:T.y-a,enabled:{[x]:u,[b]:d}}}}}},dT=function(t){return t===void 0&&(t={}),{options:t,fn(r){var i,a;const{x:c,y:l,placement:u,rects:d,middlewareData:m}=r,{offset:p=0,mainAxis:C=!0,crossAxis:g=!0}=vr(t,r),b={x:c,y:l},x=Jn(u),v=gd(x);let S=b[v],w=b[x];const T=vr(p,r),j=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(i=T.mainAxis)!=null?i:0,crossAxis:(a=T.crossAxis)!=null?a:0};if(C){const M=v==="y"?"height":"width",D=d.reference[v]-d.floating[M]+j.mainAxis,_=d.reference[v]+d.reference[M]-j.mainAxis;S<D?S=D:S>_&&(S=_)}if(g){var R,O;const M=v==="y"?"width":"height",D=Vg.has(Zr(u)),_=d.reference[x]-d.floating[M]+(D&&((R=m.offset)==null?void 0:R[x])||0)+(D?0:j.crossAxis),I=d.reference[x]+d.reference[M]+(D?0:((O=m.offset)==null?void 0:O[x])||0)-(D?j.crossAxis:0);w<_?w=_:w>I&&(w=I)}return{[v]:S,[x]:w}}}},fT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){const{placement:i,rects:a,platform:c,elements:l}=r,{apply:u=()=>{},...d}=vr(t,r),m=await c.detectOverflow(r,d),p=Zr(i),C=wa(i),g=Jn(i)==="y",{width:b,height:x}=a.floating;let v,S;p==="top"||p==="bottom"?(v=p,S=C===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(S=p,v=C==="end"?"top":"bottom");const w=x-m.top-m.bottom,T=b-m.left-m.right,j=Qr(x-m[v],w),R=Qr(b-m[S],T),O=r.middlewareData.shift,M=!O;let D=j,_=R;O!=null&&O.enabled.x&&(_=T),O!=null&&O.enabled.y&&(D=w),M&&!C&&(g?_=b-2*br(m.left,m.right):D=x-2*br(m.top,m.bottom)),await u({...r,availableWidth:_,availableHeight:D});const I=await c.getDimensions(l.floating);return b!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function wl(){return typeof window<"u"}function Ea(t){return qg(t)?(t.nodeName||"").toLowerCase():"#document"}function nn(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Sr(t){var r;return(r=(qg(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function qg(t){return wl()?t instanceof Node||t instanceof nn(t).Node:!1}function er(t){return wl()?t instanceof Element||t instanceof nn(t).Element:!1}function Wr(t){return wl()?t instanceof HTMLElement||t instanceof nn(t).HTMLElement:!1}function Yg(t){return!wl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof nn(t).ShadowRoot}function El(t){const{overflow:r,overflowX:i,overflowY:a,display:c}=tr(t);return/auto|scroll|overlay|hidden|clip/.test(r+a+i)&&c!=="inline"&&c!=="contents"}function hT(t){return/^(table|td|th)$/.test(Ea(t))}function Tl(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const mT=/transform|translate|scale|rotate|perspective|filter/,pT=/paint|layout|strict|content/,Do=t=>!!t&&t!=="none";let vd;function Sd(t){const r=er(t)?tr(t):t;return Do(r.transform)||Do(r.translate)||Do(r.scale)||Do(r.rotate)||Do(r.perspective)||!Cd()&&(Do(r.backdropFilter)||Do(r.filter))||mT.test(r.willChange||"")||pT.test(r.contain||"")}function gT(t){let r=Io(t);for(;Wr(r)&&!zi(r);){if(Sd(r))return r;if(Tl(r))return null;r=Io(r)}return null}function Cd(){return vd==null&&(vd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vd}function zi(t){return/^(html|body|#document)$/.test(Ea(t))}function tr(t){return nn(t).getComputedStyle(t)}function jl(t){return er(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Io(t){if(Ea(t)==="html")return t;const r=t.assignedSlot||t.parentNode||Yg(t)&&t.host||Sr(t);return Yg(r)?r.host:r}function Xg(t){const r=Io(t);return zi(r)?(t.ownerDocument||t).body:Wr(r)&&El(r)?r:Xg(r)}function Bi(t,r,i){var a;r===void 0&&(r=[]),i===void 0&&(i=!0);const c=Xg(t),l=c===((a=t.ownerDocument)==null?void 0:a.body),u=nn(c);if(l){const d=wd(u);return r.concat(u,u.visualViewport||[],El(c)?c:[],d&&i?Bi(d):[])}else return r.concat(c,Bi(c,[],i))}function wd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Kg(t){const r=tr(t);let i=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const c=Wr(t),l=c?t.offsetWidth:i,u=c?t.offsetHeight:a,d=xl(i)!==l||xl(a)!==u;return d&&(i=l,a=u),{width:i,height:a,$:d}}function Ed(t){return er(t)?t:t.contextElement}function Ta(t){const r=Ed(t);if(!Wr(r))return xr(1);const i=r.getBoundingClientRect(),{width:a,height:c,$:l}=Kg(r);let u=(l?xl(i.width):i.width)/a,d=(l?xl(i.height):i.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const yT=xr(0);function Fg(t){const r=nn(t);return!Cd()||!r.visualViewport?yT:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function bT(t,r,i){return r===void 0&&(r=!1),!!i&&r&&i===nn(t)}function ko(t,r,i,a){r===void 0&&(r=!1),i===void 0&&(i=!1);const c=t.getBoundingClientRect(),l=Ed(t);let u=xr(1);r&&(a?er(a)&&(u=Ta(a)):u=Ta(t));const d=bT(l,i,a)?Fg(l):xr(0);let m=(c.left+d.x)/u.x,p=(c.top+d.y)/u.y,C=c.width/u.x,g=c.height/u.y;if(l&&a){const b=nn(l),x=er(a)?nn(a):a;let v=b,S=wd(v);for(;S&&x!==v;){const w=Ta(S),T=S.getBoundingClientRect(),j=tr(S),R=T.left+(S.clientLeft+parseFloat(j.paddingLeft))*w.x,O=T.top+(S.clientTop+parseFloat(j.paddingTop))*w.y;m*=w.x,p*=w.y,C*=w.x,g*=w.y,m+=R,p+=O,v=nn(S),S=wd(v)}}return Cl({width:C,height:g,x:m,y:p})}function Al(t,r){const i=jl(t).scrollLeft;return r?r.left+i:ko(Sr(t)).left+i}function Qg(t,r){const i=t.getBoundingClientRect(),a=i.left+r.scrollLeft-Al(t,i),c=i.top+r.scrollTop;return{x:a,y:c}}function xT(t){let{elements:r,rect:i,offsetParent:a,strategy:c}=t;const l=c==="fixed",u=Sr(a),d=r?Tl(r.floating):!1;if(a===u||d&&l)return i;let m={scrollLeft:0,scrollTop:0},p=xr(1);const C=xr(0),g=Wr(a);if((g||!l)&&((Ea(a)!=="body"||El(u))&&(m=jl(a)),g)){const x=ko(a);p=Ta(a),C.x=x.x+a.clientLeft,C.y=x.y+a.clientTop}const b=u&&!g&&!l?Qg(u,m):xr(0);return{width:i.width*p.x,height:i.height*p.y,x:i.x*p.x-m.scrollLeft*p.x+C.x+b.x,y:i.y*p.y-m.scrollTop*p.y+C.y+b.y}}function vT(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function ST(t){const r=jl(t),i=t.ownerDocument.body,a=br(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),c=br(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-r.scrollLeft+Al(t);const u=-r.scrollTop;return tr(i).direction==="rtl"&&(l+=br(t.clientWidth,i.clientWidth)-a),{width:a,height:c,x:l,y:u}}const CT=25;function wT(t,r,i){i===void 0&&(i="viewport");const a=i==="layoutViewport",c=nn(t),l=Sr(t),u=c.visualViewport;let d=l.clientWidth,m=l.clientHeight,p=0,C=0;if(u){const b=!Cd()||r==="fixed";a?b||(p=-u.offsetLeft,C=-u.offsetTop):(d=u.width,m=u.height,b&&(p=u.offsetLeft,C=u.offsetTop))}if(Al(l)<=0){const b=l.ownerDocument,x=b.body,v=getComputedStyle(x),S=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(l.clientWidth-x.clientWidth-S),T=getComputedStyle(l).scrollbarGutter==="stable both-edges"?w/2:w;T<=CT&&(d-=T)}return{width:d,height:m,x:p,y:C}}function ET(t,r){const i=ko(t,!0,r==="fixed"),a=i.top+t.clientTop,c=i.left+t.clientLeft,l=Ta(t),u=t.clientWidth*l.x,d=t.clientHeight*l.y,m=c*l.x,p=a*l.y;return{width:u,height:d,x:m,y:p}}function Zg(t,r,i){let a;if(r==="viewport"||r==="layoutViewport")a=wT(t,i,r);else if(r==="document")a=ST(Sr(t));else if(er(r))a=ET(r,i);else{const c=Fg(t);a={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return Cl(a)}function TT(t,r){const i=r.get(t);if(i)return i;let a=Bi(t,[],!1).filter(d=>er(d)&&Ea(d)!=="body"),c=null;const l=tr(t).position==="fixed";let u=l?Io(t):t;for(;er(u)&&!zi(u);){const d=tr(u),m=Sd(u),p=c?c.position:l?"fixed":"";!m&&(p==="fixed"||p==="absolute"&&d.position==="static")?a=a.filter(g=>g!==u):c=d,u=Io(u)}return r.set(t,a),a}function jT(t){let{element:r,boundary:i,rootBoundary:a,strategy:c}=t;const u=[...i==="clippingAncestors"?Tl(r)?[]:TT(r,this._c):[].concat(i),a],d=Zg(r,u[0],c);let m=d.top,p=d.right,C=d.bottom,g=d.left;for(let b=1;b<u.length;b++){const x=Zg(r,u[b],c);m=br(x.top,m),p=Qr(x.right,p),C=Qr(x.bottom,C),g=br(x.left,g)}return{width:p-g,height:C-m,x:g,y:m}}function AT(t){const{width:r,height:i}=Kg(t);return{width:r,height:i}}function RT(t,r,i){const a=Wr(r),c=Sr(r),l=i==="fixed",u=ko(t,!0,l,r);let d={scrollLeft:0,scrollTop:0};const m=xr(0);if((a||!l)&&((Ea(r)!=="body"||El(c))&&(d=jl(r)),a)){const b=ko(r,!0,l,r);m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}!a&&c&&(m.x=Al(c));const p=c&&!a&&!l?Qg(c,d):xr(0),C=u.left+d.scrollLeft-m.x-p.x,g=u.top+d.scrollTop-m.y-p.y;return{x:C,y:g,width:u.width,height:u.height}}function Td(t){return tr(t).position==="static"}function Wg(t,r){if(!Wr(t)||tr(t).position==="fixed")return null;if(r)return r(t);let i=t.offsetParent;return Sr(t)===i&&(i=i.ownerDocument.body),i}function Jg(t,r){const i=nn(t);if(Tl(t))return i;if(!Wr(t)){let c=Io(t);for(;c&&!zi(c);){if(er(c)&&!Td(c))return c;c=Io(c)}return i}let a=Wg(t,r);for(;a&&hT(a)&&Td(a);)a=Wg(a,r);return a&&zi(a)&&Td(a)&&!Sd(a)?i:a||gT(t)||i}const OT=async function(t){const r=this.getOffsetParent||Jg,i=this.getDimensions,a=await i(t.floating);return{reference:RT(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function NT(t){return tr(t).direction==="rtl"}const MT={convertOffsetParentRelativeRectToViewportRelativeRect:xT,getDocumentElement:Sr,getClippingRect:jT,getOffsetParent:Jg,getElementRects:OT,getClientRects:vT,getDimensions:AT,getScale:Ta,isElement:er,isRTL:NT};function ey(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function _T(t,r,i){let a=null,c;const l=Sr(t);function u(){var C;clearTimeout(c),(C=a)==null||C.disconnect(),a=null}function d(C,g){C===void 0&&(C=!1),g===void 0&&(g=1),u();const b=t.getBoundingClientRect(),{left:x,top:v,width:S,height:w}=b;if(C||r(),!S||!w)return;const T=vl(v),j=vl(l.clientWidth-(x+S)),R=vl(l.clientHeight-(v+w)),O=vl(x),D={rootMargin:-T+"px "+-j+"px "+-R+"px "+-O+"px",threshold:br(0,Qr(1,g))||1};let _=!0;function I(B){const H=B[0].intersectionRatio;if(!ey(b,t.getBoundingClientRect()))return d();if(H!==g){if(!_)return d();H?d(!1,H):c=setTimeout(()=>{d(!1,1e-7)},1e3)}_=!1}try{a=new IntersectionObserver(I,{...D,root:l.ownerDocument})}catch{a=new IntersectionObserver(I,D)}a.observe(t)}const m=nn(t),p=()=>d(i);return m.addEventListener("resize",p),d(!0),()=>{m.removeEventListener("resize",p),u()}}function DT(t,r,i,a){a===void 0&&(a={});const{ancestorScroll:c=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=a,p=Ed(t),C=c||l?[...p?Bi(p):[],...r?Bi(r):[]]:[];C.forEach(T=>{c&&T.addEventListener("scroll",i),l&&T.addEventListener("resize",i)});const g=p&&d?_T(p,i,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(T=>{let[j]=T;j&&j.target===p&&x&&r&&(x.unobserve(r),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=x)==null||R.observe(r)})),i()}),p&&!m&&x.observe(p),r&&x.observe(r));let v,S=m?ko(t):null;m&&w();function w(){const T=ko(t);S&&!ey(S,T)&&i(),S=T,v=requestAnimationFrame(w)}return i(),()=>{var T;C.forEach(j=>{c&&j.removeEventListener("scroll",i),l&&j.removeEventListener("resize",i)}),g?.(),(T=x)==null||T.disconnect(),x=null,m&&cancelAnimationFrame(v)}}const IT=cT,kT=uT,LT=iT,zT=fT,BT=sT,ty=aT,HT=dT,PT=(t,r,i)=>{const a=new Map,c=i??{},l={...MT,...c.platform,_c:a};return oT(t,r,{...c,platform:l})};var UT=typeof document<"u",$T=function(){},Rl=UT?E.useLayoutEffect:$T;function Ol(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let i,a,c;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(i=t.length,i!==r.length)return!1;for(a=i;a--!==0;)if(!Ol(t[a],r[a]))return!1;return!0}if(c=Object.keys(t),i=c.length,i!==Object.keys(r).length)return!1;for(a=i;a--!==0;)if(!{}.hasOwnProperty.call(r,c[a]))return!1;for(a=i;a--!==0;){const l=c[a];if(!(l==="_owner"&&t.$$typeof)&&!Ol(t[l],r[l]))return!1}return!0}return t!==t&&r!==r}function ny(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ry(t,r){const i=ny(t);return Math.round(r*i)/i}function jd(t){const r=E.useRef(t);return Rl(()=>{r.current=t}),r}function GT(t){t===void 0&&(t={});const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:c,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:p}=t,[C,g]=E.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[b,x]=E.useState(a);Ol(b,a)||x(a);const[v,S]=E.useState(null),[w,T]=E.useState(null),j=E.useCallback(L=>{L!==D.current&&(D.current=L,S(L))},[]),R=E.useCallback(L=>{L!==_.current&&(_.current=L,T(L))},[]),O=l||v,M=u||w,D=E.useRef(null),_=E.useRef(null),I=E.useRef(C),B=m!=null,H=jd(m),z=jd(c),$=jd(p),X=E.useCallback(()=>{if(!D.current||!_.current)return;const L={placement:r,strategy:i,middleware:b};z.current&&(L.platform=z.current),PT(D.current,_.current,L).then(P=>{const N={...P,isPositioned:$.current!==!1};G.current&&!Ol(I.current,N)&&(I.current=N,Yr.flushSync(()=>{g(N)}))})},[b,r,i,z,$]);Rl(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(L=>({...L,isPositioned:!1})))},[p]);const G=E.useRef(!1);Rl(()=>(G.current=!0,()=>{G.current=!1}),[]),Rl(()=>{if(O&&(D.current=O),M&&(_.current=M),O&&M){if(H.current)return H.current(O,M,X);X()}},[O,M,X,H,B]);const te=E.useMemo(()=>({reference:D,floating:_,setReference:j,setFloating:R}),[j,R]),V=E.useMemo(()=>({reference:O,floating:M}),[O,M]),Y=E.useMemo(()=>{const L={position:i,left:0,top:0};if(!V.floating)return L;const P=ry(V.floating,C.x),N=ry(V.floating,C.y);return d?{...L,transform:"translate("+P+"px, "+N+"px)",...ny(V.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:P,top:N}},[i,d,V.floating,C.x,C.y]);return E.useMemo(()=>({...C,update:X,refs:te,elements:V,floatingStyles:Y}),[C,X,te,V,Y])}const VT=t=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:t,fn(i){const{element:a,padding:c}=typeof t=="function"?t(i):t;return a&&r(a)?a.current!=null?ty({element:a.current,padding:c}).fn(i):{}:a?ty({element:a,padding:c}).fn(i):{}}}},qT=(t,r)=>{const i=IT(t);return{name:i.name,fn:i.fn,options:[t,r]}},YT=(t,r)=>{const i=kT(t);return{name:i.name,fn:i.fn,options:[t,r]}},XT=(t,r)=>({fn:HT(t).fn,options:[t,r]}),KT=(t,r)=>{const i=LT(t);return{name:i.name,fn:i.fn,options:[t,r]}},FT=(t,r)=>{const i=zT(t);return{name:i.name,fn:i.fn,options:[t,r]}},QT=(t,r)=>{const i=BT(t);return{name:i.name,fn:i.fn,options:[t,r]}},ZT=(t,r)=>{const i=VT(t);return{name:i.name,fn:i.fn,options:[t,r]}};var WT=Object.defineProperty,JT=(t,r)=>WT(t,"name",{value:r,configurable:!0}),ej=E.forwardRef(JT(function(r,i){const{children:a,width:c=10,height:l=5,...u}=r;return f.jsx(He.svg,{...u,ref:i,width:c,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?a:f.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),tj=Object.defineProperty,Cr=(t,r)=>tj(t,"name",{value:r,configurable:!0}),oy={Partial:"partial"},ay={Optimized:"optimized",Always:"always"},iy="Popper",[sy,Nl]=Tn(iy),[nj,ly]=sy(iy),cy=Cr(t=>{const{__scopePopper:r,children:i}=t,[a,c]=E.useState(null),[l,u]=E.useState(void 0);return f.jsx(nj,{scope:r,anchor:a,onAnchorChange:c,placementState:l,setPlacementState:u,children:i})},"Popper"),rj="PopperAnchor",uy=E.forwardRef(Cr(function(r,i){const{__scopePopper:a,virtualRef:c,...l}=r,u=ly(rj,a),d=E.useRef(null),m=u.onAnchorChange,p=E.useCallback(S=>{d.current=S,S&&m(S)},[m]),C=ke(i,p),g=E.useRef(null);E.useEffect(()=>{if(!c)return;const S=g.current;g.current=c.current,S!==g.current&&m(g.current)});const b=u.placementState&&Ml(u.placementState),x=b?.[0],v=b?.[1];return c?null:f.jsx(He.div,{"data-radix-popper-side":x,"data-radix-popper-align":v,...l,ref:C})},"PopperAnchor")),dy="PopperContent",[oj,aj]=sy(dy),fy=E.forwardRef(Cr(function(r,i){const{__scopePopper:a,side:c="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:C=[],collisionPadding:g=0,sticky:b=oy.Partial,hideWhenDetached:x=!1,updatePositionStrategy:v=ay.Optimized,onPlaced:S,...w}=r,T=ly(dy,a),[j,R]=E.useState(null),O=ke(i,R),[M,D]=E.useState(null),_=Li(M),I=_?.width??0,B=_?.height??0,H=c+(u!=="center"?"-"+u:""),z=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},$=Array.isArray(C)?C:[C],X=$.length>0,G={padding:z,boundary:$.filter(hy),altBoundary:X},{refs:te,floatingStyles:V,placement:Y,isPositioned:L,middlewareData:P}=GT({strategy:"fixed",placement:H,whileElementsMounted:Cr((...ye)=>DT(...ye,{animationFrame:v===ay.Always}),"whileElementsMounted"),elements:{reference:T.anchor},middleware:[qT({mainAxis:l+B,alignmentAxis:d}),p&&YT({mainAxis:!0,crossAxis:!1,...b===oy.Partial?{limiter:XT()}:{},...G}),p&&KT({...G}),FT({...G,apply:Cr(({elements:ye,rects:de,availableWidth:Me,availableHeight:De})=>{const{width:we,height:xe}=de.reference,Se=ye.floating.style;Se.setProperty("--radix-popper-available-width",`${Me}px`),Se.setProperty("--radix-popper-available-height",`${De}px`),Se.setProperty("--radix-popper-anchor-width",`${we}px`),Se.setProperty("--radix-popper-anchor-height",`${xe}px`)},"apply")}),M&&ZT({element:M,padding:m}),cj({arrowWidth:I,arrowHeight:B}),x&&QT(X?{strategy:"referenceHidden",...G}:{strategy:"referenceHidden",padding:G.padding,altBoundary:G.altBoundary})]}),N=T.setPlacementState;lt(()=>(N(Y),()=>{N(void 0)}),[Y,N]);const[U,J]=Ml(Y),Q=Hn(S);lt(()=>{L&&Q?.()},[L,Q]);const le=P.arrow?.x,re=P.arrow?.y,ae=P.arrow?.centerOffset!==0,[ge,je]=E.useState();return lt(()=>{j&&je(window.getComputedStyle(j).zIndex)},[j]),f.jsx("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:L?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:f.jsx(oj,{scope:a,placedSide:U,placedAlign:J,onArrowChange:D,arrowX:le,arrowY:re,shouldHideArrow:ae,children:f.jsx(He.div,{"data-side":U,"data-align":J,...w,ref:O,style:{...w.style,animation:L?w.style?.animation:"none"}})})})},"PopperContent")),ij="PopperArrow",sj={top:"bottom",right:"left",bottom:"top",left:"right"},lj=E.forwardRef(Cr(function(r,i){const{__scopePopper:a,...c}=r,l=aj(ij,a),u=sj[l.placedSide];return f.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:f.jsx(ej,{...c,ref:i,style:{...c.style,display:"block"}})})},"PopperArrow"));function hy(t){return t!==null}Cr(hy,"isNotNull");var cj=Cr(t=>({name:"transformOrigin",options:t,fn(r){const{placement:i,rects:a,middlewareData:c}=r,u=c.arrow?.centerOffset!==0,d=u?0:t.arrowWidth,m=u?0:t.arrowHeight,[p,C]=Ml(i),g={start:"0%",center:"50%",end:"100%"}[C],b=(c.arrow?.x??0)+d/2,x=(c.arrow?.y??0)+m/2;let v="",S="";return p==="bottom"?(v=u?g:`${b}px`,S=`${-m}px`):p==="top"?(v=u?g:`${b}px`,S=`${a.floating.height+m}px`):p==="right"?(v=`${-m}px`,S=u?g:`${x}px`):p==="left"&&(v=`${a.floating.width+m}px`,S=u?g:`${x}px`),{data:{x:v,y:S}}}}),"transformOrigin");function Ml(t){const[r,i="center"]=t.split("-");return[r,i]}Cr(Ml,"getSideAndAlignFromPlacement");var uj=Object.defineProperty,Ad=(t,r)=>uj(t,"name",{value:r,configurable:!0}),Rd=!1;function my(){const[t,r]=E.useState(Rd);return E.useEffect(()=>{Rd||(Rd=!0,r(!0))},[]),t}Ad(my,"useIsHydrated");var py=No[" useSyncExternalStore ".trim().toString()];function gy(){return()=>{}}Ad(gy,"subscribe");function yy(){return py(gy,()=>!0,()=>!1)}Ad(yy,"useIsHydratedModern");var dj=typeof py=="function"?yy:my,fj=Object.defineProperty,Lo=(t,r)=>fj(t,"name",{value:r,configurable:!0}),Od="rovingFocusGroup.onEntryFocus",hj={bubbles:!1,cancelable:!0},_l="RovingFocusGroup",[Nd,by,mj]=il(_l),[pj,xy]=Tn(_l,[mj]),vy={Vertical:"vertical",Horizontal:"horizontal"},gj={RTL:"rtl"},[yj,bj]=pj(_l),xj=E.forwardRef(Lo(function(r,i){return f.jsx(Nd.Provider,{scope:r.__scopeRovingFocusGroup,children:f.jsx(Nd.Slot,{scope:r.__scopeRovingFocusGroup,children:f.jsx(vj,{...r,ref:i})})})},"RovingFocusGroup")),vj=E.forwardRef(Lo(function(r,i){const{__scopeRovingFocusGroup:a,orientation:c,loop:l=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:C,preventScrollOnEntryFocus:g=!1,...b}=r,x=E.useRef(null),v=ke(i,x),S=Ii(u),[w,T]=fr({prop:d,defaultProp:m??null,onChange:p,caller:_l}),[j,R]=E.useState(!1),O=Hn(C),M=by(a),D=E.useRef(!1),[_,I]=E.useState(0);return E.useEffect(()=>{const B=x.current;if(B)return B.addEventListener(Od,O),()=>B.removeEventListener(Od,O)},[O]),f.jsx(yj,{scope:a,orientation:c,dir:S,loop:l,currentTabStopId:w,onItemFocus:E.useCallback(B=>T(B),[T]),onItemShiftTab:E.useCallback(()=>R(!0),[]),onFocusableItemAdd:E.useCallback(()=>I(B=>B+1),[]),onFocusableItemRemove:E.useCallback(()=>I(B=>B-1),[]),children:f.jsx(He.div,{tabIndex:j||_===0?-1:0,"data-orientation":c,...b,ref:v,style:{outline:"none",...r.style},onMouseDown:Ce(r.onMouseDown,()=>{D.current=!0}),onFocus:Ce(r.onFocus,B=>{const H=!D.current;if(B.target===B.currentTarget&&H&&!j){const z=new CustomEvent(Od,hj);if(B.currentTarget.dispatchEvent(z),!z.defaultPrevented){const $=M().filter(Y=>Y.focusable),X=$.find(Y=>Y.active),G=$.find(Y=>Y.id===w),V=[X,G,...$].filter(Boolean).map(Y=>Y.ref.current);Md(V,g)}}D.current=!1}),onBlur:Ce(r.onBlur,()=>R(!1))})})},"RovingFocusGroupImpl")),Sj="RovingFocusGroupItem",Cj=E.forwardRef(Lo(function(r,i){const{__scopeRovingFocusGroup:a,focusable:c=!0,active:l=!1,tabStopId:u,children:d,...m}=r,p=mr(),C=u||p,g=bj(Sj,a),b=g.currentTabStopId===C,x=by(a),{onFocusableItemAdd:v,onFocusableItemRemove:S,currentTabStopId:w}=g,T=dj();return lt(()=>{if(!(!T||!c))return v(),()=>S()},[T,c,v,S]),E.useEffect(()=>{if(!(T||!c))return v(),()=>S()},[T,c,v,S]),f.jsx(Nd.ItemSlot,{scope:a,id:C,focusable:c,active:l,children:f.jsx(He.span,{tabIndex:b?0:-1,"data-orientation":g.orientation,...m,ref:i,onMouseDown:Ce(r.onMouseDown,j=>{c?g.onItemFocus(C):j.preventDefault()}),onFocus:Ce(r.onFocus,()=>g.onItemFocus(C)),onKeyDown:Ce(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){g.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const R=Cy(j,g.orientation,g.dir);if(R!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let M=x().filter(D=>D.focusable).map(D=>D.ref.current);if(R==="last")M.reverse();else if(R==="prev"||R==="next"){R==="prev"&&M.reverse();const D=M.indexOf(j.currentTarget);M=g.loop?wy(M,D+1):M.slice(D+1)}setTimeout(()=>Md(M))}}),children:typeof d=="function"?d({isCurrentTabStop:b,hasTabStop:w!=null}):d})})},"RovingFocusGroupItem")),wj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Sy(t,r){return r!==gj.RTL?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}Lo(Sy,"getDirectionAwareKey");function Cy(t,r,i){const a=Sy(t.key,i);if(!(r===vy.Vertical&&["ArrowLeft","ArrowRight"].includes(a))&&!(r===vy.Horizontal&&["ArrowUp","ArrowDown"].includes(a)))return wj[a]}Lo(Cy,"getFocusIntent");function Md(t,r=!1){const i=document.activeElement;for(const a of t)if(a===i||(a.focus({preventScroll:r}),document.activeElement!==i))return}Lo(Md,"focusFirst");function wy(t,r){return t.map((i,a)=>t[(r+a)%t.length])}Lo(wy,"wrapArray");var Ej=Object.defineProperty,Tj=(t,r)=>Ej(t,"name",{value:r,configurable:!0});function ja(t,[r,i]){return Math.min(i,Math.max(r,t))}Tj(ja,"clamp");var jj=Object.defineProperty,Xt=(t,r)=>jj(t,"name",{value:r,configurable:!0}),Ey="Radio",[Aj,Ty]=Tn(Ey),[Rj,Dl]=Aj(Ey);function jy(t){const{__scopeRadio:r,checked:i=!1,children:a,disabled:c,form:l,name:u,onCheck:d,required:m,value:p="on",internal_do_not_use_render:C}=t,[g,b]=E.useState(null),[x,v]=E.useState(null),[S,w]=E.useState(null),T=g?!!l||!!g.closest("form"):!0,j={checked:i,disabled:c,required:m,name:u,form:l,value:p,control:g,setControl:b,userClick:S,onUserClick:w,isFormControl:T,bubbleInput:x,setBubbleInput:v,onCheck:Xt(()=>d?.(),"onCheck")};return f.jsx(Rj,{scope:r,...j,children:Ay(C)?C(j):a})}Xt(jy,"RadioProvider");var Oj="RadioTrigger",Nj=E.forwardRef(Xt(function({__scopeRadio:r,onClick:i,...a},c){const{checked:l,disabled:u,value:d,setControl:m,onCheck:p,onUserClick:C,isFormControl:g,bubbleInput:b}=Dl(Oj,r),x=ke(c,m);return f.jsx(He.button,{type:"button",role:"radio","aria-checked":l,"data-state":_d(l),"data-disabled":u?"":void 0,disabled:u,value:d,...a,ref:x,onClick:Ce(i,v=>{const S=v.isPropagationStopped();l||(C({hasConsumerStoppedPropagation:S}),p()),b&&g&&(S||v.stopPropagation())})})},"RadioTrigger")),Mj="RadioIndicator",_j=E.forwardRef(Xt(function(r,i){const{__scopeRadio:a,forceMount:c,...l}=r,u=Dl(Mj,a);return f.jsx(Fr,{present:c||u.checked,children:f.jsx(He.span,{"data-state":_d(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i})})},"RadioIndicator")),Dj="RadioBubbleInput",Ij=E.forwardRef(Xt(function({__scopeRadio:r,onClick:i,...a},c){const{control:l,checked:u,required:d,disabled:m,name:p,value:C,form:g,bubbleInput:b,setBubbleInput:x,userClick:v}=Dl(Dj,r),S=ke(c,x),w=Li(l),T=E.useRef(!1),j=E.useRef(u),R=E.useRef(v),O=E.useRef(null);E.useEffect(()=>{const D=b;if(!D)return;const _=window.HTMLInputElement.prototype,B=Object.getOwnPropertyDescriptor(_,"checked").set;if(!B)return;const H=j.current!==u;j.current=u;const z=v!==null&&v!==R.current;if(R.current=v,z)O.current=H?null:v,H&&B.call(D,u),D.dispatchEvent(new Event("click",{bubbles:!v.hasConsumerStoppedPropagation}));else if(H){const $=O.current;O.current=null;const X=u&&$!==null;T.current=!0,B.call(D,u),D.dispatchEvent(new Event("click",{bubbles:!(X&&$.hasConsumerStoppedPropagation)})),T.current=!1}},[b,u,v]);const M=E.useRef(u);return f.jsx(He.input,{type:"radio","aria-hidden":!0,defaultChecked:M.current,required:d,disabled:m,name:p,value:C,form:g,...a,tabIndex:-1,ref:S,onClick:Ce(i,D=>{T.current&&D.stopPropagation()}),style:{...a.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function Ay(t){return typeof t=="function"}Xt(Ay,"isFunction");function _d(t){return t?"checked":"unchecked"}Xt(_d,"getState");var kj=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Dd="RadioGroup",[Lj,LM]=Tn(Dd,[xy,Ty]),Ry=xy(),Il=Ty(),[zj,Bj]=Lj(Dd),Hj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,name:c,form:l,defaultValue:u,value:d,required:m=!1,disabled:p=!1,orientation:C,dir:g,loop:b=!0,onValueChange:x,...v}=r,S=Ry(a),w=Ii(g),[T,j]=fr({prop:d,defaultProp:u??null,onChange:x,caller:Dd}),[R,O]=E.useState(null),M=ke(i,O),D=E.useRef(T);return E.useEffect(()=>{const _=l?R?.ownerDocument.getElementById(l):R?.closest("form");if(_ instanceof HTMLFormElement){const I=Xt(()=>j(D.current),"reset");return _.addEventListener("reset",I),()=>_.removeEventListener("reset",I)}},[R,l,j]),f.jsx(zj,{scope:a,name:c,form:l,required:m,disabled:p,value:T,onValueChange:j,children:f.jsx(xj,{asChild:!0,...S,orientation:C,dir:w,loop:b,children:f.jsx(He.div,{role:"radiogroup","aria-required":m,"aria-orientation":C,"data-disabled":p?"":void 0,dir:w,...v,ref:M})})})},"RadioGroup")),Pj="RadioGroupItemProvider",Uj="RadioGroupItemTrigger";function Oy(t){const{__scopeRadioGroup:r,value:i,disabled:a,children:c,internal_do_not_use_render:l}=t,u=Bj(Pj,r),d=Il(r),m=u.disabled||a;return f.jsx(jy,{...d,checked:u.value===i,disabled:m,required:u.required,name:u.name,form:u.form,value:i,onCheck:()=>u.onValueChange(i),internal_do_not_use_render:l,children:c})}Xt(Oy,"RadioGroupItemProvider");var $j=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Ry(a),u=Il(a),{checked:d,disabled:m}=Dl(Uj,u.__scopeRadio),p=E.useRef(null),C=ke(i,p),g=E.useRef(!1);return E.useEffect(()=>{const b=Xt(v=>{kj.includes(v.key)&&(g.current=!0)},"handleKeyDown"),x=Xt(()=>g.current=!1,"handleKeyUp");return document.addEventListener("keydown",b),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",b),document.removeEventListener("keyup",x)}},[]),f.jsx(Cj,{asChild:!0,...l,focusable:!m,active:d,children:f.jsx(Nj,{...u,...c,ref:C,onKeyDown:Ce(c.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onFocus:Ce(c.onFocus,()=>{g.current&&p.current?.click()})})})},"RadioGroupItemTrigger")),Gj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,value:c,disabled:l,...u}=r;return f.jsx(Oy,{__scopeRadioGroup:a,value:c,disabled:l,internal_do_not_use_render:({isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx($j,{...u,ref:i,__scopeRadioGroup:a}),d&&f.jsx(Vj,{__scopeRadioGroup:a})]})})},"RadioGroupItem")),Vj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Il(a);return f.jsx(Ij,{...l,...c,ref:i})},"RadioGroupItemBubbleInput")),qj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Il(a);return f.jsx(_j,{...l,...c,ref:i})},"RadioGroupIndicator")),Yj=Object.defineProperty,$e=(t,r)=>Yj(t,"name",{value:r,configurable:!0}),Ny={ItemAligned:"item-aligned",Popper:"popper"},Xj={RTL:"rtl"},Kj=[" ","Enter","ArrowUp","ArrowDown"],Fj=[" ","Enter"],Aa="Select",[kl,Ll,Qj]=il(Aa),[zo,zM]=Tn(Aa,[Qj,Nl]),Id=Nl(),[Zj,Jr]=zo(Aa),[Wj,Jj]=zo(Aa);function My(t){const{__scopeSelect:r,children:i,open:a,defaultOpen:c,onOpenChange:l,value:u,defaultValue:d,onValueChange:m,dir:p,name:C,autoComplete:g,disabled:b,required:x,form:v,internal_do_not_use_render:S}=t,w=Id(r),[T,j]=E.useState(null),[R,O]=E.useState(null),[M,D]=E.useState(!1),_=Ii(p),[I,B]=fr({prop:a,defaultProp:c??!1,onChange:l,caller:Aa}),[H,z]=fr({prop:u,defaultProp:d,onChange:m,caller:Aa}),$=E.useRef(null),X=E.useRef(!1),[G,te]=E.useState(null),V=$e(ae=>{te({value:ae,hasConsumerStoppedPropagation:X.current}),z(ae)},"handleUserSelect"),Y=E.useRef(H);E.useEffect(()=>{const ae=v?T?.ownerDocument.getElementById(v):T?.form;if(ae instanceof HTMLFormElement){const ge=$e(()=>z(Y.current),"reset");return ae.addEventListener("reset",ge),()=>ae.removeEventListener("reset",ge)}},[v,T,z]);const L=T?!!v||!!T.closest("form"):!0,[P,N]=E.useState(new Set),U=mr(),J=Array.from(P).map(ae=>ae.props.value).join(";"),Q=E.useCallback(ae=>{N(ge=>new Set(ge).add(ae))},[]),le=E.useCallback(ae=>{N(ge=>{const je=new Set(ge);return je.delete(ae),je})},[]),re={required:x,trigger:T,onTriggerChange:j,valueNode:R,onValueNodeChange:O,valueNodeHasChildren:M,onValueNodeHasChildrenChange:D,contentId:U,value:H,onValueChange:z,hasConsumerStoppedPropagationRef:X,userSelection:G,onUserSelect:V,open:I,onOpenChange:B,dir:_,triggerPointerDownPosRef:$,disabled:b,name:C,autoComplete:g,form:v,nativeOptions:P,nativeSelectKey:J,isFormControl:L};return f.jsx(cy,{...w,children:f.jsx(Zj,{scope:r,...re,children:f.jsx(kl.Provider,{scope:r,children:f.jsx(Wj,{scope:r,onNativeOptionAdd:Q,onNativeOptionRemove:le,children:Hy(S)?S(re):i})})})})}$e(My,"SelectProvider");var e2=$e(t=>{const{__scopeSelect:r,children:i,...a}=t;return f.jsx(My,{__scopeSelect:r,...a,internal_do_not_use_render:({isFormControl:c})=>f.jsxs(f.Fragment,{children:[i,c?f.jsx(M2,{__scopeSelect:r}):null]})})},"Select"),t2="SelectTrigger",n2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,disabled:c=!1,...l}=r,u=Id(a),d=Jr(t2,a),m=d.disabled||c,p=ke(i,d.onTriggerChange),C=Ll(a),g=E.useRef("touch"),[b,x,v]=zd(w=>{const T=C().filter(O=>!O.disabled),j=T.find(O=>O.value===d.value),R=Bd(T,w,j);R!==void 0&&d.onUserSelect(R.value)}),S=$e(w=>{m||(d.onOpenChange(!0),v()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})},"handleOpen");return f.jsx(uy,{asChild:!0,...u,children:f.jsx(He.button,{type:"button",role:"combobox","aria-controls":d.open?d.contentId:void 0,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":Hi(d.value)?"":void 0,...l,ref:p,onClick:Ce(l.onClick,w=>{w.currentTarget.focus(),g.current!=="mouse"&&S(w)}),onPointerDown:Ce(l.onPointerDown,w=>{g.current=w.pointerType;const T=w.target;T.hasPointerCapture(w.pointerId)&&T.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(S(w),w.preventDefault())}),onKeyDown:Ce(l.onKeyDown,w=>{const T=b.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&(d.hasConsumerStoppedPropagationRef.current=w.isPropagationStopped(),x(w.key)),!(T&&w.key===" ")&&Kj.includes(w.key)&&(S(),w.preventDefault())})})})},"SelectTrigger")),r2="SelectValue",o2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,className:c,style:l,children:u,placeholder:d="",...m}=r,p=Jr(r2,a),{onValueNodeHasChildrenChange:C}=p,g=u!==void 0,b=ke(i,p.onValueNodeChange);lt(()=>{C(g)},[C,g]);const x=Hi(p.value);return f.jsx(He.span,{...m,asChild:x?!1:m.asChild,ref:b,style:{pointerEvents:"none"},children:f.jsx(E.Fragment,{children:x?d:u},x?"placeholder":"value")})},"SelectValue")),a2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,children:c,...l}=r;return f.jsx(He.span,{"aria-hidden":!0,...l,ref:i,children:c||"▼"})},"SelectIcon")),i2="SelectPortal",[s2,l2]=zo(i2,{forceMount:void 0}),c2=$e(t=>{const{__scopeSelect:r,forceMount:i,...a}=t;return f.jsx(s2,{scope:t.__scopeSelect,forceMount:i,children:f.jsx(ed,{asChild:!0,...a})})},"SelectPortal"),Bo="SelectContent",u2=E.forwardRef($e(function(r,i){const a=l2(Bo,r.__scopeSelect),{forceMount:c=a.forceMount,...l}=r,u=Jr(Bo,r.__scopeSelect),[d,m]=E.useState();return lt(()=>{m(new DocumentFragment)},[]),f.jsx(Fr,{present:c||u.open,children:({present:p})=>p?f.jsx(h2,{...l,ref:i}):f.jsx(d2,{...l,fragment:d})})},"SelectContent")),d2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,children:c,fragment:l}=r;return l?Yr.createPortal(f.jsx(_y,{scope:a,children:f.jsx(kl.Slot,{scope:a,children:f.jsx("div",{ref:i,children:c})})}),l):null},"SelectContentFragment")),Pn=10,[_y,Ho]=zo(Bo),f2=dr("SelectContent.RemoveScroll"),h2=E.forwardRef($e(function(r,i){const{__scopeSelect:a}=r,{position:c=Ny.ItemAligned,onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:b,collisionBoundary:x,collisionPadding:v,sticky:S,hideWhenDetached:w,avoidCollisions:T,...j}=r,R=Jr(Bo,a),[O,M]=E.useState(null),[D,_]=E.useState(null),I=ke(i,M),[B,H]=E.useState(null),[z,$]=E.useState(null),X=Ll(a),[G,te]=E.useState(!1),V=E.useRef(!1),Y=E.useRef(!1),L=E.useRef(!1);E.useEffect(()=>{if(O)return Og(O)},[O]),dl();const P=E.useCallback(de=>{const[Me,...De]=X().map(Se=>Se.ref.current),[we]=De.slice(-1),xe=document.activeElement;for(const Se of de)if(Se===xe||(Se?.scrollIntoView({block:"nearest"}),Se===Me&&D&&(D.scrollTop=0),Se===we&&D&&(D.scrollTop=D.scrollHeight),Se?.focus(),document.activeElement!==xe))return},[X,D]),N=E.useCallback(()=>P([B,O]),[P,B,O]);E.useEffect(()=>{G&&N()},[G,N]);const{onOpenChange:U,triggerPointerDownPosRef:J}=R;E.useEffect(()=>{if(O){let de={x:0,y:0};const Me=$e(we=>{de={x:Math.abs(Math.round(we.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(we.pageY)-(J.current?.y??0))}},"handlePointerMove"),De=$e(we=>{de.x<=10&&de.y<=10?we.preventDefault():we.composedPath().includes(O)||U(!1),document.removeEventListener("pointermove",Me),J.current=null},"handlePointerUp");return J.current!==null&&(document.addEventListener("pointermove",Me),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Me),document.removeEventListener("pointerup",De,{capture:!0})}}},[O,U,J]),E.useEffect(()=>{const de=$e(()=>U(!1),"close");return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[U]);const[Q,le]=zd(de=>{const Me=X().filter(xe=>!xe.disabled),De=Me.find(xe=>xe.ref.current===document.activeElement),we=Bd(Me,de,De);we&&setTimeout(()=>we.ref.current?.focus())}),re=E.useCallback((de,Me,De)=>{const we=!Y.current;we&&(Y.current=!0);const xe=!V.current&&!De;R.value!==void 0&&R.value===Me||xe?(H(de),xe&&(V.current=!0)):we&&H(de)},[R.value]),ae=E.useCallback(()=>O?.focus(),[O]),ge=E.useCallback((de,Me,De)=>{if(!de)return;const we=!L.current;we&&(L.current=!0);const xe=!V.current&&!De;(R.value!==void 0&&R.value===Me||xe||we)&&$(de)},[R.value]),je=c===Ny.Popper?Dy:m2,ye=je===Dy?{side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:b,collisionBoundary:x,collisionPadding:v,sticky:S,hideWhenDetached:w,avoidCollisions:T}:{};return f.jsx(_y,{scope:a,content:O,viewport:D,onViewportChange:_,itemRefCallback:re,selectedItem:B,onItemLeave:ae,itemTextRefCallback:ge,focusSelectedItem:N,selectedItemText:z,position:c,isPositioned:G,searchRef:Q,children:f.jsx(sd,{as:f2,allowPinchZoom:!0,children:f.jsx(og,{asChild:!0,trapped:R.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ce(l,de=>{R.trigger?.focus({preventScroll:!0}),de.preventDefault()}),children:f.jsx(Yu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:f.jsx(je,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:de=>de.preventDefault(),...j,...ye,onPlaced:()=>te(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ce(j.onKeyDown,de=>{const Me=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!Me&&de.key.length===1&&le(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let we=X().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(de.key)&&(we=we.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const xe=de.target,Se=we.indexOf(xe);we=we.slice(Se+1)}setTimeout(()=>P(we)),de.preventDefault()}})})})})})})},"SelectContentImpl")),m2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,onPlaced:c,...l}=r,u=Jr(Bo,a),d=Ho(Bo,a),[m,p]=E.useState(null),[C,g]=E.useState(null),b=ke(i,g),x=Ll(a),v=E.useRef(!1),S=E.useRef(!0),{viewport:w,selectedItem:T,selectedItemText:j,focusSelectedItem:R}=d,O=E.useCallback(()=>{if(u.trigger&&u.valueNode&&m&&C&&w&&T&&j){const I=u.trigger.getBoundingClientRect(),B=C.getBoundingClientRect(),H=u.valueNode.getBoundingClientRect(),z=j.getBoundingClientRect();if(u.dir!==Xj.RTL){const De=z.left-B.left,we=H.left-De,xe=I.left-we,Se=I.width+xe,Bt=Math.max(Se,B.width),ht=window.innerWidth-Pn,he=ja(we,[Pn,Math.max(Pn,ht-Bt)]);m.style.minWidth=Se+"px",m.style.left=he+"px"}else{const De=B.right-z.right,we=window.innerWidth-H.right-De,xe=window.innerWidth-I.right-we,Se=I.width+xe,Bt=Math.max(Se,B.width),ht=window.innerWidth-Pn,he=ja(we,[Pn,Math.max(Pn,ht-Bt)]);m.style.minWidth=Se+"px",m.style.right=he+"px"}const $=x(),X=window.innerHeight-Pn*2,G=w.scrollHeight,te=window.getComputedStyle(C),V=parseInt(te.borderTopWidth,10),Y=parseInt(te.paddingTop,10),L=parseInt(te.borderBottomWidth,10),P=parseInt(te.paddingBottom,10),N=V+Y+G+P+L,U=Math.min(T.offsetHeight*5,N),J=window.getComputedStyle(w),Q=parseInt(J.paddingTop,10),le=parseInt(J.paddingBottom,10),re=I.top+I.height/2-Pn,ae=X-re,ge=T.offsetHeight/2,je=T.offsetTop+ge,ye=V+Y+je,de=N-ye;if(ye<=re){const De=$.length>0&&T===$[$.length-1].ref.current;m.style.bottom="0px";const we=C.clientHeight-w.offsetTop-w.offsetHeight,xe=Math.max(ae,ge+(De?le:0)+we+L),Se=ye+xe;m.style.height=Se+"px"}else{const De=$.length>0&&T===$[0].ref.current;m.style.top="0px";const xe=Math.max(re,V+w.offsetTop+(De?Q:0)+ge)+de;m.style.height=xe+"px",w.scrollTop=ye-re+w.offsetTop}m.style.margin=`${Pn}px 0`,m.style.minHeight=U+"px",m.style.maxHeight=X+"px",c?.(),requestAnimationFrame(()=>v.current=!0)}},[x,u.trigger,u.valueNode,m,C,w,T,j,u.dir,c]);lt(()=>O(),[O]);const[M,D]=E.useState();lt(()=>{C&&D(window.getComputedStyle(C).zIndex)},[C]);const _=E.useCallback(I=>{I&&S.current===!0&&(O(),R?.(),S.current=!1)},[O,R]);return f.jsx(p2,{scope:a,contentWrapper:m,shouldExpandOnScrollRef:v,onScrollButtonChange:_,children:f.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx(He.div,{...l,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),Dy=E.forwardRef($e(function(r,i){const{__scopeSelect:a,align:c="start",collisionPadding:l=Pn,...u}=r,d=Id(a);return f.jsx(fy,{...d,...u,ref:i,align:c,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[p2,kd]=zo(Bo,{}),Iy="SelectViewport",g2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,nonce:c,...l}=r,u=Ho(Iy,a),d=kd(Iy,a),m=ke(i,u.onViewportChange),p=E.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),f.jsx(kl.Slot,{scope:a,children:f.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ce(l.onScroll,C=>{const g=C.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:x}=d;if(x?.current&&b){const v=Math.abs(p.current-g.scrollTop);if(v>0){const S=window.innerHeight-Pn*2,w=parseFloat(b.style.minHeight),T=parseFloat(b.style.height),j=Math.max(w,T);if(j<S){const R=j+v,O=Math.min(S,R),M=R-O;b.style.height=O+"px",b.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,b.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),y2="SelectGroup",[b2,x2]=zo(y2),v2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,...c}=r,l=mr();return f.jsx(b2,{scope:a,id:l,children:f.jsx(He.div,{role:"group","aria-labelledby":l,...c,ref:i})})},"SelectGroup")),S2="SelectLabel",C2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,...c}=r,l=x2(S2,a);return f.jsx(He.div,{id:l.id,...c,ref:i})},"SelectLabel")),Ld="SelectItem",[w2,ky]=zo(Ld),E2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,value:c,disabled:l=!1,textValue:u,...d}=r,m=Jr(Ld,a),p=Ho(Ld,a),C=m.value===c,[g,b]=E.useState(u??""),[x,v]=E.useState(!1),S=Hn(O=>p.itemRefCallback?.(O,c,l)),w=ke(i,S),T=mr(),j=E.useRef("touch");function R(O){m.hasConsumerStoppedPropagationRef.current=O.isPropagationStopped(),m.onUserSelect(c),m.onOpenChange(!1)}return $e(R,"handleSelect"),f.jsx(w2,{scope:a,value:c,disabled:l,textId:T,isSelected:C,onItemTextChange:E.useCallback(O=>{b(M=>M||(O?.textContent??"").trim())},[]),children:f.jsx(kl.ItemSlot,{scope:a,value:c,disabled:l,textValue:g,children:f.jsx(He.div,{role:"option","aria-labelledby":T,"data-highlighted":x?"":void 0,"aria-selected":C&&x,"data-state":C?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:w,onFocus:Ce(d.onFocus,()=>v(!0)),onBlur:Ce(d.onBlur,()=>v(!1)),onClick:Ce(d.onClick,O=>{l||j.current!=="mouse"&&R(O)}),onPointerUp:Ce(d.onPointerUp,O=>{l||j.current==="mouse"&&R(O)}),onPointerDown:Ce(d.onPointerDown,O=>{j.current=O.pointerType}),onPointerMove:Ce(d.onPointerMove,O=>{j.current=O.pointerType,l?p.onItemLeave?.():j.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(d.onPointerLeave,O=>{O.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:Ce(d.onKeyDown,O=>{l||O.target!==O.currentTarget||p.searchRef?.current!==""&&O.key===" "||(Fj.includes(O.key)&&R(O),O.key===" "&&O.preventDefault())})})})})},"SelectItem")),zl="SelectItemText",T2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,className:c,style:l,...u}=r,d=Jr(zl,a),m=Ho(zl,a),p=ky(zl,a),C=Jj(zl,a),[g,b]=E.useState(null),x=Hn(R=>m.itemTextRefCallback?.(R,p.value,p.disabled)),v=ke(i,b,p.onItemTextChange,x),S=g?.textContent,w=E.useMemo(()=>f.jsx("option",{value:p.value,disabled:p.disabled,children:S},p.value),[p.disabled,p.value,S]),{onNativeOptionAdd:T,onNativeOptionRemove:j}=C;return lt(()=>(T(w),()=>j(w)),[T,j,w]),f.jsxs(f.Fragment,{children:[f.jsx(He.span,{id:p.textId,...u,ref:v}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren&&!Hi(d.value)?Yr.createPortal(u.children,d.valueNode):null]})},"SelectItemText")),j2="SelectItemIndicator",A2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,...c}=r;return ky(j2,a).isSelected?f.jsx(He.span,{"aria-hidden":!0,...c,ref:i}):null},"SelectItemIndicator")),Ly="SelectScrollUpButton",R2=E.forwardRef($e(function(r,i){const a=Ho(Ly,r.__scopeSelect),c=kd(Ly,r.__scopeSelect),[l,u]=E.useState(!1),d=ke(i,c.onScrollButtonChange);return lt(()=>{if(a.viewport&&a.isPositioned){let m=function(){const C=p.scrollTop>0;u(C)};$e(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(By,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),zy="SelectScrollDownButton",O2=E.forwardRef($e(function(r,i){const a=Ho(zy,r.__scopeSelect),c=kd(zy,r.__scopeSelect),[l,u]=E.useState(!1),d=ke(i,c.onScrollButtonChange);return lt(()=>{if(a.viewport&&a.isPositioned){let m=function(){const C=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)<C;u(g)};$e(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(By,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),By=E.forwardRef($e(function(r,i){const{__scopeSelect:a,onAutoScroll:c,...l}=r,u=Ho("SelectScrollButton",a),d=E.useRef(null),m=Ll(a),p=E.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return E.useEffect(()=>()=>p(),[p]),lt(()=>{m().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[m]),f.jsx(He.div,{"aria-hidden":!0,...l,ref:i,style:{flexShrink:0,...l.style},onPointerDown:Ce(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(c,50))}),onPointerMove:Ce(l.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(c,50))}),onPointerLeave:Ce(l.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),N2="SelectBubbleInput",M2=E.forwardRef($e(function({__scopeSelect:r,...i},a){const c=Jr(N2,r),{value:l,onValueChange:u,required:d,disabled:m,name:p,autoComplete:C,form:g,userSelection:b}=c,{nativeOptions:x,nativeSelectKey:v}=c,S=E.useRef(null),w=ke(a,S),T=l??"",j=E.useRef(T),R=E.useRef(b),O=E.useRef(!1),M=Array.from(x).some(D=>(D.props.value??"")==="");return E.useEffect(()=>{const D=S.current;if(!D)return;const _=window.HTMLSelectElement.prototype,B=Object.getOwnPropertyDescriptor(_,"value").set,H=b!==null&&b!==R.current;R.current=b;const z=j.current!==T;j.current=T;const $=H&&z;if(H&&!z&&b.value!==T&&!b.hasConsumerStoppedPropagation&&B){O.current=!0;try{B.call(D,b.value),D.dispatchEvent(new Event("change",{bubbles:!0}))}finally{O.current=!1,B.call(D,T)}return}const X=$&&!b.hasConsumerStoppedPropagation;if(z&&B){const G=new Event("change",{bubbles:X});B.call(D,T),D.dispatchEvent(G)}},[T,b]),f.jsxs(He.select,{"aria-hidden":!0,required:d,tabIndex:-1,name:p,autoComplete:C,disabled:m,form:g,onChange:D=>{O.current||u(D.target.value)},...i,style:{...Np,...i.style},ref:w,defaultValue:T,children:[Hi(l)&&!M?f.jsx("option",{value:""}):null,Array.from(x)]},v)},"SelectBubbleInput"));function Hy(t){return typeof t=="function"}$e(Hy,"isFunction");function Hi(t){return t===""||t===void 0}$e(Hi,"shouldShowPlaceholder");function zd(t){const r=Hn(t),i=E.useRef(""),a=E.useRef(0),c=E.useCallback(u=>{const d=i.current+u;r(d);function m(p){i.current=p,window.clearTimeout(a.current),p!==""&&(a.current=window.setTimeout(()=>m(""),1e3))}$e(m,"updateSearch"),m(d)},[r]),l=E.useCallback(()=>{i.current="",window.clearTimeout(a.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(a.current),[]),[i,c,l]}$e(zd,"useTypeaheadSearch");function Bd(t,r,i){const c=r.length>1&&Array.from(r).every(p=>p===r[0])?r[0]:r,l=i?t.indexOf(i):-1;let u=Py(t,Math.max(l,0));c.length===1&&(u=u.filter(p=>p!==i));const m=u.find(p=>p.textValue.toLowerCase().startsWith(c.toLowerCase()));return m!==i?m:void 0}$e(Bd,"findNextItem");function Py(t,r){return t.map((i,a)=>t[(r+a)%t.length])}$e(Py,"wrapArray");var _2=Object.defineProperty,qe=(t,r)=>_2(t,"name",{value:r,configurable:!0}),Uy={Horizontal:"horizontal"},D2={LTR:"ltr"},$y=["PageUp","PageDown"],Gy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Vy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Pi="Slider",[Hd,I2,k2]=il(Pi),[Pd,BM]=Tn(Pi,[k2]),[L2,Ra]=Pd(Pi),z2=E.forwardRef(qe(function(r,i){const{name:a,min:c=0,max:l=100,step:u=1,orientation:d=Uy.Horizontal,disabled:m=!1,minStepsBetweenThumbs:p=0,preserveThumbOrder:C=!1,defaultValue:g=[c],value:b,onValueChange:x=qe(()=>{},"onValueChange"),onValueCommit:v=qe(()=>{},"onValueCommit"),inverted:S=!1,form:w,...T}=r,j=E.useRef(new Set),R=E.useRef(0),O=E.useRef(!1),[M,D]=E.useState(null),I=d===Uy.Horizontal?B2:H2,[B,H]=E.useState(null),z=ke(i,H),[$=[],X]=fr({prop:b,defaultProp:g,onChange:qe(N=>{[...j.current][R.current]?.focus({preventScroll:!0,focusVisible:O.current}),O.current=!1,x(N)},"onChange")}),G=E.useRef($),te=E.useRef($);E.useEffect(()=>{const N=w?B?.ownerDocument.getElementById(w):B?.closest("form");if(N instanceof HTMLFormElement){const U=qe(()=>X(te.current),"reset");return N.addEventListener("reset",U),()=>N.removeEventListener("reset",U)}},[B,w,X]);function V(N){const U=e0($,N);P(N,U)}qe(V,"handleSlideStart");function Y(N){P(N,R.current)}qe(Y,"handleSlideMove");function L(){String($)!==String(G.current)&&v($)}qe(L,"handleSlideEnd");function P(N,U,{commit:J}={commit:!1}){const Q=Gd(u),le=Ui(Math.round((N-c)/u)*u+c,Q),re=ja(le,[c,l]),ae=p*u;function ge(ye){const de=C?ja(re,[ye[U-1]===void 0?c:ye[U-1]+ae,ye[U+1]===void 0?l:ye[U+1]-ae]):re,Me=Wy(ye,de,U);return r0(Me,ae)?{nextValues:Me,changedIndex:C?U:Me.indexOf(de),hasChanged:String(Me)!==String(ye)}:null}qe(ge,"getNextValues");const je=ge($);je?.hasChanged&&D(je.nextValues),X((ye=[])=>{const de=ge(ye);return de?(R.current=de.changedIndex,de.hasChanged&&J&&v(de.nextValues),de.hasChanged?de.nextValues:ye):ye})}return qe(P,"updateValues"),f.jsx(L2,{scope:r.__scopeSlider,name:a,disabled:m,min:c,max:l,valueIndexToChangeRef:R,thumbs:j.current,values:$,orientation:d,form:w,userRequestedValues:M,children:f.jsx(Hd.Provider,{scope:r.__scopeSlider,children:f.jsx(Hd.Slot,{scope:r.__scopeSlider,children:f.jsx(I,{"aria-disabled":m,"data-disabled":m?"":void 0,...T,ref:z,onPointerDown:Ce(T.onPointerDown,()=>{m||(G.current=$,O.current=!1)}),min:c,max:l,inverted:S,onSlideStart:m?void 0:V,onSlideMove:m?void 0:Y,onSlideEnd:m?void 0:L,onHomeKeyDown:()=>{m||(O.current=!0,P(c,0,{commit:!0}))},onEndKeyDown:()=>{m||(O.current=!0,P(l,$.length-1,{commit:!0}))},onStepKeyDown:({event:N,direction:U})=>{if(!m){O.current=!0;const le=$y.includes(N.key)||N.shiftKey&&Gy.includes(N.key)?10:1,re=R.current,ae=$[re],ge=o0(ae,{min:c,step:u,direction:U,multiplier:le});P(ge,re,{commit:!0})}}})})})})},"Slider")),[qy,Yy]=Pd(Pi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),B2=E.forwardRef(qe(function(r,i){const{min:a,max:c,dir:l,inverted:u,onSlideStart:d,onSlideMove:m,onSlideEnd:p,onStepKeyDown:C,...g}=r,[b,x]=E.useState(null),v=ke(i,x),S=E.useRef(void 0),w=Ii(l),T=w===D2.LTR,j=T&&!u||!T&&u;function R(O){const M=S.current||b.getBoundingClientRect(),D=[0,M.width],I=Bl(D,j?[a,c]:[c,a]);return S.current=M,I(O-M.left)}return qe(R,"getValueFromPointer"),f.jsx(qy,{scope:r.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:f.jsx(Xy,{dir:w,"data-orientation":"horizontal",...g,ref:v,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:O=>{const M=R(O.clientX);d?.(M)},onSlideMove:O=>{const M=R(O.clientX);m?.(M)},onSlideEnd:()=>{S.current=void 0,p?.()},onStepKeyDown:O=>{const D=Vy[j?"from-left":"from-right"].includes(O.key);C?.({event:O,direction:D?-1:1})}})})},"SliderHorizontal")),H2=E.forwardRef(qe(function(r,i){const{min:a,max:c,inverted:l,onSlideStart:u,onSlideMove:d,onSlideEnd:m,onStepKeyDown:p,...C}=r,g=E.useRef(null),b=ke(i,g),x=E.useRef(void 0),v=!l;function S(w){const T=x.current||g.current.getBoundingClientRect(),j=[0,T.height],O=Bl(j,v?[c,a]:[a,c]);return x.current=T,O(w-T.top)}return qe(S,"getValueFromPointer"),f.jsx(qy,{scope:r.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:f.jsx(Xy,{"data-orientation":"vertical",...C,ref:b,style:{...C.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const T=S(w.clientY);u?.(T)},onSlideMove:w=>{const T=S(w.clientY);d?.(T)},onSlideEnd:()=>{x.current=void 0,m?.()},onStepKeyDown:w=>{const j=Vy[v?"from-bottom":"from-top"].includes(w.key);p?.({event:w,direction:j?-1:1})}})})},"SliderVertical")),Xy=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onHomeKeyDown:d,onEndKeyDown:m,onStepKeyDown:p,...C}=r,g=Ra(Pi,a);return f.jsx(He.span,{...C,ref:i,onKeyDown:Ce(r.onKeyDown,b=>{b.key==="Home"?(d(b),b.preventDefault()):b.key==="End"?(m(b),b.preventDefault()):$y.concat(Gy).includes(b.key)&&(p(b),b.preventDefault())}),onPointerDown:Ce(r.onPointerDown,b=>{const x=b.target;x.setPointerCapture(b.pointerId),b.preventDefault(),g.thumbs.has(x)?x.focus({preventScroll:!0,focusVisible:!1}):c(b)}),onPointerMove:Ce(r.onPointerMove,b=>{b.target.hasPointerCapture(b.pointerId)&&l(b)}),onPointerUp:Ce(r.onPointerUp,b=>{const x=b.target;x.hasPointerCapture(b.pointerId)&&(x.releasePointerCapture(b.pointerId),u(b))})})},"SliderImpl")),P2="SliderTrack",U2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ra(P2,a);return f.jsx(He.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...c,ref:i})},"SliderTrack")),Ky="SliderRange",$2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ra(Ky,a),u=Yy(Ky,a),d=E.useRef(null),m=ke(i,d),p=l.values.length,C=l.values.map(x=>$d(x,l.min,l.max)),g=p>1?Math.min(...C):0,b=100-Math.max(...C);return f.jsx(He.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...c,ref:m,style:{...r.style,[u.startEdge]:g+"%",[u.endEdge]:b+"%"}})},"SliderRange")),G2="SliderThumb",[V2,Fy]=Pd(G2),q2="SliderThumbProvider";function Qy(t){const{__scopeSlider:r,name:i,children:a,internal_do_not_use_render:c}=t,l=Ra(q2,r),u=I2(r),[d,m]=E.useState(null),p=E.useMemo(()=>d?u().findIndex(w=>w.ref.current===d):-1,[u,d]),C=Li(d),g=d?!!l.form||!!d.closest("form"):!0,b=l.values[p],x=i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),v=b===void 0?0:$d(b,l.min,l.max);E.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]);const S={value:b,name:x,form:l.form,isFormControl:g,index:p,thumb:d,onThumbChange:m,percent:v,size:C};return f.jsx(V2,{scope:r,...S,children:a0(c)?c(S):a})}qe(Qy,"SliderThumbProvider");var Ud="SliderThumbTrigger",Y2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,...c}=r,l=Ra(Ud,a),u=Yy(Ud,a),{index:d,value:m,percent:p,size:C,onThumbChange:g}=Fy(Ud,a),b=ke(i,g),x=Jy(d,l.values.length),v=C?.[u.size],S=v?t0(v,p,u.direction):0;return f.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${p}% + ${S}px)`},children:f.jsx(Hd.ItemSlot,{scope:a,children:f.jsx(He.span,{role:"slider","aria-label":r["aria-label"]||x,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...c,ref:b,style:m===void 0?{display:"none"}:r.style,onFocus:Ce(r.onFocus,()=>{l.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),X2=E.forwardRef(qe(function(r,i){const{__scopeSlider:a,name:c,...l}=r;return f.jsx(Qy,{__scopeSlider:a,name:c,internal_do_not_use_render:({index:u,isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx(Y2,{...l,ref:i,__scopeSlider:a}),d?f.jsx(K2,{__scopeSlider:a},u):null]})})},"SliderThumb")),Zy="SliderBubbleInput",K2=E.forwardRef(qe(function({__scopeSlider:r,onInput:i,...a},c){const{index:l,value:u,name:d,form:m}=Fy(Zy,r),{userRequestedValues:p}=Ra(Zy,r),C=E.useRef(null),g=ke(C,c),b=E.useRef(!1),x=E.useRef(u),v=E.useRef(p),S=E.useRef(p);return E.useEffect(()=>{const w=C.current;if(!w)return;const T=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(T,"value").set,O=x.current,M=O!==u;x.current=u;const D=p!==S.current;if(S.current=p,M&&R){const _=p!==v.current;v.current=p;const I=p?.[l],B=_&&(D&&I!==O||I===u);b.current=!B;const H=new Event("input",{bubbles:!0});R.call(w,u),w.dispatchEvent(H),b.current=!1}},[l,u,p]),f.jsx(He.input,{style:{display:"none"},name:d,form:m,...a,ref:g,defaultValue:u,onInput:Ce(i,w=>{b.current&&w.stopPropagation()})})},"SliderBubbleInput"));function Wy(t=[],r,i){const a=[...t];return a[i]=r,a.sort((c,l)=>c-l)}qe(Wy,"getNextSortedValues");function $d(t,r,i){const l=100/(i-r)*(t-r);return ja(l,[0,100])}qe($d,"convertValueToPercentage");function Jy(t,r){return r>2?`Value ${t+1} of ${r}`:r===2?["Minimum","Maximum"][t]:void 0}qe(Jy,"getLabel");function e0(t,r){if(t.length===1)return 0;const i=t.map(c=>Math.abs(c-r)),a=Math.min(...i);return i.indexOf(a)}qe(e0,"getClosestValueIndex");function t0(t,r,i){const a=t/2,l=Bl([0,50],[0,a]);return(a-l(r)*i)*i}qe(t0,"getThumbInBoundsOffset");function n0(t){return t.slice(0,-1).map((r,i)=>t[i+1]-r)}qe(n0,"getStepsBetweenValues");function r0(t,r){if(r>0){const i=n0(t);return Math.min(...i)>=r}return!0}qe(r0,"hasMinStepsBetweenValues");function Bl(t,r){return i=>{if(t[0]===t[1]||r[0]===r[1])return r[0];const a=(r[1]-r[0])/(t[1]-t[0]);return r[0]+a*(i-t[0])}}qe(Bl,"linearScale");function Gd(t){if(!Number.isFinite(t))return 0;const r=t.toString();if(r.includes("e")){const[a,c]=r.split("e"),l=a.split(".")[1]||"",u=Number(c);return Math.max(0,l.length-u)}const i=r.split(".")[1];return i?i.length:0}qe(Gd,"getDecimalCount");function Ui(t,r){const i=Math.pow(10,r);return Math.round(t*i)/i}qe(Ui,"roundValue");function o0(t,{min:r,step:i,direction:a,multiplier:c}){const l=Gd(i),u=(t-r)/i,d=Math.round(u),m=Ui(d*i+r,l)===Ui(t,l);let p;return m?p=d+c*a:a>0?p=Math.ceil(u):p=Math.floor(u),Ui(p*i+r,l)}qe(o0,"getNextStepValue");function a0(t){return typeof t=="function"}qe(a0,"isFunction");var F2=Object.defineProperty,vt=(t,r)=>F2(t,"name",{value:r,configurable:!0}),[Vd,HM]=Tn("Tooltip",[Nl]),Hl=Nl(),Q2="TooltipProvider",Z2=700,qd="tooltip.open",[W2,Yd]=Vd(Q2),J2=vt(t=>{const{__scopeTooltip:r,delayDuration:i=Z2,skipDelayDuration:a=300,disableHoverableContent:c=!1,children:l}=t,u=E.useRef(!0),d=E.useRef(!1),m=E.useRef(0);return E.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),f.jsx(W2,{scope:r,isOpenDelayedRef:u,delayDuration:i,onOpen:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),u.current=!1)},[a]),onClose:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,a))},[a]),isPointerInTransitRef:d,onPointerInTransitChange:E.useCallback(p=>{d.current=p},[]),disableHoverableContent:c,children:l})},"TooltipProvider"),Xd="Tooltip",[eA,$i]=Vd(Xd),tA=vt(t=>{const{__scopeTooltip:r,children:i,open:a,defaultOpen:c,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=t,m=Yd(Xd,t.__scopeTooltip),p=Hl(r),[C,g]=E.useState(null),[b,x]=E.useState(void 0),v=mr(),S=E.useRef(0),w=u??m.disableHoverableContent,T=d??m.delayDuration,j=E.useRef(!1),[R,O]=fr({prop:a,defaultProp:c??!1,onChange:vt(H=>{H?(m.onOpen(),document.dispatchEvent(new CustomEvent(qd))):m.onClose(),l?.(H)},"onChange"),caller:Xd}),M=E.useMemo(()=>R?j.current?"delayed-open":"instant-open":"closed",[R]),D=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,j.current=!1,O(!0)},[O]),_=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,O(!1)},[O]),I=E.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{j.current=!0,O(!0),S.current=0},T)},[T,O]);E.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const B=b??v;return f.jsx(cy,{...p,children:f.jsx(eA,{scope:r,contentId:B,setContentId:x,open:R,stateAttribute:M,trigger:C,onTriggerChange:g,onTriggerEnter:E.useCallback(()=>{m.isOpenDelayedRef.current?I():D()},[m.isOpenDelayedRef,I,D]),onTriggerLeave:E.useCallback(()=>{w?_():(window.clearTimeout(S.current),S.current=0)},[_,w]),onOpen:D,onClose:_,disableHoverableContent:w,children:i})})},"Tooltip"),i0="TooltipTrigger",nA=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,"aria-describedby":c,...l}=r,u=$i(i0,a),d=Yd(i0,a),m=Hl(a),p=E.useRef(null),C=ke(i,p,u.onTriggerChange),g=E.useRef(!1),b=E.useRef(!1),x=E.useCallback(()=>g.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),f.jsx(uy,{asChild:!0,...m,children:f.jsx(He.button,{"aria-describedby":u.open?p0(c,u.contentId):c,"data-state":u.stateAttribute,...l,ref:C,onPointerMove:Ce(r.onPointerMove,v=>{v.pointerType!=="touch"&&!b.current&&!d.isPointerInTransitRef.current&&(u.onTriggerEnter(),b.current=!0)}),onPointerLeave:Ce(r.onPointerLeave,()=>{u.onTriggerLeave(),b.current=!1}),onPointerDown:Ce(r.onPointerDown,()=>{u.open&&u.onClose(),g.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Ce(r.onFocus,()=>{g.current||u.onOpen()}),onBlur:Ce(r.onBlur,u.onClose),onClick:Ce(r.onClick,u.onClose)})})},"TooltipTrigger")),s0="TooltipPortal",[rA,oA]=Vd(s0,{forceMount:void 0}),aA=vt(t=>{const{__scopeTooltip:r,forceMount:i,children:a,container:c}=t,l=$i(s0,r);return f.jsx(rA,{scope:r,forceMount:i,children:f.jsx(Fr,{present:i||l.open,children:f.jsx(ed,{asChild:!0,container:c,children:a})})})},"TooltipPortal"),Gi="TooltipContent",iA=E.forwardRef(vt(function(r,i){const a=oA(Gi,r.__scopeTooltip),{forceMount:c=a.forceMount,side:l="top",...u}=r,d=$i(Gi,r.__scopeTooltip);return f.jsx(Fr,{present:c||d.open,children:d.disableHoverableContent?f.jsx(l0,{side:l,...u,ref:i}):f.jsx(sA,{side:l,...u,ref:i})})},"TooltipContent")),sA=E.forwardRef(vt(function(r,i){const a=$i(Gi,r.__scopeTooltip),c=Yd(Gi,r.__scopeTooltip),l=E.useRef(null),u=ke(i,l),[d,m]=E.useState(null),{trigger:p,onClose:C}=a,g=l.current,{onPointerInTransitChange:b}=c,x=E.useCallback(()=>{m(null),b(!1)},[b]),v=E.useCallback((S,w)=>{const T=S.currentTarget,j={x:S.clientX,y:S.clientY},R=c0(j,T.getBoundingClientRect()),O=u0(j,R),M=d0(w.getBoundingClientRect()),D=h0([...O,...M]);m(D),b(!0)},[b]);return E.useEffect(()=>()=>x(),[x]),E.useEffect(()=>{if(p&&g){const S=vt(T=>v(T,g),"handleTriggerLeave"),w=vt(T=>v(T,p),"handleContentLeave");return p.addEventListener("pointerleave",S),g.addEventListener("pointerleave",w),()=>{p.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",w)}}},[p,g,v,x]),E.useEffect(()=>{if(d){const S=vt(w=>{const T=w.target,j={x:w.clientX,y:w.clientY},R=p?.contains(T)||g?.contains(T),O=!f0(j,d);R?x():O&&(x(),C())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[p,g,d,C,x]),f.jsx(l0,{...r,ref:u})},"TooltipContentHoverable")),lA=Cp("TooltipContent"),l0=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,children:c,"aria-label":l,id:u,onEscapeKeyDown:d,onPointerDownOutside:m,...p}=r,C=$i(Gi,a),g=Hl(a),{onClose:b}=C,[x,v]=E.useState(null),S=ke(i,v);lg(x),E.useEffect(()=>(document.addEventListener(qd,b),()=>document.removeEventListener(qd,b)),[b]),E.useEffect(()=>{if(C.trigger){const T=vt(j=>{j.target instanceof Node&&j.target.contains(C.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",T,{capture:!0}),()=>window.removeEventListener("scroll",T,{capture:!0})}},[C.trigger,b]);const{setContentId:w}=C;return lt(()=>(w(u),()=>{w(void 0)}),[u,w]),f.jsx(Yu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:T=>T.preventDefault(),onDismiss:b,children:f.jsxs(fy,{"data-state":C.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:C.contentId,...g,...p,ref:S,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(lA,{children:c}),l?f.jsx(aw,{id:C.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl")),cA=E.forwardRef(vt(function(r,i){const{__scopeTooltip:a,...c}=r,l=Hl(a);return f.jsx(lj,{...l,...c,ref:i})},"TooltipArrow"));function c0(t,r){const i=Math.abs(r.top-t.y),a=Math.abs(r.bottom-t.y),c=Math.abs(r.right-t.x),l=Math.abs(r.left-t.x);switch(Math.min(i,a,c,l)){case l:return"left";case c:return"right";case i:return"top";case a:return"bottom";default:throw new Error("unreachable")}}vt(c0,"getExitSideFromRect");function u0(t,r,i=5){const a=[];switch(r){case"top":a.push({x:t.x-i,y:t.y+i},{x:t.x+i,y:t.y+i});break;case"bottom":a.push({x:t.x-i,y:t.y-i},{x:t.x+i,y:t.y-i});break;case"left":a.push({x:t.x+i,y:t.y-i},{x:t.x+i,y:t.y+i});break;case"right":a.push({x:t.x-i,y:t.y-i},{x:t.x-i,y:t.y+i});break}return a}vt(u0,"getPaddedExitPoints");function d0(t){const{top:r,right:i,bottom:a,left:c}=t;return[{x:c,y:r},{x:i,y:r},{x:i,y:a},{x:c,y:a}]}vt(d0,"getPointsFromRect");function f0(t,r){const{x:i,y:a}=t;let c=!1;for(let l=0,u=r.length-1;l<r.length;u=l++){const d=r[l],m=r[u],p=d.x,C=d.y,g=m.x,b=m.y;C>a!=b>a&&i<(g-p)*(a-C)/(b-C)+p&&(c=!c)}return c}vt(f0,"isPointInPolygon");function h0(t){const r=t.slice();return r.sort((i,a)=>i.x<a.x?-1:i.x>a.x?1:i.y<a.y?-1:i.y>a.y?1:0),m0(r)}vt(h0,"getHull");function m0(t){if(t.length<=1)return t.slice();const r=[];for(let a=0;a<t.length;a++){const c=t[a];for(;r.length>=2;){const l=r[r.length-1],u=r[r.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))r.pop();else break}r.push(c)}r.pop();const i=[];for(let a=t.length-1;a>=0;a--){const c=t[a];for(;i.length>=2;){const l=i[i.length-1],u=i[i.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))i.pop();else break}i.push(c)}return i.pop(),r.length===1&&i.length===1&&r[0].x===i[0].x&&r[0].y===i[0].y?r:r.concat(i)}vt(m0,"getHullPresorted");function p0(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}vt(p0,"concatAriaDescribedby");function uA({delayDuration:t=0,...r}){return f.jsx(J2,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function dA({...t}){return f.jsx(tA,{"data-slot":"tooltip",...t})}function fA({...t}){return f.jsx(nA,{"data-slot":"tooltip-trigger",...t})}function hA({container:t,className:r,sideOffset:i=0,children:a,...c}){return f.jsx(aA,{container:t,children:f.jsxs(iA,{"data-slot":"tooltip-content",sideOffset:i,className:Ve("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",r),...c,children:[a,f.jsx(cA,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function g0(t){return t?.closest(".rt-menu-root, .rt-main-menu-root, .ui-dialog")||document.fullscreenElement||document.getElementById("uni-answer-sheet")||document.body}function mA({children:t}){return f.jsx(uA,{delayDuration:400,children:t})}const pA={"portal-wrapper":"_portal-wrapper_1eief_1"},gA={footer:"_footer_yp9z4_1"};/**
|
|
91
|
+
`)},pE=0,ba=[];function gE(t){var r=E.useRef([]),i=E.useRef([0,0]),a=E.useRef(),c=E.useState(pE++)[0],l=E.useState(vg)[0],u=E.useRef(t);E.useEffect(function(){u.current=t},[t]),E.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(c));var S=zw([t.lockRef.current],(t.shards||[]).map(Ag),!0).filter(Boolean);return S.forEach(function(w){return w.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(c))})}}},[t.inert,t.lockRef.current,t.shards]);var d=E.useCallback(function(S,w){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var T=pl(S),j=i.current,N="deltaX"in S?S.deltaX:j[0]-T[0],M="deltaY"in S?S.deltaY:j[1]-T[1],D,O=S.target,_=Math.abs(N)>Math.abs(M)?"h":"v";if("touches"in S&&_==="h"&&O.type==="range")return!1;var k=window.getSelection(),L=k&&k.anchorNode,B=L?L===O||L.contains(O):!1;if(B)return!1;var z=wg(_,O);if(!z)return!0;if(z?D=_:(D=_==="v"?"h":"v",z=wg(_,O)),!z)return!1;if(!a.current&&"changedTouches"in S&&(N||M)&&(a.current=D),!D)return!0;var U=a.current||D;return fE(U,w,S,U==="h"?N:M)},[]),m=E.useCallback(function(S){var w=S;if(!(!ba.length||ba[ba.length-1]!==l)){var T="deltaY"in w?jg(w):pl(w),j=r.current.filter(function(D){return D.name===w.type&&(D.target===w.target||w.target===D.shadowParent)&&hE(D.delta,T)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var N=(u.current.shards||[]).map(Ag).filter(Boolean).filter(function(D){return D.contains(w.target)}),M=N.length>0?d(w,N[0]):!u.current.noIsolation;M&&w.cancelable&&w.preventDefault()}}},[]),p=E.useCallback(function(S,w,T,j){var N={name:S,delta:w,target:T,should:j,shadowParent:yE(T)};r.current.push(N),setTimeout(function(){r.current=r.current.filter(function(M){return M!==N})},1)},[]),C=E.useCallback(function(S){i.current=pl(S),a.current=void 0},[]),g=E.useCallback(function(S){p(S.type,jg(S),S.target,d(S,t.lockRef.current))},[]),x=E.useCallback(function(S){p(S.type,pl(S),S.target,d(S,t.lockRef.current))},[]);E.useEffect(function(){return ba.push(l),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",m,xa),document.addEventListener("touchmove",m,xa),document.addEventListener("touchstart",C,xa),function(){ba=ba.filter(function(S){return S!==l}),document.removeEventListener("wheel",m,xa),document.removeEventListener("touchmove",m,xa),document.removeEventListener("touchstart",C,xa)}},[]);var b=t.removeScrollBar,v=t.inert;return E.createElement(E.Fragment,null,v?E.createElement(l,{styles:mE(c)}):null,b?E.createElement(aE,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function yE(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const xE=Yw(bg,gE);var id=E.forwardRef(function(t,r){return E.createElement(hl,Jn({},t,{ref:r,sideCar:xE}))});id.classNames=hl.classNames;var bE=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},va=new WeakMap,gl=new WeakMap,yl={},sd=0,Rg=function(t){return t&&(t.host||Rg(t.parentNode))},vE=function(t,r){return r.map(function(i){if(t.contains(i))return i;var a=Rg(i);return a&&t.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},SE=function(t,r,i,a){var c=vE(r,Array.isArray(t)?t:[t]);yl[i]||(yl[i]=new WeakMap);var l=yl[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(x){if(d.has(x))C(x);else try{var b=x.getAttribute(a),v=b!==null&&b!=="false",S=(va.get(x)||0)+1,w=(l.get(x)||0)+1;va.set(x,S),l.set(x,w),u.push(x),S===1&&v&&gl.set(x,!0),w===1&&x.setAttribute(i,"true"),v||x.setAttribute(a,"true")}catch(T){console.error("aria-hidden: cannot operate on ",x,T)}})};return C(r),d.clear(),sd++,function(){u.forEach(function(g){var x=va.get(g)-1,b=l.get(g)-1;va.set(g,x),l.set(g,b),x||(gl.has(g)||g.removeAttribute(a),gl.delete(g)),b||g.removeAttribute(i)}),sd--,sd||(va=new WeakMap,va=new WeakMap,gl=new WeakMap,yl={})}},Ng=function(t,r,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),c=bE(t);return c?(a.push.apply(a,Array.from(c.querySelectorAll("[aria-live], script"))),SE(a,c,i,"aria-hidden")):function(){return null}},CE=Object.defineProperty,Rn=(t,r)=>CE(t,"name",{value:r,configurable:!0}),ld="Dialog",[Og,IM]=An(ld),[wE,yr]=Og(ld),EE=Rn(t=>{const{__scopeDialog:r,children:i,open:a,defaultOpen:c,onOpenChange:l,modal:u=!0}=t,d=E.useRef(null),m=E.useRef(null),{nodes:p,registry:C}=sg(),[g,x]=hr({prop:a,defaultProp:c??!1,onChange:l,caller:ld}),[b,v]=E.useState(0),[S,w]=E.useState(0);return f.jsx(wE,{scope:r,triggerRef:d,contentRef:m,contentId:pr(),titleId:pr(),descriptionId:pr(),titlePresent:b>0,descriptionPresent:S>0,setTitleCount:v,setDescriptionCount:w,open:g,onOpenChange:x,onOpenToggle:E.useCallback(()=>x(T=>!T),[x]),modal:u,branchNodes:p,branchRegistry:C,children:i})},"Dialog"),Mg="DialogPortal",[TE,_g]=Og(Mg,{forceMount:void 0}),jE=Rn(t=>{const{__scopeDialog:r,forceMount:i,children:a,container:c}=t,l=yr(Mg,r);return f.jsx(TE,{scope:r,forceMount:i,children:E.Children.map(a,u=>f.jsx(Qr,{present:i||l.open,children:f.jsx(Ju,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),cd="DialogOverlay",AE=E.forwardRef(Rn(function(r,i){const a=_g(cd,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=yr(cd,r.__scopeDialog);return u.modal?f.jsx(Qr,{present:c||u.open,children:f.jsx(NE,{...l,ref:i})}):null},"DialogOverlay")),RE=fr("DialogOverlay.RemoveScroll"),NE=E.forwardRef(Rn(function(r,i){const{__scopeDialog:a,...c}=r,l=yr(cd,a),u=eg(),d=Ie(i,u);return f.jsx(id,{as:RE,allowPinchZoom:!0,shards:E.useMemo(()=>[l.contentRef,...l.branchNodes.map(m=>({current:m}))],[l.contentRef,l.branchNodes]),children:f.jsx(He.div,{"data-state":dd(l.open),...c,ref:d,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),ki="DialogContent",OE=E.forwardRef(Rn(function(r,i){const a=_g(ki,r.__scopeDialog),{forceMount:c=a.forceMount,...l}=r,u=yr(ki,r.__scopeDialog);return f.jsx(Qr,{present:c||u.open,children:u.modal?f.jsx(ME,{...l,ref:i}):f.jsx(_E,{...l,ref:i})})},"DialogContent")),ME=E.forwardRef(Rn(function(r,i){const a=yr(ki,r.__scopeDialog),c=E.useRef(null),l=Ie(i,a.contentRef,c);return E.useEffect(()=>{const u=c.current;if(u)return Ng(u)},[]),f.jsx(Dg,{...r,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Ce(r.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Ce(r.onPointerDownOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&u.preventDefault()}),onFocusOutside:Ce(r.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),_E=E.forwardRef(Rn(function(r,i){const a=yr(ki,r.__scopeDialog),c=E.useRef(!1),l=E.useRef(!1);return f.jsx(Dg,{...r,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{r.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||a.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,l.current=!1},onInteractOutside:u=>{r.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"DialogContentNonModal")),Dg=E.forwardRef(Rn(function(r,i){const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:u,"aria-describedby":d,children:m,...p}=r,C=yr(ki,a);return ul(),f.jsx(ig,{registry:C.branchRegistry,children:f.jsx(og,{asChild:!0,loop:!0,trapped:c,branches:C.branchNodes,onMountAutoFocus:l,onUnmountAutoFocus:u,children:f.jsx(qu,{role:"dialog",id:C.contentId,"aria-labelledby":C.titlePresent?C.titleId:void 0,"aria-describedby":C.descriptionPresent?Ig(d,C.descriptionId):d,"data-state":dd(C.open),...p,ref:i,deferPointerDownOutside:!0,onDismiss:()=>C.onOpenChange(!1),children:m})})})},"DialogContentImpl")),DE=E.forwardRef(Rn(function(r,i){const{__scopeDialog:a,...c}=r,l=yr("DialogTitle",a),{setTitleCount:u}=l;return st(()=>(u(d=>d+1),()=>u(d=>d-1)),[u]),f.jsx(He.h2,{id:l.titleId,...c,ref:i})},"DialogTitle")),IE="DialogClose",ud=E.forwardRef(Rn(function(r,i){const{__scopeDialog:a,...c}=r,l=yr(IE,a);return f.jsx(He.button,{type:"button",...c,ref:i,onClick:Ce(r.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Ig(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}Rn(Ig,"concatAriaDescribedby");function dd(t){return t?"open":"closed"}Rn(dd,"getState");var kE=Object.defineProperty,LE=(t,r)=>kE(t,"name",{value:r,configurable:!0});function Li(t){const[r,i]=E.useState(void 0);return 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}LE(Li,"useSize");var zE=Object.defineProperty,xr=(t,r)=>zE(t,"name",{value:r,configurable:!0}),fd="Checkbox",[BE,kM]=An(fd),[HE,hd]=BE(fd);function kg(t){const{__scopeCheckbox:r,checked:i,children:a,defaultChecked:c,disabled:l,form:u,name:d,onCheckedChange:m,required:p,value:C="on",internal_do_not_use_render:g}=t,[x,b]=hr({prop:i,defaultProp:c??!1,onChange:m,caller:fd}),[v,S]=E.useState(null),[w,T]=E.useState(null),[j,N]=E.useState(null),M=v?!!u||!!v.closest("form"):!0,D={checked:x,disabled:l,setChecked:b,control:v,setControl:S,name:d,form:u,value:C,userClick:j,onUserClick:N,required:p,defaultChecked:Nn(c)?!1:c,isFormControl:M,bubbleInput:w,setBubbleInput:T};return f.jsx(HE,{scope:r,...D,children:Lg(g)?g(D):a})}xr(kg,"CheckboxProvider");var PE="CheckboxTrigger",UE=E.forwardRef(xr(function({__scopeCheckbox:r,onKeyDown:i,onClick:a,...c},l){const{control:u,value:d,disabled:m,checked:p,required:C,setControl:g,setChecked:x,onUserClick:b,isFormControl:v,bubbleInput:S}=hd(PE,r),w=Ie(l,g),T=E.useRef(p);return E.useEffect(()=>{const j=u?.form;if(j){const N=xr(()=>x(T.current),"reset");return j.addEventListener("reset",N),()=>j.removeEventListener("reset",N)}},[u,x]),f.jsx(He.button,{type:"button",role:"checkbox","aria-checked":Nn(p)?"mixed":p,"aria-required":C,"data-state":md(p),"data-disabled":m?"":void 0,disabled:m,value:d,...c,ref:w,onKeyDown:Ce(i,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ce(a,j=>{const N=j.isPropagationStopped();b({requestedChecked:Nn(p)?!0:!p,hasConsumerStoppedPropagation:N}),x(M=>Nn(M)?!0:!M),S&&v&&(N||j.stopPropagation())})})},"CheckboxTrigger")),$E=E.forwardRef(xr(function(r,i){const{__scopeCheckbox:a,name:c,checked:l,defaultChecked:u,required:d,disabled:m,value:p,onCheckedChange:C,form:g,...x}=r;return f.jsx(kg,{__scopeCheckbox:a,checked:l,defaultChecked:u,disabled:m,required:d,onCheckedChange:C,name:c,form:g,value:p,internal_do_not_use_render:({isFormControl:b})=>f.jsxs(f.Fragment,{children:[f.jsx(UE,{...x,ref:i,__scopeCheckbox:a}),b&&f.jsx(YE,{__scopeCheckbox:a})]})})},"Checkbox")),GE="CheckboxIndicator",VE=E.forwardRef(xr(function(r,i){const{__scopeCheckbox:a,forceMount:c,...l}=r,u=hd(GE,a);return f.jsx(Qr,{present:c||Nn(u.checked)||u.checked===!0,children:f.jsx(He.span,{"data-state":md(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),qE="CheckboxBubbleInput",YE=E.forwardRef(xr(function({__scopeCheckbox:r,onClick:i,...a},c){const{control:l,userClick:u,checked:d,defaultChecked:m,required:p,disabled:C,name:g,value:x,form:b,bubbleInput:v,setBubbleInput:S}=hd(qE,r),w=Ie(c,S),T=Li(l),j=E.useRef(!1),N=E.useRef(d),M=E.useRef(u),D=E.useRef(null);E.useEffect(()=>{const _=v;if(!_)return;const k=window.HTMLInputElement.prototype,B=Object.getOwnPropertyDescriptor(k,"checked").set;if(!B)return;const z=N.current!==d;N.current=d;const U=u!==null&&u!==M.current;if(M.current=u,U)D.current=z?null:u,z&&(_.indeterminate=Nn(d),B.call(_,Nn(d)?!1:d)),_.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(z){const K=D.current;D.current=null;const $=K?.requestedChecked===d;j.current=!0,_.indeterminate=Nn(d),B.call(_,Nn(d)?!1:d),_.dispatchEvent(new Event("click",{bubbles:!($&&K.hasConsumerStoppedPropagation)})),j.current=!1}},[v,d,u]);const O=E.useRef(Nn(d)?!1:d);return f.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??O.current,required:p,disabled:C,name:g,value:x,form:b,...a,tabIndex:-1,ref:w,onClick:Ce(i,_=>{j.current&&_.stopPropagation()}),style:{...a.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Lg(t){return typeof t=="function"}xr(Lg,"isFunction");function Nn(t){return t==="indeterminate"}xr(Nn,"isIndeterminate");function md(t){return Nn(t)?"indeterminate":t?"checked":"unchecked"}xr(md,"getState");const XE=["top","right","bottom","left"],Zr=Math.min,br=Math.max,xl=Math.round,bl=Math.floor,vr=t=>({x:t,y:t}),KE={left:"right",right:"left",bottom:"top",top:"bottom"};function zg(t,r,i){return br(t,Zr(r,i))}function Sr(t,r){return typeof t=="function"?t(r):t}function Wr(t){return t.split("-")[0]}function Sa(t){return t.split("-")[1]}function pd(t){return t==="x"?"y":"x"}function gd(t){return t==="y"?"height":"width"}function er(t){const r=t[0];return r==="t"||r==="b"?"y":"x"}function yd(t){return pd(er(t))}function FE(t,r,i){i===void 0&&(i=!1);const a=Sa(t),c=yd(t),l=gd(c);let u=c==="x"?a===(i?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[l]>r.floating[l]&&(u=vl(u)),[u,vl(u)]}function QE(t){const r=vl(t);return[xd(t),r,xd(r)]}function xd(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Bg=["left","right"],Hg=["right","left"],ZE=["top","bottom"],WE=["bottom","top"];function JE(t,r,i){switch(t){case"top":case"bottom":return i?r?Hg:Bg:r?Bg:Hg;case"left":case"right":return r?ZE:WE;default:return[]}}function eT(t,r,i,a){const c=Sa(t);let l=JE(Wr(t),i==="start",a);return c&&(l=l.map(u=>u+"-"+c),r&&(l=l.concat(l.map(xd)))),l}function vl(t){const r=Wr(t);return KE[r]+t.slice(r.length)}function tT(t){var r,i,a,c;return{top:(r=t.top)!=null?r:0,right:(i=t.right)!=null?i:0,bottom:(a=t.bottom)!=null?a:0,left:(c=t.left)!=null?c:0}}function Pg(t){return typeof t!="number"?tT(t):{top:t,right:t,bottom:t,left:t}}function Sl(t){const{x:r,y:i,width:a,height:c}=t;return{width:a,height:c,top:i,left:r,right:r+a,bottom:i+c,x:r,y:i}}function Ug(t,r,i){let{reference:a,floating:c}=t;const l=er(r),u=yd(r),d=gd(u),m=Wr(r),p=l==="y",C=a.x+a.width/2-c.width/2,g=a.y+a.height/2-c.height/2,x=a[d]/2-c[d]/2;let b;switch(m){case"top":b={x:C,y:a.y-c.height};break;case"bottom":b={x:C,y:a.y+a.height};break;case"right":b={x:a.x+a.width,y:g};break;case"left":b={x:a.x-c.width,y:g};break;default:b={x:a.x,y:a.y}}const v=Sa(r);return v&&(b[u]+=x*(v==="end"?1:-1)*(i&&p?-1:1)),b}async function nT(t,r){var i;r===void 0&&(r={});const{x:a,y:c,platform:l,rects:u,elements:d,strategy:m}=t,{boundary:p="clippingAncestors",rootBoundary:C="viewport",elementContext:g="floating",altBoundary:x=!1,padding:b=0}=Sr(r,t),v=Pg(b),w=d[x?g==="floating"?"reference":"floating":g],T=Sl(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,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),M=await(l.isElement==null?void 0:l.isElement(N))&&await(l.getScale==null?void 0:l.getScale(N))||{x:1,y:1},D=Sl(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:j,offsetParent:N,strategy:m}):j);return{top:(T.top-D.top+v.top)/M.y,bottom:(D.bottom-T.bottom+v.bottom)/M.y,left:(T.left-D.left+v.left)/M.x,right:(D.right-T.right+v.right)/M.x}}const rT=50,oT=async(t,r,i)=>{const{placement:a="bottom",strategy:c="absolute",middleware:l=[],platform:u}=i,d=u.detectOverflow?u:{...u,detectOverflow:nT},m=await(u.isRTL==null?void 0:u.isRTL(r));let p=await u.getElementRects({reference:t,floating:r,strategy:c}),{x:C,y:g}=Ug(p,a,m),x=a,b=0;const v={};for(let S=0;S<l.length;S++){const w=l[S];if(!w)continue;const{name:T,fn:j}=w,{x:N,y:M,data:D,reset:O}=await j({x:C,y:g,initialPlacement:a,placement:x,strategy:c,middlewareData:v,rects:p,platform:d,elements:{reference:t,floating:r}});C=N??C,g=M??g,v[T]={...v[T],...D},O&&b<rT&&(b++,typeof O=="object"&&(O.placement&&(x=O.placement),O.rects&&(p=O.rects===!0?await u.getElementRects({reference:t,floating:r,strategy:c}):O.rects),{x:C,y:g}=Ug(p,x,m)),S=-1)}return{x:C,y:g,placement:x,strategy:c,middlewareData:v}},aT=t=>({name:"arrow",options:t,async fn(r){const{x:i,y:a,placement:c,rects:l,platform:u,elements:d,middlewareData:m}=r,{element:p,padding:C=0}=Sr(t,r)||{};if(p==null)return{};const g=Pg(C),x={x:i,y:a},b=yd(c),v=gd(b),S=await u.getDimensions(p),w=b==="y",T=w?"top":"left",j=w?"bottom":"right",N=w?"clientHeight":"clientWidth",M=l.reference[v]+l.reference[b]-x[b]-l.floating[v],D=x[b]-l.reference[b],O=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let _=O?O[N]:0;(!_||!await(u.isElement==null?void 0:u.isElement(O)))&&(_=d.floating[N]||l.floating[v]);const k=M/2-D/2,L=_/2-S[v]/2-1,B=Zr(g[T],L),z=Zr(g[j],L),U=_-S[v]-z,K=_/2-S[v]/2+k,$=zg(B,K,U),ee=!m.arrow&&Sa(c)!=null&&K!==$&&l.reference[v]/2-(K<B?B:z)-S[v]/2<0,G=ee?K<B?K-B:K-U:0;return{[b]:x[b]+G,data:{[b]:$,centerOffset:K-$-G,...ee&&{alignmentOffset:G}},reset:ee}}}),iT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var i,a;const{placement:c,middlewareData:l,rects:u,initialPlacement:d,platform:m,elements:p}=r,{mainAxis:C=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:S=!0,...w}=Sr(t,r);if((i=l.arrow)!=null&&i.alignmentOffset)return{};const T=Wr(c),j=er(d),N=Wr(d)===d,M=await(m.isRTL==null?void 0:m.isRTL(p.floating)),D=x||(N||!S?[vl(d)]:QE(d)),O=v!=="none";!x&&O&&D.push(...eT(d,S,v,M));const _=[d,...D],k=await m.detectOverflow(r,w),L=[];let B=((a=l.flip)==null?void 0:a.overflows)||[];if(C&&L.push(k[T]),g){const $=FE(c,u,M);L.push(k[$[0]],k[$[1]])}if(B=[...B,{placement:c,overflows:L}],!L.every($=>$<=0)){var z,U;const $=(((z=l.flip)==null?void 0:z.index)||0)+1,ee=_[$];if(ee&&(!(g==="alignment"?j!==er(ee):!1)||B.every(H=>er(H.placement)===j?H.overflows[0]>0:!0)))return{data:{index:$,overflows:B},reset:{placement:ee}};let G=(U=B.filter(q=>q.overflows[0]<=0).sort((q,H)=>q.overflows[1]-H.overflows[1])[0])==null?void 0:U.placement;if(!G)switch(b){case"bestFit":{var K;const q=(K=B.filter(H=>{if(O){const P=er(H.placement);return P===j||P==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(P=>P>0).reduce((P,A)=>P+A,0)]).sort((H,P)=>H[1]-P[1])[0])==null?void 0:K[0];q&&(G=q);break}case"initialPlacement":G=d;break}if(c!==G)return{reset:{placement:G}}}return{}}}};function $g(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function Gg(t){return XE.some(r=>t[r]>=0)}const sT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:i,platform:a}=r,{strategy:c="referenceHidden",...l}=Sr(t,r);switch(c){case"referenceHidden":{const u=await a.detectOverflow(r,{...l,elementContext:"reference"}),d=$g(u,i.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Gg(d)}}}case"escaped":{const u=await a.detectOverflow(r,{...l,altBoundary:!0}),d=$g(u,i.floating);return{data:{escapedOffsets:d,escaped:Gg(d)}}}default:return{}}}}},Vg=new Set(["left","top"]);async function lT(t,r){const{placement:i,platform:a,elements:c}=t,l=await(a.isRTL==null?void 0:a.isRTL(c.floating)),u=Wr(i),d=Sa(i),m=er(i)==="y",p=Vg.has(u)?-1:1,C=l&&m?-1:1,g=Sr(r,t);let{mainAxis:x,crossAxis:b,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof v=="number"&&(b=d==="end"?v*-1:v),m?{x:b*C,y:x*p}:{x:x*p,y:b*C}}const cT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var i,a;const{x:c,y:l,placement:u,middlewareData:d}=r,m=await lT(r,t);return u===((i=d.offset)==null?void 0:i.placement)&&(a=d.arrow)!=null&&a.alignmentOffset?{}:{x:c+m.x,y:l+m.y,data:{...m,placement:u}}}}},uT=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:i,y:a,placement:c,platform:l}=r,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:j=>{let{x:N,y:M}=j;return{x:N,y:M}}},...p}=Sr(t,r),C={x:i,y:a},g=await l.detectOverflow(r,p),x=er(c),b=pd(x);let v=C[b],S=C[x];const w=(j,N)=>zg(N+g[j==="y"?"top":"left"],N,N-g[j==="y"?"bottom":"right"]);u&&(v=w(b,v)),d&&(S=w(x,S));const T=m.fn({...r,[b]:v,[x]:S});return{...T,data:{x:T.x-i,y:T.y-a,enabled:{[b]:u,[x]:d}}}}}},dT=function(t){return t===void 0&&(t={}),{options:t,fn(r){var i,a;const{x:c,y:l,placement:u,rects:d,middlewareData:m}=r,{offset:p=0,mainAxis:C=!0,crossAxis:g=!0}=Sr(t,r),x={x:c,y:l},b=er(u),v=pd(b);let S=x[v],w=x[b];const T=Sr(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 D=v==="y"?"height":"width",O=d.reference[v]-d.floating[D]+j.mainAxis,_=d.reference[v]+d.reference[D]-j.mainAxis;S<O?S=O:S>_&&(S=_)}if(g){var N,M;const D=v==="y"?"width":"height",O=Vg.has(Wr(u)),_=d.reference[b]-d.floating[D]+(O&&((N=m.offset)==null?void 0:N[b])||0)+(O?0:j.crossAxis),k=d.reference[b]+d.reference[D]+(O?0:((M=m.offset)==null?void 0:M[b])||0)-(O?j.crossAxis:0);w<_?w=_:w>k&&(w=k)}return{[v]:S,[b]:w}}}},fT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){const{placement:i,rects:a,platform:c,elements:l}=r,{apply:u=()=>{},...d}=Sr(t,r),m=await c.detectOverflow(r,d),p=Wr(i),C=Sa(i),g=er(i)==="y",{width:x,height:b}=a.floating;let v,S;p==="top"||p==="bottom"?(v=p,S=C===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(S=p,v=C==="end"?"top":"bottom");const w=b-m.top-m.bottom,T=x-m.left-m.right,j=Zr(b-m[v],w),N=Zr(x-m[S],T),M=r.middlewareData.shift,D=!M;let O=j,_=N;M!=null&&M.enabled.x&&(_=T),M!=null&&M.enabled.y&&(O=w),D&&!C&&(g?_=x-2*br(m.left,m.right):O=b-2*br(m.top,m.bottom)),await u({...r,availableWidth:_,availableHeight:O});const k=await c.getDimensions(l.floating);return x!==k.width||b!==k.height?{reset:{rects:!0}}:{}}}};function Cl(){return typeof window<"u"}function Ca(t){return qg(t)?(t.nodeName||"").toLowerCase():"#document"}function tn(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Cr(t){var r;return(r=(qg(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function qg(t){return Cl()?t instanceof Node||t instanceof tn(t).Node:!1}function tr(t){return Cl()?t instanceof Element||t instanceof tn(t).Element:!1}function Jr(t){return Cl()?t instanceof HTMLElement||t instanceof tn(t).HTMLElement:!1}function Yg(t){return!Cl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof tn(t).ShadowRoot}function wl(t){const{overflow:r,overflowX:i,overflowY:a,display:c}=nr(t);return/auto|scroll|overlay|hidden|clip/.test(r+a+i)&&c!=="inline"&&c!=="contents"}function hT(t){return/^(table|td|th)$/.test(Ca(t))}function El(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const mT=/transform|translate|scale|rotate|perspective|filter/,pT=/paint|layout|strict|content/,Mo=t=>!!t&&t!=="none";let bd;function vd(t){const r=tr(t)?nr(t):t;return Mo(r.transform)||Mo(r.translate)||Mo(r.scale)||Mo(r.rotate)||Mo(r.perspective)||!Sd()&&(Mo(r.backdropFilter)||Mo(r.filter))||mT.test(r.willChange||"")||pT.test(r.contain||"")}function gT(t){let r=_o(t);for(;Jr(r)&&!zi(r);){if(vd(r))return r;if(El(r))return null;r=_o(r)}return null}function Sd(){return bd==null&&(bd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),bd}function zi(t){return/^(html|body|#document)$/.test(Ca(t))}function nr(t){return tn(t).getComputedStyle(t)}function Tl(t){return tr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function _o(t){if(Ca(t)==="html")return t;const r=t.assignedSlot||t.parentNode||Yg(t)&&t.host||Cr(t);return Yg(r)?r.host:r}function Xg(t){const r=_o(t);return zi(r)?(t.ownerDocument||t).body:Jr(r)&&wl(r)?r:Xg(r)}function Bi(t,r,i){var a;r===void 0&&(r=[]),i===void 0&&(i=!0);const c=Xg(t),l=c===((a=t.ownerDocument)==null?void 0:a.body),u=tn(c);if(l){const d=Cd(u);return r.concat(u,u.visualViewport||[],wl(c)?c:[],d&&i?Bi(d):[])}else return r.concat(c,Bi(c,[],i))}function Cd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Kg(t){const r=nr(t);let i=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const c=Jr(t),l=c?t.offsetWidth:i,u=c?t.offsetHeight:a,d=xl(i)!==l||xl(a)!==u;return d&&(i=l,a=u),{width:i,height:a,$:d}}function wd(t){return tr(t)?t:t.contextElement}function wa(t){const r=wd(t);if(!Jr(r))return vr(1);const i=r.getBoundingClientRect(),{width:a,height:c,$:l}=Kg(r);let u=(l?xl(i.width):i.width)/a,d=(l?xl(i.height):i.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const yT=vr(0);function Fg(t){const r=tn(t);return!Sd()||!r.visualViewport?yT:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function xT(t,r,i){return r===void 0&&(r=!1),!!i&&r&&i===tn(t)}function Do(t,r,i,a){r===void 0&&(r=!1),i===void 0&&(i=!1);const c=t.getBoundingClientRect(),l=wd(t);let u=vr(1);r&&(a?tr(a)&&(u=wa(a)):u=wa(t));const d=xT(l,i,a)?Fg(l):vr(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 x=tn(l),b=tr(a)?tn(a):a;let v=x,S=Cd(v);for(;S&&b!==v;){const w=wa(S),T=S.getBoundingClientRect(),j=nr(S),N=T.left+(S.clientLeft+parseFloat(j.paddingLeft))*w.x,M=T.top+(S.clientTop+parseFloat(j.paddingTop))*w.y;m*=w.x,p*=w.y,C*=w.x,g*=w.y,m+=N,p+=M,v=tn(S),S=Cd(v)}}return Sl({width:C,height:g,x:m,y:p})}function jl(t,r){const i=Tl(t).scrollLeft;return r?r.left+i:Do(Cr(t)).left+i}function Qg(t,r){const i=t.getBoundingClientRect(),a=i.left+r.scrollLeft-jl(t,i),c=i.top+r.scrollTop;return{x:a,y:c}}function bT(t){let{elements:r,rect:i,offsetParent:a,strategy:c}=t;const l=c==="fixed",u=Cr(a),d=r?El(r.floating):!1;if(a===u||d&&l)return i;let m={scrollLeft:0,scrollTop:0},p=vr(1);const C=vr(0),g=Jr(a);if((g||!l)&&((Ca(a)!=="body"||wl(u))&&(m=Tl(a)),g)){const b=Do(a);p=wa(a),C.x=b.x+a.clientLeft,C.y=b.y+a.clientTop}const x=u&&!g&&!l?Qg(u,m):vr(0);return{width:i.width*p.x,height:i.height*p.y,x:i.x*p.x-m.scrollLeft*p.x+C.x+x.x,y:i.y*p.y-m.scrollTop*p.y+C.y+x.y}}function vT(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function ST(t){const r=Tl(t),i=t.ownerDocument.body,a=br(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),c=br(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-r.scrollLeft+jl(t);const u=-r.scrollTop;return nr(i).direction==="rtl"&&(l+=br(t.clientWidth,i.clientWidth)-a),{width:a,height:c,x:l,y:u}}const CT=25;function wT(t,r,i){i===void 0&&(i="viewport");const a=i==="layoutViewport",c=tn(t),l=Cr(t),u=c.visualViewport;let d=l.clientWidth,m=l.clientHeight,p=0,C=0;if(u){const x=!Sd()||r==="fixed";a?x||(p=-u.offsetLeft,C=-u.offsetTop):(d=u.width,m=u.height,x&&(p=u.offsetLeft,C=u.offsetTop))}if(jl(l)<=0){const x=l.ownerDocument,b=x.body,v=getComputedStyle(b),S=x.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(l.clientWidth-b.clientWidth-S),T=getComputedStyle(l).scrollbarGutter==="stable both-edges"?w/2:w;T<=CT&&(d-=T)}return{width:d,height:m,x:p,y:C}}function ET(t,r){const i=Do(t,!0,r==="fixed"),a=i.top+t.clientTop,c=i.left+t.clientLeft,l=wa(t),u=t.clientWidth*l.x,d=t.clientHeight*l.y,m=c*l.x,p=a*l.y;return{width:u,height:d,x:m,y:p}}function Zg(t,r,i){let a;if(r==="viewport"||r==="layoutViewport")a=wT(t,i,r);else if(r==="document")a=ST(Cr(t));else if(tr(r))a=ET(r,i);else{const c=Fg(t);a={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return Sl(a)}function TT(t,r){const i=r.get(t);if(i)return i;let a=Bi(t,[],!1).filter(d=>tr(d)&&Ca(d)!=="body"),c=null;const l=nr(t).position==="fixed";let u=l?_o(t):t;for(;tr(u)&&!zi(u);){const d=nr(u),m=vd(u),p=c?c.position:l?"fixed":"";!m&&(p==="fixed"||p==="absolute"&&d.position==="static")?a=a.filter(g=>g!==u):c=d,u=_o(u)}return r.set(t,a),a}function jT(t){let{element:r,boundary:i,rootBoundary:a,strategy:c}=t;const u=[...i==="clippingAncestors"?El(r)?[]:TT(r,this._c):[].concat(i),a],d=Zg(r,u[0],c);let m=d.top,p=d.right,C=d.bottom,g=d.left;for(let x=1;x<u.length;x++){const b=Zg(r,u[x],c);m=br(b.top,m),p=Zr(b.right,p),C=Zr(b.bottom,C),g=br(b.left,g)}return{width:p-g,height:C-m,x:g,y:m}}function AT(t){const{width:r,height:i}=Kg(t);return{width:r,height:i}}function RT(t,r,i){const a=Jr(r),c=Cr(r),l=i==="fixed",u=Do(t,!0,l,r);let d={scrollLeft:0,scrollTop:0};const m=vr(0);if((a||!l)&&((Ca(r)!=="body"||wl(c))&&(d=Tl(r)),a)){const x=Do(r,!0,l,r);m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}!a&&c&&(m.x=jl(c));const p=c&&!a&&!l?Qg(c,d):vr(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 Ed(t){return nr(t).position==="static"}function Wg(t,r){if(!Jr(t)||nr(t).position==="fixed")return null;if(r)return r(t);let i=t.offsetParent;return Cr(t)===i&&(i=i.ownerDocument.body),i}function Jg(t,r){const i=tn(t);if(El(t))return i;if(!Jr(t)){let c=_o(t);for(;c&&!zi(c);){if(tr(c)&&!Ed(c))return c;c=_o(c)}return i}let a=Wg(t,r);for(;a&&hT(a)&&Ed(a);)a=Wg(a,r);return a&&zi(a)&&Ed(a)&&!vd(a)?i:a||gT(t)||i}const NT=async function(t){const r=this.getOffsetParent||Jg,i=this.getDimensions,a=await i(t.floating);return{reference:RT(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function OT(t){return nr(t).direction==="rtl"}const MT={convertOffsetParentRelativeRectToViewportRelativeRect:bT,getDocumentElement:Cr,getClippingRect:jT,getOffsetParent:Jg,getElementRects:NT,getClientRects:vT,getDimensions:AT,getScale:wa,isElement:tr,isRTL:OT};function ey(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function _T(t,r,i){let a=null,c;const l=Cr(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 x=t.getBoundingClientRect(),{left:b,top:v,width:S,height:w}=x;if(C||r(),!S||!w)return;const T=bl(v),j=bl(l.clientWidth-(b+S)),N=bl(l.clientHeight-(v+w)),M=bl(b),O={rootMargin:-T+"px "+-j+"px "+-N+"px "+-M+"px",threshold:br(0,Zr(1,g))||1};let _=!0;function k(L){const B=L[0].intersectionRatio;if(!ey(x,t.getBoundingClientRect()))return d();if(B!==g){if(!_)return d();B?d(!1,B):c=setTimeout(()=>{d(!1,1e-7)},1e3)}_=!1}try{a=new IntersectionObserver(k,{...O,root:l.ownerDocument})}catch{a=new IntersectionObserver(k,O)}a.observe(t)}const m=tn(t),p=()=>d(i);return m.addEventListener("resize",p),d(!0),()=>{m.removeEventListener("resize",p),u()}}function DT(t,r,i,a){a===void 0&&(a={});const{ancestorScroll:c=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=a,p=wd(t),C=c||l?[...p?Bi(p):[],...r?Bi(r):[]]:[];C.forEach(T=>{c&&T.addEventListener("scroll",i),l&&T.addEventListener("resize",i)});const g=p&&d?_T(p,i,l):null;let x=-1,b=null;u&&(b=new ResizeObserver(T=>{let[j]=T;j&&j.target===p&&b&&r&&(b.unobserve(r),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var N;(N=b)==null||N.observe(r)})),i()}),p&&!m&&b.observe(p),r&&b.observe(r));let v,S=m?Do(t):null;m&&w();function w(){const T=Do(t);S&&!ey(S,T)&&i(),S=T,v=requestAnimationFrame(w)}return i(),()=>{var T;C.forEach(j=>{c&&j.removeEventListener("scroll",i),l&&j.removeEventListener("resize",i)}),g?.(),(T=b)==null||T.disconnect(),b=null,m&&cancelAnimationFrame(v)}}const IT=cT,kT=uT,LT=iT,zT=fT,BT=sT,ty=aT,HT=dT,PT=(t,r,i)=>{const a=new Map,c=i??{},l={...MT,...c.platform,_c:a};return oT(t,r,{...c,platform:l})};var UT=typeof document<"u",$T=function(){},Al=UT?E.useLayoutEffect:$T;function Rl(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(!Rl(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)&&!Rl(t[l],r[l]))return!1}return!0}return t!==t&&r!==r}function ny(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ry(t,r){const i=ny(t);return Math.round(r*i)/i}function Td(t){const r=E.useRef(t);return Al(()=>{r.current=t}),r}function GT(t){t===void 0&&(t={});const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:c,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:p}=t,[C,g]=E.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[x,b]=E.useState(a);Rl(x,a)||b(a);const[v,S]=E.useState(null),[w,T]=E.useState(null),j=E.useCallback(H=>{H!==O.current&&(O.current=H,S(H))},[]),N=E.useCallback(H=>{H!==_.current&&(_.current=H,T(H))},[]),M=l||v,D=u||w,O=E.useRef(null),_=E.useRef(null),k=E.useRef(C),L=m!=null,B=Td(m),z=Td(c),U=Td(p),K=E.useCallback(()=>{if(!O.current||!_.current)return;const H={placement:r,strategy:i,middleware:x};z.current&&(H.platform=z.current),PT(O.current,_.current,H).then(P=>{const A={...P,isPositioned:U.current!==!1};$.current&&!Rl(k.current,A)&&(k.current=A,Xr.flushSync(()=>{g(A)}))})},[x,r,i,z,U]);Al(()=>{p===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,g(H=>({...H,isPositioned:!1})))},[p]);const $=E.useRef(!1);Al(()=>($.current=!0,()=>{$.current=!1}),[]),Al(()=>{if(M&&(O.current=M),D&&(_.current=D),M&&D){if(B.current)return B.current(M,D,K);K()}},[M,D,K,B,L]);const ee=E.useMemo(()=>({reference:O,floating:_,setReference:j,setFloating:N}),[j,N]),G=E.useMemo(()=>({reference:M,floating:D}),[M,D]),q=E.useMemo(()=>{const H={position:i,left:0,top:0};if(!G.floating)return H;const P=ry(G.floating,C.x),A=ry(G.floating,C.y);return d?{...H,transform:"translate("+P+"px, "+A+"px)",...ny(G.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:P,top:A}},[i,d,G.floating,C.x,C.y]);return E.useMemo(()=>({...C,update:K,refs:ee,elements:G,floatingStyles:q}),[C,K,ee,G,q])}const VT=t=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:t,fn(i){const{element:a,padding:c}=typeof t=="function"?t(i):t;return a&&r(a)?a.current!=null?ty({element:a.current,padding:c}).fn(i):{}:a?ty({element:a,padding:c}).fn(i):{}}}},qT=(t,r)=>{const i=IT(t);return{name:i.name,fn:i.fn,options:[t,r]}},YT=(t,r)=>{const i=kT(t);return{name:i.name,fn:i.fn,options:[t,r]}},XT=(t,r)=>({fn:HT(t).fn,options:[t,r]}),KT=(t,r)=>{const i=LT(t);return{name:i.name,fn:i.fn,options:[t,r]}},FT=(t,r)=>{const i=zT(t);return{name:i.name,fn:i.fn,options:[t,r]}},QT=(t,r)=>{const i=BT(t);return{name:i.name,fn:i.fn,options:[t,r]}},ZT=(t,r)=>{const i=VT(t);return{name:i.name,fn:i.fn,options:[t,r]}};var WT=Object.defineProperty,JT=(t,r)=>WT(t,"name",{value:r,configurable:!0}),ej=E.forwardRef(JT(function(r,i){const{children:a,width:c=10,height:l=5,...u}=r;return f.jsx(He.svg,{...u,ref:i,width:c,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?a:f.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),tj=Object.defineProperty,wr=(t,r)=>tj(t,"name",{value:r,configurable:!0}),oy={Partial:"partial"},ay={Optimized:"optimized",Always:"always"},iy="Popper",[sy,Nl]=An(iy),[nj,ly]=sy(iy),cy=wr(t=>{const{__scopePopper:r,children:i}=t,[a,c]=E.useState(null),[l,u]=E.useState(void 0);return f.jsx(nj,{scope:r,anchor:a,onAnchorChange:c,placementState:l,setPlacementState:u,children:i})},"Popper"),rj="PopperAnchor",uy=E.forwardRef(wr(function(r,i){const{__scopePopper:a,virtualRef:c,...l}=r,u=ly(rj,a),d=E.useRef(null),m=u.onAnchorChange,p=E.useCallback(S=>{d.current=S,S&&m(S)},[m]),C=Ie(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 x=u.placementState&&Ol(u.placementState),b=x?.[0],v=x?.[1];return c?null:f.jsx(He.div,{"data-radix-popper-side":b,"data-radix-popper-align":v,...l,ref:C})},"PopperAnchor")),dy="PopperContent",[oj,aj]=sy(dy),fy=E.forwardRef(wr(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:x=oy.Partial,hideWhenDetached:b=!1,updatePositionStrategy:v=ay.Optimized,onPlaced:S,...w}=r,T=ly(dy,a),[j,N]=E.useState(null),M=Ie(i,N),[D,O]=E.useState(null),_=Li(D),k=_?.width??0,L=_?.height??0,B=c+(u!=="center"?"-"+u:""),z=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},U=Array.isArray(C)?C:[C],K=U.length>0,$={padding:z,boundary:U.filter(hy),altBoundary:K},{refs:ee,floatingStyles:G,placement:q,isPositioned:H,middlewareData:P}=GT({strategy:"fixed",placement:B,whileElementsMounted:wr((...ge)=>DT(...ge,{animationFrame:v===ay.Always}),"whileElementsMounted"),elements:{reference:T.anchor},middleware:[qT({mainAxis:l+L,alignmentAxis:d}),p&&YT({mainAxis:!0,crossAxis:!1,...x===oy.Partial?{limiter:XT()}:{},...$}),p&&KT({...$}),FT({...$,apply:wr(({elements:ge,rects:de,availableWidth:_e,availableHeight:Me})=>{const{width:Ee,height:ve}=de.reference,Te=ge.floating.style;Te.setProperty("--radix-popper-available-width",`${_e}px`),Te.setProperty("--radix-popper-available-height",`${Me}px`),Te.setProperty("--radix-popper-anchor-width",`${Ee}px`),Te.setProperty("--radix-popper-anchor-height",`${ve}px`)},"apply")}),D&&ZT({element:D,padding:m}),cj({arrowWidth:k,arrowHeight:L}),b&&QT(K?{strategy:"referenceHidden",...$}:{strategy:"referenceHidden",padding:$.padding,altBoundary:$.altBoundary})]}),A=T.setPlacementState;st(()=>(A(q),()=>{A(void 0)}),[q,A]);const[Y,F]=Ol(q),Z=$n(S);st(()=>{H&&Z?.()},[H,Z]);const le=P.arrow?.x,re=P.arrow?.y,ae=P.arrow?.centerOffset!==0,[be,ye]=E.useState();return st(()=>{j&&ye(window.getComputedStyle(j).zIndex)},[j]),f.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:H?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:f.jsx(oj,{scope:a,placedSide:Y,placedAlign:F,onArrowChange:O,arrowX:le,arrowY:re,shouldHideArrow:ae,children:f.jsx(He.div,{"data-side":Y,"data-align":F,...w,ref:M,style:{...w.style,animation:H?w.style?.animation:"none"}})})})},"PopperContent")),ij="PopperArrow",sj={top:"bottom",right:"left",bottom:"top",left:"right"},lj=E.forwardRef(wr(function(r,i){const{__scopePopper:a,...c}=r,l=aj(ij,a),u=sj[l.placedSide];return f.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:f.jsx(ej,{...c,ref:i,style:{...c.style,display:"block"}})})},"PopperArrow"));function hy(t){return t!==null}wr(hy,"isNotNull");var cj=wr(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]=Ol(i),g={start:"0%",center:"50%",end:"100%"}[C],x=(c.arrow?.x??0)+d/2,b=(c.arrow?.y??0)+m/2;let v="",S="";return p==="bottom"?(v=u?g:`${x}px`,S=`${-m}px`):p==="top"?(v=u?g:`${x}px`,S=`${a.floating.height+m}px`):p==="right"?(v=`${-m}px`,S=u?g:`${b}px`):p==="left"&&(v=`${a.floating.width+m}px`,S=u?g:`${b}px`),{data:{x:v,y:S}}}}),"transformOrigin");function Ol(t){const[r,i="center"]=t.split("-");return[r,i]}wr(Ol,"getSideAndAlignFromPlacement");var uj=Object.defineProperty,jd=(t,r)=>uj(t,"name",{value:r,configurable:!0}),Ad=!1;function my(){const[t,r]=E.useState(Ad);return E.useEffect(()=>{Ad||(Ad=!0,r(!0))},[]),t}jd(my,"useIsHydrated");var py=Ro[" useSyncExternalStore ".trim().toString()];function gy(){return()=>{}}jd(gy,"subscribe");function yy(){return py(gy,()=>!0,()=>!1)}jd(yy,"useIsHydratedModern");var dj=typeof py=="function"?yy:my,fj=Object.defineProperty,Io=(t,r)=>fj(t,"name",{value:r,configurable:!0}),Rd="rovingFocusGroup.onEntryFocus",hj={bubbles:!1,cancelable:!0},Ml="RovingFocusGroup",[Nd,xy,mj]=al(Ml),[pj,by]=An(Ml,[mj]),vy={Vertical:"vertical",Horizontal:"horizontal"},gj={RTL:"rtl"},[yj,xj]=pj(Ml),bj=E.forwardRef(Io(function(r,i){return f.jsx(Nd.Provider,{scope:r.__scopeRovingFocusGroup,children:f.jsx(Nd.Slot,{scope:r.__scopeRovingFocusGroup,children:f.jsx(vj,{...r,ref:i})})})},"RovingFocusGroup")),vj=E.forwardRef(Io(function(r,i){const{__scopeRovingFocusGroup:a,orientation:c,loop:l=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:C,preventScrollOnEntryFocus:g=!1,...x}=r,b=E.useRef(null),v=Ie(i,b),S=Ii(u),[w,T]=hr({prop:d,defaultProp:m??null,onChange:p,caller:Ml}),[j,N]=E.useState(!1),M=$n(C),D=xy(a),O=E.useRef(!1),[_,k]=E.useState(0);return E.useEffect(()=>{const L=b.current;if(L)return L.addEventListener(Rd,M),()=>L.removeEventListener(Rd,M)},[M]),f.jsx(yj,{scope:a,orientation:c,dir:S,loop:l,currentTabStopId:w,onItemFocus:E.useCallback(L=>T(L),[T]),onItemShiftTab:E.useCallback(()=>N(!0),[]),onFocusableItemAdd:E.useCallback(()=>k(L=>L+1),[]),onFocusableItemRemove:E.useCallback(()=>k(L=>L-1),[]),children:f.jsx(He.div,{tabIndex:j||_===0?-1:0,"data-orientation":c,...x,ref:v,style:{outline:"none",...r.style},onMouseDown:Ce(r.onMouseDown,()=>{O.current=!0}),onFocus:Ce(r.onFocus,L=>{const B=!O.current;if(L.target===L.currentTarget&&B&&!j){const z=new CustomEvent(Rd,hj);if(L.currentTarget.dispatchEvent(z),!z.defaultPrevented){const U=D().filter(q=>q.focusable),K=U.find(q=>q.active),$=U.find(q=>q.id===w),G=[K,$,...U].filter(Boolean).map(q=>q.ref.current);Od(G,g)}}O.current=!1}),onBlur:Ce(r.onBlur,()=>N(!1))})})},"RovingFocusGroupImpl")),Sj="RovingFocusGroupItem",Cj=E.forwardRef(Io(function(r,i){const{__scopeRovingFocusGroup:a,focusable:c=!0,active:l=!1,tabStopId:u,children:d,...m}=r,p=pr(),C=u||p,g=xj(Sj,a),x=g.currentTabStopId===C,b=xy(a),{onFocusableItemAdd:v,onFocusableItemRemove:S,currentTabStopId:w}=g,T=dj();return st(()=>{if(!(!T||!c))return v(),()=>S()},[T,c,v,S]),E.useEffect(()=>{if(!(T||!c))return v(),()=>S()},[T,c,v,S]),f.jsx(Nd.ItemSlot,{scope:a,id:C,focusable:c,active:l,children:f.jsx(He.span,{tabIndex:x?0:-1,"data-orientation":g.orientation,...m,ref:i,onMouseDown:Ce(r.onMouseDown,j=>{c?g.onItemFocus(C):j.preventDefault()}),onFocus:Ce(r.onFocus,()=>g.onItemFocus(C)),onKeyDown:Ce(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){g.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const N=Cy(j,g.orientation,g.dir);if(N!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let D=b().filter(O=>O.focusable).map(O=>O.ref.current);if(N==="last")D.reverse();else if(N==="prev"||N==="next"){N==="prev"&&D.reverse();const O=D.indexOf(j.currentTarget);D=g.loop?wy(D,O+1):D.slice(O+1)}setTimeout(()=>Od(D))}}),children:typeof d=="function"?d({isCurrentTabStop:x,hasTabStop:w!=null}):d})})},"RovingFocusGroupItem")),wj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Sy(t,r){return r!==gj.RTL?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}Io(Sy,"getDirectionAwareKey");function Cy(t,r,i){const a=Sy(t.key,i);if(!(r===vy.Vertical&&["ArrowLeft","ArrowRight"].includes(a))&&!(r===vy.Horizontal&&["ArrowUp","ArrowDown"].includes(a)))return wj[a]}Io(Cy,"getFocusIntent");function Od(t,r=!1){const i=document.activeElement;for(const a of t)if(a===i||(a.focus({preventScroll:r}),document.activeElement!==i))return}Io(Od,"focusFirst");function wy(t,r){return t.map((i,a)=>t[(r+a)%t.length])}Io(wy,"wrapArray");var Ej=Object.defineProperty,Tj=(t,r)=>Ej(t,"name",{value:r,configurable:!0});function Ea(t,[r,i]){return Math.min(i,Math.max(r,t))}Tj(Ea,"clamp");var jj=Object.defineProperty,Xt=(t,r)=>jj(t,"name",{value:r,configurable:!0}),Ey="Radio",[Aj,Ty]=An(Ey),[Rj,_l]=Aj(Ey);function jy(t){const{__scopeRadio:r,checked:i=!1,children:a,disabled:c,form:l,name:u,onCheck:d,required:m,value:p="on",internal_do_not_use_render:C}=t,[g,x]=E.useState(null),[b,v]=E.useState(null),[S,w]=E.useState(null),T=g?!!l||!!g.closest("form"):!0,j={checked:i,disabled:c,required:m,name:u,form:l,value:p,control:g,setControl:x,userClick:S,onUserClick:w,isFormControl:T,bubbleInput:b,setBubbleInput:v,onCheck:Xt(()=>d?.(),"onCheck")};return f.jsx(Rj,{scope:r,...j,children:Ay(C)?C(j):a})}Xt(jy,"RadioProvider");var Nj="RadioTrigger",Oj=E.forwardRef(Xt(function({__scopeRadio:r,onClick:i,...a},c){const{checked:l,disabled:u,value:d,setControl:m,onCheck:p,onUserClick:C,isFormControl:g,bubbleInput:x}=_l(Nj,r),b=Ie(c,m);return f.jsx(He.button,{type:"button",role:"radio","aria-checked":l,"data-state":Md(l),"data-disabled":u?"":void 0,disabled:u,value:d,...a,ref:b,onClick:Ce(i,v=>{const S=v.isPropagationStopped();l||(C({hasConsumerStoppedPropagation:S}),p()),x&&g&&(S||v.stopPropagation())})})},"RadioTrigger")),Mj="RadioIndicator",_j=E.forwardRef(Xt(function(r,i){const{__scopeRadio:a,forceMount:c,...l}=r,u=_l(Mj,a);return f.jsx(Qr,{present:c||u.checked,children:f.jsx(He.span,{"data-state":Md(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:i})})},"RadioIndicator")),Dj="RadioBubbleInput",Ij=E.forwardRef(Xt(function({__scopeRadio:r,onClick:i,...a},c){const{control:l,checked:u,required:d,disabled:m,name:p,value:C,form:g,bubbleInput:x,setBubbleInput:b,userClick:v}=_l(Dj,r),S=Ie(c,b),w=Li(l),T=E.useRef(!1),j=E.useRef(u),N=E.useRef(v),M=E.useRef(null);E.useEffect(()=>{const O=x;if(!O)return;const _=window.HTMLInputElement.prototype,L=Object.getOwnPropertyDescriptor(_,"checked").set;if(!L)return;const B=j.current!==u;j.current=u;const z=v!==null&&v!==N.current;if(N.current=v,z)M.current=B?null:v,B&&L.call(O,u),O.dispatchEvent(new Event("click",{bubbles:!v.hasConsumerStoppedPropagation}));else if(B){const U=M.current;M.current=null;const K=u&&U!==null;T.current=!0,L.call(O,u),O.dispatchEvent(new Event("click",{bubbles:!(K&&U.hasConsumerStoppedPropagation)})),T.current=!1}},[x,u,v]);const D=E.useRef(u);return f.jsx(He.input,{type:"radio","aria-hidden":!0,defaultChecked:D.current,required:d,disabled:m,name:p,value:C,form:g,...a,tabIndex:-1,ref:S,onClick:Ce(i,O=>{T.current&&O.stopPropagation()}),style:{...a.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function Ay(t){return typeof t=="function"}Xt(Ay,"isFunction");function Md(t){return t?"checked":"unchecked"}Xt(Md,"getState");var kj=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_d="RadioGroup",[Lj,LM]=An(_d,[by,Ty]),Ry=by(),Dl=Ty(),[zj,Bj]=Lj(_d),Hj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,name:c,form:l,defaultValue:u,value:d,required:m=!1,disabled:p=!1,orientation:C,dir:g,loop:x=!0,onValueChange:b,...v}=r,S=Ry(a),w=Ii(g),[T,j]=hr({prop:d,defaultProp:u??null,onChange:b,caller:_d}),[N,M]=E.useState(null),D=Ie(i,M),O=E.useRef(T);return E.useEffect(()=>{const _=l?N?.ownerDocument.getElementById(l):N?.closest("form");if(_ instanceof HTMLFormElement){const k=Xt(()=>j(O.current),"reset");return _.addEventListener("reset",k),()=>_.removeEventListener("reset",k)}},[N,l,j]),f.jsx(zj,{scope:a,name:c,form:l,required:m,disabled:p,value:T,onValueChange:j,children:f.jsx(bj,{asChild:!0,...S,orientation:C,dir:w,loop:x,children:f.jsx(He.div,{role:"radiogroup","aria-required":m,"aria-orientation":C,"data-disabled":p?"":void 0,dir:w,...v,ref:D})})})},"RadioGroup")),Pj="RadioGroupItemProvider",Uj="RadioGroupItemTrigger";function Ny(t){const{__scopeRadioGroup:r,value:i,disabled:a,children:c,internal_do_not_use_render:l}=t,u=Bj(Pj,r),d=Dl(r),m=u.disabled||a;return f.jsx(jy,{...d,checked:u.value===i,disabled:m,required:u.required,name:u.name,form:u.form,value:i,onCheck:()=>u.onValueChange(i),internal_do_not_use_render:l,children:c})}Xt(Ny,"RadioGroupItemProvider");var $j=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Ry(a),u=Dl(a),{checked:d,disabled:m}=_l(Uj,u.__scopeRadio),p=E.useRef(null),C=Ie(i,p),g=E.useRef(!1);return E.useEffect(()=>{const x=Xt(v=>{kj.includes(v.key)&&(g.current=!0)},"handleKeyDown"),b=Xt(()=>g.current=!1,"handleKeyUp");return document.addEventListener("keydown",x),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",x),document.removeEventListener("keyup",b)}},[]),f.jsx(Cj,{asChild:!0,...l,focusable:!m,active:d,children:f.jsx(Oj,{...u,...c,ref:C,onKeyDown:Ce(c.onKeyDown,x=>{x.key==="Enter"&&x.preventDefault()}),onFocus:Ce(c.onFocus,()=>{g.current&&p.current?.click()})})})},"RadioGroupItemTrigger")),Gj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,value:c,disabled:l,...u}=r;return f.jsx(Ny,{__scopeRadioGroup:a,value:c,disabled:l,internal_do_not_use_render:({isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx($j,{...u,ref:i,__scopeRadioGroup:a}),d&&f.jsx(Vj,{__scopeRadioGroup:a})]})})},"RadioGroupItem")),Vj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Dl(a);return f.jsx(Ij,{...l,...c,ref:i})},"RadioGroupItemBubbleInput")),qj=E.forwardRef(Xt(function(r,i){const{__scopeRadioGroup:a,...c}=r,l=Dl(a);return f.jsx(_j,{...l,...c,ref:i})},"RadioGroupIndicator")),Yj=Object.defineProperty,$e=(t,r)=>Yj(t,"name",{value:r,configurable:!0}),Oy={ItemAligned:"item-aligned",Popper:"popper"},Xj={RTL:"rtl"},Kj=[" ","Enter","ArrowUp","ArrowDown"],Fj=[" ","Enter"],Ta="Select",[Il,kl,Qj]=al(Ta),[ko,zM]=An(Ta,[Qj,Nl]),Dd=Nl(),[Zj,eo]=ko(Ta),[Wj,Jj]=ko(Ta);function My(t){const{__scopeSelect:r,children:i,open:a,defaultOpen:c,onOpenChange:l,value:u,defaultValue:d,onValueChange:m,dir:p,name:C,autoComplete:g,disabled:x,required:b,form:v,internal_do_not_use_render:S}=t,w=Dd(r),[T,j]=E.useState(null),[N,M]=E.useState(null),[D,O]=E.useState(!1),_=Ii(p),[k,L]=hr({prop:a,defaultProp:c??!1,onChange:l,caller:Ta}),[B,z]=hr({prop:u,defaultProp:d,onChange:m,caller:Ta}),U=E.useRef(null),K=E.useRef(!1),[$,ee]=E.useState(null),G=$e(ae=>{ee({value:ae,hasConsumerStoppedPropagation:K.current}),z(ae)},"handleUserSelect"),q=E.useRef(B);E.useEffect(()=>{const ae=v?T?.ownerDocument.getElementById(v):T?.form;if(ae instanceof HTMLFormElement){const be=$e(()=>z(q.current),"reset");return ae.addEventListener("reset",be),()=>ae.removeEventListener("reset",be)}},[v,T,z]);const H=T?!!v||!!T.closest("form"):!0,[P,A]=E.useState(new Set),Y=pr(),F=Array.from(P).map(ae=>ae.props.value).join(";"),Z=E.useCallback(ae=>{A(be=>new Set(be).add(ae))},[]),le=E.useCallback(ae=>{A(be=>{const ye=new Set(be);return ye.delete(ae),ye})},[]),re={required:b,trigger:T,onTriggerChange:j,valueNode:N,onValueNodeChange:M,valueNodeHasChildren:D,onValueNodeHasChildrenChange:O,contentId:Y,value:B,onValueChange:z,hasConsumerStoppedPropagationRef:K,userSelection:$,onUserSelect:G,open:k,onOpenChange:L,dir:_,triggerPointerDownPosRef:U,disabled:x,name:C,autoComplete:g,form:v,nativeOptions:P,nativeSelectKey:F,isFormControl:H};return f.jsx(cy,{...w,children:f.jsx(Zj,{scope:r,...re,children:f.jsx(Il.Provider,{scope:r,children:f.jsx(Wj,{scope:r,onNativeOptionAdd:Z,onNativeOptionRemove:le,children:Hy(S)?S(re):i})})})})}$e(My,"SelectProvider");var e2=$e(t=>{const{__scopeSelect:r,children:i,...a}=t;return f.jsx(My,{__scopeSelect:r,...a,internal_do_not_use_render:({isFormControl:c})=>f.jsxs(f.Fragment,{children:[i,c?f.jsx(M2,{__scopeSelect:r}):null]})})},"Select"),t2="SelectTrigger",n2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,disabled:c=!1,...l}=r,u=Dd(a),d=eo(t2,a),m=d.disabled||c,p=Ie(i,d.onTriggerChange),C=kl(a),g=E.useRef("touch"),[x,b,v]=Ld(w=>{const T=C().filter(M=>!M.disabled),j=T.find(M=>M.value===d.value),N=zd(T,w,j);N!==void 0&&d.onUserSelect(N.value)}),S=$e(w=>{m||(d.onOpenChange(!0),v()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})},"handleOpen");return f.jsx(uy,{asChild:!0,...u,children:f.jsx(He.button,{type:"button",role:"combobox","aria-controls":d.open?d.contentId:void 0,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":Hi(d.value)?"":void 0,...l,ref:p,onClick:Ce(l.onClick,w=>{w.currentTarget.focus(),g.current!=="mouse"&&S(w)}),onPointerDown:Ce(l.onPointerDown,w=>{g.current=w.pointerType;const T=w.target;T.hasPointerCapture(w.pointerId)&&T.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(S(w),w.preventDefault())}),onKeyDown:Ce(l.onKeyDown,w=>{const T=x.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&(d.hasConsumerStoppedPropagationRef.current=w.isPropagationStopped(),b(w.key)),!(T&&w.key===" ")&&Kj.includes(w.key)&&(S(),w.preventDefault())})})})},"SelectTrigger")),r2="SelectValue",o2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,className:c,style:l,children:u,placeholder:d="",...m}=r,p=eo(r2,a),{onValueNodeHasChildrenChange:C}=p,g=u!==void 0,x=Ie(i,p.onValueNodeChange);st(()=>{C(g)},[C,g]);const b=Hi(p.value);return f.jsx(He.span,{...m,asChild:b?!1:m.asChild,ref:x,style:{pointerEvents:"none"},children:f.jsx(E.Fragment,{children:b?d:u},b?"placeholder":"value")})},"SelectValue")),a2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,children:c,...l}=r;return f.jsx(He.span,{"aria-hidden":!0,...l,ref:i,children:c||"▼"})},"SelectIcon")),i2="SelectPortal",[s2,l2]=ko(i2,{forceMount:void 0}),c2=$e(t=>{const{__scopeSelect:r,forceMount:i,...a}=t;return f.jsx(s2,{scope:t.__scopeSelect,forceMount:i,children:f.jsx(Ju,{asChild:!0,...a})})},"SelectPortal"),Lo="SelectContent",u2=E.forwardRef($e(function(r,i){const a=l2(Lo,r.__scopeSelect),{forceMount:c=a.forceMount,...l}=r,u=eo(Lo,r.__scopeSelect),[d,m]=E.useState();return st(()=>{m(new DocumentFragment)},[]),f.jsx(Qr,{present:c||u.open,children:({present:p})=>p?f.jsx(h2,{...l,ref:i}):f.jsx(d2,{...l,fragment:d})})},"SelectContent")),d2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,children:c,fragment:l}=r;return l?Xr.createPortal(f.jsx(_y,{scope:a,children:f.jsx(Il.Slot,{scope:a,children:f.jsx("div",{ref:i,children:c})})}),l):null},"SelectContentFragment")),Gn=10,[_y,zo]=ko(Lo),f2=fr("SelectContent.RemoveScroll"),h2=E.forwardRef($e(function(r,i){const{__scopeSelect:a}=r,{position:c=Oy.ItemAligned,onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:x,collisionBoundary:b,collisionPadding:v,sticky:S,hideWhenDetached:w,avoidCollisions:T,...j}=r,N=eo(Lo,a),[M,D]=E.useState(null),[O,_]=E.useState(null),k=Ie(i,D),[L,B]=E.useState(null),[z,U]=E.useState(null),K=kl(a),[$,ee]=E.useState(!1),G=E.useRef(!1),q=E.useRef(!1),H=E.useRef(!1);E.useEffect(()=>{if(M)return Ng(M)},[M]),ul();const P=E.useCallback(de=>{const[_e,...Me]=K().map(Te=>Te.ref.current),[Ee]=Me.slice(-1),ve=document.activeElement;for(const Te of de)if(Te===ve||(Te?.scrollIntoView({block:"nearest"}),Te===_e&&O&&(O.scrollTop=0),Te===Ee&&O&&(O.scrollTop=O.scrollHeight),Te?.focus(),document.activeElement!==ve))return},[K,O]),A=E.useCallback(()=>P([L,M]),[P,L,M]);E.useEffect(()=>{$&&A()},[$,A]);const{onOpenChange:Y,triggerPointerDownPosRef:F}=N;E.useEffect(()=>{if(M){let de={x:0,y:0};const _e=$e(Ee=>{de={x:Math.abs(Math.round(Ee.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(Ee.pageY)-(F.current?.y??0))}},"handlePointerMove"),Me=$e(Ee=>{de.x<=10&&de.y<=10?Ee.preventDefault():Ee.composedPath().includes(M)||Y(!1),document.removeEventListener("pointermove",_e),F.current=null},"handlePointerUp");return F.current!==null&&(document.addEventListener("pointermove",_e),document.addEventListener("pointerup",Me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",_e),document.removeEventListener("pointerup",Me,{capture:!0})}}},[M,Y,F]),E.useEffect(()=>{const de=$e(()=>Y(!1),"close");return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[Y]);const[Z,le]=Ld(de=>{const _e=K().filter(ve=>!ve.disabled),Me=_e.find(ve=>ve.ref.current===document.activeElement),Ee=zd(_e,de,Me);Ee&&setTimeout(()=>Ee.ref.current?.focus())}),re=E.useCallback((de,_e,Me)=>{const Ee=!q.current;Ee&&(q.current=!0);const ve=!G.current&&!Me;N.value!==void 0&&N.value===_e||ve?(B(de),ve&&(G.current=!0)):Ee&&B(de)},[N.value]),ae=E.useCallback(()=>M?.focus(),[M]),be=E.useCallback((de,_e,Me)=>{if(!de)return;const Ee=!H.current;Ee&&(H.current=!0);const ve=!G.current&&!Me;(N.value!==void 0&&N.value===_e||ve||Ee)&&U(de)},[N.value]),ye=c===Oy.Popper?Dy:m2,ge=ye===Dy?{side:m,sideOffset:p,align:C,alignOffset:g,arrowPadding:x,collisionBoundary:b,collisionPadding:v,sticky:S,hideWhenDetached:w,avoidCollisions:T}:{};return f.jsx(_y,{scope:a,content:M,viewport:O,onViewportChange:_,itemRefCallback:re,selectedItem:L,onItemLeave:ae,itemTextRefCallback:be,focusSelectedItem:A,selectedItemText:z,position:c,isPositioned:$,searchRef:Z,children:f.jsx(id,{as:f2,allowPinchZoom:!0,children:f.jsx(og,{asChild:!0,trapped:N.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ce(l,de=>{N.trigger?.focus({preventScroll:!0}),de.preventDefault()}),children:f.jsx(qu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:f.jsx(ye,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:de=>de.preventDefault(),...j,...ge,onPlaced:()=>ee(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ce(j.onKeyDown,de=>{const _e=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!_e&&de.key.length===1&&le(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let Ee=K().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);if(["ArrowUp","End"].includes(de.key)&&(Ee=Ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const ve=de.target,Te=Ee.indexOf(ve);Ee=Ee.slice(Te+1)}setTimeout(()=>P(Ee)),de.preventDefault()}})})})})})})},"SelectContentImpl")),m2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,onPlaced:c,...l}=r,u=eo(Lo,a),d=zo(Lo,a),[m,p]=E.useState(null),[C,g]=E.useState(null),x=Ie(i,g),b=kl(a),v=E.useRef(!1),S=E.useRef(!0),{viewport:w,selectedItem:T,selectedItemText:j,focusSelectedItem:N}=d,M=E.useCallback(()=>{if(u.trigger&&u.valueNode&&m&&C&&w&&T&&j){const k=u.trigger.getBoundingClientRect(),L=C.getBoundingClientRect(),B=u.valueNode.getBoundingClientRect(),z=j.getBoundingClientRect();if(u.dir!==Xj.RTL){const Me=z.left-L.left,Ee=B.left-Me,ve=k.left-Ee,Te=k.width+ve,At=Math.max(Te,L.width),ht=window.innerWidth-Gn,rn=Ea(Ee,[Gn,Math.max(Gn,ht-At)]);m.style.minWidth=Te+"px",m.style.left=rn+"px"}else{const Me=L.right-z.right,Ee=window.innerWidth-B.right-Me,ve=window.innerWidth-k.right-Ee,Te=k.width+ve,At=Math.max(Te,L.width),ht=window.innerWidth-Gn,rn=Ea(Ee,[Gn,Math.max(Gn,ht-At)]);m.style.minWidth=Te+"px",m.style.right=rn+"px"}const U=b(),K=window.innerHeight-Gn*2,$=w.scrollHeight,ee=window.getComputedStyle(C),G=parseInt(ee.borderTopWidth,10),q=parseInt(ee.paddingTop,10),H=parseInt(ee.borderBottomWidth,10),P=parseInt(ee.paddingBottom,10),A=G+q+$+P+H,Y=Math.min(T.offsetHeight*5,A),F=window.getComputedStyle(w),Z=parseInt(F.paddingTop,10),le=parseInt(F.paddingBottom,10),re=k.top+k.height/2-Gn,ae=K-re,be=T.offsetHeight/2,ye=T.offsetTop+be,ge=G+q+ye,de=A-ge;if(ge<=re){const Me=U.length>0&&T===U[U.length-1].ref.current;m.style.bottom="0px";const Ee=C.clientHeight-w.offsetTop-w.offsetHeight,ve=Math.max(ae,be+(Me?le:0)+Ee+H),Te=ge+ve;m.style.height=Te+"px"}else{const Me=U.length>0&&T===U[0].ref.current;m.style.top="0px";const ve=Math.max(re,G+w.offsetTop+(Me?Z:0)+be)+de;m.style.height=ve+"px",w.scrollTop=ge-re+w.offsetTop}m.style.margin=`${Gn}px 0`,m.style.minHeight=Y+"px",m.style.maxHeight=K+"px",c?.(),requestAnimationFrame(()=>v.current=!0)}},[b,u.trigger,u.valueNode,m,C,w,T,j,u.dir,c]);st(()=>M(),[M]);const[D,O]=E.useState();st(()=>{C&&O(window.getComputedStyle(C).zIndex)},[C]);const _=E.useCallback(k=>{k&&S.current===!0&&(M(),N?.(),S.current=!1)},[M,N]);return f.jsx(p2,{scope:a,contentWrapper:m,shouldExpandOnScrollRef:v,onScrollButtonChange:_,children:f.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:f.jsx(He.div,{...l,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),Dy=E.forwardRef($e(function(r,i){const{__scopeSelect:a,align:c="start",collisionPadding:l=Gn,...u}=r,d=Dd(a);return f.jsx(fy,{...d,...u,ref:i,align:c,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[p2,Id]=ko(Lo,{}),Iy="SelectViewport",g2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,nonce:c,...l}=r,u=zo(Iy,a),d=Id(Iy,a),m=Ie(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(Il.Slot,{scope:a,children:f.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ce(l.onScroll,C=>{const g=C.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:b}=d;if(b?.current&&x){const v=Math.abs(p.current-g.scrollTop);if(v>0){const S=window.innerHeight-Gn*2,w=parseFloat(x.style.minHeight),T=parseFloat(x.style.height),j=Math.max(w,T);if(j<S){const N=j+v,M=Math.min(S,N),D=N-M;x.style.height=M+"px",x.style.bottom==="0px"&&(g.scrollTop=D>0?D:0,x.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),y2="SelectGroup",[x2,b2]=ko(y2),v2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,...c}=r,l=pr();return f.jsx(x2,{scope:a,id:l,children:f.jsx(He.div,{role:"group","aria-labelledby":l,...c,ref:i})})},"SelectGroup")),S2="SelectLabel",C2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,...c}=r,l=b2(S2,a);return f.jsx(He.div,{id:l.id,...c,ref:i})},"SelectLabel")),kd="SelectItem",[w2,ky]=ko(kd),E2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,value:c,disabled:l=!1,textValue:u,...d}=r,m=eo(kd,a),p=zo(kd,a),C=m.value===c,[g,x]=E.useState(u??""),[b,v]=E.useState(!1),S=$n(M=>p.itemRefCallback?.(M,c,l)),w=Ie(i,S),T=pr(),j=E.useRef("touch");function N(M){m.hasConsumerStoppedPropagationRef.current=M.isPropagationStopped(),m.onUserSelect(c),m.onOpenChange(!1)}return $e(N,"handleSelect"),f.jsx(w2,{scope:a,value:c,disabled:l,textId:T,isSelected:C,onItemTextChange:E.useCallback(M=>{x(D=>D||(M?.textContent??"").trim())},[]),children:f.jsx(Il.ItemSlot,{scope:a,value:c,disabled:l,textValue:g,children:f.jsx(He.div,{role:"option","aria-labelledby":T,"data-highlighted":b?"":void 0,"aria-selected":C&&b,"data-state":C?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:w,onFocus:Ce(d.onFocus,()=>v(!0)),onBlur:Ce(d.onBlur,()=>v(!1)),onClick:Ce(d.onClick,M=>{l||j.current!=="mouse"&&N(M)}),onPointerUp:Ce(d.onPointerUp,M=>{l||j.current==="mouse"&&N(M)}),onPointerDown:Ce(d.onPointerDown,M=>{j.current=M.pointerType}),onPointerMove:Ce(d.onPointerMove,M=>{j.current=M.pointerType,l?p.onItemLeave?.():j.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(d.onPointerLeave,M=>{M.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:Ce(d.onKeyDown,M=>{l||M.target!==M.currentTarget||p.searchRef?.current!==""&&M.key===" "||(Fj.includes(M.key)&&N(M),M.key===" "&&M.preventDefault())})})})})},"SelectItem")),Ll="SelectItemText",T2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,className:c,style:l,...u}=r,d=eo(Ll,a),m=zo(Ll,a),p=ky(Ll,a),C=Jj(Ll,a),[g,x]=E.useState(null),b=$n(N=>m.itemTextRefCallback?.(N,p.value,p.disabled)),v=Ie(i,x,p.onItemTextChange,b),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(He.span,{id:p.textId,...u,ref:v}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren&&!Hi(d.value)?Xr.createPortal(u.children,d.valueNode):null]})},"SelectItemText")),j2="SelectItemIndicator",A2=E.forwardRef($e(function(r,i){const{__scopeSelect:a,...c}=r;return ky(j2,a).isSelected?f.jsx(He.span,{"aria-hidden":!0,...c,ref:i}):null},"SelectItemIndicator")),Ly="SelectScrollUpButton",R2=E.forwardRef($e(function(r,i){const a=zo(Ly,r.__scopeSelect),c=Id(Ly,r.__scopeSelect),[l,u]=E.useState(!1),d=Ie(i,c.onScrollButtonChange);return st(()=>{if(a.viewport&&a.isPositioned){let m=function(){const C=p.scrollTop>0;u(C)};$e(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(By,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),zy="SelectScrollDownButton",N2=E.forwardRef($e(function(r,i){const a=zo(zy,r.__scopeSelect),c=Id(zy,r.__scopeSelect),[l,u]=E.useState(!1),d=Ie(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)};$e(m,"handleScroll");const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?f.jsx(By,{...r,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),By=E.forwardRef($e(function(r,i){const{__scopeSelect:a,onAutoScroll:c,...l}=r,u=zo("SelectScrollButton",a),d=E.useRef(null),m=kl(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(He.div,{"aria-hidden":!0,...l,ref:i,style:{flexShrink:0,...l.style},onPointerDown:Ce(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(c,50))}),onPointerMove:Ce(l.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(c,50))}),onPointerLeave:Ce(l.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),O2="SelectBubbleInput",M2=E.forwardRef($e(function({__scopeSelect:r,...i},a){const c=eo(O2,r),{value:l,onValueChange:u,required:d,disabled:m,name:p,autoComplete:C,form:g,userSelection:x}=c,{nativeOptions:b,nativeSelectKey:v}=c,S=E.useRef(null),w=Ie(a,S),T=l??"",j=E.useRef(T),N=E.useRef(x),M=E.useRef(!1),D=Array.from(b).some(O=>(O.props.value??"")==="");return E.useEffect(()=>{const O=S.current;if(!O)return;const _=window.HTMLSelectElement.prototype,L=Object.getOwnPropertyDescriptor(_,"value").set,B=x!==null&&x!==N.current;N.current=x;const z=j.current!==T;j.current=T;const U=B&&z;if(B&&!z&&x.value!==T&&!x.hasConsumerStoppedPropagation&&L){M.current=!0;try{L.call(O,x.value),O.dispatchEvent(new Event("change",{bubbles:!0}))}finally{M.current=!1,L.call(O,T)}return}const K=U&&!x.hasConsumerStoppedPropagation;if(z&&L){const $=new Event("change",{bubbles:K});L.call(O,T),O.dispatchEvent($)}},[T,x]),f.jsxs(He.select,{"aria-hidden":!0,required:d,tabIndex:-1,name:p,autoComplete:C,disabled:m,form:g,onChange:O=>{M.current||u(O.target.value)},...i,style:{...Op,...i.style},ref:w,defaultValue:T,children:[Hi(l)&&!D?f.jsx("option",{value:""}):null,Array.from(b)]},v)},"SelectBubbleInput"));function Hy(t){return typeof t=="function"}$e(Hy,"isFunction");function Hi(t){return t===""||t===void 0}$e(Hi,"shouldShowPlaceholder");function Ld(t){const r=$n(t),i=E.useRef(""),a=E.useRef(0),c=E.useCallback(u=>{const d=i.current+u;r(d);function m(p){i.current=p,window.clearTimeout(a.current),p!==""&&(a.current=window.setTimeout(()=>m(""),1e3))}$e(m,"updateSearch"),m(d)},[r]),l=E.useCallback(()=>{i.current="",window.clearTimeout(a.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(a.current),[]),[i,c,l]}$e(Ld,"useTypeaheadSearch");function zd(t,r,i){const c=r.length>1&&Array.from(r).every(p=>p===r[0])?r[0]:r,l=i?t.indexOf(i):-1;let u=Py(t,Math.max(l,0));c.length===1&&(u=u.filter(p=>p!==i));const m=u.find(p=>p.textValue.toLowerCase().startsWith(c.toLowerCase()));return m!==i?m:void 0}$e(zd,"findNextItem");function Py(t,r){return t.map((i,a)=>t[(r+a)%t.length])}$e(Py,"wrapArray");var _2=Object.defineProperty,Ye=(t,r)=>_2(t,"name",{value:r,configurable:!0}),Uy={Horizontal:"horizontal"},D2={LTR:"ltr"},$y=["PageUp","PageDown"],Gy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Vy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Pi="Slider",[Bd,I2,k2]=al(Pi),[Hd,BM]=An(Pi,[k2]),[L2,ja]=Hd(Pi),z2=E.forwardRef(Ye(function(r,i){const{name:a,min:c=0,max:l=100,step:u=1,orientation:d=Uy.Horizontal,disabled:m=!1,minStepsBetweenThumbs:p=0,preserveThumbOrder:C=!1,defaultValue:g=[c],value:x,onValueChange:b=Ye(()=>{},"onValueChange"),onValueCommit:v=Ye(()=>{},"onValueCommit"),inverted:S=!1,form:w,...T}=r,j=E.useRef(new Set),N=E.useRef(0),M=E.useRef(!1),[D,O]=E.useState(null),k=d===Uy.Horizontal?B2:H2,[L,B]=E.useState(null),z=Ie(i,B),[U=[],K]=hr({prop:x,defaultProp:g,onChange:Ye(A=>{[...j.current][N.current]?.focus({preventScroll:!0,focusVisible:M.current}),M.current=!1,b(A)},"onChange")}),$=E.useRef(U),ee=E.useRef(U);E.useEffect(()=>{const A=w?L?.ownerDocument.getElementById(w):L?.closest("form");if(A instanceof HTMLFormElement){const Y=Ye(()=>K(ee.current),"reset");return A.addEventListener("reset",Y),()=>A.removeEventListener("reset",Y)}},[L,w,K]);function G(A){const Y=e0(U,A);P(A,Y)}Ye(G,"handleSlideStart");function q(A){P(A,N.current)}Ye(q,"handleSlideMove");function H(){String(U)!==String($.current)&&v(U)}Ye(H,"handleSlideEnd");function P(A,Y,{commit:F}={commit:!1}){const Z=$d(u),le=Ui(Math.round((A-c)/u)*u+c,Z),re=Ea(le,[c,l]),ae=p*u;function be(ge){const de=C?Ea(re,[ge[Y-1]===void 0?c:ge[Y-1]+ae,ge[Y+1]===void 0?l:ge[Y+1]-ae]):re,_e=Wy(ge,de,Y);return r0(_e,ae)?{nextValues:_e,changedIndex:C?Y:_e.indexOf(de),hasChanged:String(_e)!==String(ge)}:null}Ye(be,"getNextValues");const ye=be(U);ye?.hasChanged&&O(ye.nextValues),K((ge=[])=>{const de=be(ge);return de?(N.current=de.changedIndex,de.hasChanged&&F&&v(de.nextValues),de.hasChanged?de.nextValues:ge):ge})}return Ye(P,"updateValues"),f.jsx(L2,{scope:r.__scopeSlider,name:a,disabled:m,min:c,max:l,valueIndexToChangeRef:N,thumbs:j.current,values:U,orientation:d,form:w,userRequestedValues:D,children:f.jsx(Bd.Provider,{scope:r.__scopeSlider,children:f.jsx(Bd.Slot,{scope:r.__scopeSlider,children:f.jsx(k,{"aria-disabled":m,"data-disabled":m?"":void 0,...T,ref:z,onPointerDown:Ce(T.onPointerDown,()=>{m||($.current=U,M.current=!1)}),min:c,max:l,inverted:S,onSlideStart:m?void 0:G,onSlideMove:m?void 0:q,onSlideEnd:m?void 0:H,onHomeKeyDown:()=>{m||(M.current=!0,P(c,0,{commit:!0}))},onEndKeyDown:()=>{m||(M.current=!0,P(l,U.length-1,{commit:!0}))},onStepKeyDown:({event:A,direction:Y})=>{if(!m){M.current=!0;const le=$y.includes(A.key)||A.shiftKey&&Gy.includes(A.key)?10:1,re=N.current,ae=U[re],be=o0(ae,{min:c,step:u,direction:Y,multiplier:le});P(be,re,{commit:!0})}}})})})})},"Slider")),[qy,Yy]=Hd(Pi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),B2=E.forwardRef(Ye(function(r,i){const{min:a,max:c,dir:l,inverted:u,onSlideStart:d,onSlideMove:m,onSlideEnd:p,onStepKeyDown:C,...g}=r,[x,b]=E.useState(null),v=Ie(i,b),S=E.useRef(void 0),w=Ii(l),T=w===D2.LTR,j=T&&!u||!T&&u;function N(M){const D=S.current||x.getBoundingClientRect(),O=[0,D.width],k=zl(O,j?[a,c]:[c,a]);return S.current=D,k(M-D.left)}return Ye(N,"getValueFromPointer"),f.jsx(qy,{scope:r.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:f.jsx(Xy,{dir:w,"data-orientation":"horizontal",...g,ref:v,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:M=>{const D=N(M.clientX);d?.(D)},onSlideMove:M=>{const D=N(M.clientX);m?.(D)},onSlideEnd:()=>{S.current=void 0,p?.()},onStepKeyDown:M=>{const O=Vy[j?"from-left":"from-right"].includes(M.key);C?.({event:M,direction:O?-1:1})}})})},"SliderHorizontal")),H2=E.forwardRef(Ye(function(r,i){const{min:a,max:c,inverted:l,onSlideStart:u,onSlideMove:d,onSlideEnd:m,onStepKeyDown:p,...C}=r,g=E.useRef(null),x=Ie(i,g),b=E.useRef(void 0),v=!l;function S(w){const T=b.current||g.current.getBoundingClientRect(),j=[0,T.height],M=zl(j,v?[c,a]:[a,c]);return b.current=T,M(w-T.top)}return Ye(S,"getValueFromPointer"),f.jsx(qy,{scope:r.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:f.jsx(Xy,{"data-orientation":"vertical",...C,ref:x,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:()=>{b.current=void 0,m?.()},onStepKeyDown:w=>{const j=Vy[v?"from-bottom":"from-top"].includes(w.key);p?.({event:w,direction:j?-1:1})}})})},"SliderVertical")),Xy=E.forwardRef(Ye(function(r,i){const{__scopeSlider:a,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onHomeKeyDown:d,onEndKeyDown:m,onStepKeyDown:p,...C}=r,g=ja(Pi,a);return f.jsx(He.span,{...C,ref:i,onKeyDown:Ce(r.onKeyDown,x=>{x.key==="Home"?(d(x),x.preventDefault()):x.key==="End"?(m(x),x.preventDefault()):$y.concat(Gy).includes(x.key)&&(p(x),x.preventDefault())}),onPointerDown:Ce(r.onPointerDown,x=>{const b=x.target;b.setPointerCapture(x.pointerId),x.preventDefault(),g.thumbs.has(b)?b.focus({preventScroll:!0,focusVisible:!1}):c(x)}),onPointerMove:Ce(r.onPointerMove,x=>{x.target.hasPointerCapture(x.pointerId)&&l(x)}),onPointerUp:Ce(r.onPointerUp,x=>{const b=x.target;b.hasPointerCapture(x.pointerId)&&(b.releasePointerCapture(x.pointerId),u(x))})})},"SliderImpl")),P2="SliderTrack",U2=E.forwardRef(Ye(function(r,i){const{__scopeSlider:a,...c}=r,l=ja(P2,a);return f.jsx(He.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...c,ref:i})},"SliderTrack")),Ky="SliderRange",$2=E.forwardRef(Ye(function(r,i){const{__scopeSlider:a,...c}=r,l=ja(Ky,a),u=Yy(Ky,a),d=E.useRef(null),m=Ie(i,d),p=l.values.length,C=l.values.map(b=>Ud(b,l.min,l.max)),g=p>1?Math.min(...C):0,x=100-Math.max(...C);return f.jsx(He.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...c,ref:m,style:{...r.style,[u.startEdge]:g+"%",[u.endEdge]:x+"%"}})},"SliderRange")),G2="SliderThumb",[V2,Fy]=Hd(G2),q2="SliderThumbProvider";function Qy(t){const{__scopeSlider:r,name:i,children:a,internal_do_not_use_render:c}=t,l=ja(q2,r),u=I2(r),[d,m]=E.useState(null),p=E.useMemo(()=>d?u().findIndex(w=>w.ref.current===d):-1,[u,d]),C=Li(d),g=d?!!l.form||!!d.closest("form"):!0,x=l.values[p],b=i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),v=x===void 0?0:Ud(x,l.min,l.max);E.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]);const S={value:x,name:b,form:l.form,isFormControl:g,index:p,thumb:d,onThumbChange:m,percent:v,size:C};return f.jsx(V2,{scope:r,...S,children:a0(c)?c(S):a})}Ye(Qy,"SliderThumbProvider");var Pd="SliderThumbTrigger",Y2=E.forwardRef(Ye(function(r,i){const{__scopeSlider:a,...c}=r,l=ja(Pd,a),u=Yy(Pd,a),{index:d,value:m,percent:p,size:C,onThumbChange:g}=Fy(Pd,a),x=Ie(i,g),b=Jy(d,l.values.length),v=C?.[u.size],S=v?t0(v,p,u.direction):0;return f.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${p}% + ${S}px)`},children:f.jsx(Bd.ItemSlot,{scope:a,children:f.jsx(He.span,{role:"slider","aria-label":r["aria-label"]||b,"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:x,style:m===void 0?{display:"none"}:r.style,onFocus:Ce(r.onFocus,()=>{l.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),X2=E.forwardRef(Ye(function(r,i){const{__scopeSlider:a,name:c,...l}=r;return f.jsx(Qy,{__scopeSlider:a,name:c,internal_do_not_use_render:({index:u,isFormControl:d})=>f.jsxs(f.Fragment,{children:[f.jsx(Y2,{...l,ref:i,__scopeSlider:a}),d?f.jsx(K2,{__scopeSlider:a},u):null]})})},"SliderThumb")),Zy="SliderBubbleInput",K2=E.forwardRef(Ye(function({__scopeSlider:r,onInput:i,...a},c){const{index:l,value:u,name:d,form:m}=Fy(Zy,r),{userRequestedValues:p}=ja(Zy,r),C=E.useRef(null),g=Ie(C,c),x=E.useRef(!1),b=E.useRef(u),v=E.useRef(p),S=E.useRef(p);return E.useEffect(()=>{const w=C.current;if(!w)return;const T=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(T,"value").set,M=b.current,D=M!==u;b.current=u;const O=p!==S.current;if(S.current=p,D&&N){const _=p!==v.current;v.current=p;const k=p?.[l],L=_&&(O&&k!==M||k===u);x.current=!L;const B=new Event("input",{bubbles:!0});N.call(w,u),w.dispatchEvent(B),x.current=!1}},[l,u,p]),f.jsx(He.input,{style:{display:"none"},name:d,form:m,...a,ref:g,defaultValue:u,onInput:Ce(i,w=>{x.current&&w.stopPropagation()})})},"SliderBubbleInput"));function Wy(t=[],r,i){const a=[...t];return a[i]=r,a.sort((c,l)=>c-l)}Ye(Wy,"getNextSortedValues");function Ud(t,r,i){const l=100/(i-r)*(t-r);return Ea(l,[0,100])}Ye(Ud,"convertValueToPercentage");function Jy(t,r){return r>2?`Value ${t+1} of ${r}`:r===2?["Minimum","Maximum"][t]:void 0}Ye(Jy,"getLabel");function e0(t,r){if(t.length===1)return 0;const i=t.map(c=>Math.abs(c-r)),a=Math.min(...i);return i.indexOf(a)}Ye(e0,"getClosestValueIndex");function t0(t,r,i){const a=t/2,l=zl([0,50],[0,a]);return(a-l(r)*i)*i}Ye(t0,"getThumbInBoundsOffset");function n0(t){return t.slice(0,-1).map((r,i)=>t[i+1]-r)}Ye(n0,"getStepsBetweenValues");function r0(t,r){if(r>0){const i=n0(t);return Math.min(...i)>=r}return!0}Ye(r0,"hasMinStepsBetweenValues");function zl(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])}}Ye(zl,"linearScale");function $d(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}Ye($d,"getDecimalCount");function Ui(t,r){const i=Math.pow(10,r);return Math.round(t*i)/i}Ye(Ui,"roundValue");function o0(t,{min:r,step:i,direction:a,multiplier:c}){const l=$d(i),u=(t-r)/i,d=Math.round(u),m=Ui(d*i+r,l)===Ui(t,l);let p;return m?p=d+c*a:a>0?p=Math.ceil(u):p=Math.floor(u),Ui(p*i+r,l)}Ye(o0,"getNextStepValue");function a0(t){return typeof t=="function"}Ye(a0,"isFunction");var F2=Object.defineProperty,St=(t,r)=>F2(t,"name",{value:r,configurable:!0}),[Gd,HM]=An("Tooltip",[Nl]),Bl=Nl(),Q2="TooltipProvider",Z2=700,Vd="tooltip.open",[W2,qd]=Gd(Q2),J2=St(t=>{const{__scopeTooltip:r,delayDuration:i=Z2,skipDelayDuration:a=300,disableHoverableContent:c=!1,children:l}=t,u=E.useRef(!0),d=E.useRef(!1),m=E.useRef(0);return E.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),f.jsx(W2,{scope:r,isOpenDelayedRef:u,delayDuration:i,onOpen:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),u.current=!1)},[a]),onClose:E.useCallback(()=>{a<=0||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,a))},[a]),isPointerInTransitRef:d,onPointerInTransitChange:E.useCallback(p=>{d.current=p},[]),disableHoverableContent:c,children:l})},"TooltipProvider"),Yd="Tooltip",[eA,$i]=Gd(Yd),tA=St(t=>{const{__scopeTooltip:r,children:i,open:a,defaultOpen:c,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=t,m=qd(Yd,t.__scopeTooltip),p=Bl(r),[C,g]=E.useState(null),[x,b]=E.useState(void 0),v=pr(),S=E.useRef(0),w=u??m.disableHoverableContent,T=d??m.delayDuration,j=E.useRef(!1),[N,M]=hr({prop:a,defaultProp:c??!1,onChange:St(B=>{B?(m.onOpen(),document.dispatchEvent(new CustomEvent(Vd))):m.onClose(),l?.(B)},"onChange"),caller:Yd}),D=E.useMemo(()=>N?j.current?"delayed-open":"instant-open":"closed",[N]),O=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,j.current=!1,M(!0)},[M]),_=E.useCallback(()=>{window.clearTimeout(S.current),S.current=0,M(!1)},[M]),k=E.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{j.current=!0,M(!0),S.current=0},T)},[T,M]);E.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const L=x??v;return f.jsx(cy,{...p,children:f.jsx(eA,{scope:r,contentId:L,setContentId:b,open:N,stateAttribute:D,trigger:C,onTriggerChange:g,onTriggerEnter:E.useCallback(()=>{m.isOpenDelayedRef.current?k():O()},[m.isOpenDelayedRef,k,O]),onTriggerLeave:E.useCallback(()=>{w?_():(window.clearTimeout(S.current),S.current=0)},[_,w]),onOpen:O,onClose:_,disableHoverableContent:w,children:i})})},"Tooltip"),i0="TooltipTrigger",nA=E.forwardRef(St(function(r,i){const{__scopeTooltip:a,"aria-describedby":c,...l}=r,u=$i(i0,a),d=qd(i0,a),m=Bl(a),p=E.useRef(null),C=Ie(i,p,u.onTriggerChange),g=E.useRef(!1),x=E.useRef(!1),b=E.useCallback(()=>g.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),f.jsx(uy,{asChild:!0,...m,children:f.jsx(He.button,{"aria-describedby":u.open?p0(c,u.contentId):c,"data-state":u.stateAttribute,...l,ref:C,onPointerMove:Ce(r.onPointerMove,v=>{v.pointerType!=="touch"&&!x.current&&!d.isPointerInTransitRef.current&&(u.onTriggerEnter(),x.current=!0)}),onPointerLeave:Ce(r.onPointerLeave,()=>{u.onTriggerLeave(),x.current=!1}),onPointerDown:Ce(r.onPointerDown,()=>{u.open&&u.onClose(),g.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:Ce(r.onFocus,()=>{g.current||u.onOpen()}),onBlur:Ce(r.onBlur,u.onClose),onClick:Ce(r.onClick,u.onClose)})})},"TooltipTrigger")),s0="TooltipPortal",[rA,oA]=Gd(s0,{forceMount:void 0}),aA=St(t=>{const{__scopeTooltip:r,forceMount:i,children:a,container:c}=t,l=$i(s0,r);return f.jsx(rA,{scope:r,forceMount:i,children:f.jsx(Qr,{present:i||l.open,children:f.jsx(Ju,{asChild:!0,container:c,children:a})})})},"TooltipPortal"),Gi="TooltipContent",iA=E.forwardRef(St(function(r,i){const a=oA(Gi,r.__scopeTooltip),{forceMount:c=a.forceMount,side:l="top",...u}=r,d=$i(Gi,r.__scopeTooltip);return f.jsx(Qr,{present:c||d.open,children:d.disableHoverableContent?f.jsx(l0,{side:l,...u,ref:i}):f.jsx(sA,{side:l,...u,ref:i})})},"TooltipContent")),sA=E.forwardRef(St(function(r,i){const a=$i(Gi,r.__scopeTooltip),c=qd(Gi,r.__scopeTooltip),l=E.useRef(null),u=Ie(i,l),[d,m]=E.useState(null),{trigger:p,onClose:C}=a,g=l.current,{onPointerInTransitChange:x}=c,b=E.useCallback(()=>{m(null),x(!1)},[x]),v=E.useCallback((S,w)=>{const T=S.currentTarget,j={x:S.clientX,y:S.clientY},N=c0(j,T.getBoundingClientRect()),M=u0(j,N),D=d0(w.getBoundingClientRect()),O=h0([...M,...D]);m(O),x(!0)},[x]);return E.useEffect(()=>()=>b(),[b]),E.useEffect(()=>{if(p&&g){const S=St(T=>v(T,g),"handleTriggerLeave"),w=St(T=>v(T,p),"handleContentLeave");return p.addEventListener("pointerleave",S),g.addEventListener("pointerleave",w),()=>{p.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",w)}}},[p,g,v,b]),E.useEffect(()=>{if(d){const S=St(w=>{const T=w.target,j={x:w.clientX,y:w.clientY},N=p?.contains(T)||g?.contains(T),M=!f0(j,d);N?b():M&&(b(),C())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[p,g,d,C,b]),f.jsx(l0,{...r,ref:u})},"TooltipContentHoverable")),lA=Cp("TooltipContent"),l0=E.forwardRef(St(function(r,i){const{__scopeTooltip:a,children:c,"aria-label":l,id:u,onEscapeKeyDown:d,onPointerDownOutside:m,...p}=r,C=$i(Gi,a),g=Bl(a),{onClose:x}=C,[b,v]=E.useState(null),S=Ie(i,v);lg(b),E.useEffect(()=>(document.addEventListener(Vd,x),()=>document.removeEventListener(Vd,x)),[x]),E.useEffect(()=>{if(C.trigger){const T=St(j=>{j.target instanceof Node&&j.target.contains(C.trigger)&&x()},"handleScroll");return window.addEventListener("scroll",T,{capture:!0}),()=>window.removeEventListener("scroll",T,{capture:!0})}},[C.trigger,x]);const{setContentId:w}=C;return st(()=>(w(u),()=>{w(void 0)}),[u,w]),f.jsx(qu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:T=>T.preventDefault(),onDismiss:x,children:f.jsxs(fy,{"data-state":C.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:C.contentId,...g,...p,ref:S,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(lA,{children:c}),l?f.jsx(aw,{id:C.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl")),cA=E.forwardRef(St(function(r,i){const{__scopeTooltip:a,...c}=r,l=Bl(a);return f.jsx(lj,{...l,...c,ref:i})},"TooltipArrow"));function c0(t,r){const i=Math.abs(r.top-t.y),a=Math.abs(r.bottom-t.y),c=Math.abs(r.right-t.x),l=Math.abs(r.left-t.x);switch(Math.min(i,a,c,l)){case l:return"left";case c:return"right";case i:return"top";case a:return"bottom";default:throw new Error("unreachable")}}St(c0,"getExitSideFromRect");function u0(t,r,i=5){const a=[];switch(r){case"top":a.push({x:t.x-i,y:t.y+i},{x:t.x+i,y:t.y+i});break;case"bottom":a.push({x:t.x-i,y:t.y-i},{x:t.x+i,y:t.y-i});break;case"left":a.push({x:t.x+i,y:t.y-i},{x:t.x+i,y:t.y+i});break;case"right":a.push({x:t.x-i,y:t.y-i},{x:t.x-i,y:t.y+i});break}return a}St(u0,"getPaddedExitPoints");function d0(t){const{top:r,right:i,bottom:a,left:c}=t;return[{x:c,y:r},{x:i,y:r},{x:i,y:a},{x:c,y:a}]}St(d0,"getPointsFromRect");function f0(t,r){const{x:i,y:a}=t;let c=!1;for(let l=0,u=r.length-1;l<r.length;u=l++){const d=r[l],m=r[u],p=d.x,C=d.y,g=m.x,x=m.y;C>a!=x>a&&i<(g-p)*(a-C)/(x-C)+p&&(c=!c)}return c}St(f0,"isPointInPolygon");function h0(t){const r=t.slice();return r.sort((i,a)=>i.x<a.x?-1:i.x>a.x?1:i.y<a.y?-1:i.y>a.y?1:0),m0(r)}St(h0,"getHull");function m0(t){if(t.length<=1)return t.slice();const r=[];for(let a=0;a<t.length;a++){const c=t[a];for(;r.length>=2;){const l=r[r.length-1],u=r[r.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))r.pop();else break}r.push(c)}r.pop();const i=[];for(let a=t.length-1;a>=0;a--){const c=t[a];for(;i.length>=2;){const l=i[i.length-1],u=i[i.length-2];if((l.x-u.x)*(c.y-u.y)>=(l.y-u.y)*(c.x-u.x))i.pop();else break}i.push(c)}return i.pop(),r.length===1&&i.length===1&&r[0].x===i[0].x&&r[0].y===i[0].y?r:r.concat(i)}St(m0,"getHullPresorted");function p0(...t){const r=new Set;for(const i of t)if(typeof i=="string")for(const a of String(i).trim().split(/\s+/))a&&r.add(a);return r.size>0?Array.from(r).join(" "):void 0}St(p0,"concatAriaDescribedby");function uA({delayDuration:t=0,...r}){return f.jsx(J2,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function dA({...t}){return f.jsx(tA,{"data-slot":"tooltip",...t})}function fA({...t}){return f.jsx(nA,{"data-slot":"tooltip-trigger",...t})}function hA({container:t,className:r,sideOffset:i=0,children:a,...c}){return f.jsx(aA,{container:t,children:f.jsxs(iA,{"data-slot":"tooltip-content",sideOffset:i,className:qe("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",r),...c,children:[a,f.jsx(cA,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function g0(t){return t?.closest(".rt-menu-root, .rt-main-menu-root, .ui-dialog")||document.fullscreenElement||document.getElementById("uni-answer-sheet")||document.body}function mA({children:t}){return f.jsx(uA,{delayDuration:400,children:t})}const pA={"portal-wrapper":"_portal-wrapper_1eief_1"},gA={footer:"_footer_yp9z4_1"};/**
|
|
92
92
|
* @license lucide-react v1.58.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
@@ -98,32 +98,32 @@ Error generating stack: `+o.message+`
|
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/function
|
|
101
|
+
*/function xA(t,r,i=[]){if(r==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:yA(t),size:24,node:r,...i.length>0?{aliases:i}:{}}}/**
|
|
102
102
|
* @license lucide-react v1.58.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const bA=t=>{let r="",i=!1;for(const a of t){if(a==="-"||a==="_"||a<=" "){i=r.length>0;continue}r.length===0?r+=a.toLowerCase():r+=i?a.toUpperCase():a,i=!1}return r};/**
|
|
107
107
|
* @license lucide-react v1.58.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const vA=t=>{const r=
|
|
111
|
+
*/const vA=t=>{const r=bA(t);return r.charAt(0).toUpperCase()+r.slice(1)};/**
|
|
112
112
|
* @license lucide-react v1.58.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const
|
|
116
|
+
*/const Xd=(...t)=>t.filter((r,i,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===i).join(" ").trim();/**
|
|
117
117
|
* @license lucide-react v1.58.0 - ISC
|
|
118
118
|
*
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const
|
|
121
|
+
*/const Bo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
122
122
|
* @license lucide-react v1.58.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/function
|
|
126
|
+
*/function Kd(t){return t!=null}function SA(t,r={}){const i=r.attributeNames??{},a=x=>i[x]??x,c=t.size??t.width??Bo.width,l=t.size??t.height??Bo.height,u=t.aliases?.filter(x=>typeof x=="string"&&x.trim()!=="").map(x=>`lucide-${x}`)??[],d=[...t.name?[`lucide-${t.name}`]:[],...u],m=r.className?.split(" ").filter(Boolean)??[],p=r.includeDefaultClasses===!1?Xd(...m):Xd("lucide",...d,...m),C=r.absoluteStrokeWidth?Number(r.strokeWidth??Bo["stroke-width"])*Number(t.size??t.width??Bo.width)/Number(r.size??r.width??Bo.width):r.strokeWidth??Bo["stroke-width"];return["svg",{...Object.entries(Bo).reduce((x,[b,v])=>(x[a(b)]=v,x),{}),..."color"in r&&r.color&&{[a("stroke")]:r.color},..."size"in r&&Kd(r.size)&&{[a("width")]:r.size,[a("height")]:r.size},..."width"in r&&Kd(r.width)&&{[a("width")]:r.width},..."height"in r&&Kd(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(x=>{const[b,v,S]=x,w=r.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...v}:v;return S?[b,w,S]:[b,w]})]}/**
|
|
127
127
|
* @license lucide-react v1.58.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
@@ -133,70 +133,70 @@ Error generating stack: `+o.message+`
|
|
|
133
133
|
*
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
135
135
|
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const wA=t=>{for(const r in t)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},EA=E.createContext({}),TA=()=>E.useContext(EA),jA=E.forwardRef(({color:t,size:r,width:i,height:a,strokeWidth:c,absoluteStrokeWidth:l,nonScalingStroke:u,className:d="",children:m,iconNode:p=[],icon:C={node:p,aliases:[],size:24},...g},
|
|
136
|
+
*/const wA=t=>{for(const r in t)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},EA=E.createContext({}),TA=()=>E.useContext(EA),jA=E.forwardRef(({color:t,size:r,width:i,height:a,strokeWidth:c,absoluteStrokeWidth:l,nonScalingStroke:u,className:d="",children:m,iconNode:p=[],icon:C={node:p,aliases:[],size:24},...g},x)=>{const{size:b=24,strokeWidth:v=2,absoluteStrokeWidth:S=!1,nonScalingStroke:w=!1,color:T="currentColor",className:j=""}=TA()??{},N=!!m||wA(g),[M,D,O=[]]=CA(C,{color:t??T,width:i??r??b,height:a??r??b,strokeWidth:c??v,absoluteStrokeWidth:l??S,nonScalingStroke:u??w,className:Xd(j,d),hasA11yProp:N,attributes:g});return E.createElement(M,{ref:x,...D},[...O.map(([_,k])=>E.createElement(_,k)),...Array.isArray(m)?m:[m]])});/**
|
|
137
137
|
* @license lucide-react v1.58.0 - ISC
|
|
138
138
|
*
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/function
|
|
141
|
+
*/function Vn(t,r=[],i=[]){const a=typeof t=="string"?xA(t,r,i):t,c=E.forwardRef(({className:l,...u},d)=>E.createElement(jA,{ref:d,icon:a,className:l,...u}));return a.name&&(c.displayName=vA(a.name)),c}/**
|
|
142
142
|
* @license lucide-react v1.58.0 - ISC
|
|
143
143
|
*
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
145
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const y0={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};y0.node;const
|
|
146
|
+
*/const y0={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};y0.node;const x0=Vn(y0);/**
|
|
147
147
|
* @license lucide-react v1.58.0 - ISC
|
|
148
148
|
*
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
150
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const
|
|
151
|
+
*/const b0={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};b0.node;const v0=Vn(b0);/**
|
|
152
152
|
* @license lucide-react v1.58.0 - ISC
|
|
153
153
|
*
|
|
154
154
|
* This source code is licensed under the ISC license.
|
|
155
155
|
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const S0={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};S0.node;const AA=
|
|
156
|
+
*/const S0={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};S0.node;const AA=Vn(S0);/**
|
|
157
157
|
* @license lucide-react v1.58.0 - ISC
|
|
158
158
|
*
|
|
159
159
|
* This source code is licensed under the ISC license.
|
|
160
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const C0={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};C0.node;const RA=
|
|
161
|
+
*/const C0={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};C0.node;const RA=Vn(C0);/**
|
|
162
162
|
* @license lucide-react v1.58.0 - ISC
|
|
163
163
|
*
|
|
164
164
|
* This source code is licensed under the ISC license.
|
|
165
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const w0={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};w0.node;const
|
|
166
|
+
*/const w0={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};w0.node;const NA=Vn(w0);/**
|
|
167
167
|
* @license lucide-react v1.58.0 - ISC
|
|
168
168
|
*
|
|
169
169
|
* This source code is licensed under the ISC license.
|
|
170
170
|
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const E0={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]};E0.node;const
|
|
171
|
+
*/const E0={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]};E0.node;const OA=Vn(E0);/**
|
|
172
172
|
* @license lucide-react v1.58.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|
|
175
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const T0={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]};T0.node;const MA=
|
|
176
|
+
*/const T0={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]};T0.node;const MA=Vn(T0);/**
|
|
177
177
|
* @license lucide-react v1.58.0 - ISC
|
|
178
178
|
*
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const j0={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};j0.node;const _A=
|
|
181
|
+
*/const j0={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};j0.node;const _A=Vn(j0);/**
|
|
182
182
|
* @license lucide-react v1.58.0 - ISC
|
|
183
183
|
*
|
|
184
184
|
* This source code is licensed under the ISC license.
|
|
185
185
|
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const A0={name:"panels-top-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],aliases:["layout"]};A0.node;const DA=
|
|
186
|
+
*/const A0={name:"panels-top-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],aliases:["layout"]};A0.node;const DA=Vn(A0);/**
|
|
187
187
|
* @license lucide-react v1.58.0 - ISC
|
|
188
188
|
*
|
|
189
189
|
* This source code is licensed under the ISC license.
|
|
190
190
|
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const R0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};R0.node;const IA=
|
|
191
|
+
*/const R0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};R0.node;const IA=Vn(R0);/**
|
|
192
192
|
* @license lucide-react v1.58.0 - ISC
|
|
193
193
|
*
|
|
194
194
|
* This source code is licensed under the ISC license.
|
|
195
195
|
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const
|
|
196
|
+
*/const N0={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};N0.node;const kA=Vn(N0),Fd={"scale-wrapper":"_scale-wrapper_qmn4q_1",bar:"_bar_qmn4q_8",percent:"_percent_qmn4q_19"},O0={"press-wrapper":"_press-wrapper_1m46f_1",active:"_active_1m46f_8"};var Qd={exports:{}};/*!
|
|
197
197
|
Copyright (c) 2018 Jed Watson.
|
|
198
198
|
Licensed under the MIT License (MIT), see
|
|
199
199
|
http://jedwatson.github.io/classnames
|
|
200
|
-
*/var M0;function LA(){return M0||(M0=1,(function(t){(function(){var r={}.hasOwnProperty;function i(){for(var l="",u=0;u<arguments.length;u++){var d=arguments[u];d&&(l=c(l,a(d)))}return l}function a(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return i.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var u="";for(var d in l)r.call(l,d)&&l[d]&&(u=c(u,d));return u}function c(l,u){return u?l?l+" "+u:l+u:l}t.exports?(i.default=i,t.exports=i):window.classNames=i})()})(Zd)),Zd.exports}var zA=LA();const _0=Pm(zA),D0=t=>{const{padding:r="",active:i=!1,className:a,...c}=t,l=E.useMemo(()=>{if(!r)return"unset";if(typeof r=="string")return r;if(typeof r=="number")return r+"px";if(Array.isArray(r))return r.map(u=>u+"px").join(" ")},[r]);return f.jsx("div",{...c,className:_0(a,N0["press-wrapper"],i?N0.active:""),style:{padding:l},children:t.children})};function I0({title:t,children:r}){const[i,a]=E.useState(null);return f.jsxs(dA,{children:[f.jsx(fA,{asChild:!0,children:f.jsx("span",{ref:a,className:"ui-tooltip-trigger",children:r})}),f.jsx(hA,{container:g0(i),className:"ui-tooltip",side:"top",sideOffset:6,children:t})]})}const BA={"icon-quanping":NA,"icon-quxiaoquanping":MA,"icon-shitudaohang":DA},k0=t=>{const{type:r,children:i,tooltip:a,...c}=t,l=BA[r];return a?f.jsx(I0,{title:a,children:f.jsx(D0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})}):f.jsx(D0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})};function HA({className:t,type:r,...i}){return f.jsx("input",{type:r,"data-slot":"input",className:Ve("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...i})}function PA({className:t,...r}){return f.jsx("textarea",{"data-slot":"textarea",className:Ve("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",t),...r})}const Oa=E.forwardRef(function({className:r,controlSize:i,size:a,status:c,...l},u){return f.jsx(HA,{...l,ref:u,"aria-invalid":c==="error"||l["aria-invalid"],"data-control-size":i||(a==="small"?"compact":a),className:Ve("ui-control ui-input",r)})});function Pl({autoSize:t,className:r,...i}){const a=E.useRef(null);return E.useLayoutEffect(()=>{const c=a.current;if(!c||!t)return;const l=getComputedStyle(c),u=parseFloat(l.lineHeight)||20,d=parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)+2;c.style.height="0px",c.style.height=`${Math.max(t.minRows*u+d,Math.min(t.maxRows*u+d,c.scrollHeight+2))}px`},[i.value,t]),f.jsx(PA,{...i,ref:a,className:Ve("ui-control ui-textarea",r)})}function UA({...t}){return f.jsx(e2,{"data-slot":"select",...t})}function $A({...t}){return f.jsx(v2,{"data-slot":"select-group",...t})}function GA({...t}){return f.jsx(o2,{"data-slot":"select-value",...t})}function VA({className:t,size:r="default",children:i,...a}){return f.jsxs(n2,{"data-slot":"select-trigger","data-size":r,className:Ve("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...a,children:[i,f.jsx(a2,{asChild:!0,children:f.jsx(v0,{className:"size-4 opacity-50"})})]})}function qA({container:t,className:r,children:i,position:a="item-aligned",align:c="center",...l}){return f.jsx(c2,{container:t,children:f.jsxs(u2,{"data-slot":"select-content",className:Ve("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:a,align:c,...l,children:[f.jsx(KA,{}),f.jsx(g2,{className:Ve("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:i}),f.jsx(FA,{})]})})}function YA({className:t,...r}){return f.jsx(C2,{"data-slot":"select-label",className:Ve("px-2 py-1.5 text-xs text-muted-foreground",t),...r})}function XA({className:t,children:r,...i}){return f.jsxs(E2,{"data-slot":"select-item",className:Ve("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(A2,{children:f.jsx(b0,{className:"size-4"})})}),f.jsx(T2,{children:r})]})}function KA({className:t,...r}){return f.jsx(R2,{"data-slot":"select-scroll-up-button",className:Ve("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(AA,{className:"size-4"})})}function FA({className:t,...r}){return f.jsx(O2,{"data-slot":"select-scroll-down-button",className:Ve("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(v0,{className:"size-4"})})}function Wd(t){return E.Children.toArray(t).flatMap(r=>E.isValidElement(r)?r.type===E.Fragment?Wd(r.props.children):r.type==="optgroup"?[{label:r.props.label,options:Wd(r.props.children)}]:[{value:String(r.props.value??r.props.children??""),label:r.props.children,disabled:r.props.disabled}]:[])}const Ul="__empty_option__";function L0(t,r){return t.map((i,a)=>i.options?f.jsxs($A,{children:[f.jsx(YA,{children:i.label}),L0(i.options,r)]},a):f.jsx(XA,{value:String(i.value)||Ul,disabled:i.disabled,"data-option-value":i.value,onKeyDown:c=>{c.key==="Enter"&&!i.disabled&&(c.preventDefault(),r(String(i.value)||Ul))},children:i.label},String(i.value)))}function Wt({className:t,controlSize:r,size:i,children:a,options:c,value:l,onChange:u,disabled:d,...m}){const p=E.useRef(null),[C,g]=E.useState(!1),b=v=>{if(v){g(!0);return}const S=!!document.activeElement?.closest('[data-slot="select-content"]');Yr.flushSync(()=>g(!1)),S&&p.current?.focus({preventScroll:!0})},x=v=>{b(!1),u?.(v===Ul?"":v)};return f.jsxs(UA,{value:l===void 0?void 0:String(l)||Ul,onValueChange:x,disabled:d,open:C,onOpenChange:b,children:[f.jsx(VA,{...m,ref:p,className:Ve("ui-control ui-select",t),"data-value":l===void 0?"":String(l),"data-control-size":r||(i==="small"?"compact":i),children:f.jsx(GA,{})}),f.jsx(qA,{container:g0(p.current),position:"popper",align:"start",className:"ui-select-popup",onCloseAutoFocus:v=>v.preventDefault(),onEscapeKeyDown:v=>{v.preventDefault(),v.stopPropagation(),b(!1)},children:L0(c||Wd(a),x)})]})}const z0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,B0=Jm,QA=((t,r)=>i=>{var a;if(r?.variants==null)return B0(t,i?.class,i?.className);const{variants:c,defaultVariants:l}=r,u=Object.keys(c).map(p=>{const C=i?.[p],g=l?.[p];if(C===null)return null;const b=z0(C)||z0(g);return c[p][b]}),d=i&&Object.entries(i).reduce((p,C)=>{let[g,b]=C;return b===void 0||(p[g]=b),p},{}),m=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((p,C)=>{let{class:g,className:b,...x}=C;return Object.entries(x).every(v=>{let[S,w]=v;return Array.isArray(w)?w.includes({...l,...d}[S]):{...l,...d}[S]===w})?[...p,g,b]:p},[]);return B0(t,u,m,i?.class,i?.className)})("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function H0({className:t,variant:r="default",size:i="default",asChild:a=!1,...c}){const l=a?FC:"button";return f.jsx(l,{"data-slot":"button","data-variant":r,"data-size":i,className:Ve(QA({variant:r,size:i,className:t})),...c})}function ue({type:t="default",htmlType:r="button",size:i="middle",danger:a,loading:c,className:l,children:u,...d}){return f.jsxs(H0,{variant:t==="primary"?"default":t==="text"?"ghost":"outline",size:i==="small"?"xs":i==="large"?"lg":"sm",...d,type:r,disabled:d.disabled||c,"aria-busy":c||void 0,className:Ve("ui-button",a&&"ui-danger",l),children:[c&&f.jsx(OA,{className:"animate-spin","aria-hidden":"true"}),u]})}function ZA({className:t,...r}){return f.jsx($E,{"data-slot":"checkbox",className:Ve("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",t),...r,children:f.jsx(VE,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(b0,{className:"size-3.5"})})})}function zt({children:t,className:r,onChange:i,id:a,...c}){const l=E.useId();return f.jsxs("label",{className:Ve("ui-checkbox-label",r),htmlFor:a||l,children:[f.jsx(ZA,{...c,id:a||l,className:"ui-checkbox",onCheckedChange:u=>i?.({target:{checked:u===!0}})}),t&&f.jsx("span",{children:t})]})}function Na({value:t,onChange:r,precision:i,className:a,onBlur:c,...l}){const[u,d]=E.useState(t==null?"":String(t));return E.useEffect(()=>{d(t==null?"":String(t))},[t]),f.jsx(Oa,{...l,type:"number",inputMode:"decimal",className:Ve("ui-number",a),value:u,onChange:m=>{const p=m.target.value;d(p),p?Number.isFinite(Number(p))&&r?.(Number(p)):r?.(null)},onBlur:m=>{const p=Number(u),C=u&&Number.isFinite(p)&&i!==void 0?String(Number(p.toFixed(i))):u;d(t==null?"":C||String(t)),c?.(m)}})}function WA({...t}){return f.jsx(EE,{"data-slot":"dialog",...t})}function JA({...t}){return f.jsx(jE,{"data-slot":"dialog-portal",...t})}function eR({...t}){return f.jsx(dd,{"data-slot":"dialog-close",...t})}function tR({className:t,...r}){return f.jsx(AE,{"data-slot":"dialog-overlay",className:Ve("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...r})}function nR({className:t,children:r,showCloseButton:i=!0,portal:a=!0,overlay:c=!0,...l}){const u=f.jsxs(E.Fragment,{children:[c&&f.jsx(tR,{className:"ui-dialog-overlay"}),f.jsxs(NE,{"data-slot":"dialog-content",className:Ve("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",t),...l,children:[r,i&&f.jsxs(dd,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(kA,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]});return a?f.jsx(JA,{children:u}):u}function rR({className:t,...r}){return f.jsx("div",{"data-slot":"dialog-header",className:Ve("flex flex-col gap-2 text-center sm:text-left",t),...r})}function oR({className:t,showCloseButton:r=!1,children:i,...a}){return f.jsxs("div",{"data-slot":"dialog-footer",className:Ve("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a,children:[i,r&&f.jsx(dd,{asChild:!0,children:f.jsx(H0,{variant:"outline",children:"Close"})})]})}function aR({className:t,...r}){return f.jsx(DE,{"data-slot":"dialog-title",className:Ve("text-lg leading-none font-semibold",t),...r})}function Vi({open:t,modal:r=!0,panelRef:i,width:a=460,zIndex:c=900,className:l,title:u,footer:d,children:m,classNames:p,closeLabel:C,closeIcon:g,onCancel:b,onOpenAutoFocus:x,onEscapeKeyDown:v,wrapProps:S}){const w=E.useId(),T=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return f.jsx(WA,{open:t,modal:r,onOpenChange:j=>{j||b()},children:f.jsxs(nR,{...S,ref:i,portal:!1,overlay:r,showCloseButton:!1,"aria-describedby":void 0,"aria-labelledby":w,"aria-modal":r,className:Ve("ui-dialog",l),style:{width:a,zIndex:c},onInteractOutside:j=>j.preventDefault(),onOpenAutoFocus:x,onEscapeKeyDown:j=>{if(!r&&j.target instanceof Element&&!j.target.closest(".ui-dialog")){j.preventDefault();return}v?.(j)},onCloseAutoFocus:j=>{j.preventDefault(),r&&T.current?.isConnected&&T.current.focus({preventScroll:!0})},children:[f.jsxs("div",{className:"ui-dialog-surface",children:[f.jsx(rR,{className:Ve("ui-dialog-header",p?.header),children:f.jsx(aR,{asChild:!0,id:w,children:f.jsx("div",{className:"ui-dialog-title",children:u})})}),f.jsx("div",{className:Ve("ui-dialog-body",p?.body),children:m}),d&&f.jsx(oR,{className:Ve("ui-dialog-footer",p?.footer),children:d})]}),f.jsx(eR,{"aria-label":C,className:"ui-dialog-close",children:g})]})})}function iR({className:t,...r}){return f.jsx(Hj,{"data-slot":"radio-group",className:Ve("grid gap-3",t),...r})}function sR({children:t,indicator:r=!0,className:i,...a}){return f.jsxs(Gj,{"data-slot":"radio-group-item",className:Ve("aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",i),...a,children:[r&&f.jsx(qj,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(RA,{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary"})}),t]})}function lR(t){return null}function cR({value:t,onChange:r,children:i,className:a,name:c,disabled:l}){const u=E.Children.toArray(i).filter(E.isValidElement);return f.jsx(iR,{name:c,disabled:l,className:Ve("ui-radio-group",a),value:String(t),onValueChange:d=>{const m=u.find(p=>String(p.props.value)===d);m&&r({target:{value:m.props.value}})},children:u.map(({props:d})=>f.jsx(sR,{value:String(d.value),disabled:d.disabled,className:"ui-radio-option",indicator:!1,children:d.children},String(d.value)))})}const Ye={Group:cR,Button:lR};function uR({thumbLabel:t,className:r,defaultValue:i,value:a,min:c=0,max:l=100,...u}){const d=E.useMemo(()=>Array.isArray(a)?a:Array.isArray(i)?i:[c,l],[a,i,c,l]);return f.jsxs(z2,{"data-slot":"slider",defaultValue:i,value:a,min:c,max:l,className:Ve("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",r),...u,children:[f.jsx(U2,{"data-slot":"slider-track",className:Ve("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx($2,{"data-slot":"slider-range",className:Ve("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:d.length},(m,p)=>f.jsx(X2,{"data-slot":"slider-thumb","aria-label":t,className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},p))]})}function P0({value:t,onChange:r,ariaLabelForHandle:i,...a}){return f.jsx(uR,{...a,value:[t],onValueChange:c=>r(c[0]),thumbLabel:i})}const U0=t=>{let r;const i=new Set,a=(p,C)=>{const g=typeof p=="function"?p(r):p;if(!Object.is(g,r)){const b=r;r=C??(typeof g!="object"||g===null)?g:Object.assign({},r,g),i.forEach(x=>x(r,b))}},c=()=>r,d={setState:a,getState:c,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p))},m=r=t(a,c,d);return d},dR=(t=>t?U0(t):U0),fR=t=>t;function hR(t,r=fR){const i=Ni.useSyncExternalStore(t.subscribe,Ni.useCallback(()=>r(t.getState()),[t,r]),Ni.useCallback(()=>r(t.getInitialState()),[t,r]));return Ni.useDebugValue(i),i}const $0=t=>{const r=dR(t),i=a=>hR(r,a);return Object.assign(i,r),i},mR=(t=>t?$0(t):$0),$l={min:20,max:150},G0={width:4e3,height:2e3},V0={width:210,height:297},Uo=mR((t,r)=>({scale:100,navigatorVisible:!0,setScale:i=>t(a=>({...a,scale:Math.max($l.min,Math.min($l.max,Math.round(i)))})),getScale:()=>r().scale,setNavigatorVisible:i=>t(a=>({...a,navigatorVisible:i}))})),pR=()=>{const{scale:t,setScale:r,getScale:i}=Uo(),a=c=>r(i()+c);return E.useEffect(()=>{const c=document.getElementById("answer-sheet-stadio"),l=d=>{if(!d.ctrlKey)return;d.preventDefault();const m=document.getElementById("answer-sheet"),p=m.getBoundingClientRect(),C=(d.clientX-p.left)/p.width,g=(d.clientY-p.top)/p.height;Yr.flushSync(()=>r(i()+(d.deltaY<0?5:-5)));const b=m.getBoundingClientRect();c.scrollLeft+=b.left+C*b.width-d.clientX,c.scrollTop+=b.top+g*b.height-d.clientY},u=d=>{(d.ctrlKey||d.metaKey)&&(d.key==="+"||d.key==="="||d.key==="-")&&(d.preventDefault(),r(i()+(d.key==="-"?-10:10)))};return c.addEventListener("wheel",l,{passive:!1}),window.addEventListener("keydown",u),()=>{c.removeEventListener("wheel",l),window.removeEventListener("keydown",u)}},[i,r]),f.jsxs("div",{className:Qd["scale-wrapper"],"aria-label":"工作区缩放",children:[f.jsx(ue,{type:"text",size:"small","aria-label":"缩小",onClick:()=>a(-2),children:f.jsx(_A,{})}),f.jsx(P0,{className:Qd.bar,ariaLabelForHandle:"缩放比例",min:$l.min,max:$l.max,step:1,value:t,onChange:r}),f.jsx(ue,{type:"text",size:"small","aria-label":"放大",onClick:()=>a(2),children:f.jsx(IA,{})}),f.jsx(I0,{title:"重置缩放",children:f.jsxs("div",{role:"button",tabIndex:0,"aria-label":"重置缩放",onClick:()=>r(100),onKeyDown:c=>{c.key==="Enter"&&r(100)},className:_0("font-12 grey ml-5 pointer",Qd.percent),children:[t,"%"]})})]})},gR=()=>{const[t,r]=E.useState(!1);E.useEffect(()=>{const a=()=>r(document.fullscreenElement===document.getElementById("uni-answer-sheet"));return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]);const i=async()=>{try{document.fullscreenElement?await document.exitFullscreen():await document.getElementById("uni-answer-sheet").requestFullscreen()}catch{}};return f.jsx(k0,{type:t?"icon-quxiaoquanping":"icon-quanping",className:"ml-5",padding:[0,5],role:"button",tabIndex:0,"aria-label":t?"取消全屏":"全屏",tooltip:t?"取消全屏":"全屏",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i())},onClick:i})},yR=({summary:t})=>{const{navigatorVisible:r,setNavigatorVisible:i}=Uo();return f.jsxs("div",{className:gA.footer,"aria-label":"工作区底栏",children:[f.jsx("div",{className:"font-12 grey",children:t}),f.jsxs("div",{children:[f.jsx(k0,{type:"icon-shitudaohang",padding:[0,5],tooltip:(r?"隐藏":"显示")+"视图导航",active:r,role:"button",tabIndex:0,"aria-label":(r?"隐藏":"显示")+"视图导航",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i(!r))},className:"mr-5",onClick:()=>i(!r)}),f.jsx(pR,{}),f.jsx(gR,{})]})]})},q0={"stadio-wrapper":"_stadio-wrapper_jknpq_1",container:"_container_jknpq_15"},bR=({width:t=Ro(V0.width),height:r=Ro(V0.height),children:i})=>{const{scale:a}=Uo();return f.jsx("div",{id:"answer-sheet",style:{transform:`scale(${a/100})`,height:r,width:t},children:i})};var qi=(t=>(t.STADIO_SCROLL_CHANGE="STADIO_SCROLL_CHANGE",t))(qi||{});class xR{constructor(){gm(this,"callbacks",new Map)}on(r,i){this.callbacks.set(r,i)}emit(r,...i){const a=this.callbacks.get(r);a&&a(i)}depose(r){this.callbacks.delete(r)}}const Gl=new xR,vR=({width:t,height:r,children:i,onBackgroundClick:a})=>{const c=E.useRef(null),l=E.useRef(null),{scale:u}=Uo(),d=u/100,m=Math.max(G0.width,t*d+600),p=Math.max(G0.height,r*d+600),C=E.useRef(null);return E.useLayoutEffect(()=>{const g=l.current,b=(m-t*d)/2,x=(p-r*d)/2,v=C.current;if(!v||v.width!==t)g.scrollLeft=Math.max(0,b+t*d/2-g.clientWidth/2),g.scrollTop=Math.max(0,x-54);else{const S=(g.scrollLeft+g.clientWidth/2-v.left)/v.zoom,w=(g.scrollTop+g.clientHeight/2-v.top)/v.zoom;g.scrollLeft=b+S*d-g.clientWidth/2,g.scrollTop=x+w*d-g.clientHeight/2}C.current={left:b,top:x,zoom:d,width:t},Gl.emit(qi.STADIO_SCROLL_CHANGE)},[m,p,t,r,d]),E.useEffect(()=>{const g=l.current,b=c.current;let x=()=>{};const v=w=>{if(w.button!==1)return;w.preventDefault(),x();const T=w.clientX,j=w.clientY,R=g.scrollLeft,O=g.scrollTop,M=document.body.style.cursor;document.body.style.cursor="grabbing";const D=I=>g.scrollTo({left:R-I.clientX+T,top:O-I.clientY+j}),_=I=>{I.button===1&&x()};x=()=>{document.body.style.cursor=M,window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",_),window.removeEventListener("blur",x)},window.addEventListener("mousemove",D),window.addEventListener("mouseup",_),window.addEventListener("blur",x)},S=()=>Gl.emit(qi.STADIO_SCROLL_CHANGE);return b.addEventListener("mousedown",v),g.addEventListener("scroll",S),()=>{x(),b.removeEventListener("mousedown",v),g.removeEventListener("scroll",S)}},[]),f.jsx("div",{className:q0["stadio-wrapper"],ref:l,id:"answer-sheet-stadio","aria-label":"制卡工作区",children:f.jsx("div",{className:q0.container,ref:c,id:"answer-sheet-container",style:{height:p,width:m},onPointerDown:g=>{g.target===g.currentTarget&&a?.()},children:f.jsx(bR,{width:t,height:r,children:i})})})},Jd={"navigator-wrapper":"_navigator-wrapper_rb3fn_1","fake-page":"_fake-page_rb3fn_12",viewport:"_viewport_rb3fn_17"},SR=()=>{const{scale:t}=Uo(),[r,i]=E.useState({ratio:20,width:200,height:100,view:{x:0,y:0,width:0,height:0},pages:[]}),a=E.useRef(null),c=E.useRef(()=>{});return E.useEffect(()=>{const l=document.getElementById("answer-sheet-stadio"),u=document.getElementById("answer-sheet-container"),d=document.getElementById("answer-sheet");let m=0;const p=()=>{const b=Math.max(20,u.offsetWidth/200,u.offsetHeight/160),x=u.getBoundingClientRect(),v=Array.from(d.querySelectorAll("[data-paper-page]")),S=(v.length?v:[d]).map(T=>{const j=T.getBoundingClientRect();return{x:(j.left-x.left)/b,y:(j.top-x.top)/b,width:j.width/b,height:j.height/b}}),w={ratio:b,width:u.offsetWidth/b,height:u.offsetHeight/b,view:{x:l.scrollLeft/b,y:l.scrollTop/b,width:l.clientWidth/b,height:l.clientHeight/b},pages:S};i(T=>JSON.stringify(T)===JSON.stringify(w)?T:w)},C=()=>{cancelAnimationFrame(m),m=requestAnimationFrame(p)};c.current=C;const g=new ResizeObserver(C);return[l,u,d].forEach(b=>g.observe(b)),Gl.on(qi.STADIO_SCROLL_CHANGE,C),C(),()=>{c.current=()=>{},cancelAnimationFrame(m),g.disconnect(),Gl.depose(qi.STADIO_SCROLL_CHANGE)}},[]),E.useLayoutEffect(()=>{c.current()},[t]),f.jsxs("div",{className:Jd["navigator-wrapper"],"aria-label":"视图导航",style:{width:r.width,height:r.height},children:[r.pages.map((l,u)=>f.jsx("div",{className:Jd["fake-page"],"data-nav-page":u+1,style:{left:l.x,top:l.y,width:l.width,height:l.height}},u)),f.jsx("div",{className:Jd.viewport,role:"button",tabIndex:0,"aria-label":"拖动导航视口",style:{left:r.view.x,top:r.view.y,width:r.view.width,height:r.view.height},onPointerDown:l=>{if(l.button!==0)return;l.preventDefault();const u=document.getElementById("answer-sheet-stadio");a.current={x:l.clientX,y:l.clientY,left:u.scrollLeft,top:u.scrollTop},l.currentTarget.setPointerCapture(l.pointerId)},onPointerMove:l=>{if(!a.current)return;document.getElementById("answer-sheet-stadio").scrollTo({left:a.current.left+(l.clientX-a.current.x)*r.ratio,top:a.current.top+(l.clientY-a.current.y)*r.ratio})},onPointerUp:l=>{a.current=null,l.currentTarget.releasePointerCapture(l.pointerId)},onLostPointerCapture:()=>{a.current=null},onKeyDown:l=>{const d={ArrowLeft:[-80,0],ArrowRight:[80,0],ArrowUp:[0,-80],ArrowDown:[0,80]}[l.key];d&&(l.preventDefault(),document.getElementById("answer-sheet-stadio").scrollBy({left:d[0],top:d[1]}))}})]})},ef=new WeakMap;function CR(t){return Array.from(t.querySelectorAll("[data-card-editor-host]")).flatMap(r=>{const i=ef.get(r),a=r.querySelector(".rt-content");if(!i||!a||a.closest("[hidden]")||!a.getClientRects().length)return[];const c=a.getBoundingClientRect(),l=c.width/a.offsetWidth,u=[...i.getAnswerRegions()],d=new Set(u.map(m=>m.id));return a.querySelectorAll(".rt-choice-stem-glyph").forEach(m=>{const p=m.dataset.optionId,C=m.getBoundingClientRect();!p||d.has(p)||C.width<=0||C.height<=0||(d.add(p),u.push({id:p,pos:-1,type:"choiceOption",attrs:{label:m.textContent||"",questionId:m.dataset.fillQuestionId},x:(C.x-c.x)/l,y:(C.y-c.y)/l,width:C.width/l,height:C.height/l}))}),u.map(m=>({element:a,region:m,rect:{x:c.x+m.x*l,y:c.y+m.y*l,width:m.width*l,height:m.height*l}}))})}const Y0=E.createContext(null),Vl=E.forwardRef((t,r)=>{const i=E.useContext(Y0);if(!i)throw new Error("制卡需要显式注册富文本插件");const a=E.useRef(null),c=E.useRef(null),l=E.useRef(t);l.current=t;const u=E.useRef(null),d=E.useRef(null),m=E.useRef(!1),p=E.useRef(0),C=()=>({...l.current,onChange:b=>l.current.onChange?.(b),onLayout:b=>l.current.onLayout?.(b),onContentSelect:b=>l.current.onContentSelect?.(b)}),g=b=>{const x=c.current,v=++p.current;x&&x.ready.then(()=>{let S=0;const w=()=>{v!==p.current||c.current!==x||l.current.readOnly||(x.getStatus().editable?b(x):++S<120&&requestAnimationFrame(w))};requestAnimationFrame(w)}).catch(S=>{d.current=S})};return E.useImperativeHandle(r,()=>({getDocument:()=>m.current?c.current.getDocument():null,getAnswerRegions:()=>m.current?c.current.getAnswerRegions():[],setDocument(b){m.current?c.current.setDocument(b):u.current=b},syncDocument(b){m.current?c.current.syncDocument(b):u.current=b},focus:b=>g(x=>x.focus(b)),focusContent:b=>l.current.contentTargets?.some(x=>x.id===b)?(g(x=>{x.focusContent(b)||x.focus("start")}),!0):!1,insertAnswerRegion:(b,x,v)=>g(S=>S.insertAnswerRegion(b,x,v)),getStatus(){if(d.current)throw d.current;return m.current?c.current.getStatus():{ready:!1,editable:!1,composing:!1,uploading:!1,layoutPending:!0}}}),[]),E.useEffect(()=>{let b=!0;d.current=null;const x=document.createElement("div");x.style.display="contents",a.current.append(x);const v=i.create(x,C()),S=a.current;return ef.set(S,v),c.current=v,v.ready.then(()=>{b&&(m.current=!0,v.setOptions(C()),u.current&&(v.syncDocument(u.current),u.current=null))}).catch(w=>{b&&(d.current=w)}),()=>{b=!1,m.current=!1,c.current=null,p.current++,ef.delete(S),x.remove(),queueMicrotask(()=>v.destroy())}},[i]),E.useEffect(()=>{c.current?.setOptions(C())}),f.jsx("div",{ref:a,"data-card-editor-host":"",style:{display:"contents"}})}),X0={judge:"JUDGE",fill:"FILLBLANK",answer:"SHORTANSWER",writing:"CCOMPOSITION",english:"ECOMPOSITION",reading:"READTHENANSWER",cloze:"CLOZE",completion:"TEXT_COMPLETION",matching:"INFO_MATCHING",chunk:"CHUNK_CHOICE",composite:"MIXED",optional:"SHORTANSWER"};function wR(t){if(t.reference||!t.exercise)return t;const r=t.exercise,i=X0[t.kind]||"SHORTANSWER",a=Su(i);return a.fillNewLine=r.fillNewLine,a.optional=t.kind==="optional"&&r.items.length>1,a.choose=Math.max(1,Math.min(r.chooseCount,r.items.length-1)),a.questions=r.items.map(c=>{const l=i==="MIXED"?c.kind==="choice"?c.choice.multiple?"MCHOICE":"SCHOICE":X0[c.kind]||"SHORTANSWER":i,u=l==="MIXED"?"SHORTANSWER":l,d=wu({...Cu(u),partCount:1,optionCount:u==="JUDGE"?2:c.choice.options.length,score:c.score},Number(c.label)||1);if(d.id=c.id,d.label=c.label,d.document=c.document,d.choice={...fa(c.choice,u,u==="JUDGE"?2:Math.min(u==="CHUNK_CHOICE"?26:12,c.choice.options.length)),id:c.id,label:c.label},d.characters=Math.min(1200,Math.max(1,c.area.rows*c.area.columns)),d.lines=Math.min(100,Math.max(1,c.area.rows)),d.height=Math.max(30,c.area.rows*c.area.rowHeight),u==="FILLBLANK"||u==="TEXT_COMPLETION")d.parts=c.blanks.map((m,p)=>({...ji(c.blanks.length===1?c.label:`${c.label}.${p+1}`,m.score,u),id:m.id,width:m.width,breakAfter:m.breakAfter})),d.score=Fn(d.parts);else if(u==="SHORTANSWER")d.parts=[{...ji(c.label,c.score,u),document:c.document,height:d.height}];else if(Be(u)){const m=ji(c.label,c.score,u,c.choice.options.length);d.parts=[{...m,choice:{...d.choice,id:m.id}}]}return["SHORTANSWER","CCOMPOSITION","ECOMPOSITION"].includes(u)&&(d.document={...d.document,content:{...d.document.content,content:[...Ci(d.label,d.score).content.content,...d.document.content.content||[]]}},d.parts=d.parts.map(m=>({...m,document:{...m.document,content:{...m.document.content,content:[...Ci(m.label,m.score).content.content,...m.document.content.content||[]]}}}))),d}),{...t,reference:a}}const nr="reference-merged-objective";function ER(t,r){const i=t.blocks.map(d=>d.reference&&t.choiceDirection&&t.choiceDirection!==d.reference.layout.direction?{...d,reference:{...d.reference,layout:{...d.reference.layout,direction:t.choiceDirection}}}:d);if(!t.mergeObjective)return i;const a=i.find(d=>d.reference?.questions.some(m=>Et(m.type)));if(!a?.reference)return i;const c=i.flatMap(d=>{if(!d.reference)return[];const m=la({...d.reference.layout,questions:ha(d.reference)},d.document,t.questionCard!==!1||r===d.id).concentrated,p=new Set(m.questions.map(C=>C.id));return d.reference.questions.filter(C=>Et(C.type)).flatMap(C=>{if(!Be(C.type))return p.has(C.id)?[C]:[];const g=C.parts.filter(b=>p.has(b.id));return g.length?[{...C,parts:g}]:[]})});if(!c.length)return i;const l={...a,id:nr,document:Vt(),reference:{...Su("MIXED"),layout:{...a.reference.layout,presentation:"concentrated"},questions:c}},u=i.flatMap(d=>{if(!d.reference)return[d];const m=d.reference.questions.filter(C=>!Et(C.type)),p=t.questionCard!==!1&&!Cn(d.document)||r===d.id;return!m.length&&!p&&d.reference.questions.length?[]:[d]});return[l,...u]}function K0(t){const r=t.reference;if(!r)return[];const i=r.type==="MIXED"?[{id:t.id,label:"公共材料",kind:"material"}]:[];return r.questions.forEach(a=>{const c=Be(a.type);i.push({id:a.id,label:c?`第 ${a.parts.map(l=>l.label).join("、")} 题材料`:`第 ${a.label} 题题干`,kind:c?"material":"question",choice:!c&&Et(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="JUDGE"}),a.parts.filter(l=>r.textVersion!==1||l.text).forEach(l=>i.push({id:l.id,label:`第 ${l.label} ${a.type==="FILLBLANK"?"空":"题"}`,kind:"question",parentId:a.id,choice:c&&Et(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="INFO_MATCHING",inlineOptions:r.textVersion===1&&["CLOZE","INFO_MATCHING"].includes(a.type),optionWidth:r.textVersion===1&&a.type==="INFO_MATCHING"?70:void 0}))}),i}function F0(t,r){return{...t,attrs:{...t.attrs,contentId:r}}}function TR(t,r,i){const a=new Map(r.questions.filter(u=>Ei(u.type)).flatMap(u=>u.parts).map(u=>[u.id,u])),c=u=>{const d=u.type==="answerLine"&&a.get(u.attrs?.id),m=d&&Math.max(24,Math.min(600,i*d.width/100));if(d&&(u.attrs?.label!==d.label||u.attrs?.width!==m))return{...u,attrs:{...u.attrs,label:d.label,width:m}};const p=u.content?.map(c);return p?.some((C,g)=>C!==u.content[g])?{...u,content:p}:u},l=c(t.content);return l===t.content?t:{...t,content:l}}function jR(t){if(!t.reference)return t.document;const r=new Map;t.reference.questions.forEach(c=>{[c.choice,...c.parts.map(l=>l.choice)].forEach(l=>{l.contentTarget&&r.set(l.contentTarget.groupId,l.id)})});let i=!1;const a=t.document.content.content?.map(c=>{if(c.attrs?.contentId)return c;let l;const u=d=>{d.type==="choiceGroup"&&(l=r.get(d.attrs?.id)||l),d.type==="choiceStemAnchor"&&(l=r.get(d.attrs?.groupId)||l),d.content?.forEach(u)};return u(c),l?(i=!0,F0(c,l)):c});return i?{...t.document,content:{...t.document.content,content:a}}:t.document}function AR(t,r,i){const a=w=>w.questions.flatMap(T=>[T.id,...T.parts.map(j=>j.id)]),c=new Set(a(r)),l=new Set(a(i)),u=new Set([...c].filter(w=>!l.has(w)));let d=!1;const m=w=>{if(u.has(w.attrs?.contentId)||w.type==="answerLine"&&u.has(w.attrs?.id))return d=!0,null;const T=w.content?.map(m).filter(j=>j!==null);return T?{...w,content:T}:w},p=m(t.content),C=p.content||[],g=a(i),b=C.filter(w=>l.has(w.attrs?.contentId)),x=[...b].sort((w,T)=>g.indexOf(w.attrs.contentId)-g.indexOf(T.attrs.contentId));let v=0;const S=C.map(w=>l.has(w.attrs?.contentId)?x[v++]:w);return b.some((w,T)=>w!==x[T])&&(d=!0),d?{...t,content:{...p,content:S.length?S:Vt().content.content}}:t}function RR(t,r,i){const a=new Map([[r.id,i.id],...r.parts.map((x,v)=>[x.id,i.parts[v].id])]),c=new Map([...r.choice.options.map((x,v)=>[x.id,i.choice.options[v].id]),...r.parts.flatMap((x,v)=>x.choice.options.map((S,w)=>[S.id,i.parts[v].choice.options[w].id]))]),l=new Map([[r.text?.groupId,i.text?.groupId],...r.parts.map((x,v)=>[x.text?.groupId,i.parts[v].text?.groupId])].filter(x=>!!(x[0]&&x[1]))),u=t.content.content||[],d=u.filter(x=>a.has(x.attrs?.contentId));if(!d.length)return t;const m=Ao(d),p=(x,v)=>({...x,...x.attrs?{attrs:{...x.attrs,...x.type==="choiceOption"&&c.has(v.attrs?.id)?{id:c.get(v.attrs.id)}:{},...x.type==="choiceGroup"&&l.has(v.attrs?.id)?{id:l.get(v.attrs.id)}:{},...a.has(v.attrs?.contentId)?{contentId:a.get(v.attrs.contentId)}:{},...x.type==="choiceStemAnchor"&&a.has(String(v.attrs?.groupId).slice(9))?{groupId:du(a.get(String(v.attrs.groupId).slice(9)))}:{}}}:{},...x.content?{content:x.content.map((S,w)=>p(S,v.content[w]))}:{}}),C=new Map(r.parts.map((x,v)=>[x.id,i.parts[v].id])),g=(x,v)=>({...x,...v.type==="answerLine"&&C.has(v.attrs?.id)?{attrs:{...x.attrs,id:C.get(v.attrs.id)}}:{},...x.content?{content:x.content.map((S,w)=>g(S,v.content[w]))}:{}}),b=Math.max(...d.map(x=>u.indexOf(x)));return{...t,content:{...t.content,content:[...u.slice(0,b+1),...m.map((x,v)=>g(p(x,d[v]),d[v])),...u.slice(b+1)]}}}function OR(t,r){const i=t.content.content||[],a=new Set(i.map(l=>l.attrs?.contentId).filter(Boolean)),c=(r.content.content||[]).filter(l=>l.attrs?.contentId&&!a.has(l.attrs.contentId));return c.length?{...t,content:{...t.content,content:[...Cn(t)?[]:i,...c]}}:t}function NR(t,r){const i={};let a=1;return{sectionInfoList:t.filter(l=>l.reference).map((l,u)=>{const d=l.reference,m=d.textVersion===1?d:Mm({...d,questions:d.questions.map(v=>({...v,text:v.text||{...wi(v.type,v.choice,Be(v.type)),numbered:!1,itemsContent:[]},parts:v.parts.map(S=>({...S,text:S.text||{...wi(v.type,S.choice),numbered:!1,itemsContent:[]}}))}))},l.document,l.id),p=m.sectionSeq??u+1,C=v=>v?.itemsContent.map(S=>({id:S.id,key:S.key,content:r.serialize(S.content)}))||[],g=v=>r.serialize(v?.content||Vt()),b=(v,S,w)=>{const T=v?Ws({...v,itemsContent:[]},S,w):[],j=r.serialize($r(T)),R=r.unwrapParagraphs||(O=>O.replace(/^<p\b[^>]*>([\s\S]*)<\/p>$/,"$1"));return{content:R(j,!0),contentNoP:R(j),items:C(v).map(O=>`${O.key}.${R(O.content)}`)}},x=m.questions.map(v=>{const S=Be(v.type),w=a;a+=S?v.parts.length:1;const T=v.referenceData||{},j=T.questionId??v.id,R=S?v.parts.map((D,_)=>({...D.referenceData,questionId:D.referenceData?.questionId??D.id,questionPid:j,questiontypeCode:v.type,seq:w+_,showSeq:D.label,itemShowNames:[D.label],score:D.score,itemcount:D.choice.options.length,content:g(D.text),itemsContent:C(D.text)})):void 0,O={...T,questionId:j,questiontypeCode:v.type,seq:w,showSeq:v.label,showSeqs:S?v.parts.map(D=>D.label):null,itemShowNames:v.parts.length?v.parts.map(D=>D.label):[v.label],itemcount:Et(v.type)?v.choice.options.length:v.parts.length||1,childNum:S?v.parts.length:void 0,score:v.score,itemScores:v.parts.length?v.parts.map(D=>D.score):[v.score],content:g(v.text),itemsContent:C(v.text),...R?{items:R}:{},lessScore:v.choice.lessScore,scoreType:v.choice.scoreType,rightAnswers:v.rightAnswers,singleScore:v.singleScore,extension:{...T.extension||{},...v.type==="CCOMPOSITION"?{kong:v.characters}:{},...v.type==="ECOMPOSITION"?{hang:v.lines}:{},uniEditor:{text:v.text,choice:v.choice,height:v.height,contentHeight:v.contentHeight,halfPoint:v.halfPoint,parts:v.parts.map(D=>({id:D.id,text:D.text,width:D.width,height:D.height,breakAfter:D.breakAfter,choice:D.choice,document:D.document})),document:v.document}}},M=b(v.text,v.id,v.label);return i[String(j)]=S?{...M,items:v.parts.map((D,_)=>({seq:w+_,...b(D.text,D.id,D.label)}))}:M,m.type==="MIXED"&&(i[`secContent${j}`]=r.serialize(m.material||Vt())),O});return{...m.referenceData,sectionSeq:p,sectionName:l.title,sectionQuestionType:m.type,questionInfolist:x,...m.type==="MIXED"?{content:r.serialize(m.material||Vt())}:{},extension:{...m.referenceData?.extension||{},uniEditor:{id:l.id,layout:m.layout,material:m.material,document:l.document,optional:m.optional,choose:m.choose,optionalHeight:m.optionalHeight,scoreType:m.scoreType,fillNewLine:m.fillNewLine}}}}),quesTextMap:i}}function Q0(t,r){const i=Array.isArray(t)?t:t.sectionInfoList;if(!Array.isArray(i))throw new Error("缺少 sectionInfoList");const a=new Set,c=l=>{const u=l==null||l===""?crypto.randomUUID():String(l);if(a.has(u))throw new Error(`题目 ID 重复:${u}`);return a.add(u),u};return i.map(l=>{if(!(l.sectionQuestionType in cr)||!Array.isArray(l.questionInfolist))throw new Error("题块类型或 questionInfolist 无效");const u=_m(l.sectionQuestionType),d=l.extension;d?.uniEditor?.id&&(u.id=d.uniEditor.id),u.title=l.sectionName;const{questionInfolist:m,...p}=l,C=[],g=new Map;m.forEach(x=>{if(x.questionPid!==void 0&&x.questionPid!==null&&Be(x.questiontypeCode)){const v=String(x.questionPid);let S=g.get(v);S||(S={...x,questionId:x.questionPid,questionPid:void 0,content:String(x.parentContent||""),items:[],showSeqs:[]},g.set(v,S),C.push(S)),S.items.push(x),S.showSeqs.push(x.showSeq??x.seq??S.items.length)}else C.push(x)}),g.forEach(x=>{x.itemScores=x.items.map(v=>v.score??null),x.score=x.itemScores.some(v=>v===null)?null:x.itemScores.reduce((v,S)=>v+(S||0),0)});const b=C.map((x,v)=>{if(!(x.questiontypeCode in cr)||x.questiontypeCode==="MIXED")throw new Error("子题类型无效");const S=x.questiontypeCode,w=Be(S),T=w?x.items?.length||x.showSeqs?.length||x.childNum||1:["FILLBLANK","SHORTANSWER"].includes(S)&&(x.itemScores?.length||x.itemcount)||1;if(!Number.isInteger(T)||T<1||T>200)throw new Error("子题数量无效");const j=x.score??null,R=Cu(S),O=wu({...R,characters:Number(x.extension?.kong)||R.characters,lines:Number(x.extension?.hang)||R.lines,partCount:T,score:w||["FILLBLANK","SHORTANSWER"].includes(S)?x.itemScores?.[0]??(j===null?null:j/T):j,optionCount:x.itemcount||x.itemsContent?.length||4},Number(x.seq)||v+1);O.id=c(x.questionId??x.id),O.label=String(x.showSeq??x.itemShowNames?.[0]??x.seq??v+1),O.choice.id=O.id,O.choice.label=O.label,O.choice.score=j,O.choice.scoreType=x.scoreType||O.choice.scoreType,O.choice.lessScore=x.lessScore??O.choice.lessScore,O.rightAnswers=x.rightAnswers??O.rightAnswers,O.singleScore=x.singleScore??O.singleScore,O.score=j,O.referenceData=x;const M=x.extension?.uniEditor;M?.choice&&(O.choice={...M.choice,id:O.id,label:O.label,score:j}),O.height=M?.height??O.height,O.contentHeight=M?.contentHeight??O.contentHeight,O.halfPoint=M?.halfPoint??O.halfPoint;const D=(_,I,B,H=!1,z)=>{if(z)return structuredClone(z);const $=wi(S,{...B,id:I},H);return{...$,content:r.parse(_.content||""),itemsContent:!H&&_.itemsContent?_.itemsContent.map((X,G)=>({id:X.id===void 0?B.options[G]?.id||crypto.randomUUID():String(X.id),key:X.key,content:r.parse(X.content||"")})):$.itemsContent}};return O.text=D(x,O.id,O.choice,w,M?.text),O.text.itemsContent.length&&(O.choice.options=O.text.itemsContent.map(_=>({id:_.id,label:_.key}))),O.document=M?.document||wn(O.document,O.label,O.score),O.parts=O.parts.map((_,I)=>{const B=x.items?.[I],H=M?.parts?.[I];return _.id=c(H?.id??B?.questionId??B?.id),_.referenceData=B,_.label=String(B?.showSeq??x.itemShowNames?.[I]??x.showSeqs?.[I]??(w?Number(x.seq||1)+I:T===1?O.label:`${O.label}.${I+1}`)),_.score=B?.score??x.itemScores?.[I]??_.score,_.choice={...H?.choice||_.choice,id:_.id,label:_.label,score:_.score,scoreType:B?.scoreType||x.scoreType||_.choice.scoreType,lessScore:B?.lessScore??x.lessScore??_.choice.lessScore},w&&S!=="TEXT_COMPLETION"&&(_.text=D(B||{itemsContent:x.itemsContent?.map(({key:z,content:$})=>({key:z,content:$}))},_.id,_.choice,!1,H?.text)),_.text?.itemsContent.length&&(_.choice.options=_.text.itemsContent.map(z=>({id:z.id,label:z.key}))),_.document=H?.document||wn(_.document,_.label,_.score),{..._,...H?{width:H.width??_.width,height:H.height??_.height,breakAfter:H.breakAfter??_.breakAfter}:{}}}),O.characters=Number(x.extension?.kong)||O.characters,O.lines=Number(x.extension?.hang)||O.lines,O});return u.reference={...u.reference,textVersion:1,sectionSeq:l.sectionSeq,referenceData:p,questions:b,material:d?.uniEditor?.material||r.parse(l.content||""),...d?.uniEditor?{layout:d.uniEditor.layout||u.reference.layout,optional:!!d.uniEditor.optional,choose:d.uniEditor.choose||1,optionalHeight:d.uniEditor.optionalHeight??200,scoreType:d.uniEditor.scoreType||u.reference.scoreType,fillNewLine:!!d.uniEditor.fillNewLine}:{}},d?.uniEditor?.document&&(u.document=d.uniEditor.document),u.document=vu(u),u})}class wr extends Error{constructor(r,i){super(i),this.code=r}}const Z0=t=>!t.closest("[hidden]")&&t.getClientRects().length>0;function MR(t,r,i){const a=t.getBoundingClientRect(),c=a.width/i.width;if(!t.isConnected||!(c>0))throw new wr("LAYOUT_UNAVAILABLE","请显示题卡后再获取识别坐标");const l=g=>({x:(g.x-a.x)/c,y:(g.y-a.y)/c,width:g.width/c,height:g.height/c}),u=Array.from(t.querySelectorAll(".card-sheet[data-paper-page]")).map(g=>{const b=l(g.getBoundingClientRect()),x=Object.fromEntries(Array.from(g.querySelectorAll("[data-anchor]")).map(j=>[j.dataset.anchor,l(j.getBoundingClientRect())]));if(Object.keys(x).length!==4)throw new wr("MISSING_ANCHORS","缺少纸面定位点,请先完成题卡初始化");const v=x.topLeft,S=j=>Im({...j,x:j.x-b.x,y:j.y-b.y}),w={pageNumber:Number(g.dataset.paperPage),pageSize:{width:Qn(i.width),height:Qn(i.height)},anchorOrigin:{x:Qn(v.x-b.x),y:Qn(v.y-b.y)},anchorSize:{width:26,height:13},panelSize:{width:Qn(x.topRight.x+x.topRight.width-v.x),height:Qn(x.bottomRight.y+x.bottomRight.height-v.y)},anchors:{topLeft:S(x.topLeft),topRight:S(x.topRight),bottomLeft:S(x.bottomLeft),bottomRight:S(x.bottomRight)},regions:[]};for(const j of Object.values(x))if(j.x<b.x-.1||j.y<b.y-.1||j.x+j.width>b.x+b.width+.1||j.y+j.height>b.y+b.height+.1)throw new wr("MARK_OUTSIDE_PAPER","定位点超出纸面,请调整边距");const T=Array.from(g.querySelectorAll("[data-anchor], .card-code-marks, .card-exam-qr, .card-paper-footer > span")).map(j=>l(j.getBoundingClientRect()));return T.forEach((j,R)=>T.slice(R+1).forEach(O=>{const M=km(j,O);if(M&&M.width>.3&&M.height>.3)throw new wr("OVERLAPPING_PAPER_MARKS","纸面识别标记与页码重叠,请调整边距或版式")})),{data:w,paper:b,toPaper:S}});if(u.length>Qs)throw new wr("PAPER_PAGE_LIMIT","题卡仅支持一张纸,请调整内容或版式");const d=new Map;r.blocks.forEach(g=>{g.reference?.questions.forEach(b=>{const x={blockId:g.id,questionId:b.id,answerId:b.id};d.set(b.id,x),b.choice.options.forEach(v=>d.set(v.id,x)),b.parts.forEach(v=>{const S={...x,partId:v.id,answerId:v.id};d.set(v.id,S),v.choice.options.forEach(w=>d.set(w.id,S))})}),g.choices?.questions.forEach(b=>{const x={blockId:g.id,questionId:b.id,answerId:b.id};d.set(b.id,x),b.options.forEach(v=>d.set(v.id,x))})});const m=new Map,p=(g,b,x)=>{if(![g.x,g.y,g.width,g.height].every(Number.isFinite)||g.width<=0||g.height<=0)throw new wr("INVALID_RECOGNITION_RECT","识别区域尺寸无效,请检查内容是否已完成布局");const v=u.flatMap(M=>{const D=km(g,M.paper);return D?[{page:M,rect:D}]:[]}),S=v.reduce((M,D)=>M+D.rect.width*D.rect.height,0);if(!v.length||g.width*g.height-S>Math.max(g.width,g.height)*.2||v.length!==1)throw new wr("REGION_OUTSIDE_PAPER","识别区域超出纸面,请调整内容或版式");const{page:w}=v[0],T=`${w.data.pageNumber}/${x}`,j=m.get(T)||0;m.set(T,j+1);const R=Array.from({length:i.columns},(M,D)=>D).find(M=>g.x>=i.columnX(w.data.pageNumber-1,M)-1&&g.x<i.columnX(w.data.pageNumber-1,M)+i.columnWidth+1),O={...b,id:`${T}/${j}`,rect:w.toPaper(g),...R!==void 0?{columnNumber:R+1}:{}};return w.data.regions.push(O),O},C=(g,b)=>{const x=g.closest("[data-exercise-item], [data-exercise-id], [data-question-id]"),v=x?.dataset.exerciseItem||x?.dataset.exerciseId||x?.dataset.questionId;return{blockId:g.closest("[data-block-id]")?.dataset.blockId,...d.get(b||"")||d.get(v||"")}};return t.querySelectorAll("[data-recognition]").forEach(g=>{if(!Z0(g))return;const b=g.dataset.recognition,x=g.dataset.answerId,v=C(g,g.dataset.optionId||x),S=g.dataset.recognitionRole||"region",w={...v,sectionType:b,role:S,...g.dataset.recognitionScope==="section"?{scope:"section"}:{},...x?{answerId:x}:{},...g.dataset.optionId?{optionId:g.dataset.optionId}:{},...g.dataset.value!==void 0?{value:g.dataset.value}:{},...g.dataset.questionIds?{questionIds:g.dataset.questionIds.split(",")}:{}},T=`${b}/${v.blockId||"paper"}/${x||""}/${g.dataset.optionId||""}/${S}/${g.dataset.value||""}/${g.dataset.fragment||""}`,j=p(l(g.getBoundingClientRect()),w,T);g.querySelectorAll("[data-recognition-cell]").forEach(R=>{R.closest("[data-recognition]")!==g||!Z0(R)||p(l(R.getBoundingClientRect()),{...w,role:"cell",parentId:j.id,value:R.dataset.recognitionCell},`${T}/cell/${R.dataset.recognitionCell}`)})}),CR(t).forEach(({element:g,region:b,rect:x})=>{const v=b.id||`position-${b.pos}`,S=C(g,v),w=b.type==="choiceOption"||b.type==="choiceMarker",T=w?"MultiChoice":"Checkbox";p(l(x),{...S,sectionType:T,role:b.type==="answerLine"?"line":"cell",answerId:d.get(v)?.answerId||v,...w?{optionId:v}:{},...b.attrs.label?{value:String(b.attrs.label)}:{}},`editor/${S.blockId||"paper"}/${v}/${b.pos}`)}),u.forEach(({data:g})=>{const b=new Map;g.regions.filter(x=>x.sectionType==="MultiChoice"&&x.role==="cell").forEach(x=>{const v=`${x.blockId||""}/${x.answerId||""}/${x.columnNumber||""}`,S=b.get(v)||[];S.push(x),b.set(v,S)}),b.forEach((x,v)=>{const S=x[0],w=Math.min(...x.map(M=>M.rect.x)),T=Math.min(...x.map(M=>M.rect.y)),j=Math.max(...x.map(M=>M.rect.x+M.rect.width)),R=Math.max(...x.map(M=>M.rect.y+M.rect.height)),O=`${g.pageNumber}/MultiChoice/group/${v}`;g.regions.push({id:O,sectionType:"MultiChoice",role:"region",blockId:S.blockId,questionId:S.questionId,partId:S.partId,answerId:S.answerId,columnNumber:S.columnNumber,rect:Im({x:w,y:T,width:j-w,height:R-T})}),x.forEach(M=>{M.parentId=O})}),g.regions.filter(x=>!x.parentId&&x.scope!=="section").forEach(x=>{const v=g.regions.filter(S=>S!==x&&S.role==="region"&&(x.role!=="region"||S.scope==="section")&&(S.blockId===x.blockId||S.questionIds?.includes(x.questionId||""))&&(S.answerId===x.answerId||S.questionIds?.includes(x.questionId||"")||S.questionId&&S.questionId===x.questionId&&!S.partId)&&x.rect.x>=S.rect.x-.1&&x.rect.y>=S.rect.y-.1&&x.rect.x+x.rect.width<=S.rect.x+S.rect.width+.1&&x.rect.y+x.rect.height<=S.rect.y+S.rect.height+.1).sort((S,w)=>S.rect.width*S.rect.height-w.rect.width*w.rect.height)[0];v&&(x.parentId=v.id)})}),{version:2,unit:"px",dpi:96,origin:"topLeftPaper",singlePagePartition:i.columns,pages:u.map(g=>g.data)}}function _R({uploadImage:t,editorPlugin:r,initialValue:i,onSave:a,dictionaries:c}){const l=E.useMemo(()=>su(c),[c]),u=r.html,[d,m]=E.useState(i||Am),p=E.useCallback(ce=>m(Re=>{let ve=typeof ce=="function"?ce(Re):ce;ve.blocks.some(Oe=>Oe.exercise&&!Oe.reference)&&(ve={...ve,blocks:ve.blocks.map(wR)}),ve={...ve,blocks:ve.blocks.map(Oe=>{const en=Re.blocks.find(Tr=>Tr.id===Oe.id);if(Oe.reference?.textVersion===1)return TS(Oe,en,!!ve.questionCard);if(!Oe.reference||en?.reference===Oe.reference)return Oe;let hn=en?.reference?AR(Oe.document,en.reference,Oe.reference):Oe.document;if(hn.content.content?.length===1&&hn.content.content[0].type==="paragraph"&&!hn.content.content[0].content?.length&&!hn.content.content[0].attrs?.contentId&&Oe.reference.questions.length){const Tr=Oe.reference.questions[0],rr=Oe.reference.type==="MIXED"?Oe.id:Tr.id;hn={...hn,content:{...hn.content,content:[F0(hn.content.content[0],rr)]}}}const Qi=Tr=>JSON.stringify(Tr.reference?.questions.flatMap(rr=>[rr.choice,...rr.parts.map(sf=>sf.choice)]).map(rr=>[rr.id,rr.contentTarget])),_a=!en||Qi(en)!==Qi(Oe)?jR({...Oe,document:hn}):hn;return _a===Oe.document?Oe:{...Oe,document:_a}})};const et=ve.blocks.filter(Oe=>Oe.reference).map(Oe=>ha(Oe.reference));return(ve.mergeObjective?[et.flat()]:et).some(Oe=>new Set(Oe.map(en=>en.options.length)).size>1)&&ve.choiceDirection!=="column"?{...ve,choiceDirection:"column"}:ve}),[]),[C,g]=E.useState(""),[b,x]=E.useState(!i),[v,S]=E.useState(null),[w,T]=E.useState(null),[j,R]=E.useState(null),[O,M]=E.useState(null),[D,_]=E.useState(!1),[I,B]=E.useState(!0),[H,z]=E.useState({}),$=ce=>{const Re=ce.reference?el(ce.reference):ce.exercise?.items||ce.choices?.questions;return Re?.find(ve=>ve.id===H[ce.id])?.id||Re?.[0]?.id},X=(ce,Re)=>z(ve=>ve[ce]===Re?ve:{...ve,[ce]:Re}),G=ce=>{S(ce),ce===null&&T(null),ce&&R(Re=>Re===null?null:ce)},[te,V]=E.useState({}),[Y,L]=E.useState(),[P,N]=E.useState(!1),U=ce=>{ce&&T(null),N(ce)},[J,Q]=E.useState(null),le=E.useRef(new Map),re=E.useRef(null),ae=E.useCallback((ce,Re)=>{Re?le.current.set(ce,Re):le.current.delete(ce)},[]),{scale:ge,setScale:je}=Uo(),ye=ge/100,de=E.useMemo(()=>ER(d,w),[d,w]),Me=JSON.stringify([d.usage,d.preset,d.margin,d.gap,d.header,d.recognition,d.paperTitle?.id,d.paperTitle?.height,de.map(ce=>[ce.id,ce.answerHeight])]),{geometry:De,placements:we,pageCount:xe}=E.useMemo(()=>SS({...d,blocks:de},te,Y),[Me,te,Y]),Se=d.paperTitle?.id===Y?.id&&Y?.overflowing,Bt=xe*De.height+(xe-1)*Oo,ht=we.filter(ce=>ce.overflowFrom!==void 0),he=new Map(we.map(ce=>[ce.id,ce])),at=he.get(nr);at&&d.blocks.forEach(ce=>{he.has(ce.id)||he.set(ce.id,at)});const it=new Set(de.find(ce=>ce.id===nr)?.reference?.questions.map(ce=>ce.id)),Mt=new Map;d.blocks.forEach(ce=>{const Re=he.get(ce.id);Re?.overflowFrom!==void 0?Mt.set(ce.id,Re):at?.overflowFrom!==void 0&&ce.reference?.questions.some(ve=>it.has(ve.id))&&Mt.set(ce.id,at)});const $n=()=>{const ce=document.getElementById("answer-sheet-stadio");ce&&je(Math.max(20,Math.min(100,Math.floor((ce.clientWidth-96)/De.width*100))))};E.useEffect(()=>{$n()},[d.preset]);const to=(ce,Re)=>p(ve=>({...ve,blocks:ve.blocks.map(et=>et.id===ce?{...et,...Re}:et)})),Go=(ce,Re)=>p(ve=>{const et=[...ve.blocks],Ft=et.findIndex(en=>en.id===ce);if(Ft<0||Re<0||Re>=et.length||Ft===Re)return ve;const[Oe]=et.splice(Ft,1);return et.splice(Re,0,Oe),{...ve,blocks:et}}),Er=(ce,Re=!1)=>{if(G(ce),!Re)return;if(Mt.has(ce)){R(null),_(!1),M(ce);return}const ve=document.getElementById("answer-sheet-stadio"),et=Array.from(document.querySelectorAll("[data-block-id]")),Ft=et.find(Oe=>Oe.dataset.blockId===ce&&!Oe.hidden)||et.find(Oe=>Oe.dataset.blockId===nr);if(ve&&Ft){const Oe=Ft.getBoundingClientRect(),en=ve.getBoundingClientRect();ve.scrollTo({left:Math.max(0,ve.scrollLeft+Oe.left-en.left-40),top:Math.max(0,ve.scrollTop+Oe.top-en.top-90),behavior:"smooth"})}},Gn=()=>NR(d.blocks,u),At=()=>{if(!re.current)throw new Error("题卡尚未完成渲染");if(ht.length)throw new wr("CONTENT_OVERFLOW","内容超出一张纸,请调整未排入纸张的题块后再保存");return MR(re.current,d,De)},Rn=ce=>{const Re=Q0(ce,u);p(ve=>({...ve,blocks:Re})),G(null),R(null),z({})},Ht=()=>{if(a){a();return}let ce;try{ce=At()}catch(et){g(et instanceof Error?et.message:"识别坐标生成失败");return}const Re=URL.createObjectURL(new Blob([JSON.stringify({...d,...Gn(),recognitionData:ce},null,2)],{type:"application/json"})),ve=document.createElement("a");ve.href=Re,ve.download=`${d.title||"答题卡"}.json`,ve.click(),setTimeout(()=>URL.revokeObjectURL(Re),1e3)},Ki=(ce,Re=!0)=>{P||(M(null),G(ce),R(ce),B(Re))},_e=(ce,Re=!1)=>{G(ce),R(null),_(Re),M(ce)};return{card:d,paperRoot:re,creationDictionary:l,saveMessage:C,setSaveMessage:g,saveAction:a?"保存":"导出",editors:le,measurements:te,titleMeasurement:Y,paperBlocks:de,setCard:p,uploadImage:t,setQuestionCard:ce=>{T(null),p(Re=>({...Re,questionCard:ce,blocks:Re.blocks.filter(ve=>ve.areaType!==(ce?"forbiden":"editArea"))}))},editQuestion:(ce,Re)=>{if(Mt.has(ce)){_e(ce,!0);return}G(ce),T(ce),R(null);const ve=d.blocks.find(Ft=>Ft.id===ce),et=Re||ve&&$(ve);ve?.reference?.textVersion===1&&Cn(ve.document)&&to(ce,{document:vu(ve)}),requestAnimationFrame(()=>{const Ft=le.current.get(`content/${et}`)||le.current.get(ce);(!et||!Ft?.focusContent(et))&&Ft?.focus("start")})},finishQuestionEditing:()=>T(null),insertMaterialBlank:(ce,Re,ve,et)=>{G(ce),T(ce),requestAnimationFrame(()=>le.current.get(ce)?.insertAnswerRegion(Re,ve,et))},editingQuestionId:w,registerEditor:ae,creationOpen:b,setCreationOpen:x,newCard:ce=>{p(bu(ce)),G(null),R(null),M(null),Q(null),V({}),L(void 0),z({}),U(!1),x(!1)},selectedId:v,setSelectedId:G,selectedChoiceId:$,selectChoice:X,settingsId:j,setSettingsId:R,settingsAutoFocus:I,openSettings:Ki,draftBlockId:O,setDraftBlockId:M,draftQuestionMode:D,openDraft:_e,setMeasurements:V,setTitleMeasurement:L,titleOverflow:Se,readOnly:P,setReadOnly:U,deleted:J,setDeleted:Q,scale:ye,geometry:De,placements:we,pageCount:xe,totalHeight:Bt,overflow:ht,overflowById:Mt,placementById:he,fitPage:$n,updateBlock:to,moveBlock:Go,selectBlock:Er,download:Ht,getReferenceData:Gn,getRecognitionData:At,setReferenceData:Rn}}const tf=E.createContext(null);function DR({children:t}){const r=ct(),i=E.useCallback((a,c)=>r.registerEditor(`draft/${a}`,c),[r.registerEditor]);return f.jsx(tf.Provider,{value:{...r,scale:1,card:{...r.card,mergeObjective:!1},registerEditor:i},children:t})}function IR({children:t,...r}){return f.jsx(Y0.Provider,{value:r.editorPlugin,children:f.jsx(tf.Provider,{value:_R(r),children:t})})}function ct(){const t=E.useContext(tf);if(!t)throw new Error("制卡内容需要 CardProvider");return t}const kR={undo:"M9 5 4 10l5 5M4 10h10a6 6 0 0 1 0 12",redo:"m15 5 5 5-5 5m5-5H10a6 6 0 0 0 0 12",image:"M4 4h16v16H4zM4 16l5-5 4 4 3-3 4 4M16 8h.01",table:"M4 4h16v16H4zM4 10h16M10 4v16M4 15h16",check:"m5 12 4 4L19 6",back:"m14 5-7 7 7 7",close:"m6 6 12 12M6 18 18 6",upload:"M12 16V3m-4 4 4-4 4 4M5 13v7h14v-7",download:"M12 3v13m-4-4 4 4 4-4M5 17v4h14v-4",settings:"M4 7h16M4 17h16M8 4v6m8 4v6",chevronUp:"m7 14 5-5 5 5",answerLine:"M4 17h16M5 10h2m4 0h2m4 0h2",alignLeft:"M4 5h16M4 10h10M4 15h16M4 20h10",alignCenter:"M4 5h16M7 10h10M4 15h16M7 20h10",alignRight:"M4 5h16M10 10h10M4 15h16M10 20h10",alignJustify:"M4 5h16M4 10h16M4 15h16M4 20h16",document:"M6 3h8l4 4v14H6zM14 3v5h4M9 12h6m-6 4h6",trash:"M4 6h16M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",listOrdered:"M10 6h10M10 12h10M10 18h10M3 4h1v5M3 9h2M3 15a1.5 1.5 0 0 1 3 0c0 1-3 3-3 4h3"};function eo({name:t,size:r=18}){return f.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:kR[t]})})}function ql(t){const[r,i]=E.useState(null),a=E.useRef(t);a.current=t;const c=E.useRef(null),l=(C,g)=>{if(!r)return;const b=r.getBoundingClientRect();r.style.left=`${Math.max(8,Math.min(window.innerWidth-b.width-8,C))}px`,r.style.top=`${Math.max(8,Math.min(window.innerHeight-b.height-8,g))}px`},u=()=>{if(!r)return;const C=r.getBoundingClientRect(),g=a.current?.(r)||{left:(window.innerWidth-C.width)/2,top:(window.innerHeight-C.height)/2};l(g.left,g.top)},d=()=>{const C=c.current;c.current=null,r&&delete r.dataset.dragging,C?.target.hasPointerCapture(C.pointerId)&&C.target.releasePointerCapture(C.pointerId)},m=()=>c.current?(l(c.current.left,c.current.top),d(),!0):!1;return E.useLayoutEffect(()=>{if(!r)return;u();const C=()=>{const b=r.getBoundingClientRect();l(b.left,b.top)},g=new ResizeObserver(C);return g.observe(r),window.addEventListener("resize",C),document.addEventListener("fullscreenchange",C),window.addEventListener("blur",m),()=>{d(),g.disconnect(),window.removeEventListener("resize",C),document.removeEventListener("fullscreenchange",C),window.removeEventListener("blur",m)}},[r]),{dialog:r,setDialog:i,titleProps:{role:"button",tabIndex:0,onPointerDown:C=>{if(C.button!==0||!C.isPrimary||!r)return;C.preventDefault(),C.stopPropagation(),C.currentTarget.focus({preventScroll:!0});const{left:g,top:b}=r.getBoundingClientRect();c.current={x:C.clientX,y:C.clientY,left:g,top:b,target:C.currentTarget,pointerId:C.pointerId},r.dataset.dragging="true",C.currentTarget.setPointerCapture(C.pointerId)},onPointerMove:C=>{const g=c.current;g?.pointerId===C.pointerId&&l(g.left+C.clientX-g.x,g.top+C.clientY-g.y)},onPointerUp:d,onPointerCancel:m,onLostPointerCapture:d,onKeyDown:C=>{if(C.key==="Escape"&&m()&&(C.preventDefault(),C.stopPropagation()),C.key==="Home"&&(C.preventDefault(),C.stopPropagation(),u()),!r||!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(C.key))return;C.preventDefault(),C.stopPropagation();const g=C.shiftKey?50:10,b=r.getBoundingClientRect();l(b.left+(C.key==="ArrowRight"?g:C.key==="ArrowLeft"?-g:0),b.top+(C.key==="ArrowDown"?g:C.key==="ArrowUp"?-g:0))}},cancelDrag:m}}function LR({creation:t,questionCard:r,onAdd:i,onClose:a}){const[c,l]=E.useState(null),u=Om(t),d=r?"editArea":"forbiden",m=[...u,d],p={...cr,forbiden:"禁止答题区",editArea:"空白答题区"},C=E.useId(),{dialog:g,setDialog:b,titleProps:x,cancelDrag:v}=ql();E.useLayoutEffect(()=>{g?.setAttribute("aria-labelledby",C)},[g,C]);const S=f.jsx("div",{...x,className:"card-modal-drag","aria-label":"拖动添加题块",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:C,children:"添加题块"})});return f.jsxs(Vi,{open:!0,panelRef:b,width:460,zIndex:910,className:"card-modal card-add-block-modal",title:S,closeLabel:"关闭添加题块",closeIcon:f.jsx(eo,{name:"close",size:16}),onCancel:a,onEscapeKeyDown:w=>{v()&&(w.preventDefault(),w.stopPropagation())},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ue,{onClick:a,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!c||!m.includes(c),onClick:()=>{c&&m.includes(c)&&i(c)},children:"添加"})]}),children:[f.jsx("div",{className:"card-question-types",role:"group","aria-label":"选择题型",children:u.map(w=>f.jsx(ue,{"aria-pressed":c===w,onClick:()=>l(w),children:p[w]},w))}),f.jsx("div",{className:"card-question-types card-area-types",role:"group","aria-label":"纸面区域",children:f.jsx(ue,{"aria-pressed":c===d,onClick:()=>l(d),children:p[d]})})]})}function Yl({label:t,value:r,min:i,max:a,onChange:c}){const[l,u]=E.useState();return f.jsx(Na,{className:"ui-control ui-number","aria-label":t,min:i,max:a,precision:0,value:l===void 0?r:l,onChange:d=>{u(d),d!==null&&d>=i&&d<=a&&d!==r&&c(d)},onBlur:()=>{if(l!==void 0){const d=Math.max(i,Math.min(a,l??i));d!==r&&c(d),u(void 0)}}})}function Yi({label:t,value:r,min:i=.5,max:a=15,placeholder:c,onChange:l}){const[u,d]=E.useState(),m=u==null||Kn(u)&&u>=i&&u<=a;return f.jsx(Na,{className:"ui-control ui-number","aria-label":t,value:u===void 0?r:u,min:i,max:a,step:.5,placeholder:c,status:m?void 0:"error",onChange:p=>{d(p),(p===null||Kn(p)&&p>=i&&p<=a)&&l(p)},onBlur:()=>d(void 0)})}function zR({value:t,creation:r,onChange:i}){const[a,c]=E.useState("all"),[l,u]=E.useState([]),[d,m]=E.useState("settings"),[p,C]=E.useState("keep"),[g,b]=E.useState(null),[x,v]=E.useState(null),[S,w]=E.useState("keep"),[T,j]=E.useState(null),[R,O]=E.useState(1),[M,D]=E.useState(null),[_,I]=E.useState(""),[B,H]=E.useState(""),z=t.questions.filter(X=>a==="all"||l.includes(X.id)).map(X=>X.id),$=()=>{const X={};p!=="keep"&&(X.kind=p),g!==null&&(X.optionCount=g),x!==null&&(X.score=x),S!=="keep"&&(X.scoreType=S),T!==null&&S!=="ITEM_SCORE"&&(X.lessScore=T);let G;d==="settings"?G={type:d,patch:X}:d==="numbering"?G={type:d,start:R}:d==="average"?G={type:d,total:M??0}:G={type:d,text:_};const te=iS(t,z,G,r);H(te.error||""),te.value&&i(te.value)};return f.jsxs("details",{className:"card-choice-batch",children:[f.jsx("summary",{children:"批量设置"}),f.jsxs("div",{className:"card-choice-batch-fields",children:[f.jsxs("label",{className:"card-field",children:["范围",f.jsxs(Wt,{"aria-label":"批量修改范围",value:a,onChange:c,children:[f.jsx("option",{value:"all",children:"全部题目"}),f.jsx("option",{value:"selected",children:"指定题目"})]})]}),f.jsxs("label",{className:"card-field",children:["操作",f.jsxs(Wt,{"aria-label":"选择题批量操作",value:d,onChange:X=>{m(X),H("")},children:[f.jsx("option",{value:"settings",children:"修改属性"}),f.jsx("option",{value:"numbering",children:"连续题号"}),f.jsx("option",{value:"average",children:"平均分配总分"}),f.jsx("option",{value:"answers",children:"录入答案"})]})]}),a==="selected"&&f.jsx("div",{className:"card-choice-batch-selection",role:"group","aria-label":"选择批量修改题目",children:t.questions.map(X=>f.jsxs(zt,{checked:z.includes(X.id),onChange:G=>u(te=>G.target.checked?[...te,X.id]:te.filter(V=>V!==X.id)),children:["第 ",X.label," 题"]},X.id))}),d==="settings"&&f.jsxs("div",{className:"card-choice-batch-properties",children:[f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Wt,{"aria-label":"批量选择题类型",value:p,onChange:C,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(Na,{className:"ui-control ui-number","aria-label":"批量选项个数",placeholder:"保持不变",min:2,max:Sn.options,precision:0,value:g,onChange:b})]}),f.jsxs("label",{className:"card-field",children:["每题分值",f.jsx(Yi,{label:"批量每题分值",value:x,placeholder:"保持不变",onChange:v})]}),f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Wt,{"aria-label":"批量少选计分",value:S,onChange:w,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),S!=="ITEM_SCORE"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Yi,{label:"批量少选得分",min:0,value:T,placeholder:"保持不变",onChange:j})]})]}),d==="numbering"&&f.jsxs("label",{className:"card-field",children:["起始题号",f.jsx(Yl,{label:"批量起始题号",min:1,max:1e3,value:R,onChange:O})]}),d==="average"&&f.jsxs("label",{className:"card-field",children:["所选题目总分",f.jsx(Yi,{label:"平均分配总分",max:Sn.score*z.length,value:M,onChange:D})]}),d==="answers"&&f.jsxs("label",{className:"card-field card-choice-batch-answers",children:["按题目顺序录入",f.jsx(Pl,{"aria-label":"批量选择题答案",value:_,rows:3,placeholder:"每题一组,如 A BC D;- 表示清空",onChange:X=>I(X.target.value)})]}),B&&f.jsx("div",{className:"card-choice-error",role:"alert",children:B}),f.jsxs(ue,{className:"card-choice-batch-apply",type:"primary",disabled:!z.length,onClick:$,children:["应用到 ",z.length," 题"]})]})]})}function W0({value:t,document:r,creation:i,selectedId:a,onSelect:c,onChange:l,singleQuestion:u=!1}){const[d,m]=E.useState([]),[p,C]=E.useState([]),g=t.questions.find(z=>z.id===a)||t.questions[0],b=t.questions.indexOf(g),x=pu(t),v=fu(t),S=Ys(r),w=new Set(t.questions.map(z=>z.options.length)).size>1,T=()=>({value:t,selectedId:g?.id}),j=(z,$=g?.id)=>{m(G=>[...G.slice(-49),T()]),C([]),l({...z,source:"manual"});const X=z.questions.find(G=>G.id===$)||z.questions[Math.max(0,Math.min(b,z.questions.length-1))];X&&c(X.id)},R=z=>{l(z.value),z.selectedId&&c(z.selectedId)},O=z=>j({...t,questions:t.questions.map($=>$.id===g.id?{...$,...z}:$)}),M=z=>O(lu(g,z,i)),D=z=>{const $=[...t.questions];$.splice(b,1),$.splice(b+z,0,g),j({...t,questions:$})},_=(z=!1)=>{const $=z&&g?aS(g,uu(t.questions)):{...ca(0),label:uu(t.questions)},X=[...t.questions];X.splice(b+1,0,$),j({...t,questions:X},$.id)},I=t.questions.reduce((z,$)=>z+($.score??0),0),B=t.questions.filter(z=>typeof z.score!="number").length,H=g&&(Sm(t.questions,g.id,g.label)||cu(g));return f.jsxs("div",{className:"card-choice-settings","aria-label":"选择题设置",children:[u&&f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Wt,{"aria-label":"选择题填涂位置",value:v,onChange:z=>j(hu(t,r,z)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),!u&&f.jsxs("div",{children:[f.jsxs("div",{className:"card-choice-summary","aria-label":"选择题配置概况",children:[t.questions.length," 题 · ",B===t.questions.length?"未设分":`${I} 分${B?` · ${B} 题未设分`:""}`]}),f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Wt,{"aria-label":"选择题填涂位置",value:v,onChange:z=>j(hu(t,r,z)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),f.jsxs("label",{className:"card-field",children:["题目数量",f.jsx(Yl,{label:"选择题数量",min:1,max:Sn.questions,value:t.questions.length,onChange:z=>{const $=t.questions.slice(0,z);for(;$.length<z;)$.push({...ca(0),label:uu($)});j({...t,questions:$})}})]}),f.jsxs("div",{className:"card-choice-layout-fields",children:[f.jsxs("label",{className:"card-field",children:["题目排列方向",f.jsxs(Wt,{"aria-label":"填涂排列方向",value:x,onChange:z=>j({...t,direction:z}),children:[f.jsx("option",{value:"row",disabled:w,children:"横排(先右后下)"}),f.jsx("option",{value:"column",children:w?"竖排(选项数不同)":"竖排(先下后右)"})]})]}),x==="column"&&f.jsxs("label",{className:"card-field",children:["每列题数",f.jsx(Yl,{label:"每列题数",min:1,max:5,value:t.rowsPerColumn,onChange:z=>j({...t,rowsPerColumn:z})})]})]})]}),g&&f.jsxs("div",{className:"card-choice-question-settings",children:[!u&&f.jsxs("label",{className:"card-field",children:["当前题目",f.jsx(Wt,{"aria-label":"当前选择题",value:g.id,onChange:c,children:t.questions.map(z=>f.jsxs("option",{value:z.id,children:["第 ",z.label," 题"]},z.id))})]}),v!=="concentrated"&&f.jsxs("label",{className:"card-field",children:["对应正文选项",f.jsxs(Wt,{"aria-label":"填涂对应正文选项",value:S.some(z=>z.id===g.contentTarget?.groupId)?g.contentTarget.groupId:"",onChange:z=>{const $=S.find(X=>X.id===z);O({contentTarget:$?{groupId:$.id,optionIds:$.options.map(X=>X.id)}:null})},children:[f.jsx("option",{value:"",children:"未指定(集中显示)"}),S.map((z,$)=>f.jsxs("option",{value:z.id,disabled:t.questions.some(X=>X.id!==g.id&&X.contentTarget?.groupId===z.id),children:["第 ",z.label||$+1," 组选项(",z.options.length," 项)"]},z.id))]})]}),!u&&f.jsxs("label",{className:"card-field",children:["题号",f.jsx(Oa,{"aria-label":"选择题题号",value:g.label,maxLength:12,onChange:z=>O({label:z.target.value})})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(Yl,{label:"选择题选项个数",min:2,max:Math.max(Sn.options,g.options.length),value:g.options.length,onChange:z=>M({optionCount:z})})]}),f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Wt,{"aria-label":"选择题类型",value:nS(g),onChange:z=>M({kind:z}),children:[f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),!u&&f.jsxs("label",{className:"card-field",children:["本题分值",f.jsx(Yi,{label:"选择题分值",value:g.score??null,placeholder:"未设置",onChange:z=>M({score:z})})]}),g.multiple&&f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Wt,{"aria-label":"选择题少选计分",value:g.scoreType||"LESS_SCORE",onChange:z=>M({scoreType:z,lessScore:0}),children:[f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),g.multiple&&g.scoreType!=="ITEM_SCORE"&&typeof g.score=="number"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Yi,{label:"选择题少选得分",min:0,max:g.score,value:g.lessScore??0,onChange:z=>M({lessScore:z??0})})]}),f.jsxs("div",{className:"card-answer-key",role:"group","aria-label":"正确答案设置",children:[f.jsx("span",{children:"正确答案"}),f.jsx("div",{children:g.options.map(z=>f.jsx(ue,{type:"text","aria-label":`正确答案 ${z.label}`,"aria-pressed":g.correctIds.includes(z.id),onClick:()=>O({correctIds:g.correctIds.includes(z.id)?g.correctIds.filter($=>$!==z.id):g.multiple?[...g.correctIds,z.id]:[z.id]}),children:z.label},z.id))})]}),g.multiple&&g.scoreType==="ITEM_SCORE"&&f.jsxs("div",{className:"card-choice-rule","aria-label":"选项得分说明",children:["每项 ",oS(g)??"—"," 分 · 错选、不选 0 分"]}),H&&f.jsx("div",{className:"card-choice-error",role:"alert",children:H}),!u&&f.jsx(zt,{className:"card-choice-break",checked:g.breakBefore,onChange:z=>O({breakBefore:z.target.checked}),children:"此题前换行"}),!u&&f.jsxs("div",{className:"card-choice-actions",role:"group","aria-label":"选择题操作",children:[f.jsx(ue,{type:"text","aria-label":"新增选择题",title:"在当前题后新增",disabled:t.questions.length>=Sn.questions,onClick:()=>_(),children:"新增"}),f.jsx(ue,{type:"text","aria-label":"复制选择题配置",title:"复制当前题的填涂与计分配置,放在其后",disabled:t.questions.length>=Sn.questions,onClick:()=>_(!0),children:"复制"}),f.jsx(ue,{type:"text","aria-label":"上移选择题",disabled:b<=0,onClick:()=>D(-1),children:"上移"}),f.jsx(ue,{type:"text","aria-label":"下移选择题",disabled:b>=t.questions.length-1,onClick:()=>D(1),children:"下移"}),f.jsx(ue,{type:"text",danger:!0,"aria-label":"删除当前选择题",disabled:t.questions.length<=1,onClick:()=>{const z=t.questions.filter($=>$.id!==g.id);j({...t,questions:z},z[Math.min(b,z.length-1)]?.id)},children:"删除"})]})]},g.id),!g&&f.jsx(ue,{className:"card-choice-actions",onClick:()=>_(),children:"新增选择题"}),!u&&f.jsx(zR,{value:t,creation:i,onChange:j}),!u&&(d.length>0||p.length>0)&&f.jsxs("div",{className:"card-choice-history",children:[f.jsx(ue,{type:"text",className:"card-choice-undo",disabled:!d.length,onClick:()=>{const z=d.at(-1);m(d.slice(0,-1)),C($=>[...$,T()]),R(z)},children:"撤销选择题设置"}),f.jsx(ue,{type:"text",disabled:!p.length,onClick:()=>{const z=p.at(-1);C(p.slice(0,-1)),m($=>[...$,T()]),R(z)},children:"重做"})]})]})}function Jt({label:t,children:r}){return f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:t}),r]})}function ft({label:t,value:r,min:i=0,max:a=200,step:c=1,onChange:l}){return f.jsx(Jt,{label:t,children:f.jsx(Na,{"aria-label":t,value:r,min:i,max:a,step:c,precision:c===1?0:1,onChange:u=>{u!==null&&Number.isFinite(u)&&l(Math.max(i,Math.min(a,Math.round(u/c)*c)))}})})}function rn({label:t,value:r,min:i=.5,max:a=70,onChange:c}){return f.jsx(Jt,{label:t,children:f.jsx(Na,{"aria-label":t,placeholder:"未设置",min:i,max:a,step:.5,precision:1,value:r,onChange:l=>c(l===null?null:Math.max(i,Math.min(a,Math.round(l*2)/2)))})})}function dn({label:t,value:r,onChange:i,maxLength:a=200}){return f.jsx(Jt,{label:t,children:f.jsx(Oa,{"aria-label":t,value:r,maxLength:a,onChange:c=>i(c.target.value)})})}function ot({label:t,value:r,options:i,onChange:a}){return f.jsx(Jt,{label:t,children:f.jsx(Wt,{"aria-label":t,value:r,onChange:a,children:Object.entries(i).map(([c,l])=>f.jsx("option",{value:c,children:l},c))})})}function Xl({index:t,count:r,onAdd:i,onCopy:a,onDelete:c,onMove:l,name:u="小题",maximum:d=200}){return f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small","aria-label":`新增${u}`,disabled:r>=d,onClick:i,children:"新增"}),f.jsx(ue,{size:"small","aria-label":`复制当前${u}`,disabled:t<0||r>=d,onClick:a,children:"复制"}),f.jsx(ue,{size:"small","aria-label":`上移当前${u}`,disabled:t<=0,onClick:()=>l(-1),children:"↑"}),f.jsx(ue,{size:"small","aria-label":`下移当前${u}`,disabled:t<0||t>=r-1,onClick:()=>l(1),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除当前${u}`,disabled:t<0,onClick:c,children:"删除"})]})}function Xi({value:t,onEditor:r,...i}){const a=E.useRef(null),c=E.useCallback(u=>{a.current=u,r?.(u)},[r]),l=E.useRef(JSON.stringify(t));return E.useEffect(()=>{const u=JSON.stringify(t);u!==l.current&&(l.current=u,a.current&&JSON.stringify(a.current.getDocument())!==u&&a.current.syncDocument(t))},[t]),f.jsx(Vl,{ref:c,initialValue:t,...i})}function J0({value:t,onChange:r,drawing:i=!1}){const{uploadImage:a}=ct(),c=E.useRef(null),[l,u]=E.useState(!1),[d,m]=E.useState(""),p=E.useRef(!0),C=E.useRef({value:t,onChange:r});C.current={value:t,onChange:r},E.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const g=b=>r({...t,...b});return f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"作答区样式",value:t.style,options:{blank:"空白",lines:"横线",grid:"方格纸",characters:"作文格","four-lines":"四线三格",coordinates:"坐标网格"},onChange:b=>g({style:b})}),f.jsx(ft,{label:"作答行数",value:t.rows,min:0,max:120,onChange:b=>g({rows:b})}),f.jsx(ft,{label:"作答行高",value:t.rowHeight,min:16,max:80,onChange:b=>g({rowHeight:b})}),["characters","grid","coordinates"].includes(t.style)&&f.jsx(ft,{label:"每行格数",value:t.columns,min:4,max:40,onChange:b=>g({columns:b})}),t.style==="characters"&&f.jsx(ft,{label:"字数标记间隔",value:t.wordMark,min:0,max:500,onChange:b=>g({wordMark:b})})]}),f.jsx(zt,{checked:t.title,onChange:b=>g({title:b.target.checked}),children:"标题填写区"}),i&&f.jsxs("div",{children:[f.jsx(dn,{label:"作图底图 URL",value:t.backgroundUrl,maxLength:4096,onChange:b=>g({backgroundUrl:b})}),f.jsx("input",{ref:c,type:"file",accept:"image/*",hidden:!0,onChange:async b=>{const x=b.target.files?.[0];if(b.target.value="",!!x){u(!0),m("");try{const v=a?await a(x):await new Promise((S,w)=>{const T=new FileReader;T.onload=()=>S(String(T.result)),T.onerror=()=>w(new Error("读取失败")),T.readAsDataURL(x)});if(!/^(https?:\/\/|data:image\/|blob:|\/)/i.test(v))throw new Error("图片地址无效");p.current&&C.current.onChange({...C.current.value,backgroundUrl:v})}catch{p.current&&m("图片上传失败,请重试")}finally{p.current&&u(!1)}}}}),f.jsx(ue,{size:"small",loading:l,onClick:()=>c.current?.click(),children:"上传底图"}),d&&f.jsx("p",{role:"alert",children:d})]})]})}function BR({value:t,onChange:r,correction:i=!1,practice:a=!1}){const[c,l]=E.useState(t[0]?.id),u=t.find(g=>g.id===c)||t[0],d=t.indexOf(u),m=i?"改错位置":a?"评价项":"评分点",p=g=>r(t.map(b=>b.id===u.id?{...b,...g}:b)),C=g=>{const b=g&&u?{...Ao(u),label:Ur(t)}:{id:crypto.randomUUID(),label:Ur(t),score:null,prompt:"",answer:""},x=[...t];x.splice(d+1,0,b),r(x),l(b.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":`选择${m}`,children:t.map(g=>f.jsx(ue,{size:"small","aria-pressed":g.id===u?.id,onClick:()=>l(g.id),children:g.label},g.id))}),f.jsx(Xl,{name:m,maximum:20,index:d,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(ua(t,u.id,g)),onDelete:()=>r(t.filter(g=>g.id!==u.id))}),u&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:`${m}编号`,value:u.label,onChange:g=>p({label:g})}),f.jsx(rn,{label:`${m}分值`,value:u.score,onChange:g=>p({score:g})})]}),f.jsx(dn,{label:i?"原文位置/待改文字":a?"评价维度":"作答步骤提示",value:u.prompt,onChange:g=>p({prompt:g})}),f.jsx(Jt,{label:i?"改正答案":a?"评价标准":"评分要点",children:f.jsx(Pl,{"aria-label":i?"改正答案":a?"评价标准":"评分要点",value:u.answer,autoSize:{minRows:2,maxRows:5},onChange:g=>p({answer:g.target.value})})})]})]})}function HR({value:t,onChange:r,onInsert:i}){const[a,c]=E.useState(t[0]?.id),l=t.find(p=>p.id===a)||t[0],u=t.indexOf(l),d=p=>r(t.map(C=>C.id===l.id?{...C,...p}:C)),m=p=>{const C=p&&l?{...Ao(l),label:Ur(t)}:{...Tm(),label:Ur(t)},g=[...t];g.splice(u+1,0,C),r(g),c(C.id)};return f.jsxs("div",{className:"exercise-blank-settings",children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择空位",children:t.map(p=>f.jsx(ue,{size:"small","aria-pressed":p.id===l?.id,onClick:()=>c(p.id),children:p.label},p.id))}),f.jsx(Xl,{name:"空位",maximum:20,index:u,count:t.length,onAdd:()=>m(!1),onCopy:()=>m(!0),onMove:p=>r(ua(t,l.id,p)),onDelete:()=>{r(t.filter(p=>p.id!==l.id)),c(t[Math.max(0,u-1)]?.id)}}),l&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:"空位编号",value:l.label,onChange:p=>d({label:p})}),f.jsx(rn,{label:"每空分值",value:l.score,max:15,onChange:p=>d({score:p})}),f.jsx(ot,{label:"空位样式",value:l.style,options:{line:"横线",brackets:"括号",box:"方框",characters:"字格"},onChange:p=>d({style:p})}),f.jsx(ot,{label:"空位宽度",value:String(l.width),options:{20:"1/5 行",25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:p=>d({width:Number(p)})}),l.style==="characters"&&f.jsx(ft,{label:"字格数量",value:l.characters,min:1,max:40,onChange:p=>d({characters:p})}),f.jsx(dn,{label:"空前提示",value:l.prefix,onChange:p=>d({prefix:p})}),f.jsx(dn,{label:"空后单位",value:l.suffix,onChange:p=>d({suffix:p})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(zt,{checked:l.breakAfter,onChange:p=>d({breakAfter:p.target.checked}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>r(t.map(p=>({...p,width:l.width,style:l.style,characters:l.characters}))),children:"统一空位样式"})]}),f.jsx(ue,{size:"small",onClick:()=>i(l),children:"插入此空到题干"}),f.jsx(Jt,{label:"可接受答案(每行一个)",children:f.jsx(Pl,{"aria-label":"可接受答案",value:l.answers.join(`
|
|
200
|
+
*/var M0;function LA(){return M0||(M0=1,(function(t){(function(){var r={}.hasOwnProperty;function i(){for(var l="",u=0;u<arguments.length;u++){var d=arguments[u];d&&(l=c(l,a(d)))}return l}function a(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return i.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var u="";for(var d in l)r.call(l,d)&&l[d]&&(u=c(u,d));return u}function c(l,u){return u?l?l+" "+u:l+u:l}t.exports?(i.default=i,t.exports=i):window.classNames=i})()})(Qd)),Qd.exports}var zA=LA();const _0=Pm(zA),D0=t=>{const{padding:r="",active:i=!1,className:a,...c}=t,l=E.useMemo(()=>{if(!r)return"unset";if(typeof r=="string")return r;if(typeof r=="number")return r+"px";if(Array.isArray(r))return r.map(u=>u+"px").join(" ")},[r]);return f.jsx("div",{...c,className:_0(a,O0["press-wrapper"],i?O0.active:""),style:{padding:l},children:t.children})};function I0({title:t,children:r}){const[i,a]=E.useState(null);return f.jsxs(dA,{children:[f.jsx(fA,{asChild:!0,children:f.jsx("span",{ref:a,className:"ui-tooltip-trigger",children:r})}),f.jsx(hA,{container:g0(i),className:"ui-tooltip",side:"top",sideOffset:6,children:t})]})}const BA={"icon-quanping":OA,"icon-quxiaoquanping":MA,"icon-shitudaohang":DA},k0=t=>{const{type:r,children:i,tooltip:a,...c}=t,l=BA[r];return a?f.jsx(I0,{title:a,children:f.jsx(D0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})}):f.jsx(D0,{...c,children:f.jsx(l,{size:14,"aria-hidden":"true"})})};function HA({className:t,type:r,...i}){return f.jsx("input",{type:r,"data-slot":"input",className:qe("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...i})}function PA({className:t,...r}){return f.jsx("textarea",{"data-slot":"textarea",className:qe("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 Aa=E.forwardRef(function({className:r,controlSize:i,size:a,status:c,...l},u){return f.jsx(HA,{...l,ref:u,"aria-invalid":c==="error"||l["aria-invalid"],"data-control-size":i||(a==="small"?"compact":a),className:qe("ui-control ui-input",r)})});function Hl({autoSize:t,className:r,...i}){const a=E.useRef(null);return E.useLayoutEffect(()=>{const c=a.current;if(!c||!t)return;const l=getComputedStyle(c),u=parseFloat(l.lineHeight)||20,d=parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)+2;c.style.height="0px",c.style.height=`${Math.max(t.minRows*u+d,Math.min(t.maxRows*u+d,c.scrollHeight+2))}px`},[i.value,t]),f.jsx(PA,{...i,ref:a,className:qe("ui-control ui-textarea",r)})}function UA({...t}){return f.jsx(e2,{"data-slot":"select",...t})}function $A({...t}){return f.jsx(v2,{"data-slot":"select-group",...t})}function GA({...t}){return f.jsx(o2,{"data-slot":"select-value",...t})}function VA({className:t,size:r="default",children:i,...a}){return f.jsxs(n2,{"data-slot":"select-trigger","data-size":r,className:qe("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...a,children:[i,f.jsx(a2,{asChild:!0,children:f.jsx(v0,{className:"size-4 opacity-50"})})]})}function qA({container:t,className:r,children:i,position:a="item-aligned",align:c="center",...l}){return f.jsx(c2,{container:t,children:f.jsxs(u2,{"data-slot":"select-content",className:qe("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:a,align:c,...l,children:[f.jsx(KA,{}),f.jsx(g2,{className:qe("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:i}),f.jsx(FA,{})]})})}function YA({className:t,...r}){return f.jsx(C2,{"data-slot":"select-label",className:qe("px-2 py-1.5 text-xs text-muted-foreground",t),...r})}function XA({className:t,children:r,...i}){return f.jsxs(E2,{"data-slot":"select-item",className:qe("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(A2,{children:f.jsx(x0,{className:"size-4"})})}),f.jsx(T2,{children:r})]})}function KA({className:t,...r}){return f.jsx(R2,{"data-slot":"select-scroll-up-button",className:qe("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(AA,{className:"size-4"})})}function FA({className:t,...r}){return f.jsx(N2,{"data-slot":"select-scroll-down-button",className:qe("flex cursor-default items-center justify-center py-1",t),...r,children:f.jsx(v0,{className:"size-4"})})}function Zd(t){return E.Children.toArray(t).flatMap(r=>E.isValidElement(r)?r.type===E.Fragment?Zd(r.props.children):r.type==="optgroup"?[{label:r.props.label,options:Zd(r.props.children)}]:[{value:String(r.props.value??r.props.children??""),label:r.props.children,disabled:r.props.disabled}]:[])}const Pl="__empty_option__";function L0(t,r){return t.map((i,a)=>i.options?f.jsxs($A,{children:[f.jsx(YA,{children:i.label}),L0(i.options,r)]},a):f.jsx(XA,{value:String(i.value)||Pl,disabled:i.disabled,"data-option-value":i.value,onKeyDown:c=>{c.key==="Enter"&&!i.disabled&&(c.preventDefault(),r(String(i.value)||Pl))},children:i.label},String(i.value)))}function Zt({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),x=v=>{if(v){g(!0);return}const S=!!document.activeElement?.closest('[data-slot="select-content"]');Xr.flushSync(()=>g(!1)),S&&p.current?.focus({preventScroll:!0})},b=v=>{x(!1),u?.(v===Pl?"":v)};return f.jsxs(UA,{value:l===void 0?void 0:String(l)||Pl,onValueChange:b,disabled:d,open:C,onOpenChange:x,children:[f.jsx(VA,{...m,ref:p,className:qe("ui-control ui-select",t),"data-value":l===void 0?"":String(l),"data-control-size":r||(i==="small"?"compact":i),children:f.jsx(GA,{})}),f.jsx(qA,{container:g0(p.current),position:"popper",align:"start",className:"ui-select-popup",onCloseAutoFocus:v=>v.preventDefault(),onEscapeKeyDown:v=>{v.preventDefault(),v.stopPropagation(),x(!1)},children:L0(c||Zd(a),b)})]})}const z0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,B0=Jm,QA=((t,r)=>i=>{var a;if(r?.variants==null)return B0(t,i?.class,i?.className);const{variants:c,defaultVariants:l}=r,u=Object.keys(c).map(p=>{const C=i?.[p],g=l?.[p];if(C===null)return null;const x=z0(C)||z0(g);return c[p][x]}),d=i&&Object.entries(i).reduce((p,C)=>{let[g,x]=C;return x===void 0||(p[g]=x),p},{}),m=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((p,C)=>{let{class:g,className:x,...b}=C;return Object.entries(b).every(v=>{let[S,w]=v;return Array.isArray(w)?w.includes({...l,...d}[S]):{...l,...d}[S]===w})?[...p,g,x]:p},[]);return B0(t,u,m,i?.class,i?.className)})("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function H0({className:t,variant:r="default",size:i="default",asChild:a=!1,...c}){const l=a?FC:"button";return f.jsx(l,{"data-slot":"button","data-variant":r,"data-size":i,className:qe(QA({variant:r,size:i,className:t})),...c})}function ue({type:t="default",htmlType:r="button",size:i="middle",danger:a,loading:c,className:l,children:u,...d}){return f.jsxs(H0,{variant:t==="primary"?"default":t==="text"?"ghost":"outline",size:i==="small"?"xs":i==="large"?"lg":"sm",...d,type:r,disabled:d.disabled||c,"aria-busy":c||void 0,className:qe("ui-button",a&&"ui-danger",l),children:[c&&f.jsx(NA,{className:"animate-spin","aria-hidden":"true"}),u]})}function ZA({className:t,...r}){return f.jsx($E,{"data-slot":"checkbox",className:qe("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",t),...r,children:f.jsx(VE,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(x0,{className:"size-3.5"})})})}function Bt({children:t,className:r,onChange:i,id:a,...c}){const l=E.useId();return f.jsxs("label",{className:qe("ui-checkbox-label",r),htmlFor:a||l,children:[f.jsx(ZA,{...c,id:a||l,className:"ui-checkbox",onCheckedChange:u=>i?.({target:{checked:u===!0}})}),t&&f.jsx("span",{children:t})]})}function Ra({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(Aa,{...l,type:"number",inputMode:"decimal",className:qe("ui-number",a),value:u,onChange:m=>{const p=m.target.value;d(p),p?Number.isFinite(Number(p))&&r?.(Number(p)):r?.(null)},onBlur:m=>{const p=Number(u),C=u&&Number.isFinite(p)&&i!==void 0?String(Number(p.toFixed(i))):u;d(t==null?"":C||String(t)),c?.(m)}})}function WA({...t}){return f.jsx(EE,{"data-slot":"dialog",...t})}function JA({...t}){return f.jsx(jE,{"data-slot":"dialog-portal",...t})}function eR({...t}){return f.jsx(ud,{"data-slot":"dialog-close",...t})}function tR({className:t,...r}){return f.jsx(AE,{"data-slot":"dialog-overlay",className:qe("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...r})}function nR({className:t,children:r,showCloseButton:i=!0,portal:a=!0,overlay:c=!0,...l}){const u=f.jsxs(E.Fragment,{children:[c&&f.jsx(tR,{className:"ui-dialog-overlay"}),f.jsxs(OE,{"data-slot":"dialog-content",className:qe("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(ud,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(kA,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]});return a?f.jsx(JA,{children:u}):u}function rR({className:t,...r}){return f.jsx("div",{"data-slot":"dialog-header",className:qe("flex flex-col gap-2 text-center sm:text-left",t),...r})}function oR({className:t,showCloseButton:r=!1,children:i,...a}){return f.jsxs("div",{"data-slot":"dialog-footer",className:qe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a,children:[i,r&&f.jsx(ud,{asChild:!0,children:f.jsx(H0,{variant:"outline",children:"Close"})})]})}function aR({className:t,...r}){return f.jsx(DE,{"data-slot":"dialog-title",className:qe("text-lg leading-none font-semibold",t),...r})}function Vi({open:t,modal:r=!0,panelRef:i,width:a=460,zIndex:c=900,className:l,title:u,footer:d,children:m,classNames:p,closeLabel:C,closeIcon:g,onCancel:x,onOpenAutoFocus:b,onEscapeKeyDown:v,wrapProps:S}){const w=E.useId(),T=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return f.jsx(WA,{open:t,modal:r,onOpenChange:j=>{j||x()},children:f.jsxs(nR,{...S,ref:i,portal:!1,overlay:r,showCloseButton:!1,"aria-describedby":void 0,"aria-labelledby":w,"aria-modal":r,className:qe("ui-dialog",l),style:{width:a,zIndex:c},onInteractOutside:j=>j.preventDefault(),onOpenAutoFocus:b,onEscapeKeyDown:j=>{if(!r&&j.target instanceof Element&&!j.target.closest(".ui-dialog")){j.preventDefault();return}v?.(j)},onCloseAutoFocus:j=>{j.preventDefault(),r&&T.current?.isConnected&&T.current.focus({preventScroll:!0})},children:[f.jsxs("div",{className:"ui-dialog-surface",children:[f.jsx(rR,{className:qe("ui-dialog-header",p?.header),children:f.jsx(aR,{asChild:!0,id:w,children:f.jsx("div",{className:"ui-dialog-title",children:u})})}),f.jsx("div",{className:qe("ui-dialog-body",p?.body),children:m}),d&&f.jsx(oR,{className:qe("ui-dialog-footer",p?.footer),children:d})]}),f.jsx(eR,{"aria-label":C,className:"ui-dialog-close",children:g})]})})}function iR({className:t,...r}){return f.jsx(Hj,{"data-slot":"radio-group",className:qe("grid gap-3",t),...r})}function sR({children:t,indicator:r=!0,className:i,...a}){return f.jsxs(Gj,{"data-slot":"radio-group-item",className:qe("aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",i),...a,children:[r&&f.jsx(qj,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(RA,{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary"})}),t]})}function lR(t){return null}function cR({value:t,onChange:r,children:i,className:a,name:c,disabled:l}){const u=E.Children.toArray(i).filter(E.isValidElement);return f.jsx(iR,{name:c,disabled:l,className:qe("ui-radio-group",a),value:String(t),onValueChange:d=>{const m=u.find(p=>String(p.props.value)===d);m&&r({target:{value:m.props.value}})},children:u.map(({props:d})=>f.jsx(sR,{value:String(d.value),disabled:d.disabled,className:"ui-radio-option",indicator:!1,children:d.children},String(d.value)))})}const Ge={Group:cR,Button:lR};function uR({thumbLabel:t,className:r,defaultValue:i,value:a,min:c=0,max:l=100,...u}){const d=E.useMemo(()=>Array.isArray(a)?a:Array.isArray(i)?i:[c,l],[a,i,c,l]);return f.jsxs(z2,{"data-slot":"slider",defaultValue:i,value:a,min:c,max:l,className:qe("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",r),...u,children:[f.jsx(U2,{"data-slot":"slider-track",className:qe("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx($2,{"data-slot":"slider-range",className:qe("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:d.length},(m,p)=>f.jsx(X2,{"data-slot":"slider-thumb","aria-label":t,className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},p))]})}function P0({value:t,onChange:r,ariaLabelForHandle:i,...a}){return f.jsx(uR,{...a,value:[t],onValueChange:c=>r(c[0]),thumbLabel:i})}const U0=t=>{let r;const i=new Set,a=(p,C)=>{const g=typeof p=="function"?p(r):p;if(!Object.is(g,r)){const x=r;r=C??(typeof g!="object"||g===null)?g:Object.assign({},r,g),i.forEach(b=>b(r,x))}},c=()=>r,d={setState:a,getState:c,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p))},m=r=t(a,c,d);return d},dR=(t=>t?U0(t):U0),fR=t=>t;function hR(t,r=fR){const i=Oi.useSyncExternalStore(t.subscribe,Oi.useCallback(()=>r(t.getState()),[t,r]),Oi.useCallback(()=>r(t.getInitialState()),[t,r]));return Oi.useDebugValue(i),i}const $0=t=>{const r=dR(t),i=a=>hR(r,a);return Object.assign(i,r),i},mR=(t=>t?$0(t):$0),Ul={min:20,max:150},G0={width:4e3,height:2e3},V0={width:210,height:297},Ho=mR((t,r)=>({scale:100,navigatorVisible:!0,setScale:i=>t(a=>({...a,scale:Math.max(Ul.min,Math.min(Ul.max,Math.round(i)))})),getScale:()=>r().scale,setNavigatorVisible:i=>t(a=>({...a,navigatorVisible:i}))})),pR=()=>{const{scale:t,setScale:r,getScale:i}=Ho(),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;Xr.flushSync(()=>r(i()+(d.deltaY<0?5:-5)));const x=m.getBoundingClientRect();c.scrollLeft+=x.left+C*x.width-d.clientX,c.scrollTop+=x.top+g*x.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:Fd["scale-wrapper"],"aria-label":"工作区缩放",children:[f.jsx(ue,{type:"text",size:"small","aria-label":"缩小",onClick:()=>a(-2),children:f.jsx(_A,{})}),f.jsx(P0,{className:Fd.bar,ariaLabelForHandle:"缩放比例",min:Ul.min,max:Ul.max,step:1,value:t,onChange:r}),f.jsx(ue,{type:"text",size:"small","aria-label":"放大",onClick:()=>a(2),children:f.jsx(IA,{})}),f.jsx(I0,{title:"重置缩放",children:f.jsxs("div",{role:"button",tabIndex:0,"aria-label":"重置缩放",onClick:()=>r(100),onKeyDown:c=>{c.key==="Enter"&&r(100)},className:_0("font-12 grey ml-5 pointer",Fd.percent),children:[t,"%"]})})]})},gR=()=>{const[t,r]=E.useState(!1);E.useEffect(()=>{const a=()=>r(document.fullscreenElement===document.getElementById("uni-answer-sheet"));return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]);const i=async()=>{try{document.fullscreenElement?await document.exitFullscreen():await document.getElementById("uni-answer-sheet").requestFullscreen()}catch{}};return f.jsx(k0,{type:t?"icon-quxiaoquanping":"icon-quanping",className:"ml-5",padding:[0,5],role:"button",tabIndex:0,"aria-label":t?"取消全屏":"全屏",tooltip:t?"取消全屏":"全屏",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i())},onClick:i})},yR=({summary:t})=>{const{navigatorVisible:r,setNavigatorVisible:i}=Ho();return f.jsxs("div",{className:gA.footer,"aria-label":"工作区底栏",children:[f.jsx("div",{className:"font-12 grey",children:t}),f.jsxs("div",{children:[f.jsx(k0,{type:"icon-shitudaohang",padding:[0,5],tooltip:(r?"隐藏":"显示")+"视图导航",active:r,role:"button",tabIndex:0,"aria-label":(r?"隐藏":"显示")+"视图导航",onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),i(!r))},className:"mr-5",onClick:()=>i(!r)}),f.jsx(pR,{}),f.jsx(gR,{})]})]})},q0={"stadio-wrapper":"_stadio-wrapper_jknpq_1",container:"_container_jknpq_15"},xR=({width:t=Ao(V0.width),height:r=Ao(V0.height),children:i})=>{const{scale:a}=Ho();return f.jsx("div",{id:"answer-sheet",style:{transform:`scale(${a/100})`,height:r,width:t},children:i})};var qi=(t=>(t.STADIO_SCROLL_CHANGE="STADIO_SCROLL_CHANGE",t))(qi||{});class bR{constructor(){pm(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 $l=new bR,vR=({width:t,height:r,children:i,onBackgroundClick:a})=>{const c=E.useRef(null),l=E.useRef(null),{scale:u}=Ho(),d=u/100,m=Math.max(G0.width,t*d+600),p=Math.max(G0.height,r*d+600),C=E.useRef(null);return E.useLayoutEffect(()=>{const g=l.current,x=(m-t*d)/2,b=(p-r*d)/2,v=C.current;if(!v||v.width!==t)g.scrollLeft=Math.max(0,x+t*d/2-g.clientWidth/2),g.scrollTop=Math.max(0,b-54);else{const S=(g.scrollLeft+g.clientWidth/2-v.left)/v.zoom,w=(g.scrollTop+g.clientHeight/2-v.top)/v.zoom;g.scrollLeft=x+S*d-g.clientWidth/2,g.scrollTop=b+w*d-g.clientHeight/2}C.current={left:x,top:b,zoom:d,width:t},$l.emit(qi.STADIO_SCROLL_CHANGE)},[m,p,t,r,d]),E.useEffect(()=>{const g=l.current,x=c.current;let b=()=>{};const v=w=>{if(w.button!==1)return;w.preventDefault(),b();const T=w.clientX,j=w.clientY,N=g.scrollLeft,M=g.scrollTop,D=document.body.style.cursor;document.body.style.cursor="grabbing";const O=k=>g.scrollTo({left:N-k.clientX+T,top:M-k.clientY+j}),_=k=>{k.button===1&&b()};b=()=>{document.body.style.cursor=D,window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",_),window.removeEventListener("blur",b)},window.addEventListener("mousemove",O),window.addEventListener("mouseup",_),window.addEventListener("blur",b)},S=()=>$l.emit(qi.STADIO_SCROLL_CHANGE);return x.addEventListener("mousedown",v),g.addEventListener("scroll",S),()=>{b(),x.removeEventListener("mousedown",v),g.removeEventListener("scroll",S)}},[]),f.jsx("div",{className:q0["stadio-wrapper"],ref:l,id:"answer-sheet-stadio","aria-label":"制卡工作区",children:f.jsx("div",{className:q0.container,ref:c,id:"answer-sheet-container",style:{height:p,width:m},onPointerDown:g=>{g.target===g.currentTarget&&a?.()},children:f.jsx(xR,{width:t,height:r,children:i})})})},Wd={"navigator-wrapper":"_navigator-wrapper_rb3fn_1","fake-page":"_fake-page_rb3fn_12",viewport:"_viewport_rb3fn_17"},SR=()=>{const{scale:t}=Ho(),[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 x=Math.max(20,u.offsetWidth/200,u.offsetHeight/160),b=u.getBoundingClientRect(),v=Array.from(d.querySelectorAll("[data-paper-page]")),S=(v.length?v:[d]).map(T=>{const j=T.getBoundingClientRect();return{x:(j.left-b.left)/x,y:(j.top-b.top)/x,width:j.width/x,height:j.height/x}}),w={ratio:x,width:u.offsetWidth/x,height:u.offsetHeight/x,view:{x:l.scrollLeft/x,y:l.scrollTop/x,width:l.clientWidth/x,height:l.clientHeight/x},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(x=>g.observe(x)),$l.on(qi.STADIO_SCROLL_CHANGE,C),C(),()=>{c.current=()=>{},cancelAnimationFrame(m),g.disconnect(),$l.depose(qi.STADIO_SCROLL_CHANGE)}},[]),E.useLayoutEffect(()=>{c.current()},[t]),f.jsxs("div",{className:Wd["navigator-wrapper"],"aria-label":"视图导航",style:{width:r.width,height:r.height},children:[r.pages.map((l,u)=>f.jsx("div",{className:Wd["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:Wd.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]}))}})]})},Jd=new WeakMap;function CR(t){return Array.from(t.querySelectorAll("[data-card-editor-host]")).flatMap(r=>{const i=Jd.get(r),a=r.querySelector(".rt-content");if(!i||!a||a.closest("[hidden]")||!a.getClientRects().length)return[];const c=a.getBoundingClientRect(),l=c.width/a.offsetWidth,u=[...i.getAnswerRegions()],d=new Set(u.map(m=>m.id));return a.querySelectorAll(".rt-choice-stem-glyph").forEach(m=>{const p=m.dataset.optionId,C=m.getBoundingClientRect();!p||d.has(p)||C.width<=0||C.height<=0||(d.add(p),u.push({id:p,pos:-1,type:"choiceOption",attrs:{label:m.textContent||"",questionId:m.dataset.fillQuestionId},x:(C.x-c.x)/l,y:(C.y-c.y)/l,width:C.width/l,height:C.height/l}))}),u.map(m=>({element:a,region:m,rect:{x:c.x+m.x*l,y:c.y+m.y*l,width:m.width*l,height:m.height*l}}))})}const Y0=E.createContext(null),Gl=E.forwardRef((t,r)=>{const i=E.useContext(Y0);if(!i)throw new Error("制卡需要显式注册富文本插件");const a=E.useRef(null),c=E.useRef(null),l=E.useRef(t);l.current=t;const u=E.useRef(null),d=E.useRef(null),m=E.useRef(!1),p=E.useRef(0),C=()=>({...l.current,onChange:x=>l.current.onChange?.(x),onLayout:x=>l.current.onLayout?.(x),onContentSelect:x=>l.current.onContentSelect?.(x)}),g=x=>{const b=c.current,v=++p.current;b&&b.ready.then(()=>{let S=0;const w=()=>{v!==p.current||c.current!==b||l.current.readOnly||(b.getStatus().editable?x(b):++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(x){m.current?c.current.setDocument(x):u.current=x},syncDocument(x){m.current?c.current.syncDocument(x):u.current=x},focus:x=>g(b=>b.focus(x)),focusContent:x=>l.current.contentTargets?.some(b=>b.id===x)?(g(b=>{b.focusContent(x)||b.focus("start")}),!0):!1,insertAnswerRegion:(x,b,v)=>g(S=>S.insertAnswerRegion(x,b,v)),getStatus(){if(d.current)throw d.current;return m.current?c.current.getStatus():{ready:!1,editable:!1,composing:!1,uploading:!1,layoutPending:!0}}}),[]),E.useEffect(()=>{let x=!0;d.current=null;const b=document.createElement("div");b.style.display="contents",a.current.append(b);const v=i.create(b,C()),S=a.current;return Jd.set(S,v),c.current=v,v.ready.then(()=>{x&&(m.current=!0,v.setOptions(C()),u.current&&(v.syncDocument(u.current),u.current=null))}).catch(w=>{x&&(d.current=w)}),()=>{x=!1,m.current=!1,c.current=null,p.current++,Jd.delete(S),b.remove(),queueMicrotask(()=>v.destroy())}},[i]),E.useEffect(()=>{c.current?.setOptions(C())}),f.jsx("div",{ref:a,"data-card-editor-host":"",style:{display:"contents"}})}),X0={judge:"JUDGE",fill:"FILLBLANK",answer:"SHORTANSWER",writing:"CCOMPOSITION",english:"ECOMPOSITION",reading:"READTHENANSWER",cloze:"CLOZE",completion:"TEXT_COMPLETION",matching:"INFO_MATCHING",chunk:"CHUNK_CHOICE",composite:"MIXED",optional:"SHORTANSWER"};function wR(t){if(t.reference||!t.exercise)return t;const r=t.exercise,i=X0[t.kind]||"SHORTANSWER",a=vu(i);return a.fillNewLine=r.fillNewLine,a.optional=t.kind==="optional"&&r.items.length>1,a.choose=Math.max(1,Math.min(r.chooseCount,r.items.length-1)),a.questions=r.items.map(c=>{const l=i==="MIXED"?c.kind==="choice"?c.choice.multiple?"MCHOICE":"SCHOICE":X0[c.kind]||"SHORTANSWER":i,u=l==="MIXED"?"SHORTANSWER":l,d=Cu({...Su(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={...ua(c.choice,u,u==="JUDGE"?2:Math.min(u==="CHUNK_CHOICE"?26:12,c.choice.options.length)),id:c.id,label:c.label},d.characters=Math.min(1200,Math.max(1,c.area.rows*c.area.columns)),d.lines=Math.min(100,Math.max(1,c.area.rows)),d.height=Math.max(30,c.area.rows*c.area.rowHeight),u==="FILLBLANK"||u==="TEXT_COMPLETION")d.parts=c.blanks.map((m,p)=>({...ji(c.blanks.length===1?c.label:`${c.label}.${p+1}`,m.score,u),id:m.id,width:m.width,breakAfter:m.breakAfter})),d.score=Qn(d.parts);else if(u==="SHORTANSWER")d.parts=[{...ji(c.label,c.score,u),document:c.document,height:d.height}];else if(Be(u)){const m=ji(c.label,c.score,u,c.choice.options.length);d.parts=[{...m,choice:{...d.choice,id:m.id}}]}return["SHORTANSWER","CCOMPOSITION","ECOMPOSITION"].includes(u)&&(d.document={...d.document,content:{...d.document.content,content:[...Ci(d.label,d.score).content.content,...d.document.content.content||[]]}},d.parts=d.parts.map(m=>({...m,document:{...m.document,content:{...m.document.content,content:[...Ci(m.label,m.score).content.content,...m.document.content.content||[]]}}}))),d}),{...t,reference:a}}const rr="reference-merged-objective";function ER(t,r){const i=t.blocks.map(d=>d.reference&&t.choiceDirection&&t.choiceDirection!==d.reference.layout.direction?{...d,reference:{...d.reference,layout:{...d.reference.layout,direction:t.choiceDirection}}}:d);if(!t.mergeObjective)return i;const a=i.find(d=>d.reference?.questions.some(m=>Et(m.type)));if(!a?.reference)return i;const c=i.flatMap(d=>{if(!d.reference)return[];const m=ia({...d.reference.layout,questions:da(d.reference)},d.document,t.questionCard!==!1||r===d.id).concentrated,p=new Set(m.questions.map(C=>C.id));return d.reference.questions.filter(C=>Et(C.type)).flatMap(C=>{if(!Be(C.type))return p.has(C.id)?[C]:[];const g=C.parts.filter(x=>p.has(x.id));return g.length?[{...C,parts:g}]:[]})});if(!c.length)return i;const l={...a,id:rr,document:Vt(),reference:{...vu("MIXED"),layout:{...a.reference.layout,presentation:"concentrated"},questions:c}},u=i.flatMap(d=>{if(!d.reference)return[d];const m=d.reference.questions.filter(C=>!Et(C.type)),p=t.questionCard!==!1&&!En(d.document)||r===d.id;return!m.length&&!p&&d.reference.questions.length?[]:[d]});return[l,...u]}function K0(t){const r=t.reference;if(!r)return[];const i=r.type==="MIXED"?[{id:t.id,label:"公共材料",kind:"material"}]:[];return r.questions.forEach(a=>{const c=Be(a.type);i.push({id:a.id,label:c?`第 ${a.parts.map(l=>l.label).join("、")} 题材料`:`第 ${a.label} 题题干`,kind:c?"material":"question",choice:!c&&Et(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="JUDGE"}),a.parts.filter(l=>r.textVersion!==1||l.text).forEach(l=>i.push({id:l.id,label:`第 ${l.label} ${a.type==="FILLBLANK"?"空":"题"}`,kind:"question",parentId:a.id,choice:c&&Et(a.type),hideOptionsAtStem:r.textVersion===1&&a.type==="INFO_MATCHING",inlineOptions:r.textVersion===1&&["CLOZE","INFO_MATCHING"].includes(a.type),optionWidth:r.textVersion===1&&a.type==="INFO_MATCHING"?70:void 0}))}),i}function F0(t,r){return{...t,attrs:{...t.attrs,contentId:r}}}function TR(t,r,i){const a=new Map(r.questions.filter(u=>Ei(u.type)).flatMap(u=>u.parts).map(u=>[u.id,u])),c=u=>{const d=u.type==="answerLine"&&a.get(u.attrs?.id),m=d&&Math.max(24,Math.min(600,i*d.width/100));if(d&&(u.attrs?.label!==d.label||u.attrs?.width!==m))return{...u,attrs:{...u.attrs,label:d.label,width:m}};const p=u.content?.map(c);return p?.some((C,g)=>C!==u.content[g])?{...u,content:p}:u},l=c(t.content);return l===t.content?t:{...t,content:l}}function jR(t){if(!t.reference)return t.document;const r=new Map;t.reference.questions.forEach(c=>{[c.choice,...c.parts.map(l=>l.choice)].forEach(l=>{l.contentTarget&&r.set(l.contentTarget.groupId,l.id)})});let i=!1;const a=t.document.content.content?.map(c=>{if(c.attrs?.contentId)return c;let l;const u=d=>{d.type==="choiceGroup"&&(l=r.get(d.attrs?.id)||l),d.type==="choiceStemAnchor"&&(l=r.get(d.attrs?.groupId)||l),d.content?.forEach(u)};return u(c),l?(i=!0,F0(c,l)):c});return i?{...t.document,content:{...t.document.content,content:a}}:t.document}function AR(t,r,i){const a=w=>w.questions.flatMap(T=>[T.id,...T.parts.map(j=>j.id)]),c=new Set(a(r)),l=new Set(a(i)),u=new Set([...c].filter(w=>!l.has(w)));let d=!1;const m=w=>{if(u.has(w.attrs?.contentId)||w.type==="answerLine"&&u.has(w.attrs?.id))return d=!0,null;const T=w.content?.map(m).filter(j=>j!==null);return T?{...w,content:T}:w},p=m(t.content),C=p.content||[],g=a(i),x=C.filter(w=>l.has(w.attrs?.contentId)),b=[...x].sort((w,T)=>g.indexOf(w.attrs.contentId)-g.indexOf(T.attrs.contentId));let v=0;const S=C.map(w=>l.has(w.attrs?.contentId)?b[v++]:w);return x.some((w,T)=>w!==b[T])&&(d=!0),d?{...t,content:{...p,content:S.length?S:Vt().content.content}}:t}function RR(t,r,i){const a=new Map([[r.id,i.id],...r.parts.map((b,v)=>[b.id,i.parts[v].id])]),c=new Map([...r.choice.options.map((b,v)=>[b.id,i.choice.options[v].id]),...r.parts.flatMap((b,v)=>b.choice.options.map((S,w)=>[S.id,i.parts[v].choice.options[w].id]))]),l=new Map([[r.text?.groupId,i.text?.groupId],...r.parts.map((b,v)=>[b.text?.groupId,i.parts[v].text?.groupId])].filter(b=>!!(b[0]&&b[1]))),u=t.content.content||[],d=u.filter(b=>a.has(b.attrs?.contentId));if(!d.length)return t;const m=jo(d),p=(b,v)=>({...b,...b.attrs?{attrs:{...b.attrs,...b.type==="choiceOption"&&c.has(v.attrs?.id)?{id:c.get(v.attrs.id)}:{},...b.type==="choiceGroup"&&l.has(v.attrs?.id)?{id:l.get(v.attrs.id)}:{},...a.has(v.attrs?.contentId)?{contentId:a.get(v.attrs.contentId)}:{},...b.type==="choiceStemAnchor"&&a.has(String(v.attrs?.groupId).slice(9))?{groupId:uu(a.get(String(v.attrs.groupId).slice(9)))}:{}}}:{},...b.content?{content:b.content.map((S,w)=>p(S,v.content[w]))}:{}}),C=new Map(r.parts.map((b,v)=>[b.id,i.parts[v].id])),g=(b,v)=>({...b,...v.type==="answerLine"&&C.has(v.attrs?.id)?{attrs:{...b.attrs,id:C.get(v.attrs.id)}}:{},...b.content?{content:b.content.map((S,w)=>g(S,v.content[w]))}:{}}),x=Math.max(...d.map(b=>u.indexOf(b)));return{...t,content:{...t.content,content:[...u.slice(0,x+1),...m.map((b,v)=>g(p(b,d[v]),d[v])),...u.slice(x+1)]}}}function NR(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:[...En(t)?[]:i,...c]}}:t}function OR(t,r){const i={};let a=1;return{sectionInfoList:t.filter(l=>l.reference).map((l,u)=>{const d=l.reference,m=d.textVersion===1?d:Mm({...d,questions:d.questions.map(v=>({...v,text:v.text||{...wi(v.type,v.choice,Be(v.type)),numbered:!1,itemsContent:[]},parts:v.parts.map(S=>({...S,text:S.text||{...wi(v.type,S.choice),numbered:!1,itemsContent:[]}}))}))},l.document,l.id),p=m.sectionSeq??u+1,C=v=>v?.itemsContent.map(S=>({id:S.id,key:S.key,content:r.serialize(S.content)}))||[],g=v=>r.serialize(v?.content||Vt()),x=(v,S,w)=>{const T=v?Zs({...v,itemsContent:[]},S,w):[],j=r.serialize(Gr(T)),N=r.unwrapParagraphs||(M=>M.replace(/^<p\b[^>]*>([\s\S]*)<\/p>$/,"$1"));return{content:N(j,!0),contentNoP:N(j),items:C(v).map(M=>`${M.key}.${N(M.content)}`)}},b=m.questions.map(v=>{const S=Be(v.type),w=a;a+=S?v.parts.length:1;const T=v.referenceData||{},j=T.questionId??v.id,N=S?v.parts.map((O,_)=>({...O.referenceData,questionId:O.referenceData?.questionId??O.id,questionPid:j,questiontypeCode:v.type,seq:w+_,showSeq:O.label,itemShowNames:[O.label],score:O.score,itemcount:O.choice.options.length,content:g(O.text),itemsContent:C(O.text)})):void 0,M={...T,questionId:j,questiontypeCode:v.type,seq:w,showSeq:v.label,showSeqs:S?v.parts.map(O=>O.label):null,itemShowNames:v.parts.length?v.parts.map(O=>O.label):[v.label],itemcount:Et(v.type)?v.choice.options.length:v.parts.length||1,childNum:S?v.parts.length:void 0,score:v.score,itemScores:v.parts.length?v.parts.map(O=>O.score):[v.score],content:g(v.text),itemsContent:C(v.text),...N?{items:N}:{},lessScore:v.choice.lessScore,scoreType:v.choice.scoreType,rightAnswers:v.rightAnswers,singleScore:v.singleScore,extension:{...T.extension||{},...v.type==="CCOMPOSITION"?{kong:v.characters}:{},...v.type==="ECOMPOSITION"?{hang:v.lines}:{},uniEditor:{text:v.text,choice:v.choice,height:v.height,contentHeight:v.contentHeight,halfPoint:v.halfPoint,parts:v.parts.map(O=>({id:O.id,text:O.text,width:O.width,height:O.height,breakAfter:O.breakAfter,choice:O.choice,document:O.document})),document:v.document}}},D=x(v.text,v.id,v.label);return i[String(j)]=S?{...D,items:v.parts.map((O,_)=>({seq:w+_,...x(O.text,O.id,O.label)}))}:D,m.type==="MIXED"&&(i[`secContent${j}`]=r.serialize(m.material||Vt())),M});return{...m.referenceData,sectionSeq:p,sectionName:l.title,sectionQuestionType:m.type,questionInfolist:b,...m.type==="MIXED"?{content:r.serialize(m.material||Vt())}:{},extension:{...m.referenceData?.extension||{},uniEditor:{id:l.id,layout:m.layout,material:m.material,document:l.document,optional:m.optional,choose:m.choose,optionalHeight:m.optionalHeight,scoreType:m.scoreType,fillNewLine:m.fillNewLine}}}}),quesTextMap:i}}function Q0(t,r){const i=Array.isArray(t)?t:t.sectionInfoList;if(!Array.isArray(i))throw new Error("缺少 sectionInfoList");const a=new Set,c=l=>{const u=l==null||l===""?crypto.randomUUID():String(l);if(a.has(u))throw new Error(`题目 ID 重复:${u}`);return a.add(u),u};return i.map(l=>{if(!(l.sectionQuestionType in ur)||!Array.isArray(l.questionInfolist))throw new Error("题块类型或 questionInfolist 无效");const u=_m(l.sectionQuestionType),d=l.extension;d?.uniEditor?.id&&(u.id=d.uniEditor.id),u.title=l.sectionName;const{questionInfolist:m,...p}=l,C=[],g=new Map;m.forEach(b=>{if(b.questionPid!==void 0&&b.questionPid!==null&&Be(b.questiontypeCode)){const v=String(b.questionPid);let S=g.get(v);S||(S={...b,questionId:b.questionPid,questionPid:void 0,content:String(b.parentContent||""),items:[],showSeqs:[]},g.set(v,S),C.push(S)),S.items.push(b),S.showSeqs.push(b.showSeq??b.seq??S.items.length)}else C.push(b)}),g.forEach(b=>{b.itemScores=b.items.map(v=>v.score??null),b.score=b.itemScores.some(v=>v===null)?null:b.itemScores.reduce((v,S)=>v+(S||0),0)});const x=C.map((b,v)=>{if(!(b.questiontypeCode in ur)||b.questiontypeCode==="MIXED")throw new Error("子题类型无效");const S=b.questiontypeCode,w=Be(S),T=w?b.items?.length||b.showSeqs?.length||b.childNum||1:["FILLBLANK","SHORTANSWER"].includes(S)&&(b.itemScores?.length||b.itemcount)||1;if(!Number.isInteger(T)||T<1||T>200)throw new Error("子题数量无效");const j=b.score??null,N=Su(S),M=Cu({...N,characters:Number(b.extension?.kong)||N.characters,lines:Number(b.extension?.hang)||N.lines,partCount:T,score:w||["FILLBLANK","SHORTANSWER"].includes(S)?b.itemScores?.[0]??(j===null?null:j/T):j,optionCount:b.itemcount||b.itemsContent?.length||4},Number(b.seq)||v+1);M.id=c(b.questionId??b.id),M.label=String(b.showSeq??b.itemShowNames?.[0]??b.seq??v+1),M.choice.id=M.id,M.choice.label=M.label,M.choice.score=j,M.choice.scoreType=b.scoreType||M.choice.scoreType,M.choice.lessScore=b.lessScore??M.choice.lessScore,M.rightAnswers=b.rightAnswers??M.rightAnswers,M.singleScore=b.singleScore??M.singleScore,M.score=j,M.referenceData=b;const D=b.extension?.uniEditor;D?.choice&&(M.choice={...D.choice,id:M.id,label:M.label,score:j}),M.height=D?.height??M.height,M.contentHeight=D?.contentHeight??M.contentHeight,M.halfPoint=D?.halfPoint??M.halfPoint;const O=(_,k,L,B=!1,z)=>{if(z)return structuredClone(z);const U=wi(S,{...L,id:k},B);return{...U,content:r.parse(_.content||""),itemsContent:!B&&_.itemsContent?_.itemsContent.map((K,$)=>({id:K.id===void 0?L.options[$]?.id||crypto.randomUUID():String(K.id),key:K.key,content:r.parse(K.content||"")})):U.itemsContent}};return M.text=O(b,M.id,M.choice,w,D?.text),M.text.itemsContent.length&&(M.choice.options=M.text.itemsContent.map(_=>({id:_.id,label:_.key}))),M.document=D?.document||Tn(M.document,M.label,M.score),M.parts=M.parts.map((_,k)=>{const L=b.items?.[k],B=D?.parts?.[k];return _.id=c(B?.id??L?.questionId??L?.id),_.referenceData=L,_.label=String(L?.showSeq??b.itemShowNames?.[k]??b.showSeqs?.[k]??(w?Number(b.seq||1)+k:T===1?M.label:`${M.label}.${k+1}`)),_.score=L?.score??b.itemScores?.[k]??_.score,_.choice={...B?.choice||_.choice,id:_.id,label:_.label,score:_.score,scoreType:L?.scoreType||b.scoreType||_.choice.scoreType,lessScore:L?.lessScore??b.lessScore??_.choice.lessScore},w&&S!=="TEXT_COMPLETION"&&(_.text=O(L||{itemsContent:b.itemsContent?.map(({key:z,content:U})=>({key:z,content:U}))},_.id,_.choice,!1,B?.text)),_.text?.itemsContent.length&&(_.choice.options=_.text.itemsContent.map(z=>({id:z.id,label:z.key}))),_.document=B?.document||Tn(_.document,_.label,_.score),{..._,...B?{width:B.width??_.width,height:B.height??_.height,breakAfter:B.breakAfter??_.breakAfter}:{}}}),M.characters=Number(b.extension?.kong)||M.characters,M.lines=Number(b.extension?.hang)||M.lines,M});return u.reference={...u.reference,textVersion:1,sectionSeq:l.sectionSeq,referenceData:p,questions:x,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=bu(u),u})}class Er extends Error{constructor(r,i){super(i),this.code=r}}const Z0=t=>!t.closest("[hidden]")&&t.getClientRects().length>0;function MR(t,r,i){const a=t.getBoundingClientRect(),c=a.width/i.width;if(!t.isConnected||!(c>0))throw new Er("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 x=l(g.getBoundingClientRect()),b=Object.fromEntries(Array.from(g.querySelectorAll("[data-anchor]")).map(j=>[j.dataset.anchor,l(j.getBoundingClientRect())]));if(Object.keys(b).length!==4)throw new Er("MISSING_ANCHORS","缺少纸面定位点,请先完成题卡初始化");const v=b.topLeft,S=j=>Im({...j,x:j.x-x.x,y:j.y-x.y}),w={pageNumber:Number(g.dataset.paperPage),pageSize:{width:Zn(i.width),height:Zn(i.height)},anchorOrigin:{x:Zn(v.x-x.x),y:Zn(v.y-x.y)},anchorSize:{width:26,height:13},panelSize:{width:Zn(b.topRight.x+b.topRight.width-v.x),height:Zn(b.bottomRight.y+b.bottomRight.height-v.y)},anchors:{topLeft:S(b.topLeft),topRight:S(b.topRight),bottomLeft:S(b.bottomLeft),bottomRight:S(b.bottomRight)},regions:[]};for(const j of Object.values(b))if(j.x<x.x-.1||j.y<x.y-.1||j.x+j.width>x.x+x.width+.1||j.y+j.height>x.y+x.height+.1)throw new Er("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,N)=>T.slice(N+1).forEach(M=>{const D=km(j,M);if(D&&D.width>.3&&D.height>.3)throw new Er("OVERLAPPING_PAPER_MARKS","纸面识别标记与页码重叠,请调整边距或版式")})),{data:w,paper:x,toPaper:S}});if(u.length>Am(r))throw new Er("PAPER_PAGE_LIMIT","题卡仅支持一张纸,请调整内容或版式");const d=new Map;r.blocks.forEach(g=>{g.reference?.questions.forEach(x=>{const b={blockId:g.id,questionId:x.id,answerId:x.id};d.set(x.id,b),x.choice.options.forEach(v=>d.set(v.id,b)),x.parts.forEach(v=>{const S={...b,partId:v.id,answerId:v.id};d.set(v.id,S),v.choice.options.forEach(w=>d.set(w.id,S))})}),g.choices?.questions.forEach(x=>{const b={blockId:g.id,questionId:x.id,answerId:x.id};d.set(x.id,b),x.options.forEach(v=>d.set(v.id,b))})});const m=new Map,p=(g,x,b)=>{if(![g.x,g.y,g.width,g.height].every(Number.isFinite)||g.width<=0||g.height<=0)throw new Er("INVALID_RECOGNITION_RECT","识别区域尺寸无效,请检查内容是否已完成布局");const v=u.flatMap(D=>{const O=km(g,D.paper);return O?[{page:D,rect:O}]:[]}),S=v.reduce((D,O)=>D+O.rect.width*O.rect.height,0);if(!v.length||g.width*g.height-S>Math.max(g.width,g.height)*.2||v.length!==1)throw new Er("REGION_OUTSIDE_PAPER","识别区域超出纸面,请调整内容或版式");const{page:w}=v[0],T=`${w.data.pageNumber}/${b}`,j=m.get(T)||0;m.set(T,j+1);const N=Array.from({length:i.columns},(D,O)=>O).find(D=>g.x>=i.columnX(w.data.pageNumber-1,D)-1&&g.x<i.columnX(w.data.pageNumber-1,D)+i.columnWidth+1),M={...x,id:`${T}/${j}`,rect:w.toPaper(g),...N!==void 0?{columnNumber:N+1}:{}};return w.data.regions.push(M),M},C=(g,x)=>{const b=g.closest("[data-exercise-item], [data-exercise-id], [data-question-id]"),v=b?.dataset.exerciseItem||b?.dataset.exerciseId||b?.dataset.questionId;return{blockId:g.closest("[data-block-id]")?.dataset.blockId,...d.get(x||"")||d.get(v||"")}};return t.querySelectorAll("[data-recognition]").forEach(g=>{if(!Z0(g))return;const x=g.dataset.recognition,b=g.dataset.answerId,v=C(g,g.dataset.optionId||b),S=g.dataset.recognitionRole||"region",w={...v,sectionType:x,role:S,...g.dataset.recognitionScope==="section"?{scope:"section"}:{},...b?{answerId:b}:{},...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=`${x}/${v.blockId||"paper"}/${b||""}/${g.dataset.optionId||""}/${S}/${g.dataset.value||""}/${g.dataset.fragment||""}`,j=p(l(g.getBoundingClientRect()),w,T);g.querySelectorAll("[data-recognition-cell]").forEach(N=>{N.closest("[data-recognition]")!==g||!Z0(N)||p(l(N.getBoundingClientRect()),{...w,role:"cell",parentId:j.id,value:N.dataset.recognitionCell},`${T}/cell/${N.dataset.recognitionCell}`)})}),CR(t).forEach(({element:g,region:x,rect:b})=>{const v=x.id||`position-${x.pos}`,S=C(g,v),w=x.type==="choiceOption"||x.type==="choiceMarker",T=w?"MultiChoice":"Checkbox";p(l(b),{...S,sectionType:T,role:x.type==="answerLine"?"line":"cell",answerId:d.get(v)?.answerId||v,...w?{optionId:v}:{},...x.attrs.label?{value:String(x.attrs.label)}:{}},`editor/${S.blockId||"paper"}/${v}/${x.pos}`)}),u.forEach(({data:g})=>{const x=new Map;g.regions.filter(b=>b.sectionType==="MultiChoice"&&b.role==="cell").forEach(b=>{const v=`${b.blockId||""}/${b.answerId||""}/${b.columnNumber||""}`,S=x.get(v)||[];S.push(b),x.set(v,S)}),x.forEach((b,v)=>{const S=b[0],w=Math.min(...b.map(D=>D.rect.x)),T=Math.min(...b.map(D=>D.rect.y)),j=Math.max(...b.map(D=>D.rect.x+D.rect.width)),N=Math.max(...b.map(D=>D.rect.y+D.rect.height)),M=`${g.pageNumber}/MultiChoice/group/${v}`;g.regions.push({id:M,sectionType:"MultiChoice",role:"region",blockId:S.blockId,questionId:S.questionId,partId:S.partId,answerId:S.answerId,columnNumber:S.columnNumber,rect:Im({x:w,y:T,width:j-w,height:N-T})}),b.forEach(D=>{D.parentId=M})}),g.regions.filter(b=>!b.parentId&&b.scope!=="section").forEach(b=>{const v=g.regions.filter(S=>S!==b&&S.role==="region"&&(b.role!=="region"||S.scope==="section")&&(S.blockId===b.blockId||S.questionIds?.includes(b.questionId||""))&&(S.answerId===b.answerId||S.questionIds?.includes(b.questionId||"")||S.questionId&&S.questionId===b.questionId&&!S.partId)&&b.rect.x>=S.rect.x-.1&&b.rect.y>=S.rect.y-.1&&b.rect.x+b.rect.width<=S.rect.x+S.rect.width+.1&&b.rect.y+b.rect.height<=S.rect.y+S.rect.height+.1).sort((S,w)=>S.rect.width*S.rect.height-w.rect.width*w.rect.height)[0];v&&(b.parentId=v.id)})}),{version:2,unit:"px",dpi:96,origin:"topLeftPaper",singlePagePartition:i.columns,pages:u.map(g=>g.data)}}function _R({uploadImage:t,editorPlugin:r,initialValue:i,onSave:a,dictionaries:c}){const l=E.useMemo(()=>iu(c),[c]),u=r.html,[d,m]=E.useState(i||jm),p=E.useCallback(ce=>m(Re=>{let Se=typeof ce=="function"?ce(Re):ce;Se.blocks.some(Ne=>Ne.exercise&&!Ne.reference)&&(Se={...Se,blocks:Se.blocks.map(wR)}),Se={...Se,blocks:Se.blocks.map(Ne=>{const Jt=Re.blocks.find(Tr=>Tr.id===Ne.id);if(Ne.reference?.textVersion===1)return TS(Ne,Jt,!!Se.questionCard);if(!Ne.reference||Jt?.reference===Ne.reference)return Ne;let pn=Jt?.reference?AR(Ne.document,Jt.reference,Ne.reference):Ne.document;if(pn.content.content?.length===1&&pn.content.content[0].type==="paragraph"&&!pn.content.content[0].content?.length&&!pn.content.content[0].attrs?.contentId&&Ne.reference.questions.length){const Tr=Ne.reference.questions[0],or=Ne.reference.type==="MIXED"?Ne.id:Tr.id;pn={...pn,content:{...pn.content,content:[F0(pn.content.content[0],or)]}}}const Qi=Tr=>JSON.stringify(Tr.reference?.questions.flatMap(or=>[or.choice,...or.parts.map(af=>af.choice)]).map(or=>[or.id,or.contentTarget])),_a=!Jt||Qi(Jt)!==Qi(Ne)?jR({...Ne,document:pn}):pn;return _a===Ne.document?Ne:{...Ne,document:_a}})};const tt=Se.blocks.filter(Ne=>Ne.reference).map(Ne=>da(Ne.reference));return(Se.mergeObjective?[tt.flat()]:tt).some(Ne=>new Set(Ne.map(Jt=>Jt.options.length)).size>1)&&Se.choiceDirection!=="column"?{...Se,choiceDirection:"column"}:Se}),[]),[C,g]=E.useState(""),[x,b]=E.useState(!i),[v,S]=E.useState(null),[w,T]=E.useState(null),[j,N]=E.useState(null),[M,D]=E.useState(null),[O,_]=E.useState(!1),[k,L]=E.useState(!0),[B,z]=E.useState({}),U=ce=>{const Re=ce.reference?Js(ce.reference):ce.exercise?.items||ce.choices?.questions;return Re?.find(Se=>Se.id===B[ce.id])?.id||Re?.[0]?.id},K=(ce,Re)=>z(Se=>Se[ce]===Re?Se:{...Se,[ce]:Re}),$=ce=>{S(ce),ce===null&&T(null),ce&&N(Re=>Re===null?null:ce)},[ee,G]=E.useState({}),[q,H]=E.useState(),[P,A]=E.useState(!1),Y=ce=>{ce&&T(null),A(ce)},[F,Z]=E.useState(null),le=E.useRef(new Map),re=E.useRef(null),ae=E.useCallback((ce,Re)=>{Re?le.current.set(ce,Re):le.current.delete(ce)},[]),{scale:be,setScale:ye}=Ho(),ge=be/100,de=E.useMemo(()=>ER(d,w),[d,w]),_e=JSON.stringify([d.usage,d.preset,d.duplex,d.margin,d.gap,d.header,d.recognition,d.paperTitle?.id,d.paperTitle?.height,de.map(ce=>[ce.id,ce.answerHeight])]),{geometry:Me,placements:Ee,pageCount:ve}=E.useMemo(()=>SS({...d,blocks:de},ee,q),[_e,ee,q]),Te=d.paperTitle?.id===q?.id&&q?.overflowing,At=ve*Me.height+(ve-1)*$r,ht=Ee.filter(ce=>ce.overflowFrom!==void 0),rn=new Map(Ee.map(ce=>[ce.id,ce])),pe=rn.get(rr);pe&&d.blocks.forEach(ce=>{rn.has(ce.id)||rn.set(ce.id,pe)});const yt=new Set(de.find(ce=>ce.id===rr)?.reference?.questions.map(ce=>ce.id)),Fe=new Map;d.blocks.forEach(ce=>{const Re=rn.get(ce.id);Re?.overflowFrom!==void 0?Fe.set(ce.id,Re):pe?.overflowFrom!==void 0&&ce.reference?.questions.some(Se=>yt.has(Se.id))&&Fe.set(ce.id,pe)});const On=()=>{const ce=document.getElementById("answer-sheet-stadio");ce&&ye(Math.max(20,Math.min(100,Math.floor((ce.clientWidth-96)/Me.width*100))))};E.useEffect(()=>{On()},[d.preset]);const Mn=(ce,Re)=>p(Se=>({...Se,blocks:Se.blocks.map(tt=>tt.id===ce?{...tt,...Re}:tt)})),Oa=(ce,Re)=>p(Se=>{const tt=[...Se.blocks],Kt=tt.findIndex(Jt=>Jt.id===ce);if(Kt<0||Re<0||Re>=tt.length||Kt===Re)return Se;const[Ne]=tt.splice(Kt,1);return tt.splice(Re,0,Ne),{...Se,blocks:tt}}),Uo=(ce,Re=!1)=>{if($(ce),!Re)return;if(Fe.has(ce)){N(null),_(!1),D(ce);return}const Se=document.getElementById("answer-sheet-stadio"),tt=Array.from(document.querySelectorAll("[data-block-id]")),Kt=tt.find(Ne=>Ne.dataset.blockId===ce&&!Ne.hidden)||tt.find(Ne=>Ne.dataset.blockId===rr);if(Se&&Kt){const Ne=Kt.getBoundingClientRect(),Jt=Se.getBoundingClientRect();Se.scrollTo({left:Math.max(0,Se.scrollLeft+Ne.left-Jt.left-40),top:Math.max(0,Se.scrollTop+Ne.top-Jt.top-90),behavior:"smooth"})}},on=()=>OR(d.blocks,u),Rt=()=>{if(!re.current)throw new Error("题卡尚未完成渲染");if(ht.length)throw new Er("CONTENT_OVERFLOW","内容超出一张纸,请调整未排入纸张的题块后再保存");return MR(re.current,d,Me)},mn=ce=>{const Re=Q0(ce,u);p(Se=>({...Se,blocks:Re})),$(null),N(null),z({})},Ht=()=>{if(a){a();return}let ce;try{ce=Rt()}catch(tt){g(tt instanceof Error?tt.message:"识别坐标生成失败");return}const Re=URL.createObjectURL(new Blob([JSON.stringify({...d,...on(),recognitionData:ce},null,2)],{type:"application/json"})),Se=document.createElement("a");Se.href=Re,Se.download=`${d.title||"答题卡"}.json`,Se.click(),setTimeout(()=>URL.revokeObjectURL(Re),1e3)},Ki=(ce,Re=!0)=>{P||(D(null),$(ce),N(ce),L(Re))},Ma=(ce,Re=!1)=>{$(ce),N(null),_(Re),D(ce)};return{card:d,paperRoot:re,creationDictionary:l,saveMessage:C,setSaveMessage:g,saveAction:a?"保存":"导出",editors:le,measurements:ee,titleMeasurement:q,paperBlocks:de,setCard:p,uploadImage:t,setQuestionCard:ce=>{T(null),p(Re=>({...Re,questionCard:ce,blocks:Re.blocks.filter(Se=>Se.areaType!==(ce?"forbiden":"editArea"))}))},editQuestion:(ce,Re)=>{if(Fe.has(ce)){Ma(ce,!0);return}$(ce),T(ce),N(null);const Se=d.blocks.find(Kt=>Kt.id===ce),tt=Re||Se&&U(Se);Se?.reference?.textVersion===1&&En(Se.document)&&Mn(ce,{document:bu(Se)}),requestAnimationFrame(()=>{const Kt=le.current.get(`content/${tt}`)||le.current.get(ce);(!tt||!Kt?.focusContent(tt))&&Kt?.focus("start")})},finishQuestionEditing:()=>T(null),insertMaterialBlank:(ce,Re,Se,tt)=>{$(ce),T(ce),requestAnimationFrame(()=>le.current.get(ce)?.insertAnswerRegion(Re,Se,tt))},editingQuestionId:w,registerEditor:ae,creationOpen:x,setCreationOpen:b,newCard:ce=>{p(yu(ce)),$(null),N(null),D(null),Z(null),G({}),H(void 0),z({}),Y(!1),b(!1)},selectedId:v,setSelectedId:$,selectedChoiceId:U,selectChoice:K,settingsId:j,setSettingsId:N,settingsAutoFocus:k,openSettings:Ki,draftBlockId:M,setDraftBlockId:D,draftQuestionMode:O,openDraft:Ma,setMeasurements:G,setTitleMeasurement:H,titleOverflow:Te,readOnly:P,setReadOnly:Y,deleted:F,setDeleted:Z,scale:ge,geometry:Me,placements:Ee,pageCount:ve,totalHeight:At,overflow:ht,overflowById:Fe,placementById:rn,fitPage:On,updateBlock:Mn,moveBlock:Oa,selectBlock:Uo,download:Ht,getReferenceData:on,getRecognitionData:Rt,setReferenceData:mn}}const ef=E.createContext(null);function DR({children:t}){const r=lt(),i=E.useCallback((a,c)=>r.registerEditor(`draft/${a}`,c),[r.registerEditor]);return f.jsx(ef.Provider,{value:{...r,scale:1,card:{...r.card,mergeObjective:!1},registerEditor:i},children:t})}function IR({children:t,...r}){return f.jsx(Y0.Provider,{value:r.editorPlugin,children:f.jsx(ef.Provider,{value:_R(r),children:t})})}function lt(){const t=E.useContext(ef);if(!t)throw new Error("制卡内容需要 CardProvider");return t}const kR={undo:"M9 5 4 10l5 5M4 10h10a6 6 0 0 1 0 12",redo:"m15 5 5 5-5 5m5-5H10a6 6 0 0 0 0 12",image:"M4 4h16v16H4zM4 16l5-5 4 4 3-3 4 4M16 8h.01",table:"M4 4h16v16H4zM4 10h16M10 4v16M4 15h16",check:"m5 12 4 4L19 6",back:"m14 5-7 7 7 7",close:"m6 6 12 12M6 18 18 6",upload:"M12 16V3m-4 4 4-4 4 4M5 13v7h14v-7",download:"M12 3v13m-4-4 4 4 4-4M5 17v4h14v-4",settings:"M4 7h16M4 17h16M8 4v6m8 4v6",chevronUp:"m7 14 5-5 5 5",answerLine:"M4 17h16M5 10h2m4 0h2m4 0h2",alignLeft:"M4 5h16M4 10h10M4 15h16M4 20h10",alignCenter:"M4 5h16M7 10h10M4 15h16M7 20h10",alignRight:"M4 5h16M10 10h10M4 15h16M10 20h10",alignJustify:"M4 5h16M4 10h16M4 15h16M4 20h16",document:"M6 3h8l4 4v14H6zM14 3v5h4M9 12h6m-6 4h6",trash:"M4 6h16M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",listOrdered:"M10 6h10M10 12h10M10 18h10M3 4h1v5M3 9h2M3 15a1.5 1.5 0 0 1 3 0c0 1-3 3-3 4h3"};function to({name:t,size:r=18}){return f.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:kR[t]})})}function Vl(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 x=r.getBoundingClientRect();r.style.left=`${Math.max(8,Math.min(window.innerWidth-x.width-8,C))}px`,r.style.top=`${Math.max(8,Math.min(window.innerHeight-x.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 x=r.getBoundingClientRect();l(x.left,x.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:x}=r.getBoundingClientRect();c.current={x:C.clientX,y:C.clientY,left:g,top:x,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,x=r.getBoundingClientRect();l(x.left+(C.key==="ArrowRight"?g:C.key==="ArrowLeft"?-g:0),x.top+(C.key==="ArrowDown"?g:C.key==="ArrowUp"?-g:0))}},cancelDrag:m}}function LR({creation:t,questionCard:r,onAdd:i,onClose:a}){const[c,l]=E.useState(null),u=Nm(t),d=r?"editArea":"forbiden",m=[...u,d],p={...ur,forbiden:"禁止答题区",editArea:"空白答题区"},C=E.useId(),{dialog:g,setDialog:x,titleProps:b,cancelDrag:v}=Vl();E.useLayoutEffect(()=>{g?.setAttribute("aria-labelledby",C)},[g,C]);const S=f.jsx("div",{...b,className:"card-modal-drag","aria-label":"拖动添加题块",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:C,children:"添加题块"})});return f.jsxs(Vi,{open:!0,panelRef:x,width:460,zIndex:910,className:"card-modal card-add-block-modal",title:S,closeLabel:"关闭添加题块",closeIcon:f.jsx(to,{name:"close",size:16}),onCancel:a,onEscapeKeyDown:w=>{v()&&(w.preventDefault(),w.stopPropagation())},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ue,{onClick:a,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!c||!m.includes(c),onClick:()=>{c&&m.includes(c)&&i(c)},children:"添加"})]}),children:[f.jsx("div",{className:"card-question-types",role:"group","aria-label":"选择题型",children:u.map(w=>f.jsx(ue,{"aria-pressed":c===w,onClick:()=>l(w),children:p[w]},w))}),f.jsx("div",{className:"card-question-types card-area-types",role:"group","aria-label":"纸面区域",children:f.jsx(ue,{"aria-pressed":c===d,onClick:()=>l(d),children:p[d]})})]})}function ql({label:t,value:r,min:i,max:a,onChange:c}){const[l,u]=E.useState();return f.jsx(Ra,{className:"ui-control ui-number","aria-label":t,min:i,max:a,precision:0,value:l===void 0?r:l,onChange:d=>{u(d),d!==null&&d>=i&&d<=a&&d!==r&&c(d)},onBlur:()=>{if(l!==void 0){const d=Math.max(i,Math.min(a,l??i));d!==r&&c(d),u(void 0)}}})}function Yi({label:t,value:r,min:i=.5,max:a=15,placeholder:c,onChange:l}){const[u,d]=E.useState(),m=u==null||Fn(u)&&u>=i&&u<=a;return f.jsx(Ra,{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||Fn(p)&&p>=i&&p<=a)&&l(p)},onBlur:()=>d(void 0)})}function zR({value:t,creation:r,onChange:i}){const[a,c]=E.useState("all"),[l,u]=E.useState([]),[d,m]=E.useState("settings"),[p,C]=E.useState("keep"),[g,x]=E.useState(null),[b,v]=E.useState(null),[S,w]=E.useState("keep"),[T,j]=E.useState(null),[N,M]=E.useState(1),[D,O]=E.useState(null),[_,k]=E.useState(""),[L,B]=E.useState(""),z=t.questions.filter(K=>a==="all"||l.includes(K.id)).map(K=>K.id),U=()=>{const K={};p!=="keep"&&(K.kind=p),g!==null&&(K.optionCount=g),b!==null&&(K.score=b),S!=="keep"&&(K.scoreType=S),T!==null&&S!=="ITEM_SCORE"&&(K.lessScore=T);let $;d==="settings"?$={type:d,patch:K}:d==="numbering"?$={type:d,start:N}:d==="average"?$={type:d,total:D??0}:$={type:d,text:_};const ee=iS(t,z,$,r);B(ee.error||""),ee.value&&i(ee.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(Zt,{"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(Zt,{"aria-label":"选择题批量操作",value:d,onChange:K=>{m(K),B("")},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(K=>f.jsxs(Bt,{checked:z.includes(K.id),onChange:$=>u(ee=>$.target.checked?[...ee,K.id]:ee.filter(G=>G!==K.id)),children:["第 ",K.label," 题"]},K.id))}),d==="settings"&&f.jsxs("div",{className:"card-choice-batch-properties",children:[f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Zt,{"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(Ra,{className:"ui-control ui-number","aria-label":"批量选项个数",placeholder:"保持不变",min:2,max:wn.options,precision:0,value:g,onChange:x})]}),f.jsxs("label",{className:"card-field",children:["每题分值",f.jsx(Yi,{label:"批量每题分值",value:b,placeholder:"保持不变",onChange:v})]}),f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Zt,{"aria-label":"批量少选计分",value:S,onChange:w,children:[f.jsx("option",{value:"keep",children:"保持不变"}),f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),S!=="ITEM_SCORE"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Yi,{label:"批量少选得分",min:0,value:T,placeholder:"保持不变",onChange:j})]})]}),d==="numbering"&&f.jsxs("label",{className:"card-field",children:["起始题号",f.jsx(ql,{label:"批量起始题号",min:1,max:1e3,value:N,onChange:M})]}),d==="average"&&f.jsxs("label",{className:"card-field",children:["所选题目总分",f.jsx(Yi,{label:"平均分配总分",max:wn.score*z.length,value:D,onChange:O})]}),d==="answers"&&f.jsxs("label",{className:"card-field card-choice-batch-answers",children:["按题目顺序录入",f.jsx(Hl,{"aria-label":"批量选择题答案",value:_,rows:3,placeholder:"每题一组,如 A BC D;- 表示清空",onChange:K=>k(K.target.value)})]}),L&&f.jsx("div",{className:"card-choice-error",role:"alert",children:L}),f.jsxs(ue,{className:"card-choice-batch-apply",type:"primary",disabled:!z.length,onClick:U,children:["应用到 ",z.length," 题"]})]})]})}function W0({value:t,document:r,creation:i,selectedId:a,onSelect:c,onChange:l,singleQuestion:u=!1}){const[d,m]=E.useState([]),[p,C]=E.useState([]),g=t.questions.find(z=>z.id===a)||t.questions[0],x=t.questions.indexOf(g),b=mu(t),v=du(t),S=Ys(r),w=new Set(t.questions.map(z=>z.options.length)).size>1,T=()=>({value:t,selectedId:g?.id}),j=(z,U=g?.id)=>{m($=>[...$.slice(-49),T()]),C([]),l({...z,source:"manual"});const K=z.questions.find($=>$.id===U)||z.questions[Math.max(0,Math.min(x,z.questions.length-1))];K&&c(K.id)},N=z=>{l(z.value),z.selectedId&&c(z.selectedId)},M=z=>j({...t,questions:t.questions.map(U=>U.id===g.id?{...U,...z}:U)}),D=z=>M(su(g,z,i)),O=z=>{const U=[...t.questions];U.splice(x,1),U.splice(x+z,0,g),j({...t,questions:U})},_=(z=!1)=>{const U=z&&g?aS(g,cu(t.questions)):{...sa(0),label:cu(t.questions)},K=[...t.questions];K.splice(x+1,0,U),j({...t,questions:K},U.id)},k=t.questions.reduce((z,U)=>z+(U.score??0),0),L=t.questions.filter(z=>typeof z.score!="number").length,B=g&&(vm(t.questions,g.id,g.label)||lu(g));return f.jsxs("div",{className:"card-choice-settings","aria-label":"选择题设置",children:[u&&f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Zt,{"aria-label":"选择题填涂位置",value:v,onChange:z=>j(fu(t,r,z)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),!u&&f.jsxs("div",{children:[f.jsxs("div",{className:"card-choice-summary","aria-label":"选择题配置概况",children:[t.questions.length," 题 · ",L===t.questions.length?"未设分":`${k} 分${L?` · ${L} 题未设分`:""}`]}),f.jsxs("label",{className:"card-field",children:["选项位置",f.jsxs(Zt,{"aria-label":"选择题填涂位置",value:v,onChange:z=>j(fu(t,r,z)),children:[f.jsx("option",{value:"concentrated",children:"集中填涂"}),f.jsx("option",{value:"stem",children:"题干前整组字母框"}),f.jsx("option",{value:"option",children:"各选项前空方框"})]})]}),f.jsxs("label",{className:"card-field",children:["题目数量",f.jsx(ql,{label:"选择题数量",min:1,max:wn.questions,value:t.questions.length,onChange:z=>{const U=t.questions.slice(0,z);for(;U.length<z;)U.push({...sa(0),label:cu(U)});j({...t,questions:U})}})]}),f.jsxs("div",{className:"card-choice-layout-fields",children:[f.jsxs("label",{className:"card-field",children:["题目排列方向",f.jsxs(Zt,{"aria-label":"填涂排列方向",value:b,onChange:z=>j({...t,direction:z}),children:[f.jsx("option",{value:"row",disabled:w,children:"横排(先右后下)"}),f.jsx("option",{value:"column",children:w?"竖排(选项数不同)":"竖排(先下后右)"})]})]}),b==="column"&&f.jsxs("label",{className:"card-field",children:["每列题数",f.jsx(ql,{label:"每列题数",min:1,max:5,value:t.rowsPerColumn,onChange:z=>j({...t,rowsPerColumn:z})})]})]})]}),g&&f.jsxs("div",{className:"card-choice-question-settings",children:[!u&&f.jsxs("label",{className:"card-field",children:["当前题目",f.jsx(Zt,{"aria-label":"当前选择题",value:g.id,onChange:c,children:t.questions.map(z=>f.jsxs("option",{value:z.id,children:["第 ",z.label," 题"]},z.id))})]}),v!=="concentrated"&&f.jsxs("label",{className:"card-field",children:["对应正文选项",f.jsxs(Zt,{"aria-label":"填涂对应正文选项",value:S.some(z=>z.id===g.contentTarget?.groupId)?g.contentTarget.groupId:"",onChange:z=>{const U=S.find(K=>K.id===z);M({contentTarget:U?{groupId:U.id,optionIds:U.options.map(K=>K.id)}:null})},children:[f.jsx("option",{value:"",children:"未指定(集中显示)"}),S.map((z,U)=>f.jsxs("option",{value:z.id,disabled:t.questions.some(K=>K.id!==g.id&&K.contentTarget?.groupId===z.id),children:["第 ",z.label||U+1," 组选项(",z.options.length," 项)"]},z.id))]})]}),!u&&f.jsxs("label",{className:"card-field",children:["题号",f.jsx(Aa,{"aria-label":"选择题题号",value:g.label,maxLength:12,onChange:z=>M({label:z.target.value})})]}),f.jsxs("label",{className:"card-field",children:["选项个数",f.jsx(ql,{label:"选择题选项个数",min:2,max:Math.max(wn.options,g.options.length),value:g.options.length,onChange:z=>D({optionCount:z})})]}),f.jsxs("label",{className:"card-field",children:["题型",f.jsxs(Zt,{"aria-label":"选择题类型",value:nS(g),onChange:z=>D({kind:z}),children:[f.jsx("option",{value:"single",children:"单选"}),f.jsx("option",{value:"multiple",children:"多选"})]})]}),!u&&f.jsxs("label",{className:"card-field",children:["本题分值",f.jsx(Yi,{label:"选择题分值",value:g.score??null,placeholder:"未设置",onChange:z=>D({score:z})})]}),g.multiple&&f.jsxs("label",{className:"card-field",children:["少选计分",f.jsxs(Zt,{"aria-label":"选择题少选计分",value:g.scoreType||"LESS_SCORE",onChange:z=>D({scoreType:z,lessScore:0}),children:[f.jsx("option",{value:"LESS_SCORE",children:"少选得分"}),f.jsx("option",{value:"ITEM_SCORE",children:"选项得分"})]})]}),g.multiple&&g.scoreType!=="ITEM_SCORE"&&typeof g.score=="number"&&f.jsxs("label",{className:"card-field",children:["少选得分",f.jsx(Yi,{label:"选择题少选得分",min:0,max:g.score,value:g.lessScore??0,onChange:z=>D({lessScore:z??0})})]}),f.jsxs("div",{className:"card-answer-key",role:"group","aria-label":"正确答案设置",children:[f.jsx("span",{children:"正确答案"}),f.jsx("div",{children:g.options.map(z=>f.jsx(ue,{type:"text","aria-label":`正确答案 ${z.label}`,"aria-pressed":g.correctIds.includes(z.id),onClick:()=>M({correctIds:g.correctIds.includes(z.id)?g.correctIds.filter(U=>U!==z.id):g.multiple?[...g.correctIds,z.id]:[z.id]}),children:z.label},z.id))})]}),g.multiple&&g.scoreType==="ITEM_SCORE"&&f.jsxs("div",{className:"card-choice-rule","aria-label":"选项得分说明",children:["每项 ",oS(g)??"—"," 分 · 错选、不选 0 分"]}),B&&f.jsx("div",{className:"card-choice-error",role:"alert",children:B}),!u&&f.jsx(Bt,{className:"card-choice-break",checked:g.breakBefore,onChange:z=>M({breakBefore:z.target.checked}),children:"此题前换行"}),!u&&f.jsxs("div",{className:"card-choice-actions",role:"group","aria-label":"选择题操作",children:[f.jsx(ue,{type:"text","aria-label":"新增选择题",title:"在当前题后新增",disabled:t.questions.length>=wn.questions,onClick:()=>_(),children:"新增"}),f.jsx(ue,{type:"text","aria-label":"复制选择题配置",title:"复制当前题的填涂与计分配置,放在其后",disabled:t.questions.length>=wn.questions,onClick:()=>_(!0),children:"复制"}),f.jsx(ue,{type:"text","aria-label":"上移选择题",disabled:x<=0,onClick:()=>O(-1),children:"上移"}),f.jsx(ue,{type:"text","aria-label":"下移选择题",disabled:x>=t.questions.length-1,onClick:()=>O(1),children:"下移"}),f.jsx(ue,{type:"text",danger:!0,"aria-label":"删除当前选择题",disabled:t.questions.length<=1,onClick:()=>{const z=t.questions.filter(U=>U.id!==g.id);j({...t,questions:z},z[Math.min(x,z.length-1)]?.id)},children:"删除"})]})]},g.id),!g&&f.jsx(ue,{className:"card-choice-actions",onClick:()=>_(),children:"新增选择题"}),!u&&f.jsx(zR,{value:t,creation:i,onChange:j}),!u&&(d.length>0||p.length>0)&&f.jsxs("div",{className:"card-choice-history",children:[f.jsx(ue,{type:"text",className:"card-choice-undo",disabled:!d.length,onClick:()=>{const z=d.at(-1);m(d.slice(0,-1)),C(U=>[...U,T()]),N(z)},children:"撤销选择题设置"}),f.jsx(ue,{type:"text",disabled:!p.length,onClick:()=>{const z=p.at(-1);C(p.slice(0,-1)),m(U=>[...U,T()]),N(z)},children:"重做"})]})]})}function Wt({label:t,children:r}){return f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:t}),r]})}function ft({label:t,value:r,min:i=0,max:a=200,step:c=1,onChange:l}){return f.jsx(Wt,{label:t,children:f.jsx(Ra,{"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 nn({label:t,value:r,min:i=.5,max:a=70,onChange:c}){return f.jsx(Wt,{label:t,children:f.jsx(Ra,{"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 fn({label:t,value:r,onChange:i,maxLength:a=200}){return f.jsx(Wt,{label:t,children:f.jsx(Aa,{"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(Wt,{label:t,children:f.jsx(Zt,{"aria-label":t,value:r,onChange:a,children:Object.entries(i).map(([c,l])=>f.jsx("option",{value:c,children:l},c))})})}function Yl({index:t,count:r,onAdd:i,onCopy:a,onDelete:c,onMove:l,name:u="小题",maximum:d=200}){return f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small","aria-label":`新增${u}`,disabled:r>=d,onClick:i,children:"新增"}),f.jsx(ue,{size:"small","aria-label":`复制当前${u}`,disabled:t<0||r>=d,onClick:a,children:"复制"}),f.jsx(ue,{size:"small","aria-label":`上移当前${u}`,disabled:t<=0,onClick:()=>l(-1),children:"↑"}),f.jsx(ue,{size:"small","aria-label":`下移当前${u}`,disabled:t<0||t>=r-1,onClick:()=>l(1),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除当前${u}`,disabled:t<0,onClick:c,children:"删除"})]})}function Xi({value:t,onEditor:r,...i}){const a=E.useRef(null),c=E.useCallback(u=>{a.current=u,r?.(u)},[r]),l=E.useRef(JSON.stringify(t));return E.useEffect(()=>{const u=JSON.stringify(t);u!==l.current&&(l.current=u,a.current&&JSON.stringify(a.current.getDocument())!==u&&a.current.syncDocument(t))},[t]),f.jsx(Gl,{ref:c,initialValue:t,...i})}function J0({value:t,onChange:r,drawing:i=!1}){const{uploadImage:a}=lt(),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=x=>r({...t,...x});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:x=>g({style:x})}),f.jsx(ft,{label:"作答行数",value:t.rows,min:0,max:120,onChange:x=>g({rows:x})}),f.jsx(ft,{label:"作答行高",value:t.rowHeight,min:16,max:80,onChange:x=>g({rowHeight:x})}),["characters","grid","coordinates"].includes(t.style)&&f.jsx(ft,{label:"每行格数",value:t.columns,min:4,max:40,onChange:x=>g({columns:x})}),t.style==="characters"&&f.jsx(ft,{label:"字数标记间隔",value:t.wordMark,min:0,max:500,onChange:x=>g({wordMark:x})})]}),f.jsx(Bt,{checked:t.title,onChange:x=>g({title:x.target.checked}),children:"标题填写区"}),i&&f.jsxs("div",{children:[f.jsx(fn,{label:"作图底图 URL",value:t.backgroundUrl,maxLength:4096,onChange:x=>g({backgroundUrl:x})}),f.jsx("input",{ref:c,type:"file",accept:"image/*",hidden:!0,onChange:async x=>{const b=x.target.files?.[0];if(x.target.value="",!!b){u(!0),m("");try{const v=a?await a(b):await new Promise((S,w)=>{const T=new FileReader;T.onload=()=>S(String(T.result)),T.onerror=()=>w(new Error("读取失败")),T.readAsDataURL(b)});if(!/^(https?:\/\/|data:image\/|blob:|\/)/i.test(v))throw new Error("图片地址无效");p.current&&C.current.onChange({...C.current.value,backgroundUrl:v})}catch{p.current&&m("图片上传失败,请重试")}finally{p.current&&u(!1)}}}}),f.jsx(ue,{size:"small",loading:l,onClick:()=>c.current?.click(),children:"上传底图"}),d&&f.jsx("p",{role:"alert",children:d})]})]})}function BR({value:t,onChange:r,correction:i=!1,practice:a=!1}){const[c,l]=E.useState(t[0]?.id),u=t.find(g=>g.id===c)||t[0],d=t.indexOf(u),m=i?"改错位置":a?"评价项":"评分点",p=g=>r(t.map(x=>x.id===u.id?{...x,...g}:x)),C=g=>{const x=g&&u?{...jo(u),label:Ur(t)}:{id:crypto.randomUUID(),label:Ur(t),score:null,prompt:"",answer:""},b=[...t];b.splice(d+1,0,x),r(b),l(x.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":`选择${m}`,children:t.map(g=>f.jsx(ue,{size:"small","aria-pressed":g.id===u?.id,onClick:()=>l(g.id),children:g.label},g.id))}),f.jsx(Yl,{name:m,maximum:20,index:d,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(la(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(fn,{label:`${m}编号`,value:u.label,onChange:g=>p({label:g})}),f.jsx(nn,{label:`${m}分值`,value:u.score,onChange:g=>p({score:g})})]}),f.jsx(fn,{label:i?"原文位置/待改文字":a?"评价维度":"作答步骤提示",value:u.prompt,onChange:g=>p({prompt:g})}),f.jsx(Wt,{label:i?"改正答案":a?"评价标准":"评分要点",children:f.jsx(Hl,{"aria-label":i?"改正答案":a?"评价标准":"评分要点",value:u.answer,autoSize:{minRows:2,maxRows:5},onChange:g=>p({answer:g.target.value})})})]})]})}function HR({value:t,onChange:r,onInsert:i}){const[a,c]=E.useState(t[0]?.id),l=t.find(p=>p.id===a)||t[0],u=t.indexOf(l),d=p=>r(t.map(C=>C.id===l.id?{...C,...p}:C)),m=p=>{const C=p&&l?{...jo(l),label:Ur(t)}:{...Em(),label:Ur(t)},g=[...t];g.splice(u+1,0,C),r(g),c(C.id)};return f.jsxs("div",{className:"exercise-blank-settings",children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择空位",children:t.map(p=>f.jsx(ue,{size:"small","aria-pressed":p.id===l?.id,onClick:()=>c(p.id),children:p.label},p.id))}),f.jsx(Yl,{name:"空位",maximum:20,index:u,count:t.length,onAdd:()=>m(!1),onCopy:()=>m(!0),onMove:p=>r(la(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(fn,{label:"空位编号",value:l.label,onChange:p=>d({label:p})}),f.jsx(nn,{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(ft,{label:"字格数量",value:l.characters,min:1,max:40,onChange:p=>d({characters:p})}),f.jsx(fn,{label:"空前提示",value:l.prefix,onChange:p=>d({prefix:p})}),f.jsx(fn,{label:"空后单位",value:l.suffix,onChange:p=>d({suffix:p})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(Bt,{checked:l.breakAfter,onChange:p=>d({breakAfter:p.target.checked}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>r(t.map(p=>({...p,width:l.width,style:l.style,characters:l.characters}))),children:"统一空位样式"})]}),f.jsx(ue,{size:"small",onClick:()=>i(l),children:"插入此空到题干"}),f.jsx(Wt,{label:"可接受答案(每行一个)",children:f.jsx(Hl,{"aria-label":"可接受答案",value:l.answers.join(`
|
|
201
201
|
`),autoSize:{minRows:2,maxRows:5},onChange:p=>d({answers:p.target.value.split(`
|
|
202
|
-
`)})})})]})]})}function eb({value:t,onChange:r,onRemove:i,category:a=!1}){const{uploadImage:c}=ct(),[l,u]=E.useState(t[0]?.id),d=t.find(g=>g.id===l)||t[0],m=t.indexOf(d),p=a?"类别":"共享选项",C=g=>{const b=g&&d?Ao(d):{id:crypto.randomUUID(),label:"",text:""},x=new Set(t.map(S=>S.label));b.label=Array.from({length:26},(S,w)=>String.fromCharCode(65+w)).find(S=>!x.has(S))||Ur(t);const v=[...t];v.splice(m+1,0,b),r(v),u(b.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs",children:t.map(g=>f.jsx(ue,{size:"small","aria-pressed":g.id===d?.id,onClick:()=>u(g.id),children:g.label},g.id))}),f.jsx(Xl,{name:p,maximum:26,index:m,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(ua(t,d.id,g)),onDelete:()=>i(d.id)}),d&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:`${p}编号`,value:d.label,onChange:g=>r(t.map(b=>b.id===d.id?{...b,label:g}:b))}),f.jsx(dn,{label:`${p}内容`,value:d.text,onChange:g=>r(t.map(b=>b.id===d.id?{...b,text:g}:b))})]}),d&&!a&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项图文/公式"}),f.jsx(Xi,{value:d.document||Vt(),ariaLabel:`共享选项 ${d.label} 图文内容`,uploadImage:c,onChange:g=>r(t.map(b=>b.id===d.id?{...b,document:g}:b))},d.id)]})]})}function PR({value:t,kind:r,item:i,onChange:a}){const c=l=>a({...t,...l});return f.jsxs("div",{children:[f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:r==="ordering"?"待排序/分类项目":"共享选项池"}),f.jsx(eb,{value:t.pool,onChange:l=>c({pool:l,sequence:[...t.sequence.filter(u=>l.some(d=>d.id===u)),...l.filter(u=>!t.sequence.includes(u.id)).map(u=>u.id)]}),onRemove:l=>a(mS(t,l))})]}),r==="matching"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"匹配呈现",value:t.matchingDisplay,options:{letters:"字母填答",lines:"左右连线"},onChange:l=>c({matchingDisplay:l})}),f.jsx(ot,{label:"对应关系",value:t.relation,options:{one:"一对一",many:"一对多"},onChange:l=>c({relation:l,items:t.items.map(u=>({...u,targets:l==="one"?u.targets.slice(0,1):u.targets}))})})]}),f.jsx(zt,{checked:t.reuseOptions,onChange:l=>{const u=new Set;c({reuseOptions:l.target.checked,items:t.items.map(d=>({...d,targets:d.targets.filter(m=>l.target.checked?!0:u.has(m)?!1:(u.add(m),!0))}))})},children:"允许选项重复使用"}),i&&f.jsx(Jt,{label:"当前题匹配答案",children:f.jsx("div",{className:"exercise-tabs",children:t.pool.map(l=>f.jsx(ue,{size:"small","aria-pressed":i.targets.includes(l.id),onClick:()=>a(pS(t,i.id,i.targets.includes(l.id)?i.targets.filter(u=>u!==l.id):[...i.targets,l.id])),children:l.label},l.id))})})]}),r==="ordering"&&f.jsxs("div",{children:[f.jsx(ot,{label:"排序或分类",value:t.ordering,options:{sequence:"排序",category:"分类"},onChange:l=>c({ordering:l})}),t.ordering==="sequence"?f.jsx("div",{className:"exercise-fields",children:t.sequence.map((l,u)=>f.jsx(ot,{label:`第 ${u+1} 位答案`,value:l,options:Object.fromEntries(t.pool.map(d=>[d.id,`${d.label}. ${d.text}`])),onChange:d=>{const m=[...t.sequence],p=m.indexOf(d);p>=0&&(m[p]=l),m[u]=d,c({sequence:m})}},u))}):f.jsxs("div",{children:[f.jsx(eb,{category:!0,value:t.categories,onChange:l=>c({categories:l}),onRemove:l=>c({categories:t.categories.filter(u=>u.id!==l),assignments:Object.fromEntries(Object.entries(t.assignments).filter(([,u])=>u!==l))})}),t.pool.map(l=>f.jsx(ot,{label:`${l.label} 所属类别`,value:t.assignments[l.id]||"",options:{"":"未设置",...Object.fromEntries(t.categories.map(u=>[u.id,`${u.label}. ${u.text}`]))},onChange:u=>c({assignments:{...t.assignments,[l.id]:u}})},l.id))]})]})]})}function UR({value:t,onChange:r}){const[i,a]=E.useState(0),c=l=>r({...t,...l});return f.jsxs("div",{children:[f.jsx(Jt,{label:"待断句原文",children:f.jsx(Pl,{"aria-label":"待断句原文",value:t.chunkText,autoSize:{minRows:3,maxRows:8},onSelect:l=>a(l.currentTarget.selectionStart),onChange:l=>r(gS(t,l.target.value))})}),f.jsx(ue,{size:"small",disabled:i<=0||i>=t.chunkText.length||t.chunkPoints.length>=26||t.chunkPoints.some(l=>l.offset===i),onClick:()=>{const l=new Set(t.chunkPoints.map(d=>d.label)),u=Array.from({length:26},(d,m)=>String.fromCharCode(65+m)).find(d=>!l.has(d));c({chunkPoints:[...t.chunkPoints,{id:crypto.randomUUID(),offset:i,label:u}].sort((d,m)=>d.offset-m.offset)})},children:"在光标处添加断点"}),f.jsx("div",{className:"exercise-chunk-points",children:t.chunkPoints.map(l=>f.jsxs("div",{children:[f.jsxs(zt,{checked:t.chunkCorrect.includes(l.id),onChange:u=>c({chunkCorrect:u.target.checked?[...t.chunkCorrect,l.id]:t.chunkCorrect.filter(d=>d!==l.id)}),children:[l.label," · ",t.chunkText.slice(Math.max(0,l.offset-4),l.offset),"|",t.chunkText.slice(l.offset,l.offset+4)]}),f.jsx(ue,{size:"small",type:"text","aria-label":`删除断点 ${l.label}`,onClick:()=>c({chunkPoints:t.chunkPoints.filter(u=>u.id!==l.id),chunkCorrect:t.chunkCorrect.filter(u=>u!==l.id)}),children:"删除"})]},l.id))}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ft,{label:"最多选择断点数",value:t.chunkMax,min:1,max:26,onChange:l=>c({chunkMax:l})}),f.jsx(rn,{label:"断句满分",value:t.groupScore,max:10,onChange:l=>c({groupScore:l})}),f.jsx(rn,{label:"每个正确断点分值",value:t.chunkScore,max:10,onChange:l=>c({chunkScore:l})})]})]})}function $R({value:t,kind:r,blockId:i,selectedId:a,onSelect:c,onChange:l}){const{card:u,uploadImage:d,insertMaterialBlank:m,geometry:p}=ct(),C=E.useRef([]),g=E.useRef([]),[,b]=E.useState(0),[x,v]=E.useState(1),[S,w]=E.useState(1),[T,j]=E.useState(null),R=t.items.find(G=>G.id===a)||t.items[0],O=t.items.indexOf(R),M=(G,te=R?.id)=>{JSON.stringify(t)!==JSON.stringify(G)&&(C.current.push({value:t,id:R?.id}),C.current=C.current.slice(-50),g.current=[],l(G),te&&c(te),b(V=>V+1))},D=G=>M({...t,...G}),_=G=>D({items:t.items.map(te=>te.id===R.id?{...te,...G}:te)}),I=G=>l({...t,items:t.items.map(te=>te.id===R.id?{...te,...G}:te)}),B=G=>{const te=G&&R?hS(R,Ur(t.items)):gu(R?.kind||yu(r),Ur(t.items)),V=[...t.items];V.splice(O+1,0,te),M({...t,items:V},te.id)},H=G=>{const te=G?g.current:C.current,V=G?C.current:g.current,Y=te.pop();if(!Y)return;V.push({value:t,id:R?.id});const L=Y.value.items.map(P=>{const N=t.items.find(U=>U.id===P.id);return N?{...P,document:N.document,reference:N.reference,explanation:N.explanation}:P});l({...Y.value,items:L}),Y.id&&c(Y.id),b(P=>P+1)},z=Cm.includes(r),$=R&&["answer","calculation","correction","drawing","writing","english"].includes(R.kind),X=yS(t,r);return f.jsxs("div",{className:"exercise-panel",children:[r!=="chunk"&&f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择当前小题",children:t.items.map(G=>f.jsx(ue,{size:"small","aria-pressed":R?.id===G.id,onClick:()=>c(G.id),children:G.label},G.id))}),f.jsx(Xl,{index:O,count:t.items.length,maximum:Em(r),onAdd:()=>B(!1),onCopy:()=>B(!0),onMove:G=>D({items:ua(t.items,R.id,G)}),onDelete:()=>{const G=t.items.filter(te=>te.id!==R.id);M({...t,items:G,chooseCount:Math.min(t.chooseCount,Math.max(1,G.length))},G[Math.max(0,O-1)]?.id)}}),f.jsxs("details",{children:[f.jsx("summary",{children:"批量配置"}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ft,{label:"追加题数",value:x,min:1,max:50,onChange:v}),f.jsx(ft,{label:"起始题号",value:S,min:1,max:1e3,onChange:w}),f.jsx(rn,{label:"统一题分",value:T,max:Math.min(70,...t.items.map(G=>Fs(G.kind))),onChange:j})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:t.items.length+x>Em(r),onClick:()=>{const G=[...t.items],te=[];for(let V=0;V<x;V++)te.push(gu(R?.kind||yu(r),Ur([...G,...te])));G.splice(O+1,0,...te),M({...t,items:G},te[0].id)},children:"追加空白题"}),f.jsx(ue,{size:"small",onClick:()=>D({items:t.items.map((G,te)=>({...G,label:String(S+te),choice:{...G.choice,label:String(S+te)}}))}),children:"连续编号"}),f.jsx(ue,{size:"small",disabled:T!==null&&t.items.some(G=>T>Fs(G.kind)),onClick:()=>D({items:t.items.map(G=>({...G,score:T,choice:{...G.choice,score:T}}))}),children:"统一分值"})]})]})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!C.current.length,onClick:()=>H(!1),children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!g.current.length,onClick:()=>H(!0),children:"重做题型配置"})]}),r==="chunk"&&f.jsx(UR,{value:t,onChange:M}),r==="optional"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ft,{label:"选做题数",value:t.chooseCount,min:1,max:Math.max(1,t.items.length),onChange:G=>D({chooseCount:G})}),f.jsx(rn,{label:"选做题组总分",value:t.groupScore,max:200,onChange:G=>D({groupScore:G})})]}),R&&r!=="chunk"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:"当前题号",value:R.label,onChange:G=>_({label:G,choice:{...R.choice,label:G}})}),f.jsx(rn,{label:"当前题分",value:R.score,max:Fs(R.kind),onChange:G=>_({score:G,choice:{...R.choice,score:G}})}),z&&r!=="cloze"&&r!=="completion"&&f.jsx(ot,{label:"小题题型",value:R.kind,options:dS,onChange:G=>_({kind:G})})]}),r==="cloze"&&f.jsx(ue,{size:"small",onClick:()=>m(i,R.id,R.label,60),children:"插入题号到公共材料"}),R.kind==="judge"&&f.jsxs("div",{children:[f.jsx(ot,{label:"判断标记",value:t.judgeLabels,options:{symbols:"√/×",letters:"T/F",words:"正确/错误"},onChange:G=>D({judgeLabels:G})}),f.jsx(Jt,{label:"正确判断",children:f.jsx("div",{className:"exercise-tabs",children:wm[t.judgeLabels].map((G,te)=>f.jsx(ue,{size:"small","aria-pressed":R.judgment===(te===0),onClick:()=>_({judgment:R.judgment===(te===0)?null:te===0}),children:G},te))})}),f.jsx(zt,{checked:R.needsReason,onChange:G=>_({needsReason:G.target.checked}),children:"判断后改正/说明理由"}),R.needsReason&&f.jsx(J0,{value:R.area,onChange:G=>_({area:G})})]}),R.kind==="choice"&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项与计分规则"}),f.jsx(W0,{value:{...mu(0),presentation:R.presentation,questions:[R.choice]},document:R.document,creation:u.creation,selectedId:R.choice.id,onSelect:()=>{},onChange:G=>{const te=G.questions.find(V=>V.id===R.choice.id);te&&_({choice:te,presentation:G.presentation,score:te.score??null})},singleQuestion:!0})]}),R.kind==="fill"&&r!=="matching"&&f.jsxs("div",{children:[f.jsx(zt,{checked:t.fillNewLine,onChange:G=>D({fillNewLine:G.target.checked}),children:"每题一行"}),f.jsx(HR,{value:R.blanks,onChange:G=>_({blanks:G}),onInsert:G=>m(i,G.id,`${R.label}.${G.label}`,p.columnWidth*G.width/100-30)})]}),$&&r!=="ordering"&&f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:"作答区域"}),f.jsx(J0,{value:R.area,drawing:R.kind==="drawing",onChange:G=>_({area:G})})]}),["answer","calculation","correction"].includes(R.kind)&&r!=="ordering"&&f.jsxs("details",{children:[f.jsx("summary",{children:r==="practice"?"评价量表":R.kind==="correction"?"改错位置与答案":"分步作答与评分点"}),f.jsx(BR,{value:R.steps,correction:R.kind==="correction",practice:r==="practice",onChange:G=>_({steps:G})})]}),R.kind==="table"&&f.jsx(ue,{size:"small",disabled:!Cn(R.document),onClick:()=>_({document:bS()}),children:"建立空白表格"}),["matching","ordering"].includes(r)&&f.jsx(PR,{value:t,kind:r,item:R,onChange:M}),f.jsxs("details",{children:[f.jsx("summary",{children:r==="matching"?"左侧项目内容":"小题正文"}),f.jsx(Xi,{value:R.document,ariaLabel:`小题 ${R.label} 正文设置`,uploadImage:d,onChange:G=>I({document:G})})]}),f.jsxs("details",{children:[f.jsx("summary",{children:"参考答案与解析"}),f.jsx(Jt,{label:"参考答案",children:f.jsx(Xi,{value:R.reference,ariaLabel:"参考答案",uploadImage:d,onChange:G=>I({reference:G})})}),f.jsx(Jt,{label:"解析",children:f.jsx(Xi,{value:R.explanation,ariaLabel:"答案解析",uploadImage:d,onChange:G=>I({explanation:G})})})]})]},R.id),r==="practice"&&f.jsx(dn,{label:"作品/音视频引用 URL",value:t.attachmentUrl,maxLength:4096,onChange:G=>D({attachmentUrl:G})}),X.length>0&&f.jsx("p",{className:"exercise-error",role:"alert",children:X.join(";")})]})}function GR({group:t,creation:r,start:i,scanMarking:a,onAdd:c}){const{card:l}=ct(),u=l.usage==="homework",d=w=>{const T=Cu(w,i,r);return t.type==="MIXED"&&w==="MCHOICE"?{...T,scoreType:t.scoreType||"LESS_SCORE",score:t.scoreType==="ITEM_SCORE"?T.score:null}:T},[m,p]=E.useState(()=>d(t.type==="MIXED"?"SCHOICE":t.type)),[C,g]=E.useState(null),[b,x]=E.useState({start:null,end:null}),v=w=>{g(null),p(T=>({...T,...w}))},S=da[m.type];return f.jsxs("div",{className:"reference-add-panel",children:[t.type==="MIXED"&&f.jsx(ot,{label:"子题题型",value:m.type,options:Object.fromEntries(Om(r,!0).map(w=>[w,cr[w]])),onChange:w=>{p(d(w)),x({start:null,end:null}),g(null)}}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(Ma,{label:"起始题号",value:b.start,min:1,max:1e3,onChange:w=>x(T=>({...T,start:w}))}),!Ti(m.type)&&f.jsx(Ma,{label:"结束题号",value:b.end,min:b.start||1,max:Math.min(1e3,(b.start||1)+S.count-1),onChange:w=>x(T=>({...T,end:w}))}),Et(m.type)&&(S.options[0]===S.options[1]?f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:"选项个数"}),f.jsx("span",{children:S.options[0]})]}):f.jsx(Ma,{label:"选项个数",value:m.optionCount,min:S.options[0],max:S.options[1],onChange:w=>v({optionCount:w})})),Be(m.type)&&f.jsx(Ma,{label:"子题数量",value:m.partCount,min:1,max:S.parts,onChange:w=>v({partCount:w})}),["FILLBLANK","SHORTANSWER"].includes(m.type)&&f.jsx(ft,{label:m.type==="FILLBLANK"?"每题空数":"每题小题数",value:m.partCount||1,min:1,max:m.type==="SHORTANSWER"&&(a||t.optional)?1:S.parts,onChange:w=>v({partCount:w})}),u&&f.jsx(zt,{checked:m.score===0,onChange:w=>v({score:w.target.checked?0:null,lessScore:0}),children:"无分值"}),f.jsx(rn,{min:u?0:.5,label:m.type==="FILLBLANK"?"每空分值":m.type==="SHORTANSWER"?"每小题分值":"每题分值",value:m.score,max:S.score,onChange:w=>v({score:w,lessScore:0})}),m.type==="MCHOICE"&&f.jsxs(E.Fragment,{children:[t.type!=="MIXED"&&f.jsx(ot,{label:"少选计分",value:m.scoreType,options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:w=>v({scoreType:w,lessScore:0})}),m.scoreType==="LESS_SCORE"&&f.jsx(ft,{label:"少选得分",value:m.lessScore,min:0,max:m.score||0,step:.5,onChange:w=>v({lessScore:w})})]}),m.type==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Ma,{label:"正确答案个数",value:m.rightAnswers,min:1,max:(m.optionCount||2)-1,onChange:w=>v({rightAnswers:w})}),f.jsx(rn,{label:"每涂对一处得分",value:m.singleScore,max:m.score||10,onChange:w=>v({singleScore:w})})]}),m.type==="CCOMPOSITION"&&f.jsx(ft,{label:"作文格数",value:m.characters,min:1,max:1200,onChange:w=>v({characters:w})}),m.type==="ECOMPOSITION"&&f.jsx(ft,{label:"作文行数",value:m.lines,min:1,max:100,onChange:w=>v({lines:w})})]}),C&&f.jsx("p",{role:"alert",className:"card-choice-error",children:C}),f.jsx(ue,{size:"small",type:"primary",onClick:()=>{if(b.start===null||!Ti(m.type)&&b.end===null){g("请输入起始题号和结束题号");return}const w={...m,start:b.start,end:Ti(m.type)?b.start:b.end},T=AS(t,w,a,u);g(T),T||c(w)},children:"添加题目"})]})}function Ma({label:t,value:r,min:i,max:a,onChange:c}){return f.jsx(Jt,{label:t,children:f.jsx(Na,{"aria-label":t,value:r,min:i,max:a,precision:0,placeholder:"请输入",onChange:c})})}function VR({value:t,onChange:r,onClose:i}){const a=t.questions.filter(x=>Et(x.type)).flatMap(x=>Be(x.type)?x.parts:[x]),[c,l]=E.useState([]),[u,d]=E.useState(!1),[m,p]=E.useState(!1),[C,g]=E.useState(2),b=()=>{const x=(v,S)=>!c.includes(v.id)||!v.text?v:{...v,text:{...v.text,layout:{...v.text.layout,indent:u,layout:m?"fixed":"natural",columns:m?C:S?4:2}}};r({...t,questions:t.questions.map(v=>({...x(v,v.type==="CLOZE"),parts:v.parts.map(S=>x(S,v.type==="CLOZE"))}))}),i()};return f.jsx(Vi,{open:!0,title:"客观题选项排版设置",width:400,className:"card-modal",closeLabel:"关闭选项排版",closeIcon:f.jsx(eo,{name:"close"}),onCancel:i,footer:f.jsxs(f.Fragment,{children:[f.jsx(ue,{onClick:i,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!c.length,onClick:b,children:"确定"})]}),children:f.jsxs("div",{className:"exercise-panel",children:[f.jsx(zt,{checked:c.length===a.length,onChange:x=>l(x.target.checked?a.map(v=>v.id):[]),children:"全选"}),f.jsx("div",{className:"exercise-fields",children:a.map(x=>f.jsxs(zt,{checked:c.includes(x.id),onChange:v=>l(S=>v.target.checked?[...S,x.id]:S.filter(w=>w!==x.id)),children:["第 ",x.label," 题"]},x.id))}),f.jsx(ot,{label:"首行缩进",value:String(u),options:{false:"否",true:"是"},onChange:x=>d(x==="true")}),f.jsx(ot,{label:"个数排版",value:String(m),options:{false:"否",true:"是"},onChange:x=>p(x==="true")}),m&&f.jsx(ot,{label:"排版方式",value:String(C),options:{4:"一行4个",2:"一行2个",1:"一行1个"},onChange:x=>g(Number(x))})]})})}function qR({block:t,value:r,selectedId:i,onSelect:a,onChange:c}){const{card:l,geometry:u,setCard:d,editQuestion:m,insertMaterialBlank:p}=ct(),[C,g]=E.useState(null),[b,x]=E.useState(!1),[v,S]=E.useState([]),[w,T]=E.useState([]),[j,R]=E.useState(""),[O,M]=E.useState(!1),D=r.questions.find(L=>L.id===i||L.parts.some(P=>P.id===i))||r.questions[0],_=r.questions.indexOf(D),I=(L,P)=>{S(N=>[...N.slice(-49),{value:r,document:t.document}]),T([]),R(""),g(null),c(L,P)},B=L=>I({...r,questions:r.questions.map(P=>P.id===L.id?L:P)}),H=ha(r),z=fu(r.layout),$=Ys(t.document),X={...r.layout,direction:l.choiceDirection||r.layout.direction,questions:H},G=pu(X),te=z!=="concentrated"?la(X,t.document,!0).concentrated.questions:[],V=K0(t),Y=L=>{const P=L.value;c({...P,questions:P.questions.map(N=>{const U=r.questions.find(J=>J.id===N.id);return U?{...N,text:U.text||N.text,document:wn(U.document,N.label,N.score),parts:N.parts.map(J=>({...J,text:U.parts.find(Q=>Q.id===J.id)?.text||J.text,document:wn(U.parts.find(Q=>Q.id===J.id)?.document||J.document,J.label,J.score)}))}:N})},OR(t.document,L.document))};return f.jsxs("div",{className:"exercise-panel reference-panel",children:[r.type==="MIXED"&&f.jsx(ot,{label:"复合题少选计分",value:r.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:L=>I({...r,scoreType:L,questions:r.questions.map(P=>P.type==="MCHOICE"?{...P,choice:{...P.choice,scoreType:L,lessScore:L==="ITEM_SCORE"?0:P.choice.lessScore}}:P)})}),H.length>0&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"选择题填涂位置",value:z,options:r.questions.some(L=>L.type==="CHUNK_CHOICE")?{concentrated:"集中填涂",stem:"题干前整组字母框"}:{concentrated:"集中填涂",stem:"题干前整组字母框",option:"各选项前空方框"},onChange:L=>{const P=hu(X,t.document,L),N=new Map(P.questions.map(U=>[U.id,U]));I({...r,layout:{...P,questions:[]},questions:r.questions.map(U=>({...U,choice:N.get(U.id)||U.choice,parts:U.parts.map(J=>({...J,choice:N.get(J.id)||J.choice}))}))})}}),f.jsx(ot,{label:"填涂排列方向",value:G,options:new Set(H.map(L=>L.options.length)).size>1?{column:"竖排(选项数不同)"}:{row:"横排(先右后下)",column:"竖排(先下后右)"},onChange:L=>d(P=>({...P,choiceDirection:L}))}),G==="column"&&f.jsx(ft,{label:"每列题数",value:r.layout.rowsPerColumn,min:1,max:5,onChange:L=>I({...r,layout:{...r.layout,rowsPerColumn:L}})}),r.textVersion===1&&l.questionCard&&r.type!=="INFO_MATCHING"&&f.jsx(ue,{size:"small",onClick:()=>M(!0),children:"选项排版"})]}),r.questions.length>0&&f.jsxs(E.Fragment,{children:[f.jsx(ot,{label:"当前题目",value:D.id,options:Object.fromEntries(r.questions.map(L=>[L.id,`${Be(L.type)?L.parts.map(P=>P.label).join("、"):L.label} · ${cr[L.type]}`])),onChange:a}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional,onClick:()=>x(L=>!L),children:"新增题目"}),f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional||Js(r)+D.parts.length-1>1e3,onClick:()=>{if(r.type==="CCOMPOSITION"||r.optional)return;const L=OS(D,Js(r)),P=[...r.questions];P.splice(_+1,0,L),I({...r,questions:P},RR(t.document,D,L)),a(L.id)},children:"复制当前题目"}),f.jsx(ue,{size:"small","aria-label":"上移当前题目",disabled:_<=0,onClick:()=>I({...r,questions:ua(r.questions,D.id,-1)}),children:"↑"}),f.jsx(ue,{size:"small","aria-label":"下移当前题目",disabled:_>=r.questions.length-1,onClick:()=>I({...r,questions:ua(r.questions,D.id,1)}),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,onClick:()=>{const L=r.questions.filter(P=>P.id!==D.id);I({...r,questions:L,optional:r.optional&&L.length>1,choose:Math.max(1,Math.min(r.choose,L.length-1))}),L.length&&a(L[Math.max(0,_-1)].id)},children:"删除当前题目"})]})]}),(!r.questions.length||b)&&f.jsx(GR,{group:r,creation:l.creation,start:Js(r),scanMarking:!!l.scanMarking,onAdd:L=>{const P=RS(r,{...L,paperWidth:u.columnWidth},D?.id);I({...P,questions:P.questions.map(N=>r.questions.some(U=>U.id===N.id)?N:{...N,halfPoint:!!l.halfPoint})}),a(P.questions.find(N=>!r.questions.some(U=>U.id===N.id)).id),x(!1)}},`${r.type}/${Js(r)}/${r.scoreType}`),r.type==="SHORTANSWER"&&r.questions.length>1&&f.jsxs(E.Fragment,{children:[f.jsx(zt,{checked:r.optional,disabled:r.questions.some(L=>L.parts.length>1),onChange:L=>I({...r,optional:L.target.checked,choose:1}),children:"是否选做"}),r.optional&&f.jsx(ft,{label:`${r.questions.length} 选`,value:r.choose,min:1,max:l.scanMarking?r.questions.length-1:1,onChange:L=>I({...r,choose:L})})]}),r.questions.length>0&&!r.optional&&r.type!=="MIXED"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(rn,{label:"分组总分",min:l.usage==="homework"?0:.5,value:C??Fn(r.questions),max:1e4,onChange:g}),f.jsx(ue,{size:"small",disabled:(C??Fn(r.questions))===null,onClick:()=>{const L=_S(r,C??Fn(r.questions),l.usage==="homework");L?I(L):R("总分无法平均分配,每题/空的分值须符合题型范围且为 0.5 的倍数")},children:"平均分配"})]}),D&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ot,{label:"编辑正文",value:V.some(L=>L.id===i)?i:D.id,options:Object.fromEntries(V.map(L=>[L.id,L.label])),onChange:L=>{a(L),m(t.id,L)}}),f.jsx(ue,{size:"small",onClick:()=>m(t.id,i||D.id),children:"编辑当前正文"})]}),te.length>0&&f.jsxs("p",{className:"card-choice-error",role:"status",children:["第 ",te.map(L=>L.label).join("、")," 题",z==="stem"?"尚未关联题干":"尚未关联完整选项",",暂保留集中填涂。"]}),D&&f.jsx(YR,{value:D,group:r,scanMarking:!!l.scanMarking,onApply:L=>{const P=r.questions.find(Q=>Q.id===L.id),N={...L,document:wn(P.document,L.label,L.score),parts:L.parts.map(Q=>({...Q,document:wn(P.parts.find(le=>le.id===Q.id)?.document||Q.document,Q.label,Q.score)}))},U=r.questions.filter(Q=>Q.id!==N.id).flatMap(Q=>Be(Q.type)?Q.parts.map(le=>le.label):[Q.label]),J=Be(N.type)?N.parts.map(Q=>Q.label):[N.label];return J.some(Q=>!Q.trim()||U.includes(Q))||new Set(J).size!==J.length?(R("题号不能为空或重复"),!1):(r.optional?I({...r,questions:r.questions.map(Q=>Q.id===N.id?N:{...Q,score:N.score,document:wn(Q.document,Q.label,N.score),parts:Q.parts.map(le=>({...le,score:N.score,document:wn(le.document,le.label,N.score)}))})}):B(N),!0)}},D.id),D&&Ei(D.type)&&f.jsxs(E.Fragment,{children:[f.jsx(zt,{checked:r.fillNewLine,onChange:L=>I({...r,fillNewLine:L.target.checked}),children:"每题一行"}),f.jsx("div",{className:"reference-part-settings",children:D.parts.map(L=>f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:`空位 ${L.label} 显示题号`,maxLength:10,value:L.label,onChange:P=>B({...D,parts:D.parts.map(N=>N.id===L.id?{...N,label:P}:N)})}),f.jsx(ot,{label:`空位 ${L.label} 宽度`,value:String(L.width),options:{...l.scanMarking?{20:"1/5 行"}:{},25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:P=>B({...D,parts:D.parts.map(N=>N.id===L.id?{...N,width:Number(P)}:N)})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",onClick:()=>p(t.id,L.id,L.label,u.columnWidth*L.width/100),children:"插入此空到正文"}),f.jsx(zt,{checked:L.breakAfter,onChange:P=>B({...D,parts:D.parts.map(N=>N.id===L.id?{...N,breakAfter:P.target.checked}:N)}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>I({...r,questions:r.questions.map(P=>Ei(P.type)?{...P,parts:P.parts.map(N=>({...N,width:L.width}))}:P)}),children:"宽度统一设置"})]})]},L.id))})]}),D&&Et(D.type)&&f.jsx(E.Fragment,{children:(Be(D.type)?D.parts.map(L=>L.choice):[D.choice]).map(L=>f.jsxs("div",{children:[f.jsxs(zt,{checked:L.breakBefore,onChange:P=>{const N={...L,breakBefore:P.target.checked};B({...D,choice:D.choice.id===L.id?N:D.choice,parts:D.parts.map(U=>U.choice.id===L.id?{...U,choice:N}:U)})},children:[L.label," 题前换行"]}),z==="option"&&r.textVersion!==1&&f.jsx(ot,{label:`${L.label} 题对应正文选项`,value:L.contentTarget?.groupId||"",options:{"":"按正文归属匹配",...Object.fromEntries($.map((P,N)=>[P.id,`第 ${P.label||N+1} 组选项`]))},onChange:P=>{const N=$.find(J=>J.id===P),U={...L,contentTarget:N?{groupId:P,optionIds:N.options.map(J=>J.id)}:null};B({...D,choice:D.choice.id===L.id?U:D.choice,parts:D.parts.map(J=>J.choice.id===L.id?{...J,choice:U}:J)})}})]},L.id))}),j&&f.jsx("p",{className:"card-choice-error",role:"alert",children:j}),O&&f.jsx(VR,{value:r,onChange:I,onClose:()=>M(!1)}),(v.length>0||w.length>0)&&f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!v.length,onClick:()=>{const L=v.at(-1);S(v.slice(0,-1)),T(P=>[...P,{value:r,document:t.document}]),Y(L)},children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!w.length,onClick:()=>{const L=w.at(-1);T(w.slice(0,-1)),S(P=>[...P,{value:r,document:t.document}]),Y(L)},children:"重做题型配置"})]})]})}function YR({value:t,group:r,scanMarking:i,onApply:a}){const{card:c}=ct(),[l,u]=E.useState(null),[d,m]=E.useState(""),p=l||t,C=w=>{u({...p,...w}),m("")},g=p.type,b=da[g],x=p.choice.options.length,v=p.parts.length,S=w=>{const T=Array.from({length:w},(j,R)=>p.parts[R]||ji(Be(g)?String(Number(p.parts[0]?.label||p.label)+R):w===1?p.label:`${p.label}.${R+1}`,p.parts[0]?.score??null,g,p.choice.options.length));Be(g)||T.forEach((j,R)=>{T[R]={...j,label:w===1?p.label:`${p.label}.${R+1}`}}),C({parts:T,score:Fn(T)})};return f.jsxs("div",{className:"reference-question-settings",children:[f.jsxs("div",{className:"exercise-fields",children:[r.type!=="MIXED"&&["SCHOICE","MCHOICE"].includes(g)&&f.jsx(ot,{label:"题型",value:g,options:{SCHOICE:"单选题",MCHOICE:"多选题"},onChange:w=>{const T=w==="MCHOICE"&&xi(c.creation)&&p.score===null?6:p.score;C({type:w,score:T,choice:{...fa(p.choice,w,x),score:T,scoreType:w==="MCHOICE"&&xi(c.creation)?"ITEM_SCORE":"LESS_SCORE",lessScore:0}})}}),!Be(g)&&f.jsx(dn,{label:"题目题号",value:p.label,maxLength:10,onChange:w=>C({label:w,choice:{...p.choice,label:w},parts:p.parts.map((T,j)=>({...T,label:p.parts.length===1?w:`${w}.${j+1}`}))})}),Et(g)&&f.jsx(ft,{label:"选项个数",min:b.options[0],max:b.options[1],value:x,onChange:w=>C({choice:fa(p.choice,g,w),parts:p.parts.map(T=>({...T,choice:fa(T.choice,g,w)}))})}),v>0&&(g==="INFO_MATCHING"||r.type==="MIXED")&&f.jsx(Jt,{label:"子题数量",children:f.jsx("span",{children:v})}),v>0&&g!=="INFO_MATCHING"&&r.type!=="MIXED"&&f.jsx(ft,{label:Be(g)?"子题数量":g==="FILLBLANK"?"每题空数":"每题小题数",value:v,min:1,max:g==="SHORTANSWER"&&(i||r.optional)?1:b.parts,onChange:S}),c.usage==="homework"&&f.jsx(zt,{checked:p.score===0,onChange:w=>{const T=w.target.checked?0:null;C({score:T,choice:{...p.choice,score:T,lessScore:0},parts:p.parts.map(j=>({...j,score:T,choice:{...j.choice,score:T,lessScore:0}}))})},children:"无分值"}),!v&&f.jsx(rn,{min:c.usage==="homework"?0:.5,label:"本题分值",value:p.score,max:b.score,onChange:w=>C({score:w,choice:{...p.choice,score:w,lessScore:0}})}),Be(g)&&f.jsx(rn,{min:c.usage==="homework"?0:.5,label:"每题分值",value:p.parts[0]?.score??null,max:b.score,onChange:w=>{const T=p.parts.map(j=>({...j,score:w,choice:{...j.choice,score:w}}));C({parts:T,score:Fn(T)})}}),g==="MCHOICE"&&f.jsxs(E.Fragment,{children:[r.type!=="MIXED"&&f.jsx(ot,{label:"少选计分",value:p.choice.scoreType||"LESS_SCORE",options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:w=>C({choice:{...p.choice,scoreType:w,lessScore:0}})}),p.choice.scoreType!=="ITEM_SCORE"&&f.jsx(ft,{label:"少选得分",min:0,max:p.score||0,step:.5,value:p.choice.lessScore||0,onChange:w=>C({choice:{...p.choice,lessScore:w}})})]}),g==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Ma,{label:"正确答案个数",value:p.rightAnswers,min:1,max:x-1,onChange:w=>C({rightAnswers:w})}),f.jsx(rn,{label:"每涂对一处得分",value:p.singleScore,max:p.score||10,onChange:w=>C({singleScore:w})})]}),g==="CCOMPOSITION"&&f.jsx(ft,{label:"作文格数",value:p.characters,min:1,max:1200,onChange:w=>C({characters:w})}),g==="ECOMPOSITION"&&f.jsx(Jt,{label:"初始作文行数",children:f.jsx("span",{children:p.lines})}),g==="CCOMPOSITION"&&f.jsx(ft,{label:"题干区域高度",value:p.contentHeight,min:38,max:Number.MAX_SAFE_INTEGER,onChange:w=>C({contentHeight:w})})]}),p.parts.map((w,T)=>f.jsxs("div",{className:"exercise-fields",children:[f.jsx(dn,{label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}题号`,value:w.label,maxLength:10,onChange:j=>C({parts:p.parts.map(R=>R.id===w.id?{...R,label:j,choice:{...R.choice,label:j}}:R)})}),!Be(g)&&f.jsx(rn,{min:c.usage==="homework"?0:.5,label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}分值`,value:w.score,max:b.score,onChange:j=>{const R=p.parts.map(O=>O.id===w.id?{...O,score:j,choice:{...O.choice,score:j}}:O);C({parts:R,score:Fn(R)})}}),["FILLBLANK","SHORTANSWER"].includes(g)&&r.type!=="MIXED"&&!r.optional&&v>1&&f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}`,onClick:()=>{const j=p.parts.filter(R=>R.id!==w.id).map((R,O)=>({...R,label:v===2?p.label:`${p.label}.${O+1}`}));C({parts:j,score:Fn(j)})},children:"删除"}),g==="SHORTANSWER"&&!r.optional&&f.jsx(ft,{label:`第 ${T+1} 小题作答高度`,value:w.height,min:30,max:Number.MAX_SAFE_INTEGER,onChange:j=>C({parts:p.parts.map(R=>R.id===w.id?{...R,height:j}:R)})})]},w.id)),p.parts.length>0&&f.jsx(Jt,{label:"本题总分",children:f.jsx("span",{children:p.score??"未设置"})}),!Et(g)&&!Ei(g)&&f.jsx(zt,{checked:p.halfPoint,onChange:w=>C({halfPoint:w.target.checked}),children:"计分栏显示 0.5"}),d&&f.jsx("p",{className:"card-choice-error",role:"alert",children:d}),f.jsx(ue,{size:"small",disabled:!l,onClick:()=>{if((v?p.parts:[p]).some(w=>w.score===null||w.score<(c.usage==="homework"?0:.5)||w.score>b.score)){m("请填写符合题型范围的分值");return}if(p.parts.some(w=>!w.label.trim())){m("题号不能为空");return}if(g==="INFO_MATCHING"&&v>x){m("选项个数需大于等于子题数量");return}if(g==="CHUNK_CHOICE"&&(!p.rightAnswers||p.rightAnswers>=x||p.singleScore===null||p.score!==null&&p.score!==0&&p.rightAnswers*p.singleScore>p.score)){m("正确答案个数须小于选项数,且每处得分之和不能超过题分");return}if(g==="MCHOICE"&&(p.choice.lessScore||0)>(p.score||0)){m("少选得分不能超过本题分值");return}a(p)&&u(null)},children:"应用配置"})]})}function XR({block:t,autoFocus:r,onClose:i}){const{card:a,geometry:c,setCard:l,setSelectedId:u,setDeleted:d,updateBlock:m,editQuestion:p,selectedChoiceId:C,selectChoice:g}=ct(),{dialog:b,setDialog:x,titleProps:v,cancelDrag:S}=ql(O=>{const M=O.closest(".card-workspace")?.querySelector(".card-sidebar")?.getBoundingClientRect();return{left:(M?.left??window.innerWidth)-O.getBoundingClientRect().width-12,top:(M?.top??0)+12}}),w=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);E.useLayoutEffect(()=>{if(!b)return;const O=b;O.setAttribute("aria-modal","false"),O.setAttribute("aria-labelledby","card-block-modal-title");let M=document.activeElement instanceof HTMLElement?document.activeElement:null;const D=_=>{_.target instanceof HTMLElement&&!O.contains(_.target)&&(M=_.target)};return document.addEventListener("focusin",D),()=>{document.removeEventListener("focusin",D),O.contains(document.activeElement)&&M?.isConnected&&M.focus({preventScroll:!0})}},[b]),E.useLayoutEffect(()=>{b&&(b.dataset.settingsBlock=t.id)},[b,t.id]);const T=f.jsxs("div",{...v,className:"card-modal-drag","aria-label":"拖动题块设置",title:"拖动移动;方向键微调,Home 复位","data-editor-menu-avoid":!0,children:[f.jsx("h2",{id:"card-block-modal-title",children:"题块设置"}),f.jsx("p",{"aria-hidden":"true",children:t.reference?cr[t.reference.type]:jm[t.kind]})]}),j=()=>{d({block:t,index:a.blocks.findIndex(O=>O.id===t.id)}),l(O=>({...O,blocks:O.blocks.filter(M=>M.id!==t.id)})),u(null),i()},R=f.jsxs("div",{className:"card-modal-actions",children:[f.jsxs(ue,{type:"text",danger:!0,className:"card-delete","aria-label":"删除选中题块",onClick:j,children:[f.jsx(eo,{name:"trash",size:16}),"删除题块"]}),f.jsx(ue,{type:"text",onClick:()=>{const O=Ao(t);l(M=>{const D=[...M.blocks];return D.splice(D.findIndex(_=>_.id===t.id)+1,0,O),{...M,blocks:D}}),u(O.id)},children:"复制题块"}),f.jsx(ue,{type:"primary",className:"card-edit-question",onClick:()=>p(t.id),children:t.areaType?"编辑文字":"编辑题目"})]});return f.jsx(Vi,{open:!0,modal:!1,panelRef:x,className:"card-modal card-block-modal",width:400,zIndex:900,classNames:{header:"card-modal-header",body:"card-modal-body card-inspector",footer:"card-modal-footer"},closeLabel:"关闭题块设置",closeIcon:f.jsx(eo,{name:"close",size:16}),onCancel:i,onOpenAutoFocus:O=>{O.preventDefault(),r?b?.querySelector(".ui-dialog-close")?.focus({preventScroll:!0}):w.current?.focus({preventScroll:!0})},onEscapeKeyDown:O=>{O.preventDefault(),O.stopPropagation(),S()||i()},title:T,footer:R,children:f.jsxs("div",{children:[f.jsxs("label",{className:"card-field",children:["标题",f.jsx(Oa,{"aria-label":"题块标题",value:t.title,maxLength:300,onChange:O=>m(t.id,{title:O.target.value})})]}),t.reference&&f.jsx(qR,{block:t,value:t.reference,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:(O,M)=>m(t.id,{reference:O,...M?{document:M}:{}})}),!t.reference&&t.kind==="choice"&&t.choices&&f.jsx(W0,{value:t.choices,document:t.document,creation:a.creation,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:O=>m(t.id,{choices:O})}),t.kind==="area"&&f.jsx(ft,{label:"区域高度",min:100,max:t.areaType==="forbiden"?Math.floor(c.contentHeight):4e3,value:t.answerHeight,onChange:O=>m(t.id,{answerHeight:O})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&t.exercise&&f.jsx($R,{value:t.exercise,kind:t.kind,blockId:t.id,selectedId:C(t),onSelect:O=>g(t.id,O),onChange:O=>m(t.id,{exercise:O})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&!t.exercise&&f.jsxs("div",{className:"card-range",children:["作答区高度 ",f.jsxs("b",{children:[t.answerHeight," px"]}),f.jsx(P0,{className:"ui-slider",ariaLabelForHandle:"作答区高度",min:0,max:800,step:10,value:t.answerHeight,onChange:O=>m(t.id,{answerHeight:O})}),f.jsx(ue,{size:"small",onClick:()=>{if(t.kind==="choice"||t.kind==="area")return;const O=fS(t.kind);O.items[0].area.rows=Math.ceil(t.answerHeight/O.items[0].area.rowHeight),m(t.id,{exercise:O})},children:"启用题型配置"})]})]},t.id)})}function KR(t){const r=new URLSearchParams(location.search);return{mode:r.get("mode")==="exam"?"exam":"template",name:(r.get("name")||"").slice(0,30),...xm(t,{gradeCode:r.get("gradeCode")||void 0,courseCode:r.get("courseCode")||void 0,grade:r.get("grade")||void 0,subject:r.get("subject")||void 0}),...r.get("id")?{id:r.get("id")}:{},...r.get("exampaperId")?{exampaperId:r.get("exampaperId")}:{}}}function FR({initial:t,dictionary:r,replacing:i,onCreate:a,onClose:c}){const[l,u]=E.useState(t),d={...l,...xm(r,l)},m=r.gradeCourseMap[d.gradeCode]||[],[p,C]=E.useState(""),g=E.useId(),b=E.useRef(null),{dialog:x,setDialog:v,titleProps:S}=ql();E.useLayoutEffect(()=>{x?.setAttribute("aria-labelledby",`${g}-title`)},[x,g]);const w=f.jsx("div",{...S,className:"card-modal-drag","aria-label":"拖动新建答题卡",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:`${g}-title`,children:"新建答题卡"})});return f.jsx(Vi,{open:!0,panelRef:v,width:460,className:"card-modal card-create-modal",title:w,closeLabel:"关闭新建答题卡",closeIcon:f.jsx(eo,{name:"close",size:16}),onCancel:c,onOpenAutoFocus:T=>{T.preventDefault(),b.current?.focus({preventScroll:!0})},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ue,{onClick:c,children:"取消"}),f.jsx(ue,{type:"primary",htmlType:"submit",form:g,disabled:!d.gradeCode||!d.courseCode,children:"确定"})]}),children:f.jsxs("form",{id:g,onSubmit:T=>{if(T.preventDefault(),!d.name.trim()){C("请输入题卡名称"),b.current?.focus();return}if(!d.gradeCode||!d.courseCode){C("没有可用的年级和课程");return}a({...d,name:d.name.trim()})},children:[f.jsx("div",{className:"card-create-mode",role:"group","aria-label":"创建用途",children:["template","exam"].map(T=>f.jsx(ue,{type:d.mode===T?"primary":"default","aria-pressed":d.mode===T,onClick:()=>u(j=>({...j,mode:T})),children:T==="template"?"答题卡模板":"考试答题卡"},T))}),f.jsxs("label",{className:"card-field",children:["题卡名称",f.jsx(Oa,{ref:b,"aria-label":"题卡名称",status:p?"error":void 0,"aria-invalid":!!p,"aria-describedby":p?"card-create-error":void 0,placeholder:"请输入题卡名称",maxLength:30,value:d.name,onChange:T=>{u(j=>({...j,name:T.target.value})),C("")}})]}),f.jsxs("div",{className:"card-create-subject",children:[f.jsxs("label",{className:"card-field",children:["年级",f.jsx(Wt,{"aria-label":"年级",value:d.gradeCode,disabled:!r.grades.length,onChange:T=>u(j=>({...j,...bi(r,T,r.gradeCourseMap[T][0].value)})),children:r.grades.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]}),f.jsxs("label",{className:"card-field",children:["科目",f.jsx(Wt,{"aria-label":"科目",value:d.courseCode,disabled:!m.length,onChange:T=>u(j=>({...j,...bi(r,d.gradeCode,T)})),children:m.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]})]}),!r.grades.length&&f.jsx("p",{className:"card-create-error",role:"alert",children:"没有可用的年级和课程"}),p&&f.jsx("p",{id:"card-create-error",className:"card-create-error",role:"alert",children:p}),i&&f.jsx("p",{className:"card-section-note",children:"确定后将新建空白题卡并替换当前内容。"})]})})}function QR(){const{card:t,setCard:r,setQuestionCard:i,readOnly:a,geometry:c}=ct(),l=u=>r(d=>d.header?{...d,header:{...d.header,...u}}:d);return f.jsxs("div",{className:"card-sidebar-section card-paper-settings",children:[f.jsx("h1",{children:"页面布局"}),f.jsx("div",{className:"card-preset-grid",children:Object.keys(vi).map((u,d)=>f.jsxs(ue,{type:"text","aria-label":vi[u].label,"aria-pressed":t.preset===u,disabled:a,onClick:()=>r(m=>({...m,preset:u})),children:[f.jsx("span",{className:`card-paper-icon cols-${vi[u].columns}`,children:Array.from({length:vi[u].columns},(m,p)=>f.jsx("i",{},p))}),f.jsx("span",{children:["一栏","两栏","三栏"][d]})]},u))}),f.jsx("p",{className:"card-section-note",children:c.columns===1?"一栏适用于 A4、16K 纸张":`${c.columns===2?"二":"三"}栏适用于 A3、8K 纸张`}),f.jsxs("div",{className:"card-paper-options",children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡用途"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:t.usage||"exam",onChange:u=>r(d=>({...d,usage:u.target.value})),children:[f.jsx(Ye.Button,{value:"exam",children:"考试"}),f.jsx(Ye.Button,{value:"homework",children:"作业"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"批阅模式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.scanMarking,onChange:u=>r(d=>({...d,scanMarking:u.target.value,blocks:d.blocks.map(m=>m.reference?.optional&&!u.target.value?{...m,reference:{...m.reference,choose:1}}:m)})),children:[f.jsx(Ye.Button,{value:!1,children:"手阅"}),f.jsx(Ye.Button,{value:!0,children:"网阅"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"分值 0.5"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.halfPoint,onChange:u=>r(d=>({...d,halfPoint:u.target.value,blocks:d.blocks.map(m=>m.reference?{...m,reference:{...m.reference,questions:m.reference.questions.map(p=>({...p,halfPoint:u.target.value}))}}:m)})),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡合一"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:"question-card",disabled:a,value:t.questionCard!==!1,onChange:u=>i(u.target.value),children:[f.jsx(Ye.Button,{value:!0,children:"是"}),f.jsx(Ye.Button,{value:!1,children:"否"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题排列"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:t.choiceDirection||"row",onChange:u=>r(d=>({...d,choiceDirection:u.target.value})),children:[f.jsx(Ye.Button,{value:"row",children:"横排"}),f.jsx(Ye.Button,{value:"column",children:"竖排"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题合并"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.mergeObjective,onChange:u=>r(d=>({...d,mergeObjective:u.target.value})),children:[f.jsx(Ye.Button,{value:!1,children:"不合并"}),f.jsx(Ye.Button,{value:!0,children:"合并"})]})]}),t.header&&f.jsxs(E.Fragment,{children:[[["subjectMarkers","学科标记"],["pointBlack","辅助识别点"],["examQrCode","试卷二维码"]].filter(([u])=>u!=="pointBlack"||t.usage!=="homework").map(([u,d])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:d}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",disabled:a,value:u==="subjectMarkers"?t.recognition?.[u]!==!1:!!t.recognition?.[u],onChange:m=>r(p=>({...p,recognition:{...p.recognition,[u]:m.target.value}})),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]},u)),t.recognition?.examQrCode&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"试卷 ID"}),f.jsx(Oa,{"aria-label":"二维码试卷 ID",value:String(t.creation?.exampaperId??""),disabled:a,maxLength:128,onChange:u=>r(d=>d.creation?{...d,creation:{...d.creation,exampaperId:u.target.value||void 0}}:d)})]}),t.usage!=="homework"&&f.jsxs(E.Fragment,{children:[[["focusText","注意事项"],["writeKaohao","考场/座位号"],["missExam","填涂标记"],["mifeng","密封线"]].map(([u,d])=>f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:d}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:`header-${u}`,disabled:a,value:t.header[u],onChange:m=>l({[u]:m.target.value}),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]},u)),f.jsxs("fieldset",{className:"card-setting-row card-exam-number-setting",disabled:a,children:[f.jsx("legend",{children:"考号版式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",name:"header-kaohao",disabled:a,value:t.header.kaohao,onChange:u=>l({kaohao:u.target.value}),children:[f.jsx(Ye.Button,{value:"code",children:"条形码"}),f.jsx(Ye.Button,{value:"school",children:"校内准考证号"})]})]}),t.header.kaohao==="school"&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"考号位数"}),f.jsx(Wt,{"aria-label":"准考证号位数",size:"small",disabled:a,value:t.header.weishu,onChange:u=>l({weishu:Number(u)}),children:Array.from({length:9},(u,d)=>f.jsxs("option",{value:d+4,children:[d+4,"位"]},d))})]})]}),t.usage==="homework"&&f.jsxs(E.Fragment,{children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"作业考号版式"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",value:t.header.tiaomaStyle||1,onChange:u=>l({tiaomaStyle:u.target.value}),children:[f.jsx(Ye.Button,{value:1,children:"填涂"}),f.jsx(Ye.Button,{value:2,children:"条形码"})]})]}),t.header.tiaomaStyle!==2&&f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"班级填涂"}),f.jsxs(Ye.Group,{className:"card-radio-options",size:"small",value:t.header.classText!==!1,onChange:u=>l({classText:u.target.value}),children:[f.jsx(Ye.Button,{value:!0,children:"显示"}),f.jsx(Ye.Button,{value:!1,children:"不显示"})]})]})]})]})]})]})}function tb({settings:t,activeQuestionId:r}){if(!t.questions.length)return null;const i=pu(t),a=l=>f.jsxs("div",{className:`card-choice-row${l.id===r?" is-current-choice":""}`,"data-question-id":l.id,"aria-current":l.id===r?"true":void 0,children:[f.jsxs("b",{children:[l.label,"."]}),f.jsx("div",{className:"card-choice-options","data-marker":t.marker,children:l.options.map(u=>f.jsx("span",{className:"card-choice-glyph","data-recognition":"MultiChoice","data-recognition-role":"cell","data-answer-id":l.id,"data-option-id":u.id,"data-value":u.label,"data-marker":t.marker,children:t.marker==="check"?`○ ${u.label}.`:u.label},u.id))})]},l.id),c=[[]];for(const l of t.questions)l.breakBefore&&c[c.length-1].length&&c.push([]),c[c.length-1].push(l);return f.jsx("div",{className:"card-choice-grid","aria-label":"选择题填涂区",style:{rowGap:t.rowGap,columnGap:t.columnGap},"data-direction":i,children:i==="column"?cS(t).map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{columnGap:t.columnGap,rowGap:t.rowGap},children:l.map(d=>f.jsx("div",{className:"card-choice-column",style:{gap:t.rowGap,minHeight:t.rowsPerColumn*20+(t.rowsPerColumn-1)*t.rowGap},children:d.map(a)},d[0].id))},u)):c.map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{rowGap:t.rowGap,columnGap:t.columnGap},children:l.map(a)},u))})}function nb(t){const r=t.getBoundingClientRect(),i=getComputedStyle(t),a=u=>Math.round(u*64)/64,c=a(parseFloat(i.width)+(i.boxSizing==="border-box"?0:parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth))),l=c>0&&r.width>0?r.width/c:1;return u=>{const d=u.getBoundingClientRect();let m=0;for(let p=u;p&&p!==t;p=p.parentElement)m+=parseFloat(p.style.translate.split(/\s+/)[1])||0;return{top:a((d.top-r.top)/l-m),height:a(d.height/l),width:a(d.width/l)}}}function rb(t){return nb(t.closest(".card-question")||t)(t)}function ZR(t){return rb(t).top}function Kl({id:t,label:r,value:i,visible:a,readOnly:c,placement:l,onUnits:u,onChange:d,onActiveFragment:m,uploadImage:p,choiceFillPosition:C,choiceFillBindings:g,activeChoiceQuestionId:b,contentTargets:x,editorKeys:v,onContentSelect:S}){const{geometry:w,registerEditor:T}=ct(),j=JSON.stringify(v||[]),R=E.useCallback(X=>{JSON.parse(j).forEach(G=>T(`content/${G}`,X))},[j,T]),O=E.useRef(null),M=E.useRef(!1);a&&(M.current=!0);const D=E.useRef([]),[_,I]=E.useState(0),B=E.useRef({id:t,visible:a,onUnits:u});B.current={id:t,visible:a,onUnits:u};const H=E.useCallback(()=>{const X=O.current?.querySelector(".rt-content"),G=X?ZR(X):0;I(te=>Math.abs(te-G)<.5?te:G),B.current.onUnits(B.current.id,B.current.visible?D.current.map(te=>({top:te.top+G,bottom:te.bottom+G})):[])},[]),z=E.useCallback(X=>{D.current=X,H()},[H]);E.useLayoutEffect(()=>{H()},[H,a,l.fragments,i]),E.useLayoutEffect(()=>()=>B.current.onUnits(B.current.id,[]),[]);const $=E.useMemo(()=>l.fragments.map(X=>({from:X.from-_,to:X.to-_,x:X.x-l.x,y:X.y-l.y-X.from+(X.topPadding||0)})),[l.fragments,l.x,l.y,_]);return f.jsx("div",{ref:O,className:"exercise-text",hidden:!a,children:M.current&&f.jsx(Xi,{value:i,readOnly:c||!a,uploadImage:p,ariaLabel:r,onChange:d,onEditor:R,contentTargets:x,allowContentAssignment:!1,onContentSelect:S,pagination:{slices:$,maxUnitHeight:w.contentHeight-80,onMeasure:z,onActiveSliceChange:m},choiceFillPosition:C,choiceFillBindings:g,activeChoiceQuestionId:b})})}function WR({rows:t,rowHeight:r,label:i,onChange:a}){const{scale:c}=ct(),l=E.useRef(null),u=()=>{l.current&&a(l.current.rows),l.current=null};return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":`调整 ${i} 题作答高度`,title:"拖动调整作答高度",onPointerDown:d=>{d.preventDefault(),d.stopPropagation(),d.currentTarget.focus(),l.current={y:d.clientY,rows:t},d.currentTarget.setPointerCapture(d.pointerId)},onPointerMove:d=>{l.current&&a(Math.max(1,Math.min(120,l.current.rows+Math.round((d.clientY-l.current.y)/c/r))))},onPointerUp:d=>{l.current=null,d.currentTarget.releasePointerCapture(d.pointerId)},onPointerCancel:u,onLostPointerCapture:()=>{l.current=null},onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),u()),["ArrowUp","ArrowDown"].includes(d.key)&&(d.preventDefault(),a(Math.max(1,Math.min(120,t+(d.key==="ArrowDown"?1:-1)))))}})}function ob({blank:t,item:r,active:i,fullLabel:a=!1}){return f.jsxs("div",{style:{width:`${t.width}%`},className:`exercise-flow-unit exercise-blank${i?" is-current":""}`,"data-exercise-id":r.id,"data-answer-id":t.id,children:[f.jsxs("span",{children:[a?`${r.label}.${t.label}`:`(${t.label})`," ",t.prefix]}),f.jsx("span",{className:`exercise-blank-space ${t.style}`,children:t.style==="characters"&&Array.from({length:t.characters},(c,l)=>f.jsx("i",{},l))}),f.jsx("span",{children:t.suffix})]})}function JR({area:t,item:r,active:i,readOnly:a,onResize:c,prefix:l=""}){const u={"--area-columns":t.columns,"--area-line":`${t.rowHeight}px`};return f.jsxs("div",{className:"exercise-area","data-style":t.style,style:u,children:[t.title&&f.jsxs("div",{className:`exercise-flow-unit exercise-title-line${i?" is-current":""}`,"data-exercise-id":r.id,children:["题目:",f.jsx("span",{})]}),Array.from({length:t.rows},(d,m)=>f.jsxs("div",{className:`exercise-flow-unit exercise-area-row${i?" is-current":""}`,"data-exercise-id":r.id,"data-area-row":m,style:{height:t.rowHeight,...t.backgroundUrl?{backgroundImage:`url(${JSON.stringify(t.backgroundUrl)})`,backgroundSize:`100% ${t.rows*t.rowHeight}px`,backgroundPosition:`0 -${m*t.rowHeight}px`}:{}},children:[l&&m===0&&f.jsx("span",{className:"exercise-area-prefix",children:l}),t.style==="characters"&&Array.from({length:t.columns},(p,C)=>{const g=m*t.columns+C+1;return f.jsx("span",{className:"exercise-character",children:t.wordMark>0&&g%t.wordMark===0&&f.jsxs("small",{children:[g,"字"]})},C)}),t.style==="coordinates"&&m===Math.floor(t.rows/2)&&f.jsx("span",{className:"exercise-axis-x",children:"x →"}),t.style==="coordinates"&&m===0&&f.jsx("span",{className:"exercise-axis-y",children:"↑ y"})]},m)),!a&&t.rows>0&&f.jsx(WR,{rows:t.rows,rowHeight:t.rowHeight,label:r.label,onChange:c})]})}function eO({value:t,kind:r,placement:i,showQuestion:a,readOnly:c,activeId:l,onUnits:u,onChange:d,onActiveFragment:m,uploadImage:p}){const C=(S,w="")=>`exercise-flow-unit ${w}${S===l?" is-current":""}`,g=t.pool,b=E.useMemo(()=>new Map(t.items.filter(S=>S.kind==="choice").map(S=>[S.id,la({...mu(0),presentation:S.presentation,questions:[S.choice]},S.document,a)])),[t.items,a]),x=(S=!1)=>g.map(w=>f.jsxs("div",{className:"exercise-pool-entry",children:[f.jsxs("div",{className:"exercise-flow-unit exercise-pool-option","data-pool-id":w.id,children:[S?"● ":"",w.label,". ",a?w.text:""]}),w.document&&f.jsx(Kl,{id:`pool/${w.id}`,label:`共享选项 ${w.label} 正文`,value:w.document,visible:a,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:T=>d({...t,pool:t.pool.map(j=>j.id===w.id?{...j,document:T}:j)})})]},w.id)),v=["fill","completion"].includes(r)&&(!a||t.items.every(S=>Cn(S.document)));if(r==="chunk"){let S=0;const w=t.chunkPoints.map(T=>{const j=t.chunkText.slice(S,T.offset);return S=T.offset,{text:j,...T}});return f.jsxs("div",{className:"exercise-content",children:[f.jsx(Kl,{id:"chunk-material",label:"断句题面",value:{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:w.map(T=>`${T.text}〔${T.label}〕`).join("")+t.chunkText.slice(S)||" "}]}]}},visible:a,readOnly:!0,placement:i,onUnits:u,onChange:()=>{},onActiveFragment:m}),f.jsxs("div",{className:"exercise-flow-unit exercise-chunk-answer",children:[t.chunkPoints.map(T=>f.jsx("span",{className:"exercise-mark","data-answer-id":T.id,children:T.label},T.id)),f.jsxs("span",{children:["(最多选 ",t.chunkMax," 处)"]})]})]})}return f.jsxs("div",{className:"exercise-content","data-exercise-kind":r,children:[v&&f.jsx("div",{className:"exercise-blanks",children:t.items.map(S=>f.jsxs(E.Fragment,{children:[S.blanks.map(w=>f.jsxs(E.Fragment,{children:[f.jsx(ob,{blank:w,item:S,active:S.id===l,fullLabel:!0}),w.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},w.id)),t.fillNewLine&&f.jsx("span",{className:"exercise-line-break"})]},S.id))}),r==="optional"&&f.jsxs("div",{className:"exercise-flow-unit exercise-optional-head",children:["从以下 ",t.items.length," 题中选做 ",t.chooseCount," 题",t.groupScore!==null?`,共 ${t.groupScore} 分`:"","。",f.jsxs("span",{children:["选做题号:",t.items.map(S=>f.jsx("span",{className:"exercise-mark","data-exercise-id":S.id,children:S.label},S.id))]})]}),["matching","ordering"].includes(r)&&a&&(r!=="matching"||t.matchingDisplay==="letters")&&x(),f.jsxs("div",{hidden:v,className:r==="matching"&&t.matchingDisplay==="lines"?"exercise-matching-layout":void 0,children:[f.jsx("div",{children:r==="ordering"?f.jsx("div",{children:t.ordering==="sequence"?f.jsxs("div",{className:"exercise-flow-unit exercise-sequence",children:["排序:",g.map((S,w)=>f.jsxs("span",{children:[f.jsx("span",{className:"exercise-order-slot","data-answer-id":S.id}),w<g.length-1?"→":""]},S.id))]}):t.categories.map(S=>f.jsxs("div",{className:"exercise-flow-unit exercise-category","data-category-id":S.id,children:[f.jsxs("span",{children:[S.label,". ",S.text]}),f.jsx("span",{})]},S.id))}):t.items.map(S=>{const w=S.id===l,T=b.get(S.id),j=!v&&(S.kind==="table"||a&&(!Cn(S.document)||!c&&(Cm.includes(r)||t.items.length>1||r==="matching")));return f.jsxs("div",{className:"exercise-item","data-exercise-item":S.id,children:[f.jsxs("div",{className:C(S.id,"exercise-item-heading"),"data-exercise-id":S.id,children:[f.jsxs("b",{children:[S.label,"."]}),S.score!==null&&f.jsxs("span",{children:["(",S.score," 分)"]}),r==="matching"&&t.matchingDisplay==="lines"&&f.jsx("span",{className:"exercise-connector",children:"●"})]}),f.jsx(Kl,{id:S.id,label:`小题 ${S.label} 正文`,value:S.document,visible:j,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:R=>d({...t,items:t.items.map(O=>O.id===S.id?{...O,document:R}:O)}),choiceFillPosition:T?.position,choiceFillBindings:T?.bindings,activeChoiceQuestionId:w?S.id:void 0}),(S.kind==="judge"||S.kind==="choice"&&!!T?.concentrated.questions.length)&&f.jsx("div",{className:C(S.id,"exercise-choices"),"data-exercise-id":S.id,children:(S.kind==="judge"?S.choice.options.slice(0,2):S.choice.options).map((R,O)=>f.jsx("span",{className:`exercise-mark${S.kind==="choice"||t.judgeLabels!=="words"?" exercise-choice-mark":""}`,"data-answer-id":R.id,children:S.kind==="judge"?wm[t.judgeLabels][O]:R.label},R.id))}),r==="matching"&&t.matchingDisplay==="letters"&&f.jsx("div",{className:C(S.id,"exercise-match-letters"),"data-exercise-id":S.id,children:f.jsx("span",{className:"exercise-order-slot"})}),r!=="matching"&&S.kind==="fill"&&!v&&f.jsx("div",{className:"exercise-blanks","data-new-line":t.fillNewLine,children:S.blanks.map(R=>f.jsxs(E.Fragment,{children:[f.jsx(ob,{blank:R,item:S,active:w}),R.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},R.id))}),S.steps.map(R=>f.jsxs("div",{className:C(S.id,"exercise-step"),"data-exercise-id":S.id,"data-step-id":R.id,children:[f.jsxs("span",{children:["(",R.label,") ",R.prompt,R.score!==null?`(${R.score} 分)`:""]}),f.jsx("span",{className:"exercise-step-answer"})]},R.id)),(["answer","calculation","correction","drawing","writing","english"].includes(S.kind)||S.kind==="judge"&&S.needsReason)&&f.jsx(JR,{area:S.area,item:S,active:w,readOnly:c,onResize:R=>d({...t,items:t.items.map(O=>O.id===S.id?{...O,area:{...O.area,rows:R}}:O)})})]},S.id)})}),r==="matching"&&t.matchingDisplay==="lines"&&f.jsx("div",{children:x(!0)})]}),r==="practice"&&f.jsxs("div",{className:"exercise-flow-unit exercise-evaluation",children:["评价意见:",f.jsx("span",{})]})]})}function ab({height:t,min:r,label:i,onChange:a}){const{scale:c}=ct(),l=E.useRef(null);return f.jsx("button",{className:"exercise-area-resize","data-exercise-resize":!0,"aria-label":i,onPointerDown:u=>{u.preventDefault(),u.stopPropagation(),l.current={y:u.clientY,height:t},u.currentTarget.setPointerCapture(u.pointerId)},onPointerMove:u=>{l.current&&a(Math.max(r,Math.round(l.current.height+(u.clientY-l.current.y)/c)))},onPointerUp:u=>{l.current=null,u.currentTarget.releasePointerCapture(u.pointerId)},onLostPointerCapture:()=>{l.current=null},onPointerCancel:()=>{l.current&&a(l.current.height),l.current=null},onKeyDown:u=>{u.key==="Escape"&&l.current&&(a(l.current.height),l.current=null),["ArrowUp","ArrowDown"].includes(u.key)&&(u.preventDefault(),a(Math.max(r,t+(u.key==="ArrowDown"?10:-10))))}})}const tO="M1009 734Q994 750 972 750Q950 750 935 734L694 479L522 661Q507 677 485.5 677Q464 677 449 661Q434 645 434 622.5Q434 600 449 584L621 402L383 151L91 462Q76 478 54 478Q32 478 17 462Q2 446 1 423.5Q0 401 15 384L346 34Q361 19 382.5 19Q404 19 419 34L693 327L810 201Q825 186 847 186Q869 186 884 201.5Q899 217 899 239.5Q899 262 884 279L768 402L1009 656Q1024 672 1024 694.5Q1024 717 1009 734Z",nO="M585 384 860 659Q869 675 867 693Q865 711 852 724Q839 737 821 739Q803 741 787 732L512 457L237 734Q221 744 203 741.5Q185 739 172 726Q159 713 157 695Q155 677 164 661L439 384L162 109Q152 93 154.5 75Q157 57 170 44Q183 31 201 29Q219 27 235 36L512 311L787 36Q803 27 821 29Q839 31 852 44Q865 57 867 75Q869 93 860 109Z";function rO({question:t,part:r}){const i=!r&&t.parts.length>1;return f.jsx("div",{className:"reference-homework-marking",children:i?t.parts.map((a,c)=>f.jsxs("span",{"data-recognition":"Checkbox","data-recognition-role":"cell","data-answer-id":a.id,"data-value":String(c+1),children:["(",c+1,")"]},a.id)):[tO,nO].map((a,c)=>f.jsx("span",{"data-recognition":"ScoreBox","data-recognition-role":"cell","data-answer-id":r?.id||t.parts[0]?.id||t.id,"data-value":c===0?"partial":"incorrect",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 -128 1024 1024",children:f.jsx("path",{transform:"translate(0 768) scale(1 -1)",d:a,fill:"currentColor"})})},c))})}function nf({placement:t,children:r,className:i="",answerId:a,sectionType:c,questionIds:l,scope:u,footer:d}){const m=E.useRef(null),[p,C]=E.useState({top:0,height:0});return E.useLayoutEffect(()=>{const g=()=>{const{top:x,height:v}=rb(m.current);C(S=>S.top===x&&S.height===v?S:{top:x,height:v})};g();const b=new ResizeObserver(g);return b.observe(m.current),()=>b.disconnect()},[t.fragments,r]),f.jsxs("div",{ref:m,className:`reference-paper-frame ${i}`,"data-marking-frame":d?"":void 0,children:[r,d&&f.jsx("div",{className:"exercise-flow-unit reference-marking-space"}),t.fragments.map((g,b)=>{const x=Math.max(p.top,g.from),v=Math.min(p.top+p.height,g.to),S=x<=p.top+.5;return v>x&&f.jsx("div",{"aria-hidden":"true",className:"reference-paper-border","data-recognition":!S&&u!=="section"&&c?"FrameOnly":c,"data-recognition-scope":u,"data-answer-id":a,"data-question-ids":l?.join(","),"data-fragment":b,style:{left:g.x-t.x,top:x-p.top+g.y-t.y-g.from+(x>g.from&&g.topPadding||0),height:v-x+(x===g.from&&g.topPadding||0)+(v===g.to&&g.bottomPadding||0)},children:S&&d},b)})]})}function oO({score:t,halfPoint:r,active:i,id:a}){const{card:c}=ct();return!c.scanMarking&&t!==null&&t>0&&f.jsx("div",{className:`exercise-flow-unit reference-score-row${i?" is-current":""}`,"data-exercise-id":a,children:DS(t,r).map((l,u)=>f.jsx("span",{"data-recognition":l?"ScoreBox":void 0,"data-answer-id":a,"data-recognition-role":"cell","data-value":l,children:l},u))})}function rf({question:t,part:r,props:i,optional:a=!1}){const{card:c,geometry:l,scale:u,selectChoice:d}=ct(),{value:m,placement:p,width:C,readOnly:g,activeId:b,uploadImage:x,onUnits:v,onActiveFragment:S,onChange:w}=i,T=r?.id||t.id,j=r?.label||t.label,R=r?.score??t.score,O=c.usage==="homework"&&R===0,M=O&&!r&&t.type==="SHORTANSWER"&&!a,D=O&&!c.scanMarking,_=b===T||b===t.id,I=E.useRef(null),[B,H]=E.useState(0),[z,$]=E.useState(()=>window.devicePixelRatio||1);E.useEffect(()=>{if(t.type!=="CCOMPOSITION")return;const re=()=>$(window.devicePixelRatio||1);return window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[t.type]);const X=r?.document||t.document,G=re=>w({...m,questions:m.questions.map(ae=>ae.id===t.id?{...ae,...re}:ae)}),te=re=>G(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,document:re}:ae)}:{document:re}),V=a?m.optionalHeight:r?.height||t.height;E.useLayoutEffect(()=>{const re=I.current.querySelector(".reference-answer-body"),ae=()=>H(re.offsetHeight);ae();const ge=new ResizeObserver(ae);return ge.observe(re),()=>ge.disconnect()},[]);const Y=(re="")=>`exercise-flow-unit ${re}${_?" is-current":""}`,L=Math.max(0,V-B-(D?22:!c.scanMarking&&R!==null&&R>0?18:0)),P=NS(C),N=P*31+1,U=Math.max(1,Math.round(z))/(z*u),J=`M.5 .5H${N-.5}V32.5H.5Z`+Array.from({length:P-1},(re,ae)=>`M${(ae+1)*31+.5} .5V32.5`).join(""),Q=t.type==="CCOMPOSITION"?Math.ceil(t.characters/P):Math.ceil(L/40),le=re=>a?w({...m,optionalHeight:re}):G(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,height:re}:ae)}:{height:re});return f.jsx("div",{ref:I,className:"reference-answer","data-exercise-item":T,children:f.jsxs(nf,{placement:p,answerId:T,sectionType:c.scanMarking?"FrameOnly":M&&t.parts.length>1?"Checkbox":"ScoreBox",questionIds:a?m.questions.map(re=>re.id):void 0,className:t.type==="CCOMPOSITION"?"reference-composition":"",footer:D?f.jsx(rO,{question:t,part:r}):void 0,children:[f.jsx(oO,{score:R,halfPoint:t.halfPoint,active:_,id:T}),f.jsxs("div",{className:"reference-answer-body",children:[a&&f.jsxs("div",{className:Y("reference-optional-head"),style:{minHeight:l.columns===3?104:82},"data-exercise-id":T,children:[f.jsxs("p",{children:[f.jsx("b",{children:"选做题"})," 请考生从给出的第",m.questions.map(re=>re.label).join("、"),of(m.questions.length),"题中任选",of(m.choose),"题作答,并用2B铅笔在答题卡上把所选题目对应的题号涂黑,注意所做题目的题号必须与所涂题号一致,如果多做,则按所做的",m.choose===1?"第一题":`前${of(m.choose)}题`,"计分。"]}),f.jsxs("p",{children:["我选做的题号是:",m.questions.map(re=>f.jsx("span",{"data-exercise-id":re.id,"data-recognition":"QuestionChoice","data-answer-id":re.id,"data-recognition-role":"cell","data-value":re.label,children:re.label},re.id))]})]}),f.jsx("div",{className:"reference-answer-text",style:{minHeight:t.type==="CCOMPOSITION"?t.contentHeight:void 0},children:(a?m.questions.map(re=>({item:re,entryPart:void 0})):M?t.parts.map(re=>({item:t,entryPart:re})):[{item:t,entryPart:r}]).map(({item:re,entryPart:ae})=>{const ge=a?re.parts[0]?.id||re.id:ae?.id||T,je=a?re.label:ae?.label||j,ye=a||!ae||re.parts[0]?.id===ae.id,de=m.textVersion===1&&m.type!=="MIXED"&&ye,Me=de&&i.showQuestion&&re.text,De=a?re.parts[0]?.document||re.document:ae?.document||X,we=Me?$r([...Ws(re.text,re.id,re.label),...re.type==="ECOMPOSITION"?(De.content.content||[]).slice(1):[]]):De;return f.jsx("div",{"data-exercise-id":ge,className:"reference-answer-entry",children:f.jsx(Kl,{id:`reference/${ge}`,label:`第 ${je} 题作答内容`,value:we,editorKeys:de?[re.id,ge]:[ge],contentTargets:Me?[{id:re.id,label:`第 ${re.label} 题题干`,kind:"question"}]:void 0,onContentSelect:xe=>d(i.blockId,xe),visible:!0,readOnly:g,placement:p,uploadImage:x,onUnits:v,onActiveFragment:S,onChange:Me?xe=>w({...m,questions:m.questions.map(Se=>Se.id===re.id?{...Se,text:Nm(Se.text,(xe.content.content||[]).filter(Bt=>Se.type!=="ECOMPOSITION"||Bt.attrs?.contentId===Se.id)),...Se.type==="ECOMPOSITION"?{document:$r([Se.document.content.content[0],...(xe.content.content||[]).filter(Bt=>Bt.attrs?.contentId!==Se.id)])}:{}}:Se)}):a?xe=>w({...m,questions:m.questions.map(Se=>Se.id===re.id?{...Se,document:xe,parts:Se.parts.map((Bt,ht)=>ht===0?{...Bt,document:xe}:Bt)}:Se)}):M&&ae?xe=>G({parts:t.parts.map(Se=>Se.id===ae.id?{...Se,document:xe}:Se)}):te})},ge)})})]}),Array.from({length:Q},(re,ae)=>f.jsx("div",{className:Y(`reference-answer-row ${t.type==="CCOMPOSITION"?"reference-character-row":""}`),"data-exercise-id":T,style:{height:t.type==="CCOMPOSITION"?39.5:Math.min(40,L-ae*40)},children:t.type==="CCOMPOSITION"&&f.jsxs("div",{className:"reference-character-grid",children:[f.jsx("svg",{"aria-hidden":"true",className:"reference-character-lines",width:N,height:"33",viewBox:`0 0 ${N} 33`,children:f.jsx("path",{d:J,fill:"none",stroke:"#000",strokeWidth:U,vectorEffect:"non-scaling-stroke",shapeRendering:"crispEdges"})}),Array.from({length:P},(ge,je)=>{const ye=ae*P+je+1;return f.jsx("span",{className:"reference-character","data-character":ye<=t.characters?ye:void 0,"data-padding":ye>t.characters||void 0,children:ye<=t.characters&&ye%100===0&&f.jsxs("small",{children:[ye,"字"]})},je)})]})},ae)),!g&&t.type!=="CCOMPOSITION"&&f.jsx(ab,{height:V,min:30,label:`调整第 ${j} 题作答高度`,onChange:le})]})})}function of(t){const r="零一二三四五六七八九";return t<10?r[t]:t<100?`${t<20?"":r[Math.floor(t/10)]}十${t%10?r[t%10]:""}`:t===100?"一百":String(t)}function aO(t){const{value:r,placement:i,activeId:a,concentrated:c}=t,{card:l}=ct(),u=new Set(c.questions.map(m=>m.id)),d=E.useMemo(()=>{const m=[];return r.questions.forEach(p=>{const C=Et(p.type)?"choice":Ei(p.type)?"fill":"answer",g=m.at(-1);C!=="answer"&&g?.category===C?g.questions.push(p):m.push({category:C,questions:[p]})}),m},[r.questions]);return r.optional&&r.questions.length>1?f.jsx("div",{className:"reference-content",children:f.jsx(rf,{question:r.questions[0],props:t,optional:!0})}):f.jsx("div",{className:"reference-content",children:d.map((m,p)=>f.jsxs(E.Fragment,{children:[m.category==="choice"&&ha({...r,questions:m.questions}).some(C=>u.has(C.id))&&f.jsx(nf,{placement:i,className:"reference-choice-frame",sectionType:"MultiChoice",scope:"section",answerId:`${t.blockId}/choice/${p}`,questionIds:m.questions.map(C=>C.id),children:f.jsx(tb,{activeQuestionId:m.questions.find(C=>C.id===a&&Be(C.type))?.parts[0]?.id||a,settings:{...c,questions:ha({...r,questions:m.questions}).filter(C=>u.has(C.id))}})}),m.category==="fill"&&f.jsx(nf,{placement:i,className:"reference-fill-frame",sectionType:"Checkbox",scope:"section",answerId:`${t.blockId}/fill/${p}`,questionIds:m.questions.map(C=>C.id),children:f.jsx("div",{className:"reference-fill-grid",children:m.questions.map(C=>f.jsxs(E.Fragment,{children:[C.parts.map(g=>f.jsxs(E.Fragment,{children:[f.jsxs("div",{className:`exercise-flow-unit reference-blank${l.scanMarking?" is-online":""}${a===C.id||a===g.id?" is-current":""}`,style:{width:`${g.width}%`},"data-exercise-id":g.id,"data-answer-id":g.id,"data-recognition":"Checkbox",children:[f.jsxs("span",{className:"reference-blank-number",children:[g.label,"."]}),f.jsx("span",{className:"reference-blank-line","data-recognition":"Checkbox","data-recognition-role":"line","data-answer-id":g.id}),!l.scanMarking&&f.jsx("span",{className:"reference-blank-score","data-recognition":"ScoreBox","data-recognition-role":"cell","data-answer-id":g.id})]}),g.breakAfter&&f.jsx("span",{className:"exercise-line-break"}),r.fillNewLine&&Be(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},g.id)),r.fillNewLine&&!Be(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},C.id))})}),m.category==="answer"&&m.questions.map(C=>C.type==="SHORTANSWER"&&!(l.usage==="homework"&&C.score===0)?C.parts.map(g=>f.jsx(rf,{question:C,part:g,props:t},g.id)):f.jsx(rf,{question:C,props:t},C.id)),p<d.length-1&&f.jsx("div",{className:"reference-section-gap"})]},m.questions[0].id))})}function ib({hidden:t=!1,block:r,index:i,placement:a,width:c,scale:l,selected:u,readOnly:d,showQuestion:m,activeChoiceId:p,uploadImage:C,registerEditor:g,onSelect:b,onActiveFragment:x,onSettings:v,onMeasure:S,onDocument:w,onHeight:T,onExercise:j,onReference:R}){const{card:O,geometry:M,selectChoice:D}=ct(),_=E.useMemo(()=>r.reference?K0(r):void 0,[r.id,r.reference]),I=E.useMemo(()=>r.reference?la({...r.reference.layout,questions:ha(r.reference)},r.document,m):r.kind==="choice"&&r.choices?la(r.choices,r.document,m):void 0,[r.reference,r.kind,r.choices,r.document,m]),H=!(r.reference?.textVersion===1&&r.reference.questions.length>0&&["SHORTANSWER","ECOMPOSITION","CCOMPOSITION"].includes(r.reference.type))&&!t&&r.id!==nr&&m&&(!d||!(r.exercise||r.reference)||!Cn(r.document)||!!I?.bindings.length),z=E.useRef(null),$=E.useCallback(he=>{z.current=he,g(r.id,he)},[r.id,g]),X=E.useMemo(()=>r.reference?TR(r.document,r.reference,c):r.document,[r.document,r.reference,c]);E.useEffect(()=>{z.current?.syncDocument(X)},[X]);const G=E.useRef(null),te=E.useRef(S);te.current=S;const V=E.useRef([]),Y=E.useRef(new Map),[L,P]=E.useState(0),[N,U]=E.useState(0),J=E.useRef(()=>{}),Q=he=>{const at=a.fragments.find(it=>he>=it.from-.5&&he<it.to-.5);return at?{x:at.x-a.x,y:at.y-a.y-at.from+(at.topPadding||0)}:{x:0,y:0}};J.current=()=>{const he=G.current,at=he?.querySelector(".card-question-document .rt-content");if(t||!he||!at)return;const it=nb(he.parentElement),Mt=H?it(at).top:0;P(_e=>Math.abs(_e-Mt)<.5?_e:Mt);const $n=H?V.current.map(_e=>({top:Mt+_e.top,bottom:Mt+_e.bottom})):[];Y.current.forEach(_e=>$n.push(..._e)),he.querySelectorAll(".card-choice-row, .exercise-flow-unit").forEach(_e=>{if(_e.offsetParent===null)return;const{top:St,height:On}=it(_e);$n.push({top:St,bottom:St+On});const Kt=Q(St);_e.style.translate=`${Kt.x}px ${Kt.y}px`}),he.querySelectorAll("[data-exercise-resize]").forEach(_e=>{const St=Q(it(_e).top);_e.style.translate=`${St.x}px ${St.y}px`});const to=he.querySelector(".card-answer-space:not(.card-answer-fragment)");if(to){const{top:_e,height:St}=it(to);U(Kt=>Math.abs(Kt-_e)<.5?Kt:_e);const On=r.kind==="fill"?40:28;for(let Kt=_e;Kt<_e+St;Kt+=On)$n.push({top:Kt,bottom:Math.min(Kt+On,_e+St)})}const Go=it(he),Er=he.querySelectorAll(".reference-character-row"),Gn=Er.length?it(Er[0]).top:void 0,At=Er.length?it(Er[Er.length-1]).top:void 0,Rn=Math.min(...$n.map(_e=>_e.bottom)),Ht=[...new Set($n.flatMap(_e=>[_e.top,_e.bottom]))].filter(_e=>_e>=Rn&&_e<Go.height&&!$n.some(St=>_e>St.top+.5&&_e<St.bottom-.5)).filter(_e=>At===void 0||_e<=At).sort((_e,St)=>_e-St),Ki=Array.from(he.querySelectorAll("[data-marking-frame]")).map(_e=>{const{top:St,height:On}=it(_e);return{from:St,to:St+On}});te.current({width:Go.width,height:Go.height,breaks:Ht,markingFrames:Ki,...Gn!==void 0?{compositionStart:Gn}:{}})};const le=E.useCallback(he=>{V.current=he,J.current()},[]),re=E.useCallback((he,at)=>{Y.current.set(he,at),J.current()},[]),ae=E.useMemo(()=>a.fragments.map(he=>({from:he.from-L,to:he.to-L,x:he.x-a.x,y:he.y-a.y-he.from+(he.topPadding||0)})),[a.fragments,a.x,a.y,L]);E.useLayoutEffect(()=>{J.current()},[a.fragments,r.answerHeight,r.choices,r.exercise,r.reference,m,H,t]);const ge=E.useRef(null),je=he=>{he.preventDefault(),he.stopPropagation(),he.currentTarget.focus(),ge.current={y:he.clientY,height:r.answerHeight},he.currentTarget.setPointerCapture(he.pointerId)},ye=he=>{ge.current&&T(Math.max(0,Math.min(800,Math.round(ge.current.height+(he.clientY-ge.current.y)/l))))},de=he=>{ge.current=null,he.currentTarget.releasePointerCapture(he.pointerId)},Me=()=>{ge.current&&T(ge.current.height),ge.current=null},De=he=>{he.key==="Escape"&&ge.current&&Me(),(he.key==="ArrowUp"||he.key==="ArrowDown")&&(he.preventDefault(),T(Math.max(0,Math.min(800,r.answerHeight+(he.key==="ArrowDown"?10:-10)))))};E.useEffect(()=>{const he=G.current;let at=0;const it=new ResizeObserver(()=>{cancelAnimationFrame(at),at=requestAnimationFrame(()=>J.current())});return it.observe(he),()=>{it.disconnect(),cancelAnimationFrame(at)}},[]);const we=Q(N+r.answerHeight-1),xe=`${we.x}px ${we.y}px`,Se=a.fragments.length>1,Bt=r.reference&&I&&f.jsx(aO,{blockId:r.id,showQuestion:m,value:r.reference,concentrated:O.mergeObjective&&r.id!==nr?{...I.concentrated,questions:[]}:I.concentrated,placement:a,width:c,readOnly:d,activeId:p,onUnits:re,onChange:R,onActiveFragment:x,uploadImage:C}),ht=r.reference&&(Et(r.reference.type)||r.id===nr);return f.jsx("article",{hidden:t,inert:a.page>0,"aria-hidden":a.page>0?!0:void 0,className:`card-question${u&&!d?" is-selected":""}${a.overflowing?" is-overflowing":""}${Se?" is-fragmented":""}${r.reference?.type==="CCOMPOSITION"?" is-composition":""}`,"data-block-id":r.id,"data-page":a.page+1,"data-column":a.column+1,style:{left:a.x,top:a.y,width:c,minHeight:!Se&&a.fragments[0]?.bottomPadding?a.height+a.fragments[0].bottomPadding:void 0,maxHeight:a.overflowing?a.available:void 0},onPointerDownCapture:()=>{d||b()},onFocusCapture:()=>{d||b()},"aria-label":r.title||`题块 ${i+1}`,children:f.jsxs("div",{className:"card-question-content",ref:G,children:[f.jsxs("div",{className:"card-question-heading",children:[f.jsx("h2",{children:d?r.title||`题块 ${i+1}`:f.jsx("button",{className:"card-question-title","aria-label":`设置题块 ${i+1}`,"aria-haspopup":"dialog",title:"打开题块设置",onClick:v,children:r.title||`题块 ${i+1}`})}),f.jsx("span",{children:String(i+1).padStart(2,"0")})]}),I&&!r.reference&&f.jsx(tb,{settings:I.concentrated,activeQuestionId:p}),ht&&Bt,f.jsx("div",{className:"card-question-document",hidden:!H,children:f.jsx(Vl,{ref:$,initialValue:r.document,readOnly:d||!H,uploadImage:C,ariaLabel:`题块 ${i+1} 正文`,onChange:w,pagination:{slices:ae,maxUnitHeight:M.contentHeight-80,onMeasure:le,onActiveSliceChange:x},choiceFillPosition:I?.position,choiceFillBindings:I?.bindings,activeChoiceQuestionId:p,contentTargets:_,allowContentAssignment:r.reference?.textVersion!==1,onContentSelect:he=>{he!==r.id&&D(r.id,he)}})}),!ht&&Bt,!r.reference&&r.exercise&&r.kind!=="choice"&&r.kind!=="area"&&f.jsx(eO,{value:r.exercise,kind:r.kind,placement:a,showQuestion:m,readOnly:d,activeId:p,onUnits:re,onChange:j,onActiveFragment:x,uploadImage:C}),!r.reference&&!r.exercise&&r.kind!=="choice"&&f.jsx("div",{className:`card-answer-space ${r.kind}${Se?" is-paginated-space":""}`,style:{height:r.answerHeight},"data-answer-height":r.answerHeight,children:!d&&f.jsxs("div",{className:"card-answer-controls",children:[f.jsx("span",{className:"card-answer-caption",style:{translate:xe},children:r.kind==="writing"?"作文格":"作答区域"}),f.jsx("button",{className:"card-height-handle","aria-label":`调整题块 ${i+1} 作答高度`,title:"上下拖动调整作答区;方向键微调,Esc 取消",style:{translate:xe},onPointerDown:je,onPointerMove:ye,onPointerUp:de,onPointerCancel:Me,onLostPointerCapture:()=>{ge.current=null},onKeyDown:De,children:f.jsx("span",{})})]})}),Se&&!r.reference&&!r.exercise&&r.kind!=="choice"&&a.fragments.map((he,at)=>{const it=Math.max(he.from,N),Mt=Math.min(he.to,N+r.answerHeight);return Mt>it&&f.jsx("div",{"aria-hidden":"true",className:`card-answer-space card-answer-fragment ${r.kind}`,style:{left:he.x-a.x,top:it+he.y-a.y-he.from,width:c,height:Mt-it,backgroundPositionY:`${N-it-1}px`}},at)})]})})}function sb({block:t,index:r,placement:i,onMeasure:a,onActiveFragment:c}){const{geometry:l,readOnly:u,selectedId:d,setSelectedId:m,updateBlock:p,registerEditor:C,uploadImage:g}=ct(),b=E.useRef(null),[x,v]=E.useState([]),S=E.useRef(null),w=E.useCallback(M=>{S.current=M,C(t.id,M)},[t.id,C]);E.useEffect(()=>{JSON.stringify(S.current?.getDocument())!==JSON.stringify(t.document)&&S.current?.syncDocument(t.document)},[t.document]);const T=Math.max(t.answerHeight,(x.at(-1)?.bottom||0)+12),j=E.useRef(a);j.current=a,E.useLayoutEffect(()=>{const M=(x.at(-1)?.bottom||0)+6,D=[...x.map(_=>_.bottom+6),...Array.from({length:Math.max(0,Math.floor((T-M)/40))},(_,I)=>M+(I+1)*40)];j.current({width:l.columnWidth,height:T,breaks:t.areaType==="forbiden"?[]:D})},[l.columnWidth,T,x,t.areaType]);const R=E.useMemo(()=>i.fragments.map(M=>({from:M.from-6,to:M.to-6,x:M.x-i.x,y:M.y-i.y-M.from})),[i]),O=i.fragments.at(-1);return f.jsxs("article",{inert:i.page>0,"aria-hidden":i.page>0?!0:void 0,className:`card-question card-area-block${d===t.id&&!u?" is-selected":""}${i.overflowing?" is-overflowing":""}${i.fragments.length>1?" is-fragmented":""}`,"data-block-id":t.id,"data-page":i.page+1,"data-column":i.column+1,"data-area-type":t.areaType,"aria-label":t.title,style:{left:i.x,top:i.y,width:l.columnWidth,height:T+(i.fragments.length===1&&O.bottomPadding||0),maxHeight:i.overflowing?i.available:void 0},onPointerDownCapture:()=>{u||m(t.id)},children:[i.fragments.map((M,D)=>f.jsx("div",{className:"card-area-border","data-recognition":t.areaType==="forbiden"?"Blank":"FrameOnly","data-answer-id":t.id,"data-fragment":D,style:{left:M.x-i.x,top:M.y-i.y,height:M.to-M.from+(M.bottomPadding||0),width:l.columnWidth}},D)),f.jsx("div",{className:"card-area-text",ref:b,children:f.jsx(Vl,{ref:w,initialValue:t.document,readOnly:u,ariaLabel:`题块 ${r+1} 区域文字`,uploadImage:g,onChange:M=>p(t.id,{document:M}),pagination:{slices:R,maxUnitHeight:l.contentHeight-12,onMeasure:v,onActiveSliceChange:c}})}),!u&&f.jsx("div",{className:"card-area-resize",style:{left:O.x-i.x,top:O.y-i.y+O.to-O.from+(O.bottomPadding||0)-12,width:l.columnWidth},children:f.jsx(ab,{height:t.answerHeight,min:100,label:"调整区域高度",onChange:M=>p(t.id,{answerHeight:Math.min(t.areaType==="forbiden"?l.contentHeight:4e3,M)})})})]})}function iO({block:t,onClose:r}){return f.jsx(DR,{children:f.jsx(sO,{block:t,onClose:r})})}function sO({block:t,onClose:r}){const{card:i,geometry:a,measurements:c,placementById:l,overflowById:u,draftQuestionMode:d,readOnly:m,registerEditor:p,updateBlock:C,uploadImage:g,selectedChoiceId:b,openSettings:x}=ct(),{setDialog:v,titleProps:S,cancelDrag:w}=ql(),[T,j]=E.useState(c[t.id]?.height||400),R=E.useCallback(H=>j(z=>Math.abs(z-H.height)<.5?z:H.height),[]),O=E.useMemo(()=>({id:t.id,page:0,column:0,x:0,y:0,height:T,available:T,overflowing:!1,fragments:[{page:0,column:0,x:0,y:0,from:0,to:T}]}),[t.id,T]),M=u.get(t.id)||l.get(t.id),D=M?.overflowFrom,_=M?.id===t.id&&(!d||i.questionCard||t.areaType)?D:D===void 0?void 0:0,I=i.blocks.findIndex(H=>H.id===t.id),B=()=>{r(),x(t.id)};return f.jsx(Vi,{open:!0,modal:!1,panelRef:v,className:"card-modal card-draft-modal",width:Math.min(window.innerWidth-32,a.columnWidth+48),zIndex:950,closeLabel:"关闭完整内容",closeIcon:f.jsx(eo,{name:"close",size:16}),onCancel:r,onOpenAutoFocus:H=>H.preventDefault(),onEscapeKeyDown:H=>{H.preventDefault(),H.stopPropagation(),w()||r()},title:f.jsxs("div",{...S,className:"card-modal-drag","aria-label":"拖动完整内容窗口",children:[f.jsx("h2",{children:"完整内容"}),f.jsx("p",{children:t.title})]}),footer:f.jsxs(f.Fragment,{children:[f.jsx("span",{role:"status",className:D===void 0?"card-draft-fits":"card-draft-warning",children:D===void 0?"已全部排入纸张":"有内容未排入纸张"}),!m&&f.jsx(ue,{type:"text",onClick:B,children:"题块设置"}),f.jsx(ue,{onClick:r,children:"关闭"})]}),children:f.jsxs("div",{className:"card-draft-canvas",style:{width:a.columnWidth,height:T},children:[t.kind==="area"?f.jsx(sb,{block:t,index:I,placement:O,onMeasure:R,onActiveFragment:()=>{}}):f.jsx(ib,{block:t,index:I,placement:O,width:a.columnWidth,scale:1,selected:!1,readOnly:m,showQuestion:d||i.questionCard!==!1,activeChoiceId:b(t),uploadImage:g,registerEditor:p,onSelect:()=>{},onActiveFragment:()=>{},onSettings:B,onMeasure:R,onDocument:H=>C(t.id,{document:H}),onHeight:H=>C(t.id,{answerHeight:H}),onExercise:H=>C(t.id,{exercise:H}),onReference:H=>C(t.id,{reference:H})}),_!==void 0&&f.jsx("div",{className:"card-draft-overflow-range","data-overflow-from":_,style:{top:Math.min(_,T),bottom:0},children:f.jsx("span",{children:_>0?"以下内容未排入纸张":"此题块有内容未排入纸张"})})]})})}function lO(){const{card:t,creationDictionary:r,saveMessage:i,saveAction:a,setCard:c,creationOpen:l,setCreationOpen:u,newCard:d,selectedId:m,setSelectedId:p,settingsId:C,setSettingsId:g,settingsAutoFocus:b,openSettings:x,draftBlockId:v,setDraftBlockId:S,openDraft:w,readOnly:T,setReadOnly:j,titleOverflow:R,deleted:O,setDeleted:M,overflow:D,overflowById:_,placementById:I,fitPage:B,moveBlock:H,selectBlock:z,download:$}=ct(),X=t.blocks.find(P=>P.id===C),G=t.blocks.find(P=>P.id===v),[te,V]=E.useState(!1),[Y,L]=E.useState(null);return f.jsxs("div",{className:"card-controls",children:[f.jsxs("aside",{className:"card-sidebar","aria-label":"制卡设置",children:[f.jsxs("div",{className:"card-panel-header",children:[f.jsx("strong",{children:"制卡设置"}),f.jsx("a",{"data-card-demo-link":"",href:"/rich-text",children:"富文本编辑 ↗"})]}),f.jsxs("div",{className:"card-panel-actions",children:[f.jsxs("div",{className:"card-mode","aria-label":"制卡模式",children:[f.jsx(ue,{type:"text","aria-pressed":!T,onClick:()=>j(!1),children:"编辑"}),f.jsx(ue,{type:"text","aria-pressed":T,onClick:()=>j(!0),children:"预览"})]}),f.jsxs(ue,{type:"text",onClick:$,className:"card-export",children:[f.jsx(eo,{name:"upload",size:15}),a]})]}),i&&f.jsx("div",{className:"card-overflow-notice",role:"status",children:i}),f.jsx("div",{className:"card-panel-fit",children:f.jsx(ue,{type:"text",onClick:B,children:"适合宽度"})}),D.length>0&&f.jsx("div",{className:"card-overflow-notice",role:"alert",children:"内容超出一张纸,暂不可保存或导出。请编辑标记的题块。"}),R&&f.jsx("div",{className:"card-overflow-notice",role:"alert",children:"卷头内容超出可用区域,请拖高标题或调整内容、版式。"}),f.jsxs("div",{className:"card-sidebar-section card-document-section",children:[f.jsx("strong",{className:"card-document-name",children:t.title||"未新建答题卡"}),t.creation&&f.jsxs("p",{className:"card-section-note",children:[t.creation.mode==="template"?"答题卡模板":"考试答题卡"," · ",t.creation.grade," · ",t.creation.subject]}),f.jsx(ue,{type:"text",className:"card-add-component",onClick:()=>u(!0),children:"新建答题卡"})]}),f.jsx(QR,{}),f.jsxs("div",{className:"card-sidebar-section card-outline-section",children:[f.jsxs("div",{className:"card-section-heading",children:[f.jsx("h2",{children:"题块"}),f.jsxs("span",{children:[t.blocks.length," 个"]})]}),f.jsx("p",{className:"card-section-note",children:"拖动列表调整顺序,点击打开题块设置"}),!t.blocks.length&&f.jsx("p",{className:"card-section-note",children:"从一道题开始,添加空白题块后编辑内容。"}),f.jsx("ol",{className:"card-outline",children:t.blocks.map((P,N)=>{const U=I.get(P.id),J=_.has(P.id);return f.jsxs("li",{className:m===P.id?"active":"",draggable:!T,onDragStart:Q=>{L(P.id),Q.dataTransfer.effectAllowed="move",Q.dataTransfer.setData("text/plain",P.id)},onDragEnd:()=>L(null),onDragOver:Q=>{!T&&Y&&Q.preventDefault()},onDrop:Q=>{Q.preventDefault(),Y&&!T&&H(Y,N),L(null)},children:[f.jsxs(ue,{type:"text",className:"card-outline-item","aria-haspopup":T?void 0:"dialog",onClick:()=>{T?z(P.id,!0):x(P.id)},children:[f.jsx("span",{className:"card-outline-number",children:String(N+1).padStart(2,"0")}),f.jsxs("span",{children:[f.jsx("strong",{children:P.title||jm[P.kind]}),f.jsx("small",{children:J?"有内容未排入纸张":`第 ${U.column+1} 栏`})]})]}),J&&f.jsx(ue,{type:"text",className:"card-open-draft","aria-label":`编辑题块 ${N+1} 完整内容`,onClick:()=>w(P.id),children:"查看完整内容"}),!T&&f.jsxs("div",{className:"card-reorder",children:[f.jsx(ue,{type:"text","aria-label":`上移题块 ${N+1}`,title:"上移",disabled:N===0,onClick:()=>H(P.id,N-1),children:"↑"}),f.jsx(ue,{type:"text","aria-label":`下移题块 ${N+1}`,title:"下移",disabled:N===t.blocks.length-1,onClick:()=>H(P.id,N+1),children:"↓"})]})]},P.id)})}),!T&&f.jsx("div",{className:"card-add",children:f.jsx(ue,{type:"text","aria-haspopup":"dialog",onClick:()=>V(!0),children:"+ 添加题块"})})]}),f.jsxs("div",{className:"card-sidebar-bottom",children:[f.jsx("span",{className:"card-version-dot"}),"自动排版已开启",f.jsx("span",{children:"连续换栏"})]})]}),l&&f.jsx(FR,{initial:KR(r),dictionary:r,replacing:!!(t.paperTitle||t.blocks.length),onCreate:d,onClose:()=>u(!1)}),X&&!T&&f.jsx(XR,{block:X,autoFocus:b,onClose:()=>g(null)}),G&&f.jsx(iO,{block:G,onClose:()=>S(null)},G.id),te&&!T&&!l&&f.jsx(LR,{creation:t.creation,questionCard:t.questionCard,onClose:()=>V(!1),onAdd:P=>{const N=P==="forbiden"||P==="editArea"?xS(P):_m(P);c(U=>{const J=[...U.blocks],Q=J.findIndex(le=>le.id===m);return J.splice(Q>=0?Q+1:J.length,0,N),{...U,blocks:J}}),V(!1),x(N.id)}}),O&&f.jsxs("div",{className:"card-toast",role:"status",children:["题块已删除",f.jsx(ue,{type:"text",onClick:()=>{c(P=>{const N=[...P.blocks];return N.splice(O.index,0,O.block),{...P,blocks:N}}),p(O.block.id),M(null)},children:"撤销"}),f.jsx(ue,{type:"text","aria-label":"关闭删除提示",onClick:()=>M(null),children:f.jsx(eo,{name:"close",size:14})})]})]})}function lb({seat:t=!1}){return f.jsx("div",{className:"card-student-fields",children:["姓名","班级","学号",...t?["考场/座位号"]:[]].map(r=>f.jsxs("div",{children:[f.jsxs("span",{children:[r,":"]}),f.jsx("i",{})]},r))})}function af(){return f.jsxs("div",{className:"card-barcode-area","data-recognition":"StudentId","data-value":"barcode",children:[f.jsx("div",{children:"贴条形码区"}),f.jsx("small",{children:"正面朝上,切勿贴出虚线方框"})]})}function Fl(){return f.jsxs("div",{className:"card-header-marks",children:[f.jsxs("div",{children:["正确填涂:",f.jsx("i",{className:"filled"})]}),f.jsxs("div",{"data-recognition":"IgnoreFlag",children:["缺考标记:",f.jsx("i",{"data-recognition-cell":"absent"})]})]})}function cb({marks:t,focusText:r}){return f.jsxs("div",{className:"card-attentions",children:[r&&f.jsxs("div",{className:"card-attention-box",children:[f.jsx("div",{children:"注意事项"}),f.jsxs("section",{children:[f.jsx("p",{children:"1.答题前请将姓名、班级和准考证号(或学号)填写清楚并填涂完整。"}),f.jsx("p",{children:"2.客观题答题必须使用2B铅笔填涂,修改时用橡皮擦干净。主观题答题必须使用黑色签字笔书写。"}),f.jsx("p",{children:"3.请在规定区域内答题,超出答题区域书写无效。"})]})]}),t&&f.jsx(Fl,{})]})}function cO({settings:t,columns:r,pointBlack:i}){const a=t.kaohao==="school"&&t.weishu>9,c=!t.mifeng&&r===3||a,l=r!==3&&t.focusText&&t.missExam&&!t.mifeng&&t.kaohao==="code",u=r===3&&t.missExam&&!t.mifeng&&t.kaohao==="code",d=r===3&&t.missExam&&!t.mifeng&&t.kaohao==="school"&&[8,9].includes(t.weishu),m=r===3&&t.focusText&&t.missExam&&t.mifeng&&t.kaohao==="school"&&[8,9].includes(t.weishu),p=r!==3&&t.missExam&&!t.mifeng&&a,C=t.missExam&&!l&&!u&&!d&&!m&&!p,g=t.focusText||C;return f.jsxs("div",{className:"card-header-fields",children:[f.jsxs("div",{className:`card-header-left${t.mifeng&&(t.kaohao==="code"||a)?" full-width":""}`,children:[!t.mifeng&&f.jsx(lb,{seat:t.writeKaohao}),(d||p)&&f.jsx(Fl,{}),!c&&g&&f.jsx(cb,{focusText:t.focusText,marks:C})]}),f.jsxs("div",{className:"card-header-number",children:[t.kaohao==="school"&&f.jsxs("div",{className:`card-exam-number${i&&t.weishu>=8?" with-reference-points":""}`,"data-recognition":"StudentId","data-value":String(t.weishu),"aria-label":`${t.weishu}位准考证号码`,children:[f.jsx("div",{className:"card-exam-number-heading",children:"准考证号码"}),f.jsx("div",{className:"card-exam-number-columns",children:Array.from({length:t.weishu},(b,x)=>f.jsxs("div",{className:"card-exam-number-column",children:[f.jsx("div",{className:"card-exam-number-input"}),Array.from({length:10},(v,S)=>f.jsxs("div",{className:"card-exam-number-digit","data-recognition-cell":`${x+1}:${S}`,children:["[",f.jsx("span",{children:S}),"]",i&&x===7&&(S===0||S===9)&&f.jsx("i",{className:`card-reference-point ${S===0?"top":"bottom"}`,"data-recognition":"ReferencePoint"})]},S))]},x))})]}),t.kaohao==="code"&&!t.mifeng&&f.jsx(af,{}),(l||u)&&f.jsx(Fl,{})]}),m&&f.jsx(Fl,{}),c&&g&&f.jsx(cb,{focusText:t.focusText,marks:C})]})}function uO({settings:t,back:r}){return f.jsxs("div",{className:`card-seal-line${r?" back":""}`,children:[f.jsx("span",{className:"card-seal-label",children:"密封线"}),!r&&f.jsxs("div",{className:`card-seal-details${t.kaohao==="code"?" with-barcode":""}`,children:[f.jsx(lb,{seat:t.writeKaohao}),t.kaohao==="code"&&f.jsx(af,{})]})]})}function ub({kind:t}){const r=t==="ClassId"?"班级":"学号";return f.jsxs("div",{className:"card-homework-id","data-recognition":t,"data-value":"2","aria-label":`${r}填涂区`,children:[f.jsxs("span",{className:"card-homework-id-label",children:[r,f.jsx("br",{}),"填涂:"]}),f.jsx("div",{className:"card-homework-digits",children:["十位","个位"].map((i,a)=>f.jsxs("div",{className:"card-homework-digit-row",children:[f.jsx("span",{className:"card-homework-place",children:i}),Array.from({length:10},(c,l)=>f.jsx("span",{className:"card-homework-digit",children:f.jsxs("i",{"data-recognition-cell":`${a+1}:${9-l}`,children:["[",f.jsx("span",{children:9-l}),"]"]})},l))]},i))})]})}function dO({settings:t,columns:r}){return f.jsxs("div",{className:`card-homework-header${r===3?" three":""}`,children:[f.jsx("div",{className:"card-homework-student",children:["姓名","班级","学号"].map(i=>f.jsxs("div",{children:[i,":",f.jsx("i",{})]},i))}),t.tiaomaStyle===2?f.jsx(af,{}):f.jsxs("div",{className:"card-homework-number",children:[t.classText!==!1&&f.jsx(ub,{kind:"ClassId"}),f.jsx(ub,{kind:"StudentId"})]})]})}function fO({title:t,page:r=0}){const{card:i,setCard:a,readOnly:c,geometry:l,scale:u,setTitleMeasurement:d,uploadImage:m,registerEditor:p}=ct(),C=E.useRef(null),g=E.useRef(null),b=E.useRef(null);E.useEffect(()=>{const w=`title/${t.id}/${r}`;return p(w,b.current),()=>p(w,null)},[t.id,r,p]);const x=E.useRef(null),v=E.useCallback(()=>{const w=C.current,T=g.current;if(!w||!T||r!==0)return;const j={id:t.id,width:w.offsetWidth,height:w.offsetHeight,overflowing:w.scrollHeight>w.clientHeight+1||T.scrollHeight>T.clientHeight+1};d(R=>R?.id===j.id&&R.width===j.width&&R.height===j.height&&R.overflowing===j.overflowing?R:j)},[t.id,r,d]);E.useLayoutEffect(()=>{const w=new ResizeObserver(v);return w.observe(C.current),w.observe(g.current),v(),()=>w.disconnect()},[v]),E.useEffect(()=>{b.current?.getDocument()&&JSON.stringify(b.current.getDocument())!==JSON.stringify(t.document)&&b.current.setDocument(t.document)},[t.document]);const S=w=>a(T=>T.paperTitle?.id===t.id?{...T,paperTitle:{...T.paperTitle,height:Math.max(24,Math.min(90,Math.round(w)))}}:T);return f.jsxs("div",{ref:C,className:"card-paper-header","data-header-page":r+1,style:{top:r*(l.height+Oo)+l.topInset,left:l.columnX(r,0),width:l.titleWidth,maxHeight:l.contentHeight,paddingBottom:i.header?10:Si},children:[f.jsxs("div",{className:"card-paper-title",style:{height:t.height},children:[f.jsx("div",{ref:g,className:"card-paper-title-body",children:f.jsx(Vl,{ref:b,initialValue:t.document,readOnly:c,uploadImage:m,ariaLabel:r?`第 ${r+1} 面纸面标题`:"纸面标题",onLayout:v,onChange:w=>a(T=>T.paperTitle?.id===t.id&&JSON.stringify(T.paperTitle.document)!==JSON.stringify(w)?{...T,paperTitle:{...T.paperTitle,document:w}}:T)})}),!c&&f.jsx("button",{className:"card-title-height-handle","aria-label":"调整标题高度",title:"调整输入框高度",onPointerDown:w=>{w.button===0&&(w.preventDefault(),w.stopPropagation(),x.current={y:w.clientY,height:t.height},w.currentTarget.setPointerCapture(w.pointerId))},onPointerMove:w=>{x.current&&S(x.current.height+(w.clientY-x.current.y)/u)},onPointerUp:w=>{x.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId)},onPointerCancel:()=>{x.current&&S(x.current.height),x.current=null},onLostPointerCapture:()=>{x.current=null},onKeyDown:w=>{w.key==="Escape"&&x.current&&(S(x.current.height),x.current=null),(w.key==="ArrowUp"||w.key==="ArrowDown")&&(w.preventDefault(),S(t.height+(w.key==="ArrowDown"?2:-2)))},children:f.jsx("span",{children:"↕"})})]}),i.header&&(i.usage==="homework"?f.jsx(dO,{settings:i.header,columns:l.columns}):f.jsx(cO,{settings:i.header,columns:l.columns,pointBlack:i.recognition?.pointBlack}))]})}function hO({value:t,left:r,top:i}){const a=E.useMemo(()=>{try{return Hm(t)}catch{return null}},[t]);return a&&f.jsxs("svg",{className:"card-exam-qr","data-recognition":"ExamQrCode","data-value":t,"aria-label":"试卷二维码",style:{left:r,top:i},width:"40",height:"40",viewBox:`0 0 ${a.count} ${a.count}`,shapeRendering:"crispEdges",children:[f.jsx("rect",{width:a.count,height:a.count,fill:"white"}),f.jsx("path",{d:a.path,fill:"black"})]})}const mO=["topLeft","topRight","bottomLeft","bottomRight"];function pO({card:t,geometry:r,page:i,pageCount:a}){const c=r.columnX(i,0),l=r.columnX(i,r.columns-1)+r.columnWidth,u=r.topInset-31,d=r.height-r.bottomInset+16,m=kS(i+1),p=Dm(t.creation),C=p&&Tu[p],g=t.recognition?.examQrCode&&t.creation?.exampaperId!==void 0&&i%2===0,b=x=>({left:x%2?l-(x<2?26:13):c,top:x<2?u:d,width:x<2?26:13,height:x<2?13:26});return f.jsxs(E.Fragment,{children:[mO.map((x,v)=>f.jsx("div",{className:"card-registration-mark","data-anchor":x,style:b(v)},x)),a>1&&m&&f.jsx("div",{className:"card-code-marks","data-recognition":"PageCode","data-value":String(i+1),"aria-label":`纸面识别 ${i+1}`,style:{left:c+Math.max(30,r.columnWidth-180),top:d-14},children:[...m].map((x,v)=>f.jsx("i",{"data-value":x,"data-recognition-cell":String(v+1),className:x==="1"?"is-filled":""},v))}),i%2===0&&t.recognition?.subjectMarkers!==!1&&C&&f.jsx("div",{className:"card-code-marks","data-recognition":"SubjectCode","data-value":p,"aria-label":"学科识别标记",style:{left:r.columnX(i,r.columns>1?1:0)+Math.min(100,Math.max(30,r.columnWidth-140)),top:d-14},children:[1,2,3,4].map(x=>f.jsx("i",{"data-value":C.includes(x)?"1":"0","data-recognition-cell":String(x),className:C.includes(x)?"is-filled":""},x))}),g&&f.jsx(hO,{value:String(t.creation.exampaperId),left:r.columns===1?c+(r.columnWidth-40)/2:c+r.columnWidth-40,top:r.topInset-56})]})}function gO(){const{card:t,paperRoot:r,paperBlocks:i,selectedId:a,setSelectedId:c,selectedChoiceId:l,selectChoice:u,settingsId:d,openSettings:m,openDraft:p,overflow:C,overflowById:g,registerEditor:b,editingQuestionId:x,setMeasurements:v,readOnly:S,scale:w,geometry:T,pageCount:j,totalHeight:R,placementById:O,updateBlock:M,uploadImage:D}=ct(),_=E.useRef(null),[I,B]=E.useState(null),H=(L,P)=>B(N=>N?.id===L&&N.index===P?N:{id:L,index:P}),z=L=>{const P=L instanceof Element?L.closest("[data-block-id], [data-block-fragment]"):null;return P?.dataset.blockId||P?.dataset.blockFragment},$=t.blocks.find(L=>L.id===d),X=$&&l($),G=i.find(L=>L.id===nr),te=G?.reference&&X&&el(G.reference).some(L=>L.id===X)?$:t.blocks.find(L=>L.reference?.questions.some(P=>Et(P.type))),V=G?[G,...t.blocks.map(L=>i.find(P=>P.id===L.id)||L)]:i,Y=L=>L===nr&&te?.id||L;return f.jsxs("div",{ref:r,className:"card-sheet-stack",style:{width:T.width,height:R},onPointerDownCapture:L=>{const P=z(L.target);_.current=!S&&L.button===0&&P?{id:P,x:L.clientX,y:L.clientY}:null},onPointerCancelCapture:()=>{_.current=null},onClickCapture:L=>{const P=_.current;if(_.current=null,!S&&L.button===0&&P&&z(L.target)===P.id&&Math.hypot(L.clientX-P.x,L.clientY-P.y)<5){const N=L.target instanceof Element?L.target.closest("[data-question-id], [data-fill-question-id], [data-exercise-id], [data-exercise-item], [data-answer-id], [data-content-id]"):null,U=N?.dataset.answerId||N?.dataset.questionId||N?.dataset.fillQuestionId||N?.dataset.exerciseId||N?.dataset.exerciseItem||N?.dataset.contentId,J=t.blocks.find(Q=>U&&Q.reference&&el(Q.reference).some(le=>le.id===U))||t.blocks.find(Q=>Q.id===Y(P.id));U&&(J?.reference?el(J.reference):J?.choices?.questions||J?.exercise?.items)?.some(Q=>Q.id===U)&&u(J.id,U),m(J?.id||Y(P.id),!1)}},children:[Array.from({length:j},(L,P)=>f.jsxs("div",{className:"card-sheet","data-paper-page":P+1,style:{top:P*(T.height+Oo),width:T.width,height:T.height},children:[t.header&&f.jsx(pO,{card:t,geometry:T,page:P,pageCount:j}),t.header&&!S&&Array.from({length:T.columns},(N,U)=>f.jsx("div",{className:"card-column-guide",style:{left:T.columnX(P,U),width:T.columnWidth,top:T.topInset,bottom:T.bottomInset}},U)),t.usage!=="homework"&&t.header?.mifeng&&f.jsx("div",{className:"card-seal",style:{left:P%2===0?T.margin:T.width-T.margin-T.sealWidth,width:T.sealWidth},children:f.jsx(uO,{settings:t.header,back:P%2!==0})}),t.header&&Array.from({length:T.columns},(N,U)=>f.jsx("div",{className:"card-paper-footer",style:{left:T.columnX(P,U),width:T.columnWidth,bottom:20},children:f.jsxs("span",{children:["第",P*T.columns+U+1,"页 共",j*T.columns,"页"]})},U))]},P)),t.paperTitle&&Array.from({length:j},(L,P)=>T.hasHeader(P)&&f.jsx(fO,{title:t.paperTitle,page:P},`${t.paperTitle.id}/${P}`)),f.jsxs("div",{className:"card-paper-content",style:{width:T.width,height:T.height-T.bottomInset},children:[i.flatMap(L=>{const P=O.get(L.id).fragments,N=I?.id===L.id?Math.min(I.index,P.length-1):0;return P.length>1?P.map((U,J)=>U.page<j&&f.jsx("div",{className:`card-fragment-frame${a===Y(L.id)&&!S&&J===N?" is-selected":""}`,"data-block-fragment":L.id,"data-page":U.page+1,"data-column":U.column+1,style:{left:U.x,top:U.y,width:T.columnWidth,height:U.to-U.from+(U.topPadding||0)+(U.bottomPadding||0)},onPointerDown:()=>{S||(H(L.id,J),c(Y(L.id)))}},`${L.id}/${J}`)):[]}),V.map((L,P)=>{const N=U=>v(J=>{const Q=J[L.id];return Q&&Q.compositionStart===U.compositionStart&&JSON.stringify(Q.markingFrames)===JSON.stringify(U.markingFrames)&&Math.abs(Q.width-U.width)<.5&&Math.abs(Q.height-U.height)<.5&&JSON.stringify(Q.breaks)===JSON.stringify(U.breaks)?J:{...J,[L.id]:U}});return L.kind==="area"?f.jsx(sb,{block:L,index:P,placement:O.get(L.id),onMeasure:N,onActiveFragment:U=>H(L.id,U)},L.id):f.jsx(ib,{hidden:!i.some(U=>U.id===L.id),block:L,index:P,placement:O.get(L.id),width:T.columnWidth,scale:w,selected:a===Y(L.id),readOnly:S,activeChoiceId:!S&&d===Y(L.id)?l(t.blocks.find(U=>U.id===Y(L.id))||L):void 0,showQuestion:t.questionCard!==!1||!S&&x===L.id,registerEditor:b,uploadImage:D,onSelect:()=>c(Y(L.id)),onActiveFragment:U=>H(L.id,U),onSettings:()=>{H(L.id,0),m(Y(L.id))},onDocument:U=>M(L.id,{document:U}),onHeight:U=>M(L.id,{answerHeight:U}),onExercise:U=>M(L.id,{exercise:U}),onReference:U=>{L.id!==nr&&M(L.id,{reference:U})},onMeasure:N},L.id)})]}),C.length>0&&f.jsx("button",{type:"button",className:"card-paper-capacity-notice",style:{right:T.margin+22,top:Math.min(T.height-T.bottomInset+2,T.height-22),maxWidth:T.columnWidth*.5},onClick:()=>{const L=g.keys().next().value;L&&p(L)},children:"还有内容未排入纸张 · 查看"})]})}const yO=()=>{const{navigatorVisible:t}=Uo(),{geometry:r,totalHeight:i,readOnly:a,pageCount:c,card:l,setSelectedId:u}=ct();return f.jsxs("div",{className:`${pA["portal-wrapper"]} card-workspace`,id:"uni-answer-sheet","data-mode":a?"preview":"edit",children:[f.jsx(vR,{width:r.width,height:i,onBackgroundClick:()=>u(null),children:f.jsx(gO,{})}),f.jsx(lO,{}),f.jsx(yR,{summary:`${c} 页 · ${l.blocks.length} 个题块`}),t&&f.jsx(SR,{})]})},$o=t=>structuredClone(t),db=t=>{const r=$o(t);return delete r.recognitionData,r};function fb(){return new Promise(t=>{const r=()=>{clearTimeout(a),cancelAnimationFrame(i),t()},i=requestAnimationFrame(r),a=setTimeout(r,50)})}function bO(t,r,i,a,c){i.initialValue&&ju(i.initialValue,r);let l=i,u=i.initialValue&&db(i.initialValue),d=0,m,p,C=!1,g;const b=nC.createRoot(t,{onUncaughtError:c});function x({readOnly:D}){const _=ct();return E.useLayoutEffect(()=>{m=_,a()}),E.useEffect(()=>{_.setReadOnly(!!D)},[D]),E.useEffect(()=>{if(p===_.card)return;const I=!p;p=_.card,I||l.onChange?.($o(_.card))},[_.card]),null}const v=()=>{if(C||!m)throw new Error("制卡实例尚未就绪或已经销毁");return m},S=(D,_,I)=>({code:D,path:"",message:_,...I}),w=async()=>{const D=Date.now()+8e3;let _="",I=0,B="LAYOUT_PENDING";for(;Date.now()<D;){await fb();const H=v();if(!t.isConnected||t.clientWidth<100||t.clientHeight<100)return{value:H,issues:[S("LAYOUT_UNAVAILABLE","请显示制卡容器并为其设置有效的宽高后再保存")]};const z=[...new Set(H.editors.current.values())].map(Y=>Y.getStatus());B=z.some(Y=>Y.composing||Y.uploading)?"EDITOR_BUSY":"LAYOUT_PENDING";const $=z.every(Y=>Y.ready&&!Y.composing&&!Y.uploading&&!Y.layoutPending);if($&&H.editingQuestionId&&!H.card.questionCard){H.finishQuestionEditing(),I=0;continue}const X=H.paperBlocks.every(Y=>{const L=H.measurements[Y.id];return L&&Math.abs(L.width-H.geometry.columnWidth)<1&&L.height>0})&&(!H.card.paperTitle||H.titleMeasurement?.id===H.card.paperTitle.id&&Math.abs(H.titleMeasurement.width-H.geometry.titleWidth)<1),G=Array.from(t.querySelectorAll("img[src], img[srcset]")).filter(Y=>Y.getClientRects().length),te=G.every(Y=>Y.complete),V=JSON.stringify([H.card,H.measurements,H.titleMeasurement,H.placements]);if($&&X&&te&&document.fonts.status==="loaded"&&V===_?I++:I=0,_=V,I>=4){const Y=[];return z.forEach(L=>{L.uploadError&&Y.push(S("IMAGE_UPLOAD_FAILED",L.uploadError))}),G.some(L=>!L.naturalWidth)&&Y.push(S("IMAGE_LOAD_FAILED","有图片加载失败,请检查图片地址")),H.titleOverflow&&Y.push(S("TITLE_OVERFLOW","纸面标题超出可用区域",{path:"paperTitle"})),H.overflowById.forEach((L,P)=>Y.push(S("CONTENT_OVERFLOW","内容超出一张纸,请调整未排入纸张的题块后再保存",{path:"blocks",blockId:P}))),H.paperRoot.current?.querySelectorAll(".rt-content").forEach(L=>{if(!L.getClientRects().length||L.closest("[hidden]"))return;const P=L.closest("[data-block-id]")?.dataset.blockId,N=P&&H.placementById.get(P);(!N||N.fragments.length===1)&&L.scrollWidth>L.clientWidth+2&&Y.push(S("CONTENT_OVERFLOW","内容超过输入区域宽度",{path:"blocks",...P?{blockId:P}:{}}))}),{value:H,issues:Y}}}return{value:v(),issues:[S(B,B==="EDITOR_BUSY"?"输入法输入或图片上传尚未结束,请完成后再保存":"字体、图片或分页尚未稳定,请稍后重试")]}},T=async()=>{try{const{issues:D,value:_}=await w(),B=[...qS(_.card,r).issues,...D];let H;if(!B.length)try{H=_.getRecognitionData()}catch(z){B.push(S(z instanceof wr?z.code:"RECOGNITION_FAILED",z instanceof Error?z.message:"识别坐标生成失败"))}return{value:_,recognitionData:H,result:{valid:B.length===0,issues:B}}}catch(D){if(C)throw D;return{value:v(),result:{valid:!1,issues:[S("EDITOR_ERROR",D instanceof Error?D.message:"编辑器或数据校验失败")]}}}},j=async()=>(await T()).result,R=()=>g||(g=(async()=>{const{result:D,value:_,recognitionData:I}=await T();if(v(),!D.valid)return{ok:!1,issues:D.issues};try{return{ok:!0,data:$o({..._.card,..._.getReferenceData(),recognitionData:I})}}catch(B){return{ok:!1,issues:[S("EXPORT_FAILED",B instanceof Error?B.message:"题卡数据转换失败")]}}})().finally(()=>{g=void 0})),O=()=>b.render(f.jsx(mA,{children:f.jsxs(IR,{editorPlugin:r,uploadImage:l.uploadImage,dictionaries:l.dictionaries,initialValue:u,onSave:()=>{v().setSaveMessage("正在校验…"),R().then(D=>{v().setSaveMessage(D.ok?"已生成保存数据":D.issues[0].message),l.onSave?.(D)}).catch(D=>{C||v().setSaveMessage("保存失败"),l.onError?.(D)})},children:[f.jsx(x,{readOnly:l.readOnly}),f.jsx(yO,{})]},d)}));O();const M=async D=>{ju(D,r);const _=db(D);v(),u=_;const I=++d;Yr.flushSync(O);const B=Date.now()+8e3;do{await fb();const H=v();if(I!==d)throw new DOMException("回显已被另一张题卡替换","AbortError");if([...H.editors.current.values()].every(z=>z.getStatus().ready))return}while(Date.now()<B);throw new Error("题卡数据已载入,但编辑器未能及时就绪")};return{isReady:()=>!!m&&!C,getDocument:()=>$o(v().card),setDocument:M,newDocument:D=>M(bu(D)),getReferenceData:()=>$o(v().getReferenceData()),setReferenceData:D=>M({...v().card,blocks:Q0($o(D),r.html)}),validate:j,save:R,async getRecognitionData(){const D=await T();if(!D.result.valid)throw new pa(D.result.issues);return $o(D.recognitionData)},focusIssue:D=>{if(!D.blockId)return;const _=v();_.overflowById.has(D.blockId)?_.openDraft(D.blockId):(_.selectBlock(D.blockId,!0),_.openSettings(D.blockId,!1))},update(D){l=D,O()},destroy(){C||(C=!0,b.unmount(),m=void 0)}}}const xO=Object.freeze(Object.defineProperty({__proto__:null,mountAnswerSheet:bO},Symbol.toStringTag,{value:"Module"}));return nt.AnswerSheetDataError=pa,nt.createAnswerSheet=XS,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"}),nt})({});
|
|
202
|
+
`)})})})]})]})}function ex({value:t,onChange:r,onRemove:i,category:a=!1}){const{uploadImage:c}=lt(),[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 x=g&&d?jo(d):{id:crypto.randomUUID(),label:"",text:""},b=new Set(t.map(S=>S.label));x.label=Array.from({length:26},(S,w)=>String.fromCharCode(65+w)).find(S=>!b.has(S))||Ur(t);const v=[...t];v.splice(m+1,0,x),r(v),u(x.id)};return f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs",children:t.map(g=>f.jsx(ue,{size:"small","aria-pressed":g.id===d?.id,onClick:()=>u(g.id),children:g.label},g.id))}),f.jsx(Yl,{name:p,maximum:26,index:m,count:t.length,onAdd:()=>C(!1),onCopy:()=>C(!0),onMove:g=>r(la(t,d.id,g)),onDelete:()=>i(d.id)}),d&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(fn,{label:`${p}编号`,value:d.label,onChange:g=>r(t.map(x=>x.id===d.id?{...x,label:g}:x))}),f.jsx(fn,{label:`${p}内容`,value:d.text,onChange:g=>r(t.map(x=>x.id===d.id?{...x,text:g}:x))})]}),d&&!a&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项图文/公式"}),f.jsx(Xi,{value:d.document||Vt(),ariaLabel:`共享选项 ${d.label} 图文内容`,uploadImage:c,onChange:g=>r(t.map(x=>x.id===d.id?{...x,document:g}:x))},d.id)]})]})}function PR({value:t,kind:r,item:i,onChange:a}){const c=l=>a({...t,...l});return f.jsxs("div",{children:[f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:r==="ordering"?"待排序/分类项目":"共享选项池"}),f.jsx(ex,{value:t.pool,onChange:l=>c({pool:l,sequence:[...t.sequence.filter(u=>l.some(d=>d.id===u)),...l.filter(u=>!t.sequence.includes(u.id)).map(u=>u.id)]}),onRemove:l=>a(mS(t,l))})]}),r==="matching"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(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(Bt,{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(Wt,{label:"当前题匹配答案",children:f.jsx("div",{className:"exercise-tabs",children:t.pool.map(l=>f.jsx(ue,{size:"small","aria-pressed":i.targets.includes(l.id),onClick:()=>a(pS(t,i.id,i.targets.includes(l.id)?i.targets.filter(u=>u!==l.id):[...i.targets,l.id])),children:l.label},l.id))})})]}),r==="ordering"&&f.jsxs("div",{children:[f.jsx(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(ex,{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 UR({value:t,onChange:r}){const[i,a]=E.useState(0),c=l=>r({...t,...l});return f.jsxs("div",{children:[f.jsx(Wt,{label:"待断句原文",children:f.jsx(Hl,{"aria-label":"待断句原文",value:t.chunkText,autoSize:{minRows:3,maxRows:8},onSelect:l=>a(l.currentTarget.selectionStart),onChange:l=>r(gS(t,l.target.value))})}),f.jsx(ue,{size:"small",disabled:i<=0||i>=t.chunkText.length||t.chunkPoints.length>=26||t.chunkPoints.some(l=>l.offset===i),onClick:()=>{const l=new Set(t.chunkPoints.map(d=>d.label)),u=Array.from({length:26},(d,m)=>String.fromCharCode(65+m)).find(d=>!l.has(d));c({chunkPoints:[...t.chunkPoints,{id:crypto.randomUUID(),offset:i,label:u}].sort((d,m)=>d.offset-m.offset)})},children:"在光标处添加断点"}),f.jsx("div",{className:"exercise-chunk-points",children:t.chunkPoints.map(l=>f.jsxs("div",{children:[f.jsxs(Bt,{checked:t.chunkCorrect.includes(l.id),onChange:u=>c({chunkCorrect:u.target.checked?[...t.chunkCorrect,l.id]:t.chunkCorrect.filter(d=>d!==l.id)}),children:[l.label," · ",t.chunkText.slice(Math.max(0,l.offset-4),l.offset),"|",t.chunkText.slice(l.offset,l.offset+4)]}),f.jsx(ue,{size:"small",type:"text","aria-label":`删除断点 ${l.label}`,onClick:()=>c({chunkPoints:t.chunkPoints.filter(u=>u.id!==l.id),chunkCorrect:t.chunkCorrect.filter(u=>u!==l.id)}),children:"删除"})]},l.id))}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ft,{label:"最多选择断点数",value:t.chunkMax,min:1,max:26,onChange:l=>c({chunkMax:l})}),f.jsx(nn,{label:"断句满分",value:t.groupScore,max:10,onChange:l=>c({groupScore:l})}),f.jsx(nn,{label:"每个正确断点分值",value:t.chunkScore,max:10,onChange:l=>c({chunkScore:l})})]})]})}function $R({value:t,kind:r,blockId:i,selectedId:a,onSelect:c,onChange:l}){const{card:u,uploadImage:d,insertMaterialBlank:m,geometry:p}=lt(),C=E.useRef([]),g=E.useRef([]),[,x]=E.useState(0),[b,v]=E.useState(1),[S,w]=E.useState(1),[T,j]=E.useState(null),N=t.items.find($=>$.id===a)||t.items[0],M=t.items.indexOf(N),D=($,ee=N?.id)=>{JSON.stringify(t)!==JSON.stringify($)&&(C.current.push({value:t,id:N?.id}),C.current=C.current.slice(-50),g.current=[],l($),ee&&c(ee),x(G=>G+1))},O=$=>D({...t,...$}),_=$=>O({items:t.items.map(ee=>ee.id===N.id?{...ee,...$}:ee)}),k=$=>l({...t,items:t.items.map(ee=>ee.id===N.id?{...ee,...$}:ee)}),L=$=>{const ee=$&&N?hS(N,Ur(t.items)):pu(N?.kind||gu(r),Ur(t.items)),G=[...t.items];G.splice(M+1,0,ee),D({...t,items:G},ee.id)},B=$=>{const ee=$?g.current:C.current,G=$?C.current:g.current,q=ee.pop();if(!q)return;G.push({value:t,id:N?.id});const H=q.value.items.map(P=>{const A=t.items.find(Y=>Y.id===P.id);return A?{...P,document:A.document,reference:A.reference,explanation:A.explanation}:P});l({...q.value,items:H}),q.id&&c(q.id),x(P=>P+1)},z=Sm.includes(r),U=N&&["answer","calculation","correction","drawing","writing","english"].includes(N.kind),K=yS(t,r);return f.jsxs("div",{className:"exercise-panel",children:[r!=="chunk"&&f.jsxs("div",{children:[f.jsx("div",{className:"exercise-tabs","aria-label":"选择当前小题",children:t.items.map($=>f.jsx(ue,{size:"small","aria-pressed":N?.id===$.id,onClick:()=>c($.id),children:$.label},$.id))}),f.jsx(Yl,{index:M,count:t.items.length,maximum:wm(r),onAdd:()=>L(!1),onCopy:()=>L(!0),onMove:$=>O({items:la(t.items,N.id,$)}),onDelete:()=>{const $=t.items.filter(ee=>ee.id!==N.id);D({...t,items:$,chooseCount:Math.min(t.chooseCount,Math.max(1,$.length))},$[Math.max(0,M-1)]?.id)}}),f.jsxs("details",{children:[f.jsx("summary",{children:"批量配置"}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ft,{label:"追加题数",value:b,min:1,max:50,onChange:v}),f.jsx(ft,{label:"起始题号",value:S,min:1,max:1e3,onChange:w}),f.jsx(nn,{label:"统一题分",value:T,max:Math.min(70,...t.items.map($=>Fs($.kind))),onChange:j})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:t.items.length+b>wm(r),onClick:()=>{const $=[...t.items],ee=[];for(let G=0;G<b;G++)ee.push(pu(N?.kind||gu(r),Ur([...$,...ee])));$.splice(M+1,0,...ee),D({...t,items:$},ee[0].id)},children:"追加空白题"}),f.jsx(ue,{size:"small",onClick:()=>O({items:t.items.map(($,ee)=>({...$,label:String(S+ee),choice:{...$.choice,label:String(S+ee)}}))}),children:"连续编号"}),f.jsx(ue,{size:"small",disabled:T!==null&&t.items.some($=>T>Fs($.kind)),onClick:()=>O({items:t.items.map($=>({...$,score:T,choice:{...$.choice,score:T}}))}),children:"统一分值"})]})]})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!C.current.length,onClick:()=>B(!1),children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!g.current.length,onClick:()=>B(!0),children:"重做题型配置"})]}),r==="chunk"&&f.jsx(UR,{value:t,onChange:D}),r==="optional"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(ft,{label:"选做题数",value:t.chooseCount,min:1,max:Math.max(1,t.items.length),onChange:$=>O({chooseCount:$})}),f.jsx(nn,{label:"选做题组总分",value:t.groupScore,max:200,onChange:$=>O({groupScore:$})})]}),N&&r!=="chunk"&&f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(fn,{label:"当前题号",value:N.label,onChange:$=>_({label:$,choice:{...N.choice,label:$}})}),f.jsx(nn,{label:"当前题分",value:N.score,max:Fs(N.kind),onChange:$=>_({score:$,choice:{...N.choice,score:$}})}),z&&r!=="cloze"&&r!=="completion"&&f.jsx(at,{label:"小题题型",value:N.kind,options:dS,onChange:$=>_({kind:$})})]}),r==="cloze"&&f.jsx(ue,{size:"small",onClick:()=>m(i,N.id,N.label,60),children:"插入题号到公共材料"}),N.kind==="judge"&&f.jsxs("div",{children:[f.jsx(at,{label:"判断标记",value:t.judgeLabels,options:{symbols:"√/×",letters:"T/F",words:"正确/错误"},onChange:$=>O({judgeLabels:$})}),f.jsx(Wt,{label:"正确判断",children:f.jsx("div",{className:"exercise-tabs",children:Cm[t.judgeLabels].map(($,ee)=>f.jsx(ue,{size:"small","aria-pressed":N.judgment===(ee===0),onClick:()=>_({judgment:N.judgment===(ee===0)?null:ee===0}),children:$},ee))})}),f.jsx(Bt,{checked:N.needsReason,onChange:$=>_({needsReason:$.target.checked}),children:"判断后改正/说明理由"}),N.needsReason&&f.jsx(J0,{value:N.area,onChange:$=>_({area:$})})]}),N.kind==="choice"&&f.jsxs("details",{children:[f.jsx("summary",{children:"选项与计分规则"}),f.jsx(W0,{value:{...hu(0),presentation:N.presentation,questions:[N.choice]},document:N.document,creation:u.creation,selectedId:N.choice.id,onSelect:()=>{},onChange:$=>{const ee=$.questions.find(G=>G.id===N.choice.id);ee&&_({choice:ee,presentation:$.presentation,score:ee.score??null})},singleQuestion:!0})]}),N.kind==="fill"&&r!=="matching"&&f.jsxs("div",{children:[f.jsx(Bt,{checked:t.fillNewLine,onChange:$=>O({fillNewLine:$.target.checked}),children:"每题一行"}),f.jsx(HR,{value:N.blanks,onChange:$=>_({blanks:$}),onInsert:$=>m(i,$.id,`${N.label}.${$.label}`,p.columnWidth*$.width/100-30)})]}),U&&r!=="ordering"&&f.jsxs("details",{open:!0,children:[f.jsx("summary",{children:"作答区域"}),f.jsx(J0,{value:N.area,drawing:N.kind==="drawing",onChange:$=>_({area:$})})]}),["answer","calculation","correction"].includes(N.kind)&&r!=="ordering"&&f.jsxs("details",{children:[f.jsx("summary",{children:r==="practice"?"评价量表":N.kind==="correction"?"改错位置与答案":"分步作答与评分点"}),f.jsx(BR,{value:N.steps,correction:N.kind==="correction",practice:r==="practice",onChange:$=>_({steps:$})})]}),N.kind==="table"&&f.jsx(ue,{size:"small",disabled:!En(N.document),onClick:()=>_({document:xS()}),children:"建立空白表格"}),["matching","ordering"].includes(r)&&f.jsx(PR,{value:t,kind:r,item:N,onChange:D}),f.jsxs("details",{children:[f.jsx("summary",{children:r==="matching"?"左侧项目内容":"小题正文"}),f.jsx(Xi,{value:N.document,ariaLabel:`小题 ${N.label} 正文设置`,uploadImage:d,onChange:$=>k({document:$})})]}),f.jsxs("details",{children:[f.jsx("summary",{children:"参考答案与解析"}),f.jsx(Wt,{label:"参考答案",children:f.jsx(Xi,{value:N.reference,ariaLabel:"参考答案",uploadImage:d,onChange:$=>k({reference:$})})}),f.jsx(Wt,{label:"解析",children:f.jsx(Xi,{value:N.explanation,ariaLabel:"答案解析",uploadImage:d,onChange:$=>k({explanation:$})})})]})]},N.id),r==="practice"&&f.jsx(fn,{label:"作品/音视频引用 URL",value:t.attachmentUrl,maxLength:4096,onChange:$=>O({attachmentUrl:$})}),K.length>0&&f.jsx("p",{className:"exercise-error",role:"alert",children:K.join(";")})]})}function GR({group:t,creation:r,start:i,scanMarking:a,onAdd:c}){const{card:l}=lt(),u=l.usage==="homework",d=w=>{const T=Su(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),[x,b]=E.useState({start:null,end:null}),v=w=>{g(null),p(T=>({...T,...w}))},S=ca[m.type];return f.jsxs("div",{className:"reference-add-panel",children:[t.type==="MIXED"&&f.jsx(at,{label:"子题题型",value:m.type,options:Object.fromEntries(Nm(r,!0).map(w=>[w,ur[w]])),onChange:w=>{p(d(w)),b({start:null,end:null}),g(null)}}),f.jsxs("div",{className:"exercise-fields",children:[f.jsx(Na,{label:"起始题号",value:x.start,min:1,max:1e3,onChange:w=>b(T=>({...T,start:w}))}),!Ti(m.type)&&f.jsx(Na,{label:"结束题号",value:x.end,min:x.start||1,max:Math.min(1e3,(x.start||1)+S.count-1),onChange:w=>b(T=>({...T,end:w}))}),Et(m.type)&&(S.options[0]===S.options[1]?f.jsxs("div",{className:"card-field",children:[f.jsx("span",{children:"选项个数"}),f.jsx("span",{children:S.options[0]})]}):f.jsx(Na,{label:"选项个数",value:m.optionCount,min:S.options[0],max:S.options[1],onChange:w=>v({optionCount:w})})),Be(m.type)&&f.jsx(Na,{label:"子题数量",value:m.partCount,min:1,max:S.parts,onChange:w=>v({partCount:w})}),["FILLBLANK","SHORTANSWER"].includes(m.type)&&f.jsx(ft,{label:m.type==="FILLBLANK"?"每题空数":"每题小题数",value:m.partCount||1,min:1,max:m.type==="SHORTANSWER"&&(a||t.optional)?1:S.parts,onChange:w=>v({partCount:w})}),u&&f.jsx(Bt,{checked:m.score===0,onChange:w=>v({score:w.target.checked?0:null,lessScore:0}),children:"无分值"}),f.jsx(nn,{min:u?0:.5,label:m.type==="FILLBLANK"?"每空分值":m.type==="SHORTANSWER"?"每小题分值":"每题分值",value:m.score,max:S.score,onChange:w=>v({score:w,lessScore:0})}),m.type==="MCHOICE"&&f.jsxs(E.Fragment,{children:[t.type!=="MIXED"&&f.jsx(at,{label:"少选计分",value:m.scoreType,options:{LESS_SCORE:"少选得分",ITEM_SCORE:"选项得分"},onChange:w=>v({scoreType:w,lessScore:0})}),m.scoreType==="LESS_SCORE"&&f.jsx(ft,{label:"少选得分",value:m.lessScore,min:0,max:m.score||0,step:.5,onChange:w=>v({lessScore:w})})]}),m.type==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Na,{label:"正确答案个数",value:m.rightAnswers,min:1,max:(m.optionCount||2)-1,onChange:w=>v({rightAnswers:w})}),f.jsx(nn,{label:"每涂对一处得分",value:m.singleScore,max:m.score||10,onChange:w=>v({singleScore:w})})]}),m.type==="CCOMPOSITION"&&f.jsx(ft,{label:"作文格数",value:m.characters,min:1,max:1200,onChange:w=>v({characters:w})}),m.type==="ECOMPOSITION"&&f.jsx(ft,{label:"作文行数",value:m.lines,min:1,max:100,onChange:w=>v({lines:w})})]}),C&&f.jsx("p",{role:"alert",className:"card-choice-error",children:C}),f.jsx(ue,{size:"small",type:"primary",onClick:()=>{if(x.start===null||!Ti(m.type)&&x.end===null){g("请输入起始题号和结束题号");return}const w={...m,start:x.start,end:Ti(m.type)?x.start:x.end},T=AS(t,w,a,u);g(T),T||c(w)},children:"添加题目"})]})}function Na({label:t,value:r,min:i,max:a,onChange:c}){return f.jsx(Wt,{label:t,children:f.jsx(Ra,{"aria-label":t,value:r,min:i,max:a,precision:0,placeholder:"请输入",onChange:c})})}function VR({value:t,onChange:r,onClose:i}){const a=t.questions.filter(b=>Et(b.type)).flatMap(b=>Be(b.type)?b.parts:[b]),[c,l]=E.useState([]),[u,d]=E.useState(!1),[m,p]=E.useState(!1),[C,g]=E.useState(2),x=()=>{const b=(v,S)=>!c.includes(v.id)||!v.text?v:{...v,text:{...v.text,layout:{...v.text.layout,indent:u,layout:m?"fixed":"natural",columns:m?C:S?4:2}}};r({...t,questions:t.questions.map(v=>({...b(v,v.type==="CLOZE"),parts:v.parts.map(S=>b(S,v.type==="CLOZE"))}))}),i()};return f.jsx(Vi,{open:!0,title:"客观题选项排版设置",width:400,className:"card-modal",closeLabel:"关闭选项排版",closeIcon:f.jsx(to,{name:"close"}),onCancel:i,footer:f.jsxs(f.Fragment,{children:[f.jsx(ue,{onClick:i,children:"取消"}),f.jsx(ue,{type:"primary",disabled:!c.length,onClick:x,children:"确定"})]}),children:f.jsxs("div",{className:"exercise-panel",children:[f.jsx(Bt,{checked:c.length===a.length,onChange:b=>l(b.target.checked?a.map(v=>v.id):[]),children:"全选"}),f.jsx("div",{className:"exercise-fields",children:a.map(b=>f.jsxs(Bt,{checked:c.includes(b.id),onChange:v=>l(S=>v.target.checked?[...S,b.id]:S.filter(w=>w!==b.id)),children:["第 ",b.label," 题"]},b.id))}),f.jsx(at,{label:"首行缩进",value:String(u),options:{false:"否",true:"是"},onChange:b=>d(b==="true")}),f.jsx(at,{label:"个数排版",value:String(m),options:{false:"否",true:"是"},onChange:b=>p(b==="true")}),m&&f.jsx(at,{label:"排版方式",value:String(C),options:{4:"一行4个",2:"一行2个",1:"一行1个"},onChange:b=>g(Number(b))})]})})}function qR({block:t,value:r,selectedId:i,onSelect:a,onChange:c}){const{card:l,geometry:u,setCard:d,editQuestion:m,insertMaterialBlank:p}=lt(),[C,g]=E.useState(null),[x,b]=E.useState(!1),[v,S]=E.useState([]),[w,T]=E.useState([]),[j,N]=E.useState(""),[M,D]=E.useState(!1),O=r.questions.find(H=>H.id===i||H.parts.some(P=>P.id===i))||r.questions[0],_=r.questions.indexOf(O),k=(H,P)=>{S(A=>[...A.slice(-49),{value:r,document:t.document}]),T([]),N(""),g(null),c(H,P)},L=H=>k({...r,questions:r.questions.map(P=>P.id===H.id?H:P)}),B=da(r),z=du(r.layout),U=Ys(t.document),K={...r.layout,direction:l.choiceDirection||r.layout.direction,questions:B},$=mu(K),ee=z!=="concentrated"?ia(K,t.document,!0).concentrated.questions:[],G=K0(t),q=H=>{const P=H.value;c({...P,questions:P.questions.map(A=>{const Y=r.questions.find(F=>F.id===A.id);return Y?{...A,text:Y.text||A.text,document:Tn(Y.document,A.label,A.score),parts:A.parts.map(F=>({...F,text:Y.parts.find(Z=>Z.id===F.id)?.text||F.text,document:Tn(Y.parts.find(Z=>Z.id===F.id)?.document||F.document,F.label,F.score)}))}:A})},NR(t.document,H.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:H=>k({...r,scoreType:H,questions:r.questions.map(P=>P.type==="MCHOICE"?{...P,choice:{...P.choice,scoreType:H,lessScore:H==="ITEM_SCORE"?0:P.choice.lessScore}}:P)})}),B.length>0&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"选择题填涂位置",value:z,options:r.questions.some(H=>H.type==="CHUNK_CHOICE")?{concentrated:"集中填涂",stem:"题干前整组字母框"}:{concentrated:"集中填涂",stem:"题干前整组字母框",option:"各选项前空方框"},onChange:H=>{const P=fu(K,t.document,H),A=new Map(P.questions.map(Y=>[Y.id,Y]));k({...r,layout:{...P,questions:[]},questions:r.questions.map(Y=>({...Y,choice:A.get(Y.id)||Y.choice,parts:Y.parts.map(F=>({...F,choice:A.get(F.id)||F.choice}))}))})}}),f.jsx(at,{label:"填涂排列方向",value:$,options:new Set(B.map(H=>H.options.length)).size>1?{column:"竖排(选项数不同)"}:{row:"横排(先右后下)",column:"竖排(先下后右)"},onChange:H=>d(P=>({...P,choiceDirection:H}))}),$==="column"&&f.jsx(ft,{label:"每列题数",value:r.layout.rowsPerColumn,min:1,max:5,onChange:H=>k({...r,layout:{...r.layout,rowsPerColumn:H}})}),r.textVersion===1&&l.questionCard&&r.type!=="INFO_MATCHING"&&f.jsx(ue,{size:"small",onClick:()=>D(!0),children:"选项排版"})]}),r.questions.length>0&&f.jsxs(E.Fragment,{children:[f.jsx(at,{label:"当前题目",value:O.id,options:Object.fromEntries(r.questions.map(H=>[H.id,`${Be(H.type)?H.parts.map(P=>P.label).join("、"):H.label} · ${ur[H.type]}`])),onChange:a}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional,onClick:()=>b(H=>!H),children:"新增题目"}),f.jsx(ue,{size:"small",disabled:r.type==="CCOMPOSITION"||r.optional||Ws(r)+O.parts.length-1>1e3,onClick:()=>{if(r.type==="CCOMPOSITION"||r.optional)return;const H=NS(O,Ws(r)),P=[...r.questions];P.splice(_+1,0,H),k({...r,questions:P},RR(t.document,O,H)),a(H.id)},children:"复制当前题目"}),f.jsx(ue,{size:"small","aria-label":"上移当前题目",disabled:_<=0,onClick:()=>k({...r,questions:la(r.questions,O.id,-1)}),children:"↑"}),f.jsx(ue,{size:"small","aria-label":"下移当前题目",disabled:_>=r.questions.length-1,onClick:()=>k({...r,questions:la(r.questions,O.id,1)}),children:"↓"}),f.jsx(ue,{size:"small",danger:!0,onClick:()=>{const H=r.questions.filter(P=>P.id!==O.id);k({...r,questions:H,optional:r.optional&&H.length>1,choose:Math.max(1,Math.min(r.choose,H.length-1))}),H.length&&a(H[Math.max(0,_-1)].id)},children:"删除当前题目"})]})]}),(!r.questions.length||x)&&f.jsx(GR,{group:r,creation:l.creation,start:Ws(r),scanMarking:!!l.scanMarking,onAdd:H=>{const P=RS(r,{...H,paperWidth:u.columnWidth},O?.id);k({...P,questions:P.questions.map(A=>r.questions.some(Y=>Y.id===A.id)?A:{...A,halfPoint:!!l.halfPoint})}),a(P.questions.find(A=>!r.questions.some(Y=>Y.id===A.id)).id),b(!1)}},`${r.type}/${Ws(r)}/${r.scoreType}`),r.type==="SHORTANSWER"&&r.questions.length>1&&f.jsxs(E.Fragment,{children:[f.jsx(Bt,{checked:r.optional,disabled:r.questions.some(H=>H.parts.length>1),onChange:H=>k({...r,optional:H.target.checked,choose:1}),children:"是否选做"}),r.optional&&f.jsx(ft,{label:`${r.questions.length} 选`,value:r.choose,min:1,max:l.scanMarking?r.questions.length-1:1,onChange:H=>k({...r,choose:H})})]}),r.questions.length>0&&!r.optional&&r.type!=="MIXED"&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(nn,{label:"分组总分",min:l.usage==="homework"?0:.5,value:C??Qn(r.questions),max:1e4,onChange:g}),f.jsx(ue,{size:"small",disabled:(C??Qn(r.questions))===null,onClick:()=>{const H=_S(r,C??Qn(r.questions),l.usage==="homework");H?k(H):N("总分无法平均分配,每题/空的分值须符合题型范围且为 0.5 的倍数")},children:"平均分配"})]}),O&&f.jsxs("div",{className:"exercise-fields",children:[f.jsx(at,{label:"编辑正文",value:G.some(H=>H.id===i)?i:O.id,options:Object.fromEntries(G.map(H=>[H.id,H.label])),onChange:H=>{a(H),m(t.id,H)}}),f.jsx(ue,{size:"small",onClick:()=>m(t.id,i||O.id),children:"编辑当前正文"})]}),ee.length>0&&f.jsxs("p",{className:"card-choice-error",role:"status",children:["第 ",ee.map(H=>H.label).join("、")," 题",z==="stem"?"尚未关联题干":"尚未关联完整选项",",暂保留集中填涂。"]}),O&&f.jsx(YR,{value:O,group:r,scanMarking:!!l.scanMarking,onApply:H=>{const P=r.questions.find(Z=>Z.id===H.id),A={...H,document:Tn(P.document,H.label,H.score),parts:H.parts.map(Z=>({...Z,document:Tn(P.parts.find(le=>le.id===Z.id)?.document||Z.document,Z.label,Z.score)}))},Y=r.questions.filter(Z=>Z.id!==A.id).flatMap(Z=>Be(Z.type)?Z.parts.map(le=>le.label):[Z.label]),F=Be(A.type)?A.parts.map(Z=>Z.label):[A.label];return F.some(Z=>!Z.trim()||Y.includes(Z))||new Set(F).size!==F.length?(N("题号不能为空或重复"),!1):(r.optional?k({...r,questions:r.questions.map(Z=>Z.id===A.id?A:{...Z,score:A.score,document:Tn(Z.document,Z.label,A.score),parts:Z.parts.map(le=>({...le,score:A.score,document:Tn(le.document,le.label,A.score)}))})}):L(A),!0)}},O.id),O&&Ei(O.type)&&f.jsxs(E.Fragment,{children:[f.jsx(Bt,{checked:r.fillNewLine,onChange:H=>k({...r,fillNewLine:H.target.checked}),children:"每题一行"}),f.jsx("div",{className:"reference-part-settings",children:O.parts.map(H=>f.jsxs("div",{children:[f.jsxs("div",{className:"exercise-fields",children:[f.jsx(fn,{label:`空位 ${H.label} 显示题号`,maxLength:10,value:H.label,onChange:P=>L({...O,parts:O.parts.map(A=>A.id===H.id?{...A,label:P}:A)})}),f.jsx(at,{label:`空位 ${H.label} 宽度`,value:String(H.width),options:{...l.scanMarking?{20:"1/5 行"}:{},25:"1/4 行",33:"1/3 行",50:"1/2 行",66:"2/3 行",75:"3/4 行",100:"整行"},onChange:P=>L({...O,parts:O.parts.map(A=>A.id===H.id?{...A,width:Number(P)}:A)})})]}),f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",onClick:()=>p(t.id,H.id,H.label,u.columnWidth*H.width/100),children:"插入此空到正文"}),f.jsx(Bt,{checked:H.breakAfter,onChange:P=>L({...O,parts:O.parts.map(A=>A.id===H.id?{...A,breakAfter:P.target.checked}:A)}),children:"此空后换行"}),f.jsx(ue,{size:"small",onClick:()=>k({...r,questions:r.questions.map(P=>Ei(P.type)?{...P,parts:P.parts.map(A=>({...A,width:H.width}))}:P)}),children:"宽度统一设置"})]})]},H.id))})]}),O&&Et(O.type)&&f.jsx(E.Fragment,{children:(Be(O.type)?O.parts.map(H=>H.choice):[O.choice]).map(H=>f.jsxs("div",{children:[f.jsxs(Bt,{checked:H.breakBefore,onChange:P=>{const A={...H,breakBefore:P.target.checked};L({...O,choice:O.choice.id===H.id?A:O.choice,parts:O.parts.map(Y=>Y.choice.id===H.id?{...Y,choice:A}:Y)})},children:[H.label," 题前换行"]}),z==="option"&&r.textVersion!==1&&f.jsx(at,{label:`${H.label} 题对应正文选项`,value:H.contentTarget?.groupId||"",options:{"":"按正文归属匹配",...Object.fromEntries(U.map((P,A)=>[P.id,`第 ${P.label||A+1} 组选项`]))},onChange:P=>{const A=U.find(F=>F.id===P),Y={...H,contentTarget:A?{groupId:P,optionIds:A.options.map(F=>F.id)}:null};L({...O,choice:O.choice.id===H.id?Y:O.choice,parts:O.parts.map(F=>F.choice.id===H.id?{...F,choice:Y}:F)})}})]},H.id))}),j&&f.jsx("p",{className:"card-choice-error",role:"alert",children:j}),M&&f.jsx(VR,{value:r,onChange:k,onClose:()=>D(!1)}),(v.length>0||w.length>0)&&f.jsxs("div",{className:"exercise-actions",children:[f.jsx(ue,{size:"small",disabled:!v.length,onClick:()=>{const H=v.at(-1);S(v.slice(0,-1)),T(P=>[...P,{value:r,document:t.document}]),q(H)},children:"撤销题型配置"}),f.jsx(ue,{size:"small",disabled:!w.length,onClick:()=>{const H=w.at(-1);T(w.slice(0,-1)),S(P=>[...P,{value:r,document:t.document}]),q(H)},children:"重做题型配置"})]})]})}function YR({value:t,group:r,scanMarking:i,onApply:a}){const{card:c}=lt(),[l,u]=E.useState(null),[d,m]=E.useState(""),p=l||t,C=w=>{u({...p,...w}),m("")},g=p.type,x=ca[g],b=p.choice.options.length,v=p.parts.length,S=w=>{const T=Array.from({length:w},(j,N)=>p.parts[N]||ji(Be(g)?String(Number(p.parts[0]?.label||p.label)+N):w===1?p.label:`${p.label}.${N+1}`,p.parts[0]?.score??null,g,p.choice.options.length));Be(g)||T.forEach((j,N)=>{T[N]={...j,label:w===1?p.label:`${p.label}.${N+1}`}}),C({parts:T,score:Qn(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"&&bi(c.creation)&&p.score===null?6:p.score;C({type:w,score:T,choice:{...ua(p.choice,w,b),score:T,scoreType:w==="MCHOICE"&&bi(c.creation)?"ITEM_SCORE":"LESS_SCORE",lessScore:0}})}}),!Be(g)&&f.jsx(fn,{label:"题目题号",value:p.label,maxLength:10,onChange:w=>C({label:w,choice:{...p.choice,label:w},parts:p.parts.map((T,j)=>({...T,label:p.parts.length===1?w:`${w}.${j+1}`}))})}),Et(g)&&f.jsx(ft,{label:"选项个数",min:x.options[0],max:x.options[1],value:b,onChange:w=>C({choice:ua(p.choice,g,w),parts:p.parts.map(T=>({...T,choice:ua(T.choice,g,w)}))})}),v>0&&(g==="INFO_MATCHING"||r.type==="MIXED")&&f.jsx(Wt,{label:"子题数量",children:f.jsx("span",{children:v})}),v>0&&g!=="INFO_MATCHING"&&r.type!=="MIXED"&&f.jsx(ft,{label:Be(g)?"子题数量":g==="FILLBLANK"?"每题空数":"每题小题数",value:v,min:1,max:g==="SHORTANSWER"&&(i||r.optional)?1:x.parts,onChange:S}),c.usage==="homework"&&f.jsx(Bt,{checked:p.score===0,onChange:w=>{const T=w.target.checked?0:null;C({score:T,choice:{...p.choice,score:T,lessScore:0},parts:p.parts.map(j=>({...j,score:T,choice:{...j.choice,score:T,lessScore:0}}))})},children:"无分值"}),!v&&f.jsx(nn,{min:c.usage==="homework"?0:.5,label:"本题分值",value:p.score,max:x.score,onChange:w=>C({score:w,choice:{...p.choice,score:w,lessScore:0}})}),Be(g)&&f.jsx(nn,{min:c.usage==="homework"?0:.5,label:"每题分值",value:p.parts[0]?.score??null,max:x.score,onChange:w=>{const T=p.parts.map(j=>({...j,score:w,choice:{...j.choice,score:w}}));C({parts:T,score:Qn(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(ft,{label:"少选得分",min:0,max:p.score||0,step:.5,value:p.choice.lessScore||0,onChange:w=>C({choice:{...p.choice,lessScore:w}})})]}),g==="CHUNK_CHOICE"&&f.jsxs(E.Fragment,{children:[f.jsx(Na,{label:"正确答案个数",value:p.rightAnswers,min:1,max:b-1,onChange:w=>C({rightAnswers:w})}),f.jsx(nn,{label:"每涂对一处得分",value:p.singleScore,max:p.score||10,onChange:w=>C({singleScore:w})})]}),g==="CCOMPOSITION"&&f.jsx(ft,{label:"作文格数",value:p.characters,min:1,max:1200,onChange:w=>C({characters:w})}),g==="ECOMPOSITION"&&f.jsx(Wt,{label:"初始作文行数",children:f.jsx("span",{children:p.lines})}),g==="CCOMPOSITION"&&f.jsx(ft,{label:"题干区域高度",value:p.contentHeight,min:38,max:Number.MAX_SAFE_INTEGER,onChange:w=>C({contentHeight:w})})]}),p.parts.map((w,T)=>f.jsxs("div",{className:"exercise-fields",children:[f.jsx(fn,{label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}题号`,value:w.label,maxLength:10,onChange:j=>C({parts:p.parts.map(N=>N.id===w.id?{...N,label:j,choice:{...N.choice,label:j}}:N)})}),!Be(g)&&f.jsx(nn,{min:c.usage==="homework"?0:.5,label:`第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}分值`,value:w.score,max:x.score,onChange:j=>{const N=p.parts.map(M=>M.id===w.id?{...M,score:j,choice:{...M.choice,score:j}}:M);C({parts:N,score:Qn(N)})}}),["FILLBLANK","SHORTANSWER"].includes(g)&&r.type!=="MIXED"&&!r.optional&&v>1&&f.jsx(ue,{size:"small",danger:!0,"aria-label":`删除第 ${T+1} ${g==="FILLBLANK"?"空":"小题"}`,onClick:()=>{const j=p.parts.filter(N=>N.id!==w.id).map((N,M)=>({...N,label:v===2?p.label:`${p.label}.${M+1}`}));C({parts:j,score:Qn(j)})},children:"删除"}),g==="SHORTANSWER"&&!r.optional&&f.jsx(ft,{label:`第 ${T+1} 小题作答高度`,value:w.height,min:30,max:Number.MAX_SAFE_INTEGER,onChange:j=>C({parts:p.parts.map(N=>N.id===w.id?{...N,height:j}:N)})})]},w.id)),p.parts.length>0&&f.jsx(Wt,{label:"本题总分",children:f.jsx("span",{children:p.score??"未设置"})}),!Et(g)&&!Ei(g)&&f.jsx(Bt,{checked:p.halfPoint,onChange:w=>C({halfPoint:w.target.checked}),children:"计分栏显示 0.5"}),d&&f.jsx("p",{className:"card-choice-error",role:"alert",children:d}),f.jsx(ue,{size:"small",disabled:!l,onClick:()=>{if((v?p.parts:[p]).some(w=>w.score===null||w.score<(c.usage==="homework"?0:.5)||w.score>x.score)){m("请填写符合题型范围的分值");return}if(p.parts.some(w=>!w.label.trim())){m("题号不能为空");return}if(g==="INFO_MATCHING"&&v>b){m("选项个数需大于等于子题数量");return}if(g==="CHUNK_CHOICE"&&(!p.rightAnswers||p.rightAnswers>=b||p.singleScore===null||p.score!==null&&p.score!==0&&p.rightAnswers*p.singleScore>p.score)){m("正确答案个数须小于选项数,且每处得分之和不能超过题分");return}if(g==="MCHOICE"&&(p.choice.lessScore||0)>(p.score||0)){m("少选得分不能超过本题分值");return}a(p)&&u(null)},children:"应用配置"})]})}function XR({block:t,autoFocus:r,onClose:i}){const{card:a,geometry:c,setCard:l,setSelectedId:u,setDeleted:d,updateBlock:m,editQuestion:p,selectedChoiceId:C,selectChoice:g}=lt(),{dialog:x,setDialog:b,titleProps:v,cancelDrag:S}=Vl(M=>{const D=M.closest(".card-workspace")?.querySelector(".card-sidebar")?.getBoundingClientRect();return{left:(D?.left??window.innerWidth)-M.getBoundingClientRect().width-12,top:(D?.top??0)+12}}),w=E.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);E.useLayoutEffect(()=>{if(!x)return;const M=x;M.setAttribute("aria-modal","false"),M.setAttribute("aria-labelledby","card-block-modal-title");let D=document.activeElement instanceof HTMLElement?document.activeElement:null;const O=_=>{_.target instanceof HTMLElement&&!M.contains(_.target)&&(D=_.target)};return document.addEventListener("focusin",O),()=>{document.removeEventListener("focusin",O),M.contains(document.activeElement)&&D?.isConnected&&D.focus({preventScroll:!0})}},[x]),E.useLayoutEffect(()=>{x&&(x.dataset.settingsBlock=t.id)},[x,t.id]);const T=f.jsxs("div",{...v,className:"card-modal-drag","aria-label":"拖动题块设置",title:"拖动移动;方向键微调,Home 复位","data-editor-menu-avoid":!0,children:[f.jsx("h2",{id:"card-block-modal-title",children:"题块设置"}),f.jsx("p",{"aria-hidden":"true",children:t.reference?ur[t.reference.type]:Tm[t.kind]})]}),j=()=>{d({block:t,index:a.blocks.findIndex(M=>M.id===t.id)}),l(M=>({...M,blocks:M.blocks.filter(D=>D.id!==t.id)})),u(null),i()},N=f.jsxs("div",{className:"card-modal-actions",children:[f.jsxs(ue,{type:"text",danger:!0,className:"card-delete","aria-label":"删除选中题块",onClick:j,children:[f.jsx(to,{name:"trash",size:16}),"删除题块"]}),f.jsx(ue,{type:"text",onClick:()=>{const M=jo(t);l(D=>{const O=[...D.blocks];return O.splice(O.findIndex(_=>_.id===t.id)+1,0,M),{...D,blocks:O}}),u(M.id)},children:"复制题块"}),f.jsx(ue,{type:"primary",className:"card-edit-question",onClick:()=>p(t.id),children:t.areaType?"编辑文字":"编辑题目"})]});return f.jsx(Vi,{open:!0,modal:!1,panelRef:b,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(to,{name:"close",size:16}),onCancel:i,onOpenAutoFocus:M=>{M.preventDefault(),r?x?.querySelector(".ui-dialog-close")?.focus({preventScroll:!0}):w.current?.focus({preventScroll:!0})},onEscapeKeyDown:M=>{M.preventDefault(),M.stopPropagation(),S()||i()},title:T,footer:N,children:f.jsxs("div",{children:[f.jsxs("label",{className:"card-field",children:["标题",f.jsx(Aa,{"aria-label":"题块标题",value:t.title,maxLength:300,onChange:M=>m(t.id,{title:M.target.value})})]}),t.reference&&f.jsx(qR,{block:t,value:t.reference,selectedId:C(t),onSelect:M=>g(t.id,M),onChange:(M,D)=>m(t.id,{reference:M,...D?{document:D}:{}})}),!t.reference&&t.kind==="choice"&&t.choices&&f.jsx(W0,{value:t.choices,document:t.document,creation:a.creation,selectedId:C(t),onSelect:M=>g(t.id,M),onChange:M=>m(t.id,{choices:M})}),t.kind==="area"&&f.jsx(ft,{label:"区域高度",min:100,max:t.areaType==="forbiden"?Math.floor(c.contentHeight):4e3,value:t.answerHeight,onChange:M=>m(t.id,{answerHeight:M})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&t.exercise&&f.jsx($R,{value:t.exercise,kind:t.kind,blockId:t.id,selectedId:C(t),onSelect:M=>g(t.id,M),onChange:M=>m(t.id,{exercise:M})}),!t.reference&&t.kind!=="choice"&&t.kind!=="area"&&!t.exercise&&f.jsxs("div",{className:"card-range",children:["作答区高度 ",f.jsxs("b",{children:[t.answerHeight," px"]}),f.jsx(P0,{className:"ui-slider",ariaLabelForHandle:"作答区高度",min:0,max:800,step:10,value:t.answerHeight,onChange:M=>m(t.id,{answerHeight:M})}),f.jsx(ue,{size:"small",onClick:()=>{if(t.kind==="choice"||t.kind==="area")return;const M=fS(t.kind);M.items[0].area.rows=Math.ceil(t.answerHeight/M.items[0].area.rowHeight),m(t.id,{exercise:M})},children:"启用题型配置"})]})]},t.id)})}function KR(t){const r=new URLSearchParams(location.search);return{mode:r.get("mode")==="exam"?"exam":"template",name:(r.get("name")||"").slice(0,30),...xm(t,{gradeCode:r.get("gradeCode")||void 0,courseCode:r.get("courseCode")||void 0,grade:r.get("grade")||void 0,subject:r.get("subject")||void 0}),...r.get("id")?{id:r.get("id")}:{},...r.get("exampaperId")?{exampaperId:r.get("exampaperId")}:{}}}function FR({initial:t,dictionary:r,replacing:i,onCreate:a,onClose:c}){const[l,u]=E.useState(t),d={...l,...xm(r,l)},m=r.gradeCourseMap[d.gradeCode]||[],[p,C]=E.useState(""),g=E.useId(),x=E.useRef(null),{dialog:b,setDialog:v,titleProps:S}=Vl();E.useLayoutEffect(()=>{b?.setAttribute("aria-labelledby",`${g}-title`)},[b,g]);const w=f.jsx("div",{...S,className:"card-modal-drag","aria-label":"拖动新建答题卡",title:"拖动移动;方向键微调,Home 居中",children:f.jsx("h2",{id:`${g}-title`,children:"新建答题卡"})});return f.jsx(Vi,{open:!0,panelRef:v,width:460,className:"card-modal card-create-modal",title:w,closeLabel:"关闭新建答题卡",closeIcon:f.jsx(to,{name:"close",size:16}),onCancel:c,onOpenAutoFocus:T=>{T.preventDefault(),x.current?.focus({preventScroll:!0})},footer:f.jsxs("div",{className:"card-create-actions",children:[f.jsx(ue,{onClick:c,children:"取消"}),f.jsx(ue,{type:"primary",htmlType:"submit",form:g,disabled:!d.gradeCode||!d.courseCode,children:"确定"})]}),children:f.jsxs("form",{id:g,onSubmit:T=>{if(T.preventDefault(),!d.name.trim()){C("请输入题卡名称"),x.current?.focus();return}if(!d.gradeCode||!d.courseCode){C("没有可用的年级和课程");return}a({...d,name:d.name.trim()})},children:[f.jsx("div",{className:"card-create-mode",role:"group","aria-label":"创建用途",children:["template","exam"].map(T=>f.jsx(ue,{type:d.mode===T?"primary":"default","aria-pressed":d.mode===T,onClick:()=>u(j=>({...j,mode:T})),children:T==="template"?"答题卡模板":"考试答题卡"},T))}),f.jsxs("label",{className:"card-field",children:["题卡名称",f.jsx(Aa,{ref:x,"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(Zt,{"aria-label":"年级",value:d.gradeCode,disabled:!r.grades.length,onChange:T=>u(j=>({...j,...xi(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(Zt,{"aria-label":"科目",value:d.courseCode,disabled:!m.length,onChange:T=>u(j=>({...j,...xi(r,d.gradeCode,T)})),children:m.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]})]}),!r.grades.length&&f.jsx("p",{className:"card-create-error",role:"alert",children:"没有可用的年级和课程"}),p&&f.jsx("p",{id:"card-create-error",className:"card-create-error",role:"alert",children:p}),i&&f.jsx("p",{className:"card-section-note",children:"确定后将新建空白题卡并替换当前内容。"})]})})}function QR(){const{card:t,setCard:r,setQuestionCard:i,readOnly:a,geometry:c}=lt(),l=u=>r(d=>d.header?{...d,header:{...d.header,...u}}:d);return f.jsxs("div",{className:"card-sidebar-section card-paper-settings",children:[f.jsx("h1",{children:"页面布局"}),f.jsx("div",{className:"card-preset-grid",children:Object.keys(vi).map((u,d)=>f.jsxs(ue,{type:"text","aria-label":vi[u].label,"aria-pressed":t.preset===u,disabled:a,onClick:()=>r(m=>({...m,preset:u})),children:[f.jsx("span",{className:`card-paper-icon cols-${vi[u].columns}`,children:Array.from({length:vi[u].columns},(m,p)=>f.jsx("i",{},p))}),f.jsx("span",{children:["一栏","两栏","三栏"][d]})]},u))}),f.jsx("p",{className:"card-section-note",children:c.columns===1?"一栏适用于 A4、16K 纸张":`${c.columns===2?"二":"三"}栏适用于 A3、8K 纸张`}),f.jsxs("div",{className:"card-paper-options",children:[f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"使用反面"}),f.jsxs(Ge.Group,{className:"card-radio-options",size:"small",name:"paper-duplex",disabled:a,value:t.duplex===!0,onChange:u=>r(d=>({...d,duplex:u.target.value})),children:[f.jsx(Ge.Button,{value:!1,children:"关闭"}),f.jsx(Ge.Button,{value:!0,children:"开启"})]})]}),f.jsx("p",{className:"card-section-note",children:"开启后正面排满自动续到反面,仍限一张纸。"}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡用途"}),f.jsxs(Ge.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(Ge.Button,{value:"exam",children:"考试"}),f.jsx(Ge.Button,{value:"homework",children:"作业"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"批阅模式"}),f.jsxs(Ge.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(Ge.Button,{value:!1,children:"手阅"}),f.jsx(Ge.Button,{value:!0,children:"网阅"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"分值 0.5"}),f.jsxs(Ge.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(Ge.Button,{value:!0,children:"显示"}),f.jsx(Ge.Button,{value:!1,children:"不显示"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"题卡合一"}),f.jsxs(Ge.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(Ge.Button,{value:!0,children:"是"}),f.jsx(Ge.Button,{value:!1,children:"否"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题排列"}),f.jsxs(Ge.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(Ge.Button,{value:"row",children:"横排"}),f.jsx(Ge.Button,{value:"column",children:"竖排"})]})]}),f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"客观题合并"}),f.jsxs(Ge.Group,{className:"card-radio-options",size:"small",disabled:a,value:!!t.mergeObjective,onChange:u=>r(d=>({...d,mergeObjective:u.target.value})),children:[f.jsx(Ge.Button,{value:!1,children:"不合并"}),f.jsx(Ge.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(Ge.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(Ge.Button,{value:!0,children:"显示"}),f.jsx(Ge.Button,{value:!1,children:"不显示"})]})]},u)),t.recognition?.examQrCode&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"试卷 ID"}),f.jsx(Aa,{"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(Ge.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(Ge.Button,{value:!0,children:"显示"}),f.jsx(Ge.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(Ge.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(Ge.Button,{value:"code",children:"条形码"}),f.jsx(Ge.Button,{value:"school",children:"校内准考证号"})]})]}),t.header.kaohao==="school"&&f.jsxs("label",{className:"card-number-digits",children:[f.jsx("span",{children:"考号位数"}),f.jsx(Zt,{"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(Ge.Group,{className:"card-radio-options",size:"small",value:t.header.tiaomaStyle||1,onChange:u=>l({tiaomaStyle:u.target.value}),children:[f.jsx(Ge.Button,{value:1,children:"填涂"}),f.jsx(Ge.Button,{value:2,children:"条形码"})]})]}),t.header.tiaomaStyle!==2&&f.jsxs("fieldset",{className:"card-setting-row",disabled:a,children:[f.jsx("legend",{children:"班级填涂"}),f.jsxs(Ge.Group,{className:"card-radio-options",size:"small",value:t.header.classText!==!1,onChange:u=>l({classText:u.target.value}),children:[f.jsx(Ge.Button,{value:!0,children:"显示"}),f.jsx(Ge.Button,{value:!1,children:"不显示"})]})]})]})]})]})]})}function tx({settings:t,activeQuestionId:r}){if(!t.questions.length)return null;const i=mu(t),a=l=>f.jsxs("div",{className:`card-choice-row${l.id===r?" is-current-choice":""}`,"data-question-id":l.id,"aria-current":l.id===r?"true":void 0,children:[f.jsxs("b",{children:[l.label,"."]}),f.jsx("div",{className:"card-choice-options","data-marker":t.marker,children:l.options.map(u=>f.jsx("span",{className:"card-choice-glyph","data-recognition":"MultiChoice","data-recognition-role":"cell","data-answer-id":l.id,"data-option-id":u.id,"data-value":u.label,"data-marker":t.marker,children:t.marker==="check"?`○ ${u.label}.`:u.label},u.id))})]},l.id),c=[[]];for(const l of t.questions)l.breakBefore&&c[c.length-1].length&&c.push([]),c[c.length-1].push(l);return f.jsx("div",{className:"card-choice-grid","aria-label":"选择题填涂区",style:{rowGap:t.rowGap,columnGap:t.columnGap},"data-direction":i,children:i==="column"?cS(t).map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{columnGap:t.columnGap,rowGap:t.rowGap},children:l.map(d=>f.jsx("div",{className:"card-choice-column",style:{gap:t.rowGap,minHeight:t.rowsPerColumn*20+(t.rowsPerColumn-1)*t.rowGap},children:d.map(a)},d[0].id))},u)):c.map((l,u)=>f.jsx("div",{className:"card-choice-band",style:{rowGap:t.rowGap,columnGap:t.columnGap},children:l.map(a)},u))})}function nx(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 rx(t){return nx(t.closest(".card-question")||t)(t)}function ZR(t){return rx(t).top}function Xl({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:x,contentTargets:b,editorKeys:v,onContentSelect:S}){const{geometry:w,registerEditor:T}=lt(),j=JSON.stringify(v||[]),N=E.useCallback(K=>{JSON.parse(j).forEach($=>T(`content/${$}`,K))},[j,T]),M=E.useRef(null),D=E.useRef(!1);a&&(D.current=!0);const O=E.useRef([]),[_,k]=E.useState(0),L=E.useRef({id:t,visible:a,onUnits:u});L.current={id:t,visible:a,onUnits:u};const B=E.useCallback(()=>{const K=M.current?.querySelector(".rt-content"),$=K?ZR(K):0;k(ee=>Math.abs(ee-$)<.5?ee:$),L.current.onUnits(L.current.id,L.current.visible?O.current.map(ee=>({top:ee.top+$,bottom:ee.bottom+$})):[])},[]),z=E.useCallback(K=>{O.current=K,B()},[B]);E.useLayoutEffect(()=>{B()},[B,a,l.fragments,i]),E.useLayoutEffect(()=>()=>L.current.onUnits(L.current.id,[]),[]);const U=E.useMemo(()=>l.fragments.map(K=>({from:K.from-_,to:K.to-_,x:K.x-l.x,y:K.y-l.y-K.from+(K.topPadding||0)})),[l.fragments,l.x,l.y,_]);return f.jsx("div",{ref:M,className:"exercise-text",hidden:!a,children:D.current&&f.jsx(Xi,{value:i,readOnly:c||!a,uploadImage:p,ariaLabel:r,onChange:d,onEditor:N,contentTargets:b,allowContentAssignment:!1,onContentSelect:S,pagination:{slices:U,maxUnitHeight:w.contentHeight-80,onMeasure:z,onActiveSliceChange:m},choiceFillPosition:C,choiceFillBindings:g,activeChoiceQuestionId:x})})}function WR({rows:t,rowHeight:r,label:i,onChange:a}){const{scale:c}=lt(),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 ox({blank:t,item:r,active:i,fullLabel:a=!1}){return f.jsxs("div",{style:{width:`${t.width}%`},className:`exercise-flow-unit exercise-blank${i?" is-current":""}`,"data-exercise-id":r.id,"data-answer-id":t.id,children:[f.jsxs("span",{children:[a?`${r.label}.${t.label}`:`(${t.label})`," ",t.prefix]}),f.jsx("span",{className:`exercise-blank-space ${t.style}`,children:t.style==="characters"&&Array.from({length:t.characters},(c,l)=>f.jsx("i",{},l))}),f.jsx("span",{children:t.suffix})]})}function JR({area:t,item:r,active:i,readOnly:a,onResize:c,prefix:l=""}){const u={"--area-columns":t.columns,"--area-line":`${t.rowHeight}px`};return f.jsxs("div",{className:"exercise-area","data-style":t.style,style:u,children:[t.title&&f.jsxs("div",{className:`exercise-flow-unit exercise-title-line${i?" is-current":""}`,"data-exercise-id":r.id,children:["题目:",f.jsx("span",{})]}),Array.from({length:t.rows},(d,m)=>f.jsxs("div",{className:`exercise-flow-unit exercise-area-row${i?" is-current":""}`,"data-exercise-id":r.id,"data-area-row":m,style:{height:t.rowHeight,...t.backgroundUrl?{backgroundImage:`url(${JSON.stringify(t.backgroundUrl)})`,backgroundSize:`100% ${t.rows*t.rowHeight}px`,backgroundPosition:`0 -${m*t.rowHeight}px`}:{}},children:[l&&m===0&&f.jsx("span",{className:"exercise-area-prefix",children:l}),t.style==="characters"&&Array.from({length:t.columns},(p,C)=>{const g=m*t.columns+C+1;return f.jsx("span",{className:"exercise-character",children:t.wordMark>0&&g%t.wordMark===0&&f.jsxs("small",{children:[g,"字"]})},C)}),t.style==="coordinates"&&m===Math.floor(t.rows/2)&&f.jsx("span",{className:"exercise-axis-x",children:"x →"}),t.style==="coordinates"&&m===0&&f.jsx("span",{className:"exercise-axis-y",children:"↑ y"})]},m)),!a&&t.rows>0&&f.jsx(WR,{rows:t.rows,rowHeight:t.rowHeight,label:r.label,onChange:c})]})}function eN({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,x=E.useMemo(()=>new Map(t.items.filter(S=>S.kind==="choice").map(S=>[S.id,ia({...hu(0),presentation:S.presentation,questions:[S.choice]},S.document,a)])),[t.items,a]),b=(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(Xl,{id:`pool/${w.id}`,label:`共享选项 ${w.label} 正文`,value:w.document,visible:a,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:T=>d({...t,pool:t.pool.map(j=>j.id===w.id?{...j,document:T}:j)})})]},w.id)),v=["fill","completion"].includes(r)&&(!a||t.items.every(S=>En(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(Xl,{id:"chunk-material",label:"断句题面",value:{version:1,content:{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:w.map(T=>`${T.text}〔${T.label}〕`).join("")+t.chunkText.slice(S)||" "}]}]}},visible:a,readOnly:!0,placement:i,onUnits:u,onChange:()=>{},onActiveFragment:m}),f.jsxs("div",{className:"exercise-flow-unit exercise-chunk-answer",children:[t.chunkPoints.map(T=>f.jsx("span",{className:"exercise-mark","data-answer-id":T.id,children:T.label},T.id)),f.jsxs("span",{children:["(最多选 ",t.chunkMax," 处)"]})]})]})}return f.jsxs("div",{className:"exercise-content","data-exercise-kind":r,children:[v&&f.jsx("div",{className:"exercise-blanks",children:t.items.map(S=>f.jsxs(E.Fragment,{children:[S.blanks.map(w=>f.jsxs(E.Fragment,{children:[f.jsx(ox,{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")&&b(),f.jsxs("div",{hidden:v,className:r==="matching"&&t.matchingDisplay==="lines"?"exercise-matching-layout":void 0,children:[f.jsx("div",{children:r==="ordering"?f.jsx("div",{children:t.ordering==="sequence"?f.jsxs("div",{className:"exercise-flow-unit exercise-sequence",children:["排序:",g.map((S,w)=>f.jsxs("span",{children:[f.jsx("span",{className:"exercise-order-slot","data-answer-id":S.id}),w<g.length-1?"→":""]},S.id))]}):t.categories.map(S=>f.jsxs("div",{className:"exercise-flow-unit exercise-category","data-category-id":S.id,children:[f.jsxs("span",{children:[S.label,". ",S.text]}),f.jsx("span",{})]},S.id))}):t.items.map(S=>{const w=S.id===l,T=x.get(S.id),j=!v&&(S.kind==="table"||a&&(!En(S.document)||!c&&(Sm.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(Xl,{id:S.id,label:`小题 ${S.label} 正文`,value:S.document,visible:j,readOnly:c,placement:i,uploadImage:p,onUnits:u,onActiveFragment:m,onChange:N=>d({...t,items:t.items.map(M=>M.id===S.id?{...M,document:N}:M)}),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((N,M)=>f.jsx("span",{className:`exercise-mark${S.kind==="choice"||t.judgeLabels!=="words"?" exercise-choice-mark":""}`,"data-answer-id":N.id,children:S.kind==="judge"?Cm[t.judgeLabels][M]:N.label},N.id))}),r==="matching"&&t.matchingDisplay==="letters"&&f.jsx("div",{className:C(S.id,"exercise-match-letters"),"data-exercise-id":S.id,children:f.jsx("span",{className:"exercise-order-slot"})}),r!=="matching"&&S.kind==="fill"&&!v&&f.jsx("div",{className:"exercise-blanks","data-new-line":t.fillNewLine,children:S.blanks.map(N=>f.jsxs(E.Fragment,{children:[f.jsx(ox,{blank:N,item:S,active:w}),N.breakAfter&&f.jsx("span",{className:"exercise-line-break"})]},N.id))}),S.steps.map(N=>f.jsxs("div",{className:C(S.id,"exercise-step"),"data-exercise-id":S.id,"data-step-id":N.id,children:[f.jsxs("span",{children:["(",N.label,") ",N.prompt,N.score!==null?`(${N.score} 分)`:""]}),f.jsx("span",{className:"exercise-step-answer"})]},N.id)),(["answer","calculation","correction","drawing","writing","english"].includes(S.kind)||S.kind==="judge"&&S.needsReason)&&f.jsx(JR,{area:S.area,item:S,active:w,readOnly:c,onResize:N=>d({...t,items:t.items.map(M=>M.id===S.id?{...M,area:{...M.area,rows:N}}:M)})})]},S.id)})}),r==="matching"&&t.matchingDisplay==="lines"&&f.jsx("div",{children:b(!0)})]}),r==="practice"&&f.jsxs("div",{className:"exercise-flow-unit exercise-evaluation",children:["评价意见:",f.jsx("span",{})]})]})}function ax({height:t,min:r,label:i,onChange:a}){const{scale:c}=lt(),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 tN="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",nN="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 rN({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)):[tN,nN].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 tf({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:b,height:v}=rx(m.current);C(S=>S.top===b&&S.height===v?S:{top:b,height:v})};g();const x=new ResizeObserver(g);return x.observe(m.current),()=>x.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,x)=>{const b=Math.max(p.top,g.from),v=Math.min(p.top+p.height,g.to),S=b<=p.top+.5;return v>b&&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":x,style:{left:g.x-t.x,top:b-p.top+g.y-t.y-g.from+(b>g.from&&g.topPadding||0),height:v-b+(b===g.from&&g.topPadding||0)+(v===g.to&&g.bottomPadding||0)},children:S&&d},x)})]})}function oN({score:t,halfPoint:r,active:i,id:a}){const{card:c}=lt();return!c.scanMarking&&t!==null&&t>0&&f.jsx("div",{className:`exercise-flow-unit reference-score-row${i?" is-current":""}`,"data-exercise-id":a,children:DS(t,r).map((l,u)=>f.jsx("span",{"data-recognition":l?"ScoreBox":void 0,"data-answer-id":a,"data-recognition-role":"cell","data-value":l,children:l},u))})}function nf({question:t,part:r,props:i,optional:a=!1}){const{card:c,geometry:l,scale:u,selectChoice:d}=lt(),{value:m,placement:p,width:C,readOnly:g,activeId:x,uploadImage:b,onUnits:v,onActiveFragment:S,onChange:w}=i,T=r?.id||t.id,j=r?.label||t.label,N=r?.score??t.score,M=c.usage==="homework"&&N===0,D=M&&!r&&t.type==="SHORTANSWER"&&!a,O=M&&!c.scanMarking,_=x===T||x===t.id,k=E.useRef(null),[L,B]=E.useState(0),[z,U]=E.useState(()=>window.devicePixelRatio||1);E.useEffect(()=>{if(t.type!=="CCOMPOSITION")return;const re=()=>U(window.devicePixelRatio||1);return window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[t.type]);const K=r?.document||t.document,$=re=>w({...m,questions:m.questions.map(ae=>ae.id===t.id?{...ae,...re}:ae)}),ee=re=>$(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,document:re}:ae)}:{document:re}),G=a?m.optionalHeight:r?.height||t.height;E.useLayoutEffect(()=>{const re=k.current.querySelector(".reference-answer-body"),ae=()=>B(re.offsetHeight);ae();const be=new ResizeObserver(ae);return be.observe(re),()=>be.disconnect()},[]);const q=(re="")=>`exercise-flow-unit ${re}${_?" is-current":""}`,H=Math.max(0,G-L-(O?22:!c.scanMarking&&N!==null&&N>0?18:0)),P=OS(C),A=P*31+1,Y=Math.max(1,Math.round(z))/(z*u),F=`M.5 .5H${A-.5}V32.5H.5Z`+Array.from({length:P-1},(re,ae)=>`M${(ae+1)*31+.5} .5V32.5`).join(""),Z=t.type==="CCOMPOSITION"?Math.ceil(t.characters/P):Math.ceil(H/40),le=re=>a?w({...m,optionalHeight:re}):$(r?{parts:t.parts.map(ae=>ae.id===r.id?{...ae,height:re}:ae)}:{height:re});return f.jsx("div",{ref:k,className:"reference-answer","data-exercise-item":T,children:f.jsxs(tf,{placement:p,answerId:T,sectionType:c.scanMarking?"FrameOnly":D&&t.parts.length>1?"Checkbox":"ScoreBox",questionIds:a?m.questions.map(re=>re.id):void 0,className:t.type==="CCOMPOSITION"?"reference-composition":"",footer:O?f.jsx(rN,{question:t,part:r}):void 0,children:[f.jsx(oN,{score:N,halfPoint:t.halfPoint,active:_,id:T}),f.jsxs("div",{className:"reference-answer-body",children:[a&&f.jsxs("div",{className:q("reference-optional-head"),style:{minHeight:l.columns===3?104:82},"data-exercise-id":T,children:[f.jsxs("p",{children:[f.jsx("b",{children:"选做题"})," 请考生从给出的第",m.questions.map(re=>re.label).join("、"),rf(m.questions.length),"题中任选",rf(m.choose),"题作答,并用2B铅笔在答题卡上把所选题目对应的题号涂黑,注意所做题目的题号必须与所涂题号一致,如果多做,则按所做的",m.choose===1?"第一题":`前${rf(m.choose)}题`,"计分。"]}),f.jsxs("p",{children:["我选做的题号是:",m.questions.map(re=>f.jsx("span",{"data-exercise-id":re.id,"data-recognition":"QuestionChoice","data-answer-id":re.id,"data-recognition-role":"cell","data-value":re.label,children:re.label},re.id))]})]}),f.jsx("div",{className:"reference-answer-text",style:{minHeight:t.type==="CCOMPOSITION"?t.contentHeight:void 0},children:(a?m.questions.map(re=>({item:re,entryPart:void 0})):D?t.parts.map(re=>({item:t,entryPart:re})):[{item:t,entryPart:r}]).map(({item:re,entryPart:ae})=>{const be=a?re.parts[0]?.id||re.id:ae?.id||T,ye=a?re.label:ae?.label||j,ge=a||!ae||re.parts[0]?.id===ae.id,de=m.textVersion===1&&m.type!=="MIXED"&&ge,_e=de&&i.showQuestion&&re.text,Me=a?re.parts[0]?.document||re.document:ae?.document||K,Ee=_e?Gr([...Zs(re.text,re.id,re.label),...re.type==="ECOMPOSITION"?(Me.content.content||[]).slice(1):[]]):Me;return f.jsx("div",{"data-exercise-id":be,className:"reference-answer-entry",children:f.jsx(Xl,{id:`reference/${be}`,label:`第 ${ye} 题作答内容`,value:Ee,editorKeys:de?[re.id,be]:[be],contentTargets:_e?[{id:re.id,label:`第 ${re.label} 题题干`,kind:"question"}]:void 0,onContentSelect:ve=>d(i.blockId,ve),visible:!0,readOnly:g,placement:p,uploadImage:b,onUnits:v,onActiveFragment:S,onChange:_e?ve=>w({...m,questions:m.questions.map(Te=>Te.id===re.id?{...Te,text:Om(Te.text,(ve.content.content||[]).filter(At=>Te.type!=="ECOMPOSITION"||At.attrs?.contentId===Te.id)),...Te.type==="ECOMPOSITION"?{document:Gr([Te.document.content.content[0],...(ve.content.content||[]).filter(At=>At.attrs?.contentId!==Te.id)])}:{}}:Te)}):a?ve=>w({...m,questions:m.questions.map(Te=>Te.id===re.id?{...Te,document:ve,parts:Te.parts.map((At,ht)=>ht===0?{...At,document:ve}:At)}:Te)}):D&&ae?ve=>$({parts:t.parts.map(Te=>Te.id===ae.id?{...Te,document:ve}:Te)}):ee})},be)})})]}),Array.from({length:Z},(re,ae)=>f.jsx("div",{className:q(`reference-answer-row ${t.type==="CCOMPOSITION"?"reference-character-row":""}`),"data-exercise-id":T,style:{height:t.type==="CCOMPOSITION"?39.5:Math.min(40,H-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:A,height:"33",viewBox:`0 0 ${A} 33`,children:f.jsx("path",{d:F,fill:"none",stroke:"#000",strokeWidth:Y,vectorEffect:"non-scaling-stroke",shapeRendering:"crispEdges"})}),Array.from({length:P},(be,ye)=>{const ge=ae*P+ye+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,"字"]})},ye)})]})},ae)),!g&&t.type!=="CCOMPOSITION"&&f.jsx(ax,{height:G,min:30,label:`调整第 ${j} 题作答高度`,onChange:le})]})})}function rf(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 aN(t){const{value:r,placement:i,activeId:a,concentrated:c}=t,{card:l}=lt(),u=new Set(c.questions.map(m=>m.id)),d=E.useMemo(()=>{const m=[];return r.questions.forEach(p=>{const C=Et(p.type)?"choice":Ei(p.type)?"fill":"answer",g=m.at(-1);C!=="answer"&&g?.category===C?g.questions.push(p):m.push({category:C,questions:[p]})}),m},[r.questions]);return r.optional&&r.questions.length>1?f.jsx("div",{className:"reference-content",children:f.jsx(nf,{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"&&da({...r,questions:m.questions}).some(C=>u.has(C.id))&&f.jsx(tf,{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(tx,{activeQuestionId:m.questions.find(C=>C.id===a&&Be(C.type))?.parts[0]?.id||a,settings:{...c,questions:da({...r,questions:m.questions}).filter(C=>u.has(C.id))}})}),m.category==="fill"&&f.jsx(tf,{placement:i,className:"reference-fill-frame",sectionType:"Checkbox",scope:"section",answerId:`${t.blockId}/fill/${p}`,questionIds:m.questions.map(C=>C.id),children:f.jsx("div",{className:"reference-fill-grid",children:m.questions.map(C=>f.jsxs(E.Fragment,{children:[C.parts.map(g=>f.jsxs(E.Fragment,{children:[f.jsxs("div",{className:`exercise-flow-unit reference-blank${l.scanMarking?" is-online":""}${a===C.id||a===g.id?" is-current":""}`,style:{width:`${g.width}%`},"data-exercise-id":g.id,"data-answer-id":g.id,"data-recognition":"Checkbox",children:[f.jsxs("span",{className:"reference-blank-number",children:[g.label,"."]}),f.jsx("span",{className:"reference-blank-line","data-recognition":"Checkbox","data-recognition-role":"line","data-answer-id":g.id}),!l.scanMarking&&f.jsx("span",{className:"reference-blank-score","data-recognition":"ScoreBox","data-recognition-role":"cell","data-answer-id":g.id})]}),g.breakAfter&&f.jsx("span",{className:"exercise-line-break"}),r.fillNewLine&&Be(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},g.id)),r.fillNewLine&&!Be(C.type)&&f.jsx("span",{className:"exercise-line-break"})]},C.id))})}),m.category==="answer"&&m.questions.map(C=>C.type==="SHORTANSWER"&&!(l.usage==="homework"&&C.score===0)?C.parts.map(g=>f.jsx(nf,{question:C,part:g,props:t},g.id)):f.jsx(nf,{question:C,props:t},C.id)),p<d.length-1&&f.jsx("div",{className:"reference-section-gap"})]},m.questions[0].id))})}function ix({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:x,onActiveFragment:b,onSettings:v,onMeasure:S,onDocument:w,onHeight:T,onExercise:j,onReference:N}){const{card:M,geometry:D,pageCount:O,selectChoice:_}=lt(),k=E.useMemo(()=>r.reference?K0(r):void 0,[r.id,r.reference]),L=E.useMemo(()=>r.reference?ia({...r.reference.layout,questions:da(r.reference)},r.document,m):r.kind==="choice"&&r.choices?ia(r.choices,r.document,m):void 0,[r.reference,r.kind,r.choices,r.document,m]),z=!(r.reference?.textVersion===1&&r.reference.questions.length>0&&["SHORTANSWER","ECOMPOSITION","CCOMPOSITION"].includes(r.reference.type))&&!t&&r.id!==rr&&m&&(!d||!(r.exercise||r.reference)||!En(r.document)||!!L?.bindings.length),U=E.useRef(null),K=E.useCallback(pe=>{U.current=pe,g(r.id,pe)},[r.id,g]),$=E.useMemo(()=>r.reference?TR(r.document,r.reference,c):r.document,[r.document,r.reference,c]);E.useEffect(()=>{U.current?.syncDocument($)},[$]);const ee=E.useRef(null),G=E.useRef(S);G.current=S;const q=E.useRef([]),H=E.useRef(new Map),[P,A]=E.useState(0),[Y,F]=E.useState(0),Z=E.useRef(()=>{}),le=pe=>{const yt=a.fragments.find(Fe=>pe>=Fe.from-.5&&pe<Fe.to-.5);return yt?{x:yt.x-a.x,y:yt.y-a.y-yt.from+(yt.topPadding||0)}:{x:0,y:0}};Z.current=()=>{const pe=ee.current,yt=pe?.querySelector(".card-question-document .rt-content");if(t||!pe||!yt)return;const Fe=nx(pe.parentElement),On=z?Fe(yt).top:0;A(ke=>Math.abs(ke-On)<.5?ke:On);const Mn=z?q.current.map(ke=>({top:On+ke.top,bottom:On+ke.bottom})):[];H.current.forEach(ke=>Mn.push(...ke)),pe.querySelectorAll(".card-choice-row, .exercise-flow-unit").forEach(ke=>{if(ke.offsetParent===null)return;const{top:ct,height:_n}=Fe(ke);Mn.push({top:ct,bottom:ct+_n});const Nt=le(ct);ke.style.translate=`${Nt.x}px ${Nt.y}px`}),pe.querySelectorAll("[data-exercise-resize]").forEach(ke=>{const ct=le(Fe(ke).top);ke.style.translate=`${ct.x}px ${ct.y}px`});const Oa=pe.querySelector(".card-answer-space:not(.card-answer-fragment)");if(Oa){const{top:ke,height:ct}=Fe(Oa);F(Nt=>Math.abs(Nt-ke)<.5?Nt:ke);const _n=r.kind==="fill"?40:28;for(let Nt=ke;Nt<ke+ct;Nt+=_n)Mn.push({top:Nt,bottom:Math.min(Nt+_n,ke+ct)})}const Uo=Fe(pe),on=pe.querySelectorAll(".reference-character-row"),Rt=on.length?Fe(on[0]).top:void 0,mn=on.length?Fe(on[on.length-1]).top:void 0,Ht=Math.min(...Mn.map(ke=>ke.bottom)),Ki=[...new Set(Mn.flatMap(ke=>[ke.top,ke.bottom]))].filter(ke=>ke>=Ht&&ke<Uo.height&&!Mn.some(ct=>ke>ct.top+.5&&ke<ct.bottom-.5)).filter(ke=>mn===void 0||ke<=mn).sort((ke,ct)=>ke-ct),Ma=Array.from(pe.querySelectorAll("[data-marking-frame]")).map(ke=>{const{top:ct,height:_n}=Fe(ke);return{from:ct,to:ct+_n}});G.current({width:Uo.width,height:Uo.height,breaks:Ki,markingFrames:Ma,...Rt!==void 0?{compositionStart:Rt}:{}})};const re=E.useCallback(pe=>{q.current=pe,Z.current()},[]),ae=E.useCallback((pe,yt)=>{H.current.set(pe,yt),Z.current()},[]),be=E.useMemo(()=>a.fragments.map(pe=>({from:pe.from-P,to:pe.to-P,x:pe.x-a.x,y:pe.y-a.y-pe.from+(pe.topPadding||0)})),[a.fragments,a.x,a.y,P]);E.useLayoutEffect(()=>{Z.current()},[a.fragments,r.answerHeight,r.choices,r.exercise,r.reference,m,z,t]);const ye=E.useRef(null),ge=pe=>{pe.preventDefault(),pe.stopPropagation(),pe.currentTarget.focus(),ye.current={y:pe.clientY,height:r.answerHeight},pe.currentTarget.setPointerCapture(pe.pointerId)},de=pe=>{ye.current&&T(Math.max(0,Math.min(800,Math.round(ye.current.height+(pe.clientY-ye.current.y)/l))))},_e=pe=>{ye.current=null,pe.currentTarget.releasePointerCapture(pe.pointerId)},Me=()=>{ye.current&&T(ye.current.height),ye.current=null},Ee=pe=>{pe.key==="Escape"&&ye.current&&Me(),(pe.key==="ArrowUp"||pe.key==="ArrowDown")&&(pe.preventDefault(),T(Math.max(0,Math.min(800,r.answerHeight+(pe.key==="ArrowDown"?10:-10)))))};E.useEffect(()=>{const pe=ee.current;let yt=0;const Fe=new ResizeObserver(()=>{cancelAnimationFrame(yt),yt=requestAnimationFrame(()=>Z.current())});return Fe.observe(pe),()=>{Fe.disconnect(),cancelAnimationFrame(yt)}},[]);const ve=le(Y+r.answerHeight-1),Te=`${ve.x}px ${ve.y}px`,At=a.fragments.length>1,ht=r.reference&&L&&f.jsx(aN,{blockId:r.id,showQuestion:m,value:r.reference,concentrated:M.mergeObjective&&r.id!==rr?{...L.concentrated,questions:[]}:L.concentrated,placement:a,width:c,readOnly:d,activeId:p,onUnits:ae,onChange:N,onActiveFragment:b,uploadImage:C}),rn=r.reference&&(Et(r.reference.type)||r.id===rr);return f.jsx("article",{hidden:t,inert:a.page>=O,"aria-hidden":a.page>=O?!0:void 0,className:`card-question${u&&!d?" is-selected":""}${a.overflowing?" is-overflowing":""}${At?" 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:!At&&a.fragments[0]?.bottomPadding?a.height+a.fragments[0].bottomPadding:void 0,maxHeight:a.overflowing?a.available:void 0},onPointerDownCapture:()=>{d||x()},onFocusCapture:()=>{d||x()},"aria-label":r.title||`题块 ${i+1}`,children:f.jsxs("div",{className:"card-question-content",ref:ee,children:[f.jsxs("div",{className:"card-question-heading",children:[f.jsx("h2",{children:d?r.title||`题块 ${i+1}`:f.jsx("button",{className:"card-question-title","aria-label":`设置题块 ${i+1}`,"aria-haspopup":"dialog",title:"打开题块设置",onClick:v,children:r.title||`题块 ${i+1}`})}),f.jsx("span",{children:String(i+1).padStart(2,"0")})]}),L&&!r.reference&&f.jsx(tx,{settings:L.concentrated,activeQuestionId:p}),rn&&ht,f.jsx("div",{className:"card-question-document",hidden:!z,children:f.jsx(Gl,{ref:K,initialValue:r.document,readOnly:d||!z,uploadImage:C,ariaLabel:`题块 ${i+1} 正文`,onChange:w,pagination:{slices:be,maxUnitHeight:D.contentHeight-80,onMeasure:re,onActiveSliceChange:b},choiceFillPosition:L?.position,choiceFillBindings:L?.bindings,activeChoiceQuestionId:p,contentTargets:k,allowContentAssignment:r.reference?.textVersion!==1,onContentSelect:pe=>{pe!==r.id&&_(r.id,pe)}})}),!rn&&ht,!r.reference&&r.exercise&&r.kind!=="choice"&&r.kind!=="area"&&f.jsx(eN,{value:r.exercise,kind:r.kind,placement:a,showQuestion:m,readOnly:d,activeId:p,onUnits:ae,onChange:j,onActiveFragment:b,uploadImage:C}),!r.reference&&!r.exercise&&r.kind!=="choice"&&f.jsx("div",{className:`card-answer-space ${r.kind}${At?" 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:Te},children:r.kind==="writing"?"作文格":"作答区域"}),f.jsx("button",{className:"card-height-handle","aria-label":`调整题块 ${i+1} 作答高度`,title:"上下拖动调整作答区;方向键微调,Esc 取消",style:{translate:Te},onPointerDown:ge,onPointerMove:de,onPointerUp:_e,onPointerCancel:Me,onLostPointerCapture:()=>{ye.current=null},onKeyDown:Ee,children:f.jsx("span",{})})]})}),At&&!r.reference&&!r.exercise&&r.kind!=="choice"&&a.fragments.map((pe,yt)=>{const Fe=Math.max(pe.from,Y),On=Math.min(pe.to,Y+r.answerHeight);return On>Fe&&f.jsx("div",{"aria-hidden":"true",className:`card-answer-space card-answer-fragment ${r.kind}`,style:{left:pe.x-a.x,top:Fe+pe.y-a.y-pe.from,width:c,height:On-Fe,backgroundPositionY:`${Y-Fe-1}px`}},yt)})]})})}function sx({block:t,index:r,placement:i,onMeasure:a,onActiveFragment:c}){const{geometry:l,pageCount:u,readOnly:d,selectedId:m,setSelectedId:p,updateBlock:C,registerEditor:g,uploadImage:x}=lt(),b=E.useRef(null),[v,S]=E.useState([]),w=E.useRef(null),T=E.useCallback(O=>{w.current=O,g(t.id,O)},[t.id,g]);E.useEffect(()=>{JSON.stringify(w.current?.getDocument())!==JSON.stringify(t.document)&&w.current?.syncDocument(t.document)},[t.document]);const j=Math.max(t.answerHeight,(v.at(-1)?.bottom||0)+12),N=E.useRef(a);N.current=a,E.useLayoutEffect(()=>{const O=(v.at(-1)?.bottom||0)+6,_=[...v.map(k=>k.bottom+6),...Array.from({length:Math.max(0,Math.floor((j-O)/40))},(k,L)=>O+(L+1)*40)];N.current({width:l.columnWidth,height:j,breaks:t.areaType==="forbiden"?[]:_})},[l.columnWidth,j,v,t.areaType]);const M=E.useMemo(()=>i.fragments.map(O=>({from:O.from-6,to:O.to-6,x:O.x-i.x,y:O.y-i.y-O.from})),[i]),D=i.fragments.at(-1);return f.jsxs("article",{inert:i.page>=u,"aria-hidden":i.page>=u?!0:void 0,className:`card-question card-area-block${m===t.id&&!d?" 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:j+(i.fragments.length===1&&D.bottomPadding||0),maxHeight:i.overflowing?i.available:void 0},onPointerDownCapture:()=>{d||p(t.id)},children:[i.fragments.map((O,_)=>f.jsx("div",{className:"card-area-border","data-recognition":t.areaType==="forbiden"?"Blank":"FrameOnly","data-answer-id":t.id,"data-fragment":_,style:{left:O.x-i.x,top:O.y-i.y,height:O.to-O.from+(O.bottomPadding||0),width:l.columnWidth}},_)),f.jsx("div",{className:"card-area-text",ref:b,children:f.jsx(Gl,{ref:T,initialValue:t.document,readOnly:d,ariaLabel:`题块 ${r+1} 区域文字`,uploadImage:x,onChange:O=>C(t.id,{document:O}),pagination:{slices:M,maxUnitHeight:l.contentHeight-12,onMeasure:S,onActiveSliceChange:c}})}),!d&&f.jsx("div",{className:"card-area-resize",style:{left:D.x-i.x,top:D.y-i.y+D.to-D.from+(D.bottomPadding||0)-12,width:l.columnWidth},children:f.jsx(ax,{height:t.answerHeight,min:100,label:"调整区域高度",onChange:O=>C(t.id,{answerHeight:Math.min(t.areaType==="forbiden"?l.contentHeight:4e3,O)})})})]})}function iN({block:t,onClose:r}){return f.jsx(DR,{children:f.jsx(sN,{block:t,onClose:r})})}function sN({block:t,onClose:r}){const{card:i,geometry:a,measurements:c,placementById:l,overflowById:u,draftQuestionMode:d,readOnly:m,registerEditor:p,updateBlock:C,uploadImage:g,selectedChoiceId:x,openSettings:b}=lt(),{setDialog:v,titleProps:S,cancelDrag:w}=Vl(),[T,j]=E.useState(c[t.id]?.height||400),N=E.useCallback(B=>j(z=>Math.abs(z-B.height)<.5?z:B.height),[]),M=E.useMemo(()=>({id:t.id,page:0,column:0,x:0,y:0,height:T,available:T,overflowing:!1,fragments:[{page:0,column:0,x:0,y:0,from:0,to:T}]}),[t.id,T]),D=u.get(t.id)||l.get(t.id),O=D?.overflowFrom,_=D?.id===t.id&&(!d||i.questionCard||t.areaType)?O:O===void 0?void 0:0,k=i.blocks.findIndex(B=>B.id===t.id),L=()=>{r(),b(t.id)};return f.jsx(Vi,{open:!0,modal:!1,panelRef:v,className:"card-modal card-draft-modal",width:Math.min(window.innerWidth-32,a.columnWidth+48),zIndex:950,closeLabel:"关闭完整内容",closeIcon:f.jsx(to,{name:"close",size:16}),onCancel:r,onOpenAutoFocus:B=>B.preventDefault(),onEscapeKeyDown:B=>{B.preventDefault(),B.stopPropagation(),w()||r()},title:f.jsxs("div",{...S,className:"card-modal-drag","aria-label":"拖动完整内容窗口",children:[f.jsx("h2",{children:"完整内容"}),f.jsx("p",{children:t.title})]}),footer:f.jsxs(f.Fragment,{children:[f.jsx("span",{role:"status",className:O===void 0?"card-draft-fits":"card-draft-warning",children:O===void 0?"已全部排入纸张":"有内容未排入纸张"}),!m&&f.jsx(ue,{type:"text",onClick:L,children:"题块设置"}),f.jsx(ue,{onClick:r,children:"关闭"})]}),children:f.jsxs("div",{className:"card-draft-canvas",style:{width:a.columnWidth,height:T},children:[t.kind==="area"?f.jsx(sx,{block:t,index:k,placement:M,onMeasure:N,onActiveFragment:()=>{}}):f.jsx(ix,{block:t,index:k,placement:M,width:a.columnWidth,scale:1,selected:!1,readOnly:m,showQuestion:d||i.questionCard!==!1,activeChoiceId:x(t),uploadImage:g,registerEditor:p,onSelect:()=>{},onActiveFragment:()=>{},onSettings:L,onMeasure:N,onDocument:B=>C(t.id,{document:B}),onHeight:B=>C(t.id,{answerHeight:B}),onExercise:B=>C(t.id,{exercise:B}),onReference:B=>C(t.id,{reference:B})}),_!==void 0&&f.jsx("div",{className:"card-draft-overflow-range","data-overflow-from":_,style:{top:Math.min(_,T),bottom:0},children:f.jsx("span",{children:_>0?"以下内容未排入纸张":"此题块有内容未排入纸张"})})]})})}function lN(){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:x,openSettings:b,draftBlockId:v,setDraftBlockId:S,openDraft:w,readOnly:T,setReadOnly:j,titleOverflow:N,deleted:M,setDeleted:D,overflow:O,overflowById:_,placementById:k,fitPage:L,moveBlock:B,selectBlock:z,download:U}=lt(),K=t.blocks.find(P=>P.id===C),$=t.blocks.find(P=>P.id===v),[ee,G]=E.useState(!1),[q,H]=E.useState(null);return f.jsxs("div",{className:"card-controls",children:[f.jsxs("aside",{className:"card-sidebar","aria-label":"制卡设置",children:[f.jsxs("div",{className:"card-panel-header",children:[f.jsx("strong",{children:"制卡设置"}),f.jsx("a",{"data-card-demo-link":"",href:"/rich-text",children:"富文本编辑 ↗"})]}),f.jsxs("div",{className:"card-panel-actions",children:[f.jsxs("div",{className:"card-mode","aria-label":"制卡模式",children:[f.jsx(ue,{type:"text","aria-pressed":!T,onClick:()=>j(!1),children:"编辑"}),f.jsx(ue,{type:"text","aria-pressed":T,onClick:()=>j(!0),children:"预览"})]}),f.jsxs(ue,{type:"text",onClick:U,className:"card-export",children:[f.jsx(to,{name:"upload",size:15}),a]})]}),i&&f.jsx("div",{className:"card-overflow-notice",role:"status",children:i}),f.jsx("div",{className:"card-panel-fit",children:f.jsx(ue,{type:"text",onClick:L,children:"适合宽度"})}),O.length>0&&f.jsx("div",{className:"card-overflow-notice",role:"alert",children:"内容超出一张纸,暂不可保存或导出。请编辑标记的题块。"}),N&&f.jsx("div",{className:"card-overflow-notice",role:"alert",children:"卷头内容超出可用区域,请拖高标题或调整内容、版式。"}),f.jsxs("div",{className:"card-sidebar-section card-document-section",children:[f.jsx("strong",{className:"card-document-name",children:t.title||"未新建答题卡"}),t.creation&&f.jsxs("p",{className:"card-section-note",children:[t.creation.mode==="template"?"答题卡模板":"考试答题卡"," · ",t.creation.grade," · ",t.creation.subject]}),f.jsx(ue,{type:"text",className:"card-add-component",onClick:()=>u(!0),children:"新建答题卡"})]}),f.jsx(QR,{}),f.jsxs("div",{className:"card-sidebar-section card-outline-section",children:[f.jsxs("div",{className:"card-section-heading",children:[f.jsx("h2",{children:"题块"}),f.jsxs("span",{children:[t.blocks.length," 个"]})]}),f.jsx("p",{className:"card-section-note",children:"拖动列表调整顺序,点击打开题块设置"}),!t.blocks.length&&f.jsx("p",{className:"card-section-note",children:"从一道题开始,添加空白题块后编辑内容。"}),f.jsx("ol",{className:"card-outline",children:t.blocks.map((P,A)=>{const Y=k.get(P.id),F=_.has(P.id);return f.jsxs("li",{className:m===P.id?"active":"",draggable:!T,onDragStart:Z=>{H(P.id),Z.dataTransfer.effectAllowed="move",Z.dataTransfer.setData("text/plain",P.id)},onDragEnd:()=>H(null),onDragOver:Z=>{!T&&q&&Z.preventDefault()},onDrop:Z=>{Z.preventDefault(),q&&!T&&B(q,A),H(null)},children:[f.jsxs(ue,{type:"text",className:"card-outline-item","aria-haspopup":T?void 0:"dialog",onClick:()=>{T?z(P.id,!0):b(P.id)},children:[f.jsx("span",{className:"card-outline-number",children:String(A+1).padStart(2,"0")}),f.jsxs("span",{children:[f.jsx("strong",{children:P.title||Tm[P.kind]}),f.jsx("small",{children:F?"有内容未排入纸张":`第 ${Y.column+1} 栏`})]})]}),F&&f.jsx(ue,{type:"text",className:"card-open-draft","aria-label":`编辑题块 ${A+1} 完整内容`,onClick:()=>w(P.id),children:"查看完整内容"}),!T&&f.jsxs("div",{className:"card-reorder",children:[f.jsx(ue,{type:"text","aria-label":`上移题块 ${A+1}`,title:"上移",disabled:A===0,onClick:()=>B(P.id,A-1),children:"↑"}),f.jsx(ue,{type:"text","aria-label":`下移题块 ${A+1}`,title:"下移",disabled:A===t.blocks.length-1,onClick:()=>B(P.id,A+1),children:"↓"})]})]},P.id)})}),!T&&f.jsx("div",{className:"card-add",children:f.jsx(ue,{type:"text","aria-haspopup":"dialog",onClick:()=>G(!0),children:"+ 添加题块"})})]}),f.jsxs("div",{className:"card-sidebar-bottom",children:[f.jsx("span",{className:"card-version-dot"}),"自动排版已开启",f.jsx("span",{children:"连续换栏"})]})]}),l&&f.jsx(FR,{initial:KR(r),dictionary:r,replacing:!!(t.paperTitle||t.blocks.length),onCreate:d,onClose:()=>u(!1)}),K&&!T&&f.jsx(XR,{block:K,autoFocus:x,onClose:()=>g(null)}),$&&f.jsx(iN,{block:$,onClose:()=>S(null)},$.id),ee&&!T&&!l&&f.jsx(LR,{creation:t.creation,questionCard:t.questionCard,onClose:()=>G(!1),onAdd:P=>{const A=P==="forbiden"||P==="editArea"?bS(P):_m(P);c(Y=>{const F=[...Y.blocks],Z=F.findIndex(le=>le.id===m);return F.splice(Z>=0?Z+1:F.length,0,A),{...Y,blocks:F}}),G(!1),b(A.id)}}),M&&f.jsxs("div",{className:"card-toast",role:"status",children:["题块已删除",f.jsx(ue,{type:"text",onClick:()=>{c(P=>{const A=[...P.blocks];return A.splice(M.index,0,M.block),{...P,blocks:A}}),p(M.block.id),D(null)},children:"撤销"}),f.jsx(ue,{type:"text","aria-label":"关闭删除提示",onClick:()=>D(null),children:f.jsx(to,{name:"close",size:14})})]})]})}function lx({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 of(){return f.jsxs("div",{className:"card-barcode-area","data-recognition":"StudentId","data-value":"barcode",children:[f.jsx("div",{children:"贴条形码区"}),f.jsx("small",{children:"正面朝上,切勿贴出虚线方框"})]})}function Kl(){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 cx({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(Kl,{})]})}function cN({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(lx,{seat:t.writeKaohao}),(d||p)&&f.jsx(Kl,{}),!c&&g&&f.jsx(cx,{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},(x,b)=>f.jsxs("div",{className:"card-exam-number-column",children:[f.jsx("div",{className:"card-exam-number-input"}),Array.from({length:10},(v,S)=>f.jsxs("div",{className:"card-exam-number-digit","data-recognition-cell":`${b+1}:${S}`,children:["[",f.jsx("span",{children:S}),"]",i&&b===7&&(S===0||S===9)&&f.jsx("i",{className:`card-reference-point ${S===0?"top":"bottom"}`,"data-recognition":"ReferencePoint"})]},S))]},b))})]}),t.kaohao==="code"&&!t.mifeng&&f.jsx(of,{}),(l||u)&&f.jsx(Kl,{})]}),m&&f.jsx(Kl,{}),c&&g&&f.jsx(cx,{focusText:t.focusText,marks:C})]})}function uN({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(lx,{seat:t.writeKaohao}),t.kaohao==="code"&&f.jsx(of,{})]})]})}function ux({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 dN({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(of,{}):f.jsxs("div",{className:"card-homework-number",children:[t.classText!==!1&&f.jsx(ux,{kind:"ClassId"}),f.jsx(ux,{kind:"StudentId"})]})]})}function fN({title:t,page:r=0}){const{card:i,setCard:a,readOnly:c,geometry:l,scale:u,setTitleMeasurement:d,uploadImage:m,registerEditor:p}=lt(),C=E.useRef(null),g=E.useRef(null),x=E.useRef(null);E.useEffect(()=>{const w=`title/${t.id}/${r}`;return p(w,x.current),()=>p(w,null)},[t.id,r,p]);const b=E.useRef(null),v=E.useCallback(()=>{const w=C.current,T=g.current;if(!w||!T||r!==0)return;const j={id:t.id,width:w.offsetWidth,height:w.offsetHeight,overflowing:w.scrollHeight>w.clientHeight+1||T.scrollHeight>T.clientHeight+1};d(N=>N?.id===j.id&&N.width===j.width&&N.height===j.height&&N.overflowing===j.overflowing?N:j)},[t.id,r,d]);E.useLayoutEffect(()=>{const w=new ResizeObserver(v);return w.observe(C.current),w.observe(g.current),v(),()=>w.disconnect()},[v]),E.useEffect(()=>{x.current?.getDocument()&&JSON.stringify(x.current.getDocument())!==JSON.stringify(t.document)&&x.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+$r)+l.topInset,left:l.columnX(r,0),width:l.titleWidth,maxHeight:l.contentHeight,paddingBottom:i.header?10:Si},children:[f.jsxs("div",{className:"card-paper-title",style:{height:t.height},children:[f.jsx("div",{ref:g,className:"card-paper-title-body",children:f.jsx(Gl,{ref:x,initialValue:t.document,readOnly:c,uploadImage:m,ariaLabel:r?`第 ${r+1} 面纸面标题`:"纸面标题",onLayout:v,onChange:w=>a(T=>T.paperTitle?.id===t.id&&JSON.stringify(T.paperTitle.document)!==JSON.stringify(w)?{...T,paperTitle:{...T.paperTitle,document:w}}:T)})}),!c&&f.jsx("button",{className:"card-title-height-handle","aria-label":"调整标题高度",title:"调整输入框高度",onPointerDown:w=>{w.button===0&&(w.preventDefault(),w.stopPropagation(),b.current={y:w.clientY,height:t.height},w.currentTarget.setPointerCapture(w.pointerId))},onPointerMove:w=>{b.current&&S(b.current.height+(w.clientY-b.current.y)/u)},onPointerUp:w=>{b.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId)},onPointerCancel:()=>{b.current&&S(b.current.height),b.current=null},onLostPointerCapture:()=>{b.current=null},onKeyDown:w=>{w.key==="Escape"&&b.current&&(S(b.current.height),b.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(dN,{settings:i.header,columns:l.columns}):f.jsx(cN,{settings:i.header,columns:l.columns,pointBlack:i.recognition?.pointBlack}))]})}function hN({value:t,left:r,top:i}){const a=E.useMemo(()=>{try{return Hm(t)}catch{return null}},[t]);return a&&f.jsxs("svg",{className:"card-exam-qr","data-recognition":"ExamQrCode","data-value":t,"aria-label":"试卷二维码",style:{left:r,top:i},width:"40",height:"40",viewBox:`0 0 ${a.count} ${a.count}`,shapeRendering:"crispEdges",children:[f.jsx("rect",{width:a.count,height:a.count,fill:"white"}),f.jsx("path",{d:a.path,fill:"black"})]})}const mN=["topLeft","topRight","bottomLeft","bottomRight"];function pN({card:t,geometry:r,page:i,pageCount:a}){const c=r.columnX(i,0),l=r.columnX(i,r.columns-1)+r.columnWidth,u=r.topInset-31,d=r.height-r.bottomInset+16,m=kS(i+1),p=Dm(t.creation),C=p&&Eu[p],g=t.recognition?.examQrCode&&t.creation?.exampaperId!==void 0&&i%2===0,x=b=>({left:b%2?l-(b<2?26:13):c,top:b<2?u:d,width:b<2?26:13,height:b<2?13:26});return f.jsxs(E.Fragment,{children:[mN.map((b,v)=>f.jsx("div",{className:"card-registration-mark","data-anchor":b,style:x(v)},b)),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((b,v)=>f.jsx("i",{"data-value":b,"data-recognition-cell":String(v+1),className:b==="1"?"is-filled":""},v))}),i%2===0&&t.recognition?.subjectMarkers!==!1&&C&&f.jsx("div",{className:"card-code-marks","data-recognition":"SubjectCode","data-value":p,"aria-label":"学科识别标记",style:{left:r.columnX(i,r.columns>1?1:0)+Math.min(100,Math.max(30,r.columnWidth-140)),top:d-14},children:[1,2,3,4].map(b=>f.jsx("i",{"data-value":C.includes(b)?"1":"0","data-recognition-cell":String(b),className:C.includes(b)?"is-filled":""},b))}),g&&f.jsx(hN,{value:String(t.creation.exampaperId),left:r.columns===1?c+(r.columnWidth-40)/2:c+r.columnWidth-40,top:r.topInset-56})]})}function gN(){const{card:t,paperRoot:r,paperBlocks:i,selectedId:a,setSelectedId:c,selectedChoiceId:l,selectChoice:u,settingsId:d,openSettings:m,openDraft:p,overflow:C,overflowById:g,registerEditor:x,editingQuestionId:b,setMeasurements:v,readOnly:S,scale:w,geometry:T,pageCount:j,totalHeight:N,placementById:M,updateBlock:D,uploadImage:O}=lt(),_=E.useRef(null),k=E.useId(),[L,B]=E.useState(null),z=(P,A)=>B(Y=>Y?.id===P&&Y.index===A?Y:{id:P,index:A}),U=P=>{const A=P instanceof Element?P.closest("[data-block-id], [data-block-fragment]"):null;return A?.dataset.blockId||A?.dataset.blockFragment},K=t.blocks.find(P=>P.id===d),$=K&&l(K),ee=i.find(P=>P.id===rr),G=ee?.reference&&$&&Js(ee.reference).some(P=>P.id===$)?K:t.blocks.find(P=>P.reference?.questions.some(A=>Et(A.type))),q=ee?[ee,...t.blocks.map(P=>i.find(A=>A.id===P.id)||P)]:i,H=P=>P===rr&&G?.id||P;return f.jsxs("div",{ref:r,className:"card-sheet-stack",style:{width:T.width,height:N},onPointerDownCapture:P=>{const A=U(P.target);_.current=!S&&P.button===0&&A?{id:A,x:P.clientX,y:P.clientY}:null},onPointerCancelCapture:()=>{_.current=null},onClickCapture:P=>{const A=_.current;if(_.current=null,!S&&P.button===0&&A&&U(P.target)===A.id&&Math.hypot(P.clientX-A.x,P.clientY-A.y)<5){const Y=P.target instanceof Element?P.target.closest("[data-question-id], [data-fill-question-id], [data-exercise-id], [data-exercise-item], [data-answer-id], [data-content-id]"):null,F=Y?.dataset.answerId||Y?.dataset.questionId||Y?.dataset.fillQuestionId||Y?.dataset.exerciseId||Y?.dataset.exerciseItem||Y?.dataset.contentId,Z=t.blocks.find(le=>F&&le.reference&&Js(le.reference).some(re=>re.id===F))||t.blocks.find(le=>le.id===H(A.id));F&&(Z?.reference?Js(Z.reference):Z?.choices?.questions||Z?.exercise?.items)?.some(le=>le.id===F)&&u(Z.id,F),m(Z?.id||H(A.id),!1)}},children:[Array.from({length:j},(P,A)=>f.jsxs("div",{className:"card-sheet","data-paper-page":A+1,"data-paper-side":A===0?"front":"back",style:{top:A*(T.height+$r),width:T.width,height:T.height},children:[t.duplex&&f.jsx("span",{className:"card-paper-side-label",children:A===0?"正面":"反面"}),t.header&&f.jsx(pN,{card:t,geometry:T,page:A,pageCount:j}),t.header&&!S&&Array.from({length:T.columns},(Y,F)=>f.jsx("div",{className:"card-column-guide",style:{left:T.columnX(A,F),width:T.columnWidth,top:T.topInset,bottom:T.bottomInset}},F)),t.usage!=="homework"&&t.header?.mifeng&&f.jsx("div",{className:"card-seal",style:{left:A%2===0?T.margin:T.width-T.margin-T.sealWidth,width:T.sealWidth},children:f.jsx(uN,{settings:t.header,back:A%2!==0})}),t.header&&Array.from({length:T.columns},(Y,F)=>f.jsx("div",{className:"card-paper-footer",style:{left:T.columnX(A,F),width:T.columnWidth,bottom:20},children:f.jsxs("span",{children:["第",A*T.columns+F+1,"页 共",j*T.columns,"页"]})},F))]},A)),t.paperTitle&&Array.from({length:j},(P,A)=>T.hasHeader(A)&&f.jsx(fN,{title:t.paperTitle,page:A},`${t.paperTitle.id}/${A}`)),f.jsx("svg",{width:"0",height:"0","aria-hidden":"true",style:{position:"absolute"},children:f.jsx("defs",{children:f.jsx("clipPath",{id:k,clipPathUnits:"userSpaceOnUse",children:Array.from({length:j},(P,A)=>f.jsx("rect",{x:"0",y:A*(T.height+$r),width:T.width,height:T.height-T.bottomInset},A))})})}),f.jsxs("div",{className:"card-paper-content",style:{width:T.width,height:N-T.bottomInset,clipPath:`url(#${k})`},children:[i.flatMap(P=>{const A=M.get(P.id).fragments,Y=L?.id===P.id?Math.min(L.index,A.length-1):0;return A.length>1?A.map((F,Z)=>F.page<j&&f.jsx("div",{className:`card-fragment-frame${a===H(P.id)&&!S&&Z===Y?" is-selected":""}`,"data-block-fragment":P.id,"data-page":F.page+1,"data-column":F.column+1,style:{left:F.x,top:F.y,width:T.columnWidth,height:F.to-F.from+(F.topPadding||0)+(F.bottomPadding||0)},onPointerDown:()=>{S||(z(P.id,Z),c(H(P.id)))}},`${P.id}/${Z}`)):[]}),q.map((P,A)=>{const Y=F=>v(Z=>{const le=Z[P.id];return le&&le.compositionStart===F.compositionStart&&JSON.stringify(le.markingFrames)===JSON.stringify(F.markingFrames)&&Math.abs(le.width-F.width)<.5&&Math.abs(le.height-F.height)<.5&&JSON.stringify(le.breaks)===JSON.stringify(F.breaks)?Z:{...Z,[P.id]:F}});return P.kind==="area"?f.jsx(sx,{block:P,index:A,placement:M.get(P.id),onMeasure:Y,onActiveFragment:F=>z(P.id,F)},P.id):f.jsx(ix,{hidden:!i.some(F=>F.id===P.id),block:P,index:A,placement:M.get(P.id),width:T.columnWidth,scale:w,selected:a===H(P.id),readOnly:S,activeChoiceId:!S&&d===H(P.id)?l(t.blocks.find(F=>F.id===H(P.id))||P):void 0,showQuestion:t.questionCard!==!1||!S&&b===P.id,registerEditor:x,uploadImage:O,onSelect:()=>c(H(P.id)),onActiveFragment:F=>z(P.id,F),onSettings:()=>{z(P.id,0),m(H(P.id))},onDocument:F=>D(P.id,{document:F}),onHeight:F=>D(P.id,{answerHeight:F}),onExercise:F=>D(P.id,{exercise:F}),onReference:F=>{P.id!==rr&&D(P.id,{reference:F})},onMeasure:Y},P.id)})]}),C.length>0&&f.jsx("button",{type:"button",className:"card-paper-capacity-notice",style:{right:T.margin+22,top:Math.min(N-T.bottomInset+2,N-22),maxWidth:T.columnWidth*.5},onClick:()=>{const P=g.keys().next().value;P&&p(P)},children:"还有内容未排入纸张 · 查看"})]})}const yN=()=>{const{navigatorVisible:t}=Ho(),{geometry:r,totalHeight:i,readOnly:a,pageCount:c,card:l,setSelectedId:u}=lt();return f.jsxs("div",{className:`${pA["portal-wrapper"]} card-workspace`,id:"uni-answer-sheet","data-mode":a?"preview":"edit",children:[f.jsx(vR,{width:r.width,height:i,onBackgroundClick:()=>u(null),children:f.jsx(gN,{})}),f.jsx(lN,{}),f.jsx(yR,{summary:`${c} 页 · ${l.blocks.length} 个题块`}),t&&f.jsx(SR,{})]})},Po=t=>structuredClone(t),dx=t=>{const r=Po(t);return delete r.recognitionData,r};function fx(){return new Promise(t=>{const r=()=>{clearTimeout(a),cancelAnimationFrame(i),t()},i=requestAnimationFrame(r),a=setTimeout(r,50)})}function xN(t,r,i,a,c){i.initialValue&&Tu(i.initialValue,r);let l=i,u=i.initialValue&&dx(i.initialValue),d=0,m,p,C=!1,g;const x=nC.createRoot(t,{onUncaughtError:c});function b({readOnly:O}){const _=lt();return E.useLayoutEffect(()=>{m=_,a()}),E.useEffect(()=>{_.setReadOnly(!!O)},[O]),E.useEffect(()=>{if(p===_.card)return;const k=!p;p=_.card,k||l.onChange?.(Po(_.card))},[_.card]),null}const v=()=>{if(C||!m)throw new Error("制卡实例尚未就绪或已经销毁");return m},S=(O,_,k)=>({code:O,path:"",message:_,...k}),w=async()=>{const O=Date.now()+8e3;let _="",k=0,L="LAYOUT_PENDING";for(;Date.now()<O;){await fx();const B=v();if(!t.isConnected||t.clientWidth<100||t.clientHeight<100)return{value:B,issues:[S("LAYOUT_UNAVAILABLE","请显示制卡容器并为其设置有效的宽高后再保存")]};const z=[...new Set(B.editors.current.values())].map(q=>q.getStatus());L=z.some(q=>q.composing||q.uploading)?"EDITOR_BUSY":"LAYOUT_PENDING";const U=z.every(q=>q.ready&&!q.composing&&!q.uploading&&!q.layoutPending);if(U&&B.editingQuestionId&&!B.card.questionCard){B.finishQuestionEditing(),k=0;continue}const K=B.paperBlocks.every(q=>{const H=B.measurements[q.id];return H&&Math.abs(H.width-B.geometry.columnWidth)<1&&H.height>0})&&(!B.card.paperTitle||B.titleMeasurement?.id===B.card.paperTitle.id&&Math.abs(B.titleMeasurement.width-B.geometry.titleWidth)<1),$=Array.from(t.querySelectorAll("img[src], img[srcset]")).filter(q=>q.getClientRects().length),ee=$.every(q=>q.complete),G=JSON.stringify([B.card,B.measurements,B.titleMeasurement,B.placements]);if(U&&K&&ee&&document.fonts.status==="loaded"&&G===_?k++:k=0,_=G,k>=4){const q=[];return z.forEach(H=>{H.uploadError&&q.push(S("IMAGE_UPLOAD_FAILED",H.uploadError))}),$.some(H=>!H.naturalWidth)&&q.push(S("IMAGE_LOAD_FAILED","有图片加载失败,请检查图片地址")),B.titleOverflow&&q.push(S("TITLE_OVERFLOW","纸面标题超出可用区域",{path:"paperTitle"})),B.overflowById.forEach((H,P)=>q.push(S("CONTENT_OVERFLOW","内容超出一张纸,请调整未排入纸张的题块后再保存",{path:"blocks",blockId:P}))),B.paperRoot.current?.querySelectorAll(".rt-content").forEach(H=>{if(!H.getClientRects().length||H.closest("[hidden]"))return;const P=H.closest("[data-block-id]")?.dataset.blockId,A=P&&B.placementById.get(P);(!A||A.fragments.length===1)&&H.scrollWidth>H.clientWidth+2&&q.push(S("CONTENT_OVERFLOW","内容超过输入区域宽度",{path:"blocks",...P?{blockId:P}:{}}))}),{value:B,issues:q}}}return{value:v(),issues:[S(L,L==="EDITOR_BUSY"?"输入法输入或图片上传尚未结束,请完成后再保存":"字体、图片或分页尚未稳定,请稍后重试")]}},T=async()=>{try{const{issues:O,value:_}=await w(),L=[...qS(_.card,r).issues,...O];let B;if(!L.length)try{B=_.getRecognitionData()}catch(z){L.push(S(z instanceof Er?z.code:"RECOGNITION_FAILED",z instanceof Error?z.message:"识别坐标生成失败"))}return{value:_,recognitionData:B,result:{valid:L.length===0,issues:L}}}catch(O){if(C)throw O;return{value:v(),result:{valid:!1,issues:[S("EDITOR_ERROR",O instanceof Error?O.message:"编辑器或数据校验失败")]}}}},j=async()=>(await T()).result,N=()=>g||(g=(async()=>{const{result:O,value:_,recognitionData:k}=await T();if(v(),!O.valid)return{ok:!1,issues:O.issues};try{return{ok:!0,data:Po({..._.card,..._.getReferenceData(),recognitionData:k})}}catch(L){return{ok:!1,issues:[S("EXPORT_FAILED",L instanceof Error?L.message:"题卡数据转换失败")]}}})().finally(()=>{g=void 0})),M=()=>x.render(f.jsx(mA,{children:f.jsxs(IR,{editorPlugin:r,uploadImage:l.uploadImage,dictionaries:l.dictionaries,initialValue:u,onSave:()=>{v().setSaveMessage("正在校验…"),N().then(O=>{v().setSaveMessage(O.ok?"已生成保存数据":O.issues[0].message),l.onSave?.(O)}).catch(O=>{C||v().setSaveMessage("保存失败"),l.onError?.(O)})},children:[f.jsx(b,{readOnly:l.readOnly}),f.jsx(yN,{})]},d)}));M();const D=async O=>{Tu(O,r);const _=dx(O);v(),u=_;const k=++d;Xr.flushSync(M);const L=Date.now()+8e3;do{await fx();const B=v();if(k!==d)throw new DOMException("回显已被另一张题卡替换","AbortError");if([...B.editors.current.values()].every(z=>z.getStatus().ready))return}while(Date.now()<L);throw new Error("题卡数据已载入,但编辑器未能及时就绪")};return{isReady:()=>!!m&&!C,getDocument:()=>Po(v().card),setDocument:D,newDocument:O=>D(yu(O)),getReferenceData:()=>Po(v().getReferenceData()),setReferenceData:O=>D({...v().card,blocks:Q0(Po(O),r.html)}),validate:j,save:N,async getRecognitionData(){const O=await T();if(!O.result.valid)throw new ha(O.result.issues);return Po(O.recognitionData)},focusIssue:O=>{if(!O.blockId)return;const _=v();_.overflowById.has(O.blockId)?_.openDraft(O.blockId):(_.selectBlock(O.blockId,!0),_.openSettings(O.blockId,!1))},update(O){l=O,M()},destroy(){C||(C=!0,x.unmount(),m=void 0)}}}const bN=Object.freeze(Object.defineProperty({__proto__:null,mountAnswerSheet:xN},Symbol.toStringTag,{value:"Module"}));return rt.AnswerSheetDataError=ha,rt.createAnswerSheet=XS,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"}),rt})({});
|